@sme.up/ketchup2 2.0.0-SNAPSHOT-20250905083046 → 2.0.0-SNAPSHOT-20250905085901

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 (118) hide show
  1. package/dist/_basePickBy-CnrWHKZp.js +151 -0
  2. package/dist/_basePickBy-DGKSP0gv.cjs +1 -0
  3. package/dist/_baseUniq-CfaAVYmv.cjs +1 -0
  4. package/dist/_baseUniq-rrVUjaHq.js +614 -0
  5. package/dist/arc-Cvsmptc6.js +83 -0
  6. package/dist/arc-DXWJO88c.cjs +1 -0
  7. package/dist/architecture-O4VJ6CD3-Bg5u-0vt.js +5 -0
  8. package/dist/architecture-O4VJ6CD3-DaYZgGoD.cjs +1 -0
  9. package/dist/architectureDiagram-KFL7JDKH-Cc3SNGmS.cjs +36 -0
  10. package/dist/architectureDiagram-KFL7JDKH-D30vYX4H.js +4660 -0
  11. package/dist/blockDiagram-ZYB65J3Q-XNfNJO0n.cjs +122 -0
  12. package/dist/blockDiagram-ZYB65J3Q-sf1yE8If.js +2261 -0
  13. package/dist/c4Diagram-AAMF2YG6-BNCxdxyW.js +1580 -0
  14. package/dist/c4Diagram-AAMF2YG6-BTBu0vwj.cjs +10 -0
  15. package/dist/channel-BlMDdAyt.js +5 -0
  16. package/dist/channel-DeQCp9ft.cjs +1 -0
  17. package/dist/chunk-ANTBXLJU-B62KbLiF.js +8 -0
  18. package/dist/chunk-ANTBXLJU-BjQOW3U7.cjs +1 -0
  19. package/dist/chunk-FHKO5MBM-DWB4p0-W.js +15 -0
  20. package/dist/chunk-FHKO5MBM-DzOslnSz.cjs +1 -0
  21. package/dist/chunk-GLLZNHP4-DDFtxbSr.js +19 -0
  22. package/dist/chunk-GLLZNHP4-DDZwz-lX.cjs +15 -0
  23. package/dist/chunk-JBRWN2VN-BLY_1jNQ.cjs +165 -0
  24. package/dist/chunk-JBRWN2VN-D7vb9zR6.js +1375 -0
  25. package/dist/chunk-LXBSTHXV-BmkvPzxs.cjs +220 -0
  26. package/dist/chunk-LXBSTHXV-Brv31JUq.js +1370 -0
  27. package/dist/chunk-NRVI72HA-Bltdz_dQ.js +19 -0
  28. package/dist/chunk-NRVI72HA-ClkSCOVn.cjs +1 -0
  29. package/dist/chunk-OMD6QJNC--UN3JI3w.cjs +1 -0
  30. package/dist/chunk-OMD6QJNC-D64ATN0N.js +64 -0
  31. package/dist/chunk-WVR4S24B-0YswEo26.cjs +1 -0
  32. package/dist/chunk-WVR4S24B-DiP_ArIP.js +8 -0
  33. package/dist/classDiagram-3BZAVTQC-DWqAc0qT.cjs +1 -0
  34. package/dist/classDiagram-3BZAVTQC-f7jl_VZA.js +16 -0
  35. package/dist/classDiagram-v2-QTMF73CY-DWqAc0qT.cjs +1 -0
  36. package/dist/classDiagram-v2-QTMF73CY-f7jl_VZA.js +16 -0
  37. package/dist/clone-BWcBp581.cjs +1 -0
  38. package/dist/clone-BnZevyiW.js +8 -0
  39. package/dist/cytoscape.esm-CamnA8MN.js +18735 -0
  40. package/dist/cytoscape.esm-uM8noIeE.cjs +331 -0
  41. package/dist/dagre-2BBEFEWP-CUPOuCtr.js +444 -0
  42. package/dist/dagre-2BBEFEWP-DbhCjIet.cjs +4 -0
  43. package/dist/defaultLocale-D7EN2tov.js +171 -0
  44. package/dist/defaultLocale-DIVzfLaQ.cjs +1 -0
  45. package/dist/diagram-4IRLE6MV-CQJ20yhM.cjs +24 -0
  46. package/dist/diagram-4IRLE6MV-DFeMx_Rq.js +532 -0
  47. package/dist/diagram-GUPCWM2R-CLKZFWXo.js +142 -0
  48. package/dist/diagram-GUPCWM2R-DQ8Z1dVv.cjs +24 -0
  49. package/dist/diagram-RP2FKANI-CPEWV2Fk.js +217 -0
  50. package/dist/diagram-RP2FKANI-DUPB9s-y.cjs +43 -0
  51. package/dist/erDiagram-HZWUO2LU-C0Gk1Swz.cjs +60 -0
  52. package/dist/erDiagram-HZWUO2LU-CyY2HjMf.js +841 -0
  53. package/dist/flowDiagram-THRYKUMA-gJkHOeSL.cjs +162 -0
  54. package/dist/flowDiagram-THRYKUMA-w-8EX9wZ.js +1620 -0
  55. package/dist/ganttDiagram-WV7ZQ7D5-CmPXBktC.js +2504 -0
  56. package/dist/ganttDiagram-WV7ZQ7D5-DATuP_Ex.cjs +267 -0
  57. package/dist/gitGraph-ZV4HHKMB-BXu_2mfy.js +5 -0
  58. package/dist/gitGraph-ZV4HHKMB-e_eUYuE2.cjs +1 -0
  59. package/dist/gitGraphDiagram-OJR772UL-D7Q38-er.js +699 -0
  60. package/dist/gitGraphDiagram-OJR772UL-vqgYdo84.cjs +65 -0
  61. package/dist/graph-D2z8dVgI.cjs +1 -0
  62. package/dist/graph-fWVDVASg.js +247 -0
  63. package/dist/index-CBHQ10D6.js +23234 -0
  64. package/dist/index-CH3q61Aa.cjs +266 -0
  65. package/dist/index.d.ts +6 -0
  66. package/dist/index.d.ts.map +1 -1
  67. package/dist/info-63CPKGFF-B6aHvvSX.js +5 -0
  68. package/dist/info-63CPKGFF-B7Bgcqhg.cjs +1 -0
  69. package/dist/infoDiagram-DDUCL6P7-Bb42gyGF.cjs +2 -0
  70. package/dist/infoDiagram-DDUCL6P7-G8W4Cyzb.js +24 -0
  71. package/dist/init-CHZsXQcr.cjs +1 -0
  72. package/dist/init-DjUOC4st.js +16 -0
  73. package/dist/journeyDiagram-FFXJYRFH-Bck7isLB.js +836 -0
  74. package/dist/journeyDiagram-FFXJYRFH-DFTMezSW.cjs +139 -0
  75. package/dist/kanban-definition-KOZQBZVT-Bf4fYslI.cjs +89 -0
  76. package/dist/kanban-definition-KOZQBZVT-hP_ZGt4S.js +719 -0
  77. package/dist/katex-C2g-EhzP.cjs +261 -0
  78. package/dist/katex-CUSbq6rG.js +11692 -0
  79. package/dist/ketchup2.cjs.js +1 -50
  80. package/dist/ketchup2.css +1 -1
  81. package/dist/ketchup2.es.js +23 -8127
  82. package/dist/layout-B-lXVQQa.cjs +1 -0
  83. package/dist/layout-CSXO9mhe.js +1324 -0
  84. package/dist/linear-BZgyGW2T.cjs +1 -0
  85. package/dist/linear-Cx2KaZOo.js +259 -0
  86. package/dist/mermaid-parser.core-COPhuhoR.js +12966 -0
  87. package/dist/mermaid-parser.core-DgsyN-z8.cjs +128 -0
  88. package/dist/mindmap-definition-LNHGMQRG-DJsQpf8y.cjs +95 -0
  89. package/dist/mindmap-definition-LNHGMQRG-DQUm__JP.js +3230 -0
  90. package/dist/ordinal-CagbB1m8.cjs +1 -0
  91. package/dist/ordinal-DfAQgscy.js +61 -0
  92. package/dist/packet-HUATNLJX-C2VUbl0T.js +5 -0
  93. package/dist/packet-HUATNLJX-G8eR5ynJ.cjs +1 -0
  94. package/dist/pie-WTHONI2E-CfCIU8Tr.cjs +1 -0
  95. package/dist/pie-WTHONI2E-D4qp2Ay_.js +5 -0
  96. package/dist/pieDiagram-DBDJKBY4-DqPdbFqw.cjs +30 -0
  97. package/dist/pieDiagram-DBDJKBY4-nGyOC7-l.js +161 -0
  98. package/dist/quadrantDiagram-YPSRARAO-DF8AYAxY.cjs +7 -0
  99. package/dist/quadrantDiagram-YPSRARAO-hyzkVUsQ.js +1022 -0
  100. package/dist/radar-NJJJXTRR-BpgvgEoJ.cjs +1 -0
  101. package/dist/radar-NJJJXTRR-DJxmCfQM.js +5 -0
  102. package/dist/requirementDiagram-EGVEC5DT-DOtzLvFO.cjs +64 -0
  103. package/dist/requirementDiagram-EGVEC5DT-RXOLhPE3.js +850 -0
  104. package/dist/sankeyDiagram-HRAUVNP4-CUoOlfVB.cjs +10 -0
  105. package/dist/sankeyDiagram-HRAUVNP4-DGFS1jVK.js +810 -0
  106. package/dist/sequenceDiagram-4MX5Z3NR-Cx06uio3.js +2281 -0
  107. package/dist/sequenceDiagram-4MX5Z3NR-DoW8n1Xr.cjs +122 -0
  108. package/dist/stateDiagram-UUKSUZ4H-Burg3mSA.cjs +1 -0
  109. package/dist/stateDiagram-UUKSUZ4H-C2OsUgT8.js +263 -0
  110. package/dist/stateDiagram-v2-EYPG3UTE-CVHvpjP1.cjs +1 -0
  111. package/dist/stateDiagram-v2-EYPG3UTE-DL1ew380.js +16 -0
  112. package/dist/timeline-definition-3HZDQTIS-B66f0uxR.cjs +61 -0
  113. package/dist/timeline-definition-3HZDQTIS-Bos8RJ8U.js +797 -0
  114. package/dist/treemap-75Q7IDZK-DyG1W8W-.cjs +1 -0
  115. package/dist/treemap-75Q7IDZK-Dynfjwww.js +5 -0
  116. package/dist/xychartDiagram-FDP5SA34-BzWuQtxg.js +1340 -0
  117. package/dist/xychartDiagram-FDP5SA34-CvgmaqN1.cjs +7 -0
  118. package/package.json +3 -3
@@ -0,0 +1,24 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const se=require("./chunk-NRVI72HA-ClkSCOVn.cjs"),u=require("./index-CH3q61Aa.cjs"),ie=require("./chunk-ANTBXLJU-BjQOW3U7.cjs"),oe=require("./mermaid-parser.core-DgsyN-z8.cjs"),I=require("./defaultLocale-DIVzfLaQ.cjs"),U=require("./ordinal-CagbB1m8.cjs");function ce(a){var t=0,l=a.children,n=l&&l.length;if(!n)t=1;else for(;--n>=0;)t+=l[n].value;a.value=t}function de(){return this.eachAfter(ce)}function ue(a,t){let l=-1;for(const n of this)a.call(t,n,++l,this);return this}function he(a,t){for(var l=this,n=[l],o,s,d=-1;l=n.pop();)if(a.call(t,l,++d,this),o=l.children)for(s=o.length-1;s>=0;--s)n.push(o[s]);return this}function pe(a,t){for(var l=this,n=[l],o=[],s,d,h,m=-1;l=n.pop();)if(o.push(l),s=l.children)for(d=0,h=s.length;d<h;++d)n.push(s[d]);for(;l=o.pop();)a.call(t,l,++m,this);return this}function fe(a,t){let l=-1;for(const n of this)if(a.call(t,n,++l,this))return n}function ge(a){return this.eachAfter(function(t){for(var l=+a(t.data)||0,n=t.children,o=n&&n.length;--o>=0;)l+=n[o].value;t.value=l})}function me(a){return this.eachBefore(function(t){t.children&&t.children.sort(a)})}function ye(a){for(var t=this,l=Se(t,a),n=[t];t!==l;)t=t.parent,n.push(t);for(var o=n.length;a!==l;)n.splice(o,0,a),a=a.parent;return n}function Se(a,t){if(a===t)return a;var l=a.ancestors(),n=t.ancestors(),o=null;for(a=l.pop(),t=n.pop();a===t;)o=a,a=l.pop(),t=n.pop();return o}function ve(){for(var a=this,t=[a];a=a.parent;)t.push(a);return t}function xe(){return Array.from(this)}function be(){var a=[];return this.eachBefore(function(t){t.children||a.push(t)}),a}function we(){var a=this,t=[];return a.each(function(l){l!==a&&t.push({source:l.parent,target:l})}),t}function*Ce(){var a=this,t,l=[a],n,o,s;do for(t=l.reverse(),l=[];a=t.pop();)if(yield a,n=a.children)for(o=0,s=n.length;o<s;++o)l.push(n[o]);while(l.length)}function J(a,t){a instanceof Map?(a=[void 0,a],t===void 0&&(t=Le)):t===void 0&&(t=Te);for(var l=new j(a),n,o=[l],s,d,h,m;n=o.pop();)if((d=t(n.data))&&(m=(d=Array.from(d)).length))for(n.children=d,h=m-1;h>=0;--h)o.push(s=d[h]=new j(d[h])),s.parent=n,s.depth=n.depth+1;return l.eachBefore(Ae)}function _e(){return J(this).eachBefore($e)}function Te(a){return a.children}function Le(a){return Array.isArray(a)?a[1]:null}function $e(a){a.data.value!==void 0&&(a.value=a.data.value),a.data=a.data.data}function Ae(a){var t=0;do a.height=t;while((a=a.parent)&&a.height<++t)}function j(a){this.data=a,this.depth=this.height=0,this.parent=null}j.prototype=J.prototype={constructor:j,count:de,each:ue,eachAfter:pe,eachBefore:he,find:fe,sum:ge,sort:me,path:ye,ancestors:ve,descendants:xe,leaves:be,links:we,copy:_e,[Symbol.iterator]:Ce};function ke(a){if(typeof a!="function")throw new Error;return a}function q(){return 0}function O(a){return function(){return a}}function Ne(a){a.x0=Math.round(a.x0),a.y0=Math.round(a.y0),a.x1=Math.round(a.x1),a.y1=Math.round(a.y1)}function Me(a,t,l,n,o){for(var s=a.children,d,h=-1,m=s.length,c=a.value&&(n-t)/a.value;++h<m;)d=s[h],d.y0=l,d.y1=o,d.x0=t,d.x1=t+=d.value*c}function Fe(a,t,l,n,o){for(var s=a.children,d,h=-1,m=s.length,c=a.value&&(o-l)/a.value;++h<m;)d=s[h],d.x0=t,d.x1=n,d.y0=l,d.y1=l+=d.value*c}var ze=(1+Math.sqrt(5))/2;function Ve(a,t,l,n,o,s){for(var d=[],h=t.children,m,c,p=0,w=0,r=h.length,b,v,x=t.value,f,y,N,k,V,R,M;p<r;){b=o-l,v=s-n;do f=h[w++].value;while(!f&&w<r);for(y=N=f,R=Math.max(v/b,b/v)/(x*a),M=f*f*R,V=Math.max(N/M,M/y);w<r;++w){if(f+=c=h[w].value,c<y&&(y=c),c>N&&(N=c),M=f*f*R,k=Math.max(N/M,M/y),k>V){f-=c;break}V=k}d.push(m={value:f,dice:b<v,children:h.slice(p,w)}),m.dice?Me(m,l,n,o,x?n+=v*f/x:s):Fe(m,l,n,x?l+=b*f/x:o,s),x-=f,p=w}return d}const Pe=function a(t){function l(n,o,s,d,h){Ve(t,n,o,s,d,h)}return l.ratio=function(n){return a((n=+n)>1?n:1)},l}(ze);function De(){var a=Pe,t=!1,l=1,n=1,o=[0],s=q,d=q,h=q,m=q,c=q;function p(r){return r.x0=r.y0=0,r.x1=l,r.y1=n,r.eachBefore(w),o=[0],t&&r.eachBefore(Ne),r}function w(r){var b=o[r.depth],v=r.x0+b,x=r.y0+b,f=r.x1-b,y=r.y1-b;f<v&&(v=f=(v+f)/2),y<x&&(x=y=(x+y)/2),r.x0=v,r.y0=x,r.x1=f,r.y1=y,r.children&&(b=o[r.depth+1]=s(r)/2,v+=c(r)-b,x+=d(r)-b,f-=h(r)-b,y-=m(r)-b,f<v&&(v=f=(v+f)/2),y<x&&(x=y=(x+y)/2),a(r,v,x,f,y))}return p.round=function(r){return arguments.length?(t=!!r,p):t},p.size=function(r){return arguments.length?(l=+r[0],n=+r[1],p):[l,n]},p.tile=function(r){return arguments.length?(a=ke(r),p):a},p.padding=function(r){return arguments.length?p.paddingInner(r).paddingOuter(r):p.paddingInner()},p.paddingInner=function(r){return arguments.length?(s=typeof r=="function"?r:O(+r),p):s},p.paddingOuter=function(r){return arguments.length?p.paddingTop(r).paddingRight(r).paddingBottom(r).paddingLeft(r):p.paddingTop()},p.paddingTop=function(r){return arguments.length?(d=typeof r=="function"?r:O(+r),p):d},p.paddingRight=function(r){return arguments.length?(h=typeof r=="function"?r:O(+r),p):h},p.paddingBottom=function(r){return arguments.length?(m=typeof r=="function"?r:O(+r),p):m},p.paddingLeft=function(r){return arguments.length?(c=typeof r=="function"?r:O(+r),p):c},p}var B,K=(B=class{constructor(){this.nodes=[],this.levels=new Map,this.outerNodes=[],this.classes=new Map,this.setAccTitle=u.setAccTitle,this.getAccTitle=u.getAccTitle,this.setDiagramTitle=u.setDiagramTitle,this.getDiagramTitle=u.getDiagramTitle,this.getAccDescription=u.getAccDescription,this.setAccDescription=u.setAccDescription}getNodes(){return this.nodes}getConfig(){const t=u.defaultConfig_default,l=u.getConfig();return u.cleanAndMerge({...t.treemap,...l.treemap??{}})}addNode(t,l){this.nodes.push(t),this.levels.set(t,l),l===0&&(this.outerNodes.push(t),this.root??=t)}getRoot(){return{name:"",children:this.outerNodes}}addClass(t,l){const n=this.classes.get(t)??{id:t,styles:[],textStyles:[]},o=l.replace(/\\,/g,"§§§").replace(/,/g,";").replace(/§§§/g,",").split(";");o&&o.forEach(s=>{u.isLabelStyle(s)&&(n?.textStyles?n.textStyles.push(s):n.textStyles=[s]),n?.styles?n.styles.push(s):n.styles=[s]}),this.classes.set(t,n)}getClasses(){return this.classes}getStylesForClass(t){return this.classes.get(t)?.styles??[]}clear(){u.clear(),this.nodes=[],this.levels=new Map,this.outerNodes=[],this.classes=new Map,this.root=void 0}},u.__name(B,"TreeMapDB"),B);function Q(a){if(!a.length)return[];const t=[],l=[];return a.forEach(n=>{const o={name:n.name,children:n.type==="Leaf"?void 0:[]};for(o.classSelector=n?.classSelector,n?.cssCompiledStyles&&(o.cssCompiledStyles=[n.cssCompiledStyles]),n.type==="Leaf"&&n.value!==void 0&&(o.value=n.value);l.length>0&&l[l.length-1].level>=n.level;)l.pop();if(l.length===0)t.push(o);else{const s=l[l.length-1].node;s.children?s.children.push(o):s.children=[o]}n.type!=="Leaf"&&l.push({node:o,level:n.level})}),t}u.__name(Q,"buildHierarchy");var Be=u.__name((a,t)=>{ie.populateCommonDb(a,t);const l=[];for(const s of a.TreemapRows??[])s.$type==="ClassDefStatement"&&t.addClass(s.className??"",s.styleText??"");for(const s of a.TreemapRows??[]){const d=s.item;if(!d)continue;const h=s.indent?parseInt(s.indent):0,m=Re(d),c=d.classSelector?t.getStylesForClass(d.classSelector):[],p=c.length>0?c.join(";"):void 0,w={level:h,name:m,type:d.$type,value:d.value,classSelector:d.classSelector,cssCompiledStyles:p};l.push(w)}const n=Q(l),o=u.__name((s,d)=>{for(const h of s)t.addNode(h,d),h.children&&h.children.length>0&&o(h.children,d+1)},"addNodesRecursively");o(n,0)},"populate"),Re=u.__name(a=>a.name?String(a.name):"","getItemName"),ee={parser:{yy:void 0},parse:u.__name(async a=>{try{const t=oe.parse,l=await t("treemap",a);u.log.debug("Treemap AST:",l);const n=ee.parser?.yy;if(!(n instanceof K))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.");Be(l,n)}catch(t){throw u.log.error("Error parsing treemap:",t),t}},"parse")},Ee=10,D=10,G=25,We=u.__name((a,t,l,n)=>{const o=n.db,s=o.getConfig(),d=s.padding??Ee,h=o.getDiagramTitle(),m=o.getRoot(),{themeVariables:c}=u.getConfig();if(!m)return;const p=h?30:0,w=u.selectSvgElement(t),r=s.nodeWidth?s.nodeWidth*D:960,b=s.nodeHeight?s.nodeHeight*D:500,v=r,x=b+p;w.attr("viewBox",`0 0 ${v} ${x}`),u.configureSvgSize(w,x,v,s.useMaxWidth);let f;try{const e=s.valueFormat||",";if(e==="$0,0")f=u.__name(i=>"$"+I.format(",")(i),"valueFormat");else if(e.startsWith("$")&&e.includes(",")){const i=/\.\d+/.exec(e),g=i?i[0]:"";f=u.__name(C=>"$"+I.format(","+g)(C),"valueFormat")}else if(e.startsWith("$")){const i=e.substring(1);f=u.__name(g=>"$"+I.format(i||"")(g),"valueFormat")}else f=I.format(e)}catch(e){u.log.error("Error creating format function:",e),f=I.format(",")}const y=U.ordinal().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]),N=U.ordinal().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]),k=U.ordinal().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&&w.append("text").attr("x",v/2).attr("y",p/2).attr("class","treemapTitle").attr("text-anchor","middle").attr("dominant-baseline","middle").text(h);const V=w.append("g").attr("transform",`translate(0, ${p})`).attr("class","treemapContainer"),R=J(m).sum(e=>e.value??0).sort((e,i)=>(i.value??0)-(e.value??0)),Z=De().size([r,b]).paddingTop(e=>e.children&&e.children.length>0?G+D:0).paddingInner(d).paddingLeft(e=>e.children&&e.children.length>0?D:0).paddingRight(e=>e.children&&e.children.length>0?D:0).paddingBottom(e=>e.children&&e.children.length>0?D:0).round(!0)(R),te=Z.descendants().filter(e=>e.children&&e.children.length>0),E=V.selectAll(".treemapSection").data(te).enter().append("g").attr("class","treemapSection").attr("transform",e=>`translate(${e.x0},${e.y0})`);E.append("rect").attr("width",e=>e.x1-e.x0).attr("height",G).attr("class","treemapSectionHeader").attr("fill","none").attr("fill-opacity",.6).attr("stroke-width",.6).attr("style",e=>e.depth===0?"display: none;":""),E.append("clipPath").attr("id",(e,i)=>`clip-section-${t}-${i}`).append("rect").attr("width",e=>Math.max(0,e.x1-e.x0-12)).attr("height",G),E.append("rect").attr("width",e=>e.x1-e.x0).attr("height",e=>e.y1-e.y0).attr("class",(e,i)=>`treemapSection section${i}`).attr("fill",e=>y(e.data.name)).attr("fill-opacity",.6).attr("stroke",e=>N(e.data.name)).attr("stroke-width",2).attr("stroke-opacity",.4).attr("style",e=>{if(e.depth===0)return"display: none;";const i=u.styles2String({cssCompiledStyles:e.data.cssCompiledStyles});return i.nodeStyles+";"+i.borderStyles.join(";")}),E.append("text").attr("class","treemapSectionLabel").attr("x",6).attr("y",G/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 i="dominant-baseline: middle; font-size: 12px; fill:"+k(e.data.name)+"; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;",g=u.styles2String({cssCompiledStyles:e.data.cssCompiledStyles});return i+g.labelStyles.replace("color:","fill:")}).each(function(e){if(e.depth===0)return;const i=u.select(this),g=e.data.name;i.text(g);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,$),S=i.node();if(S.getComputedTextLength()>A){const _="...";let T=g;for(;T.length>0;){if(T=g.substring(0,T.length-1),T.length===0){i.text(_),S.getComputedTextLength()>A&&i.text("");break}if(i.text(T+_),S.getComputedTextLength()<=A)break}}}),s.showValues!==!1&&E.append("text").attr("class","treemapSectionValue").attr("x",e=>e.x1-e.x0-10).attr("y",G/2).attr("text-anchor","end").attr("dominant-baseline","middle").text(e=>e.value?f(e.value):"").attr("font-style","italic").attr("style",e=>{if(e.depth===0)return"display: none;";const i="text-anchor: end; dominant-baseline: middle; font-size: 10px; fill:"+k(e.data.name)+"; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;",g=u.styles2String({cssCompiledStyles:e.data.cssCompiledStyles});return i+g.labelStyles.replace("color:","fill:")});const ae=Z.leaves(),X=V.selectAll(".treemapLeafGroup").data(ae).enter().append("g").attr("class",(e,i)=>`treemapNode treemapLeafGroup leaf${i}${e.data.classSelector?` ${e.data.classSelector}`:""}x`).attr("transform",e=>`translate(${e.x0},${e.y0})`);X.append("rect").attr("width",e=>e.x1-e.x0).attr("height",e=>e.y1-e.y0).attr("class","treemapLeaf").attr("fill",e=>e.parent?y(e.parent.data.name):y(e.data.name)).attr("style",e=>u.styles2String({cssCompiledStyles:e.data.cssCompiledStyles}).nodeStyles).attr("fill-opacity",.3).attr("stroke",e=>e.parent?y(e.parent.data.name):y(e.data.name)).attr("stroke-width",3),X.append("clipPath").attr("id",(e,i)=>`clip-${t}-${i}`).append("rect").attr("width",e=>Math.max(0,e.x1-e.x0-4)).attr("height",e=>Math.max(0,e.y1-e.y0-4)),X.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 i="text-anchor: middle; dominant-baseline: middle; font-size: 38px;fill:"+k(e.data.name)+";",g=u.styles2String({cssCompiledStyles:e.data.cssCompiledStyles});return i+g.labelStyles.replace("color:","fill:")}).attr("clip-path",(e,i)=>`url(#clip-${t}-${i})`).text(e=>e.data.name).each(function(e){const i=u.select(this),g=e.x1-e.x0,C=e.y1-e.y0,L=i.node(),$=4,P=g-2*$,A=C-2*$;if(P<10||A<10){i.style("display","none");return}let S=parseInt(i.style("font-size"),10);const F=8,_=28,T=.6,z=6,W=2;for(;L.getComputedTextLength()>P&&S>F;)S--,i.style("font-size",`${S}px`);let H=Math.max(z,Math.min(_,Math.round(S*T))),Y=S+W+H;for(;Y>A&&S>F&&(S--,H=Math.max(z,Math.min(_,Math.round(S*T))),!(H<z&&S===F));)i.style("font-size",`${S}px`),Y=S+W+H;i.style("font-size",`${S}px`),(L.getComputedTextLength()>P||S<F||A<S)&&i.style("display","none")}),s.showValues!==!1&&X.append("text").attr("class","treemapValue").attr("x",i=>(i.x1-i.x0)/2).attr("y",function(i){return(i.y1-i.y0)/2}).attr("style",i=>{const g="text-anchor: middle; dominant-baseline: hanging; font-size: 28px;fill:"+k(i.data.name)+";",C=u.styles2String({cssCompiledStyles:i.data.cssCompiledStyles});return g+C.labelStyles.replace("color:","fill:")}).attr("clip-path",(i,g)=>`url(#clip-${t}-${g})`).text(i=>i.value?f(i.value):"").each(function(i){const g=u.select(this),C=this.parentNode;if(!C){g.style("display","none");return}const L=u.select(C).select(".treemapLabel");if(L.empty()||L.style("display")==="none"){g.style("display","none");return}const $=parseFloat(L.style("font-size")),P=28,A=.6,S=6,F=2,_=Math.max(S,Math.min(P,Math.round($*A)));g.style("font-size",`${_}px`);const z=(i.y1-i.y0)/2+$/2+F;g.attr("y",z);const W=i.x1-i.x0,le=i.y1-i.y0-4,re=W-2*4;g.node().getComputedTextLength()>re||z+_>le||_<S?g.style("display","none"):g.style("display",null)});const ne=s.diagramPadding??8;se.setupViewPortForSVG(w,ne,"flowchart",s?.useMaxWidth||!1)},"draw"),He=u.__name(function(a,t){return t.db.getClasses()},"getClasses"),Ie={draw:We,getClasses:He},qe={sectionStrokeColor:"black",sectionStrokeWidth:"1",sectionFillColor:"#efefef",leafStrokeColor:"black",leafStrokeWidth:"1",leafFillColor:"#efefef",labelColor:"black",labelFontSize:"12px",valueFontSize:"10px",valueColor:"black",titleColor:"black",titleFontSize:"14px"},Oe=u.__name(({treemap:a}={})=>{const t=u.cleanAndMerge(qe,a);return`
2
+ .treemapNode.section {
3
+ stroke: ${t.sectionStrokeColor};
4
+ stroke-width: ${t.sectionStrokeWidth};
5
+ fill: ${t.sectionFillColor};
6
+ }
7
+ .treemapNode.leaf {
8
+ stroke: ${t.leafStrokeColor};
9
+ stroke-width: ${t.leafStrokeWidth};
10
+ fill: ${t.leafFillColor};
11
+ }
12
+ .treemapLabel {
13
+ fill: ${t.labelColor};
14
+ font-size: ${t.labelFontSize};
15
+ }
16
+ .treemapValue {
17
+ fill: ${t.valueColor};
18
+ font-size: ${t.valueFontSize};
19
+ }
20
+ .treemapTitle {
21
+ fill: ${t.titleColor};
22
+ font-size: ${t.titleFontSize};
23
+ }
24
+ `},"getStyles"),Ge=Oe,Xe={parser:ee,get db(){return new K},renderer:Ie,styles:Ge};exports.diagram=Xe;
@@ -0,0 +1,532 @@
1
+ import { s as he } from "./chunk-NRVI72HA-Bltdz_dQ.js";
2
+ import { _ as w, D as te, E as ae, H as ue, e as pe, l as K, aZ as P, d as Y, b as fe, a as ge, p as me, q as ye, g as Se, s as ve, F as xe, a_ as be, y as we } from "./index-CBHQ10D6.js";
3
+ import { p as Ce } from "./chunk-ANTBXLJU-B62KbLiF.js";
4
+ import { p as Te } from "./mermaid-parser.core-COPhuhoR.js";
5
+ import { b as O } from "./defaultLocale-D7EN2tov.js";
6
+ import { o as J } from "./ordinal-DfAQgscy.js";
7
+ function Le(t) {
8
+ var a = 0, l = t.children, n = l && l.length;
9
+ if (!n) a = 1;
10
+ else for (; --n >= 0; ) a += l[n].value;
11
+ t.value = a;
12
+ }
13
+ function $e() {
14
+ return this.eachAfter(Le);
15
+ }
16
+ function Ae(t, a) {
17
+ let l = -1;
18
+ for (const n of this)
19
+ t.call(a, n, ++l, this);
20
+ return this;
21
+ }
22
+ function Fe(t, a) {
23
+ for (var l = this, n = [l], o, s, d = -1; l = n.pop(); )
24
+ if (t.call(a, l, ++d, this), o = l.children)
25
+ for (s = o.length - 1; s >= 0; --s)
26
+ n.push(o[s]);
27
+ return this;
28
+ }
29
+ function ke(t, a) {
30
+ for (var l = this, n = [l], o = [], s, d, h, g = -1; l = n.pop(); )
31
+ if (o.push(l), s = l.children)
32
+ for (d = 0, h = s.length; d < h; ++d)
33
+ n.push(s[d]);
34
+ for (; l = o.pop(); )
35
+ t.call(a, l, ++g, this);
36
+ return this;
37
+ }
38
+ function Ne(t, a) {
39
+ let l = -1;
40
+ for (const n of this)
41
+ if (t.call(a, n, ++l, this))
42
+ return n;
43
+ }
44
+ function Me(t) {
45
+ return this.eachAfter(function(a) {
46
+ for (var l = +t(a.data) || 0, n = a.children, o = n && n.length; --o >= 0; ) l += n[o].value;
47
+ a.value = l;
48
+ });
49
+ }
50
+ function _e(t) {
51
+ return this.eachBefore(function(a) {
52
+ a.children && a.children.sort(t);
53
+ });
54
+ }
55
+ function ze(t) {
56
+ for (var a = this, l = Ve(a, t), n = [a]; a !== l; )
57
+ a = a.parent, n.push(a);
58
+ for (var o = n.length; t !== l; )
59
+ n.splice(o, 0, t), t = t.parent;
60
+ return n;
61
+ }
62
+ function Ve(t, a) {
63
+ if (t === a) return t;
64
+ var l = t.ancestors(), n = a.ancestors(), o = null;
65
+ for (t = l.pop(), a = n.pop(); t === a; )
66
+ o = t, t = l.pop(), a = n.pop();
67
+ return o;
68
+ }
69
+ function De() {
70
+ for (var t = this, a = [t]; t = t.parent; )
71
+ a.push(t);
72
+ return a;
73
+ }
74
+ function Pe() {
75
+ return Array.from(this);
76
+ }
77
+ function Be() {
78
+ var t = [];
79
+ return this.eachBefore(function(a) {
80
+ a.children || t.push(a);
81
+ }), t;
82
+ }
83
+ function Ee() {
84
+ var t = this, a = [];
85
+ return t.each(function(l) {
86
+ l !== t && a.push({ source: l.parent, target: l });
87
+ }), a;
88
+ }
89
+ function* Re() {
90
+ var t = this, a, l = [t], n, o, s;
91
+ do
92
+ for (a = l.reverse(), l = []; t = a.pop(); )
93
+ if (yield t, n = t.children)
94
+ for (o = 0, s = n.length; o < s; ++o)
95
+ l.push(n[o]);
96
+ while (l.length);
97
+ }
98
+ function Q(t, a) {
99
+ t instanceof Map ? (t = [void 0, t], a === void 0 && (a = Ie)) : a === void 0 && (a = He);
100
+ for (var l = new Z(t), n, o = [l], s, d, h, g; n = o.pop(); )
101
+ if ((d = a(n.data)) && (g = (d = Array.from(d)).length))
102
+ for (n.children = d, h = g - 1; h >= 0; --h)
103
+ o.push(s = d[h] = new Z(d[h])), s.parent = n, s.depth = n.depth + 1;
104
+ return l.eachBefore(qe);
105
+ }
106
+ function We() {
107
+ return Q(this).eachBefore(Oe);
108
+ }
109
+ function He(t) {
110
+ return t.children;
111
+ }
112
+ function Ie(t) {
113
+ return Array.isArray(t) ? t[1] : null;
114
+ }
115
+ function Oe(t) {
116
+ t.data.value !== void 0 && (t.value = t.data.value), t.data = t.data.data;
117
+ }
118
+ function qe(t) {
119
+ var a = 0;
120
+ do
121
+ t.height = a;
122
+ while ((t = t.parent) && t.height < ++a);
123
+ }
124
+ function Z(t) {
125
+ this.data = t, this.depth = this.height = 0, this.parent = null;
126
+ }
127
+ Z.prototype = Q.prototype = {
128
+ constructor: Z,
129
+ count: $e,
130
+ each: Ae,
131
+ eachAfter: ke,
132
+ eachBefore: Fe,
133
+ find: Ne,
134
+ sum: Me,
135
+ sort: _e,
136
+ path: ze,
137
+ ancestors: De,
138
+ descendants: Pe,
139
+ leaves: Be,
140
+ links: Ee,
141
+ copy: We,
142
+ [Symbol.iterator]: Re
143
+ };
144
+ function Ge(t) {
145
+ if (typeof t != "function") throw new Error();
146
+ return t;
147
+ }
148
+ function q() {
149
+ return 0;
150
+ }
151
+ function G(t) {
152
+ return function() {
153
+ return t;
154
+ };
155
+ }
156
+ function Xe(t) {
157
+ t.x0 = Math.round(t.x0), t.y0 = Math.round(t.y0), t.x1 = Math.round(t.x1), t.y1 = Math.round(t.y1);
158
+ }
159
+ function je(t, a, l, n, o) {
160
+ for (var s = t.children, d, h = -1, g = s.length, c = t.value && (n - a) / t.value; ++h < g; )
161
+ d = s[h], d.y0 = l, d.y1 = o, d.x0 = a, d.x1 = a += d.value * c;
162
+ }
163
+ function Ye(t, a, l, n, o) {
164
+ for (var s = t.children, d, h = -1, g = s.length, c = t.value && (o - l) / t.value; ++h < g; )
165
+ d = s[h], d.x0 = a, d.x1 = n, d.y0 = l, d.y1 = l += d.value * c;
166
+ }
167
+ var Ze = (1 + Math.sqrt(5)) / 2;
168
+ function Ue(t, a, l, n, o, s) {
169
+ for (var d = [], h = a.children, g, c, u = 0, b = 0, r = h.length, x, S, v = a.value, p, m, N, k, V, R, M; u < r; ) {
170
+ x = o - l, S = s - n;
171
+ do
172
+ p = h[b++].value;
173
+ while (!p && b < r);
174
+ for (m = N = p, R = Math.max(S / x, x / S) / (v * t), M = p * p * R, V = Math.max(N / M, M / m); b < r; ++b) {
175
+ if (p += c = h[b].value, c < m && (m = c), c > N && (N = c), M = p * p * R, k = Math.max(N / M, M / m), k > V) {
176
+ p -= c;
177
+ break;
178
+ }
179
+ V = k;
180
+ }
181
+ d.push(g = { value: p, dice: x < S, children: h.slice(u, b) }), g.dice ? je(g, l, n, o, v ? n += S * p / v : s) : Ye(g, l, n, v ? l += x * p / v : o, s), v -= p, u = b;
182
+ }
183
+ return d;
184
+ }
185
+ const Je = function t(a) {
186
+ function l(n, o, s, d, h) {
187
+ Ue(a, n, o, s, d, h);
188
+ }
189
+ return l.ratio = function(n) {
190
+ return t((n = +n) > 1 ? n : 1);
191
+ }, l;
192
+ }(Ze);
193
+ function Ke() {
194
+ var t = Je, a = !1, l = 1, n = 1, o = [0], s = q, d = q, h = q, g = q, c = q;
195
+ function u(r) {
196
+ return r.x0 = r.y0 = 0, r.x1 = l, r.y1 = n, r.eachBefore(b), o = [0], a && r.eachBefore(Xe), r;
197
+ }
198
+ function b(r) {
199
+ var x = o[r.depth], S = r.x0 + x, v = r.y0 + x, p = r.x1 - x, m = r.y1 - x;
200
+ p < S && (S = p = (S + p) / 2), m < v && (v = m = (v + m) / 2), r.x0 = S, r.y0 = v, r.x1 = p, r.y1 = m, r.children && (x = o[r.depth + 1] = s(r) / 2, S += c(r) - x, v += d(r) - x, p -= h(r) - x, m -= g(r) - x, p < S && (S = p = (S + p) / 2), m < v && (v = m = (v + m) / 2), t(r, S, v, p, m));
201
+ }
202
+ return u.round = function(r) {
203
+ return arguments.length ? (a = !!r, u) : a;
204
+ }, u.size = function(r) {
205
+ return arguments.length ? (l = +r[0], n = +r[1], u) : [l, n];
206
+ }, u.tile = function(r) {
207
+ return arguments.length ? (t = Ge(r), u) : t;
208
+ }, u.padding = function(r) {
209
+ return arguments.length ? u.paddingInner(r).paddingOuter(r) : u.paddingInner();
210
+ }, u.paddingInner = function(r) {
211
+ return arguments.length ? (s = typeof r == "function" ? r : G(+r), u) : s;
212
+ }, u.paddingOuter = function(r) {
213
+ return arguments.length ? u.paddingTop(r).paddingRight(r).paddingBottom(r).paddingLeft(r) : u.paddingTop();
214
+ }, u.paddingTop = function(r) {
215
+ return arguments.length ? (d = typeof r == "function" ? r : G(+r), u) : d;
216
+ }, u.paddingRight = function(r) {
217
+ return arguments.length ? (h = typeof r == "function" ? r : G(+r), u) : h;
218
+ }, u.paddingBottom = function(r) {
219
+ return arguments.length ? (g = typeof r == "function" ? r : G(+r), u) : g;
220
+ }, u.paddingLeft = function(r) {
221
+ return arguments.length ? (c = typeof r == "function" ? r : G(+r), u) : c;
222
+ }, u;
223
+ }
224
+ var E, ne = (E = class {
225
+ constructor() {
226
+ this.nodes = [], this.levels = /* @__PURE__ */ new Map(), this.outerNodes = [], this.classes = /* @__PURE__ */ new Map(), this.setAccTitle = fe, this.getAccTitle = ge, this.setDiagramTitle = me, this.getDiagramTitle = ye, this.getAccDescription = Se, this.setAccDescription = ve;
227
+ }
228
+ getNodes() {
229
+ return this.nodes;
230
+ }
231
+ getConfig() {
232
+ const a = xe, l = ae();
233
+ return te({
234
+ ...a.treemap,
235
+ ...l.treemap ?? {}
236
+ });
237
+ }
238
+ addNode(a, l) {
239
+ this.nodes.push(a), this.levels.set(a, l), l === 0 && (this.outerNodes.push(a), this.root ??= a);
240
+ }
241
+ getRoot() {
242
+ return { name: "", children: this.outerNodes };
243
+ }
244
+ addClass(a, l) {
245
+ const n = this.classes.get(a) ?? { id: a, styles: [], textStyles: [] }, o = l.replace(/\\,/g, "§§§").replace(/,/g, ";").replace(/§§§/g, ",").split(";");
246
+ o && o.forEach((s) => {
247
+ be(s) && (n?.textStyles ? n.textStyles.push(s) : n.textStyles = [s]), n?.styles ? n.styles.push(s) : n.styles = [s];
248
+ }), this.classes.set(a, n);
249
+ }
250
+ getClasses() {
251
+ return this.classes;
252
+ }
253
+ getStylesForClass(a) {
254
+ return this.classes.get(a)?.styles ?? [];
255
+ }
256
+ clear() {
257
+ we(), this.nodes = [], this.levels = /* @__PURE__ */ new Map(), this.outerNodes = [], this.classes = /* @__PURE__ */ new Map(), this.root = void 0;
258
+ }
259
+ }, w(E, "TreeMapDB"), E);
260
+ function le(t) {
261
+ if (!t.length)
262
+ return [];
263
+ const a = [], l = [];
264
+ return t.forEach((n) => {
265
+ const o = {
266
+ name: n.name,
267
+ children: n.type === "Leaf" ? void 0 : []
268
+ };
269
+ for (o.classSelector = n?.classSelector, n?.cssCompiledStyles && (o.cssCompiledStyles = [n.cssCompiledStyles]), n.type === "Leaf" && n.value !== void 0 && (o.value = n.value); l.length > 0 && l[l.length - 1].level >= n.level; )
270
+ l.pop();
271
+ if (l.length === 0)
272
+ a.push(o);
273
+ else {
274
+ const s = l[l.length - 1].node;
275
+ s.children ? s.children.push(o) : s.children = [o];
276
+ }
277
+ n.type !== "Leaf" && l.push({ node: o, level: n.level });
278
+ }), a;
279
+ }
280
+ w(le, "buildHierarchy");
281
+ var Qe = /* @__PURE__ */ w((t, a) => {
282
+ Ce(t, a);
283
+ const l = [];
284
+ for (const s of t.TreemapRows ?? [])
285
+ s.$type === "ClassDefStatement" && a.addClass(s.className ?? "", s.styleText ?? "");
286
+ for (const s of t.TreemapRows ?? []) {
287
+ const d = s.item;
288
+ if (!d)
289
+ continue;
290
+ const h = s.indent ? parseInt(s.indent) : 0, g = et(d), c = d.classSelector ? a.getStylesForClass(d.classSelector) : [], u = c.length > 0 ? c.join(";") : void 0, b = {
291
+ level: h,
292
+ name: g,
293
+ type: d.$type,
294
+ value: d.value,
295
+ classSelector: d.classSelector,
296
+ cssCompiledStyles: u
297
+ };
298
+ l.push(b);
299
+ }
300
+ const n = le(l), o = /* @__PURE__ */ w((s, d) => {
301
+ for (const h of s)
302
+ a.addNode(h, d), h.children && h.children.length > 0 && o(h.children, d + 1);
303
+ }, "addNodesRecursively");
304
+ o(n, 0);
305
+ }, "populate"), et = /* @__PURE__ */ w((t) => t.name ? String(t.name) : "", "getItemName"), re = {
306
+ // @ts-expect-error - TreeMapDB is not assignable to DiagramDB
307
+ parser: { yy: void 0 },
308
+ parse: /* @__PURE__ */ w(async (t) => {
309
+ try {
310
+ const l = await Te("treemap", t);
311
+ K.debug("Treemap AST:", l);
312
+ const n = re.parser?.yy;
313
+ if (!(n instanceof ne))
314
+ throw new Error(
315
+ "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."
316
+ );
317
+ Qe(l, n);
318
+ } catch (a) {
319
+ throw K.error("Error parsing treemap:", a), a;
320
+ }
321
+ }, "parse")
322
+ }, tt = 10, B = 10, X = 25, at = /* @__PURE__ */ w((t, a, l, n) => {
323
+ const o = n.db, s = o.getConfig(), d = s.padding ?? tt, h = o.getDiagramTitle(), g = o.getRoot(), { themeVariables: c } = ae();
324
+ if (!g)
325
+ return;
326
+ const u = h ? 30 : 0, b = ue(a), r = s.nodeWidth ? s.nodeWidth * B : 960, x = s.nodeHeight ? s.nodeHeight * B : 500, S = r, v = x + u;
327
+ b.attr("viewBox", `0 0 ${S} ${v}`), pe(b, v, S, s.useMaxWidth);
328
+ let p;
329
+ try {
330
+ const e = s.valueFormat || ",";
331
+ if (e === "$0,0")
332
+ p = /* @__PURE__ */ w((i) => "$" + O(",")(i), "valueFormat");
333
+ else if (e.startsWith("$") && e.includes(",")) {
334
+ const i = /\.\d+/.exec(e), f = i ? i[0] : "";
335
+ p = /* @__PURE__ */ w((C) => "$" + O("," + f)(C), "valueFormat");
336
+ } else if (e.startsWith("$")) {
337
+ const i = e.substring(1);
338
+ p = /* @__PURE__ */ w((f) => "$" + O(i || "")(f), "valueFormat");
339
+ } else
340
+ p = O(e);
341
+ } catch (e) {
342
+ K.error("Error creating format function:", e), p = O(",");
343
+ }
344
+ const m = J().range([
345
+ "transparent",
346
+ c.cScale0,
347
+ c.cScale1,
348
+ c.cScale2,
349
+ c.cScale3,
350
+ c.cScale4,
351
+ c.cScale5,
352
+ c.cScale6,
353
+ c.cScale7,
354
+ c.cScale8,
355
+ c.cScale9,
356
+ c.cScale10,
357
+ c.cScale11
358
+ ]), N = J().range([
359
+ "transparent",
360
+ c.cScalePeer0,
361
+ c.cScalePeer1,
362
+ c.cScalePeer2,
363
+ c.cScalePeer3,
364
+ c.cScalePeer4,
365
+ c.cScalePeer5,
366
+ c.cScalePeer6,
367
+ c.cScalePeer7,
368
+ c.cScalePeer8,
369
+ c.cScalePeer9,
370
+ c.cScalePeer10,
371
+ c.cScalePeer11
372
+ ]), k = J().range([
373
+ c.cScaleLabel0,
374
+ c.cScaleLabel1,
375
+ c.cScaleLabel2,
376
+ c.cScaleLabel3,
377
+ c.cScaleLabel4,
378
+ c.cScaleLabel5,
379
+ c.cScaleLabel6,
380
+ c.cScaleLabel7,
381
+ c.cScaleLabel8,
382
+ c.cScaleLabel9,
383
+ c.cScaleLabel10,
384
+ c.cScaleLabel11
385
+ ]);
386
+ 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);
387
+ const V = b.append("g").attr("transform", `translate(0, ${u})`).attr("class", "treemapContainer"), R = Q(g).sum((e) => e.value ?? 0).sort((e, i) => (i.value ?? 0) - (e.value ?? 0)), ee = Ke().size([r, x]).paddingTop(
388
+ (e) => e.children && e.children.length > 0 ? X + B : 0
389
+ ).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)(R), se = ee.descendants().filter((e) => e.children && e.children.length > 0), W = V.selectAll(".treemapSection").data(se).enter().append("g").attr("class", "treemapSection").attr("transform", (e) => `translate(${e.x0},${e.y0})`);
390
+ W.append("rect").attr("width", (e) => e.x1 - e.x0).attr("height", X).attr("class", "treemapSectionHeader").attr("fill", "none").attr("fill-opacity", 0.6).attr("stroke-width", 0.6).attr("style", (e) => e.depth === 0 ? "display: none;" : ""), W.append("clipPath").attr("id", (e, i) => `clip-section-${a}-${i}`).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, i) => `treemapSection section${i}`).attr("fill", (e) => m(e.data.name)).attr("fill-opacity", 0.6).attr("stroke", (e) => N(e.data.name)).attr("stroke-width", 2).attr("stroke-opacity", 0.4).attr("style", (e) => {
391
+ if (e.depth === 0)
392
+ return "display: none;";
393
+ const i = P({ cssCompiledStyles: e.data.cssCompiledStyles });
394
+ return i.nodeStyles + ";" + i.borderStyles.join(";");
395
+ }), 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) => {
396
+ if (e.depth === 0)
397
+ return "display: none;";
398
+ const i = "dominant-baseline: middle; font-size: 12px; fill:" + k(e.data.name) + "; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;", f = P({ cssCompiledStyles: e.data.cssCompiledStyles });
399
+ return i + f.labelStyles.replace("color:", "fill:");
400
+ }).each(function(e) {
401
+ if (e.depth === 0)
402
+ return;
403
+ const i = Y(this), f = e.data.name;
404
+ i.text(f);
405
+ const C = e.x1 - e.x0, $ = 6;
406
+ let A;
407
+ s.showValues !== !1 && e.value ? A = C - 10 - 30 - 10 - $ : A = C - $ - 6;
408
+ const F = Math.max(15, A), y = i.node();
409
+ if (y.getComputedTextLength() > F) {
410
+ const T = "...";
411
+ let L = f;
412
+ for (; L.length > 0; ) {
413
+ if (L = f.substring(0, L.length - 1), L.length === 0) {
414
+ i.text(T), y.getComputedTextLength() > F && i.text("");
415
+ break;
416
+ }
417
+ if (i.text(L + T), y.getComputedTextLength() <= F)
418
+ break;
419
+ }
420
+ }
421
+ }), 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) => {
422
+ if (e.depth === 0)
423
+ return "display: none;";
424
+ const i = "text-anchor: end; dominant-baseline: middle; font-size: 10px; fill:" + k(e.data.name) + "; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;", f = P({ cssCompiledStyles: e.data.cssCompiledStyles });
425
+ return i + f.labelStyles.replace("color:", "fill:");
426
+ });
427
+ const ie = ee.leaves(), j = V.selectAll(".treemapLeafGroup").data(ie).enter().append("g").attr("class", (e, i) => `treemapNode treemapLeafGroup leaf${i}${e.data.classSelector ? ` ${e.data.classSelector}` : ""}x`).attr("transform", (e) => `translate(${e.x0},${e.y0})`);
428
+ j.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", 0.3).attr("stroke", (e) => e.parent ? m(e.parent.data.name) : m(e.data.name)).attr("stroke-width", 3), j.append("clipPath").attr("id", (e, i) => `clip-${a}-${i}`).append("rect").attr("width", (e) => Math.max(0, e.x1 - e.x0 - 4)).attr("height", (e) => Math.max(0, e.y1 - e.y0 - 4)), j.append("text").attr("class", "treemapLabel").attr("x", (e) => (e.x1 - e.x0) / 2).attr("y", (e) => (e.y1 - e.y0) / 2).attr("style", (e) => {
429
+ const i = "text-anchor: middle; dominant-baseline: middle; font-size: 38px;fill:" + k(e.data.name) + ";", f = P({ cssCompiledStyles: e.data.cssCompiledStyles });
430
+ return i + f.labelStyles.replace("color:", "fill:");
431
+ }).attr("clip-path", (e, i) => `url(#clip-${a}-${i})`).text((e) => e.data.name).each(function(e) {
432
+ const i = Y(this), f = e.x1 - e.x0, C = e.y1 - e.y0, $ = i.node(), A = 4, D = f - 2 * A, F = C - 2 * A;
433
+ if (D < 10 || F < 10) {
434
+ i.style("display", "none");
435
+ return;
436
+ }
437
+ let y = parseInt(i.style("font-size"), 10);
438
+ const _ = 8, T = 28, L = 0.6, z = 6, H = 2;
439
+ for (; $.getComputedTextLength() > D && y > _; )
440
+ y--, i.style("font-size", `${y}px`);
441
+ let I = Math.max(
442
+ z,
443
+ Math.min(T, Math.round(y * L))
444
+ ), U = y + H + I;
445
+ for (; U > F && y > _ && (y--, I = Math.max(
446
+ z,
447
+ Math.min(T, Math.round(y * L))
448
+ ), !(I < z && y === _)); )
449
+ i.style("font-size", `${y}px`), U = y + H + I;
450
+ i.style("font-size", `${y}px`), ($.getComputedTextLength() > D || y < _ || F < y) && i.style("display", "none");
451
+ }), s.showValues !== !1 && j.append("text").attr("class", "treemapValue").attr("x", (i) => (i.x1 - i.x0) / 2).attr("y", function(i) {
452
+ return (i.y1 - i.y0) / 2;
453
+ }).attr("style", (i) => {
454
+ const f = "text-anchor: middle; dominant-baseline: hanging; font-size: 28px;fill:" + k(i.data.name) + ";", C = P({ cssCompiledStyles: i.data.cssCompiledStyles });
455
+ return f + C.labelStyles.replace("color:", "fill:");
456
+ }).attr("clip-path", (i, f) => `url(#clip-${a}-${f})`).text((i) => i.value ? p(i.value) : "").each(function(i) {
457
+ const f = Y(this), C = this.parentNode;
458
+ if (!C) {
459
+ f.style("display", "none");
460
+ return;
461
+ }
462
+ const $ = Y(C).select(".treemapLabel");
463
+ if ($.empty() || $.style("display") === "none") {
464
+ f.style("display", "none");
465
+ return;
466
+ }
467
+ const A = parseFloat($.style("font-size")), D = 28, F = 0.6, y = 6, _ = 2, T = Math.max(
468
+ y,
469
+ Math.min(D, Math.round(A * F))
470
+ );
471
+ f.style("font-size", `${T}px`);
472
+ const z = (i.y1 - i.y0) / 2 + A / 2 + _;
473
+ f.attr("y", z);
474
+ const H = i.x1 - i.x0, ce = i.y1 - i.y0 - 4, de = H - 2 * 4;
475
+ f.node().getComputedTextLength() > de || z + T > ce || T < y ? f.style("display", "none") : f.style("display", null);
476
+ });
477
+ const oe = s.diagramPadding ?? 8;
478
+ he(b, oe, "flowchart", s?.useMaxWidth || !1);
479
+ }, "draw"), nt = /* @__PURE__ */ w(function(t, a) {
480
+ return a.db.getClasses();
481
+ }, "getClasses"), lt = { draw: at, getClasses: nt }, rt = {
482
+ sectionStrokeColor: "black",
483
+ sectionStrokeWidth: "1",
484
+ sectionFillColor: "#efefef",
485
+ leafStrokeColor: "black",
486
+ leafStrokeWidth: "1",
487
+ leafFillColor: "#efefef",
488
+ labelColor: "black",
489
+ labelFontSize: "12px",
490
+ valueFontSize: "10px",
491
+ valueColor: "black",
492
+ titleColor: "black",
493
+ titleFontSize: "14px"
494
+ }, st = /* @__PURE__ */ w(({
495
+ treemap: t
496
+ } = {}) => {
497
+ const a = te(rt, t);
498
+ return `
499
+ .treemapNode.section {
500
+ stroke: ${a.sectionStrokeColor};
501
+ stroke-width: ${a.sectionStrokeWidth};
502
+ fill: ${a.sectionFillColor};
503
+ }
504
+ .treemapNode.leaf {
505
+ stroke: ${a.leafStrokeColor};
506
+ stroke-width: ${a.leafStrokeWidth};
507
+ fill: ${a.leafFillColor};
508
+ }
509
+ .treemapLabel {
510
+ fill: ${a.labelColor};
511
+ font-size: ${a.labelFontSize};
512
+ }
513
+ .treemapValue {
514
+ fill: ${a.valueColor};
515
+ font-size: ${a.valueFontSize};
516
+ }
517
+ .treemapTitle {
518
+ fill: ${a.titleColor};
519
+ font-size: ${a.titleFontSize};
520
+ }
521
+ `;
522
+ }, "getStyles"), it = st, gt = {
523
+ parser: re,
524
+ get db() {
525
+ return new ne();
526
+ },
527
+ renderer: lt,
528
+ styles: it
529
+ };
530
+ export {
531
+ gt as diagram
532
+ };