livebook/static/assets/sequenceDiagram-edd7e28f-PKF3RPXX.js
2023-05-27 07:05:48 +00:00

122 lines
78 KiB
JavaScript

import{a as ne,b as re,d as ae,e as oe,f as bt,g as Nt}from"./chunk-QFY7JLBI.js";import{Aa as ge,D as Be,Ma as Ft,Na as D,Oa as xe,Qa as Te,g as Oe,ha as H,ia as mt,l as Et,la as w,m as se,oa as ce,ra as rt,sa as le,ua as he,va as Yt,wa as de,xa as pe,ya as ue,za as fe}from"./chunk-CRHZHETQ.js";import{h as ie}from"./chunk-2YVZDWG7.js";var Kt=ie(Oe(),1);var X0=ie(Be(),1);var Wt=function(){var t=function(ct,b,_,L){for(_=_||{},L=ct.length;L--;_[ct[L]]=b);return _},e=[1,2],a=[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],v=[1,31],P=[1,32],A=[1,33],M=[1,34],I=[1,35],Y=[1,36],C=[1,37],U=[1,38],G=[1,39],W=[1,40],O=[1,41],X=[1,43],F=[1,44],q=[1,46],K=[1,47],J=[1,48],Q=[1,49],m=[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],kt=[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],Qt=[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],Mt=[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],Zt=[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],ot=[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],Rt={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,_,L,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:a,6:4,7:i,14:6,84:s},{1:[3]},{3:8,4:e,5:a,6:4,7:i,14:6,84:s},{3:9,4:e,5:a,6:4,7:i,14:6,84:s},{3:10,4:e,5:a,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:v,38:P,40:A,41:M,42:I,43:Y,44:C,46:U,48:G,49:W,51:O,55:X,57:F,58:q,63:K,64:J,65:Q,66:m,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:v,38:P,40:A,41:M,42:I,43:Y,44:C,46:U,48:G,49:W,51:O,55:X,57:F,58:q,63:K,64:J,65:Q,66:m,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(kt,n,{8:106}),t(kt,n,{8:107}),t(kt,n,{8:108}),t(Qt,n,{45:109,8:110}),t(Mt,n,{47:111,8:112}),t(Mt,n,{8:112,47:113}),t(Zt,n,{50:114,8:115}),t(kt,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(ot,[2,71]),t(ot,[2,72]),t(ot,[2,73]),t(ot,[2,74]),t(ot,[2,75]),t(ot,[2,76]),t(ot,[2,77]),t(ot,[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:v,38:P,40:A,41:M,42:I,43:Y,44:C,46:U,48:G,49:W,51:O,55:X,57:F,58:q,63:K,64:J,65:Q,66:m,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:v,38:P,40:A,41:M,42:I,43:Y,44:C,46:U,48:G,49:W,51:O,55:X,57:F,58:q,63:K,64:J,65:Q,66:m,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:v,38:P,40:A,41:M,42:I,43:Y,44:C,46:U,48:G,49:W,51:O,55:X,57:F,58:q,63:K,64:J,65:Q,66:m,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:v,38:P,40:A,41:M,42:I,43:Y,44:C,46:U,48:G,49:W,51:O,54:[1,143],55:X,57:F,58:q,63:K,64:J,65:Q,66:m,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:v,38:P,40:A,41:M,42:I,43:Y,44:C,46:U,48:G,49:W,51:O,53:[1,145],55:X,57:F,58:q,63:K,64:J,65:Q,66:m,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:v,38:P,40:A,41:M,42:I,43:Y,44:C,46:U,48:G,49:W,51:O,52:[1,148],55:X,57:F,58:q,63:K,64:J,65:Q,66:m,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:v,38:P,40:A,41:M,42:I,43:Y,44:C,46:U,48:G,49:W,51:O,55:X,57:F,58:q,63:K,64:J,65:Q,66:m,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(Qt,n,{8:110,45:168}),t(Mt,n,{8:112,47:169}),t(Zt,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 L=new Error(b);throw L.hash=_,L}},parse:function(b){var _=this,L=[0],g=[],S=[null],o=[],yt=this.table,h="",Lt=0,$t=0,Re=2,te=1,De=o.slice.call(arguments,1),B=Object.create(this.lexer),ht={yy:{}};for(var Vt in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Vt)&&(ht.yy[Vt]=this.yy[Vt]);B.setInput(b,ht.yy),ht.yy.lexer=B,ht.yy.parser=this,typeof B.yylloc=="undefined"&&(B.yylloc={});var Ct=B.yylloc;o.push(Ct);var Ve=B.options&&B.options.ranges;typeof ht.yy.parseError=="function"?this.parseError=ht.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Ce(){var nt;return nt=g.pop()||B.lex()||te,typeof nt!="number"&&(nt instanceof Array&&(g=nt,nt=g.pop()),nt=_.symbols_[nt]||nt),nt}for(var z,dt,Z,Ot,ft={},Pt,st,ee,It;;){if(dt=L[L.length-1],this.defaultActions[dt]?Z=this.defaultActions[dt]:((z===null||typeof z=="undefined")&&(z=Ce()),Z=yt[dt]&&yt[dt][z]),typeof Z=="undefined"||!Z.length||!Z[0]){var Bt="";It=[];for(Pt in yt[dt])this.terminals_[Pt]&&Pt>Re&&It.push("'"+this.terminals_[Pt]+"'");B.showPosition?Bt="Parse error on line "+(Lt+1)+`:
`+B.showPosition()+`
Expecting `+It.join(", ")+", got '"+(this.terminals_[z]||z)+"'":Bt="Parse error on line "+(Lt+1)+": Unexpected "+(z==te?"end of input":"'"+(this.terminals_[z]||z)+"'"),this.parseError(Bt,{text:B.match,token:this.terminals_[z]||z,line:B.yylineno,loc:Ct,expected:It})}if(Z[0]instanceof Array&&Z.length>1)throw new Error("Parse Error: multiple actions possible at state: "+dt+", token: "+z);switch(Z[0]){case 1:L.push(z),S.push(B.yytext),o.push(B.yylloc),L.push(Z[1]),z=null,$t=B.yyleng,h=B.yytext,Lt=B.yylineno,Ct=B.yylloc;break;case 2:if(st=this.productions_[Z[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},Ve&&(ft._$.range=[o[o.length-(st||1)].range[0],o[o.length-1].range[1]]),Ot=this.performAction.apply(ft,[h,$t,Lt,ht.yy,Z[1],S,o].concat(De)),typeof Ot!="undefined")return Ot;st&&(L=L.slice(0,-1*st*2),S=S.slice(0,-1*st),o=o.slice(0,-1*st)),L.push(this.productions_[Z[1]][0]),S.push(ft.$),o.push(ft._$),ee=yt[L[L.length-2]][L[L.length-1]],L.push(ee);break;case 3:return!0}}return!0}},Me=function(){var ct={EOF:1,parseError:function(_,L){if(this.yy.parser)this.yy.parser.parseError(_,L);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,L=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),L.length-1&&(this.yylineno-=L.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:L?(L.length===g.length?this.yylloc.first_column:0)+g[g.length-L.length].length-L[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 L,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],L=this.performAction.call(this,this.yy,this,_,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),L)return L;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,_,L,g;this._more||(this.yytext="",this.match="");for(var S=this._currentRules(),o=0;o<S.length;o++)if(L=this._input.match(this.rules[S[o]]),L&&(!_||L[0].length>_[0].length)){if(_=L,g=o,this.options.backtrack_lexer){if(b=this.test_match(L,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(_,L,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 L.yytext=L.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 L.yytext=L.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 ct}();Rt.lexer=Me;function Dt(){this.yy={}}return Dt.prototype=Rt,Rt.Parser=Dt,new Dt}();Wt.parser=Wt;var Ye=Wt,vt,lt={},xt=[],$=[],At=!1,qt,at,Fe=function(t,e,a){Te.parseDirective(this,t,e,a)},We=function(t){xt.push({name:t.text,wrap:t.wrap===void 0&&pt()||!!t.wrap,fill:t.color,actorKeys:[]}),at=xt.slice(-1)[0]},zt=function(t,e,a,i){let s=at,n=lt[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&&a==null)return}(a==null||a.text==null)&&(a={text:e,wrap:null,type:i}),(i==null||a.text==null)&&(a={text:e,wrap:null,type:i}),lt[t]={box:s,name:e,description:a.text,wrap:a.wrap===void 0&&pt()||!!a.wrap,prevActor:vt,links:{},properties:{},actorCnt:null,rectData:null,type:i||"participant"},vt&&lt[vt]&&(lt[vt].nextActor=t),at&&at.actorKeys.push(t),vt=t},qe=t=>{let e,a=0;for(e=0;e<$.length;e++)$[e].type===wt.ACTIVE_START&&$[e].from.actor===t&&a++,$[e].type===wt.ACTIVE_END&&$[e].from.actor===t&&a--;return a},ze=function(t,e,a,i){$.push({from:t,to:e,message:a.text,wrap:a.wrap===void 0&&pt()||!!a.wrap,answer:i})},R=function(t,e,a={text:void 0,wrap:void 0},i){if(i===wt.ACTIVE_END&&qe(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:a.text,wrap:a.wrap===void 0&&pt()||!!a.wrap,type:i}),!0},He=function(){return xt.length>0},Ue=function(){return xt.some(t=>t.name)},Ke=function(){return $},Ge=function(){return xt},Xe=function(){return lt},_t=function(t){return lt[t]},Je=function(){return Object.keys(lt)},Qe=function(){At=!0},Ze=function(){At=!1},je=()=>At,$e=function(t){qt=t},pt=()=>qt!==void 0?qt:rt().sequence.wrap,t0=function(){lt={},xt=[],$=[],At=!1,he()},e0=function(t){let e=t.trim(),a={text:e.replace(/^:?(?:no)?wrap:/,"").trim(),wrap:e.match(/^:?wrap:/)!==null?!0:e.match(/^:?nowrap:/)!==null?!1:void 0};return H.debug("parseMessage:",a),a},i0=function(t){let e=t.match(/^((?:rgba?|hsla?)\s*\(.*\)|\w*)(.*)$/),a=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",a)||(a="transparent",i=t.trim());else{let n=new Option().style;n.color=a,n.color!==a&&(a="transparent",i=t.trim())}return{color:a,text:i!==void 0?mt(i.replace(/^:?(?:no)?wrap:/,""),rt()):void 0,wrap:i!==void 0?i.match(/^:?wrap:/)!==null?!0:i.match(/^:?nowrap:/)!==null?!1:void 0:void 0}},wt={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},s0={FILLED:0,OPEN:1},n0={LEFTOF:0,RIGHTOF:1,OVER:2},Ee=function(t,e,a){a.text,a.wrap===void 0&&pt()||a.wrap;let i=[].concat(t,t);$.push({from:i[0],to:i[1],message:a.text,wrap:a.wrap===void 0&&pt()||!!a.wrap,type:wt.NOTE,placement:e})},be=function(t,e){let a=_t(t);try{let i=mt(e.text,rt());i=i.replace(/&amp;/g,"&"),i=i.replace(/&equals;/g,"=");let s=JSON.parse(i);Gt(a,s)}catch(i){H.error("error while parsing actor link text",i)}},r0=function(t,e){let a=_t(t);try{let c={},l=mt(e.text,rt());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,Gt(a,c)}catch(c){H.error("error while parsing actor link text",c)}};function Gt(t,e){if(t.links==null)t.links=e;else for(let a in e)t.links[a]=e[a]}var me=function(t,e){let a=_t(t);try{let i=mt(e.text,rt()),s=JSON.parse(i);ve(a,s)}catch(i){H.error("error while parsing actor properties text",i)}};function ve(t,e){if(t.properties==null)t.properties=e;else for(let a in e)t.properties[a]=e[a]}function a0(){at=void 0}var we=function(t,e){let a=_t(t),i=document.getElementById(e.text);try{let s=i.innerHTML,n=JSON.parse(s);n.properties&&ve(a,n.properties),n.links&&Gt(a,n.links)}catch(s){H.error("error while parsing actor details text",s)}},o0=function(t,e){if(t!==void 0&&t.properties!==void 0)return t.properties[e]},_e=function(t){if(Array.isArray(t))t.forEach(function(e){_e(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":zt(t.actor,t.actor,t.description,"participant");break;case"addActor":zt(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":Ee(t.actor,t.placement,t.text);break;case"addLinks":be(t.actor,t.text);break;case"addALink":r0(t.actor,t.text);break;case"addProperties":me(t.actor,t.text);break;case"addDetails":we(t.actor,t.text);break;case"addMessage":R(t.from,t.to,t.msg,t.signalType);break;case"boxStart":We(t.boxData);break;case"boxEnd":a0();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":Yt(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}},c0={addActor:zt,addMessage:ze,addSignal:R,addLinks:be,addDetails:we,addProperties:me,autoWrap:pt,setWrap:$e,enableSequenceNumbers:Qe,disableSequenceNumbers:Ze,showSequenceNumbers:je,getMessages:Ke,getActors:Xe,getActor:_t,getActorKeys:Je,getActorProperty:o0,getAccTitle:de,getBoxes:Ge,getDiagramTitle:ge,setDiagramTitle:fe,parseDirective:Fe,getConfig:()=>rt().sequence,clear:t0,parseMessage:e0,parseBoxData:i0,LINETYPE:wt,ARROWTYPE:s0,PLACEMENT:n0,addNote:Ee,setAccTitle:Yt,apply:_e,setAccDescription:pe,getAccDescription:ue,hasAtLeastOneBox:He,hasAtLeastOneBoxWithTitle:Ue},l0=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;
}
`,h0=l0,Xt=function(t,e){return ne(t,e)},ke=(t,e)=>{xe(()=>{let a=document.querySelectorAll(t);a.length!==0&&(a[0].addEventListener("mouseover",function(){f0("actor"+e+"_popup")}),a[0].addEventListener("mouseout",function(){g0("actor"+e+"_popup")}))})},d0=function(t,e,a,i,s){if(e.links===void 0||e.links===null||Object.keys(e.links).length===0)return{height:0,width:0};let n=e.links,c=e.actorCnt,l=e.rectData;var p="none";s&&(p="block !important");let d=t.append("g");d.attr("id","actor"+c+"_popup"),d.attr("class","actorPopupMenu"),d.attr("display",p),ke("#actor"+c+"_popup",c);var T="";l.class!==void 0&&(T=" "+l.class);let y=l.width>a?l.width:a,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 v=d.append("a"),P=(0,Kt.sanitizeUrl)(n[A]);v.attr("xlink:href",P),v.attr("target","_blank"),S0(i)(A,v,l.x+10,l.height+x,y,20,{class:"actor"},i),x+=30}}return u.attr("height",x),{height:l.height+x,width:y}},p0=function(t){return"var pu = document.getElementById('"+t+"'); if (pu != null) { pu.style.display = 'block'; }"},u0=function(t){return"var pu = document.getElementById('"+t+"'); if (pu != null) { pu.style.display = 'none'; }"},f0=function(t){var e=document.getElementById(t);e!=null&&(e.style.display="block")},g0=function(t){var e=document.getElementById(t);e!=null&&(e.style.display="none")},Tt=function(t,e){let a=0,i=0,s=e.text.split(w.lineBreakRegex),[n,c]=Ft(e.fontSize),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+(a+i+e.textMargin)/2);break;case"bottom":case"end":d=()=>Math.round(e.y+(a+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);let u=t.append("text");if(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),e.tspan){let x=u.append("tspan");x.attr("x",e.x),e.fill!==void 0&&x.attr("fill",e.fill),x.text(y)}else u.text(y);e.valign!==void 0&&e.textMargin!==void 0&&e.textMargin>0&&(i+=(u._groups||u)[0][0].getBBox().height,a=i),l.push(u)}return l},Le=function(t,e){function a(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)}let i=t.append("polygon");return i.attr("points",a(e.x,e.y,e.width,e.height,7)),i.attr("class","labelBox"),e.y=e.y+e.height/2,Tt(t,e),i},et=-1,Pe=(t,e)=>{t.selectAll&&t.selectAll(".actor-line").attr("class","200").attr("y2",e-55)},x0=function(t,e,a,i){let 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),ke("#root-"+et,et)));let p=bt();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;let T=Xt(l,p);if(e.rectData=p,e.properties!=null&&e.properties.icon){let u=e.properties.icon.trim();u.charAt(0)==="@"?oe(l,p.x+p.width-20,p.y+10,u.substr(1)):ae(l,p.x+p.width-20,p.y+10,u)}Jt(a)(e.description,l,p.x,p.y,p.width,p.height,{class:"actor"},a);let y=e.height;if(T.node){let u=T.node().getBBox();e.height=u.height,y=u.height}return y},T0=function(t,e,a,i){let 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"));let c=t.append("g");c.attr("class","actor-man");let l=bt();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);let 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);let d=c.node().getBBox();return e.height=d.height,Jt(a)(e.description,c,l.x,l.y+35,l.width,l.height,{class:"actor"},a),e.height},y0=function(t,e,a,i){switch(e.type){case"actor":return T0(t,e,a,i);case"participant":return x0(t,e,a,i)}},E0=function(t,e,a){let s=t.append("g");Ie(s,e),e.name&&Jt(a)(e.name,s,e.x,e.y+(e.textMaxHeight||0)/2,e.width,0,{class:"text"},a),s.lower()},b0=function(t){return t.append("g")},m0=function(t,e,a,i,s){let n=bt(),c=e.anchored;n.x=e.startx,n.y=e.starty,n.class="activation"+s%3,n.width=e.stopx-e.startx,n.height=a-e.starty,Xt(c,n)},v0=function(t,e,a,i){let{boxMargin:s,boxTextMargin:n,labelBoxHeight:c,labelBoxWidth:l,messageFontFamily:p,messageFontSize:d,messageFontWeight:T}=i,y=t.append("g"),u=function(P,A,M,I){return y.append("line").attr("x1",P).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(P){u(e.startx,P.y,e.stopx,P.y).style("stroke-dasharray","3, 3")});let x=Nt();x.text=a,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",Le(y,x),x=Ne(),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 v=Tt(y,x);return e.sectionTitles!==void 0&&e.sectionTitles.forEach(function(P,A){if(P.message){x.text=P.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,v=Tt(y,x);let M=Math.round(v.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},Ie=function(t,e){re(t,e)},w0=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")},_0=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")},k0=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")},L0=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")},P0=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")},I0=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)},N0=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")},Ne=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}},A0=function(){return{x:0,y:0,fill:"#EDF2AE",stroke:"#666",width:100,anchor:"start",height:100,rx:0,ry:0}},Jt=function(){function t(s,n,c,l,p,d,T){let 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){let{actorFontSize:u,actorFontFamily:x,actorFontWeight:v}=y,[P,A]=Ft(u),M=s.split(w.lineBreakRegex);for(let I=0;I<M.length;I++){let Y=I*P-P*(M.length-1)/2,C=n.append("text").attr("x",c+p/2).attr("y",l).style("text-anchor","middle").style("font-size",A).style("font-weight",v).style("font-family",x);C.append("tspan").attr("x",c+p/2).attr("dy",Y).text(M[I]),C.attr("y",l+d/2).attr("dominant-baseline","central").attr("alignment-baseline","central"),i(C,T)}}function a(s,n,c,l,p,d,T,y){let u=n.append("switch"),v=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%");v.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(v,T)}function i(s,n){for(let c in n)n.hasOwnProperty(c)&&s.attr(c,n[c])}return function(s){return s.textPlacement==="fo"?a:s.textPlacement==="old"?t:e}}(),S0=function(){function t(s,n,c,l,p,d,T){let 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){let{actorFontSize:u,actorFontFamily:x,actorFontWeight:v}=y,P=s.split(w.lineBreakRegex);for(let A=0;A<P.length;A++){let M=A*u-u*(P.length-1)/2,I=n.append("text").attr("x",c).attr("y",l).style("text-anchor","start").style("font-size",u).style("font-weight",v).style("font-family",x);I.append("tspan").attr("x",c).attr("dy",M).text(P[A]),I.attr("y",l+d/2).attr("dominant-baseline","central").attr("alignment-baseline","central"),i(I,T)}}function a(s,n,c,l,p,d,T,y){let u=n.append("switch"),v=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%");v.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(v,T)}function i(s,n){for(let c in n)n.hasOwnProperty(c)&&s.attr(c,n[c])}return function(s){return s.textPlacement==="fo"?a:s.textPlacement==="old"?t:e}}(),V={drawRect:Xt,drawText:Tt,drawLabel:Le,drawActor:y0,drawBox:E0,drawPopup:d0,anchorElement:b0,drawActivation:m0,drawLoop:v0,drawBackgroundRect:Ie,insertArrowHead:L0,insertArrowFilledHead:P0,insertSequenceNumber:I0,insertArrowCrossHead:N0,insertDatabaseIcon:w0,insertComputerIcon:_0,insertClockIcon:k0,getTextObj:Ne,getNoteRect:A0,popupMenu:p0,popdownMenu:u0,fixLifeLineHeights:Pe,sanitizeUrl:Kt.sanitizeUrl},r={},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,Se(rt())},updateVal:function(t,e,a,i){t[e]===void 0?t[e]=a:t[e]=i(a,t[e])},updateBounds:function(t,e,a,i){let s=this,n=0;function c(l){return function(d){n++;let T=s.sequenceItems.length-n+1;s.updateVal(d,"starty",e-T*r.boxMargin,Math.min),s.updateVal(d,"stopy",i+T*r.boxMargin,Math.max),s.updateVal(f.data,"startx",t-T*r.boxMargin,Math.min),s.updateVal(f.data,"stopx",a+T*r.boxMargin,Math.max),l!=="activation"&&(s.updateVal(d,"startx",t-T*r.boxMargin,Math.min),s.updateVal(d,"stopx",a+T*r.boxMargin,Math.max),s.updateVal(f.data,"starty",e-T*r.boxMargin,Math.min),s.updateVal(f.data,"stopy",i+T*r.boxMargin,Math.max))}}this.sequenceItems.forEach(c()),this.activations.forEach(c("activation"))},insert:function(t,e,a,i){let s=w.getMin(t,a),n=w.getMax(t,a),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,a){let i=a[t.from.actor],s=St(t.from.actor).length||0,n=i.x+i.width/2+(s-1)*r.activationWidth/2;this.activations.push({startx:n,starty:this.verticalPos+2,stopx:n+r.activationWidth,stopy:void 0,actor:t.from.actor,anchored:V.anchorElement(e)})},endActivation:function(t){let e=this.activations.map(function(a){return a.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){let 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}}},M0=function(t,e){f.bumpVerticalPos(r.boxMargin),e.height=r.boxMargin,e.starty=f.getVerticalPos();let a=bt();a.x=e.startx,a.y=e.starty,a.width=e.width||r.width,a.class="note";let i=t.append("g"),s=V.drawRect(i,a),n=Nt();n.x=e.startx,n.y=e.starty,n.width=a.width,n.dy="1em",n.text=e.message,n.class="noteText",n.fontFamily=r.noteFontFamily,n.fontSize=r.noteFontSize,n.fontWeight=r.noteFontWeight,n.anchor=r.noteAlign,n.textMargin=r.noteMargin,n.valign="center";let 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*r.noteMargin),e.height+=l+2*r.noteMargin,f.bumpVerticalPos(l+2*r.noteMargin),e.stopy=e.starty+l+2*r.noteMargin,e.stopx=e.startx+a.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}),Ht=t=>({fontFamily:t.actorFontFamily,fontSize:t.actorFontSize,fontWeight:t.actorFontWeight});function R0(t,e){f.bumpVerticalPos(10);let{startx:a,stopx:i,message:s}=e,n=w.splitBreaks(s).length,c=D.calculateTextDimensions(s,ut(r)),l=c.height/n;e.height+=l,f.bumpVerticalPos(l);let p,d=c.height-10,T=c.width;if(a===i){p=f.getVerticalPos()+d,r.rightAngles||(d+=r.boxMargin,p=f.getVerticalPos()+d),d+=30;let y=w.getMax(T/2,r.width/2);f.insert(a-y,f.getVerticalPos()-10+d,i+y,f.getVerticalPos()+30+d)}else d+=r.boxMargin,p=f.getVerticalPos()+d,f.insert(a,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}var D0=function(t,e,a,i){let{startx:s,stopx:n,starty:c,message:l,type:p,sequenceIndex:d,sequenceVisible:T}=e,y=D.calculateTextDimensions(l,ut(r)),u=Nt();u.x=s,u.y=c+10,u.width=n-s,u.class="messageText",u.dy="1em",u.text=l,u.fontFamily=r.messageFontFamily,u.fontSize=r.messageFontSize,u.fontWeight=r.messageFontWeight,u.anchor=r.messageAlign,u.valign="center",u.textMargin=r.wrapPadding,u.tspan=!1,Tt(t,u);let x=y.width,v;s===n?r.rightAngles?v=t.append("path").attr("d",`M ${s},${a} H ${s+w.getMax(r.width/2,x/2)} V ${a+25} H ${s}`):v=t.append("path").attr("d","M "+s+","+a+" C "+(s+60)+","+(a-10)+" "+(s+60)+","+(a+30)+" "+s+","+(a+20)):(v=t.append("line"),v.attr("x1",s),v.attr("y1",a),v.attr("x2",n),v.attr("y2",a)),p===i.db.LINETYPE.DOTTED||p===i.db.LINETYPE.DOTTED_CROSS||p===i.db.LINETYPE.DOTTED_POINT||p===i.db.LINETYPE.DOTTED_OPEN?(v.style("stroke-dasharray","3, 3"),v.attr("class","messageLine1")):v.attr("class","messageLine0");let P="";r.arrowMarkerAbsolute&&(P=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,P=P.replace(/\(/g,"\\("),P=P.replace(/\)/g,"\\)")),v.attr("stroke-width",2),v.attr("stroke","none"),v.style("fill","none"),(p===i.db.LINETYPE.SOLID||p===i.db.LINETYPE.DOTTED)&&v.attr("marker-end","url("+P+"#arrowhead)"),(p===i.db.LINETYPE.SOLID_POINT||p===i.db.LINETYPE.DOTTED_POINT)&&v.attr("marker-end","url("+P+"#filled-head)"),(p===i.db.LINETYPE.SOLID_CROSS||p===i.db.LINETYPE.DOTTED_CROSS)&&v.attr("marker-end","url("+P+"#crosshead)"),(T||r.showSequenceNumbers)&&(v.attr("marker-start","url("+P+"#sequencenumber)"),t.append("text").attr("x",s).attr("y",a+4).attr("font-family","sans-serif").attr("font-size","12px").attr("text-anchor","middle").attr("class","sequenceNumber").text(d))},Ut=function(t,e,a,i,s,n,c){if(s.hideUnusedParticipants===!0){let y=new Set;n.forEach(u=>{y.add(u.from),y.add(u.to)}),a=a.filter(u=>y.has(u))}let l=0,p=0,d=0,T;for(let y of a){let u=e[y],x=u.box;T&&T!=x&&(c||f.models.addBox(T),p+=r.boxMargin+T.margin),x&&x!=T&&(c||(x.x=l+p,x.y=i),p+=x.margin),u.width=u.width||r.width,u.height=w.getMax(u.height||r.height,r.height),u.margin=u.margin||r.actorMargin,u.x=l+p,u.y=f.getVerticalPos();let v=V.drawActor(t,u,r,c);d=w.getMax(d,v),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)},Ae=function(t,e,a,i){let s=0,n=0;for(let c of a){let l=e[c],p=O0(l),d=V.drawPopup(t,l,p,r,r.forceMenus,i);d.height>s&&(s=d.height),d.width+l.x>n&&(n=d.width+l.x)}return{maxHeight:s,maxWidth:n}},Se=function(t){ce(r,t),t.fontFamily&&(r.actorFontFamily=r.noteFontFamily=r.messageFontFamily=t.fontFamily),t.fontSize&&(r.actorFontSize=r.noteFontSize=r.messageFontSize=t.fontSize),t.fontWeight&&(r.actorFontWeight=r.noteFontWeight=r.messageFontWeight=t.fontWeight)},St=function(t){return f.activations.filter(function(e){return e.actor===t})},ye=function(t,e){let a=e[t],i=St(t),s=i.reduce(function(c,l){return w.getMin(c,l.startx)},a.x+a.width/2),n=i.reduce(function(c,l){return w.getMax(c,l.stopx)},a.x+a.width/2);return[s,n]};function tt(t,e,a,i,s){f.bumpVerticalPos(a);let n=i;if(e.id&&e.message&&t[e.id]){let c=t[e.id].width,l=ut(r);e.message=D.wrapLabel(`[${e.message}]`,c-2*r.wrapPadding,l),e.width=c,e.wrap=!0;let p=D.calculateTextDimensions(e.message,l),d=w.getMax(p.height,r.labelBoxHeight);n=i+d,H.debug(`${d} - ${e.message}`)}s(e),f.bumpVerticalPos(n)}var V0=function(t,e,a,i){let{securityLevel:s,sequence:n}=rt();r=n,i.db.clear(),i.parser.parse(t);let c;s==="sandbox"&&(c=Et("#i"+e));let l=s==="sandbox"?Et(c.nodes()[0].contentDocument.body):Et("body"),p=s==="sandbox"?c.nodes()[0].contentDocument:document;f.init(),H.debug(i.db);let d=s==="sandbox"?l.select(`[id="${e}"]`):Et(`[id="${e}"]`),T=i.db.getActors(),y=i.db.getBoxes(),u=i.db.getActorKeys(),x=i.db.getMessages(),v=i.db.getDiagramTitle(),P=i.db.hasAtLeastOneBox(),A=i.db.hasAtLeastOneBoxWithTitle(),M=C0(T,x,i);r.height=B0(T,M,y),V.insertComputerIcon(d),V.insertDatabaseIcon(d),V.insertClockIcon(d),P&&(f.bumpVerticalPos(r.boxMargin),A&&f.bumpVerticalPos(y[0].textMaxHeight)),Ut(d,T,u,0,r,x,!1);let I=W0(x,T,M,i);V.insertArrowHead(d),V.insertArrowCrossHead(d),V.insertArrowFilledHead(d),V.insertSequenceNumber(d);function Y(m,E){let j=f.endActivation(m);j.starty+18>E&&(j.starty=E-6,E+=12),V.drawActivation(d,j,E,r,St(m.from.actor).length),f.insert(j.startx,E-10,j.stopx,E)}let C=1,U=1,G=[];x.forEach(function(m){let E,j,k;switch(m.type){case i.db.LINETYPE.NOTE:f.resetVerticalPos(),j=m.noteModel,M0(d,j);break;case i.db.LINETYPE.ACTIVE_START:f.newActivation(m,d,T);break;case i.db.LINETYPE.ACTIVE_END:Y(m,f.getVerticalPos());break;case i.db.LINETYPE.LOOP_START:tt(I,m,r.boxMargin,r.boxMargin+r.boxTextMargin,N=>f.newLoop(N));break;case i.db.LINETYPE.LOOP_END:E=f.endLoop(),V.drawLoop(d,E,"loop",r),f.bumpVerticalPos(E.stopy-f.getVerticalPos()),f.models.addLoop(E);break;case i.db.LINETYPE.RECT_START:tt(I,m,r.boxMargin,r.boxMargin,N=>f.newLoop(void 0,N.message));break;case i.db.LINETYPE.RECT_END:E=f.endLoop(),V.drawBackgroundRect(d,E),f.models.addLoop(E),f.bumpVerticalPos(E.stopy-f.getVerticalPos());break;case i.db.LINETYPE.OPT_START:tt(I,m,r.boxMargin,r.boxMargin+r.boxTextMargin,N=>f.newLoop(N));break;case i.db.LINETYPE.OPT_END:E=f.endLoop(),V.drawLoop(d,E,"opt",r),f.bumpVerticalPos(E.stopy-f.getVerticalPos()),f.models.addLoop(E);break;case i.db.LINETYPE.ALT_START:tt(I,m,r.boxMargin,r.boxMargin+r.boxTextMargin,N=>f.newLoop(N));break;case i.db.LINETYPE.ALT_ELSE:tt(I,m,r.boxMargin+r.boxTextMargin,r.boxMargin,N=>f.addSectionToLoop(N));break;case i.db.LINETYPE.ALT_END:E=f.endLoop(),V.drawLoop(d,E,"alt",r),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,m,r.boxMargin,r.boxMargin+r.boxTextMargin,N=>f.newLoop(N)),f.saveVerticalPos();break;case i.db.LINETYPE.PAR_AND:tt(I,m,r.boxMargin+r.boxTextMargin,r.boxMargin,N=>f.addSectionToLoop(N));break;case i.db.LINETYPE.PAR_END:E=f.endLoop(),V.drawLoop(d,E,"par",r),f.bumpVerticalPos(E.stopy-f.getVerticalPos()),f.models.addLoop(E);break;case i.db.LINETYPE.AUTONUMBER:C=m.message.start||C,U=m.message.step||U,m.message.visible?i.db.enableSequenceNumbers():i.db.disableSequenceNumbers();break;case i.db.LINETYPE.CRITICAL_START:tt(I,m,r.boxMargin,r.boxMargin+r.boxTextMargin,N=>f.newLoop(N));break;case i.db.LINETYPE.CRITICAL_OPTION:tt(I,m,r.boxMargin+r.boxTextMargin,r.boxMargin,N=>f.addSectionToLoop(N));break;case i.db.LINETYPE.CRITICAL_END:E=f.endLoop(),V.drawLoop(d,E,"critical",r),f.bumpVerticalPos(E.stopy-f.getVerticalPos()),f.models.addLoop(E);break;case i.db.LINETYPE.BREAK_START:tt(I,m,r.boxMargin,r.boxMargin+r.boxTextMargin,N=>f.newLoop(N));break;case i.db.LINETYPE.BREAK_END:E=f.endLoop(),V.drawLoop(d,E,"break",r),f.bumpVerticalPos(E.stopy-f.getVerticalPos()),f.models.addLoop(E);break;default:try{f.resetVerticalPos(),k=m.msgModel,k.starty=f.getVerticalPos(),k.sequenceIndex=C,k.sequenceVisible=i.db.showSequenceNumbers();let N=R0(d,k);G.push({messageModel:k,lineStartY:N}),f.models.addMessage(k)}catch(N){H.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(m.type)&&(C=C+U)}),G.forEach(m=>D0(d,m.messageModel,m.lineStartY,i)),r.mirrorActors&&(f.bumpVerticalPos(r.boxMargin*2),Ut(d,T,u,f.getVerticalPos(),r,x,!0),f.bumpVerticalPos(r.boxMargin),Pe(d,f.getVerticalPos())),f.models.boxes.forEach(function(m){m.height=f.getVerticalPos()-m.y,f.insert(m.x,m.y,m.x+m.width,m.height),m.startx=m.x,m.starty=m.y,m.stopx=m.startx+m.width,m.stopy=m.starty+m.height,m.stroke="rgb(0,0,0, 0.5)",V.drawBox(d,m,r)}),P&&f.bumpVerticalPos(r.boxMargin);let W=Ae(d,T,u,p),{bounds:O}=f.getBounds();H.debug("For line height fix Querying: #"+e+" .actor-line"),se("#"+e+" .actor-line").attr("y2",O.stopy);let F=O.stopy-O.starty;F<W.maxHeight&&(F=W.maxHeight);let q=F+2*r.diagramMarginY;r.mirrorActors&&(q=q-r.boxMargin+r.bottomMarginAdj);let K=O.stopx-O.startx;K<W.maxWidth&&(K=W.maxWidth);let J=K+2*r.diagramMarginX;v&&d.append("text").text(v).attr("x",(O.stopx-O.startx)/2-2*r.diagramMarginX).attr("y",-25),le(d,q,J,r.useMaxWidth);let Q=v?40:0;d.attr("viewBox",O.startx-r.diagramMarginX+" -"+(r.diagramMarginY+Q)+" "+J+" "+(q+Q)),H.debug("models:",f.models)};function C0(t,e,a){let i={};return e.forEach(function(s){if(t[s.to]&&t[s.from]){let n=t[s.to];if(s.placement===a.db.PLACEMENT.LEFTOF&&!n.prevActor||s.placement===a.db.PLACEMENT.RIGHTOF&&!n.nextActor)return;let c=s.placement!==void 0,l=!c,p=c?gt(r):ut(r),d=s.wrap?D.wrapLabel(s.message,r.width-2*r.wrapPadding,p):s.message,y=D.calculateTextDimensions(d,p).width+2*r.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===a.db.PLACEMENT.RIGHTOF?i[s.from]=w.getMax(i[s.from]||0,y):s.placement===a.db.PLACEMENT.LEFTOF?i[n.prevActor]=w.getMax(i[n.prevActor]||0,y):s.placement===a.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)))}}),H.debug("maxMessageWidthPerActor:",i),i}var O0=function(t){let e=0,a=Ht(r);for(let i in t.links){let n=D.calculateTextDimensions(i,a).width+2*r.wrapPadding+2*r.boxMargin;e<n&&(e=n)}return e};function B0(t,e,a){let i=0;Object.keys(t).forEach(n=>{let c=t[n];c.wrap&&(c.description=D.wrapLabel(c.description,r.width-2*r.wrapPadding,Ht(r)));let l=D.calculateTextDimensions(c.description,Ht(r));c.width=c.wrap?r.width:w.getMax(r.width,l.width+2*r.wrapPadding),c.height=c.wrap?w.getMax(l.height,r.height):r.height,i=w.getMax(i,c.height)});for(let n in e){let c=t[n];if(!c)continue;let l=t[c.nextActor];if(!l){let y=e[n]+r.actorMargin-c.width/2;c.margin=w.getMax(y,r.actorMargin);continue}let d=e[n]+r.actorMargin-c.width/2-l.width/2;c.margin=w.getMax(d,r.actorMargin)}let s=0;return a.forEach(n=>{let c=ut(r),l=n.actorKeys.reduce((T,y)=>T+=t[y].width+(t[y].margin||0),0);l-=2*r.boxTextMargin,n.wrap&&(n.name=D.wrapLabel(n.name,l-2*r.wrapPadding,c));let p=D.calculateTextDimensions(n.name,c);s=w.getMax(p.height,s);let d=w.getMax(l,p.width+2*r.wrapPadding);if(n.margin=r.boxTextMargin,l<d){let T=(d-l)/2;n.margin+=T}}),a.forEach(n=>n.textMaxHeight=s),w.getMax(i,r.height)}var Y0=function(t,e,a){let i=e[t.from].x,s=e[t.to].x,n=t.wrap&&t.message,c=D.calculateTextDimensions(n?D.wrapLabel(t.message,r.width,gt(r)):t.message,gt(r)),l={width:n?r.width:w.getMax(r.width,c.width+2*r.noteMargin),height:0,startx:e[t.from].x,stopx:0,starty:0,stopy:0,message:t.message};return t.placement===a.db.PLACEMENT.RIGHTOF?(l.width=n?w.getMax(r.width,c.width):w.getMax(e[t.from].width/2+e[t.to].width/2,c.width+2*r.noteMargin),l.startx=i+(e[t.from].width+r.actorMargin)/2):t.placement===a.db.PLACEMENT.LEFTOF?(l.width=n?w.getMax(r.width,c.width+2*r.noteMargin):w.getMax(e[t.from].width/2+e[t.to].width/2,c.width+2*r.noteMargin),l.startx=i-l.width+(e[t.from].width-r.actorMargin)/2):t.to===t.from?(c=D.calculateTextDimensions(n?D.wrapLabel(t.message,w.getMax(r.width,e[t.from].width),gt(r)):t.message,gt(r)),l.width=n?w.getMax(r.width,e[t.from].width):w.getMax(e[t.from].width,r.width,c.width+2*r.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))+r.actorMargin,l.startx=i<s?i+e[t.from].width/2-r.actorMargin/2:s+e[t.to].width/2-r.actorMargin/2),n&&(l.message=D.wrapLabel(t.message,l.width-2*r.wrapPadding,gt(r))),H.debug(`NM:[${l.startx},${l.stopx},${l.starty},${l.stopy}:${l.width},${l.height}=${t.message}]`),l},F0=function(t,e,a){let i=!1;if([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].includes(t.type)&&(i=!0),!i)return{};let s=ye(t.from,e),n=ye(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=D.wrapLabel(t.message,w.getMax(d+2*r.wrapPadding,r.width),ut(r)));let T=D.calculateTextDimensions(t.message,ut(r));return{width:w.getMax(t.wrap?0:T.width+2*r.wrapPadding,d+2*r.wrapPadding,r.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)}},W0=function(t,e,a,i){let s={},n=[],c,l,p;return t.forEach(function(d){switch(d.id=D.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:{let y=e[d.from?d.from.actor:d.to.actor],u=St(d.from?d.from.actor:d.to.actor).length,x=y.x+y.width/2+(u-1)*r.activationWidth/2,v={startx:x,stopx:x+r.activationWidth,actor:d.from.actor,enabled:!0};f.activations.push(v)}break;case i.db.LINETYPE.ACTIVE_END:{let y=f.activations.map(u=>u.actor).lastIndexOf(d.from.actor);delete f.activations.splice(y,1)[0]}break}d.placement!==void 0?(l=Y0(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))-r.labelBoxWidth})):(p=F0(d,e,i),d.msgModel=p,p.startx&&p.stopx&&n.length>0&&n.forEach(y=>{if(c=y,p.startx===p.stopx){let 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))-r.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)-r.labelBoxWidth}))}),f.activations=[],H.debug("Loop type widths:",s),s},q0={bounds:f,drawActors:Ut,drawActorsPopup:Ae,setConf:Se,draw:V0},J0={parser:Ye,db:c0,renderer:q0,styles:h0};export{J0 as diagram};