From 9fc53648d6d30974627e34d473e0872c5bf1761c Mon Sep 17 00:00:00 2001 From: whackur Date: Sat, 25 Jul 2026 21:18:20 +0900 Subject: [PATCH 01/19] refactor: organize viewer source and refresh dependencies --- Cargo.lock | 8 +- docs/architecture.md | 35 +- ...own-Dfs9RUU9.css => Markdown-C8LL_u4z.css} | 2 +- viewer-ui/dist/assets/Markdown-CuElJdJA.js | 35 + viewer-ui/dist/assets/Markdown-Dc2pdrht.js | 35 - viewer-ui/dist/assets/Terminal-K7sK28PK.js | 35 + viewer-ui/dist/assets/Terminal-ewaHgc2M.js | 9 - viewer-ui/dist/assets/index-BU1OaTEg.css | 1 - viewer-ui/dist/assets/index-C5DKumZP.css | 2 + viewer-ui/dist/assets/index-Ck-wCR_a.js | 11 - viewer-ui/dist/assets/index-qkOCcO3M.js | 11 + viewer-ui/dist/index.html | 4 +- viewer-ui/package-lock.json | 1578 ++++++++--------- viewer-ui/package.json | 22 +- viewer-ui/src/components/DiffView.tsx | 4 +- viewer-ui/src/components/FilePane.tsx | 8 +- viewer-ui/src/components/FolderPicker.tsx | 4 +- viewer-ui/src/components/Header.tsx | 2 +- viewer-ui/src/components/LogList.tsx | 2 +- viewer-ui/src/components/ProjectMenu.tsx | 2 +- viewer-ui/src/components/RepoShell.tsx | 6 +- viewer-ui/src/components/Sidebar.tsx | 4 +- viewer-ui/src/components/StatusList.tsx | 8 +- viewer-ui/src/components/TreeList.tsx | 4 +- .../src/{ => components/content}/Markdown.tsx | 0 .../src/{ => components/feedback}/Toaster.tsx | 4 +- viewer-ui/src/{ => components}/icons.tsx | 0 .../{ => components/terminal}/Terminal.tsx | 12 +- .../terminal}/TerminalCell.tsx | 4 +- .../src/{ => hooks/terminal}/usePaneDrag.ts | 4 +- .../{ => hooks/terminal}/useTerminalSocket.ts | 6 +- .../{ => hooks/terminal}/useTerminalViews.ts | 2 +- viewer-ui/src/{ => hooks/ui}/sidebar.ts | 2 +- viewer-ui/src/{ => hooks/ui}/theme.ts | 2 +- viewer-ui/src/{ => hooks/ui}/useHotClock.ts | 4 +- viewer-ui/src/hooks/useRepoDrag.ts | 2 +- viewer-ui/src/hooks/useRepoOrder.ts | 2 +- viewer-ui/src/hooks/useRepoPoll.ts | 4 +- viewer-ui/src/{ => layout}/appLayout.ts | 2 +- viewer-ui/src/{ => lib}/diffLayout.test.ts | 2 +- viewer-ui/src/{ => lib}/diffLayout.ts | 2 +- viewer-ui/src/{ => lib}/fileView.test.ts | 0 viewer-ui/src/{ => lib}/fileView.ts | 2 +- viewer-ui/src/{ => lib}/hot.test.ts | 0 viewer-ui/src/{ => lib}/hot.ts | 0 viewer-ui/src/{ => lib}/paneOrder.test.ts | 0 viewer-ui/src/{ => lib}/paneOrder.ts | 0 viewer-ui/src/{ => lib}/termKeys.test.ts | 0 viewer-ui/src/{ => lib}/termKeys.ts | 0 viewer-ui/src/{ => lib}/terminalLayout.ts | 0 viewer-ui/src/{ => lib}/toast.ts | 0 viewer-ui/src/{ => lib}/tree.ts | 2 +- viewer-ui/src/{ => lib}/utils.ts | 0 viewer-ui/src/main.tsx | 6 +- viewer-ui/src/{ => pages}/App.tsx | 42 +- viewer-ui/src/{ => styles}/index.css | 0 56 files changed, 907 insertions(+), 1031 deletions(-) rename viewer-ui/dist/assets/{Markdown-Dfs9RUU9.css => Markdown-C8LL_u4z.css} (93%) create mode 100644 viewer-ui/dist/assets/Markdown-CuElJdJA.js delete mode 100644 viewer-ui/dist/assets/Markdown-Dc2pdrht.js create mode 100644 viewer-ui/dist/assets/Terminal-K7sK28PK.js delete mode 100644 viewer-ui/dist/assets/Terminal-ewaHgc2M.js delete mode 100644 viewer-ui/dist/assets/index-BU1OaTEg.css create mode 100644 viewer-ui/dist/assets/index-C5DKumZP.css delete mode 100644 viewer-ui/dist/assets/index-Ck-wCR_a.js create mode 100644 viewer-ui/dist/assets/index-qkOCcO3M.js rename viewer-ui/src/{ => components/content}/Markdown.tsx (100%) rename viewer-ui/src/{ => components/feedback}/Toaster.tsx (96%) rename viewer-ui/src/{ => components}/icons.tsx (100%) rename viewer-ui/src/{ => components/terminal}/Terminal.tsx (95%) rename viewer-ui/src/{ => components/terminal}/TerminalCell.tsx (95%) rename viewer-ui/src/{ => hooks/terminal}/usePaneDrag.ts (95%) rename viewer-ui/src/{ => hooks/terminal}/useTerminalSocket.ts (96%) rename viewer-ui/src/{ => hooks/terminal}/useTerminalViews.ts (97%) rename viewer-ui/src/{ => hooks/ui}/sidebar.ts (98%) rename viewer-ui/src/{ => hooks/ui}/theme.ts (98%) rename viewer-ui/src/{ => hooks/ui}/useHotClock.ts (89%) rename viewer-ui/src/{ => layout}/appLayout.ts (91%) rename viewer-ui/src/{ => lib}/diffLayout.test.ts (98%) rename viewer-ui/src/{ => lib}/diffLayout.ts (98%) rename viewer-ui/src/{ => lib}/fileView.test.ts (100%) rename viewer-ui/src/{ => lib}/fileView.ts (91%) rename viewer-ui/src/{ => lib}/hot.test.ts (100%) rename viewer-ui/src/{ => lib}/hot.ts (100%) rename viewer-ui/src/{ => lib}/paneOrder.test.ts (100%) rename viewer-ui/src/{ => lib}/paneOrder.ts (100%) rename viewer-ui/src/{ => lib}/termKeys.test.ts (100%) rename viewer-ui/src/{ => lib}/termKeys.ts (100%) rename viewer-ui/src/{ => lib}/terminalLayout.ts (100%) rename viewer-ui/src/{ => lib}/toast.ts (100%) rename viewer-ui/src/{ => lib}/tree.ts (93%) rename viewer-ui/src/{ => lib}/utils.ts (100%) rename viewer-ui/src/{ => pages}/App.tsx (87%) rename viewer-ui/src/{ => styles}/index.css (100%) diff --git a/Cargo.lock b/Cargo.lock index f1a25dfe..2d304b1b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -261,9 +261,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.3.0" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c89588d05638b5b4594a3348a2d6c20277e43a7f5c5202b05cc56888475a47b8" +checksum = "5add81bb678e6cb321aff7fa0dc7689ad82b112dbc032cea19f91d6b8e3582b9" dependencies = [ "find-msvc-tools", "jobserver", @@ -628,9 +628,9 @@ checksum = "75b325c5dbd37f80359721ad39aca5a29fb04c89279657cffdda8736d0c0b9d2" [[package]] name = "either" -version = "1.16.0" +version = "1.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91622ff5e7162018101f2fea40d6ebf4a78bbe5a49736a2020649edf9693679e" +checksum = "9e5e8f6c15a24b9a3ee5efec809ccd006d3b30e8b3bb63c39af737c7f87daa1d" [[package]] name = "equivalent" diff --git a/docs/architecture.md b/docs/architecture.md index 19b3cbee..f986f0ca 100644 --- a/docs/architecture.md +++ b/docs/architecture.md @@ -487,39 +487,46 @@ snapshot worker는 매 폴 사이클마다 현재 HEAD oid를 함께 보고한 미러가 TUI 화면을 그대로 반사하는 것과 달리, 뷰어는 **같은 데이터 계층을 읽어 DOM으로 렌더하는 두 번째 프론트엔드**다. `App`/`ui`/`input`을 전혀 참조하지 않으며, 그래서 TUI 없이도(`nightcrow serve`) 동작한다. 별도 포트·별도 쿠키·별도 비밀번호를 쓴다 — 셋 중 하나라도 공유하면 분리가 형식적인 것이 된다. +`viewer-ui/src`는 화면 조립과 재사용 단위를 분리한다. `pages/`는 화면 조립, +`components/`는 재사용 UI(terminal/content/feedback 하위 도메인 포함), `hooks/`는 +UI·터미널·저장소 상태, `lib/`는 API 이외의 순수 도메인/레이아웃 유틸리티, +`styles/`는 전역 스타일을 담당한다. `public/`의 SVG는 웹 미러가 `include_str!`로 +직접 포함하는 정적 자산이므로 번들 소스와 분리해 유지한다. `api/`는 서버 wire +계약과 HTTP 클라이언트를 별도로 유지한다. + - **요청 처리 순서가 설계다** (`viewer/server.rs`): ① Host → ② Origin → ③ 정적 번들(인증 불필요) → ④ 인증 → ⑤ 저장소 조회 → ⑥ 경로 검증. Host 검사가 Origin보다 앞이자 별개인 이유: `origin_allowed`는 Origin과 Host가 *일치한다*는 것만 증명하는데, DNS rebinding 공격자는 둘 다 통제하므로 그 조건을 자명하게 만족시킨다. loopback 바인딩일 때 non-loopback Host를 거부해야 rebinding으로 얻는 same-origin 발판이 막힌다(off-loopback이면 운영자가 네트워크 경로를 책임지므로 적용하지 않는다). 인증을 조회보다 **먼저** 하는 이유는, 그러지 않으면 미인증 클라이언트가 404와 401을 비교해 존재하는 repo id를 열거할 수 있기 때문이다. 정적 번들이 인증 앞에 오는 이유는 그것이 로그인 폼을 그리는 주체이기 때문 — 게이팅하면 로그인할 방법 자체가 사라진다. - **경로 검증은 `with_repo` 한 곳에서** 한다. 라우트마다 쓰면 빠뜨린다: 실제로 `/api/diff`가 `../../etc/passwd`를 받아들였다. `load_file_diff`는 경로를 파일이 아니라 git pathspec으로 넘겨 검증기에 닿지 않았고, 빈 hunk와 함께 공격자의 경로를 그대로 되돌려줬다. **라우트가 "어떤 로더를 호출하느냐"에 따라 우연히 안전해서는 안 된다.** - **저장소는 opaque id로만 지정**한다(`catalog.rs`). 클라이언트가 디렉토리를 이름 붙일 수 없으므로 "어느 저장소인가"는 검증할 입력이 아니라 성공하거나 404가 되는 조회다. id는 프로세스 수명 동안 안정적이라, 무관한 탭을 열고 닫아도 다른 id가 재배치되지 않는다. - **저장소별 런타임**(`runtime.rs`): `SnapshotChannel`은 단일 consumer `mpsc`라 TUI 것을 공유할 수 없어 자기 것을 띄운다. 스냅샷을 wire 페이로드로 한 번만 줄여 팬아웃한다. **팬아웃은 conflate**된다 — 느린 구독자는 최신 상태를 받지, 밀린 과거를 재생하지 않는다(슬롯 1개 + 1-depth 병합 wakeup). 소켓 I/O 중 락을 잡지 않는다. 페이로드가 직전과 동일하면 발행하지 않는다: producer는 변화가 아니라 타이머로 tick하므로, 그러지 않으면 유휴 저장소가 매초 스트리밍하며 seq를 태워 "뭔가 바뀌었나"의 지표로 쓸 수 없게 된다. - **터미널**(`terminal.rs`)은 TUI 패인과 **별개 세션**이다. 공유하려면 `App`에 손을 대야 하고 그러면 헤드리스가 깨진다. raw PTY 바이트를 서버측 VT 에뮬레이션 없이 그대로 보낸다(xterm.js가 이미 에뮬레이터다). 4바이트 LE pane id를 앞에 붙인 **바이너리 프레임** — PTY 읽기는 멀티바이트 시퀀스를 일상적으로 쪼개므로 JSON으로 조기 디코딩하면 브라우저가 재조립하기 전에 깨진다. **출력은 conflate하지 않고 큐잉**한다: 최신 status는 완결된 그림이지만 터미널 바이트는 하나만 빠져도 스트림이 깨지므로, 큐를 넘긴 클라이언트는 조용히 버리지 않고 끊는다. -- **터미널 pane 순서는 hub가 authoritative하다**(`terminal.rs::reorder_panes`, `viewer-ui/src/paneOrder.ts`). 클라이언트가 pane 헤더를 드래그하면 원하는 전체 순서를 `reorder`로 보내고, hub는 그것을 살아있는 pane에 맞춰 재조정한 뒤(`canonical_order`: 요청 순서 중 실재하는 id를 먼저, 요청이 빠뜨린 live pane은 현재 순서로 뒤에, 모르는 id·중복은 버림) canonical 순서를 `reordered`로 **전 클라이언트에 broadcast**한다. 클라이언트는 낙관적으로 미리 바꾸지 않고 이 echo를 받아 반영해(`reconcileOrder`, create/close와 같은 패턴) 여러 기기가 한 순서로 수렴한다. **순서는 hub의 pane Vec에 살아서** 재접속 replay(`connect`가 그 순서대로 `Created`를 재생)와 다른 기기가 자동으로 따라온다 — 디스크에는 쓰지 않는다. 서버 재시작은 pane 자체를 파기하고 빈 패널로 복귀하므로 영속화할 상태가 없다. DnD는 HTML5 drag가 아니라 pointer 이벤트라(sidebar divider와 같은 선택) 폰 터치도 마우스와 동일하게 동작한다. 재정렬은 pane id·scrollback·PTY를 건드리지 않고 그리드 배치만 바꾸므로 터미널이 끊기지 않는다. -- **프로젝트 탭 순서도 서버가 authoritative하다**(`catalog.rs::reorder`, `POST /api/repos/order`, `viewer-ui/src/App.tsx`). 헤더 탭을 pointer로 드래그하면(pane 헤더·sidebar divider와 같은 선택이라 폰 터치도 동일) 원하는 id 순서를 보내고, 서버가 그것을 live repo에 맞춰 canonical화한 뒤(pane의 `canonical_order`와 동형 — 재사용한 `reconcileOrder`/`reorderByDrop`을 pane number·repo string 양쪽에 쓰도록 제네릭화) 갱신된 목록을 돌려준다. **pane과 다른 점은 전송 채널이다**: repo 목록에는 전용 WebSocket이 없고 `/api/repos` 폴링뿐이라, broadcast 대신 REST로 순서를 갱신하고 다음 폴링이 그것을 받는다. **순서가 `rebuild`를 견디게** `Catalog`에 명시적 `order` overlay를 두어, `union_paths`가 base+added 자연 순서를 그 위에 정렬한다(순서에 없는 새 repo는 끝에). 폴링이 드래그 직후의 옛 순서를 늦게 들고 와 스냅백하는 것은 세 겹으로 막는다: accent·sidebar 폭과 같은 write-generation 가드(`repoOrderWrites`), 드래그 중 차단(`repoDraggingRef`), 그리고 **reorder POST가 in-flight/큐에 있는 동안 폴링이 순서를 채택하지 않는** pending 가드다(마지막 것이 "카운터는 올랐지만 POST 커밋 전 서버를 읽은 폴링이 generation은 일치하는" 창을 닫는다). 가드가 걸린 폴링은 서버 순서를 버리되 membership(다른 기기의 open/close)은 `reconcileOrder`로 받아들인다. **reorder POST는 클라이언트에서 직렬화**한다(한 번에 하나, 큐에는 최신 순서만) — 두 POST가 별도 커넥션이라 서버 처리 순서가 보장되지 않아, 병렬로 쏘면 서버가 옛 요청을 나중에 커밋해 잘못된 순서로 영속할 수 있기 때문이다. **남는 transient 하나**: 커밋 전 서버를 읽었지만 POST가 정착한 뒤 도착하는 폴링은 여전히 한 번 스냅백할 수 있다 — accent·sidebar 폭이 받아들이는 것과 같은 자기교정(다음 폴링) transient라 서버 revision을 도입하지 않는다(그 둘과 일관된 단순 poll 동기화를 유지). **영속은 open/close와 같은 경계**를 따른다: headless `serve`(`persist=true`)면 `catalog.paths()`가 `workspace.json`의 탭 순서로 저장돼 재시작·다른 기기에 유지되고, TUI 동반 실행에서는 세션 한정이다(그 파일의 주인이 TUI라서). 저장 시 `persist_workspace`는 `ws.active`를 인덱스가 아니라 **이전 활성 path 기준으로 재매핑**한다 — 순서가 바뀌면 같은 인덱스가 다른 repo를 가리키므로, 다음 TUI 실행이 엉뚱한 탭을 활성으로 열지 않게 한다. **한 가지 한계**: `serve`에 `--repo`를 명시하면 그 인자가 시작 순서를 지배해(`main.rs`: "explicit --repo comes first and wins") 그 path들의 저장된 재정렬은 재시작 때 덮인다 — 인자 없는 `serve`(workspace만으로 뜨는 일반적 경우)에서는 저장 순서가 그대로 복원된다. 이는 뷰어 기능이 아니라 기존 startup 우선순위 결정이라 그대로 둔다. 또한 `catalog.reorder`(mutation 락으로 원자적) 자체와 이어지는 `persist_workspace`(파일 IO)는 한 트랜잭션이 아니라, **두 기기가 밀리초 안에 동시에 재정렬하면** 파일이 마지막 라이브 순서보다 한 박자 뒤처질 수 있다(라이브 catalog는 항상 정확, 다음 재정렬이 교정). prefs(accent·폭)의 fire-and-forget 영속 경합과 같은 클래스라, 파일 IO를 catalog 락 안으로 끌어들이는 대신 같은 단순 모델을 유지한다. +- **터미널 pane 순서는 hub가 authoritative하다**(`terminal.rs::reorder_panes`, `viewer-ui/src/lib/paneOrder.ts`). 클라이언트가 pane 헤더를 드래그하면 원하는 전체 순서를 `reorder`로 보내고, hub는 그것을 살아있는 pane에 맞춰 재조정한 뒤(`canonical_order`: 요청 순서 중 실재하는 id를 먼저, 요청이 빠뜨린 live pane은 현재 순서로 뒤에, 모르는 id·중복은 버림) canonical 순서를 `reordered`로 **전 클라이언트에 broadcast**한다. 클라이언트는 낙관적으로 미리 바꾸지 않고 이 echo를 받아 반영해(`reconcileOrder`, create/close와 같은 패턴) 여러 기기가 한 순서로 수렴한다. **순서는 hub의 pane Vec에 살아서** 재접속 replay(`connect`가 그 순서대로 `Created`를 재생)와 다른 기기가 자동으로 따라온다 — 디스크에는 쓰지 않는다. 서버 재시작은 pane 자체를 파기하고 빈 패널로 복귀하므로 영속화할 상태가 없다. DnD는 HTML5 drag가 아니라 pointer 이벤트라(sidebar divider와 같은 선택) 폰 터치도 마우스와 동일하게 동작한다. 재정렬은 pane id·scrollback·PTY를 건드리지 않고 그리드 배치만 바꾸므로 터미널이 끊기지 않는다. +- **프로젝트 탭 순서도 서버가 authoritative하다**(`catalog.rs::reorder`, `POST /api/repos/order`, `viewer-ui/src/pages/App.tsx`). 헤더 탭을 pointer로 드래그하면(pane 헤더·sidebar divider와 같은 선택이라 폰 터치도 동일) 원하는 id 순서를 보내고, 서버가 그것을 live repo에 맞춰 canonical화한 뒤(pane의 `canonical_order`와 동형 — 재사용한 `reconcileOrder`/`reorderByDrop`을 pane number·repo string 양쪽에 쓰도록 제네릭화) 갱신된 목록을 돌려준다. **pane과 다른 점은 전송 채널이다**: repo 목록에는 전용 WebSocket이 없고 `/api/repos` 폴링뿐이라, broadcast 대신 REST로 순서를 갱신하고 다음 폴링이 그것을 받는다. **순서가 `rebuild`를 견디게** `Catalog`에 명시적 `order` overlay를 두어, `union_paths`가 base+added 자연 순서를 그 위에 정렬한다(순서에 없는 새 repo는 끝에). 폴링이 드래그 직후의 옛 순서를 늦게 들고 와 스냅백하는 것은 세 겹으로 막는다: accent·sidebar 폭과 같은 write-generation 가드(`repoOrderWrites`), 드래그 중 차단(`repoDraggingRef`), 그리고 **reorder POST가 in-flight/큐에 있는 동안 폴링이 순서를 채택하지 않는** pending 가드다(마지막 것이 "카운터는 올랐지만 POST 커밋 전 서버를 읽은 폴링이 generation은 일치하는" 창을 닫는다). 가드가 걸린 폴링은 서버 순서를 버리되 membership(다른 기기의 open/close)은 `reconcileOrder`로 받아들인다. **reorder POST는 클라이언트에서 직렬화**한다(한 번에 하나, 큐에는 최신 순서만) — 두 POST가 별도 커넥션이라 서버 처리 순서가 보장되지 않아, 병렬로 쏘면 서버가 옛 요청을 나중에 커밋해 잘못된 순서로 영속할 수 있기 때문이다. **남는 transient 하나**: 커밋 전 서버를 읽었지만 POST가 정착한 뒤 도착하는 폴링은 여전히 한 번 스냅백할 수 있다 — accent·sidebar 폭이 받아들이는 것과 같은 자기교정(다음 폴링) transient라 서버 revision을 도입하지 않는다(그 둘과 일관된 단순 poll 동기화를 유지). **영속은 open/close와 같은 경계**를 따른다: headless `serve`(`persist=true`)면 `catalog.paths()`가 `workspace.json`의 탭 순서로 저장돼 재시작·다른 기기에 유지되고, TUI 동반 실행에서는 세션 한정이다(그 파일의 주인이 TUI라서). 저장 시 `persist_workspace`는 `ws.active`를 인덱스가 아니라 **이전 활성 path 기준으로 재매핑**한다 — 순서가 바뀌면 같은 인덱스가 다른 repo를 가리키므로, 다음 TUI 실행이 엉뚱한 탭을 활성으로 열지 않게 한다. **한 가지 한계**: `serve`에 `--repo`를 명시하면 그 인자가 시작 순서를 지배해(`main.rs`: "explicit --repo comes first and wins") 그 path들의 저장된 재정렬은 재시작 때 덮인다 — 인자 없는 `serve`(workspace만으로 뜨는 일반적 경우)에서는 저장 순서가 그대로 복원된다. 이는 뷰어 기능이 아니라 기존 startup 우선순위 결정이라 그대로 둔다. 또한 `catalog.reorder`(mutation 락으로 원자적) 자체와 이어지는 `persist_workspace`(파일 IO)는 한 트랜잭션이 아니라, **두 기기가 밀리초 안에 동시에 재정렬하면** 파일이 마지막 라이브 순서보다 한 박자 뒤처질 수 있다(라이브 catalog는 항상 정확, 다음 재정렬이 교정). prefs(accent·폭)의 fire-and-forget 영속 경합과 같은 클래스라, 파일 IO를 catalog 락 안으로 끌어들이는 대신 같은 단순 모델을 유지한다. - **자원 상한**(`limits.rs`)은 전부 `truncated`로 보고된다. 잘린 목록이 전체인 척하지 않는다. - **wire 계약은 fixture로 고정한다**(`dto.rs::wire_fixture` → `viewer-ui/api.fixture.json` → `api.contract.test.ts`). Rust DTO와 TS interface가 같은 프로토콜을 손으로 두 번 적고 있어, 한쪽만 고치면 화면이 조용히 빈 값으로 렌더된다. `PROTOCOL_VERSION`은 **의도적인** 호환성 단절을 알릴 뿐 실수를 잡지 못한다. 그래서 서버가 모든 페이로드의 예시를 하나씩 만들어 fixture에 굽고(`UPDATE_API_FIXTURE=1 cargo test the_wire_fixture`), 커밋한 뒤, TS 테스트가 그 JSON을 각 interface에 **대입**한다 — 검사는 `expect`가 아니라 타입 주석이 하고, `npm run build`의 `tsc -b`에서 실패한다. Rust 쪽 변경은 fixture diff로, TS 쪽 미반영은 컴파일 실패로 드러나는 **쌍**이 핵심이다. optional 필드는 있는 경우와 없는 경우를 모두 fixture에 넣어 `skip_serializing_if`가 멈춘 것도 보이게 한다. **필드 추가는 TS 쪽에서 잡히지 않는다**(interface가 언급하지 않는 속성은 대입을 막지 않는다) — 그건 Rust fixture assertion이 잡고, 그게 사람을 `api.ts`로 보낸다. codegen(`ts-rs` 등)을 쓰지 않은 이유는 의존성과 빌드 단계가 늘어나는 데 비해 이 규모에서 얻는 게 fixture 한 장과 같기 때문이다. - **commit log는 anchor에 고정해 페이지로 받는다**(`/api/log`, `diff.rs::load_commit_log_from`). 클라이언트가 목록 끝에 다다르면 다음 페이지를 요청한다(`IntersectionObserver` 센티넬 — TUI가 커서가 tail에 가까워지면 prefetch하는 것의 웹 대응물). 페이지 크기는 `MAX_LOG_PAGE = 100`으로 TUI의 `commit_log_page_size` 기본값과 맞췄다. **`skip`만으로 페이지를 나누지 않는 이유**: skip은 한 walk 안의 offset이라, 페이지 사이에 커밋이 생기면 이후 offset이 전부 밀려 중복·누락이 생긴다 — 바로 아래 터미널 패널에서 커밋하는 것이 이 뷰어의 일상이다. 그래서 첫 응답이 walk 시작 커밋을 `head`로 실어 보내고, 이후 요청은 `from=`로 그 지점에 고정한다(`revwalk.push(oid)`). `from`이 잘못된 oid면 HEAD로 조용히 넘어가지 않고 400이다 — 클라이언트가 돌려받은 값으로 페이지를 이어가므로, 다른 질문에 답하면 목록이 어긋난다. **"더 있는가"는 한 페이지보다 1개 더 요청해 판정한다**: 정확히 한 페이지를 가져와 같은 수로 capping하면 `truncated`가 참이 될 수 없어, 이전 구현은 히스토리 길이와 무관하게 항상 `false`를 보고했다. **`skip`에는 상한을 두지 않는다.** skip은 revwalk의 `Iterator::skip`이라 한 요청의 순회량은 `skip + page`와 히스토리 길이 중 **작은 쪽**으로 이미 제한된다 — 터무니없는 값을 보내도 저장소를 한 번 걷는 비용이 천장이다. 그 이상을 상한으로 막는 것은 이 서버에서 의미가 없다: 여기까지 온 클라이언트는 **이미 인증을 통과해 대화형 셸을 받은 상태**라(`/ws/term`), 그가 서버에 시킬 수 있는 일 중 revwalk 한 번은 가장 가벼운 축이다. 인증이 신뢰 경계이고, 그 뒤에서 자원 사용을 다투는 것은 방어가 아니라 불편일 뿐이다. 반면 상한은 실질적 손해를 만든다 — 클라이언트에게 "더 있다"고 알린 페이지를 영영 못 주는 상태가 생긴다. **알려진 대가**: 페이지 i는 앞의 `i × MAX_LOG_PAGE`개를 다시 건너뛰므로 끝까지 훑는 총비용이 히스토리 길이에 제곱으로 는다. anchor별 서버측 스냅샷을 캐시하면 없앨 수 있지만, 요청마다 상태가 없다는 이 서버의 성질(TTL·메모리·축출)을 포기해야 한다. 스크롤로 도달하는 깊이에서 페이지당 비용이 밀리초 단위라 그 교환은 하지 않았다. **커서(마지막 커밋 oid에서 다시 walk) 방식은 채택하지 않았다**: 병합 히스토리에서 특정 커밋부터 walk하면 그 커밋의 *조상만* 나오므로, HEAD 기준 날짜순 walk에 끼어 있던 병렬 브랜치의 커밋이 영구히 누락된다. anchor+skip은 같은 walk의 offset이라 그 문제가 없다. **자동 페이징은 렌더된 행 수에 반응한다**(`visibleCommits.length`): `IntersectionObserver`는 intersection *변화*만 보고하는데 페이지가 붙어도 센티넬이 제자리에 남을 수 있어 매 페이지마다 재관찰해야 한다. **필터가 걸린 동안에는 페이징을 멈춘다**: log 필터는 *로드된 것*을 좁히는 것이지 서버 검색이 아니므로, 매치를 찾아 히스토리 전체를 페이지 단위로 걸어 들어가면 안 된다. "보이는 행 수" 기준만으로는 부족하다 — 페이지마다 매치가 하나라도 있으면 계속 재무장되어 결국 전체를 훑는다. 센티넬 자리에는 "로드된 N개를 필터 중, 더 보려면 필터를 지우라"는 행을 그린다. 그러지 않으면 필터된 목록의 끝과 히스토리의 끝이 구분되지 않는다. **페이지 실패는 `logDone`이 아니라 `logStalled`다**: 둘을 합치면 일시적 오류가 히스토리의 끝으로 보고되고, footer 에러는 다음 폴링에 지워져 목록이 짧아진 흔적조차 남지 않는다. 실패 시 센티넬 대신 retry 행을 그린다(요청 폭주도 함께 막힌다). **로그는 탭 진입 시점의 스냅샷이다** — TUI와 달리 HEAD 변경을 감지해 자동 갱신하지 않으며, 탭을 떠나면 페이지가 버려지고 다시 들어올 때 새로 받는다. anchor 고정이 이 성질과 맞물려, 표시 중인 목록과 이어받는 페이지가 같은 히스토리를 가리킨다. - **`GET /api/repos`는 부트스트랩이다**(`dto.rs::ViewerBootstrapDto`). 저장소 목록에 `hot` 설정·`accent`·`now_ms`가 차례로 얹히면서, 이 응답은 실질적으로 "클라이언트가 렌더를 시작하기 전에 서버와 맞춰야 하는 것 전부"가 됐다. 서버 전역 값에 각각 엔드포인트를 주지 않는 이유는 **클라이언트가 이미 3초마다 이걸 폴링하기 때문**이다 — 새 필드는 감시할 대상을 늘리지 않고 한 폴링 안에 모든 기기로 퍼진다. 반대로 `/api/status`에 얹지 않는 이유는 그쪽이 바이트 동일성으로 dedup되는 hot 스트림이라 설정이 낄 자리가 아니기 때문이다. 경로는 `/api/repos`로 두는데 `POST`(열기)·`DELETE`(닫기)가 같은 자원을 쓰기 때문이고, 페이로드의 실제 역할은 타입 이름에 적는다. 필드는 Rust `ViewerBootstrapDto`와 TS `ViewerBootstrap` 양쪽에 있어야 하며, 이름·타입이 어긋나면 아래 계약 테스트가 잡는다(추가만 한 경우는 잡히지 않는다 — 같은 항목의 한계 참조). -- **프론트엔드**(`viewer-ui/`): React 19 + Vite 7 + Tailwind v4 + `@xterm/xterm`. shadcn/ui는 쓰지 않는다 — 기본 톤이 TUI 밀도와 맞지 않아 덮어쓸 것이 더 많았다. `dist/`를 커밋해 `cargo install`에 Node를 요구하지 않는다(build.rs에서 npm을 부르면 Node 없는 설치가 전부 깨진다). CI가 재빌드해 커밋된 번들과 다르면 실패시킨다. -- **사이드바 목록은 잘라내지 않고 가로로 스크롤한다**(`viewer-ui/src/App.tsx`). status/log/tree 목록은 TUI가 `ui/mod.rs`의 `char_offset`으로 긴 경로와 커밋 summary를 좌우로 미는 것과 같은 접근을 취한다. `truncate`를 쓰지 않는 이유는 두 행을 구분하는 것이 대개 경로의 **꼬리**이기 때문이다 — `src/web/viewer/server.rs`와 `terminal.rs`는 말줄임이 지우는 바로 그 부분에서만 갈린다. 단 TUI와 한 가지가 다르다: TUI는 status 코드나 commit short_id 같은 접두 컬럼을 고정한 채 가변 텍스트만 미는 반면, 뷰어는 **행 전체가 함께 스크롤된다**(VS Code 탐색기와 같은 동작). `position: sticky`로 접두를 고정하는 안은 검토 후 기각했다 — sticky 요소가 자기 배경을 들고 hover 상태까지 따라가야 해서, 얻는 것에 비해 행 렌더링이 복잡해진다. +- **프론트엔드**(`viewer-ui/`): React 19 + TypeScript 7 + Vite 8 + Tailwind v4 + `@xterm/xterm` 6. shadcn/ui는 쓰지 않는다 — 기본 톤이 TUI 밀도와 맞지 않아 덮어쓸 것이 더 많았다. `dist/`를 커밋해 `cargo install`에 Node를 요구하지 않는다(build.rs에서 npm을 부르면 Node 없는 설치가 전부 깨진다). CI가 재빌드해 커밋된 번들과 다르면 실패시킨다. +- **사이드바 목록은 잘라내지 않고 가로로 스크롤한다**(`viewer-ui/src/pages/App.tsx`). status/log/tree 목록은 TUI가 `ui/mod.rs`의 `char_offset`으로 긴 경로와 커밋 summary를 좌우로 미는 것과 같은 접근을 취한다. `truncate`를 쓰지 않는 이유는 두 행을 구분하는 것이 대개 경로의 **꼬리**이기 때문이다 — `src/web/viewer/server.rs`와 `terminal.rs`는 말줄임이 지우는 바로 그 부분에서만 갈린다. 단 TUI와 한 가지가 다르다: TUI는 status 코드나 commit short_id 같은 접두 컬럼을 고정한 채 가변 텍스트만 미는 반면, 뷰어는 **행 전체가 함께 스크롤된다**(VS Code 탐색기와 같은 동작). `position: sticky`로 접두를 고정하는 안은 검토 후 기각했다 — sticky 요소가 자기 배경을 들고 hover 상태까지 따라가야 해서, 얻는 것에 비해 행 렌더링이 복잡해진다. -- **accent는 브라우저에 산다**(`viewer-ui/src/theme.ts`). 헤더 스와치가 TUI의 ` p`와 같은 순서로 5색을 순환한다. TUI가 ratatui 팔레트 이름 색을 쓰는 것과 달리 브라우저에는 대응물이 없어 hex를 고정하는데, 눈대중이 아니라 기존 amber `#d9a441`(OKLCH L=0.751 C=0.130 h=79.8)의 **명도·채도를 유지한 채 hue만 돌려** 파생시킨다 — 그래야 어느 프리셋을 골라도 ink 스케일 위에서 가독성이 같다. 적용은 root의 `--color-accent` 오버라이드 하나로 끝난다(Tailwind가 accent 유틸리티를 전부 `var(--color-accent)`로 컴파일한다). **저장은 서버(`~/.nightcrow/viewer.json`, `viewer/prefs.rs`), 저장소별이 아니라 뷰어 전역**이다: 뷰어는 폰·노트북 등 여러 기기에서 열리므로 브라우저마다 색을 다시 고르게 하지 않는다. repo id는 프로세스 수명 동안만 안정적이라 저장소별로 키를 잡으면 재시작마다 설정이 사라진다. 전달은 **클라이언트가 이미 3초마다 도는 `/api/repos` 폴링에 얹는다** — 별도 스트림이나 감시할 엔드포인트가 늘지 않고, 한 기기에서 바꾸면 나머지가 한 폴링 안에 따라온다. 쓰기는 `POST /api/prefs`(cross-site가 트리거할 수 없도록 GET이 아닌 POST, 인증 뒤에 배치). 여기서 유일한 순서 문제는 **클릭 직전에 출발한 폴링 응답이 옛 색을 들고 나중에 도착하는 것**이라, `App.tsx`가 로컬 변경 횟수를 세어 자기보다 오래된 응답의 accent만 버린다(나머지 필드는 그대로 쓴다). localStorage는 이제 **첫 페인트 캐시**로만 남는다: CSP가 인라인 스크립트를 막아(`script-src 'self'`) 번들 실행 전에는 칠할 수 없는데, 거기에 폴링 왕복까지 기다리면 매 로드마다 기본 amber가 번쩍인다. TUI 설정(`[theme]`, 저장소별 `accent_idx`)은 건드리지 않는다 — 읽으려면 뷰어가 TUI 설정에 의존하게 되고, 별도 포트·쿠키·비밀번호로 분리해 둔 경계가 흐려진다. +- **accent는 브라우저에 산다**(`viewer-ui/src/hooks/ui/theme.ts`). 헤더 스와치가 TUI의 ` p`와 같은 순서로 5색을 순환한다. TUI가 ratatui 팔레트 이름 색을 쓰는 것과 달리 브라우저에는 대응물이 없어 hex를 고정하는데, 눈대중이 아니라 기존 amber `#d9a441`(OKLCH L=0.751 C=0.130 h=79.8)의 **명도·채도를 유지한 채 hue만 돌려** 파생시킨다 — 그래야 어느 프리셋을 골라도 ink 스케일 위에서 가독성이 같다. 적용은 root의 `--color-accent` 오버라이드 하나로 끝난다(Tailwind가 accent 유틸리티를 전부 `var(--color-accent)`로 컴파일한다). **저장은 서버(`~/.nightcrow/viewer.json`, `viewer/prefs.rs`), 저장소별이 아니라 뷰어 전역**이다: 뷰어는 폰·노트북 등 여러 기기에서 열리므로 브라우저마다 색을 다시 고르게 하지 않는다. repo id는 프로세스 수명 동안만 안정적이라 저장소별로 키를 잡으면 재시작마다 설정이 사라진다. 전달은 **클라이언트가 이미 3초마다 도는 `/api/repos` 폴링에 얹는다** — 별도 스트림이나 감시할 엔드포인트가 늘지 않고, 한 기기에서 바꾸면 나머지가 한 폴링 안에 따라온다. 쓰기는 `POST /api/prefs`(cross-site가 트리거할 수 없도록 GET이 아닌 POST, 인증 뒤에 배치). 여기서 유일한 순서 문제는 **클릭 직전에 출발한 폴링 응답이 옛 색을 들고 나중에 도착하는 것**이라, `App.tsx`가 로컬 변경 횟수를 세어 자기보다 오래된 응답의 accent만 버린다(나머지 필드는 그대로 쓴다). localStorage는 이제 **첫 페인트 캐시**로만 남는다: CSP가 인라인 스크립트를 막아(`script-src 'self'`) 번들 실행 전에는 칠할 수 없는데, 거기에 폴링 왕복까지 기다리면 매 로드마다 기본 amber가 번쩍인다. TUI 설정(`[theme]`, 저장소별 `accent_idx`)은 건드리지 않는다 — 읽으려면 뷰어가 TUI 설정에 의존하게 되고, 별도 포트·쿠키·비밀번호로 분리해 둔 경계가 흐려진다. -- **diff는 unified/split 두 레이아웃을 토글한다**(`viewer-ui/src/diffLayout.ts`). diff pane 헤더의 버튼이 TUI의 `DiffPaneView::{Diff, Split}`(diff pane focus에서 `s` → `diff_load.rs::toggle_diff_split_view`)와 같은 전환을 준다. 페어링은 백엔드를 건드리지 않는다 — JSON `Diff` payload가 이미 라인별 `kind`(`+`/`-`/context)와 하이라이트 span을 담고 있어, `splitHunkRows`가 TUI의 `split_rows`/`flush_split_blocks`(`ui/diff_pane.rs`)를 그대로 포팅해 순서만으로 좌/우 행을 만든다(연속 removed/added를 인덱스별로 짝짓고 짧은 쪽은 blank 셀로 패딩, context는 양쪽 미러링). **저장은 accent와 같은 뷰어 전역 localStorage**다. 좁은 화면에서는 두 코드 열이 함께 읽히지 않으므로, 저장된 선호는 그대로 두되 뷰포트가 `MIN_SPLIT_WIDTH_PX`(768px) 미만이면 `effective`가 unified로 접힌다 — TUI의 `MIN_SPLIT_WIDTH` 폴백(`diff_viewer.rs`)의 웹 대응물이고, 창을 넓히면 선호가 다시 살아난다. 뷰포트 기준으로 판정하는 것은 이 폴백이 지키는 화면(폰)이 전반적으로 좁기 때문 — pane을 `ResizeObserver`로 재는 정밀도는 여기서 얻는 게 없다. +- **diff는 unified/split 두 레이아웃을 토글한다**(`viewer-ui/src/lib/diffLayout.ts`). diff pane 헤더의 버튼이 TUI의 `DiffPaneView::{Diff, Split}`(diff pane focus에서 `s` → `diff_load.rs::toggle_diff_split_view`)와 같은 전환을 준다. 페어링은 백엔드를 건드리지 않는다 — JSON `Diff` payload가 이미 라인별 `kind`(`+`/`-`/context)와 하이라이트 span을 담고 있어, `splitHunkRows`가 TUI의 `split_rows`/`flush_split_blocks`(`ui/diff_pane.rs`)를 그대로 포팅해 순서만으로 좌/우 행을 만든다(연속 removed/added를 인덱스별로 짝짓고 짧은 쪽은 blank 셀로 패딩, context는 양쪽 미러링). **저장은 accent와 같은 뷰어 전역 localStorage**다. 좁은 화면에서는 두 코드 열이 함께 읽히지 않으므로, 저장된 선호는 그대로 두되 뷰포트가 `MIN_SPLIT_WIDTH_PX`(768px) 미만이면 `effective`가 unified로 접힌다 — TUI의 `MIN_SPLIT_WIDTH` 폴백(`diff_viewer.rs`)의 웹 대응물이고, 창을 넓히면 선호가 다시 살아난다. 뷰포트 기준으로 판정하는 것은 이 폴백이 지키는 화면(폰)이 전반적으로 좁기 때문 — pane을 `ResizeObserver`로 재는 정밀도는 여기서 얻는 게 없다. -- **사이드바 너비는 divider 드래그로 조절한다**(`viewer-ui/src/sidebar.ts`). 파일 목록과 diff pane 사이 경계에 얇은 핸들을 두고, 드래그하면 pointer의 사이드바 왼쪽 모서리 기준 거리로 폭을 잡는다(원점은 드래그 시작에 한 번만 재서, 중간 re-layout이 pointer 아래로 원점을 옮기지 못하게 한다). **저장은 accent와 같은 서버 전역**(`~/.nightcrow/viewer.json`, `prefs.rs`)이라 폰·노트북이 같은 split으로 열리고, 첫 페인트 캐시로 localStorage도 함께 쓴다. **저장값은 절대 `[280, 720]px`뿐**(서버가 방어, `adopt`/load도 이 범위로만 clamp)이라, 넓은 화면에서 정한 폭이 좁은 화면에서 읽혀도 잘려 사라지지 않는다. **뷰포트 50% 상한은 표시에만 건다** — grid track이 `min(px, 50vw)`라 창이 좁아지면 폴링이나 드래그를 기다리지 않고 즉시 diff pane이 최소 절반을 지키고, 넓히면 저장값까지 곧바로 회복한다(폰에서 실제로 걸리는 건 이 비율, 큰 모니터에서 720px). 드래그 입력(`resize`)에도 같은 50% 상한을 걸어 divider가 pointer를 놓치지 않게 한다. 드래그 중에는 로컬 상태만 갱신해 pixel마다 요청하지 않고, 놓는 순간(`commit`) 한 번 `POST /api/prefs`로 쓴다 — 단 **가로로 유의미하게(≥`SIDEBAR_DRAG_THRESHOLD_PX`) 움직였을 때만** 커밋한다. 순수 클릭이나 세로 흔들림은 커밋하지 않는데, 표시폭이 `50vw`로 잘린 상태에서 그런 입력이 잘린 값을 절대 저장값에 덮어쓰는 걸 막기 위해서다. 순서 문제는 accent와 같은 방식으로 막는다 — 드래그 직전 출발한 폴링이 옛 폭을 늦게 들고 오면 스냅백하므로 `App.tsx`가 로컬 쓰기 횟수를 세어 자기보다 오래된 응답의 width를 버리고, 드래그가 살아 있는 동안(`draggingRef`)은 어떤 폴링도 채택하지 않는다. **남는 한계도 accent와 동일**하다: 쓰기는 fire-and-forget이라 커밋 직후 POST가 서버에 닿기 전 출발한 폴링 한 번은 옛 폭을 읽어 잠깐 스냅백할 수 있고(다음 폴링이 교정), 빠른 두 드래그의 POST가 역순 도착하면 서버가 옛 값으로 남을 수 있다. 이 전이는 스스로 수렴하고 여러 기기를 동시에 만지는 단일 사용자의 드문 경우라, accent와 같은 단순한 poll 동기화를 유지하려 write-generation/시퀀싱을 넣지 않는다. **divider 더블클릭은 기본 폭(460)으로 복구**한다 — resize 핸들의 관례다. 복구는 뷰포트 캡이 아니라 절대 기본값을 저장해(좁은 화면에서 눌러도 460), 표시는 CSS `min`이 캡한다. 더블클릭은 네이티브 `dblclick` 대신 pointer 핸들러 안에서 판정하는데, 드래그의 `preventDefault`가 합성 click 이벤트를 삼킬 수 있어서다. primary 버튼·완결된(취소 아닌) 클릭 쌍만 인정한다. divider는 md+ 2컬럼 레이아웃에서만 뜬다(그 아래는 스택 단일 컬럼), pane maximize 시엔 숨는다. +- **사이드바 너비는 divider 드래그로 조절한다**(`viewer-ui/src/hooks/ui/sidebar.ts`). 파일 목록과 diff pane 사이 경계에 얇은 핸들을 두고, 드래그하면 pointer의 사이드바 왼쪽 모서리 기준 거리로 폭을 잡는다(원점은 드래그 시작에 한 번만 재서, 중간 re-layout이 pointer 아래로 원점을 옮기지 못하게 한다). **저장은 accent와 같은 서버 전역**(`~/.nightcrow/viewer.json`, `prefs.rs`)이라 폰·노트북이 같은 split으로 열리고, 첫 페인트 캐시로 localStorage도 함께 쓴다. **저장값은 절대 `[280, 720]px`뿐**(서버가 방어, `adopt`/load도 이 범위로만 clamp)이라, 넓은 화면에서 정한 폭이 좁은 화면에서 읽혀도 잘려 사라지지 않는다. **뷰포트 50% 상한은 표시에만 건다** — grid track이 `min(px, 50vw)`라 창이 좁아지면 폴링이나 드래그를 기다리지 않고 즉시 diff pane이 최소 절반을 지키고, 넓히면 저장값까지 곧바로 회복한다(폰에서 실제로 걸리는 건 이 비율, 큰 모니터에서 720px). 드래그 입력(`resize`)에도 같은 50% 상한을 걸어 divider가 pointer를 놓치지 않게 한다. 드래그 중에는 로컬 상태만 갱신해 pixel마다 요청하지 않고, 놓는 순간(`commit`) 한 번 `POST /api/prefs`로 쓴다 — 단 **가로로 유의미하게(≥`SIDEBAR_DRAG_THRESHOLD_PX`) 움직였을 때만** 커밋한다. 순수 클릭이나 세로 흔들림은 커밋하지 않는데, 표시폭이 `50vw`로 잘린 상태에서 그런 입력이 잘린 값을 절대 저장값에 덮어쓰는 걸 막기 위해서다. 순서 문제는 accent와 같은 방식으로 막는다 — 드래그 직전 출발한 폴링이 옛 폭을 늦게 들고 오면 스냅백하므로 `App.tsx`가 로컬 쓰기 횟수를 세어 자기보다 오래된 응답의 width를 버리고, 드래그가 살아 있는 동안(`draggingRef`)은 어떤 폴링도 채택하지 않는다. **남는 한계도 accent와 동일**하다: 쓰기는 fire-and-forget이라 커밋 직후 POST가 서버에 닿기 전 출발한 폴링 한 번은 옛 폭을 읽어 잠깐 스냅백할 수 있고(다음 폴링이 교정), 빠른 두 드래그의 POST가 역순 도착하면 서버가 옛 값으로 남을 수 있다. 이 전이는 스스로 수렴하고 여러 기기를 동시에 만지는 단일 사용자의 드문 경우라, accent와 같은 단순한 poll 동기화를 유지하려 write-generation/시퀀싱을 넣지 않는다. **divider 더블클릭은 기본 폭(460)으로 복구**한다 — resize 핸들의 관례다. 복구는 뷰포트 캡이 아니라 절대 기본값을 저장해(좁은 화면에서 눌러도 460), 표시는 CSS `min`이 캡한다. 더블클릭은 네이티브 `dblclick` 대신 pointer 핸들러 안에서 판정하는데, 드래그의 `preventDefault`가 합성 click 이벤트를 삼킬 수 있어서다. primary 버튼·완결된(취소 아닌) 클릭 쌍만 인정한다. divider는 md+ 2컬럼 레이아웃에서만 뜬다(그 아래는 스택 단일 컬럼), pane maximize 시엔 숨는다. -- **마크다운은 렌더 뷰로 연다**(`viewer-ui/src/Markdown.tsx`, `fileView.ts`). tree에서 연 파일 경로가 `.md`/`.markdown`이면 pane 헤더에 rendered/raw 토글이 붙고 기본은 rendered다(세션 한정 상태, diff와 달리 저장하지 않음 — rendered가 일반 경우라 매번 거기서 시작한다). 렌더는 `react-markdown`(+`remark-gfm`, `rehype-highlight`)이 AST를 React 엘리먼트로 만들어 수행한다 — `dangerouslySetInnerHTML`가 없어 별도 sanitize 없이 XSS 표면이 없고, 번들 자체 포함이라 `default-src 'self'` CSP와 맞는다. 원문은 새 API 없이 `/api/file`의 하이라이트 span에서 복원한다(span은 색만 담고 문자를 바꾸지 않으므로 `fileViewSource`의 이어붙이기가 무손실). Terminal처럼 lazy-load라 초기 청크에 remark/highlight.js 파이프라인이 들어가지 않는다. 스타일은 `index.css`의 `.nc-markdown` 스코프, 코드 토큰 색은 컴포넌트가 import하는 highlight.js 테마가 준다. **한계**: 문서 내 외부 이미지는 CSP `default-src 'self'`가 막아 로드되지 않는다(깨진 이미지로 표시). +- **마크다운은 렌더 뷰로 연다**(`viewer-ui/src/components/content/Markdown.tsx`, `fileView.ts`). tree에서 연 파일 경로가 `.md`/`.markdown`이면 pane 헤더에 rendered/raw 토글이 붙고 기본은 rendered다(세션 한정 상태, diff와 달리 저장하지 않음 — rendered가 일반 경우라 매번 거기서 시작한다). 렌더는 `react-markdown`(+`remark-gfm`, `rehype-highlight`)이 AST를 React 엘리먼트로 만들어 수행한다 — `dangerouslySetInnerHTML`가 없어 별도 sanitize 없이 XSS 표면이 없고, 번들 자체 포함이라 `default-src 'self'` CSP와 맞는다. 원문은 새 API 없이 `/api/file`의 하이라이트 span에서 복원한다(span은 색만 담고 문자를 바꾸지 않으므로 `fileViewSource`의 이어붙이기가 무손실). Terminal처럼 lazy-load라 초기 청크에 remark/highlight.js 파이프라인이 들어가지 않는다. 스타일은 `index.css`의 `.nc-markdown` 스코프, 코드 토큰 색은 컴포넌트가 import하는 highlight.js 테마가 준다. **한계**: 문서 내 외부 이미지는 CSP `default-src 'self'`가 막아 로드되지 않는다(깨진 이미지로 표시). -- **hot-file 강조는 mtime을 절대 시각으로 실어 보내고 브라우저가 식힌다**(`viewer-ui/src/hot.ts`). status 목록의 각 파일에 `mtime`(Unix ms)을 붙이고, 클라이언트가 TUI의 `classify_hot`(`ui/file_list.rs`)과 같은 단계로 나눈다(<5s = accent+bold, hot window 내 = accent, 그 밖 = 기본). **나이(age)가 아니라 절대 시각인 이유**: status 페이로드는 바이트 동일성으로 dedup되어 발행되므로, 매 tick 값이 변하는 필드를 넣으면 유휴 저장소가 영구 이벤트 스트림이 된다. 대가로 **두 시계를 맞춰야 한다**: `mtime`은 서버 기계의 시계로 잰 값인데 뷰어는 폰·노트북 등 다른 기기에서 열리고, hot window 기본값은 15초라 몇 초의 어긋남도 눈에 보인다(느린 시계는 과잉 강조, 15초 이상 빠른 시계는 강조가 아예 안 켜진다). 그래서 `/api/repos` 응답에 서버 시각 `now_ms`를 함께 실어 클라이언트가 offset을 계산하고(`hot.ts::nextClockOffset`), 이후 모든 판정을 `Date.now() + offset`으로 한다. **`hot_until`이나 age를 서버가 계산해 보내는 대안은 채택하지 않았다** — age는 위의 dedup을 깨고, `hot_until`은 클라이언트가 여전히 자기 시계와 비교하므로 어긋남을 전혀 줄이지 못한다. offset은 폴링마다 다시 재는데, **첫 측정은 크기와 무관하게 채택하고 이후 `CLOCK_SKEW_EPSILON_MS`(1 tick) 미만의 *변화*만 버린다**(`hot.ts::nextClockOffset`) — epsilon은 네트워크 지터가 매 폴링 fade tick을 재시작시키는 것을 막기 위한 것이지 보정 여부를 정하는 문턱이 아니다. 900ms 어긋난 기기는 실제로 900ms 어긋나 있고 그 차이는 단계 경계에서 드러난다. 보정 후에도 남는 음수 나이는 stat과 타임스탬프 사이의 서브초 순서 문제뿐이라 TUI와 같이 fresh로 saturate한다. 창(window)과 on/off는 `[agent_indicator]` 설정을 `/api/repos` 응답에 실어 전달한다 — 클라이언트에 기본값을 따로 두면 TUI와 조용히 갈라진다. `auto_follow`는 보내지 않는다(키보드 선택 이동은 뷰어에 대응물이 없다). 시간이 지나면 식어야 하므로 목록은 스스로 초당 re-render하는데, **tick은 hot 파일이 있는 스냅샷에서만 시작하고 마지막 파일이 식으면 스스로 멈춘다**. commit 파일 목록에는 `mtime`을 싣지 않는다 — 워킹 트리의 시각은 그 커밋과 무관하다. +- **hot-file 강조는 mtime을 절대 시각으로 실어 보내고 브라우저가 식힌다**(`viewer-ui/src/lib/hot.ts`). status 목록의 각 파일에 `mtime`(Unix ms)을 붙이고, 클라이언트가 TUI의 `classify_hot`(`ui/file_list.rs`)과 같은 단계로 나눈다(<5s = accent+bold, hot window 내 = accent, 그 밖 = 기본). **나이(age)가 아니라 절대 시각인 이유**: status 페이로드는 바이트 동일성으로 dedup되어 발행되므로, 매 tick 값이 변하는 필드를 넣으면 유휴 저장소가 영구 이벤트 스트림이 된다. 대가로 **두 시계를 맞춰야 한다**: `mtime`은 서버 기계의 시계로 잰 값인데 뷰어는 폰·노트북 등 다른 기기에서 열리고, hot window 기본값은 15초라 몇 초의 어긋남도 눈에 보인다(느린 시계는 과잉 강조, 15초 이상 빠른 시계는 강조가 아예 안 켜진다). 그래서 `/api/repos` 응답에 서버 시각 `now_ms`를 함께 실어 클라이언트가 offset을 계산하고(`hot.ts::nextClockOffset`), 이후 모든 판정을 `Date.now() + offset`으로 한다. **`hot_until`이나 age를 서버가 계산해 보내는 대안은 채택하지 않았다** — age는 위의 dedup을 깨고, `hot_until`은 클라이언트가 여전히 자기 시계와 비교하므로 어긋남을 전혀 줄이지 못한다. offset은 폴링마다 다시 재는데, **첫 측정은 크기와 무관하게 채택하고 이후 `CLOCK_SKEW_EPSILON_MS`(1 tick) 미만의 *변화*만 버린다**(`hot.ts::nextClockOffset`) — epsilon은 네트워크 지터가 매 폴링 fade tick을 재시작시키는 것을 막기 위한 것이지 보정 여부를 정하는 문턱이 아니다. 900ms 어긋난 기기는 실제로 900ms 어긋나 있고 그 차이는 단계 경계에서 드러난다. 보정 후에도 남는 음수 나이는 stat과 타임스탬프 사이의 서브초 순서 문제뿐이라 TUI와 같이 fresh로 saturate한다. 창(window)과 on/off는 `[agent_indicator]` 설정을 `/api/repos` 응답에 실어 전달한다 — 클라이언트에 기본값을 따로 두면 TUI와 조용히 갈라진다. `auto_follow`는 보내지 않는다(키보드 선택 이동은 뷰어에 대응물이 없다). 시간이 지나면 식어야 하므로 목록은 스스로 초당 re-render하는데, **tick은 hot 파일이 있는 스냅샷에서만 시작하고 마지막 파일이 식으면 스스로 멈춘다**. commit 파일 목록에는 `mtime`을 싣지 않는다 — 워킹 트리의 시각은 그 커밋과 무관하다. - **끊긴 연결은 조용히 self-heal한다**(`viewer-ui/src/api.ts`, `App.tsx`). 모바일 브라우저는 화면이 꺼지면 페이지를 suspend하고 진행 중이던 fetch를 끊는데, 복귀 시 그 요청이 네트워크 실패로 reject된다(브라우저별 메시지가 갈려 Chrome은 "Failed to fetch", Safari는 "Load failed"). 이걸 **fetch 경계에서 `NetworkError`로 감싸** HTTP 오류(`ApiError`)나 응답 처리 중의 `TypeError`(잘못된 body 등 — 진짜 결함이라 반드시 노출)와 구분한다. `NetworkError`는 사람이 읽을 친절한 메시지를 담아, `err.message`를 직접 보여주는 경로(login·folder browse/open/mkdir)도 raw 메시지를 새지 않는다. **3초 `/api/repos` 폴링은 네트워크 오류를 아예 삼킨다**(스스로 재시도하고, 아래 resume nudge가 즉시 다시 돈다) — 사용자가 탭한 일회성 로드(diff/file)는 자동 재시도가 없으므로 `handle`이 친절한 toast로 알린다. **복귀는 즉시 회복시킨다**: `visibilitychange`(visible)·`online`에 `resumeTick`을 올려 폴링을 그 자리에서 한 번 돌리고(polling은 `AbortController`로 suspend된 in-flight 요청을 버려 resume마다 유령 요청이 쌓이지 않게 한다), status SSE도 다시 구독한다(모바일이 suspend 후 EventSource를 재연결 없이 닫아둘 수 있어). 재구독은 status를 `null`로 비우지 않아 **`Loading…` 깜빡임 없이** 마지막 스냅샷을 유지하다 새 replay로 갈아끼운다. -- **좁은 화면에서 프로젝트 탭은 드롭다운으로 접힌다**(`viewer-ui/src/App.tsx`의 `ProjectMenu`). 헤더의 프로젝트 탭 행은 `md`(768px) 이상에서만 보이고(`hidden md:flex`), 그 미만에서는 현재 프로젝트명을 띄우는 selector 하나로 대체된다(`md:hidden`). 드롭다운은 프로젝트 전환·프로젝트별 닫기(×)·`+ open`을 모두 담아 탭 행의 어포던스를 유지한다. 전환은 CSS 클래스로만 하고(JS 브레이크포인트 훅 없음, 사이드바 접힘과 같은 관례), 열림 상태는 컴포넌트 내부에 둔다. 바깥 클릭(투명 backdrop, `FolderPicker` 오버레이와 같은 방식)이나 Esc로 닫힌다. +- **좁은 화면에서 프로젝트 탭은 드롭다운으로 접힌다**(`viewer-ui/src/pages/App.tsx`의 `ProjectMenu`). 헤더의 프로젝트 탭 행은 `md`(768px) 이상에서만 보이고(`hidden md:flex`), 그 미만에서는 현재 프로젝트명을 띄우는 selector 하나로 대체된다(`md:hidden`). 드롭다운은 프로젝트 전환·프로젝트별 닫기(×)·`+ open`을 모두 담아 탭 행의 어포던스를 유지한다. 전환은 CSS 클래스로만 하고(JS 브레이크포인트 훅 없음, 사이드바 접힘과 같은 관례), 열림 상태는 컴포넌트 내부에 둔다. 바깥 클릭(투명 backdrop, `FolderPicker` 오버레이와 같은 방식)이나 Esc로 닫힌다. -- **폰에서는 세 영역을 동시에 쌓지 않고 하나만 채운다**(`viewer-ui/src/App.tsx`의 `mobileView`). 데스크톱은 파일 목록·컨텐츠 pane·터미널을 한 화면에 함께 두지만, 폰 세로 화면에는 셋이 각각 쥐꼬리만 한 스크롤 박스가 되어 못 쓴다. 그래서 `md` 미만에서는 하단 세그먼트 바(`md:hidden`)가 셋 중 하나를 골라 풀스크린으로 채운다. **레이아웃 전환은 CSS 클래스로만 한다**(ProjectMenu·사이드바 접힘과 같은 관례, JS 브레이크포인트 훅 없음): 최상위 grid는 데스크톱·모바일 **양쪽 다 4-track**이라(데스크톱 `md:grid-rows-[…]`는 header/main/terminal/footer, 모바일 base는 header/활성영역/세그먼트바/footer), DOM 자식 순서(header·main·terminal·세그먼트바·footer)에 grid auto-placement가 걸려 **명시적 row 배치 없이** 매 브레이크포인트에서 보이는 4개가 같은 트랙에 떨어진다 — 데스크톱은 세그먼트바가 `md:hidden`으로 빠지고, 모바일은 main/terminal 중 하나가 `hidden`으로 빠져 항상 넷이다. `mobileView`는 영속하지 않는(transient) 뷰 상태이고 데스크톱은 이를 읽지 않는다 — 파일/커밋을 열면 `setMobileView("diff")`를 무조건 호출해도 데스크톱에선 `md:` 규칙이 덮으므로 분기 없이 폰에서만 컨텐츠 화면으로 넘어간다(단, 커밋 목록 탭은 drill-down 목록을 사이드바에 유지해야 하므로 전환하지 않는다). 데스크톱 전용인 pane별 maximize 버튼 두 개는 `md`에서만 보인다 — 폰에선 세그먼트 바가 그 역할을 대신한다. +- **폰에서는 세 영역을 동시에 쌓지 않고 하나만 채운다**(`viewer-ui/src/pages/App.tsx`의 `mobileView`). 데스크톱은 파일 목록·컨텐츠 pane·터미널을 한 화면에 함께 두지만, 폰 세로 화면에는 셋이 각각 쥐꼬리만 한 스크롤 박스가 되어 못 쓴다. 그래서 `md` 미만에서는 하단 세그먼트 바(`md:hidden`)가 셋 중 하나를 골라 풀스크린으로 채운다. **레이아웃 전환은 CSS 클래스로만 한다**(ProjectMenu·사이드바 접힘과 같은 관례, JS 브레이크포인트 훅 없음): 최상위 grid는 데스크톱·모바일 **양쪽 다 4-track**이라(데스크톱 `md:grid-rows-[…]`는 header/main/terminal/footer, 모바일 base는 header/활성영역/세그먼트바/footer), DOM 자식 순서(header·main·terminal·세그먼트바·footer)에 grid auto-placement가 걸려 **명시적 row 배치 없이** 매 브레이크포인트에서 보이는 4개가 같은 트랙에 떨어진다 — 데스크톱은 세그먼트바가 `md:hidden`으로 빠지고, 모바일은 main/terminal 중 하나가 `hidden`으로 빠져 항상 넷이다. `mobileView`는 영속하지 않는(transient) 뷰 상태이고 데스크톱은 이를 읽지 않는다 — 파일/커밋을 열면 `setMobileView("diff")`를 무조건 호출해도 데스크톱에선 `md:` 규칙이 덮으므로 분기 없이 폰에서만 컨텐츠 화면으로 넘어간다(단, 커밋 목록 탭은 drill-down 목록을 사이드바에 유지해야 하므로 전환하지 않는다). 데스크톱 전용인 pane별 maximize 버튼 두 개는 `md`에서만 보인다 — 폰에선 세그먼트 바가 그 역할을 대신한다. -- **폰 터미널에는 소프트키보드가 못 내는 키를 얹는다**(`viewer-ui/src/termKeys.ts`, `Terminal.tsx`). 폰 소프트키보드로는 Esc·Tab·Ctrl 조합·화살표를 칠 수 없는데, 이것들이 없으면 대화형 셸이 막다른 길이 된다 — `Ctrl-C` 없이는 멈춘 프로세스를 못 죽이고, `Esc` 없이는 vim을 못 빠져나와 pane을 파기(=세션 파기)하는 수밖에 없다. 그래서 터미널 패널 하단에 온스크린 키 바(`md:hidden`, pane이 열렸을 때만)를 두고, 각 키를 실제 키보드가 보낼 **원시 바이트**(`termKeySequence`: Esc=`\x1b`, `^C`=`\x03`, ↑=`\x1b[A` …)로 매핑해 `term.onData`와 **같은 wire 메시지**(`{type:"input", pane, data}`)로 active pane에 흘린다 — 서버는 바 탭과 키 입력을 구분하지 못한다. 시퀀스 맵은 순수 함수라 `termKeys.test.ts`가 단위 테스트한다. 버튼은 `onPointerDown`+`preventDefault`로 눌러, 포커스를 xterm textarea에서 떼지 않아 소프트키보드가 닫히지 않게 한다. **모디파이어를 sticky로 두지 않고 자주 쓰는 조합(`^C`/`^D`/`^Z`/`^L`/`^R`)을 개별 버튼으로** 둔 것은, sticky Ctrl이 다음 입력을 가로채 변환해야 해(xterm이 textarea를 소유) 얻는 것보다 복잡하기 때문 — 임의 조합이 필요해지면 그때 얹는다. 바에는 소프트키보드가 **못 내는** 키만 담는다(일반 문자 `/`·`|`·`~`는 제외). 터치 기기에선 xterm 폰트도 한 포인트 키운다(`pointer: coarse`, 12→13px). 데스크톱 터미널은 실제 키보드가 있으므로 바가 아예 뜨지 않는다. +- **폰 터미널에는 소프트키보드가 못 내는 키를 얹는다**(`viewer-ui/src/lib/termKeys.ts`, `Terminal.tsx`). 폰 소프트키보드로는 Esc·Tab·Ctrl 조합·화살표를 칠 수 없는데, 이것들이 없으면 대화형 셸이 막다른 길이 된다 — `Ctrl-C` 없이는 멈춘 프로세스를 못 죽이고, `Esc` 없이는 vim을 못 빠져나와 pane을 파기(=세션 파기)하는 수밖에 없다. 그래서 터미널 패널 하단에 온스크린 키 바(`md:hidden`, pane이 열렸을 때만)를 두고, 각 키를 실제 키보드가 보낼 **원시 바이트**(`termKeySequence`: Esc=`\x1b`, `^C`=`\x03`, ↑=`\x1b[A` …)로 매핑해 `term.onData`와 **같은 wire 메시지**(`{type:"input", pane, data}`)로 active pane에 흘린다 — 서버는 바 탭과 키 입력을 구분하지 못한다. 시퀀스 맵은 순수 함수라 `termKeys.test.ts`가 단위 테스트한다. 버튼은 `onPointerDown`+`preventDefault`로 눌러, 포커스를 xterm textarea에서 떼지 않아 소프트키보드가 닫히지 않게 한다. **모디파이어를 sticky로 두지 않고 자주 쓰는 조합(`^C`/`^D`/`^Z`/`^L`/`^R`)을 개별 버튼으로** 둔 것은, sticky Ctrl이 다음 입력을 가로채 변환해야 해(xterm이 textarea를 소유) 얻는 것보다 복잡하기 때문 — 임의 조합이 필요해지면 그때 얹는다. 바에는 소프트키보드가 **못 내는** 키만 담는다(일반 문자 `/`·`|`·`~`는 제외). 터치 기기에선 xterm 폰트도 한 포인트 키운다(`pointer: coarse`, 12→13px). 데스크톱 터미널은 실제 키보드가 있으므로 바가 아예 뜨지 않는다. -- **폰 터치 타겟을 넓힌다**(`viewer-ui/src/App.tsx`, `Terminal.tsx`). 목록 행·사이드바 탭·터미널 pane 버튼·`ProjectMenu` 항목은 데스크톱 밀도(얇은 `py-0.5`, `h-6`)로는 손가락에 너무 작아, `md` 미만에서 세로 패딩과 히트 영역을 키우고 `md:`로 기존 밀도를 복원한다(index.css의 밀도 노브 철학과 같은 방향). 아울러 hover가 안 먹는 터치를 위해 목록·버튼에 `active:` 상태를 병행해 탭 피드백을 준다. +- **폰 터치 타겟을 넓힌다**(`viewer-ui/src/pages/App.tsx`, `Terminal.tsx`). 목록 행·사이드바 탭·터미널 pane 버튼·`ProjectMenu` 항목은 데스크톱 밀도(얇은 `py-0.5`, `h-6`)로는 손가락에 너무 작아, `md` 미만에서 세로 패딩과 히트 영역을 키우고 `md:`로 기존 밀도를 복원한다(index.css의 밀도 노브 철학과 같은 방향). 아울러 hover가 안 먹는 터치를 위해 목록·버튼에 `active:` 상태를 병행해 탭 피드백을 준다. #### 알려진 잔여 위험 (수용 또는 후속) @@ -551,7 +558,7 @@ Ratatui 레이어와 내부 TUI 간 키보드 이벤트 충돌은 leader(prefix) | CLI args | clap 4 (derive) | | 웹 미러 서버 | tungstenite 0.29 (sync WS) + argon2 + getrandom, 브라우저는 벤더링한 xterm.js 5.5 | | 웹 뷰어 번들 임베드 | rust-embed 8 (`viewer-ui/dist`) | -| 웹 뷰어 프론트엔드 | React 19 + Vite 7 + Tailwind v4 + `@xterm/xterm`, 마크다운은 react-markdown(+remark-gfm, rehype-highlight) | +| 웹 뷰어 프론트엔드 | React 19 + TypeScript 7 + Vite 8 + Tailwind v4 + `@xterm/xterm` 6, 마크다운은 react-markdown(+remark-gfm, rehype-highlight) | PTY 관리는 portable-pty 기반 `PtyBackend` 단일 구현으로 정리됐다. 초기에는 tmux control-mode 백엔드(`TmuxBackend`)도 병행 지원했으나, 중첩 TUI 키보드 라우팅 문제를 leader(prefix) 모델로 해결하면서 tmux 의존성 없이 `PtyBackend`만으로 충분해져 제거했다. diff --git a/viewer-ui/dist/assets/Markdown-Dfs9RUU9.css b/viewer-ui/dist/assets/Markdown-C8LL_u4z.css similarity index 93% rename from viewer-ui/dist/assets/Markdown-Dfs9RUU9.css rename to viewer-ui/dist/assets/Markdown-C8LL_u4z.css index 33af7377..df39f481 100644 --- a/viewer-ui/dist/assets/Markdown-Dfs9RUU9.css +++ b/viewer-ui/dist/assets/Markdown-C8LL_u4z.css @@ -1 +1 @@ -pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px}.hljs{color:#c9d1d9;background:#0d1117}.hljs-doctag,.hljs-keyword,.hljs-meta .hljs-keyword,.hljs-template-tag,.hljs-template-variable,.hljs-type,.hljs-variable.language_{color:#ff7b72}.hljs-title,.hljs-title.class_,.hljs-title.class_.inherited__,.hljs-title.function_{color:#d2a8ff}.hljs-attr,.hljs-attribute,.hljs-literal,.hljs-meta,.hljs-number,.hljs-operator,.hljs-variable,.hljs-selector-attr,.hljs-selector-class,.hljs-selector-id{color:#79c0ff}.hljs-regexp,.hljs-string,.hljs-meta .hljs-string{color:#a5d6ff}.hljs-built_in,.hljs-symbol{color:#ffa657}.hljs-comment,.hljs-code,.hljs-formula{color:#8b949e}.hljs-name,.hljs-quote,.hljs-selector-tag,.hljs-selector-pseudo{color:#7ee787}.hljs-subst{color:#c9d1d9}.hljs-section{color:#1f6feb;font-weight:700}.hljs-bullet{color:#f2cc60}.hljs-emphasis{color:#c9d1d9;font-style:italic}.hljs-strong{color:#c9d1d9;font-weight:700}.hljs-addition{color:#aff5b4;background-color:#033a16}.hljs-deletion{color:#ffdcd7;background-color:#67060c} +pre code.hljs{padding:1em;display:block;overflow-x:auto}code.hljs{padding:3px 5px}.hljs{color:#c9d1d9;background:#0d1117}.hljs-doctag,.hljs-keyword,.hljs-meta .hljs-keyword,.hljs-template-tag,.hljs-template-variable,.hljs-type,.hljs-variable.language_{color:#ff7b72}.hljs-title,.hljs-title.class_,.hljs-title.class_.inherited__,.hljs-title.function_{color:#d2a8ff}.hljs-attr,.hljs-attribute,.hljs-literal,.hljs-meta,.hljs-number,.hljs-operator,.hljs-variable,.hljs-selector-attr,.hljs-selector-class,.hljs-selector-id{color:#79c0ff}.hljs-regexp,.hljs-string,.hljs-meta .hljs-string{color:#a5d6ff}.hljs-built_in,.hljs-symbol{color:#ffa657}.hljs-comment,.hljs-code,.hljs-formula{color:#8b949e}.hljs-name,.hljs-quote,.hljs-selector-tag,.hljs-selector-pseudo{color:#7ee787}.hljs-subst{color:#c9d1d9}.hljs-section{color:#1f6feb;font-weight:700}.hljs-bullet{color:#f2cc60}.hljs-emphasis{color:#c9d1d9;font-style:italic}.hljs-strong{color:#c9d1d9;font-weight:700}.hljs-addition{color:#aff5b4;background-color:#033a16}.hljs-deletion{color:#ffdcd7;background-color:#67060c} diff --git a/viewer-ui/dist/assets/Markdown-CuElJdJA.js b/viewer-ui/dist/assets/Markdown-CuElJdJA.js new file mode 100644 index 00000000..4554045c --- /dev/null +++ b/viewer-ui/dist/assets/Markdown-CuElJdJA.js @@ -0,0 +1,35 @@ +import{c as e,d as t,i as n,l as r,u as i}from"./index-qkOCcO3M.js";function a(e,t){let n=t||{};return(e[e.length-1]===``?[...e,``]:e).join((n.padRight?` `:``)+`,`+(n.padLeft===!1?``:` `)).trim()}var o=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,s=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,c={};function l(e,t){return((t||c).jsx?s:o).test(e)}var u=/[ \t\n\f\r]/g;function d(e){return typeof e==`object`?e.type===`text`&&f(e.value):f(e)}function f(e){return e.replace(u,``)===``}var p=class{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}};p.prototype.normal={},p.prototype.property={},p.prototype.space=void 0;function m(e,t){let n={},r={};for(let t of e)Object.assign(n,t.property),Object.assign(r,t.normal);return new p(n,r,t)}function h(e){return e.toLowerCase()}var g=class{constructor(e,t){this.attribute=t,this.property=e}};g.prototype.attribute=``,g.prototype.booleanish=!1,g.prototype.boolean=!1,g.prototype.commaOrSpaceSeparated=!1,g.prototype.commaSeparated=!1,g.prototype.defined=!1,g.prototype.mustUseProperty=!1,g.prototype.number=!1,g.prototype.overloadedBoolean=!1,g.prototype.property=``,g.prototype.spaceSeparated=!1,g.prototype.space=void 0;var _=i({boolean:()=>y,booleanish:()=>b,commaOrSpaceSeparated:()=>T,commaSeparated:()=>w,number:()=>S,overloadedBoolean:()=>x,spaceSeparated:()=>C}),v=0,y=E(),b=E(),x=E(),S=E(),C=E(),w=E(),T=E();function E(){return 2**++v}var D=Object.keys(_),O=class extends g{constructor(e,t,n,r){let i=-1;if(super(e,t),k(this,`space`,r),typeof n==`number`)for(;++i4&&n.slice(0,4)===`data`&&re.test(t)){if(t.charAt(4)===`-`){let e=t.slice(5).replace(ne,oe);r=`data`+e.charAt(0).toUpperCase()+e.slice(1)}else{let e=t.slice(4);if(!ne.test(e)){let n=e.replace(te,ae);n.charAt(0)!==`-`&&(n=`-`+n),t=`data`+n}}i=O}return new i(r,t)}function ae(e){return`-`+e.toLowerCase()}function oe(e){return e.charAt(1).toUpperCase()}var se=m([j,P,I,L,R],`html`),ce=m([j,F,I,L,R],`svg`);function le(e){return e.join(` `).trim()}var ue=r(((e,t)=>{var n=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,r=/\n/g,i=/^\s*/,a=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,o=/^:\s*/,s=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,c=/^[;\s]*/,l=/^\s+|\s+$/g;function u(e,t){if(typeof e!=`string`)throw TypeError(`First argument must be a string`);if(!e)return[];t||={};var l=1,u=1;function f(e){var t=e.match(r);t&&(l+=t.length);var n=e.lastIndexOf(` +`);u=~n?e.length-n:u+e.length}function p(){var e={line:l,column:u};return function(t){return t.position=new m(e),_(),t}}function m(e){this.start=e,this.end={line:l,column:u},this.source=t.source}m.prototype.content=e;function h(n){var r=Error(t.source+`:`+l+`:`+u+`: `+n);if(r.reason=n,r.filename=t.source,r.line=l,r.column=u,r.source=e,!t.silent)throw r}function g(t){var n=t.exec(e);if(n){var r=n[0];return f(r),e=e.slice(r.length),n}}function _(){g(i)}function v(e){var t;for(e||=[];t=y();)t!==!1&&e.push(t);return e}function y(){var t=p();if(!(e.charAt(0)!=`/`||e.charAt(1)!=`*`)){for(var n=2;e.charAt(n)!=``&&(e.charAt(n)!=`*`||e.charAt(n+1)!=`/`);)++n;if(n+=2,e.charAt(n-1)===``)return h(`End of comment missing`);var r=e.slice(2,n-2);return u+=2,f(r),e=e.slice(n),u+=2,t({type:`comment`,comment:r})}}function b(){var e=p(),t=g(a);if(t){if(y(),!g(o))return h(`property missing ':'`);var r=g(s),i=e({type:`declaration`,property:d(t[0].replace(n,``)),value:r?d(r[0].replace(n,``)):``});return g(c),i}}function x(){var e=[];v(e);for(var t;t=b();)t!==!1&&(e.push(t),v(e));return e}return _(),x()}function d(e){return e?e.replace(l,``):``}t.exports=u})),de=r((e=>{var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.default=r;var n=t(ue());function r(e,t){let r=null;if(!e||typeof e!=`string`)return r;let i=(0,n.default)(e),a=typeof t==`function`;return i.forEach(e=>{if(e.type!==`declaration`)return;let{property:n,value:i}=e;a?t(n,i,e):i&&(r||={},r[n]=i)}),r}})),fe=r((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.camelCase=void 0;var t=/^--[a-zA-Z0-9_-]+$/,n=/-([a-z])/g,r=/^[^-]+$/,i=/^-(webkit|moz|ms|o|khtml)-/,a=/^-(ms)-/,o=function(e){return!e||r.test(e)||t.test(e)},s=function(e,t){return t.toUpperCase()},c=function(e,t){return`${t}-`};e.camelCase=function(e,t){return t===void 0&&(t={}),o(e)?e:(e=e.toLowerCase(),e=t.reactCompat?e.replace(a,c):e.replace(i,c),e.replace(n,s))}})),pe=r(((e,t)=>{var n=(e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}})(de()),r=fe();function i(e,t){var i={};return!e||typeof e!=`string`||(0,n.default)(e,function(e,n){e&&n&&(i[(0,r.camelCase)(e,t)]=n)}),i}i.default=i,t.exports=i})),me=he(`end`),z=he(`start`);function he(e){return t;function t(t){let n=t&&t.position&&t.position[e]||{};if(typeof n.line==`number`&&n.line>0&&typeof n.column==`number`&&n.column>0)return{line:n.line,column:n.column,offset:typeof n.offset==`number`&&n.offset>-1?n.offset:void 0}}}function ge(e){let t=z(e),n=me(e);if(t&&n)return{start:t,end:n}}function _e(e){return!e||typeof e!=`object`?``:`position`in e||`type`in e?ye(e.position):`start`in e||`end`in e?ye(e):`line`in e||`column`in e?ve(e):``}function ve(e){return be(e&&e.line)+`:`+be(e&&e.column)}function ye(e){return ve(e&&e.start)+`-`+ve(e&&e.end)}function be(e){return e&&typeof e==`number`?e:1}var B=class extends Error{constructor(e,t,n){super(),typeof t==`string`&&(n=t,t=void 0);let r=``,i={},a=!1;if(t&&(i=`line`in t&&`column`in t||`start`in t&&`end`in t?{place:t}:`type`in t?{ancestors:[t],place:t.position}:{...t}),typeof e==`string`?r=e:!i.cause&&e&&(a=!0,r=e.message,i.cause=e),!i.ruleId&&!i.source&&typeof n==`string`){let e=n.indexOf(`:`);e===-1?i.ruleId=n:(i.source=n.slice(0,e),i.ruleId=n.slice(e+1))}if(!i.place&&i.ancestors&&i.ancestors){let e=i.ancestors[i.ancestors.length-1];e&&(i.place=e.position)}let 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=r,this.line=o?o.line:void 0,this.name=_e(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}};B.prototype.file=``,B.prototype.name=``,B.prototype.reason=``,B.prototype.message=``,B.prototype.stack=``,B.prototype.column=void 0,B.prototype.line=void 0,B.prototype.ancestors=void 0,B.prototype.cause=void 0,B.prototype.fatal=void 0,B.prototype.place=void 0,B.prototype.ruleId=void 0,B.prototype.source=void 0;var xe=t(pe(),1),Se={}.hasOwnProperty,Ce=new Map,we=/[A-Z]/g,Te=new Set([`table`,`tbody`,`thead`,`tfoot`,`tr`]),Ee=new Set([`td`,`th`]);function De(e,t){if(!t||t.Fragment===void 0)throw TypeError("Expected `Fragment` in options");let n=t.filePath||void 0,r;if(t.development){if(typeof t.jsxDEV!=`function`)throw TypeError("Expected `jsxDEV` in options when `development: true`");r=Re(n,t.jsxDEV)}else{if(typeof t.jsx!=`function`)throw TypeError("Expected `jsx` in production options");if(typeof t.jsxs!=`function`)throw TypeError("Expected `jsxs` in production options");r=Le(n,t.jsx,t.jsxs)}let i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||`react`,evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space===`svg`?ce:se,stylePropertyNameCase:t.stylePropertyNameCase||`dom`,tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},a=Oe(i,e,void 0);return a&&typeof a!=`string`?a:i.create(e,i.Fragment,{children:a||void 0},void 0)}function Oe(e,t,n){if(t.type===`element`)return ke(e,t,n);if(t.type===`mdxFlowExpression`||t.type===`mdxTextExpression`)return Ae(e,t);if(t.type===`mdxJsxFlowElement`||t.type===`mdxJsxTextElement`)return Me(e,t,n);if(t.type===`mdxjsEsm`)return je(e,t);if(t.type===`root`)return Ne(e,t,n);if(t.type===`text`)return Pe(e,t)}function ke(e,t,n){let r=e.schema,i=r;t.tagName.toLowerCase()===`svg`&&r.space===`html`&&(i=ce,e.schema=i),e.ancestors.push(t);let a=We(e,t.tagName,!1),o=ze(e,t),s=Ve(e,t);return Te.has(t.tagName)&&(s=s.filter(function(e){return typeof e!=`string`||!d(e)})),Fe(e,o,a,t),Ie(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function Ae(e,t){if(t.data&&t.data.estree&&e.evaluater){let n=t.data.estree.body[0];return n.type,e.evaluater.evaluateExpression(n.expression)}Ge(e,t.position)}function je(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Ge(e,t.position)}function Me(e,t,n){let r=e.schema,i=r;t.name===`svg`&&r.space===`html`&&(i=ce,e.schema=i),e.ancestors.push(t);let a=t.name===null?e.Fragment:We(e,t.name,!0),o=Be(e,t),s=Ve(e,t);return Fe(e,o,a,t),Ie(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function Ne(e,t,n){let r={};return Ie(r,Ve(e,t)),e.create(t,e.Fragment,r,n)}function Pe(e,t){return t.value}function Fe(e,t,n,r){typeof n!=`string`&&n!==e.Fragment&&e.passNode&&(t.node=r)}function Ie(e,t){if(t.length>0){let n=t.length>1?t:t[0];n&&(e.children=n)}}function Le(e,t,n){return r;function r(e,r,i,a){let o=Array.isArray(i.children)?n:t;return a?o(r,i,a):o(r,i)}}function Re(e,t){return n;function n(n,r,i,a){let o=Array.isArray(i.children),s=z(n);return t(r,i,a,o,{columnNumber:s?s.column-1:void 0,fileName:e,lineNumber:s?s.line:void 0},void 0)}}function ze(e,t){let n={},r,i;for(i in t.properties)if(i!==`children`&&Se.call(t.properties,i)){let a=He(e,i,t.properties[i]);if(a){let[i,o]=a;e.tableCellAlignToStyle&&i===`align`&&typeof o==`string`&&Ee.has(t.tagName)?r=o:n[i]=o}}if(r){let t=n.style||={};t[e.stylePropertyNameCase===`css`?`text-align`:`textAlign`]=r}return n}function Be(e,t){let n={};for(let r of t.attributes)if(r.type===`mdxJsxExpressionAttribute`)if(r.data&&r.data.estree&&e.evaluater){let t=r.data.estree.body[0];t.type;let i=t.expression;i.type;let a=i.properties[0];a.type,Object.assign(n,e.evaluater.evaluateExpression(a.argument))}else Ge(e,t.position);else{let i=r.name,a;if(r.value&&typeof r.value==`object`)if(r.value.data&&r.value.data.estree&&e.evaluater){let t=r.value.data.estree.body[0];t.type,a=e.evaluater.evaluateExpression(t.expression)}else Ge(e,t.position);else a=r.value===null||r.value;n[i]=a}return n}function Ve(e,t){let n=[],r=-1,i=e.passKeys?new Map:Ce;for(;++ri?0:i+t:t>i?i:t,n=n>0?n:0,r.length<1e4)o=Array.from(r),o.unshift(t,n),e.splice(...o);else for(n&&e.splice(t,n);a0?(V(e,e.length,0,t),e):t}var rt={}.hasOwnProperty;function it(e){let t={},n=-1;for(;++n13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)==65535||(n&65535)==65534||n>1114111?`�`:String.fromCodePoint(n)}function U(e){return e.replace(/[\t\n\r ]+/g,` `).replace(/^ | $/g,``).toLowerCase().toUpperCase()}var W=ht(/[A-Za-z]/),G=ht(/[\dA-Za-z]/),ct=ht(/[#-'*+\--9=?A-Z^-~]/);function lt(e){return e!==null&&(e<32||e===127)}var ut=ht(/\d/),dt=ht(/[\dA-Fa-f]/),ft=ht(/[!-/:-@[-`{-~]/);function K(e){return e!==null&&e<-2}function q(e){return e!==null&&(e<0||e===32)}function J(e){return e===-2||e===-1||e===32}var pt=ht(/\p{P}|\p{S}/u),mt=ht(/\s/);function ht(e){return t;function t(t){return t!==null&&t>-1&&e.test(String.fromCharCode(t))}}function gt(e){let t=[],n=-1,r=0,i=0;for(;++n55295&&a<57344){let t=e.charCodeAt(n+1);a<56320&&t>56319&&t<57344?(o=String.fromCharCode(a,t),i=1):o=`�`}else o=String.fromCharCode(a);o&&=(t.push(e.slice(r,n),encodeURIComponent(o)),r=n+i+1,``),i&&=(n+=i,0)}return t.join(``)+e.slice(r)}function Y(e,t,n,r){let i=r?r-1:1/0,a=0;return o;function o(r){return J(r)?(e.enter(n),s(r)):t(r)}function s(r){return J(r)&&a++o))return;let n=t.events.length,a=n,s,c;for(;a--;)if(t.events[a][0]===`exit`&&t.events[a][1].type===`chunkFlow`){if(s){c=t.events[a][1].end;break}s=!0}for(_(r),e=n;er;){let r=n[i];t.containerState=r[1],r[0].exit.call(t,e)}n.length=r}function v(){i.write([null]),a=void 0,i=void 0,t.containerState._closeFlow=void 0}}function St(e,t,n){return Y(e,e.attempt(this.parser.constructs.document,t,n),`linePrefix`,this.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)}function Ct(e){if(e===null||q(e)||mt(e))return 1;if(pt(e))return 2}function wt(e,t,n){let r=[],i=-1;for(;++i1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;let d={...e[r][1].end},f={...e[n][1].start};Ot(d,-c),Ot(f,c),o={type:c>1?`strongSequence`:`emphasisSequence`,start:d,end:{...e[r][1].end}},s={type:c>1?`strongSequence`:`emphasisSequence`,start:{...e[n][1].start},end:f},a={type:c>1?`strongText`:`emphasisText`,start:{...e[r][1].end},end:{...e[n][1].start}},i={type:c>1?`strong`:`emphasis`,start:{...o.start},end:{...s.end}},e[r][1].end={...o.start},e[n][1].start={...s.end},l=[],e[r][1].end.offset-e[r][1].start.offset&&(l=H(l,[[`enter`,e[r][1],t],[`exit`,e[r][1],t]])),l=H(l,[[`enter`,i,t],[`enter`,o,t],[`exit`,o,t],[`enter`,a,t]]),l=H(l,wt(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),l=H(l,[[`exit`,a,t],[`enter`,s,t],[`exit`,s,t],[`exit`,i,t]]),e[n][1].end.offset-e[n][1].start.offset?(u=2,l=H(l,[[`enter`,e[n][1],t],[`exit`,e[n][1],t]])):u=0,V(e,r-1,n-r+3,l),n=r+l.length-u-2;break}}for(n=-1;++n0&&J(t)?Y(e,v,`linePrefix`,a+1)(t):v(t)}function v(t){return t===null||K(t)?e.check(Vt,h,b)(t):(e.enter(`codeFlowValue`),y(t))}function y(t){return t===null||K(t)?(e.exit(`codeFlowValue`),v(t)):(e.consume(t),y)}function b(n){return e.exit(`codeFenced`),t(n)}function x(e,t,n){let i=0;return a;function a(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),c}function c(t){return e.enter(`codeFencedFence`),J(t)?Y(e,l,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):l(t)}function l(t){return t===s?(e.enter(`codeFencedFenceSequence`),u(t)):n(t)}function u(t){return t===s?(i++,e.consume(t),u):i>=o?(e.exit(`codeFencedFenceSequence`),J(t)?Y(e,d,`whitespace`)(t):d(t)):n(t)}function d(r){return r===null||K(r)?(e.exit(`codeFencedFence`),t(r)):n(r)}}}function Wt(e,t,n){let r=this;return i;function i(t){return t===null?n(t):(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),a)}function a(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}var Gt={name:`codeIndented`,tokenize:qt},Kt={partial:!0,tokenize:Jt};function qt(e,t,n){let r=this;return i;function i(t){return e.enter(`codeIndented`),Y(e,a,`linePrefix`,5)(t)}function a(e){let t=r.events[r.events.length-1];return t&&t[1].type===`linePrefix`&&t[2].sliceSerialize(t[1],!0).length>=4?o(e):n(e)}function o(t){return t===null?c(t):K(t)?e.attempt(Kt,o,c)(t):(e.enter(`codeFlowValue`),s(t))}function s(t){return t===null||K(t)?(e.exit(`codeFlowValue`),o(t)):(e.consume(t),s)}function c(n){return e.exit(`codeIndented`),t(n)}}function Jt(e,t,n){let r=this;return i;function i(t){return r.parser.lazy[r.now().line]?n(t):K(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),i):Y(e,a,`linePrefix`,5)(t)}function a(e){let a=r.events[r.events.length-1];return a&&a[1].type===`linePrefix`&&a[2].sliceSerialize(a[1],!0).length>=4?t(e):K(e)?i(e):n(e)}}var Yt={name:`codeText`,previous:Zt,resolve:Xt,tokenize:Qt};function Xt(e){let t=e.length-4,n=3,r,i;if((e[n][1].type===`lineEnding`||e[n][1].type===`space`)&&(e[t][1].type===`lineEnding`||e[t][1].type===`space`)){for(r=n;++r=this.left.length+this.right.length)throw RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return ethis.left.length?this.right.slice(this.right.length-n+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-n+this.left.length).reverse())}splice(e,t,n){let r=t||0;this.setCursor(Math.trunc(e));let i=this.right.splice(this.right.length-r,1/0);return n&&en(this.left,n),i.reverse()}pop(){return this.setCursor(1/0),this.left.pop()}push(e){this.setCursor(1/0),this.left.push(e)}pushMany(e){this.setCursor(1/0),en(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),en(this.right,e.reverse())}setCursor(e){if(!(e===this.left.length||e>this.left.length&&this.right.length===0||e<0&&this.left.length===0))if(e=4?t(i):e.interrupt(r.parser.constructs.flow,n,t)(i)}}function ln(e,t,n,r,i,a,o,s,c){let l=c||1/0,u=0;return d;function d(t){return t===60?(e.enter(r),e.enter(i),e.enter(a),e.consume(t),e.exit(a),f):t===null||t===32||t===41||lt(t)?n(t):(e.enter(r),e.enter(o),e.enter(s),e.enter(`chunkString`,{contentType:`string`}),h(t))}function f(n){return n===62?(e.enter(a),e.consume(n),e.exit(a),e.exit(i),e.exit(r),t):(e.enter(s),e.enter(`chunkString`,{contentType:`string`}),p(n))}function p(t){return t===62?(e.exit(`chunkString`),e.exit(s),f(t)):t===null||t===60||K(t)?n(t):(e.consume(t),t===92?m:p)}function m(t){return t===60||t===62||t===92?(e.consume(t),p):p(t)}function h(i){return!u&&(i===null||i===41||q(i))?(e.exit(`chunkString`),e.exit(s),e.exit(o),e.exit(r),t(i)):u999||l===null||l===91||l===93&&!c||l===94&&!s&&`_hiddenFootnoteSupport`in o.parser.constructs?n(l):l===93?(e.exit(a),e.enter(i),e.consume(l),e.exit(i),e.exit(r),t):K(l)?(e.enter(`lineEnding`),e.consume(l),e.exit(`lineEnding`),u):(e.enter(`chunkString`,{contentType:`string`}),d(l))}function d(t){return t===null||t===91||t===93||K(t)||s++>999?(e.exit(`chunkString`),u(t)):(e.consume(t),c||=!J(t),t===92?f:d)}function f(t){return t===91||t===92||t===93?(e.consume(t),s++,d):d(t)}}function dn(e,t,n,r,i,a){let o;return s;function s(t){return t===34||t===39||t===40?(e.enter(r),e.enter(i),e.consume(t),e.exit(i),o=t===40?41:t,c):n(t)}function c(n){return n===o?(e.enter(i),e.consume(n),e.exit(i),e.exit(r),t):(e.enter(a),l(n))}function l(t){return t===o?(e.exit(a),c(o)):t===null?n(t):K(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),Y(e,l,`linePrefix`)):(e.enter(`chunkString`,{contentType:`string`}),u(t))}function u(t){return t===o||t===null||K(t)?(e.exit(`chunkString`),l(t)):(e.consume(t),t===92?d:u)}function d(t){return t===o||t===92?(e.consume(t),u):u(t)}}function fn(e,t){let n;return r;function r(i){return K(i)?(e.enter(`lineEnding`),e.consume(i),e.exit(`lineEnding`),n=!0,r):J(i)?Y(e,r,n?`linePrefix`:`lineSuffix`)(i):t(i)}}var pn={name:`definition`,tokenize:hn},mn={partial:!0,tokenize:gn};function hn(e,t,n){let r=this,i;return a;function a(t){return e.enter(`definition`),o(t)}function o(t){return un.call(r,e,s,n,`definitionLabel`,`definitionLabelMarker`,`definitionLabelString`)(t)}function s(t){return i=U(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),t===58?(e.enter(`definitionMarker`),e.consume(t),e.exit(`definitionMarker`),c):n(t)}function c(t){return q(t)?fn(e,l)(t):l(t)}function l(t){return ln(e,u,n,`definitionDestination`,`definitionDestinationLiteral`,`definitionDestinationLiteralMarker`,`definitionDestinationRaw`,`definitionDestinationString`)(t)}function u(t){return e.attempt(mn,d,d)(t)}function d(t){return J(t)?Y(e,f,`whitespace`)(t):f(t)}function f(a){return a===null||K(a)?(e.exit(`definition`),r.parser.defined.push(i),t(a)):n(a)}}function gn(e,t,n){return r;function r(t){return q(t)?fn(e,i)(t):n(t)}function i(t){return dn(e,a,n,`definitionTitle`,`definitionTitleMarker`,`definitionTitleString`)(t)}function a(t){return J(t)?Y(e,o,`whitespace`)(t):o(t)}function o(e){return e===null||K(e)?t(e):n(e)}}var _n={name:`hardBreakEscape`,tokenize:vn};function vn(e,t,n){return r;function r(t){return e.enter(`hardBreakEscape`),e.consume(t),i}function i(r){return K(r)?(e.exit(`hardBreakEscape`),t(r)):n(r)}}var yn={name:`headingAtx`,resolve:bn,tokenize:xn};function bn(e,t){let n=e.length-2,r=3,i,a;return e[r][1].type===`whitespace`&&(r+=2),n-2>r&&e[n][1].type===`whitespace`&&(n-=2),e[n][1].type===`atxHeadingSequence`&&(r===n-1||n-4>r&&e[n-2][1].type===`whitespace`)&&(n-=r+1===n?2:4),n>r&&(i={type:`atxHeadingText`,start:e[r][1].start,end:e[n][1].end},a={type:`chunkText`,start:e[r][1].start,end:e[n][1].end,contentType:`text`},V(e,r,n-r+1,[[`enter`,i,t],[`enter`,a,t],[`exit`,a,t],[`exit`,i,t]])),e}function xn(e,t,n){let r=0;return i;function i(t){return e.enter(`atxHeading`),a(t)}function a(t){return e.enter(`atxHeadingSequence`),o(t)}function o(t){return t===35&&r++<6?(e.consume(t),o):t===null||q(t)?(e.exit(`atxHeadingSequence`),s(t)):n(t)}function s(n){return n===35?(e.enter(`atxHeadingSequence`),c(n)):n===null||K(n)?(e.exit(`atxHeading`),t(n)):J(n)?Y(e,s,`whitespace`)(n):(e.enter(`atxHeadingText`),l(n))}function c(t){return t===35?(e.consume(t),c):(e.exit(`atxHeadingSequence`),s(t))}function l(t){return t===null||t===35||q(t)?(e.exit(`atxHeadingText`),s(t)):(e.consume(t),l)}}var Sn=`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`.split(`.`),Cn=[`pre`,`script`,`style`,`textarea`],wn={concrete:!0,name:`htmlFlow`,resolveTo:Dn,tokenize:On},Tn={partial:!0,tokenize:An},En={partial:!0,tokenize:kn};function Dn(e){let t=e.length;for(;t--&&!(e[t][0]===`enter`&&e[t][1].type===`htmlFlow`););return t>1&&e[t-2][1].type===`linePrefix`&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function On(e,t,n){let r=this,i,a,o,s,c;return l;function l(e){return u(e)}function u(t){return e.enter(`htmlFlow`),e.enter(`htmlFlowData`),e.consume(t),d}function d(s){return s===33?(e.consume(s),f):s===47?(e.consume(s),a=!0,h):s===63?(e.consume(s),i=3,r.interrupt?t:I):W(s)?(e.consume(s),o=String.fromCharCode(s),g):n(s)}function f(a){return a===45?(e.consume(a),i=2,p):a===91?(e.consume(a),i=5,s=0,m):W(a)?(e.consume(a),i=4,r.interrupt?t:I):n(a)}function p(i){return i===45?(e.consume(i),r.interrupt?t:I):n(i)}function m(i){return i===`CDATA[`.charCodeAt(s++)?(e.consume(i),s===6?r.interrupt?t:O:m):n(i)}function h(t){return W(t)?(e.consume(t),o=String.fromCharCode(t),g):n(t)}function g(s){if(s===null||s===47||s===62||q(s)){let c=s===47,l=o.toLowerCase();return!c&&!a&&Cn.includes(l)?(i=1,r.interrupt?t(s):O(s)):Sn.includes(o.toLowerCase())?(i=6,c?(e.consume(s),_):r.interrupt?t(s):O(s)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(s):a?v(s):y(s))}return s===45||G(s)?(e.consume(s),o+=String.fromCharCode(s),g):n(s)}function _(i){return i===62?(e.consume(i),r.interrupt?t:O):n(i)}function v(t){return J(t)?(e.consume(t),v):E(t)}function y(t){return t===47?(e.consume(t),E):t===58||t===95||W(t)?(e.consume(t),b):J(t)?(e.consume(t),y):E(t)}function b(t){return t===45||t===46||t===58||t===95||G(t)?(e.consume(t),b):x(t)}function x(t){return t===61?(e.consume(t),S):J(t)?(e.consume(t),x):y(t)}function S(t){return t===null||t===60||t===61||t===62||t===96?n(t):t===34||t===39?(e.consume(t),c=t,C):J(t)?(e.consume(t),S):w(t)}function C(t){return t===c?(e.consume(t),c=null,T):t===null||K(t)?n(t):(e.consume(t),C)}function w(t){return t===null||t===34||t===39||t===47||t===60||t===61||t===62||t===96||q(t)?x(t):(e.consume(t),w)}function T(e){return e===47||e===62||J(e)?y(e):n(e)}function E(t){return t===62?(e.consume(t),D):n(t)}function D(t){return t===null||K(t)?O(t):J(t)?(e.consume(t),D):n(t)}function O(t){return t===45&&i===2?(e.consume(t),M):t===60&&i===1?(e.consume(t),N):t===62&&i===4?(e.consume(t),L):t===63&&i===3?(e.consume(t),I):t===93&&i===5?(e.consume(t),F):K(t)&&(i===6||i===7)?(e.exit(`htmlFlowData`),e.check(Tn,R,k)(t)):t===null||K(t)?(e.exit(`htmlFlowData`),k(t)):(e.consume(t),O)}function k(t){return e.check(En,A,R)(t)}function A(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),j}function j(t){return t===null||K(t)?k(t):(e.enter(`htmlFlowData`),O(t))}function M(t){return t===45?(e.consume(t),I):O(t)}function N(t){return t===47?(e.consume(t),o=``,P):O(t)}function P(t){if(t===62){let n=o.toLowerCase();return Cn.includes(n)?(e.consume(t),L):O(t)}return W(t)&&o.length<8?(e.consume(t),o+=String.fromCharCode(t),P):O(t)}function F(t){return t===93?(e.consume(t),I):O(t)}function I(t){return t===62?(e.consume(t),L):t===45&&i===2?(e.consume(t),I):O(t)}function L(t){return t===null||K(t)?(e.exit(`htmlFlowData`),R(t)):(e.consume(t),L)}function R(n){return e.exit(`htmlFlow`),t(n)}}function kn(e,t,n){let r=this;return i;function i(t){return K(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),a):n(t)}function a(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}function An(e,t,n){return r;function r(r){return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),e.attempt(jt,t,n)}}var jn={name:`htmlText`,tokenize:Mn};function Mn(e,t,n){let r=this,i,a,o;return s;function s(t){return e.enter(`htmlText`),e.enter(`htmlTextData`),e.consume(t),c}function c(t){return t===33?(e.consume(t),l):t===47?(e.consume(t),x):t===63?(e.consume(t),y):W(t)?(e.consume(t),w):n(t)}function l(t){return t===45?(e.consume(t),u):t===91?(e.consume(t),a=0,m):W(t)?(e.consume(t),v):n(t)}function u(t){return t===45?(e.consume(t),p):n(t)}function d(t){return t===null?n(t):t===45?(e.consume(t),f):K(t)?(o=d,N(t)):(e.consume(t),d)}function f(t){return t===45?(e.consume(t),p):d(t)}function p(e){return e===62?M(e):e===45?f(e):d(e)}function m(t){return t===`CDATA[`.charCodeAt(a++)?(e.consume(t),a===6?h:m):n(t)}function h(t){return t===null?n(t):t===93?(e.consume(t),g):K(t)?(o=h,N(t)):(e.consume(t),h)}function g(t){return t===93?(e.consume(t),_):h(t)}function _(t){return t===62?M(t):t===93?(e.consume(t),_):h(t)}function v(t){return t===null||t===62?M(t):K(t)?(o=v,N(t)):(e.consume(t),v)}function y(t){return t===null?n(t):t===63?(e.consume(t),b):K(t)?(o=y,N(t)):(e.consume(t),y)}function b(e){return e===62?M(e):y(e)}function x(t){return W(t)?(e.consume(t),S):n(t)}function S(t){return t===45||G(t)?(e.consume(t),S):C(t)}function C(t){return K(t)?(o=C,N(t)):J(t)?(e.consume(t),C):M(t)}function w(t){return t===45||G(t)?(e.consume(t),w):t===47||t===62||q(t)?T(t):n(t)}function T(t){return t===47?(e.consume(t),M):t===58||t===95||W(t)?(e.consume(t),E):K(t)?(o=T,N(t)):J(t)?(e.consume(t),T):M(t)}function E(t){return t===45||t===46||t===58||t===95||G(t)?(e.consume(t),E):D(t)}function D(t){return t===61?(e.consume(t),O):K(t)?(o=D,N(t)):J(t)?(e.consume(t),D):T(t)}function O(t){return t===null||t===60||t===61||t===62||t===96?n(t):t===34||t===39?(e.consume(t),i=t,k):K(t)?(o=O,N(t)):J(t)?(e.consume(t),O):(e.consume(t),A)}function k(t){return t===i?(e.consume(t),i=void 0,j):t===null?n(t):K(t)?(o=k,N(t)):(e.consume(t),k)}function A(t){return t===null||t===34||t===39||t===60||t===61||t===96?n(t):t===47||t===62||q(t)?T(t):(e.consume(t),A)}function j(e){return e===47||e===62||q(e)?T(e):n(e)}function M(r){return r===62?(e.consume(r),e.exit(`htmlTextData`),e.exit(`htmlText`),t):n(r)}function N(t){return e.exit(`htmlTextData`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),P}function P(t){return J(t)?Y(e,F,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):F(t)}function F(t){return e.enter(`htmlTextData`),o(t)}}var Nn={name:`labelEnd`,resolveAll:Ln,resolveTo:Rn,tokenize:zn},Pn={tokenize:Bn},Fn={tokenize:Vn},In={tokenize:Hn};function Ln(e){let t=-1,n=[];for(;++t=3&&(a===null||K(a))?(e.exit(`thematicBreak`),t(a)):n(a)}function c(t){return t===i?(e.consume(t),r++,c):(e.exit(`thematicBreakSequence`),J(t)?Y(e,s,`whitespace`)(t):s(t))}}var X={continuation:{tokenize:er},exit:nr,name:`list`,tokenize:$n},Zn={partial:!0,tokenize:rr},Qn={partial:!0,tokenize:tr};function $n(e,t,n){let r=this,i=r.events[r.events.length-1],a=i&&i[1].type===`linePrefix`?i[2].sliceSerialize(i[1],!0).length:0,o=0;return s;function s(t){let i=r.containerState.type||(t===42||t===43||t===45?`listUnordered`:`listOrdered`);if(i===`listUnordered`?!r.containerState.marker||t===r.containerState.marker:ut(t)){if(r.containerState.type||(r.containerState.type=i,e.enter(i,{_container:!0})),i===`listUnordered`)return e.enter(`listItemPrefix`),t===42||t===45?e.check(Yn,n,l)(t):l(t);if(!r.interrupt||t===49)return e.enter(`listItemPrefix`),e.enter(`listItemValue`),c(t)}return n(t)}function c(t){return ut(t)&&++o<10?(e.consume(t),c):(!r.interrupt||o<2)&&(r.containerState.marker?t===r.containerState.marker:t===41||t===46)?(e.exit(`listItemValue`),l(t)):n(t)}function l(t){return e.enter(`listItemMarker`),e.consume(t),e.exit(`listItemMarker`),r.containerState.marker=r.containerState.marker||t,e.check(jt,r.interrupt?n:u,e.attempt(Zn,f,d))}function u(e){return r.containerState.initialBlankLine=!0,a++,f(e)}function d(t){return J(t)?(e.enter(`listItemPrefixWhitespace`),e.consume(t),e.exit(`listItemPrefixWhitespace`),f):n(t)}function f(n){return r.containerState.size=a+r.sliceSerialize(e.exit(`listItemPrefix`),!0).length,t(n)}}function er(e,t,n){let r=this;return r.containerState._closeFlow=void 0,e.check(jt,i,a);function i(n){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,Y(e,t,`listItemIndent`,r.containerState.size+1)(n)}function a(n){return r.containerState.furtherBlankLines||!J(n)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,o(n)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(Qn,t,o)(n))}function o(i){return r.containerState._closeFlow=!0,r.interrupt=void 0,Y(e,e.attempt(X,t,n),`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(i)}}function tr(e,t,n){let r=this;return Y(e,i,`listItemIndent`,r.containerState.size+1);function i(e){let i=r.events[r.events.length-1];return i&&i[1].type===`listItemIndent`&&i[2].sliceSerialize(i[1],!0).length===r.containerState.size?t(e):n(e)}}function nr(e){e.exit(this.containerState.type)}function rr(e,t,n){let r=this;return Y(e,i,`listItemPrefixWhitespace`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:5);function i(e){let i=r.events[r.events.length-1];return!J(e)&&i&&i[1].type===`listItemPrefixWhitespace`?t(e):n(e)}}var ir={name:`setextUnderline`,resolveTo:ar,tokenize:or};function ar(e,t){let n=e.length,r,i,a;for(;n--;)if(e[n][0]===`enter`){if(e[n][1].type===`content`){r=n;break}e[n][1].type===`paragraph`&&(i=n)}else e[n][1].type===`content`&&e.splice(n,1),!a&&e[n][1].type===`definition`&&(a=n);let o={type:`setextHeading`,start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type=`setextHeadingText`,a?(e.splice(i,0,[`enter`,o,t]),e.splice(a+1,0,[`exit`,e[r][1],t]),e[r][1].end={...e[a][1].end}):e[r][1]=o,e.push([`exit`,o,t]),e}function or(e,t,n){let r=this,i;return a;function a(t){let a=r.events.length,s;for(;a--;)if(r.events[a][1].type!==`lineEnding`&&r.events[a][1].type!==`linePrefix`&&r.events[a][1].type!==`content`){s=r.events[a][1].type===`paragraph`;break}return!r.parser.lazy[r.now().line]&&(r.interrupt||s)?(e.enter(`setextHeadingLine`),i=t,o(t)):n(t)}function o(t){return e.enter(`setextHeadingLineSequence`),s(t)}function s(t){return t===i?(e.consume(t),s):(e.exit(`setextHeadingLineSequence`),J(t)?Y(e,c,`lineSuffix`)(t):c(t))}function c(r){return r===null||K(r)?(e.exit(`setextHeadingLine`),t(r)):n(r)}}var sr={tokenize:cr};function cr(e){let t=this,n=e.attempt(jt,r,e.attempt(this.parser.constructs.flowInitial,i,Y(e,e.attempt(this.parser.constructs.flow,i,e.attempt(rn,i)),`linePrefix`)));return n;function r(r){if(r===null){e.consume(r);return}return e.enter(`lineEndingBlank`),e.consume(r),e.exit(`lineEndingBlank`),t.currentConstruct=void 0,n}function i(r){if(r===null){e.consume(r);return}return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),t.currentConstruct=void 0,n}}var lr={resolveAll:pr()},ur=fr(`string`),dr=fr(`text`);function fr(e){return{resolveAll:pr(e===`text`?mr:void 0),tokenize:t};function t(t){let n=this,r=this.parser.constructs[e],i=t.attempt(r,a,o);return a;function a(e){return c(e)?i(e):o(e)}function o(e){if(e===null){t.consume(e);return}return t.enter(`data`),t.consume(e),s}function s(e){return c(e)?(t.exit(`data`),i(e)):(t.consume(e),s)}function c(e){if(e===null)return!0;let t=r[e],i=-1;if(t)for(;++iCr,contentInitial:()=>_r,disable:()=>wr,document:()=>gr,flow:()=>yr,flowInitial:()=>vr,insideSpan:()=>Sr,string:()=>br,text:()=>xr}),gr={42:X,43:X,45:X,48:X,49:X,50:X,51:X,52:X,53:X,54:X,55:X,56:X,57:X,62:Nt},_r={91:pn},vr={[-2]:Gt,[-1]:Gt,32:Gt},yr={35:yn,42:Yn,45:[ir,Yn],60:wn,61:ir,95:Yn,96:Ht,126:Ht},br={38:zt,92:Lt},xr={[-5]:qn,[-4]:qn,[-3]:qn,33:Un,38:zt,42:Tt,60:[kt,jn],91:Gn,92:[_n,Lt],93:Nn,95:Tt,96:Yt},Sr={null:[Tt,lr]},Cr={null:[42,95]},wr={null:[]};function Tr(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0},i={},a=[],o=[],s=[],c={attempt:C(x),check:C(S),consume:v,enter:y,exit:b,interrupt:C(S,{interrupt:!0})},l={code:null,containerState:{},defineSkip:h,events:[],now:m,parser:e,previous:null,sliceSerialize:f,sliceStream:p,write:d},u=t.tokenize.call(l,c);return t.resolveAll&&a.push(t),l;function d(e){return o=H(o,e),g(),o[o.length-1]===null?(w(t,0),l.events=wt(a,l.events,l),l.events):[]}function f(e,t){return Dr(p(e),t)}function p(e){return Er(o,e)}function m(){let{_bufferIndex:e,_index:t,line:n,column:i,offset:a}=r;return{_bufferIndex:e,_index:t,line:n,column:i,offset:a}}function h(e){i[e.line]=e.column,E()}function g(){let e;for(;r._index-1){let e=o[0];typeof e==`string`?o[0]=e.slice(r):o.shift()}a>0&&o.push(e[i].slice(0,a))}return o}function Dr(e,t){let n=-1,r=[],i;for(;++n0){let e=a.tokenStack[a.tokenStack.length-1];(e[1]||Vr).call(a,void 0,e[0])}for(r.position={start:Rr(e.length>0?e[0][1].start:{line:1,column:1,offset:0}),end:Rr(e.length>0?e[e.length-2][1].end:{line:1,column:1,offset:0})},d=-1;++d0&&(r.className=[`language-`+i[0]]);let a={type:`element`,tagName:`code`,properties:r,children:[{type:`text`,value:n}]};return t.meta&&(a.data={meta:t.meta}),e.patch(t,a),a=e.applyData(t,a),a={type:`element`,tagName:`pre`,properties:{},children:[a]},e.patch(t,a),a}function Kr(e,t){let n={type:`element`,tagName:`del`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function qr(e,t){let n={type:`element`,tagName:`em`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Jr(e,t){let n=typeof e.options.clobberPrefix==`string`?e.options.clobberPrefix:`user-content-`,r=String(t.identifier).toUpperCase(),i=gt(r.toLowerCase()),a=e.footnoteOrder.indexOf(r),o,s=e.footnoteCounts.get(r);s===void 0?(s=0,e.footnoteOrder.push(r),o=e.footnoteOrder.length):o=a+1,s+=1,e.footnoteCounts.set(r,s);let c={type:`element`,tagName:`a`,properties:{href:`#`+n+`fn-`+i,id:n+`fnref-`+i+(s>1?`-`+s:``),dataFootnoteRef:!0,ariaDescribedBy:[`footnote-label`]},children:[{type:`text`,value:String(o)}]};e.patch(t,c);let l={type:`element`,tagName:`sup`,properties:{},children:[c]};return e.patch(t,l),e.applyData(t,l)}function Yr(e,t){let n={type:`element`,tagName:`h`+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Xr(e,t){if(e.options.allowDangerousHtml){let n={type:`raw`,value:t.value};return e.patch(t,n),e.applyData(t,n)}}function Zr(e,t){let n=t.referenceType,r=`]`;if(n===`collapsed`?r+=`[]`:n===`full`&&(r+=`[`+(t.label||t.identifier)+`]`),t.type===`imageReference`)return[{type:`text`,value:`![`+t.alt+r}];let i=e.all(t),a=i[0];a&&a.type===`text`?a.value=`[`+a.value:i.unshift({type:`text`,value:`[`});let o=i[i.length-1];return o&&o.type===`text`?o.value+=r:i.push({type:`text`,value:r}),i}function Qr(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return Zr(e,t);let i={src:gt(r.url||``),alt:t.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);let a={type:`element`,tagName:`img`,properties:i,children:[]};return e.patch(t,a),e.applyData(t,a)}function $r(e,t){let n={src:gt(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);let r={type:`element`,tagName:`img`,properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function ei(e,t){let n={type:`text`,value:t.value.replace(/\r?\n|\r/g,` `)};e.patch(t,n);let r={type:`element`,tagName:`code`,properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function ti(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return Zr(e,t);let i={href:gt(r.url||``)};r.title!==null&&r.title!==void 0&&(i.title=r.title);let a={type:`element`,tagName:`a`,properties:i,children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function ni(e,t){let n={href:gt(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);let r={type:`element`,tagName:`a`,properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function ri(e,t,n){let r=e.all(t),i=n?ii(n):ai(t),a={},o=[];if(typeof t.checked==`boolean`){let e=r[0],n;e&&e.type===`element`&&e.tagName===`p`?n=e:(n={type:`element`,tagName:`p`,properties:{},children:[]},r.unshift(n)),n.children.length>0&&n.children.unshift({type:`text`,value:` `}),n.children.unshift({type:`element`,tagName:`input`,properties:{type:`checkbox`,checked:t.checked,disabled:!0},children:[]}),a.className=[`task-list-item`]}let s=-1;for(;++s1}function oi(e,t){let n={},r=e.all(t),i=-1;for(typeof t.start==`number`&&t.start!==1&&(n.start=t.start);++i0){let r={type:`element`,tagName:`tbody`,properties:{},children:e.wrap(n,!0)},a=z(t.children[1]),o=me(t.children[t.children.length-1]);a&&o&&(r.position={start:a,end:o}),i.push(r)}let a={type:`element`,tagName:`table`,properties:{},children:e.wrap(i,!0)};return e.patch(t,a),e.applyData(t,a)}function di(e,t,n){let r=n?n.children:void 0,i=(r?r.indexOf(t):1)===0?`th`:`td`,a=n&&n.type===`table`?n.align:void 0,o=a?a.length:t.children.length,s=-1,c=[];for(;++s0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return a.push(gi(t.slice(i),i>0,!1)),a.join(``)}function gi(e,t,n){let r=0,i=e.length;if(t){let t=e.codePointAt(r);for(;t===pi||t===mi;)r++,t=e.codePointAt(r)}if(n){let t=e.codePointAt(i-1);for(;t===pi||t===mi;)i--,t=e.codePointAt(i-1)}return i>r?e.slice(r,i):``}function _i(e,t){let n={type:`text`,value:hi(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function vi(e,t){let n={type:`element`,tagName:`hr`,properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}var yi={blockquote:Ur,break:Wr,code:Gr,delete:Kr,emphasis:qr,footnoteReference:Jr,heading:Yr,html:Xr,imageReference:Qr,image:$r,inlineCode:ei,linkReference:ti,link:ni,listItem:ri,list:oi,paragraph:si,root:ci,strong:li,table:ui,tableCell:fi,tableRow:di,text:_i,thematicBreak:vi,toml:bi,yaml:bi,definition:bi,footnoteDefinition:bi};function bi(){}var xi=typeof self==`object`?self:globalThis,Si=(e,t)=>{switch(e){case`Function`:case`SharedWorker`:case`Worker`:case`eval`:case`setInterval`:case`setTimeout`:throw TypeError(`unable to deserialize `+e)}return new xi[e](t)},Ci=(e,t)=>{let n=(t,n)=>(e.set(n,t),t),r=i=>{if(e.has(i))return e.get(i);let[a,o]=t[i];switch(a){case 0:case-1:return n(o,i);case 1:{let e=n([],i);for(let t of o)e.push(r(t));return e}case 2:{let e=n({},i);for(let[t,n]of o)e[r(t)]=r(n);return e}case 3:return n(new Date(o),i);case 4:{let{source:e,flags:t}=o;return n(new RegExp(e,t),i)}case 5:{let e=n(new Map,i);for(let[t,n]of o)e.set(r(t),r(n));return e}case 6:{let e=n(new Set,i);for(let t of o)e.add(r(t));return e}case 7:{let{name:e,message:t}=o;return n(typeof xi[e]==`function`?Si(e,t):Error(t),i)}case 8:return n(BigInt(o),i);case`BigInt`:return n(Object(BigInt(o)),i);case`ArrayBuffer`:return n(new Uint8Array(o).buffer,o);case`DataView`:{let{buffer:e}=new Uint8Array(o);return n(new DataView(e),o)}}return n(Si(a,o),i)};return r},wi=e=>Ci(new Map,e)(0),Ti=``,{toString:Ei}={},{keys:Di}=Object,Oi=e=>{let t=typeof e;if(t!==`object`||!e)return[0,t];let n=Ei.call(e).slice(8,-1);switch(n){case`Array`:return[1,Ti];case`Object`:return[2,Ti];case`Date`:return[3,Ti];case`RegExp`:return[4,Ti];case`Map`:return[5,Ti];case`Set`:return[6,Ti];case`DataView`:return[1,n]}return n.includes(`Array`)?[1,n]:e instanceof Error?[7,e.name||`Error`]:[2,n]},ki=([e,t])=>e===0&&(t===`function`||t===`symbol`),Ai=(e,t,n,r)=>{let i=(e,t)=>{let i=r.push(e)-1;return n.set(t,i),i},a=r=>{if(n.has(r))return n.get(r);let[o,s]=Oi(r);switch(o){case 0:{let t=r;switch(s){case`bigint`:o=8,t=r.toString();break;case`function`:case`symbol`:if(e)throw TypeError(`unable to serialize `+s);t=null;break;case`undefined`:return i([-1],r)}return i([o,t],r)}case 1:{if(s){let e=r;return s===`DataView`?e=new Uint8Array(r.buffer):s===`ArrayBuffer`&&(e=new Uint8Array(r)),i([s,[...e]],r)}let e=[],t=i([o,e],r);for(let t of r)e.push(a(t));return t}case 2:{if(s)switch(s){case`BigInt`:return i([s,r.toString()],r);case`Boolean`:case`Number`:case`String`:return i([s,r.valueOf()],r)}if(t&&`toJSON`in r)return a(r.toJSON());let n=[],c=i([o,n],r);for(let t of Di(r))(e||!ki(Oi(r[t])))&&n.push([a(t),a(r[t])]);return c}case 3:return i([o,isNaN(r.getTime())?Ti:r.toISOString()],r);case 4:{let{source:e,flags:t}=r;return i([o,{source:e,flags:t}],r)}case 5:{let t=[],n=i([o,t],r);for(let[n,i]of r)(e||!(ki(Oi(n))||ki(Oi(i))))&&t.push([a(n),a(i)]);return n}case 6:{let t=[],n=i([o,t],r);for(let n of r)(e||!ki(Oi(n)))&&t.push(a(n));return n}}let{message:c}=r;return i([o,{name:s,message:c}],r)};return a},ji=(e,{json:t,lossy:n}={})=>{let r=[];return Ai(!(t||n),!!t,new Map,r)(e),r},Mi=typeof structuredClone==`function`?(e,t)=>t&&(`json`in t||`lossy`in t)?wi(ji(e,t)):structuredClone(e):(e,t)=>wi(ji(e,t));function Ni(e,t){let n=[{type:`text`,value:`↩`}];return t>1&&n.push({type:`element`,tagName:`sup`,properties:{},children:[{type:`text`,value:String(t)}]}),n}function Pi(e,t){return`Back to reference `+(e+1)+(t>1?`-`+t:``)}function Fi(e){let t=typeof e.options.clobberPrefix==`string`?e.options.clobberPrefix:`user-content-`,n=e.options.footnoteBackContent||Ni,r=e.options.footnoteBackLabel||Pi,i=e.options.footnoteLabel||`Footnotes`,a=e.options.footnoteLabelTagName||`h2`,o=e.options.footnoteLabelProperties||{className:[`sr-only`]},s=[],c=-1;for(;++c0&&d.push({type:`text`,value:` `});let e=typeof n==`string`?n:n(c,u);typeof e==`string`&&(e={type:`text`,value:e}),d.push({type:`element`,tagName:`a`,properties:{href:`#`+t+`fnref-`+l+(u>1?`-`+u:``),dataFootnoteBackref:``,ariaLabel:typeof r==`string`?r:r(c,u),className:[`data-footnote-backref`]},children:Array.isArray(e)?e:[e]})}let p=a[a.length-1];if(p&&p.type===`element`&&p.tagName===`p`){let e=p.children[p.children.length-1];e&&e.type===`text`?e.value+=` `:p.children.push({type:`text`,value:` `}),p.children.push(...d)}else a.push(...d);let m={type:`element`,tagName:`li`,properties:{id:t+`fn-`+l},children:e.wrap(a,!0)};e.patch(i,m),s.push(m)}if(s.length!==0)return{type:`element`,tagName:`section`,properties:{dataFootnotes:!0,className:[`footnotes`]},children:[{type:`element`,tagName:a,properties:{...Mi(o),id:`footnote-label`},children:[{type:`text`,value:i}]},{type:`text`,value:` +`},{type:`element`,tagName:`ol`,properties:{},children:e.wrap(s,!0)},{type:`text`,value:` +`}]}}var Ii=(function(e){if(e==null)return Vi;if(typeof e==`function`)return Bi(e);if(typeof e==`object`)return Array.isArray(e)?Li(e):Ri(e);if(typeof e==`string`)return zi(e);throw Error(`Expected function, string, or object as test`)});function Li(e){let t=[],n=-1;for(;++n`:``))+`)`})}return u;function u(){let l=Wi,u,d,f;if((!t||a(e,i,c[c.length-1]||void 0))&&(l=Ki(n(e,c)),l[0]===!1))return l;if(`children`in e&&e.children){let t=e;if(t.children&&l[0]!==`skip`)for(d=(r?t.children.length:-1)+o,f=c.concat(t);d>-1&&d0&&n.push({type:`text`,value:` +`}),n}function ta(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function na(e,t){let n=Xi(e,t),r=n.one(e,void 0),i=Fi(n),a=Array.isArray(r)?{type:`root`,children:r}:r||{type:`root`,children:[]};return i&&(`children`in a,a.children.push({type:`text`,value:` +`},i)),a}function ra(e,t){return e&&`run`in e?async function(n,r){let i=na(n,{file:r,...t});await e.run(i,r)}:function(n,r){return na(n,{file:r,...e||t})}}function ia(e){if(e)throw e}var aa=r(((e,t)=>{var n=Object.prototype.hasOwnProperty,r=Object.prototype.toString,i=Object.defineProperty,a=Object.getOwnPropertyDescriptor,o=function(e){return typeof Array.isArray==`function`?Array.isArray(e):r.call(e)===`[object Array]`},s=function(e){if(!e||r.call(e)!==`[object Object]`)return!1;var t=n.call(e,`constructor`),i=e.constructor&&e.constructor.prototype&&n.call(e.constructor.prototype,`isPrototypeOf`);if(e.constructor&&!t&&!i)return!1;for(var a in e);return a===void 0||n.call(e,a)},c=function(e,t){i&&t.name===`__proto__`?i(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},l=function(e,t){if(t===`__proto__`){if(!n.call(e,t))return;if(a)return a(e,t).value}return e[t]};t.exports=function e(){var t,n,r,i,a,u,d=arguments[0],f=1,p=arguments.length,m=!1;for(typeof d==`boolean`&&(m=d,d=arguments[1]||{},f=2),(d==null||typeof d!=`object`&&typeof d!=`function`)&&(d={});ft.length,o;r&&t.push(i);try{o=e.apply(this,t)}catch(e){let t=e;if(r&&n)throw t;return i(t)}r||(o&&o.then&&typeof o.then==`function`?o.then(a,i):o instanceof Error?i(o):a(o))}function i(e,...r){n||(n=!0,t(e,...r))}function a(e){i(null,e)}}var Z={basename:la,dirname:ua,extname:da,join:fa,sep:`/`};function la(e,t){if(t!==void 0&&typeof t!=`string`)throw TypeError(`"ext" argument must be a string`);ha(e);let n=0,r=-1,i=e.length,a;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else r<0&&(a=!0,r=i+1);return r<0?``:e.slice(n,r)}if(t===e)return``;let o=-1,s=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else o<0&&(a=!0,o=i+1),s>-1&&(e.codePointAt(i)===t.codePointAt(s--)?s<0&&(r=i):(s=-1,r=o));return n===r?r=o:r<0&&(r=e.length),e.slice(n,r)}function ua(e){if(ha(e),e.length===0)return`.`;let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||=!0;return t<0?e.codePointAt(0)===47?`/`:`.`:t===1&&e.codePointAt(0)===47?`//`:e.slice(0,t)}function da(e){ha(e);let t=e.length,n=-1,r=0,i=-1,a=0,o;for(;t--;){let s=e.codePointAt(t);if(s===47){if(o){r=t+1;break}continue}n<0&&(o=!0,n=t+1),s===46?i<0?i=t:a!==1&&(a=1):i>-1&&(a=-1)}return i<0||n<0||a===0||a===1&&i===n-1&&i===r+1?``:e.slice(i,n)}function fa(...e){let t=-1,n;for(;++t0&&e.codePointAt(e.length-1)===47&&(n+=`/`),t?`/`+n:n}function ma(e,t){let n=``,r=0,i=-1,a=0,o=-1,s,c;for(;++o<=e.length;){if(o2){if(c=n.lastIndexOf(`/`),c!==n.length-1){c<0?(n=``,r=0):(n=n.slice(0,c),r=n.length-1-n.lastIndexOf(`/`)),i=o,a=0;continue}}else if(n.length>0){n=``,r=0,i=o,a=0;continue}}t&&(n=n.length>0?n+`/..`:`..`,r=2)}else n.length>0?n+=`/`+e.slice(i+1,o):n=e.slice(i+1,o),r=o-i-1;i=o,a=0}else s===46&&a>-1?a++:a=-1}return n}function ha(e){if(typeof e!=`string`)throw TypeError(`Path must be a string. Received `+JSON.stringify(e))}var ga={cwd:_a};function _a(){return`/`}function va(e){return!!(typeof e==`object`&&e&&`href`in e&&e.href&&`protocol`in e&&e.protocol&&e.auth===void 0)}function ya(e){if(typeof e==`string`)e=new URL(e);else if(!va(e)){let t=TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code=`ERR_INVALID_ARG_TYPE`,t}if(e.protocol!==`file:`){let e=TypeError(`The URL must be of scheme file`);throw e.code=`ERR_INVALID_URL_SCHEME`,e}return ba(e)}function ba(e){if(e.hostname!==``){let e=TypeError(`File URL host must be "localhost" or empty on darwin`);throw e.code=`ERR_INVALID_FILE_URL_HOST`,e}let t=e.pathname,n=-1;for(;++n0){let[r,...a]=t,o=n[i][1];oa(o)&&oa(r)&&(r=(0,Oa.default)(!0,o,r)),n[i]=[e,r,...a]}}}}().freeze();function ja(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `parser`")}function Ma(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `compiler`")}function Na(e,t){if(t)throw Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function Pa(e){if(!oa(e)||typeof e.type!=`string`)throw TypeError("Expected node, got `"+e+"`")}function Fa(e,t,n){if(!n)throw Error("`"+e+"` finished async. Use `"+t+"` instead")}function Ia(e){return La(e)?e:new Sa(e)}function La(e){return!!(e&&typeof e==`object`&&`message`in e&&`messages`in e)}function Ra(e){return typeof e==`string`||za(e)}function za(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}var Ba=n();e();var Va=[],Ha={allowDangerousHtml:!0},Ua=/^(https?|ircs?|mailto|xmpp)$/i,Wa=[{from:`astPlugins`,id:`remove-buggy-html-in-markdown-parser`},{from:`allowDangerousHtml`,id:`remove-buggy-html-in-markdown-parser`},{from:`allowNode`,id:`replace-allownode-allowedtypes-and-disallowedtypes`,to:`allowElement`},{from:`allowedTypes`,id:`replace-allownode-allowedtypes-and-disallowedtypes`,to:`allowedElements`},{from:`className`,id:`remove-classname`},{from:`disallowedTypes`,id:`replace-allownode-allowedtypes-and-disallowedtypes`,to:`disallowedElements`},{from:`escapeHtml`,id:`remove-buggy-html-in-markdown-parser`},{from:`includeElementIndex`,id:`#remove-includeelementindex`},{from:`includeNodeIndex`,id:`change-includenodeindex-to-includeelementindex`},{from:`linkTarget`,id:`remove-linktarget`},{from:`plugins`,id:`change-plugins-to-remarkplugins`,to:`remarkPlugins`},{from:`rawSourcePos`,id:`#remove-rawsourcepos`},{from:`renderers`,id:`change-renderers-to-components`,to:`components`},{from:`source`,id:`change-source-to-children`,to:`children`},{from:`sourcePos`,id:`#remove-sourcepos`},{from:`transformImageUri`,id:`#add-urltransform`,to:`urlTransform`},{from:`transformLinkUri`,id:`#add-urltransform`,to:`urlTransform`}];function Ga(e){let t=Ka(e),n=qa(e);return Ja(t.runSync(t.parse(n),n),e)}function Ka(e){let t=e.rehypePlugins||Va,n=e.remarkPlugins||Va,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...Ha}:Ha;return Aa().use(Hr).use(n).use(ra,r).use(t)}function qa(e){let t=e.children||``,n=new Sa;return typeof t==`string`?n.value=t:``+t,n}function Ja(e,t){let n=t.allowedElements,r=t.allowElement,i=t.components,a=t.disallowedElements,o=t.skipHtml,s=t.unwrapDisallowed,c=t.urlTransform||Ya;for(let e of Wa)Object.hasOwn(t,e.from)&&``+e.from+(e.to?"use `"+e.to+"` instead":`remove it`)+e.id;return qi(e,l),De(e,{Fragment:Ba.Fragment,components:i,ignoreInvalidStyle:!0,jsx:Ba.jsx,jsxs:Ba.jsxs,passKeys:!0,passNode:!0});function l(e,t,i){if(e.type===`raw`&&i&&typeof t==`number`)return o?i.children.splice(t,1):i.children[t]={type:`text`,value:e.value},t;if(e.type===`element`){let t;for(t in Ye)if(Object.hasOwn(Ye,t)&&Object.hasOwn(e.properties,t)){let n=e.properties[t],r=Ye[t];(r===null||r.includes(e.tagName))&&(e.properties[t]=c(String(n||``),t,e))}}if(e.type===`element`){let o=n?!n.includes(e.tagName):a?a.includes(e.tagName):!1;if(!o&&r&&typeof t==`number`&&(o=!r(e,t,i)),o&&i&&typeof t==`number`)return s&&e.children?i.children.splice(t,1,...e.children):i.children.splice(t,1),t}}}function Ya(e){let t=e.indexOf(`:`),n=e.indexOf(`?`),r=e.indexOf(`#`),i=e.indexOf(`/`);return t===-1||i!==-1&&t>i||n!==-1&&t>n||r!==-1&&t>r||Ua.test(e.slice(0,t))?e:``}function Xa(e,t){let n=String(e);if(typeof t!=`string`)throw TypeError(`Expected character`);let r=0,i=n.indexOf(t);for(;i!==-1;)r++,i=n.indexOf(t,i+t.length);return r}function Za(e){if(typeof e!=`string`)throw TypeError(`Expected a string`);return e.replace(/[|\\{}()[\]^$+*?.]/g,`\\$&`).replace(/-/g,`\\x2d`)}function Qa(e,t,n){let r=Ii((n||{}).ignore||[]),i=$a(t),a=-1;for(;++a0?{type:`text`,value:a}:void 0),a===!1?r.lastIndex=n+1:(s!==n&&u.push({type:`text`,value:e.value.slice(s,n)}),Array.isArray(a)?u.push(...a):a&&u.push(a),s=n+d[0].length,l=!0),!r.global)break;d=r.exec(e.value)}return l?(s?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(`)`),i=Xa(e,`(`),a=Xa(e,`)`);for(;r!==-1&&i>a;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(`)`),a++;return[e,n]}function vo(e,t){let n=e.input.charCodeAt(e.index-1);return(e.index===0||mt(n)||pt(n))&&(!t||n!==47)}Oo.peek=Do;function yo(){this.buffer()}function bo(e){this.enter({type:`footnoteReference`,identifier:``,label:``},e)}function xo(){this.buffer()}function So(e){this.enter({type:`footnoteDefinition`,identifier:``,label:``,children:[]},e)}function Co(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=U(this.sliceSerialize(e)).toLowerCase(),n.label=t}function wo(e){this.exit(e)}function To(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=U(this.sliceSerialize(e)).toLowerCase(),n.label=t}function Eo(e){this.exit(e)}function Do(){return`[`}function Oo(e,t,n,r){let i=n.createTracker(r),a=i.move(`[^`),o=n.enter(`footnoteReference`),s=n.enter(`reference`);return a+=i.move(n.safe(n.associationId(e),{after:`]`,before:a})),s(),o(),a+=i.move(`]`),a}function ko(){return{enter:{gfmFootnoteCallString:yo,gfmFootnoteCall:bo,gfmFootnoteDefinitionLabelString:xo,gfmFootnoteDefinition:So},exit:{gfmFootnoteCallString:Co,gfmFootnoteCall:wo,gfmFootnoteDefinitionLabelString:To,gfmFootnoteDefinition:Eo}}}function Ao(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:Oo},unsafe:[{character:`[`,inConstruct:[`label`,`phrasing`,`reference`]}]};function n(e,n,r,i){let a=r.createTracker(i),o=a.move(`[^`),s=r.enter(`footnoteDefinition`),c=r.enter(`label`);return o+=a.move(r.safe(r.associationId(e),{before:o,after:`]`})),c(),o+=a.move(`]:`),e.children&&e.children.length>0&&(a.shift(4),o+=a.move((t?` +`:` `)+r.indentLines(r.containerFlow(e,a.current()),t?Mo:jo))),s(),o}}function jo(e,t,n){return t===0?e:Mo(e,t,n)}function Mo(e,t,n){return(n?``:` `)+e}var No=[`autolink`,`destinationLiteral`,`destinationRaw`,`reference`,`titleQuote`,`titleApostrophe`];Ro.peek=zo;function Po(){return{canContainEols:[`delete`],enter:{strikethrough:Io},exit:{strikethrough:Lo}}}function Fo(){return{unsafe:[{character:`~`,inConstruct:`phrasing`,notInConstruct:No}],handlers:{delete:Ro}}}function Io(e){this.enter({type:`delete`,children:[]},e)}function Lo(e){this.exit(e)}function Ro(e,t,n,r){let i=n.createTracker(r),a=n.enter(`strikethrough`),o=i.move(`~~`);return o+=n.containerPhrasing(e,{...i.current(),before:o,after:`~`}),o+=i.move(`~~`),a(),o}function zo(){return`~`}function Bo(e){return e.length}function Vo(e,t){let n=t||{},r=(n.align||[]).concat(),i=n.stringLength||Bo,a=[],o=[],s=[],c=[],l=0,u=-1;for(;++ul&&(l=e[u].length);++ac[a])&&(c[a]=e)}t.push(o)}o[u]=t,s[u]=r}let d=-1;if(typeof r==`object`&&`length`in r)for(;++dc[d]&&(c[d]=i),p[d]=i),f[d]=o}o.splice(1,0,f),s.splice(1,0,p),u=-1;let m=[];for(;++u `),a.shift(2);let o=n.indentLines(n.containerFlow(e,a.current()),Go);return i(),o}function Go(e,t,n){return`>`+(n?``:` `)+e}function Ko(e,t){return qo(e,t.inConstruct,!0)&&!qo(e,t.notInConstruct,!1)}function qo(e,t,n){if(typeof t==`string`&&(t=[t]),!t||t.length===0)return n;let r=-1;for(;++ro&&(o=a):a=1,i=r+t.length,r=n.indexOf(t,i);return o}function Xo(e,t){return!!(t.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function Zo(e){let t=e.options.fence||"`";if(t!=="`"&&t!==`~`)throw Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function Qo(e,t,n,r){let i=Zo(n),a=e.value||``,o=i==="`"?`GraveAccent`:`Tilde`;if(Xo(e,n)){let e=n.enter(`codeIndented`),t=n.indentLines(a,$o);return e(),t}let s=n.createTracker(r),c=i.repeat(Math.max(Yo(a,i)+1,3)),l=n.enter(`codeFenced`),u=s.move(c);if(e.lang){let t=n.enter(`codeFencedLang${o}`);u+=s.move(n.safe(e.lang,{before:u,after:` `,encode:["`"],...s.current()})),t()}if(e.lang&&e.meta){let t=n.enter(`codeFencedMeta${o}`);u+=s.move(` `),u+=s.move(n.safe(e.meta,{before:u,after:` +`,encode:["`"],...s.current()})),t()}return u+=s.move(` +`),a&&(u+=s.move(a+` +`)),u+=s.move(c),l(),u}function $o(e,t,n){return(n?``:` `)+e}function es(e){let t=e.options.quote||`"`;if(t!==`"`&&t!==`'`)throw Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function ts(e,t,n,r){let i=es(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.enter(`definition`),s=n.enter(`label`),c=n.createTracker(r),l=c.move(`[`);return l+=c.move(n.safe(n.associationId(e),{before:l,after:`]`,...c.current()})),l+=c.move(`]: `),s(),!e.url||/[\0- \u007F]/.test(e.url)?(s=n.enter(`destinationLiteral`),l+=c.move(`<`),l+=c.move(n.safe(e.url,{before:l,after:`>`,...c.current()})),l+=c.move(`>`)):(s=n.enter(`destinationRaw`),l+=c.move(n.safe(e.url,{before:l,after:e.title?` `:` +`,...c.current()}))),s(),e.title&&(s=n.enter(`title${a}`),l+=c.move(` `+i),l+=c.move(n.safe(e.title,{before:l,after:i,...c.current()})),l+=c.move(i),s()),o(),l}function ns(e){let t=e.options.emphasis||`*`;if(t!==`*`&&t!==`_`)throw Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function rs(e){return`&#x`+e.toString(16).toUpperCase()+`;`}function is(e,t,n){let r=Ct(e),i=Ct(t);return r===void 0?i===void 0?n===`_`?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}as.peek=os;function as(e,t,n,r){let i=ns(n),a=n.enter(`emphasis`),o=n.createTracker(r),s=o.move(i),c=o.move(n.containerPhrasing(e,{after:i,before:s,...o.current()})),l=c.charCodeAt(0),u=is(r.before.charCodeAt(r.before.length-1),l,i);u.inside&&(c=rs(l)+c.slice(1));let d=c.charCodeAt(c.length-1),f=is(r.after.charCodeAt(0),d,i);f.inside&&(c=c.slice(0,-1)+rs(d));let p=o.move(i);return a(),n.attentionEncodeSurroundingInfo={after:f.outside,before:u.outside},s+c+p}function os(e,t,n){return n.options.emphasis||`*`}function ss(e,t){let n=!1;return qi(e,function(e){if(`value`in e&&/\r?\n|\r/.test(e.value)||e.type===`break`)return n=!0,!1}),!!((!e.depth||e.depth<3)&&Ze(e)&&(t.options.setext||n))}function cs(e,t,n,r){let i=Math.max(Math.min(6,e.depth||1),1),a=n.createTracker(r);if(ss(e,n)){let t=n.enter(`headingSetext`),r=n.enter(`phrasing`),o=n.containerPhrasing(e,{...a.current(),before:` +`,after:` +`});return r(),t(),o+` +`+(i===1?`=`:`-`).repeat(o.length-(Math.max(o.lastIndexOf(`\r`),o.lastIndexOf(` +`))+1))}let o=`#`.repeat(i),s=n.enter(`headingAtx`),c=n.enter(`phrasing`);a.move(o+` `);let l=n.containerPhrasing(e,{before:`# `,after:` +`,...a.current()});return/^[\t ]/.test(l)&&(l=rs(l.charCodeAt(0))+l.slice(1)),l=l?o+` `+l:o,n.options.closeAtx&&(l+=` `+o),c(),s(),l}ls.peek=us;function ls(e){return e.value||``}function us(){return`<`}ds.peek=fs;function ds(e,t,n,r){let i=es(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.enter(`image`),s=n.enter(`label`),c=n.createTracker(r),l=c.move(`![`);return l+=c.move(n.safe(e.alt,{before:l,after:`]`,...c.current()})),l+=c.move(`](`),s(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(s=n.enter(`destinationLiteral`),l+=c.move(`<`),l+=c.move(n.safe(e.url,{before:l,after:`>`,...c.current()})),l+=c.move(`>`)):(s=n.enter(`destinationRaw`),l+=c.move(n.safe(e.url,{before:l,after:e.title?` `:`)`,...c.current()}))),s(),e.title&&(s=n.enter(`title${a}`),l+=c.move(` `+i),l+=c.move(n.safe(e.title,{before:l,after:i,...c.current()})),l+=c.move(i),s()),l+=c.move(`)`),o(),l}function fs(){return`!`}ps.peek=ms;function ps(e,t,n,r){let i=e.referenceType,a=n.enter(`imageReference`),o=n.enter(`label`),s=n.createTracker(r),c=s.move(`![`),l=n.safe(e.alt,{before:c,after:`]`,...s.current()});c+=s.move(l+`][`),o();let u=n.stack;n.stack=[],o=n.enter(`reference`);let d=n.safe(n.associationId(e),{before:c,after:`]`,...s.current()});return o(),n.stack=u,a(),i===`full`||!l||l!==d?c+=s.move(d+`]`):i===`shortcut`?c=c.slice(0,-1):c+=s.move(`]`),c}function ms(){return`!`}hs.peek=gs;function hs(e,t,n){let r=e.value||``,i="`",a=-1;for(;RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=` `+r+` `);++a\u007F]/.test(e.url))}vs.peek=ys;function vs(e,t,n,r){let i=es(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.createTracker(r),s,c;if(_s(e,n)){let t=n.stack;n.stack=[],s=n.enter(`autolink`);let r=o.move(`<`);return r+=o.move(n.containerPhrasing(e,{before:r,after:`>`,...o.current()})),r+=o.move(`>`),s(),n.stack=t,r}s=n.enter(`link`),c=n.enter(`label`);let l=o.move(`[`);return l+=o.move(n.containerPhrasing(e,{before:l,after:`](`,...o.current()})),l+=o.move(`](`),c(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(c=n.enter(`destinationLiteral`),l+=o.move(`<`),l+=o.move(n.safe(e.url,{before:l,after:`>`,...o.current()})),l+=o.move(`>`)):(c=n.enter(`destinationRaw`),l+=o.move(n.safe(e.url,{before:l,after:e.title?` `:`)`,...o.current()}))),c(),e.title&&(c=n.enter(`title${a}`),l+=o.move(` `+i),l+=o.move(n.safe(e.title,{before:l,after:i,...o.current()})),l+=o.move(i),c()),l+=o.move(`)`),s(),l}function ys(e,t,n){return _s(e,n)?`<`:`[`}bs.peek=xs;function bs(e,t,n,r){let i=e.referenceType,a=n.enter(`linkReference`),o=n.enter(`label`),s=n.createTracker(r),c=s.move(`[`),l=n.containerPhrasing(e,{before:c,after:`]`,...s.current()});c+=s.move(l+`][`),o();let u=n.stack;n.stack=[],o=n.enter(`reference`);let d=n.safe(n.associationId(e),{before:c,after:`]`,...s.current()});return o(),n.stack=u,a(),i===`full`||!l||l!==d?c+=s.move(d+`]`):i===`shortcut`?c=c.slice(0,-1):c+=s.move(`]`),c}function xs(){return`[`}function Ss(e){let t=e.options.bullet||`*`;if(t!==`*`&&t!==`+`&&t!==`-`)throw Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function Cs(e){let t=Ss(e),n=e.options.bulletOther;if(!n)return t===`*`?`-`:`*`;if(n!==`*`&&n!==`+`&&n!==`-`)throw Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function ws(e){let t=e.options.bulletOrdered||`.`;if(t!==`.`&&t!==`)`)throw Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function Ts(e){let t=e.options.rule||`*`;if(t!==`*`&&t!==`-`&&t!==`_`)throw Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function Es(e,t,n,r){let i=n.enter(`list`),a=n.bulletCurrent,o=e.ordered?ws(n):Ss(n),s=e.ordered?o===`.`?`)`:`.`:Cs(n),c=t&&n.bulletLastUsed?o===n.bulletLastUsed:!1;if(!e.ordered){let t=e.children?e.children[0]:void 0;if((o===`*`||o===`-`)&&t&&(!t.children||!t.children[0])&&n.stack[n.stack.length-1]===`list`&&n.stack[n.stack.length-2]===`listItem`&&n.stack[n.stack.length-3]===`list`&&n.stack[n.stack.length-4]===`listItem`&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(c=!0),Ts(n)===o&&t){let t=-1;for(;++t-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+a);let o=a.length+1;(i===`tab`||i===`mixed`&&(t&&t.type===`list`&&t.spread||e.spread))&&(o=Math.ceil(o/4)*4);let s=n.createTracker(r);s.move(a+` `.repeat(o-a.length)),s.shift(o);let c=n.enter(`listItem`),l=n.indentLines(n.containerFlow(e,s.current()),u);return c(),l;function u(e,t,n){return t?(n?``:` `.repeat(o))+e:(n?a:a+` `.repeat(o-a.length))+e}}function ks(e,t,n,r){let i=n.enter(`paragraph`),a=n.enter(`phrasing`),o=n.containerPhrasing(e,r);return a(),i(),o}var As=Ii([`break`,`delete`,`emphasis`,`footnote`,`footnoteReference`,`image`,`imageReference`,`inlineCode`,`inlineMath`,`link`,`linkReference`,`mdxJsxTextElement`,`mdxTextExpression`,`strong`,`text`,`textDirective`]);function js(e,t,n,r){return(e.children.some(function(e){return As(e)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function Ms(e){let t=e.options.strong||`*`;if(t!==`*`&&t!==`_`)throw Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}Ns.peek=Ps;function Ns(e,t,n,r){let i=Ms(n),a=n.enter(`strong`),o=n.createTracker(r),s=o.move(i+i),c=o.move(n.containerPhrasing(e,{after:i,before:s,...o.current()})),l=c.charCodeAt(0),u=is(r.before.charCodeAt(r.before.length-1),l,i);u.inside&&(c=rs(l)+c.slice(1));let d=c.charCodeAt(c.length-1),f=is(r.after.charCodeAt(0),d,i);f.inside&&(c=c.slice(0,-1)+rs(d));let p=o.move(i+i);return a(),n.attentionEncodeSurroundingInfo={after:f.outside,before:u.outside},s+c+p}function Ps(e,t,n){return n.options.strong||`*`}function Fs(e,t,n,r){return n.safe(e.value,r)}function Is(e){let t=e.options.ruleRepetition||3;if(t<3)throw Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function Ls(e,t,n){let r=(Ts(n)+(n.options.ruleSpaces?` `:``)).repeat(Is(n));return n.options.ruleSpaces?r.slice(0,-1):r}var Rs={blockquote:Wo,break:Jo,code:Qo,definition:ts,emphasis:as,hardBreak:Jo,heading:cs,html:ls,image:ds,imageReference:ps,inlineCode:hs,link:vs,linkReference:bs,list:Es,listItem:Os,paragraph:ks,root:js,strong:Ns,text:Fs,thematicBreak:Ls};function zs(){return{enter:{table:Bs,tableData:Ws,tableHeader:Ws,tableRow:Hs},exit:{codeText:Gs,table:Vs,tableData:Us,tableHeader:Us,tableRow:Us}}}function Bs(e){let t=e._align;this.enter({type:`table`,align:t.map(function(e){return e===`none`?null:e}),children:[]},e),this.data.inTable=!0}function Vs(e){this.exit(e),this.data.inTable=void 0}function Hs(e){this.enter({type:`tableRow`,children:[]},e)}function Us(e){this.exit(e)}function Ws(e){this.enter({type:`tableCell`,children:[]},e)}function Gs(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,Ks));let n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function Ks(e,t){return t===`|`?t:e}function qs(e){let t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,a=n?` `:`|`;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:f,table:o,tableCell:c,tableRow:s}};function o(e,t,n,r){return l(u(e,n,r),e.align)}function s(e,t,n,r){let i=l([d(e,n,r)]);return i.slice(0,i.indexOf(` +`))}function c(e,t,n,r){let i=n.enter(`tableCell`),o=n.enter(`phrasing`),s=n.containerPhrasing(e,{...r,before:a,after:a});return o(),i(),s}function l(e,t){return Vo(e,{align:t,alignDelimiters:r,padding:n,stringLength:i})}function u(e,t,n){let r=e.children,i=-1,a=[],o=t.enter(`table`);for(;++i0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}var Tc={tokenize:Nc,partial:!0};function Ec(){return{document:{91:{name:`gfmFootnoteDefinition`,tokenize:Ac,continuation:{tokenize:jc},exit:Mc}},text:{91:{name:`gfmFootnoteCall`,tokenize:kc},93:{name:`gfmPotentialFootnoteCall`,add:`after`,tokenize:Dc,resolveTo:Oc}}}}function Dc(e,t,n){let r=this,i=r.events.length,a=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),o;for(;i--;){let e=r.events[i][1];if(e.type===`labelImage`){o=e;break}if(e.type===`gfmFootnoteCall`||e.type===`labelLink`||e.type===`label`||e.type===`image`||e.type===`link`)break}return s;function s(i){if(!o||!o._balanced)return n(i);let s=U(r.sliceSerialize({start:o.end,end:r.now()}));return s.codePointAt(0)!==94||!a.includes(s.slice(1))?n(i):(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(i),e.exit(`gfmFootnoteCallLabelMarker`),t(i))}}function Oc(e,t){let n=e.length;for(;n--;)if(e[n][1].type===`labelImage`&&e[n][0]===`enter`){e[n][1];break}e[n+1][1].type=`data`,e[n+3][1].type=`gfmFootnoteCallLabelMarker`;let r={type:`gfmFootnoteCall`,start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:`gfmFootnoteCallMarker`,start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;let a={type:`gfmFootnoteCallString`,start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},o={type:`chunkString`,contentType:`string`,start:Object.assign({},a.start),end:Object.assign({},a.end)},s=[e[n+1],e[n+2],[`enter`,r,t],e[n+3],e[n+4],[`enter`,i,t],[`exit`,i,t],[`enter`,a,t],[`enter`,o,t],[`exit`,o,t],[`exit`,a,t],e[e.length-2],e[e.length-1],[`exit`,r,t]];return e.splice(n,e.length-n+1,...s),e}function kc(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),a=0,o;return s;function s(t){return e.enter(`gfmFootnoteCall`),e.enter(`gfmFootnoteCallLabelMarker`),e.consume(t),e.exit(`gfmFootnoteCallLabelMarker`),c}function c(t){return t===94?(e.enter(`gfmFootnoteCallMarker`),e.consume(t),e.exit(`gfmFootnoteCallMarker`),e.enter(`gfmFootnoteCallString`),e.enter(`chunkString`).contentType=`string`,l):n(t)}function l(s){if(a>999||s===93&&!o||s===null||s===91||q(s))return n(s);if(s===93){e.exit(`chunkString`);let a=e.exit(`gfmFootnoteCallString`);return i.includes(U(r.sliceSerialize(a)))?(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(s),e.exit(`gfmFootnoteCallLabelMarker`),e.exit(`gfmFootnoteCall`),t):n(s)}return q(s)||(o=!0),a++,e.consume(s),s===92?u:l}function u(t){return t===91||t===92||t===93?(e.consume(t),a++,l):l(t)}}function Ac(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),a,o=0,s;return c;function c(t){return e.enter(`gfmFootnoteDefinition`)._container=!0,e.enter(`gfmFootnoteDefinitionLabel`),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),l}function l(t){return t===94?(e.enter(`gfmFootnoteDefinitionMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionMarker`),e.enter(`gfmFootnoteDefinitionLabelString`),e.enter(`chunkString`).contentType=`string`,u):n(t)}function u(t){if(o>999||t===93&&!s||t===null||t===91||q(t))return n(t);if(t===93){e.exit(`chunkString`);let n=e.exit(`gfmFootnoteDefinitionLabelString`);return a=U(r.sliceSerialize(n)),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),e.exit(`gfmFootnoteDefinitionLabel`),f}return q(t)||(s=!0),o++,e.consume(t),t===92?d:u}function d(t){return t===91||t===92||t===93?(e.consume(t),o++,u):u(t)}function f(t){return t===58?(e.enter(`definitionMarker`),e.consume(t),e.exit(`definitionMarker`),i.includes(a)||i.push(a),Y(e,p,`gfmFootnoteDefinitionWhitespace`)):n(t)}function p(e){return t(e)}}function jc(e,t,n){return e.check(jt,t,e.attempt(Tc,t,n))}function Mc(e){e.exit(`gfmFootnoteDefinition`)}function Nc(e,t,n){let r=this;return Y(e,i,`gfmFootnoteDefinitionIndent`,5);function i(e){let i=r.events[r.events.length-1];return i&&i[1].type===`gfmFootnoteDefinitionIndent`&&i[2].sliceSerialize(i[1],!0).length===4?t(e):n(e)}}function Pc(e){let t=(e||{}).singleTilde,n={name:`strikethrough`,tokenize:i,resolveAll:r};return t??=!0,{text:{126:n},insideSpan:{null:[n]},attentionMarkers:{null:[126]}};function r(e,t){let n=-1;for(;++n1?r(a):(e.consume(a),o++,c);if(o<2&&!t)return r(a);let l=e.exit(`strikethroughSequenceTemporary`),u=Ct(a);return l._open=!u||u===2&&!!s,l._close=!s||s===2&&!!u,n(a)}}}var Fc=class{constructor(){this.map=[]}add(e,t,n){Ic(this,e,t,n)}consume(e){if(this.map.sort(function(e,t){return e[0]-t[0]}),this.map.length===0)return;let t=this.map.length,n=[];for(;t>0;)--t,n.push(e.slice(this.map[t][0]+this.map[t][1]),this.map[t][2]),e.length=this.map[t][0];n.push(e.slice()),e.length=0;let r=n.pop();for(;r;){for(let t of r)e.push(t);r=n.pop()}this.map.length=0}};function Ic(e,t,n,r){let i=0;if(!(n===0&&r.length===0)){for(;i-1;){let e=r.events[t][1].type;if(e===`lineEnding`||e===`linePrefix`)t--;else break}let i=t>-1?r.events[t][1].type:null,a=i===`tableHead`||i===`tableRow`?S:c;return a===S&&r.parser.lazy[r.now().line]?n(e):a(e)}function c(t){return e.enter(`tableHead`),e.enter(`tableRow`),l(t)}function l(e){return e===124?u(e):(o=!0,a+=1,u(e))}function u(t){return t===null?n(t):K(t)?a>1?(a=0,r.interrupt=!0,e.exit(`tableRow`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),p):n(t):J(t)?Y(e,u,`whitespace`)(t):(a+=1,o&&(o=!1,i+=1),t===124?(e.enter(`tableCellDivider`),e.consume(t),e.exit(`tableCellDivider`),o=!0,u):(e.enter(`data`),d(t)))}function d(t){return t===null||t===124||q(t)?(e.exit(`data`),u(t)):(e.consume(t),t===92?f:d)}function f(t){return t===92||t===124?(e.consume(t),d):d(t)}function p(t){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(t):(e.enter(`tableDelimiterRow`),o=!1,J(t)?Y(e,m,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):m(t))}function m(t){return t===45||t===58?g(t):t===124?(o=!0,e.enter(`tableCellDivider`),e.consume(t),e.exit(`tableCellDivider`),h):x(t)}function h(t){return J(t)?Y(e,g,`whitespace`)(t):g(t)}function g(t){return t===58?(a+=1,o=!0,e.enter(`tableDelimiterMarker`),e.consume(t),e.exit(`tableDelimiterMarker`),_):t===45?(a+=1,_(t)):t===null||K(t)?b(t):x(t)}function _(t){return t===45?(e.enter(`tableDelimiterFiller`),v(t)):x(t)}function v(t){return t===45?(e.consume(t),v):t===58?(o=!0,e.exit(`tableDelimiterFiller`),e.enter(`tableDelimiterMarker`),e.consume(t),e.exit(`tableDelimiterMarker`),y):(e.exit(`tableDelimiterFiller`),y(t))}function y(t){return J(t)?Y(e,b,`whitespace`)(t):b(t)}function b(n){return n===124?m(n):n===null||K(n)?!o||i!==a?x(n):(e.exit(`tableDelimiterRow`),e.exit(`tableHead`),t(n)):x(n)}function x(e){return n(e)}function S(t){return e.enter(`tableRow`),C(t)}function C(n){return n===124?(e.enter(`tableCellDivider`),e.consume(n),e.exit(`tableCellDivider`),C):n===null||K(n)?(e.exit(`tableRow`),t(n)):J(n)?Y(e,C,`whitespace`)(n):(e.enter(`data`),w(n))}function w(t){return t===null||t===124||q(t)?(e.exit(`data`),C(t)):(e.consume(t),t===92?T:w)}function T(t){return t===92||t===124?(e.consume(t),w):w(t)}}function Bc(e,t){let n=-1,r=!0,i=0,a=[0,0,0,0],o=[0,0,0,0],s=!1,c=0,l,u,d,f=new Fc;for(;++nn[2]+1){let t=n[2]+1,r=n[3]-n[2]-1;e.add(t,r,[])}}e.add(n[3]+1,0,[[`exit`,o,t]])}return i!==void 0&&(a.end=Object.assign({},Uc(t.events,i)),e.add(i,0,[[`exit`,a,t]]),a=void 0),a}function Hc(e,t,n,r,i){let a=[],o=Uc(t.events,n);i&&(i.end=Object.assign({},o),a.push([`exit`,i,t])),r.end=Object.assign({},o),a.push([`exit`,r,t]),e.add(n+1,0,a)}function Uc(e,t){let n=e[t],r=n[0]===`enter`?`start`:`end`;return n[1][r]}var Wc={name:`tasklistCheck`,tokenize:Kc};function Gc(){return{text:{91:Wc}}}function Kc(e,t,n){let r=this;return i;function i(t){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(t):(e.enter(`taskListCheck`),e.enter(`taskListCheckMarker`),e.consume(t),e.exit(`taskListCheckMarker`),a)}function a(t){return q(t)?(e.enter(`taskListCheckValueUnchecked`),e.consume(t),e.exit(`taskListCheckValueUnchecked`),o):t===88||t===120?(e.enter(`taskListCheckValueChecked`),e.consume(t),e.exit(`taskListCheckValueChecked`),o):n(t)}function o(t){return t===93?(e.enter(`taskListCheckMarker`),e.consume(t),e.exit(`taskListCheckMarker`),e.exit(`taskListCheck`),s):n(t)}function s(r){return K(r)?t(r):J(r)?e.check({tokenize:qc},t,n)(r):n(r)}}function qc(e,t,n){return Y(e,r,`whitespace`);function r(e){return e===null?n(e):t(e)}}function Jc(e){return it([uc(),Ec(),Pc(e),Rc(),Gc()])}var Yc={};function Xc(e){let t=this,n=e||Yc,r=t.data(),i=r.micromarkExtensions||=[],a=r.fromMarkdownExtensions||=[],o=r.toMarkdownExtensions||=[];i.push(Jc(n)),a.push($s()),o.push(ec(n))}var Zc=(function(e,t,n){let r=Ii(n);if(!e||!e.type||!e.children)throw Error(`Expected parent node`);if(typeof t==`number`){if(t<0||t===1/0)throw Error(`Expected positive finite number as index`)}else if(t=e.children.indexOf(t),t<0)throw Error(`Expected child node or index`);for(;++tl&&(l=e):e&&(l!==void 0&&l>-1&&c.push(` +`.repeat(l)||` `),l=-1,c.push(e))}return c.join(``)}function pl(e,t,n){return e.type===`element`?ml(e,t,n):e.type===`text`?n.whitespace===`normal`?hl(e,n):gl(e):[]}function ml(e,t,n){let r=vl(e,n),i=e.children||[],a=-1,o=[];if(ul(e))return o;let s,c;for(ol(e)||ll(e)&&Zc(t,e,ll)?c=` +`:cl(e)?(s=2,c=2):dl(e)&&(s=1,c=1);++a]+>`)+`)`,a={className:`type`,begin:`\\b[a-z\\d_]*_t\\b`},o={className:`string`,variants:[{begin:`(u8?|U|L)?"`,end:`"`,illegal:`\\n`,contains:[e.BACKSLASH_ESCAPE]},{begin:`(u8?|U|L)?'(\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)|.)`,end:`'`,illegal:`.`},e.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},s={className:`number`,variants:[{begin:`[+-]?(?:(?:[0-9](?:'?[0-9])*\\.(?:[0-9](?:'?[0-9])*)?|\\.[0-9](?:'?[0-9])*)(?:[Ee][+-]?[0-9](?:'?[0-9])*)?|[0-9](?:'?[0-9])*[Ee][+-]?[0-9](?:'?[0-9])*|0[Xx](?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*(?:\\.(?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)?)?|\\.[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)[Pp][+-]?[0-9](?:'?[0-9])*)(?:[Ff](?:16|32|64|128)?|(BF|bf)16|[Ll]|)`},{begin:`[+-]?\\b(?:0[Bb][01](?:'?[01])*|0[Xx][0-9A-Fa-f](?:'?[0-9A-Fa-f])*|0(?:'?[0-7])*|[1-9](?:'?[0-9])*)(?:[Uu](?:LL?|ll?)|[Uu][Zz]?|(?:LL?|ll?)[Uu]?|[Zz][Uu]|)`}],relevance:0},c={className:`meta`,begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:`if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include`},contains:[{begin:/\\\n/,relevance:0},e.inherit(o,{className:`string`}),{className:`string`,begin:/<.*?>/},n,e.C_BLOCK_COMMENT_MODE]},l={className:`title`,begin:t.optional(r)+e.IDENT_RE,relevance:0},u=t.optional(r)+e.IDENT_RE+`\\s*\\(`,d=`alignas.alignof.and.and_eq.asm.atomic_cancel.atomic_commit.atomic_noexcept.auto.bitand.bitor.break.case.catch.class.co_await.co_return.co_yield.compl.concept.const_cast|10.consteval.constexpr.constinit.continue.decltype.default.delete.do.dynamic_cast|10.else.enum.explicit.export.extern.false.final.for.friend.goto.if.import.inline.module.mutable.namespace.new.noexcept.not.not_eq.nullptr.operator.or.or_eq.override.private.protected.public.reflexpr.register.reinterpret_cast|10.requires.return.sizeof.static_assert.static_cast|10.struct.switch.synchronized.template.this.thread_local.throw.transaction_safe.transaction_safe_dynamic.true.try.typedef.typeid.typename.union.using.virtual.volatile.while.xor.xor_eq`.split(`.`),f=[`bool`,`char`,`char16_t`,`char32_t`,`char8_t`,`double`,`float`,`int`,`long`,`short`,`void`,`wchar_t`,`unsigned`,`signed`,`const`,`static`],p=`any.auto_ptr.barrier.binary_semaphore.bitset.complex.condition_variable.condition_variable_any.counting_semaphore.deque.false_type.flat_map.flat_set.future.imaginary.initializer_list.istringstream.jthread.latch.lock_guard.multimap.multiset.mutex.optional.ostringstream.packaged_task.pair.promise.priority_queue.queue.recursive_mutex.recursive_timed_mutex.scoped_lock.set.shared_future.shared_lock.shared_mutex.shared_timed_mutex.shared_ptr.stack.string_view.stringstream.timed_mutex.thread.true_type.tuple.unique_lock.unique_ptr.unordered_map.unordered_multimap.unordered_multiset.unordered_set.variant.vector.weak_ptr.wstring.wstring_view`.split(`.`),m=`abort.abs.acos.apply.as_const.asin.atan.atan2.calloc.ceil.cerr.cin.clog.cos.cosh.cout.declval.endl.exchange.exit.exp.fabs.floor.fmod.forward.fprintf.fputs.free.frexp.fscanf.future.invoke.isalnum.isalpha.iscntrl.isdigit.isgraph.islower.isprint.ispunct.isspace.isupper.isxdigit.labs.launder.ldexp.log.log10.make_pair.make_shared.make_shared_for_overwrite.make_tuple.make_unique.malloc.memchr.memcmp.memcpy.memset.modf.move.pow.printf.putchar.puts.realloc.scanf.sin.sinh.snprintf.sprintf.sqrt.sscanf.std.stderr.stdin.stdout.strcat.strchr.strcmp.strcpy.strcspn.strlen.strncat.strncmp.strncpy.strpbrk.strrchr.strspn.strstr.swap.tan.tanh.terminate.to_underlying.tolower.toupper.vfprintf.visit.vprintf.vsprintf`.split(`.`),h={type:f,keyword:d,literal:[`NULL`,`false`,`nullopt`,`nullptr`,`true`],built_in:[`_Pragma`],_type_hints:p},g={className:`function.dispatch`,relevance:0,keywords:{_hint:m},begin:t.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,e.IDENT_RE,t.lookahead(/(<[^<>]+>|)\s*\(/))},_=[g,c,a,n,e.C_BLOCK_COMMENT_MODE,s,o],v={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:`new throw return else`,end:/;/}],keywords:h,contains:_.concat([{begin:/\(/,end:/\)/,keywords:h,contains:_.concat([`self`]),relevance:0}]),relevance:0},y={className:`function`,begin:`(`+i+`[\\*&\\s]+)+`+u,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:h,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:`decltype\\(auto\\)`,keywords:h,relevance:0},{begin:u,returnBegin:!0,contains:[l],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[o,s]},{relevance:0,match:/,/},{className:`params`,begin:/\(/,end:/\)/,keywords:h,relevance:0,contains:[n,e.C_BLOCK_COMMENT_MODE,o,s,a,{begin:/\(/,end:/\)/,keywords:h,relevance:0,contains:[`self`,n,e.C_BLOCK_COMMENT_MODE,o,s,a]}]},a,n,e.C_BLOCK_COMMENT_MODE,c]};return{name:`C++`,aliases:[`cc`,`c++`,`h++`,`hpp`,`hh`,`hxx`,`cxx`],keywords:h,illegal:``,keywords:h,contains:[`self`,a]},{begin:e.IDENT_RE+`::`,keywords:h},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:`keyword`,3:`title.class`}}])}}function Cl(e){let t={type:[`boolean`,`byte`,`word`,`String`],built_in:`KeyboardController.MouseController.SoftwareSerial.EthernetServer.EthernetClient.LiquidCrystal.RobotControl.GSMVoiceCall.EthernetUDP.EsploraTFT.HttpClient.RobotMotor.WiFiClient.GSMScanner.FileSystem.Scheduler.GSMServer.YunClient.YunServer.IPAddress.GSMClient.GSMModem.Keyboard.Ethernet.Console.GSMBand.Esplora.Stepper.Process.WiFiUDP.GSM_SMS.Mailbox.USBHost.Firmata.PImage.Client.Server.GSMPIN.FileIO.Bridge.Serial.EEPROM.Stream.Mouse.Audio.Servo.File.Task.GPRS.WiFi.Wire.TFT.GSM.SPI.SD`.split(`.`),_hints:`setup.loop.runShellCommandAsynchronously.analogWriteResolution.retrieveCallingNumber.printFirmwareVersion.analogReadResolution.sendDigitalPortPair.noListenOnLocalhost.readJoystickButton.setFirmwareVersion.readJoystickSwitch.scrollDisplayRight.getVoiceCallStatus.scrollDisplayLeft.writeMicroseconds.delayMicroseconds.beginTransmission.getSignalStrength.runAsynchronously.getAsynchronously.listenOnLocalhost.getCurrentCarrier.readAccelerometer.messageAvailable.sendDigitalPorts.lineFollowConfig.countryNameWrite.runShellCommand.readStringUntil.rewindDirectory.readTemperature.setClockDivider.readLightSensor.endTransmission.analogReference.detachInterrupt.countryNameRead.attachInterrupt.encryptionType.readBytesUntil.robotNameWrite.readMicrophone.robotNameRead.cityNameWrite.userNameWrite.readJoystickY.readJoystickX.mouseReleased.openNextFile.scanNetworks.noInterrupts.digitalWrite.beginSpeaker.mousePressed.isActionDone.mouseDragged.displayLogos.noAutoscroll.addParameter.remoteNumber.getModifiers.keyboardRead.userNameRead.waitContinue.processInput.parseCommand.printVersion.readNetworks.writeMessage.blinkVersion.cityNameRead.readMessage.setDataMode.parsePacket.isListening.setBitOrder.beginPacket.isDirectory.motorsWrite.drawCompass.digitalRead.clearScreen.serialEvent.rightToLeft.setTextSize.leftToRight.requestFrom.keyReleased.compassRead.analogWrite.interrupts.WiFiServer.disconnect.playMelody.parseFloat.autoscroll.getPINUsed.setPINUsed.setTimeout.sendAnalog.readSlider.analogRead.beginWrite.createChar.motorsStop.keyPressed.tempoWrite.readButton.subnetMask.debugPrint.macAddress.writeGreen.randomSeed.attachGPRS.readString.sendString.remotePort.releaseAll.mouseMoved.background.getXChange.getYChange.answerCall.getResult.voiceCall.endPacket.constrain.getSocket.writeJSON.getButton.available.connected.findUntil.readBytes.exitValue.readGreen.writeBlue.startLoop.IPAddress.isPressed.sendSysex.pauseMode.gatewayIP.setCursor.getOemKey.tuneWrite.noDisplay.loadImage.switchPIN.onRequest.onReceive.changePIN.playFile.noBuffer.parseInt.overflow.checkPIN.knobRead.beginTFT.bitClear.updateIR.bitWrite.position.writeRGB.highByte.writeRed.setSpeed.readBlue.noStroke.remoteIP.transfer.shutdown.hangCall.beginSMS.endWrite.attached.maintain.noCursor.checkReg.checkPUK.shiftOut.isValid.shiftIn.pulseIn.connect.println.localIP.pinMode.getIMEI.display.noBlink.process.getBand.running.beginSD.drawBMP.lowByte.setBand.release.bitRead.prepare.pointTo.readRed.setMode.noFill.remove.listen.stroke.detach.attach.noTone.exists.buffer.height.bitSet.circle.config.cursor.random.IRread.setDNS.endSMS.getKey.micros.millis.begin.print.write.ready.flush.width.isPIN.blink.clear.press.mkdir.rmdir.close.point.yield.image.BSSID.click.delay.read.text.move.peek.beep.rect.line.open.seek.fill.size.turn.stop.home.find.step.tone.sqrt.RSSI.SSID.end.bit.tan.cos.sin.pow.map.abs.max.min.get.run.put`.split(`.`),literal:[`DIGITAL_MESSAGE`,`FIRMATA_STRING`,`ANALOG_MESSAGE`,`REPORT_DIGITAL`,`REPORT_ANALOG`,`INPUT_PULLUP`,`SET_PIN_MODE`,`INTERNAL2V56`,`SYSTEM_RESET`,`LED_BUILTIN`,`INTERNAL1V1`,`SYSEX_START`,`INTERNAL`,`EXTERNAL`,`DEFAULT`,`OUTPUT`,`INPUT`,`HIGH`,`LOW`]},n=Sl(e),r=n.keywords;return r.type=[...r.type,...t.type],r.literal=[...r.literal,...t.literal],r.built_in=[...r.built_in,...t.built_in],r._hints=t._hints,n.name=`Arduino`,n.aliases=[`ino`],n.supersetOf=`cpp`,n}function wl(e){let t=e.regex,n={},r={begin:/\$\{/,end:/\}/,contains:[`self`,{begin:/:-/,contains:[n]}]};Object.assign(n,{className:`variable`,variants:[{begin:t.concat(/\$[\w\d#@][\w\d_]*/,`(?![\\w\\d])(?![$])`)},r]});let i={className:`subst`,begin:/\$\(/,end:/\)/,contains:[e.BACKSLASH_ESCAPE]},a=e.inherit(e.COMMENT(),{match:[/(^|\s)/,/#.*$/],scope:{2:`comment`}}),o={begin:/<<-?\s*(?=\w+)/,starts:{contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,className:`string`})]}},s={className:`string`,begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,n,i]};i.contains.push(s);let c={match:/\\"/},l={className:`string`,begin:/'/,end:/'/},u={match:/\\'/},d={begin:/\$?\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:`number`},e.NUMBER_MODE,n]},f=e.SHEBANG({binary:`(${[`fish`,`bash`,`zsh`,`sh`,`csh`,`ksh`,`tcsh`,`dash`,`scsh`].join(`|`)})`,relevance:10}),p={className:`function`,begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[e.inherit(e.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0},m=[`if`,`then`,`else`,`elif`,`fi`,`time`,`for`,`while`,`until`,`in`,`do`,`done`,`case`,`esac`,`coproc`,`function`,`select`],h=[`true`,`false`],g={match:/(\/[a-z._-]+)+/},_=[`break`,`cd`,`continue`,`eval`,`exec`,`exit`,`export`,`getopts`,`hash`,`pwd`,`readonly`,`return`,`shift`,`test`,`times`,`trap`,`umask`,`unset`],v=[`alias`,`bind`,`builtin`,`caller`,`command`,`declare`,`echo`,`enable`,`help`,`let`,`local`,`logout`,`mapfile`,`printf`,`read`,`readarray`,`source`,`sudo`,`type`,`typeset`,`ulimit`,`unalias`],y=`autoload.bg.bindkey.bye.cap.chdir.clone.comparguments.compcall.compctl.compdescribe.compfiles.compgroups.compquote.comptags.comptry.compvalues.dirs.disable.disown.echotc.echoti.emulate.fc.fg.float.functions.getcap.getln.history.integer.jobs.kill.limit.log.noglob.popd.print.pushd.pushln.rehash.sched.setcap.setopt.stat.suspend.ttyctl.unfunction.unhash.unlimit.unsetopt.vared.wait.whence.where.which.zcompile.zformat.zftp.zle.zmodload.zparseopts.zprof.zpty.zregexparse.zsocket.zstyle.ztcp`.split(`.`),b=`chcon.chgrp.chown.chmod.cp.dd.df.dir.dircolors.ln.ls.mkdir.mkfifo.mknod.mktemp.mv.realpath.rm.rmdir.shred.sync.touch.truncate.vdir.b2sum.base32.base64.cat.cksum.comm.csplit.cut.expand.fmt.fold.head.join.md5sum.nl.numfmt.od.paste.ptx.pr.sha1sum.sha224sum.sha256sum.sha384sum.sha512sum.shuf.sort.split.sum.tac.tail.tr.tsort.unexpand.uniq.wc.arch.basename.chroot.date.dirname.du.echo.env.expr.factor.groups.hostid.id.link.logname.nice.nohup.nproc.pathchk.pinky.printenv.printf.pwd.readlink.runcon.seq.sleep.stat.stdbuf.stty.tee.test.timeout.tty.uname.unlink.uptime.users.who.whoami.yes`.split(`.`);return{name:`Bash`,aliases:[`sh`,`zsh`],keywords:{$pattern:/\b[a-z][a-z0-9._-]+\b/,keyword:m,literal:h,built_in:[..._,...v,`set`,`shopt`,...y,...b]},contains:[f,e.SHEBANG(),p,d,a,o,g,s,c,l,u,n]}}function Tl(e){let t=e.regex,n=e.COMMENT(`//`,`$`,{contains:[{begin:/\\\n/}]}),r=`[a-zA-Z_]\\w*::`,i=`(decltype\\(auto\\)|`+t.optional(r)+`[a-zA-Z_]\\w*`+t.optional(`<[^<>]+>`)+`)`,a={className:`type`,variants:[{begin:`\\b[a-z\\d_]*_t\\b`},{match:/\batomic_[a-z]{3,6}\b/}]},o={className:`string`,variants:[{begin:`(u8?|U|L)?"`,end:`"`,illegal:`\\n`,contains:[e.BACKSLASH_ESCAPE]},{begin:`(u8?|U|L)?'(\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)|.)`,end:`'`,illegal:`.`},e.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},s={className:`number`,variants:[{match:/\b(0b[01']+)/},{match:/(-?)\b([\d']+(\.[\d']*)?|\.[\d']+)((ll|LL|l|L)(u|U)?|(u|U)(ll|LL|l|L)?|f|F|b|B)/},{match:/(-?)\b(0[xX][a-fA-F0-9]+(?:'[a-fA-F0-9]+)*(?:\.[a-fA-F0-9]*(?:'[a-fA-F0-9]*)*)?(?:[pP][-+]?[0-9]+)?(l|L)?(u|U)?)/},{match:/(-?)\b\d+(?:'\d+)*(?:\.\d*(?:'\d*)*)?(?:[eE][-+]?\d+)?/}],relevance:0},c={className:`meta`,begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:`if else elif endif define undef warning error line pragma _Pragma ifdef ifndef elifdef elifndef include`},contains:[{begin:/\\\n/,relevance:0},e.inherit(o,{className:`string`}),{className:`string`,begin:/<.*?>/},n,e.C_BLOCK_COMMENT_MODE]},l={className:`title`,begin:t.optional(r)+e.IDENT_RE,relevance:0},u=t.optional(r)+e.IDENT_RE+`\\s*\\(`,d={keyword:`asm.auto.break.case.continue.default.do.else.enum.extern.for.fortran.goto.if.inline.register.restrict.return.sizeof.typeof.typeof_unqual.struct.switch.typedef.union.volatile.while._Alignas._Alignof._Atomic._Generic._Noreturn._Static_assert._Thread_local.alignas.alignof.noreturn.static_assert.thread_local._Pragma`.split(`.`),type:`float.double.signed.unsigned.int.short.long.char.void._Bool._BitInt._Complex._Imaginary._Decimal32._Decimal64._Decimal96._Decimal128._Decimal64x._Decimal128x._Float16._Float32._Float64._Float128._Float32x._Float64x._Float128x.const.static.constexpr.complex.bool.imaginary`.split(`.`),literal:`true false NULL`,built_in:`std string wstring cin cout cerr clog stdin stdout stderr stringstream istringstream ostringstream auto_ptr deque list queue stack vector map set pair bitset multiset multimap unordered_set unordered_map unordered_multiset unordered_multimap priority_queue make_pair array shared_ptr abort terminate abs acos asin atan2 atan calloc ceil cosh cos exit exp fabs floor fmod fprintf fputs free frexp fscanf future isalnum isalpha iscntrl isdigit isgraph islower isprint ispunct isspace isupper isxdigit tolower toupper labs ldexp log10 log malloc realloc memchr memcmp memcpy memset modf pow printf putchar puts scanf sinh sin snprintf sprintf sqrt sscanf strcat strchr strcmp strcpy strcspn strlen strncat strncmp strncpy strpbrk strrchr strspn strstr tanh tan vfprintf vprintf vsprintf endl initializer_list unique_ptr`},f=[c,a,n,e.C_BLOCK_COMMENT_MODE,s,o],p={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:`new throw return else`,end:/;/}],keywords:d,contains:f.concat([{begin:/\(/,end:/\)/,keywords:d,contains:f.concat([`self`]),relevance:0}]),relevance:0},m={begin:`(`+i+`[\\*&\\s]+)+`+u,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:d,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:`decltype\\(auto\\)`,keywords:d,relevance:0},{begin:u,returnBegin:!0,contains:[e.inherit(l,{className:`title.function`})],relevance:0},{relevance:0,match:/,/},{className:`params`,begin:/\(/,end:/\)/,keywords:d,relevance:0,contains:[n,e.C_BLOCK_COMMENT_MODE,o,s,a,{begin:/\(/,end:/\)/,keywords:d,relevance:0,contains:[`self`,n,e.C_BLOCK_COMMENT_MODE,o,s,a]}]},a,n,e.C_BLOCK_COMMENT_MODE,c]};return{name:`C`,aliases:[`h`],keywords:d,disableAutodetect:!0,illegal:`=]/,contains:[{beginKeywords:`final class struct`},e.TITLE_MODE]}]),exports:{preprocessor:c,strings:o,keywords:d}}}function El(e){let t=e.regex,n=e.COMMENT(`//`,`$`,{contains:[{begin:/\\\n/}]}),r=`[a-zA-Z_]\\w*::`,i=`(?!struct)(decltype\\(auto\\)|`+t.optional(r)+`[a-zA-Z_]\\w*`+t.optional(`<[^<>]+>`)+`)`,a={className:`type`,begin:`\\b[a-z\\d_]*_t\\b`},o={className:`string`,variants:[{begin:`(u8?|U|L)?"`,end:`"`,illegal:`\\n`,contains:[e.BACKSLASH_ESCAPE]},{begin:`(u8?|U|L)?'(\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)|.)`,end:`'`,illegal:`.`},e.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},s={className:`number`,variants:[{begin:`[+-]?(?:(?:[0-9](?:'?[0-9])*\\.(?:[0-9](?:'?[0-9])*)?|\\.[0-9](?:'?[0-9])*)(?:[Ee][+-]?[0-9](?:'?[0-9])*)?|[0-9](?:'?[0-9])*[Ee][+-]?[0-9](?:'?[0-9])*|0[Xx](?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*(?:\\.(?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)?)?|\\.[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)[Pp][+-]?[0-9](?:'?[0-9])*)(?:[Ff](?:16|32|64|128)?|(BF|bf)16|[Ll]|)`},{begin:`[+-]?\\b(?:0[Bb][01](?:'?[01])*|0[Xx][0-9A-Fa-f](?:'?[0-9A-Fa-f])*|0(?:'?[0-7])*|[1-9](?:'?[0-9])*)(?:[Uu](?:LL?|ll?)|[Uu][Zz]?|(?:LL?|ll?)[Uu]?|[Zz][Uu]|)`}],relevance:0},c={className:`meta`,begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:`if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include`},contains:[{begin:/\\\n/,relevance:0},e.inherit(o,{className:`string`}),{className:`string`,begin:/<.*?>/},n,e.C_BLOCK_COMMENT_MODE]},l={className:`title`,begin:t.optional(r)+e.IDENT_RE,relevance:0},u=t.optional(r)+e.IDENT_RE+`\\s*\\(`,d=`alignas.alignof.and.and_eq.asm.atomic_cancel.atomic_commit.atomic_noexcept.auto.bitand.bitor.break.case.catch.class.co_await.co_return.co_yield.compl.concept.const_cast|10.consteval.constexpr.constinit.continue.decltype.default.delete.do.dynamic_cast|10.else.enum.explicit.export.extern.false.final.for.friend.goto.if.import.inline.module.mutable.namespace.new.noexcept.not.not_eq.nullptr.operator.or.or_eq.override.private.protected.public.reflexpr.register.reinterpret_cast|10.requires.return.sizeof.static_assert.static_cast|10.struct.switch.synchronized.template.this.thread_local.throw.transaction_safe.transaction_safe_dynamic.true.try.typedef.typeid.typename.union.using.virtual.volatile.while.xor.xor_eq`.split(`.`),f=[`bool`,`char`,`char16_t`,`char32_t`,`char8_t`,`double`,`float`,`int`,`long`,`short`,`void`,`wchar_t`,`unsigned`,`signed`,`const`,`static`],p=`any.auto_ptr.barrier.binary_semaphore.bitset.complex.condition_variable.condition_variable_any.counting_semaphore.deque.false_type.flat_map.flat_set.future.imaginary.initializer_list.istringstream.jthread.latch.lock_guard.multimap.multiset.mutex.optional.ostringstream.packaged_task.pair.promise.priority_queue.queue.recursive_mutex.recursive_timed_mutex.scoped_lock.set.shared_future.shared_lock.shared_mutex.shared_timed_mutex.shared_ptr.stack.string_view.stringstream.timed_mutex.thread.true_type.tuple.unique_lock.unique_ptr.unordered_map.unordered_multimap.unordered_multiset.unordered_set.variant.vector.weak_ptr.wstring.wstring_view`.split(`.`),m=`abort.abs.acos.apply.as_const.asin.atan.atan2.calloc.ceil.cerr.cin.clog.cos.cosh.cout.declval.endl.exchange.exit.exp.fabs.floor.fmod.forward.fprintf.fputs.free.frexp.fscanf.future.invoke.isalnum.isalpha.iscntrl.isdigit.isgraph.islower.isprint.ispunct.isspace.isupper.isxdigit.labs.launder.ldexp.log.log10.make_pair.make_shared.make_shared_for_overwrite.make_tuple.make_unique.malloc.memchr.memcmp.memcpy.memset.modf.move.pow.printf.putchar.puts.realloc.scanf.sin.sinh.snprintf.sprintf.sqrt.sscanf.std.stderr.stdin.stdout.strcat.strchr.strcmp.strcpy.strcspn.strlen.strncat.strncmp.strncpy.strpbrk.strrchr.strspn.strstr.swap.tan.tanh.terminate.to_underlying.tolower.toupper.vfprintf.visit.vprintf.vsprintf`.split(`.`),h={type:f,keyword:d,literal:[`NULL`,`false`,`nullopt`,`nullptr`,`true`],built_in:[`_Pragma`],_type_hints:p},g={className:`function.dispatch`,relevance:0,keywords:{_hint:m},begin:t.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,e.IDENT_RE,t.lookahead(/(<[^<>]+>|)\s*\(/))},_=[g,c,a,n,e.C_BLOCK_COMMENT_MODE,s,o],v={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:`new throw return else`,end:/;/}],keywords:h,contains:_.concat([{begin:/\(/,end:/\)/,keywords:h,contains:_.concat([`self`]),relevance:0}]),relevance:0},y={className:`function`,begin:`(`+i+`[\\*&\\s]+)+`+u,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:h,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:`decltype\\(auto\\)`,keywords:h,relevance:0},{begin:u,returnBegin:!0,contains:[l],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[o,s]},{relevance:0,match:/,/},{className:`params`,begin:/\(/,end:/\)/,keywords:h,relevance:0,contains:[n,e.C_BLOCK_COMMENT_MODE,o,s,a,{begin:/\(/,end:/\)/,keywords:h,relevance:0,contains:[`self`,n,e.C_BLOCK_COMMENT_MODE,o,s,a]}]},a,n,e.C_BLOCK_COMMENT_MODE,c]};return{name:`C++`,aliases:[`cc`,`c++`,`h++`,`hpp`,`hh`,`hxx`,`cxx`],keywords:h,illegal:``,keywords:h,contains:[`self`,a]},{begin:e.IDENT_RE+`::`,keywords:h},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:`keyword`,3:`title.class`}}])}}function Dl(e){let t=[`bool`,`byte`,`char`,`decimal`,`delegate`,`double`,`dynamic`,`enum`,`float`,`int`,`long`,`nint`,`nuint`,`object`,`sbyte`,`short`,`string`,`ulong`,`uint`,`ushort`],n=[`public`,`private`,`protected`,`static`,`internal`,`protected`,`abstract`,`async`,`extern`,`override`,`unsafe`,`virtual`,`new`,`sealed`,`partial`],r={keyword:`abstract.as.base.break.case.catch.class.const.continue.do.else.event.explicit.extern.finally.fixed.for.foreach.goto.if.implicit.in.interface.internal.is.lock.namespace.new.operator.out.override.params.private.protected.public.readonly.record.ref.return.scoped.sealed.sizeof.stackalloc.static.struct.switch.this.throw.try.typeof.unchecked.unsafe.using.virtual.void.volatile.while`.split(`.`).concat(`add.alias.and.ascending.args.async.await.by.descending.dynamic.equals.file.from.get.global.group.init.into.join.let.nameof.not.notnull.on.or.orderby.partial.record.remove.required.scoped.select.set.unmanaged.value|0.var.when.where.with.yield`.split(`.`)),built_in:t,literal:[`default`,`false`,`null`,`true`]},i=e.inherit(e.TITLE_MODE,{begin:`[a-zA-Z](\\.?\\w)*`}),a={className:`number`,variants:[{begin:`\\b(0b[01']+)`},{begin:`(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)(u|U|l|L|ul|UL|f|F|b|B)`},{begin:`(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)`}],relevance:0},o={className:`string`,begin:/"""("*)(?!")(.|\n)*?"""\1/,relevance:1},s={className:`string`,begin:`@"`,end:`"`,contains:[{begin:`""`}]},c=e.inherit(s,{illegal:/\n/}),l={className:`subst`,begin:/\{/,end:/\}/,keywords:r},u=e.inherit(l,{illegal:/\n/}),d={className:`string`,begin:/\$"/,end:`"`,illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},e.BACKSLASH_ESCAPE,u]},f={className:`string`,begin:/\$@"/,end:`"`,contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:`""`},l]},p=e.inherit(f,{illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:`""`},u]});l.contains=[f,d,s,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,a,e.C_BLOCK_COMMENT_MODE],u.contains=[p,d,c,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,a,e.inherit(e.C_BLOCK_COMMENT_MODE,{illegal:/\n/})];let m={variants:[o,f,d,s,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},h={begin:`<`,end:`>`,contains:[{beginKeywords:`in out`},i]},g=e.IDENT_RE+`(<`+e.IDENT_RE+`(\\s*,\\s*`+e.IDENT_RE+`)*>)?(\\[\\])?`,_={begin:`@`+e.IDENT_RE,relevance:0};return{name:`C#`,aliases:[`cs`,`c#`],keywords:r,illegal:/::/,contains:[e.COMMENT(`///`,`$`,{returnBegin:!0,contains:[{className:`doctag`,variants:[{begin:`///`,relevance:0},{begin:``},{begin:``}]}]}),e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{className:`meta`,begin:`#`,end:`$`,keywords:{keyword:`if else elif endif define undef warning error line region endregion pragma checksum`}},m,a,{beginKeywords:`class interface`,relevance:0,end:/[{;=]/,illegal:/[^\s:,]/,contains:[{beginKeywords:`where class`},i,h,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:`namespace`,relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[i,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:`record`,relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[i,h,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{className:`meta`,begin:`^\\s*\\[(?=[\\w])`,excludeBegin:!0,end:`\\]`,excludeEnd:!0,contains:[{className:`string`,begin:/"/,end:/"/}]},{beginKeywords:`new return throw await else`,relevance:0},{className:`function`,begin:`(`+g+`\\s+)+`+e.IDENT_RE+`\\s*(<[^=]+>\\s*)?\\(`,returnBegin:!0,end:/\s*[{;=]/,excludeEnd:!0,keywords:r,contains:[{beginKeywords:n.join(` `),relevance:0},{begin:e.IDENT_RE+`\\s*(<[^=]+>\\s*)?\\(`,returnBegin:!0,contains:[e.TITLE_MODE,h],relevance:0},{match:/\(\)/},{className:`params`,begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:r,relevance:0,contains:[m,a,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},_]}}var Ol=e=>({IMPORTANT:{scope:`meta`,begin:`!important`},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:`number`,begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:`built_in`,begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:`selector-attr`,begin:/\[/,end:/\]/,illegal:`$`,contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:`number`,begin:e.NUMBER_RE+`(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?`,relevance:0},CSS_VARIABLE:{className:`attr`,begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),kl=`a.abbr.address.article.aside.audio.b.blockquote.body.button.canvas.caption.cite.code.dd.del.details.dfn.div.dl.dt.em.fieldset.figcaption.figure.footer.form.h1.h2.h3.h4.h5.h6.header.hgroup.html.i.iframe.img.input.ins.kbd.label.legend.li.main.mark.menu.nav.object.ol.optgroup.option.p.picture.q.quote.samp.section.select.source.span.strong.summary.sup.table.tbody.td.textarea.tfoot.th.thead.time.tr.ul.var.video`.split(`.`),Al=`defs.g.marker.mask.pattern.svg.switch.symbol.feBlend.feColorMatrix.feComponentTransfer.feComposite.feConvolveMatrix.feDiffuseLighting.feDisplacementMap.feFlood.feGaussianBlur.feImage.feMerge.feMorphology.feOffset.feSpecularLighting.feTile.feTurbulence.linearGradient.radialGradient.stop.circle.ellipse.image.line.path.polygon.polyline.rect.text.use.textPath.tspan.foreignObject.clipPath`.split(`.`),jl=[...kl,...Al],Ml=`any-hover.any-pointer.aspect-ratio.color.color-gamut.color-index.device-aspect-ratio.device-height.device-width.display-mode.forced-colors.grid.height.hover.inverted-colors.monochrome.orientation.overflow-block.overflow-inline.pointer.prefers-color-scheme.prefers-contrast.prefers-reduced-motion.prefers-reduced-transparency.resolution.scan.scripting.update.width.min-width.max-width.min-height.max-height`.split(`.`).sort().reverse(),Nl=`active.any-link.blank.checked.current.default.defined.dir.disabled.drop.empty.enabled.first.first-child.first-of-type.fullscreen.future.focus.focus-visible.focus-within.has.host.host-context.hover.indeterminate.in-range.invalid.is.lang.last-child.last-of-type.left.link.local-link.not.nth-child.nth-col.nth-last-child.nth-last-col.nth-last-of-type.nth-of-type.only-child.only-of-type.optional.out-of-range.past.placeholder-shown.read-only.read-write.required.right.root.scope.target.target-within.user-invalid.valid.visited.where`.split(`.`).sort().reverse(),Pl=[`after`,`backdrop`,`before`,`cue`,`cue-region`,`first-letter`,`first-line`,`grammar-error`,`marker`,`part`,`placeholder`,`selection`,`slotted`,`spelling-error`].sort().reverse(),Fl=`accent-color.align-content.align-items.align-self.alignment-baseline.all.anchor-name.animation.animation-composition.animation-delay.animation-direction.animation-duration.animation-fill-mode.animation-iteration-count.animation-name.animation-play-state.animation-range.animation-range-end.animation-range-start.animation-timeline.animation-timing-function.appearance.aspect-ratio.backdrop-filter.backface-visibility.background.background-attachment.background-blend-mode.background-clip.background-color.background-image.background-origin.background-position.background-position-x.background-position-y.background-repeat.background-size.baseline-shift.block-size.border.border-block.border-block-color.border-block-end.border-block-end-color.border-block-end-style.border-block-end-width.border-block-start.border-block-start-color.border-block-start-style.border-block-start-width.border-block-style.border-block-width.border-bottom.border-bottom-color.border-bottom-left-radius.border-bottom-right-radius.border-bottom-style.border-bottom-width.border-collapse.border-color.border-end-end-radius.border-end-start-radius.border-image.border-image-outset.border-image-repeat.border-image-slice.border-image-source.border-image-width.border-inline.border-inline-color.border-inline-end.border-inline-end-color.border-inline-end-style.border-inline-end-width.border-inline-start.border-inline-start-color.border-inline-start-style.border-inline-start-width.border-inline-style.border-inline-width.border-left.border-left-color.border-left-style.border-left-width.border-radius.border-right.border-right-color.border-right-style.border-right-width.border-spacing.border-start-end-radius.border-start-start-radius.border-style.border-top.border-top-color.border-top-left-radius.border-top-right-radius.border-top-style.border-top-width.border-width.bottom.box-align.box-decoration-break.box-direction.box-flex.box-flex-group.box-lines.box-ordinal-group.box-orient.box-pack.box-shadow.box-sizing.break-after.break-before.break-inside.caption-side.caret-color.clear.clip.clip-path.clip-rule.color.color-interpolation.color-interpolation-filters.color-profile.color-rendering.color-scheme.column-count.column-fill.column-gap.column-rule.column-rule-color.column-rule-style.column-rule-width.column-span.column-width.columns.contain.contain-intrinsic-block-size.contain-intrinsic-height.contain-intrinsic-inline-size.contain-intrinsic-size.contain-intrinsic-width.container.container-name.container-type.content.content-visibility.counter-increment.counter-reset.counter-set.cue.cue-after.cue-before.cursor.cx.cy.direction.display.dominant-baseline.empty-cells.enable-background.field-sizing.fill.fill-opacity.fill-rule.filter.flex.flex-basis.flex-direction.flex-flow.flex-grow.flex-shrink.flex-wrap.float.flood-color.flood-opacity.flow.font.font-display.font-family.font-feature-settings.font-kerning.font-language-override.font-optical-sizing.font-palette.font-size.font-size-adjust.font-smooth.font-smoothing.font-stretch.font-style.font-synthesis.font-synthesis-position.font-synthesis-small-caps.font-synthesis-style.font-synthesis-weight.font-variant.font-variant-alternates.font-variant-caps.font-variant-east-asian.font-variant-emoji.font-variant-ligatures.font-variant-numeric.font-variant-position.font-variation-settings.font-weight.forced-color-adjust.gap.glyph-orientation-horizontal.glyph-orientation-vertical.grid.grid-area.grid-auto-columns.grid-auto-flow.grid-auto-rows.grid-column.grid-column-end.grid-column-start.grid-gap.grid-row.grid-row-end.grid-row-start.grid-template.grid-template-areas.grid-template-columns.grid-template-rows.hanging-punctuation.height.hyphenate-character.hyphenate-limit-chars.hyphens.icon.image-orientation.image-rendering.image-resolution.ime-mode.initial-letter.initial-letter-align.inline-size.inset.inset-area.inset-block.inset-block-end.inset-block-start.inset-inline.inset-inline-end.inset-inline-start.isolation.justify-content.justify-items.justify-self.kerning.left.letter-spacing.lighting-color.line-break.line-height.line-height-step.list-style.list-style-image.list-style-position.list-style-type.margin.margin-block.margin-block-end.margin-block-start.margin-bottom.margin-inline.margin-inline-end.margin-inline-start.margin-left.margin-right.margin-top.margin-trim.marker.marker-end.marker-mid.marker-start.marks.mask.mask-border.mask-border-mode.mask-border-outset.mask-border-repeat.mask-border-slice.mask-border-source.mask-border-width.mask-clip.mask-composite.mask-image.mask-mode.mask-origin.mask-position.mask-repeat.mask-size.mask-type.masonry-auto-flow.math-depth.math-shift.math-style.max-block-size.max-height.max-inline-size.max-width.min-block-size.min-height.min-inline-size.min-width.mix-blend-mode.nav-down.nav-index.nav-left.nav-right.nav-up.none.normal.object-fit.object-position.offset.offset-anchor.offset-distance.offset-path.offset-position.offset-rotate.opacity.order.orphans.outline.outline-color.outline-offset.outline-style.outline-width.overflow.overflow-anchor.overflow-block.overflow-clip-margin.overflow-inline.overflow-wrap.overflow-x.overflow-y.overlay.overscroll-behavior.overscroll-behavior-block.overscroll-behavior-inline.overscroll-behavior-x.overscroll-behavior-y.padding.padding-block.padding-block-end.padding-block-start.padding-bottom.padding-inline.padding-inline-end.padding-inline-start.padding-left.padding-right.padding-top.page.page-break-after.page-break-before.page-break-inside.paint-order.pause.pause-after.pause-before.perspective.perspective-origin.place-content.place-items.place-self.pointer-events.position.position-anchor.position-visibility.print-color-adjust.quotes.r.resize.rest.rest-after.rest-before.right.rotate.row-gap.ruby-align.ruby-position.scale.scroll-behavior.scroll-margin.scroll-margin-block.scroll-margin-block-end.scroll-margin-block-start.scroll-margin-bottom.scroll-margin-inline.scroll-margin-inline-end.scroll-margin-inline-start.scroll-margin-left.scroll-margin-right.scroll-margin-top.scroll-padding.scroll-padding-block.scroll-padding-block-end.scroll-padding-block-start.scroll-padding-bottom.scroll-padding-inline.scroll-padding-inline-end.scroll-padding-inline-start.scroll-padding-left.scroll-padding-right.scroll-padding-top.scroll-snap-align.scroll-snap-stop.scroll-snap-type.scroll-timeline.scroll-timeline-axis.scroll-timeline-name.scrollbar-color.scrollbar-gutter.scrollbar-width.shape-image-threshold.shape-margin.shape-outside.shape-rendering.speak.speak-as.src.stop-color.stop-opacity.stroke.stroke-dasharray.stroke-dashoffset.stroke-linecap.stroke-linejoin.stroke-miterlimit.stroke-opacity.stroke-width.tab-size.table-layout.text-align.text-align-all.text-align-last.text-anchor.text-combine-upright.text-decoration.text-decoration-color.text-decoration-line.text-decoration-skip.text-decoration-skip-ink.text-decoration-style.text-decoration-thickness.text-emphasis.text-emphasis-color.text-emphasis-position.text-emphasis-style.text-indent.text-justify.text-orientation.text-overflow.text-rendering.text-shadow.text-size-adjust.text-transform.text-underline-offset.text-underline-position.text-wrap.text-wrap-mode.text-wrap-style.timeline-scope.top.touch-action.transform.transform-box.transform-origin.transform-style.transition.transition-behavior.transition-delay.transition-duration.transition-property.transition-timing-function.translate.unicode-bidi.user-modify.user-select.vector-effect.vertical-align.view-timeline.view-timeline-axis.view-timeline-inset.view-timeline-name.view-transition-name.visibility.voice-balance.voice-duration.voice-family.voice-pitch.voice-range.voice-rate.voice-stress.voice-volume.white-space.white-space-collapse.widows.width.will-change.word-break.word-spacing.word-wrap.writing-mode.x.y.z-index.zoom`.split(`.`).sort().reverse();function Il(e){let t=e.regex,n=Ol(e),r={begin:/-(webkit|moz|ms|o)-(?=[a-z])/},i=/@-?\w[\w]*(-\w+)*/,a=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE];return{name:`CSS`,case_insensitive:!0,illegal:/[=|'\$]/,keywords:{keyframePosition:`from to`},classNameAliases:{keyframePosition:`selector-tag`},contains:[n.BLOCK_COMMENT,r,n.CSS_NUMBER_MODE,{className:`selector-id`,begin:/#[A-Za-z0-9_-]+/,relevance:0},{className:`selector-class`,begin:`\\.[a-zA-Z-][a-zA-Z0-9_-]*`,relevance:0},n.ATTRIBUTE_SELECTOR_MODE,{className:`selector-pseudo`,variants:[{begin:`:(`+Nl.join(`|`)+`)`},{begin:`:(:)?(`+Pl.join(`|`)+`)`}]},n.CSS_VARIABLE,{className:`attribute`,begin:`\\b(`+Fl.join(`|`)+`)\\b`},{begin:/:/,end:/[;}{]/,contains:[n.BLOCK_COMMENT,n.HEXCOLOR,n.IMPORTANT,n.CSS_NUMBER_MODE,...a,{begin:/(url|data-uri)\(/,end:/\)/,relevance:0,keywords:{built_in:`url data-uri`},contains:[...a,{className:`string`,begin:/[^)]/,endsWithParent:!0,excludeEnd:!0}]},n.FUNCTION_DISPATCH]},{begin:t.lookahead(/@/),end:`[{;]`,relevance:0,illegal:/:/,contains:[{className:`keyword`,begin:i},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:{$pattern:/[a-z-]+/,keyword:`and or not only`,attribute:Ml.join(` `)},contains:[{begin:/[a-z-]+(?=:)/,className:`attribute`},...a,n.CSS_NUMBER_MODE]}]},{className:`selector-tag`,begin:`\\b(`+jl.join(`|`)+`)\\b`}]}}function Ll(e){let t=e.regex;return{name:`Diff`,aliases:[`patch`],contains:[{className:`meta`,relevance:10,match:t.either(/^@@ +-\d+,\d+ +\+\d+,\d+ +@@/,/^\*\*\* +\d+,\d+ +\*\*\*\*$/,/^--- +\d+,\d+ +----$/)},{className:`comment`,variants:[{begin:t.either(/Index: /,/^index/,/={3,}/,/^-{3}/,/^\*{3} /,/^\+{3}/,/^diff --git/),end:/$/},{match:/^\*{15}$/}]},{className:`addition`,begin:/^\+/,end:/$/},{className:`deletion`,begin:/^-/,end:/$/},{className:`addition`,begin:/^!/,end:/$/}]}}function Rl(e){let t={keyword:[`break`,`case`,`chan`,`const`,`continue`,`default`,`defer`,`else`,`fallthrough`,`for`,`func`,`go`,`goto`,`if`,`import`,`interface`,`map`,`package`,`range`,`return`,`select`,`struct`,`switch`,`type`,`var`],type:[`bool`,`byte`,`complex64`,`complex128`,`error`,`float32`,`float64`,`int8`,`int16`,`int32`,`int64`,`string`,`uint8`,`uint16`,`uint32`,`uint64`,`int`,`uint`,`uintptr`,`rune`],literal:[`true`,`false`,`iota`,`nil`],built_in:[`append`,`cap`,`close`,`complex`,`copy`,`imag`,`len`,`make`,`new`,`panic`,`print`,`println`,`real`,`recover`,`delete`]};return{name:`Go`,aliases:[`golang`],keywords:t,illegal:`Gl(e,t,n-1))}function Kl(e){let t=e.regex,n=`[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*`,r=n+Gl(`(?:<[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*~~~(?:\\s*,\\s*[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*~~~)*>)?`,/~~~/g,2),i={keyword:`synchronized.abstract.private.var.static.if.const .for.while.strictfp.finally.protected.import.native.final.void.enum.else.break.transient.catch.instanceof.volatile.case.assert.package.default.public.try.switch.continue.throws.protected.public.private.module.requires.exports.do.sealed.yield.permits.goto.when`.split(`.`),literal:[`false`,`true`,`null`],type:[`char`,`boolean`,`long`,`float`,`int`,`byte`,`short`,`double`],built_in:[`super`,`this`]},a={className:`meta`,begin:`@[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*`,contains:[{begin:/\(/,end:/\)/,contains:[`self`]}]},o={className:`params`,begin:/\(/,end:/\)/,keywords:i,relevance:0,contains:[e.C_BLOCK_COMMENT_MODE],endsParent:!0};return{name:`Java`,aliases:[`jsp`],keywords:i,illegal:/<\/|#/,contains:[e.COMMENT(`/\\*\\*`,`\\*/`,{relevance:0,contains:[{begin:/\w+@/,relevance:0},{className:`doctag`,begin:`@[A-Za-z]+`}]}),{begin:/import java\.[a-z]+\./,keywords:`import`,relevance:2},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{begin:/"""/,end:/"""/,className:`string`,contains:[e.BACKSLASH_ESCAPE]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,{match:[/\b(?:class|interface|enum|extends|implements|new)/,/\s+/,n],className:{1:`keyword`,3:`title.class`}},{match:/non-sealed/,scope:`keyword`},{begin:[t.concat(/(?!else)/,n),/\s+/,n,/\s+/,/=(?!=)/],className:{1:`type`,3:`variable`,5:`operator`}},{begin:[/record/,/\s+/,n],className:{1:`keyword`,3:`title.class`},contains:[o,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:`new throw return else`,relevance:0},{begin:[`(?:`+r+`\\s+)`,e.UNDERSCORE_IDENT_RE,/\s*(?=\()/],className:{2:`title.function`},keywords:i,contains:[{className:`params`,begin:/\(/,end:/\)/,keywords:i,relevance:0,contains:[a,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,Wl,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},Wl,a]}}var ql=`[A-Za-z$_][0-9A-Za-z$_]*`,Jl=`as.in.of.if.for.while.finally.var.new.function.do.return.void.else.break.catch.instanceof.with.throw.case.default.try.switch.continue.typeof.delete.let.yield.const.class.debugger.async.await.static.import.from.export.extends.using`.split(`.`),Yl=[`true`,`false`,`null`,`undefined`,`NaN`,`Infinity`],Xl=`Object.Function.Boolean.Symbol.Math.Date.Number.BigInt.String.RegExp.Array.Float32Array.Float64Array.Int8Array.Uint8Array.Uint8ClampedArray.Int16Array.Int32Array.Uint16Array.Uint32Array.BigInt64Array.BigUint64Array.Set.Map.WeakSet.WeakMap.ArrayBuffer.SharedArrayBuffer.Atomics.DataView.JSON.Promise.Generator.GeneratorFunction.AsyncFunction.Reflect.Proxy.Intl.WebAssembly`.split(`.`),Zl=[`Error`,`EvalError`,`InternalError`,`RangeError`,`ReferenceError`,`SyntaxError`,`TypeError`,`URIError`],Ql=[`setInterval`,`setTimeout`,`clearInterval`,`clearTimeout`,`require`,`exports`,`eval`,`isFinite`,`isNaN`,`parseFloat`,`parseInt`,`decodeURI`,`decodeURIComponent`,`encodeURI`,`encodeURIComponent`,`escape`,`unescape`],$l=[`arguments`,`this`,`super`,`console`,`window`,`document`,`localStorage`,`sessionStorage`,`module`,`global`],eu=[].concat(Ql,Xl,Zl);function tu(e){let t=e.regex,n=(e,{after:t})=>{let n=``,end:``},a=/<[A-Za-z0-9\\._:-]+\s*\/>/,o={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(e,t)=>{let r=e[0].length+e.index,i=e.input[r];if(i===`<`||i===`,`){t.ignoreMatch();return}i===`>`&&(n(e,{after:r})||t.ignoreMatch());let a,o=e.input.substring(r);if(a=o.match(/^\s*=/)){t.ignoreMatch();return}if((a=o.match(/^\s+extends\s+/))&&a.index===0){t.ignoreMatch();return}}},s={$pattern:ql,keyword:Jl,literal:Yl,built_in:eu,"variable.language":$l},c=`[0-9](_?[0-9])*`,l=`\\.(${c})`,u=`0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*`,d={className:`number`,variants:[{begin:`(\\b(${u})((${l})|\\.)?|(${l}))[eE][+-]?(${c})\\b`},{begin:`\\b(${u})\\b((${l})\\b|\\.)?|(${l})\\b`},{begin:`\\b(0|[1-9](_?[0-9])*)n\\b`},{begin:`\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b`},{begin:`\\b0[bB][0-1](_?[0-1])*n?\\b`},{begin:`\\b0[oO][0-7](_?[0-7])*n?\\b`},{begin:`\\b0[0-7]+n?\\b`}],relevance:0},f={className:`subst`,begin:`\\$\\{`,end:`\\}`,keywords:s,contains:[]},p={begin:".?html`",end:``,starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,f],subLanguage:`xml`}},m={begin:".?css`",end:``,starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,f],subLanguage:`css`}},h={begin:".?gql`",end:``,starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,f],subLanguage:`graphql`}},g={className:`string`,begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,f]},_={className:`comment`,variants:[e.COMMENT(/\/\*\*(?!\/)/,`\\*/`,{relevance:0,contains:[{begin:`(?=@[A-Za-z]+)`,relevance:0,contains:[{className:`doctag`,begin:`@[A-Za-z]+`},{className:`type`,begin:`\\{`,end:`\\}`,excludeEnd:!0,excludeBegin:!0,relevance:0},{className:`variable`,begin:`[A-Za-z$_][0-9A-Za-z$_]*(?=\\s*(-)|$)`,endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},v=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,m,h,g,{match:/\$\d+/},d];f.contains=v.concat({begin:/\{/,end:/\}/,keywords:s,contains:[`self`].concat(v)});let y=[].concat(_,f.contains),b=y.concat([{begin:/(\s*)\(/,end:/\)/,keywords:s,contains:[`self`].concat(y)}]),x={className:`params`,begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:s,contains:b},S={variants:[{match:[/class/,/\s+/,r,/\s+/,/extends/,/\s+/,t.concat(r,`(`,t.concat(/\./,r),`)*`)],scope:{1:`keyword`,3:`title.class`,5:`keyword`,7:`title.class.inherited`}},{match:[/class/,/\s+/,r],scope:{1:`keyword`,3:`title.class`}}]},C={relevance:0,match:t.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:`title.class`,keywords:{_:[...Xl,...Zl]}},w={label:`use_strict`,className:`meta`,relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},T={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:`keyword`,3:`title.function`},label:`func.def`,contains:[x],illegal:/%/},E={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:`variable.constant`};function D(e){return t.concat(`(?!`,e.join(`|`),`)`)}let O={match:t.concat(/\b/,D([...Ql,`super`,`import`].map(e=>`${e}\\s*\\(`)),r,t.lookahead(/\s*\(/)),className:`title.function`,relevance:0},k={begin:t.concat(/\./,t.lookahead(t.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:`prototype`,className:`property`,relevance:0},A={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:`keyword`,3:`title.function`},contains:[{begin:/\(\)/},x]},j=`(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|`+e.UNDERSCORE_IDENT_RE+`)\\s*=>`,M={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(j)],keywords:`async`,className:{1:`keyword`,3:`title.function`},contains:[x]};return{name:`JavaScript`,aliases:[`js`,`jsx`,`mjs`,`cjs`],keywords:s,exports:{PARAMS_CONTAINS:b,CLASS_REFERENCE:C},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:`shebang`,binary:`node`,relevance:5}),w,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,m,h,g,_,{match:/\$\d+/},d,C,{scope:`attr`,match:r+t.lookahead(`:`),relevance:0},M,{begin:`(`+e.RE_STARTERS_RE+`|\\b(case|return|throw)\\b)\\s*`,keywords:`return throw case`,relevance:0,contains:[_,e.REGEXP_MODE,{className:`function`,begin:j,returnBegin:!0,end:`\\s*=>`,contains:[{className:`params`,variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:s,contains:b}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:i.begin,end:i.end},{match:a},{begin:o.begin,"on:begin":o.isTrulyOpeningTag,end:o.end}],subLanguage:`xml`,contains:[{begin:o.begin,end:o.end,skip:!0,contains:[`self`]}]}]},T,{beginKeywords:`while if switch catch for`},{begin:`\\b(?!function)`+e.UNDERSCORE_IDENT_RE+`\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{`,returnBegin:!0,label:`func.def`,contains:[x,e.inherit(e.TITLE_MODE,{begin:r,className:`title.function`})]},{match:/\.\.\./,relevance:0},k,{match:`\\$[A-Za-z$_][0-9A-Za-z$_]*`,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:`title.function`},contains:[x]},O,E,S,A,{match:/\$[(.]/}]}}function nu(e){let t={className:`attr`,begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},n={match:/[{}[\],:]/,className:`punctuation`,relevance:0},r=[`true`,`false`,`null`],i={scope:`literal`,beginKeywords:r.join(` `)};return{name:`JSON`,aliases:[`jsonc`],keywords:{literal:r},contains:[t,n,e.QUOTE_STRING_MODE,i,e.C_NUMBER_MODE,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE],illegal:`\\S`}}var ru=`[0-9](_*[0-9])*`,iu=`\\.(${ru})`,au=`[0-9a-fA-F](_*[0-9a-fA-F])*`,ou={className:`number`,variants:[{begin:`(\\b(${ru})((${iu})|\\.)?|(${iu}))[eE][+-]?(${ru})[fFdD]?\\b`},{begin:`\\b(${ru})((${iu})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${iu})[fFdD]?\\b`},{begin:`\\b(${ru})[fFdD]\\b`},{begin:`\\b0[xX]((${au})\\.?|(${au})?\\.(${au}))[pP][+-]?(${ru})[fFdD]?\\b`},{begin:`\\b(0|[1-9](_*[0-9])*)[lL]?\\b`},{begin:`\\b0[xX](${au})[lL]?\\b`},{begin:`\\b0(_*[0-7])*[lL]?\\b`},{begin:`\\b0[bB][01](_*[01])*[lL]?\\b`}],relevance:0};function su(e){let t={keyword:`abstract as val var vararg get set class object open private protected public noinline crossinline dynamic final enum if else do while for when throw try catch finally import package is in fun override companion reified inline lateinit init interface annotation data sealed internal infix operator out by constructor super tailrec where const inner suspend typealias external expect actual`,built_in:`Byte Short Char Int Long Boolean Float Double Void Unit Nothing`,literal:`true false null`},n={className:`keyword`,begin:/\b(break|continue|return|this)\b/,starts:{contains:[{className:`symbol`,begin:/@\w+/}]}},r={className:`symbol`,begin:e.UNDERSCORE_IDENT_RE+`@`},i={className:`subst`,begin:/\$\{/,end:/\}/,contains:[e.C_NUMBER_MODE]},a={className:`variable`,begin:`\\$`+e.UNDERSCORE_IDENT_RE},o={className:`string`,variants:[{begin:`"""`,end:`"""(?=[^"])`,contains:[a,i]},{begin:`'`,end:`'`,illegal:/\n/,contains:[e.BACKSLASH_ESCAPE]},{begin:`"`,end:`"`,illegal:/\n/,contains:[e.BACKSLASH_ESCAPE,a,i]}]};i.contains.push(o);let s={className:`meta`,begin:`@(?:file|property|field|get|set|receiver|param|setparam|delegate)\\s*:(?:\\s*`+e.UNDERSCORE_IDENT_RE+`)?`},c={className:`meta`,begin:`@`+e.UNDERSCORE_IDENT_RE,contains:[{begin:/\(/,end:/\)/,contains:[e.inherit(o,{className:`string`}),`self`]}]},l=ou,u=e.COMMENT(`/\\*`,`\\*/`,{contains:[e.C_BLOCK_COMMENT_MODE]}),d={variants:[{className:`type`,begin:e.UNDERSCORE_IDENT_RE},{begin:/\(/,end:/\)/,contains:[]}]},f=d;return f.variants[1].contains=[d],d.variants[1].contains=[f],{name:`Kotlin`,aliases:[`kt`,`kts`],keywords:t,contains:[e.COMMENT(`/\\*\\*`,`\\*/`,{relevance:0,contains:[{className:`doctag`,begin:`@[A-Za-z]+`}]}),e.C_LINE_COMMENT_MODE,u,n,r,s,c,{className:`function`,beginKeywords:`fun`,end:`[(]|$`,returnBegin:!0,excludeEnd:!0,keywords:t,relevance:5,contains:[{begin:e.UNDERSCORE_IDENT_RE+`\\s*\\(`,returnBegin:!0,relevance:0,contains:[e.UNDERSCORE_TITLE_MODE]},{className:`type`,begin://,keywords:`reified`,relevance:0},{className:`params`,begin:/\(/,end:/\)/,endsParent:!0,keywords:t,relevance:0,contains:[{begin:/:/,end:/[=,\/]/,endsWithParent:!0,contains:[d,e.C_LINE_COMMENT_MODE,u],relevance:0},e.C_LINE_COMMENT_MODE,u,s,c,o,e.C_NUMBER_MODE]},u]},{begin:[/class|interface|trait/,/\s+/,e.UNDERSCORE_IDENT_RE],beginScope:{3:`title.class`},keywords:`class interface trait`,end:/[:\{(]|$/,excludeEnd:!0,illegal:`extends implements`,contains:[{beginKeywords:`public protected internal private constructor`},e.UNDERSCORE_TITLE_MODE,{className:`type`,begin://,excludeBegin:!0,excludeEnd:!0,relevance:0},{className:`type`,begin:/[,:]\s*/,end:/[<\(,){\s]|$/,excludeBegin:!0,returnEnd:!0},s,c]},o,{className:`meta`,begin:`^#!/usr/bin/env`,end:`$`,illegal:` +`},l]}}var cu=e=>({IMPORTANT:{scope:`meta`,begin:`!important`},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:`number`,begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:`built_in`,begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:`selector-attr`,begin:/\[/,end:/\]/,illegal:`$`,contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:`number`,begin:e.NUMBER_RE+`(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?`,relevance:0},CSS_VARIABLE:{className:`attr`,begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),lu=`a.abbr.address.article.aside.audio.b.blockquote.body.button.canvas.caption.cite.code.dd.del.details.dfn.div.dl.dt.em.fieldset.figcaption.figure.footer.form.h1.h2.h3.h4.h5.h6.header.hgroup.html.i.iframe.img.input.ins.kbd.label.legend.li.main.mark.menu.nav.object.ol.optgroup.option.p.picture.q.quote.samp.section.select.source.span.strong.summary.sup.table.tbody.td.textarea.tfoot.th.thead.time.tr.ul.var.video`.split(`.`),uu=`defs.g.marker.mask.pattern.svg.switch.symbol.feBlend.feColorMatrix.feComponentTransfer.feComposite.feConvolveMatrix.feDiffuseLighting.feDisplacementMap.feFlood.feGaussianBlur.feImage.feMerge.feMorphology.feOffset.feSpecularLighting.feTile.feTurbulence.linearGradient.radialGradient.stop.circle.ellipse.image.line.path.polygon.polyline.rect.text.use.textPath.tspan.foreignObject.clipPath`.split(`.`),du=[...lu,...uu],fu=`any-hover.any-pointer.aspect-ratio.color.color-gamut.color-index.device-aspect-ratio.device-height.device-width.display-mode.forced-colors.grid.height.hover.inverted-colors.monochrome.orientation.overflow-block.overflow-inline.pointer.prefers-color-scheme.prefers-contrast.prefers-reduced-motion.prefers-reduced-transparency.resolution.scan.scripting.update.width.min-width.max-width.min-height.max-height`.split(`.`).sort().reverse(),pu=`active.any-link.blank.checked.current.default.defined.dir.disabled.drop.empty.enabled.first.first-child.first-of-type.fullscreen.future.focus.focus-visible.focus-within.has.host.host-context.hover.indeterminate.in-range.invalid.is.lang.last-child.last-of-type.left.link.local-link.not.nth-child.nth-col.nth-last-child.nth-last-col.nth-last-of-type.nth-of-type.only-child.only-of-type.optional.out-of-range.past.placeholder-shown.read-only.read-write.required.right.root.scope.target.target-within.user-invalid.valid.visited.where`.split(`.`).sort().reverse(),mu=[`after`,`backdrop`,`before`,`cue`,`cue-region`,`first-letter`,`first-line`,`grammar-error`,`marker`,`part`,`placeholder`,`selection`,`slotted`,`spelling-error`].sort().reverse(),hu=`accent-color.align-content.align-items.align-self.alignment-baseline.all.anchor-name.animation.animation-composition.animation-delay.animation-direction.animation-duration.animation-fill-mode.animation-iteration-count.animation-name.animation-play-state.animation-range.animation-range-end.animation-range-start.animation-timeline.animation-timing-function.appearance.aspect-ratio.backdrop-filter.backface-visibility.background.background-attachment.background-blend-mode.background-clip.background-color.background-image.background-origin.background-position.background-position-x.background-position-y.background-repeat.background-size.baseline-shift.block-size.border.border-block.border-block-color.border-block-end.border-block-end-color.border-block-end-style.border-block-end-width.border-block-start.border-block-start-color.border-block-start-style.border-block-start-width.border-block-style.border-block-width.border-bottom.border-bottom-color.border-bottom-left-radius.border-bottom-right-radius.border-bottom-style.border-bottom-width.border-collapse.border-color.border-end-end-radius.border-end-start-radius.border-image.border-image-outset.border-image-repeat.border-image-slice.border-image-source.border-image-width.border-inline.border-inline-color.border-inline-end.border-inline-end-color.border-inline-end-style.border-inline-end-width.border-inline-start.border-inline-start-color.border-inline-start-style.border-inline-start-width.border-inline-style.border-inline-width.border-left.border-left-color.border-left-style.border-left-width.border-radius.border-right.border-right-color.border-right-style.border-right-width.border-spacing.border-start-end-radius.border-start-start-radius.border-style.border-top.border-top-color.border-top-left-radius.border-top-right-radius.border-top-style.border-top-width.border-width.bottom.box-align.box-decoration-break.box-direction.box-flex.box-flex-group.box-lines.box-ordinal-group.box-orient.box-pack.box-shadow.box-sizing.break-after.break-before.break-inside.caption-side.caret-color.clear.clip.clip-path.clip-rule.color.color-interpolation.color-interpolation-filters.color-profile.color-rendering.color-scheme.column-count.column-fill.column-gap.column-rule.column-rule-color.column-rule-style.column-rule-width.column-span.column-width.columns.contain.contain-intrinsic-block-size.contain-intrinsic-height.contain-intrinsic-inline-size.contain-intrinsic-size.contain-intrinsic-width.container.container-name.container-type.content.content-visibility.counter-increment.counter-reset.counter-set.cue.cue-after.cue-before.cursor.cx.cy.direction.display.dominant-baseline.empty-cells.enable-background.field-sizing.fill.fill-opacity.fill-rule.filter.flex.flex-basis.flex-direction.flex-flow.flex-grow.flex-shrink.flex-wrap.float.flood-color.flood-opacity.flow.font.font-display.font-family.font-feature-settings.font-kerning.font-language-override.font-optical-sizing.font-palette.font-size.font-size-adjust.font-smooth.font-smoothing.font-stretch.font-style.font-synthesis.font-synthesis-position.font-synthesis-small-caps.font-synthesis-style.font-synthesis-weight.font-variant.font-variant-alternates.font-variant-caps.font-variant-east-asian.font-variant-emoji.font-variant-ligatures.font-variant-numeric.font-variant-position.font-variation-settings.font-weight.forced-color-adjust.gap.glyph-orientation-horizontal.glyph-orientation-vertical.grid.grid-area.grid-auto-columns.grid-auto-flow.grid-auto-rows.grid-column.grid-column-end.grid-column-start.grid-gap.grid-row.grid-row-end.grid-row-start.grid-template.grid-template-areas.grid-template-columns.grid-template-rows.hanging-punctuation.height.hyphenate-character.hyphenate-limit-chars.hyphens.icon.image-orientation.image-rendering.image-resolution.ime-mode.initial-letter.initial-letter-align.inline-size.inset.inset-area.inset-block.inset-block-end.inset-block-start.inset-inline.inset-inline-end.inset-inline-start.isolation.justify-content.justify-items.justify-self.kerning.left.letter-spacing.lighting-color.line-break.line-height.line-height-step.list-style.list-style-image.list-style-position.list-style-type.margin.margin-block.margin-block-end.margin-block-start.margin-bottom.margin-inline.margin-inline-end.margin-inline-start.margin-left.margin-right.margin-top.margin-trim.marker.marker-end.marker-mid.marker-start.marks.mask.mask-border.mask-border-mode.mask-border-outset.mask-border-repeat.mask-border-slice.mask-border-source.mask-border-width.mask-clip.mask-composite.mask-image.mask-mode.mask-origin.mask-position.mask-repeat.mask-size.mask-type.masonry-auto-flow.math-depth.math-shift.math-style.max-block-size.max-height.max-inline-size.max-width.min-block-size.min-height.min-inline-size.min-width.mix-blend-mode.nav-down.nav-index.nav-left.nav-right.nav-up.none.normal.object-fit.object-position.offset.offset-anchor.offset-distance.offset-path.offset-position.offset-rotate.opacity.order.orphans.outline.outline-color.outline-offset.outline-style.outline-width.overflow.overflow-anchor.overflow-block.overflow-clip-margin.overflow-inline.overflow-wrap.overflow-x.overflow-y.overlay.overscroll-behavior.overscroll-behavior-block.overscroll-behavior-inline.overscroll-behavior-x.overscroll-behavior-y.padding.padding-block.padding-block-end.padding-block-start.padding-bottom.padding-inline.padding-inline-end.padding-inline-start.padding-left.padding-right.padding-top.page.page-break-after.page-break-before.page-break-inside.paint-order.pause.pause-after.pause-before.perspective.perspective-origin.place-content.place-items.place-self.pointer-events.position.position-anchor.position-visibility.print-color-adjust.quotes.r.resize.rest.rest-after.rest-before.right.rotate.row-gap.ruby-align.ruby-position.scale.scroll-behavior.scroll-margin.scroll-margin-block.scroll-margin-block-end.scroll-margin-block-start.scroll-margin-bottom.scroll-margin-inline.scroll-margin-inline-end.scroll-margin-inline-start.scroll-margin-left.scroll-margin-right.scroll-margin-top.scroll-padding.scroll-padding-block.scroll-padding-block-end.scroll-padding-block-start.scroll-padding-bottom.scroll-padding-inline.scroll-padding-inline-end.scroll-padding-inline-start.scroll-padding-left.scroll-padding-right.scroll-padding-top.scroll-snap-align.scroll-snap-stop.scroll-snap-type.scroll-timeline.scroll-timeline-axis.scroll-timeline-name.scrollbar-color.scrollbar-gutter.scrollbar-width.shape-image-threshold.shape-margin.shape-outside.shape-rendering.speak.speak-as.src.stop-color.stop-opacity.stroke.stroke-dasharray.stroke-dashoffset.stroke-linecap.stroke-linejoin.stroke-miterlimit.stroke-opacity.stroke-width.tab-size.table-layout.text-align.text-align-all.text-align-last.text-anchor.text-combine-upright.text-decoration.text-decoration-color.text-decoration-line.text-decoration-skip.text-decoration-skip-ink.text-decoration-style.text-decoration-thickness.text-emphasis.text-emphasis-color.text-emphasis-position.text-emphasis-style.text-indent.text-justify.text-orientation.text-overflow.text-rendering.text-shadow.text-size-adjust.text-transform.text-underline-offset.text-underline-position.text-wrap.text-wrap-mode.text-wrap-style.timeline-scope.top.touch-action.transform.transform-box.transform-origin.transform-style.transition.transition-behavior.transition-delay.transition-duration.transition-property.transition-timing-function.translate.unicode-bidi.user-modify.user-select.vector-effect.vertical-align.view-timeline.view-timeline-axis.view-timeline-inset.view-timeline-name.view-transition-name.visibility.voice-balance.voice-duration.voice-family.voice-pitch.voice-range.voice-rate.voice-stress.voice-volume.white-space.white-space-collapse.widows.width.will-change.word-break.word-spacing.word-wrap.writing-mode.x.y.z-index.zoom`.split(`.`).sort().reverse(),gu=pu.concat(mu).sort().reverse();function _u(e){let t=cu(e),n=gu,r=`([\\w-]+|@\\{[\\w-]+\\})`,i=[],a=[],o=function(e){return{className:`string`,begin:`~?`+e+`.*?`+e}},s=function(e,t,n){return{className:e,begin:t,relevance:n}},c={$pattern:/[a-z-]+/,keyword:`and or not only`,attribute:fu.join(` `)},l={begin:`\\(`,end:`\\)`,contains:a,keywords:c,relevance:0};a.push(e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,o(`'`),o(`"`),t.CSS_NUMBER_MODE,{begin:`(url|data-uri)\\(`,starts:{className:`string`,end:`[\\)\\n]`,excludeEnd:!0}},t.HEXCOLOR,l,s(`variable`,`@@?[\\w-]+`,10),s(`variable`,`@\\{[\\w-]+\\}`),s(`built_in`,"~?`[^`]*?`"),{className:`attribute`,begin:`[\\w-]+\\s*:`,end:`:`,returnBegin:!0,excludeEnd:!0},t.IMPORTANT,{beginKeywords:`and not`},t.FUNCTION_DISPATCH);let u=a.concat({begin:/\{/,end:/\}/,contains:i}),d={beginKeywords:`when`,endsWithParent:!0,contains:[{beginKeywords:`and not`}].concat(a)},f={begin:`([\\w-]+|@\\{[\\w-]+\\})\\s*:`,returnBegin:!0,end:/[;}]/,relevance:0,contains:[{begin:/-(webkit|moz|ms|o)-/},t.CSS_VARIABLE,{className:`attribute`,begin:`\\b(`+hu.join(`|`)+`)\\b`,end:/(?=:)/,starts:{endsWithParent:!0,illegal:`[<=$]`,relevance:0,contains:a}}]},p={className:`keyword`,begin:`@(import|media|charset|font-face|(-[a-z]+-)?keyframes|supports|document|namespace|page|viewport|host)\\b`,starts:{end:`[;{}]`,keywords:c,returnEnd:!0,contains:a,relevance:0}},m={className:`variable`,variants:[{begin:`@[\\w-]+\\s*:`,relevance:15},{begin:`@[\\w-]+`}],starts:{end:`[;}]`,returnEnd:!0,contains:u}},h={variants:[{begin:`[\\.#:&\\[>]`,end:`[;{}]`},{begin:r,end:/\{/}],returnBegin:!0,returnEnd:!0,illegal:`[<='$"]`,relevance:0,contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,d,s(`keyword`,`all\\b`),s(`variable`,`@\\{[\\w-]+\\}`),{begin:`\\b(`+du.join(`|`)+`)\\b`,className:`selector-tag`},t.CSS_NUMBER_MODE,s(`selector-tag`,r,0),s(`selector-id`,`#([\\w-]+|@\\{[\\w-]+\\})`),s(`selector-class`,`\\.([\\w-]+|@\\{[\\w-]+\\})`,0),s(`selector-tag`,`&`,0),t.ATTRIBUTE_SELECTOR_MODE,{className:`selector-pseudo`,begin:`:(`+pu.join(`|`)+`)`},{className:`selector-pseudo`,begin:`:(:)?(`+mu.join(`|`)+`)`},{begin:/\(/,end:/\)/,relevance:0,contains:u},{begin:`!important`},t.FUNCTION_DISPATCH]},g={begin:`[\\w-]+:(:)?(${n.join(`|`)})`,returnBegin:!0,contains:[h]};return i.push(e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,p,m,g,f,h,d,t.FUNCTION_DISPATCH),{name:`Less`,case_insensitive:!0,illegal:`[=>'/<($"]`,contains:i}}function vu(e){let t=`\\[=*\\[`,n=`\\]=*\\]`,r={begin:t,end:n,contains:[`self`]},i=[e.COMMENT(`--(?!\\[=*\\[)`,`$`),e.COMMENT(`--\\[=*\\[`,n,{contains:[r],relevance:10})];return{name:`Lua`,aliases:[`pluto`],keywords:{$pattern:e.UNDERSCORE_IDENT_RE,literal:`true false nil`,keyword:`and break do else elseif end for goto if in local not or repeat return then until while`,built_in:`_G _ENV _VERSION __index __newindex __mode __call __metatable __tostring __len __gc __add __sub __mul __div __mod __pow __concat __unm __eq __lt __le assert collectgarbage dofile error getfenv getmetatable ipairs load loadfile loadstring module next pairs pcall print rawequal rawget rawset require select setfenv setmetatable tonumber tostring type unpack xpcall arg self coroutine resume yield status wrap create running debug getupvalue debug sethook getmetatable gethook setmetatable setlocal traceback setfenv getinfo setupvalue getlocal getregistry getfenv io lines write close flush open output type read stderr stdin input stdout popen tmpfile math log max acos huge ldexp pi cos tanh pow deg tan cosh sinh random randomseed frexp ceil floor rad abs sqrt modf asin min mod fmod log10 atan2 exp sin atan os exit setlocale date getenv difftime remove time clock tmpname rename execute package preload loadlib loaded loaders cpath config path seeall string sub upper len gfind rep find match char dump gmatch reverse byte format gsub lower table setn insert getn foreachi maxn foreach concat sort remove`},contains:i.concat([{className:`function`,beginKeywords:`function`,end:`\\)`,contains:[e.inherit(e.TITLE_MODE,{begin:`([_a-zA-Z]\\w*\\.)*([_a-zA-Z]\\w*:)?[_a-zA-Z]\\w*`}),{className:`params`,begin:`\\(`,endsWithParent:!0,contains:i}].concat(i)},e.C_NUMBER_MODE,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,{className:`string`,begin:t,end:n,contains:[r],relevance:5}])}}function yu(e){let t={className:`variable`,variants:[{begin:`\\$\\(`+e.UNDERSCORE_IDENT_RE+`\\)`,contains:[e.BACKSLASH_ESCAPE]},{begin:/\$[@%`,subLanguage:`xml`,relevance:0},r={begin:`^[-\\*]{3,}`,end:`$`},i={className:`code`,variants:[{begin:"(`{3,})[^`](.|\\n)*?\\1`*[ ]*"},{begin:`(~{3,})[^~](.|\\n)*?\\1~*[ ]*`},{begin:"```",end:"```+[ ]*$"},{begin:`~~~`,end:`~~~+[ ]*$`},{begin:"`.+?`"},{begin:`(?=^( {4}|\\t))`,contains:[{begin:`^( {4}|\\t)`,end:`(\\n)$`}],relevance:0}]},a={className:`bullet`,begin:`^[ ]*([*+-]|(\\d+\\.))(?=\\s+)`,end:`\\s+`,excludeEnd:!0},o={begin:/^\[[^\n]+\]:/,returnBegin:!0,contains:[{className:`symbol`,begin:/\[/,end:/\]/,excludeBegin:!0,excludeEnd:!0},{className:`link`,begin:/:\s*/,end:/$/,excludeBegin:!0}]},s={variants:[{begin:/\[.+?\]\[.*?\]/,relevance:0},{begin:/\[.+?\]\(((data|javascript|mailto):|(?:http|ftp)s?:\/\/).*?\)/,relevance:2},{begin:t.concat(/\[.+?\]\(/,/[A-Za-z][A-Za-z0-9+.-]*/,/:\/\/.*?\)/),relevance:2},{begin:/\[.+?\]\([./?&#].*?\)/,relevance:1},{begin:/\[.*?\]\(.*?\)/,relevance:0}],returnBegin:!0,contains:[{match:/\[(?=\])/},{className:`string`,relevance:0,begin:`\\[`,end:`\\]`,excludeBegin:!0,returnEnd:!0},{className:`link`,relevance:0,begin:`\\]\\(`,end:`\\)`,excludeBegin:!0,excludeEnd:!0},{className:`symbol`,relevance:0,begin:`\\]\\[`,end:`\\]`,excludeBegin:!0,excludeEnd:!0}]},c={className:`strong`,contains:[],variants:[{begin:/_{2}(?!\s)/,end:/_{2}/},{begin:/\*{2}(?!\s)/,end:/\*{2}/}]},l={className:`emphasis`,contains:[],variants:[{begin:/\*(?![*\s])/,end:/\*/},{begin:/_(?![_\s])/,end:/_/,relevance:0}]},u=e.inherit(c,{contains:[]}),d=e.inherit(l,{contains:[]});c.contains.push(d),l.contains.push(u);let f=[n,s];return[c,l,u,d].forEach(e=>{e.contains=e.contains.concat(f)}),f=f.concat(c,l),{name:`Markdown`,aliases:[`md`,`mkdown`,`mkd`],contains:[{className:`section`,variants:[{begin:`^#{1,6}`,end:`$`,contains:f},{begin:`(?=^.+?\\n[=-]{2,}$)`,contains:[{begin:`^[=-]*$`},{begin:`^`,end:`\\n`,contains:f}]}]},n,a,c,l,{className:`quote`,begin:`^>\\s+`,contains:f,end:`$`},i,r,s,o,{scope:`literal`,match:/&([a-zA-Z0-9]+|#[0-9]{1,7}|#[Xx][0-9a-fA-F]{1,6});/}]}}function xu(e){let t={className:`built_in`,begin:`\\b(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)\\w+`},n=/[a-zA-Z@][a-zA-Z0-9_]*/,r={"variable.language":[`this`,`super`],$pattern:n,keyword:`while.export.sizeof.typedef.const.struct.for.union.volatile.static.mutable.if.do.return.goto.enum.else.break.extern.asm.case.default.register.explicit.typename.switch.continue.inline.readonly.assign.readwrite.self.@synchronized.id.typeof.nonatomic.IBOutlet.IBAction.strong.weak.copy.in.out.inout.bycopy.byref.oneway.__strong.__weak.__block.__autoreleasing.@private.@protected.@public.@try.@property.@end.@throw.@catch.@finally.@autoreleasepool.@synthesize.@dynamic.@selector.@optional.@required.@encode.@package.@import.@defs.@compatibility_alias.__bridge.__bridge_transfer.__bridge_retained.__bridge_retain.__covariant.__contravariant.__kindof._Nonnull._Nullable._Null_unspecified.__FUNCTION__.__PRETTY_FUNCTION__.__attribute__.getter.setter.retain.unsafe_unretained.nonnull.nullable.null_unspecified.null_resettable.class.instancetype.NS_DESIGNATED_INITIALIZER.NS_UNAVAILABLE.NS_REQUIRES_SUPER.NS_RETURNS_INNER_POINTER.NS_INLINE.NS_AVAILABLE.NS_DEPRECATED.NS_ENUM.NS_OPTIONS.NS_SWIFT_UNAVAILABLE.NS_ASSUME_NONNULL_BEGIN.NS_ASSUME_NONNULL_END.NS_REFINED_FOR_SWIFT.NS_SWIFT_NAME.NS_SWIFT_NOTHROW.NS_DURING.NS_HANDLER.NS_ENDHANDLER.NS_VALUERETURN.NS_VOIDRETURN`.split(`.`),literal:[`false`,`true`,`FALSE`,`TRUE`,`nil`,`YES`,`NO`,`NULL`],built_in:[`dispatch_once_t`,`dispatch_queue_t`,`dispatch_sync`,`dispatch_async`,`dispatch_once`],type:[`int`,`float`,`char`,`unsigned`,`signed`,`short`,`long`,`double`,`wchar_t`,`unichar`,`void`,`bool`,`BOOL`,`id|0`,`_Bool`]},i={$pattern:n,keyword:[`@interface`,`@class`,`@protocol`,`@implementation`]};return{name:`Objective-C`,aliases:[`mm`,`objc`,`obj-c`,`obj-c++`,`objective-c++`],keywords:r,illegal:`/,end:/$/,illegal:`\\n`},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{className:`class`,begin:`(`+i.keyword.join(`|`)+`)\\b`,end:/(\{|$)/,excludeEnd:!0,keywords:i,contains:[e.UNDERSCORE_TITLE_MODE]},{begin:`\\.`+e.UNDERSCORE_IDENT_RE,relevance:0}]}}function Su(e){let t=e.regex,n=`abs.accept.alarm.and.atan2.bind.binmode.bless.break.caller.chdir.chmod.chomp.chop.chown.chr.chroot.class.close.closedir.connect.continue.cos.crypt.dbmclose.dbmopen.defined.delete.die.do.dump.each.else.elsif.endgrent.endhostent.endnetent.endprotoent.endpwent.endservent.eof.eval.exec.exists.exit.exp.fcntl.field.fileno.flock.for.foreach.fork.format.formline.getc.getgrent.getgrgid.getgrnam.gethostbyaddr.gethostbyname.gethostent.getlogin.getnetbyaddr.getnetbyname.getnetent.getpeername.getpgrp.getpriority.getprotobyname.getprotobynumber.getprotoent.getpwent.getpwnam.getpwuid.getservbyname.getservbyport.getservent.getsockname.getsockopt.given.glob.gmtime.goto.grep.gt.hex.if.index.int.ioctl.join.keys.kill.last.lc.lcfirst.length.link.listen.local.localtime.log.lstat.lt.ma.map.method.mkdir.msgctl.msgget.msgrcv.msgsnd.my.ne.next.no.not.oct.open.opendir.or.ord.our.pack.package.pipe.pop.pos.print.printf.prototype.push.q|0.qq.quotemeta.qw.qx.rand.read.readdir.readline.readlink.readpipe.recv.redo.ref.rename.require.reset.return.reverse.rewinddir.rindex.rmdir.say.scalar.seek.seekdir.select.semctl.semget.semop.send.setgrent.sethostent.setnetent.setpgrp.setpriority.setprotoent.setpwent.setservent.setsockopt.shift.shmctl.shmget.shmread.shmwrite.shutdown.sin.sleep.socket.socketpair.sort.splice.split.sprintf.sqrt.srand.stat.state.study.sub.substr.symlink.syscall.sysopen.sysread.sysseek.system.syswrite.tell.telldir.tie.tied.time.times.tr.truncate.uc.ucfirst.umask.undef.unless.unlink.unpack.unshift.untie.until.use.utime.values.vec.wait.waitpid.wantarray.warn.when.while.write.x|0.xor.y|0`.split(`.`),r=/[dualxmsipngr]{0,12}/,i={$pattern:/[\w.]+/,keyword:n.join(` `)},a={className:`subst`,begin:`[$@]\\{`,end:`\\}`,keywords:i},o={begin:/->\{/,end:/\}/},s={scope:`attr`,match:/\s+:\s*\w+(\s*\(.*?\))?/},c={scope:`variable`,variants:[{begin:/\$\d/},{begin:t.concat(/[$%@](?!")(\^\w\b|#\w+(::\w+)*|\{\w+\}|\w+(::\w*)*)/,`(?![A-Za-z])(?![@$%])`)},{begin:/[$%@](?!")[^\s\w{=]|\$=/,relevance:0}],contains:[s]},l={className:`number`,variants:[{match:/0?\.[0-9][0-9_]+\b/},{match:/\bv?(0|[1-9][0-9_]*(\.[0-9_]+)?|[1-9][0-9_]*)\b/},{match:/\b0[0-7][0-7_]*\b/},{match:/\b0x[0-9a-fA-F][0-9a-fA-F_]*\b/},{match:/\b0b[0-1][0-1_]*\b/}],relevance:0},u=[e.BACKSLASH_ESCAPE,a,c],d=[/!/,/\//,/\|/,/\?/,/'/,/"/,/#/],f=(e,n,i=`\\1`)=>{let a=i===`\\1`?i:t.concat(i,n);return t.concat(t.concat(`(?:`,e,`)`),n,/(?:\\.|[^\\\/])*?/,a,/(?:\\.|[^\\\/])*?/,i,r)},p=(e,n,i)=>t.concat(t.concat(`(?:`,e,`)`),n,/(?:\\.|[^\\\/])*?/,i,r),m=[c,e.HASH_COMMENT_MODE,e.COMMENT(/^=\w/,/=cut/,{endsWithParent:!0}),o,{className:`string`,contains:u,variants:[{begin:`q[qwxr]?\\s*\\(`,end:`\\)`,relevance:5},{begin:`q[qwxr]?\\s*\\[`,end:`\\]`,relevance:5},{begin:`q[qwxr]?\\s*\\{`,end:`\\}`,relevance:5},{begin:`q[qwxr]?\\s*\\|`,end:`\\|`,relevance:5},{begin:`q[qwxr]?\\s*<`,end:`>`,relevance:5},{begin:`qw\\s+q`,end:`q`,relevance:5},{begin:`'`,end:`'`,contains:[e.BACKSLASH_ESCAPE]},{begin:`"`,end:`"`},{begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE]},{begin:/\{\w+\}/,relevance:0},{begin:`-?\\w+\\s*=>`,relevance:0}]},l,{begin:`(\\/\\/|`+e.RE_STARTERS_RE+`|\\b(split|return|print|reverse|grep)\\b)\\s*`,keywords:`split return print reverse grep`,relevance:0,contains:[e.HASH_COMMENT_MODE,{className:`regexp`,variants:[{begin:f(`s|tr|y`,t.either(...d,{capture:!0}))},{begin:f(`s|tr|y`,`\\(`,`\\)`)},{begin:f(`s|tr|y`,`\\[`,`\\]`)},{begin:f(`s|tr|y`,`\\{`,`\\}`)}],relevance:2},{className:`regexp`,variants:[{begin:/(m|qr)\/\//,relevance:0},{begin:p(`(?:m|qr)?`,/\//,/\//)},{begin:p(`m|qr`,t.either(...d,{capture:!0}),/\1/)},{begin:p(`m|qr`,/\(/,/\)/)},{begin:p(`m|qr`,/\[/,/\]/)},{begin:p(`m|qr`,/\{/,/\}/)}]}]},{className:`function`,beginKeywords:`sub method`,end:`(\\s*\\(.*?\\))?[;{]`,excludeEnd:!0,relevance:5,contains:[e.TITLE_MODE,s]},{className:`class`,beginKeywords:`class`,end:`[;{]`,excludeEnd:!0,relevance:5,contains:[e.TITLE_MODE,s,l]},{begin:`-\\w\\b`,relevance:0},{begin:`^__DATA__$`,end:`^__END__$`,subLanguage:`mojolicious`,contains:[{begin:`^@@.*`,end:`$`,className:`comment`}]}];return a.contains=m,o.contains=m,{name:`Perl`,aliases:[`pl`,`pm`],keywords:i,contains:m}}function Cu(e){let t=e.regex,n=/(?![A-Za-z0-9])(?![$])/,r=t.concat(/[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/,n),i=t.concat(/(\\?[A-Z][a-z0-9_\x7f-\xff]+|\\?[A-Z]+(?=[A-Z][a-z0-9_\x7f-\xff])){1,}/,n),a=t.concat(/[A-Z]+/,n),o={scope:`variable`,match:`\\$+`+r},s={scope:`meta`,variants:[{begin:/<\?php/,relevance:10},{begin:/<\?=/},{begin:/<\?/,relevance:.1},{begin:/\?>/}]},c={scope:`subst`,variants:[{begin:/\$\w+/},{begin:/\{\$/,end:/\}/}]},l=e.inherit(e.APOS_STRING_MODE,{illegal:null}),u=e.inherit(e.QUOTE_STRING_MODE,{illegal:null,contains:e.QUOTE_STRING_MODE.contains.concat(c)}),d={begin:/<<<[ \t]*(?:(\w+)|"(\w+)")\n/,end:/[ \t]*(\w+)\b/,contains:e.QUOTE_STRING_MODE.contains.concat(c),"on:begin":(e,t)=>{t.data._beginMatch=e[1]||e[2]},"on:end":(e,t)=>{t.data._beginMatch!==e[1]&&t.ignoreMatch()}},f=e.END_SAME_AS_BEGIN({begin:/<<<[ \t]*'(\w+)'\n/,end:/[ \t]*(\w+)\b/}),p=`[ +]`,m={scope:`string`,variants:[u,l,d,f]},h={scope:`number`,variants:[{begin:`\\b0[bB][01]+(?:_[01]+)*\\b`},{begin:`\\b0[oO][0-7]+(?:_[0-7]+)*\\b`},{begin:`\\b0[xX][\\da-fA-F]+(?:_[\\da-fA-F]+)*\\b`},{begin:`(?:\\b\\d+(?:_\\d+)*(\\.(?:\\d+(?:_\\d+)*))?|\\B\\.\\d+)(?:[eE][+-]?\\d+)?`}],relevance:0},g=[`false`,`null`,`true`],_=`__CLASS__.__DIR__.__FILE__.__FUNCTION__.__COMPILER_HALT_OFFSET__.__LINE__.__METHOD__.__NAMESPACE__.__TRAIT__.die.echo.exit.include.include_once.print.require.require_once.array.abstract.and.as.binary.bool.boolean.break.callable.case.catch.class.clone.const.continue.declare.default.do.double.else.elseif.empty.enddeclare.endfor.endforeach.endif.endswitch.endwhile.enum.eval.extends.final.finally.float.for.foreach.from.global.goto.if.implements.instanceof.insteadof.int.integer.interface.isset.iterable.list.match|0.mixed.new.never.object.or.private.protected.public.readonly.real.return.string.switch.throw.trait.try.unset.use.var.void.while.xor.yield`.split(`.`),v=`Error|0.AppendIterator.ArgumentCountError.ArithmeticError.ArrayIterator.ArrayObject.AssertionError.BadFunctionCallException.BadMethodCallException.CachingIterator.CallbackFilterIterator.CompileError.Countable.DirectoryIterator.DivisionByZeroError.DomainException.EmptyIterator.ErrorException.Exception.FilesystemIterator.FilterIterator.GlobIterator.InfiniteIterator.InvalidArgumentException.IteratorIterator.LengthException.LimitIterator.LogicException.MultipleIterator.NoRewindIterator.OutOfBoundsException.OutOfRangeException.OuterIterator.OverflowException.ParentIterator.ParseError.RangeException.RecursiveArrayIterator.RecursiveCachingIterator.RecursiveCallbackFilterIterator.RecursiveDirectoryIterator.RecursiveFilterIterator.RecursiveIterator.RecursiveIteratorIterator.RecursiveRegexIterator.RecursiveTreeIterator.RegexIterator.RuntimeException.SeekableIterator.SplDoublyLinkedList.SplFileInfo.SplFileObject.SplFixedArray.SplHeap.SplMaxHeap.SplMinHeap.SplObjectStorage.SplObserver.SplPriorityQueue.SplQueue.SplStack.SplSubject.SplTempFileObject.TypeError.UnderflowException.UnexpectedValueException.UnhandledMatchError.ArrayAccess.BackedEnum.Closure.Fiber.Generator.Iterator.IteratorAggregate.Serializable.Stringable.Throwable.Traversable.UnitEnum.WeakReference.WeakMap.Directory.__PHP_Incomplete_Class.parent.php_user_filter.self.static.stdClass`.split(`.`),y={keyword:_,literal:(e=>{let t=[];return e.forEach(e=>{t.push(e),e.toLowerCase()===e?t.push(e.toUpperCase()):t.push(e.toLowerCase())}),t})(g),built_in:v},b=e=>e.map(e=>e.replace(/\|\d+$/,``)),x={variants:[{match:[/new/,t.concat(p,`+`),t.concat(`(?!`,b(v).join(`\\b|`),`\\b)`),i],scope:{1:`keyword`,4:`title.class`}}]},S=t.concat(r,`\\b(?!\\()`),C={variants:[{match:[t.concat(/::/,t.lookahead(/(?!class\b)/)),S],scope:{2:`variable.constant`}},{match:[/::/,/class/],scope:{2:`variable.language`}},{match:[i,t.concat(/::/,t.lookahead(/(?!class\b)/)),S],scope:{1:`title.class`,3:`variable.constant`}},{match:[i,t.concat(`::`,t.lookahead(/(?!class\b)/))],scope:{1:`title.class`}},{match:[i,/::/,/class/],scope:{1:`title.class`,3:`variable.language`}}]},w={scope:`attr`,match:t.concat(r,t.lookahead(`:`),t.lookahead(/(?!::)/))},T={relevance:0,begin:/\(/,end:/\)/,keywords:y,contains:[w,o,C,e.C_BLOCK_COMMENT_MODE,m,h,x]},E={relevance:0,match:[/\b/,t.concat(`(?!fn\\b|function\\b|`,b(_).join(`\\b|`),`|`,b(v).join(`\\b|`),`\\b)`),r,t.concat(p,`*`),t.lookahead(/(?=\()/)],scope:{3:`title.function.invoke`},contains:[T]};T.contains.push(E);let D=[w,C,e.C_BLOCK_COMMENT_MODE,m,h,x],O={begin:t.concat(/#\[\s*\\?/,t.either(i,a)),beginScope:`meta`,end:/]/,endScope:`meta`,keywords:{literal:g,keyword:[`new`,`array`]},contains:[{begin:/\[/,end:/]/,keywords:{literal:g,keyword:[`new`,`array`]},contains:[`self`,...D]},...D,{scope:`meta`,variants:[{match:i},{match:a}]}]};return{case_insensitive:!1,keywords:y,contains:[O,e.HASH_COMMENT_MODE,e.COMMENT(`//`,`$`),e.COMMENT(`/\\*`,`\\*/`,{contains:[{scope:`doctag`,match:`@[A-Za-z]+`}]}),{match:/__halt_compiler\(\);/,keywords:`__halt_compiler`,starts:{scope:`comment`,end:e.MATCH_NOTHING_RE,contains:[{match:/\?>/,scope:`meta`,endsParent:!0}]}},s,{scope:`variable.language`,match:/\$this\b/},o,E,C,{match:[/const/,/\s/,r],scope:{1:`keyword`,3:`variable.constant`}},x,{scope:`function`,relevance:0,beginKeywords:`fn function`,end:/[;{]/,excludeEnd:!0,illegal:`[$%\\[]`,contains:[{beginKeywords:`use`},e.UNDERSCORE_TITLE_MODE,{begin:`=>`,endsParent:!0},{scope:`params`,begin:`\\(`,end:`\\)`,excludeBegin:!0,excludeEnd:!0,keywords:y,contains:[`self`,O,o,C,e.C_BLOCK_COMMENT_MODE,m,h]}]},{scope:`class`,variants:[{beginKeywords:`enum`,illegal:/[($"]/},{beginKeywords:`class interface trait`,illegal:/[:($"]/}],relevance:0,end:/\{/,excludeEnd:!0,contains:[{beginKeywords:`extends implements`},e.UNDERSCORE_TITLE_MODE]},{beginKeywords:`namespace`,relevance:0,end:`;`,illegal:/[.']/,contains:[e.inherit(e.UNDERSCORE_TITLE_MODE,{scope:`title.class`})]},{beginKeywords:`use`,relevance:0,end:`;`,contains:[{match:/\b(as|const|function)\b/,scope:`keyword`},e.UNDERSCORE_TITLE_MODE]},m,h]}}function wu(e){return{name:`PHP template`,subLanguage:`xml`,contains:[{begin:/<\?(php|=)?/,end:/\?>/,subLanguage:`php`,contains:[{begin:`/\\*`,end:`\\*/`,skip:!0},{begin:`b"`,end:`"`,skip:!0},{begin:`b'`,end:`'`,skip:!0},e.inherit(e.APOS_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0}),e.inherit(e.QUOTE_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0})]}]}}function Tu(e){return{name:`Plain text`,aliases:[`text`,`txt`],disableAutodetect:!0}}function Eu(e){let t=e.regex,n=/[\p{XID_Start}_]\p{XID_Continue}*/u,r=`and.as.assert.async.await.break.case.class.continue.def.del.elif.else.except.finally.for.from.global.if.import.in.is.lambda.match.nonlocal|10.not.or.pass.raise.return.try.while.with.yield`.split(`.`),i={$pattern:/[A-Za-z]\w+|__\w+__/,keyword:r,built_in:`__import__.abs.all.any.ascii.bin.bool.breakpoint.bytearray.bytes.callable.chr.classmethod.compile.complex.delattr.dict.dir.divmod.enumerate.eval.exec.filter.float.format.frozenset.getattr.globals.hasattr.hash.help.hex.id.input.int.isinstance.issubclass.iter.len.list.locals.map.max.memoryview.min.next.object.oct.open.ord.pow.print.property.range.repr.reversed.round.set.setattr.slice.sorted.staticmethod.str.sum.super.tuple.type.vars.zip`.split(`.`),literal:[`__debug__`,`Ellipsis`,`False`,`None`,`NotImplemented`,`True`],type:[`Any`,`Callable`,`Coroutine`,`Dict`,`List`,`Literal`,`Generic`,`Optional`,`Sequence`,`Set`,`Tuple`,`Type`,`Union`]},a={className:`meta`,begin:/^(>>>|\.\.\.) /},o={className:`subst`,begin:/\{/,end:/\}/,keywords:i,illegal:/#/},s={begin:/\{\{/,relevance:0},c={className:`string`,contains:[e.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,a],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,a],relevance:10},{begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,a,s,o]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,a,s,o]},{begin:/([uU]|[rR])'/,end:/'/,relevance:10},{begin:/([uU]|[rR])"/,end:/"/,relevance:10},{begin:/([bB]|[bB][rR]|[rR][bB])'/,end:/'/},{begin:/([bB]|[bB][rR]|[rR][bB])"/,end:/"/},{begin:/([fF][rR]|[rR][fF]|[fF])'/,end:/'/,contains:[e.BACKSLASH_ESCAPE,s,o]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,s,o]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},l=`[0-9](_?[0-9])*`,u=`(\\b(${l}))?\\.(${l})|\\b(${l})\\.`,d=`\\b|${r.join(`|`)}`,f={className:`number`,relevance:0,variants:[{begin:`(\\b(${l})|(${u}))[eE][+-]?(${l})[jJ]?(?=${d})`},{begin:`(${u})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${d})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${d})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${d})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${d})`},{begin:`\\b(${l})[jJ](?=${d})`}]},p={className:`comment`,begin:t.lookahead(/# type:/),end:/$/,keywords:i,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},m={className:`params`,variants:[{className:``,begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:i,contains:[`self`,a,f,c,e.HASH_COMMENT_MODE]}]};return o.contains=[c,f,a],{name:`Python`,aliases:[`py`,`gyp`,`ipython`],unicodeRegex:!0,keywords:i,illegal:/(<\/|\?)|=>/,contains:[a,f,{scope:`variable.language`,match:/\bself\b/},{beginKeywords:`if`,relevance:0},{match:/\bor\b/,scope:`keyword`},c,p,e.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,n],scope:{1:`keyword`,3:`title.function`},contains:[m]},{variants:[{match:[/\bclass/,/\s+/,n,/\s*/,/\(\s*/,n,/\s*\)/]},{match:[/\bclass/,/\s+/,n]}],scope:{1:`keyword`,3:`title.class`,6:`title.class.inherited`}},{className:`meta`,begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[f,m,c]}]}}function Du(e){return{aliases:[`pycon`],contains:[{className:`meta.prompt`,starts:{end:/ |$/,starts:{end:`$`,subLanguage:`python`}},variants:[{begin:/^>>>(?=[ ]|$)/},{begin:/^\.\.\.(?=[ ]|$)/}]}]}}function Ou(e){let t=e.regex,n=/(?:(?:[a-zA-Z]|\.[._a-zA-Z])[._a-zA-Z0-9]*)|\.(?!\d)/,r=t.either(/0[xX][0-9a-fA-F]+\.[0-9a-fA-F]*[pP][+-]?\d+i?/,/0[xX][0-9a-fA-F]+(?:[pP][+-]?\d+)?[Li]?/,/(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?[Li]?/),i=/[=!<>:]=|\|\||&&|:::?|<-|<<-|->>|->|\|>|[-+*\/?!$&|:<=>@^~]|\*\*/,a=t.either(/[()]/,/[{}]/,/\[\[/,/[[\]]/,/\\/,/,/);return{name:`R`,keywords:{$pattern:n,keyword:`function if in break next repeat else for while`,literal:`NULL NA TRUE FALSE Inf NaN NA_integer_|10 NA_real_|10 NA_character_|10 NA_complex_|10`,built_in:`LETTERS letters month.abb month.name pi T F abs acos acosh all any anyNA Arg as.call as.character as.complex as.double as.environment as.integer as.logical as.null.default as.numeric as.raw asin asinh atan atanh attr attributes baseenv browser c call ceiling class Conj cos cosh cospi cummax cummin cumprod cumsum digamma dim dimnames emptyenv exp expression floor forceAndCall gamma gc.time globalenv Im interactive invisible is.array is.atomic is.call is.character is.complex is.double is.environment is.expression is.finite is.function is.infinite is.integer is.language is.list is.logical is.matrix is.na is.name is.nan is.null is.numeric is.object is.pairlist is.raw is.recursive is.single is.symbol lazyLoadDBfetch length lgamma list log max min missing Mod names nargs nzchar oldClass on.exit pos.to.env proc.time prod quote range Re rep retracemem return round seq_along seq_len seq.int sign signif sin sinh sinpi sqrt standardGeneric substitute sum switch tan tanh tanpi tracemem trigamma trunc unclass untracemem UseMethod xtfrm`},contains:[e.COMMENT(/#'/,/$/,{contains:[{scope:`doctag`,match:/@examples/,starts:{end:t.lookahead(t.either(/\n^#'\s*(?=@[a-zA-Z]+)/,/\n^(?!#')/)),endsParent:!0}},{scope:`doctag`,begin:`@param`,end:/$/,contains:[{scope:`variable`,variants:[{match:n},{match:/`(?:\\.|[^`\\])+`/}],endsParent:!0}]},{scope:`doctag`,match:/@[a-zA-Z]+/},{scope:`keyword`,match:/\\[a-zA-Z]+/}]}),e.HASH_COMMENT_MODE,{scope:`string`,contains:[e.BACKSLASH_ESCAPE],variants:[e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\(/,end:/\)(-*)"/}),e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\{/,end:/\}(-*)"/}),e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\[/,end:/\](-*)"/}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\(/,end:/\)(-*)'/}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\{/,end:/\}(-*)'/}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\[/,end:/\](-*)'/}),{begin:`"`,end:`"`,relevance:0},{begin:`'`,end:`'`,relevance:0}]},{relevance:0,variants:[{scope:{1:`operator`,2:`number`},match:[i,r]},{scope:{1:`operator`,2:`number`},match:[/%[^%]*%/,r]},{scope:{1:`punctuation`,2:`number`},match:[a,r]},{scope:{2:`number`},match:[/[^a-zA-Z0-9._]|^/,r]}]},{scope:{3:`operator`},match:[n,/\s+/,/<-/,/\s+/]},{scope:`operator`,relevance:0,variants:[{match:i},{match:/%[^%]*%/}]},{scope:`punctuation`,relevance:0,match:a},{begin:"`",end:"`",contains:[{begin:/\\./}]}]}}function ku(e){let t=e.regex,n="([a-zA-Z_]\\w*[!?=]?|[-+~]@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?)",r=t.either(/\b([A-Z]+[a-z0-9]+)+/,/\b([A-Z]+[a-z0-9]+)+[A-Z]+/),i=t.concat(r,/(::\w+)*/),a={"variable.constant":[`__FILE__`,`__LINE__`,`__ENCODING__`],"variable.language":[`self`,`super`],keyword:`alias.and.begin.BEGIN.break.case.class.defined.do.else.elsif.end.END.ensure.for.if.in.module.next.not.or.redo.require.rescue.retry.return.then.undef.unless.until.when.while.yield.include.extend.prepend.public.private.protected.raise.throw`.split(`.`),built_in:[`proc`,`lambda`,`attr_accessor`,`attr_reader`,`attr_writer`,`define_method`,`private_constant`,`module_function`],literal:[`true`,`false`,`nil`]},o={className:`doctag`,begin:`@[A-Za-z]+`},s={begin:`#<`,end:`>`},c=[e.COMMENT(`#`,`$`,{contains:[o]}),e.COMMENT(`^=begin`,`^=end`,{contains:[o],relevance:10}),e.COMMENT(`^__END__`,e.MATCH_NOTHING_RE)],l={className:`subst`,begin:/#\{/,end:/\}/,keywords:a},u={className:`string`,contains:[e.BACKSLASH_ESCAPE,l],variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/`/,end:/`/},{begin:/%[qQwWx]?\(/,end:/\)/},{begin:/%[qQwWx]?\[/,end:/\]/},{begin:/%[qQwWx]?\{/,end:/\}/},{begin:/%[qQwWx]?/},{begin:/%[qQwWx]?\//,end:/\//},{begin:/%[qQwWx]?%/,end:/%/},{begin:/%[qQwWx]?-/,end:/-/},{begin:/%[qQwWx]?\|/,end:/\|/},{begin:/\B\?(\\\d{1,3})/},{begin:/\B\?(\\x[A-Fa-f0-9]{1,2})/},{begin:/\B\?(\\u\{?[A-Fa-f0-9]{1,6}\}?)/},{begin:/\B\?(\\M-\\C-|\\M-\\c|\\c\\M-|\\M-|\\C-\\M-)[\x20-\x7e]/},{begin:/\B\?\\(c|C-)[\x20-\x7e]/},{begin:/\B\?\\?\S/},{begin:t.concat(/<<[-~]?'?/,t.lookahead(/(\w+)(?=\W)[^\n]*\n(?:[^\n]*\n)*?\s*\1\b/)),contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,contains:[e.BACKSLASH_ESCAPE,l]})]}]},d=`[0-9](_?[0-9])*`,f={className:`number`,relevance:0,variants:[{begin:`\\b([1-9](_?[0-9])*|0)(\\.(${d}))?([eE][+-]?(${d})|r)?i?\\b`},{begin:`\\b0[dD][0-9](_?[0-9])*r?i?\\b`},{begin:`\\b0[bB][0-1](_?[0-1])*r?i?\\b`},{begin:`\\b0[oO][0-7](_?[0-7])*r?i?\\b`},{begin:`\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*r?i?\\b`},{begin:`\\b0(_?[0-7])+r?i?\\b`}]},p={variants:[{match:/\(\)/},{className:`params`,begin:/\(/,end:/(?=\))/,excludeBegin:!0,endsParent:!0,keywords:a}]},m=[u,{variants:[{match:[/class\s+/,i,/\s+<\s+/,i]},{match:[/\b(class|module)\s+/,i]}],scope:{2:`title.class`,4:`title.class.inherited`},keywords:a},{match:[/(include|extend)\s+/,i],scope:{2:`title.class`},keywords:a},{relevance:0,match:[i,/\.new[. (]/],scope:{1:`title.class`}},{relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:`variable.constant`},{relevance:0,match:r,scope:`title.class`},{match:[/def/,/\s+/,n],scope:{1:`keyword`,3:`title.function`},contains:[p]},{begin:e.IDENT_RE+`::`},{className:`symbol`,begin:e.UNDERSCORE_IDENT_RE+`(!|\\?)?:`,relevance:0},{className:`symbol`,begin:`:(?!\\s)`,contains:[u,{begin:n}],relevance:0},f,{className:`variable`,begin:`(\\$\\W)|((\\$|@@?)(\\w+))(?=[^@$?])(?![A-Za-z])(?![@$?'])`},{className:`params`,begin:/\|(?!=)/,end:/\|/,excludeBegin:!0,excludeEnd:!0,relevance:0,keywords:a},{begin:`(`+e.RE_STARTERS_RE+`|unless)\\s*`,keywords:`unless`,contains:[{className:`regexp`,contains:[e.BACKSLASH_ESCAPE,l],illegal:/\n/,variants:[{begin:`/`,end:`/[a-z]*`},{begin:/%r\{/,end:/\}[a-z]*/},{begin:`%r\\(`,end:`\\)[a-z]*`},{begin:`%r!`,end:`![a-z]*`},{begin:`%r\\[`,end:`\\][a-z]*`}]}].concat(s,c),relevance:0}].concat(s,c);l.contains=m,p.contains=m;let h=[{begin:/^\s*=>/,starts:{end:`$`,contains:m}},{className:`meta.prompt`,begin:`^([>?]>|[\\w#]+\\(\\w+\\):\\d+:\\d+[>*]|(\\w+-)?\\d+\\.\\d+\\.\\d+(p\\d+)?[^\\d][^>]+>)(?=[ ])`,starts:{end:`$`,keywords:a,contains:m}}];return c.unshift(s),{name:`Ruby`,aliases:[`rb`,`gemspec`,`podspec`,`thor`,`irb`],keywords:a,illegal:/\/\*/,contains:[e.SHEBANG({binary:`ruby`})].concat(h,c,m)}}function Au(e){let t=e.regex,n=/(r#)?/,r=t.concat(n,e.UNDERSCORE_IDENT_RE),i=t.concat(n,e.IDENT_RE),a={className:`title.function.invoke`,relevance:0,begin:t.concat(/\b/,/(?!let|for|while|if|else|match\b)/,i,t.lookahead(/\s*\(/))},o=`abstract.as.async.await.become.box.break.const.continue.crate.do.dyn.else.enum.extern.false.final.fn.for.if.impl.in.let.loop.macro.match.mod.move.mut.override.priv.pub.ref.return.self.Self.static.struct.super.trait.true.try.type.typeof.union.unsafe.unsized.use.virtual.where.while.yield`.split(`.`),s=[`true`,`false`,`Some`,`None`,`Ok`,`Err`],c=`drop .Copy.Send.Sized.Sync.Drop.Fn.FnMut.FnOnce.ToOwned.Clone.Debug.PartialEq.PartialOrd.Eq.Ord.AsRef.AsMut.Into.From.Default.Iterator.Extend.IntoIterator.DoubleEndedIterator.ExactSizeIterator.SliceConcatExt.ToString.assert!.assert_eq!.bitflags!.bytes!.cfg!.col!.concat!.concat_idents!.debug_assert!.debug_assert_eq!.env!.eprintln!.panic!.file!.format!.format_args!.include_bytes!.include_str!.line!.local_data_key!.module_path!.option_env!.print!.println!.select!.stringify!.try!.unimplemented!.unreachable!.vec!.write!.writeln!.macro_rules!.assert_ne!.debug_assert_ne!`.split(`.`),l=[`i8`,`i16`,`i32`,`i64`,`i128`,`isize`,`u8`,`u16`,`u32`,`u64`,`u128`,`usize`,`f32`,`f64`,`str`,`char`,`bool`,`Box`,`Option`,`Result`,`String`,`Vec`];return{name:`Rust`,aliases:[`rs`],keywords:{$pattern:e.IDENT_RE+`!?`,type:l,keyword:o,literal:s,built_in:c},illegal:``},a]}}var ju=e=>({IMPORTANT:{scope:`meta`,begin:`!important`},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:`number`,begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:`built_in`,begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:`selector-attr`,begin:/\[/,end:/\]/,illegal:`$`,contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:`number`,begin:e.NUMBER_RE+`(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?`,relevance:0},CSS_VARIABLE:{className:`attr`,begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),Mu=`a.abbr.address.article.aside.audio.b.blockquote.body.button.canvas.caption.cite.code.dd.del.details.dfn.div.dl.dt.em.fieldset.figcaption.figure.footer.form.h1.h2.h3.h4.h5.h6.header.hgroup.html.i.iframe.img.input.ins.kbd.label.legend.li.main.mark.menu.nav.object.ol.optgroup.option.p.picture.q.quote.samp.section.select.source.span.strong.summary.sup.table.tbody.td.textarea.tfoot.th.thead.time.tr.ul.var.video`.split(`.`),Nu=`defs.g.marker.mask.pattern.svg.switch.symbol.feBlend.feColorMatrix.feComponentTransfer.feComposite.feConvolveMatrix.feDiffuseLighting.feDisplacementMap.feFlood.feGaussianBlur.feImage.feMerge.feMorphology.feOffset.feSpecularLighting.feTile.feTurbulence.linearGradient.radialGradient.stop.circle.ellipse.image.line.path.polygon.polyline.rect.text.use.textPath.tspan.foreignObject.clipPath`.split(`.`),Pu=[...Mu,...Nu],Fu=`any-hover.any-pointer.aspect-ratio.color.color-gamut.color-index.device-aspect-ratio.device-height.device-width.display-mode.forced-colors.grid.height.hover.inverted-colors.monochrome.orientation.overflow-block.overflow-inline.pointer.prefers-color-scheme.prefers-contrast.prefers-reduced-motion.prefers-reduced-transparency.resolution.scan.scripting.update.width.min-width.max-width.min-height.max-height`.split(`.`).sort().reverse(),Iu=`active.any-link.blank.checked.current.default.defined.dir.disabled.drop.empty.enabled.first.first-child.first-of-type.fullscreen.future.focus.focus-visible.focus-within.has.host.host-context.hover.indeterminate.in-range.invalid.is.lang.last-child.last-of-type.left.link.local-link.not.nth-child.nth-col.nth-last-child.nth-last-col.nth-last-of-type.nth-of-type.only-child.only-of-type.optional.out-of-range.past.placeholder-shown.read-only.read-write.required.right.root.scope.target.target-within.user-invalid.valid.visited.where`.split(`.`).sort().reverse(),Lu=[`after`,`backdrop`,`before`,`cue`,`cue-region`,`first-letter`,`first-line`,`grammar-error`,`marker`,`part`,`placeholder`,`selection`,`slotted`,`spelling-error`].sort().reverse(),Ru=`accent-color.align-content.align-items.align-self.alignment-baseline.all.anchor-name.animation.animation-composition.animation-delay.animation-direction.animation-duration.animation-fill-mode.animation-iteration-count.animation-name.animation-play-state.animation-range.animation-range-end.animation-range-start.animation-timeline.animation-timing-function.appearance.aspect-ratio.backdrop-filter.backface-visibility.background.background-attachment.background-blend-mode.background-clip.background-color.background-image.background-origin.background-position.background-position-x.background-position-y.background-repeat.background-size.baseline-shift.block-size.border.border-block.border-block-color.border-block-end.border-block-end-color.border-block-end-style.border-block-end-width.border-block-start.border-block-start-color.border-block-start-style.border-block-start-width.border-block-style.border-block-width.border-bottom.border-bottom-color.border-bottom-left-radius.border-bottom-right-radius.border-bottom-style.border-bottom-width.border-collapse.border-color.border-end-end-radius.border-end-start-radius.border-image.border-image-outset.border-image-repeat.border-image-slice.border-image-source.border-image-width.border-inline.border-inline-color.border-inline-end.border-inline-end-color.border-inline-end-style.border-inline-end-width.border-inline-start.border-inline-start-color.border-inline-start-style.border-inline-start-width.border-inline-style.border-inline-width.border-left.border-left-color.border-left-style.border-left-width.border-radius.border-right.border-right-color.border-right-style.border-right-width.border-spacing.border-start-end-radius.border-start-start-radius.border-style.border-top.border-top-color.border-top-left-radius.border-top-right-radius.border-top-style.border-top-width.border-width.bottom.box-align.box-decoration-break.box-direction.box-flex.box-flex-group.box-lines.box-ordinal-group.box-orient.box-pack.box-shadow.box-sizing.break-after.break-before.break-inside.caption-side.caret-color.clear.clip.clip-path.clip-rule.color.color-interpolation.color-interpolation-filters.color-profile.color-rendering.color-scheme.column-count.column-fill.column-gap.column-rule.column-rule-color.column-rule-style.column-rule-width.column-span.column-width.columns.contain.contain-intrinsic-block-size.contain-intrinsic-height.contain-intrinsic-inline-size.contain-intrinsic-size.contain-intrinsic-width.container.container-name.container-type.content.content-visibility.counter-increment.counter-reset.counter-set.cue.cue-after.cue-before.cursor.cx.cy.direction.display.dominant-baseline.empty-cells.enable-background.field-sizing.fill.fill-opacity.fill-rule.filter.flex.flex-basis.flex-direction.flex-flow.flex-grow.flex-shrink.flex-wrap.float.flood-color.flood-opacity.flow.font.font-display.font-family.font-feature-settings.font-kerning.font-language-override.font-optical-sizing.font-palette.font-size.font-size-adjust.font-smooth.font-smoothing.font-stretch.font-style.font-synthesis.font-synthesis-position.font-synthesis-small-caps.font-synthesis-style.font-synthesis-weight.font-variant.font-variant-alternates.font-variant-caps.font-variant-east-asian.font-variant-emoji.font-variant-ligatures.font-variant-numeric.font-variant-position.font-variation-settings.font-weight.forced-color-adjust.gap.glyph-orientation-horizontal.glyph-orientation-vertical.grid.grid-area.grid-auto-columns.grid-auto-flow.grid-auto-rows.grid-column.grid-column-end.grid-column-start.grid-gap.grid-row.grid-row-end.grid-row-start.grid-template.grid-template-areas.grid-template-columns.grid-template-rows.hanging-punctuation.height.hyphenate-character.hyphenate-limit-chars.hyphens.icon.image-orientation.image-rendering.image-resolution.ime-mode.initial-letter.initial-letter-align.inline-size.inset.inset-area.inset-block.inset-block-end.inset-block-start.inset-inline.inset-inline-end.inset-inline-start.isolation.justify-content.justify-items.justify-self.kerning.left.letter-spacing.lighting-color.line-break.line-height.line-height-step.list-style.list-style-image.list-style-position.list-style-type.margin.margin-block.margin-block-end.margin-block-start.margin-bottom.margin-inline.margin-inline-end.margin-inline-start.margin-left.margin-right.margin-top.margin-trim.marker.marker-end.marker-mid.marker-start.marks.mask.mask-border.mask-border-mode.mask-border-outset.mask-border-repeat.mask-border-slice.mask-border-source.mask-border-width.mask-clip.mask-composite.mask-image.mask-mode.mask-origin.mask-position.mask-repeat.mask-size.mask-type.masonry-auto-flow.math-depth.math-shift.math-style.max-block-size.max-height.max-inline-size.max-width.min-block-size.min-height.min-inline-size.min-width.mix-blend-mode.nav-down.nav-index.nav-left.nav-right.nav-up.none.normal.object-fit.object-position.offset.offset-anchor.offset-distance.offset-path.offset-position.offset-rotate.opacity.order.orphans.outline.outline-color.outline-offset.outline-style.outline-width.overflow.overflow-anchor.overflow-block.overflow-clip-margin.overflow-inline.overflow-wrap.overflow-x.overflow-y.overlay.overscroll-behavior.overscroll-behavior-block.overscroll-behavior-inline.overscroll-behavior-x.overscroll-behavior-y.padding.padding-block.padding-block-end.padding-block-start.padding-bottom.padding-inline.padding-inline-end.padding-inline-start.padding-left.padding-right.padding-top.page.page-break-after.page-break-before.page-break-inside.paint-order.pause.pause-after.pause-before.perspective.perspective-origin.place-content.place-items.place-self.pointer-events.position.position-anchor.position-visibility.print-color-adjust.quotes.r.resize.rest.rest-after.rest-before.right.rotate.row-gap.ruby-align.ruby-position.scale.scroll-behavior.scroll-margin.scroll-margin-block.scroll-margin-block-end.scroll-margin-block-start.scroll-margin-bottom.scroll-margin-inline.scroll-margin-inline-end.scroll-margin-inline-start.scroll-margin-left.scroll-margin-right.scroll-margin-top.scroll-padding.scroll-padding-block.scroll-padding-block-end.scroll-padding-block-start.scroll-padding-bottom.scroll-padding-inline.scroll-padding-inline-end.scroll-padding-inline-start.scroll-padding-left.scroll-padding-right.scroll-padding-top.scroll-snap-align.scroll-snap-stop.scroll-snap-type.scroll-timeline.scroll-timeline-axis.scroll-timeline-name.scrollbar-color.scrollbar-gutter.scrollbar-width.shape-image-threshold.shape-margin.shape-outside.shape-rendering.speak.speak-as.src.stop-color.stop-opacity.stroke.stroke-dasharray.stroke-dashoffset.stroke-linecap.stroke-linejoin.stroke-miterlimit.stroke-opacity.stroke-width.tab-size.table-layout.text-align.text-align-all.text-align-last.text-anchor.text-combine-upright.text-decoration.text-decoration-color.text-decoration-line.text-decoration-skip.text-decoration-skip-ink.text-decoration-style.text-decoration-thickness.text-emphasis.text-emphasis-color.text-emphasis-position.text-emphasis-style.text-indent.text-justify.text-orientation.text-overflow.text-rendering.text-shadow.text-size-adjust.text-transform.text-underline-offset.text-underline-position.text-wrap.text-wrap-mode.text-wrap-style.timeline-scope.top.touch-action.transform.transform-box.transform-origin.transform-style.transition.transition-behavior.transition-delay.transition-duration.transition-property.transition-timing-function.translate.unicode-bidi.user-modify.user-select.vector-effect.vertical-align.view-timeline.view-timeline-axis.view-timeline-inset.view-timeline-name.view-transition-name.visibility.voice-balance.voice-duration.voice-family.voice-pitch.voice-range.voice-rate.voice-stress.voice-volume.white-space.white-space-collapse.widows.width.will-change.word-break.word-spacing.word-wrap.writing-mode.x.y.z-index.zoom`.split(`.`).sort().reverse();function zu(e){let t=ju(e),n=Lu,r=Iu,i=`@[a-z-]+`,a={className:`variable`,begin:`(\\$[a-zA-Z-][a-zA-Z0-9_-]*)\\b`,relevance:0};return{name:`SCSS`,case_insensitive:!0,illegal:`[=/|']`,contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,t.CSS_NUMBER_MODE,{className:`selector-id`,begin:`#[A-Za-z0-9_-]+`,relevance:0},{className:`selector-class`,begin:`\\.[A-Za-z0-9_-]+`,relevance:0},t.ATTRIBUTE_SELECTOR_MODE,{className:`selector-tag`,begin:`\\b(`+Pu.join(`|`)+`)\\b`,relevance:0},{className:`selector-pseudo`,begin:`:(`+r.join(`|`)+`)`},{className:`selector-pseudo`,begin:`:(:)?(`+n.join(`|`)+`)`},a,{begin:/\(/,end:/\)/,contains:[t.CSS_NUMBER_MODE]},t.CSS_VARIABLE,{className:`attribute`,begin:`\\b(`+Ru.join(`|`)+`)\\b`},{begin:`\\b(whitespace|wait|w-resize|visible|vertical-text|vertical-ideographic|uppercase|upper-roman|upper-alpha|underline|transparent|top|thin|thick|text|text-top|text-bottom|tb-rl|table-header-group|table-footer-group|sw-resize|super|strict|static|square|solid|small-caps|separate|se-resize|scroll|s-resize|rtl|row-resize|ridge|right|repeat|repeat-y|repeat-x|relative|progress|pointer|overline|outside|outset|oblique|nowrap|not-allowed|normal|none|nw-resize|no-repeat|no-drop|newspaper|ne-resize|n-resize|move|middle|medium|ltr|lr-tb|lowercase|lower-roman|lower-alpha|loose|list-item|line|line-through|line-edge|lighter|left|keep-all|justify|italic|inter-word|inter-ideograph|inside|inset|inline|inline-block|inherit|inactive|ideograph-space|ideograph-parenthesis|ideograph-numeric|ideograph-alpha|horizontal|hidden|help|hand|groove|fixed|ellipsis|e-resize|double|dotted|distribute|distribute-space|distribute-letter|distribute-all-lines|disc|disabled|default|decimal|dashed|crosshair|collapse|col-resize|circle|char|center|capitalize|break-word|break-all|bottom|both|bolder|bold|block|bidi-override|below|baseline|auto|always|all-scroll|absolute|table|table-cell)\\b`},{begin:/:/,end:/[;}{]/,relevance:0,contains:[t.BLOCK_COMMENT,a,t.HEXCOLOR,t.CSS_NUMBER_MODE,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,t.IMPORTANT,t.FUNCTION_DISPATCH]},{begin:`@(page|font-face)`,keywords:{$pattern:i,keyword:`@page @font-face`}},{begin:`@`,end:`[{;]`,returnBegin:!0,keywords:{$pattern:/[a-z-]+/,keyword:`and or not only`,attribute:Fu.join(` `)},contains:[{begin:i,className:`keyword`},{begin:/[a-z-]+(?=:)/,className:`attribute`},a,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,t.HEXCOLOR,t.CSS_NUMBER_MODE]},t.FUNCTION_DISPATCH]}}function Bu(e){return{name:`Shell Session`,aliases:[`console`,`shellsession`],contains:[{className:`meta.prompt`,begin:/^\s{0,3}[/~\w\d[\]()@-]*[>%$#][ ]?/,starts:{end:/[^\\](?=\s*$)/,subLanguage:`bash`}}]}}function Vu(e){let t=e.regex,n=e.COMMENT(`--`,`$`),r={scope:`string`,variants:[{begin:/'/,end:/'/,contains:[{match:/''/}]}]},i={begin:/"/,end:/"/,contains:[{match:/""/}]},a=[`true`,`false`,`unknown`],o=[`double precision`,`large object`,`with timezone`,`without timezone`],s=`bigint.binary.blob.boolean.char.character.clob.date.dec.decfloat.decimal.float.int.integer.interval.nchar.nclob.national.numeric.real.row.smallint.time.timestamp.varchar.varying.varbinary`.split(`.`),c=[`add`,`asc`,`collation`,`desc`,`final`,`first`,`last`,`view`],l=`abs.acos.all.allocate.alter.and.any.are.array.array_agg.array_max_cardinality.as.asensitive.asin.asymmetric.at.atan.atomic.authorization.avg.begin.begin_frame.begin_partition.between.bigint.binary.blob.boolean.both.by.call.called.cardinality.cascaded.case.cast.ceil.ceiling.char.char_length.character.character_length.check.classifier.clob.close.coalesce.collate.collect.column.commit.condition.connect.constraint.contains.convert.copy.corr.corresponding.cos.cosh.count.covar_pop.covar_samp.create.cross.cube.cume_dist.current.current_catalog.current_date.current_default_transform_group.current_path.current_role.current_row.current_schema.current_time.current_timestamp.current_path.current_role.current_transform_group_for_type.current_user.cursor.cycle.date.day.deallocate.dec.decimal.decfloat.declare.default.define.delete.dense_rank.deref.describe.deterministic.disconnect.distinct.double.drop.dynamic.each.element.else.empty.end.end_frame.end_partition.end-exec.equals.escape.every.except.exec.execute.exists.exp.external.extract.false.fetch.filter.first_value.float.floor.for.foreign.frame_row.free.from.full.function.fusion.get.global.grant.group.grouping.groups.having.hold.hour.identity.in.indicator.initial.inner.inout.insensitive.insert.int.integer.intersect.intersection.interval.into.is.join.json_array.json_arrayagg.json_exists.json_object.json_objectagg.json_query.json_table.json_table_primitive.json_value.lag.language.large.last_value.lateral.lead.leading.left.like.like_regex.listagg.ln.local.localtime.localtimestamp.log.log10.lower.match.match_number.match_recognize.matches.max.member.merge.method.min.minute.mod.modifies.module.month.multiset.national.natural.nchar.nclob.new.no.none.normalize.not.nth_value.ntile.null.nullif.numeric.octet_length.occurrences_regex.of.offset.old.omit.on.one.only.open.or.order.out.outer.over.overlaps.overlay.parameter.partition.pattern.per.percent.percent_rank.percentile_cont.percentile_disc.period.portion.position.position_regex.power.precedes.precision.prepare.primary.procedure.ptf.range.rank.reads.real.recursive.ref.references.referencing.regr_avgx.regr_avgy.regr_count.regr_intercept.regr_r2.regr_slope.regr_sxx.regr_sxy.regr_syy.release.result.return.returns.revoke.right.rollback.rollup.row.row_number.rows.running.savepoint.scope.scroll.search.second.seek.select.sensitive.session_user.set.show.similar.sin.sinh.skip.smallint.some.specific.specifictype.sql.sqlexception.sqlstate.sqlwarning.sqrt.start.static.stddev_pop.stddev_samp.submultiset.subset.substring.substring_regex.succeeds.sum.symmetric.system.system_time.system_user.table.tablesample.tan.tanh.then.time.timestamp.timezone_hour.timezone_minute.to.trailing.translate.translate_regex.translation.treat.trigger.trim.trim_array.true.truncate.uescape.union.unique.unknown.unnest.update.upper.user.using.value.values.value_of.var_pop.var_samp.varbinary.varchar.varying.versioning.when.whenever.where.width_bucket.window.with.within.without.year`.split(`.`),u=`abs.acos.array_agg.asin.atan.avg.cast.ceil.ceiling.coalesce.corr.cos.cosh.count.covar_pop.covar_samp.cume_dist.dense_rank.deref.element.exp.extract.first_value.floor.json_array.json_arrayagg.json_exists.json_object.json_objectagg.json_query.json_table.json_table_primitive.json_value.lag.last_value.lead.listagg.ln.log.log10.lower.max.min.mod.nth_value.ntile.nullif.percent_rank.percentile_cont.percentile_disc.position.position_regex.power.rank.regr_avgx.regr_avgy.regr_count.regr_intercept.regr_r2.regr_slope.regr_sxx.regr_sxy.regr_syy.row_number.sin.sinh.sqrt.stddev_pop.stddev_samp.substring.substring_regex.sum.tan.tanh.translate.translate_regex.treat.trim.trim_array.unnest.upper.value_of.var_pop.var_samp.width_bucket`.split(`.`),d=[`current_catalog`,`current_date`,`current_default_transform_group`,`current_path`,`current_role`,`current_schema`,`current_transform_group_for_type`,`current_user`,`session_user`,`system_time`,`system_user`,`current_time`,`localtime`,`current_timestamp`,`localtimestamp`],f=[`create table`,`insert into`,`primary key`,`foreign key`,`not null`,`alter table`,`add constraint`,`grouping sets`,`on overflow`,`character set`,`respect nulls`,`ignore nulls`,`nulls first`,`nulls last`,`depth first`,`breadth first`],p=u,m=[...l,...c].filter(e=>!u.includes(e)),h={scope:`variable`,match:/@[a-z0-9][a-z0-9_]*/},g={scope:`operator`,match:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0},_={match:t.concat(/\b/,t.either(...p),/\s*\(/),relevance:0,keywords:{built_in:p}};function v(e){return t.concat(/\b/,t.either(...e.map(e=>e.replace(/\s+/,`\\s+`))),/\b/)}let y={scope:`keyword`,match:v(f),relevance:0};function b(e,{exceptions:t,when:n}={}){let r=n;return t||=[],e.map(e=>e.match(/\|\d+$/)||t.includes(e)?e:r(e)?`${e}|0`:e)}return{name:`SQL`,case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:b(m,{when:e=>e.length<3}),literal:a,type:s,built_in:d},contains:[{scope:`type`,match:v(o)},y,_,h,r,i,e.C_NUMBER_MODE,e.C_BLOCK_COMMENT_MODE,n,g]}}function Hu(e){return e?typeof e==`string`?e:e.source:null}function Uu(e){return Q(`(?=`,e,`)`)}function Q(...e){return e.map(e=>Hu(e)).join(``)}function Wu(e){let t=e[e.length-1];return typeof t==`object`&&t.constructor===Object?(e.splice(e.length-1,1),t):{}}function $(...e){return`(`+(Wu(e).capture?``:`?:`)+e.map(e=>Hu(e)).join(`|`)+`)`}var Gu=e=>Q(/\b/,e,/\w$/.test(e)?/\b/:/\B/),Ku=[`Protocol`,`Type`].map(Gu),qu=[`init`,`self`].map(Gu),Ju=[`Any`,`Self`],Yu=[`actor`,`any`,`associatedtype`,`async`,`await`,/as\?/,/as!/,`as`,`borrowing`,`break`,`case`,`catch`,`class`,`consume`,`consuming`,`continue`,`convenience`,`copy`,`default`,`defer`,`deinit`,`didSet`,`distributed`,`do`,`dynamic`,`each`,`else`,`enum`,`extension`,`fallthrough`,/fileprivate\(set\)/,`fileprivate`,`final`,`for`,`func`,`get`,`guard`,`if`,`import`,`indirect`,`infix`,/init\?/,/init!/,`inout`,/internal\(set\)/,`internal`,`in`,`is`,`isolated`,`nonisolated`,`lazy`,`let`,`macro`,`mutating`,`nonmutating`,/open\(set\)/,`open`,`operator`,`optional`,`override`,`package`,`postfix`,`precedencegroup`,`prefix`,/private\(set\)/,`private`,`protocol`,/public\(set\)/,`public`,`repeat`,`required`,`rethrows`,`return`,`set`,`some`,`static`,`struct`,`subscript`,`super`,`switch`,`throws`,`throw`,/try\?/,/try!/,`try`,`typealias`,/unowned\(safe\)/,/unowned\(unsafe\)/,`unowned`,`var`,`weak`,`where`,`while`,`willSet`],Xu=[`false`,`nil`,`true`],Zu=[`assignment`,`associativity`,`higherThan`,`left`,`lowerThan`,`none`,`right`],Qu=[`#colorLiteral`,`#column`,`#dsohandle`,`#else`,`#elseif`,`#endif`,`#error`,`#file`,`#fileID`,`#fileLiteral`,`#filePath`,`#function`,`#if`,`#imageLiteral`,`#keyPath`,`#line`,`#selector`,`#sourceLocation`,`#warning`],$u=`abs.all.any.assert.assertionFailure.debugPrint.dump.fatalError.getVaList.isKnownUniquelyReferenced.max.min.numericCast.pointwiseMax.pointwiseMin.precondition.preconditionFailure.print.readLine.repeatElement.sequence.stride.swap.swift_unboxFromSwiftValueWithType.transcode.type.unsafeBitCast.unsafeDowncast.withExtendedLifetime.withUnsafeMutablePointer.withUnsafePointer.withVaList.withoutActuallyEscaping.zip`.split(`.`),ed=$(/[/=\-+!*%<>&|^~?]/,/[\u00A1-\u00A7]/,/[\u00A9\u00AB]/,/[\u00AC\u00AE]/,/[\u00B0\u00B1]/,/[\u00B6\u00BB\u00BF\u00D7\u00F7]/,/[\u2016-\u2017]/,/[\u2020-\u2027]/,/[\u2030-\u203E]/,/[\u2041-\u2053]/,/[\u2055-\u205E]/,/[\u2190-\u23FF]/,/[\u2500-\u2775]/,/[\u2794-\u2BFF]/,/[\u2E00-\u2E7F]/,/[\u3001-\u3003]/,/[\u3008-\u3020]/,/[\u3030]/),td=$(ed,/[\u0300-\u036F]/,/[\u1DC0-\u1DFF]/,/[\u20D0-\u20FF]/,/[\uFE00-\uFE0F]/,/[\uFE20-\uFE2F]/),nd=Q(ed,td,`*`),rd=$(/[a-zA-Z_]/,/[\u00A8\u00AA\u00AD\u00AF\u00B2-\u00B5\u00B7-\u00BA]/,/[\u00BC-\u00BE\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF]/,/[\u0100-\u02FF\u0370-\u167F\u1681-\u180D\u180F-\u1DBF]/,/[\u1E00-\u1FFF]/,/[\u200B-\u200D\u202A-\u202E\u203F-\u2040\u2054\u2060-\u206F]/,/[\u2070-\u20CF\u2100-\u218F\u2460-\u24FF\u2776-\u2793]/,/[\u2C00-\u2DFF\u2E80-\u2FFF]/,/[\u3004-\u3007\u3021-\u302F\u3031-\u303F\u3040-\uD7FF]/,/[\uF900-\uFD3D\uFD40-\uFDCF\uFDF0-\uFE1F\uFE30-\uFE44]/,/[\uFE47-\uFEFE\uFF00-\uFFFD]/),id=$(rd,/\d/,/[\u0300-\u036F\u1DC0-\u1DFF\u20D0-\u20FF\uFE20-\uFE2F]/),ad=Q(rd,id,`*`),od=Q(/[A-Z]/,id,`*`),sd=[`attached`,`autoclosure`,Q(/convention\(/,$(`swift`,`block`,`c`),/\)/),`discardableResult`,`dynamicCallable`,`dynamicMemberLookup`,`escaping`,`freestanding`,`frozen`,`GKInspectable`,`IBAction`,`IBDesignable`,`IBInspectable`,`IBOutlet`,`IBSegueAction`,`inlinable`,`main`,`nonobjc`,`NSApplicationMain`,`NSCopying`,`NSManaged`,Q(/objc\(/,ad,/\)/),`objc`,`objcMembers`,`propertyWrapper`,`requires_stored_property_inits`,`resultBuilder`,`Sendable`,`testable`,`UIApplicationMain`,`unchecked`,`unknown`,`usableFromInline`,`warn_unqualified_access`],cd=[`iOS`,`iOSApplicationExtension`,`macOS`,`macOSApplicationExtension`,`macCatalyst`,`macCatalystApplicationExtension`,`watchOS`,`watchOSApplicationExtension`,`tvOS`,`tvOSApplicationExtension`,`swift`];function ld(e){let t={match:/\s+/,relevance:0},n=e.COMMENT(`/\\*`,`\\*/`,{contains:[`self`]}),r=[e.C_LINE_COMMENT_MODE,n],i={match:[/\./,$(...Ku,...qu)],className:{2:`keyword`}},a={match:Q(/\./,$(...Yu)),relevance:0},o=Yu.filter(e=>typeof e==`string`).concat([`_|0`]),s={variants:[{className:`keyword`,match:$(...Yu.filter(e=>typeof e!=`string`).concat(Ju).map(Gu),...qu)}]},c={$pattern:$(/\b\w+/,/#\w+/),keyword:o.concat(Qu),literal:Xu},l=[i,a,s],u=[{match:Q(/\./,$(...$u)),relevance:0},{className:`built_in`,match:Q(/\b/,$(...$u),/(?=\()/)}],d={match:/->/,relevance:0},f=[d,{className:`operator`,relevance:0,variants:[{match:nd},{match:`\\.(\\.|${td})+`}]}],p=`([0-9]_*)+`,m=`([0-9a-fA-F]_*)+`,h={className:`number`,relevance:0,variants:[{match:`\\b(${p})(\\.(${p}))?([eE][+-]?(${p}))?\\b`},{match:`\\b0x(${m})(\\.(${m}))?([pP][+-]?(${p}))?\\b`},{match:/\b0o([0-7]_*)+\b/},{match:/\b0b([01]_*)+\b/}]},g=(e=``)=>({className:`subst`,variants:[{match:Q(/\\/,e,/[0\\tnr"']/)},{match:Q(/\\/,e,/u\{[0-9a-fA-F]{1,8}\}/)}]}),_=(e=``)=>({className:`subst`,match:Q(/\\/,e,/[\t ]*(?:[\r\n]|\r\n)/)}),v=(e=``)=>({className:`subst`,label:`interpol`,begin:Q(/\\/,e,/\(/),end:/\)/}),y=(e=``)=>({begin:Q(e,/"""/),end:Q(/"""/,e),contains:[g(e),_(e),v(e)]}),b=(e=``)=>({begin:Q(e,/"/),end:Q(/"/,e),contains:[g(e),v(e)]}),x={className:`string`,variants:[y(),y(`#`),y(`##`),y(`###`),b(),b(`#`),b(`##`),b(`###`)]},S=[e.BACKSLASH_ESCAPE,{begin:/\[/,end:/\]/,relevance:0,contains:[e.BACKSLASH_ESCAPE]}],C={begin:/\/[^\s](?=[^/\n]*\/)/,end:/\//,contains:S},w=e=>{let t=Q(e,/\//),n=Q(/\//,e);return{begin:t,end:n,contains:[...S,{scope:`comment`,begin:`#(?!.*${n})`,end:/$/}]}},T={scope:`regexp`,variants:[w(`###`),w(`##`),w(`#`),C]},E={match:Q(/`/,ad,/`/)},D=[E,{className:`variable`,match:/\$\d+/},{className:`variable`,match:`\\$${id}+`}],O=[{match:/(@|#(un)?)available/,scope:`keyword`,starts:{contains:[{begin:/\(/,end:/\)/,keywords:cd,contains:[...f,h,x]}]}},{scope:`keyword`,match:Q(/@/,$(...sd),Uu($(/\(/,/\s+/)))},{scope:`meta`,match:Q(/@/,ad)}],k={match:Uu(/\b[A-Z]/),relevance:0,contains:[{className:`type`,match:Q(/(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)/,id,`+`)},{className:`type`,match:od,relevance:0},{match:/[?!]+/,relevance:0},{match:/\.\.\./,relevance:0},{match:Q(/\s+&\s+/,Uu(od)),relevance:0}]},A={begin://,keywords:c,contains:[...r,...l,...O,d,k]};k.contains.push(A);let j={begin:/\(/,end:/\)/,relevance:0,keywords:c,contains:[`self`,{match:Q(ad,/\s*:/),keywords:`_|0`,relevance:0},...r,T,...l,...u,...f,h,x,...D,...O,k]},M={begin://,keywords:`repeat each`,contains:[...r,k]},N={begin:/\(/,end:/\)/,keywords:c,contains:[{begin:$(Uu(Q(ad,/\s*:/)),Uu(Q(ad,/\s+/,ad,/\s*:/))),end:/:/,relevance:0,contains:[{className:`keyword`,match:/\b_\b/},{className:`params`,match:ad}]},...r,...l,...f,h,x,...O,k,j],endsParent:!0,illegal:/["']/},P={match:[/(func|macro)/,/\s+/,$(E.match,ad,nd)],className:{1:`keyword`,3:`title.function`},contains:[M,N,t],illegal:[/\[/,/%/]},F={match:[/\b(?:subscript|init[?!]?)/,/\s*(?=[<(])/],className:{1:`keyword`},contains:[M,N,t],illegal:/\[|%/},I={match:[/operator/,/\s+/,nd],className:{1:`keyword`,3:`title`}},L={begin:[/precedencegroup/,/\s+/,od],className:{1:`keyword`,3:`title`},contains:[k],keywords:[...Zu,...Xu],end:/}/},R={match:[/class\b/,/\s+/,/func\b/,/\s+/,/\b[A-Za-z_][A-Za-z0-9_]*\b/],scope:{1:`keyword`,3:`keyword`,5:`title.function`}},ee={match:[/class\b/,/\s+/,/var\b/],scope:{1:`keyword`,3:`keyword`}},te={begin:[/(struct|protocol|class|extension|enum|actor)/,/\s+/,ad,/\s*/],beginScope:{1:`keyword`,3:`title.class`},keywords:c,contains:[M,...l,{begin:/:/,end:/\{/,keywords:c,contains:[{scope:`title.class.inherited`,match:od},...l],relevance:0}]};for(let e of x.variants){let t=e.contains.find(e=>e.label===`interpol`);t.keywords=c;let n=[...l,...u,...f,h,x,...D];t.contains=[...n,{begin:/\(/,end:/\)/,contains:[`self`,...n]}]}return{name:`Swift`,keywords:c,contains:[...r,P,F,R,ee,te,I,L,{beginKeywords:`import`,end:/$/,contains:[...r],relevance:0},T,...l,...u,...f,h,x,...D,...O,k,j]}}var ud=`[A-Za-z$_][0-9A-Za-z$_]*`,dd=`as.in.of.if.for.while.finally.var.new.function.do.return.void.else.break.catch.instanceof.with.throw.case.default.try.switch.continue.typeof.delete.let.yield.const.class.debugger.async.await.static.import.from.export.extends.using`.split(`.`),fd=[`true`,`false`,`null`,`undefined`,`NaN`,`Infinity`],pd=`Object.Function.Boolean.Symbol.Math.Date.Number.BigInt.String.RegExp.Array.Float32Array.Float64Array.Int8Array.Uint8Array.Uint8ClampedArray.Int16Array.Int32Array.Uint16Array.Uint32Array.BigInt64Array.BigUint64Array.Set.Map.WeakSet.WeakMap.ArrayBuffer.SharedArrayBuffer.Atomics.DataView.JSON.Promise.Generator.GeneratorFunction.AsyncFunction.Reflect.Proxy.Intl.WebAssembly`.split(`.`),md=[`Error`,`EvalError`,`InternalError`,`RangeError`,`ReferenceError`,`SyntaxError`,`TypeError`,`URIError`],hd=[`setInterval`,`setTimeout`,`clearInterval`,`clearTimeout`,`require`,`exports`,`eval`,`isFinite`,`isNaN`,`parseFloat`,`parseInt`,`decodeURI`,`decodeURIComponent`,`encodeURI`,`encodeURIComponent`,`escape`,`unescape`],gd=[`arguments`,`this`,`super`,`console`,`window`,`document`,`localStorage`,`sessionStorage`,`module`,`global`],_d=[].concat(hd,pd,md);function vd(e){let t=e.regex,n=(e,{after:t})=>{let n=``,end:``},a=/<[A-Za-z0-9\\._:-]+\s*\/>/,o={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(e,t)=>{let r=e[0].length+e.index,i=e.input[r];if(i===`<`||i===`,`){t.ignoreMatch();return}i===`>`&&(n(e,{after:r})||t.ignoreMatch());let a,o=e.input.substring(r);if(a=o.match(/^\s*=/)){t.ignoreMatch();return}if((a=o.match(/^\s+extends\s+/))&&a.index===0){t.ignoreMatch();return}}},s={$pattern:ud,keyword:dd,literal:fd,built_in:_d,"variable.language":gd},c=`[0-9](_?[0-9])*`,l=`\\.(${c})`,u=`0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*`,d={className:`number`,variants:[{begin:`(\\b(${u})((${l})|\\.)?|(${l}))[eE][+-]?(${c})\\b`},{begin:`\\b(${u})\\b((${l})\\b|\\.)?|(${l})\\b`},{begin:`\\b(0|[1-9](_?[0-9])*)n\\b`},{begin:`\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b`},{begin:`\\b0[bB][0-1](_?[0-1])*n?\\b`},{begin:`\\b0[oO][0-7](_?[0-7])*n?\\b`},{begin:`\\b0[0-7]+n?\\b`}],relevance:0},f={className:`subst`,begin:`\\$\\{`,end:`\\}`,keywords:s,contains:[]},p={begin:".?html`",end:``,starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,f],subLanguage:`xml`}},m={begin:".?css`",end:``,starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,f],subLanguage:`css`}},h={begin:".?gql`",end:``,starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,f],subLanguage:`graphql`}},g={className:`string`,begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,f]},_={className:`comment`,variants:[e.COMMENT(/\/\*\*(?!\/)/,`\\*/`,{relevance:0,contains:[{begin:`(?=@[A-Za-z]+)`,relevance:0,contains:[{className:`doctag`,begin:`@[A-Za-z]+`},{className:`type`,begin:`\\{`,end:`\\}`,excludeEnd:!0,excludeBegin:!0,relevance:0},{className:`variable`,begin:`[A-Za-z$_][0-9A-Za-z$_]*(?=\\s*(-)|$)`,endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},v=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,m,h,g,{match:/\$\d+/},d];f.contains=v.concat({begin:/\{/,end:/\}/,keywords:s,contains:[`self`].concat(v)});let y=[].concat(_,f.contains),b=y.concat([{begin:/(\s*)\(/,end:/\)/,keywords:s,contains:[`self`].concat(y)}]),x={className:`params`,begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:s,contains:b},S={variants:[{match:[/class/,/\s+/,r,/\s+/,/extends/,/\s+/,t.concat(r,`(`,t.concat(/\./,r),`)*`)],scope:{1:`keyword`,3:`title.class`,5:`keyword`,7:`title.class.inherited`}},{match:[/class/,/\s+/,r],scope:{1:`keyword`,3:`title.class`}}]},C={relevance:0,match:t.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:`title.class`,keywords:{_:[...pd,...md]}},w={label:`use_strict`,className:`meta`,relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},T={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:`keyword`,3:`title.function`},label:`func.def`,contains:[x],illegal:/%/},E={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:`variable.constant`};function D(e){return t.concat(`(?!`,e.join(`|`),`)`)}let O={match:t.concat(/\b/,D([...hd,`super`,`import`].map(e=>`${e}\\s*\\(`)),r,t.lookahead(/\s*\(/)),className:`title.function`,relevance:0},k={begin:t.concat(/\./,t.lookahead(t.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:`prototype`,className:`property`,relevance:0},A={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:`keyword`,3:`title.function`},contains:[{begin:/\(\)/},x]},j=`(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|`+e.UNDERSCORE_IDENT_RE+`)\\s*=>`,M={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(j)],keywords:`async`,className:{1:`keyword`,3:`title.function`},contains:[x]};return{name:`JavaScript`,aliases:[`js`,`jsx`,`mjs`,`cjs`],keywords:s,exports:{PARAMS_CONTAINS:b,CLASS_REFERENCE:C},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:`shebang`,binary:`node`,relevance:5}),w,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,m,h,g,_,{match:/\$\d+/},d,C,{scope:`attr`,match:r+t.lookahead(`:`),relevance:0},M,{begin:`(`+e.RE_STARTERS_RE+`|\\b(case|return|throw)\\b)\\s*`,keywords:`return throw case`,relevance:0,contains:[_,e.REGEXP_MODE,{className:`function`,begin:j,returnBegin:!0,end:`\\s*=>`,contains:[{className:`params`,variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:s,contains:b}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:i.begin,end:i.end},{match:a},{begin:o.begin,"on:begin":o.isTrulyOpeningTag,end:o.end}],subLanguage:`xml`,contains:[{begin:o.begin,end:o.end,skip:!0,contains:[`self`]}]}]},T,{beginKeywords:`while if switch catch for`},{begin:`\\b(?!function)`+e.UNDERSCORE_IDENT_RE+`\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{`,returnBegin:!0,label:`func.def`,contains:[x,e.inherit(e.TITLE_MODE,{begin:r,className:`title.function`})]},{match:/\.\.\./,relevance:0},k,{match:`\\$[A-Za-z$_][0-9A-Za-z$_]*`,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:`title.function`},contains:[x]},O,E,S,A,{match:/\$[(.]/}]}}function yd(e){let t=e.regex,n=vd(e),r=ud,i=[`any`,`void`,`number`,`boolean`,`string`,`object`,`never`,`symbol`,`bigint`,`unknown`],a={begin:[/namespace/,/\s+/,e.IDENT_RE],beginScope:{1:`keyword`,3:`title.class`}},o={beginKeywords:`interface`,end:/\{/,excludeEnd:!0,keywords:{keyword:`interface extends`,built_in:i},contains:[n.exports.CLASS_REFERENCE]},s={className:`meta`,relevance:10,begin:/^\s*['"]use strict['"]/},c={$pattern:ud,keyword:dd.concat([`type`,`interface`,`public`,`private`,`protected`,`implements`,`declare`,`abstract`,`readonly`,`enum`,`override`,`satisfies`]),literal:fd,built_in:_d.concat(i),"variable.language":gd},l={className:`meta`,begin:`@[A-Za-z$_][0-9A-Za-z$_]*`},u=(e,t,n)=>{let r=e.contains.findIndex(e=>e.label===t);if(r===-1)throw Error(`can not find mode to replace`);e.contains.splice(r,1,n)};Object.assign(n.keywords,c),n.exports.PARAMS_CONTAINS.push(l);let d=n.contains.find(e=>e.scope===`attr`),f=Object.assign({},d,{match:t.concat(r,t.lookahead(/\s*\?:/))});n.exports.PARAMS_CONTAINS.push([n.exports.CLASS_REFERENCE,d,f]),n.contains=n.contains.concat([l,a,o,f]),u(n,`shebang`,e.SHEBANG()),u(n,`use_strict`,s);let p=n.contains.find(e=>e.label===`func.def`);return p.relevance=0,Object.assign(n,{name:`TypeScript`,aliases:[`ts`,`tsx`,`mts`,`cts`]}),n}function bd(e){let t=e.regex,n={className:`string`,begin:/"(""|[^/n])"C\b/},r={className:`string`,begin:/"/,end:/"/,illegal:/\n/,contains:[{begin:/""/}]},i=/\d{1,2}\/\d{1,2}\/\d{4}/,a=/\d{4}-\d{1,2}-\d{1,2}/,o=/(\d|1[012])(:\d+){0,2} *(AM|PM)/,s=/\d{1,2}(:\d{1,2}){1,2}/,c={className:`literal`,variants:[{begin:t.concat(/# */,t.either(a,i),/ *#/)},{begin:t.concat(/# */,s,/ *#/)},{begin:t.concat(/# */,o,/ *#/)},{begin:t.concat(/# */,t.either(a,i),/ +/,t.either(o,s),/ *#/)}]},l={className:`number`,relevance:0,variants:[{begin:/\b\d[\d_]*((\.[\d_]+(E[+-]?[\d_]+)?)|(E[+-]?[\d_]+))[RFD@!#]?/},{begin:/\b\d[\d_]*((U?[SIL])|[%&])?/},{begin:/&H[\dA-F_]+((U?[SIL])|[%&])?/},{begin:/&O[0-7_]+((U?[SIL])|[%&])?/},{begin:/&B[01_]+((U?[SIL])|[%&])?/}]},u={className:`label`,begin:/^\w+:/},d=e.COMMENT(/'''/,/$/,{contains:[{className:`doctag`,begin:/<\/?/,end:/>/}]}),f=e.COMMENT(null,/$/,{variants:[{begin:/'/},{begin:/([\t ]|^)REM(?=\s)/}]});return{name:`Visual Basic .NET`,aliases:[`vb`],case_insensitive:!0,classNameAliases:{label:`symbol`},keywords:{keyword:`addhandler alias aggregate ansi as async assembly auto binary by byref byval call case catch class compare const continue custom declare default delegate dim distinct do each equals else elseif end enum erase error event exit explicit finally for friend from function get global goto group handles if implements imports in inherits interface into iterator join key let lib loop me mid module mustinherit mustoverride mybase myclass namespace narrowing new next notinheritable notoverridable of off on operator option optional order overloads overridable overrides paramarray partial preserve private property protected public raiseevent readonly redim removehandler resume return select set shadows shared skip static step stop structure strict sub synclock take text then throw to try unicode until using when where while widening with withevents writeonly yield`,built_in:`addressof and andalso await directcast gettype getxmlnamespace is isfalse isnot istrue like mod nameof new not or orelse trycast typeof xor cbool cbyte cchar cdate cdbl cdec cint clng cobj csbyte cshort csng cstr cuint culng cushort`,type:`boolean byte char date decimal double integer long object sbyte short single string uinteger ulong ushort`,literal:`true false nothing`},illegal:`//|\\{|\\}|endif|gosub|variant|wend|^\\$ `,contains:[n,r,c,l,u,d,f,{className:`meta`,begin:/[\t ]*#(const|disable|else|elseif|enable|end|externalsource|if|region)\b/,end:/$/,keywords:{keyword:`const disable else elseif enable end externalsource if region then`},contains:[f]}]}}function xd(e){e.regex;let t=e.COMMENT(/\(;/,/;\)/);return t.contains.push(`self`),{name:`WebAssembly`,keywords:{$pattern:/[\w.]+/,keyword:`anyfunc,block,br,br_if,br_table,call,call_indirect,data,drop,elem,else,end,export,func,global.get,global.set,local.get,local.set,local.tee,get_global,get_local,global,if,import,local,loop,memory,memory.grow,memory.size,module,mut,nop,offset,param,result,return,select,set_global,set_local,start,table,tee_local,then,type,unreachable`.split(`,`)},contains:[e.COMMENT(/;;/,/$/),t,{match:[/(?:offset|align)/,/\s*/,/=/],className:{1:`keyword`,3:`operator`}},{className:`variable`,begin:/\$[\w_]+/},{match:/(\((?!;)|\))+/,className:`punctuation`,relevance:0},{begin:[/(?:func|call|call_indirect)/,/\s+/,/\$[^\s)]+/],className:{1:`keyword`,3:`title.function`}},e.QUOTE_STRING_MODE,{match:/(i32|i64|f32|f64)(?!\.)/,className:`type`},{className:`keyword`,match:/\b(f32|f64|i32|i64)(?:\.(?:abs|add|and|ceil|clz|const|convert_[su]\/i(?:32|64)|copysign|ctz|demote\/f64|div(?:_[su])?|eqz?|extend_[su]\/i32|floor|ge(?:_[su])?|gt(?:_[su])?|le(?:_[su])?|load(?:(?:8|16|32)_[su])?|lt(?:_[su])?|max|min|mul|nearest|neg?|or|popcnt|promote\/f32|reinterpret\/[fi](?:32|64)|rem_[su]|rot[lr]|shl|shr_[su]|store(?:8|16|32)?|sqrt|sub|trunc(?:_[su]\/f(?:32|64))?|wrap\/i64|xor))\b/},{className:`number`,relevance:0,match:/[+-]?\b(?:\d(?:_?\d)*(?:\.\d(?:_?\d)*)?(?:[eE][+-]?\d(?:_?\d)*)?|0x[\da-fA-F](?:_?[\da-fA-F])*(?:\.[\da-fA-F](?:_?[\da-fA-D])*)?(?:[pP][+-]?\d(?:_?\d)*)?)\b|\binf\b|\bnan(?::0x[\da-fA-F](?:_?[\da-fA-D])*)?\b/}]}}function Sd(e){let t=e.regex,n=t.concat(/[\p{L}_]/u,t.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),r=/[\p{L}0-9._:-]+/u,i={className:`symbol`,begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},a={begin:/\s/,contains:[{className:`keyword`,begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},o=e.inherit(a,{begin:/\(/,end:/\)/}),s=e.inherit(e.APOS_STRING_MODE,{className:`string`}),c=e.inherit(e.QUOTE_STRING_MODE,{className:`string`}),l={endsWithParent:!0,illegal:/`]+/}]}]}]};return{name:`HTML, XML`,aliases:[`html`,`xhtml`,`rss`,`atom`,`xjb`,`xsd`,`xsl`,`plist`,`wsf`,`svg`],case_insensitive:!0,unicodeRegex:!0,contains:[{className:`meta`,begin://,relevance:10,contains:[a,c,s,o,{begin:/\[/,end:/\]/,contains:[{className:`meta`,begin://,contains:[a,o,c,s]}]}]},e.COMMENT(//,{relevance:10}),{begin://,relevance:10},i,{className:`meta`,end:/\?>/,variants:[{begin:/<\?xml/,relevance:10,contains:[c]},{begin:/<\?[a-z][a-z0-9]+/}]},{className:`tag`,begin:/)/,end:/>/,keywords:{name:`style`},contains:[l],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:[`css`,`xml`]}},{className:`tag`,begin:/)/,end:/>/,keywords:{name:`script`},contains:[l],starts:{end:/<\/script>/,returnEnd:!0,subLanguage:[`javascript`,`handlebars`,`xml`]}},{className:`tag`,begin:/<>|<\/>/},{className:`tag`,begin:t.concat(//,/>/,/\s/)))),end:/\/?>/,contains:[{className:`name`,begin:n,relevance:0,starts:l}]},{className:`tag`,begin:t.concat(/<\//,t.lookahead(t.concat(n,/>/))),contains:[{className:`name`,begin:n,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}}function Cd(e){let t=`true false yes no null`,n={className:`attr`,variants:[{begin:/[\w*@][\w*@ :()\./-]*:(?=[ \t]|$)/},{begin:/"[\w*@][\w*@ :()\./-]*":(?=[ \t]|$)/},{begin:/'[\w*@][\w*@ :()\./-]*':(?=[ \t]|$)/}]},r={className:`template-variable`,variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]},i={className:`string`,relevance:0,begin:/'/,end:/'/,contains:[{match:/''/,scope:`char.escape`,relevance:0}]},a={className:`string`,relevance:0,variants:[{begin:/"/,end:/"/},{begin:/\S+/}],contains:[e.BACKSLASH_ESCAPE,r]},o=e.inherit(a,{variants:[{begin:/'/,end:/'/,contains:[{begin:/''/,relevance:0}]},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),s={className:`number`,begin:`\\b[0-9]{4}(-[0-9][0-9]){0,2}([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?(\\.[0-9]*)?([ \\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?\\b`},c={end:`,`,endsWithParent:!0,excludeEnd:!0,keywords:t,relevance:0},l={begin:/\{/,end:/\}/,contains:[c],illegal:`\\n`,relevance:0},u={begin:`\\[`,end:`\\]`,contains:[c],illegal:`\\n`,relevance:0},d=[n,{className:`meta`,begin:`^---\\s*$`,relevance:10},{className:`string`,begin:`[\\|>]([1-9]?[+-])?[ ]*\\n( +)[^ ][^\\n]*\\n(\\2[^\\n]+\\n?)*`},{begin:`<%[%=-]?`,end:`[%-]?%>`,subLanguage:`ruby`,excludeBegin:!0,excludeEnd:!0,relevance:0},{className:`type`,begin:`!\\w+![\\w#;/?:@&=+$,.~*'()[\\]]+`},{className:`type`,begin:`!<[\\w#;/?:@&=+$,.~*'()[\\]]+>`},{className:`type`,begin:`![\\w#;/?:@&=+$,.~*'()[\\]]+`},{className:`type`,begin:`!![\\w#;/?:@&=+$,.~*'()[\\]]+`},{className:`meta`,begin:`&`+e.UNDERSCORE_IDENT_RE+`$`},{className:`meta`,begin:`\\*`+e.UNDERSCORE_IDENT_RE+`$`},{className:`bullet`,begin:`-(?=[ ]|$)`,relevance:0},e.HASH_COMMENT_MODE,{beginKeywords:t,keywords:{literal:t}},s,{className:`number`,begin:e.C_NUMBER_RE+`\\b`,relevance:0},l,u,i,a],f=[...d];return f.pop(),f.push(o),c.contains=f,{name:`YAML`,case_insensitive:!0,aliases:[`yml`],contains:d}}var wd={arduino:Cl,bash:wl,c:Tl,cpp:El,csharp:Dl,css:Il,diff:Ll,go:Rl,graphql:zl,ini:Bl,java:Kl,javascript:tu,json:nu,kotlin:su,less:_u,lua:vu,makefile:yu,markdown:bu,objectivec:xu,perl:Su,php:Cu,"php-template":wu,plaintext:Tu,python:Eu,"python-repl":Du,r:Ou,ruby:ku,rust:Au,scss:zu,shell:Bu,sql:Vu,swift:ld,typescript:yd,vbnet:bd,wasm:xd,xml:Sd,yaml:Cd},Td=t(r(((e,t)=>{function n(e){return e instanceof Map?e.clear=e.delete=e.set=function(){throw Error(`map is read-only`)}:e instanceof Set&&(e.add=e.clear=e.delete=function(){throw Error(`set is read-only`)}),Object.freeze(e),Object.getOwnPropertyNames(e).forEach(t=>{let r=e[t],i=typeof r;(i===`object`||i===`function`)&&!Object.isFrozen(r)&&n(r)}),e}var r=class{constructor(e){e.data===void 0&&(e.data={}),this.data=e.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}};function i(e){return e.replace(/&/g,`&`).replace(//g,`>`).replace(/"/g,`"`).replace(/'/g,`'`)}function a(e,...t){let n=Object.create(null);for(let t in e)n[t]=e[t];return t.forEach(function(e){for(let t in e)n[t]=e[t]}),n}var o=``,s=e=>!!e.scope,c=(e,{prefix:t})=>{if(e.startsWith(`language:`))return e.replace(`language:`,`language-`);if(e.includes(`.`)){let n=e.split(`.`);return[`${t}${n.shift()}`,...n.map((e,t)=>`${e}${`_`.repeat(t+1)}`)].join(` `)}return`${t}${e}`},l=class{constructor(e,t){this.buffer=``,this.classPrefix=t.classPrefix,e.walk(this)}addText(e){this.buffer+=i(e)}openNode(e){if(!s(e))return;let t=c(e.scope,{prefix:this.classPrefix});this.span(t)}closeNode(e){s(e)&&(this.buffer+=o)}value(){return this.buffer}span(e){this.buffer+=``}},u=(e={})=>{let t={children:[]};return Object.assign(t,e),t},d=class e{constructor(){this.rootNode=u(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(e){this.top.children.push(e)}openNode(e){let t=u({scope:e});this.add(t),this.stack.push(t)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(e){return this.constructor._walk(e,this.rootNode)}static _walk(e,t){return typeof t==`string`?e.addText(t):t.children&&(e.openNode(t),t.children.forEach(t=>this._walk(e,t)),e.closeNode(t)),e}static _collapse(t){typeof t!=`string`&&t.children&&(t.children.every(e=>typeof e==`string`)?t.children=[t.children.join(``)]:t.children.forEach(t=>{e._collapse(t)}))}},f=class extends d{constructor(e){super(),this.options=e}addText(e){e!==``&&this.add(e)}startScope(e){this.openNode(e)}endScope(){this.closeNode()}__addSublanguage(e,t){let n=e.root;t&&(n.scope=`language:${t}`),this.add(n)}toHTML(){return new l(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}};function p(e){return e?typeof e==`string`?e:e.source:null}function m(e){return _(`(?=`,e,`)`)}function h(e){return _(`(?:`,e,`)*`)}function g(e){return _(`(?:`,e,`)?`)}function _(...e){return e.map(e=>p(e)).join(``)}function v(e){let t=e[e.length-1];return typeof t==`object`&&t.constructor===Object?(e.splice(e.length-1,1),t):{}}function y(...e){return`(`+(v(e).capture?``:`?:`)+e.map(e=>p(e)).join(`|`)+`)`}function b(e){return RegExp(e.toString()+`|`).exec(``).length-1}function x(e,t){let n=e&&e.exec(t);return n&&n.index===0}var S=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function C(e,{joinWith:t}){let n=0;return e.map(e=>{n+=1;let t=n,r=p(e),i=``;for(;r.length>0;){let e=S.exec(r);if(!e){i+=r;break}i+=r.substring(0,e.index),r=r.substring(e.index+e[0].length),e[0][0]===`\\`&&e[1]?i+=`\\`+String(Number(e[1])+t):(i+=e[0],e[0]===`(`&&n++)}return i}).map(e=>`(${e})`).join(t)}var w=/\b\B/,T=`[a-zA-Z]\\w*`,E=`[a-zA-Z_]\\w*`,D=`\\b\\d+(\\.\\d+)?`,O=`(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)`,k=`\\b(0b[01]+)`,A=`!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~`,j=(e={})=>{let t=/^#![ ]*\//;return e.binary&&(e.begin=_(t,/.*\b/,e.binary,/\b.*/)),a({scope:`meta`,begin:t,end:/$/,relevance:0,"on:begin":(e,t)=>{e.index!==0&&t.ignoreMatch()}},e)},M={begin:`\\\\[\\s\\S]`,relevance:0},N={scope:`string`,begin:`'`,end:`'`,illegal:`\\n`,contains:[M]},P={scope:`string`,begin:`"`,end:`"`,illegal:`\\n`,contains:[M]},F={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},I=function(e,t,n={}){let r=a({scope:`comment`,begin:e,end:t,contains:[]},n);r.contains.push({scope:`doctag`,begin:`[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)`,end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});let i=y(`I`,`a`,`is`,`so`,`us`,`to`,`at`,`if`,`in`,`it`,`on`,/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return r.contains.push({begin:_(/[ ]+/,`(`,i,/[.]?[:]?([.][ ]|[ ])/,`){3}`)}),r},L=I(`//`,`$`),R=I(`/\\*`,`\\*/`),ee=I(`#`,`$`),te=Object.freeze({__proto__:null,APOS_STRING_MODE:N,BACKSLASH_ESCAPE:M,BINARY_NUMBER_MODE:{scope:`number`,begin:k,relevance:0},BINARY_NUMBER_RE:k,COMMENT:I,C_BLOCK_COMMENT_MODE:R,C_LINE_COMMENT_MODE:L,C_NUMBER_MODE:{scope:`number`,begin:O,relevance:0},C_NUMBER_RE:O,END_SAME_AS_BEGIN:function(e){return Object.assign(e,{"on:begin":(e,t)=>{t.data._beginMatch=e[1]},"on:end":(e,t)=>{t.data._beginMatch!==e[1]&&t.ignoreMatch()}})},HASH_COMMENT_MODE:ee,IDENT_RE:T,MATCH_NOTHING_RE:w,METHOD_GUARD:{begin:`\\.\\s*[a-zA-Z_]\\w*`,relevance:0},NUMBER_MODE:{scope:`number`,begin:D,relevance:0},NUMBER_RE:D,PHRASAL_WORDS_MODE:F,QUOTE_STRING_MODE:P,REGEXP_MODE:{scope:`regexp`,begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[M,{begin:/\[/,end:/\]/,relevance:0,contains:[M]}]},RE_STARTERS_RE:A,SHEBANG:j,TITLE_MODE:{scope:`title`,begin:T,relevance:0},UNDERSCORE_IDENT_RE:E,UNDERSCORE_TITLE_MODE:{scope:`title`,begin:E,relevance:0}});function ne(e,t){e.input[e.index-1]===`.`&&t.ignoreMatch()}function re(e,t){e.className!==void 0&&(e.scope=e.className,delete e.className)}function ie(e,t){t&&e.beginKeywords&&(e.begin=`\\b(`+e.beginKeywords.split(` `).join(`|`)+`)(?!\\.)(?=\\b|\\s)`,e.__beforeBegin=ne,e.keywords=e.keywords||e.beginKeywords,delete e.beginKeywords,e.relevance===void 0&&(e.relevance=0))}function ae(e,t){Array.isArray(e.illegal)&&(e.illegal=y(...e.illegal))}function oe(e,t){if(e.match){if(e.begin||e.end)throw Error(`begin & end are not supported with match`);e.begin=e.match,delete e.match}}function se(e,t){e.relevance===void 0&&(e.relevance=1)}var ce=(e,t)=>{if(!e.beforeMatch)return;if(e.starts)throw Error(`beforeMatch cannot be used with starts`);let n=Object.assign({},e);Object.keys(e).forEach(t=>{delete e[t]}),e.keywords=n.keywords,e.begin=_(n.beforeMatch,m(n.begin)),e.starts={relevance:0,contains:[Object.assign(n,{endsParent:!0})]},e.relevance=0,delete n.beforeMatch},le=[`of`,`and`,`for`,`in`,`not`,`or`,`if`,`then`,`parent`,`list`,`value`],ue=`keyword`;function de(e,t,n=ue){let r=Object.create(null);return typeof e==`string`?i(n,e.split(` `)):Array.isArray(e)?i(n,e):Object.keys(e).forEach(function(n){Object.assign(r,de(e[n],t,n))}),r;function i(e,n){t&&(n=n.map(e=>e.toLowerCase())),n.forEach(function(t){let n=t.split(`|`);r[n[0]]=[e,fe(n[0],n[1])]})}}function fe(e,t){return t?Number(t):+!pe(e)}function pe(e){return le.includes(e.toLowerCase())}var me={},z=e=>{console.error(e)},he=(e,...t)=>{console.log(`WARN: ${e}`,...t)},ge=(e,t)=>{me[`${e}/${t}`]||(console.log(`Deprecated as of ${e}. ${t}`),me[`${e}/${t}`]=!0)},_e=Error();function ve(e,t,{key:n}){let r=0,i=e[n],a={},o={};for(let e=1;e<=t.length;e++)o[e+r]=i[e],a[e+r]=!0,r+=b(t[e-1]);e[n]=o,e[n]._emit=a,e[n]._multi=!0}function ye(e){if(Array.isArray(e.begin)){if(e.skip||e.excludeBegin||e.returnBegin)throw z(`skip, excludeBegin, returnBegin not compatible with beginScope: {}`),_e;if(typeof e.beginScope!=`object`||e.beginScope===null)throw z(`beginScope must be object`),_e;ve(e,e.begin,{key:`beginScope`}),e.begin=C(e.begin,{joinWith:``})}}function be(e){if(Array.isArray(e.end)){if(e.skip||e.excludeEnd||e.returnEnd)throw z(`skip, excludeEnd, returnEnd not compatible with endScope: {}`),_e;if(typeof e.endScope!=`object`||e.endScope===null)throw z(`endScope must be object`),_e;ve(e,e.end,{key:`endScope`}),e.end=C(e.end,{joinWith:``})}}function B(e){e.scope&&typeof e.scope==`object`&&e.scope!==null&&(e.beginScope=e.scope,delete e.scope)}function xe(e){B(e),typeof e.beginScope==`string`&&(e.beginScope={_wrap:e.beginScope}),typeof e.endScope==`string`&&(e.endScope={_wrap:e.endScope}),ye(e),be(e)}function Se(e){function t(t,n){return new RegExp(p(t),`m`+(e.case_insensitive?`i`:``)+(e.unicodeRegex?`u`:``)+(n?`g`:``))}class n{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(e,t){t.position=this.position++,this.matchIndexes[this.matchAt]=t,this.regexes.push([t,e]),this.matchAt+=b(e)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);let e=this.regexes.map(e=>e[1]);this.matcherRe=t(C(e,{joinWith:`|`}),!0),this.lastIndex=0}exec(e){this.matcherRe.lastIndex=this.lastIndex;let t=this.matcherRe.exec(e);if(!t)return null;let n=t.findIndex((e,t)=>t>0&&e!==void 0),r=this.matchIndexes[n];return t.splice(0,n),Object.assign(t,r)}}class r{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(e){if(this.multiRegexes[e])return this.multiRegexes[e];let t=new n;return this.rules.slice(e).forEach(([e,n])=>t.addRule(e,n)),t.compile(),this.multiRegexes[e]=t,t}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(e,t){this.rules.push([e,t]),t.type===`begin`&&this.count++}exec(e){let t=this.getMatcher(this.regexIndex);t.lastIndex=this.lastIndex;let n=t.exec(e);if(this.resumingScanAtSamePosition()&&!(n&&n.index===this.lastIndex)){let t=this.getMatcher(0);t.lastIndex=this.lastIndex+1,n=t.exec(e)}return n&&(this.regexIndex+=n.position+1,this.regexIndex===this.count&&this.considerAll()),n}}function i(e){let t=new r;return e.contains.forEach(e=>t.addRule(e.begin,{rule:e,type:`begin`})),e.terminatorEnd&&t.addRule(e.terminatorEnd,{type:`end`}),e.illegal&&t.addRule(e.illegal,{type:`illegal`}),t}function o(n,r){let a=n;if(n.isCompiled)return a;[re,oe,xe,ce].forEach(e=>e(n,r)),e.compilerExtensions.forEach(e=>e(n,r)),n.__beforeBegin=null,[ie,ae,se].forEach(e=>e(n,r)),n.isCompiled=!0;let s=null;return typeof n.keywords==`object`&&n.keywords.$pattern&&(n.keywords=Object.assign({},n.keywords),s=n.keywords.$pattern,delete n.keywords.$pattern),s||=/\w+/,n.keywords&&=de(n.keywords,e.case_insensitive),a.keywordPatternRe=t(s,!0),r&&(n.begin||=/\B|\b/,a.beginRe=t(a.begin),!n.end&&!n.endsWithParent&&(n.end=/\B|\b/),n.end&&(a.endRe=t(a.end)),a.terminatorEnd=p(a.end)||``,n.endsWithParent&&r.terminatorEnd&&(a.terminatorEnd+=(n.end?`|`:``)+r.terminatorEnd)),n.illegal&&(a.illegalRe=t(n.illegal)),n.contains||=[],n.contains=[].concat(...n.contains.map(function(e){return we(e===`self`?n:e)})),n.contains.forEach(function(e){o(e,a)}),n.starts&&o(n.starts,r),a.matcher=i(a),a}if(e.compilerExtensions||=[],e.contains&&e.contains.includes(`self`))throw Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return e.classNameAliases=a(e.classNameAliases||{}),o(e)}function Ce(e){return e?e.endsWithParent||Ce(e.starts):!1}function we(e){return e.variants&&!e.cachedVariants&&(e.cachedVariants=e.variants.map(function(t){return a(e,{variants:null},t)})),e.cachedVariants?e.cachedVariants:Ce(e)?a(e,{starts:e.starts?a(e.starts):null}):Object.isFrozen(e)?a(e):e}var Te=`11.11.1`,Ee=class extends Error{constructor(e,t){super(e),this.name=`HTMLInjectionError`,this.html=t}},De=i,Oe=a,ke=Symbol(`nomatch`),Ae=7,je=function(e){let t=Object.create(null),i=Object.create(null),a=[],o=!0,s=`Could not find the language '{}', did you forget to load/include a language module?`,c={disableAutodetect:!0,name:`Plain text`,contains:[]},l={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:`hljs-`,cssSelector:`pre code`,languages:null,__emitter:f};function u(e){return l.noHighlightRe.test(e)}function d(e){let t=e.className+` `;t+=e.parentNode?e.parentNode.className:``;let n=l.languageDetectRe.exec(t);if(n){let t=N(n[1]);return t||(he(s.replace(`{}`,n[1])),he(`Falling back to no-highlight mode for this block.`,e)),t?n[1]:`no-highlight`}return t.split(/\s+/).find(e=>u(e)||N(e))}function p(e,t,n){let r=``,i=``;typeof t==`object`?(r=e,n=t.ignoreIllegals,i=t.language):(ge(`10.7.0`,`highlight(lang, code, ...args) has been deprecated.`),ge(`10.7.0`,`Please use highlight(code, options) instead. +https://github.com/highlightjs/highlight.js/issues/2277`),i=e,r=t),n===void 0&&(n=!0);let a={code:r,language:i};ee(`before:highlight`,a);let o=a.result?a.result:v(a.language,a.code,n);return o.code=a.code,ee(`after:highlight`,o),o}function v(e,n,i,a){let c=Object.create(null);function u(e,t){return e.keywords[t]}function d(){if(!A.keywords){M.addText(P);return}let e=0;A.keywordPatternRe.lastIndex=0;let t=A.keywordPatternRe.exec(P),n=``;for(;t;){n+=P.substring(e,t.index);let r=D.case_insensitive?t[0].toLowerCase():t[0],i=u(A,r);if(i){let[e,a]=i;if(M.addText(n),n=``,c[r]=(c[r]||0)+1,c[r]<=Ae&&(F+=a),e.startsWith(`_`))n+=t[0];else{let n=D.classNameAliases[e]||e;m(t[0],n)}}else n+=t[0];e=A.keywordPatternRe.lastIndex,t=A.keywordPatternRe.exec(P)}n+=P.substring(e),M.addText(n)}function f(){if(P===``)return;let e=null;if(typeof A.subLanguage==`string`){if(!t[A.subLanguage]){M.addText(P);return}e=v(A.subLanguage,P,!0,j[A.subLanguage]),j[A.subLanguage]=e._top}else e=S(P,A.subLanguage.length?A.subLanguage:null);A.relevance>0&&(F+=e.relevance),M.__addSublanguage(e._emitter,e.language)}function p(){A.subLanguage==null?d():f(),P=``}function m(e,t){e!==``&&(M.startScope(t),M.addText(e),M.endScope())}function h(e,t){let n=1,r=t.length-1;for(;n<=r;){if(!e._emit[n]){n++;continue}let r=D.classNameAliases[e[n]]||e[n],i=t[n];r?m(i,r):(P=i,d(),P=``),n++}}function g(e,t){return e.scope&&typeof e.scope==`string`&&M.openNode(D.classNameAliases[e.scope]||e.scope),e.beginScope&&(e.beginScope._wrap?(m(P,D.classNameAliases[e.beginScope._wrap]||e.beginScope._wrap),P=``):e.beginScope._multi&&(h(e.beginScope,t),P=``)),A=Object.create(e,{parent:{value:A}}),A}function _(e,t,n){let i=x(e.endRe,n);if(i){if(e[`on:end`]){let n=new r(e);e[`on:end`](t,n),n.isMatchIgnored&&(i=!1)}if(i){for(;e.endsParent&&e.parent;)e=e.parent;return e}}if(e.endsWithParent)return _(e.parent,t,n)}function y(e){return A.matcher.regexIndex===0?(P+=e[0],1):(R=!0,0)}function b(e){let t=e[0],n=e.rule,i=new r(n),a=[n.__beforeBegin,n[`on:begin`]];for(let n of a)if(n&&(n(e,i),i.isMatchIgnored))return y(t);return n.skip?P+=t:(n.excludeBegin&&(P+=t),p(),!n.returnBegin&&!n.excludeBegin&&(P=t)),g(n,e),n.returnBegin?0:t.length}function C(e){let t=e[0],r=n.substring(e.index),i=_(A,e,r);if(!i)return ke;let a=A;A.endScope&&A.endScope._wrap?(p(),m(t,A.endScope._wrap)):A.endScope&&A.endScope._multi?(p(),h(A.endScope,e)):a.skip?P+=t:(a.returnEnd||a.excludeEnd||(P+=t),p(),a.excludeEnd&&(P=t));do A.scope&&M.closeNode(),!A.skip&&!A.subLanguage&&(F+=A.relevance),A=A.parent;while(A!==i.parent);return i.starts&&g(i.starts,e),a.returnEnd?0:t.length}function w(){let e=[];for(let t=A;t!==D;t=t.parent)t.scope&&e.unshift(t.scope);e.forEach(e=>M.openNode(e))}let T={};function E(t,r){let a=r&&r[0];if(P+=t,a==null)return p(),0;if(T.type===`begin`&&r.type===`end`&&T.index===r.index&&a===``){if(P+=n.slice(r.index,r.index+1),!o){let t=Error(`0 width match regex (${e})`);throw t.languageName=e,t.badRule=T.rule,t}return 1}if(T=r,r.type===`begin`)return b(r);if(r.type===`illegal`&&!i){let e=Error(`Illegal lexeme "`+a+`" for mode "`+(A.scope||``)+`"`);throw e.mode=A,e}else if(r.type===`end`){let e=C(r);if(e!==ke)return e}if(r.type===`illegal`&&a===``)return P+=` +`,1;if(L>1e5&&L>r.index*3)throw Error(`potential infinite loop, way more iterations than matches`);return P+=a,a.length}let D=N(e);if(!D)throw z(s.replace(`{}`,e)),Error(`Unknown language: "`+e+`"`);let O=Se(D),k=``,A=a||O,j={},M=new l.__emitter(l);w();let P=``,F=0,I=0,L=0,R=!1;try{if(D.__emitTokens)D.__emitTokens(n,M);else{for(A.matcher.considerAll();;){L++,R?R=!1:A.matcher.considerAll(),A.matcher.lastIndex=I;let e=A.matcher.exec(n);if(!e)break;let t=E(n.substring(I,e.index),e);I=e.index+t}E(n.substring(I))}return M.finalize(),k=M.toHTML(),{language:e,value:k,relevance:F,illegal:!1,_emitter:M,_top:A}}catch(t){if(t.message&&t.message.includes(`Illegal`))return{language:e,value:De(n),illegal:!0,relevance:0,_illegalBy:{message:t.message,index:I,context:n.slice(I-100,I+100),mode:t.mode,resultSoFar:k},_emitter:M};if(o)return{language:e,value:De(n),illegal:!1,relevance:0,errorRaised:t,_emitter:M,_top:A};throw t}}function b(e){let t={value:De(e),illegal:!1,relevance:0,_top:c,_emitter:new l.__emitter(l)};return t._emitter.addText(e),t}function S(e,n){n=n||l.languages||Object.keys(t);let r=b(e),i=n.filter(N).filter(F).map(t=>v(t,e,!1));i.unshift(r);let[a,o]=i.sort((e,t)=>{if(e.relevance!==t.relevance)return t.relevance-e.relevance;if(e.language&&t.language){if(N(e.language).supersetOf===t.language)return 1;if(N(t.language).supersetOf===e.language)return-1}return 0}),s=a;return s.secondBest=o,s}function C(e,t,n){let r=t&&i[t]||n;e.classList.add(`hljs`),e.classList.add(`language-${r}`)}function w(e){let t=null,n=d(e);if(u(n))return;if(ee(`before:highlightElement`,{el:e,language:n}),e.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",e);return}if(e.children.length>0&&(l.ignoreUnescapedHTML||(console.warn(`One of your code blocks includes unescaped HTML. This is a potentially serious security risk.`),console.warn(`https://github.com/highlightjs/highlight.js/wiki/security`),console.warn(`The element with unescaped HTML:`),console.warn(e)),l.throwUnescapedHTML))throw new Ee(`One of your code blocks includes unescaped HTML.`,e.innerHTML);t=e;let r=t.textContent,i=n?p(r,{language:n,ignoreIllegals:!0}):S(r);e.innerHTML=i.value,e.dataset.highlighted=`yes`,C(e,n,i.language),e.result={language:i.language,re:i.relevance,relevance:i.relevance},i.secondBest&&(e.secondBest={language:i.secondBest.language,relevance:i.secondBest.relevance}),ee(`after:highlightElement`,{el:e,result:i,text:r})}function T(e){l=Oe(l,e)}let E=()=>{k(),ge(`10.6.0`,`initHighlighting() deprecated. Use highlightAll() now.`)};function D(){k(),ge(`10.6.0`,`initHighlightingOnLoad() deprecated. Use highlightAll() now.`)}let O=!1;function k(){function e(){k()}if(document.readyState===`loading`){O||window.addEventListener(`DOMContentLoaded`,e,!1),O=!0;return}document.querySelectorAll(l.cssSelector).forEach(w)}function A(n,r){let i=null;try{i=r(e)}catch(e){if(z(`Language definition for '{}' could not be registered.`.replace(`{}`,n)),o)z(e);else throw e;i=c}i.name||=n,t[n]=i,i.rawDefinition=r.bind(null,e),i.aliases&&P(i.aliases,{languageName:n})}function j(e){delete t[e];for(let t of Object.keys(i))i[t]===e&&delete i[t]}function M(){return Object.keys(t)}function N(e){return e=(e||``).toLowerCase(),t[e]||t[i[e]]}function P(e,{languageName:t}){typeof e==`string`&&(e=[e]),e.forEach(e=>{i[e.toLowerCase()]=t})}function F(e){let t=N(e);return t&&!t.disableAutodetect}function I(e){e[`before:highlightBlock`]&&!e[`before:highlightElement`]&&(e[`before:highlightElement`]=t=>{e[`before:highlightBlock`](Object.assign({block:t.el},t))}),e[`after:highlightBlock`]&&!e[`after:highlightElement`]&&(e[`after:highlightElement`]=t=>{e[`after:highlightBlock`](Object.assign({block:t.el},t))})}function L(e){I(e),a.push(e)}function R(e){let t=a.indexOf(e);t!==-1&&a.splice(t,1)}function ee(e,t){let n=e;a.forEach(function(e){e[n]&&e[n](t)})}function ne(e){return ge(`10.7.0`,`highlightBlock will be removed entirely in v12.0`),ge(`10.7.0`,`Please use highlightElement now.`),w(e)}Object.assign(e,{highlight:p,highlightAuto:S,highlightAll:k,highlightElement:w,highlightBlock:ne,configure:T,initHighlighting:E,initHighlightingOnLoad:D,registerLanguage:A,unregisterLanguage:j,listLanguages:M,getLanguage:N,registerAliases:P,autoDetection:F,inherit:Oe,addPlugin:L,removePlugin:R}),e.debugMode=function(){o=!1},e.safeMode=function(){o=!0},e.versionString=Te,e.regex={concat:_,lookahead:m,either:y,optional:g,anyNumberOfTimes:h};for(let e in te)typeof te[e]==`object`&&n(te[e]);return Object.assign(e,te),e},Me=je({});Me.newInstance=()=>je({}),t.exports=Me,Me.HighlightJS=Me,Me.default=Me}))()).default,Ed={},Dd=`hljs-`;function Od(e){let t=Td.newInstance();return e&&a(e),{highlight:n,highlightAuto:r,listLanguages:i,register:a,registerAlias:o,registered:s};function n(e,n,r){let i=r||Ed,a=typeof i.prefix==`string`?i.prefix:Dd;if(!t.getLanguage(e))throw Error("Unknown language: `"+e+"` is not registered");t.configure({__emitter:kd,classPrefix:a});let o=t.highlight(n,{ignoreIllegals:!0,language:e});if(o.errorRaised)throw Error("Could not highlight with `Highlight.js`",{cause:o.errorRaised});let s=o._emitter.root,c=s.data;return c.language=o.language,c.relevance=o.relevance,s}function r(e,r){let a=(r||Ed).subset||i(),o=-1,s=0,c;for(;++os&&(s=l.data.relevance,c=l)}return c||{type:`root`,children:[],data:{language:void 0,relevance:s}}}function i(){return t.listLanguages()}function a(e,n){if(typeof e==`string`)t.registerLanguage(e,n);else{let n;for(n in e)Object.hasOwn(e,n)&&t.registerLanguage(n,e[n])}}function o(e,n){if(typeof e==`string`)t.registerAliases(typeof n==`string`?n:[...n],{languageName:e});else{let n;for(n in e)if(Object.hasOwn(e,n)){let r=e[n];t.registerAliases(typeof r==`string`?r:[...r],{languageName:n})}}}function s(e){return!!t.getLanguage(e)}}var kd=class{constructor(e){this.options=e,this.root={type:`root`,children:[],data:{language:void 0,relevance:0}},this.stack=[this.root]}addText(e){if(e===``)return;let t=this.stack[this.stack.length-1],n=t.children[t.children.length-1];n&&n.type===`text`?n.value+=e:t.children.push({type:`text`,value:e})}startScope(e){this.openNode(String(e))}endScope(){this.closeNode()}__addSublanguage(e,t){let n=this.stack[this.stack.length-1],r=e.root.children;t?n.children.push({type:`element`,tagName:`span`,properties:{className:[t]},children:r}):n.children.push(...r)}openNode(e){let t=this,n=e.split(`.`).map(function(e,n){return n?e+`_`.repeat(n):t.options.classPrefix+e}),r=this.stack[this.stack.length-1],i={type:`element`,tagName:`span`,properties:{className:n},children:[]};r.children.push(i),this.stack.push(i)}closeNode(){this.stack.pop()}finalize(){}toHTML(){return``}},Ad={};function jd(e){let t=e||Ad,n=t.aliases,r=t.detect||!1,i=t.languages||wd,a=t.plainText,o=t.prefix,s=t.subset,c=`hljs`,l=Od(i);if(n&&l.registerAlias(n),o){let e=o.indexOf(`-`);c=e===-1?o:o.slice(0,e)}return function(e,t){qi(e,`element`,function(e,n,i){if(e.tagName!==`code`||!i||i.type!==`element`||i.tagName!==`pre`)return;let u=Md(e);if(u===!1||!u&&!r||u&&a&&a.includes(u))return;Array.isArray(e.properties.className)||(e.properties.className=[]),e.properties.className.includes(c)||e.properties.className.unshift(c);let d=fl(e,{whitespace:`pre`}),f;try{f=u?l.highlight(u,d,{prefix:o}):l.highlightAuto(d,{prefix:o,subset:s})}catch(n){let r=n;if(u&&/Unknown language/.test(r.message)){t.message("Cannot highlight as `"+u+"`, it’s not registered",{ancestors:[i,e],cause:r,place:e.position,ruleId:`missing-language`,source:`rehype-highlight`});return}throw r}!u&&f.data&&f.data.language&&e.properties.className.push(`language-`+f.data.language),f.children.length>0&&(e.children=f.children)})}}function Md(e){let t=e.properties.className,n=-1;if(!Array.isArray(t))return;let r;for(;++n(0,Ba.jsx)(`a`,{...t,target:`_blank`,rel:`noopener noreferrer`})},children:e})})}export{Nd as MarkdownView}; \ No newline at end of file diff --git a/viewer-ui/dist/assets/Markdown-Dc2pdrht.js b/viewer-ui/dist/assets/Markdown-Dc2pdrht.js deleted file mode 100644 index de222931..00000000 --- a/viewer-ui/dist/assets/Markdown-Dc2pdrht.js +++ /dev/null @@ -1,35 +0,0 @@ -import{j as vn}from"./index-Ck-wCR_a.js";function dr(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Lo(e,n){const t={};return(e[e.length-1]===""?[...e,""]:e).join((t.padRight?" ":"")+","+(t.padLeft===!1?"":" ")).trim()}const Po=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Bo=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Fo={};function Hr(e,n){return(Fo.jsx?Bo:Po).test(e)}const zo=/[ \t\n\f\r]/g;function Uo(e){return typeof e=="object"?e.type==="text"?Gr(e.value):!1:Gr(e)}function Gr(e){return e.replace(zo,"")===""}class Vn{constructor(n,t,r){this.normal=t,this.property=n,r&&(this.space=r)}}Vn.prototype.normal={};Vn.prototype.property={};Vn.prototype.space=void 0;function Gi(e,n){const t={},r={};for(const i of e)Object.assign(t,i.property),Object.assign(r,i.normal);return new Vn(t,r,n)}function Jt(e){return e.toLowerCase()}class Me{constructor(n,t){this.attribute=t,this.property=n}}Me.prototype.attribute="";Me.prototype.booleanish=!1;Me.prototype.boolean=!1;Me.prototype.commaOrSpaceSeparated=!1;Me.prototype.commaSeparated=!1;Me.prototype.defined=!1;Me.prototype.mustUseProperty=!1;Me.prototype.number=!1;Me.prototype.overloadedBoolean=!1;Me.prototype.property="";Me.prototype.spaceSeparated=!1;Me.prototype.space=void 0;let $o=0;const Y=_n(),ke=_n(),er=_n(),A=_n(),fe=_n(),bn=_n(),ze=_n();function _n(){return 2**++$o}const nr=Object.freeze(Object.defineProperty({__proto__:null,boolean:Y,booleanish:ke,commaOrSpaceSeparated:ze,commaSeparated:bn,number:A,overloadedBoolean:er,spaceSeparated:fe},Symbol.toStringTag,{value:"Module"})),Mt=Object.keys(nr);class pr extends Me{constructor(n,t,r,i){let o=-1;if(super(n,t),Kr(this,"space",i),typeof r=="number")for(;++o4&&t.slice(0,4)==="data"&&Wo.test(n)){if(n.charAt(4)==="-"){const o=n.slice(5).replace(qr,Zo);r="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=n.slice(4);if(!qr.test(o)){let a=o.replace(qo,Yo);a.charAt(0)!=="-"&&(a="-"+a),n="data"+a}}i=pr}return new i(r,n)}function Yo(e){return"-"+e.toLowerCase()}function Zo(e){return e.charAt(1).toUpperCase()}const Xo=Gi([Ki,Ho,Vi,Yi,Zi],"html"),fr=Gi([Ki,Go,Vi,Yi,Zi],"svg");function Qo(e){return e.join(" ").trim()}var Sn={},Dt,Wr;function jo(){if(Wr)return Dt;Wr=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,n=/\n/g,t=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,i=/^:\s*/,o=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,a=/^[;\s]*/,s=/^\s+|\s+$/g,c=` -`,l="/",d="*",u="",f="comment",p="declaration";function g(y,E){if(typeof y!="string")throw new TypeError("First argument must be a string");if(!y)return[];E=E||{};var N=1,x=1;function O(D){var v=D.match(n);v&&(N+=v.length);var Z=D.lastIndexOf(c);x=~Z?D.length-Z:x+D.length}function R(){var D={line:N,column:x};return function(v){return v.position=new k(D),H(),v}}function k(D){this.start=D,this.end={line:N,column:x},this.source=E.source}k.prototype.content=y;function U(D){var v=new Error(E.source+":"+N+":"+x+": "+D);if(v.reason=D,v.filename=E.source,v.line=N,v.column=x,v.source=y,!E.silent)throw v}function $(D){var v=D.exec(y);if(v){var Z=v[0];return O(Z),y=y.slice(Z.length),v}}function H(){$(t)}function w(D){var v;for(D=D||[];v=P();)v!==!1&&D.push(v);return D}function P(){var D=R();if(!(l!=y.charAt(0)||d!=y.charAt(1))){for(var v=2;u!=y.charAt(v)&&(d!=y.charAt(v)||l!=y.charAt(v+1));)++v;if(v+=2,u===y.charAt(v-1))return U("End of comment missing");var Z=y.slice(2,v-2);return x+=2,O(Z),y=y.slice(v),x+=2,D({type:f,comment:Z})}}function B(){var D=R(),v=$(r);if(v){if(P(),!$(i))return U("property missing ':'");var Z=$(o),oe=D({type:p,property:_(v[0].replace(e,u)),value:Z?_(Z[0].replace(e,u)):u});return $(a),oe}}function J(){var D=[];w(D);for(var v;v=B();)v!==!1&&(D.push(v),w(D));return D}return H(),J()}function _(y){return y?y.replace(s,u):u}return Dt=g,Dt}var Vr;function Jo(){if(Vr)return Sn;Vr=1;var e=Sn&&Sn.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Sn,"__esModule",{value:!0}),Sn.default=t;const n=e(jo());function t(r,i){let o=null;if(!r||typeof r!="string")return o;const a=(0,n.default)(r),s=typeof i=="function";return a.forEach(c=>{if(c.type!=="declaration")return;const{property:l,value:d}=c;s?i(l,d,c):d&&(o=o||{},o[l]=d)}),o}return Sn}var Bn={},Yr;function es(){if(Yr)return Bn;Yr=1,Object.defineProperty(Bn,"__esModule",{value:!0}),Bn.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,n=/-([a-z])/g,t=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,i=/^-(ms)-/,o=function(l){return!l||t.test(l)||e.test(l)},a=function(l,d){return d.toUpperCase()},s=function(l,d){return"".concat(d,"-")},c=function(l,d){return d===void 0&&(d={}),o(l)?l:(l=l.toLowerCase(),d.reactCompat?l=l.replace(i,s):l=l.replace(r,s),l.replace(n,a))};return Bn.camelCase=c,Bn}var Fn,Zr;function ns(){if(Zr)return Fn;Zr=1;var e=Fn&&Fn.__importDefault||function(i){return i&&i.__esModule?i:{default:i}},n=e(Jo()),t=es();function r(i,o){var a={};return!i||typeof i!="string"||(0,n.default)(i,function(s,c){s&&c&&(a[(0,t.camelCase)(s,o)]=c)}),a}return r.default=r,Fn=r,Fn}var ts=ns();const rs=dr(ts),Xi=Qi("end"),gr=Qi("start");function Qi(e){return n;function n(t){const r=t&&t.position&&t.position[e]||{};if(typeof r.line=="number"&&r.line>0&&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 is(e){const n=gr(e),t=Xi(e);if(n&&t)return{start:n,end:t}}function Hn(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?Xr(e.position):"start"in e||"end"in e?Xr(e):"line"in e||"column"in e?tr(e):""}function tr(e){return Qr(e&&e.line)+":"+Qr(e&&e.column)}function Xr(e){return tr(e&&e.start)+"-"+tr(e&&e.end)}function Qr(e){return e&&typeof e=="number"?e:1}class Ae extends Error{constructor(n,t,r){super(),typeof t=="string"&&(r=t,t=void 0);let i="",o={},a=!1;if(t&&("line"in t&&"column"in t?o={place:t}:"start"in t&&"end"in t?o={place:t}:"type"in t?o={ancestors:[t],place:t.position}:o={...t}),typeof n=="string"?i=n:!o.cause&&n&&(a=!0,i=n.message,o.cause=n),!o.ruleId&&!o.source&&typeof r=="string"){const c=r.indexOf(":");c===-1?o.ruleId=r:(o.source=r.slice(0,c),o.ruleId=r.slice(c+1))}if(!o.place&&o.ancestors&&o.ancestors){const c=o.ancestors[o.ancestors.length-1];c&&(o.place=c.position)}const s=o.place&&"start"in o.place?o.place.start:o.place;this.ancestors=o.ancestors||void 0,this.cause=o.cause||void 0,this.column=s?s.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=s?s.line:void 0,this.name=Hn(o.place)||"1:1",this.place=o.place||void 0,this.reason=this.message,this.ruleId=o.ruleId||void 0,this.source=o.source||void 0,this.stack=a&&o.cause&&typeof o.cause.stack=="string"?o.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}Ae.prototype.file="";Ae.prototype.name="";Ae.prototype.reason="";Ae.prototype.message="";Ae.prototype.stack="";Ae.prototype.column=void 0;Ae.prototype.line=void 0;Ae.prototype.ancestors=void 0;Ae.prototype.cause=void 0;Ae.prototype.fatal=void 0;Ae.prototype.place=void 0;Ae.prototype.ruleId=void 0;Ae.prototype.source=void 0;const mr={}.hasOwnProperty,as=new Map,os=/[A-Z]/g,ss=new Set(["table","tbody","thead","tfoot","tr"]),ls=new Set(["td","th"]),ji="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function cs(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=bs(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=hs(t,n.jsx,n.jsxs)}const i={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"?fr:Xo,stylePropertyNameCase:n.stylePropertyNameCase||"dom",tableCellAlignToStyle:n.tableCellAlignToStyle!==!1},o=Ji(i,e,void 0);return o&&typeof o!="string"?o:i.create(e,i.Fragment,{children:o||void 0},void 0)}function Ji(e,n,t){if(n.type==="element")return us(e,n,t);if(n.type==="mdxFlowExpression"||n.type==="mdxTextExpression")return ds(e,n);if(n.type==="mdxJsxFlowElement"||n.type==="mdxJsxTextElement")return fs(e,n,t);if(n.type==="mdxjsEsm")return ps(e,n);if(n.type==="root")return gs(e,n,t);if(n.type==="text")return ms(e,n)}function us(e,n,t){const r=e.schema;let i=r;n.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=fr,e.schema=i),e.ancestors.push(n);const o=na(e,n.tagName,!1),a=Es(e,n);let s=br(e,n);return ss.has(n.tagName)&&(s=s.filter(function(c){return typeof c=="string"?!Uo(c):!0})),ea(e,a,o,n),hr(a,s),e.ancestors.pop(),e.schema=r,e.create(n,o,a,t)}function ds(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)}qn(e,n.position)}function ps(e,n){if(n.data&&n.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(n.data.estree);qn(e,n.position)}function fs(e,n,t){const r=e.schema;let i=r;n.name==="svg"&&r.space==="html"&&(i=fr,e.schema=i),e.ancestors.push(n);const o=n.name===null?e.Fragment:na(e,n.name,!0),a=_s(e,n),s=br(e,n);return ea(e,a,o,n),hr(a,s),e.ancestors.pop(),e.schema=r,e.create(n,o,a,t)}function gs(e,n,t){const r={};return hr(r,br(e,n)),e.create(n,e.Fragment,r,t)}function ms(e,n){return n.value}function ea(e,n,t,r){typeof t!="string"&&t!==e.Fragment&&e.passNode&&(n.node=r)}function hr(e,n){if(n.length>0){const t=n.length>1?n:n[0];t&&(e.children=t)}}function hs(e,n,t){return r;function r(i,o,a,s){const l=Array.isArray(a.children)?t:n;return s?l(o,a,s):l(o,a)}}function bs(e,n){return t;function t(r,i,o,a){const s=Array.isArray(o.children),c=gr(r);return n(i,o,a,s,{columnNumber:c?c.column-1:void 0,fileName:e,lineNumber:c?c.line:void 0},void 0)}}function Es(e,n){const t={};let r,i;for(i in n.properties)if(i!=="children"&&mr.call(n.properties,i)){const o=ys(e,i,n.properties[i]);if(o){const[a,s]=o;e.tableCellAlignToStyle&&a==="align"&&typeof s=="string"&&ls.has(n.tagName)?r=s:t[a]=s}}if(r){const o=t.style||(t.style={});o[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return t}function _s(e,n){const t={};for(const r of n.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const o=r.data.estree.body[0];o.type;const a=o.expression;a.type;const s=a.properties[0];s.type,Object.assign(t,e.evaluater.evaluateExpression(s.argument))}else qn(e,n.position);else{const i=r.name;let o;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const s=r.value.data.estree.body[0];s.type,o=e.evaluater.evaluateExpression(s.expression)}else qn(e,n.position);else o=r.value===null?!0:r.value;t[i]=o}return t}function br(e,n){const t=[];let r=-1;const i=e.passKeys?new Map:as;for(;++ri?0:i+n:n=n>i?i: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);o0?(Ue(e,e.length,0,n),e):n}const ei={}.hasOwnProperty;function ra(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 qe(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Ie=pn(/[A-Za-z]/),Te=pn(/[\dA-Za-z]/),Cs=pn(/[#-'*+\--9=?A-Z^-~]/);function gt(e){return e!==null&&(e<32||e===127)}const rr=pn(/\d/),Os=pn(/[\dA-Fa-f]/),Is=pn(/[!-/:-@[-`{-~]/);function q(e){return e!==null&&e<-2}function ge(e){return e!==null&&(e<0||e===32)}function te(e){return e===-2||e===-1||e===32}const yt=pn(new RegExp("\\p{P}|\\p{S}","u")),En=pn(/\s/);function pn(e){return n;function n(t){return t!==null&&t>-1&&e.test(String.fromCharCode(t))}}function In(e){const n=[];let t=-1,r=0,i=0;for(;++t55295&&o<57344){const s=e.charCodeAt(t+1);o<56320&&s>56319&&s<57344?(a=String.fromCharCode(o,s),i=1):a="�"}else a=String.fromCharCode(o);a&&(n.push(e.slice(r,t),encodeURIComponent(a)),r=t+i+1,a=""),i&&(t+=i,i=0)}return n.join("")+e.slice(r)}function ie(e,n,t,r){const i=r?r-1:Number.POSITIVE_INFINITY;let o=0;return a;function a(c){return te(c)?(e.enter(t),s(c)):n(c)}function s(c){return te(c)&&o++a))return;const U=n.events.length;let $=U,H,w;for(;$--;)if(n.events[$][0]==="exit"&&n.events[$][1].type==="chunkFlow"){if(H){w=n.events[$][1].end;break}H=!0}for(E(r),k=U;kx;){const R=t[O];n.containerState=R[1],R[0].exit.call(n,e)}t.length=x}function N(){i.write([null]),o=void 0,i=void 0,n.containerState._closeFlow=void 0}}function Ps(e,n,t){return ie(e,e.attempt(this.parser.constructs.document,n,t),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Cn(e){if(e===null||ge(e)||En(e))return 1;if(yt(e))return 2}function kt(e,n,t){const r=[];let i=-1;for(;++i1&&e[t][1].end.offset-e[t][1].start.offset>1?2:1;const u={...e[r][1].end},f={...e[t][1].start};ti(u,-c),ti(f,c),a={type:c>1?"strongSequence":"emphasisSequence",start:u,end:{...e[r][1].end}},s={type:c>1?"strongSequence":"emphasisSequence",start:{...e[t][1].start},end:f},o={type:c>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[t][1].start}},i={type:c>1?"strong":"emphasis",start:{...a.start},end:{...s.end}},e[r][1].end={...a.start},e[t][1].start={...s.end},l=[],e[r][1].end.offset-e[r][1].start.offset&&(l=He(l,[["enter",e[r][1],n],["exit",e[r][1],n]])),l=He(l,[["enter",i,n],["enter",a,n],["exit",a,n],["enter",o,n]]),l=He(l,kt(n.parser.constructs.insideSpan.null,e.slice(r+1,t),n)),l=He(l,[["exit",o,n],["enter",s,n],["exit",s,n],["exit",i,n]]),e[t][1].end.offset-e[t][1].start.offset?(d=2,l=He(l,[["enter",e[t][1],n],["exit",e[t][1],n]])):d=0,Ue(e,r-1,t-r+3,l),t=r+l.length-d-2;break}}for(t=-1;++t0&&te(k)?ie(e,N,"linePrefix",o+1)(k):N(k)}function N(k){return k===null||q(k)?e.check(ri,_,O)(k):(e.enter("codeFlowValue"),x(k))}function x(k){return k===null||q(k)?(e.exit("codeFlowValue"),N(k)):(e.consume(k),x)}function O(k){return e.exit("codeFenced"),n(k)}function R(k,U,$){let H=0;return w;function w(v){return k.enter("lineEnding"),k.consume(v),k.exit("lineEnding"),P}function P(v){return k.enter("codeFencedFence"),te(v)?ie(k,B,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(v):B(v)}function B(v){return v===s?(k.enter("codeFencedFenceSequence"),J(v)):$(v)}function J(v){return v===s?(H++,k.consume(v),J):H>=a?(k.exit("codeFencedFenceSequence"),te(v)?ie(k,D,"whitespace")(v):D(v)):$(v)}function D(v){return v===null||q(v)?(k.exit("codeFencedFence"),U(v)):$(v)}}}function Ys(e,n,t){const r=this;return i;function i(a){return a===null?t(a):(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),o)}function o(a){return r.parser.lazy[r.now().line]?t(a):n(a)}}const Pt={name:"codeIndented",tokenize:Xs},Zs={partial:!0,tokenize:Qs};function Xs(e,n,t){const r=this;return i;function i(l){return e.enter("codeIndented"),ie(e,o,"linePrefix",5)(l)}function o(l){const d=r.events[r.events.length-1];return d&&d[1].type==="linePrefix"&&d[2].sliceSerialize(d[1],!0).length>=4?a(l):t(l)}function a(l){return l===null?c(l):q(l)?e.attempt(Zs,a,c)(l):(e.enter("codeFlowValue"),s(l))}function s(l){return l===null||q(l)?(e.exit("codeFlowValue"),a(l)):(e.consume(l),s)}function c(l){return e.exit("codeIndented"),n(l)}}function Qs(e,n,t){const r=this;return i;function i(a){return r.parser.lazy[r.now().line]?t(a):q(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),i):ie(e,o,"linePrefix",5)(a)}function o(a){const s=r.events[r.events.length-1];return s&&s[1].type==="linePrefix"&&s[2].sliceSerialize(s[1],!0).length>=4?n(a):q(a)?i(a):t(a)}}const js={name:"codeText",previous:el,resolve:Js,tokenize:nl};function Js(e){let n=e.length-4,t=3,r,i;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 i=t||0;this.setCursor(Math.trunc(n));const o=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&&zn(this.left,r),o.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),zn(this.left,n)}unshift(n){this.setCursor(0),this.right.push(n)}unshiftMany(n){this.setCursor(0),zn(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 ca(e,n,t,r,i,o,a,s,c){const l=c||Number.POSITIVE_INFINITY;let d=0;return u;function u(E){return E===60?(e.enter(r),e.enter(i),e.enter(o),e.consume(E),e.exit(o),f):E===null||E===32||E===41||gt(E)?t(E):(e.enter(r),e.enter(a),e.enter(s),e.enter("chunkString",{contentType:"string"}),_(E))}function f(E){return E===62?(e.enter(o),e.consume(E),e.exit(o),e.exit(i),e.exit(r),n):(e.enter(s),e.enter("chunkString",{contentType:"string"}),p(E))}function p(E){return E===62?(e.exit("chunkString"),e.exit(s),f(E)):E===null||E===60||q(E)?t(E):(e.consume(E),E===92?g:p)}function g(E){return E===60||E===62||E===92?(e.consume(E),p):p(E)}function _(E){return!d&&(E===null||E===41||ge(E))?(e.exit("chunkString"),e.exit(s),e.exit(a),e.exit(r),n(E)):d999||p===null||p===91||p===93&&!c||p===94&&!s&&"_hiddenFootnoteSupport"in a.parser.constructs?t(p):p===93?(e.exit(o),e.enter(i),e.consume(p),e.exit(i),e.exit(r),n):q(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),d):(e.enter("chunkString",{contentType:"string"}),u(p))}function u(p){return p===null||p===91||p===93||q(p)||s++>999?(e.exit("chunkString"),d(p)):(e.consume(p),c||(c=!te(p)),p===92?f:u)}function f(p){return p===91||p===92||p===93?(e.consume(p),s++,u):u(p)}}function da(e,n,t,r,i,o){let a;return s;function s(f){return f===34||f===39||f===40?(e.enter(r),e.enter(i),e.consume(f),e.exit(i),a=f===40?41:f,c):t(f)}function c(f){return f===a?(e.enter(i),e.consume(f),e.exit(i),e.exit(r),n):(e.enter(o),l(f))}function l(f){return f===a?(e.exit(o),c(a)):f===null?t(f):q(f)?(e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),ie(e,l,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),d(f))}function d(f){return f===a||f===null||q(f)?(e.exit("chunkString"),l(f)):(e.consume(f),f===92?u:d)}function u(f){return f===a||f===92?(e.consume(f),d):d(f)}}function Gn(e,n){let t;return r;function r(i){return q(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),t=!0,r):te(i)?ie(e,r,t?"linePrefix":"lineSuffix")(i):n(i)}}const cl={name:"definition",tokenize:dl},ul={partial:!0,tokenize:pl};function dl(e,n,t){const r=this;let i;return o;function o(p){return e.enter("definition"),a(p)}function a(p){return ua.call(r,e,s,t,"definitionLabel","definitionLabelMarker","definitionLabelString")(p)}function s(p){return i=qe(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),p===58?(e.enter("definitionMarker"),e.consume(p),e.exit("definitionMarker"),c):t(p)}function c(p){return ge(p)?Gn(e,l)(p):l(p)}function l(p){return ca(e,d,t,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(p)}function d(p){return e.attempt(ul,u,u)(p)}function u(p){return te(p)?ie(e,f,"whitespace")(p):f(p)}function f(p){return p===null||q(p)?(e.exit("definition"),r.parser.defined.push(i),n(p)):t(p)}}function pl(e,n,t){return r;function r(s){return ge(s)?Gn(e,i)(s):t(s)}function i(s){return da(e,o,t,"definitionTitle","definitionTitleMarker","definitionTitleString")(s)}function o(s){return te(s)?ie(e,a,"whitespace")(s):a(s)}function a(s){return s===null||q(s)?n(s):t(s)}}const fl={name:"hardBreakEscape",tokenize:gl};function gl(e,n,t){return r;function r(o){return e.enter("hardBreakEscape"),e.consume(o),i}function i(o){return q(o)?(e.exit("hardBreakEscape"),n(o)):t(o)}}const ml={name:"headingAtx",resolve:hl,tokenize:bl};function hl(e,n){let t=e.length-2,r=3,i,o;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&&(i={type:"atxHeadingText",start:e[r][1].start,end:e[t][1].end},o={type:"chunkText",start:e[r][1].start,end:e[t][1].end,contentType:"text"},Ue(e,r,t-r+1,[["enter",i,n],["enter",o,n],["exit",o,n],["exit",i,n]])),e}function bl(e,n,t){let r=0;return i;function i(d){return e.enter("atxHeading"),o(d)}function o(d){return e.enter("atxHeadingSequence"),a(d)}function a(d){return d===35&&r++<6?(e.consume(d),a):d===null||ge(d)?(e.exit("atxHeadingSequence"),s(d)):t(d)}function s(d){return d===35?(e.enter("atxHeadingSequence"),c(d)):d===null||q(d)?(e.exit("atxHeading"),n(d)):te(d)?ie(e,s,"whitespace")(d):(e.enter("atxHeadingText"),l(d))}function c(d){return d===35?(e.consume(d),c):(e.exit("atxHeadingSequence"),s(d))}function l(d){return d===null||d===35||ge(d)?(e.exit("atxHeadingText"),s(d)):(e.consume(d),l)}}const El=["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"],ai=["pre","script","style","textarea"],_l={concrete:!0,name:"htmlFlow",resolveTo:wl,tokenize:xl},yl={partial:!0,tokenize:Nl},kl={partial:!0,tokenize:Sl};function wl(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 xl(e,n,t){const r=this;let i,o,a,s,c;return l;function l(b){return d(b)}function d(b){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(b),u}function u(b){return b===33?(e.consume(b),f):b===47?(e.consume(b),o=!0,_):b===63?(e.consume(b),i=3,r.interrupt?n:m):Ie(b)?(e.consume(b),a=String.fromCharCode(b),y):t(b)}function f(b){return b===45?(e.consume(b),i=2,p):b===91?(e.consume(b),i=5,s=0,g):Ie(b)?(e.consume(b),i=4,r.interrupt?n:m):t(b)}function p(b){return b===45?(e.consume(b),r.interrupt?n:m):t(b)}function g(b){const ve="CDATA[";return b===ve.charCodeAt(s++)?(e.consume(b),s===ve.length?r.interrupt?n:B:g):t(b)}function _(b){return Ie(b)?(e.consume(b),a=String.fromCharCode(b),y):t(b)}function y(b){if(b===null||b===47||b===62||ge(b)){const ve=b===47,$e=a.toLowerCase();return!ve&&!o&&ai.includes($e)?(i=1,r.interrupt?n(b):B(b)):El.includes(a.toLowerCase())?(i=6,ve?(e.consume(b),E):r.interrupt?n(b):B(b)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?t(b):o?N(b):x(b))}return b===45||Te(b)?(e.consume(b),a+=String.fromCharCode(b),y):t(b)}function E(b){return b===62?(e.consume(b),r.interrupt?n:B):t(b)}function N(b){return te(b)?(e.consume(b),N):w(b)}function x(b){return b===47?(e.consume(b),w):b===58||b===95||Ie(b)?(e.consume(b),O):te(b)?(e.consume(b),x):w(b)}function O(b){return b===45||b===46||b===58||b===95||Te(b)?(e.consume(b),O):R(b)}function R(b){return b===61?(e.consume(b),k):te(b)?(e.consume(b),R):x(b)}function k(b){return b===null||b===60||b===61||b===62||b===96?t(b):b===34||b===39?(e.consume(b),c=b,U):te(b)?(e.consume(b),k):$(b)}function U(b){return b===c?(e.consume(b),c=null,H):b===null||q(b)?t(b):(e.consume(b),U)}function $(b){return b===null||b===34||b===39||b===47||b===60||b===61||b===62||b===96||ge(b)?R(b):(e.consume(b),$)}function H(b){return b===47||b===62||te(b)?x(b):t(b)}function w(b){return b===62?(e.consume(b),P):t(b)}function P(b){return b===null||q(b)?B(b):te(b)?(e.consume(b),P):t(b)}function B(b){return b===45&&i===2?(e.consume(b),Z):b===60&&i===1?(e.consume(b),oe):b===62&&i===4?(e.consume(b),ce):b===63&&i===3?(e.consume(b),m):b===93&&i===5?(e.consume(b),de):q(b)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(yl,pe,J)(b)):b===null||q(b)?(e.exit("htmlFlowData"),J(b)):(e.consume(b),B)}function J(b){return e.check(kl,D,pe)(b)}function D(b){return e.enter("lineEnding"),e.consume(b),e.exit("lineEnding"),v}function v(b){return b===null||q(b)?J(b):(e.enter("htmlFlowData"),B(b))}function Z(b){return b===45?(e.consume(b),m):B(b)}function oe(b){return b===47?(e.consume(b),a="",X):B(b)}function X(b){if(b===62){const ve=a.toLowerCase();return ai.includes(ve)?(e.consume(b),ce):B(b)}return Ie(b)&&a.length<8?(e.consume(b),a+=String.fromCharCode(b),X):B(b)}function de(b){return b===93?(e.consume(b),m):B(b)}function m(b){return b===62?(e.consume(b),ce):b===45&&i===2?(e.consume(b),m):B(b)}function ce(b){return b===null||q(b)?(e.exit("htmlFlowData"),pe(b)):(e.consume(b),ce)}function pe(b){return e.exit("htmlFlow"),n(b)}}function Sl(e,n,t){const r=this;return i;function i(a){return q(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),o):t(a)}function o(a){return r.parser.lazy[r.now().line]?t(a):n(a)}}function Nl(e,n,t){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(Yn,n,t)}}const Tl={name:"htmlText",tokenize:Al};function Al(e,n,t){const r=this;let i,o,a;return s;function s(m){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(m),c}function c(m){return m===33?(e.consume(m),l):m===47?(e.consume(m),R):m===63?(e.consume(m),x):Ie(m)?(e.consume(m),$):t(m)}function l(m){return m===45?(e.consume(m),d):m===91?(e.consume(m),o=0,g):Ie(m)?(e.consume(m),N):t(m)}function d(m){return m===45?(e.consume(m),p):t(m)}function u(m){return m===null?t(m):m===45?(e.consume(m),f):q(m)?(a=u,oe(m)):(e.consume(m),u)}function f(m){return m===45?(e.consume(m),p):u(m)}function p(m){return m===62?Z(m):m===45?f(m):u(m)}function g(m){const ce="CDATA[";return m===ce.charCodeAt(o++)?(e.consume(m),o===ce.length?_:g):t(m)}function _(m){return m===null?t(m):m===93?(e.consume(m),y):q(m)?(a=_,oe(m)):(e.consume(m),_)}function y(m){return m===93?(e.consume(m),E):_(m)}function E(m){return m===62?Z(m):m===93?(e.consume(m),E):_(m)}function N(m){return m===null||m===62?Z(m):q(m)?(a=N,oe(m)):(e.consume(m),N)}function x(m){return m===null?t(m):m===63?(e.consume(m),O):q(m)?(a=x,oe(m)):(e.consume(m),x)}function O(m){return m===62?Z(m):x(m)}function R(m){return Ie(m)?(e.consume(m),k):t(m)}function k(m){return m===45||Te(m)?(e.consume(m),k):U(m)}function U(m){return q(m)?(a=U,oe(m)):te(m)?(e.consume(m),U):Z(m)}function $(m){return m===45||Te(m)?(e.consume(m),$):m===47||m===62||ge(m)?H(m):t(m)}function H(m){return m===47?(e.consume(m),Z):m===58||m===95||Ie(m)?(e.consume(m),w):q(m)?(a=H,oe(m)):te(m)?(e.consume(m),H):Z(m)}function w(m){return m===45||m===46||m===58||m===95||Te(m)?(e.consume(m),w):P(m)}function P(m){return m===61?(e.consume(m),B):q(m)?(a=P,oe(m)):te(m)?(e.consume(m),P):H(m)}function B(m){return m===null||m===60||m===61||m===62||m===96?t(m):m===34||m===39?(e.consume(m),i=m,J):q(m)?(a=B,oe(m)):te(m)?(e.consume(m),B):(e.consume(m),D)}function J(m){return m===i?(e.consume(m),i=void 0,v):m===null?t(m):q(m)?(a=J,oe(m)):(e.consume(m),J)}function D(m){return m===null||m===34||m===39||m===60||m===61||m===96?t(m):m===47||m===62||ge(m)?H(m):(e.consume(m),D)}function v(m){return m===47||m===62||ge(m)?H(m):t(m)}function Z(m){return m===62?(e.consume(m),e.exit("htmlTextData"),e.exit("htmlText"),n):t(m)}function oe(m){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(m),e.exit("lineEnding"),X}function X(m){return te(m)?ie(e,de,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(m):de(m)}function de(m){return e.enter("htmlTextData"),a(m)}}const yr={name:"labelEnd",resolveAll:Il,resolveTo:Rl,tokenize:Ml},vl={tokenize:Dl},Cl={tokenize:Ll},Ol={tokenize:Pl};function Il(e){let n=-1;const t=[];for(;++n=3&&(l===null||q(l))?(e.exit("thematicBreak"),n(l)):t(l)}function c(l){return l===i?(e.consume(l),r++,c):(e.exit("thematicBreakSequence"),te(l)?ie(e,s,"whitespace")(l):s(l))}}const Re={continuation:{tokenize:Wl},exit:Yl,name:"list",tokenize:ql},Gl={partial:!0,tokenize:Zl},Kl={partial:!0,tokenize:Vl};function ql(e,n,t){const r=this,i=r.events[r.events.length-1];let o=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,a=0;return s;function s(p){const g=r.containerState.type||(p===42||p===43||p===45?"listUnordered":"listOrdered");if(g==="listUnordered"?!r.containerState.marker||p===r.containerState.marker:rr(p)){if(r.containerState.type||(r.containerState.type=g,e.enter(g,{_container:!0})),g==="listUnordered")return e.enter("listItemPrefix"),p===42||p===45?e.check(ft,t,l)(p):l(p);if(!r.interrupt||p===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),c(p)}return t(p)}function c(p){return rr(p)&&++a<10?(e.consume(p),c):(!r.interrupt||a<2)&&(r.containerState.marker?p===r.containerState.marker:p===41||p===46)?(e.exit("listItemValue"),l(p)):t(p)}function l(p){return e.enter("listItemMarker"),e.consume(p),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||p,e.check(Yn,r.interrupt?t:d,e.attempt(Gl,f,u))}function d(p){return r.containerState.initialBlankLine=!0,o++,f(p)}function u(p){return te(p)?(e.enter("listItemPrefixWhitespace"),e.consume(p),e.exit("listItemPrefixWhitespace"),f):t(p)}function f(p){return r.containerState.size=o+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,n(p)}}function Wl(e,n,t){const r=this;return r.containerState._closeFlow=void 0,e.check(Yn,i,o);function i(s){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,ie(e,n,"listItemIndent",r.containerState.size+1)(s)}function o(s){return r.containerState.furtherBlankLines||!te(s)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,a(s)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(Kl,n,a)(s))}function a(s){return r.containerState._closeFlow=!0,r.interrupt=void 0,ie(e,e.attempt(Re,n,t),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(s)}}function Vl(e,n,t){const r=this;return ie(e,i,"listItemIndent",r.containerState.size+1);function i(o){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(o):t(o)}}function Yl(e){e.exit(this.containerState.type)}function Zl(e,n,t){const r=this;return ie(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(o){const a=r.events[r.events.length-1];return!te(o)&&a&&a[1].type==="listItemPrefixWhitespace"?n(o):t(o)}}const oi={name:"setextUnderline",resolveTo:Xl,tokenize:Ql};function Xl(e,n){let t=e.length,r,i,o;for(;t--;)if(e[t][0]==="enter"){if(e[t][1].type==="content"){r=t;break}e[t][1].type==="paragraph"&&(i=t)}else e[t][1].type==="content"&&e.splice(t,1),!o&&e[t][1].type==="definition"&&(o=t);const a={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type="setextHeadingText",o?(e.splice(i,0,["enter",a,n]),e.splice(o+1,0,["exit",e[r][1],n]),e[r][1].end={...e[o][1].end}):e[r][1]=a,e.push(["exit",a,n]),e}function Ql(e,n,t){const r=this;let i;return o;function o(l){let d=r.events.length,u;for(;d--;)if(r.events[d][1].type!=="lineEnding"&&r.events[d][1].type!=="linePrefix"&&r.events[d][1].type!=="content"){u=r.events[d][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||u)?(e.enter("setextHeadingLine"),i=l,a(l)):t(l)}function a(l){return e.enter("setextHeadingLineSequence"),s(l)}function s(l){return l===i?(e.consume(l),s):(e.exit("setextHeadingLineSequence"),te(l)?ie(e,c,"lineSuffix")(l):c(l))}function c(l){return l===null||q(l)?(e.exit("setextHeadingLine"),n(l)):t(l)}}const jl={tokenize:Jl};function Jl(e){const n=this,t=e.attempt(Yn,r,e.attempt(this.parser.constructs.flowInitial,i,ie(e,e.attempt(this.parser.constructs.flow,i,e.attempt(il,i)),"linePrefix")));return t;function r(o){if(o===null){e.consume(o);return}return e.enter("lineEndingBlank"),e.consume(o),e.exit("lineEndingBlank"),n.currentConstruct=void 0,t}function i(o){if(o===null){e.consume(o);return}return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),n.currentConstruct=void 0,t}}const ec={resolveAll:fa()},nc=pa("string"),tc=pa("text");function pa(e){return{resolveAll:fa(e==="text"?rc:void 0),tokenize:n};function n(t){const r=this,i=this.parser.constructs[e],o=t.attempt(i,a,s);return a;function a(d){return l(d)?o(d):s(d)}function s(d){if(d===null){t.consume(d);return}return t.enter("data"),t.consume(d),c}function c(d){return l(d)?(t.exit("data"),o(d)):(t.consume(d),c)}function l(d){if(d===null)return!0;const u=i[d];let f=-1;if(u)for(;++f-1){const s=a[0];typeof s=="string"?a[0]=s.slice(r):a.shift()}o>0&&a.push(e[i].slice(0,o))}return a}function hc(e,n){let t=-1;const r=[];let i;for(;++t0){const Pe=W.tokenStack[W.tokenStack.length-1];(Pe[1]||li).call(W,void 0,Pe[0])}for(I.position={start:dn(S.length>0?S[0][1].start:{line:1,column:1,offset:0}),end:dn(S.length>0?S[S.length-2][1].end:{line:1,column:1,offset:0})},se=-1;++se0&&(r.className=["language-"+i[0]]);let o={type:"element",tagName:"code",properties:r,children:[{type:"text",value:t}]};return n.meta&&(o.data={meta:n.meta}),e.patch(n,o),o=e.applyData(n,o),o={type:"element",tagName:"pre",properties:{},children:[o]},e.patch(n,o),o}function Oc(e,n){const t={type:"element",tagName:"del",properties:{},children:e.all(n)};return e.patch(n,t),e.applyData(n,t)}function Ic(e,n){const t={type:"element",tagName:"em",properties:{},children:e.all(n)};return e.patch(n,t),e.applyData(n,t)}function Rc(e,n){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(n.identifier).toUpperCase(),i=In(r.toLowerCase()),o=e.footnoteOrder.indexOf(r);let a,s=e.footnoteCounts.get(r);s===void 0?(s=0,e.footnoteOrder.push(r),a=e.footnoteOrder.length):a=o+1,s+=1,e.footnoteCounts.set(r,s);const c={type:"element",tagName:"a",properties:{href:"#"+t+"fn-"+i,id:t+"fnref-"+i+(s>1?"-"+s:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(a)}]};e.patch(n,c);const l={type:"element",tagName:"sup",properties:{},children:[c]};return e.patch(n,l),e.applyData(n,l)}function Mc(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 Dc(e,n){if(e.options.allowDangerousHtml){const t={type:"raw",value:n.value};return e.patch(n,t),e.applyData(n,t)}}function ha(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 i=e.all(n),o=i[0];o&&o.type==="text"?o.value="["+o.value:i.unshift({type:"text",value:"["});const a=i[i.length-1];return a&&a.type==="text"?a.value+=r:i.push({type:"text",value:r}),i}function Lc(e,n){const t=String(n.identifier).toUpperCase(),r=e.definitionById.get(t);if(!r)return ha(e,n);const i={src:In(r.url||""),alt:n.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);const o={type:"element",tagName:"img",properties:i,children:[]};return e.patch(n,o),e.applyData(n,o)}function Pc(e,n){const t={src:In(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 Bc(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 Fc(e,n){const t=String(n.identifier).toUpperCase(),r=e.definitionById.get(t);if(!r)return ha(e,n);const i={href:In(r.url||"")};r.title!==null&&r.title!==void 0&&(i.title=r.title);const o={type:"element",tagName:"a",properties:i,children:e.all(n)};return e.patch(n,o),e.applyData(n,o)}function zc(e,n){const t={href:In(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 Uc(e,n,t){const r=e.all(n),i=t?$c(t):ba(n),o={},a=[];if(typeof n.checked=="boolean"){const d=r[0];let u;d&&d.type==="element"&&d.tagName==="p"?u=d:(u={type:"element",tagName:"p",properties:{},children:[]},r.unshift(u)),u.children.length>0&&u.children.unshift({type:"text",value:" "}),u.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:n.checked,disabled:!0},children:[]}),o.className=["task-list-item"]}let s=-1;for(;++s1}function Hc(e,n){const t={},r=e.all(n);let i=-1;for(typeof n.start=="number"&&n.start!==1&&(t.start=n.start);++i0){const a={type:"element",tagName:"tbody",properties:{},children:e.wrap(t,!0)},s=gr(n.children[1]),c=Xi(n.children[n.children.length-1]);s&&c&&(a.position={start:s,end:c}),i.push(a)}const o={type:"element",tagName:"table",properties:{},children:e.wrap(i,!0)};return e.patch(n,o),e.applyData(n,o)}function Vc(e,n,t){const r=t?t.children:void 0,o=(r?r.indexOf(n):1)===0?"th":"td",a=t&&t.type==="table"?t.align:void 0,s=a?a.length:n.children.length;let c=-1;const l=[];for(;++c0,!0),r[0]),i=r.index+r[0].length,r=t.exec(n);return o.push(di(n.slice(i),i>0,!1)),o.join("")}function di(e,n,t){let r=0,i=e.length;if(n){let o=e.codePointAt(r);for(;o===ci||o===ui;)r++,o=e.codePointAt(r)}if(t){let o=e.codePointAt(i-1);for(;o===ci||o===ui;)i--,o=e.codePointAt(i-1)}return i>r?e.slice(r,i):""}function Xc(e,n){const t={type:"text",value:Zc(String(n.value))};return e.patch(n,t),e.applyData(n,t)}function Qc(e,n){const t={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(n,t),e.applyData(n,t)}const jc={blockquote:Ac,break:vc,code:Cc,delete:Oc,emphasis:Ic,footnoteReference:Rc,heading:Mc,html:Dc,imageReference:Lc,image:Pc,inlineCode:Bc,linkReference:Fc,link:zc,listItem:Uc,list:Hc,paragraph:Gc,root:Kc,strong:qc,table:Wc,tableCell:Yc,tableRow:Vc,text:Xc,thematicBreak:Qc,toml:it,yaml:it,definition:it,footnoteDefinition:it};function it(){}const Ea=-1,wt=0,Kn=1,mt=2,kr=3,wr=4,xr=5,Sr=6,_a=7,ya=8,ka=typeof self=="object"?self:globalThis,pi=(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 ka[e](n)},Jc=(e,n)=>{const t=(i,o)=>(e.set(o,i),i),r=i=>{if(e.has(i))return e.get(i);const[o,a]=n[i];switch(o){case wt:case Ea:return t(a,i);case Kn:{const s=t([],i);for(const c of a)s.push(r(c));return s}case mt:{const s=t({},i);for(const[c,l]of a)s[r(c)]=r(l);return s}case kr:return t(new Date(a),i);case wr:{const{source:s,flags:c}=a;return t(new RegExp(s,c),i)}case xr:{const s=t(new Map,i);for(const[c,l]of a)s.set(r(c),r(l));return s}case Sr:{const s=t(new Set,i);for(const c of a)s.add(r(c));return s}case _a:{const{name:s,message:c}=a;return t(typeof ka[s]=="function"?pi(s,c):new Error(c),i)}case ya:return t(BigInt(a),i);case"BigInt":return t(Object(BigInt(a)),i);case"ArrayBuffer":return t(new Uint8Array(a).buffer,a);case"DataView":{const{buffer:s}=new Uint8Array(a);return t(new DataView(s),a)}}return t(pi(o,a),i)};return r},fi=e=>Jc(new Map,e)(0),hn="",{toString:eu}={},{keys:nu}=Object,Un=e=>{const n=typeof e;if(n!=="object"||!e)return[wt,n];const t=eu.call(e).slice(8,-1);switch(t){case"Array":return[Kn,hn];case"Object":return[mt,hn];case"Date":return[kr,hn];case"RegExp":return[wr,hn];case"Map":return[xr,hn];case"Set":return[Sr,hn];case"DataView":return[Kn,t]}return t.includes("Array")?[Kn,t]:e instanceof Error?[_a,e.name||"Error"]:[mt,t]},at=([e,n])=>e===wt&&(n==="function"||n==="symbol"),tu=(e,n,t,r)=>{const i=(a,s)=>{const c=r.push(a)-1;return t.set(s,c),c},o=a=>{if(t.has(a))return t.get(a);let[s,c]=Un(a);switch(s){case wt:{let d=a;switch(c){case"bigint":s=ya,d=a.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+c);d=null;break;case"undefined":return i([Ea],a)}return i([s,d],a)}case Kn:{if(c){let f=a;return c==="DataView"?f=new Uint8Array(a.buffer):c==="ArrayBuffer"&&(f=new Uint8Array(a)),i([c,[...f]],a)}const d=[],u=i([s,d],a);for(const f of a)d.push(o(f));return u}case mt:{if(c)switch(c){case"BigInt":return i([c,a.toString()],a);case"Boolean":case"Number":case"String":return i([c,a.valueOf()],a)}if(n&&"toJSON"in a)return o(a.toJSON());const d=[],u=i([s,d],a);for(const f of nu(a))(e||!at(Un(a[f])))&&d.push([o(f),o(a[f])]);return u}case kr:return i([s,isNaN(a.getTime())?hn:a.toISOString()],a);case wr:{const{source:d,flags:u}=a;return i([s,{source:d,flags:u}],a)}case xr:{const d=[],u=i([s,d],a);for(const[f,p]of a)(e||!(at(Un(f))||at(Un(p))))&&d.push([o(f),o(p)]);return u}case Sr:{const d=[],u=i([s,d],a);for(const f of a)(e||!at(Un(f)))&&d.push(o(f));return u}}const{message:l}=a;return i([s,{name:c,message:l}],a)};return o},gi=(e,{json:n,lossy:t}={})=>{const r=[];return tu(!(n||t),!!n,new Map,r)(e),r},ht=typeof structuredClone=="function"?(e,n)=>n&&("json"in n||"lossy"in n)?fi(gi(e,n)):structuredClone(e):(e,n)=>fi(gi(e,n));function ru(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 iu(e,n){return"Back to reference "+(e+1)+(n>1?"-"+n:"")}function au(e){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",t=e.options.footnoteBackContent||ru,r=e.options.footnoteBackLabel||iu,i=e.options.footnoteLabel||"Footnotes",o=e.options.footnoteLabelTagName||"h2",a=e.options.footnoteLabelProperties||{className:["sr-only"]},s=[];let c=-1;for(;++c0&&g.push({type:"text",value:" "});let N=typeof t=="string"?t:t(c,p);typeof N=="string"&&(N={type:"text",value:N}),g.push({type:"element",tagName:"a",properties:{href:"#"+n+"fnref-"+f+(p>1?"-"+p:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(c,p),className:["data-footnote-backref"]},children:Array.isArray(N)?N:[N]})}const y=d[d.length-1];if(y&&y.type==="element"&&y.tagName==="p"){const N=y.children[y.children.length-1];N&&N.type==="text"?N.value+=" ":y.children.push({type:"text",value:" "}),y.children.push(...g)}else d.push(...g);const E={type:"element",tagName:"li",properties:{id:n+"fn-"+f},children:e.wrap(d,!0)};e.patch(l,E),s.push(E)}if(s.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:o,properties:{...ht(a),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:` -`},{type:"element",tagName:"ol",properties:{},children:e.wrap(s,!0)},{type:"text",value:` -`}]}}const Zn=(function(e){if(e==null)return cu;if(typeof e=="function")return xt(e);if(typeof e=="object")return Array.isArray(e)?ou(e):su(e);if(typeof e=="string")return lu(e);throw new Error("Expected function, string, or object as test")});function ou(e){const n=[];let t=-1;for(;++t":""))+")"})}return f;function f(){let p=wa,g,_,y;if((!n||o(c,l,d[d.length-1]||void 0))&&(p=fu(t(c,d)),p[0]===ar))return p;if("children"in c&&c.children){const E=c;if(E.children&&p[0]!==pu)for(_=(r?E.children.length:-1)+a,y=d.concat(E);_>-1&&_0&&t.push({type:"text",value:` -`}),t}function mi(e){let n=0,t=e.charCodeAt(n);for(;t===9||t===32;)n++,t=e.charCodeAt(n);return e.slice(n)}function hi(e,n){const t=mu(e,n),r=t.one(e,void 0),i=au(t),o=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return i&&o.children.push({type:"text",value:` -`},i),o}function yu(e,n){return e&&"run"in e?async function(t,r){const i=hi(t,{file:r,...n});await e.run(i,r)}:function(t,r){return hi(t,{file:r,...e||n})}}function bi(e){if(e)throw e}var Ft,Ei;function ku(){if(Ei)return Ft;Ei=1;var e=Object.prototype.hasOwnProperty,n=Object.prototype.toString,t=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=function(l){return typeof Array.isArray=="function"?Array.isArray(l):n.call(l)==="[object Array]"},o=function(l){if(!l||n.call(l)!=="[object Object]")return!1;var d=e.call(l,"constructor"),u=l.constructor&&l.constructor.prototype&&e.call(l.constructor.prototype,"isPrototypeOf");if(l.constructor&&!d&&!u)return!1;var f;for(f in l);return typeof f>"u"||e.call(l,f)},a=function(l,d){t&&d.name==="__proto__"?t(l,d.name,{enumerable:!0,configurable:!0,value:d.newValue,writable:!0}):l[d.name]=d.newValue},s=function(l,d){if(d==="__proto__")if(e.call(l,d)){if(r)return r(l,d).value}else return;return l[d]};return Ft=function c(){var l,d,u,f,p,g,_=arguments[0],y=1,E=arguments.length,N=!1;for(typeof _=="boolean"&&(N=_,_=arguments[1]||{},y=2),(_==null||typeof _!="object"&&typeof _!="function")&&(_={});ya.length;let c;s&&a.push(i);try{c=e.apply(this,a)}catch(l){const d=l;if(s&&t)throw d;return i(d)}s||(c&&c.then&&typeof c.then=="function"?c.then(o,i):c instanceof Error?i(c):o(c))}function i(a,...s){t||(t=!0,n(a,...s))}function o(a){i(null,a)}}const Ze={basename:Nu,dirname:Tu,extname:Au,join:vu,sep:"/"};function Nu(e,n){if(n!==void 0&&typeof n!="string")throw new TypeError('"ext" argument must be a string');Xn(e);let t=0,r=-1,i=e.length,o;if(n===void 0||n.length===0||n.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(o){t=i+1;break}}else r<0&&(o=!0,r=i+1);return r<0?"":e.slice(t,r)}if(n===e)return"";let a=-1,s=n.length-1;for(;i--;)if(e.codePointAt(i)===47){if(o){t=i+1;break}}else a<0&&(o=!0,a=i+1),s>-1&&(e.codePointAt(i)===n.codePointAt(s--)?s<0&&(r=i):(s=-1,r=a));return t===r?r=a:r<0&&(r=e.length),e.slice(t,r)}function Tu(e){if(Xn(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 Au(e){Xn(e);let n=e.length,t=-1,r=0,i=-1,o=0,a;for(;n--;){const s=e.codePointAt(n);if(s===47){if(a){r=n+1;break}continue}t<0&&(a=!0,t=n+1),s===46?i<0?i=n:o!==1&&(o=1):i>-1&&(o=-1)}return i<0||t<0||o===0||o===1&&i===t-1&&i===r+1?"":e.slice(i,t)}function vu(...e){let n=-1,t;for(;++n0&&e.codePointAt(e.length-1)===47&&(t+="/"),n?"/"+t:t}function Ou(e,n){let t="",r=0,i=-1,o=0,a=-1,s,c;for(;++a<=e.length;){if(a2){if(c=t.lastIndexOf("/"),c!==t.length-1){c<0?(t="",r=0):(t=t.slice(0,c),r=t.length-1-t.lastIndexOf("/")),i=a,o=0;continue}}else if(t.length>0){t="",r=0,i=a,o=0;continue}}n&&(t=t.length>0?t+"/..":"..",r=2)}else t.length>0?t+="/"+e.slice(i+1,a):t=e.slice(i+1,a),r=a-i-1;i=a,o=0}else s===46&&o>-1?o++:o=-1}return t}function Xn(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const Iu={cwd:Ru};function Ru(){return"/"}function lr(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function Mu(e){if(typeof e=="string")e=new URL(e);else if(!lr(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 Du(e)}function Du(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[p,...g]=d;const _=r[f][1];sr(_)&&sr(p)&&(p=zt(!0,_,p)),r[f]=[l,p,...g]}}}}const Fu=new Nr().freeze();function Gt(e,n){if(typeof n!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Kt(e,n){if(typeof n!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function qt(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 yi(e){if(!sr(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function ki(e,n,t){if(!t)throw new Error("`"+e+"` finished async. Use `"+n+"` instead")}function ot(e){return zu(e)?e:new Sa(e)}function zu(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function Uu(e){return typeof e=="string"||$u(e)}function $u(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const Hu="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",wi=[],xi={allowDangerousHtml:!0},Gu=/^(https?|ircs?|mailto|xmpp)$/i,Ku=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function qu(e){const n=Wu(e),t=Vu(e);return Yu(n.runSync(n.parse(t),t),e)}function Wu(e){const n=e.rehypePlugins||wi,t=e.remarkPlugins||wi,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...xi}:xi;return Fu().use(Tc).use(t).use(yu,r).use(n)}function Vu(e){const n=e.children||"",t=new Sa;return typeof n=="string"&&(t.value=n),t}function Yu(e,n){const t=n.allowedElements,r=n.allowElement,i=n.components,o=n.disallowedElements,a=n.skipHtml,s=n.unwrapDisallowed,c=n.urlTransform||Zu;for(const d of Ku)Object.hasOwn(n,d.from)&&(""+d.from+(d.to?"use `"+d.to+"` instead":"remove it")+Hu+d.id,void 0);return St(e,l),cs(e,{Fragment:vn.Fragment,components:i,ignoreInvalidStyle:!0,jsx:vn.jsx,jsxs:vn.jsxs,passKeys:!0,passNode:!0});function l(d,u,f){if(d.type==="raw"&&f&&typeof u=="number")return a?f.children.splice(u,1):f.children[u]={type:"text",value:d.value},u;if(d.type==="element"){let p;for(p in Lt)if(Object.hasOwn(Lt,p)&&Object.hasOwn(d.properties,p)){const g=d.properties[p],_=Lt[p];(_===null||_.includes(d.tagName))&&(d.properties[p]=c(String(g||""),p,d))}}if(d.type==="element"){let p=t?!t.includes(d.tagName):o?o.includes(d.tagName):!1;if(!p&&r&&typeof u=="number"&&(p=!r(d,u,f)),p&&f&&typeof u=="number")return s&&d.children?f.children.splice(u,1,...d.children):f.children.splice(u,1),u}}}function Zu(e){const n=e.indexOf(":"),t=e.indexOf("?"),r=e.indexOf("#"),i=e.indexOf("/");return n===-1||i!==-1&&n>i||t!==-1&&n>t||r!==-1&&n>r||Gu.test(e.slice(0,n))?e:""}function Si(e,n){const t=String(e);if(typeof n!="string")throw new TypeError("Expected character");let r=0,i=t.indexOf(n);for(;i!==-1;)r++,i=t.indexOf(n,i+n.length);return r}function Xu(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function Qu(e,n,t){const i=Zn((t||{}).ignore||[]),o=ju(n);let a=-1;for(;++a0?{type:"text",value:k}:void 0),k===!1?f.lastIndex=O+1:(g!==O&&N.push({type:"text",value:l.value.slice(g,O)}),Array.isArray(k)?N.push(...k):k&&N.push(k),g=O+x[0].length,E=!0),!f.global)break;x=f.exec(l.value)}return E?(g?\]}]+$/.exec(e);if(!n)return[e,void 0];e=e.slice(0,n.index);let t=n[0],r=t.indexOf(")");const i=Si(e,"(");let o=Si(e,")");for(;r!==-1&&i>o;)e+=t.slice(0,r+1),t=t.slice(r+1),r=t.indexOf(")"),o++;return[e,t]}function Na(e,n){const t=e.input.charCodeAt(e.index-1);return(e.index===0||En(t)||yt(t))&&(!n||t!==47)}Ta.peek=kd;function fd(){this.buffer()}function gd(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function md(){this.buffer()}function hd(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function bd(e){const n=this.resume(),t=this.stack[this.stack.length-1];t.type,t.identifier=qe(this.sliceSerialize(e)).toLowerCase(),t.label=n}function Ed(e){this.exit(e)}function _d(e){const n=this.resume(),t=this.stack[this.stack.length-1];t.type,t.identifier=qe(this.sliceSerialize(e)).toLowerCase(),t.label=n}function yd(e){this.exit(e)}function kd(){return"["}function Ta(e,n,t,r){const i=t.createTracker(r);let o=i.move("[^");const a=t.enter("footnoteReference"),s=t.enter("reference");return o+=i.move(t.safe(t.associationId(e),{after:"]",before:o})),s(),a(),o+=i.move("]"),o}function wd(){return{enter:{gfmFootnoteCallString:fd,gfmFootnoteCall:gd,gfmFootnoteDefinitionLabelString:md,gfmFootnoteDefinition:hd},exit:{gfmFootnoteCallString:bd,gfmFootnoteCall:Ed,gfmFootnoteDefinitionLabelString:_d,gfmFootnoteDefinition:yd}}}function xd(e){let n=!1;return e&&e.firstLineBlank&&(n=!0),{handlers:{footnoteDefinition:t,footnoteReference:Ta},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function t(r,i,o,a){const s=o.createTracker(a);let c=s.move("[^");const l=o.enter("footnoteDefinition"),d=o.enter("label");return c+=s.move(o.safe(o.associationId(r),{before:c,after:"]"})),d(),c+=s.move("]:"),r.children&&r.children.length>0&&(s.shift(4),c+=s.move((n?` -`:" ")+o.indentLines(o.containerFlow(r,s.current()),n?Aa:Sd))),l(),c}}function Sd(e,n,t){return n===0?e:Aa(e,n,t)}function Aa(e,n,t){return(t?"":" ")+e}const Nd=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];va.peek=Od;function Td(){return{canContainEols:["delete"],enter:{strikethrough:vd},exit:{strikethrough:Cd}}}function Ad(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:Nd}],handlers:{delete:va}}}function vd(e){this.enter({type:"delete",children:[]},e)}function Cd(e){this.exit(e)}function va(e,n,t,r){const i=t.createTracker(r),o=t.enter("strikethrough");let a=i.move("~~");return a+=t.containerPhrasing(e,{...i.current(),before:a,after:"~"}),a+=i.move("~~"),o(),a}function Od(){return"~"}function Id(e){return e.length}function Rd(e,n){const t=n||{},r=(t.align||[]).concat(),i=t.stringLength||Id,o=[],a=[],s=[],c=[];let l=0,d=-1;for(;++dl&&(l=e[d].length);++Ec[E])&&(c[E]=x)}_.push(N)}a[d]=_,s[d]=y}let u=-1;if(typeof r=="object"&&"length"in r)for(;++uc[u]&&(c[u]=N),p[u]=N),f[u]=x}a.splice(1,0,f),s.splice(1,0,p),d=-1;const g=[];for(;++d "),o.shift(2);const a=t.indentLines(t.containerFlow(e,o.current()),Ld);return i(),a}function Ld(e,n,t){return">"+(t?"":" ")+e}function Pd(e,n){return Ti(e,n.inConstruct,!0)&&!Ti(e,n.notInConstruct,!1)}function Ti(e,n,t){if(typeof n=="string"&&(n=[n]),!n||n.length===0)return t;let r=-1;for(;++ra&&(a=o):o=1,i=r+n.length,r=t.indexOf(n,i);return a}function Fd(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 zd(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 Ud(e,n,t,r){const i=zd(t),o=e.value||"",a=i==="`"?"GraveAccent":"Tilde";if(Fd(e,t)){const u=t.enter("codeIndented"),f=t.indentLines(o,$d);return u(),f}const s=t.createTracker(r),c=i.repeat(Math.max(Bd(o,i)+1,3)),l=t.enter("codeFenced");let d=s.move(c);if(e.lang){const u=t.enter(`codeFencedLang${a}`);d+=s.move(t.safe(e.lang,{before:d,after:" ",encode:["`"],...s.current()})),u()}if(e.lang&&e.meta){const u=t.enter(`codeFencedMeta${a}`);d+=s.move(" "),d+=s.move(t.safe(e.meta,{before:d,after:` -`,encode:["`"],...s.current()})),u()}return d+=s.move(` -`),o&&(d+=s.move(o+` -`)),d+=s.move(c),l(),d}function $d(e,n,t){return(t?"":" ")+e}function Tr(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 Hd(e,n,t,r){const i=Tr(t),o=i==='"'?"Quote":"Apostrophe",a=t.enter("definition");let s=t.enter("label");const c=t.createTracker(r);let l=c.move("[");return l+=c.move(t.safe(t.associationId(e),{before:l,after:"]",...c.current()})),l+=c.move("]: "),s(),!e.url||/[\0- \u007F]/.test(e.url)?(s=t.enter("destinationLiteral"),l+=c.move("<"),l+=c.move(t.safe(e.url,{before:l,after:">",...c.current()})),l+=c.move(">")):(s=t.enter("destinationRaw"),l+=c.move(t.safe(e.url,{before:l,after:e.title?" ":` -`,...c.current()}))),s(),e.title&&(s=t.enter(`title${o}`),l+=c.move(" "+i),l+=c.move(t.safe(e.title,{before:l,after:i,...c.current()})),l+=c.move(i),s()),a(),l}function Gd(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 Wn(e){return"&#x"+e.toString(16).toUpperCase()+";"}function bt(e,n,t){const r=Cn(e),i=Cn(n);return r===void 0?i===void 0?t==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}Ca.peek=Kd;function Ca(e,n,t,r){const i=Gd(t),o=t.enter("emphasis"),a=t.createTracker(r),s=a.move(i);let c=a.move(t.containerPhrasing(e,{after:i,before:s,...a.current()}));const l=c.charCodeAt(0),d=bt(r.before.charCodeAt(r.before.length-1),l,i);d.inside&&(c=Wn(l)+c.slice(1));const u=c.charCodeAt(c.length-1),f=bt(r.after.charCodeAt(0),u,i);f.inside&&(c=c.slice(0,-1)+Wn(u));const p=a.move(i);return o(),t.attentionEncodeSurroundingInfo={after:f.outside,before:d.outside},s+c+p}function Kd(e,n,t){return t.options.emphasis||"*"}function qd(e,n){let t=!1;return St(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return t=!0,ar}),!!((!e.depth||e.depth<3)&&Er(e)&&(n.options.setext||t))}function Wd(e,n,t,r){const i=Math.max(Math.min(6,e.depth||1),1),o=t.createTracker(r);if(qd(e,t)){const d=t.enter("headingSetext"),u=t.enter("phrasing"),f=t.containerPhrasing(e,{...o.current(),before:` -`,after:` -`});return u(),d(),f+` -`+(i===1?"=":"-").repeat(f.length-(Math.max(f.lastIndexOf("\r"),f.lastIndexOf(` -`))+1))}const a="#".repeat(i),s=t.enter("headingAtx"),c=t.enter("phrasing");o.move(a+" ");let l=t.containerPhrasing(e,{before:"# ",after:` -`,...o.current()});return/^[\t ]/.test(l)&&(l=Wn(l.charCodeAt(0))+l.slice(1)),l=l?a+" "+l:a,t.options.closeAtx&&(l+=" "+a),c(),s(),l}Oa.peek=Vd;function Oa(e){return e.value||""}function Vd(){return"<"}Ia.peek=Yd;function Ia(e,n,t,r){const i=Tr(t),o=i==='"'?"Quote":"Apostrophe",a=t.enter("image");let s=t.enter("label");const c=t.createTracker(r);let l=c.move("![");return l+=c.move(t.safe(e.alt,{before:l,after:"]",...c.current()})),l+=c.move("]("),s(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(s=t.enter("destinationLiteral"),l+=c.move("<"),l+=c.move(t.safe(e.url,{before:l,after:">",...c.current()})),l+=c.move(">")):(s=t.enter("destinationRaw"),l+=c.move(t.safe(e.url,{before:l,after:e.title?" ":")",...c.current()}))),s(),e.title&&(s=t.enter(`title${o}`),l+=c.move(" "+i),l+=c.move(t.safe(e.title,{before:l,after:i,...c.current()})),l+=c.move(i),s()),l+=c.move(")"),a(),l}function Yd(){return"!"}Ra.peek=Zd;function Ra(e,n,t,r){const i=e.referenceType,o=t.enter("imageReference");let a=t.enter("label");const s=t.createTracker(r);let c=s.move("![");const l=t.safe(e.alt,{before:c,after:"]",...s.current()});c+=s.move(l+"]["),a();const d=t.stack;t.stack=[],a=t.enter("reference");const u=t.safe(t.associationId(e),{before:c,after:"]",...s.current()});return a(),t.stack=d,o(),i==="full"||!l||l!==u?c+=s.move(u+"]"):i==="shortcut"?c=c.slice(0,-1):c+=s.move("]"),c}function Zd(){return"!"}Ma.peek=Xd;function Ma(e,n,t){let r=e.value||"",i="`",o=-1;for(;new RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++o\u007F]/.test(e.url))}La.peek=Qd;function La(e,n,t,r){const i=Tr(t),o=i==='"'?"Quote":"Apostrophe",a=t.createTracker(r);let s,c;if(Da(e,t)){const d=t.stack;t.stack=[],s=t.enter("autolink");let u=a.move("<");return u+=a.move(t.containerPhrasing(e,{before:u,after:">",...a.current()})),u+=a.move(">"),s(),t.stack=d,u}s=t.enter("link"),c=t.enter("label");let l=a.move("[");return l+=a.move(t.containerPhrasing(e,{before:l,after:"](",...a.current()})),l+=a.move("]("),c(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(c=t.enter("destinationLiteral"),l+=a.move("<"),l+=a.move(t.safe(e.url,{before:l,after:">",...a.current()})),l+=a.move(">")):(c=t.enter("destinationRaw"),l+=a.move(t.safe(e.url,{before:l,after:e.title?" ":")",...a.current()}))),c(),e.title&&(c=t.enter(`title${o}`),l+=a.move(" "+i),l+=a.move(t.safe(e.title,{before:l,after:i,...a.current()})),l+=a.move(i),c()),l+=a.move(")"),s(),l}function Qd(e,n,t){return Da(e,t)?"<":"["}Pa.peek=jd;function Pa(e,n,t,r){const i=e.referenceType,o=t.enter("linkReference");let a=t.enter("label");const s=t.createTracker(r);let c=s.move("[");const l=t.containerPhrasing(e,{before:c,after:"]",...s.current()});c+=s.move(l+"]["),a();const d=t.stack;t.stack=[],a=t.enter("reference");const u=t.safe(t.associationId(e),{before:c,after:"]",...s.current()});return a(),t.stack=d,o(),i==="full"||!l||l!==u?c+=s.move(u+"]"):i==="shortcut"?c=c.slice(0,-1):c+=s.move("]"),c}function jd(){return"["}function Ar(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 Jd(e){const n=Ar(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 ep(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 Ba(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 np(e,n,t,r){const i=t.enter("list"),o=t.bulletCurrent;let a=e.ordered?ep(t):Ar(t);const s=e.ordered?a==="."?")":".":Jd(t);let c=n&&t.bulletLastUsed?a===t.bulletLastUsed:!1;if(!e.ordered){const d=e.children?e.children[0]:void 0;if((a==="*"||a==="-")&&d&&(!d.children||!d.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&&(c=!0),Ba(t)===a&&d){let u=-1;for(;++u-1?n.start:1)+(t.options.incrementListMarker===!1?0:n.children.indexOf(e))+o);let a=o.length+1;(i==="tab"||i==="mixed"&&(n&&n.type==="list"&&n.spread||e.spread))&&(a=Math.ceil(a/4)*4);const s=t.createTracker(r);s.move(o+" ".repeat(a-o.length)),s.shift(a);const c=t.enter("listItem"),l=t.indentLines(t.containerFlow(e,s.current()),d);return c(),l;function d(u,f,p){return f?(p?"":" ".repeat(a))+u:(p?o:o+" ".repeat(a-o.length))+u}}function ip(e,n,t,r){const i=t.enter("paragraph"),o=t.enter("phrasing"),a=t.containerPhrasing(e,r);return o(),i(),a}const ap=Zn(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function op(e,n,t,r){return(e.children.some(function(a){return ap(a)})?t.containerPhrasing:t.containerFlow).call(t,e,r)}function sp(e){const n=e.options.strong||"*";if(n!=="*"&&n!=="_")throw new Error("Cannot serialize strong with `"+n+"` for `options.strong`, expected `*`, or `_`");return n}Fa.peek=lp;function Fa(e,n,t,r){const i=sp(t),o=t.enter("strong"),a=t.createTracker(r),s=a.move(i+i);let c=a.move(t.containerPhrasing(e,{after:i,before:s,...a.current()}));const l=c.charCodeAt(0),d=bt(r.before.charCodeAt(r.before.length-1),l,i);d.inside&&(c=Wn(l)+c.slice(1));const u=c.charCodeAt(c.length-1),f=bt(r.after.charCodeAt(0),u,i);f.inside&&(c=c.slice(0,-1)+Wn(u));const p=a.move(i+i);return o(),t.attentionEncodeSurroundingInfo={after:f.outside,before:d.outside},s+c+p}function lp(e,n,t){return t.options.strong||"*"}function cp(e,n,t,r){return t.safe(e.value,r)}function up(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 dp(e,n,t){const r=(Ba(t)+(t.options.ruleSpaces?" ":"")).repeat(up(t));return t.options.ruleSpaces?r.slice(0,-1):r}const za={blockquote:Dd,break:Ai,code:Ud,definition:Hd,emphasis:Ca,hardBreak:Ai,heading:Wd,html:Oa,image:Ia,imageReference:Ra,inlineCode:Ma,link:La,linkReference:Pa,list:np,listItem:rp,paragraph:ip,root:op,strong:Fa,text:cp,thematicBreak:dp};function pp(){return{enter:{table:fp,tableData:vi,tableHeader:vi,tableRow:mp},exit:{codeText:hp,table:gp,tableData:Zt,tableHeader:Zt,tableRow:Zt}}}function fp(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 gp(e){this.exit(e),this.data.inTable=void 0}function mp(e){this.enter({type:"tableRow",children:[]},e)}function Zt(e){this.exit(e)}function vi(e){this.enter({type:"tableCell",children:[]},e)}function hp(e){let n=this.resume();this.data.inTable&&(n=n.replace(/\\([\\|])/g,bp));const t=this.stack[this.stack.length-1];t.type,t.value=n,this.exit(e)}function bp(e,n){return n==="|"?n:e}function Ep(e){const n=e||{},t=n.tableCellPadding,r=n.tablePipeAlign,i=n.stringLength,o=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:f,table:a,tableCell:c,tableRow:s}};function a(p,g,_,y){return l(d(p,_,y),p.align)}function s(p,g,_,y){const E=u(p,_,y),N=l([E]);return N.slice(0,N.indexOf(` -`))}function c(p,g,_,y){const E=_.enter("tableCell"),N=_.enter("phrasing"),x=_.containerPhrasing(p,{...y,before:o,after:o});return N(),E(),x}function l(p,g){return Rd(p,{align:g,alignDelimiters:r,padding:t,stringLength:i})}function d(p,g,_){const y=p.children;let E=-1;const N=[],x=g.enter("table");for(;++E0&&!t&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),t}const Pp={tokenize:Kp,partial:!0};function Bp(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:$p,continuation:{tokenize:Hp},exit:Gp}},text:{91:{name:"gfmFootnoteCall",tokenize:Up},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:Fp,resolveTo:zp}}}}function Fp(e,n,t){const r=this;let i=r.events.length;const o=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let a;for(;i--;){const c=r.events[i][1];if(c.type==="labelImage"){a=c;break}if(c.type==="gfmFootnoteCall"||c.type==="labelLink"||c.type==="label"||c.type==="image"||c.type==="link")break}return s;function s(c){if(!a||!a._balanced)return t(c);const l=qe(r.sliceSerialize({start:a.end,end:r.now()}));return l.codePointAt(0)!==94||!o.includes(l.slice(1))?t(c):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(c),e.exit("gfmFootnoteCallLabelMarker"),n(c))}}function zp(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)},i={type:"gfmFootnoteCallMarker",start:Object.assign({},e[t+3][1].end),end:Object.assign({},e[t+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;const o={type:"gfmFootnoteCallString",start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},a={type:"chunkString",contentType:"string",start:Object.assign({},o.start),end:Object.assign({},o.end)},s=[e[t+1],e[t+2],["enter",r,n],e[t+3],e[t+4],["enter",i,n],["exit",i,n],["enter",o,n],["enter",a,n],["exit",a,n],["exit",o,n],e[e.length-2],e[e.length-1],["exit",r,n]];return e.splice(t,e.length-t+1,...s),e}function Up(e,n,t){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let o=0,a;return s;function s(u){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(u),e.exit("gfmFootnoteCallLabelMarker"),c}function c(u){return u!==94?t(u):(e.enter("gfmFootnoteCallMarker"),e.consume(u),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",l)}function l(u){if(o>999||u===93&&!a||u===null||u===91||ge(u))return t(u);if(u===93){e.exit("chunkString");const f=e.exit("gfmFootnoteCallString");return i.includes(qe(r.sliceSerialize(f)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(u),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),n):t(u)}return ge(u)||(a=!0),o++,e.consume(u),u===92?d:l}function d(u){return u===91||u===92||u===93?(e.consume(u),o++,l):l(u)}}function $p(e,n,t){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let o,a=0,s;return c;function c(g){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(g),e.exit("gfmFootnoteDefinitionLabelMarker"),l}function l(g){return g===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(g),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",d):t(g)}function d(g){if(a>999||g===93&&!s||g===null||g===91||ge(g))return t(g);if(g===93){e.exit("chunkString");const _=e.exit("gfmFootnoteDefinitionLabelString");return o=qe(r.sliceSerialize(_)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(g),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),f}return ge(g)||(s=!0),a++,e.consume(g),g===92?u:d}function u(g){return g===91||g===92||g===93?(e.consume(g),a++,d):d(g)}function f(g){return g===58?(e.enter("definitionMarker"),e.consume(g),e.exit("definitionMarker"),i.includes(o)||i.push(o),ie(e,p,"gfmFootnoteDefinitionWhitespace")):t(g)}function p(g){return n(g)}}function Hp(e,n,t){return e.check(Yn,n,e.attempt(Pp,n,t))}function Gp(e){e.exit("gfmFootnoteDefinition")}function Kp(e,n,t){const r=this;return ie(e,i,"gfmFootnoteDefinitionIndent",5);function i(o){const a=r.events[r.events.length-1];return a&&a[1].type==="gfmFootnoteDefinitionIndent"&&a[2].sliceSerialize(a[1],!0).length===4?n(o):t(o)}}function qp(e){let t=(e||{}).singleTilde;const r={name:"strikethrough",tokenize:o,resolveAll:i};return t==null&&(t=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function i(a,s){let c=-1;for(;++c1?c(g):(a.consume(g),u++,p);if(u<2&&!t)return c(g);const y=a.exit("strikethroughSequenceTemporary"),E=Cn(g);return y._open=!E||E===2&&!!_,y._close=!_||_===2&&!!E,s(g)}}}class Wp{constructor(){this.map=[]}add(n,t,r){Vp(this,n,t,r)}consume(n){if(this.map.sort(function(o,a){return o[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 i=r.pop();for(;i;){for(const o of i)n.push(o);i=r.pop()}this.map.length=0}}function Vp(e,n,t,r){let i=0;if(!(t===0&&r.length===0)){for(;i-1;){const D=r.events[P][1].type;if(D==="lineEnding"||D==="linePrefix")P--;else break}const B=P>-1?r.events[P][1].type:null,J=B==="tableHead"||B==="tableRow"?k:c;return J===k&&r.parser.lazy[r.now().line]?t(w):J(w)}function c(w){return e.enter("tableHead"),e.enter("tableRow"),l(w)}function l(w){return w===124||(a=!0,o+=1),d(w)}function d(w){return w===null?t(w):q(w)?o>1?(o=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(w),e.exit("lineEnding"),p):t(w):te(w)?ie(e,d,"whitespace")(w):(o+=1,a&&(a=!1,i+=1),w===124?(e.enter("tableCellDivider"),e.consume(w),e.exit("tableCellDivider"),a=!0,d):(e.enter("data"),u(w)))}function u(w){return w===null||w===124||ge(w)?(e.exit("data"),d(w)):(e.consume(w),w===92?f:u)}function f(w){return w===92||w===124?(e.consume(w),u):u(w)}function p(w){return r.interrupt=!1,r.parser.lazy[r.now().line]?t(w):(e.enter("tableDelimiterRow"),a=!1,te(w)?ie(e,g,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(w):g(w))}function g(w){return w===45||w===58?y(w):w===124?(a=!0,e.enter("tableCellDivider"),e.consume(w),e.exit("tableCellDivider"),_):R(w)}function _(w){return te(w)?ie(e,y,"whitespace")(w):y(w)}function y(w){return w===58?(o+=1,a=!0,e.enter("tableDelimiterMarker"),e.consume(w),e.exit("tableDelimiterMarker"),E):w===45?(o+=1,E(w)):w===null||q(w)?O(w):R(w)}function E(w){return w===45?(e.enter("tableDelimiterFiller"),N(w)):R(w)}function N(w){return w===45?(e.consume(w),N):w===58?(a=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(w),e.exit("tableDelimiterMarker"),x):(e.exit("tableDelimiterFiller"),x(w))}function x(w){return te(w)?ie(e,O,"whitespace")(w):O(w)}function O(w){return w===124?g(w):w===null||q(w)?!a||i!==o?R(w):(e.exit("tableDelimiterRow"),e.exit("tableHead"),n(w)):R(w)}function R(w){return t(w)}function k(w){return e.enter("tableRow"),U(w)}function U(w){return w===124?(e.enter("tableCellDivider"),e.consume(w),e.exit("tableCellDivider"),U):w===null||q(w)?(e.exit("tableRow"),n(w)):te(w)?ie(e,U,"whitespace")(w):(e.enter("data"),$(w))}function $(w){return w===null||w===124||ge(w)?(e.exit("data"),U(w)):(e.consume(w),w===92?H:$)}function H(w){return w===92||w===124?(e.consume(w),$):$(w)}}function Qp(e,n){let t=-1,r=!0,i=0,o=[0,0,0,0],a=[0,0,0,0],s=!1,c=0,l,d,u;const f=new Wp;for(;++tt[2]+1){const g=t[2]+1,_=t[3]-t[2]-1;e.add(g,_,[])}}e.add(t[3]+1,0,[["exit",u,n]])}return i!==void 0&&(o.end=Object.assign({},Nn(n.events,i)),e.add(i,0,[["exit",o,n]]),o=void 0),o}function Oi(e,n,t,r,i){const o=[],a=Nn(n.events,t);i&&(i.end=Object.assign({},a),o.push(["exit",i,n])),r.end=Object.assign({},a),o.push(["exit",r,n]),e.add(t+1,0,o)}function Nn(e,n){const t=e[n],r=t[0]==="enter"?"start":"end";return t[1][r]}const jp={name:"tasklistCheck",tokenize:ef};function Jp(){return{text:{91:jp}}}function ef(e,n,t){const r=this;return i;function i(c){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?t(c):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(c),e.exit("taskListCheckMarker"),o)}function o(c){return ge(c)?(e.enter("taskListCheckValueUnchecked"),e.consume(c),e.exit("taskListCheckValueUnchecked"),a):c===88||c===120?(e.enter("taskListCheckValueChecked"),e.consume(c),e.exit("taskListCheckValueChecked"),a):t(c)}function a(c){return c===93?(e.enter("taskListCheckMarker"),e.consume(c),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),s):t(c)}function s(c){return q(c)?n(c):te(c)?e.check({tokenize:nf},n,t)(c):t(c)}}function nf(e,n,t){return ie(e,r,"whitespace");function r(i){return i===null?t(i):n(i)}}function tf(e){return ra([Ap(),Bp(),qp(e),Zp(),Jp()])}const rf={};function af(e){const n=this,t=e||rf,r=n.data(),i=r.micromarkExtensions||(r.micromarkExtensions=[]),o=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),a=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);i.push(tf(t)),o.push(xp()),a.push(Sp(t))}const Ii=(function(e,n,t){const r=Zn(t);if(!e||!e.type||!e.children)throw new Error("Expected parent node");if(typeof n=="number"){if(n<0||n===Number.POSITIVE_INFINITY)throw new Error("Expected positive finite number as index")}else if(n=e.children.indexOf(n),n<0)throw new Error("Expected child node or index");for(;++nl&&(l=d):d&&(l!==void 0&&l>-1&&c.push(` -`.repeat(l)||" "),l=-1,c.push(d))}return c.join("")}function Za(e,n,t){return e.type==="element"?ff(e,n,t):e.type==="text"?t.whitespace==="normal"?Xa(e,t):gf(e):[]}function ff(e,n,t){const r=Qa(e,t),i=e.children||[];let o=-1,a=[];if(df(e))return a;let s,c;for(ur(e)||Li(e)&&Ii(n,e,Li)?c=` -`:uf(e)?(s=2,c=2):Ya(e)&&(s=1,c=1);++o]+>")+")",s={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},l={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},e.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},d={className:"number",variants:[{begin:"[+-]?(?:(?:[0-9](?:'?[0-9])*\\.(?:[0-9](?:'?[0-9])*)?|\\.[0-9](?:'?[0-9])*)(?:[Ee][+-]?[0-9](?:'?[0-9])*)?|[0-9](?:'?[0-9])*[Ee][+-]?[0-9](?:'?[0-9])*|0[Xx](?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*(?:\\.(?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)?)?|\\.[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)[Pp][+-]?[0-9](?:'?[0-9])*)(?:[Ff](?:16|32|64|128)?|(BF|bf)16|[Ll]|)"},{begin:"[+-]?\\b(?:0[Bb][01](?:'?[01])*|0[Xx][0-9A-Fa-f](?:'?[0-9A-Fa-f])*|0(?:'?[0-7])*|[1-9](?:'?[0-9])*)(?:[Uu](?:LL?|ll?)|[Uu][Zz]?|(?:LL?|ll?)[Uu]?|[Zz][Uu]|)"}],relevance:0},u={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(l,{className:"string"}),{className:"string",begin:/<.*?>/},t,e.C_BLOCK_COMMENT_MODE]},f={className:"title",begin:n.optional(i)+e.IDENT_RE,relevance:0},p=n.optional(i)+e.IDENT_RE+"\\s*\\(",g=["alignas","alignof","and","and_eq","asm","atomic_cancel","atomic_commit","atomic_noexcept","auto","bitand","bitor","break","case","catch","class","co_await","co_return","co_yield","compl","concept","const_cast|10","consteval","constexpr","constinit","continue","decltype","default","delete","do","dynamic_cast|10","else","enum","explicit","export","extern","false","final","for","friend","goto","if","import","inline","module","mutable","namespace","new","noexcept","not","not_eq","nullptr","operator","or","or_eq","override","private","protected","public","reflexpr","register","reinterpret_cast|10","requires","return","sizeof","static_assert","static_cast|10","struct","switch","synchronized","template","this","thread_local","throw","transaction_safe","transaction_safe_dynamic","true","try","typedef","typeid","typename","union","using","virtual","volatile","while","xor","xor_eq"],_=["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],y=["any","auto_ptr","barrier","binary_semaphore","bitset","complex","condition_variable","condition_variable_any","counting_semaphore","deque","false_type","flat_map","flat_set","future","imaginary","initializer_list","istringstream","jthread","latch","lock_guard","multimap","multiset","mutex","optional","ostringstream","packaged_task","pair","promise","priority_queue","queue","recursive_mutex","recursive_timed_mutex","scoped_lock","set","shared_future","shared_lock","shared_mutex","shared_timed_mutex","shared_ptr","stack","string_view","stringstream","timed_mutex","thread","true_type","tuple","unique_lock","unique_ptr","unordered_map","unordered_multimap","unordered_multiset","unordered_set","variant","vector","weak_ptr","wstring","wstring_view"],E=["abort","abs","acos","apply","as_const","asin","atan","atan2","calloc","ceil","cerr","cin","clog","cos","cosh","cout","declval","endl","exchange","exit","exp","fabs","floor","fmod","forward","fprintf","fputs","free","frexp","fscanf","future","invoke","isalnum","isalpha","iscntrl","isdigit","isgraph","islower","isprint","ispunct","isspace","isupper","isxdigit","labs","launder","ldexp","log","log10","make_pair","make_shared","make_shared_for_overwrite","make_tuple","make_unique","malloc","memchr","memcmp","memcpy","memset","modf","move","pow","printf","putchar","puts","realloc","scanf","sin","sinh","snprintf","sprintf","sqrt","sscanf","std","stderr","stdin","stdout","strcat","strchr","strcmp","strcpy","strcspn","strlen","strncat","strncmp","strncpy","strpbrk","strrchr","strspn","strstr","swap","tan","tanh","terminate","to_underlying","tolower","toupper","vfprintf","visit","vprintf","vsprintf"],O={type:_,keyword:g,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:y},R={className:"function.dispatch",relevance:0,keywords:{_hint:E},begin:n.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,e.IDENT_RE,n.lookahead(/(<[^<>]+>|)\s*\(/))},k=[R,u,s,t,e.C_BLOCK_COMMENT_MODE,d,l],U={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:O,contains:k.concat([{begin:/\(/,end:/\)/,keywords:O,contains:k.concat(["self"]),relevance:0}]),relevance:0},$={className:"function",begin:"("+a+"[\\*&\\s]+)+"+p,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:O,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:r,keywords:O,relevance:0},{begin:p,returnBegin:!0,contains:[f],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[l,d]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:O,relevance:0,contains:[t,e.C_BLOCK_COMMENT_MODE,l,d,s,{begin:/\(/,end:/\)/,keywords:O,relevance:0,contains:["self",t,e.C_BLOCK_COMMENT_MODE,l,d,s]}]},s,t,e.C_BLOCK_COMMENT_MODE,u]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:O,illegal:"",keywords:O,contains:["self",s]},{begin:e.IDENT_RE+"::",keywords:O},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}function yf(e){const n={type:["boolean","byte","word","String"],built_in:["KeyboardController","MouseController","SoftwareSerial","EthernetServer","EthernetClient","LiquidCrystal","RobotControl","GSMVoiceCall","EthernetUDP","EsploraTFT","HttpClient","RobotMotor","WiFiClient","GSMScanner","FileSystem","Scheduler","GSMServer","YunClient","YunServer","IPAddress","GSMClient","GSMModem","Keyboard","Ethernet","Console","GSMBand","Esplora","Stepper","Process","WiFiUDP","GSM_SMS","Mailbox","USBHost","Firmata","PImage","Client","Server","GSMPIN","FileIO","Bridge","Serial","EEPROM","Stream","Mouse","Audio","Servo","File","Task","GPRS","WiFi","Wire","TFT","GSM","SPI","SD"],_hints:["setup","loop","runShellCommandAsynchronously","analogWriteResolution","retrieveCallingNumber","printFirmwareVersion","analogReadResolution","sendDigitalPortPair","noListenOnLocalhost","readJoystickButton","setFirmwareVersion","readJoystickSwitch","scrollDisplayRight","getVoiceCallStatus","scrollDisplayLeft","writeMicroseconds","delayMicroseconds","beginTransmission","getSignalStrength","runAsynchronously","getAsynchronously","listenOnLocalhost","getCurrentCarrier","readAccelerometer","messageAvailable","sendDigitalPorts","lineFollowConfig","countryNameWrite","runShellCommand","readStringUntil","rewindDirectory","readTemperature","setClockDivider","readLightSensor","endTransmission","analogReference","detachInterrupt","countryNameRead","attachInterrupt","encryptionType","readBytesUntil","robotNameWrite","readMicrophone","robotNameRead","cityNameWrite","userNameWrite","readJoystickY","readJoystickX","mouseReleased","openNextFile","scanNetworks","noInterrupts","digitalWrite","beginSpeaker","mousePressed","isActionDone","mouseDragged","displayLogos","noAutoscroll","addParameter","remoteNumber","getModifiers","keyboardRead","userNameRead","waitContinue","processInput","parseCommand","printVersion","readNetworks","writeMessage","blinkVersion","cityNameRead","readMessage","setDataMode","parsePacket","isListening","setBitOrder","beginPacket","isDirectory","motorsWrite","drawCompass","digitalRead","clearScreen","serialEvent","rightToLeft","setTextSize","leftToRight","requestFrom","keyReleased","compassRead","analogWrite","interrupts","WiFiServer","disconnect","playMelody","parseFloat","autoscroll","getPINUsed","setPINUsed","setTimeout","sendAnalog","readSlider","analogRead","beginWrite","createChar","motorsStop","keyPressed","tempoWrite","readButton","subnetMask","debugPrint","macAddress","writeGreen","randomSeed","attachGPRS","readString","sendString","remotePort","releaseAll","mouseMoved","background","getXChange","getYChange","answerCall","getResult","voiceCall","endPacket","constrain","getSocket","writeJSON","getButton","available","connected","findUntil","readBytes","exitValue","readGreen","writeBlue","startLoop","IPAddress","isPressed","sendSysex","pauseMode","gatewayIP","setCursor","getOemKey","tuneWrite","noDisplay","loadImage","switchPIN","onRequest","onReceive","changePIN","playFile","noBuffer","parseInt","overflow","checkPIN","knobRead","beginTFT","bitClear","updateIR","bitWrite","position","writeRGB","highByte","writeRed","setSpeed","readBlue","noStroke","remoteIP","transfer","shutdown","hangCall","beginSMS","endWrite","attached","maintain","noCursor","checkReg","checkPUK","shiftOut","isValid","shiftIn","pulseIn","connect","println","localIP","pinMode","getIMEI","display","noBlink","process","getBand","running","beginSD","drawBMP","lowByte","setBand","release","bitRead","prepare","pointTo","readRed","setMode","noFill","remove","listen","stroke","detach","attach","noTone","exists","buffer","height","bitSet","circle","config","cursor","random","IRread","setDNS","endSMS","getKey","micros","millis","begin","print","write","ready","flush","width","isPIN","blink","clear","press","mkdir","rmdir","close","point","yield","image","BSSID","click","delay","read","text","move","peek","beep","rect","line","open","seek","fill","size","turn","stop","home","find","step","tone","sqrt","RSSI","SSID","end","bit","tan","cos","sin","pow","map","abs","max","min","get","run","put"],literal:["DIGITAL_MESSAGE","FIRMATA_STRING","ANALOG_MESSAGE","REPORT_DIGITAL","REPORT_ANALOG","INPUT_PULLUP","SET_PIN_MODE","INTERNAL2V56","SYSTEM_RESET","LED_BUILTIN","INTERNAL1V1","SYSEX_START","INTERNAL","EXTERNAL","DEFAULT","OUTPUT","INPUT","HIGH","LOW"]},t=_f(e),r=t.keywords;return r.type=[...r.type,...n.type],r.literal=[...r.literal,...n.literal],r.built_in=[...r.built_in,...n.built_in],r._hints=n._hints,t.name="Arduino",t.aliases=["ino"],t.supersetOf="cpp",t}function kf(e){const n=e.regex,t={},r={begin:/\$\{/,end:/\}/,contains:["self",{begin:/:-/,contains:[t]}]};Object.assign(t,{className:"variable",variants:[{begin:n.concat(/\$[\w\d#@][\w\d_]*/,"(?![\\w\\d])(?![$])")},r]});const i={className:"subst",begin:/\$\(/,end:/\)/,contains:[e.BACKSLASH_ESCAPE]},o=e.inherit(e.COMMENT(),{match:[/(^|\s)/,/#.*$/],scope:{2:"comment"}}),a={begin:/<<-?\s*(?=\w+)/,starts:{contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,className:"string"})]}},s={className:"string",begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,t,i]};i.contains.push(s);const c={match:/\\"/},l={className:"string",begin:/'/,end:/'/},d={match:/\\'/},u={begin:/\$?\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},e.NUMBER_MODE,t]},f=["fish","bash","zsh","sh","csh","ksh","tcsh","dash","scsh"],p=e.SHEBANG({binary:`(${f.join("|")})`,relevance:10}),g={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[e.inherit(e.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0},_=["if","then","else","elif","fi","time","for","while","until","in","do","done","case","esac","coproc","function","select"],y=["true","false"],E={match:/(\/[a-z._-]+)+/},N=["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset"],x=["alias","bind","builtin","caller","command","declare","echo","enable","help","let","local","logout","mapfile","printf","read","readarray","source","sudo","type","typeset","ulimit","unalias"],O=["autoload","bg","bindkey","bye","cap","chdir","clone","comparguments","compcall","compctl","compdescribe","compfiles","compgroups","compquote","comptags","comptry","compvalues","dirs","disable","disown","echotc","echoti","emulate","fc","fg","float","functions","getcap","getln","history","integer","jobs","kill","limit","log","noglob","popd","print","pushd","pushln","rehash","sched","setcap","setopt","stat","suspend","ttyctl","unfunction","unhash","unlimit","unsetopt","vared","wait","whence","where","which","zcompile","zformat","zftp","zle","zmodload","zparseopts","zprof","zpty","zregexparse","zsocket","zstyle","ztcp"],R=["chcon","chgrp","chown","chmod","cp","dd","df","dir","dircolors","ln","ls","mkdir","mkfifo","mknod","mktemp","mv","realpath","rm","rmdir","shred","sync","touch","truncate","vdir","b2sum","base32","base64","cat","cksum","comm","csplit","cut","expand","fmt","fold","head","join","md5sum","nl","numfmt","od","paste","ptx","pr","sha1sum","sha224sum","sha256sum","sha384sum","sha512sum","shuf","sort","split","sum","tac","tail","tr","tsort","unexpand","uniq","wc","arch","basename","chroot","date","dirname","du","echo","env","expr","factor","groups","hostid","id","link","logname","nice","nohup","nproc","pathchk","pinky","printenv","printf","pwd","readlink","runcon","seq","sleep","stat","stdbuf","stty","tee","test","timeout","tty","uname","unlink","uptime","users","who","whoami","yes"];return{name:"Bash",aliases:["sh","zsh"],keywords:{$pattern:/\b[a-z][a-z0-9._-]+\b/,keyword:_,literal:y,built_in:[...N,...x,"set","shopt",...O,...R]},contains:[p,e.SHEBANG(),g,u,o,a,E,s,c,l,d,t]}}function wf(e){const n=e.regex,t=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),r="decltype\\(auto\\)",i="[a-zA-Z_]\\w*::",a="("+r+"|"+n.optional(i)+"[a-zA-Z_]\\w*"+n.optional("<[^<>]+>")+")",s={className:"type",variants:[{begin:"\\b[a-z\\d_]*_t\\b"},{match:/\batomic_[a-z]{3,6}\b/}]},l={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},e.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},d={className:"number",variants:[{match:/\b(0b[01']+)/},{match:/(-?)\b([\d']+(\.[\d']*)?|\.[\d']+)((ll|LL|l|L)(u|U)?|(u|U)(ll|LL|l|L)?|f|F|b|B)/},{match:/(-?)\b(0[xX][a-fA-F0-9]+(?:'[a-fA-F0-9]+)*(?:\.[a-fA-F0-9]*(?:'[a-fA-F0-9]*)*)?(?:[pP][-+]?[0-9]+)?(l|L)?(u|U)?)/},{match:/(-?)\b\d+(?:'\d+)*(?:\.\d*(?:'\d*)*)?(?:[eE][-+]?\d+)?/}],relevance:0},u={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef elifdef elifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(l,{className:"string"}),{className:"string",begin:/<.*?>/},t,e.C_BLOCK_COMMENT_MODE]},f={className:"title",begin:n.optional(i)+e.IDENT_RE,relevance:0},p=n.optional(i)+e.IDENT_RE+"\\s*\\(",y={keyword:["asm","auto","break","case","continue","default","do","else","enum","extern","for","fortran","goto","if","inline","register","restrict","return","sizeof","typeof","typeof_unqual","struct","switch","typedef","union","volatile","while","_Alignas","_Alignof","_Atomic","_Generic","_Noreturn","_Static_assert","_Thread_local","alignas","alignof","noreturn","static_assert","thread_local","_Pragma"],type:["float","double","signed","unsigned","int","short","long","char","void","_Bool","_BitInt","_Complex","_Imaginary","_Decimal32","_Decimal64","_Decimal96","_Decimal128","_Decimal64x","_Decimal128x","_Float16","_Float32","_Float64","_Float128","_Float32x","_Float64x","_Float128x","const","static","constexpr","complex","bool","imaginary"],literal:"true false NULL",built_in:"std string wstring cin cout cerr clog stdin stdout stderr stringstream istringstream ostringstream auto_ptr deque list queue stack vector map set pair bitset multiset multimap unordered_set unordered_map unordered_multiset unordered_multimap priority_queue make_pair array shared_ptr abort terminate abs acos asin atan2 atan calloc ceil cosh cos exit exp fabs floor fmod fprintf fputs free frexp fscanf future isalnum isalpha iscntrl isdigit isgraph islower isprint ispunct isspace isupper isxdigit tolower toupper labs ldexp log10 log malloc realloc memchr memcmp memcpy memset modf pow printf putchar puts scanf sinh sin snprintf sprintf sqrt sscanf strcat strchr strcmp strcpy strcspn strlen strncat strncmp strncpy strpbrk strrchr strspn strstr tanh tan vfprintf vprintf vsprintf endl initializer_list unique_ptr"},E=[u,s,t,e.C_BLOCK_COMMENT_MODE,d,l],N={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:y,contains:E.concat([{begin:/\(/,end:/\)/,keywords:y,contains:E.concat(["self"]),relevance:0}]),relevance:0},x={begin:"("+a+"[\\*&\\s]+)+"+p,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:y,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:r,keywords:y,relevance:0},{begin:p,returnBegin:!0,contains:[e.inherit(f,{className:"title.function"})],relevance:0},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:y,relevance:0,contains:[t,e.C_BLOCK_COMMENT_MODE,l,d,s,{begin:/\(/,end:/\)/,keywords:y,relevance:0,contains:["self",t,e.C_BLOCK_COMMENT_MODE,l,d,s]}]},s,t,e.C_BLOCK_COMMENT_MODE,u]};return{name:"C",aliases:["h"],keywords:y,disableAutodetect:!0,illegal:"=]/,contains:[{beginKeywords:"final class struct"},e.TITLE_MODE]}]),exports:{preprocessor:u,strings:l,keywords:y}}}function xf(e){const n=e.regex,t=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),r="decltype\\(auto\\)",i="[a-zA-Z_]\\w*::",a="(?!struct)("+r+"|"+n.optional(i)+"[a-zA-Z_]\\w*"+n.optional("<[^<>]+>")+")",s={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},l={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},e.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},d={className:"number",variants:[{begin:"[+-]?(?:(?:[0-9](?:'?[0-9])*\\.(?:[0-9](?:'?[0-9])*)?|\\.[0-9](?:'?[0-9])*)(?:[Ee][+-]?[0-9](?:'?[0-9])*)?|[0-9](?:'?[0-9])*[Ee][+-]?[0-9](?:'?[0-9])*|0[Xx](?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*(?:\\.(?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)?)?|\\.[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)[Pp][+-]?[0-9](?:'?[0-9])*)(?:[Ff](?:16|32|64|128)?|(BF|bf)16|[Ll]|)"},{begin:"[+-]?\\b(?:0[Bb][01](?:'?[01])*|0[Xx][0-9A-Fa-f](?:'?[0-9A-Fa-f])*|0(?:'?[0-7])*|[1-9](?:'?[0-9])*)(?:[Uu](?:LL?|ll?)|[Uu][Zz]?|(?:LL?|ll?)[Uu]?|[Zz][Uu]|)"}],relevance:0},u={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(l,{className:"string"}),{className:"string",begin:/<.*?>/},t,e.C_BLOCK_COMMENT_MODE]},f={className:"title",begin:n.optional(i)+e.IDENT_RE,relevance:0},p=n.optional(i)+e.IDENT_RE+"\\s*\\(",g=["alignas","alignof","and","and_eq","asm","atomic_cancel","atomic_commit","atomic_noexcept","auto","bitand","bitor","break","case","catch","class","co_await","co_return","co_yield","compl","concept","const_cast|10","consteval","constexpr","constinit","continue","decltype","default","delete","do","dynamic_cast|10","else","enum","explicit","export","extern","false","final","for","friend","goto","if","import","inline","module","mutable","namespace","new","noexcept","not","not_eq","nullptr","operator","or","or_eq","override","private","protected","public","reflexpr","register","reinterpret_cast|10","requires","return","sizeof","static_assert","static_cast|10","struct","switch","synchronized","template","this","thread_local","throw","transaction_safe","transaction_safe_dynamic","true","try","typedef","typeid","typename","union","using","virtual","volatile","while","xor","xor_eq"],_=["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],y=["any","auto_ptr","barrier","binary_semaphore","bitset","complex","condition_variable","condition_variable_any","counting_semaphore","deque","false_type","flat_map","flat_set","future","imaginary","initializer_list","istringstream","jthread","latch","lock_guard","multimap","multiset","mutex","optional","ostringstream","packaged_task","pair","promise","priority_queue","queue","recursive_mutex","recursive_timed_mutex","scoped_lock","set","shared_future","shared_lock","shared_mutex","shared_timed_mutex","shared_ptr","stack","string_view","stringstream","timed_mutex","thread","true_type","tuple","unique_lock","unique_ptr","unordered_map","unordered_multimap","unordered_multiset","unordered_set","variant","vector","weak_ptr","wstring","wstring_view"],E=["abort","abs","acos","apply","as_const","asin","atan","atan2","calloc","ceil","cerr","cin","clog","cos","cosh","cout","declval","endl","exchange","exit","exp","fabs","floor","fmod","forward","fprintf","fputs","free","frexp","fscanf","future","invoke","isalnum","isalpha","iscntrl","isdigit","isgraph","islower","isprint","ispunct","isspace","isupper","isxdigit","labs","launder","ldexp","log","log10","make_pair","make_shared","make_shared_for_overwrite","make_tuple","make_unique","malloc","memchr","memcmp","memcpy","memset","modf","move","pow","printf","putchar","puts","realloc","scanf","sin","sinh","snprintf","sprintf","sqrt","sscanf","std","stderr","stdin","stdout","strcat","strchr","strcmp","strcpy","strcspn","strlen","strncat","strncmp","strncpy","strpbrk","strrchr","strspn","strstr","swap","tan","tanh","terminate","to_underlying","tolower","toupper","vfprintf","visit","vprintf","vsprintf"],O={type:_,keyword:g,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:y},R={className:"function.dispatch",relevance:0,keywords:{_hint:E},begin:n.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,e.IDENT_RE,n.lookahead(/(<[^<>]+>|)\s*\(/))},k=[R,u,s,t,e.C_BLOCK_COMMENT_MODE,d,l],U={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:O,contains:k.concat([{begin:/\(/,end:/\)/,keywords:O,contains:k.concat(["self"]),relevance:0}]),relevance:0},$={className:"function",begin:"("+a+"[\\*&\\s]+)+"+p,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:O,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:r,keywords:O,relevance:0},{begin:p,returnBegin:!0,contains:[f],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[l,d]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:O,relevance:0,contains:[t,e.C_BLOCK_COMMENT_MODE,l,d,s,{begin:/\(/,end:/\)/,keywords:O,relevance:0,contains:["self",t,e.C_BLOCK_COMMENT_MODE,l,d,s]}]},s,t,e.C_BLOCK_COMMENT_MODE,u]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:O,illegal:"",keywords:O,contains:["self",s]},{begin:e.IDENT_RE+"::",keywords:O},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}function Sf(e){const n=["bool","byte","char","decimal","delegate","double","dynamic","enum","float","int","long","nint","nuint","object","sbyte","short","string","ulong","uint","ushort"],t=["public","private","protected","static","internal","protected","abstract","async","extern","override","unsafe","virtual","new","sealed","partial"],r=["default","false","null","true"],i=["abstract","as","base","break","case","catch","class","const","continue","do","else","event","explicit","extern","finally","fixed","for","foreach","goto","if","implicit","in","interface","internal","is","lock","namespace","new","operator","out","override","params","private","protected","public","readonly","record","ref","return","scoped","sealed","sizeof","stackalloc","static","struct","switch","this","throw","try","typeof","unchecked","unsafe","using","virtual","void","volatile","while"],o=["add","alias","and","ascending","args","async","await","by","descending","dynamic","equals","file","from","get","global","group","init","into","join","let","nameof","not","notnull","on","or","orderby","partial","record","remove","required","scoped","select","set","unmanaged","value|0","var","when","where","with","yield"],a={keyword:i.concat(o),built_in:n,literal:r},s=e.inherit(e.TITLE_MODE,{begin:"[a-zA-Z](\\.?\\w)*"}),c={className:"number",variants:[{begin:"\\b(0b[01']+)"},{begin:"(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)(u|U|l|L|ul|UL|f|F|b|B)"},{begin:"(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)"}],relevance:0},l={className:"string",begin:/"""("*)(?!")(.|\n)*?"""\1/,relevance:1},d={className:"string",begin:'@"',end:'"',contains:[{begin:'""'}]},u=e.inherit(d,{illegal:/\n/}),f={className:"subst",begin:/\{/,end:/\}/,keywords:a},p=e.inherit(f,{illegal:/\n/}),g={className:"string",begin:/\$"/,end:'"',illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},e.BACKSLASH_ESCAPE,p]},_={className:"string",begin:/\$@"/,end:'"',contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},f]},y=e.inherit(_,{illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},p]});f.contains=[_,g,d,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,c,e.C_BLOCK_COMMENT_MODE],p.contains=[y,g,u,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,c,e.inherit(e.C_BLOCK_COMMENT_MODE,{illegal:/\n/})];const E={variants:[l,_,g,d,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},N={begin:"<",end:">",contains:[{beginKeywords:"in out"},s]},x=e.IDENT_RE+"(<"+e.IDENT_RE+"(\\s*,\\s*"+e.IDENT_RE+")*>)?(\\[\\])?",O={begin:"@"+e.IDENT_RE,relevance:0};return{name:"C#",aliases:["cs","c#"],keywords:a,illegal:/::/,contains:[e.COMMENT("///","$",{returnBegin:!0,contains:[{className:"doctag",variants:[{begin:"///",relevance:0},{begin:""},{begin:""}]}]}),e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{className:"meta",begin:"#",end:"$",keywords:{keyword:"if else elif endif define undef warning error line region endregion pragma checksum"}},E,c,{beginKeywords:"class interface",relevance:0,end:/[{;=]/,illegal:/[^\s:,]/,contains:[{beginKeywords:"where class"},s,N,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"namespace",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[s,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"record",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[s,N,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{className:"meta",begin:"^\\s*\\[(?=[\\w])",excludeBegin:!0,end:"\\]",excludeEnd:!0,contains:[{className:"string",begin:/"/,end:/"/}]},{beginKeywords:"new return throw await else",relevance:0},{className:"function",begin:"("+x+"\\s+)+"+e.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,end:/\s*[{;=]/,excludeEnd:!0,keywords:a,contains:[{beginKeywords:t.join(" "),relevance:0},{begin:e.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,contains:[e.TITLE_MODE,N],relevance:0},{match:/\(\)/},{className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:a,relevance:0,contains:[E,c,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},O]}}const Nf=e=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:e.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),Tf=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],Af=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],vf=[...Tf,...Af],Cf=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),Of=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),If=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),Rf=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse();function Mf(e){const n=e.regex,t=Nf(e),r={begin:/-(webkit|moz|ms|o)-(?=[a-z])/},i="and or not only",o=/@-?\w[\w]*(-\w+)*/,a="[a-zA-Z-][a-zA-Z0-9_-]*",s=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE];return{name:"CSS",case_insensitive:!0,illegal:/[=|'\$]/,keywords:{keyframePosition:"from to"},classNameAliases:{keyframePosition:"selector-tag"},contains:[t.BLOCK_COMMENT,r,t.CSS_NUMBER_MODE,{className:"selector-id",begin:/#[A-Za-z0-9_-]+/,relevance:0},{className:"selector-class",begin:"\\."+a,relevance:0},t.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",variants:[{begin:":("+Of.join("|")+")"},{begin:":(:)?("+If.join("|")+")"}]},t.CSS_VARIABLE,{className:"attribute",begin:"\\b("+Rf.join("|")+")\\b"},{begin:/:/,end:/[;}{]/,contains:[t.BLOCK_COMMENT,t.HEXCOLOR,t.IMPORTANT,t.CSS_NUMBER_MODE,...s,{begin:/(url|data-uri)\(/,end:/\)/,relevance:0,keywords:{built_in:"url data-uri"},contains:[...s,{className:"string",begin:/[^)]/,endsWithParent:!0,excludeEnd:!0}]},t.FUNCTION_DISPATCH]},{begin:n.lookahead(/@/),end:"[{;]",relevance:0,illegal:/:/,contains:[{className:"keyword",begin:o},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:{$pattern:/[a-z-]+/,keyword:i,attribute:Cf.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...s,t.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+vf.join("|")+")\\b"}]}}function Df(e){const n=e.regex;return{name:"Diff",aliases:["patch"],contains:[{className:"meta",relevance:10,match:n.either(/^@@ +-\d+,\d+ +\+\d+,\d+ +@@/,/^\*\*\* +\d+,\d+ +\*\*\*\*$/,/^--- +\d+,\d+ +----$/)},{className:"comment",variants:[{begin:n.either(/Index: /,/^index/,/={3,}/,/^-{3}/,/^\*{3} /,/^\+{3}/,/^diff --git/),end:/$/},{match:/^\*{15}$/}]},{className:"addition",begin:/^\+/,end:/$/},{className:"deletion",begin:/^-/,end:/$/},{className:"addition",begin:/^!/,end:/$/}]}}function Lf(e){const o={keyword:["break","case","chan","const","continue","default","defer","else","fallthrough","for","func","go","goto","if","import","interface","map","package","range","return","select","struct","switch","type","var"],type:["bool","byte","complex64","complex128","error","float32","float64","int8","int16","int32","int64","string","uint8","uint16","uint32","uint64","int","uint","uintptr","rune"],literal:["true","false","iota","nil"],built_in:["append","cap","close","complex","copy","imag","len","make","new","panic","print","println","real","recover","delete"]};return{name:"Go",aliases:["golang"],keywords:o,illegal:"ja(e,n,t-1))}function Ff(e){const n=e.regex,t="[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*",r=t+ja("(?:<"+t+"~~~(?:\\s*,\\s*"+t+"~~~)*>)?",/~~~/g,2),c={keyword:["synchronized","abstract","private","var","static","if","const ","for","while","strictfp","finally","protected","import","native","final","void","enum","else","break","transient","catch","instanceof","volatile","case","assert","package","default","public","try","switch","continue","throws","protected","public","private","module","requires","exports","do","sealed","yield","permits","goto","when"],literal:["false","true","null"],type:["char","boolean","long","float","int","byte","short","double"],built_in:["super","this"]},l={className:"meta",begin:"@"+t,contains:[{begin:/\(/,end:/\)/,contains:["self"]}]},d={className:"params",begin:/\(/,end:/\)/,keywords:c,relevance:0,contains:[e.C_BLOCK_COMMENT_MODE],endsParent:!0};return{name:"Java",aliases:["jsp"],keywords:c,illegal:/<\/|#/,contains:[e.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{begin:/\w+@/,relevance:0},{className:"doctag",begin:"@[A-Za-z]+"}]}),{begin:/import java\.[a-z]+\./,keywords:"import",relevance:2},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{begin:/"""/,end:/"""/,className:"string",contains:[e.BACKSLASH_ESCAPE]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,{match:[/\b(?:class|interface|enum|extends|implements|new)/,/\s+/,t],className:{1:"keyword",3:"title.class"}},{match:/non-sealed/,scope:"keyword"},{begin:[n.concat(/(?!else)/,t),/\s+/,t,/\s+/,/=(?!=)/],className:{1:"type",3:"variable",5:"operator"}},{begin:[/record/,/\s+/,t],className:{1:"keyword",3:"title.class"},contains:[d,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"new throw return else",relevance:0},{begin:["(?:"+r+"\\s+)",e.UNDERSCORE_IDENT_RE,/\s*(?=\()/],className:{2:"title.function"},keywords:c,contains:[{className:"params",begin:/\(/,end:/\)/,keywords:c,relevance:0,contains:[l,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,Pi,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},Pi,l]}}const Bi="[A-Za-z$_][0-9A-Za-z$_]*",zf=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],Uf=["true","false","null","undefined","NaN","Infinity"],Ja=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],eo=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],no=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],$f=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],Hf=[].concat(no,Ja,eo);function Gf(e){const n=e.regex,t=(X,{after:de})=>{const m="",end:""},o=/<[A-Za-z0-9\\._:-]+\s*\/>/,a={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(X,de)=>{const m=X[0].length+X.index,ce=X.input[m];if(ce==="<"||ce===","){de.ignoreMatch();return}ce===">"&&(t(X,{after:m})||de.ignoreMatch());let pe;const b=X.input.substring(m);if(pe=b.match(/^\s*=/)){de.ignoreMatch();return}if((pe=b.match(/^\s+extends\s+/))&&pe.index===0){de.ignoreMatch();return}}},s={$pattern:Bi,keyword:zf,literal:Uf,built_in:Hf,"variable.language":$f},c="[0-9](_?[0-9])*",l=`\\.(${c})`,d="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",u={className:"number",variants:[{begin:`(\\b(${d})((${l})|\\.)?|(${l}))[eE][+-]?(${c})\\b`},{begin:`\\b(${d})\\b((${l})\\b|\\.)?|(${l})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},f={className:"subst",begin:"\\$\\{",end:"\\}",keywords:s,contains:[]},p={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,f],subLanguage:"xml"}},g={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,f],subLanguage:"css"}},_={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,f],subLanguage:"graphql"}},y={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,f]},N={className:"comment",variants:[e.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:r+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},x=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,g,_,y,{match:/\$\d+/},u];f.contains=x.concat({begin:/\{/,end:/\}/,keywords:s,contains:["self"].concat(x)});const O=[].concat(N,f.contains),R=O.concat([{begin:/(\s*)\(/,end:/\)/,keywords:s,contains:["self"].concat(O)}]),k={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:s,contains:R},U={variants:[{match:[/class/,/\s+/,r,/\s+/,/extends/,/\s+/,n.concat(r,"(",n.concat(/\./,r),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,r],scope:{1:"keyword",3:"title.class"}}]},$={relevance:0,match:n.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...Ja,...eo]}},H={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},w={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[k],illegal:/%/},P={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function B(X){return n.concat("(?!",X.join("|"),")")}const J={match:n.concat(/\b/,B([...no,"super","import"].map(X=>`${X}\\s*\\(`)),r,n.lookahead(/\s*\(/)),className:"title.function",relevance:0},D={begin:n.concat(/\./,n.lookahead(n.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},v={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},k]},Z="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",oe={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,n.lookahead(Z)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[k]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:s,exports:{PARAMS_CONTAINS:R,CLASS_REFERENCE:$},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),H,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,g,_,y,N,{match:/\$\d+/},u,$,{scope:"attr",match:r+n.lookahead(":"),relevance:0},oe,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[N,e.REGEXP_MODE,{className:"function",begin:Z,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:s,contains:R}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:i.begin,end:i.end},{match:o},{begin:a.begin,"on:begin":a.isTrulyOpeningTag,end:a.end}],subLanguage:"xml",contains:[{begin:a.begin,end:a.end,skip:!0,contains:["self"]}]}]},w,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[k,e.inherit(e.TITLE_MODE,{begin:r,className:"title.function"})]},{match:/\.\.\./,relevance:0},D,{match:"\\$"+r,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[k]},J,P,U,v,{match:/\$[(.]/}]}}function Kf(e){const n={className:"attr",begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},t={match:/[{}[\],:]/,className:"punctuation",relevance:0},r=["true","false","null"],i={scope:"literal",beginKeywords:r.join(" ")};return{name:"JSON",aliases:["jsonc"],keywords:{literal:r},contains:[n,t,e.QUOTE_STRING_MODE,i,e.C_NUMBER_MODE,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE],illegal:"\\S"}}var An="[0-9](_*[0-9])*",ut=`\\.(${An})`,dt="[0-9a-fA-F](_*[0-9a-fA-F])*",qf={className:"number",variants:[{begin:`(\\b(${An})((${ut})|\\.)?|(${ut}))[eE][+-]?(${An})[fFdD]?\\b`},{begin:`\\b(${An})((${ut})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${ut})[fFdD]?\\b`},{begin:`\\b(${An})[fFdD]\\b`},{begin:`\\b0[xX]((${dt})\\.?|(${dt})?\\.(${dt}))[pP][+-]?(${An})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${dt})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function Wf(e){const n={keyword:"abstract as val var vararg get set class object open private protected public noinline crossinline dynamic final enum if else do while for when throw try catch finally import package is in fun override companion reified inline lateinit init interface annotation data sealed internal infix operator out by constructor super tailrec where const inner suspend typealias external expect actual",built_in:"Byte Short Char Int Long Boolean Float Double Void Unit Nothing",literal:"true false null"},t={className:"keyword",begin:/\b(break|continue|return|this)\b/,starts:{contains:[{className:"symbol",begin:/@\w+/}]}},r={className:"symbol",begin:e.UNDERSCORE_IDENT_RE+"@"},i={className:"subst",begin:/\$\{/,end:/\}/,contains:[e.C_NUMBER_MODE]},o={className:"variable",begin:"\\$"+e.UNDERSCORE_IDENT_RE},a={className:"string",variants:[{begin:'"""',end:'"""(?=[^"])',contains:[o,i]},{begin:"'",end:"'",illegal:/\n/,contains:[e.BACKSLASH_ESCAPE]},{begin:'"',end:'"',illegal:/\n/,contains:[e.BACKSLASH_ESCAPE,o,i]}]};i.contains.push(a);const s={className:"meta",begin:"@(?:file|property|field|get|set|receiver|param|setparam|delegate)\\s*:(?:\\s*"+e.UNDERSCORE_IDENT_RE+")?"},c={className:"meta",begin:"@"+e.UNDERSCORE_IDENT_RE,contains:[{begin:/\(/,end:/\)/,contains:[e.inherit(a,{className:"string"}),"self"]}]},l=qf,d=e.COMMENT("/\\*","\\*/",{contains:[e.C_BLOCK_COMMENT_MODE]}),u={variants:[{className:"type",begin:e.UNDERSCORE_IDENT_RE},{begin:/\(/,end:/\)/,contains:[]}]},f=u;return f.variants[1].contains=[u],u.variants[1].contains=[f],{name:"Kotlin",aliases:["kt","kts"],keywords:n,contains:[e.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"}]}),e.C_LINE_COMMENT_MODE,d,t,r,s,c,{className:"function",beginKeywords:"fun",end:"[(]|$",returnBegin:!0,excludeEnd:!0,keywords:n,relevance:5,contains:[{begin:e.UNDERSCORE_IDENT_RE+"\\s*\\(",returnBegin:!0,relevance:0,contains:[e.UNDERSCORE_TITLE_MODE]},{className:"type",begin://,keywords:"reified",relevance:0},{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:n,relevance:0,contains:[{begin:/:/,end:/[=,\/]/,endsWithParent:!0,contains:[u,e.C_LINE_COMMENT_MODE,d],relevance:0},e.C_LINE_COMMENT_MODE,d,s,c,a,e.C_NUMBER_MODE]},d]},{begin:[/class|interface|trait/,/\s+/,e.UNDERSCORE_IDENT_RE],beginScope:{3:"title.class"},keywords:"class interface trait",end:/[:\{(]|$/,excludeEnd:!0,illegal:"extends implements",contains:[{beginKeywords:"public protected internal private constructor"},e.UNDERSCORE_TITLE_MODE,{className:"type",begin://,excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:/[,:]\s*/,end:/[<\(,){\s]|$/,excludeBegin:!0,returnEnd:!0},s,c]},a,{className:"meta",begin:"^#!/usr/bin/env",end:"$",illegal:` -`},l]}}const Vf=e=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:e.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),Yf=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],Zf=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],Xf=[...Yf,...Zf],Qf=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),to=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),ro=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),jf=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse(),Jf=to.concat(ro).sort().reverse();function eg(e){const n=Vf(e),t=Jf,r="and or not only",i="[\\w-]+",o="("+i+"|@\\{"+i+"\\})",a=[],s=[],c=function(x){return{className:"string",begin:"~?"+x+".*?"+x}},l=function(x,O,R){return{className:x,begin:O,relevance:R}},d={$pattern:/[a-z-]+/,keyword:r,attribute:Qf.join(" ")},u={begin:"\\(",end:"\\)",contains:s,keywords:d,relevance:0};s.push(e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,c("'"),c('"'),n.CSS_NUMBER_MODE,{begin:"(url|data-uri)\\(",starts:{className:"string",end:"[\\)\\n]",excludeEnd:!0}},n.HEXCOLOR,u,l("variable","@@?"+i,10),l("variable","@\\{"+i+"\\}"),l("built_in","~?`[^`]*?`"),{className:"attribute",begin:i+"\\s*:",end:":",returnBegin:!0,excludeEnd:!0},n.IMPORTANT,{beginKeywords:"and not"},n.FUNCTION_DISPATCH);const f=s.concat({begin:/\{/,end:/\}/,contains:a}),p={beginKeywords:"when",endsWithParent:!0,contains:[{beginKeywords:"and not"}].concat(s)},g={begin:o+"\\s*:",returnBegin:!0,end:/[;}]/,relevance:0,contains:[{begin:/-(webkit|moz|ms|o)-/},n.CSS_VARIABLE,{className:"attribute",begin:"\\b("+jf.join("|")+")\\b",end:/(?=:)/,starts:{endsWithParent:!0,illegal:"[<=$]",relevance:0,contains:s}}]},_={className:"keyword",begin:"@(import|media|charset|font-face|(-[a-z]+-)?keyframes|supports|document|namespace|page|viewport|host)\\b",starts:{end:"[;{}]",keywords:d,returnEnd:!0,contains:s,relevance:0}},y={className:"variable",variants:[{begin:"@"+i+"\\s*:",relevance:15},{begin:"@"+i}],starts:{end:"[;}]",returnEnd:!0,contains:f}},E={variants:[{begin:"[\\.#:&\\[>]",end:"[;{}]"},{begin:o,end:/\{/}],returnBegin:!0,returnEnd:!0,illegal:`[<='$"]`,relevance:0,contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,p,l("keyword","all\\b"),l("variable","@\\{"+i+"\\}"),{begin:"\\b("+Xf.join("|")+")\\b",className:"selector-tag"},n.CSS_NUMBER_MODE,l("selector-tag",o,0),l("selector-id","#"+o),l("selector-class","\\."+o,0),l("selector-tag","&",0),n.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",begin:":("+to.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+ro.join("|")+")"},{begin:/\(/,end:/\)/,relevance:0,contains:f},{begin:"!important"},n.FUNCTION_DISPATCH]},N={begin:i+`:(:)?(${t.join("|")})`,returnBegin:!0,contains:[E]};return a.push(e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,_,y,N,g,E,p,n.FUNCTION_DISPATCH),{name:"Less",case_insensitive:!0,illegal:`[=>'/<($"]`,contains:a}}function ng(e){const n="\\[=*\\[",t="\\]=*\\]",r={begin:n,end:t,contains:["self"]},i=[e.COMMENT("--(?!"+n+")","$"),e.COMMENT("--"+n,t,{contains:[r],relevance:10})];return{name:"Lua",aliases:["pluto"],keywords:{$pattern:e.UNDERSCORE_IDENT_RE,literal:"true false nil",keyword:"and break do else elseif end for goto if in local not or repeat return then until while",built_in:"_G _ENV _VERSION __index __newindex __mode __call __metatable __tostring __len __gc __add __sub __mul __div __mod __pow __concat __unm __eq __lt __le assert collectgarbage dofile error getfenv getmetatable ipairs load loadfile loadstring module next pairs pcall print rawequal rawget rawset require select setfenv setmetatable tonumber tostring type unpack xpcall arg self coroutine resume yield status wrap create running debug getupvalue debug sethook getmetatable gethook setmetatable setlocal traceback setfenv getinfo setupvalue getlocal getregistry getfenv io lines write close flush open output type read stderr stdin input stdout popen tmpfile math log max acos huge ldexp pi cos tanh pow deg tan cosh sinh random randomseed frexp ceil floor rad abs sqrt modf asin min mod fmod log10 atan2 exp sin atan os exit setlocale date getenv difftime remove time clock tmpname rename execute package preload loadlib loaded loaders cpath config path seeall string sub upper len gfind rep find match char dump gmatch reverse byte format gsub lower table setn insert getn foreachi maxn foreach concat sort remove"},contains:i.concat([{className:"function",beginKeywords:"function",end:"\\)",contains:[e.inherit(e.TITLE_MODE,{begin:"([_a-zA-Z]\\w*\\.)*([_a-zA-Z]\\w*:)?[_a-zA-Z]\\w*"}),{className:"params",begin:"\\(",endsWithParent:!0,contains:i}].concat(i)},e.C_NUMBER_MODE,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,{className:"string",begin:n,end:t,contains:[r],relevance:5}])}}function tg(e){const n={className:"variable",variants:[{begin:"\\$\\("+e.UNDERSCORE_IDENT_RE+"\\)",contains:[e.BACKSLASH_ESCAPE]},{begin:/\$[@%",subLanguage:"xml",relevance:0},r={begin:"^[-\\*]{3,}",end:"$"},i={className:"code",variants:[{begin:"(`{3,})[^`](.|\\n)*?\\1`*[ ]*"},{begin:"(~{3,})[^~](.|\\n)*?\\1~*[ ]*"},{begin:"```",end:"```+[ ]*$"},{begin:"~~~",end:"~~~+[ ]*$"},{begin:"`.+?`"},{begin:"(?=^( {4}|\\t))",contains:[{begin:"^( {4}|\\t)",end:"(\\n)$"}],relevance:0}]},o={className:"bullet",begin:"^[ ]*([*+-]|(\\d+\\.))(?=\\s+)",end:"\\s+",excludeEnd:!0},a={begin:/^\[[^\n]+\]:/,returnBegin:!0,contains:[{className:"symbol",begin:/\[/,end:/\]/,excludeBegin:!0,excludeEnd:!0},{className:"link",begin:/:\s*/,end:/$/,excludeBegin:!0}]},s=/[A-Za-z][A-Za-z0-9+.-]*/,c={variants:[{begin:/\[.+?\]\[.*?\]/,relevance:0},{begin:/\[.+?\]\(((data|javascript|mailto):|(?:http|ftp)s?:\/\/).*?\)/,relevance:2},{begin:n.concat(/\[.+?\]\(/,s,/:\/\/.*?\)/),relevance:2},{begin:/\[.+?\]\([./?&#].*?\)/,relevance:1},{begin:/\[.*?\]\(.*?\)/,relevance:0}],returnBegin:!0,contains:[{match:/\[(?=\])/},{className:"string",relevance:0,begin:"\\[",end:"\\]",excludeBegin:!0,returnEnd:!0},{className:"link",relevance:0,begin:"\\]\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0},{className:"symbol",relevance:0,begin:"\\]\\[",end:"\\]",excludeBegin:!0,excludeEnd:!0}]},l={className:"strong",contains:[],variants:[{begin:/_{2}(?!\s)/,end:/_{2}/},{begin:/\*{2}(?!\s)/,end:/\*{2}/}]},d={className:"emphasis",contains:[],variants:[{begin:/\*(?![*\s])/,end:/\*/},{begin:/_(?![_\s])/,end:/_/,relevance:0}]},u=e.inherit(l,{contains:[]}),f=e.inherit(d,{contains:[]});l.contains.push(f),d.contains.push(u);let p=[t,c];return[l,d,u,f].forEach(E=>{E.contains=E.contains.concat(p)}),p=p.concat(l,d),{name:"Markdown",aliases:["md","mkdown","mkd"],contains:[{className:"section",variants:[{begin:"^#{1,6}",end:"$",contains:p},{begin:"(?=^.+?\\n[=-]{2,}$)",contains:[{begin:"^[=-]*$"},{begin:"^",end:"\\n",contains:p}]}]},t,o,l,d,{className:"quote",begin:"^>\\s+",contains:p,end:"$"},i,r,c,a,{scope:"literal",match:/&([a-zA-Z0-9]+|#[0-9]{1,7}|#[Xx][0-9a-fA-F]{1,6});/}]}}function ig(e){const n={className:"built_in",begin:"\\b(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)\\w+"},t=/[a-zA-Z@][a-zA-Z0-9_]*/,s={"variable.language":["this","super"],$pattern:t,keyword:["while","export","sizeof","typedef","const","struct","for","union","volatile","static","mutable","if","do","return","goto","enum","else","break","extern","asm","case","default","register","explicit","typename","switch","continue","inline","readonly","assign","readwrite","self","@synchronized","id","typeof","nonatomic","IBOutlet","IBAction","strong","weak","copy","in","out","inout","bycopy","byref","oneway","__strong","__weak","__block","__autoreleasing","@private","@protected","@public","@try","@property","@end","@throw","@catch","@finally","@autoreleasepool","@synthesize","@dynamic","@selector","@optional","@required","@encode","@package","@import","@defs","@compatibility_alias","__bridge","__bridge_transfer","__bridge_retained","__bridge_retain","__covariant","__contravariant","__kindof","_Nonnull","_Nullable","_Null_unspecified","__FUNCTION__","__PRETTY_FUNCTION__","__attribute__","getter","setter","retain","unsafe_unretained","nonnull","nullable","null_unspecified","null_resettable","class","instancetype","NS_DESIGNATED_INITIALIZER","NS_UNAVAILABLE","NS_REQUIRES_SUPER","NS_RETURNS_INNER_POINTER","NS_INLINE","NS_AVAILABLE","NS_DEPRECATED","NS_ENUM","NS_OPTIONS","NS_SWIFT_UNAVAILABLE","NS_ASSUME_NONNULL_BEGIN","NS_ASSUME_NONNULL_END","NS_REFINED_FOR_SWIFT","NS_SWIFT_NAME","NS_SWIFT_NOTHROW","NS_DURING","NS_HANDLER","NS_ENDHANDLER","NS_VALUERETURN","NS_VOIDRETURN"],literal:["false","true","FALSE","TRUE","nil","YES","NO","NULL"],built_in:["dispatch_once_t","dispatch_queue_t","dispatch_sync","dispatch_async","dispatch_once"],type:["int","float","char","unsigned","signed","short","long","double","wchar_t","unichar","void","bool","BOOL","id|0","_Bool"]},c={$pattern:t,keyword:["@interface","@class","@protocol","@implementation"]};return{name:"Objective-C",aliases:["mm","objc","obj-c","obj-c++","objective-c++"],keywords:s,illegal:"/,end:/$/,illegal:"\\n"},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{className:"class",begin:"("+c.keyword.join("|")+")\\b",end:/(\{|$)/,excludeEnd:!0,keywords:c,contains:[e.UNDERSCORE_TITLE_MODE]},{begin:"\\."+e.UNDERSCORE_IDENT_RE,relevance:0}]}}function ag(e){const n=e.regex,t=["abs","accept","alarm","and","atan2","bind","binmode","bless","break","caller","chdir","chmod","chomp","chop","chown","chr","chroot","class","close","closedir","connect","continue","cos","crypt","dbmclose","dbmopen","defined","delete","die","do","dump","each","else","elsif","endgrent","endhostent","endnetent","endprotoent","endpwent","endservent","eof","eval","exec","exists","exit","exp","fcntl","field","fileno","flock","for","foreach","fork","format","formline","getc","getgrent","getgrgid","getgrnam","gethostbyaddr","gethostbyname","gethostent","getlogin","getnetbyaddr","getnetbyname","getnetent","getpeername","getpgrp","getpriority","getprotobyname","getprotobynumber","getprotoent","getpwent","getpwnam","getpwuid","getservbyname","getservbyport","getservent","getsockname","getsockopt","given","glob","gmtime","goto","grep","gt","hex","if","index","int","ioctl","join","keys","kill","last","lc","lcfirst","length","link","listen","local","localtime","log","lstat","lt","ma","map","method","mkdir","msgctl","msgget","msgrcv","msgsnd","my","ne","next","no","not","oct","open","opendir","or","ord","our","pack","package","pipe","pop","pos","print","printf","prototype","push","q|0","qq","quotemeta","qw","qx","rand","read","readdir","readline","readlink","readpipe","recv","redo","ref","rename","require","reset","return","reverse","rewinddir","rindex","rmdir","say","scalar","seek","seekdir","select","semctl","semget","semop","send","setgrent","sethostent","setnetent","setpgrp","setpriority","setprotoent","setpwent","setservent","setsockopt","shift","shmctl","shmget","shmread","shmwrite","shutdown","sin","sleep","socket","socketpair","sort","splice","split","sprintf","sqrt","srand","stat","state","study","sub","substr","symlink","syscall","sysopen","sysread","sysseek","system","syswrite","tell","telldir","tie","tied","time","times","tr","truncate","uc","ucfirst","umask","undef","unless","unlink","unpack","unshift","untie","until","use","utime","values","vec","wait","waitpid","wantarray","warn","when","while","write","x|0","xor","y|0"],r=/[dualxmsipngr]{0,12}/,i={$pattern:/[\w.]+/,keyword:t.join(" ")},o={className:"subst",begin:"[$@]\\{",end:"\\}",keywords:i},a={begin:/->\{/,end:/\}/},s={scope:"attr",match:/\s+:\s*\w+(\s*\(.*?\))?/},c={scope:"variable",variants:[{begin:/\$\d/},{begin:n.concat(/[$%@](?!")(\^\w\b|#\w+(::\w+)*|\{\w+\}|\w+(::\w*)*)/,"(?![A-Za-z])(?![@$%])")},{begin:/[$%@](?!")[^\s\w{=]|\$=/,relevance:0}],contains:[s]},l={className:"number",variants:[{match:/0?\.[0-9][0-9_]+\b/},{match:/\bv?(0|[1-9][0-9_]*(\.[0-9_]+)?|[1-9][0-9_]*)\b/},{match:/\b0[0-7][0-7_]*\b/},{match:/\b0x[0-9a-fA-F][0-9a-fA-F_]*\b/},{match:/\b0b[0-1][0-1_]*\b/}],relevance:0},d=[e.BACKSLASH_ESCAPE,o,c],u=[/!/,/\//,/\|/,/\?/,/'/,/"/,/#/],f=(_,y,E="\\1")=>{const N=E==="\\1"?E:n.concat(E,y);return n.concat(n.concat("(?:",_,")"),y,/(?:\\.|[^\\\/])*?/,N,/(?:\\.|[^\\\/])*?/,E,r)},p=(_,y,E)=>n.concat(n.concat("(?:",_,")"),y,/(?:\\.|[^\\\/])*?/,E,r),g=[c,e.HASH_COMMENT_MODE,e.COMMENT(/^=\w/,/=cut/,{endsWithParent:!0}),a,{className:"string",contains:d,variants:[{begin:"q[qwxr]?\\s*\\(",end:"\\)",relevance:5},{begin:"q[qwxr]?\\s*\\[",end:"\\]",relevance:5},{begin:"q[qwxr]?\\s*\\{",end:"\\}",relevance:5},{begin:"q[qwxr]?\\s*\\|",end:"\\|",relevance:5},{begin:"q[qwxr]?\\s*<",end:">",relevance:5},{begin:"qw\\s+q",end:"q",relevance:5},{begin:"'",end:"'",contains:[e.BACKSLASH_ESCAPE]},{begin:'"',end:'"'},{begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE]},{begin:/\{\w+\}/,relevance:0},{begin:"-?\\w+\\s*=>",relevance:0}]},l,{begin:"(\\/\\/|"+e.RE_STARTERS_RE+"|\\b(split|return|print|reverse|grep)\\b)\\s*",keywords:"split return print reverse grep",relevance:0,contains:[e.HASH_COMMENT_MODE,{className:"regexp",variants:[{begin:f("s|tr|y",n.either(...u,{capture:!0}))},{begin:f("s|tr|y","\\(","\\)")},{begin:f("s|tr|y","\\[","\\]")},{begin:f("s|tr|y","\\{","\\}")}],relevance:2},{className:"regexp",variants:[{begin:/(m|qr)\/\//,relevance:0},{begin:p("(?:m|qr)?",/\//,/\//)},{begin:p("m|qr",n.either(...u,{capture:!0}),/\1/)},{begin:p("m|qr",/\(/,/\)/)},{begin:p("m|qr",/\[/,/\]/)},{begin:p("m|qr",/\{/,/\}/)}]}]},{className:"function",beginKeywords:"sub method",end:"(\\s*\\(.*?\\))?[;{]",excludeEnd:!0,relevance:5,contains:[e.TITLE_MODE,s]},{className:"class",beginKeywords:"class",end:"[;{]",excludeEnd:!0,relevance:5,contains:[e.TITLE_MODE,s,l]},{begin:"-\\w\\b",relevance:0},{begin:"^__DATA__$",end:"^__END__$",subLanguage:"mojolicious",contains:[{begin:"^@@.*",end:"$",className:"comment"}]}];return o.contains=g,a.contains=g,{name:"Perl",aliases:["pl","pm"],keywords:i,contains:g}}function og(e){const n=e.regex,t=/(?![A-Za-z0-9])(?![$])/,r=n.concat(/[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/,t),i=n.concat(/(\\?[A-Z][a-z0-9_\x7f-\xff]+|\\?[A-Z]+(?=[A-Z][a-z0-9_\x7f-\xff])){1,}/,t),o=n.concat(/[A-Z]+/,t),a={scope:"variable",match:"\\$+"+r},s={scope:"meta",variants:[{begin:/<\?php/,relevance:10},{begin:/<\?=/},{begin:/<\?/,relevance:.1},{begin:/\?>/}]},c={scope:"subst",variants:[{begin:/\$\w+/},{begin:/\{\$/,end:/\}/}]},l=e.inherit(e.APOS_STRING_MODE,{illegal:null}),d=e.inherit(e.QUOTE_STRING_MODE,{illegal:null,contains:e.QUOTE_STRING_MODE.contains.concat(c)}),u={begin:/<<<[ \t]*(?:(\w+)|"(\w+)")\n/,end:/[ \t]*(\w+)\b/,contains:e.QUOTE_STRING_MODE.contains.concat(c),"on:begin":(D,v)=>{v.data._beginMatch=D[1]||D[2]},"on:end":(D,v)=>{v.data._beginMatch!==D[1]&&v.ignoreMatch()}},f=e.END_SAME_AS_BEGIN({begin:/<<<[ \t]*'(\w+)'\n/,end:/[ \t]*(\w+)\b/}),p=`[ -]`,g={scope:"string",variants:[d,l,u,f]},_={scope:"number",variants:[{begin:"\\b0[bB][01]+(?:_[01]+)*\\b"},{begin:"\\b0[oO][0-7]+(?:_[0-7]+)*\\b"},{begin:"\\b0[xX][\\da-fA-F]+(?:_[\\da-fA-F]+)*\\b"},{begin:"(?:\\b\\d+(?:_\\d+)*(\\.(?:\\d+(?:_\\d+)*))?|\\B\\.\\d+)(?:[eE][+-]?\\d+)?"}],relevance:0},y=["false","null","true"],E=["__CLASS__","__DIR__","__FILE__","__FUNCTION__","__COMPILER_HALT_OFFSET__","__LINE__","__METHOD__","__NAMESPACE__","__TRAIT__","die","echo","exit","include","include_once","print","require","require_once","array","abstract","and","as","binary","bool","boolean","break","callable","case","catch","class","clone","const","continue","declare","default","do","double","else","elseif","empty","enddeclare","endfor","endforeach","endif","endswitch","endwhile","enum","eval","extends","final","finally","float","for","foreach","from","global","goto","if","implements","instanceof","insteadof","int","integer","interface","isset","iterable","list","match|0","mixed","new","never","object","or","private","protected","public","readonly","real","return","string","switch","throw","trait","try","unset","use","var","void","while","xor","yield"],N=["Error|0","AppendIterator","ArgumentCountError","ArithmeticError","ArrayIterator","ArrayObject","AssertionError","BadFunctionCallException","BadMethodCallException","CachingIterator","CallbackFilterIterator","CompileError","Countable","DirectoryIterator","DivisionByZeroError","DomainException","EmptyIterator","ErrorException","Exception","FilesystemIterator","FilterIterator","GlobIterator","InfiniteIterator","InvalidArgumentException","IteratorIterator","LengthException","LimitIterator","LogicException","MultipleIterator","NoRewindIterator","OutOfBoundsException","OutOfRangeException","OuterIterator","OverflowException","ParentIterator","ParseError","RangeException","RecursiveArrayIterator","RecursiveCachingIterator","RecursiveCallbackFilterIterator","RecursiveDirectoryIterator","RecursiveFilterIterator","RecursiveIterator","RecursiveIteratorIterator","RecursiveRegexIterator","RecursiveTreeIterator","RegexIterator","RuntimeException","SeekableIterator","SplDoublyLinkedList","SplFileInfo","SplFileObject","SplFixedArray","SplHeap","SplMaxHeap","SplMinHeap","SplObjectStorage","SplObserver","SplPriorityQueue","SplQueue","SplStack","SplSubject","SplTempFileObject","TypeError","UnderflowException","UnexpectedValueException","UnhandledMatchError","ArrayAccess","BackedEnum","Closure","Fiber","Generator","Iterator","IteratorAggregate","Serializable","Stringable","Throwable","Traversable","UnitEnum","WeakReference","WeakMap","Directory","__PHP_Incomplete_Class","parent","php_user_filter","self","static","stdClass"],O={keyword:E,literal:(D=>{const v=[];return D.forEach(Z=>{v.push(Z),Z.toLowerCase()===Z?v.push(Z.toUpperCase()):v.push(Z.toLowerCase())}),v})(y),built_in:N},R=D=>D.map(v=>v.replace(/\|\d+$/,"")),k={variants:[{match:[/new/,n.concat(p,"+"),n.concat("(?!",R(N).join("\\b|"),"\\b)"),i],scope:{1:"keyword",4:"title.class"}}]},U=n.concat(r,"\\b(?!\\()"),$={variants:[{match:[n.concat(/::/,n.lookahead(/(?!class\b)/)),U],scope:{2:"variable.constant"}},{match:[/::/,/class/],scope:{2:"variable.language"}},{match:[i,n.concat(/::/,n.lookahead(/(?!class\b)/)),U],scope:{1:"title.class",3:"variable.constant"}},{match:[i,n.concat("::",n.lookahead(/(?!class\b)/))],scope:{1:"title.class"}},{match:[i,/::/,/class/],scope:{1:"title.class",3:"variable.language"}}]},H={scope:"attr",match:n.concat(r,n.lookahead(":"),n.lookahead(/(?!::)/))},w={relevance:0,begin:/\(/,end:/\)/,keywords:O,contains:[H,a,$,e.C_BLOCK_COMMENT_MODE,g,_,k]},P={relevance:0,match:[/\b/,n.concat("(?!fn\\b|function\\b|",R(E).join("\\b|"),"|",R(N).join("\\b|"),"\\b)"),r,n.concat(p,"*"),n.lookahead(/(?=\()/)],scope:{3:"title.function.invoke"},contains:[w]};w.contains.push(P);const B=[H,$,e.C_BLOCK_COMMENT_MODE,g,_,k],J={begin:n.concat(/#\[\s*\\?/,n.either(i,o)),beginScope:"meta",end:/]/,endScope:"meta",keywords:{literal:y,keyword:["new","array"]},contains:[{begin:/\[/,end:/]/,keywords:{literal:y,keyword:["new","array"]},contains:["self",...B]},...B,{scope:"meta",variants:[{match:i},{match:o}]}]};return{case_insensitive:!1,keywords:O,contains:[J,e.HASH_COMMENT_MODE,e.COMMENT("//","$"),e.COMMENT("/\\*","\\*/",{contains:[{scope:"doctag",match:"@[A-Za-z]+"}]}),{match:/__halt_compiler\(\);/,keywords:"__halt_compiler",starts:{scope:"comment",end:e.MATCH_NOTHING_RE,contains:[{match:/\?>/,scope:"meta",endsParent:!0}]}},s,{scope:"variable.language",match:/\$this\b/},a,P,$,{match:[/const/,/\s/,r],scope:{1:"keyword",3:"variable.constant"}},k,{scope:"function",relevance:0,beginKeywords:"fn function",end:/[;{]/,excludeEnd:!0,illegal:"[$%\\[]",contains:[{beginKeywords:"use"},e.UNDERSCORE_TITLE_MODE,{begin:"=>",endsParent:!0},{scope:"params",begin:"\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0,keywords:O,contains:["self",J,a,$,e.C_BLOCK_COMMENT_MODE,g,_]}]},{scope:"class",variants:[{beginKeywords:"enum",illegal:/[($"]/},{beginKeywords:"class interface trait",illegal:/[:($"]/}],relevance:0,end:/\{/,excludeEnd:!0,contains:[{beginKeywords:"extends implements"},e.UNDERSCORE_TITLE_MODE]},{beginKeywords:"namespace",relevance:0,end:";",illegal:/[.']/,contains:[e.inherit(e.UNDERSCORE_TITLE_MODE,{scope:"title.class"})]},{beginKeywords:"use",relevance:0,end:";",contains:[{match:/\b(as|const|function)\b/,scope:"keyword"},e.UNDERSCORE_TITLE_MODE]},g,_]}}function sg(e){return{name:"PHP template",subLanguage:"xml",contains:[{begin:/<\?(php|=)?/,end:/\?>/,subLanguage:"php",contains:[{begin:"/\\*",end:"\\*/",skip:!0},{begin:'b"',end:'"',skip:!0},{begin:"b'",end:"'",skip:!0},e.inherit(e.APOS_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0}),e.inherit(e.QUOTE_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0})]}]}}function lg(e){return{name:"Plain text",aliases:["text","txt"],disableAutodetect:!0}}function cg(e){const n=e.regex,t=new RegExp("[\\p{XID_Start}_]\\p{XID_Continue}*","u"),r=["and","as","assert","async","await","break","case","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","match","nonlocal|10","not","or","pass","raise","return","try","while","with","yield"],s={$pattern:/[A-Za-z]\w+|__\w+__/,keyword:r,built_in:["__import__","abs","all","any","ascii","bin","bool","breakpoint","bytearray","bytes","callable","chr","classmethod","compile","complex","delattr","dict","dir","divmod","enumerate","eval","exec","filter","float","format","frozenset","getattr","globals","hasattr","hash","help","hex","id","input","int","isinstance","issubclass","iter","len","list","locals","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","range","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","vars","zip"],literal:["__debug__","Ellipsis","False","None","NotImplemented","True"],type:["Any","Callable","Coroutine","Dict","List","Literal","Generic","Optional","Sequence","Set","Tuple","Type","Union"]},c={className:"meta",begin:/^(>>>|\.\.\.) /},l={className:"subst",begin:/\{/,end:/\}/,keywords:s,illegal:/#/},d={begin:/\{\{/,relevance:0},u={className:"string",contains:[e.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,c],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,c],relevance:10},{begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,c,d,l]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,c,d,l]},{begin:/([uU]|[rR])'/,end:/'/,relevance:10},{begin:/([uU]|[rR])"/,end:/"/,relevance:10},{begin:/([bB]|[bB][rR]|[rR][bB])'/,end:/'/},{begin:/([bB]|[bB][rR]|[rR][bB])"/,end:/"/},{begin:/([fF][rR]|[rR][fF]|[fF])'/,end:/'/,contains:[e.BACKSLASH_ESCAPE,d,l]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,d,l]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},f="[0-9](_?[0-9])*",p=`(\\b(${f}))?\\.(${f})|\\b(${f})\\.`,g=`\\b|${r.join("|")}`,_={className:"number",relevance:0,variants:[{begin:`(\\b(${f})|(${p}))[eE][+-]?(${f})[jJ]?(?=${g})`},{begin:`(${p})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${g})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${g})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${g})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${g})`},{begin:`\\b(${f})[jJ](?=${g})`}]},y={className:"comment",begin:n.lookahead(/# type:/),end:/$/,keywords:s,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},E={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:s,contains:["self",c,_,u,e.HASH_COMMENT_MODE]}]};return l.contains=[u,_,c],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:s,illegal:/(<\/|\?)|=>/,contains:[c,_,{scope:"variable.language",match:/\bself\b/},{beginKeywords:"if",relevance:0},{match:/\bor\b/,scope:"keyword"},u,y,e.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,t],scope:{1:"keyword",3:"title.function"},contains:[E]},{variants:[{match:[/\bclass/,/\s+/,t,/\s*/,/\(\s*/,t,/\s*\)/]},{match:[/\bclass/,/\s+/,t]}],scope:{1:"keyword",3:"title.class",6:"title.class.inherited"}},{className:"meta",begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[_,E,u]}]}}function ug(e){return{aliases:["pycon"],contains:[{className:"meta.prompt",starts:{end:/ |$/,starts:{end:"$",subLanguage:"python"}},variants:[{begin:/^>>>(?=[ ]|$)/},{begin:/^\.\.\.(?=[ ]|$)/}]}]}}function dg(e){const n=e.regex,t=/(?:(?:[a-zA-Z]|\.[._a-zA-Z])[._a-zA-Z0-9]*)|\.(?!\d)/,r=n.either(/0[xX][0-9a-fA-F]+\.[0-9a-fA-F]*[pP][+-]?\d+i?/,/0[xX][0-9a-fA-F]+(?:[pP][+-]?\d+)?[Li]?/,/(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?[Li]?/),i=/[=!<>:]=|\|\||&&|:::?|<-|<<-|->>|->|\|>|[-+*\/?!$&|:<=>@^~]|\*\*/,o=n.either(/[()]/,/[{}]/,/\[\[/,/[[\]]/,/\\/,/,/);return{name:"R",keywords:{$pattern:t,keyword:"function if in break next repeat else for while",literal:"NULL NA TRUE FALSE Inf NaN NA_integer_|10 NA_real_|10 NA_character_|10 NA_complex_|10",built_in:"LETTERS letters month.abb month.name pi T F abs acos acosh all any anyNA Arg as.call as.character as.complex as.double as.environment as.integer as.logical as.null.default as.numeric as.raw asin asinh atan atanh attr attributes baseenv browser c call ceiling class Conj cos cosh cospi cummax cummin cumprod cumsum digamma dim dimnames emptyenv exp expression floor forceAndCall gamma gc.time globalenv Im interactive invisible is.array is.atomic is.call is.character is.complex is.double is.environment is.expression is.finite is.function is.infinite is.integer is.language is.list is.logical is.matrix is.na is.name is.nan is.null is.numeric is.object is.pairlist is.raw is.recursive is.single is.symbol lazyLoadDBfetch length lgamma list log max min missing Mod names nargs nzchar oldClass on.exit pos.to.env proc.time prod quote range Re rep retracemem return round seq_along seq_len seq.int sign signif sin sinh sinpi sqrt standardGeneric substitute sum switch tan tanh tanpi tracemem trigamma trunc unclass untracemem UseMethod xtfrm"},contains:[e.COMMENT(/#'/,/$/,{contains:[{scope:"doctag",match:/@examples/,starts:{end:n.lookahead(n.either(/\n^#'\s*(?=@[a-zA-Z]+)/,/\n^(?!#')/)),endsParent:!0}},{scope:"doctag",begin:"@param",end:/$/,contains:[{scope:"variable",variants:[{match:t},{match:/`(?:\\.|[^`\\])+`/}],endsParent:!0}]},{scope:"doctag",match:/@[a-zA-Z]+/},{scope:"keyword",match:/\\[a-zA-Z]+/}]}),e.HASH_COMMENT_MODE,{scope:"string",contains:[e.BACKSLASH_ESCAPE],variants:[e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\(/,end:/\)(-*)"/}),e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\{/,end:/\}(-*)"/}),e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\[/,end:/\](-*)"/}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\(/,end:/\)(-*)'/}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\{/,end:/\}(-*)'/}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\[/,end:/\](-*)'/}),{begin:'"',end:'"',relevance:0},{begin:"'",end:"'",relevance:0}]},{relevance:0,variants:[{scope:{1:"operator",2:"number"},match:[i,r]},{scope:{1:"operator",2:"number"},match:[/%[^%]*%/,r]},{scope:{1:"punctuation",2:"number"},match:[o,r]},{scope:{2:"number"},match:[/[^a-zA-Z0-9._]|^/,r]}]},{scope:{3:"operator"},match:[t,/\s+/,/<-/,/\s+/]},{scope:"operator",relevance:0,variants:[{match:i},{match:/%[^%]*%/}]},{scope:"punctuation",relevance:0,match:o},{begin:"`",end:"`",contains:[{begin:/\\./}]}]}}function pg(e){const n=e.regex,t="([a-zA-Z_]\\w*[!?=]?|[-+~]@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?)",r=n.either(/\b([A-Z]+[a-z0-9]+)+/,/\b([A-Z]+[a-z0-9]+)+[A-Z]+/),i=n.concat(r,/(::\w+)*/),a={"variable.constant":["__FILE__","__LINE__","__ENCODING__"],"variable.language":["self","super"],keyword:["alias","and","begin","BEGIN","break","case","class","defined","do","else","elsif","end","END","ensure","for","if","in","module","next","not","or","redo","require","rescue","retry","return","then","undef","unless","until","when","while","yield",...["include","extend","prepend","public","private","protected","raise","throw"]],built_in:["proc","lambda","attr_accessor","attr_reader","attr_writer","define_method","private_constant","module_function"],literal:["true","false","nil"]},s={className:"doctag",begin:"@[A-Za-z]+"},c={begin:"#<",end:">"},l=[e.COMMENT("#","$",{contains:[s]}),e.COMMENT("^=begin","^=end",{contains:[s],relevance:10}),e.COMMENT("^__END__",e.MATCH_NOTHING_RE)],d={className:"subst",begin:/#\{/,end:/\}/,keywords:a},u={className:"string",contains:[e.BACKSLASH_ESCAPE,d],variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/`/,end:/`/},{begin:/%[qQwWx]?\(/,end:/\)/},{begin:/%[qQwWx]?\[/,end:/\]/},{begin:/%[qQwWx]?\{/,end:/\}/},{begin:/%[qQwWx]?/},{begin:/%[qQwWx]?\//,end:/\//},{begin:/%[qQwWx]?%/,end:/%/},{begin:/%[qQwWx]?-/,end:/-/},{begin:/%[qQwWx]?\|/,end:/\|/},{begin:/\B\?(\\\d{1,3})/},{begin:/\B\?(\\x[A-Fa-f0-9]{1,2})/},{begin:/\B\?(\\u\{?[A-Fa-f0-9]{1,6}\}?)/},{begin:/\B\?(\\M-\\C-|\\M-\\c|\\c\\M-|\\M-|\\C-\\M-)[\x20-\x7e]/},{begin:/\B\?\\(c|C-)[\x20-\x7e]/},{begin:/\B\?\\?\S/},{begin:n.concat(/<<[-~]?'?/,n.lookahead(/(\w+)(?=\W)[^\n]*\n(?:[^\n]*\n)*?\s*\1\b/)),contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,contains:[e.BACKSLASH_ESCAPE,d]})]}]},f="[1-9](_?[0-9])*|0",p="[0-9](_?[0-9])*",g={className:"number",relevance:0,variants:[{begin:`\\b(${f})(\\.(${p}))?([eE][+-]?(${p})|r)?i?\\b`},{begin:"\\b0[dD][0-9](_?[0-9])*r?i?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*r?i?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*r?i?\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*r?i?\\b"},{begin:"\\b0(_?[0-7])+r?i?\\b"}]},_={variants:[{match:/\(\)/},{className:"params",begin:/\(/,end:/(?=\))/,excludeBegin:!0,endsParent:!0,keywords:a}]},k=[u,{variants:[{match:[/class\s+/,i,/\s+<\s+/,i]},{match:[/\b(class|module)\s+/,i]}],scope:{2:"title.class",4:"title.class.inherited"},keywords:a},{match:[/(include|extend)\s+/,i],scope:{2:"title.class"},keywords:a},{relevance:0,match:[i,/\.new[. (]/],scope:{1:"title.class"}},{relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"},{relevance:0,match:r,scope:"title.class"},{match:[/def/,/\s+/,t],scope:{1:"keyword",3:"title.function"},contains:[_]},{begin:e.IDENT_RE+"::"},{className:"symbol",begin:e.UNDERSCORE_IDENT_RE+"(!|\\?)?:",relevance:0},{className:"symbol",begin:":(?!\\s)",contains:[u,{begin:t}],relevance:0},g,{className:"variable",begin:"(\\$\\W)|((\\$|@@?)(\\w+))(?=[^@$?])(?![A-Za-z])(?![@$?'])"},{className:"params",begin:/\|(?!=)/,end:/\|/,excludeBegin:!0,excludeEnd:!0,relevance:0,keywords:a},{begin:"("+e.RE_STARTERS_RE+"|unless)\\s*",keywords:"unless",contains:[{className:"regexp",contains:[e.BACKSLASH_ESCAPE,d],illegal:/\n/,variants:[{begin:"/",end:"/[a-z]*"},{begin:/%r\{/,end:/\}[a-z]*/},{begin:"%r\\(",end:"\\)[a-z]*"},{begin:"%r!",end:"![a-z]*"},{begin:"%r\\[",end:"\\][a-z]*"}]}].concat(c,l),relevance:0}].concat(c,l);d.contains=k,_.contains=k;const w=[{begin:/^\s*=>/,starts:{end:"$",contains:k}},{className:"meta.prompt",begin:"^("+"[>?]>"+"|"+"[\\w#]+\\(\\w+\\):\\d+:\\d+[>*]"+"|"+"(\\w+-)?\\d+\\.\\d+\\.\\d+(p\\d+)?[^\\d][^>]+>"+")(?=[ ])",starts:{end:"$",keywords:a,contains:k}}];return l.unshift(c),{name:"Ruby",aliases:["rb","gemspec","podspec","thor","irb"],keywords:a,illegal:/\/\*/,contains:[e.SHEBANG({binary:"ruby"})].concat(w).concat(l).concat(k)}}function fg(e){const n=e.regex,t=/(r#)?/,r=n.concat(t,e.UNDERSCORE_IDENT_RE),i=n.concat(t,e.IDENT_RE),o={className:"title.function.invoke",relevance:0,begin:n.concat(/\b/,/(?!let|for|while|if|else|match\b)/,i,n.lookahead(/\s*\(/))},a="([ui](8|16|32|64|128|size)|f(32|64))?",s=["abstract","as","async","await","become","box","break","const","continue","crate","do","dyn","else","enum","extern","false","final","fn","for","if","impl","in","let","loop","macro","match","mod","move","mut","override","priv","pub","ref","return","self","Self","static","struct","super","trait","true","try","type","typeof","union","unsafe","unsized","use","virtual","where","while","yield"],c=["true","false","Some","None","Ok","Err"],l=["drop ","Copy","Send","Sized","Sync","Drop","Fn","FnMut","FnOnce","ToOwned","Clone","Debug","PartialEq","PartialOrd","Eq","Ord","AsRef","AsMut","Into","From","Default","Iterator","Extend","IntoIterator","DoubleEndedIterator","ExactSizeIterator","SliceConcatExt","ToString","assert!","assert_eq!","bitflags!","bytes!","cfg!","col!","concat!","concat_idents!","debug_assert!","debug_assert_eq!","env!","eprintln!","panic!","file!","format!","format_args!","include_bytes!","include_str!","line!","local_data_key!","module_path!","option_env!","print!","println!","select!","stringify!","try!","unimplemented!","unreachable!","vec!","write!","writeln!","macro_rules!","assert_ne!","debug_assert_ne!"],d=["i8","i16","i32","i64","i128","isize","u8","u16","u32","u64","u128","usize","f32","f64","str","char","bool","Box","Option","Result","String","Vec"];return{name:"Rust",aliases:["rs"],keywords:{$pattern:e.IDENT_RE+"!?",type:d,keyword:s,literal:c,built_in:l},illegal:""},o]}}const gg=e=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:e.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),mg=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],hg=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],bg=[...mg,...hg],Eg=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),_g=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),yg=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),kg=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse();function wg(e){const n=gg(e),t=yg,r=_g,i="@[a-z-]+",o="and or not only",s={className:"variable",begin:"(\\$"+"[a-zA-Z-][a-zA-Z0-9_-]*"+")\\b",relevance:0};return{name:"SCSS",case_insensitive:!0,illegal:"[=/|']",contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,n.CSS_NUMBER_MODE,{className:"selector-id",begin:"#[A-Za-z0-9_-]+",relevance:0},{className:"selector-class",begin:"\\.[A-Za-z0-9_-]+",relevance:0},n.ATTRIBUTE_SELECTOR_MODE,{className:"selector-tag",begin:"\\b("+bg.join("|")+")\\b",relevance:0},{className:"selector-pseudo",begin:":("+r.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+t.join("|")+")"},s,{begin:/\(/,end:/\)/,contains:[n.CSS_NUMBER_MODE]},n.CSS_VARIABLE,{className:"attribute",begin:"\\b("+kg.join("|")+")\\b"},{begin:"\\b(whitespace|wait|w-resize|visible|vertical-text|vertical-ideographic|uppercase|upper-roman|upper-alpha|underline|transparent|top|thin|thick|text|text-top|text-bottom|tb-rl|table-header-group|table-footer-group|sw-resize|super|strict|static|square|solid|small-caps|separate|se-resize|scroll|s-resize|rtl|row-resize|ridge|right|repeat|repeat-y|repeat-x|relative|progress|pointer|overline|outside|outset|oblique|nowrap|not-allowed|normal|none|nw-resize|no-repeat|no-drop|newspaper|ne-resize|n-resize|move|middle|medium|ltr|lr-tb|lowercase|lower-roman|lower-alpha|loose|list-item|line|line-through|line-edge|lighter|left|keep-all|justify|italic|inter-word|inter-ideograph|inside|inset|inline|inline-block|inherit|inactive|ideograph-space|ideograph-parenthesis|ideograph-numeric|ideograph-alpha|horizontal|hidden|help|hand|groove|fixed|ellipsis|e-resize|double|dotted|distribute|distribute-space|distribute-letter|distribute-all-lines|disc|disabled|default|decimal|dashed|crosshair|collapse|col-resize|circle|char|center|capitalize|break-word|break-all|bottom|both|bolder|bold|block|bidi-override|below|baseline|auto|always|all-scroll|absolute|table|table-cell)\\b"},{begin:/:/,end:/[;}{]/,relevance:0,contains:[n.BLOCK_COMMENT,s,n.HEXCOLOR,n.CSS_NUMBER_MODE,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,n.IMPORTANT,n.FUNCTION_DISPATCH]},{begin:"@(page|font-face)",keywords:{$pattern:i,keyword:"@page @font-face"}},{begin:"@",end:"[{;]",returnBegin:!0,keywords:{$pattern:/[a-z-]+/,keyword:o,attribute:Eg.join(" ")},contains:[{begin:i,className:"keyword"},{begin:/[a-z-]+(?=:)/,className:"attribute"},s,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,n.HEXCOLOR,n.CSS_NUMBER_MODE]},n.FUNCTION_DISPATCH]}}function xg(e){return{name:"Shell Session",aliases:["console","shellsession"],contains:[{className:"meta.prompt",begin:/^\s{0,3}[/~\w\d[\]()@-]*[>%$#][ ]?/,starts:{end:/[^\\](?=\s*$)/,subLanguage:"bash"}}]}}function Sg(e){const n=e.regex,t=e.COMMENT("--","$"),r={scope:"string",variants:[{begin:/'/,end:/'/,contains:[{match:/''/}]}]},i={begin:/"/,end:/"/,contains:[{match:/""/}]},o=["true","false","unknown"],a=["double precision","large object","with timezone","without timezone"],s=["bigint","binary","blob","boolean","char","character","clob","date","dec","decfloat","decimal","float","int","integer","interval","nchar","nclob","national","numeric","real","row","smallint","time","timestamp","varchar","varying","varbinary"],c=["add","asc","collation","desc","final","first","last","view"],l=["abs","acos","all","allocate","alter","and","any","are","array","array_agg","array_max_cardinality","as","asensitive","asin","asymmetric","at","atan","atomic","authorization","avg","begin","begin_frame","begin_partition","between","bigint","binary","blob","boolean","both","by","call","called","cardinality","cascaded","case","cast","ceil","ceiling","char","char_length","character","character_length","check","classifier","clob","close","coalesce","collate","collect","column","commit","condition","connect","constraint","contains","convert","copy","corr","corresponding","cos","cosh","count","covar_pop","covar_samp","create","cross","cube","cume_dist","current","current_catalog","current_date","current_default_transform_group","current_path","current_role","current_row","current_schema","current_time","current_timestamp","current_path","current_role","current_transform_group_for_type","current_user","cursor","cycle","date","day","deallocate","dec","decimal","decfloat","declare","default","define","delete","dense_rank","deref","describe","deterministic","disconnect","distinct","double","drop","dynamic","each","element","else","empty","end","end_frame","end_partition","end-exec","equals","escape","every","except","exec","execute","exists","exp","external","extract","false","fetch","filter","first_value","float","floor","for","foreign","frame_row","free","from","full","function","fusion","get","global","grant","group","grouping","groups","having","hold","hour","identity","in","indicator","initial","inner","inout","insensitive","insert","int","integer","intersect","intersection","interval","into","is","join","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","language","large","last_value","lateral","lead","leading","left","like","like_regex","listagg","ln","local","localtime","localtimestamp","log","log10","lower","match","match_number","match_recognize","matches","max","member","merge","method","min","minute","mod","modifies","module","month","multiset","national","natural","nchar","nclob","new","no","none","normalize","not","nth_value","ntile","null","nullif","numeric","octet_length","occurrences_regex","of","offset","old","omit","on","one","only","open","or","order","out","outer","over","overlaps","overlay","parameter","partition","pattern","per","percent","percent_rank","percentile_cont","percentile_disc","period","portion","position","position_regex","power","precedes","precision","prepare","primary","procedure","ptf","range","rank","reads","real","recursive","ref","references","referencing","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","release","result","return","returns","revoke","right","rollback","rollup","row","row_number","rows","running","savepoint","scope","scroll","search","second","seek","select","sensitive","session_user","set","show","similar","sin","sinh","skip","smallint","some","specific","specifictype","sql","sqlexception","sqlstate","sqlwarning","sqrt","start","static","stddev_pop","stddev_samp","submultiset","subset","substring","substring_regex","succeeds","sum","symmetric","system","system_time","system_user","table","tablesample","tan","tanh","then","time","timestamp","timezone_hour","timezone_minute","to","trailing","translate","translate_regex","translation","treat","trigger","trim","trim_array","true","truncate","uescape","union","unique","unknown","unnest","update","upper","user","using","value","values","value_of","var_pop","var_samp","varbinary","varchar","varying","versioning","when","whenever","where","width_bucket","window","with","within","without","year"],d=["abs","acos","array_agg","asin","atan","avg","cast","ceil","ceiling","coalesce","corr","cos","cosh","count","covar_pop","covar_samp","cume_dist","dense_rank","deref","element","exp","extract","first_value","floor","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","last_value","lead","listagg","ln","log","log10","lower","max","min","mod","nth_value","ntile","nullif","percent_rank","percentile_cont","percentile_disc","position","position_regex","power","rank","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","row_number","sin","sinh","sqrt","stddev_pop","stddev_samp","substring","substring_regex","sum","tan","tanh","translate","translate_regex","treat","trim","trim_array","unnest","upper","value_of","var_pop","var_samp","width_bucket"],u=["current_catalog","current_date","current_default_transform_group","current_path","current_role","current_schema","current_transform_group_for_type","current_user","session_user","system_time","system_user","current_time","localtime","current_timestamp","localtimestamp"],f=["create table","insert into","primary key","foreign key","not null","alter table","add constraint","grouping sets","on overflow","character set","respect nulls","ignore nulls","nulls first","nulls last","depth first","breadth first"],p=d,g=[...l,...c].filter(R=>!d.includes(R)),_={scope:"variable",match:/@[a-z0-9][a-z0-9_]*/},y={scope:"operator",match:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0},E={match:n.concat(/\b/,n.either(...p),/\s*\(/),relevance:0,keywords:{built_in:p}};function N(R){return n.concat(/\b/,n.either(...R.map(k=>k.replace(/\s+/,"\\s+"))),/\b/)}const x={scope:"keyword",match:N(f),relevance:0};function O(R,{exceptions:k,when:U}={}){const $=U;return k=k||[],R.map(H=>H.match(/\|\d+$/)||k.includes(H)?H:$(H)?`${H}|0`:H)}return{name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:O(g,{when:R=>R.length<3}),literal:o,type:s,built_in:u},contains:[{scope:"type",match:N(a)},x,E,_,r,i,e.C_NUMBER_MODE,e.C_BLOCK_COMMENT_MODE,t,y]}}function io(e){return e?typeof e=="string"?e:e.source:null}function $n(e){return ue("(?=",e,")")}function ue(...e){return e.map(t=>io(t)).join("")}function Ng(e){const n=e[e.length-1];return typeof n=="object"&&n.constructor===Object?(e.splice(e.length-1,1),n):{}}function Oe(...e){return"("+(Ng(e).capture?"":"?:")+e.map(r=>io(r)).join("|")+")"}const Or=e=>ue(/\b/,e,/\w$/.test(e)?/\b/:/\B/),Tg=["Protocol","Type"].map(Or),Fi=["init","self"].map(Or),Ag=["Any","Self"],Xt=["actor","any","associatedtype","async","await",/as\?/,/as!/,"as","borrowing","break","case","catch","class","consume","consuming","continue","convenience","copy","default","defer","deinit","didSet","distributed","do","dynamic","each","else","enum","extension","fallthrough",/fileprivate\(set\)/,"fileprivate","final","for","func","get","guard","if","import","indirect","infix",/init\?/,/init!/,"inout",/internal\(set\)/,"internal","in","is","isolated","nonisolated","lazy","let","macro","mutating","nonmutating",/open\(set\)/,"open","operator","optional","override","package","postfix","precedencegroup","prefix",/private\(set\)/,"private","protocol",/public\(set\)/,"public","repeat","required","rethrows","return","set","some","static","struct","subscript","super","switch","throws","throw",/try\?/,/try!/,"try","typealias",/unowned\(safe\)/,/unowned\(unsafe\)/,"unowned","var","weak","where","while","willSet"],zi=["false","nil","true"],vg=["assignment","associativity","higherThan","left","lowerThan","none","right"],Cg=["#colorLiteral","#column","#dsohandle","#else","#elseif","#endif","#error","#file","#fileID","#fileLiteral","#filePath","#function","#if","#imageLiteral","#keyPath","#line","#selector","#sourceLocation","#warning"],Ui=["abs","all","any","assert","assertionFailure","debugPrint","dump","fatalError","getVaList","isKnownUniquelyReferenced","max","min","numericCast","pointwiseMax","pointwiseMin","precondition","preconditionFailure","print","readLine","repeatElement","sequence","stride","swap","swift_unboxFromSwiftValueWithType","transcode","type","unsafeBitCast","unsafeDowncast","withExtendedLifetime","withUnsafeMutablePointer","withUnsafePointer","withVaList","withoutActuallyEscaping","zip"],ao=Oe(/[/=\-+!*%<>&|^~?]/,/[\u00A1-\u00A7]/,/[\u00A9\u00AB]/,/[\u00AC\u00AE]/,/[\u00B0\u00B1]/,/[\u00B6\u00BB\u00BF\u00D7\u00F7]/,/[\u2016-\u2017]/,/[\u2020-\u2027]/,/[\u2030-\u203E]/,/[\u2041-\u2053]/,/[\u2055-\u205E]/,/[\u2190-\u23FF]/,/[\u2500-\u2775]/,/[\u2794-\u2BFF]/,/[\u2E00-\u2E7F]/,/[\u3001-\u3003]/,/[\u3008-\u3020]/,/[\u3030]/),oo=Oe(ao,/[\u0300-\u036F]/,/[\u1DC0-\u1DFF]/,/[\u20D0-\u20FF]/,/[\uFE00-\uFE0F]/,/[\uFE20-\uFE2F]/),Qt=ue(ao,oo,"*"),so=Oe(/[a-zA-Z_]/,/[\u00A8\u00AA\u00AD\u00AF\u00B2-\u00B5\u00B7-\u00BA]/,/[\u00BC-\u00BE\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF]/,/[\u0100-\u02FF\u0370-\u167F\u1681-\u180D\u180F-\u1DBF]/,/[\u1E00-\u1FFF]/,/[\u200B-\u200D\u202A-\u202E\u203F-\u2040\u2054\u2060-\u206F]/,/[\u2070-\u20CF\u2100-\u218F\u2460-\u24FF\u2776-\u2793]/,/[\u2C00-\u2DFF\u2E80-\u2FFF]/,/[\u3004-\u3007\u3021-\u302F\u3031-\u303F\u3040-\uD7FF]/,/[\uF900-\uFD3D\uFD40-\uFDCF\uFDF0-\uFE1F\uFE30-\uFE44]/,/[\uFE47-\uFEFE\uFF00-\uFFFD]/),Et=Oe(so,/\d/,/[\u0300-\u036F\u1DC0-\u1DFF\u20D0-\u20FF\uFE20-\uFE2F]/),Ye=ue(so,Et,"*"),pt=ue(/[A-Z]/,Et,"*"),Og=["attached","autoclosure",ue(/convention\(/,Oe("swift","block","c"),/\)/),"discardableResult","dynamicCallable","dynamicMemberLookup","escaping","freestanding","frozen","GKInspectable","IBAction","IBDesignable","IBInspectable","IBOutlet","IBSegueAction","inlinable","main","nonobjc","NSApplicationMain","NSCopying","NSManaged",ue(/objc\(/,Ye,/\)/),"objc","objcMembers","propertyWrapper","requires_stored_property_inits","resultBuilder","Sendable","testable","UIApplicationMain","unchecked","unknown","usableFromInline","warn_unqualified_access"],Ig=["iOS","iOSApplicationExtension","macOS","macOSApplicationExtension","macCatalyst","macCatalystApplicationExtension","watchOS","watchOSApplicationExtension","tvOS","tvOSApplicationExtension","swift"];function Rg(e){const n={match:/\s+/,relevance:0},t=e.COMMENT("/\\*","\\*/",{contains:["self"]}),r=[e.C_LINE_COMMENT_MODE,t],i={match:[/\./,Oe(...Tg,...Fi)],className:{2:"keyword"}},o={match:ue(/\./,Oe(...Xt)),relevance:0},a=Xt.filter(ae=>typeof ae=="string").concat(["_|0"]),s=Xt.filter(ae=>typeof ae!="string").concat(Ag).map(Or),c={variants:[{className:"keyword",match:Oe(...s,...Fi)}]},l={$pattern:Oe(/\b\w+/,/#\w+/),keyword:a.concat(Cg),literal:zi},d=[i,o,c],u={match:ue(/\./,Oe(...Ui)),relevance:0},f={className:"built_in",match:ue(/\b/,Oe(...Ui),/(?=\()/)},p=[u,f],g={match:/->/,relevance:0},_={className:"operator",relevance:0,variants:[{match:Qt},{match:`\\.(\\.|${oo})+`}]},y=[g,_],E="([0-9]_*)+",N="([0-9a-fA-F]_*)+",x={className:"number",relevance:0,variants:[{match:`\\b(${E})(\\.(${E}))?([eE][+-]?(${E}))?\\b`},{match:`\\b0x(${N})(\\.(${N}))?([pP][+-]?(${E}))?\\b`},{match:/\b0o([0-7]_*)+\b/},{match:/\b0b([01]_*)+\b/}]},O=(ae="")=>({className:"subst",variants:[{match:ue(/\\/,ae,/[0\\tnr"']/)},{match:ue(/\\/,ae,/u\{[0-9a-fA-F]{1,8}\}/)}]}),R=(ae="")=>({className:"subst",match:ue(/\\/,ae,/[\t ]*(?:[\r\n]|\r\n)/)}),k=(ae="")=>({className:"subst",label:"interpol",begin:ue(/\\/,ae,/\(/),end:/\)/}),U=(ae="")=>({begin:ue(ae,/"""/),end:ue(/"""/,ae),contains:[O(ae),R(ae),k(ae)]}),$=(ae="")=>({begin:ue(ae,/"/),end:ue(/"/,ae),contains:[O(ae),k(ae)]}),H={className:"string",variants:[U(),U("#"),U("##"),U("###"),$(),$("#"),$("##"),$("###")]},w=[e.BACKSLASH_ESCAPE,{begin:/\[/,end:/\]/,relevance:0,contains:[e.BACKSLASH_ESCAPE]}],P={begin:/\/[^\s](?=[^/\n]*\/)/,end:/\//,contains:w},B=ae=>{const Je=ue(ae,/\//),en=ue(/\//,ae);return{begin:Je,end:en,contains:[...w,{scope:"comment",begin:`#(?!.*${en})`,end:/$/}]}},J={scope:"regexp",variants:[B("###"),B("##"),B("#"),P]},D={match:ue(/`/,Ye,/`/)},v={className:"variable",match:/\$\d+/},Z={className:"variable",match:`\\$${Et}+`},oe=[D,v,Z],X={match:/(@|#(un)?)available/,scope:"keyword",starts:{contains:[{begin:/\(/,end:/\)/,keywords:Ig,contains:[...y,x,H]}]}},de={scope:"keyword",match:ue(/@/,Oe(...Og),$n(Oe(/\(/,/\s+/)))},m={scope:"meta",match:ue(/@/,Ye)},ce=[X,de,m],pe={match:$n(/\b[A-Z]/),relevance:0,contains:[{className:"type",match:ue(/(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)/,Et,"+")},{className:"type",match:pt,relevance:0},{match:/[?!]+/,relevance:0},{match:/\.\.\./,relevance:0},{match:ue(/\s+&\s+/,$n(pt)),relevance:0}]},b={begin://,keywords:l,contains:[...r,...d,...ce,g,pe]};pe.contains.push(b);const ve={match:ue(Ye,/\s*:/),keywords:"_|0",relevance:0},$e={begin:/\(/,end:/\)/,relevance:0,keywords:l,contains:["self",ve,...r,J,...d,...p,...y,x,H,...oe,...ce,pe]},be={begin://,keywords:"repeat each",contains:[...r,pe]},Qe={begin:Oe($n(ue(Ye,/\s*:/)),$n(ue(Ye,/\s+/,Ye,/\s*:/))),end:/:/,relevance:0,contains:[{className:"keyword",match:/\b_\b/},{className:"params",match:Ye}]},De={begin:/\(/,end:/\)/,keywords:l,contains:[Qe,...r,...d,...y,x,H,...ce,pe,$e],endsParent:!0,illegal:/["']/},je={match:[/(func|macro)/,/\s+/,Oe(D.match,Ye,Qt)],className:{1:"keyword",3:"title.function"},contains:[be,De,n],illegal:[/\[/,/%/]},Le={match:[/\b(?:subscript|init[?!]?)/,/\s*(?=[<(])/],className:{1:"keyword"},contains:[be,De,n],illegal:/\[|%/},on={match:[/operator/,/\s+/,Qt],className:{1:"keyword",3:"title"}},Rn={begin:[/precedencegroup/,/\s+/,pt],className:{1:"keyword",3:"title"},contains:[pe],keywords:[...vg,...zi],end:/}/},Mn={match:[/class\b/,/\s+/,/func\b/,/\s+/,/\b[A-Za-z_][A-Za-z0-9_]*\b/],scope:{1:"keyword",3:"keyword",5:"title.function"}},Dn={match:[/class\b/,/\s+/,/var\b/],scope:{1:"keyword",3:"keyword"}},kn={begin:[/(struct|protocol|class|extension|enum|actor)/,/\s+/,Ye,/\s*/],beginScope:{1:"keyword",3:"title.class"},keywords:l,contains:[be,...d,{begin:/:/,end:/\{/,keywords:l,contains:[{scope:"title.class.inherited",match:pt},...d],relevance:0}]};for(const ae of H.variants){const Je=ae.contains.find(wn=>wn.label==="interpol");Je.keywords=l;const en=[...d,...p,...y,x,H,...oe];Je.contains=[...en,{begin:/\(/,end:/\)/,contains:["self",...en]}]}return{name:"Swift",keywords:l,contains:[...r,je,Le,Mn,Dn,kn,on,Rn,{beginKeywords:"import",end:/$/,contains:[...r],relevance:0},J,...d,...p,...y,x,H,...oe,...ce,pe,$e]}}const _t="[A-Za-z$_][0-9A-Za-z$_]*",lo=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],co=["true","false","null","undefined","NaN","Infinity"],uo=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],po=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],fo=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],go=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],mo=[].concat(fo,uo,po);function Mg(e){const n=e.regex,t=(X,{after:de})=>{const m="",end:""},o=/<[A-Za-z0-9\\._:-]+\s*\/>/,a={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(X,de)=>{const m=X[0].length+X.index,ce=X.input[m];if(ce==="<"||ce===","){de.ignoreMatch();return}ce===">"&&(t(X,{after:m})||de.ignoreMatch());let pe;const b=X.input.substring(m);if(pe=b.match(/^\s*=/)){de.ignoreMatch();return}if((pe=b.match(/^\s+extends\s+/))&&pe.index===0){de.ignoreMatch();return}}},s={$pattern:_t,keyword:lo,literal:co,built_in:mo,"variable.language":go},c="[0-9](_?[0-9])*",l=`\\.(${c})`,d="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",u={className:"number",variants:[{begin:`(\\b(${d})((${l})|\\.)?|(${l}))[eE][+-]?(${c})\\b`},{begin:`\\b(${d})\\b((${l})\\b|\\.)?|(${l})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},f={className:"subst",begin:"\\$\\{",end:"\\}",keywords:s,contains:[]},p={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,f],subLanguage:"xml"}},g={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,f],subLanguage:"css"}},_={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,f],subLanguage:"graphql"}},y={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,f]},N={className:"comment",variants:[e.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:r+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},x=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,g,_,y,{match:/\$\d+/},u];f.contains=x.concat({begin:/\{/,end:/\}/,keywords:s,contains:["self"].concat(x)});const O=[].concat(N,f.contains),R=O.concat([{begin:/(\s*)\(/,end:/\)/,keywords:s,contains:["self"].concat(O)}]),k={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:s,contains:R},U={variants:[{match:[/class/,/\s+/,r,/\s+/,/extends/,/\s+/,n.concat(r,"(",n.concat(/\./,r),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,r],scope:{1:"keyword",3:"title.class"}}]},$={relevance:0,match:n.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...uo,...po]}},H={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},w={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[k],illegal:/%/},P={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function B(X){return n.concat("(?!",X.join("|"),")")}const J={match:n.concat(/\b/,B([...fo,"super","import"].map(X=>`${X}\\s*\\(`)),r,n.lookahead(/\s*\(/)),className:"title.function",relevance:0},D={begin:n.concat(/\./,n.lookahead(n.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},v={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},k]},Z="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",oe={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,n.lookahead(Z)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[k]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:s,exports:{PARAMS_CONTAINS:R,CLASS_REFERENCE:$},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),H,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,g,_,y,N,{match:/\$\d+/},u,$,{scope:"attr",match:r+n.lookahead(":"),relevance:0},oe,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[N,e.REGEXP_MODE,{className:"function",begin:Z,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:s,contains:R}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:i.begin,end:i.end},{match:o},{begin:a.begin,"on:begin":a.isTrulyOpeningTag,end:a.end}],subLanguage:"xml",contains:[{begin:a.begin,end:a.end,skip:!0,contains:["self"]}]}]},w,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[k,e.inherit(e.TITLE_MODE,{begin:r,className:"title.function"})]},{match:/\.\.\./,relevance:0},D,{match:"\\$"+r,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[k]},J,P,U,v,{match:/\$[(.]/}]}}function Dg(e){const n=e.regex,t=Mg(e),r=_t,i=["any","void","number","boolean","string","object","never","symbol","bigint","unknown"],o={begin:[/namespace/,/\s+/,e.IDENT_RE],beginScope:{1:"keyword",3:"title.class"}},a={beginKeywords:"interface",end:/\{/,excludeEnd:!0,keywords:{keyword:"interface extends",built_in:i},contains:[t.exports.CLASS_REFERENCE]},s={className:"meta",relevance:10,begin:/^\s*['"]use strict['"]/},c=["type","interface","public","private","protected","implements","declare","abstract","readonly","enum","override","satisfies"],l={$pattern:_t,keyword:lo.concat(c),literal:co,built_in:mo.concat(i),"variable.language":go},d={className:"meta",begin:"@"+r},u=(_,y,E)=>{const N=_.contains.findIndex(x=>x.label===y);if(N===-1)throw new Error("can not find mode to replace");_.contains.splice(N,1,E)};Object.assign(t.keywords,l),t.exports.PARAMS_CONTAINS.push(d);const f=t.contains.find(_=>_.scope==="attr"),p=Object.assign({},f,{match:n.concat(r,n.lookahead(/\s*\?:/))});t.exports.PARAMS_CONTAINS.push([t.exports.CLASS_REFERENCE,f,p]),t.contains=t.contains.concat([d,o,a,p]),u(t,"shebang",e.SHEBANG()),u(t,"use_strict",s);const g=t.contains.find(_=>_.label==="func.def");return g.relevance=0,Object.assign(t,{name:"TypeScript",aliases:["ts","tsx","mts","cts"]}),t}function Lg(e){const n=e.regex,t={className:"string",begin:/"(""|[^/n])"C\b/},r={className:"string",begin:/"/,end:/"/,illegal:/\n/,contains:[{begin:/""/}]},i=/\d{1,2}\/\d{1,2}\/\d{4}/,o=/\d{4}-\d{1,2}-\d{1,2}/,a=/(\d|1[012])(:\d+){0,2} *(AM|PM)/,s=/\d{1,2}(:\d{1,2}){1,2}/,c={className:"literal",variants:[{begin:n.concat(/# */,n.either(o,i),/ *#/)},{begin:n.concat(/# */,s,/ *#/)},{begin:n.concat(/# */,a,/ *#/)},{begin:n.concat(/# */,n.either(o,i),/ +/,n.either(a,s),/ *#/)}]},l={className:"number",relevance:0,variants:[{begin:/\b\d[\d_]*((\.[\d_]+(E[+-]?[\d_]+)?)|(E[+-]?[\d_]+))[RFD@!#]?/},{begin:/\b\d[\d_]*((U?[SIL])|[%&])?/},{begin:/&H[\dA-F_]+((U?[SIL])|[%&])?/},{begin:/&O[0-7_]+((U?[SIL])|[%&])?/},{begin:/&B[01_]+((U?[SIL])|[%&])?/}]},d={className:"label",begin:/^\w+:/},u=e.COMMENT(/'''/,/$/,{contains:[{className:"doctag",begin:/<\/?/,end:/>/}]}),f=e.COMMENT(null,/$/,{variants:[{begin:/'/},{begin:/([\t ]|^)REM(?=\s)/}]});return{name:"Visual Basic .NET",aliases:["vb"],case_insensitive:!0,classNameAliases:{label:"symbol"},keywords:{keyword:"addhandler alias aggregate ansi as async assembly auto binary by byref byval call case catch class compare const continue custom declare default delegate dim distinct do each equals else elseif end enum erase error event exit explicit finally for friend from function get global goto group handles if implements imports in inherits interface into iterator join key let lib loop me mid module mustinherit mustoverride mybase myclass namespace narrowing new next notinheritable notoverridable of off on operator option optional order overloads overridable overrides paramarray partial preserve private property protected public raiseevent readonly redim removehandler resume return select set shadows shared skip static step stop structure strict sub synclock take text then throw to try unicode until using when where while widening with withevents writeonly yield",built_in:"addressof and andalso await directcast gettype getxmlnamespace is isfalse isnot istrue like mod nameof new not or orelse trycast typeof xor cbool cbyte cchar cdate cdbl cdec cint clng cobj csbyte cshort csng cstr cuint culng cushort",type:"boolean byte char date decimal double integer long object sbyte short single string uinteger ulong ushort",literal:"true false nothing"},illegal:"//|\\{|\\}|endif|gosub|variant|wend|^\\$ ",contains:[t,r,c,l,d,u,f,{className:"meta",begin:/[\t ]*#(const|disable|else|elseif|enable|end|externalsource|if|region)\b/,end:/$/,keywords:{keyword:"const disable else elseif enable end externalsource if region then"},contains:[f]}]}}function Pg(e){e.regex;const n=e.COMMENT(/\(;/,/;\)/);n.contains.push("self");const t=e.COMMENT(/;;/,/$/),r=["anyfunc","block","br","br_if","br_table","call","call_indirect","data","drop","elem","else","end","export","func","global.get","global.set","local.get","local.set","local.tee","get_global","get_local","global","if","import","local","loop","memory","memory.grow","memory.size","module","mut","nop","offset","param","result","return","select","set_global","set_local","start","table","tee_local","then","type","unreachable"],i={begin:[/(?:func|call|call_indirect)/,/\s+/,/\$[^\s)]+/],className:{1:"keyword",3:"title.function"}},o={className:"variable",begin:/\$[\w_]+/},a={match:/(\((?!;)|\))+/,className:"punctuation",relevance:0},s={className:"number",relevance:0,match:/[+-]?\b(?:\d(?:_?\d)*(?:\.\d(?:_?\d)*)?(?:[eE][+-]?\d(?:_?\d)*)?|0x[\da-fA-F](?:_?[\da-fA-F])*(?:\.[\da-fA-F](?:_?[\da-fA-D])*)?(?:[pP][+-]?\d(?:_?\d)*)?)\b|\binf\b|\bnan(?::0x[\da-fA-F](?:_?[\da-fA-D])*)?\b/},c={match:/(i32|i64|f32|f64)(?!\.)/,className:"type"},l={className:"keyword",match:/\b(f32|f64|i32|i64)(?:\.(?:abs|add|and|ceil|clz|const|convert_[su]\/i(?:32|64)|copysign|ctz|demote\/f64|div(?:_[su])?|eqz?|extend_[su]\/i32|floor|ge(?:_[su])?|gt(?:_[su])?|le(?:_[su])?|load(?:(?:8|16|32)_[su])?|lt(?:_[su])?|max|min|mul|nearest|neg?|or|popcnt|promote\/f32|reinterpret\/[fi](?:32|64)|rem_[su]|rot[lr]|shl|shr_[su]|store(?:8|16|32)?|sqrt|sub|trunc(?:_[su]\/f(?:32|64))?|wrap\/i64|xor))\b/};return{name:"WebAssembly",keywords:{$pattern:/[\w.]+/,keyword:r},contains:[t,n,{match:[/(?:offset|align)/,/\s*/,/=/],className:{1:"keyword",3:"operator"}},o,a,i,e.QUOTE_STRING_MODE,c,l,s]}}function Bg(e){const n=e.regex,t=n.concat(/[\p{L}_]/u,n.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),r=/[\p{L}0-9._:-]+/u,i={className:"symbol",begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},o={begin:/\s/,contains:[{className:"keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},a=e.inherit(o,{begin:/\(/,end:/\)/}),s=e.inherit(e.APOS_STRING_MODE,{className:"string"}),c=e.inherit(e.QUOTE_STRING_MODE,{className:"string"}),l={endsWithParent:!0,illegal:/`]+/}]}]}]};return{name:"HTML, XML",aliases:["html","xhtml","rss","atom","xjb","xsd","xsl","plist","wsf","svg"],case_insensitive:!0,unicodeRegex:!0,contains:[{className:"meta",begin://,relevance:10,contains:[o,c,s,a,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin://,contains:[o,a,c,s]}]}]},e.COMMENT(//,{relevance:10}),{begin://,relevance:10},i,{className:"meta",end:/\?>/,variants:[{begin:/<\?xml/,relevance:10,contains:[c]},{begin:/<\?[a-z][a-z0-9]+/}]},{className:"tag",begin:/)/,end:/>/,keywords:{name:"style"},contains:[l],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:["css","xml"]}},{className:"tag",begin:/)/,end:/>/,keywords:{name:"script"},contains:[l],starts:{end:/<\/script>/,returnEnd:!0,subLanguage:["javascript","handlebars","xml"]}},{className:"tag",begin:/<>|<\/>/},{className:"tag",begin:n.concat(//,/>/,/\s/)))),end:/\/?>/,contains:[{className:"name",begin:t,relevance:0,starts:l}]},{className:"tag",begin:n.concat(/<\//,n.lookahead(n.concat(t,/>/))),contains:[{className:"name",begin:t,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}}function Fg(e){const n="true false yes no null",t="[\\w#;/?:@&=+$,.~*'()[\\]]+",r={className:"attr",variants:[{begin:/[\w*@][\w*@ :()\./-]*:(?=[ \t]|$)/},{begin:/"[\w*@][\w*@ :()\./-]*":(?=[ \t]|$)/},{begin:/'[\w*@][\w*@ :()\./-]*':(?=[ \t]|$)/}]},i={className:"template-variable",variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]},o={className:"string",relevance:0,begin:/'/,end:/'/,contains:[{match:/''/,scope:"char.escape",relevance:0}]},a={className:"string",relevance:0,variants:[{begin:/"/,end:/"/},{begin:/\S+/}],contains:[e.BACKSLASH_ESCAPE,i]},s=e.inherit(a,{variants:[{begin:/'/,end:/'/,contains:[{begin:/''/,relevance:0}]},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),f={className:"number",begin:"\\b"+"[0-9]{4}(-[0-9][0-9]){0,2}"+"([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?"+"(\\.[0-9]*)?"+"([ \\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?"+"\\b"},p={end:",",endsWithParent:!0,excludeEnd:!0,keywords:n,relevance:0},g={begin:/\{/,end:/\}/,contains:[p],illegal:"\\n",relevance:0},_={begin:"\\[",end:"\\]",contains:[p],illegal:"\\n",relevance:0},y=[r,{className:"meta",begin:"^---\\s*$",relevance:10},{className:"string",begin:"[\\|>]([1-9]?[+-])?[ ]*\\n( +)[^ ][^\\n]*\\n(\\2[^\\n]+\\n?)*"},{begin:"<%[%=-]?",end:"[%-]?%>",subLanguage:"ruby",excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:"!\\w+!"+t},{className:"type",begin:"!<"+t+">"},{className:"type",begin:"!"+t},{className:"type",begin:"!!"+t},{className:"meta",begin:"&"+e.UNDERSCORE_IDENT_RE+"$"},{className:"meta",begin:"\\*"+e.UNDERSCORE_IDENT_RE+"$"},{className:"bullet",begin:"-(?=[ ]|$)",relevance:0},e.HASH_COMMENT_MODE,{beginKeywords:n,keywords:{literal:n}},f,{className:"number",begin:e.C_NUMBER_RE+"\\b",relevance:0},g,_,o,a],E=[...y];return E.pop(),E.push(s),p.contains=E,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:y}}const zg={arduino:yf,bash:kf,c:wf,cpp:xf,csharp:Sf,css:Mf,diff:Df,go:Lf,graphql:Pf,ini:Bf,java:Ff,javascript:Gf,json:Kf,kotlin:Wf,less:eg,lua:ng,makefile:tg,markdown:rg,objectivec:ig,perl:ag,php:og,"php-template":sg,plaintext:lg,python:cg,"python-repl":ug,r:dg,ruby:pg,rust:fg,scss:wg,shell:xg,sql:Sg,swift:Rg,typescript:Dg,vbnet:Lg,wasm:Pg,xml:Bg,yaml:Fg};var jt,$i;function Ug(){if($i)return jt;$i=1;function e(h){return h instanceof Map?h.clear=h.delete=h.set=function(){throw new Error("map is read-only")}:h instanceof Set&&(h.add=h.clear=h.delete=function(){throw new Error("set is read-only")}),Object.freeze(h),Object.getOwnPropertyNames(h).forEach(T=>{const M=h[T],Q=typeof M;(Q==="object"||Q==="function")&&!Object.isFrozen(M)&&e(M)}),h}class n{constructor(T){T.data===void 0&&(T.data={}),this.data=T.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function t(h){return h.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}function r(h,...T){const M=Object.create(null);for(const Q in h)M[Q]=h[Q];return T.forEach(function(Q){for(const Ee in Q)M[Ee]=Q[Ee]}),M}const i="",o=h=>!!h.scope,a=(h,{prefix:T})=>{if(h.startsWith("language:"))return h.replace("language:","language-");if(h.includes(".")){const M=h.split(".");return[`${T}${M.shift()}`,...M.map((Q,Ee)=>`${Q}${"_".repeat(Ee+1)}`)].join(" ")}return`${T}${h}`};class s{constructor(T,M){this.buffer="",this.classPrefix=M.classPrefix,T.walk(this)}addText(T){this.buffer+=t(T)}openNode(T){if(!o(T))return;const M=a(T.scope,{prefix:this.classPrefix});this.span(M)}closeNode(T){o(T)&&(this.buffer+=i)}value(){return this.buffer}span(T){this.buffer+=``}}const c=(h={})=>{const T={children:[]};return Object.assign(T,h),T};class l{constructor(){this.rootNode=c(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(T){this.top.children.push(T)}openNode(T){const M=c({scope:T});this.add(M),this.stack.push(M)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(T){return this.constructor._walk(T,this.rootNode)}static _walk(T,M){return typeof M=="string"?T.addText(M):M.children&&(T.openNode(M),M.children.forEach(Q=>this._walk(T,Q)),T.closeNode(M)),T}static _collapse(T){typeof T!="string"&&T.children&&(T.children.every(M=>typeof M=="string")?T.children=[T.children.join("")]:T.children.forEach(M=>{l._collapse(M)}))}}class d extends l{constructor(T){super(),this.options=T}addText(T){T!==""&&this.add(T)}startScope(T){this.openNode(T)}endScope(){this.closeNode()}__addSublanguage(T,M){const Q=T.root;M&&(Q.scope=`language:${M}`),this.add(Q)}toHTML(){return new s(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function u(h){return h?typeof h=="string"?h:h.source:null}function f(h){return _("(?=",h,")")}function p(h){return _("(?:",h,")*")}function g(h){return _("(?:",h,")?")}function _(...h){return h.map(M=>u(M)).join("")}function y(h){const T=h[h.length-1];return typeof T=="object"&&T.constructor===Object?(h.splice(h.length-1,1),T):{}}function E(...h){return"("+(y(h).capture?"":"?:")+h.map(Q=>u(Q)).join("|")+")"}function N(h){return new RegExp(h.toString()+"|").exec("").length-1}function x(h,T){const M=h&&h.exec(T);return M&&M.index===0}const O=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function R(h,{joinWith:T}){let M=0;return h.map(Q=>{M+=1;const Ee=M;let _e=u(Q),z="";for(;_e.length>0;){const F=O.exec(_e);if(!F){z+=_e;break}z+=_e.substring(0,F.index),_e=_e.substring(F.index+F[0].length),F[0][0]==="\\"&&F[1]?z+="\\"+String(Number(F[1])+Ee):(z+=F[0],F[0]==="("&&M++)}return z}).map(Q=>`(${Q})`).join(T)}const k=/\b\B/,U="[a-zA-Z]\\w*",$="[a-zA-Z_]\\w*",H="\\b\\d+(\\.\\d+)?",w="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",P="\\b(0b[01]+)",B="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",J=(h={})=>{const T=/^#![ ]*\//;return h.binary&&(h.begin=_(T,/.*\b/,h.binary,/\b.*/)),r({scope:"meta",begin:T,end:/$/,relevance:0,"on:begin":(M,Q)=>{M.index!==0&&Q.ignoreMatch()}},h)},D={begin:"\\\\[\\s\\S]",relevance:0},v={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[D]},Z={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[D]},oe={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},X=function(h,T,M={}){const Q=r({scope:"comment",begin:h,end:T,contains:[]},M);Q.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});const Ee=E("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return Q.contains.push({begin:_(/[ ]+/,"(",Ee,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),Q},de=X("//","$"),m=X("/\\*","\\*/"),ce=X("#","$"),pe={scope:"number",begin:H,relevance:0},b={scope:"number",begin:w,relevance:0},ve={scope:"number",begin:P,relevance:0},$e={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[D,{begin:/\[/,end:/\]/,relevance:0,contains:[D]}]},be={scope:"title",begin:U,relevance:0},Qe={scope:"title",begin:$,relevance:0},De={begin:"\\.\\s*"+$,relevance:0};var Le=Object.freeze({__proto__:null,APOS_STRING_MODE:v,BACKSLASH_ESCAPE:D,BINARY_NUMBER_MODE:ve,BINARY_NUMBER_RE:P,COMMENT:X,C_BLOCK_COMMENT_MODE:m,C_LINE_COMMENT_MODE:de,C_NUMBER_MODE:b,C_NUMBER_RE:w,END_SAME_AS_BEGIN:function(h){return Object.assign(h,{"on:begin":(T,M)=>{M.data._beginMatch=T[1]},"on:end":(T,M)=>{M.data._beginMatch!==T[1]&&M.ignoreMatch()}})},HASH_COMMENT_MODE:ce,IDENT_RE:U,MATCH_NOTHING_RE:k,METHOD_GUARD:De,NUMBER_MODE:pe,NUMBER_RE:H,PHRASAL_WORDS_MODE:oe,QUOTE_STRING_MODE:Z,REGEXP_MODE:$e,RE_STARTERS_RE:B,SHEBANG:J,TITLE_MODE:be,UNDERSCORE_IDENT_RE:$,UNDERSCORE_TITLE_MODE:Qe});function on(h,T){h.input[h.index-1]==="."&&T.ignoreMatch()}function Rn(h,T){h.className!==void 0&&(h.scope=h.className,delete h.className)}function Mn(h,T){T&&h.beginKeywords&&(h.begin="\\b("+h.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",h.__beforeBegin=on,h.keywords=h.keywords||h.beginKeywords,delete h.beginKeywords,h.relevance===void 0&&(h.relevance=0))}function Dn(h,T){Array.isArray(h.illegal)&&(h.illegal=E(...h.illegal))}function kn(h,T){if(h.match){if(h.begin||h.end)throw new Error("begin & end are not supported with match");h.begin=h.match,delete h.match}}function ae(h,T){h.relevance===void 0&&(h.relevance=1)}const Je=(h,T)=>{if(!h.beforeMatch)return;if(h.starts)throw new Error("beforeMatch cannot be used with starts");const M=Object.assign({},h);Object.keys(h).forEach(Q=>{delete h[Q]}),h.keywords=M.keywords,h.begin=_(M.beforeMatch,f(M.begin)),h.starts={relevance:0,contains:[Object.assign(M,{endsParent:!0})]},h.relevance=0,delete M.beforeMatch},en=["of","and","for","in","not","or","if","then","parent","list","value"],wn="keyword";function Ln(h,T,M=wn){const Q=Object.create(null);return typeof h=="string"?Ee(M,h.split(" ")):Array.isArray(h)?Ee(M,h):Object.keys(h).forEach(function(_e){Object.assign(Q,Ln(h[_e],T,_e))}),Q;function Ee(_e,z){T&&(z=z.map(F=>F.toLowerCase())),z.forEach(function(F){const V=F.split("|");Q[V[0]]=[_e,Nt(V[0],V[1])]})}}function Nt(h,T){return T?Number(T):Tt(h)?0:1}function Tt(h){return en.includes(h.toLowerCase())}const Qn={},nn=h=>{console.error(h)},jn=(h,...T)=>{console.log(`WARN: ${h}`,...T)},S=(h,T)=>{Qn[`${h}/${T}`]||(console.log(`Deprecated as of ${h}. ${T}`),Qn[`${h}/${T}`]=!0)},I=new Error;function W(h,T,{key:M}){let Q=0;const Ee=h[M],_e={},z={};for(let F=1;F<=T.length;F++)z[F+Q]=Ee[F],_e[F+Q]=!0,Q+=N(T[F-1]);h[M]=z,h[M]._emit=_e,h[M]._multi=!0}function ne(h){if(Array.isArray(h.begin)){if(h.skip||h.excludeBegin||h.returnBegin)throw nn("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),I;if(typeof h.beginScope!="object"||h.beginScope===null)throw nn("beginScope must be object"),I;W(h,h.begin,{key:"beginScope"}),h.begin=R(h.begin,{joinWith:""})}}function se(h){if(Array.isArray(h.end)){if(h.skip||h.excludeEnd||h.returnEnd)throw nn("skip, excludeEnd, returnEnd not compatible with endScope: {}"),I;if(typeof h.endScope!="object"||h.endScope===null)throw nn("endScope must be object"),I;W(h,h.end,{key:"endScope"}),h.end=R(h.end,{joinWith:""})}}function Pe(h){h.scope&&typeof h.scope=="object"&&h.scope!==null&&(h.beginScope=h.scope,delete h.scope)}function tn(h){Pe(h),typeof h.beginScope=="string"&&(h.beginScope={_wrap:h.beginScope}),typeof h.endScope=="string"&&(h.endScope={_wrap:h.endScope}),ne(h),se(h)}function Ge(h){function T(z,F){return new RegExp(u(z),"m"+(h.case_insensitive?"i":"")+(h.unicodeRegex?"u":"")+(F?"g":""))}class M{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(F,V){V.position=this.position++,this.matchIndexes[this.matchAt]=V,this.regexes.push([V,F]),this.matchAt+=N(F)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const F=this.regexes.map(V=>V[1]);this.matcherRe=T(R(F,{joinWith:"|"}),!0),this.lastIndex=0}exec(F){this.matcherRe.lastIndex=this.lastIndex;const V=this.matcherRe.exec(F);if(!V)return null;const xe=V.findIndex((Pn,At)=>At>0&&Pn!==void 0),ye=this.matchIndexes[xe];return V.splice(0,xe),Object.assign(V,ye)}}class Q{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(F){if(this.multiRegexes[F])return this.multiRegexes[F];const V=new M;return this.rules.slice(F).forEach(([xe,ye])=>V.addRule(xe,ye)),V.compile(),this.multiRegexes[F]=V,V}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(F,V){this.rules.push([F,V]),V.type==="begin"&&this.count++}exec(F){const V=this.getMatcher(this.regexIndex);V.lastIndex=this.lastIndex;let xe=V.exec(F);if(this.resumingScanAtSamePosition()&&!(xe&&xe.index===this.lastIndex)){const ye=this.getMatcher(0);ye.lastIndex=this.lastIndex+1,xe=ye.exec(F)}return xe&&(this.regexIndex+=xe.position+1,this.regexIndex===this.count&&this.considerAll()),xe}}function Ee(z){const F=new Q;return z.contains.forEach(V=>F.addRule(V.begin,{rule:V,type:"begin"})),z.terminatorEnd&&F.addRule(z.terminatorEnd,{type:"end"}),z.illegal&&F.addRule(z.illegal,{type:"illegal"}),F}function _e(z,F){const V=z;if(z.isCompiled)return V;[Rn,kn,tn,Je].forEach(ye=>ye(z,F)),h.compilerExtensions.forEach(ye=>ye(z,F)),z.__beforeBegin=null,[Mn,Dn,ae].forEach(ye=>ye(z,F)),z.isCompiled=!0;let xe=null;return typeof z.keywords=="object"&&z.keywords.$pattern&&(z.keywords=Object.assign({},z.keywords),xe=z.keywords.$pattern,delete z.keywords.$pattern),xe=xe||/\w+/,z.keywords&&(z.keywords=Ln(z.keywords,h.case_insensitive)),V.keywordPatternRe=T(xe,!0),F&&(z.begin||(z.begin=/\B|\b/),V.beginRe=T(V.begin),!z.end&&!z.endsWithParent&&(z.end=/\B|\b/),z.end&&(V.endRe=T(V.end)),V.terminatorEnd=u(V.end)||"",z.endsWithParent&&F.terminatorEnd&&(V.terminatorEnd+=(z.end?"|":"")+F.terminatorEnd)),z.illegal&&(V.illegalRe=T(z.illegal)),z.contains||(z.contains=[]),z.contains=[].concat(...z.contains.map(function(ye){return fn(ye==="self"?z:ye)})),z.contains.forEach(function(ye){_e(ye,V)}),z.starts&&_e(z.starts,F),V.matcher=Ee(V),V}if(h.compilerExtensions||(h.compilerExtensions=[]),h.contains&&h.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return h.classNameAliases=r(h.classNameAliases||{}),_e(h)}function sn(h){return h?h.endsWithParent||sn(h.starts):!1}function fn(h){return h.variants&&!h.cachedVariants&&(h.cachedVariants=h.variants.map(function(T){return r(h,{variants:null},T)})),h.cachedVariants?h.cachedVariants:sn(h)?r(h,{starts:h.starts?r(h.starts):null}):Object.isFrozen(h)?r(h):h}var Ce="11.11.1";class ln extends Error{constructor(T,M){super(T),this.name="HTMLInjectionError",this.html=M}}const Be=t,Ir=r,Rr=Symbol("nomatch"),ho=7,Mr=function(h){const T=Object.create(null),M=Object.create(null),Q=[];let Ee=!0;const _e="Could not find the language '{}', did you forget to load/include a language module?",z={disableAutodetect:!0,name:"Plain text",contains:[]};let F={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:d};function V(C){return F.noHighlightRe.test(C)}function xe(C){let K=C.className+" ";K+=C.parentNode?C.parentNode.className:"";const re=F.languageDetectRe.exec(K);if(re){const me=cn(re[1]);return me||(jn(_e.replace("{}",re[1])),jn("Falling back to no-highlight mode for this block.",C)),me?re[1]:"no-highlight"}return K.split(/\s+/).find(me=>V(me)||cn(me))}function ye(C,K,re){let me="",we="";typeof K=="object"?(me=C,re=K.ignoreIllegals,we=K.language):(S("10.7.0","highlight(lang, code, ...args) has been deprecated."),S("10.7.0",`Please use highlight(code, options) instead. -https://github.com/highlightjs/highlight.js/issues/2277`),we=C,me=K),re===void 0&&(re=!0);const Ke={code:me,language:we};et("before:highlight",Ke);const un=Ke.result?Ke.result:Pn(Ke.language,Ke.code,re);return un.code=Ke.code,et("after:highlight",un),un}function Pn(C,K,re,me){const we=Object.create(null);function Ke(L,G){return L.keywords[G]}function un(){if(!j.keywords){Se.addText(he);return}let L=0;j.keywordPatternRe.lastIndex=0;let G=j.keywordPatternRe.exec(he),ee="";for(;G;){ee+=he.substring(L,G.index);const le=Ve.case_insensitive?G[0].toLowerCase():G[0],Ne=Ke(j,le);if(Ne){const[rn,Mo]=Ne;if(Se.addText(ee),ee="",we[le]=(we[le]||0)+1,we[le]<=ho&&(rt+=Mo),rn.startsWith("_"))ee+=G[0];else{const Do=Ve.classNameAliases[rn]||rn;We(G[0],Do)}}else ee+=G[0];L=j.keywordPatternRe.lastIndex,G=j.keywordPatternRe.exec(he)}ee+=he.substring(L),Se.addText(ee)}function nt(){if(he==="")return;let L=null;if(typeof j.subLanguage=="string"){if(!T[j.subLanguage]){Se.addText(he);return}L=Pn(j.subLanguage,he,!0,$r[j.subLanguage]),$r[j.subLanguage]=L._top}else L=vt(he,j.subLanguage.length?j.subLanguage:null);j.relevance>0&&(rt+=L.relevance),Se.__addSublanguage(L._emitter,L.language)}function Fe(){j.subLanguage!=null?nt():un(),he=""}function We(L,G){L!==""&&(Se.startScope(G),Se.addText(L),Se.endScope())}function Br(L,G){let ee=1;const le=G.length-1;for(;ee<=le;){if(!L._emit[ee]){ee++;continue}const Ne=Ve.classNameAliases[L[ee]]||L[ee],rn=G[ee];Ne?We(rn,Ne):(he=rn,un(),he=""),ee++}}function Fr(L,G){return L.scope&&typeof L.scope=="string"&&Se.openNode(Ve.classNameAliases[L.scope]||L.scope),L.beginScope&&(L.beginScope._wrap?(We(he,Ve.classNameAliases[L.beginScope._wrap]||L.beginScope._wrap),he=""):L.beginScope._multi&&(Br(L.beginScope,G),he="")),j=Object.create(L,{parent:{value:j}}),j}function zr(L,G,ee){let le=x(L.endRe,ee);if(le){if(L["on:end"]){const Ne=new n(L);L["on:end"](G,Ne),Ne.isMatchIgnored&&(le=!1)}if(le){for(;L.endsParent&&L.parent;)L=L.parent;return L}}if(L.endsWithParent)return zr(L.parent,G,ee)}function vo(L){return j.matcher.regexIndex===0?(he+=L[0],1):(Rt=!0,0)}function Co(L){const G=L[0],ee=L.rule,le=new n(ee),Ne=[ee.__beforeBegin,ee["on:begin"]];for(const rn of Ne)if(rn&&(rn(L,le),le.isMatchIgnored))return vo(G);return ee.skip?he+=G:(ee.excludeBegin&&(he+=G),Fe(),!ee.returnBegin&&!ee.excludeBegin&&(he=G)),Fr(ee,L),ee.returnBegin?0:G.length}function Oo(L){const G=L[0],ee=K.substring(L.index),le=zr(j,L,ee);if(!le)return Rr;const Ne=j;j.endScope&&j.endScope._wrap?(Fe(),We(G,j.endScope._wrap)):j.endScope&&j.endScope._multi?(Fe(),Br(j.endScope,L)):Ne.skip?he+=G:(Ne.returnEnd||Ne.excludeEnd||(he+=G),Fe(),Ne.excludeEnd&&(he=G));do j.scope&&Se.closeNode(),!j.skip&&!j.subLanguage&&(rt+=j.relevance),j=j.parent;while(j!==le.parent);return le.starts&&Fr(le.starts,L),Ne.returnEnd?0:G.length}function Io(){const L=[];for(let G=j;G!==Ve;G=G.parent)G.scope&&L.unshift(G.scope);L.forEach(G=>Se.openNode(G))}let tt={};function Ur(L,G){const ee=G&&G[0];if(he+=L,ee==null)return Fe(),0;if(tt.type==="begin"&&G.type==="end"&&tt.index===G.index&&ee===""){if(he+=K.slice(G.index,G.index+1),!Ee){const le=new Error(`0 width match regex (${C})`);throw le.languageName=C,le.badRule=tt.rule,le}return 1}if(tt=G,G.type==="begin")return Co(G);if(G.type==="illegal"&&!re){const le=new Error('Illegal lexeme "'+ee+'" for mode "'+(j.scope||"")+'"');throw le.mode=j,le}else if(G.type==="end"){const le=Oo(G);if(le!==Rr)return le}if(G.type==="illegal"&&ee==="")return he+=` -`,1;if(It>1e5&&It>G.index*3)throw new Error("potential infinite loop, way more iterations than matches");return he+=ee,ee.length}const Ve=cn(C);if(!Ve)throw nn(_e.replace("{}",C)),new Error('Unknown language: "'+C+'"');const Ro=Ge(Ve);let Ot="",j=me||Ro;const $r={},Se=new F.__emitter(F);Io();let he="",rt=0,gn=0,It=0,Rt=!1;try{if(Ve.__emitTokens)Ve.__emitTokens(K,Se);else{for(j.matcher.considerAll();;){It++,Rt?Rt=!1:j.matcher.considerAll(),j.matcher.lastIndex=gn;const L=j.matcher.exec(K);if(!L)break;const G=K.substring(gn,L.index),ee=Ur(G,L);gn=L.index+ee}Ur(K.substring(gn))}return Se.finalize(),Ot=Se.toHTML(),{language:C,value:Ot,relevance:rt,illegal:!1,_emitter:Se,_top:j}}catch(L){if(L.message&&L.message.includes("Illegal"))return{language:C,value:Be(K),illegal:!0,relevance:0,_illegalBy:{message:L.message,index:gn,context:K.slice(gn-100,gn+100),mode:L.mode,resultSoFar:Ot},_emitter:Se};if(Ee)return{language:C,value:Be(K),illegal:!1,relevance:0,errorRaised:L,_emitter:Se,_top:j};throw L}}function At(C){const K={value:Be(C),illegal:!1,relevance:0,_top:z,_emitter:new F.__emitter(F)};return K._emitter.addText(C),K}function vt(C,K){K=K||F.languages||Object.keys(T);const re=At(C),me=K.filter(cn).filter(Pr).map(Fe=>Pn(Fe,C,!1));me.unshift(re);const we=me.sort((Fe,We)=>{if(Fe.relevance!==We.relevance)return We.relevance-Fe.relevance;if(Fe.language&&We.language){if(cn(Fe.language).supersetOf===We.language)return 1;if(cn(We.language).supersetOf===Fe.language)return-1}return 0}),[Ke,un]=we,nt=Ke;return nt.secondBest=un,nt}function bo(C,K,re){const me=K&&M[K]||re;C.classList.add("hljs"),C.classList.add(`language-${me}`)}function Ct(C){let K=null;const re=xe(C);if(V(re))return;if(et("before:highlightElement",{el:C,language:re}),C.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",C);return}if(C.children.length>0&&(F.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn(C)),F.throwUnescapedHTML))throw new ln("One of your code blocks includes unescaped HTML.",C.innerHTML);K=C;const me=K.textContent,we=re?ye(me,{language:re,ignoreIllegals:!0}):vt(me);C.innerHTML=we.value,C.dataset.highlighted="yes",bo(C,re,we.language),C.result={language:we.language,re:we.relevance,relevance:we.relevance},we.secondBest&&(C.secondBest={language:we.secondBest.language,relevance:we.secondBest.relevance}),et("after:highlightElement",{el:C,result:we,text:me})}function Eo(C){F=Ir(F,C)}const _o=()=>{Jn(),S("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function yo(){Jn(),S("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let Dr=!1;function Jn(){function C(){Jn()}if(document.readyState==="loading"){Dr||window.addEventListener("DOMContentLoaded",C,!1),Dr=!0;return}document.querySelectorAll(F.cssSelector).forEach(Ct)}function ko(C,K){let re=null;try{re=K(h)}catch(me){if(nn("Language definition for '{}' could not be registered.".replace("{}",C)),Ee)nn(me);else throw me;re=z}re.name||(re.name=C),T[C]=re,re.rawDefinition=K.bind(null,h),re.aliases&&Lr(re.aliases,{languageName:C})}function wo(C){delete T[C];for(const K of Object.keys(M))M[K]===C&&delete M[K]}function xo(){return Object.keys(T)}function cn(C){return C=(C||"").toLowerCase(),T[C]||T[M[C]]}function Lr(C,{languageName:K}){typeof C=="string"&&(C=[C]),C.forEach(re=>{M[re.toLowerCase()]=K})}function Pr(C){const K=cn(C);return K&&!K.disableAutodetect}function So(C){C["before:highlightBlock"]&&!C["before:highlightElement"]&&(C["before:highlightElement"]=K=>{C["before:highlightBlock"](Object.assign({block:K.el},K))}),C["after:highlightBlock"]&&!C["after:highlightElement"]&&(C["after:highlightElement"]=K=>{C["after:highlightBlock"](Object.assign({block:K.el},K))})}function No(C){So(C),Q.push(C)}function To(C){const K=Q.indexOf(C);K!==-1&&Q.splice(K,1)}function et(C,K){const re=C;Q.forEach(function(me){me[re]&&me[re](K)})}function Ao(C){return S("10.7.0","highlightBlock will be removed entirely in v12.0"),S("10.7.0","Please use highlightElement now."),Ct(C)}Object.assign(h,{highlight:ye,highlightAuto:vt,highlightAll:Jn,highlightElement:Ct,highlightBlock:Ao,configure:Eo,initHighlighting:_o,initHighlightingOnLoad:yo,registerLanguage:ko,unregisterLanguage:wo,listLanguages:xo,getLanguage:cn,registerAliases:Lr,autoDetection:Pr,inherit:Ir,addPlugin:No,removePlugin:To}),h.debugMode=function(){Ee=!1},h.safeMode=function(){Ee=!0},h.versionString=Ce,h.regex={concat:_,lookahead:f,either:E,optional:g,anyNumberOfTimes:p};for(const C in Le)typeof Le[C]=="object"&&e(Le[C]);return Object.assign(h,Le),h},xn=Mr({});return xn.newInstance=()=>Mr({}),jt=xn,xn.HighlightJS=xn,xn.default=xn,jt}var $g=Ug();const Hg=dr($g),Hi={},Gg="hljs-";function Kg(e){const n=Hg.newInstance();return e&&o(e),{highlight:t,highlightAuto:r,listLanguages:i,register:o,registerAlias:a,registered:s};function t(c,l,d){const u=d||Hi,f=typeof u.prefix=="string"?u.prefix:Gg;if(!n.getLanguage(c))throw new Error("Unknown language: `"+c+"` is not registered");n.configure({__emitter:qg,classPrefix:f});const p=n.highlight(l,{ignoreIllegals:!0,language:c});if(p.errorRaised)throw new Error("Could not highlight with `Highlight.js`",{cause:p.errorRaised});const g=p._emitter.root,_=g.data;return _.language=p.language,_.relevance=p.relevance,g}function r(c,l){const u=(l||Hi).subset||i();let f=-1,p=0,g;for(;++fp&&(p=y.data.relevance,g=y)}return g||{type:"root",children:[],data:{language:void 0,relevance:p}}}function i(){return n.listLanguages()}function o(c,l){if(typeof c=="string")n.registerLanguage(c,l);else{let d;for(d in c)Object.hasOwn(c,d)&&n.registerLanguage(d,c[d])}}function a(c,l){if(typeof c=="string")n.registerAliases(typeof l=="string"?l:[...l],{languageName:c});else{let d;for(d in c)if(Object.hasOwn(c,d)){const u=c[d];n.registerAliases(typeof u=="string"?u:[...u],{languageName:d})}}}function s(c){return!!n.getLanguage(c)}}class qg{constructor(n){this.options=n,this.root={type:"root",children:[],data:{language:void 0,relevance:0}},this.stack=[this.root]}addText(n){if(n==="")return;const t=this.stack[this.stack.length-1],r=t.children[t.children.length-1];r&&r.type==="text"?r.value+=n:t.children.push({type:"text",value:n})}startScope(n){this.openNode(String(n))}endScope(){this.closeNode()}__addSublanguage(n,t){const r=this.stack[this.stack.length-1],i=n.root.children;t?r.children.push({type:"element",tagName:"span",properties:{className:[t]},children:i}):r.children.push(...i)}openNode(n){const t=this,r=n.split(".").map(function(a,s){return s?a+"_".repeat(s):t.options.classPrefix+a}),i=this.stack[this.stack.length-1],o={type:"element",tagName:"span",properties:{className:r},children:[]};i.children.push(o),this.stack.push(o)}closeNode(){this.stack.pop()}finalize(){}toHTML(){return""}}const Wg={};function Vg(e){const n=e||Wg,t=n.aliases,r=n.detect||!1,i=n.languages||zg,o=n.plainText,a=n.prefix,s=n.subset;let c="hljs";const l=Kg(i);if(t&&l.registerAlias(t),a){const d=a.indexOf("-");c=d===-1?a:a.slice(0,d)}return function(d,u){St(d,"element",function(f,p,g){if(f.tagName!=="code"||!g||g.type!=="element"||g.tagName!=="pre")return;const _=Yg(f);if(_===!1||!_&&!r||_&&o&&o.includes(_))return;Array.isArray(f.properties.className)||(f.properties.className=[]),f.properties.className.includes(c)||f.properties.className.unshift(c);const y=pf(f,{whitespace:"pre"});let E;try{E=_?l.highlight(_,y,{prefix:a}):l.highlightAuto(y,{prefix:a,subset:s})}catch(N){const x=N;if(_&&/Unknown language/.test(x.message)){u.message("Cannot highlight as `"+_+"`, it’s not registered",{ancestors:[g,f],cause:x,place:f.position,ruleId:"missing-language",source:"rehype-highlight"});return}throw x}!_&&E.data&&E.data.language&&f.properties.className.push("language-"+E.data.language),E.children.length>0&&(f.children=E.children)})}}function Yg(e){const n=e.properties.className;let t=-1;if(!Array.isArray(n))return;let r;for(;++tvn.jsx("a",{...t,target:"_blank",rel:"noopener noreferrer"})},children:e})})}export{Xg as MarkdownView}; diff --git a/viewer-ui/dist/assets/Terminal-K7sK28PK.js b/viewer-ui/dist/assets/Terminal-K7sK28PK.js new file mode 100644 index 00000000..5a5b8f42 --- /dev/null +++ b/viewer-ui/dist/assets/Terminal-K7sK28PK.js @@ -0,0 +1,35 @@ +import{a as e,c as t,i as n,n as r,o as i,r as a,s as o,t as s}from"./index-qkOCcO3M.js";var c=t();function l(e,t){for(;t;)[e,t]=[t,e%t];return e}function u(e,t){switch(e){case 1:return[1];case 2:return t?[2]:[1,1];case 3:return[2,1];case 4:return[2,2];case 5:return[3,2];case 6:return[3,3];case 7:return[4,3];default:return[4,4]}}function d(e,t){let n=u(e,t),r=n.reduce((e,t)=>e*t/l(e,t),1),i=[];return n.forEach((e,t)=>{let n=r/e;for(let r=0;r=4352&&e<=4447||e>=11904&&e<=12350||e>=12353&&e<=13311||e>=13312&&e<=19903||e>=19968&&e<=40959||e>=40960&&e<=42191||e>=44032&&e<=55203||e>=63744&&e<=64255||e>=65072&&e<=65103||e>=65280&&e<=65376||e>=65504&&e<=65510||e>=127744&&e<=129791||e>=131072&&e<=262141}function p(e,t){let n=0;for(let t of e)n+=f(t.codePointAt(0)??0)?2:1;if(n<=t)return e;let r=0,i=``;for(let n of e){let e=f(n.codePointAt(0)??0)?2:1;if(r+e>t-1)break;i+=n,r+=e}return`${i}…`}function m({panes:e,zoomed:t,onFocus:n,onReorder:r}){let a=(0,c.useRef)(null),o=(0,c.useRef)(null),s=(0,c.useRef)(null),l=(0,c.useRef)(!1),[u,d]=(0,c.useState)(null),[f,p]=(0,c.useState)(null),m=t===null&&e.length>1,h=()=>{a.current=null,o.current=null,s.current=null,l.current=!1,d(null),p(null)};return{draggingPane:u,dragOverPane:f,reorderable:m,endPaneDrag:h,onPaneDragStart:(e,t)=>{e.target.closest(`button`)||(n(t),!(e.button!==0||!m)&&(a.current=t,o.current={x:e.clientX,y:e.clientY},l.current=!1,e.currentTarget.setPointerCapture(e.pointerId)))},onPaneDragMove:e=>{let t=a.current,n=o.current;if(t===null||n===null||!l.current&&Math.hypot(e.clientX-n.x,e.clientY-n.y)<4)return;l.current=!0,d(t);let r=document.elementFromPoint(e.clientX,e.clientY)?.closest(`[data-pane-id]`),i=r?Number(r.getAttribute(`data-pane-id`)):null,c=i!==null&&i!==t?i:null;s.current=c,p(c)},onPaneDragEnd:()=>{let t=a.current,n=s.current;t!==null&&l.current&&n!==null&&r(i(e,t,n)),h()}}}function h({repo:t,socketRef:n,viewsRef:r,pendingRef:i,sentSizesRef:a,lastActiveByRepoRef:s,expectCreateRef:l,setPanes:u,setActive:d,setZoomed:f,setTitles:p}){(0,c.useEffect)(()=>{let c=!1,m,h=()=>{r.current.forEach(e=>e.term.dispose()),r.current.clear(),i.current.clear(),a.current.clear()},g=()=>{u([]),d(null),f(null),p({}),h();let _=location.protocol===`https:`?`wss:`:`ws:`,v=new WebSocket(`${_}//${location.host}/ws/term?repo=${encodeURIComponent(t)}`);v.binaryType=`arraybuffer`,n.current=v,v.onmessage=n=>{if(typeof n.data==`string`){let r=JSON.parse(n.data);if(r.type===`created`){let e=r.pane;u(t=>[...t,e]),l.current>0?(--l.current,d(e),s.current.set(t,e)):s.current.get(t)===e&&d(e)}else r.type===`exited`?(u(e=>e.filter(e=>e!==r.pane)),d(e=>e===r.pane?null:e),f(e=>e===r.pane?null:e),i.current.delete(r.pane),a.current.delete(r.pane),p(e=>{if(!(r.pane in e))return e;let t={...e};return delete t[r.pane],t})):r.type===`reordered`?u(t=>e(t,r.order)):r.type===`error`&&(l.current=0,o.error(r.message));return}let c=new Uint8Array(n.data);if(c.length<4)return;let m=new DataView(c.buffer).getUint32(0,!0),h=c.subarray(4),g=r.current.get(m);if(g)g.term.write(h);else{let e=i.current.get(m)??[];e.push(h),i.current.set(m,e)}},v.onclose=()=>{c||(m=setTimeout(g,1e3))}};return g(),()=>{c=!0,m&&clearTimeout(m),n.current?.close(),h()}},[t])}var g=Object.defineProperty,_=Object.getOwnPropertyDescriptor,v=(e,t)=>{for(var n in t)g(e,n,{get:t[n],enumerable:!0})},y=(e,t,n,r)=>{for(var i=r>1?void 0:r?_(t,n):t,a=e.length-1,o;a>=0;a--)(o=e[a])&&(i=(r?o(t,n,i):o(i))||i);return r&&i&&g(t,n,i),i},b=(e,t)=>(n,r)=>t(n,r,e),ee=`Terminal input`,te={get:()=>ee,set:e=>ee=e},ne=`Too much output to announce, navigate to rows manually to read`,re={get:()=>ne,set:e=>ne=e};function ie(e){return e.replace(/\r?\n/g,`\r`)}function ae(e,t){return t?`\x1B[200~`+e+`\x1B[201~`:e}function x(e,t){e.clipboardData&&e.clipboardData.setData(`text/plain`,t.selectionText),e.preventDefault()}function oe(e,t,n,r){e.stopPropagation(),e.clipboardData&&S(e.clipboardData.getData(`text/plain`),t,n,r)}function S(e,t,n,r){e=ie(e),e=ae(e,n.decPrivateModes.bracketedPasteMode&&r.rawOptions.ignoreBracketedPasteMode!==!0),n.triggerDataEvent(e,!0),t.value=``}function se(e,t,n){let r=n.getBoundingClientRect(),i=e.clientX-r.left-10,a=e.clientY-r.top-10;t.style.width=`20px`,t.style.height=`20px`,t.style.left=`${i}px`,t.style.top=`${a}px`,t.style.zIndex=`1000`,t.focus()}function ce(e,t,n,r,i){se(e,t,n),i&&r.rightClickSelect(e),t.value=r.selectionText,t.select()}function le(e){return e>65535?(e-=65536,String.fromCharCode((e>>10)+55296)+String.fromCharCode(e%1024+56320)):String.fromCharCode(e)}function C(e,t=0,n=e.length){let r=``;for(let i=t;i65535?(t-=65536,r+=String.fromCharCode((t>>10)+55296)+String.fromCharCode(t%1024+56320)):r+=String.fromCharCode(t)}return r}var ue=class{constructor(){this._interim=0}clear(){this._interim=0}decode(e,t){let n=e.length;if(!n)return 0;let r=0,i=0;if(this._interim){let n=e.charCodeAt(i++);56320<=n&&n<=57343?t[r++]=(this._interim-55296)*1024+n-56320+65536:(t[r++]=this._interim,t[r++]=n),this._interim=0}for(let a=i;a=n)return this._interim=i,r;let o=e.charCodeAt(a);56320<=o&&o<=57343?t[r++]=(i-55296)*1024+o-56320+65536:(t[r++]=i,t[r++]=o);continue}i!==65279&&(t[r++]=i)}return r}},de=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(e,t){let n=e.length;if(!n)return 0;let r=0,i,a,o,s,c=0,l=0;if(this.interim[0]){let i=!1,a=this.interim[0];a&=(a&224)==192?31:(a&240)==224?15:7;let o=0,s;for(;(s=this.interim[++o]&63)&&o<4;)a<<=6,a|=s;let c=(this.interim[0]&224)==192?2:(this.interim[0]&240)==224?3:4,u=c-o;for(;l=n)return 0;if(s=e[l++],(s&192)!=128){l--,i=!0;break}else this.interim[o++]=s,a<<=6,a|=s&63}i||(c===2?a<128?l--:t[r++]=a:c===3?a<2048||a>=55296&&a<=57343||a===65279||(t[r++]=a):a<65536||a>1114111||(t[r++]=a)),this.interim.fill(0)}let u=n-4,d=l;for(;d=n)return this.interim[0]=i,r;if(a=e[d++],(a&192)!=128){d--;continue}if(c=(i&31)<<6|a&63,c<128){d--;continue}t[r++]=c}else if((i&240)==224){if(d>=n)return this.interim[0]=i,r;if(a=e[d++],(a&192)!=128){d--;continue}if(d>=n)return this.interim[0]=i,this.interim[1]=a,r;if(o=e[d++],(o&192)!=128){d--;continue}if(c=(i&15)<<12|(a&63)<<6|o&63,c<2048||c>=55296&&c<=57343||c===65279)continue;t[r++]=c}else if((i&248)==240){if(d>=n)return this.interim[0]=i,r;if(a=e[d++],(a&192)!=128){d--;continue}if(d>=n)return this.interim[0]=i,this.interim[1]=a,r;if(o=e[d++],(o&192)!=128){d--;continue}if(d>=n)return this.interim[0]=i,this.interim[1]=a,this.interim[2]=o,r;if(s=e[d++],(s&192)!=128){d--;continue}if(c=(i&7)<<18|(a&63)<<12|(o&63)<<6|s&63,c<65536||c>1114111)continue;t[r++]=c}}return r}},fe=``,pe=` `,me=class e{constructor(){this.fg=0,this.bg=0,this.extended=new he}static toColorRGB(e){return[e>>>16&255,e>>>8&255,e&255]}static fromColorRGB(e){return(e[0]&255)<<16|(e[1]&255)<<8|e[2]&255}clone(){let t=new e;return t.fg=this.fg,t.bg=this.bg,t.extended=this.extended.clone(),t}isInverse(){return this.fg&67108864}isBold(){return this.fg&134217728}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:this.fg&268435456}isBlink(){return this.fg&536870912}isInvisible(){return this.fg&1073741824}isItalic(){return this.bg&67108864}isDim(){return this.bg&134217728}isStrikethrough(){return this.fg&2147483648}isProtected(){return this.bg&536870912}isOverline(){return this.bg&1073741824}getFgColorMode(){return this.fg&50331648}getBgColorMode(){return this.bg&50331648}isFgRGB(){return(this.fg&50331648)==50331648}isBgRGB(){return(this.bg&50331648)==50331648}isFgPalette(){return(this.fg&50331648)==16777216||(this.fg&50331648)==33554432}isBgPalette(){return(this.bg&50331648)==16777216||(this.bg&50331648)==33554432}isFgDefault(){return(this.fg&50331648)==0}isBgDefault(){return(this.bg&50331648)==0}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(this.fg&50331648){case 16777216:case 33554432:return this.fg&255;case 50331648:return this.fg&16777215;default:return-1}}getBgColor(){switch(this.bg&50331648){case 16777216:case 33554432:return this.bg&255;case 50331648:return this.bg&16777215;default:return-1}}hasExtendedAttrs(){return this.bg&268435456}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(this.bg&268435456&&~this.extended.underlineColor)switch(this.extended.underlineColor&50331648){case 16777216:case 33554432:return this.extended.underlineColor&255;case 50331648:return this.extended.underlineColor&16777215;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return this.bg&268435456&&~this.extended.underlineColor?this.extended.underlineColor&50331648:this.getFgColorMode()}isUnderlineColorRGB(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)==50331648:this.isFgRGB()}isUnderlineColorPalette(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)==16777216||(this.extended.underlineColor&50331648)==33554432:this.isFgPalette()}isUnderlineColorDefault(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)==0:this.isFgDefault()}getUnderlineStyle(){return this.fg&268435456?this.bg&268435456?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}},he=class e{constructor(e=0,t=0){this._ext=0,this._urlId=0,this._ext=e,this._urlId=t}get ext(){return this._urlId?this._ext&-469762049|this.underlineStyle<<26:this._ext}set ext(e){this._ext=e}get underlineStyle(){return this._urlId?5:(this._ext&469762048)>>26}set underlineStyle(e){this._ext&=-469762049,this._ext|=e<<26&469762048}get underlineColor(){return this._ext&67108863}set underlineColor(e){this._ext&=-67108864,this._ext|=e&67108863}get urlId(){return this._urlId}set urlId(e){this._urlId=e}get underlineVariantOffset(){let e=(this._ext&3758096384)>>29;return e<0?e^4294967288:e}set underlineVariantOffset(e){this._ext&=536870911,this._ext|=e<<29&3758096384}clone(){return new e(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}},w=class e extends me{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new he,this.combinedData=``}static fromCharData(t){let n=new e;return n.setFromCharData(t),n}isCombined(){return this.content&2097152}getWidth(){return this.content>>22}getChars(){return this.content&2097152?this.combinedData:this.content&2097151?le(this.content&2097151):``}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):this.content&2097151}setFromCharData(e){this.fg=e[0],this.bg=0;let t=!1;if(e[1].length>2)t=!0;else if(e[1].length===2){let n=e[1].charCodeAt(0);if(55296<=n&&n<=56319){let r=e[1].charCodeAt(1);56320<=r&&r<=57343?this.content=(n-55296)*1024+r-56320+65536|e[2]<<22:t=!0}else t=!0}else this.content=e[1].charCodeAt(0)|e[2]<<22;t&&(this.combinedData=e[1],this.content=2097152|e[2]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}},ge=`di$target`,_e=`di$dependencies`,ve=new Map;function ye(e){return e[_e]||[]}function T(e){if(ve.has(e))return ve.get(e);let t=function(e,n,r){if(arguments.length!==3)throw Error(`@IServiceName-decorator can only be used to decorate a parameter`);be(t,e,r)};return t._id=e,ve.set(e,t),t}function be(e,t,n){t[ge]===t?t[_e].push({id:e,index:n}):(t[_e]=[{id:e,index:n}],t[ge]=t)}var E=T(`BufferService`),xe=T(`CoreMouseService`),D=T(`CoreService`),Se=T(`CharsetService`),Ce=T(`InstantiationService`),we=T(`LogService`),O=T(`OptionsService`),Te=T(`OscLinkService`),Ee=T(`UnicodeService`),De=T(`DecorationService`),Oe=class{constructor(e,t,n){this._bufferService=e,this._optionsService=t,this._oscLinkService=n}provideLinks(e,t){let n=this._bufferService.buffer.lines.get(e-1);if(!n){t(void 0);return}let r=[],i=this._optionsService.rawOptions.linkHandler,a=new w,o=n.getTrimmedLength(),s=-1,c=-1,l=!1;for(let t=0;ti?i.activate(e,t,a):ke(e,t),hover:(e,t)=>i?.hover?.(e,t,a),leave:(e,t)=>i?.leave?.(e,t,a)})}l=!1,a.hasExtendedAttrs()&&a.extended.urlId?(c=t,s=a.extended.urlId):(c=-1,s=-1)}}t(r)}};Oe=y([b(0,E),b(1,O),b(2,Te)],Oe);function ke(e,t){if(confirm(`Do you want to navigate to ${t}? + +WARNING: This link could potentially be dangerous`)){let e=window.open();if(e){try{e.opener=null}catch{}e.location.href=t}else console.warn(`Opening link blocked as opener could not be cleared`)}}var Ae=T(`CharSizeService`),je=T(`CoreBrowserService`),Me=T(`MouseService`),Ne=T(`RenderService`),Pe=T(`SelectionService`),Fe=T(`CharacterJoinerService`),Ie=T(`ThemeService`),Le=T(`LinkProviderService`),Re=new class{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(e){setTimeout(()=>{throw e.stack?We.isErrorNoTelemetry(e)?new We(e.message+` + +`+e.stack):Error(e.message+` + +`+e.stack):e},0)}}addListener(e){return this.listeners.push(e),()=>{this._removeListener(e)}}emit(e){this.listeners.forEach(t=>{t(e)})}_removeListener(e){this.listeners.splice(this.listeners.indexOf(e),1)}setUnexpectedErrorHandler(e){this.unexpectedErrorHandler=e}getUnexpectedErrorHandler(){return this.unexpectedErrorHandler}onUnexpectedError(e){this.unexpectedErrorHandler(e),this.emit(e)}onUnexpectedExternalError(e){this.unexpectedErrorHandler(e)}};function ze(e){Ve(e)||Re.onUnexpectedError(e)}var Be=`Canceled`;function Ve(e){return e instanceof He||e instanceof Error&&e.name===Be&&e.message===Be}var He=class extends Error{constructor(){super(Be),this.name=this.message}};function Ue(e){return Error(e?`Illegal argument: ${e}`:`Illegal argument`)}var We=class e extends Error{constructor(e){super(e),this.name=`CodeExpectedError`}static fromError(t){if(t instanceof e)return t;let n=new e;return n.message=t.message,n.stack=t.stack,n}static isErrorNoTelemetry(e){return e.name===`CodeExpectedError`}},Ge=class e extends Error{constructor(t){super(t||`An unexpected bug occurred.`),Object.setPrototypeOf(this,e.prototype)}};function Ke(e,t,n=0,r=e.length){let i=n,a=r;for(;i{function t(e){return e<0}e.isLessThan=t;function n(e){return e<=0}e.isLessThanOrEqual=n;function r(e){return e>0}e.isGreaterThan=r;function i(e){return e===0}e.isNeitherLessOrGreaterThan=i,e.greaterThan=1,e.lessThan=-1,e.neitherLessOrGreaterThan=0})(Ye||={});function Xe(e,t){return(n,r)=>t(e(n),e(r))}var Ze=(e,t)=>e-t,Qe=class e{constructor(e){this.iterate=e}forEach(e){this.iterate(t=>(e(t),!0))}toArray(){let e=[];return this.iterate(t=>(e.push(t),!0)),e}filter(t){return new e(e=>this.iterate(n=>!t(n)||e(n)))}map(t){return new e(e=>this.iterate(n=>e(t(n))))}some(e){let t=!1;return this.iterate(n=>(t=e(n),!t)),t}findFirst(e){let t;return this.iterate(n=>e(n)?(t=n,!1):!0),t}findLast(e){let t;return this.iterate(n=>(e(n)&&(t=n),!0)),t}findLastMaxBy(e){let t,n=!0;return this.iterate(r=>((n||Ye.isGreaterThan(e(r,t)))&&(n=!1,t=r),!0)),t}};Qe.empty=new Qe(e=>{});function $e(e,t){let n=Object.create(null);for(let r of e){let e=t(r),i=n[e];i||=n[e]=[],i.push(r)}return n}var et=class{constructor(){this.map=new Map}add(e,t){let n=this.map.get(e);n||(n=new Set,this.map.set(e,n)),n.add(t)}delete(e,t){let n=this.map.get(e);n&&(n.delete(t),n.size===0&&this.map.delete(e))}forEach(e,t){let n=this.map.get(e);n&&n.forEach(t)}get(e){return this.map.get(e)||new Set}};function tt(e,t){let n=this,r=!1,i;return function(){if(r)return i;if(r=!0,t)try{i=e.apply(n,arguments)}finally{t()}else i=e.apply(n,arguments);return i}}var nt;(e=>{function t(e){return e&&typeof e==`object`&&typeof e[Symbol.iterator]==`function`}e.is=t;let n=Object.freeze([]);function r(){return n}e.empty=r;function*i(e){yield e}e.single=i;function a(e){return t(e)?e:i(e)}e.wrap=a;function o(e){return e||n}e.from=o;function*s(e){for(let t=e.length-1;t>=0;t--)yield e[t]}e.reverse=s;function c(e){return!e||e[Symbol.iterator]().next().done===!0}e.isEmpty=c;function l(e){return e[Symbol.iterator]().next().value}e.first=l;function u(e,t){let n=0;for(let r of e)if(t(r,n++))return!0;return!1}e.some=u;function d(e,t){for(let n of e)if(t(n))return n}e.find=d;function*f(e,t){for(let n of e)t(n)&&(yield n)}e.filter=f;function*p(e,t){let n=0;for(let r of e)yield t(r,n++)}e.map=p;function*m(e,t){let n=0;for(let r of e)yield*t(r,n++)}e.flatMap=m;function*h(...e){for(let t of e)yield*t}e.concat=h;function g(e,t,n){let r=n;for(let n of e)r=t(r,n);return r}e.reduce=g;function*_(e,t,n=e.length){for(t<0&&(t+=e.length),n<0?n+=e.length:n>e.length&&(n=e.length);tt.source!==null&&!this.getRootParent(t,e).isSingleton).flatMap(([e])=>e)}computeLeakingDisposables(e=10,t){let n;if(t)n=t;else{let e=new Map,t=[...this.livingDisposables.values()].filter(t=>t.source!==null&&!this.getRootParent(t,e).isSingleton);if(t.length===0)return;let r=new Set(t.map(e=>e.value));if(n=t.filter(e=>!(e.parent&&r.has(e.parent))),n.length===0)throw Error(`There are cyclic diposable chains!`)}if(!n)return;function r(e){function t(e,t){for(;e.length>0&&t.some(t=>typeof t==`string`?t===e[0]:e[0].match(t));)e.shift()}let n=e.source.split(` +`).map(e=>e.trim().replace(`at `,``)).filter(e=>e!==``);return t(n,[`Error`,/^trackDisposable \(.*\)$/,/^DisposableTracker.trackDisposable \(.*\)$/]),n.reverse()}let i=new et;for(let e of n){let t=r(e);for(let n=0;n<=t.length;n++)i.add(t.slice(0,n).join(` +`),e)}n.sort(Xe(e=>e.idx,Ze));let a=``,o=0;for(let t of n.slice(0,e)){o++;let e=r(t),s=[];for(let t=0;tr(e)[t]),e=>e);delete o[e[t]];for(let[e,t]of Object.entries(o))s.unshift(` - stacktraces of ${t.length} other leaks continue with ${e}`);s.unshift(a)}a+=` + + +==================== Leaking disposable ${o}/${n.length}: ${t.value.constructor.name} ==================== +${s.join(` +`)} +============================================================ + +`}return n.length>e&&(a+=` + + +... and ${n.length-e} more leaking disposables + +`),{leaks:n,details:a}}};it.idx=0;function at(e){return rt?.trackDisposable(e),e}function ot(e){rt?.markAsDisposed(e)}function st(e,t){rt?.setParent(e,t)}function ct(e){return rt?.markAsSingleton(e),e}function lt(e){if(nt.is(e)){let t=[];for(let n of e)if(n)try{n.dispose()}catch(e){t.push(e)}if(t.length===1)throw t[0];if(t.length>1)throw AggregateError(t,`Encountered errors while disposing of store`);return Array.isArray(e)?[]:e}else if(e)return e.dispose(),e}function ut(...e){return k(()=>lt(e))}function k(e){let t=at({dispose:tt(()=>{ot(t),e()})});return t}var dt=class e{constructor(){this._toDispose=new Set,this._isDisposed=!1,at(this)}dispose(){this._isDisposed||(ot(this),this._isDisposed=!0,this.clear())}get isDisposed(){return this._isDisposed}clear(){if(this._toDispose.size!==0)try{lt(this._toDispose)}finally{this._toDispose.clear()}}add(t){if(!t)return t;if(t===this)throw Error(`Cannot register a disposable on itself!`);return st(t,this),this._isDisposed?e.DISABLE_DISPOSED_WARNING||console.warn(Error(`Trying to add a disposable to a DisposableStore that has already been disposed of. The added object will be leaked!`).stack):this._toDispose.add(t),t}delete(e){if(e){if(e===this)throw Error(`Cannot dispose a disposable on itself!`);this._toDispose.delete(e),e.dispose()}}deleteAndLeak(e){e&&this._toDispose.has(e)&&(this._toDispose.delete(e),st(e,null))}};dt.DISABLE_DISPOSED_WARNING=!1;var ft=dt,A=class{constructor(){this._store=new ft,at(this),st(this._store,this)}dispose(){ot(this),this._store.dispose()}_register(e){if(e===this)throw Error(`Cannot register a disposable on itself!`);return this._store.add(e)}};A.None=Object.freeze({dispose(){}});var pt=class{constructor(){this._isDisposed=!1,at(this)}get value(){return this._isDisposed?void 0:this._value}set value(e){this._isDisposed||e===this._value||(this._value?.dispose(),e&&st(e,this),this._value=e)}clear(){this.value=void 0}dispose(){this._isDisposed=!0,ot(this),this._value?.dispose(),this._value=void 0}clearAndLeak(){let e=this._value;return this._value=void 0,e&&st(e,null),e}},mt=typeof window==`object`?window:globalThis,ht=class e{constructor(t){this.element=t,this.next=e.Undefined,this.prev=e.Undefined}};ht.Undefined=new ht(void 0);var j=ht,gt=class{constructor(){this._first=j.Undefined,this._last=j.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===j.Undefined}clear(){let e=this._first;for(;e!==j.Undefined;){let t=e.next;e.prev=j.Undefined,e.next=j.Undefined,e=t}this._first=j.Undefined,this._last=j.Undefined,this._size=0}unshift(e){return this._insert(e,!1)}push(e){return this._insert(e,!0)}_insert(e,t){let n=new j(e);if(this._first===j.Undefined)this._first=n,this._last=n;else if(t){let e=this._last;this._last=n,n.prev=e,e.next=n}else{let e=this._first;this._first=n,n.next=e,e.prev=n}this._size+=1;let r=!1;return()=>{r||(r=!0,this._remove(n))}}shift(){if(this._first!==j.Undefined){let e=this._first.element;return this._remove(this._first),e}}pop(){if(this._last!==j.Undefined){let e=this._last.element;return this._remove(this._last),e}}_remove(e){if(e.prev!==j.Undefined&&e.next!==j.Undefined){let t=e.prev;t.next=e.next,e.next.prev=t}else e.prev===j.Undefined&&e.next===j.Undefined?(this._first=j.Undefined,this._last=j.Undefined):e.next===j.Undefined?(this._last=this._last.prev,this._last.next=j.Undefined):e.prev===j.Undefined&&(this._first=this._first.next,this._first.prev=j.Undefined);--this._size}*[Symbol.iterator](){let e=this._first;for(;e!==j.Undefined;)yield e.element,e=e.next}},_t=globalThis.performance&&typeof globalThis.performance.now==`function`,vt=class e{static create(t){return new e(t)}constructor(e){this._now=_t&&e===!1?Date.now:globalThis.performance.now.bind(globalThis.performance),this._startTime=this._now(),this._stopTime=-1}stop(){this._stopTime=this._now()}reset(){this._startTime=this._now(),this._stopTime=-1}elapsed(){return this._stopTime===-1?this._now()-this._startTime:this._stopTime-this._startTime}},M;(e=>{e.None=()=>A.None;function t(e,t){return d(e,()=>{},0,void 0,!0,void 0,t)}e.defer=t;function n(e){return(t,n=null,r)=>{let i=!1,a;return a=e(e=>{if(!i)return a?a.dispose():i=!0,t.call(n,e)},null,r),i&&a.dispose(),a}}e.once=n;function r(e,t,n){return l((n,r=null,i)=>e(e=>n.call(r,t(e)),null,i),n)}e.map=r;function i(e,t,n){return l((n,r=null,i)=>e(e=>{t(e),n.call(r,e)},null,i),n)}e.forEach=i;function a(e,t,n){return l((n,r=null,i)=>e(e=>t(e)&&n.call(r,e),null,i),n)}e.filter=a;function o(e){return e}e.signal=o;function s(...e){return(t,n=null,r)=>u(ut(...e.map(e=>e(e=>t.call(n,e)))),r)}e.any=s;function c(e,t,n,i){let a=n;return r(e,e=>(a=t(a,e),a),i)}e.reduce=c;function l(e,t){let n,r=new N({onWillAddFirstListener(){n=e(r.fire,r)},onDidRemoveLastListener(){n?.dispose()}});return t?.add(r),r.event}function u(e,t){return t instanceof Array?t.push(e):t&&t.add(e),e}function d(e,t,n=100,r=!1,i=!1,a,o){let s,c,l,u=0,d,f=new N({leakWarningThreshold:a,onWillAddFirstListener(){s=e(e=>{u++,c=t(c,e),r&&!l&&(f.fire(c),c=void 0),d=()=>{let e=c;c=void 0,l=void 0,(!r||u>1)&&f.fire(e),u=0},typeof n==`number`?(clearTimeout(l),l=setTimeout(d,n)):l===void 0&&(l=0,queueMicrotask(d))})},onWillRemoveListener(){i&&u>0&&d?.()},onDidRemoveLastListener(){d=void 0,s.dispose()}});return o?.add(f),f.event}e.debounce=d;function f(t,n=0,r){return e.debounce(t,(e,t)=>e?(e.push(t),e):[t],n,void 0,!0,void 0,r)}e.accumulate=f;function p(e,t=(e,t)=>e===t,n){let r=!0,i;return a(e,e=>{let n=r||!t(e,i);return r=!1,i=e,n},n)}e.latch=p;function m(t,n,r){return[e.filter(t,n,r),e.filter(t,e=>!n(e),r)]}e.split=m;function h(e,t=!1,n=[],r){let i=n.slice(),a=e(e=>{i?i.push(e):s.fire(e)});r&&r.add(a);let o=()=>{i?.forEach(e=>s.fire(e)),i=null},s=new N({onWillAddFirstListener(){a||(a=e(e=>s.fire(e)),r&&r.add(a))},onDidAddFirstListener(){i&&(t?setTimeout(o):o())},onDidRemoveLastListener(){a&&a.dispose(),a=null}});return r&&r.add(s),s.event}e.buffer=h;function g(e,t){return(n,r,i)=>{let a=t(new v);return e(function(e){let t=a.evaluate(e);t!==_&&n.call(r,t)},void 0,i)}}e.chain=g;let _=Symbol(`HaltChainable`);class v{constructor(){this.steps=[]}map(e){return this.steps.push(e),this}forEach(e){return this.steps.push(t=>(e(t),t)),this}filter(e){return this.steps.push(t=>e(t)?t:_),this}reduce(e,t){let n=t;return this.steps.push(t=>(n=e(n,t),n)),this}latch(e=(e,t)=>e===t){let t=!0,n;return this.steps.push(r=>{let i=t||!e(r,n);return t=!1,n=r,i?r:_}),this}evaluate(e){for(let t of this.steps)if(e=t(e),e===_)break;return e}}function y(e,t,n=e=>e){let r=(...e)=>i.fire(n(...e)),i=new N({onWillAddFirstListener:()=>e.on(t,r),onDidRemoveLastListener:()=>e.removeListener(t,r)});return i.event}e.fromNodeEventEmitter=y;function b(e,t,n=e=>e){let r=(...e)=>i.fire(n(...e)),i=new N({onWillAddFirstListener:()=>e.addEventListener(t,r),onDidRemoveLastListener:()=>e.removeEventListener(t,r)});return i.event}e.fromDOMEventEmitter=b;function ee(e){return new Promise(t=>n(e)(t))}e.toPromise=ee;function te(e){let t=new N;return e.then(e=>{t.fire(e)},()=>{t.fire(void 0)}).finally(()=>{t.dispose()}),t.event}e.fromPromise=te;function ne(e,t){return e(e=>t.fire(e))}e.forward=ne;function re(e,t,n){return t(n),e(e=>t(e))}e.runAndSubscribe=re;class ie{constructor(e,t){this._observable=e,this._counter=0,this._hasChanged=!1;let n={onWillAddFirstListener:()=>{e.addObserver(this)},onDidRemoveLastListener:()=>{e.removeObserver(this)}};this.emitter=new N(n),t&&t.add(this.emitter)}beginUpdate(e){this._counter++}handlePossibleChange(e){}handleChange(e,t){this._hasChanged=!0}endUpdate(e){this._counter--,this._counter===0&&(this._observable.reportChanges(),this._hasChanged&&(this._hasChanged=!1,this.emitter.fire(this._observable.get())))}}function ae(e,t){return new ie(e,t).emitter.event}e.fromObservable=ae;function x(e){return(t,n,r)=>{let i=0,a=!1,o={beginUpdate(){i++},endUpdate(){i--,i===0&&(e.reportChanges(),a&&(a=!1,t.call(n)))},handlePossibleChange(){},handleChange(){a=!0}};e.addObserver(o),e.reportChanges();let s={dispose(){e.removeObserver(o)}};return r instanceof ft?r.add(s):Array.isArray(r)&&r.push(s),s}}e.fromObservableLight=x})(M||={});var yt=class e{constructor(t){this.listenerCount=0,this.invocationCount=0,this.elapsedOverall=0,this.durations=[],this.name=`${t}_${e._idPool++}`,e.all.add(this)}start(e){this._stopWatch=new vt,this.listenerCount=e}stop(){if(this._stopWatch){let e=this._stopWatch.elapsed();this.durations.push(e),this.elapsedOverall+=e,this.invocationCount+=1,this._stopWatch=void 0}}};yt.all=new Set,yt._idPool=0;var bt=yt,xt=-1,St=class e{constructor(t,n,r=(e._idPool++).toString(16).padStart(3,`0`)){this._errorHandler=t,this.threshold=n,this.name=r,this._warnCountdown=0}dispose(){this._stacks?.clear()}check(e,t){let n=this.threshold;if(n<=0||t{let t=this._stacks.get(e.value)||0;this._stacks.set(e.value,t-1)}}getMostFrequentStack(){if(!this._stacks)return;let e,t=0;for(let[n,r]of this._stacks)(!e||t0||this._options?.leakWarningThreshold?new Ct(e?.onListenerError??ze,this._options?.leakWarningThreshold??xt):void 0,this._perfMon=this._options?._profName?new bt(this._options._profName):void 0,this._deliveryQueue=this._options?.deliveryQueue}dispose(){this._disposed||(this._disposed=!0,this._deliveryQueue?.current===this&&this._deliveryQueue.reset(),this._listeners&&(this._listeners=void 0,this._size=0),this._options?.onDidRemoveLastListener?.(),this._leakageMon?.dispose())}get event(){return this._event??=(e,t,n)=>{if(this._leakageMon&&this._size>this._leakageMon.threshold**2){let e=`[${this._leakageMon.name}] REFUSES to accept new listeners because it exceeded its threshold by far (${this._size} vs ${this._leakageMon.threshold})`;console.warn(e);let t=this._leakageMon.getMostFrequentStack()??[`UNKNOWN stack`,-1],n=new Et(`${e}. HINT: Stack shows most frequent listener (${t[1]}-times)`,t[0]);return(this._options?.onListenerError||ze)(n),A.None}if(this._disposed)return A.None;t&&(e=e.bind(t));let r=new Ot(e),i;this._leakageMon&&this._size>=Math.ceil(this._leakageMon.threshold*.2)&&(r.stack=wt.create(),i=this._leakageMon.check(r.stack,this._size+1)),this._listeners?this._listeners instanceof Ot?(this._deliveryQueue??=new jt,this._listeners=[this._listeners,r]):this._listeners.push(r):(this._options?.onWillAddFirstListener?.(this),this._listeners=r,this._options?.onDidAddFirstListener?.(this)),this._size++;let a=k(()=>{At?.unregister(a),i?.(),this._removeListener(r)});if(n instanceof ft?n.add(a):Array.isArray(n)&&n.push(a),At){let e=Error().stack.split(` +`).slice(2,3).join(` +`).trim(),t=/(file:|vscode-file:\/\/vscode-app)?(\/[^:]*:\d+:\d+)/.exec(e);At.register(a,t?.[2]??e,a)}return a},this._event}_removeListener(e){if(this._options?.onWillRemoveListener?.(this),!this._listeners)return;if(this._size===1){this._listeners=void 0,this._options?.onDidRemoveLastListener?.(this),this._size=0;return}let t=this._listeners,n=t.indexOf(e);if(n===-1)throw console.log(`disposed?`,this._disposed),console.log(`size?`,this._size),console.log(`arr?`,JSON.stringify(this._listeners)),Error(`Attempted to dispose unknown listener`);this._size--,t[n]=void 0;let r=this._deliveryQueue.current===this;if(this._size*kt<=t.length){let e=0;for(let n=0;n0}},jt=class{constructor(){this.i=-1,this.end=0}enqueue(e,t,n){this.i=0,this.end=n,this.current=e,this.value=t}reset(){this.i=this.end,this.current=void 0,this.value=void 0}},Mt=class{constructor(){this.mapWindowIdToZoomLevel=new Map,this._onDidChangeZoomLevel=new N,this.onDidChangeZoomLevel=this._onDidChangeZoomLevel.event,this.mapWindowIdToZoomFactor=new Map,this._onDidChangeFullscreen=new N,this.onDidChangeFullscreen=this._onDidChangeFullscreen.event,this.mapWindowIdToFullScreen=new Map}getZoomLevel(e){return this.mapWindowIdToZoomLevel.get(this.getWindowId(e))??0}setZoomLevel(e,t){if(this.getZoomLevel(t)===e)return;let n=this.getWindowId(t);this.mapWindowIdToZoomLevel.set(n,e),this._onDidChangeZoomLevel.fire(n)}getZoomFactor(e){return this.mapWindowIdToZoomFactor.get(this.getWindowId(e))??1}setZoomFactor(e,t){this.mapWindowIdToZoomFactor.set(this.getWindowId(t),e)}setFullscreen(e,t){if(this.isFullscreen(t)===e)return;let n=this.getWindowId(t);this.mapWindowIdToFullScreen.set(n,e),this._onDidChangeFullscreen.fire(n)}isFullscreen(e){return!!this.mapWindowIdToFullScreen.get(this.getWindowId(e))}getWindowId(e){return e.vscodeWindowId}};Mt.INSTANCE=new Mt;var Nt=Mt;function Pt(e,t,n){typeof t==`string`&&(t=e.matchMedia(t)),t.addEventListener(`change`,n)}Nt.INSTANCE.onDidChangeZoomLevel;function Ft(e){return Nt.INSTANCE.getZoomFactor(e)}Nt.INSTANCE.onDidChangeFullscreen;var It=typeof navigator==`object`?navigator.userAgent:``,Lt=It.indexOf(`Firefox`)>=0,Rt=It.indexOf(`AppleWebKit`)>=0,zt=It.indexOf(`Chrome`)>=0,Bt=!zt&&It.indexOf(`Safari`)>=0;It.indexOf(`Electron/`),It.indexOf(`Android`);var Vt=!1;if(typeof mt.matchMedia==`function`){let e=mt.matchMedia(`(display-mode: standalone) or (display-mode: window-controls-overlay)`),t=mt.matchMedia(`(display-mode: fullscreen)`);Vt=e.matches,Pt(mt,e,({matches:e})=>{Vt&&t.matches||(Vt=e)})}function Ht(){return Vt}var Ut=`en`,Wt=!1,Gt=!1,Kt=!1,qt=!1,Jt=!1,Yt=Ut,Xt,Zt=globalThis,Qt;typeof Zt.vscode<`u`&&typeof Zt.vscode.process<`u`?Qt=Zt.vscode.process:typeof process<`u`&&typeof process?.versions?.node==`string`&&(Qt=process);var $t=typeof Qt?.versions?.electron==`string`&&Qt?.type===`renderer`;if(typeof Qt==`object`){Wt=Qt.platform===`win32`,Gt=Qt.platform===`darwin`,Kt=Qt.platform===`linux`,Kt&&Qt.env.SNAP&&Qt.env.SNAP_REVISION,Qt.env.CI||Qt.env.BUILD_ARTIFACTSTAGINGDIRECTORY,Yt=Ut;let e=Qt.env.VSCODE_NLS_CONFIG;if(e)try{let t=JSON.parse(e);t.userLocale,t.osLocale,Yt=t.resolvedLanguage||Ut,t.languagePack?.translationsConfigFile}catch{}qt=!0}else typeof navigator==`object`&&!$t?(Xt=navigator.userAgent,Wt=Xt.indexOf(`Windows`)>=0,Gt=Xt.indexOf(`Macintosh`)>=0,(Xt.indexOf(`Macintosh`)>=0||Xt.indexOf(`iPad`)>=0||Xt.indexOf(`iPhone`)>=0)&&navigator.maxTouchPoints&&navigator.maxTouchPoints,Kt=Xt.indexOf(`Linux`)>=0,Xt?.indexOf(`Mobi`),Jt=!0,Yt=globalThis._VSCODE_NLS_LANGUAGE||Ut,navigator.language.toLowerCase()):console.error(`Unable to resolve platform.`);var en=Wt,tn=Gt,nn=Kt,rn=qt;Jt&&typeof Zt.importScripts==`function`&&Zt.origin;var an=Xt,on=Yt,sn;(e=>{function t(){return on}e.value=t;function n(){return on.length===2?on===`en`:on.length>=3&&on[0]===`e`&&on[1]===`n`&&on[2]===`-`}e.isDefaultVariant=n;function r(){return on===`en`}e.isDefault=r})(sn||={});var cn=typeof Zt.postMessage==`function`&&!Zt.importScripts;(()=>{if(cn){let e=[];Zt.addEventListener(`message`,t=>{if(t.data&&t.data.vscodeScheduleAsyncWork)for(let n=0,r=e.length;n{let r=++t;e.push({id:r,callback:n}),Zt.postMessage({vscodeScheduleAsyncWork:r},`*`)}}return e=>setTimeout(e)})();var ln=!!(an&&an.indexOf(`Chrome`)>=0);an&&an.indexOf(`Firefox`),!ln&&an&&an.indexOf(`Safari`),an&&an.indexOf(`Edg/`),an&&an.indexOf(`Android`);var un=typeof navigator==`object`?navigator:{};rn||document.queryCommandSupported&&document.queryCommandSupported(`copy`)||un&&un.clipboard&&un.clipboard.writeText,rn||un&&un.clipboard&&un.clipboard.readText,rn||Ht()||un.keyboard,`ontouchstart`in mt||un.maxTouchPoints,mt.PointerEvent&&(`ontouchstart`in mt||navigator.maxTouchPoints);var dn=class{constructor(){this._keyCodeToStr=[],this._strToKeyCode=Object.create(null)}define(e,t){this._keyCodeToStr[e]=t,this._strToKeyCode[t.toLowerCase()]=e}keyCodeToStr(e){return this._keyCodeToStr[e]}strToKeyCode(e){return this._strToKeyCode[e.toLowerCase()]||0}},fn=new dn,pn=new dn,mn=new dn,hn=Array(230),gn;(e=>{function t(e){return fn.keyCodeToStr(e)}e.toString=t;function n(e){return fn.strToKeyCode(e)}e.fromString=n;function r(e){return pn.keyCodeToStr(e)}e.toUserSettingsUS=r;function i(e){return mn.keyCodeToStr(e)}e.toUserSettingsGeneral=i;function a(e){return pn.strToKeyCode(e)||mn.strToKeyCode(e)}e.fromUserSettings=a;function o(e){if(e>=98&&e<=113)return null;switch(e){case 16:return`Up`;case 18:return`Down`;case 15:return`Left`;case 17:return`Right`}return fn.keyCodeToStr(e)}e.toElectronAccelerator=o})(gn||={});var _n=class e{constructor(e,t,n,r,i){this.ctrlKey=e,this.shiftKey=t,this.altKey=n,this.metaKey=r,this.keyCode=i}equals(t){return t instanceof e&&this.ctrlKey===t.ctrlKey&&this.shiftKey===t.shiftKey&&this.altKey===t.altKey&&this.metaKey===t.metaKey&&this.keyCode===t.keyCode}getHashCode(){return`K${this.ctrlKey?`1`:`0`}${this.shiftKey?`1`:`0`}${this.altKey?`1`:`0`}${this.metaKey?`1`:`0`}${this.keyCode}`}isModifierKey(){return this.keyCode===0||this.keyCode===5||this.keyCode===57||this.keyCode===6||this.keyCode===4}toKeybinding(){return new vn([this])}isDuplicateModifierCase(){return this.ctrlKey&&this.keyCode===5||this.shiftKey&&this.keyCode===4||this.altKey&&this.keyCode===6||this.metaKey&&this.keyCode===57}},vn=class{constructor(e){if(e.length===0)throw Ue(`chords`);this.chords=e}getHashCode(){let e=``;for(let t=0,n=this.chords.length;t{function t(t){return t===e.None||t===e.Cancelled||t instanceof Mn?!0:!t||typeof t!=`object`?!1:typeof t.isCancellationRequested==`boolean`&&typeof t.onCancellationRequested==`function`}e.isCancellationToken=t,e.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:M.None}),e.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:An})})(jn||={});var Mn=class{constructor(){this._isCancelled=!1,this._emitter=null}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?An:(this._emitter||=new N,this._emitter.event)}dispose(){this._emitter&&=(this._emitter.dispose(),null)}},Nn=class{constructor(e,t){this._isDisposed=!1,this._token=-1,typeof e==`function`&&typeof t==`number`&&this.setIfNotSet(e,t)}dispose(){this.cancel(),this._isDisposed=!0}cancel(){this._token!==-1&&(clearTimeout(this._token),this._token=-1)}cancelAndSet(e,t){if(this._isDisposed)throw new Ge(`Calling 'cancelAndSet' on a disposed TimeoutTimer`);this.cancel(),this._token=setTimeout(()=>{this._token=-1,e()},t)}setIfNotSet(e,t){if(this._isDisposed)throw new Ge(`Calling 'setIfNotSet' on a disposed TimeoutTimer`);this._token===-1&&(this._token=setTimeout(()=>{this._token=-1,e()},t))}},Pn=class{constructor(){this.disposable=void 0,this.isDisposed=!1}cancel(){this.disposable?.dispose(),this.disposable=void 0}cancelAndSet(e,t,n=globalThis){if(this.isDisposed)throw new Ge(`Calling 'cancelAndSet' on a disposed IntervalTimer`);this.cancel();let r=n.setInterval(()=>{e()},t);this.disposable=k(()=>{n.clearInterval(r),this.disposable=void 0})}dispose(){this.cancel(),this.isDisposed=!0}};(function(){typeof globalThis.requestIdleCallback!=`function`||globalThis.cancelIdleCallback})();var Fn;(e=>{async function t(e){let t,n=await Promise.all(e.map(e=>e.then(e=>e,e=>{t||=e})));if(typeof t<`u`)throw t;return n}e.settled=t;function n(e){return new Promise(async(t,n)=>{try{await e(t,n)}catch(e){n(e)}})}e.withAsyncBody=n})(Fn||={});var In=class e{static fromArray(t){return new e(e=>{e.emitMany(t)})}static fromPromise(t){return new e(async e=>{e.emitMany(await t)})}static fromPromises(t){return new e(async e=>{await Promise.all(t.map(async t=>e.emitOne(await t)))})}static merge(t){return new e(async e=>{await Promise.all(t.map(async t=>{for await(let n of t)e.emitOne(n)}))})}constructor(e,t){this._state=0,this._results=[],this._error=null,this._onReturn=t,this._onStateChanged=new N,queueMicrotask(async()=>{let t={emitOne:e=>this.emitOne(e),emitMany:e=>this.emitMany(e),reject:e=>this.reject(e)};try{await Promise.resolve(e(t)),this.resolve()}catch(e){this.reject(e)}finally{t.emitOne=void 0,t.emitMany=void 0,t.reject=void 0}})}[Symbol.asyncIterator](){let e=0;return{next:async()=>{do{if(this._state===2)throw this._error;if(e(this._onReturn?.(),{done:!0,value:void 0})}}static map(t,n){return new e(async e=>{for await(let r of t)e.emitOne(n(r))})}map(t){return e.map(this,t)}static filter(t,n){return new e(async e=>{for await(let r of t)n(r)&&e.emitOne(r)})}filter(t){return e.filter(this,t)}static coalesce(t){return e.filter(t,e=>!!e)}coalesce(){return e.coalesce(this)}static async toPromise(e){let t=[];for await(let n of e)t.push(n);return t}toPromise(){return e.toPromise(this)}emitOne(e){this._state===0&&(this._results.push(e),this._onStateChanged.fire())}emitMany(e){this._state===0&&(this._results=this._results.concat(e),this._onStateChanged.fire())}resolve(){this._state===0&&(this._state=1,this._onStateChanged.fire())}reject(e){this._state===0&&(this._state=2,this._error=e,this._onStateChanged.fire())}};In.EMPTY=In.fromArray([]);function Ln(e){return 55296<=e&&e<=56319}function Rn(e){return 56320<=e&&e<=57343}function zn(e,t){return(e-55296<<10)+(t-56320)+65536}function Bn(e){return Vn(e,0)}function Vn(e,t){switch(typeof e){case`object`:return e===null?Hn(349,t):Array.isArray(e)?Gn(e,t):Kn(e,t);case`string`:return Wn(e,t);case`boolean`:return Un(e,t);case`number`:return Hn(e,t);case`undefined`:return Hn(937,t);default:return Hn(617,t)}}function Hn(e,t){return(t<<5)-t+e|0}function Un(e,t){return Hn(e?433:863,t)}function Wn(e,t){t=Hn(149417,t);for(let n=0,r=e.length;nVn(t,e),t)}function Kn(e,t){return t=Hn(181387,t),Object.keys(e).sort().reduce((t,n)=>(t=Wn(n,t),Vn(e[n],t)),t)}function qn(e,t,n=32){let r=n-t,i=~((1<>>r)>>>0}function Jn(e,t=0,n=e.byteLength,r=0){for(let i=0;ie.toString(16).padStart(2,`0`)).join(``):Yn((e>>>0).toString(16),t/4)}var Zn=class e{constructor(){this._h0=1732584193,this._h1=4023233417,this._h2=2562383102,this._h3=271733878,this._h4=3285377520,this._buff=new Uint8Array(67),this._buffDV=new DataView(this._buff.buffer),this._buffLen=0,this._totalLen=0,this._leftoverHighSurrogate=0,this._finished=!1}update(e){let t=e.length;if(t===0)return;let n=this._buff,r=this._buffLen,i=this._leftoverHighSurrogate,a,o;for(i===0?(a=e.charCodeAt(0),o=0):(a=i,o=-1,i=0);;){let s=a;if(Ln(a))if(o+1>>6,e[t++]=128|(n&63)>>>0):n<65536?(e[t++]=224|(n&61440)>>>12,e[t++]=128|(n&4032)>>>6,e[t++]=128|(n&63)>>>0):(e[t++]=240|(n&1835008)>>>18,e[t++]=128|(n&258048)>>>12,e[t++]=128|(n&4032)>>>6,e[t++]=128|(n&63)>>>0),t>=64&&(this._step(),t-=64,this._totalLen+=64,e[0]=e[64],e[1]=e[65],e[2]=e[66]),t}digest(){return this._finished||(this._finished=!0,this._leftoverHighSurrogate&&(this._leftoverHighSurrogate=0,this._buffLen=this._push(this._buff,this._buffLen,65533)),this._totalLen+=this._buffLen,this._wrapUp()),Xn(this._h0)+Xn(this._h1)+Xn(this._h2)+Xn(this._h3)+Xn(this._h4)}_wrapUp(){this._buff[this._buffLen++]=128,Jn(this._buff,this._buffLen),this._buffLen>56&&(this._step(),Jn(this._buff));let e=8*this._totalLen;this._buffDV.setUint32(56,Math.floor(e/4294967296),!1),this._buffDV.setUint32(60,e%4294967296,!1),this._step()}_step(){let t=e._bigBlock32,n=this._buffDV;for(let e=0;e<64;e+=4)t.setUint32(e,n.getUint32(e,!1),!1);for(let e=64;e<320;e+=4)t.setUint32(e,qn(t.getUint32(e-12,!1)^t.getUint32(e-32,!1)^t.getUint32(e-56,!1)^t.getUint32(e-64,!1),1),!1);let r=this._h0,i=this._h1,a=this._h2,o=this._h3,s=this._h4,c,l,u;for(let e=0;e<80;e++)e<20?(c=i&a|~i&o,l=1518500249):e<40?(c=i^a^o,l=1859775393):e<60?(c=i&a|i&o|a&o,l=2400959708):(c=i^a^o,l=3395469782),u=qn(r,5)+c+s+l+t.getUint32(e*4,!1)&4294967295,s=o,o=a,a=qn(i,30),i=r,r=u;this._h0=this._h0+r&4294967295,this._h1=this._h1+i&4294967295,this._h2=this._h2+a&4294967295,this._h3=this._h3+o&4294967295,this._h4=this._h4+s&4294967295}};Zn._bigBlock32=new DataView(new ArrayBuffer(320));var{registerWindow:Qn,getWindow:$n,getDocument:er,getWindows:tr,getWindowsCount:nr,getWindowId:rr,getWindowById:ir,hasWindow:ar,onDidRegisterWindow:or,onWillUnregisterWindow:sr,onDidUnregisterWindow:cr}=function(){let e=new Map,t={window:mt,disposables:new ft};e.set(mt.vscodeWindowId,t);let n=new N,r=new N,i=new N;function a(n,r){return(typeof n==`number`?e.get(n):void 0)??(r?t:void 0)}return{onDidRegisterWindow:n.event,onWillUnregisterWindow:i.event,onDidUnregisterWindow:r.event,registerWindow(t){if(e.has(t.vscodeWindowId))return A.None;let a=new ft,o={window:t,disposables:a.add(new ft)};return e.set(t.vscodeWindowId,o),a.add(k(()=>{e.delete(t.vscodeWindowId),r.fire(t)})),a.add(P(t,F.BEFORE_UNLOAD,()=>{i.fire(t)})),n.fire(o),a},getWindows(){return e.values()},getWindowsCount(){return e.size},getWindowId(e){return e.vscodeWindowId},hasWindow(t){return e.has(t)},getWindowById:a,getWindow(e){let t=e;if(t?.ownerDocument?.defaultView)return t.ownerDocument.defaultView.window;let n=e;return n?.view?n.view.window:mt},getDocument(e){return $n(e).document}}}(),lr=class{constructor(e,t,n,r){this._node=e,this._type=t,this._handler=n,this._options=r||!1,this._node.addEventListener(this._type,this._handler,this._options)}dispose(){this._handler&&=(this._node.removeEventListener(this._type,this._handler,this._options),this._node=null,null)}};function P(e,t,n,r){return new lr(e,t,n,r)}function ur(e,t){return function(n){return t(new On(e,n))}}function dr(e){return function(t){return e(new wn(t))}}var fr=function(e,t,n,r){let i=n;return t===`click`||t===`mousedown`||t===`contextmenu`?i=ur($n(e),n):(t===`keydown`||t===`keypress`||t===`keyup`)&&(i=dr(n)),P(e,t,i,r)},pr,mr=class extends Pn{constructor(e){super(),this.defaultTarget=e&&$n(e)}cancelAndSet(e,t,n){return super.cancelAndSet(e,t,n??this.defaultTarget)}},hr=class{constructor(e,t=0){this._runner=e,this.priority=t,this._canceled=!1}dispose(){this._canceled=!0}execute(){if(!this._canceled)try{this._runner()}catch(e){ze(e)}}static sort(e,t){return t.priority-e.priority}};(function(){let e=new Map,t=new Map,n=new Map,r=new Map,i=i=>{n.set(i,!1);let a=e.get(i)??[];for(t.set(i,a),e.set(i,[]),r.set(i,!0);a.length>0;)a.sort(hr.sort),a.shift().execute();r.set(i,!1)};pr=(t,r,a=0)=>{let o=rr(t),s=new hr(r,a),c=e.get(o);return c||(c=[],e.set(o,c)),c.push(s),n.get(o)||(n.set(o,!0),t.requestAnimationFrame(()=>i(o))),s}})();var gr=class e{constructor(e,t){this.width=e,this.height=t}with(t=this.width,n=this.height){return t!==this.width||n!==this.height?new e(t,n):this}static is(e){return typeof e==`object`&&typeof e.height==`number`&&typeof e.width==`number`}static lift(t){return t instanceof e?t:new e(t.width,t.height)}static equals(e,t){return e===t?!0:!e||!t?!1:e.width===t.width&&e.height===t.height}};gr.None=new gr(0,0);function _r(e){let t=e.getBoundingClientRect(),n=$n(e);return{left:t.left+n.scrollX,top:t.top+n.scrollY,width:t.width,height:t.height}}new class{constructor(){this.mutationObservers=new Map}observe(e,t,n){let r=this.mutationObservers.get(e);r||(r=new Map,this.mutationObservers.set(e,r));let i=Bn(n),a=r.get(i);if(a)a.users+=1;else{let o=new N,s=new MutationObserver(e=>o.fire(e));s.observe(e,n);let c=a={users:1,observer:s,onDidMutate:o.event};t.add(k(()=>{--c.users,c.users===0&&(o.dispose(),s.disconnect(),r?.delete(i),r?.size===0&&this.mutationObservers.delete(e))})),r.set(i,a)}return a.onDidMutate}};var F={CLICK:`click`,AUXCLICK:`auxclick`,DBLCLICK:`dblclick`,MOUSE_UP:`mouseup`,MOUSE_DOWN:`mousedown`,MOUSE_OVER:`mouseover`,MOUSE_MOVE:`mousemove`,MOUSE_OUT:`mouseout`,MOUSE_ENTER:`mouseenter`,MOUSE_LEAVE:`mouseleave`,MOUSE_WHEEL:`wheel`,POINTER_UP:`pointerup`,POINTER_DOWN:`pointerdown`,POINTER_MOVE:`pointermove`,POINTER_LEAVE:`pointerleave`,CONTEXT_MENU:`contextmenu`,WHEEL:`wheel`,KEY_DOWN:`keydown`,KEY_PRESS:`keypress`,KEY_UP:`keyup`,LOAD:`load`,BEFORE_UNLOAD:`beforeunload`,UNLOAD:`unload`,PAGE_SHOW:`pageshow`,PAGE_HIDE:`pagehide`,PASTE:`paste`,ABORT:`abort`,ERROR:`error`,RESIZE:`resize`,SCROLL:`scroll`,FULLSCREEN_CHANGE:`fullscreenchange`,WK_FULLSCREEN_CHANGE:`webkitfullscreenchange`,SELECT:`select`,CHANGE:`change`,SUBMIT:`submit`,RESET:`reset`,FOCUS:`focus`,FOCUS_IN:`focusin`,FOCUS_OUT:`focusout`,BLUR:`blur`,INPUT:`input`,STORAGE:`storage`,DRAG_START:`dragstart`,DRAG:`drag`,DRAG_ENTER:`dragenter`,DRAG_LEAVE:`dragleave`,DRAG_OVER:`dragover`,DROP:`drop`,DRAG_END:`dragend`,ANIMATION_START:Rt?`webkitAnimationStart`:`animationstart`,ANIMATION_END:Rt?`webkitAnimationEnd`:`animationend`,ANIMATION_ITERATION:Rt?`webkitAnimationIteration`:`animationiteration`},vr=/([\w\-]+)?(#([\w\-]+))?((\.([\w\-]+))*)/;function yr(e,t,n,...r){let i=vr.exec(t);if(!i)throw Error(`Bad use of emmet`);let a=i[1]||`div`,o;return o=e===`http://www.w3.org/1999/xhtml`?document.createElement(a):document.createElementNS(e,a),i[3]&&(o.id=i[3]),i[4]&&(o.className=i[4].replace(/\./g,` `).trim()),n&&Object.entries(n).forEach(([e,t])=>{typeof t>`u`||(/^on\w+$/.test(e)?o[e]=t:e===`selected`?t&&o.setAttribute(e,`true`):o.setAttribute(e,t))}),o.append(...r),o}function br(e,t,...n){return yr(`http://www.w3.org/1999/xhtml`,e,t,...n)}br.SVG=function(e,t,...n){return yr(`http://www.w3.org/2000/svg`,e,t,...n)};var xr=class{constructor(e){this.domNode=e,this._maxWidth=``,this._width=``,this._height=``,this._top=``,this._left=``,this._bottom=``,this._right=``,this._paddingTop=``,this._paddingLeft=``,this._paddingBottom=``,this._paddingRight=``,this._fontFamily=``,this._fontWeight=``,this._fontSize=``,this._fontStyle=``,this._fontFeatureSettings=``,this._fontVariationSettings=``,this._textDecoration=``,this._lineHeight=``,this._letterSpacing=``,this._className=``,this._display=``,this._position=``,this._visibility=``,this._color=``,this._backgroundColor=``,this._layerHint=!1,this._contain=`none`,this._boxShadow=``}setMaxWidth(e){let t=I(e);this._maxWidth!==t&&(this._maxWidth=t,this.domNode.style.maxWidth=this._maxWidth)}setWidth(e){let t=I(e);this._width!==t&&(this._width=t,this.domNode.style.width=this._width)}setHeight(e){let t=I(e);this._height!==t&&(this._height=t,this.domNode.style.height=this._height)}setTop(e){let t=I(e);this._top!==t&&(this._top=t,this.domNode.style.top=this._top)}setLeft(e){let t=I(e);this._left!==t&&(this._left=t,this.domNode.style.left=this._left)}setBottom(e){let t=I(e);this._bottom!==t&&(this._bottom=t,this.domNode.style.bottom=this._bottom)}setRight(e){let t=I(e);this._right!==t&&(this._right=t,this.domNode.style.right=this._right)}setPaddingTop(e){let t=I(e);this._paddingTop!==t&&(this._paddingTop=t,this.domNode.style.paddingTop=this._paddingTop)}setPaddingLeft(e){let t=I(e);this._paddingLeft!==t&&(this._paddingLeft=t,this.domNode.style.paddingLeft=this._paddingLeft)}setPaddingBottom(e){let t=I(e);this._paddingBottom!==t&&(this._paddingBottom=t,this.domNode.style.paddingBottom=this._paddingBottom)}setPaddingRight(e){let t=I(e);this._paddingRight!==t&&(this._paddingRight=t,this.domNode.style.paddingRight=this._paddingRight)}setFontFamily(e){this._fontFamily!==e&&(this._fontFamily=e,this.domNode.style.fontFamily=this._fontFamily)}setFontWeight(e){this._fontWeight!==e&&(this._fontWeight=e,this.domNode.style.fontWeight=this._fontWeight)}setFontSize(e){let t=I(e);this._fontSize!==t&&(this._fontSize=t,this.domNode.style.fontSize=this._fontSize)}setFontStyle(e){this._fontStyle!==e&&(this._fontStyle=e,this.domNode.style.fontStyle=this._fontStyle)}setFontFeatureSettings(e){this._fontFeatureSettings!==e&&(this._fontFeatureSettings=e,this.domNode.style.fontFeatureSettings=this._fontFeatureSettings)}setFontVariationSettings(e){this._fontVariationSettings!==e&&(this._fontVariationSettings=e,this.domNode.style.fontVariationSettings=this._fontVariationSettings)}setTextDecoration(e){this._textDecoration!==e&&(this._textDecoration=e,this.domNode.style.textDecoration=this._textDecoration)}setLineHeight(e){let t=I(e);this._lineHeight!==t&&(this._lineHeight=t,this.domNode.style.lineHeight=this._lineHeight)}setLetterSpacing(e){let t=I(e);this._letterSpacing!==t&&(this._letterSpacing=t,this.domNode.style.letterSpacing=this._letterSpacing)}setClassName(e){this._className!==e&&(this._className=e,this.domNode.className=this._className)}toggleClassName(e,t){this.domNode.classList.toggle(e,t),this._className=this.domNode.className}setDisplay(e){this._display!==e&&(this._display=e,this.domNode.style.display=this._display)}setPosition(e){this._position!==e&&(this._position=e,this.domNode.style.position=this._position)}setVisibility(e){this._visibility!==e&&(this._visibility=e,this.domNode.style.visibility=this._visibility)}setColor(e){this._color!==e&&(this._color=e,this.domNode.style.color=this._color)}setBackgroundColor(e){this._backgroundColor!==e&&(this._backgroundColor=e,this.domNode.style.backgroundColor=this._backgroundColor)}setLayerHinting(e){this._layerHint!==e&&(this._layerHint=e,this.domNode.style.transform=this._layerHint?`translate3d(0px, 0px, 0px)`:``)}setBoxShadow(e){this._boxShadow!==e&&(this._boxShadow=e,this.domNode.style.boxShadow=e)}setContain(e){this._contain!==e&&(this._contain=e,this.domNode.style.contain=this._contain)}setAttribute(e,t){this.domNode.setAttribute(e,t)}removeAttribute(e){this.domNode.removeAttribute(e)}appendChild(e){this.domNode.appendChild(e.domNode)}removeChild(e){this.domNode.removeChild(e.domNode)}};function I(e){return typeof e==`number`?`${e}px`:e}function Sr(e){return new xr(e)}var Cr=class{constructor(){this._hooks=new ft,this._pointerMoveCallback=null,this._onStopCallback=null}dispose(){this.stopMonitoring(!1),this._hooks.dispose()}stopMonitoring(e,t){if(!this.isMonitoring())return;this._hooks.clear(),this._pointerMoveCallback=null;let n=this._onStopCallback;this._onStopCallback=null,e&&n&&n(t)}isMonitoring(){return!!this._pointerMoveCallback}startMonitoring(e,t,n,r,i){this.isMonitoring()&&this.stopMonitoring(!1),this._pointerMoveCallback=r,this._onStopCallback=i;let a=e;try{e.setPointerCapture(t),this._hooks.add(k(()=>{try{e.releasePointerCapture(t)}catch{}}))}catch{a=$n(e)}this._hooks.add(P(a,F.POINTER_MOVE,e=>{if(e.buttons!==n){this.stopMonitoring(!0);return}e.preventDefault(),this._pointerMoveCallback(e)})),this._hooks.add(P(a,F.POINTER_UP,e=>this.stopMonitoring(!0)))}};function wr(e,t,n){let r=null,i=null;if(typeof n.value==`function`?(r=`value`,i=n.value,i.length!==0&&console.warn(`Memoize should only be used in functions with zero parameters`)):typeof n.get==`function`&&(r=`get`,i=n.get),!i)throw Error(`not supported`);let a=`$memoize$${t}`;n[r]=function(...e){return this.hasOwnProperty(a)||Object.defineProperty(this,a,{configurable:!1,enumerable:!1,writable:!1,value:i.apply(this,e)}),this[a]}}var Tr;(e=>(e.Tap=`-xterm-gesturetap`,e.Change=`-xterm-gesturechange`,e.Start=`-xterm-gesturestart`,e.End=`-xterm-gesturesend`,e.Contextmenu=`-xterm-gesturecontextmenu`))(Tr||={});var Er=class e extends A{constructor(){super(),this.dispatched=!1,this.targets=new gt,this.ignoreTargets=new gt,this.activeTouches={},this.handle=null,this._lastSetTapCountTime=0,this._register(M.runAndSubscribe(or,({window:e,disposables:t})=>{t.add(P(e.document,`touchstart`,e=>this.onTouchStart(e),{passive:!1})),t.add(P(e.document,`touchend`,t=>this.onTouchEnd(e,t))),t.add(P(e.document,`touchmove`,e=>this.onTouchMove(e),{passive:!1}))},{window:mt,disposables:this._store}))}static addTarget(t){return e.isTouchDevice()?(e.INSTANCE||=ct(new e),k(e.INSTANCE.targets.push(t))):A.None}static ignoreTarget(t){return e.isTouchDevice()?(e.INSTANCE||=ct(new e),k(e.INSTANCE.ignoreTargets.push(t))):A.None}static isTouchDevice(){return`ontouchstart`in mt||navigator.maxTouchPoints>0}dispose(){this.handle&&=(this.handle.dispose(),null),super.dispose()}onTouchStart(e){let t=Date.now();this.handle&&=(this.handle.dispose(),null);for(let n=0,r=e.targetTouches.length;n=e.HOLD_DELAY&&Math.abs(s.initialPageX-Je(s.rollingPageX))<30&&Math.abs(s.initialPageY-Je(s.rollingPageY))<30){let e=this.newGestureEvent(Tr.Contextmenu,s.initialTarget);e.pageX=Je(s.rollingPageX),e.pageY=Je(s.rollingPageY),this.dispatchEvent(e)}else if(i===1){let e=Je(s.rollingPageX),n=Je(s.rollingPageY),i=Je(s.rollingTimestamps)-s.rollingTimestamps[0],a=e-s.rollingPageX[0],o=n-s.rollingPageY[0],c=[...this.targets].filter(e=>s.initialTarget instanceof Node&&e.contains(s.initialTarget));this.inertia(t,c,r,Math.abs(a)/i,a>0?1:-1,e,Math.abs(o)/i,o>0?1:-1,n)}this.dispatchEvent(this.newGestureEvent(Tr.End,s.initialTarget)),delete this.activeTouches[o.identifier]}this.dispatched&&=(n.preventDefault(),n.stopPropagation(),!1)}newGestureEvent(e,t){let n=document.createEvent(`CustomEvent`);return n.initEvent(e,!1,!0),n.initialTarget=t,n.tapCount=0,n}dispatchEvent(t){if(t.type===Tr.Tap){let n=new Date().getTime(),r=0;r=n-this._lastSetTapCountTime>e.CLEAR_TAP_COUNT_TIME?1:2,this._lastSetTapCountTime=n,t.tapCount=r}else(t.type===Tr.Change||t.type===Tr.Contextmenu)&&(this._lastSetTapCountTime=0);if(t.initialTarget instanceof Node){for(let e of this.ignoreTargets)if(e.contains(t.initialTarget))return;let e=[];for(let n of this.targets)if(n.contains(t.initialTarget)){let r=0,i=t.initialTarget;for(;i&&i!==n;)r++,i=i.parentElement;e.push([r,n])}e.sort((e,t)=>e[0]-t[0]);for(let[n,r]of e)r.dispatchEvent(t),this.dispatched=!0}}inertia(t,n,r,i,a,o,s,c,l){this.handle=pr(t,()=>{let u=Date.now(),d=u-r,f=0,p=0,m=!0;i+=e.SCROLL_FRICTION*d,s+=e.SCROLL_FRICTION*d,i>0&&(m=!1,f=a*i*d),s>0&&(m=!1,p=c*s*d);let h=this.newGestureEvent(Tr.Change);h.translationX=f,h.translationY=p,n.forEach(e=>e.dispatchEvent(h)),m||this.inertia(t,n,u,i,a,o+f,s,c,l+p)})}onTouchMove(e){let t=Date.now();for(let n=0,r=e.changedTouches.length;n3&&(i.rollingPageX.shift(),i.rollingPageY.shift(),i.rollingTimestamps.shift()),i.rollingPageX.push(r.pageX),i.rollingPageY.push(r.pageY),i.rollingTimestamps.push(t)}this.dispatched&&=(e.preventDefault(),e.stopPropagation(),!1)}};Er.SCROLL_FRICTION=-.005,Er.HOLD_DELAY=700,Er.CLEAR_TAP_COUNT_TIME=400,y([wr],Er,`isTouchDevice`,1);var Dr=Er,Or=class extends A{onclick(e,t){this._register(P(e,F.CLICK,n=>t(new On($n(e),n))))}onmousedown(e,t){this._register(P(e,F.MOUSE_DOWN,n=>t(new On($n(e),n))))}onmouseover(e,t){this._register(P(e,F.MOUSE_OVER,n=>t(new On($n(e),n))))}onmouseleave(e,t){this._register(P(e,F.MOUSE_LEAVE,n=>t(new On($n(e),n))))}onkeydown(e,t){this._register(P(e,F.KEY_DOWN,e=>t(new wn(e))))}onkeyup(e,t){this._register(P(e,F.KEY_UP,e=>t(new wn(e))))}oninput(e,t){this._register(P(e,F.INPUT,t))}onblur(e,t){this._register(P(e,F.BLUR,t))}onfocus(e,t){this._register(P(e,F.FOCUS,t))}onchange(e,t){this._register(P(e,F.CHANGE,t))}ignoreGesture(e){return Dr.ignoreTarget(e)}},kr=11,Ar=class extends Or{constructor(e){super(),this._onActivate=e.onActivate,this.bgDomNode=document.createElement(`div`),this.bgDomNode.className=`arrow-background`,this.bgDomNode.style.position=`absolute`,this.bgDomNode.style.width=e.bgWidth+`px`,this.bgDomNode.style.height=e.bgHeight+`px`,typeof e.top<`u`&&(this.bgDomNode.style.top=`0px`),typeof e.left<`u`&&(this.bgDomNode.style.left=`0px`),typeof e.bottom<`u`&&(this.bgDomNode.style.bottom=`0px`),typeof e.right<`u`&&(this.bgDomNode.style.right=`0px`),this.domNode=document.createElement(`div`),this.domNode.className=e.className,this.domNode.style.position=`absolute`,this.domNode.style.width=kr+`px`,this.domNode.style.height=kr+`px`,typeof e.top<`u`&&(this.domNode.style.top=e.top+`px`),typeof e.left<`u`&&(this.domNode.style.left=e.left+`px`),typeof e.bottom<`u`&&(this.domNode.style.bottom=e.bottom+`px`),typeof e.right<`u`&&(this.domNode.style.right=e.right+`px`),this._pointerMoveMonitor=this._register(new Cr),this._register(fr(this.bgDomNode,F.POINTER_DOWN,e=>this._arrowPointerDown(e))),this._register(fr(this.domNode,F.POINTER_DOWN,e=>this._arrowPointerDown(e))),this._pointerdownRepeatTimer=this._register(new mr),this._pointerdownScheduleRepeatTimer=this._register(new Nn)}_arrowPointerDown(e){!e.target||!(e.target instanceof Element)||(this._onActivate(),this._pointerdownRepeatTimer.cancel(),this._pointerdownScheduleRepeatTimer.cancelAndSet(()=>{this._pointerdownRepeatTimer.cancelAndSet(()=>this._onActivate(),1e3/24,$n(e))},200),this._pointerMoveMonitor.startMonitoring(e.target,e.pointerId,e.buttons,e=>{},()=>{this._pointerdownRepeatTimer.cancel(),this._pointerdownScheduleRepeatTimer.cancel()}),e.preventDefault())}},jr=class e{constructor(e,t,n,r,i,a,o){this._forceIntegerValues=e,this._scrollStateBrand=void 0,this._forceIntegerValues&&(t|=0,n|=0,r|=0,i|=0,a|=0,o|=0),this.rawScrollLeft=r,this.rawScrollTop=o,t<0&&(t=0),r+t>n&&(r=n-t),r<0&&(r=0),i<0&&(i=0),o+i>a&&(o=a-i),o<0&&(o=0),this.width=t,this.scrollWidth=n,this.scrollLeft=r,this.height=i,this.scrollHeight=a,this.scrollTop=o}equals(e){return this.rawScrollLeft===e.rawScrollLeft&&this.rawScrollTop===e.rawScrollTop&&this.width===e.width&&this.scrollWidth===e.scrollWidth&&this.scrollLeft===e.scrollLeft&&this.height===e.height&&this.scrollHeight===e.scrollHeight&&this.scrollTop===e.scrollTop}withScrollDimensions(t,n){return new e(this._forceIntegerValues,typeof t.width<`u`?t.width:this.width,typeof t.scrollWidth<`u`?t.scrollWidth:this.scrollWidth,n?this.rawScrollLeft:this.scrollLeft,typeof t.height<`u`?t.height:this.height,typeof t.scrollHeight<`u`?t.scrollHeight:this.scrollHeight,n?this.rawScrollTop:this.scrollTop)}withScrollPosition(t){return new e(this._forceIntegerValues,this.width,this.scrollWidth,typeof t.scrollLeft<`u`?t.scrollLeft:this.rawScrollLeft,this.height,this.scrollHeight,typeof t.scrollTop<`u`?t.scrollTop:this.rawScrollTop)}createScrollEvent(e,t){let n=this.width!==e.width,r=this.scrollWidth!==e.scrollWidth,i=this.scrollLeft!==e.scrollLeft,a=this.height!==e.height,o=this.scrollHeight!==e.scrollHeight,s=this.scrollTop!==e.scrollTop;return{inSmoothScrolling:t,oldWidth:e.width,oldScrollWidth:e.scrollWidth,oldScrollLeft:e.scrollLeft,width:this.width,scrollWidth:this.scrollWidth,scrollLeft:this.scrollLeft,oldHeight:e.height,oldScrollHeight:e.scrollHeight,oldScrollTop:e.scrollTop,height:this.height,scrollHeight:this.scrollHeight,scrollTop:this.scrollTop,widthChanged:n,scrollWidthChanged:r,scrollLeftChanged:i,heightChanged:a,scrollHeightChanged:o,scrollTopChanged:s}}},Mr=class extends A{constructor(e){super(),this._scrollableBrand=void 0,this._onScroll=this._register(new N),this.onScroll=this._onScroll.event,this._smoothScrollDuration=e.smoothScrollDuration,this._scheduleAtNextAnimationFrame=e.scheduleAtNextAnimationFrame,this._state=new jr(e.forceIntegerValues,0,0,0,0,0,0),this._smoothScrolling=null}dispose(){this._smoothScrolling&&=(this._smoothScrolling.dispose(),null),super.dispose()}setSmoothScrollDuration(e){this._smoothScrollDuration=e}validateScrollPosition(e){return this._state.withScrollPosition(e)}getScrollDimensions(){return this._state}setScrollDimensions(e,t){let n=this._state.withScrollDimensions(e,t);this._setState(n,!!this._smoothScrolling),this._smoothScrolling?.acceptScrollDimensions(this._state)}getFutureScrollPosition(){return this._smoothScrolling?this._smoothScrolling.to:this._state}getCurrentScrollPosition(){return this._state}setScrollPositionNow(e){let t=this._state.withScrollPosition(e);this._smoothScrolling&&=(this._smoothScrolling.dispose(),null),this._setState(t,!1)}setScrollPositionSmooth(e,t){if(this._smoothScrollDuration===0)return this.setScrollPositionNow(e);if(this._smoothScrolling){e={scrollLeft:typeof e.scrollLeft>`u`?this._smoothScrolling.to.scrollLeft:e.scrollLeft,scrollTop:typeof e.scrollTop>`u`?this._smoothScrolling.to.scrollTop:e.scrollTop};let n=this._state.withScrollPosition(e);if(this._smoothScrolling.to.scrollLeft===n.scrollLeft&&this._smoothScrolling.to.scrollTop===n.scrollTop)return;let r;r=t?new Ir(this._smoothScrolling.from,n,this._smoothScrolling.startTime,this._smoothScrolling.duration):this._smoothScrolling.combine(this._state,n,this._smoothScrollDuration),this._smoothScrolling.dispose(),this._smoothScrolling=r}else{let t=this._state.withScrollPosition(e);this._smoothScrolling=Ir.start(this._state,t,this._smoothScrollDuration)}this._smoothScrolling.animationFrameDisposable=this._scheduleAtNextAnimationFrame(()=>{this._smoothScrolling&&(this._smoothScrolling.animationFrameDisposable=null,this._performSmoothScrolling())})}hasPendingScrollAnimation(){return!!this._smoothScrolling}_performSmoothScrolling(){if(!this._smoothScrolling)return;let e=this._smoothScrolling.tick(),t=this._state.withScrollPosition(e);if(this._setState(t,!0),this._smoothScrolling){if(e.isDone){this._smoothScrolling.dispose(),this._smoothScrolling=null;return}this._smoothScrolling.animationFrameDisposable=this._scheduleAtNextAnimationFrame(()=>{this._smoothScrolling&&(this._smoothScrolling.animationFrameDisposable=null,this._performSmoothScrolling())})}}_setState(e,t){let n=this._state;n.equals(e)||(this._state=e,this._onScroll.fire(this._state.createScrollEvent(n,t)))}},Nr=class{constructor(e,t,n){this.scrollLeft=e,this.scrollTop=t,this.isDone=n}};function Pr(e,t){let n=t-e;return function(t){return e+n*Rr(t)}}function Fr(e,t,n){return function(r){return r2.5*n){let r,i;return e{this._domNode?.setClassName(this._visibleClassName)},0))}_hide(e){this._revealTimer.cancel(),this._isVisible&&(this._isVisible=!1,this._domNode?.setClassName(this._invisibleClassName+(e?` fade`:``)))}},Br=140,Vr=class extends Or{constructor(e){super(),this._lazyRender=e.lazyRender,this._host=e.host,this._scrollable=e.scrollable,this._scrollByPage=e.scrollByPage,this._scrollbarState=e.scrollbarState,this._visibilityController=this._register(new zr(e.visibility,`visible scrollbar `+e.extraScrollbarClassName,`invisible scrollbar `+e.extraScrollbarClassName)),this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._pointerMoveMonitor=this._register(new Cr),this._shouldRender=!0,this.domNode=Sr(document.createElement(`div`)),this.domNode.setAttribute(`role`,`presentation`),this.domNode.setAttribute(`aria-hidden`,`true`),this._visibilityController.setDomNode(this.domNode),this.domNode.setPosition(`absolute`),this._register(P(this.domNode.domNode,F.POINTER_DOWN,e=>this._domNodePointerDown(e)))}_createArrow(e){let t=this._register(new Ar(e));this.domNode.domNode.appendChild(t.bgDomNode),this.domNode.domNode.appendChild(t.domNode)}_createSlider(e,t,n,r){this.slider=Sr(document.createElement(`div`)),this.slider.setClassName(`slider`),this.slider.setPosition(`absolute`),this.slider.setTop(e),this.slider.setLeft(t),typeof n==`number`&&this.slider.setWidth(n),typeof r==`number`&&this.slider.setHeight(r),this.slider.setLayerHinting(!0),this.slider.setContain(`strict`),this.domNode.domNode.appendChild(this.slider.domNode),this._register(P(this.slider.domNode,F.POINTER_DOWN,e=>{e.button===0&&(e.preventDefault(),this._sliderPointerDown(e))})),this.onclick(this.slider.domNode,e=>{e.leftButton&&e.stopPropagation()})}_onElementSize(e){return this._scrollbarState.setVisibleSize(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}_onElementScrollSize(e){return this._scrollbarState.setScrollSize(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}_onElementScrollPosition(e){return this._scrollbarState.setScrollPosition(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}beginReveal(){this._visibilityController.setShouldBeVisible(!0)}beginHide(){this._visibilityController.setShouldBeVisible(!1)}render(){this._shouldRender&&(this._shouldRender=!1,this._renderDomNode(this._scrollbarState.getRectangleLargeSize(),this._scrollbarState.getRectangleSmallSize()),this._updateSlider(this._scrollbarState.getSliderSize(),this._scrollbarState.getArrowSize()+this._scrollbarState.getSliderPosition()))}_domNodePointerDown(e){e.target===this.domNode.domNode&&this._onPointerDown(e)}delegatePointerDown(e){let t=this.domNode.domNode.getClientRects()[0].top,n=t+this._scrollbarState.getSliderPosition(),r=t+this._scrollbarState.getSliderPosition()+this._scrollbarState.getSliderSize(),i=this._sliderPointerPosition(e);n<=i&&i<=r?e.button===0&&(e.preventDefault(),this._sliderPointerDown(e)):this._onPointerDown(e)}_onPointerDown(e){let t,n;if(e.target===this.domNode.domNode&&typeof e.offsetX==`number`&&typeof e.offsetY==`number`)t=e.offsetX,n=e.offsetY;else{let r=_r(this.domNode.domNode);t=e.pageX-r.left,n=e.pageY-r.top}let r=this._pointerDownRelativePosition(t,n);this._setDesiredScrollPositionNow(this._scrollByPage?this._scrollbarState.getDesiredScrollPositionFromOffsetPaged(r):this._scrollbarState.getDesiredScrollPositionFromOffset(r)),e.button===0&&(e.preventDefault(),this._sliderPointerDown(e))}_sliderPointerDown(e){if(!e.target||!(e.target instanceof Element))return;let t=this._sliderPointerPosition(e),n=this._sliderOrthogonalPointerPosition(e),r=this._scrollbarState.clone();this.slider.toggleClassName(`active`,!0),this._pointerMoveMonitor.startMonitoring(e.target,e.pointerId,e.buttons,e=>{let i=this._sliderOrthogonalPointerPosition(e),a=Math.abs(i-n);if(en&&a>Br){this._setDesiredScrollPositionNow(r.getScrollPosition());return}let o=this._sliderPointerPosition(e)-t;this._setDesiredScrollPositionNow(r.getDesiredScrollPositionFromDelta(o))},()=>{this.slider.toggleClassName(`active`,!1),this._host.onDragEnd()}),this._host.onDragStart()}_setDesiredScrollPositionNow(e){let t={};this.writeScrollPosition(t,e),this._scrollable.setScrollPositionNow(t)}updateScrollbarSize(e){this._updateScrollbarSize(e),this._scrollbarState.setScrollbarSize(e),this._shouldRender=!0,this._lazyRender||this.render()}isNeeded(){return this._scrollbarState.isNeeded()}},Hr=class e{constructor(e,t,n,r,i,a){this._scrollbarSize=Math.round(t),this._oppositeScrollbarSize=Math.round(n),this._arrowSize=Math.round(e),this._visibleSize=r,this._scrollSize=i,this._scrollPosition=a,this._computedAvailableSize=0,this._computedIsNeeded=!1,this._computedSliderSize=0,this._computedSliderRatio=0,this._computedSliderPosition=0,this._refreshComputedValues()}clone(){return new e(this._arrowSize,this._scrollbarSize,this._oppositeScrollbarSize,this._visibleSize,this._scrollSize,this._scrollPosition)}setVisibleSize(e){let t=Math.round(e);return this._visibleSize===t?!1:(this._visibleSize=t,this._refreshComputedValues(),!0)}setScrollSize(e){let t=Math.round(e);return this._scrollSize===t?!1:(this._scrollSize=t,this._refreshComputedValues(),!0)}setScrollPosition(e){let t=Math.round(e);return this._scrollPosition===t?!1:(this._scrollPosition=t,this._refreshComputedValues(),!0)}setScrollbarSize(e){this._scrollbarSize=Math.round(e)}setOppositeScrollbarSize(e){this._oppositeScrollbarSize=Math.round(e)}static _computeValues(e,t,n,r,i){let a=Math.max(0,n-e),o=Math.max(0,a-2*t),s=r>0&&r>n;if(!s)return{computedAvailableSize:Math.round(a),computedIsNeeded:s,computedSliderSize:Math.round(o),computedSliderRatio:0,computedSliderPosition:0};let c=Math.round(Math.max(20,Math.floor(n*o/r))),l=(o-c)/(r-n),u=i*l;return{computedAvailableSize:Math.round(a),computedIsNeeded:s,computedSliderSize:Math.round(c),computedSliderRatio:l,computedSliderPosition:Math.round(u)}}_refreshComputedValues(){let t=e._computeValues(this._oppositeScrollbarSize,this._arrowSize,this._visibleSize,this._scrollSize,this._scrollPosition);this._computedAvailableSize=t.computedAvailableSize,this._computedIsNeeded=t.computedIsNeeded,this._computedSliderSize=t.computedSliderSize,this._computedSliderRatio=t.computedSliderRatio,this._computedSliderPosition=t.computedSliderPosition}getArrowSize(){return this._arrowSize}getScrollPosition(){return this._scrollPosition}getRectangleLargeSize(){return this._computedAvailableSize}getRectangleSmallSize(){return this._scrollbarSize}isNeeded(){return this._computedIsNeeded}getSliderSize(){return this._computedSliderSize}getSliderPosition(){return this._computedSliderPosition}getDesiredScrollPositionFromOffset(e){if(!this._computedIsNeeded)return 0;let t=e-this._arrowSize-this._computedSliderSize/2;return Math.round(t/this._computedSliderRatio)}getDesiredScrollPositionFromOffsetPaged(e){if(!this._computedIsNeeded)return 0;let t=e-this._arrowSize,n=this._scrollPosition;return t0&&Math.abs(e.deltaY)>0)return 1;let n=.5;if((!this._isAlmostInt(e.deltaX)||!this._isAlmostInt(e.deltaY))&&(n+=.25),t){let r=Math.abs(e.deltaX),i=Math.abs(e.deltaY),a=Math.abs(t.deltaX),o=Math.abs(t.deltaY),s=Math.max(Math.min(r,a),1),c=Math.max(Math.min(i,o),1),l=Math.max(r,a),u=Math.max(i,o);l%s===0&&u%c===0&&(n-=.5)}return Math.min(Math.max(n,0),1)}_isAlmostInt(e){return Math.abs(Math.round(e)-e)<.01}};Yr.INSTANCE=new Yr;var Xr=Yr,Zr=class extends Or{constructor(e,t,n){super(),this._onScroll=this._register(new N),this.onScroll=this._onScroll.event,this._onWillScroll=this._register(new N),this.onWillScroll=this._onWillScroll.event,this._options=$r(t),this._scrollable=n,this._register(this._scrollable.onScroll(e=>{this._onWillScroll.fire(e),this._onDidScroll(e),this._onScroll.fire(e)}));let r={onMouseWheel:e=>this._onMouseWheel(e),onDragStart:()=>this._onDragStart(),onDragEnd:()=>this._onDragEnd()};this._verticalScrollbar=this._register(new Wr(this._scrollable,this._options,r)),this._horizontalScrollbar=this._register(new Ur(this._scrollable,this._options,r)),this._domNode=document.createElement(`div`),this._domNode.className=`xterm-scrollable-element `+this._options.className,this._domNode.setAttribute(`role`,`presentation`),this._domNode.style.position=`relative`,this._domNode.appendChild(e),this._domNode.appendChild(this._horizontalScrollbar.domNode.domNode),this._domNode.appendChild(this._verticalScrollbar.domNode.domNode),this._options.useShadows?(this._leftShadowDomNode=Sr(document.createElement(`div`)),this._leftShadowDomNode.setClassName(`shadow`),this._domNode.appendChild(this._leftShadowDomNode.domNode),this._topShadowDomNode=Sr(document.createElement(`div`)),this._topShadowDomNode.setClassName(`shadow`),this._domNode.appendChild(this._topShadowDomNode.domNode),this._topLeftShadowDomNode=Sr(document.createElement(`div`)),this._topLeftShadowDomNode.setClassName(`shadow`),this._domNode.appendChild(this._topLeftShadowDomNode.domNode)):(this._leftShadowDomNode=null,this._topShadowDomNode=null,this._topLeftShadowDomNode=null),this._listenOnDomNode=this._options.listenOnDomNode||this._domNode,this._mouseWheelToDispose=[],this._setListeningToMouseWheel(this._options.handleMouseWheel),this.onmouseover(this._listenOnDomNode,e=>this._onMouseOver(e)),this.onmouseleave(this._listenOnDomNode,e=>this._onMouseLeave(e)),this._hideTimeout=this._register(new Nn),this._isDragging=!1,this._mouseIsOver=!1,this._shouldRender=!0,this._revealOnScroll=!0}get options(){return this._options}dispose(){this._mouseWheelToDispose=lt(this._mouseWheelToDispose),super.dispose()}getDomNode(){return this._domNode}getOverviewRulerLayoutInfo(){return{parent:this._domNode,insertBefore:this._verticalScrollbar.domNode.domNode}}delegateVerticalScrollbarPointerDown(e){this._verticalScrollbar.delegatePointerDown(e)}getScrollDimensions(){return this._scrollable.getScrollDimensions()}setScrollDimensions(e){this._scrollable.setScrollDimensions(e,!1)}updateClassName(e){this._options.className=e,tn&&(this._options.className+=` mac`),this._domNode.className=`xterm-scrollable-element `+this._options.className}updateOptions(e){typeof e.handleMouseWheel<`u`&&(this._options.handleMouseWheel=e.handleMouseWheel,this._setListeningToMouseWheel(this._options.handleMouseWheel)),typeof e.mouseWheelScrollSensitivity<`u`&&(this._options.mouseWheelScrollSensitivity=e.mouseWheelScrollSensitivity),typeof e.fastScrollSensitivity<`u`&&(this._options.fastScrollSensitivity=e.fastScrollSensitivity),typeof e.scrollPredominantAxis<`u`&&(this._options.scrollPredominantAxis=e.scrollPredominantAxis),typeof e.horizontal<`u`&&(this._options.horizontal=e.horizontal),typeof e.vertical<`u`&&(this._options.vertical=e.vertical),typeof e.horizontalScrollbarSize<`u`&&(this._options.horizontalScrollbarSize=e.horizontalScrollbarSize),typeof e.verticalScrollbarSize<`u`&&(this._options.verticalScrollbarSize=e.verticalScrollbarSize),typeof e.scrollByPage<`u`&&(this._options.scrollByPage=e.scrollByPage),this._horizontalScrollbar.updateOptions(this._options),this._verticalScrollbar.updateOptions(this._options),this._options.lazyRender||this._render()}setRevealOnScroll(e){this._revealOnScroll=e}delegateScrollFromMouseWheelEvent(e){this._onMouseWheel(new kn(e))}_setListeningToMouseWheel(e){this._mouseWheelToDispose.length>0!==e&&(this._mouseWheelToDispose=lt(this._mouseWheelToDispose),e)&&this._mouseWheelToDispose.push(P(this._listenOnDomNode,F.MOUSE_WHEEL,e=>{this._onMouseWheel(new kn(e))},{passive:!1}))}_onMouseWheel(e){if(e.browserEvent?.defaultPrevented)return;let t=Xr.INSTANCE;qr&&t.acceptStandardWheelEvent(e);let n=!1;if(e.deltaY||e.deltaX){let r=e.deltaY*this._options.mouseWheelScrollSensitivity,i=e.deltaX*this._options.mouseWheelScrollSensitivity;this._options.scrollPredominantAxis&&(this._options.scrollYToX&&i+r===0?i=r=0:Math.abs(r)>=Math.abs(i)?i=0:r=0),this._options.flipAxes&&([r,i]=[i,r]);let a=!tn&&e.browserEvent&&e.browserEvent.shiftKey;(this._options.scrollYToX||a)&&!i&&(i=r,r=0),e.browserEvent&&e.browserEvent.altKey&&(i*=this._options.fastScrollSensitivity,r*=this._options.fastScrollSensitivity);let o=this._scrollable.getFutureScrollPosition(),s={};if(r){let e=Kr*r,t=o.scrollTop-(e<0?Math.floor(e):Math.ceil(e));this._verticalScrollbar.writeScrollPosition(s,t)}if(i){let e=Kr*i,t=o.scrollLeft-(e<0?Math.floor(e):Math.ceil(e));this._horizontalScrollbar.writeScrollPosition(s,t)}s=this._scrollable.validateScrollPosition(s),(o.scrollLeft!==s.scrollLeft||o.scrollTop!==s.scrollTop)&&(qr&&this._options.mouseWheelSmoothScroll&&t.isPhysicalMouseWheel()?this._scrollable.setScrollPositionSmooth(s):this._scrollable.setScrollPositionNow(s),n=!0)}let r=n;!r&&this._options.alwaysConsumeMouseWheel&&(r=!0),!r&&this._options.consumeMouseWheelIfScrollbarIsNeeded&&(this._verticalScrollbar.isNeeded()||this._horizontalScrollbar.isNeeded())&&(r=!0),r&&(e.preventDefault(),e.stopPropagation())}_onDidScroll(e){this._shouldRender=this._horizontalScrollbar.onDidScroll(e)||this._shouldRender,this._shouldRender=this._verticalScrollbar.onDidScroll(e)||this._shouldRender,this._options.useShadows&&(this._shouldRender=!0),this._revealOnScroll&&this._reveal(),this._options.lazyRender||this._render()}renderNow(){if(!this._options.lazyRender)throw Error("Please use `lazyRender` together with `renderNow`!");this._render()}_render(){if(this._shouldRender&&(this._shouldRender=!1,this._horizontalScrollbar.render(),this._verticalScrollbar.render(),this._options.useShadows)){let e=this._scrollable.getCurrentScrollPosition(),t=e.scrollTop>0,n=e.scrollLeft>0,r=n?` left`:``,i=t?` top`:``,a=n||t?` top-left-corner`:``;this._leftShadowDomNode.setClassName(`shadow${r}`),this._topShadowDomNode.setClassName(`shadow${i}`),this._topLeftShadowDomNode.setClassName(`shadow${a}${i}${r}`)}}_onDragStart(){this._isDragging=!0,this._reveal()}_onDragEnd(){this._isDragging=!1,this._hide()}_onMouseLeave(e){this._mouseIsOver=!1,this._hide()}_onMouseOver(e){this._mouseIsOver=!0,this._reveal()}_reveal(){this._verticalScrollbar.beginReveal(),this._horizontalScrollbar.beginReveal(),this._scheduleHide()}_hide(){!this._mouseIsOver&&!this._isDragging&&(this._verticalScrollbar.beginHide(),this._horizontalScrollbar.beginHide())}_scheduleHide(){!this._mouseIsOver&&!this._isDragging&&this._hideTimeout.cancelAndSet(()=>this._hide(),Gr)}},Qr=class extends Zr{constructor(e,t,n){super(e,t,n)}setScrollPosition(e){e.reuseAnimation?this._scrollable.setScrollPositionSmooth(e,e.reuseAnimation):this._scrollable.setScrollPositionNow(e)}getScrollPosition(){return this._scrollable.getCurrentScrollPosition()}};function $r(e){let t={lazyRender:typeof e.lazyRender<`u`&&e.lazyRender,className:typeof e.className<`u`?e.className:``,useShadows:typeof e.useShadows<`u`?e.useShadows:!0,handleMouseWheel:typeof e.handleMouseWheel<`u`?e.handleMouseWheel:!0,flipAxes:typeof e.flipAxes<`u`&&e.flipAxes,consumeMouseWheelIfScrollbarIsNeeded:typeof e.consumeMouseWheelIfScrollbarIsNeeded<`u`&&e.consumeMouseWheelIfScrollbarIsNeeded,alwaysConsumeMouseWheel:typeof e.alwaysConsumeMouseWheel<`u`&&e.alwaysConsumeMouseWheel,scrollYToX:typeof e.scrollYToX<`u`&&e.scrollYToX,mouseWheelScrollSensitivity:typeof e.mouseWheelScrollSensitivity<`u`?e.mouseWheelScrollSensitivity:1,fastScrollSensitivity:typeof e.fastScrollSensitivity<`u`?e.fastScrollSensitivity:5,scrollPredominantAxis:typeof e.scrollPredominantAxis<`u`?e.scrollPredominantAxis:!0,mouseWheelSmoothScroll:typeof e.mouseWheelSmoothScroll<`u`?e.mouseWheelSmoothScroll:!0,arrowSize:typeof e.arrowSize<`u`?e.arrowSize:11,listenOnDomNode:typeof e.listenOnDomNode<`u`?e.listenOnDomNode:null,horizontal:typeof e.horizontal<`u`?e.horizontal:1,horizontalScrollbarSize:typeof e.horizontalScrollbarSize<`u`?e.horizontalScrollbarSize:10,horizontalSliderSize:typeof e.horizontalSliderSize<`u`?e.horizontalSliderSize:0,horizontalHasArrows:typeof e.horizontalHasArrows<`u`&&e.horizontalHasArrows,vertical:typeof e.vertical<`u`?e.vertical:1,verticalScrollbarSize:typeof e.verticalScrollbarSize<`u`?e.verticalScrollbarSize:10,verticalHasArrows:typeof e.verticalHasArrows<`u`&&e.verticalHasArrows,verticalSliderSize:typeof e.verticalSliderSize<`u`?e.verticalSliderSize:0,scrollByPage:typeof e.scrollByPage<`u`&&e.scrollByPage};return t.horizontalSliderSize=typeof e.horizontalSliderSize<`u`?e.horizontalSliderSize:t.horizontalScrollbarSize,t.verticalSliderSize=typeof e.verticalSliderSize<`u`?e.verticalSliderSize:t.verticalScrollbarSize,tn&&(t.className+=` mac`),t}var ei=class extends A{constructor(e,t,n,r,i,a,o,s){super(),this._bufferService=n,this._optionsService=o,this._renderService=s,this._onRequestScrollLines=this._register(new N),this.onRequestScrollLines=this._onRequestScrollLines.event,this._isSyncing=!1,this._isHandlingScroll=!1,this._suppressOnScrollHandler=!1;let c=this._register(new Mr({forceIntegerValues:!1,smoothScrollDuration:this._optionsService.rawOptions.smoothScrollDuration,scheduleAtNextAnimationFrame:e=>pr(r.window,e)}));this._register(this._optionsService.onSpecificOptionChange(`smoothScrollDuration`,()=>{c.setSmoothScrollDuration(this._optionsService.rawOptions.smoothScrollDuration)})),this._scrollableElement=this._register(new Qr(t,{vertical:1,horizontal:2,useShadows:!1,mouseWheelSmoothScroll:!0,...this._getChangeOptions()},c)),this._register(this._optionsService.onMultipleOptionChange([`scrollSensitivity`,`fastScrollSensitivity`,`overviewRuler`],()=>this._scrollableElement.updateOptions(this._getChangeOptions()))),this._register(i.onProtocolChange(e=>{this._scrollableElement.updateOptions({handleMouseWheel:!(e&16)})})),this._scrollableElement.setScrollDimensions({height:0,scrollHeight:0}),this._register(M.runAndSubscribe(a.onChangeColors,()=>{this._scrollableElement.getDomNode().style.backgroundColor=a.colors.background.css})),e.appendChild(this._scrollableElement.getDomNode()),this._register(k(()=>this._scrollableElement.getDomNode().remove())),this._styleElement=r.mainDocument.createElement(`style`),t.appendChild(this._styleElement),this._register(k(()=>this._styleElement.remove())),this._register(M.runAndSubscribe(a.onChangeColors,()=>{this._styleElement.textContent=[`.xterm .xterm-scrollable-element > .scrollbar > .slider {`,` background: ${a.colors.scrollbarSliderBackground.css};`,`}`,`.xterm .xterm-scrollable-element > .scrollbar > .slider:hover {`,` background: ${a.colors.scrollbarSliderHoverBackground.css};`,`}`,`.xterm .xterm-scrollable-element > .scrollbar > .slider.active {`,` background: ${a.colors.scrollbarSliderActiveBackground.css};`,`}`].join(` +`)})),this._register(this._bufferService.onResize(()=>this.queueSync())),this._register(this._bufferService.buffers.onBufferActivate(()=>{this._latestYDisp=void 0,this.queueSync()})),this._register(this._bufferService.onScroll(()=>this._sync())),this._register(this._scrollableElement.onScroll(e=>this._handleScroll(e)))}scrollLines(e){let t=this._scrollableElement.getScrollPosition();this._scrollableElement.setScrollPosition({reuseAnimation:!0,scrollTop:t.scrollTop+e*this._renderService.dimensions.css.cell.height})}scrollToLine(e,t){t&&(this._latestYDisp=e),this._scrollableElement.setScrollPosition({reuseAnimation:!t,scrollTop:e*this._renderService.dimensions.css.cell.height})}_getChangeOptions(){return{mouseWheelScrollSensitivity:this._optionsService.rawOptions.scrollSensitivity,fastScrollSensitivity:this._optionsService.rawOptions.fastScrollSensitivity,verticalScrollbarSize:this._optionsService.rawOptions.overviewRuler?.width||14}}queueSync(e){e!==void 0&&(this._latestYDisp=e),this._queuedAnimationFrame===void 0&&(this._queuedAnimationFrame=this._renderService.addRefreshCallback(()=>{this._queuedAnimationFrame=void 0,this._sync(this._latestYDisp)}))}_sync(e=this._bufferService.buffer.ydisp){!this._renderService||this._isSyncing||(this._isSyncing=!0,this._suppressOnScrollHandler=!0,this._scrollableElement.setScrollDimensions({height:this._renderService.dimensions.css.canvas.height,scrollHeight:this._renderService.dimensions.css.cell.height*this._bufferService.buffer.lines.length}),this._suppressOnScrollHandler=!1,e!==this._latestYDisp&&this._scrollableElement.setScrollPosition({scrollTop:e*this._renderService.dimensions.css.cell.height}),this._isSyncing=!1)}_handleScroll(e){if(!this._renderService||this._isHandlingScroll||this._suppressOnScrollHandler)return;this._isHandlingScroll=!0;let t=Math.round(e.scrollTop/this._renderService.dimensions.css.cell.height),n=t-this._bufferService.buffer.ydisp;n!==0&&(this._latestYDisp=t,this._onRequestScrollLines.fire(n)),this._isHandlingScroll=!1}};ei=y([b(2,E),b(3,je),b(4,xe),b(5,Ie),b(6,O),b(7,Ne)],ei);var ti=class extends A{constructor(e,t,n,r,i){super(),this._screenElement=e,this._bufferService=t,this._coreBrowserService=n,this._decorationService=r,this._renderService=i,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(e=>this._removeDecoration(e))),this._register(k(()=>{this._container.remove(),this._decorationElements.clear()}))}_queueRefresh(){this._animationFrame===void 0&&(this._animationFrame=this._renderService.addRefreshCallback(()=>{this._doRefreshDecorations(),this._animationFrame=void 0}))}_doRefreshDecorations(){for(let e of this._decorationService.decorations)this._renderDecoration(e);this._dimensionsChanged=!1}_renderDecoration(e){this._refreshStyle(e),this._dimensionsChanged&&this._refreshXPosition(e)}_createElement(e){let t=this._coreBrowserService.mainDocument.createElement(`div`);t.classList.add(`xterm-decoration`),t.classList.toggle(`xterm-decoration-top-layer`,e?.options?.layer===`top`),t.style.width=`${Math.round((e.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,t.style.height=`${(e.options.height||1)*this._renderService.dimensions.css.cell.height}px`,t.style.top=`${(e.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height}px`,t.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;let n=e.options.x??0;return n&&n>this._bufferService.cols&&(t.style.display=`none`),this._refreshXPosition(e,t),t}_refreshStyle(e){let t=e.marker.line-this._bufferService.buffers.active.ydisp;if(t<0||t>=this._bufferService.rows)e.element&&(e.element.style.display=`none`,e.onRenderEmitter.fire(e.element));else{let n=this._decorationElements.get(e);n||(n=this._createElement(e),e.element=n,this._decorationElements.set(e,n),this._container.appendChild(n),e.onDispose(()=>{this._decorationElements.delete(e),n.remove()})),n.style.display=this._altBufferIsActive?`none`:`block`,this._altBufferIsActive||(n.style.width=`${Math.round((e.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,n.style.height=`${(e.options.height||1)*this._renderService.dimensions.css.cell.height}px`,n.style.top=`${t*this._renderService.dimensions.css.cell.height}px`,n.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`),e.onRenderEmitter.fire(n)}}_refreshXPosition(e,t=e.element){if(!t)return;let n=e.options.x??0;(e.options.anchor||`left`)===`right`?t.style.right=n?`${n*this._renderService.dimensions.css.cell.width}px`:``:t.style.left=n?`${n*this._renderService.dimensions.css.cell.width}px`:``}_removeDecoration(e){this._decorationElements.get(e)?.remove(),this._decorationElements.delete(e),e.dispose()}};ti=y([b(1,E),b(2,je),b(3,De),b(4,Ne)],ti);var ni=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(e){if(e.options.overviewRulerOptions){for(let t of this._zones)if(t.color===e.options.overviewRulerOptions.color&&t.position===e.options.overviewRulerOptions.position){if(this._lineIntersectsZone(t,e.marker.line))return;if(this._lineAdjacentToZone(t,e.marker.line,e.options.overviewRulerOptions.position)){this._addLineToZone(t,e.marker.line);return}}if(this._zonePoolIndex=e.startBufferLine&&t<=e.endBufferLine}_lineAdjacentToZone(e,t,n){return t>=e.startBufferLine-this._linePadding[n||`full`]&&t<=e.endBufferLine+this._linePadding[n||`full`]}_addLineToZone(e,t){e.startBufferLine=Math.min(e.startBufferLine,t),e.endBufferLine=Math.max(e.endBufferLine,t)}},ri={full:0,left:0,center:0,right:0},ii={full:0,left:0,center:0,right:0},ai={full:0,left:0,center:0,right:0},oi=class extends A{constructor(e,t,n,r,i,a,o,s){super(),this._viewportElement=e,this._screenElement=t,this._bufferService=n,this._decorationService=r,this._renderService=i,this._optionsService=a,this._themeService=o,this._coreBrowserService=s,this._colorZoneStore=new ni,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(),this._viewportElement.parentElement?.insertBefore(this._canvas,this._viewportElement),this._register(k(()=>this._canvas?.remove()));let c=this._canvas.getContext(`2d`);if(c)this._ctx=c;else throw Error(`Ctx cannot be null`);this._register(this._decorationService.onDecorationRegistered(()=>this._queueRefresh(void 0,!0))),this._register(this._decorationService.onDecorationRemoved(()=>this._queueRefresh(void 0,!0))),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())})),this._register(this._renderService.onRender(()=>{(!this._containerHeight||this._containerHeight!==this._screenElement.clientHeight)&&(this._queueRefresh(!0),this._containerHeight=this._screenElement.clientHeight)})),this._register(this._coreBrowserService.onDprChange(()=>this._queueRefresh(!0))),this._register(this._optionsService.onSpecificOptionChange(`overviewRuler`,()=>this._queueRefresh(!0))),this._register(this._themeService.onChangeColors(()=>this._queueRefresh())),this._queueRefresh(!0)}get _width(){return this._optionsService.options.overviewRuler?.width||0}_refreshDrawConstants(){let e=Math.floor((this._canvas.width-1)/3),t=Math.ceil((this._canvas.width-1)/3);ii.full=this._canvas.width,ii.left=e,ii.center=t,ii.right=e,this._refreshDrawHeightConstants(),ai.full=1,ai.left=1,ai.center=1+ii.left,ai.right=1+ii.left+ii.center}_refreshDrawHeightConstants(){ri.full=Math.round(2*this._coreBrowserService.dpr);let e=this._canvas.height/this._bufferService.buffer.lines.length,t=Math.round(Math.max(Math.min(e,12),6)*this._coreBrowserService.dpr);ri.left=t,ri.center=t,ri.right=t}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*ri.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*ri.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*ri.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*ri.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(let e of this._decorationService.decorations)this._colorZoneStore.addDecoration(e);this._ctx.lineWidth=1,this._renderRulerOutline();let e=this._colorZoneStore.zones;for(let t of e)t.position!==`full`&&this._renderColorZone(t);for(let t of e)t.position===`full`&&this._renderColorZone(t);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderRulerOutline(){this._ctx.fillStyle=this._themeService.colors.overviewRulerBorder.css,this._ctx.fillRect(0,0,1,this._canvas.height),this._optionsService.rawOptions.overviewRuler.showTopBorder&&this._ctx.fillRect(1,0,this._canvas.width-1,1),this._optionsService.rawOptions.overviewRuler.showBottomBorder&&this._ctx.fillRect(1,this._canvas.height-1,this._canvas.width-1,this._canvas.height)}_renderColorZone(e){this._ctx.fillStyle=e.color,this._ctx.fillRect(ai[e.position||`full`],Math.round((this._canvas.height-1)*(e.startBufferLine/this._bufferService.buffers.active.lines.length)-ri[e.position||`full`]/2),ii[e.position||`full`],Math.round((this._canvas.height-1)*((e.endBufferLine-e.startBufferLine)/this._bufferService.buffers.active.lines.length)+ri[e.position||`full`]))}_queueRefresh(e,t){this._shouldUpdateDimensions=e||this._shouldUpdateDimensions,this._shouldUpdateAnchor=t||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>{this._refreshDecorations(),this._animationFrame=void 0}))}};oi=y([b(2,E),b(3,De),b(4,Ne),b(5,O),b(6,Ie),b(7,je)],oi);var L;(e=>(e.NUL=`\0`,e.SOH=``,e.STX=``,e.ETX=``,e.EOT=``,e.ENQ=``,e.ACK=``,e.BEL=`\x07`,e.BS=`\b`,e.HT=` `,e.LF=` +`,e.VT=`\v`,e.FF=`\f`,e.CR=`\r`,e.SO=``,e.SI=``,e.DLE=``,e.DC1=``,e.DC2=``,e.DC3=``,e.DC4=``,e.NAK=``,e.SYN=``,e.ETB=``,e.CAN=``,e.EM=``,e.SUB=``,e.ESC=`\x1B`,e.FS=``,e.GS=``,e.RS=``,e.US=``,e.SP=` `,e.DEL=``))(L||={});var si;(e=>(e.PAD=`€`,e.HOP=``,e.BPH=`‚`,e.NBH=`ƒ`,e.IND=`„`,e.NEL=`…`,e.SSA=`†`,e.ESA=`‡`,e.HTS=`ˆ`,e.HTJ=`‰`,e.VTS=`Š`,e.PLD=`‹`,e.PLU=`Œ`,e.RI=``,e.SS2=`Ž`,e.SS3=``,e.DCS=``,e.PU1=`‘`,e.PU2=`’`,e.STS=`“`,e.CCH=`”`,e.MW=`•`,e.SPA=`–`,e.EPA=`—`,e.SOS=`˜`,e.SGCI=`™`,e.SCI=`š`,e.CSI=`›`,e.ST=`œ`,e.OSC=``,e.PM=`ž`,e.APC=`Ÿ`))(si||={});var ci;(e=>e.ST=`${L.ESC}\\`)(ci||={});var li=class{constructor(e,t,n,r,i,a){this._textarea=e,this._compositionView=t,this._bufferService=n,this._optionsService=r,this._coreService=i,this._renderService=a,this._isComposing=!1,this._isSendingComposition=!1,this._compositionPosition={start:0,end:0},this._dataAlreadySent=``}get isComposing(){return this._isComposing}compositionstart(){this._isComposing=!0,this._compositionPosition.start=this._textarea.value.length,this._compositionView.textContent=``,this._dataAlreadySent=``,this._compositionView.classList.add(`active`)}compositionupdate(e){this._compositionView.textContent=e.data,this.updateCompositionElements(),setTimeout(()=>{this._compositionPosition.end=this._textarea.value.length},0)}compositionend(){this._finalizeComposition(!0)}keydown(e){if(this._isComposing||this._isSendingComposition){if(e.keyCode===20||e.keyCode===229||e.keyCode===16||e.keyCode===17||e.keyCode===18)return!1;this._finalizeComposition(!1)}return e.keyCode===229?(this._handleAnyTextareaChanges(),!1):!0}_finalizeComposition(e){if(this._compositionView.classList.remove(`active`),this._isComposing=!1,e){let e={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout(()=>{if(this._isSendingComposition){this._isSendingComposition=!1;let t;e.start+=this._dataAlreadySent.length,t=this._isComposing?this._textarea.value.substring(e.start,this._compositionPosition.start):this._textarea.value.substring(e.start),t.length>0&&this._coreService.triggerDataEvent(t,!0)}},0)}else{this._isSendingComposition=!1;let e=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(e,!0)}}_handleAnyTextareaChanges(){let e=this._textarea.value;setTimeout(()=>{if(!this._isComposing){let t=this._textarea.value,n=t.replace(e,``);this._dataAlreadySent=n,t.length>e.length?this._coreService.triggerDataEvent(n,!0):t.lengththis.updateCompositionElements(!0),0)}}};li=y([b(2,E),b(3,O),b(4,D),b(5,Ne)],li);var R=0,z=0,B=0,V=0,ui={css:`#00000000`,rgba:0},H;(e=>{function t(e,t,n,r){return r===void 0?`#${fi(e)}${fi(t)}${fi(n)}`:`#${fi(e)}${fi(t)}${fi(n)}${fi(r)}`}e.toCss=t;function n(e,t,n,r=255){return(e<<24|t<<16|n<<8|r)>>>0}e.toRgba=n;function r(t,n,r,i){return{css:e.toCss(t,n,r,i),rgba:e.toRgba(t,n,r,i)}}e.toColor=r})(H||={});var U;(e=>{function t(e,t){if(V=(t.rgba&255)/255,V===1)return{css:t.css,rgba:t.rgba};let n=t.rgba>>24&255,r=t.rgba>>16&255,i=t.rgba>>8&255,a=e.rgba>>24&255,o=e.rgba>>16&255,s=e.rgba>>8&255;return R=a+Math.round((n-a)*V),z=o+Math.round((r-o)*V),B=s+Math.round((i-s)*V),{css:H.toCss(R,z,B),rgba:H.toRgba(R,z,B)}}e.blend=t;function n(e){return(e.rgba&255)==255}e.isOpaque=n;function r(e,t,n){let r=di.ensureContrastRatio(e.rgba,t.rgba,n);if(r)return H.toColor(r>>24&255,r>>16&255,r>>8&255)}e.ensureContrastRatio=r;function i(e){let t=(e.rgba|255)>>>0;return[R,z,B]=di.toChannels(t),{css:H.toCss(R,z,B),rgba:t}}e.opaque=i;function a(e,t){return V=Math.round(t*255),[R,z,B]=di.toChannels(e.rgba),{css:H.toCss(R,z,B,V),rgba:H.toRgba(R,z,B,V)}}e.opacity=a;function o(e,t){return V=e.rgba&255,a(e,V*t/255)}e.multiplyOpacity=o;function s(e){return[e.rgba>>24&255,e.rgba>>16&255,e.rgba>>8&255]}e.toColorRGB=s})(U||={});var W;(e=>{let t,n;try{let e=document.createElement(`canvas`);e.width=1,e.height=1;let r=e.getContext(`2d`,{willReadFrequently:!0});r&&(t=r,t.globalCompositeOperation=`copy`,n=t.createLinearGradient(0,0,1,1))}catch{}function r(e){if(e.match(/#[\da-f]{3,8}/i))switch(e.length){case 4:return R=parseInt(e.slice(1,2).repeat(2),16),z=parseInt(e.slice(2,3).repeat(2),16),B=parseInt(e.slice(3,4).repeat(2),16),H.toColor(R,z,B);case 5:return R=parseInt(e.slice(1,2).repeat(2),16),z=parseInt(e.slice(2,3).repeat(2),16),B=parseInt(e.slice(3,4).repeat(2),16),V=parseInt(e.slice(4,5).repeat(2),16),H.toColor(R,z,B,V);case 7:return{css:e,rgba:(parseInt(e.slice(1),16)<<8|255)>>>0};case 9:return{css:e,rgba:parseInt(e.slice(1),16)>>>0}}let r=e.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(r)return R=parseInt(r[1]),z=parseInt(r[2]),B=parseInt(r[3]),V=Math.round((r[5]===void 0?1:parseFloat(r[5]))*255),H.toColor(R,z,B,V);if(!t||!n||(t.fillStyle=n,t.fillStyle=e,typeof t.fillStyle!=`string`)||(t.fillRect(0,0,1,1),[R,z,B,V]=t.getImageData(0,0,1,1).data,V!==255))throw Error(`css.toColor: Unsupported css format`);return{rgba:H.toRgba(R,z,B,V),css:e}}e.toColor=r})(W||={});var G;(e=>{function t(e){return n(e>>16&255,e>>8&255,e&255)}e.relativeLuminance=t;function n(e,t,n){let r=e/255,i=t/255,a=n/255,o=r<=.03928?r/12.92:((r+.055)/1.055)**2.4,s=i<=.03928?i/12.92:((i+.055)/1.055)**2.4,c=a<=.03928?a/12.92:((a+.055)/1.055)**2.4;return o*.2126+s*.7152+c*.0722}e.relativeLuminance2=n})(G||={});var di;(e=>{function t(e,t){if(V=(t&255)/255,V===1)return t;let n=t>>24&255,r=t>>16&255,i=t>>8&255,a=e>>24&255,o=e>>16&255,s=e>>8&255;return R=a+Math.round((n-a)*V),z=o+Math.round((r-o)*V),B=s+Math.round((i-s)*V),H.toRgba(R,z,B)}e.blend=t;function n(e,t,n){let a=G.relativeLuminance(e>>8),o=G.relativeLuminance(t>>8);if(pi(a,o)>8));if(spi(a,G.relativeLuminance(r>>8))?o:r}return o}let s=i(e,t,n),c=pi(a,G.relativeLuminance(s>>8));if(cpi(a,G.relativeLuminance(i>>8))?s:i}return s}}e.ensureContrastRatio=n;function r(e,t,n){let r=e>>24&255,i=e>>16&255,a=e>>8&255,o=t>>24&255,s=t>>16&255,c=t>>8&255,l=pi(G.relativeLuminance2(o,s,c),G.relativeLuminance2(r,i,a));for(;l0||s>0||c>0);)o-=Math.max(0,Math.ceil(o*.1)),s-=Math.max(0,Math.ceil(s*.1)),c-=Math.max(0,Math.ceil(c*.1)),l=pi(G.relativeLuminance2(o,s,c),G.relativeLuminance2(r,i,a));return(o<<24|s<<16|c<<8|255)>>>0}e.reduceLuminance=r;function i(e,t,n){let r=e>>24&255,i=e>>16&255,a=e>>8&255,o=t>>24&255,s=t>>16&255,c=t>>8&255,l=pi(G.relativeLuminance2(o,s,c),G.relativeLuminance2(r,i,a));for(;l>>0}e.increaseLuminance=i;function a(e){return[e>>24&255,e>>16&255,e>>8&255,e&255]}e.toChannels=a})(di||={});function fi(e){let t=e.toString(16);return t.length<2?`0`+t:t}function pi(e,t){return e1){let e=this._getJoinedRanges(r,o,a,t,i);for(let t=0;t1){let e=this._getJoinedRanges(r,o,a,t,i);for(let t=0;t=ae,le=S,C=this._workCell;if(f.length>0&&S===f[0][0]&&ce){let r=f.shift(),i=this._isCellInSelection(r[0],t);for(v=r[0]+1;v=r[1],ce?(se=!0,C=new mi(this._workCell,e.translateToString(!0,r[0],r[1]),r[1]-r[0]),le=r[1]-1,m=C.getWidth()):ae=r[1]}let ue=this._isCellInSelection(S,t),de=n&&S===a,fe=oe&&S>=l&&S<=u,he=!1;this._decorationService.forEachDecorationAtCell(S,t,void 0,e=>{he=!0});let w=C.getChars()||pe;if(w===` `&&(C.isUnderline()||C.isOverline())&&(w=`\xA0`),ie=m*s-c.get(w,C.isBold(),C.isItalic()),!h)h=this._document.createElement(`span`);else if(g&&(ue&&re||!ue&&!re&&C.bg===y)&&(ue&&re&&p.selectionForeground||C.fg===b)&&C.extended.ext===ee&&fe===te&&ie===ne&&!de&&!se&&!he&&ce){C.isInvisible()?_+=pe:_+=w,g++;continue}else g&&(h.textContent=_),h=this._document.createElement(`span`),g=0,_=``;if(y=C.bg,b=C.fg,ee=C.extended.ext,te=fe,ne=ie,re=ue,se&&a>=S&&a<=le&&(a=S),!this._coreService.isCursorHidden&&de&&this._coreService.isCursorInitialized){if(x.push(`xterm-cursor`),this._coreBrowserService.isFocused)o&&x.push(`xterm-cursor-blink`),x.push(r===`bar`?`xterm-cursor-bar`:r===`underline`?`xterm-cursor-underline`:`xterm-cursor-block`);else if(i)switch(i){case`outline`:x.push(`xterm-cursor-outline`);break;case`block`:x.push(`xterm-cursor-block`);break;case`bar`:x.push(`xterm-cursor-bar`);break;case`underline`:x.push(`xterm-cursor-underline`);break;default:break}}if(C.isBold()&&x.push(`xterm-bold`),C.isItalic()&&x.push(`xterm-italic`),C.isDim()&&x.push(`xterm-dim`),_=C.isInvisible()?pe:C.getChars()||pe,C.isUnderline()&&(x.push(`xterm-underline-${C.extended.underlineStyle}`),_===` `&&(_=`\xA0`),!C.isUnderlineColorDefault()))if(C.isUnderlineColorRGB())h.style.textDecorationColor=`rgb(${me.toColorRGB(C.getUnderlineColor()).join(`,`)})`;else{let e=C.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&C.isBold()&&e<8&&(e+=8),h.style.textDecorationColor=p.ansi[e].css}C.isOverline()&&(x.push(`xterm-overline`),_===` `&&(_=`\xA0`)),C.isStrikethrough()&&x.push(`xterm-strikethrough`),fe&&(h.style.textDecoration=`underline`);let ge=C.getFgColor(),_e=C.getFgColorMode(),ve=C.getBgColor(),ye=C.getBgColorMode(),T=!!C.isInverse();if(T){let e=ge;ge=ve,ve=e;let t=_e;_e=ye,ye=t}let be,E,xe=!1;this._decorationService.forEachDecorationAtCell(S,t,void 0,e=>{e.options.layer!==`top`&&xe||(e.backgroundColorRGB&&(ye=50331648,ve=e.backgroundColorRGB.rgba>>8&16777215,be=e.backgroundColorRGB),e.foregroundColorRGB&&(_e=50331648,ge=e.foregroundColorRGB.rgba>>8&16777215,E=e.foregroundColorRGB),xe=e.options.layer===`top`)}),!xe&&ue&&(be=this._coreBrowserService.isFocused?p.selectionBackgroundOpaque:p.selectionInactiveBackgroundOpaque,ve=be.rgba>>8&16777215,ye=50331648,xe=!0,p.selectionForeground&&(_e=50331648,ge=p.selectionForeground.rgba>>8&16777215,E=p.selectionForeground)),xe&&x.push(`xterm-decoration-top`);let D;switch(ye){case 16777216:case 33554432:D=p.ansi[ve],x.push(`xterm-bg-${ve}`);break;case 50331648:D=H.toColor(ve>>16,ve>>8&255,ve&255),this._addStyle(h,`background-color:#${Si((ve>>>0).toString(16),`0`,6)}`);break;default:T?(D=p.foreground,x.push(`xterm-bg-257`)):D=p.background}switch(be||C.isDim()&&(be=U.multiplyOpacity(D,.5)),_e){case 16777216:case 33554432:C.isBold()&&ge<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(ge+=8),this._applyMinimumContrast(h,D,p.ansi[ge],C,be,void 0)||x.push(`xterm-fg-${ge}`);break;case 50331648:let e=H.toColor(ge>>16&255,ge>>8&255,ge&255);this._applyMinimumContrast(h,D,e,C,be,E)||this._addStyle(h,`color:#${Si(ge.toString(16),`0`,6)}`);break;default:this._applyMinimumContrast(h,D,p.foreground,C,be,E)||T&&x.push(`xterm-fg-257`)}x.length&&=(h.className=x.join(` `),0),!de&&!se&&!he&&ce?g++:h.textContent=_,ie!==this.defaultSpacing&&(h.style.letterSpacing=`${ie}px`),d.push(h),S=le}return h&&g&&(h.textContent=_),d}_applyMinimumContrast(e,t,n,r,i,a){if(this._optionsService.rawOptions.minimumContrastRatio===1||vi(r.getCode()))return!1;let o=this._getContrastCache(r),s;if(!i&&!a&&(s=o.getColor(t.rgba,n.rgba)),s===void 0){let e=this._optionsService.rawOptions.minimumContrastRatio/(r.isDim()?2:1);s=U.ensureContrastRatio(i||t,a||n,e),o.setColor((i||t).rgba,(a||n).rgba,s??null)}return s?(this._addStyle(e,`color:${s.css}`),!0):!1}_getContrastCache(e){return e.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(e,t){e.setAttribute(`style`,`${e.getAttribute(`style`)||``}${t};`)}_isCellInSelection(e,t){let n=this._selectionStart,r=this._selectionEnd;return!n||!r?!1:this._columnSelectMode?n[0]<=r[0]?e>=n[0]&&t>=n[1]&&e=n[1]&&e>=r[0]&&t<=r[1]:t>n[1]&&t=n[0]&&e=n[0]}};xi=y([b(1,Fe),b(2,O),b(3,je),b(4,D),b(5,De),b(6,Ie)],xi);function Si(e,t,n){for(;e.length0&&(this._flat[r]=t),t}let i=e;t&&(i+=`B`),n&&(i+=`I`);let a=this._holey.get(i);if(a===void 0){let r=0;t&&(r|=1),n&&(r|=2),a=this._measure(e,r),a>0&&this._holey.set(i,a)}return a}_measure(e,t){let n=this._measureElements[t];return n.textContent=e.repeat(32),n.offsetWidth/32}},wi=class{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(e,t,n,r=!1){if(this.selectionStart=t,this.selectionEnd=n,!t||!n||t[0]===n[0]&&t[1]===n[1]){this.clear();return}let i=e.buffers.active.ydisp,a=t[1]-i,o=n[1]-i,s=Math.max(a,0),c=Math.min(o,e.rows-1);if(s>=e.rows||c<0){this.clear();return}this.hasSelection=!0,this.columnSelectMode=r,this.viewportStartRow=a,this.viewportEndRow=o,this.viewportCappedStartRow=s,this.viewportCappedEndRow=c,this.startCol=t[0],this.endCol=n[0]}isCellSelected(e,t,n){return this.hasSelection?(n-=e.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?t>=this.startCol&&n>=this.viewportCappedStartRow&&t=this.viewportCappedStartRow&&t>=this.endCol&&n<=this.viewportCappedEndRow:n>this.viewportStartRow&&n=this.startCol&&t=this.startCol):!1}};function Ti(){return new wi}var Ei=`xterm-dom-renderer-owner-`,Di=`xterm-rows`,Oi=`xterm-fg-`,ki=`xterm-bg-`,Ai=`xterm-focus`,ji=`xterm-selection`,Mi=1,Ni=class extends A{constructor(e,t,n,r,i,a,o,s,c,l,u,d,f,p){super(),this._terminal=e,this._document=t,this._element=n,this._screenElement=r,this._viewportElement=i,this._helperContainer=a,this._linkifier2=o,this._charSizeService=c,this._optionsService=l,this._bufferService=u,this._coreService=d,this._coreBrowserService=f,this._themeService=p,this._terminalClass=Mi++,this._rowElements=[],this._selectionRenderModel=Ti(),this.onRequestRedraw=this._register(new N).event,this._rowContainer=this._document.createElement(`div`),this._rowContainer.classList.add(Di),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(ji),this._selectionContainer.setAttribute(`aria-hidden`,`true`),this.dimensions=yi(),this._updateDimensions(),this._register(this._optionsService.onOptionChange(()=>this._handleOptionsChanged())),this._register(this._themeService.onChangeColors(e=>this._injectCss(e))),this._injectCss(this._themeService.colors),this._rowFactory=s.createInstance(xi,document),this._element.classList.add(Ei+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this._register(this._linkifier2.onShowLinkUnderline(e=>this._handleLinkHover(e))),this._register(this._linkifier2.onHideLinkUnderline(e=>this._handleLinkLeave(e))),this._register(k(()=>{this._element.classList.remove(Ei+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()})),this._widthCache=new Ci(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(){let e=this._coreBrowserService.dpr;this.dimensions.device.char.width=this._charSizeService.width*e,this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*e),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/e),this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/e),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(let e of this._rowElements)e.style.width=`${this.dimensions.css.canvas.width}px`,e.style.height=`${this.dimensions.css.cell.height}px`,e.style.lineHeight=`${this.dimensions.css.cell.height}px`,e.style.overflow=`hidden`;this._dimensionsStyleElement||(this._dimensionsStyleElement=this._document.createElement(`style`),this._screenElement.appendChild(this._dimensionsStyleElement));let t=`${this._terminalSelector} .${Di} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=t,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(e){this._themeStyleElement||(this._themeStyleElement=this._document.createElement(`style`),this._screenElement.appendChild(this._themeStyleElement));let t=`${this._terminalSelector} .${Di} { pointer-events: none; color: ${e.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;t+=`${this._terminalSelector} .${Di} .xterm-dim { color: ${U.multiplyOpacity(e.foreground,.5).css};}`,t+=`${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;}`;let n=`blink_underline_${this._terminalClass}`,r=`blink_bar_${this._terminalClass}`,i=`blink_block_${this._terminalClass}`;t+=`@keyframes ${n} { 50% { border-bottom-style: hidden; }}`,t+=`@keyframes ${r} { 50% { box-shadow: none; }}`,t+=`@keyframes ${i} { 0% { background-color: ${e.cursor.css}; color: ${e.cursorAccent.css}; } 50% { background-color: inherit; color: ${e.cursor.css}; }}`,t+=`${this._terminalSelector} .${Di}.${Ai} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${n} 1s step-end infinite;}${this._terminalSelector} .${Di}.${Ai} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${r} 1s step-end infinite;}${this._terminalSelector} .${Di}.${Ai} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${i} 1s step-end infinite;}${this._terminalSelector} .${Di} .xterm-cursor.xterm-cursor-block { background-color: ${e.cursor.css}; color: ${e.cursorAccent.css};}${this._terminalSelector} .${Di} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${e.cursor.css} !important; color: ${e.cursorAccent.css} !important;}${this._terminalSelector} .${Di} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${e.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${Di} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${e.cursor.css} inset;}${this._terminalSelector} .${Di} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${e.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,t+=`${this._terminalSelector} .${ji} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${ji} div { position: absolute; background-color: ${e.selectionBackgroundOpaque.css};}${this._terminalSelector} .${ji} div { position: absolute; background-color: ${e.selectionInactiveBackgroundOpaque.css};}`;for(let[n,r]of e.ansi.entries())t+=`${this._terminalSelector} .${Oi}${n} { color: ${r.css}; }${this._terminalSelector} .${Oi}${n}.xterm-dim { color: ${U.multiplyOpacity(r,.5).css}; }${this._terminalSelector} .${ki}${n} { background-color: ${r.css}; }`;t+=`${this._terminalSelector} .${Oi}257 { color: ${U.opaque(e.background).css}; }${this._terminalSelector} .${Oi}257.xterm-dim { color: ${U.multiplyOpacity(U.opaque(e.background),.5).css}; }${this._terminalSelector} .${ki}257 { background-color: ${e.foreground.css}; }`,this._themeStyleElement.textContent=t}_setDefaultSpacing(){let e=this.dimensions.css.cell.width-this._widthCache.get(`W`,!1,!1);this._rowContainer.style.letterSpacing=`${e}px`,this._rowFactory.defaultSpacing=e}handleDevicePixelRatioChange(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}_refreshRowElements(e,t){for(let e=this._rowElements.length;e<=t;e++){let e=this._document.createElement(`div`);this._rowContainer.appendChild(e),this._rowElements.push(e)}for(;this._rowElements.length>t;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(e,t){this._refreshRowElements(e,t),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(Ai),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add(Ai),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(e,t,n){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(e,t,n),this.renderRows(0,this._bufferService.rows-1),!e||!t||(this._selectionRenderModel.update(this._terminal,e,t,n),!this._selectionRenderModel.hasSelection))return;let r=this._selectionRenderModel.viewportStartRow,i=this._selectionRenderModel.viewportEndRow,a=this._selectionRenderModel.viewportCappedStartRow,o=this._selectionRenderModel.viewportCappedEndRow,s=this._document.createDocumentFragment();if(n){let n=e[0]>t[0];s.appendChild(this._createSelectionElement(a,n?t[0]:e[0],n?e[0]:t[0],o-a+1))}else{let n=r===a?e[0]:0,c=a===i?t[0]:this._bufferService.cols;s.appendChild(this._createSelectionElement(a,n,c));let l=o-a-1;if(s.appendChild(this._createSelectionElement(a+1,0,this._bufferService.cols,l)),a!==o){let e=i===o?t[0]:this._bufferService.cols;s.appendChild(this._createSelectionElement(o,0,e))}}this._selectionContainer.appendChild(s)}_createSelectionElement(e,t,n,r=1){let i=this._document.createElement(`div`),a=t*this.dimensions.css.cell.width,o=this.dimensions.css.cell.width*(n-t);return a+o>this.dimensions.css.canvas.width&&(o=this.dimensions.css.canvas.width-a),i.style.height=`${r*this.dimensions.css.cell.height}px`,i.style.top=`${e*this.dimensions.css.cell.height}px`,i.style.left=`${a}px`,i.style.width=`${o}px`,i}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(let e of this._rowElements)e.replaceChildren()}renderRows(e,t){let n=this._bufferService.buffer,r=n.ybase+n.y,i=Math.min(n.x,this._bufferService.cols-1),a=this._coreService.decPrivateModes.cursorBlink??this._optionsService.rawOptions.cursorBlink,o=this._coreService.decPrivateModes.cursorStyle??this._optionsService.rawOptions.cursorStyle,s=this._optionsService.rawOptions.cursorInactiveStyle;for(let c=e;c<=t;c++){let e=c+n.ydisp,t=this._rowElements[c],l=n.lines.get(e);if(!t||!l)break;t.replaceChildren(...this._rowFactory.createRow(l,e,e===r,o,s,i,a,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${Ei}${this._terminalClass}`}_handleLinkHover(e){this._setCellUnderline(e.x1,e.x2,e.y1,e.y2,e.cols,!0)}_handleLinkLeave(e){this._setCellUnderline(e.x1,e.x2,e.y1,e.y2,e.cols,!1)}_setCellUnderline(e,t,n,r,i,a){n<0&&(e=0),r<0&&(t=0);let o=this._bufferService.rows-1;n=Math.max(Math.min(n,o),0),r=Math.max(Math.min(r,o),0),i=Math.min(i,this._bufferService.cols);let s=this._bufferService.buffer,c=s.ybase+s.y,l=Math.min(s.x,i-1),u=this._optionsService.rawOptions.cursorBlink,d=this._optionsService.rawOptions.cursorStyle,f=this._optionsService.rawOptions.cursorInactiveStyle;for(let o=n;o<=r;++o){let p=o+s.ydisp,m=this._rowElements[o],h=s.lines.get(p);if(!m||!h)break;m.replaceChildren(...this._rowFactory.createRow(h,p,p===c,d,f,l,u,this.dimensions.css.cell.width,this._widthCache,a?o===n?e:0:-1,a?(o===r?t:i)-1:-1))}}};Ni=y([b(7,Ce),b(8,Ae),b(9,O),b(10,E),b(11,D),b(12,je),b(13,Ie)],Ni);var Pi=class extends A{constructor(e,t,n){super(),this._optionsService=n,this.width=0,this.height=0,this._onCharSizeChange=this._register(new N),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this._register(new Li(this._optionsService))}catch{this._measureStrategy=this._register(new Ii(e,t,this._optionsService))}this._register(this._optionsService.onMultipleOptionChange([`fontFamily`,`fontSize`],()=>this.measure()))}get hasValidSize(){return this.width>0&&this.height>0}measure(){let e=this._measureStrategy.measure();(e.width!==this.width||e.height!==this.height)&&(this.width=e.width,this.height=e.height,this._onCharSizeChange.fire())}};Pi=y([b(2,O)],Pi);var Fi=class extends A{constructor(){super(...arguments),this._result={width:0,height:0}}_validateAndSet(e,t){e!==void 0&&e>0&&t!==void 0&&t>0&&(this._result.width=e,this._result.height=t)}},Ii=class extends Fi{constructor(e,t,n){super(),this._document=e,this._parentElement=t,this._optionsService=n,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}},Li=class extends Fi{constructor(e){super(),this._optionsService=e,this._canvas=new OffscreenCanvas(100,100),this._ctx=this._canvas.getContext(`2d`);let t=this._ctx.measureText(`W`);if(!(`width`in t&&`fontBoundingBoxAscent`in t&&`fontBoundingBoxDescent`in t))throw Error(`Required font metrics not supported`)}measure(){this._ctx.font=`${this._optionsService.rawOptions.fontSize}px ${this._optionsService.rawOptions.fontFamily}`;let e=this._ctx.measureText(`W`);return this._validateAndSet(e.width,e.fontBoundingBoxAscent+e.fontBoundingBoxDescent),this._result}},Ri=class extends A{constructor(e,t,n){super(),this._textarea=e,this._window=t,this.mainDocument=n,this._isFocused=!1,this._cachedIsFocused=void 0,this._screenDprMonitor=this._register(new zi(this._window)),this._onDprChange=this._register(new N),this.onDprChange=this._onDprChange.event,this._onWindowChange=this._register(new N),this.onWindowChange=this._onWindowChange.event,this._register(this.onWindowChange(e=>this._screenDprMonitor.setWindow(e))),this._register(M.forward(this._screenDprMonitor.onDprChange,this._onDprChange)),this._register(P(this._textarea,`focus`,()=>this._isFocused=!0)),this._register(P(this._textarea,`blur`,()=>this._isFocused=!1))}get window(){return this._window}set window(e){this._window!==e&&(this._window=e,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}},zi=class extends A{constructor(e){super(),this._parentWindow=e,this._windowResizeListener=this._register(new pt),this._onDprChange=this._register(new N),this.onDprChange=this._onDprChange.event,this._outerListener=()=>this._setDprAndFireIfDiffers(),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._updateDpr(),this._setWindowResizeListener(),this._register(k(()=>this.clearListener()))}setWindow(e){this._parentWindow=e,this._setWindowResizeListener(),this._setDprAndFireIfDiffers()}_setWindowResizeListener(){this._windowResizeListener.value=P(this._parentWindow,`resize`,()=>this._setDprAndFireIfDiffers())}_setDprAndFireIfDiffers(){this._parentWindow.devicePixelRatio!==this._currentDevicePixelRatio&&this._onDprChange.fire(this._parentWindow.devicePixelRatio),this._updateDpr()}_updateDpr(){this._outerListener&&(this._resolutionMediaMatchList?.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)}},Bi=class extends A{constructor(){super(),this.linkProviders=[],this._register(k(()=>this.linkProviders.length=0))}registerLinkProvider(e){return this.linkProviders.push(e),{dispose:()=>{let t=this.linkProviders.indexOf(e);t!==-1&&this.linkProviders.splice(t,1)}}}};function Vi(e,t,n){let r=n.getBoundingClientRect(),i=e.getComputedStyle(n),a=parseInt(i.getPropertyValue(`padding-left`)),o=parseInt(i.getPropertyValue(`padding-top`));return[t.clientX-r.left-a,t.clientY-r.top-o]}function Hi(e,t,n,r,i,a,o,s,c){if(!a)return;let l=Vi(e,t,n);if(l)return l[0]=Math.ceil((l[0]+(c?o/2:0))/o),l[1]=Math.ceil(l[1]/s),l[0]=Math.min(Math.max(l[0],1),r+ +!!c),l[1]=Math.min(Math.max(l[1],1),i),l}var Ui=class{constructor(e,t){this._renderService=e,this._charSizeService=t}getCoords(e,t,n,r,i){return Hi(window,e,t,n,r,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,i)}getMouseReportCoords(e,t){let n=Vi(window,e,t);if(this._charSizeService.hasValidSize)return n[0]=Math.min(Math.max(n[0],0),this._renderService.dimensions.css.canvas.width-1),n[1]=Math.min(Math.max(n[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(n[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(n[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(n[0]),y:Math.floor(n[1])}}};Ui=y([b(0,Ne),b(1,Ae)],Ui);var Wi=class{constructor(e,t){this._renderCallback=e,this._coreBrowserService=t,this._refreshCallbacks=[]}dispose(){this._animationFrame&&=(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),void 0)}addRefreshCallback(e){return this._refreshCallbacks.push(e),this._animationFrame||=this._coreBrowserService.window.requestAnimationFrame(()=>this._innerRefresh()),this._animationFrame}refresh(e,t,n){this._rowCount=n,e=e===void 0?0:e,t=t===void 0?this._rowCount-1:t,this._rowStart=this._rowStart===void 0?e:Math.min(this._rowStart,e),this._rowEnd=this._rowEnd===void 0?t:Math.max(this._rowEnd,t),!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){this._runRefreshCallbacks();return}let e=Math.max(this._rowStart,0),t=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(e,t),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(let e of this._refreshCallbacks)e(0);this._refreshCallbacks=[]}},Gi={};v(Gi,{getSafariVersion:()=>Qi,isChromeOS:()=>ia,isFirefox:()=>Yi,isIpad:()=>ea,isIphone:()=>ta,isLegacyEdge:()=>Xi,isLinux:()=>ra,isMac:()=>$i,isNode:()=>Ki,isSafari:()=>Zi,isWindows:()=>na});var Ki=typeof process<`u`&&`title`in process,qi=Ki?`node`:navigator.userAgent,Ji=Ki?`node`:navigator.platform,Yi=qi.includes(`Firefox`),Xi=qi.includes(`Edge`),Zi=/^((?!chrome|android).)*safari/i.test(qi);function Qi(){if(!Zi)return 0;let e=qi.match(/Version\/(\d+)/);return e===null||e.length<2?0:parseInt(e[1])}var $i=[`Macintosh`,`MacIntel`,`MacPPC`,`Mac68K`].includes(Ji),ea=Ji===`iPad`,ta=Ji===`iPhone`,na=[`Windows`,`Win16`,`Win32`,`WinCE`].includes(Ji),ra=Ji.indexOf(`Linux`)>=0,ia=/\bCrOS\b/.test(qi),aa=class{constructor(){this._tasks=[],this._i=0}enqueue(e){this._tasks.push(e),this._start()}flush(){for(;this._ii){r-t<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(r-t))}ms`),this._start();return}r=i}this.clear()}},oa=class extends aa{_requestCallback(e){return setTimeout(()=>e(this._createDeadline(16)))}_cancelCallback(e){clearTimeout(e)}_createDeadline(e){let t=performance.now()+e;return{timeRemaining:()=>Math.max(0,t-performance.now())}}},sa=class extends aa{_requestCallback(e){return requestIdleCallback(e)}_cancelCallback(e){cancelIdleCallback(e)}},ca=!Ki&&`requestIdleCallback`in window?sa:oa,la=class{constructor(){this._queue=new ca}set(e){this._queue.clear(),this._queue.enqueue(e)}flush(){this._queue.flush()}},ua=class extends A{constructor(e,t,n,r,i,a,o,s,c){super(),this._rowCount=e,this._optionsService=n,this._charSizeService=r,this._coreService=i,this._coreBrowserService=s,this._renderer=this._register(new pt),this._pausedResizeTask=new la,this._observerDisposable=this._register(new pt),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 N),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this._register(new N),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this._register(new N),this.onRender=this._onRender.event,this._onRefreshRequest=this._register(new N),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new Wi((e,t)=>this._renderRows(e,t),this._coreBrowserService),this._register(this._renderDebouncer),this._syncOutputHandler=new da(this._coreBrowserService,this._coreService,()=>this._fullRefresh()),this._register(k(()=>this._syncOutputHandler.dispose())),this._register(this._coreBrowserService.onDprChange(()=>this.handleDevicePixelRatioChange())),this._register(o.onResize(()=>this._fullRefresh())),this._register(o.buffers.onBufferActivate(()=>this._renderer.value?.clear())),this._register(this._optionsService.onOptionChange(()=>this._handleOptionsChanged())),this._register(this._charSizeService.onCharSizeChange(()=>this.handleCharSizeChanged())),this._register(a.onDecorationRegistered(()=>this._fullRefresh())),this._register(a.onDecorationRemoved(()=>this._fullRefresh())),this._register(this._optionsService.onMultipleOptionChange([`customGlyphs`,`drawBoldTextInBrightColors`,`letterSpacing`,`lineHeight`,`fontFamily`,`fontSize`,`fontWeight`,`fontWeightBold`,`minimumContrastRatio`,`rescaleOverlappingGlyphs`],()=>{this.clear(),this.handleResize(o.cols,o.rows),this._fullRefresh()})),this._register(this._optionsService.onMultipleOptionChange([`cursorBlink`,`cursorStyle`],()=>this.refreshRows(o.buffer.y,o.buffer.y,!0))),this._register(c.onChangeColors(()=>this._fullRefresh())),this._registerIntersectionObserver(this._coreBrowserService.window,t),this._register(this._coreBrowserService.onWindowChange(e=>this._registerIntersectionObserver(e,t)))}get dimensions(){return this._renderer.value.dimensions}_registerIntersectionObserver(e,t){if(`IntersectionObserver`in e){let n=new e.IntersectionObserver(e=>this._handleIntersectionChange(e[e.length-1]),{threshold:0});n.observe(t),this._observerDisposable.value=k(()=>n.disconnect())}}_handleIntersectionChange(e){this._isPaused=e.isIntersecting===void 0?e.intersectionRatio===0:!e.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(e,t,n=!1){if(this._isPaused){this._needsFullRefresh=!0;return}if(this._coreService.decPrivateModes.synchronizedOutput){this._syncOutputHandler.bufferRows(e,t);return}let r=this._syncOutputHandler.flush();r&&(e=Math.min(e,r.start),t=Math.max(t,r.end)),n||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(e,t,this._rowCount)}_renderRows(e,t){if(this._renderer.value){if(this._coreService.decPrivateModes.synchronizedOutput){this._syncOutputHandler.bufferRows(e,t);return}e=Math.min(e,this._rowCount-1),t=Math.min(t,this._rowCount-1),this._renderer.value.renderRows(e,t),this._needsSelectionRefresh&&=(this._renderer.value.handleSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:e,end:t}),this._onRender.fire({start:e,end:t}),this._isNextRenderRedrawOnly=!0}}resize(e,t){this._rowCount=t,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(e){this._renderer.value=e,this._renderer.value&&(this._renderer.value.onRequestRedraw(e=>this.refreshRows(e.start,e.end,!0)),this._needsSelectionRefresh=!0,this._fullRefresh())}addRefreshCallback(e){return this._renderDebouncer.addRefreshCallback(e)}_fullRefresh(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)}clearTextureAtlas(){this._renderer.value&&(this._renderer.value.clearTextureAtlas?.(),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(e,t){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set(()=>this._renderer.value?.handleResize(e,t)):this._renderer.value.handleResize(e,t),this._fullRefresh())}handleCharSizeChanged(){this._renderer.value?.handleCharSizeChanged()}handleBlur(){this._renderer.value?.handleBlur()}handleFocus(){this._renderer.value?.handleFocus()}handleSelectionChanged(e,t,n){this._selectionState.start=e,this._selectionState.end=t,this._selectionState.columnSelectMode=n,this._renderer.value?.handleSelectionChanged(e,t,n)}handleCursorMove(){this._renderer.value?.handleCursorMove()}clear(){this._renderer.value?.clear()}};ua=y([b(2,O),b(3,Ae),b(4,D),b(5,De),b(6,E),b(7,je),b(8,Ie)],ua);var da=class{constructor(e,t,n){this._coreBrowserService=e,this._coreService=t,this._onTimeout=n,this._start=0,this._end=0,this._isBuffering=!1}bufferRows(e,t){this._isBuffering?(this._start=Math.min(this._start,e),this._end=Math.max(this._end,t)):(this._start=e,this._end=t,this._isBuffering=!0),this._timeout===void 0&&(this._timeout=this._coreBrowserService.window.setTimeout(()=>{this._timeout=void 0,this._coreService.decPrivateModes.synchronizedOutput=!1,this._onTimeout()},1e3))}flush(){if(this._timeout!==void 0&&(this._coreBrowserService.window.clearTimeout(this._timeout),this._timeout=void 0),!this._isBuffering)return;let e={start:this._start,end:this._end};return this._isBuffering=!1,e}dispose(){this._timeout!==void 0&&(this._coreBrowserService.window.clearTimeout(this._timeout),this._timeout=void 0)}};function fa(e,t,n,r){let i=n.buffer.x,a=n.buffer.y;if(!n.buffer.hasScrollback)return ha(i,a,e,t,n,r)+ga(a,t,n,r)+_a(i,a,e,t,n,r);let o;if(a===t)return o=i>e?`D`:`C`,wa(Math.abs(i-e),Ca(o,r));o=a>t?`D`:`C`;let s=Math.abs(a-t);return wa(ma(a>t?e:i,n)+(s-1)*n.cols+1+pa(a>t?i:e,n),Ca(o,r))}function pa(e,t){return e-1}function ma(e,t){return t.cols-e}function ha(e,t,n,r,i,a){return ga(t,r,i,a).length===0?``:wa(Sa(e,t,e,t-ya(t,i),!1,i).length,Ca(`D`,a))}function ga(e,t,n,r){let i=e-ya(e,n),a=t-ya(t,n);return wa(Math.abs(i-a)-va(e,t,n),Ca(xa(e,t),r))}function _a(e,t,n,r,i,a){let o;o=ga(t,r,i,a).length>0?r-ya(r,i):t;let s=r,c=ba(e,t,n,r,i,a);return wa(Sa(e,o,n,s,c===`C`,i).length,Ca(c,a))}function va(e,t,n){let r=0,i=e-ya(e,n),a=t-ya(t,n);for(let o=0;o=0&&e0?r-ya(r,i):t,e=n&&ot?`A`:`B`}function Sa(e,t,n,r,i,a){let o=e,s=t,c=``;for(;(o!==n||s!==r)&&s>=0&&sa.cols-1?(c+=a.buffer.translateBufferLineToString(s,!1,e,o),o=0,e=0,s++):!i&&o<0&&(c+=a.buffer.translateBufferLineToString(s,!1,0,e+1),o=a.cols-1,e=o,s--);return c+a.buffer.translateBufferLineToString(s,!1,e,o)}function Ca(e,t){let n=t?`O`:`[`;return L.ESC+n+e}function wa(e,t){e=Math.floor(e);let n=``;for(let r=0;rthis._bufferService.cols?e%this._bufferService.cols===0?[this._bufferService.cols,this.selectionStart[1]+Math.floor(e/this._bufferService.cols)-1]:[e%this._bufferService.cols,this.selectionStart[1]+Math.floor(e/this._bufferService.cols)]:[e,this.selectionStart[1]]}if(this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]){let e=this.selectionStart[0]+this.selectionStartLength;return e>this._bufferService.cols?[e%this._bufferService.cols,this.selectionStart[1]+Math.floor(e/this._bufferService.cols)]:[Math.max(e,this.selectionEnd[0]),this.selectionEnd[1]]}return this.selectionEnd}}areSelectionValuesReversed(){let e=this.selectionStart,t=this.selectionEnd;return!e||!t?!1:e[1]>t[1]||e[1]===t[1]&&e[0]>t[0]}handleTrim(e){return this.selectionStart&&(this.selectionStart[1]-=e),this.selectionEnd&&(this.selectionEnd[1]-=e),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)}};function Ea(e,t){if(e.start.y>e.end.y)throw Error(`Buffer range end (${e.end.x}, ${e.end.y}) cannot be before start (${e.start.x}, ${e.start.y})`);return t*(e.end.y-e.start.y)+(e.end.x-e.start.x+1)}var Da=50,Oa=15,ka=50,Aa=500,ja=RegExp(`\xA0`,`g`),Ma=class extends A{constructor(e,t,n,r,i,a,o,s,c){super(),this._element=e,this._screenElement=t,this._linkifier=n,this._bufferService=r,this._coreService=i,this._mouseService=a,this._optionsService=o,this._renderService=s,this._coreBrowserService=c,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new w,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this._register(new N),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this._register(new N),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this._register(new N),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this._register(new N),this.onRequestScrollLines=this._onRequestScrollLines.event,this._mouseMoveListener=e=>this._handleMouseMove(e),this._mouseUpListener=e=>this._handleMouseUp(e),this._coreService.onUserInput(()=>{this.hasSelection&&this.clearSelection()}),this._trimListener=this._bufferService.buffer.lines.onTrim(e=>this._handleTrim(e)),this._register(this._bufferService.buffers.onBufferActivate(e=>this._handleBufferActivate(e))),this.enable(),this._model=new Ta(this._bufferService),this._activeSelectionMode=0,this._register(k(()=>{this._removeMouseDownListeners()})),this._register(this._bufferService.onResize(e=>{e.rowsChanged&&this.clearSelection()}))}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(){let e=this._model.finalSelectionStart,t=this._model.finalSelectionEnd;return!e||!t?!1:e[0]!==t[0]||e[1]!==t[1]}get selectionText(){let e=this._model.finalSelectionStart,t=this._model.finalSelectionEnd;if(!e||!t)return``;let n=this._bufferService.buffer,r=[];if(this._activeSelectionMode===3){if(e[0]===t[0])return``;let i=e[0]e.replace(ja,` `)).join(na?`\r +`:` +`)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(e){this._refreshAnimationFrame||=this._coreBrowserService.window.requestAnimationFrame(()=>this._refresh()),ra&&e&&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(e){let t=this._getMouseBufferCoords(e),n=this._model.finalSelectionStart,r=this._model.finalSelectionEnd;return!n||!r||!t?!1:this._areCoordsInSelection(t,n,r)}isCellInSelection(e,t){let n=this._model.finalSelectionStart,r=this._model.finalSelectionEnd;return!n||!r?!1:this._areCoordsInSelection([e,t],n,r)}_areCoordsInSelection(e,t,n){return e[1]>t[1]&&e[1]=t[0]&&e[0]=t[0]}_selectWordAtCursor(e,t){let n=this._linkifier.currentLink?.link?.range;if(n)return this._model.selectionStart=[n.start.x-1,n.start.y-1],this._model.selectionStartLength=Ea(n,this._bufferService.cols),this._model.selectionEnd=void 0,!0;let r=this._getMouseBufferCoords(e);return r?(this._selectWordAt(r,t),this._model.selectionEnd=void 0,!0):!1}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(e,t){this._model.clearSelection(),e=Math.max(e,0),t=Math.min(t,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,e],this._model.selectionEnd=[this._bufferService.cols,t],this.refresh(),this._onSelectionChange.fire()}_handleTrim(e){this._model.handleTrim(e)&&this.refresh()}_getMouseBufferCoords(e){let t=this._mouseService.getCoords(e,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(t)return t[0]--,t[1]--,t[1]+=this._bufferService.buffer.ydisp,t}_getMouseEventScrollAmount(e){let t=Vi(this._coreBrowserService.window,e,this._screenElement)[1],n=this._renderService.dimensions.css.canvas.height;return t>=0&&t<=n?0:(t>n&&(t-=n),t=Math.min(Math.max(t,-Da),Da),t/=Da,t/Math.abs(t)+Math.round(t*(Oa-1)))}shouldForceSelection(e){return $i?e.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:e.shiftKey}handleMouseDown(e){if(this._mouseDownTimeStamp=e.timeStamp,!(e.button===2&&this.hasSelection)&&e.button===0){if(!this._enabled){if(!this.shouldForceSelection(e))return;e.stopPropagation()}e.preventDefault(),this._dragScrollAmount=0,this._enabled&&e.shiftKey?this._handleIncrementalClick(e):e.detail===1?this._handleSingleClick(e):e.detail===2?this._handleDoubleClick(e):e.detail===3&&this._handleTripleClick(e),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(),ka)}_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(e){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(e))}_handleSingleClick(e){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(e)?3:0,this._model.selectionStart=this._getMouseBufferCoords(e),!this._model.selectionStart)return;this._model.selectionEnd=void 0;let t=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);t&&t.length!==this._model.selectionStart[0]&&t.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(e){this._selectWordAtCursor(e,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(e){let t=this._getMouseBufferCoords(e);t&&(this._activeSelectionMode=2,this._selectLineAt(t[1]))}shouldColumnSelect(e){return e.altKey&&!($i&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(e){if(e.stopImmediatePropagation(),!this._model.selectionStart)return;let t=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(e),!this._model.selectionEnd){this.refresh(!0);return}this._activeSelectionMode===2?this._model.selectionEnd[1]0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));let n=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(e.ydisp+this._bufferService.rows,e.lines.length-1)):(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=e.ydisp),this.refresh()}}_handleMouseUp(e){let t=e.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&tthis._handleTrim(e))}_convertViewportColToCharacterIndex(e,t){let n=t;for(let r=0;t>=r;r++){let i=e.loadCell(r,this._workCell).getChars().length;this._workCell.getWidth()===0?n--:i>1&&t!==r&&(n+=i-1)}return n}setSelection(e,t,n){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[e,t],this._model.selectionStartLength=n,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(e){this._isClickInSelection(e)||(this._selectWordAtCursor(e,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(e,t,n=!0,r=!0){if(e[0]>=this._bufferService.cols)return;let i=this._bufferService.buffer,a=i.lines.get(e[1]);if(!a)return;let o=i.translateBufferLineToString(e[1],!1),s=this._convertViewportColToCharacterIndex(a,e[0]),c=s,l=e[0]-s,u=0,d=0,f=0,p=0;if(o.charAt(s)===` `){for(;s>0&&o.charAt(s-1)===` `;)s--;for(;c1&&(p+=r-1,c+=r-1);t>0&&s>0&&!this._isCharWordSeparator(a.loadCell(t-1,this._workCell));){a.loadCell(t-1,this._workCell);let e=this._workCell.getChars().length;this._workCell.getWidth()===0?(u++,t--):e>1&&(f+=e-1,s-=e-1),s--,t--}for(;n1&&(p+=e-1,c+=e-1),c++,n++}}c++;let m=s+l-u+f,h=Math.min(this._bufferService.cols,c-s+u+d-f-p);if(!(!t&&o.slice(s,c).trim()===``)){if(n&&m===0&&a.getCodePoint(0)!==32){let t=i.lines.get(e[1]-1);if(t&&a.isWrapped&&t.getCodePoint(this._bufferService.cols-1)!==32){let t=this._getWordAt([this._bufferService.cols-1,e[1]-1],!1,!0,!1);if(t){let e=this._bufferService.cols-t.start;m-=e,h+=e}}}if(r&&m+h===this._bufferService.cols&&a.getCodePoint(this._bufferService.cols-1)!==32){let t=i.lines.get(e[1]+1);if(t?.isWrapped&&t.getCodePoint(0)!==32){let t=this._getWordAt([0,e[1]+1],!1,!1,!0);t&&(h+=t.length)}}return{start:m,length:h}}}_selectWordAt(e,t){let n=this._getWordAt(e,t);if(n){for(;n.start<0;)n.start+=this._bufferService.cols,e[1]--;this._model.selectionStart=[n.start,e[1]],this._model.selectionStartLength=n.length}}_selectToWordAt(e){let t=this._getWordAt(e,!0);if(t){let n=e[1];for(;t.start<0;)t.start+=this._bufferService.cols,n--;if(!this._model.areSelectionValuesReversed())for(;t.start+t.length>this._bufferService.cols;)t.length-=this._bufferService.cols,n++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?t.start:t.start+t.length,n]}}_isCharWordSeparator(e){return e.getWidth()!==0&&this._optionsService.rawOptions.wordSeparator.indexOf(e.getChars())>=0}_selectLineAt(e){let t=this._bufferService.buffer.getWrappedRangeForLine(e),n={start:{x:0,y:t.first},end:{x:this._bufferService.cols-1,y:t.last}};this._model.selectionStart=[0,t.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=Ea(n,this._bufferService.cols)}};Ma=y([b(3,E),b(4,D),b(5,Me),b(6,O),b(7,Ne),b(8,je)],Ma);var Na=class{constructor(){this._data={}}set(e,t,n){this._data[e]||(this._data[e]={}),this._data[e][t]=n}get(e,t){return this._data[e]?this._data[e][t]:void 0}clear(){this._data={}}},Pa=class{constructor(){this._color=new Na,this._css=new Na}setCss(e,t,n){this._css.set(e,t,n)}getCss(e,t){return this._css.get(e,t)}setColor(e,t,n){this._color.set(e,t,n)}getColor(e,t){return this._color.get(e,t)}clear(){this._color.clear(),this._css.clear()}},K=Object.freeze((()=>{let e=[W.toColor(`#2e3436`),W.toColor(`#cc0000`),W.toColor(`#4e9a06`),W.toColor(`#c4a000`),W.toColor(`#3465a4`),W.toColor(`#75507b`),W.toColor(`#06989a`),W.toColor(`#d3d7cf`),W.toColor(`#555753`),W.toColor(`#ef2929`),W.toColor(`#8ae234`),W.toColor(`#fce94f`),W.toColor(`#729fcf`),W.toColor(`#ad7fa8`),W.toColor(`#34e2e2`),W.toColor(`#eeeeec`)],t=[0,95,135,175,215,255];for(let n=0;n<216;n++){let r=t[n/36%6|0],i=t[n/6%6|0],a=t[n%6];e.push({css:H.toCss(r,i,a),rgba:H.toRgba(r,i,a)})}for(let t=0;t<24;t++){let n=8+t*10;e.push({css:H.toCss(n,n,n),rgba:H.toRgba(n,n,n)})}return e})()),Fa=W.toColor(`#ffffff`),Ia=W.toColor(`#000000`),La=W.toColor(`#ffffff`),Ra=Ia,za={css:`rgba(255, 255, 255, 0.3)`,rgba:4294967117},Ba=Fa,Va=class extends A{constructor(e){super(),this._optionsService=e,this._contrastCache=new Pa,this._halfContrastCache=new Pa,this._onChangeColors=this._register(new N),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:Fa,background:Ia,cursor:La,cursorAccent:Ra,selectionForeground:void 0,selectionBackgroundTransparent:za,selectionBackgroundOpaque:U.blend(Ia,za),selectionInactiveBackgroundTransparent:za,selectionInactiveBackgroundOpaque:U.blend(Ia,za),scrollbarSliderBackground:U.opacity(Fa,.2),scrollbarSliderHoverBackground:U.opacity(Fa,.4),scrollbarSliderActiveBackground:U.opacity(Fa,.5),overviewRulerBorder:Fa,ansi:K.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)))}get colors(){return this._colors}_setTheme(e={}){let t=this._colors;if(t.foreground=q(e.foreground,Fa),t.background=q(e.background,Ia),t.cursor=U.blend(t.background,q(e.cursor,La)),t.cursorAccent=U.blend(t.background,q(e.cursorAccent,Ra)),t.selectionBackgroundTransparent=q(e.selectionBackground,za),t.selectionBackgroundOpaque=U.blend(t.background,t.selectionBackgroundTransparent),t.selectionInactiveBackgroundTransparent=q(e.selectionInactiveBackground,t.selectionBackgroundTransparent),t.selectionInactiveBackgroundOpaque=U.blend(t.background,t.selectionInactiveBackgroundTransparent),t.selectionForeground=e.selectionForeground?q(e.selectionForeground,ui):void 0,t.selectionForeground===ui&&(t.selectionForeground=void 0),U.isOpaque(t.selectionBackgroundTransparent)&&(t.selectionBackgroundTransparent=U.opacity(t.selectionBackgroundTransparent,.3)),U.isOpaque(t.selectionInactiveBackgroundTransparent)&&(t.selectionInactiveBackgroundTransparent=U.opacity(t.selectionInactiveBackgroundTransparent,.3)),t.scrollbarSliderBackground=q(e.scrollbarSliderBackground,U.opacity(t.foreground,.2)),t.scrollbarSliderHoverBackground=q(e.scrollbarSliderHoverBackground,U.opacity(t.foreground,.4)),t.scrollbarSliderActiveBackground=q(e.scrollbarSliderActiveBackground,U.opacity(t.foreground,.5)),t.overviewRulerBorder=q(e.overviewRulerBorder,Ba),t.ansi=K.slice(),t.ansi[0]=q(e.black,K[0]),t.ansi[1]=q(e.red,K[1]),t.ansi[2]=q(e.green,K[2]),t.ansi[3]=q(e.yellow,K[3]),t.ansi[4]=q(e.blue,K[4]),t.ansi[5]=q(e.magenta,K[5]),t.ansi[6]=q(e.cyan,K[6]),t.ansi[7]=q(e.white,K[7]),t.ansi[8]=q(e.brightBlack,K[8]),t.ansi[9]=q(e.brightRed,K[9]),t.ansi[10]=q(e.brightGreen,K[10]),t.ansi[11]=q(e.brightYellow,K[11]),t.ansi[12]=q(e.brightBlue,K[12]),t.ansi[13]=q(e.brightMagenta,K[13]),t.ansi[14]=q(e.brightCyan,K[14]),t.ansi[15]=q(e.brightWhite,K[15]),e.extendedAnsi){let n=Math.min(t.ansi.length-16,e.extendedAnsi.length);for(let r=0;re.index-t.index),r=[];for(let t of n){let n=this._services.get(t.id);if(!n)throw Error(`[createInstance] ${e.name} depends on UNKNOWN service ${t.id._id}.`);r.push(n)}let i=n.length>0?n[0].index:t.length;if(t.length!==i)throw Error(`[createInstance] First service dependency of ${e.name} at position ${i+1} conflicts with ${t.length} static arguments`);return new e(...t,...r)}},Wa={trace:0,debug:1,info:2,warn:3,error:4,off:5},Ga=`xterm.js: `,Ka=class extends A{constructor(e){super(),this._optionsService=e,this._logLevel=5,this._updateLogLevel(),this._register(this._optionsService.onSpecificOptionChange(`logLevel`,()=>this._updateLogLevel())),qa=this}get logLevel(){return this._logLevel}_updateLogLevel(){this._logLevel=Wa[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(e){for(let t=0;tthis._length)for(let t=this._length;t=e;t--)this._array[this._getCyclicIndex(t+n.length)]=this._array[this._getCyclicIndex(t)];for(let t=0;tthis._maxLength){let e=this._length+n.length-this._maxLength;this._startIndex+=e,this._length=this._maxLength,this.onTrimEmitter.fire(e)}else this._length+=n.length}trimStart(e){e>this._length&&(e=this._length),this._startIndex+=e,this._length-=e,this.onTrimEmitter.fire(e)}shiftElements(e,t,n){if(!(t<=0)){if(e<0||e>=this._length)throw Error(`start argument out of range`);if(e+n<0)throw Error(`Cannot shift elements in list beyond index 0`);if(n>0){for(let r=t-1;r>=0;r--)this.set(e+r+n,this.get(e+r));let r=e+t+n-this._length;if(r>0)for(this._length+=r;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let r=0;r>22,t&2097152?this._combined[e].charCodeAt(this._combined[e].length-1):n]}set(e,t){this._data[e*J+1]=t[0],t[1].length>1?(this._combined[e]=t[1],this._data[e*J+0]=e|2097152|t[2]<<22):this._data[e*J+0]=t[1].charCodeAt(0)|t[2]<<22}getWidth(e){return this._data[e*J+0]>>22}hasWidth(e){return this._data[e*J+0]&12582912}getFg(e){return this._data[e*J+1]}getBg(e){return this._data[e*J+2]}hasContent(e){return this._data[e*J+0]&4194303}getCodePoint(e){let t=this._data[e*J+0];return t&2097152?this._combined[e].charCodeAt(this._combined[e].length-1):t&2097151}isCombined(e){return this._data[e*J+0]&2097152}getString(e){let t=this._data[e*J+0];return t&2097152?this._combined[e]:t&2097151?le(t&2097151):``}isProtected(e){return this._data[e*J+2]&536870912}loadCell(e,t){return Ya=e*J,t.content=this._data[Ya+0],t.fg=this._data[Ya+1],t.bg=this._data[Ya+2],t.content&2097152&&(t.combinedData=this._combined[e]),t.bg&268435456&&(t.extended=this._extendedAttrs[e]),t}setCell(e,t){t.content&2097152&&(this._combined[e]=t.combinedData),t.bg&268435456&&(this._extendedAttrs[e]=t.extended),this._data[e*J+0]=t.content,this._data[e*J+1]=t.fg,this._data[e*J+2]=t.bg}setCellFromCodepoint(e,t,n,r){r.bg&268435456&&(this._extendedAttrs[e]=r.extended),this._data[e*J+0]=t|n<<22,this._data[e*J+1]=r.fg,this._data[e*J+2]=r.bg}addCodepointToCell(e,t,n){let r=this._data[e*J+0];r&2097152?this._combined[e]+=le(t):r&2097151?(this._combined[e]=le(r&2097151)+le(t),r&=-2097152,r|=2097152):r=t|1<<22,n&&(r&=-12582913,r|=n<<22),this._data[e*J+0]=r}insertCells(e,t,n){if(e%=this.length,e&&this.getWidth(e-1)===2&&this.setCellFromCodepoint(e-1,0,1,n),t=0;--n)this.setCell(e+t+n,this.loadCell(e+n,r));for(let r=0;rthis.length){if(this._data.buffer.byteLength>=n*4)this._data=new Uint32Array(this._data.buffer,0,n);else{let e=new Uint32Array(n);e.set(this._data),this._data=e}for(let n=this.length;n=e&&delete this._combined[r]}let r=Object.keys(this._extendedAttrs);for(let t=0;t=e&&delete this._extendedAttrs[n]}}return this.length=e,n*4*Xa=0;--e)if(this._data[e*J+0]&4194303)return e+(this._data[e*J+0]>>22);return 0}getNoBgTrimmedLength(){for(let e=this.length-1;e>=0;--e)if(this._data[e*J+0]&4194303||this._data[e*J+2]&50331648)return e+(this._data[e*J+0]>>22);return 0}copyCellsFrom(e,t,n,r,i){let a=e._data;if(i)for(let i=r-1;i>=0;i--){for(let e=0;e=t&&(this._combined[i-t+n]=e._combined[i])}}translateToString(e,t,n,r){t??=0,n??=this.length,e&&(n=Math.min(n,this.getTrimmedLength())),r&&(r.length=0);let i=``;for(;t>22||1}return r&&r.push(t),i}};function Qa(e,t,n,r,i,a){let o=[];for(let s=0;s=s&&r0&&(e>d||u[e].getTrimmedLength()===0);e--)h++;h>0&&(o.push(s+u.length-h),o.push(h)),s+=u.length-1}return o}function $a(e,t){let n=[],r=0,i=t[r],a=0;for(let o=0;ono(e,r,t)).reduce((e,t)=>e+t),a=0,o=0,s=0;for(;sc&&(a-=c,o++);let l=e[o].getWidth(a-1)===2;l&&a--;let u=l?n-1:n;r.push(u),s+=u}return r}function no(e,t,n){if(t===e.length-1)return e[t].getTrimmedLength();let r=!e[t].hasContent(n-1)&&e[t].getWidth(n-1)===1,i=e[t+1].getWidth(0)===2;return r&&i?n-1:n}var ro=class e{constructor(t){this.line=t,this.isDisposed=!1,this._disposables=[],this._id=e._nextId++,this._onDispose=this.register(new N),this.onDispose=this._onDispose.event}get id(){return this._id}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),lt(this._disposables),this._disposables.length=0)}register(e){return this._disposables.push(e),e}};ro._nextId=1;var io=ro,X={},ao=X.B;X[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:`≥`,"{":`π`,"|":`≠`,"}":`£`,"~":`·`},X.A={"#":`£`},X.B=void 0,X[4]={"#":`£`,"@":`¾`,"[":`ij`,"\\":`½`,"]":`|`,"{":`¨`,"|":`f`,"}":`¼`,"~":`´`},X.C=X[5]={"[":`Ä`,"\\":`Ö`,"]":`Å`,"^":`Ü`,"`":`é`,"{":`ä`,"|":`ö`,"}":`å`,"~":`ü`},X.R={"#":`£`,"@":`à`,"[":`°`,"\\":`ç`,"]":`§`,"{":`é`,"|":`ù`,"}":`è`,"~":`¨`},X.Q={"@":`à`,"[":`â`,"\\":`ç`,"]":`ê`,"^":`î`,"`":`ô`,"{":`é`,"|":`ù`,"}":`è`,"~":`û`},X.K={"@":`§`,"[":`Ä`,"\\":`Ö`,"]":`Ü`,"{":`ä`,"|":`ö`,"}":`ü`,"~":`ß`},X.Y={"#":`£`,"@":`§`,"[":`°`,"\\":`ç`,"]":`é`,"`":`ù`,"{":`à`,"|":`ò`,"}":`è`,"~":`ì`},X.E=X[6]={"@":`Ä`,"[":`Æ`,"\\":`Ø`,"]":`Å`,"^":`Ü`,"`":`ä`,"{":`æ`,"|":`ø`,"}":`å`,"~":`ü`},X.Z={"#":`£`,"@":`§`,"[":`¡`,"\\":`Ñ`,"]":`¿`,"{":`°`,"|":`ñ`,"}":`ç`},X.H=X[7]={"@":`É`,"[":`Ä`,"\\":`Ö`,"]":`Å`,"^":`Ü`,"`":`é`,"{":`ä`,"|":`ö`,"}":`å`,"~":`ü`},X[`=`]={"#":`ù`,"@":`à`,"[":`é`,"\\":`ç`,"]":`ê`,"^":`î`,_:`è`,"`":`ô`,"{":`ä`,"|":`ö`,"}":`ü`,"~":`û`};var oo=4294967295,so=class{constructor(e,t,n){this._hasScrollback=e,this._optionsService=t,this._bufferService=n,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=Y.clone(),this.savedCharset=ao,this.markers=[],this._nullCell=w.fromCharData([0,fe,1,0]),this._whitespaceCell=w.fromCharData([0,pe,1,32]),this._isClearing=!1,this._memoryCleanupQueue=new ca,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new Ja(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}getNullCell(e){return e?(this._nullCell.fg=e.fg,this._nullCell.bg=e.bg,this._nullCell.extended=e.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new he),this._nullCell}getWhitespaceCell(e){return e?(this._whitespaceCell.fg=e.fg,this._whitespaceCell.bg=e.bg,this._whitespaceCell.extended=e.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new he),this._whitespaceCell}getBlankLine(e,t){return new Za(this._bufferService.cols,this.getNullCell(e),t)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){let e=this.ybase+this.y-this.ydisp;return e>=0&&eoo?oo:t}fillViewportRows(e){if(this.lines.length===0){e===void 0&&(e=Y);let t=this._rows;for(;t--;)this.lines.push(this.getBlankLine(e))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new Ja(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(e,t){let n=this.getNullCell(Y),r=0,i=this._getCorrectBufferLength(t);if(i>this.lines.maxLength&&(this.lines.maxLength=i),this.lines.length>0){if(this._cols0&&this.lines.length<=this.ybase+this.y+a+1?(this.ybase--,a++,this.ydisp>0&&this.ydisp--):this.lines.push(new Za(e,n)));else for(let e=this._rows;e>t;e--)this.lines.length>t+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(i0&&(this.lines.trimStart(e),this.ybase=Math.max(this.ybase-e,0),this.ydisp=Math.max(this.ydisp-e,0),this.savedY=Math.max(this.savedY-e,0)),this.lines.maxLength=i}this.x=Math.min(this.x,e-1),this.y=Math.min(this.y,t-1),a&&(this.y+=a),this.savedX=Math.min(this.savedX,e-1),this.scrollTop=0}if(this.scrollBottom=t-1,this._isReflowEnabled&&(this._reflow(e,t),this._cols>e))for(let t=0;t.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue(()=>this._batchedMemoryCleanup()))}_batchedMemoryCleanup(){let e=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,e=!1);let t=0;for(;this._memoryCleanupPosition100)return!0;return e}get _isReflowEnabled(){let e=this._optionsService.rawOptions.windowsPty;return e&&e.buildNumber?this._hasScrollback&&e.backend===`conpty`&&e.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(e,t){this._cols!==e&&(e>this._cols?this._reflowLarger(e,t):this._reflowSmaller(e,t))}_reflowLarger(e,t){let n=this._optionsService.rawOptions.reflowCursorLine,r=Qa(this.lines,this._cols,e,this.ybase+this.y,this.getNullCell(Y),n);if(r.length>0){let n=$a(this.lines,r);eo(this.lines,n.layout),this._reflowLargerAdjustViewport(e,t,n.countRemoved)}}_reflowLargerAdjustViewport(e,t,n){let r=this.getNullCell(Y),i=n;for(;i-->0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length=0;o--){let s=this.lines.get(o);if(!s||!s.isWrapped&&s.getTrimmedLength()<=e)continue;let c=[s];for(;s.isWrapped&&o>0;)s=this.lines.get(--o),c.unshift(s);if(!n){let e=this.ybase+this.y;if(e>=o&&e0&&(i.push({start:o+c.length+a,newLines:p}),a+=p.length),c.push(...p);let m=u.length-1,h=u[m];h===0&&(m--,h=u[m]);let g=c.length-d-1,_=l;for(;g>=0;){let e=Math.min(_,h);if(c[m]===void 0)break;c[m].copyCellsFrom(c[g],_-e,h-e,e,!0),h-=e,h===0&&(m--,h=u[m]),_-=e,_===0&&(g--,_=no(c,Math.max(g,0),this._cols))}for(let t=0;t0;)this.ybase===0?this.y0){let e=[],t=[];for(let e=0;e=0;l--)if(s&&s.start>r+c){for(let e=s.newLines.length-1;e>=0;e--)this.lines.set(l--,s.newLines[e]);l++,e.push({index:r+1,amount:s.newLines.length}),c+=s.newLines.length,s=i[++o]}else this.lines.set(l,t[r--]);let l=0;for(let t=e.length-1;t>=0;t--)e[t].index+=l,this.lines.onInsertEmitter.fire(e[t]),l+=e[t].amount;let u=Math.max(0,n+a-this.lines.maxLength);u>0&&this.lines.onTrimEmitter.fire(u)}}translateBufferLineToString(e,t,n=0,r){let i=this.lines.get(e);return i?i.translateToString(t,n,r):``}getWrappedRangeForLine(e){let t=e,n=e;for(;t>0&&this.lines.get(t).isWrapped;)t--;for(;n+10;);return e>=this._cols?this._cols-1:e<0?0:e}nextStop(e){for(e??=this.x;!this.tabs[++e]&&e=this._cols?this._cols-1:e<0?0:e}clearMarkers(e){this._isClearing=!0;for(let t=0;t{t.line-=e,t.line<0&&t.dispose()})),t.register(this.lines.onInsert(e=>{t.line>=e.index&&(t.line+=e.amount)})),t.register(this.lines.onDelete(e=>{t.line>=e.index&&t.linee.index&&(t.line-=e.amount)})),t.register(t.onDispose(()=>this._removeMarker(t))),t}_removeMarker(e){this._isClearing||this.markers.splice(this.markers.indexOf(e),1)}},co=class extends A{constructor(e,t){super(),this._optionsService=e,this._bufferService=t,this._onBufferActivate=this._register(new N),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 so(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new so(!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(e){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(e),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(e,t){this._normal.resize(e,t),this._alt.resize(e,t),this.setupTabStops(e)}setupTabStops(e){this._normal.setupTabStops(e),this._alt.setupTabStops(e)}},lo=2,uo=1,fo=class extends A{constructor(e){super(),this.isUserScrolling=!1,this._onResize=this._register(new N),this.onResize=this._onResize.event,this._onScroll=this._register(new N),this.onScroll=this._onScroll.event,this.cols=Math.max(e.rawOptions.cols||0,lo),this.rows=Math.max(e.rawOptions.rows||0,uo),this.buffers=this._register(new co(e,this)),this._register(this.buffers.onBufferActivate(e=>{this._onScroll.fire(e.activeBuffer.ydisp)}))}get buffer(){return this.buffers.active}resize(e,t){let n=this.cols!==e,r=this.rows!==t;this.cols=e,this.rows=t,this.buffers.resize(e,t),this._onResize.fire({cols:e,rows:t,colsChanged:n,rowsChanged:r})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(e,t=!1){let n=this.buffer,r;r=this._cachedBlankLine,(!r||r.length!==this.cols||r.getFg(0)!==e.fg||r.getBg(0)!==e.bg)&&(r=n.getBlankLine(e,t),this._cachedBlankLine=r),r.isWrapped=t;let i=n.ybase+n.scrollTop,a=n.ybase+n.scrollBottom;if(n.scrollTop===0){let e=n.lines.isFull;a===n.lines.length-1?e?n.lines.recycle().copyFrom(r):n.lines.push(r.clone()):n.lines.splice(a+1,0,r.clone()),e?this.isUserScrolling&&(n.ydisp=Math.max(n.ydisp-1,0)):(n.ybase++,this.isUserScrolling||n.ydisp++)}else{let e=a-i+1;n.lines.shiftElements(i+1,e-1,-1),n.lines.set(a,r.clone())}this.isUserScrolling||(n.ydisp=n.ybase),this._onScroll.fire(n.ydisp)}scrollLines(e,t){let n=this.buffer;if(e<0){if(n.ydisp===0)return;this.isUserScrolling=!0}else e+n.ydisp>=n.ybase&&(this.isUserScrolling=!1);let r=n.ydisp;n.ydisp=Math.max(Math.min(n.ydisp+e,n.ybase),0),r!==n.ydisp&&(t||this._onScroll.fire(n.ydisp))}};fo=y([b(0,O)],fo);var po={cols:80,rows:24,cursorBlink:!1,cursorStyle:`block`,cursorWidth:1,cursorInactiveStyle:`outline`,customGlyphs:!0,drawBoldTextInBrightColors:!0,documentOverride:null,fastScrollModifier:`alt`,fastScrollSensitivity:5,fontFamily:`monospace`,fontSize:15,fontWeight:`normal`,fontWeightBold:`bold`,ignoreBracketedPasteMode:!1,lineHeight:1,letterSpacing:0,linkHandler:null,logLevel:`info`,logger:null,scrollback:1e3,scrollOnEraseInDisplay:!1,scrollOnUserInput:!0,scrollSensitivity:1,screenReaderMode:!1,smoothScrollDuration:0,macOptionIsMeta:!1,macOptionClickForcesSelection:!1,minimumContrastRatio:1,disableStdin:!1,allowProposedApi:!1,allowTransparency:!1,tabStopWidth:8,theme:{},reflowCursorLine:!1,rescaleOverlappingGlyphs:!1,rightClickSelectsWord:$i,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:` ()[]{}',"\``,altClickMovesCursor:!0,convertEol:!1,termName:`xterm`,cancelEvents:!1,overviewRuler:{}},mo=[`normal`,`bold`,`100`,`200`,`300`,`400`,`500`,`600`,`700`,`800`,`900`],ho=class extends A{constructor(e){super(),this._onOptionChange=this._register(new N),this.onOptionChange=this._onOptionChange.event;let t={...po};for(let n in e)if(n in t)try{let r=e[n];t[n]=this._sanitizeAndValidateOption(n,r)}catch(e){console.error(e)}this.rawOptions=t,this.options={...t},this._setupOptions(),this._register(k(()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null}))}onSpecificOptionChange(e,t){return this.onOptionChange(n=>{n===e&&t(this.rawOptions[e])})}onMultipleOptionChange(e,t){return this.onOptionChange(n=>{e.indexOf(n)!==-1&&t()})}_setupOptions(){let e=e=>{if(!(e in po))throw Error(`No option with key "${e}"`);return this.rawOptions[e]},t=(e,t)=>{if(!(e in po))throw Error(`No option with key "${e}"`);t=this._sanitizeAndValidateOption(e,t),this.rawOptions[e]!==t&&(this.rawOptions[e]=t,this._onOptionChange.fire(e))};for(let n in this.rawOptions){let r={get:e.bind(this,n),set:t.bind(this,n)};Object.defineProperty(this.options,n,r)}}_sanitizeAndValidateOption(e,t){switch(e){case`cursorStyle`:if(t||=po[e],!go(t))throw Error(`"${t}" is not a valid value for ${e}`);break;case`wordSeparator`:t||=po[e];break;case`fontWeight`:case`fontWeightBold`:if(typeof t==`number`&&1<=t&&t<=1e3)break;t=mo.includes(t)?t:po[e];break;case`cursorWidth`:t=Math.floor(t);case`lineHeight`:case`tabStopWidth`:if(t<1)throw Error(`${e} cannot be less than 1, value: ${t}`);break;case`minimumContrastRatio`:t=Math.max(1,Math.min(21,Math.round(t*10)/10));break;case`scrollback`:if(t=Math.min(t,4294967295),t<0)throw Error(`${e} cannot be less than 0, value: ${t}`);break;case`fastScrollSensitivity`:case`scrollSensitivity`:if(t<=0)throw Error(`${e} cannot be less than or equal to 0, value: ${t}`);break;case`rows`:case`cols`:if(!t&&t!==0)throw Error(`${e} must be numeric, value: ${t}`);break;case`windowsPty`:t??={};break}return t}};function go(e){return e===`block`||e===`underline`||e===`bar`}function _o(e,t=5){if(typeof e!=`object`)return e;let n=Array.isArray(e)?[]:{};for(let r in e)n[r]=t<=1?e[r]:e[r]&&_o(e[r],t-1);return n}var vo=Object.freeze({insertMode:!1}),yo=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,cursorBlink:void 0,cursorStyle:void 0,origin:!1,reverseWraparound:!1,sendFocus:!1,synchronizedOutput:!1,wraparound:!0}),bo=class extends A{constructor(e,t,n){super(),this._bufferService=e,this._logService=t,this._optionsService=n,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this._register(new N),this.onData=this._onData.event,this._onUserInput=this._register(new N),this.onUserInput=this._onUserInput.event,this._onBinary=this._register(new N),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this._register(new N),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=_o(vo),this.decPrivateModes=_o(yo)}reset(){this.modes=_o(vo),this.decPrivateModes=_o(yo)}triggerDataEvent(e,t=!1){if(this._optionsService.rawOptions.disableStdin)return;let n=this._bufferService.buffer;t&&this._optionsService.rawOptions.scrollOnUserInput&&n.ybase!==n.ydisp&&this._onRequestScrollToBottom.fire(),t&&this._onUserInput.fire(),this._logService.debug(`sending data "${e}"`),this._logService.trace(`sending data (codes)`,()=>e.split(``).map(e=>e.charCodeAt(0))),this._onData.fire(e)}triggerBinaryEvent(e){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${e}"`),this._logService.trace(`sending binary (codes)`,()=>e.split(``).map(e=>e.charCodeAt(0))),this._onBinary.fire(e))}};bo=y([b(0,E),b(1,we),b(2,O)],bo);var xo={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:e=>e.button===4||e.action!==1?!1:(e.ctrl=!1,e.alt=!1,e.shift=!1,!0)},VT200:{events:19,restrict:e=>e.action!==32},DRAG:{events:23,restrict:e=>!(e.action===32&&e.button===3)},ANY:{events:31,restrict:e=>!0}};function So(e,t){let n=(e.ctrl?16:0)|(e.shift?4:0)|(e.alt?8:0);return e.button===4?(n|=64,n|=e.action):(n|=e.button&3,e.button&4&&(n|=64),e.button&8&&(n|=128),e.action===32?n|=32:e.action===0&&!t&&(n|=3)),n}var Co=String.fromCharCode,wo={DEFAULT:e=>{let t=[So(e,!1)+32,e.col+32,e.row+32];return t[0]>255||t[1]>255||t[2]>255?``:`\x1B[M${Co(t[0])}${Co(t[1])}${Co(t[2])}`},SGR:e=>{let t=e.action===0&&e.button!==4?`m`:`M`;return`\x1B[<${So(e,!0)};${e.col};${e.row}${t}`},SGR_PIXELS:e=>{let t=e.action===0&&e.button!==4?`m`:`M`;return`\x1B[<${So(e,!0)};${e.x};${e.y}${t}`}},To=class extends A{constructor(e,t,n){super(),this._bufferService=e,this._coreService=t,this._optionsService=n,this._protocols={},this._encodings={},this._activeProtocol=``,this._activeEncoding=``,this._lastEvent=null,this._wheelPartialScroll=0,this._onProtocolChange=this._register(new N),this.onProtocolChange=this._onProtocolChange.event;for(let e of Object.keys(xo))this.addProtocol(e,xo[e]);for(let e of Object.keys(wo))this.addEncoding(e,wo[e]);this.reset()}addProtocol(e,t){this._protocols[e]=t}addEncoding(e,t){this._encodings[e]=t}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(e){if(!this._protocols[e])throw Error(`unknown protocol "${e}"`);this._activeProtocol=e,this._onProtocolChange.fire(this._protocols[e].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(e){if(!this._encodings[e])throw Error(`unknown encoding "${e}"`);this._activeEncoding=e}reset(){this.activeProtocol=`NONE`,this.activeEncoding=`DEFAULT`,this._lastEvent=null,this._wheelPartialScroll=0}consumeWheelEvent(e,t,n){if(e.deltaY===0||e.shiftKey||t===void 0||n===void 0)return 0;let r=t/n,i=this._applyScrollModifier(e.deltaY,e);return e.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(i/=r+0,Math.abs(e.deltaY)<50&&(i*=.3),this._wheelPartialScroll+=i,i=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):e.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(i*=this._bufferService.rows),i}_applyScrollModifier(e,t){return t.altKey||t.ctrlKey||t.shiftKey?e*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:e*this._optionsService.rawOptions.scrollSensitivity}triggerMouseEvent(e){if(e.col<0||e.col>=this._bufferService.cols||e.row<0||e.row>=this._bufferService.rows||e.button===4&&e.action===32||e.button===3&&e.action!==32||e.button!==4&&(e.action===2||e.action===3)||(e.col++,e.row++,e.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,e,this._activeEncoding===`SGR_PIXELS`))||!this._protocols[this._activeProtocol].restrict(e))return!1;let t=this._encodings[this._activeEncoding](e);return t&&(this._activeEncoding===`DEFAULT`?this._coreService.triggerBinaryEvent(t):this._coreService.triggerDataEvent(t,!0)),this._lastEvent=e,!0}explainEvents(e){return{down:!!(e&1),up:!!(e&2),drag:!!(e&4),move:!!(e&8),wheel:!!(e&16)}}_equalEvents(e,t,n){if(n){if(e.x!==t.x||e.y!==t.y)return!1}else if(e.col!==t.col||e.row!==t.row)return!1;return!(e.button!==t.button||e.action!==t.action||e.ctrl!==t.ctrl||e.alt!==t.alt||e.shift!==t.shift)}};To=y([b(0,E),b(1,D),b(2,O)],To);var Eo=[[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]],Do=[[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]],Z;function Oo(e,t){let n=0,r=t.length-1,i;if(et[r][1])return!1;for(;r>=n;)if(i=n+r>>1,e>t[i][1])n=i+1;else if(e=131072&&e<=196605||e>=196608&&e<=262141?2:1}charProperties(e,t){let n=this.wcwidth(e),r=n===0&&t!==0;if(r){let e=Ao.extractWidth(t);e===0?r=!1:e>n&&(n=e)}return Ao.createPropertyValue(0,n,r)}},Ao=class e{constructor(){this._providers=Object.create(null),this._active=``,this._onChange=new N,this.onChange=this._onChange.event;let e=new ko;this.register(e),this._active=e.version,this._activeProvider=e}static extractShouldJoin(e){return(e&1)!=0}static extractWidth(e){return e>>1&3}static extractCharKind(e){return e>>3}static createPropertyValue(e,t,n=!1){return(e&16777215)<<3|(t&3)<<1|!!n}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(e){if(!this._providers[e])throw Error(`unknown Unicode version "${e}"`);this._active=e,this._activeProvider=this._providers[e],this._onChange.fire(e)}register(e){this._providers[e.version]=e}wcwidth(e){return this._activeProvider.wcwidth(e)}getStringCellWidth(t){let n=0,r=0,i=t.length;for(let a=0;a=i)return n+this.wcwidth(o);let e=t.charCodeAt(a);56320<=e&&e<=57343?o=(o-55296)*1024+e-56320+65536:n+=this.wcwidth(e)}let s=this.charProperties(o,r),c=e.extractWidth(s);e.extractShouldJoin(s)&&(c-=e.extractWidth(r)),n+=c,r=s}return n}charProperties(e,t){return this._activeProvider.charProperties(e,t)}},jo=class{constructor(){this.glevel=0,this._charsets=[]}reset(){this.charset=void 0,this._charsets=[],this.glevel=0}setgLevel(e){this.glevel=e,this.charset=this._charsets[e]}setgCharset(e,t){this._charsets[e]=t,this.glevel===e&&(this.charset=t)}};function Mo(e){let t=e.buffer.lines.get(e.buffer.ybase+e.buffer.y-1)?.get(e.cols-1),n=e.buffer.lines.get(e.buffer.ybase+e.buffer.y);n&&t&&(n.isWrapped=t[3]!==0&&t[3]!==32)}var No=2147483647,Po=256,Fo=class e{constructor(e=32,t=32){if(this.maxLength=e,this.maxSubParamsLength=t,t>Po)throw Error(`maxSubParamsLength must not be greater than 256`);this.params=new Int32Array(e),this.length=0,this._subParams=new Int32Array(t),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(e),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}static fromArray(t){let n=new e;if(!t.length)return n;for(let e=+!!Array.isArray(t[0]);e>8,r=this._subParamsIdx[t]&255;r-n>0&&e.push(Array.prototype.slice.call(this._subParams,n,r))}return e}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(e){if(this._digitIsSub=!1,this.length>=this.maxLength){this._rejectDigits=!0;return}if(e<-1)throw Error(`values lesser than -1 are not allowed`);this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=e>No?No:e}addSubParam(e){if(this._digitIsSub=!0,this.length){if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength){this._rejectSubDigits=!0;return}if(e<-1)throw Error(`values lesser than -1 are not allowed`);this._subParams[this._subParamsLength++]=e>No?No:e,this._subParamsIdx[this.length-1]++}}hasSubParams(e){return(this._subParamsIdx[e]&255)-(this._subParamsIdx[e]>>8)>0}getSubParams(e){let t=this._subParamsIdx[e]>>8,n=this._subParamsIdx[e]&255;return n-t>0?this._subParams.subarray(t,n):null}getSubParamsAll(){let e={};for(let t=0;t>8,r=this._subParamsIdx[t]&255;r-n>0&&(e[t]=this._subParams.slice(n,r))}return e}addDigit(e){let t;if(this._rejectDigits||!(t=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;let n=this._digitIsSub?this._subParams:this.params,r=n[t-1];n[t-1]=~r?Math.min(r*10+e,No):e}},Io=[],Lo=class{constructor(){this._state=0,this._active=Io,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(e,t){this._handlers[e]===void 0&&(this._handlers[e]=[]);let n=this._handlers[e];return n.push(t),{dispose:()=>{let e=n.indexOf(t);e!==-1&&n.splice(e,1)}}}clearHandler(e){this._handlers[e]&&delete this._handlers[e]}setHandlerFallback(e){this._handlerFb=e}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=Io}reset(){if(this._state===2)for(let e=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;e>=0;--e)this._active[e].end(!1);this._stack.paused=!1,this._active=Io,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||Io,!this._active.length)this._handlerFb(this._id,`START`);else for(let e=this._active.length-1;e>=0;e--)this._active[e].start()}_put(e,t,n){if(!this._active.length)this._handlerFb(this._id,`PUT`,C(e,t,n));else for(let r=this._active.length-1;r>=0;r--)this._active[r].put(e,t,n)}start(){this.reset(),this._state=1}put(e,t,n){if(this._state!==3){if(this._state===1)for(;t0&&this._put(e,t,n)}}end(e,t=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),!this._active.length)this._handlerFb(this._id,`END`,e);else{let n=!1,r=this._active.length-1,i=!1;if(this._stack.paused&&(r=this._stack.loopPosition-1,n=t,i=this._stack.fallThrough,this._stack.paused=!1),!i&&n===!1){for(;r>=0&&(n=this._active[r].end(e),n!==!0);r--)if(n instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=r,this._stack.fallThrough=!1,n;r--}for(;r>=0;r--)if(n=this._active[r].end(!1),n instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=r,this._stack.fallThrough=!0,n}this._active=Io,this._id=-1,this._state=0}}},Ro=class{constructor(e){this._handler=e,this._data=``,this._hitLimit=!1}start(){this._data=``,this._hitLimit=!1}put(e,t,n){this._hitLimit||(this._data+=C(e,t,n),this._data.length>1e7&&(this._data=``,this._hitLimit=!0))}end(e){let t=!1;if(this._hitLimit)t=!1;else if(e&&(t=this._handler(this._data),t instanceof Promise))return t.then(e=>(this._data=``,this._hitLimit=!1,e));return this._data=``,this._hitLimit=!1,t}},zo=[],Bo=class{constructor(){this._handlers=Object.create(null),this._active=zo,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=zo}registerHandler(e,t){this._handlers[e]===void 0&&(this._handlers[e]=[]);let n=this._handlers[e];return n.push(t),{dispose:()=>{let e=n.indexOf(t);e!==-1&&n.splice(e,1)}}}clearHandler(e){this._handlers[e]&&delete this._handlers[e]}setHandlerFallback(e){this._handlerFb=e}reset(){if(this._active.length)for(let e=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;e>=0;--e)this._active[e].unhook(!1);this._stack.paused=!1,this._active=zo,this._ident=0}hook(e,t){if(this.reset(),this._ident=e,this._active=this._handlers[e]||zo,!this._active.length)this._handlerFb(this._ident,`HOOK`,t);else for(let e=this._active.length-1;e>=0;e--)this._active[e].hook(t)}put(e,t,n){if(!this._active.length)this._handlerFb(this._ident,`PUT`,C(e,t,n));else for(let r=this._active.length-1;r>=0;r--)this._active[r].put(e,t,n)}unhook(e,t=!0){if(!this._active.length)this._handlerFb(this._ident,`UNHOOK`,e);else{let n=!1,r=this._active.length-1,i=!1;if(this._stack.paused&&(r=this._stack.loopPosition-1,n=t,i=this._stack.fallThrough,this._stack.paused=!1),!i&&n===!1){for(;r>=0&&(n=this._active[r].unhook(e),n!==!0);r--)if(n instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=r,this._stack.fallThrough=!1,n;r--}for(;r>=0;r--)if(n=this._active[r].unhook(!1),n instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=r,this._stack.fallThrough=!0,n}this._active=zo,this._ident=0}},Vo=new Fo;Vo.addParam(0);var Ho=class{constructor(e){this._handler=e,this._data=``,this._params=Vo,this._hitLimit=!1}hook(e){this._params=e.length>1||e.params[0]?e.clone():Vo,this._data=``,this._hitLimit=!1}put(e,t,n){this._hitLimit||(this._data+=C(e,t,n),this._data.length>1e7&&(this._data=``,this._hitLimit=!0))}unhook(e){let t=!1;if(this._hitLimit)t=!1;else if(e&&(t=this._handler(this._data,this._params),t instanceof Promise))return t.then(e=>(this._params=Vo,this._data=``,this._hitLimit=!1,e));return this._params=Vo,this._data=``,this._hitLimit=!1,t}},Uo=class{constructor(e){this.table=new Uint8Array(e)}setDefault(e,t){this.table.fill(e<<4|t)}add(e,t,n,r){this.table[t<<8|e]=n<<4|r}addMany(e,t,n,r){for(let i=0;it),n=(e,n)=>t.slice(e,n),r=n(32,127),i=n(0,24);i.push(25),i.push.apply(i,n(28,32));let a=n(0,14),o;for(o in e.setDefault(1,0),e.addMany(r,0,2,0),a)e.addMany([24,26,153,154],o,3,0),e.addMany(n(128,144),o,3,0),e.addMany(n(144,152),o,3,0),e.add(156,o,0,0),e.add(27,o,11,1),e.add(157,o,4,8),e.addMany([152,158,159],o,0,7),e.add(155,o,11,3),e.add(144,o,11,9);return e.addMany(i,0,3,0),e.addMany(i,1,3,1),e.add(127,1,0,1),e.addMany(i,8,0,8),e.addMany(i,3,3,3),e.add(127,3,0,3),e.addMany(i,4,3,4),e.add(127,4,0,4),e.addMany(i,6,3,6),e.addMany(i,5,3,5),e.add(127,5,0,5),e.addMany(i,2,3,2),e.add(127,2,0,2),e.add(93,1,4,8),e.addMany(r,8,5,8),e.add(127,8,5,8),e.addMany([156,27,24,26,7],8,6,0),e.addMany(n(28,32),8,0,8),e.addMany([88,94,95],1,0,7),e.addMany(r,7,0,7),e.addMany(i,7,0,7),e.add(156,7,0,0),e.add(127,7,0,7),e.add(91,1,11,3),e.addMany(n(64,127),3,7,0),e.addMany(n(48,60),3,8,4),e.addMany([60,61,62,63],3,9,4),e.addMany(n(48,60),4,8,4),e.addMany(n(64,127),4,7,0),e.addMany([60,61,62,63],4,0,6),e.addMany(n(32,64),6,0,6),e.add(127,6,0,6),e.addMany(n(64,127),6,0,0),e.addMany(n(32,48),3,9,5),e.addMany(n(32,48),5,9,5),e.addMany(n(48,64),5,0,6),e.addMany(n(64,127),5,7,0),e.addMany(n(32,48),4,9,5),e.addMany(n(32,48),1,9,2),e.addMany(n(32,48),2,9,2),e.addMany(n(48,127),2,10,0),e.addMany(n(48,80),1,10,0),e.addMany(n(81,88),1,10,0),e.addMany([89,90,92],1,10,0),e.addMany(n(96,127),1,10,0),e.add(80,1,11,9),e.addMany(i,9,0,9),e.add(127,9,0,9),e.addMany(n(28,32),9,0,9),e.addMany(n(32,48),9,9,12),e.addMany(n(48,60),9,8,10),e.addMany([60,61,62,63],9,9,10),e.addMany(i,11,0,11),e.addMany(n(32,128),11,0,11),e.addMany(n(28,32),11,0,11),e.addMany(i,10,0,10),e.add(127,10,0,10),e.addMany(n(28,32),10,0,10),e.addMany(n(48,60),10,8,10),e.addMany([60,61,62,63],10,0,11),e.addMany(n(32,48),10,9,12),e.addMany(i,12,0,12),e.add(127,12,0,12),e.addMany(n(28,32),12,0,12),e.addMany(n(32,48),12,9,12),e.addMany(n(48,64),12,0,11),e.addMany(n(64,127),12,12,13),e.addMany(n(64,127),10,12,13),e.addMany(n(64,127),9,12,13),e.addMany(i,13,13,13),e.addMany(r,13,13,13),e.add(127,13,0,13),e.addMany([27,156,24,26],13,14,0),e.add(Wo,0,2,0),e.add(Wo,8,5,8),e.add(Wo,6,0,6),e.add(Wo,11,0,11),e.add(Wo,13,13,13),e}(),Ko=class extends A{constructor(e=Go){super(),this._transitions=e,this._parseStack={state:0,handlers:[],handlerPos:0,transition:0,chunkPos:0},this.initialState=0,this.currentState=this.initialState,this._params=new Fo,this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._printHandlerFb=(e,t,n)=>{},this._executeHandlerFb=e=>{},this._csiHandlerFb=(e,t)=>{},this._escHandlerFb=e=>{},this._errorHandlerFb=e=>e,this._printHandler=this._printHandlerFb,this._executeHandlers=Object.create(null),this._csiHandlers=Object.create(null),this._escHandlers=Object.create(null),this._register(k(()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)})),this._oscParser=this._register(new Lo),this._dcsParser=this._register(new Bo),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:`\\`},()=>!0)}_identifier(e,t=[64,126]){let n=0;if(e.prefix){if(e.prefix.length>1)throw Error(`only one byte as prefix supported`);if(n=e.prefix.charCodeAt(0),n&&60>n||n>63)throw Error(`prefix must be in range 0x3c .. 0x3f`)}if(e.intermediates){if(e.intermediates.length>2)throw Error(`only two bytes as intermediates are supported`);for(let t=0;tr||r>47)throw Error(`intermediate must be in range 0x20 .. 0x2f`);n<<=8,n|=r}}if(e.final.length!==1)throw Error(`final must be a single byte`);let r=e.final.charCodeAt(0);if(t[0]>r||r>t[1])throw Error(`final must be in range ${t[0]} .. ${t[1]}`);return n<<=8,n|=r,n}identToString(e){let t=[];for(;e;)t.push(String.fromCharCode(e&255)),e>>=8;return t.reverse().join(``)}setPrintHandler(e){this._printHandler=e}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(e,t){let n=this._identifier(e,[48,126]);this._escHandlers[n]===void 0&&(this._escHandlers[n]=[]);let r=this._escHandlers[n];return r.push(t),{dispose:()=>{let e=r.indexOf(t);e!==-1&&r.splice(e,1)}}}clearEscHandler(e){this._escHandlers[this._identifier(e,[48,126])]&&delete this._escHandlers[this._identifier(e,[48,126])]}setEscHandlerFallback(e){this._escHandlerFb=e}setExecuteHandler(e,t){this._executeHandlers[e.charCodeAt(0)]=t}clearExecuteHandler(e){this._executeHandlers[e.charCodeAt(0)]&&delete this._executeHandlers[e.charCodeAt(0)]}setExecuteHandlerFallback(e){this._executeHandlerFb=e}registerCsiHandler(e,t){let n=this._identifier(e);this._csiHandlers[n]===void 0&&(this._csiHandlers[n]=[]);let r=this._csiHandlers[n];return r.push(t),{dispose:()=>{let e=r.indexOf(t);e!==-1&&r.splice(e,1)}}}clearCsiHandler(e){this._csiHandlers[this._identifier(e)]&&delete this._csiHandlers[this._identifier(e)]}setCsiHandlerFallback(e){this._csiHandlerFb=e}registerDcsHandler(e,t){return this._dcsParser.registerHandler(this._identifier(e),t)}clearDcsHandler(e){this._dcsParser.clearHandler(this._identifier(e))}setDcsHandlerFallback(e){this._dcsParser.setHandlerFallback(e)}registerOscHandler(e,t){return this._oscParser.registerHandler(e,t)}clearOscHandler(e){this._oscParser.clearHandler(e)}setOscHandlerFallback(e){this._oscParser.setHandlerFallback(e)}setErrorHandler(e){this._errorHandler=e}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(e,t,n,r,i){this._parseStack.state=e,this._parseStack.handlers=t,this._parseStack.handlerPos=n,this._parseStack.transition=r,this._parseStack.chunkPos=i}parse(e,t,n){let r=0,i=0,a=0,o;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,a=this._parseStack.chunkPos+1;else{if(n===void 0||this._parseStack.state===1)throw this._parseStack.state=1,Error(`improper continuation due to previous async handler, giving up parsing`);let t=this._parseStack.handlers,i=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(n===!1&&i>-1){for(;i>=0&&(o=t[i](this._params),o!==!0);i--)if(o instanceof Promise)return this._parseStack.handlerPos=i,o}this._parseStack.handlers=[];break;case 4:if(n===!1&&i>-1){for(;i>=0&&(o=t[i](),o!==!0);i--)if(o instanceof Promise)return this._parseStack.handlerPos=i,o}this._parseStack.handlers=[];break;case 6:if(r=e[this._parseStack.chunkPos],o=this._dcsParser.unhook(r!==24&&r!==26,n),o)return o;r===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(r=e[this._parseStack.chunkPos],o=this._oscParser.end(r!==24&&r!==26,n),o)return o;r===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break}this._parseStack.state=0,a=this._parseStack.chunkPos+1,this.precedingJoinState=0,this.currentState=this._parseStack.transition&15}for(let n=a;n>4){case 2:for(let i=n+1;;++i){if(i>=t||(r=e[i])<32||r>126&&r=t||(r=e[i])<32||r>126&&r=t||(r=e[i])<32||r>126&&r=t||(r=e[i])<32||r>126&&r=0&&(o=a[s](this._params),o!==!0);s--)if(o instanceof Promise)return this._preserveStack(3,a,s,i,n),o;s<0&&this._csiHandlerFb(this._collect<<8|r,this._params),this.precedingJoinState=0;break;case 8:do switch(r){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(r-48)}while(++n47&&r<60);n--;break;case 9:this._collect<<=8,this._collect|=r;break;case 10:let c=this._escHandlers[this._collect<<8|r],l=c?c.length-1:-1;for(;l>=0&&(o=c[l](),o!==!0);l--)if(o instanceof Promise)return this._preserveStack(4,c,l,i,n),o;l<0&&this._escHandlerFb(this._collect<<8|r),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|r,this._params);break;case 13:for(let i=n+1;;++i)if(i>=t||(r=e[i])===24||r===26||r===27||r>127&&r=t||(r=e[i])<32||r>127&&r>4:i>>8}return n}}function Xo(e,t){let n=e.toString(16),r=n.length<2?`0`+n:n;switch(t){case 4:return n[0];case 8:return r;case 12:return(r+r).slice(0,3);default:return r+r}}function Zo(e,t=16){let[n,r,i]=e;return`rgb:${Xo(n,t)}/${Xo(r,t)}/${Xo(i,t)}`}var Qo={"(":0,")":1,"*":2,"+":3,"-":1,".":2},$o=131072,es=10;function ts(e,t){if(e>24)return t.setWinLines||!1;switch(e){case 1:return!!t.restoreWin;case 2:return!!t.minimizeWin;case 3:return!!t.setWinPosition;case 4:return!!t.setWinSizePixels;case 5:return!!t.raiseWin;case 6:return!!t.lowerWin;case 7:return!!t.refreshWin;case 8:return!!t.setWinSizeChars;case 9:return!!t.maximizeWin;case 10:return!!t.fullscreenWin;case 11:return!!t.getWinState;case 13:return!!t.getWinPosition;case 14:return!!t.getWinSizePixels;case 15:return!!t.getScreenSizePixels;case 16:return!!t.getCellSizePixels;case 18:return!!t.getWinSizeChars;case 19:return!!t.getScreenSizeChars;case 20:return!!t.getIconTitle;case 21:return!!t.getWinTitle;case 22:return!!t.pushTitle;case 23:return!!t.popTitle;case 24:return!!t.setWinLines}return!1}var ns=5e3,rs=0,is=class extends A{constructor(e,t,n,r,i,a,o,s,c=new Ko){super(),this._bufferService=e,this._charsetService=t,this._coreService=n,this._logService=r,this._optionsService=i,this._oscLinkService=a,this._coreMouseService=o,this._unicodeService=s,this._parser=c,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new ue,this._utf8Decoder=new de,this._windowTitle=``,this._iconName=``,this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=Y.clone(),this._eraseAttrDataInternal=Y.clone(),this._onRequestBell=this._register(new N),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this._register(new N),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this._register(new N),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this._register(new N),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this._register(new N),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this._register(new N),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this._register(new N),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this._register(new N),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this._register(new N),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this._register(new N),this.onLineFeed=this._onLineFeed.event,this._onScroll=this._register(new N),this.onScroll=this._onScroll.event,this._onTitleChange=this._register(new N),this.onTitleChange=this._onTitleChange.event,this._onColor=this._register(new N),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 as(this._bufferService),this._activeBuffer=this._bufferService.buffer,this._register(this._bufferService.buffers.onBufferActivate(e=>this._activeBuffer=e.activeBuffer)),this._parser.setCsiHandlerFallback((e,t)=>{this._logService.debug(`Unknown CSI code: `,{identifier:this._parser.identToString(e),params:t.toArray()})}),this._parser.setEscHandlerFallback(e=>{this._logService.debug(`Unknown ESC code: `,{identifier:this._parser.identToString(e)})}),this._parser.setExecuteHandlerFallback(e=>{this._logService.debug(`Unknown EXECUTE code: `,{code:e})}),this._parser.setOscHandlerFallback((e,t,n)=>{this._logService.debug(`Unknown OSC code: `,{identifier:e,action:t,data:n})}),this._parser.setDcsHandlerFallback((e,t,n)=>{t===`HOOK`&&(n=n.toArray()),this._logService.debug(`Unknown DCS code: `,{identifier:this._parser.identToString(e),action:t,payload:n})}),this._parser.setPrintHandler((e,t,n)=>this.print(e,t,n)),this._parser.registerCsiHandler({final:`@`},e=>this.insertChars(e)),this._parser.registerCsiHandler({intermediates:` `,final:`@`},e=>this.scrollLeft(e)),this._parser.registerCsiHandler({final:`A`},e=>this.cursorUp(e)),this._parser.registerCsiHandler({intermediates:` `,final:`A`},e=>this.scrollRight(e)),this._parser.registerCsiHandler({final:`B`},e=>this.cursorDown(e)),this._parser.registerCsiHandler({final:`C`},e=>this.cursorForward(e)),this._parser.registerCsiHandler({final:`D`},e=>this.cursorBackward(e)),this._parser.registerCsiHandler({final:`E`},e=>this.cursorNextLine(e)),this._parser.registerCsiHandler({final:`F`},e=>this.cursorPrecedingLine(e)),this._parser.registerCsiHandler({final:`G`},e=>this.cursorCharAbsolute(e)),this._parser.registerCsiHandler({final:`H`},e=>this.cursorPosition(e)),this._parser.registerCsiHandler({final:`I`},e=>this.cursorForwardTab(e)),this._parser.registerCsiHandler({final:`J`},e=>this.eraseInDisplay(e,!1)),this._parser.registerCsiHandler({prefix:`?`,final:`J`},e=>this.eraseInDisplay(e,!0)),this._parser.registerCsiHandler({final:`K`},e=>this.eraseInLine(e,!1)),this._parser.registerCsiHandler({prefix:`?`,final:`K`},e=>this.eraseInLine(e,!0)),this._parser.registerCsiHandler({final:`L`},e=>this.insertLines(e)),this._parser.registerCsiHandler({final:`M`},e=>this.deleteLines(e)),this._parser.registerCsiHandler({final:`P`},e=>this.deleteChars(e)),this._parser.registerCsiHandler({final:`S`},e=>this.scrollUp(e)),this._parser.registerCsiHandler({final:`T`},e=>this.scrollDown(e)),this._parser.registerCsiHandler({final:`X`},e=>this.eraseChars(e)),this._parser.registerCsiHandler({final:`Z`},e=>this.cursorBackwardTab(e)),this._parser.registerCsiHandler({final:"`"},e=>this.charPosAbsolute(e)),this._parser.registerCsiHandler({final:`a`},e=>this.hPositionRelative(e)),this._parser.registerCsiHandler({final:`b`},e=>this.repeatPrecedingCharacter(e)),this._parser.registerCsiHandler({final:`c`},e=>this.sendDeviceAttributesPrimary(e)),this._parser.registerCsiHandler({prefix:`>`,final:`c`},e=>this.sendDeviceAttributesSecondary(e)),this._parser.registerCsiHandler({final:`d`},e=>this.linePosAbsolute(e)),this._parser.registerCsiHandler({final:`e`},e=>this.vPositionRelative(e)),this._parser.registerCsiHandler({final:`f`},e=>this.hVPosition(e)),this._parser.registerCsiHandler({final:`g`},e=>this.tabClear(e)),this._parser.registerCsiHandler({final:`h`},e=>this.setMode(e)),this._parser.registerCsiHandler({prefix:`?`,final:`h`},e=>this.setModePrivate(e)),this._parser.registerCsiHandler({final:`l`},e=>this.resetMode(e)),this._parser.registerCsiHandler({prefix:`?`,final:`l`},e=>this.resetModePrivate(e)),this._parser.registerCsiHandler({final:`m`},e=>this.charAttributes(e)),this._parser.registerCsiHandler({final:`n`},e=>this.deviceStatus(e)),this._parser.registerCsiHandler({prefix:`?`,final:`n`},e=>this.deviceStatusPrivate(e)),this._parser.registerCsiHandler({intermediates:`!`,final:`p`},e=>this.softReset(e)),this._parser.registerCsiHandler({intermediates:` `,final:`q`},e=>this.setCursorStyle(e)),this._parser.registerCsiHandler({final:`r`},e=>this.setScrollRegion(e)),this._parser.registerCsiHandler({final:`s`},e=>this.saveCursor(e)),this._parser.registerCsiHandler({final:`t`},e=>this.windowOptions(e)),this._parser.registerCsiHandler({final:`u`},e=>this.restoreCursor(e)),this._parser.registerCsiHandler({intermediates:`'`,final:`}`},e=>this.insertColumns(e)),this._parser.registerCsiHandler({intermediates:`'`,final:`~`},e=>this.deleteColumns(e)),this._parser.registerCsiHandler({intermediates:`"`,final:`q`},e=>this.selectProtected(e)),this._parser.registerCsiHandler({intermediates:`$`,final:`p`},e=>this.requestMode(e,!0)),this._parser.registerCsiHandler({prefix:`?`,intermediates:`$`,final:`p`},e=>this.requestMode(e,!1)),this._parser.setExecuteHandler(L.BEL,()=>this.bell()),this._parser.setExecuteHandler(L.LF,()=>this.lineFeed()),this._parser.setExecuteHandler(L.VT,()=>this.lineFeed()),this._parser.setExecuteHandler(L.FF,()=>this.lineFeed()),this._parser.setExecuteHandler(L.CR,()=>this.carriageReturn()),this._parser.setExecuteHandler(L.BS,()=>this.backspace()),this._parser.setExecuteHandler(L.HT,()=>this.tab()),this._parser.setExecuteHandler(L.SO,()=>this.shiftOut()),this._parser.setExecuteHandler(L.SI,()=>this.shiftIn()),this._parser.setExecuteHandler(si.IND,()=>this.index()),this._parser.setExecuteHandler(si.NEL,()=>this.nextLine()),this._parser.setExecuteHandler(si.HTS,()=>this.tabSet()),this._parser.registerOscHandler(0,new Ro(e=>(this.setTitle(e),this.setIconName(e),!0))),this._parser.registerOscHandler(1,new Ro(e=>this.setIconName(e))),this._parser.registerOscHandler(2,new Ro(e=>this.setTitle(e))),this._parser.registerOscHandler(4,new Ro(e=>this.setOrReportIndexedColor(e))),this._parser.registerOscHandler(8,new Ro(e=>this.setHyperlink(e))),this._parser.registerOscHandler(10,new Ro(e=>this.setOrReportFgColor(e))),this._parser.registerOscHandler(11,new Ro(e=>this.setOrReportBgColor(e))),this._parser.registerOscHandler(12,new Ro(e=>this.setOrReportCursorColor(e))),this._parser.registerOscHandler(104,new Ro(e=>this.restoreIndexedColor(e))),this._parser.registerOscHandler(110,new Ro(e=>this.restoreFgColor(e))),this._parser.registerOscHandler(111,new Ro(e=>this.restoreBgColor(e))),this._parser.registerOscHandler(112,new Ro(e=>this.restoreCursorColor(e))),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(let e in X)this._parser.registerEscHandler({intermediates:`(`,final:e},()=>this.selectCharset(`(`+e)),this._parser.registerEscHandler({intermediates:`)`,final:e},()=>this.selectCharset(`)`+e)),this._parser.registerEscHandler({intermediates:`*`,final:e},()=>this.selectCharset(`*`+e)),this._parser.registerEscHandler({intermediates:`+`,final:e},()=>this.selectCharset(`+`+e)),this._parser.registerEscHandler({intermediates:`-`,final:e},()=>this.selectCharset(`-`+e)),this._parser.registerEscHandler({intermediates:`.`,final:e},()=>this.selectCharset(`.`+e)),this._parser.registerEscHandler({intermediates:`/`,final:e},()=>this.selectCharset(`/`+e));this._parser.registerEscHandler({intermediates:`#`,final:`8`},()=>this.screenAlignmentPattern()),this._parser.setErrorHandler(e=>(this._logService.error(`Parsing error: `,e),e)),this._parser.registerDcsHandler({intermediates:`$`,final:`q`},new Ho((e,t)=>this.requestStatusString(e,t)))}getAttrData(){return this._curAttrData}_preserveStack(e,t,n,r){this._parseStack.paused=!0,this._parseStack.cursorStartX=e,this._parseStack.cursorStartY=t,this._parseStack.decodedLength=n,this._parseStack.position=r}_logSlowResolvingAsync(e){this._logService.logLevel<=3&&Promise.race([e,new Promise((e,t)=>setTimeout(()=>t(`#SLOW_TIMEOUT`),ns))]).catch(e=>{if(e!==`#SLOW_TIMEOUT`)throw e;console.warn(`async parser handler taking longer than ${ns} ms`)})}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(e,t){let n,r=this._activeBuffer.x,i=this._activeBuffer.y,a=0,o=this._parseStack.paused;if(o){if(n=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,t))return this._logSlowResolvingAsync(n),n;r=this._parseStack.cursorStartX,i=this._parseStack.cursorStartY,this._parseStack.paused=!1,e.length>$o&&(a=this._parseStack.position+$o)}if(this._logService.logLevel<=1&&this._logService.debug(`parsing data ${typeof e==`string`?` "${e}"`:` "${Array.prototype.map.call(e,e=>String.fromCharCode(e)).join(``)}"`}`),this._logService.logLevel===0&&this._logService.trace(`parsing data (codes)`,typeof e==`string`?e.split(``).map(e=>e.charCodeAt(0)):e),this._parseBuffer.length$o)for(let t=a;t0&&d.getWidth(this._activeBuffer.x-1)===2&&d.setCellFromCodepoint(this._activeBuffer.x-1,0,1,u);let f=this._parser.precedingJoinState;for(let p=t;ps){if(c){let e=d,t=this._activeBuffer.x-m;for(this._activeBuffer.x=m,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),d=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),m>0&&d instanceof Za&&d.copyCellsFrom(e,t,0,m,!1);t=0;)d.setCellFromCodepoint(this._activeBuffer.x++,0,0,u);continue}if(l&&(d.insertCells(this._activeBuffer.x,i-m,this._activeBuffer.getNullCell(u)),d.getWidth(s-1)===2&&d.setCellFromCodepoint(s-1,0,1,u)),d.setCellFromCodepoint(this._activeBuffer.x++,r,i,u),i>0)for(;--i;)d.setCellFromCodepoint(this._activeBuffer.x++,0,0,u)}this._parser.precedingJoinState=f,this._activeBuffer.x0&&d.getWidth(this._activeBuffer.x)===0&&!d.hasContent(this._activeBuffer.x)&&d.setCellFromCodepoint(this._activeBuffer.x,0,1,u),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(e,t){return e.final===`t`&&!e.prefix&&!e.intermediates?this._parser.registerCsiHandler(e,e=>!ts(e.params[0],this._optionsService.rawOptions.windowOptions)||t(e)):this._parser.registerCsiHandler(e,t)}registerDcsHandler(e,t){return this._parser.registerDcsHandler(e,new Ho(t))}registerEscHandler(e,t){return this._parser.registerEscHandler(e,t)}registerOscHandler(e,t){return this._parser.registerOscHandler(e,new Ro(t))}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(){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&&this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y)?.isWrapped){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;let e=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);e.hasWidth(this._activeBuffer.x)&&!e.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let e=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-e),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(e=this._bufferService.cols-1){this._activeBuffer.x=Math.min(e,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(e,t){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=e,this._activeBuffer.y=this._activeBuffer.scrollTop+t):(this._activeBuffer.x=e,this._activeBuffer.y=t),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(e,t){this._restrictCursor(),this._setCursor(this._activeBuffer.x+e,this._activeBuffer.y+t)}cursorUp(e){let t=this._activeBuffer.y-this._activeBuffer.scrollTop;return t>=0?this._moveCursor(0,-Math.min(t,e.params[0]||1)):this._moveCursor(0,-(e.params[0]||1)),!0}cursorDown(e){let t=this._activeBuffer.scrollBottom-this._activeBuffer.y;return t>=0?this._moveCursor(0,Math.min(t,e.params[0]||1)):this._moveCursor(0,e.params[0]||1),!0}cursorForward(e){return this._moveCursor(e.params[0]||1,0),!0}cursorBackward(e){return this._moveCursor(-(e.params[0]||1),0),!0}cursorNextLine(e){return this.cursorDown(e),this._activeBuffer.x=0,!0}cursorPrecedingLine(e){return this.cursorUp(e),this._activeBuffer.x=0,!0}cursorCharAbsolute(e){return this._setCursor((e.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(e){return this._setCursor(e.length>=2?(e.params[1]||1)-1:0,(e.params[0]||1)-1),!0}charPosAbsolute(e){return this._setCursor((e.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(e){return this._moveCursor(e.params[0]||1,0),!0}linePosAbsolute(e){return this._setCursor(this._activeBuffer.x,(e.params[0]||1)-1),!0}vPositionRelative(e){return this._moveCursor(0,e.params[0]||1),!0}hVPosition(e){return this.cursorPosition(e),!0}tabClear(e){let t=e.params[0];return t===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:t===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(e){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let t=e.params[0]||1;for(;t--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(e){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let t=e.params[0]||1;for(;t--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(e){let t=e.params[0];return t===1&&(this._curAttrData.bg|=536870912),(t===2||t===0)&&(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(e,t,n,r=!1,i=!1){let a=this._activeBuffer.lines.get(this._activeBuffer.ybase+e);a.replaceCells(t,n,this._activeBuffer.getNullCell(this._eraseAttrData()),i),r&&(a.isWrapped=!1)}_resetBufferLine(e,t=!1){let n=this._activeBuffer.lines.get(this._activeBuffer.ybase+e);n&&(n.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),t),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+e),n.isWrapped=!1)}eraseInDisplay(e,t=!1){this._restrictCursor(this._bufferService.cols);let n;switch(e.params[0]){case 0:for(n=this._activeBuffer.y,this._dirtyRowTracker.markDirty(n),this._eraseInBufferLine(n++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,t);n=this._bufferService.cols&&(this._activeBuffer.lines.get(n+1).isWrapped=!1);n--;)this._resetBufferLine(n,t);this._dirtyRowTracker.markDirty(0);break;case 2:if(this._optionsService.rawOptions.scrollOnEraseInDisplay){for(n=this._bufferService.rows,this._dirtyRowTracker.markRangeDirty(0,n-1);n--&&!this._activeBuffer.lines.get(this._activeBuffer.ybase+n)?.getTrimmedLength(););for(;n>=0;n--)this._bufferService.scroll(this._eraseAttrData())}else{for(n=this._bufferService.rows,this._dirtyRowTracker.markDirty(n-1);n--;)this._resetBufferLine(n,t);this._dirtyRowTracker.markDirty(0)}break;case 3:let e=this._activeBuffer.lines.length-this._bufferService.rows;e>0&&(this._activeBuffer.lines.trimStart(e),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-e,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-e,0),this._onScroll.fire(0));break}return!0}eraseInLine(e,t=!1){switch(this._restrictCursor(this._bufferService.cols),e.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,t);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,t);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,t);break}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(e){this._restrictCursor();let t=e.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 c=s;for(let e=1;e0||(this._is(`xterm`)||this._is(`rxvt-unicode`)||this._is(`screen`)?this._coreService.triggerDataEvent(L.ESC+`[?1;2c`):this._is(`linux`)&&this._coreService.triggerDataEvent(L.ESC+`[?6c`)),!0}sendDeviceAttributesSecondary(e){return e.params[0]>0||(this._is(`xterm`)?this._coreService.triggerDataEvent(L.ESC+`[>0;276;0c`):this._is(`rxvt-unicode`)?this._coreService.triggerDataEvent(L.ESC+`[>85;95;0c`):this._is(`linux`)?this._coreService.triggerDataEvent(e.params[0]+`c`):this._is(`screen`)&&this._coreService.triggerDataEvent(L.ESC+`[>83;40003;0c`)),!0}_is(e){return(this._optionsService.rawOptions.termName+``).indexOf(e)===0}setMode(e){for(let t=0;t(e[e.NOT_RECOGNIZED=0]=`NOT_RECOGNIZED`,e[e.SET=1]=`SET`,e[e.RESET=2]=`RESET`,e[e.PERMANENTLY_SET=3]=`PERMANENTLY_SET`,e[e.PERMANENTLY_RESET=4]=`PERMANENTLY_RESET`))(n||={});let r=this._coreService.decPrivateModes,{activeProtocol:i,activeEncoding:a}=this._coreMouseService,o=this._coreService,{buffers:s,cols:c}=this._bufferService,{active:l,alt:u}=s,d=this._optionsService.rawOptions,f=(e,n)=>(o.triggerDataEvent(`${L.ESC}[${t?``:`?`}${e};${n}$y`),!0),p=e=>e?1:2,m=e.params[0];return t?m===2?f(m,4):m===4?f(m,p(o.modes.insertMode)):m===12?f(m,3):m===20?f(m,p(d.convertEol)):f(m,0):m===1?f(m,p(r.applicationCursorKeys)):m===3?f(m,d.windowOptions.setWinLines?c===80?2:+(c===132):0):m===6?f(m,p(r.origin)):m===7?f(m,p(r.wraparound)):m===8?f(m,3):m===9?f(m,p(i===`X10`)):m===12?f(m,p(d.cursorBlink)):m===25?f(m,p(!o.isCursorHidden)):m===45?f(m,p(r.reverseWraparound)):m===66?f(m,p(r.applicationKeypad)):m===67?f(m,4):m===1e3?f(m,p(i===`VT200`)):m===1002?f(m,p(i===`DRAG`)):m===1003?f(m,p(i===`ANY`)):m===1004?f(m,p(r.sendFocus)):m===1005?f(m,4):m===1006?f(m,p(a===`SGR`)):m===1015?f(m,4):m===1016?f(m,p(a===`SGR_PIXELS`)):m===1048?f(m,1):m===47||m===1047||m===1049?f(m,p(l===u)):m===2004?f(m,p(r.bracketedPasteMode)):m===2026?f(m,p(r.synchronizedOutput)):f(m,0)}_updateAttrColor(e,t,n,r,i){return t===2?(e|=50331648,e&=-16777216,e|=me.fromColorRGB([n,r,i])):t===5&&(e&=-50331904,e|=33554432|n&255),e}_extractColor(e,t,n){let r=[0,0,-1,0,0,0],i=0,a=0;do{if(r[a+i]=e.params[t+a],e.hasSubParams(t+a)){let n=e.getSubParams(t+a),o=0;do r[1]===5&&(i=1),r[a+o+1+i]=n[o];while(++o=2||r[1]===2&&a+i>=5)break;r[1]&&(i=1)}while(++a+t5)&&(e=1),t.extended.underlineStyle=e,t.fg|=268435456,e===0&&(t.fg&=-268435457),t.updateExtended()}_processSGR0(e){e.fg=Y.fg,e.bg=Y.bg,e.extended=e.extended.clone(),e.extended.underlineStyle=0,e.extended.underlineColor&=-67108864,e.updateExtended()}charAttributes(e){if(e.length===1&&e.params[0]===0)return this._processSGR0(this._curAttrData),!0;let t=e.length,n,r=this._curAttrData;for(let i=0;i=30&&n<=37?(r.fg&=-50331904,r.fg|=16777216|n-30):n>=40&&n<=47?(r.bg&=-50331904,r.bg|=16777216|n-40):n>=90&&n<=97?(r.fg&=-50331904,r.fg|=n-90|16777224):n>=100&&n<=107?(r.bg&=-50331904,r.bg|=n-100|16777224):n===0?this._processSGR0(r):n===1?r.fg|=134217728:n===3?r.bg|=67108864:n===4?(r.fg|=268435456,this._processUnderline(e.hasSubParams(i)?e.getSubParams(i)[0]:1,r)):n===5?r.fg|=536870912:n===7?r.fg|=67108864:n===8?r.fg|=1073741824:n===9?r.fg|=2147483648:n===2?r.bg|=134217728:n===21?this._processUnderline(2,r):n===22?(r.fg&=-134217729,r.bg&=-134217729):n===23?r.bg&=-67108865:n===24?(r.fg&=-268435457,this._processUnderline(0,r)):n===25?r.fg&=-536870913:n===27?r.fg&=-67108865:n===28?r.fg&=-1073741825:n===29?r.fg&=2147483647:n===39?(r.fg&=-67108864,r.fg|=Y.fg&16777215):n===49?(r.bg&=-67108864,r.bg|=Y.bg&16777215):n===38||n===48||n===58?i+=this._extractColor(e,i,r):n===53?r.bg|=1073741824:n===55?r.bg&=-1073741825:n===59?(r.extended=r.extended.clone(),r.extended.underlineColor=-1,r.updateExtended()):n===100?(r.fg&=-67108864,r.fg|=Y.fg&16777215,r.bg&=-67108864,r.bg|=Y.bg&16777215):this._logService.debug(`Unknown SGR attribute: %d.`,n);return!0}deviceStatus(e){switch(e.params[0]){case 5:this._coreService.triggerDataEvent(`${L.ESC}[0n`);break;case 6:let e=this._activeBuffer.y+1,t=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${L.ESC}[${e};${t}R`);break}return!0}deviceStatusPrivate(e){switch(e.params[0]){case 6:let e=this._activeBuffer.y+1,t=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${L.ESC}[?${e};${t}R`);break;case 15:break;case 25:break;case 26:break;case 53:break}return!0}softReset(e){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=Y.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(e){let t=e.length===0?1:e.params[0];if(t===0)this._coreService.decPrivateModes.cursorStyle=void 0,this._coreService.decPrivateModes.cursorBlink=void 0;else{switch(t){case 1:case 2:this._coreService.decPrivateModes.cursorStyle=`block`;break;case 3:case 4:this._coreService.decPrivateModes.cursorStyle=`underline`;break;case 5:case 6:this._coreService.decPrivateModes.cursorStyle=`bar`;break}let e=t%2==1;this._coreService.decPrivateModes.cursorBlink=e}return!0}setScrollRegion(e){let t=e.params[0]||1,n;return(e.length<2||(n=e.params[1])>this._bufferService.rows||n===0)&&(n=this._bufferService.rows),n>t&&(this._activeBuffer.scrollTop=t-1,this._activeBuffer.scrollBottom=n-1,this._setCursor(0,0)),!0}windowOptions(e){if(!ts(e.params[0],this._optionsService.rawOptions.windowOptions))return!0;let t=e.length>1?e.params[1]:0;switch(e.params[0]){case 14:t!==2&&this._onRequestWindowsOptionsReport.fire(0);break;case 16:this._onRequestWindowsOptionsReport.fire(1);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${L.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:(t===0||t===2)&&(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>es&&this._windowTitleStack.shift()),(t===0||t===1)&&(this._iconNameStack.push(this._iconName),this._iconNameStack.length>es&&this._iconNameStack.shift());break;case 23:(t===0||t===2)&&this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),(t===0||t===1)&&this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop());break}return!0}saveCursor(e){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(e){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(e){return this._windowTitle=e,this._onTitleChange.fire(e),!0}setIconName(e){return this._iconName=e,!0}setOrReportIndexedColor(e){let t=[],n=e.split(`;`);for(;n.length>1;){let e=n.shift(),r=n.shift();if(/^\d+$/.exec(e)){let n=parseInt(e);if(os(n))if(r===`?`)t.push({type:0,index:n});else{let e=Yo(r);e&&t.push({type:1,index:n,color:e})}}}return t.length&&this._onColor.fire(t),!0}setHyperlink(e){let t=e.indexOf(`;`);if(t===-1)return!0;let n=e.slice(0,t).trim(),r=e.slice(t+1);return r?this._createHyperlink(n,r):!n.trim()&&this._finishHyperlink()}_createHyperlink(e,t){this._getCurrentLinkId()&&this._finishHyperlink();let n=e.split(`:`),r,i=n.findIndex(e=>e.startsWith(`id=`));return i!==-1&&(r=n[i].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:r,uri:t}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(e,t){let n=e.split(`;`);for(let e=0;e=this._specialColors.length);++e,++t)if(n[e]===`?`)this._onColor.fire([{type:0,index:this._specialColors[t]}]);else{let r=Yo(n[e]);r&&this._onColor.fire([{type:1,index:this._specialColors[t],color:r}])}return!0}setOrReportFgColor(e){return this._setOrReportSpecialColor(e,0)}setOrReportBgColor(e){return this._setOrReportSpecialColor(e,1)}setOrReportCursorColor(e){return this._setOrReportSpecialColor(e,2)}restoreIndexedColor(e){if(!e)return this._onColor.fire([{type:2}]),!0;let t=[],n=e.split(`;`);for(let e=0;e=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){let e=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,e,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=Y.clone(),this._eraseAttrDataInternal=Y.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=this._curAttrData.bg&67108863,this._eraseAttrDataInternal}setgLevel(e){return this._charsetService.setgLevel(e),!0}screenAlignmentPattern(){let e=new w;e.content=4194373,e.fg=this._curAttrData.fg,e.bg=this._curAttrData.bg,this._setCursor(0,0);for(let t=0;t(this._coreService.triggerDataEvent(`${L.ESC}${e}${L.ESC}\\`),!0),r=this._bufferService.buffer,i=this._optionsService.rawOptions;return n(e===`"q`?`P1$r${+!!this._curAttrData.isProtected()}"q`:e===`"p`?`P1$r61;1"p`:e===`r`?`P1$r${r.scrollTop+1};${r.scrollBottom+1}r`:e===`m`?`P1$r0m`:e===` q`?`P1$r${{block:2,underline:4,bar:6}[i.cursorStyle]-+!!i.cursorBlink} q`:`P0$r`)}markRangeDirty(e,t){this._dirtyRowTracker.markRangeDirty(e,t)}},as=class{constructor(e){this._bufferService=e,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(e){ethis.end&&(this.end=e)}markRangeDirty(e,t){e>t&&(rs=e,e=t,t=rs),ethis.end&&(this.end=t)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};as=y([b(0,E)],as);function os(e){return 0<=e&&e<256}var ss=5e7,cs=12,ls=50,us=class extends A{constructor(e){super(),this._action=e,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0,this._didUserInput=!1,this._onWriteParsed=this._register(new N),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(e,t){if(t!==void 0&&this._syncCalls>t){this._syncCalls=0;return}if(this._pendingData+=e.length,this._writeBuffer.push(e),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;this._isSyncWriting=!0;let n;for(;n=this._writeBuffer.shift();){this._action(n);let e=this._callbacks.shift();e&&e()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(e,t){if(this._pendingData>ss)throw Error(`write data discarded, use flow control to avoid losing data`);if(!this._writeBuffer.length){if(this._bufferOffset=0,this._didUserInput){this._didUserInput=!1,this._pendingData+=e.length,this._writeBuffer.push(e),this._callbacks.push(t),this._innerWrite();return}setTimeout(()=>this._innerWrite())}this._pendingData+=e.length,this._writeBuffer.push(e),this._callbacks.push(t)}_innerWrite(e=0,t=!0){let n=e||performance.now();for(;this._writeBuffer.length>this._bufferOffset;){let e=this._writeBuffer[this._bufferOffset],r=this._action(e,t);if(r){r.catch(e=>(queueMicrotask(()=>{throw e}),Promise.resolve(!1))).then(e=>performance.now()-n>=cs?setTimeout(()=>this._innerWrite(0,e)):this._innerWrite(n,e));return}let i=this._callbacks[this._bufferOffset];if(i&&i(),this._bufferOffset++,this._pendingData-=e.length,performance.now()-n>=cs)break}this._writeBuffer.length>this._bufferOffset?(this._bufferOffset>ls&&(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()}},ds=class{constructor(e){this._bufferService=e,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(e){let t=this._bufferService.buffer;if(e.id===void 0){let n=t.addMarker(t.ybase+t.y),r={data:e,id:this._nextId++,lines:[n]};return n.onDispose(()=>this._removeMarkerFromLink(r,n)),this._dataByLinkId.set(r.id,r),r.id}let n=e,r=this._getEntryIdKey(n),i=this._entriesWithId.get(r);if(i)return this.addLineToLink(i.id,t.ybase+t.y),i.id;let a=t.addMarker(t.ybase+t.y),o={id:this._nextId++,key:this._getEntryIdKey(n),data:n,lines:[a]};return a.onDispose(()=>this._removeMarkerFromLink(o,a)),this._entriesWithId.set(o.key,o),this._dataByLinkId.set(o.id,o),o.id}addLineToLink(e,t){let n=this._dataByLinkId.get(e);if(n&&n.lines.every(e=>e.line!==t)){let e=this._bufferService.buffer.addMarker(t);n.lines.push(e),e.onDispose(()=>this._removeMarkerFromLink(n,e))}}getLinkData(e){return this._dataByLinkId.get(e)?.data}_getEntryIdKey(e){return`${e.id};;${e.uri}`}_removeMarkerFromLink(e,t){let n=e.lines.indexOf(t);n!==-1&&(e.lines.splice(n,1),e.lines.length===0&&(e.data.id!==void 0&&this._entriesWithId.delete(e.key),this._dataByLinkId.delete(e.id)))}};ds=y([b(0,E)],ds);var fs=!1,ps=class extends A{constructor(e){super(),this._windowsWrappingHeuristics=this._register(new pt),this._onBinary=this._register(new N),this.onBinary=this._onBinary.event,this._onData=this._register(new N),this.onData=this._onData.event,this._onLineFeed=this._register(new N),this.onLineFeed=this._onLineFeed.event,this._onResize=this._register(new N),this.onResize=this._onResize.event,this._onWriteParsed=this._register(new N),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this._register(new N),this._instantiationService=new Ua,this.optionsService=this._register(new ho(e)),this._instantiationService.setService(O,this.optionsService),this._bufferService=this._register(this._instantiationService.createInstance(fo)),this._instantiationService.setService(E,this._bufferService),this._logService=this._register(this._instantiationService.createInstance(Ka)),this._instantiationService.setService(we,this._logService),this.coreService=this._register(this._instantiationService.createInstance(bo)),this._instantiationService.setService(D,this.coreService),this.coreMouseService=this._register(this._instantiationService.createInstance(To)),this._instantiationService.setService(xe,this.coreMouseService),this.unicodeService=this._register(this._instantiationService.createInstance(Ao)),this._instantiationService.setService(Ee,this.unicodeService),this._charsetService=this._instantiationService.createInstance(jo),this._instantiationService.setService(Se,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(ds),this._instantiationService.setService(Te,this._oscLinkService),this._inputHandler=this._register(new is(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this._register(M.forward(this._inputHandler.onLineFeed,this._onLineFeed)),this._register(this._inputHandler),this._register(M.forward(this._bufferService.onResize,this._onResize)),this._register(M.forward(this.coreService.onData,this._onData)),this._register(M.forward(this.coreService.onBinary,this._onBinary)),this._register(this.coreService.onRequestScrollToBottom(()=>this.scrollToBottom(!0))),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}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)})),this._writeBuffer=this._register(new us((e,t)=>this._inputHandler.parse(e,t))),this._register(M.forward(this._writeBuffer.onWriteParsed,this._onWriteParsed))}get onScroll(){return this._onScrollApi||(this._onScrollApi=this._register(new N),this._onScroll.event(e=>{this._onScrollApi?.fire(e.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(e){for(let t in e)this.optionsService.options[t]=e[t]}write(e,t){this._writeBuffer.write(e,t)}writeSync(e,t){this._logService.logLevel<=3&&!fs&&(this._logService.warn(`writeSync is unreliable and will be removed soon.`),fs=!0),this._writeBuffer.writeSync(e,t)}input(e,t=!0){this.coreService.triggerDataEvent(e,t)}resize(e,t){isNaN(e)||isNaN(t)||(e=Math.max(e,lo),t=Math.max(t,uo),this._bufferService.resize(e,t))}scroll(e,t=!1){this._bufferService.scroll(e,t)}scrollLines(e,t){this._bufferService.scrollLines(e,t)}scrollPages(e){this.scrollLines(e*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(e){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(e){let t=e-this._bufferService.buffer.ydisp;t!==0&&this.scrollLines(t)}registerEscHandler(e,t){return this._inputHandler.registerEscHandler(e,t)}registerDcsHandler(e,t){return this._inputHandler.registerDcsHandler(e,t)}registerCsiHandler(e,t){return this._inputHandler.registerCsiHandler(e,t)}registerOscHandler(e,t){return this._inputHandler.registerOscHandler(e,t)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let e=!1,t=this.optionsService.rawOptions.windowsPty;t&&t.buildNumber!==void 0&&t.buildNumber!==void 0?e=t.backend===`conpty`&&t.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(e=!0),e?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){let e=[];e.push(this.onLineFeed(Mo.bind(null,this._bufferService))),e.push(this.registerCsiHandler({final:`H`},()=>(Mo(this._bufferService),!1))),this._windowsWrappingHeuristics.value=k(()=>{for(let t of e)t.dispose()})}}},ms={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:[`'`,`"`]};function hs(e,t,n,r){let i={type:0,cancel:!1,key:void 0},a=!!e.shiftKey|(e.altKey?2:0)|(e.ctrlKey?4:0)|(e.metaKey?8:0);switch(e.keyCode){case 0:e.key===`UIKeyInputUpArrow`?t?i.key=L.ESC+`OA`:i.key=L.ESC+`[A`:e.key===`UIKeyInputLeftArrow`?t?i.key=L.ESC+`OD`:i.key=L.ESC+`[D`:e.key===`UIKeyInputRightArrow`?t?i.key=L.ESC+`OC`:i.key=L.ESC+`[C`:e.key===`UIKeyInputDownArrow`&&(t?i.key=L.ESC+`OB`:i.key=L.ESC+`[B`);break;case 8:i.key=e.ctrlKey?`\b`:L.DEL,e.altKey&&(i.key=L.ESC+i.key);break;case 9:if(e.shiftKey){i.key=L.ESC+`[Z`;break}i.key=L.HT,i.cancel=!0;break;case 13:i.key=e.altKey?L.ESC+L.CR:L.CR,i.cancel=!0;break;case 27:i.key=L.ESC,e.altKey&&(i.key=L.ESC+L.ESC),i.cancel=!0;break;case 37:if(e.metaKey)break;a?i.key=L.ESC+`[1;`+(a+1)+`D`:t?i.key=L.ESC+`OD`:i.key=L.ESC+`[D`;break;case 39:if(e.metaKey)break;a?i.key=L.ESC+`[1;`+(a+1)+`C`:t?i.key=L.ESC+`OC`:i.key=L.ESC+`[C`;break;case 38:if(e.metaKey)break;a?i.key=L.ESC+`[1;`+(a+1)+`A`:t?i.key=L.ESC+`OA`:i.key=L.ESC+`[A`;break;case 40:if(e.metaKey)break;a?i.key=L.ESC+`[1;`+(a+1)+`B`:t?i.key=L.ESC+`OB`:i.key=L.ESC+`[B`;break;case 45:!e.shiftKey&&!e.ctrlKey&&(i.key=L.ESC+`[2~`);break;case 46:a?i.key=L.ESC+`[3;`+(a+1)+`~`:i.key=L.ESC+`[3~`;break;case 36:a?i.key=L.ESC+`[1;`+(a+1)+`H`:t?i.key=L.ESC+`OH`:i.key=L.ESC+`[H`;break;case 35:a?i.key=L.ESC+`[1;`+(a+1)+`F`:t?i.key=L.ESC+`OF`:i.key=L.ESC+`[F`;break;case 33:e.shiftKey?i.type=2:e.ctrlKey?i.key=L.ESC+`[5;`+(a+1)+`~`:i.key=L.ESC+`[5~`;break;case 34:e.shiftKey?i.type=3:e.ctrlKey?i.key=L.ESC+`[6;`+(a+1)+`~`:i.key=L.ESC+`[6~`;break;case 112:a?i.key=L.ESC+`[1;`+(a+1)+`P`:i.key=L.ESC+`OP`;break;case 113:a?i.key=L.ESC+`[1;`+(a+1)+`Q`:i.key=L.ESC+`OQ`;break;case 114:a?i.key=L.ESC+`[1;`+(a+1)+`R`:i.key=L.ESC+`OR`;break;case 115:a?i.key=L.ESC+`[1;`+(a+1)+`S`:i.key=L.ESC+`OS`;break;case 116:a?i.key=L.ESC+`[15;`+(a+1)+`~`:i.key=L.ESC+`[15~`;break;case 117:a?i.key=L.ESC+`[17;`+(a+1)+`~`:i.key=L.ESC+`[17~`;break;case 118:a?i.key=L.ESC+`[18;`+(a+1)+`~`:i.key=L.ESC+`[18~`;break;case 119:a?i.key=L.ESC+`[19;`+(a+1)+`~`:i.key=L.ESC+`[19~`;break;case 120:a?i.key=L.ESC+`[20;`+(a+1)+`~`:i.key=L.ESC+`[20~`;break;case 121:a?i.key=L.ESC+`[21;`+(a+1)+`~`:i.key=L.ESC+`[21~`;break;case 122:a?i.key=L.ESC+`[23;`+(a+1)+`~`:i.key=L.ESC+`[23~`;break;case 123:a?i.key=L.ESC+`[24;`+(a+1)+`~`:i.key=L.ESC+`[24~`;break;default:if(e.ctrlKey&&!e.shiftKey&&!e.altKey&&!e.metaKey)e.keyCode>=65&&e.keyCode<=90?i.key=String.fromCharCode(e.keyCode-64):e.keyCode===32?i.key=L.NUL:e.keyCode>=51&&e.keyCode<=55?i.key=String.fromCharCode(e.keyCode-51+27):e.keyCode===56?i.key=L.DEL:e.keyCode===219?i.key=L.ESC:e.keyCode===220?i.key=L.FS:e.keyCode===221&&(i.key=L.GS);else if((!n||r)&&e.altKey&&!e.metaKey){let t=ms[e.keyCode]?.[+!!e.shiftKey];if(t)i.key=L.ESC+t;else if(e.keyCode>=65&&e.keyCode<=90){let t=e.ctrlKey?e.keyCode-64:e.keyCode+32,n=String.fromCharCode(t);e.shiftKey&&(n=n.toUpperCase()),i.key=L.ESC+n}else if(e.keyCode===32)i.key=L.ESC+(e.ctrlKey?L.NUL:` `);else if(e.key===`Dead`&&e.code.startsWith(`Key`)){let t=e.code.slice(3,4);e.shiftKey||(t=t.toLowerCase()),i.key=L.ESC+t,i.cancel=!0}}else n&&!e.altKey&&!e.ctrlKey&&!e.shiftKey&&e.metaKey?e.keyCode===65&&(i.type=1):e.key&&!e.ctrlKey&&!e.altKey&&!e.metaKey&&e.keyCode>=48&&e.key.length===1?i.key=e.key:e.key&&e.ctrlKey&&(e.key===`_`&&(i.key=L.US),e.key===`@`&&(i.key=L.NUL));break}return i}var Q=0,gs=class{constructor(e){this._getKey=e,this._array=[],this._insertedValues=[],this._flushInsertedTask=new ca,this._isFlushingInserted=!1,this._deletedIndices=[],this._flushDeletedTask=new ca,this._isFlushingDeleted=!1}clear(){this._array.length=0,this._insertedValues.length=0,this._flushInsertedTask.clear(),this._isFlushingInserted=!1,this._deletedIndices.length=0,this._flushDeletedTask.clear(),this._isFlushingDeleted=!1}insert(e){this._flushCleanupDeleted(),this._insertedValues.length===0&&this._flushInsertedTask.enqueue(()=>this._flushInserted()),this._insertedValues.push(e)}_flushInserted(){let e=this._insertedValues.sort((e,t)=>this._getKey(e)-this._getKey(t)),t=0,n=0,r=Array(this._array.length+this._insertedValues.length);for(let i=0;i=this._array.length||this._getKey(e[t])<=this._getKey(this._array[n])?(r[i]=e[t],t++):r[i]=this._array[n++];this._array=r,this._insertedValues.length=0}_flushCleanupInserted(){!this._isFlushingInserted&&this._insertedValues.length>0&&this._flushInsertedTask.flush()}delete(e){if(this._flushCleanupInserted(),this._array.length===0)return!1;let t=this._getKey(e);if(t===void 0||(Q=this._search(t),Q===-1)||this._getKey(this._array[Q])!==t)return!1;do if(this._array[Q]===e)return this._deletedIndices.length===0&&this._flushDeletedTask.enqueue(()=>this._flushDeleted()),this._deletedIndices.push(Q),!0;while(++Qe-t),t=0,n=Array(this._array.length-e.length),r=0;for(let i=0;i0&&this._flushDeletedTask.flush()}*getKeyIterator(e){if(this._flushCleanupInserted(),this._flushCleanupDeleted(),this._array.length!==0&&(Q=this._search(e),!(Q<0||Q>=this._array.length)&&this._getKey(this._array[Q])===e))do yield this._array[Q];while(++Q=this._array.length)&&this._getKey(this._array[Q])===e))do t(this._array[Q]);while(++Q=t;){let r=t+n>>1,i=this._getKey(this._array[r]);if(i>e)n=r-1;else if(i0&&this._getKey(this._array[r-1])===e;)r--;return r}}return t}},_s=0,vs=0,ys=class extends A{constructor(){super(),this._decorations=new gs(e=>e?.marker.line),this._onDecorationRegistered=this._register(new N),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this._register(new N),this.onDecorationRemoved=this._onDecorationRemoved.event,this._register(k(()=>this.reset()))}get decorations(){return this._decorations.values()}registerDecoration(e){if(e.marker.isDisposed)return;let t=new bs(e);if(t){let e=t.marker.onDispose(()=>t.dispose()),n=t.onDispose(()=>{n.dispose(),t&&(this._decorations.delete(t)&&this._onDecorationRemoved.fire(t),e.dispose())});this._decorations.insert(t),this._onDecorationRegistered.fire(t)}return t}reset(){for(let e of this._decorations.values())e.dispose();this._decorations.clear()}*getDecorationsAtCell(e,t,n){let r=0,i=0;for(let a of this._decorations.getKeyIterator(t))r=a.options.x??0,i=r+(a.options.width??1),e>=r&&e{_s=t.options.x??0,vs=_s+(t.options.width??1),e>=_s&&e=this._debounceThresholdMS)this._lastRefreshMs=r,this._innerRefresh();else if(!this._additionalRefreshRequested){let e=r-this._lastRefreshMs,t=this._debounceThresholdMS-e;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout(()=>{this._lastRefreshMs=performance.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0},t)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;let e=Math.max(this._rowStart,0),t=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(e,t)}},Cs=20,ws=class extends A{constructor(e,t,n,r){super(),this._terminal=e,this._coreBrowserService=n,this._renderService=r,this._rowColumns=new WeakMap,this._liveRegionLineCount=0,this._charsToConsume=[],this._charsToAnnounce=``;let i=this._coreBrowserService.mainDocument;this._accessibilityContainer=i.createElement(`div`),this._accessibilityContainer.classList.add(`xterm-accessibility`),this._rowContainer=i.createElement(`div`),this._rowContainer.setAttribute(`role`,`list`),this._rowContainer.classList.add(`xterm-accessibility-tree`),this._rowElements=[];for(let e=0;ethis._handleBoundaryFocus(e,0),this._bottomBoundaryFocusListener=e=>this._handleBoundaryFocus(e,1),this._rowElements[0].addEventListener(`focus`,this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener(`focus`,this._bottomBoundaryFocusListener),this._accessibilityContainer.appendChild(this._rowContainer),this._liveRegion=i.createElement(`div`),this._liveRegion.classList.add(`live-region`),this._liveRegion.setAttribute(`aria-live`,`assertive`),this._accessibilityContainer.appendChild(this._liveRegion),this._liveRegionDebouncer=this._register(new Ss(this._renderRows.bind(this))),!this._terminal.element)throw Error(`Cannot enable accessibility before Terminal.open`);this._terminal.element.insertAdjacentElement(`afterbegin`,this._accessibilityContainer),this._register(this._terminal.onResize(e=>this._handleResize(e.rows))),this._register(this._terminal.onRender(e=>this._refreshRows(e.start,e.end))),this._register(this._terminal.onScroll(()=>this._refreshRows())),this._register(this._terminal.onA11yChar(e=>this._handleChar(e))),this._register(this._terminal.onLineFeed(()=>this._handleChar(` +`))),this._register(this._terminal.onA11yTab(e=>this._handleTab(e))),this._register(this._terminal.onKey(e=>this._handleKey(e.key))),this._register(this._terminal.onBlur(()=>this._clearLiveRegion())),this._register(this._renderService.onDimensionsChange(()=>this._refreshRowsDimensions())),this._register(P(i,`selectionchange`,()=>this._handleSelectionChange())),this._register(this._coreBrowserService.onDprChange(()=>this._refreshRowsDimensions())),this._refreshRowsDimensions(),this._refreshRows(),this._register(k(()=>{this._accessibilityContainer.remove(),this._rowElements.length=0}))}_handleTab(e){for(let t=0;t0?this._charsToConsume.shift()!==e&&(this._charsToAnnounce+=e):this._charsToAnnounce+=e,e===` +`&&(this._liveRegionLineCount++,this._liveRegionLineCount===Cs+1&&(this._liveRegion.textContent+=re.get())))}_clearLiveRegion(){this._liveRegion.textContent=``,this._liveRegionLineCount=0}_handleKey(e){this._clearLiveRegion(),/\p{Control}/u.test(e)||this._charsToConsume.push(e)}_refreshRows(e,t){this._liveRegionDebouncer.refresh(e,t,this._terminal.rows)}_renderRows(e,t){let n=this._terminal.buffer,r=n.lines.length.toString();for(let i=e;i<=t;i++){let e=n.lines.get(n.ydisp+i),t=[],a=e?.translateToString(!0,void 0,void 0,t)||``,o=(n.ydisp+i+1).toString(),s=this._rowElements[i];s&&(a.length===0?(s.textContent=`\xA0`,this._rowColumns.set(s,[0,1])):(s.textContent=a,this._rowColumns.set(s,t)),s.setAttribute(`aria-posinset`,o),s.setAttribute(`aria-setsize`,r),this._alignRowWidth(s))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce=``)}_handleBoundaryFocus(e,t){let n=e.target,r=this._rowElements[t===0?1:this._rowElements.length-2];if(n.getAttribute(`aria-posinset`)===(t===0?`1`:`${this._terminal.buffer.lines.length}`)||e.relatedTarget!==r)return;let i,a;if(t===0?(i=n,a=this._rowElements.pop(),this._rowContainer.removeChild(a)):(i=this._rowElements.shift(),a=n,this._rowContainer.removeChild(i)),i.removeEventListener(`focus`,this._topBoundaryFocusListener),a.removeEventListener(`focus`,this._bottomBoundaryFocusListener),t===0){let e=this._createAccessibilityTreeNode();this._rowElements.unshift(e),this._rowContainer.insertAdjacentElement(`afterbegin`,e)}else{let e=this._createAccessibilityTreeNode();this._rowElements.push(e),this._rowContainer.appendChild(e)}this._rowElements[0].addEventListener(`focus`,this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener(`focus`,this._bottomBoundaryFocusListener),this._terminal.scrollLines(t===0?-1:1),this._rowElements[t===0?1:this._rowElements.length-2].focus(),e.preventDefault(),e.stopImmediatePropagation()}_handleSelectionChange(){if(this._rowElements.length===0)return;let e=this._coreBrowserService.mainDocument.getSelection();if(!e)return;if(e.isCollapsed){this._rowContainer.contains(e.anchorNode)&&this._terminal.clearSelection();return}if(!e.anchorNode||!e.focusNode){console.error(`anchorNode and/or focusNode are null`);return}let t={node:e.anchorNode,offset:e.anchorOffset},n={node:e.focusNode,offset:e.focusOffset};if((t.node.compareDocumentPosition(n.node)&Node.DOCUMENT_POSITION_PRECEDING||t.node===n.node&&t.offset>n.offset)&&([t,n]=[n,t]),t.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(t={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(t.node))return;let r=this._rowElements.slice(-1)[0];if(n.node.compareDocumentPosition(r)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(n={node:r,offset:r.textContent?.length??0}),!this._rowContainer.contains(n.node))return;let i=({node:e,offset:t})=>{let n=e instanceof Text?e.parentNode:e,r=parseInt(n?.getAttribute(`aria-posinset`),10)-1;if(isNaN(r))return console.warn(`row is invalid. Race condition?`),null;let i=this._rowColumns.get(n);if(!i)return console.warn(`columns is null. Race condition?`),null;let a=t=this._terminal.cols&&(++r,a=0),{row:r,column:a}},a=i(t),o=i(n);if(!(!a||!o)){if(a.row>o.row||a.row===o.row&&a.column>=o.column)throw Error(`invalid range`);this._terminal.select(a.column,a.row,(o.row-a.row)*this._terminal.cols-a.column+o.column)}}_handleResize(e){this._rowElements[this._rowElements.length-1].removeEventListener(`focus`,this._bottomBoundaryFocusListener);for(let e=this._rowContainer.children.length;ee;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener(`focus`,this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){let e=this._coreBrowserService.mainDocument.createElement(`div`);return e.setAttribute(`role`,`listitem`),e.tabIndex=-1,this._refreshRowDimensions(e),e}_refreshRowsDimensions(){if(this._renderService.dimensions.css.cell.height){Object.assign(this._accessibilityContainer.style,{width:`${this._renderService.dimensions.css.canvas.width}px`,fontSize:`${this._terminal.options.fontSize}px`}),this._rowElements.length!==this._terminal.rows&&this._handleResize(this._terminal.rows);for(let e=0;e{lt(this._linkCacheDisposables),this._linkCacheDisposables.length=0,this._lastMouseEvent=void 0,this._activeProviderReplies?.clear()})),this._register(this._bufferService.onResize(()=>{this._clearCurrentLink(),this._wasResized=!0})),this._register(P(this._element,`mouseleave`,()=>{this._isMouseOut=!0,this._clearCurrentLink()})),this._register(P(this._element,`mousemove`,this._handleMouseMove.bind(this))),this._register(P(this._element,`mousedown`,this._handleMouseDown.bind(this))),this._register(P(this._element,`mouseup`,this._handleMouseUp.bind(this)))}get currentLink(){return this._currentLink}_handleMouseMove(e){this._lastMouseEvent=e;let t=this._positionFromMouseEvent(e,this._element,this._mouseService);if(!t)return;this._isMouseOut=!1;let n=e.composedPath();for(let e=0;e{e?.forEach(e=>{e.link.dispose&&e.link.dispose()})}),this._activeProviderReplies=new Map,this._activeLine=e.y);let n=!1;for(let[r,i]of this._linkProviderService.linkProviders.entries())t?this._activeProviderReplies?.get(r)&&(n=this._checkLinkProviderResult(r,e,n)):i.provideLinks(e.y,t=>{if(this._isMouseOut)return;let i=t?.map(e=>({link:e}));this._activeProviderReplies?.set(r,i),n=this._checkLinkProviderResult(r,e,n),this._activeProviderReplies?.size===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(e.y,this._activeProviderReplies)})}_removeIntersectingLinks(e,t){let n=new Set;for(let r=0;re?this._bufferService.cols:r.link.range.end.x;for(let e=a;e<=o;e++){if(n.has(e)){i.splice(t--,1);break}n.add(e)}}}}_checkLinkProviderResult(e,t,n){if(!this._activeProviderReplies)return n;let r=this._activeProviderReplies.get(e),i=!1;for(let t=0;tthis._linkAtPosition(e.link,t));e&&(n=!0,this._handleNewLink(e))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!n)for(let e=0;ethis._linkAtPosition(e.link,t));if(r){n=!0,this._handleNewLink(r);break}}return n}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(e){if(!this._currentLink)return;let t=this._positionFromMouseEvent(e,this._element,this._mouseService);t&&this._mouseDownLink&&Es(this._mouseDownLink.link,this._currentLink.link)&&this._linkAtPosition(this._currentLink.link,t)&&this._currentLink.link.activate(e,this._currentLink.link.text)}_clearCurrentLink(e,t){!this._currentLink||!this._lastMouseEvent||(!e||!t||this._currentLink.link.range.start.y>=e&&this._currentLink.link.range.end.y<=t)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,lt(this._linkCacheDisposables),this._linkCacheDisposables.length=0)}_handleNewLink(e){if(!this._lastMouseEvent)return;let t=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);t&&this._linkAtPosition(e.link,t)&&(this._currentLink=e,this._currentLink.state={decorations:{underline:e.link.decorations===void 0||e.link.decorations.underline,pointerCursor:e.link.decorations===void 0||e.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,e.link,this._lastMouseEvent),e.link.decorations={},Object.defineProperties(e.link.decorations,{pointerCursor:{get:()=>this._currentLink?.state?.decorations.pointerCursor,set:e=>{this._currentLink?.state&&this._currentLink.state.decorations.pointerCursor!==e&&(this._currentLink.state.decorations.pointerCursor=e,this._currentLink.state.isHovered&&this._element.classList.toggle(`xterm-cursor-pointer`,e))}},underline:{get:()=>this._currentLink?.state?.decorations.underline,set:t=>{this._currentLink?.state&&this._currentLink?.state?.decorations.underline!==t&&(this._currentLink.state.decorations.underline=t,this._currentLink.state.isHovered&&this._fireUnderlineEvent(e.link,t))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange(e=>{if(!this._currentLink)return;let t=e.start===0?0:e.start+1+this._bufferService.buffer.ydisp,n=this._bufferService.buffer.ydisp+1+e.end;if(this._currentLink.link.range.start.y>=t&&this._currentLink.link.range.end.y<=n&&(this._clearCurrentLink(t,n),this._lastMouseEvent)){let e=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);e&&this._askForLink(e,!1)}})))}_linkHover(e,t,n){this._currentLink?.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(t,!0),this._currentLink.state.decorations.pointerCursor&&e.classList.add(`xterm-cursor-pointer`)),t.hover&&t.hover(n,t.text)}_fireUnderlineEvent(e,t){let n=e.range,r=this._bufferService.buffer.ydisp,i=this._createLinkUnderlineEvent(n.start.x-1,n.start.y-r-1,n.end.x,n.end.y-r-1,void 0);(t?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(i)}_linkLeave(e,t,n){this._currentLink?.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(t,!1),this._currentLink.state.decorations.pointerCursor&&e.classList.remove(`xterm-cursor-pointer`)),t.leave&&t.leave(n,t.text)}_linkAtPosition(e,t){let n=e.range.start.y*this._bufferService.cols+e.range.start.x,r=e.range.end.y*this._bufferService.cols+e.range.end.x,i=t.y*this._bufferService.cols+t.x;return n<=i&&i<=r}_positionFromMouseEvent(e,t,n){let r=n.getCoords(e,t,this._bufferService.cols,this._bufferService.rows);if(r)return{x:r[0],y:r[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(e,t,n,r,i){return{x1:e,y1:t,x2:n,y2:r,cols:this._bufferService.cols,fg:i}}};Ts=y([b(1,Me),b(2,Ne),b(3,E),b(4,Le)],Ts);function Es(e,t){return e.text===t.text&&e.range.start.x===t.range.start.x&&e.range.start.y===t.range.start.y&&e.range.end.x===t.range.end.x&&e.range.end.y===t.range.end.y}var Ds=class extends ps{constructor(e={}){super(e),this._linkifier=this._register(new pt),this.browser=Gi,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this._register(new pt),this._onCursorMove=this._register(new N),this.onCursorMove=this._onCursorMove.event,this._onKey=this._register(new N),this.onKey=this._onKey.event,this._onRender=this._register(new N),this.onRender=this._onRender.event,this._onSelectionChange=this._register(new N),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this._register(new N),this.onTitleChange=this._onTitleChange.event,this._onBell=this._register(new N),this.onBell=this._onBell.event,this._onFocus=this._register(new N),this._onBlur=this._register(new N),this._onA11yCharEmitter=this._register(new N),this._onA11yTabEmitter=this._register(new N),this._onWillOpen=this._register(new N),this._setup(),this._decorationService=this._instantiationService.createInstance(ys),this._instantiationService.setService(De,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(Bi),this._instantiationService.setService(Le,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(Oe)),this._register(this._inputHandler.onRequestBell(()=>this._onBell.fire())),this._register(this._inputHandler.onRequestRefreshRows(e=>this.refresh(e?.start??0,e?.end??this.rows-1))),this._register(this._inputHandler.onRequestSendFocus(()=>this._reportFocus())),this._register(this._inputHandler.onRequestReset(()=>this.reset())),this._register(this._inputHandler.onRequestWindowsOptionsReport(e=>this._reportWindowsOptions(e))),this._register(this._inputHandler.onColor(e=>this._handleColorEvent(e))),this._register(M.forward(this._inputHandler.onCursorMove,this._onCursorMove)),this._register(M.forward(this._inputHandler.onTitleChange,this._onTitleChange)),this._register(M.forward(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this._register(M.forward(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this._register(this._bufferService.onResize(e=>this._afterResize(e.cols,e.rows))),this._register(k(()=>{this._customKeyEventHandler=void 0,this.element?.parentNode?.removeChild(this.element)}))}get linkifier(){return this._linkifier.value}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}_handleColorEvent(e){if(this._themeService)for(let t of e){let e,n=``;switch(t.index){case 256:e=`foreground`,n=`10`;break;case 257:e=`background`,n=`11`;break;case 258:e=`cursor`,n=`12`;break;default:e=`ansi`,n=`4;`+t.index}switch(t.type){case 0:let r=U.toColorRGB(e===`ansi`?this._themeService.colors.ansi[t.index]:this._themeService.colors[e]);this.coreService.triggerDataEvent(`${L.ESC}]${n};${Zo(r)}${ci.ST}`);break;case 1:if(e===`ansi`)this._themeService.modifyColors(e=>e.ansi[t.index]=H.toColor(...t.color));else{let n=e;this._themeService.modifyColors(e=>e[n]=H.toColor(...t.color))}break;case 2:this._themeService.restoreColor(t.index);break}}}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange(e){e?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(ws,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(e){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(L.ESC+`[I`),this.element.classList.add(`focus`),this._showCursor(),this._onFocus.fire()}blur(){return this.textarea?.blur()}_handleTextAreaBlur(){this.textarea.value=``,this.refresh(this.buffer.y,this.buffer.y),this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(L.ESC+`[O`),this.element.classList.remove(`focus`),this._onBlur.fire()}_syncTextArea(){if(!this.textarea||!this.buffer.isCursorInViewport||this._compositionHelper.isComposing||!this._renderService)return;let e=this.buffer.ybase+this.buffer.y,t=this.buffer.lines.get(e);if(!t)return;let n=Math.min(this.buffer.x,this.cols-1),r=this._renderService.dimensions.css.cell.height,i=t.getWidth(n),a=this._renderService.dimensions.css.cell.width*i,o=this.buffer.y*this._renderService.dimensions.css.cell.height,s=n*this._renderService.dimensions.css.cell.width;this.textarea.style.left=s+`px`,this.textarea.style.top=o+`px`,this.textarea.style.width=a+`px`,this.textarea.style.height=r+`px`,this.textarea.style.lineHeight=r+`px`,this.textarea.style.zIndex=`-5`}_initGlobal(){this._bindKeys(),this._register(P(this.element,`copy`,e=>{this.hasSelection()&&x(e,this._selectionService)}));let e=e=>oe(e,this.textarea,this.coreService,this.optionsService);this._register(P(this.textarea,`paste`,e)),this._register(P(this.element,`paste`,e)),Yi?this._register(P(this.element,`mousedown`,e=>{e.button===2&&ce(e,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})):this._register(P(this.element,`contextmenu`,e=>{ce(e,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})),ra&&this._register(P(this.element,`auxclick`,e=>{e.button===1&&se(e,this.textarea,this.screenElement)}))}_bindKeys(){this._register(P(this.textarea,`keyup`,e=>this._keyUp(e),!0)),this._register(P(this.textarea,`keydown`,e=>this._keyDown(e),!0)),this._register(P(this.textarea,`keypress`,e=>this._keyPress(e),!0)),this._register(P(this.textarea,`compositionstart`,()=>this._compositionHelper.compositionstart())),this._register(P(this.textarea,`compositionupdate`,e=>this._compositionHelper.compositionupdate(e))),this._register(P(this.textarea,`compositionend`,()=>this._compositionHelper.compositionend())),this._register(P(this.textarea,`input`,e=>this._inputEvent(e),!0)),this._register(this.onRender(()=>this._compositionHelper.updateCompositionElements()))}open(e){if(!e)throw Error(`Terminal requires a parent element.`);if(e.isConnected||this._logService.debug(`Terminal.open was called on an element that was not attached to the DOM`),this.element?.ownerDocument.defaultView&&this._coreBrowserService){this.element.ownerDocument.defaultView!==this._coreBrowserService.window&&(this._coreBrowserService.window=this.element.ownerDocument.defaultView);return}this._document=e.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`),e.appendChild(this.element);let t=this._document.createDocumentFragment();this._viewportElement=this._document.createElement(`div`),this._viewportElement.classList.add(`xterm-viewport`),t.appendChild(this._viewportElement),this.screenElement=this._document.createElement(`div`),this.screenElement.classList.add(`xterm-screen`),this._register(P(this.screenElement,`mousemove`,e=>this.updateCursorStyle(e))),this._helperContainer=this._document.createElement(`div`),this._helperContainer.classList.add(`xterm-helpers`),this.screenElement.appendChild(this._helperContainer),t.appendChild(this.screenElement);let n=this.textarea=this._document.createElement(`textarea`);this.textarea.classList.add(`xterm-helper-textarea`),this.textarea.setAttribute(`aria-label`,te.get()),ia||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._register(this.optionsService.onSpecificOptionChange(`disableStdin`,()=>n.readOnly=this.optionsService.rawOptions.disableStdin)),this.textarea.readOnly=this.optionsService.rawOptions.disableStdin,this._coreBrowserService=this._register(this._instantiationService.createInstance(Ri,this.textarea,e.ownerDocument.defaultView??window,this._document??typeof window<`u`?window.document:null)),this._instantiationService.setService(je,this._coreBrowserService),this._register(P(this.textarea,`focus`,e=>this._handleTextAreaFocus(e))),this._register(P(this.textarea,`blur`,()=>this._handleTextAreaBlur())),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(Pi,this._document,this._helperContainer),this._instantiationService.setService(Ae,this._charSizeService),this._themeService=this._instantiationService.createInstance(Va),this._instantiationService.setService(Ie,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(hi),this._instantiationService.setService(Fe,this._characterJoinerService),this._renderService=this._register(this._instantiationService.createInstance(ua,this.rows,this.screenElement)),this._instantiationService.setService(Ne,this._renderService),this._register(this._renderService.onRenderedViewportChange(e=>this._onRender.fire(e))),this.onResize(e=>this._renderService.resize(e.cols,e.rows)),this._compositionView=this._document.createElement(`div`),this._compositionView.classList.add(`composition-view`),this._compositionHelper=this._instantiationService.createInstance(li,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this._mouseService=this._instantiationService.createInstance(Ui),this._instantiationService.setService(Me,this._mouseService);let r=this._linkifier.value=this._register(this._instantiationService.createInstance(Ts,this.screenElement));this.element.appendChild(t);try{this._onWillOpen.fire(this.element)}catch{}this._renderService.hasRenderer()||this._renderService.setRenderer(this._createRenderer()),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._viewport=this._register(this._instantiationService.createInstance(ei,this.element,this.screenElement)),this._register(this._viewport.onRequestScrollLines(e=>{super.scrollLines(e,!1),this.refresh(0,this.rows-1)})),this._selectionService=this._register(this._instantiationService.createInstance(Ma,this.element,this.screenElement,r)),this._instantiationService.setService(Pe,this._selectionService),this._register(this._selectionService.onRequestScrollLines(e=>this.scrollLines(e.amount,e.suppressScrollEvent))),this._register(this._selectionService.onSelectionChange(()=>this._onSelectionChange.fire())),this._register(this._selectionService.onRequestRedraw(e=>this._renderService.handleSelectionChanged(e.start,e.end,e.columnSelectMode))),this._register(this._selectionService.onLinuxMouseSelection(e=>{this.textarea.value=e,this.textarea.focus(),this.textarea.select()})),this._register(M.any(this._onScroll.event,this._inputHandler.onScroll)(()=>{this._selectionService.refresh(),this._viewport?.queueSync()})),this._register(this._instantiationService.createInstance(ti,this.screenElement)),this._register(P(this.element,`mousedown`,e=>this._selectionService.handleMouseDown(e))),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(ws,this)),this._register(this.optionsService.onSpecificOptionChange(`screenReaderMode`,e=>this._handleScreenReaderModeOptionChange(e))),this.options.overviewRuler.width&&(this._overviewRulerRenderer=this._register(this._instantiationService.createInstance(oi,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange(`overviewRuler`,e=>{!this._overviewRulerRenderer&&e&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this._register(this._instantiationService.createInstance(oi,this._viewportElement,this.screenElement)))}),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(Ni,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){let e=this,t=this.element;function n(t){let n=e._mouseService.getMouseReportCoords(t,e.screenElement);if(!n)return!1;let r,i;switch(t.overrideType||t.type){case`mousemove`:i=32,t.buttons===void 0?(r=3,t.button!==void 0&&(r=t.button<3?t.button:3)):r=t.buttons&1?0:t.buttons&4?1:t.buttons&2?2:3;break;case`mouseup`:i=0,r=t.button<3?t.button:3;break;case`mousedown`:i=1,r=t.button<3?t.button:3;break;case`wheel`:if(e._customWheelEventHandler&&e._customWheelEventHandler(t)===!1)return!1;let n=t.deltaY;if(n===0||e.coreMouseService.consumeWheelEvent(t,e._renderService?.dimensions?.device?.cell?.height,e._coreBrowserService?.dpr)===0)return!1;i=n<0?0:1,r=4;break;default:return!1}return i===void 0||r===void 0||r>4?!1:e.coreMouseService.triggerMouseEvent({col:n.col,row:n.row,x:n.x,y:n.y,button:r,action:i,ctrl:t.ctrlKey,alt:t.altKey,shift:t.shiftKey})}let r={mouseup:null,wheel:null,mousedrag:null,mousemove:null},i={mouseup:e=>(n(e),e.buttons||(this._document.removeEventListener(`mouseup`,r.mouseup),r.mousedrag&&this._document.removeEventListener(`mousemove`,r.mousedrag)),this.cancel(e)),wheel:e=>(n(e),this.cancel(e,!0)),mousedrag:e=>{e.buttons&&n(e)},mousemove:e=>{e.buttons||n(e)}};this._register(this.coreMouseService.onProtocolChange(e=>{e?(this.optionsService.rawOptions.logLevel===`debug`&&this._logService.debug(`Binding to mouse events:`,this.coreMouseService.explainEvents(e)),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()),e&8?r.mousemove||=(t.addEventListener(`mousemove`,i.mousemove),i.mousemove):(t.removeEventListener(`mousemove`,r.mousemove),r.mousemove=null),e&16?r.wheel||=(t.addEventListener(`wheel`,i.wheel,{passive:!1}),i.wheel):(t.removeEventListener(`wheel`,r.wheel),r.wheel=null),e&2?r.mouseup||=i.mouseup:(this._document.removeEventListener(`mouseup`,r.mouseup),r.mouseup=null),e&4?r.mousedrag||=i.mousedrag:(this._document.removeEventListener(`mousemove`,r.mousedrag),r.mousedrag=null)})),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this._register(P(t,`mousedown`,e=>{if(e.preventDefault(),this.focus(),!(!this.coreMouseService.areMouseEventsActive||this._selectionService.shouldForceSelection(e)))return n(e),r.mouseup&&this._document.addEventListener(`mouseup`,r.mouseup),r.mousedrag&&this._document.addEventListener(`mousemove`,r.mousedrag),this.cancel(e)})),this._register(P(t,`wheel`,t=>{if(!r.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler(t)===!1)return!1;if(!this.buffer.hasScrollback){if(t.deltaY===0)return!1;if(e.coreMouseService.consumeWheelEvent(t,e._renderService?.dimensions?.device?.cell?.height,e._coreBrowserService?.dpr)===0)return this.cancel(t,!0);let n=L.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?`O`:`[`)+(t.deltaY<0?`A`:`B`);return this.coreService.triggerDataEvent(n,!0),this.cancel(t,!0)}}},{passive:!1}))}refresh(e,t){this._renderService?.refreshRows(e,t)}updateCursorStyle(e){this._selectionService?.shouldColumnSelect(e)?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(e,t){this._viewport?this._viewport.scrollLines(e):super.scrollLines(e,t),this.refresh(0,this.rows-1)}scrollPages(e){this.scrollLines(e*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(e){e&&this._viewport?this._viewport.scrollToLine(this.buffer.ybase,!0):this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(e){let t=e-this._bufferService.buffer.ydisp;t!==0&&this.scrollLines(t)}paste(e){S(e,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(e){this._customKeyEventHandler=e}attachCustomWheelEventHandler(e){this._customWheelEventHandler=e}registerLinkProvider(e){return this._linkProviderService.registerLinkProvider(e)}registerCharacterJoiner(e){if(!this._characterJoinerService)throw Error(`Terminal must be opened first`);let t=this._characterJoinerService.register(e);return this.refresh(0,this.rows-1),t}deregisterCharacterJoiner(e){if(!this._characterJoinerService)throw Error(`Terminal must be opened first`);this._characterJoinerService.deregister(e)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(e){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+e)}registerDecoration(e){return this._decorationService.registerDecoration(e)}hasSelection(){return this._selectionService?this._selectionService.hasSelection:!1}select(e,t,n){this._selectionService.setSelection(e,t,n)}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(){this._selectionService?.clearSelection()}selectAll(){this._selectionService?.selectAll()}selectLines(e,t){this._selectionService?.selectLines(e,t)}_keyDown(e){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(e)===!1)return!1;let t=this.browser.isMac&&this.options.macOptionIsMeta&&e.altKey;if(!t&&!this._compositionHelper.keydown(e))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(!0),!1;!t&&(e.key===`Dead`||e.key===`AltGraph`)&&(this._unprocessedDeadKey=!0);let n=hs(e,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(e),n.type===3||n.type===2){let t=this.rows-1;return this.scrollLines(n.type===2?-t:t),this.cancel(e,!0)}if(n.type===1&&this.selectAll(),this._isThirdLevelShift(this.browser,e)||(n.cancel&&this.cancel(e,!0),!n.key)||e.key&&!e.ctrlKey&&!e.altKey&&!e.metaKey&&e.key.length===1&&e.key.charCodeAt(0)>=65&&e.key.charCodeAt(0)<=90)return!0;if(this._unprocessedDeadKey)return this._unprocessedDeadKey=!1,!0;if((n.key===L.ETX||n.key===L.CR)&&(this.textarea.value=``),this._onKey.fire({key:n.key,domEvent:e}),this._showCursor(),this.coreService.triggerDataEvent(n.key,!0),!this.optionsService.rawOptions.screenReaderMode||e.altKey||e.ctrlKey)return this.cancel(e,!0);this._keyDownHandled=!0}_isThirdLevelShift(e,t){let n=e.isMac&&!this.options.macOptionIsMeta&&t.altKey&&!t.ctrlKey&&!t.metaKey||e.isWindows&&t.altKey&&t.ctrlKey&&!t.metaKey||e.isWindows&&t.getModifierState(`AltGraph`);return t.type===`keypress`?n:n&&(!t.keyCode||t.keyCode>47)}_keyUp(e){this._keyDownSeen=!1,!(this._customKeyEventHandler&&this._customKeyEventHandler(e)===!1)&&(Os(e)||this.focus(),this.updateCursorStyle(e),this._keyPressHandled=!1)}_keyPress(e){let t;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(e)===!1)return!1;if(this.cancel(e),e.charCode)t=e.charCode;else if(e.which===null||e.which===void 0)t=e.keyCode;else if(e.which!==0&&e.charCode!==0)t=e.which;else return!1;return!t||(e.altKey||e.ctrlKey||e.metaKey)&&!this._isThirdLevelShift(this.browser,e)?!1:(t=String.fromCharCode(t),this._onKey.fire({key:t,domEvent:e}),this._showCursor(),this.coreService.triggerDataEvent(t,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,!0)}_inputEvent(e){if(e.data&&e.inputType===`insertText`&&(!e.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;let t=e.data;return this.coreService.triggerDataEvent(t,!0),this.cancel(e),!0}return!1}resize(e,t){if(e===this.cols&&t===this.rows){this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure();return}super.resize(e,t)}_afterResize(e,t){this._charSizeService?.measure()}clear(){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 e=1;e=0;e--)this._addons[e].instance.dispose()}loadAddon(e,t){let n={instance:t,dispose:t.dispose,isDisposed:!1};this._addons.push(n),t.dispose=()=>this._wrappedAddonDispose(n),t.activate(e)}_wrappedAddonDispose(e){if(e.isDisposed)return;let t=-1;for(let n=0;n=this._line.length))return t?(this._line.loadCell(e,t),t):this._line.loadCell(e,new w)}translateToString(e,t,n){return this._line.translateToString(e,t,n)}},js=class{constructor(e,t){this._buffer=e,this.type=t}init(e){return this._buffer=e,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(e){let t=this._buffer.lines.get(e);if(t)return new As(t)}getNullCell(){return new w}},Ms=class extends A{constructor(e){super(),this._core=e,this._onBufferChange=this._register(new N),this.onBufferChange=this._onBufferChange.event,this._normal=new js(this._core.buffers.normal,`normal`),this._alternate=new js(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 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)}},Ns=class{constructor(e){this._core=e}registerCsiHandler(e,t){return this._core.registerCsiHandler(e,e=>t(e.toArray()))}addCsiHandler(e,t){return this.registerCsiHandler(e,t)}registerDcsHandler(e,t){return this._core.registerDcsHandler(e,(e,n)=>t(e,n.toArray()))}addDcsHandler(e,t){return this.registerDcsHandler(e,t)}registerEscHandler(e,t){return this._core.registerEscHandler(e,t)}addEscHandler(e,t){return this.registerEscHandler(e,t)}registerOscHandler(e,t){return this._core.registerOscHandler(e,t)}addOscHandler(e,t){return this.registerOscHandler(e,t)}},Ps=class{constructor(e){this._core=e}register(e){this._core.unicodeService.register(e)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(e){this._core.unicodeService.activeVersion=e}},Fs=[`cols`,`rows`],Is=0,Ls=class extends A{constructor(e){super(),this._core=this._register(new Ds(e)),this._addonManager=this._register(new ks),this._publicOptions={...this._core.options};let t=e=>this._core.options[e],n=(e,t)=>{this._checkReadonlyOptions(e),this._core.options[e]=t};for(let e in this._core.options){let r={get:t.bind(this,e),set:n.bind(this,e)};Object.defineProperty(this._publicOptions,e,r)}}_checkReadonlyOptions(e){if(Fs.includes(e))throw Error(`Option "${e}" can only be set in the constructor`)}_checkProposedApi(){if(!this._core.optionsService.rawOptions.allowProposedApi)throw 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||=new Ns(this._core),this._parser}get unicode(){return this._checkProposedApi(),new Ps(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._register(new Ms(this._core)),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){let e=this._core.coreService.decPrivateModes,t=`none`;switch(this._core.coreMouseService.activeProtocol){case`X10`:t=`x10`;break;case`VT200`:t=`vt200`;break;case`DRAG`:t=`drag`;break;case`ANY`:t=`any`;break}return{applicationCursorKeysMode:e.applicationCursorKeys,applicationKeypadMode:e.applicationKeypad,bracketedPasteMode:e.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:t,originMode:e.origin,reverseWraparoundMode:e.reverseWraparound,sendFocusMode:e.sendFocus,synchronizedOutputMode:e.synchronizedOutput,wraparoundMode:e.wraparound}}get options(){return this._publicOptions}set options(e){for(let t in e)this._publicOptions[t]=e[t]}blur(){this._core.blur()}focus(){this._core.focus()}input(e,t=!0){this._core.input(e,t)}resize(e,t){this._verifyIntegers(e,t),this._core.resize(e,t)}open(e){this._core.open(e)}attachCustomKeyEventHandler(e){this._core.attachCustomKeyEventHandler(e)}attachCustomWheelEventHandler(e){this._core.attachCustomWheelEventHandler(e)}registerLinkProvider(e){return this._core.registerLinkProvider(e)}registerCharacterJoiner(e){return this._checkProposedApi(),this._core.registerCharacterJoiner(e)}deregisterCharacterJoiner(e){this._checkProposedApi(),this._core.deregisterCharacterJoiner(e)}registerMarker(e=0){return this._verifyIntegers(e),this._core.registerMarker(e)}registerDecoration(e){return this._checkProposedApi(),this._verifyPositiveIntegers(e.x??0,e.width??0,e.height??0),this._core.registerDecoration(e)}hasSelection(){return this._core.hasSelection()}select(e,t,n){this._verifyIntegers(e,t,n),this._core.select(e,t,n)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(e,t){this._verifyIntegers(e,t),this._core.selectLines(e,t)}dispose(){super.dispose()}scrollLines(e){this._verifyIntegers(e),this._core.scrollLines(e)}scrollPages(e){this._verifyIntegers(e),this._core.scrollPages(e)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(e){this._verifyIntegers(e),this._core.scrollToLine(e)}clear(){this._core.clear()}write(e,t){this._core.write(e,t)}writeln(e,t){this._core.write(e),this._core.write(`\r +`,t)}paste(e){this._core.paste(e)}refresh(e,t){this._verifyIntegers(e,t),this._core.refresh(e,t)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(e){this._addonManager.loadAddon(this,e)}static get strings(){return{get promptLabel(){return te.get()},set promptLabel(e){te.set(e)},get tooMuchOutput(){return re.get()},set tooMuchOutput(e){re.set(e)}}}_verifyIntegers(...e){for(Is of e)if(Is===1/0||isNaN(Is)||Is%1!=0)throw Error(`This API only accepts integers`)}_verifyPositiveIntegers(...e){for(Is of e)if(Is&&(Is===1/0||isNaN(Is)||Is%1!=0||Is<0))throw Error(`This API only accepts positive integers`)}},Rs=2,zs=1,Bs=class{activate(e){this._terminal=e}dispose(){}fit(){let e=this.proposeDimensions();if(!e||!this._terminal||isNaN(e.cols)||isNaN(e.rows))return;let t=this._terminal._core;(this._terminal.rows!==e.rows||this._terminal.cols!==e.cols)&&(t._renderService.clear(),this._terminal.resize(e.cols,e.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;let e=this._terminal._core._renderService.dimensions;if(e.css.cell.width===0||e.css.cell.height===0)return;let t=this._terminal.options.scrollback===0?0:this._terminal.options.overviewRuler?.width||14,n=window.getComputedStyle(this._terminal.element.parentElement),r=parseInt(n.getPropertyValue(`height`)),i=Math.max(0,parseInt(n.getPropertyValue(`width`))),a=window.getComputedStyle(this._terminal.element),o={top:parseInt(a.getPropertyValue(`padding-top`)),bottom:parseInt(a.getPropertyValue(`padding-bottom`)),right:parseInt(a.getPropertyValue(`padding-right`)),left:parseInt(a.getPropertyValue(`padding-left`))},s=o.top+o.bottom,c=o.right+o.left,l=r-s,u=i-c-t;return{cols:Math.max(Rs,Math.floor(u/e.css.cell.width)),rows:Math.max(zs,Math.floor(l/e.css.cell.height))}}},Vs=typeof window<`u`&&typeof window.matchMedia==`function`&&window.matchMedia(`(pointer: coarse)`).matches?13:12;function Hs({panes:e,socketRef:t,viewsRef:n,bodyRefs:r,pendingRef:i,setTitles:a}){(0,c.useEffect)(()=>{for(let o of e){if(n.current.has(o))continue;let e=r.current.get(o);if(!e)continue;let s=new Ls({fontFamily:getComputedStyle(document.body).fontFamily,fontSize:Vs,theme:{background:`#0b0b0d`,foreground:`#e6e6ec`},cursorBlink:!0}),c=new Bs;s.loadAddon(c),s.onData(e=>t.current?.send(JSON.stringify({type:`input`,pane:o,data:e}))),s.onTitleChange(e=>{let t=e.replace(/\s+/g,` `).trim();t&&a(e=>({...e,[o]:t}))}),s.open(e),n.current.set(o,{term:s,fit:c});let l=i.current.get(o);if(l){for(let e of l)s.write(e);i.current.delete(o)}}for(let[t,r]of n.current)e.includes(t)||(r.term.dispose(),n.current.delete(t))},[e])}var $=n();function Us({pane:e,index:t,label:n,cellStyle:r,isActive:i,isZoomed:o,isDragged:c,isDropTarget:l,reorderable:u,onFocus:d,onToggleZoom:f,onClose:m,onPaneDragStart:h,onPaneDragMove:g,onPaneDragEnd:_,onPaneDragCancel:v,bodyRef:y}){return(0,$.jsxs)(`div`,{"data-pane-id":e,onMouseDown:d,style:r,className:`min-h-0 min-w-0 flex-col overflow-hidden rounded-sm border ${l?`border-accent ring-1 ring-accent`:i?`border-accent`:`border-ink-700`} ${c?`opacity-60`:``}`,children:[(0,$.jsxs)(`div`,{onPointerDown:h,onPointerMove:g,onPointerUp:_,onPointerCancel:v,className:`flex shrink-0 items-center gap-1 select-none bg-ink-900 px-2 py-0.5 text-xs ${u?c?`cursor-grabbing touch-none`:`cursor-grab touch-none`:``}`,children:[(0,$.jsx)(`span`,{title:n,className:`min-w-0 flex-1 truncate ${i?`text-ink-50`:`text-ink-400`}`,children:p(n,20)}),(0,$.jsx)(`button`,{onMouseDown:e=>e.stopPropagation(),onClick:f,"aria-pressed":o,title:o?`Restore the grid`:`Zoom this terminal`,"aria-label":o?`Restore the grid`:`Zoom this terminal`,className:`flex h-8 w-8 shrink-0 items-center justify-center rounded-sm text-ink-400 hover:text-accent md:h-6 md:w-6`,children:(0,$.jsx)(s,{maximized:o})}),(0,$.jsx)(`button`,{onMouseDown:e=>e.stopPropagation(),onClick:m,title:`Close terminal`,"aria-label":`close terminal ${t+1}`,className:`flex h-8 w-8 shrink-0 items-center justify-center rounded-sm text-ink-400 hover:text-removed md:h-6 md:w-6`,children:(0,$.jsx)(a,{})})]}),(0,$.jsx)(`div`,{ref:y,className:`min-h-0 flex-1`})]})}var Ws={esc:`\x1B`,tab:` `,"ctrl-c":``,"ctrl-d":``,"ctrl-z":``,"ctrl-l":`\f`,"ctrl-r":``,up:`\x1B[A`,down:`\x1B[B`,right:`\x1B[C`,left:`\x1B[D`},Gs={up:`\x1BOA`,down:`\x1BOB`,right:`\x1BOC`,left:`\x1BOD`};function Ks(e,t=!1){if(t){let t=Gs[e];if(t)return t}return Ws[e]}var qs=[{key:`esc`,label:`Esc`,aria:`Escape`},{key:`tab`,label:`Tab`,aria:`Tab`},{key:`ctrl-c`,label:`^C`,aria:`Control C`},{key:`ctrl-d`,label:`^D`,aria:`Control D`},{key:`ctrl-z`,label:`^Z`,aria:`Control Z`},{key:`ctrl-l`,label:`^L`,aria:`Control L`},{key:`ctrl-r`,label:`^R`,aria:`Control R`},{key:`left`,label:`←`,aria:`Left arrow`},{key:`down`,label:`↓`,aria:`Down arrow`},{key:`up`,label:`↑`,aria:`Up arrow`},{key:`right`,label:`→`,aria:`Right arrow`}];function Js({repo:e,maximized:t,onToggleMaximized:n,className:i=``}){let a=(0,c.useRef)(null),o=(0,c.useRef)(null),l=(0,c.useRef)(new Map),u=(0,c.useRef)(new Map),f=(0,c.useRef)(new Map),p=(0,c.useRef)(new Map),g=(0,c.useRef)(new Map),_=(0,c.useRef)(0),[v,y]=(0,c.useState)([]),[b,ee]=(0,c.useState)(null),[te,ne]=(0,c.useState)(null),[re,ie]=(0,c.useState)({w:0,h:0}),[ae,x]=(0,c.useState)({});h({repo:e,socketRef:o,viewsRef:l,pendingRef:p,sentSizesRef:f,lastActiveByRepoRef:g,expectCreateRef:_,setPanes:y,setActive:ee,setZoomed:ne,setTitles:x}),Hs({panes:v,socketRef:o,viewsRef:l,bodyRefs:u,pendingRef:p,setTitles:x}),(0,c.useEffect)(()=>{for(let[e,t]of l.current){let n=u.current.get(e);if(!n||n.clientHeight===0||n.clientWidth===0)continue;t.fit.fit();let{rows:r,cols:i}=t.term,a=f.current.get(e);a&&a.rows===r&&a.cols===i||(f.current.set(e,{rows:r,cols:i}),o.current?.send(JSON.stringify({type:`resize`,pane:e,rows:r,cols:i})))}},[v,te,re]),(0,c.useEffect)(()=>{let e=a.current;if(!e)return;let t=new ResizeObserver(()=>{ie({w:e.clientWidth,h:e.clientHeight})});return t.observe(e),()=>t.disconnect()},[]),(0,c.useEffect)(()=>{if(b===null&&v.length>0){let t=g.current.get(e);ee(t!==void 0&&v.includes(t)?t:v[v.length-1])}},[b,v,e]),(0,c.useEffect)(()=>{b!==null&&l.current.get(b)?.term.focus()},[b]);let oe=t=>{ee(t),g.current.set(e,t)},S=()=>{let e=o.current;e&&(ne(null),_.current+=1,e.send(JSON.stringify({type:`create`,rows:24,cols:80})))},se=e=>{o.current?.send(JSON.stringify({type:`close`,pane:e}))},ce=e=>{if(b===null)return;let t=l.current.get(b)?.term.modes.applicationCursorKeysMode??!1;o.current?.send(JSON.stringify({type:`input`,pane:b,data:Ks(e,t)}))},{draggingPane:le,dragOverPane:C,reorderable:ue,endPaneDrag:de,onPaneDragStart:fe,onPaneDragMove:pe,onPaneDragEnd:me}=m({panes:v,zoomed:te,onFocus:oe,onReorder:e=>o.current?.send(JSON.stringify({type:`reorder`,order:e}))}),he=d(v.length,re.w>=re.h);return(0,$.jsxs)(`section`,{className:`flex min-h-0 min-w-0 flex-col border-t border-ink-700 ${i}`,children:[(0,$.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2 bg-ink-900 px-2 py-1`,children:[(0,$.jsx)(`button`,{onClick:S,title:`New terminal`,"aria-label":`New terminal`,className:`ml-auto flex shrink-0 items-center rounded-sm px-1.5 py-0.5 text-ink-400 hover:text-accent`,children:(0,$.jsx)(r,{})}),(0,$.jsx)(`button`,{onClick:n,"aria-pressed":t,title:t?`Restore panel height`:`Maximize the panel`,"aria-label":t?`Restore panel height`:`Maximize the panel`,className:`hidden shrink-0 items-center rounded-sm px-1.5 py-0.5 text-ink-400 hover:text-accent md:flex`,children:(0,$.jsx)(s,{maximized:t})})]}),(0,$.jsxs)(`div`,{className:`relative min-h-0 flex-1 overflow-hidden bg-ink-950 p-1`,children:[v.length===0&&(0,$.jsxs)(`p`,{className:`p-3 text-ink-400`,children:[`No terminal open. Press `,(0,$.jsx)(`span`,{className:`text-accent`,children:`+`}),` above to start one.`]}),(0,$.jsx)(`div`,{ref:a,className:`grid h-full gap-1`,style:te===null?{gridTemplateColumns:`repeat(${he.cols}, minmax(0, 1fr))`,gridTemplateRows:`repeat(${he.rows}, minmax(0, 1fr))`}:{gridTemplateColumns:`1fr`,gridTemplateRows:`1fr`},children:v.map((e,t)=>{let n=ae[e]??`term ${t+1}`,r=he.cells[t];return(0,$.jsx)(Us,{pane:e,index:t,label:n,cellStyle:te===null?{display:`flex`,gridColumn:`${r.colStart} / span ${r.colSpan}`,gridRow:`${r.row}`}:{display:e===te?`flex`:`none`},isActive:e===b,isZoomed:te===e,isDragged:le===e,isDropTarget:C===e,reorderable:ue,onFocus:()=>oe(e),onToggleZoom:()=>ne(t=>t===e?null:e),onClose:()=>se(e),onPaneDragStart:t=>fe(t,e),onPaneDragMove:pe,onPaneDragEnd:me,onPaneDragCancel:de,bodyRef:t=>{t?u.current.set(e,t):u.current.delete(e)}},e)})})]}),v.length>0&&(0,$.jsx)(`div`,{className:`flex shrink-0 items-stretch gap-1 overflow-x-auto border-t border-ink-700 bg-ink-900 px-1 py-1 md:hidden`,children:qs.map(({key:e,label:t,aria:n})=>(0,$.jsx)(`button`,{onPointerDown:e=>e.preventDefault(),onClick:()=>ce(e),"aria-label":n,className:`flex min-h-9 min-w-9 shrink-0 items-center justify-center rounded-sm border border-ink-700 bg-ink-850 px-2 text-xs text-ink-200 active:bg-ink-700 active:text-accent`,children:t},e))})]})}export{Js as TerminalPanel}; \ No newline at end of file diff --git a/viewer-ui/dist/assets/Terminal-ewaHgc2M.js b/viewer-ui/dist/assets/Terminal-ewaHgc2M.js deleted file mode 100644 index 3e828475..00000000 --- a/viewer-ui/dist/assets/Terminal-ewaHgc2M.js +++ /dev/null @@ -1,9 +0,0 @@ -import{r as Y,a as ke,b as De,t as Le,j as te,M as we,X as Re,P as xe}from"./index-Ck-wCR_a.js";const Ae=20,Be=4;function Te(U,X){for(;X;)[U,X]=[X,U%X];return U}function Me(U,X){switch(U){case 1:return[1];case 2:return X?[2]:[1,1];case 3:return[2,1];case 4:return[2,2];case 5:return[3,2];case 6:return[3,3];case 7:return[4,3];default:return[4,4]}}function Oe(U,X){const G=Me(U,X),J=G.reduce((q,x)=>q*x/Te(q,x),1),z=[];return G.forEach((q,x)=>{const r=J/q;for(let o=0;o=4352&&U<=4447||U>=11904&&U<=12350||U>=12353&&U<=13311||U>=13312&&U<=19903||U>=19968&&U<=40959||U>=40960&&U<=42191||U>=44032&&U<=55203||U>=63744&&U<=64255||U>=65072&&U<=65103||U>=65280&&U<=65376||U>=65504&&U<=65510||U>=127744&&U<=129791||U>=131072&&U<=262141}function Pe(U,X){let G=0;for(const q of U)G+=Se(q.codePointAt(0)??0)?2:1;if(G<=X)return U;let J=0,z="";for(const q of U){const x=Se(q.codePointAt(0)??0)?2:1;if(J+x>X-1)break;z+=q,J+=x}return`${z}…`}function Ie({panes:U,zoomed:X,onFocus:G,onReorder:J}){const z=Y.useRef(null),q=Y.useRef(null),x=Y.useRef(null),r=Y.useRef(!1),[o,l]=Y.useState(null),[_,n]=Y.useState(null),d=X===null&&U.length>1,f=()=>{z.current=null,q.current=null,x.current=null,r.current=!1,l(null),n(null)};return{draggingPane:o,dragOverPane:_,reorderable:d,endPaneDrag:f,onPaneDragStart:(s,e)=>{s.target.closest("button")||(G(e),!(s.button!==0||!d)&&(z.current=e,q.current={x:s.clientX,y:s.clientY},r.current=!1,s.currentTarget.setPointerCapture(s.pointerId)))},onPaneDragMove:s=>{const e=z.current,i=q.current;if(e===null||i===null||!r.current&&Math.hypot(s.clientX-i.x,s.clientY-i.y){const s=z.current,e=x.current;s!==null&&r.current&&e!==null&&J(ke(U,s,e)),f()}}}function He({repo:U,socketRef:X,viewsRef:G,pendingRef:J,sentSizesRef:z,lastActiveByRepoRef:q,expectCreateRef:x,setPanes:r,setActive:o,setZoomed:l,setTitles:_}){Y.useEffect(()=>{let n=!1,d;const f=()=>{G.current.forEach(h=>h.term.dispose()),G.current.clear(),J.current.clear(),z.current.clear()},g=()=>{r([]),o(null),l(null),_({}),f();const h=location.protocol==="https:"?"wss:":"ws:",t=new WebSocket(`${h}//${location.host}/ws/term?repo=${encodeURIComponent(U)}`);t.binaryType="arraybuffer",X.current=t,t.onmessage=s=>{if(typeof s.data=="string"){const u=JSON.parse(s.data);if(u.type==="created"){const p=u.pane;r(c=>[...c,p]),x.current>0?(x.current-=1,o(p),q.current.set(U,p)):q.current.get(U)===p&&o(p)}else u.type==="exited"?(r(p=>p.filter(c=>c!==u.pane)),o(p=>p===u.pane?null:p),l(p=>p===u.pane?null:p),J.current.delete(u.pane),z.current.delete(u.pane),_(p=>{if(!(u.pane in p))return p;const c={...p};return delete c[u.pane],c})):u.type==="reordered"?r(p=>De(p,u.order)):u.type==="error"&&(x.current=0,Le.error(u.message));return}const e=new Uint8Array(s.data);if(e.length<4)return;const i=new DataView(e.buffer).getUint32(0,!0),a=e.subarray(4),v=G.current.get(i);if(v)v.term.write(a);else{const u=J.current.get(i)??[];u.push(a),J.current.set(i,u)}},t.onclose=()=>{n||(d=setTimeout(g,1e3))}};return g(),()=>{n=!0,d&&clearTimeout(d),X.current?.close(),f()}},[U])}var ge={exports:{}},Ce;function Fe(){return Ce||(Ce=1,(function(U,X){(function(G,J){U.exports=J()})(globalThis,(()=>(()=>{var G={4567:function(x,r,o){var l=this&&this.__decorate||function(e,i,a,v){var u,p=arguments.length,c=p<3?i:v===null?v=Object.getOwnPropertyDescriptor(i,a):v;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")c=Reflect.decorate(e,i,a,v);else for(var S=e.length-1;S>=0;S--)(u=e[S])&&(c=(p<3?u(c):p>3?u(i,a,c):u(i,a))||c);return p>3&&c&&Object.defineProperty(i,a,c),c},_=this&&this.__param||function(e,i){return function(a,v){i(a,v,e)}};Object.defineProperty(r,"__esModule",{value:!0}),r.AccessibilityManager=void 0;const n=o(9042),d=o(9924),f=o(844),g=o(4725),h=o(2585),t=o(3656);let s=r.AccessibilityManager=class extends f.Disposable{constructor(e,i,a,v){super(),this._terminal=e,this._coreBrowserService=a,this._renderService=v,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 u=0;uthis._handleBoundaryFocus(u,0),this._bottomBoundaryFocusListener=u=>this._handleBoundaryFocus(u,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 d.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((u=>this._handleResize(u.rows)))),this.register(this._terminal.onRender((u=>this._refreshRows(u.start,u.end)))),this.register(this._terminal.onScroll((()=>this._refreshRows()))),this.register(this._terminal.onA11yChar((u=>this._handleChar(u)))),this.register(this._terminal.onLineFeed((()=>this._handleChar(` -`)))),this.register(this._terminal.onA11yTab((u=>this._handleTab(u)))),this.register(this._terminal.onKey((u=>this._handleKey(u.key)))),this.register(this._terminal.onBlur((()=>this._clearLiveRegion()))),this.register(this._renderService.onDimensionsChange((()=>this._refreshRowsDimensions()))),this.register((0,t.addDisposableDomListener)(document,"selectionchange",(()=>this._handleSelectionChange()))),this.register(this._coreBrowserService.onDprChange((()=>this._refreshRowsDimensions()))),this._refreshRows(),this.register((0,f.toDisposable)((()=>{this._accessibilityContainer.remove(),this._rowElements.length=0})))}_handleTab(e){for(let i=0;i0?this._charsToConsume.shift()!==e&&(this._charsToAnnounce+=e):this._charsToAnnounce+=e,e===` -`&&(this._liveRegionLineCount++,this._liveRegionLineCount===21&&(this._liveRegion.textContent+=n.tooMuchOutput)))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0}_handleKey(e){this._clearLiveRegion(),new RegExp("\\p{Control}","u").test(e)||this._charsToConsume.push(e)}_refreshRows(e,i){this._liveRegionDebouncer.refresh(e,i,this._terminal.rows)}_renderRows(e,i){const a=this._terminal.buffer,v=a.lines.length.toString();for(let u=e;u<=i;u++){const p=a.lines.get(a.ydisp+u),c=[],S=p?.translateToString(!0,void 0,void 0,c)||"",E=(a.ydisp+u+1).toString(),k=this._rowElements[u];k&&(S.length===0?(k.innerText=" ",this._rowColumns.set(k,[0,1])):(k.textContent=S,this._rowColumns.set(k,c)),k.setAttribute("aria-posinset",E),k.setAttribute("aria-setsize",v))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(e,i){const a=e.target,v=this._rowElements[i===0?1:this._rowElements.length-2];if(a.getAttribute("aria-posinset")===(i===0?"1":`${this._terminal.buffer.lines.length}`)||e.relatedTarget!==v)return;let u,p;if(i===0?(u=a,p=this._rowElements.pop(),this._rowContainer.removeChild(p)):(u=this._rowElements.shift(),p=a,this._rowContainer.removeChild(u)),u.removeEventListener("focus",this._topBoundaryFocusListener),p.removeEventListener("focus",this._bottomBoundaryFocusListener),i===0){const c=this._createAccessibilityTreeNode();this._rowElements.unshift(c),this._rowContainer.insertAdjacentElement("afterbegin",c)}else{const c=this._createAccessibilityTreeNode();this._rowElements.push(c),this._rowContainer.appendChild(c)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(i===0?-1:1),this._rowElements[i===0?1:this._rowElements.length-2].focus(),e.preventDefault(),e.stopImmediatePropagation()}_handleSelectionChange(){if(this._rowElements.length===0)return;const e=document.getSelection();if(!e)return;if(e.isCollapsed)return void(this._rowContainer.contains(e.anchorNode)&&this._terminal.clearSelection());if(!e.anchorNode||!e.focusNode)return void console.error("anchorNode and/or focusNode are null");let i={node:e.anchorNode,offset:e.anchorOffset},a={node:e.focusNode,offset:e.focusOffset};if((i.node.compareDocumentPosition(a.node)&Node.DOCUMENT_POSITION_PRECEDING||i.node===a.node&&i.offset>a.offset)&&([i,a]=[a,i]),i.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(i={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(i.node))return;const v=this._rowElements.slice(-1)[0];if(a.node.compareDocumentPosition(v)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(a={node:v,offset:v.textContent?.length??0}),!this._rowContainer.contains(a.node))return;const u=({node:S,offset:E})=>{const k=S instanceof Text?S.parentNode:S;let L=parseInt(k?.getAttribute("aria-posinset"),10)-1;if(isNaN(L))return console.warn("row is invalid. Race condition?"),null;const w=this._rowColumns.get(k);if(!w)return console.warn("columns is null. Race condition?"),null;let A=E=this._terminal.cols&&(++L,A=0),{row:L,column:A}},p=u(i),c=u(a);if(p&&c){if(p.row>c.row||p.row===c.row&&p.column>=c.column)throw new Error("invalid range");this._terminal.select(p.column,p.row,(c.row-p.row)*this._terminal.cols-p.column+c.column)}}_handleResize(e){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let i=this._rowContainer.children.length;ie;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){const e=this._coreBrowserService.mainDocument.createElement("div");return e.setAttribute("role","listitem"),e.tabIndex=-1,this._refreshRowDimensions(e),e}_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 e=0;e{function o(d){return d.replace(/\r?\n/g,"\r")}function l(d,f){return f?"\x1B[200~"+d+"\x1B[201~":d}function _(d,f,g,h){d=l(d=o(d),g.decPrivateModes.bracketedPasteMode&&h.rawOptions.ignoreBracketedPasteMode!==!0),g.triggerDataEvent(d,!0),f.value=""}function n(d,f,g){const h=g.getBoundingClientRect(),t=d.clientX-h.left-10,s=d.clientY-h.top-10;f.style.width="20px",f.style.height="20px",f.style.left=`${t}px`,f.style.top=`${s}px`,f.style.zIndex="1000",f.focus()}Object.defineProperty(r,"__esModule",{value:!0}),r.rightClickHandler=r.moveTextAreaUnderMouseCursor=r.paste=r.handlePasteEvent=r.copyHandler=r.bracketTextForPaste=r.prepareTextForTerminal=void 0,r.prepareTextForTerminal=o,r.bracketTextForPaste=l,r.copyHandler=function(d,f){d.clipboardData&&d.clipboardData.setData("text/plain",f.selectionText),d.preventDefault()},r.handlePasteEvent=function(d,f,g,h){d.stopPropagation(),d.clipboardData&&_(d.clipboardData.getData("text/plain"),f,g,h)},r.paste=_,r.moveTextAreaUnderMouseCursor=n,r.rightClickHandler=function(d,f,g,h,t){n(d,f,g),t&&h.rightClickSelect(d),f.value=h.selectionText,f.select()}},7239:(x,r,o)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.ColorContrastCache=void 0;const l=o(1505);r.ColorContrastCache=class{constructor(){this._color=new l.TwoKeyMap,this._css=new l.TwoKeyMap}setCss(_,n,d){this._css.set(_,n,d)}getCss(_,n){return this._css.get(_,n)}setColor(_,n,d){this._color.set(_,n,d)}getColor(_,n){return this._color.get(_,n)}clear(){this._color.clear(),this._css.clear()}}},3656:(x,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.addDisposableDomListener=void 0,r.addDisposableDomListener=function(o,l,_,n){o.addEventListener(l,_,n);let d=!1;return{dispose:()=>{d||(d=!0,o.removeEventListener(l,_,n))}}}},3551:function(x,r,o){var l=this&&this.__decorate||function(s,e,i,a){var v,u=arguments.length,p=u<3?e:a===null?a=Object.getOwnPropertyDescriptor(e,i):a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")p=Reflect.decorate(s,e,i,a);else for(var c=s.length-1;c>=0;c--)(v=s[c])&&(p=(u<3?v(p):u>3?v(e,i,p):v(e,i))||p);return u>3&&p&&Object.defineProperty(e,i,p),p},_=this&&this.__param||function(s,e){return function(i,a){e(i,a,s)}};Object.defineProperty(r,"__esModule",{value:!0}),r.Linkifier=void 0;const n=o(3656),d=o(8460),f=o(844),g=o(2585),h=o(4725);let t=r.Linkifier=class extends f.Disposable{get currentLink(){return this._currentLink}constructor(s,e,i,a,v){super(),this._element=s,this._mouseService=e,this._renderService=i,this._bufferService=a,this._linkProviderService=v,this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this.register(new d.EventEmitter),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this.register(new d.EventEmitter),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this.register((0,f.getDisposeArrayDisposable)(this._linkCacheDisposables)),this.register((0,f.toDisposable)((()=>{this._lastMouseEvent=void 0,this._activeProviderReplies?.clear()}))),this.register(this._bufferService.onResize((()=>{this._clearCurrentLink(),this._wasResized=!0}))),this.register((0,n.addDisposableDomListener)(this._element,"mouseleave",(()=>{this._isMouseOut=!0,this._clearCurrentLink()}))),this.register((0,n.addDisposableDomListener)(this._element,"mousemove",this._handleMouseMove.bind(this))),this.register((0,n.addDisposableDomListener)(this._element,"mousedown",this._handleMouseDown.bind(this))),this.register((0,n.addDisposableDomListener)(this._element,"mouseup",this._handleMouseUp.bind(this)))}_handleMouseMove(s){this._lastMouseEvent=s;const e=this._positionFromMouseEvent(s,this._element,this._mouseService);if(!e)return;this._isMouseOut=!1;const i=s.composedPath();for(let a=0;a{a?.forEach((v=>{v.link.dispose&&v.link.dispose()}))})),this._activeProviderReplies=new Map,this._activeLine=s.y);let i=!1;for(const[a,v]of this._linkProviderService.linkProviders.entries())e?this._activeProviderReplies?.get(a)&&(i=this._checkLinkProviderResult(a,s,i)):v.provideLinks(s.y,(u=>{if(this._isMouseOut)return;const p=u?.map((c=>({link:c})));this._activeProviderReplies?.set(a,p),i=this._checkLinkProviderResult(a,s,i),this._activeProviderReplies?.size===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(s.y,this._activeProviderReplies)}))}_removeIntersectingLinks(s,e){const i=new Set;for(let a=0;as?this._bufferService.cols:p.link.range.end.x;for(let E=c;E<=S;E++){if(i.has(E)){v.splice(u--,1);break}i.add(E)}}}}_checkLinkProviderResult(s,e,i){if(!this._activeProviderReplies)return i;const a=this._activeProviderReplies.get(s);let v=!1;for(let u=0;uthis._linkAtPosition(p.link,e)));u&&(i=!0,this._handleNewLink(u))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!i)for(let u=0;uthis._linkAtPosition(c.link,e)));if(p){i=!0,this._handleNewLink(p);break}}return i}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(s){if(!this._currentLink)return;const e=this._positionFromMouseEvent(s,this._element,this._mouseService);e&&this._mouseDownLink===this._currentLink&&this._linkAtPosition(this._currentLink.link,e)&&this._currentLink.link.activate(s,this._currentLink.link.text)}_clearCurrentLink(s,e){this._currentLink&&this._lastMouseEvent&&(!s||!e||this._currentLink.link.range.start.y>=s&&this._currentLink.link.range.end.y<=e)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,(0,f.disposeArray)(this._linkCacheDisposables))}_handleNewLink(s){if(!this._lastMouseEvent)return;const e=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);e&&this._linkAtPosition(s.link,e)&&(this._currentLink=s,this._currentLink.state={decorations:{underline:s.link.decorations===void 0||s.link.decorations.underline,pointerCursor:s.link.decorations===void 0||s.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,s.link,this._lastMouseEvent),s.link.decorations={},Object.defineProperties(s.link.decorations,{pointerCursor:{get:()=>this._currentLink?.state?.decorations.pointerCursor,set:i=>{this._currentLink?.state&&this._currentLink.state.decorations.pointerCursor!==i&&(this._currentLink.state.decorations.pointerCursor=i,this._currentLink.state.isHovered&&this._element.classList.toggle("xterm-cursor-pointer",i))}},underline:{get:()=>this._currentLink?.state?.decorations.underline,set:i=>{this._currentLink?.state&&this._currentLink?.state?.decorations.underline!==i&&(this._currentLink.state.decorations.underline=i,this._currentLink.state.isHovered&&this._fireUnderlineEvent(s.link,i))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange((i=>{if(!this._currentLink)return;const a=i.start===0?0:i.start+1+this._bufferService.buffer.ydisp,v=this._bufferService.buffer.ydisp+1+i.end;if(this._currentLink.link.range.start.y>=a&&this._currentLink.link.range.end.y<=v&&(this._clearCurrentLink(a,v),this._lastMouseEvent)){const u=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);u&&this._askForLink(u,!1)}}))))}_linkHover(s,e,i){this._currentLink?.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(e,!0),this._currentLink.state.decorations.pointerCursor&&s.classList.add("xterm-cursor-pointer")),e.hover&&e.hover(i,e.text)}_fireUnderlineEvent(s,e){const i=s.range,a=this._bufferService.buffer.ydisp,v=this._createLinkUnderlineEvent(i.start.x-1,i.start.y-a-1,i.end.x,i.end.y-a-1,void 0);(e?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(v)}_linkLeave(s,e,i){this._currentLink?.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(e,!1),this._currentLink.state.decorations.pointerCursor&&s.classList.remove("xterm-cursor-pointer")),e.leave&&e.leave(i,e.text)}_linkAtPosition(s,e){const i=s.range.start.y*this._bufferService.cols+s.range.start.x,a=s.range.end.y*this._bufferService.cols+s.range.end.x,v=e.y*this._bufferService.cols+e.x;return i<=v&&v<=a}_positionFromMouseEvent(s,e,i){const a=i.getCoords(s,e,this._bufferService.cols,this._bufferService.rows);if(a)return{x:a[0],y:a[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(s,e,i,a,v){return{x1:s,y1:e,x2:i,y2:a,cols:this._bufferService.cols,fg:v}}};r.Linkifier=t=l([_(1,h.IMouseService),_(2,h.IRenderService),_(3,g.IBufferService),_(4,h.ILinkProviderService)],t)},9042:(x,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.tooMuchOutput=r.promptLabel=void 0,r.promptLabel="Terminal input",r.tooMuchOutput="Too much output to announce, navigate to rows manually to read"},3730:function(x,r,o){var l=this&&this.__decorate||function(h,t,s,e){var i,a=arguments.length,v=a<3?t:e===null?e=Object.getOwnPropertyDescriptor(t,s):e;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")v=Reflect.decorate(h,t,s,e);else for(var u=h.length-1;u>=0;u--)(i=h[u])&&(v=(a<3?i(v):a>3?i(t,s,v):i(t,s))||v);return a>3&&v&&Object.defineProperty(t,s,v),v},_=this&&this.__param||function(h,t){return function(s,e){t(s,e,h)}};Object.defineProperty(r,"__esModule",{value:!0}),r.OscLinkProvider=void 0;const n=o(511),d=o(2585);let f=r.OscLinkProvider=class{constructor(h,t,s){this._bufferService=h,this._optionsService=t,this._oscLinkService=s}provideLinks(h,t){const s=this._bufferService.buffer.lines.get(h-1);if(!s)return void t(void 0);const e=[],i=this._optionsService.rawOptions.linkHandler,a=new n.CellData,v=s.getTrimmedLength();let u=-1,p=-1,c=!1;for(let S=0;Si?i.activate(w,A,k):g(0,A),hover:(w,A)=>i?.hover?.(w,A,k),leave:(w,A)=>i?.leave?.(w,A,k)})}c=!1,a.hasExtendedAttrs()&&a.extended.urlId?(p=S,u=a.extended.urlId):(p=-1,u=-1)}}t(e)}};function g(h,t){if(confirm(`Do you want to navigate to ${t}? - -WARNING: This link could potentially be dangerous`)){const s=window.open();if(s){try{s.opener=null}catch{}s.location.href=t}else console.warn("Opening link blocked as opener could not be cleared")}}r.OscLinkProvider=f=l([_(0,d.IBufferService),_(1,d.IOptionsService),_(2,d.IOscLinkService)],f)},6193:(x,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.RenderDebouncer=void 0,r.RenderDebouncer=class{constructor(o,l){this._renderCallback=o,this._coreBrowserService=l,this._refreshCallbacks=[]}dispose(){this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}addRefreshCallback(o){return this._refreshCallbacks.push(o),this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh()))),this._animationFrame}refresh(o,l,_){this._rowCount=_,o=o!==void 0?o:0,l=l!==void 0?l:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,o):o,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,l):l,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 o=Math.max(this._rowStart,0),l=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(o,l),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(const o of this._refreshCallbacks)o(0);this._refreshCallbacks=[]}}},3236:(x,r,o)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.Terminal=void 0;const l=o(3614),_=o(3656),n=o(3551),d=o(9042),f=o(3730),g=o(1680),h=o(3107),t=o(5744),s=o(2950),e=o(1296),i=o(428),a=o(4269),v=o(5114),u=o(8934),p=o(3230),c=o(9312),S=o(4725),E=o(6731),k=o(8055),L=o(8969),w=o(8460),A=o(844),O=o(6114),I=o(8437),W=o(2584),B=o(7399),m=o(5941),b=o(9074),y=o(2585),D=o(5435),T=o(4567),H=o(779);class $ extends L.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(R={}){super(R),this.browser=O,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this.register(new A.MutableDisposable),this._onCursorMove=this.register(new w.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onKey=this.register(new w.EventEmitter),this.onKey=this._onKey.event,this._onRender=this.register(new w.EventEmitter),this.onRender=this._onRender.event,this._onSelectionChange=this.register(new w.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this.register(new w.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onBell=this.register(new w.EventEmitter),this.onBell=this._onBell.event,this._onFocus=this.register(new w.EventEmitter),this._onBlur=this.register(new w.EventEmitter),this._onA11yCharEmitter=this.register(new w.EventEmitter),this._onA11yTabEmitter=this.register(new w.EventEmitter),this._onWillOpen=this.register(new w.EventEmitter),this._setup(),this._decorationService=this._instantiationService.createInstance(b.DecorationService),this._instantiationService.setService(y.IDecorationService,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(H.LinkProviderService),this._instantiationService.setService(S.ILinkProviderService,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(f.OscLinkProvider)),this.register(this._inputHandler.onRequestBell((()=>this._onBell.fire()))),this.register(this._inputHandler.onRequestRefreshRows(((C,M)=>this.refresh(C,M)))),this.register(this._inputHandler.onRequestSendFocus((()=>this._reportFocus()))),this.register(this._inputHandler.onRequestReset((()=>this.reset()))),this.register(this._inputHandler.onRequestWindowsOptionsReport((C=>this._reportWindowsOptions(C)))),this.register(this._inputHandler.onColor((C=>this._handleColorEvent(C)))),this.register((0,w.forwardEvent)(this._inputHandler.onCursorMove,this._onCursorMove)),this.register((0,w.forwardEvent)(this._inputHandler.onTitleChange,this._onTitleChange)),this.register((0,w.forwardEvent)(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this.register((0,w.forwardEvent)(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this.register(this._bufferService.onResize((C=>this._afterResize(C.cols,C.rows)))),this.register((0,A.toDisposable)((()=>{this._customKeyEventHandler=void 0,this.element?.parentNode?.removeChild(this.element)})))}_handleColorEvent(R){if(this._themeService)for(const C of R){let M,P="";switch(C.index){case 256:M="foreground",P="10";break;case 257:M="background",P="11";break;case 258:M="cursor",P="12";break;default:M="ansi",P="4;"+C.index}switch(C.type){case 0:const N=k.color.toColorRGB(M==="ansi"?this._themeService.colors.ansi[C.index]:this._themeService.colors[M]);this.coreService.triggerDataEvent(`${W.C0.ESC}]${P};${(0,m.toRgbString)(N)}${W.C1_ESCAPED.ST}`);break;case 1:if(M==="ansi")this._themeService.modifyColors((F=>F.ansi[C.index]=k.channels.toColor(...C.color)));else{const F=M;this._themeService.modifyColors((V=>V[F]=k.channels.toColor(...C.color)))}break;case 2:this._themeService.restoreColor(C.index)}}}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange(R){R?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(T.AccessibilityManager,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(R){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(W.C0.ESC+"[I"),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()}blur(){return this.textarea?.blur()}_handleTextAreaBlur(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(W.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 R=this.buffer.ybase+this.buffer.y,C=this.buffer.lines.get(R);if(!C)return;const M=Math.min(this.buffer.x,this.cols-1),P=this._renderService.dimensions.css.cell.height,N=C.getWidth(M),F=this._renderService.dimensions.css.cell.width*N,V=this.buffer.y*this._renderService.dimensions.css.cell.height,Q=M*this._renderService.dimensions.css.cell.width;this.textarea.style.left=Q+"px",this.textarea.style.top=V+"px",this.textarea.style.width=F+"px",this.textarea.style.height=P+"px",this.textarea.style.lineHeight=P+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this.register((0,_.addDisposableDomListener)(this.element,"copy",(C=>{this.hasSelection()&&(0,l.copyHandler)(C,this._selectionService)})));const R=C=>(0,l.handlePasteEvent)(C,this.textarea,this.coreService,this.optionsService);this.register((0,_.addDisposableDomListener)(this.textarea,"paste",R)),this.register((0,_.addDisposableDomListener)(this.element,"paste",R)),O.isFirefox?this.register((0,_.addDisposableDomListener)(this.element,"mousedown",(C=>{C.button===2&&(0,l.rightClickHandler)(C,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))):this.register((0,_.addDisposableDomListener)(this.element,"contextmenu",(C=>{(0,l.rightClickHandler)(C,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))),O.isLinux&&this.register((0,_.addDisposableDomListener)(this.element,"auxclick",(C=>{C.button===1&&(0,l.moveTextAreaUnderMouseCursor)(C,this.textarea,this.screenElement)})))}_bindKeys(){this.register((0,_.addDisposableDomListener)(this.textarea,"keyup",(R=>this._keyUp(R)),!0)),this.register((0,_.addDisposableDomListener)(this.textarea,"keydown",(R=>this._keyDown(R)),!0)),this.register((0,_.addDisposableDomListener)(this.textarea,"keypress",(R=>this._keyPress(R)),!0)),this.register((0,_.addDisposableDomListener)(this.textarea,"compositionstart",(()=>this._compositionHelper.compositionstart()))),this.register((0,_.addDisposableDomListener)(this.textarea,"compositionupdate",(R=>this._compositionHelper.compositionupdate(R)))),this.register((0,_.addDisposableDomListener)(this.textarea,"compositionend",(()=>this._compositionHelper.compositionend()))),this.register((0,_.addDisposableDomListener)(this.textarea,"input",(R=>this._inputEvent(R)),!0)),this.register(this.onRender((()=>this._compositionHelper.updateCompositionElements())))}open(R){if(!R)throw new Error("Terminal requires a parent element.");if(R.isConnected||this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"),this.element?.ownerDocument.defaultView&&this._coreBrowserService)return void(this.element.ownerDocument.defaultView!==this._coreBrowserService.window&&(this._coreBrowserService.window=this.element.ownerDocument.defaultView));this._document=R.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"),R.appendChild(this.element);const C=this._document.createDocumentFragment();this._viewportElement=this._document.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),C.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",(M=>this.updateCursorStyle(M)))),this._helperContainer=this._document.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),C.appendChild(this.screenElement),this.textarea=this._document.createElement("textarea"),this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",d.promptLabel),O.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(v.CoreBrowserService,this.textarea,R.ownerDocument.defaultView??window,this._document??typeof window<"u"?window.document:null)),this._instantiationService.setService(S.ICoreBrowserService,this._coreBrowserService),this.register((0,_.addDisposableDomListener)(this.textarea,"focus",(M=>this._handleTextAreaFocus(M)))),this.register((0,_.addDisposableDomListener)(this.textarea,"blur",(()=>this._handleTextAreaBlur()))),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(i.CharSizeService,this._document,this._helperContainer),this._instantiationService.setService(S.ICharSizeService,this._charSizeService),this._themeService=this._instantiationService.createInstance(E.ThemeService),this._instantiationService.setService(S.IThemeService,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(a.CharacterJoinerService),this._instantiationService.setService(S.ICharacterJoinerService,this._characterJoinerService),this._renderService=this.register(this._instantiationService.createInstance(p.RenderService,this.rows,this.screenElement)),this._instantiationService.setService(S.IRenderService,this._renderService),this.register(this._renderService.onRenderedViewportChange((M=>this._onRender.fire(M)))),this.onResize((M=>this._renderService.resize(M.cols,M.rows))),this._compositionView=this._document.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(s.CompositionHelper,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this._mouseService=this._instantiationService.createInstance(u.MouseService),this._instantiationService.setService(S.IMouseService,this._mouseService),this.linkifier=this.register(this._instantiationService.createInstance(n.Linkifier,this.screenElement)),this.element.appendChild(C);try{this._onWillOpen.fire(this.element)}catch{}this._renderService.hasRenderer()||this._renderService.setRenderer(this._createRenderer()),this.viewport=this._instantiationService.createInstance(g.Viewport,this._viewportElement,this._viewportScrollArea),this.viewport.onRequestScrollLines((M=>this.scrollLines(M.amount,M.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(c.SelectionService,this.element,this.screenElement,this.linkifier)),this._instantiationService.setService(S.ISelectionService,this._selectionService),this.register(this._selectionService.onRequestScrollLines((M=>this.scrollLines(M.amount,M.suppressScrollEvent)))),this.register(this._selectionService.onSelectionChange((()=>this._onSelectionChange.fire()))),this.register(this._selectionService.onRequestRedraw((M=>this._renderService.handleSelectionChanged(M.start,M.end,M.columnSelectMode)))),this.register(this._selectionService.onLinuxMouseSelection((M=>{this.textarea.value=M,this.textarea.focus(),this.textarea.select()}))),this.register(this._onScroll.event((M=>{this.viewport.syncScrollArea(),this._selectionService.refresh()}))),this.register((0,_.addDisposableDomListener)(this._viewportElement,"scroll",(()=>this._selectionService.refresh()))),this.register(this._instantiationService.createInstance(h.BufferDecorationRenderer,this.screenElement)),this.register((0,_.addDisposableDomListener)(this.element,"mousedown",(M=>this._selectionService.handleMouseDown(M)))),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(T.AccessibilityManager,this)),this.register(this.optionsService.onSpecificOptionChange("screenReaderMode",(M=>this._handleScreenReaderModeOptionChange(M)))),this.options.overviewRulerWidth&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(t.OverviewRulerRenderer,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRulerWidth",(M=>{!this._overviewRulerRenderer&&M&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(t.OverviewRulerRenderer,this._viewportElement,this.screenElement)))})),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(e.DomRenderer,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){const R=this,C=this.element;function M(F){const V=R._mouseService.getMouseReportCoords(F,R.screenElement);if(!V)return!1;let Q,ee;switch(F.overrideType||F.type){case"mousemove":ee=32,F.buttons===void 0?(Q=3,F.button!==void 0&&(Q=F.button<3?F.button:3)):Q=1&F.buttons?0:4&F.buttons?1:2&F.buttons?2:3;break;case"mouseup":ee=0,Q=F.button<3?F.button:3;break;case"mousedown":ee=1,Q=F.button<3?F.button:3;break;case"wheel":if(R._customWheelEventHandler&&R._customWheelEventHandler(F)===!1||R.viewport.getLinesScrolled(F)===0)return!1;ee=F.deltaY<0?0:1,Q=4;break;default:return!1}return!(ee===void 0||Q===void 0||Q>4)&&R.coreMouseService.triggerMouseEvent({col:V.col,row:V.row,x:V.x,y:V.y,button:Q,action:ee,ctrl:F.ctrlKey,alt:F.altKey,shift:F.shiftKey})}const P={mouseup:null,wheel:null,mousedrag:null,mousemove:null},N={mouseup:F=>(M(F),F.buttons||(this._document.removeEventListener("mouseup",P.mouseup),P.mousedrag&&this._document.removeEventListener("mousemove",P.mousedrag)),this.cancel(F)),wheel:F=>(M(F),this.cancel(F,!0)),mousedrag:F=>{F.buttons&&M(F)},mousemove:F=>{F.buttons||M(F)}};this.register(this.coreMouseService.onProtocolChange((F=>{F?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(F)),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&F?P.mousemove||(C.addEventListener("mousemove",N.mousemove),P.mousemove=N.mousemove):(C.removeEventListener("mousemove",P.mousemove),P.mousemove=null),16&F?P.wheel||(C.addEventListener("wheel",N.wheel,{passive:!1}),P.wheel=N.wheel):(C.removeEventListener("wheel",P.wheel),P.wheel=null),2&F?P.mouseup||(P.mouseup=N.mouseup):(this._document.removeEventListener("mouseup",P.mouseup),P.mouseup=null),4&F?P.mousedrag||(P.mousedrag=N.mousedrag):(this._document.removeEventListener("mousemove",P.mousedrag),P.mousedrag=null)}))),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this.register((0,_.addDisposableDomListener)(C,"mousedown",(F=>{if(F.preventDefault(),this.focus(),this.coreMouseService.areMouseEventsActive&&!this._selectionService.shouldForceSelection(F))return M(F),P.mouseup&&this._document.addEventListener("mouseup",P.mouseup),P.mousedrag&&this._document.addEventListener("mousemove",P.mousedrag),this.cancel(F)}))),this.register((0,_.addDisposableDomListener)(C,"wheel",(F=>{if(!P.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler(F)===!1)return!1;if(!this.buffer.hasScrollback){const V=this.viewport.getLinesScrolled(F);if(V===0)return;const Q=W.C0.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(F.deltaY<0?"A":"B");let ee="";for(let ie=0;ie{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchStart(F),this.cancel(F)}),{passive:!0})),this.register((0,_.addDisposableDomListener)(C,"touchmove",(F=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchMove(F)?void 0:this.cancel(F)}),{passive:!1}))}refresh(R,C){this._renderService?.refreshRows(R,C)}updateCursorStyle(R){this._selectionService?.shouldColumnSelect(R)?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(R,C,M=0){M===1?(super.scrollLines(R,C,M),this.refresh(0,this.rows-1)):this.viewport?.scrollLines(R)}paste(R){(0,l.paste)(R,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(R){this._customKeyEventHandler=R}attachCustomWheelEventHandler(R){this._customWheelEventHandler=R}registerLinkProvider(R){return this._linkProviderService.registerLinkProvider(R)}registerCharacterJoiner(R){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");const C=this._characterJoinerService.register(R);return this.refresh(0,this.rows-1),C}deregisterCharacterJoiner(R){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");this._characterJoinerService.deregister(R)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(R){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+R)}registerDecoration(R){return this._decorationService.registerDecoration(R)}hasSelection(){return!!this._selectionService&&this._selectionService.hasSelection}select(R,C,M){this._selectionService.setSelection(R,C,M)}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(){this._selectionService?.clearSelection()}selectAll(){this._selectionService?.selectAll()}selectLines(R,C){this._selectionService?.selectLines(R,C)}_keyDown(R){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(R)===!1)return!1;const C=this.browser.isMac&&this.options.macOptionIsMeta&&R.altKey;if(!C&&!this._compositionHelper.keydown(R))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(),!1;C||R.key!=="Dead"&&R.key!=="AltGraph"||(this._unprocessedDeadKey=!0);const M=(0,B.evaluateKeyboardEvent)(R,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(R),M.type===3||M.type===2){const P=this.rows-1;return this.scrollLines(M.type===2?-P:P),this.cancel(R,!0)}return M.type===1&&this.selectAll(),!!this._isThirdLevelShift(this.browser,R)||(M.cancel&&this.cancel(R,!0),!M.key||!!(R.key&&!R.ctrlKey&&!R.altKey&&!R.metaKey&&R.key.length===1&&R.key.charCodeAt(0)>=65&&R.key.charCodeAt(0)<=90)||(this._unprocessedDeadKey?(this._unprocessedDeadKey=!1,!0):(M.key!==W.C0.ETX&&M.key!==W.C0.CR||(this.textarea.value=""),this._onKey.fire({key:M.key,domEvent:R}),this._showCursor(),this.coreService.triggerDataEvent(M.key,!0),!this.optionsService.rawOptions.screenReaderMode||R.altKey||R.ctrlKey?this.cancel(R,!0):void(this._keyDownHandled=!0))))}_isThirdLevelShift(R,C){const M=R.isMac&&!this.options.macOptionIsMeta&&C.altKey&&!C.ctrlKey&&!C.metaKey||R.isWindows&&C.altKey&&C.ctrlKey&&!C.metaKey||R.isWindows&&C.getModifierState("AltGraph");return C.type==="keypress"?M:M&&(!C.keyCode||C.keyCode>47)}_keyUp(R){this._keyDownSeen=!1,this._customKeyEventHandler&&this._customKeyEventHandler(R)===!1||((function(C){return C.keyCode===16||C.keyCode===17||C.keyCode===18})(R)||this.focus(),this.updateCursorStyle(R),this._keyPressHandled=!1)}_keyPress(R){let C;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(R)===!1)return!1;if(this.cancel(R),R.charCode)C=R.charCode;else if(R.which===null||R.which===void 0)C=R.keyCode;else{if(R.which===0||R.charCode===0)return!1;C=R.which}return!(!C||(R.altKey||R.ctrlKey||R.metaKey)&&!this._isThirdLevelShift(this.browser,R)||(C=String.fromCharCode(C),this._onKey.fire({key:C,domEvent:R}),this._showCursor(),this.coreService.triggerDataEvent(C,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,0))}_inputEvent(R){if(R.data&&R.inputType==="insertText"&&(!R.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;const C=R.data;return this.coreService.triggerDataEvent(C,!0),this.cancel(R),!0}return!1}resize(R,C){R!==this.cols||C!==this.rows?super.resize(R,C):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure()}_afterResize(R,C){this._charSizeService?.measure(),this.viewport?.syncScrollArea(!0)}clear(){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 R=1;R{Object.defineProperty(r,"__esModule",{value:!0}),r.TimeBasedDebouncer=void 0,r.TimeBasedDebouncer=class{constructor(o,l=1e3){this._renderCallback=o,this._debounceThresholdMS=l,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(o,l,_){this._rowCount=_,o=o!==void 0?o:0,l=l!==void 0?l:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,o):o,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,l):l;const n=Date.now();if(n-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=n,this._innerRefresh();else if(!this._additionalRefreshRequested){const d=n-this._lastRefreshMs,f=this._debounceThresholdMS-d;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout((()=>{this._lastRefreshMs=Date.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0}),f)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;const o=Math.max(this._rowStart,0),l=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(o,l)}}},1680:function(x,r,o){var l=this&&this.__decorate||function(s,e,i,a){var v,u=arguments.length,p=u<3?e:a===null?a=Object.getOwnPropertyDescriptor(e,i):a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")p=Reflect.decorate(s,e,i,a);else for(var c=s.length-1;c>=0;c--)(v=s[c])&&(p=(u<3?v(p):u>3?v(e,i,p):v(e,i))||p);return u>3&&p&&Object.defineProperty(e,i,p),p},_=this&&this.__param||function(s,e){return function(i,a){e(i,a,s)}};Object.defineProperty(r,"__esModule",{value:!0}),r.Viewport=void 0;const n=o(3656),d=o(4725),f=o(8460),g=o(844),h=o(2585);let t=r.Viewport=class extends g.Disposable{constructor(s,e,i,a,v,u,p,c){super(),this._viewportElement=s,this._scrollArea=e,this._bufferService=i,this._optionsService=a,this._charSizeService=v,this._renderService=u,this._coreBrowserService=p,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 f.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this.scrollBarWidth=this._viewportElement.offsetWidth-this._scrollArea.offsetWidth||15,this.register((0,n.addDisposableDomListener)(this._viewportElement,"scroll",this._handleScroll.bind(this))),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((S=>this._activeBuffer=S.activeBuffer))),this._renderDimensions=this._renderService.dimensions,this.register(this._renderService.onDimensionsChange((S=>this._renderDimensions=S))),this._handleThemeChange(c.colors),this.register(c.onChangeColors((S=>this._handleThemeChange(S)))),this.register(this._optionsService.onSpecificOptionChange("scrollback",(()=>this.syncScrollArea()))),setTimeout((()=>this.syncScrollArea()))}_handleThemeChange(s){this._viewportElement.style.backgroundColor=s.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(s){if(s)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 e=Math.round(this._currentRowHeight*this._lastRecordedBufferLength)+(this._lastRecordedViewportHeight-this._renderDimensions.css.canvas.height);this._lastRecordedBufferHeight!==e&&(this._lastRecordedBufferHeight=e,this._scrollArea.style.height=this._lastRecordedBufferHeight+"px")}const s=this._bufferService.buffer.ydisp*this._currentRowHeight;this._viewportElement.scrollTop!==s&&(this._ignoreNextScrollEvent=!0,this._viewportElement.scrollTop=s),this._refreshAnimationFrame=null}syncScrollArea(s=!1){if(this._lastRecordedBufferLength!==this._bufferService.buffer.lines.length)return this._lastRecordedBufferLength=this._bufferService.buffer.lines.length,void this._refresh(s);this._lastRecordedViewportHeight===this._renderService.dimensions.css.canvas.height&&this._lastScrollTop===this._activeBuffer.ydisp*this._currentRowHeight&&this._renderDimensions.device.cell.height===this._currentDeviceCellHeight||this._refresh(s)}_handleScroll(s){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 e=Math.round(this._lastScrollTop/this._currentRowHeight)-this._bufferService.buffer.ydisp;this._onRequestScrollLines.fire({amount:e,suppressScrollEvent:!0})}_smoothScroll(){if(this._isDisposed||this._smoothScrollState.origin===-1||this._smoothScrollState.target===-1)return;const s=this._smoothScrollPercent();this._viewportElement.scrollTop=this._smoothScrollState.origin+Math.round(s*(this._smoothScrollState.target-this._smoothScrollState.origin)),s<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(s,e){const i=this._viewportElement.scrollTop+this._lastRecordedViewportHeight;return!(e<0&&this._viewportElement.scrollTop!==0||e>0&&i0&&(i=k),a=""}}return{bufferElements:v,cursorElement:i}}getLinesScrolled(s){if(s.deltaY===0||s.shiftKey)return 0;let e=this._applyScrollModifier(s.deltaY,s);return s.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(e/=this._currentRowHeight+0,this._wheelPartialScroll+=e,e=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):s.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(e*=this._bufferService.rows),e}_applyScrollModifier(s,e){const i=this._optionsService.rawOptions.fastScrollModifier;return i==="alt"&&e.altKey||i==="ctrl"&&e.ctrlKey||i==="shift"&&e.shiftKey?s*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:s*this._optionsService.rawOptions.scrollSensitivity}handleTouchStart(s){this._lastTouchY=s.touches[0].pageY}handleTouchMove(s){const e=this._lastTouchY-s.touches[0].pageY;return this._lastTouchY=s.touches[0].pageY,e!==0&&(this._viewportElement.scrollTop+=e,this._bubbleScroll(s,e))}};r.Viewport=t=l([_(2,h.IBufferService),_(3,h.IOptionsService),_(4,d.ICharSizeService),_(5,d.IRenderService),_(6,d.ICoreBrowserService),_(7,d.IThemeService)],t)},3107:function(x,r,o){var l=this&&this.__decorate||function(h,t,s,e){var i,a=arguments.length,v=a<3?t:e===null?e=Object.getOwnPropertyDescriptor(t,s):e;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")v=Reflect.decorate(h,t,s,e);else for(var u=h.length-1;u>=0;u--)(i=h[u])&&(v=(a<3?i(v):a>3?i(t,s,v):i(t,s))||v);return a>3&&v&&Object.defineProperty(t,s,v),v},_=this&&this.__param||function(h,t){return function(s,e){t(s,e,h)}};Object.defineProperty(r,"__esModule",{value:!0}),r.BufferDecorationRenderer=void 0;const n=o(4725),d=o(844),f=o(2585);let g=r.BufferDecorationRenderer=class extends d.Disposable{constructor(h,t,s,e,i){super(),this._screenElement=h,this._bufferService=t,this._coreBrowserService=s,this._decorationService=e,this._renderService=i,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((a=>this._removeDecoration(a)))),this.register((0,d.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 h of this._decorationService.decorations)this._renderDecoration(h);this._dimensionsChanged=!1}_renderDecoration(h){this._refreshStyle(h),this._dimensionsChanged&&this._refreshXPosition(h)}_createElement(h){const t=this._coreBrowserService.mainDocument.createElement("div");t.classList.add("xterm-decoration"),t.classList.toggle("xterm-decoration-top-layer",h?.options?.layer==="top"),t.style.width=`${Math.round((h.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,t.style.height=(h.options.height||1)*this._renderService.dimensions.css.cell.height+"px",t.style.top=(h.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height+"px",t.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;const s=h.options.x??0;return s&&s>this._bufferService.cols&&(t.style.display="none"),this._refreshXPosition(h,t),t}_refreshStyle(h){const t=h.marker.line-this._bufferService.buffers.active.ydisp;if(t<0||t>=this._bufferService.rows)h.element&&(h.element.style.display="none",h.onRenderEmitter.fire(h.element));else{let s=this._decorationElements.get(h);s||(s=this._createElement(h),h.element=s,this._decorationElements.set(h,s),this._container.appendChild(s),h.onDispose((()=>{this._decorationElements.delete(h),s.remove()}))),s.style.top=t*this._renderService.dimensions.css.cell.height+"px",s.style.display=this._altBufferIsActive?"none":"block",h.onRenderEmitter.fire(s)}}_refreshXPosition(h,t=h.element){if(!t)return;const s=h.options.x??0;(h.options.anchor||"left")==="right"?t.style.right=s?s*this._renderService.dimensions.css.cell.width+"px":"":t.style.left=s?s*this._renderService.dimensions.css.cell.width+"px":""}_removeDecoration(h){this._decorationElements.get(h)?.remove(),this._decorationElements.delete(h),h.dispose()}};r.BufferDecorationRenderer=g=l([_(1,f.IBufferService),_(2,n.ICoreBrowserService),_(3,f.IDecorationService),_(4,n.IRenderService)],g)},5871:(x,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.ColorZoneStore=void 0,r.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(o){if(o.options.overviewRulerOptions){for(const l of this._zones)if(l.color===o.options.overviewRulerOptions.color&&l.position===o.options.overviewRulerOptions.position){if(this._lineIntersectsZone(l,o.marker.line))return;if(this._lineAdjacentToZone(l,o.marker.line,o.options.overviewRulerOptions.position))return void this._addLineToZone(l,o.marker.line)}if(this._zonePoolIndex=o.startBufferLine&&l<=o.endBufferLine}_lineAdjacentToZone(o,l,_){return l>=o.startBufferLine-this._linePadding[_||"full"]&&l<=o.endBufferLine+this._linePadding[_||"full"]}_addLineToZone(o,l){o.startBufferLine=Math.min(o.startBufferLine,l),o.endBufferLine=Math.max(o.endBufferLine,l)}}},5744:function(x,r,o){var l=this&&this.__decorate||function(i,a,v,u){var p,c=arguments.length,S=c<3?a:u===null?u=Object.getOwnPropertyDescriptor(a,v):u;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")S=Reflect.decorate(i,a,v,u);else for(var E=i.length-1;E>=0;E--)(p=i[E])&&(S=(c<3?p(S):c>3?p(a,v,S):p(a,v))||S);return c>3&&S&&Object.defineProperty(a,v,S),S},_=this&&this.__param||function(i,a){return function(v,u){a(v,u,i)}};Object.defineProperty(r,"__esModule",{value:!0}),r.OverviewRulerRenderer=void 0;const n=o(5871),d=o(4725),f=o(844),g=o(2585),h={full:0,left:0,center:0,right:0},t={full:0,left:0,center:0,right:0},s={full:0,left:0,center:0,right:0};let e=r.OverviewRulerRenderer=class extends f.Disposable{get _width(){return this._optionsService.options.overviewRulerWidth||0}constructor(i,a,v,u,p,c,S){super(),this._viewportElement=i,this._screenElement=a,this._bufferService=v,this._decorationService=u,this._renderService=p,this._optionsService=c,this._coreBrowserService=S,this._colorZoneStore=new n.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(),this._viewportElement.parentElement?.insertBefore(this._canvas,this._viewportElement);const E=this._canvas.getContext("2d");if(!E)throw new Error("Ctx cannot be null");this._ctx=E,this._registerDecorationListeners(),this._registerBufferChangeListeners(),this._registerDimensionChangeListeners(),this.register((0,f.toDisposable)((()=>{this._canvas?.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 i=Math.floor(this._canvas.width/3),a=Math.ceil(this._canvas.width/3);t.full=this._canvas.width,t.left=i,t.center=a,t.right=i,this._refreshDrawHeightConstants(),s.full=0,s.left=0,s.center=t.left,s.right=t.left+t.center}_refreshDrawHeightConstants(){h.full=Math.round(2*this._coreBrowserService.dpr);const i=this._canvas.height/this._bufferService.buffer.lines.length,a=Math.round(Math.max(Math.min(i,12),6)*this._coreBrowserService.dpr);h.left=a,h.center=a,h.right=a}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*h.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*h.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*h.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*h.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 a of this._decorationService.decorations)this._colorZoneStore.addDecoration(a);this._ctx.lineWidth=1;const i=this._colorZoneStore.zones;for(const a of i)a.position!=="full"&&this._renderColorZone(a);for(const a of i)a.position==="full"&&this._renderColorZone(a);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderColorZone(i){this._ctx.fillStyle=i.color,this._ctx.fillRect(s[i.position||"full"],Math.round((this._canvas.height-1)*(i.startBufferLine/this._bufferService.buffers.active.lines.length)-h[i.position||"full"]/2),t[i.position||"full"],Math.round((this._canvas.height-1)*((i.endBufferLine-i.startBufferLine)/this._bufferService.buffers.active.lines.length)+h[i.position||"full"]))}_queueRefresh(i,a){this._shouldUpdateDimensions=i||this._shouldUpdateDimensions,this._shouldUpdateAnchor=a||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>{this._refreshDecorations(),this._animationFrame=void 0})))}};r.OverviewRulerRenderer=e=l([_(2,g.IBufferService),_(3,g.IDecorationService),_(4,d.IRenderService),_(5,g.IOptionsService),_(6,d.ICoreBrowserService)],e)},2950:function(x,r,o){var l=this&&this.__decorate||function(h,t,s,e){var i,a=arguments.length,v=a<3?t:e===null?e=Object.getOwnPropertyDescriptor(t,s):e;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")v=Reflect.decorate(h,t,s,e);else for(var u=h.length-1;u>=0;u--)(i=h[u])&&(v=(a<3?i(v):a>3?i(t,s,v):i(t,s))||v);return a>3&&v&&Object.defineProperty(t,s,v),v},_=this&&this.__param||function(h,t){return function(s,e){t(s,e,h)}};Object.defineProperty(r,"__esModule",{value:!0}),r.CompositionHelper=void 0;const n=o(4725),d=o(2585),f=o(2584);let g=r.CompositionHelper=class{get isComposing(){return this._isComposing}constructor(h,t,s,e,i,a){this._textarea=h,this._compositionView=t,this._bufferService=s,this._optionsService=e,this._coreService=i,this._renderService=a,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(h){this._compositionView.textContent=h.data,this.updateCompositionElements(),setTimeout((()=>{this._compositionPosition.end=this._textarea.value.length}),0)}compositionend(){this._finalizeComposition(!0)}keydown(h){if(this._isComposing||this._isSendingComposition){if(h.keyCode===229||h.keyCode===16||h.keyCode===17||h.keyCode===18)return!1;this._finalizeComposition(!1)}return h.keyCode!==229||(this._handleAnyTextareaChanges(),!1)}_finalizeComposition(h){if(this._compositionView.classList.remove("active"),this._isComposing=!1,h){const t={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout((()=>{if(this._isSendingComposition){let s;this._isSendingComposition=!1,t.start+=this._dataAlreadySent.length,s=this._isComposing?this._textarea.value.substring(t.start,t.end):this._textarea.value.substring(t.start),s.length>0&&this._coreService.triggerDataEvent(s,!0)}}),0)}else{this._isSendingComposition=!1;const t=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(t,!0)}}_handleAnyTextareaChanges(){const h=this._textarea.value;setTimeout((()=>{if(!this._isComposing){const t=this._textarea.value,s=t.replace(h,"");this._dataAlreadySent=s,t.length>h.length?this._coreService.triggerDataEvent(s,!0):t.lengththis.updateCompositionElements(!0)),0)}}};r.CompositionHelper=g=l([_(2,d.IBufferService),_(3,d.IOptionsService),_(4,d.ICoreService),_(5,n.IRenderService)],g)},9806:(x,r)=>{function o(l,_,n){const d=n.getBoundingClientRect(),f=l.getComputedStyle(n),g=parseInt(f.getPropertyValue("padding-left")),h=parseInt(f.getPropertyValue("padding-top"));return[_.clientX-d.left-g,_.clientY-d.top-h]}Object.defineProperty(r,"__esModule",{value:!0}),r.getCoords=r.getCoordsRelativeToElement=void 0,r.getCoordsRelativeToElement=o,r.getCoords=function(l,_,n,d,f,g,h,t,s){if(!g)return;const e=o(l,_,n);return e?(e[0]=Math.ceil((e[0]+(s?h/2:0))/h),e[1]=Math.ceil(e[1]/t),e[0]=Math.min(Math.max(e[0],1),d+(s?1:0)),e[1]=Math.min(Math.max(e[1],1),f),e):void 0}},9504:(x,r,o)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.moveToCellSequence=void 0;const l=o(2584);function _(t,s,e,i){const a=t-n(t,e),v=s-n(s,e),u=Math.abs(a-v)-(function(p,c,S){let E=0;const k=p-n(p,S),L=c-n(c,S);for(let w=0;w=0&&ts?"A":"B"}function f(t,s,e,i,a,v){let u=t,p=s,c="";for(;u!==e||p!==i;)u+=a?1:-1,a&&u>v.cols-1?(c+=v.buffer.translateBufferLineToString(p,!1,t,u),u=0,t=0,p++):!a&&u<0&&(c+=v.buffer.translateBufferLineToString(p,!1,0,t+1),u=v.cols-1,t=u,p--);return c+v.buffer.translateBufferLineToString(p,!1,t,u)}function g(t,s){const e=s?"O":"[";return l.C0.ESC+e+t}function h(t,s){t=Math.floor(t);let e="";for(let i=0;i0?k-n(k,L):S;const O=k,I=(function(W,B,m,b,y,D){let T;return T=_(m,b,y,D).length>0?b-n(b,y):B,W=m&&Tt?"D":"C",h(Math.abs(a-t),g(u,i));u=v>s?"D":"C";const p=Math.abs(v-s);return h((function(c,S){return S.cols-c})(v>s?t:a,e)+(p-1)*e.cols+1+((v>s?a:t)-1),g(u,i))}},1296:function(x,r,o){var l=this&&this.__decorate||function(w,A,O,I){var W,B=arguments.length,m=B<3?A:I===null?I=Object.getOwnPropertyDescriptor(A,O):I;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")m=Reflect.decorate(w,A,O,I);else for(var b=w.length-1;b>=0;b--)(W=w[b])&&(m=(B<3?W(m):B>3?W(A,O,m):W(A,O))||m);return B>3&&m&&Object.defineProperty(A,O,m),m},_=this&&this.__param||function(w,A){return function(O,I){A(O,I,w)}};Object.defineProperty(r,"__esModule",{value:!0}),r.DomRenderer=void 0;const n=o(3787),d=o(2550),f=o(2223),g=o(6171),h=o(6052),t=o(4725),s=o(8055),e=o(8460),i=o(844),a=o(2585),v="xterm-dom-renderer-owner-",u="xterm-rows",p="xterm-fg-",c="xterm-bg-",S="xterm-focus",E="xterm-selection";let k=1,L=r.DomRenderer=class extends i.Disposable{constructor(w,A,O,I,W,B,m,b,y,D,T,H,$){super(),this._terminal=w,this._document=A,this._element=O,this._screenElement=I,this._viewportElement=W,this._helperContainer=B,this._linkifier2=m,this._charSizeService=y,this._optionsService=D,this._bufferService=T,this._coreBrowserService=H,this._themeService=$,this._terminalClass=k++,this._rowElements=[],this._selectionRenderModel=(0,h.createSelectionRenderModel)(),this.onRequestRedraw=this.register(new e.EventEmitter).event,this._rowContainer=this._document.createElement("div"),this._rowContainer.classList.add(u),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(E),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=(0,g.createRenderDimensions)(),this._updateDimensions(),this.register(this._optionsService.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._themeService.onChangeColors((j=>this._injectCss(j)))),this._injectCss(this._themeService.colors),this._rowFactory=b.createInstance(n.DomRendererRowFactory,document),this._element.classList.add(v+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this.register(this._linkifier2.onShowLinkUnderline((j=>this._handleLinkHover(j)))),this.register(this._linkifier2.onHideLinkUnderline((j=>this._handleLinkLeave(j)))),this.register((0,i.toDisposable)((()=>{this._element.classList.remove(v+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()}))),this._widthCache=new d.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 w=this._coreBrowserService.dpr;this.dimensions.device.char.width=this._charSizeService.width*w,this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*w),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/w),this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/w),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 O of this._rowElements)O.style.width=`${this.dimensions.css.canvas.width}px`,O.style.height=`${this.dimensions.css.cell.height}px`,O.style.lineHeight=`${this.dimensions.css.cell.height}px`,O.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));const A=`${this._terminalSelector} .${u} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=A,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(w){this._themeStyleElement||(this._themeStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));let A=`${this._terminalSelector} .${u} { color: ${w.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;A+=`${this._terminalSelector} .${u} .xterm-dim { color: ${s.color.multiplyOpacity(w.foreground,.5).css};}`,A+=`${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 O=`blink_underline_${this._terminalClass}`,I=`blink_bar_${this._terminalClass}`,W=`blink_block_${this._terminalClass}`;A+=`@keyframes ${O} { 50% { border-bottom-style: hidden; }}`,A+=`@keyframes ${I} { 50% { box-shadow: none; }}`,A+=`@keyframes ${W} { 0% { background-color: ${w.cursor.css}; color: ${w.cursorAccent.css}; } 50% { background-color: inherit; color: ${w.cursor.css}; }}`,A+=`${this._terminalSelector} .${u}.${S} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${O} 1s step-end infinite;}${this._terminalSelector} .${u}.${S} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${I} 1s step-end infinite;}${this._terminalSelector} .${u}.${S} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${W} 1s step-end infinite;}${this._terminalSelector} .${u} .xterm-cursor.xterm-cursor-block { background-color: ${w.cursor.css}; color: ${w.cursorAccent.css};}${this._terminalSelector} .${u} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${w.cursor.css} !important; color: ${w.cursorAccent.css} !important;}${this._terminalSelector} .${u} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${w.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${u} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${w.cursor.css} inset;}${this._terminalSelector} .${u} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${w.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,A+=`${this._terminalSelector} .${E} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${E} div { position: absolute; background-color: ${w.selectionBackgroundOpaque.css};}${this._terminalSelector} .${E} div { position: absolute; background-color: ${w.selectionInactiveBackgroundOpaque.css};}`;for(const[B,m]of w.ansi.entries())A+=`${this._terminalSelector} .${p}${B} { color: ${m.css}; }${this._terminalSelector} .${p}${B}.xterm-dim { color: ${s.color.multiplyOpacity(m,.5).css}; }${this._terminalSelector} .${c}${B} { background-color: ${m.css}; }`;A+=`${this._terminalSelector} .${p}${f.INVERTED_DEFAULT_COLOR} { color: ${s.color.opaque(w.background).css}; }${this._terminalSelector} .${p}${f.INVERTED_DEFAULT_COLOR}.xterm-dim { color: ${s.color.multiplyOpacity(s.color.opaque(w.background),.5).css}; }${this._terminalSelector} .${c}${f.INVERTED_DEFAULT_COLOR} { background-color: ${w.foreground.css}; }`,this._themeStyleElement.textContent=A}_setDefaultSpacing(){const w=this.dimensions.css.cell.width-this._widthCache.get("W",!1,!1);this._rowContainer.style.letterSpacing=`${w}px`,this._rowFactory.defaultSpacing=w}handleDevicePixelRatioChange(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}_refreshRowElements(w,A){for(let O=this._rowElements.length;O<=A;O++){const I=this._document.createElement("div");this._rowContainer.appendChild(I),this._rowElements.push(I)}for(;this._rowElements.length>A;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(w,A){this._refreshRowElements(w,A),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(S),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add(S),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(w,A,O){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(w,A,O),this.renderRows(0,this._bufferService.rows-1),!w||!A)return;this._selectionRenderModel.update(this._terminal,w,A,O);const I=this._selectionRenderModel.viewportStartRow,W=this._selectionRenderModel.viewportEndRow,B=this._selectionRenderModel.viewportCappedStartRow,m=this._selectionRenderModel.viewportCappedEndRow;if(B>=this._bufferService.rows||m<0)return;const b=this._document.createDocumentFragment();if(O){const y=w[0]>A[0];b.appendChild(this._createSelectionElement(B,y?A[0]:w[0],y?w[0]:A[0],m-B+1))}else{const y=I===B?w[0]:0,D=B===W?A[0]:this._bufferService.cols;b.appendChild(this._createSelectionElement(B,y,D));const T=m-B-1;if(b.appendChild(this._createSelectionElement(B+1,0,this._bufferService.cols,T)),B!==m){const H=W===m?A[0]:this._bufferService.cols;b.appendChild(this._createSelectionElement(m,0,H))}}this._selectionContainer.appendChild(b)}_createSelectionElement(w,A,O,I=1){const W=this._document.createElement("div"),B=A*this.dimensions.css.cell.width;let m=this.dimensions.css.cell.width*(O-A);return B+m>this.dimensions.css.canvas.width&&(m=this.dimensions.css.canvas.width-B),W.style.height=I*this.dimensions.css.cell.height+"px",W.style.top=w*this.dimensions.css.cell.height+"px",W.style.left=`${B}px`,W.style.width=`${m}px`,W}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 w of this._rowElements)w.replaceChildren()}renderRows(w,A){const O=this._bufferService.buffer,I=O.ybase+O.y,W=Math.min(O.x,this._bufferService.cols-1),B=this._optionsService.rawOptions.cursorBlink,m=this._optionsService.rawOptions.cursorStyle,b=this._optionsService.rawOptions.cursorInactiveStyle;for(let y=w;y<=A;y++){const D=y+O.ydisp,T=this._rowElements[y],H=O.lines.get(D);if(!T||!H)break;T.replaceChildren(...this._rowFactory.createRow(H,D,D===I,m,b,W,B,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${v}${this._terminalClass}`}_handleLinkHover(w){this._setCellUnderline(w.x1,w.x2,w.y1,w.y2,w.cols,!0)}_handleLinkLeave(w){this._setCellUnderline(w.x1,w.x2,w.y1,w.y2,w.cols,!1)}_setCellUnderline(w,A,O,I,W,B){O<0&&(w=0),I<0&&(A=0);const m=this._bufferService.rows-1;O=Math.max(Math.min(O,m),0),I=Math.max(Math.min(I,m),0),W=Math.min(W,this._bufferService.cols);const b=this._bufferService.buffer,y=b.ybase+b.y,D=Math.min(b.x,W-1),T=this._optionsService.rawOptions.cursorBlink,H=this._optionsService.rawOptions.cursorStyle,$=this._optionsService.rawOptions.cursorInactiveStyle;for(let j=O;j<=I;++j){const R=j+b.ydisp,C=this._rowElements[j],M=b.lines.get(R);if(!C||!M)break;C.replaceChildren(...this._rowFactory.createRow(M,R,R===y,H,$,D,T,this.dimensions.css.cell.width,this._widthCache,B?j===O?w:0:-1,B?(j===I?A:W)-1:-1))}}};r.DomRenderer=L=l([_(7,a.IInstantiationService),_(8,t.ICharSizeService),_(9,a.IOptionsService),_(10,a.IBufferService),_(11,t.ICoreBrowserService),_(12,t.IThemeService)],L)},3787:function(x,r,o){var l=this&&this.__decorate||function(u,p,c,S){var E,k=arguments.length,L=k<3?p:S===null?S=Object.getOwnPropertyDescriptor(p,c):S;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")L=Reflect.decorate(u,p,c,S);else for(var w=u.length-1;w>=0;w--)(E=u[w])&&(L=(k<3?E(L):k>3?E(p,c,L):E(p,c))||L);return k>3&&L&&Object.defineProperty(p,c,L),L},_=this&&this.__param||function(u,p){return function(c,S){p(c,S,u)}};Object.defineProperty(r,"__esModule",{value:!0}),r.DomRendererRowFactory=void 0;const n=o(2223),d=o(643),f=o(511),g=o(2585),h=o(8055),t=o(4725),s=o(4269),e=o(6171),i=o(3734);let a=r.DomRendererRowFactory=class{constructor(u,p,c,S,E,k,L){this._document=u,this._characterJoinerService=p,this._optionsService=c,this._coreBrowserService=S,this._coreService=E,this._decorationService=k,this._themeService=L,this._workCell=new f.CellData,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(u,p,c){this._selectionStart=u,this._selectionEnd=p,this._columnSelectMode=c}createRow(u,p,c,S,E,k,L,w,A,O,I){const W=[],B=this._characterJoinerService.getJoinedCharacters(p),m=this._themeService.colors;let b,y=u.getNoBgTrimmedLength();c&&y0&&V===B[0][0]){ee=!0;const Z=B.shift();K=new s.JoinedCellData(this._workCell,u.translateToString(!0,Z[0],Z[1]),Z[1]-Z[0]),ie=Z[1]-1,Q=K.getWidth()}const ae=this._isCellInSelection(V,p),_e=c&&V===k,fe=F&&V>=O&&V<=I;let ve=!1;this._decorationService.forEachDecorationAtCell(V,p,void 0,(Z=>{ve=!0}));let de=K.getChars()||d.WHITESPACE_CELL_CHAR;if(de===" "&&(K.isUnderline()||K.isOverline())&&(de=" "),P=Q*w-A.get(de,K.isBold(),K.isItalic()),b){if(D&&(ae&&M||!ae&&!M&&K.bg===H)&&(ae&&M&&m.selectionForeground||K.fg===$)&&K.extended.ext===j&&fe===R&&P===C&&!_e&&!ee&&!ve){K.isInvisible()?T+=d.WHITESPACE_CELL_CHAR:T+=de,D++;continue}D&&(b.textContent=T),b=this._document.createElement("span"),D=0,T=""}else b=this._document.createElement("span");if(H=K.bg,$=K.fg,j=K.extended.ext,R=fe,C=P,M=ae,ee&&k>=V&&k<=ie&&(k=V),!this._coreService.isCursorHidden&&_e&&this._coreService.isCursorInitialized){if(N.push("xterm-cursor"),this._coreBrowserService.isFocused)L&&N.push("xterm-cursor-blink"),N.push(S==="bar"?"xterm-cursor-bar":S==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(E)switch(E){case"outline":N.push("xterm-cursor-outline");break;case"block":N.push("xterm-cursor-block");break;case"bar":N.push("xterm-cursor-bar");break;case"underline":N.push("xterm-cursor-underline")}}if(K.isBold()&&N.push("xterm-bold"),K.isItalic()&&N.push("xterm-italic"),K.isDim()&&N.push("xterm-dim"),T=K.isInvisible()?d.WHITESPACE_CELL_CHAR:K.getChars()||d.WHITESPACE_CELL_CHAR,K.isUnderline()&&(N.push(`xterm-underline-${K.extended.underlineStyle}`),T===" "&&(T=" "),!K.isUnderlineColorDefault()))if(K.isUnderlineColorRGB())b.style.textDecorationColor=`rgb(${i.AttributeData.toColorRGB(K.getUnderlineColor()).join(",")})`;else{let Z=K.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&K.isBold()&&Z<8&&(Z+=8),b.style.textDecorationColor=m.ansi[Z].css}K.isOverline()&&(N.push("xterm-overline"),T===" "&&(T=" ")),K.isStrikethrough()&&N.push("xterm-strikethrough"),fe&&(b.style.textDecoration="underline");let se=K.getFgColor(),he=K.getFgColorMode(),re=K.getBgColor(),ce=K.getBgColorMode();const pe=!!K.isInverse();if(pe){const Z=se;se=re,re=Z;const Ee=he;he=ce,ce=Ee}let ne,ue,oe,le=!1;switch(this._decorationService.forEachDecorationAtCell(V,p,void 0,(Z=>{Z.options.layer!=="top"&&le||(Z.backgroundColorRGB&&(ce=50331648,re=Z.backgroundColorRGB.rgba>>8&16777215,ne=Z.backgroundColorRGB),Z.foregroundColorRGB&&(he=50331648,se=Z.foregroundColorRGB.rgba>>8&16777215,ue=Z.foregroundColorRGB),le=Z.options.layer==="top")})),!le&&ae&&(ne=this._coreBrowserService.isFocused?m.selectionBackgroundOpaque:m.selectionInactiveBackgroundOpaque,re=ne.rgba>>8&16777215,ce=50331648,le=!0,m.selectionForeground&&(he=50331648,se=m.selectionForeground.rgba>>8&16777215,ue=m.selectionForeground)),le&&N.push("xterm-decoration-top"),ce){case 16777216:case 33554432:oe=m.ansi[re],N.push(`xterm-bg-${re}`);break;case 50331648:oe=h.channels.toColor(re>>16,re>>8&255,255&re),this._addStyle(b,`background-color:#${v((re>>>0).toString(16),"0",6)}`);break;default:pe?(oe=m.foreground,N.push(`xterm-bg-${n.INVERTED_DEFAULT_COLOR}`)):oe=m.background}switch(ne||K.isDim()&&(ne=h.color.multiplyOpacity(oe,.5)),he){case 16777216:case 33554432:K.isBold()&&se<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(se+=8),this._applyMinimumContrast(b,oe,m.ansi[se],K,ne,void 0)||N.push(`xterm-fg-${se}`);break;case 50331648:const Z=h.channels.toColor(se>>16&255,se>>8&255,255&se);this._applyMinimumContrast(b,oe,Z,K,ne,ue)||this._addStyle(b,`color:#${v(se.toString(16),"0",6)}`);break;default:this._applyMinimumContrast(b,oe,m.foreground,K,ne,ue)||pe&&N.push(`xterm-fg-${n.INVERTED_DEFAULT_COLOR}`)}N.length&&(b.className=N.join(" "),N.length=0),_e||ee||ve?b.textContent=T:D++,P!==this.defaultSpacing&&(b.style.letterSpacing=`${P}px`),W.push(b),V=ie}return b&&D&&(b.textContent=T),W}_applyMinimumContrast(u,p,c,S,E,k){if(this._optionsService.rawOptions.minimumContrastRatio===1||(0,e.treatGlyphAsBackgroundColor)(S.getCode()))return!1;const L=this._getContrastCache(S);let w;if(E||k||(w=L.getColor(p.rgba,c.rgba)),w===void 0){const A=this._optionsService.rawOptions.minimumContrastRatio/(S.isDim()?2:1);w=h.color.ensureContrastRatio(E||p,k||c,A),L.setColor((E||p).rgba,(k||c).rgba,w??null)}return!!w&&(this._addStyle(u,`color:${w.css}`),!0)}_getContrastCache(u){return u.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(u,p){u.setAttribute("style",`${u.getAttribute("style")||""}${p};`)}_isCellInSelection(u,p){const c=this._selectionStart,S=this._selectionEnd;return!(!c||!S)&&(this._columnSelectMode?c[0]<=S[0]?u>=c[0]&&p>=c[1]&&u=c[1]&&u>=S[0]&&p<=S[1]:p>c[1]&&p=c[0]&&u=c[0])}};function v(u,p,c){for(;u.length{Object.defineProperty(r,"__esModule",{value:!0}),r.WidthCache=void 0,r.WidthCache=class{constructor(o,l){this._flat=new Float32Array(256),this._font="",this._fontSize=0,this._weight="normal",this._weightBold="bold",this._measureElements=[],this._container=o.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 _=o.createElement("span");_.classList.add("xterm-char-measure-element");const n=o.createElement("span");n.classList.add("xterm-char-measure-element"),n.style.fontWeight="bold";const d=o.createElement("span");d.classList.add("xterm-char-measure-element"),d.style.fontStyle="italic";const f=o.createElement("span");f.classList.add("xterm-char-measure-element"),f.style.fontWeight="bold",f.style.fontStyle="italic",this._measureElements=[_,n,d,f],this._container.appendChild(_),this._container.appendChild(n),this._container.appendChild(d),this._container.appendChild(f),l.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(o,l,_,n){o===this._font&&l===this._fontSize&&_===this._weight&&n===this._weightBold||(this._font=o,this._fontSize=l,this._weight=_,this._weightBold=n,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${_}`,this._measureElements[1].style.fontWeight=`${n}`,this._measureElements[2].style.fontWeight=`${_}`,this._measureElements[3].style.fontWeight=`${n}`,this.clear())}get(o,l,_){let n=0;if(!l&&!_&&o.length===1&&(n=o.charCodeAt(0))<256){if(this._flat[n]!==-9999)return this._flat[n];const g=this._measure(o,0);return g>0&&(this._flat[n]=g),g}let d=o;l&&(d+="B"),_&&(d+="I");let f=this._holey.get(d);if(f===void 0){let g=0;l&&(g|=1),_&&(g|=2),f=this._measure(o,g),f>0&&this._holey.set(d,f)}return f}_measure(o,l){const _=this._measureElements[l];return _.textContent=o.repeat(32),_.offsetWidth/32}}},2223:(x,r,o)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.TEXT_BASELINE=r.DIM_OPACITY=r.INVERTED_DEFAULT_COLOR=void 0;const l=o(6114);r.INVERTED_DEFAULT_COLOR=257,r.DIM_OPACITY=.5,r.TEXT_BASELINE=l.isFirefox||l.isLegacyEdge?"bottom":"ideographic"},6171:(x,r)=>{function o(_){return 57508<=_&&_<=57558}function l(_){return _>=128512&&_<=128591||_>=127744&&_<=128511||_>=128640&&_<=128767||_>=9728&&_<=9983||_>=9984&&_<=10175||_>=65024&&_<=65039||_>=129280&&_<=129535||_>=127462&&_<=127487}Object.defineProperty(r,"__esModule",{value:!0}),r.computeNextVariantOffset=r.createRenderDimensions=r.treatGlyphAsBackgroundColor=r.allowRescaling=r.isEmoji=r.isRestrictedPowerlineGlyph=r.isPowerlineGlyph=r.throwIfFalsy=void 0,r.throwIfFalsy=function(_){if(!_)throw new Error("value must not be falsy");return _},r.isPowerlineGlyph=o,r.isRestrictedPowerlineGlyph=function(_){return 57520<=_&&_<=57527},r.isEmoji=l,r.allowRescaling=function(_,n,d,f){return n===1&&d>Math.ceil(1.5*f)&&_!==void 0&&_>255&&!l(_)&&!o(_)&&!(function(g){return 57344<=g&&g<=63743})(_)},r.treatGlyphAsBackgroundColor=function(_){return o(_)||(function(n){return 9472<=n&&n<=9631})(_)},r.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}}}},r.computeNextVariantOffset=function(_,n,d=0){return(_-(2*Math.round(n)-d))%(2*Math.round(n))}},6052:(x,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.createSelectionRenderModel=void 0;class o{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(_,n,d,f=!1){if(this.selectionStart=n,this.selectionEnd=d,!n||!d||n[0]===d[0]&&n[1]===d[1])return void this.clear();const g=_.buffers.active.ydisp,h=n[1]-g,t=d[1]-g,s=Math.max(h,0),e=Math.min(t,_.rows-1);s>=_.rows||e<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=f,this.viewportStartRow=h,this.viewportEndRow=t,this.viewportCappedStartRow=s,this.viewportCappedEndRow=e,this.startCol=n[0],this.endCol=d[0])}isCellSelected(_,n,d){return!!this.hasSelection&&(d-=_.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?n>=this.startCol&&d>=this.viewportCappedStartRow&&n=this.viewportCappedStartRow&&n>=this.endCol&&d<=this.viewportCappedEndRow:d>this.viewportStartRow&&d=this.startCol&&n=this.startCol)}}r.createSelectionRenderModel=function(){return new o}},456:(x,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.SelectionModel=void 0,r.SelectionModel=class{constructor(o){this._bufferService=o,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 o=this.selectionStart[0]+this.selectionStartLength;return o>this._bufferService.cols?o%this._bufferService.cols==0?[this._bufferService.cols,this.selectionStart[1]+Math.floor(o/this._bufferService.cols)-1]:[o%this._bufferService.cols,this.selectionStart[1]+Math.floor(o/this._bufferService.cols)]:[o,this.selectionStart[1]]}if(this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]){const o=this.selectionStart[0]+this.selectionStartLength;return o>this._bufferService.cols?[o%this._bufferService.cols,this.selectionStart[1]+Math.floor(o/this._bufferService.cols)]:[Math.max(o,this.selectionEnd[0]),this.selectionEnd[1]]}return this.selectionEnd}}areSelectionValuesReversed(){const o=this.selectionStart,l=this.selectionEnd;return!(!o||!l)&&(o[1]>l[1]||o[1]===l[1]&&o[0]>l[0])}handleTrim(o){return this.selectionStart&&(this.selectionStart[1]-=o),this.selectionEnd&&(this.selectionEnd[1]-=o),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)}}},428:function(x,r,o){var l=this&&this.__decorate||function(e,i,a,v){var u,p=arguments.length,c=p<3?i:v===null?v=Object.getOwnPropertyDescriptor(i,a):v;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")c=Reflect.decorate(e,i,a,v);else for(var S=e.length-1;S>=0;S--)(u=e[S])&&(c=(p<3?u(c):p>3?u(i,a,c):u(i,a))||c);return p>3&&c&&Object.defineProperty(i,a,c),c},_=this&&this.__param||function(e,i){return function(a,v){i(a,v,e)}};Object.defineProperty(r,"__esModule",{value:!0}),r.CharSizeService=void 0;const n=o(2585),d=o(8460),f=o(844);let g=r.CharSizeService=class extends f.Disposable{get hasValidSize(){return this.width>0&&this.height>0}constructor(e,i,a){super(),this._optionsService=a,this.width=0,this.height=0,this._onCharSizeChange=this.register(new d.EventEmitter),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this.register(new s(this._optionsService))}catch{this._measureStrategy=this.register(new t(e,i,this._optionsService))}this.register(this._optionsService.onMultipleOptionChange(["fontFamily","fontSize"],(()=>this.measure())))}measure(){const e=this._measureStrategy.measure();e.width===this.width&&e.height===this.height||(this.width=e.width,this.height=e.height,this._onCharSizeChange.fire())}};r.CharSizeService=g=l([_(2,n.IOptionsService)],g);class h extends f.Disposable{constructor(){super(...arguments),this._result={width:0,height:0}}_validateAndSet(i,a){i!==void 0&&i>0&&a!==void 0&&a>0&&(this._result.width=i,this._result.height=a)}}class t extends h{constructor(i,a,v){super(),this._document=i,this._parentElement=a,this._optionsService=v,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 s extends h{constructor(i){super(),this._optionsService=i,this._canvas=new OffscreenCanvas(100,100),this._ctx=this._canvas.getContext("2d");const a=this._ctx.measureText("W");if(!("width"in a&&"fontBoundingBoxAscent"in a&&"fontBoundingBoxDescent"in a))throw new Error("Required font metrics not supported")}measure(){this._ctx.font=`${this._optionsService.rawOptions.fontSize}px ${this._optionsService.rawOptions.fontFamily}`;const i=this._ctx.measureText("W");return this._validateAndSet(i.width,i.fontBoundingBoxAscent+i.fontBoundingBoxDescent),this._result}}},4269:function(x,r,o){var l=this&&this.__decorate||function(s,e,i,a){var v,u=arguments.length,p=u<3?e:a===null?a=Object.getOwnPropertyDescriptor(e,i):a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")p=Reflect.decorate(s,e,i,a);else for(var c=s.length-1;c>=0;c--)(v=s[c])&&(p=(u<3?v(p):u>3?v(e,i,p):v(e,i))||p);return u>3&&p&&Object.defineProperty(e,i,p),p},_=this&&this.__param||function(s,e){return function(i,a){e(i,a,s)}};Object.defineProperty(r,"__esModule",{value:!0}),r.CharacterJoinerService=r.JoinedCellData=void 0;const n=o(3734),d=o(643),f=o(511),g=o(2585);class h extends n.AttributeData{constructor(e,i,a){super(),this.content=0,this.combinedData="",this.fg=e.fg,this.bg=e.bg,this.combinedData=i,this._width=a}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(e){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}r.JoinedCellData=h;let t=r.CharacterJoinerService=class ye{constructor(e){this._bufferService=e,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new f.CellData}register(e){const i={id:this._nextCharacterJoinerId++,handler:e};return this._characterJoiners.push(i),i.id}deregister(e){for(let i=0;i1){const L=this._getJoinedRanges(v,c,p,i,u);for(let w=0;w1){const k=this._getJoinedRanges(v,c,p,i,u);for(let L=0;L{Object.defineProperty(r,"__esModule",{value:!0}),r.CoreBrowserService=void 0;const l=o(844),_=o(8460),n=o(3656);class d extends l.Disposable{constructor(h,t,s){super(),this._textarea=h,this._window=t,this.mainDocument=s,this._isFocused=!1,this._cachedIsFocused=void 0,this._screenDprMonitor=new f(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((e=>this._screenDprMonitor.setWindow(e)))),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(h){this._window!==h&&(this._window=h,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}}r.CoreBrowserService=d;class f extends l.Disposable{constructor(h){super(),this._parentWindow=h,this._windowResizeListener=this.register(new l.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,l.toDisposable)((()=>this.clearListener())))}setWindow(h){this._parentWindow=h,this._setWindowResizeListener(),this._setDprAndFireIfDiffers()}_setWindowResizeListener(){this._windowResizeListener.value=(0,n.addDisposableDomListener)(this._parentWindow,"resize",(()=>this._setDprAndFireIfDiffers()))}_setDprAndFireIfDiffers(){this._parentWindow.devicePixelRatio!==this._currentDevicePixelRatio&&this._onDprChange.fire(this._parentWindow.devicePixelRatio),this._updateDpr()}_updateDpr(){this._outerListener&&(this._resolutionMediaMatchList?.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:(x,r,o)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.LinkProviderService=void 0;const l=o(844);class _ extends l.Disposable{constructor(){super(),this.linkProviders=[],this.register((0,l.toDisposable)((()=>this.linkProviders.length=0)))}registerLinkProvider(d){return this.linkProviders.push(d),{dispose:()=>{const f=this.linkProviders.indexOf(d);f!==-1&&this.linkProviders.splice(f,1)}}}}r.LinkProviderService=_},8934:function(x,r,o){var l=this&&this.__decorate||function(g,h,t,s){var e,i=arguments.length,a=i<3?h:s===null?s=Object.getOwnPropertyDescriptor(h,t):s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(g,h,t,s);else for(var v=g.length-1;v>=0;v--)(e=g[v])&&(a=(i<3?e(a):i>3?e(h,t,a):e(h,t))||a);return i>3&&a&&Object.defineProperty(h,t,a),a},_=this&&this.__param||function(g,h){return function(t,s){h(t,s,g)}};Object.defineProperty(r,"__esModule",{value:!0}),r.MouseService=void 0;const n=o(4725),d=o(9806);let f=r.MouseService=class{constructor(g,h){this._renderService=g,this._charSizeService=h}getCoords(g,h,t,s,e){return(0,d.getCoords)(window,g,h,t,s,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,e)}getMouseReportCoords(g,h){const t=(0,d.getCoordsRelativeToElement)(window,g,h);if(this._charSizeService.hasValidSize)return t[0]=Math.min(Math.max(t[0],0),this._renderService.dimensions.css.canvas.width-1),t[1]=Math.min(Math.max(t[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(t[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(t[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(t[0]),y:Math.floor(t[1])}}};r.MouseService=f=l([_(0,n.IRenderService),_(1,n.ICharSizeService)],f)},3230:function(x,r,o){var l=this&&this.__decorate||function(e,i,a,v){var u,p=arguments.length,c=p<3?i:v===null?v=Object.getOwnPropertyDescriptor(i,a):v;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")c=Reflect.decorate(e,i,a,v);else for(var S=e.length-1;S>=0;S--)(u=e[S])&&(c=(p<3?u(c):p>3?u(i,a,c):u(i,a))||c);return p>3&&c&&Object.defineProperty(i,a,c),c},_=this&&this.__param||function(e,i){return function(a,v){i(a,v,e)}};Object.defineProperty(r,"__esModule",{value:!0}),r.RenderService=void 0;const n=o(6193),d=o(4725),f=o(8460),g=o(844),h=o(7226),t=o(2585);let s=r.RenderService=class extends g.Disposable{get dimensions(){return this._renderer.value.dimensions}constructor(e,i,a,v,u,p,c,S){super(),this._rowCount=e,this._charSizeService=v,this._renderer=this.register(new g.MutableDisposable),this._pausedResizeTask=new h.DebouncedIdleTask,this._observerDisposable=this.register(new g.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 f.EventEmitter),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this.register(new f.EventEmitter),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this.register(new f.EventEmitter),this.onRender=this._onRender.event,this._onRefreshRequest=this.register(new f.EventEmitter),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new n.RenderDebouncer(((E,k)=>this._renderRows(E,k)),c),this.register(this._renderDebouncer),this.register(c.onDprChange((()=>this.handleDevicePixelRatioChange()))),this.register(p.onResize((()=>this._fullRefresh()))),this.register(p.buffers.onBufferActivate((()=>this._renderer.value?.clear()))),this.register(a.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._charSizeService.onCharSizeChange((()=>this.handleCharSizeChanged()))),this.register(u.onDecorationRegistered((()=>this._fullRefresh()))),this.register(u.onDecorationRemoved((()=>this._fullRefresh()))),this.register(a.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio","rescaleOverlappingGlyphs"],(()=>{this.clear(),this.handleResize(p.cols,p.rows),this._fullRefresh()}))),this.register(a.onMultipleOptionChange(["cursorBlink","cursorStyle"],(()=>this.refreshRows(p.buffer.y,p.buffer.y,!0)))),this.register(S.onChangeColors((()=>this._fullRefresh()))),this._registerIntersectionObserver(c.window,i),this.register(c.onWindowChange((E=>this._registerIntersectionObserver(E,i))))}_registerIntersectionObserver(e,i){if("IntersectionObserver"in e){const a=new e.IntersectionObserver((v=>this._handleIntersectionChange(v[v.length-1])),{threshold:0});a.observe(i),this._observerDisposable.value=(0,g.toDisposable)((()=>a.disconnect()))}}_handleIntersectionChange(e){this._isPaused=e.isIntersecting===void 0?e.intersectionRatio===0:!e.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(e,i,a=!1){this._isPaused?this._needsFullRefresh=!0:(a||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(e,i,this._rowCount))}_renderRows(e,i){this._renderer.value&&(e=Math.min(e,this._rowCount-1),i=Math.min(i,this._rowCount-1),this._renderer.value.renderRows(e,i),this._needsSelectionRefresh&&(this._renderer.value.handleSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:e,end:i}),this._onRender.fire({start:e,end:i}),this._isNextRenderRedrawOnly=!0)}resize(e,i){this._rowCount=i,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(e){this._renderer.value=e,this._renderer.value&&(this._renderer.value.onRequestRedraw((i=>this.refreshRows(i.start,i.end,!0))),this._needsSelectionRefresh=!0,this._fullRefresh())}addRefreshCallback(e){return this._renderDebouncer.addRefreshCallback(e)}_fullRefresh(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)}clearTextureAtlas(){this._renderer.value&&(this._renderer.value.clearTextureAtlas?.(),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(e,i){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set((()=>this._renderer.value?.handleResize(e,i))):this._renderer.value.handleResize(e,i),this._fullRefresh())}handleCharSizeChanged(){this._renderer.value?.handleCharSizeChanged()}handleBlur(){this._renderer.value?.handleBlur()}handleFocus(){this._renderer.value?.handleFocus()}handleSelectionChanged(e,i,a){this._selectionState.start=e,this._selectionState.end=i,this._selectionState.columnSelectMode=a,this._renderer.value?.handleSelectionChanged(e,i,a)}handleCursorMove(){this._renderer.value?.handleCursorMove()}clear(){this._renderer.value?.clear()}};r.RenderService=s=l([_(2,t.IOptionsService),_(3,d.ICharSizeService),_(4,t.IDecorationService),_(5,t.IBufferService),_(6,d.ICoreBrowserService),_(7,d.IThemeService)],s)},9312:function(x,r,o){var l=this&&this.__decorate||function(c,S,E,k){var L,w=arguments.length,A=w<3?S:k===null?k=Object.getOwnPropertyDescriptor(S,E):k;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")A=Reflect.decorate(c,S,E,k);else for(var O=c.length-1;O>=0;O--)(L=c[O])&&(A=(w<3?L(A):w>3?L(S,E,A):L(S,E))||A);return w>3&&A&&Object.defineProperty(S,E,A),A},_=this&&this.__param||function(c,S){return function(E,k){S(E,k,c)}};Object.defineProperty(r,"__esModule",{value:!0}),r.SelectionService=void 0;const n=o(9806),d=o(9504),f=o(456),g=o(4725),h=o(8460),t=o(844),s=o(6114),e=o(4841),i=o(511),a=o(2585),v=" ",u=new RegExp(v,"g");let p=r.SelectionService=class extends t.Disposable{constructor(c,S,E,k,L,w,A,O,I){super(),this._element=c,this._screenElement=S,this._linkifier=E,this._bufferService=k,this._coreService=L,this._mouseService=w,this._optionsService=A,this._renderService=O,this._coreBrowserService=I,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new i.CellData,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this.register(new h.EventEmitter),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this.register(new h.EventEmitter),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this.register(new h.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this.register(new h.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this._mouseMoveListener=W=>this._handleMouseMove(W),this._mouseUpListener=W=>this._handleMouseUp(W),this._coreService.onUserInput((()=>{this.hasSelection&&this.clearSelection()})),this._trimListener=this._bufferService.buffer.lines.onTrim((W=>this._handleTrim(W))),this.register(this._bufferService.buffers.onBufferActivate((W=>this._handleBufferActivate(W)))),this.enable(),this._model=new f.SelectionModel(this._bufferService),this._activeSelectionMode=0,this.register((0,t.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 c=this._model.finalSelectionStart,S=this._model.finalSelectionEnd;return!(!c||!S||c[0]===S[0]&&c[1]===S[1])}get selectionText(){const c=this._model.finalSelectionStart,S=this._model.finalSelectionEnd;if(!c||!S)return"";const E=this._bufferService.buffer,k=[];if(this._activeSelectionMode===3){if(c[0]===S[0])return"";const L=c[0]L.replace(u," "))).join(s.isWindows?`\r -`:` -`)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(c){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._refresh()))),s.isLinux&&c&&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(c){const S=this._getMouseBufferCoords(c),E=this._model.finalSelectionStart,k=this._model.finalSelectionEnd;return!!(E&&k&&S)&&this._areCoordsInSelection(S,E,k)}isCellInSelection(c,S){const E=this._model.finalSelectionStart,k=this._model.finalSelectionEnd;return!(!E||!k)&&this._areCoordsInSelection([c,S],E,k)}_areCoordsInSelection(c,S,E){return c[1]>S[1]&&c[1]=S[0]&&c[0]=S[0]}_selectWordAtCursor(c,S){const E=this._linkifier.currentLink?.link?.range;if(E)return this._model.selectionStart=[E.start.x-1,E.start.y-1],this._model.selectionStartLength=(0,e.getRangeLength)(E,this._bufferService.cols),this._model.selectionEnd=void 0,!0;const k=this._getMouseBufferCoords(c);return!!k&&(this._selectWordAt(k,S),this._model.selectionEnd=void 0,!0)}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(c,S){this._model.clearSelection(),c=Math.max(c,0),S=Math.min(S,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,c],this._model.selectionEnd=[this._bufferService.cols,S],this.refresh(),this._onSelectionChange.fire()}_handleTrim(c){this._model.handleTrim(c)&&this.refresh()}_getMouseBufferCoords(c){const S=this._mouseService.getCoords(c,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(S)return S[0]--,S[1]--,S[1]+=this._bufferService.buffer.ydisp,S}_getMouseEventScrollAmount(c){let S=(0,n.getCoordsRelativeToElement)(this._coreBrowserService.window,c,this._screenElement)[1];const E=this._renderService.dimensions.css.canvas.height;return S>=0&&S<=E?0:(S>E&&(S-=E),S=Math.min(Math.max(S,-50),50),S/=50,S/Math.abs(S)+Math.round(14*S))}shouldForceSelection(c){return s.isMac?c.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:c.shiftKey}handleMouseDown(c){if(this._mouseDownTimeStamp=c.timeStamp,(c.button!==2||!this.hasSelection)&&c.button===0){if(!this._enabled){if(!this.shouldForceSelection(c))return;c.stopPropagation()}c.preventDefault(),this._dragScrollAmount=0,this._enabled&&c.shiftKey?this._handleIncrementalClick(c):c.detail===1?this._handleSingleClick(c):c.detail===2?this._handleDoubleClick(c):c.detail===3&&this._handleTripleClick(c),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(c){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(c))}_handleSingleClick(c){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(c)?3:0,this._model.selectionStart=this._getMouseBufferCoords(c),!this._model.selectionStart)return;this._model.selectionEnd=void 0;const S=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);S&&S.length!==this._model.selectionStart[0]&&S.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(c){this._selectWordAtCursor(c,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(c){const S=this._getMouseBufferCoords(c);S&&(this._activeSelectionMode=2,this._selectLineAt(S[1]))}shouldColumnSelect(c){return c.altKey&&!(s.isMac&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(c){if(c.stopImmediatePropagation(),!this._model.selectionStart)return;const S=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(c),!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 E=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(c.ydisp+this._bufferService.rows,c.lines.length-1)):(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=c.ydisp),this.refresh()}}_handleMouseUp(c){const S=c.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&S<500&&c.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){const E=this._mouseService.getCoords(c,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(E&&E[0]!==void 0&&E[1]!==void 0){const k=(0,d.moveToCellSequence)(E[0]-1,E[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(k,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){const c=this._model.finalSelectionStart,S=this._model.finalSelectionEnd,E=!(!c||!S||c[0]===S[0]&&c[1]===S[1]);E?c&&S&&(this._oldSelectionStart&&this._oldSelectionEnd&&c[0]===this._oldSelectionStart[0]&&c[1]===this._oldSelectionStart[1]&&S[0]===this._oldSelectionEnd[0]&&S[1]===this._oldSelectionEnd[1]||this._fireOnSelectionChange(c,S,E)):this._oldHasSelection&&this._fireOnSelectionChange(c,S,E)}_fireOnSelectionChange(c,S,E){this._oldSelectionStart=c,this._oldSelectionEnd=S,this._oldHasSelection=E,this._onSelectionChange.fire()}_handleBufferActivate(c){this.clearSelection(),this._trimListener.dispose(),this._trimListener=c.activeBuffer.lines.onTrim((S=>this._handleTrim(S)))}_convertViewportColToCharacterIndex(c,S){let E=S;for(let k=0;S>=k;k++){const L=c.loadCell(k,this._workCell).getChars().length;this._workCell.getWidth()===0?E--:L>1&&S!==k&&(E+=L-1)}return E}setSelection(c,S,E){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[c,S],this._model.selectionStartLength=E,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(c){this._isClickInSelection(c)||(this._selectWordAtCursor(c,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(c,S,E=!0,k=!0){if(c[0]>=this._bufferService.cols)return;const L=this._bufferService.buffer,w=L.lines.get(c[1]);if(!w)return;const A=L.translateBufferLineToString(c[1],!1);let O=this._convertViewportColToCharacterIndex(w,c[0]),I=O;const W=c[0]-O;let B=0,m=0,b=0,y=0;if(A.charAt(O)===" "){for(;O>0&&A.charAt(O-1)===" ";)O--;for(;I1&&(y+=j-1,I+=j-1);H>0&&O>0&&!this._isCharWordSeparator(w.loadCell(H-1,this._workCell));){w.loadCell(H-1,this._workCell);const R=this._workCell.getChars().length;this._workCell.getWidth()===0?(B++,H--):R>1&&(b+=R-1,O-=R-1),O--,H--}for(;$1&&(y+=R-1,I+=R-1),I++,$++}}I++;let D=O+W-B+b,T=Math.min(this._bufferService.cols,I-O+B+m-b-y);if(S||A.slice(O,I).trim()!==""){if(E&&D===0&&w.getCodePoint(0)!==32){const H=L.lines.get(c[1]-1);if(H&&w.isWrapped&&H.getCodePoint(this._bufferService.cols-1)!==32){const $=this._getWordAt([this._bufferService.cols-1,c[1]-1],!1,!0,!1);if($){const j=this._bufferService.cols-$.start;D-=j,T+=j}}}if(k&&D+T===this._bufferService.cols&&w.getCodePoint(this._bufferService.cols-1)!==32){const H=L.lines.get(c[1]+1);if(H?.isWrapped&&H.getCodePoint(0)!==32){const $=this._getWordAt([0,c[1]+1],!1,!1,!0);$&&(T+=$.length)}}return{start:D,length:T}}}_selectWordAt(c,S){const E=this._getWordAt(c,S);if(E){for(;E.start<0;)E.start+=this._bufferService.cols,c[1]--;this._model.selectionStart=[E.start,c[1]],this._model.selectionStartLength=E.length}}_selectToWordAt(c){const S=this._getWordAt(c,!0);if(S){let E=c[1];for(;S.start<0;)S.start+=this._bufferService.cols,E--;if(!this._model.areSelectionValuesReversed())for(;S.start+S.length>this._bufferService.cols;)S.length-=this._bufferService.cols,E++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?S.start:S.start+S.length,E]}}_isCharWordSeparator(c){return c.getWidth()!==0&&this._optionsService.rawOptions.wordSeparator.indexOf(c.getChars())>=0}_selectLineAt(c){const S=this._bufferService.buffer.getWrappedRangeForLine(c),E={start:{x:0,y:S.first},end:{x:this._bufferService.cols-1,y:S.last}};this._model.selectionStart=[0,S.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=(0,e.getRangeLength)(E,this._bufferService.cols)}};r.SelectionService=p=l([_(3,a.IBufferService),_(4,a.ICoreService),_(5,g.IMouseService),_(6,a.IOptionsService),_(7,g.IRenderService),_(8,g.ICoreBrowserService)],p)},4725:(x,r,o)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.ILinkProviderService=r.IThemeService=r.ICharacterJoinerService=r.ISelectionService=r.IRenderService=r.IMouseService=r.ICoreBrowserService=r.ICharSizeService=void 0;const l=o(8343);r.ICharSizeService=(0,l.createDecorator)("CharSizeService"),r.ICoreBrowserService=(0,l.createDecorator)("CoreBrowserService"),r.IMouseService=(0,l.createDecorator)("MouseService"),r.IRenderService=(0,l.createDecorator)("RenderService"),r.ISelectionService=(0,l.createDecorator)("SelectionService"),r.ICharacterJoinerService=(0,l.createDecorator)("CharacterJoinerService"),r.IThemeService=(0,l.createDecorator)("ThemeService"),r.ILinkProviderService=(0,l.createDecorator)("LinkProviderService")},6731:function(x,r,o){var l=this&&this.__decorate||function(p,c,S,E){var k,L=arguments.length,w=L<3?c:E===null?E=Object.getOwnPropertyDescriptor(c,S):E;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")w=Reflect.decorate(p,c,S,E);else for(var A=p.length-1;A>=0;A--)(k=p[A])&&(w=(L<3?k(w):L>3?k(c,S,w):k(c,S))||w);return L>3&&w&&Object.defineProperty(c,S,w),w},_=this&&this.__param||function(p,c){return function(S,E){c(S,E,p)}};Object.defineProperty(r,"__esModule",{value:!0}),r.ThemeService=r.DEFAULT_ANSI_COLORS=void 0;const n=o(7239),d=o(8055),f=o(8460),g=o(844),h=o(2585),t=d.css.toColor("#ffffff"),s=d.css.toColor("#000000"),e=d.css.toColor("#ffffff"),i=d.css.toColor("#000000"),a={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};r.DEFAULT_ANSI_COLORS=Object.freeze((()=>{const p=[d.css.toColor("#2e3436"),d.css.toColor("#cc0000"),d.css.toColor("#4e9a06"),d.css.toColor("#c4a000"),d.css.toColor("#3465a4"),d.css.toColor("#75507b"),d.css.toColor("#06989a"),d.css.toColor("#d3d7cf"),d.css.toColor("#555753"),d.css.toColor("#ef2929"),d.css.toColor("#8ae234"),d.css.toColor("#fce94f"),d.css.toColor("#729fcf"),d.css.toColor("#ad7fa8"),d.css.toColor("#34e2e2"),d.css.toColor("#eeeeec")],c=[0,95,135,175,215,255];for(let S=0;S<216;S++){const E=c[S/36%6|0],k=c[S/6%6|0],L=c[S%6];p.push({css:d.channels.toCss(E,k,L),rgba:d.channels.toRgba(E,k,L)})}for(let S=0;S<24;S++){const E=8+10*S;p.push({css:d.channels.toCss(E,E,E),rgba:d.channels.toRgba(E,E,E)})}return p})());let v=r.ThemeService=class extends g.Disposable{get colors(){return this._colors}constructor(p){super(),this._optionsService=p,this._contrastCache=new n.ColorContrastCache,this._halfContrastCache=new n.ColorContrastCache,this._onChangeColors=this.register(new f.EventEmitter),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:t,background:s,cursor:e,cursorAccent:i,selectionForeground:void 0,selectionBackgroundTransparent:a,selectionBackgroundOpaque:d.color.blend(s,a),selectionInactiveBackgroundTransparent:a,selectionInactiveBackgroundOpaque:d.color.blend(s,a),ansi:r.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(p={}){const c=this._colors;if(c.foreground=u(p.foreground,t),c.background=u(p.background,s),c.cursor=u(p.cursor,e),c.cursorAccent=u(p.cursorAccent,i),c.selectionBackgroundTransparent=u(p.selectionBackground,a),c.selectionBackgroundOpaque=d.color.blend(c.background,c.selectionBackgroundTransparent),c.selectionInactiveBackgroundTransparent=u(p.selectionInactiveBackground,c.selectionBackgroundTransparent),c.selectionInactiveBackgroundOpaque=d.color.blend(c.background,c.selectionInactiveBackgroundTransparent),c.selectionForeground=p.selectionForeground?u(p.selectionForeground,d.NULL_COLOR):void 0,c.selectionForeground===d.NULL_COLOR&&(c.selectionForeground=void 0),d.color.isOpaque(c.selectionBackgroundTransparent)&&(c.selectionBackgroundTransparent=d.color.opacity(c.selectionBackgroundTransparent,.3)),d.color.isOpaque(c.selectionInactiveBackgroundTransparent)&&(c.selectionInactiveBackgroundTransparent=d.color.opacity(c.selectionInactiveBackgroundTransparent,.3)),c.ansi=r.DEFAULT_ANSI_COLORS.slice(),c.ansi[0]=u(p.black,r.DEFAULT_ANSI_COLORS[0]),c.ansi[1]=u(p.red,r.DEFAULT_ANSI_COLORS[1]),c.ansi[2]=u(p.green,r.DEFAULT_ANSI_COLORS[2]),c.ansi[3]=u(p.yellow,r.DEFAULT_ANSI_COLORS[3]),c.ansi[4]=u(p.blue,r.DEFAULT_ANSI_COLORS[4]),c.ansi[5]=u(p.magenta,r.DEFAULT_ANSI_COLORS[5]),c.ansi[6]=u(p.cyan,r.DEFAULT_ANSI_COLORS[6]),c.ansi[7]=u(p.white,r.DEFAULT_ANSI_COLORS[7]),c.ansi[8]=u(p.brightBlack,r.DEFAULT_ANSI_COLORS[8]),c.ansi[9]=u(p.brightRed,r.DEFAULT_ANSI_COLORS[9]),c.ansi[10]=u(p.brightGreen,r.DEFAULT_ANSI_COLORS[10]),c.ansi[11]=u(p.brightYellow,r.DEFAULT_ANSI_COLORS[11]),c.ansi[12]=u(p.brightBlue,r.DEFAULT_ANSI_COLORS[12]),c.ansi[13]=u(p.brightMagenta,r.DEFAULT_ANSI_COLORS[13]),c.ansi[14]=u(p.brightCyan,r.DEFAULT_ANSI_COLORS[14]),c.ansi[15]=u(p.brightWhite,r.DEFAULT_ANSI_COLORS[15]),p.extendedAnsi){const S=Math.min(c.ansi.length-16,p.extendedAnsi.length);for(let E=0;E{Object.defineProperty(r,"__esModule",{value:!0}),r.CircularList=void 0;const l=o(8460),_=o(844);class n extends _.Disposable{constructor(f){super(),this._maxLength=f,this.onDeleteEmitter=this.register(new l.EventEmitter),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this.register(new l.EventEmitter),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this.register(new l.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(f){if(this._maxLength===f)return;const g=new Array(f);for(let h=0;hthis._length)for(let g=this._length;g=f;t--)this._array[this._getCyclicIndex(t+h.length)]=this._array[this._getCyclicIndex(t)];for(let t=0;tthis._maxLength){const t=this._length+h.length-this._maxLength;this._startIndex+=t,this._length=this._maxLength,this.onTrimEmitter.fire(t)}else this._length+=h.length}trimStart(f){f>this._length&&(f=this._length),this._startIndex+=f,this._length-=f,this.onTrimEmitter.fire(f)}shiftElements(f,g,h){if(!(g<=0)){if(f<0||f>=this._length)throw new Error("start argument out of range");if(f+h<0)throw new Error("Cannot shift elements in list beyond index 0");if(h>0){for(let s=g-1;s>=0;s--)this.set(f+s+h,this.get(f+s));const t=f+g+h-this._length;if(t>0)for(this._length+=t;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let t=0;t{Object.defineProperty(r,"__esModule",{value:!0}),r.clone=void 0,r.clone=function o(l,_=5){if(typeof l!="object")return l;const n=Array.isArray(l)?[]:{};for(const d in l)n[d]=_<=1?l[d]:l[d]&&o(l[d],_-1);return n}},8055:(x,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.contrastRatio=r.toPaddedHex=r.rgba=r.rgb=r.css=r.color=r.channels=r.NULL_COLOR=void 0;let o=0,l=0,_=0,n=0;var d,f,g,h,t;function s(i){const a=i.toString(16);return a.length<2?"0"+a:a}function e(i,a){return i>>0},i.toColor=function(a,v,u,p){return{css:i.toCss(a,v,u,p),rgba:i.toRgba(a,v,u,p)}}})(d||(r.channels=d={})),(function(i){function a(v,u){return n=Math.round(255*u),[o,l,_]=t.toChannels(v.rgba),{css:d.toCss(o,l,_,n),rgba:d.toRgba(o,l,_,n)}}i.blend=function(v,u){if(n=(255&u.rgba)/255,n===1)return{css:u.css,rgba:u.rgba};const p=u.rgba>>24&255,c=u.rgba>>16&255,S=u.rgba>>8&255,E=v.rgba>>24&255,k=v.rgba>>16&255,L=v.rgba>>8&255;return o=E+Math.round((p-E)*n),l=k+Math.round((c-k)*n),_=L+Math.round((S-L)*n),{css:d.toCss(o,l,_),rgba:d.toRgba(o,l,_)}},i.isOpaque=function(v){return(255&v.rgba)==255},i.ensureContrastRatio=function(v,u,p){const c=t.ensureContrastRatio(v.rgba,u.rgba,p);if(c)return d.toColor(c>>24&255,c>>16&255,c>>8&255)},i.opaque=function(v){const u=(255|v.rgba)>>>0;return[o,l,_]=t.toChannels(u),{css:d.toCss(o,l,_),rgba:u}},i.opacity=a,i.multiplyOpacity=function(v,u){return n=255&v.rgba,a(v,n*u/255)},i.toColorRGB=function(v){return[v.rgba>>24&255,v.rgba>>16&255,v.rgba>>8&255]}})(f||(r.color=f={})),(function(i){let a,v;try{const u=document.createElement("canvas");u.width=1,u.height=1;const p=u.getContext("2d",{willReadFrequently:!0});p&&(a=p,a.globalCompositeOperation="copy",v=a.createLinearGradient(0,0,1,1))}catch{}i.toColor=function(u){if(u.match(/#[\da-f]{3,8}/i))switch(u.length){case 4:return o=parseInt(u.slice(1,2).repeat(2),16),l=parseInt(u.slice(2,3).repeat(2),16),_=parseInt(u.slice(3,4).repeat(2),16),d.toColor(o,l,_);case 5:return o=parseInt(u.slice(1,2).repeat(2),16),l=parseInt(u.slice(2,3).repeat(2),16),_=parseInt(u.slice(3,4).repeat(2),16),n=parseInt(u.slice(4,5).repeat(2),16),d.toColor(o,l,_,n);case 7:return{css:u,rgba:(parseInt(u.slice(1),16)<<8|255)>>>0};case 9:return{css:u,rgba:parseInt(u.slice(1),16)>>>0}}const p=u.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(p)return o=parseInt(p[1]),l=parseInt(p[2]),_=parseInt(p[3]),n=Math.round(255*(p[5]===void 0?1:parseFloat(p[5]))),d.toColor(o,l,_,n);if(!a||!v)throw new Error("css.toColor: Unsupported css format");if(a.fillStyle=v,a.fillStyle=u,typeof a.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(a.fillRect(0,0,1,1),[o,l,_,n]=a.getImageData(0,0,1,1).data,n!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:d.toRgba(o,l,_,n),css:u}}})(g||(r.css=g={})),(function(i){function a(v,u,p){const c=v/255,S=u/255,E=p/255;return .2126*(c<=.03928?c/12.92:Math.pow((c+.055)/1.055,2.4))+.7152*(S<=.03928?S/12.92:Math.pow((S+.055)/1.055,2.4))+.0722*(E<=.03928?E/12.92:Math.pow((E+.055)/1.055,2.4))}i.relativeLuminance=function(v){return a(v>>16&255,v>>8&255,255&v)},i.relativeLuminance2=a})(h||(r.rgb=h={})),(function(i){function a(u,p,c){const S=u>>24&255,E=u>>16&255,k=u>>8&255;let L=p>>24&255,w=p>>16&255,A=p>>8&255,O=e(h.relativeLuminance2(L,w,A),h.relativeLuminance2(S,E,k));for(;O0||w>0||A>0);)L-=Math.max(0,Math.ceil(.1*L)),w-=Math.max(0,Math.ceil(.1*w)),A-=Math.max(0,Math.ceil(.1*A)),O=e(h.relativeLuminance2(L,w,A),h.relativeLuminance2(S,E,k));return(L<<24|w<<16|A<<8|255)>>>0}function v(u,p,c){const S=u>>24&255,E=u>>16&255,k=u>>8&255;let L=p>>24&255,w=p>>16&255,A=p>>8&255,O=e(h.relativeLuminance2(L,w,A),h.relativeLuminance2(S,E,k));for(;O>>0}i.blend=function(u,p){if(n=(255&p)/255,n===1)return p;const c=p>>24&255,S=p>>16&255,E=p>>8&255,k=u>>24&255,L=u>>16&255,w=u>>8&255;return o=k+Math.round((c-k)*n),l=L+Math.round((S-L)*n),_=w+Math.round((E-w)*n),d.toRgba(o,l,_)},i.ensureContrastRatio=function(u,p,c){const S=h.relativeLuminance(u>>8),E=h.relativeLuminance(p>>8);if(e(S,E)>8));if(Ae(S,h.relativeLuminance(O>>8))?w:O}return w}const k=v(u,p,c),L=e(S,h.relativeLuminance(k>>8));if(Le(S,h.relativeLuminance(w>>8))?k:w}return k}},i.reduceLuminance=a,i.increaseLuminance=v,i.toChannels=function(u){return[u>>24&255,u>>16&255,u>>8&255,255&u]}})(t||(r.rgba=t={})),r.toPaddedHex=s,r.contrastRatio=e},8969:(x,r,o)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.CoreTerminal=void 0;const l=o(844),_=o(2585),n=o(4348),d=o(7866),f=o(744),g=o(7302),h=o(6975),t=o(8460),s=o(1753),e=o(1480),i=o(7994),a=o(9282),v=o(5435),u=o(5981),p=o(2660);let c=!1;class S extends l.Disposable{get onScroll(){return this._onScrollApi||(this._onScrollApi=this.register(new t.EventEmitter),this._onScroll.event((k=>{this._onScrollApi?.fire(k.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(k){for(const L in k)this.optionsService.options[L]=k[L]}constructor(k){super(),this._windowsWrappingHeuristics=this.register(new l.MutableDisposable),this._onBinary=this.register(new t.EventEmitter),this.onBinary=this._onBinary.event,this._onData=this.register(new t.EventEmitter),this.onData=this._onData.event,this._onLineFeed=this.register(new t.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onResize=this.register(new t.EventEmitter),this.onResize=this._onResize.event,this._onWriteParsed=this.register(new t.EventEmitter),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this.register(new t.EventEmitter),this._instantiationService=new n.InstantiationService,this.optionsService=this.register(new g.OptionsService(k)),this._instantiationService.setService(_.IOptionsService,this.optionsService),this._bufferService=this.register(this._instantiationService.createInstance(f.BufferService)),this._instantiationService.setService(_.IBufferService,this._bufferService),this._logService=this.register(this._instantiationService.createInstance(d.LogService)),this._instantiationService.setService(_.ILogService,this._logService),this.coreService=this.register(this._instantiationService.createInstance(h.CoreService)),this._instantiationService.setService(_.ICoreService,this.coreService),this.coreMouseService=this.register(this._instantiationService.createInstance(s.CoreMouseService)),this._instantiationService.setService(_.ICoreMouseService,this.coreMouseService),this.unicodeService=this.register(this._instantiationService.createInstance(e.UnicodeService)),this._instantiationService.setService(_.IUnicodeService,this.unicodeService),this._charsetService=this._instantiationService.createInstance(i.CharsetService),this._instantiationService.setService(_.ICharsetService,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(p.OscLinkService),this._instantiationService.setService(_.IOscLinkService,this._oscLinkService),this._inputHandler=this.register(new v.InputHandler(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this.register((0,t.forwardEvent)(this._inputHandler.onLineFeed,this._onLineFeed)),this.register(this._inputHandler),this.register((0,t.forwardEvent)(this._bufferService.onResize,this._onResize)),this.register((0,t.forwardEvent)(this.coreService.onData,this._onData)),this.register((0,t.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((L=>{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((L=>{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 u.WriteBuffer(((L,w)=>this._inputHandler.parse(L,w)))),this.register((0,t.forwardEvent)(this._writeBuffer.onWriteParsed,this._onWriteParsed))}write(k,L){this._writeBuffer.write(k,L)}writeSync(k,L){this._logService.logLevel<=_.LogLevelEnum.WARN&&!c&&(this._logService.warn("writeSync is unreliable and will be removed soon."),c=!0),this._writeBuffer.writeSync(k,L)}input(k,L=!0){this.coreService.triggerDataEvent(k,L)}resize(k,L){isNaN(k)||isNaN(L)||(k=Math.max(k,f.MINIMUM_COLS),L=Math.max(L,f.MINIMUM_ROWS),this._bufferService.resize(k,L))}scroll(k,L=!1){this._bufferService.scroll(k,L)}scrollLines(k,L,w){this._bufferService.scrollLines(k,L,w)}scrollPages(k){this.scrollLines(k*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(k){const L=k-this._bufferService.buffer.ydisp;L!==0&&this.scrollLines(L)}registerEscHandler(k,L){return this._inputHandler.registerEscHandler(k,L)}registerDcsHandler(k,L){return this._inputHandler.registerDcsHandler(k,L)}registerCsiHandler(k,L){return this._inputHandler.registerCsiHandler(k,L)}registerOscHandler(k,L){return this._inputHandler.registerOscHandler(k,L)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let k=!1;const L=this.optionsService.rawOptions.windowsPty;L&&L.buildNumber!==void 0&&L.buildNumber!==void 0?k=L.backend==="conpty"&&L.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(k=!0),k?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){const k=[];k.push(this.onLineFeed(a.updateWindowsModeWrappedState.bind(null,this._bufferService))),k.push(this.registerCsiHandler({final:"H"},(()=>((0,a.updateWindowsModeWrappedState)(this._bufferService),!1)))),this._windowsWrappingHeuristics.value=(0,l.toDisposable)((()=>{for(const L of k)L.dispose()}))}}}r.CoreTerminal=S},8460:(x,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.runAndSubscribe=r.forwardEvent=r.EventEmitter=void 0,r.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=o=>(this._listeners.push(o),{dispose:()=>{if(!this._disposed){for(let l=0;ll.fire(_)))},r.runAndSubscribe=function(o,l){return l(void 0),o((_=>l(_)))}},5435:function(x,r,o){var l=this&&this.__decorate||function(B,m,b,y){var D,T=arguments.length,H=T<3?m:y===null?y=Object.getOwnPropertyDescriptor(m,b):y;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")H=Reflect.decorate(B,m,b,y);else for(var $=B.length-1;$>=0;$--)(D=B[$])&&(H=(T<3?D(H):T>3?D(m,b,H):D(m,b))||H);return T>3&&H&&Object.defineProperty(m,b,H),H},_=this&&this.__param||function(B,m){return function(b,y){m(b,y,B)}};Object.defineProperty(r,"__esModule",{value:!0}),r.InputHandler=r.WindowsOptionsReportType=void 0;const n=o(2584),d=o(7116),f=o(2015),g=o(844),h=o(482),t=o(8437),s=o(8460),e=o(643),i=o(511),a=o(3734),v=o(2585),u=o(1480),p=o(6242),c=o(6351),S=o(5941),E={"(":0,")":1,"*":2,"+":3,"-":1,".":2},k=131072;function L(B,m){if(B>24)return m.setWinLines||!1;switch(B){case 1:return!!m.restoreWin;case 2:return!!m.minimizeWin;case 3:return!!m.setWinPosition;case 4:return!!m.setWinSizePixels;case 5:return!!m.raiseWin;case 6:return!!m.lowerWin;case 7:return!!m.refreshWin;case 8:return!!m.setWinSizeChars;case 9:return!!m.maximizeWin;case 10:return!!m.fullscreenWin;case 11:return!!m.getWinState;case 13:return!!m.getWinPosition;case 14:return!!m.getWinSizePixels;case 15:return!!m.getScreenSizePixels;case 16:return!!m.getCellSizePixels;case 18:return!!m.getWinSizeChars;case 19:return!!m.getScreenSizeChars;case 20:return!!m.getIconTitle;case 21:return!!m.getWinTitle;case 22:return!!m.pushTitle;case 23:return!!m.popTitle;case 24:return!!m.setWinLines}return!1}var w;(function(B){B[B.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",B[B.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"})(w||(r.WindowsOptionsReportType=w={}));let A=0;class O extends g.Disposable{getAttrData(){return this._curAttrData}constructor(m,b,y,D,T,H,$,j,R=new f.EscapeSequenceParser){super(),this._bufferService=m,this._charsetService=b,this._coreService=y,this._logService=D,this._optionsService=T,this._oscLinkService=H,this._coreMouseService=$,this._unicodeService=j,this._parser=R,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new h.StringToUtf32,this._utf8Decoder=new h.Utf8ToUtf32,this._workCell=new i.CellData,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=t.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=t.DEFAULT_ATTR_DATA.clone(),this._onRequestBell=this.register(new s.EventEmitter),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this.register(new s.EventEmitter),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this.register(new s.EventEmitter),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this.register(new s.EventEmitter),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this.register(new s.EventEmitter),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this.register(new s.EventEmitter),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this.register(new s.EventEmitter),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this.register(new s.EventEmitter),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this.register(new s.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this.register(new s.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onScroll=this.register(new s.EventEmitter),this.onScroll=this._onScroll.event,this._onTitleChange=this.register(new s.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onColor=this.register(new s.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 I(this._bufferService),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((C=>this._activeBuffer=C.activeBuffer))),this._parser.setCsiHandlerFallback(((C,M)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(C),params:M.toArray()})})),this._parser.setEscHandlerFallback((C=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(C)})})),this._parser.setExecuteHandlerFallback((C=>{this._logService.debug("Unknown EXECUTE code: ",{code:C})})),this._parser.setOscHandlerFallback(((C,M,P)=>{this._logService.debug("Unknown OSC code: ",{identifier:C,action:M,data:P})})),this._parser.setDcsHandlerFallback(((C,M,P)=>{M==="HOOK"&&(P=P.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(C),action:M,payload:P})})),this._parser.setPrintHandler(((C,M,P)=>this.print(C,M,P))),this._parser.registerCsiHandler({final:"@"},(C=>this.insertChars(C))),this._parser.registerCsiHandler({intermediates:" ",final:"@"},(C=>this.scrollLeft(C))),this._parser.registerCsiHandler({final:"A"},(C=>this.cursorUp(C))),this._parser.registerCsiHandler({intermediates:" ",final:"A"},(C=>this.scrollRight(C))),this._parser.registerCsiHandler({final:"B"},(C=>this.cursorDown(C))),this._parser.registerCsiHandler({final:"C"},(C=>this.cursorForward(C))),this._parser.registerCsiHandler({final:"D"},(C=>this.cursorBackward(C))),this._parser.registerCsiHandler({final:"E"},(C=>this.cursorNextLine(C))),this._parser.registerCsiHandler({final:"F"},(C=>this.cursorPrecedingLine(C))),this._parser.registerCsiHandler({final:"G"},(C=>this.cursorCharAbsolute(C))),this._parser.registerCsiHandler({final:"H"},(C=>this.cursorPosition(C))),this._parser.registerCsiHandler({final:"I"},(C=>this.cursorForwardTab(C))),this._parser.registerCsiHandler({final:"J"},(C=>this.eraseInDisplay(C,!1))),this._parser.registerCsiHandler({prefix:"?",final:"J"},(C=>this.eraseInDisplay(C,!0))),this._parser.registerCsiHandler({final:"K"},(C=>this.eraseInLine(C,!1))),this._parser.registerCsiHandler({prefix:"?",final:"K"},(C=>this.eraseInLine(C,!0))),this._parser.registerCsiHandler({final:"L"},(C=>this.insertLines(C))),this._parser.registerCsiHandler({final:"M"},(C=>this.deleteLines(C))),this._parser.registerCsiHandler({final:"P"},(C=>this.deleteChars(C))),this._parser.registerCsiHandler({final:"S"},(C=>this.scrollUp(C))),this._parser.registerCsiHandler({final:"T"},(C=>this.scrollDown(C))),this._parser.registerCsiHandler({final:"X"},(C=>this.eraseChars(C))),this._parser.registerCsiHandler({final:"Z"},(C=>this.cursorBackwardTab(C))),this._parser.registerCsiHandler({final:"`"},(C=>this.charPosAbsolute(C))),this._parser.registerCsiHandler({final:"a"},(C=>this.hPositionRelative(C))),this._parser.registerCsiHandler({final:"b"},(C=>this.repeatPrecedingCharacter(C))),this._parser.registerCsiHandler({final:"c"},(C=>this.sendDeviceAttributesPrimary(C))),this._parser.registerCsiHandler({prefix:">",final:"c"},(C=>this.sendDeviceAttributesSecondary(C))),this._parser.registerCsiHandler({final:"d"},(C=>this.linePosAbsolute(C))),this._parser.registerCsiHandler({final:"e"},(C=>this.vPositionRelative(C))),this._parser.registerCsiHandler({final:"f"},(C=>this.hVPosition(C))),this._parser.registerCsiHandler({final:"g"},(C=>this.tabClear(C))),this._parser.registerCsiHandler({final:"h"},(C=>this.setMode(C))),this._parser.registerCsiHandler({prefix:"?",final:"h"},(C=>this.setModePrivate(C))),this._parser.registerCsiHandler({final:"l"},(C=>this.resetMode(C))),this._parser.registerCsiHandler({prefix:"?",final:"l"},(C=>this.resetModePrivate(C))),this._parser.registerCsiHandler({final:"m"},(C=>this.charAttributes(C))),this._parser.registerCsiHandler({final:"n"},(C=>this.deviceStatus(C))),this._parser.registerCsiHandler({prefix:"?",final:"n"},(C=>this.deviceStatusPrivate(C))),this._parser.registerCsiHandler({intermediates:"!",final:"p"},(C=>this.softReset(C))),this._parser.registerCsiHandler({intermediates:" ",final:"q"},(C=>this.setCursorStyle(C))),this._parser.registerCsiHandler({final:"r"},(C=>this.setScrollRegion(C))),this._parser.registerCsiHandler({final:"s"},(C=>this.saveCursor(C))),this._parser.registerCsiHandler({final:"t"},(C=>this.windowOptions(C))),this._parser.registerCsiHandler({final:"u"},(C=>this.restoreCursor(C))),this._parser.registerCsiHandler({intermediates:"'",final:"}"},(C=>this.insertColumns(C))),this._parser.registerCsiHandler({intermediates:"'",final:"~"},(C=>this.deleteColumns(C))),this._parser.registerCsiHandler({intermediates:'"',final:"q"},(C=>this.selectProtected(C))),this._parser.registerCsiHandler({intermediates:"$",final:"p"},(C=>this.requestMode(C,!0))),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},(C=>this.requestMode(C,!1))),this._parser.setExecuteHandler(n.C0.BEL,(()=>this.bell())),this._parser.setExecuteHandler(n.C0.LF,(()=>this.lineFeed())),this._parser.setExecuteHandler(n.C0.VT,(()=>this.lineFeed())),this._parser.setExecuteHandler(n.C0.FF,(()=>this.lineFeed())),this._parser.setExecuteHandler(n.C0.CR,(()=>this.carriageReturn())),this._parser.setExecuteHandler(n.C0.BS,(()=>this.backspace())),this._parser.setExecuteHandler(n.C0.HT,(()=>this.tab())),this._parser.setExecuteHandler(n.C0.SO,(()=>this.shiftOut())),this._parser.setExecuteHandler(n.C0.SI,(()=>this.shiftIn())),this._parser.setExecuteHandler(n.C1.IND,(()=>this.index())),this._parser.setExecuteHandler(n.C1.NEL,(()=>this.nextLine())),this._parser.setExecuteHandler(n.C1.HTS,(()=>this.tabSet())),this._parser.registerOscHandler(0,new p.OscHandler((C=>(this.setTitle(C),this.setIconName(C),!0)))),this._parser.registerOscHandler(1,new p.OscHandler((C=>this.setIconName(C)))),this._parser.registerOscHandler(2,new p.OscHandler((C=>this.setTitle(C)))),this._parser.registerOscHandler(4,new p.OscHandler((C=>this.setOrReportIndexedColor(C)))),this._parser.registerOscHandler(8,new p.OscHandler((C=>this.setHyperlink(C)))),this._parser.registerOscHandler(10,new p.OscHandler((C=>this.setOrReportFgColor(C)))),this._parser.registerOscHandler(11,new p.OscHandler((C=>this.setOrReportBgColor(C)))),this._parser.registerOscHandler(12,new p.OscHandler((C=>this.setOrReportCursorColor(C)))),this._parser.registerOscHandler(104,new p.OscHandler((C=>this.restoreIndexedColor(C)))),this._parser.registerOscHandler(110,new p.OscHandler((C=>this.restoreFgColor(C)))),this._parser.registerOscHandler(111,new p.OscHandler((C=>this.restoreBgColor(C)))),this._parser.registerOscHandler(112,new p.OscHandler((C=>this.restoreCursorColor(C)))),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 C in d.CHARSETS)this._parser.registerEscHandler({intermediates:"(",final:C},(()=>this.selectCharset("("+C))),this._parser.registerEscHandler({intermediates:")",final:C},(()=>this.selectCharset(")"+C))),this._parser.registerEscHandler({intermediates:"*",final:C},(()=>this.selectCharset("*"+C))),this._parser.registerEscHandler({intermediates:"+",final:C},(()=>this.selectCharset("+"+C))),this._parser.registerEscHandler({intermediates:"-",final:C},(()=>this.selectCharset("-"+C))),this._parser.registerEscHandler({intermediates:".",final:C},(()=>this.selectCharset("."+C))),this._parser.registerEscHandler({intermediates:"/",final:C},(()=>this.selectCharset("/"+C)));this._parser.registerEscHandler({intermediates:"#",final:"8"},(()=>this.screenAlignmentPattern())),this._parser.setErrorHandler((C=>(this._logService.error("Parsing error: ",C),C))),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new c.DcsHandler(((C,M)=>this.requestStatusString(C,M))))}_preserveStack(m,b,y,D){this._parseStack.paused=!0,this._parseStack.cursorStartX=m,this._parseStack.cursorStartY=b,this._parseStack.decodedLength=y,this._parseStack.position=D}_logSlowResolvingAsync(m){this._logService.logLevel<=v.LogLevelEnum.WARN&&Promise.race([m,new Promise(((b,y)=>setTimeout((()=>y("#SLOW_TIMEOUT")),5e3)))]).catch((b=>{if(b!=="#SLOW_TIMEOUT")throw b;console.warn("async parser handler taking longer than 5000 ms")}))}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(m,b){let y,D=this._activeBuffer.x,T=this._activeBuffer.y,H=0;const $=this._parseStack.paused;if($){if(y=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,b))return this._logSlowResolvingAsync(y),y;D=this._parseStack.cursorStartX,T=this._parseStack.cursorStartY,this._parseStack.paused=!1,m.length>k&&(H=this._parseStack.position+k)}if(this._logService.logLevel<=v.LogLevelEnum.DEBUG&&this._logService.debug("parsing data"+(typeof m=="string"?` "${m}"`:` "${Array.prototype.map.call(m,(C=>String.fromCharCode(C))).join("")}"`),typeof m=="string"?m.split("").map((C=>C.charCodeAt(0))):m),this._parseBuffer.lengthk)for(let C=H;C0&&P.getWidth(this._activeBuffer.x-1)===2&&P.setCellFromCodepoint(this._activeBuffer.x-1,0,1,M);let N=this._parser.precedingJoinState;for(let F=b;Fj){if(R){const ie=P;let K=this._activeBuffer.x-ee;for(this._activeBuffer.x=ee,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),P=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),ee>0&&P instanceof t.BufferLine&&P.copyCellsFrom(ie,K,0,ee,!1);K=0;)P.setCellFromCodepoint(this._activeBuffer.x++,0,0,M)}else if(C&&(P.insertCells(this._activeBuffer.x,T-ee,this._activeBuffer.getNullCell(M)),P.getWidth(j-1)===2&&P.setCellFromCodepoint(j-1,e.NULL_CELL_CODE,e.NULL_CELL_WIDTH,M)),P.setCellFromCodepoint(this._activeBuffer.x++,D,T,M),T>0)for(;--T;)P.setCellFromCodepoint(this._activeBuffer.x++,0,0,M)}this._parser.precedingJoinState=N,this._activeBuffer.x0&&P.getWidth(this._activeBuffer.x)===0&&!P.hasContent(this._activeBuffer.x)&&P.setCellFromCodepoint(this._activeBuffer.x,0,1,M),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(m,b){return m.final!=="t"||m.prefix||m.intermediates?this._parser.registerCsiHandler(m,b):this._parser.registerCsiHandler(m,(y=>!L(y.params[0],this._optionsService.rawOptions.windowOptions)||b(y)))}registerDcsHandler(m,b){return this._parser.registerDcsHandler(m,new c.DcsHandler(b))}registerEscHandler(m,b){return this._parser.registerEscHandler(m,b)}registerOscHandler(m,b){return this._parser.registerOscHandler(m,new p.OscHandler(b))}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(){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&&this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y)?.isWrapped){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;const m=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);m.hasWidth(this._activeBuffer.x)&&!m.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;const m=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-m),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(m=this._bufferService.cols-1){this._activeBuffer.x=Math.min(m,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(m,b){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=m,this._activeBuffer.y=this._activeBuffer.scrollTop+b):(this._activeBuffer.x=m,this._activeBuffer.y=b),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(m,b){this._restrictCursor(),this._setCursor(this._activeBuffer.x+m,this._activeBuffer.y+b)}cursorUp(m){const b=this._activeBuffer.y-this._activeBuffer.scrollTop;return b>=0?this._moveCursor(0,-Math.min(b,m.params[0]||1)):this._moveCursor(0,-(m.params[0]||1)),!0}cursorDown(m){const b=this._activeBuffer.scrollBottom-this._activeBuffer.y;return b>=0?this._moveCursor(0,Math.min(b,m.params[0]||1)):this._moveCursor(0,m.params[0]||1),!0}cursorForward(m){return this._moveCursor(m.params[0]||1,0),!0}cursorBackward(m){return this._moveCursor(-(m.params[0]||1),0),!0}cursorNextLine(m){return this.cursorDown(m),this._activeBuffer.x=0,!0}cursorPrecedingLine(m){return this.cursorUp(m),this._activeBuffer.x=0,!0}cursorCharAbsolute(m){return this._setCursor((m.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(m){return this._setCursor(m.length>=2?(m.params[1]||1)-1:0,(m.params[0]||1)-1),!0}charPosAbsolute(m){return this._setCursor((m.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(m){return this._moveCursor(m.params[0]||1,0),!0}linePosAbsolute(m){return this._setCursor(this._activeBuffer.x,(m.params[0]||1)-1),!0}vPositionRelative(m){return this._moveCursor(0,m.params[0]||1),!0}hVPosition(m){return this.cursorPosition(m),!0}tabClear(m){const b=m.params[0];return b===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:b===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(m){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let b=m.params[0]||1;for(;b--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(m){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let b=m.params[0]||1;for(;b--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(m){const b=m.params[0];return b===1&&(this._curAttrData.bg|=536870912),b!==2&&b!==0||(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(m,b,y,D=!1,T=!1){const H=this._activeBuffer.lines.get(this._activeBuffer.ybase+m);H.replaceCells(b,y,this._activeBuffer.getNullCell(this._eraseAttrData()),T),D&&(H.isWrapped=!1)}_resetBufferLine(m,b=!1){const y=this._activeBuffer.lines.get(this._activeBuffer.ybase+m);y&&(y.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),b),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+m),y.isWrapped=!1)}eraseInDisplay(m,b=!1){let y;switch(this._restrictCursor(this._bufferService.cols),m.params[0]){case 0:for(y=this._activeBuffer.y,this._dirtyRowTracker.markDirty(y),this._eraseInBufferLine(y++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,b);y=this._bufferService.cols&&(this._activeBuffer.lines.get(y+1).isWrapped=!1);y--;)this._resetBufferLine(y,b);this._dirtyRowTracker.markDirty(0);break;case 2:for(y=this._bufferService.rows,this._dirtyRowTracker.markDirty(y-1);y--;)this._resetBufferLine(y,b);this._dirtyRowTracker.markDirty(0);break;case 3:const D=this._activeBuffer.lines.length-this._bufferService.rows;D>0&&(this._activeBuffer.lines.trimStart(D),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-D,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-D,0),this._onScroll.fire(0))}return!0}eraseInLine(m,b=!1){switch(this._restrictCursor(this._bufferService.cols),m.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,b);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,b);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,b)}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(m){this._restrictCursor();let b=m.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 R=j;for(let C=1;C0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(n.C0.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(n.C0.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(m){return m.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(n.C0.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(n.C0.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(m.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(n.C0.ESC+"[>83;40003;0c")),!0}_is(m){return(this._optionsService.rawOptions.termName+"").indexOf(m)===0}setMode(m){for(let b=0;bQ?1:2,N=m.params[0];return F=N,V=b?N===2?4:N===4?P(H.modes.insertMode):N===12?3:N===20?P(M.convertEol):0:N===1?P(y.applicationCursorKeys):N===3?M.windowOptions.setWinLines?j===80?2:j===132?1:0:0:N===6?P(y.origin):N===7?P(y.wraparound):N===8?3:N===9?P(D==="X10"):N===12?P(M.cursorBlink):N===25?P(!H.isCursorHidden):N===45?P(y.reverseWraparound):N===66?P(y.applicationKeypad):N===67?4:N===1e3?P(D==="VT200"):N===1002?P(D==="DRAG"):N===1003?P(D==="ANY"):N===1004?P(y.sendFocus):N===1005?4:N===1006?P(T==="SGR"):N===1015?4:N===1016?P(T==="SGR_PIXELS"):N===1048?1:N===47||N===1047||N===1049?P(R===C):N===2004?P(y.bracketedPasteMode):0,H.triggerDataEvent(`${n.C0.ESC}[${b?"":"?"}${F};${V}$y`),!0;var F,V}_updateAttrColor(m,b,y,D,T){return b===2?(m|=50331648,m&=-16777216,m|=a.AttributeData.fromColorRGB([y,D,T])):b===5&&(m&=-50331904,m|=33554432|255&y),m}_extractColor(m,b,y){const D=[0,0,-1,0,0,0];let T=0,H=0;do{if(D[H+T]=m.params[b+H],m.hasSubParams(b+H)){const $=m.getSubParams(b+H);let j=0;do D[1]===5&&(T=1),D[H+j+1+T]=$[j];while(++j<$.length&&j+H+1+T=2||D[1]===2&&H+T>=5)break;D[1]&&(T=1)}while(++H+b5)&&(m=1),b.extended.underlineStyle=m,b.fg|=268435456,m===0&&(b.fg&=-268435457),b.updateExtended()}_processSGR0(m){m.fg=t.DEFAULT_ATTR_DATA.fg,m.bg=t.DEFAULT_ATTR_DATA.bg,m.extended=m.extended.clone(),m.extended.underlineStyle=0,m.extended.underlineColor&=-67108864,m.updateExtended()}charAttributes(m){if(m.length===1&&m.params[0]===0)return this._processSGR0(this._curAttrData),!0;const b=m.length;let y;const D=this._curAttrData;for(let T=0;T=30&&y<=37?(D.fg&=-50331904,D.fg|=16777216|y-30):y>=40&&y<=47?(D.bg&=-50331904,D.bg|=16777216|y-40):y>=90&&y<=97?(D.fg&=-50331904,D.fg|=16777224|y-90):y>=100&&y<=107?(D.bg&=-50331904,D.bg|=16777224|y-100):y===0?this._processSGR0(D):y===1?D.fg|=134217728:y===3?D.bg|=67108864:y===4?(D.fg|=268435456,this._processUnderline(m.hasSubParams(T)?m.getSubParams(T)[0]:1,D)):y===5?D.fg|=536870912:y===7?D.fg|=67108864:y===8?D.fg|=1073741824:y===9?D.fg|=2147483648:y===2?D.bg|=134217728:y===21?this._processUnderline(2,D):y===22?(D.fg&=-134217729,D.bg&=-134217729):y===23?D.bg&=-67108865:y===24?(D.fg&=-268435457,this._processUnderline(0,D)):y===25?D.fg&=-536870913:y===27?D.fg&=-67108865:y===28?D.fg&=-1073741825:y===29?D.fg&=2147483647:y===39?(D.fg&=-67108864,D.fg|=16777215&t.DEFAULT_ATTR_DATA.fg):y===49?(D.bg&=-67108864,D.bg|=16777215&t.DEFAULT_ATTR_DATA.bg):y===38||y===48||y===58?T+=this._extractColor(m,T,D):y===53?D.bg|=1073741824:y===55?D.bg&=-1073741825:y===59?(D.extended=D.extended.clone(),D.extended.underlineColor=-1,D.updateExtended()):y===100?(D.fg&=-67108864,D.fg|=16777215&t.DEFAULT_ATTR_DATA.fg,D.bg&=-67108864,D.bg|=16777215&t.DEFAULT_ATTR_DATA.bg):this._logService.debug("Unknown SGR attribute: %d.",y);return!0}deviceStatus(m){switch(m.params[0]){case 5:this._coreService.triggerDataEvent(`${n.C0.ESC}[0n`);break;case 6:const b=this._activeBuffer.y+1,y=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${n.C0.ESC}[${b};${y}R`)}return!0}deviceStatusPrivate(m){if(m.params[0]===6){const b=this._activeBuffer.y+1,y=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${n.C0.ESC}[?${b};${y}R`)}return!0}softReset(m){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=t.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(m){const b=m.params[0]||1;switch(b){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 y=b%2==1;return this._optionsService.options.cursorBlink=y,!0}setScrollRegion(m){const b=m.params[0]||1;let y;return(m.length<2||(y=m.params[1])>this._bufferService.rows||y===0)&&(y=this._bufferService.rows),y>b&&(this._activeBuffer.scrollTop=b-1,this._activeBuffer.scrollBottom=y-1,this._setCursor(0,0)),!0}windowOptions(m){if(!L(m.params[0],this._optionsService.rawOptions.windowOptions))return!0;const b=m.length>1?m.params[1]:0;switch(m.params[0]){case 14:b!==2&&this._onRequestWindowsOptionsReport.fire(w.GET_WIN_SIZE_PIXELS);break;case 16:this._onRequestWindowsOptionsReport.fire(w.GET_CELL_SIZE_PIXELS);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${n.C0.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:b!==0&&b!==2||(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>10&&this._windowTitleStack.shift()),b!==0&&b!==1||(this._iconNameStack.push(this._iconName),this._iconNameStack.length>10&&this._iconNameStack.shift());break;case 23:b!==0&&b!==2||this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),b!==0&&b!==1||this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop())}return!0}saveCursor(m){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(m){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(m){return this._windowTitle=m,this._onTitleChange.fire(m),!0}setIconName(m){return this._iconName=m,!0}setOrReportIndexedColor(m){const b=[],y=m.split(";");for(;y.length>1;){const D=y.shift(),T=y.shift();if(/^\d+$/.exec(D)){const H=parseInt(D);if(W(H))if(T==="?")b.push({type:0,index:H});else{const $=(0,S.parseColor)(T);$&&b.push({type:1,index:H,color:$})}}}return b.length&&this._onColor.fire(b),!0}setHyperlink(m){const b=m.split(";");return!(b.length<2)&&(b[1]?this._createHyperlink(b[0],b[1]):!b[0]&&this._finishHyperlink())}_createHyperlink(m,b){this._getCurrentLinkId()&&this._finishHyperlink();const y=m.split(":");let D;const T=y.findIndex((H=>H.startsWith("id=")));return T!==-1&&(D=y[T].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:D,uri:b}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(m,b){const y=m.split(";");for(let D=0;D=this._specialColors.length);++D,++b)if(y[D]==="?")this._onColor.fire([{type:0,index:this._specialColors[b]}]);else{const T=(0,S.parseColor)(y[D]);T&&this._onColor.fire([{type:1,index:this._specialColors[b],color:T}])}return!0}setOrReportFgColor(m){return this._setOrReportSpecialColor(m,0)}setOrReportBgColor(m){return this._setOrReportSpecialColor(m,1)}setOrReportCursorColor(m){return this._setOrReportSpecialColor(m,2)}restoreIndexedColor(m){if(!m)return this._onColor.fire([{type:2}]),!0;const b=[],y=m.split(";");for(let D=0;D=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 m=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,m,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=t.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=t.DEFAULT_ATTR_DATA.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=67108863&this._curAttrData.bg,this._eraseAttrDataInternal}setgLevel(m){return this._charsetService.setgLevel(m),!0}screenAlignmentPattern(){const m=new i.CellData;m.content=4194373,m.fg=this._curAttrData.fg,m.bg=this._curAttrData.bg,this._setCursor(0,0);for(let b=0;b(this._coreService.triggerDataEvent(`${n.C0.ESC}${T}${n.C0.ESC}\\`),!0))(m==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:m==='"p'?'P1$r61;1"p':m==="r"?`P1$r${y.scrollTop+1};${y.scrollBottom+1}r`:m==="m"?"P1$r0m":m===" q"?`P1$r${{block:2,underline:4,bar:6}[D.cursorStyle]-(D.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(m,b){this._dirtyRowTracker.markRangeDirty(m,b)}}r.InputHandler=O;let I=class{constructor(B){this._bufferService=B,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(B){Bthis.end&&(this.end=B)}markRangeDirty(B,m){B>m&&(A=B,B=m,m=A),Bthis.end&&(this.end=m)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};function W(B){return 0<=B&&B<256}I=l([_(0,v.IBufferService)],I)},844:(x,r)=>{function o(l){for(const _ of l)_.dispose();l.length=0}Object.defineProperty(r,"__esModule",{value:!0}),r.getDisposeArrayDisposable=r.disposeArray=r.toDisposable=r.MutableDisposable=r.Disposable=void 0,r.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(const l of this._disposables)l.dispose();this._disposables.length=0}register(l){return this._disposables.push(l),l}unregister(l){const _=this._disposables.indexOf(l);_!==-1&&this._disposables.splice(_,1)}},r.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(l){this._isDisposed||l===this._value||(this._value?.dispose(),this._value=l)}clear(){this.value=void 0}dispose(){this._isDisposed=!0,this._value?.dispose(),this._value=void 0}},r.toDisposable=function(l){return{dispose:l}},r.disposeArray=o,r.getDisposeArrayDisposable=function(l){return{dispose:()=>o(l)}}},1505:(x,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.FourKeyMap=r.TwoKeyMap=void 0;class o{constructor(){this._data={}}set(_,n,d){this._data[_]||(this._data[_]={}),this._data[_][n]=d}get(_,n){return this._data[_]?this._data[_][n]:void 0}clear(){this._data={}}}r.TwoKeyMap=o,r.FourKeyMap=class{constructor(){this._data=new o}set(l,_,n,d,f){this._data.get(l,_)||this._data.set(l,_,new o),this._data.get(l,_).set(n,d,f)}get(l,_,n,d){return this._data.get(l,_)?.get(n,d)}clear(){this._data.clear()}}},6114:(x,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.isChromeOS=r.isLinux=r.isWindows=r.isIphone=r.isIpad=r.isMac=r.getSafariVersion=r.isSafari=r.isLegacyEdge=r.isFirefox=r.isNode=void 0,r.isNode=typeof process<"u"&&"title"in process;const o=r.isNode?"node":navigator.userAgent,l=r.isNode?"node":navigator.platform;r.isFirefox=o.includes("Firefox"),r.isLegacyEdge=o.includes("Edge"),r.isSafari=/^((?!chrome|android).)*safari/i.test(o),r.getSafariVersion=function(){if(!r.isSafari)return 0;const _=o.match(/Version\/(\d+)/);return _===null||_.length<2?0:parseInt(_[1])},r.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(l),r.isIpad=l==="iPad",r.isIphone=l==="iPhone",r.isWindows=["Windows","Win16","Win32","WinCE"].includes(l),r.isLinux=l.indexOf("Linux")>=0,r.isChromeOS=/\bCrOS\b/.test(o)},6106:(x,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.SortedList=void 0;let o=0;r.SortedList=class{constructor(l){this._getKey=l,this._array=[]}clear(){this._array.length=0}insert(l){this._array.length!==0?(o=this._search(this._getKey(l)),this._array.splice(o,0,l)):this._array.push(l)}delete(l){if(this._array.length===0)return!1;const _=this._getKey(l);if(_===void 0||(o=this._search(_),o===-1)||this._getKey(this._array[o])!==_)return!1;do if(this._array[o]===l)return this._array.splice(o,1),!0;while(++o=this._array.length)&&this._getKey(this._array[o])===l))do yield this._array[o];while(++o=this._array.length)&&this._getKey(this._array[o])===l))do _(this._array[o]);while(++o=_;){let d=_+n>>1;const f=this._getKey(this._array[d]);if(f>l)n=d-1;else{if(!(f0&&this._getKey(this._array[d-1])===l;)d--;return d}_=d+1}}return _}}},7226:(x,r,o)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.DebouncedIdleTask=r.IdleTaskQueue=r.PriorityTaskQueue=void 0;const l=o(6114);class _{constructor(){this._tasks=[],this._i=0}enqueue(f){this._tasks.push(f),this._start()}flush(){for(;this._is)return t-g<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(t-g))}ms`),void this._start();t=s}this.clear()}}class n extends _{_requestCallback(f){return setTimeout((()=>f(this._createDeadline(16))))}_cancelCallback(f){clearTimeout(f)}_createDeadline(f){const g=Date.now()+f;return{timeRemaining:()=>Math.max(0,g-Date.now())}}}r.PriorityTaskQueue=n,r.IdleTaskQueue=!l.isNode&&"requestIdleCallback"in window?class extends _{_requestCallback(d){return requestIdleCallback(d)}_cancelCallback(d){cancelIdleCallback(d)}}:n,r.DebouncedIdleTask=class{constructor(){this._queue=new r.IdleTaskQueue}set(d){this._queue.clear(),this._queue.enqueue(d)}flush(){this._queue.flush()}}},9282:(x,r,o)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.updateWindowsModeWrappedState=void 0;const l=o(643);r.updateWindowsModeWrappedState=function(_){const n=_.buffer.lines.get(_.buffer.ybase+_.buffer.y-1),d=n?.get(_.cols-1),f=_.buffer.lines.get(_.buffer.ybase+_.buffer.y);f&&d&&(f.isWrapped=d[l.CHAR_DATA_CODE_INDEX]!==l.NULL_CELL_CODE&&d[l.CHAR_DATA_CODE_INDEX]!==l.WHITESPACE_CELL_CODE)}},3734:(x,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.ExtendedAttrs=r.AttributeData=void 0;class o{constructor(){this.fg=0,this.bg=0,this.extended=new l}static toColorRGB(n){return[n>>>16&255,n>>>8&255,255&n]}static fromColorRGB(n){return(255&n[0])<<16|(255&n[1])<<8|255&n[2]}clone(){const n=new o;return n.fg=this.fg,n.bg=this.bg,n.extended=this.extended.clone(),n}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}}r.AttributeData=o;class l{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(n){this._ext=n}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(n){this._ext&=-469762049,this._ext|=n<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(n){this._ext&=-67108864,this._ext|=67108863&n}get urlId(){return this._urlId}set urlId(n){this._urlId=n}get underlineVariantOffset(){const n=(3758096384&this._ext)>>29;return n<0?4294967288^n:n}set underlineVariantOffset(n){this._ext&=536870911,this._ext|=n<<29&3758096384}constructor(n=0,d=0){this._ext=0,this._urlId=0,this._ext=n,this._urlId=d}clone(){return new l(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}r.ExtendedAttrs=l},9092:(x,r,o)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.Buffer=r.MAX_BUFFER_SIZE=void 0;const l=o(6349),_=o(7226),n=o(3734),d=o(8437),f=o(4634),g=o(511),h=o(643),t=o(4863),s=o(7116);r.MAX_BUFFER_SIZE=4294967295,r.Buffer=class{constructor(e,i,a){this._hasScrollback=e,this._optionsService=i,this._bufferService=a,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=d.DEFAULT_ATTR_DATA.clone(),this.savedCharset=s.DEFAULT_CHARSET,this.markers=[],this._nullCell=g.CellData.fromCharData([0,h.NULL_CELL_CHAR,h.NULL_CELL_WIDTH,h.NULL_CELL_CODE]),this._whitespaceCell=g.CellData.fromCharData([0,h.WHITESPACE_CELL_CHAR,h.WHITESPACE_CELL_WIDTH,h.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 l.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}getNullCell(e){return e?(this._nullCell.fg=e.fg,this._nullCell.bg=e.bg,this._nullCell.extended=e.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new n.ExtendedAttrs),this._nullCell}getWhitespaceCell(e){return e?(this._whitespaceCell.fg=e.fg,this._whitespaceCell.bg=e.bg,this._whitespaceCell.extended=e.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new n.ExtendedAttrs),this._whitespaceCell}getBlankLine(e,i){return new d.BufferLine(this._bufferService.cols,this.getNullCell(e),i)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){const e=this.ybase+this.y-this.ydisp;return e>=0&&er.MAX_BUFFER_SIZE?r.MAX_BUFFER_SIZE:i}fillViewportRows(e){if(this.lines.length===0){e===void 0&&(e=d.DEFAULT_ATTR_DATA);let i=this._rows;for(;i--;)this.lines.push(this.getBlankLine(e))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new l.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(e,i){const a=this.getNullCell(d.DEFAULT_ATTR_DATA);let v=0;const u=this._getCorrectBufferLength(i);if(u>this.lines.maxLength&&(this.lines.maxLength=u),this.lines.length>0){if(this._cols0&&this.lines.length<=this.ybase+this.y+p+1?(this.ybase--,p++,this.ydisp>0&&this.ydisp--):this.lines.push(new d.BufferLine(e,a)));else for(let c=this._rows;c>i;c--)this.lines.length>i+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(u0&&(this.lines.trimStart(c),this.ybase=Math.max(this.ybase-c,0),this.ydisp=Math.max(this.ydisp-c,0),this.savedY=Math.max(this.savedY-c,0)),this.lines.maxLength=u}this.x=Math.min(this.x,e-1),this.y=Math.min(this.y,i-1),p&&(this.y+=p),this.savedX=Math.min(this.savedX,e-1),this.scrollTop=0}if(this.scrollBottom=i-1,this._isReflowEnabled&&(this._reflow(e,i),this._cols>e))for(let p=0;p.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue((()=>this._batchedMemoryCleanup())))}_batchedMemoryCleanup(){let e=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,e=!1);let i=0;for(;this._memoryCleanupPosition100)return!0;return e}get _isReflowEnabled(){const e=this._optionsService.rawOptions.windowsPty;return e&&e.buildNumber?this._hasScrollback&&e.backend==="conpty"&&e.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(e,i){this._cols!==e&&(e>this._cols?this._reflowLarger(e,i):this._reflowSmaller(e,i))}_reflowLarger(e,i){const a=(0,f.reflowLargerGetLinesToRemove)(this.lines,this._cols,e,this.ybase+this.y,this.getNullCell(d.DEFAULT_ATTR_DATA));if(a.length>0){const v=(0,f.reflowLargerCreateNewLayout)(this.lines,a);(0,f.reflowLargerApplyNewLayout)(this.lines,v.layout),this._reflowLargerAdjustViewport(e,i,v.countRemoved)}}_reflowLargerAdjustViewport(e,i,a){const v=this.getNullCell(d.DEFAULT_ATTR_DATA);let u=a;for(;u-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length=0;p--){let c=this.lines.get(p);if(!c||!c.isWrapped&&c.getTrimmedLength()<=e)continue;const S=[c];for(;c.isWrapped&&p>0;)c=this.lines.get(--p),S.unshift(c);const E=this.ybase+this.y;if(E>=p&&E0&&(v.push({start:p+S.length+u,newLines:O}),u+=O.length),S.push(...O);let I=L.length-1,W=L[I];W===0&&(I--,W=L[I]);let B=S.length-w-1,m=k;for(;B>=0;){const y=Math.min(m,W);if(S[I]===void 0)break;if(S[I].copyCellsFrom(S[B],m-y,W-y,y,!0),W-=y,W===0&&(I--,W=L[I]),m-=y,m===0){B--;const D=Math.max(B,0);m=(0,f.getWrappedLineTrimmedLength)(S,D,this._cols)}}for(let y=0;y0;)this.ybase===0?this.y0){const p=[],c=[];for(let I=0;I=0;I--)if(L&&L.start>E+w){for(let W=L.newLines.length-1;W>=0;W--)this.lines.set(I--,L.newLines[W]);I++,p.push({index:E+1,amount:L.newLines.length}),w+=L.newLines.length,L=v[++k]}else this.lines.set(I,c[E--]);let A=0;for(let I=p.length-1;I>=0;I--)p[I].index+=A,this.lines.onInsertEmitter.fire(p[I]),A+=p[I].amount;const O=Math.max(0,S+u-this.lines.maxLength);O>0&&this.lines.onTrimEmitter.fire(O)}}translateBufferLineToString(e,i,a=0,v){const u=this.lines.get(e);return u?u.translateToString(i,a,v):""}getWrappedRangeForLine(e){let i=e,a=e;for(;i>0&&this.lines.get(i).isWrapped;)i--;for(;a+10;);return e>=this._cols?this._cols-1:e<0?0:e}nextStop(e){for(e==null&&(e=this.x);!this.tabs[++e]&&e=this._cols?this._cols-1:e<0?0:e}clearMarkers(e){this._isClearing=!0;for(let i=0;i{i.line-=a,i.line<0&&i.dispose()}))),i.register(this.lines.onInsert((a=>{i.line>=a.index&&(i.line+=a.amount)}))),i.register(this.lines.onDelete((a=>{i.line>=a.index&&i.linea.index&&(i.line-=a.amount)}))),i.register(i.onDispose((()=>this._removeMarker(i)))),i}_removeMarker(e){this._isClearing||this.markers.splice(this.markers.indexOf(e),1)}}},8437:(x,r,o)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.BufferLine=r.DEFAULT_ATTR_DATA=void 0;const l=o(3734),_=o(511),n=o(643),d=o(482);r.DEFAULT_ATTR_DATA=Object.freeze(new l.AttributeData);let f=0;class g{constructor(t,s,e=!1){this.isWrapped=e,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*t);const i=s||_.CellData.fromCharData([0,n.NULL_CELL_CHAR,n.NULL_CELL_WIDTH,n.NULL_CELL_CODE]);for(let a=0;a>22,2097152&s?this._combined[t].charCodeAt(this._combined[t].length-1):e]}set(t,s){this._data[3*t+1]=s[n.CHAR_DATA_ATTR_INDEX],s[n.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[t]=s[1],this._data[3*t+0]=2097152|t|s[n.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*t+0]=s[n.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|s[n.CHAR_DATA_WIDTH_INDEX]<<22}getWidth(t){return this._data[3*t+0]>>22}hasWidth(t){return 12582912&this._data[3*t+0]}getFg(t){return this._data[3*t+1]}getBg(t){return this._data[3*t+2]}hasContent(t){return 4194303&this._data[3*t+0]}getCodePoint(t){const s=this._data[3*t+0];return 2097152&s?this._combined[t].charCodeAt(this._combined[t].length-1):2097151&s}isCombined(t){return 2097152&this._data[3*t+0]}getString(t){const s=this._data[3*t+0];return 2097152&s?this._combined[t]:2097151&s?(0,d.stringFromCodePoint)(2097151&s):""}isProtected(t){return 536870912&this._data[3*t+2]}loadCell(t,s){return f=3*t,s.content=this._data[f+0],s.fg=this._data[f+1],s.bg=this._data[f+2],2097152&s.content&&(s.combinedData=this._combined[t]),268435456&s.bg&&(s.extended=this._extendedAttrs[t]),s}setCell(t,s){2097152&s.content&&(this._combined[t]=s.combinedData),268435456&s.bg&&(this._extendedAttrs[t]=s.extended),this._data[3*t+0]=s.content,this._data[3*t+1]=s.fg,this._data[3*t+2]=s.bg}setCellFromCodepoint(t,s,e,i){268435456&i.bg&&(this._extendedAttrs[t]=i.extended),this._data[3*t+0]=s|e<<22,this._data[3*t+1]=i.fg,this._data[3*t+2]=i.bg}addCodepointToCell(t,s,e){let i=this._data[3*t+0];2097152&i?this._combined[t]+=(0,d.stringFromCodePoint)(s):2097151&i?(this._combined[t]=(0,d.stringFromCodePoint)(2097151&i)+(0,d.stringFromCodePoint)(s),i&=-2097152,i|=2097152):i=s|4194304,e&&(i&=-12582913,i|=e<<22),this._data[3*t+0]=i}insertCells(t,s,e){if((t%=this.length)&&this.getWidth(t-1)===2&&this.setCellFromCodepoint(t-1,0,1,e),s=0;--a)this.setCell(t+s+a,this.loadCell(t+a,i));for(let a=0;athis.length){if(this._data.buffer.byteLength>=4*e)this._data=new Uint32Array(this._data.buffer,0,e);else{const i=new Uint32Array(e);i.set(this._data),this._data=i}for(let i=this.length;i=t&&delete this._combined[u]}const a=Object.keys(this._extendedAttrs);for(let v=0;v=t&&delete this._extendedAttrs[u]}}return this.length=t,4*e*2=0;--t)if(4194303&this._data[3*t+0])return t+(this._data[3*t+0]>>22);return 0}getNoBgTrimmedLength(){for(let t=this.length-1;t>=0;--t)if(4194303&this._data[3*t+0]||50331648&this._data[3*t+2])return t+(this._data[3*t+0]>>22);return 0}copyCellsFrom(t,s,e,i,a){const v=t._data;if(a)for(let p=i-1;p>=0;p--){for(let c=0;c<3;c++)this._data[3*(e+p)+c]=v[3*(s+p)+c];268435456&v[3*(s+p)+2]&&(this._extendedAttrs[e+p]=t._extendedAttrs[s+p])}else for(let p=0;p=s&&(this._combined[c-s+e]=t._combined[c])}}translateToString(t,s,e,i){s=s??0,e=e??this.length,t&&(e=Math.min(e,this.getTrimmedLength())),i&&(i.length=0);let a="";for(;s>22||1}return i&&i.push(s),a}}r.BufferLine=g},4841:(x,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.getRangeLength=void 0,r.getRangeLength=function(o,l){if(o.start.y>o.end.y)throw new Error(`Buffer range end (${o.end.x}, ${o.end.y}) cannot be before start (${o.start.x}, ${o.start.y})`);return l*(o.end.y-o.start.y)+(o.end.x-o.start.x+1)}},4634:(x,r)=>{function o(l,_,n){if(_===l.length-1)return l[_].getTrimmedLength();const d=!l[_].hasContent(n-1)&&l[_].getWidth(n-1)===1,f=l[_+1].getWidth(0)===2;return d&&f?n-1:n}Object.defineProperty(r,"__esModule",{value:!0}),r.getWrappedLineTrimmedLength=r.reflowSmallerGetNewLineLengths=r.reflowLargerApplyNewLayout=r.reflowLargerCreateNewLayout=r.reflowLargerGetLinesToRemove=void 0,r.reflowLargerGetLinesToRemove=function(l,_,n,d,f){const g=[];for(let h=0;h=h&&d0&&(c>i||e[c].getTrimmedLength()===0);c--)p++;p>0&&(g.push(h+e.length-p),g.push(p)),h+=e.length-1}return g},r.reflowLargerCreateNewLayout=function(l,_){const n=[];let d=0,f=_[d],g=0;for(let h=0;ho(l,e,_))).reduce(((s,e)=>s+e));let g=0,h=0,t=0;for(;ts&&(g-=s,h++);const e=l[h].getWidth(g-1)===2;e&&g--;const i=e?n-1:n;d.push(i),t+=i}return d},r.getWrappedLineTrimmedLength=o},5295:(x,r,o)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.BufferSet=void 0;const l=o(8460),_=o(844),n=o(9092);class d extends _.Disposable{constructor(g,h){super(),this._optionsService=g,this._bufferService=h,this._onBufferActivate=this.register(new l.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 n.Buffer(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new n.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(g){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(g),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(g,h){this._normal.resize(g,h),this._alt.resize(g,h),this.setupTabStops(g)}setupTabStops(g){this._normal.setupTabStops(g),this._alt.setupTabStops(g)}}r.BufferSet=d},511:(x,r,o)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.CellData=void 0;const l=o(482),_=o(643),n=o(3734);class d extends n.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new n.ExtendedAttrs,this.combinedData=""}static fromCharData(g){const h=new d;return h.setFromCharData(g),h}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,l.stringFromCodePoint)(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(g){this.fg=g[_.CHAR_DATA_ATTR_INDEX],this.bg=0;let h=!1;if(g[_.CHAR_DATA_CHAR_INDEX].length>2)h=!0;else if(g[_.CHAR_DATA_CHAR_INDEX].length===2){const t=g[_.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=t&&t<=56319){const s=g[_.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=s&&s<=57343?this.content=1024*(t-55296)+s-56320+65536|g[_.CHAR_DATA_WIDTH_INDEX]<<22:h=!0}else h=!0}else this.content=g[_.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|g[_.CHAR_DATA_WIDTH_INDEX]<<22;h&&(this.combinedData=g[_.CHAR_DATA_CHAR_INDEX],this.content=2097152|g[_.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}r.CellData=d},643:(x,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.WHITESPACE_CELL_CODE=r.WHITESPACE_CELL_WIDTH=r.WHITESPACE_CELL_CHAR=r.NULL_CELL_CODE=r.NULL_CELL_WIDTH=r.NULL_CELL_CHAR=r.CHAR_DATA_CODE_INDEX=r.CHAR_DATA_WIDTH_INDEX=r.CHAR_DATA_CHAR_INDEX=r.CHAR_DATA_ATTR_INDEX=r.DEFAULT_EXT=r.DEFAULT_ATTR=r.DEFAULT_COLOR=void 0,r.DEFAULT_COLOR=0,r.DEFAULT_ATTR=256|r.DEFAULT_COLOR<<9,r.DEFAULT_EXT=0,r.CHAR_DATA_ATTR_INDEX=0,r.CHAR_DATA_CHAR_INDEX=1,r.CHAR_DATA_WIDTH_INDEX=2,r.CHAR_DATA_CODE_INDEX=3,r.NULL_CELL_CHAR="",r.NULL_CELL_WIDTH=1,r.NULL_CELL_CODE=0,r.WHITESPACE_CELL_CHAR=" ",r.WHITESPACE_CELL_WIDTH=1,r.WHITESPACE_CELL_CODE=32},4863:(x,r,o)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.Marker=void 0;const l=o(8460),_=o(844);class n{get id(){return this._id}constructor(f){this.line=f,this.isDisposed=!1,this._disposables=[],this._id=n._nextId++,this._onDispose=this.register(new l.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(f){return this._disposables.push(f),f}}r.Marker=n,n._nextId=1},7116:(x,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.DEFAULT_CHARSET=r.CHARSETS=void 0,r.CHARSETS={},r.DEFAULT_CHARSET=r.CHARSETS.B,r.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:"≥","{":"π","|":"≠","}":"£","~":"·"},r.CHARSETS.A={"#":"£"},r.CHARSETS.B=void 0,r.CHARSETS[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"},r.CHARSETS.C=r.CHARSETS[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},r.CHARSETS.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"},r.CHARSETS.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"},r.CHARSETS.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"},r.CHARSETS.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"},r.CHARSETS.E=r.CHARSETS[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"},r.CHARSETS.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"},r.CHARSETS.H=r.CHARSETS[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},r.CHARSETS["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"}},2584:(x,r)=>{var o,l,_;Object.defineProperty(r,"__esModule",{value:!0}),r.C1_ESCAPED=r.C1=r.C0=void 0,(function(n){n.NUL="\0",n.SOH="",n.STX="",n.ETX="",n.EOT="",n.ENQ="",n.ACK="",n.BEL="\x07",n.BS="\b",n.HT=" ",n.LF=` -`,n.VT="\v",n.FF="\f",n.CR="\r",n.SO="",n.SI="",n.DLE="",n.DC1="",n.DC2="",n.DC3="",n.DC4="",n.NAK="",n.SYN="",n.ETB="",n.CAN="",n.EM="",n.SUB="",n.ESC="\x1B",n.FS="",n.GS="",n.RS="",n.US="",n.SP=" ",n.DEL=""})(o||(r.C0=o={})),(function(n){n.PAD="€",n.HOP="",n.BPH="‚",n.NBH="ƒ",n.IND="„",n.NEL="…",n.SSA="†",n.ESA="‡",n.HTS="ˆ",n.HTJ="‰",n.VTS="Š",n.PLD="‹",n.PLU="Œ",n.RI="",n.SS2="Ž",n.SS3="",n.DCS="",n.PU1="‘",n.PU2="’",n.STS="“",n.CCH="”",n.MW="•",n.SPA="–",n.EPA="—",n.SOS="˜",n.SGCI="™",n.SCI="š",n.CSI="›",n.ST="œ",n.OSC="",n.PM="ž",n.APC="Ÿ"})(l||(r.C1=l={})),(function(n){n.ST=`${o.ESC}\\`})(_||(r.C1_ESCAPED=_={}))},7399:(x,r,o)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.evaluateKeyboardEvent=void 0;const l=o(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:["'",'"']};r.evaluateKeyboardEvent=function(n,d,f,g){const h={type:0,cancel:!1,key:void 0},t=(n.shiftKey?1:0)|(n.altKey?2:0)|(n.ctrlKey?4:0)|(n.metaKey?8:0);switch(n.keyCode){case 0:n.key==="UIKeyInputUpArrow"?h.key=d?l.C0.ESC+"OA":l.C0.ESC+"[A":n.key==="UIKeyInputLeftArrow"?h.key=d?l.C0.ESC+"OD":l.C0.ESC+"[D":n.key==="UIKeyInputRightArrow"?h.key=d?l.C0.ESC+"OC":l.C0.ESC+"[C":n.key==="UIKeyInputDownArrow"&&(h.key=d?l.C0.ESC+"OB":l.C0.ESC+"[B");break;case 8:h.key=n.ctrlKey?"\b":l.C0.DEL,n.altKey&&(h.key=l.C0.ESC+h.key);break;case 9:if(n.shiftKey){h.key=l.C0.ESC+"[Z";break}h.key=l.C0.HT,h.cancel=!0;break;case 13:h.key=n.altKey?l.C0.ESC+l.C0.CR:l.C0.CR,h.cancel=!0;break;case 27:h.key=l.C0.ESC,n.altKey&&(h.key=l.C0.ESC+l.C0.ESC),h.cancel=!0;break;case 37:if(n.metaKey)break;t?(h.key=l.C0.ESC+"[1;"+(t+1)+"D",h.key===l.C0.ESC+"[1;3D"&&(h.key=l.C0.ESC+(f?"b":"[1;5D"))):h.key=d?l.C0.ESC+"OD":l.C0.ESC+"[D";break;case 39:if(n.metaKey)break;t?(h.key=l.C0.ESC+"[1;"+(t+1)+"C",h.key===l.C0.ESC+"[1;3C"&&(h.key=l.C0.ESC+(f?"f":"[1;5C"))):h.key=d?l.C0.ESC+"OC":l.C0.ESC+"[C";break;case 38:if(n.metaKey)break;t?(h.key=l.C0.ESC+"[1;"+(t+1)+"A",f||h.key!==l.C0.ESC+"[1;3A"||(h.key=l.C0.ESC+"[1;5A")):h.key=d?l.C0.ESC+"OA":l.C0.ESC+"[A";break;case 40:if(n.metaKey)break;t?(h.key=l.C0.ESC+"[1;"+(t+1)+"B",f||h.key!==l.C0.ESC+"[1;3B"||(h.key=l.C0.ESC+"[1;5B")):h.key=d?l.C0.ESC+"OB":l.C0.ESC+"[B";break;case 45:n.shiftKey||n.ctrlKey||(h.key=l.C0.ESC+"[2~");break;case 46:h.key=t?l.C0.ESC+"[3;"+(t+1)+"~":l.C0.ESC+"[3~";break;case 36:h.key=t?l.C0.ESC+"[1;"+(t+1)+"H":d?l.C0.ESC+"OH":l.C0.ESC+"[H";break;case 35:h.key=t?l.C0.ESC+"[1;"+(t+1)+"F":d?l.C0.ESC+"OF":l.C0.ESC+"[F";break;case 33:n.shiftKey?h.type=2:n.ctrlKey?h.key=l.C0.ESC+"[5;"+(t+1)+"~":h.key=l.C0.ESC+"[5~";break;case 34:n.shiftKey?h.type=3:n.ctrlKey?h.key=l.C0.ESC+"[6;"+(t+1)+"~":h.key=l.C0.ESC+"[6~";break;case 112:h.key=t?l.C0.ESC+"[1;"+(t+1)+"P":l.C0.ESC+"OP";break;case 113:h.key=t?l.C0.ESC+"[1;"+(t+1)+"Q":l.C0.ESC+"OQ";break;case 114:h.key=t?l.C0.ESC+"[1;"+(t+1)+"R":l.C0.ESC+"OR";break;case 115:h.key=t?l.C0.ESC+"[1;"+(t+1)+"S":l.C0.ESC+"OS";break;case 116:h.key=t?l.C0.ESC+"[15;"+(t+1)+"~":l.C0.ESC+"[15~";break;case 117:h.key=t?l.C0.ESC+"[17;"+(t+1)+"~":l.C0.ESC+"[17~";break;case 118:h.key=t?l.C0.ESC+"[18;"+(t+1)+"~":l.C0.ESC+"[18~";break;case 119:h.key=t?l.C0.ESC+"[19;"+(t+1)+"~":l.C0.ESC+"[19~";break;case 120:h.key=t?l.C0.ESC+"[20;"+(t+1)+"~":l.C0.ESC+"[20~";break;case 121:h.key=t?l.C0.ESC+"[21;"+(t+1)+"~":l.C0.ESC+"[21~";break;case 122:h.key=t?l.C0.ESC+"[23;"+(t+1)+"~":l.C0.ESC+"[23~";break;case 123:h.key=t?l.C0.ESC+"[24;"+(t+1)+"~":l.C0.ESC+"[24~";break;default:if(!n.ctrlKey||n.shiftKey||n.altKey||n.metaKey)if(f&&!g||!n.altKey||n.metaKey)!f||n.altKey||n.ctrlKey||n.shiftKey||!n.metaKey?n.key&&!n.ctrlKey&&!n.altKey&&!n.metaKey&&n.keyCode>=48&&n.key.length===1?h.key=n.key:n.key&&n.ctrlKey&&(n.key==="_"&&(h.key=l.C0.US),n.key==="@"&&(h.key=l.C0.NUL)):n.keyCode===65&&(h.type=1);else{const s=_[n.keyCode],e=s?.[n.shiftKey?1:0];if(e)h.key=l.C0.ESC+e;else if(n.keyCode>=65&&n.keyCode<=90){const i=n.ctrlKey?n.keyCode-64:n.keyCode+32;let a=String.fromCharCode(i);n.shiftKey&&(a=a.toUpperCase()),h.key=l.C0.ESC+a}else if(n.keyCode===32)h.key=l.C0.ESC+(n.ctrlKey?l.C0.NUL:" ");else if(n.key==="Dead"&&n.code.startsWith("Key")){let i=n.code.slice(3,4);n.shiftKey||(i=i.toLowerCase()),h.key=l.C0.ESC+i,h.cancel=!0}}else n.keyCode>=65&&n.keyCode<=90?h.key=String.fromCharCode(n.keyCode-64):n.keyCode===32?h.key=l.C0.NUL:n.keyCode>=51&&n.keyCode<=55?h.key=String.fromCharCode(n.keyCode-51+27):n.keyCode===56?h.key=l.C0.DEL:n.keyCode===219?h.key=l.C0.ESC:n.keyCode===220?h.key=l.C0.FS:n.keyCode===221&&(h.key=l.C0.GS)}return h}},482:(x,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.Utf8ToUtf32=r.StringToUtf32=r.utf32ToString=r.stringFromCodePoint=void 0,r.stringFromCodePoint=function(o){return o>65535?(o-=65536,String.fromCharCode(55296+(o>>10))+String.fromCharCode(o%1024+56320)):String.fromCharCode(o)},r.utf32ToString=function(o,l=0,_=o.length){let n="";for(let d=l;d<_;++d){let f=o[d];f>65535?(f-=65536,n+=String.fromCharCode(55296+(f>>10))+String.fromCharCode(f%1024+56320)):n+=String.fromCharCode(f)}return n},r.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(o,l){const _=o.length;if(!_)return 0;let n=0,d=0;if(this._interim){const f=o.charCodeAt(d++);56320<=f&&f<=57343?l[n++]=1024*(this._interim-55296)+f-56320+65536:(l[n++]=this._interim,l[n++]=f),this._interim=0}for(let f=d;f<_;++f){const g=o.charCodeAt(f);if(55296<=g&&g<=56319){if(++f>=_)return this._interim=g,n;const h=o.charCodeAt(f);56320<=h&&h<=57343?l[n++]=1024*(g-55296)+h-56320+65536:(l[n++]=g,l[n++]=h)}else g!==65279&&(l[n++]=g)}return n}},r.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(o,l){const _=o.length;if(!_)return 0;let n,d,f,g,h=0,t=0,s=0;if(this.interim[0]){let a=!1,v=this.interim[0];v&=(224&v)==192?31:(240&v)==224?15:7;let u,p=0;for(;(u=63&this.interim[++p])&&p<4;)v<<=6,v|=u;const c=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,S=c-p;for(;s=_)return 0;if(u=o[s++],(192&u)!=128){s--,a=!0;break}this.interim[p++]=u,v<<=6,v|=63&u}a||(c===2?v<128?s--:l[h++]=v:c===3?v<2048||v>=55296&&v<=57343||v===65279||(l[h++]=v):v<65536||v>1114111||(l[h++]=v)),this.interim.fill(0)}const e=_-4;let i=s;for(;i<_;){for(;!(!(i=_)return this.interim[0]=n,h;if(d=o[i++],(192&d)!=128){i--;continue}if(t=(31&n)<<6|63&d,t<128){i--;continue}l[h++]=t}else if((240&n)==224){if(i>=_)return this.interim[0]=n,h;if(d=o[i++],(192&d)!=128){i--;continue}if(i>=_)return this.interim[0]=n,this.interim[1]=d,h;if(f=o[i++],(192&f)!=128){i--;continue}if(t=(15&n)<<12|(63&d)<<6|63&f,t<2048||t>=55296&&t<=57343||t===65279)continue;l[h++]=t}else if((248&n)==240){if(i>=_)return this.interim[0]=n,h;if(d=o[i++],(192&d)!=128){i--;continue}if(i>=_)return this.interim[0]=n,this.interim[1]=d,h;if(f=o[i++],(192&f)!=128){i--;continue}if(i>=_)return this.interim[0]=n,this.interim[1]=d,this.interim[2]=f,h;if(g=o[i++],(192&g)!=128){i--;continue}if(t=(7&n)<<18|(63&d)<<12|(63&f)<<6|63&g,t<65536||t>1114111)continue;l[h++]=t}}return h}}},225:(x,r,o)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.UnicodeV6=void 0;const l=o(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]],n=[[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 d;r.UnicodeV6=class{constructor(){if(this.version="6",!d){d=new Uint8Array(65536),d.fill(1),d[0]=0,d.fill(0,1,32),d.fill(0,127,160),d.fill(2,4352,4448),d[9001]=2,d[9002]=2,d.fill(2,11904,42192),d[12351]=1,d.fill(2,44032,55204),d.fill(2,63744,64256),d.fill(2,65040,65050),d.fill(2,65072,65136),d.fill(2,65280,65377),d.fill(2,65504,65511);for(let f=0;f<_.length;++f)d.fill(0,_[f][0],_[f][1]+1)}}wcwidth(f){return f<32?0:f<127?1:f<65536?d[f]:(function(g,h){let t,s=0,e=h.length-1;if(gh[e][1])return!1;for(;e>=s;)if(t=s+e>>1,g>h[t][1])s=t+1;else{if(!(g=131072&&f<=196605||f>=196608&&f<=262141?2:1}charProperties(f,g){let h=this.wcwidth(f),t=h===0&&g!==0;if(t){const s=l.UnicodeService.extractWidth(g);s===0?t=!1:s>h&&(h=s)}return l.UnicodeService.createPropertyValue(0,h,t)}}},5981:(x,r,o)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.WriteBuffer=void 0;const l=o(8460),_=o(844);class n extends _.Disposable{constructor(f){super(),this._action=f,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0,this._didUserInput=!1,this._onWriteParsed=this.register(new l.EventEmitter),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(f,g){if(g!==void 0&&this._syncCalls>g)return void(this._syncCalls=0);if(this._pendingData+=f.length,this._writeBuffer.push(f),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;let h;for(this._isSyncWriting=!0;h=this._writeBuffer.shift();){this._action(h);const t=this._callbacks.shift();t&&t()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(f,g){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+=f.length,this._writeBuffer.push(f),this._callbacks.push(g),void this._innerWrite();setTimeout((()=>this._innerWrite()))}this._pendingData+=f.length,this._writeBuffer.push(f),this._callbacks.push(g)}_innerWrite(f=0,g=!0){const h=f||Date.now();for(;this._writeBuffer.length>this._bufferOffset;){const t=this._writeBuffer[this._bufferOffset],s=this._action(t,g);if(s){const i=a=>Date.now()-h>=12?setTimeout((()=>this._innerWrite(0,a))):this._innerWrite(h,a);return void s.catch((a=>(queueMicrotask((()=>{throw a})),Promise.resolve(!1)))).then(i)}const e=this._callbacks[this._bufferOffset];if(e&&e(),this._bufferOffset++,this._pendingData-=t.length,Date.now()-h>=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()}}r.WriteBuffer=n},5941:(x,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.toRgbString=r.parseColor=void 0;const o=/^([\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})$/,l=/^[\da-f]+$/;function _(n,d){const f=n.toString(16),g=f.length<2?"0"+f:f;switch(d){case 4:return f[0];case 8:return g;case 12:return(g+g).slice(0,3);default:return g+g}}r.parseColor=function(n){if(!n)return;let d=n.toLowerCase();if(d.indexOf("rgb:")===0){d=d.slice(4);const f=o.exec(d);if(f){const g=f[1]?15:f[4]?255:f[7]?4095:65535;return[Math.round(parseInt(f[1]||f[4]||f[7]||f[10],16)/g*255),Math.round(parseInt(f[2]||f[5]||f[8]||f[11],16)/g*255),Math.round(parseInt(f[3]||f[6]||f[9]||f[12],16)/g*255)]}}else if(d.indexOf("#")===0&&(d=d.slice(1),l.exec(d)&&[3,6,9,12].includes(d.length))){const f=d.length/3,g=[0,0,0];for(let h=0;h<3;++h){const t=parseInt(d.slice(f*h,f*h+f),16);g[h]=f===1?t<<4:f===2?t:f===3?t>>4:t>>8}return g}},r.toRgbString=function(n,d=16){const[f,g,h]=n;return`rgb:${_(f,d)}/${_(g,d)}/${_(h,d)}`}},5770:(x,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.PAYLOAD_LIMIT=void 0,r.PAYLOAD_LIMIT=1e7},6351:(x,r,o)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.DcsHandler=r.DcsParser=void 0;const l=o(482),_=o(8742),n=o(5770),d=[];r.DcsParser=class{constructor(){this._handlers=Object.create(null),this._active=d,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=d}registerHandler(g,h){this._handlers[g]===void 0&&(this._handlers[g]=[]);const t=this._handlers[g];return t.push(h),{dispose:()=>{const s=t.indexOf(h);s!==-1&&t.splice(s,1)}}}clearHandler(g){this._handlers[g]&&delete this._handlers[g]}setHandlerFallback(g){this._handlerFb=g}reset(){if(this._active.length)for(let g=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;g>=0;--g)this._active[g].unhook(!1);this._stack.paused=!1,this._active=d,this._ident=0}hook(g,h){if(this.reset(),this._ident=g,this._active=this._handlers[g]||d,this._active.length)for(let t=this._active.length-1;t>=0;t--)this._active[t].hook(h);else this._handlerFb(this._ident,"HOOK",h)}put(g,h,t){if(this._active.length)for(let s=this._active.length-1;s>=0;s--)this._active[s].put(g,h,t);else this._handlerFb(this._ident,"PUT",(0,l.utf32ToString)(g,h,t))}unhook(g,h=!0){if(this._active.length){let t=!1,s=this._active.length-1,e=!1;if(this._stack.paused&&(s=this._stack.loopPosition-1,t=h,e=this._stack.fallThrough,this._stack.paused=!1),!e&&t===!1){for(;s>=0&&(t=this._active[s].unhook(g),t!==!0);s--)if(t instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=s,this._stack.fallThrough=!1,t;s--}for(;s>=0;s--)if(t=this._active[s].unhook(!1),t instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=s,this._stack.fallThrough=!0,t}else this._handlerFb(this._ident,"UNHOOK",g);this._active=d,this._ident=0}};const f=new _.Params;f.addParam(0),r.DcsHandler=class{constructor(g){this._handler=g,this._data="",this._params=f,this._hitLimit=!1}hook(g){this._params=g.length>1||g.params[0]?g.clone():f,this._data="",this._hitLimit=!1}put(g,h,t){this._hitLimit||(this._data+=(0,l.utf32ToString)(g,h,t),this._data.length>n.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}unhook(g){let h=!1;if(this._hitLimit)h=!1;else if(g&&(h=this._handler(this._data,this._params),h instanceof Promise))return h.then((t=>(this._params=f,this._data="",this._hitLimit=!1,t)));return this._params=f,this._data="",this._hitLimit=!1,h}}},2015:(x,r,o)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.EscapeSequenceParser=r.VT500_TRANSITION_TABLE=r.TransitionTable=void 0;const l=o(844),_=o(8742),n=o(6242),d=o(6351);class f{constructor(s){this.table=new Uint8Array(s)}setDefault(s,e){this.table.fill(s<<4|e)}add(s,e,i,a){this.table[e<<8|s]=i<<4|a}addMany(s,e,i,a){for(let v=0;vc)),e=(p,c)=>s.slice(p,c),i=e(32,127),a=e(0,24);a.push(25),a.push.apply(a,e(28,32));const v=e(0,14);let u;for(u in t.setDefault(1,0),t.addMany(i,0,2,0),v)t.addMany([24,26,153,154],u,3,0),t.addMany(e(128,144),u,3,0),t.addMany(e(144,152),u,3,0),t.add(156,u,0,0),t.add(27,u,11,1),t.add(157,u,4,8),t.addMany([152,158,159],u,0,7),t.add(155,u,11,3),t.add(144,u,11,9);return t.addMany(a,0,3,0),t.addMany(a,1,3,1),t.add(127,1,0,1),t.addMany(a,8,0,8),t.addMany(a,3,3,3),t.add(127,3,0,3),t.addMany(a,4,3,4),t.add(127,4,0,4),t.addMany(a,6,3,6),t.addMany(a,5,3,5),t.add(127,5,0,5),t.addMany(a,2,3,2),t.add(127,2,0,2),t.add(93,1,4,8),t.addMany(i,8,5,8),t.add(127,8,5,8),t.addMany([156,27,24,26,7],8,6,0),t.addMany(e(28,32),8,0,8),t.addMany([88,94,95],1,0,7),t.addMany(i,7,0,7),t.addMany(a,7,0,7),t.add(156,7,0,0),t.add(127,7,0,7),t.add(91,1,11,3),t.addMany(e(64,127),3,7,0),t.addMany(e(48,60),3,8,4),t.addMany([60,61,62,63],3,9,4),t.addMany(e(48,60),4,8,4),t.addMany(e(64,127),4,7,0),t.addMany([60,61,62,63],4,0,6),t.addMany(e(32,64),6,0,6),t.add(127,6,0,6),t.addMany(e(64,127),6,0,0),t.addMany(e(32,48),3,9,5),t.addMany(e(32,48),5,9,5),t.addMany(e(48,64),5,0,6),t.addMany(e(64,127),5,7,0),t.addMany(e(32,48),4,9,5),t.addMany(e(32,48),1,9,2),t.addMany(e(32,48),2,9,2),t.addMany(e(48,127),2,10,0),t.addMany(e(48,80),1,10,0),t.addMany(e(81,88),1,10,0),t.addMany([89,90,92],1,10,0),t.addMany(e(96,127),1,10,0),t.add(80,1,11,9),t.addMany(a,9,0,9),t.add(127,9,0,9),t.addMany(e(28,32),9,0,9),t.addMany(e(32,48),9,9,12),t.addMany(e(48,60),9,8,10),t.addMany([60,61,62,63],9,9,10),t.addMany(a,11,0,11),t.addMany(e(32,128),11,0,11),t.addMany(e(28,32),11,0,11),t.addMany(a,10,0,10),t.add(127,10,0,10),t.addMany(e(28,32),10,0,10),t.addMany(e(48,60),10,8,10),t.addMany([60,61,62,63],10,0,11),t.addMany(e(32,48),10,9,12),t.addMany(a,12,0,12),t.add(127,12,0,12),t.addMany(e(28,32),12,0,12),t.addMany(e(32,48),12,9,12),t.addMany(e(48,64),12,0,11),t.addMany(e(64,127),12,12,13),t.addMany(e(64,127),10,12,13),t.addMany(e(64,127),9,12,13),t.addMany(a,13,13,13),t.addMany(i,13,13,13),t.add(127,13,0,13),t.addMany([27,156,24,26],13,14,0),t.add(g,0,2,0),t.add(g,8,5,8),t.add(g,6,0,6),t.add(g,11,0,11),t.add(g,13,13,13),t})();class h extends l.Disposable{constructor(s=r.VT500_TRANSITION_TABLE){super(),this._transitions=s,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=(e,i,a)=>{},this._executeHandlerFb=e=>{},this._csiHandlerFb=(e,i)=>{},this._escHandlerFb=e=>{},this._errorHandlerFb=e=>e,this._printHandler=this._printHandlerFb,this._executeHandlers=Object.create(null),this._csiHandlers=Object.create(null),this._escHandlers=Object.create(null),this.register((0,l.toDisposable)((()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)}))),this._oscParser=this.register(new n.OscParser),this._dcsParser=this.register(new d.DcsParser),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},(()=>!0))}_identifier(s,e=[64,126]){let i=0;if(s.prefix){if(s.prefix.length>1)throw new Error("only one byte as prefix supported");if(i=s.prefix.charCodeAt(0),i&&60>i||i>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(s.intermediates){if(s.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(let v=0;vu||u>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");i<<=8,i|=u}}if(s.final.length!==1)throw new Error("final must be a single byte");const a=s.final.charCodeAt(0);if(e[0]>a||a>e[1])throw new Error(`final must be in range ${e[0]} .. ${e[1]}`);return i<<=8,i|=a,i}identToString(s){const e=[];for(;s;)e.push(String.fromCharCode(255&s)),s>>=8;return e.reverse().join("")}setPrintHandler(s){this._printHandler=s}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(s,e){const i=this._identifier(s,[48,126]);this._escHandlers[i]===void 0&&(this._escHandlers[i]=[]);const a=this._escHandlers[i];return a.push(e),{dispose:()=>{const v=a.indexOf(e);v!==-1&&a.splice(v,1)}}}clearEscHandler(s){this._escHandlers[this._identifier(s,[48,126])]&&delete this._escHandlers[this._identifier(s,[48,126])]}setEscHandlerFallback(s){this._escHandlerFb=s}setExecuteHandler(s,e){this._executeHandlers[s.charCodeAt(0)]=e}clearExecuteHandler(s){this._executeHandlers[s.charCodeAt(0)]&&delete this._executeHandlers[s.charCodeAt(0)]}setExecuteHandlerFallback(s){this._executeHandlerFb=s}registerCsiHandler(s,e){const i=this._identifier(s);this._csiHandlers[i]===void 0&&(this._csiHandlers[i]=[]);const a=this._csiHandlers[i];return a.push(e),{dispose:()=>{const v=a.indexOf(e);v!==-1&&a.splice(v,1)}}}clearCsiHandler(s){this._csiHandlers[this._identifier(s)]&&delete this._csiHandlers[this._identifier(s)]}setCsiHandlerFallback(s){this._csiHandlerFb=s}registerDcsHandler(s,e){return this._dcsParser.registerHandler(this._identifier(s),e)}clearDcsHandler(s){this._dcsParser.clearHandler(this._identifier(s))}setDcsHandlerFallback(s){this._dcsParser.setHandlerFallback(s)}registerOscHandler(s,e){return this._oscParser.registerHandler(s,e)}clearOscHandler(s){this._oscParser.clearHandler(s)}setOscHandlerFallback(s){this._oscParser.setHandlerFallback(s)}setErrorHandler(s){this._errorHandler=s}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(s,e,i,a,v){this._parseStack.state=s,this._parseStack.handlers=e,this._parseStack.handlerPos=i,this._parseStack.transition=a,this._parseStack.chunkPos=v}parse(s,e,i){let a,v=0,u=0,p=0;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,p=this._parseStack.chunkPos+1;else{if(i===void 0||this._parseStack.state===1)throw this._parseStack.state=1,new Error("improper continuation due to previous async handler, giving up parsing");const c=this._parseStack.handlers;let S=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(i===!1&&S>-1){for(;S>=0&&(a=c[S](this._params),a!==!0);S--)if(a instanceof Promise)return this._parseStack.handlerPos=S,a}this._parseStack.handlers=[];break;case 4:if(i===!1&&S>-1){for(;S>=0&&(a=c[S](),a!==!0);S--)if(a instanceof Promise)return this._parseStack.handlerPos=S,a}this._parseStack.handlers=[];break;case 6:if(v=s[this._parseStack.chunkPos],a=this._dcsParser.unhook(v!==24&&v!==26,i),a)return a;v===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(v=s[this._parseStack.chunkPos],a=this._oscParser.end(v!==24&&v!==26,i),a)return a;v===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0}this._parseStack.state=0,p=this._parseStack.chunkPos+1,this.precedingJoinState=0,this.currentState=15&this._parseStack.transition}for(let c=p;c>4){case 2:for(let w=c+1;;++w){if(w>=e||(v=s[w])<32||v>126&&v=e||(v=s[w])<32||v>126&&v=e||(v=s[w])<32||v>126&&v=e||(v=s[w])<32||v>126&&v=0&&(a=S[E](this._params),a!==!0);E--)if(a instanceof Promise)return this._preserveStack(3,S,E,u,c),a;E<0&&this._csiHandlerFb(this._collect<<8|v,this._params),this.precedingJoinState=0;break;case 8:do switch(v){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(v-48)}while(++c47&&v<60);c--;break;case 9:this._collect<<=8,this._collect|=v;break;case 10:const k=this._escHandlers[this._collect<<8|v];let L=k?k.length-1:-1;for(;L>=0&&(a=k[L](),a!==!0);L--)if(a instanceof Promise)return this._preserveStack(4,k,L,u,c),a;L<0&&this._escHandlerFb(this._collect<<8|v),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|v,this._params);break;case 13:for(let w=c+1;;++w)if(w>=e||(v=s[w])===24||v===26||v===27||v>127&&v=e||(v=s[w])<32||v>127&&v{Object.defineProperty(r,"__esModule",{value:!0}),r.OscHandler=r.OscParser=void 0;const l=o(5770),_=o(482),n=[];r.OscParser=class{constructor(){this._state=0,this._active=n,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(d,f){this._handlers[d]===void 0&&(this._handlers[d]=[]);const g=this._handlers[d];return g.push(f),{dispose:()=>{const h=g.indexOf(f);h!==-1&&g.splice(h,1)}}}clearHandler(d){this._handlers[d]&&delete this._handlers[d]}setHandlerFallback(d){this._handlerFb=d}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=n}reset(){if(this._state===2)for(let d=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;d>=0;--d)this._active[d].end(!1);this._stack.paused=!1,this._active=n,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||n,this._active.length)for(let d=this._active.length-1;d>=0;d--)this._active[d].start();else this._handlerFb(this._id,"START")}_put(d,f,g){if(this._active.length)for(let h=this._active.length-1;h>=0;h--)this._active[h].put(d,f,g);else this._handlerFb(this._id,"PUT",(0,_.utf32ToString)(d,f,g))}start(){this.reset(),this._state=1}put(d,f,g){if(this._state!==3){if(this._state===1)for(;f0&&this._put(d,f,g)}}end(d,f=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),this._active.length){let g=!1,h=this._active.length-1,t=!1;if(this._stack.paused&&(h=this._stack.loopPosition-1,g=f,t=this._stack.fallThrough,this._stack.paused=!1),!t&&g===!1){for(;h>=0&&(g=this._active[h].end(d),g!==!0);h--)if(g instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=h,this._stack.fallThrough=!1,g;h--}for(;h>=0;h--)if(g=this._active[h].end(!1),g instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=h,this._stack.fallThrough=!0,g}else this._handlerFb(this._id,"END",d);this._active=n,this._id=-1,this._state=0}}},r.OscHandler=class{constructor(d){this._handler=d,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(d,f,g){this._hitLimit||(this._data+=(0,_.utf32ToString)(d,f,g),this._data.length>l.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}end(d){let f=!1;if(this._hitLimit)f=!1;else if(d&&(f=this._handler(this._data),f instanceof Promise))return f.then((g=>(this._data="",this._hitLimit=!1,g)));return this._data="",this._hitLimit=!1,f}}},8742:(x,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.Params=void 0;const o=2147483647;class l{static fromArray(n){const d=new l;if(!n.length)return d;for(let f=Array.isArray(n[0])?1:0;f256)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(n),this.length=0,this._subParams=new Int32Array(d),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(n),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}clone(){const n=new l(this.maxLength,this.maxSubParamsLength);return n.params.set(this.params),n.length=this.length,n._subParams.set(this._subParams),n._subParamsLength=this._subParamsLength,n._subParamsIdx.set(this._subParamsIdx),n._rejectDigits=this._rejectDigits,n._rejectSubDigits=this._rejectSubDigits,n._digitIsSub=this._digitIsSub,n}toArray(){const n=[];for(let d=0;d>8,g=255&this._subParamsIdx[d];g-f>0&&n.push(Array.prototype.slice.call(this._subParams,f,g))}return n}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(n){if(this._digitIsSub=!1,this.length>=this.maxLength)this._rejectDigits=!0;else{if(n<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=n>o?o:n}}addSubParam(n){if(this._digitIsSub=!0,this.length)if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength)this._rejectSubDigits=!0;else{if(n<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=n>o?o:n,this._subParamsIdx[this.length-1]++}}hasSubParams(n){return(255&this._subParamsIdx[n])-(this._subParamsIdx[n]>>8)>0}getSubParams(n){const d=this._subParamsIdx[n]>>8,f=255&this._subParamsIdx[n];return f-d>0?this._subParams.subarray(d,f):null}getSubParamsAll(){const n={};for(let d=0;d>8,g=255&this._subParamsIdx[d];g-f>0&&(n[d]=this._subParams.slice(f,g))}return n}addDigit(n){let d;if(this._rejectDigits||!(d=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;const f=this._digitIsSub?this._subParams:this.params,g=f[d-1];f[d-1]=~g?Math.min(10*g+n,o):n}}r.Params=l},5741:(x,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.AddonManager=void 0,r.AddonManager=class{constructor(){this._addons=[]}dispose(){for(let o=this._addons.length-1;o>=0;o--)this._addons[o].instance.dispose()}loadAddon(o,l){const _={instance:l,dispose:l.dispose,isDisposed:!1};this._addons.push(_),l.dispose=()=>this._wrappedAddonDispose(_),l.activate(o)}_wrappedAddonDispose(o){if(o.isDisposed)return;let l=-1;for(let _=0;_{Object.defineProperty(r,"__esModule",{value:!0}),r.BufferApiView=void 0;const l=o(3785),_=o(511);r.BufferApiView=class{constructor(n,d){this._buffer=n,this.type=d}init(n){return this._buffer=n,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(n){const d=this._buffer.lines.get(n);if(d)return new l.BufferLineApiView(d)}getNullCell(){return new _.CellData}}},3785:(x,r,o)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.BufferLineApiView=void 0;const l=o(511);r.BufferLineApiView=class{constructor(_){this._line=_}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(_,n){if(!(_<0||_>=this._line.length))return n?(this._line.loadCell(_,n),n):this._line.loadCell(_,new l.CellData)}translateToString(_,n,d){return this._line.translateToString(_,n,d)}}},8285:(x,r,o)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.BufferNamespaceApi=void 0;const l=o(8771),_=o(8460),n=o(844);class d extends n.Disposable{constructor(g){super(),this._core=g,this._onBufferChange=this.register(new _.EventEmitter),this.onBufferChange=this._onBufferChange.event,this._normal=new l.BufferApiView(this._core.buffers.normal,"normal"),this._alternate=new l.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)}}r.BufferNamespaceApi=d},7975:(x,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.ParserApi=void 0,r.ParserApi=class{constructor(o){this._core=o}registerCsiHandler(o,l){return this._core.registerCsiHandler(o,(_=>l(_.toArray())))}addCsiHandler(o,l){return this.registerCsiHandler(o,l)}registerDcsHandler(o,l){return this._core.registerDcsHandler(o,((_,n)=>l(_,n.toArray())))}addDcsHandler(o,l){return this.registerDcsHandler(o,l)}registerEscHandler(o,l){return this._core.registerEscHandler(o,l)}addEscHandler(o,l){return this.registerEscHandler(o,l)}registerOscHandler(o,l){return this._core.registerOscHandler(o,l)}addOscHandler(o,l){return this.registerOscHandler(o,l)}}},7090:(x,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.UnicodeApi=void 0,r.UnicodeApi=class{constructor(o){this._core=o}register(o){this._core.unicodeService.register(o)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(o){this._core.unicodeService.activeVersion=o}}},744:function(x,r,o){var l=this&&this.__decorate||function(t,s,e,i){var a,v=arguments.length,u=v<3?s:i===null?i=Object.getOwnPropertyDescriptor(s,e):i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")u=Reflect.decorate(t,s,e,i);else for(var p=t.length-1;p>=0;p--)(a=t[p])&&(u=(v<3?a(u):v>3?a(s,e,u):a(s,e))||u);return v>3&&u&&Object.defineProperty(s,e,u),u},_=this&&this.__param||function(t,s){return function(e,i){s(e,i,t)}};Object.defineProperty(r,"__esModule",{value:!0}),r.BufferService=r.MINIMUM_ROWS=r.MINIMUM_COLS=void 0;const n=o(8460),d=o(844),f=o(5295),g=o(2585);r.MINIMUM_COLS=2,r.MINIMUM_ROWS=1;let h=r.BufferService=class extends d.Disposable{get buffer(){return this.buffers.active}constructor(t){super(),this.isUserScrolling=!1,this._onResize=this.register(new n.EventEmitter),this.onResize=this._onResize.event,this._onScroll=this.register(new n.EventEmitter),this.onScroll=this._onScroll.event,this.cols=Math.max(t.rawOptions.cols||0,r.MINIMUM_COLS),this.rows=Math.max(t.rawOptions.rows||0,r.MINIMUM_ROWS),this.buffers=this.register(new f.BufferSet(t,this))}resize(t,s){this.cols=t,this.rows=s,this.buffers.resize(t,s),this._onResize.fire({cols:t,rows:s})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(t,s=!1){const e=this.buffer;let i;i=this._cachedBlankLine,i&&i.length===this.cols&&i.getFg(0)===t.fg&&i.getBg(0)===t.bg||(i=e.getBlankLine(t,s),this._cachedBlankLine=i),i.isWrapped=s;const a=e.ybase+e.scrollTop,v=e.ybase+e.scrollBottom;if(e.scrollTop===0){const u=e.lines.isFull;v===e.lines.length-1?u?e.lines.recycle().copyFrom(i):e.lines.push(i.clone()):e.lines.splice(v+1,0,i.clone()),u?this.isUserScrolling&&(e.ydisp=Math.max(e.ydisp-1,0)):(e.ybase++,this.isUserScrolling||e.ydisp++)}else{const u=v-a+1;e.lines.shiftElements(a+1,u-1,-1),e.lines.set(v,i.clone())}this.isUserScrolling||(e.ydisp=e.ybase),this._onScroll.fire(e.ydisp)}scrollLines(t,s,e){const i=this.buffer;if(t<0){if(i.ydisp===0)return;this.isUserScrolling=!0}else t+i.ydisp>=i.ybase&&(this.isUserScrolling=!1);const a=i.ydisp;i.ydisp=Math.max(Math.min(i.ydisp+t,i.ybase),0),a!==i.ydisp&&(s||this._onScroll.fire(i.ydisp))}};r.BufferService=h=l([_(0,g.IOptionsService)],h)},7994:(x,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.CharsetService=void 0,r.CharsetService=class{constructor(){this.glevel=0,this._charsets=[]}reset(){this.charset=void 0,this._charsets=[],this.glevel=0}setgLevel(o){this.glevel=o,this.charset=this._charsets[o]}setgCharset(o,l){this._charsets[o]=l,this.glevel===o&&(this.charset=l)}}},1753:function(x,r,o){var l=this&&this.__decorate||function(i,a,v,u){var p,c=arguments.length,S=c<3?a:u===null?u=Object.getOwnPropertyDescriptor(a,v):u;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")S=Reflect.decorate(i,a,v,u);else for(var E=i.length-1;E>=0;E--)(p=i[E])&&(S=(c<3?p(S):c>3?p(a,v,S):p(a,v))||S);return c>3&&S&&Object.defineProperty(a,v,S),S},_=this&&this.__param||function(i,a){return function(v,u){a(v,u,i)}};Object.defineProperty(r,"__esModule",{value:!0}),r.CoreMouseService=void 0;const n=o(2585),d=o(8460),f=o(844),g={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:i=>i.button!==4&&i.action===1&&(i.ctrl=!1,i.alt=!1,i.shift=!1,!0)},VT200:{events:19,restrict:i=>i.action!==32},DRAG:{events:23,restrict:i=>i.action!==32||i.button!==3},ANY:{events:31,restrict:i=>!0}};function h(i,a){let v=(i.ctrl?16:0)|(i.shift?4:0)|(i.alt?8:0);return i.button===4?(v|=64,v|=i.action):(v|=3&i.button,4&i.button&&(v|=64),8&i.button&&(v|=128),i.action===32?v|=32:i.action!==0||a||(v|=3)),v}const t=String.fromCharCode,s={DEFAULT:i=>{const a=[h(i,!1)+32,i.col+32,i.row+32];return a[0]>255||a[1]>255||a[2]>255?"":`\x1B[M${t(a[0])}${t(a[1])}${t(a[2])}`},SGR:i=>{const a=i.action===0&&i.button!==4?"m":"M";return`\x1B[<${h(i,!0)};${i.col};${i.row}${a}`},SGR_PIXELS:i=>{const a=i.action===0&&i.button!==4?"m":"M";return`\x1B[<${h(i,!0)};${i.x};${i.y}${a}`}};let e=r.CoreMouseService=class extends f.Disposable{constructor(i,a){super(),this._bufferService=i,this._coreService=a,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._onProtocolChange=this.register(new d.EventEmitter),this.onProtocolChange=this._onProtocolChange.event;for(const v of Object.keys(g))this.addProtocol(v,g[v]);for(const v of Object.keys(s))this.addEncoding(v,s[v]);this.reset()}addProtocol(i,a){this._protocols[i]=a}addEncoding(i,a){this._encodings[i]=a}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(i){if(!this._protocols[i])throw new Error(`unknown protocol "${i}"`);this._activeProtocol=i,this._onProtocolChange.fire(this._protocols[i].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(i){if(!this._encodings[i])throw new Error(`unknown encoding "${i}"`);this._activeEncoding=i}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null}triggerMouseEvent(i){if(i.col<0||i.col>=this._bufferService.cols||i.row<0||i.row>=this._bufferService.rows||i.button===4&&i.action===32||i.button===3&&i.action!==32||i.button!==4&&(i.action===2||i.action===3)||(i.col++,i.row++,i.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,i,this._activeEncoding==="SGR_PIXELS"))||!this._protocols[this._activeProtocol].restrict(i))return!1;const a=this._encodings[this._activeEncoding](i);return a&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(a):this._coreService.triggerDataEvent(a,!0)),this._lastEvent=i,!0}explainEvents(i){return{down:!!(1&i),up:!!(2&i),drag:!!(4&i),move:!!(8&i),wheel:!!(16&i)}}_equalEvents(i,a,v){if(v){if(i.x!==a.x||i.y!==a.y)return!1}else if(i.col!==a.col||i.row!==a.row)return!1;return i.button===a.button&&i.action===a.action&&i.ctrl===a.ctrl&&i.alt===a.alt&&i.shift===a.shift}};r.CoreMouseService=e=l([_(0,n.IBufferService),_(1,n.ICoreService)],e)},6975:function(x,r,o){var l=this&&this.__decorate||function(e,i,a,v){var u,p=arguments.length,c=p<3?i:v===null?v=Object.getOwnPropertyDescriptor(i,a):v;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")c=Reflect.decorate(e,i,a,v);else for(var S=e.length-1;S>=0;S--)(u=e[S])&&(c=(p<3?u(c):p>3?u(i,a,c):u(i,a))||c);return p>3&&c&&Object.defineProperty(i,a,c),c},_=this&&this.__param||function(e,i){return function(a,v){i(a,v,e)}};Object.defineProperty(r,"__esModule",{value:!0}),r.CoreService=void 0;const n=o(1439),d=o(8460),f=o(844),g=o(2585),h=Object.freeze({insertMode:!1}),t=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,origin:!1,reverseWraparound:!1,sendFocus:!1,wraparound:!0});let s=r.CoreService=class extends f.Disposable{constructor(e,i,a){super(),this._bufferService=e,this._logService=i,this._optionsService=a,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this.register(new d.EventEmitter),this.onData=this._onData.event,this._onUserInput=this.register(new d.EventEmitter),this.onUserInput=this._onUserInput.event,this._onBinary=this.register(new d.EventEmitter),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this.register(new d.EventEmitter),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=(0,n.clone)(h),this.decPrivateModes=(0,n.clone)(t)}reset(){this.modes=(0,n.clone)(h),this.decPrivateModes=(0,n.clone)(t)}triggerDataEvent(e,i=!1){if(this._optionsService.rawOptions.disableStdin)return;const a=this._bufferService.buffer;i&&this._optionsService.rawOptions.scrollOnUserInput&&a.ybase!==a.ydisp&&this._onRequestScrollToBottom.fire(),i&&this._onUserInput.fire(),this._logService.debug(`sending data "${e}"`,(()=>e.split("").map((v=>v.charCodeAt(0))))),this._onData.fire(e)}triggerBinaryEvent(e){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${e}"`,(()=>e.split("").map((i=>i.charCodeAt(0))))),this._onBinary.fire(e))}};r.CoreService=s=l([_(0,g.IBufferService),_(1,g.ILogService),_(2,g.IOptionsService)],s)},9074:(x,r,o)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.DecorationService=void 0;const l=o(8055),_=o(8460),n=o(844),d=o(6106);let f=0,g=0;class h extends n.Disposable{get decorations(){return this._decorations.values()}constructor(){super(),this._decorations=new d.SortedList((e=>e?.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,n.toDisposable)((()=>this.reset())))}registerDecoration(e){if(e.marker.isDisposed)return;const i=new t(e);if(i){const a=i.marker.onDispose((()=>i.dispose()));i.onDispose((()=>{i&&(this._decorations.delete(i)&&this._onDecorationRemoved.fire(i),a.dispose())})),this._decorations.insert(i),this._onDecorationRegistered.fire(i)}return i}reset(){for(const e of this._decorations.values())e.dispose();this._decorations.clear()}*getDecorationsAtCell(e,i,a){let v=0,u=0;for(const p of this._decorations.getKeyIterator(i))v=p.options.x??0,u=v+(p.options.width??1),e>=v&&e{f=u.options.x??0,g=f+(u.options.width??1),e>=f&&e{Object.defineProperty(r,"__esModule",{value:!0}),r.InstantiationService=r.ServiceCollection=void 0;const l=o(2585),_=o(8343);class n{constructor(...f){this._entries=new Map;for(const[g,h]of f)this.set(g,h)}set(f,g){const h=this._entries.get(f);return this._entries.set(f,g),h}forEach(f){for(const[g,h]of this._entries.entries())f(g,h)}has(f){return this._entries.has(f)}get(f){return this._entries.get(f)}}r.ServiceCollection=n,r.InstantiationService=class{constructor(){this._services=new n,this._services.set(l.IInstantiationService,this)}setService(d,f){this._services.set(d,f)}getService(d){return this._services.get(d)}createInstance(d,...f){const g=(0,_.getServiceDependencies)(d).sort(((s,e)=>s.index-e.index)),h=[];for(const s of g){const e=this._services.get(s.id);if(!e)throw new Error(`[createInstance] ${d.name} depends on UNKNOWN service ${s.id}.`);h.push(e)}const t=g.length>0?g[0].index:f.length;if(f.length!==t)throw new Error(`[createInstance] First service dependency of ${d.name} at position ${t+1} conflicts with ${f.length} static arguments`);return new d(...f,...h)}}},7866:function(x,r,o){var l=this&&this.__decorate||function(t,s,e,i){var a,v=arguments.length,u=v<3?s:i===null?i=Object.getOwnPropertyDescriptor(s,e):i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")u=Reflect.decorate(t,s,e,i);else for(var p=t.length-1;p>=0;p--)(a=t[p])&&(u=(v<3?a(u):v>3?a(s,e,u):a(s,e))||u);return v>3&&u&&Object.defineProperty(s,e,u),u},_=this&&this.__param||function(t,s){return function(e,i){s(e,i,t)}};Object.defineProperty(r,"__esModule",{value:!0}),r.traceCall=r.setTraceLogger=r.LogService=void 0;const n=o(844),d=o(2585),f={trace:d.LogLevelEnum.TRACE,debug:d.LogLevelEnum.DEBUG,info:d.LogLevelEnum.INFO,warn:d.LogLevelEnum.WARN,error:d.LogLevelEnum.ERROR,off:d.LogLevelEnum.OFF};let g,h=r.LogService=class extends n.Disposable{get logLevel(){return this._logLevel}constructor(t){super(),this._optionsService=t,this._logLevel=d.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",(()=>this._updateLogLevel()))),g=this}_updateLogLevel(){this._logLevel=f[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(t){for(let s=0;sJSON.stringify(u))).join(", ")})`);const v=i.apply(this,a);return g.trace(`GlyphRenderer#${i.name} return`,v),v}}},7302:(x,r,o)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.OptionsService=r.DEFAULT_OPTIONS=void 0;const l=o(8460),_=o(844),n=o(6114);r.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:n.isMac,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRulerWidth:0};const d=["normal","bold","100","200","300","400","500","600","700","800","900"];class f extends _.Disposable{constructor(h){super(),this._onOptionChange=this.register(new l.EventEmitter),this.onOptionChange=this._onOptionChange.event;const t={...r.DEFAULT_OPTIONS};for(const s in h)if(s in t)try{const e=h[s];t[s]=this._sanitizeAndValidateOption(s,e)}catch(e){console.error(e)}this.rawOptions=t,this.options={...t},this._setupOptions(),this.register((0,_.toDisposable)((()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null})))}onSpecificOptionChange(h,t){return this.onOptionChange((s=>{s===h&&t(this.rawOptions[h])}))}onMultipleOptionChange(h,t){return this.onOptionChange((s=>{h.indexOf(s)!==-1&&t()}))}_setupOptions(){const h=s=>{if(!(s in r.DEFAULT_OPTIONS))throw new Error(`No option with key "${s}"`);return this.rawOptions[s]},t=(s,e)=>{if(!(s in r.DEFAULT_OPTIONS))throw new Error(`No option with key "${s}"`);e=this._sanitizeAndValidateOption(s,e),this.rawOptions[s]!==e&&(this.rawOptions[s]=e,this._onOptionChange.fire(s))};for(const s in this.rawOptions){const e={get:h.bind(this,s),set:t.bind(this,s)};Object.defineProperty(this.options,s,e)}}_sanitizeAndValidateOption(h,t){switch(h){case"cursorStyle":if(t||(t=r.DEFAULT_OPTIONS[h]),!(function(s){return s==="block"||s==="underline"||s==="bar"})(t))throw new Error(`"${t}" is not a valid value for ${h}`);break;case"wordSeparator":t||(t=r.DEFAULT_OPTIONS[h]);break;case"fontWeight":case"fontWeightBold":if(typeof t=="number"&&1<=t&&t<=1e3)break;t=d.includes(t)?t:r.DEFAULT_OPTIONS[h];break;case"cursorWidth":t=Math.floor(t);case"lineHeight":case"tabStopWidth":if(t<1)throw new Error(`${h} cannot be less than 1, value: ${t}`);break;case"minimumContrastRatio":t=Math.max(1,Math.min(21,Math.round(10*t)/10));break;case"scrollback":if((t=Math.min(t,4294967295))<0)throw new Error(`${h} cannot be less than 0, value: ${t}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(t<=0)throw new Error(`${h} cannot be less than or equal to 0, value: ${t}`);break;case"rows":case"cols":if(!t&&t!==0)throw new Error(`${h} must be numeric, value: ${t}`);break;case"windowsPty":t=t??{}}return t}}r.OptionsService=f},2660:function(x,r,o){var l=this&&this.__decorate||function(f,g,h,t){var s,e=arguments.length,i=e<3?g:t===null?t=Object.getOwnPropertyDescriptor(g,h):t;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(f,g,h,t);else for(var a=f.length-1;a>=0;a--)(s=f[a])&&(i=(e<3?s(i):e>3?s(g,h,i):s(g,h))||i);return e>3&&i&&Object.defineProperty(g,h,i),i},_=this&&this.__param||function(f,g){return function(h,t){g(h,t,f)}};Object.defineProperty(r,"__esModule",{value:!0}),r.OscLinkService=void 0;const n=o(2585);let d=r.OscLinkService=class{constructor(f){this._bufferService=f,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(f){const g=this._bufferService.buffer;if(f.id===void 0){const a=g.addMarker(g.ybase+g.y),v={data:f,id:this._nextId++,lines:[a]};return a.onDispose((()=>this._removeMarkerFromLink(v,a))),this._dataByLinkId.set(v.id,v),v.id}const h=f,t=this._getEntryIdKey(h),s=this._entriesWithId.get(t);if(s)return this.addLineToLink(s.id,g.ybase+g.y),s.id;const e=g.addMarker(g.ybase+g.y),i={id:this._nextId++,key:this._getEntryIdKey(h),data:h,lines:[e]};return e.onDispose((()=>this._removeMarkerFromLink(i,e))),this._entriesWithId.set(i.key,i),this._dataByLinkId.set(i.id,i),i.id}addLineToLink(f,g){const h=this._dataByLinkId.get(f);if(h&&h.lines.every((t=>t.line!==g))){const t=this._bufferService.buffer.addMarker(g);h.lines.push(t),t.onDispose((()=>this._removeMarkerFromLink(h,t)))}}getLinkData(f){return this._dataByLinkId.get(f)?.data}_getEntryIdKey(f){return`${f.id};;${f.uri}`}_removeMarkerFromLink(f,g){const h=f.lines.indexOf(g);h!==-1&&(f.lines.splice(h,1),f.lines.length===0&&(f.data.id!==void 0&&this._entriesWithId.delete(f.key),this._dataByLinkId.delete(f.id)))}};r.OscLinkService=d=l([_(0,n.IBufferService)],d)},8343:(x,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.createDecorator=r.getServiceDependencies=r.serviceRegistry=void 0;const o="di$target",l="di$dependencies";r.serviceRegistry=new Map,r.getServiceDependencies=function(_){return _[l]||[]},r.createDecorator=function(_){if(r.serviceRegistry.has(_))return r.serviceRegistry.get(_);const n=function(d,f,g){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(h,t,s){t[o]===t?t[l].push({id:h,index:s}):(t[l]=[{id:h,index:s}],t[o]=t)})(n,d,g)};return n.toString=()=>_,r.serviceRegistry.set(_,n),n}},2585:(x,r,o)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.IDecorationService=r.IUnicodeService=r.IOscLinkService=r.IOptionsService=r.ILogService=r.LogLevelEnum=r.IInstantiationService=r.ICharsetService=r.ICoreService=r.ICoreMouseService=r.IBufferService=void 0;const l=o(8343);var _;r.IBufferService=(0,l.createDecorator)("BufferService"),r.ICoreMouseService=(0,l.createDecorator)("CoreMouseService"),r.ICoreService=(0,l.createDecorator)("CoreService"),r.ICharsetService=(0,l.createDecorator)("CharsetService"),r.IInstantiationService=(0,l.createDecorator)("InstantiationService"),(function(n){n[n.TRACE=0]="TRACE",n[n.DEBUG=1]="DEBUG",n[n.INFO=2]="INFO",n[n.WARN=3]="WARN",n[n.ERROR=4]="ERROR",n[n.OFF=5]="OFF"})(_||(r.LogLevelEnum=_={})),r.ILogService=(0,l.createDecorator)("LogService"),r.IOptionsService=(0,l.createDecorator)("OptionsService"),r.IOscLinkService=(0,l.createDecorator)("OscLinkService"),r.IUnicodeService=(0,l.createDecorator)("UnicodeService"),r.IDecorationService=(0,l.createDecorator)("DecorationService")},1480:(x,r,o)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.UnicodeService=void 0;const l=o(8460),_=o(225);class n{static extractShouldJoin(f){return(1&f)!=0}static extractWidth(f){return f>>1&3}static extractCharKind(f){return f>>3}static createPropertyValue(f,g,h=!1){return(16777215&f)<<3|(3&g)<<1|(h?1:0)}constructor(){this._providers=Object.create(null),this._active="",this._onChange=new l.EventEmitter,this.onChange=this._onChange.event;const f=new _.UnicodeV6;this.register(f),this._active=f.version,this._activeProvider=f}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(f){if(!this._providers[f])throw new Error(`unknown Unicode version "${f}"`);this._active=f,this._activeProvider=this._providers[f],this._onChange.fire(f)}register(f){this._providers[f.version]=f}wcwidth(f){return this._activeProvider.wcwidth(f)}getStringCellWidth(f){let g=0,h=0;const t=f.length;for(let s=0;s=t)return g+this.wcwidth(e);const v=f.charCodeAt(s);56320<=v&&v<=57343?e=1024*(e-55296)+v-56320+65536:g+=this.wcwidth(v)}const i=this.charProperties(e,h);let a=n.extractWidth(i);n.extractShouldJoin(i)&&(a-=n.extractWidth(h)),g+=a,h=i}return g}charProperties(f,g){return this._activeProvider.charProperties(f,g)}}r.UnicodeService=n}},J={};function z(x){var r=J[x];if(r!==void 0)return r.exports;var o=J[x]={exports:{}};return G[x].call(o.exports,o,o.exports,z),o.exports}var q={};return(()=>{var x=q;Object.defineProperty(x,"__esModule",{value:!0}),x.Terminal=void 0;const r=z(9042),o=z(3236),l=z(844),_=z(5741),n=z(8285),d=z(7975),f=z(7090),g=["cols","rows"];class h extends l.Disposable{constructor(s){super(),this._core=this.register(new o.Terminal(s)),this._addonManager=this.register(new _.AddonManager),this._publicOptions={...this._core.options};const e=a=>this._core.options[a],i=(a,v)=>{this._checkReadonlyOptions(a),this._core.options[a]=v};for(const a in this._core.options){const v={get:e.bind(this,a),set:i.bind(this,a)};Object.defineProperty(this._publicOptions,a,v)}}_checkReadonlyOptions(s){if(g.includes(s))throw new Error(`Option "${s}" 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 d.ParserApi(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new f.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 n.BufferNamespaceApi(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){const s=this._core.coreService.decPrivateModes;let e="none";switch(this._core.coreMouseService.activeProtocol){case"X10":e="x10";break;case"VT200":e="vt200";break;case"DRAG":e="drag";break;case"ANY":e="any"}return{applicationCursorKeysMode:s.applicationCursorKeys,applicationKeypadMode:s.applicationKeypad,bracketedPasteMode:s.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:e,originMode:s.origin,reverseWraparoundMode:s.reverseWraparound,sendFocusMode:s.sendFocus,wraparoundMode:s.wraparound}}get options(){return this._publicOptions}set options(s){for(const e in s)this._publicOptions[e]=s[e]}blur(){this._core.blur()}focus(){this._core.focus()}input(s,e=!0){this._core.input(s,e)}resize(s,e){this._verifyIntegers(s,e),this._core.resize(s,e)}open(s){this._core.open(s)}attachCustomKeyEventHandler(s){this._core.attachCustomKeyEventHandler(s)}attachCustomWheelEventHandler(s){this._core.attachCustomWheelEventHandler(s)}registerLinkProvider(s){return this._core.registerLinkProvider(s)}registerCharacterJoiner(s){return this._checkProposedApi(),this._core.registerCharacterJoiner(s)}deregisterCharacterJoiner(s){this._checkProposedApi(),this._core.deregisterCharacterJoiner(s)}registerMarker(s=0){return this._verifyIntegers(s),this._core.registerMarker(s)}registerDecoration(s){return this._checkProposedApi(),this._verifyPositiveIntegers(s.x??0,s.width??0,s.height??0),this._core.registerDecoration(s)}hasSelection(){return this._core.hasSelection()}select(s,e,i){this._verifyIntegers(s,e,i),this._core.select(s,e,i)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(s,e){this._verifyIntegers(s,e),this._core.selectLines(s,e)}dispose(){super.dispose()}scrollLines(s){this._verifyIntegers(s),this._core.scrollLines(s)}scrollPages(s){this._verifyIntegers(s),this._core.scrollPages(s)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(s){this._verifyIntegers(s),this._core.scrollToLine(s)}clear(){this._core.clear()}write(s,e){this._core.write(s,e)}writeln(s,e){this._core.write(s),this._core.write(`\r -`,e)}paste(s){this._core.paste(s)}refresh(s,e){this._verifyIntegers(s,e),this._core.refresh(s,e)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(s){this._addonManager.loadAddon(this,s)}static get strings(){return r}_verifyIntegers(...s){for(const e of s)if(e===1/0||isNaN(e)||e%1!=0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...s){for(const e of s)if(e&&(e===1/0||isNaN(e)||e%1!=0||e<0))throw new Error("This API only accepts positive integers")}}x.Terminal=h})(),q})()))})(ge)),ge.exports}var We=Fe(),me={exports:{}},be;function Ne(){return be||(be=1,(function(U,X){(function(G,J){U.exports=J()})(self,(()=>(()=>{var G={};return(()=>{var J=G;Object.defineProperty(J,"__esModule",{value:!0}),J.FitAddon=void 0,J.FitAddon=class{activate(z){this._terminal=z}dispose(){}fit(){const z=this.proposeDimensions();if(!z||!this._terminal||isNaN(z.cols)||isNaN(z.rows))return;const q=this._terminal._core;this._terminal.rows===z.rows&&this._terminal.cols===z.cols||(q._renderService.clear(),this._terminal.resize(z.cols,z.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;const z=this._terminal._core,q=z._renderService.dimensions;if(q.css.cell.width===0||q.css.cell.height===0)return;const x=this._terminal.options.scrollback===0?0:z.viewport.scrollBarWidth,r=window.getComputedStyle(this._terminal.element.parentElement),o=parseInt(r.getPropertyValue("height")),l=Math.max(0,parseInt(r.getPropertyValue("width"))),_=window.getComputedStyle(this._terminal.element),n=o-(parseInt(_.getPropertyValue("padding-top"))+parseInt(_.getPropertyValue("padding-bottom"))),d=l-(parseInt(_.getPropertyValue("padding-right"))+parseInt(_.getPropertyValue("padding-left")))-x;return{cols:Math.max(2,Math.floor(d/q.css.cell.width)),rows:Math.max(1,Math.floor(n/q.css.cell.height))}}}})(),G})()))})(me)),me.exports}var Ue=Ne();const $e=typeof window<"u"&&typeof window.matchMedia=="function"&&window.matchMedia("(pointer: coarse)").matches?13:12;function je({panes:U,socketRef:X,viewsRef:G,bodyRefs:J,pendingRef:z,setTitles:q}){Y.useEffect(()=>{for(const x of U){if(G.current.has(x))continue;const r=J.current.get(x);if(!r)continue;const o=new We.Terminal({fontFamily:getComputedStyle(document.body).fontFamily,fontSize:$e,theme:{background:"#0b0b0d",foreground:"#e6e6ec"},cursorBlink:!0}),l=new Ue.FitAddon;o.loadAddon(l),o.onData(n=>X.current?.send(JSON.stringify({type:"input",pane:x,data:n}))),o.onTitleChange(n=>{const d=n.replace(/\s+/g," ").trim();d&&q(f=>({...f,[x]:d}))}),o.open(r),G.current.set(x,{term:o,fit:l});const _=z.current.get(x);if(_){for(const n of _)o.write(n);z.current.delete(x)}}for(const[x,r]of G.current)U.includes(x)||(r.term.dispose(),G.current.delete(x))},[U])}function ze({pane:U,index:X,label:G,cellStyle:J,isActive:z,isZoomed:q,isDragged:x,isDropTarget:r,reorderable:o,onFocus:l,onToggleZoom:_,onClose:n,onPaneDragStart:d,onPaneDragMove:f,onPaneDragEnd:g,onPaneDragCancel:h,bodyRef:t}){const s=r?"border-accent ring-1 ring-accent":z?"border-accent":"border-ink-700";return te.jsxs("div",{"data-pane-id":U,onMouseDown:l,style:J,className:`min-h-0 min-w-0 flex-col overflow-hidden rounded-sm border ${s} ${x?"opacity-60":""}`,children:[te.jsxs("div",{onPointerDown:d,onPointerMove:f,onPointerUp:g,onPointerCancel:h,className:`flex shrink-0 items-center gap-1 select-none bg-ink-900 px-2 py-0.5 text-xs ${o?x?"cursor-grabbing touch-none":"cursor-grab touch-none":""}`,children:[te.jsx("span",{title:G,className:`min-w-0 flex-1 truncate ${z?"text-ink-50":"text-ink-400"}`,children:Pe(G,Ae)}),te.jsx("button",{onMouseDown:e=>e.stopPropagation(),onClick:_,"aria-pressed":q,title:q?"Restore the grid":"Zoom this terminal","aria-label":q?"Restore the grid":"Zoom this terminal",className:"flex h-8 w-8 shrink-0 items-center justify-center rounded-sm text-ink-400 hover:text-accent md:h-6 md:w-6",children:te.jsx(we,{maximized:q})}),te.jsx("button",{onMouseDown:e=>e.stopPropagation(),onClick:n,title:"Close terminal","aria-label":`close terminal ${X+1}`,className:"flex h-8 w-8 shrink-0 items-center justify-center rounded-sm text-ink-400 hover:text-removed md:h-6 md:w-6",children:te.jsx(Re,{})})]}),te.jsx("div",{ref:t,className:"min-h-0 flex-1"})]})}const Ke={esc:"\x1B",tab:" ","ctrl-c":"","ctrl-d":"","ctrl-z":"","ctrl-l":"\f","ctrl-r":"",up:"\x1B[A",down:"\x1B[B",right:"\x1B[C",left:"\x1B[D"},qe={up:"\x1BOA",down:"\x1BOB",right:"\x1BOC",left:"\x1BOD"};function Ve(U,X=!1){if(X){const G=qe[U];if(G)return G}return Ke[U]}const Ge=[{key:"esc",label:"Esc",aria:"Escape"},{key:"tab",label:"Tab",aria:"Tab"},{key:"ctrl-c",label:"^C",aria:"Control C"},{key:"ctrl-d",label:"^D",aria:"Control D"},{key:"ctrl-z",label:"^Z",aria:"Control Z"},{key:"ctrl-l",label:"^L",aria:"Control L"},{key:"ctrl-r",label:"^R",aria:"Control R"},{key:"left",label:"←",aria:"Left arrow"},{key:"down",label:"↓",aria:"Down arrow"},{key:"up",label:"↑",aria:"Up arrow"},{key:"right",label:"→",aria:"Right arrow"}];function Je({repo:U,maximized:X,onToggleMaximized:G,className:J=""}){const z=Y.useRef(null),q=Y.useRef(null),x=Y.useRef(new Map),r=Y.useRef(new Map),o=Y.useRef(new Map),l=Y.useRef(new Map),_=Y.useRef(new Map),n=Y.useRef(0),[d,f]=Y.useState([]),[g,h]=Y.useState(null),[t,s]=Y.useState(null),[e,i]=Y.useState({w:0,h:0}),[a,v]=Y.useState({});He({repo:U,socketRef:q,viewsRef:x,pendingRef:l,sentSizesRef:o,lastActiveByRepoRef:_,expectCreateRef:n,setPanes:f,setActive:h,setZoomed:s,setTitles:v}),je({panes:d,socketRef:q,viewsRef:x,bodyRefs:r,pendingRef:l,setTitles:v}),Y.useEffect(()=>{for(const[B,m]of x.current){const b=r.current.get(B);if(!b||b.clientHeight===0||b.clientWidth===0)continue;m.fit.fit();const{rows:y,cols:D}=m.term,T=o.current.get(B);T&&T.rows===y&&T.cols===D||(o.current.set(B,{rows:y,cols:D}),q.current?.send(JSON.stringify({type:"resize",pane:B,rows:y,cols:D})))}},[d,t,e]),Y.useEffect(()=>{const B=z.current;if(!B)return;const m=new ResizeObserver(()=>{i({w:B.clientWidth,h:B.clientHeight})});return m.observe(B),()=>m.disconnect()},[]),Y.useEffect(()=>{if(g===null&&d.length>0){const B=_.current.get(U);h(B!==void 0&&d.includes(B)?B:d[d.length-1])}},[g,d,U]),Y.useEffect(()=>{g!==null&&x.current.get(g)?.term.focus()},[g]);const u=B=>{h(B),_.current.set(U,B)},p=()=>{const B=q.current;B&&(s(null),n.current+=1,B.send(JSON.stringify({type:"create",rows:24,cols:80})))},c=B=>{q.current?.send(JSON.stringify({type:"close",pane:B}))},S=B=>{if(g===null)return;const m=x.current.get(g)?.term.modes.applicationCursorKeysMode??!1;q.current?.send(JSON.stringify({type:"input",pane:g,data:Ve(B,m)}))},{draggingPane:E,dragOverPane:k,reorderable:L,endPaneDrag:w,onPaneDragStart:A,onPaneDragMove:O,onPaneDragEnd:I}=Ie({panes:d,zoomed:t,onFocus:u,onReorder:B=>q.current?.send(JSON.stringify({type:"reorder",order:B}))}),W=Oe(d.length,e.w>=e.h);return te.jsxs("section",{className:`flex min-h-0 min-w-0 flex-col border-t border-ink-700 ${J}`,children:[te.jsxs("div",{className:"flex shrink-0 items-center gap-2 bg-ink-900 px-2 py-1",children:[te.jsx("button",{onClick:p,title:"New terminal","aria-label":"New terminal",className:"ml-auto flex shrink-0 items-center rounded-sm px-1.5 py-0.5 text-ink-400 hover:text-accent",children:te.jsx(xe,{})}),te.jsx("button",{onClick:G,"aria-pressed":X,title:X?"Restore panel height":"Maximize the panel","aria-label":X?"Restore panel height":"Maximize the panel",className:"hidden shrink-0 items-center rounded-sm px-1.5 py-0.5 text-ink-400 hover:text-accent md:flex",children:te.jsx(we,{maximized:X})})]}),te.jsxs("div",{className:"relative min-h-0 flex-1 overflow-hidden bg-ink-950 p-1",children:[d.length===0&&te.jsxs("p",{className:"p-3 text-ink-400",children:["No terminal open. Press ",te.jsx("span",{className:"text-accent",children:"+"})," above to start one."]}),te.jsx("div",{ref:z,className:"grid h-full gap-1",style:t!==null?{gridTemplateColumns:"1fr",gridTemplateRows:"1fr"}:{gridTemplateColumns:`repeat(${W.cols}, minmax(0, 1fr))`,gridTemplateRows:`repeat(${W.rows}, minmax(0, 1fr))`},children:d.map((B,m)=>{const b=a[B]??`term ${m+1}`,y=W.cells[m],D=t!==null?{display:B===t?"flex":"none"}:{display:"flex",gridColumn:`${y.colStart} / span ${y.colSpan}`,gridRow:`${y.row}`};return te.jsx(ze,{pane:B,index:m,label:b,cellStyle:D,isActive:B===g,isZoomed:t===B,isDragged:E===B,isDropTarget:k===B,reorderable:L,onFocus:()=>u(B),onToggleZoom:()=>s(T=>T===B?null:B),onClose:()=>c(B),onPaneDragStart:T=>A(T,B),onPaneDragMove:O,onPaneDragEnd:I,onPaneDragCancel:w,bodyRef:T=>{T?r.current.set(B,T):r.current.delete(B)}},B)})})]}),d.length>0&&te.jsx("div",{className:"flex shrink-0 items-stretch gap-1 overflow-x-auto border-t border-ink-700 bg-ink-900 px-1 py-1 md:hidden",children:Ge.map(({key:B,label:m,aria:b})=>te.jsx("button",{onPointerDown:y=>y.preventDefault(),onClick:()=>S(B),"aria-label":b,className:"flex min-h-9 min-w-9 shrink-0 items-center justify-center rounded-sm border border-ink-700 bg-ink-850 px-2 text-xs text-ink-200 active:bg-ink-700 active:text-accent",children:m},B))})]})}export{Je as TerminalPanel}; diff --git a/viewer-ui/dist/assets/index-BU1OaTEg.css b/viewer-ui/dist/assets/index-BU1OaTEg.css deleted file mode 100644 index bd220446..00000000 --- a/viewer-ui/dist/assets/index-BU1OaTEg.css +++ /dev/null @@ -1 +0,0 @@ -@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-border-style:solid;--tw-font-weight:initial;--tw-tracking:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial}}}@layer theme{:root,:host{--font-sans:system-ui, sans-serif;--font-mono:ui-monospace, "JetBrains Mono", "SF Mono", Menlo, Consolas, monospace;--color-black:#000;--color-white:#fff;--spacing:.25rem;--text-xs:.75rem;--text-xs--line-height:calc(1 / .75);--text-lg:1.125rem;--text-lg--line-height:calc(1.75 / 1.125);--font-weight-medium:500;--font-weight-semibold:600;--font-weight-bold:700;--tracking-wide:.025em;--radius-sm:.25rem;--radius-md:.375rem;--animate-pulse:pulse 2s cubic-bezier(.4, 0, .6, 1) infinite;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4, 0, .2, 1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono);--color-ink-950:#0b0b0d;--color-ink-900:#121215;--color-ink-850:#17171b;--color-ink-800:#1d1d22;--color-ink-700:#2a2a31;--color-ink-600:#3a3a43;--color-ink-400:#6f6f7d;--color-ink-200:#a8a8b5;--color-ink-50:#e6e6ec;--color-accent:#d9a441;--color-added:#4ba36b;--color-removed:#c85f5f}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--default-font-family,-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring:where(:not(iframe)){outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab,red,red)){::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::file-selector-button{appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}}@layer components;@layer utilities{.pointer-events-auto{pointer-events:auto}.pointer-events-none{pointer-events:none}.visible{visibility:visible}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.sticky{position:sticky}.inset-0{inset:0}.top-0{top:0}.top-3{top:calc(var(--spacing) * 3)}.-right-px{right:-1px}.right-3{right:calc(var(--spacing) * 3)}.left-0{left:0}.z-10{z-index:10}.z-40{z-index:40}.z-50{z-index:50}.z-\[60\]{z-index:60}.container{width:100%}@media(min-width:40rem){.container{max-width:40rem}}@media(min-width:48rem){.container{max-width:48rem}}@media(min-width:64rem){.container{max-width:64rem}}@media(min-width:80rem){.container{max-width:80rem}}@media(min-width:96rem){.container{max-width:96rem}}.mx-2{margin-inline:calc(var(--spacing) * 2)}.mx-auto{margin-inline:auto}.-my-\[8\.8px\]{margin-block:-8.8px}.my-1{margin-block:var(--spacing)}.mt-0\.5{margin-top:calc(var(--spacing) * .5)}.mt-1{margin-top:var(--spacing)}.mr-1{margin-right:var(--spacing)}.-mb-px{margin-bottom:-1px}.mb-1{margin-bottom:var(--spacing)}.mb-2{margin-bottom:calc(var(--spacing) * 2)}.mb-2\.5{margin-bottom:calc(var(--spacing) * 2.5)}.mb-3{margin-bottom:calc(var(--spacing) * 3)}.mb-5{margin-bottom:calc(var(--spacing) * 5)}.ml-auto{margin-left:auto}.block{display:block}.flex{display:flex}.grid{display:grid}.hidden{display:none}.inline{display:inline}.h-3{height:calc(var(--spacing) * 3)}.h-3\.5{height:calc(var(--spacing) * 3.5)}.h-4{height:calc(var(--spacing) * 4)}.h-5{height:calc(var(--spacing) * 5)}.h-6{height:calc(var(--spacing) * 6)}.h-8{height:calc(var(--spacing) * 8)}.h-10{height:calc(var(--spacing) * 10)}.h-12{height:calc(var(--spacing) * 12)}.h-72{height:calc(var(--spacing) * 72)}.h-\[22px\]{height:22px}.h-full{height:100%}.max-h-\[70vh\]{max-height:70vh}.max-h-\[80vh\]{max-height:80vh}.min-h-0{min-height:0}.min-h-9{min-height:calc(var(--spacing) * 9)}.min-h-11{min-height:calc(var(--spacing) * 11)}.w-1\.5{width:calc(var(--spacing) * 1.5)}.w-2{width:calc(var(--spacing) * 2)}.w-3{width:calc(var(--spacing) * 3)}.w-3\.5{width:calc(var(--spacing) * 3.5)}.w-4{width:calc(var(--spacing) * 4)}.w-5{width:calc(var(--spacing) * 5)}.w-6{width:calc(var(--spacing) * 6)}.w-8{width:calc(var(--spacing) * 8)}.w-10{width:calc(var(--spacing) * 10)}.w-12{width:calc(var(--spacing) * 12)}.w-56{width:calc(var(--spacing) * 56)}.w-80{width:calc(var(--spacing) * 80)}.w-\[17rem\]{width:17rem}.w-\[22px\]{width:22px}.w-\[34rem\]{width:34rem}.w-full{width:100%}.w-max{width:max-content}.max-w-\[6rem\]{max-width:6rem}.max-w-\[9rem\]{max-width:9rem}.max-w-\[80vw\]{max-width:80vw}.max-w-\[86vw\]{max-width:86vw}.max-w-\[calc\(100vw-1\.5rem\)\]{max-width:calc(100vw - 1.5rem)}.max-w-full{max-width:100%}.min-w-0{min-width:0}.min-w-9{min-width:calc(var(--spacing) * 9)}.min-w-full{min-width:100%}.flex-1{flex:1}.shrink-0{flex-shrink:0}.basis-1\/2{flex-basis:50%}.rotate-90{rotate:90deg}.animate-pulse{animation:var(--animate-pulse)}.cursor-col-resize{cursor:col-resize}.cursor-grab{cursor:grab}.cursor-grabbing{cursor:grabbing}.touch-none{touch-action:none}.resize{resize:both}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.grid-rows-\[auto_1fr\]{grid-template-rows:auto 1fr}.grid-rows-\[auto_minmax\(0\,1fr\)_auto_auto\]{grid-template-rows:auto minmax(0,1fr) auto auto}.flex-col{flex-direction:column}.items-baseline{align-items:baseline}.items-center{align-items:center}.items-start{align-items:flex-start}.items-stretch{align-items:stretch}.justify-center{justify-content:center}.gap-0\.5{gap:calc(var(--spacing) * .5)}.gap-1{gap:var(--spacing)}.gap-2{gap:calc(var(--spacing) * 2)}.gap-3{gap:calc(var(--spacing) * 3)}.self-stretch{align-self:stretch}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.rounded{border-radius:.25rem}.rounded-\[20\.7\%\]{border-radius:20.7%}.rounded-full{border-radius:3.40282e38px}.rounded-md{border-radius:var(--radius-md)}.rounded-sm{border-radius:var(--radius-sm)}.border{border-style:var(--tw-border-style);border-width:1px}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-r{border-right-style:var(--tw-border-style);border-right-width:1px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-b-2{border-bottom-style:var(--tw-border-style);border-bottom-width:2px}.border-l{border-left-style:var(--tw-border-style);border-left-width:1px}.border-accent{border-color:var(--color-accent)}.border-ink-700{border-color:var(--color-ink-700)}.border-ink-800{border-color:var(--color-ink-800)}.border-transparent{border-color:#0000}.bg-accent{background-color:var(--color-accent)}.bg-added\/10{background-color:#4ba36b1a}@supports (color:color-mix(in lab,red,red)){.bg-added\/10{background-color:color-mix(in oklab,var(--color-added) 10%,transparent)}}.bg-black\/60{background-color:#0009}@supports (color:color-mix(in lab,red,red)){.bg-black\/60{background-color:color-mix(in oklab,var(--color-black) 60%,transparent)}}.bg-ink-50{background-color:var(--color-ink-50)}.bg-ink-700{background-color:var(--color-ink-700)}.bg-ink-800{background-color:var(--color-ink-800)}.bg-ink-850{background-color:var(--color-ink-850)}.bg-ink-900{background-color:var(--color-ink-900)}.bg-ink-900\/40{background-color:#12121566}@supports (color:color-mix(in lab,red,red)){.bg-ink-900\/40{background-color:color-mix(in oklab,var(--color-ink-900) 40%,transparent)}}.bg-ink-950{background-color:var(--color-ink-950)}.bg-removed\/10{background-color:#c85f5f1a}@supports (color:color-mix(in lab,red,red)){.bg-removed\/10{background-color:color-mix(in oklab,var(--color-removed) 10%,transparent)}}.p-1{padding:var(--spacing)}.p-3{padding:calc(var(--spacing) * 3)}.p-4{padding:calc(var(--spacing) * 4)}.p-6{padding:calc(var(--spacing) * 6)}.px-1{padding-inline:var(--spacing)}.px-1\.5{padding-inline:calc(var(--spacing) * 1.5)}.px-2{padding-inline:calc(var(--spacing) * 2)}.px-2\.5{padding-inline:calc(var(--spacing) * 2.5)}.px-3{padding-inline:calc(var(--spacing) * 3)}.px-\[12\.8px\]{padding-inline:12.8px}.py-0\.5{padding-block:calc(var(--spacing) * .5)}.py-1{padding-block:var(--spacing)}.py-1\.5{padding-block:calc(var(--spacing) * 1.5)}.py-2{padding-block:calc(var(--spacing) * 2)}.py-\[8\.8px\]{padding-block:8.8px}.pr-1{padding-right:var(--spacing)}.pr-3{padding-right:calc(var(--spacing) * 3)}.pl-1{padding-left:var(--spacing)}.pl-2{padding-left:calc(var(--spacing) * 2)}.pl-3{padding-left:calc(var(--spacing) * 3)}.text-center{text-align:center}.text-left{text-align:left}.text-right{text-align:right}.font-sans{font-family:var(--font-sans)}.text-lg{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.text-\[0\.62rem\]{font-size:.62rem}.text-\[0\.65rem\]{font-size:.65rem}.text-\[0\.72rem\]{font-size:.72rem}.text-\[10px\]{font-size:10px}.text-\[11px\]{font-size:11px}.text-\[16px\]{font-size:16px}.font-bold{--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.tracking-\[0\.04em\]{--tw-tracking:.04em;letter-spacing:.04em}.tracking-\[0\.18em\]{--tw-tracking:.18em;letter-spacing:.18em}.tracking-wide{--tw-tracking:var(--tracking-wide);letter-spacing:var(--tracking-wide)}.break-words{overflow-wrap:break-word}.whitespace-nowrap{white-space:nowrap}.whitespace-pre{white-space:pre}.text-accent{color:var(--color-accent)}.text-added{color:var(--color-added)}.text-ink-50{color:var(--color-ink-50)}.text-ink-200{color:var(--color-ink-200)}.text-ink-400{color:var(--color-ink-400)}.text-ink-600{color:var(--color-ink-600)}.text-ink-950{color:var(--color-ink-950)}.text-removed{color:var(--color-removed)}.uppercase{text-transform:uppercase}.opacity-60{opacity:.6}.shadow-\[inset_0_2px_0_0_var\(--color-accent\)\]{--tw-shadow:inset 0 2px 0 0 var(--tw-shadow-color,var(--color-accent));box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-lg{--tw-shadow:0 10px 15px -3px var(--tw-shadow-color,#0000001a), 0 4px 6px -4px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring-1{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring-accent{--tw-ring-color:var(--color-accent)}.ring-ink-600{--tw-ring-color:var(--color-ink-600)}.filter{filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.transition-transform{transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.outline-none{--tw-outline-style:none;outline-style:none}.select-none{-webkit-user-select:none;user-select:none}.ring-inset{--tw-ring-inset:inset}.placeholder\:text-ink-400::placeholder{color:var(--color-ink-400)}@media(hover:hover){.hover\:bg-accent:hover{background-color:var(--color-accent)}.hover\:bg-ink-700:hover{background-color:var(--color-ink-700)}.hover\:bg-ink-850:hover{background-color:var(--color-ink-850)}.hover\:bg-white:hover{background-color:var(--color-white)}.hover\:text-accent:hover{color:var(--color-accent)}.hover\:text-ink-200:hover{color:var(--color-ink-200)}.hover\:text-removed:hover{color:var(--color-removed)}}.focus\:border-accent:focus{border-color:var(--color-accent)}.focus\:border-ink-600:focus{border-color:var(--color-ink-600)}.focus\:ring-1:focus{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus\:ring-\[3px\]:focus{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(3px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus\:ring-accent:focus{--tw-ring-color:var(--color-accent)}.focus\:ring-accent\/15:focus{--tw-ring-color:#d9a44126}@supports (color:color-mix(in lab,red,red)){.focus\:ring-accent\/15:focus{--tw-ring-color:color-mix(in oklab, var(--color-accent) 15%, transparent)}}.focus\:outline-none:focus{--tw-outline-style:none;outline-style:none}.active\:bg-ink-700:active{background-color:var(--color-ink-700)}.active\:text-accent:active{color:var(--color-accent)}.disabled\:opacity-50:disabled{opacity:.5}@media(min-width:40rem){.sm\:inline{display:inline}}@media(min-width:48rem){.md\:block{display:block}.md\:flex{display:flex}.md\:grid{display:grid}.md\:hidden{display:none}.md\:inline-flex{display:inline-flex}.md\:h-6{height:calc(var(--spacing) * 6)}.md\:w-6{width:calc(var(--spacing) * 6)}.md\:grid-cols-\[var\(--nc-sidebar\)_1fr\]{grid-template-columns:var(--nc-sidebar) 1fr}.md\:grid-rows-\[auto_minmax\(0\,0fr\)_minmax\(0\,1fr\)_auto\]{grid-template-rows:auto minmax(0,0fr) minmax(0,1fr) auto}.md\:grid-rows-\[auto_minmax\(0\,1fr\)_minmax\(0\,0fr\)_auto\]{grid-template-rows:auto minmax(0,1fr) minmax(0,0fr) auto}.md\:grid-rows-\[auto_minmax\(0\,11fr\)_minmax\(0\,9fr\)_auto\]{grid-template-rows:auto minmax(0,11fr) minmax(0,9fr) auto}.md\:border-r{border-right-style:var(--tw-border-style);border-right-width:1px}}}.xterm{cursor:text;-webkit-user-select:none;user-select:none;position:relative}.xterm.focus,.xterm:focus{outline:none}.xterm .xterm-helpers{z-index:5;position:absolute;top:0}.xterm .xterm-helper-textarea{opacity:0;z-index:-5;white-space:nowrap;resize:none;border:0;width:0;height:0;margin:0;padding:0;position:absolute;top:0;left:-9999em;overflow:hidden}.xterm .composition-view{color:#fff;white-space:nowrap;z-index:1;background:#000;display:none;position:absolute}.xterm .composition-view.active{display:block}.xterm .xterm-viewport{cursor:default;background-color:#000;position:absolute;inset:0;overflow-y:scroll}.xterm .xterm-screen{position:relative}.xterm .xterm-screen canvas{position:absolute;top:0;left:0}.xterm .xterm-scroll-area{visibility:hidden}.xterm-char-measure-element{visibility:hidden;line-height:normal;display:inline-block;position:absolute;top:0;left:-9999em}.xterm.enable-mouse-events{cursor:default}.xterm.xterm-cursor-pointer,.xterm .xterm-cursor-pointer{cursor:pointer}.xterm.column-select.focus{cursor:crosshair}.xterm .xterm-accessibility:not(.debug),.xterm .xterm-message{z-index:10;color:#0000;pointer-events:none;position:absolute;inset:0}.xterm .xterm-accessibility-tree:not(.debug) ::selection{color:#0000}.xterm .xterm-accessibility-tree{-webkit-user-select:text;user-select:text;white-space:pre}.xterm .live-region{width:1px;height:1px;position:absolute;left:-9999px;overflow:hidden}.xterm-dim{opacity:1!important}.xterm-underline-1{text-decoration:underline}.xterm-underline-2{-webkit-text-decoration:underline double;text-decoration:underline double}.xterm-underline-3{-webkit-text-decoration:underline wavy;text-decoration:underline wavy}.xterm-underline-4{-webkit-text-decoration:underline dotted;text-decoration:underline dotted}.xterm-underline-5{-webkit-text-decoration:underline dashed;text-decoration:underline dashed}.xterm-overline{text-decoration:overline}.xterm-overline.xterm-underline-1{text-decoration:underline overline}.xterm-overline.xterm-underline-2{-webkit-text-decoration:overline double underline;text-decoration:overline double underline}.xterm-overline.xterm-underline-3{-webkit-text-decoration:overline wavy underline;text-decoration:overline wavy underline}.xterm-overline.xterm-underline-4{-webkit-text-decoration:overline dotted underline;text-decoration:overline dotted underline}.xterm-overline.xterm-underline-5{-webkit-text-decoration:overline dashed underline;text-decoration:overline dashed underline}.xterm-strikethrough{text-decoration:line-through}.xterm-screen .xterm-decoration-container .xterm-decoration{z-index:6;position:absolute}.xterm-screen .xterm-decoration-container .xterm-decoration.xterm-decoration-top-layer{z-index:7}.xterm-decoration-overview-ruler{z-index:8;pointer-events:none;position:absolute;top:0;right:0}.xterm-decoration-top{z-index:2;position:relative}html,body,#root{height:100%}html{font-size:14px}body{background:var(--color-ink-950);color:var(--color-ink-50);font-family:var(--font-mono);margin:0;font-size:.85rem;line-height:1.4}button:not(:disabled),[role=button]:not(:disabled){cursor:pointer}*{scrollbar-width:thin;scrollbar-color:var(--color-ink-600) transparent}.nc-markdown{max-width:52rem;font-family:var(--font-sans);color:var(--color-ink-50);line-height:1.6}.nc-markdown h1,.nc-markdown h2,.nc-markdown h3,.nc-markdown h4,.nc-markdown h5,.nc-markdown h6{margin:1.4em 0 .6em;font-weight:600;line-height:1.25}.nc-markdown h1{border-bottom:1px solid var(--color-ink-700);padding-bottom:.3em;font-size:1.6em}.nc-markdown h2{border-bottom:1px solid var(--color-ink-800);padding-bottom:.25em;font-size:1.35em}.nc-markdown h3{font-size:1.15em}.nc-markdown h4{font-size:1em}.nc-markdown h5,.nc-markdown h6{color:var(--color-ink-200);font-size:.9em}.nc-markdown :first-child{margin-top:0}.nc-markdown p,.nc-markdown ul,.nc-markdown ol,.nc-markdown blockquote,.nc-markdown table,.nc-markdown pre{margin:.75em 0}.nc-markdown ul,.nc-markdown ol{padding-left:1.5em}.nc-markdown ul{list-style:outside}.nc-markdown ol{list-style:decimal}.nc-markdown li{margin:.25em 0}.nc-markdown li::marker{color:var(--color-ink-400)}.nc-markdown li:has(>input[type=checkbox]){margin-left:-1.2em;list-style:none}.nc-markdown a{color:var(--color-accent);text-underline-offset:2px;text-decoration:underline}.nc-markdown strong{font-weight:600}.nc-markdown em{font-style:italic}.nc-markdown blockquote{border-left:3px solid var(--color-ink-700);color:var(--color-ink-200);padding-left:1em}.nc-markdown hr{border:0;border-top:1px solid var(--color-ink-700);margin:1.5em 0}.nc-markdown img{max-width:100%}.nc-markdown :not(pre)>code{font-family:var(--font-mono);background:var(--color-ink-800);border-radius:3px;padding:.1em .35em;font-size:.9em}.nc-markdown pre{background:var(--color-ink-850);border:1px solid var(--color-ink-800);border-radius:4px;padding:.9em 1em;overflow-x:auto}.nc-markdown pre code{font-family:var(--font-mono);background:0 0;padding:0;font-size:.85em}.nc-markdown table{border-collapse:collapse;display:block;overflow-x:auto}.nc-markdown th,.nc-markdown td{border:1px solid var(--color-ink-700);text-align:left;padding:.4em .7em}.nc-markdown th{background:var(--color-ink-850);font-weight:600}@keyframes nc-fade-in{0%{opacity:0}to{opacity:1}}.nc-fade{animation:.16s ease-out nc-fade-in}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}@keyframes pulse{50%{opacity:.5}} diff --git a/viewer-ui/dist/assets/index-C5DKumZP.css b/viewer-ui/dist/assets/index-C5DKumZP.css new file mode 100644 index 00000000..e7595eae --- /dev/null +++ b/viewer-ui/dist/assets/index-C5DKumZP.css @@ -0,0 +1,2 @@ +/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */ +@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-border-style:solid;--tw-font-weight:initial;--tw-tracking:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-outline-style:solid;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial}}}@layer theme{:root,:host{--font-sans:system-ui, sans-serif;--font-mono:ui-monospace, "JetBrains Mono", "SF Mono", Menlo, Consolas, monospace;--color-black:#000;--color-white:#fff;--spacing:.25rem;--text-xs:.75rem;--text-xs--line-height:calc(1 / .75);--text-lg:1.125rem;--text-lg--line-height:calc(1.75 / 1.125);--font-weight-medium:500;--font-weight-semibold:600;--font-weight-bold:700;--tracking-wide:.025em;--radius-sm:.25rem;--radius-md:.375rem;--animate-pulse:pulse 2s cubic-bezier(.4, 0, .6, 1) infinite;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4, 0, .2, 1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono);--color-ink-950:#0b0b0d;--color-ink-900:#121215;--color-ink-850:#17171b;--color-ink-800:#1d1d22;--color-ink-700:#2a2a31;--color-ink-600:#3a3a43;--color-ink-400:#6f6f7d;--color-ink-200:#a8a8b5;--color-ink-50:#e6e6ec;--color-accent:#d9a441;--color-added:#4ba36b;--color-removed:#c85f5f}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--default-font-family,-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring:where(:not(iframe)){outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab, red, red)){::placeholder{color:color-mix(in oklab, currentcolor 50%, transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::file-selector-button{appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}}@layer components;@layer utilities{.pointer-events-auto{pointer-events:auto}.pointer-events-none{pointer-events:none}.invisible{visibility:hidden}.visible{visibility:visible}.sr-only{clip-path:inset(50%);white-space:nowrap;border-width:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.static{position:static}.sticky{position:sticky}.inset-0{inset:0}.top-0{top:0}.top-3{top:calc(var(--spacing) * 3)}.-right-px{right:-1px}.right-3{right:calc(var(--spacing) * 3)}.left-0{left:0}.z-10{z-index:10}.z-40{z-index:40}.z-50{z-index:50}.z-\[60\]{z-index:60}.container{width:100%}@media (width>=40rem){.container{max-width:40rem}}@media (width>=48rem){.container{max-width:48rem}}@media (width>=64rem){.container{max-width:64rem}}@media (width>=80rem){.container{max-width:80rem}}@media (width>=96rem){.container{max-width:96rem}}.mx-2{margin-inline:calc(var(--spacing) * 2)}.mx-auto{margin-inline:auto}.-my-\[8\.8px\]{margin-block:-8.8px}.my-1{margin-block:var(--spacing)}.mt-0\.5{margin-top:calc(var(--spacing) * .5)}.mt-1{margin-top:var(--spacing)}.mr-1{margin-right:var(--spacing)}.-mb-px{margin-bottom:-1px}.mb-1{margin-bottom:var(--spacing)}.mb-2{margin-bottom:calc(var(--spacing) * 2)}.mb-2\.5{margin-bottom:calc(var(--spacing) * 2.5)}.mb-3{margin-bottom:calc(var(--spacing) * 3)}.mb-5{margin-bottom:calc(var(--spacing) * 5)}.ml-auto{margin-left:auto}.block{display:block}.flex{display:flex}.grid{display:grid}.hidden{display:none}.inline{display:inline}.table{display:table}.h-3{height:calc(var(--spacing) * 3)}.h-3\.5{height:calc(var(--spacing) * 3.5)}.h-4{height:calc(var(--spacing) * 4)}.h-5{height:calc(var(--spacing) * 5)}.h-6{height:calc(var(--spacing) * 6)}.h-8{height:calc(var(--spacing) * 8)}.h-10{height:calc(var(--spacing) * 10)}.h-12{height:calc(var(--spacing) * 12)}.h-72{height:calc(var(--spacing) * 72)}.h-\[22px\]{height:22px}.h-full{height:100%}.max-h-\[70vh\]{max-height:70vh}.max-h-\[80vh\]{max-height:80vh}.min-h-0{min-height:0}.min-h-9{min-height:calc(var(--spacing) * 9)}.min-h-11{min-height:calc(var(--spacing) * 11)}.w-1\.5{width:calc(var(--spacing) * 1.5)}.w-2{width:calc(var(--spacing) * 2)}.w-3{width:calc(var(--spacing) * 3)}.w-3\.5{width:calc(var(--spacing) * 3.5)}.w-4{width:calc(var(--spacing) * 4)}.w-5{width:calc(var(--spacing) * 5)}.w-6{width:calc(var(--spacing) * 6)}.w-8{width:calc(var(--spacing) * 8)}.w-10{width:calc(var(--spacing) * 10)}.w-12{width:calc(var(--spacing) * 12)}.w-56{width:calc(var(--spacing) * 56)}.w-80{width:calc(var(--spacing) * 80)}.w-\[17rem\]{width:17rem}.w-\[22px\]{width:22px}.w-\[34rem\]{width:34rem}.w-full{width:100%}.w-max{width:max-content}.max-w-\[6rem\]{max-width:6rem}.max-w-\[9rem\]{max-width:9rem}.max-w-\[80vw\]{max-width:80vw}.max-w-\[86vw\]{max-width:86vw}.max-w-\[calc\(100vw-1\.5rem\)\]{max-width:calc(100vw - 1.5rem)}.max-w-full{max-width:100%}.min-w-0{min-width:0}.min-w-9{min-width:calc(var(--spacing) * 9)}.min-w-full{min-width:100%}.flex-1{flex:1}.shrink-0{flex-shrink:0}.basis-1\/2{flex-basis:50%}.rotate-90{rotate:90deg}.transform{transform:var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.animate-pulse{animation:var(--animate-pulse)}.cursor-col-resize{cursor:col-resize}.cursor-grab{cursor:grab}.cursor-grabbing{cursor:grabbing}.touch-none{touch-action:none}.resize{resize:both}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.grid-rows-\[auto_1fr\]{grid-template-rows:auto 1fr}.grid-rows-\[auto_minmax\(0\,1fr\)_auto_auto\]{grid-template-rows:auto minmax(0,1fr) auto auto}.flex-col{flex-direction:column}.items-baseline{align-items:baseline}.items-center{align-items:center}.items-start{align-items:flex-start}.items-stretch{align-items:stretch}.justify-center{justify-content:center}.gap-0\.5{gap:calc(var(--spacing) * .5)}.gap-1{gap:var(--spacing)}.gap-2{gap:calc(var(--spacing) * 2)}.gap-3{gap:calc(var(--spacing) * 3)}.self-stretch{align-self:stretch}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.rounded{border-radius:.25rem}.rounded-\[20\.7\%\]{border-radius:20.7%}.rounded-full{border-radius:3.40282e38px}.rounded-md{border-radius:var(--radius-md)}.rounded-sm{border-radius:var(--radius-sm)}.border{border-style:var(--tw-border-style);border-width:1px}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-r{border-right-style:var(--tw-border-style);border-right-width:1px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-b-2{border-bottom-style:var(--tw-border-style);border-bottom-width:2px}.border-l{border-left-style:var(--tw-border-style);border-left-width:1px}.border-accent{border-color:var(--color-accent)}.border-ink-700{border-color:var(--color-ink-700)}.border-ink-800{border-color:var(--color-ink-800)}.border-transparent{border-color:#0000}.bg-accent{background-color:var(--color-accent)}.bg-added\/10{background-color:#4ba36b1a}@supports (color:color-mix(in lab, red, red)){.bg-added\/10{background-color:color-mix(in oklab, var(--color-added) 10%, transparent)}}.bg-black\/60{background-color:#0009}@supports (color:color-mix(in lab, red, red)){.bg-black\/60{background-color:color-mix(in oklab, var(--color-black) 60%, transparent)}}.bg-ink-50{background-color:var(--color-ink-50)}.bg-ink-700{background-color:var(--color-ink-700)}.bg-ink-800{background-color:var(--color-ink-800)}.bg-ink-850{background-color:var(--color-ink-850)}.bg-ink-900{background-color:var(--color-ink-900)}.bg-ink-900\/40{background-color:#12121566}@supports (color:color-mix(in lab, red, red)){.bg-ink-900\/40{background-color:color-mix(in oklab, var(--color-ink-900) 40%, transparent)}}.bg-ink-950{background-color:var(--color-ink-950)}.bg-removed\/10{background-color:#c85f5f1a}@supports (color:color-mix(in lab, red, red)){.bg-removed\/10{background-color:color-mix(in oklab, var(--color-removed) 10%, transparent)}}.p-1{padding:var(--spacing)}.p-3{padding:calc(var(--spacing) * 3)}.p-4{padding:calc(var(--spacing) * 4)}.p-6{padding:calc(var(--spacing) * 6)}.px-1{padding-inline:var(--spacing)}.px-1\.5{padding-inline:calc(var(--spacing) * 1.5)}.px-2{padding-inline:calc(var(--spacing) * 2)}.px-2\.5{padding-inline:calc(var(--spacing) * 2.5)}.px-3{padding-inline:calc(var(--spacing) * 3)}.px-\[12\.8px\]{padding-inline:12.8px}.py-0\.5{padding-block:calc(var(--spacing) * .5)}.py-1{padding-block:var(--spacing)}.py-1\.5{padding-block:calc(var(--spacing) * 1.5)}.py-2{padding-block:calc(var(--spacing) * 2)}.py-\[8\.8px\]{padding-block:8.8px}.pr-1{padding-right:var(--spacing)}.pr-3{padding-right:calc(var(--spacing) * 3)}.pl-1{padding-left:var(--spacing)}.pl-2{padding-left:calc(var(--spacing) * 2)}.pl-3{padding-left:calc(var(--spacing) * 3)}.text-center{text-align:center}.text-left{text-align:left}.text-right{text-align:right}.font-sans{font-family:var(--font-sans)}.text-lg{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.text-\[0\.62rem\]{font-size:.62rem}.text-\[0\.65rem\]{font-size:.65rem}.text-\[0\.72rem\]{font-size:.72rem}.text-\[10px\]{font-size:10px}.text-\[11px\]{font-size:11px}.text-\[16px\]{font-size:16px}.font-bold{--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.tracking-\[0\.04em\]{--tw-tracking:.04em;letter-spacing:.04em}.tracking-\[0\.18em\]{--tw-tracking:.18em;letter-spacing:.18em}.tracking-wide{--tw-tracking:var(--tracking-wide);letter-spacing:var(--tracking-wide)}.break-words{overflow-wrap:break-word}.whitespace-nowrap{white-space:nowrap}.whitespace-pre{white-space:pre}.text-accent{color:var(--color-accent)}.text-added{color:var(--color-added)}.text-ink-50{color:var(--color-ink-50)}.text-ink-200{color:var(--color-ink-200)}.text-ink-400{color:var(--color-ink-400)}.text-ink-600{color:var(--color-ink-600)}.text-ink-950{color:var(--color-ink-950)}.text-removed{color:var(--color-removed)}.uppercase{text-transform:uppercase}.italic{font-style:italic}.underline{text-decoration-line:underline}.underline\!{text-decoration-line:underline!important}.opacity-60{opacity:.6}.shadow{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-\[inset_0_2px_0_0_var\(--color-accent\)\]{--tw-shadow:inset 0 2px 0 0 var(--tw-shadow-color,var(--color-accent));box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-lg{--tw-shadow:0 10px 15px -3px var(--tw-shadow-color,#0000001a), 0 4px 6px -4px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.ring-1{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.ring-accent{--tw-ring-color:var(--color-accent)}.ring-ink-600{--tw-ring-color:var(--color-ink-600)}.outline{outline-style:var(--tw-outline-style);outline-width:1px}.blur{--tw-blur:blur(8px);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.filter{filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.transition{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-transform{transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.outline-none{--tw-outline-style:none;outline-style:none}.select-none{-webkit-user-select:none;user-select:none}.ring-inset{--tw-ring-inset:inset}.placeholder\:text-ink-400::placeholder{color:var(--color-ink-400)}@media (hover:hover){.hover\:bg-accent:hover{background-color:var(--color-accent)}.hover\:bg-ink-700:hover{background-color:var(--color-ink-700)}.hover\:bg-ink-850:hover{background-color:var(--color-ink-850)}.hover\:bg-white:hover{background-color:var(--color-white)}.hover\:text-accent:hover{color:var(--color-accent)}.hover\:text-ink-200:hover{color:var(--color-ink-200)}.hover\:text-removed:hover{color:var(--color-removed)}}.focus\:border-accent:focus{border-color:var(--color-accent)}.focus\:border-ink-600:focus{border-color:var(--color-ink-600)}.focus\:ring-1:focus{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.focus\:ring-\[3px\]:focus{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(3px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.focus\:ring-accent:focus{--tw-ring-color:var(--color-accent)}.focus\:ring-accent\/15:focus{--tw-ring-color:#d9a44126}@supports (color:color-mix(in lab, red, red)){.focus\:ring-accent\/15:focus{--tw-ring-color:color-mix(in oklab, var(--color-accent) 15%, transparent)}}.focus\:outline-none:focus{--tw-outline-style:none;outline-style:none}.active\:bg-ink-700:active{background-color:var(--color-ink-700)}.active\:text-accent:active{color:var(--color-accent)}.disabled\:opacity-50:disabled{opacity:.5}@media (width>=40rem){.sm\:inline{display:inline}}@media (width>=48rem){.md\:block{display:block}.md\:flex{display:flex}.md\:grid{display:grid}.md\:hidden{display:none}.md\:inline-flex{display:inline-flex}.md\:h-6{height:calc(var(--spacing) * 6)}.md\:w-6{width:calc(var(--spacing) * 6)}.md\:grid-cols-\[var\(--nc-sidebar\)_1fr\]{grid-template-columns:var(--nc-sidebar) 1fr}.md\:grid-rows-\[auto_minmax\(0\,0fr\)_minmax\(0\,1fr\)_auto\]{grid-template-rows:auto minmax(0,0fr) minmax(0,1fr) auto}.md\:grid-rows-\[auto_minmax\(0\,1fr\)_minmax\(0\,0fr\)_auto\]{grid-template-rows:auto minmax(0,1fr) minmax(0,0fr) auto}.md\:grid-rows-\[auto_minmax\(0\,11fr\)_minmax\(0\,9fr\)_auto\]{grid-template-rows:auto minmax(0,11fr) minmax(0,9fr) auto}.md\:border-r{border-right-style:var(--tw-border-style);border-right-width:1px}}}.xterm{cursor:text;-webkit-user-select:none;user-select:none;position:relative}.xterm.focus,.xterm:focus{outline:none}.xterm .xterm-helpers{z-index:5;position:absolute;top:0}.xterm .xterm-helper-textarea{opacity:0;z-index:-5;white-space:nowrap;resize:none;border:0;width:0;height:0;margin:0;padding:0;position:absolute;top:0;left:-9999em;overflow:hidden}.xterm .composition-view{color:#fff;white-space:nowrap;z-index:1;background:#000;display:none;position:absolute}.xterm .composition-view.active{display:block}.xterm .xterm-viewport{cursor:default;background-color:#000;position:absolute;inset:0;overflow-y:scroll}.xterm .xterm-screen{position:relative}.xterm .xterm-screen canvas{position:absolute;top:0;left:0}.xterm-char-measure-element{visibility:hidden;line-height:normal;display:inline-block;position:absolute;top:0;left:-9999em}.xterm.enable-mouse-events{cursor:default}.xterm.xterm-cursor-pointer,.xterm .xterm-cursor-pointer{cursor:pointer}.xterm.column-select.focus{cursor:crosshair}.xterm .xterm-accessibility:not(.debug),.xterm .xterm-message{z-index:10;color:#0000;pointer-events:none;position:absolute;inset:0}.xterm .xterm-accessibility-tree:not(.debug) ::selection{color:#0000}.xterm .xterm-accessibility-tree{-webkit-user-select:text;user-select:text;white-space:pre;font-family:monospace}.xterm .xterm-accessibility-tree>div{transform-origin:0;width:fit-content}.xterm .live-region{width:1px;height:1px;position:absolute;left:-9999px;overflow:hidden}.xterm-dim{opacity:1!important}.xterm-underline-1{text-decoration:underline}.xterm-underline-2{-webkit-text-decoration:underline double;text-decoration:underline double}.xterm-underline-3{-webkit-text-decoration:underline wavy;text-decoration:underline wavy}.xterm-underline-4{-webkit-text-decoration:underline dotted;text-decoration:underline dotted}.xterm-underline-5{-webkit-text-decoration:underline dashed;text-decoration:underline dashed}.xterm-overline{text-decoration:overline}.xterm-overline.xterm-underline-1{text-decoration:underline overline}.xterm-overline.xterm-underline-2{-webkit-text-decoration:overline double underline;-webkit-text-decoration:overline double underline;-webkit-text-decoration:overline double underline;text-decoration:overline double underline}.xterm-overline.xterm-underline-3{-webkit-text-decoration:overline wavy underline;-webkit-text-decoration:overline wavy underline;-webkit-text-decoration:overline wavy underline;text-decoration:overline wavy underline}.xterm-overline.xterm-underline-4{-webkit-text-decoration:overline dotted underline;-webkit-text-decoration:overline dotted underline;-webkit-text-decoration:overline dotted underline;text-decoration:overline dotted underline}.xterm-overline.xterm-underline-5{-webkit-text-decoration:overline dashed underline;-webkit-text-decoration:overline dashed underline;-webkit-text-decoration:overline dashed underline;text-decoration:overline dashed underline}.xterm-strikethrough{text-decoration:line-through}.xterm-screen .xterm-decoration-container .xterm-decoration{z-index:6;position:absolute}.xterm-screen .xterm-decoration-container .xterm-decoration.xterm-decoration-top-layer{z-index:7}.xterm-decoration-overview-ruler{z-index:8;pointer-events:none;position:absolute;top:0;right:0}.xterm-decoration-top{z-index:2;position:relative}.xterm .xterm-scrollable-element>.scrollbar{cursor:default}.xterm .xterm-scrollable-element>.scrollbar>.scra{cursor:pointer;font-size:11px!important}.xterm .xterm-scrollable-element>.visible{opacity:1;z-index:11;background:0 0;transition:opacity .1s linear}.xterm .xterm-scrollable-element>.invisible{opacity:0;pointer-events:none}.xterm .xterm-scrollable-element>.invisible.fade{transition:opacity .8s linear}.xterm .xterm-scrollable-element>.shadow{display:none;position:absolute}.xterm .xterm-scrollable-element>.shadow.top{width:100%;height:3px;box-shadow:var(--vscode-scrollbar-shadow,#000) 0 6px 6px -6px inset;display:block;top:0;left:3px}.xterm .xterm-scrollable-element>.shadow.left{width:3px;height:100%;box-shadow:var(--vscode-scrollbar-shadow,#000) 6px 0 6px -6px inset;display:block;top:3px;left:0}.xterm .xterm-scrollable-element>.shadow.top-left-corner{width:3px;height:3px;display:block;top:0;left:0}.xterm .xterm-scrollable-element>.shadow.top.left{box-shadow:var(--vscode-scrollbar-shadow,#000) 6px 0 6px -6px inset}html,body,#root{height:100%}html{font-size:14px}body{background:var(--color-ink-950);color:var(--color-ink-50);font-family:var(--font-mono);margin:0;font-size:.85rem;line-height:1.4}button:not(:disabled),[role=button]:not(:disabled){cursor:pointer}*{scrollbar-width:thin;scrollbar-color:var(--color-ink-600) transparent}.nc-markdown{max-width:52rem;font-family:var(--font-sans);color:var(--color-ink-50);line-height:1.6}.nc-markdown h1,.nc-markdown h2,.nc-markdown h3,.nc-markdown h4,.nc-markdown h5,.nc-markdown h6{margin:1.4em 0 .6em;font-weight:600;line-height:1.25}.nc-markdown h1{border-bottom:1px solid var(--color-ink-700);padding-bottom:.3em;font-size:1.6em}.nc-markdown h2{border-bottom:1px solid var(--color-ink-800);padding-bottom:.25em;font-size:1.35em}.nc-markdown h3{font-size:1.15em}.nc-markdown h4{font-size:1em}.nc-markdown h5,.nc-markdown h6{color:var(--color-ink-200);font-size:.9em}.nc-markdown :first-child{margin-top:0}.nc-markdown p,.nc-markdown ul,.nc-markdown ol,.nc-markdown blockquote,.nc-markdown table,.nc-markdown pre{margin:.75em 0}.nc-markdown ul,.nc-markdown ol{padding-left:1.5em}.nc-markdown ul{list-style:outside}.nc-markdown ol{list-style:decimal}.nc-markdown li{margin:.25em 0}.nc-markdown li::marker{color:var(--color-ink-400)}.nc-markdown li:has(>input[type=checkbox]){margin-left:-1.2em;list-style:none}.nc-markdown a{color:var(--color-accent);text-underline-offset:2px;text-decoration:underline}.nc-markdown strong{font-weight:600}.nc-markdown em{font-style:italic}.nc-markdown blockquote{border-left:3px solid var(--color-ink-700);color:var(--color-ink-200);padding-left:1em}.nc-markdown hr{border:0;border-top:1px solid var(--color-ink-700);margin:1.5em 0}.nc-markdown img{max-width:100%}.nc-markdown :not(pre)>code{font-family:var(--font-mono);background:var(--color-ink-800);border-radius:3px;padding:.1em .35em;font-size:.9em}.nc-markdown pre{background:var(--color-ink-850);border:1px solid var(--color-ink-800);border-radius:4px;padding:.9em 1em;overflow-x:auto}.nc-markdown pre code{font-family:var(--font-mono);background:0 0;padding:0;font-size:.85em}.nc-markdown table{border-collapse:collapse;display:block;overflow-x:auto}.nc-markdown th,.nc-markdown td{border:1px solid var(--color-ink-700);text-align:left;padding:.4em .7em}.nc-markdown th{background:var(--color-ink-850);font-weight:600}@keyframes nc-fade-in{0%{opacity:0}to{opacity:1}}.nc-fade{animation:.16s ease-out nc-fade-in}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-outline-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}@keyframes pulse{50%{opacity:.5}} diff --git a/viewer-ui/dist/assets/index-Ck-wCR_a.js b/viewer-ui/dist/assets/index-Ck-wCR_a.js deleted file mode 100644 index aafcf9ce..00000000 --- a/viewer-ui/dist/assets/index-Ck-wCR_a.js +++ /dev/null @@ -1,11 +0,0 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./Markdown-Dc2pdrht.js","./Markdown-Dfs9RUU9.css"])))=>i.map(i=>d[i]); -(function(){const r=document.createElement("link").relList;if(r&&r.supports&&r.supports("modulepreload"))return;for(const x of document.querySelectorAll('link[rel="modulepreload"]'))s(x);new MutationObserver(x=>{for(const g of x)if(g.type==="childList")for(const T of g.addedNodes)T.tagName==="LINK"&&T.rel==="modulepreload"&&s(T)}).observe(document,{childList:!0,subtree:!0});function h(x){const g={};return x.integrity&&(g.integrity=x.integrity),x.referrerPolicy&&(g.referrerPolicy=x.referrerPolicy),x.crossOrigin==="use-credentials"?g.credentials="include":x.crossOrigin==="anonymous"?g.credentials="omit":g.credentials="same-origin",g}function s(x){if(x.ep)return;x.ep=!0;const g=h(x);fetch(x.href,g)}})();var Hi={exports:{}},Ge={};var V1;function GL(){if(V1)return Ge;V1=1;var c=Symbol.for("react.transitional.element"),r=Symbol.for("react.fragment");function h(s,x,g){var T=null;if(g!==void 0&&(T=""+g),x.key!==void 0&&(T=""+x.key),"key"in x){g={};for(var C in x)C!=="key"&&(g[C]=x[C])}else g=x;return x=g.ref,{$$typeof:c,type:s,key:T,ref:x!==void 0?x:null,props:g}}return Ge.Fragment=r,Ge.jsx=h,Ge.jsxs=h,Ge}var K1;function QL(){return K1||(K1=1,Hi.exports=GL()),Hi.exports}var o=QL(),Ri={exports:{}},P={};var J1;function kL(){if(J1)return P;J1=1;var c=Symbol.for("react.transitional.element"),r=Symbol.for("react.portal"),h=Symbol.for("react.fragment"),s=Symbol.for("react.strict_mode"),x=Symbol.for("react.profiler"),g=Symbol.for("react.consumer"),T=Symbol.for("react.context"),C=Symbol.for("react.forward_ref"),M=Symbol.for("react.suspense"),v=Symbol.for("react.memo"),U=Symbol.for("react.lazy"),j=Symbol.for("react.activity"),R=Symbol.iterator;function H(d){return d===null||typeof d!="object"?null:(d=R&&d[R]||d["@@iterator"],typeof d=="function"?d:null)}var Y={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},J=Object.assign,$={};function e0(d,N,B){this.props=d,this.context=N,this.refs=$,this.updater=B||Y}e0.prototype.isReactComponent={},e0.prototype.setState=function(d,N){if(typeof d!="object"&&typeof d!="function"&&d!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,d,N,"setState")},e0.prototype.forceUpdate=function(d){this.updater.enqueueForceUpdate(this,d,"forceUpdate")};function t0(){}t0.prototype=e0.prototype;function Z(d,N,B){this.props=d,this.context=N,this.refs=$,this.updater=B||Y}var F=Z.prototype=new t0;F.constructor=Z,J(F,e0.prototype),F.isPureReactComponent=!0;var m0=Array.isArray;function I(){}var Q={H:null,A:null,T:null,S:null},i0=Object.prototype.hasOwnProperty;function z0(d,N,B){var X=B.ref;return{$$typeof:c,type:d,key:N,ref:X!==void 0?X:null,props:B}}function J0(d,N){return z0(d.type,N,d.props)}function D0(d){return typeof d=="object"&&d!==null&&d.$$typeof===c}function j0(d){var N={"=":"=0",":":"=2"};return"$"+d.replace(/[=:]/g,function(B){return N[B]})}var w0=/\/+/g;function M0(d,N){return typeof d=="object"&&d!==null&&d.key!=null?j0(""+d.key):N.toString(36)}function q0(d){switch(d.status){case"fulfilled":return d.value;case"rejected":throw d.reason;default:switch(typeof d.status=="string"?d.then(I,I):(d.status="pending",d.then(function(N){d.status==="pending"&&(d.status="fulfilled",d.value=N)},function(N){d.status==="pending"&&(d.status="rejected",d.reason=N)})),d.status){case"fulfilled":return d.value;case"rejected":throw d.reason}}throw d}function z(d,N,B,X,V){var l0=typeof d;(l0==="undefined"||l0==="boolean")&&(d=null);var r0=!1;if(d===null)r0=!0;else switch(l0){case"bigint":case"string":case"number":r0=!0;break;case"object":switch(d.$$typeof){case c:case r:r0=!0;break;case U:return r0=d._init,z(r0(d._payload),N,B,X,V)}}if(r0)return V=V(d),r0=X===""?"."+M0(d,0):X,m0(V)?(B="",r0!=null&&(B=r0.replace(w0,"$&/")+"/"),z(V,N,B,"",function(i2){return i2})):V!=null&&(D0(V)&&(V=J0(V,B+(V.key==null||d&&d.key===V.key?"":(""+V.key).replace(w0,"$&/")+"/")+r0)),N.push(V)),1;r0=0;var g0=X===""?".":X+":";if(m0(d))for(var _0=0;_0>>1,n0=z[c0];if(0>>1;c0x(B,w))Xx(V,B)?(z[c0]=V,z[X]=w,c0=X):(z[c0]=B,z[N]=w,c0=N);else if(Xx(V,w))z[c0]=V,z[X]=w,c0=X;else break t}}return q}function x(z,q){var w=z.sortIndex-q.sortIndex;return w!==0?w:z.id-q.id}if(c.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var g=performance;c.unstable_now=function(){return g.now()}}else{var T=Date,C=T.now();c.unstable_now=function(){return T.now()-C}}var M=[],v=[],U=1,j=null,R=3,H=!1,Y=!1,J=!1,$=!1,e0=typeof setTimeout=="function"?setTimeout:null,t0=typeof clearTimeout=="function"?clearTimeout:null,Z=typeof setImmediate<"u"?setImmediate:null;function F(z){for(var q=h(v);q!==null;){if(q.callback===null)s(v);else if(q.startTime<=z)s(v),q.sortIndex=q.expirationTime,r(M,q);else break;q=h(v)}}function m0(z){if(J=!1,F(z),!Y)if(h(M)!==null)Y=!0,I||(I=!0,j0());else{var q=h(v);q!==null&&q0(m0,q.startTime-z)}}var I=!1,Q=-1,i0=5,z0=-1;function J0(){return $?!0:!(c.unstable_now()-z0z&&J0());){var c0=j.callback;if(typeof c0=="function"){j.callback=null,R=j.priorityLevel;var n0=c0(j.expirationTime<=z);if(z=c.unstable_now(),typeof n0=="function"){j.callback=n0,F(z),q=!0;break l}j===h(M)&&s(M),F(z)}else s(M);j=h(M)}if(j!==null)q=!0;else{var d=h(v);d!==null&&q0(m0,d.startTime-z),q=!1}}break t}finally{j=null,R=w,H=!1}q=void 0}}finally{q?j0():I=!1}}}var j0;if(typeof Z=="function")j0=function(){Z(D0)};else if(typeof MessageChannel<"u"){var w0=new MessageChannel,M0=w0.port2;w0.port1.onmessage=D0,j0=function(){M0.postMessage(null)}}else j0=function(){e0(D0,0)};function q0(z,q){Q=e0(function(){z(c.unstable_now())},q)}c.unstable_IdlePriority=5,c.unstable_ImmediatePriority=1,c.unstable_LowPriority=4,c.unstable_NormalPriority=3,c.unstable_Profiling=null,c.unstable_UserBlockingPriority=2,c.unstable_cancelCallback=function(z){z.callback=null},c.unstable_forceFrameRate=function(z){0>z||125c0?(z.sortIndex=w,r(v,z),h(M)===null&&z===h(v)&&(J?(t0(Q),Q=-1):J=!0,q0(m0,w-c0))):(z.sortIndex=n0,r(M,z),Y||H||(Y=!0,I||(I=!0,j0()))),z},c.unstable_shouldYield=J0,c.unstable_wrapCallback=function(z){var q=R;return function(){var w=R;R=q;try{return z.apply(this,arguments)}finally{R=w}}}})(Yi)),Yi}var F1;function VL(){return F1||(F1=1,qi.exports=wL()),qi.exports}var Zi={exports:{}},e2={};var I1;function KL(){if(I1)return e2;I1=1;var c=$i();function r(M){var v="https://react.dev/errors/"+M;if(1"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(c)}catch(r){console.error(r)}}return c(),Zi.exports=KL(),Zi.exports}var tr;function $L(){if(tr)return Qe;tr=1;var c=VL(),r=$i(),h=JL();function s(t){var l="https://react.dev/errors/"+t;if(1n0||(t.current=c0[n0],c0[n0]=null,n0--)}function B(t,l){n0++,c0[n0]=t.current,t.current=l}var X=d(null),V=d(null),l0=d(null),r0=d(null);function g0(t,l){switch(B(l0,l),B(V,t),B(X,null),l.nodeType){case 9:case 11:t=(t=l.documentElement)&&(t=t.namespaceURI)?h1(t):0;break;default:if(t=l.tagName,l=l.namespaceURI)l=h1(l),t=v1(l,t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}N(X),B(X,t)}function _0(){N(X),N(V),N(l0)}function i2(t){t.memoizedState!==null&&B(r0,t);var l=X.current,e=v1(l,t.type);l!==e&&(B(V,t),B(X,e))}function c2(t){V.current===t&&(N(X),N(V)),r0.current===t&&(N(r0),qe._currentValue=w)}var l2,x2;function E2(t){if(l2===void 0)try{throw Error()}catch(e){var l=e.stack.trim().match(/\n( *(at )?)/);l2=l&&l[1]||"",x2=-1)":-1n||L[a]!==b[n]){var _=` -`+L[a].replace(" at new "," at ");return t.displayName&&_.includes("")&&(_=_.replace("",t.displayName)),_}while(1<=a&&0<=n);break}}}finally{ot=!1,Error.prepareStackTrace=e}return(e=t?t.displayName||t.name:"")?E2(e):""}function yn(t,l){switch(t.tag){case 26:case 27:case 5:return E2(t.type);case 16:return E2("Lazy");case 13:return t.child!==l&&l!==null?E2("Suspense Fallback"):E2("Suspense");case 19:return E2("SuspenseList");case 0:case 15:return wl(t.type,!1);case 11:return wl(t.type.render,!1);case 1:return wl(t.type,!0);case 31:return E2("Activity");default:return""}}function Ve(t){try{var l="",e=null;do l+=yn(t,e),e=t,t=t.return;while(t);return l}catch(a){return` -Error generating stack: `+a.message+` -`+a.stack}}var Vl=Object.prototype.hasOwnProperty,Kl=c.unstable_scheduleCallback,Jl=c.unstable_cancelCallback,$l=c.unstable_shouldYield,el=c.unstable_requestPaint,a2=c.unstable_now,Wl=c.unstable_getCurrentPriorityLevel,Ke=c.unstable_ImmediatePriority,Je=c.unstable_UserBlockingPriority,Rt=c.unstable_NormalPriority,gn=c.unstable_LowPriority,$e=c.unstable_IdlePriority,Sn=c.log,We=c.unstable_setDisableYieldValue,Z2=null,$0=null;function X2(t){if(typeof Sn=="function"&&We(t),$0&&typeof $0.setStrictMode=="function")try{$0.setStrictMode(Z2,t)}catch{}}var n2=Math.clz32?Math.clz32:xn,bn=Math.log,pn=Math.LN2;function xn(t){return t>>>=0,t===0?32:31-(bn(t)/pn|0)|0}var al=256,nl=262144,ul=4194304;function V2(t){var l=t&42;if(l!==0)return l;switch(t&-t){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 t&261888;case 262144:case 524288:case 1048576:case 2097152:return t&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return t&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return t}}function il(t,l,e){var a=t.pendingLanes;if(a===0)return 0;var n=0,u=t.suspendedLanes,i=t.pingedLanes;t=t.warmLanes;var f=a&134217727;return f!==0?(a=f&~u,a!==0?n=V2(a):(i&=f,i!==0?n=V2(i):e||(e=f&~t,e!==0&&(n=V2(e))))):(f=a&~u,f!==0?n=V2(f):i!==0?n=V2(i):e||(e=a&~t,e!==0&&(n=V2(e)))),n===0?0:l!==0&&l!==n&&(l&u)===0&&(u=n&-n,e=l&-l,u>=e||u===32&&(e&4194048)!==0)?l:n}function Bt(t,l){return(t.pendingLanes&~(t.suspendedLanes&~t.pingedLanes)&l)===0}function Fl(t,l){switch(t){case 1:case 2:case 4:case 8:case 64:return l+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return l+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Fe(){var t=ul;return ul<<=1,(ul&62914560)===0&&(ul=4194304),t}function Il(t){for(var l=[],e=0;31>e;e++)l.push(t);return l}function qt(t,l){t.pendingLanes|=l,l!==268435456&&(t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0)}function En(t,l,e,a,n,u){var i=t.pendingLanes;t.pendingLanes=e,t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0,t.expiredLanes&=e,t.entangledLanes&=e,t.errorRecoveryDisabledLanes&=e,t.shellSuspendCounter=0;var f=t.entanglements,L=t.expirationTimes,b=t.hiddenUpdates;for(e=i&~e;0"u")return null;try{return t.activeElement||t.body}catch{return t.body}}var Hr=/[\n"\\]/g;function z2(t){return t.replace(Hr,function(l){return"\\"+l.charCodeAt(0).toString(16)+" "})}function Nn(t,l,e,a,n,u,i,f){t.name="",i!=null&&typeof i!="function"&&typeof i!="symbol"&&typeof i!="boolean"?t.type=i:t.removeAttribute("type"),l!=null?i==="number"?(l===0&&t.value===""||t.value!=l)&&(t.value=""+T2(l)):t.value!==""+T2(l)&&(t.value=""+T2(l)):i!=="submit"&&i!=="reset"||t.removeAttribute("value"),l!=null?jn(t,i,T2(l)):e!=null?jn(t,i,T2(e)):a!=null&&t.removeAttribute("value"),n==null&&u!=null&&(t.defaultChecked=!!u),n!=null&&(t.checked=n&&typeof n!="function"&&typeof n!="symbol"),f!=null&&typeof f!="function"&&typeof f!="symbol"&&typeof f!="boolean"?t.name=""+T2(f):t.removeAttribute("name")}function fc(t,l,e,a,n,u,i,f){if(u!=null&&typeof u!="function"&&typeof u!="symbol"&&typeof u!="boolean"&&(t.type=u),l!=null||e!=null){if(!(u!=="submit"&&u!=="reset"||l!=null)){An(t);return}e=e!=null?""+T2(e):"",l=l!=null?""+T2(l):e,f||l===t.value||(t.value=l),t.defaultValue=l}a=a??n,a=typeof a!="function"&&typeof a!="symbol"&&!!a,t.checked=f?t.checked:!!a,t.defaultChecked=!!a,i!=null&&typeof i!="function"&&typeof i!="symbol"&&typeof i!="boolean"&&(t.name=i),An(t)}function jn(t,l,e){l==="number"&&la(t.ownerDocument)===t||t.defaultValue===""+e||(t.defaultValue=""+e)}function Ll(t,l,e,a){if(t=t.options,l){l={};for(var n=0;n"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Hn=!1;if($2)try{var ee={};Object.defineProperty(ee,"passive",{get:function(){Hn=!0}}),window.addEventListener("test",ee,ee),window.removeEventListener("test",ee,ee)}catch{Hn=!1}var dt=null,Rn=null,aa=null;function hc(){if(aa)return aa;var t,l=Rn,e=l.length,a,n="value"in dt?dt.value:dt.textContent,u=n.length;for(t=0;t=ue),pc=" ",xc=!1;function Ec(t,l){switch(t){case"keyup":return so.indexOf(l.keyCode)!==-1;case"keydown":return l.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Tc(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var vl=!1;function oo(t,l){switch(t){case"compositionend":return Tc(l);case"keypress":return l.which!==32?null:(xc=!0,pc);case"textInput":return t=l.data,t===pc&&xc?null:t;default:return null}}function Lo(t,l){if(vl)return t==="compositionend"||!Xn&&Ec(t,l)?(t=hc(),aa=Rn=dt=null,vl=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(l.ctrlKey||l.altKey||l.metaKey)||l.ctrlKey&&l.altKey){if(l.char&&1=l)return{node:e,offset:l-t};t=a}t:{for(;e;){if(e.nextSibling){e=e.nextSibling;break t}e=e.parentNode}e=void 0}e=Dc(e)}}function Uc(t,l){return t&&l?t===l?!0:t&&t.nodeType===3?!1:l&&l.nodeType===3?Uc(t,l.parentNode):"contains"in t?t.contains(l):t.compareDocumentPosition?!!(t.compareDocumentPosition(l)&16):!1:!1}function Hc(t){t=t!=null&&t.ownerDocument!=null&&t.ownerDocument.defaultView!=null?t.ownerDocument.defaultView:window;for(var l=la(t.document);l instanceof t.HTMLIFrameElement;){try{var e=typeof l.contentWindow.location.href=="string"}catch{e=!1}if(e)t=l.contentWindow;else break;l=la(t.document)}return l}function kn(t){var l=t&&t.nodeName&&t.nodeName.toLowerCase();return l&&(l==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||l==="textarea"||t.contentEditable==="true")}var po=$2&&"documentMode"in document&&11>=document.documentMode,yl=null,wn=null,se=null,Vn=!1;function Rc(t,l,e){var a=e.window===e?e.document:e.nodeType===9?e:e.ownerDocument;Vn||yl==null||yl!==la(a)||(a=yl,"selectionStart"in a&&kn(a)?a={start:a.selectionStart,end:a.selectionEnd}:(a=(a.ownerDocument&&a.ownerDocument.defaultView||window).getSelection(),a={anchorNode:a.anchorNode,anchorOffset:a.anchorOffset,focusNode:a.focusNode,focusOffset:a.focusOffset}),se&&fe(se,a)||(se=a,a=Wa(wn,"onSelect"),0>=i,n-=i,G2=1<<32-n2(l)+n|e<u0?(L0=k,k=null):L0=k.sibling;var v0=p(y,k,S[u0],O);if(v0===null){k===null&&(k=L0);break}t&&k&&v0.alternate===null&&l(y,k),m=u(v0,m,u0),h0===null?K=v0:h0.sibling=v0,h0=v0,k=L0}if(u0===S.length)return e(y,k),d0&&F2(y,u0),K;if(k===null){for(;u0u0?(L0=k,k=null):L0=k.sibling;var Ht=p(y,k,v0.value,O);if(Ht===null){k===null&&(k=L0);break}t&&k&&Ht.alternate===null&&l(y,k),m=u(Ht,m,u0),h0===null?K=Ht:h0.sibling=Ht,h0=Ht,k=L0}if(v0.done)return e(y,k),d0&&F2(y,u0),K;if(k===null){for(;!v0.done;u0++,v0=S.next())v0=D(y,v0.value,O),v0!==null&&(m=u(v0,m,u0),h0===null?K=v0:h0.sibling=v0,h0=v0);return d0&&F2(y,u0),K}for(k=a(k);!v0.done;u0++,v0=S.next())v0=E(k,y,u0,v0.value,O),v0!==null&&(t&&v0.alternate!==null&&k.delete(v0.key===null?u0:v0.key),m=u(v0,m,u0),h0===null?K=v0:h0.sibling=v0,h0=v0);return t&&k.forEach(function(XL){return l(y,XL)}),d0&&F2(y,u0),K}function E0(y,m,S,O){if(typeof S=="object"&&S!==null&&S.type===J&&S.key===null&&(S=S.props.children),typeof S=="object"&&S!==null){switch(S.$$typeof){case H:t:{for(var K=S.key;m!==null;){if(m.key===K){if(K=S.type,K===J){if(m.tag===7){e(y,m.sibling),O=n(m,S.props.children),O.return=y,y=O;break t}}else if(m.elementType===K||typeof K=="object"&&K!==null&&K.$$typeof===i0&&$t(K)===m.type){e(y,m.sibling),O=n(m,S.props),he(O,S),O.return=y,y=O;break t}e(y,m);break}else l(y,m);m=m.sibling}S.type===J?(O=kt(S.props.children,y.mode,O,S.key),O.return=y,y=O):(O=da(S.type,S.key,S.props,null,y.mode,O),he(O,S),O.return=y,y=O)}return i(y);case Y:t:{for(K=S.key;m!==null;){if(m.key===K)if(m.tag===4&&m.stateNode.containerInfo===S.containerInfo&&m.stateNode.implementation===S.implementation){e(y,m.sibling),O=n(m,S.children||[]),O.return=y,y=O;break t}else{e(y,m);break}else l(y,m);m=m.sibling}O=Pn(S,y.mode,O),O.return=y,y=O}return i(y);case i0:return S=$t(S),E0(y,m,S,O)}if(q0(S))return G(y,m,S,O);if(j0(S)){if(K=j0(S),typeof K!="function")throw Error(s(150));return S=K.call(S),W(y,m,S,O)}if(typeof S.then=="function")return E0(y,m,ba(S),O);if(S.$$typeof===Z)return E0(y,m,va(y,S),O);pa(y,S)}return typeof S=="string"&&S!==""||typeof S=="number"||typeof S=="bigint"?(S=""+S,m!==null&&m.tag===6?(e(y,m.sibling),O=n(m,S),O.return=y,y=O):(e(y,m),O=In(S,y.mode,O),O.return=y,y=O),i(y)):e(y,m)}return function(y,m,S,O){try{me=0;var K=E0(y,m,S,O);return Al=null,K}catch(k){if(k===_l||k===ga)throw k;var h0=v2(29,k,null,y.mode);return h0.lanes=O,h0.return=y,h0}}}var Ft=uf(!0),cf=uf(!1),gt=!1;function ou(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Lu(t,l){t=t.updateQueue,l.updateQueue===t&&(l.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,callbacks:null})}function St(t){return{lane:t,tag:0,payload:null,callback:null,next:null}}function bt(t,l,e){var a=t.updateQueue;if(a===null)return null;if(a=a.shared,(y0&2)!==0){var n=a.pending;return n===null?l.next=l:(l.next=n.next,n.next=l),a.pending=l,l=La(t),Qc(t,null,e),l}return oa(t,a,l,e),La(t)}function ve(t,l,e){if(l=l.updateQueue,l!==null&&(l=l.shared,(e&4194048)!==0)){var a=l.lanes;a&=t.pendingLanes,e|=a,l.lanes=e,Q0(t,e)}}function du(t,l){var e=t.updateQueue,a=t.alternate;if(a!==null&&(a=a.updateQueue,e===a)){var n=null,u=null;if(e=e.firstBaseUpdate,e!==null){do{var i={lane:e.lane,tag:e.tag,payload:e.payload,callback:null,next:null};u===null?n=u=i:u=u.next=i,e=e.next}while(e!==null);u===null?n=u=l:u=u.next=l}else n=u=l;e={baseState:a.baseState,firstBaseUpdate:n,lastBaseUpdate:u,shared:a.shared,callbacks:a.callbacks},t.updateQueue=e;return}t=e.lastBaseUpdate,t===null?e.firstBaseUpdate=l:t.next=l,e.lastBaseUpdate=l}var mu=!1;function ye(){if(mu){var t=Ml;if(t!==null)throw t}}function ge(t,l,e,a){mu=!1;var n=t.updateQueue;gt=!1;var u=n.firstBaseUpdate,i=n.lastBaseUpdate,f=n.shared.pending;if(f!==null){n.shared.pending=null;var L=f,b=L.next;L.next=null,i===null?u=b:i.next=b,i=L;var _=t.alternate;_!==null&&(_=_.updateQueue,f=_.lastBaseUpdate,f!==i&&(f===null?_.firstBaseUpdate=b:f.next=b,_.lastBaseUpdate=L))}if(u!==null){var D=n.baseState;i=0,_=b=L=null,f=u;do{var p=f.lane&-536870913,E=p!==f.lane;if(E?(o0&p)===p:(a&p)===p){p!==0&&p===zl&&(mu=!0),_!==null&&(_=_.next={lane:0,tag:f.tag,payload:f.payload,callback:null,next:null});t:{var G=t,W=f;p=l;var E0=e;switch(W.tag){case 1:if(G=W.payload,typeof G=="function"){D=G.call(E0,D,p);break t}D=G;break t;case 3:G.flags=G.flags&-65537|128;case 0:if(G=W.payload,p=typeof G=="function"?G.call(E0,D,p):G,p==null)break t;D=j({},D,p);break t;case 2:gt=!0}}p=f.callback,p!==null&&(t.flags|=64,E&&(t.flags|=8192),E=n.callbacks,E===null?n.callbacks=[p]:E.push(p))}else E={lane:p,tag:f.tag,payload:f.payload,callback:f.callback,next:null},_===null?(b=_=E,L=D):_=_.next=E,i|=p;if(f=f.next,f===null){if(f=n.shared.pending,f===null)break;E=f,f=E.next,E.next=null,n.lastBaseUpdate=E,n.shared.pending=null}}while(!0);_===null&&(L=D),n.baseState=L,n.firstBaseUpdate=b,n.lastBaseUpdate=_,u===null&&(n.shared.lanes=0),zt|=i,t.lanes=i,t.memoizedState=D}}function ff(t,l){if(typeof t!="function")throw Error(s(191,t));t.call(l)}function sf(t,l){var e=t.callbacks;if(e!==null)for(t.callbacks=null,t=0;tu?u:8;var i=z.T,f={};z.T=f,Cu(t,!1,l,e);try{var L=n(),b=z.S;if(b!==null&&b(f,L),L!==null&&typeof L=="object"&&typeof L.then=="function"){var _=jo(L,a);pe(t,l,_,p2(t))}else pe(t,l,a,p2(t))}catch(D){pe(t,l,{then:function(){},status:"rejected",reason:D},p2())}finally{q.p=u,i!==null&&f.types!==null&&(i.types=f.types),z.T=i}}function Ro(){}function Ou(t,l,e,a){if(t.tag!==5)throw Error(s(476));var n=Xf(t).queue;Zf(t,n,l,w,e===null?Ro:function(){return Gf(t),e(a)})}function Xf(t){var l=t.memoizedState;if(l!==null)return l;l={memoizedState:w,baseState:w,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:lt,lastRenderedState:w},next:null};var e={};return l.next={memoizedState:e,baseState:e,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:lt,lastRenderedState:e},next:null},t.memoizedState=l,t=t.alternate,t!==null&&(t.memoizedState=l),l}function Gf(t){var l=Xf(t);l.next===null&&(l=t.alternate.memoizedState),pe(t,l.next.queue,{},p2())}function Du(){return I0(qe)}function Qf(){return R0().memoizedState}function kf(){return R0().memoizedState}function Bo(t){for(var l=t.return;l!==null;){switch(l.tag){case 24:case 3:var e=p2();t=St(e);var a=bt(l,t,e);a!==null&&(m2(a,l,e),ve(a,l,e)),l={cache:cu()},t.payload=l;return}l=l.return}}function qo(t,l,e){var a=p2();e={lane:a,revertLane:0,gesture:null,action:e,hasEagerState:!1,eagerState:null,next:null},Oa(t)?Vf(l,e):(e=Wn(t,l,e,a),e!==null&&(m2(e,t,a),Kf(e,l,a)))}function wf(t,l,e){var a=p2();pe(t,l,e,a)}function pe(t,l,e,a){var n={lane:a,revertLane:0,gesture:null,action:e,hasEagerState:!1,eagerState:null,next:null};if(Oa(t))Vf(l,n);else{var u=t.alternate;if(t.lanes===0&&(u===null||u.lanes===0)&&(u=l.lastRenderedReducer,u!==null))try{var i=l.lastRenderedState,f=u(i,e);if(n.hasEagerState=!0,n.eagerState=f,h2(f,i))return oa(t,l,n,0),T0===null&&ra(),!1}catch{}if(e=Wn(t,l,n,a),e!==null)return m2(e,t,a),Kf(e,l,a),!0}return!1}function Cu(t,l,e,a){if(a={lane:2,revertLane:oi(),gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},Oa(t)){if(l)throw Error(s(479))}else l=Wn(t,e,a,2),l!==null&&m2(l,t,2)}function Oa(t){var l=t.alternate;return t===a0||l!==null&&l===a0}function Vf(t,l){jl=Ta=!0;var e=t.pending;e===null?l.next=l:(l.next=e.next,e.next=l),t.pending=l}function Kf(t,l,e){if((e&4194048)!==0){var a=l.lanes;a&=t.pendingLanes,e|=a,l.lanes=e,Q0(t,e)}}var xe={readContext:I0,use:_a,useCallback:C0,useContext:C0,useEffect:C0,useImperativeHandle:C0,useLayoutEffect:C0,useInsertionEffect:C0,useMemo:C0,useReducer:C0,useRef:C0,useState:C0,useDebugValue:C0,useDeferredValue:C0,useTransition:C0,useSyncExternalStore:C0,useId:C0,useHostTransitionStatus:C0,useFormState:C0,useActionState:C0,useOptimistic:C0,useMemoCache:C0,useCacheRefresh:C0};xe.useEffectEvent=C0;var Jf={readContext:I0,use:_a,useCallback:function(t,l){return u2().memoizedState=[t,l===void 0?null:l],t},useContext:I0,useEffect:Of,useImperativeHandle:function(t,l,e){e=e!=null?e.concat([t]):null,Na(4194308,4,Hf.bind(null,l,t),e)},useLayoutEffect:function(t,l){return Na(4194308,4,t,l)},useInsertionEffect:function(t,l){Na(4,2,t,l)},useMemo:function(t,l){var e=u2();l=l===void 0?null:l;var a=t();if(It){X2(!0);try{t()}finally{X2(!1)}}return e.memoizedState=[a,l],a},useReducer:function(t,l,e){var a=u2();if(e!==void 0){var n=e(l);if(It){X2(!0);try{e(l)}finally{X2(!1)}}}else n=l;return a.memoizedState=a.baseState=n,t={pending:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:n},a.queue=t,t=t.dispatch=qo.bind(null,a0,t),[a.memoizedState,t]},useRef:function(t){var l=u2();return t={current:t},l.memoizedState=t},useState:function(t){t=Mu(t);var l=t.queue,e=wf.bind(null,a0,l);return l.dispatch=e,[t.memoizedState,e]},useDebugValue:Nu,useDeferredValue:function(t,l){var e=u2();return ju(e,t,l)},useTransition:function(){var t=Mu(!1);return t=Zf.bind(null,a0,t.queue,!0,!1),u2().memoizedState=t,[!1,t]},useSyncExternalStore:function(t,l,e){var a=a0,n=u2();if(d0){if(e===void 0)throw Error(s(407));e=e()}else{if(e=l(),T0===null)throw Error(s(349));(o0&127)!==0||hf(a,l,e)}n.memoizedState=e;var u={value:e,getSnapshot:l};return n.queue=u,Of(yf.bind(null,a,u,t),[t]),a.flags|=2048,Dl(9,{destroy:void 0},vf.bind(null,a,u,e,l),null),e},useId:function(){var t=u2(),l=T0.identifierPrefix;if(d0){var e=Q2,a=G2;e=(a&~(1<<32-n2(a)-1)).toString(32)+e,l="_"+l+"R_"+e,e=za++,0<\/script>",u=u.removeChild(u.firstChild);break;case"select":u=typeof a.is=="string"?i.createElement("select",{is:a.is}):i.createElement("select"),a.multiple?u.multiple=!0:a.size&&(u.size=a.size);break;default:u=typeof a.is=="string"?i.createElement(n,{is:a.is}):i.createElement(n)}}u[W0]=l,u[f2]=a;t:for(i=l.child;i!==null;){if(i.tag===5||i.tag===6)u.appendChild(i.stateNode);else if(i.tag!==4&&i.tag!==27&&i.child!==null){i.child.return=i,i=i.child;continue}if(i===l)break t;for(;i.sibling===null;){if(i.return===null||i.return===l)break t;i=i.return}i.sibling.return=i.return,i=i.sibling}l.stateNode=u;t:switch(t2(u,n,a),n){case"button":case"input":case"select":case"textarea":a=!!a.autoFocus;break t;case"img":a=!0;break t;default:a=!1}a&&at(l)}}return N0(l),Ku(l,l.type,t===null?null:t.memoizedProps,l.pendingProps,e),null;case 6:if(t&&l.stateNode!=null)t.memoizedProps!==a&&at(l);else{if(typeof a!="string"&&l.stateNode===null)throw Error(s(166));if(t=l0.current,El(l)){if(t=l.stateNode,e=l.memoizedProps,a=null,n=F0,n!==null)switch(n.tag){case 27:case 5:a=n.memoizedProps}t[W0]=l,t=!!(t.nodeValue===e||a!==null&&a.suppressHydrationWarning===!0||d1(t.nodeValue,e)),t||vt(l,!0)}else t=Fa(t).createTextNode(a),t[W0]=l,l.stateNode=t}return N0(l),null;case 31:if(e=l.memoizedState,t===null||t.memoizedState!==null){if(a=El(l),e!==null){if(t===null){if(!a)throw Error(s(318));if(t=l.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(s(557));t[W0]=l}else wt(),(l.flags&128)===0&&(l.memoizedState=null),l.flags|=4;N0(l),t=!1}else e=au(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=e),t=!0;if(!t)return l.flags&256?(g2(l),l):(g2(l),null);if((l.flags&128)!==0)throw Error(s(558))}return N0(l),null;case 13:if(a=l.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(n=El(l),a!==null&&a.dehydrated!==null){if(t===null){if(!n)throw Error(s(318));if(n=l.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(s(317));n[W0]=l}else wt(),(l.flags&128)===0&&(l.memoizedState=null),l.flags|=4;N0(l),n=!1}else n=au(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=n),n=!0;if(!n)return l.flags&256?(g2(l),l):(g2(l),null)}return g2(l),(l.flags&128)!==0?(l.lanes=e,l):(e=a!==null,t=t!==null&&t.memoizedState!==null,e&&(a=l.child,n=null,a.alternate!==null&&a.alternate.memoizedState!==null&&a.alternate.memoizedState.cachePool!==null&&(n=a.alternate.memoizedState.cachePool.pool),u=null,a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(u=a.memoizedState.cachePool.pool),u!==n&&(a.flags|=2048)),e!==t&&e&&(l.child.flags|=8192),Ra(l,l.updateQueue),N0(l),null);case 4:return _0(),t===null&&hi(l.stateNode.containerInfo),N0(l),null;case 10:return P2(l.type),N0(l),null;case 19:if(N(H0),a=l.memoizedState,a===null)return N0(l),null;if(n=(l.flags&128)!==0,u=a.rendering,u===null)if(n)Te(a,!1);else{if(U0!==0||t!==null&&(t.flags&128)!==0)for(t=l.child;t!==null;){if(u=Ea(t),u!==null){for(l.flags|=128,Te(a,!1),t=u.updateQueue,l.updateQueue=t,Ra(l,t),l.subtreeFlags=0,t=e,e=l.child;e!==null;)kc(e,t),e=e.sibling;return B(H0,H0.current&1|2),d0&&F2(l,a.treeForkCount),l.child}t=t.sibling}a.tail!==null&&a2()>Xa&&(l.flags|=128,n=!0,Te(a,!1),l.lanes=4194304)}else{if(!n)if(t=Ea(u),t!==null){if(l.flags|=128,n=!0,t=t.updateQueue,l.updateQueue=t,Ra(l,t),Te(a,!0),a.tail===null&&a.tailMode==="hidden"&&!u.alternate&&!d0)return N0(l),null}else 2*a2()-a.renderingStartTime>Xa&&e!==536870912&&(l.flags|=128,n=!0,Te(a,!1),l.lanes=4194304);a.isBackwards?(u.sibling=l.child,l.child=u):(t=a.last,t!==null?t.sibling=u:l.child=u,a.last=u)}return a.tail!==null?(t=a.tail,a.rendering=t,a.tail=t.sibling,a.renderingStartTime=a2(),t.sibling=null,e=H0.current,B(H0,n?e&1|2:e&1),d0&&F2(l,a.treeForkCount),t):(N0(l),null);case 22:case 23:return g2(l),vu(),a=l.memoizedState!==null,t!==null?t.memoizedState!==null!==a&&(l.flags|=8192):a&&(l.flags|=8192),a?(e&536870912)!==0&&(l.flags&128)===0&&(N0(l),l.subtreeFlags&6&&(l.flags|=8192)):N0(l),e=l.updateQueue,e!==null&&Ra(l,e.retryQueue),e=null,t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),a=null,l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(a=l.memoizedState.cachePool.pool),a!==e&&(l.flags|=2048),t!==null&&N(Jt),null;case 24:return e=null,t!==null&&(e=t.memoizedState.cache),l.memoizedState.cache!==e&&(l.flags|=2048),P2(Y0),N0(l),null;case 25:return null;case 30:return null}throw Error(s(156,l.tag))}function Qo(t,l){switch(lu(l),l.tag){case 1:return t=l.flags,t&65536?(l.flags=t&-65537|128,l):null;case 3:return P2(Y0),_0(),t=l.flags,(t&65536)!==0&&(t&128)===0?(l.flags=t&-65537|128,l):null;case 26:case 27:case 5:return c2(l),null;case 31:if(l.memoizedState!==null){if(g2(l),l.alternate===null)throw Error(s(340));wt()}return t=l.flags,t&65536?(l.flags=t&-65537|128,l):null;case 13:if(g2(l),t=l.memoizedState,t!==null&&t.dehydrated!==null){if(l.alternate===null)throw Error(s(340));wt()}return t=l.flags,t&65536?(l.flags=t&-65537|128,l):null;case 19:return N(H0),null;case 4:return _0(),null;case 10:return P2(l.type),null;case 22:case 23:return g2(l),vu(),t!==null&&N(Jt),t=l.flags,t&65536?(l.flags=t&-65537|128,l):null;case 24:return P2(Y0),null;case 25:return null;default:return null}}function gs(t,l){switch(lu(l),l.tag){case 3:P2(Y0),_0();break;case 26:case 27:case 5:c2(l);break;case 4:_0();break;case 31:l.memoizedState!==null&&g2(l);break;case 13:g2(l);break;case 19:N(H0);break;case 10:P2(l.type);break;case 22:case 23:g2(l),vu(),t!==null&&N(Jt);break;case 24:P2(Y0)}}function ze(t,l){try{var e=l.updateQueue,a=e!==null?e.lastEffect:null;if(a!==null){var n=a.next;e=n;do{if((e.tag&t)===t){a=void 0;var u=e.create,i=e.inst;a=u(),i.destroy=a}e=e.next}while(e!==n)}}catch(f){b0(l,l.return,f)}}function Et(t,l,e){try{var a=l.updateQueue,n=a!==null?a.lastEffect:null;if(n!==null){var u=n.next;a=u;do{if((a.tag&t)===t){var i=a.inst,f=i.destroy;if(f!==void 0){i.destroy=void 0,n=l;var L=e,b=f;try{b()}catch(_){b0(n,L,_)}}}a=a.next}while(a!==u)}}catch(_){b0(l,l.return,_)}}function Ss(t){var l=t.updateQueue;if(l!==null){var e=t.stateNode;try{sf(l,e)}catch(a){b0(t,t.return,a)}}}function bs(t,l,e){e.props=Pt(t.type,t.memoizedProps),e.state=t.memoizedState;try{e.componentWillUnmount()}catch(a){b0(t,l,a)}}function Me(t,l){try{var e=t.ref;if(e!==null){switch(t.tag){case 26:case 27:case 5:var a=t.stateNode;break;case 30:a=t.stateNode;break;default:a=t.stateNode}typeof e=="function"?t.refCleanup=e(a):e.current=a}}catch(n){b0(t,l,n)}}function k2(t,l){var e=t.ref,a=t.refCleanup;if(e!==null)if(typeof a=="function")try{a()}catch(n){b0(t,l,n)}finally{t.refCleanup=null,t=t.alternate,t!=null&&(t.refCleanup=null)}else if(typeof e=="function")try{e(null)}catch(n){b0(t,l,n)}else e.current=null}function ps(t){var l=t.type,e=t.memoizedProps,a=t.stateNode;try{t:switch(l){case"button":case"input":case"select":case"textarea":e.autoFocus&&a.focus();break t;case"img":e.src?a.src=e.src:e.srcSet&&(a.srcset=e.srcSet)}}catch(n){b0(t,t.return,n)}}function Ju(t,l,e){try{var a=t.stateNode;oL(a,t.type,e,l),a[f2]=l}catch(n){b0(t,t.return,n)}}function xs(t){return t.tag===5||t.tag===3||t.tag===26||t.tag===27&&jt(t.type)||t.tag===4}function $u(t){t:for(;;){for(;t.sibling===null;){if(t.return===null||xs(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.tag===27&&jt(t.type)||t.flags&2||t.child===null||t.tag===4)continue t;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function Wu(t,l,e){var a=t.tag;if(a===5||a===6)t=t.stateNode,l?(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e).insertBefore(t,l):(l=e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,l.appendChild(t),e=e._reactRootContainer,e!=null||l.onclick!==null||(l.onclick=J2));else if(a!==4&&(a===27&&jt(t.type)&&(e=t.stateNode,l=null),t=t.child,t!==null))for(Wu(t,l,e),t=t.sibling;t!==null;)Wu(t,l,e),t=t.sibling}function Ba(t,l,e){var a=t.tag;if(a===5||a===6)t=t.stateNode,l?e.insertBefore(t,l):e.appendChild(t);else if(a!==4&&(a===27&&jt(t.type)&&(e=t.stateNode),t=t.child,t!==null))for(Ba(t,l,e),t=t.sibling;t!==null;)Ba(t,l,e),t=t.sibling}function Es(t){var l=t.stateNode,e=t.memoizedProps;try{for(var a=t.type,n=l.attributes;n.length;)l.removeAttributeNode(n[0]);t2(l,a,e),l[W0]=t,l[f2]=e}catch(u){b0(t,t.return,u)}}var nt=!1,G0=!1,Fu=!1,Ts=typeof WeakSet=="function"?WeakSet:Set,K0=null;function ko(t,l){if(t=t.containerInfo,gi=nn,t=Hc(t),kn(t)){if("selectionStart"in t)var e={start:t.selectionStart,end:t.selectionEnd};else t:{e=(e=t.ownerDocument)&&e.defaultView||window;var a=e.getSelection&&e.getSelection();if(a&&a.rangeCount!==0){e=a.anchorNode;var n=a.anchorOffset,u=a.focusNode;a=a.focusOffset;try{e.nodeType,u.nodeType}catch{e=null;break t}var i=0,f=-1,L=-1,b=0,_=0,D=t,p=null;l:for(;;){for(var E;D!==e||n!==0&&D.nodeType!==3||(f=i+n),D!==u||a!==0&&D.nodeType!==3||(L=i+a),D.nodeType===3&&(i+=D.nodeValue.length),(E=D.firstChild)!==null;)p=D,D=E;for(;;){if(D===t)break l;if(p===e&&++b===n&&(f=i),p===u&&++_===a&&(L=i),(E=D.nextSibling)!==null)break;D=p,p=D.parentNode}D=E}e=f===-1||L===-1?null:{start:f,end:L}}else e=null}e=e||{start:0,end:0}}else e=null;for(Si={focusedElem:t,selectionRange:e},nn=!1,K0=l;K0!==null;)if(l=K0,t=l.child,(l.subtreeFlags&1028)!==0&&t!==null)t.return=l,K0=t;else for(;K0!==null;){switch(l=K0,u=l.alternate,t=l.flags,l.tag){case 0:if((t&4)!==0&&(t=l.updateQueue,t=t!==null?t.events:null,t!==null))for(e=0;e title"))),t2(u,a,e),u[W0]=t,V0(u),a=u;break t;case"link":var i=j1("link","href",n).get(a+(e.href||""));if(i){for(var f=0;fE0&&(i=E0,E0=W,W=i);var y=Cc(f,W),m=Cc(f,E0);if(y&&m&&(E.rangeCount!==1||E.anchorNode!==y.node||E.anchorOffset!==y.offset||E.focusNode!==m.node||E.focusOffset!==m.offset)){var S=D.createRange();S.setStart(y.node,y.offset),E.removeAllRanges(),W>E0?(E.addRange(S),E.extend(m.node,m.offset)):(S.setEnd(m.node,m.offset),E.addRange(S))}}}}for(D=[],E=f;E=E.parentNode;)E.nodeType===1&&D.push({element:E,left:E.scrollLeft,top:E.scrollTop});for(typeof f.focus=="function"&&f.focus(),f=0;fe?32:e,z.T=null,e=ni,ni=null;var u=_t,i=st;if(k0=0,Bl=_t=null,st=0,(y0&6)!==0)throw Error(s(331));var f=y0;if(y0|=4,Hs(u.current),Ds(u,u.current,i,e),y0=f,De(0,!1),$0&&typeof $0.onPostCommitFiberRoot=="function")try{$0.onPostCommitFiberRoot(Z2,u)}catch{}return!0}finally{q.p=n,z.T=a,Ps(t,l)}}function l1(t,l,e){l=_2(e,l),l=Bu(t.stateNode,l,2),t=bt(t,l,2),t!==null&&(qt(t,2),w2(t))}function b0(t,l,e){if(t.tag===3)l1(t,t,e);else for(;l!==null;){if(l.tag===3){l1(l,t,e);break}else if(l.tag===1){var a=l.stateNode;if(typeof l.type.getDerivedStateFromError=="function"||typeof a.componentDidCatch=="function"&&(Mt===null||!Mt.has(a))){t=_2(e,t),e=es(2),a=bt(l,e,2),a!==null&&(as(e,a,l,t),qt(a,2),w2(a));break}}l=l.return}}function fi(t,l,e){var a=t.pingCache;if(a===null){a=t.pingCache=new Ko;var n=new Set;a.set(l,n)}else n=a.get(l),n===void 0&&(n=new Set,a.set(l,n));n.has(e)||(ti=!0,n.add(e),t=Io.bind(null,t,l,e),l.then(t,t))}function Io(t,l,e){var a=t.pingCache;a!==null&&a.delete(l),t.pingedLanes|=t.suspendedLanes&e,t.warmLanes&=~e,T0===t&&(o0&e)===e&&(U0===4||U0===3&&(o0&62914560)===o0&&300>a2()-Za?(y0&2)===0&&ql(t,0):li|=e,Rl===o0&&(Rl=0)),w2(t)}function e1(t,l){l===0&&(l=Fe()),t=Qt(t,l),t!==null&&(qt(t,l),w2(t))}function Po(t){var l=t.memoizedState,e=0;l!==null&&(e=l.retryLane),e1(t,e)}function tL(t,l){var e=0;switch(t.tag){case 31:case 13:var a=t.stateNode,n=t.memoizedState;n!==null&&(e=n.retryLane);break;case 19:a=t.stateNode;break;case 22:a=t.stateNode._retryCache;break;default:throw Error(s(314))}a!==null&&a.delete(l),e1(t,e)}function lL(t,l){return Kl(t,l)}var Ka=null,Zl=null,si=!1,Ja=!1,ri=!1,Nt=0;function w2(t){t!==Zl&&t.next===null&&(Zl===null?Ka=Zl=t:Zl=Zl.next=t),Ja=!0,si||(si=!0,aL())}function De(t,l){if(!ri&&Ja){ri=!0;do for(var e=!1,a=Ka;a!==null;){if(t!==0){var n=a.pendingLanes;if(n===0)var u=0;else{var i=a.suspendedLanes,f=a.pingedLanes;u=(1<<31-n2(42|t)+1)-1,u&=n&~(i&~f),u=u&201326741?u&201326741|1:u?u|2:0}u!==0&&(e=!0,i1(a,u))}else u=o0,u=il(a,a===T0?u:0,a.cancelPendingCommit!==null||a.timeoutHandle!==-1),(u&3)===0||Bt(a,u)||(e=!0,i1(a,u));a=a.next}while(e);ri=!1}}function eL(){a1()}function a1(){Ja=si=!1;var t=0;Nt!==0&&dL()&&(t=Nt);for(var l=a2(),e=null,a=Ka;a!==null;){var n=a.next,u=n1(a,l);u===0?(a.next=null,e===null?Ka=n:e.next=n,n===null&&(Zl=e)):(e=a,(t!==0||(u&3)!==0)&&(Ja=!0)),a=n}k0!==0&&k0!==5||De(t),Nt!==0&&(Nt=0)}function n1(t,l){for(var e=t.suspendedLanes,a=t.pingedLanes,n=t.expirationTimes,u=t.pendingLanes&-62914561;0f)break;var _=L.transferSize,D=L.initiatorType;_&&m1(D)&&(L=L.responseEnd,i+=_*(L"u"?null:document;function M1(t,l,e){var a=Xl;if(a&&typeof l=="string"&&l){var n=z2(l);n='link[rel="'+t+'"][href="'+n+'"]',typeof e=="string"&&(n+='[crossorigin="'+e+'"]'),z1.has(n)||(z1.add(n),t={rel:t,crossOrigin:e,href:l},a.querySelector(n)===null&&(l=a.createElement("link"),t2(l,"link",t),V0(l),a.head.appendChild(l)))}}function xL(t){rt.D(t),M1("dns-prefetch",t,null)}function EL(t,l){rt.C(t,l),M1("preconnect",t,l)}function TL(t,l,e){rt.L(t,l,e);var a=Xl;if(a&&t&&l){var n='link[rel="preload"][as="'+z2(l)+'"]';l==="image"&&e&&e.imageSrcSet?(n+='[imagesrcset="'+z2(e.imageSrcSet)+'"]',typeof e.imageSizes=="string"&&(n+='[imagesizes="'+z2(e.imageSizes)+'"]')):n+='[href="'+z2(t)+'"]';var u=n;switch(l){case"style":u=Gl(t);break;case"script":u=Ql(t)}C2.has(u)||(t=j({rel:"preload",href:l==="image"&&e&&e.imageSrcSet?void 0:t,as:l},e),C2.set(u,t),a.querySelector(n)!==null||l==="style"&&a.querySelector(Re(u))||l==="script"&&a.querySelector(Be(u))||(l=a.createElement("link"),t2(l,"link",t),V0(l),a.head.appendChild(l)))}}function zL(t,l){rt.m(t,l);var e=Xl;if(e&&t){var a=l&&typeof l.as=="string"?l.as:"script",n='link[rel="modulepreload"][as="'+z2(a)+'"][href="'+z2(t)+'"]',u=n;switch(a){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":u=Ql(t)}if(!C2.has(u)&&(t=j({rel:"modulepreload",href:t},l),C2.set(u,t),e.querySelector(n)===null)){switch(a){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(e.querySelector(Be(u)))return}a=e.createElement("link"),t2(a,"link",t),V0(a),e.head.appendChild(a)}}}function ML(t,l,e){rt.S(t,l,e);var a=Xl;if(a&&t){var n=rl(a).hoistableStyles,u=Gl(t);l=l||"default";var i=n.get(u);if(!i){var f={loading:0,preload:null};if(i=a.querySelector(Re(u)))f.loading=5;else{t=j({rel:"stylesheet",href:t,"data-precedence":l},e),(e=C2.get(u))&&Mi(t,e);var L=i=a.createElement("link");V0(L),t2(L,"link",t),L._p=new Promise(function(b,_){L.onload=b,L.onerror=_}),L.addEventListener("load",function(){f.loading|=1}),L.addEventListener("error",function(){f.loading|=2}),f.loading|=4,Pa(i,l,a)}i={type:"stylesheet",instance:i,count:1,state:f},n.set(u,i)}}}function _L(t,l){rt.X(t,l);var e=Xl;if(e&&t){var a=rl(e).hoistableScripts,n=Ql(t),u=a.get(n);u||(u=e.querySelector(Be(n)),u||(t=j({src:t,async:!0},l),(l=C2.get(n))&&_i(t,l),u=e.createElement("script"),V0(u),t2(u,"link",t),e.head.appendChild(u)),u={type:"script",instance:u,count:1,state:null},a.set(n,u))}}function AL(t,l){rt.M(t,l);var e=Xl;if(e&&t){var a=rl(e).hoistableScripts,n=Ql(t),u=a.get(n);u||(u=e.querySelector(Be(n)),u||(t=j({src:t,async:!0,type:"module"},l),(l=C2.get(n))&&_i(t,l),u=e.createElement("script"),V0(u),t2(u,"link",t),e.head.appendChild(u)),u={type:"script",instance:u,count:1,state:null},a.set(n,u))}}function _1(t,l,e,a){var n=(n=l0.current)?Ia(n):null;if(!n)throw Error(s(446));switch(t){case"meta":case"title":return null;case"style":return typeof e.precedence=="string"&&typeof e.href=="string"?(l=Gl(e.href),e=rl(n).hoistableStyles,a=e.get(l),a||(a={type:"style",instance:null,count:0,state:null},e.set(l,a)),a):{type:"void",instance:null,count:0,state:null};case"link":if(e.rel==="stylesheet"&&typeof e.href=="string"&&typeof e.precedence=="string"){t=Gl(e.href);var u=rl(n).hoistableStyles,i=u.get(t);if(i||(n=n.ownerDocument||n,i={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},u.set(t,i),(u=n.querySelector(Re(t)))&&!u._p&&(i.instance=u,i.state.loading=5),C2.has(t)||(e={rel:"preload",as:"style",href:e.href,crossOrigin:e.crossOrigin,integrity:e.integrity,media:e.media,hrefLang:e.hrefLang,referrerPolicy:e.referrerPolicy},C2.set(t,e),u||NL(n,t,e,i.state))),l&&a===null)throw Error(s(528,""));return i}if(l&&a!==null)throw Error(s(529,""));return null;case"script":return l=e.async,e=e.src,typeof e=="string"&&l&&typeof l!="function"&&typeof l!="symbol"?(l=Ql(e),e=rl(n).hoistableScripts,a=e.get(l),a||(a={type:"script",instance:null,count:0,state:null},e.set(l,a)),a):{type:"void",instance:null,count:0,state:null};default:throw Error(s(444,t))}}function Gl(t){return'href="'+z2(t)+'"'}function Re(t){return'link[rel="stylesheet"]['+t+"]"}function A1(t){return j({},t,{"data-precedence":t.precedence,precedence:null})}function NL(t,l,e,a){t.querySelector('link[rel="preload"][as="style"]['+l+"]")?a.loading=1:(l=t.createElement("link"),a.preload=l,l.addEventListener("load",function(){return a.loading|=1}),l.addEventListener("error",function(){return a.loading|=2}),t2(l,"link",e),V0(l),t.head.appendChild(l))}function Ql(t){return'[src="'+z2(t)+'"]'}function Be(t){return"script[async]"+t}function N1(t,l,e){if(l.count++,l.instance===null)switch(l.type){case"style":var a=t.querySelector('style[data-href~="'+z2(e.href)+'"]');if(a)return l.instance=a,V0(a),a;var n=j({},e,{"data-href":e.href,"data-precedence":e.precedence,href:null,precedence:null});return a=(t.ownerDocument||t).createElement("style"),V0(a),t2(a,"style",n),Pa(a,e.precedence,t),l.instance=a;case"stylesheet":n=Gl(e.href);var u=t.querySelector(Re(n));if(u)return l.state.loading|=4,l.instance=u,V0(u),u;a=A1(e),(n=C2.get(n))&&Mi(a,n),u=(t.ownerDocument||t).createElement("link"),V0(u);var i=u;return i._p=new Promise(function(f,L){i.onload=f,i.onerror=L}),t2(u,"link",a),l.state.loading|=4,Pa(u,e.precedence,t),l.instance=u;case"script":return u=Ql(e.src),(n=t.querySelector(Be(u)))?(l.instance=n,V0(n),n):(a=e,(n=C2.get(u))&&(a=j({},e),_i(a,n)),t=t.ownerDocument||t,n=t.createElement("script"),V0(n),t2(n,"link",a),t.head.appendChild(n),l.instance=n);case"void":return null;default:throw Error(s(443,l.type))}else l.type==="stylesheet"&&(l.state.loading&4)===0&&(a=l.instance,l.state.loading|=4,Pa(a,e.precedence,t));return l.instance}function Pa(t,l,e){for(var a=e.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),n=a.length?a[a.length-1]:null,u=n,i=0;i title"):null)}function jL(t,l,e){if(e===1||l.itemProp!=null)return!1;switch(t){case"meta":case"title":return!0;case"style":if(typeof l.precedence!="string"||typeof l.href!="string"||l.href==="")break;return!0;case"link":if(typeof l.rel!="string"||typeof l.href!="string"||l.href===""||l.onLoad||l.onError)break;return l.rel==="stylesheet"?(t=l.disabled,typeof l.precedence=="string"&&t==null):!0;case"script":if(l.async&&typeof l.async!="function"&&typeof l.async!="symbol"&&!l.onLoad&&!l.onError&&l.src&&typeof l.src=="string")return!0}return!1}function D1(t){return!(t.type==="stylesheet"&&(t.state.loading&3)===0)}function OL(t,l,e,a){if(e.type==="stylesheet"&&(typeof a.media!="string"||matchMedia(a.media).matches!==!1)&&(e.state.loading&4)===0){if(e.instance===null){var n=Gl(a.href),u=l.querySelector(Re(n));if(u){l=u._p,l!==null&&typeof l=="object"&&typeof l.then=="function"&&(t.count++,t=ln.bind(t),l.then(t,t)),e.state.loading|=4,e.instance=u,V0(u);return}u=l.ownerDocument||l,a=A1(a),(n=C2.get(n))&&Mi(a,n),u=u.createElement("link"),V0(u);var i=u;i._p=new Promise(function(f,L){i.onload=f,i.onerror=L}),t2(u,"link",a),e.instance=u}t.stylesheets===null&&(t.stylesheets=new Map),t.stylesheets.set(e,l),(l=e.state.preload)&&(e.state.loading&3)===0&&(t.count++,e=ln.bind(t),l.addEventListener("load",e),l.addEventListener("error",e))}}var Ai=0;function DL(t,l){return t.stylesheets&&t.count===0&&an(t,t.stylesheets),0Ai?50:800)+l);return t.unsuspend=e,function(){t.unsuspend=null,clearTimeout(a),clearTimeout(n)}}:null}function ln(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)an(this,this.stylesheets);else if(this.unsuspend){var t=this.unsuspend;this.unsuspend=null,t()}}}var en=null;function an(t,l){t.stylesheets=null,t.unsuspend!==null&&(t.count++,en=new Map,l.forEach(CL,t),en=null,ln.call(t))}function CL(t,l){if(!(l.state.loading&4)){var e=en.get(t);if(e)var a=e.get(null);else{e=new Map,en.set(t,e);for(var n=t.querySelectorAll("link[data-precedence],style[data-precedence]"),u=0;u"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(c)}catch(r){console.error(r)}}return c(),Bi.exports=$L(),Bi.exports}var FL=WL();const Lr=2;class we extends Error{constructor(r,h){super(h),this.status=r}status}const dr=c=>c instanceof we&&c.status===401;class mr extends Error{constructor(r){super("connection lost — check your network",{cause:r}),this.name="NetworkError"}}const IL=c=>c instanceof mr;async function hn(c,r){try{return await fetch(c,r)}catch(h){throw new mr(h)}}async function hr(c){if(!c.ok){let h=`request failed (${c.status})`;try{const s=await c.json();typeof s?.error=="string"&&(h=s.error)}catch{}throw new we(c.status,h)}const r=await c.json();if(r.version!==Lr)throw new we(c.status,`this page is out of date (server protocol v${r.version}) — reload`);return r}async function q2(c,r){const h=await hn(c,{credentials:"same-origin",signal:r});return hr(h)}async function ke(c,r){const h=await hn(c,{method:"POST",credentials:"same-origin",headers:{"Content-Type":"application/json"},body:JSON.stringify(r)});return hr(h)}const U2=c=>new URLSearchParams(c).toString(),B0={async login(c){const r=await hn("/login",{method:"POST",credentials:"same-origin",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:new URLSearchParams({password:c}).toString()});if(!r.ok)throw new we(r.status,r.status===429?"too many attempts — wait a minute":"incorrect password")},repos:c=>q2("/api/repos",c),setAccent:c=>ke("/api/prefs",{accent:c}).then(r=>r.accent),setSidebarWidth:c=>ke("/api/prefs",{sidebar_width:c}).then(r=>r.sidebar_width),status:c=>q2(`/api/status?${U2({repo:c})}`),tree:(c,r)=>q2(`/api/tree?${U2({repo:c,path:r})}`),treeSearch:(c,r)=>q2(`/api/tree/search?${U2({repo:c,q:r})}`),log:(c,r)=>q2(`/api/log?${U2(r?{repo:c,from:r.from,skip:String(r.skip)}:{repo:c})}`),diff:(c,r)=>q2(`/api/diff?${U2({repo:c,path:r})}`),file:(c,r)=>q2(`/api/file?${U2({repo:c,path:r})}`),commit:(c,r)=>q2(`/api/commit?${U2({repo:c,oid:r})}`),commitFiles:(c,r)=>q2(`/api/commit/files?${U2({repo:c,oid:r})}`),commitFileDiff:(c,r,h)=>q2(`/api/commit/file-diff?${U2({repo:c,oid:r,path:h})}`),browse:c=>q2(`/api/browse${c?`?${U2({path:c})}`:""}`),mkdir:(c,r)=>ke("/api/mkdir",{path:c,name:r}).then(h=>h.path),open:c=>ke("/api/repos",{path:c}).then(r=>r.repo),close:async c=>{const r=await hn(`/api/repos?${U2({repo:c})}`,{method:"DELETE",credentials:"same-origin"});if(!r.ok)throw new we(r.status,`could not close (${r.status})`)},reorderRepos:c=>ke("/api/repos/order",{order:c}).then(r=>r.repos)};function PL(c,r){const h=new EventSource(`/api/events?${U2({repo:c})}`);return h.addEventListener("status",s=>{try{const x=JSON.parse(s.data);x.version===Lr&&r(x)}catch{}}),()=>h.close()}let Y2=[],td=1;const Gi=new Set;function Qi(){const c=Y2;Gi.forEach(r=>r(c))}function ld(c){return Gi.add(c),c(Y2),()=>{Gi.delete(c)}}function er(c){const r=Y2.filter(h=>h.id!==c);r.length!==Y2.length&&(Y2=r,Qi())}function Xi(c,r){const h=Y2.findIndex(x=>x.kind===c&&x.message===r);if(h!==-1){const x=Y2[h];return Y2=Y2.map((g,T)=>T===h?{...g,bump:g.bump+1}:g),Qi(),x.id}const s=td++;return Y2=[...Y2,{id:s,kind:c,message:r,bump:0}].slice(-4),Qi(),s}const ki={error:c=>Xi("error",c),info:c=>Xi("info",c),success:c=>Xi("success",c)},dn=[{name:"yellow",color:"#d9a441"},{name:"cyan",color:"#03c4db"},{name:"green",color:"#77c47a"},{name:"magenta",color:"#dc8fd5"},{name:"blue",color:"#87acfd"}],vr="nightcrow.viewer.accent";function mn(c){if(!Number.isFinite(c))return 0;const r=dn.length;return(Math.trunc(c)%r+r)%r}function ed(){try{const c=localStorage.getItem(vr);return c===null?0:mn(Number(c))}catch{return 0}}function ar(c){try{localStorage.setItem(vr,String(c))}catch{}}function ad(){const[c,r]=A.useState(ed);A.useLayoutEffect(()=>{document.documentElement.style.setProperty("--color-accent",dn[c].color)},[c]);const h=A.useCallback(()=>{r(x=>{const g=mn(x+1);return ar(g),B0.setAccent(g).catch(()=>{}),g})},[]),s=A.useCallback(x=>{r(g=>{const T=mn(x);return T===g?g:(ar(T),T)})},[]);return{accent:dn[c],next:dn[mn(c+1)],cycle:h,adopt:s}}const yr="nightcrow.sidebarWidth",wi=280,gr=720,Vi=460,Sr=.5;function Ki(c){return Math.min(Math.max(Math.round(c),wi),gr)}function nr(c){let r=gr;try{r=Math.min(r,Math.round(window.innerWidth*Sr))}catch{}return Math.min(Math.max(Math.round(c),wi),Math.max(r,wi))}function nd(){try{const c=Number(localStorage.getItem(yr));return Number.isFinite(c)&&c>0?Ki(c):Vi}catch{return Vi}}function Ln(c){try{localStorage.setItem(yr,String(c))}catch{}}function ud(){const[c,r]=A.useState(nd),h=A.useCallback(T=>{const C=nr(T);r(C),Ln(C)},[]),s=A.useCallback(T=>{const C=nr(T);r(C),Ln(C),B0.setSidebarWidth(C).catch(()=>{})},[]),x=A.useCallback(()=>{const T=Ki(Vi);r(T),Ln(T),B0.setSidebarWidth(T).catch(()=>{})},[]),g=A.useCallback(T=>{r(C=>{const M=Ki(T);return M===C?C:(Ln(M),M)})},[]);return{width:c,resize:h,commit:s,reset:x,adopt:g}}const id=5e3,br=1e3;function cd(c,r){return c===void 0||c<=0?0:c-r}const fd=br;function sd(c,r,h){const s=cd(r,h);return c===null||Math.abs(s-c)>=fd?s:c}function pr(c,r,h){if(c===void 0)return"cool";const s=Math.max(0,r-c);return s>=h?"cool":spr(s,r,h)!=="cool")}const rd={fresh:"text-accent font-bold",warm:"text-accent",cool:""};function ir(c,r,h){const[s,x]=A.useState(()=>Date.now()+h);return A.useEffect(()=>{if(r<=0||!c)return;const g=c.map(M=>M.mtime),T=Date.now()+h;if(x(T),!ur(g,T,r))return;const C=setInterval(()=>{const M=Date.now()+h;x(M),ur(g,M,r)||clearInterval(C)},br);return()=>clearInterval(C)},[c,r,h]),s}function od(c,r,h){if(r===h)return c;const s=c.indexOf(r),x=c.indexOf(h);if(s===-1||x===-1)return c;const g=c.filter(M=>M!==r),T=g.indexOf(h),C=s{let Q=!1,i0;const z0=new AbortController,J0=()=>{const D0=T.current,j0=C.current,w0=v.current;return B0.repos(z0.signal).then(({repos:M0,hot:q0,accent:z,sidebar_width:q,now_ms:w})=>{if(Q)return;t0(q0),F(n0=>sd(n0,w,Date.now())),T.current===D0&&s(z),C.current===j0&&!g.current&&x(q),r(!0),I(!0);const c0=j.current||R.current!==null;v.current===w0&&!U.current&&!c0?Y(M0):Y(n0=>{const d=xr(M0.map(B=>B.id),n0.map(B=>B.id)),N=new Map(M0.map(B=>[B.id,B]));return d.map(B=>N.get(B)).filter(Boolean)}),$(n0=>n0&&M0.some(d=>d.id===n0)?n0:M0[0]?.id??null),Q||(i0=setTimeout(J0,cr))}).catch(M0=>{Q||(dr(M0)?(r(!1),I(!1)):IL(M0)||h(M0),i0=setTimeout(J0,cr))})};return J0(),()=>{Q=!0,z0.abort(),i0&&clearTimeout(i0)}},[c,r,h,s,x,M,T,C,g,v,U,j,R]),{repos:H,setRepos:Y,repo:J,setRepo:$,hot:e0,clockSkewMs:Z,reposLoaded:m0}}function dd({repo:c,authed:r,resumeTick:h,tab:s,pane:x,setPane:g,handle:T,paneRequestRef:C}){const[M,v]=A.useState(null),U=A.useRef(x);U.current=x;const j=A.useRef(s);return j.current=s,A.useEffect(()=>{v(null)},[c,r]),A.useEffect(()=>{if(!(!c||!r))return PL(c,v)},[c,r,h]),A.useEffect(()=>{if(!c||!M)return;const R=U.current;if(j.current!=="status"||R.kind!=="diff")return;const H=R.value.path;if(!M.files.some(e0=>e0.path===H)){g({kind:"empty"});return}const Y=C.current;let J=!0;const $=()=>{const e0=U.current;return J&&Y===C.current&&e0.kind==="diff"&&e0.value.path===H};return B0.diff(c,H).then(e0=>{$()&&g({kind:"diff",value:e0})}).catch(e0=>{$()&&T(e0)}),()=>{J=!1}},[M,c,T,U,j,C,g]),{status:M,paneRef:U,tabRef:j}}const md=3,hd=400;function vd({sidebarRef:c,sidebarWidth:r,resizeSidebar:h,commitSidebarWidth:s,resetSidebarWidth:x,bumpSidebarWrites:g}){const T=A.useRef(0),C=A.useRef(0),M=A.useRef(0),v=A.useRef(!1),U=A.useRef(!1),j=A.useRef(0),[R,H]=A.useState(!1),Y=A.useCallback(t0=>{if(t0.button!==0||!t0.isPrimary)return;const Z=c.current?.getBoundingClientRect().left;Z!==void 0&&(T.current=Z,C.current=t0.clientX,M.current=r,v.current=!0,U.current=!1,g(),H(!0),t0.currentTarget.setPointerCapture(t0.pointerId),t0.preventDefault())},[r,c,g]),J=A.useCallback(t0=>{v.current&&(!U.current&&Math.abs(t0.clientX-C.current){if(!v.current)return;if(v.current=!1,H(!1),U.current){s(M.current),j.current=0;return}const t0=Date.now();t0-j.current{v.current=!1,U.current=!1,j.current=0,H(!1)},[]);return{draggingSidebar:R,onSidebarDragStart:Y,onSidebarDragMove:J,onSidebarDragEnd:$,onSidebarDragCancel:e0,draggingRef:v}}function yd({repo:c,handle:r,setPane:h,paneRequestRef:s,setCommitDrillDown:x,setMobileView:g}){const T=A.useCallback(j=>{if(!c)return;g("diff");const R=s.current+=1;B0.diff(c,j).then(H=>{R===s.current&&h({kind:"diff",value:H})}).catch(H=>{R===s.current&&r(H)})},[c,r,h,s,g]),C=A.useCallback(j=>{if(!c)return;g("diff");const R=s.current+=1;B0.file(c,j).then(H=>{R===s.current&&h({kind:"file",value:H})}).catch(H=>{R===s.current&&r(H)})},[c,r,h,s,g]),M=A.useCallback(j=>{if(!c)return;g("diff");const R=s.current+=1;B0.commit(c,j).then(H=>{R===s.current&&h({kind:"diff",value:H})}).catch(H=>{R===s.current&&r(H)})},[c,r,h,s,g]),v=A.useCallback((j,R)=>{if(!c)return;g("diff");const H=s.current+=1;B0.commitFileDiff(c,j,R).then(Y=>{H===s.current&&h({kind:"diff",value:Y})}).catch(Y=>{H===s.current&&r(Y)})},[c,r,h,s,g]),U=A.useCallback(async j=>{if(!c)return;g("diff");const R=s.current+=1;try{const H=await B0.commitFiles(c,j.oid);if(R!==s.current)return;if(x({commit:j,...H}),H.files.length===0){h({kind:"empty"});return}const Y=await B0.commit(c,j.oid);R===s.current&&h({kind:"diff",value:Y})}catch(H){R===s.current&&r(H)}},[c,r,h,s,x,g]);return{openDiff:T,openFile:C,openCommit:M,openCommitFileDiff:v,openCommitFiles:U}}function gd({repo:c,authed:r,tab:h,filter:s,handle:x}){const[g,T]=A.useState([]),[C,M]=A.useState(!1),[v,U]=A.useState(!1),j=A.useRef(null),R=A.useRef(!1),H=A.useRef(0),Y=A.useCallback(()=>{H.current+=1,R.current=!1,T([]),j.current=null,M(!1),U(!1)},[]),[J,$]=A.useState(null),e0=A.useRef(g);e0.current=g;const t0=A.useCallback(async()=>{if(!c||R.current)return;R.current=!0;const I=H.current;try{const Q=j.current,i0=await B0.log(c,Q===null?void 0:{from:Q,skip:e0.current.length});if(I!==H.current)return;T(z0=>[...z0,...i0.commits]),j.current=i0.head??null,M(!i0.truncated||i0.head===void 0)}catch(Q){I===H.current&&(x(Q),U(!0))}finally{I===H.current&&(R.current=!1)}},[c,x]);A.useEffect(()=>{!c||!r||h!=="log"||g.length===0&&!C&&!v&&t0()},[c,r,h,g.length,C,v,t0]);const Z=g.filter(I=>I.summary.toLowerCase().includes(s.toLowerCase())),F=s!=="",m0=A.useRef(null);return A.useEffect(()=>{const I=m0.current;if(!I)return;const Q=new IntersectionObserver(i0=>{i0.some(z0=>z0.isIntersecting)&&t0()},{root:I.closest("ul"),rootMargin:"400px"});return Q.observe(I),()=>Q.disconnect()},[t0,C,v,F,J,h,Z.length]),{commits:g,logDone:C,logStalled:v,setLogStalled:U,commitDrillDown:J,setCommitDrillDown:$,resetLog:Y,logSentinelRef:m0,visibleCommits:Z,logPagingPaused:F}}function Sd(){const[c,r]=A.useState(0);return A.useEffect(()=>{const h=()=>{document.visibilityState==="visible"&&r(s=>s+1)};return document.addEventListener("visibilitychange",h),window.addEventListener("online",h),()=>{document.removeEventListener("visibilitychange",h),window.removeEventListener("online",h)}},[]),c}function bd(c){const[r,h]=A.useState({}),s=A.useCallback(T=>{c!=null&&h(C=>{const M=C[c]??"none",v=typeof T=="function"?T(M):T;return{...C,[c]:v}})},[c]),x=c!=null&&r[c]||"none",g=A.useCallback(T=>{h(({[T]:C,...M})=>M)},[]);return{maximized:x,setMaximized:s,dropMaximized:g}}function pd({repos:c,setRepos:r,setRepo:h,setPane:s,setTab:x,setPickerOpen:g,dropMaximized:T,handle:C,orderWrites:M}){const v=A.useCallback(j=>{M.current+=1,r(R=>R.some(H=>H.id===j.id)?R:[...R,j]),h(j.id),s({kind:"empty"}),x("status"),g(!1)},[r,h,s,x,g,M]),U=A.useCallback(async j=>{try{await B0.close(j),M.current+=1;const R=c.filter(H=>H.id!==j);r(R),h(H=>H===j?R[0]?.id??null:H),T(j)}catch(R){C(R)}},[c,r,h,T,C,M]);return{selectOpenedRepo:v,closeRepo:U}}const xd=4;function Ed({ids:c,onReorder:r,draggingRef:h}){const s=A.useRef(null),x=A.useRef(null),g=A.useRef(null),[T,C]=A.useState(null),[M,v]=A.useState(null);return{dragging:T,target:M,onStart:(H,Y)=>{H.target.closest("button[data-tab-close]")||H.button!==0||c.length<2||(s.current=Y,x.current={x:H.clientX,y:H.clientY},h.current=!1)},onMove:H=>{const Y=s.current,J=x.current;if(Y===null||J===null)return;if(!h.current&&H.buttons===0){s.current=null,x.current=null;return}if(!h.current&&Math.hypot(H.clientX-J.x,H.clientY-J.y){const H=s.current,Y=g.current;H!==null&&h.current&&Y!==null&&r(od(c,H,Y)),s.current=null,x.current=null,g.current=null,h.current=!1,C(null),v(null)}}}function Td({repos:c,setRepos:r,handle:h,writesRef:s,draggingRef:x,inFlightRef:g,pendingRef:T}){const C=A.useCallback(()=>{if(g.current||T.current===null)return;const U=T.current;T.current=null,g.current=!0;const j=s.current;B0.reorderRepos(U).then(R=>{s.current===j&&r(R)}).catch(h).finally(()=>{g.current=!1,C()})},[h,r]),M=A.useCallback(U=>{s.current+=1,r(j=>{const R=xr(j.map(Y=>Y.id),U),H=new Map(j.map(Y=>[Y.id,Y]));return R.map(Y=>H.get(Y)).filter(Boolean)}),T.current=U,C()},[C,r]);return{...Ed({ids:c.map(U=>U.id),onReorder:M,draggingRef:x}),writesRef:s,draggingRef:x,inFlightRef:g,pendingRef:T}}const zd="data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='utf-8'?%3e%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='12%2057%201150%201150'%20role='img'%20aria-label='Black%20crow'%3e%3ctitle%3eBlack%20crow%3c/title%3e%3cdesc%3eMonochrome%20black%20crow%20silhouette%20on%20a%20transparent%20background,%20framed%20so%20the%20bird%20sits%20centred%20for%20use%20as%20an%20inline%20mark%20on%20a%20square%20tile.%3c/desc%3e%3cg%20fill-rule='evenodd'%20clip-rule='evenodd'%3e%3cpath%20fill='%23000000'%20d='M%20882%20147%20L%20859%20136%20L%20844%20131%20L%20831%20129%20L%20830%20128%20L%20815%20127%20L%20814%20126%20L%20796%20126%20L%20795%20127%20L%20786%20127%20L%20785%20128%20L%20775%20129%20L%20752%20136%20L%20732%20146%20L%20713%20160%20L%20701%20172%20L%20684%20172%20L%20683%20173%20L%20673%20173%20L%20672%20174%20L%20650%20176%20L%20649%20177%20L%20627%20181%20L%20602%20190%20L%20589%20197%20L%20579%20204%20L%20562%20221%20L%20562%20223%20L%20565%20223%20L%20578%20228%20L%20581%20228%20L%20612%20238%20L%20672%20252%20L%20684%20258%20L%20698%20271%20L%20702%20278%20L%20705%20288%20L%20705%20294%20L%20703%20301%20L%20699%20308%20L%20688%20318%20L%20630%20347%20L%20593%20372%20L%20561%20399%20L%20544%20416%20L%20522%20441%20L%20492%20481%20L%20461%20531%20L%20438%20576%20L%20431%20594%20L%20425%20602%20L%20405%20635%20L%20387%20668%20L%20385%20676%20L%20390%20679%20L%20368%20705%20L%20330%20755%20L%20306%20790%20L%20296%20808%20L%20289%20818%20L%20280%20838%20L%20280%20843%20L%20283%20845%20L%20292%20843%20L%20297%20840%20L%20299%20840%20L%20321%20828%20L%20322%20830%20L%20311%20844%20L%20288%20878%20L%20287%20881%20L%20259%20924%20L%20235%20965%20L%20205%201023%20L%20205%201025%20L%20197%201042%20L%20191%201061%20L%20191%201071%20L%20192%201072%20L%20198%201071%20L%20220%201056%20L%20242%201038%20L%20300%20986%20L%20302%20987%20L%20265%201040%20L%20264%201043%20L%20246%201070%20L%20235%201090%20L%20227%201112%20L%20227%201123%20L%20229%201128%20L%20234%201133%20L%20239%201135%20L%20255%201135%20L%20274%201129%20L%20279%201134%20L%20286%201137%20L%20290%201137%20L%20291%201138%20L%20310%201138%20L%20311%201137%20L%20317%201137%20L%20318%201136%20L%20326%201135%20L%20344%201129%20L%20369%201116%20L%20395%201097%20L%20420%201073%20L%20445%201042%20L%20457%201024%20L%20461%201016%20L%20464%201013%20L%20468%201011%20L%20489%20994%20L%20595%20901%20L%20601%20906%20L%20606%20913%20L%20614%20921%20L%20637%20949%20L%20639%20953%20L%20639%20956%20L%20636%20960%20L%20634%20961%20L%20619%20962%20L%20613%20965%20L%20605%20974%20L%20602%20982%20L%20602%20994%20L%20605%201001%20L%20608%201004%20L%20609%201004%20L%20609%20999%20L%20612%20992%20L%20616%20988%20L%20620%20986%20L%20627%20986%20L%20635%20983%20L%20645%20983%20L%20646%20982%20L%20655%20982%20L%20668%20986%20L%20676%20990%20L%20682%20996%20L%20685%201003%20L%20688%201006%20L%20696%201009%20L%20697%201012%20L%20697%201024%20L%20693%201033%20L%20693%201035%20L%20695%201035%20L%20700%201032%20L%20707%201025%20L%20710%201020%20L%20713%201010%20L%20713%201003%20L%20711%20998%20L%20711%20994%20L%20712%20993%20L%20719%201003%20L%20723%201005%20L%20727%201005%20L%20730%201011%20L%20730%201022%20L%20727%201031%20L%20728%201033%20L%20740%201021%20L%20743%201014%20L%20744%201003%20L%20747%20999%20L%20749%20992%20L%20748%20977%20L%20744%20968%20L%20740%20963%20L%20741%20962%20L%20755%20961%20L%20768%20964%20L%20777%20969%20L%20783%20975%20L%20786%20981%20L%20789%20984%20L%20795%20987%20L%20799%20987%20L%20801%20991%20L%20801%20997%20L%20802%20998%20L%20799%201013%20L%20802%201012%20L%20808%201007%20L%20813%201000%20L%20816%20991%20L%20816%20981%20L%20814%20976%20L%20814%20968%20L%20815%20967%20L%20819%20970%20L%20823%20970%20L%20826%20973%20L%20829%20980%20L%20830%20993%20L%20834%20990%20L%20838%20979%20L%20838%20968%20L%20832%20951%20L%20822%20940%20L%20815%20936%20L%20803%20933%20L%20776%20935%20L%20763%20931%20L%20753%20922%20L%20731%20898%20L%20703%20865%20L%20703%20863%20L%20710%20853%20L%20711%20855%20L%20707%20862%20L%20709%20862%20L%20718%20857%20L%20754%20832%20L%20793%20799%20L%20818%20774%20L%20849%20737%20L%20850%20741%20L%20845%20755%20L%20847%20755%20L%20861%20743%20L%20881%20721%20L%20906%20686%20L%20918%20665%20L%20933%20635%20L%20951%20590%20L%20971%20525%20L%20971%20521%20L%20974%20512%20L%20974%20508%20L%20978%20493%20L%20979%20482%20L%20980%20481%20L%20981%20466%20L%20982%20465%20L%20983%20441%20L%20982%20440%20L%20982%20428%20L%20981%20427%20L%20980%20414%20L%20978%20409%20L%20976%20397%20L%20970%20381%20L%20971%20379%20L%20974%20383%20L%20976%20381%20L%20977%20334%20L%20976%20333%20L%20976%20322%20L%20975%20321%20L%20974%20307%20L%20973%20306%20L%20973%20301%20L%20972%20300%20L%20969%20280%20L%20958%20243%20L%20949%20224%20L%20949%20222%20L%20939%20204%20L%20922%20181%20L%20903%20162%20Z%20M%20625%20888%20L%20656%20874%20L%20658%20874%20L%20665%20870%20L%20725%20930%20L%20728%20934%20L%20728%20940%20L%20723%20943%20L%20714%20944%20L%20707%20950%20L%20683%20951%20L%20673%20947%20L%20659%20932%20Z%20M%20787%20182%20L%20792%20182%20L%20796%20187%20L%20795%20192%20L%20791%20195%20L%20788%20195%20L%20783%20191%20L%20783%20186%20Z'/%3e%3cpath%20fill='%23000000'%20d='M%20895%20156%20L%20863%20138%20L%20838%20130%20L%20819%20127%20L%20789%20127%20L%20777%20129%20L%20753%20136%20L%20736%20144%20L%20717%20157%20L%20702%20172%20L%20652%20176%20L%20628%20181%20L%20607%20188%20L%20585%20200%20L%20562%20222%20L%20613%20238%20L%20670%20251%20L%20683%20257%20L%20697%20269%20L%20705%20286%20L%20705%20296%20L%20703%20302%20L%20698%20310%20L%20687%20319%20L%20631%20347%20L%20591%20374%20L%20568%20393%20L%20538%20423%20L%20520%20444%20L%20481%20498%20L%20457%20539%20L%20437%20579%20L%20432%20593%20L%20413%20622%20L%20386%20671%20L%20386%20677%20L%20390%20677%20L%20391%20679%20L%20374%20698%20L%20334%20750%20L%20307%20789%20L%20290%20817%20L%20280%20839%20L%20281%20844%20L%20291%20843%20L%20323%20826%20L%20325%20827%20L%20289%20877%20L%20237%20962%20L%20209%201015%20L%20198%201040%20L%20191%201063%20L%20191%201070%20L%20194%201072%20L%20213%201061%20L%20259%201023%20L%20302%20984%20L%20303%20985%20L%20262%201045%20L%20245%201072%20L%20233%201095%20L%20227%201114%20L%20228%201126%20L%20233%201132%20L%20242%201135%20L%20252%201135%20L%20274%201128%20L%20278%201133%20L%20288%201137%20L%20313%201137%20L%20343%201129%20L%20373%201113%20L%20398%201094%20L%20424%201068%20L%20441%201047%20L%20465%201012%20L%20520%20967%20L%20595%20900%20L%20611%20917%20L%20639%20952%20L%20639%20957%20L%20637%20960%20L%20632%20962%20L%20618%20963%20L%20611%20967%20L%20606%20973%20L%20602%20983%20L%20602%20992%20L%20608%201004%20L%20611%20993%20L%20619%20986%20L%20626%20986%20L%20643%20982%20L%20656%20982%20L%20675%20989%20L%20683%20997%20L%20688%201006%20L%20696%201009%20L%20697%201025%20L%20693%201034%20L%20694%201035%20L%20701%201031%20L%20710%201019%20L%20712%201013%20L%20712%20993%20L%20720%201003%20L%20727%201005%20L%20730%201009%20L%20730%201025%20L%20727%201032%20L%20732%201030%20L%20739%201022%20L%20743%201013%20L%20743%201004%20L%20749%20991%20L%20748%20978%20L%20740%20964%20L%20743%20961%20L%20757%20961%20L%20769%20964%20L%20781%20972%20L%20791%20985%20L%20798%20986%20L%20802%20994%20L%20802%201003%20L%20799%201013%20L%20810%201004%20L%20815%20994%20L%20816%20983%20L%20814%20977%20L%20814%20965%20L%20818%20969%20L%20825%20971%20L%20830%20983%20L%20830%20993%20L%20833%20991%20L%20837%20982%20L%20838%20969%20L%20834%20956%20L%20825%20943%20L%20820%20939%20L%20807%20934%20L%20774%20935%20L%20762%20931%20L%20736%20904%20L%20702%20864%20L%20715%20845%20L%20716%20847%20L%20707%20862%20L%20719%20856%20L%20744%20839%20L%20786%20805%20L%20824%20767%20L%20851%20733%20L%20852%20735%20L%20846%20755%20L%20853%20750%20L%20883%20718%20L%20906%20685%20L%20927%20647%20L%20951%20589%20L%20968%20535%20L%20976%20502%20L%20982%20461%20L%20981%20422%20L%20976%20398%20L%20968%20378%20L%20969%20376%20L%20975%20383%20L%20977%20341%20L%20970%20286%20L%20958%20244%20L%20945%20215%20L%20925%20185%20L%20906%20165%20Z%20M%20625%20888%20L%20665%20870%20L%20728%20933%20L%20729%20940%20L%20726%20943%20L%20715%20944%20L%20708%20950%20L%20692%20952%20L%20678%20950%20L%20672%20947%20L%20662%20936%20Z%20M%20785%20183%20L%20792%20182%20L%20796%20186%20L%20796%20191%20L%20791%20195%20L%20785%20194%20L%20783%20191%20L%20783%20186%20Z'/%3e%3cpath%20fill='%23000000'%20d='M%20896%20157%20L%20869%20141%20L%20837%20130%20L%20817%20127%20L%20792%20127%20L%20778%20129%20L%20751%20137%20L%20733%20146%20L%20715%20159%20L%20702%20172%20L%20653%20176%20L%20610%20187%20L%20581%20203%20L%20562%20222%20L%20625%20241%20L%20671%20251%20L%20683%20257%20L%20698%20270%20L%20705%20285%20L%20704%20300%20L%20699%20309%20L%20689%20318%20L%20628%20349%20L%20581%20382%20L%20540%20421%20L%20517%20448%20L%20478%20503%20L%20456%20541%20L%20439%20575%20L%20432%20593%20L%20412%20624%20L%20388%20667%20L%20386%20676%20L%20390%20677%20L%20391%20679%20L%20363%20712%20L%20332%20753%20L%20289%20819%20L%20281%20836%20L%20281%20844%20L%20293%20842%20L%20323%20826%20L%20325%20827%20L%20284%20885%20L%20236%20964%20L%20205%201024%20L%20197%201043%20L%20191%201064%20L%20191%201070%20L%20197%201071%20L%20210%201063%20L%20253%201028%20L%20303%20983%20L%20304%20984%20L%20259%201050%20L%20235%201091%20L%20227%201115%20L%20228%201125%20L%20232%201131%20L%20238%201134%20L%20249%201135%20L%20261%201133%20L%20274%201128%20L%20278%201133%20L%20289%201137%20L%20312%201137%20L%20342%201129%20L%20368%201116%20L%20399%201093%20L%20423%201069%20L%20443%201044%20L%20463%201013%20L%20493%20990%20L%20595%20900%20L%20612%20918%20L%20639%20952%20L%20639%20957%20L%20636%20961%20L%20616%20964%20L%20606%20973%20L%20602%20984%20L%20602%20991%20L%20608%201004%20L%20611%20993%20L%20621%20985%20L%20625%20986%20L%20639%20982%20L%20657%20982%20L%20677%20990%20L%20685%201002%20L%20690%201007%20L%20697%201010%20L%20698%201021%20L%20693%201034%20L%20694%201035%20L%20705%201027%20L%20710%201018%20L%20712%201011%20L%20712%201001%20L%20710%20994%20L%20712%20993%20L%20720%201003%20L%20729%201006%20L%20731%201020%20L%20728%201032%20L%20738%201023%20L%20743%201012%20L%20743%201003%20L%20748%20994%20L%20747%20976%20L%20740%20964%20L%20743%20961%20L%20759%20961%20L%20767%20963%20L%20780%20971%20L%20790%20984%20L%20799%20986%20L%20802%20992%20L%20802%201004%20L%20799%201012%20L%20803%201011%20L%20810%201004%20L%20815%20994%20L%20814%20965%20L%20818%20969%20L%20823%20969%20L%20830%20982%20L%20830%20992%20L%20832%20992%20L%20837%20982%20L%20837%20965%20L%20831%20950%20L%20821%20940%20L%20806%20934%20L%20772%20935%20L%20762%20931%20L%20733%20901%20L%20702%20863%20L%20717%20842%20L%20718%20844%20L%20707%20862%20L%20738%20843%20L%20780%20810%20L%20822%20769%20L%20851%20733%20L%20852%20735%20L%20846%20755%20L%20855%20748%20L%20882%20719%20L%20904%20688%20L%20930%20640%20L%20950%20591%20L%20967%20538%20L%20978%20490%20L%20982%20459%20L%20982%20434%20L%20976%20399%20L%20967%20376%20L%20969%20375%20L%20975%20383%20L%20976%20329%20L%20971%20293%20L%20960%20250%20L%20942%20210%20L%20923%20183%20Z%20M%20625%20888%20L%20665%20870%20L%20729%20934%20L%20729%20940%20L%20726%20943%20L%20716%20944%20L%20708%20950%20L%20695%20952%20L%20677%20950%20L%20666%20941%20Z%20M%20786%20182%20L%20790%20181%20L%20794%20183%20L%20797%20188%20L%20792%20195%20L%20787%20195%20L%20782%20190%20L%20782%20187%20Z'/%3e%3cpath%20fill='%23000000'%20d='M%20893%20155%20L%20873%20143%20L%20841%20131%20L%20816%20127%20L%20794%20127%20L%20779%20129%20L%20754%20136%20L%20735%20145%20L%20715%20159%20L%20702%20172%20L%20648%20177%20L%20629%20181%20L%20608%20188%20L%20584%20201%20L%20562%20222%20L%20614%20238%20L%20671%20251%20L%20685%20258%20L%20698%20270%20L%20704%20281%20L%20706%20292%20L%20703%20303%20L%20699%20309%20L%20686%20320%20L%20628%20349%20L%20590%20375%20L%20565%20396%20L%20543%20418%20L%20518%20447%20L%20490%20485%20L%20460%20534%20L%20441%20571%20L%20431%20595%20L%20405%20636%20L%20386%20672%20L%20386%20676%20L%20390%20677%20L%20391%20679%20L%20371%20702%20L%20335%20749%20L%20291%20816%20L%20280%20840%20L%20282%20844%20L%20298%20840%20L%20324%20825%20L%20326%20826%20L%20294%20870%20L%20235%20966%20L%20206%201022%20L%20198%201041%20L%20191%201065%20L%20191%201070%20L%20196%201071%20L%20214%201060%20L%20254%201027%20L%20303%20983%20L%20304%20984%20L%20256%201055%20L%20232%201098%20L%20227%201115%20L%20228%201125%20L%20232%201131%20L%20239%201134%20L%20248%201135%20L%20264%201132%20L%20274%201128%20L%20280%201134%20L%20289%201137%20L%20311%201137%20L%20339%201130%20L%20371%201114%20L%20401%201091%20L%20422%201070%20L%20440%201048%20L%20463%201013%20L%20487%20995%20L%20595%20900%20L%20613%20919%20L%20639%20951%20L%20639%20958%20L%20636%20961%20L%20619%20963%20L%20613%20966%20L%20605%20975%20L%20602%20991%20L%20604%20998%20L%20608%201003%20L%20611%20993%20L%20620%20985%20L%20624%20986%20L%20632%20983%20L%20647%20981%20L%20658%20982%20L%20677%20990%20L%20689%201006%20L%20697%201009%20L%20698%201021%20L%20694%201035%20L%20703%201029%20L%20710%201018%20L%20712%201010%20L%20712%201002%20L%20710%20997%20L%20711%20992%20L%20720%201003%20L%20728%201005%20L%20730%201008%20L%20731%201021%20L%20728%201032%20L%20738%201023%20L%20742%201014%20L%20743%201003%20L%20748%20994%20L%20748%20980%20L%20742%20966%20L%20739%20963%20L%20741%20961%20L%20753%20960%20L%20770%20964%20L%20780%20971%20L%20790%20984%20L%20799%20986%20L%20802%20992%20L%20802%201005%20L%20799%201012%20L%20804%201010%20L%20809%201005%20L%20815%20993%20L%20813%20964%20L%20817%20968%20L%20823%20969%20L%20826%20972%20L%20830%20982%20L%20831%20992%20L%20834%20989%20L%20838%20975%20L%20837%20966%20L%20831%20950%20L%20821%20940%20L%20804%20934%20L%20779%20936%20L%20763%20932%20L%20731%20899%20L%20702%20865%20L%20702%20863%20L%20717%20842%20L%20718%20844%20L%20708%20862%20L%20749%20835%20L%20781%20809%20L%20820%20771%20L%20851%20733%20L%20852%20736%20L%20846%20755%20L%20857%20746%20L%20881%20720%20L%20907%20683%20L%20928%20644%20L%20945%20604%20L%20967%20537%20L%20978%20489%20L%20982%20455%20L%20982%20437%20L%20979%20413%20L%20975%20396%20L%20967%20377%20L%20968%20374%20L%20975%20382%20L%20976%20332%20L%20972%20299%20L%20962%20257%20L%20954%20235%20L%20943%20212%20L%20923%20183%20Z%20M%20624%20888%20L%20666%20870%20L%20729%20934%20L%20729%20940%20L%20726%20943%20L%20716%20944%20L%20706%20951%20L%20684%20952%20L%20677%20950%20L%20665%20940%20Z%20M%20701%20220%20L%20710%20219%20L%20717%20221%20L%20704%20223%20L%20704%20221%20Z%20M%20666%20217%20L%20679%20216%20L%20689%20218%20L%20685%20220%20L%20675%20220%20Z%20M%20658%20210%20L%20661%20208%20L%20686%20205%20L%20706%20206%20L%20725%20209%20L%20733%20217%20L%20741%20220%20L%20738%20221%20L%20696%20214%20L%20661%20212%20Z%20M%20788%20181%20L%20793%20182%20L%20797%20188%20L%20792%20195%20L%20786%20195%20L%20782%20190%20L%20783%20185%20Z'/%3e%3cpath%20fill='%23000000'%20d='M%20893%20155%20L%20864%20139%20L%20836%20130%20L%20813%20127%20L%20796%20127%20L%20774%20130%20L%20749%20138%20L%20735%20145%20L%20720%20155%20L%20702%20172%20L%20687%20173%20L%20700%20174%20L%20694%20181%20L%20674%20184%20L%20670%20180%20L%20665%20183%20L%20657%20184%20L%20639%20196%20L%20641%20198%20L%20647%20198%20L%20648%20194%20L%20654%20193%20L%20686%20204%20L%20724%20208%20L%20740%20213%20L%20751%20222%20L%20750%20223%20L%20693%20214%20L%20671%20212%20L%20639%20212%20L%20636%20211%20L%20634%20207%20L%20629%20207%20L%20626%20210%20L%20617%20210%20L%20614%20208%20L%20604%20207%20L%20594%20213%20L%20582%20216%20L%20580%20214%20L%20581%20210%20L%20576%20208%20L%20586%20200%20L%20565%20218%20L%20563%20222%20L%20618%20239%20L%20671%20251%20L%20682%20256%20L%20689%20261%20L%20702%20276%20L%20706%20288%20L%20704%20301%20L%20700%20308%20L%20683%20322%20L%20630%20348%20L%20585%20379%20L%20563%20398%20L%20523%20441%20L%20497%20475%20L%20459%20536%20L%20443%20567%20L%20431%20595%20L%20411%20626%20L%20387%20670%20L%20386%20676%20L%20390%20677%20L%20391%20679%20L%20368%20706%20L%20333%20752%20L%20290%20818%20L%20281%20837%20L%20282%20844%20L%20300%20839%20L%20324%20825%20L%20326%20826%20L%20285%20884%20L%20242%20954%20L%20207%201020%20L%20192%201060%20L%20192%201071%20L%20196%201071%20L%20211%201062%20L%20240%201039%20L%20303%20983%20L%20305%20984%20L%20277%201023%20L%20242%201078%20L%20228%201110%20L%20227%201119%20L%20231%201130%20L%20239%201134%20L%20255%201134%20L%20274%201128%20L%20280%201134%20L%20285%201136%20L%20310%201137%20L%20339%201130%20L%20374%201112%20L%20394%201097%20L%20421%201071%20L%20445%201041%20L%20463%201013%20L%20488%20994%20L%20595%20900%20L%20614%20920%20L%20639%20951%20L%20639%20958%20L%20636%20961%20L%20619%20963%20L%20613%20966%20L%20607%20972%20L%20603%20980%20L%20602%20989%20L%20603%20995%20L%20608%201003%20L%20610%20994%20L%20620%20985%20L%20623%20986%20L%20631%20983%20L%20647%20981%20L%20665%20984%20L%20676%20989%20L%20689%201006%20L%20695%201007%20L%20697%201009%20L%20698%201023%20L%20694%201035%20L%20699%201032%20L%20709%201020%20L%20712%201010%20L%20710%20997%20L%20711%20992%20L%20719%201002%20L%20725%201005%20L%20727%201004%20L%20730%201008%20L%20731%201022%20L%20728%201032%20L%20739%201021%20L%20743%201010%20L%20743%201003%20L%20748%20993%20L%20748%20981%20L%20746%20974%20L%20739%20963%20L%20741%20961%20L%20755%20960%20L%20770%20964%20L%20779%20970%20L%20789%20983%20L%20799%20986%20L%20802%20992%20L%20802%201005%20L%20799%201012%20L%20808%201006%20L%20815%20993%20L%20813%20964%20L%20817%20968%20L%20825%20970%20L%20829%20978%20L%20831%20992%20L%20837%20981%20L%20837%20966%20L%20832%20952%20L%20822%20941%20L%20813%20936%20L%20803%20934%20L%20776%20936%20L%20763%20932%20L%20723%20890%20L%20702%20865%20L%20702%20863%20L%20717%20841%20L%20719%20842%20L%20708%20862%20L%20742%20840%20L%20782%20808%20L%20818%20773%20L%20851%20733%20L%20852%20736%20L%20846%20754%20L%20850%20752%20L%20881%20720%20L%20905%20686%20L%20932%20635%20L%20950%20590%20L%20969%20529%20L%20977%20494%20L%20982%20454%20L%20980%20419%20L%20975%20396%20L%20967%20377%20L%20968%20374%20L%20975%20382%20L%20976%20334%20L%20969%20284%20L%20959%20248%20L%20941%20209%20L%20921%20181%20Z%20M%20624%20888%20L%20666%20870%20L%20729%20934%20L%20729%20941%20L%20724%20944%20L%20716%20944%20L%20707%20951%20L%20683%20952%20L%20673%20948%20L%20659%20933%20Z%20M%20563%20618%20L%20569%20614%20L%20579%20621%20L%20576%20626%20L%20572%20627%20L%20568%20623%20L%20565%20623%20Z%20M%20575%20603%20L%20578%20603%20L%20588%20613%20L%20588%20619%20L%20585%20621%20L%20582%20620%20L%20575%20613%20L%20576%20612%20L%20573%20605%20Z%20M%20748%20398%20L%20752%20412%20L%20752%20432%20L%20748%20444%20L%20732%20470%20L%20716%20484%20L%20698%20493%20L%20685%20494%20L%20682%20491%20L%20707%20445%20L%20685%20473%20L%20667%20492%20L%20647%20508%20L%20632%20517%20L%20619%20519%20L%20615%20517%20L%20615%20513%20L%20643%20470%20L%20603%20514%20L%20589%20526%20L%20569%20538%20L%20558%20540%20L%20554%20539%20L%20552%20535%20L%20577%20498%20L%20549%20528%20L%20526%20546%20L%20508%20554%20L%20498%20555%20L%20495%20552%20L%20501%20541%20L%20482%20555%20L%20471%20558%20L%20464%20558%20L%20461%20560%20L%20460%20559%20L%20461%20555%20L%20469%20547%20L%20473%20537%20L%20491%20512%20L%20511%20497%20L%20582%20434%20L%20617%20408%20L%20632%20399%20L%20659%20386%20L%20677%20380%20L%20695%20377%20L%20712%20377%20L%20725%20380%20L%20739%20388%20Z%20M%20625%20216%20L%20683%20216%20L%20737%20222%20L%20742%20224%20L%20733%20226%20L%20721%20225%20L%20713%20230%20L%20711%20228%20L%20706%20228%20L%20694%20237%20L%20690%20233%20L%20690%20225%20L%20679%20228%20L%20674%20232%20L%20668%20232%20L%20659%20229%20L%20649%20222%20L%20632%20219%20L%20632%20217%20Z%20M%20788%20181%20L%20793%20182%20L%20797%20187%20L%20795%20193%20L%20792%20195%20L%20786%20195%20L%20782%20190%20L%20783%20185%20Z'/%3e%3cpath%20fill='%23000000'%20d='M%20607%20972%20L%20603%20981%20L%20603%20995%20L%20608%201003%20L%20610%20994%20L%20616%20987%20L%20620%20985%20L%20627%20985%20L%20635%20982%20L%20655%20981%20L%20676%20989%20L%20683%20996%20L%20689%201006%20L%20695%201007%20L%20697%201009%20L%20698%201024%20L%20694%201034%20L%20699%201032%20L%20706%201025%20L%20712%201010%20L%20710%20994%20L%20709%20997%20L%20706%20994%20L%20700%20994%20L%20694%20997%20L%20672%20976%20L%20658%20974%20L%20647%20967%20L%20642%20974%20L%20638%20974%20L%20636%20972%20L%20636%20961%20L%20629%20963%20L%20631%20972%20L%20625%20977%20L%20620%20977%20L%20613%20967%20L%20614%20966%20Z%20M%20686%20966%20L%20704%20980%20L%20719%201002%20L%20727%201004%20L%20730%201007%20L%20731%201023%20L%20728%201032%20L%20731%201030%20L%20741%201017%20L%20743%201003%20L%20748%20992%20L%20748%20981%20L%20742%20967%20L%20740%20965%20L%20742%20968%20L%20735%20972%20L%20726%20965%20L%20705%20960%20L%20724%20968%20L%20740%20983%20L%20742%20987%20L%20740%20991%20L%20732%20991%20L%20728%20996%20L%20726%20996%20L%20721%20992%20L%20713%20979%20Z%20M%20784%20943%20L%20784%20946%20L%20798%20950%20L%20819%20969%20L%20825%20970%20L%20830%20981%20L%20831%20992%20L%20837%20981%20L%20837%20966%20L%20829%20948%20L%20825%20944%20L%20830%20950%20L%20821%20957%20L%20813%20951%20L%20794%20942%20Z%20M%20659%20933%20L%20662%20937%20L%20658%20942%20L%20658%20945%20L%20663%20947%20L%20666%20945%20L%20667%20946%20L%20668%20944%20L%20670%20946%20Z%20M%20643%20913%20L%20647%20918%20L%20644%20921%20L%20642%20928%20L%20629%20938%20L%20627%20936%20L%20636%20947%20L%20634%20945%20L%20641%20933%20L%20651%20923%20L%20657%20930%20Z%20M%20936%20310%20L%20934%20309%20L%20945%20338%20L%20949%20368%20L%20949%20381%20L%20947%20383%20L%20935%20367%20L%20914%20348%20L%20929%20377%20L%20934%20397%20L%20936%20414%20L%20935%20440%20L%20933%20442%20L%20930%20440%20L%20924%20419%20L%20912%20395%20L%20909%20393%20L%20910%20410%20L%20907%20433%20L%20899%20458%20L%20895%20462%20L%20893%20460%20L%20892%20445%20L%20888%20427%20L%20873%20390%20L%20873%20416%20L%20871%20430%20L%20866%20448%20L%20862%20454%20L%20859%20452%20L%20853%20433%20L%20842%20410%20L%20823%20382%20L%20807%20365%20L%20805%20366%20L%20811%20394%20L%20812%20416%20L%20810%20425%20L%20806%20428%20L%20801%20423%20L%20790%20403%20L%20772%20383%20L%20759%20372%20L%20733%20357%20L%20724%20355%20L%20705%20346%20L%20693%20344%20L%20669%20344%20L%20646%20349%20L%20636%20353%20L%20662%20349%20L%20677%20349%20L%20699%20353%20L%20708%20356%20L%20725%20366%20L%20736%20376%20L%20745%20389%20L%20753%20415%20L%20752%20442%20L%20743%20476%20L%20723%20520%20L%20693%20569%20L%20646%20631%20L%20605%20676%20L%20568%20709%20L%20565%20710%20L%20562%20706%20L%20562%20692%20L%20567%20665%20L%20578%20636%20L%20602%20619%20L%20622%20602%20L%20645%20578%20L%20670%20546%20L%20630%20588%20L%20603%20610%20L%20574%20628%20L%20560%20633%20L%20556%20633%20L%20555%20631%20L%20563%20617%20L%20596%20572%20L%20647%20509%20L%20636%20515%20L%20562%20609%20L%20541%20630%20L%20520%20645%20L%20502%20653%20L%20490%20653%20L%20536%20590%20L%20513%20617%20L%20478%20651%20L%20454%20665%20L%20440%20669%20L%20436%20667%20L%20488%20596%20L%20459%20630%20L%20436%20653%20L%20411%20671%20L%20392%20678%20L%20372%20701%20L%20319%20772%20L%20289%20820%20L%20281%20838%20L%20282%20844%20L%20295%20841%20L%20324%20825%20L%20326%20826%20L%20289%20878%20L%20242%20954%20L%20209%201016%20L%20193%201056%20L%20191%201069%20L%20192%201071%20L%20196%201071%20L%20219%201056%20L%20303%20983%20L%20305%20984%20L%20255%201057%20L%20234%201094%20L%20228%201111%20L%20228%201124%20L%20234%201132%20L%20240%201134%20L%20254%201134%20L%20275%201128%20L%20279%201133%20L%20291%201137%20L%20316%201136%20L%20344%201128%20L%20364%201118%20L%20389%201101%20L%20403%201089%20L%20427%201064%20L%20447%201038%20L%20463%201013%20L%20489%20993%20L%20594%20901%20L%20595%20899%20L%20593%20894%20L%20588%20891%20L%20567%20868%20L%20569%20865%20L%20576%20867%20L%20586%20873%20L%20589%20867%20L%20607%20867%20L%20619%20880%20L%20622%20887%20L%20626%20891%20L%20624%20889%20L%20626%20886%20L%20666%20870%20L%20705%20909%20L%20710%20905%20L%20713%20905%20L%20716%20908%20L%20716%20911%20L%20712%20916%20L%20728%20932%20L%20730%20939%20L%20727%20943%20L%20717%20944%20L%20710%20949%20L%20712%20948%20L%20725%20951%20L%20739%20963%20L%20740%20961%20L%20756%20960%20L%20774%20966%20L%20784%20975%20L%20789%20983%20L%20800%20987%20L%20802%20991%20L%20802%201005%20L%20799%201012%20L%20806%201008%20L%20811%201002%20L%20815%20993%20L%20813%20968%20L%20812%20973%20L%20807%20971%20L%20796%20976%20L%20791%20973%20L%20788%20967%20L%20779%20958%20L%20767%20952%20L%20762%20941%20L%20756%20940%20L%20751%20932%20L%20749%20931%20L%20743%20936%20L%20738%20936%20L%20736%20933%20L%20741%20925%20L%20739%20915%20L%20742%20912%20L%20745%20914%20L%20702%20865%20L%20702%20863%20L%20717%20841%20L%20719%20842%20L%20709%20861%20L%20746%20837%20L%20783%20807%20L%20826%20764%20L%20851%20732%20L%20853%20734%20L%20846%20754%20L%20851%20751%20L%20874%20728%20L%20890%20708%20L%20908%20681%20L%20938%20621%20L%20960%20560%20L%20971%20521%20L%20979%20481%20L%20982%20444%20L%20977%20405%20L%20970%20382%20L%20966%20375%20L%20968%20374%20L%20974%20381%20L%20975%20368%20L%20974%20372%20L%20968%20364%20L%20966%20354%20L%20957%20337%20Z%20M%20247%201077%20L%20251%201085%20L%20246%201088%20L%20245%201091%20L%20240%201092%20L%20239%201085%20L%20241%201081%20Z%20M%20370%20935%20L%20371%20937%20L%20326%20997%20L%20301%201034%20L%20289%201044%20L%20286%201042%20L%20283%201045%20L%20277%201045%20L%20273%201043%20L%20264%201052%20L%20261%201049%20L%20270%201037%20L%20271%201038%20L%20281%201027%20L%20293%201010%20L%20326%20971%20Z%20M%20726%20921%20L%20728%20921%20L%20731%20926%20L%20729%20933%20L%20722%20926%20Z%20M%20729%20897%20L%20734%20902%20L%20732%20906%20L%20726%20902%20L%20726%20899%20Z%20M%20715%20882%20L%20720%20886%20L%20718%20890%20L%20711%20887%20Z%20M%20605%20762%20L%20608%20761%20L%20607%20760%20L%20609%20757%20L%20610%20759%20L%20617%20761%20L%20620%20764%20L%20611%20770%20L%20607%20770%20L%20606%20765%20L%20608%20765%20Z%20M%20611%20754%20L%20617%20750%20L%20620%20751%20L%20621%20749%20L%20625%20749%20L%20628%20752%20L%20628%20756%20L%20623%20761%20Z%20M%20549%20710%20L%20551%20713%20L%20551%20722%20L%20506%20774%20L%20403%20878%20L%20309%20963%20L%20307%20961%20L%20313%20953%20L%20322%20945%20L%20340%20922%20L%20375%20885%20Z%20M%20695%20704%20L%20696%20708%20L%20698%20709%20L%20695%20710%20L%20695%20713%20L%20692%20715%20L%20688%20710%20Z%20M%20704%20694%20L%20706%20695%20L%20706%20698%20L%20710%20698%20L%20713%20703%20L%20708%20708%20L%20707%20714%20L%20705%20716%20L%20701%20716%20L%20697%20708%20L%20699%20706%20L%20697%20705%20L%20701%20701%20L%20704%20705%20L%20706%20704%20L%20706%20700%20L%20702%20697%20Z%20M%20552%20678%20L%20554%20681%20L%20552%20701%20L%20465%20787%20L%20361%20883%20L%20316%20927%20L%20253%20993%20L%20211%201042%20L%20211%201036%20L%20222%201011%20L%20261%20942%20L%20292%20898%20L%20338%20843%20L%20374%20807%20L%20387%20807%20L%20403%20801%20L%20419%20792%20L%20456%20766%20L%20500%20728%20Z%20M%20704%20654%20L%20706%20658%20L%20711%20658%20L%20714%20661%20L%20715%20673%20L%20713%20676%20L%20705%20676%20L%20702%20674%20L%20704%20677%20L%20704%20681%20L%20702%20682%20L%20704%20685%20L%20700%20686%20L%20694%20678%20L%20691%20678%20L%20688%20674%20L%20692%20670%20L%20692%20664%20L%20694%20661%20Z%20M%20565%20642%20L%20558%20663%20L%20545%20677%20L%20494%20726%20L%20443%20767%20L%20401%20792%20L%20392%20795%20L%20387%20794%20L%20405%20766%20L%20455%20707%20L%20388%20767%20L%20355%20794%20L%20304%20827%20L%20299%20826%20L%20302%20817%20L%20316%20795%20L%20360%20739%20L%20398%20700%20L%20425%20677%20L%20428%20679%20L%20443%20679%20L%20461%20673%20L%20476%20664%20L%20493%20666%20L%20517%20657%20L%20542%20641%20L%20546%20643%20Z%20M%20563%20221%20L%20572%20225%20L%20571%20223%20L%20574%20220%20L%20585%20217%20L%20596%20218%20L%20607%20215%20L%20653%20214%20L%20706%20218%20L%20749%20224%20L%20749%20226%20L%20735%20233%20L%20732%20238%20L%20732%20249%20L%20693%20242%20L%20620%20239%20L%20672%20251%20L%20688%20260%20L%20701%20274%20L%20706%20287%20L%20704%20301%20L%20707%20297%20L%20711%20300%20L%20713%20309%20L%20720%20324%20L%20723%20327%20L%20724%20308%20L%20726%20304%20L%20735%20318%20L%20757%20341%20L%20753%20319%20L%20754%20313%20L%20760%20317%20L%20786%20345%20L%20784%20324%20L%20775%20300%20L%20779%20300%20L%20800%20317%20L%20800%20312%20L%20787%20283%20L%20772%20264%20L%20778%20263%20L%20800%20271%20L%20803%20270%20L%20770%20236%20L%20772%20234%20L%20797%20234%20L%20807%20230%20L%20801%20230%20L%20800%20228%20L%20811%20218%20L%20818%20203%20L%20818%20193%20L%20812%20179%20L%20798%20168%20L%20784%20166%20L%20760%20173%20L%20747%20173%20L%20712%20163%20L%20718%20157%20L%20703%20171%20L%20711%20173%20L%20720%20178%20L%20723%20182%20L%20720%20186%20L%20695%20190%20L%20680%20190%20L%20670%20193%20L%20656%20193%20L%20687%20204%20L%20729%20209%20L%20742%20214%20L%20753%20223%20L%20752%20224%20L%20729%20219%20L%20669%20212%20L%20610%20213%20L%20576%20218%20L%20565%20221%20L%20565%20219%20Z%20M%20771%20189%20L%20772%20201%20L%20775%20207%20L%20780%20212%20L%20787%20215%20L%20796%20216%20L%20796%20218%20L%20784%20219%20L%20776%20215%20L%20771%20210%20L%20768%20204%20L%20768%20194%20Z%20M%20788%20181%20L%20793%20182%20L%20797%20187%20L%20796%20192%20L%20790%20196%20L%20786%20195%20L%20782%20191%20L%20782%20186%20Z'/%3e%3c/g%3e%3c/svg%3e";function Wi({className:c}){return o.jsx("span",{className:`block overflow-hidden rounded-[20.7%] bg-accent ${c??""}`,children:o.jsx("img",{src:zd,alt:"","aria-hidden":"true",className:"h-full w-full"})})}function Md({maximized:c}){return o.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",focusable:"false",className:"h-4 w-4",children:c?o.jsxs(o.Fragment,{children:[o.jsx("path",{d:"M8 3v3a2 2 0 0 1-2 2H3"}),o.jsx("path",{d:"M21 8h-3a2 2 0 0 1-2-2V3"}),o.jsx("path",{d:"M3 16h3a2 2 0 0 1 2 2v3"}),o.jsx("path",{d:"M16 21v-3a2 2 0 0 1 2-2h3"})]}):o.jsxs(o.Fragment,{children:[o.jsx("path",{d:"M8 3H5a2 2 0 0 0-2 2v3"}),o.jsx("path",{d:"M21 8V5a2 2 0 0 0-2-2h-3"}),o.jsx("path",{d:"M3 16v3a2 2 0 0 0 2 2h3"}),o.jsx("path",{d:"M16 21h3a2 2 0 0 0 2-2v-3"})]})})}function Er({open:c}){return o.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",focusable:"false",className:`h-3.5 w-3.5 shrink-0 transition-transform ${c?"rotate-90":""}`,children:o.jsx("path",{d:"m9 18 6-6-6-6"})})}function vn({className:c="h-4 w-4"}){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",focusable:"false",className:`shrink-0 ${c}`,children:[o.jsx("path",{d:"M18 6 6 18"}),o.jsx("path",{d:"m6 6 12 12"})]})}function Tr({className:c="h-4 w-4"}){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",focusable:"false",className:`shrink-0 ${c}`,children:[o.jsx("path",{d:"M5 12h14"}),o.jsx("path",{d:"M12 5v14"})]})}function _d(){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",focusable:"false",className:"h-4 w-4",children:[o.jsx("rect",{width:"18",height:"18",x:"3",y:"3",rx:"2"}),o.jsx("path",{d:"M12 3v18"})]})}function Ad(){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",focusable:"false",className:"h-4 w-4",children:[o.jsx("path",{d:"M2 12s3.5-7 10-7 10 7 10 7-3.5 7-10 7-10-7-10-7Z"}),o.jsx("circle",{cx:"12",cy:"12",r:"3"})]})}function Nd(){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",focusable:"false",className:"h-4 w-4",children:[o.jsx("circle",{cx:"11",cy:"11",r:"8"}),o.jsx("path",{d:"m21 21-4.3-4.3"})]})}function jd({className:c="h-4 w-4"}){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",focusable:"false",className:`shrink-0 ${c}`,children:[o.jsx("path",{d:"M3 6h.01"}),o.jsx("path",{d:"M3 12h.01"}),o.jsx("path",{d:"M3 18h.01"}),o.jsx("path",{d:"M8 6h13"}),o.jsx("path",{d:"M8 12h13"}),o.jsx("path",{d:"M8 18h13"})]})}function Od({className:c="h-4 w-4"}){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",focusable:"false",className:`shrink-0 ${c}`,children:[o.jsx("path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z"}),o.jsx("path",{d:"M14 2v4a2 2 0 0 0 2 2h4"}),o.jsx("path",{d:"M10 9H8"}),o.jsx("path",{d:"M16 13H8"}),o.jsx("path",{d:"M16 17H8"})]})}function Dd({className:c="h-4 w-4"}){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",focusable:"false",className:`shrink-0 ${c}`,children:[o.jsx("path",{d:"m4 17 6-6-6-6"}),o.jsx("path",{d:"M12 19h8"})]})}function Cd({repos:c,currentId:r,onSelect:h,onCloseProject:s,onOpenPicker:x,className:g=""}){const[T,C]=A.useState(!1),M=A.useRef(null),v=c.find(U=>U.id===r);return A.useEffect(()=>{if(!T)return;const U=j=>{j.key==="Escape"&&(C(!1),M.current?.focus())};return document.addEventListener("keydown",U),()=>document.removeEventListener("keydown",U)},[T]),o.jsxs("div",{className:`relative ${g}`,children:[o.jsxs("button",{ref:M,onClick:()=>C(U=>!U),"aria-haspopup":"menu","aria-expanded":T,title:v?.display_path??"Select a project",className:"flex max-w-[9rem] items-center gap-1 rounded-sm bg-ink-700 py-0.5 pl-2 pr-1 text-ink-50",children:[o.jsx("span",{className:"truncate",children:v?.name??"No project"}),o.jsx(Er,{open:T})]}),T&&o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"fixed inset-0 z-40",onClick:()=>C(!1)}),o.jsxs("div",{role:"menu",className:"absolute left-0 z-50 mt-1 max-h-[70vh] w-56 max-w-[80vw] overflow-y-auto rounded-md border border-ink-700 bg-ink-900 py-1 shadow-lg",children:[c.length===0&&o.jsx("p",{className:"px-3 py-1.5 text-ink-400",children:"No projects open."}),c.map(U=>o.jsxs("div",{className:`flex items-center ${U.id===r?"bg-ink-700 text-ink-50":"text-ink-200"}`,children:[o.jsx("button",{role:"menuitem",onClick:()=>{h(U.id),C(!1)},title:U.display_path,className:"min-w-0 flex-1 truncate py-1.5 pl-3 pr-1 text-left hover:text-accent",children:U.name}),o.jsx("button",{onClick:()=>s(U.id),"aria-label":`close ${U.name}`,title:"Close project",className:"mr-1 flex h-6 w-6 shrink-0 items-center justify-center rounded-sm text-ink-400 hover:text-removed",children:o.jsx(vn,{className:"h-3.5 w-3.5"})})]},U.id)),o.jsx("div",{className:"my-1 border-t border-ink-800"}),o.jsxs("button",{role:"menuitem",onClick:()=>{x(),C(!1)},className:"flex w-full items-center gap-1 px-3 py-1.5 text-left text-ink-400 hover:text-ink-200",children:[o.jsx(Tr,{className:"h-3.5 w-3.5"}),"open"]})]})]})]})}function Ud({repos:c,repo:r,setRepo:h,setPane:s,closeRepo:x,setPickerOpen:g,accent:T,next:C,cycle:M,draggingRepo:v,dragOverRepo:U,onRepoDragStart:j,onRepoDragMove:R,onRepoDragEnd:H}){return o.jsxs("header",{className:"flex items-center gap-2 border-b border-ink-700 bg-ink-900 px-[12.8px] py-[8.8px]",children:[o.jsx(Wi,{className:"h-[22px] w-[22px] shrink-0"}),o.jsx("span",{className:"text-[16px] font-medium tracking-[0.04em] text-ink-50",children:"nightcrow"}),o.jsx("span",{className:"hidden font-sans text-[10px] uppercase tracking-[0.18em] text-ink-400 sm:inline",children:"web viewer"}),o.jsx(Cd,{className:"md:hidden",repos:c,currentId:r,onSelect:Y=>{h(Y),s()},onCloseProject:x,onOpenPicker:()=>g(!0)}),o.jsx("nav",{className:"-my-[8.8px] hidden items-stretch self-stretch overflow-x-auto pl-1 md:flex",children:c.map(Y=>o.jsxs("div",{"data-repo-id":Y.id,onPointerDown:J=>j(J,Y.id),onPointerMove:R,onPointerUp:H,onPointerCancel:H,onLostPointerCapture:H,className:`flex items-center border-r border-ink-700 whitespace-nowrap ${c.length>1?"touch-none":""} ${v===Y.id?"opacity-60":""} ${U===Y.id?"bg-ink-800 ring-1 ring-inset ring-accent":""} ${Y.id===r?"bg-ink-950 text-ink-50 shadow-[inset_0_2px_0_0_var(--color-accent)]":"text-ink-400 hover:bg-ink-850 hover:text-ink-200"}`,title:Y.display_path,children:[o.jsx("button",{onClick:()=>{h(Y.id),s()},className:"self-stretch pl-3 pr-1",children:Y.name}),o.jsx("button",{onClick:J=>{J.stopPropagation(),x(Y.id)},"data-tab-close":!0,title:"Close project","aria-label":`close ${Y.name}`,className:"mr-1 flex h-5 w-5 items-center justify-center rounded-sm text-ink-400 hover:bg-ink-700 hover:text-removed",children:o.jsx(vn,{className:"h-3.5 w-3.5"})})]},Y.id))}),o.jsxs("button",{onClick:()=>g(!0),title:"Open a project",className:"hidden shrink-0 items-center gap-1 rounded-sm px-2 py-0.5 text-ink-400 hover:text-ink-200 md:inline-flex",children:[o.jsx(Tr,{className:"h-3.5 w-3.5"}),"open"]}),o.jsx("button",{onClick:M,title:`Accent: ${T.name} (click for ${C.name})`,"aria-label":`accent colour: ${T.name}, click for ${C.name}`,className:"ml-auto flex h-6 w-6 shrink-0 items-center justify-center rounded-sm",children:o.jsx("span",{"aria-hidden":"true",className:"h-3 w-3 rounded-full bg-accent ring-1 ring-ink-600"})}),o.jsx("a",{href:"/logout",className:"pl-2 text-ink-400 hover:text-ink-200",children:"sign out"})]})}const Hd="modulepreload",Rd=function(c,r){return new URL(c,r).href},fr={},zr=function(r,h,s){let x=Promise.resolve();if(h&&h.length>0){let v=function(U){return Promise.all(U.map(j=>Promise.resolve(j).then(R=>({status:"fulfilled",value:R}),R=>({status:"rejected",reason:R}))))};const T=document.getElementsByTagName("link"),C=document.querySelector("meta[property=csp-nonce]"),M=C?.nonce||C?.getAttribute("nonce");x=v(h.map(U=>{if(U=Rd(U,s),U in fr)return;fr[U]=!0;const j=U.endsWith(".css"),R=j?'[rel="stylesheet"]':"";if(s)for(let Y=T.length-1;Y>=0;Y--){const J=T[Y];if(J.href===U&&(!j||J.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${U}"]${R}`))return;const H=document.createElement("link");if(H.rel=j?"stylesheet":Hd,j||(H.as="script"),H.crossOrigin="",H.href=U,M&&H.setAttribute("nonce",M),document.head.appendChild(H),j)return new Promise((Y,J)=>{H.addEventListener("load",Y),H.addEventListener("error",()=>J(new Error(`Unable to preload CSS for ${U}`)))})}))}function g(T){const C=new Event("vite:preloadError",{cancelable:!0});if(C.payload=T,window.dispatchEvent(C),!C.defaultPrevented)throw T}return x.then(T=>{for(const C of T||[])C.status==="rejected"&&g(C.reason);return r().catch(g)})},Bd=180;function qd({repo:c,authed:r,tab:h,filter:s,filterOpen:x,handle:g}){const[T,C]=A.useState({}),[M,v]=A.useState(new Set),[U,j]=A.useState([]),[R,H]=A.useState(!1),[Y,J]=A.useState(!1);A.useEffect(()=>{!c||!r||h!=="tree"||B0.tree(c,"").then(Z=>C(F=>({...F,"":Z.entries}))).catch(g)},[c,r,h,g]),A.useEffect(()=>{if(!c||!r||h!=="tree"||!x||!s){j([]),H(!1),J(!1);return}J(!0);let Z=!0;const F=setTimeout(()=>{B0.treeSearch(c,s).then(m0=>{Z&&(j(m0.matches),H(m0.truncated))}).catch(m0=>{Z&&g(m0)}).finally(()=>{Z&&J(!1)})},Bd);return()=>{Z=!1,clearTimeout(F)}},[c,r,h,s,x,g]);const $=A.useCallback(Z=>{c&&B0.tree(c,Z).then(F=>C(m0=>({...m0,[Z]:F.entries}))).catch(g)},[c,g]),e0=A.useCallback(Z=>{const F=!M.has(Z);v(m0=>{const I=new Set(m0);return I.has(Z)?I.delete(Z):I.add(Z),I}),F&&!(Z in T)&&$(Z)},[M,T,$]),t0=A.useCallback(Z=>{const F=Z.split("/"),m0=[];let I="";for(const Q of F)I=I?`${I}/${Q}`:Q,m0.push(I);v(Q=>{const i0=new Set(Q);return m0.forEach(z0=>i0.add(z0)),i0}),m0.forEach(Q=>{Q in T||$(Q)})},[T,$]);return{treeChildren:T,setTreeChildren:C,treeExpanded:M,setTreeExpanded:v,treeMatches:U,treeTruncated:R,treeSearchLoading:Y,loadTreeChildren:$,toggleTreeDir:e0,revealTreeDir:t0}}function Yd(c,r){const h=[],s=(x,g)=>{for(const T of c[x]??[]){const C=x?`${x}/${T.name}`:T.name;h.push({path:C,name:T.name,is_dir:T.is_dir,depth:g}),T.is_dir&&r.has(C)&&s(C,g+1)}};return s("",0),h}function Fi({path:c,from:r,className:h}){return o.jsx("span",{className:`whitespace-nowrap ${h??""}`,title:r?`${r} → ${c}`:c,children:r?`${r} → ${c}`:c})}function Zd(c){const r=Math.max(0,Math.floor(Date.now()/1e3-c));return r<60?`${r}s`:r<3600?`${Math.floor(r/60)}m`:r<86400?`${Math.floor(r/3600)}h`:r<86400*30?`${Math.floor(r/86400)}d`:r<86400*365?`${Math.floor(r/(86400*30))}mo`:`${Math.floor(r/(86400*365))}y`}function Mr(c){return c==="+"?"bg-added/10":c==="-"?"bg-removed/10":""}function Ji(c){return c==="?"?"text-ink-400":c==="D"?"text-removed":c==="A"?"text-added":"text-accent"}function Xd({status:c,files:r,now:h,hotWindowMs:s,openDiff:x}){return c===null?o.jsx("li",{className:"px-3 py-2 text-ink-400",children:"Loading…"}):o.jsx(o.Fragment,{children:r.map(g=>o.jsx("li",{children:o.jsxs("button",{onClick:()=>x(g.path),className:"flex w-max min-w-full gap-2 px-3 py-0.5 text-left hover:bg-ink-850",children:[o.jsxs("span",{className:"shrink-0",children:[o.jsx("span",{className:Ji(g.index),children:g.index===" "?" ":g.index}),o.jsx("span",{className:Ji(g.worktree),children:g.worktree===" "?" ":g.worktree})]}),o.jsx(Fi,{path:g.path,from:g.old_path,className:rd[pr(g.mtime,h,s)]})]})},g.path))})}function Gd({visibleCommits:c,commits:r,aheadOids:h,commitDrillDown:s,visibleCommitFiles:x,logDone:g,logStalled:T,logPagingPaused:C,setLogStalled:M,logSentinelRef:v,openCommitFiles:U,openCommit:j,openCommitFileDiff:R,setCommitDrillDown:H,setPaneEmpty:Y,bumpPaneRequest:J}){return o.jsxs(o.Fragment,{children:[!s&&c.map($=>o.jsx("li",{children:o.jsxs("button",{onClick:()=>{U($)},title:`${$.author} · ${$.summary}`,className:"flex w-max min-w-full items-baseline gap-2 px-3 py-0.5 text-left hover:bg-ink-850",children:[o.jsx("span",{className:"w-2 shrink-0 text-added",children:h.has($.oid)?"↑":""}),o.jsx("span",{className:"shrink-0 text-accent",children:$.short_id}),o.jsx("span",{className:"w-10 shrink-0 text-right text-ink-400",children:Zd($.time)}),o.jsx("span",{className:"max-w-[6rem] shrink-0 truncate text-ink-400",children:$.author}),o.jsx("span",{className:"whitespace-nowrap",children:$.summary})]})},$.oid)),!s&&!g&&!T&&!C&&o.jsx("li",{ref:v,className:"px-3 py-1 text-ink-400","aria-hidden":"true",children:"loading…"}),!s&&!g&&!T&&C&&o.jsxs("li",{className:"px-3 py-1 text-ink-400",children:["filtering ",r.length," loaded commits — clear the filter to load more"]}),!s&&T&&o.jsx("li",{className:"px-3 py-1",children:o.jsx("button",{onClick:()=>M(!1),className:"text-ink-400 hover:text-accent",children:"could not load more — retry"})}),s&&o.jsxs(o.Fragment,{children:[o.jsxs("li",{className:"sticky top-0 z-10 flex w-max min-w-full items-center gap-1 bg-ink-900 px-2 py-1 text-ink-400",children:[o.jsx("button",{onClick:()=>{J(),H(null),Y()},className:"rounded-sm px-1 hover:text-accent",title:"Back to commit log",children:"< log"}),o.jsx("span",{className:"text-ink-600",children:"·"}),o.jsx("span",{className:"shrink-0 text-accent",children:s.commit.short_id}),o.jsx("button",{onClick:()=>j(s.commit.oid),className:"rounded-sm px-1 hover:text-accent",title:"Show the complete commit diff",children:"all changes"})]}),x.map($=>o.jsx("li",{children:o.jsxs("button",{onClick:()=>R(s.commit.oid,$.path),className:"flex w-max min-w-full gap-2 px-3 py-0.5 text-left hover:bg-ink-850",children:[o.jsx("span",{className:Ji($.index),children:$.index}),o.jsx(Fi,{path:$.path,from:$.old_path})]})},$.path)),s.files.length===0&&o.jsx("li",{className:"px-3 py-2 text-ink-400",children:"No changed files."}),s.files.length>0&&x.length===0&&o.jsx("li",{className:"px-3 py-2 text-ink-400",children:"No matching files."}),s.truncated&&o.jsxs("li",{className:"px-3 py-1 text-accent",children:["Showing the first ",s.files.length," files."]})]})]})}function Qd({treeSearching:c,treeMatches:r,treeTruncated:h,treeSearchLoading:s,treeRows:x,treeExpanded:g,openFile:T,revealTreeDir:C,toggleTreeDir:M}){return c?o.jsxs(o.Fragment,{children:[r.map(v=>o.jsx("li",{children:o.jsx("button",{onClick:()=>{v.is_dir?C(v.path):T(v.path)},title:v.path,className:"w-max min-w-full whitespace-nowrap px-3 py-0.5 text-left hover:bg-ink-850",children:v.is_dir?o.jsxs("span",{className:"text-accent",children:[v.path,"/"]}):v.path})},v.path)),r.length===0&&o.jsx("li",{className:"px-3 py-0.5 text-ink-400",children:s?"searching…":"no matches"}),h&&o.jsxs("li",{className:"px-3 py-0.5 text-ink-400",children:["showing the first ",r.length," matches"]})]}):o.jsx(o.Fragment,{children:x.map(v=>o.jsx("li",{children:o.jsxs("button",{onClick:()=>v.is_dir?M(v.path):T(v.path),title:v.path,style:{paddingLeft:`${v.depth*.75+.5}rem`},className:"flex w-max min-w-full items-center gap-1 py-0.5 pr-3 text-left hover:bg-ink-850",children:[v.is_dir?o.jsx(Er,{open:g.has(v.path)}):o.jsx("span",{className:"h-3.5 w-3.5 shrink-0"}),o.jsx("span",{className:`whitespace-nowrap ${v.is_dir?"text-accent":""}`,children:v.is_dir?`${v.name}/`:v.name})]})},v.path))})}function kd(c){const{tab:r,setTab:h,filter:s,setFilter:x,filterOpen:g,setFilterOpen:T,status:C,files:M,now:v,hotWindowMs:U,setPane:j,openDiff:R,openFile:H,openCommit:Y,openCommitFileDiff:J,openCommitFiles:$,repo:e0,authed:t0,handle:Z,sidebarRef:F,draggingSidebar:m0,onSidebarDragStart:I,onSidebarDragMove:Q,onSidebarDragEnd:i0,onSidebarDragCancel:z0,filesMax:J0,bumpPaneRequest:D0,commits:j0,logDone:w0,logStalled:M0,setLogStalled:q0,commitDrillDown:z,setCommitDrillDown:q,resetLog:w,logSentinelRef:c0,visibleCommits:n0,logPagingPaused:d,aheadOids:N,visibleCommitFiles:B,mobileView:X}=c,V=qd({repo:e0,authed:t0,tab:r,filter:s,filterOpen:g,handle:Z}),l0=r==="tree"&&g&&s!=="",r0=Yd(V.treeChildren,V.treeExpanded);return o.jsxs("section",{ref:F,className:`relative min-h-0 flex-col overflow-hidden ${X==="files"?"flex":"hidden md:flex"} ${J0?"md:flex":"border-ink-700 md:border-r"}`,children:[!J0&&o.jsx("div",{role:"separator","aria-orientation":"vertical","aria-label":"Resize the file sidebar (double-click to reset)",title:"Drag to resize · double-click to reset",onPointerDown:I,onPointerMove:Q,onPointerUp:i0,onPointerCancel:z0,onLostPointerCapture:i0,className:`absolute -right-px top-0 z-10 hidden h-full w-1.5 cursor-col-resize touch-none md:block ${m0?"bg-accent":"hover:bg-accent"}`}),o.jsxs("div",{className:"flex shrink-0 items-stretch border-b border-ink-700 px-2",children:[["status","log","tree"].map(g0=>o.jsx("button",{onClick:()=>{g0!==r&&(D0(),r==="log"&&(q(null),w()),h(g0),j({kind:"empty"}))},"aria-current":g0===r?"page":void 0,className:`-mb-px border-b-2 px-2 py-1 ${g0===r?"border-accent text-ink-50":"border-transparent text-ink-400 hover:text-ink-200"}`,children:g0},g0)),o.jsx("button",{onClick:()=>{g&&x(""),T(g0=>!g0)},"aria-pressed":g,title:g?"Hide the filter":"Filter the list","aria-label":g?"Hide the filter":"Filter the list",className:`my-1 ml-auto flex shrink-0 items-center rounded-sm px-1.5 hover:text-accent ${g?"text-ink-50":"text-ink-400"}`,children:o.jsx(Nd,{})})]}),g&&o.jsx("input",{value:s,onChange:g0=>x(g0.target.value),placeholder:"filter…",autoFocus:!0,className:"mx-2 mb-1 shrink-0 rounded-sm bg-ink-850 px-2 py-1 outline-none placeholder:text-ink-400 focus:ring-1 focus:ring-accent"}),o.jsxs("ul",{className:"min-h-0 flex-1 overflow-auto",children:[r==="status"&&o.jsx(Xd,{status:C,files:M,now:v,hotWindowMs:U,openDiff:R}),r==="log"&&o.jsx(Gd,{visibleCommits:n0,commits:j0,aheadOids:N,commitDrillDown:z,visibleCommitFiles:B,logDone:w0,logStalled:M0,logPagingPaused:d,setLogStalled:q0,logSentinelRef:c0,openCommitFiles:$,openCommit:Y,openCommitFileDiff:J,setCommitDrillDown:q,setPaneEmpty:()=>j({kind:"empty"}),bumpPaneRequest:D0}),r==="tree"&&o.jsx(Qd,{treeSearching:l0,treeMatches:V.treeMatches,treeTruncated:V.treeTruncated,treeSearchLoading:V.treeSearchLoading,treeRows:r0,treeExpanded:V.treeExpanded,openFile:H,revealTreeDir:V.revealTreeDir,toggleTreeDir:V.toggleTreeDir})]})]})}const _r="nightcrow.viewer.diffLayout",Ar=768;function wd(c){const r=[];let h=[],s=[];const x=()=>{const g=Math.max(h.length,s.length);for(let T=0;T{let h;try{h=window.matchMedia(`(min-width: ${Ar}px)`)}catch{return}const s=x=>r(x.matches);return h.addEventListener("change",s),()=>h.removeEventListener("change",s)},[]),c}function Wd(){const[c,r]=A.useState(Vd),h=$d(),s=A.useCallback(()=>{r(g=>{const T=g==="split"?"unified":"split";return Kd(T),T})},[]);return{layout:c,effective:c==="split"&&h?"split":"unified",toggle:s}}const Fd=[".md",".markdown"];function sr(c){const r=c.toLowerCase();return Fd.some(h=>r.endsWith(h))}function Id(c){return c.map(r=>r.map(h=>h.t).join("")).join(` -`)}function Nr({line:c}){return o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"text-ink-400 select-none",children:c.kind}),c.spans.map((r,h)=>o.jsx("span",{style:{color:r.c},children:r.t},h))]})}function Pd({line:c}){return c===null?o.jsx("div",{className:"whitespace-pre bg-ink-900/40 px-3",children:" "}):o.jsx("div",{className:`whitespace-pre px-3 ${Mr(c.kind)}`,children:o.jsx(Nr,{line:c})})}function rr({cells:c,border:r}){const h=r?"border-l border-ink-800":"";return o.jsx("div",{className:`min-w-0 flex-1 basis-1/2 overflow-x-auto ${h}`,children:o.jsx("div",{className:"w-max min-w-full",children:c.map((s,x)=>o.jsx(Pd,{line:s},x))})})}function t3({lines:c}){const r=wd(c);return o.jsxs("div",{className:"flex",children:[o.jsx(rr,{cells:r.map(h=>h.left),border:!1}),o.jsx(rr,{cells:r.map(h=>h.right),border:!0})]})}function l3({diff:c,split:r}){return o.jsxs("div",{className:"p-1",children:[c.hunks.length===0&&o.jsx("p",{className:"p-3 text-ink-400",children:"No changes."}),c.hunks.map((h,s)=>o.jsxs("div",{className:"mb-2",children:[o.jsxs("div",{className:"bg-ink-850 px-3 py-0.5 text-ink-400",children:[h.file_path?`${h.file_path} `:"",h.header]}),r?o.jsx(t3,{lines:h.lines}):h.lines.map((x,g)=>o.jsx("div",{className:`px-3 whitespace-pre ${Mr(x.kind)}`,children:o.jsx(Nr,{line:x})},g))]},s)),c.truncated&&o.jsx("p",{className:"p-3 text-accent",children:"Diff truncated — it exceeded the server's size ceiling."})]})}const e3=A.lazy(()=>zr(()=>import("./Markdown-Dc2pdrht.js"),__vite__mapDeps([0,1]),import.meta.url).then(c=>({default:c.MarkdownView})));function a3({pane:c,mdRendered:r,setMdRendered:h,filesMax:s,setMaximized:x,status:g,className:T=""}){const C=Wd();return o.jsxs("section",{className:`min-h-0 min-w-0 flex-col ${T}`,children:[o.jsxs("div",{className:"flex shrink-0 items-center gap-2 bg-ink-850 px-3 py-0.5 text-ink-400",children:[c.kind==="file"&&o.jsx(Fi,{path:c.value.path}),o.jsxs("div",{className:"ml-auto flex shrink-0 items-center gap-1",children:[c.kind==="diff"&&o.jsx("button",{onClick:C.toggle,"aria-pressed":C.layout==="split",title:C.layout==="split"?"Switch to unified diff":"Switch to split diff","aria-label":C.layout==="split"?"Switch to unified diff":"Switch to split diff",className:`flex shrink-0 items-center rounded-sm px-1.5 py-0.5 hover:text-accent ${C.layout==="split"?"text-accent":""}`,children:o.jsx(_d,{})}),c.kind==="file"&&sr(c.value.path)&&o.jsx("button",{onClick:()=>h(M=>!M),"aria-pressed":r,title:r?"Show raw source":"Show rendered markdown","aria-label":r?"Show raw source":"Show rendered markdown",className:`flex shrink-0 items-center rounded-sm px-1.5 py-0.5 hover:text-accent ${r?"text-accent":""}`,children:o.jsx(Ad,{})}),o.jsx("button",{onClick:()=>x(s?"none":"files"),"aria-pressed":s,title:s?"Restore the layout":"Maximize the file pane","aria-label":s?"Restore the layout":"Maximize the file pane",className:"hidden shrink-0 items-center rounded-sm px-1.5 py-0.5 hover:text-accent md:flex",children:o.jsx(Md,{maximized:s})})]})]}),o.jsxs("div",{className:"min-h-0 flex-1 overflow-auto",children:[c.kind==="empty"&&o.jsx("p",{className:"p-4 text-ink-400",children:g===null?"Loading…":"Select a file or commit."}),c.kind==="file"&&o.jsxs(o.Fragment,{children:[sr(c.value.path)&&r?o.jsx(A.Suspense,{fallback:o.jsx("p",{className:"p-4 text-ink-400",children:"Rendering…"}),children:o.jsx(e3,{source:Id(c.value.lines)})}):o.jsx("pre",{className:"p-3 whitespace-pre text-ink-200",children:c.value.lines.map((M,v)=>o.jsx("div",{children:M.length===0?" ":M.map((U,j)=>o.jsx("span",{style:{color:U.c},children:U.t},j))},v))}),c.value.truncated&&o.jsx("p",{className:"p-3 text-accent",children:"File truncated — it exceeded the server's size ceiling."})]}),c.kind==="diff"&&o.jsx(l3,{diff:c.value,split:C.effective==="split"})]})]})}const n3=A.lazy(()=>zr(()=>import("./Terminal-ewaHgc2M.js"),[],import.meta.url).then(c=>({default:c.TerminalPanel})));function u3(c){const{repo:r,current:h,status:s,files:x,now:g,hotWindowMs:T,pane:C,setPane:M,tab:v,setTab:U,filter:j,setFilter:R,filterOpen:H,setFilterOpen:Y,openDiff:J,openFile:$,openCommit:e0,openCommitFileDiff:t0,openCommitFiles:Z,authed:F,handle:m0,sidebarWidth:I,sidebarRef:Q,draggingSidebar:i0,onSidebarDragStart:z0,onSidebarDragMove:J0,onSidebarDragEnd:D0,onSidebarDragCancel:j0,filesMax:w0,bumpPaneRequest:M0,commits:q0,logDone:z,logStalled:q,setLogStalled:w,commitDrillDown:c0,setCommitDrillDown:n0,resetLog:d,logSentinelRef:N,visibleCommits:B,logPagingPaused:X,aheadOids:V,visibleCommitFiles:l0,mdRendered:r0,setMdRendered:g0,maximized:_0,setMaximized:i2,mobileView:c2,setMobileView:l2}=c;return o.jsxs(o.Fragment,{children:[i0&&o.jsx("div",{className:"fixed inset-0 z-50 cursor-col-resize"}),o.jsxs("main",{className:`grid min-h-0 grid-cols-1 md:grid-cols-[var(--nc-sidebar)_1fr] ${c2==="terminal"?"hidden md:grid":""} ${i0?"select-none":""}`,style:{"--nc-sidebar":w0?"0px":`min(${I}px, ${Sr*100}vw)`},children:[o.jsx(kd,{tab:v,setTab:U,filter:j,setFilter:R,filterOpen:H,setFilterOpen:Y,status:s,files:x,now:g,hotWindowMs:T,setPane:M,openDiff:J,openFile:$,openCommit:e0,openCommitFileDiff:t0,openCommitFiles:Z,repo:r,authed:F,handle:m0,sidebarRef:Q,draggingSidebar:i0,onSidebarDragStart:z0,onSidebarDragMove:J0,onSidebarDragEnd:D0,onSidebarDragCancel:j0,filesMax:w0,bumpPaneRequest:M0,commits:q0,logDone:z,logStalled:q,setLogStalled:w,commitDrillDown:c0,setCommitDrillDown:n0,resetLog:d,logSentinelRef:N,visibleCommits:B,logPagingPaused:X,aheadOids:V,visibleCommitFiles:l0,mobileView:c2}),o.jsx(a3,{pane:C,mdRendered:r0,setMdRendered:g0,filesMax:w0,setMaximized:i2,status:s,className:c2==="diff"?"flex":"hidden md:flex"})]}),o.jsx(A.Suspense,{fallback:null,children:o.jsx(n3,{repo:r,maximized:_0==="terminal",onToggleMaximized:()=>i2(x2=>x2==="terminal"?"none":"terminal"),className:c2==="terminal"?"flex":"hidden md:flex"})}),o.jsx("nav",{"aria-label":"Switch view",className:"flex shrink-0 items-stretch border-t border-ink-700 bg-ink-900 md:hidden",children:[["files","Files",jd],["diff","Diff",Od],["terminal","Terminal",Dd]].map(([x2,E2,ot])=>o.jsxs("button",{onClick:()=>l2(x2),"aria-current":c2===x2?"page":void 0,className:`flex min-h-11 flex-1 flex-col items-center justify-center gap-0.5 py-1 text-[11px] ${c2===x2?"text-accent shadow-[inset_0_2px_0_0_var(--color-accent)]":"text-ink-400"}`,children:[o.jsx(ot,{className:"h-5 w-5"}),E2]},x2))}),o.jsxs("footer",{className:"flex shrink-0 items-center gap-3 border-t border-ink-700 bg-ink-900 px-3 py-1 text-ink-400",children:[o.jsx("span",{className:"truncate",children:h?.display_path}),s?.branch&&o.jsx("span",{className:"text-accent",children:s.branch}),s?.tracking&&o.jsxs("span",{children:["↑",s.tracking.ahead," ↓",s.tracking.behind]}),o.jsx("span",{className:"ml-auto",children:s?o.jsx("span",{className:"text-added",children:"● live"}):"connecting…"})]})]})}function i3({onClose:c,onOpened:r}){const[h,s]=A.useState(null),[x,g]=A.useState(null),[T,C]=A.useState(null),[M,v]=A.useState(!1),[U,j]=A.useState(""),[R,H]=A.useState(!1),[Y,J]=A.useState(0);A.useEffect(()=>{let Z=!1;return B0.browse(h??void 0).then(F=>{Z||(g(F),C(null))}).catch(F=>{Z||C(F instanceof Error?F.message:"could not browse")}),()=>{Z=!0}},[h,Y]);const $=Z=>s(`${x.path.replace(/\/$/,"")}/${Z}`),e0=async()=>{if(x){v(!0);try{r(await B0.open(x.path))}catch(Z){ki.error(Z instanceof Error?Z.message:"could not open"),v(!1)}}},t0=async()=>{if(!x)return;const Z=U.trim();if(Z){H(!0);try{await B0.mkdir(x.path,Z),j(""),J(F=>F+1)}catch(F){ki.error(F instanceof Error?F.message:"could not create folder")}finally{H(!1)}}};return o.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60 p-4",onClick:c,children:o.jsxs("div",{className:"flex max-h-[80vh] w-[34rem] max-w-full flex-col rounded-md border border-ink-700 bg-ink-900",onClick:Z=>Z.stopPropagation(),children:[o.jsxs("div",{className:"flex shrink-0 items-center gap-2 border-b border-ink-700 px-3 py-2",children:[o.jsx("span",{className:"font-medium text-ink-50",children:"Open a project"}),o.jsx("button",{onClick:c,"aria-label":"close",className:"ml-auto flex h-6 w-6 items-center justify-center rounded-sm text-ink-400 hover:text-ink-200",children:o.jsx(vn,{})})]}),o.jsx("div",{className:"shrink-0 truncate border-b border-ink-700 px-3 py-1.5 text-ink-400",children:x?.path??"…"}),o.jsxs("ul",{className:"h-72 min-h-0 overflow-y-auto",children:[x?.parent&&o.jsx("li",{children:o.jsx("button",{onClick:()=>s(x.parent),className:"w-full px-3 py-1 text-left text-ink-400 hover:bg-ink-850",children:"../"})}),x?.entries.map(Z=>o.jsx("li",{children:o.jsxs("button",{onClick:()=>$(Z.name),className:"flex w-full items-center gap-2 px-3 py-1 text-left hover:bg-ink-850",children:[o.jsxs("span",{className:"truncate text-accent",children:[Z.name,"/"]}),Z.is_repo&&o.jsx("span",{className:"rounded-sm bg-ink-700 px-1 text-[0.65rem] text-ink-200",children:"git"})]})},Z.name)),x&&x.entries.length===0&&o.jsx("li",{className:"px-3 py-1 text-ink-400",children:"No sub-folders."})]}),T&&o.jsx("p",{className:"shrink-0 px-3 py-1 text-removed",children:T}),o.jsxs("div",{className:"flex shrink-0 items-center gap-2 border-t border-ink-700 px-3 py-2",children:[o.jsx("input",{value:U,onChange:Z=>j(Z.target.value),onKeyDown:Z=>{Z.key==="Enter"&&t0()},placeholder:"New folder name","aria-label":"new folder name",className:"min-w-0 flex-1 rounded-sm border border-ink-700 bg-ink-950 px-2 py-1 text-ink-50 placeholder:text-ink-400 focus:border-ink-600 focus:outline-none"}),o.jsx("button",{onClick:t0,disabled:!x||!U.trim()||R,className:"shrink-0 rounded-sm border border-ink-700 px-2 py-1 text-ink-200 hover:bg-ink-850 disabled:opacity-50",children:R?"Creating…":"Create"})]}),o.jsxs("div",{className:"flex shrink-0 items-center gap-2 border-t border-ink-700 px-3 py-2",children:[o.jsx("span",{className:"truncate text-ink-400",children:x?x.path:""}),o.jsx("button",{onClick:e0,disabled:!x||M,className:"ml-auto shrink-0 rounded-md bg-ink-50 px-3 py-1 font-semibold text-ink-950 hover:bg-white disabled:opacity-50",children:M?"Opening…":"Open"})]})]})})}function or(){return o.jsx("div",{className:"flex h-full items-center justify-center p-6",children:o.jsxs("div",{className:"flex flex-col items-center gap-3 text-ink-400",children:[o.jsx(Wi,{className:"h-12 w-12 animate-pulse"}),o.jsx("span",{className:"text-[0.72rem] tracking-[0.18em] uppercase",children:"Loading…"})]})})}function c3({onSuccess:c}){const[r,h]=A.useState(""),[s,x]=A.useState(null),[g,T]=A.useState(!1),C=async M=>{M.preventDefault(),T(!0),x(null);try{await B0.login(r),c()}catch(v){x(v instanceof Error?v.message:"login failed")}finally{T(!1)}};return o.jsx("div",{className:"flex h-full items-center justify-center p-6",children:o.jsxs("form",{onSubmit:C,className:"w-[17rem] max-w-[86vw]",children:[o.jsx(Wi,{className:"mx-auto mb-3 block h-10 w-10"}),o.jsx("h1",{className:"text-center text-lg font-medium tracking-wide text-ink-50",children:"nightcrow"}),o.jsx("p",{className:"mt-1 mb-5 text-center text-[0.62rem] tracking-[0.18em] text-ink-400 uppercase",children:"web viewer"}),s&&o.jsx("p",{className:"mb-2.5 text-center text-removed",children:s}),o.jsx("input",{type:"password",autoFocus:!0,value:r,onChange:M=>h(M.target.value),placeholder:"password",className:"mb-2 w-full rounded-md border border-ink-700 bg-ink-900 px-2.5 py-1.5 outline-none placeholder:text-ink-400 focus:border-accent focus:ring-[3px] focus:ring-accent/15"}),o.jsx("button",{type:"submit",disabled:g,className:"w-full rounded-md bg-ink-50 py-1.5 font-semibold text-ink-950 hover:bg-white disabled:opacity-50",children:g?"Signing in…":"Sign in"})]})})}function f3(c,r){return c?`grid-rows-[auto_minmax(0,1fr)_auto_auto] ${r==="terminal"?"md:grid-rows-[auto_minmax(0,0fr)_minmax(0,1fr)_auto]":r==="files"?"md:grid-rows-[auto_minmax(0,1fr)_minmax(0,0fr)_auto]":"md:grid-rows-[auto_minmax(0,11fr)_minmax(0,9fr)_auto]"}`:"grid-rows-[auto_1fr]"}function s3(){const[c,r]=A.useState(null),[h,s]=A.useState("status"),[x,g]=A.useState(""),[T,C]=A.useState(!1),[M,v]=A.useState({kind:"empty"}),[U,j]=A.useState("files"),R=A.useRef(0),H=A.useCallback(()=>{R.current+=1},[]),[Y,J]=A.useState(!1),{accent:$,next:e0,cycle:t0,adopt:Z}=ad(),F=A.useRef(0),m0=A.useCallback(()=>{F.current+=1,t0()},[t0]),{width:I,resize:Q,commit:i0,reset:z0,adopt:J0}=ud(),D0=A.useRef(0),j0=A.useRef(0),w0=A.useRef(!1),M0=A.useRef(!1),q0=A.useRef(null),z=A.useCallback(Q0=>{D0.current+=1,i0(Q0)},[i0]),q=A.useCallback(()=>{D0.current+=1,z0()},[z0]),w=A.useCallback(()=>{D0.current+=1},[]),c0=A.useRef(null),[n0,d]=A.useState(!0),N=A.useCallback(Q0=>{if(dr(Q0)){r(!1);return}ki.error(Q0 instanceof Error?Q0.message:"request failed")},[]),B=Sd(),{draggingSidebar:X,onSidebarDragStart:V,onSidebarDragMove:l0,onSidebarDragEnd:r0,onSidebarDragCancel:g0,draggingRef:_0}=vd({sidebarRef:c0,sidebarWidth:I,resizeSidebar:Q,commitSidebarWidth:z,resetSidebarWidth:q,bumpSidebarWrites:w}),{repos:i2,setRepos:c2,repo:l2,setRepo:x2,hot:E2,clockSkewMs:ot,reposLoaded:wl}=Ld({authed:c,setAuthed:r,handle:N,adoptAccent:Z,adoptSidebarWidth:J0,draggingRef:_0,accentWrites:F,sidebarWrites:D0,resumeTick:B,orderWrites:j0,repoDraggingRef:w0,reorderInFlightRef:M0,pendingReorderRef:q0}),{dragging:yn,target:Ve,onStart:Vl,onMove:Kl,onEnd:Jl}=Td({repos:i2,setRepos:c2,handle:N,writesRef:j0,draggingRef:w0,inFlightRef:M0,pendingRef:q0}),$l=E2?.enabled?E2.window_secs*1e3:0;ir(void 0,$l,ot??0);const{status:el}=dd({repo:l2,authed:c,resumeTick:B,tab:h,pane:M,setPane:v,handle:N,paneRequestRef:R}),a2=ir(el?.files,$l,ot??0),{maximized:Wl,setMaximized:Ke,dropMaximized:Je}=bd(l2),{commits:Rt,logDone:gn,logStalled:$e,setLogStalled:Sn,commitDrillDown:We,setCommitDrillDown:Z2,resetLog:$0,logSentinelRef:X2,visibleCommits:n2,logPagingPaused:bn}=gd({repo:l2,authed:c,tab:h,filter:x,handle:N}),{openDiff:pn,openFile:xn,openCommit:al,openCommitFileDiff:nl,openCommitFiles:ul}=yd({repo:l2,handle:N,setPane:v,paneRequestRef:R,setCommitDrillDown:Z2,setMobileView:j}),{selectOpenedRepo:V2,closeRepo:il}=pd({repos:i2,setRepos:c2,setRepo:x2,setPane:v,setTab:s,setPickerOpen:J,dropMaximized:Je,handle:N,orderWrites:j0});if(A.useEffect(()=>{H(),Z2(null),v({kind:"empty"}),$0()},[l2,$0,H,Z2]),c===null)return o.jsx(or,{});if(!c)return o.jsx(c3,{onSuccess:()=>r(!0)});if(!wl)return o.jsx(or,{});const Bt=i2.find(Q0=>Q0.id===l2),Fl=x.toLowerCase(),Fe=(el?.files??[]).filter(Q0=>Q0.path.toLowerCase().includes(Fl)),Il=(We?.files??[]).filter(Q0=>Q0.path.toLowerCase().includes(Fl)||Q0.old_path?.toLowerCase().includes(Fl)),qt=new Set(Rt.slice(0,el?.tracking?.ahead??0).map(Q0=>Q0.oid)),En=Wl==="files",Ie=f3(l2,Wl);return o.jsxs("div",{className:`nc-fade grid h-full ${Ie}`,children:[o.jsx(Ud,{repos:i2,repo:l2,setRepo:Q0=>{x2(Q0),v({kind:"empty"})},setPane:()=>v({kind:"empty"}),closeRepo:il,setPickerOpen:J,accent:$,next:e0,cycle:m0,draggingRepo:yn,dragOverRepo:Ve,onRepoDragStart:Vl,onRepoDragMove:Kl,onRepoDragEnd:Jl}),l2?o.jsx(u3,{repo:l2,repos:i2,current:Bt,status:el,files:Fe,now:a2,hotWindowMs:$l,pane:M,setPane:v,tab:h,setTab:s,filter:x,setFilter:g,filterOpen:T,setFilterOpen:C,openDiff:pn,openFile:xn,openCommit:al,openCommitFileDiff:nl,openCommitFiles:ul,authed:c,handle:N,sidebarWidth:I,sidebarRef:c0,draggingSidebar:X,onSidebarDragStart:V,onSidebarDragMove:l0,onSidebarDragEnd:r0,onSidebarDragCancel:g0,filesMax:En,bumpPaneRequest:H,commits:Rt,logDone:gn,logStalled:$e,setLogStalled:Sn,commitDrillDown:We,setCommitDrillDown:Z2,resetLog:$0,logSentinelRef:X2,visibleCommits:n2,logPagingPaused:bn,aheadOids:qt,visibleCommitFiles:Il,mdRendered:n0,setMdRendered:d,maximized:Wl,setMaximized:Ke,mobileView:U,setMobileView:j}):o.jsx("div",{className:"flex items-center justify-center p-6 text-center text-ink-400",children:o.jsxs("span",{children:["No repository open. Click"," ",o.jsx("span",{className:"text-ink-200",children:"+ open"})," above to add one."]})}),Y&&o.jsx(i3,{onClose:()=>J(!1),onOpened:V2})]})}const r3={error:7e3,info:5e3,success:5e3},o3={error:"text-removed",info:"text-accent",success:"text-added"};function L3(){const[c,r]=A.useState([]);return A.useEffect(()=>ld(r),[]),c.length===0?null:o.jsx("div",{className:"pointer-events-none fixed right-3 top-3 z-[60] flex w-80 max-w-[calc(100vw-1.5rem)] flex-col gap-2","aria-live":"polite",children:c.map(h=>o.jsx(d3,{toast:h},h.id))})}function d3({toast:c}){const[r,h]=A.useState(!1);return A.useEffect(()=>{if(r)return;const s=setTimeout(()=>er(c.id),r3[c.kind]);return()=>clearTimeout(s)},[c.id,c.kind,c.bump,r]),o.jsxs("div",{role:c.kind==="error"?"alert":"status",className:"nc-fade pointer-events-auto flex items-start gap-2 rounded-md border border-ink-700 bg-ink-850 px-3 py-2 text-xs shadow-lg",onMouseEnter:()=>h(!0),onMouseLeave:()=>h(!1),children:[o.jsx("span",{className:`min-w-0 flex-1 break-words ${o3[c.kind]}`,children:c.message}),o.jsx("button",{type:"button",onClick:()=>er(c.id),"aria-label":"dismiss",className:"mt-0.5 flex h-4 w-4 shrink-0 items-center justify-center rounded-sm text-ink-400 hover:bg-ink-700 hover:text-ink-200",children:o.jsx(vn,{className:"h-3 w-3"})})]})}FL.createRoot(document.getElementById("root")).render(o.jsxs(A.StrictMode,{children:[o.jsx(s3,{}),o.jsx(L3,{})]}));export{Md as M,Tr as P,vn as X,od as a,xr as b,o as j,A as r,ki as t}; diff --git a/viewer-ui/dist/assets/index-qkOCcO3M.js b/viewer-ui/dist/assets/index-qkOCcO3M.js new file mode 100644 index 00000000..8946af66 --- /dev/null +++ b/viewer-ui/dist/assets/index-qkOCcO3M.js @@ -0,0 +1,11 @@ +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./Markdown-CuElJdJA.js","./Markdown-C8LL_u4z.css"])))=>i.map(i=>d[i]); +var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),s=(e,n)=>{let r={};for(var i in e)t(r,i,{get:e[i],enumerable:!0});return n||t(r,Symbol.toStringTag,{value:`Module`}),r},c=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;li[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},l=(n,r,a)=>(a=n==null?{}:e(i(n)),c(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n));(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var u=o((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),i=Symbol.for(`react.strict_mode`),a=Symbol.for(`react.profiler`),o=Symbol.for(`react.consumer`),s=Symbol.for(`react.context`),c=Symbol.for(`react.forward_ref`),l=Symbol.for(`react.suspense`),u=Symbol.for(`react.memo`),d=Symbol.for(`react.lazy`),f=Symbol.for(`react.activity`),p=Symbol.iterator;function m(e){return typeof e!=`object`||!e?null:(e=p&&e[p]||e[`@@iterator`],typeof e==`function`?e:null)}var h={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},g=Object.assign,_={};function v(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}v.prototype.isReactComponent={},v.prototype.setState=function(e,t){if(typeof e!=`object`&&typeof e!=`function`&&e!=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,e,t,`setState`)},v.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function y(){}y.prototype=v.prototype;function b(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}var x=b.prototype=new y;x.constructor=b,g(x,v.prototype),x.isPureReactComponent=!0;var ee=Array.isArray;function S(){}var C={H:null,A:null,T:null,S:null},te=Object.prototype.hasOwnProperty;function w(e,n,r){var i=r.ref;return{$$typeof:t,type:e,key:n,ref:i===void 0?null:i,props:r}}function ne(e,t){return w(e.type,t,e.props)}function T(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function E(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var re=/\/+/g;function D(e,t){return typeof e==`object`&&e&&e.key!=null?E(``+e.key):t.toString(36)}function ie(e){switch(e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason;default:switch(typeof e.status==`string`?e.then(S,S):(e.status=`pending`,e.then(function(t){e.status===`pending`&&(e.status=`fulfilled`,e.value=t)},function(t){e.status===`pending`&&(e.status=`rejected`,e.reason=t)})),e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason}}throw e}function ae(e,r,i,a,o){var s=typeof e;(s===`undefined`||s===`boolean`)&&(e=null);var c=!1;if(e===null)c=!0;else switch(s){case`bigint`:case`string`:case`number`:c=!0;break;case`object`:switch(e.$$typeof){case t:case n:c=!0;break;case d:return c=e._init,ae(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+D(e,0):a,ee(o)?(i=``,c!=null&&(i=c.replace(re,`$&/`)+`/`),ae(o,r,i,``,function(e){return e})):o!=null&&(T(o)&&(o=ne(o,i+(o.key==null||e&&e.key===o.key?``:(``+o.key).replace(re,`$&/`)+`/`)+c)),r.push(o)),1;c=0;var l=a===``?`.`:a+`:`;if(ee(e))for(var u=0;u{t.exports=u()})),f=o((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0>>1,a=e[r];if(0>>1;ri(c,n))li(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(li(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(e.unstable_now=void 0,typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=!1,_=typeof setTimeout==`function`?setTimeout:null,v=typeof clearTimeout==`function`?clearTimeout:null,y=typeof setImmediate<`u`?setImmediate:null;function b(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function x(e){if(h=!1,b(e),!m)if(n(c)!==null)m=!0,ee||(ee=!0,T());else{var t=n(l);t!==null&&D(x,t.startTime-e)}}var ee=!1,S=-1,C=5,te=-1;function w(){return g?!0:!(e.unstable_now()-tet&&w());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=t);if(t=e.unstable_now(),typeof s==`function`){d.callback=s,b(t),i=!0;break b}d===n(c)&&r(c),b(t)}else r(c);d=n(c)}if(d!==null)i=!0;else{var u=n(l);u!==null&&D(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?T():ee=!1}}}var T;if(typeof y==`function`)T=function(){y(ne)};else if(typeof MessageChannel<`u`){var E=new MessageChannel,re=E.port2;E.port1.onmessage=ne,T=function(){re.postMessage(null)}}else T=function(){_(ne,0)};function D(t,n){S=_(function(){t(e.unstable_now())},n)}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(e){e.callback=null},e.unstable_forceFrameRate=function(e){0>e||125o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(v(S),S=-1):h=!0,D(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,ee||(ee=!0,T()))),r},e.unstable_shouldYield=w,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),p=o(((e,t)=>{t.exports=f()})),m=o((e=>{var t=d();function n(e){var t=`https://react.dev/errors/`+e;if(1{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=m()})),g=o((e=>{var t=p(),n=d(),r=h();function i(e){var t=`https://react.dev/errors/`+e;if(1ue||(e.current=le[ue],le[ue]=null,ue--)}function M(e,t){ue++,le[ue]=e.current,e.current=t}var de=A(null),fe=A(null),pe=A(null),me=A(null);function he(e,t){switch(M(pe,t),M(fe,e),M(de,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Vd(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Vd(t),e=Hd(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}j(de),M(de,e)}function ge(){j(de),j(fe),j(pe)}function _e(e){e.memoizedState!==null&&M(me,e);var t=de.current,n=Hd(t,e.type);t!==n&&(M(fe,e),M(de,n))}function ve(e){fe.current===e&&(j(de),j(fe)),me.current===e&&(j(me),Qf._currentValue=ce)}var ye,be;function xe(e){if(ye===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);ye=t&&t[1]||``,be=-1)`:-1i||c[r]!==l[i]){var u=` +`+c[r].replace(` at new `,` at `);return e.displayName&&u.includes(``)&&(u=u.replace(``,e.displayName)),u}while(1<=r&&0<=i);break}}}finally{Se=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?xe(n):``}function we(e,t){switch(e.tag){case 26:case 27:case 5:return xe(e.type);case 16:return xe(`Lazy`);case 13:return e.child!==t&&t!==null?xe(`Suspense Fallback`):xe(`Suspense`);case 19:return xe(`SuspenseList`);case 0:case 15:return Ce(e.type,!1);case 11:return Ce(e.type.render,!1);case 1:return Ce(e.type,!0);case 31:return xe(`Activity`);default:return``}}function Te(e){try{var t=``,n=null;do t+=we(e,n),n=e,e=e.return;while(e);return t}catch(e){return` +Error generating stack: `+e.message+` +`+e.stack}}var Ee=Object.prototype.hasOwnProperty,De=t.unstable_scheduleCallback,Oe=t.unstable_cancelCallback,ke=t.unstable_shouldYield,Ae=t.unstable_requestPaint,je=t.unstable_now,Me=t.unstable_getCurrentPriorityLevel,Ne=t.unstable_ImmediatePriority,Pe=t.unstable_UserBlockingPriority,Fe=t.unstable_NormalPriority,Ie=t.unstable_LowPriority,Le=t.unstable_IdlePriority,Re=t.log,ze=t.unstable_setDisableYieldValue,Be=null,Ve=null;function He(e){if(typeof Re==`function`&&ze(e),Ve&&typeof Ve.setStrictMode==`function`)try{Ve.setStrictMode(Be,e)}catch{}}var Ue=Math.clz32?Math.clz32:Ge,We=Math.log,N=Math.LN2;function Ge(e){return e>>>=0,e===0?32:31-(We(e)/N|0)|0}var Ke=256,qe=262144,Je=4194304;function Ye(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function Xe(e,t,n){var r=e.pendingLanes;if(r===0)return 0;var i=0,a=e.suspendedLanes,o=e.pingedLanes;e=e.warmLanes;var s=r&134217727;return s===0?(s=r&~a,s===0?o===0?n||(n=r&~e,n!==0&&(i=Ye(n))):i=Ye(o):i=Ye(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=Ye(n))):i=Ye(o)):i=Ye(r)),i===0?0:t!==0&&t!==i&&(t&a)===0&&(a=i&-i,n=t&-t,a>=n||a===32&&n&4194048)?t:i}function Ze(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function Qe(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function $e(){var e=Je;return Je<<=1,!(Je&62914560)&&(Je=4194304),e}function et(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function tt(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function nt(e,t,n,r,i,a){var o=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var s=e.entanglements,c=e.expirationTimes,l=e.hiddenUpdates;for(n=o&~n;0`u`||window.document===void 0||window.document.createElement===void 0),mn=!1;if(pn)try{var hn={};Object.defineProperty(hn,"passive",{get:function(){mn=!0}}),window.addEventListener(`test`,hn,hn),window.removeEventListener(`test`,hn,hn)}catch{mn=!1}var gn=null,_n=null,vn=null;function yn(){if(vn)return vn;var e,t=_n,n=t.length,r,i=`value`in gn?gn.value:gn.textContent,a=i.length;for(e=0;e=Zn),er=` `,tr=!1;function nr(e,t){switch(e){case`keyup`:return Yn.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function rr(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var ir=!1;function ar(e,t){switch(e){case`compositionend`:return rr(t);case`keypress`:return t.which===32?(tr=!0,er):null;case`textInput`:return e=t.data,e===er&&tr?null:e;default:return null}}function or(e,t){if(ir)return e===`compositionend`||!Xn&&nr(e,t)?(e=yn(),vn=_n=gn=null,ir=!1,e):null;switch(e){case`paste`:return null;case`keypress`:if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:n,offset:t-e};e=r}a:{for(;n;){if(n.nextSibling){n=n.nextSibling;break a}n=n.parentNode}n=void 0}n=Or(n)}}function Ar(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Ar(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function jr(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Bt(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href==`string`}catch{n=!1}if(n)e=t.contentWindow;else break;t=Bt(e.document)}return t}function Mr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t===`input`&&(e.type===`text`||e.type===`search`||e.type===`tel`||e.type===`url`||e.type===`password`)||t===`textarea`||e.contentEditable===`true`)}var Nr=pn&&`documentMode`in document&&11>=document.documentMode,Pr=null,Fr=null,Ir=null,Lr=!1;function Rr(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Lr||Pr==null||Pr!==Bt(r)||(r=Pr,`selectionStart`in r&&Mr(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Ir&&Dr(Ir,r)||(Ir=r,r=Ed(Fr,`onSelect`),0>=o,i-=o,Ai=1<<32-Ue(t)+i|n<h?(g=d,d=null):g=d.sibling;var _=p(i,d,s[h],c);if(_===null){d===null&&(d=g);break}e&&d&&_.alternate===null&&t(i,d),a=o(_,a,h),u===null?l=_:u.sibling=_,u=_,d=g}if(h===s.length)return n(i,d),I&&Mi(i,h),l;if(d===null){for(;hg?(_=h,h=null):_=h.sibling;var y=p(a,h,v.value,l);if(y===null){h===null&&(h=_);break}e&&h&&y.alternate===null&&t(a,h),s=o(y,s,g),d===null?u=y:d.sibling=y,d=y,h=_}if(v.done)return n(a,h),I&&Mi(a,g),u;if(h===null){for(;!v.done;g++,v=c.next())v=f(a,v.value,l),v!==null&&(s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return I&&Mi(a,g),u}for(h=r(h);!v.done;g++,v=c.next())v=m(h,a,g,v.value,l),v!==null&&(e&&v.alternate!==null&&h.delete(v.key===null?g:v.key),s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return e&&h.forEach(function(e){return t(a,e)}),I&&Mi(a,g),u}function b(e,r,o,c){if(typeof o==`object`&&o&&o.type===y&&o.key===null&&(o=o.props.children),typeof o==`object`&&o){switch(o.$$typeof){case _:a:{for(var l=o.key;r!==null;){if(r.key===l){if(l=o.type,l===y){if(r.tag===7){n(e,r.sibling),c=a(r,o.props.children),c.return=e,e=c;break a}}else if(r.elementType===l||typeof l==`object`&&l&&l.$$typeof===T&&ja(l)===r.type){n(e,r.sibling),c=a(r,o.props),Ra(c,o),c.return=e,e=c;break a}n(e,r);break}else t(e,r);r=r.sibling}o.type===y?(c=_i(o.props.children,e.mode,c,o.key),c.return=e,e=c):(c=gi(o.type,o.key,o.props,null,e.mode,c),Ra(c,o),c.return=e,e=c)}return s(e);case v:a:{for(l=o.key;r!==null;){if(r.key===l)if(r.tag===4&&r.stateNode.containerInfo===o.containerInfo&&r.stateNode.implementation===o.implementation){n(e,r.sibling),c=a(r,o.children||[]),c.return=e,e=c;break a}else{n(e,r);break}else t(e,r);r=r.sibling}c=bi(o,e.mode,c),c.return=e,e=c}return s(e);case T:return o=ja(o),b(e,r,o,c)}if(se(o))return h(e,r,o,c);if(ie(o)){if(l=ie(o),typeof l!=`function`)throw Error(i(150));return o=l.call(o),g(e,r,o,c)}if(typeof o.then==`function`)return b(e,r,La(o),c);if(o.$$typeof===S)return b(e,r,aa(e,o),c);za(e,o)}return typeof o==`string`&&o!==``||typeof o==`number`||typeof o==`bigint`?(o=``+o,r!==null&&r.tag===6?(n(e,r.sibling),c=a(r,o),c.return=e,e=c):(n(e,r),c=vi(o,e.mode,c),c.return=e,e=c),s(e)):n(e,r)}return function(e,t,n,r){try{Ia=0;var i=b(e,t,n,r);return Fa=null,i}catch(t){if(t===Ta||t===Da)throw t;var a=fi(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var Va=Ba(!0),Ha=Ba(!1),Ua=!1;function Wa(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Ga(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function Ka(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function qa(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,G&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=li(e),ci(e,null,n),t}return ai(e,r,t,n),li(e)}function Ja(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,n&4194048)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,it(e,n)}}function Ya(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var o={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};a===null?i=a=o:a=a.next=o,n=n.next}while(n!==null);a===null?i=a=t:a=a.next=t}else i=a=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:r.shared,callbacks:r.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var Xa=!1;function Za(){if(Xa){var e=ga;if(e!==null)throw e}}function Qa(e,t,n,r){Xa=!1;var i=e.updateQueue;Ua=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var c=s,l=c.next;c.next=null,o===null?a=l:o.next=l,o=c;var u=e.alternate;u!==null&&(u=u.updateQueue,s=u.lastBaseUpdate,s!==o&&(s===null?u.firstBaseUpdate=l:s.next=l,u.lastBaseUpdate=c))}if(a!==null){var d=i.baseState;o=0,u=l=c=null,s=a;do{var f=s.lane&-536870913,p=f!==s.lane;if(p?(J&f)===f:(r&f)===f){f!==0&&f===ha&&(Xa=!0),u!==null&&(u=u.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});a:{var h=e,g=s;f=t;var _=n;switch(g.tag){case 1:if(h=g.payload,typeof h==`function`){d=h.call(_,d,f);break a}d=h;break a;case 3:h.flags=h.flags&-65537|128;case 0:if(h=g.payload,f=typeof h==`function`?h.call(_,d,f):h,f==null)break a;d=m({},d,f);break a;case 2:Ua=!0}}f=s.callback,f!==null&&(e.flags|=64,p&&(e.flags|=8192),p=i.callbacks,p===null?i.callbacks=[f]:p.push(f))}else p={lane:f,tag:s.tag,payload:s.payload,callback:s.callback,next:null},u===null?(l=u=p,c=d):u=u.next=p,o|=f;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;p=s,s=p.next,p.next=null,i.lastBaseUpdate=p,i.shared.pending=null}}while(1);u===null&&(c=d),i.baseState=c,i.firstBaseUpdate=l,i.lastBaseUpdate=u,a===null&&(i.shared.lanes=0),Gl|=o,e.lanes=o,e.memoizedState=d}}function $a(e,t){if(typeof e!=`function`)throw Error(i(191,e));e.call(t)}function eo(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;ea?a:8;var o=O.T,s={};O.T=s,Fs(e,!1,t,n);try{var c=i(),l=O.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?Ps(e,t,ya(c,r),pu(e)):Ps(e,t,r,pu(e))}catch(n){Ps(e,t,{then:function(){},status:`rejected`,reason:n},pu())}finally{k.p=a,o!==null&&s.types!==null&&(o.types=s.types),O.T=o}}function ws(){}function Ts(e,t,n,r){if(e.tag!==5)throw Error(i(476));var a=Es(e).queue;Cs(e,a,t,ce,n===null?ws:function(){return Ds(e),n(r)})}function Es(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:ce,baseState:ce,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Io,lastRenderedState:ce},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Io,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Ds(e){var t=Es(e);t.next===null&&(t=e.alternate.memoizedState),Ps(e,t.next.queue,{},pu())}function Os(){return ia(Qf)}function ks(){return H().memoizedState}function As(){return H().memoizedState}function js(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=pu();e=Ka(n);var r=qa(t,e,n);r!==null&&(hu(r,t,n),Ja(r,t,n)),t={cache:da()},e.payload=t;return}t=t.return}}function Ms(e,t,n){var r=pu();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},Is(e)?Ls(t,n):(n=oi(e,t,n,r),n!==null&&(hu(n,e,r),Rs(n,t,r)))}function Ns(e,t,n){Ps(e,t,n,pu())}function Ps(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(Is(e))Ls(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var o=t.lastRenderedState,s=a(o,n);if(i.hasEagerState=!0,i.eagerState=s,Er(s,o))return ai(e,t,i,0),K===null&&ii(),!1}catch{}if(n=oi(e,t,i,r),n!==null)return hu(n,e,r),Rs(n,t,r),!0}return!1}function Fs(e,t,n,r){if(r={lane:2,revertLane:dd(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},Is(e)){if(t)throw Error(i(479))}else t=oi(e,n,r,2),t!==null&&hu(t,e,2)}function Is(e){var t=e.alternate;return e===R||t!==null&&t===R}function Ls(e,t){_o=go=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Rs(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,it(e,n)}}var zs={readContext:ia,use:Po,useCallback:V,useContext:V,useEffect:V,useImperativeHandle:V,useLayoutEffect:V,useInsertionEffect:V,useMemo:V,useReducer:V,useRef:V,useState:V,useDebugValue:V,useDeferredValue:V,useTransition:V,useSyncExternalStore:V,useId:V,useHostTransitionStatus:V,useFormState:V,useActionState:V,useOptimistic:V,useMemoCache:V,useCacheRefresh:V};zs.useEffectEvent=V;var Bs={readContext:ia,use:Po,useCallback:function(e,t){return jo().memoizedState=[e,t===void 0?null:t],e},useContext:ia,useEffect:us,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),cs(4194308,4,gs.bind(null,t,e),n)},useLayoutEffect:function(e,t){return cs(4194308,4,e,t)},useInsertionEffect:function(e,t){cs(4,2,e,t)},useMemo:function(e,t){var n=jo();t=t===void 0?null:t;var r=e();if(vo){He(!0);try{e()}finally{He(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=jo();if(n!==void 0){var i=n(t);if(vo){He(!0);try{n(t)}finally{He(!1)}}}else i=t;return r.memoizedState=r.baseState=i,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:i},r.queue=e,e=e.dispatch=Ms.bind(null,R,e),[r.memoizedState,e]},useRef:function(e){var t=jo();return e={current:e},t.memoizedState=e},useState:function(e){e=Ko(e);var t=e.queue,n=Ns.bind(null,R,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:vs,useDeferredValue:function(e,t){return xs(jo(),e,t)},useTransition:function(){var e=Ko(!1);return e=Cs.bind(null,R,e.queue,!0,!1),jo().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=R,a=jo();if(I){if(n===void 0)throw Error(i(407));n=n()}else{if(n=t(),K===null)throw Error(i(349));J&127||Vo(r,t,n)}a.memoizedState=n;var o={value:n,getSnapshot:t};return a.queue=o,us(Uo.bind(null,r,o,e),[e]),r.flags|=2048,os(9,{destroy:void 0},Ho.bind(null,r,o,n,t),null),n},useId:function(){var e=jo(),t=K.identifierPrefix;if(I){var n=ji,r=Ai;n=(r&~(1<<32-Ue(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=yo++,0<\/script>`,o=o.removeChild(o.firstChild);break;case`select`:o=typeof r.is==`string`?s.createElement(`select`,{is:r.is}):s.createElement(`select`),r.multiple?o.multiple=!0:r.size&&(o.size=r.size);break;default:o=typeof r.is==`string`?s.createElement(a,{is:r.is}):s.createElement(a)}}o[P]=t,o[dt]=r;a:for(s=t.child;s!==null;){if(s.tag===5||s.tag===6)o.appendChild(s.stateNode);else if(s.tag!==4&&s.tag!==27&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===t)break a;for(;s.sibling===null;){if(s.return===null||s.return===t)break a;s=s.return}s.sibling.return=s.return,s=s.sibling}t.stateNode=o;a:switch(Pd(o,a,r),a){case`button`:case`input`:case`select`:case`textarea`:r=!!r.autoFocus;break a;case`img`:r=!0;break a;default:r=!1}r&&Pc(t)}}return U(t),Fc(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&Pc(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(i(166));if(e=pe.current,Wi(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,a=Li,a!==null)switch(a.tag){case 27:case 5:r=a.memoizedProps}e[P]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||Md(e.nodeValue,n)),e||Vi(t,!0)}else e=Bd(e).createTextNode(r),e[P]=t,t.stateNode=e}return U(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=Wi(t),n!==null){if(e===null){if(!r)throw Error(i(318));if(e=t.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(557));e[P]=t}else Gi(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;U(t),e=!1}else n=Ki(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(po(t),t):(po(t),null);if(t.flags&128)throw Error(i(558))}return U(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(a=Wi(t),r!==null&&r.dehydrated!==null){if(e===null){if(!a)throw Error(i(318));if(a=t.memoizedState,a=a===null?null:a.dehydrated,!a)throw Error(i(317));a[P]=t}else Gi(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;U(t),a=!1}else a=Ki(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),a=!0;if(!a)return t.flags&256?(po(t),t):(po(t),null)}return po(t),t.flags&128?(t.lanes=n,t):(n=r!==null,e=e!==null&&e.memoizedState!==null,n&&(r=t.child,a=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(a=r.alternate.memoizedState.cachePool.pool),o=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(o=r.memoizedState.cachePool.pool),o!==a&&(r.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),Lc(t,t.updateQueue),U(t),null);case 4:return ge(),e===null&&Sd(t.stateNode.containerInfo),U(t),null;case 10:return Qi(t.type),U(t),null;case 19:if(j(L),r=t.memoizedState,r===null)return U(t),null;if(a=(t.flags&128)!=0,o=r.rendering,o===null)if(a)Rc(r,!1);else{if(X!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=mo(e),o!==null){for(t.flags|=128,Rc(r,!1),e=o.updateQueue,t.updateQueue=e,Lc(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)hi(n,e),n=n.sibling;return M(L,L.current&1|2),I&&Mi(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&je()>tu&&(t.flags|=128,a=!0,Rc(r,!1),t.lanes=4194304)}else{if(!a)if(e=mo(o),e!==null){if(t.flags|=128,a=!0,e=e.updateQueue,t.updateQueue=e,Lc(t,e),Rc(r,!0),r.tail===null&&r.tailMode===`hidden`&&!o.alternate&&!I)return U(t),null}else 2*je()-r.renderingStartTime>tu&&n!==536870912&&(t.flags|=128,a=!0,Rc(r,!1),t.lanes=4194304);r.isBackwards?(o.sibling=t.child,t.child=o):(e=r.last,e===null?t.child=o:e.sibling=o,r.last=o)}return r.tail===null?(U(t),null):(e=r.tail,r.rendering=e,r.tail=e.sibling,r.renderingStartTime=je(),e.sibling=null,n=L.current,M(L,a?n&1|2:n&1),I&&Mi(t,r.treeForkCount),e);case 22:case 23:return po(t),ao(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(U(t),t.subtreeFlags&6&&(t.flags|=8192)):U(t),n=t.updateQueue,n!==null&&Lc(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),r=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),r!==n&&(t.flags|=2048),e!==null&&j(xa),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Qi(ua),U(t),null;case 25:return null;case 30:return null}throw Error(i(156,t.tag))}function Bc(e,t){switch(Fi(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Qi(ua),ge(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return ve(t),null;case 31:if(t.memoizedState!==null){if(po(t),t.alternate===null)throw Error(i(340));Gi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(po(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));Gi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return j(L),null;case 4:return ge(),null;case 10:return Qi(t.type),null;case 22:case 23:return po(t),ao(),e!==null&&j(xa),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Qi(ua),null;case 25:return null;default:return null}}function Vc(e,t){switch(Fi(t),t.tag){case 3:Qi(ua),ge();break;case 26:case 27:case 5:ve(t);break;case 4:ge();break;case 31:t.memoizedState!==null&&po(t);break;case 13:po(t);break;case 19:j(L);break;case 10:Qi(t.type);break;case 22:case 23:po(t),ao(),e!==null&&j(xa);break;case 24:Qi(ua)}}function Hc(e,t){try{var n=t.updateQueue,r=n===null?null:n.lastEffect;if(r!==null){var i=r.next;n=i;do{if((n.tag&e)===e){r=void 0;var a=n.create,o=n.inst;r=a(),o.destroy=r}n=n.next}while(n!==i)}}catch(e){Z(t,t.return,e)}}function Uc(e,t,n){try{var r=t.updateQueue,i=r===null?null:r.lastEffect;if(i!==null){var a=i.next;r=a;do{if((r.tag&e)===e){var o=r.inst,s=o.destroy;if(s!==void 0){o.destroy=void 0,i=t;var c=n,l=s;try{l()}catch(e){Z(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){Z(t,t.return,e)}}function Wc(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{eo(t,n)}catch(t){Z(e,e.return,t)}}}function Gc(e,t,n){n.props=qs(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){Z(e,t,n)}}function Kc(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;case 30:r=e.stateNode;break;default:r=e.stateNode}typeof n==`function`?e.refCleanup=n(r):n.current=r}}catch(n){Z(e,t,n)}}function qc(e,t){var n=e.ref,r=e.refCleanup;if(n!==null)if(typeof r==`function`)try{r()}catch(n){Z(e,t,n)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n==`function`)try{n(null)}catch(n){Z(e,t,n)}else n.current=null}function Jc(e){var t=e.type,n=e.memoizedProps,r=e.stateNode;try{a:switch(t){case`button`:case`input`:case`select`:case`textarea`:n.autoFocus&&r.focus();break a;case`img`:n.src?r.src=n.src:n.srcSet&&(r.srcset=n.srcSet)}}catch(t){Z(e,e.return,t)}}function Yc(e,t,n){try{var r=e.stateNode;Fd(r,e.type,n,t),r[dt]=t}catch(t){Z(e,e.return,t)}}function Xc(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Zd(e.type)||e.tag===4}function Zc(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||Xc(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&Zd(e.type)||e.flags&2||e.child===null||e.tag===4)continue a;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Qc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n).insertBefore(e,t):(t=n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n,t.appendChild(e),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=rn));else if(r!==4&&(r===27&&Zd(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(Qc(e,t,n),e=e.sibling;e!==null;)Qc(e,t,n),e=e.sibling}function $c(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(r===27&&Zd(e.type)&&(n=e.stateNode),e=e.child,e!==null))for($c(e,t,n),e=e.sibling;e!==null;)$c(e,t,n),e=e.sibling}function el(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);Pd(t,r,n),t[P]=e,t[dt]=n}catch(t){Z(e,e.return,t)}}var tl=!1,nl=!1,rl=!1,il=typeof WeakSet==`function`?WeakSet:Set,al=null;function ol(e,t){if(e=e.containerInfo,Rd=sp,e=jr(e),Mr(e)){if(`selectionStart`in e)var n={start:e.selectionStart,end:e.selectionEnd};else a:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var a=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break a}var s=0,c=-1,l=-1,u=0,d=0,f=e,p=null;b:for(;;){for(var m;f!==n||a!==0&&f.nodeType!==3||(c=s+a),f!==o||r!==0&&f.nodeType!==3||(l=s+r),f.nodeType===3&&(s+=f.nodeValue.length),(m=f.firstChild)!==null;)p=f,f=m;for(;;){if(f===e)break b;if(p===n&&++u===a&&(c=s),p===o&&++d===r&&(l=s),(m=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=m}n=c===-1||l===-1?null:{start:c,end:l}}else n=null}n||={start:0,end:0}}else n=null;for(zd={focusedElem:e,selectionRange:n},sp=!1,al=t;al!==null;)if(t=al,e=t.child,t.subtreeFlags&1028&&e!==null)e.return=t,al=e;else for(;al!==null;){switch(t=al,o=t.alternate,e=t.flags,t.tag){case 0:if(e&4&&(e=t.updateQueue,e=e===null?null:e.events,e!==null))for(n=0;n title`))),Pd(o,r,n),o[P]=e,Ct(o),r=o;break a;case`link`:var s=Vf(`link`,`href`,a).get(r+(n.href||``));if(s){for(var c=0;cg&&(o=g,g=h,h=o);var _=kr(s,h),v=kr(s,g);if(_&&v&&(p.rangeCount!==1||p.anchorNode!==_.node||p.anchorOffset!==_.offset||p.focusNode!==v.node||p.focusOffset!==v.offset)){var y=d.createRange();y.setStart(_.node,_.offset),p.removeAllRanges(),h>g?(p.addRange(y),p.extend(v.node,v.offset)):(y.setEnd(v.node,v.offset),p.addRange(y))}}}}for(d=[],p=s;p=p.parentNode;)p.nodeType===1&&d.push({element:p,left:p.scrollLeft,top:p.scrollTop});for(typeof s.focus==`function`&&s.focus(),s=0;sn?32:n,O.T=null,n=lu,lu=null;var o=au,s=su;if(iu=0,ou=au=null,su=0,G&6)throw Error(i(331));var c=G;if(G|=4,Fl(o.current),Dl(o,o.current,s,n),G=c,id(0,!1),Ve&&typeof Ve.onPostCommitFiberRoot==`function`)try{Ve.onPostCommitFiberRoot(Be,o)}catch{}return!0}finally{k.p=a,O.T=r,Vu(e,t)}}function Wu(e,t,n){t=Si(n,t),t=$s(e.stateNode,t,2),e=qa(e,t,2),e!==null&&(tt(e,2),rd(e))}function Z(e,t,n){if(e.tag===3)Wu(e,e,n);else for(;t!==null;){if(t.tag===3){Wu(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(ru===null||!ru.has(r))){e=Si(n,e),n=ec(2),r=qa(t,n,2),r!==null&&(tc(n,r,t,e),tt(r,2),rd(r));break}}t=t.return}}function Gu(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new zl;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(Ul=!0,i.add(n),e=Ku.bind(null,e,t,n),t.then(e,e))}function Ku(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,K===e&&(J&n)===n&&(X===4||X===3&&(J&62914560)===J&&300>je()-$l?!(G&2)&&Su(e,0):ql|=n,Yl===J&&(Yl=0)),rd(e)}function qu(e,t){t===0&&(t=$e()),e=si(e,t),e!==null&&(tt(e,t),rd(e))}function Ju(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),qu(e,n)}function Yu(e,t){var n=0;switch(e.tag){case 31:case 13:var r=e.stateNode,a=e.memoizedState;a!==null&&(n=a.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(i(314))}r!==null&&r.delete(t),qu(e,n)}function Xu(e,t){return De(e,t)}var Zu=null,Qu=null,$u=!1,ed=!1,td=!1,nd=0;function rd(e){e!==Qu&&e.next===null&&(Qu===null?Zu=Qu=e:Qu=Qu.next=e),ed=!0,$u||($u=!0,ud())}function id(e,t){if(!td&&ed){td=!0;do for(var n=!1,r=Zu;r!==null;){if(!t)if(e!==0){var i=r.pendingLanes;if(i===0)var a=0;else{var o=r.suspendedLanes,s=r.pingedLanes;a=(1<<31-Ue(42|e)+1)-1,a&=i&~(o&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,ld(r,a))}else a=J,a=Xe(r,r===K?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||Ze(r,a)||(n=!0,ld(r,a));r=r.next}while(n);td=!1}}function ad(){od()}function od(){ed=$u=!1;var e=0;nd!==0&&Gd()&&(e=nd);for(var t=je(),n=null,r=Zu;r!==null;){var i=r.next,a=sd(r,t);a===0?(r.next=null,n===null?Zu=i:n.next=i,i===null&&(Qu=n)):(n=r,(e!==0||a&3)&&(ed=!0)),r=i}iu!==0&&iu!==5||id(e,!1),nd!==0&&(nd=0)}function sd(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes&-62914561;0s)break;var u=c.transferSize,d=c.initiatorType;u&&Id(d)&&(c=c.responseEnd,o+=u*(c`u`?null:document;function xf(e,t,n){var r=bf;if(r&&typeof t==`string`&&t){var i=Ht(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),hf.has(i)||(hf.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),Pd(t,`link`,e),Ct(t),r.head.appendChild(t)))}}function Sf(e){_f.D(e),xf(`dns-prefetch`,e,null)}function Cf(e,t){_f.C(e,t),xf(`preconnect`,e,t)}function wf(e,t,n){_f.L(e,t,n);var r=bf;if(r&&e&&t){var i=`link[rel="preload"][as="`+Ht(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+Ht(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+Ht(n.imageSizes)+`"]`)):i+=`[href="`+Ht(e)+`"]`;var a=i;switch(t){case`style`:a=Af(e);break;case`script`:a=Pf(e)}mf.has(a)||(e=m({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),mf.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(jf(a))||t===`script`&&r.querySelector(Ff(a))||(t=r.createElement(`link`),Pd(t,`link`,e),Ct(t),r.head.appendChild(t)))}}function Tf(e,t){_f.m(e,t);var n=bf;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+Ht(r)+`"][href="`+Ht(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=Pf(e)}if(!mf.has(a)&&(e=m({rel:`modulepreload`,href:e},t),mf.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(Ff(a)))return}r=n.createElement(`link`),Pd(r,`link`,e),Ct(r),n.head.appendChild(r)}}}function Ef(e,t,n){_f.S(e,t,n);var r=bf;if(r&&e){var i=St(r).hoistableStyles,a=Af(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(jf(a)))s.loading=5;else{e=m({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=mf.get(a))&&Rf(e,n);var c=o=r.createElement(`link`);Ct(c),Pd(c,`link`,e),c._p=new Promise(function(e,t){c.onload=e,c.onerror=t}),c.addEventListener(`load`,function(){s.loading|=1}),c.addEventListener(`error`,function(){s.loading|=2}),s.loading|=4,Lf(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function Df(e,t){_f.X(e,t);var n=bf;if(n&&e){var r=St(n).hoistableScripts,i=Pf(e),a=r.get(i);a||(a=n.querySelector(Ff(i)),a||(e=m({src:e,async:!0},t),(t=mf.get(i))&&zf(e,t),a=n.createElement(`script`),Ct(a),Pd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Of(e,t){_f.M(e,t);var n=bf;if(n&&e){var r=St(n).hoistableScripts,i=Pf(e),a=r.get(i);a||(a=n.querySelector(Ff(i)),a||(e=m({src:e,async:!0,type:`module`},t),(t=mf.get(i))&&zf(e,t),a=n.createElement(`script`),Ct(a),Pd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function kf(e,t,n,r){var a=(a=pe.current)?gf(a):null;if(!a)throw Error(i(446));switch(e){case`meta`:case`title`:return null;case`style`:return typeof n.precedence==`string`&&typeof n.href==`string`?(t=Af(n.href),n=St(a).hoistableStyles,r=n.get(t),r||(r={type:`style`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};case`link`:if(n.rel===`stylesheet`&&typeof n.href==`string`&&typeof n.precedence==`string`){e=Af(n.href);var o=St(a).hoistableStyles,s=o.get(e);if(s||(a=a.ownerDocument||a,s={type:`stylesheet`,instance:null,count:0,state:{loading:0,preload:null}},o.set(e,s),(o=a.querySelector(jf(e)))&&!o._p&&(s.instance=o,s.state.loading=5),mf.has(e)||(n={rel:`preload`,as:`style`,href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},mf.set(e,n),o||Nf(a,e,n,s.state))),t&&r===null)throw Error(i(528,``));return s}if(t&&r!==null)throw Error(i(529,``));return null;case`script`:return t=n.async,n=n.src,typeof n==`string`&&t&&typeof t!=`function`&&typeof t!=`symbol`?(t=Pf(n),n=St(a).hoistableScripts,r=n.get(t),r||(r={type:`script`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};default:throw Error(i(444,e))}}function Af(e){return`href="`+Ht(e)+`"`}function jf(e){return`link[rel="stylesheet"][`+e+`]`}function Mf(e){return m({},e,{"data-precedence":e.precedence,precedence:null})}function Nf(e,t,n,r){e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)?r.loading=1:(t=e.createElement(`link`),r.preload=t,t.addEventListener(`load`,function(){return r.loading|=1}),t.addEventListener(`error`,function(){return r.loading|=2}),Pd(t,`link`,n),Ct(t),e.head.appendChild(t))}function Pf(e){return`[src="`+Ht(e)+`"]`}function Ff(e){return`script[async]`+e}function If(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+Ht(n.href)+`"]`);if(r)return t.instance=r,Ct(r),r;var a=m({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),Ct(r),Pd(r,`style`,a),Lf(r,n.precedence,e),t.instance=r;case`stylesheet`:a=Af(n.href);var o=e.querySelector(jf(a));if(o)return t.state.loading|=4,t.instance=o,Ct(o),o;r=Mf(n),(a=mf.get(a))&&Rf(r,a),o=(e.ownerDocument||e).createElement(`link`),Ct(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),Pd(o,`link`,r),t.state.loading|=4,Lf(o,n.precedence,e),t.instance=o;case`script`:return o=Pf(n.src),(a=e.querySelector(Ff(o)))?(t.instance=a,Ct(a),a):(r=n,(a=mf.get(o))&&(r=m({},n),zf(r,a)),e=e.ownerDocument||e,a=e.createElement(`script`),Ct(a),Pd(a,`link`,r),e.head.appendChild(a),t.instance=a);case`void`:return null;default:throw Error(i(443,t.type))}else t.type===`stylesheet`&&!(t.state.loading&4)&&(r=t.instance,t.state.loading|=4,Lf(r,n.precedence,e));return t.instance}function Lf(e,t,n){for(var r=n.querySelectorAll(`link[rel="stylesheet"][data-precedence],style[data-precedence]`),i=r.length?r[r.length-1]:null,a=i,o=0;o title`):null)}function Uf(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case`meta`:case`title`:return!0;case`style`:if(typeof t.precedence!=`string`||typeof t.href!=`string`||t.href===``)break;return!0;case`link`:if(typeof t.rel!=`string`||typeof t.href!=`string`||t.href===``||t.onLoad||t.onError)break;switch(t.rel){case`stylesheet`:return e=t.disabled,typeof t.precedence==`string`&&e==null;default:return!0}case`script`:if(t.async&&typeof t.async!=`function`&&typeof t.async!=`symbol`&&!t.onLoad&&!t.onError&&t.src&&typeof t.src==`string`)return!0}return!1}function Wf(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function Gf(e,t,n,r){if(n.type===`stylesheet`&&(typeof r.media!=`string`||!1!==matchMedia(r.media).matches)&&!(n.state.loading&4)){if(n.instance===null){var i=Af(r.href),a=t.querySelector(jf(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=Jf.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,Ct(a);return}a=t.ownerDocument||t,r=Mf(r),(i=mf.get(i))&&Rf(r,i),a=a.createElement(`link`),Ct(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),Pd(a,`link`,r),n.instance=a}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&!(n.state.loading&3)&&(e.count++,n=Jf.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var Kf=0;function qf(e,t){return e.stylesheets&&e.count===0&&Xf(e,e.stylesheets),0Kf?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function Jf(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Xf(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Yf=null;function Xf(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Yf=new Map,t.forEach(Zf,e),Yf=null,Jf.call(e))}function Zf(e,t){if(!(t.state.loading&4)){var n=Yf.get(e);if(n)var r=n.get(null);else{n=new Map,Yf.set(e,n);for(var i=e.querySelectorAll(`link[data-precedence],style[data-precedence]`),a=0;a{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=g()})),v=d(),y=_(),b=class extends Error{status;constructor(e,t){super(t),this.status=e}},x=e=>e instanceof b&&e.status===401,ee=class extends Error{constructor(e){super(`connection lost — check your network`,{cause:e}),this.name=`NetworkError`}},S=e=>e instanceof ee;async function C(e,t){try{return await fetch(e,t)}catch(e){throw new ee(e)}}async function te(e){if(!e.ok){let t=`request failed (${e.status})`;try{let n=await e.json();typeof n?.error==`string`&&(t=n.error)}catch{}throw new b(e.status,t)}let t=await e.json();if(t.version!==2)throw new b(e.status,`this page is out of date (server protocol v${t.version}) — reload`);return t}async function w(e,t){return te(await C(e,{credentials:`same-origin`,signal:t}))}async function ne(e,t){return te(await C(e,{method:`POST`,credentials:`same-origin`,headers:{"Content-Type":`application/json`},body:JSON.stringify(t)}))}var T=e=>new URLSearchParams(e).toString(),E={async login(e){let t=await C(`/login`,{method:`POST`,credentials:`same-origin`,headers:{"Content-Type":`application/x-www-form-urlencoded`},body:new URLSearchParams({password:e}).toString()});if(!t.ok)throw new b(t.status,t.status===429?`too many attempts — wait a minute`:`incorrect password`)},repos:e=>w(`/api/repos`,e),setAccent:e=>ne(`/api/prefs`,{accent:e}).then(e=>e.accent),setSidebarWidth:e=>ne(`/api/prefs`,{sidebar_width:e}).then(e=>e.sidebar_width),status:e=>w(`/api/status?${T({repo:e})}`),tree:(e,t)=>w(`/api/tree?${T({repo:e,path:t})}`),treeSearch:(e,t)=>w(`/api/tree/search?${T({repo:e,q:t})}`),log:(e,t)=>w(`/api/log?${T(t?{repo:e,from:t.from,skip:String(t.skip)}:{repo:e})}`),diff:(e,t)=>w(`/api/diff?${T({repo:e,path:t})}`),file:(e,t)=>w(`/api/file?${T({repo:e,path:t})}`),commit:(e,t)=>w(`/api/commit?${T({repo:e,oid:t})}`),commitFiles:(e,t)=>w(`/api/commit/files?${T({repo:e,oid:t})}`),commitFileDiff:(e,t,n)=>w(`/api/commit/file-diff?${T({repo:e,oid:t,path:n})}`),browse:e=>w(`/api/browse${e?`?${T({path:e})}`:``}`),mkdir:(e,t)=>ne(`/api/mkdir`,{path:e,name:t}).then(e=>e.path),open:e=>ne(`/api/repos`,{path:e}).then(e=>e.repo),close:async e=>{let t=await C(`/api/repos?${T({repo:e})}`,{method:`DELETE`,credentials:`same-origin`});if(!t.ok)throw new b(t.status,`could not close (${t.status})`)},reorderRepos:e=>ne(`/api/repos/order`,{order:e}).then(e=>e.repos)};function re(e,t){let n=new EventSource(`/api/events?${T({repo:e})}`);return n.addEventListener(`status`,e=>{try{let n=JSON.parse(e.data);n.version===2&&t(n)}catch{}}),()=>n.close()}var D=[],ie=1,ae=new Set;function oe(){let e=D;ae.forEach(t=>t(e))}function se(e){return ae.add(e),e(D),()=>{ae.delete(e)}}function O(e){let t=D.filter(t=>t.id!==e);t.length!==D.length&&(D=t,oe())}function k(e,t){let n=D.findIndex(n=>n.kind===e&&n.message===t);if(n!==-1){let e=D[n];return D=D.map((e,t)=>t===n?{...e,bump:e.bump+1}:e),oe(),e.id}let r=ie++;return D=[...D,{id:r,kind:e,message:t,bump:0}].slice(-4),oe(),r}var ce={error:e=>k(`error`,e),info:e=>k(`info`,e),success:e=>k(`success`,e)},le=[{name:`yellow`,color:`#d9a441`},{name:`cyan`,color:`#03c4db`},{name:`green`,color:`#77c47a`},{name:`magenta`,color:`#dc8fd5`},{name:`blue`,color:`#87acfd`}],ue=`nightcrow.viewer.accent`;function A(e){if(!Number.isFinite(e))return 0;let t=le.length;return(Math.trunc(e)%t+t)%t}function j(){try{let e=localStorage.getItem(ue);return e===null?0:A(Number(e))}catch{return 0}}function M(e){try{localStorage.setItem(ue,String(e))}catch{}}function de(){let[e,t]=(0,v.useState)(j);(0,v.useLayoutEffect)(()=>{document.documentElement.style.setProperty(`--color-accent`,le[e].color)},[e]);let n=(0,v.useCallback)(()=>{t(e=>{let t=A(e+1);return M(t),E.setAccent(t).catch(()=>{}),t})},[]),r=(0,v.useCallback)(e=>{t(t=>{let n=A(e);return n===t?t:(M(n),n)})},[]);return{accent:le[e],next:le[A(e+1)],cycle:n,adopt:r}}var fe=`nightcrow.sidebarWidth`,pe=.5;function me(e){return Math.min(Math.max(Math.round(e),280),720)}function he(e){let t=720;try{t=Math.min(t,Math.round(window.innerWidth*pe))}catch{}return Math.min(Math.max(Math.round(e),280),Math.max(t,280))}function ge(){try{let e=Number(localStorage.getItem(fe));return Number.isFinite(e)&&e>0?me(e):460}catch{return 460}}function _e(e){try{localStorage.setItem(fe,String(e))}catch{}}function ve(){let[e,t]=(0,v.useState)(ge);return{width:e,resize:(0,v.useCallback)(e=>{let n=he(e);t(n),_e(n)},[]),commit:(0,v.useCallback)(e=>{let n=he(e);t(n),_e(n),E.setSidebarWidth(n).catch(()=>{})},[]),reset:(0,v.useCallback)(()=>{let e=me(460);t(e),_e(e),E.setSidebarWidth(e).catch(()=>{})},[]),adopt:(0,v.useCallback)(e=>{t(t=>{let n=me(e);return n===t?t:(_e(n),n)})},[])}}var ye=1e3;function be(e,t){return e===void 0||e<=0?0:e-t}function xe(e,t,n){let r=be(t,n);return e===null||Math.abs(r-e)>=1e3?r:e}function Se(e,t,n){if(e===void 0)return`cool`;let r=Math.max(0,t-e);return r>=n?`cool`:r<5e3?`fresh`:`warm`}function Ce(e,t,n){return e.some(e=>Se(e,t,n)!==`cool`)}var we={fresh:`text-accent font-bold`,warm:`text-accent`,cool:``};function Te(e,t,n){let[r,i]=(0,v.useState)(()=>Date.now()+n);return(0,v.useEffect)(()=>{if(t<=0||!e)return;let r=e.map(e=>e.mtime),a=Date.now()+n;if(i(a),!Ce(r,a,t))return;let o=setInterval(()=>{let e=Date.now()+n;i(e),Ce(r,e,t)||clearInterval(o)},ye);return()=>clearInterval(o)},[e,t,n]),r}function Ee(e,t,n){if(t===n)return e;let r=e.indexOf(t),i=e.indexOf(n);if(r===-1||i===-1)return e;let a=e.filter(e=>e!==t),o=a.indexOf(n),s=r{let e=!1,c,p=new AbortController,h=()=>{let _=o.current,v=s.current,b=l.current;return E.repos(p.signal).then(({repos:n,hot:p,accent:x,sidebar_width:S,now_ms:C})=>{if(e)return;y(p),ee(e=>xe(e,C,Date.now())),o.current===_&&r(x),s.current===v&&!a.current&&i(S),t(!0),te(!0);let w=d.current||f.current!==null;l.current===b&&!u.current&&!w?m(n):m(e=>{let t=De(n.map(e=>e.id),e.map(e=>e.id)),r=new Map(n.map(e=>[e.id,e]));return t.map(e=>r.get(e)).filter(Boolean)}),g(e=>e&&n.some(t=>t.id===e)?e:n[0]?.id??null),e||(c=setTimeout(h,Oe))}).catch(r=>{e||(x(r)?(t(!1),te(!1)):S(r)||n(r),c=setTimeout(h,Oe))})};return h(),()=>{e=!0,p.abort(),c&&clearTimeout(c)}},[e,t,n,r,i,c,o,s,a,l,u,d,f]),{repos:p,setRepos:m,repo:h,setRepo:g,hot:_,clockSkewMs:b,reposLoaded:C}}function Ae({repo:e,authed:t,resumeTick:n,tab:r,pane:i,setPane:a,handle:o,paneRequestRef:s}){let[c,l]=(0,v.useState)(null),u=(0,v.useRef)(i);u.current=i;let d=(0,v.useRef)(r);return d.current=r,(0,v.useEffect)(()=>{l(null)},[e,t]),(0,v.useEffect)(()=>{if(!(!e||!t))return re(e,l)},[e,t,n]),(0,v.useEffect)(()=>{if(!e||!c)return;let t=u.current;if(d.current!==`status`||t.kind!==`diff`)return;let n=t.value.path;if(!c.files.some(e=>e.path===n)){a({kind:`empty`});return}let r=s.current,i=!0,l=()=>{let e=u.current;return i&&r===s.current&&e.kind===`diff`&&e.value.path===n};return E.diff(e,n).then(e=>{l()&&a({kind:`diff`,value:e})}).catch(e=>{l()&&o(e)}),()=>{i=!1}},[c,e,o,u,d,s,a]),{status:c,paneRef:u,tabRef:d}}var je=3,Me=400;function Ne({sidebarRef:e,sidebarWidth:t,resizeSidebar:n,commitSidebarWidth:r,resetSidebarWidth:i,bumpSidebarWrites:a}){let o=(0,v.useRef)(0),s=(0,v.useRef)(0),c=(0,v.useRef)(0),l=(0,v.useRef)(!1),u=(0,v.useRef)(!1),d=(0,v.useRef)(0),[f,p]=(0,v.useState)(!1);return{draggingSidebar:f,onSidebarDragStart:(0,v.useCallback)(n=>{if(n.button!==0||!n.isPrimary)return;let r=e.current?.getBoundingClientRect().left;r!==void 0&&(o.current=r,s.current=n.clientX,c.current=t,l.current=!0,u.current=!1,a(),p(!0),n.currentTarget.setPointerCapture(n.pointerId),n.preventDefault())},[t,e,a]),onSidebarDragMove:(0,v.useCallback)(e=>{l.current&&(!u.current&&Math.abs(e.clientX-s.current){if(!l.current)return;if(l.current=!1,p(!1),u.current){r(c.current),d.current=0;return}let e=Date.now();e-d.current{l.current=!1,u.current=!1,d.current=0,p(!1)},[]),draggingRef:l}}function Pe({repo:e,handle:t,setPane:n,paneRequestRef:r,setCommitDrillDown:i,setMobileView:a}){return{openDiff:(0,v.useCallback)(i=>{if(!e)return;a(`diff`);let o=r.current+=1;E.diff(e,i).then(e=>{o===r.current&&n({kind:`diff`,value:e})}).catch(e=>{o===r.current&&t(e)})},[e,t,n,r,a]),openFile:(0,v.useCallback)(i=>{if(!e)return;a(`diff`);let o=r.current+=1;E.file(e,i).then(e=>{o===r.current&&n({kind:`file`,value:e})}).catch(e=>{o===r.current&&t(e)})},[e,t,n,r,a]),openCommit:(0,v.useCallback)(i=>{if(!e)return;a(`diff`);let o=r.current+=1;E.commit(e,i).then(e=>{o===r.current&&n({kind:`diff`,value:e})}).catch(e=>{o===r.current&&t(e)})},[e,t,n,r,a]),openCommitFileDiff:(0,v.useCallback)((i,o)=>{if(!e)return;a(`diff`);let s=r.current+=1;E.commitFileDiff(e,i,o).then(e=>{s===r.current&&n({kind:`diff`,value:e})}).catch(e=>{s===r.current&&t(e)})},[e,t,n,r,a]),openCommitFiles:(0,v.useCallback)(async o=>{if(!e)return;a(`diff`);let s=r.current+=1;try{let t=await E.commitFiles(e,o.oid);if(s!==r.current)return;if(i({commit:o,...t}),t.files.length===0){n({kind:`empty`});return}let a=await E.commit(e,o.oid);s===r.current&&n({kind:`diff`,value:a})}catch(e){s===r.current&&t(e)}},[e,t,n,r,i,a])}}function Fe({repo:e,authed:t,tab:n,filter:r,handle:i}){let[a,o]=(0,v.useState)([]),[s,c]=(0,v.useState)(!1),[l,u]=(0,v.useState)(!1),d=(0,v.useRef)(null),f=(0,v.useRef)(!1),p=(0,v.useRef)(0),m=(0,v.useCallback)(()=>{p.current+=1,f.current=!1,o([]),d.current=null,c(!1),u(!1)},[]),[h,g]=(0,v.useState)(null),_=(0,v.useRef)(a);_.current=a;let y=(0,v.useCallback)(async()=>{if(!e||f.current)return;f.current=!0;let t=p.current;try{let n=d.current,r=await E.log(e,n===null?void 0:{from:n,skip:_.current.length});if(t!==p.current)return;o(e=>[...e,...r.commits]),d.current=r.head??null,c(!r.truncated||r.head===void 0)}catch(e){t===p.current&&(i(e),u(!0))}finally{t===p.current&&(f.current=!1)}},[e,i]);(0,v.useEffect)(()=>{!e||!t||n!==`log`||a.length===0&&!s&&!l&&y()},[e,t,n,a.length,s,l,y]);let b=a.filter(e=>e.summary.toLowerCase().includes(r.toLowerCase())),x=r!==``,ee=(0,v.useRef)(null);return(0,v.useEffect)(()=>{let e=ee.current;if(!e)return;let t=new IntersectionObserver(e=>{e.some(e=>e.isIntersecting)&&y()},{root:e.closest(`ul`),rootMargin:`400px`});return t.observe(e),()=>t.disconnect()},[y,s,l,x,h,n,b.length]),{commits:a,logDone:s,logStalled:l,setLogStalled:u,commitDrillDown:h,setCommitDrillDown:g,resetLog:m,logSentinelRef:ee,visibleCommits:b,logPagingPaused:x}}function Ie(){let[e,t]=(0,v.useState)(0);return(0,v.useEffect)(()=>{let e=()=>{document.visibilityState===`visible`&&t(e=>e+1)};return document.addEventListener(`visibilitychange`,e),window.addEventListener(`online`,e),()=>{document.removeEventListener(`visibilitychange`,e),window.removeEventListener(`online`,e)}},[]),e}function Le(e){let[t,n]=(0,v.useState)({}),r=(0,v.useCallback)(t=>{e!=null&&n(n=>{let r=n[e]??`none`,i=typeof t==`function`?t(r):t;return{...n,[e]:i}})},[e]);return{maximized:e!=null&&t[e]||`none`,setMaximized:r,dropMaximized:(0,v.useCallback)(e=>{n(({[e]:t,...n})=>n)},[])}}function Re({repos:e,setRepos:t,setRepo:n,setPane:r,setTab:i,setPickerOpen:a,dropMaximized:o,handle:s,orderWrites:c}){return{selectOpenedRepo:(0,v.useCallback)(e=>{c.current+=1,t(t=>t.some(t=>t.id===e.id)?t:[...t,e]),n(e.id),r({kind:`empty`}),i(`status`),a(!1)},[t,n,r,i,a,c]),closeRepo:(0,v.useCallback)(async r=>{try{await E.close(r),c.current+=1;let i=e.filter(e=>e.id!==r);t(i),n(e=>e===r?i[0]?.id??null:e),o(r)}catch(e){s(e)}},[e,t,n,o,s,c])}}var ze=4;function Be({ids:e,onReorder:t,draggingRef:n}){let r=(0,v.useRef)(null),i=(0,v.useRef)(null),a=(0,v.useRef)(null),[o,s]=(0,v.useState)(null),[c,l]=(0,v.useState)(null);return{dragging:o,target:c,onStart:(t,a)=>{t.target.closest(`button[data-tab-close]`)||t.button!==0||e.length<2||(r.current=a,i.current={x:t.clientX,y:t.clientY},n.current=!1)},onMove:e=>{let t=r.current,o=i.current;if(t===null||o===null)return;if(!n.current&&e.buttons===0){r.current=null,i.current=null;return}if(!n.current&&Math.hypot(e.clientX-o.x,e.clientY-o.y){let o=r.current,c=a.current;o!==null&&n.current&&c!==null&&t(Ee(e,o,c)),r.current=null,i.current=null,a.current=null,n.current=!1,s(null),l(null)}}}function Ve({repos:e,setRepos:t,handle:n,writesRef:r,draggingRef:i,inFlightRef:a,pendingRef:o}){let s=(0,v.useCallback)(()=>{if(a.current||o.current===null)return;let e=o.current;o.current=null,a.current=!0;let i=r.current;E.reorderRepos(e).then(e=>{r.current===i&&t(e)}).catch(n).finally(()=>{a.current=!1,s()})},[n,t]),c=(0,v.useCallback)(e=>{r.current+=1,t(t=>{let n=De(t.map(e=>e.id),e),r=new Map(t.map(e=>[e.id,e]));return n.map(e=>r.get(e)).filter(Boolean)}),o.current=e,s()},[s,t]);return{...Be({ids:e.map(e=>e.id),onReorder:c,draggingRef:i}),writesRef:r,draggingRef:i,inFlightRef:a,pendingRef:o}}var He=`data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='utf-8'?%3e%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='12%2057%201150%201150'%20role='img'%20aria-label='Black%20crow'%3e%3ctitle%3eBlack%20crow%3c/title%3e%3cdesc%3eMonochrome%20black%20crow%20silhouette%20on%20a%20transparent%20background,%20framed%20so%20the%20bird%20sits%20centred%20for%20use%20as%20an%20inline%20mark%20on%20a%20square%20tile.%3c/desc%3e%3cg%20fill-rule='evenodd'%20clip-rule='evenodd'%3e%3cpath%20fill='%23000000'%20d='M%20882%20147%20L%20859%20136%20L%20844%20131%20L%20831%20129%20L%20830%20128%20L%20815%20127%20L%20814%20126%20L%20796%20126%20L%20795%20127%20L%20786%20127%20L%20785%20128%20L%20775%20129%20L%20752%20136%20L%20732%20146%20L%20713%20160%20L%20701%20172%20L%20684%20172%20L%20683%20173%20L%20673%20173%20L%20672%20174%20L%20650%20176%20L%20649%20177%20L%20627%20181%20L%20602%20190%20L%20589%20197%20L%20579%20204%20L%20562%20221%20L%20562%20223%20L%20565%20223%20L%20578%20228%20L%20581%20228%20L%20612%20238%20L%20672%20252%20L%20684%20258%20L%20698%20271%20L%20702%20278%20L%20705%20288%20L%20705%20294%20L%20703%20301%20L%20699%20308%20L%20688%20318%20L%20630%20347%20L%20593%20372%20L%20561%20399%20L%20544%20416%20L%20522%20441%20L%20492%20481%20L%20461%20531%20L%20438%20576%20L%20431%20594%20L%20425%20602%20L%20405%20635%20L%20387%20668%20L%20385%20676%20L%20390%20679%20L%20368%20705%20L%20330%20755%20L%20306%20790%20L%20296%20808%20L%20289%20818%20L%20280%20838%20L%20280%20843%20L%20283%20845%20L%20292%20843%20L%20297%20840%20L%20299%20840%20L%20321%20828%20L%20322%20830%20L%20311%20844%20L%20288%20878%20L%20287%20881%20L%20259%20924%20L%20235%20965%20L%20205%201023%20L%20205%201025%20L%20197%201042%20L%20191%201061%20L%20191%201071%20L%20192%201072%20L%20198%201071%20L%20220%201056%20L%20242%201038%20L%20300%20986%20L%20302%20987%20L%20265%201040%20L%20264%201043%20L%20246%201070%20L%20235%201090%20L%20227%201112%20L%20227%201123%20L%20229%201128%20L%20234%201133%20L%20239%201135%20L%20255%201135%20L%20274%201129%20L%20279%201134%20L%20286%201137%20L%20290%201137%20L%20291%201138%20L%20310%201138%20L%20311%201137%20L%20317%201137%20L%20318%201136%20L%20326%201135%20L%20344%201129%20L%20369%201116%20L%20395%201097%20L%20420%201073%20L%20445%201042%20L%20457%201024%20L%20461%201016%20L%20464%201013%20L%20468%201011%20L%20489%20994%20L%20595%20901%20L%20601%20906%20L%20606%20913%20L%20614%20921%20L%20637%20949%20L%20639%20953%20L%20639%20956%20L%20636%20960%20L%20634%20961%20L%20619%20962%20L%20613%20965%20L%20605%20974%20L%20602%20982%20L%20602%20994%20L%20605%201001%20L%20608%201004%20L%20609%201004%20L%20609%20999%20L%20612%20992%20L%20616%20988%20L%20620%20986%20L%20627%20986%20L%20635%20983%20L%20645%20983%20L%20646%20982%20L%20655%20982%20L%20668%20986%20L%20676%20990%20L%20682%20996%20L%20685%201003%20L%20688%201006%20L%20696%201009%20L%20697%201012%20L%20697%201024%20L%20693%201033%20L%20693%201035%20L%20695%201035%20L%20700%201032%20L%20707%201025%20L%20710%201020%20L%20713%201010%20L%20713%201003%20L%20711%20998%20L%20711%20994%20L%20712%20993%20L%20719%201003%20L%20723%201005%20L%20727%201005%20L%20730%201011%20L%20730%201022%20L%20727%201031%20L%20728%201033%20L%20740%201021%20L%20743%201014%20L%20744%201003%20L%20747%20999%20L%20749%20992%20L%20748%20977%20L%20744%20968%20L%20740%20963%20L%20741%20962%20L%20755%20961%20L%20768%20964%20L%20777%20969%20L%20783%20975%20L%20786%20981%20L%20789%20984%20L%20795%20987%20L%20799%20987%20L%20801%20991%20L%20801%20997%20L%20802%20998%20L%20799%201013%20L%20802%201012%20L%20808%201007%20L%20813%201000%20L%20816%20991%20L%20816%20981%20L%20814%20976%20L%20814%20968%20L%20815%20967%20L%20819%20970%20L%20823%20970%20L%20826%20973%20L%20829%20980%20L%20830%20993%20L%20834%20990%20L%20838%20979%20L%20838%20968%20L%20832%20951%20L%20822%20940%20L%20815%20936%20L%20803%20933%20L%20776%20935%20L%20763%20931%20L%20753%20922%20L%20731%20898%20L%20703%20865%20L%20703%20863%20L%20710%20853%20L%20711%20855%20L%20707%20862%20L%20709%20862%20L%20718%20857%20L%20754%20832%20L%20793%20799%20L%20818%20774%20L%20849%20737%20L%20850%20741%20L%20845%20755%20L%20847%20755%20L%20861%20743%20L%20881%20721%20L%20906%20686%20L%20918%20665%20L%20933%20635%20L%20951%20590%20L%20971%20525%20L%20971%20521%20L%20974%20512%20L%20974%20508%20L%20978%20493%20L%20979%20482%20L%20980%20481%20L%20981%20466%20L%20982%20465%20L%20983%20441%20L%20982%20440%20L%20982%20428%20L%20981%20427%20L%20980%20414%20L%20978%20409%20L%20976%20397%20L%20970%20381%20L%20971%20379%20L%20974%20383%20L%20976%20381%20L%20977%20334%20L%20976%20333%20L%20976%20322%20L%20975%20321%20L%20974%20307%20L%20973%20306%20L%20973%20301%20L%20972%20300%20L%20969%20280%20L%20958%20243%20L%20949%20224%20L%20949%20222%20L%20939%20204%20L%20922%20181%20L%20903%20162%20Z%20M%20625%20888%20L%20656%20874%20L%20658%20874%20L%20665%20870%20L%20725%20930%20L%20728%20934%20L%20728%20940%20L%20723%20943%20L%20714%20944%20L%20707%20950%20L%20683%20951%20L%20673%20947%20L%20659%20932%20Z%20M%20787%20182%20L%20792%20182%20L%20796%20187%20L%20795%20192%20L%20791%20195%20L%20788%20195%20L%20783%20191%20L%20783%20186%20Z'/%3e%3cpath%20fill='%23000000'%20d='M%20895%20156%20L%20863%20138%20L%20838%20130%20L%20819%20127%20L%20789%20127%20L%20777%20129%20L%20753%20136%20L%20736%20144%20L%20717%20157%20L%20702%20172%20L%20652%20176%20L%20628%20181%20L%20607%20188%20L%20585%20200%20L%20562%20222%20L%20613%20238%20L%20670%20251%20L%20683%20257%20L%20697%20269%20L%20705%20286%20L%20705%20296%20L%20703%20302%20L%20698%20310%20L%20687%20319%20L%20631%20347%20L%20591%20374%20L%20568%20393%20L%20538%20423%20L%20520%20444%20L%20481%20498%20L%20457%20539%20L%20437%20579%20L%20432%20593%20L%20413%20622%20L%20386%20671%20L%20386%20677%20L%20390%20677%20L%20391%20679%20L%20374%20698%20L%20334%20750%20L%20307%20789%20L%20290%20817%20L%20280%20839%20L%20281%20844%20L%20291%20843%20L%20323%20826%20L%20325%20827%20L%20289%20877%20L%20237%20962%20L%20209%201015%20L%20198%201040%20L%20191%201063%20L%20191%201070%20L%20194%201072%20L%20213%201061%20L%20259%201023%20L%20302%20984%20L%20303%20985%20L%20262%201045%20L%20245%201072%20L%20233%201095%20L%20227%201114%20L%20228%201126%20L%20233%201132%20L%20242%201135%20L%20252%201135%20L%20274%201128%20L%20278%201133%20L%20288%201137%20L%20313%201137%20L%20343%201129%20L%20373%201113%20L%20398%201094%20L%20424%201068%20L%20441%201047%20L%20465%201012%20L%20520%20967%20L%20595%20900%20L%20611%20917%20L%20639%20952%20L%20639%20957%20L%20637%20960%20L%20632%20962%20L%20618%20963%20L%20611%20967%20L%20606%20973%20L%20602%20983%20L%20602%20992%20L%20608%201004%20L%20611%20993%20L%20619%20986%20L%20626%20986%20L%20643%20982%20L%20656%20982%20L%20675%20989%20L%20683%20997%20L%20688%201006%20L%20696%201009%20L%20697%201025%20L%20693%201034%20L%20694%201035%20L%20701%201031%20L%20710%201019%20L%20712%201013%20L%20712%20993%20L%20720%201003%20L%20727%201005%20L%20730%201009%20L%20730%201025%20L%20727%201032%20L%20732%201030%20L%20739%201022%20L%20743%201013%20L%20743%201004%20L%20749%20991%20L%20748%20978%20L%20740%20964%20L%20743%20961%20L%20757%20961%20L%20769%20964%20L%20781%20972%20L%20791%20985%20L%20798%20986%20L%20802%20994%20L%20802%201003%20L%20799%201013%20L%20810%201004%20L%20815%20994%20L%20816%20983%20L%20814%20977%20L%20814%20965%20L%20818%20969%20L%20825%20971%20L%20830%20983%20L%20830%20993%20L%20833%20991%20L%20837%20982%20L%20838%20969%20L%20834%20956%20L%20825%20943%20L%20820%20939%20L%20807%20934%20L%20774%20935%20L%20762%20931%20L%20736%20904%20L%20702%20864%20L%20715%20845%20L%20716%20847%20L%20707%20862%20L%20719%20856%20L%20744%20839%20L%20786%20805%20L%20824%20767%20L%20851%20733%20L%20852%20735%20L%20846%20755%20L%20853%20750%20L%20883%20718%20L%20906%20685%20L%20927%20647%20L%20951%20589%20L%20968%20535%20L%20976%20502%20L%20982%20461%20L%20981%20422%20L%20976%20398%20L%20968%20378%20L%20969%20376%20L%20975%20383%20L%20977%20341%20L%20970%20286%20L%20958%20244%20L%20945%20215%20L%20925%20185%20L%20906%20165%20Z%20M%20625%20888%20L%20665%20870%20L%20728%20933%20L%20729%20940%20L%20726%20943%20L%20715%20944%20L%20708%20950%20L%20692%20952%20L%20678%20950%20L%20672%20947%20L%20662%20936%20Z%20M%20785%20183%20L%20792%20182%20L%20796%20186%20L%20796%20191%20L%20791%20195%20L%20785%20194%20L%20783%20191%20L%20783%20186%20Z'/%3e%3cpath%20fill='%23000000'%20d='M%20896%20157%20L%20869%20141%20L%20837%20130%20L%20817%20127%20L%20792%20127%20L%20778%20129%20L%20751%20137%20L%20733%20146%20L%20715%20159%20L%20702%20172%20L%20653%20176%20L%20610%20187%20L%20581%20203%20L%20562%20222%20L%20625%20241%20L%20671%20251%20L%20683%20257%20L%20698%20270%20L%20705%20285%20L%20704%20300%20L%20699%20309%20L%20689%20318%20L%20628%20349%20L%20581%20382%20L%20540%20421%20L%20517%20448%20L%20478%20503%20L%20456%20541%20L%20439%20575%20L%20432%20593%20L%20412%20624%20L%20388%20667%20L%20386%20676%20L%20390%20677%20L%20391%20679%20L%20363%20712%20L%20332%20753%20L%20289%20819%20L%20281%20836%20L%20281%20844%20L%20293%20842%20L%20323%20826%20L%20325%20827%20L%20284%20885%20L%20236%20964%20L%20205%201024%20L%20197%201043%20L%20191%201064%20L%20191%201070%20L%20197%201071%20L%20210%201063%20L%20253%201028%20L%20303%20983%20L%20304%20984%20L%20259%201050%20L%20235%201091%20L%20227%201115%20L%20228%201125%20L%20232%201131%20L%20238%201134%20L%20249%201135%20L%20261%201133%20L%20274%201128%20L%20278%201133%20L%20289%201137%20L%20312%201137%20L%20342%201129%20L%20368%201116%20L%20399%201093%20L%20423%201069%20L%20443%201044%20L%20463%201013%20L%20493%20990%20L%20595%20900%20L%20612%20918%20L%20639%20952%20L%20639%20957%20L%20636%20961%20L%20616%20964%20L%20606%20973%20L%20602%20984%20L%20602%20991%20L%20608%201004%20L%20611%20993%20L%20621%20985%20L%20625%20986%20L%20639%20982%20L%20657%20982%20L%20677%20990%20L%20685%201002%20L%20690%201007%20L%20697%201010%20L%20698%201021%20L%20693%201034%20L%20694%201035%20L%20705%201027%20L%20710%201018%20L%20712%201011%20L%20712%201001%20L%20710%20994%20L%20712%20993%20L%20720%201003%20L%20729%201006%20L%20731%201020%20L%20728%201032%20L%20738%201023%20L%20743%201012%20L%20743%201003%20L%20748%20994%20L%20747%20976%20L%20740%20964%20L%20743%20961%20L%20759%20961%20L%20767%20963%20L%20780%20971%20L%20790%20984%20L%20799%20986%20L%20802%20992%20L%20802%201004%20L%20799%201012%20L%20803%201011%20L%20810%201004%20L%20815%20994%20L%20814%20965%20L%20818%20969%20L%20823%20969%20L%20830%20982%20L%20830%20992%20L%20832%20992%20L%20837%20982%20L%20837%20965%20L%20831%20950%20L%20821%20940%20L%20806%20934%20L%20772%20935%20L%20762%20931%20L%20733%20901%20L%20702%20863%20L%20717%20842%20L%20718%20844%20L%20707%20862%20L%20738%20843%20L%20780%20810%20L%20822%20769%20L%20851%20733%20L%20852%20735%20L%20846%20755%20L%20855%20748%20L%20882%20719%20L%20904%20688%20L%20930%20640%20L%20950%20591%20L%20967%20538%20L%20978%20490%20L%20982%20459%20L%20982%20434%20L%20976%20399%20L%20967%20376%20L%20969%20375%20L%20975%20383%20L%20976%20329%20L%20971%20293%20L%20960%20250%20L%20942%20210%20L%20923%20183%20Z%20M%20625%20888%20L%20665%20870%20L%20729%20934%20L%20729%20940%20L%20726%20943%20L%20716%20944%20L%20708%20950%20L%20695%20952%20L%20677%20950%20L%20666%20941%20Z%20M%20786%20182%20L%20790%20181%20L%20794%20183%20L%20797%20188%20L%20792%20195%20L%20787%20195%20L%20782%20190%20L%20782%20187%20Z'/%3e%3cpath%20fill='%23000000'%20d='M%20893%20155%20L%20873%20143%20L%20841%20131%20L%20816%20127%20L%20794%20127%20L%20779%20129%20L%20754%20136%20L%20735%20145%20L%20715%20159%20L%20702%20172%20L%20648%20177%20L%20629%20181%20L%20608%20188%20L%20584%20201%20L%20562%20222%20L%20614%20238%20L%20671%20251%20L%20685%20258%20L%20698%20270%20L%20704%20281%20L%20706%20292%20L%20703%20303%20L%20699%20309%20L%20686%20320%20L%20628%20349%20L%20590%20375%20L%20565%20396%20L%20543%20418%20L%20518%20447%20L%20490%20485%20L%20460%20534%20L%20441%20571%20L%20431%20595%20L%20405%20636%20L%20386%20672%20L%20386%20676%20L%20390%20677%20L%20391%20679%20L%20371%20702%20L%20335%20749%20L%20291%20816%20L%20280%20840%20L%20282%20844%20L%20298%20840%20L%20324%20825%20L%20326%20826%20L%20294%20870%20L%20235%20966%20L%20206%201022%20L%20198%201041%20L%20191%201065%20L%20191%201070%20L%20196%201071%20L%20214%201060%20L%20254%201027%20L%20303%20983%20L%20304%20984%20L%20256%201055%20L%20232%201098%20L%20227%201115%20L%20228%201125%20L%20232%201131%20L%20239%201134%20L%20248%201135%20L%20264%201132%20L%20274%201128%20L%20280%201134%20L%20289%201137%20L%20311%201137%20L%20339%201130%20L%20371%201114%20L%20401%201091%20L%20422%201070%20L%20440%201048%20L%20463%201013%20L%20487%20995%20L%20595%20900%20L%20613%20919%20L%20639%20951%20L%20639%20958%20L%20636%20961%20L%20619%20963%20L%20613%20966%20L%20605%20975%20L%20602%20991%20L%20604%20998%20L%20608%201003%20L%20611%20993%20L%20620%20985%20L%20624%20986%20L%20632%20983%20L%20647%20981%20L%20658%20982%20L%20677%20990%20L%20689%201006%20L%20697%201009%20L%20698%201021%20L%20694%201035%20L%20703%201029%20L%20710%201018%20L%20712%201010%20L%20712%201002%20L%20710%20997%20L%20711%20992%20L%20720%201003%20L%20728%201005%20L%20730%201008%20L%20731%201021%20L%20728%201032%20L%20738%201023%20L%20742%201014%20L%20743%201003%20L%20748%20994%20L%20748%20980%20L%20742%20966%20L%20739%20963%20L%20741%20961%20L%20753%20960%20L%20770%20964%20L%20780%20971%20L%20790%20984%20L%20799%20986%20L%20802%20992%20L%20802%201005%20L%20799%201012%20L%20804%201010%20L%20809%201005%20L%20815%20993%20L%20813%20964%20L%20817%20968%20L%20823%20969%20L%20826%20972%20L%20830%20982%20L%20831%20992%20L%20834%20989%20L%20838%20975%20L%20837%20966%20L%20831%20950%20L%20821%20940%20L%20804%20934%20L%20779%20936%20L%20763%20932%20L%20731%20899%20L%20702%20865%20L%20702%20863%20L%20717%20842%20L%20718%20844%20L%20708%20862%20L%20749%20835%20L%20781%20809%20L%20820%20771%20L%20851%20733%20L%20852%20736%20L%20846%20755%20L%20857%20746%20L%20881%20720%20L%20907%20683%20L%20928%20644%20L%20945%20604%20L%20967%20537%20L%20978%20489%20L%20982%20455%20L%20982%20437%20L%20979%20413%20L%20975%20396%20L%20967%20377%20L%20968%20374%20L%20975%20382%20L%20976%20332%20L%20972%20299%20L%20962%20257%20L%20954%20235%20L%20943%20212%20L%20923%20183%20Z%20M%20624%20888%20L%20666%20870%20L%20729%20934%20L%20729%20940%20L%20726%20943%20L%20716%20944%20L%20706%20951%20L%20684%20952%20L%20677%20950%20L%20665%20940%20Z%20M%20701%20220%20L%20710%20219%20L%20717%20221%20L%20704%20223%20L%20704%20221%20Z%20M%20666%20217%20L%20679%20216%20L%20689%20218%20L%20685%20220%20L%20675%20220%20Z%20M%20658%20210%20L%20661%20208%20L%20686%20205%20L%20706%20206%20L%20725%20209%20L%20733%20217%20L%20741%20220%20L%20738%20221%20L%20696%20214%20L%20661%20212%20Z%20M%20788%20181%20L%20793%20182%20L%20797%20188%20L%20792%20195%20L%20786%20195%20L%20782%20190%20L%20783%20185%20Z'/%3e%3cpath%20fill='%23000000'%20d='M%20893%20155%20L%20864%20139%20L%20836%20130%20L%20813%20127%20L%20796%20127%20L%20774%20130%20L%20749%20138%20L%20735%20145%20L%20720%20155%20L%20702%20172%20L%20687%20173%20L%20700%20174%20L%20694%20181%20L%20674%20184%20L%20670%20180%20L%20665%20183%20L%20657%20184%20L%20639%20196%20L%20641%20198%20L%20647%20198%20L%20648%20194%20L%20654%20193%20L%20686%20204%20L%20724%20208%20L%20740%20213%20L%20751%20222%20L%20750%20223%20L%20693%20214%20L%20671%20212%20L%20639%20212%20L%20636%20211%20L%20634%20207%20L%20629%20207%20L%20626%20210%20L%20617%20210%20L%20614%20208%20L%20604%20207%20L%20594%20213%20L%20582%20216%20L%20580%20214%20L%20581%20210%20L%20576%20208%20L%20586%20200%20L%20565%20218%20L%20563%20222%20L%20618%20239%20L%20671%20251%20L%20682%20256%20L%20689%20261%20L%20702%20276%20L%20706%20288%20L%20704%20301%20L%20700%20308%20L%20683%20322%20L%20630%20348%20L%20585%20379%20L%20563%20398%20L%20523%20441%20L%20497%20475%20L%20459%20536%20L%20443%20567%20L%20431%20595%20L%20411%20626%20L%20387%20670%20L%20386%20676%20L%20390%20677%20L%20391%20679%20L%20368%20706%20L%20333%20752%20L%20290%20818%20L%20281%20837%20L%20282%20844%20L%20300%20839%20L%20324%20825%20L%20326%20826%20L%20285%20884%20L%20242%20954%20L%20207%201020%20L%20192%201060%20L%20192%201071%20L%20196%201071%20L%20211%201062%20L%20240%201039%20L%20303%20983%20L%20305%20984%20L%20277%201023%20L%20242%201078%20L%20228%201110%20L%20227%201119%20L%20231%201130%20L%20239%201134%20L%20255%201134%20L%20274%201128%20L%20280%201134%20L%20285%201136%20L%20310%201137%20L%20339%201130%20L%20374%201112%20L%20394%201097%20L%20421%201071%20L%20445%201041%20L%20463%201013%20L%20488%20994%20L%20595%20900%20L%20614%20920%20L%20639%20951%20L%20639%20958%20L%20636%20961%20L%20619%20963%20L%20613%20966%20L%20607%20972%20L%20603%20980%20L%20602%20989%20L%20603%20995%20L%20608%201003%20L%20610%20994%20L%20620%20985%20L%20623%20986%20L%20631%20983%20L%20647%20981%20L%20665%20984%20L%20676%20989%20L%20689%201006%20L%20695%201007%20L%20697%201009%20L%20698%201023%20L%20694%201035%20L%20699%201032%20L%20709%201020%20L%20712%201010%20L%20710%20997%20L%20711%20992%20L%20719%201002%20L%20725%201005%20L%20727%201004%20L%20730%201008%20L%20731%201022%20L%20728%201032%20L%20739%201021%20L%20743%201010%20L%20743%201003%20L%20748%20993%20L%20748%20981%20L%20746%20974%20L%20739%20963%20L%20741%20961%20L%20755%20960%20L%20770%20964%20L%20779%20970%20L%20789%20983%20L%20799%20986%20L%20802%20992%20L%20802%201005%20L%20799%201012%20L%20808%201006%20L%20815%20993%20L%20813%20964%20L%20817%20968%20L%20825%20970%20L%20829%20978%20L%20831%20992%20L%20837%20981%20L%20837%20966%20L%20832%20952%20L%20822%20941%20L%20813%20936%20L%20803%20934%20L%20776%20936%20L%20763%20932%20L%20723%20890%20L%20702%20865%20L%20702%20863%20L%20717%20841%20L%20719%20842%20L%20708%20862%20L%20742%20840%20L%20782%20808%20L%20818%20773%20L%20851%20733%20L%20852%20736%20L%20846%20754%20L%20850%20752%20L%20881%20720%20L%20905%20686%20L%20932%20635%20L%20950%20590%20L%20969%20529%20L%20977%20494%20L%20982%20454%20L%20980%20419%20L%20975%20396%20L%20967%20377%20L%20968%20374%20L%20975%20382%20L%20976%20334%20L%20969%20284%20L%20959%20248%20L%20941%20209%20L%20921%20181%20Z%20M%20624%20888%20L%20666%20870%20L%20729%20934%20L%20729%20941%20L%20724%20944%20L%20716%20944%20L%20707%20951%20L%20683%20952%20L%20673%20948%20L%20659%20933%20Z%20M%20563%20618%20L%20569%20614%20L%20579%20621%20L%20576%20626%20L%20572%20627%20L%20568%20623%20L%20565%20623%20Z%20M%20575%20603%20L%20578%20603%20L%20588%20613%20L%20588%20619%20L%20585%20621%20L%20582%20620%20L%20575%20613%20L%20576%20612%20L%20573%20605%20Z%20M%20748%20398%20L%20752%20412%20L%20752%20432%20L%20748%20444%20L%20732%20470%20L%20716%20484%20L%20698%20493%20L%20685%20494%20L%20682%20491%20L%20707%20445%20L%20685%20473%20L%20667%20492%20L%20647%20508%20L%20632%20517%20L%20619%20519%20L%20615%20517%20L%20615%20513%20L%20643%20470%20L%20603%20514%20L%20589%20526%20L%20569%20538%20L%20558%20540%20L%20554%20539%20L%20552%20535%20L%20577%20498%20L%20549%20528%20L%20526%20546%20L%20508%20554%20L%20498%20555%20L%20495%20552%20L%20501%20541%20L%20482%20555%20L%20471%20558%20L%20464%20558%20L%20461%20560%20L%20460%20559%20L%20461%20555%20L%20469%20547%20L%20473%20537%20L%20491%20512%20L%20511%20497%20L%20582%20434%20L%20617%20408%20L%20632%20399%20L%20659%20386%20L%20677%20380%20L%20695%20377%20L%20712%20377%20L%20725%20380%20L%20739%20388%20Z%20M%20625%20216%20L%20683%20216%20L%20737%20222%20L%20742%20224%20L%20733%20226%20L%20721%20225%20L%20713%20230%20L%20711%20228%20L%20706%20228%20L%20694%20237%20L%20690%20233%20L%20690%20225%20L%20679%20228%20L%20674%20232%20L%20668%20232%20L%20659%20229%20L%20649%20222%20L%20632%20219%20L%20632%20217%20Z%20M%20788%20181%20L%20793%20182%20L%20797%20187%20L%20795%20193%20L%20792%20195%20L%20786%20195%20L%20782%20190%20L%20783%20185%20Z'/%3e%3cpath%20fill='%23000000'%20d='M%20607%20972%20L%20603%20981%20L%20603%20995%20L%20608%201003%20L%20610%20994%20L%20616%20987%20L%20620%20985%20L%20627%20985%20L%20635%20982%20L%20655%20981%20L%20676%20989%20L%20683%20996%20L%20689%201006%20L%20695%201007%20L%20697%201009%20L%20698%201024%20L%20694%201034%20L%20699%201032%20L%20706%201025%20L%20712%201010%20L%20710%20994%20L%20709%20997%20L%20706%20994%20L%20700%20994%20L%20694%20997%20L%20672%20976%20L%20658%20974%20L%20647%20967%20L%20642%20974%20L%20638%20974%20L%20636%20972%20L%20636%20961%20L%20629%20963%20L%20631%20972%20L%20625%20977%20L%20620%20977%20L%20613%20967%20L%20614%20966%20Z%20M%20686%20966%20L%20704%20980%20L%20719%201002%20L%20727%201004%20L%20730%201007%20L%20731%201023%20L%20728%201032%20L%20731%201030%20L%20741%201017%20L%20743%201003%20L%20748%20992%20L%20748%20981%20L%20742%20967%20L%20740%20965%20L%20742%20968%20L%20735%20972%20L%20726%20965%20L%20705%20960%20L%20724%20968%20L%20740%20983%20L%20742%20987%20L%20740%20991%20L%20732%20991%20L%20728%20996%20L%20726%20996%20L%20721%20992%20L%20713%20979%20Z%20M%20784%20943%20L%20784%20946%20L%20798%20950%20L%20819%20969%20L%20825%20970%20L%20830%20981%20L%20831%20992%20L%20837%20981%20L%20837%20966%20L%20829%20948%20L%20825%20944%20L%20830%20950%20L%20821%20957%20L%20813%20951%20L%20794%20942%20Z%20M%20659%20933%20L%20662%20937%20L%20658%20942%20L%20658%20945%20L%20663%20947%20L%20666%20945%20L%20667%20946%20L%20668%20944%20L%20670%20946%20Z%20M%20643%20913%20L%20647%20918%20L%20644%20921%20L%20642%20928%20L%20629%20938%20L%20627%20936%20L%20636%20947%20L%20634%20945%20L%20641%20933%20L%20651%20923%20L%20657%20930%20Z%20M%20936%20310%20L%20934%20309%20L%20945%20338%20L%20949%20368%20L%20949%20381%20L%20947%20383%20L%20935%20367%20L%20914%20348%20L%20929%20377%20L%20934%20397%20L%20936%20414%20L%20935%20440%20L%20933%20442%20L%20930%20440%20L%20924%20419%20L%20912%20395%20L%20909%20393%20L%20910%20410%20L%20907%20433%20L%20899%20458%20L%20895%20462%20L%20893%20460%20L%20892%20445%20L%20888%20427%20L%20873%20390%20L%20873%20416%20L%20871%20430%20L%20866%20448%20L%20862%20454%20L%20859%20452%20L%20853%20433%20L%20842%20410%20L%20823%20382%20L%20807%20365%20L%20805%20366%20L%20811%20394%20L%20812%20416%20L%20810%20425%20L%20806%20428%20L%20801%20423%20L%20790%20403%20L%20772%20383%20L%20759%20372%20L%20733%20357%20L%20724%20355%20L%20705%20346%20L%20693%20344%20L%20669%20344%20L%20646%20349%20L%20636%20353%20L%20662%20349%20L%20677%20349%20L%20699%20353%20L%20708%20356%20L%20725%20366%20L%20736%20376%20L%20745%20389%20L%20753%20415%20L%20752%20442%20L%20743%20476%20L%20723%20520%20L%20693%20569%20L%20646%20631%20L%20605%20676%20L%20568%20709%20L%20565%20710%20L%20562%20706%20L%20562%20692%20L%20567%20665%20L%20578%20636%20L%20602%20619%20L%20622%20602%20L%20645%20578%20L%20670%20546%20L%20630%20588%20L%20603%20610%20L%20574%20628%20L%20560%20633%20L%20556%20633%20L%20555%20631%20L%20563%20617%20L%20596%20572%20L%20647%20509%20L%20636%20515%20L%20562%20609%20L%20541%20630%20L%20520%20645%20L%20502%20653%20L%20490%20653%20L%20536%20590%20L%20513%20617%20L%20478%20651%20L%20454%20665%20L%20440%20669%20L%20436%20667%20L%20488%20596%20L%20459%20630%20L%20436%20653%20L%20411%20671%20L%20392%20678%20L%20372%20701%20L%20319%20772%20L%20289%20820%20L%20281%20838%20L%20282%20844%20L%20295%20841%20L%20324%20825%20L%20326%20826%20L%20289%20878%20L%20242%20954%20L%20209%201016%20L%20193%201056%20L%20191%201069%20L%20192%201071%20L%20196%201071%20L%20219%201056%20L%20303%20983%20L%20305%20984%20L%20255%201057%20L%20234%201094%20L%20228%201111%20L%20228%201124%20L%20234%201132%20L%20240%201134%20L%20254%201134%20L%20275%201128%20L%20279%201133%20L%20291%201137%20L%20316%201136%20L%20344%201128%20L%20364%201118%20L%20389%201101%20L%20403%201089%20L%20427%201064%20L%20447%201038%20L%20463%201013%20L%20489%20993%20L%20594%20901%20L%20595%20899%20L%20593%20894%20L%20588%20891%20L%20567%20868%20L%20569%20865%20L%20576%20867%20L%20586%20873%20L%20589%20867%20L%20607%20867%20L%20619%20880%20L%20622%20887%20L%20626%20891%20L%20624%20889%20L%20626%20886%20L%20666%20870%20L%20705%20909%20L%20710%20905%20L%20713%20905%20L%20716%20908%20L%20716%20911%20L%20712%20916%20L%20728%20932%20L%20730%20939%20L%20727%20943%20L%20717%20944%20L%20710%20949%20L%20712%20948%20L%20725%20951%20L%20739%20963%20L%20740%20961%20L%20756%20960%20L%20774%20966%20L%20784%20975%20L%20789%20983%20L%20800%20987%20L%20802%20991%20L%20802%201005%20L%20799%201012%20L%20806%201008%20L%20811%201002%20L%20815%20993%20L%20813%20968%20L%20812%20973%20L%20807%20971%20L%20796%20976%20L%20791%20973%20L%20788%20967%20L%20779%20958%20L%20767%20952%20L%20762%20941%20L%20756%20940%20L%20751%20932%20L%20749%20931%20L%20743%20936%20L%20738%20936%20L%20736%20933%20L%20741%20925%20L%20739%20915%20L%20742%20912%20L%20745%20914%20L%20702%20865%20L%20702%20863%20L%20717%20841%20L%20719%20842%20L%20709%20861%20L%20746%20837%20L%20783%20807%20L%20826%20764%20L%20851%20732%20L%20853%20734%20L%20846%20754%20L%20851%20751%20L%20874%20728%20L%20890%20708%20L%20908%20681%20L%20938%20621%20L%20960%20560%20L%20971%20521%20L%20979%20481%20L%20982%20444%20L%20977%20405%20L%20970%20382%20L%20966%20375%20L%20968%20374%20L%20974%20381%20L%20975%20368%20L%20974%20372%20L%20968%20364%20L%20966%20354%20L%20957%20337%20Z%20M%20247%201077%20L%20251%201085%20L%20246%201088%20L%20245%201091%20L%20240%201092%20L%20239%201085%20L%20241%201081%20Z%20M%20370%20935%20L%20371%20937%20L%20326%20997%20L%20301%201034%20L%20289%201044%20L%20286%201042%20L%20283%201045%20L%20277%201045%20L%20273%201043%20L%20264%201052%20L%20261%201049%20L%20270%201037%20L%20271%201038%20L%20281%201027%20L%20293%201010%20L%20326%20971%20Z%20M%20726%20921%20L%20728%20921%20L%20731%20926%20L%20729%20933%20L%20722%20926%20Z%20M%20729%20897%20L%20734%20902%20L%20732%20906%20L%20726%20902%20L%20726%20899%20Z%20M%20715%20882%20L%20720%20886%20L%20718%20890%20L%20711%20887%20Z%20M%20605%20762%20L%20608%20761%20L%20607%20760%20L%20609%20757%20L%20610%20759%20L%20617%20761%20L%20620%20764%20L%20611%20770%20L%20607%20770%20L%20606%20765%20L%20608%20765%20Z%20M%20611%20754%20L%20617%20750%20L%20620%20751%20L%20621%20749%20L%20625%20749%20L%20628%20752%20L%20628%20756%20L%20623%20761%20Z%20M%20549%20710%20L%20551%20713%20L%20551%20722%20L%20506%20774%20L%20403%20878%20L%20309%20963%20L%20307%20961%20L%20313%20953%20L%20322%20945%20L%20340%20922%20L%20375%20885%20Z%20M%20695%20704%20L%20696%20708%20L%20698%20709%20L%20695%20710%20L%20695%20713%20L%20692%20715%20L%20688%20710%20Z%20M%20704%20694%20L%20706%20695%20L%20706%20698%20L%20710%20698%20L%20713%20703%20L%20708%20708%20L%20707%20714%20L%20705%20716%20L%20701%20716%20L%20697%20708%20L%20699%20706%20L%20697%20705%20L%20701%20701%20L%20704%20705%20L%20706%20704%20L%20706%20700%20L%20702%20697%20Z%20M%20552%20678%20L%20554%20681%20L%20552%20701%20L%20465%20787%20L%20361%20883%20L%20316%20927%20L%20253%20993%20L%20211%201042%20L%20211%201036%20L%20222%201011%20L%20261%20942%20L%20292%20898%20L%20338%20843%20L%20374%20807%20L%20387%20807%20L%20403%20801%20L%20419%20792%20L%20456%20766%20L%20500%20728%20Z%20M%20704%20654%20L%20706%20658%20L%20711%20658%20L%20714%20661%20L%20715%20673%20L%20713%20676%20L%20705%20676%20L%20702%20674%20L%20704%20677%20L%20704%20681%20L%20702%20682%20L%20704%20685%20L%20700%20686%20L%20694%20678%20L%20691%20678%20L%20688%20674%20L%20692%20670%20L%20692%20664%20L%20694%20661%20Z%20M%20565%20642%20L%20558%20663%20L%20545%20677%20L%20494%20726%20L%20443%20767%20L%20401%20792%20L%20392%20795%20L%20387%20794%20L%20405%20766%20L%20455%20707%20L%20388%20767%20L%20355%20794%20L%20304%20827%20L%20299%20826%20L%20302%20817%20L%20316%20795%20L%20360%20739%20L%20398%20700%20L%20425%20677%20L%20428%20679%20L%20443%20679%20L%20461%20673%20L%20476%20664%20L%20493%20666%20L%20517%20657%20L%20542%20641%20L%20546%20643%20Z%20M%20563%20221%20L%20572%20225%20L%20571%20223%20L%20574%20220%20L%20585%20217%20L%20596%20218%20L%20607%20215%20L%20653%20214%20L%20706%20218%20L%20749%20224%20L%20749%20226%20L%20735%20233%20L%20732%20238%20L%20732%20249%20L%20693%20242%20L%20620%20239%20L%20672%20251%20L%20688%20260%20L%20701%20274%20L%20706%20287%20L%20704%20301%20L%20707%20297%20L%20711%20300%20L%20713%20309%20L%20720%20324%20L%20723%20327%20L%20724%20308%20L%20726%20304%20L%20735%20318%20L%20757%20341%20L%20753%20319%20L%20754%20313%20L%20760%20317%20L%20786%20345%20L%20784%20324%20L%20775%20300%20L%20779%20300%20L%20800%20317%20L%20800%20312%20L%20787%20283%20L%20772%20264%20L%20778%20263%20L%20800%20271%20L%20803%20270%20L%20770%20236%20L%20772%20234%20L%20797%20234%20L%20807%20230%20L%20801%20230%20L%20800%20228%20L%20811%20218%20L%20818%20203%20L%20818%20193%20L%20812%20179%20L%20798%20168%20L%20784%20166%20L%20760%20173%20L%20747%20173%20L%20712%20163%20L%20718%20157%20L%20703%20171%20L%20711%20173%20L%20720%20178%20L%20723%20182%20L%20720%20186%20L%20695%20190%20L%20680%20190%20L%20670%20193%20L%20656%20193%20L%20687%20204%20L%20729%20209%20L%20742%20214%20L%20753%20223%20L%20752%20224%20L%20729%20219%20L%20669%20212%20L%20610%20213%20L%20576%20218%20L%20565%20221%20L%20565%20219%20Z%20M%20771%20189%20L%20772%20201%20L%20775%20207%20L%20780%20212%20L%20787%20215%20L%20796%20216%20L%20796%20218%20L%20784%20219%20L%20776%20215%20L%20771%20210%20L%20768%20204%20L%20768%20194%20Z%20M%20788%20181%20L%20793%20182%20L%20797%20187%20L%20796%20192%20L%20790%20196%20L%20786%20195%20L%20782%20191%20L%20782%20186%20Z'/%3e%3c/g%3e%3c/svg%3e`,Ue=o((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.fragment`);function r(e,n,r){var i=null;if(r!==void 0&&(i=``+r),n.key!==void 0&&(i=``+n.key),`key`in n)for(var a in r={},n)a!==`key`&&(r[a]=n[a]);else r=n;return n=r.ref,{$$typeof:t,type:e,key:i,ref:n===void 0?null:n,props:r}}e.Fragment=n,e.jsx=r,e.jsxs=r})),We=o(((e,t)=>{t.exports=Ue()})),N=We();function Ge({className:e}){return(0,N.jsx)(`span`,{className:`block overflow-hidden rounded-[20.7%] bg-accent ${e??``}`,children:(0,N.jsx)(`img`,{src:He,alt:``,"aria-hidden":`true`,className:`h-full w-full`})})}function Ke({maximized:e}){return(0,N.jsx)(`svg`,{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,focusable:`false`,className:`h-4 w-4`,children:e?(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(`path`,{d:`M8 3v3a2 2 0 0 1-2 2H3`}),(0,N.jsx)(`path`,{d:`M21 8h-3a2 2 0 0 1-2-2V3`}),(0,N.jsx)(`path`,{d:`M3 16h3a2 2 0 0 1 2 2v3`}),(0,N.jsx)(`path`,{d:`M16 21v-3a2 2 0 0 1 2-2h3`})]}):(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(`path`,{d:`M8 3H5a2 2 0 0 0-2 2v3`}),(0,N.jsx)(`path`,{d:`M21 8V5a2 2 0 0 0-2-2h-3`}),(0,N.jsx)(`path`,{d:`M3 16v3a2 2 0 0 0 2 2h3`}),(0,N.jsx)(`path`,{d:`M16 21h3a2 2 0 0 0 2-2v-3`})]})})}function qe({open:e}){return(0,N.jsx)(`svg`,{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.5`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,focusable:`false`,className:`h-3.5 w-3.5 shrink-0 transition-transform ${e?`rotate-90`:``}`,children:(0,N.jsx)(`path`,{d:`m9 18 6-6-6-6`})})}function Je({className:e=`h-4 w-4`}){return(0,N.jsxs)(`svg`,{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,focusable:`false`,className:`shrink-0 ${e}`,children:[(0,N.jsx)(`path`,{d:`M18 6 6 18`}),(0,N.jsx)(`path`,{d:`m6 6 12 12`})]})}function Ye({className:e=`h-4 w-4`}){return(0,N.jsxs)(`svg`,{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,focusable:`false`,className:`shrink-0 ${e}`,children:[(0,N.jsx)(`path`,{d:`M5 12h14`}),(0,N.jsx)(`path`,{d:`M12 5v14`})]})}function Xe(){return(0,N.jsxs)(`svg`,{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,focusable:`false`,className:`h-4 w-4`,children:[(0,N.jsx)(`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`}),(0,N.jsx)(`path`,{d:`M12 3v18`})]})}function Ze(){return(0,N.jsxs)(`svg`,{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,focusable:`false`,className:`h-4 w-4`,children:[(0,N.jsx)(`path`,{d:`M2 12s3.5-7 10-7 10 7 10 7-3.5 7-10 7-10-7-10-7Z`}),(0,N.jsx)(`circle`,{cx:`12`,cy:`12`,r:`3`})]})}function Qe(){return(0,N.jsxs)(`svg`,{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,focusable:`false`,className:`h-4 w-4`,children:[(0,N.jsx)(`circle`,{cx:`11`,cy:`11`,r:`8`}),(0,N.jsx)(`path`,{d:`m21 21-4.3-4.3`})]})}function $e({className:e=`h-4 w-4`}){return(0,N.jsxs)(`svg`,{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,focusable:`false`,className:`shrink-0 ${e}`,children:[(0,N.jsx)(`path`,{d:`M3 6h.01`}),(0,N.jsx)(`path`,{d:`M3 12h.01`}),(0,N.jsx)(`path`,{d:`M3 18h.01`}),(0,N.jsx)(`path`,{d:`M8 6h13`}),(0,N.jsx)(`path`,{d:`M8 12h13`}),(0,N.jsx)(`path`,{d:`M8 18h13`})]})}function et({className:e=`h-4 w-4`}){return(0,N.jsxs)(`svg`,{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,focusable:`false`,className:`shrink-0 ${e}`,children:[(0,N.jsx)(`path`,{d:`M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z`}),(0,N.jsx)(`path`,{d:`M14 2v4a2 2 0 0 0 2 2h4`}),(0,N.jsx)(`path`,{d:`M10 9H8`}),(0,N.jsx)(`path`,{d:`M16 13H8`}),(0,N.jsx)(`path`,{d:`M16 17H8`})]})}function tt({className:e=`h-4 w-4`}){return(0,N.jsxs)(`svg`,{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,focusable:`false`,className:`shrink-0 ${e}`,children:[(0,N.jsx)(`path`,{d:`m4 17 6-6-6-6`}),(0,N.jsx)(`path`,{d:`M12 19h8`})]})}function nt({repos:e,currentId:t,onSelect:n,onCloseProject:r,onOpenPicker:i,className:a=``}){let[o,s]=(0,v.useState)(!1),c=(0,v.useRef)(null),l=e.find(e=>e.id===t);return(0,v.useEffect)(()=>{if(!o)return;let e=e=>{e.key===`Escape`&&(s(!1),c.current?.focus())};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[o]),(0,N.jsxs)(`div`,{className:`relative ${a}`,children:[(0,N.jsxs)(`button`,{ref:c,onClick:()=>s(e=>!e),"aria-haspopup":`menu`,"aria-expanded":o,title:l?.display_path??`Select a project`,className:`flex max-w-[9rem] items-center gap-1 rounded-sm bg-ink-700 py-0.5 pl-2 pr-1 text-ink-50`,children:[(0,N.jsx)(`span`,{className:`truncate`,children:l?.name??`No project`}),(0,N.jsx)(qe,{open:o})]}),o&&(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(`div`,{className:`fixed inset-0 z-40`,onClick:()=>s(!1)}),(0,N.jsxs)(`div`,{role:`menu`,className:`absolute left-0 z-50 mt-1 max-h-[70vh] w-56 max-w-[80vw] overflow-y-auto rounded-md border border-ink-700 bg-ink-900 py-1 shadow-lg`,children:[e.length===0&&(0,N.jsx)(`p`,{className:`px-3 py-1.5 text-ink-400`,children:`No projects open.`}),e.map(e=>(0,N.jsxs)(`div`,{className:`flex items-center ${e.id===t?`bg-ink-700 text-ink-50`:`text-ink-200`}`,children:[(0,N.jsx)(`button`,{role:`menuitem`,onClick:()=>{n(e.id),s(!1)},title:e.display_path,className:`min-w-0 flex-1 truncate py-1.5 pl-3 pr-1 text-left hover:text-accent`,children:e.name}),(0,N.jsx)(`button`,{onClick:()=>r(e.id),"aria-label":`close ${e.name}`,title:`Close project`,className:`mr-1 flex h-6 w-6 shrink-0 items-center justify-center rounded-sm text-ink-400 hover:text-removed`,children:(0,N.jsx)(Je,{className:`h-3.5 w-3.5`})})]},e.id)),(0,N.jsx)(`div`,{className:`my-1 border-t border-ink-800`}),(0,N.jsxs)(`button`,{role:`menuitem`,onClick:()=>{i(),s(!1)},className:`flex w-full items-center gap-1 px-3 py-1.5 text-left text-ink-400 hover:text-ink-200`,children:[(0,N.jsx)(Ye,{className:`h-3.5 w-3.5`}),`open`]})]})]})]})}function rt({repos:e,repo:t,setRepo:n,setPane:r,closeRepo:i,setPickerOpen:a,accent:o,next:s,cycle:c,draggingRepo:l,dragOverRepo:u,onRepoDragStart:d,onRepoDragMove:f,onRepoDragEnd:p}){return(0,N.jsxs)(`header`,{className:`flex items-center gap-2 border-b border-ink-700 bg-ink-900 px-[12.8px] py-[8.8px]`,children:[(0,N.jsx)(Ge,{className:`h-[22px] w-[22px] shrink-0`}),(0,N.jsx)(`span`,{className:`text-[16px] font-medium tracking-[0.04em] text-ink-50`,children:`nightcrow`}),(0,N.jsx)(`span`,{className:`hidden font-sans text-[10px] uppercase tracking-[0.18em] text-ink-400 sm:inline`,children:`web viewer`}),(0,N.jsx)(nt,{className:`md:hidden`,repos:e,currentId:t,onSelect:e=>{n(e),r()},onCloseProject:i,onOpenPicker:()=>a(!0)}),(0,N.jsx)(`nav`,{className:`-my-[8.8px] hidden items-stretch self-stretch overflow-x-auto pl-1 md:flex`,children:e.map(a=>(0,N.jsxs)(`div`,{"data-repo-id":a.id,onPointerDown:e=>d(e,a.id),onPointerMove:f,onPointerUp:p,onPointerCancel:p,onLostPointerCapture:p,className:`flex items-center border-r border-ink-700 whitespace-nowrap ${e.length>1?`touch-none`:``} ${l===a.id?`opacity-60`:``} ${u===a.id?`bg-ink-800 ring-1 ring-inset ring-accent`:``} ${a.id===t?`bg-ink-950 text-ink-50 shadow-[inset_0_2px_0_0_var(--color-accent)]`:`text-ink-400 hover:bg-ink-850 hover:text-ink-200`}`,title:a.display_path,children:[(0,N.jsx)(`button`,{onClick:()=>{n(a.id),r()},className:`self-stretch pl-3 pr-1`,children:a.name}),(0,N.jsx)(`button`,{onClick:e=>{e.stopPropagation(),i(a.id)},"data-tab-close":!0,title:`Close project`,"aria-label":`close ${a.name}`,className:`mr-1 flex h-5 w-5 items-center justify-center rounded-sm text-ink-400 hover:bg-ink-700 hover:text-removed`,children:(0,N.jsx)(Je,{className:`h-3.5 w-3.5`})})]},a.id))}),(0,N.jsxs)(`button`,{onClick:()=>a(!0),title:`Open a project`,className:`hidden shrink-0 items-center gap-1 rounded-sm px-2 py-0.5 text-ink-400 hover:text-ink-200 md:inline-flex`,children:[(0,N.jsx)(Ye,{className:`h-3.5 w-3.5`}),`open`]}),(0,N.jsx)(`button`,{onClick:c,title:`Accent: ${o.name} (click for ${s.name})`,"aria-label":`accent colour: ${o.name}, click for ${s.name}`,className:`ml-auto flex h-6 w-6 shrink-0 items-center justify-center rounded-sm`,children:(0,N.jsx)(`span`,{"aria-hidden":`true`,className:`h-3 w-3 rounded-full bg-accent ring-1 ring-ink-600`})}),(0,N.jsx)(`a`,{href:`/logout`,className:`pl-2 text-ink-400 hover:text-ink-200`,children:`sign out`})]})}var it=180;function at({repo:e,authed:t,tab:n,filter:r,filterOpen:i,handle:a}){let[o,s]=(0,v.useState)({}),[c,l]=(0,v.useState)(new Set),[u,d]=(0,v.useState)([]),[f,p]=(0,v.useState)(!1),[m,h]=(0,v.useState)(!1);(0,v.useEffect)(()=>{!e||!t||n!==`tree`||E.tree(e,``).then(e=>s(t=>({...t,"":e.entries}))).catch(a)},[e,t,n,a]),(0,v.useEffect)(()=>{if(!e||!t||n!==`tree`||!i||!r){d([]),p(!1),h(!1);return}h(!0);let o=!0,s=setTimeout(()=>{E.treeSearch(e,r).then(e=>{o&&(d(e.matches),p(e.truncated))}).catch(e=>{o&&a(e)}).finally(()=>{o&&h(!1)})},it);return()=>{o=!1,clearTimeout(s)}},[e,t,n,r,i,a]);let g=(0,v.useCallback)(t=>{e&&E.tree(e,t).then(e=>s(n=>({...n,[t]:e.entries}))).catch(a)},[e,a]);return{treeChildren:o,setTreeChildren:s,treeExpanded:c,setTreeExpanded:l,treeMatches:u,treeTruncated:f,treeSearchLoading:m,loadTreeChildren:g,toggleTreeDir:(0,v.useCallback)(e=>{let t=!c.has(e);l(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n}),t&&!(e in o)&&g(e)},[c,o,g]),revealTreeDir:(0,v.useCallback)(e=>{let t=e.split(`/`),n=[],r=``;for(let e of t)r=r?`${r}/${e}`:e,n.push(r);l(e=>{let t=new Set(e);return n.forEach(e=>t.add(e)),t}),n.forEach(e=>{e in o||g(e)})},[o,g])}}function ot(e,t){let n=[],r=(i,a)=>{for(let o of e[i]??[]){let e=i?`${i}/${o.name}`:o.name;n.push({path:e,name:o.name,is_dir:o.is_dir,depth:a}),o.is_dir&&t.has(e)&&r(e,a+1)}};return r(``,0),n}function st({path:e,from:t,className:n}){return(0,N.jsx)(`span`,{className:`whitespace-nowrap ${n??``}`,title:t?`${t} → ${e}`:e,children:t?`${t} → ${e}`:e})}function ct(e){let t=Math.max(0,Math.floor(Date.now()/1e3-e));return t<60?`${t}s`:t<3600?`${Math.floor(t/60)}m`:t<86400?`${Math.floor(t/3600)}h`:t<86400*30?`${Math.floor(t/86400)}d`:t<86400*365?`${Math.floor(t/(86400*30))}mo`:`${Math.floor(t/(86400*365))}y`}function lt(e){return e===`+`?`bg-added/10`:e===`-`?`bg-removed/10`:``}function ut(e){return e===`?`?`text-ink-400`:e===`D`?`text-removed`:e===`A`?`text-added`:`text-accent`}function P({status:e,files:t,now:n,hotWindowMs:r,openDiff:i}){return e===null?(0,N.jsx)(`li`,{className:`px-3 py-2 text-ink-400`,children:`Loading…`}):(0,N.jsx)(N.Fragment,{children:t.map(e=>(0,N.jsx)(`li`,{children:(0,N.jsxs)(`button`,{onClick:()=>i(e.path),className:`flex w-max min-w-full gap-2 px-3 py-0.5 text-left hover:bg-ink-850`,children:[(0,N.jsxs)(`span`,{className:`shrink-0`,children:[(0,N.jsx)(`span`,{className:ut(e.index),children:e.index===` `?` `:e.index}),(0,N.jsx)(`span`,{className:ut(e.worktree),children:e.worktree===` `?` `:e.worktree})]}),(0,N.jsx)(st,{path:e.path,from:e.old_path,className:we[Se(e.mtime,n,r)]})]})},e.path))})}function dt({visibleCommits:e,commits:t,aheadOids:n,commitDrillDown:r,visibleCommitFiles:i,logDone:a,logStalled:o,logPagingPaused:s,setLogStalled:c,logSentinelRef:l,openCommitFiles:u,openCommit:d,openCommitFileDiff:f,setCommitDrillDown:p,setPaneEmpty:m,bumpPaneRequest:h}){return(0,N.jsxs)(N.Fragment,{children:[!r&&e.map(e=>(0,N.jsx)(`li`,{children:(0,N.jsxs)(`button`,{onClick:()=>void u(e),title:`${e.author} · ${e.summary}`,className:`flex w-max min-w-full items-baseline gap-2 px-3 py-0.5 text-left hover:bg-ink-850`,children:[(0,N.jsx)(`span`,{className:`w-2 shrink-0 text-added`,children:n.has(e.oid)?`↑`:``}),(0,N.jsx)(`span`,{className:`shrink-0 text-accent`,children:e.short_id}),(0,N.jsx)(`span`,{className:`w-10 shrink-0 text-right text-ink-400`,children:ct(e.time)}),(0,N.jsx)(`span`,{className:`max-w-[6rem] shrink-0 truncate text-ink-400`,children:e.author}),(0,N.jsx)(`span`,{className:`whitespace-nowrap`,children:e.summary})]})},e.oid)),!r&&!a&&!o&&!s&&(0,N.jsx)(`li`,{ref:l,className:`px-3 py-1 text-ink-400`,"aria-hidden":`true`,children:`loading…`}),!r&&!a&&!o&&s&&(0,N.jsxs)(`li`,{className:`px-3 py-1 text-ink-400`,children:[`filtering `,t.length,` loaded commits — clear the filter to load more`]}),!r&&o&&(0,N.jsx)(`li`,{className:`px-3 py-1`,children:(0,N.jsx)(`button`,{onClick:()=>c(!1),className:`text-ink-400 hover:text-accent`,children:`could not load more — retry`})}),r&&(0,N.jsxs)(N.Fragment,{children:[(0,N.jsxs)(`li`,{className:`sticky top-0 z-10 flex w-max min-w-full items-center gap-1 bg-ink-900 px-2 py-1 text-ink-400`,children:[(0,N.jsx)(`button`,{onClick:()=>{h(),p(null),m()},className:`rounded-sm px-1 hover:text-accent`,title:`Back to commit log`,children:`< log`}),(0,N.jsx)(`span`,{className:`text-ink-600`,children:`·`}),(0,N.jsx)(`span`,{className:`shrink-0 text-accent`,children:r.commit.short_id}),(0,N.jsx)(`button`,{onClick:()=>d(r.commit.oid),className:`rounded-sm px-1 hover:text-accent`,title:`Show the complete commit diff`,children:`all changes`})]}),i.map(e=>(0,N.jsx)(`li`,{children:(0,N.jsxs)(`button`,{onClick:()=>f(r.commit.oid,e.path),className:`flex w-max min-w-full gap-2 px-3 py-0.5 text-left hover:bg-ink-850`,children:[(0,N.jsx)(`span`,{className:ut(e.index),children:e.index}),(0,N.jsx)(st,{path:e.path,from:e.old_path})]})},e.path)),r.files.length===0&&(0,N.jsx)(`li`,{className:`px-3 py-2 text-ink-400`,children:`No changed files.`}),r.files.length>0&&i.length===0&&(0,N.jsx)(`li`,{className:`px-3 py-2 text-ink-400`,children:`No matching files.`}),r.truncated&&(0,N.jsxs)(`li`,{className:`px-3 py-1 text-accent`,children:[`Showing the first `,r.files.length,` files.`]})]})]})}function ft({treeSearching:e,treeMatches:t,treeTruncated:n,treeSearchLoading:r,treeRows:i,treeExpanded:a,openFile:o,revealTreeDir:s,toggleTreeDir:c}){return e?(0,N.jsxs)(N.Fragment,{children:[t.map(e=>(0,N.jsx)(`li`,{children:(0,N.jsx)(`button`,{onClick:()=>{e.is_dir?s(e.path):o(e.path)},title:e.path,className:`w-max min-w-full whitespace-nowrap px-3 py-0.5 text-left hover:bg-ink-850`,children:e.is_dir?(0,N.jsxs)(`span`,{className:`text-accent`,children:[e.path,`/`]}):e.path})},e.path)),t.length===0&&(0,N.jsx)(`li`,{className:`px-3 py-0.5 text-ink-400`,children:r?`searching…`:`no matches`}),n&&(0,N.jsxs)(`li`,{className:`px-3 py-0.5 text-ink-400`,children:[`showing the first `,t.length,` matches`]})]}):(0,N.jsx)(N.Fragment,{children:i.map(e=>(0,N.jsx)(`li`,{children:(0,N.jsxs)(`button`,{onClick:()=>e.is_dir?c(e.path):o(e.path),title:e.path,style:{paddingLeft:`${e.depth*.75+.5}rem`},className:`flex w-max min-w-full items-center gap-1 py-0.5 pr-3 text-left hover:bg-ink-850`,children:[e.is_dir?(0,N.jsx)(qe,{open:a.has(e.path)}):(0,N.jsx)(`span`,{className:`h-3.5 w-3.5 shrink-0`}),(0,N.jsx)(`span`,{className:`whitespace-nowrap ${e.is_dir?`text-accent`:``}`,children:e.is_dir?`${e.name}/`:e.name})]})},e.path))})}function pt(e){let{tab:t,setTab:n,filter:r,setFilter:i,filterOpen:a,setFilterOpen:o,status:s,files:c,now:l,hotWindowMs:u,setPane:d,openDiff:f,openFile:p,openCommit:m,openCommitFileDiff:h,openCommitFiles:g,repo:_,authed:v,handle:y,sidebarRef:b,draggingSidebar:x,onSidebarDragStart:ee,onSidebarDragMove:S,onSidebarDragEnd:C,onSidebarDragCancel:te,filesMax:w,bumpPaneRequest:ne,commits:T,logDone:E,logStalled:re,setLogStalled:D,commitDrillDown:ie,setCommitDrillDown:ae,resetLog:oe,logSentinelRef:se,visibleCommits:O,logPagingPaused:k,aheadOids:ce,visibleCommitFiles:le,mobileView:ue}=e,A=at({repo:_,authed:v,tab:t,filter:r,filterOpen:a,handle:y}),j=t===`tree`&&a&&r!==``,M=ot(A.treeChildren,A.treeExpanded);return(0,N.jsxs)(`section`,{ref:b,className:`relative min-h-0 flex-col overflow-hidden ${ue===`files`?`flex`:`hidden md:flex`} ${w?`md:flex`:`border-ink-700 md:border-r`}`,children:[!w&&(0,N.jsx)(`div`,{role:`separator`,"aria-orientation":`vertical`,"aria-label":`Resize the file sidebar (double-click to reset)`,title:`Drag to resize · double-click to reset`,onPointerDown:ee,onPointerMove:S,onPointerUp:C,onPointerCancel:te,onLostPointerCapture:C,className:`absolute -right-px top-0 z-10 hidden h-full w-1.5 cursor-col-resize touch-none md:block ${x?`bg-accent`:`hover:bg-accent`}`}),(0,N.jsxs)(`div`,{className:`flex shrink-0 items-stretch border-b border-ink-700 px-2`,children:[[`status`,`log`,`tree`].map(e=>(0,N.jsx)(`button`,{onClick:()=>{e!==t&&(ne(),t===`log`&&(ae(null),oe()),n(e),d({kind:`empty`}))},"aria-current":e===t?`page`:void 0,className:`-mb-px border-b-2 px-2 py-1 ${e===t?`border-accent text-ink-50`:`border-transparent text-ink-400 hover:text-ink-200`}`,children:e},e)),(0,N.jsx)(`button`,{onClick:()=>{a&&i(``),o(e=>!e)},"aria-pressed":a,title:a?`Hide the filter`:`Filter the list`,"aria-label":a?`Hide the filter`:`Filter the list`,className:`my-1 ml-auto flex shrink-0 items-center rounded-sm px-1.5 hover:text-accent ${a?`text-ink-50`:`text-ink-400`}`,children:(0,N.jsx)(Qe,{})})]}),a&&(0,N.jsx)(`input`,{value:r,onChange:e=>i(e.target.value),placeholder:`filter…`,autoFocus:!0,className:`mx-2 mb-1 shrink-0 rounded-sm bg-ink-850 px-2 py-1 outline-none placeholder:text-ink-400 focus:ring-1 focus:ring-accent`}),(0,N.jsxs)(`ul`,{className:`min-h-0 flex-1 overflow-auto`,children:[t===`status`&&(0,N.jsx)(P,{status:s,files:c,now:l,hotWindowMs:u,openDiff:f}),t===`log`&&(0,N.jsx)(dt,{visibleCommits:O,commits:T,aheadOids:ce,commitDrillDown:ie,visibleCommitFiles:le,logDone:E,logStalled:re,logPagingPaused:k,setLogStalled:D,logSentinelRef:se,openCommitFiles:g,openCommit:m,openCommitFileDiff:h,setCommitDrillDown:ae,setPaneEmpty:()=>d({kind:`empty`}),bumpPaneRequest:ne}),t===`tree`&&(0,N.jsx)(ft,{treeSearching:j,treeMatches:A.treeMatches,treeTruncated:A.treeTruncated,treeSearchLoading:A.treeSearchLoading,treeRows:M,treeExpanded:A.treeExpanded,openFile:p,revealTreeDir:A.revealTreeDir,toggleTreeDir:A.toggleTreeDir})]})]})}var mt=`nightcrow.viewer.diffLayout`,ht=768;function gt(e){let t=[],n=[],r=[],i=()=>{let e=Math.max(n.length,r.length);for(let i=0;i{let e;try{e=window.matchMedia(`(min-width: ${ht}px)`)}catch{return}let n=e=>t(e.matches);return e.addEventListener(`change`,n),()=>e.removeEventListener(`change`,n)},[]),e}function xt(){let[e,t]=(0,v.useState)(_t),n=bt(),r=(0,v.useCallback)(()=>{t(e=>{let t=e===`split`?`unified`:`split`;return vt(t),t})},[]);return{layout:e,effective:e===`split`&&n?`split`:`unified`,toggle:r}}var St=[`.md`,`.markdown`];function Ct(e){let t=e.toLowerCase();return St.some(e=>t.endsWith(e))}function wt(e){return e.map(e=>e.map(e=>e.t).join(``)).join(` +`)}function Tt({line:e}){return(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(`span`,{className:`text-ink-400 select-none`,children:e.kind}),e.spans.map((e,t)=>(0,N.jsx)(`span`,{style:{color:e.c},children:e.t},t))]})}function Et({line:e}){return e===null?(0,N.jsx)(`div`,{className:`whitespace-pre bg-ink-900/40 px-3`,children:` `}):(0,N.jsx)(`div`,{className:`whitespace-pre px-3 ${lt(e.kind)}`,children:(0,N.jsx)(Tt,{line:e})})}function Dt({cells:e,border:t}){return(0,N.jsx)(`div`,{className:`min-w-0 flex-1 basis-1/2 overflow-x-auto ${t?`border-l border-ink-800`:``}`,children:(0,N.jsx)(`div`,{className:`w-max min-w-full`,children:e.map((e,t)=>(0,N.jsx)(Et,{line:e},t))})})}function Ot({lines:e}){let t=gt(e);return(0,N.jsxs)(`div`,{className:`flex`,children:[(0,N.jsx)(Dt,{cells:t.map(e=>e.left),border:!1}),(0,N.jsx)(Dt,{cells:t.map(e=>e.right),border:!0})]})}function kt({diff:e,split:t}){return(0,N.jsxs)(`div`,{className:`p-1`,children:[e.hunks.length===0&&(0,N.jsx)(`p`,{className:`p-3 text-ink-400`,children:`No changes.`}),e.hunks.map((e,n)=>(0,N.jsxs)(`div`,{className:`mb-2`,children:[(0,N.jsxs)(`div`,{className:`bg-ink-850 px-3 py-0.5 text-ink-400`,children:[e.file_path?`${e.file_path} `:``,e.header]}),t?(0,N.jsx)(Ot,{lines:e.lines}):e.lines.map((e,t)=>(0,N.jsx)(`div`,{className:`px-3 whitespace-pre ${lt(e.kind)}`,children:(0,N.jsx)(Tt,{line:e})},t))]},n)),e.truncated&&(0,N.jsx)(`p`,{className:`p-3 text-accent`,children:`Diff truncated — it exceeded the server's size ceiling.`})]})}var At=`modulepreload`,jt=function(e,t){return new URL(e,t).href},Mt={},Nt=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}function s(e){return import.meta.resolve?import.meta.resolve(e):new URL(e,import.meta.url).href}r=o(t.map(t=>{if(t=jt(t,n),t=s(t),t in Mt)return;Mt[t]=!0;let r=t.endsWith(`.css`);for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.href===t&&(!r||i.rel===`stylesheet`))return}let i=document.createElement(`link`);if(i.rel=r?`stylesheet`:At,r||(i.as=`script`),i.crossOrigin=``,i.href=t,a&&i.setAttribute(`nonce`,a),document.head.appendChild(i),r)return new Promise((e,n)=>{i.addEventListener(`load`,e),i.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},Pt=(0,v.lazy)(()=>Nt(()=>import(`./Markdown-CuElJdJA.js`).then(e=>({default:e.MarkdownView})),__vite__mapDeps([0,1]),import.meta.url));function Ft({pane:e,mdRendered:t,setMdRendered:n,filesMax:r,setMaximized:i,status:a,className:o=``}){let s=xt();return(0,N.jsxs)(`section`,{className:`min-h-0 min-w-0 flex-col ${o}`,children:[(0,N.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2 bg-ink-850 px-3 py-0.5 text-ink-400`,children:[e.kind===`file`&&(0,N.jsx)(st,{path:e.value.path}),(0,N.jsxs)(`div`,{className:`ml-auto flex shrink-0 items-center gap-1`,children:[e.kind===`diff`&&(0,N.jsx)(`button`,{onClick:s.toggle,"aria-pressed":s.layout===`split`,title:s.layout===`split`?`Switch to unified diff`:`Switch to split diff`,"aria-label":s.layout===`split`?`Switch to unified diff`:`Switch to split diff`,className:`flex shrink-0 items-center rounded-sm px-1.5 py-0.5 hover:text-accent ${s.layout===`split`?`text-accent`:``}`,children:(0,N.jsx)(Xe,{})}),e.kind===`file`&&Ct(e.value.path)&&(0,N.jsx)(`button`,{onClick:()=>n(e=>!e),"aria-pressed":t,title:t?`Show raw source`:`Show rendered markdown`,"aria-label":t?`Show raw source`:`Show rendered markdown`,className:`flex shrink-0 items-center rounded-sm px-1.5 py-0.5 hover:text-accent ${t?`text-accent`:``}`,children:(0,N.jsx)(Ze,{})}),(0,N.jsx)(`button`,{onClick:()=>i(r?`none`:`files`),"aria-pressed":r,title:r?`Restore the layout`:`Maximize the file pane`,"aria-label":r?`Restore the layout`:`Maximize the file pane`,className:`hidden shrink-0 items-center rounded-sm px-1.5 py-0.5 hover:text-accent md:flex`,children:(0,N.jsx)(Ke,{maximized:r})})]})]}),(0,N.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-auto`,children:[e.kind===`empty`&&(0,N.jsx)(`p`,{className:`p-4 text-ink-400`,children:a===null?`Loading…`:`Select a file or commit.`}),e.kind===`file`&&(0,N.jsxs)(N.Fragment,{children:[Ct(e.value.path)&&t?(0,N.jsx)(v.Suspense,{fallback:(0,N.jsx)(`p`,{className:`p-4 text-ink-400`,children:`Rendering…`}),children:(0,N.jsx)(Pt,{source:wt(e.value.lines)})}):(0,N.jsx)(`pre`,{className:`p-3 whitespace-pre text-ink-200`,children:e.value.lines.map((e,t)=>(0,N.jsx)(`div`,{children:e.length===0?` `:e.map((e,t)=>(0,N.jsx)(`span`,{style:{color:e.c},children:e.t},t))},t))}),e.value.truncated&&(0,N.jsx)(`p`,{className:`p-3 text-accent`,children:`File truncated — it exceeded the server's size ceiling.`})]}),e.kind===`diff`&&(0,N.jsx)(kt,{diff:e.value,split:s.effective===`split`})]})]})}var It=(0,v.lazy)(()=>Nt(()=>import(`./Terminal-K7sK28PK.js`).then(e=>({default:e.TerminalPanel})),[],import.meta.url));function Lt(e){let{repo:t,current:n,status:r,files:i,now:a,hotWindowMs:o,pane:s,setPane:c,tab:l,setTab:u,filter:d,setFilter:f,filterOpen:p,setFilterOpen:m,openDiff:h,openFile:g,openCommit:_,openCommitFileDiff:y,openCommitFiles:b,authed:x,handle:ee,sidebarWidth:S,sidebarRef:C,draggingSidebar:te,onSidebarDragStart:w,onSidebarDragMove:ne,onSidebarDragEnd:T,onSidebarDragCancel:E,filesMax:re,bumpPaneRequest:D,commits:ie,logDone:ae,logStalled:oe,setLogStalled:se,commitDrillDown:O,setCommitDrillDown:k,resetLog:ce,logSentinelRef:le,visibleCommits:ue,logPagingPaused:A,aheadOids:j,visibleCommitFiles:M,mdRendered:de,setMdRendered:fe,maximized:me,setMaximized:he,mobileView:ge,setMobileView:_e}=e;return(0,N.jsxs)(N.Fragment,{children:[te&&(0,N.jsx)(`div`,{className:`fixed inset-0 z-50 cursor-col-resize`}),(0,N.jsxs)(`main`,{className:`grid min-h-0 grid-cols-1 md:grid-cols-[var(--nc-sidebar)_1fr] ${ge===`terminal`?`hidden md:grid`:``} ${te?`select-none`:``}`,style:{"--nc-sidebar":re?`0px`:`min(${S}px, ${pe*100}vw)`},children:[(0,N.jsx)(pt,{tab:l,setTab:u,filter:d,setFilter:f,filterOpen:p,setFilterOpen:m,status:r,files:i,now:a,hotWindowMs:o,setPane:c,openDiff:h,openFile:g,openCommit:_,openCommitFileDiff:y,openCommitFiles:b,repo:t,authed:x,handle:ee,sidebarRef:C,draggingSidebar:te,onSidebarDragStart:w,onSidebarDragMove:ne,onSidebarDragEnd:T,onSidebarDragCancel:E,filesMax:re,bumpPaneRequest:D,commits:ie,logDone:ae,logStalled:oe,setLogStalled:se,commitDrillDown:O,setCommitDrillDown:k,resetLog:ce,logSentinelRef:le,visibleCommits:ue,logPagingPaused:A,aheadOids:j,visibleCommitFiles:M,mobileView:ge}),(0,N.jsx)(Ft,{pane:s,mdRendered:de,setMdRendered:fe,filesMax:re,setMaximized:he,status:r,className:ge===`diff`?`flex`:`hidden md:flex`})]}),(0,N.jsx)(v.Suspense,{fallback:null,children:(0,N.jsx)(It,{repo:t,maximized:me===`terminal`,onToggleMaximized:()=>he(e=>e===`terminal`?`none`:`terminal`),className:ge===`terminal`?`flex`:`hidden md:flex`})}),(0,N.jsx)(`nav`,{"aria-label":`Switch view`,className:`flex shrink-0 items-stretch border-t border-ink-700 bg-ink-900 md:hidden`,children:[[`files`,`Files`,$e],[`diff`,`Diff`,et],[`terminal`,`Terminal`,tt]].map(([e,t,n])=>(0,N.jsxs)(`button`,{onClick:()=>_e(e),"aria-current":ge===e?`page`:void 0,className:`flex min-h-11 flex-1 flex-col items-center justify-center gap-0.5 py-1 text-[11px] ${ge===e?`text-accent shadow-[inset_0_2px_0_0_var(--color-accent)]`:`text-ink-400`}`,children:[(0,N.jsx)(n,{className:`h-5 w-5`}),t]},e))}),(0,N.jsxs)(`footer`,{className:`flex shrink-0 items-center gap-3 border-t border-ink-700 bg-ink-900 px-3 py-1 text-ink-400`,children:[(0,N.jsx)(`span`,{className:`truncate`,children:n?.display_path}),r?.branch&&(0,N.jsx)(`span`,{className:`text-accent`,children:r.branch}),r?.tracking&&(0,N.jsxs)(`span`,{children:[`↑`,r.tracking.ahead,` ↓`,r.tracking.behind]}),(0,N.jsx)(`span`,{className:`ml-auto`,children:r?(0,N.jsx)(`span`,{className:`text-added`,children:`● live`}):`connecting…`})]})]})}function Rt({onClose:e,onOpened:t}){let[n,r]=(0,v.useState)(null),[i,a]=(0,v.useState)(null),[o,s]=(0,v.useState)(null),[c,l]=(0,v.useState)(!1),[u,d]=(0,v.useState)(``),[f,p]=(0,v.useState)(!1),[m,h]=(0,v.useState)(0);(0,v.useEffect)(()=>{let e=!1;return E.browse(n??void 0).then(t=>{e||(a(t),s(null))}).catch(t=>{e||s(t instanceof Error?t.message:`could not browse`)}),()=>{e=!0}},[n,m]);let g=e=>r(`${i.path.replace(/\/$/,``)}/${e}`),_=async()=>{if(i){l(!0);try{t(await E.open(i.path))}catch(e){ce.error(e instanceof Error?e.message:`could not open`),l(!1)}}},y=async()=>{if(!i)return;let e=u.trim();if(e){p(!0);try{await E.mkdir(i.path,e),d(``),h(e=>e+1)}catch(e){ce.error(e instanceof Error?e.message:`could not create folder`)}finally{p(!1)}}};return(0,N.jsx)(`div`,{className:`fixed inset-0 z-50 flex items-center justify-center bg-black/60 p-4`,onClick:e,children:(0,N.jsxs)(`div`,{className:`flex max-h-[80vh] w-[34rem] max-w-full flex-col rounded-md border border-ink-700 bg-ink-900`,onClick:e=>e.stopPropagation(),children:[(0,N.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2 border-b border-ink-700 px-3 py-2`,children:[(0,N.jsx)(`span`,{className:`font-medium text-ink-50`,children:`Open a project`}),(0,N.jsx)(`button`,{onClick:e,"aria-label":`close`,className:`ml-auto flex h-6 w-6 items-center justify-center rounded-sm text-ink-400 hover:text-ink-200`,children:(0,N.jsx)(Je,{})})]}),(0,N.jsx)(`div`,{className:`shrink-0 truncate border-b border-ink-700 px-3 py-1.5 text-ink-400`,children:i?.path??`…`}),(0,N.jsxs)(`ul`,{className:`h-72 min-h-0 overflow-y-auto`,children:[i?.parent&&(0,N.jsx)(`li`,{children:(0,N.jsx)(`button`,{onClick:()=>r(i.parent),className:`w-full px-3 py-1 text-left text-ink-400 hover:bg-ink-850`,children:`../`})}),i?.entries.map(e=>(0,N.jsx)(`li`,{children:(0,N.jsxs)(`button`,{onClick:()=>g(e.name),className:`flex w-full items-center gap-2 px-3 py-1 text-left hover:bg-ink-850`,children:[(0,N.jsxs)(`span`,{className:`truncate text-accent`,children:[e.name,`/`]}),e.is_repo&&(0,N.jsx)(`span`,{className:`rounded-sm bg-ink-700 px-1 text-[0.65rem] text-ink-200`,children:`git`})]})},e.name)),i&&i.entries.length===0&&(0,N.jsx)(`li`,{className:`px-3 py-1 text-ink-400`,children:`No sub-folders.`})]}),o&&(0,N.jsx)(`p`,{className:`shrink-0 px-3 py-1 text-removed`,children:o}),(0,N.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2 border-t border-ink-700 px-3 py-2`,children:[(0,N.jsx)(`input`,{value:u,onChange:e=>d(e.target.value),onKeyDown:e=>{e.key===`Enter`&&y()},placeholder:`New folder name`,"aria-label":`new folder name`,className:`min-w-0 flex-1 rounded-sm border border-ink-700 bg-ink-950 px-2 py-1 text-ink-50 placeholder:text-ink-400 focus:border-ink-600 focus:outline-none`}),(0,N.jsx)(`button`,{onClick:y,disabled:!i||!u.trim()||f,className:`shrink-0 rounded-sm border border-ink-700 px-2 py-1 text-ink-200 hover:bg-ink-850 disabled:opacity-50`,children:f?`Creating…`:`Create`})]}),(0,N.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2 border-t border-ink-700 px-3 py-2`,children:[(0,N.jsx)(`span`,{className:`truncate text-ink-400`,children:i?i.path:``}),(0,N.jsx)(`button`,{onClick:_,disabled:!i||c,className:`ml-auto shrink-0 rounded-md bg-ink-50 px-3 py-1 font-semibold text-ink-950 hover:bg-white disabled:opacity-50`,children:c?`Opening…`:`Open`})]})]})})}function zt(){return(0,N.jsx)(`div`,{className:`flex h-full items-center justify-center p-6`,children:(0,N.jsxs)(`div`,{className:`flex flex-col items-center gap-3 text-ink-400`,children:[(0,N.jsx)(Ge,{className:`h-12 w-12 animate-pulse`}),(0,N.jsx)(`span`,{className:`text-[0.72rem] tracking-[0.18em] uppercase`,children:`Loading…`})]})})}function Bt({onSuccess:e}){let[t,n]=(0,v.useState)(``),[r,i]=(0,v.useState)(null),[a,o]=(0,v.useState)(!1);return(0,N.jsx)(`div`,{className:`flex h-full items-center justify-center p-6`,children:(0,N.jsxs)(`form`,{onSubmit:async n=>{n.preventDefault(),o(!0),i(null);try{await E.login(t),e()}catch(e){i(e instanceof Error?e.message:`login failed`)}finally{o(!1)}},className:`w-[17rem] max-w-[86vw]`,children:[(0,N.jsx)(Ge,{className:`mx-auto mb-3 block h-10 w-10`}),(0,N.jsx)(`h1`,{className:`text-center text-lg font-medium tracking-wide text-ink-50`,children:`nightcrow`}),(0,N.jsx)(`p`,{className:`mt-1 mb-5 text-center text-[0.62rem] tracking-[0.18em] text-ink-400 uppercase`,children:`web viewer`}),r&&(0,N.jsx)(`p`,{className:`mb-2.5 text-center text-removed`,children:r}),(0,N.jsx)(`input`,{type:`password`,autoFocus:!0,value:t,onChange:e=>n(e.target.value),placeholder:`password`,className:`mb-2 w-full rounded-md border border-ink-700 bg-ink-900 px-2.5 py-1.5 outline-none placeholder:text-ink-400 focus:border-accent focus:ring-[3px] focus:ring-accent/15`}),(0,N.jsx)(`button`,{type:`submit`,disabled:a,className:`w-full rounded-md bg-ink-50 py-1.5 font-semibold text-ink-950 hover:bg-white disabled:opacity-50`,children:a?`Signing in…`:`Sign in`})]})})}function Vt(e,t){return e?`grid-rows-[auto_minmax(0,1fr)_auto_auto] ${t===`terminal`?`md:grid-rows-[auto_minmax(0,0fr)_minmax(0,1fr)_auto]`:t===`files`?`md:grid-rows-[auto_minmax(0,1fr)_minmax(0,0fr)_auto]`:`md:grid-rows-[auto_minmax(0,11fr)_minmax(0,9fr)_auto]`}`:`grid-rows-[auto_1fr]`}function Ht(){let[e,t]=(0,v.useState)(null),[n,r]=(0,v.useState)(`status`),[i,a]=(0,v.useState)(``),[o,s]=(0,v.useState)(!1),[c,l]=(0,v.useState)({kind:`empty`}),[u,d]=(0,v.useState)(`files`),f=(0,v.useRef)(0),p=(0,v.useCallback)(()=>{f.current+=1},[]),[m,h]=(0,v.useState)(!1),{accent:g,next:_,cycle:y,adopt:b}=de(),ee=(0,v.useRef)(0),S=(0,v.useCallback)(()=>{ee.current+=1,y()},[y]),{width:C,resize:te,commit:w,reset:ne,adopt:T}=ve(),E=(0,v.useRef)(0),re=(0,v.useRef)(0),D=(0,v.useRef)(!1),ie=(0,v.useRef)(!1),ae=(0,v.useRef)(null),oe=(0,v.useCallback)(e=>{E.current+=1,w(e)},[w]),se=(0,v.useCallback)(()=>{E.current+=1,ne()},[ne]),O=(0,v.useCallback)(()=>{E.current+=1},[]),k=(0,v.useRef)(null),[le,ue]=(0,v.useState)(!0),A=(0,v.useCallback)(e=>{if(x(e)){t(!1);return}ce.error(e instanceof Error?e.message:`request failed`)},[]),j=Ie(),{draggingSidebar:M,onSidebarDragStart:fe,onSidebarDragMove:pe,onSidebarDragEnd:me,onSidebarDragCancel:he,draggingRef:ge}=Ne({sidebarRef:k,sidebarWidth:C,resizeSidebar:te,commitSidebarWidth:oe,resetSidebarWidth:se,bumpSidebarWrites:O}),{repos:_e,setRepos:ye,repo:be,setRepo:xe,hot:Se,clockSkewMs:Ce,reposLoaded:we}=ke({authed:e,setAuthed:t,handle:A,adoptAccent:b,adoptSidebarWidth:T,draggingRef:ge,accentWrites:ee,sidebarWrites:E,resumeTick:j,orderWrites:re,repoDraggingRef:D,reorderInFlightRef:ie,pendingReorderRef:ae}),{dragging:Ee,target:De,onStart:Oe,onMove:je,onEnd:Me}=Ve({repos:_e,setRepos:ye,handle:A,writesRef:re,draggingRef:D,inFlightRef:ie,pendingRef:ae}),ze=Se?.enabled?Se.window_secs*1e3:0;Te(void 0,ze,Ce??0);let{status:Be}=Ae({repo:be,authed:e,resumeTick:j,tab:n,pane:c,setPane:l,handle:A,paneRequestRef:f}),He=Te(Be?.files,ze,Ce??0),{maximized:Ue,setMaximized:We,dropMaximized:Ge}=Le(be),{commits:Ke,logDone:qe,logStalled:Je,setLogStalled:Ye,commitDrillDown:Xe,setCommitDrillDown:Ze,resetLog:Qe,logSentinelRef:$e,visibleCommits:et,logPagingPaused:tt}=Fe({repo:be,authed:e,tab:n,filter:i,handle:A}),{openDiff:nt,openFile:it,openCommit:at,openCommitFileDiff:ot,openCommitFiles:st}=Pe({repo:be,handle:A,setPane:l,paneRequestRef:f,setCommitDrillDown:Ze,setMobileView:d}),{selectOpenedRepo:ct,closeRepo:lt}=Re({repos:_e,setRepos:ye,setRepo:xe,setPane:l,setTab:r,setPickerOpen:h,dropMaximized:Ge,handle:A,orderWrites:re});if((0,v.useEffect)(()=>{p(),Ze(null),l({kind:`empty`}),Qe()},[be,Qe,p,Ze]),e===null)return(0,N.jsx)(zt,{});if(!e)return(0,N.jsx)(Bt,{onSuccess:()=>t(!0)});if(!we)return(0,N.jsx)(zt,{});let ut=_e.find(e=>e.id===be),P=i.toLowerCase(),dt=(Be?.files??[]).filter(e=>e.path.toLowerCase().includes(P)),ft=(Xe?.files??[]).filter(e=>e.path.toLowerCase().includes(P)||e.old_path?.toLowerCase().includes(P)),pt=new Set(Ke.slice(0,Be?.tracking?.ahead??0).map(e=>e.oid)),mt=Ue===`files`;return(0,N.jsxs)(`div`,{className:`nc-fade grid h-full ${Vt(be,Ue)}`,children:[(0,N.jsx)(rt,{repos:_e,repo:be,setRepo:e=>{xe(e),l({kind:`empty`})},setPane:()=>l({kind:`empty`}),closeRepo:lt,setPickerOpen:h,accent:g,next:_,cycle:S,draggingRepo:Ee,dragOverRepo:De,onRepoDragStart:Oe,onRepoDragMove:je,onRepoDragEnd:Me}),be?(0,N.jsx)(Lt,{repo:be,repos:_e,current:ut,status:Be,files:dt,now:He,hotWindowMs:ze,pane:c,setPane:l,tab:n,setTab:r,filter:i,setFilter:a,filterOpen:o,setFilterOpen:s,openDiff:nt,openFile:it,openCommit:at,openCommitFileDiff:ot,openCommitFiles:st,authed:e,handle:A,sidebarWidth:C,sidebarRef:k,draggingSidebar:M,onSidebarDragStart:fe,onSidebarDragMove:pe,onSidebarDragEnd:me,onSidebarDragCancel:he,filesMax:mt,bumpPaneRequest:p,commits:Ke,logDone:qe,logStalled:Je,setLogStalled:Ye,commitDrillDown:Xe,setCommitDrillDown:Ze,resetLog:Qe,logSentinelRef:$e,visibleCommits:et,logPagingPaused:tt,aheadOids:pt,visibleCommitFiles:ft,mdRendered:le,setMdRendered:ue,maximized:Ue,setMaximized:We,mobileView:u,setMobileView:d}):(0,N.jsx)(`div`,{className:`flex items-center justify-center p-6 text-center text-ink-400`,children:(0,N.jsxs)(`span`,{children:[`No repository open. Click`,` `,(0,N.jsx)(`span`,{className:`text-ink-200`,children:`+ open`}),` above to add one.`]})}),m&&(0,N.jsx)(Rt,{onClose:()=>h(!1),onOpened:ct})]})}var Ut={error:7e3,info:5e3,success:5e3},Wt={error:`text-removed`,info:`text-accent`,success:`text-added`};function Gt(){let[e,t]=(0,v.useState)([]);return(0,v.useEffect)(()=>se(t),[]),e.length===0?null:(0,N.jsx)(`div`,{className:`pointer-events-none fixed right-3 top-3 z-[60] flex w-80 max-w-[calc(100vw-1.5rem)] flex-col gap-2`,"aria-live":`polite`,children:e.map(e=>(0,N.jsx)(Kt,{toast:e},e.id))})}function Kt({toast:e}){let[t,n]=(0,v.useState)(!1);return(0,v.useEffect)(()=>{if(t)return;let n=setTimeout(()=>O(e.id),Ut[e.kind]);return()=>clearTimeout(n)},[e.id,e.kind,e.bump,t]),(0,N.jsxs)(`div`,{role:e.kind===`error`?`alert`:`status`,className:`nc-fade pointer-events-auto flex items-start gap-2 rounded-md border border-ink-700 bg-ink-850 px-3 py-2 text-xs shadow-lg`,onMouseEnter:()=>n(!0),onMouseLeave:()=>n(!1),children:[(0,N.jsx)(`span`,{className:`min-w-0 flex-1 break-words ${Wt[e.kind]}`,children:e.message}),(0,N.jsx)(`button`,{type:`button`,onClick:()=>O(e.id),"aria-label":`dismiss`,className:`mt-0.5 flex h-4 w-4 shrink-0 items-center justify-center rounded-sm text-ink-400 hover:bg-ink-700 hover:text-ink-200`,children:(0,N.jsx)(Je,{className:`h-3 w-3`})})]})}(0,y.createRoot)(document.getElementById(`root`)).render((0,N.jsxs)(v.StrictMode,{children:[(0,N.jsx)(Ht,{}),(0,N.jsx)(Gt,{})]}));export{De as a,d as c,l as d,We as i,o as l,Ye as n,Ee as o,Je as r,ce as s,Ke as t,s as u}; \ No newline at end of file diff --git a/viewer-ui/dist/index.html b/viewer-ui/dist/index.html index 959971dc..b73ce939 100644 --- a/viewer-ui/dist/index.html +++ b/viewer-ui/dist/index.html @@ -5,8 +5,8 @@ nightcrow - - + +
diff --git a/viewer-ui/package-lock.json b/viewer-ui/package-lock.json index 94ec3f9e..4b7d797f 100644 --- a/viewer-ui/package-lock.json +++ b/viewer-ui/package-lock.json @@ -8,306 +8,58 @@ "name": "nightcrow-viewer-ui", "version": "0.1.0", "dependencies": { - "@xterm/addon-fit": "^0.10.0", - "@xterm/xterm": "^5.5.0", + "@xterm/addon-fit": "^0.11.0", + "@xterm/xterm": "^6.0.0", "highlight.js": "^11.11.1", - "react": "^19.2.0", - "react-dom": "^19.2.0", + "react": "^19.2.8", + "react-dom": "^19.2.8", "react-markdown": "^10.1.0", "rehype-highlight": "^7.0.2", "remark-gfm": "^4.0.1" }, "devDependencies": { - "@tailwindcss/vite": "^4.1.0", - "@types/react": "^19.2.0", - "@types/react-dom": "^19.2.0", - "@vitejs/plugin-react": "^5.0.0", - "tailwindcss": "^4.1.0", - "typescript": "^5.9.0", - "vite": "^7.1.0", + "@tailwindcss/vite": "^4.3.3", + "@types/react": "^19.2.17", + "@types/react-dom": "^19.2.3", + "@vitejs/plugin-react": "^6.0.4", + "tailwindcss": "^4.3.3", + "typescript": "^7.0.2", + "vite": "^8.1.5", "vitest": "^4.1.10" } }, - "node_modules/@babel/code-frame": { - "version": "7.29.7", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.29.7.tgz", - "integrity": "sha512-Aup7aUOfpbAUg2ROOJN6Iw5f9DMBlzu0mIkm/malLQFN/YQgO48wCj0Kxa3sEHJvPVFg7siR+qRInwXd2qhQKw==", - "dev": true, - "license": "MIT", - "dependencies": { - "@babel/helper-validator-identifier": "^7.29.7", - "js-tokens": "^4.0.0", - "picocolors": "^1.1.1" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/compat-data": { - "version": "7.29.7", - "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.29.7.tgz", - "integrity": "sha512-locTkQyKvwIEgBzVrn8693ebc97F2U8ZHjbXwDXJ5Fn2TCpNwTlKcaKLkdHop5c/icOFE7qt7Q9JC5hnKNa6Gg==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/core": { - "version": "7.29.7", - "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.29.7.tgz", - "integrity": "sha512-RgHBCvtjbOK2gXSNBNIkNoEc9qoVEtau3hj8gEqKQuL3HZAibKarWFEI3Lfm6EYKkLalOh8eSrj9b+ch9H/VBA==", - "dev": true, - "license": "MIT", - "dependencies": { - "@babel/code-frame": "^7.29.7", - "@babel/generator": "^7.29.7", - "@babel/helper-compilation-targets": "^7.29.7", - "@babel/helper-module-transforms": "^7.29.7", - "@babel/helpers": "^7.29.7", - "@babel/parser": "^7.29.7", - "@babel/template": "^7.29.7", - "@babel/traverse": "^7.29.7", - "@babel/types": "^7.29.7", - "@jridgewell/remapping": "^2.3.5", - "convert-source-map": "^2.0.0", - "debug": "^4.1.0", - "gensync": "^1.0.0-beta.2", - "json5": "^2.2.3", - "semver": "^6.3.1" - }, - "engines": { - "node": ">=6.9.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/babel" - } - }, - "node_modules/@babel/generator": { - "version": "7.29.7", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.29.7.tgz", - "integrity": "sha512-DkXD5OJQaAQIdZ1bt3UZdEnHAn9Imd3IVBdX03UFe+ony9Ojw5pzr9YVKGDY1jt+Gcn/FnGkNf8r+Vj5NOJWtQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "@babel/parser": "^7.29.7", - "@babel/types": "^7.29.7", - "@jridgewell/gen-mapping": "^0.3.12", - "@jridgewell/trace-mapping": "^0.3.28", - "jsesc": "^3.0.2" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/helper-compilation-targets": { - "version": "7.29.7", - "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.29.7.tgz", - "integrity": "sha512-wem6WaBj4NaVYVdNhLPPVacES6ZJ+KBBfSkTMD3YZxbP3rm3Di85tJU5ljaUNhaOynt+Aj0xruhYuzQBt8n71g==", - "dev": true, - "license": "MIT", - "dependencies": { - "@babel/compat-data": "^7.29.7", - "@babel/helper-validator-option": "^7.29.7", - "browserslist": "^4.24.0", - "lru-cache": "^5.1.1", - "semver": "^6.3.1" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/helper-globals": { - "version": "7.29.7", - "resolved": "https://registry.npmjs.org/@babel/helper-globals/-/helper-globals-7.29.7.tgz", - "integrity": "sha512-3nQVUAtvkKH9zahfWgw96Jc/uFOmjACE1kQz82E2lqWmHBgjzbNlsC22nuQTfahmWeQtTq5nQ/4Nnd2A1wj4zA==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/helper-module-imports": { - "version": "7.29.7", - "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.29.7.tgz", - "integrity": "sha512-ejHwrQQYcm9xnTivShn2IDOlIzInN34AXskvq9QicvCtEzq1Vzclu/tKF8Jq1Cg8JG2GL6/EmjgsCT7lXepE3g==", - "dev": true, - "license": "MIT", - "dependencies": { - "@babel/traverse": "^7.29.7", - "@babel/types": "^7.29.7" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/helper-module-transforms": { - "version": "7.29.7", - "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.29.7.tgz", - "integrity": "sha512-UPUVSyXbOh627KiCIGQSgwWzGeBKLkaJ9PJEdrngIwMSzxLR4jS4+f1f1jb7VzBbg8nFLaYotvVPFCTqdrmTAg==", - "dev": true, - "license": "MIT", - "dependencies": { - "@babel/helper-module-imports": "^7.29.7", - "@babel/helper-validator-identifier": "^7.29.7", - "@babel/traverse": "^7.29.7" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0" - } - }, - "node_modules/@babel/helper-plugin-utils": { - "version": "7.29.7", - "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.29.7.tgz", - "integrity": "sha512-G7sHYigPY17oO5SYWnfD/0MTBwVR781S/JI643e/JhUYgVgWE/61SoW3NH9KWUKyKq5LVh3npif99Wkt6j86Jw==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/helper-string-parser": { - "version": "7.29.7", - "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.29.7.tgz", - "integrity": "sha512-Pb5ijPrZ89GDH8223L4UP8i6QApWxs04RbPQJTeWDV0/keR2E36MeKnyr6LYmUUvqRRI+Iv87SuF1W6ErINzYw==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/helper-validator-identifier": { - "version": "7.29.7", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.29.7.tgz", - "integrity": "sha512-qehxGkRj55h/ff8EMaJ+cYhyaKlHIxqYDn682wQD7RNp9UujOQsHog2uS0r2vzr4pW+sXf90NeeayjcNaX3fFg==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/helper-validator-option": { - "version": "7.29.7", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.29.7.tgz", - "integrity": "sha512-N9ZErrD+yW5geCDtBqnOoxmR8+tNKiGuxKlDpuJxfsqpa2dFcexaziGAE/qoHLiDDreVNMupxGmSoNlyvsA3gw==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/helpers": { - "version": "7.29.7", - "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.29.7.tgz", - "integrity": "sha512-1k2lAGRMfHTcwuNYcCNUmaUffmQv8KWMfh2iJUUeRlwlwH4FdNG7mfPI10NPfLHJFThE4Tyr4mv7kTNZOiPuBg==", - "dev": true, - "license": "MIT", - "dependencies": { - "@babel/template": "^7.29.7", - "@babel/types": "^7.29.7" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/parser": { - "version": "7.29.7", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.29.7.tgz", - "integrity": "sha512-hnORnjP/1P/zFEndoeX+n+t1RwWRJiJpM/jO7FW32Kn9r5+sJB2JWOdYo4L6k78j15eCwY3Gm/7364B1EMwtNg==", - "dev": true, - "license": "MIT", - "dependencies": { - "@babel/types": "^7.29.7" - }, - "bin": { - "parser": "bin/babel-parser.js" - }, - "engines": { - "node": ">=6.0.0" - } - }, - "node_modules/@babel/plugin-transform-react-jsx-self": { - "version": "7.29.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-react-jsx-self/-/plugin-transform-react-jsx-self-7.29.7.tgz", - "integrity": "sha512-TL0hMc9xzy86VD31nUiwzd5otRAcyEPcsegCxolO0PvcXuH1v0kECe/UIznYFihpkvU5wg/jk4v0TTEFfm53fw==", - "dev": true, - "license": "MIT", - "dependencies": { - "@babel/helper-plugin-utils": "^7.29.7" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-transform-react-jsx-source": { - "version": "7.29.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-react-jsx-source/-/plugin-transform-react-jsx-source-7.29.7.tgz", - "integrity": "sha512-06IyK09H3wi4cGbhDBwp5gUGo0IKtnYa8tyTiephirPCK6fbobVGiXMMI5zLQ4aKEYP3wZ3ArU44o+8KMrSG/Q==", - "dev": true, - "license": "MIT", - "dependencies": { - "@babel/helper-plugin-utils": "^7.29.7" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/template": { - "version": "7.29.7", - "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.29.7.tgz", - "integrity": "sha512-puq+Gf35oI24FeN11LkoUQFqv9uwNeWpxXZi/Ji3rRIoKAzKnxRaZ+Gkj0vKS9ZCiTESfng1N9LyOyXvo+m+Gg==", + "node_modules/@emnapi/core": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/@emnapi/core/-/core-1.11.1.tgz", + "integrity": "sha512-RSvbQmHzdKzNsLYa/wHrbc3KN4sYLKAdPZxqiM2HATqv/SBk2/ENSHpvXGaLOMcsAyz0poEGqkmmKYG3OWiJEQ==", "dev": true, "license": "MIT", + "optional": true, "dependencies": { - "@babel/code-frame": "^7.29.7", - "@babel/parser": "^7.29.7", - "@babel/types": "^7.29.7" - }, - "engines": { - "node": ">=6.9.0" + "@emnapi/wasi-threads": "1.2.2", + "tslib": "^2.4.0" } }, - "node_modules/@babel/traverse": { - "version": "7.29.7", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.29.7.tgz", - "integrity": "sha512-EhlfNQtZ+NK22w5BM61ciuiq1m58ed33Wr1Xan//ZRTy6hgjnwyCffRYwzsGXdASJSUJ1guZILsErh1eQcl+zw==", + "node_modules/@emnapi/runtime": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/@emnapi/runtime/-/runtime-1.11.1.tgz", + "integrity": "sha512-vgj7R3y3Wgx24IQaGPA/R6YFXLHVMOZ0uVEyIQPaWs+rd1AzfEMXlAC22FYwO1XkKR6NPsq7mUandH8oIRdZFw==", "dev": true, "license": "MIT", + "optional": true, "dependencies": { - "@babel/code-frame": "^7.29.7", - "@babel/generator": "^7.29.7", - "@babel/helper-globals": "^7.29.7", - "@babel/parser": "^7.29.7", - "@babel/template": "^7.29.7", - "@babel/types": "^7.29.7", - "debug": "^4.3.1" - }, - "engines": { - "node": ">=6.9.0" + "tslib": "^2.4.0" } }, - "node_modules/@babel/types": { - "version": "7.29.7", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.29.7.tgz", - "integrity": "sha512-4zBIxpPzowiZpusoFkyGVwakdRJUyuH5PxQ/PrqghfdFWWasvnCdPfQXHrenDai+gyLARulZjZowCOj6fjT4pA==", + "node_modules/@emnapi/wasi-threads": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/@emnapi/wasi-threads/-/wasi-threads-1.2.2.tgz", + "integrity": "sha512-c95qOXkHdydNKhscBTebqEC1CVAZpyqOfVfBzQ1qgzyl3gfeldUjIggDbIZgDKsHLgnsM+igH7TJ/eAasaVuMA==", "dev": true, "license": "MIT", + "optional": true, "dependencies": { - "@babel/helper-string-parser": "^7.29.7", - "@babel/helper-validator-identifier": "^7.29.7" - }, - "engines": { - "node": ">=6.9.0" + "tslib": "^2.4.0" } }, "node_modules/@esbuild/aix-ppc64": { @@ -323,6 +75,7 @@ "os": [ "aix" ], + "peer": true, "engines": { "node": ">=18" } @@ -340,6 +93,7 @@ "os": [ "android" ], + "peer": true, "engines": { "node": ">=18" } @@ -357,6 +111,7 @@ "os": [ "android" ], + "peer": true, "engines": { "node": ">=18" } @@ -374,6 +129,7 @@ "os": [ "android" ], + "peer": true, "engines": { "node": ">=18" } @@ -391,6 +147,7 @@ "os": [ "darwin" ], + "peer": true, "engines": { "node": ">=18" } @@ -408,6 +165,7 @@ "os": [ "darwin" ], + "peer": true, "engines": { "node": ">=18" } @@ -425,6 +183,7 @@ "os": [ "freebsd" ], + "peer": true, "engines": { "node": ">=18" } @@ -442,6 +201,7 @@ "os": [ "freebsd" ], + "peer": true, "engines": { "node": ">=18" } @@ -459,6 +219,7 @@ "os": [ "linux" ], + "peer": true, "engines": { "node": ">=18" } @@ -476,6 +237,7 @@ "os": [ "linux" ], + "peer": true, "engines": { "node": ">=18" } @@ -493,6 +255,7 @@ "os": [ "linux" ], + "peer": true, "engines": { "node": ">=18" } @@ -510,6 +273,7 @@ "os": [ "linux" ], + "peer": true, "engines": { "node": ">=18" } @@ -527,6 +291,7 @@ "os": [ "linux" ], + "peer": true, "engines": { "node": ">=18" } @@ -544,6 +309,7 @@ "os": [ "linux" ], + "peer": true, "engines": { "node": ">=18" } @@ -561,6 +327,7 @@ "os": [ "linux" ], + "peer": true, "engines": { "node": ">=18" } @@ -578,6 +345,7 @@ "os": [ "linux" ], + "peer": true, "engines": { "node": ">=18" } @@ -595,6 +363,7 @@ "os": [ "linux" ], + "peer": true, "engines": { "node": ">=18" } @@ -612,6 +381,7 @@ "os": [ "netbsd" ], + "peer": true, "engines": { "node": ">=18" } @@ -629,6 +399,7 @@ "os": [ "netbsd" ], + "peer": true, "engines": { "node": ">=18" } @@ -646,6 +417,7 @@ "os": [ "openbsd" ], + "peer": true, "engines": { "node": ">=18" } @@ -663,6 +435,7 @@ "os": [ "openbsd" ], + "peer": true, "engines": { "node": ">=18" } @@ -680,6 +453,7 @@ "os": [ "openharmony" ], + "peer": true, "engines": { "node": ">=18" } @@ -697,6 +471,7 @@ "os": [ "sunos" ], + "peer": true, "engines": { "node": ">=18" } @@ -714,6 +489,7 @@ "os": [ "win32" ], + "peer": true, "engines": { "node": ">=18" } @@ -731,6 +507,7 @@ "os": [ "win32" ], + "peer": true, "engines": { "node": ">=18" } @@ -748,6 +525,7 @@ "os": [ "win32" ], + "peer": true, "engines": { "node": ">=18" } @@ -802,31 +580,39 @@ "@jridgewell/sourcemap-codec": "^1.4.14" } }, - "node_modules/@rolldown/pluginutils": { - "version": "1.0.0-rc.3", - "resolved": "https://registry.npmjs.org/@rolldown/pluginutils/-/pluginutils-1.0.0-rc.3.tgz", - "integrity": "sha512-eybk3TjzzzV97Dlj5c+XrBFW57eTNhzod66y9HrBlzJ6NsCrWCp/2kaPS3K9wJmurBC0Tdw4yPjXKZqlznim3Q==", + "node_modules/@napi-rs/wasm-runtime": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/@napi-rs/wasm-runtime/-/wasm-runtime-1.1.6.tgz", + "integrity": "sha512-ZLv/JdUfkvOy9eCnnBaGfiO+XimbjebAeO+MRQqD/B+FR1tnRN0tpKSJHRbE8sFfS6aqsXZ67TQjfwfsxULVbg==", "dev": true, - "license": "MIT" + "license": "MIT", + "optional": true, + "dependencies": { + "@tybys/wasm-util": "^0.10.3" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/Brooooooklyn" + }, + "peerDependencies": { + "@emnapi/core": "^1.7.1", + "@emnapi/runtime": "^1.7.1" + } }, - "node_modules/@rollup/rollup-android-arm-eabi": { - "version": "4.62.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.62.2.tgz", - "integrity": "sha512-6o7ZLZK+BeenkZCFNDXqpbjw9bD6nuWonvS/lwQJp7NoVVxm6p3qE7qQ5jGuBjiFsgvqjD8mZAU5oWxTmbOeOg==", - "cpu": [ - "arm" - ], + "node_modules/@oxc-project/types": { + "version": "0.139.0", + "resolved": "https://registry.npmjs.org/@oxc-project/types/-/types-0.139.0.tgz", + "integrity": "sha512-r9gHphtCs+1M7J0pw6Sn/hh/Wpa/iQrOOkrNAlVLF/gHq+/CJmHIWKKUUhdWjcD6CIa8idarspCsASiXCXvFUw==", "dev": true, "license": "MIT", - "optional": true, - "os": [ - "android" - ] + "funding": { + "url": "https://github.com/sponsors/Boshen" + } }, - "node_modules/@rollup/rollup-android-arm64": { - "version": "4.62.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.62.2.tgz", - "integrity": "sha512-BaH7BllCACHoH1LguOU56UItGfUWjujlO65kS9LAodViaN4bwIKd7oeW/ZHJ/4ljr/7MIiENnNy3HJ0zXv8Zkw==", + "node_modules/@rolldown/binding-android-arm64": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/@rolldown/binding-android-arm64/-/binding-android-arm64-1.1.5.tgz", + "integrity": "sha512-lZg8fqIv2v7FF237bwMgzGZEJvGL79/s5knJ/i6FmsGF4XXlzccZ4jb+TrFIxtSSxFtIpdsgrPZeMk1I9AFcyQ==", "cpu": [ "arm64" ], @@ -835,12 +621,15 @@ "optional": true, "os": [ "android" - ] + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } }, - "node_modules/@rollup/rollup-darwin-arm64": { - "version": "4.62.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.62.2.tgz", - "integrity": "sha512-v39RCCvj4He82I9sFmk+M1VZ0PLM9sfsLVikjfx2hYBNALhrrOR2D3JjQA6AhlaSOgcR+RzrKY7e1+bT6SUO/A==", + "node_modules/@rolldown/binding-darwin-arm64": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/@rolldown/binding-darwin-arm64/-/binding-darwin-arm64-1.1.5.tgz", + "integrity": "sha512-51Bnx9pNiMRKSUNtBfySkNJ9vMU9Hh3I1ozDd6gyPPYzaXCfnptUcEZxXGYFn+ul2dtcMUiqGR1Yai2K10uoTw==", "cpu": [ "arm64" ], @@ -849,12 +638,15 @@ "optional": true, "os": [ "darwin" - ] + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } }, - "node_modules/@rollup/rollup-darwin-x64": { - "version": "4.62.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.62.2.tgz", - "integrity": "sha512-yl0y2vq3S3lHeuXhEdss6TWfKW8vkujImO12tn4ZkG/4oghr09LvdYm2RElVjokTQiUvDUGXLGsYeLqUMCKpGA==", + "node_modules/@rolldown/binding-darwin-x64": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/@rolldown/binding-darwin-x64/-/binding-darwin-x64-1.1.5.tgz", + "integrity": "sha512-Tm+gbfC0aHu1tBA/JvKQh32S0K6YgCHkiAF4/W6xX0K0RmNuc94VeK419dJoE65R5aRxmo+noZQSWrAMF6yb6g==", "cpu": [ "x64" ], @@ -863,26 +655,15 @@ "optional": true, "os": [ "darwin" - ] - }, - "node_modules/@rollup/rollup-freebsd-arm64": { - "version": "4.62.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-arm64/-/rollup-freebsd-arm64-4.62.2.tgz", - "integrity": "sha512-tT4pvt4qXD+vEoezupCWi+a1F0vvDiksiHc+PxRlYTOH1I6/X4id9jPxTP+Fg+545euaFT1jJVs4CEdHZAU1vw==", - "cpu": [ - "arm64" ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "freebsd" - ] + "engines": { + "node": "^20.19.0 || >=22.12.0" + } }, - "node_modules/@rollup/rollup-freebsd-x64": { - "version": "4.62.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-x64/-/rollup-freebsd-x64-4.62.2.tgz", - "integrity": "sha512-6nU5F2wCW+qvCBhTn1pdIU3bzsIoF7EUwsCDRxilWGprQR6yd508YnH9+OKFCwpfS8pjZqDUmnCAr7exax0XCg==", + "node_modules/@rolldown/binding-freebsd-x64": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/@rolldown/binding-freebsd-x64/-/binding-freebsd-x64-1.1.5.tgz", + "integrity": "sha512-JMzDKCCXq93YccG5gz3hvOs1oXRKAf0XYpfOS88e+wZrC8Iugj6j68867vrYZkvpDDpKn/KoKORThmchMpF6TA==", "cpu": [ "x64" ], @@ -891,26 +672,15 @@ "optional": true, "os": [ "freebsd" - ] - }, - "node_modules/@rollup/rollup-linux-arm-gnueabihf": { - "version": "4.62.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.62.2.tgz", - "integrity": "sha512-n1GJHPOvpIfhi3TmrCeh6S6URt9BFCt0KQE3qvexyGCTAKpR4Lg+eWvNZEqu7epxwus/8ElT3hacYEucm49SZg==", - "cpu": [ - "arm" ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ] + "engines": { + "node": "^20.19.0 || >=22.12.0" + } }, - "node_modules/@rollup/rollup-linux-arm-musleabihf": { - "version": "4.62.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.62.2.tgz", - "integrity": "sha512-JqgflS8wEB+UXV/vS1RpRbifGBeN4D5lz8D8oOFbFZw4vedvdOgCFAjfBmIMdW3yL10XpQQ0Ambepw6MXrhOnA==", + "node_modules/@rolldown/binding-linux-arm-gnueabihf": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-arm-gnueabihf/-/binding-linux-arm-gnueabihf-1.1.5.tgz", + "integrity": "sha512-uML21j2K5TfPGutKxub+M+nLjZIrWjXQ5Grx4lCe/nimTj9B4L63zHpjXLl4y0L3mcm2htEQIb06oCG/szerNw==", "cpu": [ "arm" ], @@ -919,12 +689,15 @@ "optional": true, "os": [ "linux" - ] + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } }, - "node_modules/@rollup/rollup-linux-arm64-gnu": { - "version": "4.62.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.62.2.tgz", - "integrity": "sha512-wnFJkogWvN4jm/hQRF2UBaeUmk20j5+DmHvoyWii2b8HJDyvz1MF2OU/6ynXt2KR63rbZLWkFpoytpdc/yBuSA==", + "node_modules/@rolldown/binding-linux-arm64-gnu": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-arm64-gnu/-/binding-linux-arm64-gnu-1.1.5.tgz", + "integrity": "sha512-navSiuTMogvnQoZoM/v+l3ZWo50/NTwSHSzheABx/RCnmUPaKwq9qSo4Br2OYRs21+Fz8uFqITZM3H4opOB0/Q==", "cpu": [ "arm64" ], @@ -933,12 +706,15 @@ "optional": true, "os": [ "linux" - ] + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } }, - "node_modules/@rollup/rollup-linux-arm64-musl": { - "version": "4.62.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.62.2.tgz", - "integrity": "sha512-HVu2bp0zhvJ8xHEV9+UUs7S90VadmBSY3LcIMvozbPo4AuMGDWlz3ymHLHZPX4hR67TKTt8Qp5PJ5RBg/i+RMQ==", + "node_modules/@rolldown/binding-linux-arm64-musl": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-arm64-musl/-/binding-linux-arm64-musl-1.1.5.tgz", + "integrity": "sha512-lAryqH7IteztmCXQXk0etKj4wBQ7Gx5S6LjKhsgp9zb8I5bsuvU/2llH1hDQcjsFeqIsovMVN339/8pUDDBXxA==", "cpu": [ "arm64" ], @@ -947,110 +723,136 @@ "optional": true, "os": [ "linux" - ] + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } }, - "node_modules/@rollup/rollup-linux-loong64-gnu": { - "version": "4.62.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loong64-gnu/-/rollup-linux-loong64-gnu-4.62.2.tgz", - "integrity": "sha512-mQqqAV8QaoSgr9I2fKDLY2BAVvmKjWoGiu/cSYQonsLvtqwEn1E4QYfnCOcp5zoEqNhsDYin1s6jx/VJmrxlZg==", + "node_modules/@rolldown/binding-linux-ppc64-gnu": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-ppc64-gnu/-/binding-linux-ppc64-gnu-1.1.5.tgz", + "integrity": "sha512-fsK/sNBnxzBlL4O1JNrZakVQxPspqpED5dLtNsZS9oOKmtSpdNIzxH2kkol5HYTWJN47sE20ztMJPxfZ89qGOg==", "cpu": [ - "loong64" + "ppc64" ], "dev": true, "license": "MIT", "optional": true, "os": [ "linux" - ] + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } }, - "node_modules/@rollup/rollup-linux-loong64-musl": { - "version": "4.62.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loong64-musl/-/rollup-linux-loong64-musl-4.62.2.tgz", - "integrity": "sha512-IxKLoxCQ2IWi6bT2akyDUBGsOImDKB+sPp4EsTmwFQ/fMwpCKm8uLSSgP/Kx/QYUgKis6SEZ5/Nlhup0DIA0PQ==", + "node_modules/@rolldown/binding-linux-s390x-gnu": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-s390x-gnu/-/binding-linux-s390x-gnu-1.1.5.tgz", + "integrity": "sha512-gLYb4BIadlfTOYT5gO503n8zQjXflgzpD0FcyKh0Mzx3rqCZKnHoJWV9xe1KXUJ5lx2JfcSHr/mhzS0PC/McAA==", "cpu": [ - "loong64" + "s390x" ], "dev": true, "license": "MIT", "optional": true, "os": [ "linux" - ] + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } }, - "node_modules/@rollup/rollup-linux-ppc64-gnu": { - "version": "4.62.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-ppc64-gnu/-/rollup-linux-ppc64-gnu-4.62.2.tgz", - "integrity": "sha512-Mk5ha2RQSgyFfmYYLkBpPnUk8D8FriBxesO1u9O75X0mHgXL1UQcH5Itl2lurWL2tj0RxV9b9tJgipac0hRY9A==", + "node_modules/@rolldown/binding-linux-x64-gnu": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-x64-gnu/-/binding-linux-x64-gnu-1.1.5.tgz", + "integrity": "sha512-FjcpEKUyJygHgs1o50VYNvkt5+7Le/VEdYt0AkRpkL33MnyQfwr8l5mXwMmfmTbyMPr5vJLC+8/Gd9gXnwU1QQ==", "cpu": [ - "ppc64" + "x64" ], "dev": true, "license": "MIT", "optional": true, "os": [ "linux" - ] + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } }, - "node_modules/@rollup/rollup-linux-ppc64-musl": { - "version": "4.62.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-ppc64-musl/-/rollup-linux-ppc64-musl-4.62.2.tgz", - "integrity": "sha512-CjvEnqJL/0/TQ3TXX3OPIJ/kmBellrWd4heXUmHeJlTnmwjKpSJzoehLaL6Xk0ZnMHBu9dZuFADNOrtjF4v+2w==", + "node_modules/@rolldown/binding-linux-x64-musl": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-x64-musl/-/binding-linux-x64-musl-1.1.5.tgz", + "integrity": "sha512-Me+PfPI2TMeOQk0gYWfLQZtTktrmzbr8cDboqX83XKc7UrgAi55gF+2dUkWdxd19n55Essp2yeca+O9N5rBxHg==", "cpu": [ - "ppc64" + "x64" ], "dev": true, "license": "MIT", "optional": true, "os": [ "linux" - ] + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } }, - "node_modules/@rollup/rollup-linux-riscv64-gnu": { - "version": "4.62.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.62.2.tgz", - "integrity": "sha512-1SiZbzwdkaDURsew/tSOrooKiYy7EQGT6m8ufavAi9NEyQb/6VuIxFXAL1fqa4iZe3g4NbNk4P7J32z2tw5Mgg==", + "node_modules/@rolldown/binding-openharmony-arm64": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/@rolldown/binding-openharmony-arm64/-/binding-openharmony-arm64-1.1.5.tgz", + "integrity": "sha512-yc5WrLzXks6zCQfn9Oxr8pORKyl/pF+QjHmW/Qx3qu0oyrrNC+y2JLTU1E2rcWYAmzlnqngWXHQjy51VzW70Vw==", "cpu": [ - "riscv64" + "arm64" ], "dev": true, "license": "MIT", "optional": true, "os": [ - "linux" - ] + "openharmony" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } }, - "node_modules/@rollup/rollup-linux-riscv64-musl": { - "version": "4.62.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-musl/-/rollup-linux-riscv64-musl-4.62.2.tgz", - "integrity": "sha512-nQts12zJ3NQRoE6uYljOH89v7szzLDvG2JD/vsX+vGXU8w/At1GowTZ5/7qeFQ8m7L55rpR8Okugnuo5bgjy2Q==", + "node_modules/@rolldown/binding-wasm32-wasi": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/@rolldown/binding-wasm32-wasi/-/binding-wasm32-wasi-1.1.5.tgz", + "integrity": "sha512-VbQGPX2b4r48TAMIM2cjgluIM1HYutm4pcTEJsle7iEP7sB1dFqtPLBVbdLAZCxy1txCcPxf4QFf4v8uvltPqA==", "cpu": [ - "riscv64" + "wasm32" ], "dev": true, "license": "MIT", "optional": true, - "os": [ - "linux" - ] + "dependencies": { + "@emnapi/core": "1.11.1", + "@emnapi/runtime": "1.11.1", + "@napi-rs/wasm-runtime": "^1.1.6" + }, + "engines": { + "node": "^20.19.0 || >=22.12.0" + } }, - "node_modules/@rollup/rollup-linux-s390x-gnu": { - "version": "4.62.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.62.2.tgz", - "integrity": "sha512-E9/ll019jhPIJgpzfZoIkBGhcz+kKNgVWYRY0zr9srBdPPFVpvOKW8VaJKUbeK+eZXyQF9ltME+Kk6affeaPgg==", + "node_modules/@rolldown/binding-win32-arm64-msvc": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/@rolldown/binding-win32-arm64-msvc/-/binding-win32-arm64-msvc-1.1.5.tgz", + "integrity": "sha512-gHv82k63z4qpV5+Q1y/12KrK0ltWBukVDI8nZcbT7Tt/ZlOIVwppazneq0F93oDxTo3IgAMEDIoQh3E2n6mVsw==", "cpu": [ - "s390x" + "arm64" ], "dev": true, "license": "MIT", "optional": true, "os": [ - "linux" - ] + "win32" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } }, - "node_modules/@rollup/rollup-linux-x64-gnu": { - "version": "4.62.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.62.2.tgz", - "integrity": "sha512-5BqxR/pshjey51iliyzTD5Xi3EN0aLmQ2lZ3lvefVV9c82BvrLo2/6OT55iifpWBufs6kdwWbuOKS841DrmK9A==", + "node_modules/@rolldown/binding-win32-x64-msvc": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/@rolldown/binding-win32-x64-msvc/-/binding-win32-x64-msvc-1.1.5.tgz", + "integrity": "sha512-tTZuDBPw85tEN5PQi1pnEBzDy0Z49HtScLAbD5t6hyeU92A95pRWaSMw1GZZi/RwgSgUIl0xrSlXIT/9QzvYSA==", "cpu": [ "x64" ], @@ -1058,106 +860,18 @@ "license": "MIT", "optional": true, "os": [ - "linux" - ] - }, - "node_modules/@rollup/rollup-linux-x64-musl": { - "version": "4.62.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.62.2.tgz", - "integrity": "sha512-uNN83XxQrRAh/w0/pmAfibcwyb6YWt4gP+dpnQKPVJshAloQ785ii8CT8ZCIxkGg9opVsvAlGhFitSm6D1Jjpg==", - "cpu": [ - "x64" + "win32" ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ] - }, - "node_modules/@rollup/rollup-openbsd-x64": { - "version": "4.62.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-openbsd-x64/-/rollup-openbsd-x64-4.62.2.tgz", - "integrity": "sha512-srjEIxSH3LRnJN6THczDHWQplqEMFiAJrTab0msUryh9kwNpkICf3Ea6q6MN/2cZwRFUNx5w+h6Hpi4QuHS6Zg==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "openbsd" - ] - }, - "node_modules/@rollup/rollup-openharmony-arm64": { - "version": "4.62.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-openharmony-arm64/-/rollup-openharmony-arm64-4.62.2.tgz", - "integrity": "sha512-8hOJnxgbyObnCm5AlRA3A931xX19xq80RjVTKgJOvEKWqJruP/Uf12IbAOaDjjEXYRewwHLfmF0YRIdK3OwKWA==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "openharmony" - ] - }, - "node_modules/@rollup/rollup-win32-arm64-msvc": { - "version": "4.62.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.62.2.tgz", - "integrity": "sha512-mmF4AY1i0hG/bLWUctUq59gtmgaSIRa3cu/A3JFRp/sCNEme2bgDEiDS22P9FbnJB8NJNF4jPJiSP5RHQpUTDg==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "win32" - ] - }, - "node_modules/@rollup/rollup-win32-ia32-msvc": { - "version": "4.62.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.62.2.tgz", - "integrity": "sha512-DZgkknc6jhHrk46V25vbAM0zZkyP0nSDkJB8/dRkLTxv470dOmWDqGoEJl/9A0dFfS7yE3REOwNDxpHwSLSt0Q==", - "cpu": [ - "ia32" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "win32" - ] - }, - "node_modules/@rollup/rollup-win32-x64-gnu": { - "version": "4.62.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-gnu/-/rollup-win32-x64-gnu-4.62.2.tgz", - "integrity": "sha512-T6xr6ucWSFto+VGajA8YH26LdpHRuP4YLHEKAtCWvJDOlnmWcDZVCI2Jmjr+IFHDlt2zRaTAKE4tfjTaWLgJBg==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "win32" - ] + "engines": { + "node": "^20.19.0 || >=22.12.0" + } }, - "node_modules/@rollup/rollup-win32-x64-msvc": { - "version": "4.62.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.62.2.tgz", - "integrity": "sha512-BfzEnDJOt9T8M989/lA37EcJgat01wLRnoi5dQf3QzOH7jzpqTAzdDbVfRljVr5r+jzKqpbHeyOfAaXxAd0PAA==", - "cpu": [ - "x64" - ], + "node_modules/@rolldown/pluginutils": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@rolldown/pluginutils/-/pluginutils-1.0.1.tgz", + "integrity": "sha512-2j9bGt5Jh8hj+vPtgzPtl72j0yRxHAyumoo6TNfAjsLB04UtpSvPbPcDcBMxz7n+9CYB0c1GxQFxYRg2jimqGw==", "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "win32" - ] + "license": "MIT" }, "node_modules/@standard-schema/spec": { "version": "1.1.0", @@ -1438,49 +1152,15 @@ "vite": "^5.2.0 || ^6 || ^7 || ^8" } }, - "node_modules/@types/babel__core": { - "version": "7.20.5", - "resolved": "https://registry.npmjs.org/@types/babel__core/-/babel__core-7.20.5.tgz", - "integrity": "sha512-qoQprZvz5wQFJwMDqeseRXWv3rqMvhgpbXFfVyWhbx9X47POIA6i/+dXefEmZKoAgOaTdaIgNSMqMIU61yRyzA==", - "dev": true, - "license": "MIT", - "dependencies": { - "@babel/parser": "^7.20.7", - "@babel/types": "^7.20.7", - "@types/babel__generator": "*", - "@types/babel__template": "*", - "@types/babel__traverse": "*" - } - }, - "node_modules/@types/babel__generator": { - "version": "7.27.0", - "resolved": "https://registry.npmjs.org/@types/babel__generator/-/babel__generator-7.27.0.tgz", - "integrity": "sha512-ufFd2Xi92OAVPYsy+P4n7/U7e68fex0+Ee8gSG9KX7eo084CWiQ4sdxktvdl0bOPupXtVJPY19zk6EwWqUQ8lg==", - "dev": true, - "license": "MIT", - "dependencies": { - "@babel/types": "^7.0.0" - } - }, - "node_modules/@types/babel__template": { - "version": "7.4.4", - "resolved": "https://registry.npmjs.org/@types/babel__template/-/babel__template-7.4.4.tgz", - "integrity": "sha512-h/NUaSyG5EyxBIp8YRxo4RMe2/qQgvyowRwVMzhYhBCONbW8PUsg4lkFMrhgZhUe5z3L3MiLDuvyJ/CaPa2A8A==", - "dev": true, - "license": "MIT", - "dependencies": { - "@babel/parser": "^7.1.0", - "@babel/types": "^7.0.0" - } - }, - "node_modules/@types/babel__traverse": { - "version": "7.28.0", - "resolved": "https://registry.npmjs.org/@types/babel__traverse/-/babel__traverse-7.28.0.tgz", - "integrity": "sha512-8PvcXf70gTDZBgt9ptxJ8elBeBjcLOAcOtoO/mPJjtji1+CdGbHgm77om1GrsPxsiE+uXIpNSK64UYaIwQXd4Q==", + "node_modules/@tybys/wasm-util": { + "version": "0.10.3", + "resolved": "https://registry.npmjs.org/@tybys/wasm-util/-/wasm-util-0.10.3.tgz", + "integrity": "sha512-F3fo1MYrRJYL3zER0OUOmkutjr1Vp23m7OsSgp7nq4SP6OqX6C/56XFIPAl5bt3zaBRjmW7SGz3u/6LwFpYcOg==", "dev": true, "license": "MIT", + "optional": true, "dependencies": { - "@babel/types": "^7.28.2" + "tslib": "^2.4.0" } }, "node_modules/@types/chai": { @@ -1525,54 +1205,394 @@ "@types/estree": "*" } }, - "node_modules/@types/hast": { - "version": "3.0.5", - "resolved": "https://registry.npmjs.org/@types/hast/-/hast-3.0.5.tgz", - "integrity": "sha512-rp/ezSWaD1m44dPKICGhiskI13nVr7qTloFwDa/IYkhhf5nzwP+zIQcIJh3WIFSBOy/H1PzB40jPjMDksN4F+g==", - "license": "MIT", - "dependencies": { - "@types/unist": "*" + "node_modules/@types/hast": { + "version": "3.0.5", + "resolved": "https://registry.npmjs.org/@types/hast/-/hast-3.0.5.tgz", + "integrity": "sha512-rp/ezSWaD1m44dPKICGhiskI13nVr7qTloFwDa/IYkhhf5nzwP+zIQcIJh3WIFSBOy/H1PzB40jPjMDksN4F+g==", + "license": "MIT", + "dependencies": { + "@types/unist": "*" + } + }, + "node_modules/@types/mdast": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-4.0.4.tgz", + "integrity": "sha512-kGaNbPh1k7AFzgpud/gMdvIm5xuECykRR+JnWKQno9TAXVa6WIVCGTPvYGekIDL4uwCZQSYbUxNBSb1aUo79oA==", + "license": "MIT", + "dependencies": { + "@types/unist": "*" + } + }, + "node_modules/@types/ms": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/@types/ms/-/ms-2.1.0.tgz", + "integrity": "sha512-GsCCIZDE/p3i96vtEqx+7dBUGXrc7zeSK3wwPHIaRThS+9OhWIXRqzs4d6k1SVU8g91DrNRWxWUGhp5KXQb2VA==", + "license": "MIT" + }, + "node_modules/@types/react": { + "version": "19.2.17", + "resolved": "https://registry.npmjs.org/@types/react/-/react-19.2.17.tgz", + "integrity": "sha512-MXfmqaVPEVgkBT/aY0aGCkRWWtByiYQXo3xdQ8r5RzuFrPiRn8Gar2tQdXSUQ2GKV3bkXckek89V8wQBY2Q/Aw==", + "license": "MIT", + "dependencies": { + "csstype": "^3.2.2" + } + }, + "node_modules/@types/react-dom": { + "version": "19.2.3", + "resolved": "https://registry.npmjs.org/@types/react-dom/-/react-dom-19.2.3.tgz", + "integrity": "sha512-jp2L/eY6fn+KgVVQAOqYItbF0VY/YApe5Mz2F0aykSO8gx31bYCZyvSeYxCHKvzHG5eZjc+zyaS5BrBWya2+kQ==", + "dev": true, + "license": "MIT", + "peerDependencies": { + "@types/react": "^19.2.0" + } + }, + "node_modules/@types/unist": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.3.tgz", + "integrity": "sha512-ko/gIFJRv177XgZsZcBwnqJN5x/Gien8qNOn0D5bQU/zAzVf9Zt3BlcUiLqhV9y4ARk0GbT3tnUiPNgnTXzc/Q==", + "license": "MIT" + }, + "node_modules/@typescript/typescript-aix-ppc64": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/@typescript/typescript-aix-ppc64/-/typescript-aix-ppc64-7.0.2.tgz", + "integrity": "sha512-MTKKkWB7p/0E9xi1d1tHtZ5PiLkGEMIq88pK2CubZjOsLtYTLqhgIgi6zepFa+9GHZ6h05NMCkQxGKiPXMxXtQ==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "aix" + ], + "engines": { + "node": ">=16.20.0" + } + }, + "node_modules/@typescript/typescript-darwin-arm64": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/@typescript/typescript-darwin-arm64/-/typescript-darwin-arm64-7.0.2.tgz", + "integrity": "sha512-gowzar9MwS/aRWp6f3a4KUqzRjAZjOsmGNCM6LcTgXum+dBfgsBVMN+AgvOCCbguXyick6LJhpBszxMebJ8syA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=16.20.0" + } + }, + "node_modules/@typescript/typescript-darwin-x64": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/@typescript/typescript-darwin-x64/-/typescript-darwin-x64-7.0.2.tgz", + "integrity": "sha512-SZ9xZInqApNlNGc9s0W1VSsktYSOe9cFqNOIqmN1Gs8SmkjKZYFt017G4VwPxASInODuAdbTW7sXiFUf893RgA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=16.20.0" + } + }, + "node_modules/@typescript/typescript-freebsd-arm64": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/@typescript/typescript-freebsd-arm64/-/typescript-freebsd-arm64-7.0.2.tgz", + "integrity": "sha512-W5NH4y/J0plIIS5b2xvTEkU7JFxyqdMAOgf+Ilhl0vHQXKO5dZoxd+C/jEtq56c4F3wk71RB4BMRQ2XdI+bwYQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=16.20.0" + } + }, + "node_modules/@typescript/typescript-freebsd-x64": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/@typescript/typescript-freebsd-x64/-/typescript-freebsd-x64-7.0.2.tgz", + "integrity": "sha512-UMGDx5sTpzNw3WiPebH7l90IWfJggEd+egHt/q6p7/Cm3zqoV7VxkGXt+3DxPIw8CcmvAB0j3sVVfbhX+M4Tpw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=16.20.0" + } + }, + "node_modules/@typescript/typescript-linux-arm": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/@typescript/typescript-linux-arm/-/typescript-linux-arm-7.0.2.tgz", + "integrity": "sha512-gffT3xPz9sR7j/YJExkyPntrI0P2EP9XbOyWzth2/Gs0RstK+90RBcO0ncXoXy/beYll1SXw846Nf2zdnEz0QQ==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=16.20.0" + } + }, + "node_modules/@typescript/typescript-linux-arm64": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/@typescript/typescript-linux-arm64/-/typescript-linux-arm64-7.0.2.tgz", + "integrity": "sha512-Qh4eU4/y3yDjnfjjyPYihMj5/ODIlmt+Bzu17OI+fiSRDW57QmU5SiN63exPRNJPKUzcc1INa1NXdrJ+MqHjUQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=16.20.0" + } + }, + "node_modules/@typescript/typescript-linux-loong64": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/@typescript/typescript-linux-loong64/-/typescript-linux-loong64-7.0.2.tgz", + "integrity": "sha512-uEHck9i8hoAzXPiYRib1O7miOnz23SxIeVl6F4LXox+qov1K35jHcEW6VHKvZI+pyvl7fZEP4MCU5LYvIq1GuQ==", + "cpu": [ + "loong64" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=16.20.0" + } + }, + "node_modules/@typescript/typescript-linux-mips64el": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/@typescript/typescript-linux-mips64el/-/typescript-linux-mips64el-7.0.2.tgz", + "integrity": "sha512-R4KvAMnE43W5Qeqb0Ly56O3mWMWIAgsMyz36DCaycd5nbg/9kzm0liw3JocfRqyJY0KPmzFjbswozXyW0DnIYA==", + "cpu": [ + "mips64el" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=16.20.0" + } + }, + "node_modules/@typescript/typescript-linux-ppc64": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/@typescript/typescript-linux-ppc64/-/typescript-linux-ppc64-7.0.2.tgz", + "integrity": "sha512-DORx5b3sd/4S7eayxm4FQv+A7CrkUIGRaHiwI8oiHTAI1fAPWhF4J0vAlkC8biAlHSVVwxMQ3tjZ2/DVbnQiiA==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=16.20.0" + } + }, + "node_modules/@typescript/typescript-linux-riscv64": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/@typescript/typescript-linux-riscv64/-/typescript-linux-riscv64-7.0.2.tgz", + "integrity": "sha512-wf0jqEDOjrPRnKwYRyyJDRo11KMbvMFrU+q4zqKyChODBzvlkbhNQfKvLxQCcwTpdDaXSHZTVuh0JoCrKCUMHQ==", + "cpu": [ + "riscv64" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=16.20.0" + } + }, + "node_modules/@typescript/typescript-linux-s390x": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/@typescript/typescript-linux-s390x/-/typescript-linux-s390x-7.0.2.tgz", + "integrity": "sha512-IkwJc3L7yhytWd/ewjyxNDfOmswCm9GWMJT/ue/dU4aZNbwZeYAetq42VyLmsmSjvoX7z74X6ZaYCtzAr0EuGw==", + "cpu": [ + "s390x" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=16.20.0" + } + }, + "node_modules/@typescript/typescript-linux-x64": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/@typescript/typescript-linux-x64/-/typescript-linux-x64-7.0.2.tgz", + "integrity": "sha512-EYdf2cNg7rgCWJnxCdJ+F3V39O8ihb37eHAu1LK8oAFizgTQbPOK7zHHXbPt8rX24COqODXeI3sIf0fCXG7H/A==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=16.20.0" + } + }, + "node_modules/@typescript/typescript-netbsd-arm64": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/@typescript/typescript-netbsd-arm64/-/typescript-netbsd-arm64-7.0.2.tgz", + "integrity": "sha512-+polYF4MF04aPpO5FTkHran9yUQDSXqy5GiSDKpsll5jy3l3+g9QLhpf39T+ePtefhXLOGrLl0QIjkQP6VnelA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=16.20.0" + } + }, + "node_modules/@typescript/typescript-netbsd-x64": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/@typescript/typescript-netbsd-x64/-/typescript-netbsd-x64-7.0.2.tgz", + "integrity": "sha512-8YIT0EHM/3dq10ZOVF/A7pc/YSMtbcecct4rWtexrnSCHOPcpC2KTLXfTCR6vDpnSiY12heNb1GiN/wu+T/FyA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=16.20.0" + } + }, + "node_modules/@typescript/typescript-openbsd-arm64": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/@typescript/typescript-openbsd-arm64/-/typescript-openbsd-arm64-7.0.2.tgz", + "integrity": "sha512-APT8+ClYnuYm1u9+kgGXoMj2VzWzcymwh2gNSQVySHfkRDGOTVkoWLjCmOQSaO+PoqQ57B0flRp9SA+7GnnkzQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=16.20.0" } }, - "node_modules/@types/mdast": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-4.0.4.tgz", - "integrity": "sha512-kGaNbPh1k7AFzgpud/gMdvIm5xuECykRR+JnWKQno9TAXVa6WIVCGTPvYGekIDL4uwCZQSYbUxNBSb1aUo79oA==", - "license": "MIT", - "dependencies": { - "@types/unist": "*" + "node_modules/@typescript/typescript-openbsd-x64": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/@typescript/typescript-openbsd-x64/-/typescript-openbsd-x64-7.0.2.tgz", + "integrity": "sha512-yX7s+Q0Dln0Dt9tEzZsAjXXR/+ytBM7AlglaqyeMPxQszJ1JhlJdZ6jLA+IzldHtflX81em7lDao1xXu+aRRkg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=16.20.0" } }, - "node_modules/@types/ms": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/@types/ms/-/ms-2.1.0.tgz", - "integrity": "sha512-GsCCIZDE/p3i96vtEqx+7dBUGXrc7zeSK3wwPHIaRThS+9OhWIXRqzs4d6k1SVU8g91DrNRWxWUGhp5KXQb2VA==", - "license": "MIT" - }, - "node_modules/@types/react": { - "version": "19.2.17", - "resolved": "https://registry.npmjs.org/@types/react/-/react-19.2.17.tgz", - "integrity": "sha512-MXfmqaVPEVgkBT/aY0aGCkRWWtByiYQXo3xdQ8r5RzuFrPiRn8Gar2tQdXSUQ2GKV3bkXckek89V8wQBY2Q/Aw==", - "license": "MIT", - "dependencies": { - "csstype": "^3.2.2" + "node_modules/@typescript/typescript-sunos-x64": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/@typescript/typescript-sunos-x64/-/typescript-sunos-x64-7.0.2.tgz", + "integrity": "sha512-dLJDGaLZ1D4HPQn62u1n8mBDkJREwMsAkCdkwd4Ieqw+x3TUyTsqY0YiBCtE6H6OzzgGk3iuZ3vFWRS+E8/d1g==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "sunos" + ], + "engines": { + "node": ">=16.20.0" } }, - "node_modules/@types/react-dom": { - "version": "19.2.3", - "resolved": "https://registry.npmjs.org/@types/react-dom/-/react-dom-19.2.3.tgz", - "integrity": "sha512-jp2L/eY6fn+KgVVQAOqYItbF0VY/YApe5Mz2F0aykSO8gx31bYCZyvSeYxCHKvzHG5eZjc+zyaS5BrBWya2+kQ==", + "node_modules/@typescript/typescript-win32-arm64": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/@typescript/typescript-win32-arm64/-/typescript-win32-arm64-7.0.2.tgz", + "integrity": "sha512-Gyl1Vy6OsWesLzmq+EP0Fb7b4Nid5232AvcA2SFcdYreldpNtYFFofPjnt62y9hQy7VTaZp65ICJjuAQRaVcIQ==", + "cpu": [ + "arm64" + ], "dev": true, - "license": "MIT", - "peerDependencies": { - "@types/react": "^19.2.0" + "license": "Apache-2.0", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=16.20.0" } }, - "node_modules/@types/unist": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.3.tgz", - "integrity": "sha512-ko/gIFJRv177XgZsZcBwnqJN5x/Gien8qNOn0D5bQU/zAzVf9Zt3BlcUiLqhV9y4ARk0GbT3tnUiPNgnTXzc/Q==", - "license": "MIT" + "node_modules/@typescript/typescript-win32-x64": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/@typescript/typescript-win32-x64/-/typescript-win32-x64-7.0.2.tgz", + "integrity": "sha512-0BQ3HkAHHlKLSp1qRvf3SUhGpGsDuhB/jgFw75guyqbxJqEaS0Cw/VFO8i2nHglJUzQCRtMMR/IBAKE3ETMC4g==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=16.20.0" + } }, "node_modules/@ungap/structured-clone": { "version": "1.3.3", @@ -1581,24 +1601,29 @@ "license": "ISC" }, "node_modules/@vitejs/plugin-react": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/@vitejs/plugin-react/-/plugin-react-5.2.0.tgz", - "integrity": "sha512-YmKkfhOAi3wsB1PhJq5Scj3GXMn3WvtQ/JC0xoopuHoXSdmtdStOpFrYaT1kie2YgFBcIe64ROzMYRjCrYOdYw==", + "version": "6.0.4", + "resolved": "https://registry.npmjs.org/@vitejs/plugin-react/-/plugin-react-6.0.4.tgz", + "integrity": "sha512-XcCQz0TBpBgljhj0gMuuDj49i6Ytqh5q1osT/Gp5uAVJUCTWxyskk/l1jwYYiu2xcNHHipdMz40EGfM1VdamVg==", "dev": true, "license": "MIT", "dependencies": { - "@babel/core": "^7.29.0", - "@babel/plugin-transform-react-jsx-self": "^7.27.1", - "@babel/plugin-transform-react-jsx-source": "^7.27.1", - "@rolldown/pluginutils": "1.0.0-rc.3", - "@types/babel__core": "^7.20.5", - "react-refresh": "^0.18.0" + "@rolldown/pluginutils": "^1.0.1" }, "engines": { "node": "^20.19.0 || >=22.12.0" }, "peerDependencies": { - "vite": "^4.2.0 || ^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0" + "@rolldown/plugin-babel": "^0.1.7 || ^0.2.0", + "babel-plugin-react-compiler": "^1.0.0", + "vite": "^8.0.0" + }, + "peerDependenciesMeta": { + "@rolldown/plugin-babel": { + "optional": true + }, + "babel-plugin-react-compiler": { + "optional": true + } } }, "node_modules/@vitest/expect": { @@ -1715,19 +1740,19 @@ } }, "node_modules/@xterm/addon-fit": { - "version": "0.10.0", - "resolved": "https://registry.npmjs.org/@xterm/addon-fit/-/addon-fit-0.10.0.tgz", - "integrity": "sha512-UFYkDm4HUahf2lnEyHvio51TNGiLK66mqP2JoATy7hRZeXaGMRDr00JiSF7m63vR5WKATF605yEggJKsw0JpMQ==", - "license": "MIT", - "peerDependencies": { - "@xterm/xterm": "^5.0.0" - } + "version": "0.11.0", + "resolved": "https://registry.npmjs.org/@xterm/addon-fit/-/addon-fit-0.11.0.tgz", + "integrity": "sha512-jYcgT6xtVYhnhgxh3QgYDnnNMYTcf8ElbxxFzX0IZo+vabQqSPAjC3c1wJrKB5E19VwQei89QCiZZP86DCPF7g==", + "license": "MIT" }, "node_modules/@xterm/xterm": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/@xterm/xterm/-/xterm-5.5.0.tgz", - "integrity": "sha512-hqJHYaQb5OptNunnyAnkHyM8aCjZ1MEIDTQu1iIbbTD/xops91NB5yq1ZK/dC2JDbVWtF23zUtl9JE2NqwT87A==", - "license": "MIT" + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/@xterm/xterm/-/xterm-6.0.0.tgz", + "integrity": "sha512-TQwDdQGtwwDt+2cgKDLn0IRaSxYu1tSUjgKarSDkUM0ZNiSRXFpjxEsvc/Zgc5kq5omJ+V0a8/kIM2WD3sMOYg==", + "license": "MIT", + "workspaces": [ + "addons/*" + ] }, "node_modules/assertion-error": { "version": "2.0.1", @@ -1749,74 +1774,6 @@ "url": "https://github.com/sponsors/wooorm" } }, - "node_modules/baseline-browser-mapping": { - "version": "2.10.43", - "resolved": "https://registry.npmjs.org/baseline-browser-mapping/-/baseline-browser-mapping-2.10.43.tgz", - "integrity": "sha512-AjYpR78kDWAY3Efj+cDTFH9t9SCoL7OoTp1BOb0mQV7S+6CiLwnWM3FyxhJtdPufDFKzmCSFoUncKjWgJEZTCQ==", - "dev": true, - "license": "Apache-2.0", - "bin": { - "baseline-browser-mapping": "dist/cli.cjs" - }, - "engines": { - "node": ">=6.0.0" - } - }, - "node_modules/browserslist": { - "version": "4.28.6", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.28.6.tgz", - "integrity": "sha512-FQBYNK15VMslhLHpA7+n+n1GOlF1kId2xcCg7/j95f24AOF6VDYMNH4mFxF7KuaTdv627faazpOAjFzMrfJOUw==", - "dev": true, - "funding": [ - { - "type": "opencollective", - "url": "https://opencollective.com/browserslist" - }, - { - "type": "tidelift", - "url": "https://tidelift.com/funding/github/npm/browserslist" - }, - { - "type": "github", - "url": "https://github.com/sponsors/ai" - } - ], - "license": "MIT", - "dependencies": { - "baseline-browser-mapping": "^2.10.42", - "caniuse-lite": "^1.0.30001803", - "electron-to-chromium": "^1.5.389", - "node-releases": "^2.0.51", - "update-browserslist-db": "^1.2.3" - }, - "bin": { - "browserslist": "cli.js" - }, - "engines": { - "node": "^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7" - } - }, - "node_modules/caniuse-lite": { - "version": "1.0.30001806", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001806.tgz", - "integrity": "sha512-72Cuvd95zbSYPKq6Fhg8eDJRlzgWDf7/mtoZv6Qe/DYNCEBdNxoA3+rZAU2ZhGCpZlns3EssFavaZomckT5Uuw==", - "dev": true, - "funding": [ - { - "type": "opencollective", - "url": "https://opencollective.com/browserslist" - }, - { - "type": "tidelift", - "url": "https://tidelift.com/funding/github/npm/caniuse-lite" - }, - { - "type": "github", - "url": "https://github.com/sponsors/ai" - } - ], - "license": "CC-BY-4.0" - }, "node_modules/ccount": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/ccount/-/ccount-2.0.1.tgz", @@ -1962,13 +1919,6 @@ "url": "https://github.com/sponsors/wooorm" } }, - "node_modules/electron-to-chromium": { - "version": "1.5.393", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.393.tgz", - "integrity": "sha512-kiDJdIUawuEIcp9XoICKp1iTYDEbgguIPq526N1Q7jIQDeQ3CqoMx71025PI/7E48Ddtw2HuWsVjY7afEgNxmg==", - "dev": true, - "license": "ISC" - }, "node_modules/enhanced-resolve": { "version": "5.24.3", "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.24.3.tgz", @@ -1997,6 +1947,8 @@ "dev": true, "hasInstallScript": true, "license": "MIT", + "optional": true, + "peer": true, "bin": { "esbuild": "bin/esbuild" }, @@ -2032,16 +1984,6 @@ "@esbuild/win32-x64": "0.28.1" } }, - "node_modules/escalade": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.2.0.tgz", - "integrity": "sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=6" - } - }, "node_modules/escape-string-regexp": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-5.0.0.tgz", @@ -2123,16 +2065,6 @@ "node": "^8.16.0 || ^10.6.0 || >=11.0.0" } }, - "node_modules/gensync": { - "version": "1.0.0-beta.2", - "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz", - "integrity": "sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=6.9.0" - } - }, "node_modules/graceful-fs": { "version": "4.2.11", "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", @@ -2300,39 +2232,6 @@ "jiti": "lib/jiti-cli.mjs" } }, - "node_modules/js-tokens": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", - "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", - "dev": true, - "license": "MIT" - }, - "node_modules/jsesc": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-3.1.0.tgz", - "integrity": "sha512-/sM3dO2FOzXjKQhJuo0Q173wf2KOo8t4I8vHy6lF9poUp7bKT0/NHE8fPX23PwfhnykfqnC2xRxOnVw5XuGIaA==", - "dev": true, - "license": "MIT", - "bin": { - "jsesc": "bin/jsesc" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/json5": { - "version": "2.2.3", - "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz", - "integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==", - "dev": true, - "license": "MIT", - "bin": { - "json5": "lib/cli.js" - }, - "engines": { - "node": ">=6" - } - }, "node_modules/lightningcss": { "version": "1.32.0", "resolved": "https://registry.npmjs.org/lightningcss/-/lightningcss-1.32.0.tgz", @@ -2619,16 +2518,6 @@ "url": "https://github.com/sponsors/wooorm" } }, - "node_modules/lru-cache": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz", - "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==", - "dev": true, - "license": "ISC", - "dependencies": { - "yallist": "^3.0.2" - } - }, "node_modules/magic-string": { "version": "0.30.21", "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.21.tgz", @@ -3507,16 +3396,6 @@ "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" } }, - "node_modules/node-releases": { - "version": "2.0.51", - "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.51.tgz", - "integrity": "sha512-wRNIrw4DmVLKQlbgOMdkMx27Wrpzes2hh5Jtbi2bjPd+4wJstWIqP5A+lscnqbm0xxmT5Bpg8Lec5ItEBwx6BQ==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=18" - } - }, "node_modules/obug": { "version": "2.1.4", "resolved": "https://registry.npmjs.org/obug/-/obug-2.1.4.tgz", @@ -3623,24 +3502,24 @@ } }, "node_modules/react": { - "version": "19.2.7", - "resolved": "https://registry.npmjs.org/react/-/react-19.2.7.tgz", - "integrity": "sha512-HNe9WslTbXmFK8o8cmwgAeJFSBvt1bPdHCVKtaaV+WlAN36mpT4hcRpwbf3fY56ar2oIXzsBpOAiIRHAdY0OlQ==", + "version": "19.2.8", + "resolved": "https://registry.npmjs.org/react/-/react-19.2.8.tgz", + "integrity": "sha512-PWaYA1L/q9u2u7xYQi+Y3L3Yfnie7XyLeaJICV1MGD6LprsBxcAqGjYyr0eY3p+QdsA+x/Irkt4Qif8D63+Sbw==", "license": "MIT", "engines": { "node": ">=0.10.0" } }, "node_modules/react-dom": { - "version": "19.2.7", - "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-19.2.7.tgz", - "integrity": "sha512-t0BRVXvbiE/o20Hfw669rLbMCDWtYZLvmJigy2f0MxsXF+71pxhR3xOkspmsO8h3ZlNzyibAmtCa3l4lYKk6gQ==", + "version": "19.2.8", + "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-19.2.8.tgz", + "integrity": "sha512-rVprimfGBG3DR+Tq0IQG2DT5PxKth1WIGDmj5yPmlzr4YBe7uyE+Du4oVqTDXZSHGGGXRtTJEGSSePyQCMBglQ==", "license": "MIT", "dependencies": { "scheduler": "^0.27.0" }, "peerDependencies": { - "react": "^19.2.7" + "react": "^19.2.8" } }, "node_modules/react-markdown": { @@ -3670,16 +3549,6 @@ "react": ">=18" } }, - "node_modules/react-refresh": { - "version": "0.18.0", - "resolved": "https://registry.npmjs.org/react-refresh/-/react-refresh-0.18.0.tgz", - "integrity": "sha512-QgT5//D3jfjJb6Gsjxv0Slpj23ip+HtOpnNgnb2S5zU3CB26G/IDPGoy4RJB42wzFE46DRsstbW6tKHoKbhAxw==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/rehype-highlight": { "version": "7.0.2", "resolved": "https://registry.npmjs.org/rehype-highlight/-/rehype-highlight-7.0.2.tgz", @@ -3763,49 +3632,38 @@ "url": "https://opencollective.com/unified" } }, - "node_modules/rollup": { - "version": "4.62.2", - "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.62.2.tgz", - "integrity": "sha512-RFnrW4lhXA3s3eqHDZvN654g8OTjzRfqpIRJYczCGB6HzphckVAi/Qh4tbPUbRuDi7s1Llv8g/NspLkttY3gTA==", + "node_modules/rolldown": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/rolldown/-/rolldown-1.1.5.tgz", + "integrity": "sha512-t9z29cJjXf/vxQ8dyhCSpt6H6aSwHTk8cT5I3iy6SMXuFpk5mB6PL6XfC8PCwrPTx93udwKUm9HRteAlTGBLiA==", "dev": true, "license": "MIT", "dependencies": { - "@types/estree": "1.0.9" + "@oxc-project/types": "=0.139.0", + "@rolldown/pluginutils": "^1.0.0" }, "bin": { - "rollup": "dist/bin/rollup" + "rolldown": "bin/cli.mjs" }, "engines": { - "node": ">=18.0.0", - "npm": ">=8.0.0" + "node": "^20.19.0 || >=22.12.0" }, "optionalDependencies": { - "@rollup/rollup-android-arm-eabi": "4.62.2", - "@rollup/rollup-android-arm64": "4.62.2", - "@rollup/rollup-darwin-arm64": "4.62.2", - "@rollup/rollup-darwin-x64": "4.62.2", - "@rollup/rollup-freebsd-arm64": "4.62.2", - "@rollup/rollup-freebsd-x64": "4.62.2", - "@rollup/rollup-linux-arm-gnueabihf": "4.62.2", - "@rollup/rollup-linux-arm-musleabihf": "4.62.2", - "@rollup/rollup-linux-arm64-gnu": "4.62.2", - "@rollup/rollup-linux-arm64-musl": "4.62.2", - "@rollup/rollup-linux-loong64-gnu": "4.62.2", - "@rollup/rollup-linux-loong64-musl": "4.62.2", - "@rollup/rollup-linux-ppc64-gnu": "4.62.2", - "@rollup/rollup-linux-ppc64-musl": "4.62.2", - "@rollup/rollup-linux-riscv64-gnu": "4.62.2", - "@rollup/rollup-linux-riscv64-musl": "4.62.2", - "@rollup/rollup-linux-s390x-gnu": "4.62.2", - "@rollup/rollup-linux-x64-gnu": "4.62.2", - "@rollup/rollup-linux-x64-musl": "4.62.2", - "@rollup/rollup-openbsd-x64": "4.62.2", - "@rollup/rollup-openharmony-arm64": "4.62.2", - "@rollup/rollup-win32-arm64-msvc": "4.62.2", - "@rollup/rollup-win32-ia32-msvc": "4.62.2", - "@rollup/rollup-win32-x64-gnu": "4.62.2", - "@rollup/rollup-win32-x64-msvc": "4.62.2", - "fsevents": "~2.3.2" + "@rolldown/binding-android-arm64": "1.1.5", + "@rolldown/binding-darwin-arm64": "1.1.5", + "@rolldown/binding-darwin-x64": "1.1.5", + "@rolldown/binding-freebsd-x64": "1.1.5", + "@rolldown/binding-linux-arm-gnueabihf": "1.1.5", + "@rolldown/binding-linux-arm64-gnu": "1.1.5", + "@rolldown/binding-linux-arm64-musl": "1.1.5", + "@rolldown/binding-linux-ppc64-gnu": "1.1.5", + "@rolldown/binding-linux-s390x-gnu": "1.1.5", + "@rolldown/binding-linux-x64-gnu": "1.1.5", + "@rolldown/binding-linux-x64-musl": "1.1.5", + "@rolldown/binding-openharmony-arm64": "1.1.5", + "@rolldown/binding-wasm32-wasi": "1.1.5", + "@rolldown/binding-win32-arm64-msvc": "1.1.5", + "@rolldown/binding-win32-x64-msvc": "1.1.5" } }, "node_modules/scheduler": { @@ -3814,16 +3672,6 @@ "integrity": "sha512-eNv+WrVbKu1f3vbYJT/xtiF5syA5HPIMtf9IgY/nKg0sWqzAUEvqY/xm7OcZc/qafLx/iO9FgOmeSAp4v5ti/Q==", "license": "MIT" }, - "node_modules/semver": { - "version": "6.3.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", - "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", - "dev": true, - "license": "ISC", - "bin": { - "semver": "bin/semver.js" - } - }, "node_modules/siginfo": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/siginfo/-/siginfo-2.0.0.tgz", @@ -3982,18 +3830,47 @@ "url": "https://github.com/sponsors/wooorm" } }, + "node_modules/tslib": { + "version": "2.8.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz", + "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==", + "dev": true, + "license": "0BSD", + "optional": true + }, "node_modules/typescript": { - "version": "5.9.3", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.9.3.tgz", - "integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==", + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-7.0.2.tgz", + "integrity": "sha512-8FYau96o3NKOhbjKi/qNvG/W5jhzxkbdm5sj9AbZ/5T5sWqn3hJgLfGx27sRKZWTvyzCP8dLRBTf5tBTSRVUNA==", "dev": true, "license": "Apache-2.0", "bin": { - "tsc": "bin/tsc", - "tsserver": "bin/tsserver" + "tsc": "bin/tsc" }, "engines": { - "node": ">=14.17" + "node": ">=16.20.0" + }, + "optionalDependencies": { + "@typescript/typescript-aix-ppc64": "7.0.2", + "@typescript/typescript-darwin-arm64": "7.0.2", + "@typescript/typescript-darwin-x64": "7.0.2", + "@typescript/typescript-freebsd-arm64": "7.0.2", + "@typescript/typescript-freebsd-x64": "7.0.2", + "@typescript/typescript-linux-arm": "7.0.2", + "@typescript/typescript-linux-arm64": "7.0.2", + "@typescript/typescript-linux-loong64": "7.0.2", + "@typescript/typescript-linux-mips64el": "7.0.2", + "@typescript/typescript-linux-ppc64": "7.0.2", + "@typescript/typescript-linux-riscv64": "7.0.2", + "@typescript/typescript-linux-s390x": "7.0.2", + "@typescript/typescript-linux-x64": "7.0.2", + "@typescript/typescript-netbsd-arm64": "7.0.2", + "@typescript/typescript-netbsd-x64": "7.0.2", + "@typescript/typescript-openbsd-arm64": "7.0.2", + "@typescript/typescript-openbsd-x64": "7.0.2", + "@typescript/typescript-sunos-x64": "7.0.2", + "@typescript/typescript-win32-arm64": "7.0.2", + "@typescript/typescript-win32-x64": "7.0.2" } }, "node_modules/unified": { @@ -4097,37 +3974,6 @@ "url": "https://opencollective.com/unified" } }, - "node_modules/update-browserslist-db": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.2.3.tgz", - "integrity": "sha512-Js0m9cx+qOgDxo0eMiFGEueWztz+d4+M3rGlmKPT+T4IS/jP4ylw3Nwpu6cpTTP8R1MAC1kF4VbdLt3ARf209w==", - "dev": true, - "funding": [ - { - "type": "opencollective", - "url": "https://opencollective.com/browserslist" - }, - { - "type": "tidelift", - "url": "https://tidelift.com/funding/github/npm/browserslist" - }, - { - "type": "github", - "url": "https://github.com/sponsors/ai" - } - ], - "license": "MIT", - "dependencies": { - "escalade": "^3.2.0", - "picocolors": "^1.1.1" - }, - "bin": { - "update-browserslist-db": "cli.js" - }, - "peerDependencies": { - "browserslist": ">= 4.21.0" - } - }, "node_modules/vfile": { "version": "6.0.3", "resolved": "https://registry.npmjs.org/vfile/-/vfile-6.0.3.tgz", @@ -4157,18 +4003,17 @@ } }, "node_modules/vite": { - "version": "7.3.6", - "resolved": "https://registry.npmjs.org/vite/-/vite-7.3.6.tgz", - "integrity": "sha512-4XP60spRGjSZFf1qYH+dJIkK2znL3zQfl9KkOV9MkkRR/3Dls0dxaBsQPTloEc5BLXWPL9vsOxopxyKoMmDueg==", + "version": "8.1.5", + "resolved": "https://registry.npmjs.org/vite/-/vite-8.1.5.tgz", + "integrity": "sha512-7ULLwsCdYx/nRyrpiEwvqb5TFHrMVZyBt+rg/OAXT7rgj/z+DtTDyKFeLAdDkubDVDKD8jOsndmy7m55XcfUsw==", "dev": true, "license": "MIT", "dependencies": { - "esbuild": "^0.27.0 || ^0.28.0", - "fdir": "^6.5.0", - "picomatch": "^4.0.3", - "postcss": "^8.5.6", - "rollup": "^4.43.0", - "tinyglobby": "^0.2.15" + "lightningcss": "^1.32.0", + "picomatch": "^4.0.5", + "postcss": "^8.5.17", + "rolldown": "~1.1.5", + "tinyglobby": "^0.2.17" }, "bin": { "vite": "bin/vite.js" @@ -4184,9 +4029,10 @@ }, "peerDependencies": { "@types/node": "^20.19.0 || >=22.12.0", + "@vitejs/devtools": "^0.3.0", + "esbuild": "^0.27.0 || ^0.28.0", "jiti": ">=1.21.0", "less": "^4.0.0", - "lightningcss": "^1.21.0", "sass": "^1.70.0", "sass-embedded": "^1.70.0", "stylus": ">=0.54.8", @@ -4199,13 +4045,16 @@ "@types/node": { "optional": true }, - "jiti": { + "@vitejs/devtools": { "optional": true }, - "less": { + "esbuild": { + "optional": true + }, + "jiti": { "optional": true }, - "lightningcss": { + "less": { "optional": true }, "sass": { @@ -4338,13 +4187,6 @@ "node": ">=8" } }, - "node_modules/yallist": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", - "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==", - "dev": true, - "license": "ISC" - }, "node_modules/zwitch": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/zwitch/-/zwitch-2.0.4.tgz", diff --git a/viewer-ui/package.json b/viewer-ui/package.json index 1294606f..a0503da9 100644 --- a/viewer-ui/package.json +++ b/viewer-ui/package.json @@ -10,23 +10,23 @@ "test": "vitest run" }, "dependencies": { - "@xterm/addon-fit": "^0.10.0", - "@xterm/xterm": "^5.5.0", + "@xterm/addon-fit": "^0.11.0", + "@xterm/xterm": "^6.0.0", "highlight.js": "^11.11.1", - "react": "^19.2.0", - "react-dom": "^19.2.0", + "react": "^19.2.8", + "react-dom": "^19.2.8", "react-markdown": "^10.1.0", "rehype-highlight": "^7.0.2", "remark-gfm": "^4.0.1" }, "devDependencies": { - "@tailwindcss/vite": "^4.1.0", - "@types/react": "^19.2.0", - "@types/react-dom": "^19.2.0", - "@vitejs/plugin-react": "^5.0.0", - "tailwindcss": "^4.1.0", - "typescript": "^5.9.0", - "vite": "^7.1.0", + "@tailwindcss/vite": "^4.3.3", + "@types/react": "^19.2.17", + "@types/react-dom": "^19.2.3", + "@vitejs/plugin-react": "^6.0.4", + "tailwindcss": "^4.3.3", + "typescript": "^7.0.2", + "vite": "^8.1.5", "vitest": "^4.1.10" } } diff --git a/viewer-ui/src/components/DiffView.tsx b/viewer-ui/src/components/DiffView.tsx index 51a906f5..6f996036 100644 --- a/viewer-ui/src/components/DiffView.tsx +++ b/viewer-ui/src/components/DiffView.tsx @@ -1,5 +1,5 @@ -import { splitHunkRows } from "../diffLayout"; -import { diffLineBg } from "../utils"; +import { splitHunkRows } from "../lib/diffLayout"; +import { diffLineBg } from "../lib/utils"; import type { Diff, DiffLine } from "../api"; function DiffLineContent({ line }: { line: DiffLine }) { diff --git a/viewer-ui/src/components/FilePane.tsx b/viewer-ui/src/components/FilePane.tsx index b0f44710..25ed7dd8 100644 --- a/viewer-ui/src/components/FilePane.tsx +++ b/viewer-ui/src/components/FilePane.tsx @@ -1,7 +1,7 @@ import { Suspense, lazy } from "react"; -import { useDiffLayout } from "../diffLayout"; -import { fileViewSource, isMarkdownPath } from "../fileView"; -import { MaximizeIcon, PreviewIcon, SplitViewIcon } from "../icons"; +import { useDiffLayout } from "../lib/diffLayout"; +import { fileViewSource, isMarkdownPath } from "../lib/fileView"; +import { MaximizeIcon, PreviewIcon, SplitViewIcon } from "./icons"; import { DiffView } from "./DiffView"; import { PathLabel } from "./PathLabel"; import type { Status } from "../api"; @@ -9,7 +9,7 @@ import type { Pane } from "../types"; // Keep the markdown pipeline out of the initial chunk. const MarkdownView = lazy(() => - import("../Markdown").then((m) => ({ default: m.MarkdownView })), + import("./content/Markdown").then((m) => ({ default: m.MarkdownView })), ); export interface FilePaneProps { diff --git a/viewer-ui/src/components/FolderPicker.tsx b/viewer-ui/src/components/FolderPicker.tsx index b7c48419..89fc829c 100644 --- a/viewer-ui/src/components/FolderPicker.tsx +++ b/viewer-ui/src/components/FolderPicker.tsx @@ -1,7 +1,7 @@ import { useEffect, useState } from "react"; import { api, type Browse, type Repo } from "../api"; -import { toast } from "../toast"; -import { XIcon } from "../icons"; +import { toast } from "../lib/toast"; +import { XIcon } from "./icons"; export function FolderPicker({ onClose, diff --git a/viewer-ui/src/components/Header.tsx b/viewer-ui/src/components/Header.tsx index df137cdd..618d267f 100644 --- a/viewer-ui/src/components/Header.tsx +++ b/viewer-ui/src/components/Header.tsx @@ -1,6 +1,6 @@ import { Mark } from "./Mark"; import { ProjectMenu } from "./ProjectMenu"; -import { PlusIcon, XIcon } from "../icons"; +import { PlusIcon, XIcon } from "./icons"; import type { Repo } from "../api"; export interface HeaderProps { diff --git a/viewer-ui/src/components/LogList.tsx b/viewer-ui/src/components/LogList.tsx index 54aba173..7dda125e 100644 --- a/viewer-ui/src/components/LogList.tsx +++ b/viewer-ui/src/components/LogList.tsx @@ -1,5 +1,5 @@ import { PathLabel } from "./PathLabel"; -import { formatRelativeTime, statusColor } from "../utils"; +import { formatRelativeTime, statusColor } from "../lib/utils"; import type { Commit } from "../api"; import type { CommitDrillDown } from "../hooks/useLog"; diff --git a/viewer-ui/src/components/ProjectMenu.tsx b/viewer-ui/src/components/ProjectMenu.tsx index 7eb303d9..d4ea6dc6 100644 --- a/viewer-ui/src/components/ProjectMenu.tsx +++ b/viewer-ui/src/components/ProjectMenu.tsx @@ -1,5 +1,5 @@ import { useEffect, useRef, useState } from "react"; -import { ChevronIcon, PlusIcon, XIcon } from "../icons"; +import { ChevronIcon, PlusIcon, XIcon } from "./icons"; import type { Repo } from "../api"; export function ProjectMenu({ diff --git a/viewer-ui/src/components/RepoShell.tsx b/viewer-ui/src/components/RepoShell.tsx index 5fc439d4..dbb9ba72 100644 --- a/viewer-ui/src/components/RepoShell.tsx +++ b/viewer-ui/src/components/RepoShell.tsx @@ -1,6 +1,6 @@ import { Suspense, lazy } from "react"; import type { CSSProperties } from "react"; -import { MAX_SIDEBAR_VIEWPORT_FRACTION } from "../sidebar"; +import { MAX_SIDEBAR_VIEWPORT_FRACTION } from "../hooks/ui/sidebar"; import type { PointerEvent as ReactPointerEvent } from "react"; import { Sidebar } from "./Sidebar"; import { FilePane } from "./FilePane"; @@ -8,11 +8,11 @@ import type { ChangedFile, Commit, Repo, Status } from "../api"; import type { CommitDrillDown } from "../hooks/useLog"; import type { Maximized, Pane, Tab } from "../types"; import type { MobileView } from "../types"; -import { FileTextIcon, ListIcon, TerminalIcon } from "../icons"; +import { FileTextIcon, ListIcon, TerminalIcon } from "./icons"; // Keep xterm out of the initial login and git-viewer bundle. const TerminalPanel = lazy(() => - import("../Terminal").then((m) => ({ default: m.TerminalPanel })), + import("./terminal/Terminal").then((m) => ({ default: m.TerminalPanel })), ); export interface RepoShellProps { diff --git a/viewer-ui/src/components/Sidebar.tsx b/viewer-ui/src/components/Sidebar.tsx index 80d4bd77..14e3129a 100644 --- a/viewer-ui/src/components/Sidebar.tsx +++ b/viewer-ui/src/components/Sidebar.tsx @@ -1,7 +1,7 @@ import type { PointerEvent as ReactPointerEvent } from "react"; -import { SearchIcon } from "../icons"; +import { SearchIcon } from "./icons"; import { useTree } from "../hooks/useTree"; -import { buildTreeRows } from "../tree"; +import { buildTreeRows } from "../lib/tree"; import { StatusList } from "./StatusList"; import { LogList } from "./LogList"; import { TreeList } from "./TreeList"; diff --git a/viewer-ui/src/components/StatusList.tsx b/viewer-ui/src/components/StatusList.tsx index d5100420..00dd3b65 100644 --- a/viewer-ui/src/components/StatusList.tsx +++ b/viewer-ui/src/components/StatusList.tsx @@ -1,7 +1,7 @@ import { PathLabel } from "./PathLabel"; -import { HOT_CLASS } from "../useHotClock"; -import { classifyHot } from "../hot"; -import { statusColor } from "../utils"; +import { HOT_CLASS } from "../hooks/ui/useHotClock"; +import { classifyHot } from "../lib/hot"; +import { statusColor } from "../lib/utils"; import type { ChangedFile, Status } from "../api"; export interface StatusListProps { @@ -48,4 +48,4 @@ export function StatusList({ ))} ); -} \ No newline at end of file +} diff --git a/viewer-ui/src/components/TreeList.tsx b/viewer-ui/src/components/TreeList.tsx index 367919b9..e857736c 100644 --- a/viewer-ui/src/components/TreeList.tsx +++ b/viewer-ui/src/components/TreeList.tsx @@ -1,6 +1,6 @@ -import { ChevronIcon } from "../icons"; +import { ChevronIcon } from "./icons"; import type { TreeMatch } from "../api"; -import type { TreeRow } from "../tree"; +import type { TreeRow } from "../lib/tree"; export interface TreeListProps { treeSearching: boolean; diff --git a/viewer-ui/src/Markdown.tsx b/viewer-ui/src/components/content/Markdown.tsx similarity index 100% rename from viewer-ui/src/Markdown.tsx rename to viewer-ui/src/components/content/Markdown.tsx diff --git a/viewer-ui/src/Toaster.tsx b/viewer-ui/src/components/feedback/Toaster.tsx similarity index 96% rename from viewer-ui/src/Toaster.tsx rename to viewer-ui/src/components/feedback/Toaster.tsx index dc36489d..a7b1a88d 100644 --- a/viewer-ui/src/Toaster.tsx +++ b/viewer-ui/src/components/feedback/Toaster.tsx @@ -1,11 +1,11 @@ import { useEffect, useState } from "react"; -import { XIcon } from "./icons"; +import { XIcon } from "../icons"; import { dismissToast, subscribeToasts, type Toast, type ToastKind, -} from "./toast"; +} from "../../lib/toast"; const DURATION_MS: Record = { error: 7000, diff --git a/viewer-ui/src/icons.tsx b/viewer-ui/src/components/icons.tsx similarity index 100% rename from viewer-ui/src/icons.tsx rename to viewer-ui/src/components/icons.tsx diff --git a/viewer-ui/src/Terminal.tsx b/viewer-ui/src/components/terminal/Terminal.tsx similarity index 95% rename from viewer-ui/src/Terminal.tsx rename to viewer-ui/src/components/terminal/Terminal.tsx index 4c69c9e7..db62cea3 100644 --- a/viewer-ui/src/Terminal.tsx +++ b/viewer-ui/src/components/terminal/Terminal.tsx @@ -1,11 +1,11 @@ import { useEffect, useRef, useState, type CSSProperties } from "react"; -import { MaximizeIcon, PlusIcon } from "./icons"; -import { planLayout, type PaneView } from "./terminalLayout"; -import { usePaneDrag } from "./usePaneDrag"; -import { useTerminalSocket } from "./useTerminalSocket"; -import { useTerminalViews } from "./useTerminalViews"; +import { MaximizeIcon, PlusIcon } from "../icons"; +import { planLayout, type PaneView } from "../../lib/terminalLayout"; +import { usePaneDrag } from "../../hooks/terminal/usePaneDrag"; +import { useTerminalSocket } from "../../hooks/terminal/useTerminalSocket"; +import { useTerminalViews } from "../../hooks/terminal/useTerminalViews"; import { TerminalCell } from "./TerminalCell"; -import { TERM_KEY_BAR, termKeySequence } from "./termKeys"; +import { TERM_KEY_BAR, termKeySequence } from "../../lib/termKeys"; export function TerminalPanel({ repo, diff --git a/viewer-ui/src/TerminalCell.tsx b/viewer-ui/src/components/terminal/TerminalCell.tsx similarity index 95% rename from viewer-ui/src/TerminalCell.tsx rename to viewer-ui/src/components/terminal/TerminalCell.tsx index c137c496..01714a00 100644 --- a/viewer-ui/src/TerminalCell.tsx +++ b/viewer-ui/src/components/terminal/TerminalCell.tsx @@ -1,6 +1,6 @@ import type { CSSProperties } from "react"; -import { MaximizeIcon, XIcon } from "./icons"; -import { TAB_TITLE_MAX_CELLS, truncateCells } from "./terminalLayout"; +import { MaximizeIcon, XIcon } from "../icons"; +import { TAB_TITLE_MAX_CELLS, truncateCells } from "../../lib/terminalLayout"; interface TerminalCellProps { pane: number; diff --git a/viewer-ui/src/usePaneDrag.ts b/viewer-ui/src/hooks/terminal/usePaneDrag.ts similarity index 95% rename from viewer-ui/src/usePaneDrag.ts rename to viewer-ui/src/hooks/terminal/usePaneDrag.ts index 8214f349..b12bbf7c 100644 --- a/viewer-ui/src/usePaneDrag.ts +++ b/viewer-ui/src/hooks/terminal/usePaneDrag.ts @@ -1,6 +1,6 @@ import { useRef, useState } from "react"; -import { reorderByDrop } from "./paneOrder"; -import { PANE_DRAG_THRESHOLD_PX } from "./terminalLayout"; +import { reorderByDrop } from "../../lib/paneOrder"; +import { PANE_DRAG_THRESHOLD_PX } from "../../lib/terminalLayout"; interface UsePaneDragArgs { panes: number[]; diff --git a/viewer-ui/src/useTerminalSocket.ts b/viewer-ui/src/hooks/terminal/useTerminalSocket.ts similarity index 96% rename from viewer-ui/src/useTerminalSocket.ts rename to viewer-ui/src/hooks/terminal/useTerminalSocket.ts index ac5a69af..e07b0992 100644 --- a/viewer-ui/src/useTerminalSocket.ts +++ b/viewer-ui/src/hooks/terminal/useTerminalSocket.ts @@ -1,8 +1,8 @@ import { useEffect } from "react"; import type { MutableRefObject } from "react"; -import { reconcileOrder } from "./paneOrder"; -import { toast } from "./toast"; -import type { PaneView } from "./terminalLayout"; +import { reconcileOrder } from "../../lib/paneOrder"; +import { toast } from "../../lib/toast"; +import type { PaneView } from "../../lib/terminalLayout"; interface UseTerminalSocketArgs { repo: string; diff --git a/viewer-ui/src/useTerminalViews.ts b/viewer-ui/src/hooks/terminal/useTerminalViews.ts similarity index 97% rename from viewer-ui/src/useTerminalViews.ts rename to viewer-ui/src/hooks/terminal/useTerminalViews.ts index ed4cc304..f4539c81 100644 --- a/viewer-ui/src/useTerminalViews.ts +++ b/viewer-ui/src/hooks/terminal/useTerminalViews.ts @@ -2,7 +2,7 @@ import { useEffect } from "react"; import type { MutableRefObject } from "react"; import { Terminal } from "@xterm/xterm"; import { FitAddon } from "@xterm/addon-fit"; -import type { PaneView } from "./terminalLayout"; +import type { PaneView } from "../../lib/terminalLayout"; const TERM_FONT_SIZE = typeof window !== "undefined" && diff --git a/viewer-ui/src/sidebar.ts b/viewer-ui/src/hooks/ui/sidebar.ts similarity index 98% rename from viewer-ui/src/sidebar.ts rename to viewer-ui/src/hooks/ui/sidebar.ts index d2c103fb..01890c8f 100644 --- a/viewer-ui/src/sidebar.ts +++ b/viewer-ui/src/hooks/ui/sidebar.ts @@ -1,7 +1,7 @@ // localStorage provides first paint while the server shares this preference. import { useCallback, useState } from "react"; -import { api } from "./api"; +import { api } from "../../api"; const STORAGE_KEY = "nightcrow.sidebarWidth"; diff --git a/viewer-ui/src/theme.ts b/viewer-ui/src/hooks/ui/theme.ts similarity index 98% rename from viewer-ui/src/theme.ts rename to viewer-ui/src/hooks/ui/theme.ts index 606f3647..ff6f5f51 100644 --- a/viewer-ui/src/theme.ts +++ b/viewer-ui/src/hooks/ui/theme.ts @@ -1,5 +1,5 @@ import { useCallback, useLayoutEffect, useState } from "react"; -import { api } from "./api"; +import { api } from "../../api"; /** Keep accent presets in the TUI's cycle order. */ export const ACCENTS = [ diff --git a/viewer-ui/src/useHotClock.ts b/viewer-ui/src/hooks/ui/useHotClock.ts similarity index 89% rename from viewer-ui/src/useHotClock.ts rename to viewer-ui/src/hooks/ui/useHotClock.ts index 5858c8f6..d7a3ae9e 100644 --- a/viewer-ui/src/useHotClock.ts +++ b/viewer-ui/src/hooks/ui/useHotClock.ts @@ -1,6 +1,6 @@ import { useEffect, useState } from "react"; -import { anyHot, HOT_TICK_MS, type HotStage } from "./hot"; -import type { ChangedFile } from "./api"; +import { anyHot, HOT_TICK_MS, type HotStage } from "../../lib/hot"; +import type { ChangedFile } from "../../api"; /** Keep change-kind colors stable as highlights fade. */ export const HOT_CLASS: Record = { diff --git a/viewer-ui/src/hooks/useRepoDrag.ts b/viewer-ui/src/hooks/useRepoDrag.ts index 5d5f1e29..13738359 100644 --- a/viewer-ui/src/hooks/useRepoDrag.ts +++ b/viewer-ui/src/hooks/useRepoDrag.ts @@ -1,5 +1,5 @@ import { useRef, useState, type PointerEvent as ReactPointerEvent } from "react"; -import { reorderByDrop } from "../paneOrder"; +import { reorderByDrop } from "../lib/paneOrder"; const DRAG_THRESHOLD_PX = 4; diff --git a/viewer-ui/src/hooks/useRepoOrder.ts b/viewer-ui/src/hooks/useRepoOrder.ts index d1e98fce..237a6cb9 100644 --- a/viewer-ui/src/hooks/useRepoOrder.ts +++ b/viewer-ui/src/hooks/useRepoOrder.ts @@ -1,6 +1,6 @@ import { useCallback } from "react"; import { api, type Repo } from "../api"; -import { reconcileOrder } from "../paneOrder"; +import { reconcileOrder } from "../lib/paneOrder"; import { useRepoDrag } from "./useRepoDrag"; interface UseRepoOrderArgs { diff --git a/viewer-ui/src/hooks/useRepoPoll.ts b/viewer-ui/src/hooks/useRepoPoll.ts index 5874d1b7..f0bde4d5 100644 --- a/viewer-ui/src/hooks/useRepoPoll.ts +++ b/viewer-ui/src/hooks/useRepoPoll.ts @@ -6,8 +6,8 @@ import { type HotConfig, type Repo, } from "../api"; -import { nextClockOffset } from "../hot"; -import { reconcileOrder } from "../paneOrder"; +import { nextClockOffset } from "../lib/hot"; +import { reconcileOrder } from "../lib/paneOrder"; const REPO_POLL_MS = 3000; diff --git a/viewer-ui/src/appLayout.ts b/viewer-ui/src/layout/appLayout.ts similarity index 91% rename from viewer-ui/src/appLayout.ts rename to viewer-ui/src/layout/appLayout.ts index b95cdcad..7ff4eb4f 100644 --- a/viewer-ui/src/appLayout.ts +++ b/viewer-ui/src/layout/appLayout.ts @@ -1,4 +1,4 @@ -import type { Maximized } from "./types"; +import type { Maximized } from "../types"; export function appRows(repo: string | null, maximized: Maximized): string { if (!repo) return "grid-rows-[auto_1fr]"; diff --git a/viewer-ui/src/diffLayout.test.ts b/viewer-ui/src/lib/diffLayout.test.ts similarity index 98% rename from viewer-ui/src/diffLayout.test.ts rename to viewer-ui/src/lib/diffLayout.test.ts index a788588c..841faa5e 100644 --- a/viewer-ui/src/diffLayout.test.ts +++ b/viewer-ui/src/lib/diffLayout.test.ts @@ -1,6 +1,6 @@ import { describe, expect, it } from "vitest"; import { splitHunkRows } from "./diffLayout"; -import type { DiffLine } from "./api"; +import type { DiffLine } from "../api"; // Kind-only fixtures: the pairing logic looks at `kind` alone, so the spans // carry a single marker span whose text echoes the kind for readable asserts. diff --git a/viewer-ui/src/diffLayout.ts b/viewer-ui/src/lib/diffLayout.ts similarity index 98% rename from viewer-ui/src/diffLayout.ts rename to viewer-ui/src/lib/diffLayout.ts index ea19073f..0b719b59 100644 --- a/viewer-ui/src/diffLayout.ts +++ b/viewer-ui/src/lib/diffLayout.ts @@ -1,5 +1,5 @@ import { useCallback, useEffect, useState } from "react"; -import type { DiffLine } from "./api"; +import type { DiffLine } from "../api"; export type DiffLayout = "unified" | "split"; diff --git a/viewer-ui/src/fileView.test.ts b/viewer-ui/src/lib/fileView.test.ts similarity index 100% rename from viewer-ui/src/fileView.test.ts rename to viewer-ui/src/lib/fileView.test.ts diff --git a/viewer-ui/src/fileView.ts b/viewer-ui/src/lib/fileView.ts similarity index 91% rename from viewer-ui/src/fileView.ts rename to viewer-ui/src/lib/fileView.ts index 6bb6fea5..124aaecb 100644 --- a/viewer-ui/src/fileView.ts +++ b/viewer-ui/src/lib/fileView.ts @@ -1,4 +1,4 @@ -import type { Span } from "./api"; +import type { Span } from "../api"; const MARKDOWN_EXTENSIONS = [".md", ".markdown"]; diff --git a/viewer-ui/src/hot.test.ts b/viewer-ui/src/lib/hot.test.ts similarity index 100% rename from viewer-ui/src/hot.test.ts rename to viewer-ui/src/lib/hot.test.ts diff --git a/viewer-ui/src/hot.ts b/viewer-ui/src/lib/hot.ts similarity index 100% rename from viewer-ui/src/hot.ts rename to viewer-ui/src/lib/hot.ts diff --git a/viewer-ui/src/paneOrder.test.ts b/viewer-ui/src/lib/paneOrder.test.ts similarity index 100% rename from viewer-ui/src/paneOrder.test.ts rename to viewer-ui/src/lib/paneOrder.test.ts diff --git a/viewer-ui/src/paneOrder.ts b/viewer-ui/src/lib/paneOrder.ts similarity index 100% rename from viewer-ui/src/paneOrder.ts rename to viewer-ui/src/lib/paneOrder.ts diff --git a/viewer-ui/src/termKeys.test.ts b/viewer-ui/src/lib/termKeys.test.ts similarity index 100% rename from viewer-ui/src/termKeys.test.ts rename to viewer-ui/src/lib/termKeys.test.ts diff --git a/viewer-ui/src/termKeys.ts b/viewer-ui/src/lib/termKeys.ts similarity index 100% rename from viewer-ui/src/termKeys.ts rename to viewer-ui/src/lib/termKeys.ts diff --git a/viewer-ui/src/terminalLayout.ts b/viewer-ui/src/lib/terminalLayout.ts similarity index 100% rename from viewer-ui/src/terminalLayout.ts rename to viewer-ui/src/lib/terminalLayout.ts diff --git a/viewer-ui/src/toast.ts b/viewer-ui/src/lib/toast.ts similarity index 100% rename from viewer-ui/src/toast.ts rename to viewer-ui/src/lib/toast.ts diff --git a/viewer-ui/src/tree.ts b/viewer-ui/src/lib/tree.ts similarity index 93% rename from viewer-ui/src/tree.ts rename to viewer-ui/src/lib/tree.ts index a3f3686e..5f330a46 100644 --- a/viewer-ui/src/tree.ts +++ b/viewer-ui/src/lib/tree.ts @@ -1,4 +1,4 @@ -import type { TreeEntry } from "./api"; +import type { TreeEntry } from "../api"; export interface TreeRow { path: string; diff --git a/viewer-ui/src/utils.ts b/viewer-ui/src/lib/utils.ts similarity index 100% rename from viewer-ui/src/utils.ts rename to viewer-ui/src/lib/utils.ts diff --git a/viewer-ui/src/main.tsx b/viewer-ui/src/main.tsx index 6535c6eb..257defcb 100644 --- a/viewer-ui/src/main.tsx +++ b/viewer-ui/src/main.tsx @@ -1,8 +1,8 @@ import { StrictMode } from "react"; import { createRoot } from "react-dom/client"; -import { App } from "./App"; -import { Toaster } from "./Toaster"; -import "./index.css"; +import { App } from "./pages/App"; +import { Toaster } from "./components/feedback/Toaster"; +import "./styles/index.css"; createRoot(document.getElementById("root")!).render( diff --git a/viewer-ui/src/App.tsx b/viewer-ui/src/pages/App.tsx similarity index 87% rename from viewer-ui/src/App.tsx rename to viewer-ui/src/pages/App.tsx index b2a12fed..c6e55c35 100644 --- a/viewer-ui/src/App.tsx +++ b/viewer-ui/src/pages/App.tsx @@ -1,25 +1,25 @@ import { useCallback, useEffect, useRef, useState } from "react"; -import { isUnauthorized } from "./api"; -import { toast } from "./toast"; -import { useAccent } from "./theme"; -import { useSidebarWidth } from "./sidebar"; -import { useHotClock } from "./useHotClock"; -import { useRepoPoll } from "./hooks/useRepoPoll"; -import { useStatus } from "./hooks/useStatus"; -import { useSidebarDrag } from "./hooks/useSidebarDrag"; -import { usePaneOpeners } from "./hooks/usePaneOpeners"; -import { useLog } from "./hooks/useLog"; -import { useResumeTick } from "./hooks/useResumeTick"; -import { useMaximized } from "./hooks/useMaximized"; -import { useRepoActions } from "./hooks/useRepoActions"; -import { useRepoOrder } from "./hooks/useRepoOrder"; -import { Header } from "./components/Header"; -import { RepoShell } from "./components/RepoShell"; -import { FolderPicker } from "./components/FolderPicker"; -import { LoadingSplash } from "./components/LoadingSplash"; -import { Login } from "./components/Login"; -import type { MobileView, Pane, Tab } from "./types"; -import { appRows } from "./appLayout"; +import { isUnauthorized } from "../api"; +import { toast } from "../lib/toast"; +import { useAccent } from "../hooks/ui/theme"; +import { useSidebarWidth } from "../hooks/ui/sidebar"; +import { useHotClock } from "../hooks/ui/useHotClock"; +import { useRepoPoll } from "../hooks/useRepoPoll"; +import { useStatus } from "../hooks/useStatus"; +import { useSidebarDrag } from "../hooks/useSidebarDrag"; +import { usePaneOpeners } from "../hooks/usePaneOpeners"; +import { useLog } from "../hooks/useLog"; +import { useResumeTick } from "../hooks/useResumeTick"; +import { useMaximized } from "../hooks/useMaximized"; +import { useRepoActions } from "../hooks/useRepoActions"; +import { useRepoOrder } from "../hooks/useRepoOrder"; +import { Header } from "../components/Header"; +import { RepoShell } from "../components/RepoShell"; +import { FolderPicker } from "../components/FolderPicker"; +import { LoadingSplash } from "../components/LoadingSplash"; +import { Login } from "../components/Login"; +import type { MobileView, Pane, Tab } from "../types"; +import { appRows } from "../layout/appLayout"; export function App() { const [authed, setAuthed] = useState(null); diff --git a/viewer-ui/src/index.css b/viewer-ui/src/styles/index.css similarity index 100% rename from viewer-ui/src/index.css rename to viewer-ui/src/styles/index.css From a08feb6e3f1f0da4b63da53863e8ac251ba61b1a Mon Sep 17 00:00:00 2001 From: whackur Date: Sat, 25 Jul 2026 21:36:25 +0900 Subject: [PATCH 02/19] refactor: organize application source hierarchy --- docs/architecture.md | 27 +++--- src/app/commit_log_fetch.rs | 2 +- src/app/commit_log_pagination.rs | 2 +- src/app/session_io.rs | 2 +- src/app/tests/session_restore.rs | 16 ++-- src/app/tests/snapshot.rs | 4 +- src/app/tests/terminal_init.rs | 4 +- src/app/tests/tree_session.rs | 6 +- src/{app_init.rs => application/bootstrap.rs} | 2 +- src/{ => application}/event_loop.rs | 12 +-- .../input/dispatch.rs} | 4 +- .../input/handlers.rs} | 4 +- src/application/input/mod.rs | 6 ++ src/{ => application/input}/mouse.rs | 2 +- src/{ => application/input}/paste.rs | 0 src/application/mod.rs | 10 +++ src/{ => application}/splash.rs | 0 .../tests}/helpers.rs | 0 src/{main_tests => application/tests}/mod.rs | 0 .../tests}/mouse.rs | 2 +- .../tests}/mouse_clicks.rs | 4 +- .../tests}/mouse_empty.rs | 4 +- .../tests}/mouse_release.rs | 2 +- .../tests}/paste.rs | 4 +- .../tests}/prefix.rs | 2 +- .../tests}/prefix_digits.rs | 2 +- .../tests}/search.rs | 2 +- src/{main_tests => application/tests}/swap.rs | 2 +- .../tests}/terminal.rs | 2 +- .../tests}/workspace.rs | 6 +- src/backend/pty.rs | 2 +- src/cli.rs | 6 +- src/main.rs | 32 +++---- src/{ => platform}/logging.rs | 0 src/{ => platform}/logging_tests.rs | 0 src/platform/mod.rs | 5 ++ src/platform/paths.rs | 53 +++++++++++ src/platform/threading.rs | 32 +++++++ src/runtime/snapshot.rs | 2 +- src/util.rs | 88 ------------------- src/web/viewer/runtime/mod.rs | 5 +- src/web/viewer/server/mutations.rs | 8 +- src/web/viewer/terminal/mod.rs | 5 +- src/workspace/mod.rs | 4 +- src/{session.rs => workspace/persistence.rs} | 0 src/workspace/repo_input.rs | 2 +- 46 files changed, 203 insertions(+), 176 deletions(-) rename src/{app_init.rs => application/bootstrap.rs} (96%) rename src/{ => application}/event_loop.rs (96%) rename src/{key_dispatch.rs => application/input/dispatch.rs} (99%) rename src/{key_handlers.rs => application/input/handlers.rs} (98%) create mode 100644 src/application/input/mod.rs rename src/{ => application/input}/mouse.rs (99%) rename src/{ => application/input}/paste.rs (100%) create mode 100644 src/application/mod.rs rename src/{ => application}/splash.rs (100%) rename src/{main_tests => application/tests}/helpers.rs (100%) rename src/{main_tests => application/tests}/mod.rs (100%) rename src/{main_tests => application/tests}/mouse.rs (99%) rename src/{main_tests => application/tests}/mouse_clicks.rs (98%) rename src/{main_tests => application/tests}/mouse_empty.rs (97%) rename src/{main_tests => application/tests}/mouse_release.rs (98%) rename src/{main_tests => application/tests}/paste.rs (95%) rename src/{main_tests => application/tests}/prefix.rs (99%) rename src/{main_tests => application/tests}/prefix_digits.rs (98%) rename src/{main_tests => application/tests}/search.rs (98%) rename src/{main_tests => application/tests}/swap.rs (98%) rename src/{main_tests => application/tests}/terminal.rs (95%) rename src/{main_tests => application/tests}/workspace.rs (95%) rename src/{ => platform}/logging.rs (100%) rename src/{ => platform}/logging_tests.rs (100%) create mode 100644 src/platform/mod.rs create mode 100644 src/platform/paths.rs create mode 100644 src/platform/threading.rs delete mode 100644 src/util.rs rename src/{session.rs => workspace/persistence.rs} (100%) diff --git a/docs/architecture.md b/docs/architecture.md index f986f0ca..d55db217 100644 --- a/docs/architecture.md +++ b/docs/architecture.md @@ -57,18 +57,22 @@ below for the layout and resize rules. ``` src/ ├── main.rs # entry point, TerminalGuard, run() -├── app_init.rs # single-project App construction + startup commands ├── cli.rs # Cli/Commands, run_init/run_serve, web surface bootstrap -├── event_loop.rs # main_loop: poll/render/broadcast/input drain -├── key_dispatch.rs # handle_key, prefix follow-up, global action, KeyOutcome -├── key_handlers.rs # ViewMode-specific key handlers (upper/terminal/overlay) -├── mouse.rs # mouse dispatch, click/scroll/swap-target routing -├── paste.rs # paste dispatch (terminal/search/dialog) -├── splash.rs # first-run splash overlay loop -├── logging.rs # tracing-based file logger (rotation + retention) -├── session.rs # workspace + per-repo state (~/.nightcrow/workspace.json) -├── util.rs # shared low-level helpers (try_timed_join) ├── test_util.rs # #[cfg(test)] git fixture helpers shared across modules +├── application/ # native TUI process orchestration +│ ├── bootstrap.rs # single-project App construction + startup commands +│ ├── event_loop.rs # main_loop: poll/render/broadcast/input drain +│ ├── splash.rs # first-run splash overlay loop +│ ├── input/ # terminal/browser input routing +│ │ ├── dispatch.rs # key dispatch, prefix follow-up, KeyOutcome +│ │ ├── handlers.rs # ViewMode-specific key handlers (upper/terminal/overlay) +│ │ ├── mouse.rs # click/scroll/swap-target routing +│ │ └── paste.rs # terminal/search/dialog paste routing +│ └── tests/ # application-level input and workspace tests +├── platform/ # OS-adjacent services shared by domain layers +│ ├── logging.rs # tracing-based file logger (rotation + retention) +│ ├── paths.rs # shell-independent tilde expansion +│ └── threading.rs # bounded worker-thread reaping ├── app.rs # App struct + type defs (NoticeKind/ViewMode/Focus/AutoFollow) ├── app/ │ ├── app_impl.rs # App core methods: new, notice, prefix/swap state @@ -99,6 +103,7 @@ src/ │ ├── mod.rs # Workspace: open projects (Vec) + active index, │ │ # process-level repo dialog/notice │ ├── repo_input.rs # o repo-input modal state +│ ├── persistence.rs # workspace + per-repo state (~/.nightcrow/workspace.json) │ └── tests/ # workspace + repo_input tests ├── runtime/ │ ├── mod.rs @@ -300,7 +305,7 @@ background even while scrolled out of the window. - **Hot path (UI 틱 안)**: `launch_commit_log_worker`는 이전 `JoinHandle`을 join 없이 drop한다. 매 prefetch마다 5ms를 기다리면 스크롤이 jank해진다. worker 본체는 `tx.send` 1회 후 종료하므로 누적되지 않고, 받는 쪽(`page_rx`)을 먼저 drop했기 때문에 그 send는 즉시 실패한다. **timed-join을 여기 추가하지 말 것.** - **Quiescent moment (Drop, repo switch, reply drain 직후)**: `cancel_commit_log_page_fetch`, `poll_commit_log_page_fetch`의 reply drain 분기, 그리고 `Drop` impl은 모두 `try_timed_join`(~5ms)을 사용한다. 사용자가 클릭한 시점이거나 worker가 이미 마지막 syscall에 도달한 시점이라 잠깐의 대기를 흡수해도 UX 손실이 없고, OS 스레드를 즉시 회수한다. -`try_timed_join`은 `src/util.rs`에 공유 helper로 두고, snapshot/commit-log/PTY 세 곳에서 모두 호출한다. 새 worker 패턴을 추가할 때도 같은 분기 기준으로 join 정책을 선택한다. +`try_timed_join`은 `src/platform/threading.rs`에 공유 helper로 두고, snapshot/commit-log/PTY 세 곳에서 모두 호출한다. 새 worker 패턴을 추가할 때도 같은 분기 기준으로 join 정책을 선택한다. ### Status filter cache diff --git a/src/app/commit_log_fetch.rs b/src/app/commit_log_fetch.rs index 0df3507a..043b8e1d 100644 --- a/src/app/commit_log_fetch.rs +++ b/src/app/commit_log_fetch.rs @@ -7,7 +7,7 @@ use std::sync::mpsc; use std::thread; -use crate::util::{REAP_TIMEOUT, try_timed_join}; +use crate::platform::threading::{REAP_TIMEOUT, try_timed_join}; use git2::{Oid, Repository}; diff --git a/src/app/commit_log_pagination.rs b/src/app/commit_log_pagination.rs index 03bd8a33..f8627c90 100644 --- a/src/app/commit_log_pagination.rs +++ b/src/app/commit_log_pagination.rs @@ -3,7 +3,7 @@ use std::sync::mpsc::Receiver; use std::thread::JoinHandle; -use crate::util::{REAP_TIMEOUT, try_timed_join}; +use crate::platform::threading::{REAP_TIMEOUT, try_timed_join}; use super::commit_log_fetch::CommitLogPageMsg; diff --git a/src/app/session_io.rs b/src/app/session_io.rs index 39d67e20..efea8a77 100644 --- a/src/app/session_io.rs +++ b/src/app/session_io.rs @@ -1,7 +1,7 @@ use super::{App, Focus, NoticeKind, ViewMode}; use crate::git::diff::{load_commit_files, load_commit_log}; use crate::runtime::terminal::TerminalFullscreen; -use crate::session::SessionState; +use crate::workspace::persistence::SessionState; impl App { // The live view, except for a selection still waiting on its first diff --git a/src/app/tests/session_restore.rs b/src/app/tests/session_restore.rs index 6c83d9ae..dd212fca 100644 --- a/src/app/tests/session_restore.rs +++ b/src/app/tests/session_restore.rs @@ -114,7 +114,7 @@ fn save_session_round_trips_list_fullscreen() { fn restore_session_list_fullscreen_forces_filelist_focus() { let mut app = app_with_files(vec![]); - app.restore_session(&crate::session::SessionState { + app.restore_session(&crate::workspace::persistence::SessionState { focus: Some(Focus::DiffViewer), list_fullscreen: true, ..Default::default() @@ -132,7 +132,7 @@ fn restore_session_prefers_terminal_fullscreen_over_list_fullscreen() { title: "shell".into(), }]; - app.restore_session(&crate::session::SessionState { + app.restore_session(&crate::workspace::persistence::SessionState { focus: Some(Focus::FileList), terminal_fullscreen: true, list_fullscreen: true, @@ -182,7 +182,7 @@ fn restore_session_restores_active_pane_even_when_focus_is_not_terminal() { }, ]; - app.restore_session(&crate::session::SessionState { + app.restore_session(&crate::workspace::persistence::SessionState { focus: Some(Focus::FileList), active_pane: 1, ..Default::default() @@ -200,7 +200,7 @@ fn restore_session_fullscreen_forces_terminal_focus() { title: "shell".into(), }]; - app.restore_session(&crate::session::SessionState { + app.restore_session(&crate::workspace::persistence::SessionState { focus: Some(Focus::FileList), terminal_fullscreen: true, ..Default::default() @@ -214,7 +214,7 @@ fn restore_session_fullscreen_forces_terminal_focus() { fn restore_session_diff_fullscreen_forces_diff_focus() { let mut app = app_with_files(vec![]); - app.restore_session(&crate::session::SessionState { + app.restore_session(&crate::workspace::persistence::SessionState { focus: Some(Focus::FileList), diff_fullscreen: true, ..Default::default() @@ -232,7 +232,7 @@ fn restore_session_prefers_terminal_fullscreen_over_diff_fullscreen() { title: "shell".into(), }]; - app.restore_session(&crate::session::SessionState { + app.restore_session(&crate::workspace::persistence::SessionState { focus: Some(Focus::FileList), terminal_fullscreen: true, diff_fullscreen: true, @@ -263,7 +263,7 @@ fn save_session_round_trips_diff_fullscreen() { fn restore_session_normalizes_accent_index() { let mut app = app_with_files(vec![]); - app.restore_session(&crate::session::SessionState { + app.restore_session(&crate::workspace::persistence::SessionState { accent_idx: usize::MAX, ..Default::default() }); @@ -289,7 +289,7 @@ fn restore_session_keeps_log_scroll_after_loading_commit_diff() { let mut app = app_with_files(vec![]); app.repo_path = path; - app.restore_session(&crate::session::SessionState { + app.restore_session(&crate::workspace::persistence::SessionState { mode: Some(ViewMode::Log), scroll: 2, ..Default::default() diff --git a/src/app/tests/snapshot.rs b/src/app/tests/snapshot.rs index 661a5d6d..a90db32a 100644 --- a/src/app/tests/snapshot.rs +++ b/src/app/tests/snapshot.rs @@ -51,7 +51,7 @@ fn a_saved_mode_lands_immediately_and_survives_being_changed() { ..app_with_files(vec![]) }; - app.restore_session(&crate::session::SessionState { + app.restore_session(&crate::workspace::persistence::SessionState { mode: Some(ViewMode::Tree), ..Default::default() }); @@ -85,7 +85,7 @@ fn a_saved_selection_is_restored_by_the_first_snapshot() { ..app_with_files(vec![]) }; - app.restore_session(&crate::session::SessionState { + app.restore_session(&crate::workspace::persistence::SessionState { selected_file: Some("b.rs".to_string()), ..Default::default() }); diff --git a/src/app/tests/terminal_init.rs b/src/app/tests/terminal_init.rs index 99b36934..2d727e1e 100644 --- a/src/app/tests/terminal_init.rs +++ b/src/app/tests/terminal_init.rs @@ -25,7 +25,7 @@ fn restore_session_overrides_fresh_launch_terminal_focus() { app.ensure_initial_terminal(&[]); assert_eq!(app.focus, Focus::Terminal); // A restored session must win over the fresh-launch terminal focus. - app.restore_session(&crate::session::SessionState { + app.restore_session(&crate::workspace::persistence::SessionState { focus: Some(Focus::FileList), ..Default::default() }); @@ -40,7 +40,7 @@ fn restore_pane_focus_wins_immediately_without_snapshot() { let mut app = app_with_fake_backend(); app.ensure_initial_terminal(&[]); assert_eq!(app.focus, Focus::Terminal); - app.restore_pane_focus(&crate::session::SessionState { + app.restore_pane_focus(&crate::workspace::persistence::SessionState { focus: Some(Focus::FileList), ..Default::default() }); diff --git a/src/app/tests/tree_session.rs b/src/app/tests/tree_session.rs index 36d3857b..e6572df4 100644 --- a/src/app/tests/tree_session.rs +++ b/src/app/tests/tree_session.rs @@ -127,7 +127,7 @@ fn restoring_tree_session_clears_lingering_status_search() { app.search_push('x'); assert!(app.status_view.search_active); - app.restore_session(&crate::session::SessionState { + app.restore_session(&crate::workspace::persistence::SessionState { mode: Some(ViewMode::Tree), ..Default::default() }); @@ -163,7 +163,7 @@ fn restore_tree_session_ignores_unsafe_expanded_paths() { let (dir, path) = make_tree_repo(); let mut app = app_on(&path); - app.restore_session(&crate::session::SessionState { + app.restore_session(&crate::workspace::persistence::SessionState { mode: Some(ViewMode::Tree), tree_expanded: vec![ "../../..".to_string(), @@ -191,7 +191,7 @@ fn restore_tree_session_prunes_expansion_gone_since_save() { std::fs::rename(Path::new(&path).join("src"), Path::new(&path).join("lib")).unwrap(); let mut app = app_on(&path); - app.restore_session(&crate::session::SessionState { + app.restore_session(&crate::workspace::persistence::SessionState { mode: Some(ViewMode::Tree), tree_expanded: vec!["src".to_string()], tree_selected_path: Some("src".to_string()), diff --git a/src/app_init.rs b/src/application/bootstrap.rs similarity index 96% rename from src/app_init.rs rename to src/application/bootstrap.rs index 530e511c..5509d2d5 100644 --- a/src/app_init.rs +++ b/src/application/bootstrap.rs @@ -1,5 +1,5 @@ use crate::app::App; -use crate::session::SessionState; +use crate::workspace::persistence::SessionState; pub(crate) fn init_app( repo_path: &str, diff --git a/src/event_loop.rs b/src/application/event_loop.rs similarity index 96% rename from src/event_loop.rs rename to src/application/event_loop.rs index 4ad9c96a..60a3a6a4 100644 --- a/src/event_loop.rs +++ b/src/application/event_loop.rs @@ -1,8 +1,8 @@ +pub(crate) use crate::application::input::dispatch::ProjectContext; +use crate::application::input::dispatch::{KeyOutcome, ProjectRequest, dispatch_key}; +use crate::application::input::mouse::dispatch_mouse; +use crate::application::input::paste::dispatch_paste; use crate::cli::WebSurfaces; -pub(crate) use crate::key_dispatch::ProjectContext; -use crate::key_dispatch::{KeyOutcome, ProjectRequest, dispatch_key}; -use crate::mouse::dispatch_mouse; -use crate::paste::dispatch_paste; use crate::workspace::Workspace; use crossterm::event::{self, Event}; use ratatui::layout::Rect; @@ -256,7 +256,7 @@ pub(crate) fn apply_project_request( // `close_active` carries the project's view state into the // remembered set; writing here means a crash later cannot lose it. if ws.close_active() { - crate::session::save_workspace(&ws.to_persisted()); + crate::workspace::persistence::save_workspace(&ws.to_persisted()); } } ProjectRequest::Open(repo_path) => { @@ -280,7 +280,7 @@ pub(crate) fn apply_project_request( return; } let saved = ws.session_for(&repo_path).cloned(); - let project = crate::app_init::init_app( + let project = crate::application::bootstrap::init_app( &repo_path, ctx.cfg, ctx.startup_commands, diff --git a/src/key_dispatch.rs b/src/application/input/dispatch.rs similarity index 99% rename from src/key_dispatch.rs rename to src/application/input/dispatch.rs index 2c9e00c6..43cec91e 100644 --- a/src/key_dispatch.rs +++ b/src/application/input/dispatch.rs @@ -1,8 +1,8 @@ use crate::app::{App, Focus}; -use crate::input::{Action, encode_key, map_key, prefix_action, prefix_action_fullscreen}; -use crate::key_handlers::{ +use crate::application::input::handlers::{ handle_empty_key, handle_repo_input_key, handle_terminal_key, handle_upper_key, }; +use crate::input::{Action, encode_key, map_key, prefix_action, prefix_action_fullscreen}; use crate::workspace::Workspace; use crossterm::event::{KeyCode, KeyEvent, KeyEventKind, KeyModifiers}; diff --git a/src/key_handlers.rs b/src/application/input/handlers.rs similarity index 98% rename from src/key_handlers.rs rename to src/application/input/handlers.rs index e857a771..b7419258 100644 --- a/src/key_handlers.rs +++ b/src/application/input/handlers.rs @@ -1,6 +1,8 @@ use crate::app::{App, DiffPaneView, Focus, ViewMode}; +use crate::application::input::dispatch::{ + KeyOutcome, ProjectRequest, matches_text_command, text_input_char, +}; use crate::input::{Action, encode_key, prefix_action, vim_navigation_action}; -use crate::key_dispatch::{KeyOutcome, ProjectRequest, matches_text_command, text_input_char}; use crate::runtime::terminal::SCROLL_LINE_STEP; use crate::workspace::Workspace; use crossterm::event::{KeyCode, KeyEvent}; diff --git a/src/application/input/mod.rs b/src/application/input/mod.rs new file mode 100644 index 00000000..63cf73cc --- /dev/null +++ b/src/application/input/mod.rs @@ -0,0 +1,6 @@ +//! Translate terminal and browser input into application actions. + +pub(crate) mod dispatch; +mod handlers; +pub(crate) mod mouse; +pub(crate) mod paste; diff --git a/src/mouse.rs b/src/application/input/mouse.rs similarity index 99% rename from src/mouse.rs rename to src/application/input/mouse.rs index 1751d483..1603bce5 100644 --- a/src/mouse.rs +++ b/src/application/input/mouse.rs @@ -1,5 +1,5 @@ use crate::app::{App, Focus}; -use crate::key_dispatch::{KeyOutcome, ProjectRequest, handle_key}; +use crate::application::input::dispatch::{KeyOutcome, ProjectRequest, handle_key}; use crate::runtime::terminal::WHEEL_LINES_PER_NOTCH; use crate::workspace::Workspace; use crossterm::event::{KeyCode, KeyEvent, KeyModifiers, MouseEvent, MouseEventKind}; diff --git a/src/paste.rs b/src/application/input/paste.rs similarity index 100% rename from src/paste.rs rename to src/application/input/paste.rs diff --git a/src/application/mod.rs b/src/application/mod.rs new file mode 100644 index 00000000..c6f5ac11 --- /dev/null +++ b/src/application/mod.rs @@ -0,0 +1,10 @@ +//! Process-level orchestration for the native TUI. +//! +//! This layer owns startup and event routing. Domain state lives in `app`, +//! while rendering, runtime services, and persistence stay in their own +//! top-level modules. + +pub(crate) mod bootstrap; +pub(crate) mod event_loop; +pub(crate) mod input; +pub(crate) mod splash; diff --git a/src/splash.rs b/src/application/splash.rs similarity index 100% rename from src/splash.rs rename to src/application/splash.rs diff --git a/src/main_tests/helpers.rs b/src/application/tests/helpers.rs similarity index 100% rename from src/main_tests/helpers.rs rename to src/application/tests/helpers.rs diff --git a/src/main_tests/mod.rs b/src/application/tests/mod.rs similarity index 100% rename from src/main_tests/mod.rs rename to src/application/tests/mod.rs diff --git a/src/main_tests/mouse.rs b/src/application/tests/mouse.rs similarity index 99% rename from src/main_tests/mouse.rs rename to src/application/tests/mouse.rs index ac09b94a..202b4266 100644 --- a/src/main_tests/mouse.rs +++ b/src/application/tests/mouse.rs @@ -1,6 +1,6 @@ use super::helpers::*; use crate::app::Focus; -use crate::mouse::{dispatch_mouse, handle_mouse}; +use crate::application::input::mouse::{dispatch_mouse, handle_mouse}; use crate::workspace::Workspace; use crossterm::event::MouseEventKind; diff --git a/src/main_tests/mouse_clicks.rs b/src/application/tests/mouse_clicks.rs similarity index 98% rename from src/main_tests/mouse_clicks.rs rename to src/application/tests/mouse_clicks.rs index 5b042d76..1b8c8b4d 100644 --- a/src/main_tests/mouse_clicks.rs +++ b/src/application/tests/mouse_clicks.rs @@ -1,7 +1,7 @@ use super::helpers::*; use crate::app::Focus; -use crate::key_dispatch::KeyOutcome; -use crate::mouse::handle_mouse; +use crate::application::input::dispatch::KeyOutcome; +use crate::application::input::mouse::handle_mouse; use crossterm::event::MouseEventKind; #[test] diff --git a/src/main_tests/mouse_empty.rs b/src/application/tests/mouse_empty.rs similarity index 97% rename from src/main_tests/mouse_empty.rs rename to src/application/tests/mouse_empty.rs index 59eb3bd0..f1f745b4 100644 --- a/src/main_tests/mouse_empty.rs +++ b/src/application/tests/mouse_empty.rs @@ -1,8 +1,8 @@ use super::helpers::*; use crate::app; use crate::app::tests::{app_with_fake_backend, app_with_files}; -use crate::key_dispatch::{KeyOutcome, ProjectRequest}; -use crate::mouse::{dispatch_mouse, handle_mouse}; +use crate::application::input::dispatch::{KeyOutcome, ProjectRequest}; +use crate::application::input::mouse::{dispatch_mouse, handle_mouse}; use crate::workspace::Workspace; use crossterm::event::MouseEventKind; diff --git a/src/main_tests/mouse_release.rs b/src/application/tests/mouse_release.rs similarity index 98% rename from src/main_tests/mouse_release.rs rename to src/application/tests/mouse_release.rs index e12e0fc8..0e1f22e2 100644 --- a/src/main_tests/mouse_release.rs +++ b/src/application/tests/mouse_release.rs @@ -1,5 +1,5 @@ use super::helpers::*; -use crate::mouse::handle_mouse; +use crate::application::input::mouse::handle_mouse; use crossterm::event::MouseEventKind; #[test] diff --git a/src/main_tests/paste.rs b/src/application/tests/paste.rs similarity index 95% rename from src/main_tests/paste.rs rename to src/application/tests/paste.rs index c8ed0c78..40cc1419 100644 --- a/src/main_tests/paste.rs +++ b/src/application/tests/paste.rs @@ -1,8 +1,8 @@ use super::helpers::*; use crate::app::Focus; use crate::app::tests::app_with_files; -use crate::key_dispatch::handle_key; -use crate::paste::{dispatch_paste, handle_paste}; +use crate::application::input::dispatch::handle_key; +use crate::application::input::paste::{dispatch_paste, handle_paste}; #[test] fn paste_while_prefix_armed_cancels_prefix() { diff --git a/src/main_tests/prefix.rs b/src/application/tests/prefix.rs similarity index 99% rename from src/main_tests/prefix.rs rename to src/application/tests/prefix.rs index bd3dfc27..a901fea7 100644 --- a/src/main_tests/prefix.rs +++ b/src/application/tests/prefix.rs @@ -1,7 +1,7 @@ use super::helpers::*; use crate::app::Focus; use crate::app::tests::app_with_files; -use crate::key_dispatch::{KeyOutcome, ProjectRequest, dispatch_key, handle_key}; +use crate::application::input::dispatch::{KeyOutcome, ProjectRequest, dispatch_key, handle_key}; use crate::workspace::Workspace; use crossterm::event::{KeyCode, KeyEvent, KeyModifiers}; diff --git a/src/main_tests/prefix_digits.rs b/src/application/tests/prefix_digits.rs similarity index 98% rename from src/main_tests/prefix_digits.rs rename to src/application/tests/prefix_digits.rs index 0cacdb54..4c034cc1 100644 --- a/src/main_tests/prefix_digits.rs +++ b/src/application/tests/prefix_digits.rs @@ -1,7 +1,7 @@ use super::helpers::*; use crate::app::tests::app_with_files; use crate::app::{Focus, ViewMode}; -use crate::key_dispatch::handle_key; +use crate::application::input::dispatch::handle_key; use crossterm::event::{KeyCode, KeyModifiers}; #[test] diff --git a/src/main_tests/search.rs b/src/application/tests/search.rs similarity index 98% rename from src/main_tests/search.rs rename to src/application/tests/search.rs index acb53835..7c3e0c8e 100644 --- a/src/main_tests/search.rs +++ b/src/application/tests/search.rs @@ -1,7 +1,7 @@ use super::helpers::*; use crate::app::tests::app_with_files; use crate::app::{DiffPaneView, Focus}; -use crate::key_dispatch::handle_key; +use crate::application::input::dispatch::handle_key; use crossterm::event::{KeyCode, KeyModifiers}; #[test] diff --git a/src/main_tests/swap.rs b/src/application/tests/swap.rs similarity index 98% rename from src/main_tests/swap.rs rename to src/application/tests/swap.rs index 3e9f5bd7..61256442 100644 --- a/src/main_tests/swap.rs +++ b/src/application/tests/swap.rs @@ -1,6 +1,6 @@ use super::helpers::*; use crate::app::Focus; -use crate::key_dispatch::handle_key; +use crate::application::input::dispatch::handle_key; use crossterm::event::{KeyCode, KeyModifiers}; #[test] diff --git a/src/main_tests/terminal.rs b/src/application/tests/terminal.rs similarity index 95% rename from src/main_tests/terminal.rs rename to src/application/tests/terminal.rs index 28eed4fb..804bbe65 100644 --- a/src/main_tests/terminal.rs +++ b/src/application/tests/terminal.rs @@ -1,5 +1,5 @@ use super::helpers::*; -use crate::key_dispatch::handle_key; +use crate::application::input::dispatch::handle_key; use crossterm::event::{KeyCode, KeyModifiers}; #[test] diff --git a/src/main_tests/workspace.rs b/src/application/tests/workspace.rs similarity index 95% rename from src/main_tests/workspace.rs rename to src/application/tests/workspace.rs index 747e23a3..948f4021 100644 --- a/src/main_tests/workspace.rs +++ b/src/application/tests/workspace.rs @@ -1,7 +1,9 @@ use super::helpers::*; use crate::app::tests::app_with_files; -use crate::event_loop::apply_project_request; -use crate::key_dispatch::{KeyOutcome, ProjectContext, ProjectRequest, dispatch_key, handle_key}; +use crate::application::event_loop::apply_project_request; +use crate::application::input::dispatch::{ + KeyOutcome, ProjectContext, ProjectRequest, dispatch_key, handle_key, +}; use crate::workspace::Workspace; use crossterm::event::{KeyCode, KeyModifiers}; diff --git a/src/backend/pty.rs b/src/backend/pty.rs index 3f800b4a..dc2765da 100644 --- a/src/backend/pty.rs +++ b/src/backend/pty.rs @@ -1,5 +1,5 @@ use super::{BackendEvent, PaneId, TerminalBackend}; -use crate::util::try_timed_join; +use crate::platform::threading::try_timed_join; use anyhow::Result; use portable_pty::{CommandBuilder, NativePtySystem, PtySize, PtySystem}; use std::collections::BTreeMap; diff --git a/src/cli.rs b/src/cli.rs index 8355c789..0ae174fd 100644 --- a/src/cli.rs +++ b/src/cli.rs @@ -141,7 +141,7 @@ pub(crate) fn run_serve( // Unify with the TUI/mirror: restore the previously-open projects so the // viewer does not start blank each launch. Explicit --repo comes first and // wins; remembered repos that still exist fill in after, de-duplicated. - if let Some(ws) = crate::session::load_workspace() { + if let Some(ws) = crate::workspace::persistence::load_workspace() { for repo in ws.repos { if std::path::Path::new(&repo).is_dir() && !paths.contains(&repo) { paths.push(repo); @@ -201,7 +201,7 @@ pub(crate) fn run_serve( fn resolve_serve_repos(repos: &[std::path::PathBuf]) -> Result> { let mut out: Vec = Vec::new(); for repo in repos { - let expanded = crate::util::expand_tilde(repo); + let expanded = crate::platform::paths::expand_tilde(repo); if !expanded.exists() { anyhow::bail!("no such directory: {}", expanded.display()); } @@ -269,7 +269,7 @@ pub(crate) fn resolve_repo_paths( let mut out = Vec::with_capacity(repos.len()); for p in repos { out.push( - crate::git::resolve_repo_path(crate::util::expand_tilde(p)) + crate::git::resolve_repo_path(crate::platform::paths::expand_tilde(p)) .to_string_lossy() .to_string(), ); diff --git a/src/main.rs b/src/main.rs index f23a300c..d222feb4 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,30 +1,23 @@ mod app; -mod app_init; +mod application; +#[cfg(test)] +#[path = "application/tests/mod.rs"] +mod application_tests; mod backend; mod cli; mod config; -mod event_loop; mod git; mod input; -mod key_dispatch; -mod key_handlers; -mod logging; -#[cfg(test)] -#[path = "main_tests/mod.rs"] -mod main_tests; -mod mouse; -mod paste; +mod platform; mod runtime; -mod session; -mod splash; #[cfg(test)] mod test_util; mod ui; -mod util; mod web; mod workspace; use anyhow::Result; +use application::event_loop::{ProjectContext, main_loop}; use clap::Parser; use crossterm::event::{ DisableBracketedPaste, DisableMouseCapture, EnableBracketedPaste, EnableMouseCapture, @@ -33,17 +26,16 @@ use crossterm::{ execute, terminal::{EnterAlternateScreen, LeaveAlternateScreen, disable_raw_mode, enable_raw_mode}, }; -use event_loop::{ProjectContext, main_loop}; use ratatui::{Terminal, backend::CrosstermBackend}; use std::io; use syntect::highlighting::ThemeSet; use workspace::Workspace; +use crate::application::splash::SplashOutcome; use crate::cli::{ Cli, Commands, WebSurfaces, log_anchor_for, resolve_repo_paths, run_init, run_serve, start_viewer_if_enabled, start_web_if_enabled, }; -use crate::splash::SplashOutcome; fn main() -> Result<()> { let cli = Cli::parse(); @@ -85,7 +77,7 @@ fn main() -> Result<()> { // directory does. A log path cannot follow the active tab — the file is // opened once, at startup. let log_anchor = log_anchor_for(&repo_paths)?; - let _log_guard = logging::init_logging(&cfg.log, &log_anchor); + let _log_guard = platform::logging::init_logging(&cfg.log, &log_anchor); tracing::info!( level = cfg.log.level.as_str(), @@ -190,7 +182,7 @@ fn run( // argument, the last set of tabs comes back — and since quitting with none // open records exactly that, an empty screen stays reachable without a // dedicated flag. - let stored = session::load_workspace(); + let stored = workspace::persistence::load_workspace(); // The same file carries the tab list and every repo's view state, so the // remembered half is seeded even when `--repo` overrides the tab list. if let Some(state) = stored.as_ref() { @@ -235,7 +227,7 @@ fn run( break; } let saved = ws.session_for(path).cloned(); - ws.add(app_init::init_app( + ws.add(application::bootstrap::init_app( path, &cfg, &startup_commands, @@ -265,7 +257,7 @@ fn run( } if matches!( - splash::splash_loop(terminal, &ws, cfg.theme.preset_index())?, + application::splash::splash_loop(terminal, &ws, cfg.theme.preset_index())?, SplashOutcome::Quit ) { tracing::info!("nightcrow stopped during splash"); @@ -277,7 +269,7 @@ fn run( // sessions are stored per repo (`/.nightcrow/session.json`), so a // background project's pane/focus state would otherwise be lost purely // because the user happened to quit from another tab. - session::save_workspace(&ws.to_persisted()); + workspace::persistence::save_workspace(&ws.to_persisted()); tracing::info!("nightcrow stopped"); Ok(()) } diff --git a/src/logging.rs b/src/platform/logging.rs similarity index 100% rename from src/logging.rs rename to src/platform/logging.rs diff --git a/src/logging_tests.rs b/src/platform/logging_tests.rs similarity index 100% rename from src/logging_tests.rs rename to src/platform/logging_tests.rs diff --git a/src/platform/mod.rs b/src/platform/mod.rs new file mode 100644 index 00000000..c42e8bec --- /dev/null +++ b/src/platform/mod.rs @@ -0,0 +1,5 @@ +//! Operating-system-adjacent services shared by application layers. + +pub(crate) mod logging; +pub(crate) mod paths; +pub(crate) mod threading; diff --git a/src/platform/paths.rs b/src/platform/paths.rs new file mode 100644 index 00000000..fcd7d77d --- /dev/null +++ b/src/platform/paths.rs @@ -0,0 +1,53 @@ +//! Filesystem path helpers that do not belong to a domain module. + +use std::path::{Path, PathBuf}; + +/// Expand a leading `~` to the user's home directory. +/// +/// Paths typed inside the TUI never pass through a shell, so `~/work` would +/// otherwise be taken as a directory literally named `~`. Only the bare `~` +/// form is expanded — `~user` needs a passwd lookup and is left as typed, as +/// is every path when the home directory cannot be determined. +pub(crate) fn expand_tilde(path: impl AsRef) -> PathBuf { + let path = path.as_ref(); + // `strip_prefix` matches whole components, so this accepts `~` and + // `~/rest` while leaving `~user/rest` alone. + let Ok(rest) = path.strip_prefix("~") else { + return path.to_path_buf(); + }; + match dirs::home_dir() { + Some(home) => home.join(rest), + None => path.to_path_buf(), + } +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn expand_tilde_replaces_a_leading_tilde_with_the_home_directory() { + let home = dirs::home_dir().expect("a home directory"); + + assert_eq!(expand_tilde("~/workspace/x"), home.join("workspace/x")); + } + + #[test] + fn expand_tilde_maps_a_bare_tilde_to_the_home_directory() { + let home = dirs::home_dir().expect("a home directory"); + + assert_eq!(expand_tilde("~"), home); + } + + #[test] + fn expand_tilde_leaves_paths_without_a_leading_tilde_alone() { + assert_eq!(expand_tilde("/abs/path"), PathBuf::from("/abs/path")); + assert_eq!(expand_tilde("rel/path"), PathBuf::from("rel/path")); + assert_eq!(expand_tilde("/tmp/~/x"), PathBuf::from("/tmp/~/x")); + } + + #[test] + fn expand_tilde_leaves_a_user_qualified_tilde_alone() { + assert_eq!(expand_tilde("~other/x"), PathBuf::from("~other/x")); + } +} diff --git a/src/platform/threading.rs b/src/platform/threading.rs new file mode 100644 index 00000000..b28775fe --- /dev/null +++ b/src/platform/threading.rs @@ -0,0 +1,32 @@ +//! Bounded thread-reaping helpers. + +use std::thread::{self, JoinHandle}; +use std::time::{Duration, Instant}; + +/// Default reap window for [`try_timed_join`] at known-quiescent call sites +/// (Drop impls, worker swap-out). The signal-then-join pattern means the +/// worker is already a few syscalls from returning; a handful of millis is +/// generous without ever stalling the UI noticeably. +pub const REAP_TIMEOUT: Duration = Duration::from_millis(5); + +/// Spin briefly waiting for `handle` to finish, then either join it or +/// detach the handle. Detaches without panicking on timeout so the UI is +/// never blocked by a hung worker. Used at quiescent moments (repo switch, +/// after reply drain, Drop) where the worker is either already done or +/// microseconds away from exiting. +pub fn try_timed_join(handle: JoinHandle<()>, timeout: Duration) { + let deadline = Instant::now() + timeout; + while !handle.is_finished() && Instant::now() < deadline { + // Short sleep keeps the busy-wait cheap; the common path is one + // iteration because the worker exits as soon as it tries to send. + thread::sleep(Duration::from_micros(200)); + } + if handle.is_finished() { + if let Err(e) = handle.join() { + tracing::warn!(?e, "worker thread panicked"); + } + } else { + tracing::debug!("worker still running at detach; reaping deferred to OS"); + drop(handle); + } +} diff --git a/src/runtime/snapshot.rs b/src/runtime/snapshot.rs index 4729dc6a..872e20c8 100644 --- a/src/runtime/snapshot.rs +++ b/src/runtime/snapshot.rs @@ -129,7 +129,7 @@ impl Drop for SnapshotChannel { // Bounded join: a worker stuck inside libgit2 (corrupted packfile, // hung NFS) must not freeze app shutdown / repo switch. if let Some(h) = self.handle.take() { - crate::util::try_timed_join(h, crate::util::REAP_TIMEOUT); + crate::platform::threading::try_timed_join(h, crate::platform::threading::REAP_TIMEOUT); } } } diff --git a/src/util.rs b/src/util.rs deleted file mode 100644 index 488be099..00000000 --- a/src/util.rs +++ /dev/null @@ -1,88 +0,0 @@ -//! Shared low-level utilities. Keep tiny — anything domain-specific should -//! live in the relevant module instead. - -use std::path::{Path, PathBuf}; -use std::thread::{self, JoinHandle}; -use std::time::{Duration, Instant}; - -/// Expand a leading `~` to the user's home directory. -/// -/// Paths typed inside the TUI never pass through a shell, so `~/work` would -/// otherwise be taken as a directory literally named `~`. Only the bare `~` -/// form is expanded — `~user` needs a passwd lookup and is left as typed, as -/// is every path when the home directory cannot be determined. -pub fn expand_tilde(path: impl AsRef) -> PathBuf { - let path = path.as_ref(); - // `strip_prefix` matches whole components, so this accepts `~` and - // `~/rest` while leaving `~user/rest` alone. - let Ok(rest) = path.strip_prefix("~") else { - return path.to_path_buf(); - }; - match dirs::home_dir() { - Some(home) => home.join(rest), - None => path.to_path_buf(), - } -} - -/// Default reap window for [`try_timed_join`] at known-quiescent call sites -/// (Drop impls, worker swap-out). The signal-then-join pattern means the -/// worker is already a few syscalls from returning; a handful of millis is -/// generous without ever stalling the UI noticeably. -pub const REAP_TIMEOUT: Duration = Duration::from_millis(5); - -/// Spin briefly waiting for `handle` to finish, then either join it or -/// detach the handle. Detaches without panicking on timeout so the UI is -/// never blocked by a hung worker. Used at quiescent moments (repo switch, -/// after reply drain, Drop) where the worker is either already done or -/// microseconds away from exiting. -pub fn try_timed_join(handle: JoinHandle<()>, timeout: Duration) { - let deadline = Instant::now() + timeout; - while !handle.is_finished() && Instant::now() < deadline { - // Short sleep keeps the busy-wait cheap; the common path is one - // iteration because the worker exits as soon as it tries to send. - thread::sleep(Duration::from_micros(200)); - } - if handle.is_finished() { - if let Err(e) = handle.join() { - tracing::warn!(?e, "worker thread panicked"); - } - } else { - tracing::debug!("worker still running at detach; reaping deferred to OS"); - drop(handle); - } -} - -#[cfg(test)] -mod tests { - use super::*; - - #[test] - fn expand_tilde_replaces_a_leading_tilde_with_the_home_directory() { - let home = dirs::home_dir().expect("a home directory"); - - assert_eq!(expand_tilde("~/workspace/x"), home.join("workspace/x")); - } - - #[test] - fn expand_tilde_maps_a_bare_tilde_to_the_home_directory() { - let home = dirs::home_dir().expect("a home directory"); - - assert_eq!(expand_tilde("~"), home); - } - - #[test] - fn expand_tilde_leaves_paths_without_a_leading_tilde_alone() { - assert_eq!(expand_tilde("/abs/path"), PathBuf::from("/abs/path")); - assert_eq!(expand_tilde("rel/path"), PathBuf::from("rel/path")); - // A tilde that is not the first component is an ordinary directory - // name, not a home reference. - assert_eq!(expand_tilde("/tmp/~/x"), PathBuf::from("/tmp/~/x")); - } - - #[test] - fn expand_tilde_leaves_a_user_qualified_tilde_alone() { - // `~other` needs a passwd lookup; expanding it against our own home - // would silently point at the wrong directory. - assert_eq!(expand_tilde("~other/x"), PathBuf::from("~other/x")); - } -} diff --git a/src/web/viewer/runtime/mod.rs b/src/web/viewer/runtime/mod.rs index f838b392..6b3088be 100644 --- a/src/web/viewer/runtime/mod.rs +++ b/src/web/viewer/runtime/mod.rs @@ -242,7 +242,10 @@ impl RepoRuntime { self.stop.store(true, Ordering::Release); let handle = self.worker.lock().expect("worker slot poisoned").take(); if let Some(handle) = handle { - crate::util::try_timed_join(handle, crate::util::REAP_TIMEOUT); + crate::platform::threading::try_timed_join( + handle, + crate::platform::threading::REAP_TIMEOUT, + ); } } } diff --git a/src/web/viewer/server/mutations.rs b/src/web/viewer/server/mutations.rs index 2b2745d1..31c7cc0a 100644 --- a/src/web/viewer/server/mutations.rs +++ b/src/web/viewer/server/mutations.rs @@ -69,7 +69,7 @@ pub(super) fn handle_open_repo(body: &str, state: &ViewerState) -> Vec { if raw.is_empty() { return json_error("400 Bad Request", "a path is required"); } - let expanded = crate::util::expand_tilde(raw); + let expanded = crate::platform::paths::expand_tilde(raw); // is_dir() follows symlinks and is false for a missing path — either way it // cannot be served. if !expanded.is_dir() { @@ -133,7 +133,7 @@ pub(super) fn handle_mkdir(body: &str) -> Vec { if name.starts_with('.') || name.contains('/') || name.contains('\\') || name.contains('\0') { return json_error("400 Bad Request", "invalid folder name"); } - let parent = crate::util::expand_tilde(request.path.trim()); + let parent = crate::platform::paths::expand_tilde(request.path.trim()); // is_dir() follows symlinks and is false for a missing path — the same gate // `open` uses for the directory it is handed. if !parent.is_dir() { @@ -206,13 +206,13 @@ fn persist_workspace(state: &ViewerState) { if !state.persist { return; } - let mut ws = crate::session::load_workspace().unwrap_or_default(); + let mut ws = crate::workspace::persistence::load_workspace().unwrap_or_default(); let active_path = ws.repos.get(ws.active).cloned(); ws.repos = state.catalog.paths(); ws.active = active_path .and_then(|path| ws.repos.iter().position(|repo| repo == &path)) .unwrap_or(0); - crate::session::save_workspace(&ws); + crate::workspace::persistence::save_workspace(&ws); } /// Resolve the `repo` parameter to an entry, or produce the 404 response. diff --git a/src/web/viewer/terminal/mod.rs b/src/web/viewer/terminal/mod.rs index 4a0654f0..9c5c3f43 100644 --- a/src/web/viewer/terminal/mod.rs +++ b/src/web/viewer/terminal/mod.rs @@ -169,7 +169,10 @@ impl TerminalHub { .expect("terminal worker slot poisoned") .take(); if let Some(handle) = handle { - crate::util::try_timed_join(handle, crate::util::REAP_TIMEOUT); + crate::platform::threading::try_timed_join( + handle, + crate::platform::threading::REAP_TIMEOUT, + ); } } } diff --git a/src/workspace/mod.rs b/src/workspace/mod.rs index 7f4282b5..8cc1a22b 100644 --- a/src/workspace/mod.rs +++ b/src/workspace/mod.rs @@ -9,8 +9,10 @@ mod repo_input; pub use repo_input::RepoInputResult; +pub(crate) mod persistence; + +use self::persistence::{MAX_REMEMBERED, RepoSession, SessionState, WorkspaceState}; use crate::app::{App, Notice, NoticeKind}; -use crate::session::{MAX_REMEMBERED, RepoSession, SessionState, WorkspaceState}; use crate::ui::status_view::RepoInput; use crossterm::event::KeyEvent; diff --git a/src/session.rs b/src/workspace/persistence.rs similarity index 100% rename from src/session.rs rename to src/workspace/persistence.rs diff --git a/src/workspace/repo_input.rs b/src/workspace/repo_input.rs index 96b7469c..4699ccd2 100644 --- a/src/workspace/repo_input.rs +++ b/src/workspace/repo_input.rs @@ -52,7 +52,7 @@ impl Workspace { } // The dialog is not a shell, so `~` has to be expanded here or a home // relative path would read as a directory literally named `~`. - let p = crate::util::expand_tilde(trimmed); + let p = crate::platform::paths::expand_tilde(trimmed); if !p.is_dir() { // The rejected path is already on screen in the input itself, so // the message names the problem only. From c0a098fd127bd6cd6054fd326bbd5a7766a03aaf Mon Sep 17 00:00:00 2001 From: whackur Date: Wed, 29 Jul 2026 11:18:49 +0900 Subject: [PATCH 03/19] chore: mark the viewer's built bundle as generated Co-Authored-By: Claude Opus 5 (1M context) --- .gitattributes | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 .gitattributes diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 00000000..5173424d --- /dev/null +++ b/.gitattributes @@ -0,0 +1,7 @@ +# The viewer's built bundle is committed so `cargo install` needs no Node +# toolchain (see src/web/viewer/assets.rs). Vite names every chunk by content +# hash, so any change under viewer-ui/src rewrites these files wholesale and +# buries the real diff. Collapse them: `-diff` prints one line instead of the +# bundle, `linguist-generated` folds them in GitHub reviews. Rebuild with +# `npm --prefix viewer-ui run build` — never hand-edit. +viewer-ui/dist/** -diff linguist-generated=true From e0643cb440944098c48bc4ea29467eebd96caf60 Mon Sep 17 00:00:00 2001 From: whackur Date: Wed, 29 Jul 2026 14:06:57 +0900 Subject: [PATCH 04/19] docs: plan the repo dialog path picker Records why the dialog completes paths natively instead of hosting a real shell (Windows has no readline equivalent, so a native completer is needed either way) and why the in-repo tree navigator cannot be reused for a filesystem picker. Co-Authored-By: Claude Opus 5 (1M context) --- Cargo.toml | 1 + docs/repo-picker-plan.md | 133 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 134 insertions(+) create mode 100644 docs/repo-picker-plan.md diff --git a/Cargo.toml b/Cargo.toml index fe126263..9bff4ee6 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -27,6 +27,7 @@ exclude = [ "release.toml", "CLAUDE.md", "docs/code-review-2026-05-08.md", + "docs/repo-picker-plan.md", "docs/status-short-plan.md", "docs/web-viewer-plan.md", ] diff --git a/docs/repo-picker-plan.md b/docs/repo-picker-plan.md new file mode 100644 index 00000000..a44f70c6 --- /dev/null +++ b/docs/repo-picker-plan.md @@ -0,0 +1,133 @@ +# repo 다이얼로그 경로 탐색 — 구현 계획 + +> **상태: 1단계 진행 중.** 확정된 설계는 구현과 함께 `docs/architecture.md`로 이관하고, +> 이 문서는 **왜 그렇게 갔는지**의 이력으로 남긴다. + +## 1. 문제 + +` o` repo 다이얼로그(`src/workspace/repo_input.rs`)는 append-only `String` +버퍼다. `Tab`은 `text_input_char`가 `None`을 돌려주므로 **완전히 무시**된다. 경로를 +전부 손으로 쳐야 하고, 어떤 하위 폴더가 있는지 볼 방법이 없다. + +## 2. 셸을 띄우지 않는 이유 + +`bash --norc -c 'read -e -p ...'`(readline) 또는 zsh `vared`를 PTY로 띄우면 완성이 +공짜로 따라온다. 검토 후 접었다: + +- **Windows에 대응 프리미티브가 없다.** PowerShell `Read-Host`는 완성이 없고 + (PSReadLine은 대화형 호스트 루프 전용), cmd `set /p`도 없다. Windows를 목표로 두는 + 순간 네이티브 완성기를 어차피 써야 하므로 셸은 *대체*가 아니라 *추가* 경로가 된다. +- 결과 회수가 PTY 스트림 하나뿐이라 sentinel/임시 파일 프로토콜이 필요하다. +- readline 후보 목록은 여러 줄 + "Display all N possibilities?"를 뿜어 hint bar 1줄로 + 안 되고, PTY 그리드 렌더 영역을 새로 만들어야 한다. +- `$SHELL` 그대로 쓰면 rc 오염·시작 지연·rc가 입력 대기 시 먹통 리스크가 붙는다. + +`std::fs::read_dir` 기반 네이티브 구현은 새 의존성 0, `cfg(windows)` 분기 0으로 +같은 체감을 준다. + +## 3. 기존 트리 인프라를 재사용하지 않는 이유 + +2단계(트리 피커)에서 `ViewMode::Tree` 자산을 쓰고 싶었지만 대부분 못 쓴다: + +- `git::tree::read_children`은 `git2::Repository`가 필수이고 **repo-relative** 경로만 + 받으며, `resolve_in_workdir`이 워크트리 밖 경로와 심볼릭 링크를 거부한다. 피커는 + *어떤 repo에도 속하지 않는* 경로를 돌아다녀야 하고 **프로젝트 0개 상태**에서도 떠야 + 한다 — 이 함수가 막으려고 만들어진 것이 정확히 피커의 일이다. +- `TreeView`(`src/ui/tree_view/mod.rs`)는 `App` 소유(프로젝트별)이고 search index / + show_set / row_width_cache가 repo-relative 트리 전용이다. 다이얼로그는 `Workspace` + 레벨이라 타입 공유가 아니라 expand/visible_rows **패턴만** 참고한다. +- `tree_list::render`는 `&App`, `app.focus`, `jump_legend(app, '1')`에 의존해 빈 화면에서 + 호출 불가. + +실제 재사용: `render_selectable_list`(`src/ui/helpers.rs`) 하나. 그리고 1단계의 +디렉터리 목록 함수는 2단계가 그대로 쓴다 — 두 단계의 공통 기반이다. + +## 4. 1단계 — Tab 완성 + +### 후보 표시 위치: notice 행 재사용 + +`chrome_rows`가 이미 두 화면 모두에 notice 행을 할당한다. 새 팝업 영역은 레이아웃과 +hit-test로 번지므로 기존 행을 쓴다. 우선순위: + +``` +에러 notice (빨강) > 후보 목록 (DarkGray) > repo 헤더 (경로/브랜치) +``` + +프로젝트 화면에서 그 행은 repo 헤더(`render_notice_row` → `render_repo_header`)라, +완성 중에는 후보가 헤더를 덮는다. 에러 notice가 이미 같은 방식으로 덮으므로 일관된다. +폭 초과 시 `+N more`로 자른다. + +### Tab 규칙: "진행이 있으면 진행, 없으면 보여준다" + +카운터 없는 무상태 규칙 하나로 readline 체감이 나온다. + +| 매칭 수 | 동작 | +| --- | --- | +| 0개 | 무변경. 에러 notice 띄우지 않음 — 타이핑 중 정상 상태다 | +| 1개 | 이름 + 구분자 삽입 → Tab 연타로 하위 탐색 | +| N개, 공통 접두사가 fragment와 다름 | 공통 접두사까지 확장(대소문자 교정 포함), 목록 없음 | +| N개, 더 확장 불가 | 후보 목록 표시 | + +`/`로 끝나는 상태(fragment 빈 상태)에서는 첫 Tab에 그 폴더 내용이 바로 뜬다 — 원래 +불편의 핵심 케이스. bash 기본값은 벨만 울리고 두 번째 Tab에 보여주지만, readline의 +`show-all-if-ambiguous on` 쪽을 택했다. + +### 매칭 규칙 + +- **디렉터리만.** repo 피커이므로. `file_type()`로 판정하고 심볼릭 링크일 때만 + `path().is_dir()`로 추가 stat — 심볼릭 링크된 repo를 살리면서 큰 디렉터리에서 + entry당 stat을 피한다. +- **구분자**: `/`는 항상, `\`는 `cfg!(windows)`일 때만. Unix에서 `\`는 합법 파일명 + 문자다. `cfg!` 상수 분기라 `#[cfg]` 블록이 필요 없다. +- **삽입할 구분자**: 버퍼에 이미 있는 마지막 구분자를 재사용, 없으면 + `MAIN_SEPARATOR`. Windows에서 `/`로 쳤는데 `\`가 섞이는 것을 막는다. +- **대소문자**: 정확한 접두사를 먼저 시도하고 0개일 때만 무시하고 재시도. Linux에서 + 예상 밖 매칭을 만들지 않고 macOS/Windows에선 편하다. +- **숨김 폴더**: fragment가 `.`로 시작할 때만 포함(셸 관례). +- **구분자 없는 버퍼**: 프로세스 cwd 기준 — `confirm_repo_input`이 상대 경로를 해석하는 + 기준과 같다. +- **비-UTF8 파일명 제외**: 버퍼가 `String`이라 `to_string_lossy`로 넣으면 다시 열 수 + 없는 경로가 된다. +- 접두사·공통접두사 계산은 char 단위(UTF-8 경계 안전). +- `read_dir` 실패(권한 없음, 디렉터리 아님)는 조용한 no-op. + +### 셸이 아니라는 것의 의미 + +`cd`/`ls` 등 커맨드, `$VAR`, 글롭, 커맨드 치환은 없다. Enter는 항상 "이 경로 열기"다. +동작하는 것: `~`·`~/rest`(`expand_tilde`), `..`(OS가 해석하고 확정 시 +`resolve_repo_path`가 canonicalize한다), cwd 기준 상대 경로. + +### 사용자가 입력한 텍스트는 다시 쓰지 않는다 + +`~`나 상대 경로는 **읽을 때만** 확장하고, 버퍼에는 완성된 컴포넌트만 이어붙인다. +`~/x`를 `/Users/me/x`로 바꿔 써넣지 않는다. + +### 작업 순서 + +1. `src/workspace/path_complete.rs` 신규 — 순수 함수 + 단위 테스트. + `complete_dir_path(buf) -> PathCompletion { buf, candidates }`. `Workspace`에 + 의존하지 않아 `tempfile`로 실제 트리를 만들어 검증한다. +2. 다이얼로그 배선 — `RepoInput.candidates`, `repo_input_complete()`, + `push`/`pop`/`accept_prefill`/`start`/`cancel`에서 후보 무효화, + `handlers.rs`에 `KeyCode::Tab` arm. `REPO_INPUT_MAX_BYTES` 상한은 호출자가 검사한다. +3. 후보 렌더 — `render_notice_row`가 후보를 받도록 확장, `draw`/`draw_empty` 갱신, + 폭 초과 시 `+N more`, 우선순위 테스트. +4. 문서 — `README.md` 키 표 + notice 행 설명, `docs/architecture.md`. + +각 단계 후 `cargo build && cargo test && cargo clippy --all-targets --all-features -- -D warnings` +통과 상태를 유지한다. 2단계까지만 머지된 중간 상태도 동작한다(완성은 되고 후보만 안 보임). + +## 5. 2단계 — 트리 피커 (1단계 완료 후 확정) + +방향만 기록한다. 세부는 1단계 착지 후 정한다. + +- **플로팅이 아니라 body 영역 전체를 쓰는 리스트.** `src/ui/`에 팝업/오버레이 인프라가 + 전혀 없다(`Clear` 위젯도 centered-rect 헬퍼도 없고, 모든 surface가 레이아웃 영역을 + 차지한다). 떠 있는 박스는 이 프로젝트 최초의 플로팅 UI가 되고 마우스 캡처가 기본 on이라 + `hit_test.rs`에 새 히트 영역을 끼워야 한다. body 전체를 쓰면 둘 다 크게 줄어든다. +- 1단계의 디렉터리 목록 함수를 그대로 쓴다. +- 텍스트 필드와 병행한다: 필드에서 `Tab`은 완성, 별도 키로 트리를 연다. 경로를 아는 + 경우(형제 체크아웃 — prefill이 노리는 케이스)는 타이핑이 빠르고, 모르는 경우는 트리가 + 낫다. 경쟁 관계가 아니다. +- 미정: 여는 키, 마지막 탐색 위치의 세션 저장 여부, 트리에서 `Enter`가 곧 확정인지 + 텍스트 필드로 되돌리는지. From 7fbb3cfdc017694e4868f66d41683ed55e5545b3 Mon Sep 17 00:00:00 2001 From: whackur Date: Wed, 29 Jul 2026 14:07:06 +0900 Subject: [PATCH 05/19] feat: complete repo dialog paths with Tab MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Tab was inert in the dialog: text_input_char rejects it, so the one field where a path is typed with no view of the filesystem had no way to look. One read_dir per press against the directory the buffer names, directories only. Extending and listing are independent: an extension that still narrows the prefix skips the list, but an empty fragment means "what is in here?" and lists even while extending. Exact-case matching runs first and only falls back to ignoring case, so Linux gains no surprise matches while macOS and Windows stop needing the on-disk casing. The typed text is never rewritten — a leading ~ is expanded to read the directory, not to replace what the user typed with an absolute path. Candidates are stored but not yet drawn; the notice row follows. Co-Authored-By: Claude Opus 5 (1M context) --- src/application/input/handlers.rs | 3 + src/ui/status_view.rs | 4 + src/ui/tests/chrome_tests.rs | 1 + src/workspace/mod.rs | 1 + src/workspace/path_complete.rs | 158 ++++++++++++++ src/workspace/path_complete/tests.rs | 262 ++++++++++++++++++++++++ src/workspace/repo_input.rs | 26 +++ src/workspace/tests/repo_input_tests.rs | 70 +++++++ 8 files changed, 525 insertions(+) create mode 100644 src/workspace/path_complete.rs create mode 100644 src/workspace/path_complete/tests.rs diff --git a/src/application/input/handlers.rs b/src/application/input/handlers.rs index b7419258..afbb4274 100644 --- a/src/application/input/handlers.rs +++ b/src/application/input/handlers.rs @@ -51,6 +51,9 @@ pub(crate) fn handle_repo_input_key(ws: &mut Workspace, key: KeyEvent) -> KeyOut // The caret is always at the end of the buffer, so these can't move // it; they mean "keep this path and let me extend it". KeyCode::Right | KeyCode::End => ws.repo_input_accept_prefill(), + // `BackTab` is deliberately unhandled: completion here never cycles, so + // there is nothing for a reverse Tab to step back through. + KeyCode::Tab => ws.repo_input_complete(), _ => { if let Some(c) = text_input_char(key) { ws.repo_input_push(c); diff --git a/src/ui/status_view.rs b/src/ui/status_view.rs index 2e361124..2581557b 100644 --- a/src/ui/status_view.rs +++ b/src/ui/status_view.rs @@ -103,4 +103,8 @@ pub struct RepoInput { /// whole prefill; Backspace clears the flag instead, keeping the text /// and entering ordinary editing (the sub-directory case). pub prefilled: bool, + /// Directory names offered by the last Tab press, shown on the notice row. + /// Any edit clears them: the list describes a fragment that no longer + /// matches what is in the buffer. + pub candidates: Vec, } diff --git a/src/ui/tests/chrome_tests.rs b/src/ui/tests/chrome_tests.rs index dbf8450c..ce262b6a 100644 --- a/src/ui/tests/chrome_tests.rs +++ b/src/ui/tests/chrome_tests.rs @@ -42,6 +42,7 @@ fn the_empty_screen_shows_the_dialog_and_its_rejection() { active: true, buf: "/definitely/not/here".to_string(), prefilled: false, + candidates: Vec::new(), }; let notice = crate::app::Notice::new(NoticeKind::RepoInput, "no such directory"); diff --git a/src/workspace/mod.rs b/src/workspace/mod.rs index 8cc1a22b..cde7ea55 100644 --- a/src/workspace/mod.rs +++ b/src/workspace/mod.rs @@ -5,6 +5,7 @@ //! project. Every project drains its queues each tick whether or not it is on //! screen; snapshots apply to the active one only. +mod path_complete; mod repo_input; pub use repo_input::RepoInputResult; diff --git a/src/workspace/path_complete.rs b/src/workspace/path_complete.rs new file mode 100644 index 00000000..a907ab3b --- /dev/null +++ b/src/workspace/path_complete.rs @@ -0,0 +1,158 @@ +//! Tab completion for the repo dialog's path field. +//! +//! One `read_dir` per Tab press, against the single directory the buffer names +//! — a deep tree is never walked. Directories only: the dialog opens a repo and +//! a file can never be one. +//! +//! The dialog is not a shell, so only what `confirm_repo_input` itself accepts +//! is understood here: `~`, `..`, and cwd-relative paths. No `$VAR`, no globs. + +use std::path::MAIN_SEPARATOR; + +/// What one Tab press does to the buffer. +pub(crate) struct PathCompletion { + /// The buffer after completion — unchanged when nothing matched. + pub buf: String, + /// Directory names to offer. Empty when the completion was unambiguous, + /// when nothing matched, or when the buffer grew: a list is only worth + /// showing once typing can no longer narrow things down. + pub candidates: Vec, +} + +/// Whether `c` ends a path component. `\` counts on Windows only — on Unix it +/// is a legal filename character, so treating it as a separator there would +/// split paths that contain one. +fn is_sep(c: char) -> bool { + c == '/' || (cfg!(windows) && c == '\\') +} + +/// Complete the last component of `buf` against the directory the rest of it +/// names. See the module docs for the rules; the caller owns the length cap and +/// decides whether to apply the result. +/// +/// The user's own text is never rewritten: a leading `~` or a relative path is +/// expanded for reading only, and the returned buffer keeps the typed prefix +/// with just the completed component appended. +pub(crate) fn complete_dir_path(buf: &str) -> PathCompletion { + let unchanged = || PathCompletion { + buf: buf.to_string(), + candidates: Vec::new(), + }; + + // Split at the last separator: everything up to and including it names the + // directory to list, and the rest is the prefix being completed. + let (dir_text, frag, sep) = match buf.char_indices().rfind(|(_, c)| is_sep(*c)) { + Some((i, c)) => (&buf[..i + c.len_utf8()], &buf[i + c.len_utf8()..], c), + // No separator at all: complete against the process cwd, matching how + // `confirm_repo_input` resolves a bare relative path. + None => ("", buf, MAIN_SEPARATOR), + }; + + let dir = crate::platform::paths::expand_tilde(if dir_text.is_empty() { + "." + } else { + dir_text + }); + // A path that isn't a readable directory yet is the normal mid-typing + // state, not an error worth reporting. + let Ok(read) = std::fs::read_dir(&dir) else { + return unchanged(); + }; + + let show_hidden = frag.starts_with('.'); + let names: Vec = read + .flatten() + .filter(is_dir_entry) + // A non-UTF-8 name cannot round-trip through the `String` buffer, so + // completing to it would produce a path that no longer opens. + .filter_map(|e| e.file_name().into_string().ok()) + .filter(|n| show_hidden || !n.starts_with('.')) + .collect(); + + let mut matches: Vec<&str> = names + .iter() + .map(String::as_str) + .filter(|n| n.starts_with(frag)) + .collect(); + if matches.is_empty() { + // Retry ignoring case only once the exact prefix has found nothing: on + // case-insensitive filesystems (macOS, Windows) the typed casing rarely + // matches the disk, and on Linux this can never shadow an exact match. + let lower = frag.to_lowercase(); + matches = names + .iter() + .map(String::as_str) + .filter(|n| n.to_lowercase().starts_with(&lower)) + .collect(); + } + matches.sort_unstable(); + + match matches.len() { + 0 => unchanged(), + // Append the separator too, so Tab can be pressed again to descend. + 1 => PathCompletion { + buf: format!("{dir_text}{}{sep}", matches[0]), + candidates: Vec::new(), + }, + _ => { + let common = longest_common_prefix(&matches); + // Extending also corrects casing, so this fires whenever the shared + // prefix reads differently from what was typed, not only when it is + // longer. + let extended = common != frag; + // Listing and extending are independent. While typing can still be + // narrowed by an extension the list would be noise — except on a + // directory boundary, where an empty fragment means "what is in + // here?" and a silent extension answers nothing. + let candidates = if extended && !frag.is_empty() { + Vec::new() + } else { + matches.iter().map(|n| n.to_string()).collect() + }; + PathCompletion { + buf: if extended { + format!("{dir_text}{common}") + } else { + buf.to_string() + }, + candidates, + } + } + } +} + +/// `file_type` comes free with the directory read on most platforms; only a +/// symlink costs the extra stat to see what it points at. Symlinked checkouts +/// are common enough that reporting them as non-directories would hide real +/// repos, so unlike the in-repo tree navigator this one follows them. +fn is_dir_entry(entry: &std::fs::DirEntry) -> bool { + match entry.file_type() { + Ok(t) if t.is_symlink() => entry.path().is_dir(), + Ok(t) => t.is_dir(), + // An entry that vanished or cannot be stat'd is dropped rather than + // failing the whole listing. + Err(_) => false, + } +} + +/// Longest prefix shared by every name, truncated on a char boundary so a +/// multi-byte name never splits mid-codepoint. +fn longest_common_prefix(names: &[&str]) -> String { + let Some((first, rest)) = names.split_first() else { + return String::new(); + }; + let mut end = first.len(); + for name in rest { + let shared = first + .char_indices() + .zip(name.chars()) + .take_while(|((_, a), b)| a == b) + .last() + .map_or(0, |((i, a), _)| i + a.len_utf8()); + end = end.min(shared); + } + first[..end].to_string() +} + +#[cfg(test)] +mod tests; diff --git a/src/workspace/path_complete/tests.rs b/src/workspace/path_complete/tests.rs new file mode 100644 index 00000000..9324c43c --- /dev/null +++ b/src/workspace/path_complete/tests.rs @@ -0,0 +1,262 @@ +use super::*; +use std::path::Path; +use tempfile::TempDir; + +/// A directory holding `dirs` as sub-directories and `files` as plain files. +fn tree(dirs: &[&str], files: &[&str]) -> TempDir { + let root = TempDir::new().expect("a temp dir"); + for d in dirs { + std::fs::create_dir(root.path().join(d)).expect("create dir"); + } + for f in files { + std::fs::write(root.path().join(f), b"x").expect("create file"); + } + root +} + +/// `/` as the dialog buffer would hold it. `/` is a separator on +/// every supported platform, so it stands in for whatever the user typed. +fn buf_in(root: &Path, frag: &str) -> String { + format!("{}/{frag}", root.to_str().expect("a UTF-8 temp path")) +} + +#[test] +fn completing_a_unique_directory_appends_a_separator_to_descend() { + let root = tree(&["nightcrow"], &[]); + + let c = complete_dir_path(&buf_in(root.path(), "night")); + + assert_eq!(c.buf, buf_in(root.path(), "nightcrow/")); + assert!(c.candidates.is_empty(), "a unique match needs no list"); +} + +#[test] +fn completing_an_ambiguous_prefix_extends_it_without_listing() { + let root = tree(&["nightcrow", "nightowl"], &[]); + + let c = complete_dir_path(&buf_in(root.path(), "n")); + + assert_eq!(c.buf, buf_in(root.path(), "night")); + assert!( + c.candidates.is_empty(), + "while an extension still narrows the prefix, a list is noise" + ); +} + +#[test] +fn completing_a_prefix_that_cannot_grow_lists_the_candidates() { + let root = tree(&["nightcrow", "nightowl"], &[]); + let buf = buf_in(root.path(), "night"); + + let c = complete_dir_path(&buf); + + assert_eq!(c.buf, buf, "with nothing left to extend the text stands"); + assert_eq!(c.candidates, vec!["nightcrow", "nightowl"]); +} + +#[test] +fn completing_at_a_directory_boundary_lists_every_subdirectory() { + let root = tree(&["alpha", "beta"], &[]); + let buf = buf_in(root.path(), ""); + + let c = complete_dir_path(&buf); + + assert_eq!(c.buf, buf); + assert_eq!(c.candidates, vec!["alpha", "beta"]); +} + +#[test] +fn completing_at_a_directory_boundary_lists_even_while_extending() { + // An empty fragment means "what is in here?", so the shared `sr` prefix + // gets applied *and* the list shown — extending alone would answer nothing. + let root = tree(&["src", "srv"], &[]); + + let c = complete_dir_path(&buf_in(root.path(), "")); + + assert_eq!(c.buf, buf_in(root.path(), "sr")); + assert_eq!(c.candidates, vec!["src", "srv"]); +} + +#[test] +fn completing_skips_files_because_a_repo_must_be_a_directory() { + let root = tree(&["target"], &["tags", "tsconfig.json"]); + + let c = complete_dir_path(&buf_in(root.path(), "t")); + + assert_eq!( + c.buf, + buf_in(root.path(), "target/"), + "the two files must not make the directory ambiguous" + ); +} + +#[test] +fn completing_hides_dotted_directories_until_the_fragment_starts_with_a_dot() { + let root = tree(&[".config", "docs"], &[]); + + let visible = complete_dir_path(&buf_in(root.path(), "")); + assert_eq!(visible.buf, buf_in(root.path(), "docs/")); + + let hidden = complete_dir_path(&buf_in(root.path(), ".")); + assert_eq!(hidden.buf, buf_in(root.path(), ".config/")); +} + +#[test] +fn completing_an_unmatched_prefix_leaves_the_buffer_alone() { + let root = tree(&["docs"], &[]); + let buf = buf_in(root.path(), "zzz"); + + let c = complete_dir_path(&buf); + + assert_eq!(c.buf, buf); + assert!(c.candidates.is_empty()); +} + +#[test] +fn completing_an_empty_directory_leaves_the_buffer_alone() { + let root = tree(&[], &["only-a-file"]); + let buf = buf_in(root.path(), ""); + + let c = complete_dir_path(&buf); + + assert_eq!(c.buf, buf); + assert!(c.candidates.is_empty()); +} + +#[test] +fn completing_inside_an_unreadable_directory_leaves_the_buffer_alone() { + // Mid-typing the buffer routinely names a directory that does not exist. + // That is not an error worth reporting, so it must be a silent no-op. + let buf = "/nonexistent-dir-for-nightcrow-tests/x".to_string(); + + let c = complete_dir_path(&buf); + + assert_eq!(c.buf, buf); + assert!(c.candidates.is_empty()); +} + +#[test] +fn completing_a_bare_fragment_with_no_separator_does_not_panic() { + // Exercises the cwd branch without depending on the working directory's + // contents, which other tests may be changing in parallel. + let buf = "zzz-no-such-prefix-in-cwd".to_string(); + + let c = complete_dir_path(&buf); + + assert_eq!(c.buf, buf); + assert!(c.candidates.is_empty()); +} + +#[test] +fn completing_keeps_a_tilde_literal_instead_of_expanding_it_into_the_buffer() { + // `~` is expanded to read the directory, but writing the expansion back + // would replace the user's text with an absolute path they never typed. + let home = dirs::home_dir().expect("a home directory"); + let home_str = home.to_str().expect("a UTF-8 home path"); + + let c = complete_dir_path("~/"); + + assert!( + c.buf.starts_with("~/"), + "the typed prefix must survive, got: {}", + c.buf + ); + assert!( + !c.buf.contains(home_str), + "the home path must not be written into the buffer, got: {}", + c.buf + ); +} + +#[test] +fn completing_falls_back_to_ignoring_case_and_corrects_the_typed_casing() { + let root = tree(&["Documents"], &[]); + + let c = complete_dir_path(&buf_in(root.path(), "docu")); + + assert_eq!( + c.buf, + buf_in(root.path(), "Documents/"), + "a case-insensitive match must be recased to the name on disk" + ); +} + +// Only a case-sensitive filesystem can hold `Docs` and `docs` side by side; +// APFS and NTFS reject the second `create_dir` as AlreadyExists. The fallback +// this covers therefore only has anything to disambiguate on Linux. +#[cfg(target_os = "linux")] +#[test] +fn completing_prefers_an_exact_case_match_over_a_case_insensitive_one() { + let root = tree(&["Docs", "docs"], &[]); + + let c = complete_dir_path(&buf_in(root.path(), "docs")); + + assert_eq!( + c.buf, + buf_in(root.path(), "docs/"), + "the exact-case pass must resolve this before the fallback runs" + ); +} + +#[test] +fn completing_handles_multi_byte_names_on_a_char_boundary() { + let root = tree(&["한국어-프로젝트", "한국어-문서"], &[]); + + let c = complete_dir_path(&buf_in(root.path(), "한")); + + assert_eq!( + c.buf, + buf_in(root.path(), "한국어-"), + "the shared prefix must stop on a char boundary, not a byte one" + ); +} + +// APFS validates filenames as UTF-8 and rejects the create outright, so only +// Linux can stage an entry the listing has to skip. +#[cfg(target_os = "linux")] +#[test] +fn completing_skips_names_that_are_not_valid_utf8() { + use std::os::unix::ffi::OsStrExt; + + let root = TempDir::new().expect("a temp dir"); + std::fs::create_dir(root.path().join("docs")).expect("create dir"); + let invalid = std::ffi::OsStr::from_bytes(b"do\xffcs"); + std::fs::create_dir(root.path().join(invalid)).expect("create dir"); + + let c = complete_dir_path(&buf_in(root.path(), "do")); + + assert_eq!( + c.buf, + buf_in(root.path(), "docs/"), + "a non-UTF-8 name cannot round-trip the buffer, so it must not compete" + ); +} + +#[cfg(windows)] +#[test] +fn completing_reuses_the_separator_already_in_the_buffer() { + let root = tree(&["docs"], &[]); + let base = root.path().to_str().expect("a UTF-8 temp path").to_string(); + + let c = complete_dir_path(&format!("{base}/do")); + + assert!( + c.buf.ends_with("docs/"), + "a buffer typed with `/` must not gain a `\\`, got: {}", + c.buf + ); +} + +#[cfg(unix)] +#[test] +fn completing_follows_a_symlink_to_a_directory() { + // Symlinked checkouts are common, and reporting one as a non-directory + // would hide a real repo from the picker. + let root = tree(&["real"], &[]); + std::os::unix::fs::symlink(root.path().join("real"), root.path().join("linked")) + .expect("create symlink"); + + let c = complete_dir_path(&buf_in(root.path(), "link")); + + assert_eq!(c.buf, buf_in(root.path(), "linked/")); +} diff --git a/src/workspace/repo_input.rs b/src/workspace/repo_input.rs index 4699ccd2..3113c227 100644 --- a/src/workspace/repo_input.rs +++ b/src/workspace/repo_input.rs @@ -31,6 +31,7 @@ impl Workspace { .unwrap_or_default(); self.repo_input.active = true; self.repo_input.prefilled = true; + self.repo_input.candidates.clear(); self.clear_notice(NoticeKind::RepoInput); } @@ -38,6 +39,7 @@ impl Workspace { self.repo_input.active = false; self.repo_input.buf.clear(); self.repo_input.prefilled = false; + self.repo_input.candidates.clear(); self.clear_notice(NoticeKind::RepoInput); } @@ -72,10 +74,31 @@ impl Workspace { self.repo_input.active = false; self.repo_input.buf.clear(); self.repo_input.prefilled = false; + self.repo_input.candidates.clear(); self.clear_notice(NoticeKind::RepoInput); RepoInputResult::Open(resolved) } + /// Extend the typed path from disk, and offer the directories it could + /// still become. Bound to Tab, which is otherwise inert in a text field — + /// and this is the one field where a path is typed with no way to see what + /// is actually there. + pub fn repo_input_complete(&mut self) { + // Tab reads as "extend this path", so an untouched prefill survives + // rather than being replaced — the same reading Backspace and → give it. + self.repo_input.prefilled = false; + let completed = super::path_complete::complete_dir_path(&self.repo_input.buf); + // A completion that would breach the cap is dropped whole: applying a + // truncated path would silently point somewhere else. + if completed.buf.len() > REPO_INPUT_MAX_BYTES { + return; + } + // Any edit invalidates the verdict on the old text, completion included. + self.clear_notice(NoticeKind::RepoInput); + self.repo_input.buf = completed.buf; + self.repo_input.candidates = completed.candidates; + } + pub fn repo_input_push(&mut self, ch: char) { // Typing over an untouched prefill replaces it: the dialog opens on // the current repo path, and a user heading somewhere unrelated would @@ -90,6 +113,7 @@ impl Workspace { } // Any edit invalidates the verdict on the old text. self.clear_notice(NoticeKind::RepoInput); + self.repo_input.candidates.clear(); self.repo_input.buf.push(ch); } @@ -99,6 +123,7 @@ impl Workspace { /// this" without Backspace eating the separator first. pub fn repo_input_accept_prefill(&mut self) { self.repo_input.prefilled = false; + self.repo_input.candidates.clear(); } pub fn repo_input_pop(&mut self) { @@ -106,6 +131,7 @@ impl Workspace { // and just leave prefill mode. self.repo_input.prefilled = false; self.clear_notice(NoticeKind::RepoInput); + self.repo_input.candidates.clear(); self.repo_input.buf.pop(); } } diff --git a/src/workspace/tests/repo_input_tests.rs b/src/workspace/tests/repo_input_tests.rs index 9f341e1a..dc40ec20 100644 --- a/src/workspace/tests/repo_input_tests.rs +++ b/src/workspace/tests/repo_input_tests.rs @@ -68,6 +68,76 @@ fn confirming_a_tilde_path_opens_the_home_relative_directory() { ); } +/// A workspace whose prefill is `/`, so Tab has a real +/// directory to complete against. +fn workspace_completing_in(root: &tempfile::TempDir, frag: &str) -> (Workspace, String) { + let base = format!("{}/", root.path().to_str().expect("a UTF-8 temp path")); + let mut ws = workspace_on(&[&format!("{base}{frag}")]); + ws.start_repo_input(); + (ws, base) +} + +#[test] +fn completing_extends_an_untouched_prefill_instead_of_replacing_it() { + // Typing over a prefill replaces it, but Tab means "extend this path" — + // the same reading Backspace and → already give it. + let root = tempfile::TempDir::new().expect("a temp dir"); + std::fs::create_dir(root.path().join("nightcrow")).expect("create dir"); + let (mut ws, base) = workspace_completing_in(&root, "night"); + + ws.repo_input_complete(); + + assert_eq!(ws.repo_input.buf, format!("{base}nightcrow/")); + assert!( + !ws.repo_input.prefilled, + "the prefill is spent, so the next keystroke must append" + ); +} + +#[test] +fn completing_at_a_directory_boundary_offers_the_subdirectories() { + let root = tempfile::TempDir::new().expect("a temp dir"); + std::fs::create_dir(root.path().join("alpha")).expect("create dir"); + std::fs::create_dir(root.path().join("beta")).expect("create dir"); + let (mut ws, base) = workspace_completing_in(&root, ""); + + ws.repo_input_complete(); + + assert_eq!(ws.repo_input.buf, base, "nothing shared to extend"); + assert_eq!(ws.repo_input.candidates, vec!["alpha", "beta"]); +} + +#[test] +fn editing_after_a_completion_drops_the_stale_candidate_list() { + let root = tempfile::TempDir::new().expect("a temp dir"); + std::fs::create_dir(root.path().join("alpha")).expect("create dir"); + std::fs::create_dir(root.path().join("beta")).expect("create dir"); + let (mut ws, _) = workspace_completing_in(&root, ""); + ws.repo_input_complete(); + assert_eq!(ws.repo_input.candidates.len(), 2); + + ws.repo_input_push('a'); + + assert!( + ws.repo_input.candidates.is_empty(), + "the list described a fragment the buffer no longer holds" + ); +} + +#[test] +fn completing_a_path_that_matches_nothing_raises_no_notice() { + // Mid-typing, a path that does not exist yet is the normal state — only + // confirming one is an error. + let root = tempfile::TempDir::new().expect("a temp dir"); + let (mut ws, base) = workspace_completing_in(&root, "zzz"); + + ws.repo_input_complete(); + + assert_eq!(ws.repo_input.buf, format!("{base}zzz")); + assert!(ws.repo_input.candidates.is_empty()); + assert!(ws.empty_notice().is_none()); +} + #[test] fn reopening_the_dialog_re_arms_the_prefill() { let mut ws = workspace_on(&["/repos/current"]); From 6478aca585779c9a4a697512a9ec8adc440b6da2 Mon Sep 17 00:00:00 2001 From: whackur Date: Wed, 29 Jul 2026 14:10:46 +0900 Subject: [PATCH 06/19] feat: show repo-path candidates on the notice row MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The candidates the completer produced had nowhere to go. They take the notice row, which already exists on both screens, rather than a floating popup that would be this project's first — and would need its own hit-test regions with the mouse captured. Priority on that row is notice, then candidates, then the repo header: a notice explains a rejected action and any edit clears it, so the two never stay stale together. A list too wide for the row reports the tail as `+N more` instead of dropping it silently. Co-Authored-By: Claude Opus 5 (1M context) --- src/ui/mod.rs | 18 ++++---- src/ui/notice.rs | 76 ++++++++++++++++++++++++++++--- src/ui/tests/common.rs | 13 +++++- src/ui/tests/notice_tests.rs | 81 ++++++++++++++++++++++++++++++++++ src/workspace/path_complete.rs | 7 +-- 5 files changed, 175 insertions(+), 20 deletions(-) diff --git a/src/ui/mod.rs b/src/ui/mod.rs index f0d1d530..b2afad66 100644 --- a/src/ui/mod.rs +++ b/src/ui/mod.rs @@ -76,14 +76,11 @@ pub fn draw_empty( rows.body, ); - // Matches `render_notice_row`: a notice is the same red wherever it lands. - let notice_line = match notice { - Some(n) => Line::from(Span::styled( - format!(" {}", n.line()), - Style::default().fg(Color::Red).add_modifier(Modifier::BOLD), - )), - None => Line::default(), - }; + // Shares `render_notice_row`'s priority order so a notice looks the same + // wherever it lands; with no project there is no repo header to fall back + // to, so the row just goes empty. + let notice_line = notice::notice_or_candidates(notice, chrome.repo_input, rows.notice.width) + .unwrap_or_default(); frame.render_widget(Paragraph::new(notice_line), rows.notice); // The armed prefix shows the same chip as the project screen: pressing @@ -132,7 +129,10 @@ pub fn draw( project_tab::render(tabs.repo_paths, tabs.active, rows.tabs, accent), rows.tabs, ); - frame.render_widget(render_notice_row(app, accent), notice_area); + frame.render_widget( + render_notice_row(app, tabs.repo_input, accent, notice_area.width), + notice_area, + ); if app.terminal.fullscreen.fills_body() { let cursor = terminal_tab::render(frame, app, body_area, accent); diff --git a/src/ui/notice.rs b/src/ui/notice.rs index 292a1f2d..2f985876 100644 --- a/src/ui/notice.rs +++ b/src/ui/notice.rs @@ -1,18 +1,84 @@ -use crate::app::App; +use crate::app::{App, Notice}; +use crate::ui::status_view::RepoInput; use ratatui::{ style::{Color, Modifier, Style}, text::{Line, Span}, widgets::Paragraph, }; -pub(crate) fn render_notice_row<'a>(app: &'a App, accent: Color) -> Paragraph<'a> { - if let Some(notice) = app.notice.as_ref() { - return Paragraph::new(Line::from(Span::styled( +/// Separates candidate names, and sits before the overflow count. +const CANDIDATE_GAP: &str = " "; + +pub(crate) fn render_notice_row<'a>( + app: &'a App, + repo_input: &RepoInput, + accent: Color, + width: u16, +) -> Paragraph<'a> { + match notice_or_candidates(app.notice.as_ref(), repo_input, width) { + Some(line) => Paragraph::new(line), + None => render_repo_header(app, accent), + } +} + +/// The notice row's content when something wants to claim it: a notice first, +/// then the repo dialog's completion candidates. `None` leaves the row to the +/// caller's own fallback — the repo header on the project screen, nothing on the +/// empty one. +/// +/// A notice outranks the candidates because it explains a rejected action, and +/// any edit (Tab included) clears it, so the two rarely compete for long. +pub(crate) fn notice_or_candidates<'a>( + notice: Option<&'a Notice>, + repo_input: &RepoInput, + width: u16, +) -> Option> { + if let Some(notice) = notice { + return Some(Line::from(Span::styled( format!(" {}", notice.line()), Style::default().fg(Color::Red).add_modifier(Modifier::BOLD), ))); } - render_repo_header(app, accent) + if repo_input.candidates.is_empty() { + return None; + } + // Dim, not red: these are an answer to Tab, and reading them as an error + // would undo the point of showing them. + Some(Line::from(Span::styled( + candidate_line(&repo_input.candidates, width), + Style::default().fg(Color::DarkGray), + ))) +} + +/// Fit as many candidate names as the row holds, reporting the rest as +/// `+N more`. The row is one line, so a long list has to be cut somewhere and +/// dropping the tail silently would read as "that is all there is". +fn candidate_line(candidates: &[String], width: u16) -> String { + let width = width as usize; + let mut line = String::new(); + let mut shown = 0; + for name in candidates { + let next = format!("{}{name}", if shown == 0 { " " } else { CANDIDATE_GAP }); + // Reserve room for the count this name would push into the overflow, so + // the last name placed can never crowd out its own `+N more`. + let overflow = overflow_label(candidates.len() - shown - 1); + if Span::raw(&line).width() + Span::raw(&next).width() + Span::raw(&overflow).width() + > width + { + break; + } + line.push_str(&next); + shown += 1; + } + line.push_str(&overflow_label(candidates.len() - shown)); + line +} + +fn overflow_label(remaining: usize) -> String { + if remaining == 0 { + return String::new(); + } + format!("{CANDIDATE_GAP}+{remaining} more") } pub(crate) fn render_repo_header<'a>(app: &'a App, accent: Color) -> Paragraph<'a> { diff --git a/src/ui/tests/common.rs b/src/ui/tests/common.rs index 3a0646c7..c2f80170 100644 --- a/src/ui/tests/common.rs +++ b/src/ui/tests/common.rs @@ -15,9 +15,20 @@ use ratatui::{ use syntect::highlighting::ThemeSet; pub(super) fn notice_text(app: &App) -> String { + notice_text_with(app, &RepoInput::default()) +} + +/// The notice row with a dialog state that can be claiming it — completion +/// candidates share the row with notices and the repo header. +pub(super) fn notice_text_with(app: &App, repo_input: &RepoInput) -> String { let mut terminal = Terminal::new(TestBackend::new(200, 1)).unwrap(); terminal - .draw(|frame| frame.render_widget(render_notice_row(app, Color::Yellow), frame.area())) + .draw(|frame| { + frame.render_widget( + render_notice_row(app, repo_input, Color::Yellow, frame.area().width), + frame.area(), + ) + }) .unwrap(); let buf = terminal.backend().buffer(); (0..buf.area.width) diff --git a/src/ui/tests/notice_tests.rs b/src/ui/tests/notice_tests.rs index 3bf606c0..bd021362 100644 --- a/src/ui/tests/notice_tests.rs +++ b/src/ui/tests/notice_tests.rs @@ -64,6 +64,87 @@ fn notice_row_shows_notices_through_every_overlay() { } } +fn dialog_offering(candidates: &[&str]) -> crate::ui::status_view::RepoInput { + crate::ui::status_view::RepoInput { + active: true, + buf: "/repos/".to_string(), + prefilled: false, + candidates: candidates.iter().map(|c| c.to_string()).collect(), + } +} + +#[test] +fn completion_candidates_take_the_notice_row_over_repo_identity() { + let mut app = app_with_files(vec![]); + app.repo_path = "/tmp/somewhere".to_string(); + + let text = notice_text_with(&app, &dialog_offering(&["nightcrow", "nightowl"])); + + assert!(text.contains("nightcrow"), "got: {text}"); + assert!(text.contains("nightowl"), "got: {text}"); + assert!( + !text.contains("/tmp/somewhere"), + "the candidates answer the Tab that is on screen, got: {text}" + ); +} + +/// A notice explains a rejected action, so it outranks a candidate list — and +/// because any edit clears it, the two cannot both be stale for long. +#[test] +fn a_notice_outranks_the_completion_candidates() { + let mut app = app_with_files(vec![]); + app.raise_notice(NoticeKind::RepoInput, "no such directory"); + + let text = notice_text_with(&app, &dialog_offering(&["nightcrow"])); + + assert!(text.contains("no such directory"), "got: {text}"); + assert!(!text.contains("nightcrow"), "got: {text}"); +} + +#[test] +fn a_candidate_list_too_wide_for_the_row_reports_what_it_dropped() { + let mut terminal = + ratatui::Terminal::new(ratatui::backend::TestBackend::new(24, 1)).expect("a terminal"); + let app = app_with_files(vec![]); + let dialog = dialog_offering(&["alpha", "bravo", "charlie", "delta"]); + + terminal + .draw(|frame| { + frame.render_widget( + crate::ui::notice::render_notice_row( + &app, + &dialog, + ratatui::style::Color::Yellow, + frame.area().width, + ), + frame.area(), + ) + }) + .expect("draw"); + let buf = terminal.backend().buffer(); + let text: String = (0..buf.area.width).map(|x| buf[(x, 0)].symbol()).collect(); + + assert!(text.contains("alpha"), "got: {text}"); + assert!( + text.contains("more"), + "a truncated list must say the tail exists, got: {text}" + ); + assert!( + !text.contains("delta"), + "the row is 24 columns wide, got: {text}" + ); +} + +#[test] +fn the_empty_screen_shows_completion_candidates_too() { + // With no project there is no repo header to fall back to, so the row is + // free — but it still has to render the list. + let text = drawn_empty(&dialog_offering(&["nightcrow", "nightowl"]), None, false); + + assert!(text.contains("nightcrow"), "got: {text}"); + assert!(text.contains("nightowl"), "got: {text}"); +} + /// With nothing raised the row is the repo/branch line, and it comes back /// intact after a notice is cleared. #[test] diff --git a/src/workspace/path_complete.rs b/src/workspace/path_complete.rs index a907ab3b..737f9fea 100644 --- a/src/workspace/path_complete.rs +++ b/src/workspace/path_complete.rs @@ -48,11 +48,8 @@ pub(crate) fn complete_dir_path(buf: &str) -> PathCompletion { None => ("", buf, MAIN_SEPARATOR), }; - let dir = crate::platform::paths::expand_tilde(if dir_text.is_empty() { - "." - } else { - dir_text - }); + let dir = + crate::platform::paths::expand_tilde(if dir_text.is_empty() { "." } else { dir_text }); // A path that isn't a readable directory yet is the normal mid-typing // state, not an error worth reporting. let Ok(read) = std::fs::read_dir(&dir) else { From 66f57a05343e1828646a580e549f3b62ef4f7903 Mon Sep 17 00:00:00 2001 From: whackur Date: Wed, 29 Jul 2026 14:11:40 +0900 Subject: [PATCH 07/19] docs: document Tab completion in the repo dialog Covers the key, the extend-or-list rule, what is offered (directories only, dotted ones on request, case corrected), and the boundary that trips people up: the field takes ~ / .. / relative paths but is not a shell. Co-Authored-By: Claude Opus 5 (1M context) --- README.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 2535b16d..4024f399 100644 --- a/README.md +++ b/README.md @@ -123,7 +123,9 @@ The diff for a selected file shows the combined working-tree-with-index changes. **Tree view** (` b`) — a read-only directory tree of the whole working tree on the left, with the selected file's raw contents on the right. Unlike the status view (which lists only changed files), the tree lets you browse and read *any* file next to the diff without leaving nightcrow. `j`/`k` move the cursor, `→`/`Enter` expand a directory (read lazily, one level at a time), `←` collapses it or steps up to the parent, and selecting a file previews it. Press `/` while the tree is focused for a recursive filename search across the whole tree — type to filter, `Enter` reveals the selected match in place (expanding its ancestor directories), `Esc` cancels. Focus the file preview with ` 2`, then press `/` to search within the file contents — `n`/`N` jump to the next/previous match, `Esc` clears the search. `.gitignore`-matched paths (e.g. `target/`, `node_modules/`) are hidden by default — toggle with `[tree] respect_gitignore`. Expanded directories are watched for filesystem changes, so files and folders created, moved, or deleted by another process (an editor, `git`, an LLM CLI) appear without leaving the view; set `[tree] live_watch = false` to refresh only on entry instead. The tree never writes, renames, or deletes anything. Expansion state and the selected path persist across sessions. -**Notice row** — a one-row strip just above the hint bar shows the repo path (home-relative, e.g. `~/projects/myapp`), the current branch, and ahead/behind counts (`↑N ↓M`) when the branch tracks an upstream. When something fails — a git snapshot, a diff load, a terminal pane, or a repo path you typed that doesn't exist — the message takes over this row in red until the problem is resolved or you act on the app again. A rejected repo path therefore appears directly above the input you're correcting. +**Notice row** — a one-row strip just above the hint bar shows the repo path (home-relative, e.g. `~/projects/myapp`), the current branch, and ahead/behind counts (`↑N ↓M`) when the branch tracks an upstream. When something fails — a git snapshot, a diff load, a terminal pane, or a repo path you typed that doesn't exist — the message takes over this row in red until the problem is resolved or you act on the app again. A rejected repo path therefore appears directly above the input you're correcting. The repo dialog's completion candidates share this row (dimmed, and a notice outranks them), so a list too long for one line ends in `+N more`. + +**Path completion in the repo dialog** — `Tab` completes the directory you're typing, so you don't have to know the path by heart. One press extends as far as the names allow; when there's nothing left to extend it lists what's there instead. On a trailing `/` the first press shows that directory's contents, and a unique match gains a trailing `/` so you can keep pressing `Tab` to descend. Only directories are offered (a file can't be a repo), dotted directories stay hidden until you type a leading `.`, and a name that differs only in case is matched and corrected for you. The dialog is a path field, not a shell — `~`, `..` and paths relative to your working directory all work, but `cd`, `$VAR`, and globs don't, and `Enter` always means "open this path". ## Keyboard shortcuts @@ -162,7 +164,7 @@ visible from the terminal pane. | ` l` | Toggle between status view and commit log view | | ` b` | Toggle the read-only file-tree view (returns to status view) | | ` f` | Fullscreen the focused pane. For the terminal it cycles `off → grid (all panes) → zoom (active pane only) → off`; with a single pane it toggles straight off/on. File list and diff viewer toggle off/on | -| ` o` | Open a repo in a **project tab** (prefilled with the active project's path — type to replace it, or press `→`/`End` first to extend it). A leading `~` expands to your home directory. If another tab already has that repo open, nightcrow focuses that tab instead of running two copies against one worktree | +| ` o` | Open a repo in a **project tab** (prefilled with the active project's path — type to replace it, or press `→`/`End` first to extend it). `Tab` completes the path against your filesystem (see below). A leading `~` expands to your home directory. If another tab already has that repo open, nightcrow focuses that tab instead of running two copies against one worktree | | ` x` | Close the active project tab. Closing the last one leaves nightcrow with no project open, which is a normal state | | ` p` | Cycle accent color (yellow → cyan → green → magenta → blue) | | ` r` | Force a full redraw (clears stray glyphs left by terminal programs) | From e1a74097547423e8b9297629ecaa16dce16cea4f Mon Sep 17 00:00:00 2001 From: whackur Date: Wed, 29 Jul 2026 14:12:59 +0900 Subject: [PATCH 08/19] docs: record the repo dialog's path completion design Notes the two constraints that are easy to violate later: the completer must not reuse git::tree::read_children (it requires a Repository and forbids paths outside the worktree, which is exactly what the picker walks), and it must not write an expanded ~ back into the buffer. Co-Authored-By: Claude Opus 5 (1M context) --- docs/architecture.md | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/docs/architecture.md b/docs/architecture.md index 033139f6..a88130ca 100644 --- a/docs/architecture.md +++ b/docs/architecture.md @@ -103,6 +103,7 @@ src/ │ ├── mod.rs # Workspace: open projects (Vec) + active index, │ │ # process-level repo dialog/notice │ ├── repo_input.rs # o repo-input modal state +│ ├── path_complete.rs # Tab 경로 완성 (read_dir 한 단계, 디렉터리만) │ ├── persistence.rs # workspace + per-repo state (~/.nightcrow/workspace.json) │ └── tests/ # workspace + repo_input tests ├── runtime/ @@ -358,6 +359,30 @@ pane을 살려두는 탓에 탭 라벨과 셸의 작업 디렉토리가 어긋 `dispatch_key`가 워크스페이스 레벨 경우(다이얼로그, 빈 화면의 두 키)를 먼저 해소하므로, 프로젝트별 입력 경로 전체가 프로젝트 하나만 아는 채로 유지된다. +**경로 완성** — 다이얼로그의 `Tab`은 `workspace/path_complete.rs`가 처리한다. +셸을 PTY로 띄우지 않는 이유와 대안 비교는 `docs/repo-picker-plan.md`에 있다 — +요약하면 Windows에 readline 대응 프리미티브가 없어서 네이티브 완성기가 어차피 +필요하다. 규칙은 무상태 하나다: **확장할 게 있으면 확장하고, 없으면 후보를 +보여준다.** 단 fragment가 비어 있으면(구분자로 끝나는 상태) 확장과 동시에 +목록도 낸다 — 그때의 `Tab`은 "여기 뭐가 있냐"는 질문이라 조용한 확장은 답이 +아니다. Tab 한 번에 `read_dir` 한 단계만 읽고 디렉터리만 후보로 삼는다. + +사용자가 입력한 텍스트는 다시 쓰지 않는다. `~`나 상대 경로는 **읽을 때만** +확장하고 버퍼에는 완성된 컴포넌트만 이어붙인다 — `~/x`를 `/Users/me/x`로 +바꿔 써넣으면 사용자가 타이핑한 적 없는 경로가 화면에 남는다. + +`git::tree::read_children`(`ViewMode::Tree`용)을 쓰지 않는다는 점에 주의한다. +그쪽은 `git2::Repository`가 필수이고 repo-relative 경로만 받으며 워크트리 밖 +경로와 심볼릭 링크를 거부하는데, 피커는 어떤 repo에도 속하지 않는 경로를 +돌아다녀야 하고 프로젝트가 0개일 때도 떠야 한다. 심볼릭 링크 정책도 반대다 — +트리는 링크를 따라가지 않지만(순환 방지) 피커는 따라간다(링크된 체크아웃이 +실제 repo다). + +후보는 notice 행에 표시한다(`ui/notice.rs`). 우선순위는 notice > 후보 > +repo 헤더다. 플로팅 팝업을 쓰지 않은 이유는 `src/ui/`에 오버레이 인프라가 +없고(모든 surface가 레이아웃 행을 차지한다) 마우스 캡처가 기본 on이라 +`hit_test.rs`에 새 히트 영역이 필요해지기 때문이다. + 입력 핸들러는 `&mut App` 하나만 받으므로 탭 목록에 닿을 수 없다. 대신 워크스페이스 수준 의도를 `KeyOutcome::Project(ProjectRequest)`로 반환하고 `main_loop`이 실행한다. 이 덕분에 프로젝트별 입력 경로 전체가 그대로 유지된다. From aed6ab0b76f45d8afb5f892973cdd296c197e5b7 Mon Sep 17 00:00:00 2001 From: whackur Date: Wed, 29 Jul 2026 14:16:55 +0900 Subject: [PATCH 09/19] test: pin Tab routing to the repo dialog's completion MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Tab reaching the dialog at all was the original defect — text_input_char rejects it, so the key was swallowed. dispatch_key had no test covering that route, only the completion rules underneath it. Co-Authored-By: Claude Opus 5 (1M context) --- src/application/tests/workspace.rs | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/src/application/tests/workspace.rs b/src/application/tests/workspace.rs index 948f4021..04e51887 100644 --- a/src/application/tests/workspace.rs +++ b/src/application/tests/workspace.rs @@ -58,6 +58,26 @@ fn confirming_the_dialog_asks_the_workspace_to_open_that_path() { assert!(!ws.repo_input.active, "dialog must close on success"); } +#[test] +fn the_dialog_completes_the_path_on_tab() { + // Tab used to fall through to `text_input_char`, which rejects it, so the + // key was silently swallowed. This pins the routing, not the completion + // rules — those are covered in `workspace::path_complete`. + let dir = tempfile::TempDir::new().expect("a temp dir"); + std::fs::create_dir(dir.path().join("nightcrow")).expect("create dir"); + let base = format!("{}/", dir.path().to_str().expect("a UTF-8 temp path")); + let mut ws = workspace_on(&["/a"]); + ws.start_repo_input(); + for c in format!("{base}night").chars() { + ws.repo_input_push(c); + } + + let outcome = dispatch_key(&mut ws, press(KeyCode::Tab, KeyModifiers::NONE)); + + assert_eq!(outcome, KeyOutcome::Continue); + assert_eq!(ws.repo_input.buf, format!("{base}nightcrow/")); +} + #[test] fn confirming_the_dialog_on_a_bad_path_keeps_it_open() { let mut ws = workspace_on(&["/a"]); From a9e7369110bb8263a5043805c6cb61fad5623b4c Mon Sep 17 00:00:00 2001 From: whackur Date: Wed, 29 Jul 2026 14:30:15 +0900 Subject: [PATCH 10/19] refactor: extract the shared directory listing from path completion split_dir and read_dir_names are what the filesystem browser needs too, so they move out of complete_dir_path's body. Pure refactor: an unreadable directory and an empty one already produced the same completion result, so collapsing both to an empty listing changes nothing, and read_dir_names sorting makes the later sort of the filtered matches redundant. Co-Authored-By: Claude Opus 5 (1M context) --- src/workspace/path_complete.rs | 65 ++++++++++++++++++++-------------- 1 file changed, 39 insertions(+), 26 deletions(-) diff --git a/src/workspace/path_complete.rs b/src/workspace/path_complete.rs index 737f9fea..f39b7599 100644 --- a/src/workspace/path_complete.rs +++ b/src/workspace/path_complete.rs @@ -7,7 +7,7 @@ //! The dialog is not a shell, so only what `confirm_repo_input` itself accepts //! is understood here: `~`, `..`, and cwd-relative paths. No `$VAR`, no globs. -use std::path::MAIN_SEPARATOR; +use std::path::{MAIN_SEPARATOR, Path}; /// What one Tab press does to the buffer. pub(crate) struct PathCompletion { @@ -22,10 +22,41 @@ pub(crate) struct PathCompletion { /// Whether `c` ends a path component. `\` counts on Windows only — on Unix it /// is a legal filename character, so treating it as a separator there would /// split paths that contain one. -fn is_sep(c: char) -> bool { +pub(crate) fn is_sep(c: char) -> bool { c == '/' || (cfg!(windows) && c == '\\') } +/// Split a dialog buffer into the directory text (up to and including the last +/// separator) and the trailing component being completed. With no separator the +/// whole buffer is the component and the directory is empty, meaning the process +/// cwd — the same reading `confirm_repo_input` gives a bare relative path. +pub(crate) fn split_dir(buf: &str) -> (&str, &str) { + match buf.char_indices().rfind(|(_, c)| is_sep(*c)) { + Some((i, c)) => (&buf[..i + c.len_utf8()], &buf[i + c.len_utf8()..]), + None => ("", buf), + } +} + +/// Immediate sub-directory names of `dir`, sorted. A directory that cannot be +/// read yields nothing: mid-typing that is the normal state for the completer, +/// and for the browser an unreadable directory is simply one with nothing to +/// show. Directories only — the dialog opens a repo, and a file cannot be one. +pub(crate) fn read_dir_names(dir: &Path, show_hidden: bool) -> Vec { + let Ok(read) = std::fs::read_dir(dir) else { + return Vec::new(); + }; + let mut names: Vec = read + .flatten() + .filter(is_dir_entry) + // A non-UTF-8 name cannot round-trip through the `String` buffer, so + // completing to it would produce a path that no longer opens. + .filter_map(|e| e.file_name().into_string().ok()) + .filter(|n| show_hidden || !n.starts_with('.')) + .collect(); + names.sort_unstable(); + names +} + /// Complete the last component of `buf` against the directory the rest of it /// names. See the module docs for the rules; the caller owns the length cap and /// decides whether to apply the result. @@ -39,32 +70,14 @@ pub(crate) fn complete_dir_path(buf: &str) -> PathCompletion { candidates: Vec::new(), }; - // Split at the last separator: everything up to and including it names the - // directory to list, and the rest is the prefix being completed. - let (dir_text, frag, sep) = match buf.char_indices().rfind(|(_, c)| is_sep(*c)) { - Some((i, c)) => (&buf[..i + c.len_utf8()], &buf[i + c.len_utf8()..], c), - // No separator at all: complete against the process cwd, matching how - // `confirm_repo_input` resolves a bare relative path. - None => ("", buf, MAIN_SEPARATOR), - }; + let (dir_text, frag) = split_dir(buf); + // Reuse whatever separator is already in the buffer so a path typed with + // `/` on Windows does not come back with a `\` spliced into it. + let sep = dir_text.chars().next_back().unwrap_or(MAIN_SEPARATOR); let dir = crate::platform::paths::expand_tilde(if dir_text.is_empty() { "." } else { dir_text }); - // A path that isn't a readable directory yet is the normal mid-typing - // state, not an error worth reporting. - let Ok(read) = std::fs::read_dir(&dir) else { - return unchanged(); - }; - - let show_hidden = frag.starts_with('.'); - let names: Vec = read - .flatten() - .filter(is_dir_entry) - // A non-UTF-8 name cannot round-trip through the `String` buffer, so - // completing to it would produce a path that no longer opens. - .filter_map(|e| e.file_name().into_string().ok()) - .filter(|n| show_hidden || !n.starts_with('.')) - .collect(); + let names = read_dir_names(&dir, frag.starts_with('.')); let mut matches: Vec<&str> = names .iter() @@ -82,7 +95,7 @@ pub(crate) fn complete_dir_path(buf: &str) -> PathCompletion { .filter(|n| n.to_lowercase().starts_with(&lower)) .collect(); } - matches.sort_unstable(); + // `read_dir_names` already sorted, and filtering preserves order. match matches.len() { 0 => unchanged(), From f1a1518421b115d3276f80690d17822635701837 Mon Sep 17 00:00:00 2001 From: whackur Date: Wed, 29 Jul 2026 14:40:08 +0900 Subject: [PATCH 11/19] fix: send ESC+CR for Alt+Enter in terminal panes Enter was encoded as a bare CR whatever modifiers were held, so a pane program could not tell "insert a newline" from "submit". Alt+Enter now carries the Meta prefix the same way Alt+Char does, which is the sequence Claude Code and other pane TUIs read as newline. Shift+Enter still cannot work: without the kitty keyboard protocol the outer terminal never reports the modifier, so nightcrow has nothing to encode. Co-Authored-By: Claude Opus 5 (1M context) --- src/input/encode.rs | 6 +++++- src/input/tests/encode_tests.rs | 10 ++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/src/input/encode.rs b/src/input/encode.rs index 6753b27d..f2a20067 100644 --- a/src/input/encode.rs +++ b/src/input/encode.rs @@ -36,7 +36,11 @@ pub fn encode_key(key: KeyEvent) -> Option> { let mut enc = [0u8; 4]; Some(c.encode_utf8(&mut enc).as_bytes().to_vec()) } - KeyCode::Enter => Some(vec![b'\r']), + // Alt+Enter carries the Meta prefix like Alt+Char does. Terminal UIs + // read ESC+CR as "insert a newline, don't submit" — it is what Claude + // Code binds its newline to — so dropping the modifier here made the + // two indistinguishable and every Alt+Enter submitted instead. + KeyCode::Enter => Some(if alt { vec![0x1b, b'\r'] } else { vec![b'\r'] }), KeyCode::Backspace => Some(vec![0x7f]), KeyCode::Delete => Some(csi_tilde(3, key.modifiers)), KeyCode::Esc => Some(vec![0x1b]), diff --git a/src/input/tests/encode_tests.rs b/src/input/tests/encode_tests.rs index f3a8d591..3b344b0e 100644 --- a/src/input/tests/encode_tests.rs +++ b/src/input/tests/encode_tests.rs @@ -114,6 +114,16 @@ fn encode_enter_as_cr() { assert_eq!(encode_key(key(KeyCode::Enter)), Some(vec![b'\r'])); } +#[test] +fn encode_alt_enter_as_esc_cr() { + // A pane program cannot tell "newline" from "submit" if the modifier is + // dropped; ESC+CR is the Meta-prefixed form TUIs read as newline. + assert_eq!( + encode_key(KeyEvent::new(KeyCode::Enter, KeyModifiers::ALT)), + Some(vec![0x1b, b'\r']) + ); +} + #[test] fn encode_ctrl_space_as_nul() { // xterm convention: Ctrl+Space → NUL. The generic `c - '@'` formula From 6708f45c584e5e01e041252da24bdcaf06ec79bc Mon Sep 17 00:00:00 2001 From: whackur Date: Wed, 29 Jul 2026 14:42:07 +0900 Subject: [PATCH 12/19] docs: mark the path picker's first stage done and settle stage two Stage one shipped, so the status header no longer claims it is in progress. Stage two's three open questions are resolved: Enter fills the text field rather than opening the repo, Ctrl+T opens the tree, and deriving the root from the buffer removes the need to persist a last-browsed location at all. Co-Authored-By: Claude Opus 5 (1M context) --- docs/repo-picker-plan.md | 46 +++++++++++++++++++++++++++++++--------- 1 file changed, 36 insertions(+), 10 deletions(-) diff --git a/docs/repo-picker-plan.md b/docs/repo-picker-plan.md index a44f70c6..a63f1a16 100644 --- a/docs/repo-picker-plan.md +++ b/docs/repo-picker-plan.md @@ -1,7 +1,11 @@ # repo 다이얼로그 경로 탐색 — 구현 계획 -> **상태: 1단계 진행 중.** 확정된 설계는 구현과 함께 `docs/architecture.md`로 이관하고, -> 이 문서는 **왜 그렇게 갔는지**의 이력으로 남긴다. +> **상태: 1단계(Tab 완성) 구현 완료. 2단계(트리 피커) 미착수.** 확정된 설계는 +> `docs/architecture.md`로 이관했고, 사용법은 `README.md`에 있다. 이 문서는 **왜 그렇게 +> 갔는지**의 이력으로 남긴다. +> +> 2단계는 공통 기반(`path_complete::split_dir` / `read_dir_names` 추출)까지만 들어갔다. +> 착수 시 5절의 확정 사항부터 읽으면 된다. ## 1. 문제 @@ -117,17 +121,39 @@ hit-test로 번지므로 기존 행을 쓴다. 우선순위: 각 단계 후 `cargo build && cargo test && cargo clippy --all-targets --all-features -- -D warnings` 통과 상태를 유지한다. 2단계까지만 머지된 중간 상태도 동작한다(완성은 되고 후보만 안 보임). -## 5. 2단계 — 트리 피커 (1단계 완료 후 확정) - -방향만 기록한다. 세부는 1단계 착지 후 정한다. - +## 5. 2단계 — 트리 피커 (확정, 미착수) + +- **`Enter`는 확정이 아니라 텍스트 필드로 되돌리며 그 경로를 채운다.** 트리는 필드를 + 채우는 피커고, repo를 실제로 여는 지점은 여전히 필드의 `Enter` 한 곳이다. 선택 후에도 + `Tab`으로 더 파고들거나 손으로 고칠 수 있다. +- **여는 키는 `Ctrl+T`.** printable 문자는 전부 합법 경로 문자라 쓸 수 없고, 다이얼로그가 + 키를 독점하므로 앱의 다른 `Ctrl+T`(새 터미널)와 충돌하지 않는다. +- **세션 저장은 하지 않는다.** 트리를 텍스트 필드가 현재 가리키는 디렉터리에서 열면 + 된다. 필드는 이미 활성 프로젝트 경로로 prefill되므로 "지난 위치"가 새 영속 상태 없이 + 따라온다. +- 트리 키: `j`/`k` 이동, `→` 확장, `←` 접기/부모로, `Enter` 선택 후 필드 복귀, + `Esc` 트리만 닫기(한 번 더 누르면 다이얼로그 취소). 기존 트리 뷰(` b`)는 `→`와 + `Enter` 둘 다 확장이지만 여기서는 `Enter`가 선택이라 확장은 `→` 전용이다 — 같은 앱에서 + `Enter` 의미가 갈리는 지점이라 README에 명시한다. +- 디렉터리만 표시한다(1단계와 동일 — 파일은 repo가 될 수 없다). +- 루트 위로 올라갈 수 있어야 한다. depth 0에서 `←`는 부모로 re-root한다. 버퍼의 literal + 텍스트(`root_text`)와 확장된 `PathBuf`를 따로 들고, 고른 경로는 `root_text` 기준으로 + 조립한다 — 1단계와 같은 이유로 사용자가 타이핑한 `~`를 절대 경로로 바꿔 쓰지 않는다. +- **마우스 클릭 선택은 범위 밖.** `hit_test.rs`에 새 히트 영역이 필요해 별도 작업으로 + 둔다. 키보드로 완결된다. - **플로팅이 아니라 body 영역 전체를 쓰는 리스트.** `src/ui/`에 팝업/오버레이 인프라가 전혀 없다(`Clear` 위젯도 centered-rect 헬퍼도 없고, 모든 surface가 레이아웃 영역을 차지한다). 떠 있는 박스는 이 프로젝트 최초의 플로팅 UI가 되고 마우스 캡처가 기본 on이라 `hit_test.rs`에 새 히트 영역을 끼워야 한다. body 전체를 쓰면 둘 다 크게 줄어든다. -- 1단계의 디렉터리 목록 함수를 그대로 쓴다. -- 텍스트 필드와 병행한다: 필드에서 `Tab`은 완성, 별도 키로 트리를 연다. 경로를 아는 +- 1단계의 `split_dir` / `read_dir_names`를 그대로 쓴다 — 이미 추출해 뒀다. +- 텍스트 필드와 병행한다: 필드에서 `Tab`은 완성, `Ctrl+T`로 트리를 연다. 경로를 아는 경우(형제 체크아웃 — prefill이 노리는 케이스)는 타이핑이 빠르고, 모르는 경우는 트리가 낫다. 경쟁 관계가 아니다. -- 미정: 여는 키, 마지막 탐색 위치의 세션 저장 여부, 트리에서 `Enter`가 곧 확정인지 - 텍스트 필드로 되돌리는지. + +### 남은 작업 순서 + +1. `workspace/path_tree.rs` — 트리 상태(선택 / 확장 `BTreeSet` / lazy children 캐시)와 + 탐색. `Workspace` 소유. +2. 필드 ↔ 트리 전환 배선 — `Ctrl+T` 열기, `Enter` 선택 시 필드 버퍼에 경로 + 구분자 주입. +3. `ui/path_tree.rs` — body 렌더. `render_selectable_list` 재사용. +4. README 키 표 + `architecture.md` 갱신. From 7f697b9d7c419108636f9e8250077b9a05d1c0da Mon Sep 17 00:00:00 2001 From: whackur Date: Wed, 29 Jul 2026 14:53:23 +0900 Subject: [PATCH 13/19] docs: explain why the jump legend spaces the leader and digit MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Panel titles show ` 1` / ` 2`, not `^F1`: written without the space it reads as Ctrl+F1, which is a different key the app passes through to the PTY instead of intercepting. Also notes that the project tab row's F1…F10 legend is a separate axis. --- docs/architecture.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/architecture.md b/docs/architecture.md index a88130ca..03b2d89d 100644 --- a/docs/architecture.md +++ b/docs/architecture.md @@ -333,7 +333,7 @@ background even while scrolled out of the window. - **Lower panel focused (terminal)**: leader/예약키가 아닌 모든 키는 active backend의 stdin으로 직접 통과한다(`encode_key`가 화살표/F-key/제어문자를 VT100 시퀀스로 인코딩). 단독 `Ctrl+T/W/L/O/P/Q` 등은 앱 명령이 아니므로 control byte로 PTY에 전달된다(리더 `Ctrl+F`만 prefix를 arm하고 통과하지 않는다). bare F키는 앱이 가로채므로 pane 안 프로그램(htop, mc 등)의 F키 메뉴는 동작하지 않는다 — 수정자를 붙인 `Ctrl+F1`, `Shift+F5` 등은 통과한다. - overlay(repo input/search) active 시에는 leader dispatch가 금지되고 overlay가 키를 소유한다. armed 중 overlay가 열리는 경로면 prefix를 취소한다. repo 다이얼로그는 `Workspace` 소유라 `main::dispatch_key`가 per-project 핸들러보다 먼저 처리한다 — 프로젝트가 없을 때도 열려야 하기 때문. - **프로젝트가 없을 때**: `main::handle_empty_key`가 leader arming과 `o`/`q`만 해석하고 나머지는 버린다. ` `는 여기서도 액션 테이블로 넘어가지 않는다 — 기본 leader가 `ctrl+f`라 follow-up이 `f`에 매칭돼 fullscreen이 토글될 수 있기 때문. -- 좌측/우측 패널 타이틀에는 현재 포커스 단축키(`F1` / `F2`)가 노출돼 사용자가 즉시 jump 키를 알 수 있다. +- 좌측/우측 패널 타이틀에는 현재 포커스 단축키(` 1` / ` 2`, 기본 leader면 `^F 1` / `^F 2`)가 노출돼 사용자가 즉시 jump 키를 알 수 있다. `ui::jump_legend`가 설정된 leader label과 digit을 **공백으로** 이어 붙인다 — `^F1`로 붙여 쓰면 Ctrl+F1로 읽히고, 그 조합은 앱이 가로채지 않고 PTY로 통과시키는 별개 키라 오해를 만든다. 프로젝트 탭 행이 쓰는 `F1`…`F10` legend와는 다른 축임에 주의한다. ### Project Boundary (`Workspace` / `App`) From 91478e11666f752a3225cd07c5f1e4599c0fe47f Mon Sep 17 00:00:00 2001 From: whackur Date: Wed, 29 Jul 2026 16:05:29 +0900 Subject: [PATCH 14/19] feat: show line numbers in the diff and file views MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit DiffLine now carries libgit2's old_lineno/new_lineno instead of discarding them. Deriving the numbers from the hunk header at render time would have put per-kind counters in the rendering layer, which is the wrong place for that state. Added lines have no old number and removed lines have no new one, so the gutter leaves that column blank rather than inventing one. The gutter is a separate Paragraph from the body, and that is load-bearing: horizontal scrolling is Paragraph::scroll, which shifts a whole line, so a gutter sharing the body's paragraph slides off the left edge. The file view already had a gutter with exactly that bug — scrolling right lost its numbers. Both vectors are filled in one loop so the two paragraphs cannot disagree about which rows they are showing. MIN_SPLIT_WIDTH goes 80 -> 90: each half now spends 5 columns on its gutter, and leaving the threshold alone would have quietly narrowed the code each half can show rather than falling back to unified. Title assembly moves to title.rs, which drops a copy that had been duplicated between the unified and split renderers. Co-Authored-By: Claude Opus 5 (1M context) --- README.md | 1 + docs/architecture.md | 4 + src/app/tests/helpers.rs | 2 + src/git/diff/diff_load.rs | 7 +- src/git/diff/snapshot.rs | 3 + src/git/diff/tests/diff_lineno.rs | 110 ++++++++++++++++++++++ src/git/diff/tests/mod.rs | 1 + src/git/diff/types.rs | 9 ++ src/ui/diff_pane/tests/mod.rs | 4 + src/ui/diff_viewer/file_view.rs | 61 ++++++++----- src/ui/diff_viewer/gutter.rs | 103 +++++++++++++++++++++ src/ui/diff_viewer/mod.rs | 126 +++++++++++--------------- src/ui/diff_viewer/split_view.rs | 122 +++++++++++++++---------- src/ui/diff_viewer/tests/file_view.rs | 44 +++++++++ src/ui/diff_viewer/tests/mod.rs | 123 +++++++++++++++++++++++++ src/ui/diff_viewer/tests/split.rs | 37 ++++++++ src/ui/diff_viewer/tests/unified.rs | 108 ++++++++++++++++++++++ src/ui/diff_viewer/title.rs | 52 +++++++++++ src/web/viewer/dto/tests/mod.rs | 8 ++ 19 files changed, 784 insertions(+), 141 deletions(-) create mode 100644 src/git/diff/tests/diff_lineno.rs create mode 100644 src/ui/diff_viewer/gutter.rs create mode 100644 src/ui/diff_viewer/tests/file_view.rs create mode 100644 src/ui/diff_viewer/tests/mod.rs create mode 100644 src/ui/diff_viewer/tests/split.rs create mode 100644 src/ui/diff_viewer/tests/unified.rs create mode 100644 src/ui/diff_viewer/title.rs diff --git a/README.md b/README.md index 4024f399..e1ee410e 100644 --- a/README.md +++ b/README.md @@ -212,6 +212,7 @@ through to the terminal program. | `←` / `→` | Horizontal scroll (4 columns) | | `v` | Toggle between hunk diff and full file preview | | `s` | Toggle between the unified diff and a side-by-side split view (falls back to unified when the pane is too narrow) | +| — | **Line numbers** are always shown in a pinned gutter. The unified view shows both sides (old, new) — an added line leaves the old column blank, a removed line leaves the new one blank. The split view numbers each half with the side it shows, and the file view (`v`) numbers the file itself. The gutter stays in place while `←`/`→` scroll the code | | ` f` | Zoom the diff/file pane to full screen (toggle) | | `/` | Open search (works in both diff and file preview, including tree mode) | | `n` / `N` | Next / previous search match | diff --git a/docs/architecture.md b/docs/architecture.md index 03b2d89d..dda2d8dd 100644 --- a/docs/architecture.md +++ b/docs/architecture.md @@ -210,6 +210,10 @@ trait TerminalBackend { - UI 스레드 동기 로드: 파일/커밋 선택이 바뀌면 `load_*_with_repo`를 직접 호출한다. App은 `git2::Repository`를 lazy-cache하므로 매 호출마다 `Repository::discover`를 다시 실행하지 않는다. cache는 프로젝트와 수명을 같이 하므로 무효화 시점이 따로 없다 — 저장소가 바뀌는 유일한 방법이 탭을 닫고 새로 여는 것이기 때문. - 경로 검증: 워크트리 안의 파일·디렉토리를 여는 경로는 전부 `git::path::resolve_in_workdir`를 거친다(파일 미리보기와 트리 리스팅 양쪽). plain relative 컴포넌트만 허용하고 `..`·절대경로·NUL·`.git`(대소문자 무시)을 거부하며, 워크디렉토리부터 한 컴포넌트씩 내려가 **모든 깊이의 심링크**를 막고 canonicalize containment로 마무리한다. 지금 호출자는 git이 만들어 낸 경로만 넘기지만, 검증을 호출부가 아니라 파일시스템 경계에 두어야 웹 표면이 요청 문자열을 같은 로더에 태워도 안전하다. 크기 검사와 읽기는 같은 파일 핸들에서, 트리 리스팅은 검증기가 돌려준 경로로 `read_dir`을 수행해 check→use TOCTOU를 닫는다. `.git` 판정은 `is_git_dir_name` 하나로 통일한다 — 대소문자와 후행 점·공백(NTFS가 버리는 문자)까지 흡수하며, 규칙을 두 군데에 따로 적으면 그 틈이 우회로가 된다. - 렌더링: 보이는 행(`scroll_start..scroll_start+visible_height`)에 한해 `syntect`로 syntax highlighting을 수행한다. 보이지 않는 라인은 highlighter state만 진행시켜 multi-line construct(블록 주석, 문자열 리터럴)의 syntax 연속성을 유지한다. +- **줄 번호 gutter**(`ui/diff_viewer/gutter.rs`): `DiffLine`이 libgit2의 `old_lineno`/`new_lineno`를 그대로 들고 다닌다. 추가 줄은 old가, 삭제 줄은 new가 `None`이라 해당 칼럼을 비운다 — hunk 헤더에서 파생시키지 않는 이유는 kind별 카운터를 렌더 층에서 관리하게 되어 상태가 잘못된 층에 놓이기 때문이다. unified은 두 칼럼, split은 좌=old·우=new 한 칼럼씩, file view는 파일 자신의 번호를 보여준다. + - **gutter와 본문은 반드시 별개 `Paragraph`여야 한다.** diff 계열은 수평 스크롤을 `Paragraph::scroll((0, x))`로 구현하는데 이건 라인을 통째로 밀기 때문에, 같은 paragraph에 있는 gutter는 `scroll_x > 0`이면 왼쪽으로 사라진다(실제로 file view에 그 버그가 있었다). `Block`을 따로 그리고 `block.inner`를 `Layout::Horizontal`로 쪼개 gutter는 `scroll((0,0))`, 본문만 스크롤한다. 수직 스크롤은 **어느 행을 담았는지**로 표현되므로 두 vector를 같은 루프에서 lockstep으로 채우는 것이 정렬을 지키는 유일한 수단이다. + - 폭은 로드된 hunk 전체의 최대 줄 번호에서 파생하고 최소 3자리를 보장한다. 보이는 창 기준으로 계산하면 스크롤 중에 본문 좌측 경계가 흔들린다. hunk 헤더 행도 같은 폭의 빈 gutter를 받아야 `@@`가 본문보다 한 칼럼 왼쪽에서 시작하지 않는다. + - `MIN_SPLIT_WIDTH`를 80 → 90으로 올렸다. 각 half가 gutter에 5칼럼을 쓰므로, 문턱을 그대로 두면 side-by-side 진입은 되지만 half당 읽을 수 있는 코드 폭이 조용히 줄어든다. ### Split-View Terminal Panel diff --git a/src/app/tests/helpers.rs b/src/app/tests/helpers.rs index 587d9ce6..2b2fce9f 100644 --- a/src/app/tests/helpers.rs +++ b/src/app/tests/helpers.rs @@ -90,6 +90,8 @@ pub(crate) fn context_hunk(lines: &[&str]) -> DiffHunk { .map(|content| DiffLine { kind: LineKind::Context, content: (*content).to_string(), + old_lineno: None, + new_lineno: None, }) .collect(), file_path: None, diff --git a/src/git/diff/diff_load.rs b/src/git/diff/diff_load.rs index 99f1b755..270e34dd 100644 --- a/src/git/diff/diff_load.rs +++ b/src/git/diff/diff_load.rs @@ -238,7 +238,12 @@ fn collect_hunks( _ => LineKind::Context, }; if let Some(h) = hunks.borrow_mut().last_mut() { - h.lines.push(DiffLine { kind, content }); + h.lines.push(DiffLine { + kind, + content, + old_lineno: line.old_lineno(), + new_lineno: line.new_lineno(), + }); } true }), diff --git a/src/git/diff/snapshot.rs b/src/git/diff/snapshot.rs index e9d39500..334671e3 100644 --- a/src/git/diff/snapshot.rs +++ b/src/git/diff/snapshot.rs @@ -189,6 +189,9 @@ pub(super) fn binary_diff_hunk(file_path: &str) -> DiffHunk { lines: vec![DiffLine { kind: LineKind::Context, content: "Binary files differ".to_string(), + // Synthetic placeholder: a binary file has no line numbering. + old_lineno: None, + new_lineno: None, }], file_path: Some(file_path.to_string()), } diff --git a/src/git/diff/tests/diff_lineno.rs b/src/git/diff/tests/diff_lineno.rs new file mode 100644 index 00000000..4761af8c --- /dev/null +++ b/src/git/diff/tests/diff_lineno.rs @@ -0,0 +1,110 @@ +use crate::git::diff::{LineKind, load_commit_file_diff, load_commit_log, load_file_diff}; +use crate::test_util::{make_repo, open_repo, run_git}; +use std::path::Path; + +/// `(kind, old_lineno, new_lineno)` for every line of a hunk — the shape the +/// gutter renderer will consume. +fn gutter(hunk: &crate::git::diff::DiffHunk) -> Vec<(LineKind, Option, Option)> { + hunk.lines + .iter() + .map(|l| (l.kind, l.old_lineno, l.new_lineno)) + .collect() +} + +#[test] +fn mixed_hunk_lines_carry_the_line_numbers_of_the_side_they_exist_on() { + let (dir, path) = make_repo(); + let fp = Path::new(&path).join("m.txt"); + std::fs::write(&fp, "one\ntwo\nthree\n").unwrap(); + run_git(&path, &["add", "."]); + run_git(&path, &["commit", "-m", "init"]); + std::fs::write(&fp, "one\nTWO\nthree\n").unwrap(); + + let hunks = load_file_diff(&open_repo(&path), "m.txt").unwrap(); + + assert_eq!(hunks.len(), 1); + assert_eq!( + gutter(&hunks[0]), + vec![ + (LineKind::Context, Some(1), Some(1)), + // Removed exists only on the old side, added only on the new side. + (LineKind::Removed, Some(2), None), + (LineKind::Added, None, Some(2)), + (LineKind::Context, Some(3), Some(3)), + ] + ); + drop(dir); +} + +#[test] +fn second_hunk_resumes_from_its_own_offsets_after_an_earlier_insertion() { + let (dir, path) = make_repo(); + let fp = Path::new(&path).join("long.txt"); + let before: String = (1..=20).map(|n| format!("l{n:02}\n")).collect(); + std::fs::write(&fp, &before).unwrap(); + run_git(&path, &["add", "."]); + run_git(&path, &["commit", "-m", "init"]); + // Insert one extra line near the top and edit near the bottom, so the two + // changes land in separate hunks and the new side of the second hunk is + // offset by one from the old side. + let after: String = (1..=20) + .map(|n| match n { + 2 => "l02a\nl02b\n".to_string(), + 18 => "l18x\n".to_string(), + _ => format!("l{n:02}\n"), + }) + .collect(); + std::fs::write(&fp, &after).unwrap(); + + let hunks = load_file_diff(&open_repo(&path), "long.txt").unwrap(); + + assert_eq!(hunks.len(), 2, "expected two separate hunks"); + let second = gutter(&hunks[1]); + // First context line of the second hunk: old side 15, new side 16 because + // the earlier hunk added a line. + assert_eq!(second[0], (LineKind::Context, Some(15), Some(16))); + assert_eq!( + second, + vec![ + (LineKind::Context, Some(15), Some(16)), + (LineKind::Context, Some(16), Some(17)), + (LineKind::Context, Some(17), Some(18)), + (LineKind::Removed, Some(18), None), + (LineKind::Added, None, Some(19)), + (LineKind::Context, Some(19), Some(20)), + (LineKind::Context, Some(20), Some(21)), + ] + ); + drop(dir); +} + +#[test] +fn commit_diff_lines_carry_line_numbers_too() { + let (dir, path) = make_repo(); + let fp = Path::new(&path).join("c.txt"); + std::fs::write(&fp, "one\ntwo\n").unwrap(); + run_git(&path, &["add", "."]); + run_git(&path, &["commit", "-m", "init"]); + std::fs::write(&fp, "one\nTWO\n").unwrap(); + run_git(&path, &["add", "."]); + run_git(&path, &["commit", "-m", "edit"]); + + let commits = load_commit_log(&open_repo(&path), 1).unwrap(); + let hunks = load_commit_file_diff(&open_repo(&path), commits[0].oid, "c.txt").unwrap(); + + // The commit collector prepends a synthetic per-file header hunk; the real + // hunk follows it and must still carry libgit2's numbers. + let real = hunks + .iter() + .find(|h| h.header.starts_with("@@")) + .expect("commit diff should contain a unified hunk"); + assert_eq!( + gutter(real), + vec![ + (LineKind::Context, Some(1), Some(1)), + (LineKind::Removed, Some(2), None), + (LineKind::Added, None, Some(2)), + ] + ); + drop(dir); +} diff --git a/src/git/diff/tests/mod.rs b/src/git/diff/tests/mod.rs index d8cac34d..68cf0e7f 100644 --- a/src/git/diff/tests/mod.rs +++ b/src/git/diff/tests/mod.rs @@ -1,3 +1,4 @@ mod commit_log; +mod diff_lineno; mod diff_load; mod snapshot; diff --git a/src/git/diff/types.rs b/src/git/diff/types.rs index d236a4d3..f54df6de 100644 --- a/src/git/diff/types.rs +++ b/src/git/diff/types.rs @@ -152,6 +152,15 @@ pub enum LineKind { pub struct DiffLine { pub kind: LineKind, pub content: String, + /// Line number on the pre-image side, as reported by libgit2. `None` for an + /// added line, which exists only on the new side — so the gutter can leave + /// that column blank instead of inventing a number. Also `None` on + /// hand-built fixtures and the synthetic binary-file hunk, where no real + /// line numbering exists. + pub old_lineno: Option, + /// Line number on the post-image side. `None` for a removed line, which is + /// absent from the new side. Same `None` cases as `old_lineno` otherwise. + pub new_lineno: Option, } #[derive(Debug, Clone)] diff --git a/src/ui/diff_pane/tests/mod.rs b/src/ui/diff_pane/tests/mod.rs index 50220d01..dcc7a040 100644 --- a/src/ui/diff_pane/tests/mod.rs +++ b/src/ui/diff_pane/tests/mod.rs @@ -22,6 +22,8 @@ fn match_hunk(lines: &[&str]) -> DiffHunk { .map(|s| DiffLine { kind: LineKind::Context, content: (*s).to_string(), + old_lineno: None, + new_lineno: None, }) .collect(), file_path: None, @@ -77,6 +79,8 @@ fn kinded_hunk(lines: &[(LineKind, &str)]) -> DiffHunk { .map(|(kind, s)| DiffLine { kind: *kind, content: (*s).to_string(), + old_lineno: None, + new_lineno: None, }) .collect(), file_path: None, diff --git a/src/ui/diff_viewer/file_view.rs b/src/ui/diff_viewer/file_view.rs index ac493282..b8e41f33 100644 --- a/src/ui/diff_viewer/file_view.rs +++ b/src/ui/diff_viewer/file_view.rs @@ -1,10 +1,11 @@ use crate::app::{App, Focus}; +use crate::ui::jump_legend; use ratatui::{ Frame, layout::{Constraint, Direction, Layout, Rect}, style::{Color, Style}, text::{Line, Span}, - widgets::{Block, Borders, Paragraph}, + widgets::{Block, Borders}, }; use syntect::highlighting::ThemeSet; use syntect::parsing::SyntaxSet; @@ -45,7 +46,7 @@ pub(crate) fn render_file_view( (area, None) }; - let jump = super::jump_legend(app, '2'); + let jump = jump_legend(app, '2'); let title = if has_search { let count = app.diff.search.matches.len(); if count == 0 { @@ -63,6 +64,10 @@ pub(crate) fn render_file_view( let visible_height = (content_area.height as usize).saturating_sub(2); let current_match = app.diff.search.current_match(); + // An error or an empty file has no lines to number, so the gutter column is + // not reserved at all — otherwise the message would sit indented under it. + let mut gutter_lines: Vec = Vec::new(); + let mut gutter_width = 0u16; let lines: Vec = if let Some(err) = &app.diff.file_view.error { vec![Line::from(Span::styled( err.as_str(), @@ -77,7 +82,10 @@ pub(crate) fn render_file_view( app.diff.file_view.ensure_highlight_cache(ss, ts, syntax); let fv = &app.diff.file_view; let total = fv.line_count(); - let width = total.to_string().len(); + // Same floor as the diff gutters, so switching between `v` and the diff + // view does not shift the body's left edge. + let digits = super::gutter::digits_for(total); + gutter_width = super::gutter::side_gutter_width(digits); // Belt-and-braces: ensure_highlight_cache keeps line_highlights // aligned with content.lines().count(), but if that invariant ever // slips the slice below would panic. Clamp against the cache length. @@ -107,30 +115,41 @@ pub(crate) fn render_file_view( } else { Color::Reset }; - let mut spans = vec![Span::styled( - format!(" {:>width$} ", line_no, width = width), + // The number lives in its own paragraph so horizontal scrolling + // cannot slide it off the left edge, which is what used to + // happen while it shared the body's paragraph. + gutter_lines.push(Line::from(Span::styled( + super::gutter::side_gutter_text(Some(line_no as u32), digits), Style::default().fg(Color::DarkGray).bg(bg), - )]; - for seg in segs { - spans.push(Span::styled( - seg.text.as_str(), - Style::default().fg(super::rgb_to_color(seg.rgb)).bg(bg), - )); - } + ))); + let spans: Vec = segs + .iter() + .map(|seg| { + Span::styled( + seg.text.as_str(), + Style::default().fg(super::rgb_to_color(seg.rgb)).bg(bg), + ) + }) + .collect(); Line::from(spans) }) .collect() }; - let para = Paragraph::new(lines) - .block( - Block::default() - .borders(Borders::ALL) - .title(title) - .border_style(border_style), - ) - .scroll((0, app.diff.file_view.scroll_x.min(u16::MAX as usize) as u16)); - frame.render_widget(para, content_area); + let block = Block::default() + .borders(Borders::ALL) + .title(title) + .border_style(border_style); + let inner = block.inner(content_area); + frame.render_widget(block, content_area); + super::gutter::render_gutter_and_body( + frame, + inner, + gutter_width, + gutter_lines, + lines, + app.diff.file_view.scroll_x.min(u16::MAX as usize) as u16, + ); if let Some(sa) = search_area { super::render_search_bar( diff --git a/src/ui/diff_viewer/gutter.rs b/src/ui/diff_viewer/gutter.rs new file mode 100644 index 00000000..ec6a8a2d --- /dev/null +++ b/src/ui/diff_viewer/gutter.rs @@ -0,0 +1,103 @@ +use crate::git::diff::DiffHunk; +use ratatui::{ + Frame, + layout::{Constraint, Direction, Layout, Rect}, + text::Line, + widgets::Paragraph, +}; + +/// Minimum digits reserved for one line-number column. Keeps the gutter — and +/// with it the body's left edge — from twitching between a 1-digit and a +/// 2-digit file, the way `delta`/`diff-so-fancy` reserve a fixed column. +const MIN_LINENO_DIGITS: usize = 3; + +/// One padding space on each side of a number column: it lifts the digits off +/// the pane border and off the `+`/`-` marker that follows. +const LINENO_PAD: usize = 2; + +/// Single space separating the old and new columns of the unified gutter. +const LINENO_GAP: usize = 1; + +/// Digits needed to print `max_lineno`, floored at `MIN_LINENO_DIGITS`. +pub(crate) fn digits_for(max_lineno: usize) -> usize { + let digits = if max_lineno == 0 { + 1 + } else { + max_lineno.ilog10() as usize + 1 + }; + digits.max(MIN_LINENO_DIGITS) +} + +/// Gutter digit count for a whole loaded diff: the widest line number that +/// appears on either side of any hunk. Derived from the loaded hunks, never +/// from the visible window, so scrolling cannot change the gutter width and +/// shift the body sideways mid-scroll. +/// +/// Recomputed per frame instead of cached: it is one allocation-free pass over +/// the same lines `ensure_highlight_cache` already walks for its fingerprint, +/// and a cache would need invalidating at every `DiffPane::hunks` mutation — +/// a missed one renders numbers against the wrong column width. +pub(crate) fn lineno_digits(hunks: &[DiffHunk]) -> usize { + let max = hunks + .iter() + .flat_map(|h| h.lines.iter()) + // `Option::max` picks the larger `Some`; both `None` only on fixtures + // and the synthetic binary hunk, which then fall back to the minimum. + .filter_map(|l| l.old_lineno.max(l.new_lineno)) + .max() + .unwrap_or(0); + digits_for(max as usize) +} + +/// Width of the unified gutter, which shows the old and new columns together. +pub(crate) fn unified_gutter_width(digits: usize) -> u16 { + (2 * digits + LINENO_GAP + LINENO_PAD) as u16 +} + +/// Width of a one-column gutter (each split half, and the file view). +pub(crate) fn side_gutter_width(digits: usize) -> u16 { + (digits + LINENO_PAD) as u16 +} + +/// `" old new "`, with either column blank when the line is absent on that +/// side (added lines have no old number, removed lines have no new one). +pub(crate) fn unified_gutter_text(old: Option, new: Option, digits: usize) -> String { + format!( + " {:>digits$} {:>digits$} ", + lineno_text(old), + lineno_text(new) + ) +} + +/// `" n "` for a single-column gutter; all spaces when `no` is `None`. +pub(crate) fn side_gutter_text(no: Option, digits: usize) -> String { + format!(" {:>digits$} ", lineno_text(no)) +} + +fn lineno_text(no: Option) -> String { + no.map(|v| v.to_string()).unwrap_or_default() +} + +/// Render a pinned gutter column and a horizontally scrollable body inside +/// `inner` (a `Block`'s inner area — draw the block yourself first). +/// +/// The two must be separate `Paragraph`s: `Paragraph::scroll` shifts the whole +/// line, so a gutter span living in the body's paragraph would slide off the +/// left edge as soon as `scroll_x > 0`. Vertical scroll is instead expressed +/// by *which* lines the caller collected, so passing windows built from the +/// same rows is what keeps numbers aligned with their content. +pub(crate) fn render_gutter_and_body( + frame: &mut Frame, + inner: Rect, + gutter_width: u16, + gutter: Vec>, + body: Vec>, + scroll_x: u16, +) { + let cols = Layout::default() + .direction(Direction::Horizontal) + .constraints([Constraint::Length(gutter_width), Constraint::Min(0)]) + .split(inner); + frame.render_widget(Paragraph::new(gutter), cols[0]); + frame.render_widget(Paragraph::new(body).scroll((0, scroll_x)), cols[1]); +} diff --git a/src/ui/diff_viewer/mod.rs b/src/ui/diff_viewer/mod.rs index f55fa575..66c44047 100644 --- a/src/ui/diff_viewer/mod.rs +++ b/src/ui/diff_viewer/mod.rs @@ -1,26 +1,38 @@ +#[cfg(test)] +mod tests; + mod file_view; +mod gutter; mod split_view; +mod title; pub(crate) use file_view::render_file_view; pub(crate) use split_view::render_split_view; use crate::app::{App, DiffPaneView, Focus, ViewMode}; use crate::git::diff::LineKind; -use crate::ui::{focused_border_style, jump_legend, path_extension, render_search_bar}; +use crate::ui::{focused_border_style, path_extension, render_search_bar}; +use gutter::{lineno_digits, render_gutter_and_body, unified_gutter_text, unified_gutter_width}; use ratatui::{ Frame, layout::{Constraint, Direction, Layout, Rect}, style::{Color, Style}, text::{Line, Span}, - widgets::{Block, Borders, Paragraph}, + widgets::{Block, Borders}, }; use syntect::highlighting::ThemeSet; use syntect::parsing::SyntaxSet; +use title::unified_title; /// Minimum pane width (columns) for the side-by-side split layout. Below this /// each half is too narrow to read, so `Split` view falls back to the unified /// diff renderer. -const MIN_SPLIT_WIDTH: u16 = 80; +/// +/// Derived: 80 columns used to leave each half ~38 columns of code, and each +/// half now spends `side_gutter_width(MIN_LINENO_DIGITS)` = 5 of them on its +/// line-number gutter. Raising the threshold by both gutters keeps the same +/// readable code width per side rather than silently shrinking it. +const MIN_SPLIT_WIDTH: u16 = 90; pub(crate) fn rgb_to_color(rgb: (u8, u8, u8)) -> Color { Color::Rgb(rgb.0, rgb.1, rgb.2) @@ -81,7 +93,21 @@ pub fn render( app.diff.scroll = scroll_start; let visible_end = scroll_start.saturating_add(visible_height); + // Gutter width is a property of the whole loaded diff, not of the visible + // window, so the body's left edge stays put while scrolling. With no diff + // loaded the pane holds only a placeholder message, which has no line to + // number — reserving the column there would just indent the message. + let digits = lineno_digits(&app.diff.hunks); + let gutter_width = if total_lines == 0 { + 0 + } else { + unified_gutter_width(digits) + }; + let mut lines: Vec = Vec::with_capacity(visible_height); + // Collected in lockstep with `lines`: same rows, same order, so the two + // paragraphs share one vertical window. + let mut gutter_lines: Vec = Vec::with_capacity(visible_height); let mut flat_idx: usize = 0; 'outer: for (hi, hunk) in app.diff.hunks.iter().enumerate() { @@ -95,6 +121,9 @@ pub fn render( hunk.header.as_str(), Style::default().fg(Color::Cyan), ))); + // Blank, but full width: a header row with no gutter cell would + // start its `@@` one column left of the body's left edge. + gutter_lines.push(Line::from("")); } flat_idx += 1; @@ -151,6 +180,12 @@ pub fn render( } lines.push(Line::from(spans)); + // Same background as the row so the number reads as part of it + // rather than as a column floating beside the highlight. + gutter_lines.push(Line::from(Span::styled( + unified_gutter_text(diff_line.old_lineno, diff_line.new_lineno, digits), + Style::default().fg(Color::DarkGray).bg(bg), + ))); flat_idx += 1; } } @@ -182,75 +217,22 @@ pub fn render( ))); } - let jump = jump_legend(app, '2'); - let title = match app.mode { - ViewMode::Log => { - let label = if app.log_view.diff_title.is_empty() { - "Diff" - } else { - app.log_view.diff_title.as_str() - }; - if has_search { - let count = app.diff.search.matches.len(); - if count == 0 { - format!(" {jump} {label} [no matches] ") - } else { - format!( - " {jump} {label} [{}/{}] ", - app.diff.search.cursor + 1, - count - ) - } - } else { - format!(" {jump} {label} ") - } - } - ViewMode::Status => { - let selected = app.selected_filtered_status_file(); - if has_search { - let count = app.diff.search.matches.len(); - let file = selected.map(|f| f.path.as_str()).unwrap_or("Diff"); - if count == 0 { - format!(" {jump} {file} [no matches] ") - } else { - format!(" {jump} {file} [{}/{}] ", app.diff.search.cursor + 1, count) - } - } else if let Some(f) = selected { - format!(" {jump} {} ", f.path) - } else { - format!(" {jump} Diff ") - } - } - ViewMode::Tree => { - let path = app.tree_view.selected_path(); - let label = path.as_deref().unwrap_or("File"); - if has_search { - let count = app.diff.search.matches.len(); - if count == 0 { - format!(" {jump} {label} [no matches] ") - } else { - format!( - " {jump} {label} [{}/{}] ", - app.diff.search.cursor + 1, - count - ) - } - } else { - format!(" {jump} {label} ") - } - } - }; - - let para = Paragraph::new(lines) - .block( - Block::default() - .borders(Borders::ALL) - .title(title) - .border_style(border_style), - ) - .scroll((0, app.diff.scroll_x.min(u16::MAX as usize) as u16)); - - frame.render_widget(para, diff_area); + // The block is rendered on its own rather than attached to a paragraph: + // the gutter and the body are two paragraphs sharing one bordered area. + let block = Block::default() + .borders(Borders::ALL) + .title(unified_title(app)) + .border_style(border_style); + let inner = block.inner(diff_area); + frame.render_widget(block, diff_area); + render_gutter_and_body( + frame, + inner, + gutter_width, + gutter_lines, + lines, + app.diff.scroll_x.min(u16::MAX as usize) as u16, + ); if let Some(sa) = search_area { render_search_bar( diff --git a/src/ui/diff_viewer/split_view.rs b/src/ui/diff_viewer/split_view.rs index b122cfeb..768e84b5 100644 --- a/src/ui/diff_viewer/split_view.rs +++ b/src/ui/diff_viewer/split_view.rs @@ -1,4 +1,4 @@ -use crate::app::{App, Focus, ViewMode}; +use crate::app::{App, Focus}; use crate::git::diff::LineKind; use crate::ui::diff_pane::SplitRow; use ratatui::{ @@ -6,7 +6,7 @@ use ratatui::{ layout::{Constraint, Direction, Layout, Rect}, style::{Color, Style}, text::{Line, Span}, - widgets::{Block, Borders, Paragraph}, + widgets::{Block, Borders}, }; use syntect::highlighting::ThemeSet; use syntect::parsing::SyntaxSet; @@ -35,8 +35,16 @@ pub(crate) fn render_split_view( app.diff.scroll = scroll_start; let scroll_end = scroll_start.saturating_add(visible_height).min(rows.len()); + // Each half carries the number of the side it shows: old on the left, new + // on the right. Collected in lockstep with the body lines so the two + // paragraphs of a half share one vertical window. + let digits = super::gutter::lineno_digits(&app.diff.hunks); + let gutter_width = super::gutter::side_gutter_width(digits); + let mut left_lines: Vec = Vec::with_capacity(visible_height); let mut right_lines: Vec = Vec::with_capacity(visible_height); + let mut left_gutter: Vec = Vec::with_capacity(visible_height); + let mut right_gutter: Vec = Vec::with_capacity(visible_height); for row in &rows[scroll_start..scroll_end] { match row { SplitRow::Header(hi) => { @@ -51,15 +59,23 @@ pub(crate) fn render_split_view( Style::default().fg(Color::Cyan), ))); right_lines.push(Line::from("")); + // Blank but present: a header with no gutter cell would start + // one column left of the body beneath it. + left_gutter.push(Line::from("")); + right_gutter.push(Line::from("")); } SplitRow::Body { left, right } => { - left_lines.push(split_side_line(app, *left)); - right_lines.push(split_side_line(app, *right)); + let (lg, lb) = split_side_lines(app, *left, digits, Side::Old); + let (rg, rb) = split_side_lines(app, *right, digits, Side::New); + left_lines.push(lb); + right_lines.push(rb); + left_gutter.push(lg); + right_gutter.push(rg); } } } - let title = split_title(app); + let title = super::title::split_title(app); let block = Block::default() .borders(Borders::ALL) .title(title) @@ -73,31 +89,58 @@ pub(crate) fn render_split_view( .split(inner); let scroll_x = app.diff.scroll_x.min(u16::MAX as usize) as u16; - let left_para = Paragraph::new(left_lines).scroll((0, scroll_x)); - // A left border on the right column draws the vertical divider between - // the two halves and indents the new-side content by one cell. - let right_para = Paragraph::new(right_lines) - .block( - Block::default() - .borders(Borders::LEFT) - .border_style(border_style), - ) - .scroll((0, scroll_x)); + super::gutter::render_gutter_and_body( + frame, + halves[0], + gutter_width, + left_gutter, + left_lines, + scroll_x, + ); + + // A left border on the right column draws the vertical divider between the + // two halves and indents the new-side content by one cell. It is rendered + // on its own so the gutter and body can split the area inside it. + let right_block = Block::default() + .borders(Borders::LEFT) + .border_style(border_style); + let right_inner = right_block.inner(halves[1]); + frame.render_widget(right_block, halves[1]); + super::gutter::render_gutter_and_body( + frame, + right_inner, + gutter_width, + right_gutter, + right_lines, + scroll_x, + ); +} - frame.render_widget(left_para, halves[0]); - frame.render_widget(right_para, halves[1]); +/// Which side's line number a half shows. +enum Side { + Old, + New, } -/// Build one side's `Line` for a split body row. `None` (no counterpart line -/// on this side) renders as a blank line; otherwise the cell is styled by line -/// kind and reuses the prebuilt highlight cache, mirroring the unified -/// renderer's per-line treatment. -fn split_side_line<'a>(app: &'a App, cell: Option<(usize, usize)>) -> Line<'a> { +/// Build one side's gutter and body `Line` for a split body row, as +/// `(gutter, body)`. `None` (no counterpart line on this side) renders both as +/// blank; otherwise the cell is styled by line kind and reuses the prebuilt +/// highlight cache, mirroring the unified renderer's per-line treatment. +/// +/// Both lines come from one lookup so they cannot disagree about which +/// `DiffLine` the row is showing. +fn split_side_lines<'a>( + app: &'a App, + cell: Option<(usize, usize)>, + digits: usize, + side: Side, +) -> (Line<'a>, Line<'a>) { + let blank = || (Line::from(""), Line::from("")); let Some((hi, li)) = cell else { - return Line::from(""); + return blank(); }; let Some(diff_line) = app.diff.hunks.get(hi).and_then(|h| h.lines.get(li)) else { - return Line::from(""); + return blank(); }; let bg = match diff_line.kind { @@ -128,29 +171,14 @@ fn split_side_line<'a>(app: &'a App, cell: Option<(usize, usize)>) -> Line<'a> { Style::default().bg(bg), )); } - Line::from(spans) -} -/// Title for the split pane: the same file/commit label the unified view uses, -/// tagged `[split]`. Search match counts are omitted because the split view -/// does not render search highlights. -fn split_title(app: &App) -> String { - let label = match app.mode { - ViewMode::Log => { - if app.log_view.diff_title.is_empty() { - "Diff".to_string() - } else { - app.log_view.diff_title.clone() - } - } - ViewMode::Status => app - .selected_filtered_status_file() - .map(|f| f.path.clone()) - .unwrap_or_else(|| "Diff".to_string()), - ViewMode::Tree => app - .tree_view - .selected_path() - .unwrap_or_else(|| "File".to_string()), + let lineno = match side { + Side::Old => diff_line.old_lineno, + Side::New => diff_line.new_lineno, }; - format!(" {} {label} [split] ", super::jump_legend(app, '2')) + let gutter = Line::from(Span::styled( + super::gutter::side_gutter_text(lineno, digits), + Style::default().fg(Color::DarkGray).bg(bg), + )); + (gutter, Line::from(spans)) } diff --git a/src/ui/diff_viewer/tests/file_view.rs b/src/ui/diff_viewer/tests/file_view.rs new file mode 100644 index 00000000..0ef425a7 --- /dev/null +++ b/src/ui/diff_viewer/tests/file_view.rs @@ -0,0 +1,44 @@ +use super::*; + +/// Regression: the file view already had a gutter, but it shared the body's +/// paragraph, so scrolling sideways carried the numbers off the left edge. +#[test] +fn file_view_line_numbers_stay_put_when_the_body_scrolls_sideways() { + let mut app = app_with_files(vec!["src/lib.rs"]); + app.mode = ViewMode::Status; + app.diff.view = DiffPaneView::File; + app.diff.file_view.key = Some(crate::app::FileViewKey::Status("src/lib.rs".to_string())); + app.diff.file_view.content = + "fn first() { let a_long_identifier = 1; }\nfn second() {}\n".to_string(); + + let unscrolled = drawn_file_view(&mut app, 60, 8, 0); + let scrolled = drawn_file_view(&mut app, 60, 8, 12); + + for screen in [&unscrolled, &scrolled] { + assert!( + screen.iter().any(|l| l.contains('1')) && screen.iter().any(|l| l.contains('2')), + "both line numbers must be on screen, got:\n{screen:#?}" + ); + } + assert_ne!( + unscrolled, scrolled, + "the body should actually have scrolled" + ); + assert_eq!( + unscrolled + .iter() + .filter_map(|l| l.find(" 1 ").map(|_| ())) + .count(), + scrolled + .iter() + .filter_map(|l| l.find(" 1 ").map(|_| ())) + .count(), + "the numbered gutter column must survive the scroll:\n{scrolled:#?}" + ); +} + +/// The file view reads its own horizontal offset, not `diff.scroll_x`. +fn drawn_file_view(app: &mut App, width: u16, height: u16, scroll_x: usize) -> Vec { + app.diff.file_view.scroll_x = scroll_x; + drawn(app, width, height, 0) +} diff --git a/src/ui/diff_viewer/tests/mod.rs b/src/ui/diff_viewer/tests/mod.rs new file mode 100644 index 00000000..e316400e --- /dev/null +++ b/src/ui/diff_viewer/tests/mod.rs @@ -0,0 +1,123 @@ +//! Line-number gutter rendering. +//! +//! The gutter and the diff body are deliberately two `Paragraph`s: a single +//! paragraph would slide the numbers off the left edge as soon as the body is +//! scrolled horizontally. Several of these tests exist only to keep that from +//! regressing, so they assert on a rendered screen rather than on a helper. + +use crate::app::tests::app_with_files; +use crate::app::{App, DiffPaneView, ViewMode}; +use crate::git::diff::{DiffHunk, DiffLine, LineKind}; +use ratatui::{Terminal, backend::TestBackend, layout::Rect, style::Color}; +use syntect::highlighting::ThemeSet; + +/// A context / removed / added trio, which is the shape that exercises every +/// gutter column state: both numbers, old only, new only. +fn trio_hunk() -> DiffHunk { + DiffHunk { + header: "@@ -41,3 +41,3 @@".to_string(), + lines: vec![ + DiffLine { + kind: LineKind::Context, + content: "keep_me();".to_string(), + old_lineno: Some(41), + new_lineno: Some(41), + }, + DiffLine { + kind: LineKind::Removed, + content: "gone();".to_string(), + old_lineno: Some(42), + new_lineno: None, + }, + DiffLine { + kind: LineKind::Added, + content: "fresh();".to_string(), + old_lineno: None, + new_lineno: Some(42), + }, + ], + file_path: Some("src/lib.rs".to_string()), + } +} + +fn app_showing(hunk: DiffHunk, view: DiffPaneView) -> App { + let mut app = app_with_files(vec!["src/lib.rs"]); + app.mode = ViewMode::Status; + app.diff.hunks = vec![hunk]; + app.diff.view = view; + app +} + +/// Screen column of `needle`. `str::find` yields a byte offset, and the pane +/// border is a 3-byte `│`, so byte offsets are not columns here. +fn col_of(line: &str, needle: &str) -> usize { + let byte = line + .find(needle) + .unwrap_or_else(|| panic!("{needle:?} not in {line:?}")); + line[..byte].chars().count() +} + +/// The `n` leftmost columns of a rendered row, counted in characters. +fn left_columns(line: &str, n: usize) -> String { + line.chars().take(n).collect() +} + +/// Everything from column `n` rightwards, counted in characters. +fn right_columns(line: &str, n: usize) -> String { + line.chars().skip(n).collect() +} + +/// Render the diff pane on its own and return the screen as lines of text. +fn drawn(app: &mut App, width: u16, height: u16, scroll_x: usize) -> Vec { + app.diff.scroll_x = scroll_x; + let mut terminal = Terminal::new(TestBackend::new(width, height)).expect("a terminal"); + let ss = two_face::syntax::extra_newlines(); + let ts = ThemeSet::load_defaults(); + terminal + .draw(|frame| { + super::render( + frame, + app, + Rect::new(0, 0, width, height), + &ss, + &ts, + Color::Yellow, + ); + }) + .expect("draw"); + let buf = terminal.backend().buffer(); + (0..buf.area.height) + .map(|y| { + (0..buf.area.width) + .map(|x| buf[(x, y)].symbol()) + .collect::() + }) + .collect() +} +/// The split view pairs a removed line with its added counterpart on one row, +/// so this fixture gives the two sides *different* numbers — with both at 42 +/// the test could not tell an old column from a new one. +fn skewed_pair_hunk() -> DiffHunk { + DiffHunk { + header: "@@ -42 +77 @@".to_string(), + lines: vec![ + DiffLine { + kind: LineKind::Removed, + content: "gone();".to_string(), + old_lineno: Some(42), + new_lineno: None, + }, + DiffLine { + kind: LineKind::Added, + content: "fresh();".to_string(), + old_lineno: None, + new_lineno: Some(77), + }, + ], + file_path: Some("src/lib.rs".to_string()), + } +} + +mod file_view; +mod split; +mod unified; diff --git a/src/ui/diff_viewer/tests/split.rs b/src/ui/diff_viewer/tests/split.rs new file mode 100644 index 00000000..ddaa7e19 --- /dev/null +++ b/src/ui/diff_viewer/tests/split.rs @@ -0,0 +1,37 @@ +use super::*; + +#[test] +fn split_halves_number_the_side_each_one_shows() { + let mut app = app_showing(skewed_pair_hunk(), DiffPaneView::Split); + + // Wide enough to clear MIN_SPLIT_WIDTH, or the renderer falls back to + // unified and this would silently test the wrong layout. + let screen = drawn(&mut app, 120, 10, 0); + let joined = screen.join("\n"); + assert!( + joined.contains("[split]"), + "the split layout must actually be in use, got:\n{joined}" + ); + + // One row, both sides: the removed line on the left, its replacement on the + // right. That pairing is what the split view is for. + let row = screen + .iter() + .find(|l| l.contains("gone")) + .expect("the paired change row"); + assert!( + row.contains("fresh"), + "the split view pairs the removal with its replacement on one row: {row:?}" + ); + + let mid = 120 / 2; + let (left, right) = (left_columns(row, mid), right_columns(row, mid)); + assert!( + left.contains("42") && !left.contains("77"), + "the left half carries only the old-side number: {left:?}" + ); + assert!( + right.contains("77") && !right.contains("42"), + "the right half carries only the new-side number: {right:?}" + ); +} diff --git a/src/ui/diff_viewer/tests/unified.rs b/src/ui/diff_viewer/tests/unified.rs new file mode 100644 index 00000000..3ba41e93 --- /dev/null +++ b/src/ui/diff_viewer/tests/unified.rs @@ -0,0 +1,108 @@ +use super::*; + +#[test] +fn unified_gutter_numbers_each_line_on_the_side_it_exists_on() { + let mut app = app_showing(trio_hunk(), DiffPaneView::Diff); + + let screen = drawn(&mut app, 60, 10, 0); + let body: Vec<&String> = screen.iter().filter(|l| l.contains("();")).collect(); + + let context = body + .iter() + .find(|l| l.contains("keep_me")) + .expect("the context row"); + let removed = body + .iter() + .find(|l| l.contains("gone")) + .expect("the removed row"); + let added = body + .iter() + .find(|l| l.contains("fresh")) + .expect("the added row"); + + assert!( + context.contains("41") && context.matches("41").count() == 2, + "a context line exists on both sides, so both columns carry 41: {context:?}" + ); + assert!( + removed.contains("42"), + "a removed line keeps its old number: {removed:?}" + ); + assert!( + removed.matches("42").count() == 1, + "a removed line has no new-side number: {removed:?}" + ); + assert!( + added.matches("42").count() == 1, + "an added line has only a new-side number: {added:?}" + ); +} + +/// The reason the gutter is a separate paragraph at all. +#[test] +fn unified_gutter_stays_put_when_the_body_scrolls_sideways() { + let mut app = app_showing(trio_hunk(), DiffPaneView::Diff); + + let unscrolled = drawn(&mut app, 60, 10, 0); + let scrolled = drawn(&mut app, 60, 10, 6); + + let numbers_before = unscrolled.iter().filter(|l| l.contains("41")).count(); + let numbers_after = scrolled.iter().filter(|l| l.contains("41")).count(); + assert_eq!( + numbers_before, numbers_after, + "the gutter must survive horizontal scroll, got:\n{scrolled:#?}" + ); + assert!( + scrolled.iter().any(|l| !l.contains("keep_me()")), + "the body should actually have scrolled, got:\n{scrolled:#?}" + ); +} + +#[test] +fn a_hunk_header_reserves_the_same_gutter_width_as_the_body() { + let mut app = app_showing(trio_hunk(), DiffPaneView::Diff); + + let screen = drawn(&mut app, 60, 10, 0); + let header = screen + .iter() + .find(|l| l.contains("@@")) + .expect("the hunk header row"); + let body = screen + .iter() + .find(|l| l.contains("keep_me")) + .expect("the context row"); + + // The body carries a `+`/`-`/space kind marker that the header does not, so + // aligned means "one column apart", not "equal". Asserting the relationship + // rather than a literal column keeps this from pinning the gutter's width. + assert_eq!( + col_of(header, "@@") + 1, + col_of(body, "keep_me"), + "header and body must start from the same gutter edge:\nheader {header:?}\nbody {body:?}" + ); + assert!( + col_of(header, "@@") > 1, + "the header must clear the reserved gutter rather than starting against \ + the border, got column {} in {header:?}", + col_of(header, "@@") + ); +} + +#[test] +fn an_empty_diff_reserves_no_gutter_for_its_placeholder() { + let mut app = app_with_files(vec![]); + app.mode = ViewMode::Status; + + let screen = drawn(&mut app, 60, 10, 0); + let msg = screen + .iter() + .find(|l| l.contains("No changes")) + .expect("the placeholder row"); + + assert_eq!( + col_of(msg, "No changes"), + 1, + "with nothing to number the message sits against the border, not \ + indented under an empty gutter: {msg:?}" + ); +} diff --git a/src/ui/diff_viewer/title.rs b/src/ui/diff_viewer/title.rs new file mode 100644 index 00000000..a5dbe553 --- /dev/null +++ b/src/ui/diff_viewer/title.rs @@ -0,0 +1,52 @@ +use crate::app::{App, ViewMode}; +use crate::ui::jump_legend; + +/// What the diff pane is showing right now: the commit's diff title in log +/// mode, the selected path in status/tree mode, with per-mode fallbacks for +/// "nothing selected". +fn diff_label(app: &App) -> String { + match app.mode { + ViewMode::Log => { + if app.log_view.diff_title.is_empty() { + "Diff".to_string() + } else { + app.log_view.diff_title.clone() + } + } + ViewMode::Status => app + .selected_filtered_status_file() + .map(|f| f.path.clone()) + .unwrap_or_else(|| "Diff".to_string()), + ViewMode::Tree => app + .tree_view + .selected_path() + .unwrap_or_else(|| "File".to_string()), + } +} + +/// Title for the unified diff pane: jump legend, label, and the search match +/// counter while a query is active. +pub(crate) fn unified_title(app: &App) -> String { + let jump = jump_legend(app, '2'); + let label = diff_label(app); + if !app.diff.search.has_query() { + return format!(" {jump} {label} "); + } + let count = app.diff.search.matches.len(); + if count == 0 { + format!(" {jump} {label} [no matches] ") + } else { + format!( + " {jump} {label} [{}/{}] ", + app.diff.search.cursor + 1, + count + ) + } +} + +/// Title for the split pane: the same label, tagged `[split]`. Search match +/// counts are omitted because the split view does not render search +/// highlights. +pub(crate) fn split_title(app: &App) -> String { + format!(" {} {} [split] ", jump_legend(app, '2'), diff_label(app)) +} diff --git a/src/web/viewer/dto/tests/mod.rs b/src/web/viewer/dto/tests/mod.rs index 70262595..8ee543a2 100644 --- a/src/web/viewer/dto/tests/mod.rs +++ b/src/web/viewer/dto/tests/mod.rs @@ -173,6 +173,8 @@ fn hunk(header: &str, lines: usize, width: usize) -> DiffHunk { .map(|_| crate::git::diff::DiffLine { kind: LineKind::Context, content: "x".repeat(width), + old_lineno: None, + new_lineno: None, }) .collect(), } @@ -187,14 +189,20 @@ fn diff_dto_maps_line_kinds_to_wire_codes() { crate::git::diff::DiffLine { kind: LineKind::Added, content: "new".into(), + old_lineno: None, + new_lineno: Some(1), }, crate::git::diff::DiffLine { kind: LineKind::Removed, content: "old".into(), + old_lineno: Some(1), + new_lineno: None, }, crate::git::diff::DiffLine { kind: LineKind::Context, content: "same".into(), + old_lineno: Some(2), + new_lineno: Some(2), }, ], }]; From cfcaf94620a611f58ff7215e2745e6e2059d7ea1 Mon Sep 17 00:00:00 2001 From: whackur Date: Wed, 29 Jul 2026 16:08:58 +0900 Subject: [PATCH 15/19] feat: cycle the diff view with Tab MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit There were already three displays — unified, split, file — but v and s each toggle one of them against the unified default, so the third is undiscoverable unless you already know it is there. Tab walks all three; v and s stay for jumping straight to a known view. The file step is skipped when can_open_file_view is false rather than being a dead press, matching the gate that already makes v a no-op, and the whole cycle is inert in tree view where the right pane is always the file preview. Co-Authored-By: Claude Opus 5 (1M context) --- README.md | 1 + docs/architecture.md | 1 + src/app/file_view_load.rs | 28 +++++++++++++++++ src/app/tests/diff_file_view.rs | 50 +++++++++++++++++++++++++++++++ src/application/input/handlers.rs | 2 ++ src/application/tests/search.rs | 25 ++++++++++++++++ src/ui/hint_text.rs | 12 ++++---- 7 files changed, 113 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index e1ee410e..456588f6 100644 --- a/README.md +++ b/README.md @@ -211,6 +211,7 @@ through to the terminal program. | `PgUp` / `PgDn` | Scroll 20 lines | | `←` / `→` | Horizontal scroll (4 columns) | | `v` | Toggle between hunk diff and full file preview | +| `Tab` | Cycle the display: unified diff → side-by-side split → file contents → unified. `v` and `s` each toggle one view against the unified default, so the third stays hidden unless you know it exists; `Tab` walks all three. Skips the file step when there is no file to open, and does nothing in tree view | | `s` | Toggle between the unified diff and a side-by-side split view (falls back to unified when the pane is too narrow) | | — | **Line numbers** are always shown in a pinned gutter. The unified view shows both sides (old, new) — an added line leaves the old column blank, a removed line leaves the new one blank. The split view numbers each half with the side it shows, and the file view (`v`) numbers the file itself. The gutter stays in place while `←`/`→` scroll the code | | ` f` | Zoom the diff/file pane to full screen (toggle) | diff --git a/docs/architecture.md b/docs/architecture.md index dda2d8dd..fddaf17e 100644 --- a/docs/architecture.md +++ b/docs/architecture.md @@ -214,6 +214,7 @@ trait TerminalBackend { - **gutter와 본문은 반드시 별개 `Paragraph`여야 한다.** diff 계열은 수평 스크롤을 `Paragraph::scroll((0, x))`로 구현하는데 이건 라인을 통째로 밀기 때문에, 같은 paragraph에 있는 gutter는 `scroll_x > 0`이면 왼쪽으로 사라진다(실제로 file view에 그 버그가 있었다). `Block`을 따로 그리고 `block.inner`를 `Layout::Horizontal`로 쪼개 gutter는 `scroll((0,0))`, 본문만 스크롤한다. 수직 스크롤은 **어느 행을 담았는지**로 표현되므로 두 vector를 같은 루프에서 lockstep으로 채우는 것이 정렬을 지키는 유일한 수단이다. - 폭은 로드된 hunk 전체의 최대 줄 번호에서 파생하고 최소 3자리를 보장한다. 보이는 창 기준으로 계산하면 스크롤 중에 본문 좌측 경계가 흔들린다. hunk 헤더 행도 같은 폭의 빈 gutter를 받아야 `@@`가 본문보다 한 칼럼 왼쪽에서 시작하지 않는다. - `MIN_SPLIT_WIDTH`를 80 → 90으로 올렸다. 각 half가 gutter에 5칼럼을 쓰므로, 문턱을 그대로 두면 side-by-side 진입은 되지만 half당 읽을 수 있는 코드 폭이 조용히 줄어든다. +- **표시 방식 전환**: `DiffPaneView`는 `Diff`/`Split`/`File` 세 값인데 `v`(File 토글)와 `s`(Split 토글)는 각각 unified를 기준으로 한 축만 오간다 — 세 번째가 있다는 걸 모르면 발견할 수 없다. `Tab`(`App::cycle_diff_view`)이 `Diff → Split → File → Diff`로 셋을 모두 순회해 집합을 드러내고, `v`/`s`는 아는 뷰로 바로 가는 용도로 남는다. File 단계는 `can_open_file_view`가 거짓이면(선택 없음 / 해석 불가한 커밋 파일) 건너뛴다 — `v`가 no-op이 되는 것과 같은 게이트이며, 순회 중 죽은 입력을 만들지 않기 위함이다. Tree 모드는 우측 pane이 항상 파일 미리보기라 순회 대상이 없어 no-op이다. ### Split-View Terminal Panel diff --git a/src/app/file_view_load.rs b/src/app/file_view_load.rs index 76123380..816b648f 100644 --- a/src/app/file_view_load.rs +++ b/src/app/file_view_load.rs @@ -112,6 +112,34 @@ impl App { }; } + /// Step to the next display: unified → split → file → unified. + /// + /// `v` and `s` each toggle one view against the unified default, which + /// leaves the third one undiscoverable unless you already know it exists. + /// One key that walks all three makes the set visible; the direct toggles + /// stay for jumping straight to a known view. + /// + /// The file step is skipped when there is nothing to open (no selection, or + /// a commit whose file cannot be resolved) rather than being a dead press — + /// the same gate `can_open_file_view` puts on `v`. + pub fn cycle_diff_view(&mut self) { + // Tree mode's right pane is always the raw file preview, so there is + // no cycle to walk — matching `v`/`s`. + if self.mode == ViewMode::Tree { + return; + } + match self.diff.view { + DiffPaneView::Diff => self.toggle_diff_split_view(), + DiffPaneView::Split => { + self.diff.view = DiffPaneView::Diff; + if self.can_open_file_view() { + self.toggle_diff_file_view(); + } + } + DiffPaneView::File => self.toggle_diff_file_view(), + } + } + pub(crate) fn load_commit_diff_for_selected(&mut self) { let (oid, title) = match self.log_view.commits.get(self.log_view.selected) { Some(entry) => (entry.oid, entry.to_string()), diff --git a/src/app/tests/diff_file_view.rs b/src/app/tests/diff_file_view.rs index d08b1154..78f31400 100644 --- a/src/app/tests/diff_file_view.rs +++ b/src/app/tests/diff_file_view.rs @@ -36,6 +36,56 @@ fn toggle_diff_file_view_ignores_selection_outside_filter() { assert!(app.diff.file_view.key.is_none()); } +#[test] +fn cycling_the_diff_view_walks_all_three_and_returns_to_the_start() { + let mut app = app_with_files(vec!["a.rs"]); + assert_eq!(app.diff.view, DiffPaneView::Diff); + + app.cycle_diff_view(); + assert_eq!(app.diff.view, DiffPaneView::Split); + app.cycle_diff_view(); + assert_eq!(app.diff.view, DiffPaneView::File); + app.cycle_diff_view(); + assert_eq!( + app.diff.view, + DiffPaneView::Diff, + "the cycle must close so one key can reach every view" + ); +} + +#[test] +fn cycling_skips_the_file_view_when_there_is_nothing_to_open() { + // Selection outside the filter leaves no resolvable file, the same gate + // that makes `v` a no-op. Skipping keeps the press from doing nothing. + let mut app = app_with_files(vec!["alpha.rs", "bravo.rs"]); + app.status_view.search_query.set("alpha"); + app.status_view.recompute_filter(); + app.status_view.selected = 1; + assert!(!app.can_open_file_view()); + + app.cycle_diff_view(); + assert_eq!(app.diff.view, DiffPaneView::Split); + app.cycle_diff_view(); + assert_eq!( + app.diff.view, + DiffPaneView::Diff, + "with no file to show the cycle is unified <-> split" + ); +} + +#[test] +fn cycling_the_diff_view_does_nothing_in_tree_mode() { + // Tree mode's right pane is always the raw file preview, so there is no + // cycle to walk — matching `v`/`s`. + let mut app = app_with_files(vec!["a.rs"]); + app.mode = ViewMode::Tree; + app.diff.view = DiffPaneView::File; + + app.cycle_diff_view(); + + assert_eq!(app.diff.view, DiffPaneView::File); +} + #[test] fn toggle_diff_split_view_round_trips_and_overrides_file_view() { let mut app = app_with_files(vec!["a.rs"]); diff --git a/src/application/input/handlers.rs b/src/application/input/handlers.rs index afbb4274..abc36dad 100644 --- a/src/application/input/handlers.rs +++ b/src/application/input/handlers.rs @@ -263,6 +263,8 @@ fn handle_unmapped_upper_key(app: &mut App, key: KeyEvent) { Focus::DiffViewer => match key.code { _ if matches_text_command(key, 'v') => app.toggle_diff_file_view(), _ if matches_text_command(key, 's') => app.toggle_diff_split_view(), + // Walks all three views; `v`/`s` still jump straight to one. + KeyCode::Tab => app.cycle_diff_view(), _ if matches_text_command(key, '/') => { exit_split_for_search(app); app.diff.start_search(); diff --git a/src/application/tests/search.rs b/src/application/tests/search.rs index 7c3e0c8e..bd6dfe72 100644 --- a/src/application/tests/search.rs +++ b/src/application/tests/search.rs @@ -94,3 +94,28 @@ fn handle_key_diff_next_match_from_split_returns_to_unified_when_query_exists() assert_eq!(app.diff.view, DiffPaneView::Diff); } + +#[test] +fn tab_in_the_diff_viewer_cycles_the_view() { + // Tab reaching the diff viewer at all is the point: it is not a text + // command, so it needs its own arm in the focus handler. + let mut app = app_with_files(vec!["a.rs"]); + app.focus = Focus::DiffViewer; + assert_eq!(app.diff.view, DiffPaneView::Diff); + + let _ = handle_key(&mut app, press(KeyCode::Tab, KeyModifiers::NONE)); + + assert_eq!(app.diff.view, DiffPaneView::Split); +} + +#[test] +fn tab_outside_the_diff_viewer_leaves_the_view_alone() { + // The file list owns Tab-less navigation and the terminal forwards Tab to + // its PTY; neither may reach the diff pane's cycle. + let mut app = app_with_files(vec!["a.rs"]); + app.focus = Focus::FileList; + + let _ = handle_key(&mut app, press(KeyCode::Tab, KeyModifiers::NONE)); + + assert_eq!(app.diff.view, DiffPaneView::Diff); +} diff --git a/src/ui/hint_text.rs b/src/ui/hint_text.rs index 365d753d..4186a0a9 100644 --- a/src/ui/hint_text.rs +++ b/src/ui/hint_text.rs @@ -75,10 +75,10 @@ pub(crate) fn normal_hint_literal(app: &App) -> &'static str { } else if !app.diff.search.query.is_empty() { " f: exit zoom | n: next match | shift+n: prev match | /: new search | esc: clear" } else if app.can_open_file_view() { - " f: exit zoom | j/k: scroll | v: view file | s: split | /: search | pgup/pgdn: page | q: quit" + " f: exit zoom | j/k: scroll | tab: view | v: view file | s: split | /: search | pgup/pgdn: page | q: quit" } else { // No file target for `v` — a hint for a no-op key would lie. - " f: exit zoom | j/k: scroll | s: split | /: search | pgup/pgdn: page | q: quit" + " f: exit zoom | j/k: scroll | tab: view | s: split | /: search | pgup/pgdn: page | q: quit" }; return hint; } @@ -148,16 +148,16 @@ pub(crate) fn normal_hint_literal(app: &App) -> &'static str { // The `l` toggle names its destination (Tree mode never reaches // these arms — its right pane is always the file view). if app.mode == ViewMode::Log { - " shift+←/→: cycle | j/k: scroll | pgup/pgdn: scroll | v: view file | s: split | /: search | t: new pane | f: zoom | l: status view | b: tree view | o: open project | q: quit" + " shift+←/→: cycle | j/k: scroll | pgup/pgdn: scroll | tab: view | v: view file | s: split | /: search | t: new pane | f: zoom | l: status view | b: tree view | o: open project | q: quit" } else { - " shift+←/→: cycle | j/k: scroll | pgup/pgdn: scroll | v: view file | s: split | /: search | t: new pane | f: zoom | l: log view | b: tree view | o: open project | q: quit" + " shift+←/→: cycle | j/k: scroll | pgup/pgdn: scroll | tab: view | v: view file | s: split | /: search | t: new pane | f: zoom | l: log view | b: tree view | o: open project | q: quit" } } else { // No file target for `v` — a hint for a no-op key would lie. if app.mode == ViewMode::Log { - " shift+←/→: cycle | j/k: scroll | pgup/pgdn: scroll | s: split | /: search | t: new pane | f: zoom | l: status view | b: tree view | o: open project | q: quit" + " shift+←/→: cycle | j/k: scroll | pgup/pgdn: scroll | tab: view | s: split | /: search | t: new pane | f: zoom | l: status view | b: tree view | o: open project | q: quit" } else { - " shift+←/→: cycle | j/k: scroll | pgup/pgdn: scroll | s: split | /: search | t: new pane | f: zoom | l: log view | b: tree view | o: open project | q: quit" + " shift+←/→: cycle | j/k: scroll | pgup/pgdn: scroll | tab: view | s: split | /: search | t: new pane | f: zoom | l: log view | b: tree view | o: open project | q: quit" } } } From 67591c582a6fb416bb6d1bdcd4e387bc095ce35e Mon Sep 17 00:00:00 2001 From: whackur Date: Wed, 29 Jul 2026 16:16:35 +0900 Subject: [PATCH 16/19] feat: toggle soft wrapping in the diff and file views MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `w` wraps long lines instead of making you scroll sideways for the tail. Wrapping and horizontal scrolling are mutually exclusive by construction, not by choice: ratatui's Paragraph ignores scroll.x once wrapping is on. Enabling wrap therefore resets the offset, or turning it back off would resurrect a stale one. While wrapping, the line-number gutter folds into the body line. A wrapped body line spans several screen rows while its gutter line spans one, so a separate gutter paragraph would desynchronise every row below it — and the reason the gutter was separated in the first place (horizontal scroll) does not exist in this mode. A continuation row therefore carries no number. The split view ignores wrapping outright: halves folding to different heights would stop lining up, which is the only reason that layout exists. Vertical scroll stays in logical lines, so wrapping can leave the bottom of the pane short of a full screen. Nothing becomes unreachable, and search matches keep indexing logical rows. Co-Authored-By: Claude Opus 5 (1M context) --- README.md | 1 + docs/architecture.md | 4 ++ src/app/file_view_load.rs | 13 +++++ src/app/tests/diff_file_view.rs | 28 +++++++++ src/application/input/handlers.rs | 1 + src/ui/diff_pane/mod.rs | 7 +++ src/ui/diff_viewer/file_view.rs | 1 + src/ui/diff_viewer/gutter.rs | 37 +++++++++++- src/ui/diff_viewer/mod.rs | 1 + src/ui/diff_viewer/split_view.rs | 4 ++ src/ui/diff_viewer/tests/mod.rs | 1 + src/ui/diff_viewer/tests/wrap.rs | 94 +++++++++++++++++++++++++++++++ src/ui/hint_text.rs | 12 ++-- 13 files changed, 196 insertions(+), 8 deletions(-) create mode 100644 src/ui/diff_viewer/tests/wrap.rs diff --git a/README.md b/README.md index 456588f6..7d4c78e3 100644 --- a/README.md +++ b/README.md @@ -211,6 +211,7 @@ through to the terminal program. | `PgUp` / `PgDn` | Scroll 20 lines | | `←` / `→` | Horizontal scroll (4 columns) | | `v` | Toggle between hunk diff and full file preview | +| `w` | Toggle soft wrapping of long lines. On, the tail of a long line continues on the next row instead of needing `←`/`→`; the line number folds into the line rather than sitting in its own column, so a continuation row carries no number. Horizontal scrolling is inert while wrapping (and the offset resets when you turn it on). The split view ignores wrapping — halves folding to different heights would stop lining up | | `Tab` | Cycle the display: unified diff → side-by-side split → file contents → unified. `v` and `s` each toggle one view against the unified default, so the third stays hidden unless you know it exists; `Tab` walks all three. Skips the file step when there is no file to open, and does nothing in tree view | | `s` | Toggle between the unified diff and a side-by-side split view (falls back to unified when the pane is too narrow) | | — | **Line numbers** are always shown in a pinned gutter. The unified view shows both sides (old, new) — an added line leaves the old column blank, a removed line leaves the new one blank. The split view numbers each half with the side it shows, and the file view (`v`) numbers the file itself. The gutter stays in place while `←`/`→` scroll the code | diff --git a/docs/architecture.md b/docs/architecture.md index fddaf17e..36deac6b 100644 --- a/docs/architecture.md +++ b/docs/architecture.md @@ -214,6 +214,10 @@ trait TerminalBackend { - **gutter와 본문은 반드시 별개 `Paragraph`여야 한다.** diff 계열은 수평 스크롤을 `Paragraph::scroll((0, x))`로 구현하는데 이건 라인을 통째로 밀기 때문에, 같은 paragraph에 있는 gutter는 `scroll_x > 0`이면 왼쪽으로 사라진다(실제로 file view에 그 버그가 있었다). `Block`을 따로 그리고 `block.inner`를 `Layout::Horizontal`로 쪼개 gutter는 `scroll((0,0))`, 본문만 스크롤한다. 수직 스크롤은 **어느 행을 담았는지**로 표현되므로 두 vector를 같은 루프에서 lockstep으로 채우는 것이 정렬을 지키는 유일한 수단이다. - 폭은 로드된 hunk 전체의 최대 줄 번호에서 파생하고 최소 3자리를 보장한다. 보이는 창 기준으로 계산하면 스크롤 중에 본문 좌측 경계가 흔들린다. hunk 헤더 행도 같은 폭의 빈 gutter를 받아야 `@@`가 본문보다 한 칼럼 왼쪽에서 시작하지 않는다. - `MIN_SPLIT_WIDTH`를 80 → 90으로 올렸다. 각 half가 gutter에 5칼럼을 쓰므로, 문턱을 그대로 두면 side-by-side 진입은 되지만 half당 읽을 수 있는 코드 폭이 조용히 줄어든다. +- **자동 줄바꿈**(`DiffPane::wrap`, diff pane focus에서 `w`): ratatui `Paragraph::wrap`은 켜지면 `scroll.x`를 무시하므로(`ratatui-widgets`의 `render_paragraph`가 wrap 분기에서 `WordWrapper`만 쓰고 `LineTruncator`의 horizontal offset 경로를 타지 않는다) **줄바꿈과 수평 스크롤은 구조적으로 배타**다. 켤 때 `scroll_x`를 0으로 되돌린다 — 남겨두면 끌 때 낡은 오프셋이 되살아난다. + - 줄바꿈 모드에서는 **gutter를 본문 라인 안으로 접어 넣는다**. 본문 한 줄이 여러 화면 행을 먹는데 gutter 라인은 한 행이라, 두 paragraph를 나란히 두면 그 아래 전부가 어긋난다. gutter를 분리한 애초의 이유(수평 스크롤)가 이 모드엔 없으므로 인라인이 안전하다. 대가는 이어지는 행에 번호가 붙지 않는 것. + - **split 뷰는 줄바꿈을 무시한다.** 좌/우 half가 서로 다른 높이로 접히면 행 대응이 무너지는데, 그 대응이 이 레이아웃의 유일한 존재 이유다. + - 수직 스크롤은 여전히 **논리 줄** 단위다(렌더러가 창을 직접 슬라이스하고 ratatui의 vertical scroll을 쓰지 않는다). 따라서 줄바꿈이 켜진 채 긴 줄이 많으면 pane 높이보다 적은 논리 줄만 보이고 아래가 잘린다 — 스크롤로 전부 도달할 수 있으므로 감춰지는 내용은 없다. 검색 매치가 논리 행 인덱스라는 전제도 이 덕분에 유지된다. - **표시 방식 전환**: `DiffPaneView`는 `Diff`/`Split`/`File` 세 값인데 `v`(File 토글)와 `s`(Split 토글)는 각각 unified를 기준으로 한 축만 오간다 — 세 번째가 있다는 걸 모르면 발견할 수 없다. `Tab`(`App::cycle_diff_view`)이 `Diff → Split → File → Diff`로 셋을 모두 순회해 집합을 드러내고, `v`/`s`는 아는 뷰로 바로 가는 용도로 남는다. File 단계는 `can_open_file_view`가 거짓이면(선택 없음 / 해석 불가한 커밋 파일) 건너뛴다 — `v`가 no-op이 되는 것과 같은 게이트이며, 순회 중 죽은 입력을 만들지 않기 위함이다. Tree 모드는 우측 pane이 항상 파일 미리보기라 순회 대상이 없어 no-op이다. ### Split-View Terminal Panel diff --git a/src/app/file_view_load.rs b/src/app/file_view_load.rs index 816b648f..2532518e 100644 --- a/src/app/file_view_load.rs +++ b/src/app/file_view_load.rs @@ -112,6 +112,19 @@ impl App { }; } + /// Soft-wrap long lines instead of scrolling sideways to reach them. + /// + /// Turning wrapping on resets the horizontal offset. ratatui ignores it + /// while wrapping, so leaving it set would strand a stale offset that + /// silently reappears the moment wrapping is turned back off. + pub fn toggle_diff_wrap(&mut self) { + self.diff.wrap = !self.diff.wrap; + if self.diff.wrap { + self.diff.scroll_x = 0; + self.diff.file_view.scroll_x = 0; + } + } + /// Step to the next display: unified → split → file → unified. /// /// `v` and `s` each toggle one view against the unified default, which diff --git a/src/app/tests/diff_file_view.rs b/src/app/tests/diff_file_view.rs index 78f31400..1e7bacb3 100644 --- a/src/app/tests/diff_file_view.rs +++ b/src/app/tests/diff_file_view.rs @@ -179,3 +179,31 @@ fn snapshot_refresh_with_no_filter_matches_clears_file_view() { assert_eq!(app.diff.view, DiffPaneView::Diff); assert!(app.diff.file_view.key.is_none()); } + +#[test] +fn enabling_wrap_drops_the_stale_horizontal_offset() { + // ratatui ignores scroll.x while wrapping, so an offset left behind would + // reappear the moment wrap is switched back off. + let mut app = app_with_files(vec!["a.rs"]); + app.diff.scroll_x = 12; + app.diff.file_view.scroll_x = 9; + + app.toggle_diff_wrap(); + + assert!(app.diff.wrap); + assert_eq!(app.diff.scroll_x, 0); + assert_eq!(app.diff.file_view.scroll_x, 0); +} + +#[test] +fn disabling_wrap_leaves_the_offset_where_it_was_reset() { + let mut app = app_with_files(vec!["a.rs"]); + app.toggle_diff_wrap(); + app.toggle_diff_wrap(); + + assert!(!app.diff.wrap); + assert_eq!( + app.diff.scroll_x, 0, + "turning wrap off must not resurrect a pre-wrap offset" + ); +} diff --git a/src/application/input/handlers.rs b/src/application/input/handlers.rs index abc36dad..6cc90821 100644 --- a/src/application/input/handlers.rs +++ b/src/application/input/handlers.rs @@ -263,6 +263,7 @@ fn handle_unmapped_upper_key(app: &mut App, key: KeyEvent) { Focus::DiffViewer => match key.code { _ if matches_text_command(key, 'v') => app.toggle_diff_file_view(), _ if matches_text_command(key, 's') => app.toggle_diff_split_view(), + _ if matches_text_command(key, 'w') => app.toggle_diff_wrap(), // Walks all three views; `v`/`s` still jump straight to one. KeyCode::Tab => app.cycle_diff_view(), _ if matches_text_command(key, '/') => { diff --git a/src/ui/diff_pane/mod.rs b/src/ui/diff_pane/mod.rs index c5f3a3ba..022b1ecf 100644 --- a/src/ui/diff_pane/mod.rs +++ b/src/ui/diff_pane/mod.rs @@ -59,6 +59,13 @@ pub struct DiffPane { pub(crate) cached_content_bytes: usize, pub scroll: usize, pub scroll_x: usize, + /// Soft-wrap long lines instead of letting them run off the right edge. + /// + /// Mutually exclusive with horizontal scrolling by construction, not by + /// choice: ratatui's `Paragraph` ignores its `scroll.x` once wrapping is on. + /// The split view ignores this entirely — halves that wrap to different + /// heights would stop lining up, which is the whole point of that layout. + pub wrap: bool, pub search: DiffSearch, pub view: DiffPaneView, pub file_view: FileViewState, diff --git a/src/ui/diff_viewer/file_view.rs b/src/ui/diff_viewer/file_view.rs index b8e41f33..f5aa5ff7 100644 --- a/src/ui/diff_viewer/file_view.rs +++ b/src/ui/diff_viewer/file_view.rs @@ -149,6 +149,7 @@ pub(crate) fn render_file_view( gutter_lines, lines, app.diff.file_view.scroll_x.min(u16::MAX as usize) as u16, + app.diff.wrap, ); if let Some(sa) = search_area { diff --git a/src/ui/diff_viewer/gutter.rs b/src/ui/diff_viewer/gutter.rs index ec6a8a2d..5eb4dbc1 100644 --- a/src/ui/diff_viewer/gutter.rs +++ b/src/ui/diff_viewer/gutter.rs @@ -3,7 +3,7 @@ use ratatui::{ Frame, layout::{Constraint, Direction, Layout, Rect}, text::Line, - widgets::Paragraph, + widgets::{Paragraph, Wrap}, }; /// Minimum digits reserved for one line-number column. Keeps the gutter — and @@ -81,11 +81,17 @@ fn lineno_text(no: Option) -> String { /// Render a pinned gutter column and a horizontally scrollable body inside /// `inner` (a `Block`'s inner area — draw the block yourself first). /// -/// The two must be separate `Paragraph`s: `Paragraph::scroll` shifts the whole +/// The two are separate `Paragraph`s: `Paragraph::scroll` shifts the whole /// line, so a gutter span living in the body's paragraph would slide off the /// left edge as soon as `scroll_x > 0`. Vertical scroll is instead expressed /// by *which* lines the caller collected, so passing windows built from the /// same rows is what keeps numbers aligned with their content. +/// +/// With `wrap` set that split is abandoned for the opposite reason: a wrapped +/// body line occupies several screen rows while its gutter line still occupies +/// one, which would desynchronise every row below it. The number is folded into +/// the body line instead, where wrapping carries it along. That is safe only +/// because wrapping and horizontal scrolling cannot both be active. pub(crate) fn render_gutter_and_body( frame: &mut Frame, inner: Rect, @@ -93,7 +99,17 @@ pub(crate) fn render_gutter_and_body( gutter: Vec>, body: Vec>, scroll_x: u16, + wrap: bool, ) { + if wrap { + frame.render_widget( + // `trim: false` keeps a continuation row's leading whitespace, which + // in source code is the indentation. + Paragraph::new(merge_gutter_into_body(gutter, body)).wrap(Wrap { trim: false }), + inner, + ); + return; + } let cols = Layout::default() .direction(Direction::Horizontal) .constraints([Constraint::Length(gutter_width), Constraint::Min(0)]) @@ -101,3 +117,20 @@ pub(crate) fn render_gutter_and_body( frame.render_widget(Paragraph::new(gutter), cols[0]); frame.render_widget(Paragraph::new(body).scroll((0, scroll_x)), cols[1]); } + +/// Prepend each gutter line's spans to the body line it belongs to. The two +/// vectors are built in lockstep by the callers, so index `i` pairs row `i`; a +/// body row with no gutter entry simply keeps its own spans. +fn merge_gutter_into_body<'a>(gutter: Vec>, body: Vec>) -> Vec> { + let mut gutter = gutter.into_iter(); + body.into_iter() + .map(|line| match gutter.next() { + Some(g) => { + let mut spans = g.spans; + spans.extend(line.spans); + Line::from(spans) + } + None => line, + }) + .collect() +} diff --git a/src/ui/diff_viewer/mod.rs b/src/ui/diff_viewer/mod.rs index 66c44047..72f9ffef 100644 --- a/src/ui/diff_viewer/mod.rs +++ b/src/ui/diff_viewer/mod.rs @@ -232,6 +232,7 @@ pub fn render( gutter_lines, lines, app.diff.scroll_x.min(u16::MAX as usize) as u16, + app.diff.wrap, ); if let Some(sa) = search_area { diff --git a/src/ui/diff_viewer/split_view.rs b/src/ui/diff_viewer/split_view.rs index 768e84b5..ac3bc863 100644 --- a/src/ui/diff_viewer/split_view.rs +++ b/src/ui/diff_viewer/split_view.rs @@ -96,6 +96,9 @@ pub(crate) fn render_split_view( left_gutter, left_lines, scroll_x, + // Wrapping is deliberately ignored here: halves that fold to different + // heights stop lining up, and lining up is what this layout is for. + false, ); // A left border on the right column draws the vertical divider between the @@ -113,6 +116,7 @@ pub(crate) fn render_split_view( right_gutter, right_lines, scroll_x, + false, ); } diff --git a/src/ui/diff_viewer/tests/mod.rs b/src/ui/diff_viewer/tests/mod.rs index e316400e..c89ca3dc 100644 --- a/src/ui/diff_viewer/tests/mod.rs +++ b/src/ui/diff_viewer/tests/mod.rs @@ -121,3 +121,4 @@ fn skewed_pair_hunk() -> DiffHunk { mod file_view; mod split; mod unified; +mod wrap; diff --git a/src/ui/diff_viewer/tests/wrap.rs b/src/ui/diff_viewer/tests/wrap.rs new file mode 100644 index 00000000..a1b3f5f3 --- /dev/null +++ b/src/ui/diff_viewer/tests/wrap.rs @@ -0,0 +1,94 @@ +use super::*; + +/// One context line far wider than any pane this test renders into. +fn long_line_hunk() -> DiffHunk { + DiffHunk { + header: "@@ -7,1 +7,1 @@".to_string(), + lines: vec![DiffLine { + kind: LineKind::Context, + content: "alpha bravo charlie delta echo foxtrot golf hotel india juliett".to_string(), + old_lineno: Some(7), + new_lineno: Some(7), + }], + file_path: Some("src/lib.rs".to_string()), + } +} + +/// Rows that carry any of the line's words, i.e. how many screen rows the one +/// logical line ended up occupying. +fn rows_with_content(screen: &[String]) -> usize { + screen + .iter() + .filter(|l| { + ["alpha", "charlie", "foxtrot", "india", "juliett"] + .iter() + .any(|w| l.contains(w)) + }) + .count() +} + +#[test] +fn wrapping_folds_a_long_line_onto_several_rows() { + let mut app = app_showing(long_line_hunk(), DiffPaneView::Diff); + + let truncated = drawn(&mut app, 40, 10, 0); + app.diff.wrap = true; + let wrapped = drawn(&mut app, 40, 10, 0); + + assert_eq!( + rows_with_content(&truncated), + 1, + "unwrapped, the line is clipped to one row:\n{truncated:#?}" + ); + assert!( + rows_with_content(&wrapped) > 1, + "wrapped, it must continue onto further rows:\n{wrapped:#?}" + ); + assert!( + wrapped.iter().any(|l| l.contains("juliett")), + "the tail must become reachable without scrolling:\n{wrapped:#?}" + ); +} + +/// With wrapping on the gutter is folded into the body line, because a separate +/// gutter paragraph would desynchronise the moment a line spans two rows. +#[test] +fn wrapping_keeps_the_line_number_on_the_row_the_line_starts_on() { + let mut app = app_showing(long_line_hunk(), DiffPaneView::Diff); + app.diff.wrap = true; + + let screen = drawn(&mut app, 40, 10, 0); + let first = screen + .iter() + .find(|l| l.contains("alpha")) + .expect("the row the line starts on"); + + assert!( + first.contains('7'), + "the number travels with its own line: {first:?}" + ); + let continuation = screen + .iter() + .find(|l| l.contains("juliett") && !l.contains("alpha")) + .expect("a continuation row"); + assert!( + !continuation.contains('7'), + "a continuation row must not be numbered again: {continuation:?}" + ); +} + +#[test] +fn the_split_view_ignores_wrapping() { + // Halves that fold to different heights would stop lining up, and lining up + // is the only reason to be in this layout. + let mut app = app_showing(long_line_hunk(), DiffPaneView::Split); + app.diff.wrap = true; + + let screen = drawn(&mut app, 120, 10, 0); + + assert_eq!( + rows_with_content(&screen), + 1, + "the split row stays clipped to one row:\n{screen:#?}" + ); +} diff --git a/src/ui/hint_text.rs b/src/ui/hint_text.rs index 4186a0a9..9ee775bd 100644 --- a/src/ui/hint_text.rs +++ b/src/ui/hint_text.rs @@ -75,10 +75,10 @@ pub(crate) fn normal_hint_literal(app: &App) -> &'static str { } else if !app.diff.search.query.is_empty() { " f: exit zoom | n: next match | shift+n: prev match | /: new search | esc: clear" } else if app.can_open_file_view() { - " f: exit zoom | j/k: scroll | tab: view | v: view file | s: split | /: search | pgup/pgdn: page | q: quit" + " f: exit zoom | j/k: scroll | tab: view | w: wrap | v: view file | s: split | /: search | pgup/pgdn: page | q: quit" } else { // No file target for `v` — a hint for a no-op key would lie. - " f: exit zoom | j/k: scroll | tab: view | s: split | /: search | pgup/pgdn: page | q: quit" + " f: exit zoom | j/k: scroll | tab: view | w: wrap | s: split | /: search | pgup/pgdn: page | q: quit" }; return hint; } @@ -148,16 +148,16 @@ pub(crate) fn normal_hint_literal(app: &App) -> &'static str { // The `l` toggle names its destination (Tree mode never reaches // these arms — its right pane is always the file view). if app.mode == ViewMode::Log { - " shift+←/→: cycle | j/k: scroll | pgup/pgdn: scroll | tab: view | v: view file | s: split | /: search | t: new pane | f: zoom | l: status view | b: tree view | o: open project | q: quit" + " shift+←/→: cycle | j/k: scroll | pgup/pgdn: scroll | tab: view | w: wrap | v: view file | s: split | /: search | t: new pane | f: zoom | l: status view | b: tree view | o: open project | q: quit" } else { - " shift+←/→: cycle | j/k: scroll | pgup/pgdn: scroll | tab: view | v: view file | s: split | /: search | t: new pane | f: zoom | l: log view | b: tree view | o: open project | q: quit" + " shift+←/→: cycle | j/k: scroll | pgup/pgdn: scroll | tab: view | w: wrap | v: view file | s: split | /: search | t: new pane | f: zoom | l: log view | b: tree view | o: open project | q: quit" } } else { // No file target for `v` — a hint for a no-op key would lie. if app.mode == ViewMode::Log { - " shift+←/→: cycle | j/k: scroll | pgup/pgdn: scroll | tab: view | s: split | /: search | t: new pane | f: zoom | l: status view | b: tree view | o: open project | q: quit" + " shift+←/→: cycle | j/k: scroll | pgup/pgdn: scroll | tab: view | w: wrap | s: split | /: search | t: new pane | f: zoom | l: status view | b: tree view | o: open project | q: quit" } else { - " shift+←/→: cycle | j/k: scroll | pgup/pgdn: scroll | tab: view | s: split | /: search | t: new pane | f: zoom | l: log view | b: tree view | o: open project | q: quit" + " shift+←/→: cycle | j/k: scroll | pgup/pgdn: scroll | tab: view | w: wrap | s: split | /: search | t: new pane | f: zoom | l: log view | b: tree view | o: open project | q: quit" } } } From a0cdc56429133e8b571f0afb781ab0845928e514 Mon Sep 17 00:00:00 2001 From: whackur Date: Wed, 29 Jul 2026 17:45:19 +0900 Subject: [PATCH 17/19] fix: advertise the wrap key in the file preview's hint legend MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `w` is handled for the whole diff focus, but the legend only offered it in the unified diff arms — so the one view where a long unwrapped line sends you looking for the key was the view that never named it. The split view stays out on purpose: it ignores wrapping, and a hint for a no-op key would lie. Co-Authored-By: Claude Opus 5 (1M context) --- src/ui/hint_text.rs | 11 ++++++---- src/ui/tests/hint_diff_tests.rs | 36 +++++++++++++++++++++++++++++++++ 2 files changed, 43 insertions(+), 4 deletions(-) diff --git a/src/ui/hint_text.rs b/src/ui/hint_text.rs index 9ee775bd..c0d90e80 100644 --- a/src/ui/hint_text.rs +++ b/src/ui/hint_text.rs @@ -64,11 +64,14 @@ pub(crate) fn normal_hint_literal(app: &App) -> &'static str { // Tree mode's right pane is permanently the file view — `v` // can't leave it, so don't advertise a no-op. if app.mode == ViewMode::Tree { - " f: exit zoom | j/k: scroll | pgup/pgdn: page | q: quit" + " f: exit zoom | j/k: scroll | pgup/pgdn: page | w: wrap | q: quit" } else { - " f: exit zoom | v: back to diff | j/k: scroll | pgup/pgdn: page | q: quit" + " f: exit zoom | v: back to diff | j/k: scroll | pgup/pgdn: page | w: wrap | q: quit" } } else if app.diff.view == DiffPaneView::Split { + // No `w: wrap` here or in the unzoomed split arm: the split view + // ignores wrapping (halves folding to different heights would stop + // lining up), and a hint for a no-op key would lie. " f: exit zoom | s: unified diff | j/k: scroll | pgup/pgdn: page | q: quit" } else if app.diff.search.active { " type to search | enter: confirm | esc: cancel" @@ -134,9 +137,9 @@ pub(crate) fn normal_hint_literal(app: &App) -> &'static str { // Tree mode's right pane is permanently the file view — `v` // can't leave it, so don't advertise a no-op. if app.mode == ViewMode::Tree { - " j/k: scroll | pgup/pgdn: page | /: search | shift+←/→: cycle | q: quit" + " j/k: scroll | pgup/pgdn: page | w: wrap | /: search | shift+←/→: cycle | q: quit" } else { - " v: back to diff | j/k: scroll | pgup/pgdn: page | /: search | shift+←/→: cycle | q: quit" + " v: back to diff | j/k: scroll | pgup/pgdn: page | w: wrap | /: search | shift+←/→: cycle | q: quit" } } else if app.diff.view == DiffPaneView::Split { " s: unified diff | j/k: scroll | pgup/pgdn: page | shift+←/→: cycle | f: zoom | q: quit" diff --git a/src/ui/tests/hint_diff_tests.rs b/src/ui/tests/hint_diff_tests.rs index 39cc8557..1b4e3204 100644 --- a/src/ui/tests/hint_diff_tests.rs +++ b/src/ui/tests/hint_diff_tests.rs @@ -77,6 +77,42 @@ fn diff_hint_advertises_view_file_only_with_a_file_target() { ); } +/// `w` is handled for the whole diff focus, so every view it acts in has to +/// advertise it — the file view most of all, since a long unwrapped line is +/// what sends you looking for the key. The split view is the one exception: +/// wrapping is ignored there, and a hint for a no-op key would lie. +#[test] +fn every_view_that_wraps_advertises_the_key() { + let mut app = app_with_fake_backend(); + app.focus = Focus::DiffViewer; + for view in [DiffPaneView::Diff, DiffPaneView::File] { + app.diff.view = view; + for zoomed in [false, true] { + app.diff.fullscreen = zoomed; + let text = hint_text(&app); + assert!( + text.contains("w: wrap"), + "{view:?} legend (zoomed={zoomed}) must offer wrap, got: {text}" + ); + } + } + + // Tree mode's right pane is permanently the file view, and wraps the same. + let mut tree = app_with_fake_backend(); + tree.mode = ViewMode::Tree; + tree.focus = Focus::DiffViewer; + tree.diff.view = DiffPaneView::File; + assert!(hint_text(&tree).contains("w: wrap"), "tree file view wraps"); + + app.diff.view = DiffPaneView::Split; + app.diff.fullscreen = false; + let text = hint_text(&app); + assert!( + !text.contains("w: wrap"), + "the split view ignores wrapping, so it must not offer it, got: {text}" + ); +} + /// Tree mode's right pane is permanently the file view — `v` never /// toggles there, so the file-view legend must not offer `back to diff`. #[test] From 7c8782bfa9861728054b63a55cc3d01ba5164a41 Mon Sep 17 00:00:00 2001 From: whackur Date: Wed, 29 Jul 2026 17:45:31 +0900 Subject: [PATCH 18/19] feat: browse repo-dialog paths with a directory tree MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Typing a path only helps when you know it. `↓` in the repo dialog opens a directory browser rooted at whatever the field names, and `Enter` takes the selection back into the field rather than opening it — the field's own Enter stays the single place a repo is opened, so a picked path can still be extended with Tab or corrected by hand. `↓` rather than a Ctrl chord: every other key in the dialog is bare, the field's horizontal keys already mean "edit this path", and the browser's own cursor moves on the vertical axis. A second Tab, once the candidate list is up, escalates to the same browser — that press used to redraw the same list, and it is exactly the moment the flat list proved too little. State is a flat row list: expanding splices children in after their parent and collapsing drains the deeper rows below it, so the selection is a plain index into what is on screen. Paths keep the user's own notation, with one exception — `←` past a `~` root has no expressible parent, so it falls back to the absolute path, checked against the real parent rather than trusted from text surgery. The dialog replaces the hint legend entirely, so the input line now spells its own keys out; without that neither `↓` nor Tab is findable anywhere on screen. The legend is dropped whole when the path leaves no room, since the caret has to stay visible. Co-Authored-By: Claude Opus 5 (1M context) --- src/application/input/dispatch.rs | 3 +- src/application/input/handlers.rs | 30 --- src/application/input/mod.rs | 1 + src/application/input/repo_dialog.rs | 76 +++++++ src/application/tests/mod.rs | 1 + src/application/tests/repo_dialog.rs | 134 +++++++++++ src/ui/hint_bar.rs | 41 +++- src/ui/mod.rs | 59 +++-- src/ui/path_tree.rs | 58 +++++ src/ui/status_view.rs | 4 + src/ui/tests/chrome_tests.rs | 1 + src/ui/tests/common.rs | 10 +- src/ui/tests/hint_click_tests.rs | 7 +- src/ui/tests/hint_legend_tests.rs | 7 +- src/ui/tests/mod.rs | 1 + src/ui/tests/notice_tests.rs | 1 + src/ui/tests/repo_picker_tests.rs | 105 +++++++++ src/workspace/mod.rs | 3 + src/workspace/path_tree.rs | 278 +++++++++++++++++++++++ src/workspace/path_tree/tests.rs | 203 +++++++++++++++++ src/workspace/repo_input.rs | 5 +- src/workspace/repo_picker.rs | 79 +++++++ src/workspace/tests/mod.rs | 1 + src/workspace/tests/repo_picker_tests.rs | 131 +++++++++++ 24 files changed, 1180 insertions(+), 59 deletions(-) create mode 100644 src/application/input/repo_dialog.rs create mode 100644 src/application/tests/repo_dialog.rs create mode 100644 src/ui/path_tree.rs create mode 100644 src/ui/tests/repo_picker_tests.rs create mode 100644 src/workspace/path_tree.rs create mode 100644 src/workspace/path_tree/tests.rs create mode 100644 src/workspace/repo_picker.rs create mode 100644 src/workspace/tests/repo_picker_tests.rs diff --git a/src/application/input/dispatch.rs b/src/application/input/dispatch.rs index 43cec91e..94b246ee 100644 --- a/src/application/input/dispatch.rs +++ b/src/application/input/dispatch.rs @@ -1,7 +1,8 @@ use crate::app::{App, Focus}; use crate::application::input::handlers::{ - handle_empty_key, handle_repo_input_key, handle_terminal_key, handle_upper_key, + handle_empty_key, handle_terminal_key, handle_upper_key, }; +use crate::application::input::repo_dialog::handle_repo_input_key; use crate::input::{Action, encode_key, map_key, prefix_action, prefix_action_fullscreen}; use crate::workspace::Workspace; use crossterm::event::{KeyCode, KeyEvent, KeyEventKind, KeyModifiers}; diff --git a/src/application/input/handlers.rs b/src/application/input/handlers.rs index 6cc90821..558273cf 100644 --- a/src/application/input/handlers.rs +++ b/src/application/input/handlers.rs @@ -33,36 +33,6 @@ pub(crate) fn handle_empty_key(ws: &mut Workspace, key: KeyEvent) -> KeyOutcome KeyOutcome::Continue } -pub(crate) fn handle_repo_input_key(ws: &mut Workspace, key: KeyEvent) -> KeyOutcome { - match key.code { - KeyCode::Esc => ws.cancel_repo_input(), - KeyCode::Enter => { - if let crate::workspace::RepoInputResult::Open(path) = ws.confirm_repo_input() { - return KeyOutcome::Project(ProjectRequest::Open(path)); - } - } - KeyCode::Backspace => { - if ws.repo_input.buf.is_empty() { - ws.cancel_repo_input(); - } else { - ws.repo_input_pop(); - } - } - // The caret is always at the end of the buffer, so these can't move - // it; they mean "keep this path and let me extend it". - KeyCode::Right | KeyCode::End => ws.repo_input_accept_prefill(), - // `BackTab` is deliberately unhandled: completion here never cycles, so - // there is nothing for a reverse Tab to step back through. - KeyCode::Tab => ws.repo_input_complete(), - _ => { - if let Some(c) = text_input_char(key) { - ws.repo_input_push(c); - } - } - } - KeyOutcome::Continue -} - pub(crate) fn handle_terminal_key(app: &mut App, key: KeyEvent, action: Action) { match action { Action::TermScrollUp => { diff --git a/src/application/input/mod.rs b/src/application/input/mod.rs index 63cf73cc..0721b817 100644 --- a/src/application/input/mod.rs +++ b/src/application/input/mod.rs @@ -4,3 +4,4 @@ pub(crate) mod dispatch; mod handlers; pub(crate) mod mouse; pub(crate) mod paste; +mod repo_dialog; diff --git a/src/application/input/repo_dialog.rs b/src/application/input/repo_dialog.rs new file mode 100644 index 00000000..b6077f88 --- /dev/null +++ b/src/application/input/repo_dialog.rs @@ -0,0 +1,76 @@ +//! Keys for the open-repo dialog: the path field, and the directory browser it +//! can open. The dialog owns every key while it is up, so these are all bare +//! keys — no leader, and no chord to keep clear of the app's own bindings. + +use crate::application::input::dispatch::{KeyOutcome, ProjectRequest, text_input_char}; +use crate::workspace::Workspace; +use crossterm::event::{KeyCode, KeyEvent}; + +pub(crate) fn handle_repo_input_key(ws: &mut Workspace, key: KeyEvent) -> KeyOutcome { + // The browser takes the keys while it is open; the field is still on screen + // below it, but its text cannot change until the browser hands a path back. + if ws.repo_input.picker.is_some() { + handle_picker_key(ws, key); + return KeyOutcome::Continue; + } + match key.code { + KeyCode::Esc => ws.cancel_repo_input(), + KeyCode::Enter => { + if let crate::workspace::RepoInputResult::Open(path) = ws.confirm_repo_input() { + return KeyOutcome::Project(ProjectRequest::Open(path)); + } + } + KeyCode::Backspace => { + if ws.repo_input.buf.is_empty() { + ws.cancel_repo_input(); + } else { + ws.repo_input_pop(); + } + } + // The caret is always at the end of the buffer, so these can't move + // it; they mean "keep this path and let me extend it". + KeyCode::Right | KeyCode::End => ws.repo_input_accept_prefill(), + // Down opens the browser, matching where every autocomplete puts its + // list. Up too: reaching for either vertical key means "the list", + // and neither can mean anything else in a single-line field. + KeyCode::Down | KeyCode::Up => ws.repo_input_browse(), + // `BackTab` is deliberately unhandled: completion here never cycles, so + // there is nothing for a reverse Tab to step back through. + KeyCode::Tab => { + // A Tab that can no longer extend the path has already shown the + // candidate list, so a second one has nothing left to do — that + // dead press is exactly the moment the flat list proved too little, + // so it escalates to the browser instead. + if ws.repo_input.candidates.is_empty() { + ws.repo_input_complete(); + } else { + ws.repo_input_browse(); + } + } + _ => { + if let Some(c) = text_input_char(key) { + ws.repo_input_push(c); + } + } + } + KeyOutcome::Continue +} + +/// `Enter` selects here rather than opening — the browser fills the field, and +/// the field's Enter remains the single place a repo is opened. That splits the +/// meaning of Enter between the two surfaces, which is why `→` alone expands +/// (unlike the in-repo tree view, where Enter expands too). +fn handle_picker_key(ws: &mut Workspace, key: KeyEvent) { + match key.code { + // One Esc leaves the browser, a second cancels the dialog: the field's + // text survives the first, so a browse can be abandoned without + // retyping the path it started from. + KeyCode::Esc => ws.repo_input_close_browser(), + KeyCode::Enter => ws.repo_input_pick(), + KeyCode::Down | KeyCode::Char('j') => ws.repo_picker_move(true), + KeyCode::Up | KeyCode::Char('k') => ws.repo_picker_move(false), + KeyCode::Right => ws.repo_picker_expand(), + KeyCode::Left => ws.repo_picker_collapse(), + _ => {} + } +} diff --git a/src/application/tests/mod.rs b/src/application/tests/mod.rs index 0308837c..28dd549d 100644 --- a/src/application/tests/mod.rs +++ b/src/application/tests/mod.rs @@ -6,6 +6,7 @@ mod mouse_release; mod paste; mod prefix; mod prefix_digits; +mod repo_dialog; mod search; mod swap; mod terminal; diff --git a/src/application/tests/repo_dialog.rs b/src/application/tests/repo_dialog.rs new file mode 100644 index 00000000..5f92f5a0 --- /dev/null +++ b/src/application/tests/repo_dialog.rs @@ -0,0 +1,134 @@ +//! Key routing for the repo dialog's directory browser. Pins which surface owns +//! a key — the browser's own behaviour lives in `workspace::path_tree`, and the +//! field/browser contract in `workspace::tests::repo_picker_tests`. + +use super::helpers::*; +use crate::application::input::dispatch::{KeyOutcome, dispatch_key}; +use crate::workspace::Workspace; +use crossterm::event::{KeyCode, KeyModifiers}; +use tempfile::TempDir; + +/// The dialog open on a real temp directory holding `dirs`, plus its canonical +/// path as the field's text. +fn dialog_on(dirs: &[&str]) -> (TempDir, Workspace, String) { + let root = TempDir::new().expect("a temp dir"); + for d in dirs { + let mut p = root.path().to_path_buf(); + for part in d.split('/') { + p.push(part); + if !p.is_dir() { + std::fs::create_dir(&p).expect("create dir"); + } + } + } + let text = std::fs::canonicalize(root.path()) + .expect("canonical temp path") + .to_str() + .expect("a UTF-8 temp path") + .to_string(); + let mut ws = workspace_on(&["/a"]); + ws.start_repo_input(); + ws.repo_input.buf = text.clone(); + (root, ws, text) +} + +fn send(ws: &mut Workspace, code: KeyCode) { + assert_eq!( + dispatch_key(ws, press(code, KeyModifiers::NONE)), + KeyOutcome::Continue + ); +} + +#[test] +fn down_in_the_field_opens_the_browser() { + let (_guard, mut ws, _) = dialog_on(&["alpha"]); + + send(&mut ws, KeyCode::Down); + + assert!(ws.repo_input.picker.is_some()); +} + +#[test] +fn a_second_tab_escalates_from_the_candidate_list_to_the_browser() { + // The first Tab cannot extend past the shared prefix, so it lists; the + // second would repeat that list, which is the moment the list proved too + // little. + let (_guard, mut ws, _) = dialog_on(&["alpha", "another"]); + ws.repo_input.buf.push('/'); + + send(&mut ws, KeyCode::Tab); + assert!( + !ws.repo_input.candidates.is_empty() && ws.repo_input.picker.is_none(), + "the first Tab lists without leaving the field" + ); + + send(&mut ws, KeyCode::Tab); + assert!(ws.repo_input.picker.is_some(), "the second Tab escalates"); +} + +#[test] +fn tab_still_completes_when_no_list_is_up() { + let (_guard, mut ws, text) = dialog_on(&["alpha"]); + ws.repo_input.buf = format!("{text}/al"); + + send(&mut ws, KeyCode::Tab); + + assert_eq!(ws.repo_input.buf, format!("{text}/alpha/")); + assert!(ws.repo_input.picker.is_none()); +} + +#[test] +fn the_browser_takes_the_keys_the_field_would_have_had() { + let (_guard, mut ws, text) = dialog_on(&["alpha/inner"]); + send(&mut ws, KeyCode::Down); + + // In the field these would edit the buffer; here they drive the tree. + send(&mut ws, KeyCode::Right); + send(&mut ws, KeyCode::Down); + send(&mut ws, KeyCode::Enter); + + assert!(ws.repo_input.picker.is_none(), "Enter selects and returns"); + assert_eq!(ws.repo_input.buf, format!("{text}/alpha/inner/")); + assert!(ws.repo_input.active, "selecting must not open the repo"); +} + +#[test] +fn typing_cannot_change_the_field_while_the_browser_is_up() { + let (_guard, mut ws, text) = dialog_on(&["alpha"]); + send(&mut ws, KeyCode::Down); + + send(&mut ws, KeyCode::Char('x')); + send(&mut ws, KeyCode::Backspace); + + assert_eq!(ws.repo_input.buf, text); +} + +#[test] +fn the_first_esc_leaves_the_browser_and_the_second_cancels_the_dialog() { + let (_guard, mut ws, _) = dialog_on(&["alpha"]); + send(&mut ws, KeyCode::Down); + + send(&mut ws, KeyCode::Esc); + assert!(ws.repo_input.picker.is_none()); + assert!(ws.repo_input.active, "the field survives the first Esc"); + + send(&mut ws, KeyCode::Esc); + assert!(!ws.repo_input.active); +} + +#[test] +fn j_and_k_move_the_browser_without_reaching_the_field() { + let (_guard, mut ws, text) = dialog_on(&["alpha", "zeta"]); + send(&mut ws, KeyCode::Down); + + send(&mut ws, KeyCode::Char('j')); + assert_eq!( + ws.repo_input.picker.as_ref().expect("open").selected(), + 1, + "`j` moves the cursor rather than typing a `j`" + ); + send(&mut ws, KeyCode::Char('k')); + send(&mut ws, KeyCode::Enter); + + assert_eq!(ws.repo_input.buf, format!("{text}/alpha/")); +} diff --git a/src/ui/hint_bar.rs b/src/ui/hint_bar.rs index a700e1f2..e2ee5362 100644 --- a/src/ui/hint_bar.rs +++ b/src/ui/hint_bar.rs @@ -3,6 +3,7 @@ use crate::ui::chrome::{Chrome, chrome_rows}; use crate::ui::hint_text::{ EMPTY_HINT, EMPTY_HINT_ARMED, PREFIX_CHIP, normal_hint_literal, prefix_armed_hint_text, }; +use crate::ui::status_view::RepoInput; use ratatui::{ layout::{Position, Rect}, style::{Color, Modifier, Style}, @@ -83,19 +84,47 @@ pub(crate) fn hint_spans(text: &str, leader: &str, mark_clickable: bool) -> Vec< spans } +/// The dialog's input line, with its keys spelled out after the caret. Nothing +/// else advertises them: the dialog replaces the hint legend entirely, so a key +/// missing from this line cannot be found anywhere on screen. +/// +/// The legend is dropped whole when the path leaves no room for it, rather than +/// clipped — the caret has to stay visible, and half a legend reads as a glitch. +/// `width` is the hint row's; 0 means "unknown", which keeps the legend. +pub(crate) fn repo_input_line<'a>( + repo_input: &'a RepoInput, + accent: Color, + width: u16, +) -> Line<'a> { + const PROMPT: &str = "repo: "; + let legend = if repo_input.picker.is_some() { + " ↓↑/jk: move | →: open | ←: up | enter: select | esc: back" + } else { + " ↓: browse | tab: complete | enter: open | esc: cancel" + }; + let mut spans = vec![ + Span::styled(PROMPT, Style::default().fg(accent)), + Span::raw(repo_input.buf.as_str()), + Span::styled("█", Style::default().fg(accent)), + ]; + // Display columns, not bytes: a path can hold wide or combining characters. + let used: usize = spans.iter().map(Span::width).sum(); + if width == 0 || used + Span::raw(legend).width() <= usize::from(width) { + spans.push(Span::styled(legend, Style::default().fg(Color::DarkGray))); + } + Line::from(spans) +} + pub(crate) fn render_hint_bar<'a>( app: &'a App, chrome: Chrome<'a>, accent: Color, + width: u16, ) -> Paragraph<'a> { if chrome.repo_input.active { // A rejected path is reported on the notice row above, so this row - // stays a plain input line. - return Paragraph::new(Line::from(vec![ - Span::styled("repo: ", Style::default().fg(accent)), - Span::raw(chrome.repo_input.buf.as_str()), - Span::styled("█", Style::default().fg(accent)), - ])); + // stays the input line plus its own legend. + return Paragraph::new(repo_input_line(chrome.repo_input, accent, width)); } if app.prefix_armed() { let mut spans = vec![Span::styled( diff --git a/src/ui/mod.rs b/src/ui/mod.rs index b2afad66..7ad61ead 100644 --- a/src/ui/mod.rs +++ b/src/ui/mod.rs @@ -4,6 +4,7 @@ pub mod diff_viewer; pub mod file_list; pub mod file_view; pub mod log_view; +pub mod path_tree; pub mod project_tab; pub mod search; pub mod splash; @@ -67,14 +68,17 @@ pub fn draw_empty( ); let leader_label = crate::app::leader_label_of(leader); - frame.render_widget( - Paragraph::new(Line::from(vec![Span::styled( - format!(" no project open — {leader_label} o to open a repo"), - Style::default().fg(Color::DarkGray), - )])) - .block(Block::default().borders(Borders::ALL)), - rows.body, - ); + match chrome.repo_input.picker.as_ref() { + Some(tree) => path_tree::render(frame, tree, rows.body, accent), + None => frame.render_widget( + Paragraph::new(Line::from(vec![Span::styled( + format!(" no project open — {leader_label} o to open a repo"), + Style::default().fg(Color::DarkGray), + )])) + .block(Block::default().borders(Borders::ALL)), + rows.body, + ), + } // Shares `render_notice_row`'s priority order so a notice looks the same // wherever it lands; with no project there is no repo header to fall back @@ -87,11 +91,7 @@ pub fn draw_empty( // the leader here has to look like it did something, or it reads as a // dead key. let hint = if chrome.repo_input.active { - Line::from(vec![ - Span::styled("repo: ", Style::default().fg(accent)), - Span::raw(chrome.repo_input.buf.clone()), - Span::styled("█", Style::default().fg(accent)), - ]) + hint_bar::repo_input_line(chrome.repo_input, accent, rows.hint.width) } else if prefix_armed { let mut spans = vec![Span::styled( PREFIX_CHIP, @@ -134,15 +134,34 @@ pub fn draw( notice_area, ); + // The browser owns the body while it is open, ahead of every view-mode and + // fullscreen branch: the dialog already holds all the keys, so whatever + // those branches would draw is inert and would only hide the browse. + if let Some(tree) = tabs.repo_input.picker.as_ref() { + path_tree::render(frame, tree, body_area, accent); + frame.render_widget( + render_hint_bar(app, tabs, accent, hint_area.width), + hint_area, + ); + // No PTY cursor: the pane underneath cannot be typed into from here. + return None; + } + if app.terminal.fullscreen.fills_body() { let cursor = terminal_tab::render(frame, app, body_area, accent); - frame.render_widget(render_hint_bar(app, tabs, accent), hint_area); + frame.render_widget( + render_hint_bar(app, tabs, accent, hint_area.width), + hint_area, + ); return cursor; } if app.diff.fullscreen { diff_viewer::render(frame, app, body_area, ss, ts, accent); - frame.render_widget(render_hint_bar(app, tabs, accent), hint_area); + frame.render_widget( + render_hint_bar(app, tabs, accent, hint_area.width), + hint_area, + ); return None; } @@ -152,7 +171,10 @@ pub fn draw( ViewMode::Log => commit_list::render(frame, app, body_area, accent), ViewMode::Tree => tree_list::render(frame, app, body_area, accent), } - frame.render_widget(render_hint_bar(app, tabs, accent), hint_area); + frame.render_widget( + render_hint_bar(app, tabs, accent, hint_area.width), + hint_area, + ); return None; } @@ -178,6 +200,9 @@ pub fn draw( } diff_viewer::render(frame, app, upper[1], ss, ts, accent); let cursor = terminal_tab::render(frame, app, main[1], accent); - frame.render_widget(render_hint_bar(app, tabs, accent), hint_area); + frame.render_widget( + render_hint_bar(app, tabs, accent, hint_area.width), + hint_area, + ); cursor } diff --git a/src/ui/path_tree.rs b/src/ui/path_tree.rs new file mode 100644 index 00000000..6d480a0a --- /dev/null +++ b/src/ui/path_tree.rs @@ -0,0 +1,58 @@ +//! The repo dialog's directory browser, drawn over the whole body. +//! +//! Not a floating box: nothing in this crate floats — every surface takes a +//! layout area — and mouse capture is on by default, so an overlay would be the +//! first thing needing a hit region of its own. Taking the body avoids both, and +//! the path field stays visible on the hint row underneath. + +use crate::ui::render_selectable_list; +use crate::workspace::PathTree; +use ratatui::{ + Frame, + layout::Rect, + style::{Color, Style}, + text::{Line, Span}, + widgets::ListItem, +}; + +/// Two columns per level: enough to read the nesting without pushing long names +/// off the right edge of a deep tree. +const INDENT: usize = 2; + +pub(crate) fn render(frame: &mut Frame, tree: &PathTree, area: Rect, accent: Color) { + let dim = Style::default().fg(Color::DarkGray); + let (items, selected) = if tree.rows().is_empty() { + // Nothing selectable, but the box must say why it is blank — an empty + // frame reads as a failure to load. Enter still picks the root itself. + ( + vec![ListItem::new(Line::from(Span::styled( + " (no sub-directories)", + dim, + )))], + None, + ) + } else { + let items = tree + .rows() + .iter() + .map(|row| { + let marker = if row.expanded { "▾" } else { "▸" }; + ListItem::new(Line::from(vec![ + Span::raw(" ".repeat(row.depth * INDENT)), + Span::styled(format!("{marker} "), dim), + Span::raw(row.name.clone()), + ])) + }) + .collect(); + (items, Some(tree.selected())) + }; + + render_selectable_list( + frame, + area, + format!(" browse {} ", tree.root_label()), + items, + selected, + Style::default().fg(accent), + ); +} diff --git a/src/ui/status_view.rs b/src/ui/status_view.rs index 2581557b..e80bec6e 100644 --- a/src/ui/status_view.rs +++ b/src/ui/status_view.rs @@ -107,4 +107,8 @@ pub struct RepoInput { /// Any edit clears them: the list describes a fragment that no longer /// matches what is in the buffer. pub candidates: Vec, + /// The directory browser, when open. `Some` takes over the body and the + /// dialog's keys; the field stays on screen below it and keeps the text, so + /// closing the browser returns to exactly what was being typed. + pub picker: Option, } diff --git a/src/ui/tests/chrome_tests.rs b/src/ui/tests/chrome_tests.rs index ce262b6a..a9f85de6 100644 --- a/src/ui/tests/chrome_tests.rs +++ b/src/ui/tests/chrome_tests.rs @@ -43,6 +43,7 @@ fn the_empty_screen_shows_the_dialog_and_its_rejection() { buf: "/definitely/not/here".to_string(), prefilled: false, candidates: Vec::new(), + picker: None, }; let notice = crate::app::Notice::new(NoticeKind::RepoInput, "no such directory"); diff --git a/src/ui/tests/common.rs b/src/ui/tests/common.rs index c2f80170..6467ee5d 100644 --- a/src/ui/tests/common.rs +++ b/src/ui/tests/common.rs @@ -62,7 +62,10 @@ pub(super) fn hint_text_with(app: &App, chrome: Chrome<'_>) -> String { let mut terminal = Terminal::new(TestBackend::new(200, 1)).unwrap(); terminal .draw(|frame| { - frame.render_widget(render_hint_bar(app, chrome, Color::Yellow), frame.area()) + frame.render_widget( + render_hint_bar(app, chrome, Color::Yellow, frame.area().width), + frame.area(), + ) }) .unwrap(); let buf = terminal.backend().buffer(); @@ -82,7 +85,10 @@ pub(super) fn assert_inverted_cells_are_clickable(app: &App) { let mut terminal = Terminal::new(TestBackend::new(200, 1)).unwrap(); terminal .draw(|frame| { - frame.render_widget(render_hint_bar(app, chrome, Color::Yellow), frame.area()) + frame.render_widget( + render_hint_bar(app, chrome, Color::Yellow, frame.area().width), + frame.area(), + ) }) .unwrap(); let buf = terminal.backend().buffer(); diff --git a/src/ui/tests/hint_click_tests.rs b/src/ui/tests/hint_click_tests.rs index b891c37b..2e65c8a4 100644 --- a/src/ui/tests/hint_click_tests.rs +++ b/src/ui/tests/hint_click_tests.rs @@ -88,7 +88,12 @@ fn hint_click_agrees_with_the_rendered_buffer_not_just_the_builder() { terminal .draw(|frame| { frame.render_widget( - render_hint_bar(&app, plain_chrome(&RepoInput::default()), Color::Yellow), + render_hint_bar( + &app, + plain_chrome(&RepoInput::default()), + Color::Yellow, + frame.area().width, + ), frame.area(), ) }) diff --git a/src/ui/tests/hint_legend_tests.rs b/src/ui/tests/hint_legend_tests.rs index 84002025..b62d633f 100644 --- a/src/ui/tests/hint_legend_tests.rs +++ b/src/ui/tests/hint_legend_tests.rs @@ -57,7 +57,12 @@ fn hint_bar_inverts_nothing_when_mouse_capture_is_disabled() { terminal .draw(|frame| { frame.render_widget( - render_hint_bar(&app, plain_chrome(&RepoInput::default()), Color::Yellow), + render_hint_bar( + &app, + plain_chrome(&RepoInput::default()), + Color::Yellow, + frame.area().width, + ), frame.area(), ) }) diff --git a/src/ui/tests/mod.rs b/src/ui/tests/mod.rs index a965700d..b7b53fc2 100644 --- a/src/ui/tests/mod.rs +++ b/src/ui/tests/mod.rs @@ -6,3 +6,4 @@ mod hint_diff_tests; mod hint_legend_tests; mod hit_test_tests; mod notice_tests; +mod repo_picker_tests; diff --git a/src/ui/tests/notice_tests.rs b/src/ui/tests/notice_tests.rs index bd021362..566ac59c 100644 --- a/src/ui/tests/notice_tests.rs +++ b/src/ui/tests/notice_tests.rs @@ -70,6 +70,7 @@ fn dialog_offering(candidates: &[&str]) -> crate::ui::status_view::RepoInput { buf: "/repos/".to_string(), prefilled: false, candidates: candidates.iter().map(|c| c.to_string()).collect(), + picker: None, } } diff --git a/src/ui/tests/repo_picker_tests.rs b/src/ui/tests/repo_picker_tests.rs new file mode 100644 index 00000000..2c74ceea --- /dev/null +++ b/src/ui/tests/repo_picker_tests.rs @@ -0,0 +1,105 @@ +use super::common::*; +use crate::ui::hint_bar::repo_input_line; +use crate::ui::status_view::RepoInput; +use crate::workspace::PathTree; +use ratatui::style::Color; +use tempfile::TempDir; + +/// The dialog's state with the browser open on a temp directory holding `dirs`. +fn browsing(dirs: &[&str]) -> (TempDir, RepoInput) { + let root = TempDir::new().expect("a temp dir"); + for d in dirs { + std::fs::create_dir(root.path().join(d)).expect("create dir"); + } + let buf = std::fs::canonicalize(root.path()) + .expect("canonical temp path") + .to_str() + .expect("a UTF-8 temp path") + .to_string(); + let picker = PathTree::open(&buf).expect("a readable root"); + ( + root, + RepoInput { + active: true, + buf, + prefilled: false, + candidates: Vec::new(), + picker: Some(picker), + }, + ) +} + +fn field_only() -> RepoInput { + RepoInput { + active: true, + buf: "/repos/current".to_string(), + prefilled: true, + candidates: Vec::new(), + picker: None, + } +} + +#[test] +fn the_browser_fills_the_body_with_the_directories_it_read() { + let (_guard, repo_input) = browsing(&["alpha", "zeta"]); + + let screen = drawn_empty(&repo_input, None, false); + + assert!( + screen.contains("browse"), + "the box names where it is:\n{screen}" + ); + assert!( + screen.contains("alpha") && screen.contains("zeta"), + "{screen}" + ); +} + +#[test] +fn an_empty_directory_says_so_rather_than_drawing_a_blank_box() { + let (_guard, repo_input) = browsing(&[]); + + let screen = drawn_empty(&repo_input, None, false); + + assert!(screen.contains("no sub-directories"), "{screen}"); +} + +#[test] +fn the_dialog_advertises_its_keys_on_the_input_row() { + // Nothing else can: the dialog replaces the hint legend entirely, so an + // unadvertised key is unfindable. + let field = field_only(); + let line = repo_input_line(&field, Color::Yellow, 90).to_string(); + + assert!(line.contains("/repos/current"), "the path itself: {line}"); + assert!( + line.contains("↓: browse"), + "the way into the browser: {line}" + ); + assert!(line.contains("tab: complete"), "{line}"); +} + +#[test] +fn the_browsers_own_keys_replace_the_fields_on_the_input_row() { + let (_guard, repo_input) = browsing(&["alpha"]); + + let line = repo_input_line(&repo_input, Color::Yellow, 200).to_string(); + + assert!(line.contains("enter: select"), "not `enter: open`: {line}"); + assert!(line.contains("←: up"), "{line}"); + assert!(!line.contains("↓: browse"), "already browsing: {line}"); +} + +#[test] +fn a_path_too_long_for_the_legend_drops_it_whole_and_keeps_the_caret() { + let mut field = field_only(); + field.buf = "/a".repeat(30); + + let line = repo_input_line(&field, Color::Yellow, 40).to_string(); + + assert!( + !line.contains("browse"), + "a half legend reads as a glitch: {line}" + ); + assert!(line.ends_with('█'), "the caret has to survive: {line}"); +} diff --git a/src/workspace/mod.rs b/src/workspace/mod.rs index cde7ea55..69cdef6e 100644 --- a/src/workspace/mod.rs +++ b/src/workspace/mod.rs @@ -6,8 +6,11 @@ //! screen; snapshots apply to the active one only. mod path_complete; +mod path_tree; mod repo_input; +mod repo_picker; +pub use path_tree::PathTree; pub use repo_input::RepoInputResult; pub(crate) mod persistence; diff --git a/src/workspace/path_tree.rs b/src/workspace/path_tree.rs new file mode 100644 index 00000000..2d27bda9 --- /dev/null +++ b/src/workspace/path_tree.rs @@ -0,0 +1,278 @@ +//! Directory browser for the repo dialog's path field. +//! +//! A flat row list, not a nested tree: expanding splices a directory's children +//! in after it and collapsing removes the rows below it, so the selection is a +//! plain index into what is on screen and no flatten pass runs per frame. +//! +//! Directories only, and nothing here writes: the browser fills the field, and +//! the field's own Enter stays the single place a repo is actually opened. It +//! deliberately does not reuse `git::tree`, which requires a `git2::Repository` +//! and refuses paths outside a worktree — the browser has to walk directories +//! belonging to no repo, with possibly no project open at all. + +use super::path_complete::{is_sep, read_dir_names, split_dir}; +use crate::platform::paths::expand_tilde; +use std::path::{MAIN_SEPARATOR, Path, PathBuf}; + +/// One visible row: a directory name `depth` levels below the root. +#[derive(Debug, Clone, PartialEq, Eq)] +pub struct PathRow { + pub name: String, + pub depth: usize, + /// Whether this row's children are spliced in below it. Set even when the + /// directory turned out to have none, so the marker shows it was read + /// rather than leaving the user pressing `→` at an unchanging row. + pub expanded: bool, +} + +#[derive(Debug, Clone)] +pub struct PathTree { + /// The root exactly as the user typed it (`~/coding`, `..`, or `""` for the + /// cwd). Kept beside `root` so a picked path is assembled from the user's + /// own notation — the dialog never rewrites their `~` into an absolute path. + root_text: String, + /// The canonicalized root. Canonical because stepping the root up walks + /// `parent()`, which yields nothing useful for a relative path like `.`. + root: PathBuf, + /// Separator to assemble picked paths with: whatever the field already uses, + /// so a path typed with `/` on Windows doesn't come back with a `\` in it. + sep: char, + rows: Vec, + selected: usize, +} + +impl PathTree { + /// Open the browser on the directory the field currently names. `None` when + /// that cannot be read, which the caller reports on the notice row — with no + /// rows and no root there is nothing to draw. + pub(crate) fn open(buf: &str) -> Option { + let trimmed = buf.trim(); + let sep = trimmed + .chars() + .rev() + .find(|c| is_sep(*c)) + .unwrap_or(MAIN_SEPARATOR); + // Browse from the directory the field names; when it names a file or a + // half-typed component, fall back to the text up to the last separator — + // the same reading Tab completion gives it. + let text = if !trimmed.is_empty() && expand_tilde(trimmed).is_dir() { + trimmed + } else { + split_dir(trimmed).0 + }; + let root = + std::fs::canonicalize(expand_tilde(if text.is_empty() { "." } else { text })).ok()?; + if !root.is_dir() { + return None; + } + let rows = list_rows(&root, 0); + Some(Self { + root_text: text.to_string(), + root, + sep, + rows, + selected: 0, + }) + } + + /// The root as the user's own text, for the browser's title. `""` means the + /// cwd, which reads as `.` on screen. + pub fn root_label(&self) -> &str { + if self.root_text.is_empty() { + "." + } else { + &self.root_text + } + } + + pub fn rows(&self) -> &[PathRow] { + &self.rows + } + + pub fn selected(&self) -> usize { + self.selected + } + + /// Clamped rather than wrapping: the list is a path being narrowed down, and + /// wrapping from the last row back to the first loses the user's place. + pub(crate) fn move_selection(&mut self, down: bool) { + if self.rows.is_empty() { + return; + } + self.selected = if down { + (self.selected + 1).min(self.rows.len() - 1) + } else { + self.selected.saturating_sub(1) + }; + } + + /// Read the selected directory's children and splice them in below it. One + /// `read_dir` per press, against that directory only — an unexpanded subtree + /// is never walked. + pub(crate) fn expand(&mut self) { + let Some(row) = self.rows.get(self.selected) else { + return; + }; + if row.expanded { + return; + } + let depth = row.depth; + let children = list_rows(&self.abs_of(self.selected), depth + 1); + self.rows[self.selected].expanded = true; + let at = self.selected + 1; + self.rows.splice(at..at, children); + } + + /// Collapse the selected directory, or — when it is already collapsed — step + /// out of it: to its parent row, or past the root itself at depth 0. + pub(crate) fn collapse_or_up(&mut self) { + let Some(row) = self.rows.get(self.selected) else { + // Nothing to collapse in an empty directory, so `←` still means + // "get me out of here". + self.re_root(); + return; + }; + let depth = row.depth; + if row.expanded { + self.rows[self.selected].expanded = false; + let from = self.selected + 1; + let end = self.rows[from..] + .iter() + .position(|r| r.depth <= depth) + .map_or(self.rows.len(), |n| from + n); + self.rows.drain(from..end); + return; + } + if depth > 0 { + if let Some(i) = self.rows[..self.selected] + .iter() + .rposition(|r| r.depth == depth - 1) + { + self.selected = i; + } + return; + } + self.re_root(); + } + + /// The picked path in the user's own notation, with a trailing separator so + /// Tab can carry on descending from it once the field has it back. + pub(crate) fn selected_path(&self) -> String { + let mut out = self.root_text.clone(); + if !self.rows.is_empty() { + for name in self.components_of(self.selected) { + if !out.is_empty() && !out.ends_with(is_sep) { + out.push(self.sep); + } + out.push_str(name); + } + } + // An empty root text is the cwd; a bare separator would read as the + // filesystem root instead. + if out.is_empty() { + out.push('.'); + } + if !out.ends_with(is_sep) { + out.push(self.sep); + } + out + } + + /// Step the root up one level, so a browse that started deep in one checkout + /// can still reach a sibling. Expansion below is dropped — the rows are + /// rebuilt from the new root — and the directory just left is selected, so + /// the key reads as "step out" rather than "jump somewhere". + fn re_root(&mut self) { + let Some(parent) = self.root.parent().map(Path::to_path_buf) else { + return; + }; + let left = self + .root + .file_name() + .and_then(|n| n.to_str()) + .map(str::to_string); + // Verify the user-notation parent against the real one instead of + // trusting the text surgery: `~` has no expressible parent, and neither + // does a bare Windows drive. Falling back to the absolute path is the + // one place the dialog rewrites the user's text, because their notation + // cannot name where they just asked to go. + self.root_text = parent_text(&self.root_text, self.sep) + .filter(|t| canonicalizes_to(t, &parent)) + .unwrap_or_else(|| parent.to_string_lossy().to_string()); + self.root = parent; + self.rows = list_rows(&self.root, 0); + self.selected = left + .and_then(|name| self.rows.iter().position(|r| r.name == name)) + .unwrap_or(0); + } + + /// The selected row's path components, walking back up the flat list: the + /// nearest preceding row one level shallower is its parent. + fn components_of(&self, idx: usize) -> Vec<&str> { + let mut want = self.rows[idx].depth; + let mut out = Vec::with_capacity(want + 1); + for row in self.rows[..=idx].iter().rev() { + if row.depth == want { + out.push(row.name.as_str()); + if want == 0 { + break; + } + want -= 1; + } + } + out.reverse(); + out + } + + fn abs_of(&self, idx: usize) -> PathBuf { + self.components_of(idx) + .iter() + .fold(self.root.clone(), |p, c| p.join(c)) + } +} + +/// Hidden directories are left out, matching the completer's default: a home +/// directory full of dot-directories would bury the checkouts being looked for. +fn list_rows(dir: &Path, depth: usize) -> Vec { + read_dir_names(dir, false) + .into_iter() + .map(|name| PathRow { + name, + depth, + expanded: false, + }) + .collect() +} + +/// The user's root text one level up, or `None` when their notation cannot +/// express it. Purely textual — the caller checks it against the real parent. +fn parent_text(text: &str, sep: char) -> Option { + let t = text.trim_end_matches(is_sep); + if t.is_empty() { + // `""` is the cwd, whose parent is `..`. All-separators is the + // filesystem root, which has no parent for `re_root` to reach. + return text.is_empty().then(|| "..".to_string()); + } + if t == "." { + return Some("..".to_string()); + } + // `..` can only go further up by appending another one; trimming a + // component off it would walk back down. + if split_dir(t).1 == ".." { + return Some(format!("{t}{sep}..")); + } + match t.char_indices().rfind(|(_, c)| is_sep(*c)) { + // A separator at index 0 is the filesystem root itself, which stays. + Some((0, c)) => Some(c.to_string()), + Some((i, _)) => Some(t[..i].to_string()), + // A lone relative component (`nightcrow`) sits in the cwd. + None => Some(".".to_string()), + } +} + +fn canonicalizes_to(text: &str, expected: &Path) -> bool { + std::fs::canonicalize(expand_tilde(text)).is_ok_and(|p| p == expected) +} + +#[cfg(test)] +mod tests; diff --git a/src/workspace/path_tree/tests.rs b/src/workspace/path_tree/tests.rs new file mode 100644 index 00000000..4dde6c30 --- /dev/null +++ b/src/workspace/path_tree/tests.rs @@ -0,0 +1,203 @@ +use super::*; +use tempfile::TempDir; + +/// A temp directory with `dirs` created inside it (slash-separated paths are +/// created level by level), plus its canonical path — macOS hands out temp paths +/// under a symlinked `/var`, and the browser reports canonical roots. +fn tree(dirs: &[&str]) -> (TempDir, PathBuf) { + let root = TempDir::new().expect("a temp dir"); + for d in dirs { + let mut p = root.path().to_path_buf(); + for part in d.split('/') { + p.push(part); + if !p.is_dir() { + std::fs::create_dir(&p).expect("create dir"); + } + } + } + let canonical = std::fs::canonicalize(root.path()).expect("canonical temp path"); + (root, canonical) +} + +fn text(path: &Path) -> String { + path.to_str().expect("a UTF-8 temp path").to_string() +} + +fn names(tree: &PathTree) -> Vec<(usize, &str)> { + tree.rows() + .iter() + .map(|r| (r.depth, r.name.as_str())) + .collect() +} + +#[test] +fn opening_on_a_directory_lists_its_sub_directories_sorted() { + let (_guard, root) = tree(&["zeta", "alpha", ".hidden"]); + + let picker = PathTree::open(&text(&root)).expect("a readable root"); + + assert_eq!( + names(&picker), + vec![(0, "alpha"), (0, "zeta")], + "sorted, directories only, hidden left out" + ); +} + +#[test] +fn opening_on_a_half_typed_name_falls_back_to_its_directory() { + let (_guard, root) = tree(&["alpha"]); + + let picker = PathTree::open(&format!("{}/alp", text(&root))).expect("a readable root"); + + assert_eq!(picker.root_label(), format!("{}/", text(&root))); + assert_eq!(names(&picker), vec![(0, "alpha")]); +} + +#[test] +fn opening_on_an_unreadable_path_yields_nothing_to_draw() { + let (_guard, root) = tree(&[]); + + assert!(PathTree::open(&format!("{}/missing/deeper", text(&root))).is_none()); +} + +#[test] +fn expanding_splices_children_below_their_parent() { + let (_guard, root) = tree(&["alpha/inner", "zeta"]); + let mut picker = PathTree::open(&text(&root)).expect("a readable root"); + + picker.expand(); + + assert_eq!( + names(&picker), + vec![(0, "alpha"), (1, "inner"), (0, "zeta")] + ); + assert!(picker.rows()[0].expanded); +} + +#[test] +fn collapsing_removes_the_whole_subtree_below_the_row() { + let (_guard, root) = tree(&["alpha/inner/deepest", "zeta"]); + let mut picker = PathTree::open(&text(&root)).expect("a readable root"); + picker.expand(); + picker.move_selection(true); + picker.expand(); + assert_eq!(picker.rows().len(), 4, "alpha, inner, deepest, zeta"); + + picker.move_selection(false); + picker.collapse_or_up(); + + assert_eq!(names(&picker), vec![(0, "alpha"), (0, "zeta")]); + assert!(!picker.rows()[0].expanded); +} + +#[test] +fn left_on_a_collapsed_child_steps_to_its_parent_row() { + let (_guard, root) = tree(&["alpha/inner"]); + let mut picker = PathTree::open(&text(&root)).expect("a readable root"); + picker.expand(); + picker.move_selection(true); + assert_eq!(picker.selected(), 1); + + picker.collapse_or_up(); + + assert_eq!(picker.selected(), 0, "the nearest shallower row above it"); +} + +#[test] +fn left_at_the_root_re_roots_to_the_parent_and_selects_where_it_came_from() { + let (_guard, root) = tree(&["alpha"]); + let inner = root.join("alpha"); + let mut picker = PathTree::open(&text(&inner)).expect("a readable root"); + + picker.collapse_or_up(); + + assert_eq!(picker.root_label(), text(&root)); + assert_eq!( + picker.rows()[picker.selected()].name, + "alpha", + "the directory just stepped out of stays selected" + ); +} + +#[test] +fn re_rooting_keeps_the_users_own_notation() { + let (_guard, root) = tree(&["alpha/inner"]); + // A trailing separator and a `..` hop: both have to survive the step up as + // text rather than being canonicalized into an absolute path. + let typed = format!("{}/alpha/../alpha/inner/", text(&root)); + let mut picker = PathTree::open(&typed).expect("a readable root"); + + picker.collapse_or_up(); + + assert_eq!( + picker.root_label(), + format!("{}/alpha/../alpha", text(&root)) + ); +} + +#[test] +fn picking_a_row_returns_the_typed_root_plus_a_trailing_separator() { + let (_guard, root) = tree(&["alpha/inner"]); + let mut picker = PathTree::open(&format!("{}/", text(&root))).expect("a readable root"); + picker.expand(); + picker.move_selection(true); + + assert_eq!( + picker.selected_path(), + format!("{}/alpha/inner/", text(&root)), + "the separator lets Tab carry on descending in the field" + ); +} + +#[test] +fn picking_in_an_empty_directory_yields_the_root_itself() { + let (_guard, root) = tree(&[]); + let picker = PathTree::open(&text(&root)).expect("a readable root"); + + assert!(picker.rows().is_empty()); + assert_eq!(picker.selected_path(), format!("{}/", text(&root))); +} + +#[test] +fn moving_the_selection_clamps_at_both_ends() { + let (_guard, root) = tree(&["alpha", "zeta"]); + let mut picker = PathTree::open(&text(&root)).expect("a readable root"); + + picker.move_selection(false); + assert_eq!(picker.selected(), 0); + picker.move_selection(true); + picker.move_selection(true); + assert_eq!( + picker.selected(), + 1, + "clamped, not wrapped to the first row" + ); +} + +#[test] +fn a_home_relative_root_falls_back_to_an_absolute_parent() { + // `~` has no expressible parent, so the one rewrite the dialog allows. + let Some(home) = std::fs::canonicalize(expand_tilde("~")).ok() else { + return; + }; + let Some(parent) = home.parent().map(Path::to_path_buf) else { + return; + }; + let mut picker = PathTree::open("~").expect("a readable home"); + assert_eq!(picker.root_label(), "~"); + + picker.collapse_or_up(); + + assert_eq!(picker.root_label(), parent.to_string_lossy()); +} + +#[test] +fn parent_text_walks_up_without_reading_the_filesystem() { + assert_eq!(parent_text("", '/').as_deref(), Some("..")); + assert_eq!(parent_text(".", '/').as_deref(), Some("..")); + assert_eq!(parent_text("..", '/').as_deref(), Some("../..")); + assert_eq!(parent_text("nightcrow", '/').as_deref(), Some(".")); + assert_eq!(parent_text("~/coding/", '/').as_deref(), Some("~")); + assert_eq!(parent_text("/Users", '/').as_deref(), Some("/")); + assert_eq!(parent_text("/", '/'), None, "the root has no parent"); +} diff --git a/src/workspace/repo_input.rs b/src/workspace/repo_input.rs index 3113c227..d6167c8e 100644 --- a/src/workspace/repo_input.rs +++ b/src/workspace/repo_input.rs @@ -17,7 +17,7 @@ pub enum RepoInputResult { // Mirrors `PROMPT_BUFFER_MAX_BYTES` so a bracketed paste cannot grow this // buffer without bound; comfortably above any realistic filesystem path. -const REPO_INPUT_MAX_BYTES: usize = 4096; +pub(super) const REPO_INPUT_MAX_BYTES: usize = 4096; impl Workspace { /// Open the dialog that adds a project tab. Prefilled with the active @@ -32,6 +32,7 @@ impl Workspace { self.repo_input.active = true; self.repo_input.prefilled = true; self.repo_input.candidates.clear(); + self.repo_input.picker = None; self.clear_notice(NoticeKind::RepoInput); } @@ -40,6 +41,7 @@ impl Workspace { self.repo_input.buf.clear(); self.repo_input.prefilled = false; self.repo_input.candidates.clear(); + self.repo_input.picker = None; self.clear_notice(NoticeKind::RepoInput); } @@ -75,6 +77,7 @@ impl Workspace { self.repo_input.buf.clear(); self.repo_input.prefilled = false; self.repo_input.candidates.clear(); + self.repo_input.picker = None; self.clear_notice(NoticeKind::RepoInput); RepoInputResult::Open(resolved) } diff --git a/src/workspace/repo_picker.rs b/src/workspace/repo_picker.rs new file mode 100644 index 00000000..bd6d0972 --- /dev/null +++ b/src/workspace/repo_picker.rs @@ -0,0 +1,79 @@ +//! The repo dialog's directory browser, opened from the path field. +//! +//! The browser only ever fills the field; opening a repo stays the field's own +//! Enter, so there is one place that decides what gets opened no matter how the +//! path was arrived at. + +use super::Workspace; +use super::path_tree::PathTree; +use super::repo_input::REPO_INPUT_MAX_BYTES; +use crate::app::NoticeKind; + +impl Workspace { + /// Open the browser on whatever directory the field currently names. Bound + /// to `↓`: the field's horizontal keys already mean "edit this path", so the + /// vertical axis is free for the list, which is also where every other + /// autocomplete puts it. + pub fn repo_input_browse(&mut self) { + // Browsing is an edit intent: the browser writes a whole path into the + // buffer, so an untouched prefill has to stop being replaceable or the + // first key typed after returning would wipe what was just picked. + self.repo_input.prefilled = false; + // The candidate row and the browser answer the same question; leaving + // the list up would describe a fragment the browser is replacing. + self.repo_input.candidates.clear(); + match PathTree::open(&self.repo_input.buf) { + Some(tree) => { + self.clear_notice(NoticeKind::RepoInput); + self.repo_input.picker = Some(tree); + } + // The path is on screen in the field itself, so name the problem + // only — and stay in the field, where it can be corrected. + None => self.raise_notice(NoticeKind::RepoInput, "cannot browse that directory"), + } + } + + /// Close the browser and return to the field with the text untouched. + pub fn repo_input_close_browser(&mut self) { + self.repo_input.picker = None; + } + + /// Take the browser's selection into the field and return to it, so the path + /// can still be extended with Tab or corrected by hand before opening. + pub fn repo_input_pick(&mut self) { + let Some(tree) = self.repo_input.picker.take() else { + return; + }; + let picked = tree.selected_path(); + if picked.len() > REPO_INPUT_MAX_BYTES { + // Refuse whole rather than truncate: a cut path silently points + // somewhere else. Says what it means, since nothing is on screen + // to explain the field not changing. + self.raise_notice(NoticeKind::RepoInput, "path too long"); + return; + } + self.clear_notice(NoticeKind::RepoInput); + self.repo_input.buf = picked; + self.repo_input.candidates.clear(); + } + + /// Move the browser's cursor. Inert with the browser closed, so the caller + /// need not re-check which surface has the keys. + pub fn repo_picker_move(&mut self, down: bool) { + if let Some(tree) = self.repo_input.picker.as_mut() { + tree.move_selection(down); + } + } + + pub fn repo_picker_expand(&mut self) { + if let Some(tree) = self.repo_input.picker.as_mut() { + tree.expand(); + } + } + + pub fn repo_picker_collapse(&mut self) { + if let Some(tree) = self.repo_input.picker.as_mut() { + tree.collapse_or_up(); + } + } +} diff --git a/src/workspace/tests/mod.rs b/src/workspace/tests/mod.rs index 5cd1456c..44bcfdda 100644 --- a/src/workspace/tests/mod.rs +++ b/src/workspace/tests/mod.rs @@ -2,4 +2,5 @@ use super::*; mod common; mod repo_input_tests; +mod repo_picker_tests; mod workspace_tests; diff --git a/src/workspace/tests/repo_picker_tests.rs b/src/workspace/tests/repo_picker_tests.rs new file mode 100644 index 00000000..b1f439bc --- /dev/null +++ b/src/workspace/tests/repo_picker_tests.rs @@ -0,0 +1,131 @@ +//! The contract between the path field and the directory browser: which one +//! holds the state, and what crossing between them does to the buffer. + +use super::common::*; +use crate::app::NoticeKind; +use tempfile::TempDir; + +/// A workspace whose dialog is open on a real temp directory, since the browser +/// reads the filesystem. +fn dialog_on(dirs: &[&str]) -> (TempDir, crate::workspace::Workspace) { + let root = TempDir::new().expect("a temp dir"); + for d in dirs { + std::fs::create_dir(root.path().join(d)).expect("create dir"); + } + let canonical = std::fs::canonicalize(root.path()).expect("canonical temp path"); + let mut ws = workspace_on(&[canonical.to_str().expect("a UTF-8 temp path")]); + ws.start_repo_input(); + (root, ws) +} + +#[test] +fn browsing_opens_on_the_prefilled_path() { + let (_guard, mut ws) = dialog_on(&["alpha"]); + + ws.repo_input_browse(); + + let picker = ws.repo_input.picker.as_ref().expect("the browser is open"); + assert_eq!(picker.rows().len(), 1); + assert_eq!(picker.rows()[0].name, "alpha"); +} + +#[test] +fn browsing_leaves_prefill_mode_so_the_picked_path_survives_typing() { + let (_guard, mut ws) = dialog_on(&["alpha"]); + + ws.repo_input_browse(); + ws.repo_input_pick(); + ws.repo_input_push('x'); + + assert!( + ws.repo_input.buf.ends_with("alpha/x"), + "typing must extend the picked path, not replace it: {}", + ws.repo_input.buf + ); +} + +#[test] +fn picking_a_row_closes_the_browser_and_fills_the_field() { + let (_guard, mut ws) = dialog_on(&["alpha"]); + let before = ws.repo_input.buf.clone(); + + ws.repo_input_browse(); + ws.repo_input_pick(); + + assert!(ws.repo_input.picker.is_none(), "back to the field"); + assert_eq!(ws.repo_input.buf, format!("{before}/alpha/")); +} + +#[test] +fn closing_the_browser_keeps_the_text_it_started_from() { + let (_guard, mut ws) = dialog_on(&["alpha"]); + let before = ws.repo_input.buf.clone(); + + ws.repo_input_browse(); + ws.repo_picker_move(true); + ws.repo_input_close_browser(); + + assert!(ws.repo_input.picker.is_none()); + assert_eq!( + ws.repo_input.buf, before, + "an abandoned browse must not have to be retyped" + ); + assert!(ws.repo_input.active, "the dialog itself stays open"); +} + +#[test] +fn browsing_an_unreadable_path_reports_it_and_stays_in_the_field() { + let (_guard, mut ws) = dialog_on(&[]); + for c in "/missing/deeper".chars() { + ws.repo_input_push(c); + } + + ws.repo_input_browse(); + + assert!(ws.repo_input.picker.is_none()); + assert_eq!( + ws.active().and_then(|p| p.notice.as_ref()).map(|n| n.kind), + Some(NoticeKind::RepoInput), + "the refusal has to be visible somewhere" + ); +} + +#[test] +fn browsing_drops_the_candidate_list_it_replaces() { + let (_guard, mut ws) = dialog_on(&["alpha", "another"]); + ws.repo_input_push('/'); + ws.repo_input_complete(); + assert!(!ws.repo_input.candidates.is_empty(), "two names to offer"); + + ws.repo_input_browse(); + + assert!( + ws.repo_input.candidates.is_empty(), + "the browser answers the same question the list did" + ); +} + +#[test] +fn cancelling_the_dialog_takes_the_browser_with_it() { + let (_guard, mut ws) = dialog_on(&["alpha"]); + ws.repo_input_browse(); + + ws.cancel_repo_input(); + + assert!(ws.repo_input.picker.is_none()); + assert!(!ws.repo_input.active); +} + +#[test] +fn navigation_is_inert_with_the_browser_closed() { + let (_guard, mut ws) = dialog_on(&["alpha"]); + let before = ws.repo_input.buf.clone(); + + ws.repo_picker_move(true); + ws.repo_picker_expand(); + ws.repo_picker_collapse(); + ws.repo_input_pick(); + + assert_eq!(ws.repo_input.buf, before); + assert!(ws.repo_input.picker.is_none()); +} From 5c12f5dc1293c07ba0fa6a601e6c13a5e85cdbb7 Mon Sep 17 00:00:00 2001 From: whackur Date: Wed, 29 Jul 2026 17:45:36 +0900 Subject: [PATCH 19/19] docs: record the repo dialog's directory browser MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Marks the picker plan implemented and keeps the three places the implementation diverged from it: the entry key (`↓`, not `Ctrl+T`), the hint legend the plan never accounted for, and the flat row list in place of a `BTreeSet` plus children cache. Co-Authored-By: Claude Opus 5 (1M context) --- README.md | 14 +++++++++++++- docs/architecture.md | 41 +++++++++++++++++++++++++++++++++++++++- docs/repo-picker-plan.md | 28 ++++++++++++++++++++------- 3 files changed, 74 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 7d4c78e3..13b89eb5 100644 --- a/README.md +++ b/README.md @@ -127,6 +127,18 @@ The diff for a selected file shows the combined working-tree-with-index changes. **Path completion in the repo dialog** — `Tab` completes the directory you're typing, so you don't have to know the path by heart. One press extends as far as the names allow; when there's nothing left to extend it lists what's there instead. On a trailing `/` the first press shows that directory's contents, and a unique match gains a trailing `/` so you can keep pressing `Tab` to descend. Only directories are offered (a file can't be a repo), dotted directories stay hidden until you type a leading `.`, and a name that differs only in case is matched and corrected for you. The dialog is a path field, not a shell — `~`, `..` and paths relative to your working directory all work, but `cd`, `$VAR`, and globs don't, and `Enter` always means "open this path". +**Browsing for a repo** — when you don't know the path, press `↓` in the repo dialog to browse instead of typing. (A second `Tab`, once the candidate list is up, opens the same browser: at that point the flat list has told you all it can.) The browser fills the body of the screen, rooted at whatever directory the field currently names, and the field stays visible below it with the keys spelled out. + +| Key | Action | +|-----|--------| +| `↓` / `j`, `↑` / `k` | Move the cursor | +| `→` | Expand the selected directory (read lazily, one level at a time) | +| `←` | Collapse it, or step out — to the parent row, or one level *above the root* when you're already at the top, so a sibling checkout is one press away | +| `Enter` | Take the selected path into the field and return to it — this does **not** open the repo. Press `Enter` again in the field for that, or keep refining the path with `Tab` first | +| `Esc` | Leave the browser, keeping the text it started from. A second `Esc` cancels the dialog | + +Directories only, hidden ones excluded, and nothing is ever written. Note that `Enter` means *select* here but *open* in the field — the browser's job is to fill the field, so `→` alone expands (unlike the file-tree view, where `Enter` expands too). Paths keep your own notation: browsing out of `~/coding` gives you back `~/coding/…`, not an absolute path. Mouse selection isn't supported; the browser is keyboard-only. + ## Keyboard shortcuts nightcrow uses a tmux-style **leader (prefix)** key for its app commands. The @@ -164,7 +176,7 @@ visible from the terminal pane. | ` l` | Toggle between status view and commit log view | | ` b` | Toggle the read-only file-tree view (returns to status view) | | ` f` | Fullscreen the focused pane. For the terminal it cycles `off → grid (all panes) → zoom (active pane only) → off`; with a single pane it toggles straight off/on. File list and diff viewer toggle off/on | -| ` o` | Open a repo in a **project tab** (prefilled with the active project's path — type to replace it, or press `→`/`End` first to extend it). `Tab` completes the path against your filesystem (see below). A leading `~` expands to your home directory. If another tab already has that repo open, nightcrow focuses that tab instead of running two copies against one worktree | +| ` o` | Open a repo in a **project tab** (prefilled with the active project's path — type to replace it, or press `→`/`End` first to extend it). `Tab` completes the path against your filesystem and `↓` opens a directory browser (see below). A leading `~` expands to your home directory. If another tab already has that repo open, nightcrow focuses that tab instead of running two copies against one worktree | | ` x` | Close the active project tab. Closing the last one leaves nightcrow with no project open, which is a normal state | | ` p` | Cycle accent color (yellow → cyan → green → magenta → blue) | | ` r` | Force a full redraw (clears stray glyphs left by terminal programs) | diff --git a/docs/architecture.md b/docs/architecture.md index 36deac6b..8b2e77e7 100644 --- a/docs/architecture.md +++ b/docs/architecture.md @@ -104,8 +104,10 @@ src/ │ │ # process-level repo dialog/notice │ ├── repo_input.rs # o repo-input modal state │ ├── path_complete.rs # Tab 경로 완성 (read_dir 한 단계, 디렉터리만) +│ ├── path_tree.rs # ↓ 디렉터리 브라우저 상태 (평면 row 리스트) +│ ├── repo_picker.rs # 필드 ↔ 브라우저 전환 │ ├── persistence.rs # workspace + per-repo state (~/.nightcrow/workspace.json) -│ └── tests/ # workspace + repo_input tests +│ └── tests/ # workspace + repo_input + repo_picker tests ├── runtime/ │ ├── mod.rs │ ├── snapshot.rs # SnapshotChannel: background git status/log worker @@ -392,6 +394,43 @@ repo 헤더다. 플로팅 팝업을 쓰지 않은 이유는 `src/ui/`에 오버 없고(모든 surface가 레이아웃 행을 차지한다) 마우스 캡처가 기본 on이라 `hit_test.rs`에 새 히트 영역이 필요해지기 때문이다. +**디렉터리 브라우저** — `workspace/path_tree.rs`(상태) + `ui/path_tree.rs`(렌더). +경로를 아는 경우(형제 체크아웃 — prefill이 노리는 케이스)는 타이핑이 빠르고 +모르는 경우는 브라우저가 낫다. 둘은 경쟁이 아니라 계층이다. + +- **진입은 `↓`**(또는 `↑`). printable 문자는 전부 합법 경로 문자라 쓸 수 없고, + 필드의 수평 키(`→`/`End`=prefill 수락)는 이미 "이 경로를 편집한다"는 뜻이라 + 수직 축이 비어 있다 — 브라우저 안에서 `↓`/`j`가 커서를 옮기므로 진입 키와 + 진입 후 조작이 같은 축에 놓이고, 모든 자동완성이 목록을 아래에 두는 관용과도 + 맞는다. `Ctrl+T`는 접었다: `T` 니모닉이 ` t`(새 터미널)와 겹쳐 + "충돌하지 않는다"를 설명해야 했고, 다이얼로그의 다른 키가 전부 bare인데 + Ctrl 화음만 튄다. +- **후보 목록이 떠 있을 때의 두 번째 `Tab`도 브라우저로 승격한다.** 그 상태의 + Tab은 같은 목록을 다시 그리는 죽은 키였고, 평면 목록이 실패한 지점이 정확히 + 거기다 — 배울 키 없이 도달하는 경로를 하나 남긴다. +- **`Enter`는 확정이 아니라 필드로 되돌리며 경로를 채운다.** repo를 실제로 여는 + 지점은 필드의 `Enter` 한 곳뿐이다. 그래서 `Enter`의 의미가 두 surface에서 + 갈리고, 브라우저에서는 확장이 `→` 전용이다(트리 뷰는 `Enter`도 확장한다). +- **평면 row 리스트**로 들고 있다. 확장은 자식을 부모 뒤에 splice, 접기는 아래 + 깊은 row를 drain — 선택이 화면 인덱스 그대로여서 프레임마다 flatten이 없다. +- **사용자 표기를 보존한다**(완성기와 같은 이유). `root_text`(타이핑한 그대로)와 + canonical `PathBuf`를 따로 들고, 고른 경로는 `root_text` 기준으로 조립한다. + `←`가 depth 0에서 루트를 한 단계 올릴 때만 예외가 생긴다 — `~`나 Windows + 드라이브의 부모는 사용자 표기로 표현할 수 없으므로 절대 경로로 대체하되, + 텍스트 수술을 믿지 않고 `canonicalize` 결과를 실제 부모와 대조해 검증한다. +- **body 전체를 쓴다**(위의 팝업 부재와 같은 이유). 다이얼로그가 이미 모든 키를 + 소유하므로 view mode·fullscreen 분기보다 앞에서 body를 가로챈다 — 그 분기들이 + 그릴 것은 어차피 inert다. 마우스 클릭 선택은 범위 밖(`hit_test.rs`에 새 히트 + 영역이 필요하다). 세션 저장도 하지 않는다: 필드가 활성 프로젝트 경로로 + prefill되므로 "지난 위치"가 새 영속 상태 없이 따라온다. +- 브라우저를 열면 `prefilled`가 해제된다. 브라우저는 버퍼에 전체 경로를 쓰므로, + 플래그가 살아 있으면 복귀 후 첫 타이핑이 방금 고른 경로를 지운다. + +다이얼로그는 hint legend를 통째로 대체하므로(입력 줄이 그 자리를 쓴다) 키를 +알릴 다른 자리가 없다. `hint_bar::repo_input_line`이 커서 뒤에 축약 legend를 +붙이고, 폭이 모자라면 잘라내지 않고 통째로 버린다 — 커서는 반드시 보여야 하고 +반쪽 legend는 렌더 결함으로 읽힌다. + 입력 핸들러는 `&mut App` 하나만 받으므로 탭 목록에 닿을 수 없다. 대신 워크스페이스 수준 의도를 `KeyOutcome::Project(ProjectRequest)`로 반환하고 `main_loop`이 실행한다. 이 덕분에 프로젝트별 입력 경로 전체가 그대로 유지된다. diff --git a/docs/repo-picker-plan.md b/docs/repo-picker-plan.md index a63f1a16..5ce2a93c 100644 --- a/docs/repo-picker-plan.md +++ b/docs/repo-picker-plan.md @@ -1,11 +1,25 @@ # repo 다이얼로그 경로 탐색 — 구현 계획 -> **상태: 1단계(Tab 완성) 구현 완료. 2단계(트리 피커) 미착수.** 확정된 설계는 -> `docs/architecture.md`로 이관했고, 사용법은 `README.md`에 있다. 이 문서는 **왜 그렇게 -> 갔는지**의 이력으로 남긴다. +> **상태: 구현 완료 (계획 이력).** 1단계(Tab 완성)와 2단계(디렉터리 브라우저) 모두 +> 들어갔다. 확정된 설계는 `docs/architecture.md`로 이관했고, 사용법은 `README.md`에 +> 있다. 이 문서는 **왜 그렇게 갔는지**의 이력으로 남긴다. > -> 2단계는 공통 기반(`path_complete::split_dir` / `read_dir_names` 추출)까지만 들어갔다. -> 착수 시 5절의 확정 사항부터 읽으면 된다. +> 구현이 5절의 계획과 갈린 지점 두 개: +> - **진입 키는 `Ctrl+T`가 아니라 `↓`다.** `T` 니모닉이 ` t`(새 터미널)와 겹쳐 +> "충돌하지 않는다"를 설명해야 했는데, 설명이 필요한 키는 이미 진 것이다. 다이얼로그의 +> 다른 키가 전부 bare인 것과도 맞고, 필드의 수평 키가 이미 "이 경로를 편집한다"는 +> 뜻이라 수직 축이 비어 있었다. 후보 목록이 떠 있을 때의 두 번째 `Tab`도 같은 곳으로 +> 승격한다 — 배울 키 없이 도달하는 경로. +> - **hint 행에 키 legend를 붙였다.** 계획에 없던 항목인데, 다이얼로그가 hint legend를 +> 통째로 입력 줄로 대체해서 `Tab` 완성조차 화면에 안 나오고 있었다. 진입 키를 아무리 +> 잘 골라도 광고할 자리가 없으면 못 찾는다. +> +> - **상태는 `BTreeSet` + children 캐시가 아니라 평면 row 리스트다.** 확장이 자식을 부모 +> 뒤에 splice하고 접기가 아래 깊은 row를 drain하면, 선택이 화면 인덱스 그대로여서 +> visible_rows 계산도 캐시 무효화도 필요 없다. 계획이 트리 뷰의 구조를 따라가려 했지만 +> 그쪽 복잡도는 repo-relative 검색 인덱스에서 온 것이고 브라우저에는 없다. +> +> 계획대로 범위 밖으로 남긴 것: 마우스 클릭 선택. ## 1. 문제 @@ -121,7 +135,7 @@ hit-test로 번지므로 기존 행을 쓴다. 우선순위: 각 단계 후 `cargo build && cargo test && cargo clippy --all-targets --all-features -- -D warnings` 통과 상태를 유지한다. 2단계까지만 머지된 중간 상태도 동작한다(완성은 되고 후보만 안 보임). -## 5. 2단계 — 트리 피커 (확정, 미착수) +## 5. 2단계 — 디렉터리 브라우저 (확정 당시의 설계) - **`Enter`는 확정이 아니라 텍스트 필드로 되돌리며 그 경로를 채운다.** 트리는 필드를 채우는 피커고, repo를 실제로 여는 지점은 여전히 필드의 `Enter` 한 곳이다. 선택 후에도 @@ -150,7 +164,7 @@ hit-test로 번지므로 기존 행을 쓴다. 우선순위: 경우(형제 체크아웃 — prefill이 노리는 케이스)는 타이핑이 빠르고, 모르는 경우는 트리가 낫다. 경쟁 관계가 아니다. -### 남은 작업 순서 +### 작업 순서 1. `workspace/path_tree.rs` — 트리 상태(선택 / 확장 `BTreeSet` / lazy children 캐시)와 탐색. `Workspace` 소유.