@eeshaai/code 0.0.1 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (129) hide show
  1. package/LICENSE.md +115 -0
  2. package/README.md +322 -0
  3. package/dist/THIRD-PARTY-NOTICES.md +23 -0
  4. package/dist/claude-agent-sdk/LICENSE.md +1 -0
  5. package/dist/claude-agent-sdk/sdk.mjs +156 -0
  6. package/dist/cli.js +23 -0
  7. package/dist/pluginWorker.js +1610 -0
  8. package/dist/resources/styles/custom/instructions/design.md +284 -0
  9. package/dist/resources/styles/custom/instructions/requirements.md +161 -0
  10. package/dist/resources/styles/custom/instructions/tasks-implement.md +90 -0
  11. package/dist/resources/styles/custom/instructions/tasks.md +159 -0
  12. package/dist/resources/styles/custom/process.md +49 -0
  13. package/dist/resources/styles/custom/prompts/first.md +29 -0
  14. package/dist/resources/styles/custom/prompts/implement.md +27 -0
  15. package/dist/resources/styles/custom/prompts/rewrite-note.md +40 -0
  16. package/dist/resources/styles/custom/prompts/rewrite.md +32 -0
  17. package/dist/resources/styles/custom/style.yml +46 -0
  18. package/dist/resources/styles/grammar.md +731 -0
  19. package/dist/server.js +839 -0
  20. package/dist/web/chunks/abnfDiagram-VCTEODGH-6KC3BO47.js +2 -0
  21. package/dist/web/chunks/architecture-7GRP2DOG-JLXNDD4H.js +2 -0
  22. package/dist/web/chunks/architectureDiagram-5GKGNRK7-QKPCVOD2.js +37 -0
  23. package/dist/web/chunks/blockDiagram-I7D4REHJ-4XZWNXLB.js +130 -0
  24. package/dist/web/chunks/c4Diagram-7LVT6UL2-4HJHKNE3.js +39 -0
  25. package/dist/web/chunks/chunk-2DLEMZHM.js +33 -0
  26. package/dist/web/chunks/chunk-2RFQIKC6.js +232 -0
  27. package/dist/web/chunks/chunk-37NHO5VO.js +2 -0
  28. package/dist/web/chunks/chunk-46RPN6IE.js +3 -0
  29. package/dist/web/chunks/chunk-4IPDIKAU.js +2 -0
  30. package/dist/web/chunks/chunk-4KP3BIPB.js +2 -0
  31. package/dist/web/chunks/chunk-4S2DRQJ6.js +340 -0
  32. package/dist/web/chunks/chunk-4TORDSRR.js +2 -0
  33. package/dist/web/chunks/chunk-5KNOHX5X.js +15 -0
  34. package/dist/web/chunks/chunk-6FQEBIA3.js +133 -0
  35. package/dist/web/chunks/chunk-6KSWTVXD.js +3 -0
  36. package/dist/web/chunks/chunk-6TGTE6CF.js +2 -0
  37. package/dist/web/chunks/chunk-6URXM4C4.js +2 -0
  38. package/dist/web/chunks/chunk-6VRLULJH.js +2 -0
  39. package/dist/web/chunks/chunk-7XAOOQR4.js +2 -0
  40. package/dist/web/chunks/chunk-BUZPUGIT.js +2 -0
  41. package/dist/web/chunks/chunk-DIRT34TZ.js +2 -0
  42. package/dist/web/chunks/chunk-FGASMJTA.js +4 -0
  43. package/dist/web/chunks/chunk-FNIFXWXL.js +2 -0
  44. package/dist/web/chunks/chunk-FPLIRG3U.js +73 -0
  45. package/dist/web/chunks/chunk-GQPX4EIC.js +11 -0
  46. package/dist/web/chunks/chunk-HAKJ3AUV.js +2 -0
  47. package/dist/web/chunks/chunk-HBEUVMXY.js +2 -0
  48. package/dist/web/chunks/chunk-HNYXDXPN.js +63 -0
  49. package/dist/web/chunks/chunk-HX7W7GSO.js +2 -0
  50. package/dist/web/chunks/chunk-II6WN3ZG.js +2 -0
  51. package/dist/web/chunks/chunk-JOSXY3EP.js +169 -0
  52. package/dist/web/chunks/chunk-L34PKG4P.js +2 -0
  53. package/dist/web/chunks/chunk-LDXBIOBF.js +2 -0
  54. package/dist/web/chunks/chunk-LHNPPNB7.js +3 -0
  55. package/dist/web/chunks/chunk-LQ6CTWX6.js +2 -0
  56. package/dist/web/chunks/chunk-LSVIQRSY.js +2 -0
  57. package/dist/web/chunks/chunk-M3SWKTLZ.js +2 -0
  58. package/dist/web/chunks/chunk-MBZYSJFT.js +2 -0
  59. package/dist/web/chunks/chunk-MZEMPN3C.js +2 -0
  60. package/dist/web/chunks/chunk-OODDZ447.js +2 -0
  61. package/dist/web/chunks/chunk-OXLTOJNY.js +3 -0
  62. package/dist/web/chunks/chunk-PR453BYT.js +2 -0
  63. package/dist/web/chunks/chunk-QNEZP2TE.js +179 -0
  64. package/dist/web/chunks/chunk-R7TFKRNM.js +2 -0
  65. package/dist/web/chunks/chunk-T4HEWXAQ.js +2 -0
  66. package/dist/web/chunks/chunk-TPXX77KB.js +2 -0
  67. package/dist/web/chunks/chunk-TPYBIPJG.js +2 -0
  68. package/dist/web/chunks/chunk-TXNHMPKM.js +89 -0
  69. package/dist/web/chunks/chunk-VAKN3BTM.js +2 -0
  70. package/dist/web/chunks/chunk-VY4GEFSG.js +2 -0
  71. package/dist/web/chunks/chunk-XBYCKXUJ.js +207 -0
  72. package/dist/web/chunks/chunk-YM7LHP34.js +16 -0
  73. package/dist/web/chunks/classDiagram-ZZMXUADV-4J5HHZD6.js +2 -0
  74. package/dist/web/chunks/classDiagram-v2-VYDZK3BY-X6WY2DAS.js +2 -0
  75. package/dist/web/chunks/cose-bilkent-JH36ORCC-ZPRW5JRW.js +2 -0
  76. package/dist/web/chunks/cynefin-OW5HDTMX-SVVTQRRB.js +2 -0
  77. package/dist/web/chunks/cynefinDiagram-5FMLGOSQ-O7GURHJG.js +63 -0
  78. package/dist/web/chunks/dagre-GXQ25YYZ-WK67O4N6.js +5 -0
  79. package/dist/web/chunks/diagram-S7CK7UJ4-2CEO2EN2.js +31 -0
  80. package/dist/web/chunks/diagram-UQ7AKVKN-2Z4VHGF3.js +42 -0
  81. package/dist/web/chunks/diagram-VSXAHHWV-AN4BOWYB.js +4 -0
  82. package/dist/web/chunks/diagram-VX7I27RA-VEZ2GXCM.js +25 -0
  83. package/dist/web/chunks/diagram-Z3DM3KII-TGGNDSLW.js +25 -0
  84. package/dist/web/chunks/ebnfDiagram-PWID7BFC-7RM57IJV.js +2 -0
  85. package/dist/web/chunks/erDiagram-RLTQ6QDP-LCATC3YT.js +100 -0
  86. package/dist/web/chunks/eventmodeling-NTZA5JFV-2SR57JAH.js +2 -0
  87. package/dist/web/chunks/flowDiagram-HODETNUW-HU6Y2EYQ.js +2 -0
  88. package/dist/web/chunks/ganttDiagram-EL5Y4UJY-5VPBBF2V.js +293 -0
  89. package/dist/web/chunks/gitGraph-4MIJSDKK-25JPIQP7.js +2 -0
  90. package/dist/web/chunks/gitGraphDiagram-WWUBYQGX-HZMAGPIJ.js +107 -0
  91. package/dist/web/chunks/info-A6RAGUB7-72MROTVX.js +2 -0
  92. package/dist/web/chunks/infoDiagram-27XIBGKW-BQYTPGNG.js +3 -0
  93. package/dist/web/chunks/ishikawaDiagram-5VMMS53U-A54WWBPX.js +71 -0
  94. package/dist/web/chunks/journeyDiagram-3NMN7TZE-XRCTMTR7.js +140 -0
  95. package/dist/web/chunks/kanban-definition-UXKFOSKX-UW2PQXZF.js +90 -0
  96. package/dist/web/chunks/katex-B7HWCVTN.js +258 -0
  97. package/dist/web/chunks/mermaid.core-VL5SQK5M.js +19 -0
  98. package/dist/web/chunks/mindmap-definition-YA3MSWOX-2H2Z6CVN.js +97 -0
  99. package/dist/web/chunks/packet-AYTQ26CC-NEGDW4B6.js +2 -0
  100. package/dist/web/chunks/pegDiagram-XKGWAZYB-KC4BYUN7.js +2 -0
  101. package/dist/web/chunks/pie-WAS4IAKB-OT3EMGHT.js +2 -0
  102. package/dist/web/chunks/pieDiagram-E7YTZNPT-54T6XSU5.js +40 -0
  103. package/dist/web/chunks/quadrantDiagram-AXDQQJYC-3G3RXSTE.js +8 -0
  104. package/dist/web/chunks/radar-RG4KPBEZ-DCHU5FOQ.js +2 -0
  105. package/dist/web/chunks/railroad-74A4TZTK-RZX6D7H6.js +2 -0
  106. package/dist/web/chunks/railroad-abnf-HS5TGJTU-STTFN7R4.js +2 -0
  107. package/dist/web/chunks/railroad-ebnf-LZEXJU2U-RBXU3IBK.js +2 -0
  108. package/dist/web/chunks/railroad-peg-WCYAUIDC-OD5BXOH6.js +2 -0
  109. package/dist/web/chunks/railroadDiagram-O6MQD6OU-3LHKFF5N.js +2 -0
  110. package/dist/web/chunks/requirementDiagram-BXWQKSXE-M4LF54YT.js +85 -0
  111. package/dist/web/chunks/sankeyDiagram-P5KCCOFB-USCKKKNT.js +41 -0
  112. package/dist/web/chunks/sequenceDiagram-WJ2MYXX4-QZ2O4KWV.js +163 -0
  113. package/dist/web/chunks/sizeCapture-INFHLROL-DZI5JWEV.js +2 -0
  114. package/dist/web/chunks/stateDiagram-D77RDMKH-EQJNTBF3.js +2 -0
  115. package/dist/web/chunks/stateDiagram-v2-MP3YSRHH-WSCDKLG6.js +2 -0
  116. package/dist/web/chunks/swimlanes-42K2YHIH-H7SZ2HG6.js +2 -0
  117. package/dist/web/chunks/swimlanesDiagram-VR7AAH4N-DFYTBPVS.js +9 -0
  118. package/dist/web/chunks/timeline-definition-24CTP7MA-4Q2ARIQ6.js +121 -0
  119. package/dist/web/chunks/treeView-Q6P3EWNA-ADCP6RPT.js +2 -0
  120. package/dist/web/chunks/treemap-WGGIJYW6-NEV7DUDY.js +2 -0
  121. package/dist/web/chunks/vennDiagram-4TSXK5OY-WMJVK74C.js +35 -0
  122. package/dist/web/chunks/wardley-WFR3VGLG-4QZOFDI5.js +2 -0
  123. package/dist/web/chunks/wardleyDiagram-VM6X3IG4-CLB324RQ.js +79 -0
  124. package/dist/web/chunks/xychartDiagram-S5SC5T6Z-G5C2R7C2.js +8 -0
  125. package/dist/web/index.html +24 -0
  126. package/dist/web/page.css +2 -0
  127. package/dist/web/page.js +210 -0
  128. package/package.json +62 -10
  129. package/cli.js +0 -2
@@ -0,0 +1,232 @@
1
+ import{a as jt}from"./chunk-HBEUVMXY.js";import{b as Ut}from"./chunk-DIRT34TZ.js";import{a as Ht}from"./chunk-6TGTE6CF.js";import{h as Wt}from"./chunk-T4HEWXAQ.js";import{g as Vt,p as Mt}from"./chunk-LHNPPNB7.js";import{N as M,T as Rt,U as $t,V as Ft,W as Pt,X as Bt,Y as Yt,Z as Gt,_ as R,g as Nt}from"./chunk-6FQEBIA3.js";import{b as E,h as pt}from"./chunk-L34PKG4P.js";import{a as f}from"./chunk-LDXBIOBF.js";import{d as Ot}from"./chunk-R7TFKRNM.js";Ot();var Ct=(function(){var t=f(function(V,a,u,i){for(u=u||{},i=V.length;i--;u[V[i]]=a);return u},"o"),e=[1,2],l=[1,3],s=[1,4],c=[2,4],h=[1,9],p=[1,11],y=[1,16],o=[1,17],T=[1,18],m=[1,19],O=[1,33],x=[1,20],_=[1,21],d=[1,22],L=[1,23],$=[1,24],C=[1,26],F=[1,27],A=[1,28],P=[1,29],I=[1,30],H=[1,31],rt=[1,32],it=[1,35],at=[1,36],nt=[1,37],ot=[1,38],z=[1,34],S=[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],lt=[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],Lt=[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],Tt={trace:f(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:f(function(a,u,i,g,b,r,K){var n=r.length-1;switch(b){case 3:return g.setRootDoc(r[n]),r[n];break;case 4:this.$=[];break;case 5:r[n]!="nl"&&(r[n-1].push(r[n]),this.$=r[n-1]);break;case 6:case 7:this.$=r[n];break;case 8:this.$="nl";break;case 12:this.$=r[n];break;case 13:let ht=r[n-1];ht.description=g.trimColon(r[n]),this.$=ht;break;case 14:this.$={stmt:"relation",state1:r[n-2],state2:r[n]};break;case 15:let ut=g.trimColon(r[n]);this.$={stmt:"relation",state1:r[n-3],state2:r[n-1],description:ut};break;case 19:this.$={stmt:"state",id:r[n-3],type:"default",description:"",doc:r[n-1]};break;case 20:var B=r[n],Y=r[n-2].trim();if(r[n].match(":")){var Q=r[n].split(":");B=Q[0],Y=[Y,Q[1]]}this.$={stmt:"state",id:B,type:"default",description:Y};break;case 21:this.$={stmt:"state",id:r[n-3],type:"default",description:r[n-5],doc:r[n-1]};break;case 22:this.$={stmt:"state",id:r[n],type:"fork"};break;case 23:this.$={stmt:"state",id:r[n],type:"join"};break;case 24:this.$={stmt:"state",id:r[n],type:"choice"};break;case 25:this.$={stmt:"state",id:g.getDividerId(),type:"divider"};break;case 26:this.$={stmt:"state",id:r[n-1].trim(),note:{position:r[n-2].trim(),text:r[n].trim()}};break;case 29:this.$=r[n].trim(),g.setAccTitle(this.$);break;case 30:case 31:this.$=r[n].trim(),g.setAccDescription(this.$);break;case 32:this.$={stmt:"click",id:r[n-3],url:r[n-2],tooltip:r[n-1]};break;case 33:this.$={stmt:"click",id:r[n-3],url:r[n-1],tooltip:""};break;case 34:case 35:this.$={stmt:"classDef",id:r[n-1].trim(),classes:r[n].trim()};break;case 36:this.$={stmt:"style",id:r[n-1].trim(),styleClass:r[n].trim()};break;case 37:this.$={stmt:"applyClass",id:r[n-1].trim(),styleClass:r[n].trim()};break;case 38:g.setDirection("TB"),this.$={stmt:"dir",value:"TB"};break;case 39:g.setDirection("BT"),this.$={stmt:"dir",value:"BT"};break;case 40:g.setDirection("RL"),this.$={stmt:"dir",value:"RL"};break;case 41:g.setDirection("LR"),this.$={stmt:"dir",value:"LR"};break;case 44:case 45:this.$={stmt:"state",id:r[n].trim(),type:"default",description:""};break;case 46:this.$={stmt:"state",id:r[n-2].trim(),classes:[r[n].trim()],type:"default",description:""};break;case 47:this.$={stmt:"state",id:r[n-2].trim(),classes:[r[n].trim()],type:"default",description:""};break}},"anonymous"),table:[{3:1,4:e,5:l,6:s},{1:[3]},{3:5,4:e,5:l,6:s},{3:6,4:e,5:l,6:s},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],c,{7:7}),{1:[2,1]},{1:[2,2]},{1:[2,3],4:h,5:p,8:8,9:10,10:12,11:13,12:14,13:15,16:y,17:o,19:T,22:m,24:O,25:x,26:_,27:d,28:L,29:$,32:25,33:C,35:F,37:A,38:P,41:I,45:H,48:rt,51:it,52:at,53:nt,54:ot,57:z},t(S,[2,5]),{9:39,10:12,11:13,12:14,13:15,16:y,17:o,19:T,22:m,24:O,25:x,26:_,27:d,28:L,29:$,32:25,33:C,35:F,37:A,38:P,41:I,45:H,48:rt,51:it,52:at,53:nt,54:ot,57:z},t(S,[2,7]),t(S,[2,8]),t(S,[2,9]),t(S,[2,10]),t(S,[2,11]),t(S,[2,12],{14:[1,40],15:[1,41]}),t(S,[2,16]),{18:[1,42]},t(S,[2,18],{20:[1,43]}),{23:[1,44]},t(S,[2,22]),t(S,[2,23]),t(S,[2,24]),t(S,[2,25]),{30:45,31:[1,46],59:[1,47],60:[1,48]},t(S,[2,28]),{34:[1,49]},{36:[1,50]},t(S,[2,31]),{13:51,24:O,57:z},{42:[1,52],44:[1,53]},{46:[1,54]},{49:[1,55]},t(lt,[2,44],{58:[1,56]}),t(lt,[2,45],{58:[1,57]}),t(S,[2,38]),t(S,[2,39]),t(S,[2,40]),t(S,[2,41]),t(S,[2,6]),t(S,[2,13]),{13:58,24:O,57:z},t(S,[2,17]),t(Lt,c,{7:59}),{24:[1,60]},{24:[1,61]},{23:[1,62]},{24:[2,48]},{24:[2,49]},t(S,[2,29]),t(S,[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(S,[2,14],{14:[1,71]}),{4:h,5:p,8:8,9:10,10:12,11:13,12:14,13:15,16:y,17:o,19:T,21:[1,72],22:m,24:O,25:x,26:_,27:d,28:L,29:$,32:25,33:C,35:F,37:A,38:P,41:I,45:H,48:rt,51:it,52:at,53:nt,54:ot,57:z},t(S,[2,20],{20:[1,73]}),{31:[1,74]},{24:[1,75]},{39:[1,76]},{39:[1,77]},t(S,[2,34]),t(S,[2,35]),t(S,[2,36]),t(S,[2,37]),t(lt,[2,46]),t(lt,[2,47]),t(S,[2,15]),t(S,[2,19]),t(Lt,c,{7:78}),t(S,[2,26]),t(S,[2,27]),{5:[1,79]},{5:[1,80]},{4:h,5:p,8:8,9:10,10:12,11:13,12:14,13:15,16:y,17:o,19:T,21:[1,81],22:m,24:O,25:x,26:_,27:d,28:L,29:$,32:25,33:C,35:F,37:A,38:P,41:I,45:H,48:rt,51:it,52:at,53:nt,54:ot,57:z},t(S,[2,32]),t(S,[2,33]),t(S,[2,21])],defaultActions:{5:[2,1],6:[2,2],47:[2,48],48:[2,49]},parseError:f(function(a,u){if(u.recoverable)this.trace(a);else{var i=new Error(a);throw i.hash=u,i}},"parseError"),parse:f(function(a){var u=this,i=[0],g=[],b=[null],r=[],K=this.table,n="",B=0,Y=0,Q=0,ht=2,ut=1,pe=r.slice.call(arguments,1),k=Object.create(this.lexer),W={yy:{}};for(var bt in this.yy)Object.prototype.hasOwnProperty.call(this.yy,bt)&&(W.yy[bt]=this.yy[bt]);k.setInput(a,W.yy),W.yy.lexer=k,W.yy.parser=this,typeof k.yylloc>"u"&&(k.yylloc={});var Et=k.yylloc;r.push(Et);var Se=k.options&&k.options.ranges;typeof W.yy.parseError=="function"?this.parseError=W.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function ye(w){i.length=i.length-2*w,b.length=b.length-w,r.length=r.length-w}f(ye,"popStack");function It(){var w;return w=g.pop()||k.lex()||ut,typeof w!="number"&&(w instanceof Array&&(g=w,w=g.pop()),w=u.symbols_[w]||w),w}f(It,"lex");for(var D,mt,j,N,Me,kt,X={},dt,G,wt,ft;;){if(j=i[i.length-1],this.defaultActions[j]?N=this.defaultActions[j]:((D===null||typeof D>"u")&&(D=It()),N=K[j]&&K[j][D]),typeof N>"u"||!N.length||!N[0]){var _t="";ft=[];for(dt in K[j])this.terminals_[dt]&&dt>ht&&ft.push("'"+this.terminals_[dt]+"'");k.showPosition?_t="Parse error on line "+(B+1)+`:
2
+ `+k.showPosition()+`
3
+ Expecting `+ft.join(", ")+", got '"+(this.terminals_[D]||D)+"'":_t="Parse error on line "+(B+1)+": Unexpected "+(D==ut?"end of input":"'"+(this.terminals_[D]||D)+"'"),this.parseError(_t,{text:k.match,token:this.terminals_[D]||D,line:k.yylineno,loc:Et,expected:ft})}if(N[0]instanceof Array&&N.length>1)throw new Error("Parse Error: multiple actions possible at state: "+j+", token: "+D);switch(N[0]){case 1:i.push(D),b.push(k.yytext),r.push(k.yylloc),i.push(N[1]),D=null,mt?(D=mt,mt=null):(Y=k.yyleng,n=k.yytext,B=k.yylineno,Et=k.yylloc,Q>0&&Q--);break;case 2:if(G=this.productions_[N[1]][1],X.$=b[b.length-G],X._$={first_line:r[r.length-(G||1)].first_line,last_line:r[r.length-1].last_line,first_column:r[r.length-(G||1)].first_column,last_column:r[r.length-1].last_column},Se&&(X._$.range=[r[r.length-(G||1)].range[0],r[r.length-1].range[1]]),kt=this.performAction.apply(X,[n,Y,B,W.yy,N[1],b,r].concat(pe)),typeof kt<"u")return kt;G&&(i=i.slice(0,-1*G*2),b=b.slice(0,-1*G),r=r.slice(0,-1*G)),i.push(this.productions_[N[1]][0]),b.push(X.$),r.push(X._$),wt=K[i[i.length-2]][i[i.length-1]],i.push(wt);break;case 3:return!0}}return!0},"parse")},fe=(function(){var V={EOF:1,parseError:f(function(u,i){if(this.yy.parser)this.yy.parser.parseError(u,i);else throw new Error(u)},"parseError"),setInput:f(function(a,u){return this.yy=u||this.yy||{},this._input=a,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:f(function(){var a=this._input[0];this.yytext+=a,this.yyleng++,this.offset++,this.match+=a,this.matched+=a;var u=a.match(/(?:\r\n?|\n).*/g);return u?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),a},"input"),unput:f(function(a){var u=a.length,i=a.split(/(?:\r\n?|\n)/g);this._input=a+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-u),this.offset-=u;var g=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),i.length-1&&(this.yylineno-=i.length-1);var b=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:i?(i.length===g.length?this.yylloc.first_column:0)+g[g.length-i.length].length-i[0].length:this.yylloc.first_column-u},this.options.ranges&&(this.yylloc.range=[b[0],b[0]+this.yyleng-u]),this.yyleng=this.yytext.length,this},"unput"),more:f(function(){return this._more=!0,this},"more"),reject:f(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:f(function(a){this.unput(this.match.slice(a))},"less"),pastInput:f(function(){var a=this.matched.substr(0,this.matched.length-this.match.length);return(a.length>20?"...":"")+a.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:f(function(){var a=this.match;return a.length<20&&(a+=this._input.substr(0,20-a.length)),(a.substr(0,20)+(a.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:f(function(){var a=this.pastInput(),u=new Array(a.length+1).join("-");return a+this.upcomingInput()+`
5
+ `+u+"^"},"showPosition"),test_match:f(function(a,u){var i,g,b;if(this.options.backtrack_lexer&&(b={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&&(b.yylloc.range=this.yylloc.range.slice(0))),g=a[0].match(/(?:\r\n?|\n).*/g),g&&(this.yylineno+=g.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:g?g[g.length-1].length-g[g.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+a[0].length},this.yytext+=a[0],this.match+=a[0],this.matches=a,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(a[0].length),this.matched+=a[0],i=this.performAction.call(this,this.yy,this,u,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),i)return i;if(this._backtrack){for(var r in b)this[r]=b[r];return!1}return!1},"test_match"),next:f(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var a,u,i,g;this._more||(this.yytext="",this.match="");for(var b=this._currentRules(),r=0;r<b.length;r++)if(i=this._input.match(this.rules[b[r]]),i&&(!u||i[0].length>u[0].length)){if(u=i,g=r,this.options.backtrack_lexer){if(a=this.test_match(i,b[r]),a!==!1)return a;if(this._backtrack){u=!1;continue}else return!1}else if(!this.options.flex)break}return u?(a=this.test_match(u,b[g]),a!==!1?a:!1):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:f(function(){var u=this.next();return u||this.lex()},"lex"),begin:f(function(u){this.conditionStack.push(u)},"begin"),popState:f(function(){var u=this.conditionStack.length-1;return u>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:f(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:f(function(u){return u=this.conditionStack.length-1-Math.abs(u||0),u>=0?this.conditionStack[u]:"INITIAL"},"topState"),pushState:f(function(u){this.begin(u)},"pushState"),stateStackSize:f(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:f(function(u,i,g,b){function r(){let n=i.yytext.indexOf("%%");if(n===0)return!1;if(n>0){let B=i.yytext.slice(0,n),Y=i.yytext.slice(n);Y&&u.lexer.unput(Y),i.yytext=B}return!0}f(r,"processId");var K=b;switch(g){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:return 5;case 9:break;case 10:break;case 11:break;case 12:break;case 13:return this.pushState("SCALE"),17;break;case 14:return 18;case 15:this.popState();break;case 16:return this.begin("acc_title"),33;break;case 17:return this.popState(),"acc_title_value";break;case 18:return this.begin("acc_descr"),35;break;case 19:return this.popState(),"acc_descr_value";break;case 20:this.begin("acc_descr_multiline");break;case 21:this.popState();break;case 22:return"acc_descr_multiline_value";case 23:return this.pushState("CLASSDEF"),41;break;case 24:return this.popState(),this.pushState("CLASSDEFID"),"DEFAULT_CLASSDEF_ID";break;case 25:return this.popState(),this.pushState("CLASSDEFID"),42;break;case 26:return this.popState(),43;break;case 27:return this.pushState("CLASS"),48;break;case 28:return this.popState(),this.pushState("CLASS_STYLE"),49;break;case 29:return this.popState(),50;break;case 30:return this.pushState("STYLE"),45;break;case 31:return this.popState(),this.pushState("STYLEDEF_STYLES"),46;break;case 32:return this.popState(),47;break;case 33:return this.pushState("SCALE"),17;break;case 34:return 18;case 35:this.popState();break;case 36:this.pushState("STATE");break;case 37:return this.popState(),i.yytext=i.yytext.slice(0,-8).trim(),25;break;case 38:return this.popState(),i.yytext=i.yytext.slice(0,-8).trim(),26;break;case 39:return this.popState(),i.yytext=i.yytext.slice(0,-10).trim(),27;break;case 40:return this.popState(),i.yytext=i.yytext.slice(0,-8).trim(),25;break;case 41:return this.popState(),i.yytext=i.yytext.slice(0,-8).trim(),26;break;case 42:return this.popState(),i.yytext=i.yytext.slice(0,-10).trim(),27;break;case 43:return 51;case 44:return 52;case 45:return 53;case 46:return 54;case 47:this.pushState("STATE_STRING");break;case 48:return this.pushState("STATE_ID"),"AS";break;case 49:if(!r())return;return this.popState(),"ID";break;case 50:this.popState();break;case 51:return"STATE_DESCR";case 52:throw new Error('Error: State name must be a single word. Found: "'+i.yytext.trim()+'"');case 53:return 19;case 54:this.popState();break;case 55:return this.popState(),this.pushState("struct"),20;break;case 56:return this.popState(),21;break;case 57:break;case 58:return this.begin("NOTE"),29;break;case 59:return this.popState(),this.pushState("NOTE_ID"),59;break;case 60:return this.popState(),this.pushState("NOTE_ID"),60;break;case 61:this.popState(),this.pushState("FLOATING_NOTE");break;case 62:return this.popState(),this.pushState("FLOATING_NOTE_ID"),"AS";break;case 63:break;case 64:return"NOTE_TEXT";case 65:if(!r())return;return this.popState(),"ID";break;case 66:if(!r())return;return this.popState(),this.pushState("NOTE_TEXT"),24;break;case 67:return this.popState(),i.yytext=i.yytext.substr(2).trim(),31;break;case 68:return this.popState(),i.yytext=i.yytext.slice(0,-8).trim(),31;break;case 69:return 6;case 70:return 6;case 71:return 16;case 72:return 57;case 73:return r()?24:void 0;case 74:return i.yytext=i.yytext.trim(),14;break;case 75:return 15;case 76:return 28;case 77:return 58;case 78:return 5;case 79: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,/^(?:[\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,/^(?:\w+\s+\w+.*?\{)/i,/^(?:[^\n\s\{]+)/i,/^(?:\n)/i,/^(?:\{)/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]*?\n\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:[10,11,12],inclusive:!1},struct:{rules:[10,11,12,23,27,30,36,43,44,45,46,56,57,58,72,73,74,75,76,77],inclusive:!1},FLOATING_NOTE_ID:{rules:[65],inclusive:!1},FLOATING_NOTE:{rules:[62,63,64],inclusive:!1},NOTE_TEXT:{rules:[67,68],inclusive:!1},NOTE_ID:{rules:[66],inclusive:!1},NOTE:{rules:[59,60,61],inclusive:!1},STYLEDEF_STYLEOPTS:{rules:[],inclusive:!1},STYLEDEF_STYLES:{rules:[32],inclusive:!1},STYLE_IDS:{rules:[],inclusive:!1},STYLE:{rules:[31],inclusive:!1},CLASS_STYLE:{rules:[29],inclusive:!1},CLASS:{rules:[28],inclusive:!1},CLASSDEFID:{rules:[26],inclusive:!1},CLASSDEF:{rules:[24,25],inclusive:!1},acc_descr_multiline:{rules:[21,22],inclusive:!1},acc_descr:{rules:[19],inclusive:!1},acc_title:{rules:[17],inclusive:!1},SCALE:{rules:[14,15,34,35],inclusive:!1},ALIAS:{rules:[],inclusive:!1},STATE_ID:{rules:[49],inclusive:!1},STATE_STRING:{rules:[50,51],inclusive:!1},FORK_STATE:{rules:[],inclusive:!1},STATE:{rules:[10,11,12,37,38,39,40,41,42,47,48,52,53,54,55],inclusive:!1},ID:{rules:[10,11,12],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,8,9,11,12,13,16,18,20,23,27,30,33,36,55,58,69,70,71,72,73,74,75,77,78,79],inclusive:!0}}};return V})();Tt.lexer=fe;function ct(){this.yy={}}return f(ct,"Parser"),ct.prototype=Tt,Tt.Parser=ct,new ct})();Ct.parser=Ct;var Qe=Ct,ge="TB",te="TB",zt="dir",q="state",J="root",At="relation",Te="classDef",be="style",Ee="applyClass",et="default",ee="divider",se="fill:none",re="fill: #333",ie="c",ae="markdown",ne="normal",Dt="rect",vt="rectWithTitle",me="stateStart",ke="stateEnd",Kt="divider",Xt="roundedWithTitle",_e="note",De="noteGroup",st="statediagram",ve="state",Ce=`${st}-${ve}`,oe="transition",Ae="note",xe="note-edge",Le=`${oe} ${xe}`,Ie=`${st}-${Ae}`,we="cluster",Oe=`${st}-${we}`,Ne="cluster-alt",Re=`${st}-${Ne}`,le="parent",ce="note",$e="state",xt="----",Fe=`${xt}${ce}`,Jt=`${xt}${le}`,he=f((t,e=te)=>{if(!t.doc)return e;let l=e;for(let s of t.doc)s.stmt==="dir"&&(l=s.value);return l},"getDir"),Pe=f(function(t,e){return e.db.getClasses()},"getClasses"),Be=f(async function(t,e,l,s){E.info("REF0:"),E.info("Drawing state diagram (v2)",e);let{securityLevel:c,state:h,layout:p}=R();s.db.extract(s.db.getRootDocV2());let y=s.db.getData(),o=jt(e,c);y.type=s.type,y.layoutAlgorithm=p,y.nodeSpacing=h?.nodeSpacing||50,y.rankSpacing=h?.rankSpacing||50,R().look==="neo"?y.markers=["barbNeo"]:y.markers=["barb"],y.diagramId=e,await Ut(y,o);let m=8;try{(typeof s.db.getLinks=="function"?s.db.getLinks():new Map).forEach((x,_)=>{let d=typeof _=="string"?_:typeof _?.id=="string"?_.id:"",L=y.nodes.find(I=>I.id===d);if(!d){E.warn("\u26A0\uFE0F Invalid or missing stateId from key:",JSON.stringify(_));return}let $=o.node()?.querySelectorAll("g.node, g.rough-node"),C;if($?.forEach(I=>{let H=I.textContent?.trim();(I.id===L?.domId||H===d)&&(C=I)}),!C){E.warn("\u26A0\uFE0F Could not find node matching text:",d);return}let F=C.parentNode;if(!F){E.warn("\u26A0\uFE0F Node has no parent, cannot wrap:",d);return}let A=document.createElementNS("http://www.w3.org/2000/svg","a"),P=x.url.replace(/^"+|"+$/g,"");if(A.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",P),A.setAttribute("target","_blank"),x.tooltip){let I=x.tooltip.replace(/^"+|"+$/g,"");A.setAttribute("title",I),C.setAttribute("title",I)}F.replaceChild(A,C),A.appendChild(C),E.info("\u{1F517} Wrapped node in <a> tag for:",d,x.url)})}catch(O){E.error("\u274C Error injecting clickable links:",O)}Mt.insertTitle(o,"statediagramTitleText",h?.titleTopMargin??25,s.db.getDiagramTitle()),Ht(o,m,st,h?.useMaxWidth??!0)},"draw"),Ze={getClasses:Pe,draw:Be,getDir:he},yt=new Map,U=0;function gt(t="",e=0,l="",s=xt){let c=l!==null&&l.length>0?`${s}${l}`:"";return`${$e}-${t}${c}-${e}`}f(gt,"stateDomId");var Ye=f((t,e,l,s,c,h,p,y)=>{E.trace("items",e),e.forEach(o=>{switch(o.stmt){case q:tt(t,o,l,s,c,h,p,y);break;case et:tt(t,o,l,s,c,h,p,y);break;case At:{tt(t,o.state1,l,s,c,h,p,y),tt(t,o.state2,l,s,c,h,p,y);let T=p==="neo",m={id:"edge"+U,start:o.state1.id,end:o.state2.id,arrowhead:"normal",arrowTypeEnd:T?"arrow_barb_neo":"arrow_barb",style:se,labelStyle:"",label:M.sanitizeText(o.description??"",R()),arrowheadStyle:re,labelpos:ie,labelType:ae,thickness:ne,classes:oe,look:p};c.push(m),U++}break}})},"setupDoc"),qt=f((t,e=te)=>{let l=e;if(t.doc)for(let s of t.doc)s.stmt==="dir"&&(l=s.value);return l},"getDir");function Z(t,e,l){if(!e.id||e.id==="</join></fork>"||e.id==="</choice>")return;e.cssClasses&&(Array.isArray(e.cssCompiledStyles)||(e.cssCompiledStyles=[]),e.cssClasses.split(" ").forEach(c=>{let h=l.get(c);h&&(e.cssCompiledStyles=[...e.cssCompiledStyles??[],...h.styles])}));let s=t.find(c=>c.id===e.id);s?Object.assign(s,e):t.push(e)}f(Z,"insertOrUpdateNode");function ue(t){return t?.classes?.join(" ")??""}f(ue,"getClassesFromDbInfo");function de(t){return t?.styles??[]}f(de,"getStylesFromDbInfo");var tt=f((t,e,l,s,c,h,p,y)=>{let o=e.id,T=l.get(o),m=ue(T),O=de(T),x=R();if(E.info("dataFetcher parsedItem",e,T,O),o!=="root"){let _=Dt;e.start===!0?_=me:e.start===!1&&(_=ke),e.type!==et&&(_=e.type),yt.get(o)||yt.set(o,{id:o,shape:_,description:M.sanitizeText(o,x),cssClasses:`${m} ${Ce}`,cssStyles:O});let d=yt.get(o);e.description&&(Array.isArray(d.description)?(d.shape=vt,d.description.push(e.description)):d.description?.length&&d.description.length>0?(d.shape=vt,d.description===o?d.description=[e.description]:d.description=[d.description,e.description]):(d.shape=Dt,d.description=e.description),d.description=M.sanitizeTextOrArray(d.description,x)),d.description?.length===1&&d.shape===vt&&(d.type==="group"?d.shape=Xt:d.shape=Dt),!d.type&&e.doc&&(E.info("Setting cluster for XCX",o,qt(e)),d.type="group",d.isGroup=!0,d.dir=qt(e),d.shape=e.type===ee?Kt:Xt,d.cssClasses=`${d.cssClasses} ${Oe} ${h?Re:""}`);let L={labelStyle:"",shape:d.shape,label:d.description,cssClasses:d.cssClasses,cssCompiledStyles:[],cssStyles:d.cssStyles,id:o,dir:d.dir,domId:gt(o,U),type:d.type,isGroup:d.type==="group",padding:8,rx:10,ry:10,look:p,labelType:"markdown"};if(L.shape===Kt&&(L.label=""),t&&t.id!=="root"&&(E.trace("Setting node ",o," to be child of its parent ",t.id),L.parentId=t.id),L.centerLabel=!0,e.note){let $={labelStyle:"",shape:_e,label:e.note.text,labelType:"markdown",cssClasses:Ie,cssStyles:[],cssCompiledStyles:[],id:o+Fe+"-"+U,domId:gt(o,U,ce),type:d.type,isGroup:d.type==="group",padding:x.flowchart?.padding,look:p,position:e.note.position},C=o+Jt,F={labelStyle:"",shape:De,label:e.note.text,cssClasses:d.cssClasses,cssStyles:[],id:o+Jt,domId:gt(o,U,le),type:"group",isGroup:!0,padding:16,look:p,position:e.note.position};U++,F.id=C,$.parentId=C,Z(s,F,y),Z(s,$,y),Z(s,L,y);let A=o,P=$.id;e.note.position==="left of"&&(A=$.id,P=o),c.push({id:A+"-"+P,start:A,end:P,arrowhead:"none",arrowTypeEnd:"",style:se,labelStyle:"",classes:Le,arrowheadStyle:re,labelpos:ie,labelType:ae,thickness:ne,look:p})}else Z(s,L,y)}e.doc&&(E.trace("Adding nodes children "),Ye(e,e.doc,l,s,c,!h,p,y))},"dataFetcher"),Ge=f(()=>{yt.clear(),U=0},"reset"),v={START_NODE:"[*]",START_TYPE:"start",END_NODE:"[*]",END_TYPE:"end",COLOR_KEYWORD:"color",FILL_KEYWORD:"fill",BG_FILL:"bgFill",STYLECLASS_SEP:","},Qt=f(()=>new Map,"newClassesList"),Zt=f(()=>({relations:[],states:new Map,documents:{}}),"newDoc"),St=f(t=>JSON.parse(JSON.stringify(t)),"clone"),ss=class{constructor(t){this.version=t,this.nodes=[],this.edges=[],this.rootDoc=[],this.classes=Qt(),this.documents={root:Zt()},this.currentDocument=this.documents.root,this.startEndCount=0,this.dividerCnt=0,this.links=new Map,this.funs=[],this.getAccTitle=Ft,this.setAccTitle=$t,this.getAccDescription=Bt,this.setAccDescription=Pt,this.setDiagramTitle=Yt,this.getDiagramTitle=Gt,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),this.bindFunctions=this.bindFunctions.bind(this)}static{f(this,"StateDB")}static{this.relationType={AGGREGATION:0,EXTENSION:1,COMPOSITION:2,DEPENDENCY:3}}extract(t){this.clear(!0);for(let s of Array.isArray(t)?t:t.doc)switch(s.stmt){case q:this.addState(s.id.trim(),s.type,s.doc,s.description,s.note);break;case At:this.addRelation(s.state1,s.state2,s.description);break;case Te:this.addStyleClass(s.id.trim(),s.classes);break;case be:this.handleStyleDef(s);break;case Ee:this.setCssClass(s.id.trim(),s.styleClass);break;case"click":this.addLink(s.id,s.url,s.tooltip);break}let e=this.getStates(),l=R();Ge(),tt(void 0,this.getRootDocV2(),e,this.nodes,this.edges,!0,l.look,this.classes);for(let s of this.nodes)if(Array.isArray(s.label)){if(s.description=s.label.slice(1),s.isGroup&&s.description.length>0)throw new Error(`Group nodes can only have label. Remove the additional description for node [${s.id}]`);s.label=s.label[0]}}handleStyleDef(t){let e=t.id.trim().split(","),l=t.styleClass.split(",");for(let s of e){let c=this.getState(s);if(!c){let h=s.trim();this.addState(h),c=this.getState(h)}c&&(c.styles=l.map(h=>h.replace(/;/g,"")?.trim()))}}setRootDoc(t){E.info("Setting root doc",t),this.rootDoc=t,this.version===1?this.extract(t):this.extract(this.getRootDocV2())}docTranslator(t,e,l){if(e.stmt===At){this.docTranslator(t,e.state1,!0),this.docTranslator(t,e.state2,!1);return}if(e.stmt===q&&(e.id===v.START_NODE?(e.id=t.id+(l?"_start":"_end"),e.start=l):e.id=e.id.trim()),e.stmt!==J&&e.stmt!==q||!e.doc)return;let s=[],c=[];for(let h of e.doc)if(h.type===ee){let p=St(h);p.doc=St(c),s.push(p),c=[]}else c.push(h);if(s.length>0&&c.length>0){let h={stmt:q,id:Vt(),type:"divider",doc:St(c)};s.push(St(h)),e.doc=s}e.doc.forEach(h=>this.docTranslator(e,h,!0))}getRootDocV2(){return this.docTranslator({id:J,stmt:J},{id:J,stmt:J,doc:this.rootDoc},!0),{id:J,doc:this.rootDoc}}addState(t,e=et,l=void 0,s=void 0,c=void 0,h=void 0,p=void 0,y=void 0){let o=t?.trim();if(!this.currentDocument.states.has(o))E.info("Adding state ",o,s),this.currentDocument.states.set(o,{stmt:q,id:o,descriptions:[],type:e,doc:l,note:c,classes:[],styles:[],textStyles:[]});else{let T=this.currentDocument.states.get(o);if(!T)throw new Error(`State not found: ${o}`);T.doc||(T.doc=l),T.type||(T.type=e)}if(s&&(E.info("Setting state description",o,s),(Array.isArray(s)?s:[s]).forEach(m=>this.addDescription(o,m.trim()))),c){let T=this.currentDocument.states.get(o);if(!T)throw new Error(`State not found: ${o}`);T.note=c,T.note.text=M.sanitizeText(T.note.text,R())}h&&(E.info("Setting state classes",o,h),(Array.isArray(h)?h:[h]).forEach(m=>this.setCssClass(o,m.trim()))),p&&(E.info("Setting state styles",o,p),(Array.isArray(p)?p:[p]).forEach(m=>this.setStyle(o,m.trim()))),y&&(E.info("Setting state styles",o,p),(Array.isArray(y)?y:[y]).forEach(m=>this.setTextStyle(o,m.trim())))}clear(t){this.nodes=[],this.edges=[],this.funs=[this.setupToolTips.bind(this)],this.documents={root:Zt()},this.currentDocument=this.documents.root,this.startEndCount=0,this.classes=Qt(),t||(this.links=new Map,Rt())}getState(t){return this.currentDocument.states.get(t)}getStates(){return this.currentDocument.states}logDocuments(){E.info("Documents = ",this.documents)}getRelations(){return this.currentDocument.relations}addLink(t,e,l){this.links.set(t,{url:e,tooltip:l}),E.warn("Adding link",t,e,l)}getLinks(){return this.links}startIdIfNeeded(t=""){return t===v.START_NODE?(this.startEndCount++,`${v.START_TYPE}${this.startEndCount}`):t}startTypeIfNeeded(t="",e=et){return t===v.START_NODE?v.START_TYPE:e}endIdIfNeeded(t=""){return t===v.END_NODE?(this.startEndCount++,`${v.END_TYPE}${this.startEndCount}`):t}endTypeIfNeeded(t="",e=et){return t===v.END_NODE?v.END_TYPE:e}addRelationObjs(t,e,l=""){let s=this.startIdIfNeeded(t.id.trim()),c=this.startTypeIfNeeded(t.id.trim(),t.type),h=this.startIdIfNeeded(e.id.trim()),p=this.startTypeIfNeeded(e.id.trim(),e.type);this.addState(s,c,t.doc,t.description,t.note,t.classes,t.styles,t.textStyles),this.addState(h,p,e.doc,e.description,e.note,e.classes,e.styles,e.textStyles),this.currentDocument.relations.push({id1:s,id2:h,relationTitle:M.sanitizeText(l,R())})}addRelation(t,e,l){if(typeof t=="object"&&typeof e=="object")this.addRelationObjs(t,e,l);else if(typeof t=="string"&&typeof e=="string"){let s=this.startIdIfNeeded(t.trim()),c=this.startTypeIfNeeded(t),h=this.endIdIfNeeded(e.trim()),p=this.endTypeIfNeeded(e);this.addState(s,c),this.addState(h,p),this.currentDocument.relations.push({id1:s,id2:h,relationTitle:l?M.sanitizeText(l,R()):void 0})}}addDescription(t,e){let l=this.currentDocument.states.get(t),s=e.startsWith(":")?e.replace(":","").trim():e;l?.descriptions?.push(M.sanitizeText(s,R()))}cleanupLabel(t){return t.startsWith(":")?t.slice(2).trim():t.trim()}getDividerId(){return this.dividerCnt++,`divider-id-${this.dividerCnt}`}addStyleClass(t,e=""){this.classes.has(t)||this.classes.set(t,{id:t,styles:[],textStyles:[]});let l=this.classes.get(t);e&&l&&e.split(v.STYLECLASS_SEP).forEach(s=>{let c=s.replace(/([^;]*);/,"$1").trim();if(RegExp(v.COLOR_KEYWORD).exec(s)){let p=c.replace(v.FILL_KEYWORD,v.BG_FILL).replace(v.COLOR_KEYWORD,v.FILL_KEYWORD);l.textStyles.push(p)}l.styles.push(c)})}getClasses(){return this.classes}setupToolTips(t){let e=Wt();pt(t).select("svg").selectAll("g.node, g.rough-node").on("mouseover",c=>{let h=pt(c.currentTarget),p=h.attr("title");if(p===null)return;let y=c.currentTarget?.getBoundingClientRect();e.transition().duration(200).style("opacity",".9"),e.style("left",window.scrollX+y.left+(y.right-y.left)/2+"px").style("top",window.scrollY+y.bottom+"px"),e.html(Nt.sanitize(p)),h.classed("hover",!0)}).on("mouseout",c=>{e.transition().duration(500).style("opacity",0),pt(c.currentTarget).classed("hover",!1)})}setCssClass(t,e){t.split(",").forEach(l=>{let s=this.getState(l);if(!s){let c=l.trim();this.addState(c),s=this.getState(c)}s?.classes?.push(e)})}setStyle(t,e){this.getState(t)?.styles?.push(e)}setTextStyle(t,e){this.getState(t)?.textStyles?.push(e)}bindFunctions(t){this.funs.forEach(e=>{e(t)})}getDirectionStatement(){return this.rootDoc.find(t=>t.stmt===zt)}getDirection(){return this.getDirectionStatement()?.value??ge}setDirection(t){let e=this.getDirectionStatement();e?e.value=t:this.rootDoc.unshift({stmt:zt,value:t})}trimColon(t){return t.startsWith(":")?t.slice(1).trim():t.trim()}getData(){let t=R();return{nodes:this.nodes,edges:this.edges,other:{},config:t,direction:he(this.getRootDocV2())}}getConfig(){return R().state}},Ve=f(t=>`
7
+ defs [id$="-barbEnd"] {
8
+ fill: ${t.transitionColor};
9
+ stroke: ${t.transitionColor};
10
+ }
11
+ g.stateGroup text {
12
+ fill: ${t.nodeBorder};
13
+ stroke: none;
14
+ font-size: 10px;
15
+ }
16
+ g.stateGroup text {
17
+ fill: ${t.textColor};
18
+ stroke: none;
19
+ font-size: 10px;
20
+
21
+ }
22
+ g.stateGroup .state-title {
23
+ font-weight: bolder;
24
+ fill: ${t.stateLabelColor};
25
+ }
26
+
27
+ g.stateGroup rect {
28
+ fill: ${t.mainBkg};
29
+ stroke: ${t.nodeBorder};
30
+ }
31
+
32
+ g.stateGroup line {
33
+ stroke: ${t.lineColor};
34
+ stroke-width: ${t.strokeWidth||1};
35
+ }
36
+
37
+ .transition {
38
+ stroke: ${t.transitionColor};
39
+ stroke-width: ${t.strokeWidth||1};
40
+ fill: none;
41
+ }
42
+
43
+ .stateGroup .composit {
44
+ fill: ${t.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: ${t.noteBorderColor};
55
+ fill: ${t.noteBkgColor};
56
+
57
+ text {
58
+ fill: ${t.noteTextColor};
59
+ stroke: none;
60
+ font-size: 10px;
61
+ }
62
+ }
63
+
64
+ .stateLabel .box {
65
+ stroke: none;
66
+ stroke-width: 0;
67
+ fill: ${t.mainBkg};
68
+ opacity: 0.5;
69
+ }
70
+
71
+ .edgeLabel .label rect {
72
+ fill: ${t.labelBackgroundColor};
73
+ opacity: 0.5;
74
+ }
75
+ .edgeLabel {
76
+ background-color: ${t.edgeLabelBackground};
77
+ p {
78
+ background-color: ${t.edgeLabelBackground};
79
+ }
80
+ rect {
81
+ opacity: 0.5;
82
+ background-color: ${t.edgeLabelBackground};
83
+ fill: ${t.edgeLabelBackground};
84
+ }
85
+ text-align: center;
86
+ }
87
+ .edgeLabel .label text {
88
+ fill: ${t.transitionLabelColor||t.tertiaryTextColor};
89
+ }
90
+ .label div .edgeLabel {
91
+ color: ${t.transitionLabelColor||t.tertiaryTextColor};
92
+ }
93
+
94
+ .stateLabel text {
95
+ fill: ${t.stateLabelColor};
96
+ font-size: 10px;
97
+ font-weight: bold;
98
+ }
99
+
100
+ .node circle.state-start {
101
+ fill: ${t.specialStateColor};
102
+ stroke: ${t.specialStateColor};
103
+ }
104
+
105
+ .node .fork-join {
106
+ fill: ${t.specialStateColor};
107
+ stroke: ${t.specialStateColor};
108
+ }
109
+
110
+ .node circle.state-end {
111
+ fill: ${t.innerEndBackground};
112
+ stroke: ${t.background};
113
+ stroke-width: 1.5
114
+ }
115
+ .end-state-inner {
116
+ fill: ${t.compositeBackground||t.background};
117
+ // stroke: ${t.background};
118
+ stroke-width: 1.5
119
+ }
120
+
121
+ .node rect {
122
+ fill: ${t.stateBkg||t.mainBkg};
123
+ stroke: ${t.stateBorder||t.nodeBorder};
124
+ stroke-width: ${t.strokeWidth||1}px;
125
+ }
126
+ .node polygon {
127
+ fill: ${t.mainBkg};
128
+ stroke: ${t.stateBorder||t.nodeBorder};;
129
+ stroke-width: ${t.strokeWidth||1}px;
130
+ }
131
+ [id$="-barbEnd"] {
132
+ fill: ${t.lineColor};
133
+ }
134
+
135
+ .statediagram-cluster rect {
136
+ fill: ${t.compositeTitleBackground};
137
+ stroke: ${t.stateBorder||t.nodeBorder};
138
+ stroke-width: ${t.strokeWidth||1}px;
139
+ }
140
+
141
+ .cluster-label, .nodeLabel {
142
+ color: ${t.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: ${t.stateBorder||t.nodeBorder};
152
+ }
153
+
154
+ .statediagram-state .title-state {
155
+ rx: 5px;
156
+ ry: 5px;
157
+ }
158
+ .statediagram-cluster.statediagram-cluster .inner {
159
+ fill: ${t.compositeBackground||t.background};
160
+ }
161
+ .statediagram-cluster.statediagram-cluster-alt .inner {
162
+ fill: ${t.altBackground?t.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: ${t.altBackground?t.altBackground:"#efefef"};
177
+ }
178
+
179
+ .note-edge {
180
+ stroke-dasharray: 5;
181
+ }
182
+
183
+ .statediagram-note rect {
184
+ fill: ${t.noteBkgColor};
185
+ stroke: ${t.noteBorderColor};
186
+ stroke-width: 1px;
187
+ rx: 0;
188
+ ry: 0;
189
+ }
190
+ .statediagram-note rect {
191
+ fill: ${t.noteBkgColor};
192
+ stroke: ${t.noteBorderColor};
193
+ stroke-width: 1px;
194
+ rx: 0;
195
+ ry: 0;
196
+ }
197
+
198
+ .statediagram-note text {
199
+ fill: ${t.noteTextColor};
200
+ }
201
+
202
+ .statediagram-note .nodeLabel {
203
+ color: ${t.noteTextColor};
204
+ }
205
+ .statediagram .edgeLabel {
206
+ color: red; // ${t.noteTextColor};
207
+ }
208
+
209
+ [id$="-dependencyStart"], [id$="-dependencyEnd"] {
210
+ fill: ${t.lineColor};
211
+ stroke: ${t.lineColor};
212
+ stroke-width: ${t.strokeWidth||1};
213
+ }
214
+
215
+ .statediagramTitleText {
216
+ text-anchor: middle;
217
+ font-size: 18px;
218
+ fill: ${t.textColor};
219
+ }
220
+
221
+ [data-look="neo"].statediagram-cluster rect {
222
+ fill: ${t.mainBkg};
223
+ stroke: ${t.useGradient?"url("+t.svgId+"-gradient)":t.stateBorder||t.nodeBorder};
224
+ stroke-width: ${t.strokeWidth??1};
225
+ }
226
+ [data-look="neo"].statediagram-cluster rect.outer {
227
+ rx: ${t.radius}px;
228
+ ry: ${t.radius}px;
229
+ filter: ${t.dropShadow?t.dropShadow.replace("url(#drop-shadow)",`url(${t.svgId}-drop-shadow)`):"none"}
230
+ }
231
+ `,"getStyles"),rs=Ve;export{Qe as a,Ze as b,ss as c,rs as d};
232
+ //# sourceMappingURL=chunk-2RFQIKC6.js.map
@@ -0,0 +1,2 @@
1
+ import{a as t,b as d,c as l,d as o,e as u,g as c,p as f,w as m,y as v}from"./chunk-QNEZP2TE.js";import{d as s}from"./chunk-R7TFKRNM.js";s();var b=class extends v{static{t(this,"RailroadAbnfTokenBuilder")}constructor(){super(["railroad-abnf-beta"])}},A=class extends m{static{t(this,"RailroadAbnfValueConverter")}runConverter(r,e,a){let i=super.runConverter(r,e,a);if(r.name==="TITLE"&&typeof i=="string"){let n=i.trim();if(n.startsWith('"')&&n.endsWith('"')||n.startsWith("'")&&n.endsWith("'"))return n.slice(1,-1)}return i}runCustomConverter(r,e,a){if(r.name==="ABNF_STRING")return e.slice(1,-1)}},C={parser:{TokenBuilder:t(()=>new b,"TokenBuilder"),ValueConverter:t(()=>new A,"ValueConverter")}};function R(r=u){let e=o(l(r),c),a=o(d({shared:e}),f,C);return e.ServiceRegistry.register(a),{shared:e,RailroadAbnf:a}}t(R,"createRailroadAbnfServices");export{C as a,R as b};
2
+ //# sourceMappingURL=chunk-37NHO5VO.js.map
@@ -0,0 +1,3 @@
1
+ import{a as o,b as c,c as l,d as i,e as u,g as f,q as E,w as m,y as v}from"./chunk-QNEZP2TE.js";import{d}from"./chunk-R7TFKRNM.js";d();var h=class extends v{static{o(this,"RailroadEbnfTokenBuilder")}constructor(){super(["railroad-ebnf-beta"])}},b=o(a=>{let e=a.slice(1,-1),r="";for(let t=0;t<e.length;t++){let n=e[t];if(n==="\\"&&t+1<e.length){t++;let s=e[t];switch(s){case"n":r+=`
2
+ `;break;case"r":r+="\r";break;case"t":r+=" ";break;default:r+=s}continue}r+=n}return r},"decodeEscapedString"),C=class extends m{static{o(this,"RailroadEbnfValueConverter")}runConverter(a,e,r){let t=super.runConverter(a,e,r);if(a.name==="TITLE"&&typeof t=="string"){let n=t.trim();if(n.startsWith('"')&&n.endsWith('"')||n.startsWith("'")&&n.endsWith("'"))return b(n)}return t}runCustomConverter(a,e,r){if(a.name==="EBNF_STRING")return b(e);if(a.name==="EBNF_SPECIAL_SEQUENCE")return e.slice(1,-1).trim()}},R={parser:{TokenBuilder:o(()=>new h,"TokenBuilder"),ValueConverter:o(()=>new C,"ValueConverter")}};function S(a=u){let e=i(l(a),f),r=i(c({shared:e}),E,R);return e.ServiceRegistry.register(r),{shared:e,RailroadEbnf:r}}o(S,"createRailroadEbnfServices");export{R as a,S as b};
3
+ //# sourceMappingURL=chunk-46RPN6IE.js.map
@@ -0,0 +1,2 @@
1
+ import{a as Q}from"./chunk-BUZPUGIT.js";import{c as j,d as q,e as K}from"./chunk-HNYXDXPN.js";import{a as O}from"./chunk-M3SWKTLZ.js";import{d as P,e as Y}from"./chunk-OODDZ447.js";import{d as J}from"./chunk-FPLIRG3U.js";import{_ as G,o as Z,y as X}from"./chunk-6FQEBIA3.js";import{b as L,h as I}from"./chunk-L34PKG4P.js";import{a as $}from"./chunk-LDXBIOBF.js";import{d as U}from"./chunk-R7TFKRNM.js";U();var et=$(async(k,t)=>{let l=G(),{themeVariables:b,handDrawnSeed:d}=l,{clusterBkg:x,clusterBorder:m}=b,n=m,{labelStyles:C,nodeStyles:c,borderStyles:R,backgroundStyles:o}=P(t),h=k.insert("g").attr("class","cluster swimlane "+(t.cssClasses||"")).attr("id",t.id).attr("data-id",t.id).attr("data-et","cluster").attr("data-look",t.look),g=Z(l.flowchart.htmlLabels),a=t.direction==="LR",s=h.insert("g").attr("class","cluster-label swimlane-label"),w=await J(s,t.label,{style:t.labelStyle,useHtmlLabels:g,isNode:!0,width:t.width}),r=w.getBBox();if(g){let B=w.children[0],D=I(w);r=B.getBoundingClientRect(),D.attr("width",r.width),D.attr("height",r.height)}let p=t.padding??0,u=t.width<=r.width+p?r.width+p:t.width;t.width<=r.width+p?t.diff=(u-t.width)/2-p:t.diff=-p;let i=t.height,f=t.y-i/2,T=t.y+i/2,e=t.x-u/2,v=t.swimlaneContentTop!==void 0?t.swimlaneContentTop:f+i/3,y=a?4:0,N=r.height+2*y,S,M;if(a){let B=Math.max(N,r.height+2*y),D=e+B,H=Math.max(0,u-B);if(t.look==="handDrawn"){let V=O.svg(h),z=Y(t,{roughness:.7,fill:x,stroke:n,fillWeight:3,seed:d}),_=Y(t,{roughness:.7,fill:"none",stroke:n,seed:d}),A=V.rectangle(e,f,B,i,z);S=h.insert(()=>A,":first-child");let F=V.rectangle(D,f,H,i,_);M=h.insert(()=>F,":first-child"),S.select("path:nth-child(2)").attr("style",R.join(";")),S.select("path").attr("style",o.join(";").replace("fill","stroke"))}else S=h.insert("rect",":first-child"),M=h.insert("rect",":first-child"),S.attr("class","swimlane-title").attr("style",c).attr("x",e).attr("y",f).attr("width",B).attr("height",i).attr("fill",x).attr("stroke",n),M.attr("class","swimlane-body").attr("style",c).attr("x",D).attr("y",f).attr("width",H).attr("height",i).attr("fill","none").attr("stroke",n);let E=e+B/2,W=t.y;s.attr("transform",`translate(${E}, ${W}) rotate(-90) translate(${-r.width/2}, ${-r.height/2})`)}else{let B=Math.max(0,v-f),D=Math.min(N,B),H=f+D,E=Math.max(0,T-H),W=t.x-u/2;if(t.look==="handDrawn"){let _=O.svg(h),A=Y(t,{roughness:.7,fill:x,stroke:n,fillWeight:3,seed:d}),F=Y(t,{roughness:.7,fill:"none",stroke:n,seed:d}),rt=_.rectangle(W,f,u,D,A);S=h.insert(()=>rt,":first-child");let it=_.rectangle(W,H,u,E,F);M=h.insert(()=>it,":first-child"),S.select("path:nth-child(2)").attr("style",R.join(";")),S.select("path").attr("style",o.join(";").replace("fill","stroke"))}else S=h.insert("rect",":first-child"),M=h.insert("rect",":first-child"),S.attr("class","swimlane-title").attr("style",c).attr("x",W).attr("y",f).attr("width",u).attr("height",D).attr("fill",x).attr("stroke",n),M.attr("class","swimlane-body").attr("style",c).attr("x",W).attr("y",H).attr("width",u).attr("height",E).attr("fill","none").attr("stroke",n);let V=t.x-r.width/2,z=f+(D-r.height)/2;s.attr("transform",`translate(${V}, ${z})`)}if(L.trace("Swimlane data ",t,JSON.stringify(t)),C){let B=s.select("span");B&&B.attr("style",C)}return t.offsetX=0,t.width=u,t.height=i,t.offsetY=r.height-p/2,t.intersect=function(B){return j(t,B)},{cluster:h,labelBBox:r}},"swimlane"),tt=$(async(k,t)=>{L.info("Creating subgraph rect for ",t.id,t);let l=G(),{themeVariables:b,handDrawnSeed:d}=l,{clusterBkg:x,clusterBorder:m}=b,{labelStyles:n,nodeStyles:C,borderStyles:c,backgroundStyles:R}=P(t),o=k.insert("g").attr("class","cluster "+t.cssClasses).attr("id",t.domId).attr("data-look",t.look),h=X(l),g=o.insert("g").attr("class","cluster-label "),a;t.labelType==="markdown"?a=await J(g,t.label,{style:t.labelStyle,useHtmlLabels:h,isNode:!0,width:t.width}):a=await K(g,t.label,t.labelStyle||"",!1,!0);let s=a.getBBox();if(X(l)){let e=a.children[0],v=I(a);s=e.getBoundingClientRect(),v.attr("width",s.width),v.attr("height",s.height)}let w=t.width<=s.width+t.padding?s.width+t.padding:t.width;t.width<=s.width+t.padding?t.diff=(w-t.width)/2-t.padding:t.diff=-t.padding;let r=t.height,p=t.x-w/2,u=t.y-r/2;L.trace("Data ",t,JSON.stringify(t));let i;if(t.look==="handDrawn"){let e=O.svg(o),v=Y(t,{roughness:.7,fill:x,stroke:m,fillWeight:3,seed:d}),y=e.path(q(p,u,w,r,0),v);i=o.insert(()=>(L.debug("Rough node insert CXC",y),y),":first-child"),i.select("path:nth-child(2)").attr("style",c.join(";")),i.select("path").attr("style",R.join(";").replace("fill","stroke"))}else i=o.insert("rect",":first-child"),i.attr("style",C).attr("rx",t.rx).attr("ry",t.ry).attr("x",p).attr("y",u).attr("width",w).attr("height",r);let{subGraphTitleTopMargin:f}=Q(l);if(g.attr("transform",`translate(${t.x-s.width/2}, ${t.y-t.height/2+f})`),n){let e=g.select("span");e&&e.attr("style",n)}let T=i.node().getBBox();return t.offsetX=0,t.width=T.width,t.height=T.height,t.offsetY=s.height-t.padding/2,t.intersect=function(e){return j(t,e)},{cluster:o,labelBBox:s}},"rect"),at=$((k,t)=>{let l=k.insert("g").attr("class","note-cluster").attr("id",t.domId),b=l.insert("rect",":first-child"),d=0*t.padding,x=d/2;b.attr("rx",t.rx).attr("ry",t.ry).attr("x",t.x-t.width/2-x).attr("y",t.y-t.height/2-x).attr("width",t.width+d).attr("height",t.height+d).attr("fill","none");let m=b.node().getBBox();return t.width=m.width,t.height=m.height,t.intersect=function(n){return j(t,n)},{cluster:l,labelBBox:{width:0,height:0}}},"noteGroup"),lt=$(async(k,t)=>{let l=G(),{themeVariables:b,handDrawnSeed:d}=l,{altBackground:x,compositeBackground:m,compositeTitleBackground:n,nodeBorder:C}=b,c=k.insert("g").attr("class",t.cssClasses).attr("id",t.domId).attr("data-id",t.id).attr("data-look",t.look),R=c.insert("g",":first-child"),o=c.insert("g").attr("class","cluster-label"),h=c.append("rect"),g=await K(o,t.label,t.labelStyle,void 0,!0),a=g.getBBox();if(X(l)){let y=g.children[0],N=I(g);a=y.getBoundingClientRect(),N.attr("width",a.width),N.attr("height",a.height)}let s=0*t.padding,w=s/2,r=(t.width<=a.width+t.padding?a.width+t.padding:t.width)+s;t.width<=a.width+t.padding?t.diff=(r-t.width)/2-t.padding:t.diff=-t.padding;let p=t.height+s,u=t.height+s-a.height-6,i=t.x-r/2,f=t.y-p/2;t.width=r;let T=t.y-t.height/2-w+a.height+2,e;if(t.look==="handDrawn"){let y=t.cssClasses.includes("statediagram-cluster-alt"),N=O.svg(c),S=t.rx||t.ry?N.path(q(i,f,r,p,10),{roughness:.7,fill:n,fillStyle:"solid",stroke:C,seed:d}):N.rectangle(i,f,r,p,{seed:d});e=c.insert(()=>S,":first-child");let M=N.rectangle(i,T,r,u,{fill:y?x:m,fillStyle:y?"hachure":"solid",stroke:C,seed:d});e=c.insert(()=>S,":first-child"),h=c.insert(()=>M)}else e=R.insert("rect",":first-child"),e.attr("class","outer").attr("x",i).attr("y",f).attr("width",r).attr("height",p).attr("data-look",t.look),h.attr("class","inner").attr("x",i).attr("y",T).attr("width",r).attr("height",u);o.attr("transform",`translate(${t.x-a.width/2}, ${f+1-(X(l)?0:3)})`);let v=e.node().getBBox();return t.height=v.height,t.offsetX=0,t.offsetY=a.height-t.padding/2,t.labelBBox=a,t.intersect=function(y){return j(t,y)},{cluster:c,labelBBox:a}},"roundedWithTitle"),ct=$(async(k,t)=>{L.info("Creating subgraph rect for ",t.id,t);let l=G(),{themeVariables:b,handDrawnSeed:d}=l,{clusterBkg:x,clusterBorder:m}=b,{labelStyles:n,nodeStyles:C,borderStyles:c,backgroundStyles:R}=P(t),o=k.insert("g").attr("class","cluster "+t.cssClasses).attr("id",t.domId).attr("data-look",t.look),h=X(l),g=o.insert("g").attr("class","cluster-label "),a=await J(g,t.label,{style:t.labelStyle,useHtmlLabels:h,isNode:!0,width:t.width}),s=a.getBBox();if(X(l)){let e=a.children[0],v=I(a);s=e.getBoundingClientRect(),v.attr("width",s.width),v.attr("height",s.height)}let w=t.width<=s.width+t.padding?s.width+t.padding:t.width;t.width<=s.width+t.padding?t.diff=(w-t.width)/2-t.padding:t.diff=-t.padding;let r=t.height,p=t.x-w/2,u=t.y-r/2;L.trace("Data ",t,JSON.stringify(t));let i;if(t.look==="handDrawn"){let e=O.svg(o),v=Y(t,{roughness:.7,fill:x,stroke:m,fillWeight:4,seed:d}),y=e.path(q(p,u,w,r,t.rx),v);i=o.insert(()=>(L.debug("Rough node insert CXC",y),y),":first-child"),i.select("path:nth-child(2)").attr("style",c.join(";")),i.select("path").attr("style",R.join(";").replace("fill","stroke"))}else i=o.insert("rect",":first-child"),i.attr("style",C).attr("rx",t.rx).attr("ry",t.ry).attr("x",p).attr("y",u).attr("width",w).attr("height",r);let{subGraphTitleTopMargin:f}=Q(l);if(g.attr("transform",`translate(${t.x-s.width/2}, ${t.y-t.height/2+f})`),n){let e=g.select("span");e&&e.attr("style",n)}let T=i.node().getBBox();return t.offsetX=0,t.width=T.width,t.height=T.height,t.offsetY=s.height-t.padding/2,t.intersect=function(e){return j(t,e)},{cluster:o,labelBBox:s}},"kanbanSection"),ht=$((k,t)=>{let l=G(),{themeVariables:b,handDrawnSeed:d}=l,{nodeBorder:x}=b,m=k.insert("g").attr("class",t.cssClasses).attr("id",t.domId).attr("data-look",t.look),n=m.insert("g",":first-child"),C=0*t.padding,c=t.width+C;t.diff=-t.padding;let R=t.height+C,o=t.x-c/2,h=t.y-R/2;t.width=c;let g;if(t.look==="handDrawn"){let w=O.svg(m).rectangle(o,h,c,R,{fill:"lightgrey",roughness:.5,strokeLineDash:[5],stroke:x,seed:d});g=m.insert(()=>w,":first-child")}else{g=n.insert("rect",":first-child");let s="outer";t.look,s="divider",g.attr("class",s).attr("x",o).attr("y",h).attr("width",c).attr("height",R).attr("data-look",t.look)}let a=g.node().getBBox();return t.height=a.height,t.offsetX=0,t.offsetY=0,t.intersect=function(s){return j(t,s)},{cluster:m,labelBBox:{}}},"divider"),nt=tt,ot={rect:tt,squareRect:nt,roundedWithTitle:lt,noteGroup:at,divider:ht,kanbanSection:ct,swimlane:et},st=new Map,vt=$(async(k,t)=>{let l=t.shape||"rect",b=await ot[l](k,t);return st.set(t.id,b),b},"insertCluster"),St=$(()=>{st=new Map},"clear");export{vt as a,St as b};
2
+ //# sourceMappingURL=chunk-4IPDIKAU.js.map
@@ -0,0 +1,2 @@
1
+ import{a as t}from"./chunk-LDXBIOBF.js";import{d as i}from"./chunk-R7TFKRNM.js";i();function o(c,e){c.accDescr&&e.setAccDescription?.(c.accDescr),c.accTitle&&e.setAccTitle?.(c.accTitle),c.title&&e.setDiagramTitle?.(c.title)}t(o,"populateCommonDb");export{o as a};
2
+ //# sourceMappingURL=chunk-4KP3BIPB.js.map