blob: 120979c3a798c409ea8989e1562b5d63bfe1f27e [file] [log] [blame]
import{g as me,x as ve,v as we,c as lt,s as te,b as _e,a as ke,m as Pe,z as Le,l as K,d as Lt,j as w,e as Ie,h as Pt,i as Ne,y as C,n as ee,a0 as ie,af as Ae,ag as Se}from"./mermaid.core-41dc3077.js";import{d as Me,a as Re,g as It,b as De,c as Ve,e as zt}from"./svgDrawCommon-f26cad39-c39ec0cd.js";import"./app-5cdcb249.js";import{s as Ce}from"./selectAll-25c6d219.js";var Bt=function(){var t=function(ot,b,_,P){for(_=_||{},P=ot.length;P--;_[ot[P]]=b);return _},e=[1,2],r=[1,3],i=[1,5],s=[1,7],n=[2,5],c=[1,15],l=[1,17],p=[1,19],d=[1,21],T=[1,22],y=[1,23],u=[1,29],x=[1,30],m=[1,31],L=[1,32],A=[1,33],M=[1,34],I=[1,35],Y=[1,36],V=[1,37],H=[1,38],G=[1,39],W=[1,40],O=[1,41],X=[1,43],F=[1,44],q=[1,46],U=[1,47],J=[1,48],Z=[1,49],v=[1,50],E=[1,51],j=[1,54],k=[1,4,5,19,21,23,26,28,34,35,36,38,40,41,42,43,44,46,48,49,51,52,53,54,55,57,58,63,64,65,66,74,84],N=[4,5,21,55,57],vt=[4,5,19,21,23,26,28,34,35,36,38,40,41,42,43,44,46,48,49,51,55,57,58,63,64,65,66,74,84],Gt=[4,5,19,21,23,26,28,34,35,36,38,40,41,42,43,44,46,48,49,51,54,55,57,58,63,64,65,66,74,84],St=[4,5,19,21,23,26,28,34,35,36,38,40,41,42,43,44,46,48,49,51,53,55,57,58,63,64,65,66,74,84],Xt=[4,5,19,21,23,26,28,34,35,36,38,40,41,42,43,44,46,48,49,51,52,55,57,58,63,64,65,66,74,84],rt=[72,73,74],it=[1,128],Jt=[1,4,5,7,19,21,23,26,28,34,35,36,38,40,41,42,43,44,46,48,49,51,52,53,54,55,57,58,63,64,65,66,74,84],Mt={trace:function(){},yy:{},symbols_:{error:2,start:3,SPACE:4,NEWLINE:5,directive:6,SD:7,document:8,line:9,statement:10,box_section:11,box_line:12,participant_statement:13,openDirective:14,typeDirective:15,closeDirective:16,":":17,argDirective:18,box:19,restOfLine:20,end:21,signal:22,autonumber:23,NUM:24,off:25,activate:26,actor:27,deactivate:28,note_statement:29,links_statement:30,link_statement:31,properties_statement:32,details_statement:33,title:34,legacy_title:35,acc_title:36,acc_title_value:37,acc_descr:38,acc_descr_value:39,acc_descr_multiline_value:40,loop:41,rect:42,opt:43,alt:44,else_sections:45,par:46,par_sections:47,par_over:48,critical:49,option_sections:50,break:51,option:52,and:53,else:54,participant:55,AS:56,participant_actor:57,note:58,placement:59,text2:60,over:61,actor_pair:62,links:63,link:64,properties:65,details:66,spaceList:67,",":68,left_of:69,right_of:70,signaltype:71,"+":72,"-":73,ACTOR:74,SOLID_OPEN_ARROW:75,DOTTED_OPEN_ARROW:76,SOLID_ARROW:77,DOTTED_ARROW:78,SOLID_CROSS:79,DOTTED_CROSS:80,SOLID_POINT:81,DOTTED_POINT:82,TXT:83,open_directive:84,type_directive:85,arg_directive:86,close_directive:87,$accept:0,$end:1},terminals_:{2:"error",4:"SPACE",5:"NEWLINE",7:"SD",17:":",19:"box",20:"restOfLine",21:"end",23:"autonumber",24:"NUM",25:"off",26:"activate",28:"deactivate",34:"title",35:"legacy_title",36:"acc_title",37:"acc_title_value",38:"acc_descr",39:"acc_descr_value",40:"acc_descr_multiline_value",41:"loop",42:"rect",43:"opt",44:"alt",46:"par",48:"par_over",49:"critical",51:"break",52:"option",53:"and",54:"else",55:"participant",56:"AS",57:"participant_actor",58:"note",61:"over",63:"links",64:"link",65:"properties",66:"details",68:",",69:"left_of",70:"right_of",72:"+",73:"-",74:"ACTOR",75:"SOLID_OPEN_ARROW",76:"DOTTED_OPEN_ARROW",77:"SOLID_ARROW",78:"DOTTED_ARROW",79:"SOLID_CROSS",80:"DOTTED_CROSS",81:"SOLID_POINT",82:"DOTTED_POINT",83:"TXT",84:"open_directive",85:"type_directive",86:"arg_directive",87:"close_directive"},productions_:[0,[3,2],[3,2],[3,2],[3,2],[8,0],[8,2],[9,2],[9,1],[9,1],[11,0],[11,2],[12,2],[12,1],[12,1],[6,4],[6,6],[10,1],[10,4],[10,2],[10,4],[10,3],[10,3],[10,2],[10,3],[10,3],[10,2],[10,2],[10,2],[10,2],[10,2],[10,1],[10,1],[10,2],[10,2],[10,1],[10,4],[10,4],[10,4],[10,4],[10,4],[10,4],[10,4],[10,4],[10,1],[50,1],[50,4],[47,1],[47,4],[45,1],[45,4],[13,5],[13,3],[13,5],[13,3],[29,4],[29,4],[30,3],[31,3],[32,3],[33,3],[67,2],[67,1],[62,3],[62,1],[59,1],[59,1],[22,5],[22,5],[22,4],[27,1],[71,1],[71,1],[71,1],[71,1],[71,1],[71,1],[71,1],[71,1],[60,1],[14,1],[15,1],[18,1],[16,1]],performAction:function(b,_,P,g,S,o,yt){var h=o.length-1;switch(S){case 4:return g.apply(o[h]),o[h];case 5:case 10:this.$=[];break;case 6:case 11:o[h-1].push(o[h]),this.$=o[h-1];break;case 7:case 8:case 12:case 13:this.$=o[h];break;case 9:case 14:this.$=[];break;case 18:o[h-1].unshift({type:"boxStart",boxData:g.parseBoxData(o[h-2])}),o[h-1].push({type:"boxEnd",boxText:o[h-2]}),this.$=o[h-1];break;case 20:this.$={type:"sequenceIndex",sequenceIndex:Number(o[h-2]),sequenceIndexStep:Number(o[h-1]),sequenceVisible:!0,signalType:g.LINETYPE.AUTONUMBER};break;case 21:this.$={type:"sequenceIndex",sequenceIndex:Number(o[h-1]),sequenceIndexStep:1,sequenceVisible:!0,signalType:g.LINETYPE.AUTONUMBER};break;case 22:this.$={type:"sequenceIndex",sequenceVisible:!1,signalType:g.LINETYPE.AUTONUMBER};break;case 23:this.$={type:"sequenceIndex",sequenceVisible:!0,signalType:g.LINETYPE.AUTONUMBER};break;case 24:this.$={type:"activeStart",signalType:g.LINETYPE.ACTIVE_START,actor:o[h-1]};break;case 25:this.$={type:"activeEnd",signalType:g.LINETYPE.ACTIVE_END,actor:o[h-1]};break;case 31:g.setDiagramTitle(o[h].substring(6)),this.$=o[h].substring(6);break;case 32:g.setDiagramTitle(o[h].substring(7)),this.$=o[h].substring(7);break;case 33:this.$=o[h].trim(),g.setAccTitle(this.$);break;case 34:case 35:this.$=o[h].trim(),g.setAccDescription(this.$);break;case 36:o[h-1].unshift({type:"loopStart",loopText:g.parseMessage(o[h-2]),signalType:g.LINETYPE.LOOP_START}),o[h-1].push({type:"loopEnd",loopText:o[h-2],signalType:g.LINETYPE.LOOP_END}),this.$=o[h-1];break;case 37:o[h-1].unshift({type:"rectStart",color:g.parseMessage(o[h-2]),signalType:g.LINETYPE.RECT_START}),o[h-1].push({type:"rectEnd",color:g.parseMessage(o[h-2]),signalType:g.LINETYPE.RECT_END}),this.$=o[h-1];break;case 38:o[h-1].unshift({type:"optStart",optText:g.parseMessage(o[h-2]),signalType:g.LINETYPE.OPT_START}),o[h-1].push({type:"optEnd",optText:g.parseMessage(o[h-2]),signalType:g.LINETYPE.OPT_END}),this.$=o[h-1];break;case 39:o[h-1].unshift({type:"altStart",altText:g.parseMessage(o[h-2]),signalType:g.LINETYPE.ALT_START}),o[h-1].push({type:"altEnd",signalType:g.LINETYPE.ALT_END}),this.$=o[h-1];break;case 40:o[h-1].unshift({type:"parStart",parText:g.parseMessage(o[h-2]),signalType:g.LINETYPE.PAR_START}),o[h-1].push({type:"parEnd",signalType:g.LINETYPE.PAR_END}),this.$=o[h-1];break;case 41:o[h-1].unshift({type:"parStart",parText:g.parseMessage(o[h-2]),signalType:g.LINETYPE.PAR_OVER_START}),o[h-1].push({type:"parEnd",signalType:g.LINETYPE.PAR_END}),this.$=o[h-1];break;case 42:o[h-1].unshift({type:"criticalStart",criticalText:g.parseMessage(o[h-2]),signalType:g.LINETYPE.CRITICAL_START}),o[h-1].push({type:"criticalEnd",signalType:g.LINETYPE.CRITICAL_END}),this.$=o[h-1];break;case 43:o[h-1].unshift({type:"breakStart",breakText:g.parseMessage(o[h-2]),signalType:g.LINETYPE.BREAK_START}),o[h-1].push({type:"breakEnd",optText:g.parseMessage(o[h-2]),signalType:g.LINETYPE.BREAK_END}),this.$=o[h-1];break;case 46:this.$=o[h-3].concat([{type:"option",optionText:g.parseMessage(o[h-1]),signalType:g.LINETYPE.CRITICAL_OPTION},o[h]]);break;case 48:this.$=o[h-3].concat([{type:"and",parText:g.parseMessage(o[h-1]),signalType:g.LINETYPE.PAR_AND},o[h]]);break;case 50:this.$=o[h-3].concat([{type:"else",altText:g.parseMessage(o[h-1]),signalType:g.LINETYPE.ALT_ELSE},o[h]]);break;case 51:o[h-3].type="addParticipant",o[h-3].description=g.parseMessage(o[h-1]),this.$=o[h-3];break;case 52:o[h-1].type="addParticipant",this.$=o[h-1];break;case 53:o[h-3].type="addActor",o[h-3].description=g.parseMessage(o[h-1]),this.$=o[h-3];break;case 54:o[h-1].type="addActor",this.$=o[h-1];break;case 55:this.$=[o[h-1],{type:"addNote",placement:o[h-2],actor:o[h-1].actor,text:o[h]}];break;case 56:o[h-2]=[].concat(o[h-1],o[h-1]).slice(0,2),o[h-2][0]=o[h-2][0].actor,o[h-2][1]=o[h-2][1].actor,this.$=[o[h-1],{type:"addNote",placement:g.PLACEMENT.OVER,actor:o[h-2].slice(0,2),text:o[h]}];break;case 57:this.$=[o[h-1],{type:"addLinks",actor:o[h-1].actor,text:o[h]}];break;case 58:this.$=[o[h-1],{type:"addALink",actor:o[h-1].actor,text:o[h]}];break;case 59:this.$=[o[h-1],{type:"addProperties",actor:o[h-1].actor,text:o[h]}];break;case 60:this.$=[o[h-1],{type:"addDetails",actor:o[h-1].actor,text:o[h]}];break;case 63:this.$=[o[h-2],o[h]];break;case 64:this.$=o[h];break;case 65:this.$=g.PLACEMENT.LEFTOF;break;case 66:this.$=g.PLACEMENT.RIGHTOF;break;case 67:this.$=[o[h-4],o[h-1],{type:"addMessage",from:o[h-4].actor,to:o[h-1].actor,signalType:o[h-3],msg:o[h]},{type:"activeStart",signalType:g.LINETYPE.ACTIVE_START,actor:o[h-1]}];break;case 68:this.$=[o[h-4],o[h-1],{type:"addMessage",from:o[h-4].actor,to:o[h-1].actor,signalType:o[h-3],msg:o[h]},{type:"activeEnd",signalType:g.LINETYPE.ACTIVE_END,actor:o[h-4]}];break;case 69:this.$=[o[h-3],o[h-1],{type:"addMessage",from:o[h-3].actor,to:o[h-1].actor,signalType:o[h-2],msg:o[h]}];break;case 70:this.$={type:"addParticipant",actor:o[h]};break;case 71:this.$=g.LINETYPE.SOLID_OPEN;break;case 72:this.$=g.LINETYPE.DOTTED_OPEN;break;case 73:this.$=g.LINETYPE.SOLID;break;case 74:this.$=g.LINETYPE.DOTTED;break;case 75:this.$=g.LINETYPE.SOLID_CROSS;break;case 76:this.$=g.LINETYPE.DOTTED_CROSS;break;case 77:this.$=g.LINETYPE.SOLID_POINT;break;case 78:this.$=g.LINETYPE.DOTTED_POINT;break;case 79:this.$=g.parseMessage(o[h].trim().substring(1));break;case 80:g.parseDirective("%%{","open_directive");break;case 81:g.parseDirective(o[h],"type_directive");break;case 82:o[h]=o[h].trim().replace(/'/g,'"'),g.parseDirective(o[h],"arg_directive");break;case 83:g.parseDirective("}%%","close_directive","sequence");break}},table:[{3:1,4:e,5:r,6:4,7:i,14:6,84:s},{1:[3]},{3:8,4:e,5:r,6:4,7:i,14:6,84:s},{3:9,4:e,5:r,6:4,7:i,14:6,84:s},{3:10,4:e,5:r,6:4,7:i,14:6,84:s},t([1,4,5,19,23,26,28,34,35,36,38,40,41,42,43,44,46,48,49,51,55,57,58,63,64,65,66,74,84],n,{8:11}),{15:12,85:[1,13]},{85:[2,80]},{1:[2,1]},{1:[2,2]},{1:[2,3]},{1:[2,4],4:c,5:l,6:42,9:14,10:16,13:18,14:6,19:p,22:20,23:d,26:T,27:45,28:y,29:24,30:25,31:26,32:27,33:28,34:u,35:x,36:m,38:L,40:A,41:M,42:I,43:Y,44:V,46:H,48:G,49:W,51:O,55:X,57:F,58:q,63:U,64:J,65:Z,66:v,74:E,84:s},{16:52,17:[1,53],87:j},t([17,87],[2,81]),t(k,[2,6]),{6:42,10:55,13:18,14:6,19:p,22:20,23:d,26:T,27:45,28:y,29:24,30:25,31:26,32:27,33:28,34:u,35:x,36:m,38:L,40:A,41:M,42:I,43:Y,44:V,46:H,48:G,49:W,51:O,55:X,57:F,58:q,63:U,64:J,65:Z,66:v,74:E,84:s},t(k,[2,8]),t(k,[2,9]),t(k,[2,17]),{20:[1,56]},{5:[1,57]},{5:[1,60],24:[1,58],25:[1,59]},{27:61,74:E},{27:62,74:E},{5:[1,63]},{5:[1,64]},{5:[1,65]},{5:[1,66]},{5:[1,67]},t(k,[2,31]),t(k,[2,32]),{37:[1,68]},{39:[1,69]},t(k,[2,35]),{20:[1,70]},{20:[1,71]},{20:[1,72]},{20:[1,73]},{20:[1,74]},{20:[1,75]},{20:[1,76]},{20:[1,77]},t(k,[2,44]),{27:78,74:E},{27:79,74:E},{71:80,75:[1,81],76:[1,82],77:[1,83],78:[1,84],79:[1,85],80:[1,86],81:[1,87],82:[1,88]},{59:89,61:[1,90],69:[1,91],70:[1,92]},{27:93,74:E},{27:94,74:E},{27:95,74:E},{27:96,74:E},t([5,56,68,75,76,77,78,79,80,81,82,83],[2,70]),{5:[1,97]},{18:98,86:[1,99]},{5:[2,83]},t(k,[2,7]),t(N,[2,10],{11:100}),t(k,[2,19]),{5:[1,102],24:[1,101]},{5:[1,103]},t(k,[2,23]),{5:[1,104]},{5:[1,105]},t(k,[2,26]),t(k,[2,27]),t(k,[2,28]),t(k,[2,29]),t(k,[2,30]),t(k,[2,33]),t(k,[2,34]),t(vt,n,{8:106}),t(vt,n,{8:107}),t(vt,n,{8:108}),t(Gt,n,{45:109,8:110}),t(St,n,{47:111,8:112}),t(St,n,{8:112,47:113}),t(Xt,n,{50:114,8:115}),t(vt,n,{8:116}),{5:[1,118],56:[1,117]},{5:[1,120],56:[1,119]},{27:123,72:[1,121],73:[1,122],74:E},t(rt,[2,71]),t(rt,[2,72]),t(rt,[2,73]),t(rt,[2,74]),t(rt,[2,75]),t(rt,[2,76]),t(rt,[2,77]),t(rt,[2,78]),{27:124,74:E},{27:126,62:125,74:E},{74:[2,65]},{74:[2,66]},{60:127,83:it},{60:129,83:it},{60:130,83:it},{60:131,83:it},t(Jt,[2,15]),{16:132,87:j},{87:[2,82]},{4:[1,135],5:[1,137],12:134,13:136,21:[1,133],55:X,57:F},{5:[1,138]},t(k,[2,21]),t(k,[2,22]),t(k,[2,24]),t(k,[2,25]),{4:c,5:l,6:42,9:14,10:16,13:18,14:6,19:p,21:[1,139],22:20,23:d,26:T,27:45,28:y,29:24,30:25,31:26,32:27,33:28,34:u,35:x,36:m,38:L,40:A,41:M,42:I,43:Y,44:V,46:H,48:G,49:W,51:O,55:X,57:F,58:q,63:U,64:J,65:Z,66:v,74:E,84:s},{4:c,5:l,6:42,9:14,10:16,13:18,14:6,19:p,21:[1,140],22:20,23:d,26:T,27:45,28:y,29:24,30:25,31:26,32:27,33:28,34:u,35:x,36:m,38:L,40:A,41:M,42:I,43:Y,44:V,46:H,48:G,49:W,51:O,55:X,57:F,58:q,63:U,64:J,65:Z,66:v,74:E,84:s},{4:c,5:l,6:42,9:14,10:16,13:18,14:6,19:p,21:[1,141],22:20,23:d,26:T,27:45,28:y,29:24,30:25,31:26,32:27,33:28,34:u,35:x,36:m,38:L,40:A,41:M,42:I,43:Y,44:V,46:H,48:G,49:W,51:O,55:X,57:F,58:q,63:U,64:J,65:Z,66:v,74:E,84:s},{21:[1,142]},{4:c,5:l,6:42,9:14,10:16,13:18,14:6,19:p,21:[2,49],22:20,23:d,26:T,27:45,28:y,29:24,30:25,31:26,32:27,33:28,34:u,35:x,36:m,38:L,40:A,41:M,42:I,43:Y,44:V,46:H,48:G,49:W,51:O,54:[1,143],55:X,57:F,58:q,63:U,64:J,65:Z,66:v,74:E,84:s},{21:[1,144]},{4:c,5:l,6:42,9:14,10:16,13:18,14:6,19:p,21:[2,47],22:20,23:d,26:T,27:45,28:y,29:24,30:25,31:26,32:27,33:28,34:u,35:x,36:m,38:L,40:A,41:M,42:I,43:Y,44:V,46:H,48:G,49:W,51:O,53:[1,145],55:X,57:F,58:q,63:U,64:J,65:Z,66:v,74:E,84:s},{21:[1,146]},{21:[1,147]},{4:c,5:l,6:42,9:14,10:16,13:18,14:6,19:p,21:[2,45],22:20,23:d,26:T,27:45,28:y,29:24,30:25,31:26,32:27,33:28,34:u,35:x,36:m,38:L,40:A,41:M,42:I,43:Y,44:V,46:H,48:G,49:W,51:O,52:[1,148],55:X,57:F,58:q,63:U,64:J,65:Z,66:v,74:E,84:s},{4:c,5:l,6:42,9:14,10:16,13:18,14:6,19:p,21:[1,149],22:20,23:d,26:T,27:45,28:y,29:24,30:25,31:26,32:27,33:28,34:u,35:x,36:m,38:L,40:A,41:M,42:I,43:Y,44:V,46:H,48:G,49:W,51:O,55:X,57:F,58:q,63:U,64:J,65:Z,66:v,74:E,84:s},{20:[1,150]},t(k,[2,52]),{20:[1,151]},t(k,[2,54]),{27:152,74:E},{27:153,74:E},{60:154,83:it},{60:155,83:it},{60:156,83:it},{68:[1,157],83:[2,64]},{5:[2,57]},{5:[2,79]},{5:[2,58]},{5:[2,59]},{5:[2,60]},{5:[1,158]},t(k,[2,18]),t(N,[2,11]),{13:159,55:X,57:F},t(N,[2,13]),t(N,[2,14]),t(k,[2,20]),t(k,[2,36]),t(k,[2,37]),t(k,[2,38]),t(k,[2,39]),{20:[1,160]},t(k,[2,40]),{20:[1,161]},t(k,[2,41]),t(k,[2,42]),{20:[1,162]},t(k,[2,43]),{5:[1,163]},{5:[1,164]},{60:165,83:it},{60:166,83:it},{5:[2,69]},{5:[2,55]},{5:[2,56]},{27:167,74:E},t(Jt,[2,16]),t(N,[2,12]),t(Gt,n,{8:110,45:168}),t(St,n,{8:112,47:169}),t(Xt,n,{8:115,50:170}),t(k,[2,51]),t(k,[2,53]),{5:[2,67]},{5:[2,68]},{83:[2,63]},{21:[2,50]},{21:[2,48]},{21:[2,46]}],defaultActions:{7:[2,80],8:[2,1],9:[2,2],10:[2,3],54:[2,83],91:[2,65],92:[2,66],99:[2,82],127:[2,57],128:[2,79],129:[2,58],130:[2,59],131:[2,60],154:[2,69],155:[2,55],156:[2,56],165:[2,67],166:[2,68],167:[2,63],168:[2,50],169:[2,48],170:[2,46]},parseError:function(b,_){if(_.recoverable)this.trace(b);else{var P=new Error(b);throw P.hash=_,P}},parse:function(b){var _=this,P=[0],g=[],S=[null],o=[],yt=this.table,h="",wt=0,Zt=0,Te=2,Qt=1,ye=o.slice.call(arguments,1),B=Object.create(this.lexer),ht={yy:{}};for(var Dt in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Dt)&&(ht.yy[Dt]=this.yy[Dt]);B.setInput(b,ht.yy),ht.yy.lexer=B,ht.yy.parser=this,typeof B.yylloc>"u"&&(B.yylloc={});var Vt=B.yylloc;o.push(Vt);var Ee=B.options&&B.options.ranges;typeof ht.yy.parseError=="function"?this.parseError=ht.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function be(){var nt;return nt=g.pop()||B.lex()||Qt,typeof nt!="number"&&(nt instanceof Array&&(g=nt,nt=g.pop()),nt=_.symbols_[nt]||nt),nt}for(var z,dt,Q,Ct,ft={},_t,st,jt,kt;;){if(dt=P[P.length-1],this.defaultActions[dt]?Q=this.defaultActions[dt]:((z===null||typeof z>"u")&&(z=be()),Q=yt[dt]&&yt[dt][z]),typeof Q>"u"||!Q.length||!Q[0]){var Ot="";kt=[];for(_t in yt[dt])this.terminals_[_t]&&_t>Te&&kt.push("'"+this.terminals_[_t]+"'");B.showPosition?Ot="Parse error on line "+(wt+1)+`:
`+B.showPosition()+`
Expecting `+kt.join(", ")+", got '"+(this.terminals_[z]||z)+"'":Ot="Parse error on line "+(wt+1)+": Unexpected "+(z==Qt?"end of input":"'"+(this.terminals_[z]||z)+"'"),this.parseError(Ot,{text:B.match,token:this.terminals_[z]||z,line:B.yylineno,loc:Vt,expected:kt})}if(Q[0]instanceof Array&&Q.length>1)throw new Error("Parse Error: multiple actions possible at state: "+dt+", token: "+z);switch(Q[0]){case 1:P.push(z),S.push(B.yytext),o.push(B.yylloc),P.push(Q[1]),z=null,Zt=B.yyleng,h=B.yytext,wt=B.yylineno,Vt=B.yylloc;break;case 2:if(st=this.productions_[Q[1]][1],ft.$=S[S.length-st],ft._$={first_line:o[o.length-(st||1)].first_line,last_line:o[o.length-1].last_line,first_column:o[o.length-(st||1)].first_column,last_column:o[o.length-1].last_column},Ee&&(ft._$.range=[o[o.length-(st||1)].range[0],o[o.length-1].range[1]]),Ct=this.performAction.apply(ft,[h,Zt,wt,ht.yy,Q[1],S,o].concat(ye)),typeof Ct<"u")return Ct;st&&(P=P.slice(0,-1*st*2),S=S.slice(0,-1*st),o=o.slice(0,-1*st)),P.push(this.productions_[Q[1]][0]),S.push(ft.$),o.push(ft._$),jt=yt[P[P.length-2]][P[P.length-1]],P.push(jt);break;case 3:return!0}}return!0}},xe=function(){var ot={EOF:1,parseError:function(_,P){if(this.yy.parser)this.yy.parser.parseError(_,P);else throw new Error(_)},setInput:function(b,_){return this.yy=_||this.yy||{},this._input=b,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},input:function(){var b=this._input[0];this.yytext+=b,this.yyleng++,this.offset++,this.match+=b,this.matched+=b;var _=b.match(/(?:\r\n?|\n).*/g);return _?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),b},unput:function(b){var _=b.length,P=b.split(/(?:\r\n?|\n)/g);this._input=b+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-_),this.offset-=_;var g=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),P.length-1&&(this.yylineno-=P.length-1);var S=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:P?(P.length===g.length?this.yylloc.first_column:0)+g[g.length-P.length].length-P[0].length:this.yylloc.first_column-_},this.options.ranges&&(this.yylloc.range=[S[0],S[0]+this.yyleng-_]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject: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).
`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},less:function(b){this.unput(this.match.slice(b))},pastInput:function(){var b=this.matched.substr(0,this.matched.length-this.match.length);return(b.length>20?"...":"")+b.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var b=this.match;return b.length<20&&(b+=this._input.substr(0,20-b.length)),(b.substr(0,20)+(b.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var b=this.pastInput(),_=new Array(b.length+1).join("-");return b+this.upcomingInput()+`
`+_+"^"},test_match:function(b,_){var P,g,S;if(this.options.backtrack_lexer&&(S={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&&(S.yylloc.range=this.yylloc.range.slice(0))),g=b[0].match(/(?:\r\n?|\n).*/g),g&&(this.yylineno+=g.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:g?g[g.length-1].length-g[g.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+b[0].length},this.yytext+=b[0],this.match+=b[0],this.matches=b,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(b[0].length),this.matched+=b[0],P=this.performAction.call(this,this.yy,this,_,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),P)return P;if(this._backtrack){for(var o in S)this[o]=S[o];return!1}return!1},next:function(){if(this.done)return this.EOF;this._input||(this.done=!0);var b,_,P,g;this._more||(this.yytext="",this.match="");for(var S=this._currentRules(),o=0;o<S.length;o++)if(P=this._input.match(this.rules[S[o]]),P&&(!_||P[0].length>_[0].length)){if(_=P,g=o,this.options.backtrack_lexer){if(b=this.test_match(P,S[o]),b!==!1)return b;if(this._backtrack){_=!1;continue}else return!1}else if(!this.options.flex)break}return _?(b=this.test_match(_,S[g]),b!==!1?b:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text.
`+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var _=this.next();return _||this.lex()},begin:function(_){this.conditionStack.push(_)},popState:function(){var _=this.conditionStack.length-1;return _>0?this.conditionStack.pop():this.conditionStack[0]},_currentRules:function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},topState:function(_){return _=this.conditionStack.length-1-Math.abs(_||0),_>=0?this.conditionStack[_]:"INITIAL"},pushState:function(_){this.begin(_)},stateStackSize:function(){return this.conditionStack.length},options:{"case-insensitive":!0},performAction:function(_,P,g,S){switch(g){case 0:return this.begin("open_directive"),84;case 1:return this.begin("type_directive"),85;case 2:return this.popState(),this.begin("arg_directive"),17;case 3:return this.popState(),this.popState(),87;case 4:return 86;case 5:return 5;case 6:break;case 7:break;case 8:break;case 9:break;case 10:break;case 11:return 24;case 12:return this.begin("LINE"),19;case 13:return this.begin("ID"),55;case 14:return this.begin("ID"),57;case 15:return P.yytext=P.yytext.trim(),this.begin("ALIAS"),74;case 16:return this.popState(),this.popState(),this.begin("LINE"),56;case 17:return this.popState(),this.popState(),5;case 18:return this.begin("LINE"),41;case 19:return this.begin("LINE"),42;case 20:return this.begin("LINE"),43;case 21:return this.begin("LINE"),44;case 22:return this.begin("LINE"),54;case 23:return this.begin("LINE"),46;case 24:return this.begin("LINE"),48;case 25:return this.begin("LINE"),53;case 26:return this.begin("LINE"),49;case 27:return this.begin("LINE"),52;case 28:return this.begin("LINE"),51;case 29:return this.popState(),20;case 30:return 21;case 31:return 69;case 32:return 70;case 33:return 63;case 34:return 64;case 35:return 65;case 36:return 66;case 37:return 61;case 38:return 58;case 39:return this.begin("ID"),26;case 40:return this.begin("ID"),28;case 41:return 34;case 42:return 35;case 43:return this.begin("acc_title"),36;case 44:return this.popState(),"acc_title_value";case 45:return this.begin("acc_descr"),38;case 46:return this.popState(),"acc_descr_value";case 47:this.begin("acc_descr_multiline");break;case 48:this.popState();break;case 49:return"acc_descr_multiline_value";case 50:return 7;case 51:return 23;case 52:return 25;case 53:return 68;case 54:return 5;case 55:return P.yytext=P.yytext.trim(),74;case 56:return 77;case 57:return 78;case 58:return 75;case 59:return 76;case 60:return 79;case 61:return 80;case 62:return 81;case 63:return 82;case 64:return 83;case 65:return 72;case 66:return 73;case 67:return 5;case 68:return"INVALID"}},rules:[/^(?:%%\{)/i,/^(?:((?:(?!\}%%)[^:.])*))/i,/^(?::)/i,/^(?:\}%%)/i,/^(?:((?:(?!\}%%).|\n)*))/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:((?!\n)\s)+)/i,/^(?:#[^\n]*)/i,/^(?:%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[0-9]+(?=[ \n]+))/i,/^(?:box\b)/i,/^(?:participant\b)/i,/^(?:actor\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,/^(?:-[x])/i,/^(?:--[x])/i,/^(?:-[\)])/i,/^(?:--[\)])/i,/^(?::(?:(?:no)?wrap)?[^#\n;]+)/i,/^(?:\+)/i,/^(?:-)/i,/^(?:$)/i,/^(?:.)/i],conditions:{acc_descr_multiline:{rules:[48,49],inclusive:!1},acc_descr:{rules:[46],inclusive:!1},acc_title:{rules:[44],inclusive:!1},open_directive:{rules:[1,8],inclusive:!1},type_directive:{rules:[2,3,8],inclusive:!1},arg_directive:{rules:[3,4,8],inclusive:!1},ID:{rules:[7,8,15],inclusive:!1},ALIAS:{rules:[7,8,16,17],inclusive:!1},LINE:{rules:[7,8,29],inclusive:!1},INITIAL:{rules:[0,5,6,8,9,10,11,12,13,14,18,19,20,21,22,23,24,25,26,27,28,30,31,32,33,34,35,36,37,38,39,40,41,42,43,45,47,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68],inclusive:!0}}};return ot}();Mt.lexer=xe;function Rt(){this.yy={}}return Rt.prototype=Mt,Mt.Parser=Rt,new Rt}();Bt.parser=Bt;const Oe=Bt;let Et,ct={},xt=[],$=[],Nt=!1,Yt,at;const Be=function(t,e,r){Pe.parseDirective(this,t,e,r)},Ye=function(t){xt.push({name:t.text,wrap:t.wrap===void 0&&pt()||!!t.wrap,fill:t.color,actorKeys:[]}),at=xt.slice(-1)[0]},Ft=function(t,e,r,i){let s=at;const n=ct[t];if(n){if(at&&n.box&&at!==n.box)throw new Error("A same participant should only be defined in one Box: "+n.name+" can't be in '"+n.box.name+"' and in '"+at.name+"' at the same time.");if(s=n.box?n.box:at,n.box=s,n&&e===n.name&&r==null)return}(r==null||r.text==null)&&(r={text:e,wrap:null,type:i}),(i==null||r.text==null)&&(r={text:e,wrap:null,type:i}),ct[t]={box:s,name:e,description:r.text,wrap:r.wrap===void 0&&pt()||!!r.wrap,prevActor:Et,links:{},properties:{},actorCnt:null,rectData:null,type:i||"participant"},Et&&ct[Et]&&(ct[Et].nextActor=t),at&&at.actorKeys.push(t),Et=t},Fe=t=>{let e,r=0;for(e=0;e<$.length;e++)$[e].type===bt.ACTIVE_START&&$[e].from.actor===t&&r++,$[e].type===bt.ACTIVE_END&&$[e].from.actor===t&&r--;return r},We=function(t,e,r,i){$.push({from:t,to:e,message:r.text,wrap:r.wrap===void 0&&pt()||!!r.wrap,answer:i})},R=function(t,e,r={text:void 0,wrap:void 0},i){if(i===bt.ACTIVE_END&&Fe(t.actor)<1){let n=new Error("Trying to inactivate an inactive participant ("+t.actor+")");throw n.hash={text:"->>-",token:"->>-",line:"1",loc:{first_line:1,last_line:1,first_column:1,last_column:1},expected:["'ACTIVE_PARTICIPANT'"]},n}return $.push({from:t,to:e,message:r.text,wrap:r.wrap===void 0&&pt()||!!r.wrap,type:i}),!0},qe=function(){return xt.length>0},ze=function(){return xt.some(t=>t.name)},He=function(){return $},Ue=function(){return xt},Ke=function(){return ct},mt=function(t){return ct[t]},Ge=function(){return Object.keys(ct)},Xe=function(){Nt=!0},Je=function(){Nt=!1},Ze=()=>Nt,Qe=function(t){Yt=t},pt=()=>Yt!==void 0?Yt:lt().sequence.wrap,je=function(){ct={},xt=[],$=[],Nt=!1,Le()},$e=function(t){const e=t.trim(),r={text:e.replace(/^:?(?:no)?wrap:/,"").trim(),wrap:e.match(/^:?wrap:/)!==null?!0:e.match(/^:?nowrap:/)!==null?!1:void 0};return K.debug("parseMessage:",r),r},t0=function(t){const e=t.match(/^((?:rgba?|hsla?)\s*\(.*\)|\w*)(.*)$/);let r=e!=null&&e[1]?e[1].trim():"transparent",i=e!=null&&e[2]?e[2].trim():void 0;if(window&&window.CSS)window.CSS.supports("color",r)||(r="transparent",i=t.trim());else{const n=new Option().style;n.color=r,n.color!==r&&(r="transparent",i=t.trim())}return{color:r,text:i!==void 0?Lt(i.replace(/^:?(?:no)?wrap:/,""),lt()):void 0,wrap:i!==void 0?i.match(/^:?wrap:/)!==null?!0:i.match(/^:?nowrap:/)!==null?!1:void 0:void 0}},bt={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},e0={FILLED:0,OPEN:1},i0={LEFTOF:0,RIGHTOF:1,OVER:2},se=function(t,e,r){r.text,r.wrap===void 0&&pt()||r.wrap;const i=[].concat(t,t);$.push({from:i[0],to:i[1],message:r.text,wrap:r.wrap===void 0&&pt()||!!r.wrap,type:bt.NOTE,placement:e})},ne=function(t,e){const r=mt(t);try{let i=Lt(e.text,lt());i=i.replace(/&amp;/g,"&"),i=i.replace(/&equals;/g,"=");const s=JSON.parse(i);Ht(r,s)}catch(i){K.error("error while parsing actor link text",i)}},s0=function(t,e){const r=mt(t);try{const c={};let l=Lt(e.text,lt());var i=l.indexOf("@");l=l.replace(/&amp;/g,"&"),l=l.replace(/&equals;/g,"=");var s=l.slice(0,i-1).trim(),n=l.slice(i+1).trim();c[s]=n,Ht(r,c)}catch(c){K.error("error while parsing actor link text",c)}};function Ht(t,e){if(t.links==null)t.links=e;else for(let r in e)t.links[r]=e[r]}const ae=function(t,e){const r=mt(t);try{let i=Lt(e.text,lt());const s=JSON.parse(i);re(r,s)}catch(i){K.error("error while parsing actor properties text",i)}};function re(t,e){if(t.properties==null)t.properties=e;else for(let r in e)t.properties[r]=e[r]}function n0(){at=void 0}const oe=function(t,e){const r=mt(t),i=document.getElementById(e.text);try{const s=i.innerHTML,n=JSON.parse(s);n.properties&&re(r,n.properties),n.links&&Ht(r,n.links)}catch(s){K.error("error while parsing actor details text",s)}},a0=function(t,e){if(t!==void 0&&t.properties!==void 0)return t.properties[e]},ce=function(t){if(Array.isArray(t))t.forEach(function(e){ce(e)});else switch(t.type){case"sequenceIndex":$.push({from:void 0,to:void 0,message:{start:t.sequenceIndex,step:t.sequenceIndexStep,visible:t.sequenceVisible},wrap:!1,type:t.signalType});break;case"addParticipant":Ft(t.actor,t.actor,t.description,"participant");break;case"addActor":Ft(t.actor,t.actor,t.description,"actor");break;case"activeStart":R(t.actor,void 0,void 0,t.signalType);break;case"activeEnd":R(t.actor,void 0,void 0,t.signalType);break;case"addNote":se(t.actor,t.placement,t.text);break;case"addLinks":ne(t.actor,t.text);break;case"addALink":s0(t.actor,t.text);break;case"addProperties":ae(t.actor,t.text);break;case"addDetails":oe(t.actor,t.text);break;case"addMessage":R(t.from,t.to,t.msg,t.signalType);break;case"boxStart":Ye(t.boxData);break;case"boxEnd":n0();break;case"loopStart":R(void 0,void 0,t.loopText,t.signalType);break;case"loopEnd":R(void 0,void 0,void 0,t.signalType);break;case"rectStart":R(void 0,void 0,t.color,t.signalType);break;case"rectEnd":R(void 0,void 0,void 0,t.signalType);break;case"optStart":R(void 0,void 0,t.optText,t.signalType);break;case"optEnd":R(void 0,void 0,void 0,t.signalType);break;case"altStart":R(void 0,void 0,t.altText,t.signalType);break;case"else":R(void 0,void 0,t.altText,t.signalType);break;case"altEnd":R(void 0,void 0,void 0,t.signalType);break;case"setAccTitle":te(t.text);break;case"parStart":R(void 0,void 0,t.parText,t.signalType);break;case"and":R(void 0,void 0,t.parText,t.signalType);break;case"parEnd":R(void 0,void 0,void 0,t.signalType);break;case"criticalStart":R(void 0,void 0,t.criticalText,t.signalType);break;case"option":R(void 0,void 0,t.optionText,t.signalType);break;case"criticalEnd":R(void 0,void 0,void 0,t.signalType);break;case"breakStart":R(void 0,void 0,t.breakText,t.signalType);break;case"breakEnd":R(void 0,void 0,void 0,t.signalType);break}},r0={addActor:Ft,addMessage:We,addSignal:R,addLinks:ne,addDetails:oe,addProperties:ae,autoWrap:pt,setWrap:Qe,enableSequenceNumbers:Xe,disableSequenceNumbers:Je,showSequenceNumbers:Ze,getMessages:He,getActors:Ke,getActor:mt,getActorKeys:Ge,getActorProperty:a0,getAccTitle:me,getBoxes:Ue,getDiagramTitle:ve,setDiagramTitle:we,parseDirective:Be,getConfig:()=>lt().sequence,clear:je,parseMessage:$e,parseBoxData:t0,LINETYPE:bt,ARROWTYPE:e0,PLACEMENT:i0,addNote:se,setAccTitle:te,apply:ce,setAccDescription:_e,getAccDescription:ke,hasAtLeastOneBox:qe,hasAtLeastOneBoxWithTitle:ze},o0=t=>`.actor {
stroke: ${t.actorBorder};
fill: ${t.actorBkg};
}
text.actor > tspan {
fill: ${t.actorTextColor};
stroke: none;
}
.actor-line {
stroke: ${t.actorLineColor};
}
.messageLine0 {
stroke-width: 1.5;
stroke-dasharray: none;
stroke: ${t.signalColor};
}
.messageLine1 {
stroke-width: 1.5;
stroke-dasharray: 2, 2;
stroke: ${t.signalColor};
}
#arrowhead path {
fill: ${t.signalColor};
stroke: ${t.signalColor};
}
.sequenceNumber {
fill: ${t.sequenceNumberColor};
}
#sequencenumber {
fill: ${t.signalColor};
}
#crosshead path {
fill: ${t.signalColor};
stroke: ${t.signalColor};
}
.messageText {
fill: ${t.signalTextColor};
stroke: none;
}
.labelBox {
stroke: ${t.labelBoxBorderColor};
fill: ${t.labelBoxBkgColor};
}
.labelText, .labelText > tspan {
fill: ${t.labelTextColor};
stroke: none;
}
.loopText, .loopText > tspan {
fill: ${t.loopTextColor};
stroke: none;
}
.loopLine {
stroke-width: 2px;
stroke-dasharray: 2, 2;
stroke: ${t.labelBoxBorderColor};
fill: ${t.labelBoxBorderColor};
}
.note {
//stroke: #decc93;
stroke: ${t.noteBorderColor};
fill: ${t.noteBkgColor};
}
.noteText, .noteText > tspan {
fill: ${t.noteTextColor};
stroke: none;
}
.activation0 {
fill: ${t.activationBkgColor};
stroke: ${t.activationBorderColor};
}
.activation1 {
fill: ${t.activationBkgColor};
stroke: ${t.activationBorderColor};
}
.activation2 {
fill: ${t.activationBkgColor};
stroke: ${t.activationBorderColor};
}
.actorPopupMenu {
position: absolute;
}
.actorPopupMenuPanel {
position: absolute;
fill: ${t.actorBkg};
box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
filter: drop-shadow(3px 5px 2px rgb(0 0 0 / 0.4));
}
.actor-man line {
stroke: ${t.actorBorder};
fill: ${t.actorBkg};
}
.actor-man circle, line {
stroke: ${t.actorBorder};
fill: ${t.actorBkg};
stroke-width: 2px;
}
`,c0=o0,Ut=function(t,e){return Me(t,e)},le=(t,e)=>{Ae(()=>{const r=document.querySelectorAll(t);r.length!==0&&(r[0].addEventListener("mouseover",function(){p0("actor"+e+"_popup")}),r[0].addEventListener("mouseout",function(){u0("actor"+e+"_popup")}))})},l0=function(t,e,r,i,s){if(e.links===void 0||e.links===null||Object.keys(e.links).length===0)return{height:0,width:0};const n=e.links,c=e.actorCnt,l=e.rectData;var p="none";s&&(p="block !important");const d=t.append("g");d.attr("id","actor"+c+"_popup"),d.attr("class","actorPopupMenu"),d.attr("display",p),le("#actor"+c+"_popup",c);var T="";l.class!==void 0&&(T=" "+l.class);let y=l.width>r?l.width:r;const u=d.append("rect");if(u.attr("class","actorPopupMenuPanel"+T),u.attr("x",l.x),u.attr("y",l.height),u.attr("fill",l.fill),u.attr("stroke",l.stroke),u.attr("width",y),u.attr("height",l.height),u.attr("rx",l.rx),u.attr("ry",l.ry),n!=null){var x=20;for(let A in n){var m=d.append("a"),L=ee(n[A]);m.attr("xlink:href",L),m.attr("target","_blank"),N0(i)(A,m,l.x+10,l.height+x,y,20,{class:"actor"},i),x+=30}}return u.attr("height",x),{height:l.height+x,width:y}},h0=function(t){return"var pu = document.getElementById('"+t+"'); if (pu != null) { pu.style.display = 'block'; }"},d0=function(t){return"var pu = document.getElementById('"+t+"'); if (pu != null) { pu.style.display = 'none'; }"},p0=function(t){var e=document.getElementById(t);e!=null&&(e.style.display="block")},u0=function(t){var e=document.getElementById(t);e!=null&&(e.style.display="none")},Tt=function(t,e){let r=0,i=0;const s=e.text.split(w.lineBreakRegex),[n,c]=ie(e.fontSize);let l=[],p=0,d=()=>e.y;if(e.valign!==void 0&&e.textMargin!==void 0&&e.textMargin>0)switch(e.valign){case"top":case"start":d=()=>Math.round(e.y+e.textMargin);break;case"middle":case"center":d=()=>Math.round(e.y+(r+i+e.textMargin)/2);break;case"bottom":case"end":d=()=>Math.round(e.y+(r+i+2*e.textMargin)-e.textMargin);break}if(e.anchor!==void 0&&e.textMargin!==void 0&&e.width!==void 0)switch(e.anchor){case"left":case"start":e.x=Math.round(e.x+e.textMargin),e.anchor="start",e.dominantBaseline="middle",e.alignmentBaseline="middle";break;case"middle":case"center":e.x=Math.round(e.x+e.width/2),e.anchor="middle",e.dominantBaseline="middle",e.alignmentBaseline="middle";break;case"right":case"end":e.x=Math.round(e.x+e.width-e.textMargin),e.anchor="end",e.dominantBaseline="middle",e.alignmentBaseline="middle";break}for(let[T,y]of s.entries()){e.textMargin!==void 0&&e.textMargin===0&&n!==void 0&&(p=T*n);const u=t.append("text");u.attr("x",e.x),u.attr("y",d()),e.anchor!==void 0&&u.attr("text-anchor",e.anchor).attr("dominant-baseline",e.dominantBaseline).attr("alignment-baseline",e.alignmentBaseline),e.fontFamily!==void 0&&u.style("font-family",e.fontFamily),c!==void 0&&u.style("font-size",c),e.fontWeight!==void 0&&u.style("font-weight",e.fontWeight),e.fill!==void 0&&u.attr("fill",e.fill),e.class!==void 0&&u.attr("class",e.class),e.dy!==void 0?u.attr("dy",e.dy):p!==0&&u.attr("dy",p);const x=y||Se;if(e.tspan){const m=u.append("tspan");m.attr("x",e.x),e.fill!==void 0&&m.attr("fill",e.fill),m.text(x)}else u.text(x);e.valign!==void 0&&e.textMargin!==void 0&&e.textMargin>0&&(i+=(u._groups||u)[0][0].getBBox().height,r=i),l.push(u)}return l},he=function(t,e){function r(s,n,c,l,p){return s+","+n+" "+(s+c)+","+n+" "+(s+c)+","+(n+l-p)+" "+(s+c-p*1.2)+","+(n+l)+" "+s+","+(n+l)}const i=t.append("polygon");return i.attr("points",r(e.x,e.y,e.width,e.height,7)),i.attr("class","labelBox"),e.y=e.y+e.height/2,Tt(t,e),i};let et=-1;const de=(t,e)=>{t.selectAll&&t.selectAll(".actor-line").attr("class","200").attr("y2",e-55)},f0=function(t,e,r,i){const s=e.x+e.width/2,n=e.y+5,c=t.append("g");var l=c;i||(et++,l.append("line").attr("id","actor"+et).attr("x1",s).attr("y1",n).attr("x2",s).attr("y2",2e3).attr("class","actor-line").attr("stroke-width","0.5px").attr("stroke","#999"),l=c.append("g"),e.actorCnt=et,e.links!=null&&(l.attr("id","root-"+et),le("#root-"+et,et)));const p=It();var d="actor";e.properties!=null&&e.properties.class?d=e.properties.class:p.fill="#eaeaea",p.x=e.x,p.y=e.y,p.width=e.width,p.height=e.height,p.class=d,p.rx=3,p.ry=3;const T=Ut(l,p);if(e.rectData=p,e.properties!=null&&e.properties.icon){const u=e.properties.icon.trim();u.charAt(0)==="@"?De(l,p.x+p.width-20,p.y+10,u.substr(1)):Ve(l,p.x+p.width-20,p.y+10,u)}Kt(r)(e.description,l,p.x,p.y,p.width,p.height,{class:"actor"},r);let y=e.height;if(T.node){const u=T.node().getBBox();e.height=u.height,y=u.height}return y},g0=function(t,e,r,i){const s=e.x+e.width/2,n=e.y+80;i||(et++,t.append("line").attr("id","actor"+et).attr("x1",s).attr("y1",n).attr("x2",s).attr("y2",2e3).attr("class","actor-line").attr("stroke-width","0.5px").attr("stroke","#999"));const c=t.append("g");c.attr("class","actor-man");const l=It();l.x=e.x,l.y=e.y,l.fill="#eaeaea",l.width=e.width,l.height=e.height,l.class="actor",l.rx=3,l.ry=3,c.append("line").attr("id","actor-man-torso"+et).attr("x1",s).attr("y1",e.y+25).attr("x2",s).attr("y2",e.y+45),c.append("line").attr("id","actor-man-arms"+et).attr("x1",s-18).attr("y1",e.y+33).attr("x2",s+18).attr("y2",e.y+33),c.append("line").attr("x1",s-18).attr("y1",e.y+60).attr("x2",s).attr("y2",e.y+45),c.append("line").attr("x1",s).attr("y1",e.y+45).attr("x2",s+16).attr("y2",e.y+60);const p=c.append("circle");p.attr("cx",e.x+e.width/2),p.attr("cy",e.y+10),p.attr("r",15),p.attr("width",e.width),p.attr("height",e.height);const d=c.node().getBBox();return e.height=d.height,Kt(r)(e.description,c,l.x,l.y+35,l.width,l.height,{class:"actor"},r),e.height},x0=function(t,e,r,i){switch(e.type){case"actor":return g0(t,e,r,i);case"participant":return f0(t,e,r,i)}},T0=function(t,e,r){const s=t.append("g");pe(s,e),e.name&&Kt(r)(e.name,s,e.x,e.y+(e.textMaxHeight||0)/2,e.width,0,{class:"text"},r),s.lower()},y0=function(t){return t.append("g")},E0=function(t,e,r,i,s){const n=It(),c=e.anchored;n.x=e.startx,n.y=e.starty,n.class="activation"+s%3,n.width=e.stopx-e.startx,n.height=r-e.starty,Ut(c,n)},b0=function(t,e,r,i){const{boxMargin:s,boxTextMargin:n,labelBoxHeight:c,labelBoxWidth:l,messageFontFamily:p,messageFontSize:d,messageFontWeight:T}=i,y=t.append("g"),u=function(L,A,M,I){return y.append("line").attr("x1",L).attr("y1",A).attr("x2",M).attr("y2",I).attr("class","loopLine")};u(e.startx,e.starty,e.stopx,e.starty),u(e.stopx,e.starty,e.stopx,e.stopy),u(e.startx,e.stopy,e.stopx,e.stopy),u(e.startx,e.starty,e.startx,e.stopy),e.sections!==void 0&&e.sections.forEach(function(L){u(e.startx,L.y,e.stopx,L.y).style("stroke-dasharray","3, 3")});let x=zt();x.text=r,x.x=e.startx,x.y=e.starty,x.fontFamily=p,x.fontSize=d,x.fontWeight=T,x.anchor="middle",x.valign="middle",x.tspan=!1,x.width=l||50,x.height=c||20,x.textMargin=n,x.class="labelText",he(y,x),x=ue(),x.text=e.title,x.x=e.startx+l/2+(e.stopx-e.startx)/2,x.y=e.starty+s+n,x.anchor="middle",x.valign="middle",x.textMargin=n,x.class="loopText",x.fontFamily=p,x.fontSize=d,x.fontWeight=T,x.wrap=!0;let m=Tt(y,x);return e.sectionTitles!==void 0&&e.sectionTitles.forEach(function(L,A){if(L.message){x.text=L.message,x.x=e.startx+(e.stopx-e.startx)/2,x.y=e.sections[A].y+s+n,x.class="loopText",x.anchor="middle",x.valign="middle",x.tspan=!1,x.fontFamily=p,x.fontSize=d,x.fontWeight=T,x.wrap=e.wrap,m=Tt(y,x);let M=Math.round(m.map(I=>(I._groups||I)[0][0].getBBox().height).reduce((I,Y)=>I+Y));e.sections[A].height+=M-(s+n)}}),e.height=Math.round(e.stopy-e.starty),y},pe=function(t,e){Re(t,e)},m0=function(t){t.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")},v0=function(t){t.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")},w0=function(t){t.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")},_0=function(t){t.append("defs").append("marker").attr("id","arrowhead").attr("refX",9).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto").append("path").attr("d","M 0 0 L 10 5 L 0 10 z")},k0=function(t){t.append("defs").append("marker").attr("id","filled-head").attr("refX",18).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")},P0=function(t){t.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)},L0=function(t){t.append("defs").append("marker").attr("id","crosshead").attr("markerWidth",15).attr("markerHeight",8).attr("orient","auto").attr("refX",4).attr("refY",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")},ue=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}},I0=function(){return{x:0,y:0,fill:"#EDF2AE",stroke:"#666",width:100,anchor:"start",height:100,rx:0,ry:0}},Kt=function(){function t(s,n,c,l,p,d,T){const y=n.append("text").attr("x",c+p/2).attr("y",l+d/2+5).style("text-anchor","middle").text(s);i(y,T)}function e(s,n,c,l,p,d,T,y){const{actorFontSize:u,actorFontFamily:x,actorFontWeight:m}=y,[L,A]=ie(u),M=s.split(w.lineBreakRegex);for(let I=0;I<M.length;I++){const Y=I*L-L*(M.length-1)/2,V=n.append("text").attr("x",c+p/2).attr("y",l).style("text-anchor","middle").style("font-size",A).style("font-weight",m).style("font-family",x);V.append("tspan").attr("x",c+p/2).attr("dy",Y).text(M[I]),V.attr("y",l+d/2).attr("dominant-baseline","central").attr("alignment-baseline","central"),i(V,T)}}function r(s,n,c,l,p,d,T,y){const u=n.append("switch"),m=u.append("foreignObject").attr("x",c).attr("y",l).attr("width",p).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),e(s,u,c,l,p,d,T,y),i(m,T)}function i(s,n){for(const c in n)n.hasOwnProperty(c)&&s.attr(c,n[c])}return function(s){return s.textPlacement==="fo"?r:s.textPlacement==="old"?t:e}}(),N0=function(){function t(s,n,c,l,p,d,T){const y=n.append("text").attr("x",c).attr("y",l).style("text-anchor","start").text(s);i(y,T)}function e(s,n,c,l,p,d,T,y){const{actorFontSize:u,actorFontFamily:x,actorFontWeight:m}=y,L=s.split(w.lineBreakRegex);for(let A=0;A<L.length;A++){const M=A*u-u*(L.length-1)/2,I=n.append("text").attr("x",c).attr("y",l).style("text-anchor","start").style("font-size",u).style("font-weight",m).style("font-family",x);I.append("tspan").attr("x",c).attr("dy",M).text(L[A]),I.attr("y",l+d/2).attr("dominant-baseline","central").attr("alignment-baseline","central"),i(I,T)}}function r(s,n,c,l,p,d,T,y){const u=n.append("switch"),m=u.append("foreignObject").attr("x",c).attr("y",l).attr("width",p).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),e(s,u,c,l,p,d,T,y),i(m,T)}function i(s,n){for(const c in n)n.hasOwnProperty(c)&&s.attr(c,n[c])}return function(s){return s.textPlacement==="fo"?r:s.textPlacement==="old"?t:e}}(),D={drawRect:Ut,drawText:Tt,drawLabel:he,drawActor:x0,drawBox:T0,drawPopup:l0,anchorElement:y0,drawActivation:E0,drawLoop:b0,drawBackgroundRect:pe,insertArrowHead:_0,insertArrowFilledHead:k0,insertSequenceNumber:P0,insertArrowCrossHead:L0,insertDatabaseIcon:m0,insertComputerIcon:v0,insertClockIcon:w0,getTextObj:ue,getNoteRect:I0,popupMenu:h0,popdownMenu:d0,fixLifeLineHeights:de,sanitizeUrl:ee};let a={};const f={data:{startx:void 0,stopx:void 0,starty:void 0,stopy:void 0},verticalPos:0,sequenceItems:[],activations:[],models:{getHeight:function(){return Math.max.apply(null,this.actors.length===0?[0]:this.actors.map(t=>t.height||0))+(this.loops.length===0?0:this.loops.map(t=>t.height||0).reduce((t,e)=>t+e))+(this.messages.length===0?0:this.messages.map(t=>t.height||0).reduce((t,e)=>t+e))+(this.notes.length===0?0:this.notes.map(t=>t.height||0).reduce((t,e)=>t+e))},clear:function(){this.actors=[],this.boxes=[],this.loops=[],this.messages=[],this.notes=[]},addBox:function(t){this.boxes.push(t)},addActor:function(t){this.actors.push(t)},addLoop:function(t){this.loops.push(t)},addMessage:function(t){this.messages.push(t)},addNote:function(t){this.notes.push(t)},lastActor:function(){return this.actors[this.actors.length-1]},lastLoop:function(){return this.loops[this.loops.length-1]},lastMessage:function(){return this.messages[this.messages.length-1]},lastNote:function(){return this.notes[this.notes.length-1]},actors:[],boxes:[],loops:[],messages:[],notes:[]},init: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,ge(lt())},updateVal:function(t,e,r,i){t[e]===void 0?t[e]=r:t[e]=i(r,t[e])},updateBounds:function(t,e,r,i){const s=this;let n=0;function c(l){return function(d){n++;const T=s.sequenceItems.length-n+1;s.updateVal(d,"starty",e-T*a.boxMargin,Math.min),s.updateVal(d,"stopy",i+T*a.boxMargin,Math.max),s.updateVal(f.data,"startx",t-T*a.boxMargin,Math.min),s.updateVal(f.data,"stopx",r+T*a.boxMargin,Math.max),l!=="activation"&&(s.updateVal(d,"startx",t-T*a.boxMargin,Math.min),s.updateVal(d,"stopx",r+T*a.boxMargin,Math.max),s.updateVal(f.data,"starty",e-T*a.boxMargin,Math.min),s.updateVal(f.data,"stopy",i+T*a.boxMargin,Math.max))}}this.sequenceItems.forEach(c()),this.activations.forEach(c("activation"))},insert:function(t,e,r,i){const s=w.getMin(t,r),n=w.getMax(t,r),c=w.getMin(e,i),l=w.getMax(e,i);this.updateVal(f.data,"startx",s,Math.min),this.updateVal(f.data,"starty",c,Math.min),this.updateVal(f.data,"stopx",n,Math.max),this.updateVal(f.data,"stopy",l,Math.max),this.updateBounds(s,c,n,l)},newActivation:function(t,e,r){const i=r[t.from.actor],s=At(t.from.actor).length||0,n=i.x+i.width/2+(s-1)*a.activationWidth/2;this.activations.push({startx:n,starty:this.verticalPos+2,stopx:n+a.activationWidth,stopy:void 0,actor:t.from.actor,anchored:D.anchorElement(e)})},endActivation:function(t){const e=this.activations.map(function(r){return r.actor}).lastIndexOf(t.from.actor);return this.activations.splice(e,1)[0]},createLoop:function(t={message:void 0,wrap:!1,width:void 0},e){return{startx:void 0,starty:this.verticalPos,stopx:void 0,stopy:void 0,title:t.message,wrap:t.wrap,width:t.width,height:0,fill:e}},newLoop:function(t={message:void 0,wrap:!1,width:void 0},e){this.sequenceItems.push(this.createLoop(t,e))},endLoop:function(){return this.sequenceItems.pop()},isLoopOverlap:function(){return this.sequenceItems.length?this.sequenceItems[this.sequenceItems.length-1].overlap:!1},addSectionToLoop:function(t){const e=this.sequenceItems.pop();e.sections=e.sections||[],e.sectionTitles=e.sectionTitles||[],e.sections.push({y:f.getVerticalPos(),height:0}),e.sectionTitles.push(t),this.sequenceItems.push(e)},saveVerticalPos:function(){this.isLoopOverlap()&&(this.savedVerticalPos=this.verticalPos)},resetVerticalPos:function(){this.isLoopOverlap()&&(this.verticalPos=this.savedVerticalPos)},bumpVerticalPos:function(t){this.verticalPos=this.verticalPos+t,this.data.stopy=w.getMax(this.data.stopy,this.verticalPos)},getVerticalPos:function(){return this.verticalPos},getBounds:function(){return{bounds:this.data,models:this.models}}},A0=function(t,e){f.bumpVerticalPos(a.boxMargin),e.height=a.boxMargin,e.starty=f.getVerticalPos();const r=It();r.x=e.startx,r.y=e.starty,r.width=e.width||a.width,r.class="note";const i=t.append("g"),s=D.drawRect(i,r),n=zt();n.x=e.startx,n.y=e.starty,n.width=r.width,n.dy="1em",n.text=e.message,n.class="noteText",n.fontFamily=a.noteFontFamily,n.fontSize=a.noteFontSize,n.fontWeight=a.noteFontWeight,n.anchor=a.noteAlign,n.textMargin=a.noteMargin,n.valign="center";const c=Tt(i,n),l=Math.round(c.map(p=>(p._groups||p)[0][0].getBBox().height).reduce((p,d)=>p+d));s.attr("height",l+2*a.noteMargin),e.height+=l+2*a.noteMargin,f.bumpVerticalPos(l+2*a.noteMargin),e.stopy=e.starty+l+2*a.noteMargin,e.stopx=e.startx+r.width,f.insert(e.startx,e.starty,e.stopx,e.stopy),f.models.addNote(e)},ut=t=>({fontFamily:t.messageFontFamily,fontSize:t.messageFontSize,fontWeight:t.messageFontWeight}),gt=t=>({fontFamily:t.noteFontFamily,fontSize:t.noteFontSize,fontWeight:t.noteFontWeight}),Wt=t=>({fontFamily:t.actorFontFamily,fontSize:t.actorFontSize,fontWeight:t.actorFontWeight});function S0(t,e){f.bumpVerticalPos(10);const{startx:r,stopx:i,message:s}=e,n=w.splitBreaks(s).length,c=C.calculateTextDimensions(s,ut(a)),l=c.height/n;e.height+=l,f.bumpVerticalPos(l);let p,d=c.height-10;const T=c.width;if(r===i){p=f.getVerticalPos()+d,a.rightAngles||(d+=a.boxMargin,p=f.getVerticalPos()+d),d+=30;const y=w.getMax(T/2,a.width/2);f.insert(r-y,f.getVerticalPos()-10+d,i+y,f.getVerticalPos()+30+d)}else d+=a.boxMargin,p=f.getVerticalPos()+d,f.insert(r,p-10,i,p);return f.bumpVerticalPos(d),e.height+=d,e.stopy=e.starty+e.height,f.insert(e.fromBounds,e.starty,e.toBounds,e.stopy),p}const M0=function(t,e,r,i){const{startx:s,stopx:n,starty:c,message:l,type:p,sequenceIndex:d,sequenceVisible:T}=e,y=C.calculateTextDimensions(l,ut(a)),u=zt();u.x=s,u.y=c+10,u.width=n-s,u.class="messageText",u.dy="1em",u.text=l,u.fontFamily=a.messageFontFamily,u.fontSize=a.messageFontSize,u.fontWeight=a.messageFontWeight,u.anchor=a.messageAlign,u.valign="center",u.textMargin=a.wrapPadding,u.tspan=!1,Tt(t,u);const x=y.width;let m;s===n?a.rightAngles?m=t.append("path").attr("d",`M ${s},${r} H ${s+w.getMax(a.width/2,x/2)} V ${r+25} H ${s}`):m=t.append("path").attr("d","M "+s+","+r+" C "+(s+60)+","+(r-10)+" "+(s+60)+","+(r+30)+" "+s+","+(r+20)):(m=t.append("line"),m.attr("x1",s),m.attr("y1",r),m.attr("x2",n),m.attr("y2",r)),p===i.db.LINETYPE.DOTTED||p===i.db.LINETYPE.DOTTED_CROSS||p===i.db.LINETYPE.DOTTED_POINT||p===i.db.LINETYPE.DOTTED_OPEN?(m.style("stroke-dasharray","3, 3"),m.attr("class","messageLine1")):m.attr("class","messageLine0");let L="";a.arrowMarkerAbsolute&&(L=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,L=L.replace(/\(/g,"\\("),L=L.replace(/\)/g,"\\)")),m.attr("stroke-width",2),m.attr("stroke","none"),m.style("fill","none"),(p===i.db.LINETYPE.SOLID||p===i.db.LINETYPE.DOTTED)&&m.attr("marker-end","url("+L+"#arrowhead)"),(p===i.db.LINETYPE.SOLID_POINT||p===i.db.LINETYPE.DOTTED_POINT)&&m.attr("marker-end","url("+L+"#filled-head)"),(p===i.db.LINETYPE.SOLID_CROSS||p===i.db.LINETYPE.DOTTED_CROSS)&&m.attr("marker-end","url("+L+"#crosshead)"),(T||a.showSequenceNumbers)&&(m.attr("marker-start","url("+L+"#sequencenumber)"),t.append("text").attr("x",s).attr("y",r+4).attr("font-family","sans-serif").attr("font-size","12px").attr("text-anchor","middle").attr("class","sequenceNumber").text(d))},qt=function(t,e,r,i,s,n,c){if(s.hideUnusedParticipants===!0){const y=new Set;n.forEach(u=>{y.add(u.from),y.add(u.to)}),r=r.filter(u=>y.has(u))}let l=0,p=0,d=0,T;for(const y of r){const u=e[y],x=u.box;T&&T!=x&&(c||f.models.addBox(T),p+=a.boxMargin+T.margin),x&&x!=T&&(c||(x.x=l+p,x.y=i),p+=x.margin),u.width=u.width||a.width,u.height=w.getMax(u.height||a.height,a.height),u.margin=u.margin||a.actorMargin,u.x=l+p,u.y=f.getVerticalPos();const m=D.drawActor(t,u,a,c);d=w.getMax(d,m),f.insert(u.x,i,u.x+u.width,u.height),l+=u.width+p,u.box&&(u.box.width=l+x.margin-u.box.x),p=u.margin,T=u.box,f.models.addActor(u)}T&&!c&&f.models.addBox(T),f.bumpVerticalPos(d)},fe=function(t,e,r,i){let s=0,n=0;for(const c of r){const l=e[c],p=V0(l),d=D.drawPopup(t,l,p,a,a.forceMenus,i);d.height>s&&(s=d.height),d.width+l.x>n&&(n=d.width+l.x)}return{maxHeight:s,maxWidth:n}},ge=function(t){Ie(a,t),t.fontFamily&&(a.actorFontFamily=a.noteFontFamily=a.messageFontFamily=t.fontFamily),t.fontSize&&(a.actorFontSize=a.noteFontSize=a.messageFontSize=t.fontSize),t.fontWeight&&(a.actorFontWeight=a.noteFontWeight=a.messageFontWeight=t.fontWeight)},At=function(t){return f.activations.filter(function(e){return e.actor===t})},$t=function(t,e){const r=e[t],i=At(t),s=i.reduce(function(c,l){return w.getMin(c,l.startx)},r.x+r.width/2),n=i.reduce(function(c,l){return w.getMax(c,l.stopx)},r.x+r.width/2);return[s,n]};function tt(t,e,r,i,s){f.bumpVerticalPos(r);let n=i;if(e.id&&e.message&&t[e.id]){const c=t[e.id].width,l=ut(a);e.message=C.wrapLabel(`[${e.message}]`,c-2*a.wrapPadding,l),e.width=c,e.wrap=!0;const p=C.calculateTextDimensions(e.message,l),d=w.getMax(p.height,a.labelBoxHeight);n=i+d,K.debug(`${d} - ${e.message}`)}s(e),f.bumpVerticalPos(n)}const R0=function(t,e,r,i){const{securityLevel:s,sequence:n}=lt();a=n,i.db.clear(),i.parser.parse(t);let c;s==="sandbox"&&(c=Pt("#i"+e));const l=s==="sandbox"?Pt(c.nodes()[0].contentDocument.body):Pt("body"),p=s==="sandbox"?c.nodes()[0].contentDocument:document;f.init(),K.debug(i.db);const d=s==="sandbox"?l.select(`[id="${e}"]`):Pt(`[id="${e}"]`),T=i.db.getActors(),y=i.db.getBoxes(),u=i.db.getActorKeys(),x=i.db.getMessages(),m=i.db.getDiagramTitle(),L=i.db.hasAtLeastOneBox(),A=i.db.hasAtLeastOneBoxWithTitle(),M=D0(T,x,i);a.height=C0(T,M,y),D.insertComputerIcon(d),D.insertDatabaseIcon(d),D.insertClockIcon(d),L&&(f.bumpVerticalPos(a.boxMargin),A&&f.bumpVerticalPos(y[0].textMaxHeight)),qt(d,T,u,0,a,x,!1);const I=Y0(x,T,M,i);D.insertArrowHead(d),D.insertArrowCrossHead(d),D.insertArrowFilledHead(d),D.insertSequenceNumber(d);function Y(v,E){const j=f.endActivation(v);j.starty+18>E&&(j.starty=E-6,E+=12),D.drawActivation(d,j,E,a,At(v.from.actor).length),f.insert(j.startx,E-10,j.stopx,E)}let V=1,H=1;const G=[];x.forEach(function(v){let E,j,k;switch(v.type){case i.db.LINETYPE.NOTE:f.resetVerticalPos(),j=v.noteModel,A0(d,j);break;case i.db.LINETYPE.ACTIVE_START:f.newActivation(v,d,T);break;case i.db.LINETYPE.ACTIVE_END:Y(v,f.getVerticalPos());break;case i.db.LINETYPE.LOOP_START:tt(I,v,a.boxMargin,a.boxMargin+a.boxTextMargin,N=>f.newLoop(N));break;case i.db.LINETYPE.LOOP_END:E=f.endLoop(),D.drawLoop(d,E,"loop",a),f.bumpVerticalPos(E.stopy-f.getVerticalPos()),f.models.addLoop(E);break;case i.db.LINETYPE.RECT_START:tt(I,v,a.boxMargin,a.boxMargin,N=>f.newLoop(void 0,N.message));break;case i.db.LINETYPE.RECT_END:E=f.endLoop(),D.drawBackgroundRect(d,E),f.models.addLoop(E),f.bumpVerticalPos(E.stopy-f.getVerticalPos());break;case i.db.LINETYPE.OPT_START:tt(I,v,a.boxMargin,a.boxMargin+a.boxTextMargin,N=>f.newLoop(N));break;case i.db.LINETYPE.OPT_END:E=f.endLoop(),D.drawLoop(d,E,"opt",a),f.bumpVerticalPos(E.stopy-f.getVerticalPos()),f.models.addLoop(E);break;case i.db.LINETYPE.ALT_START:tt(I,v,a.boxMargin,a.boxMargin+a.boxTextMargin,N=>f.newLoop(N));break;case i.db.LINETYPE.ALT_ELSE:tt(I,v,a.boxMargin+a.boxTextMargin,a.boxMargin,N=>f.addSectionToLoop(N));break;case i.db.LINETYPE.ALT_END:E=f.endLoop(),D.drawLoop(d,E,"alt",a),f.bumpVerticalPos(E.stopy-f.getVerticalPos()),f.models.addLoop(E);break;case i.db.LINETYPE.PAR_START:case i.db.LINETYPE.PAR_OVER_START:tt(I,v,a.boxMargin,a.boxMargin+a.boxTextMargin,N=>f.newLoop(N)),f.saveVerticalPos();break;case i.db.LINETYPE.PAR_AND:tt(I,v,a.boxMargin+a.boxTextMargin,a.boxMargin,N=>f.addSectionToLoop(N));break;case i.db.LINETYPE.PAR_END:E=f.endLoop(),D.drawLoop(d,E,"par",a),f.bumpVerticalPos(E.stopy-f.getVerticalPos()),f.models.addLoop(E);break;case i.db.LINETYPE.AUTONUMBER:V=v.message.start||V,H=v.message.step||H,v.message.visible?i.db.enableSequenceNumbers():i.db.disableSequenceNumbers();break;case i.db.LINETYPE.CRITICAL_START:tt(I,v,a.boxMargin,a.boxMargin+a.boxTextMargin,N=>f.newLoop(N));break;case i.db.LINETYPE.CRITICAL_OPTION:tt(I,v,a.boxMargin+a.boxTextMargin,a.boxMargin,N=>f.addSectionToLoop(N));break;case i.db.LINETYPE.CRITICAL_END:E=f.endLoop(),D.drawLoop(d,E,"critical",a),f.bumpVerticalPos(E.stopy-f.getVerticalPos()),f.models.addLoop(E);break;case i.db.LINETYPE.BREAK_START:tt(I,v,a.boxMargin,a.boxMargin+a.boxTextMargin,N=>f.newLoop(N));break;case i.db.LINETYPE.BREAK_END:E=f.endLoop(),D.drawLoop(d,E,"break",a),f.bumpVerticalPos(E.stopy-f.getVerticalPos()),f.models.addLoop(E);break;default:try{f.resetVerticalPos(),k=v.msgModel,k.starty=f.getVerticalPos(),k.sequenceIndex=V,k.sequenceVisible=i.db.showSequenceNumbers();const N=S0(d,k);G.push({messageModel:k,lineStartY:N}),f.models.addMessage(k)}catch(N){K.error("error while drawing message",N)}}[i.db.LINETYPE.SOLID_OPEN,i.db.LINETYPE.DOTTED_OPEN,i.db.LINETYPE.SOLID,i.db.LINETYPE.DOTTED,i.db.LINETYPE.SOLID_CROSS,i.db.LINETYPE.DOTTED_CROSS,i.db.LINETYPE.SOLID_POINT,i.db.LINETYPE.DOTTED_POINT].includes(v.type)&&(V=V+H)}),G.forEach(v=>M0(d,v.messageModel,v.lineStartY,i)),a.mirrorActors&&(f.bumpVerticalPos(a.boxMargin*2),qt(d,T,u,f.getVerticalPos(),a,x,!0),f.bumpVerticalPos(a.boxMargin),de(d,f.getVerticalPos())),f.models.boxes.forEach(function(v){v.height=f.getVerticalPos()-v.y,f.insert(v.x,v.y,v.x+v.width,v.height),v.startx=v.x,v.starty=v.y,v.stopx=v.startx+v.width,v.stopy=v.starty+v.height,v.stroke="rgb(0,0,0, 0.5)",D.drawBox(d,v,a)}),L&&f.bumpVerticalPos(a.boxMargin);const W=fe(d,T,u,p),{bounds:O}=f.getBounds();K.debug("For line height fix Querying: #"+e+" .actor-line"),Ce("#"+e+" .actor-line").attr("y2",O.stopy);let F=O.stopy-O.starty;F<W.maxHeight&&(F=W.maxHeight);let q=F+2*a.diagramMarginY;a.mirrorActors&&(q=q-a.boxMargin+a.bottomMarginAdj);let U=O.stopx-O.startx;U<W.maxWidth&&(U=W.maxWidth);const J=U+2*a.diagramMarginX;m&&d.append("text").text(m).attr("x",(O.stopx-O.startx)/2-2*a.diagramMarginX).attr("y",-25),Ne(d,q,J,a.useMaxWidth);const Z=m?40:0;d.attr("viewBox",O.startx-a.diagramMarginX+" -"+(a.diagramMarginY+Z)+" "+J+" "+(q+Z)),K.debug("models:",f.models)};function D0(t,e,r){const i={};return e.forEach(function(s){if(t[s.to]&&t[s.from]){const n=t[s.to];if(s.placement===r.db.PLACEMENT.LEFTOF&&!n.prevActor||s.placement===r.db.PLACEMENT.RIGHTOF&&!n.nextActor)return;const c=s.placement!==void 0,l=!c,p=c?gt(a):ut(a),d=s.wrap?C.wrapLabel(s.message,a.width-2*a.wrapPadding,p):s.message,y=C.calculateTextDimensions(d,p).width+2*a.wrapPadding;l&&s.from===n.nextActor?i[s.to]=w.getMax(i[s.to]||0,y):l&&s.from===n.prevActor?i[s.from]=w.getMax(i[s.from]||0,y):l&&s.from===s.to?(i[s.from]=w.getMax(i[s.from]||0,y/2),i[s.to]=w.getMax(i[s.to]||0,y/2)):s.placement===r.db.PLACEMENT.RIGHTOF?i[s.from]=w.getMax(i[s.from]||0,y):s.placement===r.db.PLACEMENT.LEFTOF?i[n.prevActor]=w.getMax(i[n.prevActor]||0,y):s.placement===r.db.PLACEMENT.OVER&&(n.prevActor&&(i[n.prevActor]=w.getMax(i[n.prevActor]||0,y/2)),n.nextActor&&(i[s.from]=w.getMax(i[s.from]||0,y/2)))}}),K.debug("maxMessageWidthPerActor:",i),i}const V0=function(t){let e=0;const r=Wt(a);for(const i in t.links){const n=C.calculateTextDimensions(i,r).width+2*a.wrapPadding+2*a.boxMargin;e<n&&(e=n)}return e};function C0(t,e,r){let i=0;Object.keys(t).forEach(n=>{const c=t[n];c.wrap&&(c.description=C.wrapLabel(c.description,a.width-2*a.wrapPadding,Wt(a)));const l=C.calculateTextDimensions(c.description,Wt(a));c.width=c.wrap?a.width:w.getMax(a.width,l.width+2*a.wrapPadding),c.height=c.wrap?w.getMax(l.height,a.height):a.height,i=w.getMax(i,c.height)});for(const n in e){const c=t[n];if(!c)continue;const l=t[c.nextActor];if(!l){const y=e[n]+a.actorMargin-c.width/2;c.margin=w.getMax(y,a.actorMargin);continue}const d=e[n]+a.actorMargin-c.width/2-l.width/2;c.margin=w.getMax(d,a.actorMargin)}let s=0;return r.forEach(n=>{const c=ut(a);let l=n.actorKeys.reduce((T,y)=>T+=t[y].width+(t[y].margin||0),0);l-=2*a.boxTextMargin,n.wrap&&(n.name=C.wrapLabel(n.name,l-2*a.wrapPadding,c));const p=C.calculateTextDimensions(n.name,c);s=w.getMax(p.height,s);const d=w.getMax(l,p.width+2*a.wrapPadding);if(n.margin=a.boxTextMargin,l<d){const T=(d-l)/2;n.margin+=T}}),r.forEach(n=>n.textMaxHeight=s),w.getMax(i,a.height)}const O0=function(t,e,r){const i=e[t.from].x,s=e[t.to].x,n=t.wrap&&t.message;let c=C.calculateTextDimensions(n?C.wrapLabel(t.message,a.width,gt(a)):t.message,gt(a));const l={width:n?a.width:w.getMax(a.width,c.width+2*a.noteMargin),height:0,startx:e[t.from].x,stopx:0,starty:0,stopy:0,message:t.message};return t.placement===r.db.PLACEMENT.RIGHTOF?(l.width=n?w.getMax(a.width,c.width):w.getMax(e[t.from].width/2+e[t.to].width/2,c.width+2*a.noteMargin),l.startx=i+(e[t.from].width+a.actorMargin)/2):t.placement===r.db.PLACEMENT.LEFTOF?(l.width=n?w.getMax(a.width,c.width+2*a.noteMargin):w.getMax(e[t.from].width/2+e[t.to].width/2,c.width+2*a.noteMargin),l.startx=i-l.width+(e[t.from].width-a.actorMargin)/2):t.to===t.from?(c=C.calculateTextDimensions(n?C.wrapLabel(t.message,w.getMax(a.width,e[t.from].width),gt(a)):t.message,gt(a)),l.width=n?w.getMax(a.width,e[t.from].width):w.getMax(e[t.from].width,a.width,c.width+2*a.noteMargin),l.startx=i+(e[t.from].width-l.width)/2):(l.width=Math.abs(i+e[t.from].width/2-(s+e[t.to].width/2))+a.actorMargin,l.startx=i<s?i+e[t.from].width/2-a.actorMargin/2:s+e[t.to].width/2-a.actorMargin/2),n&&(l.message=C.wrapLabel(t.message,l.width-2*a.wrapPadding,gt(a))),K.debug(`NM:[${l.startx},${l.stopx},${l.starty},${l.stopy}:${l.width},${l.height}=${t.message}]`),l},B0=function(t,e,r){let i=!1;if([r.db.LINETYPE.SOLID_OPEN,r.db.LINETYPE.DOTTED_OPEN,r.db.LINETYPE.SOLID,r.db.LINETYPE.DOTTED,r.db.LINETYPE.SOLID_CROSS,r.db.LINETYPE.DOTTED_CROSS,r.db.LINETYPE.SOLID_POINT,r.db.LINETYPE.DOTTED_POINT].includes(t.type)&&(i=!0),!i)return{};const s=$t(t.from,e),n=$t(t.to,e),c=s[0]<=n[0]?1:0,l=s[0]<n[0]?0:1,p=[...s,...n],d=Math.abs(n[l]-s[c]);t.wrap&&t.message&&(t.message=C.wrapLabel(t.message,w.getMax(d+2*a.wrapPadding,a.width),ut(a)));const T=C.calculateTextDimensions(t.message,ut(a));return{width:w.getMax(t.wrap?0:T.width+2*a.wrapPadding,d+2*a.wrapPadding,a.width),height:0,startx:s[c],stopx:n[l],starty:0,stopy:0,message:t.message,type:t.type,wrap:t.wrap,fromBounds:Math.min.apply(null,p),toBounds:Math.max.apply(null,p)}},Y0=function(t,e,r,i){const s={},n=[];let c,l,p;return t.forEach(function(d){switch(d.id=C.random({length:10}),d.type){case i.db.LINETYPE.LOOP_START:case i.db.LINETYPE.ALT_START:case i.db.LINETYPE.OPT_START:case i.db.LINETYPE.PAR_START:case i.db.LINETYPE.PAR_OVER_START:case i.db.LINETYPE.CRITICAL_START:case i.db.LINETYPE.BREAK_START:n.push({id:d.id,msg:d.message,from:Number.MAX_SAFE_INTEGER,to:Number.MIN_SAFE_INTEGER,width:0});break;case i.db.LINETYPE.ALT_ELSE:case i.db.LINETYPE.PAR_AND:case i.db.LINETYPE.CRITICAL_OPTION:d.message&&(c=n.pop(),s[c.id]=c,s[d.id]=c,n.push(c));break;case i.db.LINETYPE.LOOP_END:case i.db.LINETYPE.ALT_END:case i.db.LINETYPE.OPT_END:case i.db.LINETYPE.PAR_END:case i.db.LINETYPE.CRITICAL_END:case i.db.LINETYPE.BREAK_END:c=n.pop(),s[c.id]=c;break;case i.db.LINETYPE.ACTIVE_START:{const y=e[d.from?d.from.actor:d.to.actor],u=At(d.from?d.from.actor:d.to.actor).length,x=y.x+y.width/2+(u-1)*a.activationWidth/2,m={startx:x,stopx:x+a.activationWidth,actor:d.from.actor,enabled:!0};f.activations.push(m)}break;case i.db.LINETYPE.ACTIVE_END:{const y=f.activations.map(u=>u.actor).lastIndexOf(d.from.actor);delete f.activations.splice(y,1)[0]}break}d.placement!==void 0?(l=O0(d,e,i),d.noteModel=l,n.forEach(y=>{c=y,c.from=w.getMin(c.from,l.startx),c.to=w.getMax(c.to,l.startx+l.width),c.width=w.getMax(c.width,Math.abs(c.from-c.to))-a.labelBoxWidth})):(p=B0(d,e,i),d.msgModel=p,p.startx&&p.stopx&&n.length>0&&n.forEach(y=>{if(c=y,p.startx===p.stopx){const u=e[d.from],x=e[d.to];c.from=w.getMin(u.x-p.width/2,u.x-u.width/2,c.from),c.to=w.getMax(x.x+p.width/2,x.x+u.width/2,c.to),c.width=w.getMax(c.width,Math.abs(c.to-c.from))-a.labelBoxWidth}else c.from=w.getMin(p.startx,c.from),c.to=w.getMax(p.stopx,c.to),c.width=w.getMax(c.width,p.width)-a.labelBoxWidth}))}),f.activations=[],K.debug("Loop type widths:",s),s},F0={bounds:f,drawActors:qt,drawActorsPopup:fe,setConf:ge,draw:R0},U0={parser:Oe,db:r0,renderer:F0,styles:c0};export{U0 as diagram};