termbeam 1.24.6 → 1.24.7

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 (78) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/package.json +5 -2
  3. package/public/assets/{arc-B-kHVSHm.js → arc-CN_mAzCx.js} +1 -1
  4. package/public/assets/architectureDiagram-3BPJPVTR-DG5MAGnf.js +36 -0
  5. package/public/assets/blockDiagram-GPEHLZMM-C-jOi0wQ.js +132 -0
  6. package/public/assets/{c4Diagram-AHTNJAMY-CTMgX1cX.js → c4Diagram-AAUBKEIU-Lf-jQplF.js} +1 -1
  7. package/public/assets/channel-BCPoRD6y.js +1 -0
  8. package/public/assets/{chunk-EDXVE4YY-CE8rOa_t.js → chunk-2J33WTMH-C9JymBSL.js} +1 -1
  9. package/public/assets/{chunk-4BX2VUAB-Dh2uLXnN.js → chunk-4BX2VUAB-Csp2FrXm.js} +1 -1
  10. package/public/assets/{chunk-55IACEB6-CXpb7ee_.js → chunk-55IACEB6-yz1xCvvM.js} +1 -1
  11. package/public/assets/chunk-727SXJPM-B3MVWfnV.js +206 -0
  12. package/public/assets/chunk-AQP2D5EJ-B-TNnfnz.js +231 -0
  13. package/public/assets/{chunk-FMBD7UC4-BLg2kyYB.js → chunk-FMBD7UC4-Dtw2KMej.js} +1 -1
  14. package/public/assets/{chunk-YZCP3GAM-BEWtPcgx.js → chunk-ND2GUHAM-CHQn8fqy.js} +1 -1
  15. package/public/assets/{chunk-QZHKN3VN-BKNHHSt_.js → chunk-QZHKN3VN-DBFY1_WB.js} +1 -1
  16. package/public/assets/classDiagram-4FO5ZUOK-Cu1smEpb.js +1 -0
  17. package/public/assets/classDiagram-v2-Q7XG4LA2-Cu1smEpb.js +1 -0
  18. package/public/assets/{cose-bilkent-S5V4N54A-D0oPvtgW.js → cose-bilkent-S5V4N54A-CCEZDlDl.js} +1 -1
  19. package/public/assets/dagre-BM42HDAG-BRbrP_yo.js +4 -0
  20. package/public/assets/diagram-2AECGRRQ-CbD1yOYx.js +43 -0
  21. package/public/assets/diagram-5GNKFQAL-BP3jOKKR.js +10 -0
  22. package/public/assets/diagram-KO2AKTUF-BSDZWca7.js +3 -0
  23. package/public/assets/diagram-LMA3HP47-Cc6VwNQA.js +24 -0
  24. package/public/assets/diagram-OG6HWLK6-DKU0ICzr.js +24 -0
  25. package/public/assets/{erDiagram-SMLLAGMA-DauayxtN.js → erDiagram-TEJ5UH35-BnoW0mTO.js} +1 -1
  26. package/public/assets/{flowDiagram-DWJPFMVM-B9Vlj9_Q.js → flowDiagram-I6XJVG4X-deD4XLcv.js} +1 -1
  27. package/public/assets/{ganttDiagram-T4ZO3ILL-DzKvltPM.js → ganttDiagram-6RSMTGT7-BgYvdjYD.js} +4 -4
  28. package/public/assets/gitGraphDiagram-PVQCEYII-BtPMKzJD.js +106 -0
  29. package/public/assets/graph-CAnANduQ.js +1 -0
  30. package/public/assets/{index-BGmKdmbq.js → index-DYmxHUor.js} +205 -206
  31. package/public/assets/infoDiagram-5YYISTIA-BNFXZeHF.js +2 -0
  32. package/public/assets/{ishikawaDiagram-UXIWVN3A-CVU0u8sm.js → ishikawaDiagram-YF4QCWOH-DuehQ5YB.js} +1 -1
  33. package/public/assets/{journeyDiagram-VCZTEJTY-CqA6npNF.js → journeyDiagram-JHISSGLW-Blto5i-o.js} +1 -1
  34. package/public/assets/{kanban-definition-6JOO6SKY-D9q90aEW.js → kanban-definition-UN3LZRKU-S2WBlPRG.js} +1 -1
  35. package/public/assets/layout-DGIYPm2g.js +1 -0
  36. package/public/assets/{linear-BSD1339P.js → linear-CMeCahwl.js} +1 -1
  37. package/public/assets/{mindmap-definition-QFDTVHPH-izsv4jah.js → mindmap-definition-RKZ34NQL-GBziQpLb.js} +5 -5
  38. package/public/assets/pieDiagram-4H26LBE5-Dlh-y7ih.js +30 -0
  39. package/public/assets/quadrantDiagram-W4KKPZXB-tr5QhZAJ.js +7 -0
  40. package/public/assets/{requirementDiagram-MS252O5E-BPWx8zxI.js → requirementDiagram-4Y6WPE33-_qV3HlS7.js} +1 -1
  41. package/public/assets/sankeyDiagram-5OEKKPKP-C7-d2ULi.js +40 -0
  42. package/public/assets/sequenceDiagram-3UESZ5HK-CYGsjwvO.js +162 -0
  43. package/public/assets/stateDiagram-AJRCARHV-D5wVSY__.js +1 -0
  44. package/public/assets/stateDiagram-v2-BHNVJYJU-DcLQpqf2.js +1 -0
  45. package/public/assets/{timeline-definition-GMOUNBTQ-RBm7leY_.js → timeline-definition-PNZ67QCA-B7tB0CoS.js} +1 -1
  46. package/public/assets/{vennDiagram-DHZGUBPP-DxJlwpQM.js → vennDiagram-CIIHVFJN-CX_n409t.js} +1 -1
  47. package/public/assets/wardley-L42UT6IY-eoSJq8mJ.js +173 -0
  48. package/public/assets/wardleyDiagram-YWT4CUSO-lQio0_RH.js +78 -0
  49. package/public/assets/{xychartDiagram-5P7HB3ND-BZwzlEyy.js → xychartDiagram-2RQKCTM6-Bv9Hklj4.js} +1 -1
  50. package/public/index.html +1 -1
  51. package/public/sw.js +1 -1
  52. package/public/assets/_basePickBy-CropUxEy.js +0 -1
  53. package/public/assets/_baseUniq-DhZINcU9.js +0 -1
  54. package/public/assets/architectureDiagram-Q4EWVU46-DRl95ZRx.js +0 -36
  55. package/public/assets/blockDiagram-DXYQGD6D-BYsytJkG.js +0 -132
  56. package/public/assets/channel-cJ7IKSvr.js +0 -1
  57. package/public/assets/chunk-4TB4RGXK-D1PYPWHm.js +0 -206
  58. package/public/assets/chunk-OYMX7WX6-bqxT3ZHj.js +0 -231
  59. package/public/assets/classDiagram-6PBFFD2Q-zPNjkgfP.js +0 -1
  60. package/public/assets/classDiagram-v2-HSJHXN6E-zPNjkgfP.js +0 -1
  61. package/public/assets/clone-BT4FDaUd.js +0 -1
  62. package/public/assets/dagre-KV5264BT-ClUWyWMN.js +0 -4
  63. package/public/assets/diagram-5BDNPKRD-CSuwSi7l.js +0 -10
  64. package/public/assets/diagram-G4DWMVQ6-BfuJkGqa.js +0 -24
  65. package/public/assets/diagram-MMDJMWI5-rsxXrn5j.js +0 -43
  66. package/public/assets/diagram-TYMM5635-CiV_d4kk.js +0 -24
  67. package/public/assets/gitGraphDiagram-UUTBAWPF-CiAFlpLn.js +0 -106
  68. package/public/assets/graph-Dctbvw2Z.js +0 -1
  69. package/public/assets/infoDiagram-42DDH7IO-DY9CEIu4.js +0 -2
  70. package/public/assets/layout-pWVZP2Gn.js +0 -1
  71. package/public/assets/pieDiagram-DEJITSTG-CAHofmwS.js +0 -30
  72. package/public/assets/quadrantDiagram-34T5L4WZ-DnLA26kb.js +0 -7
  73. package/public/assets/sankeyDiagram-XADWPNL6-CcHCN8ZN.js +0 -10
  74. package/public/assets/sequenceDiagram-FGHM5R23-CWdWgkGM.js +0 -157
  75. package/public/assets/stateDiagram-FHFEXIEX-bGNCZX08.js +0 -1
  76. package/public/assets/stateDiagram-v2-QKLJ7IA2-DlEiSt3V.js +0 -1
  77. package/public/assets/wardley-RL74JXVD-mcAzA-kJ.js +0 -162
  78. package/public/assets/wardleyDiagram-NUSXRM2D-B3HIOLBU.js +0 -20
@@ -1,231 +0,0 @@
1
- import{g as te}from"./chunk-55IACEB6-CXpb7ee_.js";import{s as ee}from"./chunk-EDXVE4YY-CE8rOa_t.js";import{_ as f,l as b,c as F,r as se,u as ie,a as re,b as ae,g as ne,s as le,p as oe,q as ce,T as he,k as H,z as ue}from"./index-BGmKdmbq.js";var vt=(function(){var t=f(function(V,l,h,n){for(h=h||{},n=V.length;n--;h[V[n]]=l);return h},"o"),e=[1,2],s=[1,3],a=[1,4],i=[2,4],o=[1,9],u=[1,11],p=[1,16],S=[1,17],T=[1,18],E=[1,19],m=[1,33],L=[1,20],v=[1,21],O=[1,22],w=[1,23],C=[1,24],d=[1,26],D=[1,27],$=[1,28],B=[1,29],I=[1,30],G=[1,31],P=[1,32],at=[1,35],nt=[1,36],lt=[1,37],ot=[1,38],K=[1,34],y=[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],ct=[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],xt=[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],gt={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(l,h,n,g,_,r,Z){var c=r.length-1;switch(_){case 3:return g.setRootDoc(r[c]),r[c];case 4:this.$=[];break;case 5:r[c]!="nl"&&(r[c-1].push(r[c]),this.$=r[c-1]);break;case 6:case 7:this.$=r[c];break;case 8:this.$="nl";break;case 12:this.$=r[c];break;case 13:const tt=r[c-1];tt.description=g.trimColon(r[c]),this.$=tt;break;case 14:this.$={stmt:"relation",state1:r[c-2],state2:r[c]};break;case 15:const Tt=g.trimColon(r[c]);this.$={stmt:"relation",state1:r[c-3],state2:r[c-1],description:Tt};break;case 19:this.$={stmt:"state",id:r[c-3],type:"default",description:"",doc:r[c-1]};break;case 20:var U=r[c],X=r[c-2].trim();if(r[c].match(":")){var ut=r[c].split(":");U=ut[0],X=[X,ut[1]]}this.$={stmt:"state",id:U,type:"default",description:X};break;case 21:this.$={stmt:"state",id:r[c-3],type:"default",description:r[c-5],doc:r[c-1]};break;case 22:this.$={stmt:"state",id:r[c],type:"fork"};break;case 23:this.$={stmt:"state",id:r[c],type:"join"};break;case 24:this.$={stmt:"state",id:r[c],type:"choice"};break;case 25:this.$={stmt:"state",id:g.getDividerId(),type:"divider"};break;case 26:this.$={stmt:"state",id:r[c-1].trim(),note:{position:r[c-2].trim(),text:r[c].trim()}};break;case 29:this.$=r[c].trim(),g.setAccTitle(this.$);break;case 30:case 31:this.$=r[c].trim(),g.setAccDescription(this.$);break;case 32:this.$={stmt:"click",id:r[c-3],url:r[c-2],tooltip:r[c-1]};break;case 33:this.$={stmt:"click",id:r[c-3],url:r[c-1],tooltip:""};break;case 34:case 35:this.$={stmt:"classDef",id:r[c-1].trim(),classes:r[c].trim()};break;case 36:this.$={stmt:"style",id:r[c-1].trim(),styleClass:r[c].trim()};break;case 37:this.$={stmt:"applyClass",id:r[c-1].trim(),styleClass:r[c].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[c].trim(),type:"default",description:""};break;case 46:this.$={stmt:"state",id:r[c-2].trim(),classes:[r[c].trim()],type:"default",description:""};break;case 47:this.$={stmt:"state",id:r[c-2].trim(),classes:[r[c].trim()],type:"default",description:""};break}},"anonymous"),table:[{3:1,4:e,5:s,6:a},{1:[3]},{3:5,4:e,5:s,6:a},{3:6,4:e,5:s,6:a},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],i,{7:7}),{1:[2,1]},{1:[2,2]},{1:[2,3],4:o,5:u,8:8,9:10,10:12,11:13,12:14,13:15,16:p,17:S,19:T,22:E,24:m,25:L,26:v,27:O,28:w,29:C,32:25,33:d,35:D,37:$,38:B,41:I,45:G,48:P,51:at,52:nt,53:lt,54:ot,57:K},t(y,[2,5]),{9:39,10:12,11:13,12:14,13:15,16:p,17:S,19:T,22:E,24:m,25:L,26:v,27:O,28:w,29:C,32:25,33:d,35:D,37:$,38:B,41:I,45:G,48:P,51:at,52:nt,53:lt,54:ot,57:K},t(y,[2,7]),t(y,[2,8]),t(y,[2,9]),t(y,[2,10]),t(y,[2,11]),t(y,[2,12],{14:[1,40],15:[1,41]}),t(y,[2,16]),{18:[1,42]},t(y,[2,18],{20:[1,43]}),{23:[1,44]},t(y,[2,22]),t(y,[2,23]),t(y,[2,24]),t(y,[2,25]),{30:45,31:[1,46],59:[1,47],60:[1,48]},t(y,[2,28]),{34:[1,49]},{36:[1,50]},t(y,[2,31]),{13:51,24:m,57:K},{42:[1,52],44:[1,53]},{46:[1,54]},{49:[1,55]},t(ct,[2,44],{58:[1,56]}),t(ct,[2,45],{58:[1,57]}),t(y,[2,38]),t(y,[2,39]),t(y,[2,40]),t(y,[2,41]),t(y,[2,6]),t(y,[2,13]),{13:58,24:m,57:K},t(y,[2,17]),t(xt,i,{7:59}),{24:[1,60]},{24:[1,61]},{23:[1,62]},{24:[2,48]},{24:[2,49]},t(y,[2,29]),t(y,[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(y,[2,14],{14:[1,71]}),{4:o,5:u,8:8,9:10,10:12,11:13,12:14,13:15,16:p,17:S,19:T,21:[1,72],22:E,24:m,25:L,26:v,27:O,28:w,29:C,32:25,33:d,35:D,37:$,38:B,41:I,45:G,48:P,51:at,52:nt,53:lt,54:ot,57:K},t(y,[2,20],{20:[1,73]}),{31:[1,74]},{24:[1,75]},{39:[1,76]},{39:[1,77]},t(y,[2,34]),t(y,[2,35]),t(y,[2,36]),t(y,[2,37]),t(ct,[2,46]),t(ct,[2,47]),t(y,[2,15]),t(y,[2,19]),t(xt,i,{7:78}),t(y,[2,26]),t(y,[2,27]),{5:[1,79]},{5:[1,80]},{4:o,5:u,8:8,9:10,10:12,11:13,12:14,13:15,16:p,17:S,19:T,21:[1,81],22:E,24:m,25:L,26:v,27:O,28:w,29:C,32:25,33:d,35:D,37:$,38:B,41:I,45:G,48:P,51:at,52:nt,53:lt,54:ot,57:K},t(y,[2,32]),t(y,[2,33]),t(y,[2,21])],defaultActions:{5:[2,1],6:[2,2],47:[2,48],48:[2,49]},parseError:f(function(l,h){if(h.recoverable)this.trace(l);else{var n=new Error(l);throw n.hash=h,n}},"parseError"),parse:f(function(l){var h=this,n=[0],g=[],_=[null],r=[],Z=this.table,c="",U=0,X=0,ut=2,tt=1,Tt=r.slice.call(arguments,1),k=Object.create(this.lexer),W={yy:{}};for(var Et in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Et)&&(W.yy[Et]=this.yy[Et]);k.setInput(l,W.yy),W.yy.lexer=k,W.yy.parser=this,typeof k.yylloc>"u"&&(k.yylloc={});var _t=k.yylloc;r.push(_t);var Qt=k.options&&k.options.ranges;typeof W.yy.parseError=="function"?this.parseError=W.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Zt(R){n.length=n.length-2*R,_.length=_.length-R,r.length=r.length-R}f(Zt,"popStack");function Lt(){var R;return R=g.pop()||k.lex()||tt,typeof R!="number"&&(R instanceof Array&&(g=R,R=g.pop()),R=h.symbols_[R]||R),R}f(Lt,"lex");for(var x,j,N,mt,J={},dt,Y,Ot,ft;;){if(j=n[n.length-1],this.defaultActions[j]?N=this.defaultActions[j]:((x===null||typeof x>"u")&&(x=Lt()),N=Z[j]&&Z[j][x]),typeof N>"u"||!N.length||!N[0]){var bt="";ft=[];for(dt in Z[j])this.terminals_[dt]&&dt>ut&&ft.push("'"+this.terminals_[dt]+"'");k.showPosition?bt="Parse error on line "+(U+1)+`:
2
- `+k.showPosition()+`
3
- Expecting `+ft.join(", ")+", got '"+(this.terminals_[x]||x)+"'":bt="Parse error on line "+(U+1)+": Unexpected "+(x==tt?"end of input":"'"+(this.terminals_[x]||x)+"'"),this.parseError(bt,{text:k.match,token:this.terminals_[x]||x,line:k.yylineno,loc:_t,expected:ft})}if(N[0]instanceof Array&&N.length>1)throw new Error("Parse Error: multiple actions possible at state: "+j+", token: "+x);switch(N[0]){case 1:n.push(x),_.push(k.yytext),r.push(k.yylloc),n.push(N[1]),x=null,X=k.yyleng,c=k.yytext,U=k.yylineno,_t=k.yylloc;break;case 2:if(Y=this.productions_[N[1]][1],J.$=_[_.length-Y],J._$={first_line:r[r.length-(Y||1)].first_line,last_line:r[r.length-1].last_line,first_column:r[r.length-(Y||1)].first_column,last_column:r[r.length-1].last_column},Qt&&(J._$.range=[r[r.length-(Y||1)].range[0],r[r.length-1].range[1]]),mt=this.performAction.apply(J,[c,X,U,W.yy,N[1],_,r].concat(Tt)),typeof mt<"u")return mt;Y&&(n=n.slice(0,-1*Y*2),_=_.slice(0,-1*Y),r=r.slice(0,-1*Y)),n.push(this.productions_[N[1]][0]),_.push(J.$),r.push(J._$),Ot=Z[n[n.length-2]][n[n.length-1]],n.push(Ot);break;case 3:return!0}}return!0},"parse")},qt=(function(){var V={EOF:1,parseError:f(function(h,n){if(this.yy.parser)this.yy.parser.parseError(h,n);else throw new Error(h)},"parseError"),setInput:f(function(l,h){return this.yy=h||this.yy||{},this._input=l,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 l=this._input[0];this.yytext+=l,this.yyleng++,this.offset++,this.match+=l,this.matched+=l;var h=l.match(/(?:\r\n?|\n).*/g);return h?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),l},"input"),unput:f(function(l){var h=l.length,n=l.split(/(?:\r\n?|\n)/g);this._input=l+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-h),this.offset-=h;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),n.length-1&&(this.yylineno-=n.length-1);var _=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===g.length?this.yylloc.first_column:0)+g[g.length-n.length].length-n[0].length:this.yylloc.first_column-h},this.options.ranges&&(this.yylloc.range=[_[0],_[0]+this.yyleng-h]),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(l){this.unput(this.match.slice(l))},"less"),pastInput:f(function(){var l=this.matched.substr(0,this.matched.length-this.match.length);return(l.length>20?"...":"")+l.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:f(function(){var l=this.match;return l.length<20&&(l+=this._input.substr(0,20-l.length)),(l.substr(0,20)+(l.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:f(function(){var l=this.pastInput(),h=new Array(l.length+1).join("-");return l+this.upcomingInput()+`
5
- `+h+"^"},"showPosition"),test_match:f(function(l,h){var n,g,_;if(this.options.backtrack_lexer&&(_={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&&(_.yylloc.range=this.yylloc.range.slice(0))),g=l[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+l[0].length},this.yytext+=l[0],this.match+=l[0],this.matches=l,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(l[0].length),this.matched+=l[0],n=this.performAction.call(this,this.yy,this,h,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var r in _)this[r]=_[r];return!1}return!1},"test_match"),next:f(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var l,h,n,g;this._more||(this.yytext="",this.match="");for(var _=this._currentRules(),r=0;r<_.length;r++)if(n=this._input.match(this.rules[_[r]]),n&&(!h||n[0].length>h[0].length)){if(h=n,g=r,this.options.backtrack_lexer){if(l=this.test_match(n,_[r]),l!==!1)return l;if(this._backtrack){h=!1;continue}else return!1}else if(!this.options.flex)break}return h?(l=this.test_match(h,_[g]),l!==!1?l:!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 h=this.next();return h||this.lex()},"lex"),begin:f(function(h){this.conditionStack.push(h)},"begin"),popState:f(function(){var h=this.conditionStack.length-1;return h>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(h){return h=this.conditionStack.length-1-Math.abs(h||0),h>=0?this.conditionStack[h]:"INITIAL"},"topState"),pushState:f(function(h){this.begin(h)},"pushState"),stateStackSize:f(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:f(function(h,n,g,_){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: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(),n.yytext=n.yytext.slice(0,-8).trim(),25;case 40:return this.popState(),n.yytext=n.yytext.slice(0,-8).trim(),26;case 41:return this.popState(),n.yytext=n.yytext.slice(0,-10).trim(),27;case 42:return this.popState(),n.yytext=n.yytext.slice(0,-8).trim(),25;case 43:return this.popState(),n.yytext=n.yytext.slice(0,-8).trim(),26;case 44:return this.popState(),n.yytext=n.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(),n.yytext=n.yytext.substr(2).trim(),31;case 70:return this.popState(),n.yytext=n.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 n.yytext=n.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}}};return V})();gt.lexer=qt;function ht(){this.yy={}}return f(ht,"Parser"),ht.prototype=gt,gt.Parser=ht,new ht})();vt.parser=vt;var Ye=vt,de="TB",Bt="TB",Rt="dir",Q="state",q="root",Ct="relation",fe="classDef",pe="style",Se="applyClass",it="default",Gt="divider",Yt="fill:none",Vt="fill: #333",Mt="c",Ut="markdown",Wt="normal",kt="rect",Dt="rectWithTitle",ye="stateStart",ge="stateEnd",It="divider",Nt="roundedWithTitle",Te="note",Ee="noteGroup",rt="statediagram",_e="state",me=`${rt}-${_e}`,jt="transition",be="note",ke="note-edge",De=`${jt} ${ke}`,ve=`${rt}-${be}`,Ce="cluster",Ae=`${rt}-${Ce}`,xe="cluster-alt",Le=`${rt}-${xe}`,Ht="parent",zt="note",Oe="state",At="----",Re=`${At}${zt}`,wt=`${At}${Ht}`,Kt=f((t,e=Bt)=>{if(!t.doc)return e;let s=e;for(const a of t.doc)a.stmt==="dir"&&(s=a.value);return s},"getDir"),Ie=f(function(t,e){return e.db.getClasses()},"getClasses"),Ne=f(async function(t,e,s,a){b.info("REF0:"),b.info("Drawing state diagram (v2)",e);const{securityLevel:i,state:o,layout:u}=F();a.db.extract(a.db.getRootDocV2());const p=a.db.getData(),S=te(e,i);p.type=a.type,p.layoutAlgorithm=u,p.nodeSpacing=(o==null?void 0:o.nodeSpacing)||50,p.rankSpacing=(o==null?void 0:o.rankSpacing)||50,F().look==="neo"?p.markers=["barbNeo"]:p.markers=["barb"],p.diagramId=e,await se(p,S);const E=8;try{(typeof a.db.getLinks=="function"?a.db.getLinks():new Map).forEach((L,v)=>{var B;const O=typeof v=="string"?v:typeof(v==null?void 0:v.id)=="string"?v.id:"";if(!O){b.warn("⚠️ Invalid or missing stateId from key:",JSON.stringify(v));return}const w=(B=S.node())==null?void 0:B.querySelectorAll("g");let C;if(w==null||w.forEach(I=>{var P;((P=I.textContent)==null?void 0:P.trim())===O&&(C=I)}),!C){b.warn("⚠️ Could not find node matching text:",O);return}const d=C.parentNode;if(!d){b.warn("⚠️ Node has no parent, cannot wrap:",O);return}const D=document.createElementNS("http://www.w3.org/2000/svg","a"),$=L.url.replace(/^"+|"+$/g,"");if(D.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",$),D.setAttribute("target","_blank"),L.tooltip){const I=L.tooltip.replace(/^"+|"+$/g,"");D.setAttribute("title",I)}d.replaceChild(D,C),D.appendChild(C),b.info("🔗 Wrapped node in <a> tag for:",O,L.url)})}catch(m){b.error("❌ Error injecting clickable links:",m)}ie.insertTitle(S,"statediagramTitleText",(o==null?void 0:o.titleTopMargin)??25,a.db.getDiagramTitle()),ee(S,E,rt,(o==null?void 0:o.useMaxWidth)??!0)},"draw"),Ve={getClasses:Ie,draw:Ne,getDir:Kt},St=new Map,M=0;function yt(t="",e=0,s="",a=At){const i=s!==null&&s.length>0?`${a}${s}`:"";return`${Oe}-${t}${i}-${e}`}f(yt,"stateDomId");var we=f((t,e,s,a,i,o,u,p)=>{b.trace("items",e),e.forEach(S=>{switch(S.stmt){case Q:st(t,S,s,a,i,o,u,p);break;case it:st(t,S,s,a,i,o,u,p);break;case Ct:{st(t,S.state1,s,a,i,o,u,p),st(t,S.state2,s,a,i,o,u,p);const T=u==="neo",E={id:"edge"+M,start:S.state1.id,end:S.state2.id,arrowhead:"normal",arrowTypeEnd:T?"arrow_barb_neo":"arrow_barb",style:Yt,labelStyle:"",label:H.sanitizeText(S.description??"",F()),arrowheadStyle:Vt,labelpos:Mt,labelType:Ut,thickness:Wt,classes:jt,look:u};i.push(E),M++}break}})},"setupDoc"),$t=f((t,e=Bt)=>{let s=e;if(t.doc)for(const a of t.doc)a.stmt==="dir"&&(s=a.value);return s},"getDir");function et(t,e,s){if(!e.id||e.id==="</join></fork>"||e.id==="</choice>")return;e.cssClasses&&(Array.isArray(e.cssCompiledStyles)||(e.cssCompiledStyles=[]),e.cssClasses.split(" ").forEach(i=>{const o=s.get(i);o&&(e.cssCompiledStyles=[...e.cssCompiledStyles??[],...o.styles])}));const a=t.find(i=>i.id===e.id);a?Object.assign(a,e):t.push(e)}f(et,"insertOrUpdateNode");function Xt(t){var e;return((e=t==null?void 0:t.classes)==null?void 0:e.join(" "))??""}f(Xt,"getClassesFromDbInfo");function Jt(t){return(t==null?void 0:t.styles)??[]}f(Jt,"getStylesFromDbInfo");var st=f((t,e,s,a,i,o,u,p)=>{var v,O,w;const S=e.id,T=s.get(S),E=Xt(T),m=Jt(T),L=F();if(b.info("dataFetcher parsedItem",e,T,m),S!=="root"){let C=kt;e.start===!0?C=ye:e.start===!1&&(C=ge),e.type!==it&&(C=e.type),St.get(S)||St.set(S,{id:S,shape:C,description:H.sanitizeText(S,L),cssClasses:`${E} ${me}`,cssStyles:m});const d=St.get(S);e.description&&(Array.isArray(d.description)?(d.shape=Dt,d.description.push(e.description)):(v=d.description)!=null&&v.length&&d.description.length>0?(d.shape=Dt,d.description===S?d.description=[e.description]:d.description=[d.description,e.description]):(d.shape=kt,d.description=e.description),d.description=H.sanitizeTextOrArray(d.description,L)),((O=d.description)==null?void 0:O.length)===1&&d.shape===Dt&&(d.type==="group"?d.shape=Nt:d.shape=kt),!d.type&&e.doc&&(b.info("Setting cluster for XCX",S,$t(e)),d.type="group",d.isGroup=!0,d.dir=$t(e),d.shape=e.type===Gt?It:Nt,d.cssClasses=`${d.cssClasses} ${Ae} ${o?Le:""}`);const D={labelStyle:"",shape:d.shape,label:d.description,cssClasses:d.cssClasses,cssCompiledStyles:[],cssStyles:d.cssStyles,id:S,dir:d.dir,domId:yt(S,M),type:d.type,isGroup:d.type==="group",padding:8,rx:10,ry:10,look:u,labelType:"markdown"};if(D.shape===It&&(D.label=""),t&&t.id!=="root"&&(b.trace("Setting node ",S," to be child of its parent ",t.id),D.parentId=t.id),D.centerLabel=!0,e.note){const $={labelStyle:"",shape:Te,label:e.note.text,labelType:"markdown",cssClasses:ve,cssStyles:[],cssCompiledStyles:[],id:S+Re+"-"+M,domId:yt(S,M,zt),type:d.type,isGroup:d.type==="group",padding:(w=L.flowchart)==null?void 0:w.padding,look:u,position:e.note.position},B=S+wt,I={labelStyle:"",shape:Ee,label:e.note.text,cssClasses:d.cssClasses,cssStyles:[],id:S+wt,domId:yt(S,M,Ht),type:"group",isGroup:!0,padding:16,look:u,position:e.note.position};M++,I.id=B,$.parentId=B,et(a,I,p),et(a,$,p),et(a,D,p);let G=S,P=$.id;e.note.position==="left of"&&(G=$.id,P=S),i.push({id:G+"-"+P,start:G,end:P,arrowhead:"none",arrowTypeEnd:"",style:Yt,labelStyle:"",classes:De,arrowheadStyle:Vt,labelpos:Mt,labelType:Ut,thickness:Wt,look:u})}else et(a,D,p)}e.doc&&(b.trace("Adding nodes children "),we(e,e.doc,s,a,i,!o,u,p))},"dataFetcher"),$e=f(()=>{St.clear(),M=0},"reset"),A={START_NODE:"[*]",START_TYPE:"start",END_NODE:"[*]",END_TYPE:"end",COLOR_KEYWORD:"color",FILL_KEYWORD:"fill",BG_FILL:"bgFill",STYLECLASS_SEP:","},Pt=f(()=>new Map,"newClassesList"),Ft=f(()=>({relations:[],states:new Map,documents:{}}),"newDoc"),pt=f(t=>JSON.parse(JSON.stringify(t)),"clone"),z,Me=(z=class{constructor(e){this.version=e,this.nodes=[],this.edges=[],this.rootDoc=[],this.classes=Pt(),this.documents={root:Ft()},this.currentDocument=this.documents.root,this.startEndCount=0,this.dividerCnt=0,this.links=new Map,this.getAccTitle=re,this.setAccTitle=ae,this.getAccDescription=ne,this.setAccDescription=le,this.setDiagramTitle=oe,this.getDiagramTitle=ce,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)}extract(e){this.clear(!0);for(const i of Array.isArray(e)?e:e.doc)switch(i.stmt){case Q:this.addState(i.id.trim(),i.type,i.doc,i.description,i.note);break;case Ct:this.addRelation(i.state1,i.state2,i.description);break;case fe:this.addStyleClass(i.id.trim(),i.classes);break;case pe:this.handleStyleDef(i);break;case Se:this.setCssClass(i.id.trim(),i.styleClass);break;case"click":this.addLink(i.id,i.url,i.tooltip);break}const s=this.getStates(),a=F();$e(),st(void 0,this.getRootDocV2(),s,this.nodes,this.edges,!0,a.look,this.classes);for(const i of this.nodes)if(Array.isArray(i.label)){if(i.description=i.label.slice(1),i.isGroup&&i.description.length>0)throw new Error(`Group nodes can only have label. Remove the additional description for node [${i.id}]`);i.label=i.label[0]}}handleStyleDef(e){const s=e.id.trim().split(","),a=e.styleClass.split(",");for(const i of s){let o=this.getState(i);if(!o){const u=i.trim();this.addState(u),o=this.getState(u)}o&&(o.styles=a.map(u=>{var p;return(p=u.replace(/;/g,""))==null?void 0:p.trim()}))}}setRootDoc(e){b.info("Setting root doc",e),this.rootDoc=e,this.version===1?this.extract(e):this.extract(this.getRootDocV2())}docTranslator(e,s,a){if(s.stmt===Ct){this.docTranslator(e,s.state1,!0),this.docTranslator(e,s.state2,!1);return}if(s.stmt===Q&&(s.id===A.START_NODE?(s.id=e.id+(a?"_start":"_end"),s.start=a):s.id=s.id.trim()),s.stmt!==q&&s.stmt!==Q||!s.doc)return;const i=[];let o=[];for(const u of s.doc)if(u.type===Gt){const p=pt(u);p.doc=pt(o),i.push(p),o=[]}else o.push(u);if(i.length>0&&o.length>0){const u={stmt:Q,id:he(),type:"divider",doc:pt(o)};i.push(pt(u)),s.doc=i}s.doc.forEach(u=>this.docTranslator(s,u,!0))}getRootDocV2(){return this.docTranslator({id:q,stmt:q},{id:q,stmt:q,doc:this.rootDoc},!0),{id:q,doc:this.rootDoc}}addState(e,s=it,a=void 0,i=void 0,o=void 0,u=void 0,p=void 0,S=void 0){const T=e==null?void 0:e.trim();if(!this.currentDocument.states.has(T))b.info("Adding state ",T,i),this.currentDocument.states.set(T,{stmt:Q,id:T,descriptions:[],type:s,doc:a,note:o,classes:[],styles:[],textStyles:[]});else{const E=this.currentDocument.states.get(T);if(!E)throw new Error(`State not found: ${T}`);E.doc||(E.doc=a),E.type||(E.type=s)}if(i&&(b.info("Setting state description",T,i),(Array.isArray(i)?i:[i]).forEach(m=>this.addDescription(T,m.trim()))),o){const E=this.currentDocument.states.get(T);if(!E)throw new Error(`State not found: ${T}`);E.note=o,E.note.text=H.sanitizeText(E.note.text,F())}u&&(b.info("Setting state classes",T,u),(Array.isArray(u)?u:[u]).forEach(m=>this.setCssClass(T,m.trim()))),p&&(b.info("Setting state styles",T,p),(Array.isArray(p)?p:[p]).forEach(m=>this.setStyle(T,m.trim()))),S&&(b.info("Setting state styles",T,p),(Array.isArray(S)?S:[S]).forEach(m=>this.setTextStyle(T,m.trim())))}clear(e){this.nodes=[],this.edges=[],this.documents={root:Ft()},this.currentDocument=this.documents.root,this.startEndCount=0,this.classes=Pt(),e||(this.links=new Map,ue())}getState(e){return this.currentDocument.states.get(e)}getStates(){return this.currentDocument.states}logDocuments(){b.info("Documents = ",this.documents)}getRelations(){return this.currentDocument.relations}addLink(e,s,a){this.links.set(e,{url:s,tooltip:a}),b.warn("Adding link",e,s,a)}getLinks(){return this.links}startIdIfNeeded(e=""){return e===A.START_NODE?(this.startEndCount++,`${A.START_TYPE}${this.startEndCount}`):e}startTypeIfNeeded(e="",s=it){return e===A.START_NODE?A.START_TYPE:s}endIdIfNeeded(e=""){return e===A.END_NODE?(this.startEndCount++,`${A.END_TYPE}${this.startEndCount}`):e}endTypeIfNeeded(e="",s=it){return e===A.END_NODE?A.END_TYPE:s}addRelationObjs(e,s,a=""){const i=this.startIdIfNeeded(e.id.trim()),o=this.startTypeIfNeeded(e.id.trim(),e.type),u=this.startIdIfNeeded(s.id.trim()),p=this.startTypeIfNeeded(s.id.trim(),s.type);this.addState(i,o,e.doc,e.description,e.note,e.classes,e.styles,e.textStyles),this.addState(u,p,s.doc,s.description,s.note,s.classes,s.styles,s.textStyles),this.currentDocument.relations.push({id1:i,id2:u,relationTitle:H.sanitizeText(a,F())})}addRelation(e,s,a){if(typeof e=="object"&&typeof s=="object")this.addRelationObjs(e,s,a);else if(typeof e=="string"&&typeof s=="string"){const i=this.startIdIfNeeded(e.trim()),o=this.startTypeIfNeeded(e),u=this.endIdIfNeeded(s.trim()),p=this.endTypeIfNeeded(s);this.addState(i,o),this.addState(u,p),this.currentDocument.relations.push({id1:i,id2:u,relationTitle:a?H.sanitizeText(a,F()):void 0})}}addDescription(e,s){var o;const a=this.currentDocument.states.get(e),i=s.startsWith(":")?s.replace(":","").trim():s;(o=a==null?void 0:a.descriptions)==null||o.push(H.sanitizeText(i,F()))}cleanupLabel(e){return e.startsWith(":")?e.slice(2).trim():e.trim()}getDividerId(){return this.dividerCnt++,`divider-id-${this.dividerCnt}`}addStyleClass(e,s=""){this.classes.has(e)||this.classes.set(e,{id:e,styles:[],textStyles:[]});const a=this.classes.get(e);s&&a&&s.split(A.STYLECLASS_SEP).forEach(i=>{const o=i.replace(/([^;]*);/,"$1").trim();if(RegExp(A.COLOR_KEYWORD).exec(i)){const p=o.replace(A.FILL_KEYWORD,A.BG_FILL).replace(A.COLOR_KEYWORD,A.FILL_KEYWORD);a.textStyles.push(p)}a.styles.push(o)})}getClasses(){return this.classes}setCssClass(e,s){e.split(",").forEach(a=>{var o;let i=this.getState(a);if(!i){const u=a.trim();this.addState(u),i=this.getState(u)}(o=i==null?void 0:i.classes)==null||o.push(s)})}setStyle(e,s){var a,i;(i=(a=this.getState(e))==null?void 0:a.styles)==null||i.push(s)}setTextStyle(e,s){var a,i;(i=(a=this.getState(e))==null?void 0:a.textStyles)==null||i.push(s)}getDirectionStatement(){return this.rootDoc.find(e=>e.stmt===Rt)}getDirection(){var e;return((e=this.getDirectionStatement())==null?void 0:e.value)??de}setDirection(e){const s=this.getDirectionStatement();s?s.value=e:this.rootDoc.unshift({stmt:Rt,value:e})}trimColon(e){return e.startsWith(":")?e.slice(1).trim():e.trim()}getData(){const e=F();return{nodes:this.nodes,edges:this.edges,other:{},config:e,direction:Kt(this.getRootDocV2())}}getConfig(){return F().state}},f(z,"StateDB"),z.relationType={AGGREGATION:0,EXTENSION:1,COMPOSITION:2,DEPENDENCY:3},z),Pe=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"),Ue=Pe;export{Me as S,Ye as a,Ve as b,Ue as s};
@@ -1 +0,0 @@
1
- import{s as a,c as s,a as e,C as t}from"./chunk-4TB4RGXK-D1PYPWHm.js";import{_ as i}from"./index-BGmKdmbq.js";import"./chunk-FMBD7UC4-BLg2kyYB.js";import"./chunk-YZCP3GAM-BEWtPcgx.js";import"./chunk-55IACEB6-CXpb7ee_.js";import"./chunk-EDXVE4YY-CE8rOa_t.js";var u={parser:e,get db(){return new t},renderer:s,styles:a,init:i(r=>{r.class||(r.class={}),r.class.arrowMarkerAbsolute=r.arrowMarkerAbsolute},"init")};export{u as diagram};
@@ -1 +0,0 @@
1
- import{s as a,c as s,a as e,C as t}from"./chunk-4TB4RGXK-D1PYPWHm.js";import{_ as i}from"./index-BGmKdmbq.js";import"./chunk-FMBD7UC4-BLg2kyYB.js";import"./chunk-YZCP3GAM-BEWtPcgx.js";import"./chunk-55IACEB6-CXpb7ee_.js";import"./chunk-EDXVE4YY-CE8rOa_t.js";var u={parser:e,get db(){return new t},renderer:s,styles:a,init:i(r=>{r.class||(r.class={}),r.class.arrowMarkerAbsolute=r.arrowMarkerAbsolute},"init")};export{u as diagram};
@@ -1 +0,0 @@
1
- import{b as r}from"./_baseUniq-DhZINcU9.js";var e=4;function a(o){return r(o,e)}export{a as c};
@@ -1,4 +0,0 @@
1
- import{_ as X,ay as j,az as Y,aA as _,aB as H,l as i,c as V,aC as z,aD as U,ag as $,am as q,ah as P,af as K,aE as Q,aF as W,aG as Z}from"./index-BGmKdmbq.js";import{G as B}from"./graph-Dctbvw2Z.js";import{l as I}from"./layout-pWVZP2Gn.js";import{i as x}from"./_baseUniq-DhZINcU9.js";import{c as L}from"./clone-BT4FDaUd.js";import{m as A}from"./_basePickBy-CropUxEy.js";function p(e){var t={options:{directed:e.isDirected(),multigraph:e.isMultigraph(),compound:e.isCompound()},nodes:ee(e),edges:ne(e)};return x(e.graph())||(t.value=L(e.graph())),t}function ee(e){return A(e.nodes(),function(t){var n=e.node(t),o=e.parent(t),c={v:t};return x(n)||(c.value=n),x(o)||(c.parent=o),c})}function ne(e){return A(e.edges(),function(t){var n=e.edge(t),o={v:t.v,w:t.w};return x(t.name)||(o.name=t.name),x(n)||(o.value=n),o})}var f=new Map,b=new Map,G=new Map,te=X(()=>{b.clear(),G.clear(),f.clear()},"clear"),O=X((e,t)=>{const n=b.get(t)||[];return i.trace("In isDescendant",t," ",e," = ",n.includes(e)),n.includes(e)},"isDescendant"),se=X((e,t)=>{const n=b.get(t)||[];return i.info("Descendants of ",t," is ",n),i.info("Edge is ",e),e.v===t||e.w===t?!1:n?n.includes(e.v)||O(e.v,t)||O(e.w,t)||n.includes(e.w):(i.debug("Tilt, ",t,",not in descendants"),!1)},"edgeInCluster"),J=X((e,t,n,o)=>{i.warn("Copying children of ",e,"root",o,"data",t.node(e),o);const c=t.children(e)||[];e!==o&&c.push(e),i.warn("Copying (nodes) clusterId",e,"nodes",c),c.forEach(a=>{if(t.children(a).length>0)J(a,t,n,o);else{const r=t.node(a);i.info("cp ",a," to ",o," with parent ",e),n.setNode(a,r),o!==t.parent(a)&&(i.warn("Setting parent",a,t.parent(a)),n.setParent(a,t.parent(a))),e!==o&&a!==e?(i.debug("Setting parent",a,e),n.setParent(a,e)):(i.info("In copy ",e,"root",o,"data",t.node(e),o),i.debug("Not Setting parent for node=",a,"cluster!==rootId",e!==o,"node!==clusterId",a!==e));const u=t.edges(a);i.debug("Copying Edges",u),u.forEach(l=>{i.info("Edge",l);const v=t.edge(l.v,l.w,l.name);i.info("Edge data",v,o);try{se(l,o)?(i.info("Copying as ",l.v,l.w,v,l.name),n.setEdge(l.v,l.w,v,l.name),i.info("newGraph edges ",n.edges(),n.edge(n.edges()[0]))):i.info("Skipping copy of edge ",l.v,"-->",l.w," rootId: ",o," clusterId:",e)}catch(C){i.error(C)}})}i.debug("Removing node",a),t.removeNode(a)})},"copy"),R=X((e,t)=>{const n=t.children(e);let o=[...n];for(const c of n)G.set(c,e),o=[...o,...R(c,t)];return o},"extractDescendants"),ie=X((e,t,n)=>{const o=e.edges().filter(l=>l.v===t||l.w===t),c=e.edges().filter(l=>l.v===n||l.w===n),a=o.map(l=>({v:l.v===t?n:l.v,w:l.w===t?t:l.w})),r=c.map(l=>({v:l.v,w:l.w}));return a.filter(l=>r.some(v=>l.v===v.v&&l.w===v.w))},"findCommonEdges"),D=X((e,t,n)=>{const o=t.children(e);if(i.trace("Searching children of id ",e,o),o.length<1)return e;let c;for(const a of o){const r=D(a,t,n),u=ie(t,n,r);if(r)if(u.length>0)c=r;else return r}return c},"findNonClusterChild"),k=X(e=>!f.has(e)||!f.get(e).externalConnections?e:f.has(e)?f.get(e).id:e,"getAnchorId"),re=X((e,t)=>{if(!e||t>10){i.debug("Opting out, no graph ");return}else i.debug("Opting in, graph ");e.nodes().forEach(function(n){e.children(n).length>0&&(i.warn("Cluster identified",n," Replacement id in edges: ",D(n,e,n)),b.set(n,R(n,e)),f.set(n,{id:D(n,e,n),clusterData:e.node(n)}))}),e.nodes().forEach(function(n){const o=e.children(n),c=e.edges();o.length>0?(i.debug("Cluster identified",n,b),c.forEach(a=>{const r=O(a.v,n),u=O(a.w,n);r^u&&(i.warn("Edge: ",a," leaves cluster ",n),i.warn("Descendants of XXX ",n,": ",b.get(n)),f.get(n).externalConnections=!0)})):i.debug("Not a cluster ",n,b)});for(let n of f.keys()){const o=f.get(n).id,c=e.parent(o);c!==n&&f.has(c)&&!f.get(c).externalConnections&&(f.get(n).id=c)}e.edges().forEach(function(n){const o=e.edge(n);i.warn("Edge "+n.v+" -> "+n.w+": "+JSON.stringify(n)),i.warn("Edge "+n.v+" -> "+n.w+": "+JSON.stringify(e.edge(n)));let c=n.v,a=n.w;if(i.warn("Fix XXX",f,"ids:",n.v,n.w,"Translating: ",f.get(n.v)," --- ",f.get(n.w)),f.get(n.v)||f.get(n.w)){if(i.warn("Fixing and trying - removing XXX",n.v,n.w,n.name),c=k(n.v),a=k(n.w),e.removeEdge(n.v,n.w,n.name),c!==n.v){const r=e.parent(c);f.get(r).externalConnections=!0,o.fromCluster=n.v}if(a!==n.w){const r=e.parent(a);f.get(r).externalConnections=!0,o.toCluster=n.w}i.warn("Fix Replacing with XXX",c,a,n.name),e.setEdge(c,a,o,n.name)}}),i.warn("Adjusted Graph",p(e)),T(e,0),i.trace(f)},"adjustClustersAndEdges"),T=X((e,t)=>{var c,a;if(i.warn("extractor - ",t,p(e),e.children("D")),t>10){i.error("Bailing out");return}let n=e.nodes(),o=!1;for(const r of n){const u=e.children(r);o=o||u.length>0}if(!o){i.debug("Done, no node has children",e.nodes());return}i.debug("Nodes = ",n,t);for(const r of n)if(i.debug("Extracting node",r,f,f.has(r)&&!f.get(r).externalConnections,!e.parent(r),e.node(r),e.children("D")," Depth ",t),!f.has(r))i.debug("Not a cluster",r,t);else if(!f.get(r).externalConnections&&e.children(r)&&e.children(r).length>0){i.warn("Cluster without external connections, without a parent and with children",r,t);let l=e.graph().rankdir==="TB"?"LR":"TB";(a=(c=f.get(r))==null?void 0:c.clusterData)!=null&&a.dir&&(l=f.get(r).clusterData.dir,i.warn("Fixing dir",f.get(r).clusterData.dir,l));const v=new B({multigraph:!0,compound:!0}).setGraph({rankdir:l,nodesep:50,ranksep:50,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}});i.warn("Old graph before copy",p(e)),J(r,e,v,r),e.setNode(r,{clusterNode:!0,id:r,clusterData:f.get(r).clusterData,label:f.get(r).label,graph:v}),i.warn("New graph after copy node: (",r,")",p(v)),i.debug("Old graph after copy",p(e))}else i.warn("Cluster ** ",r," **not meeting the criteria !externalConnections:",!f.get(r).externalConnections," no parent: ",!e.parent(r)," children ",e.children(r)&&e.children(r).length>0,e.children("D"),t),i.debug(f);n=e.nodes(),i.warn("New list of nodes",n);for(const r of n){const u=e.node(r);i.warn(" Now next level",r,u),u!=null&&u.clusterNode&&T(u.graph,t+1)}},"extractor"),M=X((e,t)=>{if(t.length===0)return[];let n=Object.assign([],t);return t.forEach(o=>{const c=e.children(o),a=M(e,c);n=[...n,...a]}),n},"sorter"),oe=X(e=>M(e,e.children()),"sortNodesByHierarchy"),F=X(async(e,t,n,o,c,a)=>{i.warn("Graph in recursive render:XAX",p(t),c);const r=t.graph().rankdir;i.trace("Dir in recursive render - dir:",r);const u=e.insert("g").attr("class","root");t.nodes()?i.info("Recursive render XXX",t.nodes()):i.info("No nodes found for",t),t.edges().length>0&&i.info("Recursive edges",t.edge(t.edges()[0]));const l=u.insert("g").attr("class","clusters"),v=u.insert("g").attr("class","edgePaths"),C=u.insert("g").attr("class","edgeLabels"),g=u.insert("g").attr("class","nodes");await Promise.all(t.nodes().map(async function(d){const s=t.node(d);if(c!==void 0){const w=JSON.parse(JSON.stringify(c.clusterData));i.trace(`Setting data for parent cluster XXX
2
- Node.id = `,d,`
3
- data=`,w.height,`
4
- Parent cluster`,c.height),t.setNode(c.id,w),t.parent(d)||(i.trace("Setting parent",d,c.id),t.setParent(d,c.id,w))}if(i.info("(Insert) Node XXX"+d+": "+JSON.stringify(t.node(d))),s!=null&&s.clusterNode){i.info("Cluster identified XBX",d,s.width,t.node(d));const{ranksep:w,nodesep:m}=t.graph();s.graph.setGraph({...s.graph.graph(),ranksep:w+25,nodesep:m});const N=await F(g,s.graph,n,o,t.node(d),a),S=N.elem;z(s,S),s.diff=N.diff||0,i.info("New compound node after recursive render XAX",d,"width",s.width,"height",s.height),U(S,s)}else t.children(d).length>0?(i.trace("Cluster - the non recursive path XBX",d,s.id,s,s.width,"Graph:",t),i.trace(D(s.id,t)),f.set(s.id,{id:D(s.id,t),node:s})):(i.trace("Node - the non recursive path XAX",d,g,t.node(d),r),await $(g,t.node(d),{config:a,dir:r}))})),await X(async()=>{const d=t.edges().map(async function(s){const w=t.edge(s.v,s.w,s.name);i.info("Edge "+s.v+" -> "+s.w+": "+JSON.stringify(s)),i.info("Edge "+s.v+" -> "+s.w+": ",s," ",JSON.stringify(t.edge(s))),i.info("Fix",f,"ids:",s.v,s.w,"Translating: ",f.get(s.v),f.get(s.w)),await Z(C,w)});await Promise.all(d)},"processEdges")(),i.info("Graph before layout:",JSON.stringify(p(t))),i.info("############################################# XXX"),i.info("### Layout ### XXX"),i.info("############################################# XXX"),I(t),i.info("Graph after layout:",JSON.stringify(p(t)));let E=0,{subGraphTitleTotalMargin:y}=q(a);return await Promise.all(oe(t).map(async function(d){var w;const s=t.node(d);if(i.info("Position XBX => "+d+": ("+s.x,","+s.y,") width: ",s.width," height: ",s.height),s!=null&&s.clusterNode)s.y+=y,i.info("A tainted cluster node XBX1",d,s.id,s.width,s.height,s.x,s.y,t.parent(d)),f.get(s.id).node=s,P(s);else if(t.children(d).length>0){i.info("A pure cluster node XBX1",d,s.id,s.x,s.y,s.width,s.height,t.parent(d)),s.height+=y,t.node(s.parentId);const m=(s==null?void 0:s.padding)/2||0,N=((w=s==null?void 0:s.labelBBox)==null?void 0:w.height)||0,S=N-m||0;i.debug("OffsetY",S,"labelHeight",N,"halfPadding",m),await K(l,s),f.get(s.id).node=s}else{const m=t.node(s.parentId);s.y+=y/2,i.info("A regular node XBX1 - using the padding",s.id,"parent",s.parentId,s.width,s.height,s.x,s.y,"offsetY",s.offsetY,"parent",m,m==null?void 0:m.offsetY,s),P(s)}})),t.edges().forEach(function(d){const s=t.edge(d);i.info("Edge "+d.v+" -> "+d.w+": "+JSON.stringify(s),s),s.points.forEach(S=>S.y+=y/2);const w=t.node(d.v);var m=t.node(d.w);const N=Q(v,s,f,n,w,m,o);W(s,N)}),t.nodes().forEach(function(d){const s=t.node(d);i.info(d,s.type,s.diff),s.isGroup&&(E=s.diff)}),i.warn("Returning from recursive render XAX",u,E),{elem:u,diff:E}},"recursiveRender"),ge=X(async(e,t)=>{var a,r,u,l,v,C;const n=new B({multigraph:!0,compound:!0}).setGraph({rankdir:e.direction,nodesep:((a=e.config)==null?void 0:a.nodeSpacing)||((u=(r=e.config)==null?void 0:r.flowchart)==null?void 0:u.nodeSpacing)||e.nodeSpacing,ranksep:((l=e.config)==null?void 0:l.rankSpacing)||((C=(v=e.config)==null?void 0:v.flowchart)==null?void 0:C.rankSpacing)||e.rankSpacing,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}}),o=t.select("g");j(o,e.markers,e.type,e.diagramId),Y(),_(),H(),te(),e.nodes.forEach(g=>{n.setNode(g.id,{...g}),g.parentId&&n.setParent(g.id,g.parentId)}),i.debug("Edges:",e.edges),e.edges.forEach(g=>{if(g.start===g.end){const h=g.start,E=h+"---"+h+"---1",y=h+"---"+h+"---2",d=n.node(h);n.setNode(E,{domId:E,id:E,parentId:d.parentId,labelStyle:"",label:"",padding:0,shape:"labelRect",style:"",width:10,height:10}),n.setParent(E,d.parentId),n.setNode(y,{domId:y,id:y,parentId:d.parentId,labelStyle:"",padding:0,shape:"labelRect",label:"",style:"",width:10,height:10}),n.setParent(y,d.parentId);const s=structuredClone(g),w=structuredClone(g),m=structuredClone(g);s.label="",s.arrowTypeEnd="none",s.id=h+"-cyclic-special-1",w.arrowTypeStart="none",w.arrowTypeEnd="none",w.id=h+"-cyclic-special-mid",m.label="",d.isGroup&&(s.fromCluster=h,m.toCluster=h),m.id=h+"-cyclic-special-2",m.arrowTypeStart="none",n.setEdge(h,E,s,h+"-cyclic-special-0"),n.setEdge(E,y,w,h+"-cyclic-special-1"),n.setEdge(y,h,m,h+"-cyc<lic-special-2")}else n.setEdge(g.start,g.end,{...g},g.id)}),i.warn("Graph at first:",JSON.stringify(p(n))),re(n),i.warn("Graph after XAX:",JSON.stringify(p(n)));const c=V();await F(o,n,e.type,e.diagramId,void 0,c)},"render");export{ge as render};
@@ -1,10 +0,0 @@
1
- import{p as x,b as f,s as C,q as B,g as T,a as y,_ as s,F as u,l as k,I as V,e as _,D,G as N,z as S}from"./index-BGmKdmbq.js";import{p as I}from"./chunk-4BX2VUAB-Dh2uLXnN.js";import{I as $}from"./chunk-QZHKN3VN-BKNHHSt_.js";import{p as z}from"./wardley-RL74JXVD-mcAzA-kJ.js";import"./_baseUniq-DhZINcU9.js";import"./_basePickBy-CropUxEy.js";import"./clone-BT4FDaUd.js";var d=new $(()=>({cnt:1,stack:[{id:0,level:-1,name:"/",children:[]}]})),A=s(()=>{d.reset(),S()},"clear"),X=s(()=>d.records.stack[0],"getRoot"),H=s(()=>d.records.cnt,"getCount"),L=N.treeView,R=s(()=>u(L,D().treeView),"getConfig"),W=s((e,t)=>{for(;e<=d.records.stack[d.records.stack.length-1].level;)d.records.stack.pop();const a={id:d.records.cnt++,level:e,name:t,children:[]};d.records.stack[d.records.stack.length-1].children.push(a),d.records.stack.push(a)},"addNode"),E={clear:A,addNode:W,getRoot:X,getCount:H,getConfig:R,getAccTitle:y,getAccDescription:T,getDiagramTitle:B,setAccDescription:C,setAccTitle:f,setDiagramTitle:x},w=E,F=s(e=>{I(e,w),e.nodes.map(t=>w.addNode(t.indent?parseInt(t.indent):0,t.name))},"populate"),M={parse:s(async e=>{const t=await z("treeView",e);k.debug(t),F(t)},"parse")},Y=s((e,t,a,n,o)=>{const c=n.append("text").text(a.name).attr("dominant-baseline","middle").attr("class","treeView-node-label"),{height:p,width:r}=c.node().getBBox(),l=p+o.paddingY*2,i=r+o.paddingX*2;c.attr("x",e+o.paddingX),c.attr("y",t+l/2),a.BBox={x:e,y:t,width:i,height:l}},"positionLabel"),b=s((e,t,a,n,o,c)=>e.append("line").attr("x1",t).attr("y1",a).attr("x2",n).attr("y2",o).attr("stroke-width",c).attr("class","treeView-node-line"),"positionLine"),q=s((e,t,a)=>{let n=0,o=0;const c=s((r,l,i,h)=>{const v=h*(i.rowIndent+i.paddingX);Y(v,n,l,r,i);const{height:g,width:m}=l.BBox;b(r,v-i.rowIndent,n+g/2,v,n+g/2,i.lineThickness),o=Math.max(o,v+m),n+=g},"drawNode"),p=s((r,l=0)=>{c(e,r,a,l),r.children.forEach(g=>{p(g,l+1)});const{x:i,y:h,height:v}=r.BBox;if(r.children.length){const{y:g,height:m}=r.children[r.children.length-1].BBox;b(e,i+a.paddingX,h+v,i+a.paddingX,g+m/2+a.lineThickness/2,a.lineThickness)}},"processNode");return p(t),{totalHeight:n,totalWidth:o}},"drawTree"),G=s((e,t,a,n)=>{k.debug(`Rendering treeView diagram
2
- `+e);const o=n.db,c=o.getRoot(),p=o.getConfig(),r=V(t),l=r.append("g");l.attr("class","tree-view");const{totalHeight:i,totalWidth:h}=q(l,c,p);r.attr("viewBox",`-${p.lineThickness/2} 0 ${h} ${i}`),_(r,i,h,p.useMaxWidth)},"draw"),j={draw:G},J=j,K={labelFontSize:"16px",labelColor:"black",lineColor:"black"},O=s(({treeView:e})=>{const{labelFontSize:t,labelColor:a,lineColor:n}=u(K,e);return`
3
- .treeView-node-label {
4
- font-size: ${t};
5
- fill: ${a};
6
- }
7
- .treeView-node-line {
8
- stroke: ${n};
9
- }
10
- `},"styles"),P=O,se={db:w,renderer:J,parser:M,styles:P};export{se as diagram};
@@ -1,24 +0,0 @@
1
- import{_ as w,K as he,D as ee,F as J,I as ue,e as pe,l as Q,b1 as P,d as j,b as fe,a as ge,p as me,q as ye,g as Se,s as ve,G as xe,b2 as be,z as we}from"./index-BGmKdmbq.js";import{s as Ce}from"./chunk-EDXVE4YY-CE8rOa_t.js";import{p as Te}from"./chunk-4BX2VUAB-Dh2uLXnN.js";import{p as Le}from"./wardley-RL74JXVD-mcAzA-kJ.js";import{b as O}from"./defaultLocale-DX6XiGOO.js";import{o as Z}from"./ordinal-Cboi1Yqb.js";import"./_baseUniq-DhZINcU9.js";import"./_basePickBy-CropUxEy.js";import"./clone-BT4FDaUd.js";import"./init-Gi6I4Gst.js";function $e(t){var a=0,l=t.children,n=l&&l.length;if(!n)a=1;else for(;--n>=0;)a+=l[n].value;t.value=a}function Ae(){return this.eachAfter($e)}function Fe(t,a){let l=-1;for(const n of this)t.call(a,n,++l,this);return this}function Ne(t,a){for(var l=this,n=[l],r,s,d=-1;l=n.pop();)if(t.call(a,l,++d,this),r=l.children)for(s=r.length-1;s>=0;--s)n.push(r[s]);return this}function Me(t,a){for(var l=this,n=[l],r=[],s,d,h,g=-1;l=n.pop();)if(r.push(l),s=l.children)for(d=0,h=s.length;d<h;++d)n.push(s[d]);for(;l=r.pop();)t.call(a,l,++g,this);return this}function Ve(t,a){let l=-1;for(const n of this)if(t.call(a,n,++l,this))return n}function _e(t){return this.eachAfter(function(a){for(var l=+t(a.data)||0,n=a.children,r=n&&n.length;--r>=0;)l+=n[r].value;a.value=l})}function ke(t){return this.eachBefore(function(a){a.children&&a.children.sort(t)})}function ze(t){for(var a=this,l=De(a,t),n=[a];a!==l;)a=a.parent,n.push(a);for(var r=n.length;t!==l;)n.splice(r,0,t),t=t.parent;return n}function De(t,a){if(t===a)return t;var l=t.ancestors(),n=a.ancestors(),r=null;for(t=l.pop(),a=n.pop();t===a;)r=t,t=l.pop(),a=n.pop();return r}function Pe(){for(var t=this,a=[t];t=t.parent;)a.push(t);return a}function Be(){return Array.from(this)}function Re(){var t=[];return this.eachBefore(function(a){a.children||t.push(a)}),t}function Ee(){var t=this,a=[];return t.each(function(l){l!==t&&a.push({source:l.parent,target:l})}),a}function*We(){var t=this,a,l=[t],n,r,s;do for(a=l.reverse(),l=[];t=a.pop();)if(yield t,n=t.children)for(r=0,s=n.length;r<s;++r)l.push(n[r]);while(l.length)}function te(t,a){t instanceof Map?(t=[void 0,t],a===void 0&&(a=Oe)):a===void 0&&(a=He);for(var l=new K(t),n,r=[l],s,d,h,g;n=r.pop();)if((d=a(n.data))&&(g=(d=Array.from(d)).length))for(n.children=d,h=g-1;h>=0;--h)r.push(s=d[h]=new K(d[h])),s.parent=n,s.depth=n.depth+1;return l.eachBefore(qe)}function Ie(){return te(this).eachBefore(Ge)}function He(t){return t.children}function Oe(t){return Array.isArray(t)?t[1]:null}function Ge(t){t.data.value!==void 0&&(t.value=t.data.value),t.data=t.data.data}function qe(t){var a=0;do t.height=a;while((t=t.parent)&&t.height<++a)}function K(t){this.data=t,this.depth=this.height=0,this.parent=null}K.prototype=te.prototype={constructor:K,count:Ae,each:Fe,eachAfter:Me,eachBefore:Ne,find:Ve,sum:_e,sort:ke,path:ze,ancestors:Pe,descendants:Be,leaves:Re,links:Ee,copy:Ie,[Symbol.iterator]:We};function Xe(t){if(typeof t!="function")throw new Error;return t}function G(){return 0}function q(t){return function(){return t}}function Ye(t){t.x0=Math.round(t.x0),t.y0=Math.round(t.y0),t.x1=Math.round(t.x1),t.y1=Math.round(t.y1)}function je(t,a,l,n,r){for(var s=t.children,d,h=-1,g=s.length,c=t.value&&(n-a)/t.value;++h<g;)d=s[h],d.y0=l,d.y1=r,d.x0=a,d.x1=a+=d.value*c}function Ke(t,a,l,n,r){for(var s=t.children,d,h=-1,g=s.length,c=t.value&&(r-l)/t.value;++h<g;)d=s[h],d.x0=a,d.x1=n,d.y0=l,d.y1=l+=d.value*c}var Ue=(1+Math.sqrt(5))/2;function Ze(t,a,l,n,r,s){for(var d=[],h=a.children,g,c,u=0,b=0,i=h.length,x,S,v=a.value,p,m,M,N,z,E,V;u<i;){x=r-l,S=s-n;do p=h[b++].value;while(!p&&b<i);for(m=M=p,E=Math.max(S/x,x/S)/(v*t),V=p*p*E,z=Math.max(M/V,V/m);b<i;++b){if(p+=c=h[b].value,c<m&&(m=c),c>M&&(M=c),V=p*p*E,N=Math.max(M/V,V/m),N>z){p-=c;break}z=N}d.push(g={value:p,dice:x<S,children:h.slice(u,b)}),g.dice?je(g,l,n,r,v?n+=S*p/v:s):Ke(g,l,n,v?l+=x*p/v:r,s),v-=p,u=b}return d}const Je=(function t(a){function l(n,r,s,d,h){Ze(a,n,r,s,d,h)}return l.ratio=function(n){return t((n=+n)>1?n:1)},l})(Ue);function Qe(){var t=Je,a=!1,l=1,n=1,r=[0],s=G,d=G,h=G,g=G,c=G;function u(i){return i.x0=i.y0=0,i.x1=l,i.y1=n,i.eachBefore(b),r=[0],a&&i.eachBefore(Ye),i}function b(i){var x=r[i.depth],S=i.x0+x,v=i.y0+x,p=i.x1-x,m=i.y1-x;p<S&&(S=p=(S+p)/2),m<v&&(v=m=(v+m)/2),i.x0=S,i.y0=v,i.x1=p,i.y1=m,i.children&&(x=r[i.depth+1]=s(i)/2,S+=c(i)-x,v+=d(i)-x,p-=h(i)-x,m-=g(i)-x,p<S&&(S=p=(S+p)/2),m<v&&(v=m=(v+m)/2),t(i,S,v,p,m))}return u.round=function(i){return arguments.length?(a=!!i,u):a},u.size=function(i){return arguments.length?(l=+i[0],n=+i[1],u):[l,n]},u.tile=function(i){return arguments.length?(t=Xe(i),u):t},u.padding=function(i){return arguments.length?u.paddingInner(i).paddingOuter(i):u.paddingInner()},u.paddingInner=function(i){return arguments.length?(s=typeof i=="function"?i:q(+i),u):s},u.paddingOuter=function(i){return arguments.length?u.paddingTop(i).paddingRight(i).paddingBottom(i).paddingLeft(i):u.paddingTop()},u.paddingTop=function(i){return arguments.length?(d=typeof i=="function"?i:q(+i),u):d},u.paddingRight=function(i){return arguments.length?(h=typeof i=="function"?i:q(+i),u):h},u.paddingBottom=function(i){return arguments.length?(g=typeof i=="function"?i:q(+i),u):g},u.paddingLeft=function(i){return arguments.length?(c=typeof i=="function"?i:q(+i),u):c},u}var R,ne=(R=class{constructor(){this.nodes=[],this.levels=new Map,this.outerNodes=[],this.classes=new Map,this.setAccTitle=fe,this.getAccTitle=ge,this.setDiagramTitle=me,this.getDiagramTitle=ye,this.getAccDescription=Se,this.setAccDescription=ve}getNodes(){return this.nodes}getConfig(){const a=xe,l=ee();return J({...a.treemap,...l.treemap??{}})}addNode(a,l){this.nodes.push(a),this.levels.set(a,l),l===0&&(this.outerNodes.push(a),this.root??(this.root=a))}getRoot(){return{name:"",children:this.outerNodes}}addClass(a,l){const n=this.classes.get(a)??{id:a,styles:[],textStyles:[]},r=l.replace(/\\,/g,"§§§").replace(/,/g,";").replace(/§§§/g,",").split(";");r&&r.forEach(s=>{be(s)&&(n!=null&&n.textStyles?n.textStyles.push(s):n.textStyles=[s]),n!=null&&n.styles?n.styles.push(s):n.styles=[s]}),this.classes.set(a,n)}getClasses(){return this.classes}getStylesForClass(a){var l;return((l=this.classes.get(a))==null?void 0:l.styles)??[]}clear(){we(),this.nodes=[],this.levels=new Map,this.outerNodes=[],this.classes=new Map,this.root=void 0}},w(R,"TreeMapDB"),R);function le(t){if(!t.length)return[];const a=[],l=[];return t.forEach(n=>{const r={name:n.name,children:n.type==="Leaf"?void 0:[]};for(r.classSelector=n==null?void 0:n.classSelector,n!=null&&n.cssCompiledStyles&&(r.cssCompiledStyles=n.cssCompiledStyles),n.type==="Leaf"&&n.value!==void 0&&(r.value=n.value);l.length>0&&l[l.length-1].level>=n.level;)l.pop();if(l.length===0)a.push(r);else{const s=l[l.length-1].node;s.children?s.children.push(r):s.children=[r]}n.type!=="Leaf"&&l.push({node:r,level:n.level})}),a}w(le,"buildHierarchy");var et=w((t,a)=>{Te(t,a);const l=[];for(const s of t.TreemapRows??[])s.$type==="ClassDefStatement"&&a.addClass(s.className??"",s.styleText??"");for(const s of t.TreemapRows??[]){const d=s.item;if(!d)continue;const h=s.indent?parseInt(s.indent):0,g=tt(d),c=d.classSelector?a.getStylesForClass(d.classSelector):[],u=c.length>0?c:void 0,b={level:h,name:g,type:d.$type,value:d.value,classSelector:d.classSelector,cssCompiledStyles:u};l.push(b)}const n=le(l),r=w((s,d)=>{for(const h of s)a.addNode(h,d),h.children&&h.children.length>0&&r(h.children,d+1)},"addNodesRecursively");r(n,0)},"populate"),tt=w(t=>t.name?String(t.name):"","getItemName"),re={parser:{yy:void 0},parse:w(async t=>{var a;try{const n=await Le("treemap",t);Q.debug("Treemap AST:",n);const r=(a=re.parser)==null?void 0:a.yy;if(!(r instanceof ne))throw new Error("parser.parser?.yy was not a TreemapDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");et(n,r)}catch(l){throw Q.error("Error parsing treemap:",l),l}},"parse")},at=10,B=10,X=25,nt=w((t,a,l,n)=>{const r=n.db,s=r.getConfig(),d=s.padding??at,h=r.getDiagramTitle(),g=r.getRoot(),{themeVariables:c}=ee();if(!g)return;const u=h?30:0,b=ue(a),i=s.nodeWidth?s.nodeWidth*B:960,x=s.nodeHeight?s.nodeHeight*B:500,S=i,v=x+u;b.attr("viewBox",`0 0 ${S} ${v}`),pe(b,v,S,s.useMaxWidth);let p;try{const e=s.valueFormat||",";if(e==="$0,0")p=w(o=>"$"+O(",")(o),"valueFormat");else if(e.startsWith("$")&&e.includes(",")){const o=/\.\d+/.exec(e),f=o?o[0]:"";p=w(C=>"$"+O(","+f)(C),"valueFormat")}else if(e.startsWith("$")){const o=e.substring(1);p=w(f=>"$"+O(o||"")(f),"valueFormat")}else p=O(e)}catch(e){Q.error("Error creating format function:",e),p=O(",")}const m=Z().range(["transparent",c.cScale0,c.cScale1,c.cScale2,c.cScale3,c.cScale4,c.cScale5,c.cScale6,c.cScale7,c.cScale8,c.cScale9,c.cScale10,c.cScale11]),M=Z().range(["transparent",c.cScalePeer0,c.cScalePeer1,c.cScalePeer2,c.cScalePeer3,c.cScalePeer4,c.cScalePeer5,c.cScalePeer6,c.cScalePeer7,c.cScalePeer8,c.cScalePeer9,c.cScalePeer10,c.cScalePeer11]),N=Z().range([c.cScaleLabel0,c.cScaleLabel1,c.cScaleLabel2,c.cScaleLabel3,c.cScaleLabel4,c.cScaleLabel5,c.cScaleLabel6,c.cScaleLabel7,c.cScaleLabel8,c.cScaleLabel9,c.cScaleLabel10,c.cScaleLabel11]);h&&b.append("text").attr("x",S/2).attr("y",u/2).attr("class","treemapTitle").attr("text-anchor","middle").attr("dominant-baseline","middle").text(h);const z=b.append("g").attr("transform",`translate(0, ${u})`).attr("class","treemapContainer"),E=te(g).sum(e=>e.value??0).sort((e,o)=>(o.value??0)-(e.value??0)),ae=Qe().size([i,x]).paddingTop(e=>e.children&&e.children.length>0?X+B:0).paddingInner(d).paddingLeft(e=>e.children&&e.children.length>0?B:0).paddingRight(e=>e.children&&e.children.length>0?B:0).paddingBottom(e=>e.children&&e.children.length>0?B:0).round(!0)(E),se=ae.descendants().filter(e=>e.children&&e.children.length>0),W=z.selectAll(".treemapSection").data(se).enter().append("g").attr("class","treemapSection").attr("transform",e=>`translate(${e.x0},${e.y0})`);W.append("rect").attr("width",e=>e.x1-e.x0).attr("height",X).attr("class","treemapSectionHeader").attr("fill","none").attr("fill-opacity",.6).attr("stroke-width",.6).attr("style",e=>e.depth===0?"display: none;":""),W.append("clipPath").attr("id",(e,o)=>`clip-section-${a}-${o}`).append("rect").attr("width",e=>Math.max(0,e.x1-e.x0-12)).attr("height",X),W.append("rect").attr("width",e=>e.x1-e.x0).attr("height",e=>e.y1-e.y0).attr("class",(e,o)=>`treemapSection section${o}`).attr("fill",e=>m(e.data.name)).attr("fill-opacity",.6).attr("stroke",e=>M(e.data.name)).attr("stroke-width",2).attr("stroke-opacity",.4).attr("style",e=>{if(e.depth===0)return"display: none;";const o=P({cssCompiledStyles:e.data.cssCompiledStyles});return o.nodeStyles+";"+o.borderStyles.join(";")}),W.append("text").attr("class","treemapSectionLabel").attr("x",6).attr("y",X/2).attr("dominant-baseline","middle").text(e=>e.depth===0?"":e.data.name).attr("font-weight","bold").attr("style",e=>{if(e.depth===0)return"display: none;";const o="dominant-baseline: middle; font-size: 12px; fill:"+N(e.data.name)+"; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;",f=P({cssCompiledStyles:e.data.cssCompiledStyles});return o+f.labelStyles.replace("color:","fill:")}).each(function(e){if(e.depth===0)return;const o=j(this),f=e.data.name;o.text(f);const C=e.x1-e.x0,L=6;let $;s.showValues!==!1&&e.value?$=C-10-30-10-L:$=C-L-6;const A=Math.max(15,$),y=o.node();if(y.getComputedTextLength()>A){let T=f;for(;T.length>0;){if(T=f.substring(0,T.length-1),T.length===0){o.text("..."),y.getComputedTextLength()>A&&o.text("");break}if(o.text(T+"..."),y.getComputedTextLength()<=A)break}}}),s.showValues!==!1&&W.append("text").attr("class","treemapSectionValue").attr("x",e=>e.x1-e.x0-10).attr("y",X/2).attr("text-anchor","end").attr("dominant-baseline","middle").text(e=>e.value?p(e.value):"").attr("font-style","italic").attr("style",e=>{if(e.depth===0)return"display: none;";const o="text-anchor: end; dominant-baseline: middle; font-size: 10px; fill:"+N(e.data.name)+"; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;",f=P({cssCompiledStyles:e.data.cssCompiledStyles});return o+f.labelStyles.replace("color:","fill:")});const ie=ae.leaves(),Y=z.selectAll(".treemapLeafGroup").data(ie).enter().append("g").attr("class",(e,o)=>`treemapNode treemapLeafGroup leaf${o}${e.data.classSelector?` ${e.data.classSelector}`:""}x`).attr("transform",e=>`translate(${e.x0},${e.y0})`);Y.append("rect").attr("width",e=>e.x1-e.x0).attr("height",e=>e.y1-e.y0).attr("class","treemapLeaf").attr("fill",e=>e.parent?m(e.parent.data.name):m(e.data.name)).attr("style",e=>P({cssCompiledStyles:e.data.cssCompiledStyles}).nodeStyles).attr("fill-opacity",.3).attr("stroke",e=>e.parent?m(e.parent.data.name):m(e.data.name)).attr("stroke-width",3),Y.append("clipPath").attr("id",(e,o)=>`clip-${a}-${o}`).append("rect").attr("width",e=>Math.max(0,e.x1-e.x0-4)).attr("height",e=>Math.max(0,e.y1-e.y0-4)),Y.append("text").attr("class","treemapLabel").attr("x",e=>(e.x1-e.x0)/2).attr("y",e=>(e.y1-e.y0)/2).attr("style",e=>{const o="text-anchor: middle; dominant-baseline: middle; font-size: 38px;fill:"+N(e.data.name)+";",f=P({cssCompiledStyles:e.data.cssCompiledStyles});return o+f.labelStyles.replace("color:","fill:")}).attr("clip-path",(e,o)=>`url(#clip-${a}-${o})`).text(e=>e.data.name).each(function(e){const o=j(this),f=e.x1-e.x0,C=e.y1-e.y0,L=o.node(),$=4,D=f-2*$,A=C-2*$;if(D<10||A<10){o.style("display","none");return}let y=parseInt(o.style("font-size"),10);const _=8,F=28,T=.6,k=6,I=2;for(;L.getComputedTextLength()>D&&y>_;)y--,o.style("font-size",`${y}px`);let H=Math.max(k,Math.min(F,Math.round(y*T))),U=y+I+H;for(;U>A&&y>_&&(y--,H=Math.max(k,Math.min(F,Math.round(y*T))),!(H<k&&y===_));)o.style("font-size",`${y}px`),U=y+I+H;o.style("font-size",`${y}px`),(L.getComputedTextLength()>D||y<_||A<y)&&o.style("display","none")}),s.showValues!==!1&&Y.append("text").attr("class","treemapValue").attr("x",o=>(o.x1-o.x0)/2).attr("y",function(o){return(o.y1-o.y0)/2}).attr("style",o=>{const f="text-anchor: middle; dominant-baseline: hanging; font-size: 28px;fill:"+N(o.data.name)+";",C=P({cssCompiledStyles:o.data.cssCompiledStyles});return f+C.labelStyles.replace("color:","fill:")}).attr("clip-path",(o,f)=>`url(#clip-${a}-${f})`).text(o=>o.value?p(o.value):"").each(function(o){const f=j(this),C=this.parentNode;if(!C){f.style("display","none");return}const L=j(C).select(".treemapLabel");if(L.empty()||L.style("display")==="none"){f.style("display","none");return}const $=parseFloat(L.style("font-size")),D=28,A=.6,y=6,_=2,F=Math.max(y,Math.min(D,Math.round($*A)));f.style("font-size",`${F}px`);const k=(o.y1-o.y0)/2+$/2+_;f.attr("y",k);const I=o.x1-o.x0,ce=o.y1-o.y0-4,de=I-8;f.node().getComputedTextLength()>de||k+F>ce||F<y?f.style("display","none"):f.style("display",null)});const oe=s.diagramPadding??8;Ce(b,oe,"flowchart",(s==null?void 0:s.useMaxWidth)||!1)},"draw"),lt=w(function(t,a){return a.db.getClasses()},"getClasses"),rt={draw:nt,getClasses:lt},st={sectionStrokeColor:"black",sectionStrokeWidth:"1",sectionFillColor:"#efefef",leafStrokeColor:"black",leafStrokeWidth:"1",leafFillColor:"#efefef",labelFontSize:"12px",valueFontSize:"10px",titleFontSize:"14px"},it=w(({treemap:t}={})=>{const a=he(),l=ee(),n=J(a,l.themeVariables),r=J(st,t),s=r.titleColor??n.titleColor,d=r.labelColor??n.textColor,h=r.valueColor??n.textColor;return`
2
- .treemapNode.section {
3
- stroke: ${r.sectionStrokeColor};
4
- stroke-width: ${r.sectionStrokeWidth};
5
- fill: ${r.sectionFillColor};
6
- }
7
- .treemapNode.leaf {
8
- stroke: ${r.leafStrokeColor};
9
- stroke-width: ${r.leafStrokeWidth};
10
- fill: ${r.leafFillColor};
11
- }
12
- .treemapLabel {
13
- fill: ${d};
14
- font-size: ${r.labelFontSize};
15
- }
16
- .treemapValue {
17
- fill: ${h};
18
- font-size: ${r.valueFontSize};
19
- }
20
- .treemapTitle {
21
- fill: ${s};
22
- font-size: ${r.titleFontSize};
23
- }
24
- `},"getStyles"),ot=it,xt={parser:re,get db(){return new ne},renderer:rt,styles:ot};export{xt as diagram};
@@ -1,43 +0,0 @@
1
- import{s as k,g as I,q as R,p as F,a as _,b as D,_ as l,I as E,z,F as y,G,D as C,l as P,K as W,e as B}from"./index-BGmKdmbq.js";import{p as V}from"./chunk-4BX2VUAB-Dh2uLXnN.js";import{p as H}from"./wardley-RL74JXVD-mcAzA-kJ.js";import"./_baseUniq-DhZINcU9.js";import"./_basePickBy-CropUxEy.js";import"./clone-BT4FDaUd.js";var x={showLegend:!0,ticks:5,max:null,min:0,graticule:"circle"},w={axes:[],curves:[],options:x},m=structuredClone(w),j=G.radar,q=l(()=>y({...j,...C().radar}),"getConfig"),b=l(()=>m.axes,"getAxes"),K=l(()=>m.curves,"getCurves"),N=l(()=>m.options,"getOptions"),U=l(a=>{m.axes=a.map(t=>({name:t.name,label:t.label??t.name}))},"setAxes"),X=l(a=>{m.curves=a.map(t=>({name:t.name,label:t.label??t.name,entries:Y(t.entries)}))},"setCurves"),Y=l(a=>{if(a[0].axis==null)return a.map(e=>e.value);const t=b();if(t.length===0)throw new Error("Axes must be populated before curves for reference entries");return t.map(e=>{const r=a.find(s=>{var o;return((o=s.axis)==null?void 0:o.$refText)===e.name});if(r===void 0)throw new Error("Missing entry for axis "+e.label);return r.value})},"computeCurveEntries"),Z=l(a=>{var e,r,s,o,i;const t=a.reduce((n,c)=>(n[c.name]=c,n),{});m.options={showLegend:((e=t.showLegend)==null?void 0:e.value)??x.showLegend,ticks:((r=t.ticks)==null?void 0:r.value)??x.ticks,max:((s=t.max)==null?void 0:s.value)??x.max,min:((o=t.min)==null?void 0:o.value)??x.min,graticule:((i=t.graticule)==null?void 0:i.value)??x.graticule}},"setOptions"),J=l(()=>{z(),m=structuredClone(w)},"clear"),$={getAxes:b,getCurves:K,getOptions:N,setAxes:U,setCurves:X,setOptions:Z,getConfig:q,clear:J,setAccTitle:D,getAccTitle:_,setDiagramTitle:F,getDiagramTitle:R,getAccDescription:I,setAccDescription:k},Q=l(a=>{V(a,$);const{axes:t,curves:e,options:r}=a;$.setAxes(t),$.setCurves(e),$.setOptions(r)},"populate"),tt={parse:l(async a=>{const t=await H("radar",a);P.debug(t),Q(t)},"parse")},et=l((a,t,e,r)=>{const s=r.db,o=s.getAxes(),i=s.getCurves(),n=s.getOptions(),c=s.getConfig(),d=s.getDiagramTitle(),p=E(t),u=at(p,c),g=n.max??Math.max(...i.map(f=>Math.max(...f.entries))),h=n.min,v=Math.min(c.width,c.height)/2;rt(u,o,v,n.ticks,n.graticule),st(u,o,v,c),M(u,o,i,h,g,n.graticule,c),T(u,i,n.showLegend,c),u.append("text").attr("class","radarTitle").text(d).attr("x",0).attr("y",-c.height/2-c.marginTop)},"draw"),at=l((a,t)=>{const e=t.width+t.marginLeft+t.marginRight,r=t.height+t.marginTop+t.marginBottom,s={x:t.marginLeft+t.width/2,y:t.marginTop+t.height/2};return B(a,r,e,t.useMaxWidth??!0),a.attr("viewBox",`0 0 ${e} ${r}`),a.append("g").attr("transform",`translate(${s.x}, ${s.y})`)},"drawFrame"),rt=l((a,t,e,r,s)=>{if(s==="circle")for(let o=0;o<r;o++){const i=e*(o+1)/r;a.append("circle").attr("r",i).attr("class","radarGraticule")}else if(s==="polygon"){const o=t.length;for(let i=0;i<r;i++){const n=e*(i+1)/r,c=t.map((d,p)=>{const u=2*p*Math.PI/o-Math.PI/2,g=n*Math.cos(u),h=n*Math.sin(u);return`${g},${h}`}).join(" ");a.append("polygon").attr("points",c).attr("class","radarGraticule")}}},"drawGraticule"),st=l((a,t,e,r)=>{const s=t.length;for(let o=0;o<s;o++){const i=t[o].label,n=2*o*Math.PI/s-Math.PI/2;a.append("line").attr("x1",0).attr("y1",0).attr("x2",e*r.axisScaleFactor*Math.cos(n)).attr("y2",e*r.axisScaleFactor*Math.sin(n)).attr("class","radarAxisLine"),a.append("text").text(i).attr("x",e*r.axisLabelFactor*Math.cos(n)).attr("y",e*r.axisLabelFactor*Math.sin(n)).attr("class","radarAxisLabel")}},"drawAxes");function M(a,t,e,r,s,o,i){const n=t.length,c=Math.min(i.width,i.height)/2;e.forEach((d,p)=>{if(d.entries.length!==n)return;const u=d.entries.map((g,h)=>{const v=2*Math.PI*h/n-Math.PI/2,f=A(g,r,s,c),S=f*Math.cos(v),O=f*Math.sin(v);return{x:S,y:O}});o==="circle"?a.append("path").attr("d",L(u,i.curveTension)).attr("class",`radarCurve-${p}`):o==="polygon"&&a.append("polygon").attr("points",u.map(g=>`${g.x},${g.y}`).join(" ")).attr("class",`radarCurve-${p}`)})}l(M,"drawCurves");function A(a,t,e,r){const s=Math.min(Math.max(a,t),e);return r*(s-t)/(e-t)}l(A,"relativeRadius");function L(a,t){const e=a.length;let r=`M${a[0].x},${a[0].y}`;for(let s=0;s<e;s++){const o=a[(s-1+e)%e],i=a[s],n=a[(s+1)%e],c=a[(s+2)%e],d={x:i.x+(n.x-o.x)*t,y:i.y+(n.y-o.y)*t},p={x:n.x-(c.x-i.x)*t,y:n.y-(c.y-i.y)*t};r+=` C${d.x},${d.y} ${p.x},${p.y} ${n.x},${n.y}`}return`${r} Z`}l(L,"closedRoundCurve");function T(a,t,e,r){if(!e)return;const s=(r.width/2+r.marginRight)*3/4,o=-(r.height/2+r.marginTop)*3/4,i=20;t.forEach((n,c)=>{const d=a.append("g").attr("transform",`translate(${s}, ${o+c*i})`);d.append("rect").attr("width",12).attr("height",12).attr("class",`radarLegendBox-${c}`),d.append("text").attr("x",16).attr("y",0).attr("class","radarLegendText").text(n.label)})}l(T,"drawLegend");var nt={draw:et},ot=l((a,t)=>{let e="";for(let r=0;r<a.THEME_COLOR_LIMIT;r++){const s=a[`cScale${r}`];e+=`
2
- .radarCurve-${r} {
3
- color: ${s};
4
- fill: ${s};
5
- fill-opacity: ${t.curveOpacity};
6
- stroke: ${s};
7
- stroke-width: ${t.curveStrokeWidth};
8
- }
9
- .radarLegendBox-${r} {
10
- fill: ${s};
11
- fill-opacity: ${t.curveOpacity};
12
- stroke: ${s};
13
- }
14
- `}return e},"genIndexStyles"),it=l(a=>{const t=W(),e=C(),r=y(t,e.themeVariables),s=y(r.radar,a);return{themeVariables:r,radarOptions:s}},"buildRadarStyleOptions"),lt=l(({radar:a}={})=>{const{themeVariables:t,radarOptions:e}=it(a);return`
15
- .radarTitle {
16
- font-size: ${t.fontSize};
17
- color: ${t.titleColor};
18
- dominant-baseline: hanging;
19
- text-anchor: middle;
20
- }
21
- .radarAxisLine {
22
- stroke: ${e.axisColor};
23
- stroke-width: ${e.axisStrokeWidth};
24
- }
25
- .radarAxisLabel {
26
- dominant-baseline: middle;
27
- text-anchor: middle;
28
- font-size: ${e.axisLabelFontSize}px;
29
- color: ${e.axisColor};
30
- }
31
- .radarGraticule {
32
- fill: ${e.graticuleColor};
33
- fill-opacity: ${e.graticuleOpacity};
34
- stroke: ${e.graticuleColor};
35
- stroke-width: ${e.graticuleStrokeWidth};
36
- }
37
- .radarLegendText {
38
- text-anchor: start;
39
- font-size: ${e.legendFontSize}px;
40
- dominant-baseline: hanging;
41
- }
42
- ${ot(t,e)}
43
- `},"styles"),xt={parser:tt,db:$,renderer:nt,styles:lt};export{xt as diagram};
@@ -1,24 +0,0 @@
1
- import{_ as b,F as m,I as B,e as C,l as w,b as S,a as D,p as T,q as z,g as F,s as P,G as E,D as A,z as W}from"./index-BGmKdmbq.js";import{p as _}from"./chunk-4BX2VUAB-Dh2uLXnN.js";import{p as N}from"./wardley-RL74JXVD-mcAzA-kJ.js";import"./_baseUniq-DhZINcU9.js";import"./_basePickBy-CropUxEy.js";import"./clone-BT4FDaUd.js";var I=E.packet,u,v=(u=class{constructor(){this.packet=[],this.setAccTitle=S,this.getAccTitle=D,this.setDiagramTitle=T,this.getDiagramTitle=z,this.getAccDescription=F,this.setAccDescription=P}getConfig(){const t=m({...I,...A().packet});return t.showBits&&(t.paddingY+=10),t}getPacket(){return this.packet}pushWord(t){t.length>0&&this.packet.push(t)}clear(){W(),this.packet=[]}},b(u,"PacketDB"),u),L=1e4,M=b((e,t)=>{_(e,t);let o=-1,r=[],n=1;const{bitsPerRow:l}=t.getConfig();for(let{start:a,end:i,bits:d,label:c}of e.blocks){if(a!==void 0&&i!==void 0&&i<a)throw new Error(`Packet block ${a} - ${i} is invalid. End must be greater than start.`);if(a??(a=o+1),a!==o+1)throw new Error(`Packet block ${a} - ${i??a} is not contiguous. It should start from ${o+1}.`);if(d===0)throw new Error(`Packet block ${a} is invalid. Cannot have a zero bit field.`);for(i??(i=a+(d??1)-1),d??(d=i-a+1),o=i,w.debug(`Packet block ${a} - ${o} with label ${c}`);r.length<=l+1&&t.getPacket().length<L;){const[p,s]=Y({start:a,end:i,bits:d,label:c},n,l);if(r.push(p),p.end+1===n*l&&(t.pushWord(r),r=[],n++),!s)break;({start:a,end:i,bits:d,label:c}=s)}}t.pushWord(r)},"populate"),Y=b((e,t,o)=>{if(e.start===void 0)throw new Error("start should have been set during first phase");if(e.end===void 0)throw new Error("end should have been set during first phase");if(e.start>e.end)throw new Error(`Block start ${e.start} is greater than block end ${e.end}.`);if(e.end+1<=t*o)return[e,void 0];const r=t*o-1,n=t*o;return[{start:e.start,end:r,label:e.label,bits:r-e.start},{start:n,end:e.end,label:e.label,bits:e.end-n}]},"getNextFittingBlock"),x={parser:{yy:void 0},parse:b(async e=>{var r;const t=await N("packet",e),o=(r=x.parser)==null?void 0:r.yy;if(!(o instanceof v))throw new Error("parser.parser?.yy was not a PacketDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");w.debug(t),M(t,o)},"parse")},G=b((e,t,o,r)=>{const n=r.db,l=n.getConfig(),{rowHeight:a,paddingY:i,bitWidth:d,bitsPerRow:c}=l,p=n.getPacket(),s=n.getDiagramTitle(),h=a+i,g=h*(p.length+1)-(s?0:a),k=d*c+2,f=B(t);f.attr("viewBox",`0 0 ${k} ${g}`),C(f,g,k,l.useMaxWidth);for(const[y,$]of p.entries())O(f,$,y,l);f.append("text").text(s).attr("x",k/2).attr("y",g-h/2).attr("dominant-baseline","middle").attr("text-anchor","middle").attr("class","packetTitle")},"draw"),O=b((e,t,o,{rowHeight:r,paddingX:n,paddingY:l,bitWidth:a,bitsPerRow:i,showBits:d})=>{const c=e.append("g"),p=o*(r+l)+l;for(const s of t){const h=s.start%i*a+1,g=(s.end-s.start+1)*a-n;if(c.append("rect").attr("x",h).attr("y",p).attr("width",g).attr("height",r).attr("class","packetBlock"),c.append("text").attr("x",h+g/2).attr("y",p+r/2).attr("class","packetLabel").attr("dominant-baseline","middle").attr("text-anchor","middle").text(s.label),!d)continue;const k=s.end===s.start,f=p-2;c.append("text").attr("x",h+(k?g/2:0)).attr("y",f).attr("class","packetByte start").attr("dominant-baseline","auto").attr("text-anchor",k?"middle":"start").text(s.start),k||c.append("text").attr("x",h+g).attr("y",f).attr("class","packetByte end").attr("dominant-baseline","auto").attr("text-anchor","end").text(s.end)}},"drawWord"),j={draw:G},q={byteFontSize:"10px",startByteColor:"black",endByteColor:"black",labelColor:"black",labelFontSize:"12px",titleColor:"black",titleFontSize:"14px",blockStrokeColor:"black",blockStrokeWidth:"1",blockFillColor:"#efefef"},H=b(({packet:e}={})=>{const t=m(q,e);return`
2
- .packetByte {
3
- font-size: ${t.byteFontSize};
4
- }
5
- .packetByte.start {
6
- fill: ${t.startByteColor};
7
- }
8
- .packetByte.end {
9
- fill: ${t.endByteColor};
10
- }
11
- .packetLabel {
12
- fill: ${t.labelColor};
13
- font-size: ${t.labelFontSize};
14
- }
15
- .packetTitle {
16
- fill: ${t.titleColor};
17
- font-size: ${t.titleFontSize};
18
- }
19
- .packetBlock {
20
- stroke: ${t.blockStrokeColor};
21
- stroke-width: ${t.blockStrokeWidth};
22
- fill: ${t.blockFillColor};
23
- }
24
- `},"styles"),V={parser:x,get db(){return new v},renderer:j,styles:H};export{V as diagram};