for-humanity 0.11.0 → 0.13.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.
Files changed (226) hide show
  1. package/CHANGELOG.md +33 -0
  2. package/README.md +16 -9
  3. package/dist/browser.js +16 -16
  4. package/dist/cli.css +2 -941
  5. package/dist/cli.js +92 -2290
  6. package/dist/config.js +1 -0
  7. package/dist/constant/copy.d.ts +100 -0
  8. package/dist/constant/site.d.ts +20 -0
  9. package/dist/constant/status.d.ts +19 -0
  10. package/dist/copy-C1uzvEnr.js +103 -0
  11. package/dist/group-path-XAThmzvC.js +10 -0
  12. package/dist/load-site-CbpLEhwu.js +2379 -0
  13. package/dist/logger-Dv1i9xSV.js +9 -0
  14. package/dist/mermaid/THIRD-PARTY-NOTICES.txt +3134 -0
  15. package/dist/mermaid/chunk--TN-qHgG.js +2 -0
  16. package/dist/mermaid/chunk-0kM1Lv4D.js +2 -0
  17. package/dist/mermaid/chunk-3FHei3pH.js +2001 -0
  18. package/dist/mermaid/chunk-3_2p2GqN.js +2 -0
  19. package/dist/mermaid/chunk-6HLei9i0.js +84 -0
  20. package/dist/mermaid/chunk-7Sz3kAwl.js +2214 -0
  21. package/dist/mermaid/chunk-7Tarqbpa.js +18047 -0
  22. package/dist/mermaid/chunk-9kkt8lzL.js +10 -0
  23. package/dist/mermaid/chunk-B--pNBQF.js +884 -0
  24. package/dist/mermaid/chunk-B4F-pysn.js +4241 -0
  25. package/dist/mermaid/chunk-B58sEIY_.js +14 -0
  26. package/dist/mermaid/chunk-B9_UWzSH.js +1517 -0
  27. package/dist/mermaid/chunk-BB8uZHwY.js +75 -0
  28. package/dist/mermaid/chunk-BFfk0LEc.js +717 -0
  29. package/dist/mermaid/chunk-BKri0qr7.js +89 -0
  30. package/dist/mermaid/chunk-BL404pH5.js +26 -0
  31. package/dist/mermaid/chunk-BLeiQSWo.js +354 -0
  32. package/dist/mermaid/chunk-BOmH_UFd.js +2 -0
  33. package/dist/mermaid/chunk-BSej9Nhy.js +1361 -0
  34. package/dist/mermaid/chunk-BYzrzvCI.js +12 -0
  35. package/dist/mermaid/chunk-BariMtWr.js +3020 -0
  36. package/dist/mermaid/chunk-BcrBoMwH.js +2352 -0
  37. package/dist/mermaid/chunk-Bok8z-Yo.js +67 -0
  38. package/dist/mermaid/chunk-BpTHLKQM.js +1970 -0
  39. package/dist/mermaid/chunk-BqjuxRsC.js +733 -0
  40. package/dist/mermaid/chunk-BuvPd-s5.js +1073 -0
  41. package/dist/mermaid/chunk-BvVehae3.js +5069 -0
  42. package/dist/mermaid/chunk-C-JABYpd.js +3075 -0
  43. package/dist/mermaid/chunk-C9XlTm4w.js +2 -0
  44. package/dist/mermaid/chunk-CApNbSU9.js +6 -0
  45. package/dist/mermaid/chunk-CCM2AH-C.js +9 -0
  46. package/dist/mermaid/chunk-CD1E0F_N.js +2 -0
  47. package/dist/mermaid/chunk-CDWvKG7D.js +2 -0
  48. package/dist/mermaid/chunk-CEVPpC1F.js +34 -0
  49. package/dist/mermaid/chunk-CLDr12lf.js +47504 -0
  50. package/dist/mermaid/chunk-CLVYqOBI.js +61 -0
  51. package/dist/mermaid/chunk-CLeOkFb5.js +15 -0
  52. package/dist/mermaid/chunk-CLgRAtOz.js +37 -0
  53. package/dist/mermaid/chunk-CMqFNUBl.js +134 -0
  54. package/dist/mermaid/chunk-CTPaBJXB.js +2 -0
  55. package/dist/mermaid/chunk-CVi6IGBL.js +2 -0
  56. package/dist/mermaid/chunk-CWV_EN-4.js +4745 -0
  57. package/dist/mermaid/chunk-CZ0dAs3g.js +2 -0
  58. package/dist/mermaid/chunk-C_YGy4Fn.js +236 -0
  59. package/dist/mermaid/chunk-CcVH22Yt.js +100 -0
  60. package/dist/mermaid/chunk-CgG6CD9_.js +7175 -0
  61. package/dist/mermaid/chunk-CgOP6IDB.js +3397 -0
  62. package/dist/mermaid/chunk-Cgg2UTSf.js +13 -0
  63. package/dist/mermaid/chunk-ChJfJJ1A.js +214 -0
  64. package/dist/mermaid/chunk-Ck5XRA46.js +447 -0
  65. package/dist/mermaid/chunk-Ckuw16cl.js +203 -0
  66. package/dist/mermaid/chunk-CpAbRCbF.js +1880 -0
  67. package/dist/mermaid/chunk-CuYekbSv.js +2 -0
  68. package/dist/mermaid/chunk-CwS4wZ5a.js +2 -0
  69. package/dist/mermaid/chunk-D-bcrBO3.js +82 -0
  70. package/dist/mermaid/chunk-D3IEAkCW.js +76 -0
  71. package/dist/mermaid/chunk-D8XfBJ_K.js +645 -0
  72. package/dist/mermaid/chunk-D9Ddd9y4.js +2228 -0
  73. package/dist/mermaid/chunk-DBh1mIbK.js +12 -0
  74. package/dist/mermaid/chunk-DD6Df6Ic.js +5 -0
  75. package/dist/mermaid/chunk-DGVDaXjx.js +8 -0
  76. package/dist/mermaid/chunk-DK9KqIXj.js +632 -0
  77. package/dist/mermaid/chunk-DORnIAsy.js +4487 -0
  78. package/dist/mermaid/chunk-DU69_VcF.js +363 -0
  79. package/dist/mermaid/chunk-DVNvSFoz.js +2144 -0
  80. package/dist/mermaid/chunk-DZe-4kde.js +20 -0
  81. package/dist/mermaid/chunk-D_a06Rz4.js +287 -0
  82. package/dist/mermaid/chunk-DfyFJJi2.js +972 -0
  83. package/dist/mermaid/chunk-DhKYPp1Z.js +2 -0
  84. package/dist/mermaid/chunk-DjFqgNTG.js +94 -0
  85. package/dist/mermaid/chunk-DmbDDrr-.js +65 -0
  86. package/dist/mermaid/chunk-DpuxlyL_.js +696 -0
  87. package/dist/mermaid/chunk-DqGhppWe.js +2 -0
  88. package/dist/mermaid/chunk-DqPZxHXa.js +5 -0
  89. package/dist/mermaid/chunk-Dt_1Jyif.js +293 -0
  90. package/dist/mermaid/chunk-DyQBE_NW.js +1935 -0
  91. package/dist/mermaid/chunk-JckyC4mW.js +1009 -0
  92. package/dist/mermaid/chunk-K7Myuj2-.js +1334 -0
  93. package/dist/mermaid/chunk-KuPYb48V.js +275 -0
  94. package/dist/mermaid/chunk-MFVRUoO0.js +4020 -0
  95. package/dist/mermaid/chunk-MbInCS_6.js +28 -0
  96. package/dist/mermaid/chunk-MexOLyKV.js +355 -0
  97. package/dist/mermaid/chunk-NnbDtJzg.js +21856 -0
  98. package/dist/mermaid/chunk-SGpOYZbI.js +2139 -0
  99. package/dist/mermaid/chunk-TbxLDlcU.js +198 -0
  100. package/dist/mermaid/chunk-TftHqGLg.js +490 -0
  101. package/dist/mermaid/chunk-UjQ8vA_Z.js +4138 -0
  102. package/dist/mermaid/chunk-YgmVTKqc.js +16 -0
  103. package/dist/mermaid/chunk-_a9EZE1v.js +1798 -0
  104. package/dist/mermaid/chunk-dTb8jqeP.js +2 -0
  105. package/dist/mermaid/chunk-fFdMfF8S.js +2240 -0
  106. package/dist/mermaid/chunk-feYbMzBj.js +1267 -0
  107. package/dist/mermaid/chunk-g3Pn8DkW.js +46 -0
  108. package/dist/mermaid/chunk-hM77LvCb.js +19832 -0
  109. package/dist/mermaid/chunk-hUDb-eAW.js +527 -0
  110. package/dist/mermaid/chunk-tpABtZ-3.js +4252 -0
  111. package/dist/mermaid/chunk-xIbz3oFK.js +59 -0
  112. package/dist/mermaid/chunk-yBz-vst0.js +976 -0
  113. package/dist/mermaid/mermaid-BhtR3wyB.js +1145 -0
  114. package/dist/run-site-command-C80YoNOe.js +129 -0
  115. package/dist/site-config-bllORGpm.js +90 -0
  116. package/dist/site.js +1 -0
  117. package/dist/start-dev-server-C4_Lu1nZ.js +176 -0
  118. package/dist/to-change-queue-DbEnZGNK.js +34 -0
  119. package/dist/to-error-message-pF6_7wGK.js +16 -0
  120. package/dist/type/group-path.d.ts +7 -0
  121. package/dist/type/site-config.d.ts +57 -0
  122. package/package.json +34 -17
  123. package/src/component/widget/cursor-face/_constant/cursor-face.ts +0 -14
  124. package/src/component/widget/cursor-face/wg-cursor-face.css +0 -15
  125. package/src/component/widget/cursor-face/wg-cursor-face.tsx +0 -153
  126. package/src/component/widget/navigation/_constant/locale.ts +0 -9
  127. package/src/component/widget/navigation/_constant/navigation-data-schema.ts +0 -33
  128. package/src/component/widget/navigation/_constant/navigation.ts +0 -9
  129. package/src/component/widget/navigation/_constant/reading-line.ts +0 -4
  130. package/src/component/widget/navigation/_function/restore-navigation-scroll.ts +0 -59
  131. package/src/component/widget/navigation/_function/to-doc-groups/_to-doc-branches.ts +0 -15
  132. package/src/component/widget/navigation/_function/to-doc-groups/_to-doc-group-branches.ts +0 -70
  133. package/src/component/widget/navigation/_function/to-doc-groups/to-doc-groups.ts +0 -15
  134. package/src/component/widget/navigation/_function/to-navigation-data/_to-navigation-document.ts +0 -13
  135. package/src/component/widget/navigation/_function/to-navigation-data/_to-navigation-group.ts +0 -13
  136. package/src/component/widget/navigation/_function/to-navigation-data/to-navigation-data.ts +0 -18
  137. package/src/component/widget/navigation/_function/to-navigation-json.ts +0 -8
  138. package/src/component/widget/navigation/_function/to-toc-groups.ts +0 -38
  139. package/src/component/widget/navigation/_type/doc-branch.ts +0 -11
  140. package/src/component/widget/navigation/_type/doc-group.ts +0 -24
  141. package/src/component/widget/navigation/_type/navigation-data.ts +0 -75
  142. package/src/component/widget/navigation/_type/navigation-focus-snapshot.ts +0 -17
  143. package/src/component/widget/navigation/_type/toc-group.ts +0 -39
  144. package/src/component/widget/navigation/_wg-navigation-nav-list.css +0 -48
  145. package/src/component/widget/navigation/_wg-navigation-nav-list.tsx +0 -61
  146. package/src/component/widget/navigation/_wg-navigation-nav.css +0 -21
  147. package/src/component/widget/navigation/_wg-navigation-nav.tsx +0 -33
  148. package/src/component/widget/navigation/_wg-navigation-scroll.tsx +0 -117
  149. package/src/component/widget/navigation/_wg-navigation-toc.css +0 -91
  150. package/src/component/widget/navigation/_wg-navigation-toc.tsx +0 -114
  151. package/src/component/widget/navigation/wg-navigation.css +0 -282
  152. package/src/component/widget/navigation/wg-navigation.tsx +0 -420
  153. package/src/component/widget/prose/_constant/heading-highlight.ts +0 -4
  154. package/src/component/widget/prose/_constant/section.ts +0 -7
  155. package/src/component/widget/prose/_constant/status.ts +0 -9
  156. package/src/component/widget/prose/_function/has-block-content.ts +0 -30
  157. package/src/component/widget/prose/_function/rehype-head.ts +0 -31
  158. package/src/component/widget/prose/_function/rehype-sections/_to-section-headings.ts +0 -20
  159. package/src/component/widget/prose/_function/rehype-sections/rehype-sections.ts +0 -21
  160. package/src/component/widget/prose/_function/rehype-tables.ts +0 -22
  161. package/src/component/widget/prose/_function/remark-blocks.ts +0 -112
  162. package/src/component/widget/prose/_function/remark-flow.ts +0 -26
  163. package/src/component/widget/prose/_function/remark-links.ts +0 -33
  164. package/src/component/widget/prose/_function/remark-parts.ts +0 -26
  165. package/src/component/widget/prose/_function/remark-status.ts +0 -59
  166. package/src/component/widget/prose/_function/remark-swatch.ts +0 -16
  167. package/src/component/widget/prose/_function/remark-unknown-directives.ts +0 -25
  168. package/src/component/widget/prose/wg-prose.css +0 -454
  169. package/src/component/widget/prose/wg-prose.tsx +0 -43
  170. package/src/component/widget/shell/wg-shell.css +0 -63
  171. package/src/component/widget/shell/wg-shell.tsx +0 -88
  172. package/src/component/widget/shell-controls/wg-shell-controls.css +0 -4
  173. package/src/component/widget/shell-controls/wg-shell-controls.tsx +0 -170
  174. package/src/constant/asset.ts +0 -63
  175. package/src/constant/copy.ts +0 -133
  176. package/src/constant/doc.ts +0 -13
  177. package/src/constant/font.ts +0 -34
  178. package/src/constant/site.ts +0 -24
  179. package/src/constant/status.ts +0 -15
  180. package/src/entry/browser/browser.tsx +0 -22
  181. package/src/entry/cli/_constant/cli.ts +0 -19
  182. package/src/entry/cli/_constant/crawling.ts +0 -14
  183. package/src/entry/cli/_constant/snippet.ts +0 -21
  184. package/src/entry/cli/_function/create-app.tsx +0 -57
  185. package/src/entry/cli/_function/create-dev-app.ts +0 -87
  186. package/src/entry/cli/_function/create-processor/_rehype-assets.ts +0 -70
  187. package/src/entry/cli/_function/create-processor/_rehype-heading-ids.ts +0 -34
  188. package/src/entry/cli/_function/create-processor/_remark-report.ts +0 -15
  189. package/src/entry/cli/_function/create-processor/_remark-snippets.ts +0 -117
  190. package/src/entry/cli/_function/create-processor/_shiki-transformers.ts +0 -55
  191. package/src/entry/cli/_function/create-processor/create-processor.ts +0 -64
  192. package/src/entry/cli/_function/read-docs.ts +0 -128
  193. package/src/entry/cli/_function/read-home.ts +0 -32
  194. package/src/entry/cli/_function/to-crawling-app.ts +0 -42
  195. package/src/entry/cli/cli.test.ts +0 -782
  196. package/src/entry/cli/cli.ts +0 -206
  197. package/src/env.d.ts +0 -6
  198. package/src/page/doc/pg-doc.tsx +0 -35
  199. package/src/page/home/pg-home.tsx +0 -40
  200. package/src/store/navigation/create-navigation-stores.test.ts +0 -74
  201. package/src/store/navigation/create-navigation-stores.ts +0 -59
  202. package/src/store/navigation/navigation-state.ts +0 -36
  203. package/src/store/navigation/navigation-storage.ts +0 -9
  204. package/src/store/navigation/to-navigation-scroll-state.ts +0 -42
  205. package/src/style/base.css +0 -28
  206. package/src/style/token.css +0 -186
  207. package/src/type/doc-content.ts +0 -15
  208. package/src/type/doc-data.ts +0 -38
  209. package/src/type/doc-file-data.ts +0 -21
  210. package/src/type/doc-heading.ts +0 -17
  211. package/src/type/doc-outline.ts +0 -16
  212. package/src/type/doc-section.ts +0 -9
  213. package/src/type/doc.ts +0 -20
  214. package/src/type/group-path.ts +0 -7
  215. package/src/type/site-assets.ts +0 -25
  216. package/src/type/site-config.ts +0 -73
  217. package/src/type/vfile-data.d.ts +0 -10
  218. package/src/util/async/to-change-queue.test.ts +0 -58
  219. package/src/util/async/to-change-queue.ts +0 -43
  220. package/src/util/dom/find-hash-target.ts +0 -18
  221. package/src/util/dom/reveal-hash-target.ts +0 -15
  222. package/src/util/error/to-error-message.ts +0 -10
  223. package/src/util/file/to-asset-path.ts +0 -26
  224. package/src/util/font/to-font-css.test.ts +0 -41
  225. package/src/util/font/to-font-css.ts +0 -28
  226. package/src/util/mermaid/render-flow.js +0 -321
@@ -0,0 +1,203 @@
1
+ import { m as e } from "./chunk-DVNvSFoz.js";
2
+ import { n as t } from "./chunk-BYzrzvCI.js";
3
+ import { C as n, H as r, U as i, _ as a, a as o, b as s, c, f as l, q as u, v as d } from "./chunk-MFVRUoO0.js";
4
+ import { t as f } from "./chunk-DmbDDrr-.js";
5
+ import { n as p } from "./chunk-6HLei9i0.js";
6
+ import { m } from "./chunk-xIbz3oFK.js";
7
+ import { t as h } from "./chunk-D-bcrBO3.js";
8
+ import { t as g } from "./chunk-CApNbSU9.js";
9
+ import { i as _, m as v } from "./chunk-K7Myuj2-.js";
10
+ import { t as y } from "./chunk-B58sEIY_.js";
11
+ import { n as b } from "./chunk-DK9KqIXj.js";
12
+ import { t as x } from "./chunk-DGVDaXjx.js";
13
+ //#region node_modules/.pnpm/d3-shape@3.2.0/node_modules/d3-shape/src/descending.js
14
+ function S(e, t) {
15
+ return t < e ? -1 : t > e ? 1 : t >= e ? 0 : NaN;
16
+ }
17
+ //#endregion
18
+ //#region node_modules/.pnpm/d3-shape@3.2.0/node_modules/d3-shape/src/identity.js
19
+ function C(e) {
20
+ return e;
21
+ }
22
+ //#endregion
23
+ //#region node_modules/.pnpm/d3-shape@3.2.0/node_modules/d3-shape/src/pie.js
24
+ function w() {
25
+ var e = C, t = S, n = null, r = p(0), i = p(m), a = p(0);
26
+ function o(o) {
27
+ var s, c = (o = g(o)).length, l, u, d = 0, f = Array(c), p = Array(c), h = +r.apply(this, arguments), _ = Math.min(m, Math.max(-m, i.apply(this, arguments) - h)), v, y = Math.min(Math.abs(_) / c, a.apply(this, arguments)), b = y * (_ < 0 ? -1 : 1), x;
28
+ for (s = 0; s < c; ++s) (x = p[f[s] = s] = +e(o[s], s, o)) > 0 && (d += x);
29
+ for (t == null ? n != null && f.sort(function(e, t) {
30
+ return n(o[e], o[t]);
31
+ }) : f.sort(function(e, n) {
32
+ return t(p[e], p[n]);
33
+ }), s = 0, u = d ? (_ - c * b) / d : 0; s < c; ++s, h = v) l = f[s], x = p[l], v = h + (x > 0 ? x * u : 0) + b, p[l] = {
34
+ data: o[l],
35
+ index: s,
36
+ value: x,
37
+ startAngle: h,
38
+ endAngle: v,
39
+ padAngle: y
40
+ };
41
+ return p;
42
+ }
43
+ return o.value = function(t) {
44
+ return arguments.length ? (e = typeof t == "function" ? t : p(+t), o) : e;
45
+ }, o.sortValues = function(e) {
46
+ return arguments.length ? (t = e, n = null, o) : t;
47
+ }, o.sort = function(e) {
48
+ return arguments.length ? (n = e, t = null, o) : n;
49
+ }, o.startAngle = function(e) {
50
+ return arguments.length ? (r = typeof e == "function" ? e : p(+e), o) : r;
51
+ }, o.endAngle = function(e) {
52
+ return arguments.length ? (i = typeof e == "function" ? e : p(+e), o) : i;
53
+ }, o.padAngle = function(e) {
54
+ return arguments.length ? (a = typeof e == "function" ? e : p(+e), o) : a;
55
+ }, o;
56
+ }
57
+ //#endregion
58
+ //#region node_modules/.pnpm/mermaid@12.2.0/node_modules/mermaid/dist/chunks/mermaid.core/pieDiagram-GNMPY74T.mjs
59
+ var T = l.pie, E = {
60
+ sections: /* @__PURE__ */ new Map(),
61
+ showData: !1,
62
+ config: T
63
+ }, D = E.sections, O = E.showData, k = structuredClone(T), A = {
64
+ getConfig: /* @__PURE__ */ t(() => structuredClone(k), "getConfig"),
65
+ clear: /* @__PURE__ */ t(() => {
66
+ D = /* @__PURE__ */ new Map(), O = E.showData, o();
67
+ }, "clear"),
68
+ setDiagramTitle: u,
69
+ getDiagramTitle: n,
70
+ setAccTitle: i,
71
+ getAccTitle: d,
72
+ setAccDescription: r,
73
+ getAccDescription: a,
74
+ addSection: /* @__PURE__ */ t(({ label: t, value: n }) => {
75
+ if (n < 0) throw Error(`"${t}" has invalid value: ${n}. Negative values are not allowed in pie charts. All slice values must be >= 0.`);
76
+ D.has(t) || (D.set(t, n), e.debug(`added new section: ${t}, with value: ${n}`));
77
+ }, "addSection"),
78
+ getSections: /* @__PURE__ */ t(() => D, "getSections"),
79
+ setShowData: /* @__PURE__ */ t((e) => {
80
+ O = e;
81
+ }, "setShowData"),
82
+ getShowData: /* @__PURE__ */ t(() => O, "getShowData")
83
+ }, j = /* @__PURE__ */ t((e, t) => {
84
+ x(e, t), t.setShowData(e.showData), e.sections.map(t.addSection);
85
+ }, "populateDb"), M = { parse: /* @__PURE__ */ t(async (t) => {
86
+ let n = await b("pie", t);
87
+ e.debug(n), j(n, A);
88
+ }, "parse") }, N = /* @__PURE__ */ t((e) => `
89
+ .pieCircle{
90
+ stroke: ${e.pieStrokeColor};
91
+ stroke-width : ${e.pieStrokeWidth};
92
+ opacity : ${e.pieOpacity};
93
+ }
94
+ .pieCircle.highlighted{
95
+ scale: 1.05;
96
+ opacity: 1;
97
+ }
98
+ .pieCircle.highlightedOnHover:hover{
99
+ transition-duration: 250ms;
100
+ scale: 1.05;
101
+ opacity: 1;
102
+ }
103
+ .pieOuterCircle{
104
+ stroke: ${e.pieOuterStrokeColor};
105
+ stroke-width: ${e.pieOuterStrokeWidth};
106
+ fill: none;
107
+ }
108
+ .pieTitleText {
109
+ text-anchor: middle;
110
+ font-size: ${e.pieTitleTextSize};
111
+ fill: ${e.pieTitleTextColor};
112
+ font-family: ${e.fontFamily};
113
+ }
114
+ .slice {
115
+ font-family: ${e.fontFamily};
116
+ fill: ${e.pieSectionTextColor};
117
+ font-size:${e.pieSectionTextSize};
118
+ // fill: white;
119
+ }
120
+ .legend text {
121
+ fill: ${e.pieLegendTextColor};
122
+ font-family: ${e.fontFamily};
123
+ font-size: ${e.pieLegendTextSize};
124
+ }
125
+ `, "getStyles"), P = /* @__PURE__ */ t((e) => {
126
+ let t = [...e.values()].reduce((e, t) => e + t, 0), n = [...e.entries()].map(([e, t]) => ({
127
+ label: e,
128
+ value: t
129
+ })).filter((e) => e.value / t * 100 >= 1);
130
+ return w().value((e) => e.value).sort(null)(n);
131
+ }, "createPieArcs"), F = {
132
+ parser: M,
133
+ db: A,
134
+ renderer: { draw: /* @__PURE__ */ t((t, n, r, i) => {
135
+ e.debug("rendering pie chart\n" + t);
136
+ let a = i.db, o = s(), l = _(a.getConfig(), o.pie), u = y(n), d = u.append("g");
137
+ d.attr("transform", "translate(225,225)");
138
+ let { themeVariables: p } = o, [m] = v(p.pieOuterStrokeWidth);
139
+ m ??= 2;
140
+ let g = l.legendPosition, b = l.textPosition, x = l.donutHole > 0 && l.donutHole <= .9 ? l.donutHole : 0, S = h().innerRadius(x * 185).outerRadius(185), C = h().innerRadius(185 * b).outerRadius(185 * b), w = d.append("g");
141
+ w.append("circle").attr("cx", 0).attr("cy", 0).attr("r", 185 + m / 2).attr("class", "pieOuterCircle");
142
+ let T = a.getSections(), E = P(T), D = [
143
+ p.pie1,
144
+ p.pie2,
145
+ p.pie3,
146
+ p.pie4,
147
+ p.pie5,
148
+ p.pie6,
149
+ p.pie7,
150
+ p.pie8,
151
+ p.pie9,
152
+ p.pie10,
153
+ p.pie11,
154
+ p.pie12
155
+ ], O = 0;
156
+ T.forEach((e) => {
157
+ O += e;
158
+ });
159
+ let k = E.filter((e) => (e.data.value / O * 100).toFixed(0) !== "0"), A = f(D).domain([...T.keys()]);
160
+ w.selectAll("mySlices").data(k).enter().append("path").attr("d", S).attr("fill", (e) => A(e.data.label)).attr("class", (e) => {
161
+ let t = "pieCircle";
162
+ return l.highlightSlice === "hover" ? t += " highlightedOnHover" : l.highlightSlice === e.data.label && (t += " highlighted"), t;
163
+ }), w.selectAll("mySlices").data(k).enter().append("text").text((e) => (e.data.value / O * 100).toFixed(0) + "%").attr("transform", (e) => "translate(" + C.centroid(e) + ")").style("text-anchor", "middle").attr("class", "slice");
164
+ let j = d.append("text").text(a.getDiagramTitle()).attr("x", 0).attr("y", -200).attr("class", "pieTitleText"), M = [...T.entries()].map(([e, t]) => ({
165
+ label: e,
166
+ value: t
167
+ })), N = d.selectAll(".legend").data(M).enter().append("g").attr("class", "legend");
168
+ N.append("rect").attr("width", 18).attr("height", 18).style("fill", (e) => A(e.label)).style("stroke", (e) => A(e.label)), N.append("text").attr("x", 22).attr("y", 14).text((e) => a.getShowData() ? `${e.label} [${e.value}]` : e.label);
169
+ let F = Math.max(...N.selectAll("text").nodes().map((e) => e?.getBoundingClientRect().width ?? 0)), I = 450, L = 490, R = M.length * 22;
170
+ switch (g) {
171
+ case "center":
172
+ N.attr("transform", (e, t) => {
173
+ let n = 22 * M.length / 2, r = -F / 2 - 22, i = t * 22 - n;
174
+ return "translate(" + r + "," + i + ")";
175
+ });
176
+ break;
177
+ case "top":
178
+ I += R, N.attr("transform", (e, t) => `translate(${-F / 2 - 22}, ${t * 22 - 185})`), w.attr("transform", () => `translate(0, ${R + 22})`);
179
+ break;
180
+ case "bottom":
181
+ I += R, N.attr("transform", (e, t) => {
182
+ let n = -F / 2 - 22, r = t * 22 - -207;
183
+ return "translate(" + n + "," + r + ")";
184
+ });
185
+ break;
186
+ case "left":
187
+ L += 22 + F, N.attr("transform", (e, t) => {
188
+ let n = 22 * M.length / 2;
189
+ return "translate(-207," + (t * 22 - n) + ")";
190
+ }), w.attr("transform", () => `translate(${F + 18 + 4}, 0)`);
191
+ break;
192
+ default: L += 22 + F, N.attr("transform", (e, t) => {
193
+ let n = 22 * M.length / 2;
194
+ return "translate(216," + (t * 22 - n) + ")";
195
+ });
196
+ }
197
+ let z = j.node()?.getBoundingClientRect().width ?? 0, B = 225 - z / 2, V = 225 + z / 2, H = Math.min(0, B), U = Math.max(L, V) - H;
198
+ u.attr("viewBox", `${H} 0 ${U} ${I}`), c(u, I, U, l.useMaxWidth);
199
+ }, "draw") },
200
+ styles: N
201
+ };
202
+ //#endregion
203
+ export { F as diagram };