@zombie-mermaid/svg-renderer 2.2.1 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +69 -0
- package/dist/index.cjs +29 -28
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +89 -0
- package/dist/index.d.ts +89 -0
- package/dist/index.js +1238 -701
- package/dist/index.js.map +1 -1
- package/package.json +11 -5
- package/src/__tests__/render-mermaid-svg.test.ts +64 -0
- package/src/index.ts +222 -5
- package/src/layout-engine/from-elk.ts +80 -5
- package/src/registry.ts +351 -0
- package/src/layout.ts +0 -8
package/dist/index.cjs
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},s=(n,r,s)=>(s=n==null?{}:e(i(n)),o(r||!n||!n.__esModule||!a.call(n,`default`)?t(s,`default`,{value:n,enumerable:!0}):s,n));let c=require("elkjs/lib/elk.bundled.js");c=s(c,1);let l=require("@zombie-mermaid/core"),u=require("@zombie-mermaid/mermaid-parser");function d(e){return`M ${e.x} ${e.y}`}function f(e){return d(e[0])+e.slice(1).map(e=>` L ${e.x} ${e.y}`).join(``)}function p(e){if(e.length<3)return f(e);let t=e[e.length-1],n=[d(e[0])],r=(e,t,n)=>` C ${(2*e.x+t.x)/3} ${(2*e.y+t.y)/3}, ${(e.x+2*t.x)/3} ${(e.y+2*t.y)/3}, ${(e.x+4*t.x+n.x)/6} ${(e.y+4*t.y+n.y)/6}`;n.push(` L ${(5*e[0].x+e[1].x)/6} ${(5*e[0].y+e[1].y)/6}`);for(let t=2;t<e.length;t++)n.push(r(e[t-2],e[t-1],e[t]));return n.push(r(e[e.length-2],t,t)),n.push(` L ${t.x} ${t.y}`),n.join(``)}function m(e){if(e.length<3)return f(e);let t=[d(e[0])];for(let n=1;n<e.length-1;n++){let r=e[n-1],i=e[n],a=e[n+1],o=Math.hypot(i.x-r.x,i.y-r.y),s=Math.hypot(a.x-i.x,a.y-i.y);if(o===0||s===0){t.push(` L ${i.x} ${i.y}`);continue}let c=Math.min(12,o/2,s/2),l=i.x-(i.x-r.x)/o*c,u=i.y-(i.y-r.y)/o*c,d=i.x+(a.x-i.x)/s*c,f=i.y+(a.y-i.y)/s*c;t.push(` L ${l} ${u}`),t.push(` Q ${i.x} ${i.y}, ${d} ${f}`)}let n=e[e.length-1];return t.push(` L ${n.x} ${n.y}`),t.join(``)}function h(e,t){let n=[d(e[0])],r=e.length-1;for(let i=0;i<r;i++){let a=e[i],o=e[i+1];if(i===r-1){n.push(` L ${o.x} ${o.y}`);break}if(t===`before`)n.push(` L ${a.x} ${o.y} L ${o.x} ${o.y}`);else if(t===`after`)n.push(` L ${o.x} ${a.y} L ${o.x} ${o.y}`);else{let e=(a.y+o.y)/2;n.push(` L ${a.x} ${e} L ${o.x} ${e} L ${o.x} ${o.y}`)}}return n.join(``)}function g(e,t=`linear`){if(e.length===0)return``;if(e.length===1)return d(e[0]);switch(t){case`basis`:return p(e);case`natural`:return m(e);case`step`:return h(e,`mid`);case`stepBefore`:return h(e,`before`);case`stepAfter`:return h(e,`after`);default:return f(e)}}var _=null,v=null,y=20;function b(e=y){if(!Number.isInteger(e)||e<1)throw Error(`createLayoutCache: maxSize must be a positive integer, got ${e}`);return{map:new Map,maxSize:e}}function x(e){if(Array.isArray(e))return`[${e.map(x).join(`,`)}]`;if(typeof e==`object`&&e){let t=e;return`{${Object.keys(t).sort().map(e=>`${JSON.stringify(e)}:${x(t[e])}`).join(`,`)}}`}return JSON.stringify(e)}function S(){if(_&&v)return v;let e=[],t=globalThis.setTimeout;globalThis.setTimeout=(n,r)=>r===0?(e.push(n),0):t(n,r);let n=globalThis,r=`self`in n,i=n.self;if(r&&n.document===void 0&&delete n.self,_=new c.default,!_)throw Error(`ELKBundled construction unexpectedly produced no instance`);return r&&(n.self=i),globalThis.setTimeout=t,e.forEach(e=>e()),v=_.worker.worker,v}function C(e,t){let n=t,r=n?x(e):void 0;if(n&&r!==void 0){let e=n.map.get(r);if(e)return n.map.delete(r),n.map.set(r,e),e}let i=S(),a,o,s=i.onmessage;if(i.onmessage=e=>{e.data.error?o=e.data.error:a=e.data.data},i.dispatcher.saveDispatch({data:{id:0,cmd:`layout`,graph:e}}),i.onmessage=s,o)throw o;if(!a)throw Error(`ELK layout did not return synchronously`);if(n&&r!==void 0&&(n.map.set(r,a),n.map.size>n.maxSize)){let e=n.map.keys().next().value;e!==void 0&&n.map.delete(e)}return a}function w(e,t,n){return(0,l.measureTextWidth)(e,t,n)}function T(e,t){return e.length*t*.6}var E=`'JetBrains Mono'`,D=`${E}, 'SF Mono', 'Fira Code', ui-monospace, monospace`,O={nodeLabel:13,edgeLabel:11,groupHeader:12};function k(e){return{nodeLabel:e?.nodeLabel??O.nodeLabel,edgeLabel:e?.edgeLabel??O.edgeLabel,groupHeader:e?.groupHeader??O.groupHeader}}var A={nodeLabel:500,edgeLabel:400,groupHeader:600},j=12,M={horizontal:20,vertical:10,diamondExtra:24},N={outerBox:1,innerBox:.75,connector:1},P=`0.35em`,F={width:8,height:5},I={font:`Inter`,padding:40,nodeSpacing:28,layerSpacing:48,mergeEdges:!0,thoroughness:3,fontSizes:O},ee={flowchart:`DOWN`,state:`DOWN`,class:`DOWN`,er:`RIGHT`};function te(e,t){switch(e){case`LR`:return`RIGHT`;case`RL`:return`LEFT`;case`BT`:return`UP`;case`TD`:case`TB`:return`DOWN`;default:return t}}function ne(e){let t=typeof e==`number`?{top:e,left:e,bottom:e,right:e}:e;return`[top=${t.top},left=${t.left},bottom=${t.bottom},right=${t.right}]`}function re(e){return{"elk.algorithm":`layered`,"elk.direction":e.direction,"elk.spacing.nodeNode":String(e.nodeSpacing),"elk.layered.spacing.nodeNodeBetweenLayers":String(e.layerSpacing),"elk.padding":ne(e.padding),"elk.edgeRouting":`ORTHOGONAL`}}function L(e,t,n){let r={id:e,width:t.width,height:t.height};return n!==void 0&&(r.labels=[{text:n}]),r}var ie={"elk.edgeLabels.inline":`true`,"elk.edgeLabels.placement":`CENTER`};function ae(e,t){let n=(0,l.measureMultilineText)(e,t.fontSize,A.edgeLabel),r={text:e,width:n.width+8,height:n.height+6};return t.layoutOptions&&(r.layoutOptions={...t.layoutOptions}),r}function R(e){let t={id:e.id,sources:[e.source],targets:[e.target]};return e.label&&(t.labels=[ae(e.label,e.labelStyle)]),t}function oe(e){return te(e,ee.flowchart)}function se(e){return{...re(e),"elk.spacing.edgeEdge":`12`,"elk.layered.spacing.edgeEdgeBetweenLayers":`12`,"elk.layered.spacing.edgeNodeBetweenLayers":`12`,"elk.layered.nodePlacement.bk.fixedAlignment":`BALANCED`,"elk.contentAlignment":`H_CENTER V_CENTER`}}function ce(e){return{fontSize:e.fontSizes.edgeLabel,layoutOptions:ie}}function le(e,t,n,r){let i=(0,l.measureMultilineText)(t,r,A.nodeLabel),a=i.width+M.horizontal*2,o=i.height+M.vertical*2;if(n===`diamond`){let e=Math.max(a,o)+M.diamondExtra;a=e,o=e}if(n===`circle`||n===`doublecircle`){let e=Math.ceil(Math.sqrt(a*a+o*o))+8;a=n===`doublecircle`?e+12:e,o=a}return n===`hexagon`&&(a+=M.horizontal),(n===`trapezoid`||n===`trapezoid-alt`||n===`parallelogram`||n===`parallelogram-alt`)&&(a+=M.horizontal),n===`asymmetric`&&(a+=12),n===`cylinder`&&(o+=14),n===`state-start`||n===`state-end`?{width:28,height:28}:(a=Math.max(a,60),o=Math.max(o,36),{width:a,height:o})}var ue=` root`;function de(e){for(let t of e)if(t.direction!==void 0||de(t.children))return!0;return!1}function fe(e,t){for(let n of e.nodeIds)t.add(n);for(let n of e.children)fe(n,t)}function pe(e,t){let n=new Set;if(fe(e,n),n.size===0)return!0;let r=t=>n.has(t)||t===e.id;return!t.edges.some(e=>r(e.source)!==r(e.target))}function me(e){let t=new Map;function n(e,r){let i=[...r,e.id];t.set(e.id,i);for(let t of e.children)n(t,i)}for(let t of e)n(t,[]);return t}function he(e,t){let n=0;for(;n<e.length&&n<t.length&&e[n]===t[n];)n++;return n}function ge(e,t){let n=new Set,r=new Set;for(let t of e.subgraphs)r.add(t.id),ve(t,n,r);let i=ye(e.subgraphs),a=me(e.subgraphs),o=e=>e?a.get(e)??[]:[],s=new Map;s.set(null,[]);let c=[];for(let t=0;t<e.edges.length;t++){let n=e.edges[t],r=i.get(n.source),a=i.get(n.target);if(r&&r===a){let e=s.get(r)??[];s.set(r,e),e.push({index:t,edge:n})}else!r&&!a?s.get(null).push({index:t,edge:n}):c.push({index:t,edge:n,srcChain:o(r),tgtChain:o(a)})}let l=de(e.subgraphs),u=[],d=[],f={...se({direction:oe(e.direction),nodeSpacing:t.nodeSpacing,layerSpacing:t.layerSpacing,padding:t.padding}),"elk.layered.thoroughness":String(I.thoroughness),"elk.layered.highDegreeNodes.treatment":`true`,"elk.layered.highDegreeNodes.threshold":`8`,"elk.layered.compaction.postCompaction.strategy":`LEFT_RIGHT_CONSTRAINT_LOCKING`,"elk.layered.considerModelOrder.strategy":`NODES_AND_EDGES`,"elk.layered.wrapping.strategy":`OFF`,"elk.hierarchyHandling":l?`SEPARATE`:`INCLUDE_CHILDREN`},p=new Map,m=new Map;function h(e,t){let n=p.get(e)??new Set;p.set(e,n),n.add(t)}function g(e,t){let n=m.get(e)??[];m.set(e,n),n.push(t)}if(l)for(let{index:e,edge:n,srcChain:r,tgtChain:i}of c){let a=he(r,i),o=n.source;if(r.length>a){for(let t=r.length-1;t>=a;t--){let i=r[t],a=`${i}_out_${e}`;h(i,a);let o=t===r.length-1?n.source:`${r[t+1]}_out_${e}`;g(i,{id:`e${e}_s${t}`,sources:[o],targets:[a]})}o=`${r[a]}_out_${e}`}let s=n.target;if(i.length>a){for(let t=a;t<=i.length-1;t++){let r=i[t],a=`${r}_in_${e}`;h(r,a);let o=t===i.length-1?n.target:`${i[t+1]}_in_${e}`;g(r,{id:`e${e}_t${t}`,sources:[a],targets:[o]})}s=`${i[a]}_in_${e}`}g(a>0?r[a-1]:ue,R({id:`e${e}`,source:o,target:s,label:n.label,labelStyle:ce(t)}))}for(let[i,a]of e.nodes)if(!n.has(i)&&!r.has(i)){let e=le(i,a.label,a.shape,t.fontSizes.nodeLabel);u.push(L(i,e,a.label))}for(let n of[...e.subgraphs].reverse())u.push(_e(n,e,t,s,p,m,e.direction));for(let{index:e,edge:n}of s.get(null))n.source!==n.target&&d.push(R({id:`e${e}`,source:n.source,target:n.target,label:n.label,labelStyle:ce(t)}));if(l)for(let e of m.get(ue)??[])d.push(e);else for(let{index:e,edge:n}of c)d.push(R({id:`e${e}`,source:n.source,target:n.target,label:n.label,labelStyle:ce(t)}));return{id:`root`,layoutOptions:f,children:u,edges:d}}function _e(e,t,n,r,i,a,o){let s=e.direction!==void 0&&pe(e,t)?e.direction:o,c=se({direction:oe(s),nodeSpacing:n.nodeSpacing,layerSpacing:n.layerSpacing,padding:{top:44,left:16,bottom:16,right:16}}),l,u=i.get(e.id);u&&u.size>0&&(l=[...u].map(e=>({id:e})));let d=[];for(let r of e.nodeIds){let e=t.nodes.get(r);if(e){let t=le(r,e.label,e.shape,n.fontSizes.nodeLabel);d.push(L(r,t,e.label))}}for(let o of[...e.children].reverse())d.push(_e(o,t,n,r,i,a,s));let f=[],p=r.get(e.id)??[];for(let{index:e,edge:t}of p)t.source!==t.target&&f.push(R({id:`e${e}`,source:t.source,target:t.target,label:t.label,labelStyle:ce(n)}));for(let t of a.get(e.id)??[])f.push(t);return{id:e.id,layoutOptions:c,labels:e.label?[{text:e.label}]:void 0,ports:l,children:d,edges:f}}function ve(e,t,n){for(let n of e.nodeIds)t.add(n);for(let r of e.children)n.add(r.id),ve(r,t,n)}function ye(e){let t=new Map;function n(e){for(let n of e.nodeIds)t.set(n,e.id);for(let t of e.children)n(t)}for(let t of e)n(t);return t}function be(e,t,n){if(e.length<2||t.shape===`rectangle`||t.shape===`rounded`||t.shape===`stadium`)return e;let r=[...e];if(t.shape===`diamond`){if(n)r[0]=xe(e[0],e[1],t);else{let n=e.length-1;r[n]=xe(e[n],e[n-1],t)}}return r}function xe(e,t,n){let r=n.x+n.width/2,i=n.y+n.height/2,a={x:r,y:n.y},o={x:n.x+n.width,y:i},s={x:r,y:n.y+n.height},c={x:n.x,y:i},l=e.x-t.x,u=e.y-t.y;if(Math.abs(l)<Math.abs(u)){let t=e.x;return u>0?t<=r?Ce(t,c,a)??a:Ce(t,a,o)??a:t<=r?Ce(t,s,c)??s:Ce(t,o,s)??s}{let t=e.y;return l>0?t<=i?Se(t,a,c)??c:Se(t,c,s)??c:t<=i?Se(t,a,o)??o:Se(t,o,s)??o}}function Se(e,t,n){let r=n.y-t.y;if(Math.abs(r)<.001)return null;let i=(e-t.y)/r;return i<0||i>1?null:{x:t.x+i*(n.x-t.x),y:e}}function Ce(e,t,n){let r=n.x-t.x;if(Math.abs(r)<.001)return null;let i=(e-t.x)/r;return i<0||i>1?null:{x:e,y:t.y+i*(n.y-t.y)}}function we(e,t,n){if(e.length===0)return;let r=n===`LR`||n===`RL`,i=new Set;for(let e of t)i.add(`${e.source}:${e.target}`),i.add(`${e.target}:${e.source}`);let a=I.layerSpacing*.6,o=[...e].sort((e,t)=>r?e.x-t.x:e.y-t.y),s=[],c=[o[0]];for(let e=1;e<o.length;e++){let t=(r?o[e].x:o[e].y)-(r?o[e-1].x:o[e-1].y),n=c.some(t=>i.has(`${t.id}:${o[e].id}`));t<=a&&!n?c.push(o[e]):(s.push(c),c=[o[e]])}s.push(c);let l=new Map;for(let e of s){if(e.length<=1)continue;let t=e.map(e=>r?e.x:e.y),n=Math.min(...t),i=Math.max(...t);if(i-n<=1)continue;let a=(n+i)/2;for(let t of e){let e=a-(r?t.x:t.y);Math.abs(e)>.5&&(r?t.x=a:t.y=a,l.set(t.id,e))}}if(l.size!==0)for(let e of t){if(e.points.length<2)continue;let t=l.get(e.source),n=l.get(e.target);if(t!=null){let n=e.points[0];r?(n.x+=t,e.points.length>1&&e.points[1].x===n.x-t&&(e.points[1].x+=t)):(n.y+=t,e.points.length>1&&e.points[1].y===n.y-t&&(e.points[1].y+=t))}if(n!=null){let t=e.points[e.points.length-1];if(r){if(t.x+=n,e.points.length>1){let r=e.points[e.points.length-2];r.x===t.x-n&&(r.x+=n)}}else if(t.y+=n,e.points.length>1){let r=e.points[e.points.length-2];r.y===t.y-n&&(r.y+=n)}}}}var Te=.5;function Ee(e,t,n){for(let r=0;r<e.length-1;r++){let i=e[r],a=e[r+1],o=Math.min(i.x,a.x),s=Math.max(i.x,a.x),c=Math.min(i.y,a.y),l=Math.max(i.y,a.y);for(let e of t){if(n.has(e.id))continue;let t=e.x+Te,r=e.x+e.width-Te,i=e.y+Te,a=e.y+e.height-Te;if(!(t>=r||i>=a)&&o<r&&s>t&&c<a&&l>i)return!1}}return!0}function De(e,t,n){let r=[];for(let i of n)e>=i.x&&e<=i.x+i.width&&t>=i.y&&t<=i.y+i.height&&(r.push(i),r.push(...De(e,t,i.children)));return r}function Oe(e,t,n,r,i){let a=i===`LR`,o=i===`RL`,s=i===`BT`,c=a||o,l=new Set(De(t,n,r).map(e=>e.id)),u=De(c?e:t,c?n:e,r).find(e=>!l.has(e.id));return u?a?u.x-12:o?u.x+u.width+12:s?u.y+u.height+12:u.y-12:e}function ke(e,t,n,r){let i=new Map(t.map(e=>[e.id,e])),a=new Set,o=r===`LR`,s=r===`RL`,c=r===`BT`,l=o||s,u=new Map;for(let t of e){if(t.source===t.target)continue;let e=u.get(t.source)??[];u.set(t.source,e),e.push(t)}for(let[e,d]of u){if(d.length<2)continue;let u=d[0].style;if(d.some(e=>e.label||e.style!==u))continue;let f=i.get(e);if(!f)continue;let p=[];for(let e of d){let t=i.get(e.target);t&&(o?t.x>f.x+f.width:s?t.x+t.width<f.x:c?t.y+t.height<f.y:t.y>f.y+f.height)&&p.push({edge:e,node:t})}if(p.length<2)continue;let m=f.x+f.width/2,h=f.y+f.height/2;if(l){let i=o?f.x+f.width:f.x,s=h,c=i+((o?Math.min(...p.map(e=>e.node.x)):Math.max(...p.map(e=>e.node.x+e.node.width)))-i)/2;c=Oe(c,m,h,n,r);let l=[];for(let{edge:n,node:r}of p){let a=o?r.x:r.x+r.width,u=r.y+r.height/2,d=[{x:i,y:s},{x:c,y:s},{x:c,y:u},{x:a,y:u}];Ee(d,t,new Set([e,r.id]))&&l.push({edge:n,points:d})}if(l.length<2)continue;for(let{edge:e,points:t}of l)e.points=t,a.add(e)}else{let i=m,o=c?f.y:f.y+f.height,s=o+((c?Math.max(...p.map(e=>e.node.y+e.node.height)):Math.min(...p.map(e=>e.node.y)))-o)/2;s=Oe(s,m,h,n,r);let l=[];for(let{edge:n,node:r}of p){let a=r.x+r.width/2,u=c?r.y+r.height:r.y,d=[{x:i,y:o},{x:i,y:s},{x:a,y:s},{x:a,y:u}];Ee(d,t,new Set([e,r.id]))&&l.push({edge:n,points:d})}if(l.length<2)continue;for(let{edge:e,points:t}of l)e.points=t,a.add(e)}}let d=new Map;for(let t of e){if(a.has(t)||t.source===t.target)continue;let e=d.get(t.target)??[];d.set(t.target,e),e.push(t)}for(let[e,a]of d){if(a.length<2)continue;let u=a[0].style;if(a.some(e=>e.label||e.style!==u))continue;let d=i.get(e);if(!d)continue;let f=[];for(let e of a){let t=i.get(e.source);t&&(o?t.x+t.width<d.x:s?t.x>d.x+d.width:c?t.y>d.y+d.height:t.y+t.height<d.y)&&f.push({edge:e,node:t})}if(f.length<2)continue;let p=d.x+d.width/2,m=d.y+d.height/2;if(l){let i=o?d.x:d.x+d.width,a=m,s=o?Math.max(...f.map(e=>e.node.x+e.node.width)):Math.min(...f.map(e=>e.node.x)),c=s+(i-s)/2;c=Oe(c,p,m,n,r);let l=[];for(let{edge:n,node:r}of f){let s=o?r.x+r.width:r.x,u=r.y+r.height/2,d=[{x:s,y:u},{x:c,y:u},{x:c,y:a},{x:i,y:a}];Ee(d,t,new Set([r.id,e]))&&l.push({edge:n,points:d})}if(l.length<2)continue;for(let{edge:e,points:t}of l)e.points=t}else{let i=p,a=c?d.y+d.height:d.y,o=c?Math.min(...f.map(e=>e.node.y)):Math.max(...f.map(e=>e.node.y+e.node.height)),s=o+(a-o)/2;s=Oe(s,p,m,n,r);let l=[];for(let{edge:n,node:r}of f){let o=r.x+r.width/2,u=[{x:o,y:c?r.y:r.y+r.height},{x:o,y:s},{x:i,y:s},{x:i,y:a}];Ee(u,t,new Set([r.id,e]))&&l.push({edge:n,points:u})}if(l.length<2)continue;for(let{edge:e,points:t}of l)e.points=t}}}function z(e,t=0,n=0){let r=[];if(!e.sections||e.sections.length===0)return r;let i=e.sections[0];if(r.push({x:i.startPoint.x+t,y:i.startPoint.y+n}),i.bendPoints)for(let e of i.bendPoints)r.push({x:e.x+t,y:e.y+n});return r.push({x:i.endPoint.x+t,y:i.endPoint.y+n}),r}function Ae(e,t=0,n=0){if(!e.labels||e.labels.length===0)return;let r=e.labels[0];if(r.x!=null&&r.y!=null)return{x:r.x+(r.width??0)/2+t,y:r.y+(r.height??0)/2+n}}var je=16,Me=28,Ne=18,Pe=28,Fe=10;function Ie(e,t){let n=e.x+e.width,r=e.y+e.height/2,i=Math.min(Pe,e.height*.6)/2,a=Me+t*Ne,o=[];for(let e=0;e<=je;e++){let t=Math.PI*e/je;o.push({x:n+a*Math.sin(t),y:r-i*Math.cos(t)})}return{points:o,labelPosition:{x:n+a+Fe,y:r}}}function Le(e,t,n){let r=new Map;for(let i=0;i<e.edges.length;i++){let a=e.edges[i];if(a.source!==a.target)continue;let o=t.get(a.source);if(!o)continue;let s=r.get(o.id)??0;r.set(o.id,s+1);let{points:c,labelPosition:l}=Ie(o,s);n.push({source:a.source,target:a.target,label:a.label,style:a.style,hasArrowStart:a.hasArrowStart,hasArrowEnd:a.hasArrowEnd,points:c,labelPosition:a.label?l:void 0,inlineStyle:Je(i,e),id:a.id,animate:a.animate})}}function Re(e){let t=[];for(let n of e)t.push({x:n.x,y:n.y,right:n.x+n.width,bottom:n.y+n.height}),t.push(...Re(n.children));return t}function ze(e,t,n=!1){let r=[],i=[],a=[],o=new Set;for(let e of t.subgraphs)qe(e,o);Be(e,t,o,r,a,0,0);let s=Re(a);Ue(e,t,i,0,0,s.length>0?{leftX:Math.min(...s.map(e=>e.x))-20,rightX:Math.max(...s.map(e=>e.right))+20}:void 0),we(r,i,t.direction);let c=new Map(r.map(e=>[e.id,e]));Le(t,c,i),n&&ke(i,r,a,t.direction);for(let e of i){let t=c.get(e.source),n=c.get(e.target);t&&(e.points=be(e.points,t,!0)),n&&(e.points=be(e.points,n,!1))}let l=e.width??800,u=e.height??600,d=F.width,f=I.padding;for(let e of i){for(let t of e.points)l=Math.max(l,t.x+d+f),u=Math.max(u,t.y+d+f);e.labelPosition&&(l=Math.max(l,e.labelPosition.x+60+f),u=Math.max(u,e.labelPosition.y+20+f))}return{width:l,height:u,nodes:r,edges:i,groups:a}}function Be(e,t,n,r,i,a,o){if(e.children)for(let s of e.children){let e=(s.x??0)+a,c=(s.y??0)+o,u=s.width??0,d=s.height??0;if(n.has(s.id)){let a=[];Be(s,t,n,r,a,e,c);let o=Ke(t.subgraphs,s.id);i.push({id:s.id,label:o?.label??``,x:e,y:c,width:u,height:d,children:a})}else{let a=t.nodes.get(s.id);if(a){let n=(0,l.resolveNodeStyle)(s.id,t),i=t.classAssignments.get(s.id);r.push({id:s.id,label:a.label,shape:a.shape,x:e,y:c,width:u,height:d,inlineStyle:n,className:i,interaction:t.interactions.get(s.id)})}s.children&&s.children.length>0&&Be(s,t,n,r,i,e,c)}}}function Ve(e){let t=/^e(\d+)$/.exec(e);if(t)return{edgeIndex:parseInt(t[1],10),role:`bridge`};let n=/^e(\d+)_([st])(\d+)$/.exec(e);if(n)return{edgeIndex:parseInt(n[1],10),role:n[2]===`s`?`source`:`target`,level:parseInt(n[3],10)}}function He(e){if(e.length===0)return{x:0,y:0};if(e.length===1)return e[0];let t=0;for(let n=1;n<e.length;n++){let r=e[n].x-e[n-1].x,i=e[n].y-e[n-1].y;t+=Math.sqrt(r*r+i*i)}let n=t/2;for(let t=1;t<e.length;t++){let r=e[t].x-e[t-1].x,i=e[t].y-e[t-1].y,a=Math.sqrt(r*r+i*i);if(n<=a){let o=n/a;return{x:e[t-1].x+o*r,y:e[t-1].y+o*i}}n-=a}return e[e.length-1]}function Ue(e,t,n,r,i,a){let o=new Map;Ge(e,o,0,0);let s=0;for(let[e,r]of o){let i=t.edges[e];if(!i)continue;let o=[],c=e=>{!e||e.points.length===0||(o.length>0?o.push(...e.points.slice(1)):o.push(...e.points))},l=[...r.sourceHops.keys()].sort((e,t)=>t-e);for(let e of l)c(r.sourceHops.get(e));c(r.bridge);let u=[...r.targetHops.keys()].sort((e,t)=>e-t);for(let e of u)c(r.targetHops.get(e));let d;i.label&&o.length>=2&&(d=r.bridge?.labelPosition??He(o));let f=We(o,a,s);f!==o&&s++,i.label&&f!==o&&f.length>=2&&(d=He(f)),n.push({source:i.source,target:i.target,label:i.label,style:i.style,hasArrowStart:i.hasArrowStart,hasArrowEnd:i.hasArrowEnd,points:f,labelPosition:d,inlineStyle:Je(e,t),id:i.id,animate:i.animate})}}function We(e,t,n=0){if(e.length<2)return e;let r=!1;for(let t=1;t<e.length;t++){let n=Math.abs(e[t].x-e[t-1].x),i=Math.abs(e[t].y-e[t-1].y);if(n>1&&i>1){r=!0;break}}if(!r)return e;let i=[e[0]];for(let r=1;r<e.length;r++){let a=i[i.length-1],o=e[r],s=Math.abs(o.x-a.x),c=Math.abs(o.y-a.y);if(s>1&&c>1){if(t){let e=n%2==0,r=Math.floor(n/2)*12,s=e?t.rightX+r:t.leftX-r;i.push({x:s,y:a.y}),i.push({x:s,y:o.y})}else{let e=(a.y+o.y)/2;i.push({x:a.x,y:e}),i.push({x:o.x,y:e})}}i.push(o)}return i}function Ge(e,t,n,r){if(e.edges)for(let i of e.edges){let e=Ve(i.id);if(!e)continue;let{edgeIndex:a}=e,o=z(i,n,r),s=Ae(i,n,r),c=t.get(a)??{sourceHops:new Map,targetHops:new Map};t.set(a,c);let l={edgeIndex:a,points:o,labelPosition:s};e.role===`bridge`?c.bridge=l:e.role===`source`?c.sourceHops.set(e.level,l):c.targetHops.set(e.level,l)}if(e.children)for(let i of e.children)Ge(i,t,n+(i.x??0),r+(i.y??0))}function Ke(e,t){for(let n of e){if(n.id===t)return n;let e=Ke(n.children,t);if(e)return e}}function qe(e,t){t.add(e.id);for(let n of e.children)qe(n,t)}function Je(e,t){let n,r=t.linkStyles.get(`default`);r&&(n={...r});let i=t.linkStyles.get(e);return i&&(n=n?{...n,...i}:{...i}),n}function Ye(e,t={}){let n={...I,...t,fontSizes:k(t.fontSizes)};return ze(C(ge(e,n),t.layoutCache),e,n.mergeEdges)}function Xe(e,t={}){return ge(e,{...I,...t,fontSizes:k(t.fontSizes)})}function Ze(e,t,n=`Inter`,r=!1,i=O,a=`linear`,o,s=!0,c=!0,u,d,f={}){let p=[],m=c&&e.nodes.some(e=>!!(0,l.safeHref)(e.interaction?.href));p.push(V((0,l.svgOpenTag)(e.width,e.height,t,r,u,d,m,f.styleAttribute),o)),p.push((0,l.buildStyleBlock)(n,!1,f.nonce)),s&&e.edges.some(e=>e.animate)&&p.push(Qe(f.nonce)),p.push(`<defs>`),p.push($e());let h=new Set;for(let t of e.edges)t.inlineStyle?.stroke&&h.add(t.inlineStyle.stroke);for(let e of h)p.push(et(e));p.push(`</defs>`);for(let t of e.groups)p.push(rt(t,n,i));for(let t of e.edges)p.push(it(t,a,s));for(let t of e.edges)t.label&&p.push(ot(t,n,i));for(let t of e.nodes)p.push(ut(t,n,i,c));return p.push(`</svg>`),p.join(`
|
|
2
|
-
`)}function
|
|
3
|
-
`)}function
|
|
4
|
-
`+s(`arrowhead-start${t}`,`auto-start-reverse`)}function
|
|
5
|
-
`)}function
|
|
6
|
-
`)}\n</g>`}function
|
|
7
|
-
`)}function
|
|
8
|
-
`)}function
|
|
9
|
-
`)}function
|
|
10
|
-
`)}function
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},s=(n,r,s)=>(s=n==null?{}:e(i(n)),o(r||!n||!n.__esModule||!a.call(n,`default`)?t(s,`default`,{value:n,enumerable:!0}):s,n));let c=require("elkjs/lib/elk.bundled.js");c=s(c,1);let l=require("@zombie-mermaid/core"),u=require("@zombie-mermaid/mermaid-parser"),d=require("entities");function f(e){return`M ${e.x} ${e.y}`}function p(e){return f(e[0])+e.slice(1).map(e=>` L ${e.x} ${e.y}`).join(``)}function m(e){if(e.length<3)return p(e);let t=e[e.length-1],n=[f(e[0])],r=(e,t,n)=>` C ${(2*e.x+t.x)/3} ${(2*e.y+t.y)/3}, ${(e.x+2*t.x)/3} ${(e.y+2*t.y)/3}, ${(e.x+4*t.x+n.x)/6} ${(e.y+4*t.y+n.y)/6}`;n.push(` L ${(5*e[0].x+e[1].x)/6} ${(5*e[0].y+e[1].y)/6}`);for(let t=2;t<e.length;t++)n.push(r(e[t-2],e[t-1],e[t]));return n.push(r(e[e.length-2],t,t)),n.push(` L ${t.x} ${t.y}`),n.join(``)}function h(e){if(e.length<3)return p(e);let t=[f(e[0])];for(let n=1;n<e.length-1;n++){let r=e[n-1],i=e[n],a=e[n+1],o=Math.hypot(i.x-r.x,i.y-r.y),s=Math.hypot(a.x-i.x,a.y-i.y);if(o===0||s===0){t.push(` L ${i.x} ${i.y}`);continue}let c=Math.min(12,o/2,s/2),l=i.x-(i.x-r.x)/o*c,u=i.y-(i.y-r.y)/o*c,d=i.x+(a.x-i.x)/s*c,f=i.y+(a.y-i.y)/s*c;t.push(` L ${l} ${u}`),t.push(` Q ${i.x} ${i.y}, ${d} ${f}`)}let n=e[e.length-1];return t.push(` L ${n.x} ${n.y}`),t.join(``)}function g(e,t){let n=[f(e[0])],r=e.length-1;for(let i=0;i<r;i++){let a=e[i],o=e[i+1];if(i===r-1){n.push(` L ${o.x} ${o.y}`);break}if(t===`before`)n.push(` L ${a.x} ${o.y} L ${o.x} ${o.y}`);else if(t===`after`)n.push(` L ${o.x} ${a.y} L ${o.x} ${o.y}`);else{let e=(a.y+o.y)/2;n.push(` L ${a.x} ${e} L ${o.x} ${e} L ${o.x} ${o.y}`)}}return n.join(``)}function _(e,t=`linear`){if(e.length===0)return``;if(e.length===1)return f(e[0]);switch(t){case`basis`:return m(e);case`natural`:return h(e);case`step`:return g(e,`mid`);case`stepBefore`:return g(e,`before`);case`stepAfter`:return g(e,`after`);default:return p(e)}}var v=null,y=null,b=20;function x(e=b){if(!Number.isInteger(e)||e<1)throw Error(`createLayoutCache: maxSize must be a positive integer, got ${e}`);return{map:new Map,maxSize:e}}function S(e){if(Array.isArray(e))return`[${e.map(S).join(`,`)}]`;if(typeof e==`object`&&e){let t=e;return`{${Object.keys(t).sort().map(e=>`${JSON.stringify(e)}:${S(t[e])}`).join(`,`)}}`}return JSON.stringify(e)}function C(){if(v&&y)return y;let e=[],t=globalThis.setTimeout;globalThis.setTimeout=(n,r)=>r===0?(e.push(n),0):t(n,r);let n=globalThis,r=`self`in n,i=n.self;if(r&&n.document===void 0&&delete n.self,v=new c.default,!v)throw Error(`ELKBundled construction unexpectedly produced no instance`);return r&&(n.self=i),globalThis.setTimeout=t,e.forEach(e=>e()),y=v.worker.worker,y}function w(e,t){let n=t,r=n?S(e):void 0;if(n&&r!==void 0){let e=n.map.get(r);if(e)return n.map.delete(r),n.map.set(r,e),e}let i=C(),a,o,s=i.onmessage;if(i.onmessage=e=>{e.data.error?o=e.data.error:a=e.data.data},i.dispatcher.saveDispatch({data:{id:0,cmd:`layout`,graph:e}}),i.onmessage=s,o)throw o;if(!a)throw Error(`ELK layout did not return synchronously`);if(n&&r!==void 0&&(n.map.set(r,a),n.map.size>n.maxSize)){let e=n.map.keys().next().value;e!==void 0&&n.map.delete(e)}return a}function T(e,t,n){return(0,l.measureTextWidth)(e,t,n)}function E(e,t){return e.length*t*.6}var D=`'JetBrains Mono'`,O=`${D}, 'SF Mono', 'Fira Code', ui-monospace, monospace`,k={nodeLabel:13,edgeLabel:11,groupHeader:12};function A(e){return{nodeLabel:e?.nodeLabel??k.nodeLabel,edgeLabel:e?.edgeLabel??k.edgeLabel,groupHeader:e?.groupHeader??k.groupHeader}}var j={nodeLabel:500,edgeLabel:400,groupHeader:600},M=12,N={horizontal:20,vertical:10,diamondExtra:24},P={outerBox:1,innerBox:.75,connector:1},F=`0.35em`,I={width:8,height:5},L={font:`Inter`,padding:40,nodeSpacing:28,layerSpacing:48,mergeEdges:!0,thoroughness:3,fontSizes:k},ee={flowchart:`DOWN`,state:`DOWN`,class:`DOWN`,er:`RIGHT`};function te(e,t){switch(e){case`LR`:return`RIGHT`;case`RL`:return`LEFT`;case`BT`:return`UP`;case`TD`:case`TB`:return`DOWN`;default:return t}}function ne(e){let t=typeof e==`number`?{top:e,left:e,bottom:e,right:e}:e;return`[top=${t.top},left=${t.left},bottom=${t.bottom},right=${t.right}]`}function re(e){return{"elk.algorithm":`layered`,"elk.direction":e.direction,"elk.spacing.nodeNode":String(e.nodeSpacing),"elk.layered.spacing.nodeNodeBetweenLayers":String(e.layerSpacing),"elk.padding":ne(e.padding),"elk.edgeRouting":`ORTHOGONAL`}}function R(e,t,n){let r={id:e,width:t.width,height:t.height};return n!==void 0&&(r.labels=[{text:n}]),r}var ie={"elk.edgeLabels.inline":`true`,"elk.edgeLabels.placement":`CENTER`};function ae(e,t){let n=(0,l.measureMultilineText)(e,t.fontSize,j.edgeLabel),r={text:e,width:n.width+8,height:n.height+6};return t.layoutOptions&&(r.layoutOptions={...t.layoutOptions}),r}function z(e){let t={id:e.id,sources:[e.source],targets:[e.target]};return e.label&&(t.labels=[ae(e.label,e.labelStyle)]),t}function oe(e){return te(e,ee.flowchart)}function se(e){return{...re(e),"elk.spacing.edgeEdge":`12`,"elk.layered.spacing.edgeEdgeBetweenLayers":`12`,"elk.layered.spacing.edgeNodeBetweenLayers":`12`,"elk.layered.nodePlacement.bk.fixedAlignment":`BALANCED`,"elk.contentAlignment":`H_CENTER V_CENTER`}}function ce(e){return{fontSize:e.fontSizes.edgeLabel,layoutOptions:ie}}function le(e,t,n,r){let i=(0,l.measureMultilineText)(t,r,j.nodeLabel),a=i.width+N.horizontal*2,o=i.height+N.vertical*2;if(n===`diamond`){let e=Math.max(a,o)+N.diamondExtra;a=e,o=e}if(n===`circle`||n===`doublecircle`){let e=Math.ceil(Math.sqrt(a*a+o*o))+8;a=n===`doublecircle`?e+12:e,o=a}return n===`hexagon`&&(a+=N.horizontal),(n===`trapezoid`||n===`trapezoid-alt`||n===`parallelogram`||n===`parallelogram-alt`)&&(a+=N.horizontal),n===`asymmetric`&&(a+=12),n===`cylinder`&&(o+=14),n===`state-start`||n===`state-end`?{width:28,height:28}:(a=Math.max(a,60),o=Math.max(o,36),{width:a,height:o})}var ue=` root`;function de(e){for(let t of e)if(t.direction!==void 0||de(t.children))return!0;return!1}function fe(e,t){for(let n of e.nodeIds)t.add(n);for(let n of e.children)fe(n,t)}function pe(e,t){let n=new Set;if(fe(e,n),n.size===0)return!0;let r=t=>n.has(t)||t===e.id;return!t.edges.some(e=>r(e.source)!==r(e.target))}function me(e){let t=new Map;function n(e,r){let i=[...r,e.id];t.set(e.id,i);for(let t of e.children)n(t,i)}for(let t of e)n(t,[]);return t}function he(e,t){let n=0;for(;n<e.length&&n<t.length&&e[n]===t[n];)n++;return n}function ge(e,t){let n=new Set,r=new Set;for(let t of e.subgraphs)r.add(t.id),ve(t,n,r);let i=ye(e.subgraphs),a=me(e.subgraphs),o=e=>e?a.get(e)??[]:[],s=new Map;s.set(null,[]);let c=[];for(let t=0;t<e.edges.length;t++){let n=e.edges[t],r=i.get(n.source),a=i.get(n.target);if(r&&r===a){let e=s.get(r)??[];s.set(r,e),e.push({index:t,edge:n})}else!r&&!a?s.get(null).push({index:t,edge:n}):c.push({index:t,edge:n,srcChain:o(r),tgtChain:o(a)})}let l=de(e.subgraphs),u=[],d=[],f={...se({direction:oe(e.direction),nodeSpacing:t.nodeSpacing,layerSpacing:t.layerSpacing,padding:t.padding}),"elk.layered.thoroughness":String(L.thoroughness),"elk.layered.highDegreeNodes.treatment":`true`,"elk.layered.highDegreeNodes.threshold":`8`,"elk.layered.compaction.postCompaction.strategy":`LEFT_RIGHT_CONSTRAINT_LOCKING`,"elk.layered.considerModelOrder.strategy":`NODES_AND_EDGES`,"elk.layered.wrapping.strategy":`OFF`,"elk.hierarchyHandling":l?`SEPARATE`:`INCLUDE_CHILDREN`},p=new Map,m=new Map;function h(e,t){let n=p.get(e)??new Set;p.set(e,n),n.add(t)}function g(e,t){let n=m.get(e)??[];m.set(e,n),n.push(t)}if(l)for(let{index:e,edge:n,srcChain:r,tgtChain:i}of c){let a=he(r,i),o=n.source;if(r.length>a){for(let t=r.length-1;t>=a;t--){let i=r[t],a=`${i}_out_${e}`;h(i,a);let o=t===r.length-1?n.source:`${r[t+1]}_out_${e}`;g(i,{id:`e${e}_s${t}`,sources:[o],targets:[a]})}o=`${r[a]}_out_${e}`}let s=n.target;if(i.length>a){for(let t=a;t<=i.length-1;t++){let r=i[t],a=`${r}_in_${e}`;h(r,a);let o=t===i.length-1?n.target:`${i[t+1]}_in_${e}`;g(r,{id:`e${e}_t${t}`,sources:[a],targets:[o]})}s=`${i[a]}_in_${e}`}g(a>0?r[a-1]:ue,z({id:`e${e}`,source:o,target:s,label:n.label,labelStyle:ce(t)}))}for(let[i,a]of e.nodes)if(!n.has(i)&&!r.has(i)){let e=le(i,a.label,a.shape,t.fontSizes.nodeLabel);u.push(R(i,e,a.label))}for(let n of[...e.subgraphs].reverse())u.push(_e(n,e,t,s,p,m,e.direction));for(let{index:e,edge:n}of s.get(null))n.source!==n.target&&d.push(z({id:`e${e}`,source:n.source,target:n.target,label:n.label,labelStyle:ce(t)}));if(l)for(let e of m.get(ue)??[])d.push(e);else for(let{index:e,edge:n}of c)d.push(z({id:`e${e}`,source:n.source,target:n.target,label:n.label,labelStyle:ce(t)}));return{id:`root`,layoutOptions:f,children:u,edges:d}}function _e(e,t,n,r,i,a,o){let s=e.direction!==void 0&&pe(e,t)?e.direction:o,c=se({direction:oe(s),nodeSpacing:n.nodeSpacing,layerSpacing:n.layerSpacing,padding:{top:44,left:16,bottom:16,right:16}}),l,u=i.get(e.id);u&&u.size>0&&(l=[...u].map(e=>({id:e})));let d=[];for(let r of e.nodeIds){let e=t.nodes.get(r);if(e){let t=le(r,e.label,e.shape,n.fontSizes.nodeLabel);d.push(R(r,t,e.label))}}for(let o of[...e.children].reverse())d.push(_e(o,t,n,r,i,a,s));let f=[],p=r.get(e.id)??[];for(let{index:e,edge:t}of p)t.source!==t.target&&f.push(z({id:`e${e}`,source:t.source,target:t.target,label:t.label,labelStyle:ce(n)}));for(let t of a.get(e.id)??[])f.push(t);return{id:e.id,layoutOptions:c,labels:e.label?[{text:e.label}]:void 0,ports:l,children:d,edges:f}}function ve(e,t,n){for(let n of e.nodeIds)t.add(n);for(let r of e.children)n.add(r.id),ve(r,t,n)}function ye(e){let t=new Map;function n(e){for(let n of e.nodeIds)t.set(n,e.id);for(let t of e.children)n(t)}for(let t of e)n(t);return t}function be(e,t,n){if(e.length<2||t.shape===`rectangle`||t.shape===`rounded`||t.shape===`stadium`)return e;let r=[...e];if(t.shape===`diamond`){if(n)r[0]=xe(e[0],e[1],t);else{let n=e.length-1;r[n]=xe(e[n],e[n-1],t)}}return r}function xe(e,t,n){let r=n.x+n.width/2,i=n.y+n.height/2,a={x:r,y:n.y},o={x:n.x+n.width,y:i},s={x:r,y:n.y+n.height},c={x:n.x,y:i},l=e.x-t.x,u=e.y-t.y;if(Math.abs(l)<Math.abs(u)){let t=e.x;return u>0?t<=r?Ce(t,c,a)??a:Ce(t,a,o)??a:t<=r?Ce(t,s,c)??s:Ce(t,o,s)??s}{let t=e.y;return l>0?t<=i?Se(t,a,c)??c:Se(t,c,s)??c:t<=i?Se(t,a,o)??o:Se(t,o,s)??o}}function Se(e,t,n){let r=n.y-t.y;if(Math.abs(r)<.001)return null;let i=(e-t.y)/r;return i<0||i>1?null:{x:t.x+i*(n.x-t.x),y:e}}function Ce(e,t,n){let r=n.x-t.x;if(Math.abs(r)<.001)return null;let i=(e-t.x)/r;return i<0||i>1?null:{x:e,y:t.y+i*(n.y-t.y)}}function we(e,t,n){if(e.length===0)return;let r=n===`LR`||n===`RL`,i=new Set;for(let e of t)i.add(`${e.source}:${e.target}`),i.add(`${e.target}:${e.source}`);let a=L.layerSpacing*.6,o=[...e].sort((e,t)=>r?e.x-t.x:e.y-t.y),s=[],c=[o[0]];for(let e=1;e<o.length;e++){let t=(r?o[e].x:o[e].y)-(r?o[e-1].x:o[e-1].y),n=c.some(t=>i.has(`${t.id}:${o[e].id}`));t<=a&&!n?c.push(o[e]):(s.push(c),c=[o[e]])}s.push(c);let l=new Map;for(let e of s){if(e.length<=1)continue;let t=e.map(e=>r?e.x:e.y),n=Math.min(...t),i=Math.max(...t);if(i-n<=1)continue;let a=(n+i)/2;for(let t of e){let e=a-(r?t.x:t.y);Math.abs(e)>.5&&(r?t.x=a:t.y=a,l.set(t.id,e))}}if(l.size!==0)for(let e of t){if(e.points.length<2)continue;let t=l.get(e.source),n=l.get(e.target);if(t!=null){let n=e.points[0];r?(n.x+=t,e.points.length>1&&e.points[1].x===n.x-t&&(e.points[1].x+=t)):(n.y+=t,e.points.length>1&&e.points[1].y===n.y-t&&(e.points[1].y+=t))}if(n!=null){let t=e.points[e.points.length-1];if(r){if(t.x+=n,e.points.length>1){let r=e.points[e.points.length-2];r.x===t.x-n&&(r.x+=n)}}else if(t.y+=n,e.points.length>1){let r=e.points[e.points.length-2];r.y===t.y-n&&(r.y+=n)}}}}var Te=.5;function Ee(e,t,n){for(let r=0;r<e.length-1;r++){let i=e[r],a=e[r+1],o=Math.min(i.x,a.x),s=Math.max(i.x,a.x),c=Math.min(i.y,a.y),l=Math.max(i.y,a.y);for(let e of t){if(n.has(e.id))continue;let t=e.x+Te,r=e.x+e.width-Te,i=e.y+Te,a=e.y+e.height-Te;if(!(t>=r||i>=a)&&o<r&&s>t&&c<a&&l>i)return!1}}return!0}function De(e,t,n){let r=[];for(let i of n)e>=i.x&&e<=i.x+i.width&&t>=i.y&&t<=i.y+i.height&&(r.push(i),r.push(...De(e,t,i.children)));return r}function Oe(e,t,n,r,i){let a=i===`LR`,o=i===`RL`,s=i===`BT`,c=a||o,l=new Set(De(t,n,r).map(e=>e.id)),u=De(c?e:t,c?n:e,r).find(e=>!l.has(e.id));return u?a?u.x-12:o?u.x+u.width+12:s?u.y+u.height+12:u.y-12:e}function ke(e,t,n,r){let i=new Map(t.map(e=>[e.id,e])),a=new Set,o=r===`LR`,s=r===`RL`,c=r===`BT`,l=o||s,u=new Map;for(let t of e){if(t.source===t.target)continue;let e=u.get(t.source)??[];u.set(t.source,e),e.push(t)}for(let[e,d]of u){if(d.length<2)continue;let u=d[0].style;if(d.some(e=>e.label||e.style!==u))continue;let f=i.get(e);if(!f)continue;let p=[];for(let e of d){let t=i.get(e.target);t&&(o?t.x>f.x+f.width:s?t.x+t.width<f.x:c?t.y+t.height<f.y:t.y>f.y+f.height)&&p.push({edge:e,node:t})}if(p.length<2)continue;let m=f.x+f.width/2,h=f.y+f.height/2;if(l){let i=o?f.x+f.width:f.x,s=h,c=i+((o?Math.min(...p.map(e=>e.node.x)):Math.max(...p.map(e=>e.node.x+e.node.width)))-i)/2;c=Oe(c,m,h,n,r);let l=[];for(let{edge:n,node:r}of p){let a=o?r.x:r.x+r.width,u=r.y+r.height/2,d=[{x:i,y:s},{x:c,y:s},{x:c,y:u},{x:a,y:u}];Ee(d,t,new Set([e,r.id]))&&l.push({edge:n,points:d})}if(l.length<2)continue;for(let{edge:e,points:t}of l)e.points=t,a.add(e)}else{let i=m,o=c?f.y:f.y+f.height,s=o+((c?Math.max(...p.map(e=>e.node.y+e.node.height)):Math.min(...p.map(e=>e.node.y)))-o)/2;s=Oe(s,m,h,n,r);let l=[];for(let{edge:n,node:r}of p){let a=r.x+r.width/2,u=c?r.y+r.height:r.y,d=[{x:i,y:o},{x:i,y:s},{x:a,y:s},{x:a,y:u}];Ee(d,t,new Set([e,r.id]))&&l.push({edge:n,points:d})}if(l.length<2)continue;for(let{edge:e,points:t}of l)e.points=t,a.add(e)}}let d=new Map;for(let t of e){if(a.has(t)||t.source===t.target)continue;let e=d.get(t.target)??[];d.set(t.target,e),e.push(t)}for(let[e,a]of d){if(a.length<2)continue;let u=a[0].style;if(a.some(e=>e.label||e.style!==u))continue;let d=i.get(e);if(!d)continue;let f=[];for(let e of a){let t=i.get(e.source);t&&(o?t.x+t.width<d.x:s?t.x>d.x+d.width:c?t.y>d.y+d.height:t.y+t.height<d.y)&&f.push({edge:e,node:t})}if(f.length<2)continue;let p=d.x+d.width/2,m=d.y+d.height/2;if(l){let i=o?d.x:d.x+d.width,a=m,s=o?Math.max(...f.map(e=>e.node.x+e.node.width)):Math.min(...f.map(e=>e.node.x)),c=s+(i-s)/2;c=Oe(c,p,m,n,r);let l=[];for(let{edge:n,node:r}of f){let s=o?r.x+r.width:r.x,u=r.y+r.height/2,d=[{x:s,y:u},{x:c,y:u},{x:c,y:a},{x:i,y:a}];Ee(d,t,new Set([r.id,e]))&&l.push({edge:n,points:d})}if(l.length<2)continue;for(let{edge:e,points:t}of l)e.points=t}else{let i=p,a=c?d.y+d.height:d.y,o=c?Math.min(...f.map(e=>e.node.y)):Math.max(...f.map(e=>e.node.y+e.node.height)),s=o+(a-o)/2;s=Oe(s,p,m,n,r);let l=[];for(let{edge:n,node:r}of f){let o=r.x+r.width/2,u=[{x:o,y:c?r.y:r.y+r.height},{x:o,y:s},{x:i,y:s},{x:i,y:a}];Ee(u,t,new Set([r.id,e]))&&l.push({edge:n,points:u})}if(l.length<2)continue;for(let{edge:e,points:t}of l)e.points=t}}}function Ae(e,t=0,n=0){let r=[];if(!e.sections||e.sections.length===0)return r;let i=e.sections[0];if(r.push({x:i.startPoint.x+t,y:i.startPoint.y+n}),i.bendPoints)for(let e of i.bendPoints)r.push({x:e.x+t,y:e.y+n});return r.push({x:i.endPoint.x+t,y:i.endPoint.y+n}),r}function je(e,t=0,n=0){if(!e.labels||e.labels.length===0)return;let r=e.labels[0];if(r.x!=null&&r.y!=null)return{x:r.x+(r.width??0)/2+t,y:r.y+(r.height??0)/2+n}}var Me=16,Ne=28,Pe=18,Fe=28,Ie=10;function Le(e,t){let n=e.x+e.width,r=e.y+e.height/2,i=Math.min(Fe,e.height*.6)/2,a=Ne+t*Pe,o=[];for(let e=0;e<=Me;e++){let t=Math.PI*e/Me;o.push({x:n+a*Math.sin(t),y:r-i*Math.cos(t)})}return{points:o,labelPosition:{x:n+a+Ie,y:r}}}function Re(e,t,n){let r=new Map;for(let i=0;i<e.edges.length;i++){let a=e.edges[i];if(a.source!==a.target)continue;let o=t.get(a.source);if(!o)continue;let s=r.get(o.id)??0;r.set(o.id,s+1);let{points:c,labelPosition:l}=Le(o,s);n.push({source:a.source,target:a.target,label:a.label,style:a.style,hasArrowStart:a.hasArrowStart,hasArrowEnd:a.hasArrowEnd,points:c,labelPosition:a.label?l:void 0,inlineStyle:Xe(i,e),id:a.id,animate:a.animate})}}function ze(e){let t=[];for(let n of e)t.push({x:n.x,y:n.y,right:n.x+n.width,bottom:n.y+n.height}),t.push(...ze(n.children));return t}function Be(e,t,n=!1){let r=[],i=[],a=[],o=new Set;for(let e of t.subgraphs)Ye(e,o);Ve(e,t,o,r,a,0,0);let s=ze(a);We(e,t,i,0,0,s.length>0?{leftX:Math.min(...s.map(e=>e.x))-20,rightX:Math.max(...s.map(e=>e.right))+20}:void 0),we(r,i,t.direction);let c=new Map(r.map(e=>[e.id,e]));Re(t,c,i),n&&ke(i,r,a,t.direction);for(let e of i){let t=c.get(e.source),n=c.get(e.target);t&&(e.points=be(e.points,t,!0)),n&&(e.points=be(e.points,n,!1))}let l=e.width??800,u=e.height??600,d=I.width,f=L.padding;for(let e of i){for(let t of e.points)l=Math.max(l,t.x+d+f),u=Math.max(u,t.y+d+f);e.labelPosition&&(l=Math.max(l,e.labelPosition.x+60+f),u=Math.max(u,e.labelPosition.y+20+f))}return{width:l,height:u,nodes:r,edges:i,groups:a}}function Ve(e,t,n,r,i,a,o){if(e.children)for(let s of e.children){let e=(s.x??0)+a,c=(s.y??0)+o,u=s.width??0,d=s.height??0;if(n.has(s.id)){let a=[];Ve(s,t,n,r,a,e,c);let o=Je(t.subgraphs,s.id);i.push({id:s.id,label:o?.label??``,x:e,y:c,width:u,height:d,children:a})}else{let a=t.nodes.get(s.id);if(a){let n=(0,l.resolveNodeStyle)(s.id,t),i=t.classAssignments.get(s.id);r.push({id:s.id,label:a.label,shape:a.shape,x:e,y:c,width:u,height:d,inlineStyle:n,className:i,interaction:t.interactions.get(s.id)})}s.children&&s.children.length>0&&Ve(s,t,n,r,i,e,c)}}}function He(e){let t=/^e(\d+)$/.exec(e);if(t)return{edgeIndex:parseInt(t[1],10),role:`bridge`};let n=/^e(\d+)_([st])(\d+)$/.exec(e);if(n)return{edgeIndex:parseInt(n[1],10),role:n[2]===`s`?`source`:`target`,level:parseInt(n[3],10)}}function Ue(e){if(e.length===0)return{x:0,y:0};if(e.length===1)return e[0];let t=0;for(let n=1;n<e.length;n++){let r=e[n].x-e[n-1].x,i=e[n].y-e[n-1].y;t+=Math.sqrt(r*r+i*i)}let n=t/2;for(let t=1;t<e.length;t++){let r=e[t].x-e[t-1].x,i=e[t].y-e[t-1].y,a=Math.sqrt(r*r+i*i);if(n<=a){let o=n/a;return{x:e[t-1].x+o*r,y:e[t-1].y+o*i}}n-=a}return e[e.length-1]}function We(e,t,n,r,i,a){let o=new Map;Ge(e,o,0,0);let s=new Map;qe(e,s,0,0,o);let c=0;for(let[e,r]of s){let i=t.edges[e];if(!i)continue;let o=[],s=e=>{!e||e.points.length===0||(o.length>0?o.push(...e.points.slice(1)):o.push(...e.points))},l=[...r.sourceHops.keys()].sort((e,t)=>t-e);for(let e of l)s(r.sourceHops.get(e));s(r.bridge);let u=[...r.targetHops.keys()].sort((e,t)=>e-t);for(let e of u)s(r.targetHops.get(e));let d;i.label&&o.length>=2&&(d=r.bridge?.labelPosition??Ue(o));let f=Ke(o,a,c);f!==o&&c++,i.label&&f!==o&&f.length>=2&&(d=Ue(f)),n.push({source:i.source,target:i.target,label:i.label,style:i.style,hasArrowStart:i.hasArrowStart,hasArrowEnd:i.hasArrowEnd,points:f,labelPosition:d,inlineStyle:Xe(e,t),id:i.id,animate:i.animate})}}function Ge(e,t,n,r){t.set(e.id,{x:n,y:r});for(let i of e.children??[]){let e=i.x??0,a=i.y??0;Ge(i,t,n+e,r+a)}}function Ke(e,t,n=0){if(e.length<2)return e;let r=!1;for(let t=1;t<e.length;t++){let n=Math.abs(e[t].x-e[t-1].x),i=Math.abs(e[t].y-e[t-1].y);if(n>1&&i>1){r=!0;break}}if(!r)return e;let i=[e[0]];for(let r=1;r<e.length;r++){let a=i[i.length-1],o=e[r],s=Math.abs(o.x-a.x),c=Math.abs(o.y-a.y);if(s>1&&c>1){if(t){let e=n%2==0,r=Math.floor(n/2)*12,s=e?t.rightX+r:t.leftX-r;i.push({x:s,y:a.y}),i.push({x:s,y:o.y})}else{let e=(a.y+o.y)/2;i.push({x:a.x,y:e}),i.push({x:o.x,y:e})}}i.push(o)}return i}function qe(e,t,n,r,i){if(e.edges)for(let a of e.edges){let e=He(a.id);if(!e)continue;let{edgeIndex:o}=e,s=a.container,c=s?i.get(s):void 0,l=c?.x??n,u=c?.y??r,d=Ae(a,l,u),f=je(a,l,u),p=t.get(o)??{sourceHops:new Map,targetHops:new Map};t.set(o,p);let m={edgeIndex:o,points:d,labelPosition:f};e.role===`bridge`?p.bridge=m:e.role===`source`?p.sourceHops.set(e.level,m):p.targetHops.set(e.level,m)}if(e.children)for(let a of e.children)qe(a,t,n+(a.x??0),r+(a.y??0),i)}function Je(e,t){for(let n of e){if(n.id===t)return n;let e=Je(n.children,t);if(e)return e}}function Ye(e,t){t.add(e.id);for(let n of e.children)Ye(n,t)}function Xe(e,t){let n,r=t.linkStyles.get(`default`);r&&(n={...r});let i=t.linkStyles.get(e);return i&&(n=n?{...n,...i}:{...i}),n}function Ze(e,t={}){let n={...L,...t,fontSizes:A(t.fontSizes)};return Be(w(ge(e,n),t.layoutCache),e,n.mergeEdges)}function Qe(e,t={}){return ge(e,{...L,...t,fontSizes:A(t.fontSizes)})}function $e(e,t,n=`Inter`,r=!1,i=k,a=`linear`,o,s=!0,c=!0,u,d,f={}){let p=[],m=c&&e.nodes.some(e=>!!(0,l.safeHref)(e.interaction?.href));p.push(V((0,l.svgOpenTag)(e.width,e.height,t,r,u,d,m,f.styleAttribute),o)),p.push((0,l.buildStyleBlock)(n,!1,f.nonce)),s&&e.edges.some(e=>e.animate)&&p.push(et(f.nonce)),p.push(`<defs>`),p.push(tt());let h=new Set;for(let t of e.edges)t.inlineStyle?.stroke&&h.add(t.inlineStyle.stroke);for(let e of h)p.push(nt(e));p.push(`</defs>`);for(let t of e.groups)p.push(at(t,n,i));for(let t of e.edges)p.push(ot(t,a,s));for(let t of e.edges)t.label&&p.push(ct(t,n,i));for(let t of e.nodes)p.push(ft(t,n,i,c));return p.push(`</svg>`),p.join(`
|
|
2
|
+
`)}function et(e){return[(0,l.styleOpenTag)(e),` @keyframes zm-edge-dash { to { stroke-dashoffset: -28; } }`,` .edge-animated { animation: zm-edge-dash 1s linear infinite; }`,` @media (prefers-reduced-motion: reduce) {`,` .edge-animated { animation: none; }`,` }`,`</style>`].join(`
|
|
3
|
+
`)}function tt(){return rt(`var(--_arrow)`,``)}function nt(e){return rt((0,l.escapeAttr)(e),`-${it(e)}`)}function rt(e,t){let n=I.width,r=I.height,i=n-1,a=`fill="${e}" stroke="${e}" stroke-width="0.75" stroke-linejoin="round"`,o=`<polygon points="0 0, ${n} ${r/2}, 0 ${r}" ${a} />`,s=(e,t)=>` <marker id="${e}" markerWidth="${n}" markerHeight="${r}" refX="${i}" refY="${r/2}" orient="${t}">\n ${o}\n </marker>`;return s(`arrowhead${t}`,`auto`)+`
|
|
4
|
+
`+s(`arrowhead-start${t}`,`auto-start-reverse`)}function it(e){return e.replace(/[^a-zA-Z0-9]/g,e=>e.charCodeAt(0).toString(16))}function at(e,t,n){let r=n.groupHeader+16,i=[];i.push(`<g class="subgraph" data-id="${(0,l.escapeAttr)(e.id)}" data-label="${(0,l.escapeAttr)(e.label)}">`),i.push(` <rect x="${e.x}" y="${e.y}" width="${e.width}" height="${e.height}" rx="0" ry="0" fill="var(--_group-fill)" stroke="var(--_node-stroke)" stroke-width="${P.outerBox}" />`),i.push(` <rect x="${e.x}" y="${e.y}" width="${e.width}" height="${r}" rx="0" ry="0" fill="var(--_group-hdr)" stroke="var(--_node-stroke)" stroke-width="${P.outerBox}" />`),i.push(` `+(0,l.renderMultilineText)(e.label,e.x+12,e.y+r/2,n.groupHeader,`font-size="${n.groupHeader}" font-weight="${j.groupHeader}" fill="var(--_text-sec)"`));for(let r of e.children)i.push(at(r,t,n));return i.push(`</g>`),i.join(`
|
|
5
|
+
`)}function ot(e,t,n=!0){if(e.points.length<2)return``;let r=n&&(e.animate??!1),i=t!==`linear`,a=e.style===`invisible`,o=e.style===`dotted`?` stroke-dasharray="4 4"`:``,s=e.style===`thick`?P.connector*2:P.connector,c=a?`none`:(0,l.escapeAttr)(e.inlineStyle?.stroke??`var(--_line)`),u=(0,l.escapeAttr)(e.inlineStyle?.[`stroke-width`]??String(s)),d=e.inlineStyle?.stroke?`-${it(e.inlineStyle.stroke)}`:``,f=``;a||(e.hasArrowEnd&&(f+=` marker-end="url(#arrowhead${d})"`),e.hasArrowStart&&(f+=` marker-start="url(#arrowhead-start${d})"`));let p=[`class="edge${r?` edge-animated`:``}"`,`data-from="${(0,l.escapeAttr)(e.source)}"`,`data-to="${(0,l.escapeAttr)(e.target)}"`,`data-style="${e.style}"`,`data-arrow-start="${e.hasArrowStart}"`,`data-arrow-end="${e.hasArrowEnd}"`];e.label&&p.push(`data-label="${(0,l.escapeAttr)(e.label)}"`),e.id&&p.push(`data-id="${(0,l.escapeAttr)(e.id)}"`);let m=r&&!o?` stroke-dasharray="8 6"`:``,h=i?`d="${_(e.points,t)}"`:`points="${st(e.points)}"`;return`<${i?`path`:`polyline`} ${p.join(` `)} ${h} fill="none" stroke="${c}" stroke-width="${u}"${o}${m}${f} />`}function st(e){return e.map(e=>`${e.x},${e.y}`).join(` `)}function ct(e,t,n){if(!e.label)return``;let r=e.label,i=e.labelPosition??ut(e.points),a=(0,l.measureMultilineText)(r,n.edgeLabel,j.edgeLabel),o=(0,l.renderMultilineTextWithBackground)(r,i.x,i.y,a.width,a.height,n.edgeLabel,8,`text-anchor="middle" font-size="${n.edgeLabel}" font-weight="${j.edgeLabel}" fill="var(--_text-sec)"`,`rx="2" ry="2" fill="var(--bg)" stroke="var(--_inner-stroke)" stroke-width="1"`);return`<g class="edge-label" data-from="${(0,l.escapeAttr)(e.source)}" data-to="${(0,l.escapeAttr)(e.target)}" data-label="${(0,l.escapeAttr)(r)}">\n ${o.replace(/\n/g,`
|
|
6
|
+
`)}\n</g>`}function lt(e,t){let n=e[t];if(!n)throw Error(`edgeMidpoint: missing point at index ${t}`);return n}function ut(e){if(e.length===0)return{x:0,y:0};if(e.length===1)return e[0];let t=0;for(let n=1;n<e.length;n++)t+=dt(lt(e,n-1),lt(e,n));let n=t/2;for(let t=1;t<e.length;t++){let r=lt(e,t-1),i=lt(e,t),a=dt(r,i);if(n<=a){let e=n/a;return{x:r.x+e*(i.x-r.x),y:r.y+e*(i.y-r.y)}}n-=a}return e[e.length-1]}function dt(e,t){return Math.sqrt((t.x-e.x)**2+(t.y-e.y)**2)}function ft(e,t,n,r=!0){let i=pt(e),a=qt(e,t,n),o=[],s=(0,l.sanitizeClassName)(e.className),c=s?`node ${s}`:`node`,u=e.interaction,d=[`class="${c}"`,`data-id="${(0,l.escapeAttr)(e.id)}"`,`data-label="${(0,l.escapeAttr)(e.label)}"`,`data-shape="${e.shape}"`];o.push(`<g ${d.join(` `)}>`);let f=r?(0,l.safeHref)(u?.href):void 0,p=f?` `:` `;if(f){let e=u?.target?` target="${(0,l.escapeAttr)(u.target)}"`:``;o.push(` <a href="${(0,l.escapeAttr)(f)}"${e}>`)}return r&&u?.tooltip&&o.push(`${p}<title>${(0,l.escapeXml)(u.tooltip)}</title>`),o.push(`${p}${i.replace(/\n/g,`\n${p}`)}`),a&&o.push(`${p}${a.replace(/\n/g,`\n${p}`)}`),f&&o.push(` </a>`),o.push(`</g>`),o.join(`
|
|
7
|
+
`)}function pt(e){let{x:t,y:n,width:r,height:i,shape:a,inlineStyle:o}=e,s=(0,l.escapeAttr)(o?.fill??`var(--_node-fill)`),c=(0,l.escapeAttr)(o?.stroke??`var(--_node-stroke)`),u=(0,l.escapeAttr)(o?.[`stroke-width`]??String(P.innerBox));switch(a){case`diamond`:return vt(t,n,r,i,s,c,u);case`rounded`:return ht(t,n,r,i,s,c,u);case`stadium`:return gt(t,n,r,i,s,c,u);case`circle`:return _t(t,n,r,i,s,c,u);case`subroutine`:return yt(t,n,r,i,s,c,u);case`doublecircle`:return bt(t,n,r,i,s,c,u);case`hexagon`:return xt(t,n,r,i,s,c,u);case`cylinder`:return St(t,n,r,i,s,c,u);case`asymmetric`:return Ct(t,n,r,i,s,c,u);case`trapezoid`:return wt(t,n,r,i,s,c,u);case`trapezoid-alt`:return Tt(t,n,r,i,s,c,u);case`parallelogram`:return Et(t,n,r,i,s,c,u);case`parallelogram-alt`:return Dt(t,n,r,i,s,c,u);case`state-start`:return Gt(t,n,r,i);case`state-end`:return Kt(t,n,r,i);case`document`:return Ot(t,n,r,i,s,c,u);case`stacked-document`:return kt(t,n,r,i,s,c,u,!0);case`stacked-process`:return kt(t,n,r,i,s,c,u,!1);case`card`:return At(t,n,r,i,s,c,u);case`lined-process`:return jt(t,n,r,i,s,c,u);case`divided-process`:return Mt(t,n,r,i,s,c,u);case`window-pane`:return Nt(t,n,r,i,s,c,u);case`triangle`:return Pt(t,n,r,i,s,c,u,!1);case`flipped-triangle`:return Pt(t,n,r,i,s,c,u,!0);case`filled-circle`:return Ft(t,n,r,i,c);case`crossed-circle`:return It(t,n,r,i,s,c,u);case`fork-join`:return Lt(t,n,r,i,c);case`notched-pentagon`:return Rt(t,n,r,i,s,c,u);case`sloped-rectangle`:return zt(t,n,r,i,s,c,u);case`flag`:return Bt(t,n,r,i,s,c,u);case`bow-tie-rectangle`:return Vt(t,n,r,i,s,c,u);case`half-rounded-rectangle`:return Ht(t,n,r,i,s,c,u);case`brace`:return Ut(t,n,r,i,s,c,u,`left`);case`brace-right`:return Ut(t,n,r,i,s,c,u,`right`);case`braces`:return Ut(t,n,r,i,s,c,u,`both`);case`bolt`:return Wt(t,n,r,i,s,c,u);case`text`:case`anchor`:return``;default:return mt(t,n,r,i,s,c,u)}}function mt(e,t,n,r,i,a,o){return`<rect x="${e}" y="${t}" width="${n}" height="${r}" rx="0" ry="0" fill="${i}" stroke="${a}" stroke-width="${o}" />`}function ht(e,t,n,r,i,a,o){return`<rect x="${e}" y="${t}" width="${n}" height="${r}" rx="6" ry="6" fill="${i}" stroke="${a}" stroke-width="${o}" />`}function gt(e,t,n,r,i,a,o){let s=r/2;return`<rect x="${e}" y="${t}" width="${n}" height="${r}" rx="${s}" ry="${s}" fill="${i}" stroke="${a}" stroke-width="${o}" />`}function _t(e,t,n,r,i,a,o){return`<circle cx="${e+n/2}" cy="${t+r/2}" r="${Math.min(n,r)/2}" fill="${i}" stroke="${a}" stroke-width="${o}" />`}function vt(e,t,n,r,i,a,o){let s=e+n/2,c=t+r/2,l=n/2,u=r/2;return`<polygon points="${[`${s},${c-u}`,`${s+l},${c}`,`${s},${c+u}`,`${s-l},${c}`].join(` `)}" fill="${i}" stroke="${a}" stroke-width="${o}" />`}function yt(e,t,n,r,i,a,o){return`<rect x="${e}" y="${t}" width="${n}" height="${r}" rx="0" ry="0" fill="${i}" stroke="${a}" stroke-width="${o}" />\n<line x1="${e+8}" y1="${t}" x2="${e+8}" y2="${t+r}" stroke="${a}" stroke-width="${o}" />\n<line x1="${e+n-8}" y1="${t}" x2="${e+n-8}" y2="${t+r}" stroke="${a}" stroke-width="${o}" />`}function bt(e,t,n,r,i,a,o){let s=e+n/2,c=t+r/2,l=Math.min(n,r)/2;return`<circle cx="${s}" cy="${c}" r="${l}" fill="${i}" stroke="${a}" stroke-width="${o}" />\n<circle cx="${s}" cy="${c}" r="${l-5}" fill="${i}" stroke="${a}" stroke-width="${o}" />`}function xt(e,t,n,r,i,a,o){let s=r/4;return`<polygon points="${[`${e+s},${t}`,`${e+n-s},${t}`,`${e+n},${t+r/2}`,`${e+n-s},${t+r}`,`${e+s},${t+r}`,`${e},${t+r/2}`].join(` `)}" fill="${i}" stroke="${a}" stroke-width="${o}" />`}function St(e,t,n,r,i,a,o){let s=e+n/2,c=t+7,l=r-14;return`<rect x="${e}" y="${c}" width="${n}" height="${l}" fill="${i}" stroke="none" />\n<line x1="${e}" y1="${c}" x2="${e}" y2="${c+l}" stroke="${a}" stroke-width="${o}" />\n<line x1="${e+n}" y1="${c}" x2="${e+n}" y2="${c+l}" stroke="${a}" stroke-width="${o}" />\n<ellipse cx="${s}" cy="${t+r-7}" rx="${n/2}" ry="7" fill="${i}" stroke="${a}" stroke-width="${o}" />\n<ellipse cx="${s}" cy="${c}" rx="${n/2}" ry="7" fill="${i}" stroke="${a}" stroke-width="${o}" />`}function Ct(e,t,n,r,i,a,o){return`<polygon points="${[`${e+12},${t}`,`${e+n},${t}`,`${e+n},${t+r}`,`${e+12},${t+r}`,`${e},${t+r/2}`].join(` `)}" fill="${i}" stroke="${a}" stroke-width="${o}" />`}function wt(e,t,n,r,i,a,o){let s=n*.15;return`<polygon points="${[`${e+s},${t}`,`${e+n-s},${t}`,`${e+n},${t+r}`,`${e},${t+r}`].join(` `)}" fill="${i}" stroke="${a}" stroke-width="${o}" />`}function Tt(e,t,n,r,i,a,o){let s=n*.15;return`<polygon points="${[`${e},${t}`,`${e+n},${t}`,`${e+n-s},${t+r}`,`${e+s},${t+r}`].join(` `)}" fill="${i}" stroke="${a}" stroke-width="${o}" />`}function Et(e,t,n,r,i,a,o){let s=n*.15;return`<polygon points="${[`${e+s},${t}`,`${e+n},${t}`,`${e+n-s},${t+r}`,`${e},${t+r}`].join(` `)}" fill="${i}" stroke="${a}" stroke-width="${o}" />`}function Dt(e,t,n,r,i,a,o){let s=n*.15;return`<polygon points="${[`${e},${t}`,`${e+n-s},${t}`,`${e+n},${t+r}`,`${e+s},${t+r}`].join(` `)}" fill="${i}" stroke="${a}" stroke-width="${o}" />`}function B(e,t,n){return`fill="${e}" stroke="${t}" stroke-width="${n}"`}function Ot(e,t,n,r,i,a,o){let s=Math.min(10,r*.16),c=t+r-s;return`<path d="${`M ${e} ${t} L ${e+n} ${t} L ${e+n} ${c} C ${e+n*.75} ${c+s*1.8} ${e+n*.25} ${c-s*.8} ${e} ${c} Z`}" ${B(i,a,o)} />`}function kt(e,t,n,r,i,a,o,s){let c=n-10,l=r-10,u=[];for(let n=2;n>=1;n--)u.push(`<rect x="${e+5*n}" y="${t+5*(2-n)}" width="${c}" height="${l}" ${B(i,a,o)} />`);return u.push(s?Ot(e,t+10,c,l,i,a,o):`<rect x="${e}" y="${t+10}" width="${c}" height="${l}" ${B(i,a,o)} />`),u.join(`
|
|
8
|
+
`)}function At(e,t,n,r,i,a,o){let s=Math.min(14,n*.12,r*.3);return`<polygon points="${[`${e+s},${t}`,`${e+n},${t}`,`${e+n},${t+r}`,`${e},${t+r}`,`${e},${t+s}`].join(` `)}" ${B(i,a,o)} />`}function jt(e,t,n,r,i,a,o){let s=Math.min(12,n*.12);return`<rect x="${e}" y="${t}" width="${n}" height="${r}" ${B(i,a,o)} />\n<line x1="${e+s}" y1="${t}" x2="${e+s}" y2="${t+r}" stroke="${a}" stroke-width="${o}" />`}function Mt(e,t,n,r,i,a,o){let s=t+Math.min(16,r*.3);return`<rect x="${e}" y="${t}" width="${n}" height="${r}" ${B(i,a,o)} />\n<line x1="${e}" y1="${s}" x2="${e+n}" y2="${s}" stroke="${a}" stroke-width="${o}" />`}function Nt(e,t,n,r,i,a,o){let s=e+Math.min(16,n*.16),c=t+Math.min(14,r*.28);return`<rect x="${e}" y="${t}" width="${n}" height="${r}" ${B(i,a,o)} />\n<line x1="${s}" y1="${t}" x2="${s}" y2="${t+r}" stroke="${a}" stroke-width="${o}" />\n<line x1="${e}" y1="${c}" x2="${e+n}" y2="${c}" stroke="${a}" stroke-width="${o}" />`}function Pt(e,t,n,r,i,a,o,s){return`<polygon points="${(s?[`${e},${t}`,`${e+n},${t}`,`${e+n/2},${t+r}`]:[`${e+n/2},${t}`,`${e+n},${t+r}`,`${e},${t+r}`]).join(` `)}" ${B(i,a,o)} />`}function Ft(e,t,n,r,i){let a=Math.min(n,r)/2-2;return`<circle cx="${e+n/2}" cy="${t+r/2}" r="${a}" fill="${i}" stroke="${i}" />`}function It(e,t,n,r,i,a,o){let s=e+n/2,c=t+r/2,l=Math.min(n,r)/2-2,u=l/Math.SQRT2;return`<circle cx="${s}" cy="${c}" r="${l}" ${B(i,a,o)} />\n<line x1="${s-u}" y1="${c-u}" x2="${s+u}" y2="${c+u}" stroke="${a}" stroke-width="${o}" />\n<line x1="${s+u}" y1="${c-u}" x2="${s-u}" y2="${c+u}" stroke="${a}" stroke-width="${o}" />`}function Lt(e,t,n,r,i){let a=Math.min(8,r);return`<rect x="${e}" y="${t+(r-a)/2}" width="${n}" height="${a}" fill="${i}" stroke="${i}" />`}function Rt(e,t,n,r,i,a,o){let s=Math.min(14,n*.12,r*.3);return`<polygon points="${[`${e+s},${t}`,`${e+n-s},${t}`,`${e+n},${t+s}`,`${e+n},${t+r}`,`${e},${t+r}`,`${e},${t+s}`].join(` `)}" ${B(i,a,o)} />`}function zt(e,t,n,r,i,a,o){return`<polygon points="${[`${e},${t+Math.min(12,r*.3)}`,`${e+n},${t}`,`${e+n},${t+r}`,`${e},${t+r}`].join(` `)}" ${B(i,a,o)} />`}function Bt(e,t,n,r,i,a,o){let s=Math.min(8,r*.14);return`<path d="${`M ${e} ${t+s} C ${e+n*.25} ${t-s} ${e+n*.75} ${t+s*2} ${e+n} ${t+s} L ${e+n} ${t+r-s} C ${e+n*.75} ${t+r+s} ${e+n*.25} ${t+r-s*2} ${e} ${t+r-s} Z`}" ${B(i,a,o)} />`}function Vt(e,t,n,r,i,a,o){let s=Math.min(14,n*.12);return`<path d="${`M ${e+s} ${t} L ${e+n} ${t} Q ${e+n-s*1.4} ${t+r/2} ${e+n} ${t+r} L ${e+s} ${t+r} Q ${e+s*1.4} ${t+r/2} ${e+s} ${t} Z`}" ${B(i,a,o)} />`}function Ht(e,t,n,r,i,a,o){let s=r/2,c=Math.max(0,n-s);return`<path d="${`M ${e} ${t} L ${e+c} ${t} A ${s} ${s} 0 0 1 ${e+c} ${t+r} L ${e} ${t+r} Z`}" ${B(i,a,o)} />`}function Ut(e,t,n,r,i,a,o,s){let c=Math.min(10,n*.12),l=[`<rect x="${e}" y="${t}" width="${n}" height="${r}" fill="none" stroke="none" />`],u=`M ${e+c} ${t} Q ${e} ${t} ${e} ${t+r*.25} Q ${e} ${t+r/2} ${e-c*.4} ${t+r/2} Q ${e} ${t+r/2} ${e} ${t+r*.75} Q ${e} ${t+r} ${e+c} ${t+r}`,d=`M ${e+n-c} ${t} Q ${e+n} ${t} ${e+n} ${t+r*.25} Q ${e+n} ${t+r/2} ${e+n+c*.4} ${t+r/2} Q ${e+n} ${t+r/2} ${e+n} ${t+r*.75} Q ${e+n} ${t+r} ${e+n-c} ${t+r}`;return(s===`left`||s===`both`)&&l.push(`<path d="${u}" fill="none" stroke="${a}" stroke-width="${o}" />`),(s===`right`||s===`both`)&&l.push(`<path d="${d}" fill="none" stroke="${a}" stroke-width="${o}" />`),l.join(`
|
|
9
|
+
`)}function Wt(e,t,n,r,i,a,o){return`<polygon points="${[`${e+n*.42},${t}`,`${e+n},${t}`,`${e+n*.62},${t+r*.42}`,`${e+n},${t+r*.42}`,`${e+n*.3},${t+r}`,`${e+n*.5},${t+r*.55}`,`${e},${t+r*.55}`].join(` `)}" ${B(i,a,o)} />`}function Gt(e,t,n,r){return`<circle cx="${e+n/2}" cy="${t+r/2}" r="${Math.min(n,r)/2-2}" fill="var(--_text)" stroke="none" />`}function Kt(e,t,n,r){let i=e+n/2,a=t+r/2,o=Math.min(n,r)/2-2,s=o-4;return`<circle cx="${i}" cy="${a}" r="${o}" fill="none" stroke="var(--_text)" stroke-width="${P.innerBox*2}" />\n<circle cx="${i}" cy="${a}" r="${s}" fill="var(--_text)" stroke="none" />`}function qt(e,t,n){if((e.shape===`state-start`||e.shape===`state-end`)&&!e.label)return``;let r=e.x+e.width/2,i=e.y+e.height/2,a=(0,l.escapeAttr)(e.inlineStyle?.color??(0,l.getReadableTextColor)(e.inlineStyle?.fill,`var(--_text)`)),o=`text-anchor="middle" font-size="${n.nodeLabel}" font-weight="${j.nodeLabel}" fill="${a}"`,s=e.inlineStyle?.[`font-family`];return s&&(o+=` style="font-family: ${(0,l.escapeAttr)(s)};"`),(0,l.renderMultilineText)(e.label,r,i,n.nodeLabel,o)}function Jt(e){return(0,l.escapeAttr)(e).replace(/\r/g,` `).replace(/\n/g,` `).replace(/\t/g,`	`)}function V(e,t){return t===void 0?e:e.replace(`<svg `,`<svg data-src="${Jt(t)}" `)}var Yt=class{raw=new Map;resolved=new Map;inProgress=new Set;declare(e,t){this.raw.set(e,t),this.resolved.delete(e)}lookup(e){if(this.resolved.has(e))return this.resolved.get(e);let t=this.raw.get(e);if(t===void 0||this.inProgress.has(e))return;this.inProgress.add(e);let n=H(t,this).trim();this.inProgress.delete(e);let r=!/\bvar\(|\bcolor-mix\(/.test(n);return this.resolved.set(e,r?n:void 0),r?n:void 0}};function Xt(e,t){let n=0;for(let r=t;r<e.length;r++){let t=e[r];if(t===`(`)n++;else if(t===`)`&&(n--,n===0))return r}return-1}function Zt(e){let t=[],n=0,r=0;for(let i=0;i<e.length;i++){let a=e[i];a===`(`?n++:a===`)`?n--:a===`,`&&n===0&&(t.push(e.slice(r,i)),r=i+1)}return t.push(e.slice(r)),t}var Qt=`(?<![\\w-])(var|color-mix)\\(`;function $t(e,t){let[n,...r]=Zt(e),i=(n??``).trim(),a=t.lookup(i);return a===void 0?r.length>0?r.join(`,`).trim():null:a}function en(e){let t=e.trim().split(/\s+/),n,r;for(let e of t)if(/^[\d.]+%$/.test(e)){if(r!==void 0)return null;r=Number(e.slice(0,-1))}else{if(n!==void 0)return null;n=e}return n===void 0?null:{color:n,pct:r}}function tn(e){let t=Zt(e);if(t.length!==3)return null;let[n,r,i]=t;if(n===void 0||r===void 0||i===void 0||!/^\s*in\s+srgb\s*$/i.test(n))return null;let a=en(r),o=en(i);if(!a||!o)return null;let s=(0,l.parseCssColor)(a.color),c=(0,l.parseCssColor)(o.color);if(!s||!c)return null;let u=(0,l.mixSrgb)(s,c,a.pct,o.pct);return u?(0,l.formatCssColor)(u):null}function H(e,t){let n=``,r=0,i=new RegExp(Qt,`g`),a;for(;(a=i.exec(e))!==null;){let o=a[1];if(o===void 0)continue;let s=a.index,c=s+o.length,l=Xt(e,c);if(l===-1)break;let u=H(e.slice(c+1,l),t),d=o===`var`?$t(u,t):tn(u);n+=e.slice(r,s),n+=d??`${o}(${u})`,r=l+1,i.lastIndex=r}return n+e.slice(r)}function nn(e,t){let n=new Yt;for(let[e,r]of Object.entries(t))n.declare(e,r);return H(e,n)}var rn=/(--[\w-]+)\s*:\s*([^;{}]+)/g,an=/(\s)([\w:.-]+)(=)("[^"]*"|'[^']*')/g,on=new Set([`data-src`]);function sn(e,t){rn.lastIndex=0;let n;for(;(n=rn.exec(e))!==null;){let[,e,r]=n;e!==void 0&&r!==void 0&&t.declare(e,r.trim())}}function cn(e,t){return e.replace(an,(e,n,r,i,a)=>{if(on.has(r))return e;let o=a[0]??`"`;return`${n}${r}${i}${o}${H(a.slice(1,-1),t)}${o}`})}function ln(e,t){let n=new Yt;n.declare(`--bg`,t.bg),n.declare(`--fg`,t.fg),t.line&&n.declare(`--line`,t.line),t.accent&&n.declare(`--accent`,t.accent),t.muted&&n.declare(`--muted`,t.muted),t.surface&&n.declare(`--surface`,t.surface),t.border&&n.declare(`--border`,t.border);for(let t of e.matchAll(/<style[^>]*>([\s\S]*?)<\/style>/g)){let e=t[1];e!==void 0&&sn(e,n)}for(let t of e.matchAll(/\sstyle=("[^"]*"|'[^']*')/g)){let e=t[1];e!==void 0&&sn(e.slice(1,-1),n)}let r=``,i=0;for(;i<e.length;){let t=e.indexOf(`<`,i);if(t===-1)break;if(r+=e.slice(i,t),e.startsWith(`<style`,t)){let a=e.indexOf(`>`,t),o=e.indexOf(`</style>`,t);if(a===-1||o===-1)break;r+=e.slice(t,a+1),r+=H(e.slice(a+1,o),n),r+=`</style>`,i=o+8;continue}let a=-1,o=null;for(let n=t+1;n<e.length;n++){let t=e[n];if(o!==null)t===o&&(o=null);else if(t===`"`||t===`'`)o=t;else if(t===`>`){a=n;break}}if(a===-1)break;let s=e.slice(t,a+1);r+=s.startsWith(`<!`)||s.startsWith(`<?`)||s.startsWith(`</`)?s:cn(s,n),i=a+1}return r+e.slice(i)}var U={padding:40,boxPadX:8,headerBaseHeight:32,annotationHeight:16,memberRowHeight:20,sectionPadY:8,emptySectionHeight:8,minWidth:120,memberFontSize:11,memberFontWeight:400,nodeSpacing:40,layerSpacing:60,notePadX:10,notePadY:6};function un(e){return`note ${e}`}function dn(e){return`${e} link`}function fn(e,t){let n=new Map,r=new Map,i=A(t.fontSizes);for(let t of e.classes){let e=t.annotation?U.headerBaseHeight+U.annotationHeight:U.headerBaseHeight,r=t.attributes.length>0?t.attributes.length*U.memberRowHeight+U.sectionPadY:U.emptySectionHeight,a=t.methods.length>0?t.methods.length*U.memberRowHeight+U.sectionPadY:U.emptySectionHeight,o=T(t.label,i.nodeLabel,j.nodeLabel),s=hn(t.attributes),c=hn(t.methods),l=Math.max(U.minWidth,o+U.boxPadX*2,s+U.boxPadX*2,c+U.boxPadX*2),u=e+r+a;n.set(t.id,{width:l,height:u,headerHeight:e,attrHeight:r,methodHeight:a})}let a=[];for(let[e,t]of n)a.push(R(e,t));let o={fontSize:i.edgeLabel},s=[];for(let[t,n]of e.relationships.entries())s.push(z({id:`e${t}`,source:n.from,target:n.to,label:n.label,labelStyle:o}));let c=new Set(n.keys());for(let[t,n]of e.notes.entries()){let e=un(t),u=(0,l.measureMultilineText)(n.text,i.edgeLabel,j.edgeLabel),d={width:u.width+U.notePadX*2,height:u.height+U.notePadY*2};r.set(e,d),a.push(R(e,d)),n.forClass!==void 0&&c.has(n.forClass)&&s.push(z({id:dn(e),source:e,target:n.forClass,labelStyle:o}))}return{elkGraph:{id:`root`,layoutOptions:{...re({direction:te(void 0,ee.class),nodeSpacing:U.nodeSpacing,layerSpacing:U.layerSpacing,padding:U.padding}),"elk.edgeLabels.placement":`CENTER`},children:a,edges:s},classSizes:n,noteSizes:r}}function pn(e,t,n,r){let i=new Map;for(let e of t.classes)i.set(e.id,e);let a=[];for(let r of e.children??[]){let e=i.get(r.id);if(e){let i=n.get(e.id);if(!i)throw Error(`Missing computed size for class "${e.id}"`);a.push({id:e.id,label:e.label,annotation:e.annotation,attributes:e.attributes,methods:e.methods,x:r.x??0,y:r.y??0,width:r.width??i.width,height:r.height??i.height,headerHeight:i.headerHeight,attrHeight:i.attrHeight,methodHeight:i.methodHeight,interaction:t.interactions.get(e.id),inlineStyle:(0,l.resolveNodeStyle)(e.id,t),className:t.classAssignments.get(e.id)})}}let o=[],s=e.edges??[];for(let[e,n]of t.relationships.entries()){let t=s[e];if(!t)throw Error(`Missing ELK edge for relationship ${e}`);let r=Ae(t),i=je(t);o.push({from:n.from,to:n.to,type:n.type,markerAt:n.markerAt,label:n.label,fromCardinality:n.fromCardinality,toCardinality:n.toCardinality,points:r,labelPosition:i})}let c=new Map;for(let e of s.slice(t.relationships.length))c.set(e.id,e);let u=new Map;for(let t of e.children??[])u.set(t.id,t);let d=[];for(let[e,n]of t.notes.entries()){let t=un(e),i=u.get(t),a=r.get(t);if(!i||!a)throw Error(`Missing layout for note ${e}`);let o=c.get(dn(t));d.push({id:t,text:n.text,...o&&n.forClass!==void 0?{forClass:n.forClass}:{},x:i.x??0,y:i.y??0,width:i.width??a.width,height:i.height??a.height,...o?{linkPoints:Ae(o)}:{}})}return{width:e.width??600,height:e.height??400,classes:a,relationships:o,notes:d}}function mn(e,t={}){if(e.classes.length===0&&e.notes.length===0)return{width:0,height:0,classes:[],relationships:[],notes:[]};let{elkGraph:n,classSizes:r,noteSizes:i}=fn(e,t);return pn(w(n,t.layoutCache),e,r,i)}function hn(e){if(e.length===0)return 0;let t=0;for(let n of e){let e=E((0,u.formatClassMember)(n),U.memberFontSize);e>t&&(t=e)}return t}var gn={memberSize:11,memberWeight:400,annotationSize:10,annotationWeight:500};function _n(e,t,n=`Inter`,r=!1,i=k,a,o,s,c=!0,u={}){let d=[],f=c&&e.classes.some(e=>!!(0,l.safeHref)(e.interaction?.href));d.push(V((0,l.svgOpenTag)(e.width,e.height,t,r,o,s,f,u.styleAttribute),a)),d.push((0,l.buildStyleBlock)(n,!0,u.nonce)),d.push(`<defs>`),d.push(vn()),d.push(`</defs>`);for(let t of e.relationships)d.push(Cn(t));for(let t of e.notes)d.push(Sn(t));for(let t of e.classes)d.push(yn(t,i,c));for(let t of e.notes)d.push(xn(t,i));for(let t of e.relationships)d.push(En(t,i));return d.push(`</svg>`),d.join(`
|
|
10
|
+
`)}function vn(){return` <marker id="cls-inherit" markerWidth="12" markerHeight="10" refX="12" refY="5" orient="auto-start-reverse">
|
|
11
11
|
<polygon points="0 0, 12 5, 0 10" fill="var(--bg)" stroke="var(--_arrow)" stroke-width="1.5" />
|
|
12
12
|
</marker>
|
|
13
13
|
<marker id="cls-composition" markerWidth="12" markerHeight="10" refX="0" refY="5" orient="auto-start-reverse">
|
|
@@ -18,23 +18,23 @@ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});var e=Object.
|
|
|
18
18
|
</marker>
|
|
19
19
|
<marker id="cls-arrow" markerWidth="8" markerHeight="6" refX="8" refY="3" orient="auto-start-reverse">
|
|
20
20
|
<polyline points="0 0, 8 3, 0 6" fill="none" stroke="var(--_arrow)" stroke-width="1.5" />
|
|
21
|
-
</marker>`}function
|
|
22
|
-
`)}function
|
|
23
|
-
`)}function
|
|
24
|
-
`)}function
|
|
25
|
-
`))}return d.length===0&&f.push(` <text x="${r+a/2}" y="${p+c/2}" text-anchor="middle" dy="${
|
|
26
|
-
`)}function
|
|
27
|
-
`);i.push(`<g><title>${
|
|
28
|
-
`)}function
|
|
29
|
-
`)}function
|
|
30
|
-
`)}function
|
|
31
|
-
`)}function
|
|
32
|
-
`)}function
|
|
33
|
-
`)}function
|
|
34
|
-
`)}function
|
|
35
|
-
`)[0],o=
|
|
36
|
-
`)}function $n(e,t){let{x:n,y:r,width:i,height:a}=e,o=e.actors&&e.actors.length>0?` data-actors="${e.actors.map(l.escapeAttr).join(`,`)}"`:``;return`<g class="note"${e.position?` data-position="${(0,l.escapeAttr)(e.position)}"`:``}${o}>\n <polygon points="${[`${n},${r}`,`${n+i-6},${r}`,`${n+i},${r+6}`,`${n+i},${r+a}`,`${n},${r+a}`].join(` `)}" fill="var(--bg)" stroke="var(--_node-stroke)" stroke-width="${N.innerBox}" />\n <polygon points="${n+i-6},${r} ${n+i},${r+6} ${n+i-6},${r+6}" fill="var(--_inner-stroke)" stroke="var(--_node-stroke)" stroke-width="${N.innerBox}" />\n ${(0,l.renderMultilineText)(e.text,n+i/2,r+a/2,t.edgeLabel,`font-size="${t.edgeLabel}" text-anchor="middle" font-weight="${A.edgeLabel}" fill="var(--_text-muted)"`)}\n</g>`}var Y={plotWidth:600,plotHeight:340,padding:22,titleFontSize:18,titleFontWeight:600,titleHeight:42,axisLabelFontSize:14,axisLabelFontWeight:400,axisTitleFontSize:15,axisTitleFontWeight:500,xLabelHeight:38,yLabelWidth:58,yLabelGap:18,axisTitlePad:30,tickLength:4,barPadRatio:.2,barGroupGap:0,maxBarWidth:40,legendFontSize:14,legendFontWeight:400,legendHeight:28,legendSwatchW:14,legendSwatchH:14,legendGap:6,legendItemGap:16};function er(e,t={}){return e.horizontal?nr(e):tr(e)}function tr(e){let t=!!e.title,n=!!e.xAxis.title,r=!!e.yAxis.title,i=e.series.length>1,a=e.yAxis.range;if(!a)throw Error(`XY chart: y-axis range was not set by the parser`);let o=cr(a.min,a.max),s=Math.max(...o.map(e=>w(lr(e),Y.axisLabelFontSize,Y.axisLabelFontWeight)),Y.yLabelWidth),c=Y.padding+(t?Y.titleHeight:0)+(i?Y.legendHeight:0),l=Y.padding+Y.xLabelHeight+(n?Y.axisTitlePad:0),u=Y.padding+s+Y.yLabelGap+(r?Y.axisTitlePad:0),d=Y.padding,f=Y.plotWidth,p=Y.plotHeight,m=u+f+d,h=c+p+l,g={x:u,y:c,width:f,height:p},_=rr(e),v=e=>u+(e+.5)*(f/_),y=f/_,b=e=>{let t=(e-a.min)/(a.max-a.min||1);return c+p-t*p},x=ar(e,v,c+p,y),S=o.map(e=>({label:lr(e),x:u,y:b(e),tx:u-Y.tickLength,ty:b(e),labelX:u-Y.yLabelGap,labelY:b(e),textAnchor:`end`})),C=o.map(e=>({x1:u,y1:b(e),x2:u+f,y2:b(e)})),T=ir(e,_),E=e.series.map((e,t)=>t),D=or(e,v,b,y,a.min,T,E),O=sr(e,v,b,T,E),k=Y.padding+(t?Y.titleHeight:0)+Y.legendHeight/2,A=i?ur(e,m/2,k,E):[],j={x1:u,y1:c+p,x2:u+f,y2:c+p},M={x1:u,y1:c,x2:u,y2:c+p},N={ticks:x,line:j,...e.xAxis.title?{title:{text:e.xAxis.title,x:u+f/2,y:h-Y.padding}}:{}},P={ticks:S,line:M,...e.yAxis.title?{title:{text:e.yAxis.title,x:Y.padding+4,y:c+p/2,rotate:-90}}:{}};return{width:m,height:h,title:e.title?{text:e.title,x:m/2,y:Y.padding+Y.titleFontSize}:void 0,xAxis:N,yAxis:P,plotArea:g,bars:D,lines:O,gridLines:C,legend:A}}function nr(e){let t=!!e.title,n=!!e.xAxis.title,r=!!e.yAxis.title,i=e.series.length>1,a=e.yAxis.range;if(!a)throw Error(`XY chart: y-axis range was not set by the parser`);let o=cr(a.min,a.max),s=rr(e),c=ir(e,s),l=Math.max(...c.map(e=>w(e,Y.axisLabelFontSize,Y.axisLabelFontWeight)),40),u=Y.padding+(t?Y.titleHeight:0)+(i?Y.legendHeight:0),d=Y.padding+Y.xLabelHeight+(r?Y.axisTitlePad:0),f=Y.padding+l+Y.yLabelGap+(n?Y.axisTitlePad:0),p=Y.padding,m=Y.plotWidth,h=Y.plotHeight,g=f+m+p,_=u+h+d,v={x:f,y:u,width:m,height:h},y=e=>{let t=(e-a.min)/(a.max-a.min||1);return f+t*m},b=h/s,x=e=>u+(e+.5)*b,S=o.map(e=>({label:lr(e),x:y(e),y:u+h,tx:y(e),ty:u+h+Y.tickLength,labelX:y(e),labelY:u+h+18,textAnchor:`middle`})),C=c.map((e,t)=>({label:e,x:f,y:x(t),tx:f-Y.tickLength,ty:x(t),labelX:f-Y.yLabelGap,labelY:x(t),textAnchor:`end`})),T=o.map(e=>({x1:y(e),y1:u,x2:y(e),y2:u+h})),E=e.series.map((e,t)=>t),D=e.series.filter(e=>e.type===`bar`).length,O=[];if(D>0){let t=b*(1-Y.barPadRatio),n=D>1?(t-(D-1)*Y.barGroupGap)/D:t,r=Math.min(n,Y.maxBarWidth),i=D>1?r*D+Y.barGroupGap*(D-1):r,o=0,s=0;for(let t of e.series){if(t.type!==`bar`){s++;continue}for(let e=0;e<t.data.length;e++){let n=x(e)-i/2+o*(r+Y.barGroupGap),l=y(Math.max(t.data[e],a.min)),u=y(Math.max(0,a.min));O.push({x:Math.min(u,l),y:n,width:Math.abs(l-u),height:r,value:t.data[e],label:c[e],seriesIndex:o,colorIndex:E[s]})}o++,s++}}let k=[],A=0,j=0;for(let t of e.series){if(t.type!==`line`){j++;continue}let e=t.data.map((e,t)=>({x:y(e),y:x(t),value:e,label:c[t]}));k.push({points:e,seriesIndex:A,colorIndex:E[j]}),A++,j++}let M={x1:f,y1:u+h,x2:f+m,y2:u+h},N={x1:f,y1:u,x2:f,y2:u+h},P={ticks:S,line:M,...e.yAxis.title?{title:{text:e.yAxis.title,x:f+m/2,y:_-Y.padding}}:{}},F={ticks:C,line:N,...e.xAxis.title?{title:{text:e.xAxis.title,x:Y.padding+4,y:u+h/2,rotate:-90}}:{}},I=e.title?{text:e.title,x:g/2,y:Y.padding+Y.titleFontSize}:void 0,ee=Y.padding+(t?Y.titleHeight:0)+Y.legendHeight/2;return{width:g,height:_,horizontal:!0,title:I,xAxis:P,yAxis:F,plotArea:v,bars:O,lines:k,gridLines:T,legend:i?ur(e,g/2,ee,E):[]}}function rr(e){if(e.xAxis.categories)return e.xAxis.categories.length;for(let t of e.series)if(t.data.length>0)return t.data.length;return 1}function ir(e,t){if(e.xAxis.categories)return e.xAxis.categories;if(e.xAxis.range){let{min:n,max:r}=e.xAxis.range,i=t>1?(r-n)/(t-1):0;return Array.from({length:t},(e,t)=>lr(n+i*t))}return Array.from({length:t},(e,t)=>String(t+1))}function ar(e,t,n,r){return ir(e,rr(e)).map((e,r)=>({label:e,x:t(r),y:n,tx:t(r),ty:n+Y.tickLength,labelX:t(r),labelY:n+18,textAnchor:`middle`}))}function or(e,t,n,r,i,a,o){let s=e.series.filter(e=>e.type===`bar`).length;if(s===0)return[];let c=r*(1-Y.barPadRatio),l=s>1?(c-(s-1)*Y.barGroupGap)/s:c,u=Math.min(l,Y.maxBarWidth),d=s>1?u*s+Y.barGroupGap*(s-1):u,f=[],p=0,m=0;for(let r of e.series){if(r.type!==`bar`){m++;continue}for(let e=0;e<r.data.length;e++){let s=t(e)-d/2+p*(u+Y.barGroupGap),c=n(r.data[e]),l=n(Math.max(0,i));f.push({x:s,y:Math.min(c,l),width:u,height:Math.abs(l-c),value:r.data[e],label:a[e],seriesIndex:p,colorIndex:o[m]})}p++,m++}return f}function sr(e,t,n,r,i){let a=[],o=0,s=0;for(let c of e.series){if(c.type!==`line`){s++;continue}let e=c.data.map((e,i)=>({x:t(i),y:n(e),value:e,label:r[i]}));a.push({points:e,seriesIndex:o,colorIndex:i[s]}),o++,s++}return a}function cr(e,t){let n=t-e;if(n<=0)return[e];let r=n/6,i=10**Math.floor(Math.log10(r)),a=r/i,o;o=a<=1.5?i:a<=3?2*i:a<=7?5*i:10*i;let s=Math.ceil(e/o)*o,c=[];for(let e=s;e<=t+o*.001;e+=o)c.push(Math.round(e*1e10)/1e10);return c}function lr(e){return Number.isInteger(e)?String(e):e.toFixed(+(Math.abs(e)<10))}function ur(e,t,n,r){let i=[],a=0,o=0;for(let t=0;t<e.series.length;t++){let s=e.series[t],c=s.type===`bar`?`Bar ${a+1}`:`Line ${o+1}`;i.push({label:c,x:0,y:n,type:s.type,seriesIndex:s.type===`bar`?a:o,colorIndex:r[t]}),s.type===`bar`?a++:o++}let s=i.map(e=>{let t=w(e.label,Y.legendFontSize,Y.legendFontWeight);return Y.legendSwatchW+Y.legendGap+t}),c=t-(s.reduce((e,t)=>e+t,0)+(i.length-1)*Y.legendItemGap)/2;for(let e=0;e<i.length;e++)i[e].x=c,c+=s[e]+Y.legendItemGap;return i}var X={titleSize:18,titleWeight:600,axisTitleSize:15,axisTitleWeight:500,labelSize:14,labelWeight:400,legendSize:14,legendWeight:400,dotRadius:5,lineWidth:2.5,barRadius:8},Z={fontSize:15,fontWeight:500,height:32,padX:14,offsetY:12,rx:8,minY:4,pointerSize:6};function dr(e,t,n=`Inter`,r=!1,i=!1,a,o,s,c={}){let u=[],d=Math.max(0,...e.bars.map(e=>e.colorIndex),...e.lines.map(e=>e.colorIndex)),f=V((0,l.svgOpenTag)(e.width,e.height,t,r,o,s,void 0,c.styleAttribute).replace(`<svg `,`<svg data-xychart-colors="${d}" `),a);u.push(f),u.push((0,l.buildStyleBlock)(n,!1,c.nonce));let p=Math.max(...e.lines.map(e=>e.points.length),0),m=p>0&&p<=12,{style:h,defs:g}=fr(e,i,m,t.accent,t.bg,c.nonce);u.push(h),g&&u.push(g);let{plotArea:_}=e,v=e.xAxis.ticks.map(e=>e.x),y=e.horizontal?e.yAxis.ticks.map(e=>e.y):e.gridLines.map(e=>e.y1),b=v.length>1?Math.abs(v[1]-v[0]):_.width/6,x=y.length>1?Math.abs(y[1]-y[0]):_.height/6,S=b/Math.max(1,Math.round(b/20)),C=x/Math.max(1,Math.round(x/20)),w=v[0]??_.x,T=y[0]??_.y,E=w-Math.ceil((w-_.x)/S)*S,D=T-Math.ceil((T-_.y)/C)*C;for(let e=D;e<=_.y+_.height+.5;e+=C)for(let t=E;t<=_.x+_.width+.5;t+=S)u.push(`<circle cx="${Q(t)}" cy="${Q(e)}" r="1.5" class="xychart-grid"/>`);let O=[];for(let t of e.bars){let n=` data-value="${t.value}"${t.label?` data-label="${$(t.label)}"`:``}`,r=e.horizontal?mr(t.x,t.y,t.width,t.height,X.barRadius):pr(t.x,t.y,t.width,t.height,X.barRadius);if(u.push(`<path d="${r}" class="xychart-bar xychart-color-${t.colorIndex}"${n}/>`),i){let e=vr(t.value),n=t.label?`${t.label}: ${e}`:e,r=_r(t.x+t.width/2,t.y,e);O.push(`<g class="xychart-bar-group"><rect x="${Q(t.x)}" y="${Q(t.y)}" width="${Q(t.width)}" height="${Q(t.height)}" fill="transparent"/><title>${$(n)}</title>`+r+`</g>`)}}for(let t of e.lines){if(t.points.length===0)continue;let e=hr(t.points);u.push(`<path d="${e}" class="xychart-line-shadow xychart-color-${t.colorIndex}" transform="translate(0,2)"/>`),u.push(`<path d="${e}" class="xychart-line xychart-color-${t.colorIndex}"/>`)}let k=[];if(i||m){let t=new Map;for(let n of e.legend)n.type===`line`&&t.set(n.seriesIndex,n.label);let n=new Map;for(let t of e.lines)for(let e of t.points){let r=Q(e.x),i=n.get(r)??[];n.set(r,i),i.push({x:e.x,y:e.y,value:e.value,label:e.label,seriesIndex:t.seriesIndex,colorIndex:t.colorIndex})}for(let e of n.values()){let n=e[0].x,r=e[0].label||``;if(i&&e.length>1){let i=Math.min(...e.map(e=>e.y)),a=Math.max(...e.map(e=>e.y)),o=X.dotRadius*3,s=`<rect x="${Q(n-o)}" y="${Q(i-o)}" width="${Q(o*2)}" height="${Q(a-i+o*2)}" fill="transparent" class="xychart-hit"/>`,c=e.map(e=>({text:vr(e.value),legendLabel:t.get(e.seriesIndex)||`Line ${e.seriesIndex+1}`})),l=gr(n,i-X.dotRadius,r,c),u=c.map(e=>e.text),d=r?`${r}: ${u.join(` · `)}`:u.join(` · `),f=`<g class="xychart-dot-group">${s}`;for(let t of e){let e=` data-value="${t.value}"${t.label?` data-label="${$(t.label)}"`:``}`;f+=`<circle cx="${Q(t.x)}" cy="${Q(t.y)}" r="${X.dotRadius}" class="xychart-dot xychart-color-${t.colorIndex}"${e}/>`}f+=`<title>${$(d)}</title>${l}</g>`,k.push(f)}else if(i){let t=e[0],r=` data-value="${t.value}"${t.label?` data-label="${$(t.label)}"`:``}`,i=vr(t.value),a=t.label?`${t.label}: ${i}`:i,o=_r(n,t.y-X.dotRadius,i),s=m?`<circle cx="${Q(n)}" cy="${Q(t.y)}" r="${X.dotRadius*3}" fill="transparent" class="xychart-hit"/>`:``;k.push(`<g class="xychart-dot-group">${s}<circle cx="${Q(t.x)}" cy="${Q(t.y)}" r="${X.dotRadius}" class="xychart-dot xychart-color-${t.colorIndex}"${r}/><title>${$(a)}</title>${o}</g>`)}else for(let t of e){let e=` data-value="${t.value}"${t.label?` data-label="${$(t.label)}"`:``}`;u.push(`<circle cx="${Q(t.x)}" cy="${Q(t.y)}" r="${X.dotRadius}" class="xychart-dot xychart-color-${t.colorIndex}"${e}/>`)}}}for(let t of e.xAxis.ticks)u.push(`<text x="${t.labelX}" y="${t.labelY}" text-anchor="${t.textAnchor}" font-size="${X.labelSize}" font-weight="${X.labelWeight}" dy="${P}" class="xychart-label">${$(t.label)}</text>`);for(let t of e.yAxis.ticks)u.push(`<text x="${t.labelX}" y="${t.labelY}" text-anchor="${t.textAnchor}" font-size="${X.labelSize}" font-weight="${X.labelWeight}" dy="${P}" class="xychart-label">${$(t.label)}</text>`);if(e.xAxis.title){let t=e.xAxis.title,n=t.rotate?` transform="rotate(${t.rotate},${t.x},${t.y})"`:``;u.push(`<text x="${t.x}" y="${t.y}" text-anchor="middle"${n} font-size="${X.axisTitleSize}" font-weight="${X.axisTitleWeight}" dy="${P}" class="xychart-axis-title">${$(t.text)}</text>`)}if(e.yAxis.title){let t=e.yAxis.title,n=t.rotate?` transform="rotate(${t.rotate},${t.x},${t.y})"`:``;u.push(`<text x="${t.x}" y="${t.y}" text-anchor="middle"${n} font-size="${X.axisTitleSize}" font-weight="${X.axisTitleWeight}" dy="${P}" class="xychart-axis-title">${$(t.text)}</text>`)}e.title&&u.push(`<text x="${e.title.x}" y="${e.title.y}" text-anchor="middle" font-size="${X.titleSize}" font-weight="${X.titleWeight}" dy="${P}" class="xychart-title">${$(e.title.text)}</text>`);for(let t of e.legend){if(t.type===`bar`)u.push(`<rect x="${t.x}" y="${t.y-7}" width="14" height="14" rx="3" class="xychart-bar xychart-color-${t.colorIndex}"/>`);else{let e=t.y;u.push(`<line x1="${t.x}" y1="${e}" x2="${t.x+14}" y2="${e}" stroke-width="${X.lineWidth}" stroke-linecap="round" class="xychart-legend-line xychart-color-${t.colorIndex}"/>`)}u.push(`<text x="${t.x+14+6}" y="${t.y}" text-anchor="start" font-size="${X.legendSize}" font-weight="${X.legendWeight}" dy="${P}" class="xychart-label">${$(t.label)}</text>`)}for(let e of O)u.push(e);for(let e of k)u.push(e);return u.push(`</svg>`),u.join(`
|
|
37
|
-
`)}function
|
|
21
|
+
</marker>`}function yn(e,t,n=!0){let{x:r,y:i,width:a,height:o,headerHeight:s,attrHeight:c,inlineStyle:u}=e,d=[],f=e.interaction,p=(0,l.escapeAttr)(u?.fill??`var(--_node-fill)`),m=(0,l.escapeAttr)(u?.stroke??`var(--_node-stroke)`),h=(0,l.escapeAttr)(u?.[`stroke-width`]??String(P.outerBox)),g=u?.fill?p:`var(--_group-hdr)`,_=u?.color?(0,l.escapeAttr)(u.color):u?.fill?(0,l.escapeAttr)((0,l.getReadableTextColor)(u.fill,`var(--_text)`)):void 0,v=e.annotation?` data-annotation="${(0,l.escapeAttr)(e.annotation)}"`:``,y=(0,l.sanitizeClassName)(e.className),b=[`class="${y?`class-node ${y}`:`class-node`}"`,`data-id="${(0,l.escapeAttr)(e.id)}"`,`data-label="${(0,l.escapeAttr)(e.label)}"`];d.push(`<g ${b.join(` `)}${v}>`);let x=n?(0,l.safeHref)(f?.href):void 0;if(x){let e=f?.target?` target="${(0,l.escapeAttr)(f.target)}"`:``;d.push(` <a href="${(0,l.escapeAttr)(x)}"${e}>`)}n&&f?.tooltip&&d.push(` <title>${G(f.tooltip)}</title>`),d.push(` <rect x="${r}" y="${i}" width="${a}" height="${o}" rx="0" ry="0" fill="${p}" stroke="${m}" stroke-width="${h}" />`),d.push(` <rect x="${r}" y="${i}" width="${a}" height="${s}" rx="0" ry="0" fill="${g}" stroke="${m}" stroke-width="${h}" />`);let S=i+s/2;if(e.annotation){let t=i+12;d.push(` <text x="${r+a/2}" y="${t}" text-anchor="middle" dy="${F}" font-size="${gn.annotationSize}" font-weight="${gn.annotationWeight}" font-style="italic" fill="${_??`var(--_text-muted)`}"><<${G(e.annotation)}>></text>`),S=i+s/2+6}d.push(` `+(0,l.renderMultilineText)(e.label,r+a/2,S,t.nodeLabel,`text-anchor="middle" font-size="${t.nodeLabel}" font-weight="700" fill="${_??`var(--_text)`}"`));let C=i+s;d.push(` <line x1="${r}" y1="${C}" x2="${r+a}" y2="${C}" stroke="${m}" stroke-width="${P.innerBox}" />`);for(let t=0;t<e.attributes.length;t++){let n=e.attributes[t],i=C+4+t*20+10;d.push(` `+bn(n,r+U.boxPadX,i,_))}let w=C+c;d.push(` <line x1="${r}" y1="${w}" x2="${r+a}" y2="${w}" stroke="${m}" stroke-width="${P.innerBox}" />`);for(let t=0;t<e.methods.length;t++){let n=e.methods[t],i=w+4+t*20+10;d.push(` `+bn(n,r+U.boxPadX,i,_))}return x&&d.push(` </a>`),d.push(`</g>`),d.join(`
|
|
22
|
+
`)}function bn(e,t,n,r){let i=e.isAbstract?` font-style="italic"`:``,a=e.isStatic?` text-decoration="underline"`:``,o=r??`var(--_text-faint)`,s=r??`var(--_text-sec)`,c=r??`var(--_text-muted)`,l=[];e.visibility&&l.push(`<tspan fill="${o}">${G(e.visibility)} </tspan>`);let u=e.isMethod?`${e.name}(${e.params||``})`:e.name;return l.push(`<tspan fill="${s}">${G(u)}</tspan>`),e.type&&(l.push(`<tspan fill="${o}">: </tspan>`),l.push(`<tspan fill="${c}">${G(e.type)}</tspan>`)),`<text x="${t}" y="${n}" class="mono" dy="${F}" font-size="${gn.memberSize}" font-weight="${gn.memberWeight}"${i}${a}>${l.join(``)}</text>`}var W=6;function xn(e,t){let{x:n,y:r,width:i,height:a}=e,o=e.forClass===void 0?``:` data-for="${(0,l.escapeAttr)(e.forClass)}"`,s=[`${n},${r}`,`${n+i-W},${r}`,`${n+i},${r+W}`,`${n+i},${r+a}`,`${n},${r+a}`].join(` `),c=`${n+i-W},${r} ${n+i},${r+W} ${n+i-W},${r+W}`;return`<g class="class-note"${o}>\n <polygon points="${s}" fill="var(--bg)" stroke="var(--_node-stroke)" stroke-width="${P.innerBox}" />\n <polygon points="${c}" fill="var(--_inner-stroke)" stroke="var(--_node-stroke)" stroke-width="${P.innerBox}" />\n ${(0,l.renderMultilineText)(e.text,n+i/2,r+a/2,t.edgeLabel,`font-size="${t.edgeLabel}" text-anchor="middle" font-weight="${j.edgeLabel}" fill="var(--_text-muted)"`)}\n</g>`}function Sn(e){if(!e.linkPoints||e.linkPoints.length<2)return``;let t=e.linkPoints.map(e=>`${e.x},${e.y}`).join(` `);return`<polyline class="class-note-link"${e.forClass===void 0?``:` data-for="${(0,l.escapeAttr)(e.forClass)}"`} points="${t}" fill="none" stroke="var(--_line)" stroke-width="${P.connector}" stroke-dasharray="2 3" />`}function Cn(e){if(e.points.length<2)return``;let t=e.points.map(e=>`${e.x},${e.y}`).join(` `),n=e.type===`dependency`||e.type===`realization`?` stroke-dasharray="6 4"`:``,r=wn(e.type,e.markerAt),i=[`class="class-relationship"`,`data-from="${(0,l.escapeAttr)(e.from)}"`,`data-to="${(0,l.escapeAttr)(e.to)}"`,`data-type="${e.type}"`,`data-marker-at="${e.markerAt}"`];return e.label&&i.push(`data-label="${(0,l.escapeAttr)(e.label)}"`),e.fromCardinality&&i.push(`data-from-cardinality="${(0,l.escapeAttr)(e.fromCardinality)}"`),e.toCardinality&&i.push(`data-to-cardinality="${(0,l.escapeAttr)(e.toCardinality)}"`),`<polyline ${i.join(` `)} points="${t}" fill="none" stroke="var(--_line)" stroke-width="${P.connector}"${n}${r} />`}function wn(e,t){let n=Tn(e);return n?t===`from`?` marker-start="url(#${n})"`:` marker-end="url(#${n})"`:``}function Tn(e){switch(e){case`inheritance`:case`realization`:return`cls-inherit`;case`composition`:return`cls-composition`;case`aggregation`:return`cls-aggregation`;case`association`:case`dependency`:return`cls-arrow`;default:return null}}function En(e,t){if(!e.label&&!e.fromCardinality&&!e.toCardinality||e.points.length<2)return``;let n=[];if(e.label){let r=e.labelPosition??Dn(e.points);n.push((0,l.renderMultilineText)(e.label,r.x,r.y-8,t.edgeLabel,`font-size="${t.edgeLabel}" text-anchor="middle" font-weight="${j.edgeLabel}" fill="var(--_text-muted)"`))}if(e.fromCardinality&&e.points.length>=2){let r=e.points[0],i=e.points[1],a=On(r,i);n.push((0,l.renderMultilineText)(e.fromCardinality,r.x+a.x,r.y+a.y,t.edgeLabel,`font-size="${t.edgeLabel}" text-anchor="middle" font-weight="${j.edgeLabel}" fill="var(--_text-muted)"`))}if(e.toCardinality&&e.points.length>=2){let r=e.points[e.points.length-1],i=e.points[e.points.length-2],a=On(r,i);n.push((0,l.renderMultilineText)(e.toCardinality,r.x+a.x,r.y+a.y,t.edgeLabel,`font-size="${t.edgeLabel}" text-anchor="middle" font-weight="${j.edgeLabel}" fill="var(--_text-muted)"`))}return n.join(`
|
|
23
|
+
`)}function Dn(e){return e.length===0?{x:0,y:0}:e[Math.floor(e.length/2)]}function On(e,t){let n=t.x-e.x,r=t.y-e.y;return Math.abs(n)>Math.abs(r)?{x:n>0?14:-14,y:-10}:{x:-14,y:r>0?14:-14}}var G=l.escapeXml,K={padding:40,boxPadX:14,headerHeight:34,rowHeight:22,minWidth:140,attrFontSize:11,attrFontWeight:400,nodeSpacing:70,layerSpacing:90};function kn(e,t){let n=new Map,r=A(t.fontSizes);for(let t of e.entities){let e=T(t.label,r.nodeLabel,j.nodeLabel),i=0;for(let e of t.attributes){let t=E(`${e.type} ${e.name}${e.keys.length>0?` `+e.keys.join(`,`):``}`,K.attrFontSize);t>i&&(i=t)}let a=Math.max(K.minWidth,e+K.boxPadX*2,i+K.boxPadX*2),o=K.headerHeight+Math.max(t.attributes.length,1)*K.rowHeight;n.set(t.id,{width:a,height:o})}let i=[];for(let[e,t]of n)i.push(R(e,t));let a={fontSize:r.edgeLabel},o=[];for(let[t,n]of e.relationships.entries())o.push(z({id:`e${t}`,source:n.entity1,target:n.entity2,label:n.label,labelStyle:a}));return{elkGraph:{id:`root`,layoutOptions:{...re({direction:te(e.direction,ee.er),nodeSpacing:K.nodeSpacing,layerSpacing:K.layerSpacing,padding:K.padding}),"elk.edgeLabels.placement":`CENTER`},children:i,edges:o},entitySizes:n}}function An(e,t,n){let r=new Map;for(let e of t.entities)r.set(e.id,e);let i=[];for(let t of e.children??[]){let e=r.get(t.id);if(e){let r=n.get(e.id);if(!r)throw Error(`Missing computed size for entity "${e.id}"`);i.push({id:e.id,label:e.label,attributes:e.attributes,x:t.x??0,y:t.y??0,width:t.width??r.width,height:t.height??r.height,headerHeight:K.headerHeight,rowHeight:K.rowHeight})}}let a=[];for(let[n,r]of(e.edges??[]).entries()){let e=t.relationships[n],i=Ae(r);a.push({entity1:e.entity1,entity2:e.entity2,cardinality1:e.cardinality1,cardinality2:e.cardinality2,label:e.label,identifying:e.identifying,points:i})}return{width:e.width??600,height:e.height??400,entities:i,relationships:a}}function jn(e,t={}){if(e.entities.length===0)return{width:0,height:0,entities:[],relationships:[]};let{elkGraph:n,entitySizes:r}=kn(e,t);return An(w(n,t.layoutCache),e,r)}var q={attrSize:11,attrWeight:400,keySize:9,keyWeight:600};function Mn(e,t,n=`Inter`,r=!1,i=k,a,o,s,c={}){let u=[];u.push(V((0,l.svgOpenTag)(e.width,e.height,t,r,o,s,void 0,c.styleAttribute),a)),u.push((0,l.buildStyleBlock)(n,!0,c.nonce)),u.push(`<defs>`),u.push(`</defs>`);for(let t of e.relationships)u.push(Fn(t));for(let t of e.entities)u.push(Nn(t,i));for(let t of e.relationships)u.push(Ln(t));for(let t of e.relationships)u.push(In(t,i));return u.push(`</svg>`),u.join(`
|
|
24
|
+
`)}function Nn(e,t){let{id:n,x:r,y:i,width:a,height:o,headerHeight:s,rowHeight:c,label:u,attributes:d}=e,f=[];f.push(`<g class="entity" data-id="${(0,l.escapeAttr)(n)}" data-label="${(0,l.escapeAttr)(u)}">`),f.push(` <rect x="${r}" y="${i}" width="${a}" height="${o}" rx="0" ry="0" fill="var(--_node-fill)" stroke="var(--_node-stroke)" stroke-width="${P.outerBox}" />`),f.push(` <rect x="${r}" y="${i}" width="${a}" height="${s}" rx="0" ry="0" fill="var(--_group-hdr)" stroke="var(--_node-stroke)" stroke-width="${P.outerBox}" />`),f.push(` `+(0,l.renderMultilineText)(u,r+a/2,i+s/2,t.nodeLabel,`text-anchor="middle" font-size="${t.nodeLabel}" font-weight="700" fill="var(--_text)"`));let p=i+s;f.push(` <line x1="${r}" y1="${p}" x2="${r+a}" y2="${p}" stroke="var(--_node-stroke)" stroke-width="${P.innerBox}" />`);for(let e=0;e<d.length;e++){let t=d[e],n=p+e*c+c/2;f.push(` `+Pn(t,r,n,a).replace(/\n/g,`
|
|
25
|
+
`))}return d.length===0&&f.push(` <text x="${r+a/2}" y="${p+c/2}" text-anchor="middle" dy="${F}" font-size="${q.attrSize}" fill="var(--_text-faint)" font-style="italic">(no attributes)</text>`),f.push(`</g>`),f.join(`
|
|
26
|
+
`)}function Pn(e,t,n,r){let i=[],a=e.comment&&e.comment.length>0;if(e.comment&&e.comment.length>0){let t=e.comment.replace(/<br\s*\/?>/gi,`
|
|
27
|
+
`);i.push(`<g><title>${Bn(t)}</title>`)}let o=0;e.keys.length>0&&(o=T(e.keys.join(`,`),q.keySize,q.keyWeight)+8,i.push(`<rect x="${t+6}" y="${n-7}" width="${o}" height="14" rx="2" ry="2" fill="var(--_key-badge)" />`),i.push(`<text x="${t+6+o/2}" y="${n}" text-anchor="middle" dy="${F}" font-size="${q.keySize}" font-weight="${q.keyWeight}" fill="var(--_text-sec)">${e.keys.join(`,`)}</text>`));let s=t+8+(o>0?o+6:0);i.push(`<text x="${s}" y="${n}" class="mono" dy="${F}" font-size="${q.attrSize}" font-weight="${q.attrWeight}"><tspan fill="var(--_text-muted)">${Bn(e.type)}</tspan></text>`);let c=t+r-8;return i.push(`<text x="${c}" y="${n}" class="mono" text-anchor="end" dy="${F}" font-size="${q.attrSize}" font-weight="${q.attrWeight}"><tspan fill="var(--_text-sec)">${Bn(e.name)}</tspan></text>`),a&&i.push(`</g>`),i.join(`
|
|
28
|
+
`)}function Fn(e){if(e.points.length<2)return``;let t=e.points.map(e=>`${e.x},${e.y}`).join(` `),n=e.identifying?``:` stroke-dasharray="6 4"`,r=e.label?` data-label="${(0,l.escapeAttr)(e.label)}"`:``;return`<polyline ${[`class="er-relationship"`,`data-entity1="${(0,l.escapeAttr)(e.entity1)}"`,`data-entity2="${(0,l.escapeAttr)(e.entity2)}"`,`data-cardinality1="${e.cardinality1}"`,`data-cardinality2="${e.cardinality2}"`,`data-identifying="${e.identifying}"`].join(` `)}${r} points="${t}" fill="none" stroke="var(--_line)" stroke-width="${P.connector}"${n} />`}function In(e,t){if(!e.label||e.points.length<2)return``;let n=zn(e.points),r=(0,l.measureMultilineText)(e.label,t.edgeLabel,j.edgeLabel),i=r.width+8,a=r.height+6;return`<rect x="${n.x-i/2}" y="${n.y-a/2}" width="${i}" height="${a}" rx="2" ry="2" fill="var(--bg)" stroke="var(--_inner-stroke)" stroke-width="0.5" />\n${(0,l.renderMultilineText)(e.label,n.x,n.y,t.edgeLabel,`text-anchor="middle" font-size="${t.edgeLabel}" font-weight="${j.edgeLabel}" fill="var(--_text-muted)"`)}`}function Ln(e){if(e.points.length<2)return``;let t=[],n=e.points[0],r=e.points[1];t.push(Rn(n,r,e.cardinality1));let i=e.points[e.points.length-1],a=e.points[e.points.length-2];return t.push(Rn(i,a,e.cardinality2)),t.join(`
|
|
29
|
+
`)}function Rn(e,t,n){let r=[],i=P.connector+.25,a=e.x-t.x,o=e.y-t.y,s=Math.sqrt(a*a+o*o);if(s===0)return``;let c=a/s,l=o/s,u=-l,d=c,f=e.x-c*4,p=e.y-l*4,m=e.x-c*16,h=e.y-l*16,g=n===`one`||n===`zero-one`,_=n===`many`||n===`zero-many`,v=n===`zero-one`||n===`zero-many`;if(g){r.push(`<line x1="${f+u*6}" y1="${p+d*6}" x2="${f-u*6}" y2="${p-d*6}" stroke="var(--_line)" stroke-width="${i}" />`);let e=f-c*4,t=p-l*4;r.push(`<line x1="${e+u*6}" y1="${t+d*6}" x2="${e-u*6}" y2="${t-d*6}" stroke="var(--_line)" stroke-width="${i}" />`)}if(_){let e=f,t=p;r.push(`<line x1="${e+u*7}" y1="${t+d*7}" x2="${m}" y2="${h}" stroke="var(--_line)" stroke-width="${i}" />`),r.push(`<line x1="${e}" y1="${t}" x2="${m}" y2="${h}" stroke="var(--_line)" stroke-width="${i}" />`),r.push(`<line x1="${e-u*7}" y1="${t-d*7}" x2="${m}" y2="${h}" stroke="var(--_line)" stroke-width="${i}" />`)}if(v){let t=_?20:12,n=e.x-c*t,a=e.y-l*t;r.push(`<circle cx="${n}" cy="${a}" r="4" fill="var(--bg)" stroke="var(--_line)" stroke-width="${i}" />`)}return r.join(`
|
|
30
|
+
`)}function zn(e){if(e.length===0)return{x:0,y:0};if(e.length===1)return e[0];let t=0;for(let n=1;n<e.length;n++){let r=e[n].x-e[n-1].x,i=e[n].y-e[n-1].y;t+=Math.sqrt(r*r+i*i)}if(t===0)return e[0];let n=t/2,r=0;for(let t=1;t<e.length;t++){let i=e[t].x-e[t-1].x,a=e[t].y-e[t-1].y,o=Math.sqrt(i*i+a*a);if(r+o>=n){let s=o>0?(n-r)/o:0;return{x:e[t-1].x+i*s,y:e[t-1].y+a*s}}r+=o}return e[e.length-1]}var Bn=l.escapeXml,J={padding:30,actorGap:140,actorHeight:40,actorPadX:16,headerGap:20,messageRowHeight:40,selfMessageHeight:30,activationWidth:10,blockPadX:10,blockPadTop:40,blockPadBottom:8,blockHeaderExtra:28,dividerExtra:24,noteWidth:60,notePadX:12,notePadY:6,noteGap:10,noteOffsetAfterMessage:8,noteStackGap:4,boxPad:10};function Vn(e){return e+8}function Hn(e){return{...J,actorHeight:e?.actorHeight??J.actorHeight,headerGap:e?.headerGap??J.headerGap,messageRowHeight:e?.messageRowHeight??J.messageRowHeight,noteOffsetAfterMessage:e?.noteOffsetAfterMessage??J.noteOffsetAfterMessage,noteStackGap:e?.noteStackGap??J.noteStackGap}}function Un(e,t={}){if(e.actors.length===0)return{width:0,height:0,actors:[],lifelines:[],messages:[],activations:[],blocks:[],notes:[],boxes:[]};let n=Hn(t.sequence),r=A(t.fontSizes),i=e.actors.map(e=>{let t=T(e.label,r.nodeLabel,j.nodeLabel);return Math.max(t+n.actorPadX*2,80)}),a=[],o=n.padding+i[0]/2;for(let t=0;t<e.actors.length;t++){if(t>0){let e=Math.max(n.actorGap,(i[t-1]+i[t])/2+40);o+=e}a.push(o)}let s=new Map;for(let t=0;t<e.actors.length;t++)s.set(e.actors[t].id,t);let c=e.boxes.filter(e=>e.actorIds.length>0),l=c.some(e=>e.label!==``),u=c.length===0?0:n.boxPad+(l?Vn(r.edgeLabel):0),d=n.padding+u,f=e.actors.map((e,t)=>({id:e.id,label:e.label,type:e.type,x:a[t],y:d,width:i[t],height:n.actorHeight})),p=c.map(e=>{let t=e.actorIds.map(e=>s.get(e)??0),r=Math.min(...t),o=Math.max(...t),c=a[r]-i[r]/2-n.boxPad,l=a[o]+i[o]/2+n.boxPad,u={label:e.label,x:c,y:n.padding,width:l-c,height:0};return e.color!==void 0&&(u.color=e.color),u}),m=d+n.actorHeight+n.headerGap,h=[],g=new Map;for(let t of e.blocks){let e=g.get(t.startIndex)??0;g.set(t.startIndex,Math.max(e,n.blockHeaderExtra));for(let e of t.dividers){let t=g.get(e.index)??0;g.set(e.index,Math.max(t,n.dividerExtra))}}let _=new Map;for(let t of e.notes){let e=_.get(t.afterIndex)??[];e.push(t),_.set(t.afterIndex,e)}let v=[],y=_.get(-1);if(y&&y.length>0){let e=m;for(let t of y){let o=Math.max(n.noteWidth,T(t.text,r.edgeLabel,j.edgeLabel)+n.notePadX*2),c=r.edgeLabel+n.notePadY*2,l=s.get(t.actorIds[0]??``)??0,u;if(t.position===`left`)u=a[l]-i[l]/2-o-n.noteGap;else if(t.position===`right`)u=a[l]+i[l]/2+n.noteGap;else if(t.actorIds.length>1){let e=s.get(t.actorIds[t.actorIds.length-1]??``)??l;u=(a[l]+a[e])/2-o/2}else u=a[l]-o/2;v.push({text:t.text,x:u,y:e,width:o,height:c,position:t.position,actors:t.actorIds}),e+=c+n.noteStackGap}m=Math.max(m,e+n.messageRowHeight/2)}let b=new Map,x=[];function S(e,t){let n=b.get(e)??[];b.set(e,n);let r=n.length;n.push({startY:t,depth:r})}function C(e,t){let r=b.get(e);if(!r||r.length===0)return;let{startY:i,depth:o}=r.pop(),c=s.get(e)??0,l=o*4;x.push({actorId:e,x:a[c]-n.activationWidth/2+l,topY:i,bottomY:t,width:n.activationWidth})}let w=new Map;for(let t of e.activations){let e=w.get(t.afterIndex)??[];e.push(t),w.set(t.afterIndex,e)}function E(e,t){for(let n of w.get(e)??[])n.kind===`start`?S(n.actorId,t):C(n.actorId,t)}E(-1,m);for(let t=0;t<e.messages.length;t++){let o=e.messages[t],c=s.get(o.from)??0,l=s.get(o.to)??0,u=o.from===o.to,d=g.get(t)??0;d>0&&(m+=d);let f=a[c],p=a[l],y=!u&&e.actors[l].createdAt===t;if(y){let e=i[l]/2;p+=f<p?-e:e}h.push({from:o.from,to:o.to,label:o.label,lineStyle:o.lineStyle,arrowHead:o.arrowHead,x1:f,x2:p,y:m,isSelf:u,bidirectional:o.bidirectional??!1,seqNumber:o.seqNumber}),o.activate&&S(o.to,m),o.deactivate&&C(o.from,m),E(t,m),m+=u?n.selfMessageHeight+n.messageRowHeight:n.messageRowHeight,y&&(m+=n.actorHeight/2);let b=_.get(t);if(b&&b.length>0){let e=u?n.selfMessageHeight:0,o=h[t].y+e+n.noteOffsetAfterMessage;for(let e of b){let t=Math.max(n.noteWidth,T(e.text,r.edgeLabel,j.edgeLabel)+n.notePadX*2),c=r.edgeLabel+n.notePadY*2,l=s.get(e.actorIds[0]??``)??0,u;if(e.position===`left`)u=a[l]-i[l]/2-t-n.noteGap;else if(e.position===`right`)u=a[l]+i[l]/2+n.noteGap;else if(e.actorIds.length>1){let n=s.get(e.actorIds[e.actorIds.length-1]??``)??l;u=(a[l]+a[n])/2-t/2}else u=a[l]-t/2;v.push({text:e.text,x:u,y:o,width:t,height:c,position:e.position,actors:e.actorIds}),o+=c+n.noteStackGap}m=Math.max(m,o+n.messageRowHeight/2)}}for(let[e,t]of b)for(let{startY:r,depth:i}of t){let t=s.get(e)??0,o=i*4;x.push({actorId:e,x:a[t]-n.activationWidth/2+o,topY:r,bottomY:m-n.messageRowHeight/2,width:n.activationWidth})}let D=e.blocks.map(t=>{let o=h[t.startIndex],c=h[t.endIndex],l=(o?.y??m)-n.blockPadTop,u=(c?.y??m)+n.blockPadBottom+12,d=new Set;for(let n=t.startIndex;n<=t.endIndex;n++){let t=e.messages[n];t&&(d.add(s.get(t.from)??0),d.add(s.get(t.to)??0))}if(d.size===0)for(let t=0;t<e.actors.length;t++)d.add(t);let f=Math.min(...d),p=Math.max(...d),g=a[f]-i[f]/2-n.blockPadX,_=a[p]+i[p]/2+n.blockPadX,v=t.dividers.map(e=>{let t=h[e.index],n=t?.y??m,i=28;if(e.label&&t?.label){let n=T(`[${e.label}]`,r.edgeLabel,j.edgeLabel),a=g+8,o=a+n,s=T(t.label,r.edgeLabel,j.edgeLabel),c=t.isSelf?t.x1+36:(t.x1+t.x2)/2-s/2,l=c+s;o>c&&a<l&&(i=36)}return{y:n-i,label:e.label}});return{type:t.type,label:t.label,x:g,y:l,width:_-g,height:u-l,dividers:v}}),O=v,k=m+n.padding,M=n.padding,N=0;for(let e of f)M=Math.min(M,e.x-e.width/2),N=Math.max(N,e.x+e.width/2);for(let e of D)M=Math.min(M,e.x),N=Math.max(N,e.x+e.width);for(let e of O)M=Math.min(M,e.x),N=Math.max(N,e.x+e.width);for(let e of p)M=Math.min(M,e.x),N=Math.max(N,e.x+e.width);for(let e of h)if(e.isSelf&&e.label){let t=e.x1+30+8,n=T(e.label,r.edgeLabel,j.edgeLabel);N=Math.max(N,t+n+8)}let P=M<n.padding?n.padding-M:0;if(P>0){for(let e of f)e.x+=P;for(let e of h)e.x1+=P,e.x2+=P;for(let e of x)e.x+=P;for(let e of D)e.x+=P;for(let e of O)e.x+=P;for(let e of p)e.x+=P;for(let e=0;e<a.length;e++)a[e]+=P}for(let t=0;t<e.actors.length;t++){let r=e.actors[t].createdAt;r!==void 0&&(f[t].y=(h[r]?.y??m)-n.actorHeight/2)}let F=e.actors.map((e,t)=>{let r=e.destroyedAt,i={actorId:e.id,x:a[t],topY:f[t].y+n.actorHeight,bottomY:r===void 0?k-n.padding:h[r]?.y??m};return r!==void 0&&(i.destroyed=!0),i});for(let e of p)e.height=k-n.padding+n.boxPad-e.y;let I=N+P+n.padding;return{width:Math.max(I,200),height:Math.max(k,100),actors:f,lifelines:F,messages:h,activations:x,blocks:D,notes:O,boxes:p}}function Wn(e,t,n=`Inter`,r=!1,i=k,a,o,s,c={}){let u=[];u.push(V((0,l.svgOpenTag)(e.width,e.height,t,r,o,s,void 0,c.styleAttribute),a)),u.push((0,l.buildStyleBlock)(n,!1,c.nonce)),u.push(`<defs>`),u.push(Gn()),u.push(`</defs>`);for(let t of e.boxes)u.push($n(t,i));for(let t of e.blocks)u.push(er(t,i));for(let t of e.lifelines)u.push(qn(t));for(let t of e.activations)u.push(Yn(t));for(let t of e.messages)u.push(Xn(t,i));for(let t of e.notes)u.push(tr(t,i));for(let t of e.actors)u.push(Kn(t,i));return u.push(`</svg>`),u.join(`
|
|
31
|
+
`)}function Gn(){let e=I.width,t=I.height;return` <marker id="seq-arrow" markerWidth="${e}" markerHeight="${t}" refX="${e}" refY="${t/2}" orient="auto-start-reverse">\n <polygon points="0 0, ${e} ${t/2}, 0 ${t}" fill="var(--_arrow)" />\n </marker>\n <marker id="seq-arrow-open" markerWidth="${e}" markerHeight="${t}" refX="${e}" refY="${t/2}" orient="auto-start-reverse">\n <polyline points="0 0, ${e} ${t/2}, 0 ${t}" fill="none" stroke="var(--_arrow)" stroke-width="1" />\n </marker>`}function Kn(e,t){let{id:n,x:r,y:i,width:a,height:o,label:s,type:c}=e,u=[];if(u.push(`<g class="actor" data-id="${(0,l.escapeAttr)(n)}" data-label="${(0,l.escapeAttr)(s)}" data-type="${c}">`),c===`actor`){let e=o/24*.9,n=r-12*e,a=i+(o-24*e)/2,c=P.outerBox/e,d=`var(--_line)`;u.push(` <g transform="translate(${n},${a}) scale(${e})">\n <path d="M21 12C21 16.9706 16.9706 21 12 21C7.02944 21 3 16.9706 3 12C3 7.02944 7.02944 3 12 3C16.9706 3 21 7.02944 21 12Z" fill="none" stroke="${d}" stroke-width="${c}" />\n <path d="M15 10C15 11.6569 13.6569 13 12 13C10.3431 13 9 11.6569 9 10C9 8.34315 10.3431 7 12 7C13.6569 7 15 8.34315 15 10Z" fill="none" stroke="${d}" stroke-width="${c}" />\n <path d="M5.62842 18.3563C7.08963 17.0398 9.39997 16 12 16C14.6 16 16.9104 17.0398 18.3716 18.3563" fill="none" stroke="${d}" stroke-width="${c}" />\n </g>`),u.push(` `+(0,l.renderMultilineText)(s,r,i+o+14,t.nodeLabel,`font-size="${t.nodeLabel}" text-anchor="middle" font-weight="${j.nodeLabel}" fill="var(--_text)"`))}else{let e=r-a/2;u.push(` <rect x="${e}" y="${i}" width="${a}" height="${o}" rx="4" ry="4" fill="var(--_node-fill)" stroke="var(--_node-stroke)" stroke-width="${P.outerBox}" />`),u.push(` `+(0,l.renderMultilineText)(s,r,i+o/2,t.nodeLabel,`font-size="${t.nodeLabel}" text-anchor="middle" font-weight="${j.nodeLabel}" fill="var(--_text)"`))}return u.push(`</g>`),u.join(`
|
|
32
|
+
`)}function qn(e){let t=`<line class="lifeline" data-actor="${(0,l.escapeAttr)(e.actorId)}" x1="${e.x}" y1="${e.topY}" x2="${e.x}" y2="${e.bottomY}" stroke="var(--_line)" stroke-width="0.75" stroke-dasharray="6 4" />`;if(!e.destroyed)return t;let{x:n,bottomY:r}=e,i=Jn;return t+`\n<path class="destroy" data-actor="${(0,l.escapeAttr)(e.actorId)}" d="M${n-i} ${r-i} L${n+i} ${r+i} M${n+i} ${r-i} L${n-i} ${r+i}" fill="none" stroke="var(--_line)" stroke-width="${P.outerBox}" stroke-linecap="round" />`}var Jn=8;function Yn(e){return`<rect class="activation" data-actor="${(0,l.escapeAttr)(e.actorId)}" x="${e.x}" y="${e.topY}" width="${e.width}" height="${e.bottomY-e.topY}" fill="var(--_node-fill)" stroke="var(--_node-stroke)" stroke-width="${P.innerBox}" />`}function Xn(e,t){let n=[],r=e.lineStyle===`dashed`?` stroke-dasharray="6 4"`:``,i=e.arrowHead===`filled`?`seq-arrow`:`seq-arrow-open`,a=e.bidirectional?` marker-start="url(#${i})"`:``;if(n.push(`<g class="message" data-from="${(0,l.escapeAttr)(e.from)}" data-to="${(0,l.escapeAttr)(e.to)}" data-label="${(0,l.escapeAttr)(e.label)}" data-line-style="${e.lineStyle}" data-arrow-head="${e.arrowHead}" data-self="${e.isSelf}" data-bidirectional="${e.bidirectional}">`),e.isSelf)n.push(` <polyline points="${e.x1},${e.y} ${e.x1+30},${e.y} ${e.x1+30},${e.y+20} ${e.x2},${e.y+20}" fill="none" stroke="var(--_line)" stroke-width="${P.connector}"${r} marker-end="url(#${i})"${a} />`),n.push(` `+(0,l.renderMultilineText)(e.label,e.x1+30+8,e.y+10,t.edgeLabel,`font-size="${t.edgeLabel}" text-anchor="start" font-weight="${j.edgeLabel}" fill="var(--_text-muted)"`));else{n.push(` <line x1="${e.x1}" y1="${e.y}" x2="${e.x2}" y2="${e.y}" stroke="var(--_line)" stroke-width="${P.connector}"${r} marker-end="url(#${i})"${a} />`);let o=(e.x1+e.x2)/2;n.push(` `+(0,l.renderMultilineText)(e.label,o,e.y-10,t.edgeLabel,`font-size="${t.edgeLabel}" text-anchor="middle" font-weight="${j.edgeLabel}" fill="var(--_text-muted)"`))}return e.seqNumber!==void 0&&n.push(` `+Zn(e,t)),n.push(`</g>`),n.join(`
|
|
33
|
+
`)}function Zn(e,t){let n=Math.max(t.edgeLabel-2,8),r=e.bidirectional?e.x1+Math.sign(e.x2-e.x1)*(8+I.width):e.x1;return`<g class="seq-number"><circle cx="${r}" cy="${e.y}" r="8" fill="var(--bg)" stroke="var(--_arrow)" stroke-width="${P.innerBox}" />`+(0,l.renderMultilineText)(String(e.seqNumber),r,e.y,n,`font-size="${n}" text-anchor="middle" font-weight="${j.edgeLabel}" fill="var(--_arrow)"`)+`</g>`}var Qn=35;function $n(e,t){let n=e.label?` data-label="${(0,l.escapeAttr)(e.label)}"`:``,r=e.color===void 0?``:` data-color="${(0,l.escapeAttr)(e.color)}"`,i=e.color===void 0?`none`:`color-mix(in srgb, ${(0,l.escapeAttr)(e.color)} ${Qn}%, var(--bg))`,a=[`<g class="participant-box"${n}${r}>`,` <rect x="${e.x}" y="${e.y}" width="${e.width}" height="${e.height}" rx="4" ry="4" fill="${i}" stroke="var(--_node-stroke)" stroke-width="${P.innerBox}" />`];return e.label&&a.push(` `+(0,l.renderMultilineText)(e.label,e.x+e.width/2,e.y+Vn(t.edgeLabel)/2,t.edgeLabel,`font-size="${t.edgeLabel}" text-anchor="middle" font-weight="${j.groupHeader}" fill="var(--_text-sec)"`)),a.push(`</g>`),a.join(`
|
|
34
|
+
`)}function er(e,t){let n=[],r=e.label?` data-label="${(0,l.escapeAttr)(e.label)}"`:``;n.push(`<g class="block" data-type="${(0,l.escapeAttr)(e.type)}"${r}>`),n.push(` <rect x="${e.x}" y="${e.y}" width="${e.width}" height="${e.height}" rx="0" ry="0" fill="none" stroke="var(--_node-stroke)" stroke-width="${P.outerBox}" />`);let i=`${e.type}${e.label?` [${e.label}]`:``}`,a=i.split(`
|
|
35
|
+
`)[0],o=T(a,t.edgeLabel,j.groupHeader)+16;n.push(` <rect x="${e.x}" y="${e.y}" width="${o}" height="18" fill="var(--_group-hdr)" stroke="var(--_node-stroke)" stroke-width="${P.outerBox}" />`),n.push(` `+(0,l.renderMultilineText)(i,e.x+6,e.y+9,t.edgeLabel,`font-size="${t.edgeLabel}" font-weight="${j.groupHeader}" fill="var(--_text-sec)"`));for(let r of e.dividers)n.push(` <line x1="${e.x}" y1="${r.y}" x2="${e.x+e.width}" y2="${r.y}" stroke="var(--_line)" stroke-width="0.75" stroke-dasharray="6 4" />`),r.label&&n.push(` `+(0,l.renderMultilineText)(`[${r.label}]`,e.x+8,r.y+14,t.edgeLabel,`font-size="${t.edgeLabel}" text-anchor="start" font-weight="${j.edgeLabel}" fill="var(--_text-muted)"`));return n.push(`</g>`),n.join(`
|
|
36
|
+
`)}function tr(e,t){let{x:n,y:r,width:i,height:a}=e,o=e.actors&&e.actors.length>0?` data-actors="${e.actors.map(l.escapeAttr).join(`,`)}"`:``;return`<g class="note"${e.position?` data-position="${(0,l.escapeAttr)(e.position)}"`:``}${o}>\n <polygon points="${[`${n},${r}`,`${n+i-6},${r}`,`${n+i},${r+6}`,`${n+i},${r+a}`,`${n},${r+a}`].join(` `)}" fill="var(--bg)" stroke="var(--_node-stroke)" stroke-width="${P.innerBox}" />\n <polygon points="${n+i-6},${r} ${n+i},${r+6} ${n+i-6},${r+6}" fill="var(--_inner-stroke)" stroke="var(--_node-stroke)" stroke-width="${P.innerBox}" />\n ${(0,l.renderMultilineText)(e.text,n+i/2,r+a/2,t.edgeLabel,`font-size="${t.edgeLabel}" text-anchor="middle" font-weight="${j.edgeLabel}" fill="var(--_text-muted)"`)}\n</g>`}var Y={plotWidth:600,plotHeight:340,padding:22,titleFontSize:18,titleFontWeight:600,titleHeight:42,axisLabelFontSize:14,axisLabelFontWeight:400,axisTitleFontSize:15,axisTitleFontWeight:500,xLabelHeight:38,yLabelWidth:58,yLabelGap:18,axisTitlePad:30,tickLength:4,barPadRatio:.2,barGroupGap:0,maxBarWidth:40,legendFontSize:14,legendFontWeight:400,legendHeight:28,legendSwatchW:14,legendSwatchH:14,legendGap:6,legendItemGap:16};function nr(e,t={}){return e.horizontal?ir(e):rr(e)}function rr(e){let t=!!e.title,n=!!e.xAxis.title,r=!!e.yAxis.title,i=e.series.length>1,a=e.yAxis.range;if(!a)throw Error(`XY chart: y-axis range was not set by the parser`);let o=ur(a.min,a.max),s=Math.max(...o.map(e=>T(dr(e),Y.axisLabelFontSize,Y.axisLabelFontWeight)),Y.yLabelWidth),c=Y.padding+(t?Y.titleHeight:0)+(i?Y.legendHeight:0),l=Y.padding+Y.xLabelHeight+(n?Y.axisTitlePad:0),u=Y.padding+s+Y.yLabelGap+(r?Y.axisTitlePad:0),d=Y.padding,f=Y.plotWidth,p=Y.plotHeight,m=u+f+d,h=c+p+l,g={x:u,y:c,width:f,height:p},_=ar(e),v=e=>u+(e+.5)*(f/_),y=f/_,b=e=>{let t=(e-a.min)/(a.max-a.min||1);return c+p-t*p},x=sr(e,v,c+p,y),S=o.map(e=>({label:dr(e),x:u,y:b(e),tx:u-Y.tickLength,ty:b(e),labelX:u-Y.yLabelGap,labelY:b(e),textAnchor:`end`})),C=o.map(e=>({x1:u,y1:b(e),x2:u+f,y2:b(e)})),w=or(e,_),E=e.series.map((e,t)=>t),D=cr(e,v,b,y,a.min,w,E),O=lr(e,v,b,w,E),k=Y.padding+(t?Y.titleHeight:0)+Y.legendHeight/2,A=i?fr(e,m/2,k,E):[],j={x1:u,y1:c+p,x2:u+f,y2:c+p},M={x1:u,y1:c,x2:u,y2:c+p},N={ticks:x,line:j,...e.xAxis.title?{title:{text:e.xAxis.title,x:u+f/2,y:h-Y.padding}}:{}},P={ticks:S,line:M,...e.yAxis.title?{title:{text:e.yAxis.title,x:Y.padding+4,y:c+p/2,rotate:-90}}:{}};return{width:m,height:h,title:e.title?{text:e.title,x:m/2,y:Y.padding+Y.titleFontSize}:void 0,xAxis:N,yAxis:P,plotArea:g,bars:D,lines:O,gridLines:C,legend:A}}function ir(e){let t=!!e.title,n=!!e.xAxis.title,r=!!e.yAxis.title,i=e.series.length>1,a=e.yAxis.range;if(!a)throw Error(`XY chart: y-axis range was not set by the parser`);let o=ur(a.min,a.max),s=ar(e),c=or(e,s),l=Math.max(...c.map(e=>T(e,Y.axisLabelFontSize,Y.axisLabelFontWeight)),40),u=Y.padding+(t?Y.titleHeight:0)+(i?Y.legendHeight:0),d=Y.padding+Y.xLabelHeight+(r?Y.axisTitlePad:0),f=Y.padding+l+Y.yLabelGap+(n?Y.axisTitlePad:0),p=Y.padding,m=Y.plotWidth,h=Y.plotHeight,g=f+m+p,_=u+h+d,v={x:f,y:u,width:m,height:h},y=e=>{let t=(e-a.min)/(a.max-a.min||1);return f+t*m},b=h/s,x=e=>u+(e+.5)*b,S=o.map(e=>({label:dr(e),x:y(e),y:u+h,tx:y(e),ty:u+h+Y.tickLength,labelX:y(e),labelY:u+h+18,textAnchor:`middle`})),C=c.map((e,t)=>({label:e,x:f,y:x(t),tx:f-Y.tickLength,ty:x(t),labelX:f-Y.yLabelGap,labelY:x(t),textAnchor:`end`})),w=o.map(e=>({x1:y(e),y1:u,x2:y(e),y2:u+h})),E=e.series.map((e,t)=>t),D=e.series.filter(e=>e.type===`bar`).length,O=[];if(D>0){let t=b*(1-Y.barPadRatio),n=D>1?(t-(D-1)*Y.barGroupGap)/D:t,r=Math.min(n,Y.maxBarWidth),i=D>1?r*D+Y.barGroupGap*(D-1):r,o=0,s=0;for(let t of e.series){if(t.type!==`bar`){s++;continue}for(let e=0;e<t.data.length;e++){let n=x(e)-i/2+o*(r+Y.barGroupGap),l=y(Math.max(t.data[e],a.min)),u=y(Math.max(0,a.min));O.push({x:Math.min(u,l),y:n,width:Math.abs(l-u),height:r,value:t.data[e],label:c[e],seriesIndex:o,colorIndex:E[s]})}o++,s++}}let k=[],A=0,j=0;for(let t of e.series){if(t.type!==`line`){j++;continue}let e=t.data.map((e,t)=>({x:y(e),y:x(t),value:e,label:c[t]}));k.push({points:e,seriesIndex:A,colorIndex:E[j]}),A++,j++}let M={x1:f,y1:u+h,x2:f+m,y2:u+h},N={x1:f,y1:u,x2:f,y2:u+h},P={ticks:S,line:M,...e.yAxis.title?{title:{text:e.yAxis.title,x:f+m/2,y:_-Y.padding}}:{}},F={ticks:C,line:N,...e.xAxis.title?{title:{text:e.xAxis.title,x:Y.padding+4,y:u+h/2,rotate:-90}}:{}},I=e.title?{text:e.title,x:g/2,y:Y.padding+Y.titleFontSize}:void 0,L=Y.padding+(t?Y.titleHeight:0)+Y.legendHeight/2;return{width:g,height:_,horizontal:!0,title:I,xAxis:P,yAxis:F,plotArea:v,bars:O,lines:k,gridLines:w,legend:i?fr(e,g/2,L,E):[]}}function ar(e){if(e.xAxis.categories)return e.xAxis.categories.length;for(let t of e.series)if(t.data.length>0)return t.data.length;return 1}function or(e,t){if(e.xAxis.categories)return e.xAxis.categories;if(e.xAxis.range){let{min:n,max:r}=e.xAxis.range,i=t>1?(r-n)/(t-1):0;return Array.from({length:t},(e,t)=>dr(n+i*t))}return Array.from({length:t},(e,t)=>String(t+1))}function sr(e,t,n,r){return or(e,ar(e)).map((e,r)=>({label:e,x:t(r),y:n,tx:t(r),ty:n+Y.tickLength,labelX:t(r),labelY:n+18,textAnchor:`middle`}))}function cr(e,t,n,r,i,a,o){let s=e.series.filter(e=>e.type===`bar`).length;if(s===0)return[];let c=r*(1-Y.barPadRatio),l=s>1?(c-(s-1)*Y.barGroupGap)/s:c,u=Math.min(l,Y.maxBarWidth),d=s>1?u*s+Y.barGroupGap*(s-1):u,f=[],p=0,m=0;for(let r of e.series){if(r.type!==`bar`){m++;continue}for(let e=0;e<r.data.length;e++){let s=t(e)-d/2+p*(u+Y.barGroupGap),c=n(r.data[e]),l=n(Math.max(0,i));f.push({x:s,y:Math.min(c,l),width:u,height:Math.abs(l-c),value:r.data[e],label:a[e],seriesIndex:p,colorIndex:o[m]})}p++,m++}return f}function lr(e,t,n,r,i){let a=[],o=0,s=0;for(let c of e.series){if(c.type!==`line`){s++;continue}let e=c.data.map((e,i)=>({x:t(i),y:n(e),value:e,label:r[i]}));a.push({points:e,seriesIndex:o,colorIndex:i[s]}),o++,s++}return a}function ur(e,t){let n=t-e;if(n<=0)return[e];let r=n/6,i=10**Math.floor(Math.log10(r)),a=r/i,o;o=a<=1.5?i:a<=3?2*i:a<=7?5*i:10*i;let s=Math.ceil(e/o)*o,c=[];for(let e=s;e<=t+o*.001;e+=o)c.push(Math.round(e*1e10)/1e10);return c}function dr(e){return Number.isInteger(e)?String(e):e.toFixed(+(Math.abs(e)<10))}function fr(e,t,n,r){let i=[],a=0,o=0;for(let t=0;t<e.series.length;t++){let s=e.series[t],c=s.type===`bar`?`Bar ${a+1}`:`Line ${o+1}`;i.push({label:c,x:0,y:n,type:s.type,seriesIndex:s.type===`bar`?a:o,colorIndex:r[t]}),s.type===`bar`?a++:o++}let s=i.map(e=>{let t=T(e.label,Y.legendFontSize,Y.legendFontWeight);return Y.legendSwatchW+Y.legendGap+t}),c=t-(s.reduce((e,t)=>e+t,0)+(i.length-1)*Y.legendItemGap)/2;for(let e=0;e<i.length;e++)i[e].x=c,c+=s[e]+Y.legendItemGap;return i}var X={titleSize:18,titleWeight:600,axisTitleSize:15,axisTitleWeight:500,labelSize:14,labelWeight:400,legendSize:14,legendWeight:400,dotRadius:5,lineWidth:2.5,barRadius:8},Z={fontSize:15,fontWeight:500,height:32,padX:14,offsetY:12,rx:8,minY:4,pointerSize:6};function pr(e,t,n=`Inter`,r=!1,i=!1,a,o,s,c={}){let u=[],d=Math.max(0,...e.bars.map(e=>e.colorIndex),...e.lines.map(e=>e.colorIndex)),f=V((0,l.svgOpenTag)(e.width,e.height,t,r,o,s,void 0,c.styleAttribute).replace(`<svg `,`<svg data-xychart-colors="${d}" `),a);u.push(f),u.push((0,l.buildStyleBlock)(n,!1,c.nonce));let p=Math.max(...e.lines.map(e=>e.points.length),0),m=p>0&&p<=12,{style:h,defs:g}=mr(e,i,m,t.accent,t.bg,c.nonce);u.push(h),g&&u.push(g);let{plotArea:_}=e,v=e.xAxis.ticks.map(e=>e.x),y=e.horizontal?e.yAxis.ticks.map(e=>e.y):e.gridLines.map(e=>e.y1),b=v.length>1?Math.abs(v[1]-v[0]):_.width/6,x=y.length>1?Math.abs(y[1]-y[0]):_.height/6,S=b/Math.max(1,Math.round(b/20)),C=x/Math.max(1,Math.round(x/20)),w=v[0]??_.x,T=y[0]??_.y,E=w-Math.ceil((w-_.x)/S)*S,D=T-Math.ceil((T-_.y)/C)*C;for(let e=D;e<=_.y+_.height+.5;e+=C)for(let t=E;t<=_.x+_.width+.5;t+=S)u.push(`<circle cx="${Q(t)}" cy="${Q(e)}" r="1.5" class="xychart-grid"/>`);let O=[];for(let t of e.bars){let n=` data-value="${t.value}"${t.label?` data-label="${$(t.label)}"`:``}`,r=e.horizontal?gr(t.x,t.y,t.width,t.height,X.barRadius):hr(t.x,t.y,t.width,t.height,X.barRadius);if(u.push(`<path d="${r}" class="xychart-bar xychart-color-${t.colorIndex}"${n}/>`),i){let e=br(t.value),n=t.label?`${t.label}: ${e}`:e,r=yr(t.x+t.width/2,t.y,e);O.push(`<g class="xychart-bar-group"><rect x="${Q(t.x)}" y="${Q(t.y)}" width="${Q(t.width)}" height="${Q(t.height)}" fill="transparent"/><title>${$(n)}</title>`+r+`</g>`)}}for(let t of e.lines){if(t.points.length===0)continue;let e=_r(t.points);u.push(`<path d="${e}" class="xychart-line-shadow xychart-color-${t.colorIndex}" transform="translate(0,2)"/>`),u.push(`<path d="${e}" class="xychart-line xychart-color-${t.colorIndex}"/>`)}let k=[];if(i||m){let t=new Map;for(let n of e.legend)n.type===`line`&&t.set(n.seriesIndex,n.label);let n=new Map;for(let t of e.lines)for(let e of t.points){let r=Q(e.x),i=n.get(r)??[];n.set(r,i),i.push({x:e.x,y:e.y,value:e.value,label:e.label,seriesIndex:t.seriesIndex,colorIndex:t.colorIndex})}for(let e of n.values()){let n=e[0].x,r=e[0].label||``;if(i&&e.length>1){let i=Math.min(...e.map(e=>e.y)),a=Math.max(...e.map(e=>e.y)),o=X.dotRadius*3,s=`<rect x="${Q(n-o)}" y="${Q(i-o)}" width="${Q(o*2)}" height="${Q(a-i+o*2)}" fill="transparent" class="xychart-hit"/>`,c=e.map(e=>({text:br(e.value),legendLabel:t.get(e.seriesIndex)||`Line ${e.seriesIndex+1}`})),l=vr(n,i-X.dotRadius,r,c),u=c.map(e=>e.text),d=r?`${r}: ${u.join(` · `)}`:u.join(` · `),f=`<g class="xychart-dot-group">${s}`;for(let t of e){let e=` data-value="${t.value}"${t.label?` data-label="${$(t.label)}"`:``}`;f+=`<circle cx="${Q(t.x)}" cy="${Q(t.y)}" r="${X.dotRadius}" class="xychart-dot xychart-color-${t.colorIndex}"${e}/>`}f+=`<title>${$(d)}</title>${l}</g>`,k.push(f)}else if(i){let t=e[0],r=` data-value="${t.value}"${t.label?` data-label="${$(t.label)}"`:``}`,i=br(t.value),a=t.label?`${t.label}: ${i}`:i,o=yr(n,t.y-X.dotRadius,i),s=m?`<circle cx="${Q(n)}" cy="${Q(t.y)}" r="${X.dotRadius*3}" fill="transparent" class="xychart-hit"/>`:``;k.push(`<g class="xychart-dot-group">${s}<circle cx="${Q(t.x)}" cy="${Q(t.y)}" r="${X.dotRadius}" class="xychart-dot xychart-color-${t.colorIndex}"${r}/><title>${$(a)}</title>${o}</g>`)}else for(let t of e){let e=` data-value="${t.value}"${t.label?` data-label="${$(t.label)}"`:``}`;u.push(`<circle cx="${Q(t.x)}" cy="${Q(t.y)}" r="${X.dotRadius}" class="xychart-dot xychart-color-${t.colorIndex}"${e}/>`)}}}for(let t of e.xAxis.ticks)u.push(`<text x="${t.labelX}" y="${t.labelY}" text-anchor="${t.textAnchor}" font-size="${X.labelSize}" font-weight="${X.labelWeight}" dy="${F}" class="xychart-label">${$(t.label)}</text>`);for(let t of e.yAxis.ticks)u.push(`<text x="${t.labelX}" y="${t.labelY}" text-anchor="${t.textAnchor}" font-size="${X.labelSize}" font-weight="${X.labelWeight}" dy="${F}" class="xychart-label">${$(t.label)}</text>`);if(e.xAxis.title){let t=e.xAxis.title,n=t.rotate?` transform="rotate(${t.rotate},${t.x},${t.y})"`:``;u.push(`<text x="${t.x}" y="${t.y}" text-anchor="middle"${n} font-size="${X.axisTitleSize}" font-weight="${X.axisTitleWeight}" dy="${F}" class="xychart-axis-title">${$(t.text)}</text>`)}if(e.yAxis.title){let t=e.yAxis.title,n=t.rotate?` transform="rotate(${t.rotate},${t.x},${t.y})"`:``;u.push(`<text x="${t.x}" y="${t.y}" text-anchor="middle"${n} font-size="${X.axisTitleSize}" font-weight="${X.axisTitleWeight}" dy="${F}" class="xychart-axis-title">${$(t.text)}</text>`)}e.title&&u.push(`<text x="${e.title.x}" y="${e.title.y}" text-anchor="middle" font-size="${X.titleSize}" font-weight="${X.titleWeight}" dy="${F}" class="xychart-title">${$(e.title.text)}</text>`);for(let t of e.legend){if(t.type===`bar`)u.push(`<rect x="${t.x}" y="${t.y-7}" width="14" height="14" rx="3" class="xychart-bar xychart-color-${t.colorIndex}"/>`);else{let e=t.y;u.push(`<line x1="${t.x}" y1="${e}" x2="${t.x+14}" y2="${e}" stroke-width="${X.lineWidth}" stroke-linecap="round" class="xychart-legend-line xychart-color-${t.colorIndex}"/>`)}u.push(`<text x="${t.x+14+6}" y="${t.y}" text-anchor="start" font-size="${X.legendSize}" font-weight="${X.legendWeight}" dy="${F}" class="xychart-label">${$(t.label)}</text>`)}for(let e of O)u.push(e);for(let e of k)u.push(e);return u.push(`</svg>`),u.join(`
|
|
37
|
+
`)}function mr(e,t,n,r,i,a){let o=r??u.CHART_ACCENT_FALLBACK,s=new Set;for(let t of e.bars)s.add(t.colorIndex);for(let t of e.lines)s.add(t.colorIndex);let c=[];for(let e of[...s].sort((e,t)=>e-t)){let t=e===0?`var(--accent, ${u.CHART_ACCENT_FALLBACK})`:(0,u.getSeriesColor)(e,o,i);c.push(` --xychart-color-${e}: ${t};`),c.push(` --xychart-bar-fill-${e}: color-mix(in srgb, var(--bg) 75%, var(--xychart-color-${e}) 25%);`)}let d=[];for(let e of[...s].sort((e,t)=>e-t)){let t=`var(--xychart-color-${e})`;d.push(` .xychart-bar.xychart-color-${e} { stroke: ${t}; fill: var(--xychart-bar-fill-${e}); }`),d.push(` path.xychart-color-${e}, line.xychart-color-${e} { stroke: ${t}; }`),d.push(` circle.xychart-color-${e} { fill: ${t}; }`)}let f=t?`
|
|
38
38
|
.xychart-tip { opacity: 0; pointer-events: none; }
|
|
39
39
|
.xychart-tip-bg { fill: var(--_text); filter: drop-shadow(0 1px 3px color-mix(in srgb, var(--fg) 20%, transparent)); }
|
|
40
40
|
.xychart-tip-text { fill: var(--bg); font-size: ${Z.fontSize}px; font-weight: ${Z.fontWeight}; }
|
|
@@ -52,5 +52,6 @@ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});var e=Object.
|
|
|
52
52
|
.xychart-title { fill: var(--_text); }${p}
|
|
53
53
|
${d.join(`
|
|
54
54
|
`)}${f}
|
|
55
|
-
</style>`,defs:``}}function
|
|
55
|
+
</style>`,defs:``}}function hr(e,t,n,r,i){let a=Math.min(i,n/2,r/2);return a<=0?`M${Q(e)},${Q(t)} h${Q(n)} v${Q(r)} h${Q(-n)} Z`:[`M${Q(e)},${Q(t+a)}`,`Q${Q(e)},${Q(t)} ${Q(e+a)},${Q(t)}`,`L${Q(e+n-a)},${Q(t)}`,`Q${Q(e+n)},${Q(t)} ${Q(e+n)},${Q(t+a)}`,`L${Q(e+n)},${Q(t+r-a)}`,`Q${Q(e+n)},${Q(t+r)} ${Q(e+n-a)},${Q(t+r)}`,`L${Q(e+a)},${Q(t+r)}`,`Q${Q(e)},${Q(t+r)} ${Q(e)},${Q(t+r-a)}`,`Z`].join(` `)}function gr(e,t,n,r,i){let a=Math.min(i,n/2,r/2);return a<=0?`M${Q(e)},${Q(t)} h${Q(n)} v${Q(r)} h${Q(-n)} Z`:[`M${Q(e+a)},${Q(t)}`,`L${Q(e+n-a)},${Q(t)}`,`Q${Q(e+n)},${Q(t)} ${Q(e+n)},${Q(t+a)}`,`L${Q(e+n)},${Q(t+r-a)}`,`Q${Q(e+n)},${Q(t+r)} ${Q(e+n-a)},${Q(t+r)}`,`L${Q(e+a)},${Q(t+r)}`,`Q${Q(e)},${Q(t+r)} ${Q(e)},${Q(t+r-a)}`,`L${Q(e)},${Q(t+a)}`,`Q${Q(e)},${Q(t)} ${Q(e+a)},${Q(t)}`,`Z`].join(` `)}function _r(e){if(e.length===0)return``;if(e.length===1)return`M${Q(e[0].x)},${Q(e[0].y)}`;if(e.length===2)return`M${Q(e[0].x)},${Q(e[0].y)} L${Q(e[1].x)},${Q(e[1].y)}`;let t=e.length,n=[],r=[];for(let i=0;i<t-1;i++)n.push(e[i+1].x-e[i].x),r.push(n[i]===0?0:(e[i+1].y-e[i].y)/n[i]);let i=Array(t).fill(0);if(t>2){let e=Array(t).fill(0),a=Array(t).fill(0);for(let i=1;i<t-1;i++){let t=2*(n[i-1]+n[i]),o=3*(r[i]-r[i-1]);if(i===1)e[i]=n[i]/t,a[i]=o/t;else{let r=t-n[i-1]*e[i-1];e[i]=n[i]/r,a[i]=(o-n[i-1]*a[i-1])/r}}for(let n=t-2;n>=1;n--)i[n]=a[n]-e[n]*i[n+1]}let a=Array(t).fill(0);for(let e=0;e<t-1;e++)a[e]=r[e]-n[e]*(2*i[e]+i[e+1])/3;a[t-1]=r[t-2]+n[t-2]*i[t-2]/3;let o=`M${Q(e[0].x)},${Q(e[0].y)}`;for(let r=0;r<t-1;r++){let t=n[r]/3,i=e[r].x+t,s=e[r].y+a[r]*t,c=e[r+1].x-t,l=e[r+1].y-a[r+1]*t;o+=` C${Q(i)},${Q(s)} ${Q(c)},${Q(l)} ${Q(e[r+1].x)},${Q(e[r+1].y)}`}return o}function vr(e,t,n,r){let i=T(n,Z.fontSize,600),a=Math.max(...r.map(e=>{let t=T(e.legendLabel,Z.fontSize,Z.fontWeight),n=T(e.text,Z.fontSize,Z.fontWeight);return t+10+n})),o=Math.max(i,a)+Z.padX*2,s=26+r.length*20+6,c=Math.max(Z.minY,t-Z.offsetY-s-Z.pointerSize),l=e-o/2,u=e,d=c+s,f=Z.pointerSize,p=`<polygon points="${Q(u-f)},${Q(d)} ${Q(u+f)},${Q(d)} ${Q(u)},${Q(d+f)}" class="xychart-tip xychart-tip-ptr"/>`,m=`<rect x="${Q(l)}" y="${Q(c)}" width="${Q(o)}" height="${s}" rx="${Z.rx}" class="xychart-tip xychart-tip-bg"/>`;m+=p;let h=c+6+10;m+=`<text x="${Q(e)}" y="${Q(h)}" text-anchor="middle" font-weight="600" font-size="${Z.fontSize}" dy="${F}" class="xychart-tip xychart-tip-text">${$(n)}</text>`;let g=l+Z.padX,_=l+o-Z.padX;for(let e of r)h+=20,m+=`<text x="${Q(g)}" y="${Q(h)}" text-anchor="start" font-size="${Z.fontSize}" font-weight="${Z.fontWeight}" dy="${F}" class="xychart-tip xychart-tip-text">${$(e.legendLabel)}</text>`,m+=`<text x="${Q(_)}" y="${Q(h)}" text-anchor="end" font-size="${Z.fontSize}" font-weight="${Z.fontWeight}" dy="${F}" class="xychart-tip xychart-tip-text">${$(e.text)}</text>`;return m}function yr(e,t,n){let r=T(n,Z.fontSize,Z.fontWeight)+Z.padX*2,i=Z.height,a=Math.max(Z.minY,t-Z.offsetY-i-Z.pointerSize),o=e-r/2,s=e,c=a+i/2,l=e,u=a+i,d=Z.pointerSize,f=`<polygon points="${Q(l-d)},${Q(u)} ${Q(l+d)},${Q(u)} ${Q(l)},${Q(u+d)}" class="xychart-tip xychart-tip-ptr"/>`;return`<rect x="${Q(o)}" y="${Q(a)}" width="${Q(r)}" height="${i}" rx="${Z.rx}" class="xychart-tip xychart-tip-bg"/>`+f+`<text x="${Q(s)}" y="${Q(c)}" text-anchor="middle" dy="${F}" class="xychart-tip xychart-tip-text">${$(n)}</text>`}function br(e){return Number.isInteger(e)?e.toLocaleString(`en-US`):e.toFixed(+(Math.abs(e)<10))}function Q(e){return String(Math.round(e*10)/10)}function $(e){return e.replace(/&/g,`&`).replace(/</g,`<`).replace(/>/g,`>`).replace(/"/g,`"`)}function xr(e){let t=e.trim();return t.length>=2&&(t[0]===`"`&&t[t.length-1]===`"`||t[0]===`'`&&t[t.length-1]===`'`)?t.slice(1,-1):t}var Sr=`"graph <dir>"/"flowchart <dir>" (dir: TD, TB, LR, BT, RL), "stateDiagram-v2", "sequenceDiagram", "classDiagram", "erDiagram", "xychart-beta"`;function Cr(e){let t=e.trim().toLowerCase();if(/^sequence/.test(t))return`sequenceDiagram`;if(/^class/.test(t))return`classDiagram`;if(/^er/.test(t))return`erDiagram`;if(/^xychart/.test(t))return`xychart-beta`;if(/^state/.test(t))return`stateDiagram-v2`}var wr=/^(?:[\w-]+@)?<?(?:-{2,}|={2,}|-\.+-?|~{3,})/;function Tr(e){let t=[];for(let n of e)n.forEach((e,n)=>{if(n===0&&t.length>0&&wr.test(e.text)){let n=t[t.length-1];t[t.length-1]={text:`${n.text} ${e.text}`,line:n.line}}else t.push(e)});return t}function Er(e){let t=(0,l.extractInitConfig)(e.split(`
|
|
56
|
+
`).map(e=>e.trim())),n=Tr((0,l.splitStatementsByLine)(e));if(n.length===0)throw Error(`Empty mermaid diagram`);let r=n[0],i=/^stateDiagram(-v2)?\s*$/i.test(r.text)?Or(n):Dr(n);return i.initConfig=t,i}function Dr(e){let t=e[0];if(t===void 0)throw Error(`parseFlowchart called with no lines`);let n=t.text,r=n.match(/^(?:graph|flowchart)\s+(TD|TB|LR|BT|RL)\s*$/i);if(!r){let e=n.match(/^(?:graph|flowchart)\b\s*(.*)$/i);if(e){let r=e[1].trim();throw Error(r.length>0?`Line ${t.line}: Invalid direction "${r}" in header "${n}". Expected one of: TD, TB, LR, BT, RL.`:`Line ${t.line}: Missing direction in header "${n}". Expected e.g. "graph TD" or "flowchart LR" — one of: TD, TB, LR, BT, RL.`)}let r=Cr(n),i=r&&r.toLowerCase()!==n.trim().toLowerCase()?` Did you mean "${r}"?`:``;throw Error(`Line ${t.line}: Invalid mermaid header: "${n}".${i} Supported headers: ${Sr}.`)}let i={direction:(0,l.toDirection)(r[1]),nodes:new Map,edges:[],subgraphs:[],classDefs:new Map,classAssignments:new Map,nodeStyles:new Map,linkStyles:new Map,interactions:new Map},a=[];for(let t=1;t<e.length;t++){let n=e[t].text;if((0,l.tryApplyClassDef)(n,i)||(0,l.tryApplyClassAssignment)(n,i)||(0,l.tryApplyStyleStatement)(n,i))continue;if(/^click\s+/i.test(n)){Br(n,i);continue}if(Hr(n,i))continue;let r=n.match(/^linkStyle\s+(default|[\d,\s]+)\s+(.+)$/);if(r){let e=r[1].trim(),t=(0,l.parseStyleProps)(r[2]);if(e==="default")i.linkStyles.set(`default`,{...i.linkStyles.get(`default`),...t});else{let n=e.split(`,`).map(e=>parseInt(e.trim(),10));for(let e of n)isNaN(e)||i.linkStyles.set(e,{...i.linkStyles.get(e),...t})}continue}let o=n.match(/^direction\s+(TD|TB|LR|BT|RL)\s*$/i);if(o&&a.length>0){a[a.length-1].direction=(0,l.toDirection)(o[1]);continue}let s=n.match(/^subgraph\s+(.+)$/);if(s){let e=s[1].trim(),t=e.match(/^([^\s[]+)\s*\[(.+)\]$/),n,r;t?(n=t[1],r=(0,l.normalizeBrTags)(xr(t[2]))):(r=(0,l.normalizeBrTags)(xr(e)),n=r.replace(/\s+/g,`_`).replace(/[^\p{L}\p{N}_-]/gu,``));let i={id:n,label:r,nodeIds:[],children:[]};a.push(i);continue}if(n===`end`){let e=a.pop();e&&(a.length>0?a[a.length-1].children.push(e):i.subgraphs.push(e));continue}Kr(n,i,a)}return i}function Or(e){let t={direction:`TD`,nodes:new Map,edges:[],subgraphs:[],classDefs:new Map,classAssignments:new Map,nodeStyles:new Map,linkStyles:new Map,interactions:new Map},n=[],r=new Set,i=0,a=0;for(let o=1;o<e.length;o++){let s=e[o].text,c=s.match(/^direction\s+(TD|TB|LR|BT|RL)\s*$/i);if(c){n.length>0?n[n.length-1].direction=(0,l.toDirection)(c[1]):t.direction=(0,l.toDirection)(c[1]);continue}let u=s.match(/^linkStyle\s+(default|[\d,\s]+)\s+(.+)$/);if(u){let e=u[1].trim(),n=(0,l.parseStyleProps)(u[2]);if(e==="default")t.linkStyles.set(`default`,{...t.linkStyles.get(`default`),...n});else{let r=e.split(`,`).map(e=>parseInt(e.trim(),10));for(let e of r)isNaN(e)||t.linkStyles.set(e,{...t.linkStyles.get(e),...n})}continue}if(Hr(s,t))continue;let d=s.match(/^state\s+(?:"([^"]+)"\s+as\s+)?([\w\p{L}]+)\s*\{$/u);if(d){let e=d[1]??d[2],i=d[2],a={id:i,label:e,nodeIds:[],children:[]};n.push(a),r.add(i),t.nodes.delete(i);continue}if(s===`}`){let e=n.pop();e&&(n.length>0?n[n.length-1].children.push(e):t.subgraphs.push(e));continue}let f=s.match(/^state\s+"([^"]+)"\s+as\s+([\w\p{L}]+)\s*$/u);if(f){let e=(0,l.normalizeBrTags)(f[1]),r=f[2];kr(t,n,{id:r,label:e,shape:`rounded`});continue}let p=s.match(/^(\[\*\]|[\w\p{L}-]+)\s*(?:([\w-]+)@)?-->\s*(\[\*\]|[\w\p{L}-]+)(?:\s*:\s*(.+))?$/u);if(p){let e=p[1],o=p[2],s=p[3],c=p[4]?.trim(),u=c?(0,l.normalizeBrTags)(c):void 0;e===`[*]`?(i++,e=`_start${i>1?i:``}`,kr(t,n,{id:e,label:``,shape:`state-start`})):r.has(e)||Ar(t,n,e),s===`[*]`?(a++,s=`_end${a>1?a:``}`,kr(t,n,{id:s,label:``,shape:`state-end`})):r.has(s)||Ar(t,n,s),t.edges.push({source:e,target:s,label:u,style:`solid`,hasArrowStart:!1,hasArrowEnd:!0,...o===void 0?{}:{id:o}});continue}let m=s.match(/^([\w\p{L}-]+)\s*:\s*(.+)$/u);if(m){let e=m[1];kr(t,n,{id:e,label:(0,l.normalizeBrTags)(m[2].trim()),shape:`rounded`});continue}}return t}function kr(e,t,n){if(e.nodes.has(n.id)||e.nodes.set(n.id,n),t.length>0){let e=t[t.length-1];e.nodeIds.includes(n.id)||e.nodeIds.push(n.id)}}function Ar(e,t,n){if(!e.nodes.has(n))kr(e,t,{id:n,label:n,shape:`rounded`});else if(t.length>0){let e=t[t.length-1];e.nodeIds.includes(n)||e.nodeIds.push(n)}}var jr=/^(<|o|x)?(-{2,}|={2,}|-\.+-|~{3,})(>|o|x)?(?:\|([^|]*)\|)?/,Mr=new Set([`--`,`==`]);function Nr(e){if(e===`o`)return`circle`;if(e===`x`)return`cross`}var Pr=/^(<|o|x)?(--|-\.|==)\s+(.+?)\s+(-{2,}[>ox]|={2,}[>ox]|\.+-[>ox]|-{3,}|={3,}|-\.+-)/,Fr=[{regex:/^([\w\p{L}-]+)\(\(\(((?:"[^"]*"|(?!\)\)\)).)+)\)\)\)/u,shape:`doublecircle`},{regex:/^([\w\p{L}-]+)\(\[((?:"[^"]*"|(?!\]\)).)+)\]\)/u,shape:`stadium`},{regex:/^([\w\p{L}-]+)\(\(((?:"[^"]*"|(?!\)\)).)+)\)\)/u,shape:`circle`},{regex:/^([\w\p{L}-]+)\[\[((?:"[^"]*"|(?!\]\]).)+)\]\]/u,shape:`subroutine`},{regex:/^([\w\p{L}-]+)\[\(((?:"[^"]*"|(?!\)\]).)+)\)\]/u,shape:`cylinder`},{regex:/^([\w\p{L}-]+)\[\/((?:"[^"]*"|(?![\\/]\]).)+)([\\/])\]/u,shape:e=>e===`\\`?`trapezoid`:`parallelogram`},{regex:/^([\w\p{L}-]+)\[\\((?:"[^"]*"|(?![\\/]\]).)+)([\\/])\]/u,shape:e=>e===`/`?`trapezoid-alt`:`parallelogram-alt`},{regex:/^([\w\p{L}-]+)>((?:"[^"]*"|(?!\]).)+)\]/u,shape:`asymmetric`},{regex:/^([\w\p{L}-]+)\{\{((?:"[^"]*"|(?!\}\}).)+)\}\}/u,shape:`hexagon`},{regex:/^([\w\p{L}-]+)\[((?:"[^"]*"|(?!\]).)+)\]/u,shape:`rectangle`},{regex:/^([\w\p{L}-]+)\(((?:"[^"]*"|(?!\)).)+)\)/u,shape:`rounded`},{regex:/^([\w\p{L}-]+)\{((?:"[^"]*"|(?!\}).)+)\}/u,shape:`diamond`}],Ir=/^([\w\p{L}]+(?:-[\w\p{L}]+)*)/u,Lr=/^([\w\p{L}-]+)(?=@\{)/u;function Rr(e){if(e.shape)return(0,u.resolveShapeName)(e.shape)??`rectangle`;if(e.icon!==void 0||e.img!==void 0)switch(e.form?.toLowerCase()){case`circle`:return`circle`;case`rounded`:return`rounded`;default:return`rectangle`}return`rectangle`}function zr(e,t){return t.label!==void 0&&t.label.length>0?t.label:t.icon?t.icon:t.img?t.img:e}function Br(e,t){(0,l.applyClickStatement)(e,t.interactions)}var Vr=/^([\w-]+)(?=@\{)/;function Hr(e,t){let n=e.match(Vr);if(!n||!t.edges.some(e=>e.id===n[1]))return!1;let r=(0,u.matchExpandedBlock)(e.slice(n[1].length));return r?(Ur(t,n[1],(0,u.parseExpandedMeta)(r.body)),!0):!1}function Ur(e,t,n){for(let r of e.edges)r.id===t&&(n.animate!==void 0&&(r.animate=n.animate.toLowerCase()!==`false`),n.animation!==void 0&&(r.animate=!0))}var Wr=/^:::([\w][\w-]*)/,Gr=/^([\w\p{L}-]+):::([\w][\w-]*)/u;function Kr(e,t,n){let r=e.trim(),i=qr(r,t,n);if(!i||i.ids.length===0)return;r=i.remaining.trim();let a=i.ids;for(;r.length>0;){let e,i,o,s,c,u,d,f=r.match(/^([\w-]+)@(?=[-=<~ox])/);f&&(d=f[1],r=r.slice(f[0].length));let p=r.match(jr),m=p?.[2],h=p?.[1],g=p?.[3];if(p&&m!==void 0&&!(h===void 0&&g===void 0&&Mr.has(m))){e=h!==void 0,c=Nr(h);let t=p[4]?.trim();s=t?(0,l.normalizeBrTags)(t):void 0,r=r.slice(p[0].length).trim(),i=Zr(m),o=g!==void 0,u=Nr(g)}else{let t=r.match(Pr);if(!t)break;e=!!t[1],c=Nr(t[1]);let n=t[3].trim();s=n?(0,l.normalizeBrTags)(n):void 0;let a=t[2],d=t[4];r=r.slice(t[0].length).trim(),i=Qr(a,d),u=Nr(d.slice(-1)),o=d.endsWith(`>`)||u!==void 0}let _=qr(r,t,n);if(!_||_.ids.length===0)break;r=_.remaining.trim();for(let n of a)for(let r of _.ids)t.edges.push({source:n,target:r,label:s,style:i,hasArrowStart:e,hasArrowEnd:o,...c===void 0?{}:{startMarker:c},...u===void 0?{}:{endMarker:u},...d===void 0?{}:{id:d}});a=_.ids}}function qr(e,t,n){let r=Jr(e,t,n);if(!r)return null;let i=[r.id],a=r.remaining.trim();for(;a.startsWith(`&`);){a=a.slice(1).trim();let e=Jr(a,t,n);if(!e)break;i.push(e.id),a=e.remaining.trim()}return{ids:i,remaining:a}}function Jr(e,t,n){let r=null,i=e,a,o=i.match(Gr);o&&(a=o[2],i=o[1]+i.slice(o[0].length));let s=i.match(Lr);if(s){let e=s[1],a=(0,u.matchExpandedBlock)(i.slice(e.length));if(a){let o=(0,u.parseExpandedMeta)(a.body);Yr(t,n,{id:e,label:(0,l.normalizeBrTags)(zr(e,o)),shape:Rr(o)}),r=e,i=i.slice(e.length+a.length)}}if(r===null)for(let{regex:e,shape:a}of Fr){let o=i.match(e);if(o){r=o[1];let e=(0,l.normalizeBrTags)(o[2]),s=typeof a==`function`?a(o[3]??``):a;Yr(t,n,{id:r,label:e,shape:s}),i=i.slice(o[0].length);break}}if(r===null){let e=i.match(Ir);e&&(r=e[1],t.nodes.has(r)||Yr(t,n,{id:r,label:r,shape:`rectangle`}),i=i.slice(e[0].length))}if(r===null)return null;a&&t.classAssignments.set(r,a);let c=i.match(Wr);return c&&(t.classAssignments.set(r,c[1]),i=i.slice(c[0].length)),{id:r,remaining:i}}function Yr(e,t,n){e.nodes.has(n.id)||e.nodes.set(n.id,n),Xr(t,n.id)}function Xr(e,t){if(e.length>0){let n=e[e.length-1];n.nodeIds.includes(t)||n.nodeIds.push(t)}}function Zr(e){return e.startsWith(`~`)?`invisible`:e.includes(`.`)?`dotted`:e.startsWith(`=`)?`thick`:`solid`}function Qr(e,t){return e.includes(`.`)||t.includes(`.`)?`dotted`:e.startsWith(`=`)||t.startsWith(`=`)?`thick`:`solid`}var $r={type:`xychart`,parse:u.parseXYChart,layoutForSvg:nr,renderSvg(e,t,n){let r=n.interactivity===void 0?n.interactive??!1:n.interactivity===`full`;return pr(e,t.colors,t.font,t.transparent,r,t.embedSource,t.title,t.decorative,t.emit)}},ei={type:`sequence`,parse:u.parseSequenceDiagram,layoutForSvg:Un,renderSvg(e,t){return Wn(e,t.colors,t.font,t.transparent,t.fontSizes,t.embedSource,t.title,t.decorative,t.emit)}};function ti(e){return(e.interactivity??`static`)!==`none`}function ni(e){return(e.interactivity??`static`)===`full`}var ri={type:`class`,parse:u.parseClassDiagram,layoutForSvg:mn,renderSvg(e,t,n){return _n(e,t.colors,t.font,t.transparent,t.fontSizes,t.embedSource,t.title,t.decorative,ti(n),t.emit)}},ii={xychart:$r,er:{type:`er`,parse:u.parseErDiagram,layoutForSvg(e,t){return jn((0,l.withDirectionOverride)(e,t.direction),t)},renderSvg(e,t){return Mn(e,t.colors,t.font,t.transparent,t.fontSizes,t.embedSource,t.title,t.decorative,t.emit)}},sequence:ei,class:ri,flowchart:{type:`flowchart`,parse:(e,t)=>Er(t),layoutForSvg(e,t){return{graph:Ze((0,l.withDirectionOverride)(e,t.direction),t),curve:t.curve??e.initConfig?.curve??`linear`}},renderSvg(e,t,n){return $e(e.graph,t.colors,t.font,t.transparent,t.fontSizes,e.curve,t.embedSource,ni(n),ti(n),t.title,t.decorative,t.emit)}}};function ai(e){return{bg:e.bg??l.DEFAULTS.bg,fg:e.fg??l.DEFAULTS.fg,line:e.line,accent:e.accent,muted:e.muted,surface:e.surface,border:e.border}}function oi(e={}){return(0,l.themeStyleDeclarations)(ai(e),e.transparent)}function si(e){return{nonce:e.nonce,styleAttribute:e.styleAttribute}}function ci(e,t={}){let n=li(e,t);return t.resolveColors?ln(n,ai(t)):n}function li(e,t){let n=(0,d.decodeXML)(e),r=ai(t),i=t.font??`Inter`;(0,l.setMonospaceMetrics)((0,l.isMonospaceFont)(i));let a=t.transparent??!1,o=A(t.fontSizes),s=(0,l.detectDiagramType)(n),c=t.embedSource?e:void 0,u=t.title,f=t.decorative,p=si(t),m=(0,l.splitStatements)(n),h=ii[s],g=h.parse(m,n),_=h.layoutForSvg(g,t),v={colors:r,font:i,transparent:a,fontSizes:o,embedSource:c,title:u,decorative:f,emit:p};return h.renderSvg(_,v,t)}async function ui(e,t={}){return ci(e,t)}var di=ci,fi=ui;exports.ARROW_HEAD=I,exports.CLS=U,exports.ELK_DIRECTION_FALLBACK=ee,exports.FONT_SIZES=k,exports.FONT_WEIGHTS=j,exports.GROUP_HEADER_CONTENT_PAD=M,exports.INLINE_CENTERED_EDGE_LABEL=ie,exports.MONO_FONT=D,exports.MONO_FONT_STACK=O,exports.NODE_PADDING=N,exports.STROKE_WIDTHS=P,exports.TEXT_BASELINE_SHIFT=F,exports.baseElkLayoutOptions=re,exports.boxLabelHeight=Vn,exports.buildElkEdge=z,exports.buildElkEdgeLabel=ae,exports.buildElkLeafNode=R,exports.classNoteId=un,exports.clipEdgeToShape=be,exports.convertToElkFormat=Qe,exports.createLayoutCache=x,exports.directionToElk=te,exports.elkLayoutSync=w,exports.elkPadding=ne,exports.estimateMonoTextWidth=E,exports.estimateTextWidth=T,exports.evaluateCssColorValue=nn,exports.extractEdgeLabelPosition=je,exports.extractEdgePoints=Ae,exports.layoutClassDiagramSync=mn,exports.layoutErDiagramSync=jn,exports.layoutGraphSync=Ze,exports.layoutSequenceDiagram=Un,exports.layoutXYChart=nr,exports.pointsToPath=_,exports.renderClassSvg=_n,exports.renderErSvg=Mn,exports.renderMermaid=fi,exports.renderMermaidSVG=ci,exports.renderMermaidSVGAsync=ui,exports.renderMermaidSync=di,exports.renderSequenceSvg=Wn,exports.renderSvg=$e,exports.renderXYChartSvg=pr,exports.resolveCssColors=ln,exports.resolveFontSizes=A,exports.themeCssVariables=oi,exports.withDataSrc=V;
|
|
56
57
|
//# sourceMappingURL=index.cjs.map
|