gitnexus 1.6.4-rc.2 → 1.6.4-rc.21

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 (243) hide show
  1. package/README.md +35 -0
  2. package/dist/_shared/index.d.ts +1 -1
  3. package/dist/_shared/index.d.ts.map +1 -1
  4. package/dist/_shared/index.js +1 -1
  5. package/dist/_shared/index.js.map +1 -1
  6. package/dist/_shared/scope-resolution/finalize-algorithm.d.ts +22 -14
  7. package/dist/_shared/scope-resolution/finalize-algorithm.d.ts.map +1 -1
  8. package/dist/_shared/scope-resolution/finalize-algorithm.js +298 -37
  9. package/dist/_shared/scope-resolution/finalize-algorithm.js.map +1 -1
  10. package/dist/_shared/scope-resolution/scope-tree.d.ts +23 -1
  11. package/dist/_shared/scope-resolution/scope-tree.d.ts.map +1 -1
  12. package/dist/_shared/scope-resolution/scope-tree.js +36 -2
  13. package/dist/_shared/scope-resolution/scope-tree.js.map +1 -1
  14. package/dist/_shared/scope-resolution/types.d.ts +47 -3
  15. package/dist/_shared/scope-resolution/types.d.ts.map +1 -1
  16. package/dist/_shared/scope-resolution/types.js +10 -2
  17. package/dist/_shared/scope-resolution/types.js.map +1 -1
  18. package/dist/cli/analyze.d.ts +6 -0
  19. package/dist/cli/analyze.js +35 -0
  20. package/dist/cli/doctor.d.ts +1 -0
  21. package/dist/cli/doctor.js +31 -0
  22. package/dist/cli/index.js +13 -0
  23. package/dist/cli/setup.js +2 -2
  24. package/dist/core/embeddings/config.d.ts +2 -0
  25. package/dist/core/embeddings/config.js +36 -0
  26. package/dist/core/embeddings/embedder.js +11 -6
  27. package/dist/core/embeddings/embedding-pipeline.d.ts +7 -1
  28. package/dist/core/embeddings/embedding-pipeline.js +93 -29
  29. package/dist/core/embeddings/exact-search.d.ts +15 -0
  30. package/dist/core/embeddings/exact-search.js +27 -0
  31. package/dist/core/embeddings/types.d.ts +4 -0
  32. package/dist/core/embeddings/types.js +2 -0
  33. package/dist/core/group/config-parser.js +2 -0
  34. package/dist/core/group/matching.d.ts +3 -3
  35. package/dist/core/group/matching.js +46 -6
  36. package/dist/core/group/storage.js +2 -0
  37. package/dist/core/group/sync.js +1 -1
  38. package/dist/core/group/types.d.ts +18 -0
  39. package/dist/core/ingestion/call-processor.d.ts +3 -3
  40. package/dist/core/ingestion/call-processor.js +58 -65
  41. package/dist/core/ingestion/constants.d.ts +4 -3
  42. package/dist/core/ingestion/constants.js +8 -3
  43. package/dist/core/ingestion/finalize-orchestrator.js +6 -3
  44. package/dist/core/ingestion/heritage-processor.js +2 -2
  45. package/dist/core/ingestion/import-processor.js +1 -1
  46. package/dist/core/ingestion/language-provider.d.ts +8 -0
  47. package/dist/core/ingestion/languages/csharp/captures.js +4 -1
  48. package/dist/core/ingestion/languages/csharp/namespace-siblings.d.ts +14 -13
  49. package/dist/core/ingestion/languages/csharp/namespace-siblings.js +62 -50
  50. package/dist/core/ingestion/languages/python/captures.js +9 -1
  51. package/dist/core/ingestion/languages/python/index.d.ts +1 -1
  52. package/dist/core/ingestion/languages/python/index.js +1 -1
  53. package/dist/core/ingestion/languages/python/simple-hooks.d.ts +3 -1
  54. package/dist/core/ingestion/languages/python/simple-hooks.js +8 -0
  55. package/dist/core/ingestion/languages/python.js +28 -1
  56. package/dist/core/ingestion/languages/swift.js +14 -0
  57. package/dist/core/ingestion/languages/typescript/arity-metadata.d.ts +59 -0
  58. package/dist/core/ingestion/languages/typescript/arity-metadata.js +103 -0
  59. package/dist/core/ingestion/languages/typescript/arity.d.ts +37 -0
  60. package/dist/core/ingestion/languages/typescript/arity.js +54 -0
  61. package/dist/core/ingestion/languages/typescript/cache-stats.d.ts +17 -0
  62. package/dist/core/ingestion/languages/typescript/cache-stats.js +28 -0
  63. package/dist/core/ingestion/languages/typescript/captures.d.ts +28 -0
  64. package/dist/core/ingestion/languages/typescript/captures.js +451 -0
  65. package/dist/core/ingestion/languages/typescript/import-decomposer.d.ts +49 -0
  66. package/dist/core/ingestion/languages/typescript/import-decomposer.js +371 -0
  67. package/dist/core/ingestion/languages/typescript/import-target.d.ts +50 -0
  68. package/dist/core/ingestion/languages/typescript/import-target.js +61 -0
  69. package/dist/core/ingestion/languages/typescript/index.d.ts +94 -0
  70. package/dist/core/ingestion/languages/typescript/index.js +94 -0
  71. package/dist/core/ingestion/languages/typescript/interpret.d.ts +35 -0
  72. package/dist/core/ingestion/languages/typescript/interpret.js +317 -0
  73. package/dist/core/ingestion/languages/typescript/merge-bindings.d.ts +62 -0
  74. package/dist/core/ingestion/languages/typescript/merge-bindings.js +158 -0
  75. package/dist/core/ingestion/languages/typescript/query.d.ts +77 -0
  76. package/dist/core/ingestion/languages/typescript/query.js +778 -0
  77. package/dist/core/ingestion/languages/typescript/receiver-binding.d.ts +59 -0
  78. package/dist/core/ingestion/languages/typescript/receiver-binding.js +171 -0
  79. package/dist/core/ingestion/languages/typescript/scope-resolver.d.ts +16 -0
  80. package/dist/core/ingestion/languages/typescript/scope-resolver.js +113 -0
  81. package/dist/core/ingestion/languages/typescript/simple-hooks.d.ts +71 -0
  82. package/dist/core/ingestion/languages/typescript/simple-hooks.js +131 -0
  83. package/dist/core/ingestion/languages/typescript.js +19 -0
  84. package/dist/core/ingestion/method-extractors/configs/swift.js +3 -4
  85. package/dist/core/ingestion/model/scope-resolution-indexes.d.ts +14 -1
  86. package/dist/core/ingestion/parsing-processor.js +20 -9
  87. package/dist/core/ingestion/pipeline-phases/processes.js +9 -4
  88. package/dist/core/ingestion/pipeline-phases/tools.d.ts +1 -0
  89. package/dist/core/ingestion/pipeline-phases/tools.js +10 -4
  90. package/dist/core/ingestion/registry-primary-flag.d.ts +3 -1
  91. package/dist/core/ingestion/registry-primary-flag.js +4 -1
  92. package/dist/core/ingestion/scope-extractor-bridge.d.ts +5 -2
  93. package/dist/core/ingestion/scope-extractor-bridge.js +7 -2
  94. package/dist/core/ingestion/scope-extractor.js +19 -18
  95. package/dist/core/ingestion/scope-resolution/contract/scope-resolver.d.ts +73 -11
  96. package/dist/core/ingestion/scope-resolution/contract/scope-resolver.js +48 -10
  97. package/dist/core/ingestion/scope-resolution/passes/compound-receiver.js +283 -14
  98. package/dist/core/ingestion/scope-resolution/passes/imported-return-types.d.ts +23 -2
  99. package/dist/core/ingestion/scope-resolution/passes/imported-return-types.js +109 -37
  100. package/dist/core/ingestion/scope-resolution/passes/mro.js +3 -1
  101. package/dist/core/ingestion/scope-resolution/passes/receiver-bound-calls.js +13 -5
  102. package/dist/core/ingestion/scope-resolution/pipeline/phase.js +11 -2
  103. package/dist/core/ingestion/scope-resolution/pipeline/registry.js +2 -0
  104. package/dist/core/ingestion/scope-resolution/pipeline/run.d.ts +8 -0
  105. package/dist/core/ingestion/scope-resolution/pipeline/run.js +21 -5
  106. package/dist/core/ingestion/scope-resolution/pipeline/validate-bindings-immutability.d.ts +39 -0
  107. package/dist/core/ingestion/scope-resolution/pipeline/validate-bindings-immutability.js +65 -0
  108. package/dist/core/ingestion/scope-resolution/scope/walkers.d.ts +54 -11
  109. package/dist/core/ingestion/scope-resolution/scope/walkers.js +105 -30
  110. package/dist/core/ingestion/type-extractors/swift.js +7 -4
  111. package/dist/core/ingestion/utils/ast-helpers.d.ts +2 -0
  112. package/dist/core/ingestion/utils/ast-helpers.js +12 -0
  113. package/dist/core/ingestion/utils/env.d.ts +10 -0
  114. package/dist/core/ingestion/utils/env.js +14 -0
  115. package/dist/core/ingestion/workers/parse-worker.d.ts +1 -0
  116. package/dist/core/ingestion/workers/parse-worker.js +15 -9
  117. package/dist/core/ingestion/workers/worker-pool.d.ts +11 -4
  118. package/dist/core/ingestion/workers/worker-pool.js +244 -48
  119. package/dist/core/lbug/extension-loader.d.ts +86 -0
  120. package/dist/core/lbug/extension-loader.js +184 -0
  121. package/dist/core/lbug/lbug-adapter.d.ts +18 -17
  122. package/dist/core/lbug/lbug-adapter.js +45 -73
  123. package/dist/core/lbug/pool-adapter.js +10 -28
  124. package/dist/core/platform/capabilities.d.ts +24 -0
  125. package/dist/core/platform/capabilities.js +54 -0
  126. package/dist/core/run-analyze.js +36 -9
  127. package/dist/core/search/bm25-index.d.ts +0 -17
  128. package/dist/core/search/bm25-index.js +10 -118
  129. package/dist/core/search/fts-indexes.d.ts +1 -0
  130. package/dist/core/search/fts-indexes.js +7 -0
  131. package/dist/core/search/fts-schema.d.ts +6 -0
  132. package/dist/core/search/fts-schema.js +7 -0
  133. package/dist/mcp/core/embedder.js +11 -4
  134. package/dist/mcp/local/local-backend.js +50 -15
  135. package/dist/server/api.d.ts +5 -0
  136. package/dist/server/api.js +113 -0
  137. package/hooks/claude/gitnexus-hook.cjs +11 -1
  138. package/package.json +6 -5
  139. package/scripts/build-tree-sitter-dart.cjs +42 -0
  140. package/scripts/build-tree-sitter-proto.cjs +1 -1
  141. package/scripts/build.js +22 -2
  142. package/scripts/install-duckdb-extension.mjs +37 -0
  143. package/vendor/tree-sitter-dart/README.md +18 -0
  144. package/vendor/tree-sitter-dart/binding.gyp +31 -0
  145. package/vendor/tree-sitter-dart/bindings/node/binding.cc +20 -0
  146. package/vendor/tree-sitter-dart/bindings/node/index.d.ts +28 -0
  147. package/vendor/tree-sitter-dart/bindings/node/index.js +7 -0
  148. package/vendor/tree-sitter-dart/grammar.js +2895 -0
  149. package/vendor/tree-sitter-dart/package.json +18 -0
  150. package/vendor/tree-sitter-dart/queries/highlights.scm +246 -0
  151. package/vendor/tree-sitter-dart/queries/tags.scm +92 -0
  152. package/vendor/tree-sitter-dart/queries/test.scm +1 -0
  153. package/vendor/tree-sitter-dart/src/grammar.json +12459 -0
  154. package/vendor/tree-sitter-dart/src/node-types.json +15055 -0
  155. package/vendor/tree-sitter-dart/src/parser.c +196127 -0
  156. package/vendor/tree-sitter-dart/src/scanner.c +130 -0
  157. package/vendor/tree-sitter-dart/src/tree_sitter/alloc.h +54 -0
  158. package/vendor/tree-sitter-dart/src/tree_sitter/array.h +290 -0
  159. package/vendor/tree-sitter-dart/src/tree_sitter/parser.h +265 -0
  160. package/vendor/tree-sitter-swift/LICENSE +21 -0
  161. package/vendor/tree-sitter-swift/README.md +139 -0
  162. package/vendor/tree-sitter-swift/bindings/node/index.d.ts +28 -0
  163. package/vendor/tree-sitter-swift/bindings/node/index.js +7 -0
  164. package/vendor/tree-sitter-swift/package.json +28 -0
  165. package/vendor/tree-sitter-swift/prebuilds/darwin-arm64/tree-sitter-swift.node +0 -0
  166. package/vendor/tree-sitter-swift/prebuilds/darwin-x64/tree-sitter-swift.node +0 -0
  167. package/vendor/tree-sitter-swift/prebuilds/linux-arm64/tree-sitter-swift.node +0 -0
  168. package/vendor/tree-sitter-swift/prebuilds/linux-x64/tree-sitter-swift.node +0 -0
  169. package/vendor/tree-sitter-swift/prebuilds/win32-arm64/tree-sitter-swift.node +0 -0
  170. package/vendor/tree-sitter-swift/prebuilds/win32-x64/tree-sitter-swift.node +0 -0
  171. package/vendor/tree-sitter-swift/src/node-types.json +30694 -0
  172. package/web/assets/agent-DaprsFSX.js +597 -0
  173. package/web/assets/architecture-YZFGNWBL-S5CXDPWN-DEdGaPg2.js +1 -0
  174. package/web/assets/architectureDiagram-EMZXCZ2Q-Domyk_gO.js +36 -0
  175. package/web/assets/blockDiagram-IGV67L2C-B_2kD7tM.js +132 -0
  176. package/web/assets/c4Diagram-DFAF54RM-BhJJW8Gg.js +10 -0
  177. package/web/assets/chunk-3GS5O3IE-jlWIjPsl.js +231 -0
  178. package/web/assets/chunk-3YCYZ6SJ-Blq_IzZs.js +1 -0
  179. package/web/assets/chunk-6NTNNK5N-DyPc58pp.js +1 -0
  180. package/web/assets/chunk-7RZVMHOQ-BdIU-RGO.js +321 -0
  181. package/web/assets/chunk-A34GCYZU-BI2i_LdU.js +1 -0
  182. package/web/assets/chunk-AEOMTBSW-D7qjBMHW.js +1 -0
  183. package/web/assets/chunk-CilyBKbf.js +1 -0
  184. package/web/assets/chunk-DJ7UZH7F-i11ywiBl.js +1 -0
  185. package/web/assets/chunk-DKKBVRCY-1SffGI1N.js +4 -0
  186. package/web/assets/chunk-DU5LTGQ6-DaPeiwD5.js +1 -0
  187. package/web/assets/chunk-FXACKDTF-uhhi2PC2.js +159 -0
  188. package/web/assets/chunk-H3VCZNTA-IchcISDt.js +1 -0
  189. package/web/assets/chunk-HN6EAY2L-D7ZFMNrB.js +1 -0
  190. package/web/assets/chunk-KSICW3F5-C2tZmXwv.js +15 -0
  191. package/web/assets/chunk-O5ABG6QK-Bt-Km84H.js +1 -0
  192. package/web/assets/chunk-PK6DOVAG-ChlWY0BQ.js +206 -0
  193. package/web/assets/chunk-RNJOYNJ4-B724K7cW.js +1 -0
  194. package/web/assets/chunk-RWUO3TPN-DYn1XriD.js +1 -0
  195. package/web/assets/chunk-TBF5ZNIQ-DKtDz6ae.js +1 -0
  196. package/web/assets/chunk-TU3PZOEN-DE5Qhc0N.js +1 -0
  197. package/web/assets/chunk-TYMNRAUI-g1h33cq-.js +1 -0
  198. package/web/assets/chunk-VELTKBKT-C9dVN39o.js +1 -0
  199. package/web/assets/chunk-W7ZLLLMY-Du-Hb9yb.js +1 -0
  200. package/web/assets/chunk-WSB5WSVC-B123clsZ.js +1 -0
  201. package/web/assets/chunk-XGPFEOL4-BR7Eue38.js +1 -0
  202. package/web/assets/classDiagram-PPOCWD7C-BglfKSs_.js +1 -0
  203. package/web/assets/classDiagram-v2-23LJLIIU-BSzTM28O.js +1 -0
  204. package/web/assets/context-builder-CqQNhRj1.js +15 -0
  205. package/web/assets/cose-bilkent-PNC4W37J-DCfErU-A.js +1 -0
  206. package/web/assets/dagre-E77IOHMT-tDRRhDoN.js +4 -0
  207. package/web/assets/diagram-H7BISOXX-CUVHlmAh.js +43 -0
  208. package/web/assets/diagram-JC5VWROH-BoyOxulB.js +24 -0
  209. package/web/assets/diagram-LXUTUG65-osr9hb7N.js +10 -0
  210. package/web/assets/diagram-WEHSV5V5-d8nUqS39.js +24 -0
  211. package/web/assets/erDiagram-GCSMX5X6-b-IwOhPS.js +85 -0
  212. package/web/assets/flowDiagram-OTCZ4VVT-Ott2Q0AP.js +162 -0
  213. package/web/assets/ganttDiagram-MUNLMDZQ-BYtgN_5s.js +292 -0
  214. package/web/assets/gitGraph-7Q5UKJZL-54BCDZD5-CFyBIGZq.js +1 -0
  215. package/web/assets/gitGraphDiagram-3HKGZ4G3-CsVD2gn4.js +106 -0
  216. package/web/assets/index-BleGLU8S.css +2 -0
  217. package/web/assets/index-C_xK08EW.js +885 -0
  218. package/web/assets/info-OMHHGYJF-BF2H5H6G-yjAxKEzh.js +1 -0
  219. package/web/assets/infoDiagram-MN7RKWGX-DXK0Unn5.js +2 -0
  220. package/web/assets/ishikawaDiagram-YMYX4NHK-CXsnC2FA.js +70 -0
  221. package/web/assets/journeyDiagram-SO5T7YLQ-BzZ07B-X.js +139 -0
  222. package/web/assets/kanban-definition-LJHFXRCJ-C6_EpAd9.js +89 -0
  223. package/web/assets/katex-GD7MH7QM-CJiOjBBJ.js +261 -0
  224. package/web/assets/mindmap-definition-2EUWGEK5-CCYGWZ1m.js +96 -0
  225. package/web/assets/packet-4T2RLAQJ-EV4IVRXR-B8k4E3IT.js +1 -0
  226. package/web/assets/pie-ZZUOXDRM-N23DN5KN-DdvfY118.js +1 -0
  227. package/web/assets/pieDiagram-3IATQBI2-RyvRlQb4.js +30 -0
  228. package/web/assets/quadrantDiagram-E256RVCF-Bfb6sxCx.js +7 -0
  229. package/web/assets/radar-PYXPWWZC-P6TP7ZYP-1EEDC_yU.js +1 -0
  230. package/web/assets/requirementDiagram-M5DCFWZL-DjvHDyvN.js +84 -0
  231. package/web/assets/sankeyDiagram-L3NBLAOT-CBCbbl8s.js +10 -0
  232. package/web/assets/sequenceDiagram-ZOUHS735-BscU8TUR.js +157 -0
  233. package/web/assets/stateDiagram-MLPALWAM-CJusEK2D.js +1 -0
  234. package/web/assets/stateDiagram-v2-B5LQ5ZB2-DImJ3PXD.js +1 -0
  235. package/web/assets/timeline-definition-5SPVSISX-DigPA1X8.js +120 -0
  236. package/web/assets/treeView-SZITEDCU-5DXDK3XO-CzPDt3aG.js +1 -0
  237. package/web/assets/treemap-W4RFUUIX-WYLRDWKO-B9Iqiorr.js +1 -0
  238. package/web/assets/vennDiagram-IE5QUKF5-C91UkZIf.js +34 -0
  239. package/web/assets/wardley-RL74JXVD-BCRCBASE-x42Qw7hp.js +1 -0
  240. package/web/assets/wardleyDiagram-XU3VSMPF-DloBhI0U.js +20 -0
  241. package/web/assets/xychartDiagram-ZHJ5623Y-BGWJvgwI.js +7 -0
  242. package/web/index.html +21 -0
  243. package/scripts/patch-tree-sitter-swift.cjs +0 -78
@@ -0,0 +1,231 @@
1
+ import{t as e}from"./chunk-VELTKBKT-C9dVN39o.js";import{$t as t,I as n,Jt as r,Rt as i,c as a,en as o,fn as s,hn as c,in as l,j as u,mn as d,qn as f,sn as p}from"./index-C_xK08EW.js";import{t as m}from"./chunk-TBF5ZNIQ-DKtDz6ae.js";import{t as h}from"./chunk-RWUO3TPN-DYn1XriD.js";var g=(function(){var t=e(function(e,t,n,r){for(n||={},r=e.length;r--;n[e[r]]=t);return n},`o`),n=[1,2],r=[1,3],i=[1,4],a=[2,4],o=[1,9],s=[1,11],c=[1,16],l=[1,17],u=[1,18],d=[1,19],f=[1,33],p=[1,20],m=[1,21],h=[1,22],g=[1,23],_=[1,24],v=[1,26],y=[1,27],b=[1,28],x=[1,29],S=[1,30],C=[1,31],w=[1,32],T=[1,35],E=[1,36],D=[1,37],O=[1,38],k=[1,34],A=[1,4,5,16,17,19,21,22,24,25,26,27,28,29,33,35,37,38,41,45,48,51,52,53,54,57],j=[1,4,5,14,15,16,17,19,21,22,24,25,26,27,28,29,33,35,37,38,39,40,41,45,48,51,52,53,54,57],M=[4,5,16,17,19,21,22,24,25,26,27,28,29,33,35,37,38,41,45,48,51,52,53,54,57],N={trace:e(function(){},`trace`),yy:{},symbols_:{error:2,start:3,SPACE:4,NL:5,SD:6,document:7,line:8,statement:9,classDefStatement:10,styleStatement:11,cssClassStatement:12,idStatement:13,DESCR:14,"-->":15,HIDE_EMPTY:16,scale:17,WIDTH:18,COMPOSIT_STATE:19,STRUCT_START:20,STRUCT_STOP:21,STATE_DESCR:22,AS:23,ID:24,FORK:25,JOIN:26,CHOICE:27,CONCURRENT:28,note:29,notePosition:30,NOTE_TEXT:31,direction:32,acc_title:33,acc_title_value:34,acc_descr:35,acc_descr_value:36,acc_descr_multiline_value:37,CLICK:38,STRING:39,HREF:40,classDef:41,CLASSDEF_ID:42,CLASSDEF_STYLEOPTS:43,DEFAULT:44,style:45,STYLE_IDS:46,STYLEDEF_STYLEOPTS:47,class:48,CLASSENTITY_IDS:49,STYLECLASS:50,direction_tb:51,direction_bt:52,direction_rl:53,direction_lr:54,eol:55,";":56,EDGE_STATE:57,STYLE_SEPARATOR:58,left_of:59,right_of:60,$accept:0,$end:1},terminals_:{2:`error`,4:`SPACE`,5:`NL`,6:`SD`,14:`DESCR`,15:`-->`,16:`HIDE_EMPTY`,17:`scale`,18:`WIDTH`,19:`COMPOSIT_STATE`,20:`STRUCT_START`,21:`STRUCT_STOP`,22:`STATE_DESCR`,23:`AS`,24:`ID`,25:`FORK`,26:`JOIN`,27:`CHOICE`,28:`CONCURRENT`,29:`note`,31:`NOTE_TEXT`,33:`acc_title`,34:`acc_title_value`,35:`acc_descr`,36:`acc_descr_value`,37:`acc_descr_multiline_value`,38:`CLICK`,39:`STRING`,40:`HREF`,41:`classDef`,42:`CLASSDEF_ID`,43:`CLASSDEF_STYLEOPTS`,44:`DEFAULT`,45:`style`,46:`STYLE_IDS`,47:`STYLEDEF_STYLEOPTS`,48:`class`,49:`CLASSENTITY_IDS`,50:`STYLECLASS`,51:`direction_tb`,52:`direction_bt`,53:`direction_rl`,54:`direction_lr`,56:`;`,57:`EDGE_STATE`,58:`STYLE_SEPARATOR`,59:`left_of`,60:`right_of`},productions_:[0,[3,2],[3,2],[3,2],[7,0],[7,2],[8,2],[8,1],[8,1],[9,1],[9,1],[9,1],[9,1],[9,2],[9,3],[9,4],[9,1],[9,2],[9,1],[9,4],[9,3],[9,6],[9,1],[9,1],[9,1],[9,1],[9,4],[9,4],[9,1],[9,2],[9,2],[9,1],[9,5],[9,5],[10,3],[10,3],[11,3],[12,3],[32,1],[32,1],[32,1],[32,1],[55,1],[55,1],[13,1],[13,1],[13,3],[13,3],[30,1],[30,1]],performAction:e(function(e,t,n,r,i,a,o){var s=a.length-1;switch(i){case 3:return r.setRootDoc(a[s]),a[s];case 4:this.$=[];break;case 5:a[s]!=`nl`&&(a[s-1].push(a[s]),this.$=a[s-1]);break;case 6:case 7:this.$=a[s];break;case 8:this.$=`nl`;break;case 12:this.$=a[s];break;case 13:let e=a[s-1];e.description=r.trimColon(a[s]),this.$=e;break;case 14:this.$={stmt:`relation`,state1:a[s-2],state2:a[s]};break;case 15:let t=r.trimColon(a[s]);this.$={stmt:`relation`,state1:a[s-3],state2:a[s-1],description:t};break;case 19:this.$={stmt:`state`,id:a[s-3],type:`default`,description:``,doc:a[s-1]};break;case 20:var c=a[s],l=a[s-2].trim();if(a[s].match(`:`)){var u=a[s].split(`:`);c=u[0],l=[l,u[1]]}this.$={stmt:`state`,id:c,type:`default`,description:l};break;case 21:this.$={stmt:`state`,id:a[s-3],type:`default`,description:a[s-5],doc:a[s-1]};break;case 22:this.$={stmt:`state`,id:a[s],type:`fork`};break;case 23:this.$={stmt:`state`,id:a[s],type:`join`};break;case 24:this.$={stmt:`state`,id:a[s],type:`choice`};break;case 25:this.$={stmt:`state`,id:r.getDividerId(),type:`divider`};break;case 26:this.$={stmt:`state`,id:a[s-1].trim(),note:{position:a[s-2].trim(),text:a[s].trim()}};break;case 29:this.$=a[s].trim(),r.setAccTitle(this.$);break;case 30:case 31:this.$=a[s].trim(),r.setAccDescription(this.$);break;case 32:this.$={stmt:`click`,id:a[s-3],url:a[s-2],tooltip:a[s-1]};break;case 33:this.$={stmt:`click`,id:a[s-3],url:a[s-1],tooltip:``};break;case 34:case 35:this.$={stmt:`classDef`,id:a[s-1].trim(),classes:a[s].trim()};break;case 36:this.$={stmt:`style`,id:a[s-1].trim(),styleClass:a[s].trim()};break;case 37:this.$={stmt:`applyClass`,id:a[s-1].trim(),styleClass:a[s].trim()};break;case 38:r.setDirection(`TB`),this.$={stmt:`dir`,value:`TB`};break;case 39:r.setDirection(`BT`),this.$={stmt:`dir`,value:`BT`};break;case 40:r.setDirection(`RL`),this.$={stmt:`dir`,value:`RL`};break;case 41:r.setDirection(`LR`),this.$={stmt:`dir`,value:`LR`};break;case 44:case 45:this.$={stmt:`state`,id:a[s].trim(),type:`default`,description:``};break;case 46:this.$={stmt:`state`,id:a[s-2].trim(),classes:[a[s].trim()],type:`default`,description:``};break;case 47:this.$={stmt:`state`,id:a[s-2].trim(),classes:[a[s].trim()],type:`default`,description:``};break}},`anonymous`),table:[{3:1,4:n,5:r,6:i},{1:[3]},{3:5,4:n,5:r,6:i},{3:6,4:n,5:r,6:i},t([1,4,5,16,17,19,22,24,25,26,27,28,29,33,35,37,38,41,45,48,51,52,53,54,57],a,{7:7}),{1:[2,1]},{1:[2,2]},{1:[2,3],4:o,5:s,8:8,9:10,10:12,11:13,12:14,13:15,16:c,17:l,19:u,22:d,24:f,25:p,26:m,27:h,28:g,29:_,32:25,33:v,35:y,37:b,38:x,41:S,45:C,48:w,51:T,52:E,53:D,54:O,57:k},t(A,[2,5]),{9:39,10:12,11:13,12:14,13:15,16:c,17:l,19:u,22:d,24:f,25:p,26:m,27:h,28:g,29:_,32:25,33:v,35:y,37:b,38:x,41:S,45:C,48:w,51:T,52:E,53:D,54:O,57:k},t(A,[2,7]),t(A,[2,8]),t(A,[2,9]),t(A,[2,10]),t(A,[2,11]),t(A,[2,12],{14:[1,40],15:[1,41]}),t(A,[2,16]),{18:[1,42]},t(A,[2,18],{20:[1,43]}),{23:[1,44]},t(A,[2,22]),t(A,[2,23]),t(A,[2,24]),t(A,[2,25]),{30:45,31:[1,46],59:[1,47],60:[1,48]},t(A,[2,28]),{34:[1,49]},{36:[1,50]},t(A,[2,31]),{13:51,24:f,57:k},{42:[1,52],44:[1,53]},{46:[1,54]},{49:[1,55]},t(j,[2,44],{58:[1,56]}),t(j,[2,45],{58:[1,57]}),t(A,[2,38]),t(A,[2,39]),t(A,[2,40]),t(A,[2,41]),t(A,[2,6]),t(A,[2,13]),{13:58,24:f,57:k},t(A,[2,17]),t(M,a,{7:59}),{24:[1,60]},{24:[1,61]},{23:[1,62]},{24:[2,48]},{24:[2,49]},t(A,[2,29]),t(A,[2,30]),{39:[1,63],40:[1,64]},{43:[1,65]},{43:[1,66]},{47:[1,67]},{50:[1,68]},{24:[1,69]},{24:[1,70]},t(A,[2,14],{14:[1,71]}),{4:o,5:s,8:8,9:10,10:12,11:13,12:14,13:15,16:c,17:l,19:u,21:[1,72],22:d,24:f,25:p,26:m,27:h,28:g,29:_,32:25,33:v,35:y,37:b,38:x,41:S,45:C,48:w,51:T,52:E,53:D,54:O,57:k},t(A,[2,20],{20:[1,73]}),{31:[1,74]},{24:[1,75]},{39:[1,76]},{39:[1,77]},t(A,[2,34]),t(A,[2,35]),t(A,[2,36]),t(A,[2,37]),t(j,[2,46]),t(j,[2,47]),t(A,[2,15]),t(A,[2,19]),t(M,a,{7:78}),t(A,[2,26]),t(A,[2,27]),{5:[1,79]},{5:[1,80]},{4:o,5:s,8:8,9:10,10:12,11:13,12:14,13:15,16:c,17:l,19:u,21:[1,81],22:d,24:f,25:p,26:m,27:h,28:g,29:_,32:25,33:v,35:y,37:b,38:x,41:S,45:C,48:w,51:T,52:E,53:D,54:O,57:k},t(A,[2,32]),t(A,[2,33]),t(A,[2,21])],defaultActions:{5:[2,1],6:[2,2],47:[2,48],48:[2,49]},parseError:e(function(e,t){if(t.recoverable)this.trace(e);else{var n=Error(e);throw n.hash=t,n}},`parseError`),parse:e(function(t){var n=this,r=[0],i=[],a=[null],o=[],s=this.table,c=``,l=0,u=0,d=0,f=2,p=1,m=o.slice.call(arguments,1),h=Object.create(this.lexer),g={yy:{}};for(var _ in this.yy)Object.prototype.hasOwnProperty.call(this.yy,_)&&(g.yy[_]=this.yy[_]);h.setInput(t,g.yy),g.yy.lexer=h,g.yy.parser=this,typeof h.yylloc>`u`&&(h.yylloc={});var v=h.yylloc;o.push(v);var y=h.options&&h.options.ranges;typeof g.yy.parseError==`function`?this.parseError=g.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function b(e){r.length-=2*e,a.length-=e,o.length-=e}e(b,`popStack`);function x(){var e;return e=i.pop()||h.lex()||p,typeof e!=`number`&&(e instanceof Array&&(i=e,e=i.pop()),e=n.symbols_[e]||e),e}e(x,`lex`);for(var S,C,w,T,E,D={},O,k,A,j;;){if(w=r[r.length-1],this.defaultActions[w]?T=this.defaultActions[w]:((S===null||typeof S>`u`)&&(S=x()),T=s[w]&&s[w][S]),typeof T>`u`||!T.length||!T[0]){var M=``;for(O in j=[],s[w])this.terminals_[O]&&O>f&&j.push(`'`+this.terminals_[O]+`'`);M=h.showPosition?`Parse error on line `+(l+1)+`:
2
+ `+h.showPosition()+`
3
+ Expecting `+j.join(`, `)+`, got '`+(this.terminals_[S]||S)+`'`:`Parse error on line `+(l+1)+`: Unexpected `+(S==p?`end of input`:`'`+(this.terminals_[S]||S)+`'`),this.parseError(M,{text:h.match,token:this.terminals_[S]||S,line:h.yylineno,loc:v,expected:j})}if(T[0]instanceof Array&&T.length>1)throw Error(`Parse Error: multiple actions possible at state: `+w+`, token: `+S);switch(T[0]){case 1:r.push(S),a.push(h.yytext),o.push(h.yylloc),r.push(T[1]),S=null,C?(S=C,C=null):(u=h.yyleng,c=h.yytext,l=h.yylineno,v=h.yylloc,d>0&&d--);break;case 2:if(k=this.productions_[T[1]][1],D.$=a[a.length-k],D._$={first_line:o[o.length-(k||1)].first_line,last_line:o[o.length-1].last_line,first_column:o[o.length-(k||1)].first_column,last_column:o[o.length-1].last_column},y&&(D._$.range=[o[o.length-(k||1)].range[0],o[o.length-1].range[1]]),E=this.performAction.apply(D,[c,u,l,g.yy,T[1],a,o].concat(m)),typeof E<`u`)return E;k&&(r=r.slice(0,-1*k*2),a=a.slice(0,-1*k),o=o.slice(0,-1*k)),r.push(this.productions_[T[1]][0]),a.push(D.$),o.push(D._$),A=s[r[r.length-2]][r[r.length-1]],r.push(A);break;case 3:return!0}}return!0},`parse`)};N.lexer=(function(){return{EOF:1,parseError:e(function(e,t){if(this.yy.parser)this.yy.parser.parseError(e,t);else throw Error(e)},`parseError`),setInput:e(function(e,t){return this.yy=t||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={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},`setInput`),input:e(function(){var e=this._input[0];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},`input`),unput:e(function(e){var t=e.length,n=e.split(/(?:\r\n?|\n)/g);this._input=e+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-t),this.offset-=t;var r=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),n.length-1&&(this.yylineno-=n.length-1);var i=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:n?(n.length===r.length?this.yylloc.first_column:0)+r[r.length-n.length].length-n[0].length:this.yylloc.first_column-t},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-t]),this.yyleng=this.yytext.length,this},`unput`),more:e(function(){return this._more=!0,this},`more`),reject:e(function(){if(this.options.backtrack_lexer)this._backtrack=!0;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).
4
+ `+this.showPosition(),{text:``,token:null,line:this.yylineno});return this},`reject`),less:e(function(e){this.unput(this.match.slice(e))},`less`),pastInput:e(function(){var e=this.matched.substr(0,this.matched.length-this.match.length);return(e.length>20?`...`:``)+e.substr(-20).replace(/\n/g,``)},`pastInput`),upcomingInput:e(function(){var e=this.match;return e.length<20&&(e+=this._input.substr(0,20-e.length)),(e.substr(0,20)+(e.length>20?`...`:``)).replace(/\n/g,``)},`upcomingInput`),showPosition:e(function(){var e=this.pastInput(),t=Array(e.length+1).join(`-`);return e+this.upcomingInput()+`
5
+ `+t+`^`},`showPosition`),test_match:e(function(e,t){var n,r,i;if(this.options.backtrack_lexer&&(i={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(i.yylloc.range=this.yylloc.range.slice(0))),r=e[0].match(/(?:\r\n?|\n).*/g),r&&(this.yylineno+=r.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:r?r[r.length-1].length-r[r.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+e[0].length},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],n=this.performAction.call(this,this.yy,this,t,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var a in i)this[a]=i[a];return!1}return!1},`test_match`),next:e(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var e,t,n,r;this._more||(this.yytext=``,this.match=``);for(var i=this._currentRules(),a=0;a<i.length;a++)if(n=this._input.match(this.rules[i[a]]),n&&(!t||n[0].length>t[0].length)){if(t=n,r=a,this.options.backtrack_lexer){if(e=this.test_match(n,i[a]),e!==!1)return e;if(this._backtrack){t=!1;continue}else return!1}else if(!this.options.flex)break}return t?(e=this.test_match(t,i[r]),e===!1?!1:e):this._input===``?this.EOF:this.parseError(`Lexical error on line `+(this.yylineno+1)+`. Unrecognized text.
6
+ `+this.showPosition(),{text:``,token:null,line:this.yylineno})},`next`),lex:e(function(){return this.next()||this.lex()},`lex`),begin:e(function(e){this.conditionStack.push(e)},`begin`),popState:e(function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},`popState`),_currentRules:e(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},`_currentRules`),topState:e(function(e){return e=this.conditionStack.length-1-Math.abs(e||0),e>=0?this.conditionStack[e]:`INITIAL`},`topState`),pushState:e(function(e){this.begin(e)},`pushState`),stateStackSize:e(function(){return this.conditionStack.length},`stateStackSize`),options:{"case-insensitive":!0},performAction:e(function(e,t,n,r){switch(n){case 0:return 38;case 1:return 40;case 2:return 39;case 3:return 44;case 4:return 51;case 5:return 52;case 6:return 53;case 7:return 54;case 8:break;case 9:break;case 10:return 5;case 11:break;case 12:break;case 13:break;case 14:break;case 15:return this.pushState(`SCALE`),17;case 16:return 18;case 17:this.popState();break;case 18:return this.begin(`acc_title`),33;case 19:return this.popState(),`acc_title_value`;case 20:return this.begin(`acc_descr`),35;case 21:return this.popState(),`acc_descr_value`;case 22:this.begin(`acc_descr_multiline`);break;case 23:this.popState();break;case 24:return`acc_descr_multiline_value`;case 25:return this.pushState(`CLASSDEF`),41;case 26:return this.popState(),this.pushState(`CLASSDEFID`),`DEFAULT_CLASSDEF_ID`;case 27:return this.popState(),this.pushState(`CLASSDEFID`),42;case 28:return this.popState(),43;case 29:return this.pushState(`CLASS`),48;case 30:return this.popState(),this.pushState(`CLASS_STYLE`),49;case 31:return this.popState(),50;case 32:return this.pushState(`STYLE`),45;case 33:return this.popState(),this.pushState(`STYLEDEF_STYLES`),46;case 34:return this.popState(),47;case 35:return this.pushState(`SCALE`),17;case 36:return 18;case 37:this.popState();break;case 38:this.pushState(`STATE`);break;case 39:return this.popState(),t.yytext=t.yytext.slice(0,-8).trim(),25;case 40:return this.popState(),t.yytext=t.yytext.slice(0,-8).trim(),26;case 41:return this.popState(),t.yytext=t.yytext.slice(0,-10).trim(),27;case 42:return this.popState(),t.yytext=t.yytext.slice(0,-8).trim(),25;case 43:return this.popState(),t.yytext=t.yytext.slice(0,-8).trim(),26;case 44:return this.popState(),t.yytext=t.yytext.slice(0,-10).trim(),27;case 45:return 51;case 46:return 52;case 47:return 53;case 48:return 54;case 49:this.pushState(`STATE_STRING`);break;case 50:return this.pushState(`STATE_ID`),`AS`;case 51:return this.popState(),`ID`;case 52:this.popState();break;case 53:return`STATE_DESCR`;case 54:return 19;case 55:this.popState();break;case 56:return this.popState(),this.pushState(`struct`),20;case 57:break;case 58:return this.popState(),21;case 59:break;case 60:return this.begin(`NOTE`),29;case 61:return this.popState(),this.pushState(`NOTE_ID`),59;case 62:return this.popState(),this.pushState(`NOTE_ID`),60;case 63:this.popState(),this.pushState(`FLOATING_NOTE`);break;case 64:return this.popState(),this.pushState(`FLOATING_NOTE_ID`),`AS`;case 65:break;case 66:return`NOTE_TEXT`;case 67:return this.popState(),`ID`;case 68:return this.popState(),this.pushState(`NOTE_TEXT`),24;case 69:return this.popState(),t.yytext=t.yytext.substr(2).trim(),31;case 70:return this.popState(),t.yytext=t.yytext.slice(0,-8).trim(),31;case 71:return 6;case 72:return 6;case 73:return 16;case 74:return 57;case 75:return 24;case 76:return t.yytext=t.yytext.trim(),14;case 77:return 15;case 78:return 28;case 79:return 58;case 80:return 5;case 81:return`INVALID`}},`anonymous`),rules:[/^(?:click\b)/i,/^(?:href\b)/i,/^(?:"[^"]*")/i,/^(?:default\b)/i,/^(?:.*direction\s+TB[^\n]*)/i,/^(?:.*direction\s+BT[^\n]*)/i,/^(?:.*direction\s+RL[^\n]*)/i,/^(?:.*direction\s+LR[^\n]*)/i,/^(?:%%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[\n]+)/i,/^(?:[\s]+)/i,/^(?:((?!\n)\s)+)/i,/^(?:#[^\n]*)/i,/^(?:%[^\n]*)/i,/^(?:scale\s+)/i,/^(?:\d+)/i,/^(?:\s+width\b)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:classDef\s+)/i,/^(?:DEFAULT\s+)/i,/^(?:\w+\s+)/i,/^(?:[^\n]*)/i,/^(?:class\s+)/i,/^(?:(\w+)+((,\s*\w+)*))/i,/^(?:[^\n]*)/i,/^(?:style\s+)/i,/^(?:[\w,]+\s+)/i,/^(?:[^\n]*)/i,/^(?:scale\s+)/i,/^(?:\d+)/i,/^(?:\s+width\b)/i,/^(?:state\s+)/i,/^(?:.*<<fork>>)/i,/^(?:.*<<join>>)/i,/^(?:.*<<choice>>)/i,/^(?:.*\[\[fork\]\])/i,/^(?:.*\[\[join\]\])/i,/^(?:.*\[\[choice\]\])/i,/^(?:.*direction\s+TB[^\n]*)/i,/^(?:.*direction\s+BT[^\n]*)/i,/^(?:.*direction\s+RL[^\n]*)/i,/^(?:.*direction\s+LR[^\n]*)/i,/^(?:["])/i,/^(?:\s*as\s+)/i,/^(?:[^\n\{]*)/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:[^\n\s\{]+)/i,/^(?:\n)/i,/^(?:\{)/i,/^(?:%%(?!\{)[^\n]*)/i,/^(?:\})/i,/^(?:[\n])/i,/^(?:note\s+)/i,/^(?:left of\b)/i,/^(?:right of\b)/i,/^(?:")/i,/^(?:\s*as\s*)/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:[^\n]*)/i,/^(?:\s*[^:\n\s\-]+)/i,/^(?:\s*:[^:\n;]+)/i,/^(?:[\s\S]*?end note\b)/i,/^(?:stateDiagram\s+)/i,/^(?:stateDiagram-v2\s+)/i,/^(?:hide empty description\b)/i,/^(?:\[\*\])/i,/^(?:[^:\n\s\-\{]+)/i,/^(?:\s*:(?:[^:\n;]|:[^:\n;])+)/i,/^(?:-->)/i,/^(?:--)/i,/^(?::::)/i,/^(?:$)/i,/^(?:.)/i],conditions:{LINE:{rules:[12,13],inclusive:!1},struct:{rules:[12,13,25,29,32,38,45,46,47,48,57,58,59,60,74,75,76,77,78,79],inclusive:!1},FLOATING_NOTE_ID:{rules:[67],inclusive:!1},FLOATING_NOTE:{rules:[64,65,66],inclusive:!1},NOTE_TEXT:{rules:[69,70],inclusive:!1},NOTE_ID:{rules:[68],inclusive:!1},NOTE:{rules:[61,62,63],inclusive:!1},STYLEDEF_STYLEOPTS:{rules:[],inclusive:!1},STYLEDEF_STYLES:{rules:[34],inclusive:!1},STYLE_IDS:{rules:[],inclusive:!1},STYLE:{rules:[33],inclusive:!1},CLASS_STYLE:{rules:[31],inclusive:!1},CLASS:{rules:[30],inclusive:!1},CLASSDEFID:{rules:[28],inclusive:!1},CLASSDEF:{rules:[26,27],inclusive:!1},acc_descr_multiline:{rules:[23,24],inclusive:!1},acc_descr:{rules:[21],inclusive:!1},acc_title:{rules:[19],inclusive:!1},SCALE:{rules:[16,17,36,37],inclusive:!1},ALIAS:{rules:[],inclusive:!1},STATE_ID:{rules:[51],inclusive:!1},STATE_STRING:{rules:[52,53],inclusive:!1},FORK_STATE:{rules:[],inclusive:!1},STATE:{rules:[12,13,39,40,41,42,43,44,49,50,54,55,56],inclusive:!1},ID:{rules:[12,13],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,8,9,10,11,13,14,15,18,20,22,25,29,32,35,38,56,60,71,72,73,74,75,76,77,79,80,81],inclusive:!0}}}})();function P(){this.yy={}}return e(P,`Parser`),P.prototype=N,N.Parser=P,new P})();g.parser=g;var _=g,v=`state`,y=`root`,b=`relation`,x=`classDef`,S=`style`,C=`applyClass`,w=`default`,T=`divider`,E=`fill:none`,D=`fill: #333`,O=`markdown`,k=`normal`,A=`rect`,j=`rectWithTitle`,M=`stateStart`,N=`stateEnd`,P=`divider`,F=`roundedWithTitle`,ee=`note`,te=`noteGroup`,I=`statediagram`,ne=`${I}-state`,L=`transition`,re=`note`,ie=`${L} note-edge`,ae=`${I}-${re}`,oe=`${I}-cluster`,se=`${I}-cluster-alt`,R=`parent`,z=`note`,ce=`state`,B=`----`,le=`${B}${z}`,V=`${B}${R}`,H=e((e,t=`TB`)=>{if(!e.doc)return t;let n=t;for(let t of e.doc)t.stmt===`dir`&&(n=t.value);return n},`getDir`),ue={getClasses:e(function(e,t){return t.db.getClasses()},`getClasses`),draw:e(async function(e,t,r,i){f.info(`REF0:`),f.info(`Drawing state diagram (v2)`,t);let{securityLevel:o,state:s,layout:c}=d();i.db.extract(i.db.getRootDocV2());let l=i.db.getData(),u=m(t,o);l.type=i.type,l.layoutAlgorithm=c,l.nodeSpacing=s?.nodeSpacing||50,l.rankSpacing=s?.rankSpacing||50,d().look===`neo`?l.markers=[`barbNeo`]:l.markers=[`barb`],l.diagramId=t,await a(l,u);try{(typeof i.db.getLinks==`function`?i.db.getLinks():new Map).forEach((e,t)=>{let n=typeof t==`string`?t:typeof t?.id==`string`?t.id:``;if(!n){f.warn(`⚠️ Invalid or missing stateId from key:`,JSON.stringify(t));return}let r=u.node()?.querySelectorAll(`g`),i;if(r?.forEach(e=>{e.textContent?.trim()===n&&(i=e)}),!i){f.warn(`⚠️ Could not find node matching text:`,n);return}let a=i.parentNode;if(!a){f.warn(`⚠️ Node has no parent, cannot wrap:`,n);return}let o=document.createElementNS(`http://www.w3.org/2000/svg`,`a`),s=e.url.replace(/^"+|"+$/g,``);if(o.setAttributeNS(`http://www.w3.org/1999/xlink`,`xlink:href`,s),o.setAttribute(`target`,`_blank`),e.tooltip){let t=e.tooltip.replace(/^"+|"+$/g,``);o.setAttribute(`title`,t)}a.replaceChild(o,i),o.appendChild(i),f.info(`🔗 Wrapped node in <a> tag for:`,n,e.url)})}catch(e){f.error(`❌ Error injecting clickable links:`,e)}n.insertTitle(u,`statediagramTitleText`,s?.titleTopMargin??25,i.db.getDiagramTitle()),h(u,8,I,s?.useMaxWidth??!0)},`draw`),getDir:H},U=new Map,W=0;function G(e=``,t=0,n=``,r=B){return`${ce}-${e}${n!==null&&n.length>0?`${r}${n}`:``}-${t}`}e(G,`stateDomId`);var de=e((e,t,n,r,a,o,s,c)=>{f.trace(`items`,t),t.forEach(t=>{switch(t.stmt){case v:X(e,t,n,r,a,o,s,c);break;case w:X(e,t,n,r,a,o,s,c);break;case b:{X(e,t.state1,n,r,a,o,s,c),X(e,t.state2,n,r,a,o,s,c);let l=s===`neo`,u={id:`edge`+W,start:t.state1.id,end:t.state2.id,arrowhead:`normal`,arrowTypeEnd:l?`arrow_barb_neo`:`arrow_barb`,style:E,labelStyle:``,label:i.sanitizeText(t.description??``,d()),arrowheadStyle:D,labelpos:`c`,labelType:O,thickness:k,classes:L,look:s};a.push(u),W++}break}})},`setupDoc`),K=e((e,t=`TB`)=>{let n=t;if(e.doc)for(let t of e.doc)t.stmt===`dir`&&(n=t.value);return n},`getDir`);function q(e,t,n){if(!t.id||t.id===`</join></fork>`||t.id===`</choice>`)return;t.cssClasses&&(Array.isArray(t.cssCompiledStyles)||(t.cssCompiledStyles=[]),t.cssClasses.split(` `).forEach(e=>{let r=n.get(e);r&&(t.cssCompiledStyles=[...t.cssCompiledStyles??[],...r.styles])}));let r=e.find(e=>e.id===t.id);r?Object.assign(r,t):e.push(t)}e(q,`insertOrUpdateNode`);function J(e){return e?.classes?.join(` `)??``}e(J,`getClassesFromDbInfo`);function Y(e){return e?.styles??[]}e(Y,`getStylesFromDbInfo`);var X=e((e,t,n,r,a,o,s,c)=>{let l=t.id,u=n.get(l),p=J(u),m=Y(u),h=d();if(f.info(`dataFetcher parsedItem`,t,u,m),l!==`root`){let n=A;t.start===!0?n=M:t.start===!1&&(n=N),t.type!==w&&(n=t.type),U.get(l)||U.set(l,{id:l,shape:n,description:i.sanitizeText(l,h),cssClasses:`${p} ${ne}`,cssStyles:m});let u=U.get(l);t.description&&(Array.isArray(u.description)?(u.shape=j,u.description.push(t.description)):u.description?.length&&u.description.length>0?(u.shape=j,u.description===l?u.description=[t.description]:u.description=[u.description,t.description]):(u.shape=A,u.description=t.description),u.description=i.sanitizeTextOrArray(u.description,h)),u.description?.length===1&&u.shape===j&&(u.type===`group`?u.shape=F:u.shape=A),!u.type&&t.doc&&(f.info(`Setting cluster for XCX`,l,K(t)),u.type=`group`,u.isGroup=!0,u.dir=K(t),u.shape=t.type===T?P:F,u.cssClasses=`${u.cssClasses} ${oe} ${o?se:``}`);let d={labelStyle:``,shape:u.shape,label:u.description,cssClasses:u.cssClasses,cssCompiledStyles:[],cssStyles:u.cssStyles,id:l,dir:u.dir,domId:G(l,W),type:u.type,isGroup:u.type===`group`,padding:8,rx:10,ry:10,look:s,labelType:`markdown`};if(d.shape===P&&(d.label=``),e&&e.id!==`root`&&(f.trace(`Setting node `,l,` to be child of its parent `,e.id),d.parentId=e.id),d.centerLabel=!0,t.note){let e={labelStyle:``,shape:ee,label:t.note.text,labelType:`markdown`,cssClasses:ae,cssStyles:[],cssCompiledStyles:[],id:l+le+`-`+W,domId:G(l,W,z),type:u.type,isGroup:u.type===`group`,padding:h.flowchart?.padding,look:s,position:t.note.position},n=l+V,i={labelStyle:``,shape:te,label:t.note.text,cssClasses:u.cssClasses,cssStyles:[],id:l+V,domId:G(l,W,R),type:`group`,isGroup:!0,padding:16,look:s,position:t.note.position};W++,i.id=n,e.parentId=n,q(r,i,c),q(r,e,c),q(r,d,c);let o=l,f=e.id;t.note.position===`left of`&&(o=e.id,f=l),a.push({id:o+`-`+f,start:o,end:f,arrowhead:`none`,arrowTypeEnd:``,style:E,labelStyle:``,classes:ie,arrowheadStyle:D,labelpos:`c`,labelType:O,thickness:k,look:s})}else q(r,d,c)}t.doc&&(f.trace(`Adding nodes children `),de(t,t.doc,n,r,a,!o,s,c))},`dataFetcher`),fe=e(()=>{U.clear(),W=0},`reset`),Z={START_NODE:`[*]`,START_TYPE:`start`,END_NODE:`[*]`,END_TYPE:`end`,COLOR_KEYWORD:`color`,FILL_KEYWORD:`fill`,BG_FILL:`bgFill`,STYLECLASS_SEP:`,`},Q=e(()=>new Map,`newClassesList`),pe=e(()=>({relations:[],states:new Map,documents:{}}),`newDoc`),$=e(e=>JSON.parse(JSON.stringify(e)),`clone`),me=class{constructor(e){this.version=e,this.nodes=[],this.edges=[],this.rootDoc=[],this.classes=Q(),this.documents={root:pe()},this.currentDocument=this.documents.root,this.startEndCount=0,this.dividerCnt=0,this.links=new Map,this.getAccTitle=c,this.setAccTitle=t,this.getAccDescription=l,this.setAccDescription=r,this.setDiagramTitle=o,this.getDiagramTitle=p,this.clear(),this.setRootDoc=this.setRootDoc.bind(this),this.getDividerId=this.getDividerId.bind(this),this.setDirection=this.setDirection.bind(this),this.trimColon=this.trimColon.bind(this)}static{e(this,`StateDB`)}static{this.relationType={AGGREGATION:0,EXTENSION:1,COMPOSITION:2,DEPENDENCY:3}}extract(e){this.clear(!0);for(let t of Array.isArray(e)?e:e.doc)switch(t.stmt){case v:this.addState(t.id.trim(),t.type,t.doc,t.description,t.note);break;case b:this.addRelation(t.state1,t.state2,t.description);break;case x:this.addStyleClass(t.id.trim(),t.classes);break;case S:this.handleStyleDef(t);break;case C:this.setCssClass(t.id.trim(),t.styleClass);break;case`click`:this.addLink(t.id,t.url,t.tooltip);break}let t=this.getStates(),n=d();fe(),X(void 0,this.getRootDocV2(),t,this.nodes,this.edges,!0,n.look,this.classes);for(let e of this.nodes)if(Array.isArray(e.label)){if(e.description=e.label.slice(1),e.isGroup&&e.description.length>0)throw Error(`Group nodes can only have label. Remove the additional description for node [${e.id}]`);e.label=e.label[0]}}handleStyleDef(e){let t=e.id.trim().split(`,`),n=e.styleClass.split(`,`);for(let e of t){let t=this.getState(e);if(!t){let n=e.trim();this.addState(n),t=this.getState(n)}t&&(t.styles=n.map(e=>e.replace(/;/g,``)?.trim()))}}setRootDoc(e){f.info(`Setting root doc`,e),this.rootDoc=e,this.version===1?this.extract(e):this.extract(this.getRootDocV2())}docTranslator(e,t,n){if(t.stmt===b){this.docTranslator(e,t.state1,!0),this.docTranslator(e,t.state2,!1);return}if(t.stmt===v&&(t.id===Z.START_NODE?(t.id=e.id+(n?`_start`:`_end`),t.start=n):t.id=t.id.trim()),t.stmt!==y&&t.stmt!==v||!t.doc)return;let r=[],i=[];for(let e of t.doc)if(e.type===T){let t=$(e);t.doc=$(i),r.push(t),i=[]}else i.push(e);if(r.length>0&&i.length>0){let e={stmt:v,id:u(),type:`divider`,doc:$(i)};r.push($(e)),t.doc=r}t.doc.forEach(e=>this.docTranslator(t,e,!0))}getRootDocV2(){return this.docTranslator({id:y,stmt:y},{id:y,stmt:y,doc:this.rootDoc},!0),{id:y,doc:this.rootDoc}}addState(e,t=w,n=void 0,r=void 0,a=void 0,o=void 0,s=void 0,c=void 0){let l=e?.trim();if(!this.currentDocument.states.has(l))f.info(`Adding state `,l,r),this.currentDocument.states.set(l,{stmt:v,id:l,descriptions:[],type:t,doc:n,note:a,classes:[],styles:[],textStyles:[]});else{let e=this.currentDocument.states.get(l);if(!e)throw Error(`State not found: ${l}`);e.doc||=n,e.type||=t}if(r&&(f.info(`Setting state description`,l,r),(Array.isArray(r)?r:[r]).forEach(e=>this.addDescription(l,e.trim()))),a){let e=this.currentDocument.states.get(l);if(!e)throw Error(`State not found: ${l}`);e.note=a,e.note.text=i.sanitizeText(e.note.text,d())}o&&(f.info(`Setting state classes`,l,o),(Array.isArray(o)?o:[o]).forEach(e=>this.setCssClass(l,e.trim()))),s&&(f.info(`Setting state styles`,l,s),(Array.isArray(s)?s:[s]).forEach(e=>this.setStyle(l,e.trim()))),c&&(f.info(`Setting state styles`,l,s),(Array.isArray(c)?c:[c]).forEach(e=>this.setTextStyle(l,e.trim())))}clear(e){this.nodes=[],this.edges=[],this.documents={root:pe()},this.currentDocument=this.documents.root,this.startEndCount=0,this.classes=Q(),e||(this.links=new Map,s())}getState(e){return this.currentDocument.states.get(e)}getStates(){return this.currentDocument.states}logDocuments(){f.info(`Documents = `,this.documents)}getRelations(){return this.currentDocument.relations}addLink(e,t,n){this.links.set(e,{url:t,tooltip:n}),f.warn(`Adding link`,e,t,n)}getLinks(){return this.links}startIdIfNeeded(e=``){return e===Z.START_NODE?(this.startEndCount++,`${Z.START_TYPE}${this.startEndCount}`):e}startTypeIfNeeded(e=``,t=w){return e===Z.START_NODE?Z.START_TYPE:t}endIdIfNeeded(e=``){return e===Z.END_NODE?(this.startEndCount++,`${Z.END_TYPE}${this.startEndCount}`):e}endTypeIfNeeded(e=``,t=w){return e===Z.END_NODE?Z.END_TYPE:t}addRelationObjs(e,t,n=``){let r=this.startIdIfNeeded(e.id.trim()),a=this.startTypeIfNeeded(e.id.trim(),e.type),o=this.startIdIfNeeded(t.id.trim()),s=this.startTypeIfNeeded(t.id.trim(),t.type);this.addState(r,a,e.doc,e.description,e.note,e.classes,e.styles,e.textStyles),this.addState(o,s,t.doc,t.description,t.note,t.classes,t.styles,t.textStyles),this.currentDocument.relations.push({id1:r,id2:o,relationTitle:i.sanitizeText(n,d())})}addRelation(e,t,n){if(typeof e==`object`&&typeof t==`object`)this.addRelationObjs(e,t,n);else if(typeof e==`string`&&typeof t==`string`){let r=this.startIdIfNeeded(e.trim()),a=this.startTypeIfNeeded(e),o=this.endIdIfNeeded(t.trim()),s=this.endTypeIfNeeded(t);this.addState(r,a),this.addState(o,s),this.currentDocument.relations.push({id1:r,id2:o,relationTitle:n?i.sanitizeText(n,d()):void 0})}}addDescription(e,t){let n=this.currentDocument.states.get(e),r=t.startsWith(`:`)?t.replace(`:`,``).trim():t;n?.descriptions?.push(i.sanitizeText(r,d()))}cleanupLabel(e){return e.startsWith(`:`)?e.slice(2).trim():e.trim()}getDividerId(){return this.dividerCnt++,`divider-id-${this.dividerCnt}`}addStyleClass(e,t=``){this.classes.has(e)||this.classes.set(e,{id:e,styles:[],textStyles:[]});let n=this.classes.get(e);t&&n&&t.split(Z.STYLECLASS_SEP).forEach(e=>{let t=e.replace(/([^;]*);/,`$1`).trim();if(RegExp(Z.COLOR_KEYWORD).exec(e)){let e=t.replace(Z.FILL_KEYWORD,Z.BG_FILL).replace(Z.COLOR_KEYWORD,Z.FILL_KEYWORD);n.textStyles.push(e)}n.styles.push(t)})}getClasses(){return this.classes}setCssClass(e,t){e.split(`,`).forEach(e=>{let n=this.getState(e);if(!n){let t=e.trim();this.addState(t),n=this.getState(t)}n?.classes?.push(t)})}setStyle(e,t){this.getState(e)?.styles?.push(t)}setTextStyle(e,t){this.getState(e)?.textStyles?.push(t)}getDirectionStatement(){return this.rootDoc.find(e=>e.stmt===`dir`)}getDirection(){return this.getDirectionStatement()?.value??`TB`}setDirection(e){let t=this.getDirectionStatement();t?t.value=e:this.rootDoc.unshift({stmt:`dir`,value:e})}trimColon(e){return e.startsWith(`:`)?e.slice(1).trim():e.trim()}getData(){let e=d();return{nodes:this.nodes,edges:this.edges,other:{},config:e,direction:H(this.getRootDocV2())}}getConfig(){return d().state}},he=e(e=>`
7
+ defs [id$="-barbEnd"] {
8
+ fill: ${e.transitionColor};
9
+ stroke: ${e.transitionColor};
10
+ }
11
+ g.stateGroup text {
12
+ fill: ${e.nodeBorder};
13
+ stroke: none;
14
+ font-size: 10px;
15
+ }
16
+ g.stateGroup text {
17
+ fill: ${e.textColor};
18
+ stroke: none;
19
+ font-size: 10px;
20
+
21
+ }
22
+ g.stateGroup .state-title {
23
+ font-weight: bolder;
24
+ fill: ${e.stateLabelColor};
25
+ }
26
+
27
+ g.stateGroup rect {
28
+ fill: ${e.mainBkg};
29
+ stroke: ${e.nodeBorder};
30
+ }
31
+
32
+ g.stateGroup line {
33
+ stroke: ${e.lineColor};
34
+ stroke-width: ${e.strokeWidth||1};
35
+ }
36
+
37
+ .transition {
38
+ stroke: ${e.transitionColor};
39
+ stroke-width: ${e.strokeWidth||1};
40
+ fill: none;
41
+ }
42
+
43
+ .stateGroup .composit {
44
+ fill: ${e.background};
45
+ border-bottom: 1px
46
+ }
47
+
48
+ .stateGroup .alt-composit {
49
+ fill: #e0e0e0;
50
+ border-bottom: 1px
51
+ }
52
+
53
+ .state-note {
54
+ stroke: ${e.noteBorderColor};
55
+ fill: ${e.noteBkgColor};
56
+
57
+ text {
58
+ fill: ${e.noteTextColor};
59
+ stroke: none;
60
+ font-size: 10px;
61
+ }
62
+ }
63
+
64
+ .stateLabel .box {
65
+ stroke: none;
66
+ stroke-width: 0;
67
+ fill: ${e.mainBkg};
68
+ opacity: 0.5;
69
+ }
70
+
71
+ .edgeLabel .label rect {
72
+ fill: ${e.labelBackgroundColor};
73
+ opacity: 0.5;
74
+ }
75
+ .edgeLabel {
76
+ background-color: ${e.edgeLabelBackground};
77
+ p {
78
+ background-color: ${e.edgeLabelBackground};
79
+ }
80
+ rect {
81
+ opacity: 0.5;
82
+ background-color: ${e.edgeLabelBackground};
83
+ fill: ${e.edgeLabelBackground};
84
+ }
85
+ text-align: center;
86
+ }
87
+ .edgeLabel .label text {
88
+ fill: ${e.transitionLabelColor||e.tertiaryTextColor};
89
+ }
90
+ .label div .edgeLabel {
91
+ color: ${e.transitionLabelColor||e.tertiaryTextColor};
92
+ }
93
+
94
+ .stateLabel text {
95
+ fill: ${e.stateLabelColor};
96
+ font-size: 10px;
97
+ font-weight: bold;
98
+ }
99
+
100
+ .node circle.state-start {
101
+ fill: ${e.specialStateColor};
102
+ stroke: ${e.specialStateColor};
103
+ }
104
+
105
+ .node .fork-join {
106
+ fill: ${e.specialStateColor};
107
+ stroke: ${e.specialStateColor};
108
+ }
109
+
110
+ .node circle.state-end {
111
+ fill: ${e.innerEndBackground};
112
+ stroke: ${e.background};
113
+ stroke-width: 1.5
114
+ }
115
+ .end-state-inner {
116
+ fill: ${e.compositeBackground||e.background};
117
+ // stroke: ${e.background};
118
+ stroke-width: 1.5
119
+ }
120
+
121
+ .node rect {
122
+ fill: ${e.stateBkg||e.mainBkg};
123
+ stroke: ${e.stateBorder||e.nodeBorder};
124
+ stroke-width: ${e.strokeWidth||1}px;
125
+ }
126
+ .node polygon {
127
+ fill: ${e.mainBkg};
128
+ stroke: ${e.stateBorder||e.nodeBorder};;
129
+ stroke-width: ${e.strokeWidth||1}px;
130
+ }
131
+ [id$="-barbEnd"] {
132
+ fill: ${e.lineColor};
133
+ }
134
+
135
+ .statediagram-cluster rect {
136
+ fill: ${e.compositeTitleBackground};
137
+ stroke: ${e.stateBorder||e.nodeBorder};
138
+ stroke-width: ${e.strokeWidth||1}px;
139
+ }
140
+
141
+ .cluster-label, .nodeLabel {
142
+ color: ${e.stateLabelColor};
143
+ // line-height: 1;
144
+ }
145
+
146
+ .statediagram-cluster rect.outer {
147
+ rx: 5px;
148
+ ry: 5px;
149
+ }
150
+ .statediagram-state .divider {
151
+ stroke: ${e.stateBorder||e.nodeBorder};
152
+ }
153
+
154
+ .statediagram-state .title-state {
155
+ rx: 5px;
156
+ ry: 5px;
157
+ }
158
+ .statediagram-cluster.statediagram-cluster .inner {
159
+ fill: ${e.compositeBackground||e.background};
160
+ }
161
+ .statediagram-cluster.statediagram-cluster-alt .inner {
162
+ fill: ${e.altBackground?e.altBackground:`#efefef`};
163
+ }
164
+
165
+ .statediagram-cluster .inner {
166
+ rx:0;
167
+ ry:0;
168
+ }
169
+
170
+ .statediagram-state rect.basic {
171
+ rx: 5px;
172
+ ry: 5px;
173
+ }
174
+ .statediagram-state rect.divider {
175
+ stroke-dasharray: 10,10;
176
+ fill: ${e.altBackground?e.altBackground:`#efefef`};
177
+ }
178
+
179
+ .note-edge {
180
+ stroke-dasharray: 5;
181
+ }
182
+
183
+ .statediagram-note rect {
184
+ fill: ${e.noteBkgColor};
185
+ stroke: ${e.noteBorderColor};
186
+ stroke-width: 1px;
187
+ rx: 0;
188
+ ry: 0;
189
+ }
190
+ .statediagram-note rect {
191
+ fill: ${e.noteBkgColor};
192
+ stroke: ${e.noteBorderColor};
193
+ stroke-width: 1px;
194
+ rx: 0;
195
+ ry: 0;
196
+ }
197
+
198
+ .statediagram-note text {
199
+ fill: ${e.noteTextColor};
200
+ }
201
+
202
+ .statediagram-note .nodeLabel {
203
+ color: ${e.noteTextColor};
204
+ }
205
+ .statediagram .edgeLabel {
206
+ color: red; // ${e.noteTextColor};
207
+ }
208
+
209
+ [id$="-dependencyStart"], [id$="-dependencyEnd"] {
210
+ fill: ${e.lineColor};
211
+ stroke: ${e.lineColor};
212
+ stroke-width: ${e.strokeWidth||1};
213
+ }
214
+
215
+ .statediagramTitleText {
216
+ text-anchor: middle;
217
+ font-size: 18px;
218
+ fill: ${e.textColor};
219
+ }
220
+
221
+ [data-look="neo"].statediagram-cluster rect {
222
+ fill: ${e.mainBkg};
223
+ stroke: ${e.useGradient?`url(`+e.svgId+`-gradient)`:e.stateBorder||e.nodeBorder};
224
+ stroke-width: ${e.strokeWidth??1};
225
+ }
226
+ [data-look="neo"].statediagram-cluster rect.outer {
227
+ rx: ${e.radius}px;
228
+ ry: ${e.radius}px;
229
+ filter: ${e.dropShadow?e.dropShadow.replace(`url(#drop-shadow)`,`url(${e.svgId}-drop-shadow)`):`none`}
230
+ }
231
+ `,`getStyles`);export{ue as i,me as n,he as r,_ as t};
@@ -0,0 +1 @@
1
+ import{t as e}from"./chunk-VELTKBKT-C9dVN39o.js";import{$ as t,Ct as n,Q as r}from"./index-C_xK08EW.js";import{A as i,B as a,C as o,E as s,F as c,G as l,K as u,N as d,O as f,R as p,S as m,W as h,a as g,d as _,g as ee,h as v,i as te,j as y,o as b,p as x,r as S,s as C,u as ne,v as w,x as T}from"./chunk-H3VCZNTA-IchcISDt.js";import{t as E}from"./chunk-HN6EAY2L-D7ZFMNrB.js";function D(e,t,n,r){var i;do i=p(r);while(e.hasNode(i));return n.dummy=t,e.setNode(i,n),i}e(D,`addDummyNode`);function re(e){var t=new E().setGraph(e.graph());return o(e.nodes(),function(n){t.setNode(n,e.node(n))}),o(e.edges(),function(n){var r=t.edge(n.v,n.w)||{weight:0,minlen:1},i=e.edge(n);t.setEdge(n.v,n.w,{weight:r.weight+i.weight,minlen:Math.max(r.minlen,i.minlen)})}),t}e(re,`simplify`);function O(e){var t=new E({multigraph:e.isMultigraph()}).setGraph(e.graph());return o(e.nodes(),function(n){e.children(n).length||t.setNode(n,e.node(n))}),o(e.edges(),function(n){t.setEdge(n,e.edge(n))}),t}e(O,`asNonCompoundGraph`);function k(e,t){var n=e.x,r=e.y,i=t.x-n,a=t.y-r,o=e.width/2,s=e.height/2;if(!i&&!a)throw Error(`Not possible to find intersection inside of the rectangle`);var c,l;return Math.abs(a)*o>Math.abs(i)*s?(a<0&&(s=-s),c=s*i/a,l=s):(i<0&&(o=-o),c=o,l=o*a/i),{x:n+c,y:r+l}}e(k,`intersectRect`);function A(e){var t=b(g(j(e)+1),function(){return[]});return o(e.nodes(),function(n){var r=e.node(n),i=r.rank;h(i)||(t[i][r.order]=n)}),t}e(A,`buildLayerMatrix`);function ie(e){var t=u(b(e.nodes(),function(t){return e.node(t).rank}));o(e.nodes(),function(n){var r=e.node(n);i(r,`rank`)&&(r.rank-=t)})}e(ie,`normalizeRanks`);function ae(e){var t=u(b(e.nodes(),function(t){return e.node(t).rank})),n=[];o(e.nodes(),function(r){var i=e.node(r).rank-t;n[i]||(n[i]=[]),n[i].push(r)});var r=0,i=e.graph().nodeRankFactor;o(n,function(t,n){h(t)&&n%i!==0?--r:r&&o(t,function(t){e.node(t).rank+=r})})}e(ae,`removeEmptyRanks`);function oe(e,t,n,r){var i={width:0,height:0};return arguments.length>=4&&(i.rank=n,i.order=r),D(e,`border`,i,t)}e(oe,`addBorderNode`);function j(e){return s(b(e.nodes(),function(t){var n=e.node(t).rank;if(!h(n))return n}))}e(j,`maxRank`);function se(e,t){var n={lhs:[],rhs:[]};return o(e,function(e){t(e)?n.lhs.push(e):n.rhs.push(e)}),n}e(se,`partition`);function ce(e,t){var n=ee();try{return t()}finally{console.log(e+` time: `+(ee()-n)+`ms`)}}e(ce,`time`);function le(e,t){return t()}e(le,`notime`);function ue(t){function n(e){var r=t.children(e),i=t.node(e);if(r.length&&o(r,n),Object.prototype.hasOwnProperty.call(i,`minRank`)){i.borderLeft=[],i.borderRight=[];for(var a=i.minRank,s=i.maxRank+1;a<s;++a)M(t,`borderLeft`,`_bl`,e,i,a),M(t,`borderRight`,`_br`,e,i,a)}}e(n,`dfs`),o(t.children(),n)}e(ue,`addBorderSegments`);function M(e,t,n,r,i,a){var o={width:0,height:0,rank:a,borderType:t},s=i[t][a-1],c=D(e,`border`,o,n);i[t][a]=c,e.setParent(c,r),s&&e.setEdge(s,c,{weight:1})}e(M,`addBorderNode`);function de(e){var t=e.graph().rankdir.toLowerCase();(t===`lr`||t===`rl`)&&N(e)}e(de,`adjust`);function fe(e){var t=e.graph().rankdir.toLowerCase();(t===`bt`||t===`rl`)&&pe(e),(t===`lr`||t===`rl`)&&(me(e),N(e))}e(fe,`undo`);function N(e){o(e.nodes(),function(t){P(e.node(t))}),o(e.edges(),function(t){P(e.edge(t))})}e(N,`swapWidthHeight`);function P(e){var t=e.width;e.width=e.height,e.height=t}e(P,`swapWidthHeightOne`);function pe(e){o(e.nodes(),function(t){F(e.node(t))}),o(e.edges(),function(t){var n=e.edge(t);o(n.points,F),Object.prototype.hasOwnProperty.call(n,`y`)&&F(n)})}e(pe,`reverseY`);function F(e){e.y=-e.y}e(F,`reverseYOne`);function me(e){o(e.nodes(),function(t){I(e.node(t))}),o(e.edges(),function(t){var n=e.edge(t);o(n.points,I),Object.prototype.hasOwnProperty.call(n,`x`)&&I(n)})}e(me,`swapXY`);function I(e){var t=e.x;e.x=e.y,e.y=t}e(I,`swapXYOne`);var he=class{static{e(this,`List`)}constructor(){var e={};e._next=e._prev=e,this._sentinel=e}dequeue(){var e=this._sentinel,t=e._prev;if(t!==e)return L(t),t}enqueue(e){var t=this._sentinel;e._prev&&e._next&&L(e),e._next=t._next,t._next._prev=e,t._next=e,e._prev=t}toString(){for(var e=[],t=this._sentinel,n=t._prev;n!==t;)e.push(JSON.stringify(n,ge)),n=n._prev;return`[`+e.join(`, `)+`]`}};function L(e){e._prev._next=e._next,e._next._prev=e._prev,delete e._next,delete e._prev}e(L,`unlink`);function ge(e,t){if(e!==`_next`&&e!==`_prev`)return t}e(ge,`filterOutLinks`);var _e=r(1);function ve(e,t){if(e.nodeCount()<=1)return[];var n=be(e,t||_e);return x(b(ye(n.graph,n.buckets,n.zeroIdx),function(t){return e.outEdges(t.v,t.w)}))}e(ve,`greedyFAS`);function ye(e,t,n){for(var r=[],i=t[t.length-1],a=t[0],o;e.nodeCount();){for(;o=a.dequeue();)R(e,t,n,o);for(;o=i.dequeue();)R(e,t,n,o);if(e.nodeCount()){for(var s=t.length-2;s>0;--s)if(o=t[s].dequeue(),o){r=r.concat(R(e,t,n,o,!0));break}}}return r}e(ye,`doGreedyFAS`);function R(e,t,n,r,i){var a=i?[]:void 0;return o(e.inEdges(r.v),function(r){var o=e.edge(r),s=e.node(r.v);i&&a.push({v:r.v,w:r.w}),s.out-=o,z(t,n,s)}),o(e.outEdges(r.v),function(r){var i=e.edge(r),a=r.w,o=e.node(a);o.in-=i,z(t,n,o)}),e.removeNode(r.v),a}e(R,`removeNode`);function be(e,t){var n=new E,r=0,i=0;o(e.nodes(),function(e){n.setNode(e,{v:e,in:0,out:0})}),o(e.edges(),function(e){var a=n.edge(e.v,e.w)||0,o=t(e),s=a+o;n.setEdge(e.v,e.w,s),i=Math.max(i,n.node(e.v).out+=o),r=Math.max(r,n.node(e.w).in+=o)});var a=g(i+r+3).map(function(){return new he}),s=r+1;return o(n.nodes(),function(e){z(a,s,n.node(e))}),{graph:n,buckets:a,zeroIdx:s}}e(be,`buildState`);function z(e,t,n){n.out?n.in?e[n.out-n.in+t].enqueue(n):e[e.length-1].enqueue(n):e[0].enqueue(n)}e(z,`assignBucket`);function xe(t){o(t.graph().acyclicer===`greedy`?ve(t,n(t)):Se(t),function(e){var n=t.edge(e);t.removeEdge(e),n.forwardName=e.name,n.reversed=!0,t.setEdge(e.w,e.v,n,p(`rev`))});function n(e){return function(t){return e.edge(t).weight}}e(n,`weightFn`)}e(xe,`run`);function Se(t){var n=[],r={},i={};function a(e){Object.prototype.hasOwnProperty.call(i,e)||(i[e]=!0,r[e]=!0,o(t.outEdges(e),function(e){Object.prototype.hasOwnProperty.call(r,e.w)?n.push(e):a(e.w)}),delete r[e])}return e(a,`dfs`),o(t.nodes(),a),n}e(Se,`dfsFAS`);function Ce(e){o(e.edges(),function(t){var n=e.edge(t);if(n.reversed){e.removeEdge(t);var r=n.forwardName;delete n.reversed,delete n.forwardName,e.setEdge(t.w,t.v,n,r)}})}e(Ce,`undo`);function we(e){e.graph().dummyChains=[],o(e.edges(),function(t){Te(e,t)})}e(we,`run`);function Te(e,t){var n=t.v,r=e.node(n).rank,i=t.w,a=e.node(i).rank,o=t.name,s=e.edge(t),c=s.labelRank;if(a!==r+1){e.removeEdge(t);var l=void 0,u,d;for(d=0,++r;r<a;++d,++r)s.points=[],l={width:0,height:0,edgeLabel:s,edgeObj:t,rank:r},u=D(e,`edge`,l,`_d`),r===c&&(l.width=s.width,l.height=s.height,l.dummy=`edge-label`,l.labelpos=s.labelpos),e.setEdge(n,u,{weight:s.weight},o),d===0&&e.graph().dummyChains.push(u),n=u;e.setEdge(n,i,{weight:s.weight},o)}}e(Te,`normalizeEdge`);function Ee(e){o(e.graph().dummyChains,function(t){var n=e.node(t),r=n.edgeLabel,i;for(e.setEdge(n.edgeObj,r);n.dummy;)i=e.successors(t)[0],e.removeNode(t),r.points.push({x:n.x,y:n.y}),n.dummy===`edge-label`&&(r.x=n.x,r.y=n.y,r.width=n.width,r.height=n.height),t=i,n=e.node(t)})}e(Ee,`undo`);function B(t){var n={};function r(e){var i=t.node(e);if(Object.prototype.hasOwnProperty.call(n,e))return i.rank;n[e]=!0;var a=u(b(t.outEdges(e),function(e){return r(e.w)-t.edge(e).minlen}));return(a===1/0||a==null)&&(a=0),i.rank=a}e(r,`dfs`),o(t.sources(),r)}e(B,`longestPath`);function V(e,t){return e.node(t.w).rank-e.node(t.v).rank-e.edge(t).minlen}e(V,`slack`);function H(e){var t=new E({directed:!1}),n=e.nodes()[0],r=e.nodeCount();t.setNode(n,{});for(var i,a;De(t,e)<r;)i=Oe(t,e),a=t.hasNode(i.v)?V(e,i):-V(e,i),ke(t,e,a);return t}e(H,`feasibleTree`);function De(t,n){function r(e){o(n.nodeEdges(e),function(i){var a=i.v,o=e===a?i.w:a;!t.hasNode(o)&&!V(n,i)&&(t.setNode(o,{}),t.setEdge(e,o,{}),r(o))})}return e(r,`dfs`),o(t.nodes(),r),t.nodeCount()}e(De,`tightTree`);function Oe(e,t){return _(t.edges(),function(n){if(e.hasNode(n.v)!==e.hasNode(n.w))return V(t,n)})}e(Oe,`findMinSlackEdge`);function ke(e,t,n){o(e.nodes(),function(e){t.node(e).rank+=n})}e(ke,`shiftRanks`),r(1),r(1),Ae.CycleException=U;function Ae(t){var n={},r={},i=[];function a(e){if(Object.prototype.hasOwnProperty.call(r,e))throw new U;Object.prototype.hasOwnProperty.call(n,e)||(r[e]=!0,n[e]=!0,o(t.predecessors(e),a),delete r[e],i.push(e))}if(e(a,`visit`),o(t.sinks(),a),l(n)!==t.nodeCount())throw new U;return i}e(Ae,`topsort`);function U(){}e(U,`CycleException`),U.prototype=Error();function W(e,n,r){t(n)||(n=[n]);var i=(e.isDirected()?e.successors:e.neighbors).bind(e),a=[],s={};return o(n,function(t){if(!e.hasNode(t))throw Error(`Graph does not have node: `+t);G(e,t,r===`post`,s,i,a)}),a}e(W,`dfs`);function G(e,t,n,r,i,a){Object.prototype.hasOwnProperty.call(r,t)||(r[t]=!0,n||a.push(t),o(i(t),function(t){G(e,t,n,r,i,a)}),n&&a.push(t))}e(G,`doDfs`);function je(e,t){return W(e,t,`post`)}e(je,`postorder`);function Me(e,t){return W(e,t,`pre`)}e(Me,`preorder`),K.initLowLimValues=Y,K.initCutValues=q,K.calcCutValue=J,K.leaveEdge=Pe,K.enterEdge=Fe,K.exchangeEdges=Ie;function K(e){e=re(e),B(e);var t=H(e);Y(t),q(t,e);for(var n,r;n=Pe(t);)r=Fe(t,e,n),Ie(t,e,n,r)}e(K,`networkSimplex`);function q(e,t){var n=je(e,e.nodes());n=n.slice(0,n.length-1),o(n,function(n){Ne(e,t,n)})}e(q,`initCutValues`);function Ne(e,t,n){var r=e.node(n).parent;e.edge(n,r).cutvalue=J(e,t,n)}e(Ne,`assignCutValue`);function J(e,t,n){var r=e.node(n).parent,i=!0,a=t.edge(n,r),s=0;return a||=(i=!1,t.edge(r,n)),s=a.weight,o(t.nodeEdges(n),function(a){var o=a.v===n,c=o?a.w:a.v;if(c!==r){var l=o===i,u=t.edge(a).weight;if(s+=l?u:-u,Re(e,n,c)){var d=e.edge(n,c).cutvalue;s+=l?-d:d}}}),s}e(J,`calcCutValue`);function Y(e,t){arguments.length<2&&(t=e.nodes()[0]),X(e,{},1,t)}e(Y,`initLowLimValues`);function X(e,t,n,r,i){var a=n,s=e.node(r);return t[r]=!0,o(e.neighbors(r),function(i){Object.prototype.hasOwnProperty.call(t,i)||(n=X(e,t,n,i,r))}),s.low=a,s.lim=n++,i?s.parent=i:delete s.parent,n}e(X,`dfsAssignLowLim`);function Pe(e){return C(e.edges(),function(t){return e.edge(t).cutvalue<0})}e(Pe,`leaveEdge`);function Fe(e,t,n){var r=n.v,i=n.w;t.hasEdge(r,i)||(r=n.w,i=n.v);var a=e.node(r),o=e.node(i),s=a,c=!1;return a.lim>o.lim&&(s=o,c=!0),_(y(t.edges(),function(t){return c===ze(e,e.node(t.v),s)&&c!==ze(e,e.node(t.w),s)}),function(e){return V(t,e)})}e(Fe,`enterEdge`);function Ie(e,t,n,r){var i=n.v,a=n.w;e.removeEdge(i,a),e.setEdge(r.v,r.w,{}),Y(e),q(e,t),Le(e,t)}e(Ie,`exchangeEdges`);function Le(e,t){var n=Me(e,C(e.nodes(),function(e){return!t.node(e).parent}));n=n.slice(1),o(n,function(n){var r=e.node(n).parent,i=t.edge(n,r),a=!1;i||(i=t.edge(r,n),a=!0),t.node(n).rank=t.node(r).rank+(a?i.minlen:-i.minlen)})}e(Le,`updateRanks`);function Re(e,t,n){return e.hasEdge(t,n)}e(Re,`isTreeEdge`);function ze(e,t,n){return n.low<=t.lim&&t.lim<=n.lim}e(ze,`isDescendant`);function Be(e){switch(e.graph().ranker){case`network-simplex`:Z(e);break;case`tight-tree`:He(e);break;case`longest-path`:Ve(e);break;default:Z(e)}}e(Be,`rank`);var Ve=B;function He(e){B(e),H(e)}e(He,`tightTreeRanker`);function Z(e){K(e)}e(Z,`networkSimplexRanker`);function Ue(e){var t=D(e,`root`,{},`_root`),n=Ge(e),r=s(T(n))-1,i=2*r+1;e.graph().nestingRoot=t,o(e.edges(),function(t){e.edge(t).minlen*=i});var a=Ke(e)+1;o(e.children(),function(o){We(e,t,i,a,r,n,o)}),e.graph().nodeRankFactor=i}e(Ue,`run`);function We(e,t,n,r,i,a,s){var c=e.children(s);if(!c.length){s!==t&&e.setEdge(t,s,{weight:0,minlen:n});return}var l=oe(e,`_bt`),u=oe(e,`_bb`),d=e.node(s);e.setParent(l,s),d.borderTop=l,e.setParent(u,s),d.borderBottom=u,o(c,function(o){We(e,t,n,r,i,a,o);var c=e.node(o),d=c.borderTop?c.borderTop:o,f=c.borderBottom?c.borderBottom:o,p=c.borderTop?r:2*r,m=d===f?i-a[s]+1:1;e.setEdge(l,d,{weight:p,minlen:m,nestingEdge:!0}),e.setEdge(f,u,{weight:p,minlen:m,nestingEdge:!0})}),e.parent(s)||e.setEdge(t,l,{weight:0,minlen:i+a[s]})}e(We,`dfs`);function Ge(t){var n={};function r(e,i){var a=t.children(e);a&&a.length&&o(a,function(e){r(e,i+1)}),n[e]=i}return e(r,`dfs`),o(t.children(),function(e){r(e,1)}),n}e(Ge,`treeDepths`);function Ke(e){return v(e.edges(),function(t,n){return t+e.edge(n).weight},0)}e(Ke,`sumWeights`);function qe(e){var t=e.graph();e.removeNode(t.nestingRoot),delete t.nestingRoot,o(e.edges(),function(t){e.edge(t).nestingEdge&&e.removeEdge(t)})}e(qe,`cleanup`);function Je(e,t,n){var r={},i;o(n,function(n){for(var a=e.parent(n),o,s;a;){if(o=e.parent(a),o?(s=r[o],r[o]=a):(s=i,i=a),s&&s!==a){t.setEdge(s,a);return}a=o}})}e(Je,`addSubgraphConstraints`);function Ye(e,t,n){var r=Xe(e),i=new E({compound:!0}).setGraph({root:r}).setDefaultNodeLabel(function(t){return e.node(t)});return o(e.nodes(),function(a){var s=e.node(a),c=e.parent(a);(s.rank===t||s.minRank<=t&&t<=s.maxRank)&&(i.setNode(a),i.setParent(a,c||r),o(e[n](a),function(t){var n=t.v===a?t.w:t.v,r=i.edge(n,a),o=h(r)?0:r.weight;i.setEdge(n,a,{weight:e.edge(t).weight+o})}),Object.prototype.hasOwnProperty.call(s,`minRank`)&&i.setNode(a,{borderLeft:s.borderLeft[t],borderRight:s.borderRight[t]}))}),i}e(Ye,`buildLayerGraph`);function Xe(e){for(var t;e.hasNode(t=p(`_root`)););return t}e(Xe,`createRootNode`);function Ze(e,t){for(var n=0,r=1;r<t.length;++r)n+=Qe(e,t[r-1],t[r]);return n}e(Ze,`crossCount`);function Qe(e,t,n){for(var r=d(n,b(n,function(e,t){return t})),i=x(b(t,function(t){return a(b(e.outEdges(t),function(t){return{pos:r[t.w],weight:e.edge(t).weight}}),`pos`)})),s=1;s<n.length;)s<<=1;var c=2*s-1;--s;var l=b(Array(c),function(){return 0}),u=0;return o(i.forEach(function(e){var t=e.pos+s;l[t]+=e.weight;for(var n=0;t>0;)t%2&&(n+=l[t+1]),t=t-1>>1,l[t]+=e.weight;u+=e.weight*n})),u}e(Qe,`twoLayerCrossCount`);function $e(t){var n={},r=y(t.nodes(),function(e){return!t.children(e).length}),c=b(g(s(b(r,function(e){return t.node(e).rank}))+1),function(){return[]});function l(e){i(n,e)||(n[e]=!0,c[t.node(e).rank].push(e),o(t.successors(e),l))}return e(l,`dfs`),o(a(r,function(e){return t.node(e).rank}),l),c}e($e,`initOrder`);function et(e,t){return b(t,function(t){var n=e.inEdges(t);if(n.length){var r=v(n,function(t,n){var r=e.edge(n),i=e.node(n.v);return{sum:t.sum+r.weight*i.order,weight:t.weight+r.weight}},{sum:0,weight:0});return{v:t,barycenter:r.sum/r.weight,weight:r.weight}}else return{v:t}})}e(et,`barycenter`);function tt(e,t){var n={};return o(e,function(e,t){var r=n[e.v]={indegree:0,in:[],out:[],vs:[e.v],i:t};h(e.barycenter)||(r.barycenter=e.barycenter,r.weight=e.weight)}),o(t.edges(),function(e){var t=n[e.v],r=n[e.w];!h(t)&&!h(r)&&(r.indegree++,t.out.push(n[e.w]))}),nt(y(n,function(e){return!e.indegree}))}e(tt,`resolveConflicts`);function nt(t){var n=[];function r(e){return function(t){t.merged||(h(t.barycenter)||h(e.barycenter)||t.barycenter>=e.barycenter)&&rt(e,t)}}e(r,`handleIn`);function i(e){return function(n){n.in.push(e),--n.indegree===0&&t.push(n)}}for(e(i,`handleOut`);t.length;){var a=t.pop();n.push(a),o(a.in.reverse(),r(a)),o(a.out,i(a))}return b(y(n,function(e){return!e.merged}),function(e){return w(e,[`vs`,`i`,`barycenter`,`weight`])})}e(nt,`doResolveConflicts`);function rt(e,t){var n=0,r=0;e.weight&&(n+=e.barycenter*e.weight,r+=e.weight),t.weight&&(n+=t.barycenter*t.weight,r+=t.weight),e.vs=t.vs.concat(e.vs),e.barycenter=n/r,e.weight=r,e.i=Math.min(t.i,e.i),t.merged=!0}e(rt,`mergeEntries`);function it(e,t){var n=se(e,function(e){return Object.prototype.hasOwnProperty.call(e,`barycenter`)}),r=n.lhs,i=a(n.rhs,function(e){return-e.i}),s=[],c=0,l=0,u=0;r.sort(ot(!!t)),u=at(s,i,u),o(r,function(e){u+=e.vs.length,s.push(e.vs),c+=e.barycenter*e.weight,l+=e.weight,u=at(s,i,u)});var d={vs:x(s)};return l&&(d.barycenter=c/l,d.weight=l),d}e(it,`sort`);function at(e,t,n){for(var r;t.length&&(r=S(t)).i<=n;)t.pop(),e.push(r.vs),n++;return n}e(at,`consumeUnsortable`);function ot(e){return function(t,n){return t.barycenter<n.barycenter?-1:t.barycenter>n.barycenter?1:e?n.i-t.i:t.i-n.i}}e(ot,`compareWithBias`);function st(e,t,n,r){var i=e.children(t),a=e.node(t),s=a?a.borderLeft:void 0,c=a?a.borderRight:void 0,l={};s&&(i=y(i,function(e){return e!==s&&e!==c}));var u=et(e,i);o(u,function(t){if(e.children(t.v).length){var i=st(e,t.v,n,r);l[t.v]=i,Object.prototype.hasOwnProperty.call(i,`barycenter`)&&lt(t,i)}});var d=tt(u,n);ct(d,l);var f=it(d,r);if(s&&(f.vs=x([s,f.vs,c]),e.predecessors(s).length)){var p=e.node(e.predecessors(s)[0]),m=e.node(e.predecessors(c)[0]);Object.prototype.hasOwnProperty.call(f,`barycenter`)||(f.barycenter=0,f.weight=0),f.barycenter=(f.barycenter*f.weight+p.order+m.order)/(f.weight+2),f.weight+=2}return f}e(st,`sortSubgraph`);function ct(e,t){o(e,function(e){e.vs=x(e.vs.map(function(e){return t[e]?t[e].vs:e}))})}e(ct,`expandSubgraphs`);function lt(e,t){h(e.barycenter)?(e.barycenter=t.barycenter,e.weight=t.weight):(e.barycenter=(e.barycenter*e.weight+t.barycenter*t.weight)/(e.weight+t.weight),e.weight+=t.weight)}e(lt,`mergeBarycenters`);function ut(e){var t=j(e),n=dt(e,g(1,t+1),`inEdges`),r=dt(e,g(t-1,-1,-1),`outEdges`),i=$e(e);pt(e,i);for(var a=1/0,o,s=0,l=0;l<4;++s,++l){ft(s%2?n:r,s%4>=2),i=A(e);var u=Ze(e,i);u<a&&(l=0,o=c(i),a=u)}pt(e,o)}e(ut,`order`);function dt(e,t,n){return b(t,function(t){return Ye(e,t,n)})}e(dt,`buildLayerGraphs`);function ft(e,t){var n=new E;o(e,function(e){var r=e.graph().root,i=st(e,r,n,t);o(i.vs,function(t,n){e.node(t).order=n}),Je(e,n,i.vs)})}e(ft,`sweepLayerGraphs`);function pt(e,t){o(t,function(t){o(t,function(t,n){e.node(t).order=n})})}e(pt,`assignOrder`);function mt(e){var t=gt(e);o(e.graph().dummyChains,function(n){for(var r=e.node(n),i=r.edgeObj,a=ht(e,t,i.v,i.w),o=a.path,s=a.lca,c=0,l=o[c],u=!0;n!==i.w;){if(r=e.node(n),u){for(;(l=o[c])!==s&&e.node(l).maxRank<r.rank;)c++;l===s&&(u=!1)}if(!u){for(;c<o.length-1&&e.node(l=o[c+1]).minRank<=r.rank;)c++;l=o[c]}e.setParent(n,l),n=e.successors(n)[0]}})}e(mt,`parentDummyChains`);function ht(e,t,n,r){var i=[],a=[],o=Math.min(t[n].low,t[r].low),s=Math.max(t[n].lim,t[r].lim),c=n,l;do c=e.parent(c),i.push(c);while(c&&(t[c].low>o||s>t[c].lim));for(l=c,c=r;(c=e.parent(c))!==l;)a.push(c);return{path:i.concat(a.reverse()),lca:l}}e(ht,`findPath`);function gt(t){var n={},r=0;function i(e){var a=r;o(t.children(e),i),n[e]={low:a,lim:r++}}return e(i,`dfs`),o(t.children(),i),n}e(gt,`postorder`);function _t(t,n){var r={};function i(e,n){var i=0,a=0,s=e.length,c=S(n);return o(n,function(e,l){var u=yt(t,e),d=u?t.node(u).order:s;(u||e===c)&&(o(n.slice(a,l+1),function(e){o(t.predecessors(e),function(n){var a=t.node(n),o=a.order;(o<i||d<o)&&!(a.dummy&&t.node(e).dummy)&&bt(r,n,e)})}),a=l+1,i=d)}),n}return e(i,`visitLayer`),v(n,i),r}e(_t,`findType1Conflicts`);function vt(t,n){var r={};function i(e,n,i,a,s){var c;o(g(n,i),function(n){c=e[n],t.node(c).dummy&&o(t.predecessors(c),function(e){var n=t.node(e);n.dummy&&(n.order<a||n.order>s)&&bt(r,e,c)})})}e(i,`scan`);function a(e,n){var r=-1,a,s=0;return o(n,function(o,c){if(t.node(o).dummy===`border`){var l=t.predecessors(o);l.length&&(a=t.node(l[0]).order,i(n,s,c,r,a),s=c,r=a)}i(n,s,n.length,a,e.length)}),n}return e(a,`visitLayer`),v(n,a),r}e(vt,`findType2Conflicts`);function yt(e,t){if(e.node(t).dummy)return C(e.predecessors(t),function(t){return e.node(t).dummy})}e(yt,`findOtherInnerSegmentNode`);function bt(e,t,n){if(t>n){var r=t;t=n,n=r}Object.prototype.hasOwnProperty.call(e,t)||Object.defineProperty(e,t,{enumerable:!0,configurable:!0,value:{},writable:!0});var i=e[t];Object.defineProperty(i,n,{enumerable:!0,configurable:!0,value:!0,writable:!0})}e(bt,`addConflict`);function xt(e,t,n){if(t>n){var r=t;t=n,n=r}return!!e[t]&&Object.prototype.hasOwnProperty.call(e[t],n)}e(xt,`hasConflict`);function St(e,t,n,r){var i={},s={},c={};return o(t,function(e){o(e,function(e,t){i[e]=e,s[e]=e,c[e]=t})}),o(t,function(e){var t=-1;o(e,function(e){var o=r(e);if(o.length){o=a(o,function(e){return c[e]});for(var l=(o.length-1)/2,u=Math.floor(l),d=Math.ceil(l);u<=d;++u){var f=o[u];s[e]===e&&t<c[f]&&!xt(n,e,f)&&(s[f]=e,s[e]=i[e]=i[f],t=c[f])}}})}),{root:i,align:s}}e(St,`verticalAlignment`);function Ct(t,n,r,i,a){var s={},c=wt(t,n,r,a),l=a?`borderLeft`:`borderRight`;function u(e,t){for(var n=c.nodes(),r=n.pop(),i={};r;)i[r]?e(r):(i[r]=!0,n.push(r),n=n.concat(t(r))),r=n.pop()}e(u,`iterate`);function d(e){s[e]=c.inEdges(e).reduce(function(e,t){return Math.max(e,s[t.v]+c.edge(t))},0)}e(d,`pass1`);function f(e){var n=c.outEdges(e).reduce(function(e,t){return Math.min(e,s[t.w]-c.edge(t))},1/0),r=t.node(e);n!==1/0&&r.borderType!==l&&(s[e]=Math.max(s[e],n))}return e(f,`pass2`),u(d,c.predecessors.bind(c)),u(f,c.successors.bind(c)),o(i,function(e){s[e]=s[r[e]]}),s}e(Ct,`horizontalCompaction`);function wt(e,t,n,r){var i=new E,a=e.graph(),s=kt(a.nodesep,a.edgesep,r);return o(t,function(t){var r;o(t,function(t){var a=n[t];if(i.setNode(a),r){var o=n[r],c=i.edge(o,a);i.setEdge(o,a,Math.max(s(e,t,r),c||0))}r=t})}),i}e(wt,`buildBlockGraph`);function Tt(e,t){return _(T(t),function(t){var n=-1/0,r=1/0;return m(t,function(t,i){var a=At(e,i)/2;n=Math.max(t+a,n),r=Math.min(t-a,r)}),n-r})}e(Tt,`findSmallestWidthAlignment`);function Et(e,t){var n=T(t),r=u(n),i=s(n);o([`u`,`d`],function(n){o([`l`,`r`],function(a){var o=n+a,c=e[o],l;if(c!==t){var d=T(c);l=a===`l`?r-u(d):i-s(d),l&&(e[o]=f(c,function(e){return e+l}))}})})}e(Et,`alignCoordinates`);function Dt(e,t){return f(e.ul,function(n,r){if(t)return e[t.toLowerCase()][r];var i=a(b(e,r));return(i[1]+i[2])/2})}e(Dt,`balance`);function Ot(e){var t=A(e),r=n(_t(e,t),vt(e,t)),i={},a;return o([`u`,`d`],function(n){a=n===`u`?t:T(t).reverse(),o([`l`,`r`],function(t){t===`r`&&(a=b(a,function(e){return T(e).reverse()}));var o=(n===`u`?e.predecessors:e.successors).bind(e),s=St(e,a,r,o),c=Ct(e,a,s.root,s.align,t===`r`);t===`r`&&(c=f(c,function(e){return-e})),i[n+t]=c})}),Et(i,Tt(e,i)),Dt(i,e.graph().align)}e(Ot,`positionX`);function kt(e,t,n){return function(r,i,a){var o=r.node(i),s=r.node(a),c=0,l;if(c+=o.width/2,Object.prototype.hasOwnProperty.call(o,`labelpos`))switch(o.labelpos.toLowerCase()){case`l`:l=-o.width/2;break;case`r`:l=o.width/2;break}if(l&&(c+=n?l:-l),l=0,c+=(o.dummy?t:e)/2,c+=(s.dummy?t:e)/2,c+=s.width/2,Object.prototype.hasOwnProperty.call(s,`labelpos`))switch(s.labelpos.toLowerCase()){case`l`:l=s.width/2;break;case`r`:l=-s.width/2;break}return l&&(c+=n?l:-l),l=0,c}}e(kt,`sep`);function At(e,t){return e.node(t).width}e(At,`width`);function jt(e){e=O(e),Mt(e),te(Ot(e),function(t,n){e.node(n).x=t})}e(jt,`position`);function Mt(e){var t=A(e),n=e.graph().ranksep,r=0;o(t,function(t){var i=s(b(t,function(t){return e.node(t).height}));o(t,function(t){e.node(t).y=r+i/2}),r+=i+n})}e(Mt,`positionY`);function Nt(e,t){var n=t&&t.debugTiming?ce:le;n(`layout`,()=>{var t=n(` buildLayoutGraph`,()=>Wt(e));n(` runLayout`,()=>Pt(t,n)),n(` updateInputGraph`,()=>Ft(e,t))})}e(Nt,`layout`);function Pt(e,t){t(` makeSpaceForEdgeLabels`,()=>Gt(e)),t(` removeSelfEdges`,()=>en(e)),t(` acyclic`,()=>xe(e)),t(` nestingGraph.run`,()=>Ue(e)),t(` rank`,()=>Be(O(e))),t(` injectEdgeLabelProxies`,()=>Kt(e)),t(` removeEmptyRanks`,()=>ae(e)),t(` nestingGraph.cleanup`,()=>qe(e)),t(` normalizeRanks`,()=>ie(e)),t(` assignRankMinMax`,()=>qt(e)),t(` removeEdgeLabelProxies`,()=>Jt(e)),t(` normalize.run`,()=>we(e)),t(` parentDummyChains`,()=>mt(e)),t(` addBorderSegments`,()=>ue(e)),t(` order`,()=>ut(e)),t(` insertSelfEdges`,()=>tn(e)),t(` adjustCoordinateSystem`,()=>de(e)),t(` position`,()=>jt(e)),t(` positionSelfEdges`,()=>nn(e)),t(` removeBorderNodes`,()=>$t(e)),t(` normalize.undo`,()=>Ee(e)),t(` fixupEdgeLabelCoords`,()=>Zt(e)),t(` undoCoordinateSystem`,()=>fe(e)),t(` translateGraph`,()=>Yt(e)),t(` assignNodeIntersects`,()=>Xt(e)),t(` reversePoints`,()=>Qt(e)),t(` acyclic.undo`,()=>Ce(e))}e(Pt,`runLayout`);function Ft(e,t){o(e.nodes(),function(n){var r=e.node(n),i=t.node(n);r&&(r.x=i.x,r.y=i.y,t.children(n).length&&(r.width=i.width,r.height=i.height))}),o(e.edges(),function(n){var r=e.edge(n),i=t.edge(n);r.points=i.points,Object.prototype.hasOwnProperty.call(i,`x`)&&(r.x=i.x,r.y=i.y)}),e.graph().width=t.graph().width,e.graph().height=t.graph().height}e(Ft,`updateInputGraph`);var It=[`nodesep`,`edgesep`,`ranksep`,`marginx`,`marginy`],Lt={ranksep:50,edgesep:20,nodesep:50,rankdir:`tb`},Rt=[`acyclicer`,`ranker`,`rankdir`,`align`],zt=[`width`,`height`],Bt={width:0,height:0},Vt=[`minlen`,`weight`,`width`,`height`,`labeloffset`],Ht={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:`r`},Ut=[`labelpos`];function Wt(e){var t=new E({multigraph:!0,compound:!0}),r=$(e.graph());return t.setGraph(n({},Lt,Q(r,It),w(r,Rt))),o(e.nodes(),function(n){var r=$(e.node(n));t.setNode(n,ne(Q(r,zt),Bt)),t.setParent(n,e.parent(n))}),o(e.edges(),function(r){var i=$(e.edge(r));t.setEdge(r,n({},Ht,Q(i,Vt),w(i,Ut)))}),t}e(Wt,`buildLayoutGraph`);function Gt(e){var t=e.graph();t.ranksep/=2,o(e.edges(),function(n){var r=e.edge(n);r.minlen*=2,r.labelpos.toLowerCase()!==`c`&&(t.rankdir===`TB`||t.rankdir===`BT`?r.width+=r.labeloffset:r.height+=r.labeloffset)})}e(Gt,`makeSpaceForEdgeLabels`);function Kt(e){o(e.edges(),function(t){var n=e.edge(t);if(n.width&&n.height){var r=e.node(t.v);D(e,`edge-proxy`,{rank:(e.node(t.w).rank-r.rank)/2+r.rank,e:t},`_ep`)}})}e(Kt,`injectEdgeLabelProxies`);function qt(e){var t=0;o(e.nodes(),function(n){var r=e.node(n);r.borderTop&&(r.minRank=e.node(r.borderTop).rank,r.maxRank=e.node(r.borderBottom).rank,t=s(t,r.maxRank))}),e.graph().maxRank=t}e(qt,`assignRankMinMax`);function Jt(e){o(e.nodes(),function(t){var n=e.node(t);n.dummy===`edge-proxy`&&(e.edge(n.e).labelRank=n.rank,e.removeNode(t))})}e(Jt,`removeEdgeLabelProxies`);function Yt(t){var n=1/0,r=0,i=1/0,a=0,s=t.graph(),c=s.marginx||0,l=s.marginy||0;function u(e){var t=e.x,o=e.y,s=e.width,c=e.height;n=Math.min(n,t-s/2),r=Math.max(r,t+s/2),i=Math.min(i,o-c/2),a=Math.max(a,o+c/2)}e(u,`getExtremes`),o(t.nodes(),function(e){u(t.node(e))}),o(t.edges(),function(e){var n=t.edge(e);Object.prototype.hasOwnProperty.call(n,`x`)&&u(n)}),n-=c,i-=l,o(t.nodes(),function(e){var r=t.node(e);r.x-=n,r.y-=i}),o(t.edges(),function(e){var r=t.edge(e);o(r.points,function(e){e.x-=n,e.y-=i}),Object.prototype.hasOwnProperty.call(r,`x`)&&(r.x-=n),Object.prototype.hasOwnProperty.call(r,`y`)&&(r.y-=i)}),s.width=r-n+c,s.height=a-i+l}e(Yt,`translateGraph`);function Xt(e){o(e.edges(),function(t){var n=e.edge(t),r=e.node(t.v),i=e.node(t.w),a,o;n.points?(a=n.points[0],o=n.points[n.points.length-1]):(n.points=[],a=i,o=r),n.points.unshift(k(r,a)),n.points.push(k(i,o))})}e(Xt,`assignNodeIntersects`);function Zt(e){o(e.edges(),function(t){var n=e.edge(t);if(Object.prototype.hasOwnProperty.call(n,`x`))switch((n.labelpos===`l`||n.labelpos===`r`)&&(n.width-=n.labeloffset),n.labelpos){case`l`:n.x-=n.width/2+n.labeloffset;break;case`r`:n.x+=n.width/2+n.labeloffset;break}})}e(Zt,`fixupEdgeLabelCoords`);function Qt(e){o(e.edges(),function(t){var n=e.edge(t);n.reversed&&n.points.reverse()})}e(Qt,`reversePointsForReversedEdges`);function $t(e){o(e.nodes(),function(t){if(e.children(t).length){var n=e.node(t),r=e.node(n.borderTop),i=e.node(n.borderBottom),a=e.node(S(n.borderLeft)),o=e.node(S(n.borderRight));n.width=Math.abs(o.x-a.x),n.height=Math.abs(i.y-r.y),n.x=a.x+n.width/2,n.y=r.y+n.height/2}}),o(e.nodes(),function(t){e.node(t).dummy===`border`&&e.removeNode(t)})}e($t,`removeBorderNodes`);function en(e){o(e.edges(),function(t){if(t.v===t.w){var n=e.node(t.v);n.selfEdges||=[],n.selfEdges.push({e:t,label:e.edge(t)}),e.removeEdge(t)}})}e(en,`removeSelfEdges`);function tn(e){o(A(e),function(t){var n=0;o(t,function(t,r){var i=e.node(t);i.order=r+n,o(i.selfEdges,function(t){D(e,`selfedge`,{width:t.label.width,height:t.label.height,rank:i.rank,order:r+ ++n,e:t.e,label:t.label},`_se`)}),delete i.selfEdges})})}e(tn,`insertSelfEdges`);function nn(e){o(e.nodes(),function(t){var n=e.node(t);if(n.dummy===`selfedge`){var r=e.node(n.e.v),i=r.x+r.width/2,a=r.y,o=n.x-i,s=r.height/2;e.setEdge(n.e,n.label),e.removeNode(t),n.label.points=[{x:i+2*o/3,y:a-s},{x:i+5*o/6,y:a-s},{x:i+o,y:a},{x:i+5*o/6,y:a+s},{x:i+2*o/3,y:a+s}],n.label.x=n.x,n.label.y=n.y}})}e(nn,`positionSelfEdges`);function Q(e,t){return f(w(e,t),Number)}e(Q,`selectNumberAttrs`);function $(e){var t={};return o(e,function(e,n){t[n.toLowerCase()]=e}),t}e($,`canonicalize`);export{Nt as t};
@@ -0,0 +1 @@
1
+ import{t as e}from"./chunk-VELTKBKT-C9dVN39o.js";import{a as t,c as n,d as r,g as i,n as a,o,p as s,s as c,u as l}from"./chunk-FXACKDTF-uhhi2PC2.js";var u=class extends i{static{e(this,`PieTokenBuilder`)}static{o(this,`PieTokenBuilder`)}constructor(){super([`pie`,`showData`])}},d=class extends s{static{e(this,`PieValueConverter`)}static{o(this,`PieValueConverter`)}runCustomConverter(e,t,n){if(e.name===`PIE_SECTION_LABEL`)return t.replace(/"/g,``).trim()}},f={parser:{TokenBuilder:o(()=>new u,`TokenBuilder`),ValueConverter:o(()=>new d,`ValueConverter`)}};function p(e=c){let i=n(a(e),l),o=n(t({shared:i}),r,f);return i.ServiceRegistry.register(o),{shared:i,Pie:o}}e(p,`createPieServices`),o(p,`createPieServices`);export{f as n,p as t};