livebook/static/assets/stateDiagram-GNSP7T6Y-XLPHEHPO.js

2 lines
11 KiB
JavaScript
Raw Permalink Normal View History

2024-11-21 18:56:42 +08:00
import{a as U,c as E,d as F}from"./chunk-VWDTCB2M.js";import"./chunk-3JJH2D3F.js";import"./chunk-WXHYUPIN.js";import"./chunk-BOD4ZWPQ.js";import"./chunk-24CS6DUF.js";import"./chunk-YJYNUSAM.js";import"./chunk-5JJWRCP3.js";import"./chunk-E34HJRR4.js";import"./chunk-MCENFELV.js";import{a as P}from"./chunk-RVGDP346.js";import{a as G}from"./chunk-6IOWLTMD.js";import{m as C}from"./chunk-HFFTYNMA.js";import"./chunk-XHGORZV2.js";import{Fa as R,Ja as W,N as T,O as A,Z as t,h as u,ia as z,j as S}from"./chunk-3QLLRM5L.js";import"./chunk-WYMAA4MH.js";import"./chunk-SISR4MA5.js";import"./chunk-24JW6VB3.js";import"./chunk-MGYUK2XN.js";var _={},Y=u((e,i)=>{_[e]=i},"set"),I=u(e=>_[e],"get"),X=u(()=>Object.keys(_),"keys"),$=u(()=>X().length,"size"),q={get:I,set:Y,keys:X,size:$},Z=u(e=>e.append("circle").attr("class","start-state").attr("r",t().state.sizeUnit).attr("cx",t().state.padding+t().state.sizeUnit).attr("cy",t().state.padding+t().state.sizeUnit),"drawStartState"),j=u(e=>e.append("line").style("stroke","grey").style("stroke-dasharray","3").attr("x1",t().state.textHeight).attr("class","divider").attr("x2",t().state.textHeight*2).attr("y1",0).attr("y2",0),"drawDivider"),K=u((e,i)=>{let s=e.append("text").attr("x",2*t().state.padding).attr("y",t().state.textHeight+2*t().state.padding).attr("font-size",t().state.fontSize).attr("class","state-title").text(i.id),o=s.node().getBBox();return e.insert("rect",":first-child").attr("x",t().state.padding).attr("y",t().state.padding).attr("width",o.width+2*t().state.padding).attr("height",o.height+2*t().state.padding).attr("rx",t().state.radius),s},"drawSimpleState"),Q=u((e,i)=>{let s=u(function(l,y,m){let k=l.append("tspan").attr("x",2*t().state.padding).text(y);m||k.attr("dy",t().state.textHeight)},"addTspan"),n=e.append("text").attr("x",2*t().state.padding).attr("y",t().state.textHeight+1.3*t().state.padding).attr("font-size",t().state.fontSize).attr("class","state-title").text(i.descriptions[0]).node().getBBox(),h=n.height,p=e.append("text").attr("x",t().state.padding).attr("y",h+t().state.padding*.4+t().state.dividerMargin+t().state.textHeight).attr("class","state-description"),a=!0,d=!0;i.descriptions.forEach(function(l){a||(s(p,l,d),d=!1),a=!1});let w=e.append("line").attr("x1",t().state.padding).attr("y1",t().state.padding+h+t().state.dividerMargin/2).attr("y2",t().state.padding+h+t().state.dividerMargin/2).attr("class","descr-divider"),x=p.node().getBBox(),c=Math.max(x.width,n.width);return w.attr("x2",c+3*t().state.padding),e.insert("rect",":first-child").attr("x",t().state.padding).attr("y",t().state.padding).attr("width",c+2*t().state.padding).attr("height",x.height+h+2*t().state.padding).attr("rx",t().state.radius),e},"drawDescrState"),V=u((e,i,s)=>{let o=t().state.padding,n=2*t().state.padding,h=e.node().getBBox(),p=h.width,a=h.x,d=e.append("text").attr("x",0).attr("y",t().state.titleShift).attr("font-size",t().state.fontSize).attr("class","state-title").text(i.id),x=d.node().getBBox().width+n,c=Math.max(x,p);c===p&&(c=c+n);let l,y=e.node().getBBox();i.doc,l=a-o,x>p&&(l=(p-c)/2+o),Math.abs(a-y.x)<o&&x>p&&(l=a-(x-p)/2);let m=1-t().state.textHeight;return e.insert("rect",":first-child").attr("x",l).attr("y",m).attr("class",s?"alt-composit":"composit").attr("width",c).attr("height",y.height+t().state.textHeight+t().state.titleShift+1).attr("rx","0"),d.attr("x",l+o),x<=p&&d.attr("x",a+(c-n)/2-x/2+o),e.insert("rect",":first-child").attr("x",l).attr("y",t().state.titleShift-t().state.textHeight-t().state.padding).attr("width",c).attr("height",t().state.textHeight*3).attr("rx",t().state.radius),e.insert("rect",":first-child").attr("x",l).attr("y",t().state.titleShift-t().state.textHeight-t().state.padding).attr("width",c).attr("height",y.height+3+2*t().state.textHeight).attr("rx",t().state.radius),e},"addTitleAndBox"),tt=u(e=>(e.append("circle").attr("class","end-state-outer").attr("r",t().state.sizeUnit+t().state.miniPadding).attr("cx",t().state.padding+t().state.sizeUnit+t().state.miniPadding).attr("cy",t().state.padding+t().state.sizeUnit+t().state.miniPadding),e.append("circle").at