mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-07-21 15:55:36 +08:00
3 lines
116 KiB
JavaScript
3 lines
116 KiB
JavaScript
|
|
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/chunks/sizeCapture-X5ZJPWSS.CaGFXDCM.js","assets/chunks/mermaid.core.TSSz6aZW.js","assets/chunks/framework.C2AwuPrQ.js"])))=>i.map(i=>d[i]);
|
||
|
|
import{W as Er}from"./framework.C2AwuPrQ.js";import{c as Tr}from"./chunk-RYQCIY6F.DF2IyMF4.js";import{am as wr,an as Ar,ao as Rr,ap as Nr,l as Ke,c as Or,ag as Pr,af as Br,ah as kr,at as _r,av as Fr,_ as d,z as Dr,as as Hr,aw as Xr,y as Oe,ax as Ye,ay as Ao}from"./mermaid.core.TSSz6aZW.js";import{G as Yr}from"./graph.BvS0Xx32.js";import"./map.DsahiwlY.js";async function _o(t,e){const n=new Yr({multigraph:!0,compound:!0}),o=[...e.edges],s=Or(),r=t.insert("g").attr("class","root"),i=r.insert("g").attr("class","clusters"),c=r.insert("g").attr("class","edges edgePath"),a=r.insert("g").attr("class","edgeLabels"),l=r.insert("g").attr("class","nodes"),g=new Map,x=t.node()!=null;await Promise.all(e.nodes.map(async I=>{if(I.isGroup)n.setNode(I.id,{...I});else{if(x){const u=await Pr(l,I,{config:s,dir:I.dir}),p=u.node()?.getBBox()??{width:0,height:0};g.set(I.id,u),I.width=p.width,I.height=p.height}n.setNode(I.id,{...I})}}));for(const I of o)n.setEdge(I.start,I.end,{...I},I.id),e.edges.some(p=>p.id===I.id)||e.edges.push(I);if(globalThis.mermaidCaptureSizes){const{captureNodeSizes:I}=await Er(async()=>{const{captureNodeSizes:u}=await import("./sizeCapture-X5ZJPWSS.CaGFXDCM.js");return{captureNodeSizes:u}},__vite__mapDeps([0,1,2]));I(t,e)}return{graph:n,groups:{clusters:i,edgePaths:c,edgeLabels:a,nodes:l,rootGroups:r},nodeElements:g}}d(_o,"createGraphWithElements");var Ro=5,Ge=1e-5,$e=1e-6;function qe(t){const e=[];for(let n=0;n<t.length-1;n++)e.push({a:t[n],b:t[n+1]});return e}d(qe,"buildSegmentList");function Fo(t,e,n,o){const s=e.x-t.x,r=e.y-t.y,i=o.x-n.x,c=o.y-n.y,a=s*c-r*i;if(a===0)return null;const l=n.x-t.x,g=n.y-t.y,x=(l*c-g*i)/a,I=(l*r-g*s)/a;return x<=$e||x>=1-$e||I<=$e||I>=1-$e?null:{point:{x:t.x+x*s,y:t.y+x*r},tA:x,tB:I}}d(Fo,"segmentIntersection");function vn(t){return Math.abs(t.b.x-t.a.x)>=Math.abs(t.b.y-t.a.y)}d(vn,"isHorizontalSeg");function Do(t){const e=[];for(let n=0;n<t.length;n++){const o=t[n],s=qe(o.points);for(let r=n+1;r<t.length;r++){const i=t[r],c=qe(i.points);for(const[a,l]of s.entries())for(const[g,x]of c.entries()){const I=Fo(l.a,l.b,x.a,x.b);if(!I)continue;const u=vn(l),p=vn(x);(u!==p?u:!1)?e.push({jumpEdgeId:o.id,otherEdgeId:i.id,segIndex:a,t:I.tA,point:I.point}):e.push({jumpEdgeId:i.id,otherEdgeId:o.id,segIndex:g,t:I.tB,point:I.point})}}}return e}d(Do,"findEdgeIntersections");function re(t){const e=Math.round(t*1e3)/1e3;return Number.isInteger(e)?`${e}`:`${e}`}d(re,"fmt");function we(t){return`${re(t.x)},${re(t.y)}`}d(we,"pointToString");function Ho(t){const e=t.b.x-t.a.x,n=t.b.y-t.a.y;return Math.abs(e)>=Math.abs(n)?e>=0?1:0:n>=0?1:0}d(Ho,"getArcSweepFlag");var Gr=.001;function Xo(t,e){if(t.length<2)return t.map(r=>({...r}));const n=t.map(r=>({...r})),o=e.arrowTypeStart&&Ao[e.arrowTypeStart];if(o){const r=t[0],i=t[1],c=Math.atan2(i.y-r.y,i.x-r.x);n[0].x=r.x+o*Math.cos(c),n[0].y=r.y+o*Math.sin(c)}const s=e.arrowTypeEnd&&Ao[e.arrowTypeEnd];if(s){const r=t.length,i=t[r-2],c=t[r-1],a=Math.atan2(c.y-i.y,c.x-i.x);n[r-1].x=c.x-s*Math.cos(a),n[r-1].y=c.y-s*Math.sin(a)}return n}d(Xo,"applyMarkerOffsets");function Yo(t,e,n,o,s){const r=t.point.x,i=t.point.y,c={x:r-e*t.r,y:i-n*t.r},a={x:r+e*t.r,y:i+n*t.r},l=[`L${we(c)}`];return s==="arc"?l.push(`A${re(t.r)},${re(t.r)} 0 0 ${o} ${we(a)}`):l.push(`M${we(a)}`),l}d(Yo,"emitJump");function Ln(t,e,n,o){const s=e.x-t.x,r=e.y-t.y,i=n.x-e.x,c=n.y-e.y,a=Math.hypot(s,r),l=Math.hypot(i,c);if(a<Ge||l<Ge)return null;const g=s/a,x=r/a,I=i/l,u=c/l,p=g*I+x*u,f=Math.max(-1,Math.min(1,p)),y=Math.acos(f);if(y<Ge||Math.abs(Math.PI-y)<Ge)return null;const v=Math.min(o/Math.sin(y/2),a/2,l/2);return{startX:e.x-g*v,startY:e.y-x*v,endX:e.x+I*v,endY:e.y+u*v,ctrlX:e.x,ctrlY:e.y,cutLen:v}}d(Ln,"computeRoundedCorner");function Go(t,e,n){const o=t.points;if(o.length<2)return"";const s=Xo(o,t),r=t.curve==="rounded",i=qe(s),c=new Map;for(const l of e){const g=i[l.segIndex];if(!g)continue;const x=Math.hypot(g.b.x-g.a.x,g.b.y-g.a.y),I=c.get(l.segIndex)??[];I.push({t:l.t,point:l.point,d:l.t*x,r:n.jumpRadius}),c.set(l.segIndex,I)}const a=[`M${we(s[0])}`];for(let l=0;l<i.length;l++){const g=i[l],x=
|