@loopstack/loopstack-studio 0.25.0 → 0.25.2

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 (196) hide show
  1. package/dist/components/ai-elements/message.js +2 -2
  2. package/dist/components/ai-elements/reasoning.js +9 -9
  3. package/dist/loopstack-studio.css +1 -1
  4. package/dist/node_modules/@chevrotain/gast/lib/src/helpers.js +2 -5
  5. package/dist/node_modules/@chevrotain/gast/lib/src/model.js +69 -72
  6. package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/{architecture-7HQA4BMR.js → architecture-YZFGNWBL.js} +2 -2
  7. package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/{chunk-TQ3KTPDO.js → chunk-2KRD3SAO.js} +1 -1
  8. package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/{chunk-4F5CHEZ2.js → chunk-67CJDMHE.js} +1 -1
  9. package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/{chunk-UMXZTB3W.js → chunk-7N4EOEYR.js} +5 -2
  10. package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/{chunk-PL6DKKU2.js → chunk-AA7GKIK3.js} +1 -1
  11. package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/chunk-CIAEETIT.js +23 -0
  12. package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/{chunk-SJTYNZTY.js → chunk-FOC6F5B3.js} +1 -1
  13. package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/chunk-K5T4RW27.js +1197 -0
  14. package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/{chunk-FRFDVMJY.js → chunk-KGLVRYIC.js} +1 -1
  15. package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/{chunk-B2363JML.js → chunk-LIHQZDEY.js} +1 -1
  16. package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/chunk-ORNJ4GCN.js +29 -0
  17. package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/{gitGraph-G5XIXVHT.js → gitGraph-7Q5UKJZL.js} +2 -2
  18. package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/info-OMHHGYJF.js +3 -0
  19. package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/packet-4T2RLAQJ.js +3 -0
  20. package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/pie-ZZUOXDRM.js +3 -0
  21. package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/radar-PYXPWWZC.js +3 -0
  22. package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/treeView-SZITEDCU.js +3 -0
  23. package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/treemap-W4RFUUIX.js +3 -0
  24. package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/wardley-RL74JXVD.js +3 -0
  25. package/dist/node_modules/@mermaid-js/parser/dist/mermaid-parser.core.js +27 -17
  26. package/dist/node_modules/@upsetjs/venn.js/build/venn.esm.js +903 -0
  27. package/dist/node_modules/@xyflow/react/dist/esm/index.js +76 -75
  28. package/dist/node_modules/@xyflow/system/dist/esm/index.js +30 -28
  29. package/dist/node_modules/chevrotain/lib/src/parse/cst/cst_visitor.js +31 -40
  30. package/dist/node_modules/chevrotain/lib/src/parse/errors_public.js +23 -26
  31. package/dist/node_modules/chevrotain/lib/src/parse/exceptions_public.js +12 -13
  32. package/dist/node_modules/chevrotain/lib/src/parse/grammar/checks.js +181 -205
  33. package/dist/node_modules/chevrotain/lib/src/parse/grammar/first.js +11 -13
  34. package/dist/node_modules/chevrotain/lib/src/parse/grammar/follow.js +12 -13
  35. package/dist/node_modules/chevrotain/lib/src/parse/grammar/gast/gast_resolver_public.js +8 -9
  36. package/dist/node_modules/chevrotain/lib/src/parse/grammar/interpreter.js +176 -183
  37. package/dist/node_modules/chevrotain/lib/src/parse/grammar/llk_lookahead.js +17 -19
  38. package/dist/node_modules/chevrotain/lib/src/parse/grammar/lookahead.js +153 -160
  39. package/dist/node_modules/chevrotain/lib/src/parse/grammar/resolver.js +10 -12
  40. package/dist/node_modules/chevrotain/lib/src/parse/grammar/rest.js +36 -38
  41. package/dist/node_modules/chevrotain/lib/src/parse/parser/parser.js +37 -45
  42. package/dist/node_modules/chevrotain/lib/src/parse/parser/traits/error_handler.js +12 -14
  43. package/dist/node_modules/chevrotain/lib/src/parse/parser/traits/gast_recorder.js +80 -86
  44. package/dist/node_modules/chevrotain/lib/src/parse/parser/traits/lexer_adapter.js +6 -2
  45. package/dist/node_modules/chevrotain/lib/src/parse/parser/traits/looksahead.js +39 -41
  46. package/dist/node_modules/chevrotain/lib/src/parse/parser/traits/perf_tracer.js +7 -8
  47. package/dist/node_modules/chevrotain/lib/src/parse/parser/traits/recognizer_api.js +69 -70
  48. package/dist/node_modules/chevrotain/lib/src/parse/parser/traits/recognizer_engine.js +215 -205
  49. package/dist/node_modules/chevrotain/lib/src/parse/parser/traits/recoverable.js +76 -76
  50. package/dist/node_modules/chevrotain/lib/src/parse/parser/traits/tree_builder.js +29 -39
  51. package/dist/node_modules/chevrotain/lib/src/scan/lexer.js +252 -274
  52. package/dist/node_modules/chevrotain/lib/src/scan/lexer_public.js +93 -106
  53. package/dist/node_modules/chevrotain/lib/src/scan/reg_exp.js +61 -61
  54. package/dist/node_modules/chevrotain/lib/src/scan/tokens.js +31 -41
  55. package/dist/node_modules/chevrotain/lib/src/scan/tokens_public.js +15 -18
  56. package/dist/node_modules/chevrotain-allstar/lib/all-star-lookahead.js +226 -226
  57. package/dist/node_modules/chevrotain-allstar/lib/atn.js +17 -17
  58. package/dist/node_modules/cytoscape/dist/cytoscape.esm.js +17 -14
  59. package/dist/node_modules/dagre-d3-es/src/dagre/greedy-fas.js +19 -19
  60. package/dist/node_modules/dagre-d3-es/src/dagre/layout.js +48 -48
  61. package/dist/node_modules/dagre-d3-es/src/dagre/nesting-graph.js +9 -9
  62. package/dist/node_modules/dagre-d3-es/src/dagre/order/cross-count.js +3 -3
  63. package/dist/node_modules/dagre-d3-es/src/dagre/order/index.js +11 -11
  64. package/dist/node_modules/dagre-d3-es/src/dagre/order/init-order.js +4 -4
  65. package/dist/node_modules/dagre-d3-es/src/dagre/order/resolve-conflicts.js +4 -4
  66. package/dist/node_modules/dagre-d3-es/src/dagre/order/sort-subgraph.js +8 -8
  67. package/dist/node_modules/dagre-d3-es/src/dagre/order/sort.js +5 -5
  68. package/dist/node_modules/dagre-d3-es/src/dagre/position/bk.js +61 -61
  69. package/dist/node_modules/dagre-d3-es/src/dagre/position/index.js +1 -1
  70. package/dist/node_modules/dagre-d3-es/src/dagre/rank/network-simplex.js +25 -25
  71. package/dist/node_modules/dagre-d3-es/src/dagre/rank/util.js +8 -8
  72. package/dist/node_modules/dagre-d3-es/src/dagre/util.js +48 -48
  73. package/dist/node_modules/dagre-d3-es/src/graphlib/graph.js +109 -109
  74. package/dist/node_modules/dagre-d3-es/src/graphlib/json.js +17 -17
  75. package/dist/node_modules/dompurify/dist/purify.es.js +67 -67
  76. package/dist/node_modules/katex/dist/katex.js +1256 -1209
  77. package/dist/node_modules/khroma/dist/methods/transparentize.js +3 -0
  78. package/dist/node_modules/lodash-es/_baseClone.js +2 -2
  79. package/dist/node_modules/lodash-es/_baseMatchesProperty.js +6 -6
  80. package/dist/node_modules/lodash-es/_baseToString.js +1 -1
  81. package/dist/node_modules/lodash-es/_baseUniq.js +1 -1
  82. package/dist/node_modules/lodash-es/_createSet.js +1 -1
  83. package/dist/node_modules/lodash-es/_getAllKeys.js +2 -2
  84. package/dist/node_modules/lodash-es/_getAllKeysIn.js +1 -1
  85. package/dist/node_modules/lodash-es/findIndex.js +2 -2
  86. package/dist/node_modules/lodash-es/flatMap.js +1 -1
  87. package/dist/node_modules/lodash-es/forEach.js +1 -1
  88. package/dist/node_modules/lodash-es/max.js +1 -1
  89. package/dist/node_modules/lodash-es/min.js +1 -1
  90. package/dist/node_modules/lodash-es/minBy.js +1 -1
  91. package/dist/node_modules/lodash-es/reduce.js +1 -1
  92. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/architectureDiagram-Q4EWVU46.js +691 -0
  93. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{blockDiagram-VD42YOAC.js → blockDiagram-DXYQGD6D.js} +183 -157
  94. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{c4Diagram-YG6GDRKO.js → c4Diagram-AHTNJAMY.js} +65 -63
  95. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/chunk-336JU56O.js +47 -0
  96. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{chunk-EXTU4WIE.js → chunk-426QAEUC.js} +1 -1
  97. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{chunk-B4BG7PRW.js → chunk-4TB4RGXK.js} +533 -393
  98. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/chunk-5FUZZQ4R.js +3638 -0
  99. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{chunk-S3R3BYOJ.js → chunk-5PVQY5BW.js} +1 -1
  100. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{chunk-HN2XXSSU.js → chunk-BSJP7CBP.js} +20 -14
  101. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{chunk-QN33PNHL.js → chunk-EDXVE4YY.js} +1 -1
  102. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/chunk-ENJZ2VHE.js +568 -0
  103. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/chunk-ICPOFSXX.js +2320 -0
  104. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{chunk-DI55MBZ5.js → chunk-OYMX7WX6.js} +35 -21
  105. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/chunk-U2HBQHQK.js +272 -0
  106. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{chunk-ATLVNIR6.js → chunk-X2U36JSP.js} +1 -1
  107. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{chunk-MI3HLSF2.js → chunk-XPW4576I.js} +11 -7
  108. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/chunk-YZCP3GAM.js +60 -0
  109. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/chunk-ZZ45TVLE.js +30 -0
  110. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{classDiagram-2ON5EDUG.js → classDiagram-6PBFFD2Q.js} +12 -11
  111. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{classDiagram-v2-WZHVMYZB.js → classDiagram-v2-HSJHXN6E.js} +12 -11
  112. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{dagre-6UL2VRFP.js → dagre-KV5264BT.js} +8 -8
  113. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/diagram-5BDNPKRD.js +99 -0
  114. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{diagram-PSM6KHXK.js → diagram-G4DWMVQ6.js} +20 -23
  115. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/diagram-MMDJMWI5.js +211 -0
  116. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{diagram-S2PKOQOG.js → diagram-TYMM5635.js} +4 -4
  117. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{erDiagram-Q2GNP2WA.js → erDiagram-SMLLAGMA.js} +486 -386
  118. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{flowDiagram-NV44I4VS.js → flowDiagram-DWJPFMVM.js} +915 -898
  119. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{ganttDiagram-JELNMOA3.js → ganttDiagram-T4ZO3ILL.js} +59 -29
  120. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/gitGraphDiagram-UUTBAWPF.js +728 -0
  121. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/infoDiagram-42DDH7IO.js +17 -0
  122. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/ishikawaDiagram-UXIWVN3A.js +714 -0
  123. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{journeyDiagram-XKPGCS4Q.js → journeyDiagram-VCZTEJTY.js} +32 -32
  124. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{kanban-definition-3W4ZIXB7.js → kanban-definition-6JOO6SKY.js} +13 -9
  125. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{mindmap-definition-VGOIOE7T.js → mindmap-definition-QFDTVHPH.js} +105 -59
  126. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/pieDiagram-DEJITSTG.js +117 -0
  127. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{quadrantDiagram-AYHSOK5B.js → quadrantDiagram-34T5L4WZ.js} +1 -1
  128. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{requirementDiagram-UZGBJVZJ.js → requirementDiagram-MS252O5E.js} +49 -19
  129. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{sankeyDiagram-TZEHDZUN.js → sankeyDiagram-XADWPNL6.js} +1 -1
  130. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/sequenceDiagram-FGHM5R23.js +4155 -0
  131. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{stateDiagram-FKZM4ZOC.js → stateDiagram-FHFEXIEX.js} +12 -12
  132. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{stateDiagram-v2-4FDKWEC3.js → stateDiagram-v2-QKLJ7IA2.js} +11 -11
  133. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/timeline-definition-GMOUNBTQ.js +1071 -0
  134. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/vennDiagram-DHZGUBPP.js +959 -0
  135. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/wardleyDiagram-NUSXRM2D.js +574 -0
  136. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{xychartDiagram-PRI3JC2R.js → xychartDiagram-5P7HB3ND.js} +38 -35
  137. package/dist/node_modules/mermaid/dist/mermaid.core.js +235 -192
  138. package/dist/node_modules/nanoid/url-alphabet/index.js +1 -1
  139. package/dist/node_modules/remend/dist/index.js +333 -264
  140. package/dist/node_modules/streamdown/dist/chunk-BO2N2NFS.js +2498 -0
  141. package/dist/node_modules/streamdown/dist/highlighted-body-OFNGDK62.js +35 -0
  142. package/dist/node_modules/streamdown/dist/index.js +1 -1
  143. package/dist/node_modules/streamdown/dist/mermaid-GHXKKRXX.js +3 -0
  144. package/dist/node_modules/streamdown/node_modules/marked/lib/marked.esm.js +672 -667
  145. package/dist/pages/DashboardPage.js +3 -3
  146. package/package.json +2 -2
  147. package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/chunk-TCCFYFTB.js +0 -787
  148. package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/info-VBDWY6EO.js +0 -3
  149. package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/packet-DYOGHKS2.js +0 -3
  150. package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/pie-VRWISCQL.js +0 -3
  151. package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/radar-ZZBFDIW7.js +0 -3
  152. package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/treemap-GDKQZRPO.js +0 -3
  153. package/dist/node_modules/chevrotain/lib/src/parse/parser/traits/context_assist.js +0 -16
  154. package/dist/node_modules/lodash-es/_arrayAggregator.js +0 -9
  155. package/dist/node_modules/lodash-es/_arrayEvery.js +0 -6
  156. package/dist/node_modules/lodash-es/_baseAggregator.js +0 -8
  157. package/dist/node_modules/lodash-es/_baseDifference.js +0 -22
  158. package/dist/node_modules/lodash-es/_baseEvery.js +0 -9
  159. package/dist/node_modules/lodash-es/_baseIsRegExp.js +0 -8
  160. package/dist/node_modules/lodash-es/_baseSlice.js +0 -8
  161. package/dist/node_modules/lodash-es/_baseSome.js +0 -9
  162. package/dist/node_modules/lodash-es/_createAggregator.js +0 -12
  163. package/dist/node_modules/lodash-es/assign.js +0 -14
  164. package/dist/node_modules/lodash-es/compact.js +0 -9
  165. package/dist/node_modules/lodash-es/difference.js +0 -8
  166. package/dist/node_modules/lodash-es/drop.js +0 -8
  167. package/dist/node_modules/lodash-es/dropRight.js +0 -8
  168. package/dist/node_modules/lodash-es/every.js +0 -11
  169. package/dist/node_modules/lodash-es/groupBy.js +0 -6
  170. package/dist/node_modules/lodash-es/head.js +0 -5
  171. package/dist/node_modules/lodash-es/includes.js +0 -13
  172. package/dist/node_modules/lodash-es/indexOf.js +0 -11
  173. package/dist/node_modules/lodash-es/isRegExp.js +0 -5
  174. package/dist/node_modules/lodash-es/negate.js +0 -16
  175. package/dist/node_modules/lodash-es/pickBy.js +0 -15
  176. package/dist/node_modules/lodash-es/reject.js +0 -10
  177. package/dist/node_modules/lodash-es/some.js +0 -11
  178. package/dist/node_modules/lodash-es/uniq.js +0 -6
  179. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/architectureDiagram-VXUJARFQ.js +0 -673
  180. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/chunk-ABZYJK2D.js +0 -1547
  181. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/chunk-CVBHYZKI.js +0 -10
  182. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/chunk-DR5Q36YT.js +0 -135
  183. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/chunk-JA3XYJ7Z.js +0 -247
  184. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/chunk-JZLCHNYA.js +0 -3516
  185. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/chunk-N4CR4FBY.js +0 -39
  186. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/chunk-QXUST7PY.js +0 -497
  187. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/chunk-TZMSLE5B.js +0 -55
  188. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/diagram-QEK2KX5R.js +0 -211
  189. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/gitGraphDiagram-V2S2FVAM.js +0 -621
  190. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/infoDiagram-HS3SLOUP.js +0 -18
  191. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/pieDiagram-ADFJNKIX.js +0 -117
  192. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/sequenceDiagram-WL72ISMW.js +0 -3560
  193. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/timeline-definition-IT6M3QCI.js +0 -833
  194. package/dist/node_modules/streamdown/dist/chunk-RLXIAIE6.js +0 -2189
  195. package/dist/node_modules/streamdown/dist/highlighted-body-B3W2YXNL.js +0 -33
  196. package/dist/node_modules/streamdown/dist/mermaid-3ZIDBTTL.js +0 -3
@@ -0,0 +1,959 @@
1
+ import { __name } from "./chunk-AGHRB4JF.js";
2
+ import is_dark_default from "../../../../khroma/dist/methods/is_dark.js";
3
+ import lighten_default from "../../../../khroma/dist/methods/lighten.js";
4
+ import darken_default from "../../../../khroma/dist/methods/darken.js";
5
+ import transparentize_default from "../../../../khroma/dist/methods/transparentize.js";
6
+ import { clear, configureSvgSize, defaultConfig_default, getAccDescription, getAccTitle, getConfig, getDiagramTitle, setAccDescription, setAccTitle, setDiagramTitle } from "./chunk-ICPOFSXX.js";
7
+ import select_default from "../../../../d3-selection/src/select.js";
8
+ import "../../../../d3/src/index.js";
9
+ import { selectSvgElement } from "./chunk-426QAEUC.js";
10
+ import { cleanAndMerge } from "./chunk-5PVQY5BW.js";
11
+ import { at } from "../../../../roughjs/bundled/rough.esm.js";
12
+ import { VennDiagram, layout } from "../../../../@upsetjs/venn.js/build/venn.esm.js";
13
+ var parser = (function() {
14
+ var f = /* @__PURE__ */ __name(function(e, f, p, m) {
15
+ for (p ||= {}, m = e.length; m--; p[e[m]] = f);
16
+ return p;
17
+ }, "o"), p = [5, 8], m = [
18
+ 7,
19
+ 8,
20
+ 11,
21
+ 12,
22
+ 17,
23
+ 19,
24
+ 22,
25
+ 24
26
+ ], h = [1, 17], g = [1, 18], _ = [
27
+ 7,
28
+ 8,
29
+ 11,
30
+ 12,
31
+ 14,
32
+ 15,
33
+ 16,
34
+ 17,
35
+ 19,
36
+ 20,
37
+ 21,
38
+ 22,
39
+ 24,
40
+ 27
41
+ ], v = [1, 31], y = [1, 39], b = [
42
+ 7,
43
+ 8,
44
+ 11,
45
+ 12,
46
+ 17,
47
+ 19,
48
+ 22,
49
+ 24,
50
+ 27
51
+ ], x = [1, 57], S = [1, 56], C = [1, 58], w = [1, 59], T = [1, 60], E = [
52
+ 7,
53
+ 8,
54
+ 11,
55
+ 12,
56
+ 16,
57
+ 17,
58
+ 19,
59
+ 20,
60
+ 22,
61
+ 24,
62
+ 27,
63
+ 31,
64
+ 32,
65
+ 33
66
+ ], D = {
67
+ trace: /* @__PURE__ */ __name(function() {}, "trace"),
68
+ yy: {},
69
+ symbols_: {
70
+ error: 2,
71
+ start: 3,
72
+ optNewlines: 4,
73
+ VENN: 5,
74
+ document: 6,
75
+ EOF: 7,
76
+ NEWLINE: 8,
77
+ line: 9,
78
+ statement: 10,
79
+ TITLE: 11,
80
+ SET: 12,
81
+ identifier: 13,
82
+ BRACKET_LABEL: 14,
83
+ COLON: 15,
84
+ NUMERIC: 16,
85
+ UNION: 17,
86
+ identifierList: 18,
87
+ TEXT: 19,
88
+ IDENTIFIER: 20,
89
+ STRING: 21,
90
+ INDENT_TEXT: 22,
91
+ indentedTextTail: 23,
92
+ STYLE: 24,
93
+ stylesOpt: 25,
94
+ styleField: 26,
95
+ COMMA: 27,
96
+ styleValue: 28,
97
+ valueTokens: 29,
98
+ valueToken: 30,
99
+ HEXCOLOR: 31,
100
+ RGBCOLOR: 32,
101
+ RGBACOLOR: 33,
102
+ $accept: 0,
103
+ $end: 1
104
+ },
105
+ terminals_: {
106
+ 2: "error",
107
+ 5: "VENN",
108
+ 7: "EOF",
109
+ 8: "NEWLINE",
110
+ 11: "TITLE",
111
+ 12: "SET",
112
+ 14: "BRACKET_LABEL",
113
+ 15: "COLON",
114
+ 16: "NUMERIC",
115
+ 17: "UNION",
116
+ 19: "TEXT",
117
+ 20: "IDENTIFIER",
118
+ 21: "STRING",
119
+ 22: "INDENT_TEXT",
120
+ 24: "STYLE",
121
+ 27: "COMMA",
122
+ 31: "HEXCOLOR",
123
+ 32: "RGBCOLOR",
124
+ 33: "RGBACOLOR"
125
+ },
126
+ productions_: [
127
+ 0,
128
+ [3, 4],
129
+ [4, 0],
130
+ [4, 2],
131
+ [6, 0],
132
+ [6, 2],
133
+ [9, 1],
134
+ [9, 1],
135
+ [10, 1],
136
+ [10, 2],
137
+ [10, 3],
138
+ [10, 4],
139
+ [10, 5],
140
+ [10, 2],
141
+ [10, 3],
142
+ [10, 4],
143
+ [10, 5],
144
+ [10, 3],
145
+ [10, 3],
146
+ [10, 3],
147
+ [10, 4],
148
+ [10, 4],
149
+ [10, 2],
150
+ [10, 3],
151
+ [23, 1],
152
+ [23, 1],
153
+ [23, 1],
154
+ [23, 2],
155
+ [23, 2],
156
+ [25, 1],
157
+ [25, 3],
158
+ [26, 3],
159
+ [28, 1],
160
+ [28, 1],
161
+ [29, 1],
162
+ [29, 2],
163
+ [30, 1],
164
+ [30, 1],
165
+ [30, 1],
166
+ [30, 1],
167
+ [30, 1],
168
+ [18, 1],
169
+ [18, 3],
170
+ [13, 1],
171
+ [13, 1]
172
+ ],
173
+ performAction: /* @__PURE__ */ __name(function(e, f, p, m, h, g, _) {
174
+ var v = g.length - 1;
175
+ switch (h) {
176
+ case 1: return g[v - 1];
177
+ case 2:
178
+ case 3:
179
+ case 4:
180
+ this.$ = [];
181
+ break;
182
+ case 5:
183
+ g[v - 1].push(g[v]), this.$ = g[v - 1];
184
+ break;
185
+ case 6:
186
+ this.$ = [];
187
+ break;
188
+ case 7:
189
+ case 22:
190
+ case 32:
191
+ case 36:
192
+ case 37:
193
+ case 38:
194
+ case 39:
195
+ case 40:
196
+ this.$ = g[v];
197
+ break;
198
+ case 8:
199
+ m.setDiagramTitle(g[v].substr(6)), this.$ = g[v].substr(6);
200
+ break;
201
+ case 9:
202
+ m.addSubsetData([g[v]], void 0, void 0), m.setIndentMode && m.setIndentMode(!0);
203
+ break;
204
+ case 10:
205
+ m.addSubsetData([g[v - 1]], g[v], void 0), m.setIndentMode && m.setIndentMode(!0);
206
+ break;
207
+ case 11:
208
+ m.addSubsetData([g[v - 2]], void 0, parseFloat(g[v])), m.setIndentMode && m.setIndentMode(!0);
209
+ break;
210
+ case 12:
211
+ m.addSubsetData([g[v - 3]], g[v - 2], parseFloat(g[v])), m.setIndentMode && m.setIndentMode(!0);
212
+ break;
213
+ case 13:
214
+ if (g[v].length < 2) throw Error("union requires multiple identifiers");
215
+ m.validateUnionIdentifiers && m.validateUnionIdentifiers(g[v]), m.addSubsetData(g[v], void 0, void 0), m.setIndentMode && m.setIndentMode(!0);
216
+ break;
217
+ case 14:
218
+ if (g[v - 1].length < 2) throw Error("union requires multiple identifiers");
219
+ m.validateUnionIdentifiers && m.validateUnionIdentifiers(g[v - 1]), m.addSubsetData(g[v - 1], g[v], void 0), m.setIndentMode && m.setIndentMode(!0);
220
+ break;
221
+ case 15:
222
+ if (g[v - 2].length < 2) throw Error("union requires multiple identifiers");
223
+ m.validateUnionIdentifiers && m.validateUnionIdentifiers(g[v - 2]), m.addSubsetData(g[v - 2], void 0, parseFloat(g[v])), m.setIndentMode && m.setIndentMode(!0);
224
+ break;
225
+ case 16:
226
+ if (g[v - 3].length < 2) throw Error("union requires multiple identifiers");
227
+ m.validateUnionIdentifiers && m.validateUnionIdentifiers(g[v - 3]), m.addSubsetData(g[v - 3], g[v - 2], parseFloat(g[v])), m.setIndentMode && m.setIndentMode(!0);
228
+ break;
229
+ case 17:
230
+ case 18:
231
+ case 19:
232
+ m.addTextData(g[v - 1], g[v], void 0);
233
+ break;
234
+ case 20:
235
+ case 21:
236
+ m.addTextData(g[v - 2], g[v - 1], g[v]);
237
+ break;
238
+ case 23:
239
+ m.addStyleData(g[v - 1], g[v]);
240
+ break;
241
+ case 24:
242
+ case 25:
243
+ case 26:
244
+ var y = m.getCurrentSets();
245
+ if (!y) throw Error("text requires set");
246
+ m.addTextData(y, g[v], void 0);
247
+ break;
248
+ case 27:
249
+ case 28:
250
+ var y = m.getCurrentSets();
251
+ if (!y) throw Error("text requires set");
252
+ m.addTextData(y, g[v - 1], g[v]);
253
+ break;
254
+ case 29:
255
+ case 41:
256
+ this.$ = [g[v]];
257
+ break;
258
+ case 30:
259
+ case 42:
260
+ this.$ = [...g[v - 2], g[v]];
261
+ break;
262
+ case 31:
263
+ this.$ = [g[v - 2], g[v]];
264
+ break;
265
+ case 33:
266
+ this.$ = g[v].join(" ");
267
+ break;
268
+ case 34:
269
+ this.$ = [g[v]];
270
+ break;
271
+ case 35:
272
+ g[v - 1].push(g[v]), this.$ = g[v - 1];
273
+ break;
274
+ case 43:
275
+ case 44:
276
+ this.$ = g[v];
277
+ break;
278
+ }
279
+ }, "anonymous"),
280
+ table: [
281
+ f(p, [2, 2], {
282
+ 3: 1,
283
+ 4: 2
284
+ }),
285
+ { 1: [3] },
286
+ {
287
+ 5: [1, 3],
288
+ 8: [1, 4]
289
+ },
290
+ f(m, [2, 4], { 6: 5 }),
291
+ f(p, [2, 3]),
292
+ {
293
+ 7: [1, 6],
294
+ 8: [1, 8],
295
+ 9: 7,
296
+ 10: 9,
297
+ 11: [1, 10],
298
+ 12: [1, 11],
299
+ 17: [1, 12],
300
+ 19: [1, 13],
301
+ 22: [1, 14],
302
+ 24: [1, 15]
303
+ },
304
+ { 1: [2, 1] },
305
+ f(m, [2, 5]),
306
+ f(m, [2, 6]),
307
+ f(m, [2, 7]),
308
+ f(m, [2, 8]),
309
+ {
310
+ 13: 16,
311
+ 20: h,
312
+ 21: g
313
+ },
314
+ {
315
+ 13: 20,
316
+ 18: 19,
317
+ 20: h,
318
+ 21: g
319
+ },
320
+ {
321
+ 13: 20,
322
+ 18: 21,
323
+ 20: h,
324
+ 21: g
325
+ },
326
+ {
327
+ 16: [1, 25],
328
+ 20: [1, 23],
329
+ 21: [1, 24],
330
+ 23: 22
331
+ },
332
+ {
333
+ 13: 20,
334
+ 18: 26,
335
+ 20: h,
336
+ 21: g
337
+ },
338
+ f(m, [2, 9], {
339
+ 14: [1, 27],
340
+ 15: [1, 28]
341
+ }),
342
+ f(_, [2, 43]),
343
+ f(_, [2, 44]),
344
+ f(m, [2, 13], {
345
+ 14: [1, 29],
346
+ 15: [1, 30],
347
+ 27: v
348
+ }),
349
+ f(_, [2, 41]),
350
+ {
351
+ 16: [1, 34],
352
+ 20: [1, 32],
353
+ 21: [1, 33],
354
+ 27: v
355
+ },
356
+ f(m, [2, 22]),
357
+ f(m, [2, 24], { 14: [1, 35] }),
358
+ f(m, [2, 25], { 14: [1, 36] }),
359
+ f(m, [2, 26]),
360
+ {
361
+ 20: y,
362
+ 25: 37,
363
+ 26: 38,
364
+ 27: v
365
+ },
366
+ f(m, [2, 10], { 15: [1, 40] }),
367
+ { 16: [1, 41] },
368
+ f(m, [2, 14], { 15: [1, 42] }),
369
+ { 16: [1, 43] },
370
+ {
371
+ 13: 44,
372
+ 20: h,
373
+ 21: g
374
+ },
375
+ f(m, [2, 17], { 14: [1, 45] }),
376
+ f(m, [2, 18], { 14: [1, 46] }),
377
+ f(m, [2, 19]),
378
+ f(m, [2, 27]),
379
+ f(m, [2, 28]),
380
+ f(m, [2, 23], { 27: [1, 47] }),
381
+ f(b, [2, 29]),
382
+ { 15: [1, 48] },
383
+ { 16: [1, 49] },
384
+ f(m, [2, 11]),
385
+ { 16: [1, 50] },
386
+ f(m, [2, 15]),
387
+ f(_, [2, 42]),
388
+ f(m, [2, 20]),
389
+ f(m, [2, 21]),
390
+ {
391
+ 20: y,
392
+ 26: 51
393
+ },
394
+ {
395
+ 16: x,
396
+ 20: S,
397
+ 21: [1, 53],
398
+ 28: 52,
399
+ 29: 54,
400
+ 30: 55,
401
+ 31: C,
402
+ 32: w,
403
+ 33: T
404
+ },
405
+ f(m, [2, 12]),
406
+ f(m, [2, 16]),
407
+ f(b, [2, 30]),
408
+ f(b, [2, 31]),
409
+ f(b, [2, 32]),
410
+ f(b, [2, 33], {
411
+ 30: 61,
412
+ 16: x,
413
+ 20: S,
414
+ 31: C,
415
+ 32: w,
416
+ 33: T
417
+ }),
418
+ f(E, [2, 34]),
419
+ f(E, [2, 36]),
420
+ f(E, [2, 37]),
421
+ f(E, [2, 38]),
422
+ f(E, [2, 39]),
423
+ f(E, [2, 40]),
424
+ f(E, [2, 35])
425
+ ],
426
+ defaultActions: { 6: [2, 1] },
427
+ parseError: /* @__PURE__ */ __name(function(e, f) {
428
+ if (f.recoverable) this.trace(e);
429
+ else {
430
+ var p = Error(e);
431
+ throw p.hash = f, p;
432
+ }
433
+ }, "parseError"),
434
+ parse: /* @__PURE__ */ __name(function(f) {
435
+ var p = this, m = [0], h = [], g = [null], _ = [], v = this.table, y = "", b = 0, x = 0, S = 0, C = 2, w = 1, T = _.slice.call(arguments, 1), E = Object.create(this.lexer), D = { yy: {} };
436
+ for (var O in this.yy) Object.prototype.hasOwnProperty.call(this.yy, O) && (D.yy[O] = this.yy[O]);
437
+ E.setInput(f, D.yy), D.yy.lexer = E, D.yy.parser = this, E.yylloc === void 0 && (E.yylloc = {});
438
+ var k = E.yylloc;
439
+ _.push(k);
440
+ var A = E.options && E.options.ranges;
441
+ typeof D.yy.parseError == "function" ? this.parseError = D.yy.parseError : this.parseError = Object.getPrototypeOf(this).parseError;
442
+ function j(e) {
443
+ m.length -= 2 * e, g.length -= e, _.length -= e;
444
+ }
445
+ __name(j, "popStack");
446
+ function M() {
447
+ var e = h.pop() || E.lex() || w;
448
+ return typeof e != "number" && (e instanceof Array && (h = e, e = h.pop()), e = p.symbols_[e] || e), e;
449
+ }
450
+ __name(M, "lex");
451
+ for (var N, P, F, I, L, R = {}, z, B, V, H;;) {
452
+ if (F = m[m.length - 1], this.defaultActions[F] ? I = this.defaultActions[F] : (N ??= M(), I = v[F] && v[F][N]), I === void 0 || !I.length || !I[0]) {
453
+ var U = "";
454
+ for (z in H = [], v[F]) this.terminals_[z] && z > C && H.push("'" + this.terminals_[z] + "'");
455
+ U = E.showPosition ? "Parse error on line " + (b + 1) + ":\n" + E.showPosition() + "\nExpecting " + H.join(", ") + ", got '" + (this.terminals_[N] || N) + "'" : "Parse error on line " + (b + 1) + ": Unexpected " + (N == w ? "end of input" : "'" + (this.terminals_[N] || N) + "'"), this.parseError(U, {
456
+ text: E.match,
457
+ token: this.terminals_[N] || N,
458
+ line: E.yylineno,
459
+ loc: k,
460
+ expected: H
461
+ });
462
+ }
463
+ if (I[0] instanceof Array && I.length > 1) throw Error("Parse Error: multiple actions possible at state: " + F + ", token: " + N);
464
+ switch (I[0]) {
465
+ case 1:
466
+ m.push(N), g.push(E.yytext), _.push(E.yylloc), m.push(I[1]), N = null, P ? (N = P, P = null) : (x = E.yyleng, y = E.yytext, b = E.yylineno, k = E.yylloc, S > 0 && S--);
467
+ break;
468
+ case 2:
469
+ if (B = this.productions_[I[1]][1], R.$ = g[g.length - B], R._$ = {
470
+ first_line: _[_.length - (B || 1)].first_line,
471
+ last_line: _[_.length - 1].last_line,
472
+ first_column: _[_.length - (B || 1)].first_column,
473
+ last_column: _[_.length - 1].last_column
474
+ }, A && (R._$.range = [_[_.length - (B || 1)].range[0], _[_.length - 1].range[1]]), L = this.performAction.apply(R, [
475
+ y,
476
+ x,
477
+ b,
478
+ D.yy,
479
+ I[1],
480
+ g,
481
+ _
482
+ ].concat(T)), L !== void 0) return L;
483
+ B && (m = m.slice(0, -1 * B * 2), g = g.slice(0, -1 * B), _ = _.slice(0, -1 * B)), m.push(this.productions_[I[1]][0]), g.push(R.$), _.push(R._$), V = v[m[m.length - 2]][m[m.length - 1]], m.push(V);
484
+ break;
485
+ case 3: return !0;
486
+ }
487
+ }
488
+ return !0;
489
+ }, "parse")
490
+ };
491
+ D.lexer = /* @__PURE__ */ (function() {
492
+ return {
493
+ EOF: 1,
494
+ parseError: /* @__PURE__ */ __name(function(e, f) {
495
+ if (this.yy.parser) this.yy.parser.parseError(e, f);
496
+ else throw Error(e);
497
+ }, "parseError"),
498
+ setInput: /* @__PURE__ */ __name(function(e, f) {
499
+ return this.yy = f || this.yy || {}, this._input = e, this._more = this._backtrack = this.done = !1, this.yylineno = this.yyleng = 0, this.yytext = this.matched = this.match = "", this.conditionStack = ["INITIAL"], this.yylloc = {
500
+ first_line: 1,
501
+ first_column: 0,
502
+ last_line: 1,
503
+ last_column: 0
504
+ }, this.options.ranges && (this.yylloc.range = [0, 0]), this.offset = 0, this;
505
+ }, "setInput"),
506
+ input: /* @__PURE__ */ __name(function() {
507
+ var e = this._input[0];
508
+ return this.yytext += e, this.yyleng++, this.offset++, this.match += e, this.matched += e, e.match(/(?:\r\n?|\n).*/g) ? (this.yylineno++, this.yylloc.last_line++) : this.yylloc.last_column++, this.options.ranges && this.yylloc.range[1]++, this._input = this._input.slice(1), e;
509
+ }, "input"),
510
+ unput: /* @__PURE__ */ __name(function(e) {
511
+ var f = e.length, p = e.split(/(?:\r\n?|\n)/g);
512
+ this._input = e + this._input, this.yytext = this.yytext.substr(0, this.yytext.length - f), this.offset -= f;
513
+ var m = this.match.split(/(?:\r\n?|\n)/g);
514
+ this.match = this.match.substr(0, this.match.length - 1), this.matched = this.matched.substr(0, this.matched.length - 1), p.length - 1 && (this.yylineno -= p.length - 1);
515
+ var h = this.yylloc.range;
516
+ return this.yylloc = {
517
+ first_line: this.yylloc.first_line,
518
+ last_line: this.yylineno + 1,
519
+ first_column: this.yylloc.first_column,
520
+ last_column: p ? (p.length === m.length ? this.yylloc.first_column : 0) + m[m.length - p.length].length - p[0].length : this.yylloc.first_column - f
521
+ }, this.options.ranges && (this.yylloc.range = [h[0], h[0] + this.yyleng - f]), this.yyleng = this.yytext.length, this;
522
+ }, "unput"),
523
+ more: /* @__PURE__ */ __name(function() {
524
+ return this._more = !0, this;
525
+ }, "more"),
526
+ reject: /* @__PURE__ */ __name(function() {
527
+ if (this.options.backtrack_lexer) this._backtrack = !0;
528
+ else return this.parseError("Lexical error on line " + (this.yylineno + 1) + ". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n" + this.showPosition(), {
529
+ text: "",
530
+ token: null,
531
+ line: this.yylineno
532
+ });
533
+ return this;
534
+ }, "reject"),
535
+ less: /* @__PURE__ */ __name(function(e) {
536
+ this.unput(this.match.slice(e));
537
+ }, "less"),
538
+ pastInput: /* @__PURE__ */ __name(function() {
539
+ var e = this.matched.substr(0, this.matched.length - this.match.length);
540
+ return (e.length > 20 ? "..." : "") + e.substr(-20).replace(/\n/g, "");
541
+ }, "pastInput"),
542
+ upcomingInput: /* @__PURE__ */ __name(function() {
543
+ var e = this.match;
544
+ return e.length < 20 && (e += this._input.substr(0, 20 - e.length)), (e.substr(0, 20) + (e.length > 20 ? "..." : "")).replace(/\n/g, "");
545
+ }, "upcomingInput"),
546
+ showPosition: /* @__PURE__ */ __name(function() {
547
+ var e = this.pastInput(), f = Array(e.length + 1).join("-");
548
+ return e + this.upcomingInput() + "\n" + f + "^";
549
+ }, "showPosition"),
550
+ test_match: /* @__PURE__ */ __name(function(e, f) {
551
+ var p, m, h;
552
+ if (this.options.backtrack_lexer && (h = {
553
+ yylineno: this.yylineno,
554
+ yylloc: {
555
+ first_line: this.yylloc.first_line,
556
+ last_line: this.last_line,
557
+ first_column: this.yylloc.first_column,
558
+ last_column: this.yylloc.last_column
559
+ },
560
+ yytext: this.yytext,
561
+ match: this.match,
562
+ matches: this.matches,
563
+ matched: this.matched,
564
+ yyleng: this.yyleng,
565
+ offset: this.offset,
566
+ _more: this._more,
567
+ _input: this._input,
568
+ yy: this.yy,
569
+ conditionStack: this.conditionStack.slice(0),
570
+ done: this.done
571
+ }, this.options.ranges && (h.yylloc.range = this.yylloc.range.slice(0))), m = e[0].match(/(?:\r\n?|\n).*/g), m && (this.yylineno += m.length), this.yylloc = {
572
+ first_line: this.yylloc.last_line,
573
+ last_line: this.yylineno + 1,
574
+ first_column: this.yylloc.last_column,
575
+ last_column: m ? m[m.length - 1].length - m[m.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + e[0].length
576
+ }, this.yytext += e[0], this.match += e[0], this.matches = e, this.yyleng = this.yytext.length, this.options.ranges && (this.yylloc.range = [this.offset, this.offset += this.yyleng]), this._more = !1, this._backtrack = !1, this._input = this._input.slice(e[0].length), this.matched += e[0], p = this.performAction.call(this, this.yy, this, f, this.conditionStack[this.conditionStack.length - 1]), this.done && this._input && (this.done = !1), p) return p;
577
+ if (this._backtrack) {
578
+ for (var g in h) this[g] = h[g];
579
+ return !1;
580
+ }
581
+ return !1;
582
+ }, "test_match"),
583
+ next: /* @__PURE__ */ __name(function() {
584
+ if (this.done) return this.EOF;
585
+ this._input || (this.done = !0);
586
+ var e, f, p, m;
587
+ this._more || (this.yytext = "", this.match = "");
588
+ for (var h = this._currentRules(), g = 0; g < h.length; g++) if (p = this._input.match(this.rules[h[g]]), p && (!f || p[0].length > f[0].length)) {
589
+ if (f = p, m = g, this.options.backtrack_lexer) {
590
+ if (e = this.test_match(p, h[g]), e !== !1) return e;
591
+ if (this._backtrack) {
592
+ f = !1;
593
+ continue;
594
+ } else return !1;
595
+ } else if (!this.options.flex) break;
596
+ }
597
+ return f ? (e = this.test_match(f, h[m]), e === !1 ? !1 : e) : this._input === "" ? this.EOF : this.parseError("Lexical error on line " + (this.yylineno + 1) + ". Unrecognized text.\n" + this.showPosition(), {
598
+ text: "",
599
+ token: null,
600
+ line: this.yylineno
601
+ });
602
+ }, "next"),
603
+ lex: /* @__PURE__ */ __name(function() {
604
+ return this.next() || this.lex();
605
+ }, "lex"),
606
+ begin: /* @__PURE__ */ __name(function(e) {
607
+ this.conditionStack.push(e);
608
+ }, "begin"),
609
+ popState: /* @__PURE__ */ __name(function() {
610
+ return this.conditionStack.length - 1 > 0 ? this.conditionStack.pop() : this.conditionStack[0];
611
+ }, "popState"),
612
+ _currentRules: /* @__PURE__ */ __name(function() {
613
+ return this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1] ? this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules : this.conditions.INITIAL.rules;
614
+ }, "_currentRules"),
615
+ topState: /* @__PURE__ */ __name(function(e) {
616
+ return e = this.conditionStack.length - 1 - Math.abs(e || 0), e >= 0 ? this.conditionStack[e] : "INITIAL";
617
+ }, "topState"),
618
+ pushState: /* @__PURE__ */ __name(function(e) {
619
+ this.begin(e);
620
+ }, "pushState"),
621
+ stateStackSize: /* @__PURE__ */ __name(function() {
622
+ return this.conditionStack.length;
623
+ }, "stateStackSize"),
624
+ options: { "case-insensitive": !0 },
625
+ performAction: /* @__PURE__ */ __name(function(e, f, p, m) {
626
+ switch (p) {
627
+ case 0: break;
628
+ case 1: break;
629
+ case 2: break;
630
+ case 3:
631
+ if (e.getIndentMode && e.getIndentMode()) return e.consumeIndentText = !0, this.begin("INITIAL"), 22;
632
+ break;
633
+ case 4: break;
634
+ case 5:
635
+ e.setIndentMode && e.setIndentMode(!1), this.begin("INITIAL"), this.unput(f.yytext);
636
+ break;
637
+ case 6: return this.begin("bol"), 8;
638
+ case 7: break;
639
+ case 8: break;
640
+ case 9: return 7;
641
+ case 10: return 11;
642
+ case 11: return 5;
643
+ case 12: return 12;
644
+ case 13: return 17;
645
+ case 14:
646
+ if (e.consumeIndentText) e.consumeIndentText = !1;
647
+ else return 19;
648
+ break;
649
+ case 15: return 24;
650
+ case 16: return f.yytext = f.yytext.slice(2, -2), 14;
651
+ case 17: return f.yytext = f.yytext.slice(1, -1).trim(), 14;
652
+ case 18: return 16;
653
+ case 19: return 31;
654
+ case 20: return 33;
655
+ case 21: return 32;
656
+ case 22: return 20;
657
+ case 23: return 21;
658
+ case 24: return 27;
659
+ case 25: return 15;
660
+ }
661
+ }, "anonymous"),
662
+ rules: [
663
+ /^(?:%%(?!\{)[^\n]*)/i,
664
+ /^(?:[^\}]%%[^\n]*)/i,
665
+ /^(?:[ \t]+(?=[\n\r]))/i,
666
+ /^(?:[ \t]+(?=text\b))/i,
667
+ /^(?:[ \t]+)/i,
668
+ /^(?:[^ \t\n\r])/i,
669
+ /^(?:[\n\r]+)/i,
670
+ /^(?:%%[^\n]*)/i,
671
+ /^(?:[ \t]+)/i,
672
+ /^(?:$)/i,
673
+ /^(?:title\s[^#\n;]+)/i,
674
+ /^(?:venn-beta\b)/i,
675
+ /^(?:set\b)/i,
676
+ /^(?:union\b)/i,
677
+ /^(?:text\b)/i,
678
+ /^(?:style\b)/i,
679
+ /^(?:\["[^\"]*"\])/i,
680
+ /^(?:\[[^\]\"]+\])/i,
681
+ /^(?:[+-]?(\d+(\.\d+)?|\.\d+))/i,
682
+ /^(?:#[0-9a-fA-F]{3,8})/i,
683
+ /^(?:rgba\(\s*[0-9.]+\s*[,]\s*[0-9.]+\s*[,]\s*[0-9.]+\s*[,]\s*[0-9.]+\s*\))/i,
684
+ /^(?:rgb\(\s*[0-9.]+\s*[,]\s*[0-9.]+\s*[,]\s*[0-9.]+\s*\))/i,
685
+ /^(?:[A-Za-z_][A-Za-z0-9\-_]*)/i,
686
+ /^(?:"[^\"]*")/i,
687
+ /^(?:,)/i,
688
+ /^(?::)/i
689
+ ],
690
+ conditions: {
691
+ bol: {
692
+ rules: [
693
+ 0,
694
+ 1,
695
+ 2,
696
+ 3,
697
+ 4,
698
+ 5,
699
+ 6,
700
+ 7,
701
+ 8,
702
+ 9,
703
+ 10,
704
+ 11,
705
+ 12,
706
+ 13,
707
+ 14,
708
+ 15,
709
+ 16,
710
+ 17,
711
+ 18,
712
+ 19,
713
+ 20,
714
+ 21,
715
+ 22,
716
+ 23,
717
+ 24,
718
+ 25
719
+ ],
720
+ inclusive: !0
721
+ },
722
+ INITIAL: {
723
+ rules: [
724
+ 0,
725
+ 1,
726
+ 6,
727
+ 7,
728
+ 8,
729
+ 9,
730
+ 10,
731
+ 11,
732
+ 12,
733
+ 13,
734
+ 14,
735
+ 15,
736
+ 16,
737
+ 17,
738
+ 18,
739
+ 19,
740
+ 20,
741
+ 21,
742
+ 22,
743
+ 23,
744
+ 24,
745
+ 25
746
+ ],
747
+ inclusive: !0
748
+ }
749
+ }
750
+ };
751
+ })();
752
+ function O() {
753
+ this.yy = {};
754
+ }
755
+ return __name(O, "Parser"), O.prototype = D, D.Parser = O, new O();
756
+ })();
757
+ parser.parser = parser;
758
+ var venn_default = parser, subsets = [], textNodes = [], styleEntries = [], knownSets = /* @__PURE__ */ new Set(), currentSets, indentMode = !1, addSubsetData = /* @__PURE__ */ __name((e, f, p) => {
759
+ let m = normalizeIdentifierList(e).sort(), h = p ?? 10 / e.length ** 2;
760
+ currentSets = m, m.length === 1 && knownSets.add(m[0]), subsets.push({
761
+ sets: m,
762
+ size: h,
763
+ label: f ? normalizeText(f) : void 0
764
+ });
765
+ }, "addSubsetData"), getSubsetData = /* @__PURE__ */ __name(() => subsets, "getSubsetData"), normalizeText = /* @__PURE__ */ __name((e) => {
766
+ let f = e.trim();
767
+ return f.length >= 2 && f.startsWith("\"") && f.endsWith("\"") ? f.slice(1, -1) : f;
768
+ }, "normalizeText"), normalizeStyleValue = /* @__PURE__ */ __name((e) => e && normalizeText(e), "normalizeStyleValue"), addTextData = /* @__PURE__ */ __name((e, f, p) => {
769
+ let m = normalizeText(f);
770
+ textNodes.push({
771
+ sets: normalizeIdentifierList(e).sort(),
772
+ id: m,
773
+ label: p ? normalizeText(p) : void 0
774
+ });
775
+ }, "addTextData"), addStyleData = /* @__PURE__ */ __name((e, f) => {
776
+ let p = normalizeIdentifierList(e).sort(), m = {};
777
+ for (let [e, p] of f) m[e] = normalizeStyleValue(p) ?? p;
778
+ styleEntries.push({
779
+ targets: p,
780
+ styles: m
781
+ });
782
+ }, "addStyleData"), getStyleData = /* @__PURE__ */ __name(() => styleEntries, "getStyleData"), normalizeIdentifierList = /* @__PURE__ */ __name((e) => e.map((e) => normalizeText(e)), "normalizeIdentifierList"), validateUnionIdentifiers = /* @__PURE__ */ __name((e) => {
783
+ let f = normalizeIdentifierList(e).filter((e) => !knownSets.has(e));
784
+ if (f.length > 0) throw Error(`unknown set identifier: ${f.join(", ")}`);
785
+ }, "validateUnionIdentifiers"), getTextData = /* @__PURE__ */ __name(() => textNodes, "getTextData"), getCurrentSets = /* @__PURE__ */ __name(() => currentSets, "getCurrentSets"), getIndentMode = /* @__PURE__ */ __name(() => indentMode, "getIndentMode"), setIndentMode = /* @__PURE__ */ __name((e) => {
786
+ indentMode = e;
787
+ }, "setIndentMode"), DEFAULT_VENN_CONFIG = defaultConfig_default.venn;
788
+ function getConfig2() {
789
+ return cleanAndMerge(DEFAULT_VENN_CONFIG, getConfig().venn);
790
+ }
791
+ __name(getConfig2, "getConfig");
792
+ var db = {
793
+ getConfig: getConfig2,
794
+ clear: /* @__PURE__ */ __name(() => {
795
+ clear(), subsets.length = 0, textNodes.length = 0, styleEntries.length = 0, knownSets.clear(), currentSets = void 0, indentMode = !1;
796
+ }, "customClear"),
797
+ setAccTitle,
798
+ getAccTitle,
799
+ setDiagramTitle,
800
+ getDiagramTitle,
801
+ getAccDescription,
802
+ setAccDescription,
803
+ addSubsetData,
804
+ getSubsetData,
805
+ addTextData,
806
+ addStyleData,
807
+ validateUnionIdentifiers,
808
+ getTextData,
809
+ getStyleData,
810
+ getCurrentSets,
811
+ getIndentMode,
812
+ setIndentMode
813
+ }, styles_default = /* @__PURE__ */ __name((e) => `
814
+ .venn-title {
815
+ font-size: 32px;
816
+ fill: ${e.vennTitleTextColor};
817
+ font-family: ${e.fontFamily};
818
+ }
819
+
820
+ .venn-circle text {
821
+ font-size: 48px;
822
+ font-family: ${e.fontFamily};
823
+ }
824
+
825
+ .venn-intersection text {
826
+ font-size: 48px;
827
+ fill: ${e.vennSetTextColor};
828
+ font-family: ${e.fontFamily};
829
+ }
830
+
831
+ .venn-text-node {
832
+ font-family: ${e.fontFamily};
833
+ color: ${e.vennSetTextColor};
834
+ }
835
+ `, "getStyles");
836
+ function buildStyleByKey(e) {
837
+ let f = /* @__PURE__ */ new Map();
838
+ for (let p of e) {
839
+ let e = p.targets.join("|"), m = f.get(e);
840
+ m ? Object.assign(m, p.styles) : f.set(e, { ...p.styles });
841
+ }
842
+ return f;
843
+ }
844
+ __name(buildStyleByKey, "buildStyleByKey");
845
+ var draw = /* @__PURE__ */ __name((e, g, v, y) => {
846
+ let b = y.db, S = b.getConfig?.(), { themeVariables: C, look: w, handDrawnSeed: T } = getConfig(), O = w === "handDrawn", M = [
847
+ C.venn1,
848
+ C.venn2,
849
+ C.venn3,
850
+ C.venn4,
851
+ C.venn5,
852
+ C.venn6,
853
+ C.venn7,
854
+ C.venn8
855
+ ].filter(Boolean), N = b.getDiagramTitle?.(), P = b.getSubsetData(), F = b.getTextData(), I = buildStyleByKey(b.getStyleData()), L = S?.width ?? 800, R = S?.height ?? 450, z = L / 1600, B = N ? 48 * z : 0, V = C.primaryTextColor ?? C.textColor, H = selectSvgElement(g);
856
+ H.attr("viewBox", `0 0 ${L} ${R}`), N && H.append("text").text(N).attr("class", "venn-title").attr("font-size", `${32 * z}px`).attr("text-anchor", "middle").attr("dominant-baseline", "middle").attr("x", "50%").attr("y", 32 * z).style("fill", C.vennTitleTextColor || C.titleColor);
857
+ let U = select_default(document.createElement("div")), W = VennDiagram().width(L).height(R - B);
858
+ U.datum(P).call(W);
859
+ let G = O ? at.svg(U.select("svg").node()) : void 0, K = layout(P, {
860
+ width: L,
861
+ height: R - B,
862
+ padding: S?.padding ?? 15
863
+ }), q = /* @__PURE__ */ new Map();
864
+ for (let e of K) {
865
+ let f = stableSetsKey([...e.data.sets].sort());
866
+ q.set(f, e);
867
+ }
868
+ F.length > 0 && renderTextNodes(S, q, U, F, z, I);
869
+ let J = is_dark_default(C.background || "#f4f4f4");
870
+ U.selectAll(".venn-circle").each(function(e, f) {
871
+ let g = select_default(this), _ = stableSetsKey([...e.sets].sort()), v = I.get(_), y = v?.fill || M[f % M.length] || C.primaryColor;
872
+ g.classed(`venn-set-${f % 8}`, !0);
873
+ let b = v?.["fill-opacity"] ?? .1, x = v?.stroke || y, S = v?.["stroke-width"] || `${5 * z}`;
874
+ if (O && G) {
875
+ let e = q.get(_);
876
+ if (e && e.circles.length > 0) {
877
+ let p = e.circles[0], m = G.circle(p.x, p.y, p.radius * 2, {
878
+ roughness: .7,
879
+ seed: T,
880
+ fill: transparentize_default(y, .7),
881
+ fillStyle: "hachure",
882
+ fillWeight: 2,
883
+ hachureGap: 8,
884
+ hachureAngle: -41 + f * 60,
885
+ stroke: x,
886
+ strokeWidth: parseFloat(String(S))
887
+ });
888
+ g.select("path").remove(), g.node()?.insertBefore(m, g.select("text").node());
889
+ }
890
+ } else g.select("path").style("fill", y).style("fill-opacity", b).style("stroke", x).style("stroke-width", S).style("stroke-opacity", .95);
891
+ let w = v?.color || (J ? lighten_default(y, 30) : darken_default(y, 30));
892
+ g.select("text").style("font-size", `${48 * z}px`).style("fill", w);
893
+ }), O && G ? U.selectAll(".venn-intersection").each(function(e) {
894
+ let f = select_default(this), p = stableSetsKey([...e.sets].sort()), m = I.get(p), g = m?.fill;
895
+ if (g) {
896
+ let e = f.select("path"), p = e.attr("d");
897
+ if (p) {
898
+ let f = G.path(p, {
899
+ roughness: .7,
900
+ seed: T,
901
+ fill: transparentize_default(g, .3),
902
+ fillStyle: "cross-hatch",
903
+ fillWeight: 2,
904
+ hachureGap: 6,
905
+ hachureAngle: 60,
906
+ stroke: "none"
907
+ }), m = e.node();
908
+ m?.parentNode?.insertBefore(f, m), e.remove();
909
+ }
910
+ } else f.select("path").style("fill-opacity", 0);
911
+ f.select("text").style("font-size", `${48 * z}px`).style("fill", m?.color ?? C.vennSetTextColor ?? V);
912
+ }) : (U.selectAll(".venn-intersection text").style("font-size", `${48 * z}px`).style("fill", (e) => {
913
+ let f = stableSetsKey([...e.sets].sort());
914
+ return I.get(f)?.color ?? C.vennSetTextColor ?? V;
915
+ }), U.selectAll(".venn-intersection path").style("fill-opacity", (e) => {
916
+ let f = stableSetsKey([...e.sets].sort());
917
+ return I.get(f)?.fill ? 1 : 0;
918
+ }).style("fill", (e) => {
919
+ let f = stableSetsKey([...e.sets].sort());
920
+ return I.get(f)?.fill ?? "transparent";
921
+ }));
922
+ let Y = H.append("g").attr("transform", `translate(0, ${B})`), X = U.select("svg").node();
923
+ if (X && "childNodes" in X) for (let e of [...X.childNodes]) Y.node()?.appendChild(e);
924
+ configureSvgSize(H, R, L, S?.useMaxWidth ?? !0);
925
+ }, "draw");
926
+ function stableSetsKey(e) {
927
+ return e.join("|");
928
+ }
929
+ __name(stableSetsKey, "stableSetsKey");
930
+ function renderTextNodes(e, f, p, m, h, g) {
931
+ let _ = e?.useDebugLayout ?? !1, v = p.select("svg").append("g").attr("class", "venn-text-nodes"), y = /* @__PURE__ */ new Map();
932
+ for (let e of m) {
933
+ let f = stableSetsKey(e.sets), p = y.get(f);
934
+ p ? p.push(e) : y.set(f, [e]);
935
+ }
936
+ for (let [e, p] of y.entries()) {
937
+ let m = f.get(e);
938
+ if (!m?.text) continue;
939
+ let y = m.text.x, b = m.text.y, x = Math.min(...m.circles.map((e) => e.radius)), S = Math.min(...m.circles.map((e) => e.radius - Math.hypot(y - e.x, b - e.y))), C = Number.isFinite(S) ? Math.max(0, S) : 0;
940
+ C === 0 && Number.isFinite(x) && (C = x * .6);
941
+ let w = v.append("g").attr("class", "venn-text-area").attr("font-size", `${40 * h}px`);
942
+ _ && w.append("circle").attr("class", "venn-text-debug-circle").attr("cx", y).attr("cy", b).attr("r", C).attr("fill", "none").attr("stroke", "purple").attr("stroke-width", 1.5 * h).attr("stroke-dasharray", `${6 * h} ${4 * h}`);
943
+ let T = Math.max(80 * h, C * 2 * .95), E = Math.max(60 * h, C * 2 * .95), D = (m.data.label && m.data.label.length > 0 ? Math.min(32 * h, C * .25) : 0) + (p.length <= 2 ? 30 * h : 0), O = y - T / 2, k = b - E / 2 + D, A = Math.max(1, Math.ceil(Math.sqrt(p.length))), j = Math.max(1, Math.ceil(p.length / A)), M = T / A, N = E / j;
944
+ for (let [e, f] of p.entries()) {
945
+ let p = e % A, m = Math.floor(e / A), v = O + M * (p + .5), y = k + N * (m + .5);
946
+ _ && w.append("rect").attr("class", "venn-text-debug-cell").attr("x", O + M * p).attr("y", k + N * m).attr("width", M).attr("height", N).attr("fill", "none").attr("stroke", "teal").attr("stroke-width", 1 * h).attr("stroke-dasharray", `${4 * h} ${3 * h}`);
947
+ let b = M * .9, x = N * .9, S = w.append("foreignObject").attr("class", "venn-text-node-fo").attr("width", b).attr("height", x).attr("x", v - b / 2).attr("y", y - x / 2).attr("overflow", "visible"), C = g.get(f.id)?.color, T = S.append("xhtml:span").attr("class", "venn-text-node").style("display", "flex").style("width", "100%").style("height", "100%").style("white-space", "normal").style("align-items", "center").style("justify-content", "center").style("text-align", "center").style("overflow-wrap", "normal").style("word-break", "normal").text(f.label ?? f.id);
948
+ C && T.style("color", C);
949
+ }
950
+ }
951
+ }
952
+ __name(renderTextNodes, "renderTextNodes");
953
+ var diagram = {
954
+ parser: venn_default,
955
+ db,
956
+ renderer: { draw },
957
+ styles: styles_default
958
+ };
959
+ export { diagram };