orbitchat 2.4.0 → 2.5.1
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/dist/assets/_baseUniq-BPMphbq5-Ci3F4c-i.js +1 -0
- package/dist/assets/{api-CbnJQJEM.js → api-CtfRLc4F.js} +1 -1
- package/dist/assets/arc-D9rhTKV0-CroREmq6.js +1 -0
- package/dist/assets/architectureDiagram-VXUJARFQ-BiqZtsDe-DyrE6YO2.js +36 -0
- package/dist/assets/{blockDiagram-VD42YOAC-D-In4h7h-GR2X5iHE.js → blockDiagram-VD42YOAC-zcRIdFTD-Cs5m0yBo.js} +5 -5
- package/dist/assets/{c4Diagram-YG6GDRKO-DBs8r9gh-Du7LWYZ4.js → c4Diagram-YG6GDRKO-DYXNcDX4-DN_-dJAG.js} +3 -3
- package/dist/assets/channel-CUIutAfm-J8R0v6QY.js +1 -0
- package/dist/assets/{chunk-4BX2VUAB-BqD7w0AR-D7c6nLrg.js → chunk-4BX2VUAB-DAh9ktmY-DJUd7iky.js} +1 -1
- package/dist/assets/chunk-55IACEB6-Cza7pcpr-CsIEdvZL.js +1 -0
- package/dist/assets/{chunk-B4BG7PRW-Dwma1pSy-DAvzfXmN.js → chunk-B4BG7PRW-BTUSpeKy-C84_H2ja.js} +4 -4
- package/dist/assets/{chunk-DI55MBZ5-BY2XXvZz-qqVfAJBd.js → chunk-DI55MBZ5-DKt4WII7-DidpEj2B.js} +3 -3
- package/dist/assets/{chunk-FMBD7UC4-BeiLbQ8U-TxIYeXcv.js → chunk-FMBD7UC4-DdcCR8w3-BfMdoImH.js} +1 -1
- package/dist/assets/chunk-QN33PNHL-v6AkzOl1-BYUBLlie.js +1 -0
- package/dist/assets/{chunk-QZHKN3VN-Cwlo2qTG-Br1Vb3wS.js → chunk-QZHKN3VN-DVJOrqBZ-CMUptYKe.js} +1 -1
- package/dist/assets/chunk-TZMSLE5B-G2jJHqli-DMA5IQKp.js +1 -0
- package/dist/assets/classDiagram-2ON5EDUG-CxmgTanh-sy4W7YBV.js +1 -0
- package/dist/assets/classDiagram-v2-WZHVMYZB-CxmgTanh-sy4W7YBV.js +1 -0
- package/dist/assets/clone-CsNB4mMi-CjijztFi.js +1 -0
- package/dist/assets/{cose-bilkent-S5V4N54A-DKeVcPDK-DTZgjEVH.js → cose-bilkent-S5V4N54A-BRr2Y6dg-BApR6rBr.js} +1 -1
- package/dist/assets/dagre-6UL2VRFP-DX8gNHmJ-COuhp_WH.js +4 -0
- package/dist/assets/diagram-PSM6KHXK-DNX818To-DZwizlXL.js +24 -0
- package/dist/assets/diagram-QEK2KX5R-BDO6hKtm-TIVfhOXf.js +43 -0
- package/dist/assets/diagram-S2PKOQOG-IEqaDwzi-CKibEs0x.js +24 -0
- package/dist/assets/{erDiagram-Q2GNP2WA-DgUeO5_h-2MbueKw6.js → erDiagram-Q2GNP2WA-DbLpN8Jp-Be1aw4xN.js} +4 -4
- package/dist/assets/{flowDiagram-NV44I4VS-C5HQUzU9-BqSPI961.js → flowDiagram-NV44I4VS-pJlHae8Y-DbXF_vZM.js} +1 -1
- package/dist/assets/{ganttDiagram-JELNMOA3-DgSZ1ixF-Cd65CEcG.js → ganttDiagram-JELNMOA3-J0Tkq5TR-Dea0K9q1.js} +4 -4
- package/dist/assets/gitGraphDiagram-NY62KEGX-DgYonpsZ-7lxSMqF0.js +65 -0
- package/dist/assets/graph-BpcfrHXY-BH81qtTI.js +1 -0
- package/dist/assets/index-CS9omSqb.js +978 -0
- package/dist/assets/{index-BAOVR-xx-DqKeffaZ.js → index-DvNpGWs7-Dgb0lDIY.js} +1 -1
- package/dist/assets/infoDiagram-WHAUD3N6-C3JLOAnb-D99rN4Tp.js +2 -0
- package/dist/assets/{journeyDiagram-XKPGCS4Q-DXjg3S3r-eYE1OR5w.js → journeyDiagram-XKPGCS4Q-CfjB2Qdf-wB3u3y_Q.js} +4 -4
- package/dist/assets/{kanban-definition-3W4ZIXB7-Uxt7Am6n-DX9mrPkG.js → kanban-definition-3W4ZIXB7-CrW8yVmd-CQRjSMnx.js} +8 -8
- package/dist/assets/layout-bsfAhWjc-xFXmwmRe.js +1 -0
- package/dist/assets/min-C2aDz5ZK-B9D8sW79.js +1 -0
- package/dist/assets/{mindmap-definition-VGOIOE7T-DXwVuAPE-qJmCP82W.js → mindmap-definition-VGOIOE7T-Dj37RkY_-DyDCU6bd.js} +5 -5
- package/dist/assets/pieDiagram-ADFJNKIX-BiQvDx8I-Ba7lEuym.js +30 -0
- package/dist/assets/{quadrantDiagram-AYHSOK5B-CnLDz007-CrMOvsDe.js → quadrantDiagram-AYHSOK5B-D4b-YFzI-DdkdBS88.js} +5 -5
- package/dist/assets/{requirementDiagram-UZGBJVZJ-rDaI-8Be-Dy8GQT4v.js → requirementDiagram-UZGBJVZJ-km07nlVd-p1bGk1YD.js} +3 -3
- package/dist/assets/sankeyDiagram-TZEHDZUN-LfuSRRbf-CViEN22a.js +10 -0
- package/dist/assets/{sequenceDiagram-WL72ISMW-BFF7TtP7-tTa5Tkld.js → sequenceDiagram-WL72ISMW-CQ4J-0_7-BdxRbQ7B.js} +13 -13
- package/dist/assets/stateDiagram-FKZM4ZOC-JtogJwt6-Bwfh0qFf.js +1 -0
- package/dist/assets/stateDiagram-v2-4FDKWEC3-DuQ7UaeU-DOrYQe5I.js +1 -0
- package/dist/assets/{timeline-definition-IT6M3QCI-5W361ZNm-V6nC7b9u.js → timeline-definition-IT6M3QCI-Cs3NnF2M-DkWnrDas.js} +7 -7
- package/dist/assets/treemap-KMMF4GRG-CkW25-tn-CpmtOl1S.js +128 -0
- package/dist/assets/{xychartDiagram-PRI3JC2R-CSr0GxaP-DbqnMlyT.js → xychartDiagram-PRI3JC2R-JzAaXa5z-qm9b5yhA.js} +4 -4
- package/dist/index.html +1 -1
- package/package.json +2 -2
- package/dist/assets/_basePickBy-C3-QE0dl-D2KUXyib.js +0 -1
- package/dist/assets/_baseUniq-CstiM9Lp-BxKGgzMp.js +0 -1
- package/dist/assets/arc-W3NKKXLI-CfOX_Ovy.js +0 -1
- package/dist/assets/architectureDiagram-VXUJARFQ-zzJsgPC6-oUVgC3W6.js +0 -36
- package/dist/assets/channel-RBWQyMSg-BfU0bkWQ.js +0 -1
- package/dist/assets/chunk-55IACEB6-D8pvDVEJ-BT10lsq5.js +0 -1
- package/dist/assets/chunk-QN33PNHL-BkO3hOeq-DLIk9U3l.js +0 -1
- package/dist/assets/chunk-TZMSLE5B-BnXK-OiF-CaOoC40G.js +0 -1
- package/dist/assets/classDiagram-2ON5EDUG-Crd6O69V-C_lVvtqK.js +0 -1
- package/dist/assets/classDiagram-v2-WZHVMYZB-Crd6O69V-C_lVvtqK.js +0 -1
- package/dist/assets/clone-CfLgyC8S-fIbAizoc.js +0 -1
- package/dist/assets/dagre-6UL2VRFP-BPf604Df-BB0DffH3.js +0 -4
- package/dist/assets/diagram-PSM6KHXK-DeLcpEV3-cHjtjsFW.js +0 -24
- package/dist/assets/diagram-QEK2KX5R-C_5RR1NJ-Dm-vaEcT.js +0 -43
- package/dist/assets/diagram-S2PKOQOG-DVx43aon-CE0TwLpI.js +0 -24
- package/dist/assets/gitGraphDiagram-NY62KEGX-DY5loT9K-DxvoN3QM.js +0 -65
- package/dist/assets/graph-BfwqPHx6-CDekYJCb.js +0 -1
- package/dist/assets/index-DgEaSYFR.js +0 -1234
- package/dist/assets/infoDiagram-WHAUD3N6-DIqQ6vCk-BniEsISH.js +0 -2
- package/dist/assets/layout-CSfkE668-cyqcCl0f.js +0 -1
- package/dist/assets/pieDiagram-ADFJNKIX-Cj0EHHtj-BQAmETkM.js +0 -30
- package/dist/assets/sankeyDiagram-TZEHDZUN-A0YO8ixs-a7KaBYfF.js +0 -10
- package/dist/assets/stateDiagram-FKZM4ZOC-ofFsB7HJ-bOg8RTsv.js +0 -1
- package/dist/assets/stateDiagram-v2-4FDKWEC3-CEZFbksU-BfeiShMk.js +0 -1
- package/dist/assets/treemap-KMMF4GRG-pGRoYcSn-C9GhcNEl.js +0 -128
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import{Q as p,v as kt,E as xt,e as vt,p as bt,B as wt,h as St,k as lt,J as Et,w as q,ap as Lt,aX as Mt,F as At,l as Tt}from"./index-CS9omSqb.js";function Pt(t){for(var n=t.length/6|0,s=new Array(n),a=0;a<n;)s[a]="#"+t.slice(a*6,++a*6);return s}const Nt=Pt("4e79a7f28e2ce1575976b7b259a14fedc949af7aa1ff9da79c755fbab0ab");function ct(t,n){let s;if(n===void 0)for(const a of t)a!=null&&(s<a||s===void 0&&a>=a)&&(s=a);else{let a=-1;for(let c of t)(c=n(c,++a,t))!=null&&(s<c||s===void 0&&c>=c)&&(s=c)}return s}function pt(t,n){let s;if(n===void 0)for(const a of t)a!=null&&(s>a||s===void 0&&a>=a)&&(s=a);else{let a=-1;for(let c of t)(c=n(c,++a,t))!=null&&(s>c||s===void 0&&c>=c)&&(s=c)}return s}function tt(t,n){let s=0;if(n===void 0)for(let a of t)(a=+a)&&(s+=a);else{let a=-1;for(let c of t)(c=+n(c,++a,t))&&(s+=c)}return s}function Ot(t){return t.target.depth}function Ct(t){return t.depth}function It(t,n){return n-1-t.height}function _t(t,n){return t.sourceLinks.length?t.depth:n-1}function Dt(t){return t.targetLinks.length?t.depth:t.sourceLinks.length?pt(t.sourceLinks,Ot)-1:0}function V(t){return function(){return t}}function ht(t,n){return B(t.source,n.source)||t.index-n.index}function ut(t,n){return B(t.target,n.target)||t.index-n.index}function B(t,n){return t.y0-n.y0}function et(t){return t.value}function $t(t){return t.index}function jt(t){return t.nodes}function zt(t){return t.links}function ft(t,n){const s=t.get(n);if(!s)throw new Error("missing: "+n);return s}function yt({nodes:t}){for(const n of t){let s=n.y0,a=s;for(const c of n.sourceLinks)c.y0=s+c.width/2,s+=c.width;for(const c of n.targetLinks)c.y1=a+c.width/2,a+=c.width}}function Ft(){let t=0,n=0,s=1,a=1,c=24,x=8,_,m=$t,i=_t,o,f,d=jt,y=zt,w=6;function v(){const e={nodes:d.apply(null,arguments),links:y.apply(null,arguments)};return N(e),A(e),T(e),I(e),O(e),yt(e),e}v.update=function(e){return yt(e),e},v.nodeId=function(e){return arguments.length?(m=typeof e=="function"?e:V(e),v):m},v.nodeAlign=function(e){return arguments.length?(i=typeof e=="function"?e:V(e),v):i},v.nodeSort=function(e){return arguments.length?(o=e,v):o},v.nodeWidth=function(e){return arguments.length?(c=+e,v):c},v.nodePadding=function(e){return arguments.length?(x=_=+e,v):x},v.nodes=function(e){return arguments.length?(d=typeof e=="function"?e:V(e),v):d},v.links=function(e){return arguments.length?(y=typeof e=="function"?e:V(e),v):y},v.linkSort=function(e){return arguments.length?(f=e,v):f},v.size=function(e){return arguments.length?(t=n=0,s=+e[0],a=+e[1],v):[s-t,a-n]},v.extent=function(e){return arguments.length?(t=+e[0][0],s=+e[1][0],n=+e[0][1],a=+e[1][1],v):[[t,n],[s,a]]},v.iterations=function(e){return arguments.length?(w=+e,v):w};function N({nodes:e,links:u}){for(const[h,r]of e.entries())r.index=h,r.sourceLinks=[],r.targetLinks=[];const l=new Map(e.map((h,r)=>[m(h,r,e),h]));for(const[h,r]of u.entries()){r.index=h;let{source:k,target:b}=r;typeof k!="object"&&(k=r.source=ft(l,k)),typeof b!="object"&&(b=r.target=ft(l,b)),k.sourceLinks.push(r),b.targetLinks.push(r)}if(f!=null)for(const{sourceLinks:h,targetLinks:r}of e)h.sort(f),r.sort(f)}function A({nodes:e}){for(const u of e)u.value=u.fixedValue===void 0?Math.max(tt(u.sourceLinks,et),tt(u.targetLinks,et)):u.fixedValue}function T({nodes:e}){const u=e.length;let l=new Set(e),h=new Set,r=0;for(;l.size;){for(const k of l){k.depth=r;for(const{target:b}of k.sourceLinks)h.add(b)}if(++r>u)throw new Error("circular link");l=h,h=new Set}}function I({nodes:e}){const u=e.length;let l=new Set(e),h=new Set,r=0;for(;l.size;){for(const k of l){k.height=r;for(const{source:b}of k.targetLinks)h.add(b)}if(++r>u)throw new Error("circular link");l=h,h=new Set}}function P({nodes:e}){const u=ct(e,r=>r.depth)+1,l=(s-t-c)/(u-1),h=new Array(u);for(const r of e){const k=Math.max(0,Math.min(u-1,Math.floor(i.call(null,r,u))));r.layer=k,r.x0=t+k*l,r.x1=r.x0+c,h[k]?h[k].push(r):h[k]=[r]}if(o)for(const r of h)r.sort(o);return h}function S(e){const u=pt(e,l=>(a-n-(l.length-1)*_)/tt(l,et));for(const l of e){let h=n;for(const r of l){r.y0=h,r.y1=h+r.value*u,h=r.y1+_;for(const k of r.sourceLinks)k.width=k.value*u}h=(a-h+_)/(l.length+1);for(let r=0;r<l.length;++r){const k=l[r];k.y0+=h*(r+1),k.y1+=h*(r+1)}$(l)}}function O(e){const u=P(e);_=Math.min(x,(a-n)/(ct(u,l=>l.length)-1)),S(u);for(let l=0;l<w;++l){const h=Math.pow(.99,l),r=Math.max(1-h,(l+1)/w);C(u,h,r),D(u,h,r)}}function D(e,u,l){for(let h=1,r=e.length;h<r;++h){const k=e[h];for(const b of k){let W=0,j=0;for(const{source:X,value:H}of b.targetLinks){let Y=H*(b.layer-X.layer);W+=M(X,b)*Y,j+=Y}if(!(j>0))continue;let Q=(W/j-b.y0)*u;b.y0+=Q,b.y1+=Q,E(b)}o===void 0&&k.sort(B),g(k,l)}}function C(e,u,l){for(let h=e.length,r=h-2;r>=0;--r){const k=e[r];for(const b of k){let W=0,j=0;for(const{target:X,value:H}of b.sourceLinks){let Y=H*(X.layer-b.layer);W+=G(b,X)*Y,j+=Y}if(!(j>0))continue;let Q=(W/j-b.y0)*u;b.y0+=Q,b.y1+=Q,E(b)}o===void 0&&k.sort(B),g(k,l)}}function g(e,u){const l=e.length>>1,h=e[l];U(e,h.y0-_,l-1,u),L(e,h.y1+_,l+1,u),U(e,a,e.length-1,u),L(e,n,0,u)}function L(e,u,l,h){for(;l<e.length;++l){const r=e[l],k=(u-r.y0)*h;k>1e-6&&(r.y0+=k,r.y1+=k),u=r.y1+_}}function U(e,u,l,h){for(;l>=0;--l){const r=e[l],k=(r.y1-u)*h;k>1e-6&&(r.y0-=k,r.y1-=k),u=r.y0-_}}function E({sourceLinks:e,targetLinks:u}){if(f===void 0){for(const{source:{sourceLinks:l}}of u)l.sort(ut);for(const{target:{targetLinks:l}}of e)l.sort(ht)}}function $(e){if(f===void 0)for(const{sourceLinks:u,targetLinks:l}of e)u.sort(ut),l.sort(ht)}function M(e,u){let l=e.y0-(e.sourceLinks.length-1)*_/2;for(const{target:h,width:r}of e.sourceLinks){if(h===u)break;l+=r+_}for(const{source:h,width:r}of u.targetLinks){if(h===e)break;l-=r}return l}function G(e,u){let l=u.y0-(u.targetLinks.length-1)*_/2;for(const{source:h,width:r}of u.targetLinks){if(h===e)break;l+=r+_}for(const{target:h,width:r}of e.sourceLinks){if(h===u)break;l-=r}return l}return v}var st=Math.PI,rt=2*st,z=1e-6,Ut=rt-z;function ot(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function mt(){return new ot}ot.prototype=mt.prototype={constructor:ot,moveTo:function(t,n){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+n)},closePath:function(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")},lineTo:function(t,n){this._+="L"+(this._x1=+t)+","+(this._y1=+n)},quadraticCurveTo:function(t,n,s,a){this._+="Q"+ +t+","+ +n+","+(this._x1=+s)+","+(this._y1=+a)},bezierCurveTo:function(t,n,s,a,c,x){this._+="C"+ +t+","+ +n+","+ +s+","+ +a+","+(this._x1=+c)+","+(this._y1=+x)},arcTo:function(t,n,s,a,c){t=+t,n=+n,s=+s,a=+a,c=+c;var x=this._x1,_=this._y1,m=s-t,i=a-n,o=x-t,f=_-n,d=o*o+f*f;if(c<0)throw new Error("negative radius: "+c);if(this._x1===null)this._+="M"+(this._x1=t)+","+(this._y1=n);else if(d>z)if(!(Math.abs(f*m-i*o)>z)||!c)this._+="L"+(this._x1=t)+","+(this._y1=n);else{var y=s-x,w=a-_,v=m*m+i*i,N=y*y+w*w,A=Math.sqrt(v),T=Math.sqrt(d),I=c*Math.tan((st-Math.acos((v+d-N)/(2*A*T)))/2),P=I/T,S=I/A;Math.abs(P-1)>z&&(this._+="L"+(t+P*o)+","+(n+P*f)),this._+="A"+c+","+c+",0,0,"+ +(f*y>o*w)+","+(this._x1=t+S*m)+","+(this._y1=n+S*i)}},arc:function(t,n,s,a,c,x){t=+t,n=+n,s=+s,x=!!x;var _=s*Math.cos(a),m=s*Math.sin(a),i=t+_,o=n+m,f=1^x,d=x?a-c:c-a;if(s<0)throw new Error("negative radius: "+s);this._x1===null?this._+="M"+i+","+o:(Math.abs(this._x1-i)>z||Math.abs(this._y1-o)>z)&&(this._+="L"+i+","+o),s&&(d<0&&(d=d%rt+rt),d>Ut?this._+="A"+s+","+s+",0,1,"+f+","+(t-_)+","+(n-m)+"A"+s+","+s+",0,1,"+f+","+(this._x1=i)+","+(this._y1=o):d>z&&(this._+="A"+s+","+s+",0,"+ +(d>=st)+","+f+","+(this._x1=t+s*Math.cos(c))+","+(this._y1=n+s*Math.sin(c))))},rect:function(t,n,s,a){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+n)+"h"+ +s+"v"+ +a+"h"+-s+"Z"},toString:function(){return this._}};function gt(t){return function(){return t}}function Gt(t){return t[0]}function Wt(t){return t[1]}var Qt=Array.prototype.slice;function Xt(t){return t.source}function Yt(t){return t.target}function qt(t){var n=Xt,s=Yt,a=Gt,c=Wt,x=null;function _(){var m,i=Qt.call(arguments),o=n.apply(this,i),f=s.apply(this,i);if(x||(x=m=mt()),t(x,+a.apply(this,(i[0]=o,i)),+c.apply(this,i),+a.apply(this,(i[0]=f,i)),+c.apply(this,i)),m)return x=null,m+""||null}return _.source=function(m){return arguments.length?(n=m,_):n},_.target=function(m){return arguments.length?(s=m,_):s},_.x=function(m){return arguments.length?(a=typeof m=="function"?m:gt(+m),_):a},_.y=function(m){return arguments.length?(c=typeof m=="function"?m:gt(+m),_):c},_.context=function(m){return arguments.length?(x=m??null,_):x},_}function Vt(t,n,s,a,c){t.moveTo(n,s),t.bezierCurveTo(n=(n+a)/2,s,n,c,a,c)}function Bt(){return qt(Vt)}function Jt(t){return[t.source.x1,t.y0]}function Rt(t){return[t.target.x0,t.y1]}function Kt(){return Bt().source(Jt).target(Rt)}var at=function(){var t=p(function(m,i,o,f){for(o=o||{},f=m.length;f--;o[m[f]]=i);return o},"o"),n=[1,9],s=[1,10],a=[1,5,10,12],c={trace:p(function(){},"trace"),yy:{},symbols_:{error:2,start:3,SANKEY:4,NEWLINE:5,csv:6,opt_eof:7,record:8,csv_tail:9,EOF:10,"field[source]":11,COMMA:12,"field[target]":13,"field[value]":14,field:15,escaped:16,non_escaped:17,DQUOTE:18,ESCAPED_TEXT:19,NON_ESCAPED_TEXT:20,$accept:0,$end:1},terminals_:{2:"error",4:"SANKEY",5:"NEWLINE",10:"EOF",11:"field[source]",12:"COMMA",13:"field[target]",14:"field[value]",18:"DQUOTE",19:"ESCAPED_TEXT",20:"NON_ESCAPED_TEXT"},productions_:[0,[3,4],[6,2],[9,2],[9,0],[7,1],[7,0],[8,5],[15,1],[15,1],[16,3],[17,1]],performAction:p(function(m,i,o,f,d,y,w){var v=y.length-1;switch(d){case 7:const N=f.findOrCreateNode(y[v-4].trim().replaceAll('""','"')),A=f.findOrCreateNode(y[v-2].trim().replaceAll('""','"')),T=parseFloat(y[v].trim());f.addLink(N,A,T);break;case 8:case 9:case 11:this.$=y[v];break;case 10:this.$=y[v-1];break}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},{5:[1,3]},{6:4,8:5,15:6,16:7,17:8,18:n,20:s},{1:[2,6],7:11,10:[1,12]},t(s,[2,4],{9:13,5:[1,14]}),{12:[1,15]},t(a,[2,8]),t(a,[2,9]),{19:[1,16]},t(a,[2,11]),{1:[2,1]},{1:[2,5]},t(s,[2,2]),{6:17,8:5,15:6,16:7,17:8,18:n,20:s},{15:18,16:7,17:8,18:n,20:s},{18:[1,19]},t(s,[2,3]),{12:[1,20]},t(a,[2,10]),{15:21,16:7,17:8,18:n,20:s},t([1,5,10],[2,7])],defaultActions:{11:[2,1],12:[2,5]},parseError:p(function(m,i){if(i.recoverable)this.trace(m);else{var o=new Error(m);throw o.hash=i,o}},"parseError"),parse:p(function(m){var i=this,o=[0],f=[],d=[null],y=[],w=this.table,v="",N=0,A=0,T=2,I=1,P=y.slice.call(arguments,1),S=Object.create(this.lexer),O={yy:{}};for(var D in this.yy)Object.prototype.hasOwnProperty.call(this.yy,D)&&(O.yy[D]=this.yy[D]);S.setInput(m,O.yy),O.yy.lexer=S,O.yy.parser=this,typeof S.yylloc>"u"&&(S.yylloc={});var C=S.yylloc;y.push(C);var g=S.options&&S.options.ranges;typeof O.yy.parseError=="function"?this.parseError=O.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function L(b){o.length=o.length-2*b,d.length=d.length-b,y.length=y.length-b}p(L,"popStack");function U(){var b;return b=f.pop()||S.lex()||I,typeof b!="number"&&(b instanceof Array&&(f=b,b=f.pop()),b=i.symbols_[b]||b),b}p(U,"lex");for(var E,$,M,G,e={},u,l,h,r;;){if($=o[o.length-1],this.defaultActions[$]?M=this.defaultActions[$]:((E===null||typeof E>"u")&&(E=U()),M=w[$]&&w[$][E]),typeof M>"u"||!M.length||!M[0]){var k="";r=[];for(u in w[$])this.terminals_[u]&&u>T&&r.push("'"+this.terminals_[u]+"'");S.showPosition?k="Parse error on line "+(N+1)+`:
|
|
2
|
+
`+S.showPosition()+`
|
|
3
|
+
Expecting `+r.join(", ")+", got '"+(this.terminals_[E]||E)+"'":k="Parse error on line "+(N+1)+": Unexpected "+(E==I?"end of input":"'"+(this.terminals_[E]||E)+"'"),this.parseError(k,{text:S.match,token:this.terminals_[E]||E,line:S.yylineno,loc:C,expected:r})}if(M[0]instanceof Array&&M.length>1)throw new Error("Parse Error: multiple actions possible at state: "+$+", token: "+E);switch(M[0]){case 1:o.push(E),d.push(S.yytext),y.push(S.yylloc),o.push(M[1]),E=null,A=S.yyleng,v=S.yytext,N=S.yylineno,C=S.yylloc;break;case 2:if(l=this.productions_[M[1]][1],e.$=d[d.length-l],e._$={first_line:y[y.length-(l||1)].first_line,last_line:y[y.length-1].last_line,first_column:y[y.length-(l||1)].first_column,last_column:y[y.length-1].last_column},g&&(e._$.range=[y[y.length-(l||1)].range[0],y[y.length-1].range[1]]),G=this.performAction.apply(e,[v,A,N,O.yy,M[1],d,y].concat(P)),typeof G<"u")return G;l&&(o=o.slice(0,-1*l*2),d=d.slice(0,-1*l),y=y.slice(0,-1*l)),o.push(this.productions_[M[1]][0]),d.push(e.$),y.push(e._$),h=w[o[o.length-2]][o[o.length-1]],o.push(h);break;case 3:return!0}}return!0},"parse")},x=function(){var m={EOF:1,parseError:p(function(i,o){if(this.yy.parser)this.yy.parser.parseError(i,o);else throw new Error(i)},"parseError"),setInput:p(function(i,o){return this.yy=o||this.yy||{},this._input=i,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:p(function(){var i=this._input[0];this.yytext+=i,this.yyleng++,this.offset++,this.match+=i,this.matched+=i;var o=i.match(/(?:\r\n?|\n).*/g);return o?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),i},"input"),unput:p(function(i){var o=i.length,f=i.split(/(?:\r\n?|\n)/g);this._input=i+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-o),this.offset-=o;var d=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),f.length-1&&(this.yylineno-=f.length-1);var y=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:f?(f.length===d.length?this.yylloc.first_column:0)+d[d.length-f.length].length-f[0].length:this.yylloc.first_column-o},this.options.ranges&&(this.yylloc.range=[y[0],y[0]+this.yyleng-o]),this.yyleng=this.yytext.length,this},"unput"),more:p(function(){return this._more=!0,this},"more"),reject:p(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
|
|
4
|
+
`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:p(function(i){this.unput(this.match.slice(i))},"less"),pastInput:p(function(){var i=this.matched.substr(0,this.matched.length-this.match.length);return(i.length>20?"...":"")+i.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:p(function(){var i=this.match;return i.length<20&&(i+=this._input.substr(0,20-i.length)),(i.substr(0,20)+(i.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:p(function(){var i=this.pastInput(),o=new Array(i.length+1).join("-");return i+this.upcomingInput()+`
|
|
5
|
+
`+o+"^"},"showPosition"),test_match:p(function(i,o){var f,d,y;if(this.options.backtrack_lexer&&(y={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(y.yylloc.range=this.yylloc.range.slice(0))),d=i[0].match(/(?:\r\n?|\n).*/g),d&&(this.yylineno+=d.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:d?d[d.length-1].length-d[d.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+i[0].length},this.yytext+=i[0],this.match+=i[0],this.matches=i,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(i[0].length),this.matched+=i[0],f=this.performAction.call(this,this.yy,this,o,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),f)return f;if(this._backtrack){for(var w in y)this[w]=y[w];return!1}return!1},"test_match"),next:p(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var i,o,f,d;this._more||(this.yytext="",this.match="");for(var y=this._currentRules(),w=0;w<y.length;w++)if(f=this._input.match(this.rules[y[w]]),f&&(!o||f[0].length>o[0].length)){if(o=f,d=w,this.options.backtrack_lexer){if(i=this.test_match(f,y[w]),i!==!1)return i;if(this._backtrack){o=!1;continue}else return!1}else if(!this.options.flex)break}return o?(i=this.test_match(o,y[d]),i!==!1?i:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text.
|
|
6
|
+
`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:p(function(){var i=this.next();return i||this.lex()},"lex"),begin:p(function(i){this.conditionStack.push(i)},"begin"),popState:p(function(){var i=this.conditionStack.length-1;return i>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:p(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:p(function(i){return i=this.conditionStack.length-1-Math.abs(i||0),i>=0?this.conditionStack[i]:"INITIAL"},"topState"),pushState:p(function(i){this.begin(i)},"pushState"),stateStackSize:p(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:p(function(i,o,f,d){switch(f){case 0:return this.pushState("csv"),4;case 1:return this.pushState("csv"),4;case 2:return 10;case 3:return 5;case 4:return 12;case 5:return this.pushState("escaped_text"),18;case 6:return 20;case 7:return this.popState("escaped_text"),18;case 8:return 19}},"anonymous"),rules:[/^(?:sankey-beta\b)/i,/^(?:sankey\b)/i,/^(?:$)/i,/^(?:((\u000D\u000A)|(\u000A)))/i,/^(?:(\u002C))/i,/^(?:(\u0022))/i,/^(?:([\u0020-\u0021\u0023-\u002B\u002D-\u007E])*)/i,/^(?:(\u0022)(?!(\u0022)))/i,/^(?:(([\u0020-\u0021\u0023-\u002B\u002D-\u007E])|(\u002C)|(\u000D)|(\u000A)|(\u0022)(\u0022))*)/i],conditions:{csv:{rules:[2,3,4,5,6,7,8],inclusive:!1},escaped_text:{rules:[7,8],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,8],inclusive:!0}}};return m}();c.lexer=x;function _(){this.yy={}}return p(_,"Parser"),_.prototype=c,c.Parser=_,new _}();at.parser=at;var J=at,K=[],Z=[],R=new Map,Zt=p(()=>{K=[],Z=[],R=new Map,At()},"clear"),nt,Ht=(nt=class{constructor(t,n,s=0){this.source=t,this.target=n,this.value=s}},p(nt,"SankeyLink"),nt),te=p((t,n,s)=>{K.push(new Ht(t,n,s))},"addLink"),it,ee=(it=class{constructor(t){this.ID=t}},p(it,"SankeyNode"),it),ne=p(t=>{t=Tt.sanitizeText(t,lt());let n=R.get(t);return n===void 0&&(n=new ee(t),R.set(t,n),Z.push(n)),n},"findOrCreateNode"),ie=p(()=>Z,"getNodes"),se=p(()=>K,"getLinks"),re=p(()=>({nodes:Z.map(t=>({id:t.ID})),links:K.map(t=>({source:t.source.ID,target:t.target.ID,value:t.value}))}),"getGraph"),oe={nodesMap:R,getConfig:p(()=>lt().sankey,"getConfig"),getNodes:ie,getLinks:se,getGraph:re,addLink:te,findOrCreateNode:ne,getAccTitle:St,setAccTitle:wt,getAccDescription:bt,setAccDescription:vt,getDiagramTitle:xt,setDiagramTitle:kt,clear:Zt},F,dt=(F=class{static next(t){return new F(t+ ++F.count)}constructor(t){this.id=t,this.href=`#${t}`}toString(){return"url("+this.href+")"}},p(F,"Uid"),F.count=0,F),ae={left:Ct,right:It,center:Dt,justify:_t},le=p(function(t,n,s,a){const{securityLevel:c,sankey:x}=lt(),_=Et.sankey;let m;c==="sandbox"&&(m=q("#i"+n));const i=c==="sandbox"?q(m.nodes()[0].contentDocument.body):q("body"),o=c==="sandbox"?i.select(`[id="${n}"]`):q(`[id="${n}"]`),f=(x==null?void 0:x.width)??_.width,d=(x==null?void 0:x.height)??_.width,y=(x==null?void 0:x.useMaxWidth)??_.useMaxWidth,w=(x==null?void 0:x.nodeAlignment)??_.nodeAlignment,v=(x==null?void 0:x.prefix)??_.prefix,N=(x==null?void 0:x.suffix)??_.suffix,A=(x==null?void 0:x.showValues)??_.showValues,T=a.db.getGraph(),I=ae[w];Ft().nodeId(g=>g.id).nodeWidth(10).nodePadding(10+(A?15:0)).nodeAlign(I).extent([[0,0],[f,d]])(T);const P=Lt(Nt);o.append("g").attr("class","nodes").selectAll(".node").data(T.nodes).join("g").attr("class","node").attr("id",g=>(g.uid=dt.next("node-")).id).attr("transform",function(g){return"translate("+g.x0+","+g.y0+")"}).attr("x",g=>g.x0).attr("y",g=>g.y0).append("rect").attr("height",g=>g.y1-g.y0).attr("width",g=>g.x1-g.x0).attr("fill",g=>P(g.id));const S=p(({id:g,value:L})=>A?`${g}
|
|
7
|
+
${v}${Math.round(L*100)/100}${N}`:g,"getText");o.append("g").attr("class","node-labels").attr("font-size",14).selectAll("text").data(T.nodes).join("text").attr("x",g=>g.x0<f/2?g.x1+6:g.x0-6).attr("y",g=>(g.y1+g.y0)/2).attr("dy",`${A?"0":"0.35"}em`).attr("text-anchor",g=>g.x0<f/2?"start":"end").text(S);const O=o.append("g").attr("class","links").attr("fill","none").attr("stroke-opacity",.5).selectAll(".link").data(T.links).join("g").attr("class","link").style("mix-blend-mode","multiply"),D=(x==null?void 0:x.linkColor)??"gradient";if(D==="gradient"){const g=O.append("linearGradient").attr("id",L=>(L.uid=dt.next("linearGradient-")).id).attr("gradientUnits","userSpaceOnUse").attr("x1",L=>L.source.x1).attr("x2",L=>L.target.x0);g.append("stop").attr("offset","0%").attr("stop-color",L=>P(L.source.id)),g.append("stop").attr("offset","100%").attr("stop-color",L=>P(L.target.id))}let C;switch(D){case"gradient":C=p(g=>g.uid,"coloring");break;case"source":C=p(g=>P(g.source.id),"coloring");break;case"target":C=p(g=>P(g.target.id),"coloring");break;default:C=D}O.append("path").attr("d",Kt()).attr("stroke",C).attr("stroke-width",g=>Math.max(1,g.width)),Mt(void 0,o,0,y)},"draw"),ce={draw:le},he=p(t=>t.replaceAll(/^[^\S\n\r]+|[^\S\n\r]+$/g,"").replaceAll(/([\n\r])+/g,`
|
|
8
|
+
`).trim(),"prepareTextForParsing"),ue=p(t=>`.label {
|
|
9
|
+
font-family: ${t.fontFamily};
|
|
10
|
+
}`,"getStyles"),fe=ue,ye=J.parse.bind(J);J.parse=t=>ye(he(t));var de={styles:fe,parser:J,db:oe,renderer:ce};export{de as diagram};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import{d as Ee,p as Ut,y as lt,x as we,m as Gt,h as Kt}from"./chunk-TZMSLE5B-BnXK-OiF-CaOoC40G.js";import{x as y,J as Ie,p as at,f as At,a as X,l as re,G as ke,i as Le,n as L,u as ee,h as ve,w as Pe,g as _e,B as Ae,z as Ne,C as Me,H as Oe,M as Se,y as Nt,v as V,ax as kt,ay as W,ao as se,az as De,aA as $e,aB as ie,T as qt}from"./index-DgEaSYFR.js";import{e as Re}from"./chunk-QZHKN3VN-Cwlo2qTG-Br1Vb3wS.js";var zt=function(){var e=y(function(ct,I,k,E){for(k=k||{},E=ct.length;E--;k[ct[E]]=I);return k},"o"),t=[1,2],o=[1,3],a=[1,4],r=[2,4],s=[1,9],c=[1,11],h=[1,13],g=[1,14],i=[1,16],d=[1,17],n=[1,18],u=[1,24],b=[1,25],m=[1,26],w=[1,27],P=[1,28],A=[1,29],N=[1,30],M=[1,31],$=[1,32],B=[1,33],q=[1,34],Z=[1,35],rt=[1,36],z=[1,37],H=[1,38],F=[1,39],R=[1,41],Q=[1,42],j=[1,43],J=[1,44],st=[1,45],D=[1,46],T=[1,4,5,13,14,16,18,21,23,29,30,31,33,35,36,37,38,39,41,43,44,46,47,48,49,50,52,53,55,60,61,62,63,71],v=[2,71],U=[4,5,16,50,52,53],tt=[4,5,13,14,16,18,21,23,29,30,31,33,35,36,37,38,39,41,43,44,46,50,52,53,55,60,61,62,63,71],S=[4,5,13,14,16,18,21,23,29,30,31,33,35,36,37,38,39,41,43,44,46,49,50,52,53,55,60,61,62,63,71],Rt=[4,5,13,14,16,18,21,23,29,30,31,33,35,36,37,38,39,41,43,44,46,48,50,52,53,55,60,61,62,63,71],Xt=[4,5,13,14,16,18,21,23,29,30,31,33,35,36,37,38,39,41,43,44,46,47,50,52,53,55,60,61,62,63,71],nt=[69,70,71],ht=[1,127],Ct={trace:y(function(){},"trace"),yy:{},symbols_:{error:2,start:3,SPACE:4,NEWLINE:5,SD:6,document:7,line:8,statement:9,box_section:10,box_line:11,participant_statement:12,create:13,box:14,restOfLine:15,end:16,signal:17,autonumber:18,NUM:19,off:20,activate:21,actor:22,deactivate:23,note_statement:24,links_statement:25,link_statement:26,properties_statement:27,details_statement:28,title:29,legacy_title:30,acc_title:31,acc_title_value:32,acc_descr:33,acc_descr_value:34,acc_descr_multiline_value:35,loop:36,rect:37,opt:38,alt:39,else_sections:40,par:41,par_sections:42,par_over:43,critical:44,option_sections:45,break:46,option:47,and:48,else:49,participant:50,AS:51,participant_actor:52,destroy:53,actor_with_config:54,note:55,placement:56,text2:57,over:58,actor_pair:59,links:60,link:61,properties:62,details:63,spaceList:64,",":65,left_of:66,right_of:67,signaltype:68,"+":69,"-":70,ACTOR:71,config_object:72,CONFIG_START:73,CONFIG_CONTENT:74,CONFIG_END:75,SOLID_OPEN_ARROW:76,DOTTED_OPEN_ARROW:77,SOLID_ARROW:78,BIDIRECTIONAL_SOLID_ARROW:79,DOTTED_ARROW:80,BIDIRECTIONAL_DOTTED_ARROW:81,SOLID_CROSS:82,DOTTED_CROSS:83,SOLID_POINT:84,DOTTED_POINT:85,TXT:86,$accept:0,$end:1},terminals_:{2:"error",4:"SPACE",5:"NEWLINE",6:"SD",13:"create",14:"box",15:"restOfLine",16:"end",18:"autonumber",19:"NUM",20:"off",21:"activate",23:"deactivate",29:"title",30:"legacy_title",31:"acc_title",32:"acc_title_value",33:"acc_descr",34:"acc_descr_value",35:"acc_descr_multiline_value",36:"loop",37:"rect",38:"opt",39:"alt",41:"par",43:"par_over",44:"critical",46:"break",47:"option",48:"and",49:"else",50:"participant",51:"AS",52:"participant_actor",53:"destroy",55:"note",58:"over",60:"links",61:"link",62:"properties",63:"details",65:",",66:"left_of",67:"right_of",69:"+",70:"-",71:"ACTOR",73:"CONFIG_START",74:"CONFIG_CONTENT",75:"CONFIG_END",76:"SOLID_OPEN_ARROW",77:"DOTTED_OPEN_ARROW",78:"SOLID_ARROW",79:"BIDIRECTIONAL_SOLID_ARROW",80:"DOTTED_ARROW",81:"BIDIRECTIONAL_DOTTED_ARROW",82:"SOLID_CROSS",83:"DOTTED_CROSS",84:"SOLID_POINT",85:"DOTTED_POINT",86:"TXT"},productions_:[0,[3,2],[3,2],[3,2],[7,0],[7,2],[8,2],[8,1],[8,1],[10,0],[10,2],[11,2],[11,1],[11,1],[9,1],[9,2],[9,4],[9,2],[9,4],[9,3],[9,3],[9,2],[9,3],[9,3],[9,2],[9,2],[9,2],[9,2],[9,2],[9,1],[9,1],[9,2],[9,2],[9,1],[9,4],[9,4],[9,4],[9,4],[9,4],[9,4],[9,4],[9,4],[45,1],[45,4],[42,1],[42,4],[40,1],[40,4],[12,5],[12,3],[12,5],[12,3],[12,3],[12,3],[24,4],[24,4],[25,3],[26,3],[27,3],[28,3],[64,2],[64,1],[59,3],[59,1],[56,1],[56,1],[17,5],[17,5],[17,4],[54,2],[72,3],[22,1],[68,1],[68,1],[68,1],[68,1],[68,1],[68,1],[68,1],[68,1],[68,1],[68,1],[57,1]],performAction:y(function(ct,I,k,E,O,p,G){var x=p.length-1;switch(O){case 3:return E.apply(p[x]),p[x];case 4:case 9:this.$=[];break;case 5:case 10:p[x-1].push(p[x]),this.$=p[x-1];break;case 6:case 7:case 11:case 12:this.$=p[x];break;case 8:case 13:this.$=[];break;case 15:p[x].type="createParticipant",this.$=p[x];break;case 16:p[x-1].unshift({type:"boxStart",boxData:E.parseBoxData(p[x-2])}),p[x-1].push({type:"boxEnd",boxText:p[x-2]}),this.$=p[x-1];break;case 18:this.$={type:"sequenceIndex",sequenceIndex:Number(p[x-2]),sequenceIndexStep:Number(p[x-1]),sequenceVisible:!0,signalType:E.LINETYPE.AUTONUMBER};break;case 19:this.$={type:"sequenceIndex",sequenceIndex:Number(p[x-1]),sequenceIndexStep:1,sequenceVisible:!0,signalType:E.LINETYPE.AUTONUMBER};break;case 20:this.$={type:"sequenceIndex",sequenceVisible:!1,signalType:E.LINETYPE.AUTONUMBER};break;case 21:this.$={type:"sequenceIndex",sequenceVisible:!0,signalType:E.LINETYPE.AUTONUMBER};break;case 22:this.$={type:"activeStart",signalType:E.LINETYPE.ACTIVE_START,actor:p[x-1].actor};break;case 23:this.$={type:"activeEnd",signalType:E.LINETYPE.ACTIVE_END,actor:p[x-1].actor};break;case 29:E.setDiagramTitle(p[x].substring(6)),this.$=p[x].substring(6);break;case 30:E.setDiagramTitle(p[x].substring(7)),this.$=p[x].substring(7);break;case 31:this.$=p[x].trim(),E.setAccTitle(this.$);break;case 32:case 33:this.$=p[x].trim(),E.setAccDescription(this.$);break;case 34:p[x-1].unshift({type:"loopStart",loopText:E.parseMessage(p[x-2]),signalType:E.LINETYPE.LOOP_START}),p[x-1].push({type:"loopEnd",loopText:p[x-2],signalType:E.LINETYPE.LOOP_END}),this.$=p[x-1];break;case 35:p[x-1].unshift({type:"rectStart",color:E.parseMessage(p[x-2]),signalType:E.LINETYPE.RECT_START}),p[x-1].push({type:"rectEnd",color:E.parseMessage(p[x-2]),signalType:E.LINETYPE.RECT_END}),this.$=p[x-1];break;case 36:p[x-1].unshift({type:"optStart",optText:E.parseMessage(p[x-2]),signalType:E.LINETYPE.OPT_START}),p[x-1].push({type:"optEnd",optText:E.parseMessage(p[x-2]),signalType:E.LINETYPE.OPT_END}),this.$=p[x-1];break;case 37:p[x-1].unshift({type:"altStart",altText:E.parseMessage(p[x-2]),signalType:E.LINETYPE.ALT_START}),p[x-1].push({type:"altEnd",signalType:E.LINETYPE.ALT_END}),this.$=p[x-1];break;case 38:p[x-1].unshift({type:"parStart",parText:E.parseMessage(p[x-2]),signalType:E.LINETYPE.PAR_START}),p[x-1].push({type:"parEnd",signalType:E.LINETYPE.PAR_END}),this.$=p[x-1];break;case 39:p[x-1].unshift({type:"parStart",parText:E.parseMessage(p[x-2]),signalType:E.LINETYPE.PAR_OVER_START}),p[x-1].push({type:"parEnd",signalType:E.LINETYPE.PAR_END}),this.$=p[x-1];break;case 40:p[x-1].unshift({type:"criticalStart",criticalText:E.parseMessage(p[x-2]),signalType:E.LINETYPE.CRITICAL_START}),p[x-1].push({type:"criticalEnd",signalType:E.LINETYPE.CRITICAL_END}),this.$=p[x-1];break;case 41:p[x-1].unshift({type:"breakStart",breakText:E.parseMessage(p[x-2]),signalType:E.LINETYPE.BREAK_START}),p[x-1].push({type:"breakEnd",optText:E.parseMessage(p[x-2]),signalType:E.LINETYPE.BREAK_END}),this.$=p[x-1];break;case 43:this.$=p[x-3].concat([{type:"option",optionText:E.parseMessage(p[x-1]),signalType:E.LINETYPE.CRITICAL_OPTION},p[x]]);break;case 45:this.$=p[x-3].concat([{type:"and",parText:E.parseMessage(p[x-1]),signalType:E.LINETYPE.PAR_AND},p[x]]);break;case 47:this.$=p[x-3].concat([{type:"else",altText:E.parseMessage(p[x-1]),signalType:E.LINETYPE.ALT_ELSE},p[x]]);break;case 48:p[x-3].draw="participant",p[x-3].type="addParticipant",p[x-3].description=E.parseMessage(p[x-1]),this.$=p[x-3];break;case 49:p[x-1].draw="participant",p[x-1].type="addParticipant",this.$=p[x-1];break;case 50:p[x-3].draw="actor",p[x-3].type="addParticipant",p[x-3].description=E.parseMessage(p[x-1]),this.$=p[x-3];break;case 51:p[x-1].draw="actor",p[x-1].type="addParticipant",this.$=p[x-1];break;case 52:p[x-1].type="destroyParticipant",this.$=p[x-1];break;case 53:p[x-1].draw="participant",p[x-1].type="addParticipant",this.$=p[x-1];break;case 54:this.$=[p[x-1],{type:"addNote",placement:p[x-2],actor:p[x-1].actor,text:p[x]}];break;case 55:p[x-2]=[].concat(p[x-1],p[x-1]).slice(0,2),p[x-2][0]=p[x-2][0].actor,p[x-2][1]=p[x-2][1].actor,this.$=[p[x-1],{type:"addNote",placement:E.PLACEMENT.OVER,actor:p[x-2].slice(0,2),text:p[x]}];break;case 56:this.$=[p[x-1],{type:"addLinks",actor:p[x-1].actor,text:p[x]}];break;case 57:this.$=[p[x-1],{type:"addALink",actor:p[x-1].actor,text:p[x]}];break;case 58:this.$=[p[x-1],{type:"addProperties",actor:p[x-1].actor,text:p[x]}];break;case 59:this.$=[p[x-1],{type:"addDetails",actor:p[x-1].actor,text:p[x]}];break;case 62:this.$=[p[x-2],p[x]];break;case 63:this.$=p[x];break;case 64:this.$=E.PLACEMENT.LEFTOF;break;case 65:this.$=E.PLACEMENT.RIGHTOF;break;case 66:this.$=[p[x-4],p[x-1],{type:"addMessage",from:p[x-4].actor,to:p[x-1].actor,signalType:p[x-3],msg:p[x],activate:!0},{type:"activeStart",signalType:E.LINETYPE.ACTIVE_START,actor:p[x-1].actor}];break;case 67:this.$=[p[x-4],p[x-1],{type:"addMessage",from:p[x-4].actor,to:p[x-1].actor,signalType:p[x-3],msg:p[x]},{type:"activeEnd",signalType:E.LINETYPE.ACTIVE_END,actor:p[x-4].actor}];break;case 68:this.$=[p[x-3],p[x-1],{type:"addMessage",from:p[x-3].actor,to:p[x-1].actor,signalType:p[x-2],msg:p[x]}];break;case 69:this.$={type:"addParticipant",actor:p[x-1],config:p[x]};break;case 70:this.$=p[x-1].trim();break;case 71:this.$={type:"addParticipant",actor:p[x]};break;case 72:this.$=E.LINETYPE.SOLID_OPEN;break;case 73:this.$=E.LINETYPE.DOTTED_OPEN;break;case 74:this.$=E.LINETYPE.SOLID;break;case 75:this.$=E.LINETYPE.BIDIRECTIONAL_SOLID;break;case 76:this.$=E.LINETYPE.DOTTED;break;case 77:this.$=E.LINETYPE.BIDIRECTIONAL_DOTTED;break;case 78:this.$=E.LINETYPE.SOLID_CROSS;break;case 79:this.$=E.LINETYPE.DOTTED_CROSS;break;case 80:this.$=E.LINETYPE.SOLID_POINT;break;case 81:this.$=E.LINETYPE.DOTTED_POINT;break;case 82:this.$=E.parseMessage(p[x].trim().substring(1));break}},"anonymous"),table:[{3:1,4:t,5:o,6:a},{1:[3]},{3:5,4:t,5:o,6:a},{3:6,4:t,5:o,6:a},e([1,4,5,13,14,18,21,23,29,30,31,33,35,36,37,38,39,41,43,44,46,50,52,53,55,60,61,62,63,71],r,{7:7}),{1:[2,1]},{1:[2,2]},{1:[2,3],4:s,5:c,8:8,9:10,12:12,13:h,14:g,17:15,18:i,21:d,22:40,23:n,24:19,25:20,26:21,27:22,28:23,29:u,30:b,31:m,33:w,35:P,36:A,37:N,38:M,39:$,41:B,43:q,44:Z,46:rt,50:z,52:H,53:F,55:R,60:Q,61:j,62:J,63:st,71:D},e(T,[2,5]),{9:47,12:12,13:h,14:g,17:15,18:i,21:d,22:40,23:n,24:19,25:20,26:21,27:22,28:23,29:u,30:b,31:m,33:w,35:P,36:A,37:N,38:M,39:$,41:B,43:q,44:Z,46:rt,50:z,52:H,53:F,55:R,60:Q,61:j,62:J,63:st,71:D},e(T,[2,7]),e(T,[2,8]),e(T,[2,14]),{12:48,50:z,52:H,53:F},{15:[1,49]},{5:[1,50]},{5:[1,53],19:[1,51],20:[1,52]},{22:54,71:D},{22:55,71:D},{5:[1,56]},{5:[1,57]},{5:[1,58]},{5:[1,59]},{5:[1,60]},e(T,[2,29]),e(T,[2,30]),{32:[1,61]},{34:[1,62]},e(T,[2,33]),{15:[1,63]},{15:[1,64]},{15:[1,65]},{15:[1,66]},{15:[1,67]},{15:[1,68]},{15:[1,69]},{15:[1,70]},{22:71,54:72,71:[1,73]},{22:74,71:D},{22:75,71:D},{68:76,76:[1,77],77:[1,78],78:[1,79],79:[1,80],80:[1,81],81:[1,82],82:[1,83],83:[1,84],84:[1,85],85:[1,86]},{56:87,58:[1,88],66:[1,89],67:[1,90]},{22:91,71:D},{22:92,71:D},{22:93,71:D},{22:94,71:D},e([5,51,65,76,77,78,79,80,81,82,83,84,85,86],v),e(T,[2,6]),e(T,[2,15]),e(U,[2,9],{10:95}),e(T,[2,17]),{5:[1,97],19:[1,96]},{5:[1,98]},e(T,[2,21]),{5:[1,99]},{5:[1,100]},e(T,[2,24]),e(T,[2,25]),e(T,[2,26]),e(T,[2,27]),e(T,[2,28]),e(T,[2,31]),e(T,[2,32]),e(tt,r,{7:101}),e(tt,r,{7:102}),e(tt,r,{7:103}),e(S,r,{40:104,7:105}),e(Rt,r,{42:106,7:107}),e(Rt,r,{7:107,42:108}),e(Xt,r,{45:109,7:110}),e(tt,r,{7:111}),{5:[1,113],51:[1,112]},{5:[1,114]},e([5,51],v,{72:115,73:[1,116]}),{5:[1,118],51:[1,117]},{5:[1,119]},{22:122,69:[1,120],70:[1,121],71:D},e(nt,[2,72]),e(nt,[2,73]),e(nt,[2,74]),e(nt,[2,75]),e(nt,[2,76]),e(nt,[2,77]),e(nt,[2,78]),e(nt,[2,79]),e(nt,[2,80]),e(nt,[2,81]),{22:123,71:D},{22:125,59:124,71:D},{71:[2,64]},{71:[2,65]},{57:126,86:ht},{57:128,86:ht},{57:129,86:ht},{57:130,86:ht},{4:[1,133],5:[1,135],11:132,12:134,16:[1,131],50:z,52:H,53:F},{5:[1,136]},e(T,[2,19]),e(T,[2,20]),e(T,[2,22]),e(T,[2,23]),{4:s,5:c,8:8,9:10,12:12,13:h,14:g,16:[1,137],17:15,18:i,21:d,22:40,23:n,24:19,25:20,26:21,27:22,28:23,29:u,30:b,31:m,33:w,35:P,36:A,37:N,38:M,39:$,41:B,43:q,44:Z,46:rt,50:z,52:H,53:F,55:R,60:Q,61:j,62:J,63:st,71:D},{4:s,5:c,8:8,9:10,12:12,13:h,14:g,16:[1,138],17:15,18:i,21:d,22:40,23:n,24:19,25:20,26:21,27:22,28:23,29:u,30:b,31:m,33:w,35:P,36:A,37:N,38:M,39:$,41:B,43:q,44:Z,46:rt,50:z,52:H,53:F,55:R,60:Q,61:j,62:J,63:st,71:D},{4:s,5:c,8:8,9:10,12:12,13:h,14:g,16:[1,139],17:15,18:i,21:d,22:40,23:n,24:19,25:20,26:21,27:22,28:23,29:u,30:b,31:m,33:w,35:P,36:A,37:N,38:M,39:$,41:B,43:q,44:Z,46:rt,50:z,52:H,53:F,55:R,60:Q,61:j,62:J,63:st,71:D},{16:[1,140]},{4:s,5:c,8:8,9:10,12:12,13:h,14:g,16:[2,46],17:15,18:i,21:d,22:40,23:n,24:19,25:20,26:21,27:22,28:23,29:u,30:b,31:m,33:w,35:P,36:A,37:N,38:M,39:$,41:B,43:q,44:Z,46:rt,49:[1,141],50:z,52:H,53:F,55:R,60:Q,61:j,62:J,63:st,71:D},{16:[1,142]},{4:s,5:c,8:8,9:10,12:12,13:h,14:g,16:[2,44],17:15,18:i,21:d,22:40,23:n,24:19,25:20,26:21,27:22,28:23,29:u,30:b,31:m,33:w,35:P,36:A,37:N,38:M,39:$,41:B,43:q,44:Z,46:rt,48:[1,143],50:z,52:H,53:F,55:R,60:Q,61:j,62:J,63:st,71:D},{16:[1,144]},{16:[1,145]},{4:s,5:c,8:8,9:10,12:12,13:h,14:g,16:[2,42],17:15,18:i,21:d,22:40,23:n,24:19,25:20,26:21,27:22,28:23,29:u,30:b,31:m,33:w,35:P,36:A,37:N,38:M,39:$,41:B,43:q,44:Z,46:rt,47:[1,146],50:z,52:H,53:F,55:R,60:Q,61:j,62:J,63:st,71:D},{4:s,5:c,8:8,9:10,12:12,13:h,14:g,16:[1,147],17:15,18:i,21:d,22:40,23:n,24:19,25:20,26:21,27:22,28:23,29:u,30:b,31:m,33:w,35:P,36:A,37:N,38:M,39:$,41:B,43:q,44:Z,46:rt,50:z,52:H,53:F,55:R,60:Q,61:j,62:J,63:st,71:D},{15:[1,148]},e(T,[2,49]),e(T,[2,53]),{5:[2,69]},{74:[1,149]},{15:[1,150]},e(T,[2,51]),e(T,[2,52]),{22:151,71:D},{22:152,71:D},{57:153,86:ht},{57:154,86:ht},{57:155,86:ht},{65:[1,156],86:[2,63]},{5:[2,56]},{5:[2,82]},{5:[2,57]},{5:[2,58]},{5:[2,59]},e(T,[2,16]),e(U,[2,10]),{12:157,50:z,52:H,53:F},e(U,[2,12]),e(U,[2,13]),e(T,[2,18]),e(T,[2,34]),e(T,[2,35]),e(T,[2,36]),e(T,[2,37]),{15:[1,158]},e(T,[2,38]),{15:[1,159]},e(T,[2,39]),e(T,[2,40]),{15:[1,160]},e(T,[2,41]),{5:[1,161]},{75:[1,162]},{5:[1,163]},{57:164,86:ht},{57:165,86:ht},{5:[2,68]},{5:[2,54]},{5:[2,55]},{22:166,71:D},e(U,[2,11]),e(S,r,{7:105,40:167}),e(Rt,r,{7:107,42:168}),e(Xt,r,{7:110,45:169}),e(T,[2,48]),{5:[2,70]},e(T,[2,50]),{5:[2,66]},{5:[2,67]},{86:[2,62]},{16:[2,47]},{16:[2,45]},{16:[2,43]}],defaultActions:{5:[2,1],6:[2,2],89:[2,64],90:[2,65],115:[2,69],126:[2,56],127:[2,82],128:[2,57],129:[2,58],130:[2,59],153:[2,68],154:[2,54],155:[2,55],162:[2,70],164:[2,66],165:[2,67],166:[2,62],167:[2,47],168:[2,45],169:[2,43]},parseError:y(function(ct,I){if(I.recoverable)this.trace(ct);else{var k=new Error(ct);throw k.hash=I,k}},"parseError"),parse:y(function(ct){var I=this,k=[0],E=[],O=[null],p=[],G=this.table,x="",vt=0,Zt=0,be=2,Qt=1,fe=p.slice.call(arguments,1),Y=Object.create(this.lexer),yt={yy:{}};for(var Bt in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Bt)&&(yt.yy[Bt]=this.yy[Bt]);Y.setInput(ct,yt.yy),yt.yy.lexer=Y,yt.yy.parser=this,typeof Y.yylloc>"u"&&(Y.yylloc={});var Yt=Y.yylloc;p.push(Yt);var me=Y.options&&Y.options.ranges;typeof yt.yy.parseError=="function"?this.parseError=yt.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Te(et){k.length=k.length-2*et,O.length=O.length-et,p.length=p.length-et}y(Te,"popStack");function Jt(){var et;return et=E.pop()||Y.lex()||Qt,typeof et!="number"&&(et instanceof Array&&(E=et,et=E.pop()),et=I.symbols_[et]||et),et}y(Jt,"lex");for(var K,bt,it,Vt,Tt={},Pt,dt,te,_t;;){if(bt=k[k.length-1],this.defaultActions[bt]?it=this.defaultActions[bt]:((K===null||typeof K>"u")&&(K=Jt()),it=G[bt]&&G[bt][K]),typeof it>"u"||!it.length||!it[0]){var Ft="";_t=[];for(Pt in G[bt])this.terminals_[Pt]&&Pt>be&&_t.push("'"+this.terminals_[Pt]+"'");Y.showPosition?Ft="Parse error on line "+(vt+1)+`:
|
|
1
|
+
import{d as Ee,p as Ut,y as lt,x as we,m as Gt,h as Kt}from"./chunk-TZMSLE5B-G2jJHqli-DMA5IQKp.js";import{Q as y,H as Ie,k as at,w as At,s as X,S as re,f as ke,g as Le,l as L,B as ee,e as Pe,v as ve,h as _e,p as Ae,E as Ne,M as Me,x as Oe,F as Se,Y as Nt,O as V,ax as kt,ay as W,ao as se,az as De,aA as $e,aB as ie,L as qt}from"./index-CS9omSqb.js";import{e as Re}from"./chunk-QZHKN3VN-DVJOrqBZ-CMUptYKe.js";var zt=function(){var e=y(function(ct,I,k,E){for(k=k||{},E=ct.length;E--;k[ct[E]]=I);return k},"o"),t=[1,2],o=[1,3],a=[1,4],r=[2,4],s=[1,9],c=[1,11],h=[1,13],g=[1,14],i=[1,16],d=[1,17],n=[1,18],u=[1,24],b=[1,25],T=[1,26],w=[1,27],v=[1,28],A=[1,29],N=[1,30],M=[1,31],$=[1,32],B=[1,33],q=[1,34],Z=[1,35],rt=[1,36],z=[1,37],H=[1,38],F=[1,39],R=[1,41],Q=[1,42],j=[1,43],J=[1,44],st=[1,45],D=[1,46],f=[1,4,5,13,14,16,18,21,23,29,30,31,33,35,36,37,38,39,41,43,44,46,47,48,49,50,52,53,55,60,61,62,63,71],P=[2,71],U=[4,5,16,50,52,53],tt=[4,5,13,14,16,18,21,23,29,30,31,33,35,36,37,38,39,41,43,44,46,50,52,53,55,60,61,62,63,71],S=[4,5,13,14,16,18,21,23,29,30,31,33,35,36,37,38,39,41,43,44,46,49,50,52,53,55,60,61,62,63,71],Rt=[4,5,13,14,16,18,21,23,29,30,31,33,35,36,37,38,39,41,43,44,46,48,50,52,53,55,60,61,62,63,71],Xt=[4,5,13,14,16,18,21,23,29,30,31,33,35,36,37,38,39,41,43,44,46,47,50,52,53,55,60,61,62,63,71],nt=[69,70,71],ht=[1,127],Ct={trace:y(function(){},"trace"),yy:{},symbols_:{error:2,start:3,SPACE:4,NEWLINE:5,SD:6,document:7,line:8,statement:9,box_section:10,box_line:11,participant_statement:12,create:13,box:14,restOfLine:15,end:16,signal:17,autonumber:18,NUM:19,off:20,activate:21,actor:22,deactivate:23,note_statement:24,links_statement:25,link_statement:26,properties_statement:27,details_statement:28,title:29,legacy_title:30,acc_title:31,acc_title_value:32,acc_descr:33,acc_descr_value:34,acc_descr_multiline_value:35,loop:36,rect:37,opt:38,alt:39,else_sections:40,par:41,par_sections:42,par_over:43,critical:44,option_sections:45,break:46,option:47,and:48,else:49,participant:50,AS:51,participant_actor:52,destroy:53,actor_with_config:54,note:55,placement:56,text2:57,over:58,actor_pair:59,links:60,link:61,properties:62,details:63,spaceList:64,",":65,left_of:66,right_of:67,signaltype:68,"+":69,"-":70,ACTOR:71,config_object:72,CONFIG_START:73,CONFIG_CONTENT:74,CONFIG_END:75,SOLID_OPEN_ARROW:76,DOTTED_OPEN_ARROW:77,SOLID_ARROW:78,BIDIRECTIONAL_SOLID_ARROW:79,DOTTED_ARROW:80,BIDIRECTIONAL_DOTTED_ARROW:81,SOLID_CROSS:82,DOTTED_CROSS:83,SOLID_POINT:84,DOTTED_POINT:85,TXT:86,$accept:0,$end:1},terminals_:{2:"error",4:"SPACE",5:"NEWLINE",6:"SD",13:"create",14:"box",15:"restOfLine",16:"end",18:"autonumber",19:"NUM",20:"off",21:"activate",23:"deactivate",29:"title",30:"legacy_title",31:"acc_title",32:"acc_title_value",33:"acc_descr",34:"acc_descr_value",35:"acc_descr_multiline_value",36:"loop",37:"rect",38:"opt",39:"alt",41:"par",43:"par_over",44:"critical",46:"break",47:"option",48:"and",49:"else",50:"participant",51:"AS",52:"participant_actor",53:"destroy",55:"note",58:"over",60:"links",61:"link",62:"properties",63:"details",65:",",66:"left_of",67:"right_of",69:"+",70:"-",71:"ACTOR",73:"CONFIG_START",74:"CONFIG_CONTENT",75:"CONFIG_END",76:"SOLID_OPEN_ARROW",77:"DOTTED_OPEN_ARROW",78:"SOLID_ARROW",79:"BIDIRECTIONAL_SOLID_ARROW",80:"DOTTED_ARROW",81:"BIDIRECTIONAL_DOTTED_ARROW",82:"SOLID_CROSS",83:"DOTTED_CROSS",84:"SOLID_POINT",85:"DOTTED_POINT",86:"TXT"},productions_:[0,[3,2],[3,2],[3,2],[7,0],[7,2],[8,2],[8,1],[8,1],[10,0],[10,2],[11,2],[11,1],[11,1],[9,1],[9,2],[9,4],[9,2],[9,4],[9,3],[9,3],[9,2],[9,3],[9,3],[9,2],[9,2],[9,2],[9,2],[9,2],[9,1],[9,1],[9,2],[9,2],[9,1],[9,4],[9,4],[9,4],[9,4],[9,4],[9,4],[9,4],[9,4],[45,1],[45,4],[42,1],[42,4],[40,1],[40,4],[12,5],[12,3],[12,5],[12,3],[12,3],[12,3],[24,4],[24,4],[25,3],[26,3],[27,3],[28,3],[64,2],[64,1],[59,3],[59,1],[56,1],[56,1],[17,5],[17,5],[17,4],[54,2],[72,3],[22,1],[68,1],[68,1],[68,1],[68,1],[68,1],[68,1],[68,1],[68,1],[68,1],[68,1],[57,1]],performAction:y(function(ct,I,k,E,O,p,G){var x=p.length-1;switch(O){case 3:return E.apply(p[x]),p[x];case 4:case 9:this.$=[];break;case 5:case 10:p[x-1].push(p[x]),this.$=p[x-1];break;case 6:case 7:case 11:case 12:this.$=p[x];break;case 8:case 13:this.$=[];break;case 15:p[x].type="createParticipant",this.$=p[x];break;case 16:p[x-1].unshift({type:"boxStart",boxData:E.parseBoxData(p[x-2])}),p[x-1].push({type:"boxEnd",boxText:p[x-2]}),this.$=p[x-1];break;case 18:this.$={type:"sequenceIndex",sequenceIndex:Number(p[x-2]),sequenceIndexStep:Number(p[x-1]),sequenceVisible:!0,signalType:E.LINETYPE.AUTONUMBER};break;case 19:this.$={type:"sequenceIndex",sequenceIndex:Number(p[x-1]),sequenceIndexStep:1,sequenceVisible:!0,signalType:E.LINETYPE.AUTONUMBER};break;case 20:this.$={type:"sequenceIndex",sequenceVisible:!1,signalType:E.LINETYPE.AUTONUMBER};break;case 21:this.$={type:"sequenceIndex",sequenceVisible:!0,signalType:E.LINETYPE.AUTONUMBER};break;case 22:this.$={type:"activeStart",signalType:E.LINETYPE.ACTIVE_START,actor:p[x-1].actor};break;case 23:this.$={type:"activeEnd",signalType:E.LINETYPE.ACTIVE_END,actor:p[x-1].actor};break;case 29:E.setDiagramTitle(p[x].substring(6)),this.$=p[x].substring(6);break;case 30:E.setDiagramTitle(p[x].substring(7)),this.$=p[x].substring(7);break;case 31:this.$=p[x].trim(),E.setAccTitle(this.$);break;case 32:case 33:this.$=p[x].trim(),E.setAccDescription(this.$);break;case 34:p[x-1].unshift({type:"loopStart",loopText:E.parseMessage(p[x-2]),signalType:E.LINETYPE.LOOP_START}),p[x-1].push({type:"loopEnd",loopText:p[x-2],signalType:E.LINETYPE.LOOP_END}),this.$=p[x-1];break;case 35:p[x-1].unshift({type:"rectStart",color:E.parseMessage(p[x-2]),signalType:E.LINETYPE.RECT_START}),p[x-1].push({type:"rectEnd",color:E.parseMessage(p[x-2]),signalType:E.LINETYPE.RECT_END}),this.$=p[x-1];break;case 36:p[x-1].unshift({type:"optStart",optText:E.parseMessage(p[x-2]),signalType:E.LINETYPE.OPT_START}),p[x-1].push({type:"optEnd",optText:E.parseMessage(p[x-2]),signalType:E.LINETYPE.OPT_END}),this.$=p[x-1];break;case 37:p[x-1].unshift({type:"altStart",altText:E.parseMessage(p[x-2]),signalType:E.LINETYPE.ALT_START}),p[x-1].push({type:"altEnd",signalType:E.LINETYPE.ALT_END}),this.$=p[x-1];break;case 38:p[x-1].unshift({type:"parStart",parText:E.parseMessage(p[x-2]),signalType:E.LINETYPE.PAR_START}),p[x-1].push({type:"parEnd",signalType:E.LINETYPE.PAR_END}),this.$=p[x-1];break;case 39:p[x-1].unshift({type:"parStart",parText:E.parseMessage(p[x-2]),signalType:E.LINETYPE.PAR_OVER_START}),p[x-1].push({type:"parEnd",signalType:E.LINETYPE.PAR_END}),this.$=p[x-1];break;case 40:p[x-1].unshift({type:"criticalStart",criticalText:E.parseMessage(p[x-2]),signalType:E.LINETYPE.CRITICAL_START}),p[x-1].push({type:"criticalEnd",signalType:E.LINETYPE.CRITICAL_END}),this.$=p[x-1];break;case 41:p[x-1].unshift({type:"breakStart",breakText:E.parseMessage(p[x-2]),signalType:E.LINETYPE.BREAK_START}),p[x-1].push({type:"breakEnd",optText:E.parseMessage(p[x-2]),signalType:E.LINETYPE.BREAK_END}),this.$=p[x-1];break;case 43:this.$=p[x-3].concat([{type:"option",optionText:E.parseMessage(p[x-1]),signalType:E.LINETYPE.CRITICAL_OPTION},p[x]]);break;case 45:this.$=p[x-3].concat([{type:"and",parText:E.parseMessage(p[x-1]),signalType:E.LINETYPE.PAR_AND},p[x]]);break;case 47:this.$=p[x-3].concat([{type:"else",altText:E.parseMessage(p[x-1]),signalType:E.LINETYPE.ALT_ELSE},p[x]]);break;case 48:p[x-3].draw="participant",p[x-3].type="addParticipant",p[x-3].description=E.parseMessage(p[x-1]),this.$=p[x-3];break;case 49:p[x-1].draw="participant",p[x-1].type="addParticipant",this.$=p[x-1];break;case 50:p[x-3].draw="actor",p[x-3].type="addParticipant",p[x-3].description=E.parseMessage(p[x-1]),this.$=p[x-3];break;case 51:p[x-1].draw="actor",p[x-1].type="addParticipant",this.$=p[x-1];break;case 52:p[x-1].type="destroyParticipant",this.$=p[x-1];break;case 53:p[x-1].draw="participant",p[x-1].type="addParticipant",this.$=p[x-1];break;case 54:this.$=[p[x-1],{type:"addNote",placement:p[x-2],actor:p[x-1].actor,text:p[x]}];break;case 55:p[x-2]=[].concat(p[x-1],p[x-1]).slice(0,2),p[x-2][0]=p[x-2][0].actor,p[x-2][1]=p[x-2][1].actor,this.$=[p[x-1],{type:"addNote",placement:E.PLACEMENT.OVER,actor:p[x-2].slice(0,2),text:p[x]}];break;case 56:this.$=[p[x-1],{type:"addLinks",actor:p[x-1].actor,text:p[x]}];break;case 57:this.$=[p[x-1],{type:"addALink",actor:p[x-1].actor,text:p[x]}];break;case 58:this.$=[p[x-1],{type:"addProperties",actor:p[x-1].actor,text:p[x]}];break;case 59:this.$=[p[x-1],{type:"addDetails",actor:p[x-1].actor,text:p[x]}];break;case 62:this.$=[p[x-2],p[x]];break;case 63:this.$=p[x];break;case 64:this.$=E.PLACEMENT.LEFTOF;break;case 65:this.$=E.PLACEMENT.RIGHTOF;break;case 66:this.$=[p[x-4],p[x-1],{type:"addMessage",from:p[x-4].actor,to:p[x-1].actor,signalType:p[x-3],msg:p[x],activate:!0},{type:"activeStart",signalType:E.LINETYPE.ACTIVE_START,actor:p[x-1].actor}];break;case 67:this.$=[p[x-4],p[x-1],{type:"addMessage",from:p[x-4].actor,to:p[x-1].actor,signalType:p[x-3],msg:p[x]},{type:"activeEnd",signalType:E.LINETYPE.ACTIVE_END,actor:p[x-4].actor}];break;case 68:this.$=[p[x-3],p[x-1],{type:"addMessage",from:p[x-3].actor,to:p[x-1].actor,signalType:p[x-2],msg:p[x]}];break;case 69:this.$={type:"addParticipant",actor:p[x-1],config:p[x]};break;case 70:this.$=p[x-1].trim();break;case 71:this.$={type:"addParticipant",actor:p[x]};break;case 72:this.$=E.LINETYPE.SOLID_OPEN;break;case 73:this.$=E.LINETYPE.DOTTED_OPEN;break;case 74:this.$=E.LINETYPE.SOLID;break;case 75:this.$=E.LINETYPE.BIDIRECTIONAL_SOLID;break;case 76:this.$=E.LINETYPE.DOTTED;break;case 77:this.$=E.LINETYPE.BIDIRECTIONAL_DOTTED;break;case 78:this.$=E.LINETYPE.SOLID_CROSS;break;case 79:this.$=E.LINETYPE.DOTTED_CROSS;break;case 80:this.$=E.LINETYPE.SOLID_POINT;break;case 81:this.$=E.LINETYPE.DOTTED_POINT;break;case 82:this.$=E.parseMessage(p[x].trim().substring(1));break}},"anonymous"),table:[{3:1,4:t,5:o,6:a},{1:[3]},{3:5,4:t,5:o,6:a},{3:6,4:t,5:o,6:a},e([1,4,5,13,14,18,21,23,29,30,31,33,35,36,37,38,39,41,43,44,46,50,52,53,55,60,61,62,63,71],r,{7:7}),{1:[2,1]},{1:[2,2]},{1:[2,3],4:s,5:c,8:8,9:10,12:12,13:h,14:g,17:15,18:i,21:d,22:40,23:n,24:19,25:20,26:21,27:22,28:23,29:u,30:b,31:T,33:w,35:v,36:A,37:N,38:M,39:$,41:B,43:q,44:Z,46:rt,50:z,52:H,53:F,55:R,60:Q,61:j,62:J,63:st,71:D},e(f,[2,5]),{9:47,12:12,13:h,14:g,17:15,18:i,21:d,22:40,23:n,24:19,25:20,26:21,27:22,28:23,29:u,30:b,31:T,33:w,35:v,36:A,37:N,38:M,39:$,41:B,43:q,44:Z,46:rt,50:z,52:H,53:F,55:R,60:Q,61:j,62:J,63:st,71:D},e(f,[2,7]),e(f,[2,8]),e(f,[2,14]),{12:48,50:z,52:H,53:F},{15:[1,49]},{5:[1,50]},{5:[1,53],19:[1,51],20:[1,52]},{22:54,71:D},{22:55,71:D},{5:[1,56]},{5:[1,57]},{5:[1,58]},{5:[1,59]},{5:[1,60]},e(f,[2,29]),e(f,[2,30]),{32:[1,61]},{34:[1,62]},e(f,[2,33]),{15:[1,63]},{15:[1,64]},{15:[1,65]},{15:[1,66]},{15:[1,67]},{15:[1,68]},{15:[1,69]},{15:[1,70]},{22:71,54:72,71:[1,73]},{22:74,71:D},{22:75,71:D},{68:76,76:[1,77],77:[1,78],78:[1,79],79:[1,80],80:[1,81],81:[1,82],82:[1,83],83:[1,84],84:[1,85],85:[1,86]},{56:87,58:[1,88],66:[1,89],67:[1,90]},{22:91,71:D},{22:92,71:D},{22:93,71:D},{22:94,71:D},e([5,51,65,76,77,78,79,80,81,82,83,84,85,86],P),e(f,[2,6]),e(f,[2,15]),e(U,[2,9],{10:95}),e(f,[2,17]),{5:[1,97],19:[1,96]},{5:[1,98]},e(f,[2,21]),{5:[1,99]},{5:[1,100]},e(f,[2,24]),e(f,[2,25]),e(f,[2,26]),e(f,[2,27]),e(f,[2,28]),e(f,[2,31]),e(f,[2,32]),e(tt,r,{7:101}),e(tt,r,{7:102}),e(tt,r,{7:103}),e(S,r,{40:104,7:105}),e(Rt,r,{42:106,7:107}),e(Rt,r,{7:107,42:108}),e(Xt,r,{45:109,7:110}),e(tt,r,{7:111}),{5:[1,113],51:[1,112]},{5:[1,114]},e([5,51],P,{72:115,73:[1,116]}),{5:[1,118],51:[1,117]},{5:[1,119]},{22:122,69:[1,120],70:[1,121],71:D},e(nt,[2,72]),e(nt,[2,73]),e(nt,[2,74]),e(nt,[2,75]),e(nt,[2,76]),e(nt,[2,77]),e(nt,[2,78]),e(nt,[2,79]),e(nt,[2,80]),e(nt,[2,81]),{22:123,71:D},{22:125,59:124,71:D},{71:[2,64]},{71:[2,65]},{57:126,86:ht},{57:128,86:ht},{57:129,86:ht},{57:130,86:ht},{4:[1,133],5:[1,135],11:132,12:134,16:[1,131],50:z,52:H,53:F},{5:[1,136]},e(f,[2,19]),e(f,[2,20]),e(f,[2,22]),e(f,[2,23]),{4:s,5:c,8:8,9:10,12:12,13:h,14:g,16:[1,137],17:15,18:i,21:d,22:40,23:n,24:19,25:20,26:21,27:22,28:23,29:u,30:b,31:T,33:w,35:v,36:A,37:N,38:M,39:$,41:B,43:q,44:Z,46:rt,50:z,52:H,53:F,55:R,60:Q,61:j,62:J,63:st,71:D},{4:s,5:c,8:8,9:10,12:12,13:h,14:g,16:[1,138],17:15,18:i,21:d,22:40,23:n,24:19,25:20,26:21,27:22,28:23,29:u,30:b,31:T,33:w,35:v,36:A,37:N,38:M,39:$,41:B,43:q,44:Z,46:rt,50:z,52:H,53:F,55:R,60:Q,61:j,62:J,63:st,71:D},{4:s,5:c,8:8,9:10,12:12,13:h,14:g,16:[1,139],17:15,18:i,21:d,22:40,23:n,24:19,25:20,26:21,27:22,28:23,29:u,30:b,31:T,33:w,35:v,36:A,37:N,38:M,39:$,41:B,43:q,44:Z,46:rt,50:z,52:H,53:F,55:R,60:Q,61:j,62:J,63:st,71:D},{16:[1,140]},{4:s,5:c,8:8,9:10,12:12,13:h,14:g,16:[2,46],17:15,18:i,21:d,22:40,23:n,24:19,25:20,26:21,27:22,28:23,29:u,30:b,31:T,33:w,35:v,36:A,37:N,38:M,39:$,41:B,43:q,44:Z,46:rt,49:[1,141],50:z,52:H,53:F,55:R,60:Q,61:j,62:J,63:st,71:D},{16:[1,142]},{4:s,5:c,8:8,9:10,12:12,13:h,14:g,16:[2,44],17:15,18:i,21:d,22:40,23:n,24:19,25:20,26:21,27:22,28:23,29:u,30:b,31:T,33:w,35:v,36:A,37:N,38:M,39:$,41:B,43:q,44:Z,46:rt,48:[1,143],50:z,52:H,53:F,55:R,60:Q,61:j,62:J,63:st,71:D},{16:[1,144]},{16:[1,145]},{4:s,5:c,8:8,9:10,12:12,13:h,14:g,16:[2,42],17:15,18:i,21:d,22:40,23:n,24:19,25:20,26:21,27:22,28:23,29:u,30:b,31:T,33:w,35:v,36:A,37:N,38:M,39:$,41:B,43:q,44:Z,46:rt,47:[1,146],50:z,52:H,53:F,55:R,60:Q,61:j,62:J,63:st,71:D},{4:s,5:c,8:8,9:10,12:12,13:h,14:g,16:[1,147],17:15,18:i,21:d,22:40,23:n,24:19,25:20,26:21,27:22,28:23,29:u,30:b,31:T,33:w,35:v,36:A,37:N,38:M,39:$,41:B,43:q,44:Z,46:rt,50:z,52:H,53:F,55:R,60:Q,61:j,62:J,63:st,71:D},{15:[1,148]},e(f,[2,49]),e(f,[2,53]),{5:[2,69]},{74:[1,149]},{15:[1,150]},e(f,[2,51]),e(f,[2,52]),{22:151,71:D},{22:152,71:D},{57:153,86:ht},{57:154,86:ht},{57:155,86:ht},{65:[1,156],86:[2,63]},{5:[2,56]},{5:[2,82]},{5:[2,57]},{5:[2,58]},{5:[2,59]},e(f,[2,16]),e(U,[2,10]),{12:157,50:z,52:H,53:F},e(U,[2,12]),e(U,[2,13]),e(f,[2,18]),e(f,[2,34]),e(f,[2,35]),e(f,[2,36]),e(f,[2,37]),{15:[1,158]},e(f,[2,38]),{15:[1,159]},e(f,[2,39]),e(f,[2,40]),{15:[1,160]},e(f,[2,41]),{5:[1,161]},{75:[1,162]},{5:[1,163]},{57:164,86:ht},{57:165,86:ht},{5:[2,68]},{5:[2,54]},{5:[2,55]},{22:166,71:D},e(U,[2,11]),e(S,r,{7:105,40:167}),e(Rt,r,{7:107,42:168}),e(Xt,r,{7:110,45:169}),e(f,[2,48]),{5:[2,70]},e(f,[2,50]),{5:[2,66]},{5:[2,67]},{86:[2,62]},{16:[2,47]},{16:[2,45]},{16:[2,43]}],defaultActions:{5:[2,1],6:[2,2],89:[2,64],90:[2,65],115:[2,69],126:[2,56],127:[2,82],128:[2,57],129:[2,58],130:[2,59],153:[2,68],154:[2,54],155:[2,55],162:[2,70],164:[2,66],165:[2,67],166:[2,62],167:[2,47],168:[2,45],169:[2,43]},parseError:y(function(ct,I){if(I.recoverable)this.trace(ct);else{var k=new Error(ct);throw k.hash=I,k}},"parseError"),parse:y(function(ct){var I=this,k=[0],E=[],O=[null],p=[],G=this.table,x="",Pt=0,Zt=0,be=2,Qt=1,me=p.slice.call(arguments,1),Y=Object.create(this.lexer),yt={yy:{}};for(var Bt in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Bt)&&(yt.yy[Bt]=this.yy[Bt]);Y.setInput(ct,yt.yy),yt.yy.lexer=Y,yt.yy.parser=this,typeof Y.yylloc>"u"&&(Y.yylloc={});var Yt=Y.yylloc;p.push(Yt);var Te=Y.options&&Y.options.ranges;typeof yt.yy.parseError=="function"?this.parseError=yt.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function fe(et){k.length=k.length-2*et,O.length=O.length-et,p.length=p.length-et}y(fe,"popStack");function Jt(){var et;return et=E.pop()||Y.lex()||Qt,typeof et!="number"&&(et instanceof Array&&(E=et,et=E.pop()),et=I.symbols_[et]||et),et}y(Jt,"lex");for(var K,bt,it,Vt,ft={},vt,dt,te,_t;;){if(bt=k[k.length-1],this.defaultActions[bt]?it=this.defaultActions[bt]:((K===null||typeof K>"u")&&(K=Jt()),it=G[bt]&&G[bt][K]),typeof it>"u"||!it.length||!it[0]){var Ft="";_t=[];for(vt in G[bt])this.terminals_[vt]&&vt>be&&_t.push("'"+this.terminals_[vt]+"'");Y.showPosition?Ft="Parse error on line "+(Pt+1)+`:
|
|
2
2
|
`+Y.showPosition()+`
|
|
3
|
-
Expecting `+_t.join(", ")+", got '"+(this.terminals_[K]||K)+"'":Ft="Parse error on line "+(
|
|
3
|
+
Expecting `+_t.join(", ")+", got '"+(this.terminals_[K]||K)+"'":Ft="Parse error on line "+(Pt+1)+": Unexpected "+(K==Qt?"end of input":"'"+(this.terminals_[K]||K)+"'"),this.parseError(Ft,{text:Y.match,token:this.terminals_[K]||K,line:Y.yylineno,loc:Yt,expected:_t})}if(it[0]instanceof Array&&it.length>1)throw new Error("Parse Error: multiple actions possible at state: "+bt+", token: "+K);switch(it[0]){case 1:k.push(K),O.push(Y.yytext),p.push(Y.yylloc),k.push(it[1]),K=null,Zt=Y.yyleng,x=Y.yytext,Pt=Y.yylineno,Yt=Y.yylloc;break;case 2:if(dt=this.productions_[it[1]][1],ft.$=O[O.length-dt],ft._$={first_line:p[p.length-(dt||1)].first_line,last_line:p[p.length-1].last_line,first_column:p[p.length-(dt||1)].first_column,last_column:p[p.length-1].last_column},Te&&(ft._$.range=[p[p.length-(dt||1)].range[0],p[p.length-1].range[1]]),Vt=this.performAction.apply(ft,[x,Zt,Pt,yt.yy,it[1],O,p].concat(me)),typeof Vt<"u")return Vt;dt&&(k=k.slice(0,-1*dt*2),O=O.slice(0,-1*dt),p=p.slice(0,-1*dt)),k.push(this.productions_[it[1]][0]),O.push(ft.$),p.push(ft._$),te=G[k[k.length-2]][k[k.length-1]],k.push(te);break;case 3:return!0}}return!0},"parse")},ye=function(){var ct={EOF:1,parseError:y(function(I,k){if(this.yy.parser)this.yy.parser.parseError(I,k);else throw new Error(I)},"parseError"),setInput:y(function(I,k){return this.yy=k||this.yy||{},this._input=I,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:y(function(){var I=this._input[0];this.yytext+=I,this.yyleng++,this.offset++,this.match+=I,this.matched+=I;var k=I.match(/(?:\r\n?|\n).*/g);return k?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),I},"input"),unput:y(function(I){var k=I.length,E=I.split(/(?:\r\n?|\n)/g);this._input=I+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-k),this.offset-=k;var O=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),E.length-1&&(this.yylineno-=E.length-1);var p=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:E?(E.length===O.length?this.yylloc.first_column:0)+O[O.length-E.length].length-E[0].length:this.yylloc.first_column-k},this.options.ranges&&(this.yylloc.range=[p[0],p[0]+this.yyleng-k]),this.yyleng=this.yytext.length,this},"unput"),more:y(function(){return this._more=!0,this},"more"),reject:y(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
|
|
4
4
|
`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:y(function(I){this.unput(this.match.slice(I))},"less"),pastInput:y(function(){var I=this.matched.substr(0,this.matched.length-this.match.length);return(I.length>20?"...":"")+I.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:y(function(){var I=this.match;return I.length<20&&(I+=this._input.substr(0,20-I.length)),(I.substr(0,20)+(I.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:y(function(){var I=this.pastInput(),k=new Array(I.length+1).join("-");return I+this.upcomingInput()+`
|
|
5
5
|
`+k+"^"},"showPosition"),test_match:y(function(I,k){var E,O,p;if(this.options.backtrack_lexer&&(p={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(p.yylloc.range=this.yylloc.range.slice(0))),O=I[0].match(/(?:\r\n?|\n).*/g),O&&(this.yylineno+=O.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:O?O[O.length-1].length-O[O.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+I[0].length},this.yytext+=I[0],this.match+=I[0],this.matches=I,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(I[0].length),this.matched+=I[0],E=this.performAction.call(this,this.yy,this,k,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),E)return E;if(this._backtrack){for(var G in p)this[G]=p[G];return!1}return!1},"test_match"),next:y(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var I,k,E,O;this._more||(this.yytext="",this.match="");for(var p=this._currentRules(),G=0;G<p.length;G++)if(E=this._input.match(this.rules[p[G]]),E&&(!k||E[0].length>k[0].length)){if(k=E,O=G,this.options.backtrack_lexer){if(I=this.test_match(E,p[G]),I!==!1)return I;if(this._backtrack){k=!1;continue}else return!1}else if(!this.options.flex)break}return k?(I=this.test_match(k,p[O]),I!==!1?I:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text.
|
|
6
|
-
`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:y(function(){var I=this.next();return I||this.lex()},"lex"),begin:y(function(I){this.conditionStack.push(I)},"begin"),popState:y(function(){var I=this.conditionStack.length-1;return I>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:y(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:y(function(I){return I=this.conditionStack.length-1-Math.abs(I||0),I>=0?this.conditionStack[I]:"INITIAL"},"topState"),pushState:y(function(I){this.begin(I)},"pushState"),stateStackSize:y(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:y(function(I,k,E,O){switch(E){case 0:return 5;case 1:break;case 2:break;case 3:break;case 4:break;case 5:break;case 6:return 19;case 7:return this.begin("CONFIG"),73;case 8:return 74;case 9:return this.popState(),this.popState(),75;case 10:return k.yytext=k.yytext.trim(),71;case 11:return k.yytext=k.yytext.trim(),this.begin("ALIAS"),71;case 12:return this.begin("LINE"),14;case 13:return this.begin("ID"),50;case 14:return this.begin("ID"),52;case 15:return 13;case 16:return this.begin("ID"),53;case 17:return k.yytext=k.yytext.trim(),this.begin("ALIAS"),71;case 18:return this.popState(),this.popState(),this.begin("LINE"),51;case 19:return this.popState(),this.popState(),5;case 20:return this.begin("LINE"),36;case 21:return this.begin("LINE"),37;case 22:return this.begin("LINE"),38;case 23:return this.begin("LINE"),39;case 24:return this.begin("LINE"),49;case 25:return this.begin("LINE"),41;case 26:return this.begin("LINE"),43;case 27:return this.begin("LINE"),48;case 28:return this.begin("LINE"),44;case 29:return this.begin("LINE"),47;case 30:return this.begin("LINE"),46;case 31:return this.popState(),15;case 32:return 16;case 33:return 66;case 34:return 67;case 35:return 60;case 36:return 61;case 37:return 62;case 38:return 63;case 39:return 58;case 40:return 55;case 41:return this.begin("ID"),21;case 42:return this.begin("ID"),23;case 43:return 29;case 44:return 30;case 45:return this.begin("acc_title"),31;case 46:return this.popState(),"acc_title_value";case 47:return this.begin("acc_descr"),33;case 48:return this.popState(),"acc_descr_value";case 49:this.begin("acc_descr_multiline");break;case 50:this.popState();break;case 51:return"acc_descr_multiline_value";case 52:return 6;case 53:return 18;case 54:return 20;case 55:return 65;case 56:return 5;case 57:return k.yytext=k.yytext.trim(),71;case 58:return 78;case 59:return 79;case 60:return 80;case 61:return 81;case 62:return 76;case 63:return 77;case 64:return 82;case 65:return 83;case 66:return 84;case 67:return 85;case 68:return 86;case 69:return 86;case 70:return 69;case 71:return 70;case 72:return 5;case 73:return"INVALID"}},"anonymous"),rules:[/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:((?!\n)\s)+)/i,/^(?:#[^\n]*)/i,/^(?:%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[0-9]+(?=[ \n]+))/i,/^(?:@\{)/i,/^(?:[^\}]+)/i,/^(?:\})/i,/^(?:[^\<->\->:\n,;@\s]+(?=@\{))/i,/^(?:[^\<->\->:\n,;@]+?([\-]*[^\<->\->:\n,;@]+?)*?(?=((?!\n)\s)+as(?!\n)\s|[#\n;]|$))/i,/^(?:box\b)/i,/^(?:participant\b)/i,/^(?:actor\b)/i,/^(?:create\b)/i,/^(?:destroy\b)/i,/^(?:[^<\->\->:\n,;]+?([\-]*[^<\->\->:\n,;]+?)*?(?=((?!\n)\s)+as(?!\n)\s|[#\n;]|$))/i,/^(?:as\b)/i,/^(?:(?:))/i,/^(?:loop\b)/i,/^(?:rect\b)/i,/^(?:opt\b)/i,/^(?:alt\b)/i,/^(?:else\b)/i,/^(?:par\b)/i,/^(?:par_over\b)/i,/^(?:and\b)/i,/^(?:critical\b)/i,/^(?:option\b)/i,/^(?:break\b)/i,/^(?:(?:[:]?(?:no)?wrap)?[^#\n;]*)/i,/^(?:end\b)/i,/^(?:left of\b)/i,/^(?:right of\b)/i,/^(?:links\b)/i,/^(?:link\b)/i,/^(?:properties\b)/i,/^(?:details\b)/i,/^(?:over\b)/i,/^(?:note\b)/i,/^(?:activate\b)/i,/^(?:deactivate\b)/i,/^(?:title\s[^#\n;]+)/i,/^(?:title:\s[^#\n;]+)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:sequenceDiagram\b)/i,/^(?:autonumber\b)/i,/^(?:off\b)/i,/^(?:,)/i,/^(?:;)/i,/^(?:[^+<\->\->:\n,;]+((?!(-x|--x|-\)|--\)))[\-]*[^\+<\->\->:\n,;]+)*)/i,/^(?:->>)/i,/^(?:<<->>)/i,/^(?:-->>)/i,/^(?:<<-->>)/i,/^(?:->)/i,/^(?:-->)/i,/^(?:-[x])/i,/^(?:--[x])/i,/^(?:-[\)])/i,/^(?:--[\)])/i,/^(?::(?:(?:no)?wrap)?[^#\n;]*)/i,/^(?::)/i,/^(?:\+)/i,/^(?:-)/i,/^(?:$)/i,/^(?:.)/i],conditions:{acc_descr_multiline:{rules:[50,51],inclusive:!1},acc_descr:{rules:[48],inclusive:!1},acc_title:{rules:[46],inclusive:!1},ID:{rules:[2,3,7,10,11,17],inclusive:!1},ALIAS:{rules:[2,3,18,19],inclusive:!1},LINE:{rules:[2,3,31],inclusive:!1},CONFIG:{rules:[8,9],inclusive:!1},CONFIG_DATA:{rules:[],inclusive:!1},INITIAL:{rules:[0,1,3,4,5,6,12,13,14,15,16,20,21,22,23,24,25,26,27,28,29,30,32,33,34,35,36,37,38,39,40,41,42,43,44,45,47,49,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73],inclusive:!0}}};return ct}();Ct.lexer=ye;function Lt(){this.yy={}}return y(Lt,"Parser"),Lt.prototype=Ct,Ct.Parser=Lt,new Lt}();zt.parser=zt;var Ce=zt,Be={SOLID:0,DOTTED:1,NOTE:2,SOLID_CROSS:3,DOTTED_CROSS:4,SOLID_OPEN:5,DOTTED_OPEN:6,LOOP_START:10,LOOP_END:11,ALT_START:12,ALT_ELSE:13,ALT_END:14,OPT_START:15,OPT_END:16,ACTIVE_START:17,ACTIVE_END:18,PAR_START:19,PAR_AND:20,PAR_END:21,RECT_START:22,RECT_END:23,SOLID_POINT:24,DOTTED_POINT:25,AUTONUMBER:26,CRITICAL_START:27,CRITICAL_OPTION:28,CRITICAL_END:29,BREAK_START:30,BREAK_END:31,PAR_OVER_START:32,BIDIRECTIONAL_SOLID:33,BIDIRECTIONAL_DOTTED:34},Ye={FILLED:0,OPEN:1},Ve={LEFTOF:0,RIGHTOF:1,OVER:2},Mt={ACTOR:"actor",CONTROL:"control",DATABASE:"database",ENTITY:"entity"},Wt,Fe=(Wt=class{constructor(){this.state=new Re(()=>({prevActor:void 0,actors:new Map,createdActors:new Map,destroyedActors:new Map,boxes:[],messages:[],notes:[],sequenceNumbersEnabled:!1,wrapEnabled:void 0,currentBox:void 0,lastCreated:void 0,lastDestroyed:void 0})),this.setAccTitle=ee,this.setAccDescription=
|
|
6
|
+
`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:y(function(){var I=this.next();return I||this.lex()},"lex"),begin:y(function(I){this.conditionStack.push(I)},"begin"),popState:y(function(){var I=this.conditionStack.length-1;return I>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:y(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:y(function(I){return I=this.conditionStack.length-1-Math.abs(I||0),I>=0?this.conditionStack[I]:"INITIAL"},"topState"),pushState:y(function(I){this.begin(I)},"pushState"),stateStackSize:y(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:y(function(I,k,E,O){switch(E){case 0:return 5;case 1:break;case 2:break;case 3:break;case 4:break;case 5:break;case 6:return 19;case 7:return this.begin("CONFIG"),73;case 8:return 74;case 9:return this.popState(),this.popState(),75;case 10:return k.yytext=k.yytext.trim(),71;case 11:return k.yytext=k.yytext.trim(),this.begin("ALIAS"),71;case 12:return this.begin("LINE"),14;case 13:return this.begin("ID"),50;case 14:return this.begin("ID"),52;case 15:return 13;case 16:return this.begin("ID"),53;case 17:return k.yytext=k.yytext.trim(),this.begin("ALIAS"),71;case 18:return this.popState(),this.popState(),this.begin("LINE"),51;case 19:return this.popState(),this.popState(),5;case 20:return this.begin("LINE"),36;case 21:return this.begin("LINE"),37;case 22:return this.begin("LINE"),38;case 23:return this.begin("LINE"),39;case 24:return this.begin("LINE"),49;case 25:return this.begin("LINE"),41;case 26:return this.begin("LINE"),43;case 27:return this.begin("LINE"),48;case 28:return this.begin("LINE"),44;case 29:return this.begin("LINE"),47;case 30:return this.begin("LINE"),46;case 31:return this.popState(),15;case 32:return 16;case 33:return 66;case 34:return 67;case 35:return 60;case 36:return 61;case 37:return 62;case 38:return 63;case 39:return 58;case 40:return 55;case 41:return this.begin("ID"),21;case 42:return this.begin("ID"),23;case 43:return 29;case 44:return 30;case 45:return this.begin("acc_title"),31;case 46:return this.popState(),"acc_title_value";case 47:return this.begin("acc_descr"),33;case 48:return this.popState(),"acc_descr_value";case 49:this.begin("acc_descr_multiline");break;case 50:this.popState();break;case 51:return"acc_descr_multiline_value";case 52:return 6;case 53:return 18;case 54:return 20;case 55:return 65;case 56:return 5;case 57:return k.yytext=k.yytext.trim(),71;case 58:return 78;case 59:return 79;case 60:return 80;case 61:return 81;case 62:return 76;case 63:return 77;case 64:return 82;case 65:return 83;case 66:return 84;case 67:return 85;case 68:return 86;case 69:return 86;case 70:return 69;case 71:return 70;case 72:return 5;case 73:return"INVALID"}},"anonymous"),rules:[/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:((?!\n)\s)+)/i,/^(?:#[^\n]*)/i,/^(?:%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[0-9]+(?=[ \n]+))/i,/^(?:@\{)/i,/^(?:[^\}]+)/i,/^(?:\})/i,/^(?:[^\<->\->:\n,;@\s]+(?=@\{))/i,/^(?:[^\<->\->:\n,;@]+?([\-]*[^\<->\->:\n,;@]+?)*?(?=((?!\n)\s)+as(?!\n)\s|[#\n;]|$))/i,/^(?:box\b)/i,/^(?:participant\b)/i,/^(?:actor\b)/i,/^(?:create\b)/i,/^(?:destroy\b)/i,/^(?:[^<\->\->:\n,;]+?([\-]*[^<\->\->:\n,;]+?)*?(?=((?!\n)\s)+as(?!\n)\s|[#\n;]|$))/i,/^(?:as\b)/i,/^(?:(?:))/i,/^(?:loop\b)/i,/^(?:rect\b)/i,/^(?:opt\b)/i,/^(?:alt\b)/i,/^(?:else\b)/i,/^(?:par\b)/i,/^(?:par_over\b)/i,/^(?:and\b)/i,/^(?:critical\b)/i,/^(?:option\b)/i,/^(?:break\b)/i,/^(?:(?:[:]?(?:no)?wrap)?[^#\n;]*)/i,/^(?:end\b)/i,/^(?:left of\b)/i,/^(?:right of\b)/i,/^(?:links\b)/i,/^(?:link\b)/i,/^(?:properties\b)/i,/^(?:details\b)/i,/^(?:over\b)/i,/^(?:note\b)/i,/^(?:activate\b)/i,/^(?:deactivate\b)/i,/^(?:title\s[^#\n;]+)/i,/^(?:title:\s[^#\n;]+)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:sequenceDiagram\b)/i,/^(?:autonumber\b)/i,/^(?:off\b)/i,/^(?:,)/i,/^(?:;)/i,/^(?:[^+<\->\->:\n,;]+((?!(-x|--x|-\)|--\)))[\-]*[^\+<\->\->:\n,;]+)*)/i,/^(?:->>)/i,/^(?:<<->>)/i,/^(?:-->>)/i,/^(?:<<-->>)/i,/^(?:->)/i,/^(?:-->)/i,/^(?:-[x])/i,/^(?:--[x])/i,/^(?:-[\)])/i,/^(?:--[\)])/i,/^(?::(?:(?:no)?wrap)?[^#\n;]*)/i,/^(?::)/i,/^(?:\+)/i,/^(?:-)/i,/^(?:$)/i,/^(?:.)/i],conditions:{acc_descr_multiline:{rules:[50,51],inclusive:!1},acc_descr:{rules:[48],inclusive:!1},acc_title:{rules:[46],inclusive:!1},ID:{rules:[2,3,7,10,11,17],inclusive:!1},ALIAS:{rules:[2,3,18,19],inclusive:!1},LINE:{rules:[2,3,31],inclusive:!1},CONFIG:{rules:[8,9],inclusive:!1},CONFIG_DATA:{rules:[],inclusive:!1},INITIAL:{rules:[0,1,3,4,5,6,12,13,14,15,16,20,21,22,23,24,25,26,27,28,29,30,32,33,34,35,36,37,38,39,40,41,42,43,44,45,47,49,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73],inclusive:!0}}};return ct}();Ct.lexer=ye;function Lt(){this.yy={}}return y(Lt,"Parser"),Lt.prototype=Ct,Ct.Parser=Lt,new Lt}();zt.parser=zt;var Ce=zt,Be={SOLID:0,DOTTED:1,NOTE:2,SOLID_CROSS:3,DOTTED_CROSS:4,SOLID_OPEN:5,DOTTED_OPEN:6,LOOP_START:10,LOOP_END:11,ALT_START:12,ALT_ELSE:13,ALT_END:14,OPT_START:15,OPT_END:16,ACTIVE_START:17,ACTIVE_END:18,PAR_START:19,PAR_AND:20,PAR_END:21,RECT_START:22,RECT_END:23,SOLID_POINT:24,DOTTED_POINT:25,AUTONUMBER:26,CRITICAL_START:27,CRITICAL_OPTION:28,CRITICAL_END:29,BREAK_START:30,BREAK_END:31,PAR_OVER_START:32,BIDIRECTIONAL_SOLID:33,BIDIRECTIONAL_DOTTED:34},Ye={FILLED:0,OPEN:1},Ve={LEFTOF:0,RIGHTOF:1,OVER:2},Mt={ACTOR:"actor",CONTROL:"control",DATABASE:"database",ENTITY:"entity"},Wt,Fe=(Wt=class{constructor(){this.state=new Re(()=>({prevActor:void 0,actors:new Map,createdActors:new Map,destroyedActors:new Map,boxes:[],messages:[],notes:[],sequenceNumbersEnabled:!1,wrapEnabled:void 0,currentBox:void 0,lastCreated:void 0,lastDestroyed:void 0})),this.setAccTitle=ee,this.setAccDescription=Pe,this.setDiagramTitle=ve,this.getAccTitle=_e,this.getAccDescription=Ae,this.getDiagramTitle=Ne,this.apply=this.apply.bind(this),this.parseBoxData=this.parseBoxData.bind(this),this.parseMessage=this.parseMessage.bind(this),this.clear(),this.setWrap(at().wrap),this.LINETYPE=Be,this.ARROWTYPE=Ye,this.PLACEMENT=Ve}addBox(e){this.state.records.boxes.push({name:e.text,wrap:e.wrap??this.autoWrap(),fill:e.color,actorKeys:[]}),this.state.records.currentBox=this.state.records.boxes.slice(-1)[0]}addActor(e,t,o,a,r){let s=this.state.records.currentBox,c;if(r!==void 0){let g;r.includes(`
|
|
7
7
|
`)?g=r+`
|
|
8
8
|
`:g=`{
|
|
9
9
|
`+r+`
|
|
@@ -129,17 +129,17 @@ Expecting `+_t.join(", ")+", got '"+(this.terminals_[K]||K)+"'":Ft="Parse error
|
|
|
129
129
|
stroke-width: 2px;
|
|
130
130
|
}
|
|
131
131
|
|
|
132
|
-
`,"getStyles"),qe=We,
|
|
133
|
-
a ${
|
|
134
|
-
h ${n.width-2*
|
|
135
|
-
a ${
|
|
132
|
+
`,"getStyles"),qe=We,mt=36,ut="actor-top",xt="actor-bottom",St="actor-box",gt="actor-man",It=y(function(e,t){return we(e,t)},"drawRect"),ze=y(function(e,t,o,a,r){if(t.links===void 0||t.links===null||Object.keys(t.links).length===0)return{height:0,width:0};const s=t.links,c=t.actorCnt,h=t.rectData;var g="none";r&&(g="block !important");const i=e.append("g");i.attr("id","actor"+c+"_popup"),i.attr("class","actorPopupMenu"),i.attr("display",g);var d="";h.class!==void 0&&(d=" "+h.class);let n=h.width>o?h.width:o;const u=i.append("rect");if(u.attr("class","actorPopupMenuPanel"+d),u.attr("x",h.x),u.attr("y",h.height),u.attr("fill",h.fill),u.attr("stroke",h.stroke),u.attr("width",n),u.attr("height",h.height),u.attr("rx",h.rx),u.attr("ry",h.ry),s!=null){var b=20;for(let v in s){var T=i.append("a"),w=re.sanitizeUrl(s[v]);T.attr("xlink:href",w),T.attr("target","_blank"),pa(a)(v,T,h.x+10,h.height+b,n,20,{class:"actor"},a),b+=30}}return u.attr("height",b),{height:h.height+b,width:n}},"drawPopup"),Dt=y(function(e){return"var pu = document.getElementById('"+e+"'); if (pu != null) { pu.style.display = pu.style.display == 'block' ? 'none' : 'block'; }"},"popupMenuToggle"),Ot=y(async function(e,t,o=null){let a=e.append("foreignObject");const r=await ie(t.text,qt()),s=a.append("xhtml:div").attr("style","width: fit-content;").attr("xmlns","http://www.w3.org/1999/xhtml").html(r).node().getBoundingClientRect();if(a.attr("height",Math.round(s.height)).attr("width",Math.round(s.width)),t.class==="noteText"){const c=e.node().firstChild;c.setAttribute("height",s.height+2*t.textMargin);const h=c.getBBox();a.attr("x",Math.round(h.x+h.width/2-s.width/2)).attr("y",Math.round(h.y+h.height/2-s.height/2))}else if(o){let{startx:c,stopx:h,starty:g}=o;if(c>h){const i=c;c=h,h=i}a.attr("x",Math.round(c+Math.abs(c-h)/2-s.width/2)),t.class==="loopText"?a.attr("y",Math.round(g)):a.attr("y",Math.round(g-s.height))}return[a]},"drawKatex"),wt=y(function(e,t){let o=0,a=0;const r=t.text.split(L.lineBreakRegex),[s,c]=se(t.fontSize);let h=[],g=0,i=y(()=>t.y,"yfunc");if(t.valign!==void 0&&t.textMargin!==void 0&&t.textMargin>0)switch(t.valign){case"top":case"start":i=y(()=>Math.round(t.y+t.textMargin),"yfunc");break;case"middle":case"center":i=y(()=>Math.round(t.y+(o+a+t.textMargin)/2),"yfunc");break;case"bottom":case"end":i=y(()=>Math.round(t.y+(o+a+2*t.textMargin)-t.textMargin),"yfunc");break}if(t.anchor!==void 0&&t.textMargin!==void 0&&t.width!==void 0)switch(t.anchor){case"left":case"start":t.x=Math.round(t.x+t.textMargin),t.anchor="start",t.dominantBaseline="middle",t.alignmentBaseline="middle";break;case"middle":case"center":t.x=Math.round(t.x+t.width/2),t.anchor="middle",t.dominantBaseline="middle",t.alignmentBaseline="middle";break;case"right":case"end":t.x=Math.round(t.x+t.width-t.textMargin),t.anchor="end",t.dominantBaseline="middle",t.alignmentBaseline="middle";break}for(let[d,n]of r.entries()){t.textMargin!==void 0&&t.textMargin===0&&s!==void 0&&(g=d*s);const u=e.append("text");u.attr("x",t.x),u.attr("y",i()),t.anchor!==void 0&&u.attr("text-anchor",t.anchor).attr("dominant-baseline",t.dominantBaseline).attr("alignment-baseline",t.alignmentBaseline),t.fontFamily!==void 0&&u.style("font-family",t.fontFamily),c!==void 0&&u.style("font-size",c),t.fontWeight!==void 0&&u.style("font-weight",t.fontWeight),t.fill!==void 0&&u.attr("fill",t.fill),t.class!==void 0&&u.attr("class",t.class),t.dy!==void 0?u.attr("dy",t.dy):g!==0&&u.attr("dy",g);const b=n||De;if(t.tspan){const T=u.append("tspan");T.attr("x",t.x),t.fill!==void 0&&T.attr("fill",t.fill),T.text(b)}else u.text(b);t.valign!==void 0&&t.textMargin!==void 0&&t.textMargin>0&&(a+=(u._groups||u)[0][0].getBBox().height,o=a),h.push(u)}return h},"drawText"),oe=y(function(e,t){function o(r,s,c,h,g){return r+","+s+" "+(r+c)+","+s+" "+(r+c)+","+(s+h-g)+" "+(r+c-g*1.2)+","+(s+h)+" "+r+","+(s+h)}y(o,"genPoints");const a=e.append("polygon");return a.attr("points",o(t.x,t.y,t.width,t.height,7)),a.attr("class","labelBox"),t.y=t.y+t.height/2,wt(e,t),a},"drawLabel"),_=-1,ne=y((e,t,o,a)=>{e.select&&o.forEach(r=>{const s=t.get(r),c=e.select("#actor"+s.actorCnt);!a.mirrorActors&&s.stopy?c.attr("y2",s.stopy+s.height/2):a.mirrorActors&&c.attr("y2",s.stopy)})},"fixLifeLineHeights"),He=y(function(e,t,o,a){var r,s;const c=a?t.stopy:t.starty,h=t.x+t.width/2,g=c+t.height,i=e.append("g").lower();var d=i;a||(_++,Object.keys(t.links||{}).length&&!o.forceMenus&&d.attr("onclick",Dt(`actor${_}_popup`)).attr("cursor","pointer"),d.append("line").attr("id","actor"+_).attr("x1",h).attr("y1",g).attr("x2",h).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",t.name),d=i.append("g"),t.actorCnt=_,t.links!=null&&d.attr("id","root-"+_));const n=lt();var u="actor";(r=t.properties)!=null&&r.class?u=t.properties.class:n.fill="#eaeaea",a?u+=` ${xt}`:u+=` ${ut}`,n.x=t.x,n.y=c,n.width=t.width,n.height=t.height,n.class=u,n.rx=3,n.ry=3,n.name=t.name;const b=It(d,n);if(t.rectData=n,(s=t.properties)!=null&&s.icon){const w=t.properties.icon.trim();w.charAt(0)==="@"?Gt(d,n.x+n.width-20,n.y+10,w.substr(1)):Kt(d,n.x+n.width-20,n.y+10,w)}pt(o,W(t.description))(t.description,d,n.x,n.y,n.width,n.height,{class:`actor ${St}`},o);let T=t.height;if(b.node){const w=b.node().getBBox();t.height=w.height,T=w.height}return T},"drawActorTypeParticipant"),je=y(function(e,t,o,a){var r,s;const c=a?t.stopy:t.starty,h=t.x+t.width/2,g=c+t.height,i=e.append("g").lower();var d=i;a||(_++,Object.keys(t.links||{}).length&&!o.forceMenus&&d.attr("onclick",Dt(`actor${_}_popup`)).attr("cursor","pointer"),d.append("line").attr("id","actor"+_).attr("x1",h).attr("y1",g).attr("x2",h).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",t.name),d=i.append("g"),t.actorCnt=_,t.links!=null&&d.attr("id","root-"+_));const n=lt();var u="actor";(r=t.properties)!=null&&r.class?u=t.properties.class:n.fill="#eaeaea",a?u+=` ${xt}`:u+=` ${ut}`,n.x=t.x,n.y=c,n.width=t.width,n.height=t.height,n.class=u,n.name=t.name;const b=6,T={...n,x:n.x+-b,y:n.y+ +b,class:"actor"},w=It(d,n);if(It(d,T),t.rectData=n,(s=t.properties)!=null&&s.icon){const A=t.properties.icon.trim();A.charAt(0)==="@"?Gt(d,n.x+n.width-20,n.y+10,A.substr(1)):Kt(d,n.x+n.width-20,n.y+10,A)}pt(o,W(t.description))(t.description,d,n.x-b,n.y+b,n.width,n.height,{class:`actor ${St}`},o);let v=t.height;if(w.node){const A=w.node().getBBox();t.height=A.height,v=A.height}return v},"drawActorTypeCollections"),Ue=y(function(e,t,o,a){var r,s;const c=a?t.stopy:t.starty,h=t.x+t.width/2,g=c+t.height,i=e.append("g").lower();let d=i;a||(_++,Object.keys(t.links||{}).length&&!o.forceMenus&&d.attr("onclick",Dt(`actor${_}_popup`)).attr("cursor","pointer"),d.append("line").attr("id","actor"+_).attr("x1",h).attr("y1",g).attr("x2",h).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",t.name),d=i.append("g"),t.actorCnt=_,t.links!=null&&d.attr("id","root-"+_));const n=lt();let u="actor";(r=t.properties)!=null&&r.class?u=t.properties.class:n.fill="#eaeaea",a?u+=` ${xt}`:u+=` ${ut}`,n.x=t.x,n.y=c,n.width=t.width,n.height=t.height,n.class=u,n.name=t.name;const b=n.height/2,T=b/(2.5+n.height/50),w=d.append("g"),v=d.append("g");if(w.append("path").attr("d",`M ${n.x},${n.y+b}
|
|
133
|
+
a ${T},${b} 0 0 0 0,${n.height}
|
|
134
|
+
h ${n.width-2*T}
|
|
135
|
+
a ${T},${b} 0 0 0 0,-${n.height}
|
|
136
136
|
Z
|
|
137
|
-
`).attr("class",u),
|
|
138
|
-
a ${
|
|
137
|
+
`).attr("class",u),v.append("path").attr("d",`M ${n.x},${n.y+b}
|
|
138
|
+
a ${T},${b} 0 0 0 0,${n.height}`).attr("stroke","#666").attr("stroke-width","1px").attr("class",u),w.attr("transform",`translate(${T}, ${-(n.height/2)})`),v.attr("transform",`translate(${n.width-T}, ${-n.height/2})`),t.rectData=n,(s=t.properties)!=null&&s.icon){const M=t.properties.icon.trim(),$=n.x+n.width-20,B=n.y+10;M.charAt(0)==="@"?Gt(d,$,B,M.substr(1)):Kt(d,$,B,M)}pt(o,W(t.description))(t.description,d,n.x,n.y,n.width,n.height,{class:`actor ${St}`},o);let A=t.height;const N=w.select("path:last-child");if(N.node()){const M=N.node().getBBox();t.height=M.height,A=M.height}return A},"drawActorTypeQueue"),Ge=y(function(e,t,o,a){var r;const s=a?t.stopy:t.starty,c=t.x+t.width/2,h=s+75,g=e.append("g").lower();a||(_++,g.append("line").attr("id","actor"+_).attr("x1",c).attr("y1",h).attr("x2",c).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",t.name),t.actorCnt=_);const i=e.append("g");let d=gt;a?d+=` ${xt}`:d+=` ${ut}`,i.attr("class",d),i.attr("name",t.name);const n=lt();n.x=t.x,n.y=s,n.fill="#eaeaea",n.width=t.width,n.height=t.height,n.class="actor";const u=t.x+t.width/2,b=s+30,T=18;i.append("defs").append("marker").attr("id","filled-head-control").attr("refX",11).attr("refY",5.8).attr("markerWidth",20).attr("markerHeight",28).attr("orient","172.5").append("path").attr("d","M 14.4 5.6 L 7.2 10.4 L 8.8 5.6 L 7.2 0.8 Z"),i.append("circle").attr("cx",u).attr("cy",b).attr("r",T).attr("fill","#eaeaf7").attr("stroke","#666").attr("stroke-width",1.2),i.append("line").attr("marker-end","url(#filled-head-control)").attr("transform",`translate(${u}, ${b-T})`);const w=i.node().getBBox();return t.height=w.height+2*(((r=o==null?void 0:o.sequence)==null?void 0:r.labelBoxHeight)??0),pt(o,W(t.description))(t.description,i,n.x,n.y+T+(a?5:10),n.width,n.height,{class:`actor ${gt}`},o),t.height},"drawActorTypeControl"),Ke=y(function(e,t,o,a){var r;const s=a?t.stopy:t.starty,c=t.x+t.width/2,h=s+75,g=e.append("g").lower(),i=e.append("g");let d=gt;a?d+=` ${xt}`:d+=` ${ut}`,i.attr("class",d),i.attr("name",t.name);const n=lt();n.x=t.x,n.y=s,n.fill="#eaeaea",n.width=t.width,n.height=t.height,n.class="actor";const u=t.x+t.width/2,b=s+(a?10:25),T=18;i.append("circle").attr("cx",u).attr("cy",b).attr("r",T).attr("width",t.width).attr("height",t.height),i.append("line").attr("x1",u-T).attr("x2",u+T).attr("y1",b+T).attr("y2",b+T).attr("stroke","#333").attr("stroke-width",2);const w=i.node().getBBox();return t.height=w.height+(((r=o==null?void 0:o.sequence)==null?void 0:r.labelBoxHeight)??0),a||(_++,g.append("line").attr("id","actor"+_).attr("x1",c).attr("y1",h).attr("x2",c).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",t.name),t.actorCnt=_),pt(o,W(t.description))(t.description,i,n.x,n.y+(a?(b-s+T-5)/2:(b+T-s)/2),n.width,n.height,{class:`actor ${gt}`},o),a?i.attr("transform",`translate(0, ${T/2})`):i.attr("transform",`translate(0, ${T/2})`),t.height},"drawActorTypeEntity"),Xe=y(function(e,t,o,a){var r;const s=a?t.stopy:t.starty,c=t.x+t.width/2,h=s+t.height+2*o.boxTextMargin,g=e.append("g").lower();let i=g;a||(_++,Object.keys(t.links||{}).length&&!o.forceMenus&&i.attr("onclick",Dt(`actor${_}_popup`)).attr("cursor","pointer"),i.append("line").attr("id","actor"+_).attr("x1",c).attr("y1",h).attr("x2",c).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",t.name),i=g.append("g"),t.actorCnt=_,t.links!=null&&i.attr("id","root-"+_));const d=lt();let n="actor";(r=t.properties)!=null&&r.class?n=t.properties.class:d.fill="#eaeaea",a?n+=` ${xt}`:n+=` ${ut}`,d.x=t.x,d.y=s,d.width=t.width,d.height=t.height,d.class=n,d.name=t.name,d.x=t.x,d.y=s;const u=d.width/4,b=d.width/4,T=u/2,w=T/(2.5+u/50),v=i.append("g"),A=`
|
|
139
139
|
M ${d.x},${d.y+w}
|
|
140
|
-
a ${
|
|
141
|
-
a ${
|
|
140
|
+
a ${T},${w} 0 0 0 ${u},0
|
|
141
|
+
a ${T},${w} 0 0 0 -${u},0
|
|
142
142
|
l 0,${b-2*w}
|
|
143
|
-
a ${
|
|
143
|
+
a ${T},${w} 0 0 0 ${u},0
|
|
144
144
|
l 0,-${b-2*w}
|
|
145
|
-
`;P.append("path").attr("d",A).attr("fill","#eaeaea").attr("stroke","#000").attr("stroke-width",1).attr("class",n),a?P.attr("transform",`translate(${u*1.5}, ${d.height/4-2*w})`):P.attr("transform",`translate(${u*1.5}, ${(d.height+w)/4})`),t.rectData=d,pt(o,W(t.description))(t.description,i,d.x,d.y+(a?(d.height+b)/4:(d.height+w)/2),d.width,d.height,{class:`actor ${St}`},o);const N=P.select("path:last-child");if(N.node()){const M=N.node().getBBox();t.height=M.height+(o.sequence.labelBoxHeight??0)}return t.height},"drawActorTypeDatabase"),Ze=y(function(e,t,o,a){const r=a?t.stopy:t.starty,s=t.x+t.width/2,c=r+80,h=30,g=e.append("g").lower();a||(_++,g.append("line").attr("id","actor"+_).attr("x1",s).attr("y1",c).attr("x2",s).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",t.name),t.actorCnt=_);const i=e.append("g");let d=gt;a?d+=` ${xt}`:d+=` ${ut}`,i.attr("class",d),i.attr("name",t.name);const n=lt();n.x=t.x,n.y=r,n.fill="#eaeaea",n.width=t.width,n.height=t.height,n.class="actor",i.append("line").attr("id","actor-man-torso"+_).attr("x1",t.x+t.width/2-h*2.5).attr("y1",r+10).attr("x2",t.x+t.width/2-15).attr("y2",r+10),i.append("line").attr("id","actor-man-arms"+_).attr("x1",t.x+t.width/2-h*2.5).attr("y1",r+0).attr("x2",t.x+t.width/2-h*2.5).attr("y2",r+20),i.append("circle").attr("cx",t.x+t.width/2).attr("cy",r+10).attr("r",h);const u=i.node().getBBox();return t.height=u.height+(o.sequence.labelBoxHeight??0),pt(o,W(t.description))(t.description,i,n.x,n.y+(a?h/2-4:h/2+3),n.width,n.height,{class:`actor ${gt}`},o),a?i.attr("transform",`translate(0,${h/2+7})`):i.attr("transform",`translate(0,${h/2+7})`),t.height},"drawActorTypeBoundary"),Qe=y(function(e,t,o,a){const r=a?t.stopy:t.starty,s=t.x+t.width/2,c=r+80,h=e.append("g").lower();a||(_++,h.append("line").attr("id","actor"+_).attr("x1",s).attr("y1",c).attr("x2",s).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",t.name),t.actorCnt=_);const g=e.append("g");let i=gt;a?i+=` ${xt}`:i+=` ${ut}`,g.attr("class",i),g.attr("name",t.name);const d=lt();d.x=t.x,d.y=r,d.fill="#eaeaea",d.width=t.width,d.height=t.height,d.class="actor",d.rx=3,d.ry=3,g.append("line").attr("id","actor-man-torso"+_).attr("x1",s).attr("y1",r+25).attr("x2",s).attr("y2",r+45),g.append("line").attr("id","actor-man-arms"+_).attr("x1",s-ft/2).attr("y1",r+33).attr("x2",s+ft/2).attr("y2",r+33),g.append("line").attr("x1",s-ft/2).attr("y1",r+60).attr("x2",s).attr("y2",r+45),g.append("line").attr("x1",s).attr("y1",r+45).attr("x2",s+ft/2-2).attr("y2",r+60);const n=g.append("circle");n.attr("cx",t.x+t.width/2),n.attr("cy",r+10),n.attr("r",15),n.attr("width",t.width),n.attr("height",t.height);const u=g.node().getBBox();return t.height=u.height,pt(o,W(t.description))(t.description,g,d.x,d.y+35,d.width,d.height,{class:`actor ${gt}`},o),t.height},"drawActorTypeActor"),Je=y(async function(e,t,o,a){switch(t.type){case"actor":return await Qe(e,t,o,a);case"participant":return await He(e,t,o,a);case"boundary":return await Ze(e,t,o,a);case"control":return await Ge(e,t,o,a);case"entity":return await Ke(e,t,o,a);case"database":return await Xe(e,t,o,a);case"collections":return await je(e,t,o,a);case"queue":return await Ue(e,t,o,a)}},"drawActor"),ta=y(function(e,t,o){const a=e.append("g");ce(a,t),t.name&&pt(o)(t.name,a,t.x,t.y+o.boxTextMargin+(t.textMaxHeight||0)/2,t.width,0,{class:"text"},o),a.lower()},"drawBox"),ea=y(function(e){return e.append("g")},"anchorElement"),aa=y(function(e,t,o,a,r){const s=lt(),c=t.anchored;s.x=t.startx,s.y=t.starty,s.class="activation"+r%3,s.width=t.stopx-t.startx,s.height=o-t.starty,It(c,s)},"drawActivation"),ra=y(async function(e,t,o,a){const{boxMargin:r,boxTextMargin:s,labelBoxHeight:c,labelBoxWidth:h,messageFontFamily:g,messageFontSize:i,messageFontWeight:d}=a,n=e.append("g"),u=y(function(w,P,A,N){return n.append("line").attr("x1",w).attr("y1",P).attr("x2",A).attr("y2",N).attr("class","loopLine")},"drawLoopLine");u(t.startx,t.starty,t.stopx,t.starty),u(t.stopx,t.starty,t.stopx,t.stopy),u(t.startx,t.stopy,t.stopx,t.stopy),u(t.startx,t.starty,t.startx,t.stopy),t.sections!==void 0&&t.sections.forEach(function(w){u(t.startx,w.y,t.stopx,w.y).style("stroke-dasharray","3, 3")});let b=Ut();b.text=o,b.x=t.startx,b.y=t.starty,b.fontFamily=g,b.fontSize=i,b.fontWeight=d,b.anchor="middle",b.valign="middle",b.tspan=!1,b.width=h||50,b.height=c||20,b.textMargin=s,b.class="labelText",oe(n,b),b=le(),b.text=t.title,b.x=t.startx+h/2+(t.stopx-t.startx)/2,b.y=t.starty+r+s,b.anchor="middle",b.valign="middle",b.textMargin=s,b.class="loopText",b.fontFamily=g,b.fontSize=i,b.fontWeight=d,b.wrap=!0;let m=W(b.text)?await Ot(n,b,t):wt(n,b);if(t.sectionTitles!==void 0){for(const[w,P]of Object.entries(t.sectionTitles))if(P.message){b.text=P.message,b.x=t.startx+(t.stopx-t.startx)/2,b.y=t.sections[w].y+r+s,b.class="loopText",b.anchor="middle",b.valign="middle",b.tspan=!1,b.fontFamily=g,b.fontSize=i,b.fontWeight=d,b.wrap=t.wrap,W(b.text)?(t.starty=t.sections[w].y,await Ot(n,b,t)):wt(n,b);let A=Math.round(m.map(N=>(N._groups||N)[0][0].getBBox().height).reduce((N,M)=>N+M));t.sections[w].height+=A-(r+s)}}return t.height=Math.round(t.stopy-t.starty),n},"drawLoop"),ce=y(function(e,t){Ee(e,t)},"drawBackgroundRect"),sa=y(function(e){e.append("defs").append("symbol").attr("id","database").attr("fill-rule","evenodd").attr("clip-rule","evenodd").append("path").attr("transform","scale(.5)").attr("d","M12.258.001l.256.004.255.005.253.008.251.01.249.012.247.015.246.016.242.019.241.02.239.023.236.024.233.027.231.028.229.031.225.032.223.034.22.036.217.038.214.04.211.041.208.043.205.045.201.046.198.048.194.05.191.051.187.053.183.054.18.056.175.057.172.059.168.06.163.061.16.063.155.064.15.066.074.033.073.033.071.034.07.034.069.035.068.035.067.035.066.035.064.036.064.036.062.036.06.036.06.037.058.037.058.037.055.038.055.038.053.038.052.038.051.039.05.039.048.039.047.039.045.04.044.04.043.04.041.04.04.041.039.041.037.041.036.041.034.041.033.042.032.042.03.042.029.042.027.042.026.043.024.043.023.043.021.043.02.043.018.044.017.043.015.044.013.044.012.044.011.045.009.044.007.045.006.045.004.045.002.045.001.045v17l-.001.045-.002.045-.004.045-.006.045-.007.045-.009.044-.011.045-.012.044-.013.044-.015.044-.017.043-.018.044-.02.043-.021.043-.023.043-.024.043-.026.043-.027.042-.029.042-.03.042-.032.042-.033.042-.034.041-.036.041-.037.041-.039.041-.04.041-.041.04-.043.04-.044.04-.045.04-.047.039-.048.039-.05.039-.051.039-.052.038-.053.038-.055.038-.055.038-.058.037-.058.037-.06.037-.06.036-.062.036-.064.036-.064.036-.066.035-.067.035-.068.035-.069.035-.07.034-.071.034-.073.033-.074.033-.15.066-.155.064-.16.063-.163.061-.168.06-.172.059-.175.057-.18.056-.183.054-.187.053-.191.051-.194.05-.198.048-.201.046-.205.045-.208.043-.211.041-.214.04-.217.038-.22.036-.223.034-.225.032-.229.031-.231.028-.233.027-.236.024-.239.023-.241.02-.242.019-.246.016-.247.015-.249.012-.251.01-.253.008-.255.005-.256.004-.258.001-.258-.001-.256-.004-.255-.005-.253-.008-.251-.01-.249-.012-.247-.015-.245-.016-.243-.019-.241-.02-.238-.023-.236-.024-.234-.027-.231-.028-.228-.031-.226-.032-.223-.034-.22-.036-.217-.038-.214-.04-.211-.041-.208-.043-.204-.045-.201-.046-.198-.048-.195-.05-.19-.051-.187-.053-.184-.054-.179-.056-.176-.057-.172-.059-.167-.06-.164-.061-.159-.063-.155-.064-.151-.066-.074-.033-.072-.033-.072-.034-.07-.034-.069-.035-.068-.035-.067-.035-.066-.035-.064-.036-.063-.036-.062-.036-.061-.036-.06-.037-.058-.037-.057-.037-.056-.038-.055-.038-.053-.038-.052-.038-.051-.039-.049-.039-.049-.039-.046-.039-.046-.04-.044-.04-.043-.04-.041-.04-.04-.041-.039-.041-.037-.041-.036-.041-.034-.041-.033-.042-.032-.042-.03-.042-.029-.042-.027-.042-.026-.043-.024-.043-.023-.043-.021-.043-.02-.043-.018-.044-.017-.043-.015-.044-.013-.044-.012-.044-.011-.045-.009-.044-.007-.045-.006-.045-.004-.045-.002-.045-.001-.045v-17l.001-.045.002-.045.004-.045.006-.045.007-.045.009-.044.011-.045.012-.044.013-.044.015-.044.017-.043.018-.044.02-.043.021-.043.023-.043.024-.043.026-.043.027-.042.029-.042.03-.042.032-.042.033-.042.034-.041.036-.041.037-.041.039-.041.04-.041.041-.04.043-.04.044-.04.046-.04.046-.039.049-.039.049-.039.051-.039.052-.038.053-.038.055-.038.056-.038.057-.037.058-.037.06-.037.061-.036.062-.036.063-.036.064-.036.066-.035.067-.035.068-.035.069-.035.07-.034.072-.034.072-.033.074-.033.151-.066.155-.064.159-.063.164-.061.167-.06.172-.059.176-.057.179-.056.184-.054.187-.053.19-.051.195-.05.198-.048.201-.046.204-.045.208-.043.211-.041.214-.04.217-.038.22-.036.223-.034.226-.032.228-.031.231-.028.234-.027.236-.024.238-.023.241-.02.243-.019.245-.016.247-.015.249-.012.251-.01.253-.008.255-.005.256-.004.258-.001.258.001zm-9.258 20.499v.01l.001.021.003.021.004.022.005.021.006.022.007.022.009.023.01.022.011.023.012.023.013.023.015.023.016.024.017.023.018.024.019.024.021.024.022.025.023.024.024.025.052.049.056.05.061.051.066.051.07.051.075.051.079.052.084.052.088.052.092.052.097.052.102.051.105.052.11.052.114.051.119.051.123.051.127.05.131.05.135.05.139.048.144.049.147.047.152.047.155.047.16.045.163.045.167.043.171.043.176.041.178.041.183.039.187.039.19.037.194.035.197.035.202.033.204.031.209.03.212.029.216.027.219.025.222.024.226.021.23.02.233.018.236.016.24.015.243.012.246.01.249.008.253.005.256.004.259.001.26-.001.257-.004.254-.005.25-.008.247-.011.244-.012.241-.014.237-.016.233-.018.231-.021.226-.021.224-.024.22-.026.216-.027.212-.028.21-.031.205-.031.202-.034.198-.034.194-.036.191-.037.187-.039.183-.04.179-.04.175-.042.172-.043.168-.044.163-.045.16-.046.155-.046.152-.047.148-.048.143-.049.139-.049.136-.05.131-.05.126-.05.123-.051.118-.052.114-.051.11-.052.106-.052.101-.052.096-.052.092-.052.088-.053.083-.051.079-.052.074-.052.07-.051.065-.051.06-.051.056-.05.051-.05.023-.024.023-.025.021-.024.02-.024.019-.024.018-.024.017-.024.015-.023.014-.024.013-.023.012-.023.01-.023.01-.022.008-.022.006-.022.006-.022.004-.022.004-.021.001-.021.001-.021v-4.127l-.077.055-.08.053-.083.054-.085.053-.087.052-.09.052-.093.051-.095.05-.097.05-.1.049-.102.049-.105.048-.106.047-.109.047-.111.046-.114.045-.115.045-.118.044-.12.043-.122.042-.124.042-.126.041-.128.04-.13.04-.132.038-.134.038-.135.037-.138.037-.139.035-.142.035-.143.034-.144.033-.147.032-.148.031-.15.03-.151.03-.153.029-.154.027-.156.027-.158.026-.159.025-.161.024-.162.023-.163.022-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.011-.178.01-.179.008-.179.008-.181.006-.182.005-.182.004-.184.003-.184.002h-.37l-.184-.002-.184-.003-.182-.004-.182-.005-.181-.006-.179-.008-.179-.008-.178-.01-.176-.011-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.022-.162-.023-.161-.024-.159-.025-.157-.026-.156-.027-.155-.027-.153-.029-.151-.03-.15-.03-.148-.031-.146-.032-.145-.033-.143-.034-.141-.035-.14-.035-.137-.037-.136-.037-.134-.038-.132-.038-.13-.04-.128-.04-.126-.041-.124-.042-.122-.042-.12-.044-.117-.043-.116-.045-.113-.045-.112-.046-.109-.047-.106-.047-.105-.048-.102-.049-.1-.049-.097-.05-.095-.05-.093-.052-.09-.051-.087-.052-.085-.053-.083-.054-.08-.054-.077-.054v4.127zm0-5.654v.011l.001.021.003.021.004.021.005.022.006.022.007.022.009.022.01.022.011.023.012.023.013.023.015.024.016.023.017.024.018.024.019.024.021.024.022.024.023.025.024.024.052.05.056.05.061.05.066.051.07.051.075.052.079.051.084.052.088.052.092.052.097.052.102.052.105.052.11.051.114.051.119.052.123.05.127.051.131.05.135.049.139.049.144.048.147.048.152.047.155.046.16.045.163.045.167.044.171.042.176.042.178.04.183.04.187.038.19.037.194.036.197.034.202.033.204.032.209.03.212.028.216.027.219.025.222.024.226.022.23.02.233.018.236.016.24.014.243.012.246.01.249.008.253.006.256.003.259.001.26-.001.257-.003.254-.006.25-.008.247-.01.244-.012.241-.015.237-.016.233-.018.231-.02.226-.022.224-.024.22-.025.216-.027.212-.029.21-.03.205-.032.202-.033.198-.035.194-.036.191-.037.187-.039.183-.039.179-.041.175-.042.172-.043.168-.044.163-.045.16-.045.155-.047.152-.047.148-.048.143-.048.139-.05.136-.049.131-.05.126-.051.123-.051.118-.051.114-.052.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.051.07-.052.065-.051.06-.05.056-.051.051-.049.023-.025.023-.024.021-.025.02-.024.019-.024.018-.024.017-.024.015-.023.014-.023.013-.024.012-.022.01-.023.01-.023.008-.022.006-.022.006-.022.004-.021.004-.022.001-.021.001-.021v-4.139l-.077.054-.08.054-.083.054-.085.052-.087.053-.09.051-.093.051-.095.051-.097.05-.1.049-.102.049-.105.048-.106.047-.109.047-.111.046-.114.045-.115.044-.118.044-.12.044-.122.042-.124.042-.126.041-.128.04-.13.039-.132.039-.134.038-.135.037-.138.036-.139.036-.142.035-.143.033-.144.033-.147.033-.148.031-.15.03-.151.03-.153.028-.154.028-.156.027-.158.026-.159.025-.161.024-.162.023-.163.022-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.011-.178.009-.179.009-.179.007-.181.007-.182.005-.182.004-.184.003-.184.002h-.37l-.184-.002-.184-.003-.182-.004-.182-.005-.181-.007-.179-.007-.179-.009-.178-.009-.176-.011-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.022-.162-.023-.161-.024-.159-.025-.157-.026-.156-.027-.155-.028-.153-.028-.151-.03-.15-.03-.148-.031-.146-.033-.145-.033-.143-.033-.141-.035-.14-.036-.137-.036-.136-.037-.134-.038-.132-.039-.13-.039-.128-.04-.126-.041-.124-.042-.122-.043-.12-.043-.117-.044-.116-.044-.113-.046-.112-.046-.109-.046-.106-.047-.105-.048-.102-.049-.1-.049-.097-.05-.095-.051-.093-.051-.09-.051-.087-.053-.085-.052-.083-.054-.08-.054-.077-.054v4.139zm0-5.666v.011l.001.02.003.022.004.021.005.022.006.021.007.022.009.023.01.022.011.023.012.023.013.023.015.023.016.024.017.024.018.023.019.024.021.025.022.024.023.024.024.025.052.05.056.05.061.05.066.051.07.051.075.052.079.051.084.052.088.052.092.052.097.052.102.052.105.051.11.052.114.051.119.051.123.051.127.05.131.05.135.05.139.049.144.048.147.048.152.047.155.046.16.045.163.045.167.043.171.043.176.042.178.04.183.04.187.038.19.037.194.036.197.034.202.033.204.032.209.03.212.028.216.027.219.025.222.024.226.021.23.02.233.018.236.017.24.014.243.012.246.01.249.008.253.006.256.003.259.001.26-.001.257-.003.254-.006.25-.008.247-.01.244-.013.241-.014.237-.016.233-.018.231-.02.226-.022.224-.024.22-.025.216-.027.212-.029.21-.03.205-.032.202-.033.198-.035.194-.036.191-.037.187-.039.183-.039.179-.041.175-.042.172-.043.168-.044.163-.045.16-.045.155-.047.152-.047.148-.048.143-.049.139-.049.136-.049.131-.051.126-.05.123-.051.118-.052.114-.051.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.052.07-.051.065-.051.06-.051.056-.05.051-.049.023-.025.023-.025.021-.024.02-.024.019-.024.018-.024.017-.024.015-.023.014-.024.013-.023.012-.023.01-.022.01-.023.008-.022.006-.022.006-.022.004-.022.004-.021.001-.021.001-.021v-4.153l-.077.054-.08.054-.083.053-.085.053-.087.053-.09.051-.093.051-.095.051-.097.05-.1.049-.102.048-.105.048-.106.048-.109.046-.111.046-.114.046-.115.044-.118.044-.12.043-.122.043-.124.042-.126.041-.128.04-.13.039-.132.039-.134.038-.135.037-.138.036-.139.036-.142.034-.143.034-.144.033-.147.032-.148.032-.15.03-.151.03-.153.028-.154.028-.156.027-.158.026-.159.024-.161.024-.162.023-.163.023-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.01-.178.01-.179.009-.179.007-.181.006-.182.006-.182.004-.184.003-.184.001-.185.001-.185-.001-.184-.001-.184-.003-.182-.004-.182-.006-.181-.006-.179-.007-.179-.009-.178-.01-.176-.01-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.023-.162-.023-.161-.024-.159-.024-.157-.026-.156-.027-.155-.028-.153-.028-.151-.03-.15-.03-.148-.032-.146-.032-.145-.033-.143-.034-.141-.034-.14-.036-.137-.036-.136-.037-.134-.038-.132-.039-.13-.039-.128-.041-.126-.041-.124-.041-.122-.043-.12-.043-.117-.044-.116-.044-.113-.046-.112-.046-.109-.046-.106-.048-.105-.048-.102-.048-.1-.05-.097-.049-.095-.051-.093-.051-.09-.052-.087-.052-.085-.053-.083-.053-.08-.054-.077-.054v4.153zm8.74-8.179l-.257.004-.254.005-.25.008-.247.011-.244.012-.241.014-.237.016-.233.018-.231.021-.226.022-.224.023-.22.026-.216.027-.212.028-.21.031-.205.032-.202.033-.198.034-.194.036-.191.038-.187.038-.183.04-.179.041-.175.042-.172.043-.168.043-.163.045-.16.046-.155.046-.152.048-.148.048-.143.048-.139.049-.136.05-.131.05-.126.051-.123.051-.118.051-.114.052-.11.052-.106.052-.101.052-.096.052-.092.052-.088.052-.083.052-.079.052-.074.051-.07.052-.065.051-.06.05-.056.05-.051.05-.023.025-.023.024-.021.024-.02.025-.019.024-.018.024-.017.023-.015.024-.014.023-.013.023-.012.023-.01.023-.01.022-.008.022-.006.023-.006.021-.004.022-.004.021-.001.021-.001.021.001.021.001.021.004.021.004.022.006.021.006.023.008.022.01.022.01.023.012.023.013.023.014.023.015.024.017.023.018.024.019.024.02.025.021.024.023.024.023.025.051.05.056.05.06.05.065.051.07.052.074.051.079.052.083.052.088.052.092.052.096.052.101.052.106.052.11.052.114.052.118.051.123.051.126.051.131.05.136.05.139.049.143.048.148.048.152.048.155.046.16.046.163.045.168.043.172.043.175.042.179.041.183.04.187.038.191.038.194.036.198.034.202.033.205.032.21.031.212.028.216.027.22.026.224.023.226.022.231.021.233.018.237.016.241.014.244.012.247.011.25.008.254.005.257.004.26.001.26-.001.257-.004.254-.005.25-.008.247-.011.244-.012.241-.014.237-.016.233-.018.231-.021.226-.022.224-.023.22-.026.216-.027.212-.028.21-.031.205-.032.202-.033.198-.034.194-.036.191-.038.187-.038.183-.04.179-.041.175-.042.172-.043.168-.043.163-.045.16-.046.155-.046.152-.048.148-.048.143-.048.139-.049.136-.05.131-.05.126-.051.123-.051.118-.051.114-.052.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.051.07-.052.065-.051.06-.05.056-.05.051-.05.023-.025.023-.024.021-.024.02-.025.019-.024.018-.024.017-.023.015-.024.014-.023.013-.023.012-.023.01-.023.01-.022.008-.022.006-.023.006-.021.004-.022.004-.021.001-.021.001-.021-.001-.021-.001-.021-.004-.021-.004-.022-.006-.021-.006-.023-.008-.022-.01-.022-.01-.023-.012-.023-.013-.023-.014-.023-.015-.024-.017-.023-.018-.024-.019-.024-.02-.025-.021-.024-.023-.024-.023-.025-.051-.05-.056-.05-.06-.05-.065-.051-.07-.052-.074-.051-.079-.052-.083-.052-.088-.052-.092-.052-.096-.052-.101-.052-.106-.052-.11-.052-.114-.052-.118-.051-.123-.051-.126-.051-.131-.05-.136-.05-.139-.049-.143-.048-.148-.048-.152-.048-.155-.046-.16-.046-.163-.045-.168-.043-.172-.043-.175-.042-.179-.041-.183-.04-.187-.038-.191-.038-.194-.036-.198-.034-.202-.033-.205-.032-.21-.031-.212-.028-.216-.027-.22-.026-.224-.023-.226-.022-.231-.021-.233-.018-.237-.016-.241-.014-.244-.012-.247-.011-.25-.008-.254-.005-.257-.004-.26-.001-.26.001z")},"insertDatabaseIcon"),ia=y(function(e){e.append("defs").append("symbol").attr("id","computer").attr("width","24").attr("height","24").append("path").attr("transform","scale(.5)").attr("d","M2 2v13h20v-13h-20zm18 11h-16v-9h16v9zm-10.228 6l.466-1h3.524l.467 1h-4.457zm14.228 3h-24l2-6h2.104l-1.33 4h18.45l-1.297-4h2.073l2 6zm-5-10h-14v-7h14v7z")},"insertComputerIcon"),oa=y(function(e){e.append("defs").append("symbol").attr("id","clock").attr("width","24").attr("height","24").append("path").attr("transform","scale(.5)").attr("d","M12 2c5.514 0 10 4.486 10 10s-4.486 10-10 10-10-4.486-10-10 4.486-10 10-10zm0-2c-6.627 0-12 5.373-12 12s5.373 12 12 12 12-5.373 12-12-5.373-12-12-12zm5.848 12.459c.202.038.202.333.001.372-1.907.361-6.045 1.111-6.547 1.111-.719 0-1.301-.582-1.301-1.301 0-.512.77-5.447 1.125-7.445.034-.192.312-.181.343.014l.985 6.238 5.394 1.011z")},"insertClockIcon"),na=y(function(e){e.append("defs").append("marker").attr("id","arrowhead").attr("refX",7.9).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto-start-reverse").append("path").attr("d","M -1 0 L 10 5 L 0 10 z")},"insertArrowHead"),ca=y(function(e){e.append("defs").append("marker").attr("id","filled-head").attr("refX",15.5).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L14,7 L9,1 Z")},"insertArrowFilledHead"),la=y(function(e){e.append("defs").append("marker").attr("id","sequencenumber").attr("refX",15).attr("refY",15).attr("markerWidth",60).attr("markerHeight",40).attr("orient","auto").append("circle").attr("cx",15).attr("cy",15).attr("r",6)},"insertSequenceNumber"),ha=y(function(e){e.append("defs").append("marker").attr("id","crosshead").attr("markerWidth",15).attr("markerHeight",8).attr("orient","auto").attr("refX",4).attr("refY",4.5).append("path").attr("fill","none").attr("stroke","#000000").style("stroke-dasharray","0, 0").attr("stroke-width","1pt").attr("d","M 1,2 L 6,7 M 6,2 L 1,7")},"insertArrowCrossHead"),le=y(function(){return{x:0,y:0,fill:void 0,anchor:void 0,style:"#666",width:void 0,height:void 0,textMargin:0,rx:0,ry:0,tspan:!0,valign:void 0}},"getTextObj"),da=y(function(){return{x:0,y:0,fill:"#EDF2AE",stroke:"#666",width:100,anchor:"start",height:100,rx:0,ry:0}},"getNoteRect"),pt=function(){function e(s,c,h,g,i,d,n){const u=c.append("text").attr("x",h+i/2).attr("y",g+d/2+5).style("text-anchor","middle").text(s);r(u,n)}y(e,"byText");function t(s,c,h,g,i,d,n,u){const{actorFontSize:b,actorFontFamily:m,actorFontWeight:w}=u,[P,A]=se(b),N=s.split(L.lineBreakRegex);for(let M=0;M<N.length;M++){const $=M*P-P*(N.length-1)/2,B=c.append("text").attr("x",h+i/2).attr("y",g).style("text-anchor","middle").style("font-size",A).style("font-weight",w).style("font-family",m);B.append("tspan").attr("x",h+i/2).attr("dy",$).text(N[M]),B.attr("y",g+d/2).attr("dominant-baseline","central").attr("alignment-baseline","central"),r(B,n)}}y(t,"byTspan");function o(s,c,h,g,i,d,n,u){const b=c.append("switch"),m=b.append("foreignObject").attr("x",h).attr("y",g).attr("width",i).attr("height",d).append("xhtml:div").style("display","table").style("height","100%").style("width","100%");m.append("div").style("display","table-cell").style("text-align","center").style("vertical-align","middle").text(s),t(s,b,h,g,i,d,n,u),r(m,n)}y(o,"byFo");async function a(s,c,h,g,i,d,n,u){const b=await kt(s,qt()),m=c.append("switch"),w=m.append("foreignObject").attr("x",h+i/2-b.width/2).attr("y",g+d/2-b.height/2).attr("width",b.width).attr("height",b.height).append("xhtml:div").style("height","100%").style("width","100%");w.append("div").style("text-align","center").style("vertical-align","middle").html(await ie(s,qt())),t(s,m,h,g,i,d,n,u),r(w,n)}y(a,"byKatex");function r(s,c){for(const h in c)c.hasOwnProperty(h)&&s.attr(h,c[h])}return y(r,"_setTextAttrs"),function(s,c=!1){return c?a:s.textPlacement==="fo"?o:s.textPlacement==="old"?e:t}}(),pa=function(){function e(r,s,c,h,g,i,d){const n=s.append("text").attr("x",c).attr("y",h).style("text-anchor","start").text(r);a(n,d)}y(e,"byText");function t(r,s,c,h,g,i,d,n){const{actorFontSize:u,actorFontFamily:b,actorFontWeight:m}=n,w=r.split(L.lineBreakRegex);for(let P=0;P<w.length;P++){const A=P*u-u*(w.length-1)/2,N=s.append("text").attr("x",c).attr("y",h).style("text-anchor","start").style("font-size",u).style("font-weight",m).style("font-family",b);N.append("tspan").attr("x",c).attr("dy",A).text(w[P]),N.attr("y",h+i/2).attr("dominant-baseline","central").attr("alignment-baseline","central"),a(N,d)}}y(t,"byTspan");function o(r,s,c,h,g,i,d,n){const u=s.append("switch"),b=u.append("foreignObject").attr("x",c).attr("y",h).attr("width",g).attr("height",i).append("xhtml:div").style("display","table").style("height","100%").style("width","100%");b.append("div").style("display","table-cell").style("text-align","center").style("vertical-align","middle").text(r),t(r,u,c,h,g,i,d,n),a(b,d)}y(o,"byFo");function a(r,s){for(const c in s)s.hasOwnProperty(c)&&r.attr(c,s[c])}return y(a,"_setTextAttrs"),function(r){return r.textPlacement==="fo"?o:r.textPlacement==="old"?e:t}}(),C={drawRect:It,drawText:wt,drawLabel:oe,drawActor:Je,drawBox:ta,drawPopup:ze,anchorElement:ea,drawActivation:aa,drawLoop:ra,drawBackgroundRect:ce,insertArrowHead:na,insertArrowFilledHead:ca,insertSequenceNumber:la,insertArrowCrossHead:ha,insertDatabaseIcon:sa,insertComputerIcon:ia,insertClockIcon:oa,getTextObj:le,getNoteRect:da,fixLifeLineHeights:ne,sanitizeUrl:re.sanitizeUrl},l={},f={data:{startx:void 0,stopx:void 0,starty:void 0,stopy:void 0},verticalPos:0,sequenceItems:[],activations:[],models:{getHeight:y(function(){return Math.max.apply(null,this.actors.length===0?[0]:this.actors.map(e=>e.height||0))+(this.loops.length===0?0:this.loops.map(e=>e.height||0).reduce((e,t)=>e+t))+(this.messages.length===0?0:this.messages.map(e=>e.height||0).reduce((e,t)=>e+t))+(this.notes.length===0?0:this.notes.map(e=>e.height||0).reduce((e,t)=>e+t))},"getHeight"),clear:y(function(){this.actors=[],this.boxes=[],this.loops=[],this.messages=[],this.notes=[]},"clear"),addBox:y(function(e){this.boxes.push(e)},"addBox"),addActor:y(function(e){this.actors.push(e)},"addActor"),addLoop:y(function(e){this.loops.push(e)},"addLoop"),addMessage:y(function(e){this.messages.push(e)},"addMessage"),addNote:y(function(e){this.notes.push(e)},"addNote"),lastActor:y(function(){return this.actors[this.actors.length-1]},"lastActor"),lastLoop:y(function(){return this.loops[this.loops.length-1]},"lastLoop"),lastMessage:y(function(){return this.messages[this.messages.length-1]},"lastMessage"),lastNote:y(function(){return this.notes[this.notes.length-1]},"lastNote"),actors:[],boxes:[],loops:[],messages:[],notes:[]},init:y(function(){this.sequenceItems=[],this.activations=[],this.models.clear(),this.data={startx:void 0,stopx:void 0,starty:void 0,stopy:void 0},this.verticalPos=0,pe(at())},"init"),updateVal:y(function(e,t,o,a){e[t]===void 0?e[t]=o:e[t]=a(o,e[t])},"updateVal"),updateBounds:y(function(e,t,o,a){const r=this;let s=0;function c(h){return y(function(g){s++;const i=r.sequenceItems.length-s+1;r.updateVal(g,"starty",t-i*l.boxMargin,Math.min),r.updateVal(g,"stopy",a+i*l.boxMargin,Math.max),r.updateVal(f.data,"startx",e-i*l.boxMargin,Math.min),r.updateVal(f.data,"stopx",o+i*l.boxMargin,Math.max),h!=="activation"&&(r.updateVal(g,"startx",e-i*l.boxMargin,Math.min),r.updateVal(g,"stopx",o+i*l.boxMargin,Math.max),r.updateVal(f.data,"starty",t-i*l.boxMargin,Math.min),r.updateVal(f.data,"stopy",a+i*l.boxMargin,Math.max))},"updateItemBounds")}y(c,"updateFn"),this.sequenceItems.forEach(c()),this.activations.forEach(c("activation"))},"updateBounds"),insert:y(function(e,t,o,a){const r=L.getMin(e,o),s=L.getMax(e,o),c=L.getMin(t,a),h=L.getMax(t,a);this.updateVal(f.data,"startx",r,Math.min),this.updateVal(f.data,"starty",c,Math.min),this.updateVal(f.data,"stopx",s,Math.max),this.updateVal(f.data,"stopy",h,Math.max),this.updateBounds(r,c,s,h)},"insert"),newActivation:y(function(e,t,o){const a=o.get(e.from),r=$t(e.from).length||0,s=a.x+a.width/2+(r-1)*l.activationWidth/2;this.activations.push({startx:s,starty:this.verticalPos+2,stopx:s+l.activationWidth,stopy:void 0,actor:e.from,anchored:C.anchorElement(t)})},"newActivation"),endActivation:y(function(e){const t=this.activations.map(function(o){return o.actor}).lastIndexOf(e.from);return this.activations.splice(t,1)[0]},"endActivation"),createLoop:y(function(e={message:void 0,wrap:!1,width:void 0},t){return{startx:void 0,starty:this.verticalPos,stopx:void 0,stopy:void 0,title:e.message,wrap:e.wrap,width:e.width,height:0,fill:t}},"createLoop"),newLoop:y(function(e={message:void 0,wrap:!1,width:void 0},t){this.sequenceItems.push(this.createLoop(e,t))},"newLoop"),endLoop:y(function(){return this.sequenceItems.pop()},"endLoop"),isLoopOverlap:y(function(){return this.sequenceItems.length?this.sequenceItems[this.sequenceItems.length-1].overlap:!1},"isLoopOverlap"),addSectionToLoop:y(function(e){const t=this.sequenceItems.pop();t.sections=t.sections||[],t.sectionTitles=t.sectionTitles||[],t.sections.push({y:f.getVerticalPos(),height:0}),t.sectionTitles.push(e),this.sequenceItems.push(t)},"addSectionToLoop"),saveVerticalPos:y(function(){this.isLoopOverlap()&&(this.savedVerticalPos=this.verticalPos)},"saveVerticalPos"),resetVerticalPos:y(function(){this.isLoopOverlap()&&(this.verticalPos=this.savedVerticalPos)},"resetVerticalPos"),bumpVerticalPos:y(function(e){this.verticalPos=this.verticalPos+e,this.data.stopy=L.getMax(this.data.stopy,this.verticalPos)},"bumpVerticalPos"),getVerticalPos:y(function(){return this.verticalPos},"getVerticalPos"),getBounds:y(function(){return{bounds:this.data,models:this.models}},"getBounds")},ga=y(async function(e,t){f.bumpVerticalPos(l.boxMargin),t.height=l.boxMargin,t.starty=f.getVerticalPos();const o=lt();o.x=t.startx,o.y=t.starty,o.width=t.width||l.width,o.class="note";const a=e.append("g"),r=C.drawRect(a,o),s=Ut();s.x=t.startx,s.y=t.starty,s.width=o.width,s.dy="1em",s.text=t.message,s.class="noteText",s.fontFamily=l.noteFontFamily,s.fontSize=l.noteFontSize,s.fontWeight=l.noteFontWeight,s.anchor=l.noteAlign,s.textMargin=l.noteMargin,s.valign="center";const c=W(s.text)?await Ot(a,s):wt(a,s),h=Math.round(c.map(g=>(g._groups||g)[0][0].getBBox().height).reduce((g,i)=>g+i));r.attr("height",h+2*l.noteMargin),t.height+=h+2*l.noteMargin,f.bumpVerticalPos(h+2*l.noteMargin),t.stopy=t.starty+h+2*l.noteMargin,t.stopx=t.startx+o.width,f.insert(t.startx,t.starty,t.stopx,t.stopy),f.models.addNote(t)},"drawNote"),mt=y(e=>({fontFamily:e.messageFontFamily,fontSize:e.messageFontSize,fontWeight:e.messageFontWeight}),"messageFont"),Et=y(e=>({fontFamily:e.noteFontFamily,fontSize:e.noteFontSize,fontWeight:e.noteFontWeight}),"noteFont"),Ht=y(e=>({fontFamily:e.actorFontFamily,fontSize:e.actorFontSize,fontWeight:e.actorFontWeight}),"actorFont");async function he(e,t){f.bumpVerticalPos(10);const{startx:o,stopx:a,message:r}=t,s=L.splitBreaks(r).length,c=W(r),h=c?await kt(r,at()):V.calculateTextDimensions(r,mt(l));if(!c){const n=h.height/s;t.height+=n,f.bumpVerticalPos(n)}let g,i=h.height-10;const d=h.width;if(o===a){g=f.getVerticalPos()+i,l.rightAngles||(i+=l.boxMargin,g=f.getVerticalPos()+i),i+=30;const n=L.getMax(d/2,l.width/2);f.insert(o-n,f.getVerticalPos()-10+i,a+n,f.getVerticalPos()+30+i)}else i+=l.boxMargin,g=f.getVerticalPos()+i,f.insert(o,g-10,a,g);return f.bumpVerticalPos(i),t.height+=i,t.stopy=t.starty+t.height,f.insert(t.fromBounds,t.starty,t.toBounds,t.stopy),g}y(he,"boundMessage");var ua=y(async function(e,t,o,a){const{startx:r,stopx:s,starty:c,message:h,type:g,sequenceIndex:i,sequenceVisible:d}=t,n=V.calculateTextDimensions(h,mt(l)),u=Ut();u.x=r,u.y=c+10,u.width=s-r,u.class="messageText",u.dy="1em",u.text=h,u.fontFamily=l.messageFontFamily,u.fontSize=l.messageFontSize,u.fontWeight=l.messageFontWeight,u.anchor=l.messageAlign,u.valign="center",u.textMargin=l.wrapPadding,u.tspan=!1,W(u.text)?await Ot(e,u,{startx:r,stopx:s,starty:o}):wt(e,u);const b=n.width;let m;r===s?l.rightAngles?m=e.append("path").attr("d",`M ${r},${o} H ${r+L.getMax(l.width/2,b/2)} V ${o+25} H ${r}`):m=e.append("path").attr("d","M "+r+","+o+" C "+(r+60)+","+(o-10)+" "+(r+60)+","+(o+30)+" "+r+","+(o+20)):(m=e.append("line"),m.attr("x1",r),m.attr("y1",o),m.attr("x2",s),m.attr("y2",o)),g===a.db.LINETYPE.DOTTED||g===a.db.LINETYPE.DOTTED_CROSS||g===a.db.LINETYPE.DOTTED_POINT||g===a.db.LINETYPE.DOTTED_OPEN||g===a.db.LINETYPE.BIDIRECTIONAL_DOTTED?(m.style("stroke-dasharray","3, 3"),m.attr("class","messageLine1")):m.attr("class","messageLine0");let w="";l.arrowMarkerAbsolute&&(w=$e(!0)),m.attr("stroke-width",2),m.attr("stroke","none"),m.style("fill","none"),(g===a.db.LINETYPE.SOLID||g===a.db.LINETYPE.DOTTED)&&m.attr("marker-end","url("+w+"#arrowhead)"),(g===a.db.LINETYPE.BIDIRECTIONAL_SOLID||g===a.db.LINETYPE.BIDIRECTIONAL_DOTTED)&&(m.attr("marker-start","url("+w+"#arrowhead)"),m.attr("marker-end","url("+w+"#arrowhead)")),(g===a.db.LINETYPE.SOLID_POINT||g===a.db.LINETYPE.DOTTED_POINT)&&m.attr("marker-end","url("+w+"#filled-head)"),(g===a.db.LINETYPE.SOLID_CROSS||g===a.db.LINETYPE.DOTTED_CROSS)&&m.attr("marker-end","url("+w+"#crosshead)"),(d||l.showSequenceNumbers)&&((g===a.db.LINETYPE.BIDIRECTIONAL_SOLID||g===a.db.LINETYPE.BIDIRECTIONAL_DOTTED)&&(r<s?m.attr("x1",r+12):m.attr("x1",r+6)),e.append("line").attr("x1",r).attr("y1",o).attr("x2",r).attr("y2",o).attr("stroke-width",0).attr("marker-start","url("+w+"#sequencenumber)"),e.append("text").attr("x",r).attr("y",o+4).attr("font-family","sans-serif").attr("font-size","12px").attr("text-anchor","middle").attr("class","sequenceNumber").text(i))},"drawMessage"),xa=y(function(e,t,o,a,r,s,c){let h=0,g=0,i,d=0;for(const n of a){const u=t.get(n),b=u.box;i&&i!=b&&(c||f.models.addBox(i),g+=l.boxMargin+i.margin),b&&b!=i&&(c||(b.x=h+g,b.y=r),g+=b.margin),u.width=u.width||l.width,u.height=L.getMax(u.height||l.height,l.height),u.margin=u.margin||l.actorMargin,d=L.getMax(d,u.height),o.get(u.name)&&(g+=u.width/2),u.x=h+g,u.starty=f.getVerticalPos(),f.insert(u.x,r,u.x+u.width,u.height),h+=u.width+g,u.box&&(u.box.width=h+b.margin-u.box.x),g=u.margin,i=u.box,f.models.addActor(u)}i&&!c&&f.models.addBox(i),f.bumpVerticalPos(d)},"addActorRenderingData"),jt=y(async function(e,t,o,a){if(a){let r=0;f.bumpVerticalPos(l.boxMargin*2);for(const s of o){const c=t.get(s);c.stopy||(c.stopy=f.getVerticalPos());const h=await C.drawActor(e,c,l,!0);r=L.getMax(r,h)}f.bumpVerticalPos(r+l.boxMargin)}else for(const r of o){const s=t.get(r);await C.drawActor(e,s,l,!1)}},"drawActors"),de=y(function(e,t,o,a){let r=0,s=0;for(const c of o){const h=t.get(c),g=ba(h),i=C.drawPopup(e,h,g,l,l.forceMenus,a);i.height>r&&(r=i.height),i.width+h.x>s&&(s=i.width+h.x)}return{maxHeight:r,maxWidth:s}},"drawActorsPopup"),pe=y(function(e){Le(l,e),e.fontFamily&&(l.actorFontFamily=l.noteFontFamily=l.messageFontFamily=e.fontFamily),e.fontSize&&(l.actorFontSize=l.noteFontSize=l.messageFontSize=e.fontSize),e.fontWeight&&(l.actorFontWeight=l.noteFontWeight=l.messageFontWeight=e.fontWeight)},"setConf"),$t=y(function(e){return f.activations.filter(function(t){return t.actor===e})},"actorActivations"),ae=y(function(e,t){const o=t.get(e),a=$t(e),r=a.reduce(function(c,h){return L.getMin(c,h.startx)},o.x+o.width/2-1),s=a.reduce(function(c,h){return L.getMax(c,h.stopx)},o.x+o.width/2+1);return[r,s]},"activationBounds");function ot(e,t,o,a,r){f.bumpVerticalPos(o);let s=a;if(t.id&&t.message&&e[t.id]){const c=e[t.id].width,h=mt(l);t.message=V.wrapLabel(`[${t.message}]`,c-2*l.wrapPadding,h),t.width=c,t.wrap=!0;const g=V.calculateTextDimensions(t.message,h),i=L.getMax(g.height,l.labelBoxHeight);s=a+i,X.debug(`${i} - ${t.message}`)}r(t),f.bumpVerticalPos(s)}y(ot,"adjustLoopHeightForWrap");function ge(e,t,o,a,r,s,c){function h(d,n){d.x<r.get(e.from).x?(f.insert(t.stopx-n,t.starty,t.startx,t.stopy+d.height/2+l.noteMargin),t.stopx=t.stopx+n):(f.insert(t.startx,t.starty,t.stopx+n,t.stopy+d.height/2+l.noteMargin),t.stopx=t.stopx-n)}y(h,"receiverAdjustment");function g(d,n){d.x<r.get(e.to).x?(f.insert(t.startx-n,t.starty,t.stopx,t.stopy+d.height/2+l.noteMargin),t.startx=t.startx+n):(f.insert(t.stopx,t.starty,t.startx+n,t.stopy+d.height/2+l.noteMargin),t.startx=t.startx-n)}y(g,"senderAdjustment");const i=[Mt.ACTOR,Mt.CONTROL,Mt.ENTITY,Mt.DATABASE];if(s.get(e.to)==a){const d=r.get(e.to),n=i.includes(d.type)?ft/2+3:d.width/2+3;h(d,n),d.starty=o-d.height/2,f.bumpVerticalPos(d.height/2)}else if(c.get(e.from)==a){const d=r.get(e.from);if(l.mirrorActors){const n=i.includes(d.type)?ft/2:d.width/2;g(d,n)}d.stopy=o-d.height/2,f.bumpVerticalPos(d.height/2)}else if(c.get(e.to)==a){const d=r.get(e.to);if(l.mirrorActors){const n=i.includes(d.type)?ft/2+3:d.width/2+3;h(d,n)}d.stopy=o-d.height/2,f.bumpVerticalPos(d.height/2)}}y(ge,"adjustCreatedDestroyedData");var ya=y(async function(e,t,o,a){const{securityLevel:r,sequence:s}=at();l=s;let c;r==="sandbox"&&(c=At("#i"+t));const h=r==="sandbox"?At(c.nodes()[0].contentDocument.body):At("body"),g=r==="sandbox"?c.nodes()[0].contentDocument:document;f.init(),X.debug(a.db);const i=r==="sandbox"?h.select(`[id="${t}"]`):At(`[id="${t}"]`),d=a.db.getActors(),n=a.db.getCreatedActors(),u=a.db.getDestroyedActors(),b=a.db.getBoxes();let m=a.db.getActorKeys();const w=a.db.getMessages(),P=a.db.getDiagramTitle(),A=a.db.hasAtLeastOneBox(),N=a.db.hasAtLeastOneBoxWithTitle(),M=await ue(d,w,a);if(l.height=await xe(d,M,b),C.insertComputerIcon(i),C.insertDatabaseIcon(i),C.insertClockIcon(i),A&&(f.bumpVerticalPos(l.boxMargin),N&&f.bumpVerticalPos(b[0].textMaxHeight)),l.hideUnusedParticipants===!0){const T=new Set;w.forEach(v=>{T.add(v.from),T.add(v.to)}),m=m.filter(v=>T.has(v))}xa(i,d,n,m,0,w,!1);const $=await Ta(w,d,M,a);C.insertArrowHead(i),C.insertArrowCrossHead(i),C.insertArrowFilledHead(i),C.insertSequenceNumber(i);function B(T,v){const U=f.endActivation(T);U.starty+18>v&&(U.starty=v-6,v+=12),C.drawActivation(i,U,v,l,$t(T.from).length),f.insert(U.startx,v-10,U.stopx,v)}y(B,"activeEnd");let q=1,Z=1;const rt=[],z=[];let H=0;for(const T of w){let v,U,tt;switch(T.type){case a.db.LINETYPE.NOTE:f.resetVerticalPos(),U=T.noteModel,await ga(i,U);break;case a.db.LINETYPE.ACTIVE_START:f.newActivation(T,i,d);break;case a.db.LINETYPE.ACTIVE_END:B(T,f.getVerticalPos());break;case a.db.LINETYPE.LOOP_START:ot($,T,l.boxMargin,l.boxMargin+l.boxTextMargin,S=>f.newLoop(S));break;case a.db.LINETYPE.LOOP_END:v=f.endLoop(),await C.drawLoop(i,v,"loop",l),f.bumpVerticalPos(v.stopy-f.getVerticalPos()),f.models.addLoop(v);break;case a.db.LINETYPE.RECT_START:ot($,T,l.boxMargin,l.boxMargin,S=>f.newLoop(void 0,S.message));break;case a.db.LINETYPE.RECT_END:v=f.endLoop(),z.push(v),f.models.addLoop(v),f.bumpVerticalPos(v.stopy-f.getVerticalPos());break;case a.db.LINETYPE.OPT_START:ot($,T,l.boxMargin,l.boxMargin+l.boxTextMargin,S=>f.newLoop(S));break;case a.db.LINETYPE.OPT_END:v=f.endLoop(),await C.drawLoop(i,v,"opt",l),f.bumpVerticalPos(v.stopy-f.getVerticalPos()),f.models.addLoop(v);break;case a.db.LINETYPE.ALT_START:ot($,T,l.boxMargin,l.boxMargin+l.boxTextMargin,S=>f.newLoop(S));break;case a.db.LINETYPE.ALT_ELSE:ot($,T,l.boxMargin+l.boxTextMargin,l.boxMargin,S=>f.addSectionToLoop(S));break;case a.db.LINETYPE.ALT_END:v=f.endLoop(),await C.drawLoop(i,v,"alt",l),f.bumpVerticalPos(v.stopy-f.getVerticalPos()),f.models.addLoop(v);break;case a.db.LINETYPE.PAR_START:case a.db.LINETYPE.PAR_OVER_START:ot($,T,l.boxMargin,l.boxMargin+l.boxTextMargin,S=>f.newLoop(S)),f.saveVerticalPos();break;case a.db.LINETYPE.PAR_AND:ot($,T,l.boxMargin+l.boxTextMargin,l.boxMargin,S=>f.addSectionToLoop(S));break;case a.db.LINETYPE.PAR_END:v=f.endLoop(),await C.drawLoop(i,v,"par",l),f.bumpVerticalPos(v.stopy-f.getVerticalPos()),f.models.addLoop(v);break;case a.db.LINETYPE.AUTONUMBER:q=T.message.start||q,Z=T.message.step||Z,T.message.visible?a.db.enableSequenceNumbers():a.db.disableSequenceNumbers();break;case a.db.LINETYPE.CRITICAL_START:ot($,T,l.boxMargin,l.boxMargin+l.boxTextMargin,S=>f.newLoop(S));break;case a.db.LINETYPE.CRITICAL_OPTION:ot($,T,l.boxMargin+l.boxTextMargin,l.boxMargin,S=>f.addSectionToLoop(S));break;case a.db.LINETYPE.CRITICAL_END:v=f.endLoop(),await C.drawLoop(i,v,"critical",l),f.bumpVerticalPos(v.stopy-f.getVerticalPos()),f.models.addLoop(v);break;case a.db.LINETYPE.BREAK_START:ot($,T,l.boxMargin,l.boxMargin+l.boxTextMargin,S=>f.newLoop(S));break;case a.db.LINETYPE.BREAK_END:v=f.endLoop(),await C.drawLoop(i,v,"break",l),f.bumpVerticalPos(v.stopy-f.getVerticalPos()),f.models.addLoop(v);break;default:try{tt=T.msgModel,tt.starty=f.getVerticalPos(),tt.sequenceIndex=q,tt.sequenceVisible=a.db.showSequenceNumbers();const S=await he(i,tt);ge(T,tt,S,H,d,n,u),rt.push({messageModel:tt,lineStartY:S}),f.models.addMessage(tt)}catch(S){X.error("error while drawing message",S)}}[a.db.LINETYPE.SOLID_OPEN,a.db.LINETYPE.DOTTED_OPEN,a.db.LINETYPE.SOLID,a.db.LINETYPE.DOTTED,a.db.LINETYPE.SOLID_CROSS,a.db.LINETYPE.DOTTED_CROSS,a.db.LINETYPE.SOLID_POINT,a.db.LINETYPE.DOTTED_POINT,a.db.LINETYPE.BIDIRECTIONAL_SOLID,a.db.LINETYPE.BIDIRECTIONAL_DOTTED].includes(T.type)&&(q=q+Z),H++}X.debug("createdActors",n),X.debug("destroyedActors",u),await jt(i,d,m,!1);for(const T of rt)await ua(i,T.messageModel,T.lineStartY,a);l.mirrorActors&&await jt(i,d,m,!0),z.forEach(T=>C.drawBackgroundRect(i,T)),ne(i,d,m,l);for(const T of f.models.boxes){T.height=f.getVerticalPos()-T.y,f.insert(T.x,T.y,T.x+T.width,T.height);const v=l.boxMargin*2;T.startx=T.x-v,T.starty=T.y-v*.25,T.stopx=T.startx+T.width+2*v,T.stopy=T.starty+T.height+v*.75,T.stroke="rgb(0,0,0, 0.5)",C.drawBox(i,T,l)}A&&f.bumpVerticalPos(l.boxMargin);const F=de(i,d,m,g),{bounds:R}=f.getBounds();R.startx===void 0&&(R.startx=0),R.starty===void 0&&(R.starty=0),R.stopx===void 0&&(R.stopx=0),R.stopy===void 0&&(R.stopy=0);let Q=R.stopy-R.starty;Q<F.maxHeight&&(Q=F.maxHeight);let j=Q+2*l.diagramMarginY;l.mirrorActors&&(j=j-l.boxMargin+l.bottomMarginAdj);let J=R.stopx-R.startx;J<F.maxWidth&&(J=F.maxWidth);const st=J+2*l.diagramMarginX;P&&i.append("text").text(P).attr("x",(R.stopx-R.startx)/2-2*l.diagramMarginX).attr("y",-25),ke(i,j,st,l.useMaxWidth);const D=P?40:0;i.attr("viewBox",R.startx-l.diagramMarginX+" -"+(l.diagramMarginY+D)+" "+st+" "+(j+D)),X.debug("models:",f.models)},"draw");async function ue(e,t,o){const a={};for(const r of t)if(e.get(r.to)&&e.get(r.from)){const s=e.get(r.to);if(r.placement===o.db.PLACEMENT.LEFTOF&&!s.prevActor||r.placement===o.db.PLACEMENT.RIGHTOF&&!s.nextActor)continue;const c=r.placement!==void 0,h=!c,g=c?Et(l):mt(l),i=r.wrap?V.wrapLabel(r.message,l.width-2*l.wrapPadding,g):r.message,d=(W(i)?await kt(r.message,at()):V.calculateTextDimensions(i,g)).width+2*l.wrapPadding;h&&r.from===s.nextActor?a[r.to]=L.getMax(a[r.to]||0,d):h&&r.from===s.prevActor?a[r.from]=L.getMax(a[r.from]||0,d):h&&r.from===r.to?(a[r.from]=L.getMax(a[r.from]||0,d/2),a[r.to]=L.getMax(a[r.to]||0,d/2)):r.placement===o.db.PLACEMENT.RIGHTOF?a[r.from]=L.getMax(a[r.from]||0,d):r.placement===o.db.PLACEMENT.LEFTOF?a[s.prevActor]=L.getMax(a[s.prevActor]||0,d):r.placement===o.db.PLACEMENT.OVER&&(s.prevActor&&(a[s.prevActor]=L.getMax(a[s.prevActor]||0,d/2)),s.nextActor&&(a[r.from]=L.getMax(a[r.from]||0,d/2)))}return X.debug("maxMessageWidthPerActor:",a),a}y(ue,"getMaxMessageWidthPerActor");var ba=y(function(e){let t=0;const o=Ht(l);for(const a in e.links){const r=V.calculateTextDimensions(a,o).width+2*l.wrapPadding+2*l.boxMargin;t<r&&(t=r)}return t},"getRequiredPopupWidth");async function xe(e,t,o){let a=0;for(const s of e.keys()){const c=e.get(s);c.wrap&&(c.description=V.wrapLabel(c.description,l.width-2*l.wrapPadding,Ht(l)));const h=W(c.description)?await kt(c.description,at()):V.calculateTextDimensions(c.description,Ht(l));c.width=c.wrap?l.width:L.getMax(l.width,h.width+2*l.wrapPadding),c.height=c.wrap?L.getMax(h.height,l.height):l.height,a=L.getMax(a,c.height)}for(const s in t){const c=e.get(s);if(!c)continue;const h=e.get(c.nextActor);if(!h){const i=t[s]+l.actorMargin-c.width/2;c.margin=L.getMax(i,l.actorMargin);continue}const g=t[s]+l.actorMargin-c.width/2-h.width/2;c.margin=L.getMax(g,l.actorMargin)}let r=0;return o.forEach(s=>{const c=mt(l);let h=s.actorKeys.reduce((n,u)=>n+=e.get(u).width+(e.get(u).margin||0),0);const g=l.boxMargin*8;h+=g,h-=2*l.boxTextMargin,s.wrap&&(s.name=V.wrapLabel(s.name,h-2*l.wrapPadding,c));const i=V.calculateTextDimensions(s.name,c);r=L.getMax(i.height,r);const d=L.getMax(h,i.width+2*l.wrapPadding);if(s.margin=l.boxTextMargin,h<d){const n=(d-h)/2;s.margin+=n}}),o.forEach(s=>s.textMaxHeight=r),L.getMax(a,l.height)}y(xe,"calculateActorMargins");var fa=y(async function(e,t,o){const a=t.get(e.from),r=t.get(e.to),s=a.x,c=r.x,h=e.wrap&&e.message;let g=W(e.message)?await kt(e.message,at()):V.calculateTextDimensions(h?V.wrapLabel(e.message,l.width,Et(l)):e.message,Et(l));const i={width:h?l.width:L.getMax(l.width,g.width+2*l.noteMargin),height:0,startx:a.x,stopx:0,starty:0,stopy:0,message:e.message};return e.placement===o.db.PLACEMENT.RIGHTOF?(i.width=h?L.getMax(l.width,g.width):L.getMax(a.width/2+r.width/2,g.width+2*l.noteMargin),i.startx=s+(a.width+l.actorMargin)/2):e.placement===o.db.PLACEMENT.LEFTOF?(i.width=h?L.getMax(l.width,g.width+2*l.noteMargin):L.getMax(a.width/2+r.width/2,g.width+2*l.noteMargin),i.startx=s-i.width+(a.width-l.actorMargin)/2):e.to===e.from?(g=V.calculateTextDimensions(h?V.wrapLabel(e.message,L.getMax(l.width,a.width),Et(l)):e.message,Et(l)),i.width=h?L.getMax(l.width,a.width):L.getMax(a.width,l.width,g.width+2*l.noteMargin),i.startx=s+(a.width-i.width)/2):(i.width=Math.abs(s+a.width/2-(c+r.width/2))+l.actorMargin,i.startx=s<c?s+a.width/2-l.actorMargin/2:c+r.width/2-l.actorMargin/2),h&&(i.message=V.wrapLabel(e.message,i.width-2*l.wrapPadding,Et(l))),X.debug(`NM:[${i.startx},${i.stopx},${i.starty},${i.stopy}:${i.width},${i.height}=${e.message}]`),i},"buildNoteModel"),ma=y(function(e,t,o){if(![o.db.LINETYPE.SOLID_OPEN,o.db.LINETYPE.DOTTED_OPEN,o.db.LINETYPE.SOLID,o.db.LINETYPE.DOTTED,o.db.LINETYPE.SOLID_CROSS,o.db.LINETYPE.DOTTED_CROSS,o.db.LINETYPE.SOLID_POINT,o.db.LINETYPE.DOTTED_POINT,o.db.LINETYPE.BIDIRECTIONAL_SOLID,o.db.LINETYPE.BIDIRECTIONAL_DOTTED].includes(e.type))return{};const[a,r]=ae(e.from,t),[s,c]=ae(e.to,t),h=a<=s;let g=h?r:a,i=h?s:c;const d=Math.abs(s-c)>2,n=y(w=>h?-w:w,"adjustValue");e.from===e.to?i=g:(e.activate&&!d&&(i+=n(l.activationWidth/2-1)),[o.db.LINETYPE.SOLID_OPEN,o.db.LINETYPE.DOTTED_OPEN].includes(e.type)||(i+=n(3)),[o.db.LINETYPE.BIDIRECTIONAL_SOLID,o.db.LINETYPE.BIDIRECTIONAL_DOTTED].includes(e.type)&&(g-=n(3)));const u=[a,r,s,c],b=Math.abs(g-i);e.wrap&&e.message&&(e.message=V.wrapLabel(e.message,L.getMax(b+2*l.wrapPadding,l.width),mt(l)));const m=V.calculateTextDimensions(e.message,mt(l));return{width:L.getMax(e.wrap?0:m.width+2*l.wrapPadding,b+2*l.wrapPadding,l.width),height:0,startx:g,stopx:i,starty:0,stopy:0,message:e.message,type:e.type,wrap:e.wrap,fromBounds:Math.min.apply(null,u),toBounds:Math.max.apply(null,u)}},"buildMessageModel"),Ta=y(async function(e,t,o,a){const r={},s=[];let c,h,g;for(const i of e){switch(i.type){case a.db.LINETYPE.LOOP_START:case a.db.LINETYPE.ALT_START:case a.db.LINETYPE.OPT_START:case a.db.LINETYPE.PAR_START:case a.db.LINETYPE.PAR_OVER_START:case a.db.LINETYPE.CRITICAL_START:case a.db.LINETYPE.BREAK_START:s.push({id:i.id,msg:i.message,from:Number.MAX_SAFE_INTEGER,to:Number.MIN_SAFE_INTEGER,width:0});break;case a.db.LINETYPE.ALT_ELSE:case a.db.LINETYPE.PAR_AND:case a.db.LINETYPE.CRITICAL_OPTION:i.message&&(c=s.pop(),r[c.id]=c,r[i.id]=c,s.push(c));break;case a.db.LINETYPE.LOOP_END:case a.db.LINETYPE.ALT_END:case a.db.LINETYPE.OPT_END:case a.db.LINETYPE.PAR_END:case a.db.LINETYPE.CRITICAL_END:case a.db.LINETYPE.BREAK_END:c=s.pop(),r[c.id]=c;break;case a.db.LINETYPE.ACTIVE_START:{const d=t.get(i.from?i.from:i.to.actor),n=$t(i.from?i.from:i.to.actor).length,u=d.x+d.width/2+(n-1)*l.activationWidth/2,b={startx:u,stopx:u+l.activationWidth,actor:i.from,enabled:!0};f.activations.push(b)}break;case a.db.LINETYPE.ACTIVE_END:{const d=f.activations.map(n=>n.actor).lastIndexOf(i.from);f.activations.splice(d,1).splice(0,1)}break}i.placement!==void 0?(h=await fa(i,t,a),i.noteModel=h,s.forEach(d=>{c=d,c.from=L.getMin(c.from,h.startx),c.to=L.getMax(c.to,h.startx+h.width),c.width=L.getMax(c.width,Math.abs(c.from-c.to))-l.labelBoxWidth})):(g=ma(i,t,a),i.msgModel=g,g.startx&&g.stopx&&s.length>0&&s.forEach(d=>{if(c=d,g.startx===g.stopx){const n=t.get(i.from),u=t.get(i.to);c.from=L.getMin(n.x-g.width/2,n.x-n.width/2,c.from),c.to=L.getMax(u.x+g.width/2,u.x+n.width/2,c.to),c.width=L.getMax(c.width,Math.abs(c.to-c.from))-l.labelBoxWidth}else c.from=L.getMin(g.startx,c.from),c.to=L.getMax(g.stopx,c.to),c.width=L.getMax(c.width,g.width)-l.labelBoxWidth}))}return f.activations=[],X.debug("Loop type widths:",r),r},"calculateLoopBounds"),Ea={bounds:f,drawActors:jt,drawActorsPopup:de,setConf:pe,draw:ya},La={parser:Ce,get db(){return new Fe},renderer:Ea,styles:qe,init:y(e=>{e.sequence||(e.sequence={}),e.wrap&&(e.sequence.wrap=e.wrap,Ie({sequence:{wrap:e.wrap}}))},"init")};export{La as diagram};
|
|
145
|
+
`;v.append("path").attr("d",A).attr("fill","#eaeaea").attr("stroke","#000").attr("stroke-width",1).attr("class",n),a?v.attr("transform",`translate(${u*1.5}, ${d.height/4-2*w})`):v.attr("transform",`translate(${u*1.5}, ${(d.height+w)/4})`),t.rectData=d,pt(o,W(t.description))(t.description,i,d.x,d.y+(a?(d.height+b)/4:(d.height+w)/2),d.width,d.height,{class:`actor ${St}`},o);const N=v.select("path:last-child");if(N.node()){const M=N.node().getBBox();t.height=M.height+(o.sequence.labelBoxHeight??0)}return t.height},"drawActorTypeDatabase"),Ze=y(function(e,t,o,a){const r=a?t.stopy:t.starty,s=t.x+t.width/2,c=r+80,h=30,g=e.append("g").lower();a||(_++,g.append("line").attr("id","actor"+_).attr("x1",s).attr("y1",c).attr("x2",s).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",t.name),t.actorCnt=_);const i=e.append("g");let d=gt;a?d+=` ${xt}`:d+=` ${ut}`,i.attr("class",d),i.attr("name",t.name);const n=lt();n.x=t.x,n.y=r,n.fill="#eaeaea",n.width=t.width,n.height=t.height,n.class="actor",i.append("line").attr("id","actor-man-torso"+_).attr("x1",t.x+t.width/2-h*2.5).attr("y1",r+10).attr("x2",t.x+t.width/2-15).attr("y2",r+10),i.append("line").attr("id","actor-man-arms"+_).attr("x1",t.x+t.width/2-h*2.5).attr("y1",r+0).attr("x2",t.x+t.width/2-h*2.5).attr("y2",r+20),i.append("circle").attr("cx",t.x+t.width/2).attr("cy",r+10).attr("r",h);const u=i.node().getBBox();return t.height=u.height+(o.sequence.labelBoxHeight??0),pt(o,W(t.description))(t.description,i,n.x,n.y+(a?h/2-4:h/2+3),n.width,n.height,{class:`actor ${gt}`},o),a?i.attr("transform",`translate(0,${h/2+7})`):i.attr("transform",`translate(0,${h/2+7})`),t.height},"drawActorTypeBoundary"),Qe=y(function(e,t,o,a){const r=a?t.stopy:t.starty,s=t.x+t.width/2,c=r+80,h=e.append("g").lower();a||(_++,h.append("line").attr("id","actor"+_).attr("x1",s).attr("y1",c).attr("x2",s).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",t.name),t.actorCnt=_);const g=e.append("g");let i=gt;a?i+=` ${xt}`:i+=` ${ut}`,g.attr("class",i),g.attr("name",t.name);const d=lt();d.x=t.x,d.y=r,d.fill="#eaeaea",d.width=t.width,d.height=t.height,d.class="actor",d.rx=3,d.ry=3,g.append("line").attr("id","actor-man-torso"+_).attr("x1",s).attr("y1",r+25).attr("x2",s).attr("y2",r+45),g.append("line").attr("id","actor-man-arms"+_).attr("x1",s-mt/2).attr("y1",r+33).attr("x2",s+mt/2).attr("y2",r+33),g.append("line").attr("x1",s-mt/2).attr("y1",r+60).attr("x2",s).attr("y2",r+45),g.append("line").attr("x1",s).attr("y1",r+45).attr("x2",s+mt/2-2).attr("y2",r+60);const n=g.append("circle");n.attr("cx",t.x+t.width/2),n.attr("cy",r+10),n.attr("r",15),n.attr("width",t.width),n.attr("height",t.height);const u=g.node().getBBox();return t.height=u.height,pt(o,W(t.description))(t.description,g,d.x,d.y+35,d.width,d.height,{class:`actor ${gt}`},o),t.height},"drawActorTypeActor"),Je=y(async function(e,t,o,a){switch(t.type){case"actor":return await Qe(e,t,o,a);case"participant":return await He(e,t,o,a);case"boundary":return await Ze(e,t,o,a);case"control":return await Ge(e,t,o,a);case"entity":return await Ke(e,t,o,a);case"database":return await Xe(e,t,o,a);case"collections":return await je(e,t,o,a);case"queue":return await Ue(e,t,o,a)}},"drawActor"),ta=y(function(e,t,o){const a=e.append("g");ce(a,t),t.name&&pt(o)(t.name,a,t.x,t.y+o.boxTextMargin+(t.textMaxHeight||0)/2,t.width,0,{class:"text"},o),a.lower()},"drawBox"),ea=y(function(e){return e.append("g")},"anchorElement"),aa=y(function(e,t,o,a,r){const s=lt(),c=t.anchored;s.x=t.startx,s.y=t.starty,s.class="activation"+r%3,s.width=t.stopx-t.startx,s.height=o-t.starty,It(c,s)},"drawActivation"),ra=y(async function(e,t,o,a){const{boxMargin:r,boxTextMargin:s,labelBoxHeight:c,labelBoxWidth:h,messageFontFamily:g,messageFontSize:i,messageFontWeight:d}=a,n=e.append("g"),u=y(function(w,v,A,N){return n.append("line").attr("x1",w).attr("y1",v).attr("x2",A).attr("y2",N).attr("class","loopLine")},"drawLoopLine");u(t.startx,t.starty,t.stopx,t.starty),u(t.stopx,t.starty,t.stopx,t.stopy),u(t.startx,t.stopy,t.stopx,t.stopy),u(t.startx,t.starty,t.startx,t.stopy),t.sections!==void 0&&t.sections.forEach(function(w){u(t.startx,w.y,t.stopx,w.y).style("stroke-dasharray","3, 3")});let b=Ut();b.text=o,b.x=t.startx,b.y=t.starty,b.fontFamily=g,b.fontSize=i,b.fontWeight=d,b.anchor="middle",b.valign="middle",b.tspan=!1,b.width=h||50,b.height=c||20,b.textMargin=s,b.class="labelText",oe(n,b),b=le(),b.text=t.title,b.x=t.startx+h/2+(t.stopx-t.startx)/2,b.y=t.starty+r+s,b.anchor="middle",b.valign="middle",b.textMargin=s,b.class="loopText",b.fontFamily=g,b.fontSize=i,b.fontWeight=d,b.wrap=!0;let T=W(b.text)?await Ot(n,b,t):wt(n,b);if(t.sectionTitles!==void 0){for(const[w,v]of Object.entries(t.sectionTitles))if(v.message){b.text=v.message,b.x=t.startx+(t.stopx-t.startx)/2,b.y=t.sections[w].y+r+s,b.class="loopText",b.anchor="middle",b.valign="middle",b.tspan=!1,b.fontFamily=g,b.fontSize=i,b.fontWeight=d,b.wrap=t.wrap,W(b.text)?(t.starty=t.sections[w].y,await Ot(n,b,t)):wt(n,b);let A=Math.round(T.map(N=>(N._groups||N)[0][0].getBBox().height).reduce((N,M)=>N+M));t.sections[w].height+=A-(r+s)}}return t.height=Math.round(t.stopy-t.starty),n},"drawLoop"),ce=y(function(e,t){Ee(e,t)},"drawBackgroundRect"),sa=y(function(e){e.append("defs").append("symbol").attr("id","database").attr("fill-rule","evenodd").attr("clip-rule","evenodd").append("path").attr("transform","scale(.5)").attr("d","M12.258.001l.256.004.255.005.253.008.251.01.249.012.247.015.246.016.242.019.241.02.239.023.236.024.233.027.231.028.229.031.225.032.223.034.22.036.217.038.214.04.211.041.208.043.205.045.201.046.198.048.194.05.191.051.187.053.183.054.18.056.175.057.172.059.168.06.163.061.16.063.155.064.15.066.074.033.073.033.071.034.07.034.069.035.068.035.067.035.066.035.064.036.064.036.062.036.06.036.06.037.058.037.058.037.055.038.055.038.053.038.052.038.051.039.05.039.048.039.047.039.045.04.044.04.043.04.041.04.04.041.039.041.037.041.036.041.034.041.033.042.032.042.03.042.029.042.027.042.026.043.024.043.023.043.021.043.02.043.018.044.017.043.015.044.013.044.012.044.011.045.009.044.007.045.006.045.004.045.002.045.001.045v17l-.001.045-.002.045-.004.045-.006.045-.007.045-.009.044-.011.045-.012.044-.013.044-.015.044-.017.043-.018.044-.02.043-.021.043-.023.043-.024.043-.026.043-.027.042-.029.042-.03.042-.032.042-.033.042-.034.041-.036.041-.037.041-.039.041-.04.041-.041.04-.043.04-.044.04-.045.04-.047.039-.048.039-.05.039-.051.039-.052.038-.053.038-.055.038-.055.038-.058.037-.058.037-.06.037-.06.036-.062.036-.064.036-.064.036-.066.035-.067.035-.068.035-.069.035-.07.034-.071.034-.073.033-.074.033-.15.066-.155.064-.16.063-.163.061-.168.06-.172.059-.175.057-.18.056-.183.054-.187.053-.191.051-.194.05-.198.048-.201.046-.205.045-.208.043-.211.041-.214.04-.217.038-.22.036-.223.034-.225.032-.229.031-.231.028-.233.027-.236.024-.239.023-.241.02-.242.019-.246.016-.247.015-.249.012-.251.01-.253.008-.255.005-.256.004-.258.001-.258-.001-.256-.004-.255-.005-.253-.008-.251-.01-.249-.012-.247-.015-.245-.016-.243-.019-.241-.02-.238-.023-.236-.024-.234-.027-.231-.028-.228-.031-.226-.032-.223-.034-.22-.036-.217-.038-.214-.04-.211-.041-.208-.043-.204-.045-.201-.046-.198-.048-.195-.05-.19-.051-.187-.053-.184-.054-.179-.056-.176-.057-.172-.059-.167-.06-.164-.061-.159-.063-.155-.064-.151-.066-.074-.033-.072-.033-.072-.034-.07-.034-.069-.035-.068-.035-.067-.035-.066-.035-.064-.036-.063-.036-.062-.036-.061-.036-.06-.037-.058-.037-.057-.037-.056-.038-.055-.038-.053-.038-.052-.038-.051-.039-.049-.039-.049-.039-.046-.039-.046-.04-.044-.04-.043-.04-.041-.04-.04-.041-.039-.041-.037-.041-.036-.041-.034-.041-.033-.042-.032-.042-.03-.042-.029-.042-.027-.042-.026-.043-.024-.043-.023-.043-.021-.043-.02-.043-.018-.044-.017-.043-.015-.044-.013-.044-.012-.044-.011-.045-.009-.044-.007-.045-.006-.045-.004-.045-.002-.045-.001-.045v-17l.001-.045.002-.045.004-.045.006-.045.007-.045.009-.044.011-.045.012-.044.013-.044.015-.044.017-.043.018-.044.02-.043.021-.043.023-.043.024-.043.026-.043.027-.042.029-.042.03-.042.032-.042.033-.042.034-.041.036-.041.037-.041.039-.041.04-.041.041-.04.043-.04.044-.04.046-.04.046-.039.049-.039.049-.039.051-.039.052-.038.053-.038.055-.038.056-.038.057-.037.058-.037.06-.037.061-.036.062-.036.063-.036.064-.036.066-.035.067-.035.068-.035.069-.035.07-.034.072-.034.072-.033.074-.033.151-.066.155-.064.159-.063.164-.061.167-.06.172-.059.176-.057.179-.056.184-.054.187-.053.19-.051.195-.05.198-.048.201-.046.204-.045.208-.043.211-.041.214-.04.217-.038.22-.036.223-.034.226-.032.228-.031.231-.028.234-.027.236-.024.238-.023.241-.02.243-.019.245-.016.247-.015.249-.012.251-.01.253-.008.255-.005.256-.004.258-.001.258.001zm-9.258 20.499v.01l.001.021.003.021.004.022.005.021.006.022.007.022.009.023.01.022.011.023.012.023.013.023.015.023.016.024.017.023.018.024.019.024.021.024.022.025.023.024.024.025.052.049.056.05.061.051.066.051.07.051.075.051.079.052.084.052.088.052.092.052.097.052.102.051.105.052.11.052.114.051.119.051.123.051.127.05.131.05.135.05.139.048.144.049.147.047.152.047.155.047.16.045.163.045.167.043.171.043.176.041.178.041.183.039.187.039.19.037.194.035.197.035.202.033.204.031.209.03.212.029.216.027.219.025.222.024.226.021.23.02.233.018.236.016.24.015.243.012.246.01.249.008.253.005.256.004.259.001.26-.001.257-.004.254-.005.25-.008.247-.011.244-.012.241-.014.237-.016.233-.018.231-.021.226-.021.224-.024.22-.026.216-.027.212-.028.21-.031.205-.031.202-.034.198-.034.194-.036.191-.037.187-.039.183-.04.179-.04.175-.042.172-.043.168-.044.163-.045.16-.046.155-.046.152-.047.148-.048.143-.049.139-.049.136-.05.131-.05.126-.05.123-.051.118-.052.114-.051.11-.052.106-.052.101-.052.096-.052.092-.052.088-.053.083-.051.079-.052.074-.052.07-.051.065-.051.06-.051.056-.05.051-.05.023-.024.023-.025.021-.024.02-.024.019-.024.018-.024.017-.024.015-.023.014-.024.013-.023.012-.023.01-.023.01-.022.008-.022.006-.022.006-.022.004-.022.004-.021.001-.021.001-.021v-4.127l-.077.055-.08.053-.083.054-.085.053-.087.052-.09.052-.093.051-.095.05-.097.05-.1.049-.102.049-.105.048-.106.047-.109.047-.111.046-.114.045-.115.045-.118.044-.12.043-.122.042-.124.042-.126.041-.128.04-.13.04-.132.038-.134.038-.135.037-.138.037-.139.035-.142.035-.143.034-.144.033-.147.032-.148.031-.15.03-.151.03-.153.029-.154.027-.156.027-.158.026-.159.025-.161.024-.162.023-.163.022-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.011-.178.01-.179.008-.179.008-.181.006-.182.005-.182.004-.184.003-.184.002h-.37l-.184-.002-.184-.003-.182-.004-.182-.005-.181-.006-.179-.008-.179-.008-.178-.01-.176-.011-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.022-.162-.023-.161-.024-.159-.025-.157-.026-.156-.027-.155-.027-.153-.029-.151-.03-.15-.03-.148-.031-.146-.032-.145-.033-.143-.034-.141-.035-.14-.035-.137-.037-.136-.037-.134-.038-.132-.038-.13-.04-.128-.04-.126-.041-.124-.042-.122-.042-.12-.044-.117-.043-.116-.045-.113-.045-.112-.046-.109-.047-.106-.047-.105-.048-.102-.049-.1-.049-.097-.05-.095-.05-.093-.052-.09-.051-.087-.052-.085-.053-.083-.054-.08-.054-.077-.054v4.127zm0-5.654v.011l.001.021.003.021.004.021.005.022.006.022.007.022.009.022.01.022.011.023.012.023.013.023.015.024.016.023.017.024.018.024.019.024.021.024.022.024.023.025.024.024.052.05.056.05.061.05.066.051.07.051.075.052.079.051.084.052.088.052.092.052.097.052.102.052.105.052.11.051.114.051.119.052.123.05.127.051.131.05.135.049.139.049.144.048.147.048.152.047.155.046.16.045.163.045.167.044.171.042.176.042.178.04.183.04.187.038.19.037.194.036.197.034.202.033.204.032.209.03.212.028.216.027.219.025.222.024.226.022.23.02.233.018.236.016.24.014.243.012.246.01.249.008.253.006.256.003.259.001.26-.001.257-.003.254-.006.25-.008.247-.01.244-.012.241-.015.237-.016.233-.018.231-.02.226-.022.224-.024.22-.025.216-.027.212-.029.21-.03.205-.032.202-.033.198-.035.194-.036.191-.037.187-.039.183-.039.179-.041.175-.042.172-.043.168-.044.163-.045.16-.045.155-.047.152-.047.148-.048.143-.048.139-.05.136-.049.131-.05.126-.051.123-.051.118-.051.114-.052.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.051.07-.052.065-.051.06-.05.056-.051.051-.049.023-.025.023-.024.021-.025.02-.024.019-.024.018-.024.017-.024.015-.023.014-.023.013-.024.012-.022.01-.023.01-.023.008-.022.006-.022.006-.022.004-.021.004-.022.001-.021.001-.021v-4.139l-.077.054-.08.054-.083.054-.085.052-.087.053-.09.051-.093.051-.095.051-.097.05-.1.049-.102.049-.105.048-.106.047-.109.047-.111.046-.114.045-.115.044-.118.044-.12.044-.122.042-.124.042-.126.041-.128.04-.13.039-.132.039-.134.038-.135.037-.138.036-.139.036-.142.035-.143.033-.144.033-.147.033-.148.031-.15.03-.151.03-.153.028-.154.028-.156.027-.158.026-.159.025-.161.024-.162.023-.163.022-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.011-.178.009-.179.009-.179.007-.181.007-.182.005-.182.004-.184.003-.184.002h-.37l-.184-.002-.184-.003-.182-.004-.182-.005-.181-.007-.179-.007-.179-.009-.178-.009-.176-.011-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.022-.162-.023-.161-.024-.159-.025-.157-.026-.156-.027-.155-.028-.153-.028-.151-.03-.15-.03-.148-.031-.146-.033-.145-.033-.143-.033-.141-.035-.14-.036-.137-.036-.136-.037-.134-.038-.132-.039-.13-.039-.128-.04-.126-.041-.124-.042-.122-.043-.12-.043-.117-.044-.116-.044-.113-.046-.112-.046-.109-.046-.106-.047-.105-.048-.102-.049-.1-.049-.097-.05-.095-.051-.093-.051-.09-.051-.087-.053-.085-.052-.083-.054-.08-.054-.077-.054v4.139zm0-5.666v.011l.001.02.003.022.004.021.005.022.006.021.007.022.009.023.01.022.011.023.012.023.013.023.015.023.016.024.017.024.018.023.019.024.021.025.022.024.023.024.024.025.052.05.056.05.061.05.066.051.07.051.075.052.079.051.084.052.088.052.092.052.097.052.102.052.105.051.11.052.114.051.119.051.123.051.127.05.131.05.135.05.139.049.144.048.147.048.152.047.155.046.16.045.163.045.167.043.171.043.176.042.178.04.183.04.187.038.19.037.194.036.197.034.202.033.204.032.209.03.212.028.216.027.219.025.222.024.226.021.23.02.233.018.236.017.24.014.243.012.246.01.249.008.253.006.256.003.259.001.26-.001.257-.003.254-.006.25-.008.247-.01.244-.013.241-.014.237-.016.233-.018.231-.02.226-.022.224-.024.22-.025.216-.027.212-.029.21-.03.205-.032.202-.033.198-.035.194-.036.191-.037.187-.039.183-.039.179-.041.175-.042.172-.043.168-.044.163-.045.16-.045.155-.047.152-.047.148-.048.143-.049.139-.049.136-.049.131-.051.126-.05.123-.051.118-.052.114-.051.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.052.07-.051.065-.051.06-.051.056-.05.051-.049.023-.025.023-.025.021-.024.02-.024.019-.024.018-.024.017-.024.015-.023.014-.024.013-.023.012-.023.01-.022.01-.023.008-.022.006-.022.006-.022.004-.022.004-.021.001-.021.001-.021v-4.153l-.077.054-.08.054-.083.053-.085.053-.087.053-.09.051-.093.051-.095.051-.097.05-.1.049-.102.048-.105.048-.106.048-.109.046-.111.046-.114.046-.115.044-.118.044-.12.043-.122.043-.124.042-.126.041-.128.04-.13.039-.132.039-.134.038-.135.037-.138.036-.139.036-.142.034-.143.034-.144.033-.147.032-.148.032-.15.03-.151.03-.153.028-.154.028-.156.027-.158.026-.159.024-.161.024-.162.023-.163.023-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.01-.178.01-.179.009-.179.007-.181.006-.182.006-.182.004-.184.003-.184.001-.185.001-.185-.001-.184-.001-.184-.003-.182-.004-.182-.006-.181-.006-.179-.007-.179-.009-.178-.01-.176-.01-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.023-.162-.023-.161-.024-.159-.024-.157-.026-.156-.027-.155-.028-.153-.028-.151-.03-.15-.03-.148-.032-.146-.032-.145-.033-.143-.034-.141-.034-.14-.036-.137-.036-.136-.037-.134-.038-.132-.039-.13-.039-.128-.041-.126-.041-.124-.041-.122-.043-.12-.043-.117-.044-.116-.044-.113-.046-.112-.046-.109-.046-.106-.048-.105-.048-.102-.048-.1-.05-.097-.049-.095-.051-.093-.051-.09-.052-.087-.052-.085-.053-.083-.053-.08-.054-.077-.054v4.153zm8.74-8.179l-.257.004-.254.005-.25.008-.247.011-.244.012-.241.014-.237.016-.233.018-.231.021-.226.022-.224.023-.22.026-.216.027-.212.028-.21.031-.205.032-.202.033-.198.034-.194.036-.191.038-.187.038-.183.04-.179.041-.175.042-.172.043-.168.043-.163.045-.16.046-.155.046-.152.048-.148.048-.143.048-.139.049-.136.05-.131.05-.126.051-.123.051-.118.051-.114.052-.11.052-.106.052-.101.052-.096.052-.092.052-.088.052-.083.052-.079.052-.074.051-.07.052-.065.051-.06.05-.056.05-.051.05-.023.025-.023.024-.021.024-.02.025-.019.024-.018.024-.017.023-.015.024-.014.023-.013.023-.012.023-.01.023-.01.022-.008.022-.006.023-.006.021-.004.022-.004.021-.001.021-.001.021.001.021.001.021.004.021.004.022.006.021.006.023.008.022.01.022.01.023.012.023.013.023.014.023.015.024.017.023.018.024.019.024.02.025.021.024.023.024.023.025.051.05.056.05.06.05.065.051.07.052.074.051.079.052.083.052.088.052.092.052.096.052.101.052.106.052.11.052.114.052.118.051.123.051.126.051.131.05.136.05.139.049.143.048.148.048.152.048.155.046.16.046.163.045.168.043.172.043.175.042.179.041.183.04.187.038.191.038.194.036.198.034.202.033.205.032.21.031.212.028.216.027.22.026.224.023.226.022.231.021.233.018.237.016.241.014.244.012.247.011.25.008.254.005.257.004.26.001.26-.001.257-.004.254-.005.25-.008.247-.011.244-.012.241-.014.237-.016.233-.018.231-.021.226-.022.224-.023.22-.026.216-.027.212-.028.21-.031.205-.032.202-.033.198-.034.194-.036.191-.038.187-.038.183-.04.179-.041.175-.042.172-.043.168-.043.163-.045.16-.046.155-.046.152-.048.148-.048.143-.048.139-.049.136-.05.131-.05.126-.051.123-.051.118-.051.114-.052.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.051.07-.052.065-.051.06-.05.056-.05.051-.05.023-.025.023-.024.021-.024.02-.025.019-.024.018-.024.017-.023.015-.024.014-.023.013-.023.012-.023.01-.023.01-.022.008-.022.006-.023.006-.021.004-.022.004-.021.001-.021.001-.021-.001-.021-.001-.021-.004-.021-.004-.022-.006-.021-.006-.023-.008-.022-.01-.022-.01-.023-.012-.023-.013-.023-.014-.023-.015-.024-.017-.023-.018-.024-.019-.024-.02-.025-.021-.024-.023-.024-.023-.025-.051-.05-.056-.05-.06-.05-.065-.051-.07-.052-.074-.051-.079-.052-.083-.052-.088-.052-.092-.052-.096-.052-.101-.052-.106-.052-.11-.052-.114-.052-.118-.051-.123-.051-.126-.051-.131-.05-.136-.05-.139-.049-.143-.048-.148-.048-.152-.048-.155-.046-.16-.046-.163-.045-.168-.043-.172-.043-.175-.042-.179-.041-.183-.04-.187-.038-.191-.038-.194-.036-.198-.034-.202-.033-.205-.032-.21-.031-.212-.028-.216-.027-.22-.026-.224-.023-.226-.022-.231-.021-.233-.018-.237-.016-.241-.014-.244-.012-.247-.011-.25-.008-.254-.005-.257-.004-.26-.001-.26.001z")},"insertDatabaseIcon"),ia=y(function(e){e.append("defs").append("symbol").attr("id","computer").attr("width","24").attr("height","24").append("path").attr("transform","scale(.5)").attr("d","M2 2v13h20v-13h-20zm18 11h-16v-9h16v9zm-10.228 6l.466-1h3.524l.467 1h-4.457zm14.228 3h-24l2-6h2.104l-1.33 4h18.45l-1.297-4h2.073l2 6zm-5-10h-14v-7h14v7z")},"insertComputerIcon"),oa=y(function(e){e.append("defs").append("symbol").attr("id","clock").attr("width","24").attr("height","24").append("path").attr("transform","scale(.5)").attr("d","M12 2c5.514 0 10 4.486 10 10s-4.486 10-10 10-10-4.486-10-10 4.486-10 10-10zm0-2c-6.627 0-12 5.373-12 12s5.373 12 12 12 12-5.373 12-12-5.373-12-12-12zm5.848 12.459c.202.038.202.333.001.372-1.907.361-6.045 1.111-6.547 1.111-.719 0-1.301-.582-1.301-1.301 0-.512.77-5.447 1.125-7.445.034-.192.312-.181.343.014l.985 6.238 5.394 1.011z")},"insertClockIcon"),na=y(function(e){e.append("defs").append("marker").attr("id","arrowhead").attr("refX",7.9).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto-start-reverse").append("path").attr("d","M -1 0 L 10 5 L 0 10 z")},"insertArrowHead"),ca=y(function(e){e.append("defs").append("marker").attr("id","filled-head").attr("refX",15.5).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L14,7 L9,1 Z")},"insertArrowFilledHead"),la=y(function(e){e.append("defs").append("marker").attr("id","sequencenumber").attr("refX",15).attr("refY",15).attr("markerWidth",60).attr("markerHeight",40).attr("orient","auto").append("circle").attr("cx",15).attr("cy",15).attr("r",6)},"insertSequenceNumber"),ha=y(function(e){e.append("defs").append("marker").attr("id","crosshead").attr("markerWidth",15).attr("markerHeight",8).attr("orient","auto").attr("refX",4).attr("refY",4.5).append("path").attr("fill","none").attr("stroke","#000000").style("stroke-dasharray","0, 0").attr("stroke-width","1pt").attr("d","M 1,2 L 6,7 M 6,2 L 1,7")},"insertArrowCrossHead"),le=y(function(){return{x:0,y:0,fill:void 0,anchor:void 0,style:"#666",width:void 0,height:void 0,textMargin:0,rx:0,ry:0,tspan:!0,valign:void 0}},"getTextObj"),da=y(function(){return{x:0,y:0,fill:"#EDF2AE",stroke:"#666",width:100,anchor:"start",height:100,rx:0,ry:0}},"getNoteRect"),pt=function(){function e(s,c,h,g,i,d,n){const u=c.append("text").attr("x",h+i/2).attr("y",g+d/2+5).style("text-anchor","middle").text(s);r(u,n)}y(e,"byText");function t(s,c,h,g,i,d,n,u){const{actorFontSize:b,actorFontFamily:T,actorFontWeight:w}=u,[v,A]=se(b),N=s.split(L.lineBreakRegex);for(let M=0;M<N.length;M++){const $=M*v-v*(N.length-1)/2,B=c.append("text").attr("x",h+i/2).attr("y",g).style("text-anchor","middle").style("font-size",A).style("font-weight",w).style("font-family",T);B.append("tspan").attr("x",h+i/2).attr("dy",$).text(N[M]),B.attr("y",g+d/2).attr("dominant-baseline","central").attr("alignment-baseline","central"),r(B,n)}}y(t,"byTspan");function o(s,c,h,g,i,d,n,u){const b=c.append("switch"),T=b.append("foreignObject").attr("x",h).attr("y",g).attr("width",i).attr("height",d).append("xhtml:div").style("display","table").style("height","100%").style("width","100%");T.append("div").style("display","table-cell").style("text-align","center").style("vertical-align","middle").text(s),t(s,b,h,g,i,d,n,u),r(T,n)}y(o,"byFo");async function a(s,c,h,g,i,d,n,u){const b=await kt(s,qt()),T=c.append("switch"),w=T.append("foreignObject").attr("x",h+i/2-b.width/2).attr("y",g+d/2-b.height/2).attr("width",b.width).attr("height",b.height).append("xhtml:div").style("height","100%").style("width","100%");w.append("div").style("text-align","center").style("vertical-align","middle").html(await ie(s,qt())),t(s,T,h,g,i,d,n,u),r(w,n)}y(a,"byKatex");function r(s,c){for(const h in c)c.hasOwnProperty(h)&&s.attr(h,c[h])}return y(r,"_setTextAttrs"),function(s,c=!1){return c?a:s.textPlacement==="fo"?o:s.textPlacement==="old"?e:t}}(),pa=function(){function e(r,s,c,h,g,i,d){const n=s.append("text").attr("x",c).attr("y",h).style("text-anchor","start").text(r);a(n,d)}y(e,"byText");function t(r,s,c,h,g,i,d,n){const{actorFontSize:u,actorFontFamily:b,actorFontWeight:T}=n,w=r.split(L.lineBreakRegex);for(let v=0;v<w.length;v++){const A=v*u-u*(w.length-1)/2,N=s.append("text").attr("x",c).attr("y",h).style("text-anchor","start").style("font-size",u).style("font-weight",T).style("font-family",b);N.append("tspan").attr("x",c).attr("dy",A).text(w[v]),N.attr("y",h+i/2).attr("dominant-baseline","central").attr("alignment-baseline","central"),a(N,d)}}y(t,"byTspan");function o(r,s,c,h,g,i,d,n){const u=s.append("switch"),b=u.append("foreignObject").attr("x",c).attr("y",h).attr("width",g).attr("height",i).append("xhtml:div").style("display","table").style("height","100%").style("width","100%");b.append("div").style("display","table-cell").style("text-align","center").style("vertical-align","middle").text(r),t(r,u,c,h,g,i,d,n),a(b,d)}y(o,"byFo");function a(r,s){for(const c in s)s.hasOwnProperty(c)&&r.attr(c,s[c])}return y(a,"_setTextAttrs"),function(r){return r.textPlacement==="fo"?o:r.textPlacement==="old"?e:t}}(),C={drawRect:It,drawText:wt,drawLabel:oe,drawActor:Je,drawBox:ta,drawPopup:ze,anchorElement:ea,drawActivation:aa,drawLoop:ra,drawBackgroundRect:ce,insertArrowHead:na,insertArrowFilledHead:ca,insertSequenceNumber:la,insertArrowCrossHead:ha,insertDatabaseIcon:sa,insertComputerIcon:ia,insertClockIcon:oa,getTextObj:le,getNoteRect:da,fixLifeLineHeights:ne,sanitizeUrl:re.sanitizeUrl},l={},m={data:{startx:void 0,stopx:void 0,starty:void 0,stopy:void 0},verticalPos:0,sequenceItems:[],activations:[],models:{getHeight:y(function(){return Math.max.apply(null,this.actors.length===0?[0]:this.actors.map(e=>e.height||0))+(this.loops.length===0?0:this.loops.map(e=>e.height||0).reduce((e,t)=>e+t))+(this.messages.length===0?0:this.messages.map(e=>e.height||0).reduce((e,t)=>e+t))+(this.notes.length===0?0:this.notes.map(e=>e.height||0).reduce((e,t)=>e+t))},"getHeight"),clear:y(function(){this.actors=[],this.boxes=[],this.loops=[],this.messages=[],this.notes=[]},"clear"),addBox:y(function(e){this.boxes.push(e)},"addBox"),addActor:y(function(e){this.actors.push(e)},"addActor"),addLoop:y(function(e){this.loops.push(e)},"addLoop"),addMessage:y(function(e){this.messages.push(e)},"addMessage"),addNote:y(function(e){this.notes.push(e)},"addNote"),lastActor:y(function(){return this.actors[this.actors.length-1]},"lastActor"),lastLoop:y(function(){return this.loops[this.loops.length-1]},"lastLoop"),lastMessage:y(function(){return this.messages[this.messages.length-1]},"lastMessage"),lastNote:y(function(){return this.notes[this.notes.length-1]},"lastNote"),actors:[],boxes:[],loops:[],messages:[],notes:[]},init:y(function(){this.sequenceItems=[],this.activations=[],this.models.clear(),this.data={startx:void 0,stopx:void 0,starty:void 0,stopy:void 0},this.verticalPos=0,pe(at())},"init"),updateVal:y(function(e,t,o,a){e[t]===void 0?e[t]=o:e[t]=a(o,e[t])},"updateVal"),updateBounds:y(function(e,t,o,a){const r=this;let s=0;function c(h){return y(function(g){s++;const i=r.sequenceItems.length-s+1;r.updateVal(g,"starty",t-i*l.boxMargin,Math.min),r.updateVal(g,"stopy",a+i*l.boxMargin,Math.max),r.updateVal(m.data,"startx",e-i*l.boxMargin,Math.min),r.updateVal(m.data,"stopx",o+i*l.boxMargin,Math.max),h!=="activation"&&(r.updateVal(g,"startx",e-i*l.boxMargin,Math.min),r.updateVal(g,"stopx",o+i*l.boxMargin,Math.max),r.updateVal(m.data,"starty",t-i*l.boxMargin,Math.min),r.updateVal(m.data,"stopy",a+i*l.boxMargin,Math.max))},"updateItemBounds")}y(c,"updateFn"),this.sequenceItems.forEach(c()),this.activations.forEach(c("activation"))},"updateBounds"),insert:y(function(e,t,o,a){const r=L.getMin(e,o),s=L.getMax(e,o),c=L.getMin(t,a),h=L.getMax(t,a);this.updateVal(m.data,"startx",r,Math.min),this.updateVal(m.data,"starty",c,Math.min),this.updateVal(m.data,"stopx",s,Math.max),this.updateVal(m.data,"stopy",h,Math.max),this.updateBounds(r,c,s,h)},"insert"),newActivation:y(function(e,t,o){const a=o.get(e.from),r=$t(e.from).length||0,s=a.x+a.width/2+(r-1)*l.activationWidth/2;this.activations.push({startx:s,starty:this.verticalPos+2,stopx:s+l.activationWidth,stopy:void 0,actor:e.from,anchored:C.anchorElement(t)})},"newActivation"),endActivation:y(function(e){const t=this.activations.map(function(o){return o.actor}).lastIndexOf(e.from);return this.activations.splice(t,1)[0]},"endActivation"),createLoop:y(function(e={message:void 0,wrap:!1,width:void 0},t){return{startx:void 0,starty:this.verticalPos,stopx:void 0,stopy:void 0,title:e.message,wrap:e.wrap,width:e.width,height:0,fill:t}},"createLoop"),newLoop:y(function(e={message:void 0,wrap:!1,width:void 0},t){this.sequenceItems.push(this.createLoop(e,t))},"newLoop"),endLoop:y(function(){return this.sequenceItems.pop()},"endLoop"),isLoopOverlap:y(function(){return this.sequenceItems.length?this.sequenceItems[this.sequenceItems.length-1].overlap:!1},"isLoopOverlap"),addSectionToLoop:y(function(e){const t=this.sequenceItems.pop();t.sections=t.sections||[],t.sectionTitles=t.sectionTitles||[],t.sections.push({y:m.getVerticalPos(),height:0}),t.sectionTitles.push(e),this.sequenceItems.push(t)},"addSectionToLoop"),saveVerticalPos:y(function(){this.isLoopOverlap()&&(this.savedVerticalPos=this.verticalPos)},"saveVerticalPos"),resetVerticalPos:y(function(){this.isLoopOverlap()&&(this.verticalPos=this.savedVerticalPos)},"resetVerticalPos"),bumpVerticalPos:y(function(e){this.verticalPos=this.verticalPos+e,this.data.stopy=L.getMax(this.data.stopy,this.verticalPos)},"bumpVerticalPos"),getVerticalPos:y(function(){return this.verticalPos},"getVerticalPos"),getBounds:y(function(){return{bounds:this.data,models:this.models}},"getBounds")},ga=y(async function(e,t){m.bumpVerticalPos(l.boxMargin),t.height=l.boxMargin,t.starty=m.getVerticalPos();const o=lt();o.x=t.startx,o.y=t.starty,o.width=t.width||l.width,o.class="note";const a=e.append("g"),r=C.drawRect(a,o),s=Ut();s.x=t.startx,s.y=t.starty,s.width=o.width,s.dy="1em",s.text=t.message,s.class="noteText",s.fontFamily=l.noteFontFamily,s.fontSize=l.noteFontSize,s.fontWeight=l.noteFontWeight,s.anchor=l.noteAlign,s.textMargin=l.noteMargin,s.valign="center";const c=W(s.text)?await Ot(a,s):wt(a,s),h=Math.round(c.map(g=>(g._groups||g)[0][0].getBBox().height).reduce((g,i)=>g+i));r.attr("height",h+2*l.noteMargin),t.height+=h+2*l.noteMargin,m.bumpVerticalPos(h+2*l.noteMargin),t.stopy=t.starty+h+2*l.noteMargin,t.stopx=t.startx+o.width,m.insert(t.startx,t.starty,t.stopx,t.stopy),m.models.addNote(t)},"drawNote"),Tt=y(e=>({fontFamily:e.messageFontFamily,fontSize:e.messageFontSize,fontWeight:e.messageFontWeight}),"messageFont"),Et=y(e=>({fontFamily:e.noteFontFamily,fontSize:e.noteFontSize,fontWeight:e.noteFontWeight}),"noteFont"),Ht=y(e=>({fontFamily:e.actorFontFamily,fontSize:e.actorFontSize,fontWeight:e.actorFontWeight}),"actorFont");async function he(e,t){m.bumpVerticalPos(10);const{startx:o,stopx:a,message:r}=t,s=L.splitBreaks(r).length,c=W(r),h=c?await kt(r,at()):V.calculateTextDimensions(r,Tt(l));if(!c){const n=h.height/s;t.height+=n,m.bumpVerticalPos(n)}let g,i=h.height-10;const d=h.width;if(o===a){g=m.getVerticalPos()+i,l.rightAngles||(i+=l.boxMargin,g=m.getVerticalPos()+i),i+=30;const n=L.getMax(d/2,l.width/2);m.insert(o-n,m.getVerticalPos()-10+i,a+n,m.getVerticalPos()+30+i)}else i+=l.boxMargin,g=m.getVerticalPos()+i,m.insert(o,g-10,a,g);return m.bumpVerticalPos(i),t.height+=i,t.stopy=t.starty+t.height,m.insert(t.fromBounds,t.starty,t.toBounds,t.stopy),g}y(he,"boundMessage");var ua=y(async function(e,t,o,a){const{startx:r,stopx:s,starty:c,message:h,type:g,sequenceIndex:i,sequenceVisible:d}=t,n=V.calculateTextDimensions(h,Tt(l)),u=Ut();u.x=r,u.y=c+10,u.width=s-r,u.class="messageText",u.dy="1em",u.text=h,u.fontFamily=l.messageFontFamily,u.fontSize=l.messageFontSize,u.fontWeight=l.messageFontWeight,u.anchor=l.messageAlign,u.valign="center",u.textMargin=l.wrapPadding,u.tspan=!1,W(u.text)?await Ot(e,u,{startx:r,stopx:s,starty:o}):wt(e,u);const b=n.width;let T;r===s?l.rightAngles?T=e.append("path").attr("d",`M ${r},${o} H ${r+L.getMax(l.width/2,b/2)} V ${o+25} H ${r}`):T=e.append("path").attr("d","M "+r+","+o+" C "+(r+60)+","+(o-10)+" "+(r+60)+","+(o+30)+" "+r+","+(o+20)):(T=e.append("line"),T.attr("x1",r),T.attr("y1",o),T.attr("x2",s),T.attr("y2",o)),g===a.db.LINETYPE.DOTTED||g===a.db.LINETYPE.DOTTED_CROSS||g===a.db.LINETYPE.DOTTED_POINT||g===a.db.LINETYPE.DOTTED_OPEN||g===a.db.LINETYPE.BIDIRECTIONAL_DOTTED?(T.style("stroke-dasharray","3, 3"),T.attr("class","messageLine1")):T.attr("class","messageLine0");let w="";l.arrowMarkerAbsolute&&(w=$e(!0)),T.attr("stroke-width",2),T.attr("stroke","none"),T.style("fill","none"),(g===a.db.LINETYPE.SOLID||g===a.db.LINETYPE.DOTTED)&&T.attr("marker-end","url("+w+"#arrowhead)"),(g===a.db.LINETYPE.BIDIRECTIONAL_SOLID||g===a.db.LINETYPE.BIDIRECTIONAL_DOTTED)&&(T.attr("marker-start","url("+w+"#arrowhead)"),T.attr("marker-end","url("+w+"#arrowhead)")),(g===a.db.LINETYPE.SOLID_POINT||g===a.db.LINETYPE.DOTTED_POINT)&&T.attr("marker-end","url("+w+"#filled-head)"),(g===a.db.LINETYPE.SOLID_CROSS||g===a.db.LINETYPE.DOTTED_CROSS)&&T.attr("marker-end","url("+w+"#crosshead)"),(d||l.showSequenceNumbers)&&((g===a.db.LINETYPE.BIDIRECTIONAL_SOLID||g===a.db.LINETYPE.BIDIRECTIONAL_DOTTED)&&(r<s?T.attr("x1",r+12):T.attr("x1",r+6)),e.append("line").attr("x1",r).attr("y1",o).attr("x2",r).attr("y2",o).attr("stroke-width",0).attr("marker-start","url("+w+"#sequencenumber)"),e.append("text").attr("x",r).attr("y",o+4).attr("font-family","sans-serif").attr("font-size","12px").attr("text-anchor","middle").attr("class","sequenceNumber").text(i))},"drawMessage"),xa=y(function(e,t,o,a,r,s,c){let h=0,g=0,i,d=0;for(const n of a){const u=t.get(n),b=u.box;i&&i!=b&&(c||m.models.addBox(i),g+=l.boxMargin+i.margin),b&&b!=i&&(c||(b.x=h+g,b.y=r),g+=b.margin),u.width=u.width||l.width,u.height=L.getMax(u.height||l.height,l.height),u.margin=u.margin||l.actorMargin,d=L.getMax(d,u.height),o.get(u.name)&&(g+=u.width/2),u.x=h+g,u.starty=m.getVerticalPos(),m.insert(u.x,r,u.x+u.width,u.height),h+=u.width+g,u.box&&(u.box.width=h+b.margin-u.box.x),g=u.margin,i=u.box,m.models.addActor(u)}i&&!c&&m.models.addBox(i),m.bumpVerticalPos(d)},"addActorRenderingData"),jt=y(async function(e,t,o,a){if(a){let r=0;m.bumpVerticalPos(l.boxMargin*2);for(const s of o){const c=t.get(s);c.stopy||(c.stopy=m.getVerticalPos());const h=await C.drawActor(e,c,l,!0);r=L.getMax(r,h)}m.bumpVerticalPos(r+l.boxMargin)}else for(const r of o){const s=t.get(r);await C.drawActor(e,s,l,!1)}},"drawActors"),de=y(function(e,t,o,a){let r=0,s=0;for(const c of o){const h=t.get(c),g=ba(h),i=C.drawPopup(e,h,g,l,l.forceMenus,a);i.height>r&&(r=i.height),i.width+h.x>s&&(s=i.width+h.x)}return{maxHeight:r,maxWidth:s}},"drawActorsPopup"),pe=y(function(e){Le(l,e),e.fontFamily&&(l.actorFontFamily=l.noteFontFamily=l.messageFontFamily=e.fontFamily),e.fontSize&&(l.actorFontSize=l.noteFontSize=l.messageFontSize=e.fontSize),e.fontWeight&&(l.actorFontWeight=l.noteFontWeight=l.messageFontWeight=e.fontWeight)},"setConf"),$t=y(function(e){return m.activations.filter(function(t){return t.actor===e})},"actorActivations"),ae=y(function(e,t){const o=t.get(e),a=$t(e),r=a.reduce(function(c,h){return L.getMin(c,h.startx)},o.x+o.width/2-1),s=a.reduce(function(c,h){return L.getMax(c,h.stopx)},o.x+o.width/2+1);return[r,s]},"activationBounds");function ot(e,t,o,a,r){m.bumpVerticalPos(o);let s=a;if(t.id&&t.message&&e[t.id]){const c=e[t.id].width,h=Tt(l);t.message=V.wrapLabel(`[${t.message}]`,c-2*l.wrapPadding,h),t.width=c,t.wrap=!0;const g=V.calculateTextDimensions(t.message,h),i=L.getMax(g.height,l.labelBoxHeight);s=a+i,X.debug(`${i} - ${t.message}`)}r(t),m.bumpVerticalPos(s)}y(ot,"adjustLoopHeightForWrap");function ge(e,t,o,a,r,s,c){function h(d,n){d.x<r.get(e.from).x?(m.insert(t.stopx-n,t.starty,t.startx,t.stopy+d.height/2+l.noteMargin),t.stopx=t.stopx+n):(m.insert(t.startx,t.starty,t.stopx+n,t.stopy+d.height/2+l.noteMargin),t.stopx=t.stopx-n)}y(h,"receiverAdjustment");function g(d,n){d.x<r.get(e.to).x?(m.insert(t.startx-n,t.starty,t.stopx,t.stopy+d.height/2+l.noteMargin),t.startx=t.startx+n):(m.insert(t.stopx,t.starty,t.startx+n,t.stopy+d.height/2+l.noteMargin),t.startx=t.startx-n)}y(g,"senderAdjustment");const i=[Mt.ACTOR,Mt.CONTROL,Mt.ENTITY,Mt.DATABASE];if(s.get(e.to)==a){const d=r.get(e.to),n=i.includes(d.type)?mt/2+3:d.width/2+3;h(d,n),d.starty=o-d.height/2,m.bumpVerticalPos(d.height/2)}else if(c.get(e.from)==a){const d=r.get(e.from);if(l.mirrorActors){const n=i.includes(d.type)?mt/2:d.width/2;g(d,n)}d.stopy=o-d.height/2,m.bumpVerticalPos(d.height/2)}else if(c.get(e.to)==a){const d=r.get(e.to);if(l.mirrorActors){const n=i.includes(d.type)?mt/2+3:d.width/2+3;h(d,n)}d.stopy=o-d.height/2,m.bumpVerticalPos(d.height/2)}}y(ge,"adjustCreatedDestroyedData");var ya=y(async function(e,t,o,a){const{securityLevel:r,sequence:s}=at();l=s;let c;r==="sandbox"&&(c=At("#i"+t));const h=r==="sandbox"?At(c.nodes()[0].contentDocument.body):At("body"),g=r==="sandbox"?c.nodes()[0].contentDocument:document;m.init(),X.debug(a.db);const i=r==="sandbox"?h.select(`[id="${t}"]`):At(`[id="${t}"]`),d=a.db.getActors(),n=a.db.getCreatedActors(),u=a.db.getDestroyedActors(),b=a.db.getBoxes();let T=a.db.getActorKeys();const w=a.db.getMessages(),v=a.db.getDiagramTitle(),A=a.db.hasAtLeastOneBox(),N=a.db.hasAtLeastOneBoxWithTitle(),M=await ue(d,w,a);if(l.height=await xe(d,M,b),C.insertComputerIcon(i),C.insertDatabaseIcon(i),C.insertClockIcon(i),A&&(m.bumpVerticalPos(l.boxMargin),N&&m.bumpVerticalPos(b[0].textMaxHeight)),l.hideUnusedParticipants===!0){const f=new Set;w.forEach(P=>{f.add(P.from),f.add(P.to)}),T=T.filter(P=>f.has(P))}xa(i,d,n,T,0,w,!1);const $=await fa(w,d,M,a);C.insertArrowHead(i),C.insertArrowCrossHead(i),C.insertArrowFilledHead(i),C.insertSequenceNumber(i);function B(f,P){const U=m.endActivation(f);U.starty+18>P&&(U.starty=P-6,P+=12),C.drawActivation(i,U,P,l,$t(f.from).length),m.insert(U.startx,P-10,U.stopx,P)}y(B,"activeEnd");let q=1,Z=1;const rt=[],z=[];let H=0;for(const f of w){let P,U,tt;switch(f.type){case a.db.LINETYPE.NOTE:m.resetVerticalPos(),U=f.noteModel,await ga(i,U);break;case a.db.LINETYPE.ACTIVE_START:m.newActivation(f,i,d);break;case a.db.LINETYPE.ACTIVE_END:B(f,m.getVerticalPos());break;case a.db.LINETYPE.LOOP_START:ot($,f,l.boxMargin,l.boxMargin+l.boxTextMargin,S=>m.newLoop(S));break;case a.db.LINETYPE.LOOP_END:P=m.endLoop(),await C.drawLoop(i,P,"loop",l),m.bumpVerticalPos(P.stopy-m.getVerticalPos()),m.models.addLoop(P);break;case a.db.LINETYPE.RECT_START:ot($,f,l.boxMargin,l.boxMargin,S=>m.newLoop(void 0,S.message));break;case a.db.LINETYPE.RECT_END:P=m.endLoop(),z.push(P),m.models.addLoop(P),m.bumpVerticalPos(P.stopy-m.getVerticalPos());break;case a.db.LINETYPE.OPT_START:ot($,f,l.boxMargin,l.boxMargin+l.boxTextMargin,S=>m.newLoop(S));break;case a.db.LINETYPE.OPT_END:P=m.endLoop(),await C.drawLoop(i,P,"opt",l),m.bumpVerticalPos(P.stopy-m.getVerticalPos()),m.models.addLoop(P);break;case a.db.LINETYPE.ALT_START:ot($,f,l.boxMargin,l.boxMargin+l.boxTextMargin,S=>m.newLoop(S));break;case a.db.LINETYPE.ALT_ELSE:ot($,f,l.boxMargin+l.boxTextMargin,l.boxMargin,S=>m.addSectionToLoop(S));break;case a.db.LINETYPE.ALT_END:P=m.endLoop(),await C.drawLoop(i,P,"alt",l),m.bumpVerticalPos(P.stopy-m.getVerticalPos()),m.models.addLoop(P);break;case a.db.LINETYPE.PAR_START:case a.db.LINETYPE.PAR_OVER_START:ot($,f,l.boxMargin,l.boxMargin+l.boxTextMargin,S=>m.newLoop(S)),m.saveVerticalPos();break;case a.db.LINETYPE.PAR_AND:ot($,f,l.boxMargin+l.boxTextMargin,l.boxMargin,S=>m.addSectionToLoop(S));break;case a.db.LINETYPE.PAR_END:P=m.endLoop(),await C.drawLoop(i,P,"par",l),m.bumpVerticalPos(P.stopy-m.getVerticalPos()),m.models.addLoop(P);break;case a.db.LINETYPE.AUTONUMBER:q=f.message.start||q,Z=f.message.step||Z,f.message.visible?a.db.enableSequenceNumbers():a.db.disableSequenceNumbers();break;case a.db.LINETYPE.CRITICAL_START:ot($,f,l.boxMargin,l.boxMargin+l.boxTextMargin,S=>m.newLoop(S));break;case a.db.LINETYPE.CRITICAL_OPTION:ot($,f,l.boxMargin+l.boxTextMargin,l.boxMargin,S=>m.addSectionToLoop(S));break;case a.db.LINETYPE.CRITICAL_END:P=m.endLoop(),await C.drawLoop(i,P,"critical",l),m.bumpVerticalPos(P.stopy-m.getVerticalPos()),m.models.addLoop(P);break;case a.db.LINETYPE.BREAK_START:ot($,f,l.boxMargin,l.boxMargin+l.boxTextMargin,S=>m.newLoop(S));break;case a.db.LINETYPE.BREAK_END:P=m.endLoop(),await C.drawLoop(i,P,"break",l),m.bumpVerticalPos(P.stopy-m.getVerticalPos()),m.models.addLoop(P);break;default:try{tt=f.msgModel,tt.starty=m.getVerticalPos(),tt.sequenceIndex=q,tt.sequenceVisible=a.db.showSequenceNumbers();const S=await he(i,tt);ge(f,tt,S,H,d,n,u),rt.push({messageModel:tt,lineStartY:S}),m.models.addMessage(tt)}catch(S){X.error("error while drawing message",S)}}[a.db.LINETYPE.SOLID_OPEN,a.db.LINETYPE.DOTTED_OPEN,a.db.LINETYPE.SOLID,a.db.LINETYPE.DOTTED,a.db.LINETYPE.SOLID_CROSS,a.db.LINETYPE.DOTTED_CROSS,a.db.LINETYPE.SOLID_POINT,a.db.LINETYPE.DOTTED_POINT,a.db.LINETYPE.BIDIRECTIONAL_SOLID,a.db.LINETYPE.BIDIRECTIONAL_DOTTED].includes(f.type)&&(q=q+Z),H++}X.debug("createdActors",n),X.debug("destroyedActors",u),await jt(i,d,T,!1);for(const f of rt)await ua(i,f.messageModel,f.lineStartY,a);l.mirrorActors&&await jt(i,d,T,!0),z.forEach(f=>C.drawBackgroundRect(i,f)),ne(i,d,T,l);for(const f of m.models.boxes){f.height=m.getVerticalPos()-f.y,m.insert(f.x,f.y,f.x+f.width,f.height);const P=l.boxMargin*2;f.startx=f.x-P,f.starty=f.y-P*.25,f.stopx=f.startx+f.width+2*P,f.stopy=f.starty+f.height+P*.75,f.stroke="rgb(0,0,0, 0.5)",C.drawBox(i,f,l)}A&&m.bumpVerticalPos(l.boxMargin);const F=de(i,d,T,g),{bounds:R}=m.getBounds();R.startx===void 0&&(R.startx=0),R.starty===void 0&&(R.starty=0),R.stopx===void 0&&(R.stopx=0),R.stopy===void 0&&(R.stopy=0);let Q=R.stopy-R.starty;Q<F.maxHeight&&(Q=F.maxHeight);let j=Q+2*l.diagramMarginY;l.mirrorActors&&(j=j-l.boxMargin+l.bottomMarginAdj);let J=R.stopx-R.startx;J<F.maxWidth&&(J=F.maxWidth);const st=J+2*l.diagramMarginX;v&&i.append("text").text(v).attr("x",(R.stopx-R.startx)/2-2*l.diagramMarginX).attr("y",-25),ke(i,j,st,l.useMaxWidth);const D=v?40:0;i.attr("viewBox",R.startx-l.diagramMarginX+" -"+(l.diagramMarginY+D)+" "+st+" "+(j+D)),X.debug("models:",m.models)},"draw");async function ue(e,t,o){const a={};for(const r of t)if(e.get(r.to)&&e.get(r.from)){const s=e.get(r.to);if(r.placement===o.db.PLACEMENT.LEFTOF&&!s.prevActor||r.placement===o.db.PLACEMENT.RIGHTOF&&!s.nextActor)continue;const c=r.placement!==void 0,h=!c,g=c?Et(l):Tt(l),i=r.wrap?V.wrapLabel(r.message,l.width-2*l.wrapPadding,g):r.message,d=(W(i)?await kt(r.message,at()):V.calculateTextDimensions(i,g)).width+2*l.wrapPadding;h&&r.from===s.nextActor?a[r.to]=L.getMax(a[r.to]||0,d):h&&r.from===s.prevActor?a[r.from]=L.getMax(a[r.from]||0,d):h&&r.from===r.to?(a[r.from]=L.getMax(a[r.from]||0,d/2),a[r.to]=L.getMax(a[r.to]||0,d/2)):r.placement===o.db.PLACEMENT.RIGHTOF?a[r.from]=L.getMax(a[r.from]||0,d):r.placement===o.db.PLACEMENT.LEFTOF?a[s.prevActor]=L.getMax(a[s.prevActor]||0,d):r.placement===o.db.PLACEMENT.OVER&&(s.prevActor&&(a[s.prevActor]=L.getMax(a[s.prevActor]||0,d/2)),s.nextActor&&(a[r.from]=L.getMax(a[r.from]||0,d/2)))}return X.debug("maxMessageWidthPerActor:",a),a}y(ue,"getMaxMessageWidthPerActor");var ba=y(function(e){let t=0;const o=Ht(l);for(const a in e.links){const r=V.calculateTextDimensions(a,o).width+2*l.wrapPadding+2*l.boxMargin;t<r&&(t=r)}return t},"getRequiredPopupWidth");async function xe(e,t,o){let a=0;for(const s of e.keys()){const c=e.get(s);c.wrap&&(c.description=V.wrapLabel(c.description,l.width-2*l.wrapPadding,Ht(l)));const h=W(c.description)?await kt(c.description,at()):V.calculateTextDimensions(c.description,Ht(l));c.width=c.wrap?l.width:L.getMax(l.width,h.width+2*l.wrapPadding),c.height=c.wrap?L.getMax(h.height,l.height):l.height,a=L.getMax(a,c.height)}for(const s in t){const c=e.get(s);if(!c)continue;const h=e.get(c.nextActor);if(!h){const i=t[s]+l.actorMargin-c.width/2;c.margin=L.getMax(i,l.actorMargin);continue}const g=t[s]+l.actorMargin-c.width/2-h.width/2;c.margin=L.getMax(g,l.actorMargin)}let r=0;return o.forEach(s=>{const c=Tt(l);let h=s.actorKeys.reduce((n,u)=>n+=e.get(u).width+(e.get(u).margin||0),0);const g=l.boxMargin*8;h+=g,h-=2*l.boxTextMargin,s.wrap&&(s.name=V.wrapLabel(s.name,h-2*l.wrapPadding,c));const i=V.calculateTextDimensions(s.name,c);r=L.getMax(i.height,r);const d=L.getMax(h,i.width+2*l.wrapPadding);if(s.margin=l.boxTextMargin,h<d){const n=(d-h)/2;s.margin+=n}}),o.forEach(s=>s.textMaxHeight=r),L.getMax(a,l.height)}y(xe,"calculateActorMargins");var ma=y(async function(e,t,o){const a=t.get(e.from),r=t.get(e.to),s=a.x,c=r.x,h=e.wrap&&e.message;let g=W(e.message)?await kt(e.message,at()):V.calculateTextDimensions(h?V.wrapLabel(e.message,l.width,Et(l)):e.message,Et(l));const i={width:h?l.width:L.getMax(l.width,g.width+2*l.noteMargin),height:0,startx:a.x,stopx:0,starty:0,stopy:0,message:e.message};return e.placement===o.db.PLACEMENT.RIGHTOF?(i.width=h?L.getMax(l.width,g.width):L.getMax(a.width/2+r.width/2,g.width+2*l.noteMargin),i.startx=s+(a.width+l.actorMargin)/2):e.placement===o.db.PLACEMENT.LEFTOF?(i.width=h?L.getMax(l.width,g.width+2*l.noteMargin):L.getMax(a.width/2+r.width/2,g.width+2*l.noteMargin),i.startx=s-i.width+(a.width-l.actorMargin)/2):e.to===e.from?(g=V.calculateTextDimensions(h?V.wrapLabel(e.message,L.getMax(l.width,a.width),Et(l)):e.message,Et(l)),i.width=h?L.getMax(l.width,a.width):L.getMax(a.width,l.width,g.width+2*l.noteMargin),i.startx=s+(a.width-i.width)/2):(i.width=Math.abs(s+a.width/2-(c+r.width/2))+l.actorMargin,i.startx=s<c?s+a.width/2-l.actorMargin/2:c+r.width/2-l.actorMargin/2),h&&(i.message=V.wrapLabel(e.message,i.width-2*l.wrapPadding,Et(l))),X.debug(`NM:[${i.startx},${i.stopx},${i.starty},${i.stopy}:${i.width},${i.height}=${e.message}]`),i},"buildNoteModel"),Ta=y(function(e,t,o){if(![o.db.LINETYPE.SOLID_OPEN,o.db.LINETYPE.DOTTED_OPEN,o.db.LINETYPE.SOLID,o.db.LINETYPE.DOTTED,o.db.LINETYPE.SOLID_CROSS,o.db.LINETYPE.DOTTED_CROSS,o.db.LINETYPE.SOLID_POINT,o.db.LINETYPE.DOTTED_POINT,o.db.LINETYPE.BIDIRECTIONAL_SOLID,o.db.LINETYPE.BIDIRECTIONAL_DOTTED].includes(e.type))return{};const[a,r]=ae(e.from,t),[s,c]=ae(e.to,t),h=a<=s;let g=h?r:a,i=h?s:c;const d=Math.abs(s-c)>2,n=y(w=>h?-w:w,"adjustValue");e.from===e.to?i=g:(e.activate&&!d&&(i+=n(l.activationWidth/2-1)),[o.db.LINETYPE.SOLID_OPEN,o.db.LINETYPE.DOTTED_OPEN].includes(e.type)||(i+=n(3)),[o.db.LINETYPE.BIDIRECTIONAL_SOLID,o.db.LINETYPE.BIDIRECTIONAL_DOTTED].includes(e.type)&&(g-=n(3)));const u=[a,r,s,c],b=Math.abs(g-i);e.wrap&&e.message&&(e.message=V.wrapLabel(e.message,L.getMax(b+2*l.wrapPadding,l.width),Tt(l)));const T=V.calculateTextDimensions(e.message,Tt(l));return{width:L.getMax(e.wrap?0:T.width+2*l.wrapPadding,b+2*l.wrapPadding,l.width),height:0,startx:g,stopx:i,starty:0,stopy:0,message:e.message,type:e.type,wrap:e.wrap,fromBounds:Math.min.apply(null,u),toBounds:Math.max.apply(null,u)}},"buildMessageModel"),fa=y(async function(e,t,o,a){const r={},s=[];let c,h,g;for(const i of e){switch(i.type){case a.db.LINETYPE.LOOP_START:case a.db.LINETYPE.ALT_START:case a.db.LINETYPE.OPT_START:case a.db.LINETYPE.PAR_START:case a.db.LINETYPE.PAR_OVER_START:case a.db.LINETYPE.CRITICAL_START:case a.db.LINETYPE.BREAK_START:s.push({id:i.id,msg:i.message,from:Number.MAX_SAFE_INTEGER,to:Number.MIN_SAFE_INTEGER,width:0});break;case a.db.LINETYPE.ALT_ELSE:case a.db.LINETYPE.PAR_AND:case a.db.LINETYPE.CRITICAL_OPTION:i.message&&(c=s.pop(),r[c.id]=c,r[i.id]=c,s.push(c));break;case a.db.LINETYPE.LOOP_END:case a.db.LINETYPE.ALT_END:case a.db.LINETYPE.OPT_END:case a.db.LINETYPE.PAR_END:case a.db.LINETYPE.CRITICAL_END:case a.db.LINETYPE.BREAK_END:c=s.pop(),r[c.id]=c;break;case a.db.LINETYPE.ACTIVE_START:{const d=t.get(i.from?i.from:i.to.actor),n=$t(i.from?i.from:i.to.actor).length,u=d.x+d.width/2+(n-1)*l.activationWidth/2,b={startx:u,stopx:u+l.activationWidth,actor:i.from,enabled:!0};m.activations.push(b)}break;case a.db.LINETYPE.ACTIVE_END:{const d=m.activations.map(n=>n.actor).lastIndexOf(i.from);m.activations.splice(d,1).splice(0,1)}break}i.placement!==void 0?(h=await ma(i,t,a),i.noteModel=h,s.forEach(d=>{c=d,c.from=L.getMin(c.from,h.startx),c.to=L.getMax(c.to,h.startx+h.width),c.width=L.getMax(c.width,Math.abs(c.from-c.to))-l.labelBoxWidth})):(g=Ta(i,t,a),i.msgModel=g,g.startx&&g.stopx&&s.length>0&&s.forEach(d=>{if(c=d,g.startx===g.stopx){const n=t.get(i.from),u=t.get(i.to);c.from=L.getMin(n.x-g.width/2,n.x-n.width/2,c.from),c.to=L.getMax(u.x+g.width/2,u.x+n.width/2,c.to),c.width=L.getMax(c.width,Math.abs(c.to-c.from))-l.labelBoxWidth}else c.from=L.getMin(g.startx,c.from),c.to=L.getMax(g.stopx,c.to),c.width=L.getMax(c.width,g.width)-l.labelBoxWidth}))}return m.activations=[],X.debug("Loop type widths:",r),r},"calculateLoopBounds"),Ea={bounds:m,drawActors:jt,drawActorsPopup:de,setConf:pe,draw:ya},La={parser:Ce,get db(){return new Fe},renderer:Ea,styles:qe,init:y(e=>{e.sequence||(e.sequence={}),e.wrap&&(e.sequence.wrap=e.wrap,Ie({sequence:{wrap:e.wrap}}))},"init")};export{La as diagram};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{U as A,B as G,M}from"./chunk-DI55MBZ5-DKt4WII7-DidpEj2B.js";import{Q as y,k as t,w as v,s as E,f as O,l as H,aw as U,aD as P,aA as R,O as I}from"./index-CS9omSqb.js";import{Q as C}from"./graph-BpcfrHXY-BH81qtTI.js";import{B as W}from"./layout-bsfAhWjc-xFXmwmRe.js";import"./chunk-55IACEB6-Cza7pcpr-CsIEdvZL.js";import"./chunk-QN33PNHL-v6AkzOl1-BYUBLlie.js";import"./_baseUniq-BPMphbq5-Ci3F4c-i.js";import"./min-C2aDz5ZK-B9D8sW79.js";var $=y(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"),F=y(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"),J=y((e,n)=>{const g=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(n.id),s=g.node().getBBox();return e.insert("rect",":first-child").attr("x",t().state.padding).attr("y",t().state.padding).attr("width",s.width+2*t().state.padding).attr("height",s.height+2*t().state.padding).attr("rx",t().state.radius),g},"drawSimpleState"),Q=y((e,n)=>{const g=y(function(o,u,b){const m=o.append("tspan").attr("x",2*t().state.padding).text(u);b||m.attr("dy",t().state.textHeight)},"addTspan"),s=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(n.descriptions[0]).node().getBBox(),r=s.height,c=e.append("text").attr("x",t().state.padding).attr("y",r+t().state.padding*.4+t().state.dividerMargin+t().state.textHeight).attr("class","state-description");let l=!0,a=!0;n.descriptions.forEach(function(o){l||(g(c,o,a),a=!1),l=!1});const d=e.append("line").attr("x1",t().state.padding).attr("y1",t().state.padding+r+t().state.dividerMargin/2).attr("y2",t().state.padding+r+t().state.dividerMargin/2).attr("class","descr-divider"),x=c.node().getBBox(),h=Math.max(x.width,s.width);return d.attr("x2",h+3*t().state.padding),e.insert("rect",":first-child").attr("x",t().state.padding).attr("y",t().state.padding).attr("width",h+2*t().state.padding).attr("height",x.height+r+2*t().state.padding).attr("rx",t().state.radius),e},"drawDescrState"),Y=y((e,n,g)=>{const s=t().state.padding,r=2*t().state.padding,c=e.node().getBBox(),l=c.width,a=c.x,d=e.append("text").attr("x",0).attr("y",t().state.titleShift).attr("font-size",t().state.fontSize).attr("class","state-title").text(n.id),x=d.node().getBBox().width+r;let h=Math.max(x,l);h===l&&(h=h+r);let o;const u=e.node().getBBox();n.doc,o=a-s,x>l&&(o=(l-h)/2+s),Math.abs(a-u.x)<s&&x>l&&(o=a-(x-l)/2);const b=1-t().state.textHeight;return e.insert("rect",":first-child").attr("x",o).attr("y",b).attr("class",g?"alt-composit":"composit").attr("width",h).attr("height",u.height+t().state.textHeight+t().state.titleShift+1).attr("rx","0"),d.attr("x",o+s),x<=l&&d.attr("x",a+(h-r)/2-x/2+s),e.insert("rect",":first-child").attr("x",o).attr("y",t().state.titleShift-t().state.textHeight-t().state.padding).attr("width",h).attr("height",t().state.textHeight*3).attr("rx",t().state.radius),e.insert("rect",":first-child").attr("x",o).attr("y",t().state.titleShift-t().state.textHeight-t().state.padding).attr("width",h).attr("height",u.height+3+2*t().state.textHeight).attr("rx",t().state.radius),e},"addTitleAndBox"),j=y(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").attr("class","end-state-inner").attr("r",t().state.sizeUnit).attr("cx",t().state.padding+t().state.sizeUnit+2).attr("cy",t().state.padding+t().state.sizeUnit+2)),"drawEndState"),X=y((e,n)=>{let g=t().state.forkWidth,s=t().state.forkHeight;if(n.parentId){let r=g;g=s,s=r}return e.append("rect").style("stroke","black").style("fill","black").attr("width",g).attr("height",s).attr("x",t().state.padding).attr("y",t().state.padding)},"drawForkJoinState"),q=y((e,n,g,s)=>{let r=0;const c=s.append("text");c.style("text-anchor","start"),c.attr("class","noteText");let l=e.replace(/\r\n/g,"<br/>");l=l.replace(/\n/g,"<br/>");const a=l.split(H.lineBreakRegex);let d=1.25*t().state.noteMargin;for(const x of a){const h=x.trim();if(h.length>0){const o=c.append("tspan");if(o.text(h),d===0){const u=o.node().getBBox();d+=u.height}r+=d,o.attr("x",n+t().state.noteMargin),o.attr("y",g+r+1.25*t().state.noteMargin)}}return{textWidth:c.node().getBBox().width,textHeight:r}},"_drawLongText"),Z=y((e,n)=>{n.attr("class","state-note");const g=n.append("rect").attr("x",0).attr("y",t().state.padding),s=n.append("g"),{textWidth:r,textHeight:c}=q(e,0,0,s);return g.attr("height",c+2*t().state.noteMargin),g.attr("width",r+t().state.noteMargin*2),g},"drawNote"),T=y(function(e,n){const g=n.id,s={id:g,label:n.id,width:0,height:0},r=e.append("g").attr("id",g).attr("class","stateGroup");n.type==="start"&&$(r),n.type==="end"&&j(r),(n.type==="fork"||n.type==="join")&&X(r,n),n.type==="note"&&Z(n.note.text,r),n.type==="divider"&&F(r),n.type==="default"&&n.descriptions.length===0&&J(r,n),n.type==="default"&&n.descriptions.length>0&&Q(r,n);const c=r.node().getBBox();return s.width=c.width+2*t().state.padding,s.height=c.height+2*t().state.padding,s},"drawState"),D=0,K=y(function(e,n,g){const s=y(function(d){switch(d){case M.relationType.AGGREGATION:return"aggregation";case M.relationType.EXTENSION:return"extension";case M.relationType.COMPOSITION:return"composition";case M.relationType.DEPENDENCY:return"dependency"}},"getRelationType");n.points=n.points.filter(d=>!Number.isNaN(d.y));const r=n.points,c=U().x(function(d){return d.x}).y(function(d){return d.y}).curve(P),l=e.append("path").attr("d",c(r)).attr("id","edge"+D).attr("class","transition");let a="";if(t().state.arrowMarkerAbsolute&&(a=R(!0)),l.attr("marker-end","url("+a+"#"+s(M.relationType.DEPENDENCY)+"End)"),g.title!==void 0){const d=e.append("g").attr("class","stateLabel"),{x,y:h}=I.calcLabelPosition(n.points),o=H.getRows(g.title);let u=0;const b=[];let m=0,S=0;for(let f=0;f<=o.length;f++){const p=d.append("text").attr("text-anchor","middle").text(o[f]).attr("x",x).attr("y",h+u),w=p.node().getBBox();m=Math.max(m,w.width),S=Math.min(S,w.x),E.info(w.x,x,h+u),u===0&&(u=p.node().getBBox().height,E.info("Title height",u,h)),b.push(p)}let N=u*o.length;if(o.length>1){const f=(o.length-1)*u*.5;b.forEach((p,w)=>p.attr("y",h+w*u-f)),N=u*o.length}const i=d.node().getBBox();d.insert("rect",":first-child").attr("class","box").attr("x",x-m/2-t().state.padding/2).attr("y",h-N/2-t().state.padding/2-3.5).attr("width",m+t().state.padding).attr("height",N+t().state.padding),E.info(i)}D++},"drawEdge"),B,z={},V=y(function(){},"setConf"),_=y(function(e){e.append("defs").append("marker").attr("id","dependencyEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 19,7 L9,13 L14,7 L9,1 Z")},"insertMarkers"),tt=y(function(e,n,g,s){B=t().state;const r=t().securityLevel;let c;r==="sandbox"&&(c=v("#i"+n));const l=r==="sandbox"?v(c.nodes()[0].contentDocument.body):v("body"),a=r==="sandbox"?c.nodes()[0].contentDocument:document;E.debug("Rendering diagram "+e);const d=l.select(`[id='${n}']`);_(d);const x=s.db.getRootDoc();L(x,d,void 0,!1,l,a,s);const h=B.padding,o=d.node().getBBox(),u=o.width+h*2,b=o.height+h*2,m=u*1.75;O(d,b,m,B.useMaxWidth),d.attr("viewBox",`${o.x-B.padding} ${o.y-B.padding} `+u+" "+b)},"draw"),et=y(e=>e?e.length*B.fontSizeFactor:1,"getLabelWidth"),L=y((e,n,g,s,r,c,l)=>{const a=new C({compound:!0,multigraph:!0});let d,x=!0;for(d=0;d<e.length;d++)if(e[d].stmt==="relation"){x=!1;break}g?a.setGraph({rankdir:"LR",multigraph:!0,compound:!0,ranker:"tight-tree",ranksep:x?1:B.edgeLengthFactor,nodeSep:x?1:50,isMultiGraph:!0}):a.setGraph({rankdir:"TB",multigraph:!0,compound:!0,ranksep:x?1:B.edgeLengthFactor,nodeSep:x?1:50,ranker:"tight-tree",isMultiGraph:!0}),a.setDefaultEdgeLabel(function(){return{}});const h=l.db.getStates(),o=l.db.getRelations(),u=Object.keys(h);for(const i of u){const f=h[i];g&&(f.parentId=g);let p;if(f.doc){let w=n.append("g").attr("id",f.id).attr("class","stateGroup");p=L(f.doc,w,f.id,!s,r,c,l);{w=Y(w,f,s);let k=w.node().getBBox();p.width=k.width,p.height=k.height+B.padding/2,z[f.id]={y:B.compositTitleSize}}}else p=T(n,f,a);if(f.note){const w={descriptions:[],id:f.id+"-note",note:f.note,type:"note"},k=T(n,w,a);f.note.position==="left of"?(a.setNode(p.id+"-note",k),a.setNode(p.id,p)):(a.setNode(p.id,p),a.setNode(p.id+"-note",k)),a.setParent(p.id,p.id+"-group"),a.setParent(p.id+"-note",p.id+"-group")}else a.setNode(p.id,p)}E.debug("Count=",a.nodeCount(),a);let b=0;o.forEach(function(i){b++,E.debug("Setting edge",i),a.setEdge(i.id1,i.id2,{relation:i,width:et(i.title),height:B.labelHeight*H.getRows(i.title).length,labelpos:"c"},"id"+b)}),W(a),E.debug("Graph after layout",a.nodes());const m=n.node();a.nodes().forEach(function(i){i!==void 0&&a.node(i)!==void 0?(E.warn("Node "+i+": "+JSON.stringify(a.node(i))),r.select("#"+m.id+" #"+i).attr("transform","translate("+(a.node(i).x-a.node(i).width/2)+","+(a.node(i).y+(z[i]?z[i].y:0)-a.node(i).height/2)+" )"),r.select("#"+m.id+" #"+i).attr("data-x-shift",a.node(i).x-a.node(i).width/2),c.querySelectorAll("#"+m.id+" #"+i+" .divider").forEach(f=>{const p=f.parentElement;let w=0,k=0;p&&(p.parentElement&&(w=p.parentElement.getBBox().width),k=parseInt(p.getAttribute("data-x-shift"),10),Number.isNaN(k)&&(k=0)),f.setAttribute("x1",0-k+8),f.setAttribute("x2",w-k-8)})):E.debug("No Node "+i+": "+JSON.stringify(a.node(i)))});let S=m.getBBox();a.edges().forEach(function(i){i!==void 0&&a.edge(i)!==void 0&&(E.debug("Edge "+i.v+" -> "+i.w+": "+JSON.stringify(a.edge(i))),K(n,a.edge(i),a.edge(i).relation))}),S=m.getBBox();const N={id:g||"root",label:g||"root",width:0,height:0};return N.width=S.width+2*B.padding,N.height=S.height+2*B.padding,E.debug("Doc rendered",N,a),N},"renderDoc"),at={setConf:V,draw:tt},ht={parser:G,get db(){return new M(1)},renderer:at,styles:A,init:y(e=>{e.state||(e.state={}),e.state.arrowMarkerAbsolute=e.arrowMarkerAbsolute},"init")};export{ht as diagram};
|