UNPKG

code-server

Version:

Run VS Code on a remote server.

163 lines • 117 kB
import{a as je}from"./chunk-FKJDPLBD.js";import{a as Xe,b as Je}from"./chunk-LGOKT4X5.js";import{a as Ze,b as $e,d as Yt,e as Wt,f as ht,g as Kt}from"./chunk-VG7CIE7S.js";import{c as Qe,n as ae,p as X}from"./chunk-PKRYIESI.js";import{a as xr}from"./chunk-JBQZ5UCE.js";import{$ as Ge,B as kt,H as Nt,I as Ye,K as Z,L as Ot,M as ee,N as w,O as We,T as Ke,U as re,V as Fe,W as qe,X as He,Y as ze,Z as Ue,_ as $,o as Ve}from"./chunk-VBOJ6TJX.js";import{b as g,d as tt,j as wt}from"./chunk-XDY7PRES.js";import{c as gr}from"./chunk-OOJM4CTU.js";var ce=gr(xr(),1),ie=(function(){var e=g(function(ut,k,v,P){for(v=v||{},P=ut.length;P--;v[ut[P]]=k);return v},"o"),t=[1,2],a=[1,3],r=[1,4],i=[2,4],c=[1,9],s=[1,11],n=[1,12],E=[1,14],T=[1,15],l=[1,17],x=[1,18],u=[1,19],R=[1,25],p=[1,26],f=[1,27],_=[1,28],I=[1,29],O=[1,30],L=[1,31],S=[1,32],A=[1,33],N=[1,34],B=[1,35],V=[1,36],H=[1,37],U=[1,38],G=[1,39],J=[1,40],et=[1,42],z=[1,43],st=[1,44],rt=[1,45],it=[1,46],Y=[1,47],C=[1,4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,48,49,50,51,53,54,56,61,62,63,64,73],Dt=[1,74],m=[1,80],D=[1,81],lt=[1,82],at=[1,83],W=[1,84],le=[1,85],he=[1,86],de=[1,87],Te=[1,88],pe=[1,89],Ee=[1,90],ue=[1,91],fe=[1,92],_e=[1,93],ge=[1,94],xe=[1,95],Ie=[1,96],be=[1,97],ye=[1,98],Re=[1,99],Oe=[1,100],Le=[1,101],me=[1,102],Ae=[1,103],Se=[1,104],ke=[1,105],Ne=[2,78],At=[4,5,17,51,53,54],vt=[4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,51,53,54,56,61,62,63,64,73],we=[4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,50,51,53,54,56,61,62,63,64,73],Gt=[4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,49,51,53,54,56,61,62,63,64,73],Pe=[4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,48,51,53,54,56,61,62,63,64,73],Xt=[5,52],K=[70,71,72,73],ot=[1,151],Jt={trace:g(function(){},"trace"),yy:{},symbols_:{error:2,start:3,SPACE:4,NEWLINE:5,SD:6,document:7,line:8,statement:9,INVALID:10,box_section:11,box_line:12,participant_statement:13,create:14,box:15,restOfLine:16,end:17,signal:18,autonumber:19,NUM:20,off:21,activate:22,actor:23,deactivate:24,note_statement:25,links_statement:26,link_statement:27,properties_statement:28,details_statement:29,title:30,legacy_title:31,acc_title:32,acc_title_value:33,acc_descr:34,acc_descr_value:35,acc_descr_multiline_value:36,loop:37,rect:38,opt:39,alt:40,else_sections:41,par:42,par_sections:43,par_over:44,critical:45,option_sections:46,break:47,option:48,and:49,else:50,participant:51,AS:52,participant_actor:53,destroy:54,actor_with_config:55,note:56,placement:57,text2:58,over:59,actor_pair:60,links:61,link:62,properties:63,details:64,spaceList:65,",":66,left_of:67,right_of:68,signaltype:69,"+":70,"-":71,"()":72,ACTOR:73,config_object:74,CONFIG_START:75,CONFIG_CONTENT:76,CONFIG_END:77,SOLID_OPEN_ARROW:78,DOTTED_OPEN_ARROW:79,SOLID_ARROW:80,SOLID_ARROW_TOP:81,SOLID_ARROW_BOTTOM:82,STICK_ARROW_TOP:83,STICK_ARROW_BOTTOM:84,SOLID_ARROW_TOP_DOTTED:85,SOLID_ARROW_BOTTOM_DOTTED:86,STICK_ARROW_TOP_DOTTED:87,STICK_ARROW_BOTTOM_DOTTED:88,SOLID_ARROW_TOP_REVERSE:89,SOLID_ARROW_BOTTOM_REVERSE:90,STICK_ARROW_TOP_REVERSE:91,STICK_ARROW_BOTTOM_REVERSE:92,SOLID_ARROW_TOP_REVERSE_DOTTED:93,SOLID_ARROW_BOTTOM_REVERSE_DOTTED:94,STICK_ARROW_TOP_REVERSE_DOTTED:95,STICK_ARROW_BOTTOM_REVERSE_DOTTED:96,BIDIRECTIONAL_SOLID_ARROW:97,DOTTED_ARROW:98,BIDIRECTIONAL_DOTTED_ARROW:99,SOLID_CROSS:100,DOTTED_CROSS:101,SOLID_POINT:102,DOTTED_POINT:103,TXT:104,$accept:0,$end:1},terminals_:{2:"error",4:"SPACE",5:"NEWLINE",6:"SD",10:"INVALID",14:"create",15:"box",16:"restOfLine",17:"end",19:"autonumber",20:"NUM",21:"off",22:"activate",24:"deactivate",30:"title",31:"legacy_title",32:"acc_title",33:"acc_title_value",34:"acc_descr",35:"acc_descr_value",36:"acc_descr_multiline_value",37:"loop",38:"rect",39:"opt",40:"alt",42:"par",44:"par_over",45:"critical",47:"break",48:"option",49:"and",50:"else",51:"participant",52:"AS",53:"participant_actor",54:"destroy",56:"note",59:"over",61:"links",62:"link",63:"properties",64:"details",66:",",67:"left_of",68:"right_of",70:"+",71:"-",72:"()",73:"ACTOR",75:"CONFIG_START",76:"CONFIG_CONTENT",77:"CONFIG_END",78:"SOLID_OPEN_ARROW",79:"DOTTED_OPEN_ARROW",80:"SOLID_ARROW",81:"SOLID_ARROW_TOP",82:"SOLID_ARROW_BOTTOM",83:"STICK_ARROW_TOP",84:"STICK_ARROW_BOTTOM",85:"SOLID_ARROW_TOP_DOTTED",86:"SOLID_ARROW_BOTTOM_DOTTED",87:"STICK_ARROW_TOP_DOTTED",88:"STICK_ARROW_BOTTOM_DOTTED",89:"SOLID_ARROW_TOP_REVERSE",90:"SOLID_ARROW_BOTTOM_REVERSE",91:"STICK_ARROW_TOP_REVERSE",92:"STICK_ARROW_BOTTOM_REVERSE",93:"SOLID_ARROW_TOP_REVERSE_DOTTED",94:"SOLID_ARROW_BOTTOM_REVERSE_DOTTED",95:"STICK_ARROW_TOP_REVERSE_DOTTED",96:"STICK_ARROW_BOTTOM_REVERSE_DOTTED",97:"BIDIRECTIONAL_SOLID_ARROW",98:"DOTTED_ARROW",99:"BIDIRECTIONAL_DOTTED_ARROW",100:"SOLID_CROSS",101:"DOTTED_CROSS",102:"SOLID_POINT",103:"DOTTED_POINT",104:"TXT"},productions_:[0,[3,2],[3,2],[3,2],[7,0],[7,2],[8,2],[8,1],[8,1],[8,1],[11,0],[11,2],[12,2],[12,1],[12,1],[9,1],[9,2],[9,4],[9,2],[9,4],[9,3],[9,3],[9,2],[9,3],[9,3],[9,2],[9,2],[9,2],[9,2],[9,2],[9,1],[9,1],[9,2],[9,2],[9,1],[9,4],[9,4],[9,4],[9,4],[9,4],[9,4],[9,4],[9,4],[46,1],[46,4],[43,1],[43,4],[41,1],[41,4],[13,5],[13,3],[13,5],[13,3],[13,3],[13,5],[13,3],[13,5],[13,3],[25,4],[25,4],[26,3],[27,3],[28,3],[29,3],[65,2],[65,1],[60,3],[60,1],[57,1],[57,1],[18,5],[18,5],[18,5],[18,5],[18,6],[18,4],[55,2],[74,3],[23,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[58,1]],performAction:g(function(k,v,P,b,F,o,St){var d=o.length-1;switch(F){case 3:return b.apply(o[d]),o[d];break;case 4:case 10:this.$=[];break;case 5:case 11:o[d-1].push(o[d]),this.$=o[d-1];break;case 6:case 7:case 12:case 13:this.$=o[d];break;case 8:case 9:case 14:this.$=[];break;case 16:o[d].type="createParticipant",this.$=o[d];break;case 17:o[d-1].unshift({type:"boxStart",boxData:b.parseBoxData(o[d-2])}),o[d-1].push({type:"boxEnd",boxText:o[d-2]}),this.$=o[d-1];break;case 19:this.$={type:"sequenceIndex",sequenceIndex:Number(o[d-2]),sequenceIndexStep:Number(o[d-1]),sequenceVisible:!0,signalType:b.LINETYPE.AUTONUMBER};break;case 20:this.$={type:"sequenceIndex",sequenceIndex:Number(o[d-1]),sequenceIndexStep:1,sequenceVisible:!0,signalType:b.LINETYPE.AUTONUMBER};break;case 21:this.$={type:"sequenceIndex",sequenceVisible:!1,signalType:b.LINETYPE.AUTONUMBER};break;case 22:this.$={type:"sequenceIndex",sequenceVisible:!0,signalType:b.LINETYPE.AUTONUMBER};break;case 23:this.$={type:"activeStart",signalType:b.LINETYPE.ACTIVE_START,actor:o[d-1].actor};break;case 24:this.$={type:"activeEnd",signalType:b.LINETYPE.ACTIVE_END,actor:o[d-1].actor};break;case 30:b.setDiagramTitle(o[d].substring(6)),this.$=o[d].substring(6);break;case 31:b.setDiagramTitle(o[d].substring(7)),this.$=o[d].substring(7);break;case 32:this.$=o[d].trim(),b.setAccTitle(this.$);break;case 33:case 34:this.$=o[d].trim(),b.setAccDescription(this.$);break;case 35:o[d-1].unshift({type:"loopStart",loopText:b.parseMessage(o[d-2]),signalType:b.LINETYPE.LOOP_START}),o[d-1].push({type:"loopEnd",loopText:o[d-2],signalType:b.LINETYPE.LOOP_END}),this.$=o[d-1];break;case 36:o[d-1].unshift({type:"rectStart",color:b.parseMessage(o[d-2]),signalType:b.LINETYPE.RECT_START}),o[d-1].push({type:"rectEnd",color:b.parseMessage(o[d-2]),signalType:b.LINETYPE.RECT_END}),this.$=o[d-1];break;case 37:o[d-1].unshift({type:"optStart",optText:b.parseMessage(o[d-2]),signalType:b.LINETYPE.OPT_START}),o[d-1].push({type:"optEnd",optText:b.parseMessage(o[d-2]),signalType:b.LINETYPE.OPT_END}),this.$=o[d-1];break;case 38:o[d-1].unshift({type:"altStart",altText:b.parseMessage(o[d-2]),signalType:b.LINETYPE.ALT_START}),o[d-1].push({type:"altEnd",signalType:b.LINETYPE.ALT_END}),this.$=o[d-1];break;case 39:o[d-1].unshift({type:"parStart",parText:b.parseMessage(o[d-2]),signalType:b.LINETYPE.PAR_START}),o[d-1].push({type:"parEnd",signalType:b.LINETYPE.PAR_END}),this.$=o[d-1];break;case 40:o[d-1].unshift({type:"parStart",parText:b.parseMessage(o[d-2]),signalType:b.LINETYPE.PAR_OVER_START}),o[d-1].push({type:"parEnd",signalType:b.LINETYPE.PAR_END}),this.$=o[d-1];break;case 41:o[d-1].unshift({type:"criticalStart",criticalText:b.parseMessage(o[d-2]),signalType:b.LINETYPE.CRITICAL_START}),o[d-1].push({type:"criticalEnd",signalType:b.LINETYPE.CRITICAL_END}),this.$=o[d-1];break;case 42:o[d-1].unshift({type:"breakStart",breakText:b.parseMessage(o[d-2]),signalType:b.LINETYPE.BREAK_START}),o[d-1].push({type:"breakEnd",optText:b.parseMessage(o[d-2]),signalType:b.LINETYPE.BREAK_END}),this.$=o[d-1];break;case 44:this.$=o[d-3].concat([{type:"option",optionText:b.parseMessage(o[d-1]),signalType:b.LINETYPE.CRITICAL_OPTION},o[d]]);break;case 46:this.$=o[d-3].concat([{type:"and",parText:b.parseMessage(o[d-1]),signalType:b.LINETYPE.PAR_AND},o[d]]);break;case 48:this.$=o[d-3].concat([{type:"else",altText:b.parseMessage(o[d-1]),signalType:b.LINETYPE.ALT_ELSE},o[d]]);break;case 49:o[d-3].draw="participant",o[d-3].type="addParticipant",o[d-3].description=b.parseMessage(o[d-1]),this.$=o[d-3];break;case 50:o[d-1].draw="participant",o[d-1].type="addParticipant",this.$=o[d-1];break;case 51:o[d-3].draw="actor",o[d-3].type="addParticipant",o[d-3].description=b.parseMessage(o[d-1]),this.$=o[d-3];break;case 52:case 57:o[d-1].draw="actor",o[d-1].type="addParticipant",this.$=o[d-1];break;case 53:o[d-1].type="destroyParticipant",this.$=o[d-1];break;case 54:o[d-3].draw="participant",o[d-3].type="addParticipant",o[d-3].description=b.parseMessage(o[d-1]),this.$=o[d-3];break;case 55:o[d-1].draw="participant",o[d-1].type="addParticipant",this.$=o[d-1];break;case 56:o[d-3].draw="actor",o[d-3].type="addParticipant",o[d-3].description=b.parseMessage(o[d-1]),this.$=o[d-3];break;case 58:this.$=[o[d-1],{type:"addNote",placement:o[d-2],actor:o[d-1].actor,text:o[d]}];break;case 59:o[d-2]=[].concat(o[d-1],o[d-1]).slice(0,2),o[d-2][0]=o[d-2][0].actor,o[d-2][1]=o[d-2][1].actor,this.$=[o[d-1],{type:"addNote",placement:b.PLACEMENT.OVER,actor:o[d-2].slice(0,2),text:o[d]}];break;case 60:this.$=[o[d-1],{type:"addLinks",actor:o[d-1].actor,text:o[d]}];break;case 61:this.$=[o[d-1],{type:"addALink",actor:o[d-1].actor,text:o[d]}];break;case 62:this.$=[o[d-1],{type:"addProperties",actor:o[d-1].actor,text:o[d]}];break;case 63:this.$=[o[d-1],{type:"addDetails",actor:o[d-1].actor,text:o[d]}];break;case 66:this.$=[o[d-2],o[d]];break;case 67:this.$=o[d];break;case 68:this.$=b.PLACEMENT.LEFTOF;break;case 69:this.$=b.PLACEMENT.RIGHTOF;break;case 70:this.$=[o[d-4],o[d-1],{type:"addMessage",from:o[d-4].actor,to:o[d-1].actor,signalType:o[d-3],msg:o[d],activate:!0},{type:"activeStart",signalType:b.LINETYPE.ACTIVE_START,actor:o[d-1].actor}];break;case 71:this.$=[o[d-4],o[d-1],{type:"addMessage",from:o[d-4].actor,to:o[d-1].actor,signalType:o[d-3],msg:o[d]},{type:"activeEnd",signalType:b.LINETYPE.ACTIVE_END,actor:o[d-4].actor}];break;case 72:this.$=[o[d-4],o[d-1],{type:"addMessage",from:o[d-4].actor,to:o[d-1].actor,signalType:o[d-3],msg:o[d],activate:!0,centralConnection:b.LINETYPE.CENTRAL_CONNECTION},{type:"centralConnection",signalType:b.LINETYPE.CENTRAL_CONNECTION,actor:o[d-1].actor}];break;case 73:this.$=[o[d-4],o[d-1],{type:"addMessage",from:o[d-4].actor,to:o[d-1].actor,signalType:o[d-2],msg:o[d],activate:!1,centralConnection:b.LINETYPE.CENTRAL_CONNECTION_REVERSE},{type:"centralConnectionReverse",signalType:b.LINETYPE.CENTRAL_CONNECTION_REVERSE,actor:o[d-4].actor}];break;case 74:this.$=[o[d-5],o[d-1],{type:"addMessage",from:o[d-5].actor,to:o[d-1].actor,signalType:o[d-3],msg:o[d],activate:!0,centralConnection:b.LINETYPE.CENTRAL_CONNECTION_DUAL},{type:"centralConnection",signalType:b.LINETYPE.CENTRAL_CONNECTION,actor:o[d-1].actor},{type:"centralConnectionReverse",signalType:b.LINETYPE.CENTRAL_CONNECTION_REVERSE,actor:o[d-5].actor}];break;case 75:this.$=[o[d-3],o[d-1],{type:"addMessage",from:o[d-3].actor,to:o[d-1].actor,signalType:o[d-2],msg:o[d]}];break;case 76:this.$={type:"addParticipant",actor:o[d-1],config:o[d]};break;case 77:this.$=o[d-1].trim();break;case 78:this.$={type:"addParticipant",actor:o[d]};break;case 79:this.$=b.LINETYPE.SOLID_OPEN;break;case 80:this.$=b.LINETYPE.DOTTED_OPEN;break;case 81:this.$=b.LINETYPE.SOLID;break;case 82:this.$=b.LINETYPE.SOLID_TOP;break;case 83:this.$=b.LINETYPE.SOLID_BOTTOM;break;case 84:this.$=b.LINETYPE.STICK_TOP;break;case 85:this.$=b.LINETYPE.STICK_BOTTOM;break;case 86:this.$=b.LINETYPE.SOLID_TOP_DOTTED;break;case 87:this.$=b.LINETYPE.SOLID_BOTTOM_DOTTED;break;case 88:this.$=b.LINETYPE.STICK_TOP_DOTTED;break;case 89:this.$=b.LINETYPE.STICK_BOTTOM_DOTTED;break;case 90:this.$=b.LINETYPE.SOLID_ARROW_TOP_REVERSE;break;case 91:this.$=b.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE;break;case 92:this.$=b.LINETYPE.STICK_ARROW_TOP_REVERSE;break;case 93:this.$=b.LINETYPE.STICK_ARROW_BOTTOM_REVERSE;break;case 94:this.$=b.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED;break;case 95:this.$=b.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED;break;case 96:this.$=b.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED;break;case 97:this.$=b.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED;break;case 98:this.$=b.LINETYPE.BIDIRECTIONAL_SOLID;break;case 99:this.$=b.LINETYPE.DOTTED;break;case 100:this.$=b.LINETYPE.BIDIRECTIONAL_DOTTED;break;case 101:this.$=b.LINETYPE.SOLID_CROSS;break;case 102:this.$=b.LINETYPE.DOTTED_CROSS;break;case 103:this.$=b.LINETYPE.SOLID_POINT;break;case 104:this.$=b.LINETYPE.DOTTED_POINT;break;case 105:this.$=b.parseMessage(o[d].trim().substring(1));break}},"anonymous"),table:[{3:1,4:t,5:a,6:r},{1:[3]},{3:5,4:t,5:a,6:r},{3:6,4:t,5:a,6:r},e([1,4,5,10,14,15,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,51,53,54,56,61,62,63,64,73],i,{7:7}),{1:[2,1]},{1:[2,2]},{1:[2,3],4:c,5:s,8:8,9:10,10:n,13:13,14:E,15:T,18:16,19:l,22:x,23:41,24:u,25:20,26:21,27:22,28:23,29:24,30:R,31:p,32:f,34:_,36:I,37:O,38:L,39:S,40:A,42:N,44:B,45:V,47:H,51:U,53:G,54:J,56:et,61:z,62:st,63:rt,64:it,73:Y},e(C,[2,5]),{9:48,13:13,14:E,15:T,18:16,19:l,22:x,23:41,24:u,25:20,26:21,27:22,28:23,29:24,30:R,31:p,32:f,34:_,36:I,37:O,38:L,39:S,40:A,42:N,44:B,45:V,47:H,51:U,53:G,54:J,56:et,61:z,62:st,63:rt,64:it,73:Y},e(C,[2,7]),e(C,[2,8]),e(C,[2,9]),e(C,[2,15]),{13:49,51:U,53:G,54:J},{16:[1,50]},{5:[1,51]},{5:[1,54],20:[1,52],21:[1,53]},{23:55,73:Y},{23:56,73:Y},{5:[1,57]},{5:[1,58]},{5:[1,59]},{5:[1,60]},{5:[1,61]},e(C,[2,30]),e(C,[2,31]),{33:[1,62]},{35:[1,63]},e(C,[2,34]),{16:[1,64]},{16:[1,65]},{16:[1,66]},{16:[1,67]},{16:[1,68]},{16:[1,69]},{16:[1,70]},{16:[1,71]},{23:72,55:73,73:Dt},{23:75,55:76,73:Dt},{23:77,73:Y},{69:78,72:[1,79],78:m,79:D,80:lt,81:at,82:W,83:le,84:he,85:de,86:Te,87:pe,88:Ee,89:ue,90:fe,91:_e,92:ge,93:xe,94:Ie,95:be,96:ye,97:Re,98:Oe,99:Le,100:me,101:Ae,102:Se,103:ke},{57:106,59:[1,107],67:[1,108],68:[1,109]},{23:110,73:Y},{23:111,73:Y},{23:112,73:Y},{23:113,73:Y},e([5,66,72,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104],Ne),e(C,[2,6]),e(C,[2,16]),e(At,[2,10],{11:114}),e(C,[2,18]),{5:[1,116],20:[1,115]},{5:[1,117]},e(C,[2,22]),{5:[1,118]},{5:[1,119]},e(C,[2,25]),e(C,[2,26]),e(C,[2,27]),e(C,[2,28]),e(C,[2,29]),e(C,[2,32]),e(C,[2,33]),e(vt,i,{7:120}),e(vt,i,{7:121}),e(vt,i,{7:122}),e(we,i,{41:123,7:124}),e(Gt,i,{43:125,7:126}),e(Gt,i,{7:126,43:127}),e(Pe,i,{46:128,7:129}),e(vt,i,{7:130}),{5:[1,132],52:[1,131]},{5:[1,134],52:[1,133]},e(Xt,Ne,{74:135,75:[1,136]}),{5:[1,138],52:[1,137]},{5:[1,140],52:[1,139]},{5:[1,141]},{23:145,70:[1,142],71:[1,143],72:[1,144],73:Y},{69:146,78:m,79:D,80:lt,81:at,82:W,83:le,84:he,85:de,86:Te,87:pe,88:Ee,89:ue,90:fe,91:_e,92:ge,93:xe,94:Ie,95:be,96:ye,97:Re,98:Oe,99:Le,100:me,101:Ae,102:Se,103:ke},e(K,[2,79]),e(K,[2,80]),e(K,[2,81]),e(K,[2,82]),e(K,[2,83]),e(K,[2,84]),e(K,[2,85]),e(K,[2,86]),e(K,[2,87]),e(K,[2,88]),e(K,[2,89]),e(K,[2,90]),e(K,[2,91]),e(K,[2,92]),e(K,[2,93]),e(K,[2,94]),e(K,[2,95]),e(K,[2,96]),e(K,[2,97]),e(K,[2,98]),e(K,[2,99]),e(K,[2,100]),e(K,[2,101]),e(K,[2,102]),e(K,[2,103]),e(K,[2,104]),{23:147,73:Y},{23:149,60:148,73:Y},{73:[2,68]},{73:[2,69]},{58:150,104:ot},{58:152,104:ot},{58:153,104:ot},{58:154,104:ot},{4:[1,157],5:[1,159],12:156,13:158,17:[1,155],51:U,53:G,54:J},{5:[1,160]},e(C,[2,20]),e(C,[2,21]),e(C,[2,23]),e(C,[2,24]),{4:c,5:s,8:8,9:10,10:n,13:13,14:E,15:T,17:[1,161],18:16,19:l,22:x,23:41,24:u,25:20,26:21,27:22,28:23,29:24,30:R,31:p,32:f,34:_,36:I,37:O,38:L,39:S,40:A,42:N,44:B,45:V,47:H,51:U,53:G,54:J,56:et,61:z,62:st,63:rt,64:it,73:Y},{4:c,5:s,8:8,9:10,10:n,13:13,14:E,15:T,17:[1,162],18:16,19:l,22:x,23:41,24:u,25:20,26:21,27:22,28:23,29:24,30:R,31:p,32:f,34:_,36:I,37:O,38:L,39:S,40:A,42:N,44:B,45:V,47:H,51:U,53:G,54:J,56:et,61:z,62:st,63:rt,64:it,73:Y},{4:c,5:s,8:8,9:10,10:n,13:13,14:E,15:T,17:[1,163],18:16,19:l,22:x,23:41,24:u,25:20,26:21,27:22,28:23,29:24,30:R,31:p,32:f,34:_,36:I,37:O,38:L,39:S,40:A,42:N,44:B,45:V,47:H,51:U,53:G,54:J,56:et,61:z,62:st,63:rt,64:it,73:Y},{17:[1,164]},{4:c,5:s,8:8,9:10,10:n,13:13,14:E,15:T,17:[2,47],18:16,19:l,22:x,23:41,24:u,25:20,26:21,27:22,28:23,29:24,30:R,31:p,32:f,34:_,36:I,37:O,38:L,39:S,40:A,42:N,44:B,45:V,47:H,50:[1,165],51:U,53:G,54:J,56:et,61:z,62:st,63:rt,64:it,73:Y},{17:[1,166]},{4:c,5:s,8:8,9:10,10:n,13:13,14:E,15:T,17:[2,45],18:16,19:l,22:x,23:41,24:u,25:20,26:21,27:22,28:23,29:24,30:R,31:p,32:f,34:_,36:I,37:O,38:L,39:S,40:A,42:N,44:B,45:V,47:H,49:[1,167],51:U,53:G,54:J,56:et,61:z,62:st,63:rt,64:it,73:Y},{17:[1,168]},{17:[1,169]},{4:c,5:s,8:8,9:10,10:n,13:13,14:E,15:T,17:[2,43],18:16,19:l,22:x,23:41,24:u,25:20,26:21,27:22,28:23,29:24,30:R,31:p,32:f,34:_,36:I,37:O,38:L,39:S,40:A,42:N,44:B,45:V,47:H,48:[1,170],51:U,53:G,54:J,56:et,61:z,62:st,63:rt,64:it,73:Y},{4:c,5:s,8:8,9:10,10:n,13:13,14:E,15:T,17:[1,171],18:16,19:l,22:x,23:41,24:u,25:20,26:21,27:22,28:23,29:24,30:R,31:p,32:f,34:_,36:I,37:O,38:L,39:S,40:A,42:N,44:B,45:V,47:H,51:U,53:G,54:J,56:et,61:z,62:st,63:rt,64:it,73:Y},{16:[1,172]},e(C,[2,50]),{16:[1,173]},e(C,[2,55]),e(Xt,[2,76]),{76:[1,174]},{16:[1,175]},e(C,[2,52]),{16:[1,176]},e(C,[2,57]),e(C,[2,53]),{23:177,73:Y},{23:178,73:Y},{23:179,73:Y},{58:180,104:ot},{23:181,72:[1,182],73:Y},{58:183,104:ot},{58:184,104:ot},{66:[1,185],104:[2,67]},{5:[2,60]},{5:[2,105]},{5:[2,61]},{5:[2,62]},{5:[2,63]},e(C,[2,17]),e(At,[2,11]),{13:186,51:U,53:G,54:J},e(At,[2,13]),e(At,[2,14]),e(C,[2,19]),e(C,[2,35]),e(C,[2,36]),e(C,[2,37]),e(C,[2,38]),{16:[1,187]},e(C,[2,39]),{16:[1,188]},e(C,[2,40]),e(C,[2,41]),{16:[1,189]},e(C,[2,42]),{5:[1,190]},{5:[1,191]},{77:[1,192]},{5:[1,193]},{5:[1,194]},{58:195,104:ot},{58:196,104:ot},{58:197,104:ot},{5:[2,75]},{58:198,104:ot},{23:199,73:Y},{5:[2,58]},{5:[2,59]},{23:200,73:Y},e(At,[2,12]),e(we,i,{7:124,41:201}),e(Gt,i,{7:126,43:202}),e(Pe,i,{7:129,46:203}),e(C,[2,49]),e(C,[2,54]),e(Xt,[2,77]),e(C,[2,51]),e(C,[2,56]),{5:[2,70]},{5:[2,71]},{5:[2,72]},{5:[2,73]},{58:204,104:ot},{104:[2,66]},{17:[2,48]},{17:[2,46]},{17:[2,44]},{5:[2,74]}],defaultActions:{5:[2,1],6:[2,2],108:[2,68],109:[2,69],150:[2,60],151:[2,105],152:[2,61],153:[2,62],154:[2,63],180:[2,75],183:[2,58],184:[2,59],195:[2,70],196:[2,71],197:[2,72],198:[2,73],200:[2,66],201:[2,48],202:[2,46],203:[2,44],204:[2,74]},parseError:g(function(k,v){if(v.recoverable)this.trace(k);else{var P=new Error(k);throw P.hash=v,P}},"parseError"),parse:g(function(k){var v=this,P=[0],b=[],F=[null],o=[],St=this.table,d="",Mt=0,De=0,ve=0,Er=2,Ce=1,ur=o.slice.call(arguments,1),Q=Object.create(this.lexer),gt={yy:{}};for(var Qt in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Qt)&&(gt.yy[Qt]=this.yy[Qt]);Q.setInput(k,gt.yy),gt.yy.lexer=Q,gt.yy.parser=this,typeof Q.yylloc>"u"&&(Q.yylloc={});var Zt=Q.yylloc;o.push(Zt);var fr=Q.options&&Q.options.ranges;typeof gt.yy.parseError=="function"?this.parseError=gt.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function _r(nt){P.length=P.length-2*nt,F.length=F.length-nt,o.length=o.length-nt}g(_r,"popStack");function Me(){var nt;return nt=b.pop()||Q.lex()||Ce,typeof nt!="number"&&(nt instanceof Array&&(b=nt,nt=b.pop()),nt=v.symbols_[nt]||nt),nt}g(Me,"lex");for(var j,$t,xt,ct,Ea,jt,Rt={},Bt,Tt,Be,Vt;;){if(xt=P[P.length-1],this.defaultActions[xt]?ct=this.defaultActions[xt]:((j===null||typeof j>"u")&&(j=Me()),ct=St[xt]&&St[xt][j]),typeof ct>"u"||!ct.length||!ct[0]){var te="";Vt=[];for(Bt in St[xt])this.terminals_[Bt]&&Bt>Er&&Vt.push("'"+this.terminals_[Bt]+"'");Q.showPosition?te="Parse error on line "+(Mt+1)+`:
`+Q.showPosition()+`
Expecting `+Vt.join(", ")+", got '"+(this.terminals_[j]||j)+"'":te="Parse error on line "+(Mt+1)+": Unexpected "+(j==Ce?"end of input":"'"+(this.terminals_[j]||j)+"'"),this.parseError(te,{text:Q.match,token:this.terminals_[j]||j,line:Q.yylineno,loc:Zt,expected:Vt})}if(ct[0]instanceof Array&&ct.length>1)throw new Error("Parse Error: multiple actions possible at state: "+xt+", token: "+j);switch(ct[0]){case 1:P.push(j),F.push(Q.yytext),o.push(Q.yylloc),P.push(ct[1]),j=null,$t?(j=$t,$t=null):(De=Q.yyleng,d=Q.yytext,Mt=Q.yylineno,Zt=Q.yylloc,ve>0&&ve--);break;case 2:if(Tt=this.productions_[ct[1]][1],Rt.$=F[F.length-Tt],Rt._$={first_line:o[o.length-(Tt||1)].first_line,last_line:o[o.length-1].last_line,first_column:o[o.length-(Tt||1)].first_column,last_column:o[o.length-1].last_column},fr&&(Rt._$.range=[o[o.length-(Tt||1)].range[0],o[o.length-1].range[1]]),jt=this.performAction.apply(Rt,[d,De,Mt,gt.yy,ct[1],F,o].concat(ur)),typeof jt<"u")return jt;Tt&&(P=P.slice(0,-1*Tt*2),F=F.slice(0,-1*Tt),o=o.slice(0,-1*Tt)),P.push(this.productions_[ct[1]][0]),F.push(Rt.$),o.push(Rt._$),Be=St[P[P.length-2]][P[P.length-1]],P.push(Be);break;case 3:return!0}}return!0},"parse")},pr=(function(){var ut={EOF:1,parseError:g(function(v,P){if(this.yy.parser)this.yy.parser.parseError(v,P);else throw new Error(v)},"parseError"),setInput:g(function(k,v){return this.yy=v||this.yy||{},this._input=k,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:g(function(){var k=this._input[0];this.yytext+=k,this.yyleng++,this.offset++,this.match+=k,this.matched+=k;var v=k.match(/(?:\r\n?|\n).*/g);return v?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),k},"input"),unput:g(function(k){var v=k.length,P=k.split(/(?:\r\n?|\n)/g);this._input=k+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-v),this.offset-=v;var b=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 F=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===b.length?this.yylloc.first_column:0)+b[b.length-P.length].length-P[0].length:this.yylloc.first_column-v},this.options.ranges&&(this.yylloc.range=[F[0],F[0]+this.yyleng-v]),this.yyleng=this.yytext.length,this},"unput"),more:g(function(){return this._more=!0,this},"more"),reject:g(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},"reject"),less:g(function(k){this.unput(this.match.slice(k))},"less"),pastInput:g(function(){var k=this.matched.substr(0,this.matched.length-this.match.length);return(k.length>20?"...":"")+k.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:g(function(){var k=this.match;return k.length<20&&(k+=this._input.substr(0,20-k.length)),(k.substr(0,20)+(k.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:g(function(){var k=this.pastInput(),v=new Array(k.length+1).join("-");return k+this.upcomingInput()+`
`+v+"^"},"showPosition"),test_match:g(function(k,v){var P,b,F;if(this.options.backtrack_lexer&&(F={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&&(F.yylloc.range=this.yylloc.range.slice(0))),b=k[0].match(/(?:\r\n?|\n).*/g),b&&(this.yylineno+=b.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:b?b[b.length-1].length-b[b.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+k[0].length},this.yytext+=k[0],this.match+=k[0],this.matches=k,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(k[0].length),this.matched+=k[0],P=this.performAction.call(this,this.yy,this,v,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),P)return P;if(this._backtrack){for(var o in F)this[o]=F[o];return!1}return!1},"test_match"),next:g(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var k,v,P,b;this._more||(this.yytext="",this.match="");for(var F=this._currentRules(),o=0;o<F.length;o++)if(P=this._input.match(this.rules[F[o]]),P&&(!v||P[0].length>v[0].length)){if(v=P,b=o,this.options.backtrack_lexer){if(k=this.test_match(P,F[o]),k!==!1)return k;if(this._backtrack){v=!1;continue}else return!1}else if(!this.options.flex)break}return v?(k=this.test_match(v,F[b]),k!==!1?k:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text.
`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:g(function(){var v=this.next();return v||this.lex()},"lex"),begin:g(function(v){this.conditionStack.push(v)},"begin"),popState:g(function(){var v=this.conditionStack.length-1;return v>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:g(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:g(function(v){return v=this.conditionStack.length-1-Math.abs(v||0),v>=0?this.conditionStack[v]:"INITIAL"},"topState"),pushState:g(function(v){this.begin(v)},"pushState"),stateStackSize:g(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:g(function(v,P,b,F){var o=F;switch(b){case 0:return 5;case 1:break;case 2:break;case 3:break;case 4:break;case 5:break;case 6:return 20;case 7:return this.begin("CONFIG"),75;break;case 8:return 76;case 9:return this.popState(),this.begin("ALIAS"),77;break;case 10:return this.popState(),this.popState(),77;break;case 11:return P.yytext=P.yytext.trim(),73;break;case 12:return P.yytext=P.yytext.trim(),this.begin("ALIAS"),73;break;case 13:return P.yytext=P.yytext.trim(),this.popState(),73;break;case 14:return this.popState(),10;break;case 15:return P.yytext=P.yytext.trim(),this.popState(),10;break;case 16:return this.begin("LINE"),15;break;case 17:return this.begin("ID"),51;break;case 18:return this.begin("ID"),53;break;case 19:return 14;case 20:return this.begin("ID"),54;break;case 21:return this.popState(),this.popState(),this.begin("LINE"),52;break;case 22:return this.popState(),this.popState(),5;break;case 23:return this.begin("LINE"),37;break;case 24:return this.begin("LINE"),38;break;case 25:return this.begin("LINE"),39;break;case 26:return this.begin("LINE"),40;break;case 27:return this.begin("LINE"),50;break;case 28:return this.begin("LINE"),42;break;case 29:return this.begin("LINE"),44;break;case 30:return this.begin("LINE"),49;break;case 31:return this.begin("LINE"),45;break;case 32:return this.begin("LINE"),48;break;case 33:return this.begin("LINE"),47;break;case 34:return this.popState(),16;break;case 35:return 17;case 36:return 67;case 37:return 68;case 38:return 61;case 39:return 62;case 40:return 63;case 41:return 64;case 42:return 59;case 43:return 56;case 44:return this.begin("ID"),22;break;case 45:return this.begin("ID"),24;break;case 46:return 30;case 47:return 31;case 48:return this.begin("acc_title"),32;break;case 49:return this.popState(),"acc_title_value";break;case 50:return this.begin("acc_descr"),34;break;case 51:return this.popState(),"acc_descr_value";break;case 52:this.begin("acc_descr_multiline");break;case 53:this.popState();break;case 54:return"acc_descr_multiline_value";case 55:return 6;case 56:return 19;case 57:return 21;case 58:return 66;case 59:return 5;case 60:return P.yytext=P.yytext.trim(),73;break;case 61:return 80;case 62:return 97;case 63:return 98;case 64:return 99;case 65:return 78;case 66:return 79;case 67:return 100;case 68:return 101;case 69:return 102;case 70:return 103;case 71:return 85;case 72:return 86;case 73:return 87;case 74:return 88;case 75:return 93;case 76:return 94;case 77:return 95;case 78:return 96;case 79:return 81;case 80:return 82;case 81:return 83;case 82:return 84;case 83:return 89;case 84:return 90;case 85:return 91;case 86:return 92;case 87:return 104;case 88:return 104;case 89:return 70;case 90:return 71;case 91:return 72;case 92:return 5;case 93:return 10}},"anonymous"),rules:[/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:((?!\n)\s)+)/i,/^(?:#[^\n]*)/i,/^(?:%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:([0-9]+(\.[0-9]{1,2})?|\.[0-9]{1,2})(?=[ \n]+))/i,/^(?:@\{)/i,/^(?:[^\}]+)/i,/^(?:\}(?=\s+as\s))/i,/^(?:\})/i,/^(?:[^\<->\->:\n,;@\s]+(?=@\{))/i,/^(?:[^<>:\n,;@\s]+(?=\s+as\s))/i,/^(?:[^<>:\n,;@]+(?=\s*[\n;#]|$))/i,/^(?:[^<>:\n,;@]*<[^\n]*)/i,/^(?:[^\n]+)/i,/^(?:box\b)/i,/^(?:participant\b)/i,/^(?:actor\b)/i,/^(?:create\b)/i,/^(?:destroy\b)/i,/^(?:as\b)/i,/^(?:(?:))/i,/^(?:loop\b)/i,/^(?:rect\b)/i,/^(?:opt\b)/i,/^(?:alt\b)/i,/^(?:else\b)/i,/^(?:par\b)/i,/^(?:par_over\b)/i,/^(?:and\b)/i,/^(?:critical\b)/i,/^(?:option\b)/i,/^(?:break\b)/i,/^(?:(?:[:]?(?:no)?wrap)?[^#\n;]*)/i,/^(?:end\b)/i,/^(?:left of\b)/i,/^(?:right of\b)/i,/^(?:links\b)/i,/^(?:link\b)/i,/^(?:properties\b)/i,/^(?:details\b)/i,/^(?:over\b)/i,/^(?:note\b)/i,/^(?:activate\b)/i,/^(?:deactivate\b)/i,/^(?:title\s[^#\n;]+)/i,/^(?:title:\s[^#\n;]+)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:sequenceDiagram\b)/i,/^(?:autonumber\b)/i,/^(?:off\b)/i,/^(?:,)/i,/^(?:;)/i,/^(?:[^\/\\\+\()\+<\->\->:\n,;]+((?!(-x|--x|-\)|--\)|-\|\\|-\\|-\/|-\/\/|-\|\/|\/\|-|\\\|-|\/\/-|\\\\-|\/\|-|--\|\\|--|\(\)))[\-]*[^\+<\->\->:\n,;]+)*)/i,/^(?:->>)/i,/^(?:<<->>)/i,/^(?:-->>)/i,/^(?:<<-->>)/i,/^(?:->)/i,/^(?:-->)/i,/^(?:-[x])/i,/^(?:--[x])/i,/^(?:-[\)])/i,/^(?:--[\)])/i,/^(?:--\|\\)/i,/^(?:--\|\/)/i,/^(?:--\\\\)/i,/^(?:--\/\/)/i,/^(?:\/\|--)/i,/^(?:\\\|--)/i,/^(?:\/\/--)/i,/^(?:\\\\--)/i,/^(?:-\|\\)/i,/^(?:-\|\/)/i,/^(?:-\\\\)/i,/^(?:-\/\/)/i,/^(?:\/\|-)/i,/^(?:\\\|-)/i,/^(?:\/\/-)/i,/^(?:\\\\-)/i,/^(?::(?:(?:no)?wrap)?[^#\n;]*)/i,/^(?::)/i,/^(?:\+)/i,/^(?:-)/i,/^(?:\(\))/i,/^(?:$)/i,/^(?:.)/i],conditions:{acc_descr_multiline:{rules:[53,54],inclusive:!1},acc_descr:{rules:[51],inclusive:!1},acc_title:{rules:[49],inclusive:!1},ID:{rules:[2,3,7,11,12,13,14,15],inclusive:!1},ALIAS:{rules:[2,3,21,22],inclusive:!1},LINE:{rules:[2,3,34],inclusive:!1},CONFIG:{rules:[8,9,10],inclusive:!1},CONFIG_DATA:{rules:[],inclusive:!1},INITIAL:{rules:[0,1,3,4,5,6,16,17,18,19,20,23,24,25,26,27,28,29,30,31,32,33,35,36,37,38,39,40,41,42,43,44,45,46,47,48,50,52,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93],inclusive:!0}}};return ut})();Jt.lexer=pr;function Ct(){this.yy={}}return g(Ct,"Parser"),Ct.prototype=Jt,Jt.Parser=Ct,new Ct})();ie.parser=ie;var Ir=ie,br={SOLID:0,DOTTED:1,NOTE:2,SOLID_CROSS:3,DOTTED_CROSS:4,SOLID_OPEN:5,DOTTED_OPEN:6,LOOP_START:10,LOOP_END:11,ALT_START:12,ALT_ELSE:13,ALT_END:14,OPT_START:15,OPT_END:16,ACTIVE_START:17,ACTIVE_END:18,PAR_START:19,PAR_AND:20,PAR_END:21,RECT_START:22,RECT_END:23,SOLID_POINT:24,DOTTED_POINT:25,AUTONUMBER:26,CRITICAL_START:27,CRITICAL_OPTION:28,CRITICAL_END:29,BREAK_START:30,BREAK_END:31,PAR_OVER_START:32,BIDIRECTIONAL_SOLID:33,BIDIRECTIONAL_DOTTED:34,SOLID_TOP:41,SOLID_BOTTOM:42,STICK_TOP:43,STICK_BOTTOM:44,SOLID_ARROW_TOP_REVERSE:45,SOLID_ARROW_BOTTOM_REVERSE:46,STICK_ARROW_TOP_REVERSE:47,STICK_ARROW_BOTTOM_REVERSE:48,SOLID_TOP_DOTTED:51,SOLID_BOTTOM_DOTTED:52,STICK_TOP_DOTTED:53,STICK_BOTTOM_DOTTED:54,SOLID_ARROW_TOP_REVERSE_DOTTED:55,SOLID_ARROW_BOTTOM_REVERSE_DOTTED:56,STICK_ARROW_TOP_REVERSE_DOTTED:57,STICK_ARROW_BOTTOM_REVERSE_DOTTED:58,CENTRAL_CONNECTION:59,CENTRAL_CONNECTION_REVERSE:60,CENTRAL_CONNECTION_DUAL:61},yr={FILLED:0,OPEN:1},Rr={LEFTOF:0,RIGHTOF:1,OVER:2},Ft={ACTOR:"actor",BOUNDARY:"boundary",COLLECTIONS:"collections",CONTROL:"control",DATABASE:"database",ENTITY:"entity",PARTICIPANT:"participant",QUEUE:"queue"},Or=class{constructor(){this.state=new je(()=>({prevActor:void 0,actors:new Map,createdActors:new Map,destroyedActors:new Map,boxes:[],messages:[],notes:[],sequenceNumbersEnabled:!1,wrapEnabled:void 0,currentBox:void 0,lastCreated:void 0,lastDestroyed:void 0})),this.setAccTitle=re,this.setAccDescription=qe,this.setDiagramTitle=ze,this.getAccTitle=Fe,this.getAccDescription=He,this.getDiagramTitle=Ue,this.apply=this.apply.bind(this),this.parseBoxData=this.parseBoxData.bind(this),this.parseMessage=this.parseMessage.bind(this),this.clear(),this.setWrap($().wrap),this.LINETYPE=br,this.ARROWTYPE=yr,this.PLACEMENT=Rr}static{g(this,"SequenceDB")}addBox(e){this.state.records.boxes.push({name:e.text,wrap:e.wrap??this.autoWrap(),fill:e.color,actorKeys:[]}),this.state.records.currentBox=this.state.records.boxes.slice(-1)[0]}addActor(e,t,a,r,i){let c=this.state.records.currentBox,s;if(i!==void 0){let E;i.includes(`
`)?E=i+`
`:E=`{
`+i+`
}`,s=Je(E,{schema:Xe})}r=s?.type??r,s?.alias&&(!a||a.text===t)&&(a={text:s.alias,wrap:a?.wrap,type:r});let n=this.state.records.actors.get(e);if(n){if(this.state.records.currentBox&&n.box&&this.state.records.currentBox!==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 '${this.state.records.currentBox.name}' at the same time.`);if(c=n.box?n.box:this.state.records.currentBox,n.box=c,n&&t===n.name&&a==null)return}if(a?.text==null&&(a={text:t,type:r}),(r==null||a.text==null)&&(a={text:t,type:r}),this.state.records.actors.set(e,{box:c,name:t,description:a.text,wrap:a.wrap??this.autoWrap(),prevActor:this.state.records.prevActor,links:{},properties:{},actorCnt:null,rectData:null,type:r??"participant"}),this.state.records.prevActor){let E=this.state.records.actors.get(this.state.records.prevActor);E&&(E.nextActor=e)}this.state.records.currentBox&&this.state.records.currentBox.actorKeys.push(e),this.state.records.prevActor=e}activationCount(e){let t,a=0;if(!e)return 0;for(t=0;t<this.state.records.messages.length;t++)this.state.records.messages[t].type===this.LINETYPE.ACTIVE_START&&this.state.records.messages[t].from===e&&a++,this.state.records.messages[t].type===this.LINETYPE.ACTIVE_END&&this.state.records.messages[t].from===e&&a--;return a}addMessage(e,t,a,r){this.state.records.messages.push({id:this.state.records.messages.length.toString(),from:e,to:t,message:a.text,wrap:a.wrap??this.autoWrap(),answer:r})}addSignal(e,t,a,r,i=!1,c){if(r===this.LINETYPE.ACTIVE_END&&this.activationCount(e??"")<1){let n=new Error("Trying to inactivate an inactive participant ("+e+")");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 this.state.records.messages.push({id:this.state.records.messages.length.toString(),from:e,to:t,message:a?.text??"",wrap:a?.wrap??this.autoWrap(),type:r,activate:i,centralConnection:c??0}),!0}hasAtLeastOneBox(){return this.state.records.boxes.length>0}hasAtLeastOneBoxWithTitle(){return this.state.records.boxes.some(e=>e.name)}getMessages(){return this.state.records.messages}getBoxes(){return this.state.records.boxes}getActors(){return this.state.records.actors}getCreatedActors(){return this.state.records.createdActors}getDestroyedActors(){return this.state.records.destroyedActors}getActor(e){return this.state.records.actors.get(e)}getActorKeys(){return[...this.state.records.actors.keys()]}enableSequenceNumbers(){this.state.records.sequenceNumbersEnabled=!0}disableSequenceNumbers(){this.state.records.sequenceNumbersEnabled=!1}showSequenceNumbers(){return this.state.records.sequenceNumbersEnabled}setWrap(e){this.state.records.wrapEnabled=e}extractWrap(e){if(e===void 0)return{};e=e.trim();let t=/^:?wrap:/.exec(e)!==null?!0:/^:?nowrap:/.exec(e)!==null?!1:void 0;return{cleanedText:(t===void 0?e:e.replace(/^:?(?:no)?wrap:/,"")).trim(),wrap:t}}autoWrap(){return this.state.records.wrapEnabled!==void 0?this.state.records.wrapEnabled:$().sequence?.wrap??!1}clear(){this.state.reset(),Ke()}parseMessage(e){let t=e.trim(),{wrap:a,cleanedText:r}=this.extractWrap(t),i={text:r,wrap:a};return tt.debug(`parseMessage: ${JSON.stringify(i)}`),i}parseBoxData(e){let t=/^((?:rgba?|hsla?)\s*\(.*\)|\w*)(.*)$/.exec(e),a=t?.[1]?t[1].trim():"transparent",r=t?.[2]?t[2].trim():void 0;if(window?.CSS)window.CSS.supports("color",a)||(a="transparent",r=e.trim());else{let s=new Option().style;s.color=a,s.color!==a&&(a="transparent",r=e.trim())}let{wrap:i,cleanedText:c}=this.extractWrap(r);return{text:c?Nt(c,$()):void 0,color:a,wrap:i}}addNote(e,t,a){let r={actor:e,placement:t,message:a.text,wrap:a.wrap??this.autoWrap()},i=[].concat(e,e);this.state.records.notes.push(r),this.state.records.messages.push({id:this.state.records.messages.length.toString(),from:i[0],to:i[1],message:a.text,wrap:a.wrap??this.autoWrap(),type:this.LINETYPE.NOTE,placement:t})}addLinks(e,t){let a=this.getActor(e);try{let r=Nt(t.text,$());r=r.replace(/&equals;/g,"="),r=r.replace(/&amp;/g,"&");let i=JSON.parse(r);this.insertLinks(a,i)}catch(r){tt.error("error while parsing actor link text",r)}}addALink(e,t){let a=this.getActor(e);try{let r={},i=Nt(t.text,$()),c=i.indexOf("@");i=i.replace(/&equals;/g,"="),i=i.replace(/&amp;/g,"&");let s=i.slice(0,c-1).trim(),n=i.slice(c+1).trim();r[s]=n,this.insertLinks(a,r)}catch(r){tt.error("error while parsing actor link text",r)}}insertLinks(e,t){if(e.links==null)e.links=t;else for(let a in t)e.links[a]=t[a]}addProperties(e,t){let a=this.getActor(e);try{let r=Nt(t.text,$()),i=JSON.parse(r);this.insertProperties(a,i)}catch(r){tt.error("error while parsing actor properties text",r)}}insertProperties(e,t){if(e.properties==null)e.properties=t;else for(let a in t)e.properties[a]=t[a]}boxEnd(){this.state.records.currentBox=void 0}addDetails(e,t){let a=this.getActor(e),r=document.getElementById(t.text);try{let i=r.innerHTML,c=JSON.parse(i);c.properties&&this.insertProperties(a,c.properties),c.links&&this.insertLinks(a,c.links)}catch(i){tt.error("error while parsing actor details text",i)}}getActorProperty(e,t){if(e?.properties!==void 0)return e.properties[t]}apply(e){if(Array.isArray(e))e.forEach(t=>{this.apply(t)});else switch(e.type){case"sequenceIndex":this.state.records.messages.push({id:this.state.records.messages.length.toString(),from:void 0,to:void 0,message:{start:e.sequenceIndex,step:e.sequenceIndexStep,visible:e.sequenceVisible},wrap:!1,type:e.signalType});break;case"addParticipant":this.addActor(e.actor,e.actor,e.description,e.draw,e.config);break;case"createParticipant":if(this.state.records.actors.has(e.actor))throw new Error("It is not possible to have actors with the same id, even if one is destroyed before the next is created. Use 'AS' aliases to simulate the behavior");this.state.records.lastCreated=e.actor,this.addActor(e.actor,e.actor,e.description,e.draw,e.config),this.state.records.createdActors.set(e.actor,this.state.records.messages.length);break;case"destroyParticipant":this.state.records.lastDestroyed=e.actor,this.state.records.destroyedActors.set(e.actor,this.state.records.messages.length);break;case"activeStart":this.addSignal(e.actor,void 0,void 0,e.signalType);break;case"centralConnection":this.addSignal(e.actor,void 0,void 0,e.signalType);break;case"centralConnectionReverse":this.addSignal(e.actor,void 0,void 0,e.signalType);break;case"activeEnd":this.addSignal(e.actor,void 0,void 0,e.signalType);break;case"addNote":this.addNote(e.actor,e.placement,e.text);break;case"addLinks":this.addLinks(e.actor,e.text);break;case"addALink":this.addALink(e.actor,e.text);break;case"addProperties":this.addProperties(e.actor,e.text);break;case"addDetails":this.addDetails(e.actor,e.text);break;case"addMessage":if(this.state.records.lastCreated){if(e.to!==this.state.records.lastCreated)throw new Error("The created participant "+this.state.records.lastCreated.name+" does not have an associated creating message after its declaration. Please check the sequence diagram.");this.state.records.lastCreated=void 0}else if(this.state.records.lastDestroyed){if(e.to!==this.state.records.lastDestroyed&&e.from!==this.state.records.lastDestroyed)throw new Error("The destroyed participant "+this.state.records.lastDestroyed.name+" does not have an associated destroying message after its declaration. Please check the sequence diagram.");this.state.records.lastDestroyed=void 0}this.addSignal(e.from,e.to,e.msg,e.signalType,e.activate,e.centralConnection);break;case"boxStart":this.addBox(e.boxData);break;case"boxEnd":this.boxEnd();break;case"loopStart":this.addSignal(void 0,void 0,e.loopText,e.signalType);break;case"loopEnd":this.addSignal(void 0,void 0,void 0,e.signalType);break;case"rectStart":this.addSignal(void 0,void 0,e.color,e.signalType);break;case"rectEnd":this.addSignal(void 0,void 0,void 0,e.signalType);break;case"optStart":this.addSignal(void 0,void 0,e.optText,e.signalType);break;case"optEnd":this.addSignal(void 0,void 0,void 0,e.signalType);break;case"altStart":this.addSignal(void 0,void 0,e.altText,e.signalType);break;case"else":this.addSignal(void 0,void 0,e.altText,e.signalType);break;case"altEnd":this.addSignal(void 0,void 0,void 0,e.signalType);break;case"setAccTitle":re(e.text);break;case"parStart":this.addSignal(void 0,void 0,e.parText,e.signalType);break;case"and":this.addSignal(void 0,void 0,e.parText,e.signalType);break;case"parEnd":this.addSignal(void 0,void 0,void 0,e.signalType);break;case"criticalStart":this.addSignal(void 0,void 0,e.criticalText,e.signalType);break;case"option":this.addSignal(void 0,void 0,e.optionText,e.signalType);break;case"criticalEnd":this.addSignal(void 0,void 0,void 0,e.signalType);break;case"breakStart":this.addSignal(void 0,void 0,e.breakText,e.signalType);break;case"breakEnd":this.addSignal(void 0,void 0,void 0,e.signalType);break}}getConfig(){return $().sequence}},Lr=g(e=>{let t=e.dropShadow??"none",{look:a}=$();return`.actor {
    stroke: ${e.actorBorder};
    fill: ${e.actorBkg};
    stroke-width: ${e.strokeWidth??1};
  }

  rect.actor.outer-path[data-look="neo"] {
      filter: ${t};
  }

  rect.note[data-look="neo"] {
      stroke:${e.noteBorderColor};
      fill:${e.noteBkgColor};
      filter: ${t};
  }

  text.actor > tspan {
    fill: ${e.actorTextColor};
    stroke: none;
  }

  .actor-line {
    stroke: ${e.actorLineColor};
  }

  .innerArc {
    stroke-width: 1.5;
    stroke-dasharray: none;
  }

  .messageLine0 {
    stroke-width: 1.5;
    stroke-dasharray: none;
    stroke: ${e.signalColor};
  }

  .messageLine1 {
    stroke-width: 1.5;
    stroke-dasharray: 2, 2;
    stroke: ${e.signalColor};
  }

  [id$="-arrowhead"] path {
    fill: ${e.signalColor};
    stroke: ${e.signalColor};
  }

  .sequenceNumber {
    fill: ${e.sequenceNumberColor};
  }

  [id$="-sequencenumber"] {
    fill: ${e.signalColor};
  }

  [id$="-crosshead"] path {
    fill: ${e.signalColor};
    stroke: ${e.signalColor};
  }

  .messageText {
    fill: ${e.signalTextColor};
    stroke: none;
  }

  .labelBox {
    stroke: ${e.labelBoxBorderColor};
    fill: ${e.labelBoxBkgColor};
    filter: ${a==="neo"?t:"none"};
  }

  .labelText, .labelText > tspan {
    fill: ${e.labelTextColor};
    stroke: none;
  }

  .loopText, .loopText > tspan {
    fill: ${e.loopTextColor};
    stroke: none;
  }

  .sectionTitle, .sectionTitle > tspan {
    fill: ${e.loopTextColor};
    stroke: none;
  }

  .loopLine {
    stroke-width: 2px;
    stroke-dasharray: 2, 2;
    stroke: ${e.labelBoxBorderColor};
    fill: ${e.labelBoxBorderColor};
  }

  .note {
    //stroke: #decc93;
    stroke: ${e.noteBorderColor};
    fill: ${e.noteBkgColor};
  }

  .noteText, .noteText > tspan {
    fill: ${e.noteTextColor};
    stroke: none;
    ${e.noteFontWeight?`font-weight: ${e.noteFontWeight};`:""}
  }

  .activation0 {
    fill: ${e.activationBkgColor};
    stroke: ${e.activationBorderColor};
  }

  .activation1 {
    fill: ${e.activationBkgColor};
    stroke: ${e.activationBorderColor};
  }

  .activation2 {
    fill: ${e.activationBkgColor};
    stroke: ${e.activationBorderColor};
  }

  .actorPopupMenu {
    position: absolute;
  }

  .actorPopupMenuPanel {
    position: absolute;
    fill: ${e.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 circle, line {
    fill: ${e.actorBkg};
    stroke-width: 2px;
  }

  g rect.rect {
    filter: ${t};
    stroke: ${e.nodeBorder};
  }
`},"getStyles"),mr=Lr,It=36,ft="actor-top",_t="actor-bottom",Ht="actor-box",bt="actor-man",pt=new Set(["redux-color","redux-dark-color"]),Pt=g(function(e,t){let a=Ze(e,t);return kt().look==="neo"&&a.attr("data-look","neo"),a},"drawRect"),Ar=g(function(e,t,a,r,i){if(t.links===void 0||t.links===null||Object.keys(t.links).length===0)return{height:0,width:0};let c=t.links,s=t.actorCnt,n=t.rectData;var E="none";i&&(E="block !important");let T=e.append("g");T.attr("id","actor"+s+"_popup"),T.attr("class","actorPopupMenu"),T.attr("display",E);var l="";n.class!==void 0&&(l=" "+n.class);let x=n.width>a?n.width:a,u=T.append("rect");if(u.attr("class","actorPopupMenuPanel"+l),u.attr("x",n.x),u.attr("y",n.height),u.attr("fill",n.fill),u.attr("stroke",n.stroke),u.attr("width",x),u.attr("height",n.height),u.attr("rx",n.rx),u.attr("ry",n.ry),c!=null){var R=20;for(let _ in c){var p=T.append("a"),f=(0,ce.sanitizeUrl)(c[_]);p.attr("xlink:href",f),p.attr("target","_blank"),Qr(r)(_,p,n.x+10,n.height+R,x,20,{class:"actor"},r),R+=30}}return u.attr("height",R),{height:n.height+R,width:x}},"drawPopup"),zt=g(function(e){return"var pu = document.getElementById('"+e+"'); if (pu != null) { pu.style.display = pu.style.display == 'block' ? 'none' : 'block'; }"},"popupMenuToggle"),qt=g(async function(e,t,a=null){let r=e.append("foreignObject"),i=await ee(t.text,kt()),s=r.append("xhtml:div").attr("style","width: fit-content;").attr("xmlns","http://www.w3.org/1999/xhtml").html(i).node().getBoundingClientRect();if(r.attr("height",Math.round(s.height)).attr("width",Math.round(s.width)),t.class==="noteText"){let n=e.node().firstChild;n.setAttribute("height",s.height+2*t.textMargin);let E=n.getBBox();r.attr("x",Math.round(E.x+E.width/2-s.width/2)).attr("y",Math.round(E.y+E.height/2-s.height/2))}else if(a){let{startx:n,stopx:E,starty:T}=a;if(n>E){let l=n;n=E,E=l}r.attr("x",Math.round(n+Math.abs(n-E)/2-s.width/2)),t.class==="loopText"?r.attr("y",Math.round(T)):r.attr("y",Math.round(T-s.height))}return[r]},"drawKatex"),mt=g(function(e,t){let a=0,r=0,i=t.text.split(w.lineBreakRegex),[c,s]=ae(t.fontSize),n=[],E=0,T=g(()=>t.y,"yfunc");if(t.valign!==void 0&&t.textMargin!==void 0&&t.textMargin>0)switch(t.valign){case"top":case"start":T=g(()=>Math.round(t.y+t.textMargin),"yfunc");break;case"middle":case"center":T=g(()=>Math.round(t.y+(a+r+t.textMargin)/2),"yfunc");break;case"bottom":case"end":T=g(()=>Math.round(t.y+(a+r+2*t.textMargin)-t.textMargin),"yfunc");break}if(t.anchor!==void 0&&t.textMargin!==void 0&&t.width!==void 0)switch(t.anchor){case"left":case"start":t.x=Math.round(t.x+t.textMargin),t.anchor="start",t.dominantBaseline="middle",t.alignmentBaseline="middle";break;case"middle":case"center":t.x=Math.round(t.x+t.width/2),t.anchor="middle",t.dominantBaseline="middle",t.alignmentBaseline="middle";break;case"right":case"end":t.x=Math.round(t.x+t.width-t.textMargin),t.anchor="end",t.dominantBaseline="middle",t.alignmentBaseline="middle";break}for(let[l,x]of i.entries()){t.textMargin!==void 0&&t.textMargin===0&&c!==void 0&&(E=l*c);let u=e.append("text");u.attr("x",t.x),u.attr("y",T()),t.anchor!==void 0&&u.attr("text-anchor",t.anchor).attr("dominant-baseline",t.dominantBaseline).attr("alignment-baseline",t.alignmentBaseline),t.fontFamily!==void 0&&u.style("font-family",t.fontFamily),s!==void 0&&u.style("font-size",s),t.fontWeight!==void 0&&u.style("font-weight",t.fontWeight),t.fill!==void 0&&u.attr("fill",t.fill),t.class!==void 0&&u.attr("class",t.class),t.dy!==void 0?u.attr("dy",t.dy):E!==0&&u.attr("dy",E);let R=x||Qe;if(t.tspan){let p=u.append("tspan");p.attr("x",t.x),t.fill!==void 0&&p.attr("fill",t.fill),p.text(R)}else u.text(R);t.valign!==void 0&&t.textMargin!==void 0&&t.textMargin>0&&(r+=(u._groups||u)[0][0].getBBox().height,a=r),n.push(u)}return n},"drawText"),rr=g(function(e,t){function a(i,c,s,n,E){return i+","+c+" "+(i+s)+","+c+" "+(i+s)+","+(c+n-E)+" "+(i+s-E*1.2)+","+(c+n)+" "+i+","+(c+n)}g(a,"genPoints");let r=e.append("polygon");return r.attr("points",a(t.x,t.y,t.width,t.height,7)),r.attr("class","labelBox"),t.y=t.y+t.height/2,mt(e,t),r},"drawLabel"),M=-1,ar=g((e,t,a,r)=>{e.select&&a.forEach(i=>{let c=t.get(i),s=e.select("#actor"+c.actorCnt);!r.mirrorActors&&c.stopy?s.attr("y2",c.stopy+c.height/2):r.mirrorActors&&s.attr("y2",c.stopy)})},"fixLifeLineHeights"),Sr=g(function(e,t,a,r,i){let c=r?t.stopy:t.starty,s=t.x+t.width/2,n=c+t.height,{look:E,theme:T,themeVariables:l}=a,{bkgColorArray:x,borderColorArray:u}=l,R=e.append("g").lower();var p=R;r||(M++,Object.keys(t.links||{}).length&&!a.forceMenus&&p.attr("onclick",zt(`actor${M}_popup`)).attr("cursor","pointer"),p.append("line").attr("id","actor"+M).attr("x1",s).attr("y1",n).attr("x2",s).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",t.name).attr("data-et","life-line").attr("data-id",t.name),p=R.append("g"),t.actorCnt=M,t.links!=null&&p.attr("id","root-"+M),E==="neo"&&p.attr("data-look","neo"));let f=ht();var _="actor";t.properties?.class?_=t.properties.class:f.fill="#eaeaea",r?_+=` ${_t}`:_+=` ${ft}`,f.x=t.x,f.y=c,f.width=t.width,f.height=t.height,f.class=_,f.rx=3,f.ry=3,f.name=t.name,E==="neo"&&(f.rx=6,f.ry=6);let I=Pt(p,f),O=i.get(t.name)??0;if(pt.has(T)&&(I.style("stroke",u[O%u.length]),I.style("fill",x[O%u.length])),E==="neo"&&I.attr("filter","url(#drop-shadow)"),t.rectData=f,t.properties?.icon){let S=t.properties.icon.trim();S.charAt(0)==="@"?Wt(p,f.x+f.width-20,f.y+10,S.substr(1)):Yt(p,f.x+f.width-20,f.y+10,S)}r||(p.attr("data-et","participant"),p.attr("data-type","participant"),p.attr("data-id",t.name)),Et(a,Z(t.description))(t.description,p,f.x,f.y,f.width,f.height,{class:`actor ${Ht}`},a);let L=t.height;if(I.node){let S=I.node().getBBox();t.height=S.height,L=S.height}return L},"drawActorTypeParticipant"),kr=g(function(e,t,a,r,i){let c=r?t.stopy:t.starty,s=t.x+t.width/2,n=c+t.height,{look:E,theme:T,themeVariables:l}=a,{bkgColorArray:x,borderColorArray:u}=l,R=e.append("g").lower();var p=R;r||(M++,Object.keys(t.links||{}).length&&!a.forceMenus&&p.attr("onclick",zt(`actor${M}_popup`)).attr("cursor","pointer"),p.append("line").attr("id","actor"+M).attr("x1",s).attr("y1",n).attr("x2",s).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",t.name).attr("data-et","life-line").attr("data-id",t.name),p=R.append("g"),t.actorCnt=M,t.links!=null&&p.attr("id","root-"+M),E==="neo"&&p.attr("data-look","neo"));let f=ht();var _="actor";t.properties?.class?_=t.properties.class:f.fill="#eaeaea",r?_+=` ${_t}`:_+=` ${ft}`,f.x=t.x,f.y=c,f.width=t.width,f.height=t.height,f.class=_,f.name=t.name;let I=6,O={...f,x:f.x+-I,y:f.y+ +I,class:"actor"},L=Pt(p,f),S=Pt(p,O);t.rectData=f,E==="neo"&&p.attr("filter","url(#drop-shadow)");let A=i.get(t.name)??0;if(pt.has(T)&&(L.style("stroke",u[A%u.length]),L.style("fill",x[A%u.length]),S.style("stroke",u[A%u.length]),S.style("fill",x[A%u.length])),t.properties?.icon){let B=t.properties.icon.trim();B.charAt(0)==="@"?Wt(p,f.x+f.width-20,f.y+10,B.substr(1)):Yt(p,f.x+f.width-20,f.y+10,B)}Et(a,Z(t.description))(t.description,p,f.x-I,f.y+I,f.width,f.height,{class:`actor ${Ht}`},a);let N=t.height;if(L.node){let B=L.node().getBBox();t.height=B.height,N=B.height}return r||(p.attr("data-et","participant"),p.attr("data-type","collections"),p.attr("data-id",t.name)),N},"drawActorTypeCollections"),Nr=g(function(e,t,a,r,i){let c=r?t.stopy:t.starty,s=t.x+t.width/2,n=c+t.height,{look:E,theme:T,themeVariables:l}=a,{bkgColorArray:x,borderColorArray:u}=l,R=e.append("g").lower(),p=R;r||(M++,Object.keys(t.links||{}).length&&!a.forceMenus&&p.attr("onclick",zt(`actor${M}_popup`)).attr("cursor","pointer"),p.append("line").attr("id","actor"+M).attr("x1",s).attr("y1",n).attr("x2",s).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",t.name).attr("data-et","life-line").attr("data-id",t.name),p=R.append("g"),t.actorCnt=M,t.links!=null&&p.attr("id","root-"+M),E==="neo"&&p.attr("data-look","neo"));let f=ht(),_="actor";t.properties?.class?_=t.properties.class:f.fill="#eaeaea",r?_+=` ${_t}`:_+=` ${ft}`,p.attr("class",_),f.x=t.x,f.y=c,f.width=t.width,f.height=t.height,f.name=t.name;let I=f.height/2,O=I/(2.5+f.height/50),L=p.append("g"),S=p.append("g"),A=`M ${f.x},${f.y+I}
    a ${O},${I} 0 0 0 0,${f.height}
    h ${f.width-2*O}
    a ${O},${I} 0 0 0 0,-${f.height}
    Z
  `;L.append("path").attr("d",A),S.append("path").attr("d",`M ${f.x},${f.y+I}
      a ${O},${I} 0 0 0 0,${f.height}`),L.attr("transform",`translate(${O}, ${-(f.height/2)})`),S.attr("transform",`translate(${f.width-O}, ${-f.height/2})`),t.rectData=f,E==="neo"&&L.attr("filter","url(#drop-shadow)");let N=i.get(t.name)??0;if(pt.has(T)&&(L.style("stroke",u[N%u.length]),L.style("fill",x[N%u.length]),S.style("stroke",u[N%u.length]),S.style("fill",x[N%u.length])),t.properties?.icon){let H=t.properties.icon.trim(),U=f.x+f.width-20,G=f.y+10;H.charAt(0)==="@"?Wt(p,U,G,H.substr(1)):Yt(p,U,G,H)}Et(a,Z(t.description))(t.description,p,f.x,f.y,f.width,f.height,{class:`actor ${Ht}`},a);let B=t.height,V=L.select("path:last-child");if(V.node()){let H=V.node().getBBox();t.height=H.height,B=H.height}return r||(p.attr("data-et","participant"),p.attr("data-type","queue"),p.attr("data-id",t.name)),B},"drawActorTypeQueue"),wr=g(function(e,t,a,r,i,c){let s=r?t.stopy:t.starty,n=t.x+t.width/2,E=s+75,{look:T,theme:l,themeVariables:x}=a,{bkgColorArray:u,borderColorArray:R,actorBorder:p,actorBkg:f}=x,_=e.append("g").lower();r||(M++,_.append("line").attr("id","actor"+M).attr("x1",n).attr("y1",E).attr("x2",n).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",t.name).attr("data-et","life-line").attr("data-id",t.name),t.actorCnt=M);let I=e.append("g"),O=bt;r?O+=` ${_t}`:O+=` ${ft}`,I.attr("class",O),I.attr("name",t.name);let L=ht();L.x=t.x,L.y=s,L.fill="#eaeaea",L.width=t.width,L.height=t.height,L.class="actor";let S=t.x+t.width/2,A=s+32,N=22;I.append("defs").append("marker").attr("id",i+"-filled-head-control").attr("refX",11).attr("refY",5.8).attr("markerWidth",20).attr("markerHeight",28).attr("orient","172.5").attr("stroke-width",1.2).append("path").attr("d","M 14.4 5.6 L 7.2 10.4 L 8.8 5.6 L 7.2 0.8 Z"),I.append("circle").attr("cx",S).attr("cy",A).attr("r",N).attr("filter",`${T==="neo"?"url(#drop-shadow)":""}`),I.append("line").attr("marker-end","url(#"+i+"-filled-head-control)").attr("transform",`translate(${S}, ${A-N})`);let B=c.get(t.name)??0;pt.has(l)?(I.style("stroke",R[B%R.length]),I.style("fill",u[B%R.length])):(I.style("stroke",p),I.style("fill",f));let V=I.node().getBBox();return t.height=V.height+2*(a?.sequence?.labelBoxHeight??0),Et(a,Z(t.description))(t.description,I,L.x,L.y+N+(r?5:12),L.width,L.height,{class:`actor ${bt}`},a),r||(I.attr("data-et","participant"),I.attr("data-type","control"),I.attr("data-id",t.name)),t.height},"drawActorTypeControl"),Pr=g(function(e,t,a,r,i){let c=r?t.stopy:t.starty,s=t.x+t.width/2,n=c+75,{look:E,theme:T,themeVariables:l}=a,{bkgColorArray:x,borderColorArray:u}=l,R=e.append("g").lower(),p=e.append("g"),f="actor";r?f+=` ${_t}`:f+=` ${ft}`,p.attr("class",f),p.attr("name",t.name);let _=ht();_.x=t.x,_.y=c,_.fill="#eaeaea",_.width=t.width,_.height=t.height,_.class="actor";let I=t.x+t.width/2,O=c+(r?10:25),L=22;p.append("circle").attr("cx",I).attr("cy",O).attr("r",L).attr("width",t.width).attr("height",t.height),p.append("line").attr("x1",I-L).attr("x2",I+L).attr("y1",O+L).attr("y2",O+L).attr("stroke-width",2),E==="neo"&&p.attr("filter","url(#drop-shadow)");let S=i.get(t.name)??0;pt.has(T)&&(p.style("stroke",u[S%u.length]),p.style("fill",x[S%u.length]));let A=p.node().getBBox();return t.height=A.height+(a?.sequence?.labelBoxHeight??0),r||(M++,R.append("line").attr("id","actor"+M).attr("x1",s).attr("y1",n).attr("x2",s).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",t.name).attr("data-et","life-line").attr("data-id",t.name),t.actorCnt=M),Et(a,Z(t.description))(t.description,p,_.x,_.y+(r?15:30),_.width,_.height,{class:`actor ${bt}`},a),r?p.attr("transform",`translate(0, ${L})`):(p.attr("transform",`translate(0, ${L/2-5})`),p.attr("data-et","participant"),p.attr("data-type","entity"),p.attr("data-id",t.name)),t.height},"drawActorTypeEntity"),Dr=g(function(e,t,a,r,i){let c=r?t.stopy:t.starty,s=t.x+t.width/2,n=c+t.height+2*a.boxTextMargin,{theme:E,themeVariables:T,look:l}=a,{bkgColorArray:x,borderColorArray:u,actorBorder:R}=T,p=e.append("g").lower(),f=p;r||(M++,Object.keys(t.links||{}).length&&!a.forceMenus&&f.attr("onclick",zt(`actor${M}_popup`)).attr("cursor","pointer"),f.append("line").attr("id","actor"+M).attr("x1",s).attr("y1",n).attr("x2",s).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",t.name).attr("data-et","life-line").attr("data-id",t.name),f=p.append("g"),t.actorCnt=M,t.links!=null&&f.attr("id","root-"+M),l==="neo"&&f.attr("data-look","neo"));let _=ht(),I="actor";t.properties?.class?I=t.properties.class:_.fill="#eaeaea",r?I+=` ${_t}`:I+=` ${ft}`,_.x=t.x,_.y=c,_.width=t.width,_.height=t.height,_.class=I,_.name=t.name,_.x=t.x,_.y=c;let O=_.width/3,L=_.width/3,S=O/2,A=S/(2.5+O/50),N=f.append("g");N.attr("class",I);let B=`
  M ${_.x},${_.y+A}
  a ${S},${A} 0 0 0 ${O},0
  a ${S},${A} 0 0 0 -${O},0
  l 0,${L-2*A}
  a ${S},${A} 0 0 0 ${O},0
  l 0,-${L-2*A}
`;N.append("path").attr("d",B),l==="neo"&&N.attr("filter","url(#drop-shadow)");let V=i.get(t.name)??0;pt.has(E)?(N.style("stroke",u[V%u.length]),N.style("fill",x[V%u.length])):N.style("stroke",R),N.attr("transform",`translate(${O}, ${A})`),t.rectData=_,Et(a,Z(t.description))(t.description,f,_.x,_.y+35,_.width,_.height,{class:`actor ${Ht}`},a);let H=N.select("path:last-child");if(H.node()){let U=H.node().getBBox();t.height=U.height+(a.sequence.labelBoxHeight??0)}return r||(f.attr("data-et","participant"),f.attr("data-type","database"),f.attr("data-id",t.name)),t.height},"drawActorTypeDatabase"),vr=g(function(e,t,a,r,i){let c=r?t.stopy:t.starty,s=t.x+t.width/2,n=c+80,E=22,T=e.append("g").lower(),{look:l,theme:x,themeVariables:u}=a,{bkgColorArray:R,borderColorArray:p,actorBorder:f}=u;r||(M++,T.append("line").attr("id","actor"+M).attr("x1",s).attr("y1",n).attr("x2",s).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",t.name).attr("data-et","life-line").attr("data-id",t.name),t.actorCnt=M);let _=e.append("g"),I=bt;r?I+=` ${_t}`:I+=` ${ft}`,_.attr("class",I),_.attr("name",t.name);let O=ht();O.x=t.x,O.y=c,O.fill="#eaeaea",O.width=t.width,O.height=t.height,O.class="actor",_.append("line").attr("id","actor-man-torso"+M).attr("x1",t.x+t.width/2-E*2.5).attr("y1",c+12).attr("x2",t.x+t.width/2-15).attr("y2",c+12),_.append("line").attr("id","actor-man-arms"+M).attr("x1",t.x+t.width/2-E*2.5).attr("y1",c+2).attr("x2",t.x+t.width/2-E*2.5).attr("y2",c+22),_.append("circle").attr("cx",t.x+t.width/2).attr("cy",c+12).attr("r",E),l==="neo"&&_.attr("filter","url(#drop-shadow)");let L=i.get(t.name)??0;pt.has(x)?(_.style("stroke",p[L%p.length]),_.style("fill",R[L%p.length])):_.style("stroke",f);let S=_.node().getBBox();return t.height=S.height+(a.sequence.labelBoxHeight??0),Et(a,Z(t.description))(t.description,_,O.x,O.y+15,O.width,O.height,{class:`actor ${bt}`},a),_.attr("transform",`translate(0,${E/2+10})`),r||(_.attr("data-et","participant"),_.attr("data-type","boundary"),_.attr("data-id",t.name)),t.height},"drawActorTypeBoundary"),Cr=g(function(e,t,a,r,i){let c=r?t.stopy:t.starty,s=t.x+t.width/2,n=c+80,{look:E,theme:T,themeVariables:l}=a,{bkgColorArray:x,borderColorArray:u,actorBorder:R}=l,p=e.append("g").lower();r||(M++,p.append("line").attr("id","actor"+M).attr("x1",s).attr("y1",n).attr("x2",s).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",t.name).attr("data-et","life-line").attr("data-id",t.name),t.actorCnt=M);let f=e.append("g"),_=bt;r?_+=` ${_t}`:_+=` ${ft}`,f.attr("class",_),f.attr("name",t.name),r||f.attr("data-et","participant").attr("data-type","actor").attr("data-id",t.name);let I=E==="neo"?.5:1,O=E==="neo"?c+(1-I)*30:c;f.append("line").attr("id","actor-man-torso"+M).attr("x1",s).attr("y1",O+25*I).attr("x2",s).attr("y2",O+45*I),f.append("line").attr("id","actor-man-arms"+M).attr("x1",s-It/2*I).attr("y1",O+33*I).attr("x2",s+It/2*I).attr("y2",O+33*I),f.append("line").attr("x1",s-It/2*I).attr("y1",O+60*I).attr("x2",s).attr("y2",O+45*I),f.append("line").attr("x1",s).attr("y1",O+45*I).attr("x2",s+(It/2-2)*I).attr("y2",O+60*I);let L=f.append("circle");L.attr("cx",t.x+t.width/2),L.attr("cy",O+10*I),L.attr("r",15*I),L.attr("width",t.width*I),L.attr("height",t.height*I);let S=f.node().getBBox();t.height=S.height;let A=ht();A.x=t.x,A.y=O,A.fill="#eaeaea",A.width=t.width,A.height=t.height/I,A.class="actor",A.rx=3,A.ry=3;let N=i.get(t.name)??0;return pt.has(T)?(f.style("stroke",u[N%u.length]),f.style("fill",x[N%u.length])):f.style("stroke",R),Et(a,Z(t.description))(t.description,f,A.x,O+35*I-(E==="neo"?10:0),A.width,A.height,{class:`actor ${bt}`},a),t.height},"drawActorTypeActor"),Mr=g(async function(e,t,a,r,i,c,s){let n=s??new Map([...c.db.getActors().values()].map((E,T)=>[E.name,T]));switch(t.type){case"actor":return await Cr(e,t,a,r,n);case"participant":return await Sr(e,t,a,r,n);case"boundary":return await vr(e,t,a,r,n);case"control":return await wr(e,t,a,r,i,n);case"entity":return await Pr(e,t,a,r,n);case"database":return await Dr(e,t,a,r,n);case"collections":return await kr(e,t,a,r,n);case"queue":return await Nr(e,t,a,r,n)}},"drawActor"),Br=g(function(e,t,a){let i=e.append("g");sr(i,t),t.name&&Et(a)(t.name,i,t.x,t.y+a.boxTextMargin+(t.textMaxHeight||0)/2,t.width,0,{class:"text"},a),i.lower()},"drawBox"),Vr=g(function(e){return e.append("g")},"anchorElement"),Yr=g(function(e,t,a,r,i,c,s){let{theme:n,themeVariables:E}=r,{bkgColorArray:T,borderColorArray:l,mainBkg:x}=E,u=ht(),R=t.anchored,p=t.actor;u.x=t.startx,u.y=t.starty,u.class="activation"+i%3,u.width=t.stopx-t.startx,u.height=a-t.starty;let f=Pt(R,u),I=(s??new Map([...c.db.getActors().values()].map((O,L)=>[O.name,L]))).get(p)??0;pt.has(n)&&(f.style("stroke",l[I%l.length]),f.style("fill",T[I%l.length]??x))},"drawActivation"),Wr=g(async function(e,t,a,r,i){let{boxMargin:c,boxTextMargin:s,labelBoxHeight:n,labelBoxWidth:E,messageFontFamily:T,messageFontSize:l,messageFontWeight:x}=r,u=e.append("g").attr("data-et","control-structure").attr("data-id","i"+i.id),R=g(function(_,I,O,L){return u.append("line").attr("x1",_).attr("y1",I).attr("x2",O).attr("y2",L).attr("class","loopLine")},"drawLoopLine");R(t.startx,t.starty,t.stopx,t.starty),R(t.stopx,t.starty,t.stopx,t.stopy),R(t.startx,t.stopy,t.stopx,t.stopy),R(t.startx,t.starty,t.startx,t.stopy),t.sections!==void 0&&t.sections.forEach(function(_){R(t.startx,_.y,t.stopx,_.y).style("stroke-dasharray","3, 3")});let p=Kt();p.text=a,p.x=t.startx,p.y=t.starty,p.fontFamily=T,p.fontSize=l,p.fontWeight=x,p.anchor="middle",p.valign="middle",p.tspan=!1,p.width=Math.max(E??0,50),p.height=n+(r.look==="neo"?15:0)||20,p.textMargin=s,p.class="labelText",rr(u,p),p=ir(),p.text=t.title,p.x=t.startx+E/2+(t.stopx-t.startx)/2,p.y=t.starty+c+s,p.anchor="middle",p.valign="middle",p.textMargin=s,p.class="loopText",p.fontFamily=T,p.fontSize=l,p.fontWeight=x,p.wrap=!0;let f=Z(p.text)?await qt(u,p,t):mt(u,p);if(t.sectionTitles!==void 0){for(let[_,I]of Object.entries(t.sectionTitles))if(I.message){p.text=I.message,p.x=t.startx+(t.stopx-t.startx)/2,p.y=t.sections[_].y+c+s,p.class="sectionTitle",p.anchor="middle",p.valign="middle",p.tspan=!1,p.fontFamily=T,p.fontSize=l,p.fontWeight=x,p.wrap=t.wrap,Z(p.text)?(t.starty=t.sections[_].y,await qt(u,p,t)):mt(u,p);let O=Math.round(f.map(L=>(L._groups||L)[0][0].getBBox().height).reduce((L,S)=>L+S));t.sections[_].height+=O-(c+s)}}return t.height=Math.round(t.stopy-t.starty),u},"drawLoop"),sr=g(function(e,t){$e(e,t)},"drawBackgroundRect"),Kr=g(function(e,t){e.append("defs").append("symbol").attr("id",t+"-database").attr("fill-rule","evenodd").attr("clip-rule","evenodd").append("path").attr("transform","scale(.5)").attr("d","M12.258.001l.256.004.255.005.253.008.251.01.249.012.247.015.246.016.242.019.241.02.239.023.236.024.233.027.231.028.229.031.225.032.223.034.22.036.217.038.214.04.211.041.208.043.205.045.201.046.198.048.194.05.191.051.187.053.183.054.18.056.175.057.172.059.168.06.163.061.16.063.155.064.15.066.074.033.073.033.071.034.07.034.069.035.068.035.067.035.066.035.064.036.064.036.062.036.06.036.06.037.058.037.058.037.055.038.055.038.053.038.052.038.051.039.05.039.048.039.047.039.045.04.044.04.043.04.041.04.04.041.039.041.037.041.036.041.034.041.033.042.032.042.03.042.029.042.027.042.026.043.024.043.023.043.021.043.02.043.018.044.017.043.015.044.013.044.012.044.011.045.009.044.007.045.006.045.004.045.002.045.001.045v17l-.001.045-.002.045-.004.045-.006.045-.007.045-.009.044-.011.045-.012.044-.013.044-.015.044-.017.043-.018.044-.02.043-.021.043-.023.043-.024.043-.026.043-.027.042-.029.042-.03.042-.032.042-.033.042-.034.041-.036.041-.037.041-.039.041-.04.041-.041.04-.043.04-.044.04-.045.04-.047.039-.048.039-.05.039-.051.039-.052.038-.053.038-.055.038-.055.038-.058.037-.058.037-.06.037-.06.036-.062.036-.064.036-.064.036-.066.035-.067.035-.068.035-.069.035-.07.034-.071.034-.073.033-.074.033-.15.066-.155.064-.16.063-.163.061-.168.06-.172.059-.175.057-.18.056-.183.054-.187.053-.191.051-.194.05-.198.048-.201.046-.205.045-.208.043-.211.041-.214.04-.217.038-.22.036-.223.034-.225.032-.229.031-.231.028-.233.027-.236.024-.239.023-.241.02-.242.019-.246.016-.247.015-.249.012-.251.01-.253.008-.255.005-.256.004-.258.001-.258-.001-.256-.004-.255-.005-.253-.008-.251-.01-.249-.012-.247-.015-.245-.016-.243-.019-.241-.02-.238-.023-.236-.024-.234-.027-.231-.028-.228-.031-.226-.032-.223-.034-.22-.036-.217-.038-.214-.04-.211-.041-.208-.043-.204-.045-.201-.046-.198-.048-.195-.05-.19-.051-.187-.053-.184-.054-.179-.056-.176-.057-.172-.059-.167-.06-.164-.061-.159-.063-.155-.064-.151-.066-.074-.033-.072-.033-.072-.034-.07-.034-.069-.035-.068-.035-.067-.035-.066-.035-.064-.036-.063-.036-.062-.036-.061-.036-.06-.037-.058-.037-.057-.037-.056-.038-.055-.038-.053-.038-.052-.038-.051-.039-.049-.039-.049-.039-.046-.039-.046-.04-.044-.04-.043-.04-.041-.04-.04-.041-.039-.041-.037-.041-.036-.041-.034-.041-.033-.042-.032-.042-.03-.042-.029-.042-.027-.042-.026-.043-.024-.043-.023-.043-.021-.043-.02-.043-.018-.044-.017-.043-.015-.044-.013-.044-.012-.044-.011-.045-.009-.044-.007-.045-.006-.045-.004-.045-.002-.045-.001-.045v-17l.001-.045.002-.045.004-.045.006-.045.007-.045.009-.044.011-.045.012-.044.013-.044.015-.044.017-.043.018-.044.02-.043.021-.043.023-.043.024-.043.026-.043.027-.042.029-.042.03-.042.032-.042.033-.042.034-.041.036-.041.037-.041.039-.041.04-.041.041-.04.043-.04.044-.04.046-.04.046-.039.049-.039.049-.039.051-.039.052-.038.053-.038.055-.038.056-.038.057-.037.058-.037.06-.037.061-.036.062-.036.063-.036.064-.036.066-.035.067-.035.068-.035.069-.035.07-.034.072-.034.072-.033.074-.033.151-.066.155-.064.159-.063.164-.061.167-.06.172-.059.176-.057.179-.056.184-.054.187-.053.19-.051.195-.05.198-.048.201-.046.204-.045.208-.043.211-.041.214-.04.217-.038.22-.036.223-.034.226-.032.228-.031.231-.028.234-.027.236-.024.238-.023.241-.02.243-.019.245-.016.247-.015.249-.012.251-.01.253-.008.255-.005.256-.004.258-.001.258.001zm-9.258 20.499v.01l.001.021.003.021.004.022.005.021.006.022.007.022.009.023.01.022.011.023.012.023.013.023.015.023.016.024.017.023.018.024.019.024.021.024.022.025.023.024.024.025.052.049.056.05.061.051.066.051.07.051.075.051.079.052.084.052.088.052.092.052.097.052.102.051.105.052.11.052.114.051.119.051.123.051.127.05.131.05.135.05.139.048.144.049.147.047.152.047.155.047.16.045.163.045.167.043.171.043.176.041.178.041.183.039.187.039.19.037.194.035.197.035.202.033.204.031.209.03.212.029.216.027.219.025.222.024.226.021.23.02.233.018.236.016.24.015.243.012.246.01.249.008.253.005.256.004.259.001.26-.001.257-.004.254-.005.25-.008.247-.011.244-.012.241-.014.237-.016.233-.018.231-.021.226-.021.224-.024.22-.026.216-.027.212-.028.21-.031.205-.031.202-.034.198-.034.194-.036.191-.037.187-.039.183-.04.179-.04.175-.042.172-.043.168-.044.163-.045.16-.046.155-.046.152-.047.148-.048.143-.049.139-.049.136-.05.131-.05.126-.05.123-.051.118-.052.114-.051.11-.052.106-.052.101-.052.096-.052.092-.052.088-.053.083-.051.079-.052.074-.052.07-.051.065-.051.06-.051.056-.05.051-.05.023-.024.023-.025.021-.024.02-.024.019-.024.018-.024.017-.024.015-.023.014-.024.013-.023.012-.023.01-.023.01-.022.008-.022.006-.022.006-.022.004-.022.004-.021.001-.021.001-.021v-4.127l-.077.055-.08.053-.083.054-.085.053-.087.052-.09.052-.093.051-.095.05-.097.05-.1.049-.102.049-.105.048-.106.047-.109.047-.111.046-.114.045-.115.045-.118.044-.12.043-.122.042-.124.042-.126.041-.128.04-.13.04-.132.038-.134.038-.135.037-.138.037-.139.035-.142.035-.143.034-.144.033-.147.032-.148.031-.15.03-.151.03-.153.029-.154.027-.156.027-.158.026-.159.025-.161.024-.162.023-.163.022-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.011-.178.01-.179.008-.179.008-.181.006-.182.005-.182.004-.184.003-.184.002h-.37l-.184-.002-.184-.003-.182-.004-.182-.005-.181-.006-.179-.008-.179-.008-.178-.01-.176-.011-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.022-.162-.023-.161-.024-.159-.025-.157-.026-.156-.027-.155-.027-.153-.029-.151-.03-.15-.03-.148-.031-.146-.032-.145-.033-.143-.034-.141-.035-.14-.035-.137-.037-.136-.037-.134-.038-.132-.038-.13-.04-.128-.04-.126-.041-.124-.042-.122-.042-.12-.044-.117-.043-.116-.045-.113-.045-.112-.046-.109-.047-.106-.047-.105-.048-.102-.049-.1-.049-.097-.05-.095-.05-.093-.052-.09-.051-.087-.052-.085-.053-.083-.054-.08-.054-.077-.054v4.127zm0-5.654v.011l.001.021.003.021.004.021.005.022.006.022.007.022.009.022.01.022.011.023.012.023.013.023.015.024.016.023.017.024.018.024.019.024.021.024.022.024.023.025.024.024.052.05.056.05.061.05.066.051.07.051.075.052.079.051.084.052.088.052.092.052.097.052.102.052.105.052.11.051.114.051.119.052.123.05.127.051.131.05.135.049.139.049.144.048.147.048.152.047.155.046.16.045.163.045.167.044.171.042.176.042.178.04.183.04.187.038.19.037.194.036.197.034.202.033.204.032.209.03.212.028.216.027.219.025.222.024.226.022.23.02.233.018.236.016.24.014.243.012.246.01.249.008.253.006.256.003.259.001.26-.001.257-.003.254-.006.25-.008.247-.01.244-.012.241-.015.237-.016.233-.018.231-.02.226-.022.224-.024.22-.025.216-.027.212-.029.21-.03.205-.032.202-.033.198-.035.194-.036.191-.037.187-.039.183-.039.179-.041.175-.042.172-.043.168-.044.163-.045.16-.045.155-.047.152-.047.148-.048.143-.048.139-.05.136-.049.131-.05.126-.051.123-.051.118-.051.114-.052.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.051.07-.052.065-.051.06-.05.056-.051.051-.049.023-.025.023-.024.021-.025.02-.024.019-.024.018-.024.017-.024.015-.023.014-.023.013-.024.012-.022.01-.023.01-.023.008-.022.006-.022.006-.022.004-.021.004-.022.001-.021.001-.021v-4.139l-.077.054-.08.054-.083.054-.085.052-.087.053-.09.051-.093.051-.095.051-.097.05-.1.049-.102.049-.105.048-.106.047-.109.047-.111.046-.114.045-.115.044-.118.044-.12.044-.122.042-.124.042-.126.041-.128.04-.13.039-.132.039-.134.038-.135.037-.138.036-.139.036-.142.035-.143.033-.144.033-.147.033-.148.031-.15.03-.151.03-.153.028-.154.028-.156.027-.158.026-.159.025-.161.024-.162.023-.163.022-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.011-.178.009-.179.009-.179.007-.181.007-.182.005-.182.004-.184.003-.184.002h-.37l-.184-.002-.184-.003-.182-.004-.182-.005-.181-.007-.179-.007-.179-.009-.178-.009-.176-.011-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.022-.162-.023-.161-.024-.159-.025-.157-.026-.156-.027-.155-.028-.153-.028-.151-.03-.15-.03-.148-.031-.146-.033-.145-.033-.143-.033-.141-.035-.14-.036-.137-.036-.136-.037-.134-.038-.132-.039-.13-.039-.128-.04-.126-.041-.124-.042-.122-.043-.12-.043-.117-.044-.116-.044-.113-.046-.112-.046-.109-.046-.106-.047-.105-.048-.102-.049-.1-.049-.097-.05-.095-.051-.093-.051-.09-.051-.087-.053-.085-.052-.083-.054-.08-.054-.077-.054v4.139zm0-5.666v.011l.001.02.003.022.004.021.005.022.006.021.007.022.009.023.01.022.011.023.012.023.013.023.015.023.016.024.017.024.018.023.019.024.021.025.022.024.023.024.024.025.052.05.056.05.061.05.066.051.07.051.075.052.079.051.084.052.088.052.092.052.097.052.102.052.105.051.11.052.114.051.119.051.123.051.127.05.131.05.135.05.139.049.144.048.147.048.152.047.155.046.16.045.163.045.167.043.171.043.176.042.178.04.183.04.187.038.19.037.194.036.197.034.202.033.204.032.209.03.212.028.216.027.219.025.222.024.226.021.23.02.233.018.236.017.24.014.243.012.246.01.249.008.253.006.256.003.259.001.26-.001.257-.003.254-.006.25-.008.247-.01.244-.013.241-.014.237-.016.233-.018.231-.02.226-.022.224-.024.22-.025.216-.027.212-.029.21-.03.205-.032.202-.033.198-.035.194-.036.191-.037.187-.039.183-.039.179-.041.175-.042.172-.043.168-.044.163-.045.16-.045.155-.047.152-.047.148-.048.143-.049.139-.049.136-.049.131-.051.126-.05.123-.051.118-.052.114-.051.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.052.07-.051.065-.051.06-.051.056-.05.051-.049.023-.025.023-.025.021-.024.02-.024.019-.024.018-.024.017-.024.015-.023.014-.024.013-.023.012-.023.01-.022.01-.023.008-.022.006-.022.006-.022.004-.022.004-.021.001-.021.001-.021v-4.153l-.077.054-.08.054-.083.053-.085.053-.087.053-.09.051-.093.051-.095.051-.097.05-.1.049-.102.048-.105.048-.106.048-.109.046-.111.046-.114.046-.115.044-.118.044-.12.043-.122.043-.124.042-.126.041-.128.04-.13.039-.132.039-.134.038-.135.037-.138.036-.139.036-.142.034-.143.034-.144.033-.147.032-.148.032-.15.03-.151.03-.153.028-.154.028-.156.027-.158.026-.159.024-.161.024-.162.023-.163.023-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.01-.178.01-.179.009-.179.007-.181.006-.182.006-.182.004-.184.003-.184.001-.185.001-.185-.001-.184-.001-.184-.003-.182-.004-.182-.006-.181-.006-.179-.007-.179-.009-.178-.01-.176-.01-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.023-.162-.023-.161-.024-.159-.024-.157-.026-.156-.027-.155-.028-.153-.028-.151-.03-.15-.03-.148-.032-.146-.032-.145-.033-.143-.034-.141-.034-.14-.036-.137-.036-.136-.037-.134-.038-.132-.039-.13-.039-.128-.041-.126-.041-.124-.041-.122-.043-.12-.043-.117-.044-.116-.044-.113-.046-.112-.046-.109-.046-.106-.048-.105-.048-.102-.048-.1-.05-.097-.049-.095-.051-.093-.051-.09-.052-.087-.052-.085-.053-.083-.053-.08-.054-.077-.054v4.153zm8.74-8.179l-.257.004-.254.005-.25.008-.247.011-.244.012-.241.014-.237.016-.233.018-.231.021-.226.022-.224.023-.22.026-.216.027-.212.028-.21.031-.205.032-.202.033-.198.034-.194.036-.191.038-.187.038-.183.04-.179.041-.175.042-.172.043-.168.043-.163.045-.16.046-.155.046-.152.048-.148.048-.143.048-.139.049-.136.05-.131.05-.126.051-.123.051-.118.051-.114.052-.11.052-.106.052-.101.052-.096.052-.092.052-.088.052-.083.052-.079.052-.074.051-.07.052-.065.051-.06.05-.056.05-.051.05-.023.025-.023.024-.021.024-.02.025-.019.024-.018.024-.017.023-.015.024-.014.023-.013.023-.012.023-.01.023-.01.022-.008.022-.006.023-.006.021-.004.022-.004.021-.001.021-.001.021.001.021.001.021.004.021.004.022.006.021.006.023.008.022.01.022.01.023.012.023.013.023.014.023.015.024.017.023.018.024.019.024.02.025.021.024.023.024.023.025.051.05.056.05.06.05.065.051.07.052.074.051.079.052.083.052.088.052.092.052.096.052.101.052.106.052.11.052.114.052.118.051.123.051.126.051.131.05.136.05.139.049.143.048.148.048.152.048.155.046.16.046.163.045.168.043.172.043.175.042.179.041.183.04.187.038.191.038.194.036.198.034.202.033.205.032.21.031.212.028.216.027.22.026.224.023.226.022.231.021.233.018.237.016.241.014.244.012.247.011.25.008.254.005.257.004.26.001.26-.001.257-.004.254-.005.25-.008.247-.011.244-.012.241-.014.237-.016.233-.018.231-.021.226-.022.224-.023.22-.026.216-.027.212-.028.21-.031.205-.032.202-.033.198-.034.194-.036.191-.038.187-.038.183-.04.179-.041.175-.042.172-.043.168-.043.163-.045.16-.046.155-.046.152-.048.148-.048.143-.048.139-.049.136-.05.131-.05.126-.051.123-.051.118-.051.114-.052.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.051.07-.052.065-.051.06-.05.056-.05.051-.05.023-.025.023-.024.021-.024.02-.025.019-.024.018-.024.017-.023.015-.024.014-.023.013-.023.012-.023.01-.023.01-.022.008-.022.006-.023.006-.021.004-.022.004-.021.001-.021.001-.021-.001-.021-.001-.021-.004-.021-.004-.022-.006-.021-.006-.023-.008-.022-.01-.022-.01-.023-.012-.023-.013-.023-.014-.023-.015-.024-.017-.023-.018-.024-.019-.024-.02-.025-.021-.024-.023-.024-.023-.025-.051-.05-.056-.05-.06-.05-.065-.051-.07-.052-.074-.051-.079-.052-.083-.052-.088-.052-.092-.052-.096-.052-.101-.052-.106-.052-.11-.052-.114-.052-.118-.051-.123-.051-.126-.051-.131-.05-.136-.05-.139-.049-.143-.048-.148-.048-.152-.048-.155-.046-.16-.046-.163-.045-.168-.043-.172-.043-.175-.042-.179-.041-.183-.04-.187-.038-.191-.038-.194-.036-.198-.034-.202-.033-.205-.032-.21-.031-.212-.028-.216-.027-.22-.026-.224-.023-.226-.022-.231-.021-.233-.018-.237-.016-.241-.014-.244-.012-.247-.011-.25-.008-.254-.005-.257-.004-.26-.001-.26.001z")},"insertDatabaseIcon"),Fr=g(function(e,t){e.append("defs").append("symbol").attr("id",t+"-computer").attr("width","24").attr("height","24").append("path").attr("transform","scale(.5)").attr("d","M2 2v13h20v-13h-20zm18 11h-16v-9h16v9zm-10.228 6l.466-1h3.524l.467 1h-4.457zm14.228 3h-24l2-6h2.104l-1.33 4h18.45l-1.297-4h2.073l2 6zm-5-10h-14v-7h14v7z")},"insertComputerIcon"),qr=g(function(e,t){e.append("defs").append("symbol").attr("id",t+"-clock").attr("width","24").attr("height","24").append("path").attr("transform","scale(.5)").attr("d","M12 2c5.514 0 10 4.486 10 10s-4.486 10-10 10-10-4.486-10-10 4.486-10 10-10zm0-2c-6.627 0-12 5.373-12 12s5.373 12 12 12 12-5.373 12-12-5.373-12-12-12zm5.848 12.459c.202.038.202.333.001.372-1.907.361-6.045 1.111-6.547 1.111-.719 0-1.301-.582-1.301-1.301 0-.512.77-5.447 1.125-7.445.034-.192.312-.181.343.014l.985 6.238 5.394 1.011z")},"insertClockIcon"),Hr=g(function(e,t){e.append("defs").append("marker").attr("id",t+"-arrowhead").attr("refX",7.9).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto-start-reverse").append("path").attr("d","M -1 0 L 10 5 L 0 10 z")},"insertArrowHead"),zr=g(function(e,t){e.append("defs").append("marker").attr("id",t+"-filled-head").attr("refX",15.5).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L14,7 L9,1 Z")},"insertArrowFilledHead"),Ur=g(function(e,t){e.append("defs").append("marker").attr("id",t+"-sequencenumber").attr("refX",15).attr("refY",15).attr("markerWidth",60).attr("markerHeight",40).attr("orient","auto").append("circle").attr("cx",15).attr("cy",15).attr("r",6)},"insertSequenceNumber"),Gr=g(function(e,t){e.append("defs").append("marker").attr("id",t+"-crosshead").attr("markerWidth",15).attr("markerHeight",8).attr("orient","auto").attr("refX",4).attr("refY",4.5).append("path").attr("fill","none").attr("stroke","#000000").style("stroke-dasharray","0, 0").attr("stroke-width","1pt").attr("d","M 1,2 L 6,7 M 6,2 L 1,7")},"insertArrowCrossHead"),Xr=g(function(e,t){let{theme:a}=t;e.append("defs").append("filter").attr("id","drop-shadow").attr("height","130%").attr("width","130%").append("feDropShadow").attr("dx","4").attr("dy","4").attr("stdDeviation",0).attr("flood-opacity","0.06").attr("flood-color",`${a==="redux"||a==="redux-color"?"#000000":"#FFFFFF"}`)},"insertDropShadow"),ir=g(function(){return{x:0,y:0,fill:void 0,anchor:void 0,style:"#666",width:void 0,height:void 0,textMargin:0,rx:0,ry:0,tspan:!0,valign:void 0}},"getTextObj"),Jr=g(function(){return{x:0,y:0,fill:"#EDF2AE",stroke:"#666",width:100,anchor:"start",height:100,rx:0,ry:0}},"getNoteRect"),Et=(function(){function e(c,s,n,E,T,l,x){let u=s.append("text").attr("x",n+T/2).attr("y",E+l/2+5).style("text-anchor","middle").text(c);i(u,x)}g(e,"byText");function t(c,s,n,E,T,l,x,u){let{actorFontSize:R,actorFontFamily:p,actorFontWeight:f}=u,[_,I]=ae(R),O=c.split(w.lineBreakRegex);for(let L=0;L<O.length;L++){let S=L*_-_*(O.length-1)/2,A=s.append("text").attr("x",n+T/2).attr("y",E).style("text-anchor","middle").style("font-size",I).style("font-weight",f).style("font-family",p);A.append("tspan").attr("x",n+T/2).attr("dy",S).text(O[L]),A.attr("y",E+l/2).attr("dominant-baseline","central").attr("alignment-baseline","central"),i(A,x)}}g(t,"byTspan");function a(c,s,n,E,T,l,x,u){let R=s.append("switch"),f=R.append("foreignObject").attr("x",n).attr("y",E).attr("width",T).attr("height",l).append("xhtml:div").style("display","table").style("height","100%").style("width","100%");f.append("div").style("display","table-cell").style("text-align","center").style("vertical-align","middle").text(c),t(c,R,n,E,T,l,x,u),i(f,x)}g(a,"byFo");async function r(c,s,n,E,T,l,x,u){let R=await Ot(c,kt()),p=s.append("switch"),_=p.append("foreignObject").attr("x",n+T/2-R.width/2).attr("y",E+l/2-R.height/2).attr("width",R.width).attr("height",R.height).append("xhtml:div").style("height","100%").style("width","100%");_.append("div").style("text-align","center").style("vertical-align","middle").html(await ee(c,kt())),t(c,p,n,E,T,l,x,u),i(_,x)}g(r,"byKatex");function i(c,s){for(let n in s)s.hasOwnProperty(n)&&c.attr(n,s[n])}return g(i,"_setTextAttrs"),function(c,s=!1){return s?r:c.textPlacement==="fo"?a:c.textPlacement==="old"?e:t}})(),Qr=(function(){function e(i,c,s,n,E,T,l){let x=c.append("text").attr("x",s).attr("y",n).style("text-anchor","start").text(i);r(x,l)}g(e,"byText");function t(i,c,s,n,E,T,l,x){let{actorFontSize:u,actorFontFamily:R,actorFontWeight:p}=x,f=i.split(w.lineBreakRegex);for(let _=0;_<f.length;_++){let I=_*u-u*(f.length-1)/2,O=c.append("text").attr("x",s).attr("y",n).style("text-anchor","start").style("font-size",u).style("font-weight",p).style("font-family",R);O.append("tspan").attr("x",s).attr("dy",I).text(f[_]),O.attr("y",n+T/2).attr("dominant-baseline","central").attr("alignment-baseline","central"),r(O,l)}}g(t,"byTspan");function a(i,c,s,n,E,T,l,x){let u=c.append("switch"),p=u.append("foreignObject").attr("x",s).attr("y",n).attr("width",E).attr("height",T).append("xhtml:div").style("display","table").style("height","100%").style("width","100%");p.append("div").style("display","table-cell").style("text-align","center").style("vertical-align","middle").text(i),t(i,u,s,n,E,T,l,x),r(p,l)}g(a,"byFo");function r(i,c){for(let s in c)c.hasOwnProperty(s)&&i.attr(s,c[s])}return g(r,"_setTextAttrs"),function(i){return i.textPlacement==="fo"?a:i.textPlacement==="old"?e:t}})(),Zr=g(function(e,t){e.append("defs").append("marker").attr("id",t+"-solidTopArrowHead").attr("refX",7.9).attr("refY",7.25).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto-start-reverse").append("path").attr("d","M 0 0 L 10 8 L 0 8 z")},"insertSolidTopArrowHead"),$r=g(function(e,t){e.append("defs").append("marker").attr("id",t+"-solidBottomArrowHead").attr("refX",7.9).attr("refY",.75).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto-start-reverse").append("path").attr("d","M 0 0 L 10 0 L 0 8 z")},"insertSolidBottomArrowHead"),jr=g(function(e,t){e.append("defs").append("marker").attr("id",t+"-stickTopArrowHead").attr("refX",7.5).attr("refY",7).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto-start-reverse").append("path").attr("d","M 0 0 L 7 7").attr("stroke","black").attr("stroke-width",1.5).attr("fill","none")},"insertStickTopArrowHead"),ta=g(function(e,t){e.append("defs").append("marker").attr("id",t+"-stickBottomArrowHead").attr("refX",7.5).attr("refY",0).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto-start-reverse").append("path").attr("d","M 0 7 L 7 0").attr("stroke","black").attr("stroke-width",1.5).attr("fill","none")},"insertStickBottomArrowHead"),q={drawRect:Pt,drawText:mt,drawLabel:rr,drawActor:Mr,drawBox:Br,drawPopup:Ar,anchorElement:Vr,drawActivation:Yr,drawLoop:Wr,drawBackgroundRect:sr,insertArrowHead:Hr,insertArrowFilledHead:zr,insertSequenceNumber:Ur,insertArrowCrossHead:Gr,insertDatabaseIcon:Kr,insertComputerIcon:Fr,insertClockIcon:qr,getTextObj:ir,getNoteRect:Jr,fixLifeLineHeights:ar,sanitizeUrl:ce.sanitizeUrl,insertDropShadow:Xr,insertSolidTopArrowHead:Zr,insertSolidBottomArrowHead:$r,insertStickTopArrowHead:jr,insertStickBottomArrowHead:ta},h={},y={data:{startx:void 0,stopx:void 0,starty:void 0,stopy:void 0},verticalPos:0,sequenceItems:[],activations:[],models:{getHeight:g(function(){return Math.max.apply(null,this.actors.length===0?[0]:this.actors.map(e=>e.height||0))+(this.loops.length===0?0:this.loops.map(e=>e.height||0).reduce((e,t)=>e+t))+(this.messages.length===0?0:this.messages.map(e=>e.height||0).reduce((e,t)=>e+t))+(this.notes.length===0?0:this.notes.map(e=>e.height||0).reduce((e,t)=>e+t))},"getHeight"),clear:g(function(){this.actors=[],this.boxes=[],this.loops=[],this.messages=[],this.notes=[]},"clear"),addBox:g(function(e){this.boxes.push(e)},"addBox"),addActor:g(function(e){this.actors.push(e)},"addActor"),addLoop:g(function(e){this.loops.push(e)},"addLoop"),addMessage:g(function(e){this.messages.push(e)},"addMessage"),addNote:g(function(e){this.notes.push(e)},"addNote"),lastActor:g(function(){return this.actors[this.actors.length-1]},"lastActor"),lastLoop:g(function(){return this.loops[this.loops.length-1]},"lastLoop"),lastMessage:g(function(){return this.messages[this.messages.length-1]},"lastMessage"),lastNote:g(function(){return this.notes[this.notes.length-1]},"lastNote"),actors:[],boxes:[],loops:[],messages:[],notes:[]},init:g(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,cr($())},"init"),updateVal:g(function(e,t,a,r){e[t]===void 0?e[t]=a:e[t]=r(a,e[t])},"updateVal"),updateBounds:g(function(e,t,a,r){let i=this,c=0;function s(n){return g(function(T){c++;let l=i.sequenceItems.length-c+1;i.updateVal(T,"starty",t-l*h.boxMargin,Math.min),i.updateVal(T,"stopy",r+l*h.boxMargin,Math.max),i.updateVal(y.data,"startx",e-l*h.boxMargin,Math.min),i.updateVal(y.data,"stopx",a+l*h.boxMargin,Math.max),n!=="activation"&&(i.updateVal(T,"startx",e-l*h.boxMargin,Math.min),i.updateVal(T,"stopx",a+l*h.boxMargin,Math.max),i.updateVal(y.data,"starty",t-l*h.boxMargin,Math.min),i.updateVal(y.data,"stopy",r+l*h.boxMargin,Math.max))},"updateItemBounds")}g(s,"updateFn"),this.sequenceItems.forEach(s()),this.activations.forEach(s("activation"))},"updateBounds"),insert:g(function(e,t,a,r){let i=w.getMin(e,a),c=w.getMax(e,a),s=w.getMin(t,r),n=w.getMax(t,r);this.updateVal(y.data,"startx",i,Math.min),this.updateVal(y.data,"starty",s,Math.min),this.updateVal(y.data,"stopx",c,Math.max),this.updateVal(y.data,"stopy",n,Math.max),this.updateBounds(i,s,c,n)},"insert"),newActivation:g(function(e,t,a){let r=a.get(e.from),i=Ut(e.from).length||0,c=r.x+r.width/2+(i-1)*h.activationWidth/2;this.activations.push({startx:c,starty:this.verticalPos+2,stopx:c+h.activationWidth,stopy:void 0,actor:e.from,anchored:q.anchorElement(t)})},"newActivation"),endActivation:g(function(e){let t=this.activations.map(function(a){return a.actor}).lastIndexOf(e.from);return this.activations.splice(t,1)[0]},"endActivation"),createLoop:g(function(e={message:void 0,wrap:!1,width:void 0},t){return{startx:void 0,starty:this.verticalPos,stopx:void 0,stopy:void 0,title:e.message,wrap:e.wrap,width:e.width,height:0,fill:t}},"createLoop"),newLoop:g(function(e={message:void 0,wrap:!1,width:void 0},t){this.sequenceItems.push(this.createLoop(e,t))},"newLoop"),endLoop:g(function(){return this.sequenceItems.pop()},"endLoop"),isLoopOverlap:g(function(){return this.sequenceItems.length?this.sequenceItems[this.sequenceItems.length-1].overlap:!1},"isLoopOverlap"),addSectionToLoop:g(function(e){let t=this.sequenceItems.pop();t.sections=t.sections||[],t.sectionTitles=t.sectionTitles||[],t.sections.push({y:y.getVerticalPos(),height:0}),t.sectionTitles.push(e),this.sequenceItems.push(t)},"addSectionToLoop"),saveVerticalPos:g(function(){this.isLoopOverlap()&&(this.savedVerticalPos=this.verticalPos)},"saveVerticalPos"),resetVerticalPos:g(function(){this.isLoopOverlap()&&(this.verticalPos=this.savedVerticalPos)},"resetVerticalPos"),bumpVerticalPos:g(function(e){this.verticalPos=this.verticalPos+e,this.data.stopy=w.getMax(this.data.stopy,this.verticalPos)},"bumpVerticalPos"),getVerticalPos:g(function(){return this.verticalPos},"getVerticalPos"),getBounds:g(function(){return{bounds:this.data,models:this.models}},"getBounds")},ea=g(async function(e,t,a){y.bumpVerticalPos(h.boxMargin),t.height=h.boxMargin,t.starty=y.getVerticalPos();let r=ht();r.x=t.startx,r.y=t.starty,r.width=t.width||h.width,r.class="note";let i=e.append("g");i.attr("data-et","note"),i.attr("data-id","i"+a);let c=q.drawRect(i,r),s=Kt();s.x=t.startx,s.y=t.starty,s.width=r.width,s.dy="1em",s.text=t.message,s.class="noteText",s.fontFamily=h.noteFontFamily,s.fontSize=h.noteFontSize,s.fontWeight=h.noteFontWeight,s.anchor=h.noteAlign,s.textMargin=h.noteMargin,s.valign="center";let n=Z(s.text)?await qt(i,s):mt(i,s),E=Math.round(n.map(T=>(T._groups||T)[0][0].getBBox().height).reduce((T,l)=>T+l));c.attr("height",E+2*h.noteMargin),t.height+=E+2*h.noteMargin,y.bumpVerticalPos(E+2*h.noteMargin),t.stopy=t.starty+E+2*h.noteMargin,t.stopx=t.startx+r.width,y.insert(t.startx,t.starty,t.stopx,t.stopy),y.models.addNote(t)},"drawNote"),tr=g(function(e,t,a,r,i,c,s){let n=r.db.getActors(),E=n.get(t.from),T=n.get(t.to),l=a.sequenceVisible,x=E.x+E.width/2,u=T.x+T.width/2,R=x<=u,p=Tr(t,r),f=e.append("g"),_=16.5,I=g((N,B)=>{let V=N?_:-_;return B?-V:V},"getCircleOffset"),O=g(N=>{f.append("circle").attr("cx",N).attr("cy",s).attr("r",5).attr("width",10).attr("height",10)},"drawCircle"),{CENTRAL_CONNECTION:L,CENTRAL_CONNECTION_REVERSE:S,CENTRAL_CONNECTION_DUAL:A}=r.db.LINETYPE;if(l)switch(t.centralConnection){case L:p&&(u+=I(R,!0));break;case S:p||(x+=I(R,!1));break;case A:p?u+=I(R,!0):x+=I(R,!1);break}switch(t.centralConnection){case L:O(u);break;case S:O(x);break;case A:O(x),O(u);break}},"drawCentralConnection"),yt=g(e=>({fontFamily:e.messageFontFamily,fontSize:e.messageFontSize,fontWeight:e.messageFontWeight}),"messageFont"),Lt=g(e=>({fontFamily:e.noteFontFamily,fontSize:e.noteFontSize,fontWeight:e.noteFontWeight}),"noteFont"),ne=g(e=>({fontFamily:e.actorFontFamily,fontSize:e.actorFontSize,fontWeight:e.actorFontWeight}),"actorFont");async function nr(e,t){y.bumpVerticalPos(10);let{startx:a,stopx:r,message:i}=t,c=w.splitBreaks(i).length,s=Z(i),n=s?await Ot(i,$()):X.calculateTextDimensions(i,yt(h));if(!s){let x=n.height/c;t.height+=x,y.bumpVerticalPos(x)}let E,T=n.height-10,l=n.width;if(a===r){E=y.getVerticalPos()+T,h.rightAngles||(T+=h.boxMargin,E=y.getVerticalPos()+T),T+=30;let x=w.getMax(l/2,h.width/2);y.insert(a-x,y.getVerticalPos()-10+T,r+x,y.getVerticalPos()+30+T)}else T+=h.boxMargin,E=y.getVerticalPos()+T,y.insert(a,E-10,r,E);return y.bumpVerticalPos(T),t.height+=T,t.stopy=t.starty+t.height,y.insert(t.fromBounds,t.starty,t.toBounds,t.stopy),E}g(nr,"boundMessage");var ra=g(async function(e,t,a,r,i,c){let{startx:s,stopx:n,starty:E,message:T,type:l,sequenceIndex:x,sequenceVisible:u}=t,R=X.calculateTextDimensions(T,yt(h)),p=Kt();p.x=Math.min(s,n),p.y=E+10,p.width=Math.abs(n-s),p.class="messageText",p.dy="1em",p.text=T,p.fontFamily=h.messageFontFamily,p.fontSize=h.messageFontSize,p.fontWeight=h.messageFontWeight,p.anchor=h.messageAlign,p.valign="center",p.textMargin=h.wrapPadding,p.tspan=!1,Z(p.text)?await qt(e,p,{startx:s,stopx:n,starty:a}):mt(e,p);let f=R.width,_;if(s===n){let O=u||h.showSequenceNumbers,L=Tr(i,r),S=ha(i,r),A=s+(O&&(L||S)?10:0);h.rightAngles?_=e.append("path").attr("d",`M  ${A},${a} H ${s+w.getMax(h.width/2,f/2)} V ${a+25} H ${s}`):_=e.append("path").attr("d","M "+A+","+a+" C "+(A+60)+","+(a-10)+" "+(s+60)+","+(a+30)+" "+s+","+(a+20)),se(i,r)&&tr(e,i,t,r,s,n,a)}else _=e.append("line"),_.attr("x1",s),_.attr("y1",a),_.attr("x2",n),_.attr("y2",a),se(i,r)&&tr(e,i,t,r,s,n,a);l===r.db.LINETYPE.DOTTED||l===r.db.LINETYPE.DOTTED_CROSS||l===r.db.LINETYPE.DOTTED_POINT||l===r.db.LINETYPE.DOTTED_OPEN||l===r.db.LINETYPE.BIDIRECTIONAL_DOTTED||l===r.db.LINETYPE.SOLID_TOP_DOTTED||l===r.db.LINETYPE.SOLID_BOTTOM_DOTTED||l===r.db.LINETYPE.STICK_TOP_DOTTED||l===r.db.LINETYPE.STICK_BOTTOM_DOTTED||l===r.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED||l===r.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED||l===r.db.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED||l===r.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED?(_.style("stroke-dasharray","3, 3"),_.attr("class","messageLine1")):_.attr("class","messageLine0"),_.attr("data-et","message"),_.attr("data-id","i"+t.id),_.attr("data-from",t.from),_.attr("data-to",t.to);let I="";if(h.arrowMarkerAbsolute&&(I=Ye(!0)),_.attr("stroke-width",2),_.attr("stroke","none"),_.style("fill","none"),(l===r.db.LINETYPE.SOLID_TOP||l===r.db.LINETYPE.SOLID_TOP_DOTTED)&&_.attr("marker-end","url("+I+"#"+c+"-solidTopArrowHead)"),(l===r.db.LINETYPE.SOLID_BOTTOM||l===r.db.LINETYPE.SOLID_BOTTOM_DOTTED)&&_.attr("marker-end","url("+I+"#"+c+"-solidBottomArrowHead)"),(l===r.db.LINETYPE.STICK_TOP||l===r.db.LINETYPE.STICK_TOP_DOTTED)&&_.attr("marker-end","url("+I+"#"+c+"-stickTopArrowHead)"),(l===r.db.LINETYPE.STICK_BOTTOM||l===r.db.LINETYPE.STICK_BOTTOM_DOTTED)&&_.attr("marker-end","url("+I+"#"+c+"-stickBottomArrowHead)"),(l===r.db.LINETYPE.SOLID_ARROW_TOP_REVERSE||l===r.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED)&&_.attr("marker-start","url("+I+"#"+c+"-solidBottomArrowHead)"),(l===r.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE||l===r.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED)&&_.attr("marker-start","url("+I+"#"+c+"-solidTopArrowHead)"),(l===r.db.LINETYPE.STICK_ARROW_TOP_REVERSE||l===r.db.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED)&&_.attr("marker-start","url("+I+"#"+c+"-stickBottomArrowHead)"),(l===r.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE||l===r.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED)&&_.attr("marker-start","url("+I+"#"+c+"-stickTopArrowHead)"),(l===r.db.LINETYPE.SOLID||l===r.db.LINETYPE.DOTTED)&&_.attr("marker-end","url("+I+"#"+c+"-arrowhead)"),(l===r.db.LINETYPE.BIDIRECTIONAL_SOLID||l===r.db.LINETYPE.BIDIRECTIONAL_DOTTED)&&(_.attr("marker-start","url("+I+"#"+c+"-arrowhead)"),_.attr("marker-end","url("+I+"#"+c+"-arrowhead)")),(l===r.db.LINETYPE.SOLID_POINT||l===r.db.LINETYPE.DOTTED_POINT)&&_.attr("marker-end","url("+I+"#"+c+"-filled-head)"),(l===r.db.LINETYPE.SOLID_CROSS||l===r.db.LINETYPE.DOTTED_CROSS)&&_.attr("marker-end","url("+I+"#"+c+"-crosshead)"),u||h.showSequenceNumbers){let O=l===r.db.LINETYPE.BIDIRECTIONAL_SOLID||l===r.db.LINETYPE.BIDIRECTIONAL_DOTTED,L=l===r.db.LINETYPE.SOLID_ARROW_TOP_REVERSE||l===r.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED||l===r.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE||l===r.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED||l===r.db.LINETYPE.STICK_ARROW_TOP_REVERSE||l===r.db.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED||l===r.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE||l===r.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED,S=6,A=se(i,r),N=s,B=n;O?(s<n?N=s+S*2:(N=s-S+(A?-5:0),N+=i?.centralConnection===r.db.LINETYPE.CENTRAL_CONNECTION_DUAL||i?.centralConnection===r.db.LINETYPE.CENTRAL_CONNECTION_REVERSE?-7.5:0),_.attr("x1",N)):L?(n>s?B=n-2*S:(B=n-S,N+=i?.centralConnection===r.db.LINETYPE.CENTRAL_CONNECTION_DUAL||i?.centralConnection===r.db.LINETYPE.CENTRAL_CONNECTION_REVERSE?-7.5:0),B+=A?15:0,_.attr("x2",B),_.attr("x1",N)):_.attr("x1",s+S);let V=0,H=s===n,U=s<=n;H?V=t.fromBounds+1:L?V=U?t.toBounds-1:t.fromBounds+1:V=U?t.fromBounds+1:t.toBounds-1;let G="12px",J=x.toString().length;J>5?G="7px":J>3&&(G="9px"),e.append("line").attr("x1",V).attr("y1",a).attr("x2",V).attr("y2",a).attr("stroke-width",0).attr("marker-start","url("+I+"#"+c+"-sequencenumber)"),e.append("text").attr("x",V).attr("y",a+4).attr("font-family","sans-serif").attr("font-size",G).attr("text-anchor","middle").attr("class","sequenceNumber").text(x)}},"drawMessage"),aa=g(function(e,t,a,r,i,c,s){let n=0,E=0,T,l=0;for(let x of r){let u=t.get(x),R=u.box;T&&T!=R&&(s||y.models.addBox(T),E+=h.boxMargin+T.margin),R&&R!=T&&(s||(R.x=n+E,R.y=i),E+=R.margin),u.width=w.getMax(u.width||h.width,h.width),u.height=w.getMax(u.height||h.height,h.height),u.margin=u.margin||h.actorMargin,l=w.getMax(l,u.height),a.get(u.name)&&(E+=u.width/2),u.x=n+E,u.starty=y.getVerticalPos(),y.insert(u.x,i,u.x+u.width,u.height),n+=u.width+E,u.box&&(u.box.width=n+R.margin-u.box.x),E=u.margin,T=u.box,y.models.addActor(u)}T&&!s&&y.models.addBox(T),y.bumpVerticalPos(l)},"addActorRenderingData"),oe=g(async function(e,t,a,r,i,c,s){if(r){let n=0;y.bumpVerticalPos(h.boxMargin*2);for(let E of a){let T=t.get(E);T.stopy||(T.stopy=y.getVerticalPos());let l=await q.drawActor(e,T,h,!0,i,c,s);n=w.getMax(n,l)}y.bumpVerticalPos(n+h.boxMargin)}else for(let n of a){let E=t.get(n);await q.drawActor(e,E,h,!1,i,c,s)}},"drawActors"),or=g(function(e,t,a,r){let i=0,c=0;for(let s of a){let n=t.get(s),E=ia(n),T=q.drawPopup(e,n,E,h,h.forceMenus,r);T.height>i&&(i=T.height),T.width+n.x>c&&(c=T.width+n.x)}return{maxHeight:i,maxWidth:c}},"drawActorsPopup"),cr=g(function(e){Ve(h,e),e.fontFamily&&(h.actorFontFamily=h.noteFontFamily=h.messageFontFamily=e.fontFamily),e.fontSize&&(h.actorFontSize=h.noteFontSize=h.messageFontSize=e.fontSize),e.fontWeight&&(h.actorFontWeight=h.noteFontWeight=h.messageFontWeight=e.fontWeight)},"setConf"),Ut=g(function(e){return y.activations.filter(function(t){return t.actor===e})},"actorActivations"),er=g(function(e,t){let a=t.get(e),r=Ut(e),i=r.reduce(function(s,n){return w.getMin(s,n.startx)},a.x+a.width/2-1),c=r.reduce(function(s,n){return w.getMax(s,n.stopx)},a.x+a.width/2+1);return[i,c]},"activationBounds");function dt(e,t,a,r,i){y.bumpVerticalPos(a);let c=r;if(t.id&&t.message&&e[t.id]){let s=e[t.id].width,n=yt(h);t.message=X.wrapLabel(`[${t.message}]`,s-2*h.wrapPadding,n),t.width=s,t.wrap=!0;let E=X.calculateTextDimensions(t.message,n),T=w.getMax(E.height,h.labelBoxHeight);c=r+T,tt.debug(`${T} - ${t.message}`)}i(t),y.bumpVerticalPos(c)}g(dt,"adjustLoopHeightForWrap");function lr(e,t,a,r,i,c,s){function n(l,x){l.x<i.get(e.from).x?(y.insert(t.stopx-x,t.starty,t.startx,t.stopy+l.height/2+h.noteMargin),t.stopx=t.stopx+x):(y.insert(t.startx,t.starty,t.stopx+x,t.stopy+l.height/2+h.noteMargin),t.stopx=t.stopx-x)}g(n,"receiverAdjustment");function E(l,x){l.x<i.get(e.to).x?(y.insert(t.startx-x,t.starty,t.stopx,t.stopy+l.height/2+h.noteMargin),t.startx=t.startx+x):(y.insert(t.stopx,t.starty,t.startx+x,t.stopy+l.height/2+h.noteMargin),t.startx=t.startx-x)}g(E,"senderAdjustment");let T=[Ft.ACTOR,Ft.CONTROL,Ft.ENTITY,Ft.DATABASE];if(c.get(e.to)==r){let l=i.get(e.to),x=T.includes(l.type)?It/2+3:l.width/2+3;n(l,x),l.starty=a-l.height/2,y.bumpVerticalPos(l.height/2)}else if(s.get(e.from)==r){let l=i.get(e.from);if(h.mirrorActors){let x=T.includes(l.type)?It/2:l.width/2;E(l,x)}l.stopy=a-l.height/2,y.bumpVerticalPos(l.height/2)}else if(s.get(e.to)==r){let l=i.get(e.to);if(h.mirrorActors){let x=T.includes(l.type)?It/2+3:l.width/2+3;n(l,x)}l.stopy=a-l.height/2,y.bumpVerticalPos(l.height/2)}}g(lr,"adjustCreatedDestroyedData");var sa=g(async function(e,t,a,r){let{securityLevel:i,sequence:c,look:s}=$();h=c;let n;i==="sandbox"&&(n=wt("#i"+t));let E=i==="sandbox"?wt(n.nodes()[0].contentDocument.body):wt("body"),T=i==="sandbox"?n.nodes()[0].contentDocument:document;y.init(),tt.debug(r.db);let l=i==="sandbox"?E.select(`[id="${t}"]`):wt(`[id="${t}"]`),x=r.db.getActors(),u=r.db.getCreatedActors(),R=r.db.getDestroyedActors(),p=r.db.getBoxes(),f=r.db.getActorKeys(),_=r.db.getMessages(),I=r.db.getDiagramTitle(),O=r.db.hasAtLeastOneBox(),L=r.db.hasAtLeastOneBoxWithTitle(),S=await hr(x,_,r);if(h.height=await dr(x,S,p),q.insertComputerIcon(l,t),q.insertDatabaseIcon(l,t),q.insertClockIcon(l,t),O&&(y.bumpVerticalPos(h.boxMargin),L&&y.bumpVerticalPos(p[0].textMaxHeight)),h.hideUnusedParticipants===!0){let m=new Set;_.forEach(D=>{m.add(D.from),m.add(D.to)}),f=f.filter(D=>m.has(D))}let A=new Map(f.map((m,D)=>[x.get(m)?.name??m,D]));aa(l,x,u,f,0,_,!1);let N=await Ta(_,x,S,r);q.insertArrowHead(l,t),q.insertArrowCrossHead(l,t),q.insertArrowFilledHead(l,t),q.insertSequenceNumber(l,t),q.insertSolidTopArrowHead(l,t),q.insertSolidBottomArrowHead(l,t),q.insertStickTopArrowHead(l,t),q.insertStickBottomArrowHead(l,t),s==="neo"&&q.insertDropShadow(l,h);function B(m,D){let lt=y.endActivation(m);lt.starty+18>D&&(lt.starty=D-6,D+=12),q.drawActivation(l,lt,D,h,Ut(m.from).length,r,A),y.insert(lt.startx,D-10,lt.stopx,D)}g(B,"activeEnd");let V=1,H=1,U=[],G=[],J=0;for(let m of _){let D,lt,at;switch(m.type){case r.db.LINETYPE.NOTE:y.resetVerticalPos(),lt=m.noteModel,await ea(l,lt,m.id);break;case r.db.LINETYPE.ACTIVE_START:y.newActivation(m,l,x);break;case r.db.LINETYPE.CENTRAL_CONNECTION:y.newActivation(m,l,x);break;case r.db.LINETYPE.CENTRAL_CONNECTION_REVERSE:y.newActivation(m,l,x);break;case r.db.LINETYPE.ACTIVE_END:B(m,y.getVerticalPos());break;case r.db.LINETYPE.LOOP_START:dt(N,m,h.boxMargin,h.boxMargin+h.boxTextMargin,W=>y.newLoop(W));break;case r.db.LINETYPE.LOOP_END:D=y.endLoop(),await q.drawLoop(l,D,"loop",h,m),y.bumpVerticalPos(D.stopy-y.getVerticalPos()),y.models.addLoop(D);break;case r.db.LINETYPE.RECT_START:dt(N,m,h.boxMargin,h.boxMargin,W=>y.newLoop(void 0,W.message));break;case r.db.LINETYPE.RECT_END:D=y.endLoop(),G.push(D),y.models.addLoop(D),y.bumpVerticalPos(D.stopy-y.getVerticalPos());break;case r.db.LINETYPE.OPT_START:dt(N,m,h.boxMargin,h.boxMargin+h.boxTextMargin,W=>y.newLoop(W));break;case r.db.LINETYPE.OPT_END:D=y.endLoop(),await q.drawLoop(l,D,"opt",h,m),y.bumpVerticalPos(D.stopy-y.getVerticalPos()),y.models.addLoop(D);break;case r.db.LINETYPE.ALT_START:dt(N,m,h.boxMargin,h.boxMargin+h.boxTextMargin,W=>y.newLoop(W));break;case r.db.LINETYPE.ALT_ELSE:dt(N,m,h.boxMargin+h.boxTextMargin,h.boxMargin,W=>y.addSectionToLoop(W));break;case r.db.LINETYPE.ALT_END:D=y.endLoop(),await q.drawLoop(l,D,"alt",h,m),y.bumpVerticalPos(D.stopy-y.getVerticalPos()),y.models.addLoop(D);break;case r.db.LINETYPE.PAR_START:case r.db.LINETYPE.PAR_OVER_START:dt(N,m,h.boxMargin,h.boxMargin+h.boxTextMargin,W=>y.newLoop(W)),y.saveVerticalPos();break;case r.db.LINETYPE.PAR_AND:dt(N,m,h.boxMargin+h.boxTextMargin,h.boxMargin,W=>y.addSectionToLoop(W));break;case r.db.LINETYPE.PAR_END:D=y.endLoop(),await q.drawLoop(l,D,"par",h,m),y.bumpVerticalPos(D.stopy-y.getVerticalPos()),y.models.addLoop(D);break;case r.db.LINETYPE.AUTONUMBER:V=m.message.start||V,H=m.message.step||H,m.message.visible?r.db.enableSequenceNumbers():r.db.disableSequenceNumbers();break;case r.db.LINETYPE.CRITICAL_START:dt(N,m,h.boxMargin,h.boxMargin+h.boxTextMargin,W=>y.newLoop(W));break;case r.db.LINETYPE.CRITICAL_OPTION:dt(N,m,h.boxMargin+h.boxTextMargin,h.boxMargin,W=>y.addSectionToLoop(W));break;case r.db.LINETYPE.CRITICAL_END:D=y.endLoop(),await q.drawLoop(l,D,"critical",h,m),y.bumpVerticalPos(D.stopy-y.getVerticalPos()),y.models.addLoop(D);break;case r.db.LINETYPE.BREAK_START:dt(N,m,h.boxMargin,h.boxMargin+h.boxTextMargin,W=>y.newLoop(W));break;case r.db.LINETYPE.BREAK_END:D=y.endLoop(),await q.drawLoop(l,D,"break",h,m),y.bumpVerticalPos(D.stopy-y.getVerticalPos()),y.models.addLoop(D);break;default:try{at=m.msgModel,at.starty=y.getVerticalPos(),at.sequenceIndex=V,at.sequenceVisible=r.db.showSequenceNumbers(),at.id=m.id,at.from=m.from,at.to=m.to;let W=await nr(l,at);lr(m,at,W,J,x,u,R),U.push({messageModel:at,lineStartY:W,msg:m}),y.models.addMessage(at)}catch(W){tt.error("error while drawing message",W)}}[r.db.LINETYPE.SOLID_OPEN,r.db.LINETYPE.DOTTED_OPEN,r.db.LINETYPE.SOLID,r.db.LINETYPE.SOLID_TOP,r.db.LINETYPE.SOLID_BOTTOM,r.db.LINETYPE.STICK_TOP,r.db.LINETYPE.STICK_BOTTOM,r.db.LINETYPE.SOLID_TOP_DOTTED,r.db.LINETYPE.SOLID_BOTTOM_DOTTED,r.db.LINETYPE.STICK_TOP_DOTTED,r.db.LINETYPE.STICK_BOTTOM_DOTTED,r.db.LINETYPE.SOLID_ARROW_TOP_REVERSE,r.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE,r.db.LINETYPE.STICK_ARROW_TOP_REVERSE,r.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE,r.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED,r.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED,r.db.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED,r.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED,r.db.LINETYPE.DOTTED,r.db.LINETYPE.SOLID_CROSS,r.db.LINETYPE.DOTTED_CROSS,r.db.LINETYPE.SOLID_POINT,r.db.LINETYPE.DOTTED_POINT,r.db.LINETYPE.BIDIRECTIONAL_SOLID,r.db.LINETYPE.BIDIRECTIONAL_DOTTED].includes(m.type)&&(V=Math.round((V+H)*100)/100),J++}tt.debug("createdActors",u),tt.debug("destroyedActors",R),await oe(l,x,f,!1,t,r,A);for(let m of U)await ra(l,m.messageModel,m.lineStartY,r,m.msg,t);h.mirrorActors&&await oe(l,x,f,!0,t,r,A),G.forEach(m=>q.drawBackgroundRect(l,m)),ar(l,x,f,h);for(let m of y.models.boxes){m.height=y.getVerticalPos()-m.y,y.insert(m.x,m.y,m.x+m.width,m.height);let D=h.boxMargin*2;m.startx=m.x-D,m.starty=m.y-D*.25,m.stopx=m.startx+m.width+2*D,m.stopy=m.starty+m.height+D*.75,m.stroke="rgb(0,0,0, 0.5)",q.drawBox(l,m,h)}O&&y.bumpVerticalPos(h.boxMargin);let et=or(l,x,f,T),{bounds:z}=y.getBounds();z.startx===void 0&&(z.startx=0),z.starty===void 0&&(z.starty=0),z.stopx===void 0&&(z.stopx=0),z.stopy===void 0&&(z.stopy=0);let st=z.stopy-z.starty;st<et.maxHeight&&(st=et.maxHeight);let rt=st+2*h.diagramMarginY;h.mirrorActors&&(rt=rt-h.boxMargin+h.bottomMarginAdj);let it=z.stopx-z.startx;it<et.maxWidth&&(it=et.maxWidth);let Y=it+2*h.diagramMarginX;I&&l.append("text").text(I).attr("x",(z.stopx-z.startx)/2-2*h.diagramMarginX).attr("y",-25),We(l,rt,Y,h.useMaxWidth);let C=I?40:0,Dt=x.size&&s==="neo"?30:0;l.attr("viewBox",z.startx-h.diagramMarginX+" -"+(h.diagramMarginY+C)+" "+Y+" "+(rt+C+Dt)),tt.debug("models:",y.models)},"draw");async function hr(e,t,a){let r={};for(let i of t)if(e.get(i.to)&&e.get(i.from)){let c=e.get(i.to);if(i.placement===a.db.PLACEMENT.LEFTOF&&!c.prevActor||i.placement===a.db.PLACEMENT.RIGHTOF&&!c.nextActor)continue;let s=i.placement!==void 0,n=!s,E=s?Lt(h):yt(h),T=i.wrap?X.wrapLabel(i.message,h.width-2*h.wrapPadding,E):i.message,x=(Z(T)?await Ot(i.message,$()):X.calculateTextDimensions(T,E)).width+2*h.wrapPadding;n&&i.from===c.nextActor?r[i.to]=w.getMax(r[i.to]||0,x):n&&i.from===c.prevActor?r[i.from]=w.getMax(r[i.from]||0,x):n&&i.from===i.to?(r[i.from]=w.getMax(r[i.from]||0,x/2),r[i.to]=w.getMax(r[i.to]||0,x/2)):i.placement===a.db.PLACEMENT.RIGHTOF?r[i.from]=w.getMax(r[i.from]||0,x):i.placement===a.db.PLACEMENT.LEFTOF?r[c.prevActor]=w.getMax(r[c.prevActor]||0,x):i.placement===a.db.PLACEMENT.OVER&&(c.prevActor&&(r[c.prevActor]=w.getMax(r[c.prevActor]||0,x/2)),c.nextActor&&(r[i.from]=w.getMax(r[i.from]||0,x/2)))}return tt.debug("maxMessageWidthPerActor:",r),r}g(hr,"getMaxMessageWidthPerActor");var ia=g(function(e){let t=0,a=ne(h);for(let r in e.links){let c=X.calculateTextDimensions(r,a).width+2*h.wrapPadding+2*h.boxMargin;t<c&&(t=c)}return t},"getRequiredPopupWidth");async function dr(e,t,a){let r=0;for(let c of e.keys()){let s=e.get(c);s.wrap&&(s.description=X.wrapLabel(s.description,h.width-2*h.wrapPadding,ne(h)));let n=Z(s.description)?await Ot(s.description,$()):X.calculateTextDimensions(s.description,ne(h));s.width=s.wrap?h.width:w.getMax(h.width,n.width+2*h.wrapPadding),s.height=s.wrap?w.getMax(n.height,h.height):h.height,r=w.getMax(r,s.height)}for(let c in t){let s=e.get(c);if(!s)continue;let n=e.get(s.nextActor);if(!n){let x=t[c]+h.actorMargin-s.width/2;s.margin=w.getMax(x,h.actorMargin);continue}let T=t[c]+h.actorMargin-s.width/2-n.width/2;s.margin=w.getMax(T,h.actorMargin)}let i=0;return a.forEach(c=>{let s=yt(h),n=c.actorKeys.reduce((x,u)=>x+=e.get(u).width+(e.get(u).margin||0),0),E=h.boxMargin*8;n+=E,n-=2*h.boxTextMargin,c.wrap&&(c.name=X.wrapLabel(c.name,n-2*h.wrapPadding,s));let T=X.calculateTextDimensions(c.name,s);i=w.getMax(T.height,i);let l=w.getMax(n,T.width+2*h.wrapPadding);if(c.margin=h.boxTextMargin,n<l){let x=(l-n)/2;c.margin+=x}}),a.forEach(c=>c.textMaxHeight=i),w.getMax(r,h.height)}g(dr,"calculateActorMargins");var na=g(async function(e,t,a){let r=t.get(e.from),i=t.get(e.to),c=r.x,s=i.x,n=e.wrap&&e.message,E=Z(e.message)?await Ot(e.message,$()):X.calculateTextDimensions(n?X.wrapLabel(e.message,h.width,Lt(h)):e.message,Lt(h)),T={width:n?h.width:w.getMax(h.width,E.width+2*h.noteMargin),height:0,startx:r.x,stopx:0,starty:0,stopy:0,message:e.message};return e.placement===a.db.PLACEMENT.RIGHTOF?(T.width=n?w.getMax(h.width,E.width):w.getMax(r.width/2+i.width/2,E.width+2*h.noteMargin),T.startx=c+(r.width+h.actorMargin)/2):e.placement===a.db.PLACEMENT.LEFTOF?(T.width=n?w.getMax(h.width,E.width+2*h.noteMargin):w.getMax(r.width/2+i.width/2,E.width+2*h.noteMargin),T.startx=c-T.width+(r.width-h.actorMargin)/2):e.to===e.from?(E=X.calculateTextDimensions(n?X.wrapLabel(e.message,w.getMax(h.width,r.width),Lt(h)):e.message,Lt(h)),T.width=n?w.getMax(h.width,r.width):w.getMax(r.width,h.width,E.width+2*h.noteMargin),T.startx=c+(r.width-T.width)/2):(T.width=Math.abs(c+r.width/2-(s+i.width/2))+h.actorMargin,T.startx=c<s?c+r.width/2-h.actorMargin/2:s+i.width/2-h.actorMargin/2),n&&(T.message=X.wrapLabel(e.message,T.width-2*h.wrapPadding,Lt(h))),tt.debug(`NM:[${T.startx},${T.stopx},${T.starty},${T.stopy}:${T.width},${T.height}=${e.message}]`),T},"buildNoteModel"),oa=4,ca=6,se=g(function(e,t){let{CENTRAL_CONNECTION:a,CENTRAL_CONNECTION_REVERSE:r,CENTRAL_CONNECTION_DUAL:i}=t.db.LINETYPE;return[a,r,i].includes(e.centralConnection)},"hasCentralConnection"),la=g(function(e,t,a){let{CENTRAL_CONNECTION_REVERSE:r,CENTRAL_CONNECTION_DUAL:i,BIDIRECTIONAL_SOLID:c,BIDIRECTIONAL_DOTTED:s}=t.db.LINETYPE,n=0;return(e.centralConnection===r||e.centralConnection===i)&&(n+=oa),(e.centralConnection===r||e.centralConnection===i)&&(e.type===c||e.type===s)&&(n+=a?0:-ca),n},"calculateCentralConnectionOffset"),Tr=g(function(e,t){let{SOLID_ARROW_TOP_REVERSE:a,SOLID_ARROW_TOP_REVERSE_DOTTED:r,SOLID_ARROW_BOTTOM_REVERSE:i,SOLID_ARROW_BOTTOM_REVERSE_DOTTED:c,STICK_ARROW_TOP_REVERSE:s,STICK_ARROW_TOP_REVERSE_DOTTED:n,STICK_ARROW_BOTTOM_REVERSE:E,STICK_ARROW_BOTTOM_REVERSE_DOTTED:T}=t.db.LINETYPE;return[a,r,i,c,s,n,E,T].includes(e.type)},"isReverseArrowType"),ha=g(function(e,t){let{BIDIRECTIONAL_SOLID:a,BIDIRECTIONAL_DOTTED:r}=t.db.LINETYPE;return[a,r].includes(e.type)},"isBidirectionalArrowType"),da=g(function(e,t,a){let{look:r}=$();if(![a.db.LINETYPE.SOLID_OPEN,a.db.LINETYPE.DOTTED_OPEN,a.db.LINETYPE.SOLID,a.db.LINETYPE.SOLID_TOP,a.db.LINETYPE.SOLID_BOTTOM,a.db.LINETYPE.STICK_TOP,a.db.LINETYPE.STICK_BOTTOM,a.db.LINETYPE.SOLID_TOP_DOTTED,a.db.LINETYPE.SOLID_BOTTOM_DOTTED,a.db.LINETYPE.STICK_TOP_DOTTED,a.db.LINETYPE.STICK_BOTTOM_DOTTED,a.db.LINETYPE.SOLID_ARROW_TOP_REVERSE,a.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE,a.db.LINETYPE.STICK_ARROW_TOP_REVERSE,a.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE,a.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED,a.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED,a.db.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED,a.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED,a.db.LINETYPE.DOTTED,a.db.LINETYPE.SOLID_CROSS,a.db.LINETYPE.DOTTED_CROSS,a.db.LINETYPE.SOLID_POINT,a.db.LINETYPE.DOTTED_POINT,a.db.LINETYPE.BIDIRECTIONAL_SOLID,a.db.LINETYPE.BIDIRECTIONAL_DOTTED].includes(e.type))return{};let[i,c]=er(e.from,t),[s,n]=er(e.to,t),E=i<=s,T=E?c:i,l=E?s:n;r==="neo"&&(e.type!==a.db.LINETYPE.SOLID_OPEN&&(l+=E?-3:3),(e.type===a.db.LINETYPE.BIDIRECTIONAL_SOLID||e.type===a.db.LINETYPE.BIDIRECTIONAL_DOTTED)&&(T+=E?3:-3)),T+=la(e,a,E);let x=Math.abs(s-n)>2,u=g(_=>E?-_:_,"adjustValue");e.from===e.to?l=T:(e.activate&&!x&&(l+=u(h.activationWidth/2-1)),[a.db.LINETYPE.SOLID_OPEN,a.db.LINETYPE.DOTTED_OPEN,a.db.LINETYPE.STICK_TOP,a.db.LINETYPE.STICK_BOTTOM,a.db.LINETYPE.STICK_TOP_DOTTED,a.db.LINETYPE.STICK_BOTTOM_DOTTED,a.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED,a.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED,a.db.LINETYPE.STICK_ARROW_TOP_REVERSE,a.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE,a.db.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED,a.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED,a.db.LINETYPE.SOLID_ARROW_TOP_REVERSE,a.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE].includes(e.type)||(l+=u(3)),[a.db.LINETYPE.BIDIRECTIONAL_SOLID,a.db.LINETYPE.BIDIRECTIONAL_DOTTED,a.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED,a.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED,a.db.LINETYPE.SOLID_ARROW_TOP_REVERSE,a.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE].includes(e.type)&&(T-=u(3)));let R=[i,c,s,n],p=Math.abs(T-l);e.wrap&&e.message&&(e.message=X.wrapLabel(e.message,w.getMax(p+2*h.wrapPadding,h.width),yt(h)));let f=X.calculateTextDimensions(e.message,yt(h));return{width:w.getMax(e.wrap?0:f.width+2*h.wrapPadding,p+2*h.wrapPadding,h.width),height:0,startx:T,stopx:l,starty:0,stopy:0,message:e.message,type:e.type,wrap:e.wrap,fromBounds:Math.min.apply(null,R),toBounds:Math.max.apply(null,R)}},"buildMessageModel"),Ta=g(async function(e,t,a,r){let i={},c=[],s,n,E;for(let T of e){switch(T.type){case r.db.LINETYPE.LOOP_START:case r.db.LINETYPE.ALT_START:case r.db.LINETYPE.OPT_START:case r.db.LINETYPE.PAR_START:case r.db.LINETYPE.PAR_OVER_START:case r.db.LINETYPE.CRITICAL_START:case r.db.LINETYPE.BREAK_START:c.push({id:T.id,msg:T.message,from:Number.MAX_SAFE_INTEGER,to:Number.MIN_SAFE_INTEGER,width:0});break;case r.db.LINETYPE.ALT_ELSE:case r.db.LINETYPE.PAR_AND:case r.db.LINETYPE.CRITICAL_OPTION:T.message&&(s=c.pop(),i[s.id]=s,i[T.id]=s,c.push(s));break;case r.db.LINETYPE.LOOP_END:case r.db.LINETYPE.ALT_END:case r.db.LINETYPE.OPT_END:case r.db.LINETYPE.PAR_END:case r.db.LINETYPE.CRITICAL_END:case r.db.LINETYPE.BREAK_END:s=c.pop(),i[s.id]=s;break;case r.db.LINETYPE.ACTIVE_START:{let x=t.get(T.from?T.from:T.to.actor),u=Ut(T.from?T.from:T.to.actor).length,R=x.x+x.width/2+(u-1)*h.activationWidth/2,p={startx:R,stopx:R+h.activationWidth,actor:T.from,enabled:!0};y.activations.push(p)}break;case r.db.LINETYPE.ACTIVE_END:{let x=y.activations.map(u=>u.actor).lastIndexOf(T.from);y.activations.splice(x,1).splice(0,1)}break}T.placement!==void 0?(n=await na(T,t,r),T.noteModel=n,c.forEach(x=>{s=x,s.from=w.getMin(s.from,n.startx),s.to=w.getMax(s.to,n.startx+n.width),s.width=w.getMax(s.width,Math.abs(s.from-s.to))-h.labelBoxWidth})):(E=da(T,t,r),T.msgModel=E,E.startx&&E.stopx&&c.length>0&&c.forEach(x=>{if(s=x,E.startx===E.stopx){let u=t.get(T.from),R=t.get(T.to);s.from=w.getMin(u.x-E.width/2,u.x-u.width/2,s.from),s.to=w.getMax(R.x+E.width/2,R.x+u.width/2,s.to),s.width=w.getMax(s.width,Math.abs(s.to-s.from))-h.labelBoxWidth}else s.from=w.getMin(E.startx,s.from),s.to=w.getMax(E.stopx,s.to),s.width=w.getMax(s.width,E.width)-h.labelBoxWidth}))}return y.activations=[],tt.debug("Loop type widths:",i),i},"calculateLoopBounds"),pa={bounds:y,drawActors:oe,drawActorsPopup:or,setConf:cr,draw:sa},ya={parser:Ir,get db(){return new Or},renderer:pa,styles:mr,init:g(e=>{e.sequence||(e.sequence={}),e.wrap&&(e.sequence.wrap=e.wrap,Ge({sequence:{wrap:e.wrap}}))},"init")};export{ya as diagram};