difit 5.0.5 → 5.0.7

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 (89) hide show
  1. package/dist/cli/comment.js +56 -14
  2. package/dist/cli/comment.test.js +93 -1
  3. package/dist/cli/utils.js +1 -1
  4. package/dist/client/assets/{arc-BFtqNjFn.js → arc-DREI5TWD.js} +1 -1
  5. package/dist/client/assets/architecture-7EHR7CIX-DGxkQlnD.js +1 -0
  6. package/dist/client/assets/{architectureDiagram-3BPJPVTR-DmME0UxE.js → architectureDiagram-3BPJPVTR-DFkR4rlM.js} +1 -1
  7. package/dist/client/assets/{blockDiagram-GPEHLZMM-PQt9ACSG.js → blockDiagram-GPEHLZMM-ZxUtccGH.js} +1 -1
  8. package/dist/client/assets/{c4Diagram-AAUBKEIU-CWuXJ1kB.js → c4Diagram-AAUBKEIU-EE04Xrty.js} +1 -1
  9. package/dist/client/assets/channel-CHYmQZZG.js +1 -0
  10. package/dist/client/assets/{chunk-2J33WTMH-CfA-PvoW.js → chunk-2J33WTMH-CuaIj_t6.js} +1 -1
  11. package/dist/client/assets/{chunk-3OPIFGDE-gkZuX4yY.js → chunk-3OPIFGDE-CH_P6j0v.js} +1 -1
  12. package/dist/client/assets/{chunk-4BX2VUAB-DSQCc7U1.js → chunk-4BX2VUAB-BhIIlsZ3.js} +1 -1
  13. package/dist/client/assets/{chunk-55IACEB6-B1y0i-GB.js → chunk-55IACEB6-BHzcuGiT.js} +1 -1
  14. package/dist/client/assets/{chunk-5ZQYHXKU-CEIvXj2b.js → chunk-5ZQYHXKU-irirG3d7.js} +1 -1
  15. package/dist/client/assets/{chunk-727SXJPM-CEjIVi4i.js → chunk-727SXJPM-CxLWqspe.js} +1 -1
  16. package/dist/client/assets/{chunk-AQP2D5EJ-BjBoY9LI.js → chunk-AQP2D5EJ-B_5FWHRn.js} +1 -1
  17. package/dist/client/assets/{chunk-BSJP7CBP-BqNNVFo6.js → chunk-BSJP7CBP-DpFoD8PT.js} +1 -1
  18. package/dist/client/assets/{chunk-CSCIHK7Q-D5vLpEnH.js → chunk-CSCIHK7Q-CN57H9UO.js} +1 -1
  19. package/dist/client/assets/{chunk-FMBD7UC4-BrWuacsZ.js → chunk-FMBD7UC4-DS0PqbvC.js} +1 -1
  20. package/dist/client/assets/{chunk-KSCS5N6A-qSOz7jWc.js → chunk-KSCS5N6A-DMeidheb.js} +1 -1
  21. package/dist/client/assets/{chunk-L5ZTLDWV-Dhh37z00.js → chunk-L5ZTLDWV-C9K_60Xm.js} +1 -1
  22. package/dist/client/assets/{chunk-LZXEDZCA-BKlqtWgQ.js → chunk-LZXEDZCA-BGtpnXZ1.js} +2 -2
  23. package/dist/client/assets/{chunk-ND2GUHAM-BQLqpNmi.js → chunk-ND2GUHAM-dPpYOuu1.js} +1 -1
  24. package/dist/client/assets/{chunk-NZK2D7GU-DkNhg6-R.js → chunk-NZK2D7GU-DuRhNiHO.js} +1 -1
  25. package/dist/client/assets/{chunk-O5CBEL6O-CTXwJcAL.js → chunk-O5CBEL6O-DBgK6fiG.js} +1 -1
  26. package/dist/client/assets/chunk-QZHKN3VN-AnmIw7mX.js +1 -0
  27. package/dist/client/assets/chunk-WU5MYG2G-BTiTfGJM.js +1 -0
  28. package/dist/client/assets/{chunk-XPW4576I-H2Ha6BfF.js → chunk-XPW4576I-RVDoolKv.js} +1 -1
  29. package/dist/client/assets/classDiagram-4FO5ZUOK-DMyzL29P.js +1 -0
  30. package/dist/client/assets/classDiagram-v2-Q7XG4LA2-DMyzL29P.js +1 -0
  31. package/dist/client/assets/{cose-bilkent-S5V4N54A-DMsMbiYL.js → cose-bilkent-S5V4N54A-C_heAUQX.js} +1 -1
  32. package/dist/client/assets/{dagre-BM42HDAG-cR2rAe7x.js → dagre-BM42HDAG-nAm5-YBv.js} +1 -1
  33. package/dist/client/assets/{diagram-2AECGRRQ-CaU6Vl7N.js → diagram-2AECGRRQ-DzkMI5-T.js} +1 -1
  34. package/dist/client/assets/{diagram-5GNKFQAL-DyRyfb2-.js → diagram-5GNKFQAL-CISSUOsD.js} +1 -1
  35. package/dist/client/assets/{diagram-KO2AKTUF-UMVtIbJM.js → diagram-KO2AKTUF-DVRaNRJB.js} +1 -1
  36. package/dist/client/assets/{diagram-LMA3HP47-B1XCcv68.js → diagram-LMA3HP47-DJsfPM2-.js} +1 -1
  37. package/dist/client/assets/{diagram-OG6HWLK6-Bsv8UOEy.js → diagram-OG6HWLK6-CgfXkSn6.js} +1 -1
  38. package/dist/client/assets/{dist-BQ3IfAOs.js → dist-DsFysxLW.js} +1 -1
  39. package/dist/client/assets/{erDiagram-TEJ5UH35-D1kbLbMZ.js → erDiagram-TEJ5UH35-Duprm7mz.js} +1 -1
  40. package/dist/client/assets/eventmodeling-FCH6USID-DgO_2CL2.js +1 -0
  41. package/dist/client/assets/{flowDiagram-I6XJVG4X-B32KAFNL.js → flowDiagram-I6XJVG4X-ChDsFg1k.js} +1 -1
  42. package/dist/client/assets/{ganttDiagram-6RSMTGT7-CqzkN5qQ.js → ganttDiagram-6RSMTGT7-BgT4bA2O.js} +1 -1
  43. package/dist/client/assets/{gitGraph-WXDBUCRP-Dvf-BtdZ.js → gitGraph-WXDBUCRP-D2Tc-dnW.js} +1 -1
  44. package/dist/client/assets/{gitGraphDiagram-PVQCEYII-C4H2BCfL.js → gitGraphDiagram-PVQCEYII-CktpkEml.js} +1 -1
  45. package/dist/client/assets/index-BMRoOTU-.js +83 -0
  46. package/dist/client/assets/index-DJEQpFaQ.css +2 -0
  47. package/dist/client/assets/{info-J43DQDTF-DXDhrNcd.js → info-J43DQDTF-bJtQyd_Y.js} +1 -1
  48. package/dist/client/assets/{infoDiagram-5YYISTIA-E5FzjiZF.js → infoDiagram-5YYISTIA-2Pd6AfIZ.js} +1 -1
  49. package/dist/client/assets/{ishikawaDiagram-YF4QCWOH-BniIwOHI.js → ishikawaDiagram-YF4QCWOH-BNKWCuEa.js} +1 -1
  50. package/dist/client/assets/{journeyDiagram-JHISSGLW-CWRTSMsz.js → journeyDiagram-JHISSGLW-DW7F45JQ.js} +1 -1
  51. package/dist/client/assets/{kanban-definition-UN3LZRKU-BC4bkqDK.js → kanban-definition-UN3LZRKU-BP9z6Fz_.js} +1 -1
  52. package/dist/client/assets/{line-C2IYittA.js → line-D5Ou3Ysz.js} +1 -1
  53. package/dist/client/assets/{linear-DPSSuoXX.js → linear-j-04apkE.js} +1 -1
  54. package/dist/client/assets/{mermaid-parser.core-CTlM-0t3.js → mermaid-parser.core-mbc8J2Wv.js} +2 -2
  55. package/dist/client/assets/{mermaid.core-DZRGOTXQ.js → mermaid.core-BqQLoEhf.js} +3 -3
  56. package/dist/client/assets/{mindmap-definition-RKZ34NQL-BA30G-1n.js → mindmap-definition-RKZ34NQL-D6V6zOcp.js} +1 -1
  57. package/dist/client/assets/{packet-YPE3B663-B67puhVE.js → packet-YPE3B663-DEYhteSK.js} +1 -1
  58. package/dist/client/assets/{pie-LRSECV5Y-BZZXmr3e.js → pie-LRSECV5Y-B5pcI4cb.js} +1 -1
  59. package/dist/client/assets/{pieDiagram-4H26LBE5-gGCwheaD.js → pieDiagram-4H26LBE5-Cbhj1myT.js} +1 -1
  60. package/dist/client/assets/{quadrantDiagram-W4KKPZXB-CA3RhxT7.js → quadrantDiagram-W4KKPZXB-BLRF1wH0.js} +1 -1
  61. package/dist/client/assets/{radar-GUYGQ44K-Ds0OU0l0.js → radar-GUYGQ44K-3u8RaujE.js} +1 -1
  62. package/dist/client/assets/{requirementDiagram-4Y6WPE33-Cqttdo2T.js → requirementDiagram-4Y6WPE33-CvuvVoeD.js} +1 -1
  63. package/dist/client/assets/{sankeyDiagram-5OEKKPKP-BXX9KVMV.js → sankeyDiagram-5OEKKPKP-DK6Ak875.js} +1 -1
  64. package/dist/client/assets/{sequenceDiagram-3UESZ5HK-Bld0u6Ie.js → sequenceDiagram-3UESZ5HK-BUrpkbLl.js} +1 -1
  65. package/dist/client/assets/{src-Dm91GJHU.js → src-3oJtdAc0.js} +1 -1
  66. package/dist/client/assets/{stateDiagram-AJRCARHV-BwUjJAdX.js → stateDiagram-AJRCARHV-rMdhh-BM.js} +1 -1
  67. package/dist/client/assets/stateDiagram-v2-BHNVJYJU-D57jPzmZ.js +1 -0
  68. package/dist/client/assets/{timeline-definition-PNZ67QCA-CyRL0FgR.js → timeline-definition-PNZ67QCA-HJrE8OfG.js} +1 -1
  69. package/dist/client/assets/{treeView-BLDUP644-DA1KxC4j.js → treeView-BLDUP644-DhCldToR.js} +1 -1
  70. package/dist/client/assets/{treemap-LRROVOQU-BV_MfLqC.js → treemap-LRROVOQU-C3ctDtd2.js} +1 -1
  71. package/dist/client/assets/{vennDiagram-CIIHVFJN-CQjCwVQs.js → vennDiagram-CIIHVFJN-BU_h1DHf.js} +1 -1
  72. package/dist/client/assets/{wardley-L42UT6IY-DI_f84It.js → wardley-L42UT6IY-DzaGiv5e.js} +1 -1
  73. package/dist/client/assets/{wardleyDiagram-YWT4CUSO-VQ_jJqtY.js → wardleyDiagram-YWT4CUSO-Dk9C0jMk.js} +1 -1
  74. package/dist/client/assets/{xychartDiagram-2RQKCTM6-BqRVgu7T.js → xychartDiagram-2RQKCTM6-CD9r_u2H.js} +1 -1
  75. package/dist/client/index.html +2 -2
  76. package/dist/server/file-watcher.js +4 -1
  77. package/dist/server/server.js +16 -0
  78. package/dist/server/server.test.js +56 -4
  79. package/package.json +2 -1
  80. package/dist/client/assets/architecture-7EHR7CIX-DQLa0A5_.js +0 -1
  81. package/dist/client/assets/channel-CAvsdwYs.js +0 -1
  82. package/dist/client/assets/chunk-QZHKN3VN-bwEuudaJ.js +0 -1
  83. package/dist/client/assets/chunk-WU5MYG2G-B5BfXv5j.js +0 -1
  84. package/dist/client/assets/classDiagram-4FO5ZUOK-M2HyV8WB.js +0 -1
  85. package/dist/client/assets/classDiagram-v2-Q7XG4LA2-M2HyV8WB.js +0 -1
  86. package/dist/client/assets/eventmodeling-FCH6USID-B9hLzMDy.js +0 -1
  87. package/dist/client/assets/index-Cez3EHkb.js +0 -82
  88. package/dist/client/assets/index-DZauad3j.css +0 -2
  89. package/dist/client/assets/stateDiagram-v2-BHNVJYJU-CUwARcoN.js +0 -1
@@ -1,6 +1,15 @@
1
1
  import { Command, Option } from 'commander';
2
2
  import { parseCommentImportValue } from '../utils/commentImports.js';
3
3
  import { detectStdinSource, readStdin } from './utils.js';
4
+ function handleCommandError(error, port) {
5
+ if (error instanceof TypeError && error.message.includes('fetch failed')) {
6
+ console.error(`Error: Cannot connect to difit server on port ${port}. Is the server running?`);
7
+ }
8
+ else {
9
+ console.error(`Error: ${error instanceof Error ? error.message : 'Unknown error'}`);
10
+ }
11
+ process.exit(1);
12
+ }
4
13
  async function parseCommentAddInput(json) {
5
14
  if (typeof json === 'string') {
6
15
  return json;
@@ -15,7 +24,7 @@ async function parseCommentAddInput(json) {
15
24
  return stdin;
16
25
  }
17
26
  export function createCommentCommand() {
18
- const comment = new Command('comment').description('Add or retrieve comments on a running difit server');
27
+ const comment = new Command('comment').description('Add, retrieve, or resolve comments on a running difit server');
19
28
  comment
20
29
  .command('add')
21
30
  .description('Add comments to a running difit server')
@@ -44,13 +53,7 @@ export function createCommentCommand() {
44
53
  }));
45
54
  }
46
55
  catch (error) {
47
- if (error instanceof TypeError && error.message.includes('fetch failed')) {
48
- console.error(`Error: Cannot connect to difit server on port ${opts.port}. Is the server running?`);
49
- }
50
- else {
51
- console.error(`Error: ${error instanceof Error ? error.message : 'Unknown error'}`);
52
- }
53
- process.exit(1);
56
+ handleCommandError(error, opts.port);
54
57
  }
55
58
  });
56
59
  comment
@@ -78,13 +81,52 @@ export function createCommentCommand() {
78
81
  }
79
82
  }
80
83
  catch (error) {
81
- if (error instanceof TypeError && error.message.includes('fetch failed')) {
82
- console.error(`Error: Cannot connect to difit server on port ${opts.port}. Is the server running?`);
83
- }
84
- else {
85
- console.error(`Error: ${error instanceof Error ? error.message : 'Unknown error'}`);
84
+ handleCommandError(error, opts.port);
85
+ }
86
+ });
87
+ comment
88
+ .command('resolve')
89
+ .alias('remove')
90
+ .description('Resolve (remove) comment threads on a running difit server')
91
+ .argument('<threadIds...>', 'thread IDs to resolve')
92
+ .requiredOption('--port <port>', 'port of the running difit server', parseInt)
93
+ .action(async (threadIds, opts) => {
94
+ try {
95
+ const results = await Promise.all(threadIds.map(async (threadId) => {
96
+ const response = await fetch(`http://localhost:${opts.port}/api/comments/${encodeURIComponent(threadId)}`, { method: 'DELETE' });
97
+ if (response.ok) {
98
+ return { threadId, status: 'resolved' };
99
+ }
100
+ if (response.status === 404) {
101
+ return { threadId, status: 'notFound' };
102
+ }
103
+ const errorBody = (await response.json().catch(() => ({})));
104
+ return {
105
+ threadId,
106
+ status: 'error',
107
+ error: errorBody.error ?? `Failed to resolve thread ${threadId}`,
108
+ };
109
+ }));
110
+ const resolved = results.filter((r) => r.status === 'resolved').map((r) => r.threadId);
111
+ const notFound = results.filter((r) => r.status === 'notFound').map((r) => r.threadId);
112
+ const errors = results
113
+ .filter((r) => r.status === 'error')
114
+ .map((r) => ({
115
+ threadId: r.threadId,
116
+ error: r.error ?? `Failed to resolve thread ${r.threadId}`,
117
+ }));
118
+ console.log(JSON.stringify({
119
+ success: notFound.length === 0 && errors.length === 0,
120
+ resolved,
121
+ notFound,
122
+ errors,
123
+ }));
124
+ if (notFound.length > 0 || errors.length > 0) {
125
+ process.exit(1);
86
126
  }
87
- process.exit(1);
127
+ }
128
+ catch (error) {
129
+ handleCommandError(error, opts.port);
88
130
  }
89
131
  });
90
132
  return comment;
@@ -5,10 +5,11 @@ describe('createCommentCommand', () => {
5
5
  it('creates a command named "comment"', () => {
6
6
  expect(command.name()).toBe('comment');
7
7
  });
8
- it('has "add" and "get" subcommands', () => {
8
+ it('has "add", "get", and "resolve" subcommands', () => {
9
9
  const subcommandNames = command.commands.map((c) => c.name());
10
10
  expect(subcommandNames).toContain('add');
11
11
  expect(subcommandNames).toContain('get');
12
+ expect(subcommandNames).toContain('resolve');
12
13
  });
13
14
  describe('add subcommand', () => {
14
15
  const addCommand = command.commands.find((c) => c.name() === 'add');
@@ -38,6 +39,24 @@ describe('createCommentCommand', () => {
38
39
  expect(formatOption?.argChoices).toEqual(['text', 'json']);
39
40
  });
40
41
  });
42
+ describe('resolve subcommand', () => {
43
+ const resolveCommand = command.commands.find((c) => c.name() === 'resolve');
44
+ it('has "remove" alias', () => {
45
+ expect(resolveCommand.aliases()).toContain('remove');
46
+ });
47
+ it('requires --port option', () => {
48
+ const portOption = resolveCommand.options.find((o) => o.long === '--port');
49
+ expect(portOption).toBeDefined();
50
+ expect(portOption?.mandatory).toBe(true);
51
+ });
52
+ it('accepts variadic threadIds argument', () => {
53
+ const args = resolveCommand.registeredArguments;
54
+ expect(args).toHaveLength(1);
55
+ expect(args[0].name()).toBe('threadIds');
56
+ expect(args[0].required).toBe(true);
57
+ expect(args[0].variadic).toBe(true);
58
+ });
59
+ });
41
60
  });
42
61
  function jsonResponse(body, status = 200) {
43
62
  return new Response(JSON.stringify(body), {
@@ -161,4 +180,77 @@ describe('comment subcommand integration', () => {
161
180
  expect(consoleOutput).toHaveLength(0);
162
181
  });
163
182
  });
183
+ describe('resolve', () => {
184
+ it('sends DELETE requests for each thread ID', async () => {
185
+ mockFetch.mockResolvedValue(jsonResponse({ success: true, threadId: 'abc123', version: 2 }));
186
+ const command = createCommentCommand();
187
+ await command.parseAsync(['node', 'difit', 'resolve', '--port', '4966', 'abc123', 'def456']);
188
+ expect(mockFetch).toHaveBeenCalledWith('http://localhost:4966/api/comments/abc123', {
189
+ method: 'DELETE',
190
+ });
191
+ expect(mockFetch).toHaveBeenCalledWith('http://localhost:4966/api/comments/def456', {
192
+ method: 'DELETE',
193
+ });
194
+ expect(consoleOutput[0]).toBe(JSON.stringify({
195
+ success: true,
196
+ resolved: ['abc123', 'def456'],
197
+ notFound: [],
198
+ errors: [],
199
+ }));
200
+ expect(process.exit).not.toHaveBeenCalled();
201
+ });
202
+ it('works via the remove alias', async () => {
203
+ mockFetch.mockResolvedValue(jsonResponse({ success: true, threadId: 'abc123', version: 2 }));
204
+ const command = createCommentCommand();
205
+ await command.parseAsync(['node', 'difit', 'remove', '--port', '4966', 'abc123']);
206
+ expect(mockFetch).toHaveBeenCalledWith('http://localhost:4966/api/comments/abc123', {
207
+ method: 'DELETE',
208
+ });
209
+ expect(consoleOutput[0]).toContain('"success":true');
210
+ });
211
+ it('URL-encodes thread IDs', async () => {
212
+ mockFetch.mockResolvedValue(jsonResponse({ success: true }));
213
+ const command = createCommentCommand();
214
+ await command.parseAsync(['node', 'difit', 'resolve', '--port', '4966', 'a/b c']);
215
+ expect(mockFetch).toHaveBeenCalledWith('http://localhost:4966/api/comments/a%2Fb%20c', {
216
+ method: 'DELETE',
217
+ });
218
+ });
219
+ it('reports unknown thread IDs and exits with an error', async () => {
220
+ mockFetch
221
+ .mockResolvedValueOnce(jsonResponse({ success: true, threadId: 'abc123', version: 2 }))
222
+ .mockResolvedValueOnce(jsonResponse({ error: 'Thread not found: missing' }, 404));
223
+ const command = createCommentCommand();
224
+ await command.parseAsync(['node', 'difit', 'resolve', '--port', '4966', 'abc123', 'missing']);
225
+ expect(consoleOutput[0]).toBe(JSON.stringify({
226
+ success: false,
227
+ resolved: ['abc123'],
228
+ notFound: ['missing'],
229
+ errors: [],
230
+ }));
231
+ expect(process.exit).toHaveBeenCalledWith(1);
232
+ });
233
+ it('collects server errors without dropping remaining thread IDs', async () => {
234
+ mockFetch
235
+ .mockResolvedValueOnce(jsonResponse({ error: 'Internal error' }, 500))
236
+ .mockResolvedValueOnce(jsonResponse({ success: true, threadId: 'def456', version: 2 }));
237
+ const command = createCommentCommand();
238
+ await command.parseAsync(['node', 'difit', 'resolve', '--port', '4966', 'abc123', 'def456']);
239
+ expect(consoleOutput[0]).toBe(JSON.stringify({
240
+ success: false,
241
+ resolved: ['def456'],
242
+ notFound: [],
243
+ errors: [{ threadId: 'abc123', error: 'Internal error' }],
244
+ }));
245
+ expect(process.exit).toHaveBeenCalledWith(1);
246
+ });
247
+ it('handles connection error', async () => {
248
+ mockFetch.mockRejectedValue(new TypeError('fetch failed'));
249
+ const command = createCommentCommand();
250
+ await command.parseAsync(['node', 'difit', 'resolve', '--port', '9999', 'abc123']);
251
+ expect(consoleErrors[0]).toContain('Cannot connect');
252
+ expect(consoleErrors[0]).toContain('9999');
253
+ expect(process.exit).toHaveBeenCalledWith(1);
254
+ });
255
+ });
164
256
  });
package/dist/cli/utils.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { execSync } from 'child_process';
2
2
  import { fstatSync } from 'node:fs';
3
- import { createInterface } from 'readline/promises';
3
+ import { createInterface } from 'node:readline/promises';
4
4
  import { parseCommentImportValue } from '../utils/commentImports.js';
5
5
  export function detectStdinSource(stdinStat = fstatSync(0)) {
6
6
  if (stdinStat.isFIFO()) {
@@ -1 +1 @@
1
- import{n as e,t}from"./path-BWPyau1x.js";import{a as n,c as r,d as i,f as a,i as o,l as s,m as c,n as l,o as u,p as d,r as f,u as p}from"./dist-BQ3IfAOs.js";function m(e){return e.innerRadius}function h(e){return e.outerRadius}function g(e){return e.startAngle}function _(e){return e.endAngle}function v(e){return e&&e.padAngle}function y(e,t,n,r,i,a,o,s){var c=n-e,l=r-t,u=o-i,d=s-a,f=d*c-u*l;if(!(f*f<1e-12))return f=(u*(t-a)-d*(e-i))/f,[e+f*c,t+f*l]}function b(e,t,n,r,i,a,o){var c=e-n,l=t-r,u=(o?a:-a)/d(c*c+l*l),f=u*l,p=-u*c,m=e+f,h=t+p,g=n+f,_=r+p,v=(m+g)/2,y=(h+_)/2,b=g-m,x=_-h,S=b*b+x*x,C=i-a,w=m*_-g*h,T=(x<0?-1:1)*d(s(0,C*C*S-w*w)),E=(w*x-b*T)/S,D=(-w*b-x*T)/S,O=(w*x+b*T)/S,k=(-w*b+x*T)/S,A=E-v,j=D-y,M=O-v,N=k-y;return A*A+j*j>M*M+N*N&&(E=O,D=k),{cx:E,cy:D,x01:-f,y01:-p,x11:E*(i/C-1),y11:D*(i/C-1)}}function x(){var s=m,x=h,S=e(0),C=null,w=g,T=_,E=v,D=null,O=t(k);function k(){var e,t,m=+s.apply(this,arguments),h=+x.apply(this,arguments),g=w.apply(this,arguments)-r,_=T.apply(this,arguments)-r,v=l(_-g),k=_>g;if(D||=e=O(),h<m&&(t=h,h=m,m=t),!(h>1e-12))D.moveTo(0,0);else if(v>c-1e-12)D.moveTo(h*u(g),h*a(g)),D.arc(0,0,h,g,_,!k),m>1e-12&&(D.moveTo(m*u(_),m*a(_)),D.arc(0,0,m,_,g,k));else{var A=g,j=_,M=g,N=_,P=v,F=v,I=E.apply(this,arguments)/2,L=I>1e-12&&(C?+C.apply(this,arguments):d(m*m+h*h)),R=p(l(h-m)/2,+S.apply(this,arguments)),z=R,B=R,V,H;if(L>1e-12){var U=o(L/m*a(I)),W=o(L/h*a(I));(P-=U*2)>1e-12?(U*=k?1:-1,M+=U,N-=U):(P=0,M=N=(g+_)/2),(F-=W*2)>1e-12?(W*=k?1:-1,A+=W,j-=W):(F=0,A=j=(g+_)/2)}var G=h*u(A),K=h*a(A),q=m*u(N),J=m*a(N);if(R>1e-12){var Y=h*u(j),X=h*a(j),Z=m*u(M),Q=m*a(M),$;if(v<i)if($=y(G,K,Z,Q,Y,X,q,J)){var ee=G-$[0],te=K-$[1],ne=Y-$[0],re=X-$[1],ie=1/a(f((ee*ne+te*re)/(d(ee*ee+te*te)*d(ne*ne+re*re)))/2),ae=d($[0]*$[0]+$[1]*$[1]);z=p(R,(m-ae)/(ie-1)),B=p(R,(h-ae)/(ie+1))}else z=B=0}F>1e-12?B>1e-12?(V=b(Z,Q,G,K,h,B,k),H=b(Y,X,q,J,h,B,k),D.moveTo(V.cx+V.x01,V.cy+V.y01),B<R?D.arc(V.cx,V.cy,B,n(V.y01,V.x01),n(H.y01,H.x01),!k):(D.arc(V.cx,V.cy,B,n(V.y01,V.x01),n(V.y11,V.x11),!k),D.arc(0,0,h,n(V.cy+V.y11,V.cx+V.x11),n(H.cy+H.y11,H.cx+H.x11),!k),D.arc(H.cx,H.cy,B,n(H.y11,H.x11),n(H.y01,H.x01),!k))):(D.moveTo(G,K),D.arc(0,0,h,A,j,!k)):D.moveTo(G,K),!(m>1e-12)||!(P>1e-12)?D.lineTo(q,J):z>1e-12?(V=b(q,J,Y,X,m,-z,k),H=b(G,K,Z,Q,m,-z,k),D.lineTo(V.cx+V.x01,V.cy+V.y01),z<R?D.arc(V.cx,V.cy,z,n(V.y01,V.x01),n(H.y01,H.x01),!k):(D.arc(V.cx,V.cy,z,n(V.y01,V.x01),n(V.y11,V.x11),!k),D.arc(0,0,m,n(V.cy+V.y11,V.cx+V.x11),n(H.cy+H.y11,H.cx+H.x11),k),D.arc(H.cx,H.cy,z,n(H.y11,H.x11),n(H.y01,H.x01),!k))):D.arc(0,0,m,N,M,k)}if(D.closePath(),e)return D=null,e+``||null}return k.centroid=function(){var e=(+s.apply(this,arguments)+ +x.apply(this,arguments))/2,t=(+w.apply(this,arguments)+ +T.apply(this,arguments))/2-i/2;return[u(t)*e,a(t)*e]},k.innerRadius=function(t){return arguments.length?(s=typeof t==`function`?t:e(+t),k):s},k.outerRadius=function(t){return arguments.length?(x=typeof t==`function`?t:e(+t),k):x},k.cornerRadius=function(t){return arguments.length?(S=typeof t==`function`?t:e(+t),k):S},k.padRadius=function(t){return arguments.length?(C=t==null?null:typeof t==`function`?t:e(+t),k):C},k.startAngle=function(t){return arguments.length?(w=typeof t==`function`?t:e(+t),k):w},k.endAngle=function(t){return arguments.length?(T=typeof t==`function`?t:e(+t),k):T},k.padAngle=function(t){return arguments.length?(E=typeof t==`function`?t:e(+t),k):E},k.context=function(e){return arguments.length?(D=e??null,k):D},k}export{x as t};
1
+ import{n as e,t}from"./path-BWPyau1x.js";import{a as n,c as r,d as i,f as a,i as o,l as s,m as c,n as l,o as u,p as d,r as f,u as p}from"./dist-DsFysxLW.js";function m(e){return e.innerRadius}function h(e){return e.outerRadius}function g(e){return e.startAngle}function _(e){return e.endAngle}function v(e){return e&&e.padAngle}function y(e,t,n,r,i,a,o,s){var c=n-e,l=r-t,u=o-i,d=s-a,f=d*c-u*l;if(!(f*f<1e-12))return f=(u*(t-a)-d*(e-i))/f,[e+f*c,t+f*l]}function b(e,t,n,r,i,a,o){var c=e-n,l=t-r,u=(o?a:-a)/d(c*c+l*l),f=u*l,p=-u*c,m=e+f,h=t+p,g=n+f,_=r+p,v=(m+g)/2,y=(h+_)/2,b=g-m,x=_-h,S=b*b+x*x,C=i-a,w=m*_-g*h,T=(x<0?-1:1)*d(s(0,C*C*S-w*w)),E=(w*x-b*T)/S,D=(-w*b-x*T)/S,O=(w*x+b*T)/S,k=(-w*b+x*T)/S,A=E-v,j=D-y,M=O-v,N=k-y;return A*A+j*j>M*M+N*N&&(E=O,D=k),{cx:E,cy:D,x01:-f,y01:-p,x11:E*(i/C-1),y11:D*(i/C-1)}}function x(){var s=m,x=h,S=e(0),C=null,w=g,T=_,E=v,D=null,O=t(k);function k(){var e,t,m=+s.apply(this,arguments),h=+x.apply(this,arguments),g=w.apply(this,arguments)-r,_=T.apply(this,arguments)-r,v=l(_-g),k=_>g;if(D||=e=O(),h<m&&(t=h,h=m,m=t),!(h>1e-12))D.moveTo(0,0);else if(v>c-1e-12)D.moveTo(h*u(g),h*a(g)),D.arc(0,0,h,g,_,!k),m>1e-12&&(D.moveTo(m*u(_),m*a(_)),D.arc(0,0,m,_,g,k));else{var A=g,j=_,M=g,N=_,P=v,F=v,I=E.apply(this,arguments)/2,L=I>1e-12&&(C?+C.apply(this,arguments):d(m*m+h*h)),R=p(l(h-m)/2,+S.apply(this,arguments)),z=R,B=R,V,H;if(L>1e-12){var U=o(L/m*a(I)),W=o(L/h*a(I));(P-=U*2)>1e-12?(U*=k?1:-1,M+=U,N-=U):(P=0,M=N=(g+_)/2),(F-=W*2)>1e-12?(W*=k?1:-1,A+=W,j-=W):(F=0,A=j=(g+_)/2)}var G=h*u(A),K=h*a(A),q=m*u(N),J=m*a(N);if(R>1e-12){var Y=h*u(j),X=h*a(j),Z=m*u(M),Q=m*a(M),$;if(v<i)if($=y(G,K,Z,Q,Y,X,q,J)){var ee=G-$[0],te=K-$[1],ne=Y-$[0],re=X-$[1],ie=1/a(f((ee*ne+te*re)/(d(ee*ee+te*te)*d(ne*ne+re*re)))/2),ae=d($[0]*$[0]+$[1]*$[1]);z=p(R,(m-ae)/(ie-1)),B=p(R,(h-ae)/(ie+1))}else z=B=0}F>1e-12?B>1e-12?(V=b(Z,Q,G,K,h,B,k),H=b(Y,X,q,J,h,B,k),D.moveTo(V.cx+V.x01,V.cy+V.y01),B<R?D.arc(V.cx,V.cy,B,n(V.y01,V.x01),n(H.y01,H.x01),!k):(D.arc(V.cx,V.cy,B,n(V.y01,V.x01),n(V.y11,V.x11),!k),D.arc(0,0,h,n(V.cy+V.y11,V.cx+V.x11),n(H.cy+H.y11,H.cx+H.x11),!k),D.arc(H.cx,H.cy,B,n(H.y11,H.x11),n(H.y01,H.x01),!k))):(D.moveTo(G,K),D.arc(0,0,h,A,j,!k)):D.moveTo(G,K),!(m>1e-12)||!(P>1e-12)?D.lineTo(q,J):z>1e-12?(V=b(q,J,Y,X,m,-z,k),H=b(G,K,Z,Q,m,-z,k),D.lineTo(V.cx+V.x01,V.cy+V.y01),z<R?D.arc(V.cx,V.cy,z,n(V.y01,V.x01),n(H.y01,H.x01),!k):(D.arc(V.cx,V.cy,z,n(V.y01,V.x01),n(V.y11,V.x11),!k),D.arc(0,0,m,n(V.cy+V.y11,V.cx+V.x11),n(H.cy+H.y11,H.cx+H.x11),k),D.arc(H.cx,H.cy,z,n(H.y11,H.x11),n(H.y01,H.x01),!k))):D.arc(0,0,m,N,M,k)}if(D.closePath(),e)return D=null,e+``||null}return k.centroid=function(){var e=(+s.apply(this,arguments)+ +x.apply(this,arguments))/2,t=(+w.apply(this,arguments)+ +T.apply(this,arguments))/2-i/2;return[u(t)*e,a(t)*e]},k.innerRadius=function(t){return arguments.length?(s=typeof t==`function`?t:e(+t),k):s},k.outerRadius=function(t){return arguments.length?(x=typeof t==`function`?t:e(+t),k):x},k.cornerRadius=function(t){return arguments.length?(S=typeof t==`function`?t:e(+t),k):S},k.padRadius=function(t){return arguments.length?(C=t==null?null:typeof t==`function`?t:e(+t),k):C},k.startAngle=function(t){return arguments.length?(w=typeof t==`function`?t:e(+t),k):w},k.endAngle=function(t){return arguments.length?(T=typeof t==`function`?t:e(+t),k):T},k.padAngle=function(t){return arguments.length?(E=typeof t==`function`?t:e(+t),k):E},k.context=function(e){return arguments.length?(D=e??null,k):D},k}export{x as t};
@@ -0,0 +1 @@
1
+ import"./chunk-NNHCCRGN-DlpIbxXb.js";import{x as e}from"./mermaid-parser.core-mbc8J2Wv.js";export{e as createArchitectureServices};