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,28 @@
1
+ import "./chunk-DVNvSFoz.js";
2
+ import { n as e } from "./chunk-BYzrzvCI.js";
3
+ import "./chunk-MFVRUoO0.js";
4
+ import "./chunk-K7Myuj2-.js";
5
+ import "./chunk-B9_UWzSH.js";
6
+ import "./chunk-Bok8z-Yo.js";
7
+ import "./chunk-KuPYb48V.js";
8
+ import "./chunk-_a9EZE1v.js";
9
+ import "./chunk-DORnIAsy.js";
10
+ import "./chunk-CLgRAtOz.js";
11
+ import "./chunk-DU69_VcF.js";
12
+ import "./chunk-DpuxlyL_.js";
13
+ import "./chunk-BB8uZHwY.js";
14
+ import "./chunk-CLVYqOBI.js";
15
+ import "./chunk-CCM2AH-C.js";
16
+ import "./chunk-BL404pH5.js";
17
+ import { r as t, t as n } from "./chunk-tpABtZ-3.js";
18
+ //#region node_modules/.pnpm/mermaid@12.2.0/node_modules/mermaid/dist/chunks/mermaid.core/swimlanesDiagram-AYQRV4AK.mjs
19
+ var r = n({ styles: /* @__PURE__ */ e((e) => `${t(e)}
20
+ .swimlane.cluster:not([data-color-id]) rect {
21
+ stroke: ${e.clusterBorder} !important;
22
+ }
23
+ [data-look="neo"].cluster rect {
24
+ filter: none;
25
+ }
26
+ `, "getStyles") });
27
+ //#endregion
28
+ export { r as diagram };
@@ -0,0 +1,355 @@
1
+ import { m as e } from "./chunk-DVNvSFoz.js";
2
+ import { n as t } from "./chunk-BYzrzvCI.js";
3
+ import { C as n, E as r, H as i, U as a, _ as o, a as s, c, f as l, q as u, v as d, y as f } from "./chunk-MFVRUoO0.js";
4
+ import { i as p } from "./chunk-K7Myuj2-.js";
5
+ import { t as m } from "./chunk-B58sEIY_.js";
6
+ import { n as h } from "./chunk-DK9KqIXj.js";
7
+ import { t as g } from "./chunk-DGVDaXjx.js";
8
+ //#region node_modules/.pnpm/mermaid@12.2.0/node_modules/mermaid/dist/chunks/mermaid.core/cynefinDiagram-WF24UDRP.mjs
9
+ var _ = /* @__PURE__ */ t(() => ({
10
+ domains: /* @__PURE__ */ new Map(),
11
+ transitions: []
12
+ }), "createDefaultData"), v = _(), y = {
13
+ getDomains: /* @__PURE__ */ t(() => v.domains, "getDomains"),
14
+ getTransitions: /* @__PURE__ */ t(() => v.transitions, "getTransitions"),
15
+ setDomains: /* @__PURE__ */ t((e) => {
16
+ if (e) for (let t of e) {
17
+ let e = t.domain, n = (t.items ?? []).map((e) => ({ label: e.label }));
18
+ v.domains.set(e, {
19
+ name: e,
20
+ items: n
21
+ });
22
+ }
23
+ }, "setDomains"),
24
+ setTransitions: /* @__PURE__ */ t((t) => {
25
+ t && (v.transitions = t.filter((t) => t.from !== t.to || (e.warn(`Cynefin: self-loop transition on domain "${t.from}" is not meaningful and will be skipped.`), !1)).map((e) => ({
26
+ from: e.from,
27
+ to: e.to,
28
+ label: e.label || void 0
29
+ })));
30
+ }, "setTransitions"),
31
+ getConfig: /* @__PURE__ */ t(() => p({
32
+ ...l.cynefin,
33
+ ...f().cynefin
34
+ }), "getConfig"),
35
+ clear: /* @__PURE__ */ t(() => {
36
+ s(), v = _();
37
+ }, "clear"),
38
+ setAccTitle: a,
39
+ getAccTitle: d,
40
+ setDiagramTitle: u,
41
+ getDiagramTitle: n,
42
+ getAccDescription: o,
43
+ setAccDescription: i
44
+ }, b = /* @__PURE__ */ t((e) => {
45
+ g(e, y), y.setDomains(e.domains), y.setTransitions(e.transitions);
46
+ }, "populate"), x = { parse: /* @__PURE__ */ t(async (t) => {
47
+ let n = await h("cynefin", t);
48
+ e.debug(n), b(n);
49
+ }, "parse") };
50
+ function S(e) {
51
+ let t = e + 1831565813 | 0;
52
+ return t = Math.imul(t ^ t >>> 15, t | 1), t ^= t + Math.imul(t ^ t >>> 7, t | 61), ((t ^ t >>> 14) >>> 0) / 4294967296;
53
+ }
54
+ t(S, "seededRandom");
55
+ function C(e) {
56
+ let t = 0;
57
+ for (let n = 0; n < e.length; n++) {
58
+ let r = e.charCodeAt(n);
59
+ t = (t << 5) - t + r, t |= 0;
60
+ }
61
+ return t;
62
+ }
63
+ t(C, "hashString");
64
+ function w(e, t) {
65
+ return typeof e == "number" && Number.isFinite(e) && e !== 0 ? e : C(t);
66
+ }
67
+ t(w, "resolveSeed");
68
+ function T(e, t, n, r) {
69
+ let i = e / 2, a = r ?? e * .015, o = t / 7, s = [];
70
+ for (let e = 0; e <= 7; e++) {
71
+ let t = S(n + e * 17) * a * 2 - a;
72
+ s.push({
73
+ x: i + t,
74
+ y: e * o
75
+ });
76
+ }
77
+ let c = `M${s[0].x},${s[0].y}`;
78
+ for (let e = 0; e < s.length - 1; e++) {
79
+ let t = s[e], r = s[e + 1], i = (t.y + r.y) / 2, o = e % 2 == 0 ? 1 : -1, l = a * 1.5 * o * S(n + e * 31 + 7), u = t.x + l, d = i, f = r.x - l;
80
+ c += ` C${u},${d} ${f},${i} ${r.x},${r.y}`;
81
+ }
82
+ return c;
83
+ }
84
+ t(T, "generateFoldPath");
85
+ function E(e, t, n, r) {
86
+ let i = t / 2, a = r ?? t * .015, o = e / 7, s = [];
87
+ for (let e = 0; e <= 7; e++) {
88
+ let t = S(n + e * 23) * a * 2 - a;
89
+ s.push({
90
+ x: e * o,
91
+ y: i + t
92
+ });
93
+ }
94
+ let c = `M${s[0].x},${s[0].y}`;
95
+ for (let e = 0; e < s.length - 1; e++) {
96
+ let t = s[e], r = s[e + 1], i = (t.x + r.x) / 2, o = e % 2 == 0 ? 1 : -1, l = a * 1.5 * o * S(n + e * 37 + 11), u = i, d = t.y + l, f = i, p = r.y - l;
97
+ c += ` C${u},${d} ${f},${p} ${r.x},${r.y}`;
98
+ }
99
+ return c;
100
+ }
101
+ t(E, "generateHorizontalBoundary");
102
+ function D(e, t) {
103
+ let n = e / 2, r = t * .5, i = t, a = e * .03;
104
+ return [
105
+ `M${n},${r}`,
106
+ `C${n + a},${r + (i - r) * .2}`,
107
+ `${n - a * 1.5},${r + (i - r) * .55}`,
108
+ `${n + a * .5},${r + (i - r) * .75}`,
109
+ `C${n - a},${r + (i - r) * .85}`,
110
+ `${n + a * .3},${r + (i - r) * .95}`,
111
+ `${n},${i}`
112
+ ].join(" ");
113
+ }
114
+ t(D, "generateCliffPath");
115
+ function O(e, t, n, r) {
116
+ return [
117
+ `M${e - n},${t}`,
118
+ `A${n},${r} 0 1,1 ${e + n},${t}`,
119
+ `A${n},${r} 0 1,1 ${e - n},${t}`,
120
+ "Z"
121
+ ].join(" ");
122
+ }
123
+ t(O, "generateConfusionPath");
124
+ var k = {
125
+ complex: {
126
+ model: "Probe → Sense → Respond",
127
+ practice: "Emergent Practices"
128
+ },
129
+ complicated: {
130
+ model: "Sense → Analyse → Respond",
131
+ practice: "Good Practices"
132
+ },
133
+ clear: {
134
+ model: "Sense → Categorise → Respond",
135
+ practice: "Best Practices"
136
+ },
137
+ chaotic: {
138
+ model: "Act → Sense → Respond",
139
+ practice: "Novel Practices"
140
+ },
141
+ confusion: {
142
+ model: "",
143
+ practice: "Disorder"
144
+ }
145
+ }, A = /* @__PURE__ */ t((e, t) => {
146
+ let n = e / 2, r = t / 2;
147
+ return {
148
+ complex: {
149
+ cx: n / 2,
150
+ cy: r / 2,
151
+ x: 0,
152
+ y: 0,
153
+ w: n,
154
+ h: r
155
+ },
156
+ complicated: {
157
+ cx: n + n / 2,
158
+ cy: r / 2,
159
+ x: n,
160
+ y: 0,
161
+ w: n,
162
+ h: r
163
+ },
164
+ chaotic: {
165
+ cx: n / 2,
166
+ cy: r + r / 2,
167
+ x: 0,
168
+ y: r,
169
+ w: n,
170
+ h: r
171
+ },
172
+ clear: {
173
+ cx: n + n / 2,
174
+ cy: r + r / 2,
175
+ x: n,
176
+ y: r,
177
+ w: n,
178
+ h: r
179
+ },
180
+ confusion: {
181
+ cx: n,
182
+ cy: r,
183
+ x: n * .7,
184
+ y: r * .7,
185
+ w: n * .6,
186
+ h: r * .6
187
+ }
188
+ };
189
+ }, "getDomainLayouts"), j = /* @__PURE__ */ t(() => {
190
+ let e = r(), t = f();
191
+ return p(e, t.themeVariables).cynefin;
192
+ }, "getCynefinDomainColors"), M = 3, N = { draw: /* @__PURE__ */ t((t, n, r, i) => {
193
+ let a = i.db, o = a.getDomains(), s = a.getTransitions(), l = a.getDiagramTitle(), u = a.getAccTitle(), d = a.getAccDescription(), f = a.getConfig(), p = j();
194
+ e.debug("Rendering Cynefin diagram");
195
+ let h = f.width, g = f.height, _ = f.padding, v = f.showDomainDescriptions, y = f.boundaryAmplitude, b = h + _ * 2, x = g + _ * 2, S = {
196
+ complex: p.complexBg,
197
+ complicated: p.complicatedBg,
198
+ clear: p.clearBg,
199
+ chaotic: p.chaoticBg,
200
+ confusion: p.confusionBg
201
+ }, C = m(n);
202
+ c(C, x, b, f.useMaxWidth ?? !0), C.attr("viewBox", `0 0 ${b} ${x}`), u && C.append("title").text(u), d && C.append("desc").text(d);
203
+ let N = C.append("g").attr("transform", `translate(${_}, ${_})`), P = A(h, g), F = w(f.seed, n), I = N.append("g").attr("class", "cynefin-backgrounds"), L = [
204
+ "complex",
205
+ "complicated",
206
+ "chaotic",
207
+ "clear"
208
+ ];
209
+ for (let e of L) {
210
+ let t = P[e];
211
+ I.append("rect").attr("class", "cynefinDomain").attr("x", t.x).attr("y", t.y).attr("width", t.w).attr("height", t.h).attr("fill", S[e]).attr("fill-opacity", .4).attr("stroke", "none");
212
+ }
213
+ let R = N.append("g").attr("class", "cynefin-boundaries");
214
+ R.append("path").attr("class", "cynefinBoundary").attr("d", T(h, g, F, y)).attr("fill", "none"), R.append("path").attr("class", "cynefinBoundary").attr("d", E(h, g, F + 100, y)).attr("fill", "none"), R.append("path").attr("class", "cynefinCliff").attr("d", D(h, g)).attr("fill", "none");
215
+ let z = h * .15, B = g * .15;
216
+ N.append("path").attr("class", "cynefinConfusion").attr("d", O(h / 2, g / 2, z, B)).attr("fill", S.confusion).attr("fill-opacity", .5);
217
+ let V = N.append("g").attr("class", "cynefin-labels");
218
+ for (let e of L) {
219
+ let t = P[e];
220
+ V.append("text").attr("class", "cynefinDomainLabel").attr("x", t.cx).attr("y", v ? t.cy - 30 : t.cy).attr("text-anchor", "middle").attr("dominant-baseline", "middle").text(e.charAt(0).toUpperCase() + e.slice(1));
221
+ }
222
+ if (V.append("text").attr("class", "cynefinDomainLabel").attr("x", h / 2).attr("y", v ? g / 2 - 10 : g / 2).attr("text-anchor", "middle").attr("dominant-baseline", "middle").text("Confusion"), v) {
223
+ let e = N.append("g").attr("class", "cynefin-subtitles");
224
+ for (let t of L) {
225
+ let n = P[t], r = k[t];
226
+ e.append("text").attr("class", "cynefinSubtitle").attr("x", n.cx).attr("y", n.cy - 10).attr("text-anchor", "middle").attr("dominant-baseline", "middle").text(r.model), e.append("text").attr("class", "cynefinSubtitle").attr("x", n.cx).attr("y", n.cy + 5).attr("text-anchor", "middle").attr("dominant-baseline", "middle").text(r.practice);
227
+ }
228
+ e.append("text").attr("class", "cynefinSubtitle").attr("x", h / 2).attr("y", g / 2 + 8).attr("text-anchor", "middle").attr("dominant-baseline", "middle").text(k.confusion.practice);
229
+ }
230
+ let H = N.append("g").attr("class", "cynefin-items");
231
+ for (let e of [
232
+ "complex",
233
+ "complicated",
234
+ "chaotic",
235
+ "clear",
236
+ "confusion"
237
+ ]) {
238
+ let t = o.get(e);
239
+ if (!t || t.items.length === 0) continue;
240
+ let n = P[e], r = e === "confusion", i = t.items, a = 0;
241
+ r && t.items.length > M && (a = t.items.length - M, i = t.items.slice(0, M));
242
+ let s;
243
+ if (r) {
244
+ let e = v ? 22 : 14;
245
+ s = n.cy + e;
246
+ } else s = n.cy + (v ? 25 : 15);
247
+ if ([...i].forEach((t, r) => {
248
+ let i = s + r * 30, a = H.append("g"), o = a.append("text").attr("class", "cynefinItemText").attr("x", 0).attr("y", 13).attr("text-anchor", "middle").attr("dominant-baseline", "central").text(t.label), c = t.label.length * 7, l = o.node();
249
+ if (l && typeof l.getBBox == "function") {
250
+ let e = l.getBBox();
251
+ e.width > 0 && (c = e.width);
252
+ }
253
+ let u = c + 20, d = n.cx - u / 2;
254
+ a.attr("transform", `translate(${d}, ${i})`), a.insert("rect", "text").attr("class", "cynefinItem").attr("x", 0).attr("y", 0).attr("width", u).attr("height", 26).attr("rx", 4).attr("ry", 4).attr("fill", S[e]).attr("fill-opacity", .95), o.attr("x", u / 2).attr("y", 13);
255
+ }), a > 0) {
256
+ let t = s + i.length * 30, r = `+${a} more`, o = H.append("g"), c = o.append("text").attr("class", "cynefinItemText").attr("x", 0).attr("y", 13).attr("text-anchor", "middle").attr("dominant-baseline", "central").text(r), l = r.length * 7, u = c.node();
257
+ if (u && typeof u.getBBox == "function") {
258
+ let e = u.getBBox();
259
+ e.width > 0 && (l = e.width);
260
+ }
261
+ let d = l + 20, f = n.cx - d / 2;
262
+ o.attr("transform", `translate(${f}, ${t})`), o.insert("rect", "text").attr("class", "cynefinItemOverflow").attr("x", 0).attr("y", 0).attr("width", d).attr("height", 26).attr("rx", 4).attr("ry", 4).attr("fill", S[e]).attr("fill-opacity", .6), c.attr("x", d / 2).attr("y", 13);
263
+ }
264
+ }
265
+ if (s.length > 0) {
266
+ let t = C.select("defs").empty() ? C.append("defs") : C.select("defs"), r = `cynefin-arrow-${n}`;
267
+ t.append("marker").attr("id", r).attr("viewBox", "0 0 10 10").attr("refX", 9).attr("refY", 5).attr("markerWidth", 6).attr("markerHeight", 6).attr("orient", "auto-start-reverse").append("path").attr("d", "M 0 0 L 10 5 L 0 10 z").attr("class", "cynefinArrowHead");
268
+ let i = N.append("g").attr("class", "cynefin-arrows");
269
+ s.forEach((t) => {
270
+ let n = P[t.from], a = P[t.to];
271
+ if (!n || !a) return;
272
+ if (t.from === t.to) {
273
+ e.warn(`Cynefin renderer: skipping self-loop on domain "${t.from}"`);
274
+ return;
275
+ }
276
+ let o = n.cx, s = n.cy, c = a.cx, l = a.cy, u = (o + c) / 2, d = (s + l) / 2, f = c - o, p = l - s, m = Math.sqrt(f * f + p * p), h = m * .15, g = -p / m, _ = f / m, v = u + g * h, y = d + _ * h;
277
+ i.append("path").attr("class", "cynefinArrowLine").attr("d", `M${o},${s} Q${v},${y} ${c},${l}`).attr("fill", "none").attr("marker-end", `url(#${r})`), t.label && i.append("text").attr("class", "cynefinArrowLabel").attr("x", v).attr("y", y - 6).attr("text-anchor", "middle").attr("dominant-baseline", "auto").text(t.label);
278
+ });
279
+ }
280
+ l && N.append("text").attr("class", "cynefinTitle").attr("x", h / 2).attr("y", -_ / 2).attr("text-anchor", "middle").attr("dominant-baseline", "middle").text(l);
281
+ }, "draw") }, P = /* @__PURE__ */ t(() => {
282
+ let e = r(), t = f();
283
+ return p(e, t.themeVariables).cynefin;
284
+ }, "getCynefinTheme"), F = {
285
+ parser: x,
286
+ db: y,
287
+ renderer: N,
288
+ styles: /* @__PURE__ */ t(() => {
289
+ let e = P();
290
+ return `
291
+ .cynefinDomain {
292
+ stroke: none;
293
+ }
294
+ .cynefinDomainLabel {
295
+ font-size: ${e.domainFontSize}px;
296
+ font-weight: bold;
297
+ fill: ${e.labelColor};
298
+ }
299
+ .cynefinSubtitle {
300
+ font-size: ${e.itemFontSize - 1}px;
301
+ fill: ${e.textColor};
302
+ font-style: italic;
303
+ }
304
+ .cynefinItem {
305
+ fill-opacity: 0.95;
306
+ stroke: ${e.boundaryColor};
307
+ stroke-width: 1;
308
+ }
309
+ .cynefinItemText {
310
+ font-size: ${e.itemFontSize}px;
311
+ fill: ${e.textColor};
312
+ }
313
+ .cynefinItemOverflow {
314
+ fill-opacity: 0.6;
315
+ stroke: ${e.boundaryColor};
316
+ stroke-width: 1;
317
+ stroke-dasharray: 3 2;
318
+ }
319
+ .cynefinBoundary {
320
+ stroke: ${e.boundaryColor};
321
+ stroke-width: ${e.boundaryWidth};
322
+ stroke-dasharray: 6 3;
323
+ }
324
+ .cynefinCliff {
325
+ stroke: ${e.cliffColor};
326
+ stroke-width: ${e.cliffWidth};
327
+ }
328
+ .cynefinConfusion {
329
+ stroke: ${e.boundaryColor};
330
+ stroke-width: 1.5;
331
+ stroke-dasharray: 4 2;
332
+ }
333
+ .cynefinArrowLine {
334
+ stroke: ${e.arrowColor};
335
+ stroke-width: ${e.arrowWidth};
336
+ fill: none;
337
+ }
338
+ .cynefinArrowHead {
339
+ fill: ${e.arrowColor};
340
+ stroke: none;
341
+ }
342
+ .cynefinArrowLabel {
343
+ font-size: ${e.itemFontSize - 1}px;
344
+ fill: ${e.textColor};
345
+ }
346
+ .cynefinTitle {
347
+ font-size: ${e.domainFontSize + 2}px;
348
+ font-weight: bold;
349
+ fill: ${e.labelColor};
350
+ }
351
+ `;
352
+ }, "styles")
353
+ };
354
+ //#endregion
355
+ export { F as diagram };