colonynote 0.0.0 → 1.0.0-beta.12

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 (71) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +125 -0
  3. package/README.zh.md +125 -0
  4. package/bin/colonynote.js +148 -0
  5. package/dist/client/assets/__vite-browser-external-BIHI7g3E.js +1 -0
  6. package/dist/client/assets/_baseUniq-T-svP185.js +1 -0
  7. package/dist/client/assets/arc-DPGp6UO-.js +1 -0
  8. package/dist/client/assets/architectureDiagram-Q4EWVU46-BjON9QCG.js +36 -0
  9. package/dist/client/assets/blockDiagram-DXYQGD6D-BLoDfE0P.js +132 -0
  10. package/dist/client/assets/c4Diagram-AHTNJAMY-fQ1soS6G.js +10 -0
  11. package/dist/client/assets/channel-MqQDOUgw.js +1 -0
  12. package/dist/client/assets/chunk-4BX2VUAB-BQI2dXlO.js +1 -0
  13. package/dist/client/assets/chunk-4TB4RGXK-B0FuCAMO.js +206 -0
  14. package/dist/client/assets/chunk-55IACEB6-SbmoW08H.js +1 -0
  15. package/dist/client/assets/chunk-EDXVE4YY-BTkJGdcb.js +1 -0
  16. package/dist/client/assets/chunk-FMBD7UC4-2RG66CzU.js +15 -0
  17. package/dist/client/assets/chunk-OYMX7WX6-B7irjINX.js +231 -0
  18. package/dist/client/assets/chunk-QZHKN3VN-rsXCL0TK.js +1 -0
  19. package/dist/client/assets/chunk-YZCP3GAM-ArKVHPRF.js +1 -0
  20. package/dist/client/assets/classDiagram-6PBFFD2Q-CZdm6ATq.js +1 -0
  21. package/dist/client/assets/classDiagram-v2-HSJHXN6E-CZdm6ATq.js +1 -0
  22. package/dist/client/assets/clone-CxH2cmrL.js +1 -0
  23. package/dist/client/assets/cose-bilkent-S5V4N54A-DVBMSGze.js +1 -0
  24. package/dist/client/assets/cytoscape.esm-DxGcaOPV.js +331 -0
  25. package/dist/client/assets/dagre-KV5264BT-COm1avIi.js +4 -0
  26. package/dist/client/assets/defaultLocale-DX6XiGOO.js +1 -0
  27. package/dist/client/assets/diagram-5BDNPKRD-BHzIKztM.js +10 -0
  28. package/dist/client/assets/diagram-G4DWMVQ6-D1JhDGDX.js +24 -0
  29. package/dist/client/assets/diagram-MMDJMWI5-q28BYReU.js +43 -0
  30. package/dist/client/assets/diagram-TYMM5635-BoK9AqHX.js +24 -0
  31. package/dist/client/assets/erDiagram-SMLLAGMA-ogyu4HEv.js +85 -0
  32. package/dist/client/assets/flowDiagram-DWJPFMVM-DAdHTFWv.js +162 -0
  33. package/dist/client/assets/ganttDiagram-T4ZO3ILL-DrS8W1v-.js +292 -0
  34. package/dist/client/assets/gitGraphDiagram-UUTBAWPF-DtK9J5bd.js +106 -0
  35. package/dist/client/assets/graph-BO_7TUSR.js +1 -0
  36. package/dist/client/assets/index-BE_qBo7x.js +778 -0
  37. package/dist/client/assets/index-DpiDy0Bm.css +1 -0
  38. package/dist/client/assets/infoDiagram-42DDH7IO-C-F87kp2.js +2 -0
  39. package/dist/client/assets/init-Gi6I4Gst.js +1 -0
  40. package/dist/client/assets/ishikawaDiagram-UXIWVN3A-DpaZPVt0.js +70 -0
  41. package/dist/client/assets/journeyDiagram-VCZTEJTY-DLdy6qU_.js +139 -0
  42. package/dist/client/assets/kanban-definition-6JOO6SKY-Cw72R2rP.js +89 -0
  43. package/dist/client/assets/katex-DkKDou_j.js +257 -0
  44. package/dist/client/assets/layout-CVdqBmBb.js +1 -0
  45. package/dist/client/assets/linear-BZWegF8q.js +1 -0
  46. package/dist/client/assets/min-Bc431PrS.js +1 -0
  47. package/dist/client/assets/mindmap-definition-QFDTVHPH-DPQMmeL4.js +96 -0
  48. package/dist/client/assets/ordinal-Cboi1Yqb.js +1 -0
  49. package/dist/client/assets/pieDiagram-DEJITSTG-QjO816qL.js +30 -0
  50. package/dist/client/assets/quadrantDiagram-34T5L4WZ-BDxYyK8x.js +7 -0
  51. package/dist/client/assets/requirementDiagram-MS252O5E-CTRbkAm3.js +84 -0
  52. package/dist/client/assets/sankeyDiagram-XADWPNL6-s1VkzWAg.js +10 -0
  53. package/dist/client/assets/sequenceDiagram-FGHM5R23-UyatbRZw.js +157 -0
  54. package/dist/client/assets/stateDiagram-FHFEXIEX-ClKORA1p.js +1 -0
  55. package/dist/client/assets/stateDiagram-v2-QKLJ7IA2-Cf33alPP.js +1 -0
  56. package/dist/client/assets/timeline-definition-GMOUNBTQ-BaJ6GkFx.js +120 -0
  57. package/dist/client/assets/vennDiagram-DHZGUBPP-C2I2hokK.js +34 -0
  58. package/dist/client/assets/wardley-RL74JXVD-BaYnW9zG.js +162 -0
  59. package/dist/client/assets/wardleyDiagram-NUSXRM2D-lI3b3rv0.js +20 -0
  60. package/dist/client/assets/xychartDiagram-5P7HB3ND-gAPYB-k3.js +7 -0
  61. package/dist/client/favicon.ico +0 -0
  62. package/dist/client/index.html +48 -0
  63. package/dist/client/logo.png +0 -0
  64. package/dist/config.js +117 -0
  65. package/dist/server/api.js +593 -0
  66. package/dist/server/app.js +21 -0
  67. package/dist/server/ignore.js +210 -0
  68. package/dist/server/index.js +116 -0
  69. package/dist/server/watcher.js +62 -0
  70. package/package.json +105 -10
  71. package/index.js +0 -1
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2024 岳晓亮
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,125 @@
1
+ # ColonyNote
2
+
3
+ [简体中文](./README.zh.md) | English
4
+
5
+ A modern Markdown online editor with real-time preview, Mermaid diagrams, and LaTeX support.
6
+
7
+ > **Edit server-side Markdown files** - No upload needed, edit directly in your browser!
8
+
9
+ ## Features
10
+
11
+ - **Server-side Editing** - Edit markdown files on server directly in browser
12
+ - **Real-time Preview** - Live rendering as you type
13
+ - **Mermaid Support** - Render flowcharts, sequence diagrams, Gantt charts, and more
14
+ - **LaTeX Formulas** - Full support for mathematical expressions
15
+ - **Code Highlighting** - Syntax highlighting for various programming languages
16
+ - **Dark Theme** - Follow system preference or manual toggle
17
+ - **Mobile Friendly** - Responsive design optimized for mobile devices
18
+ - **Real-time Sync** - WebSocket-based file change notifications
19
+
20
+ ## Installation
21
+
22
+ ```bash
23
+ npm install -g colonynote
24
+ ```
25
+
26
+ ## Usage
27
+
28
+ ### Start the server
29
+
30
+ ```bash
31
+ colonynote [options]
32
+ ```
33
+
34
+ ### Options
35
+
36
+ | Option | Alias | Description | Default |
37
+ |--------|-------|-------------|---------|
38
+ | `--root` | `-r` | Root directory for documents | Current directory |
39
+ | `--port` | `-p` | Server port | `5787` |
40
+ | `--host` | | Server host | `0.0.0.0` |
41
+ | `--config` | `-c` | Config file path | `colonynote.config.js` |
42
+ | `--help` | `-h` | Show help | |
43
+ | `--version` | | Show version | |
44
+
45
+ ### Examples
46
+
47
+ ```bash
48
+ # Start with default settings
49
+ colonynote
50
+
51
+ # Specify root directory
52
+ colonynote -r /path/to/docs
53
+
54
+ # Specify port
55
+ colonynote -p 3000
56
+
57
+ # Use config file
58
+ colonynote -c ./my-config.js
59
+
60
+ # Combine options
61
+ colonynote -r ./docs -p 8080
62
+ ```
63
+
64
+ ## Configuration
65
+
66
+ Create a `colonynote.config.js` file in your project root:
67
+
68
+ ```javascript
69
+ export default {
70
+ root: './docs', // Root directory for documents
71
+ port: 5787, // Server port
72
+ host: '0.0.0.0', // Server host
73
+ allowedExtensions: ['.md', '.markdown'], // Supported file extensions
74
+ theme: {
75
+ default: 'system', // Theme: light | dark | system
76
+ },
77
+ editor: {
78
+ autosave: true, // Auto save
79
+ debounceMs: 300, // Save debounce delay
80
+ },
81
+ }
82
+ ```
83
+
84
+ ## Development
85
+
86
+ ```bash
87
+ # Clone the repository
88
+ git clone https://github.com/opencolony/note.git
89
+
90
+ # Install dependencies
91
+ npm install
92
+
93
+ # Start development server (backend + frontend with hot reload)
94
+ npm run dev
95
+
96
+ # Frontend only (Vite dev server, port 5787)
97
+ npm run dev:frontend
98
+
99
+ # Backend only (Hono server, port 5788)
100
+ npm run dev:backend
101
+
102
+ # Build for production
103
+ npm run build
104
+
105
+ # Run production build
106
+ npm start
107
+ ```
108
+
109
+ ## Tech Stack
110
+
111
+ - **Backend**: Hono, @hono/node-server, ws (WebSocket)
112
+ - **Frontend**: React 18, Vite, Tailwind CSS v4
113
+ - **UI Components**: shadcn/ui (Radix UI)
114
+ - **Editor**: TipTap 3, tiptap-markdown
115
+ - **Diagrams**: Mermaid
116
+ - **LaTeX**: KaTeX
117
+ - **Icons**: lucide-react
118
+
119
+ ## License
120
+
121
+ MIT
122
+
123
+ ## Author
124
+
125
+ 岳晓亮 <hi@yuexiaoliang.com>
package/README.zh.md ADDED
@@ -0,0 +1,125 @@
1
+ # ColonyNote
2
+
3
+ [English](./README.md) | 简体中文
4
+
5
+ 一个支持实时预览、Mermaid 图表和 LaTeX 公式的 Markdown 在线编辑器。
6
+
7
+ > **在线编辑服务端 Markdown 文件** - 无需上传下载,直接在浏览器中编辑!
8
+
9
+ ## 功能特性
10
+
11
+ - **服务端编辑** - 在浏览器中直接编辑服务器上的 Markdown 文件
12
+ - **实时预览** - 实时渲染输入内容
13
+ - **Mermaid 支持** - 渲染流程图、时序图、甘特图等
14
+ - **LaTeX 公式** - 完整支持数学公式
15
+ - **代码高亮** - 支持多种编程语言的语法高亮
16
+ - **深色主题** - 跟随系统偏好或手动切换
17
+ - **移动端适配** - 响应式设计,适配移动设备
18
+ - **实时同步** - 基于 WebSocket 的文件变更通知
19
+
20
+ ## 安装
21
+
22
+ ```bash
23
+ npm install -g colonynote
24
+ ```
25
+
26
+ ## 使用方法
27
+
28
+ ### 启动服务器
29
+
30
+ ```bash
31
+ colonynote [选项]
32
+ ```
33
+
34
+ ### 选项
35
+
36
+ | 选项 | 别名 | 描述 | 默认值 |
37
+ |------|------|------|--------|
38
+ | `--root` | `-r` | 文档根目录 | 当前目录 |
39
+ | `--port` | `-p` | 服务器端口 | `5787` |
40
+ | `--host` | | 服务器地址 | `0.0.0.0` |
41
+ | `--config` | `-c` | 配置文件路径 | `colonynote.config.js` |
42
+ | `--help` | `-h` | 显示帮助 | |
43
+ | `--version` | | 显示版本 | |
44
+
45
+ ### 示例
46
+
47
+ ```bash
48
+ # 使用默认设置启动
49
+ colonynote
50
+
51
+ # 指定根目录
52
+ colonynote -r /path/to/docs
53
+
54
+ # 指定端口
55
+ colonynote -p 3000
56
+
57
+ # 使用配置文件
58
+ colonynote -c ./my-config.js
59
+
60
+ # 组合选项
61
+ colonynote -r ./docs -p 8080
62
+ ```
63
+
64
+ ## 配置
65
+
66
+ 在项目根目录创建 `colonynote.config.js` 文件:
67
+
68
+ ```javascript
69
+ export default {
70
+ root: './docs', // 文档根目录
71
+ port: 5787, // 服务器端口
72
+ host: '0.0.0.0', // 服务器地址
73
+ allowedExtensions: ['.md', '.markdown'], // 支持的文件扩展名
74
+ theme: {
75
+ default: 'system', // 主题:light | dark | system
76
+ },
77
+ editor: {
78
+ autosave: true, // 自动保存
79
+ debounceMs: 300, // 保存防抖延迟
80
+ },
81
+ }
82
+ ```
83
+
84
+ ## 开发
85
+
86
+ ```bash
87
+ # 克隆仓库
88
+ git clone https://github.com/opencolony/note.git
89
+
90
+ # 安装依赖
91
+ npm install
92
+
93
+ # 启动开发服务器(后端 + 前端热更新)
94
+ npm run dev
95
+
96
+ # 仅前端开发(Vite 开发服务器,端口 5787)
97
+ npm run dev:frontend
98
+
99
+ # 仅后端开发(Hono 服务器,端口 5788)
100
+ npm run dev:backend
101
+
102
+ # 构建生产版本
103
+ npm run build
104
+
105
+ # 运行生产版本
106
+ npm start
107
+ ```
108
+
109
+ ## 技术栈
110
+
111
+ - **后端**: Hono, @hono/node-server, ws (WebSocket)
112
+ - **前端**: React 18, Vite, Tailwind CSS v4
113
+ - **UI 组件**: shadcn/ui (Radix UI)
114
+ - **编辑器**: TipTap 3, tiptap-markdown
115
+ - **图表**: Mermaid
116
+ - **LaTeX 公式**: KaTeX
117
+ - **图标**: lucide-react
118
+
119
+ ## 许可证
120
+
121
+ MIT
122
+
123
+ ## 作者
124
+
125
+ 岳晓亮 <hi@yuexiaoliang.com>
@@ -0,0 +1,148 @@
1
+ #!/usr/bin/env node
2
+
3
+ import { serve } from '@hono/node-server'
4
+ import { Hono } from 'hono'
5
+ import { cors } from 'hono/cors'
6
+ import { createFileRouter } from '../dist/server/api.js'
7
+ import { loadConfig, DEFAULT_PORT, DEFAULT_HOST } from '../dist/config.js'
8
+ import { setupWatcher } from '../dist/server/watcher.js'
9
+ import { IgnoreMatcher } from '../dist/server/ignore.js'
10
+ import { WebSocketServer, WebSocket } from 'ws'
11
+ import { readFileSync, existsSync } from 'fs'
12
+ import { fileURLToPath } from 'url'
13
+ import { dirname, join, extname } from 'path'
14
+ import { Command } from 'commander'
15
+
16
+ const __filename = fileURLToPath(import.meta.url)
17
+ const __dirname = dirname(__filename)
18
+ const pkg = JSON.parse(readFileSync(join(__dirname, '../package.json'), 'utf-8'))
19
+
20
+ const program = new Command()
21
+
22
+ program
23
+ .name('colonynote')
24
+ .description('Markdown online editor')
25
+ .version(pkg.version)
26
+ .option('-r, --root <path>', 'Root directory (can be specified multiple times)', collect, [])
27
+ .option('-p, --port <number>', 'Server port', DEFAULT_PORT.toString())
28
+ .option('--host <host>', 'Server host', DEFAULT_HOST)
29
+ .parse()
30
+
31
+ const options = program.opts()
32
+
33
+ function collect(value, previous) {
34
+ return previous.concat([value])
35
+ }
36
+
37
+ async function main() {
38
+ const config = await loadConfig()
39
+
40
+ // CLI --root adds to config.roots (temporary, not saved)
41
+ if (options.root && options.root.length > 0) {
42
+ for (const rootPath of options.root) {
43
+ config.roots.push({ path: rootPath })
44
+ }
45
+ }
46
+
47
+ const port = parseInt(options.port, 10)
48
+ const host = options.host
49
+
50
+ const matcher = new IgnoreMatcher(config.roots[0]?.path || process.cwd(), {
51
+ enableIgnoreFiles: config.ignore.enableIgnoreFiles,
52
+ ignoreFileNames: config.ignore.ignoreFileNames,
53
+ globalPatterns: config.ignore.patterns,
54
+ })
55
+
56
+ const app = new Hono()
57
+ app.use('*', cors())
58
+
59
+ const fileRouter = createFileRouter(config, matcher)
60
+ app.route('/api/files', fileRouter)
61
+
62
+ const publicDir = join(dirname(fileURLToPath(import.meta.url)), '../dist/client')
63
+
64
+ app.get('/assets/*', async (c) => {
65
+ const filePath = c.req.path.replace('/assets', '')
66
+ const fullPath = join(publicDir, 'assets', filePath)
67
+ if (!existsSync(fullPath)) {
68
+ return c.notFound()
69
+ }
70
+ const content = readFileSync(fullPath)
71
+ const ext = extname(filePath)
72
+ const contentType = ext === '.js' ? 'application/javascript' : ext === '.css' ? 'text/css' : 'text/plain'
73
+ return new Response(content, { headers: { 'Content-Type': contentType } })
74
+ })
75
+
76
+ app.get('/logo.png', async (c) => {
77
+ const fullPath = join(publicDir, 'logo.png')
78
+ if (!existsSync(fullPath)) {
79
+ return c.notFound()
80
+ }
81
+ const content = readFileSync(fullPath)
82
+ return new Response(content, { headers: { 'Content-Type': 'image/png' } })
83
+ })
84
+
85
+ app.get('/favicon.ico', async (c) => {
86
+ const fullPath = join(publicDir, 'favicon.ico')
87
+ if (!existsSync(fullPath)) {
88
+ return c.notFound()
89
+ }
90
+ const content = readFileSync(fullPath)
91
+ return new Response(content, { headers: { 'Content-Type': 'image/x-icon' } })
92
+ })
93
+
94
+ app.get('*', async (c) => {
95
+ const indexPath = join(publicDir, 'index.html')
96
+ if (existsSync(indexPath)) {
97
+ const content = readFileSync(indexPath, 'utf-8')
98
+ return new Response(content, {
99
+ headers: { 'Content-Type': 'text/html' },
100
+ })
101
+ }
102
+ return c.notFound()
103
+ })
104
+
105
+ const server = serve({
106
+ fetch: app.fetch,
107
+ port,
108
+ hostname: host,
109
+ })
110
+
111
+ const clients = new Set()
112
+ const wss = new WebSocketServer({ noServer: true })
113
+
114
+ wss.on('connection', (ws) => {
115
+ clients.add(ws)
116
+ ws.on('close', () => clients.delete(ws))
117
+ })
118
+
119
+ server.on('upgrade', (request, socket, head) => {
120
+ if (request.url === '/ws') {
121
+ wss.handleUpgrade(request, socket, head, (ws) => {
122
+ wss.emit('connection', ws, request)
123
+ })
124
+ }
125
+ })
126
+
127
+ setupWatcher(config, matcher, {
128
+ onFileChange: (rootPath, event, filePath) => {
129
+ const relativePath = filePath.replace(rootPath, '')
130
+ const message = JSON.stringify({ type: 'file:change', event, path: relativePath, rootPath })
131
+ clients.forEach((client) => {
132
+ if (client.readyState === WebSocket.OPEN) {
133
+ client.send(message)
134
+ }
135
+ })
136
+ },
137
+ })
138
+
139
+ console.log(`\n ColonyNote is running!\n`)
140
+ console.log(` Local: http://localhost:${port}`)
141
+ console.log(` Network: http://${host}:${port}`)
142
+ console.log(` Roots: ${config.roots.map(r => r.path).join(', ')}\n`)
143
+ }
144
+
145
+ main().catch((e) => {
146
+ console.error('Failed to start:', e)
147
+ process.exit(1)
148
+ })
@@ -0,0 +1 @@
1
+ const e={};export{e as default};
@@ -0,0 +1 @@
1
+ import{aY as L,bu as ln,aH as A,aW as P,aG as W,bv as gn,bw as dn,bx as hn,by as z,bz as pn,bp as An,bA as m,aZ as N,b2 as B,b5 as T,bB as _n,b0 as on,bC as wn,bs as On,aI as V,bq as vn,bD as R}from"./index-BE_qBo7x.js";var Pn="[object Symbol]";function x(n){return typeof n=="symbol"||L(n)&&ln(n)==Pn}function bn(n,r){for(var e=-1,i=n==null?0:n.length,f=Array(i);++e<i;)f[e]=r(n[e],e,n);return f}var U=P?P.prototype:void 0,H=U?U.toString:void 0;function k(n){if(typeof n=="string")return n;if(A(n))return bn(n,k)+"";if(x(n))return H?H.call(n):"";var r=n+"";return r=="0"&&1/n==-1/0?"-0":r}function yn(){}function En(n,r){for(var e=-1,i=n==null?0:n.length;++e<i&&r(n[e],e,n)!==!1;);return n}function cn(n,r,e,i){for(var f=n.length,t=e+-1;++t<f;)if(r(n[t],t,n))return t;return-1}function Tn(n){return n!==n}function In(n,r,e){for(var i=e-1,f=n.length;++i<f;)if(n[i]===r)return i;return-1}function Rn(n,r,e){return r===r?In(n,r,e):cn(n,Tn,e)}function Sn(n,r){var e=n==null?0:n.length;return!!e&&Rn(n,r,0)>-1}function M(n){return W(n)?gn(n):dn(n)}var Ln=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,xn=/^\w*$/;function C(n,r){if(A(n))return!1;var e=typeof n;return e=="number"||e=="symbol"||e=="boolean"||n==null||x(n)?!0:xn.test(n)||!Ln.test(n)||r!=null&&n in Object(r)}var Mn=500;function Cn(n){var r=hn(n,function(i){return e.size===Mn&&e.clear(),i}),e=r.cache;return r}var $n=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Dn=/\\(\\)?/g,Gn=Cn(function(n){var r=[];return n.charCodeAt(0)===46&&r.push(""),n.replace($n,function(e,i,f,t){r.push(f?t.replace(Dn,"$1"):i||e)}),r});function Fn(n){return n==null?"":k(n)}function j(n,r){return A(n)?n:C(n,r)?[n]:Gn(Fn(n))}function I(n){if(typeof n=="string"||x(n))return n;var r=n+"";return r=="0"&&1/n==-1/0?"-0":r}function nn(n,r){r=j(r,n);for(var e=0,i=r.length;n!=null&&e<i;)n=n[I(r[e++])];return e&&e==i?n:void 0}function mn(n,r,e){var i=n==null?void 0:nn(n,r);return i===void 0?e:i}function rn(n,r){for(var e=-1,i=r.length,f=n.length;++e<i;)n[f+e]=r[e];return n}var K=P?P.isConcatSpreadable:void 0;function Nn(n){return A(n)||z(n)||!!(K&&n&&n[K])}function Kr(n,r,e,i,f){var t=-1,s=n.length;for(e||(e=Nn),f||(f=[]);++t<s;){var u=n[t];e(u)?rn(f,u):i||(f[f.length]=u)}return f}function Bn(n,r,e,i){var f=-1,t=n==null?0:n.length;for(i&&t&&(e=n[++f]);++f<t;)e=r(e,n[f],f,n);return e}function en(n,r){for(var e=-1,i=n==null?0:n.length,f=0,t=[];++e<i;){var s=n[e];r(s,e,n)&&(t[f++]=s)}return t}function Un(){return[]}var Hn=Object.prototype,Kn=Hn.propertyIsEnumerable,q=Object.getOwnPropertySymbols,qn=q?function(n){return n==null?[]:(n=Object(n),en(q(n),function(r){return Kn.call(n,r)}))}:Un;function Zn(n,r,e){var i=r(n);return A(n)?i:rn(i,e(n))}function Z(n){return Zn(n,M,qn)}var Yn="__lodash_hash_undefined__";function Xn(n){return this.__data__.set(n,Yn),this}function Jn(n){return this.__data__.has(n)}function b(n){var r=-1,e=n==null?0:n.length;for(this.__data__=new pn;++r<e;)this.add(n[r])}b.prototype.add=b.prototype.push=Xn;b.prototype.has=Jn;function Qn(n,r){for(var e=-1,i=n==null?0:n.length;++e<i;)if(r(n[e],e,n))return!0;return!1}function tn(n,r){return n.has(r)}var Wn=1,zn=2;function fn(n,r,e,i,f,t){var s=e&Wn,u=n.length,a=r.length;if(u!=a&&!(s&&a>u))return!1;var h=t.get(n),g=t.get(r);if(h&&g)return h==r&&g==n;var l=-1,d=!0,o=e&zn?new b:void 0;for(t.set(n,r),t.set(r,n);++l<u;){var p=n[l],_=r[l];if(i)var w=s?i(_,p,l,r,n,t):i(p,_,l,n,r,t);if(w!==void 0){if(w)continue;d=!1;break}if(o){if(!Qn(r,function(O,v){if(!tn(o,v)&&(p===O||f(p,O,e,i,t)))return o.push(v)})){d=!1;break}}else if(!(p===_||f(p,_,e,i,t))){d=!1;break}}return t.delete(n),t.delete(r),d}function Vn(n){var r=-1,e=Array(n.size);return n.forEach(function(i,f){e[++r]=[f,i]}),e}function $(n){var r=-1,e=Array(n.size);return n.forEach(function(i){e[++r]=i}),e}var kn=1,jn=2,nr="[object Boolean]",rr="[object Date]",er="[object Error]",ir="[object Map]",tr="[object Number]",fr="[object RegExp]",sr="[object Set]",ur="[object String]",ar="[object Symbol]",lr="[object ArrayBuffer]",gr="[object DataView]",Y=P?P.prototype:void 0,S=Y?Y.valueOf:void 0;function dr(n,r,e,i,f,t,s){switch(e){case gr:if(n.byteLength!=r.byteLength||n.byteOffset!=r.byteOffset)return!1;n=n.buffer,r=r.buffer;case lr:return!(n.byteLength!=r.byteLength||!t(new m(n),new m(r)));case nr:case rr:case tr:return An(+n,+r);case er:return n.name==r.name&&n.message==r.message;case fr:case ur:return n==r+"";case ir:var u=Vn;case sr:var a=i&kn;if(u||(u=$),n.size!=r.size&&!a)return!1;var h=s.get(n);if(h)return h==r;i|=jn,s.set(n,r);var g=fn(u(n),u(r),i,f,t,s);return s.delete(n),g;case ar:if(S)return S.call(n)==S.call(r)}return!1}var hr=1,pr=Object.prototype,Ar=pr.hasOwnProperty;function _r(n,r,e,i,f,t){var s=e&hr,u=Z(n),a=u.length,h=Z(r),g=h.length;if(a!=g&&!s)return!1;for(var l=a;l--;){var d=u[l];if(!(s?d in r:Ar.call(r,d)))return!1}var o=t.get(n),p=t.get(r);if(o&&p)return o==r&&p==n;var _=!0;t.set(n,r),t.set(r,n);for(var w=s;++l<a;){d=u[l];var O=n[d],v=r[d];if(i)var F=s?i(v,O,d,r,n,t):i(O,v,d,n,r,t);if(!(F===void 0?O===v||f(O,v,e,i,t):F)){_=!1;break}w||(w=d=="constructor")}if(_&&!w){var y=n.constructor,E=r.constructor;y!=E&&"constructor"in n&&"constructor"in r&&!(typeof y=="function"&&y instanceof y&&typeof E=="function"&&E instanceof E)&&(_=!1)}return t.delete(n),t.delete(r),_}var or=1,X="[object Arguments]",J="[object Array]",c="[object Object]",wr=Object.prototype,Q=wr.hasOwnProperty;function Or(n,r,e,i,f,t){var s=A(n),u=A(r),a=s?J:N(n),h=u?J:N(r);a=a==X?c:a,h=h==X?c:h;var g=a==c,l=h==c,d=a==h;if(d&&B(n)){if(!B(r))return!1;s=!0,g=!1}if(d&&!g)return t||(t=new T),s||_n(n)?fn(n,r,e,i,f,t):dr(n,r,a,e,i,f,t);if(!(e&or)){var o=g&&Q.call(n,"__wrapped__"),p=l&&Q.call(r,"__wrapped__");if(o||p){var _=o?n.value():n,w=p?r.value():r;return t||(t=new T),f(_,w,e,i,t)}}return d?(t||(t=new T),_r(n,r,e,i,f,t)):!1}function D(n,r,e,i,f){return n===r?!0:n==null||r==null||!L(n)&&!L(r)?n!==n&&r!==r:Or(n,r,e,i,D,f)}var vr=1,Pr=2;function br(n,r,e,i){var f=e.length,t=f;if(n==null)return!t;for(n=Object(n);f--;){var s=e[f];if(s[2]?s[1]!==n[s[0]]:!(s[0]in n))return!1}for(;++f<t;){s=e[f];var u=s[0],a=n[u],h=s[1];if(s[2]){if(a===void 0&&!(u in n))return!1}else{var g=new T,l;if(!(l===void 0?D(h,a,vr|Pr,i,g):l))return!1}}return!0}function sn(n){return n===n&&!on(n)}function yr(n){for(var r=M(n),e=r.length;e--;){var i=r[e],f=n[i];r[e]=[i,f,sn(f)]}return r}function un(n,r){return function(e){return e==null?!1:e[n]===r&&(r!==void 0||n in Object(e))}}function Er(n){var r=yr(n);return r.length==1&&r[0][2]?un(r[0][0],r[0][1]):function(e){return e===n||br(e,n,r)}}function cr(n,r){return n!=null&&r in Object(n)}function Tr(n,r,e){r=j(r,n);for(var i=-1,f=r.length,t=!1;++i<f;){var s=I(r[i]);if(!(t=n!=null&&e(n,s)))break;n=n[s]}return t||++i!=f?t:(f=n==null?0:n.length,!!f&&wn(f)&&On(s,f)&&(A(n)||z(n)))}function Ir(n,r){return n!=null&&Tr(n,r,cr)}var Rr=1,Sr=2;function Lr(n,r){return C(n)&&sn(r)?un(I(n),r):function(e){var i=mn(e,n);return i===void 0&&i===r?Ir(e,n):D(r,i,Rr|Sr)}}function xr(n){return function(r){return r==null?void 0:r[n]}}function Mr(n){return function(r){return nn(r,n)}}function Cr(n){return C(n)?xr(I(n)):Mr(n)}function an(n){return typeof n=="function"?n:n==null?V:typeof n=="object"?A(n)?Lr(n[0],n[1]):Er(n):Cr(n)}function $r(n,r){return n&&vn(n,r,M)}function Dr(n,r){return function(e,i){if(e==null)return e;if(!W(e))return n(e,i);for(var f=e.length,t=-1,s=Object(e);++t<f&&i(s[t],t,s)!==!1;);return e}}var G=Dr($r);function Gr(n){return typeof n=="function"?n:V}function qr(n,r){var e=A(n)?En:G;return e(n,Gr(r))}function Fr(n,r){var e=[];return G(n,function(i,f,t){r(i,f,t)&&e.push(i)}),e}function Zr(n,r){var e=A(n)?en:Fr;return e(n,an(r))}function mr(n,r,e,i,f){return f(n,function(t,s,u){e=i?(i=!1,t):r(e,t,s,u)}),e}function Yr(n,r,e){var i=A(n)?Bn:mr,f=arguments.length<3;return i(n,an(r),e,f,G)}var Nr=1/0,Br=R&&1/$(new R([,-0]))[1]==Nr?function(n){return new R(n)}:yn,Ur=200;function Xr(n,r,e){var i=-1,f=Sn,t=n.length,s=!0,u=[],a=u;if(t>=Ur){var h=r?null:Br(n);if(h)return $(h);s=!1,f=tn,a=new b}else a=r?[]:u;n:for(;++i<t;){var g=n[i],l=r?r(g):g;if(g=g!==0?g:0,s&&l===l){for(var d=a.length;d--;)if(a[d]===l)continue n;r&&a.push(l),u.push(g)}else f(a,l,e)||(a!==u&&a.push(l),u.push(g))}return u}export{G as a,Kr as b,an as c,bn as d,rn as e,Zn as f,qn as g,En as h,x as i,Z as j,M as k,Xr as l,Zr as m,qr as n,cn as o,Gr as p,$r as q,Yr as r,Un as s,Tr as t,j as u,I as v,nn as w,Ir as x,Fn as y};
@@ -0,0 +1 @@
1
+ import{a0 as ln,a1 as an,a2 as y,a3 as tn,a4 as H,a5 as q,a6 as _,a7 as un,a8 as rn,a9 as L,aa as o,ab as B,ac as sn,ad as on,ae as fn}from"./index-BE_qBo7x.js";function cn(l){return l.innerRadius}function yn(l){return l.outerRadius}function gn(l){return l.startAngle}function dn(l){return l.endAngle}function mn(l){return l&&l.padAngle}function pn(l,h,I,D,v,A,C,a){var O=I-l,i=D-h,n=C-v,d=a-A,u=d*O-n*i;if(!(u*u<y))return u=(n*(h-A)-d*(l-v))/u,[l+u*O,h+u*i]}function W(l,h,I,D,v,A,C){var a=l-I,O=h-D,i=(C?A:-A)/L(a*a+O*O),n=i*O,d=-i*a,u=l+n,s=h+d,f=I+n,c=D+d,F=(u+f)/2,t=(s+c)/2,m=f-u,g=c-s,R=m*m+g*g,T=v-A,P=u*c-f*s,S=(g<0?-1:1)*L(fn(0,T*T*R-P*P)),j=(P*g-m*S)/R,z=(-P*m-g*S)/R,w=(P*g+m*S)/R,p=(-P*m+g*S)/R,x=j-F,e=z-t,r=w-F,G=p-t;return x*x+e*e>r*r+G*G&&(j=w,z=p),{cx:j,cy:z,x01:-n,y01:-d,x11:j*(v/T-1),y11:z*(v/T-1)}}function hn(){var l=cn,h=yn,I=B(0),D=null,v=gn,A=dn,C=mn,a=null,O=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,F=un(c-f),t=c>f;if(a||(a=n=O()),s<u&&(d=s,s=u,u=d),!(s>y))a.moveTo(0,0);else if(F>tn-y)a.moveTo(s*H(f),s*q(f)),a.arc(0,0,s,f,c,!t),u>y&&(a.moveTo(u*H(c),u*q(c)),a.arc(0,0,u,c,f,t));else{var m=f,g=c,R=f,T=c,P=F,S=F,j=C.apply(this,arguments)/2,z=j>y&&(D?+D.apply(this,arguments):L(u*u+s*s)),w=_(un(s-u)/2,+I.apply(this,arguments)),p=w,x=w,e,r;if(z>y){var G=sn(z/u*q(j)),M=sn(z/s*q(j));(P-=G*2)>y?(G*=t?1:-1,R+=G,T-=G):(P=0,R=T=(f+c)/2),(S-=M*2)>y?(M*=t?1:-1,m+=M,g-=M):(S=0,m=g=(f+c)/2)}var J=s*H(m),K=s*q(m),N=u*H(T),Q=u*q(T);if(w>y){var U=s*H(g),V=s*q(g),X=u*H(R),Y=u*q(R),E;if(F<rn)if(E=pn(J,K,X,Y,U,V,N,Q)){var Z=J-E[0],$=K-E[1],b=U-E[0],k=V-E[1],nn=1/q(on((Z*b+$*k)/(L(Z*Z+$*$)*L(b*b+k*k)))/2),en=L(E[0]*E[0]+E[1]*E[1]);p=_(w,(u-en)/(nn-1)),x=_(w,(s-en)/(nn+1))}else p=x=0}S>y?x>y?(e=W(X,Y,J,K,s,x,t),r=W(U,V,N,Q,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(J,K),a.arc(0,0,s,m,g,!t)):a.moveTo(J,K),!(u>y)||!(P>y)?a.lineTo(N,Q):p>y?(e=W(N,Q,U,V,u,-p,t),r=W(J,K,X,Y,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[H(d)*n,q(d)*n]},i.innerRadius=function(n){return arguments.length?(l=typeof n=="function"?n:B(+n),i):l},i.outerRadius=function(n){return arguments.length?(h=typeof n=="function"?n:B(+n),i):h},i.cornerRadius=function(n){return arguments.length?(I=typeof n=="function"?n:B(+n),i):I},i.padRadius=function(n){return arguments.length?(D=n==null?null:typeof n=="function"?n:B(+n),i):D},i.startAngle=function(n){return arguments.length?(v=typeof n=="function"?n:B(+n),i):v},i.endAngle=function(n){return arguments.length?(A=typeof n=="function"?n:B(+n),i):A},i.padAngle=function(n){return arguments.length?(C=typeof n=="function"?n:B(+n),i):C},i.context=function(n){return arguments.length?(a=n??null,i):a},i}export{hn as d};