redraft-local 1.0.0 → 1.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (78) hide show
  1. package/README.md +79 -113
  2. package/dist/assets/{arc-IrAUEFbo.js → arc-D_Swy6PV.js} +1 -1
  3. package/dist/assets/{architectureDiagram-3BPJPVTR-eV8e6Cny.js → architectureDiagram-3BPJPVTR-J646oipM.js} +1 -1
  4. package/dist/assets/{blockDiagram-GPEHLZMM-CepkBlQ8.js → blockDiagram-GPEHLZMM-DOdO14l2.js} +1 -1
  5. package/dist/assets/{c4Diagram-AAUBKEIU-DIU7Cr9F.js → c4Diagram-AAUBKEIU-Btu8_53J.js} +1 -1
  6. package/dist/assets/channel-DsxWmGmy.js +1 -0
  7. package/dist/assets/{chunk-2J33WTMH-U7Y-rHjN.js → chunk-2J33WTMH-CRr8ljiS.js} +1 -1
  8. package/dist/assets/{chunk-4BX2VUAB-lcElluiE.js → chunk-4BX2VUAB-Dc7UNDIA.js} +1 -1
  9. package/dist/assets/{chunk-55IACEB6-CFvH86_F.js → chunk-55IACEB6-BfqLx6kn.js} +1 -1
  10. package/dist/assets/{chunk-727SXJPM-sjJISzIW.js → chunk-727SXJPM-C2mHpI3-.js} +1 -1
  11. package/dist/assets/{chunk-AQP2D5EJ-lHbzNL29.js → chunk-AQP2D5EJ-D_U-g8Xd.js} +1 -1
  12. package/dist/assets/{chunk-FMBD7UC4-DepXanYO.js → chunk-FMBD7UC4-B6MVhVK5.js} +1 -1
  13. package/dist/assets/{chunk-ND2GUHAM-ChO86fmu.js → chunk-ND2GUHAM-C3u4VP3b.js} +1 -1
  14. package/dist/assets/{chunk-QZHKN3VN-cMXIHNS0.js → chunk-QZHKN3VN-JqZBybaW.js} +1 -1
  15. package/dist/assets/classDiagram-4FO5ZUOK-B6NkHsrH.js +1 -0
  16. package/dist/assets/classDiagram-v2-Q7XG4LA2-B6NkHsrH.js +1 -0
  17. package/dist/assets/{cose-bilkent-S5V4N54A-BtIXFmhL.js → cose-bilkent-S5V4N54A-D2tVyZ8S.js} +1 -1
  18. package/dist/assets/{dagre-BM42HDAG-BXjqIBZS.js → dagre-BM42HDAG-CGU7PNkH.js} +1 -1
  19. package/dist/assets/{diagram-2AECGRRQ-Tl_nXDTZ.js → diagram-2AECGRRQ-DF4PZWry.js} +1 -1
  20. package/dist/assets/{diagram-5GNKFQAL-JfhswyGB.js → diagram-5GNKFQAL-D-fJ-UP1.js} +1 -1
  21. package/dist/assets/{diagram-KO2AKTUF-BF-BmBhK.js → diagram-KO2AKTUF-DnRsU6WY.js} +1 -1
  22. package/dist/assets/{diagram-LMA3HP47-Cru13vuB.js → diagram-LMA3HP47-DXRZxkPL.js} +1 -1
  23. package/dist/assets/{diagram-OG6HWLK6-ChurlTYX.js → diagram-OG6HWLK6-BtyoDI0y.js} +1 -1
  24. package/dist/assets/{erDiagram-TEJ5UH35-BoAub81I.js → erDiagram-TEJ5UH35-CQ8Xm3L1.js} +1 -1
  25. package/dist/assets/{flowDiagram-I6XJVG4X-BEfgdRJD.js → flowDiagram-I6XJVG4X-DJogWRB6.js} +1 -1
  26. package/dist/assets/{ganttDiagram-6RSMTGT7-D9vdaEDA.js → ganttDiagram-6RSMTGT7-CwDVu3wX.js} +1 -1
  27. package/dist/assets/{gitGraphDiagram-PVQCEYII-6r_-LhOd.js → gitGraphDiagram-PVQCEYII-BFkYOL0u.js} +1 -1
  28. package/dist/assets/{graph-CXTBBug4.js → graph-C0lIiNQ9.js} +1 -1
  29. package/dist/assets/{index-C5rqPEZO.js → index-2r7Da6NH.js} +1 -1
  30. package/dist/assets/{index-B0lYydq8.js → index-B7DpboJP.js} +1 -1
  31. package/dist/assets/{index-Dg1VPHlx.js → index-BOQbNa5E.js} +1 -1
  32. package/dist/assets/{index-BQlgsOap.js → index-Bn4ghHLK.js} +1 -1
  33. package/dist/assets/{index-yQHxzZ_P.js → index-C4vOGYpd.js} +1 -1
  34. package/dist/assets/{index-KyyXYoYK.js → index-C9ljCBwi.js} +1 -1
  35. package/dist/assets/{index-1GVlsuGh.js → index-CIGZhCtG.js} +1 -1
  36. package/dist/assets/{index-BZ5M7Lmr.js → index-CQbg0sEq.js} +1 -1
  37. package/dist/assets/{index-B2PzsWy_.js → index-CRFD0qqc.js} +1 -1
  38. package/dist/assets/{index-DF8EOjKn.js → index-CYsrmKy8.js} +1 -1
  39. package/dist/assets/{index-BHHb2vdB.js → index-Cd1BLBtA.js} +1 -1
  40. package/dist/assets/{index-BwWp5CJi.css → index-CjbBHf0x.css} +1 -1
  41. package/dist/assets/{index-DuZDoaL2.js → index-CkrGHD_o.js} +1 -1
  42. package/dist/assets/{index-CKP5xcLm.js → index-CrBROreI.js} +1 -1
  43. package/dist/assets/{index-CbUkFUyy.js → index-Cv28RZnd.js} +1 -1
  44. package/dist/assets/{index-BrrCW2Du.js → index-Cz3YNsrm.js} +1 -1
  45. package/dist/assets/{index-Dg04Tp6d.js → index-D9Hy07J8.js} +1 -1
  46. package/dist/assets/{index-CJat2L_Y.js → index-DTHcUELS.js} +1 -1
  47. package/dist/assets/{index-BADGcZeo.js → index-DsOSy8xC.js} +1 -1
  48. package/dist/assets/{index-BJ4jfHuR.js → index-P0HG7ml-.js} +1 -1
  49. package/dist/assets/{index-CEPnpNst.js → index-ZBBDPj7P.js} +157 -158
  50. package/dist/assets/{index-CFjWwLPi.js → index-lcWNRlm8.js} +1 -1
  51. package/dist/assets/{index-CbDr3dMB.js → index-nIt909SX.js} +1 -1
  52. package/dist/assets/{index-c9l6T4Cz.js → index-yCoA0NsD.js} +1 -1
  53. package/dist/assets/{infoDiagram-5YYISTIA-DiheReis.js → infoDiagram-5YYISTIA-Ccd7RoQl.js} +1 -1
  54. package/dist/assets/{ishikawaDiagram-YF4QCWOH-4_L0YQN_.js → ishikawaDiagram-YF4QCWOH-D-gEvZZ_.js} +1 -1
  55. package/dist/assets/{journeyDiagram-JHISSGLW-DAmBT_zw.js → journeyDiagram-JHISSGLW-DS177kP9.js} +1 -1
  56. package/dist/assets/{kanban-definition-UN3LZRKU-D3aEPBwr.js → kanban-definition-UN3LZRKU-BdTzJI_S.js} +1 -1
  57. package/dist/assets/{layout-Cv7Sf47H.js → layout-CglVrgpW.js} +1 -1
  58. package/dist/assets/{linear-g803cvQu.js → linear-CUEJW0YE.js} +1 -1
  59. package/dist/assets/{mindmap-definition-RKZ34NQL-DjgyQt_X.js → mindmap-definition-RKZ34NQL-CAQpOzG8.js} +1 -1
  60. package/dist/assets/{pieDiagram-4H26LBE5-yFcm2Lht.js → pieDiagram-4H26LBE5-DcNdoCUO.js} +1 -1
  61. package/dist/assets/{quadrantDiagram-W4KKPZXB-B1tA6-GI.js → quadrantDiagram-W4KKPZXB-__i9Z3ji.js} +1 -1
  62. package/dist/assets/{requirementDiagram-4Y6WPE33-CQuxflx5.js → requirementDiagram-4Y6WPE33-mIW4fwkc.js} +1 -1
  63. package/dist/assets/{sankeyDiagram-5OEKKPKP-BAc81IoP.js → sankeyDiagram-5OEKKPKP-wS1BI3xo.js} +1 -1
  64. package/dist/assets/{sequenceDiagram-3UESZ5HK-C5qxh_r3.js → sequenceDiagram-3UESZ5HK-DAHQ72aY.js} +1 -1
  65. package/dist/assets/{stateDiagram-AJRCARHV-vGhwcSH9.js → stateDiagram-AJRCARHV-CezbFLSl.js} +1 -1
  66. package/dist/assets/stateDiagram-v2-BHNVJYJU-BHPGn4U6.js +1 -0
  67. package/dist/assets/{timeline-definition-PNZ67QCA-C4UTIH27.js → timeline-definition-PNZ67QCA-DUssVPNj.js} +1 -1
  68. package/dist/assets/{vennDiagram-CIIHVFJN-B51qUqyF.js → vennDiagram-CIIHVFJN-MnU-vX8K.js} +1 -1
  69. package/dist/assets/{wardley-L42UT6IY-c2i9mxDa.js → wardley-L42UT6IY-c1R-eeRO.js} +1 -1
  70. package/dist/assets/{wardleyDiagram-YWT4CUSO-BAxR03RU.js → wardleyDiagram-YWT4CUSO-Cf_Ur_xL.js} +1 -1
  71. package/dist/assets/{xychartDiagram-2RQKCTM6-cnr8gtAH.js → xychartDiagram-2RQKCTM6-4EQ_jtu_.js} +1 -1
  72. package/dist/index.html +2 -2
  73. package/dist-server/cli.mjs +83 -20
  74. package/package.json +1 -1
  75. package/dist/assets/channel-C4wa-44g.js +0 -1
  76. package/dist/assets/classDiagram-4FO5ZUOK-CbSFD3RU.js +0 -1
  77. package/dist/assets/classDiagram-v2-Q7XG4LA2-CbSFD3RU.js +0 -1
  78. package/dist/assets/stateDiagram-v2-BHNVJYJU-DCZ1QOqI.js +0 -1
package/README.md CHANGED
@@ -1,160 +1,126 @@
1
- <img src="public/logo.png" alt="ReDraft" height="48" />
1
+ <p align="center">
2
+ <img src="assets/hero.png" alt="ReDraft — GitHub-based document review workspace">
3
+ </p>
2
4
 
3
- # ReDraft
5
+ <p align="center">
6
+ <strong>Collaborative markdown review — powered by a branch in your repo.</strong>
7
+ </p>
4
8
 
5
- [![npm](https://img.shields.io/npm/v/redraft-local)](https://www.npmjs.com/package/redraft-local)
6
- [![npm downloads](https://img.shields.io/npm/dm/redraft-local)](https://www.npmjs.com/package/redraft-local)
7
- [![CI](https://github.com/tcamise-gpsw/redraft/actions/workflows/ci.yml/badge.svg)](https://github.com/tcamise-gpsw/redraft/actions/workflows/ci.yml)
8
- [![Site](https://img.shields.io/badge/site-redraft--docs.dev-blue)](https://redraft-docs.dev)
9
+ <p align="center">
10
+ <a href="https://www.npmjs.com/package/redraft-local"><img src="https://img.shields.io/npm/v/redraft-local?style=flat&colorA=222222&colorB=CB3837" alt="npm version"></a>
11
+ <a href="https://www.npmjs.com/package/redraft-local"><img src="https://img.shields.io/npm/dm/redraft-local?style=flat&colorA=222222&colorB=CB3837" alt="npm downloads"></a>
12
+ <a href="https://github.com/tcamise-gpsw/redraft/actions/workflows/ci.yml"><img src="https://img.shields.io/github/actions/workflow/status/tcamise-gpsw/redraft/ci.yml?style=flat&colorA=222222&colorB=3FB950" alt="CI"></a>
13
+ <a href="https://redraft-docs.dev"><img src="https://img.shields.io/badge/site-redraft--docs.dev-58A6FF?style=flat&colorA=222222" alt="Site"></a>
14
+ <a href="https://www.typescriptlang.org"><img src="https://img.shields.io/badge/TypeScript-3178C6?style=flat&colorA=222222&logo=typescript&logoColor=white" alt="TypeScript"></a>
15
+ </p>
9
16
 
10
- ReDraft is a review workspace for markdown documents. It lets teams browse repository docs, discuss them with inline comment threads, and edit them in either a rich-text editor or raw markdown backed by GitHub in remote mode or the local filesystem in local mode.
17
+ ReDraft turns any Git repository into a review workspace for markdown documents. Select text, leave a comment, reply in threads, resolve feedback all without leaving the browser. No database, no platform migration, no new accounts. Your documents stay as `.md` files. Review threads live on a sidecar branch. That's it.
11
18
 
12
- ## What it does
19
+ **Built for everyone on the team.** Non-technical reviewers use the WYSIWYG editor — no markdown syntax required. Engineers switch to raw mode for full control. AI agents edit files directly on disk. Everyone works on the same documents in the same review threads, each in the mode that fits them.
13
20
 
14
- - Organizes markdown documents from anywhere in the repository
15
- - Renders markdown documents with comments, activity, and Mermaid diagrams
16
- - Supports inline comment threads, replies, and resolution
17
- - Lets different users work in the mode that fits them best
18
-
19
- | Mode | Best for | Data source | Editing style |
20
- | ------------------- | ------------------------- | ------------------- | -------------------------------- |
21
- | **Remote WYSIWYG** | Non-technical reviewers | GitHub repository | Rich-text editing in the browser |
22
- | **Remote Markdown** | Technical contributors | GitHub repository | Raw markdown + preview |
23
- | **Local + AI** | Power users and AI agents | Local files on disk | Browser UI + direct file edits |
21
+ **Remote and local are the same UI.** Use [redraft-docs.dev](https://redraft-docs.dev) to review any GitHub repo in the browser, or run `npx redraft-local` to serve your local checkout. Local mode lets you edit with your own tools — your editor, your scripts, your AI agents — and see changes reflected live. ReDraft ships with [built-in skills](.agents/skills/redraft-review/) for walking comment threads, drafting replies, and revising documents, so agents work alongside human reviewers out of the box.
24
22
 
25
23
  ---
26
24
 
27
- ## Remote mode — for reviewers and contributors
28
-
29
- Remote mode is the hosted GitHub-backed experience. You connect ReDraft to a repository and browse any markdown document in that repo.
30
-
31
- ### For non-technical reviewers
32
-
33
- Use **View** and **WYSIWYG** modes when you want to read, comment, and make light edits without working directly in markdown syntax.
25
+ ## Get started
34
26
 
35
- Typical workflow:
27
+ ### Remote
36
28
 
37
- 1. Open [redraft-docs.dev](https://redraft-docs.dev).
38
- 2. Enter a fine-grained GitHub PAT and `owner/repo`.
39
- 3. Choose a document from the tree.
40
- 4. Read in **View** mode or switch to **WYSIWYG**.
41
- 5. Select text, add comments, reply to threads, and resolve feedback.
29
+ Visit [redraft-docs.dev](https://redraft-docs.dev), enter a fine-grained GitHub PAT (`Contents: Read/Write` + `Metadata: Read`), point it at any repo, and start reviewing. Nothing to install.
42
30
 
43
- ### For technical contributors
31
+ ### Local (advanced)
44
32
 
45
- Use **Raw** mode when you want direct markdown control while still keeping the browser review workflow.
33
+ For power users and AI agents who want to work with local tools:
46
34
 
47
- Typical workflow:
35
+ ```bash
36
+ npx redraft-local --open
37
+ ```
48
38
 
49
- 1. Connect to the target repository.
50
- 2. Open a document from the tree.
51
- 3. Switch between **View**, **WYSIWYG**, and **Raw** as needed.
52
- 4. Edit markdown directly in **Raw** mode.
53
- 5. Save changes back to GitHub with SHA-based conflict protection.
39
+ Launches a local server and opens the browser automatically. Every `.md` file in your working directory is ready for review — no signup, no PAT, no config. Edit files in your own editor or with AI agents and see changes live in the browser.
54
40
 
55
- ### Remote mode requirements
41
+ ---
56
42
 
57
- ReDraft expects a fine-grained GitHub PAT with:
43
+ ## How it works
58
44
 
59
- - **Contents: Read/Write**
60
- - **Metadata: Read**
45
+ ReDraft stores nothing outside your repository. Documents are plain `.md` files on any branch — pick the branch you want to review from the branch selector. Comment threads live as structured JSON on a dedicated sidecar branch (`redraft` by default) under `.redraft/comments/`. The sidecar branch never touches your working tree — no merge conflicts, no noise in diffs.
61
46
 
62
- Repository conventions:
47
+ ```
48
+ your-repo/
49
+ ├── any branch (your documents)
50
+ │ ├── proposals/api-design.md
51
+ │ ├── rfcs/rfc-001.md
52
+ │ └── docs/architecture.md
53
+
54
+ └── redraft (sidecar branch — created automatically)
55
+ └── .redraft/comments/<document-branch>/
56
+ ├── proposals/api-design.comments.json
57
+ └── rfcs/rfc-001.comments.json
58
+ ```
63
59
 
64
- - Markdown documents can live anywhere in the repo
65
- - Comment threads live under `.redraft/comments/<mirrored-path>.comments.json`
66
- - Document content and comment files are written with SHA checks for conflict detection
60
+ One React frontend serves both modes. In remote mode, it talks to the GitHub REST API. In local mode, it talks to a local server that mirrors the same API shape against your filesystem. The code path is identical — only the transport changes.
67
61
 
68
62
  ---
69
63
 
70
- ## Local mode for power users and AI agents
64
+ ## 01 · Browse, review, and comment
71
65
 
72
- Local mode serves the same UI from your machine, but reads and writes local files instead of going through the GitHub API.
66
+ Open any markdown document in the repository. The left sidebar shows the full document tree and highlights documents with active review threads under **Under Review**. The center panel renders the document with full formatting. The right sidebar shows comment threads anchored to the text they reference.
73
67
 
74
- ### Quick start
68
+ Select text to anchor a comment. Threads support replies, resolution, and deletion. Comments stay anchored even when the document changes — ReDraft uses surrounding context to relocate anchors after edits. If the anchor text is gone entirely, the thread moves to an **Orphaned** section instead of silently disappearing.
75
69
 
76
- **Install once globally, or use directly via npx:**
70
+ ![Document view with tree, rendered markdown, and comment threads](assets/screenshots/document-view.png)
77
71
 
78
- ```bash
79
- npx redraft-local
80
- ```
72
+ ## 02 · Three editing modes
81
73
 
82
- Or install globally and reuse:
83
-
84
- ```bash
85
- npm install -g redraft-local
86
- redraft-local
87
- ```
74
+ Switch between **View**, **WYSIWYG**, and **Raw** depending on how you work.
88
75
 
89
- This starts a local ReDraft server at `http://127.0.0.1:4200` by default. The frontend is bundled into the package — no separate build step required.
76
+ | Mode | Editor | Best for |
77
+ | ----------- | --------------------------- | ------------------------------------ |
78
+ | **View** | Read-only rendered markdown | Reading and commenting |
79
+ | **WYSIWYG** | Milkdown rich-text editor | Non-technical reviewers, light edits |
80
+ | **Raw** | Plain textarea | Power users who think in markdown |
90
81
 
91
- **Options:**
82
+ ![Raw markdown editing with comment sidebar](assets/screenshots/raw-markdown.png)
92
83
 
93
- ```
94
- redraft [directory] [options]
95
- redraft serve [directory] [options]
84
+ ## 03 · Mermaid diagrams, code blocks, and full markdown
96
85
 
97
- --port <number> Port to listen on (default: 4200)
98
- --host <string> Bind address (default: 127.0.0.1)
99
- --open Open the browser automatically
100
- --no-ui API-only mode, skip serving the frontend
101
- ```
86
+ ReDraft renders the full CommonMark spec plus Mermaid diagrams, fenced code blocks with syntax highlighting, tables, blockquotes, and task lists. What you see in the browser is what your markdown looks like — no surprises.
102
87
 
103
- `[directory]` is optional. Omit it to serve the current working directory.
88
+ ![Mermaid flowchart rendered inline](assets/screenshots/mermaid-diagram.png)
104
89
 
105
- **Contributing / running from source:**
90
+ ## 04 · Local mode — just files on disk
106
91
 
107
92
  ```bash
108
- npm install
109
- npm run build
110
- npm run serve
93
+ npx redraft-local # serve current directory
94
+ npx redraft-local ./proposals # serve a specific path
111
95
  ```
112
96
 
113
- `npm install` also wires up pre-commit hooks via `git config core.hooksPath .githooks`. The hook runs `format:check` and `lint` before every commit. To activate manually: `npm run prepare`.
114
-
115
- What local mode gives you:
97
+ Everything is plain text. Documents are `.md` files. Comments are `.json` sidecars on a Git branch. Use any tool you want — your editor, `sed`, a Python script, an AI agent. ReDraft watches the filesystem and updates the browser live.
116
98
 
117
- - No PAT prompt
118
- - Direct read/write access to local `.md` files
119
- - Structured review threads stored under `.redraft/comments/`
120
- - Live UI updates when files change on disk
121
- - Optional git convenience endpoints for status and commits
99
+ ReDraft ships with a [redraft-review skill](.agents/skills/redraft-review/) that lets AI agents walk unresolved threads, draft replies, resolve feedback, and revise documents through a structured API.
122
100
 
123
- ### Working with AI agents
124
-
125
- Local mode is the intended environment for AI-assisted document workflows.
126
-
127
- The design target is:
101
+ **Options:**
128
102
 
129
- - Agents edit markdown documents directly on disk
130
- - Agents use the local ReDraft API for structured comment operations
103
+ ```
104
+ npx redraft-local [directory] [options]
105
+ npx redraft-local serve [directory] [options]
106
+
107
+ --port <number> Port to listen on (default: 4200)
108
+ --host <string> Bind address (default: 127.0.0.1)
109
+ --open Open the browser automatically
110
+ --sidecar-branch <string> Git branch for comments (default: redraft)
111
+ --no-ui API-only mode, skip serving the frontend
112
+ ```
131
113
 
132
- Planned/common AI workflows include:
114
+ ## 05 · Zero infrastructure
133
115
 
134
- - Review unresolved comment threads one by one
135
- - Draft or post replies
136
- - Resolve completed threads
137
- - Revise a document based on accumulated feedback
138
- - Summarize open discussions across the repo
116
+ There is no database. No object store. No Redis. No account system. Your data is markdown files and JSON sidecars in a Git repository you already own. Remote mode is a static site on GitHub Pages. Local mode is a single Node process.
139
117
 
140
118
  ---
141
119
 
142
- ## How ReDraft works
143
-
144
- ReDraft uses one React frontend across all modes.
145
-
146
- - In **remote mode**, the browser talks to the GitHub REST API.
147
- - In **local mode**, the browser talks to a local server that mimics the GitHub contents API while reading and writing the filesystem.
148
- - Comment threads are stored separately from document markdown under `.redraft/comments/`, so review discussion remains structured and portable.
149
-
150
- For architecture details, see `docs/architecture.md`.
151
-
152
- ---
120
+ ## Development
153
121
 
154
- ## Related documentation
122
+ See [docs/development.md](docs/development.md) for build, test, and deployment details.
155
123
 
156
- - `docs/architecture.md` — system architecture and data flow
157
- - `docs/development.md`development setup, build, test, and deployment details
158
- - `docs/specs/`design specs and approved technical decisions
159
- - `docs/plans/` — implementation plans and execution notes
160
- - `AGENTS.md` — repository guidance for coding agents
124
+ - [docs/architecture.md](docs/architecture.md) — system architecture and data flow
125
+ - [docs/specs/](docs/specs/)design specs and technical decisions
126
+ - [AGENTS.md](AGENTS.md)repository guidance for coding agents
@@ -1 +1 @@
1
- import{a8 as ln,a9 as an,aa as g,ab as tn,ac as G,ad as j,ae as _,af as un,ag as rn,ah as K,ai as o,aj as z,ak as sn,al as on,am as fn}from"./index-CEPnpNst.js";function cn(l){return l.innerRadius}function gn(l){return l.outerRadius}function yn(l){return l.startAngle}function dn(l){return l.endAngle}function mn(l){return l&&l.padAngle}function pn(l,h,E,q,v,A,B,a){var I=E-l,i=q-h,n=B-v,d=a-A,u=d*I-n*i;if(!(u*u<g))return u=(n*(h-A)-d*(l-v))/u,[l+u*I,h+u*i]}function V(l,h,E,q,v,A,B){var a=l-E,I=h-q,i=(B?A:-A)/K(a*a+I*I),n=i*I,d=-i*a,u=l+n,s=h+d,f=E+n,c=q+d,C=(u+f)/2,t=(s+c)/2,m=f-u,y=c-s,R=m*m+y*y,T=v-A,P=u*c-f*s,O=(y<0?-1:1)*K(fn(0,T*T*R-P*P)),S=(P*y-m*O)/R,k=(-P*m-y*O)/R,w=(P*y+m*O)/R,p=(-P*m+y*O)/R,x=S-C,e=k-t,r=w-C,F=p-t;return x*x+e*e>r*r+F*F&&(S=w,k=p),{cx:S,cy:k,x01:-n,y01:-d,x11:S*(v/T-1),y11:k*(v/T-1)}}function hn(){var l=cn,h=gn,E=z(0),q=null,v=yn,A=dn,B=mn,a=null,I=ln(i);function i(){var n,d,u=+l.apply(this,arguments),s=+h.apply(this,arguments),f=v.apply(this,arguments)-an,c=A.apply(this,arguments)-an,C=un(c-f),t=c>f;if(a||(a=n=I()),s<u&&(d=s,s=u,u=d),!(s>g))a.moveTo(0,0);else if(C>tn-g)a.moveTo(s*G(f),s*j(f)),a.arc(0,0,s,f,c,!t),u>g&&(a.moveTo(u*G(c),u*j(c)),a.arc(0,0,u,c,f,t));else{var m=f,y=c,R=f,T=c,P=C,O=C,S=B.apply(this,arguments)/2,k=S>g&&(q?+q.apply(this,arguments):K(u*u+s*s)),w=_(un(s-u)/2,+E.apply(this,arguments)),p=w,x=w,e,r;if(k>g){var F=sn(k/u*j(S)),L=sn(k/s*j(S));(P-=F*2)>g?(F*=t?1:-1,R+=F,T-=F):(P=0,R=T=(f+c)/2),(O-=L*2)>g?(L*=t?1:-1,m+=L,y-=L):(O=0,m=y=(f+c)/2)}var H=s*G(m),J=s*j(m),M=u*G(T),N=u*j(T);if(w>g){var Q=s*G(y),U=s*j(y),W=u*G(R),X=u*j(R),D;if(C<rn)if(D=pn(H,J,W,X,Q,U,M,N)){var Y=H-D[0],Z=J-D[1],$=Q-D[0],b=U-D[1],nn=1/j(on((Y*$+Z*b)/(K(Y*Y+Z*Z)*K($*$+b*b)))/2),en=K(D[0]*D[0]+D[1]*D[1]);p=_(w,(u-en)/(nn-1)),x=_(w,(s-en)/(nn+1))}else p=x=0}O>g?x>g?(e=V(W,X,H,J,s,x,t),r=V(Q,U,M,N,s,x,t),a.moveTo(e.cx+e.x01,e.cy+e.y01),x<w?a.arc(e.cx,e.cy,x,o(e.y01,e.x01),o(r.y01,r.x01),!t):(a.arc(e.cx,e.cy,x,o(e.y01,e.x01),o(e.y11,e.x11),!t),a.arc(0,0,s,o(e.cy+e.y11,e.cx+e.x11),o(r.cy+r.y11,r.cx+r.x11),!t),a.arc(r.cx,r.cy,x,o(r.y11,r.x11),o(r.y01,r.x01),!t))):(a.moveTo(H,J),a.arc(0,0,s,m,y,!t)):a.moveTo(H,J),!(u>g)||!(P>g)?a.lineTo(M,N):p>g?(e=V(M,N,Q,U,u,-p,t),r=V(H,J,W,X,u,-p,t),a.lineTo(e.cx+e.x01,e.cy+e.y01),p<w?a.arc(e.cx,e.cy,p,o(e.y01,e.x01),o(r.y01,r.x01),!t):(a.arc(e.cx,e.cy,p,o(e.y01,e.x01),o(e.y11,e.x11),!t),a.arc(0,0,u,o(e.cy+e.y11,e.cx+e.x11),o(r.cy+r.y11,r.cx+r.x11),t),a.arc(r.cx,r.cy,p,o(r.y11,r.x11),o(r.y01,r.x01),!t))):a.arc(0,0,u,T,R,t)}if(a.closePath(),n)return a=null,n+""||null}return i.centroid=function(){var n=(+l.apply(this,arguments)+ +h.apply(this,arguments))/2,d=(+v.apply(this,arguments)+ +A.apply(this,arguments))/2-rn/2;return[G(d)*n,j(d)*n]},i.innerRadius=function(n){return arguments.length?(l=typeof n=="function"?n:z(+n),i):l},i.outerRadius=function(n){return arguments.length?(h=typeof n=="function"?n:z(+n),i):h},i.cornerRadius=function(n){return arguments.length?(E=typeof n=="function"?n:z(+n),i):E},i.padRadius=function(n){return arguments.length?(q=n==null?null:typeof n=="function"?n:z(+n),i):q},i.startAngle=function(n){return arguments.length?(v=typeof n=="function"?n:z(+n),i):v},i.endAngle=function(n){return arguments.length?(A=typeof n=="function"?n:z(+n),i):A},i.padAngle=function(n){return arguments.length?(B=typeof n=="function"?n:z(+n),i):B},i.context=function(n){return arguments.length?(a=n??null,i):a},i}export{hn as d};
1
+ import{a8 as ln,a9 as an,aa as g,ab as tn,ac as G,ad as j,ae as _,af as un,ag as rn,ah as K,ai as o,aj as z,ak as sn,al as on,am as fn}from"./index-ZBBDPj7P.js";function cn(l){return l.innerRadius}function gn(l){return l.outerRadius}function yn(l){return l.startAngle}function dn(l){return l.endAngle}function mn(l){return l&&l.padAngle}function pn(l,h,E,q,v,A,B,a){var I=E-l,i=q-h,n=B-v,d=a-A,u=d*I-n*i;if(!(u*u<g))return u=(n*(h-A)-d*(l-v))/u,[l+u*I,h+u*i]}function V(l,h,E,q,v,A,B){var a=l-E,I=h-q,i=(B?A:-A)/K(a*a+I*I),n=i*I,d=-i*a,u=l+n,s=h+d,f=E+n,c=q+d,C=(u+f)/2,t=(s+c)/2,m=f-u,y=c-s,R=m*m+y*y,T=v-A,P=u*c-f*s,O=(y<0?-1:1)*K(fn(0,T*T*R-P*P)),S=(P*y-m*O)/R,k=(-P*m-y*O)/R,w=(P*y+m*O)/R,p=(-P*m+y*O)/R,x=S-C,e=k-t,r=w-C,F=p-t;return x*x+e*e>r*r+F*F&&(S=w,k=p),{cx:S,cy:k,x01:-n,y01:-d,x11:S*(v/T-1),y11:k*(v/T-1)}}function hn(){var l=cn,h=gn,E=z(0),q=null,v=yn,A=dn,B=mn,a=null,I=ln(i);function i(){var n,d,u=+l.apply(this,arguments),s=+h.apply(this,arguments),f=v.apply(this,arguments)-an,c=A.apply(this,arguments)-an,C=un(c-f),t=c>f;if(a||(a=n=I()),s<u&&(d=s,s=u,u=d),!(s>g))a.moveTo(0,0);else if(C>tn-g)a.moveTo(s*G(f),s*j(f)),a.arc(0,0,s,f,c,!t),u>g&&(a.moveTo(u*G(c),u*j(c)),a.arc(0,0,u,c,f,t));else{var m=f,y=c,R=f,T=c,P=C,O=C,S=B.apply(this,arguments)/2,k=S>g&&(q?+q.apply(this,arguments):K(u*u+s*s)),w=_(un(s-u)/2,+E.apply(this,arguments)),p=w,x=w,e,r;if(k>g){var F=sn(k/u*j(S)),L=sn(k/s*j(S));(P-=F*2)>g?(F*=t?1:-1,R+=F,T-=F):(P=0,R=T=(f+c)/2),(O-=L*2)>g?(L*=t?1:-1,m+=L,y-=L):(O=0,m=y=(f+c)/2)}var H=s*G(m),J=s*j(m),M=u*G(T),N=u*j(T);if(w>g){var Q=s*G(y),U=s*j(y),W=u*G(R),X=u*j(R),D;if(C<rn)if(D=pn(H,J,W,X,Q,U,M,N)){var Y=H-D[0],Z=J-D[1],$=Q-D[0],b=U-D[1],nn=1/j(on((Y*$+Z*b)/(K(Y*Y+Z*Z)*K($*$+b*b)))/2),en=K(D[0]*D[0]+D[1]*D[1]);p=_(w,(u-en)/(nn-1)),x=_(w,(s-en)/(nn+1))}else p=x=0}O>g?x>g?(e=V(W,X,H,J,s,x,t),r=V(Q,U,M,N,s,x,t),a.moveTo(e.cx+e.x01,e.cy+e.y01),x<w?a.arc(e.cx,e.cy,x,o(e.y01,e.x01),o(r.y01,r.x01),!t):(a.arc(e.cx,e.cy,x,o(e.y01,e.x01),o(e.y11,e.x11),!t),a.arc(0,0,s,o(e.cy+e.y11,e.cx+e.x11),o(r.cy+r.y11,r.cx+r.x11),!t),a.arc(r.cx,r.cy,x,o(r.y11,r.x11),o(r.y01,r.x01),!t))):(a.moveTo(H,J),a.arc(0,0,s,m,y,!t)):a.moveTo(H,J),!(u>g)||!(P>g)?a.lineTo(M,N):p>g?(e=V(M,N,Q,U,u,-p,t),r=V(H,J,W,X,u,-p,t),a.lineTo(e.cx+e.x01,e.cy+e.y01),p<w?a.arc(e.cx,e.cy,p,o(e.y01,e.x01),o(r.y01,r.x01),!t):(a.arc(e.cx,e.cy,p,o(e.y01,e.x01),o(e.y11,e.x11),!t),a.arc(0,0,u,o(e.cy+e.y11,e.cx+e.x11),o(r.cy+r.y11,r.cx+r.x11),t),a.arc(r.cx,r.cy,p,o(r.y11,r.x11),o(r.y01,r.x01),!t))):a.arc(0,0,u,T,R,t)}if(a.closePath(),n)return a=null,n+""||null}return i.centroid=function(){var n=(+l.apply(this,arguments)+ +h.apply(this,arguments))/2,d=(+v.apply(this,arguments)+ +A.apply(this,arguments))/2-rn/2;return[G(d)*n,j(d)*n]},i.innerRadius=function(n){return arguments.length?(l=typeof n=="function"?n:z(+n),i):l},i.outerRadius=function(n){return arguments.length?(h=typeof n=="function"?n:z(+n),i):h},i.cornerRadius=function(n){return arguments.length?(E=typeof n=="function"?n:z(+n),i):E},i.padRadius=function(n){return arguments.length?(q=n==null?null:typeof n=="function"?n:z(+n),i):q},i.startAngle=function(n){return arguments.length?(v=typeof n=="function"?n:z(+n),i):v},i.endAngle=function(n){return arguments.length?(A=typeof n=="function"?n:z(+n),i):A},i.padAngle=function(n){return arguments.length?(B=typeof n=="function"?n:z(+n),i):B},i.context=function(n){return arguments.length?(a=n??null,i):a},i}export{hn as d};