@legionworks/facet 1.9.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 (327) hide show
  1. package/LICENSE-APACHE +202 -0
  2. package/LICENSE-MIT +23 -0
  3. package/README.md +158 -0
  4. package/dist/gallery/chunk-4g8rem85.css +656 -0
  5. package/dist/gallery/chunk-c6s9k9ty.js +5970 -0
  6. package/dist/gallery/frame/artifact.css +8424 -0
  7. package/dist/gallery/frame/chunks/abnfDiagram-N423BO3Z-jj74szbm.js +155 -0
  8. package/dist/gallery/frame/chunks/architecture-TIHT7OUA-cvdjn7dt.js +10 -0
  9. package/dist/gallery/frame/chunks/architectureDiagram-T3A2C74G-n4z77eg6.js +8675 -0
  10. package/dist/gallery/frame/chunks/blockDiagram-VBNYF7ZC-7xsqzrd1.js +3529 -0
  11. package/dist/gallery/frame/chunks/c4Diagram-5PPSVZJV-z2zjs7wx.js +2413 -0
  12. package/dist/gallery/frame/chunks/classDiagram-JCYQIIEL-ve8rngqp.js +47 -0
  13. package/dist/gallery/frame/chunks/classDiagram-v2-OCEON4UE-8cfaxb8z.js +47 -0
  14. package/dist/gallery/frame/chunks/cose-bilkent-JH36ORCC-sn92qexx.js +4822 -0
  15. package/dist/gallery/frame/chunks/cynefin-VYW2F7L2-tqjv913d.js +10 -0
  16. package/dist/gallery/frame/chunks/cynefinDiagram-MW4NZA55-c1c0dj12.js +500 -0
  17. package/dist/gallery/frame/chunks/dagre-VZM6K2ZE-7tyg4yt2.js +476 -0
  18. package/dist/gallery/frame/chunks/diagram-7IWD3JNH-y4eng9sc.js +526 -0
  19. package/dist/gallery/frame/chunks/diagram-B4RE2ZJO-rn3p7j5h.js +673 -0
  20. package/dist/gallery/frame/chunks/diagram-LBJQPF4R-w4a2cm9q.js +255 -0
  21. package/dist/gallery/frame/chunks/diagram-Q27KOJAE-aqc2v7wy.js +575 -0
  22. package/dist/gallery/frame/chunks/diagram-UB23O5K3-xncy8nyd.js +355 -0
  23. package/dist/gallery/frame/chunks/ebnfDiagram-BXEA7PRR-acwgxz16.js +175 -0
  24. package/dist/gallery/frame/chunks/erDiagram-JOGREHBK-mzp5nswt.js +1332 -0
  25. package/dist/gallery/frame/chunks/eventmodeling-45OFAUF4-sg07qr0c.js +10 -0
  26. package/dist/gallery/frame/chunks/flowDiagram-UKHOOZJN-2e5ygs44.js +29 -0
  27. package/dist/gallery/frame/chunks/ganttDiagram-PKOTCBZU-p2hhh7hr.js +2620 -0
  28. package/dist/gallery/frame/chunks/gitGraph-TEB2WS4Q-j6kw0naa.js +10 -0
  29. package/dist/gallery/frame/chunks/gitGraphDiagram-DS77QQ5N-4z9z8wjm.js +1347 -0
  30. package/dist/gallery/frame/chunks/info-DKCQHKI2-mpt80jd3.js +10 -0
  31. package/dist/gallery/frame/chunks/infoDiagram-6WML65LV-5rqm3mgg.js +65 -0
  32. package/dist/gallery/frame/chunks/ishikawaDiagram-WSZJBQD7-b51z96jy.js +975 -0
  33. package/dist/gallery/frame/chunks/journeyDiagram-NVQOT4AX-9jbfp0pk.js +1272 -0
  34. package/dist/gallery/frame/chunks/kanban-definition-27J2QSJJ-4x0vx4se.js +1116 -0
  35. package/dist/gallery/frame/chunks/katex-xfgk95tv.js +14034 -0
  36. package/dist/gallery/frame/chunks/markdown-1s5vwkf2.js +9 -0
  37. package/dist/gallery/frame/chunks/markdown-2h6bwsms.js +3239 -0
  38. package/dist/gallery/frame/chunks/markdown-2x113yh8.js +107 -0
  39. package/dist/gallery/frame/chunks/markdown-30b7rwmp.js +1943 -0
  40. package/dist/gallery/frame/chunks/markdown-356bfj4g.js +2031 -0
  41. package/dist/gallery/frame/chunks/markdown-44n9ea69.js +2406 -0
  42. package/dist/gallery/frame/chunks/markdown-56enrf2r.js +39 -0
  43. package/dist/gallery/frame/chunks/markdown-5avymm8t.js +725 -0
  44. package/dist/gallery/frame/chunks/markdown-6r4svars.js +33 -0
  45. package/dist/gallery/frame/chunks/markdown-6zz8efx2.js +24 -0
  46. package/dist/gallery/frame/chunks/markdown-7jp6prnb.js +19 -0
  47. package/dist/gallery/frame/chunks/markdown-809k7q41.js +55 -0
  48. package/dist/gallery/frame/chunks/markdown-82xmzhzd.js +1076 -0
  49. package/dist/gallery/frame/chunks/markdown-92n37gd4.js +7627 -0
  50. package/dist/gallery/frame/chunks/markdown-ag2sssf8.js +36 -0
  51. package/dist/gallery/frame/chunks/markdown-b4s7ntq2.js +19 -0
  52. package/dist/gallery/frame/chunks/markdown-c9k0fvp1.js +100 -0
  53. package/dist/gallery/frame/chunks/markdown-ceefymn8.js +125 -0
  54. package/dist/gallery/frame/chunks/markdown-d1wfbs70.js +243 -0
  55. package/dist/gallery/frame/chunks/markdown-dy5sgjhc.js +11022 -0
  56. package/dist/gallery/frame/chunks/markdown-dz3z5w30.js +30868 -0
  57. package/dist/gallery/frame/chunks/markdown-eg6ngz7y.js +30340 -0
  58. package/dist/gallery/frame/chunks/markdown-ff5wvb43.js +1149 -0
  59. package/dist/gallery/frame/chunks/markdown-ffg06nfz.js +86 -0
  60. package/dist/gallery/frame/chunks/markdown-fvfncadf.js +472 -0
  61. package/dist/gallery/frame/chunks/markdown-gvyszqpv.js +19 -0
  62. package/dist/gallery/frame/chunks/markdown-gx1p0ew0.js +88 -0
  63. package/dist/gallery/frame/chunks/markdown-gxye5frz.js +65 -0
  64. package/dist/gallery/frame/chunks/markdown-h7pzv34e.js +105 -0
  65. package/dist/gallery/frame/chunks/markdown-hab789t9.js +47 -0
  66. package/dist/gallery/frame/chunks/markdown-hjp6sj8t.js +125 -0
  67. package/dist/gallery/frame/chunks/markdown-jka64qgp.js +1993 -0
  68. package/dist/gallery/frame/chunks/markdown-k8xkn8mw.js +56 -0
  69. package/dist/gallery/frame/chunks/markdown-m7frq8x8.js +112 -0
  70. package/dist/gallery/frame/chunks/markdown-p740v4qm.js +36 -0
  71. package/dist/gallery/frame/chunks/markdown-pxfeh231.js +57 -0
  72. package/dist/gallery/frame/chunks/markdown-pzgd8z3s.js +87 -0
  73. package/dist/gallery/frame/chunks/markdown-qx3cngz2.js +1673 -0
  74. package/dist/gallery/frame/chunks/markdown-rawhfvvc.js +85 -0
  75. package/dist/gallery/frame/chunks/markdown-rd8w0ng9.js +49 -0
  76. package/dist/gallery/frame/chunks/markdown-rm2yxfjj.js +2773 -0
  77. package/dist/gallery/frame/chunks/markdown-s1jatrnk.js +993 -0
  78. package/dist/gallery/frame/chunks/markdown-sgfg5vvq.js +59 -0
  79. package/dist/gallery/frame/chunks/markdown-t4ethv9d.js +409 -0
  80. package/dist/gallery/frame/chunks/markdown-tnmabqvz.js +36 -0
  81. package/dist/gallery/frame/chunks/markdown-tvdpppw8.js +5292 -0
  82. package/dist/gallery/frame/chunks/markdown-v0x27twr.js +22 -0
  83. package/dist/gallery/frame/chunks/markdown-v14td68x.js +36 -0
  84. package/dist/gallery/frame/chunks/markdown-w6sgd54z.js +36 -0
  85. package/dist/gallery/frame/chunks/markdown-xw8dsk8b.js +2125 -0
  86. package/dist/gallery/frame/chunks/markdown-y18mve73.js +85 -0
  87. package/dist/gallery/frame/chunks/markdown-yengsms5.js +427 -0
  88. package/dist/gallery/frame/chunks/markdown-z1wc0v0d.js +1826 -0
  89. package/dist/gallery/frame/chunks/markdown-zazx9h4n.js +329 -0
  90. package/dist/gallery/frame/chunks/mermaid-de7p4v0x.js +30 -0
  91. package/dist/gallery/frame/chunks/mindmap-definition-FAOFIHXS-ra44cbem.js +1216 -0
  92. package/dist/gallery/frame/chunks/packet-7NZHBO7P-xppm5913.js +10 -0
  93. package/dist/gallery/frame/chunks/pegDiagram-VL7TDLO6-a2a4wg03.js +163 -0
  94. package/dist/gallery/frame/chunks/pie-RZYD4A2V-hnbxk152.js +10 -0
  95. package/dist/gallery/frame/chunks/pieDiagram-7S7Q4E2Y-f1vxjtmx.js +311 -0
  96. package/dist/gallery/frame/chunks/quadrantDiagram-CIZ2JOQS-ywafa6kh.js +1390 -0
  97. package/dist/gallery/frame/chunks/radar-I7S5WNFK-ewqd27se.js +10 -0
  98. package/dist/gallery/frame/chunks/railroad-3IZDKUUU-5hy4bdx3.js +10 -0
  99. package/dist/gallery/frame/chunks/railroad-abnf-AHOZXSZD-bh5sxz0d.js +10 -0
  100. package/dist/gallery/frame/chunks/railroad-ebnf-EBAXGLYW-6b9c3zeh.js +10 -0
  101. package/dist/gallery/frame/chunks/railroad-peg-LSFZ7HO6-avc8v39s.js +10 -0
  102. package/dist/gallery/frame/chunks/railroadDiagram-AXF67PYL-qc61wax4.js +131 -0
  103. package/dist/gallery/frame/chunks/requirementDiagram-LRYGKXZP-9bs4786c.js +1295 -0
  104. package/dist/gallery/frame/chunks/sankeyDiagram-W5VNT64P-awt1em8b.js +1339 -0
  105. package/dist/gallery/frame/chunks/sequenceDiagram-SI44F4Z6-qaf9mz3t.js +4324 -0
  106. package/dist/gallery/frame/chunks/sizeCapture-X5ZJPWSS-9fq685xd.js +64 -0
  107. package/dist/gallery/frame/chunks/stateDiagram-OKZ733FA-vx7a7hh0.js +456 -0
  108. package/dist/gallery/frame/chunks/stateDiagram-v2-UEYNNEHI-x4m6ws5t.js +46 -0
  109. package/dist/gallery/frame/chunks/swimlanes-SLNWSIFB-e4mxm1gh.js +8287 -0
  110. package/dist/gallery/frame/chunks/swimlanesDiagram-ULZ7WXOC-0h93e2qq.js +42 -0
  111. package/dist/gallery/frame/chunks/timeline-definition-Z64GVDOM-wp0bhbzg.js +1549 -0
  112. package/dist/gallery/frame/chunks/treeView-QDETBFTQ-hcx7n0vt.js +10 -0
  113. package/dist/gallery/frame/chunks/treemap-6X3UGDF4-av02skdw.js +10 -0
  114. package/dist/gallery/frame/chunks/vennDiagram-T6HMQDX7-pmvk1p7n.js +2566 -0
  115. package/dist/gallery/frame/chunks/wardley-OPB4EBWU-njsp6e40.js +10 -0
  116. package/dist/gallery/frame/chunks/wardleyDiagram-T6FBY63Y-eggmnv4z.js +979 -0
  117. package/dist/gallery/frame/chunks/xychartDiagram-ELKLHX3M-q40tnpe5.js +1954 -0
  118. package/dist/gallery/frame/frame.css +183 -0
  119. package/dist/gallery/frame/runtime/chart.js +42744 -0
  120. package/dist/gallery/frame/runtime/html.js +14 -0
  121. package/dist/gallery/frame/runtime/markdown.js +1403 -0
  122. package/dist/gallery/frame/runtime/mermaid.js +32 -0
  123. package/dist/gallery/frame/runtime/svg.js +14 -0
  124. package/dist/gallery/frame/runtime/tsx.js +52 -0
  125. package/dist/gallery/index.html +104 -0
  126. package/docs/reference/cli.md +163 -0
  127. package/docs/reference/export.md +106 -0
  128. package/docs/reference/html.md +215 -0
  129. package/docs/reference/http.md +85 -0
  130. package/docs/reference/mcp.md +78 -0
  131. package/docs/reference/security.md +119 -0
  132. package/docs/reference/storage.md +93 -0
  133. package/docs/reference/tsx.md +101 -0
  134. package/docs/reference/validation.md +212 -0
  135. package/package.json +89 -0
  136. package/scripts/build-gallery.ts +127 -0
  137. package/scripts/launch-netns.sh +67 -0
  138. package/skills/facet/SKILL.md +100 -0
  139. package/src/cli/client.ts +311 -0
  140. package/src/cli/commands/create.ts +49 -0
  141. package/src/cli/commands/doctor.ts +249 -0
  142. package/src/cli/commands/export.ts +179 -0
  143. package/src/cli/commands/instantiate.ts +35 -0
  144. package/src/cli/commands/list.ts +49 -0
  145. package/src/cli/commands/open.ts +75 -0
  146. package/src/cli/commands/pin.ts +39 -0
  147. package/src/cli/commands/promote.ts +49 -0
  148. package/src/cli/commands/publish.ts +122 -0
  149. package/src/cli/commands/read-back.ts +56 -0
  150. package/src/cli/commands/status.ts +114 -0
  151. package/src/cli/commands/watch.ts +146 -0
  152. package/src/cli/main.ts +522 -0
  153. package/src/cli/output.ts +106 -0
  154. package/src/cli/parser.ts +376 -0
  155. package/src/cli/presenter.ts +212 -0
  156. package/src/cli/service-metadata.ts +134 -0
  157. package/src/cli/spawn-service.ts +326 -0
  158. package/src/css.d.ts +4 -0
  159. package/src/gallery-web/app.ts +1581 -0
  160. package/src/gallery-web/export-menu.ts +121 -0
  161. package/src/gallery-web/export.ts +112 -0
  162. package/src/gallery-web/favicon.ts +54 -0
  163. package/src/gallery-web/frame/entries/chart.ts +6 -0
  164. package/src/gallery-web/frame/entries/html.ts +6 -0
  165. package/src/gallery-web/frame/entries/markdown.ts +6 -0
  166. package/src/gallery-web/frame/entries/mermaid.ts +6 -0
  167. package/src/gallery-web/frame/entries/svg.ts +6 -0
  168. package/src/gallery-web/frame/entries/tsx.ts +6 -0
  169. package/src/gallery-web/frame/frame-payload.ts +91 -0
  170. package/src/gallery-web/frame/renderer-validation.ts +13 -0
  171. package/src/gallery-web/frame/renderers/chart.ts +182 -0
  172. package/src/gallery-web/frame/renderers/dompurify-shim.ts +112 -0
  173. package/src/gallery-web/frame/renderers/html.ts +48 -0
  174. package/src/gallery-web/frame/renderers/markdown.ts +81 -0
  175. package/src/gallery-web/frame/renderers/mermaid.ts +120 -0
  176. package/src/gallery-web/frame/renderers/registry.ts +260 -0
  177. package/src/gallery-web/frame/renderers/svg.ts +393 -0
  178. package/src/gallery-web/frame/renderers/tsx.ts +61 -0
  179. package/src/gallery-web/frame/runtime.ts +501 -0
  180. package/src/gallery-web/frame/styles/artifact.css +8424 -0
  181. package/src/gallery-web/frame/styles/frame.css +183 -0
  182. package/src/gallery-web/frame/styles/html-source.css +23 -0
  183. package/src/gallery-web/frame/view-box.ts +33 -0
  184. package/src/gallery-web/frame-html.ts +72 -0
  185. package/src/gallery-web/index.html +104 -0
  186. package/src/gallery-web/session.ts +107 -0
  187. package/src/gallery-web/sse-client.ts +212 -0
  188. package/src/gallery-web/styles/app.css +420 -0
  189. package/src/gallery-web/styles/tokens.css +112 -0
  190. package/src/gallery-web/styles/verdict.css +186 -0
  191. package/src/gallery-web/swap.ts +64 -0
  192. package/src/gallery-web/theme.ts +40 -0
  193. package/src/gallery-web/view-state.ts +93 -0
  194. package/src/harness-adapters/claude-code/README.md +10 -0
  195. package/src/harness-adapters/claude-code/facet.sh +4 -0
  196. package/src/harness-adapters/codex/README.md +10 -0
  197. package/src/harness-adapters/codex/facet.sh +4 -0
  198. package/src/harness-adapters/mcp/README.md +13 -0
  199. package/src/harness-adapters/mcp/cli-bridge.ts +216 -0
  200. package/src/harness-adapters/mcp/main.ts +15 -0
  201. package/src/harness-adapters/mcp/server.ts +164 -0
  202. package/src/harness-adapters/mcp/tool-schemas.ts +53 -0
  203. package/src/harness-adapters/opencode/README.md +10 -0
  204. package/src/harness-adapters/opencode/facet.sh +4 -0
  205. package/src/runtime/compiled-entrypoints.ts +69 -0
  206. package/src/service/dispatcher.ts +717 -0
  207. package/src/service/export.ts +218 -0
  208. package/src/service/http-utils.ts +55 -0
  209. package/src/service/lexical/expectations.ts +210 -0
  210. package/src/service/lifecycle/idle-controller.ts +125 -0
  211. package/src/service/lifecycle/orphan-cleanup.ts +128 -0
  212. package/src/service/lifecycle/process-lock.ts +235 -0
  213. package/src/service/main.ts +136 -0
  214. package/src/service/process.ts +240 -0
  215. package/src/service/router-guards.ts +239 -0
  216. package/src/service/router.ts +627 -0
  217. package/src/service/security/auth.ts +168 -0
  218. package/src/service/security/host-origin.ts +138 -0
  219. package/src/service/security/http-guards.ts +13 -0
  220. package/src/service/security/leases.ts +182 -0
  221. package/src/service/security/token-store.ts +138 -0
  222. package/src/service/server.ts +356 -0
  223. package/src/service/store/database.ts +61 -0
  224. package/src/service/store/evidence-retention.ts +234 -0
  225. package/src/service/store/migrations.ts +167 -0
  226. package/src/service/store/repository-lifecycle.ts +121 -0
  227. package/src/service/store/repository.ts +732 -0
  228. package/src/service/store/schema.ts +218 -0
  229. package/src/service/stored-verdict.ts +97 -0
  230. package/src/service/stream.ts +301 -0
  231. package/src/service/verdict-enrichment.ts +45 -0
  232. package/src/shared/build/frame-bundle-plugins.ts +61 -0
  233. package/src/shared/build-mode.ts +28 -0
  234. package/src/shared/config/evidence-read.ts +98 -0
  235. package/src/shared/config/limits.ts +56 -0
  236. package/src/shared/config/paths.ts +96 -0
  237. package/src/shared/contracts/artifact-types.ts +2 -0
  238. package/src/shared/contracts/artifact.ts +98 -0
  239. package/src/shared/contracts/commands/_shared.ts +59 -0
  240. package/src/shared/contracts/commands/guards.ts +86 -0
  241. package/src/shared/contracts/commands/index.ts +204 -0
  242. package/src/shared/contracts/commands/names.ts +35 -0
  243. package/src/shared/contracts/commands/requests.ts +149 -0
  244. package/src/shared/contracts/commands/results.ts +200 -0
  245. package/src/shared/contracts/envelope.ts +140 -0
  246. package/src/shared/contracts/events.ts +41 -0
  247. package/src/shared/contracts/observed-counts.ts +19 -0
  248. package/src/shared/contracts/renderers.ts +6 -0
  249. package/src/shared/contracts/validation.ts +296 -0
  250. package/src/shared/errors/facet-error.ts +127 -0
  251. package/src/shared/errors/store-error.ts +68 -0
  252. package/src/shared/evidence-image.ts +37 -0
  253. package/src/shared/export.ts +31 -0
  254. package/src/shared/html/policy.ts +108 -0
  255. package/src/shared/html/style-vocabulary.ts +352 -0
  256. package/src/shared/logging/logger.ts +108 -0
  257. package/src/shared/logging/redact.ts +49 -0
  258. package/src/shared/security/frozen-csp.ts +13 -0
  259. package/src/shared/storage-version.ts +2 -0
  260. package/src/shared/tsx/execution.ts +29 -0
  261. package/src/shared/tsx/import-policy.ts +94 -0
  262. package/src/shared/util/dir-permissions.ts +94 -0
  263. package/src/shared/util/mermaid-nodes.ts +230 -0
  264. package/src/shared/util/process.ts +67 -0
  265. package/src/shared/util/time.ts +21 -0
  266. package/src/shared/version.ts +3 -0
  267. package/src/validation/sandbox/limits.ts +41 -0
  268. package/src/validation/sandbox/netns.ts +177 -0
  269. package/src/validation/tier0/chart.ts +177 -0
  270. package/src/validation/tier0/dom-shim.ts +54 -0
  271. package/src/validation/tier0/html.ts +408 -0
  272. package/src/validation/tier0/markdown.ts +285 -0
  273. package/src/validation/tier0/mermaid.ts +98 -0
  274. package/src/validation/tier0/runner.ts +504 -0
  275. package/src/validation/tier0/svg.ts +321 -0
  276. package/src/validation/tier0/tsx/allowlist-resolver.ts +77 -0
  277. package/src/validation/tier0/tsx/ast-policy-capabilities.ts +238 -0
  278. package/src/validation/tier0/tsx/ast-policy-shared.ts +71 -0
  279. package/src/validation/tier0/tsx/ast-policy.ts +181 -0
  280. package/src/validation/tier0/tsx/compiler.ts +156 -0
  281. package/src/validation/tier0/worker-dispatch.ts +211 -0
  282. package/src/validation/tier0/worker-entry.ts +96 -0
  283. package/src/validation/tier0/worker-input.ts +75 -0
  284. package/src/validation/tier1/browser-process.ts +147 -0
  285. package/src/validation/tier1/cdp-pipe.ts +281 -0
  286. package/src/validation/tier1/entries/chart.ts +5 -0
  287. package/src/validation/tier1/entries/html.ts +6 -0
  288. package/src/validation/tier1/entries/markdown.ts +5 -0
  289. package/src/validation/tier1/entries/mermaid.ts +5 -0
  290. package/src/validation/tier1/entries/svg.ts +5 -0
  291. package/src/validation/tier1/entries/tsx.ts +5 -0
  292. package/src/validation/tier1/frame-target.ts +162 -0
  293. package/src/validation/tier1/harness-entry.ts +261 -0
  294. package/src/validation/tier1/harness.ts +215 -0
  295. package/src/validation/tier1/isolated-probe.ts +94 -0
  296. package/src/validation/tier1/launcher.ts +177 -0
  297. package/src/validation/tier1/limits.ts +80 -0
  298. package/src/validation/tier1/nonce.ts +17 -0
  299. package/src/validation/tier1/protocol-probe.ts +519 -0
  300. package/src/validation/tier1/runner.ts +1122 -0
  301. package/src/validation/tier1/verdict.ts +246 -0
  302. package/src/validation/tier1/webp.ts +69 -0
  303. package/templates/README.md +88 -0
  304. package/templates/bar-compare.vl.json +63 -0
  305. package/templates/capacity-report.tsx +102 -0
  306. package/templates/decision-record.md +24 -0
  307. package/templates/deployment-state.mmd +40 -0
  308. package/templates/exemplar.md +91 -0
  309. package/templates/facet-story.tsx +799 -0
  310. package/templates/fleet-dashboard.html +141 -0
  311. package/templates/html-release-ledger.html +91 -0
  312. package/templates/html-status-report.html +114 -0
  313. package/templates/incident-console.tsx +147 -0
  314. package/templates/legion-boundaries.mmd +23 -0
  315. package/templates/legion-flow.mmd +15 -0
  316. package/templates/legion-sequence.mmd +14 -0
  317. package/templates/legion-state.mmd +7 -0
  318. package/templates/metric-card.svg +29 -0
  319. package/templates/observability-map.svg +101 -0
  320. package/templates/pipeline-audit.md +108 -0
  321. package/templates/release-metrics.vl.json +98 -0
  322. package/templates/service-topology.mmd +47 -0
  323. package/templates/status-report.md +32 -0
  324. package/templates/system-map.svg +53 -0
  325. package/templates/timeseries.vl.json +71 -0
  326. package/templates/tsx-interactive-counter.tsx +19 -0
  327. package/templates/tsx-status-report.tsx +31 -0
@@ -0,0 +1,1076 @@
1
+ // node_modules/roughjs/bundled/rough.esm.js
2
+ function t(t2, e, s) {
3
+ if (t2 && t2.length) {
4
+ const [n, o] = e, a = Math.PI / 180 * s, h = Math.cos(a), r = Math.sin(a);
5
+ for (const e2 of t2) {
6
+ const [t3, s2] = e2;
7
+ e2[0] = (t3 - n) * h - (s2 - o) * r + n, e2[1] = (t3 - n) * r + (s2 - o) * h + o;
8
+ }
9
+ }
10
+ }
11
+ function e(t2, e2) {
12
+ return t2[0] === e2[0] && t2[1] === e2[1];
13
+ }
14
+ function s(s2, n, o, a = 1) {
15
+ const h = o, r = Math.max(n, 0.1), i = s2[0] && s2[0][0] && typeof s2[0][0] == "number" ? [s2] : s2, c = [0, 0];
16
+ if (h)
17
+ for (const e2 of i)
18
+ t(e2, c, h);
19
+ const l = function(t2, s3, n2) {
20
+ const o2 = [];
21
+ for (const s4 of t2) {
22
+ const t3 = [...s4];
23
+ e(t3[0], t3[t3.length - 1]) || t3.push([t3[0][0], t3[0][1]]), t3.length > 2 && o2.push(t3);
24
+ }
25
+ const a2 = [];
26
+ s3 = Math.max(s3, 0.1);
27
+ const h2 = [];
28
+ for (const t3 of o2)
29
+ for (let e2 = 0;e2 < t3.length - 1; e2++) {
30
+ const s4 = t3[e2], n3 = t3[e2 + 1];
31
+ if (s4[1] !== n3[1]) {
32
+ const t4 = Math.min(s4[1], n3[1]);
33
+ h2.push({ ymin: t4, ymax: Math.max(s4[1], n3[1]), x: t4 === s4[1] ? s4[0] : n3[0], islope: (n3[0] - s4[0]) / (n3[1] - s4[1]) });
34
+ }
35
+ }
36
+ if (h2.sort((t3, e2) => t3.ymin < e2.ymin ? -1 : t3.ymin > e2.ymin ? 1 : t3.x < e2.x ? -1 : t3.x > e2.x ? 1 : t3.ymax === e2.ymax ? 0 : (t3.ymax - e2.ymax) / Math.abs(t3.ymax - e2.ymax)), !h2.length)
37
+ return a2;
38
+ let r2 = [], i2 = h2[0].ymin, c2 = 0;
39
+ for (;r2.length || h2.length; ) {
40
+ if (h2.length) {
41
+ let t3 = -1;
42
+ for (let e2 = 0;e2 < h2.length && !(h2[e2].ymin > i2); e2++)
43
+ t3 = e2;
44
+ h2.splice(0, t3 + 1).forEach((t4) => {
45
+ r2.push({ s: i2, edge: t4 });
46
+ });
47
+ }
48
+ if (r2 = r2.filter((t3) => !(t3.edge.ymax <= i2)), r2.sort((t3, e2) => t3.edge.x === e2.edge.x ? 0 : (t3.edge.x - e2.edge.x) / Math.abs(t3.edge.x - e2.edge.x)), (n2 !== 1 || c2 % s3 == 0) && r2.length > 1)
49
+ for (let t3 = 0;t3 < r2.length; t3 += 2) {
50
+ const e2 = t3 + 1;
51
+ if (e2 >= r2.length)
52
+ break;
53
+ const s4 = r2[t3].edge, n3 = r2[e2].edge;
54
+ a2.push([[Math.round(s4.x), i2], [Math.round(n3.x), i2]]);
55
+ }
56
+ i2 += n2, r2.forEach((t3) => {
57
+ t3.edge.x = t3.edge.x + n2 * t3.edge.islope;
58
+ }), c2++;
59
+ }
60
+ return a2;
61
+ }(i, r, a);
62
+ if (h) {
63
+ for (const e2 of i)
64
+ t(e2, c, -h);
65
+ (function(e2, s3, n2) {
66
+ const o2 = [];
67
+ e2.forEach((t2) => o2.push(...t2)), t(o2, s3, n2);
68
+ })(l, c, -h);
69
+ }
70
+ return l;
71
+ }
72
+ function n(t2, e2) {
73
+ var n2;
74
+ const o = e2.hachureAngle + 90;
75
+ let a = e2.hachureGap;
76
+ a < 0 && (a = 4 * e2.strokeWidth), a = Math.round(Math.max(a, 0.1));
77
+ let h = 1;
78
+ return e2.roughness >= 1 && (((n2 = e2.randomizer) === null || n2 === undefined ? undefined : n2.next()) || Math.random()) > 0.7 && (h = a), s(t2, a, o, h || 1);
79
+ }
80
+
81
+ class o {
82
+ constructor(t2) {
83
+ this.helper = t2;
84
+ }
85
+ fillPolygons(t2, e2) {
86
+ return this._fillPolygons(t2, e2);
87
+ }
88
+ _fillPolygons(t2, e2) {
89
+ const s2 = n(t2, e2);
90
+ return { type: "fillSketch", ops: this.renderLines(s2, e2) };
91
+ }
92
+ renderLines(t2, e2) {
93
+ const s2 = [];
94
+ for (const n2 of t2)
95
+ s2.push(...this.helper.doubleLineOps(n2[0][0], n2[0][1], n2[1][0], n2[1][1], e2));
96
+ return s2;
97
+ }
98
+ }
99
+ function a(t2) {
100
+ const e2 = t2[0], s2 = t2[1];
101
+ return Math.sqrt(Math.pow(e2[0] - s2[0], 2) + Math.pow(e2[1] - s2[1], 2));
102
+ }
103
+
104
+ class h extends o {
105
+ fillPolygons(t2, e2) {
106
+ let s2 = e2.hachureGap;
107
+ s2 < 0 && (s2 = 4 * e2.strokeWidth), s2 = Math.max(s2, 0.1);
108
+ const o2 = n(t2, Object.assign({}, e2, { hachureGap: s2 })), h2 = Math.PI / 180 * e2.hachureAngle, r = [], i = 0.5 * s2 * Math.cos(h2), c = 0.5 * s2 * Math.sin(h2);
109
+ for (const [t3, e3] of o2)
110
+ a([t3, e3]) && r.push([[t3[0] - i, t3[1] + c], [...e3]], [[t3[0] + i, t3[1] - c], [...e3]]);
111
+ return { type: "fillSketch", ops: this.renderLines(r, e2) };
112
+ }
113
+ }
114
+
115
+ class r extends o {
116
+ fillPolygons(t2, e2) {
117
+ const s2 = this._fillPolygons(t2, e2), n2 = Object.assign({}, e2, { hachureAngle: e2.hachureAngle + 90 }), o2 = this._fillPolygons(t2, n2);
118
+ return s2.ops = s2.ops.concat(o2.ops), s2;
119
+ }
120
+ }
121
+
122
+ class i {
123
+ constructor(t2) {
124
+ this.helper = t2;
125
+ }
126
+ fillPolygons(t2, e2) {
127
+ const s2 = n(t2, e2 = Object.assign({}, e2, { hachureAngle: 0 }));
128
+ return this.dotsOnLines(s2, e2);
129
+ }
130
+ dotsOnLines(t2, e2) {
131
+ const s2 = [];
132
+ let n2 = e2.hachureGap;
133
+ n2 < 0 && (n2 = 4 * e2.strokeWidth), n2 = Math.max(n2, 0.1);
134
+ let o2 = e2.fillWeight;
135
+ o2 < 0 && (o2 = e2.strokeWidth / 2);
136
+ const h2 = n2 / 4;
137
+ for (const r2 of t2) {
138
+ const t3 = a(r2), i2 = t3 / n2, c = Math.ceil(i2) - 1, l = t3 - c * n2, u = (r2[0][0] + r2[1][0]) / 2 - n2 / 4, p = Math.min(r2[0][1], r2[1][1]);
139
+ for (let t4 = 0;t4 < c; t4++) {
140
+ const a2 = p + l + t4 * n2, r3 = u - h2 + 2 * Math.random() * h2, i3 = a2 - h2 + 2 * Math.random() * h2, c2 = this.helper.ellipse(r3, i3, o2, o2, e2);
141
+ s2.push(...c2.ops);
142
+ }
143
+ }
144
+ return { type: "fillSketch", ops: s2 };
145
+ }
146
+ }
147
+
148
+ class c {
149
+ constructor(t2) {
150
+ this.helper = t2;
151
+ }
152
+ fillPolygons(t2, e2) {
153
+ const s2 = n(t2, e2);
154
+ return { type: "fillSketch", ops: this.dashedLine(s2, e2) };
155
+ }
156
+ dashedLine(t2, e2) {
157
+ const s2 = e2.dashOffset < 0 ? e2.hachureGap < 0 ? 4 * e2.strokeWidth : e2.hachureGap : e2.dashOffset, n2 = e2.dashGap < 0 ? e2.hachureGap < 0 ? 4 * e2.strokeWidth : e2.hachureGap : e2.dashGap, o2 = [];
158
+ return t2.forEach((t3) => {
159
+ const h2 = a(t3), r2 = Math.floor(h2 / (s2 + n2)), i2 = (h2 + n2 - r2 * (s2 + n2)) / 2;
160
+ let c2 = t3[0], l = t3[1];
161
+ c2[0] > l[0] && (c2 = t3[1], l = t3[0]);
162
+ const u = Math.atan((l[1] - c2[1]) / (l[0] - c2[0]));
163
+ for (let t4 = 0;t4 < r2; t4++) {
164
+ const a2 = t4 * (s2 + n2), h3 = a2 + s2, r3 = [c2[0] + a2 * Math.cos(u) + i2 * Math.cos(u), c2[1] + a2 * Math.sin(u) + i2 * Math.sin(u)], l2 = [c2[0] + h3 * Math.cos(u) + i2 * Math.cos(u), c2[1] + h3 * Math.sin(u) + i2 * Math.sin(u)];
165
+ o2.push(...this.helper.doubleLineOps(r3[0], r3[1], l2[0], l2[1], e2));
166
+ }
167
+ }), o2;
168
+ }
169
+ }
170
+
171
+ class l {
172
+ constructor(t2) {
173
+ this.helper = t2;
174
+ }
175
+ fillPolygons(t2, e2) {
176
+ const s2 = e2.hachureGap < 0 ? 4 * e2.strokeWidth : e2.hachureGap, o2 = e2.zigzagOffset < 0 ? s2 : e2.zigzagOffset, a2 = n(t2, e2 = Object.assign({}, e2, { hachureGap: s2 + o2 }));
177
+ return { type: "fillSketch", ops: this.zigzagLines(a2, o2, e2) };
178
+ }
179
+ zigzagLines(t2, e2, s2) {
180
+ const n2 = [];
181
+ return t2.forEach((t3) => {
182
+ const o2 = a(t3), h2 = Math.round(o2 / (2 * e2));
183
+ let r2 = t3[0], i2 = t3[1];
184
+ r2[0] > i2[0] && (r2 = t3[1], i2 = t3[0]);
185
+ const c2 = Math.atan((i2[1] - r2[1]) / (i2[0] - r2[0]));
186
+ for (let t4 = 0;t4 < h2; t4++) {
187
+ const o3 = 2 * t4 * e2, a2 = 2 * (t4 + 1) * e2, h3 = Math.sqrt(2 * Math.pow(e2, 2)), i3 = [r2[0] + o3 * Math.cos(c2), r2[1] + o3 * Math.sin(c2)], l2 = [r2[0] + a2 * Math.cos(c2), r2[1] + a2 * Math.sin(c2)], u = [i3[0] + h3 * Math.cos(c2 + Math.PI / 4), i3[1] + h3 * Math.sin(c2 + Math.PI / 4)];
188
+ n2.push(...this.helper.doubleLineOps(i3[0], i3[1], u[0], u[1], s2), ...this.helper.doubleLineOps(u[0], u[1], l2[0], l2[1], s2));
189
+ }
190
+ }), n2;
191
+ }
192
+ }
193
+ var u = {};
194
+
195
+ class p {
196
+ constructor(t2) {
197
+ this.seed = t2;
198
+ }
199
+ next() {
200
+ return this.seed ? (2 ** 31 - 1 & (this.seed = Math.imul(48271, this.seed))) / 2 ** 31 : Math.random();
201
+ }
202
+ }
203
+ var f = 0;
204
+ var d = 1;
205
+ var g = 2;
206
+ var M = { A: 7, a: 7, C: 6, c: 6, H: 1, h: 1, L: 2, l: 2, M: 2, m: 2, Q: 4, q: 4, S: 4, s: 4, T: 2, t: 2, V: 1, v: 1, Z: 0, z: 0 };
207
+ function k(t2, e2) {
208
+ return t2.type === e2;
209
+ }
210
+ function b(t2) {
211
+ const e2 = [], s2 = function(t3) {
212
+ const e3 = new Array;
213
+ for (;t3 !== ""; )
214
+ if (t3.match(/^([ \t\r\n,]+)/))
215
+ t3 = t3.substr(RegExp.$1.length);
216
+ else if (t3.match(/^([aAcChHlLmMqQsStTvVzZ])/))
217
+ e3[e3.length] = { type: f, text: RegExp.$1 }, t3 = t3.substr(RegExp.$1.length);
218
+ else {
219
+ if (!t3.match(/^(([-+]?[0-9]+(\.[0-9]*)?|[-+]?\.[0-9]+)([eE][-+]?[0-9]+)?)/))
220
+ return [];
221
+ e3[e3.length] = { type: d, text: `${parseFloat(RegExp.$1)}` }, t3 = t3.substr(RegExp.$1.length);
222
+ }
223
+ return e3[e3.length] = { type: g, text: "" }, e3;
224
+ }(t2);
225
+ let n2 = "BOD", o2 = 0, a2 = s2[o2];
226
+ for (;!k(a2, g); ) {
227
+ let h2 = 0;
228
+ const r2 = [];
229
+ if (n2 === "BOD") {
230
+ if (a2.text !== "M" && a2.text !== "m")
231
+ return b("M0,0" + t2);
232
+ o2++, h2 = M[a2.text], n2 = a2.text;
233
+ } else
234
+ k(a2, d) ? h2 = M[n2] : (o2++, h2 = M[a2.text], n2 = a2.text);
235
+ if (!(o2 + h2 < s2.length))
236
+ throw new Error("Path data ended short");
237
+ for (let t3 = o2;t3 < o2 + h2; t3++) {
238
+ const e3 = s2[t3];
239
+ if (!k(e3, d))
240
+ throw new Error("Param not a number: " + n2 + "," + e3.text);
241
+ r2[r2.length] = +e3.text;
242
+ }
243
+ if (typeof M[n2] != "number")
244
+ throw new Error("Bad segment: " + n2);
245
+ {
246
+ const t3 = { key: n2, data: r2 };
247
+ e2.push(t3), o2 += h2, a2 = s2[o2], n2 === "M" && (n2 = "L"), n2 === "m" && (n2 = "l");
248
+ }
249
+ }
250
+ return e2;
251
+ }
252
+ function y(t2) {
253
+ let e2 = 0, s2 = 0, n2 = 0, o2 = 0;
254
+ const a2 = [];
255
+ for (const { key: h2, data: r2 } of t2)
256
+ switch (h2) {
257
+ case "M":
258
+ a2.push({ key: "M", data: [...r2] }), [e2, s2] = r2, [n2, o2] = r2;
259
+ break;
260
+ case "m":
261
+ e2 += r2[0], s2 += r2[1], a2.push({ key: "M", data: [e2, s2] }), n2 = e2, o2 = s2;
262
+ break;
263
+ case "L":
264
+ a2.push({ key: "L", data: [...r2] }), [e2, s2] = r2;
265
+ break;
266
+ case "l":
267
+ e2 += r2[0], s2 += r2[1], a2.push({ key: "L", data: [e2, s2] });
268
+ break;
269
+ case "C":
270
+ a2.push({ key: "C", data: [...r2] }), e2 = r2[4], s2 = r2[5];
271
+ break;
272
+ case "c": {
273
+ const t3 = r2.map((t4, n3) => n3 % 2 ? t4 + s2 : t4 + e2);
274
+ a2.push({ key: "C", data: t3 }), e2 = t3[4], s2 = t3[5];
275
+ break;
276
+ }
277
+ case "Q":
278
+ a2.push({ key: "Q", data: [...r2] }), e2 = r2[2], s2 = r2[3];
279
+ break;
280
+ case "q": {
281
+ const t3 = r2.map((t4, n3) => n3 % 2 ? t4 + s2 : t4 + e2);
282
+ a2.push({ key: "Q", data: t3 }), e2 = t3[2], s2 = t3[3];
283
+ break;
284
+ }
285
+ case "A":
286
+ a2.push({ key: "A", data: [...r2] }), e2 = r2[5], s2 = r2[6];
287
+ break;
288
+ case "a":
289
+ e2 += r2[5], s2 += r2[6], a2.push({ key: "A", data: [r2[0], r2[1], r2[2], r2[3], r2[4], e2, s2] });
290
+ break;
291
+ case "H":
292
+ a2.push({ key: "H", data: [...r2] }), e2 = r2[0];
293
+ break;
294
+ case "h":
295
+ e2 += r2[0], a2.push({ key: "H", data: [e2] });
296
+ break;
297
+ case "V":
298
+ a2.push({ key: "V", data: [...r2] }), s2 = r2[0];
299
+ break;
300
+ case "v":
301
+ s2 += r2[0], a2.push({ key: "V", data: [s2] });
302
+ break;
303
+ case "S":
304
+ a2.push({ key: "S", data: [...r2] }), e2 = r2[2], s2 = r2[3];
305
+ break;
306
+ case "s": {
307
+ const t3 = r2.map((t4, n3) => n3 % 2 ? t4 + s2 : t4 + e2);
308
+ a2.push({ key: "S", data: t3 }), e2 = t3[2], s2 = t3[3];
309
+ break;
310
+ }
311
+ case "T":
312
+ a2.push({ key: "T", data: [...r2] }), e2 = r2[0], s2 = r2[1];
313
+ break;
314
+ case "t":
315
+ e2 += r2[0], s2 += r2[1], a2.push({ key: "T", data: [e2, s2] });
316
+ break;
317
+ case "Z":
318
+ case "z":
319
+ a2.push({ key: "Z", data: [] }), e2 = n2, s2 = o2;
320
+ }
321
+ return a2;
322
+ }
323
+ function m(t2) {
324
+ const e2 = [];
325
+ let s2 = "", n2 = 0, o2 = 0, a2 = 0, h2 = 0, r2 = 0, i2 = 0;
326
+ for (const { key: c2, data: l2 } of t2) {
327
+ switch (c2) {
328
+ case "M":
329
+ e2.push({ key: "M", data: [...l2] }), [n2, o2] = l2, [a2, h2] = l2;
330
+ break;
331
+ case "C":
332
+ e2.push({ key: "C", data: [...l2] }), n2 = l2[4], o2 = l2[5], r2 = l2[2], i2 = l2[3];
333
+ break;
334
+ case "L":
335
+ e2.push({ key: "L", data: [...l2] }), [n2, o2] = l2;
336
+ break;
337
+ case "H":
338
+ n2 = l2[0], e2.push({ key: "L", data: [n2, o2] });
339
+ break;
340
+ case "V":
341
+ o2 = l2[0], e2.push({ key: "L", data: [n2, o2] });
342
+ break;
343
+ case "S": {
344
+ let t3 = 0, a3 = 0;
345
+ s2 === "C" || s2 === "S" ? (t3 = n2 + (n2 - r2), a3 = o2 + (o2 - i2)) : (t3 = n2, a3 = o2), e2.push({ key: "C", data: [t3, a3, ...l2] }), r2 = l2[0], i2 = l2[1], n2 = l2[2], o2 = l2[3];
346
+ break;
347
+ }
348
+ case "T": {
349
+ const [t3, a3] = l2;
350
+ let h3 = 0, c3 = 0;
351
+ s2 === "Q" || s2 === "T" ? (h3 = n2 + (n2 - r2), c3 = o2 + (o2 - i2)) : (h3 = n2, c3 = o2);
352
+ const u2 = n2 + 2 * (h3 - n2) / 3, p2 = o2 + 2 * (c3 - o2) / 3, f2 = t3 + 2 * (h3 - t3) / 3, d2 = a3 + 2 * (c3 - a3) / 3;
353
+ e2.push({ key: "C", data: [u2, p2, f2, d2, t3, a3] }), r2 = h3, i2 = c3, n2 = t3, o2 = a3;
354
+ break;
355
+ }
356
+ case "Q": {
357
+ const [t3, s3, a3, h3] = l2, c3 = n2 + 2 * (t3 - n2) / 3, u2 = o2 + 2 * (s3 - o2) / 3, p2 = a3 + 2 * (t3 - a3) / 3, f2 = h3 + 2 * (s3 - h3) / 3;
358
+ e2.push({ key: "C", data: [c3, u2, p2, f2, a3, h3] }), r2 = t3, i2 = s3, n2 = a3, o2 = h3;
359
+ break;
360
+ }
361
+ case "A": {
362
+ const t3 = Math.abs(l2[0]), s3 = Math.abs(l2[1]), a3 = l2[2], h3 = l2[3], r3 = l2[4], i3 = l2[5], c3 = l2[6];
363
+ if (t3 === 0 || s3 === 0)
364
+ e2.push({ key: "C", data: [n2, o2, i3, c3, i3, c3] }), n2 = i3, o2 = c3;
365
+ else if (n2 !== i3 || o2 !== c3) {
366
+ x(n2, o2, i3, c3, t3, s3, a3, h3, r3).forEach(function(t4) {
367
+ e2.push({ key: "C", data: t4 });
368
+ }), n2 = i3, o2 = c3;
369
+ }
370
+ break;
371
+ }
372
+ case "Z":
373
+ e2.push({ key: "Z", data: [] }), n2 = a2, o2 = h2;
374
+ }
375
+ s2 = c2;
376
+ }
377
+ return e2;
378
+ }
379
+ function w(t2, e2, s2) {
380
+ return [t2 * Math.cos(s2) - e2 * Math.sin(s2), t2 * Math.sin(s2) + e2 * Math.cos(s2)];
381
+ }
382
+ function x(t2, e2, s2, n2, o2, a2, h2, r2, i2, c2) {
383
+ const l2 = (u2 = h2, Math.PI * u2 / 180);
384
+ var u2;
385
+ let p2 = [], f2 = 0, d2 = 0, g2 = 0, M2 = 0;
386
+ if (c2)
387
+ [f2, d2, g2, M2] = c2;
388
+ else {
389
+ [t2, e2] = w(t2, e2, -l2), [s2, n2] = w(s2, n2, -l2);
390
+ const h3 = (t2 - s2) / 2, c3 = (e2 - n2) / 2;
391
+ let u3 = h3 * h3 / (o2 * o2) + c3 * c3 / (a2 * a2);
392
+ u3 > 1 && (u3 = Math.sqrt(u3), o2 *= u3, a2 *= u3);
393
+ const p3 = o2 * o2, k3 = a2 * a2, b3 = p3 * k3 - p3 * c3 * c3 - k3 * h3 * h3, y3 = p3 * c3 * c3 + k3 * h3 * h3, m3 = (r2 === i2 ? -1 : 1) * Math.sqrt(Math.abs(b3 / y3));
394
+ g2 = m3 * o2 * c3 / a2 + (t2 + s2) / 2, M2 = m3 * -a2 * h3 / o2 + (e2 + n2) / 2, f2 = Math.asin(parseFloat(((e2 - M2) / a2).toFixed(9))), d2 = Math.asin(parseFloat(((n2 - M2) / a2).toFixed(9))), t2 < g2 && (f2 = Math.PI - f2), s2 < g2 && (d2 = Math.PI - d2), f2 < 0 && (f2 = 2 * Math.PI + f2), d2 < 0 && (d2 = 2 * Math.PI + d2), i2 && f2 > d2 && (f2 -= 2 * Math.PI), !i2 && d2 > f2 && (d2 -= 2 * Math.PI);
395
+ }
396
+ let k2 = d2 - f2;
397
+ if (Math.abs(k2) > 120 * Math.PI / 180) {
398
+ const t3 = d2, e3 = s2, r3 = n2;
399
+ d2 = i2 && d2 > f2 ? f2 + 120 * Math.PI / 180 * 1 : f2 + 120 * Math.PI / 180 * -1, p2 = x(s2 = g2 + o2 * Math.cos(d2), n2 = M2 + a2 * Math.sin(d2), e3, r3, o2, a2, h2, 0, i2, [d2, t3, g2, M2]);
400
+ }
401
+ k2 = d2 - f2;
402
+ const b2 = Math.cos(f2), y2 = Math.sin(f2), m2 = Math.cos(d2), P = Math.sin(d2), v = Math.tan(k2 / 4), S = 4 / 3 * o2 * v, O = 4 / 3 * a2 * v, L = [t2, e2], T = [t2 + S * y2, e2 - O * b2], D = [s2 + S * P, n2 - O * m2], A = [s2, n2];
403
+ if (T[0] = 2 * L[0] - T[0], T[1] = 2 * L[1] - T[1], c2)
404
+ return [T, D, A].concat(p2);
405
+ {
406
+ p2 = [T, D, A].concat(p2);
407
+ const t3 = [];
408
+ for (let e3 = 0;e3 < p2.length; e3 += 3) {
409
+ const s3 = w(p2[e3][0], p2[e3][1], l2), n3 = w(p2[e3 + 1][0], p2[e3 + 1][1], l2), o3 = w(p2[e3 + 2][0], p2[e3 + 2][1], l2);
410
+ t3.push([s3[0], s3[1], n3[0], n3[1], o3[0], o3[1]]);
411
+ }
412
+ return t3;
413
+ }
414
+ }
415
+ var P = { randOffset: function(t2, e2) {
416
+ return G(t2, e2);
417
+ }, randOffsetWithRange: function(t2, e2, s2) {
418
+ return E(t2, e2, s2);
419
+ }, ellipse: function(t2, e2, s2, n2, o2) {
420
+ const a2 = T(s2, n2, o2);
421
+ return D(t2, e2, o2, a2).opset;
422
+ }, doubleLineOps: function(t2, e2, s2, n2, o2) {
423
+ return $(t2, e2, s2, n2, o2, true);
424
+ } };
425
+ function v(t2, e2, s2, n2, o2) {
426
+ return { type: "path", ops: $(t2, e2, s2, n2, o2) };
427
+ }
428
+ function S(t2, e2, s2) {
429
+ const n2 = (t2 || []).length;
430
+ if (n2 > 2) {
431
+ const o2 = [];
432
+ for (let e3 = 0;e3 < n2 - 1; e3++)
433
+ o2.push(...$(t2[e3][0], t2[e3][1], t2[e3 + 1][0], t2[e3 + 1][1], s2));
434
+ return e2 && o2.push(...$(t2[n2 - 1][0], t2[n2 - 1][1], t2[0][0], t2[0][1], s2)), { type: "path", ops: o2 };
435
+ }
436
+ return n2 === 2 ? v(t2[0][0], t2[0][1], t2[1][0], t2[1][1], s2) : { type: "path", ops: [] };
437
+ }
438
+ function O(t2, e2, s2, n2, o2) {
439
+ return function(t3, e3) {
440
+ return S(t3, true, e3);
441
+ }([[t2, e2], [t2 + s2, e2], [t2 + s2, e2 + n2], [t2, e2 + n2]], o2);
442
+ }
443
+ function L(t2, e2) {
444
+ if (t2.length) {
445
+ const s2 = typeof t2[0][0] == "number" ? [t2] : t2, n2 = j(s2[0], 1 * (1 + 0.2 * e2.roughness), e2), o2 = e2.disableMultiStroke ? [] : j(s2[0], 1.5 * (1 + 0.22 * e2.roughness), z(e2));
446
+ for (let t3 = 1;t3 < s2.length; t3++) {
447
+ const a2 = s2[t3];
448
+ if (a2.length) {
449
+ const t4 = j(a2, 1 * (1 + 0.2 * e2.roughness), e2), s3 = e2.disableMultiStroke ? [] : j(a2, 1.5 * (1 + 0.22 * e2.roughness), z(e2));
450
+ for (const e3 of t4)
451
+ e3.op !== "move" && n2.push(e3);
452
+ for (const t5 of s3)
453
+ t5.op !== "move" && o2.push(t5);
454
+ }
455
+ }
456
+ return { type: "path", ops: n2.concat(o2) };
457
+ }
458
+ return { type: "path", ops: [] };
459
+ }
460
+ function T(t2, e2, s2) {
461
+ const n2 = Math.sqrt(2 * Math.PI * Math.sqrt((Math.pow(t2 / 2, 2) + Math.pow(e2 / 2, 2)) / 2)), o2 = Math.ceil(Math.max(s2.curveStepCount, s2.curveStepCount / Math.sqrt(200) * n2)), a2 = 2 * Math.PI / o2;
462
+ let h2 = Math.abs(t2 / 2), r2 = Math.abs(e2 / 2);
463
+ const i2 = 1 - s2.curveFitting;
464
+ return h2 += G(h2 * i2, s2), r2 += G(r2 * i2, s2), { increment: a2, rx: h2, ry: r2 };
465
+ }
466
+ function D(t2, e2, s2, n2) {
467
+ const [o2, a2] = F(n2.increment, t2, e2, n2.rx, n2.ry, 1, n2.increment * E(0.1, E(0.4, 1, s2), s2), s2);
468
+ let h2 = q(o2, null, s2);
469
+ if (!s2.disableMultiStroke && s2.roughness !== 0) {
470
+ const [o3] = F(n2.increment, t2, e2, n2.rx, n2.ry, 1.5, 0, s2), a3 = q(o3, null, s2);
471
+ h2 = h2.concat(a3);
472
+ }
473
+ return { estimatedPoints: a2, opset: { type: "path", ops: h2 } };
474
+ }
475
+ function A(t2, e2, s2, n2, o2, a2, h2, r2, i2) {
476
+ const c2 = t2, l2 = e2;
477
+ let u2 = Math.abs(s2 / 2), p2 = Math.abs(n2 / 2);
478
+ u2 += G(0.01 * u2, i2), p2 += G(0.01 * p2, i2);
479
+ let f2 = o2, d2 = a2;
480
+ for (;f2 < 0; )
481
+ f2 += 2 * Math.PI, d2 += 2 * Math.PI;
482
+ d2 - f2 > 2 * Math.PI && (f2 = 0, d2 = 2 * Math.PI);
483
+ const g2 = 2 * Math.PI / i2.curveStepCount, M2 = Math.min(g2 / 2, (d2 - f2) / 2), k2 = V(M2, c2, l2, u2, p2, f2, d2, 1, i2);
484
+ if (!i2.disableMultiStroke) {
485
+ const t3 = V(M2, c2, l2, u2, p2, f2, d2, 1.5, i2);
486
+ k2.push(...t3);
487
+ }
488
+ return h2 && (r2 ? k2.push(...$(c2, l2, c2 + u2 * Math.cos(f2), l2 + p2 * Math.sin(f2), i2), ...$(c2, l2, c2 + u2 * Math.cos(d2), l2 + p2 * Math.sin(d2), i2)) : k2.push({ op: "lineTo", data: [c2, l2] }, { op: "lineTo", data: [c2 + u2 * Math.cos(f2), l2 + p2 * Math.sin(f2)] })), { type: "path", ops: k2 };
489
+ }
490
+ function _(t2, e2) {
491
+ const s2 = m(y(b(t2))), n2 = [];
492
+ let o2 = [0, 0], a2 = [0, 0];
493
+ for (const { key: t3, data: h2 } of s2)
494
+ switch (t3) {
495
+ case "M":
496
+ a2 = [h2[0], h2[1]], o2 = [h2[0], h2[1]];
497
+ break;
498
+ case "L":
499
+ n2.push(...$(a2[0], a2[1], h2[0], h2[1], e2)), a2 = [h2[0], h2[1]];
500
+ break;
501
+ case "C": {
502
+ const [t4, s3, o3, r2, i2, c2] = h2;
503
+ n2.push(...Z(t4, s3, o3, r2, i2, c2, a2, e2)), a2 = [i2, c2];
504
+ break;
505
+ }
506
+ case "Z":
507
+ n2.push(...$(a2[0], a2[1], o2[0], o2[1], e2)), a2 = [o2[0], o2[1]];
508
+ }
509
+ return { type: "path", ops: n2 };
510
+ }
511
+ function I(t2, e2) {
512
+ const s2 = [];
513
+ for (const n2 of t2)
514
+ if (n2.length) {
515
+ const t3 = e2.maxRandomnessOffset || 0, o2 = n2.length;
516
+ if (o2 > 2) {
517
+ s2.push({ op: "move", data: [n2[0][0] + G(t3, e2), n2[0][1] + G(t3, e2)] });
518
+ for (let a2 = 1;a2 < o2; a2++)
519
+ s2.push({ op: "lineTo", data: [n2[a2][0] + G(t3, e2), n2[a2][1] + G(t3, e2)] });
520
+ }
521
+ }
522
+ return { type: "fillPath", ops: s2 };
523
+ }
524
+ function C(t2, e2) {
525
+ return function(t3, e3) {
526
+ let s2 = t3.fillStyle || "hachure";
527
+ if (!u[s2])
528
+ switch (s2) {
529
+ case "zigzag":
530
+ u[s2] || (u[s2] = new h(e3));
531
+ break;
532
+ case "cross-hatch":
533
+ u[s2] || (u[s2] = new r(e3));
534
+ break;
535
+ case "dots":
536
+ u[s2] || (u[s2] = new i(e3));
537
+ break;
538
+ case "dashed":
539
+ u[s2] || (u[s2] = new c(e3));
540
+ break;
541
+ case "zigzag-line":
542
+ u[s2] || (u[s2] = new l(e3));
543
+ break;
544
+ default:
545
+ s2 = "hachure", u[s2] || (u[s2] = new o(e3));
546
+ }
547
+ return u[s2];
548
+ }(e2, P).fillPolygons(t2, e2);
549
+ }
550
+ function z(t2) {
551
+ const e2 = Object.assign({}, t2);
552
+ return e2.randomizer = undefined, t2.seed && (e2.seed = t2.seed + 1), e2;
553
+ }
554
+ function W(t2) {
555
+ return t2.randomizer || (t2.randomizer = new p(t2.seed || 0)), t2.randomizer.next();
556
+ }
557
+ function E(t2, e2, s2, n2 = 1) {
558
+ return s2.roughness * n2 * (W(s2) * (e2 - t2) + t2);
559
+ }
560
+ function G(t2, e2, s2 = 1) {
561
+ return E(-t2, t2, e2, s2);
562
+ }
563
+ function $(t2, e2, s2, n2, o2, a2 = false) {
564
+ const h2 = a2 ? o2.disableMultiStrokeFill : o2.disableMultiStroke, r2 = R(t2, e2, s2, n2, o2, true, false);
565
+ if (h2)
566
+ return r2;
567
+ const i2 = R(t2, e2, s2, n2, o2, true, true);
568
+ return r2.concat(i2);
569
+ }
570
+ function R(t2, e2, s2, n2, o2, a2, h2) {
571
+ const r2 = Math.pow(t2 - s2, 2) + Math.pow(e2 - n2, 2), i2 = Math.sqrt(r2);
572
+ let c2 = 1;
573
+ c2 = i2 < 200 ? 1 : i2 > 500 ? 0.4 : -0.0016668 * i2 + 1.233334;
574
+ let l2 = o2.maxRandomnessOffset || 0;
575
+ l2 * l2 * 100 > r2 && (l2 = i2 / 10);
576
+ const u2 = l2 / 2, p2 = 0.2 + 0.2 * W(o2);
577
+ let f2 = o2.bowing * o2.maxRandomnessOffset * (n2 - e2) / 200, d2 = o2.bowing * o2.maxRandomnessOffset * (t2 - s2) / 200;
578
+ f2 = G(f2, o2, c2), d2 = G(d2, o2, c2);
579
+ const g2 = [], M2 = () => G(u2, o2, c2), k2 = () => G(l2, o2, c2), b2 = o2.preserveVertices;
580
+ return a2 && (h2 ? g2.push({ op: "move", data: [t2 + (b2 ? 0 : M2()), e2 + (b2 ? 0 : M2())] }) : g2.push({ op: "move", data: [t2 + (b2 ? 0 : G(l2, o2, c2)), e2 + (b2 ? 0 : G(l2, o2, c2))] })), h2 ? g2.push({ op: "bcurveTo", data: [f2 + t2 + (s2 - t2) * p2 + M2(), d2 + e2 + (n2 - e2) * p2 + M2(), f2 + t2 + 2 * (s2 - t2) * p2 + M2(), d2 + e2 + 2 * (n2 - e2) * p2 + M2(), s2 + (b2 ? 0 : M2()), n2 + (b2 ? 0 : M2())] }) : g2.push({ op: "bcurveTo", data: [f2 + t2 + (s2 - t2) * p2 + k2(), d2 + e2 + (n2 - e2) * p2 + k2(), f2 + t2 + 2 * (s2 - t2) * p2 + k2(), d2 + e2 + 2 * (n2 - e2) * p2 + k2(), s2 + (b2 ? 0 : k2()), n2 + (b2 ? 0 : k2())] }), g2;
581
+ }
582
+ function j(t2, e2, s2) {
583
+ if (!t2.length)
584
+ return [];
585
+ const n2 = [];
586
+ n2.push([t2[0][0] + G(e2, s2), t2[0][1] + G(e2, s2)]), n2.push([t2[0][0] + G(e2, s2), t2[0][1] + G(e2, s2)]);
587
+ for (let o2 = 1;o2 < t2.length; o2++)
588
+ n2.push([t2[o2][0] + G(e2, s2), t2[o2][1] + G(e2, s2)]), o2 === t2.length - 1 && n2.push([t2[o2][0] + G(e2, s2), t2[o2][1] + G(e2, s2)]);
589
+ return q(n2, null, s2);
590
+ }
591
+ function q(t2, e2, s2) {
592
+ const n2 = t2.length, o2 = [];
593
+ if (n2 > 3) {
594
+ const a2 = [], h2 = 1 - s2.curveTightness;
595
+ o2.push({ op: "move", data: [t2[1][0], t2[1][1]] });
596
+ for (let e3 = 1;e3 + 2 < n2; e3++) {
597
+ const s3 = t2[e3];
598
+ a2[0] = [s3[0], s3[1]], a2[1] = [s3[0] + (h2 * t2[e3 + 1][0] - h2 * t2[e3 - 1][0]) / 6, s3[1] + (h2 * t2[e3 + 1][1] - h2 * t2[e3 - 1][1]) / 6], a2[2] = [t2[e3 + 1][0] + (h2 * t2[e3][0] - h2 * t2[e3 + 2][0]) / 6, t2[e3 + 1][1] + (h2 * t2[e3][1] - h2 * t2[e3 + 2][1]) / 6], a2[3] = [t2[e3 + 1][0], t2[e3 + 1][1]], o2.push({ op: "bcurveTo", data: [a2[1][0], a2[1][1], a2[2][0], a2[2][1], a2[3][0], a2[3][1]] });
599
+ }
600
+ if (e2 && e2.length === 2) {
601
+ const t3 = s2.maxRandomnessOffset;
602
+ o2.push({ op: "lineTo", data: [e2[0] + G(t3, s2), e2[1] + G(t3, s2)] });
603
+ }
604
+ } else
605
+ n2 === 3 ? (o2.push({ op: "move", data: [t2[1][0], t2[1][1]] }), o2.push({ op: "bcurveTo", data: [t2[1][0], t2[1][1], t2[2][0], t2[2][1], t2[2][0], t2[2][1]] })) : n2 === 2 && o2.push(...R(t2[0][0], t2[0][1], t2[1][0], t2[1][1], s2, true, true));
606
+ return o2;
607
+ }
608
+ function F(t2, e2, s2, n2, o2, a2, h2, r2) {
609
+ const i2 = [], c2 = [];
610
+ if (r2.roughness === 0) {
611
+ t2 /= 4, c2.push([e2 + n2 * Math.cos(-t2), s2 + o2 * Math.sin(-t2)]);
612
+ for (let a3 = 0;a3 <= 2 * Math.PI; a3 += t2) {
613
+ const t3 = [e2 + n2 * Math.cos(a3), s2 + o2 * Math.sin(a3)];
614
+ i2.push(t3), c2.push(t3);
615
+ }
616
+ c2.push([e2 + n2 * Math.cos(0), s2 + o2 * Math.sin(0)]), c2.push([e2 + n2 * Math.cos(t2), s2 + o2 * Math.sin(t2)]);
617
+ } else {
618
+ const l2 = G(0.5, r2) - Math.PI / 2;
619
+ c2.push([G(a2, r2) + e2 + 0.9 * n2 * Math.cos(l2 - t2), G(a2, r2) + s2 + 0.9 * o2 * Math.sin(l2 - t2)]);
620
+ const u2 = 2 * Math.PI + l2 - 0.01;
621
+ for (let h3 = l2;h3 < u2; h3 += t2) {
622
+ const t3 = [G(a2, r2) + e2 + n2 * Math.cos(h3), G(a2, r2) + s2 + o2 * Math.sin(h3)];
623
+ i2.push(t3), c2.push(t3);
624
+ }
625
+ c2.push([G(a2, r2) + e2 + n2 * Math.cos(l2 + 2 * Math.PI + 0.5 * h2), G(a2, r2) + s2 + o2 * Math.sin(l2 + 2 * Math.PI + 0.5 * h2)]), c2.push([G(a2, r2) + e2 + 0.98 * n2 * Math.cos(l2 + h2), G(a2, r2) + s2 + 0.98 * o2 * Math.sin(l2 + h2)]), c2.push([G(a2, r2) + e2 + 0.9 * n2 * Math.cos(l2 + 0.5 * h2), G(a2, r2) + s2 + 0.9 * o2 * Math.sin(l2 + 0.5 * h2)]);
626
+ }
627
+ return [c2, i2];
628
+ }
629
+ function V(t2, e2, s2, n2, o2, a2, h2, r2, i2) {
630
+ const c2 = a2 + G(0.1, i2), l2 = [];
631
+ l2.push([G(r2, i2) + e2 + 0.9 * n2 * Math.cos(c2 - t2), G(r2, i2) + s2 + 0.9 * o2 * Math.sin(c2 - t2)]);
632
+ for (let a3 = c2;a3 <= h2; a3 += t2)
633
+ l2.push([G(r2, i2) + e2 + n2 * Math.cos(a3), G(r2, i2) + s2 + o2 * Math.sin(a3)]);
634
+ return l2.push([e2 + n2 * Math.cos(h2), s2 + o2 * Math.sin(h2)]), l2.push([e2 + n2 * Math.cos(h2), s2 + o2 * Math.sin(h2)]), q(l2, null, i2);
635
+ }
636
+ function Z(t2, e2, s2, n2, o2, a2, h2, r2) {
637
+ const i2 = [], c2 = [r2.maxRandomnessOffset || 1, (r2.maxRandomnessOffset || 1) + 0.3];
638
+ let l2 = [0, 0];
639
+ const u2 = r2.disableMultiStroke ? 1 : 2, p2 = r2.preserveVertices;
640
+ for (let f2 = 0;f2 < u2; f2++)
641
+ f2 === 0 ? i2.push({ op: "move", data: [h2[0], h2[1]] }) : i2.push({ op: "move", data: [h2[0] + (p2 ? 0 : G(c2[0], r2)), h2[1] + (p2 ? 0 : G(c2[0], r2))] }), l2 = p2 ? [o2, a2] : [o2 + G(c2[f2], r2), a2 + G(c2[f2], r2)], i2.push({ op: "bcurveTo", data: [t2 + G(c2[f2], r2), e2 + G(c2[f2], r2), s2 + G(c2[f2], r2), n2 + G(c2[f2], r2), l2[0], l2[1]] });
642
+ return i2;
643
+ }
644
+ function Q(t2) {
645
+ return [...t2];
646
+ }
647
+ function H(t2, e2 = 0) {
648
+ const s2 = t2.length;
649
+ if (s2 < 3)
650
+ throw new Error("A curve must have at least three points.");
651
+ const n2 = [];
652
+ if (s2 === 3)
653
+ n2.push(Q(t2[0]), Q(t2[1]), Q(t2[2]), Q(t2[2]));
654
+ else {
655
+ const s3 = [];
656
+ s3.push(t2[0], t2[0]);
657
+ for (let e3 = 1;e3 < t2.length; e3++)
658
+ s3.push(t2[e3]), e3 === t2.length - 1 && s3.push(t2[e3]);
659
+ const o2 = [], a2 = 1 - e2;
660
+ n2.push(Q(s3[0]));
661
+ for (let t3 = 1;t3 + 2 < s3.length; t3++) {
662
+ const e3 = s3[t3];
663
+ o2[0] = [e3[0], e3[1]], o2[1] = [e3[0] + (a2 * s3[t3 + 1][0] - a2 * s3[t3 - 1][0]) / 6, e3[1] + (a2 * s3[t3 + 1][1] - a2 * s3[t3 - 1][1]) / 6], o2[2] = [s3[t3 + 1][0] + (a2 * s3[t3][0] - a2 * s3[t3 + 2][0]) / 6, s3[t3 + 1][1] + (a2 * s3[t3][1] - a2 * s3[t3 + 2][1]) / 6], o2[3] = [s3[t3 + 1][0], s3[t3 + 1][1]], n2.push(o2[1], o2[2], o2[3]);
664
+ }
665
+ }
666
+ return n2;
667
+ }
668
+ function N(t2, e2) {
669
+ return Math.pow(t2[0] - e2[0], 2) + Math.pow(t2[1] - e2[1], 2);
670
+ }
671
+ function B(t2, e2, s2) {
672
+ const n2 = N(e2, s2);
673
+ if (n2 === 0)
674
+ return N(t2, e2);
675
+ let o2 = ((t2[0] - e2[0]) * (s2[0] - e2[0]) + (t2[1] - e2[1]) * (s2[1] - e2[1])) / n2;
676
+ return o2 = Math.max(0, Math.min(1, o2)), N(t2, J(e2, s2, o2));
677
+ }
678
+ function J(t2, e2, s2) {
679
+ return [t2[0] + (e2[0] - t2[0]) * s2, t2[1] + (e2[1] - t2[1]) * s2];
680
+ }
681
+ function K(t2, e2, s2, n2) {
682
+ const o2 = n2 || [];
683
+ if (function(t3, e3) {
684
+ const s3 = t3[e3 + 0], n3 = t3[e3 + 1], o3 = t3[e3 + 2], a3 = t3[e3 + 3];
685
+ let h3 = 3 * n3[0] - 2 * s3[0] - a3[0];
686
+ h3 *= h3;
687
+ let r2 = 3 * n3[1] - 2 * s3[1] - a3[1];
688
+ r2 *= r2;
689
+ let i2 = 3 * o3[0] - 2 * a3[0] - s3[0];
690
+ i2 *= i2;
691
+ let c2 = 3 * o3[1] - 2 * a3[1] - s3[1];
692
+ return c2 *= c2, h3 < i2 && (h3 = i2), r2 < c2 && (r2 = c2), h3 + r2;
693
+ }(t2, e2) < s2) {
694
+ const s3 = t2[e2 + 0];
695
+ if (o2.length) {
696
+ (a2 = o2[o2.length - 1], h2 = s3, Math.sqrt(N(a2, h2))) > 1 && o2.push(s3);
697
+ } else
698
+ o2.push(s3);
699
+ o2.push(t2[e2 + 3]);
700
+ } else {
701
+ const n3 = 0.5, a3 = t2[e2 + 0], h3 = t2[e2 + 1], r2 = t2[e2 + 2], i2 = t2[e2 + 3], c2 = J(a3, h3, n3), l2 = J(h3, r2, n3), u2 = J(r2, i2, n3), p2 = J(c2, l2, n3), f2 = J(l2, u2, n3), d2 = J(p2, f2, n3);
702
+ K([a3, c2, p2, d2], 0, s2, o2), K([d2, f2, u2, i2], 0, s2, o2);
703
+ }
704
+ var a2, h2;
705
+ return o2;
706
+ }
707
+ function U(t2, e2) {
708
+ return X(t2, 0, t2.length, e2);
709
+ }
710
+ function X(t2, e2, s2, n2, o2) {
711
+ const a2 = o2 || [], h2 = t2[e2], r2 = t2[s2 - 1];
712
+ let i2 = 0, c2 = 1;
713
+ for (let n3 = e2 + 1;n3 < s2 - 1; ++n3) {
714
+ const e3 = B(t2[n3], h2, r2);
715
+ e3 > i2 && (i2 = e3, c2 = n3);
716
+ }
717
+ return Math.sqrt(i2) > n2 ? (X(t2, e2, c2 + 1, n2, a2), X(t2, c2, s2, n2, a2)) : (a2.length || a2.push(h2), a2.push(r2)), a2;
718
+ }
719
+ function Y(t2, e2 = 0.15, s2) {
720
+ const n2 = [], o2 = (t2.length - 1) / 3;
721
+ for (let s3 = 0;s3 < o2; s3++) {
722
+ K(t2, 3 * s3, e2, n2);
723
+ }
724
+ return s2 && s2 > 0 ? X(n2, 0, n2.length, s2) : n2;
725
+ }
726
+ var tt = "none";
727
+
728
+ class et {
729
+ constructor(t2) {
730
+ this.defaultOptions = { maxRandomnessOffset: 2, roughness: 1, bowing: 1, stroke: "#000", strokeWidth: 1, curveTightness: 0, curveFitting: 0.95, curveStepCount: 9, fillStyle: "hachure", fillWeight: -1, hachureAngle: -41, hachureGap: -1, dashOffset: -1, dashGap: -1, zigzagOffset: -1, seed: 0, disableMultiStroke: false, disableMultiStrokeFill: false, preserveVertices: false, fillShapeRoughnessGain: 0.8 }, this.config = t2 || {}, this.config.options && (this.defaultOptions = this._o(this.config.options));
731
+ }
732
+ static newSeed() {
733
+ return Math.floor(Math.random() * 2 ** 31);
734
+ }
735
+ _o(t2) {
736
+ return t2 ? Object.assign({}, this.defaultOptions, t2) : this.defaultOptions;
737
+ }
738
+ _d(t2, e2, s2) {
739
+ return { shape: t2, sets: e2 || [], options: s2 || this.defaultOptions };
740
+ }
741
+ line(t2, e2, s2, n2, o2) {
742
+ const a2 = this._o(o2);
743
+ return this._d("line", [v(t2, e2, s2, n2, a2)], a2);
744
+ }
745
+ rectangle(t2, e2, s2, n2, o2) {
746
+ const a2 = this._o(o2), h2 = [], r2 = O(t2, e2, s2, n2, a2);
747
+ if (a2.fill) {
748
+ const o3 = [[t2, e2], [t2 + s2, e2], [t2 + s2, e2 + n2], [t2, e2 + n2]];
749
+ a2.fillStyle === "solid" ? h2.push(I([o3], a2)) : h2.push(C([o3], a2));
750
+ }
751
+ return a2.stroke !== tt && h2.push(r2), this._d("rectangle", h2, a2);
752
+ }
753
+ ellipse(t2, e2, s2, n2, o2) {
754
+ const a2 = this._o(o2), h2 = [], r2 = T(s2, n2, a2), i2 = D(t2, e2, a2, r2);
755
+ if (a2.fill)
756
+ if (a2.fillStyle === "solid") {
757
+ const s3 = D(t2, e2, a2, r2).opset;
758
+ s3.type = "fillPath", h2.push(s3);
759
+ } else
760
+ h2.push(C([i2.estimatedPoints], a2));
761
+ return a2.stroke !== tt && h2.push(i2.opset), this._d("ellipse", h2, a2);
762
+ }
763
+ circle(t2, e2, s2, n2) {
764
+ const o2 = this.ellipse(t2, e2, s2, s2, n2);
765
+ return o2.shape = "circle", o2;
766
+ }
767
+ linearPath(t2, e2) {
768
+ const s2 = this._o(e2);
769
+ return this._d("linearPath", [S(t2, false, s2)], s2);
770
+ }
771
+ arc(t2, e2, s2, n2, o2, a2, h2 = false, r2) {
772
+ const i2 = this._o(r2), c2 = [], l2 = A(t2, e2, s2, n2, o2, a2, h2, true, i2);
773
+ if (h2 && i2.fill)
774
+ if (i2.fillStyle === "solid") {
775
+ const h3 = Object.assign({}, i2);
776
+ h3.disableMultiStroke = true;
777
+ const r3 = A(t2, e2, s2, n2, o2, a2, true, false, h3);
778
+ r3.type = "fillPath", c2.push(r3);
779
+ } else
780
+ c2.push(function(t3, e3, s3, n3, o3, a3, h3) {
781
+ const r3 = t3, i3 = e3;
782
+ let c3 = Math.abs(s3 / 2), l3 = Math.abs(n3 / 2);
783
+ c3 += G(0.01 * c3, h3), l3 += G(0.01 * l3, h3);
784
+ let u2 = o3, p2 = a3;
785
+ for (;u2 < 0; )
786
+ u2 += 2 * Math.PI, p2 += 2 * Math.PI;
787
+ p2 - u2 > 2 * Math.PI && (u2 = 0, p2 = 2 * Math.PI);
788
+ const f2 = (p2 - u2) / h3.curveStepCount, d2 = [];
789
+ for (let t4 = u2;t4 <= p2; t4 += f2)
790
+ d2.push([r3 + c3 * Math.cos(t4), i3 + l3 * Math.sin(t4)]);
791
+ return d2.push([r3 + c3 * Math.cos(p2), i3 + l3 * Math.sin(p2)]), d2.push([r3, i3]), C([d2], h3);
792
+ }(t2, e2, s2, n2, o2, a2, i2));
793
+ return i2.stroke !== tt && c2.push(l2), this._d("arc", c2, i2);
794
+ }
795
+ curve(t2, e2) {
796
+ const s2 = this._o(e2), n2 = [], o2 = L(t2, s2);
797
+ if (s2.fill && s2.fill !== tt)
798
+ if (s2.fillStyle === "solid") {
799
+ const e3 = L(t2, Object.assign(Object.assign({}, s2), { disableMultiStroke: true, roughness: s2.roughness ? s2.roughness + s2.fillShapeRoughnessGain : 0 }));
800
+ n2.push({ type: "fillPath", ops: this._mergedShape(e3.ops) });
801
+ } else {
802
+ const e3 = [], o3 = t2;
803
+ if (o3.length) {
804
+ const t3 = typeof o3[0][0] == "number" ? [o3] : o3;
805
+ for (const n3 of t3)
806
+ n3.length < 3 ? e3.push(...n3) : n3.length === 3 ? e3.push(...Y(H([n3[0], n3[0], n3[1], n3[2]]), 10, (1 + s2.roughness) / 2)) : e3.push(...Y(H(n3), 10, (1 + s2.roughness) / 2));
807
+ }
808
+ e3.length && n2.push(C([e3], s2));
809
+ }
810
+ return s2.stroke !== tt && n2.push(o2), this._d("curve", n2, s2);
811
+ }
812
+ polygon(t2, e2) {
813
+ const s2 = this._o(e2), n2 = [], o2 = S(t2, true, s2);
814
+ return s2.fill && (s2.fillStyle === "solid" ? n2.push(I([t2], s2)) : n2.push(C([t2], s2))), s2.stroke !== tt && n2.push(o2), this._d("polygon", n2, s2);
815
+ }
816
+ path(t2, e2) {
817
+ const s2 = this._o(e2), n2 = [];
818
+ if (!t2)
819
+ return this._d("path", n2, s2);
820
+ t2 = (t2 || "").replace(/\n/g, " ").replace(/(-\s)/g, "-").replace("/(ss)/g", " ");
821
+ const o2 = s2.fill && s2.fill !== "transparent" && s2.fill !== tt, a2 = s2.stroke !== tt, h2 = !!(s2.simplification && s2.simplification < 1), r2 = function(t3, e3, s3) {
822
+ const n3 = m(y(b(t3))), o3 = [];
823
+ let a3 = [], h3 = [0, 0], r3 = [];
824
+ const i3 = () => {
825
+ r3.length >= 4 && a3.push(...Y(r3, e3)), r3 = [];
826
+ }, c2 = () => {
827
+ i3(), a3.length && (o3.push(a3), a3 = []);
828
+ };
829
+ for (const { key: t4, data: e4 } of n3)
830
+ switch (t4) {
831
+ case "M":
832
+ c2(), h3 = [e4[0], e4[1]], a3.push(h3);
833
+ break;
834
+ case "L":
835
+ i3(), a3.push([e4[0], e4[1]]);
836
+ break;
837
+ case "C":
838
+ if (!r3.length) {
839
+ const t5 = a3.length ? a3[a3.length - 1] : h3;
840
+ r3.push([t5[0], t5[1]]);
841
+ }
842
+ r3.push([e4[0], e4[1]]), r3.push([e4[2], e4[3]]), r3.push([e4[4], e4[5]]);
843
+ break;
844
+ case "Z":
845
+ i3(), a3.push([h3[0], h3[1]]);
846
+ }
847
+ if (c2(), !s3)
848
+ return o3;
849
+ const l2 = [];
850
+ for (const t4 of o3) {
851
+ const e4 = U(t4, s3);
852
+ e4.length && l2.push(e4);
853
+ }
854
+ return l2;
855
+ }(t2, 1, h2 ? 4 - 4 * (s2.simplification || 1) : (1 + s2.roughness) / 2), i2 = _(t2, s2);
856
+ if (o2)
857
+ if (s2.fillStyle === "solid")
858
+ if (r2.length === 1) {
859
+ const e3 = _(t2, Object.assign(Object.assign({}, s2), { disableMultiStroke: true, roughness: s2.roughness ? s2.roughness + s2.fillShapeRoughnessGain : 0 }));
860
+ n2.push({ type: "fillPath", ops: this._mergedShape(e3.ops) });
861
+ } else
862
+ n2.push(I(r2, s2));
863
+ else
864
+ n2.push(C(r2, s2));
865
+ return a2 && (h2 ? r2.forEach((t3) => {
866
+ n2.push(S(t3, false, s2));
867
+ }) : n2.push(i2)), this._d("path", n2, s2);
868
+ }
869
+ opsToPath(t2, e2) {
870
+ let s2 = "";
871
+ for (const n2 of t2.ops) {
872
+ const t3 = typeof e2 == "number" && e2 >= 0 ? n2.data.map((t4) => +t4.toFixed(e2)) : n2.data;
873
+ switch (n2.op) {
874
+ case "move":
875
+ s2 += `M${t3[0]} ${t3[1]} `;
876
+ break;
877
+ case "bcurveTo":
878
+ s2 += `C${t3[0]} ${t3[1]}, ${t3[2]} ${t3[3]}, ${t3[4]} ${t3[5]} `;
879
+ break;
880
+ case "lineTo":
881
+ s2 += `L${t3[0]} ${t3[1]} `;
882
+ }
883
+ }
884
+ return s2.trim();
885
+ }
886
+ toPaths(t2) {
887
+ const e2 = t2.sets || [], s2 = t2.options || this.defaultOptions, n2 = [];
888
+ for (const t3 of e2) {
889
+ let e3 = null;
890
+ switch (t3.type) {
891
+ case "path":
892
+ e3 = { d: this.opsToPath(t3), stroke: s2.stroke, strokeWidth: s2.strokeWidth, fill: tt };
893
+ break;
894
+ case "fillPath":
895
+ e3 = { d: this.opsToPath(t3), stroke: tt, strokeWidth: 0, fill: s2.fill || tt };
896
+ break;
897
+ case "fillSketch":
898
+ e3 = this.fillSketch(t3, s2);
899
+ }
900
+ e3 && n2.push(e3);
901
+ }
902
+ return n2;
903
+ }
904
+ fillSketch(t2, e2) {
905
+ let s2 = e2.fillWeight;
906
+ return s2 < 0 && (s2 = e2.strokeWidth / 2), { d: this.opsToPath(t2), stroke: e2.fill || tt, strokeWidth: s2, fill: tt };
907
+ }
908
+ _mergedShape(t2) {
909
+ return t2.filter((t3, e2) => e2 === 0 || t3.op !== "move");
910
+ }
911
+ }
912
+
913
+ class st {
914
+ constructor(t2, e2) {
915
+ this.canvas = t2, this.ctx = this.canvas.getContext("2d"), this.gen = new et(e2);
916
+ }
917
+ draw(t2) {
918
+ const e2 = t2.sets || [], s2 = t2.options || this.getDefaultOptions(), n2 = this.ctx, o2 = t2.options.fixedDecimalPlaceDigits;
919
+ for (const a2 of e2)
920
+ switch (a2.type) {
921
+ case "path":
922
+ n2.save(), n2.strokeStyle = s2.stroke === "none" ? "transparent" : s2.stroke, n2.lineWidth = s2.strokeWidth, s2.strokeLineDash && n2.setLineDash(s2.strokeLineDash), s2.strokeLineDashOffset && (n2.lineDashOffset = s2.strokeLineDashOffset), this._drawToContext(n2, a2, o2), n2.restore();
923
+ break;
924
+ case "fillPath": {
925
+ n2.save(), n2.fillStyle = s2.fill || "";
926
+ const e3 = t2.shape === "curve" || t2.shape === "polygon" || t2.shape === "path" ? "evenodd" : "nonzero";
927
+ this._drawToContext(n2, a2, o2, e3), n2.restore();
928
+ break;
929
+ }
930
+ case "fillSketch":
931
+ this.fillSketch(n2, a2, s2);
932
+ }
933
+ }
934
+ fillSketch(t2, e2, s2) {
935
+ let n2 = s2.fillWeight;
936
+ n2 < 0 && (n2 = s2.strokeWidth / 2), t2.save(), s2.fillLineDash && t2.setLineDash(s2.fillLineDash), s2.fillLineDashOffset && (t2.lineDashOffset = s2.fillLineDashOffset), t2.strokeStyle = s2.fill || "", t2.lineWidth = n2, this._drawToContext(t2, e2, s2.fixedDecimalPlaceDigits), t2.restore();
937
+ }
938
+ _drawToContext(t2, e2, s2, n2 = "nonzero") {
939
+ t2.beginPath();
940
+ for (const n3 of e2.ops) {
941
+ const e3 = typeof s2 == "number" && s2 >= 0 ? n3.data.map((t3) => +t3.toFixed(s2)) : n3.data;
942
+ switch (n3.op) {
943
+ case "move":
944
+ t2.moveTo(e3[0], e3[1]);
945
+ break;
946
+ case "bcurveTo":
947
+ t2.bezierCurveTo(e3[0], e3[1], e3[2], e3[3], e3[4], e3[5]);
948
+ break;
949
+ case "lineTo":
950
+ t2.lineTo(e3[0], e3[1]);
951
+ }
952
+ }
953
+ e2.type === "fillPath" ? t2.fill(n2) : t2.stroke();
954
+ }
955
+ get generator() {
956
+ return this.gen;
957
+ }
958
+ getDefaultOptions() {
959
+ return this.gen.defaultOptions;
960
+ }
961
+ line(t2, e2, s2, n2, o2) {
962
+ const a2 = this.gen.line(t2, e2, s2, n2, o2);
963
+ return this.draw(a2), a2;
964
+ }
965
+ rectangle(t2, e2, s2, n2, o2) {
966
+ const a2 = this.gen.rectangle(t2, e2, s2, n2, o2);
967
+ return this.draw(a2), a2;
968
+ }
969
+ ellipse(t2, e2, s2, n2, o2) {
970
+ const a2 = this.gen.ellipse(t2, e2, s2, n2, o2);
971
+ return this.draw(a2), a2;
972
+ }
973
+ circle(t2, e2, s2, n2) {
974
+ const o2 = this.gen.circle(t2, e2, s2, n2);
975
+ return this.draw(o2), o2;
976
+ }
977
+ linearPath(t2, e2) {
978
+ const s2 = this.gen.linearPath(t2, e2);
979
+ return this.draw(s2), s2;
980
+ }
981
+ polygon(t2, e2) {
982
+ const s2 = this.gen.polygon(t2, e2);
983
+ return this.draw(s2), s2;
984
+ }
985
+ arc(t2, e2, s2, n2, o2, a2, h2 = false, r2) {
986
+ const i2 = this.gen.arc(t2, e2, s2, n2, o2, a2, h2, r2);
987
+ return this.draw(i2), i2;
988
+ }
989
+ curve(t2, e2) {
990
+ const s2 = this.gen.curve(t2, e2);
991
+ return this.draw(s2), s2;
992
+ }
993
+ path(t2, e2) {
994
+ const s2 = this.gen.path(t2, e2);
995
+ return this.draw(s2), s2;
996
+ }
997
+ }
998
+ var nt = "http://www.w3.org/2000/svg";
999
+
1000
+ class ot {
1001
+ constructor(t2, e2) {
1002
+ this.svg = t2, this.gen = new et(e2);
1003
+ }
1004
+ draw(t2) {
1005
+ const e2 = t2.sets || [], s2 = t2.options || this.getDefaultOptions(), n2 = this.svg.ownerDocument || window.document, o2 = n2.createElementNS(nt, "g"), a2 = t2.options.fixedDecimalPlaceDigits;
1006
+ for (const h2 of e2) {
1007
+ let e3 = null;
1008
+ switch (h2.type) {
1009
+ case "path":
1010
+ e3 = n2.createElementNS(nt, "path"), e3.setAttribute("d", this.opsToPath(h2, a2)), e3.setAttribute("stroke", s2.stroke), e3.setAttribute("stroke-width", s2.strokeWidth + ""), e3.setAttribute("fill", "none"), s2.strokeLineDash && e3.setAttribute("stroke-dasharray", s2.strokeLineDash.join(" ").trim()), s2.strokeLineDashOffset && e3.setAttribute("stroke-dashoffset", `${s2.strokeLineDashOffset}`);
1011
+ break;
1012
+ case "fillPath":
1013
+ e3 = n2.createElementNS(nt, "path"), e3.setAttribute("d", this.opsToPath(h2, a2)), e3.setAttribute("stroke", "none"), e3.setAttribute("stroke-width", "0"), e3.setAttribute("fill", s2.fill || ""), t2.shape !== "curve" && t2.shape !== "polygon" || e3.setAttribute("fill-rule", "evenodd");
1014
+ break;
1015
+ case "fillSketch":
1016
+ e3 = this.fillSketch(n2, h2, s2);
1017
+ }
1018
+ e3 && o2.appendChild(e3);
1019
+ }
1020
+ return o2;
1021
+ }
1022
+ fillSketch(t2, e2, s2) {
1023
+ let n2 = s2.fillWeight;
1024
+ n2 < 0 && (n2 = s2.strokeWidth / 2);
1025
+ const o2 = t2.createElementNS(nt, "path");
1026
+ return o2.setAttribute("d", this.opsToPath(e2, s2.fixedDecimalPlaceDigits)), o2.setAttribute("stroke", s2.fill || ""), o2.setAttribute("stroke-width", n2 + ""), o2.setAttribute("fill", "none"), s2.fillLineDash && o2.setAttribute("stroke-dasharray", s2.fillLineDash.join(" ").trim()), s2.fillLineDashOffset && o2.setAttribute("stroke-dashoffset", `${s2.fillLineDashOffset}`), o2;
1027
+ }
1028
+ get generator() {
1029
+ return this.gen;
1030
+ }
1031
+ getDefaultOptions() {
1032
+ return this.gen.defaultOptions;
1033
+ }
1034
+ opsToPath(t2, e2) {
1035
+ return this.gen.opsToPath(t2, e2);
1036
+ }
1037
+ line(t2, e2, s2, n2, o2) {
1038
+ const a2 = this.gen.line(t2, e2, s2, n2, o2);
1039
+ return this.draw(a2);
1040
+ }
1041
+ rectangle(t2, e2, s2, n2, o2) {
1042
+ const a2 = this.gen.rectangle(t2, e2, s2, n2, o2);
1043
+ return this.draw(a2);
1044
+ }
1045
+ ellipse(t2, e2, s2, n2, o2) {
1046
+ const a2 = this.gen.ellipse(t2, e2, s2, n2, o2);
1047
+ return this.draw(a2);
1048
+ }
1049
+ circle(t2, e2, s2, n2) {
1050
+ const o2 = this.gen.circle(t2, e2, s2, n2);
1051
+ return this.draw(o2);
1052
+ }
1053
+ linearPath(t2, e2) {
1054
+ const s2 = this.gen.linearPath(t2, e2);
1055
+ return this.draw(s2);
1056
+ }
1057
+ polygon(t2, e2) {
1058
+ const s2 = this.gen.polygon(t2, e2);
1059
+ return this.draw(s2);
1060
+ }
1061
+ arc(t2, e2, s2, n2, o2, a2, h2 = false, r2) {
1062
+ const i2 = this.gen.arc(t2, e2, s2, n2, o2, a2, h2, r2);
1063
+ return this.draw(i2);
1064
+ }
1065
+ curve(t2, e2) {
1066
+ const s2 = this.gen.curve(t2, e2);
1067
+ return this.draw(s2);
1068
+ }
1069
+ path(t2, e2) {
1070
+ const s2 = this.gen.path(t2, e2);
1071
+ return this.draw(s2);
1072
+ }
1073
+ }
1074
+ var at = { canvas: (t2, e2) => new st(t2, e2), svg: (t2, e2) => new ot(t2, e2), generator: (t2) => new et(t2), newSeed: () => et.newSeed() };
1075
+
1076
+ export { at };