UNPKG

epic-designer-gold

Version:

基于vue3的设计器,可视化开发页面表单

146 lines 114 kB
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./mermaid.core-7qlaqoae.cjs"),K=require("./chunk-JSJVCQXG-BpVVsENG.cjs"),Be=require("./chunk-QZHKN3VN-6YLV6nCZ.cjs");var Yt=function(){var e=r.__name(function(ot,L,S,b){for(S=S||{},b=ot.length;b--;S[ot[b]]=L);return S},"o"),t=[1,2],n=[1,3],a=[1,4],i=[2,4],o=[1,9],c=[1,11],h=[1,12],d=[1,14],s=[1,15],p=[1,17],_=[1,18],f=[1,19],u=[1,25],O=[1,26],m=[1,27],y=[1,28],N=[1,29],A=[1,30],w=[1,31],D=[1,32],k=[1,33],Y=[1,34],W=[1,35],q=[1,36],z=[1,37],U=[1,38],H=[1,39],v=[1,40],J=[1,42],G=[1,43],Q=[1,44],$=[1,45],j=[1,46],R=[1,47],I=[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],at=[1,74],st=[1,80],C=[1,81],Ft=[1,82],qt=[1,83],Ht=[1,84],zt=[1,85],Ut=[1,86],Gt=[1,87],Xt=[1,88],Jt=[1,89],Qt=[1,90],Zt=[1,91],$t=[1,92],jt=[1,93],te=[1,94],ee=[1,95],ae=[1,96],se=[1,97],re=[1,98],ne=[1,99],ie=[1,100],oe=[1,101],ce=[1,102],le=[1,103],de=[1,104],he=[1,105],Te=[2,78],xt=[4,5,17,51,53,54],Rt=[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],Ee=[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],Dt=[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],kt=[5,52],M=[70,71,72,73],tt=[1,151],vt={trace:r.__name(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:r.__name(function(L,S,b,g,B,l,mt){var E=l.length-1;switch(B){case 3:return g.apply(l[E]),l[E];case 4:case 10:this.$=[];break;case 5:case 11:l[E-1].push(l[E]),this.$=l[E-1];break;case 6:case 7:case 12:case 13:this.$=l[E];break;case 8:case 9:case 14:this.$=[];break;case 16:l[E].type="createParticipant",this.$=l[E];break;case 17:l[E-1].unshift({type:"boxStart",boxData:g.parseBoxData(l[E-2])}),l[E-1].push({type:"boxEnd",boxText:l[E-2]}),this.$=l[E-1];break;case 19:this.$={type:"sequenceIndex",sequenceIndex:Number(l[E-2]),sequenceIndexStep:Number(l[E-1]),sequenceVisible:!0,signalType:g.LINETYPE.AUTONUMBER};break;case 20:this.$={type:"sequenceIndex",sequenceIndex:Number(l[E-1]),sequenceIndexStep:1,sequenceVisible:!0,signalType:g.LINETYPE.AUTONUMBER};break;case 21:this.$={type:"sequenceIndex",sequenceVisible:!1,signalType:g.LINETYPE.AUTONUMBER};break;case 22:this.$={type:"sequenceIndex",sequenceVisible:!0,signalType:g.LINETYPE.AUTONUMBER};break;case 23:this.$={type:"activeStart",signalType:g.LINETYPE.ACTIVE_START,actor:l[E-1].actor};break;case 24:this.$={type:"activeEnd",signalType:g.LINETYPE.ACTIVE_END,actor:l[E-1].actor};break;case 30:g.setDiagramTitle(l[E].substring(6)),this.$=l[E].substring(6);break;case 31:g.setDiagramTitle(l[E].substring(7)),this.$=l[E].substring(7);break;case 32:this.$=l[E].trim(),g.setAccTitle(this.$);break;case 33:case 34:this.$=l[E].trim(),g.setAccDescription(this.$);break;case 35:l[E-1].unshift({type:"loopStart",loopText:g.parseMessage(l[E-2]),signalType:g.LINETYPE.LOOP_START}),l[E-1].push({type:"loopEnd",loopText:l[E-2],signalType:g.LINETYPE.LOOP_END}),this.$=l[E-1];break;case 36:l[E-1].unshift({type:"rectStart",color:g.parseMessage(l[E-2]),signalType:g.LINETYPE.RECT_START}),l[E-1].push({type:"rectEnd",color:g.parseMessage(l[E-2]),signalType:g.LINETYPE.RECT_END}),this.$=l[E-1];break;case 37:l[E-1].unshift({type:"optStart",optText:g.parseMessage(l[E-2]),signalType:g.LINETYPE.OPT_START}),l[E-1].push({type:"optEnd",optText:g.parseMessage(l[E-2]),signalType:g.LINETYPE.OPT_END}),this.$=l[E-1];break;case 38:l[E-1].unshift({type:"altStart",altText:g.parseMessage(l[E-2]),signalType:g.LINETYPE.ALT_START}),l[E-1].push({type:"altEnd",signalType:g.LINETYPE.ALT_END}),this.$=l[E-1];break;case 39:l[E-1].unshift({type:"parStart",parText:g.parseMessage(l[E-2]),signalType:g.LINETYPE.PAR_START}),l[E-1].push({type:"parEnd",signalType:g.LINETYPE.PAR_END}),this.$=l[E-1];break;case 40:l[E-1].unshift({type:"parStart",parText:g.parseMessage(l[E-2]),signalType:g.LINETYPE.PAR_OVER_START}),l[E-1].push({type:"parEnd",signalType:g.LINETYPE.PAR_END}),this.$=l[E-1];break;case 41:l[E-1].unshift({type:"criticalStart",criticalText:g.parseMessage(l[E-2]),signalType:g.LINETYPE.CRITICAL_START}),l[E-1].push({type:"criticalEnd",signalType:g.LINETYPE.CRITICAL_END}),this.$=l[E-1];break;case 42:l[E-1].unshift({type:"breakStart",breakText:g.parseMessage(l[E-2]),signalType:g.LINETYPE.BREAK_START}),l[E-1].push({type:"breakEnd",optText:g.parseMessage(l[E-2]),signalType:g.LINETYPE.BREAK_END}),this.$=l[E-1];break;case 44:this.$=l[E-3].concat([{type:"option",optionText:g.parseMessage(l[E-1]),signalType:g.LINETYPE.CRITICAL_OPTION},l[E]]);break;case 46:this.$=l[E-3].concat([{type:"and",parText:g.parseMessage(l[E-1]),signalType:g.LINETYPE.PAR_AND},l[E]]);break;case 48:this.$=l[E-3].concat([{type:"else",altText:g.parseMessage(l[E-1]),signalType:g.LINETYPE.ALT_ELSE},l[E]]);break;case 49:l[E-3].draw="participant",l[E-3].type="addParticipant",l[E-3].description=g.parseMessage(l[E-1]),this.$=l[E-3];break;case 50:l[E-1].draw="participant",l[E-1].type="addParticipant",this.$=l[E-1];break;case 51:l[E-3].draw="actor",l[E-3].type="addParticipant",l[E-3].description=g.parseMessage(l[E-1]),this.$=l[E-3];break;case 52:case 57:l[E-1].draw="actor",l[E-1].type="addParticipant",this.$=l[E-1];break;case 53:l[E-1].type="destroyParticipant",this.$=l[E-1];break;case 54:l[E-3].draw="participant",l[E-3].type="addParticipant",l[E-3].description=g.parseMessage(l[E-1]),this.$=l[E-3];break;case 55:l[E-1].draw="participant",l[E-1].type="addParticipant",this.$=l[E-1];break;case 56:l[E-3].draw="actor",l[E-3].type="addParticipant",l[E-3].description=g.parseMessage(l[E-1]),this.$=l[E-3];break;case 58:this.$=[l[E-1],{type:"addNote",placement:l[E-2],actor:l[E-1].actor,text:l[E]}];break;case 59:l[E-2]=[].concat(l[E-1],l[E-1]).slice(0,2),l[E-2][0]=l[E-2][0].actor,l[E-2][1]=l[E-2][1].actor,this.$=[l[E-1],{type:"addNote",placement:g.PLACEMENT.OVER,actor:l[E-2].slice(0,2),text:l[E]}];break;case 60:this.$=[l[E-1],{type:"addLinks",actor:l[E-1].actor,text:l[E]}];break;case 61:this.$=[l[E-1],{type:"addALink",actor:l[E-1].actor,text:l[E]}];break;case 62:this.$=[l[E-1],{type:"addProperties",actor:l[E-1].actor,text:l[E]}];break;case 63:this.$=[l[E-1],{type:"addDetails",actor:l[E-1].actor,text:l[E]}];break;case 66:this.$=[l[E-2],l[E]];break;case 67:this.$=l[E];break;case 68:this.$=g.PLACEMENT.LEFTOF;break;case 69:this.$=g.PLACEMENT.RIGHTOF;break;case 70:this.$=[l[E-4],l[E-1],{type:"addMessage",from:l[E-4].actor,to:l[E-1].actor,signalType:l[E-3],msg:l[E],activate:!0},{type:"activeStart",signalType:g.LINETYPE.ACTIVE_START,actor:l[E-1].actor}];break;case 71:this.$=[l[E-4],l[E-1],{type:"addMessage",from:l[E-4].actor,to:l[E-1].actor,signalType:l[E-3],msg:l[E]},{type:"activeEnd",signalType:g.LINETYPE.ACTIVE_END,actor:l[E-4].actor}];break;case 72:this.$=[l[E-4],l[E-1],{type:"addMessage",from:l[E-4].actor,to:l[E-1].actor,signalType:l[E-3],msg:l[E],activate:!0,centralConnection:g.LINETYPE.CENTRAL_CONNECTION},{type:"centralConnection",signalType:g.LINETYPE.CENTRAL_CONNECTION,actor:l[E-1].actor}];break;case 73:this.$=[l[E-4],l[E-1],{type:"addMessage",from:l[E-4].actor,to:l[E-1].actor,signalType:l[E-2],msg:l[E],activate:!1,centralConnection:g.LINETYPE.CENTRAL_CONNECTION_REVERSE},{type:"centralConnectionReverse",signalType:g.LINETYPE.CENTRAL_CONNECTION_REVERSE,actor:l[E-4].actor}];break;case 74:this.$=[l[E-5],l[E-1],{type:"addMessage",from:l[E-5].actor,to:l[E-1].actor,signalType:l[E-3],msg:l[E],activate:!0,centralConnection:g.LINETYPE.CENTRAL_CONNECTION_DUAL},{type:"centralConnection",signalType:g.LINETYPE.CENTRAL_CONNECTION,actor:l[E-1].actor},{type:"centralConnectionReverse",signalType:g.LINETYPE.CENTRAL_CONNECTION_REVERSE,actor:l[E-5].actor}];break;case 75:this.$=[l[E-3],l[E-1],{type:"addMessage",from:l[E-3].actor,to:l[E-1].actor,signalType:l[E-2],msg:l[E]}];break;case 76:this.$={type:"addParticipant",actor:l[E-1],config:l[E]};break;case 77:this.$=l[E-1].trim();break;case 78:this.$={type:"addParticipant",actor:l[E]};break;case 79:this.$=g.LINETYPE.SOLID_OPEN;break;case 80:this.$=g.LINETYPE.DOTTED_OPEN;break;case 81:this.$=g.LINETYPE.SOLID;break;case 82:this.$=g.LINETYPE.SOLID_TOP;break;case 83:this.$=g.LINETYPE.SOLID_BOTTOM;break;case 84:this.$=g.LINETYPE.STICK_TOP;break;case 85:this.$=g.LINETYPE.STICK_BOTTOM;break;case 86:this.$=g.LINETYPE.SOLID_TOP_DOTTED;break;case 87:this.$=g.LINETYPE.SOLID_BOTTOM_DOTTED;break;case 88:this.$=g.LINETYPE.STICK_TOP_DOTTED;break;case 89:this.$=g.LINETYPE.STICK_BOTTOM_DOTTED;break;case 90:this.$=g.LINETYPE.SOLID_ARROW_TOP_REVERSE;break;case 91:this.$=g.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE;break;case 92:this.$=g.LINETYPE.STICK_ARROW_TOP_REVERSE;break;case 93:this.$=g.LINETYPE.STICK_ARROW_BOTTOM_REVERSE;break;case 94:this.$=g.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED;break;case 95:this.$=g.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED;break;case 96:this.$=g.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED;break;case 97:this.$=g.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED;break;case 98:this.$=g.LINETYPE.BIDIRECTIONAL_SOLID;break;case 99:this.$=g.LINETYPE.DOTTED;break;case 100:this.$=g.LINETYPE.BIDIRECTIONAL_DOTTED;break;case 101:this.$=g.LINETYPE.SOLID_CROSS;break;case 102:this.$=g.LINETYPE.DOTTED_CROSS;break;case 103:this.$=g.LINETYPE.SOLID_POINT;break;case 104:this.$=g.LINETYPE.DOTTED_POINT;break;case 105:this.$=g.parseMessage(l[E].trim().substring(1));break}},"anonymous"),table:[{3:1,4:t,5:n,6:a},{1:[3]},{3:5,4:t,5:n,6:a},{3:6,4:t,5:n,6:a},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:o,5:c,8:8,9:10,10:h,13:13,14:d,15:s,18:16,19:p,22:_,23:41,24:f,25:20,26:21,27:22,28:23,29:24,30:u,31:O,32:m,34:y,36:N,37:A,38:w,39:D,40:k,42:Y,44:W,45:q,47:z,51:U,53:H,54:v,56:J,61:G,62:Q,63:$,64:j,73:R},e(I,[2,5]),{9:48,13:13,14:d,15:s,18:16,19:p,22:_,23:41,24:f,25:20,26:21,27:22,28:23,29:24,30:u,31:O,32:m,34:y,36:N,37:A,38:w,39:D,40:k,42:Y,44:W,45:q,47:z,51:U,53:H,54:v,56:J,61:G,62:Q,63:$,64:j,73:R},e(I,[2,7]),e(I,[2,8]),e(I,[2,9]),e(I,[2,15]),{13:49,51:U,53:H,54:v},{16:[1,50]},{5:[1,51]},{5:[1,54],20:[1,52],21:[1,53]},{23:55,73:R},{23:56,73:R},{5:[1,57]},{5:[1,58]},{5:[1,59]},{5:[1,60]},{5:[1,61]},e(I,[2,30]),e(I,[2,31]),{33:[1,62]},{35:[1,63]},e(I,[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:at},{23:75,55:76,73:at},{23:77,73:R},{69:78,72:[1,79],78:st,79:C,80:Ft,81:qt,82:Ht,83:zt,84:Ut,85:Gt,86:Xt,87:Jt,88:Qt,89:Zt,90:$t,91:jt,92:te,93:ee,94:ae,95:se,96:re,97:ne,98:ie,99:oe,100:ce,101:le,102:de,103:he},{57:106,59:[1,107],67:[1,108],68:[1,109]},{23:110,73:R},{23:111,73:R},{23:112,73:R},{23:113,73:R},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],Te),e(I,[2,6]),e(I,[2,16]),e(xt,[2,10],{11:114}),e(I,[2,18]),{5:[1,116],20:[1,115]},{5:[1,117]},e(I,[2,22]),{5:[1,118]},{5:[1,119]},e(I,[2,25]),e(I,[2,26]),e(I,[2,27]),e(I,[2,28]),e(I,[2,29]),e(I,[2,32]),e(I,[2,33]),e(Rt,i,{7:120}),e(Rt,i,{7:121}),e(Rt,i,{7:122}),e(Ee,i,{41:123,7:124}),e(Dt,i,{43:125,7:126}),e(Dt,i,{7:126,43:127}),e(pe,i,{46:128,7:129}),e(Rt,i,{7:130}),{5:[1,132],52:[1,131]},{5:[1,134],52:[1,133]},e(kt,Te,{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:R},{69:146,78:st,79:C,80:Ft,81:qt,82:Ht,83:zt,84:Ut,85:Gt,86:Xt,87:Jt,88:Qt,89:Zt,90:$t,91:jt,92:te,93:ee,94:ae,95:se,96:re,97:ne,98:ie,99:oe,100:ce,101:le,102:de,103:he},e(M,[2,79]),e(M,[2,80]),e(M,[2,81]),e(M,[2,82]),e(M,[2,83]),e(M,[2,84]),e(M,[2,85]),e(M,[2,86]),e(M,[2,87]),e(M,[2,88]),e(M,[2,89]),e(M,[2,90]),e(M,[2,91]),e(M,[2,92]),e(M,[2,93]),e(M,[2,94]),e(M,[2,95]),e(M,[2,96]),e(M,[2,97]),e(M,[2,98]),e(M,[2,99]),e(M,[2,100]),e(M,[2,101]),e(M,[2,102]),e(M,[2,103]),e(M,[2,104]),{23:147,73:R},{23:149,60:148,73:R},{73:[2,68]},{73:[2,69]},{58:150,104:tt},{58:152,104:tt},{58:153,104:tt},{58:154,104:tt},{4:[1,157],5:[1,159],12:156,13:158,17:[1,155],51:U,53:H,54:v},{5:[1,160]},e(I,[2,20]),e(I,[2,21]),e(I,[2,23]),e(I,[2,24]),{4:o,5:c,8:8,9:10,10:h,13:13,14:d,15:s,17:[1,161],18:16,19:p,22:_,23:41,24:f,25:20,26:21,27:22,28:23,29:24,30:u,31:O,32:m,34:y,36:N,37:A,38:w,39:D,40:k,42:Y,44:W,45:q,47:z,51:U,53:H,54:v,56:J,61:G,62:Q,63:$,64:j,73:R},{4:o,5:c,8:8,9:10,10:h,13:13,14:d,15:s,17:[1,162],18:16,19:p,22:_,23:41,24:f,25:20,26:21,27:22,28:23,29:24,30:u,31:O,32:m,34:y,36:N,37:A,38:w,39:D,40:k,42:Y,44:W,45:q,47:z,51:U,53:H,54:v,56:J,61:G,62:Q,63:$,64:j,73:R},{4:o,5:c,8:8,9:10,10:h,13:13,14:d,15:s,17:[1,163],18:16,19:p,22:_,23:41,24:f,25:20,26:21,27:22,28:23,29:24,30:u,31:O,32:m,34:y,36:N,37:A,38:w,39:D,40:k,42:Y,44:W,45:q,47:z,51:U,53:H,54:v,56:J,61:G,62:Q,63:$,64:j,73:R},{17:[1,164]},{4:o,5:c,8:8,9:10,10:h,13:13,14:d,15:s,17:[2,47],18:16,19:p,22:_,23:41,24:f,25:20,26:21,27:22,28:23,29:24,30:u,31:O,32:m,34:y,36:N,37:A,38:w,39:D,40:k,42:Y,44:W,45:q,47:z,50:[1,165],51:U,53:H,54:v,56:J,61:G,62:Q,63:$,64:j,73:R},{17:[1,166]},{4:o,5:c,8:8,9:10,10:h,13:13,14:d,15:s,17:[2,45],18:16,19:p,22:_,23:41,24:f,25:20,26:21,27:22,28:23,29:24,30:u,31:O,32:m,34:y,36:N,37:A,38:w,39:D,40:k,42:Y,44:W,45:q,47:z,49:[1,167],51:U,53:H,54:v,56:J,61:G,62:Q,63:$,64:j,73:R},{17:[1,168]},{17:[1,169]},{4:o,5:c,8:8,9:10,10:h,13:13,14:d,15:s,17:[2,43],18:16,19:p,22:_,23:41,24:f,25:20,26:21,27:22,28:23,29:24,30:u,31:O,32:m,34:y,36:N,37:A,38:w,39:D,40:k,42:Y,44:W,45:q,47:z,48:[1,170],51:U,53:H,54:v,56:J,61:G,62:Q,63:$,64:j,73:R},{4:o,5:c,8:8,9:10,10:h,13:13,14:d,15:s,17:[1,171],18:16,19:p,22:_,23:41,24:f,25:20,26:21,27:22,28:23,29:24,30:u,31:O,32:m,34:y,36:N,37:A,38:w,39:D,40:k,42:Y,44:W,45:q,47:z,51:U,53:H,54:v,56:J,61:G,62:Q,63:$,64:j,73:R},{16:[1,172]},e(I,[2,50]),{16:[1,173]},e(I,[2,55]),e(kt,[2,76]),{76:[1,174]},{16:[1,175]},e(I,[2,52]),{16:[1,176]},e(I,[2,57]),e(I,[2,53]),{23:177,73:R},{23:178,73:R},{23:179,73:R},{58:180,104:tt},{23:181,72:[1,182],73:R},{58:183,104:tt},{58:184,104:tt},{66:[1,185],104:[2,67]},{5:[2,60]},{5:[2,105]},{5:[2,61]},{5:[2,62]},{5:[2,63]},e(I,[2,17]),e(xt,[2,11]),{13:186,51:U,53:H,54:v},e(xt,[2,13]),e(xt,[2,14]),e(I,[2,19]),e(I,[2,35]),e(I,[2,36]),e(I,[2,37]),e(I,[2,38]),{16:[1,187]},e(I,[2,39]),{16:[1,188]},e(I,[2,40]),e(I,[2,41]),{16:[1,189]},e(I,[2,42]),{5:[1,190]},{5:[1,191]},{77:[1,192]},{5:[1,193]},{5:[1,194]},{58:195,104:tt},{58:196,104:tt},{58:197,104:tt},{5:[2,75]},{58:198,104:tt},{23:199,73:R},{5:[2,58]},{5:[2,59]},{23:200,73:R},e(xt,[2,12]),e(Ee,i,{7:124,41:201}),e(Dt,i,{7:126,43:202}),e(pe,i,{7:129,46:203}),e(I,[2,49]),e(I,[2,54]),e(kt,[2,77]),e(I,[2,51]),e(I,[2,56]),{5:[2,70]},{5:[2,71]},{5:[2,72]},{5:[2,73]},{58:204,104:tt},{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:r.__name(function(L,S){if(S.recoverable)this.trace(L);else{var b=new Error(L);throw b.hash=S,b}},"parseError"),parse:r.__name(function(L){var S=this,b=[0],g=[],B=[null],l=[],mt=this.table,E="",yt=0,_e=0,ke=2,ue=1,ve=l.slice.call(arguments,1),F=Object.create(this.lexer),dt={yy:{}};for(var Ct in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Ct)&&(dt.yy[Ct]=this.yy[Ct]);F.setInput(L,dt.yy),dt.yy.lexer=F,dt.yy.parser=this,typeof F.yylloc>"u"&&(F.yylloc={});var Mt=F.yylloc;l.push(Mt);var Ce=F.options&&F.options.ranges;typeof dt.yy.parseError=="function"?this.parseError=dt.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Me(Z){b.length=b.length-2*Z,B.length=B.length-Z,l.length=l.length-Z}r.__name(Me,"popStack");function fe(){var Z;return Z=g.pop()||F.lex()||ue,typeof Z!="number"&&(Z instanceof Array&&(g=Z,Z=g.pop()),Z=S.symbols_[Z]||Z),Z}r.__name(fe,"lex");for(var X,ht,et,Bt,_t={},Lt,nt,ge,bt;;){if(ht=b[b.length-1],this.defaultActions[ht]?et=this.defaultActions[ht]:((X===null||typeof X>"u")&&(X=fe()),et=mt[ht]&&mt[ht][X]),typeof et>"u"||!et.length||!et[0]){var Vt="";bt=[];for(Lt in mt[ht])this.terminals_[Lt]&&Lt>ke&&bt.push("'"+this.terminals_[Lt]+"'");F.showPosition?Vt="Parse error on line "+(yt+1)+`:
`+F.showPosition()+`
Expecting `+bt.join(", ")+", got '"+(this.terminals_[X]||X)+"'":Vt="Parse error on line "+(yt+1)+": Unexpected "+(X==ue?"end of input":"'"+(this.terminals_[X]||X)+"'"),this.parseError(Vt,{text:F.match,token:this.terminals_[X]||X,line:F.yylineno,loc:Mt,expected:bt})}if(et[0]instanceof Array&&et.length>1)throw new Error("Parse Error: multiple actions possible at state: "+ht+", token: "+X);switch(et[0]){case 1:b.push(X),B.push(F.yytext),l.push(F.yylloc),b.push(et[1]),X=null,_e=F.yyleng,E=F.yytext,yt=F.yylineno,Mt=F.yylloc;break;case 2:if(nt=this.productions_[et[1]][1],_t.$=B[B.length-nt],_t._$={first_line:l[l.length-(nt||1)].first_line,last_line:l[l.length-1].last_line,first_column:l[l.length-(nt||1)].first_column,last_column:l[l.length-1].last_column},Ce&&(_t._$.range=[l[l.length-(nt||1)].range[0],l[l.length-1].range[1]]),Bt=this.performAction.apply(_t,[E,_e,yt,dt.yy,et[1],B,l].concat(ve)),typeof Bt<"u")return Bt;nt&&(b=b.slice(0,-1*nt*2),B=B.slice(0,-1*nt),l=l.slice(0,-1*nt)),b.push(this.productions_[et[1]][0]),B.push(_t.$),l.push(_t._$),ge=mt[b[b.length-2]][b[b.length-1]],b.push(ge);break;case 3:return!0}}return!0},"parse")},De=function(){var ot={EOF:1,parseError:r.__name(function(S,b){if(this.yy.parser)this.yy.parser.parseError(S,b);else throw new Error(S)},"parseError"),setInput:r.__name(function(L,S){return this.yy=S||this.yy||{},this._input=L,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:r.__name(function(){var L=this._input[0];this.yytext+=L,this.yyleng++,this.offset++,this.match+=L,this.matched+=L;var S=L.match(/(?:\r\n?|\n).*/g);return S?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),L},"input"),unput:r.__name(function(L){var S=L.length,b=L.split(/(?:\r\n?|\n)/g);this._input=L+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-S),this.offset-=S;var g=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),b.length-1&&(this.yylineno-=b.length-1);var B=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:b?(b.length===g.length?this.yylloc.first_column:0)+g[g.length-b.length].length-b[0].length:this.yylloc.first_column-S},this.options.ranges&&(this.yylloc.range=[B[0],B[0]+this.yyleng-S]),this.yyleng=this.yytext.length,this},"unput"),more:r.__name(function(){return this._more=!0,this},"more"),reject:r.__name(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:r.__name(function(L){this.unput(this.match.slice(L))},"less"),pastInput:r.__name(function(){var L=this.matched.substr(0,this.matched.length-this.match.length);return(L.length>20?"...":"")+L.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:r.__name(function(){var L=this.match;return L.length<20&&(L+=this._input.substr(0,20-L.length)),(L.substr(0,20)+(L.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:r.__name(function(){var L=this.pastInput(),S=new Array(L.length+1).join("-");return L+this.upcomingInput()+`
`+S+"^"},"showPosition"),test_match:r.__name(function(L,S){var b,g,B;if(this.options.backtrack_lexer&&(B={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&&(B.yylloc.range=this.yylloc.range.slice(0))),g=L[0].match(/(?:\r\n?|\n).*/g),g&&(this.yylineno+=g.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:g?g[g.length-1].length-g[g.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+L[0].length},this.yytext+=L[0],this.match+=L[0],this.matches=L,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(L[0].length),this.matched+=L[0],b=this.performAction.call(this,this.yy,this,S,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),b)return b;if(this._backtrack){for(var l in B)this[l]=B[l];return!1}return!1},"test_match"),next:r.__name(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var L,S,b,g;this._more||(this.yytext="",this.match="");for(var B=this._currentRules(),l=0;l<B.length;l++)if(b=this._input.match(this.rules[B[l]]),b&&(!S||b[0].length>S[0].length)){if(S=b,g=l,this.options.backtrack_lexer){if(L=this.test_match(b,B[l]),L!==!1)return L;if(this._backtrack){S=!1;continue}else return!1}else if(!this.options.flex)break}return S?(L=this.test_match(S,B[g]),L!==!1?L:!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:r.__name(function(){var S=this.next();return S||this.lex()},"lex"),begin:r.__name(function(S){this.conditionStack.push(S)},"begin"),popState:r.__name(function(){var S=this.conditionStack.length-1;return S>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:r.__name(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:r.__name(function(S){return S=this.conditionStack.length-1-Math.abs(S||0),S>=0?this.conditionStack[S]:"INITIAL"},"topState"),pushState:r.__name(function(S){this.begin(S)},"pushState"),stateStackSize:r.__name(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:r.__name(function(S,b,g,B){switch(g){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;case 8:return 76;case 9:return this.popState(),this.begin("ALIAS"),77;case 10:return this.popState(),this.popState(),77;case 11:return b.yytext=b.yytext.trim(),73;case 12:return b.yytext=b.yytext.trim(),this.begin("ALIAS"),73;case 13:return b.yytext=b.yytext.trim(),this.popState(),73;case 14:return this.popState(),10;case 15:return this.begin("LINE"),15;case 16:return this.begin("ID"),51;case 17:return this.begin("ID"),53;case 18:return 14;case 19:return this.begin("ID"),54;case 20:return this.popState(),this.popState(),this.begin("LINE"),52;case 21:return this.popState(),this.popState(),5;case 22:return this.begin("LINE"),37;case 23:return this.begin("LINE"),38;case 24:return this.begin("LINE"),39;case 25:return this.begin("LINE"),40;case 26:return this.begin("LINE"),50;case 27:return this.begin("LINE"),42;case 28:return this.begin("LINE"),44;case 29:return this.begin("LINE"),49;case 30:return this.begin("LINE"),45;case 31:return this.begin("LINE"),48;case 32:return this.begin("LINE"),47;case 33:return this.popState(),16;case 34:return 17;case 35:return 67;case 36:return 68;case 37:return 61;case 38:return 62;case 39:return 63;case 40:return 64;case 41:return 59;case 42:return 56;case 43:return this.begin("ID"),22;case 44:return this.begin("ID"),24;case 45:return 30;case 46:return 31;case 47:return this.begin("acc_title"),32;case 48:return this.popState(),"acc_title_value";case 49:return this.begin("acc_descr"),34;case 50:return this.popState(),"acc_descr_value";case 51:this.begin("acc_descr_multiline");break;case 52:this.popState();break;case 53:return"acc_descr_multiline_value";case 54:return 6;case 55:return 19;case 56:return 21;case 57:return 66;case 58:return 5;case 59:return b.yytext=b.yytext.trim(),73;case 60:return 80;case 61:return 97;case 62:return 98;case 63:return 99;case 64:return 78;case 65:return 79;case 66:return 100;case 67:return 101;case 68:return 102;case 69:return 103;case 70:return 85;case 71:return 86;case 72:return 87;case 73:return 88;case 74:return 93;case 75:return 94;case 76:return 95;case 77:return 96;case 78:return 81;case 79:return 82;case 80:return 83;case 81:return 84;case 82:return 89;case 83:return 90;case 84:return 91;case 85:return 92;case 86:return 104;case 87:return 104;case 88:return 70;case 89:return 71;case 90:return 72;case 91:return 5;case 92:return 10}},"anonymous"),rules:[/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:((?!\n)\s)+)/i,/^(?:#[^\n]*)/i,/^(?:%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[0-9]+(?=[ \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,/^(?: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:[52,53],inclusive:!1},acc_descr:{rules:[50],inclusive:!1},acc_title:{rules:[48],inclusive:!1},ID:{rules:[2,3,7,11,12,13,14],inclusive:!1},ALIAS:{rules:[2,3,20,21],inclusive:!1},LINE:{rules:[2,3,33],inclusive:!1},CONFIG:{rules:[8,9,10],inclusive:!1},CONFIG_DATA:{rules:[],inclusive:!1},INITIAL:{rules:[0,1,3,4,5,6,15,16,17,18,19,22,23,24,25,26,27,28,29,30,31,32,34,35,36,37,38,39,40,41,42,43,44,45,46,47,49,51,54,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],inclusive:!0}}};return ot}();vt.lexer=De;function Ot(){this.yy={}}return r.__name(Ot,"Parser"),Ot.prototype=vt,vt.Parser=Ot,new Ot}();Yt.parser=Yt;var Ve=Yt,Ye={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},We={FILLED:0,OPEN:1},Ke={LEFTOF:0,RIGHTOF:1,OVER:2},St={ACTOR:"actor",CONTROL:"control",DATABASE:"database",ENTITY:"entity"},ft,Fe=(ft=class{constructor(){this.state=new Be.ImperativeState(()=>({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=r.setAccTitle,this.setAccDescription=r.setAccDescription,this.setDiagramTitle=r.setDiagramTitle,this.getAccTitle=r.getAccTitle,this.getAccDescription=r.getAccDescription,this.getDiagramTitle=r.getDiagramTitle,this.apply=this.apply.bind(this),this.parseBoxData=this.parseBoxData.bind(this),this.parseMessage=this.parseMessage.bind(this),this.clear(),this.setWrap(r.getConfig2().wrap),this.LINETYPE=Ye,this.ARROWTYPE=We,this.PLACEMENT=Ke}addBox(t){this.state.records.boxes.push({name:t.text,wrap:t.wrap??this.autoWrap(),fill:t.color,actorKeys:[]}),this.state.records.currentBox=this.state.records.boxes.slice(-1)[0]}addActor(t,n,a,i,o){let c=this.state.records.currentBox,h;if(o!==void 0){let s;o.includes(`
`)?s=o+`
`:s=`{
`+o+`
}`,h=r.load(s,{schema:r.JSON_SCHEMA})}i=(h==null?void 0:h.type)??i,h!=null&&h.alias&&(!a||a.text===n)&&(a={text:h.alias,wrap:a==null?void 0:a.wrap,type:i});const d=this.state.records.actors.get(t);if(d){if(this.state.records.currentBox&&d.box&&this.state.records.currentBox!==d.box)throw new Error(`A same participant should only be defined in one Box: ${d.name} can't be in '${d.box.name}' and in '${this.state.records.currentBox.name}' at the same time.`);if(c=d.box?d.box:this.state.records.currentBox,d.box=c,d&&n===d.name&&a==null)return}if((a==null?void 0:a.text)==null&&(a={text:n,type:i}),(i==null||a.text==null)&&(a={text:n,type:i}),this.state.records.actors.set(t,{box:c,name:n,description:a.text,wrap:a.wrap??this.autoWrap(),prevActor:this.state.records.prevActor,links:{},properties:{},actorCnt:null,rectData:null,type:i??"participant"}),this.state.records.prevActor){const s=this.state.records.actors.get(this.state.records.prevActor);s&&(s.nextActor=t)}this.state.records.currentBox&&this.state.records.currentBox.actorKeys.push(t),this.state.records.prevActor=t}activationCount(t){let n,a=0;if(!t)return 0;for(n=0;n<this.state.records.messages.length;n++)this.state.records.messages[n].type===this.LINETYPE.ACTIVE_START&&this.state.records.messages[n].from===t&&a++,this.state.records.messages[n].type===this.LINETYPE.ACTIVE_END&&this.state.records.messages[n].from===t&&a--;return a}addMessage(t,n,a,i){this.state.records.messages.push({id:this.state.records.messages.length.toString(),from:t,to:n,message:a.text,wrap:a.wrap??this.autoWrap(),answer:i})}addSignal(t,n,a,i,o=!1,c){if(i===this.LINETYPE.ACTIVE_END&&this.activationCount(t??"")<1){const d=new Error("Trying to inactivate an inactive participant ("+t+")");throw d.hash={text:"->>-",token:"->>-",line:"1",loc:{first_line:1,last_line:1,first_column:1,last_column:1},expected:["'ACTIVE_PARTICIPANT'"]},d}return this.state.records.messages.push({id:this.state.records.messages.length.toString(),from:t,to:n,message:(a==null?void 0:a.text)??"",wrap:(a==null?void 0:a.wrap)??this.autoWrap(),type:i,activate:o,centralConnection:c??0}),!0}hasAtLeastOneBox(){return this.state.records.boxes.length>0}hasAtLeastOneBoxWithTitle(){return this.state.records.boxes.some(t=>t.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(t){return this.state.records.actors.get(t)}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(t){this.state.records.wrapEnabled=t}extractWrap(t){if(t===void 0)return{};t=t.trim();const n=/^:?wrap:/.exec(t)!==null?!0:/^:?nowrap:/.exec(t)!==null?!1:void 0;return{cleanedText:(n===void 0?t:t.replace(/^:?(?:no)?wrap:/,"")).trim(),wrap:n}}autoWrap(){var t;return this.state.records.wrapEnabled!==void 0?this.state.records.wrapEnabled:((t=r.getConfig2().sequence)==null?void 0:t.wrap)??!1}clear(){this.state.reset(),r.clear()}parseMessage(t){const n=t.trim(),{wrap:a,cleanedText:i}=this.extractWrap(n),o={text:i,wrap:a};return r.log.debug(`parseMessage: ${JSON.stringify(o)}`),o}parseBoxData(t){const n=/^((?:rgba?|hsla?)\s*\(.*\)|\w*)(.*)$/.exec(t);let a=n!=null&&n[1]?n[1].trim():"transparent",i=n!=null&&n[2]?n[2].trim():void 0;if(window!=null&&window.CSS)window.CSS.supports("color",a)||(a="transparent",i=t.trim());else{const h=new Option().style;h.color=a,h.color!==a&&(a="transparent",i=t.trim())}const{wrap:o,cleanedText:c}=this.extractWrap(i);return{text:c?r.sanitizeText(c,r.getConfig2()):void 0,color:a,wrap:o}}addNote(t,n,a){const i={actor:t,placement:n,message:a.text,wrap:a.wrap??this.autoWrap()},o=[].concat(t,t);this.state.records.notes.push(i),this.state.records.messages.push({id:this.state.records.messages.length.toString(),from:o[0],to:o[1],message:a.text,wrap:a.wrap??this.autoWrap(),type:this.LINETYPE.NOTE,placement:n})}addLinks(t,n){const a=this.getActor(t);try{let i=r.sanitizeText(n.text,r.getConfig2());i=i.replace(/&equals;/g,"="),i=i.replace(/&amp;/g,"&");const o=JSON.parse(i);this.insertLinks(a,o)}catch(i){r.log.error("error while parsing actor link text",i)}}addALink(t,n){const a=this.getActor(t);try{const i={};let o=r.sanitizeText(n.text,r.getConfig2());const c=o.indexOf("@");o=o.replace(/&equals;/g,"="),o=o.replace(/&amp;/g,"&");const h=o.slice(0,c-1).trim(),d=o.slice(c+1).trim();i[h]=d,this.insertLinks(a,i)}catch(i){r.log.error("error while parsing actor link text",i)}}insertLinks(t,n){if(t.links==null)t.links=n;else for(const a in n)t.links[a]=n[a]}addProperties(t,n){const a=this.getActor(t);try{const i=r.sanitizeText(n.text,r.getConfig2()),o=JSON.parse(i);this.insertProperties(a,o)}catch(i){r.log.error("error while parsing actor properties text",i)}}insertProperties(t,n){if(t.properties==null)t.properties=n;else for(const a in n)t.properties[a]=n[a]}boxEnd(){this.state.records.currentBox=void 0}addDetails(t,n){const a=this.getActor(t),i=document.getElementById(n.text);try{const o=i.innerHTML,c=JSON.parse(o);c.properties&&this.insertProperties(a,c.properties),c.links&&this.insertLinks(a,c.links)}catch(o){r.log.error("error while parsing actor details text",o)}}getActorProperty(t,n){if((t==null?void 0:t.properties)!==void 0)return t.properties[n]}apply(t){if(Array.isArray(t))t.forEach(n=>{this.apply(n)});else switch(t.type){case"sequenceIndex":this.state.records.messages.push({id:this.state.records.messages.length.toString(),from:void 0,to:void 0,message:{start:t.sequenceIndex,step:t.sequenceIndexStep,visible:t.sequenceVisible},wrap:!1,type:t.signalType});break;case"addParticipant":this.addActor(t.actor,t.actor,t.description,t.draw,t.config);break;case"createParticipant":if(this.state.records.actors.has(t.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=t.actor,this.addActor(t.actor,t.actor,t.description,t.draw,t.config),this.state.records.createdActors.set(t.actor,this.state.records.messages.length);break;case"destroyParticipant":this.state.records.lastDestroyed=t.actor,this.state.records.destroyedActors.set(t.actor,this.state.records.messages.length);break;case"activeStart":this.addSignal(t.actor,void 0,void 0,t.signalType);break;case"centralConnection":this.addSignal(t.actor,void 0,void 0,t.signalType);break;case"centralConnectionReverse":this.addSignal(t.actor,void 0,void 0,t.signalType);break;case"activeEnd":this.addSignal(t.actor,void 0,void 0,t.signalType);break;case"addNote":this.addNote(t.actor,t.placement,t.text);break;case"addLinks":this.addLinks(t.actor,t.text);break;case"addALink":this.addALink(t.actor,t.text);break;case"addProperties":this.addProperties(t.actor,t.text);break;case"addDetails":this.addDetails(t.actor,t.text);break;case"addMessage":if(this.state.records.lastCreated){if(t.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(t.to!==this.state.records.lastDestroyed&&t.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(t.from,t.to,t.msg,t.signalType,t.activate,t.centralConnection);break;case"boxStart":this.addBox(t.boxData);break;case"boxEnd":this.boxEnd();break;case"loopStart":this.addSignal(void 0,void 0,t.loopText,t.signalType);break;case"loopEnd":this.addSignal(void 0,void 0,void 0,t.signalType);break;case"rectStart":this.addSignal(void 0,void 0,t.color,t.signalType);break;case"rectEnd":this.addSignal(void 0,void 0,void 0,t.signalType);break;case"optStart":this.addSignal(void 0,void 0,t.optText,t.signalType);break;case"optEnd":this.addSignal(void 0,void 0,void 0,t.signalType);break;case"altStart":this.addSignal(void 0,void 0,t.altText,t.signalType);break;case"else":this.addSignal(void 0,void 0,t.altText,t.signalType);break;case"altEnd":this.addSignal(void 0,void 0,void 0,t.signalType);break;case"setAccTitle":r.setAccTitle(t.text);break;case"parStart":this.addSignal(void 0,void 0,t.parText,t.signalType);break;case"and":this.addSignal(void 0,void 0,t.parText,t.signalType);break;case"parEnd":this.addSignal(void 0,void 0,void 0,t.signalType);break;case"criticalStart":this.addSignal(void 0,void 0,t.criticalText,t.signalType);break;case"option":this.addSignal(void 0,void 0,t.optionText,t.signalType);break;case"criticalEnd":this.addSignal(void 0,void 0,void 0,t.signalType);break;case"breakStart":this.addSignal(void 0,void 0,t.breakText,t.signalType);break;case"breakEnd":this.addSignal(void 0,void 0,void 0,t.signalType);break}}getConfig(){return r.getConfig2().sequence}},r.__name(ft,"SequenceDB"),ft),qe=r.__name(e=>`.actor {
    stroke: ${e.actorBorder};
    fill: ${e.actorBkg};
  }

  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};
  }

  #arrowhead path {
    fill: ${e.signalColor};
    stroke: ${e.signalColor};
  }

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

  #sequencenumber {
    fill: ${e.signalColor};
  }

  #crosshead path {
    fill: ${e.signalColor};
    stroke: ${e.signalColor};
  }

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

  .labelBox {
    stroke: ${e.labelBoxBorderColor};
    fill: ${e.labelBoxBkgColor};
  }

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

  .loopText, .loopText > 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;
  }

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

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