colonynote 1.0.0-beta.8 → 1.0.0
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.
- package/README.md +6 -6
- package/README.zh.md +6 -6
- package/bin/colonynote.js +48 -81
- package/dist/client/assets/arc-Ezd9GmKE.js +1 -0
- package/dist/client/assets/architecture-YZFGNWBL-Dns9u0e5.js +1 -0
- package/dist/client/assets/architectureDiagram-Q4EWVU46-BmLJotd1.js +36 -0
- package/dist/client/assets/array-C0548cPn.js +1 -0
- package/dist/client/assets/blockDiagram-DXYQGD6D-ZqrNO8HM.js +132 -0
- package/dist/client/assets/c4Diagram-AHTNJAMY-BJWyymhT.js +10 -0
- package/dist/client/assets/channel-C-zEXS3V.js +1 -0
- package/dist/client/assets/chunk-2KRD3SAO-B1G2AY6H.js +1 -0
- package/dist/client/assets/chunk-4BX2VUAB-mLNpdiNK.js +1 -0
- package/dist/client/assets/chunk-4TB4RGXK-BsRi3qra.js +206 -0
- package/dist/client/assets/chunk-55IACEB6-BkCqG_Mc.js +1 -0
- package/dist/client/assets/chunk-67CJDMHE-Cz-mqdi4.js +1 -0
- package/dist/client/assets/chunk-7N4EOEYR-BFd0Oy6w.js +1 -0
- package/dist/client/assets/chunk-AA7GKIK3-D77gJjH7.js +1 -0
- package/dist/client/assets/chunk-CIAEETIT-DxQTGSBH.js +1 -0
- package/dist/client/assets/chunk-Dlc7tRH4.js +1 -0
- package/dist/client/assets/chunk-EDXVE4YY-DglU8MxC.js +1 -0
- package/dist/client/assets/{chunk-FMBD7UC4-aAnHvYnB.js → chunk-FMBD7UC4-B_1_v8GP.js} +2 -2
- package/dist/client/assets/chunk-FOC6F5B3-CEMl5H_U.js +1 -0
- package/dist/client/assets/chunk-K5T4RW27-Dzh5Xx8O.js +94 -0
- package/dist/client/assets/chunk-KGLVRYIC-Be2dMs_W.js +1 -0
- package/dist/client/assets/chunk-LIHQZDEY-BGBWPKdn.js +1 -0
- package/dist/client/assets/chunk-ORNJ4GCN-W_NT507t.js +1 -0
- package/dist/client/assets/chunk-OYMX7WX6-BV6RCL_j.js +231 -0
- package/dist/client/assets/chunk-QZHKN3VN-B0CMV9NG.js +1 -0
- package/dist/client/assets/chunk-YZCP3GAM-CDitFgw3.js +1 -0
- package/dist/client/assets/classDiagram-6PBFFD2Q-XeqY_hie.js +1 -0
- package/dist/client/assets/classDiagram-v2-HSJHXN6E-D5yY32qd.js +1 -0
- package/dist/client/assets/clone-AnN0418d.js +1 -0
- package/dist/client/assets/cose-bilkent-S5V4N54A-YQtZwRYb.js +1 -0
- package/dist/client/assets/cytoscape.esm-DT0IEibP.js +321 -0
- package/dist/client/assets/dagre-Cs_hK0RA.js +1 -0
- package/dist/client/assets/dagre-KV5264BT-DvMqAy8J.js +4 -0
- package/dist/client/assets/defaultLocale-ClcAPJ5U.js +1 -0
- package/dist/client/assets/diagram-5BDNPKRD-BwrN8bUG.js +10 -0
- package/dist/client/assets/diagram-G4DWMVQ6-Cqaj-jnn.js +24 -0
- package/dist/client/assets/diagram-MMDJMWI5-DNA312HK.js +43 -0
- package/dist/client/assets/diagram-TYMM5635-BujcYOHW.js +24 -0
- package/dist/client/assets/erDiagram-SMLLAGMA-ZjZZH-zN.js +85 -0
- package/dist/client/assets/flatten-DA7ZzNkq.js +1 -0
- package/dist/client/assets/flowDiagram-DWJPFMVM-CeIGHswO.js +162 -0
- package/dist/client/assets/ganttDiagram-T4ZO3ILL-BeGMFmHq.js +292 -0
- package/dist/client/assets/gitGraph-7Q5UKJZL-Dib3-KZp.js +1 -0
- package/dist/client/assets/gitGraphDiagram-UUTBAWPF-2fnUKQRp.js +106 -0
- package/dist/client/assets/graphlib-DRri47Ms.js +1 -0
- package/dist/client/assets/identity-CQcu21F9.js +1 -0
- package/dist/client/assets/index-DKyd5iCm.css +2 -0
- package/dist/client/assets/index-Ts5WhtRB.js +574 -0
- package/dist/client/assets/info-OMHHGYJF-oQ5--hGK.js +1 -0
- package/dist/client/assets/infoDiagram-42DDH7IO-KL_uq6JQ.js +2 -0
- package/dist/client/assets/init-TU6eJ00_.js +1 -0
- package/dist/client/assets/ishikawaDiagram-UXIWVN3A-DYWG2VdA.js +70 -0
- package/dist/client/assets/journeyDiagram-VCZTEJTY-DT7IVz7z.js +139 -0
- package/dist/client/assets/kanban-definition-6JOO6SKY-CHPPLj8n.js +89 -0
- package/dist/client/assets/katex-HOUACuRw.js +257 -0
- package/dist/client/assets/linear-CizMozZt.js +1 -0
- package/dist/client/assets/mermaid-parser.core-Bpqvb2jv.js +4 -0
- package/dist/client/assets/mindmap-definition-QFDTVHPH-Dov77gi8.js +96 -0
- package/dist/client/assets/ordinal-DCsgWfZW.js +1 -0
- package/dist/client/assets/packet-4T2RLAQJ-Cuyyn0tM.js +1 -0
- package/dist/client/assets/path-yo4Xej8w.js +1 -0
- package/dist/client/assets/pie-ZZUOXDRM-DajTPYmY.js +1 -0
- package/dist/client/assets/pieDiagram-DEJITSTG-DwmqzTu7.js +30 -0
- package/dist/client/assets/quadrantDiagram-34T5L4WZ-CdCBXbvb.js +7 -0
- package/dist/client/assets/radar-PYXPWWZC-DWe78GFc.js +1 -0
- package/dist/client/assets/reduce-DV5GRzs4.js +1 -0
- package/dist/client/assets/requirementDiagram-MS252O5E-32eCbPFl.js +84 -0
- package/dist/client/assets/rough.esm-DulVNktb.js +1 -0
- package/dist/client/assets/sankeyDiagram-XADWPNL6-BBDL_wPZ.js +10 -0
- package/dist/client/assets/sequenceDiagram-FGHM5R23-Ck7ukfb7.js +157 -0
- package/dist/client/assets/stateDiagram-FHFEXIEX-BKJrixhp.js +1 -0
- package/dist/client/assets/stateDiagram-v2-QKLJ7IA2-Bio1QBYF.js +1 -0
- package/dist/client/assets/timeline-definition-GMOUNBTQ-B_D-q7Kc.js +120 -0
- package/dist/client/assets/treeView-SZITEDCU-BQ27_5HI.js +1 -0
- package/dist/client/assets/treemap-W4RFUUIX-D2TpEq--.js +1 -0
- package/dist/client/assets/vennDiagram-DHZGUBPP-CvHqv3h2.js +34 -0
- package/dist/client/assets/wardley-RL74JXVD-DoAmhKVb.js +1 -0
- package/dist/client/assets/wardleyDiagram-NUSXRM2D-CYRpN4xk.js +20 -0
- package/dist/client/assets/xychartDiagram-5P7HB3ND-Dh0MaaMp.js +7 -0
- package/dist/client/index.html +7 -2
- package/dist/config.js +122 -52
- package/dist/server/api.js +637 -31
- package/dist/server/ignore.js +221 -0
- package/dist/server/index.js +78 -24
- package/dist/server/search-ignore.test.js +51 -0
- package/dist/server/watcher.js +54 -18
- package/package.json +16 -16
- package/dist/client/assets/__vite-browser-external-BIHI7g3E.js +0 -1
- package/dist/client/assets/_basePickBy-COW6_o5l.js +0 -1
- package/dist/client/assets/_baseUniq-BZLZ0Cq5.js +0 -1
- package/dist/client/assets/arc-ChrJd4LX.js +0 -1
- package/dist/client/assets/architectureDiagram-2XIMDMQ5-DUvtAUqm.js +0 -36
- package/dist/client/assets/blockDiagram-WCTKOSBZ-CZjHlzLw.js +0 -132
- package/dist/client/assets/c4Diagram-IC4MRINW-Bb4QcjBn.js +0 -10
- package/dist/client/assets/channel-Kq606-yO.js +0 -1
- package/dist/client/assets/chunk-4BX2VUAB-U2gnuzht.js +0 -1
- package/dist/client/assets/chunk-55IACEB6-DDf5FyZA.js +0 -1
- package/dist/client/assets/chunk-JSJVCQXG-95g2NCsz.js +0 -1
- package/dist/client/assets/chunk-KX2RTZJC-Uw77DOxq.js +0 -1
- package/dist/client/assets/chunk-NQ4KR5QH-CEtk7AxS.js +0 -220
- package/dist/client/assets/chunk-QZHKN3VN-CxHNihbm.js +0 -1
- package/dist/client/assets/chunk-WL4C6EOR-YWnktay4.js +0 -189
- package/dist/client/assets/classDiagram-VBA2DB6C-Bgw-akZn.js +0 -1
- package/dist/client/assets/classDiagram-v2-RAHNMMFH-Bgw-akZn.js +0 -1
- package/dist/client/assets/clone-DXEvmIA_.js +0 -1
- package/dist/client/assets/cose-bilkent-S5V4N54A-BcT_Pp_t.js +0 -1
- package/dist/client/assets/cytoscape.esm-BQaXIfA_.js +0 -331
- package/dist/client/assets/dagre-KLK3FWXG-DfkYqpYp.js +0 -4
- package/dist/client/assets/defaultLocale-DX6XiGOO.js +0 -1
- package/dist/client/assets/diagram-E7M64L7V-kzGsyL8B.js +0 -24
- package/dist/client/assets/diagram-IFDJBPK2-DK7bXX4F.js +0 -43
- package/dist/client/assets/diagram-P4PSJMXO-z9xCBdYx.js +0 -24
- package/dist/client/assets/erDiagram-INFDFZHY-D7a5C5o_.js +0 -70
- package/dist/client/assets/flowDiagram-PKNHOUZH-DqBsAGYI.js +0 -162
- package/dist/client/assets/ganttDiagram-A5KZAMGK-CytDHso0.js +0 -292
- package/dist/client/assets/gitGraphDiagram-K3NZZRJ6-C_xN53WG.js +0 -65
- package/dist/client/assets/graph-CZtfE55r.js +0 -1
- package/dist/client/assets/index-AcpT_uDS.css +0 -1
- package/dist/client/assets/index-Ci71-3A2.js +0 -705
- package/dist/client/assets/infoDiagram-LFFYTUFH-JmJVtb4-.js +0 -2
- package/dist/client/assets/init-Gi6I4Gst.js +0 -1
- package/dist/client/assets/ishikawaDiagram-PHBUUO56-BZLBgU5l.js +0 -70
- package/dist/client/assets/journeyDiagram-4ABVD52K-Bso62bBS.js +0 -139
- package/dist/client/assets/kanban-definition-K7BYSVSG-D9jsFbIS.js +0 -89
- package/dist/client/assets/katex-B1X10hvy.js +0 -261
- package/dist/client/assets/layout-Db-5vCEZ.js +0 -1
- package/dist/client/assets/linear-DdXT-poy.js +0 -1
- package/dist/client/assets/mindmap-definition-YRQLILUH-DUpkjOn4.js +0 -68
- package/dist/client/assets/ordinal-Cboi1Yqb.js +0 -1
- package/dist/client/assets/pieDiagram-SKSYHLDU-BTseg5zx.js +0 -30
- package/dist/client/assets/quadrantDiagram-337W2JSQ-Cf86XD1_.js +0 -7
- package/dist/client/assets/requirementDiagram-Z7DCOOCP-BK2yRQcz.js +0 -73
- package/dist/client/assets/sankeyDiagram-WA2Y5GQK-jBbEn6rj.js +0 -10
- package/dist/client/assets/sequenceDiagram-2WXFIKYE-qg69rBRP.js +0 -145
- package/dist/client/assets/stateDiagram-RAJIS63D-BFIxDKEY.js +0 -1
- package/dist/client/assets/stateDiagram-v2-FVOUBMTO-DYqLkNfp.js +0 -1
- package/dist/client/assets/timeline-definition-YZTLITO2-B17QFyRY.js +0 -61
- package/dist/client/assets/treemap-KZPCXAKY-CGSXpgHF.js +0 -162
- package/dist/client/assets/vennDiagram-LZ73GAT5-mbh453Lq.js +0 -34
- package/dist/client/assets/xychartDiagram-JWTSCODW-COWgeBYx.js +0 -7
- package/dist/server/app.js +0 -14
|
@@ -0,0 +1,221 @@
|
|
|
1
|
+
import path from 'path';
|
|
2
|
+
import fs from 'fs';
|
|
3
|
+
import { minimatch } from 'minimatch';
|
|
4
|
+
/**
|
|
5
|
+
* 默认忽略配置
|
|
6
|
+
*/
|
|
7
|
+
export const defaultIgnoreConfig = {
|
|
8
|
+
enableIgnoreFiles: true,
|
|
9
|
+
ignoreFileNames: ['.colonynoteignore', '.gitignore'],
|
|
10
|
+
globalPatterns: [],
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* 忽略匹配器 - 管理所有忽略规则并提供匹配功能
|
|
14
|
+
*/
|
|
15
|
+
export class IgnoreMatcher {
|
|
16
|
+
ignoreFiles = new Map();
|
|
17
|
+
globalRules = [];
|
|
18
|
+
rootPaths;
|
|
19
|
+
config;
|
|
20
|
+
constructor(rootPaths, config = defaultIgnoreConfig) {
|
|
21
|
+
this.rootPaths = Array.isArray(rootPaths)
|
|
22
|
+
? rootPaths.map(p => path.resolve(p))
|
|
23
|
+
: [path.resolve(rootPaths)];
|
|
24
|
+
this.config = config;
|
|
25
|
+
this.globalRules = this.parsePatterns(config.globalPatterns, this.rootPaths[0]);
|
|
26
|
+
}
|
|
27
|
+
findRootForPath(absolutePath) {
|
|
28
|
+
for (const root of this.rootPaths) {
|
|
29
|
+
if (absolutePath.startsWith(root)) {
|
|
30
|
+
return root;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
return null;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* 解析忽略模式字符串为规则对象
|
|
37
|
+
*/
|
|
38
|
+
parsePatterns(patterns, basePath) {
|
|
39
|
+
const rules = [];
|
|
40
|
+
for (const rawPattern of patterns) {
|
|
41
|
+
// 跳过空行和注释
|
|
42
|
+
const trimmed = rawPattern.trim();
|
|
43
|
+
if (!trimmed || trimmed.startsWith('#'))
|
|
44
|
+
continue;
|
|
45
|
+
const isNegation = trimmed.startsWith('!');
|
|
46
|
+
const isDirectory = trimmed.endsWith('/');
|
|
47
|
+
// 处理模式字符串
|
|
48
|
+
let pattern = trimmed;
|
|
49
|
+
// 处理否定模式:移除开头的 !
|
|
50
|
+
if (isNegation) {
|
|
51
|
+
pattern = pattern.slice(1);
|
|
52
|
+
}
|
|
53
|
+
// 处理目录标记:暂时保留,匹配时再处理
|
|
54
|
+
const cleanPattern = isDirectory ? pattern.slice(0, -1) : pattern;
|
|
55
|
+
// 判断是否为绝对路径模式(以 / 开头)
|
|
56
|
+
const isAbsolute = cleanPattern.startsWith('/');
|
|
57
|
+
const rule = {
|
|
58
|
+
pattern: cleanPattern,
|
|
59
|
+
rawPattern: trimmed,
|
|
60
|
+
isNegation,
|
|
61
|
+
isDirectory,
|
|
62
|
+
basePath,
|
|
63
|
+
isAbsolute,
|
|
64
|
+
};
|
|
65
|
+
rules.push(rule);
|
|
66
|
+
}
|
|
67
|
+
return rules;
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* 加载指定路径的 .ignore 文件
|
|
71
|
+
*/
|
|
72
|
+
loadIgnoreFile(filePath) {
|
|
73
|
+
try {
|
|
74
|
+
if (!fs.existsSync(filePath))
|
|
75
|
+
return false;
|
|
76
|
+
const content = fs.readFileSync(filePath, 'utf-8');
|
|
77
|
+
const lines = content.split(/\r?\n/);
|
|
78
|
+
const basePath = path.dirname(filePath);
|
|
79
|
+
const ignoreFile = {
|
|
80
|
+
filePath,
|
|
81
|
+
basePath,
|
|
82
|
+
rules: this.parsePatterns(lines, basePath),
|
|
83
|
+
};
|
|
84
|
+
this.ignoreFiles.set(filePath, ignoreFile);
|
|
85
|
+
return true;
|
|
86
|
+
}
|
|
87
|
+
catch (e) {
|
|
88
|
+
console.error(`Failed to load ignore file ${filePath}:`, e);
|
|
89
|
+
return false;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* 就近查找并加载 .ignore 文件
|
|
94
|
+
* 从 targetPath 向上查找,直到 matchedRoot
|
|
95
|
+
*/
|
|
96
|
+
findAndLoadIgnoreFiles(targetPath, matchedRoot) {
|
|
97
|
+
if (this.config.enableIgnoreFiles === false)
|
|
98
|
+
return;
|
|
99
|
+
let currentPath = path.resolve(targetPath);
|
|
100
|
+
// 如果是文件,从其父目录开始查找
|
|
101
|
+
try {
|
|
102
|
+
const stat = fs.statSync(currentPath);
|
|
103
|
+
if (stat.isFile()) {
|
|
104
|
+
currentPath = path.dirname(currentPath);
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
catch {
|
|
108
|
+
// 路径不存在,假设是目录
|
|
109
|
+
}
|
|
110
|
+
while (currentPath.startsWith(matchedRoot) && currentPath.length >= matchedRoot.length) {
|
|
111
|
+
for (const fileName of (this.config.ignoreFileNames || [])) {
|
|
112
|
+
const ignoreFilePath = path.join(currentPath, fileName);
|
|
113
|
+
// 避免重复加载
|
|
114
|
+
if (!this.ignoreFiles.has(ignoreFilePath)) {
|
|
115
|
+
this.loadIgnoreFile(ignoreFilePath);
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
// 向上一级目录
|
|
119
|
+
const parentPath = path.dirname(currentPath);
|
|
120
|
+
if (parentPath === currentPath)
|
|
121
|
+
break; // 已到达目录
|
|
122
|
+
currentPath = parentPath;
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* 检查单个规则是否匹配目标路径
|
|
127
|
+
*/
|
|
128
|
+
matchRule(rule, targetPath, isDirectory) {
|
|
129
|
+
const relativePath = path.relative(rule.basePath, targetPath);
|
|
130
|
+
if (rule.isAbsolute) {
|
|
131
|
+
const patternWithoutSlash = rule.pattern.replace(/^\//, '');
|
|
132
|
+
if (relativePath === patternWithoutSlash ||
|
|
133
|
+
relativePath.startsWith(patternWithoutSlash + path.sep)) {
|
|
134
|
+
return true;
|
|
135
|
+
}
|
|
136
|
+
return minimatch(relativePath, patternWithoutSlash, { dot: true });
|
|
137
|
+
}
|
|
138
|
+
if (!rule.pattern.includes('/')) {
|
|
139
|
+
const basename = path.basename(targetPath);
|
|
140
|
+
if (rule.isDirectory) {
|
|
141
|
+
if (minimatch(basename, rule.pattern, { dot: true })) {
|
|
142
|
+
return true;
|
|
143
|
+
}
|
|
144
|
+
const parts = relativePath.split(path.sep);
|
|
145
|
+
for (let i = 0; i < parts.length; i++) {
|
|
146
|
+
if (minimatch(parts[i], rule.pattern, { dot: true })) {
|
|
147
|
+
return true;
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
else {
|
|
152
|
+
if (minimatch(basename, rule.pattern, { dot: true })) {
|
|
153
|
+
return true;
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
return false;
|
|
157
|
+
}
|
|
158
|
+
return minimatch(relativePath, rule.pattern, { dot: true });
|
|
159
|
+
}
|
|
160
|
+
/**
|
|
161
|
+
* 检查路径是否被忽略
|
|
162
|
+
* 返回 true 表示应该忽略,false 表示不忽略
|
|
163
|
+
*/
|
|
164
|
+
isIgnored(targetPath, isDirectory = false) {
|
|
165
|
+
const absolutePath = path.resolve(targetPath);
|
|
166
|
+
// 检查是否在任何一个 root 下
|
|
167
|
+
const matchedRoot = this.findRootForPath(absolutePath);
|
|
168
|
+
if (!matchedRoot)
|
|
169
|
+
return false;
|
|
170
|
+
// 就近查找并加载 .ignore 文件
|
|
171
|
+
this.findAndLoadIgnoreFiles(absolutePath, matchedRoot);
|
|
172
|
+
// 收集所有相关规则(按优先级排序)
|
|
173
|
+
// 规则优先级:就近的 .ignore 文件 > 上层的 .ignore 文件 > 全局配置
|
|
174
|
+
const allRules = [];
|
|
175
|
+
// 1. 添加全局规则(最低优先级)
|
|
176
|
+
allRules.push(...this.globalRules);
|
|
177
|
+
// 2. 添加 .ignore 文件规则(按目录层级从根到当前)
|
|
178
|
+
const sortedIgnoreFiles = Array.from(this.ignoreFiles.values())
|
|
179
|
+
.sort((a, b) => {
|
|
180
|
+
// 按 basePath 深度排序:目录优先级低,近目录优先级高
|
|
181
|
+
const depthA = a.basePath.split(path.sep).length;
|
|
182
|
+
const depthB = b.basePath.split(path.sep).length;
|
|
183
|
+
return depthA - depthB;
|
|
184
|
+
});
|
|
185
|
+
for (const ignoreFile of sortedIgnoreFiles) {
|
|
186
|
+
// 只考虑影响当前路径的规则文件
|
|
187
|
+
if (absolutePath.startsWith(ignoreFile.basePath)) {
|
|
188
|
+
allRules.push(...ignoreFile.rules);
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
// 3. 应用规则(后出现的规则优先级更高)
|
|
192
|
+
let shouldIgnore = false;
|
|
193
|
+
for (const rule of allRules) {
|
|
194
|
+
if (this.matchRule(rule, absolutePath, isDirectory)) {
|
|
195
|
+
// 否定规则取消忽略
|
|
196
|
+
if (rule.isNegation) {
|
|
197
|
+
shouldIgnore = false;
|
|
198
|
+
}
|
|
199
|
+
else {
|
|
200
|
+
shouldIgnore = true;
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
return shouldIgnore;
|
|
205
|
+
}
|
|
206
|
+
/**
|
|
207
|
+
* 清除缓存的 .ignore 文件(用于重新加载)
|
|
208
|
+
*/
|
|
209
|
+
clearCache() {
|
|
210
|
+
this.ignoreFiles.clear();
|
|
211
|
+
}
|
|
212
|
+
updateGlobalPatterns(patterns) {
|
|
213
|
+
this.globalRules = this.parsePatterns(patterns, this.rootPaths[0]);
|
|
214
|
+
}
|
|
215
|
+
/**
|
|
216
|
+
* 获取已加载的 .ignore 文件列表
|
|
217
|
+
*/
|
|
218
|
+
getLoadedIgnoreFiles() {
|
|
219
|
+
return Array.from(this.ignoreFiles.keys());
|
|
220
|
+
}
|
|
221
|
+
}
|
package/dist/server/index.js
CHANGED
|
@@ -1,20 +1,40 @@
|
|
|
1
1
|
import { serve } from '@hono/node-server';
|
|
2
2
|
import { Hono } from 'hono';
|
|
3
3
|
import { cors } from 'hono/cors';
|
|
4
|
-
import { createFileRouter } from './api.js';
|
|
5
|
-
import { loadConfig } from '../config.js';
|
|
4
|
+
import { createFileRouter, createMutableConfigHolder } from './api.js';
|
|
5
|
+
import { loadConfig, getConfigFilePath, DEFAULT_PORT, DEFAULT_HOST } from '../config.js';
|
|
6
6
|
import { setupWatcher } from './watcher.js';
|
|
7
|
+
import { IgnoreMatcher } from './ignore.js';
|
|
7
8
|
import { WebSocketServer, WebSocket } from 'ws';
|
|
8
9
|
import fs from 'fs';
|
|
9
10
|
import path from 'path';
|
|
10
11
|
import { fileURLToPath } from 'url';
|
|
11
12
|
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
12
13
|
const clientDir = path.join(__dirname, '..', 'client');
|
|
14
|
+
function findDirForPath(filePath, config) {
|
|
15
|
+
const matches = config.dirs.filter((dir) => {
|
|
16
|
+
const d = path.normalize(dir.path);
|
|
17
|
+
const f = path.normalize(filePath);
|
|
18
|
+
return f === d || f.startsWith(d + path.sep);
|
|
19
|
+
});
|
|
20
|
+
const best = matches.sort((a, b) => b.path.length - a.path.length)[0];
|
|
21
|
+
return best?.path || config.dirs[0]?.path || '';
|
|
22
|
+
}
|
|
13
23
|
async function main() {
|
|
14
|
-
const
|
|
24
|
+
const initialConfig = await loadConfig();
|
|
25
|
+
let initialMatcher = new IgnoreMatcher(initialConfig.dirs.map(d => d.path), {
|
|
26
|
+
globalPatterns: initialConfig.ignore.patterns,
|
|
27
|
+
});
|
|
28
|
+
const holder = createMutableConfigHolder(initialConfig, initialMatcher);
|
|
29
|
+
const clients = new Set();
|
|
30
|
+
const wss = new WebSocketServer({ noServer: true });
|
|
31
|
+
wss.on('connection', (ws) => {
|
|
32
|
+
clients.add(ws);
|
|
33
|
+
ws.on('close', () => clients.delete(ws));
|
|
34
|
+
});
|
|
15
35
|
const app = new Hono();
|
|
16
36
|
app.use('*', cors());
|
|
17
|
-
const fileRouter = createFileRouter(
|
|
37
|
+
const fileRouter = createFileRouter(holder);
|
|
18
38
|
app.route('/api/files', fileRouter);
|
|
19
39
|
app.get('/assets/*', async (c) => {
|
|
20
40
|
const filePath = c.req.path.replace('/assets', '');
|
|
@@ -63,14 +83,8 @@ async function main() {
|
|
|
63
83
|
});
|
|
64
84
|
const server = serve({
|
|
65
85
|
fetch: app.fetch,
|
|
66
|
-
port:
|
|
67
|
-
hostname:
|
|
68
|
-
});
|
|
69
|
-
const clients = new Set();
|
|
70
|
-
const wss = new WebSocketServer({ noServer: true });
|
|
71
|
-
wss.on('connection', (ws) => {
|
|
72
|
-
clients.add(ws);
|
|
73
|
-
ws.on('close', () => clients.delete(ws));
|
|
86
|
+
port: DEFAULT_PORT,
|
|
87
|
+
hostname: DEFAULT_HOST,
|
|
74
88
|
});
|
|
75
89
|
server.on('upgrade', (request, socket, head) => {
|
|
76
90
|
if (request.url === '/ws') {
|
|
@@ -79,21 +93,61 @@ async function main() {
|
|
|
79
93
|
});
|
|
80
94
|
}
|
|
81
95
|
});
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
96
|
+
function broadcastWsMessage(message) {
|
|
97
|
+
clients.forEach((client) => {
|
|
98
|
+
if (client.readyState === WebSocket.OPEN) {
|
|
99
|
+
client.send(message);
|
|
100
|
+
}
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
let watcher = setupWatcher(holder.config, initialMatcher, {
|
|
104
|
+
onFileChange: (rootPath, event, filePath) => {
|
|
105
|
+
const actualRootPath = findDirForPath(filePath, holder.config);
|
|
106
|
+
const relativePath = '/' + filePath.replace(actualRootPath, '').replace(/^\/+/, '');
|
|
107
|
+
const message = JSON.stringify({ type: 'file:change', event, path: relativePath, rootPath: actualRootPath });
|
|
108
|
+
broadcastWsMessage(message);
|
|
91
109
|
},
|
|
92
110
|
});
|
|
111
|
+
// Config file hot-reload
|
|
112
|
+
const configFilePath = getConfigFilePath();
|
|
113
|
+
let reloadTimer = null;
|
|
114
|
+
fs.watch(path.dirname(configFilePath), (eventType, filename) => {
|
|
115
|
+
if (filename !== path.basename(configFilePath))
|
|
116
|
+
return;
|
|
117
|
+
if (reloadTimer)
|
|
118
|
+
clearTimeout(reloadTimer);
|
|
119
|
+
reloadTimer = setTimeout(() => {
|
|
120
|
+
reloadTimer = null;
|
|
121
|
+
reloadConfig();
|
|
122
|
+
}, 500);
|
|
123
|
+
});
|
|
124
|
+
function reloadConfig() {
|
|
125
|
+
loadConfig().then((loaded) => {
|
|
126
|
+
const newMatcher = new IgnoreMatcher(loaded.dirs.map(d => d.path), {
|
|
127
|
+
globalPatterns: loaded.ignore.patterns,
|
|
128
|
+
});
|
|
129
|
+
holder.setConfig(loaded);
|
|
130
|
+
holder.setMatcher(newMatcher);
|
|
131
|
+
// Restart file watcher
|
|
132
|
+
watcher.close();
|
|
133
|
+
watcher = setupWatcher(loaded, newMatcher, {
|
|
134
|
+
onFileChange: (rootPath, event, filePath) => {
|
|
135
|
+
const actualRootPath = findDirForPath(filePath, holder.config);
|
|
136
|
+
const relativePath = '/' + filePath.replace(actualRootPath, '').replace(/^\/+/, '');
|
|
137
|
+
const message = JSON.stringify({ type: 'file:change', event, path: relativePath, rootPath: actualRootPath });
|
|
138
|
+
broadcastWsMessage(message);
|
|
139
|
+
},
|
|
140
|
+
});
|
|
141
|
+
console.log(`[Config] Reloaded from ${configFilePath}`);
|
|
142
|
+
broadcastWsMessage(JSON.stringify({ type: 'config:reload' }));
|
|
143
|
+
}).catch((e) => {
|
|
144
|
+
console.warn('[Config] Failed to reload config:', e);
|
|
145
|
+
});
|
|
146
|
+
}
|
|
93
147
|
console.log(`\n ColonyNote is running!\n`);
|
|
94
|
-
console.log(` Local: http://localhost:${
|
|
95
|
-
console.log(` Network: http://${
|
|
96
|
-
console.log(`
|
|
148
|
+
console.log(` Local: http://localhost:${DEFAULT_PORT}`);
|
|
149
|
+
console.log(` Network: http://${DEFAULT_HOST}:${DEFAULT_PORT}`);
|
|
150
|
+
console.log(` Dirs: ${holder.config.dirs.map(r => r.path).join(', ')}\n`);
|
|
97
151
|
}
|
|
98
152
|
main().catch((e) => {
|
|
99
153
|
console.error('Failed to start:', e);
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { describe, it, expect } from 'vitest';
|
|
2
|
+
import { minimatch } from 'minimatch';
|
|
3
|
+
describe('ignore pattern matching', () => {
|
|
4
|
+
const testPatterns = (patterns, path) => {
|
|
5
|
+
return patterns.some(pattern => {
|
|
6
|
+
const normalizedPattern = pattern.endsWith('/') ? pattern.slice(0, -1) : pattern;
|
|
7
|
+
return minimatch(path, normalizedPattern, { dot: true, matchBase: true });
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
it('should match node_modules/', () => {
|
|
11
|
+
const patterns = ['node_modules/'];
|
|
12
|
+
expect(testPatterns(patterns, '/home/user/projects/myapp/node_modules')).toBe(true);
|
|
13
|
+
expect(testPatterns(patterns, '/home/user/projects/node_modules')).toBe(true);
|
|
14
|
+
expect(testPatterns(patterns, '/home/user/projects/myapp/src')).toBe(false);
|
|
15
|
+
});
|
|
16
|
+
it('should match *.log', () => {
|
|
17
|
+
const patterns = ['*.log'];
|
|
18
|
+
expect(testPatterns(patterns, '/home/user/app.log')).toBe(true);
|
|
19
|
+
expect(testPatterns(patterns, '/home/user/debug.log')).toBe(true);
|
|
20
|
+
expect(testPatterns(patterns, '/home/user/app.js')).toBe(false);
|
|
21
|
+
});
|
|
22
|
+
it('should match **/test/**', () => {
|
|
23
|
+
const patterns = ['**/test/**'];
|
|
24
|
+
expect(testPatterns(patterns, '/home/user/projects/myapp/test/unit')).toBe(true);
|
|
25
|
+
expect(testPatterns(patterns, '/home/user/test/integration')).toBe(true);
|
|
26
|
+
expect(testPatterns(patterns, '/home/user/projects/myapp/src')).toBe(false);
|
|
27
|
+
});
|
|
28
|
+
it('should match .env', () => {
|
|
29
|
+
const patterns = ['.env'];
|
|
30
|
+
expect(testPatterns(patterns, '/home/user/projects/myapp/.env')).toBe(true);
|
|
31
|
+
expect(testPatterns(patterns, '/home/user/.env')).toBe(true);
|
|
32
|
+
expect(testPatterns(patterns, '/home/user/projects/myapp/.env.local')).toBe(false);
|
|
33
|
+
});
|
|
34
|
+
it('should not match with empty patterns', () => {
|
|
35
|
+
const patterns = [];
|
|
36
|
+
expect(testPatterns(patterns, '/home/user/projects/myapp/node_modules')).toBe(false);
|
|
37
|
+
});
|
|
38
|
+
it('should match multiple patterns', () => {
|
|
39
|
+
const patterns = ['node_modules/', '*.log', '.git/'];
|
|
40
|
+
expect(testPatterns(patterns, '/home/user/app.log')).toBe(true);
|
|
41
|
+
expect(testPatterns(patterns, '/home/user/node_modules')).toBe(true);
|
|
42
|
+
expect(testPatterns(patterns, '/home/user/.git')).toBe(true);
|
|
43
|
+
expect(testPatterns(patterns, '/home/user/src')).toBe(false);
|
|
44
|
+
});
|
|
45
|
+
it('should match relative paths', () => {
|
|
46
|
+
const patterns = ['node_modules/'];
|
|
47
|
+
expect(testPatterns(patterns, 'node_modules')).toBe(true);
|
|
48
|
+
expect(testPatterns(patterns, 'src/node_modules')).toBe(true);
|
|
49
|
+
expect(testPatterns(patterns, 'src')).toBe(false);
|
|
50
|
+
});
|
|
51
|
+
});
|
package/dist/server/watcher.js
CHANGED
|
@@ -1,37 +1,73 @@
|
|
|
1
1
|
import chokidar from 'chokidar';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
import fs from 'fs';
|
|
3
|
+
import path from 'path';
|
|
4
|
+
function isPathUnderRoot(filePath, rootPath) {
|
|
5
|
+
const normalizedFile = path.normalize(filePath);
|
|
6
|
+
const normalizedRoot = path.normalize(rootPath);
|
|
7
|
+
return normalizedFile === normalizedRoot || normalizedFile.startsWith(normalizedRoot + path.sep);
|
|
8
|
+
}
|
|
9
|
+
export function setupWatcher(config, matcher, callbacks) {
|
|
10
|
+
const rootPaths = config.dirs.map(r => r.path);
|
|
11
|
+
const watcher = chokidar.watch(rootPaths, {
|
|
12
|
+
ignored: (filePath) => {
|
|
13
|
+
if (!config.showHiddenFiles && (filePath.includes('/.') || filePath.startsWith('.')))
|
|
6
14
|
return true;
|
|
7
|
-
|
|
8
|
-
|
|
15
|
+
try {
|
|
16
|
+
const stat = fs.statSync(filePath);
|
|
17
|
+
if (matcher.isIgnored(filePath, stat.isDirectory()))
|
|
18
|
+
return true;
|
|
19
|
+
}
|
|
20
|
+
catch {
|
|
21
|
+
if (matcher.isIgnored(filePath, false))
|
|
22
|
+
return true;
|
|
23
|
+
}
|
|
24
|
+
const ext = filePath.split('.').pop()?.toLowerCase() || '';
|
|
25
|
+
if (ext && !config.allowedExtensions.includes('.' + ext) && !filePath.includes('/')) {
|
|
9
26
|
return false;
|
|
10
27
|
}
|
|
11
28
|
return false;
|
|
12
29
|
},
|
|
13
30
|
persistent: true,
|
|
14
31
|
ignoreInitial: true,
|
|
15
|
-
depth:
|
|
32
|
+
depth: 3,
|
|
16
33
|
});
|
|
17
34
|
watcher
|
|
18
|
-
.on('add', (
|
|
19
|
-
if (config.allowedExtensions.some(ext =>
|
|
20
|
-
|
|
35
|
+
.on('add', (filePath) => {
|
|
36
|
+
if (config.allowedExtensions.some(ext => filePath.endsWith(ext))) {
|
|
37
|
+
const matchingRoots = config.dirs.filter(r => isPathUnderRoot(filePath, r.path));
|
|
38
|
+
const matchingRoot = matchingRoots.sort((a, b) => b.path.length - a.path.length)[0];
|
|
39
|
+
const rootPath = matchingRoot?.path || config.dirs[0]?.path || '';
|
|
40
|
+
callbacks.onFileChange(rootPath, 'add', filePath);
|
|
21
41
|
}
|
|
22
42
|
})
|
|
23
|
-
.on('change', (
|
|
24
|
-
if (config.allowedExtensions.some(ext =>
|
|
25
|
-
|
|
43
|
+
.on('change', (filePath) => {
|
|
44
|
+
if (config.allowedExtensions.some(ext => filePath.endsWith(ext))) {
|
|
45
|
+
const matchingRoots = config.dirs.filter(r => isPathUnderRoot(filePath, r.path));
|
|
46
|
+
const matchingRoot = matchingRoots.sort((a, b) => b.path.length - a.path.length)[0];
|
|
47
|
+
const rootPath = matchingRoot?.path || config.dirs[0]?.path || '';
|
|
48
|
+
callbacks.onFileChange(rootPath, 'change', filePath);
|
|
26
49
|
}
|
|
27
50
|
})
|
|
28
|
-
.on('unlink', (
|
|
29
|
-
if (config.allowedExtensions.some(ext =>
|
|
30
|
-
|
|
51
|
+
.on('unlink', (filePath) => {
|
|
52
|
+
if (config.allowedExtensions.some(ext => filePath.endsWith(ext))) {
|
|
53
|
+
const matchingRoots = config.dirs.filter(r => isPathUnderRoot(filePath, r.path));
|
|
54
|
+
const matchingRoot = matchingRoots.sort((a, b) => b.path.length - a.path.length)[0];
|
|
55
|
+
const rootPath = matchingRoot?.path || config.dirs[0]?.path || '';
|
|
56
|
+
callbacks.onFileChange(rootPath, 'unlink', filePath);
|
|
31
57
|
}
|
|
32
58
|
})
|
|
33
|
-
.on('addDir', (
|
|
34
|
-
.
|
|
59
|
+
.on('addDir', (filePath) => {
|
|
60
|
+
const matchingRoots = config.dirs.filter(r => isPathUnderRoot(filePath, r.path));
|
|
61
|
+
const matchingRoot = matchingRoots.sort((a, b) => b.path.length - a.path.length)[0];
|
|
62
|
+
const rootPath = matchingRoot?.path || config.dirs[0]?.path || '';
|
|
63
|
+
callbacks.onFileChange(rootPath, 'addDir', filePath);
|
|
64
|
+
})
|
|
65
|
+
.on('unlinkDir', (filePath) => {
|
|
66
|
+
const matchingRoots = config.dirs.filter(r => isPathUnderRoot(filePath, r.path));
|
|
67
|
+
const matchingRoot = matchingRoots.sort((a, b) => b.path.length - a.path.length)[0];
|
|
68
|
+
const rootPath = matchingRoot?.path || config.dirs[0]?.path || '';
|
|
69
|
+
callbacks.onFileChange(rootPath, 'unlinkDir', filePath);
|
|
70
|
+
})
|
|
35
71
|
.on('error', (error) => console.error('Watcher error:', error));
|
|
36
72
|
return watcher;
|
|
37
73
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "colonynote",
|
|
3
|
-
"version": "1.0.0
|
|
3
|
+
"version": "1.0.0",
|
|
4
4
|
"engines": {
|
|
5
5
|
"node": ">=18"
|
|
6
6
|
},
|
|
@@ -32,20 +32,15 @@
|
|
|
32
32
|
"dist"
|
|
33
33
|
],
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@hono/node-server": "^1.19.
|
|
36
|
-
"@milkdown/crepe": "^7.19.2",
|
|
37
|
-
"@milkdown/plugin-listener": "^7.19.2",
|
|
38
|
-
"@milkdown/prose": "^7.19.2",
|
|
39
|
-
"@milkdown/react": "^7.19.2",
|
|
40
|
-
"@milkdown/utils": "^7.19.2",
|
|
35
|
+
"@hono/node-server": "^1.19.14",
|
|
41
36
|
"@radix-ui/react-alert-dialog": "^1.1.15",
|
|
42
37
|
"@radix-ui/react-collapsible": "^1.1.12",
|
|
43
38
|
"@radix-ui/react-dialog": "^1.1.15",
|
|
44
|
-
"@radix-ui/react-popover": "^1.1.15",
|
|
45
39
|
"@radix-ui/react-scroll-area": "^1.2.10",
|
|
46
40
|
"@radix-ui/react-slot": "^1.2.4",
|
|
47
41
|
"@tailwindcss/typography": "^0.5.19",
|
|
48
42
|
"@tailwindcss/vite": "^4.2.2",
|
|
43
|
+
"@tiptap/core": "3.22.2",
|
|
49
44
|
"@tiptap/extension-code-block-lowlight": "^3.20.4",
|
|
50
45
|
"@tiptap/extension-highlight": "^3.20.4",
|
|
51
46
|
"@tiptap/extension-image": "^3.20.4",
|
|
@@ -65,40 +60,45 @@
|
|
|
65
60
|
"chokidar": "^4.0.3",
|
|
66
61
|
"class-variance-authority": "^0.7.1",
|
|
67
62
|
"clsx": "^2.1.1",
|
|
68
|
-
"
|
|
69
|
-
"
|
|
70
|
-
"
|
|
63
|
+
"cmdk": "^1.1.1",
|
|
64
|
+
"commander": "^14.0.3",
|
|
65
|
+
"fuzzysort": "^3.1.0",
|
|
66
|
+
"hono": "^4.12.15",
|
|
67
|
+
"js-yaml": "^4.1.1",
|
|
71
68
|
"lowlight": "^3.3.0",
|
|
72
69
|
"lucide-react": "^0.577.0",
|
|
73
70
|
"markdown-extensions": "^2.0.0",
|
|
74
|
-
"mermaid": "^11.
|
|
71
|
+
"mermaid": "^11.14.0",
|
|
72
|
+
"minimatch": "^10.2.5",
|
|
75
73
|
"react": "^18.3.1",
|
|
76
74
|
"react-dom": "^18.3.1",
|
|
77
|
-
"react-zoom-pan-pinch": "^3.7.0",
|
|
78
75
|
"tailwind-merge": "^3.5.0",
|
|
79
76
|
"tailwindcss": "^4.2.2",
|
|
80
77
|
"tiptap-markdown": "^0.9.0",
|
|
81
78
|
"ws": "^8.20.0"
|
|
82
79
|
},
|
|
83
80
|
"devDependencies": {
|
|
81
|
+
"@types/js-yaml": "^4.0.9",
|
|
84
82
|
"@types/node": "^22.19.15",
|
|
85
83
|
"@types/react": "^18.3.28",
|
|
86
84
|
"@types/react-dom": "^18.3.7",
|
|
87
85
|
"@types/ws": "^8.18.1",
|
|
88
|
-
"@vitejs/plugin-react": "^
|
|
86
|
+
"@vitejs/plugin-react": "^6.0.1",
|
|
89
87
|
"bumpp": "^11.0.1",
|
|
90
88
|
"tsx": "^4.21.0",
|
|
91
89
|
"typescript": "^5.9.3",
|
|
92
|
-
"vite": "^
|
|
90
|
+
"vite": "^8.0.10",
|
|
91
|
+
"vitest": "^4.1.4"
|
|
93
92
|
},
|
|
94
93
|
"scripts": {
|
|
95
|
-
"dev": "tsx src/dev.ts",
|
|
94
|
+
"dev": "tsx src/dev.ts --dir ./workspace",
|
|
96
95
|
"dev:frontend": "vite",
|
|
97
96
|
"dev:backend": "tsx src/server/index.ts",
|
|
98
97
|
"build": "vite build && tsc -p tsconfig.server.json",
|
|
99
98
|
"preview": "vite preview",
|
|
100
99
|
"start": "node dist/server/index.js",
|
|
101
100
|
"typecheck": "tsc --noEmit",
|
|
101
|
+
"test": "vitest",
|
|
102
102
|
"release": "bumpp"
|
|
103
103
|
}
|
|
104
104
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
const e={};export{e as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{e as x,c as O,g as m,k as P,h as p,j as w,l as c,m as A,n as I,t as N,o as _}from"./_baseUniq-BZLZ0Cq5.js";import{aU as g,aC as $,aV as E,aW as F,aX as M,aY as l,aZ as B,a_ as T,a$ as y,b0 as S}from"./index-Ci71-3A2.js";var C=/\s/;function G(n){for(var r=n.length;r--&&C.test(n.charAt(r)););return r}var H=/^\s+/;function L(n){return n&&n.slice(0,G(n)+1).replace(H,"")}var o=NaN,R=/^[-+]0x[0-9a-f]+$/i,W=/^0b[01]+$/i,X=/^0o[0-7]+$/i,Y=parseInt;function q(n){if(typeof n=="number")return n;if(x(n))return o;if(g(n)){var r=typeof n.valueOf=="function"?n.valueOf():n;n=g(r)?r+"":r}if(typeof n!="string")return n===0?n:+n;n=L(n);var t=W.test(n);return t||X.test(n)?Y(n.slice(2),t?2:8):R.test(n)?o:+n}var v=1/0,z=17976931348623157e292;function K(n){if(!n)return n===0?n:0;if(n=q(n),n===v||n===-v){var r=n<0?-1:1;return r*z}return n===n?n:0}function U(n){var r=K(n),t=r%1;return r===r?t?r-t:r:0}function fn(n){var r=n==null?0:n.length;return r?O(n):[]}var b=Object.prototype,Z=b.hasOwnProperty,dn=$(function(n,r){n=Object(n);var t=-1,i=r.length,a=i>2?r[2]:void 0;for(a&&E(r[0],r[1],a)&&(i=1);++t<i;)for(var f=r[t],e=F(f),s=-1,d=e.length;++s<d;){var u=e[s],h=n[u];(h===void 0||M(h,b[u])&&!Z.call(n,u))&&(n[u]=f[u])}return n});function un(n){var r=n==null?0:n.length;return r?n[r-1]:void 0}function D(n){return function(r,t,i){var a=Object(r);if(!l(r)){var f=m(t);r=P(r),t=function(s){return f(a[s],s,a)}}var e=n(r,t,i);return e>-1?a[f?r[e]:e]:void 0}}var J=Math.max;function Q(n,r,t){var i=n==null?0:n.length;if(!i)return-1;var a=t==null?0:U(t);return a<0&&(a=J(i+a,0)),p(n,m(r),a)}var hn=D(Q);function V(n,r){var t=-1,i=l(n)?Array(n.length):[];return w(n,function(a,f,e){i[++t]=r(a,f,e)}),i}function gn(n,r){var t=B(n)?c:V;return t(n,m(r))}var j=Object.prototype,k=j.hasOwnProperty;function nn(n,r){return n!=null&&k.call(n,r)}function mn(n,r){return n!=null&&A(n,r,nn)}function rn(n,r){return n<r}function tn(n,r,t){for(var i=-1,a=n.length;++i<a;){var f=n[i],e=r(f);if(e!=null&&(s===void 0?e===e&&!x(e):t(e,s)))var s=e,d=f}return d}function on(n){return n&&n.length?tn(n,T,rn):void 0}function an(n,r,t,i){if(!g(n))return n;r=I(r,n);for(var a=-1,f=r.length,e=f-1,s=n;s!=null&&++a<f;){var d=N(r[a]),u=t;if(d==="__proto__"||d==="constructor"||d==="prototype")return n;if(a!=e){var h=s[d];u=void 0,u===void 0&&(u=g(h)?h:y(r[a+1])?[]:{})}S(s,d,u),s=s[d]}return n}function vn(n,r,t){for(var i=-1,a=r.length,f={};++i<a;){var e=r[i],s=_(n,e);t(s,e)&&an(f,I(e,n),s)}return f}export{rn as a,tn as b,V as c,vn as d,on as e,fn as f,hn as g,mn as h,dn as i,U as j,un as l,gn as m,K as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{bh as S,bi as Rn,aZ as T,bj as w,aY as sn,bk as xn,bl as mn,bm as Cn,bn as un,bo as x,aW as U,bp as Mn,bq as on,br as Fn,bs as E,bf as gn,bt as R,aU as ln,bu as Dn,bv as D,bw as Gn,bx as Un,by as _,b0 as Bn,bz as Nn,aX as Kn,bA as X,bB as jn,bC as Hn,a$ as qn,a_ as cn,bd as Yn,bD as C}from"./index-Ci71-3A2.js";var Zn="[object Symbol]";function B(n){return typeof n=="symbol"||S(n)&&Rn(n)==Zn}function bn(n,r){for(var e=-1,t=n==null?0:n.length,f=Array(t);++e<t;)f[e]=r(n[e],e,n);return f}var J=w?w.prototype:void 0,Q=J?J.toString:void 0;function dn(n){if(typeof n=="string")return n;if(T(n))return bn(n,dn)+"";if(B(n))return Q?Q.call(n):"";var r=n+"";return r=="0"&&1/n==-1/0?"-0":r}function Xn(){}function pn(n,r){for(var e=-1,t=n==null?0:n.length;++e<t&&r(n[e],e,n)!==!1;);return n}function Jn(n,r,e,t){for(var f=n.length,i=e+-1;++i<f;)if(r(n[i],i,n))return i;return-1}function Qn(n){return n!==n}function Wn(n,r,e){for(var t=e-1,f=n.length;++t<f;)if(n[t]===r)return t;return-1}function zn(n,r,e){return r===r?Wn(n,r,e):Jn(n,Qn,e)}function Vn(n,r){var e=n==null?0:n.length;return!!e&&zn(n,r,0)>-1}function $(n){return sn(n)?xn(n):mn(n)}var kn=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,nr=/^\w*$/;function N(n,r){if(T(n))return!1;var e=typeof n;return e=="number"||e=="symbol"||e=="boolean"||n==null||B(n)?!0:nr.test(n)||!kn.test(n)||r!=null&&n in Object(r)}var rr=500;function er(n){var r=Cn(n,function(t){return e.size===rr&&e.clear(),t}),e=r.cache;return r}var tr=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,ir=/\\(\\)?/g,fr=er(function(n){var r=[];return n.charCodeAt(0)===46&&r.push(""),n.replace(tr,function(e,t,f,i){r.push(f?i.replace(ir,"$1"):t||e)}),r});function ar(n){return n==null?"":dn(n)}function An(n,r){return T(n)?n:N(n,r)?[n]:fr(ar(n))}function m(n){if(typeof n=="string"||B(n))return n;var r=n+"";return r=="0"&&1/n==-1/0?"-0":r}function yn(n,r){r=An(r,n);for(var e=0,t=r.length;n!=null&&e<t;)n=n[m(r[e++])];return e&&e==t?n:void 0}function sr(n,r,e){var t=n==null?void 0:yn(n,r);return t===void 0?e:t}function K(n,r){for(var e=-1,t=r.length,f=n.length;++e<t;)n[f+e]=r[e];return n}var W=w?w.isConcatSpreadable:void 0;function ur(n){return T(n)||un(n)||!!(W&&n&&n[W])}function Ot(n,r,e,t,f){var i=-1,a=n.length;for(e||(e=ur),f||(f=[]);++i<a;){var s=n[i];e(s)?K(f,s):t||(f[f.length]=s)}return f}function or(n,r,e,t){var f=-1,i=n==null?0:n.length;for(t&&i&&(e=n[++f]);++f<i;)e=r(e,n[f],f,n);return e}function gr(n,r){return n&&x(r,$(r),n)}function lr(n,r){return n&&x(r,U(r),n)}function Tn(n,r){for(var e=-1,t=n==null?0:n.length,f=0,i=[];++e<t;){var a=n[e];r(a,e,n)&&(i[f++]=a)}return i}function hn(){return[]}var cr=Object.prototype,br=cr.propertyIsEnumerable,z=Object.getOwnPropertySymbols,j=z?function(n){return n==null?[]:(n=Object(n),Tn(z(n),function(r){return br.call(n,r)}))}:hn;function dr(n,r){return x(n,j(n),r)}var pr=Object.getOwnPropertySymbols,wn=pr?function(n){for(var r=[];n;)K(r,j(n)),n=Mn(n);return r}:hn;function Ar(n,r){return x(n,wn(n),r)}function On(n,r,e){var t=r(n);return T(n)?t:K(t,e(n))}function G(n){return On(n,$,j)}function yr(n){return On(n,U,wn)}var Tr=Object.prototype,hr=Tr.hasOwnProperty;function wr(n){var r=n.length,e=new n.constructor(r);return r&&typeof n[0]=="string"&&hr.call(n,"index")&&(e.index=n.index,e.input=n.input),e}function Or(n,r){var e=r?on(n.buffer):n.buffer;return new n.constructor(e,n.byteOffset,n.byteLength)}var $r=/\w*$/;function _r(n){var r=new n.constructor(n.source,$r.exec(n));return r.lastIndex=n.lastIndex,r}var V=w?w.prototype:void 0,k=V?V.valueOf:void 0;function Sr(n){return k?Object(k.call(n)):{}}var Er="[object Boolean]",Ir="[object Date]",Pr="[object Map]",vr="[object Number]",Lr="[object RegExp]",Rr="[object Set]",xr="[object String]",mr="[object Symbol]",Cr="[object ArrayBuffer]",Mr="[object DataView]",Fr="[object Float32Array]",Dr="[object Float64Array]",Gr="[object Int8Array]",Ur="[object Int16Array]",Br="[object Int32Array]",Nr="[object Uint8Array]",Kr="[object Uint8ClampedArray]",jr="[object Uint16Array]",Hr="[object Uint32Array]";function qr(n,r,e){var t=n.constructor;switch(r){case Cr:return on(n);case Er:case Ir:return new t(+n);case Mr:return Or(n,e);case Fr:case Dr:case Gr:case Ur:case Br:case Nr:case Kr:case jr:case Hr:return Fn(n,e);case Pr:return new t;case vr:case xr:return new t(n);case Lr:return _r(n);case Rr:return new t;case mr:return Sr(n)}}var Yr="[object Map]";function Zr(n){return S(n)&&E(n)==Yr}var nn=R&&R.isMap,Xr=nn?gn(nn):Zr,Jr="[object Set]";function Qr(n){return S(n)&&E(n)==Jr}var rn=R&&R.isSet,Wr=rn?gn(rn):Qr,zr=1,Vr=2,kr=4,$n="[object Arguments]",ne="[object Array]",re="[object Boolean]",ee="[object Date]",te="[object Error]",_n="[object Function]",ie="[object GeneratorFunction]",fe="[object Map]",ae="[object Number]",Sn="[object Object]",se="[object RegExp]",ue="[object Set]",oe="[object String]",ge="[object Symbol]",le="[object WeakMap]",ce="[object ArrayBuffer]",be="[object DataView]",de="[object Float32Array]",pe="[object Float64Array]",Ae="[object Int8Array]",ye="[object Int16Array]",Te="[object Int32Array]",he="[object Uint8Array]",we="[object Uint8ClampedArray]",Oe="[object Uint16Array]",$e="[object Uint32Array]",g={};g[$n]=g[ne]=g[ce]=g[be]=g[re]=g[ee]=g[de]=g[pe]=g[Ae]=g[ye]=g[Te]=g[fe]=g[ae]=g[Sn]=g[se]=g[ue]=g[oe]=g[ge]=g[he]=g[we]=g[Oe]=g[$e]=!0;g[te]=g[_n]=g[le]=!1;function M(n,r,e,t,f,i){var a,s=r&zr,u=r&Vr,b=r&kr;if(a!==void 0)return a;if(!ln(n))return n;var l=T(n);if(l){if(a=wr(n),!s)return Dn(n,a)}else{var o=E(n),c=o==_n||o==ie;if(D(n))return Gn(n,s);if(o==Sn||o==$n||c&&!f){if(a=u||c?{}:Un(n),!s)return u?Ar(n,lr(a,n)):dr(n,gr(a,n))}else{if(!g[o])return f?n:{};a=qr(n,o,s)}}i||(i=new _);var h=i.get(n);if(h)return h;i.set(n,a),Wr(n)?n.forEach(function(d){a.add(M(d,r,e,d,n,i))}):Xr(n)&&n.forEach(function(d,p){a.set(p,M(d,r,e,p,n,i))});var A=b?u?yr:G:u?U:$,y=l?void 0:A(n);return pn(y||n,function(d,p){y&&(p=d,d=n[p]),Bn(a,p,M(d,r,e,p,n,i))}),a}var _e="__lodash_hash_undefined__";function Se(n){return this.__data__.set(n,_e),this}function Ee(n){return this.__data__.has(n)}function I(n){var r=-1,e=n==null?0:n.length;for(this.__data__=new Nn;++r<e;)this.add(n[r])}I.prototype.add=I.prototype.push=Se;I.prototype.has=Ee;function Ie(n,r){for(var e=-1,t=n==null?0:n.length;++e<t;)if(r(n[e],e,n))return!0;return!1}function En(n,r){return n.has(r)}var Pe=1,ve=2;function In(n,r,e,t,f,i){var a=e&Pe,s=n.length,u=r.length;if(s!=u&&!(a&&u>s))return!1;var b=i.get(n),l=i.get(r);if(b&&l)return b==r&&l==n;var o=-1,c=!0,h=e&ve?new I:void 0;for(i.set(n,r),i.set(r,n);++o<s;){var A=n[o],y=r[o];if(t)var d=a?t(y,A,o,r,n,i):t(A,y,o,n,r,i);if(d!==void 0){if(d)continue;c=!1;break}if(h){if(!Ie(r,function(p,O){if(!En(h,O)&&(A===p||f(A,p,e,t,i)))return h.push(O)})){c=!1;break}}else if(!(A===y||f(A,y,e,t,i))){c=!1;break}}return i.delete(n),i.delete(r),c}function Le(n){var r=-1,e=Array(n.size);return n.forEach(function(t,f){e[++r]=[f,t]}),e}function H(n){var r=-1,e=Array(n.size);return n.forEach(function(t){e[++r]=t}),e}var Re=1,xe=2,me="[object Boolean]",Ce="[object Date]",Me="[object Error]",Fe="[object Map]",De="[object Number]",Ge="[object RegExp]",Ue="[object Set]",Be="[object String]",Ne="[object Symbol]",Ke="[object ArrayBuffer]",je="[object DataView]",en=w?w.prototype:void 0,F=en?en.valueOf:void 0;function He(n,r,e,t,f,i,a){switch(e){case je:if(n.byteLength!=r.byteLength||n.byteOffset!=r.byteOffset)return!1;n=n.buffer,r=r.buffer;case Ke:return!(n.byteLength!=r.byteLength||!i(new X(n),new X(r)));case me:case Ce:case De:return Kn(+n,+r);case Me:return n.name==r.name&&n.message==r.message;case Ge:case Be:return n==r+"";case Fe:var s=Le;case Ue:var u=tℜif(s||(s=H),n.size!=r.size&&!u)return!1;var b=a.get(n);if(b)return b==r;t|=xe,a.set(n,r);var l=In(s(n),s(r),t,f,i,a);return a.delete(n),l;case Ne:if(F)return F.call(n)==F.call(r)}return!1}var qe=1,Ye=Object.prototype,Ze=Ye.hasOwnProperty;function Xe(n,r,e,t,f,i){var a=e&qe,s=G(n),u=s.length,b=G(r),l=b.length;if(u!=l&&!a)return!1;for(var o=u;o--;){var c=s[o];if(!(a?c in r:Ze.call(r,c)))return!1}var h=i.get(n),A=i.get(r);if(h&&A)return h==r&&A==n;var y=!0;i.set(n,r),i.set(r,n);for(var d=a;++o<u;){c=s[o];var p=n[c],O=r[c];if(t)var Z=a?t(O,p,c,r,n,i):t(p,O,c,n,r,i);if(!(Z===void 0?p===O||f(p,O,e,t,i):Z)){y=!1;break}d||(d=c=="constructor")}if(y&&!d){var P=n.constructor,v=r.constructor;P!=v&&"constructor"in n&&"constructor"in r&&!(typeof P=="function"&&P instanceof P&&typeof v=="function"&&v instanceof v)&&(y=!1)}return i.delete(n),i.delete(r),y}var Je=1,tn="[object Arguments]",fn="[object Array]",L="[object Object]",Qe=Object.prototype,an=Qe.hasOwnProperty;function We(n,r,e,t,f,i){var a=T(n),s=T(r),u=a?fn:E(n),b=s?fn:E(r);u=u==tn?L:u,b=b==tn?L:b;var l=u==L,o=b==L,c=u==b;if(c&&D(n)){if(!D(r))return!1;a=!0,l=!1}if(c&&!l)return i||(i=new _),a||jn(n)?In(n,r,e,t,f,i):He(n,r,u,e,t,f,i);if(!(e&Je)){var h=l&&an.call(n,"__wrapped__"),A=o&&an.call(r,"__wrapped__");if(h||A){var y=h?n.value():n,d=A?r.value():r;return i||(i=new _),f(y,d,e,t,i)}}return c?(i||(i=new _),Xe(n,r,e,t,f,i)):!1}function q(n,r,e,t,f){return n===r?!0:n==null||r==null||!S(n)&&!S(r)?n!==n&&r!==r:We(n,r,e,t,q,f)}var ze=1,Ve=2;function ke(n,r,e,t){var f=e.length,i=f;if(n==null)return!i;for(n=Object(n);f--;){var a=e[f];if(a[2]?a[1]!==n[a[0]]:!(a[0]in n))return!1}for(;++f<i;){a=e[f];var s=a[0],u=n[s],b=a[1];if(a[2]){if(u===void 0&&!(s in n))return!1}else{var l=new _,o;if(!(o===void 0?q(b,u,ze|Ve,t,l):o))return!1}}return!0}function Pn(n){return n===n&&!ln(n)}function nt(n){for(var r=$(n),e=r.length;e--;){var t=r[e],f=n[t];r[e]=[t,f,Pn(f)]}return r}function vn(n,r){return function(e){return e==null?!1:e[n]===r&&(r!==void 0||n in Object(e))}}function rt(n){var r=nt(n);return r.length==1&&r[0][2]?vn(r[0][0],r[0][1]):function(e){return e===n||ke(e,n,r)}}function et(n,r){return n!=null&&r in Object(n)}function tt(n,r,e){r=An(r,n);for(var t=-1,f=r.length,i=!1;++t<f;){var a=m(r[t]);if(!(i=n!=null&&e(n,a)))break;n=n[a]}return i||++t!=f?i:(f=n==null?0:n.length,!!f&&Hn(f)&&qn(a,f)&&(T(n)||un(n)))}function it(n,r){return n!=null&&tt(n,r,et)}var ft=1,at=2;function st(n,r){return N(n)&&Pn(r)?vn(m(n),r):function(e){var t=sr(e,n);return t===void 0&&t===r?it(e,n):q(r,t,ft|at)}}function ut(n){return function(r){return r==null?void 0:r[n]}}function ot(n){return function(r){return yn(r,n)}}function gt(n){return N(n)?ut(m(n)):ot(n)}function Ln(n){return typeof n=="function"?n:n==null?cn:typeof n=="object"?T(n)?st(n[0],n[1]):rt(n):gt(n)}function lt(n,r){return n&&Yn(n,r,$)}function ct(n,r){return function(e,t){if(e==null)return e;if(!sn(e))return n(e,t);for(var f=e.length,i=-1,a=Object(e);++i<f&&t(a[i],i,a)!==!1;);return e}}var Y=ct(lt);function bt(n){return typeof n=="function"?n:cn}function $t(n,r){var e=T(n)?pn:Y;return e(n,bt(r))}function dt(n,r){var e=[];return Y(n,function(t,f,i){r(t,f,i)&&e.push(t)}),e}function _t(n,r){var e=T(n)?Tn:dt;return e(n,Ln(r))}function pt(n,r){return bn(r,function(e){return n[e]})}function St(n){return n==null?[]:pt(n,$(n))}function Et(n){return n===void 0}function At(n,r,e,t,f){return f(n,function(i,a,s){e=t?(t=!1,i):r(e,i,a,s)}),e}function It(n,r,e){var t=T(n)?or:At,f=arguments.length<3;return t(n,Ln(r),e,f,Y)}var yt=1/0,Tt=C&&1/H(new C([,-0]))[1]==yt?function(n){return new C(n)}:Xn,ht=200;function Pt(n,r,e){var t=-1,f=Vn,i=n.length,a=!0,s=[],u=s;if(i>=ht){var b=r?null:Tt(n);if(b)return H(b);a=!1,f=En,u=new I}else u=r?[]:s;n:for(;++t<i;){var l=n[t],o=r?r(l):l;if(l=l!==0?l:0,a&&o===o){for(var c=u.length;c--;)if(u[c]===o)continue n;r&&u.push(o),s.push(l)}else f(u,o,e)||(u!==s&&u.push(o),s.push(l))}return s}export{Tn as A,dt as B,Ie as C,Xn as D,I as S,Pt as a,M as b,Ot as c,$t as d,B as e,_t as f,Ln as g,Jn as h,Et as i,Y as j,$ as k,bn as l,tt as m,An as n,yn as o,bt as p,lt as q,It as r,it as s,m as t,ar as u,St as v,Vn as w,En as x,zn as y,yr as z};
|
|
@@ -1 +0,0 @@
|
|
|
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-Ci71-3A2.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};
|