rdesign/frontend/node_modules/mermaid/dist/chunks/mermaid.esm.min/sequenceDiagram-PYXOKC54.mjs

146 lines
109 KiB
JavaScript

import{a as $e}from"./chunk-TU3PZOEN.mjs";import{a as Ze,b as Qe}from"./chunk-NN2NZ22Q.mjs";import{a as Ge,b as Xe,d as Vt,e as Yt,f as it,g as St}from"./chunk-W2A4CRWB.mjs";import{a as Je,k as te,m as F}from"./chunk-Q3CC2MQB.mjs";import{a as fr}from"./chunk-XBXGYYE5.mjs";import{A as Ye,C as H,D as _t,E as $t,F as L,N as ve,Q as We,R as jt,S as Ke,T as Fe,U as qe,V as He,W as ze,Y as Q,Z as Ue,a as Ve,s as Bt,z as Lt}from"./chunk-3UWU4A3N.mjs";import{b as G,h as Nt}from"./chunk-MGPAVIPZ.mjs";import"./chunk-JIN56HTB.mjs";import{a as f,f as ur}from"./chunk-VELTKBKT.mjs";var ee=(function(){var e=f(function(pt,O,S,N){for(S=S||{},N=pt.length;N--;S[pt[N]]=O);return S},"o"),t=[1,2],a=[1,3],r=[1,4],n=[2,4],i=[1,9],o=[1,11],h=[1,12],l=[1,14],s=[1,15],T=[1,17],E=[1,18],g=[1,19],u=[1,25],R=[1,26],m=[1,27],y=[1,28],w=[1,29],P=[1,30],k=[1,31],D=[1,32],v=[1,33],W=[1,34],K=[1,35],z=[1,36],X=[1,37],J=[1,38],U=[1,39],C=[1,40],j=[1,42],$=[1,43],tt=[1,44],rt=[1,45],st=[1,46],I=[1,47],b=[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],ot=[1,74],ct=[1,80],M=[1,81],ie=[1,82],oe=[1,83],ce=[1,84],le=[1,85],de=[1,86],he=[1,87],pe=[1,88],Te=[1,89],Ee=[1,90],ue=[1,91],fe=[1,92],ge=[1,93],_e=[1,94],xe=[1,95],be=[1,96],me=[1,97],Ie=[1,98],Re=[1,99],Oe=[1,100],ye=[1,101],Le=[1,102],Ne=[1,103],Se=[1,104],Pe=[1,105],we=[2,78],Ot=[4,5,17,51,53,54],kt=[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],Ae=[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],qt=[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],ke=[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],Ht=[5,52],B=[70,71,72,73],at=[1,151],zt={trace:f(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:f(function(O,S,N,_,V,c,yt){var p=c.length-1;switch(V){case 3:return _.apply(c[p]),c[p];break;case 4:case 10:this.$=[];break;case 5:case 11:c[p-1].push(c[p]),this.$=c[p-1];break;case 6:case 7:case 12:case 13:this.$=c[p];break;case 8:case 9:case 14:this.$=[];break;case 16:c[p].type="createParticipant",this.$=c[p];break;case 17:c[p-1].unshift({type:"boxStart",boxData:_.parseBoxData(c[p-2])}),c[p-1].push({type:"boxEnd",boxText:c[p-2]}),this.$=c[p-1];break;case 19:this.$={type:"sequenceIndex",sequenceIndex:Number(c[p-2]),sequenceIndexStep:Number(c[p-1]),sequenceVisible:!0,signalType:_.LINETYPE.AUTONUMBER};break;case 20:this.$={type:"sequenceIndex",sequenceIndex:Number(c[p-1]),sequenceIndexStep:1,sequenceVisible:!0,signalType:_.LINETYPE.AUTONUMBER};break;case 21:this.$={type:"sequenceIndex",sequenceVisible:!1,signalType:_.LINETYPE.AUTONUMBER};break;case 22:this.$={type:"sequenceIndex",sequenceVisible:!0,signalType:_.LINETYPE.AUTONUMBER};break;case 23:this.$={type:"activeStart",signalType:_.LINETYPE.ACTIVE_START,actor:c[p-1].actor};break;case 24:this.$={type:"activeEnd",signalType:_.LINETYPE.ACTIVE_END,actor:c[p-1].actor};break;case 30:_.setDiagramTitle(c[p].substring(6)),this.$=c[p].substring(6);break;case 31:_.setDiagramTitle(c[p].substring(7)),this.$=c[p].substring(7);break;case 32:this.$=c[p].trim(),_.setAccTitle(this.$);break;case 33:case 34:this.$=c[p].trim(),_.setAccDescription(this.$);break;case 35:c[p-1].unshift({type:"loopStart",loopText:_.parseMessage(c[p-2]),signalType:_.LINETYPE.LOOP_START}),c[p-1].push({type:"loopEnd",loopText:c[p-2],signalType:_.LINETYPE.LOOP_END}),this.$=c[p-1];break;case 36:c[p-1].unshift({type:"rectStart",color:_.parseMessage(c[p-2]),signalType:_.LINETYPE.RECT_START}),c[p-1].push({type:"rectEnd",color:_.parseMessage(c[p-2]),signalType:_.LINETYPE.RECT_END}),this.$=c[p-1];break;case 37:c[p-1].unshift({type:"optStart",optText:_.parseMessage(c[p-2]),signalType:_.LINETYPE.OPT_START}),c[p-1].push({type:"optEnd",optText:_.parseMessage(c[p-2]),signalType:_.LINETYPE.OPT_END}),this.$=c[p-1];break;case 38:c[p-1].unshift({type:"altStart",altText:_.parseMessage(c[p-2]),signalType:_.LINETYPE.ALT_START}),c[p-1].push({type:"altEnd",signalType:_.LINETYPE.ALT_END}),this.$=c[p-1];break;case 39:c[p-1].unshift({type:"parStart",parText:_.parseMessage(c[p-2]),signalType:_.LINETYPE.PAR_START}),c[p-1].push({type:"parEnd",signalType:_.LINETYPE.PAR_END}),this.$=c[p-1];break;case 40:c[p-1].unshift({type:"parStart",parText:_.parseMessage(c[p-2]),signalType:_.LINETYPE.PAR_OVER_START}),c[p-1].push({type:"parEnd",signalType:_.LINETYPE.PAR_END}),this.$=c[p-1];break;case 41:c[p-1].unshift({type:"criticalStart",criticalText:_.parseMessage(c[p-2]),signalType:_.LINETYPE.CRITICAL_START}),c[p-1].push({type:"criticalEnd",signalType:_.LINETYPE.CRITICAL_END}),this.$=c[p-1];break;case 42:c[p-1].unshift({type:"breakStart",breakText:_.parseMessage(c[p-2]),signalType:_.LINETYPE.BREAK_START}),c[p-1].push({type:"breakEnd",optText:_.parseMessage(c[p-2]),signalType:_.LINETYPE.BREAK_END}),this.$=c[p-1];break;case 44:this.$=c[p-3].concat([{type:"option",optionText:_.parseMessage(c[p-1]),signalType:_.LINETYPE.CRITICAL_OPTION},c[p]]);break;case 46:this.$=c[p-3].concat([{type:"and",parText:_.parseMessage(c[p-1]),signalType:_.LINETYPE.PAR_AND},c[p]]);break;case 48:this.$=c[p-3].concat([{type:"else",altText:_.parseMessage(c[p-1]),signalType:_.LINETYPE.ALT_ELSE},c[p]]);break;case 49:c[p-3].draw="participant",c[p-3].type="addParticipant",c[p-3].description=_.parseMessage(c[p-1]),this.$=c[p-3];break;case 50:c[p-1].draw="participant",c[p-1].type="addParticipant",this.$=c[p-1];break;case 51:c[p-3].draw="actor",c[p-3].type="addParticipant",c[p-3].description=_.parseMessage(c[p-1]),this.$=c[p-3];break;case 52:case 57:c[p-1].draw="actor",c[p-1].type="addParticipant",this.$=c[p-1];break;case 53:c[p-1].type="destroyParticipant",this.$=c[p-1];break;case 54:c[p-3].draw="participant",c[p-3].type="addParticipant",c[p-3].description=_.parseMessage(c[p-1]),this.$=c[p-3];break;case 55:c[p-1].draw="participant",c[p-1].type="addParticipant",this.$=c[p-1];break;case 56:c[p-3].draw="actor",c[p-3].type="addParticipant",c[p-3].description=_.parseMessage(c[p-1]),this.$=c[p-3];break;case 58:this.$=[c[p-1],{type:"addNote",placement:c[p-2],actor:c[p-1].actor,text:c[p]}];break;case 59:c[p-2]=[].concat(c[p-1],c[p-1]).slice(0,2),c[p-2][0]=c[p-2][0].actor,c[p-2][1]=c[p-2][1].actor,this.$=[c[p-1],{type:"addNote",placement:_.PLACEMENT.OVER,actor:c[p-2].slice(0,2),text:c[p]}];break;case 60:this.$=[c[p-1],{type:"addLinks",actor:c[p-1].actor,text:c[p]}];break;case 61:this.$=[c[p-1],{type:"addALink",actor:c[p-1].actor,text:c[p]}];break;case 62:this.$=[c[p-1],{type:"addProperties",actor:c[p-1].actor,text:c[p]}];break;case 63:this.$=[c[p-1],{type:"addDetails",actor:c[p-1].actor,text:c[p]}];break;case 66:this.$=[c[p-2],c[p]];break;case 67:this.$=c[p];break;case 68:this.$=_.PLACEMENT.LEFTOF;break;case 69:this.$=_.PLACEMENT.RIGHTOF;break;case 70:this.$=[c[p-4],c[p-1],{type:"addMessage",from:c[p-4].actor,to:c[p-1].actor,signalType:c[p-3],msg:c[p],activate:!0},{type:"activeStart",signalType:_.LINETYPE.ACTIVE_START,actor:c[p-1].actor}];break;case 71:this.$=[c[p-4],c[p-1],{type:"addMessage",from:c[p-4].actor,to:c[p-1].actor,signalType:c[p-3],msg:c[p]},{type:"activeEnd",signalType:_.LINETYPE.ACTIVE_END,actor:c[p-4].actor}];break;case 72:this.$=[c[p-4],c[p-1],{type:"addMessage",from:c[p-4].actor,to:c[p-1].actor,signalType:c[p-3],msg:c[p],activate:!0,centralConnection:_.LINETYPE.CENTRAL_CONNECTION},{type:"centralConnection",signalType:_.LINETYPE.CENTRAL_CONNECTION,actor:c[p-1].actor}];break;case 73:this.$=[c[p-4],c[p-1],{type:"addMessage",from:c[p-4].actor,to:c[p-1].actor,signalType:c[p-2],msg:c[p],activate:!1,centralConnection:_.LINETYPE.CENTRAL_CONNECTION_REVERSE},{type:"centralConnectionReverse",signalType:_.LINETYPE.CENTRAL_CONNECTION_REVERSE,actor:c[p-4].actor}];break;case 74:this.$=[c[p-5],c[p-1],{type:"addMessage",from:c[p-5].actor,to:c[p-1].actor,signalType:c[p-3],msg:c[p],activate:!0,centralConnection:_.LINETYPE.CENTRAL_CONNECTION_DUAL},{type:"centralConnection",signalType:_.LINETYPE.CENTRAL_CONNECTION,actor:c[p-1].actor},{type:"centralConnectionReverse",signalType:_.LINETYPE.CENTRAL_CONNECTION_REVERSE,actor:c[p-5].actor}];break;case 75:this.$=[c[p-3],c[p-1],{type:"addMessage",from:c[p-3].actor,to:c[p-1].actor,signalType:c[p-2],msg:c[p]}];break;case 76:this.$={type:"addParticipant",actor:c[p-1],config:c[p]};break;case 77:this.$=c[p-1].trim();break;case 78:this.$={type:"addParticipant",actor:c[p]};break;case 79:this.$=_.LINETYPE.SOLID_OPEN;break;case 80:this.$=_.LINETYPE.DOTTED_OPEN;break;case 81:this.$=_.LINETYPE.SOLID;break;case 82:this.$=_.LINETYPE.SOLID_TOP;break;case 83:this.$=_.LINETYPE.SOLID_BOTTOM;break;case 84:this.$=_.LINETYPE.STICK_TOP;break;case 85:this.$=_.LINETYPE.STICK_BOTTOM;break;case 86:this.$=_.LINETYPE.SOLID_TOP_DOTTED;break;case 87:this.$=_.LINETYPE.SOLID_BOTTOM_DOTTED;break;case 88:this.$=_.LINETYPE.STICK_TOP_DOTTED;break;case 89:this.$=_.LINETYPE.STICK_BOTTOM_DOTTED;break;case 90:this.$=_.LINETYPE.SOLID_ARROW_TOP_REVERSE;break;case 91:this.$=_.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE;break;case 92:this.$=_.LINETYPE.STICK_ARROW_TOP_REVERSE;break;case 93:this.$=_.LINETYPE.STICK_ARROW_BOTTOM_REVERSE;break;case 94:this.$=_.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED;break;case 95:this.$=_.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED;break;case 96:this.$=_.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED;break;case 97:this.$=_.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED;break;case 98:this.$=_.LINETYPE.BIDIRECTIONAL_SOLID;break;case 99:this.$=_.LINETYPE.DOTTED;break;case 100:this.$=_.LINETYPE.BIDIRECTIONAL_DOTTED;break;case 101:this.$=_.LINETYPE.SOLID_CROSS;break;case 102:this.$=_.LINETYPE.DOTTED_CROSS;break;case 103:this.$=_.LINETYPE.SOLID_POINT;break;case 104:this.$=_.LINETYPE.DOTTED_POINT;break;case 105:this.$=_.parseMessage(c[p].trim().substring(1));break}},"anonymous"),table:[{3:1,4:t,5:a,6:r},{1:[3]},{3:5,4:t,5:a,6:r},{3:6,4:t,5:a,6:r},e([1,4,5,10,14,15,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,51,53,54,56,61,62,63,64,73],n,{7:7}),{1:[2,1]},{1:[2,2]},{1:[2,3],4:i,5:o,8:8,9:10,10:h,13:13,14:l,15:s,18:16,19:T,22:E,23:41,24:g,25:20,26:21,27:22,28:23,29:24,30:u,31:R,32:m,34:y,36:w,37:P,38:k,39:D,40:v,42:W,44:K,45:z,47:X,51:J,53:U,54:C,56:j,61:$,62:tt,63:rt,64:st,73:I},e(b,[2,5]),{9:48,13:13,14:l,15:s,18:16,19:T,22:E,23:41,24:g,25:20,26:21,27:22,28:23,29:24,30:u,31:R,32:m,34:y,36:w,37:P,38:k,39:D,40:v,42:W,44:K,45:z,47:X,51:J,53:U,54:C,56:j,61:$,62:tt,63:rt,64:st,73:I},e(b,[2,7]),e(b,[2,8]),e(b,[2,9]),e(b,[2,15]),{13:49,51:J,53:U,54:C},{16:[1,50]},{5:[1,51]},{5:[1,54],20:[1,52],21:[1,53]},{23:55,73:I},{23:56,73:I},{5:[1,57]},{5:[1,58]},{5:[1,59]},{5:[1,60]},{5:[1,61]},e(b,[2,30]),e(b,[2,31]),{33:[1,62]},{35:[1,63]},e(b,[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:ot},{23:75,55:76,73:ot},{23:77,73:I},{69:78,72:[1,79],78:ct,79:M,80:ie,81:oe,82:ce,83:le,84:de,85:he,86:pe,87:Te,88:Ee,89:ue,90:fe,91:ge,92:_e,93:xe,94:be,95:me,96:Ie,97:Re,98:Oe,99:ye,100:Le,101:Ne,102:Se,103:Pe},{57:106,59:[1,107],67:[1,108],68:[1,109]},{23:110,73:I},{23:111,73:I},{23:112,73:I},{23:113,73:I},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],we),e(b,[2,6]),e(b,[2,16]),e(Ot,[2,10],{11:114}),e(b,[2,18]),{5:[1,116],20:[1,115]},{5:[1,117]},e(b,[2,22]),{5:[1,118]},{5:[1,119]},e(b,[2,25]),e(b,[2,26]),e(b,[2,27]),e(b,[2,28]),e(b,[2,29]),e(b,[2,32]),e(b,[2,33]),e(kt,n,{7:120}),e(kt,n,{7:121}),e(kt,n,{7:122}),e(Ae,n,{41:123,7:124}),e(qt,n,{43:125,7:126}),e(qt,n,{7:126,43:127}),e(ke,n,{46:128,7:129}),e(kt,n,{7:130}),{5:[1,132],52:[1,131]},{5:[1,134],52:[1,133]},e(Ht,we,{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:I},{69:146,78:ct,79:M,80:ie,81:oe,82:ce,83:le,84:de,85:he,86:pe,87:Te,88:Ee,89:ue,90:fe,91:ge,92:_e,93:xe,94:be,95:me,96:Ie,97:Re,98:Oe,99:ye,100:Le,101:Ne,102:Se,103:Pe},e(B,[2,79]),e(B,[2,80]),e(B,[2,81]),e(B,[2,82]),e(B,[2,83]),e(B,[2,84]),e(B,[2,85]),e(B,[2,86]),e(B,[2,87]),e(B,[2,88]),e(B,[2,89]),e(B,[2,90]),e(B,[2,91]),e(B,[2,92]),e(B,[2,93]),e(B,[2,94]),e(B,[2,95]),e(B,[2,96]),e(B,[2,97]),e(B,[2,98]),e(B,[2,99]),e(B,[2,100]),e(B,[2,101]),e(B,[2,102]),e(B,[2,103]),e(B,[2,104]),{23:147,73:I},{23:149,60:148,73:I},{73:[2,68]},{73:[2,69]},{58:150,104:at},{58:152,104:at},{58:153,104:at},{58:154,104:at},{4:[1,157],5:[1,159],12:156,13:158,17:[1,155],51:J,53:U,54:C},{5:[1,160]},e(b,[2,20]),e(b,[2,21]),e(b,[2,23]),e(b,[2,24]),{4:i,5:o,8:8,9:10,10:h,13:13,14:l,15:s,17:[1,161],18:16,19:T,22:E,23:41,24:g,25:20,26:21,27:22,28:23,29:24,30:u,31:R,32:m,34:y,36:w,37:P,38:k,39:D,40:v,42:W,44:K,45:z,47:X,51:J,53:U,54:C,56:j,61:$,62:tt,63:rt,64:st,73:I},{4:i,5:o,8:8,9:10,10:h,13:13,14:l,15:s,17:[1,162],18:16,19:T,22:E,23:41,24:g,25:20,26:21,27:22,28:23,29:24,30:u,31:R,32:m,34:y,36:w,37:P,38:k,39:D,40:v,42:W,44:K,45:z,47:X,51:J,53:U,54:C,56:j,61:$,62:tt,63:rt,64:st,73:I},{4:i,5:o,8:8,9:10,10:h,13:13,14:l,15:s,17:[1,163],18:16,19:T,22:E,23:41,24:g,25:20,26:21,27:22,28:23,29:24,30:u,31:R,32:m,34:y,36:w,37:P,38:k,39:D,40:v,42:W,44:K,45:z,47:X,51:J,53:U,54:C,56:j,61:$,62:tt,63:rt,64:st,73:I},{17:[1,164]},{4:i,5:o,8:8,9:10,10:h,13:13,14:l,15:s,17:[2,47],18:16,19:T,22:E,23:41,24:g,25:20,26:21,27:22,28:23,29:24,30:u,31:R,32:m,34:y,36:w,37:P,38:k,39:D,40:v,42:W,44:K,45:z,47:X,50:[1,165],51:J,53:U,54:C,56:j,61:$,62:tt,63:rt,64:st,73:I},{17:[1,166]},{4:i,5:o,8:8,9:10,10:h,13:13,14:l,15:s,17:[2,45],18:16,19:T,22:E,23:41,24:g,25:20,26:21,27:22,28:23,29:24,30:u,31:R,32:m,34:y,36:w,37:P,38:k,39:D,40:v,42:W,44:K,45:z,47:X,49:[1,167],51:J,53:U,54:C,56:j,61:$,62:tt,63:rt,64:st,73:I},{17:[1,168]},{17:[1,169]},{4:i,5:o,8:8,9:10,10:h,13:13,14:l,15:s,17:[2,43],18:16,19:T,22:E,23:41,24:g,25:20,26:21,27:22,28:23,29:24,30:u,31:R,32:m,34:y,36:w,37:P,38:k,39:D,40:v,42:W,44:K,45:z,47:X,48:[1,170],51:J,53:U,54:C,56:j,61:$,62:tt,63:rt,64:st,73:I},{4:i,5:o,8:8,9:10,10:h,13:13,14:l,15:s,17:[1,171],18:16,19:T,22:E,23:41,24:g,25:20,26:21,27:22,28:23,29:24,30:u,31:R,32:m,34:y,36:w,37:P,38:k,39:D,40:v,42:W,44:K,45:z,47:X,51:J,53:U,54:C,56:j,61:$,62:tt,63:rt,64:st,73:I},{16:[1,172]},e(b,[2,50]),{16:[1,173]},e(b,[2,55]),e(Ht,[2,76]),{76:[1,174]},{16:[1,175]},e(b,[2,52]),{16:[1,176]},e(b,[2,57]),e(b,[2,53]),{23:177,73:I},{23:178,73:I},{23:179,73:I},{58:180,104:at},{23:181,72:[1,182],73:I},{58:183,104:at},{58:184,104:at},{66:[1,185],104:[2,67]},{5:[2,60]},{5:[2,105]},{5:[2,61]},{5:[2,62]},{5:[2,63]},e(b,[2,17]),e(Ot,[2,11]),{13:186,51:J,53:U,54:C},e(Ot,[2,13]),e(Ot,[2,14]),e(b,[2,19]),e(b,[2,35]),e(b,[2,36]),e(b,[2,37]),e(b,[2,38]),{16:[1,187]},e(b,[2,39]),{16:[1,188]},e(b,[2,40]),e(b,[2,41]),{16:[1,189]},e(b,[2,42]),{5:[1,190]},{5:[1,191]},{77:[1,192]},{5:[1,193]},{5:[1,194]},{58:195,104:at},{58:196,104:at},{58:197,104:at},{5:[2,75]},{58:198,104:at},{23:199,73:I},{5:[2,58]},{5:[2,59]},{23:200,73:I},e(Ot,[2,12]),e(Ae,n,{7:124,41:201}),e(qt,n,{7:126,43:202}),e(ke,n,{7:129,46:203}),e(b,[2,49]),e(b,[2,54]),e(Ht,[2,77]),e(b,[2,51]),e(b,[2,56]),{5:[2,70]},{5:[2,71]},{5:[2,72]},{5:[2,73]},{58:204,104:at},{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:f(function(O,S){if(S.recoverable)this.trace(O);else{var N=new Error(O);throw N.hash=S,N}},"parseError"),parse:f(function(O){var S=this,N=[0],_=[],V=[null],c=[],yt=this.table,p="",Dt=0,De=0,Ce=0,hr=2,Me=1,pr=c.slice.call(arguments,1),q=Object.create(this.lexer),ft={yy:{}};for(var Gt in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Gt)&&(ft.yy[Gt]=this.yy[Gt]);q.setInput(O,ft.yy),ft.yy.lexer=q,ft.yy.parser=this,typeof q.yylloc>"u"&&(q.yylloc={});var Xt=q.yylloc;c.push(Xt);var Tr=q.options&&q.options.ranges;typeof ft.yy.parseError=="function"?this.parseError=ft.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function ps(et){N.length=N.length-2*et,V.length=V.length-et,c.length=c.length-et}f(ps,"popStack");function Er(){var et;return et=_.pop()||q.lex()||Me,typeof et!="number"&&(et instanceof Array&&(_=et,et=_.pop()),et=S.symbols_[et]||et),et}f(Er,"lex");for(var Z,Jt,gt,nt,Ts,Zt,It={},Ct,dt,Be,Mt;;){if(gt=N[N.length-1],this.defaultActions[gt]?nt=this.defaultActions[gt]:((Z===null||typeof Z>"u")&&(Z=Er()),nt=yt[gt]&&yt[gt][Z]),typeof nt>"u"||!nt.length||!nt[0]){var Qt="";Mt=[];for(Ct in yt[gt])this.terminals_[Ct]&&Ct>hr&&Mt.push("'"+this.terminals_[Ct]+"'");q.showPosition?Qt="Parse error on line "+(Dt+1)+`:
`+q.showPosition()+`
Expecting `+Mt.join(", ")+", got '"+(this.terminals_[Z]||Z)+"'":Qt="Parse error on line "+(Dt+1)+": Unexpected "+(Z==Me?"end of input":"'"+(this.terminals_[Z]||Z)+"'"),this.parseError(Qt,{text:q.match,token:this.terminals_[Z]||Z,line:q.yylineno,loc:Xt,expected:Mt})}if(nt[0]instanceof Array&&nt.length>1)throw new Error("Parse Error: multiple actions possible at state: "+gt+", token: "+Z);switch(nt[0]){case 1:N.push(Z),V.push(q.yytext),c.push(q.yylloc),N.push(nt[1]),Z=null,Jt?(Z=Jt,Jt=null):(De=q.yyleng,p=q.yytext,Dt=q.yylineno,Xt=q.yylloc,Ce>0&&Ce--);break;case 2:if(dt=this.productions_[nt[1]][1],It.$=V[V.length-dt],It._$={first_line:c[c.length-(dt||1)].first_line,last_line:c[c.length-1].last_line,first_column:c[c.length-(dt||1)].first_column,last_column:c[c.length-1].last_column},Tr&&(It._$.range=[c[c.length-(dt||1)].range[0],c[c.length-1].range[1]]),Zt=this.performAction.apply(It,[p,De,Dt,ft.yy,nt[1],V,c].concat(pr)),typeof Zt<"u")return Zt;dt&&(N=N.slice(0,-1*dt*2),V=V.slice(0,-1*dt),c=c.slice(0,-1*dt)),N.push(this.productions_[nt[1]][0]),V.push(It.$),c.push(It._$),Be=yt[N[N.length-2]][N[N.length-1]],N.push(Be);break;case 3:return!0}}return!0},"parse")},dr=(function(){var pt={EOF:1,parseError:f(function(S,N){if(this.yy.parser)this.yy.parser.parseError(S,N);else throw new Error(S)},"parseError"),setInput:f(function(O,S){return this.yy=S||this.yy||{},this._input=O,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:f(function(){var O=this._input[0];this.yytext+=O,this.yyleng++,this.offset++,this.match+=O,this.matched+=O;var S=O.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),O},"input"),unput:f(function(O){var S=O.length,N=O.split(/(?:\r\n?|\n)/g);this._input=O+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-S),this.offset-=S;var _=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),N.length-1&&(this.yylineno-=N.length-1);var V=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:N?(N.length===_.length?this.yylloc.first_column:0)+_[_.length-N.length].length-N[0].length:this.yylloc.first_column-S},this.options.ranges&&(this.yylloc.range=[V[0],V[0]+this.yyleng-S]),this.yyleng=this.yytext.length,this},"unput"),more:f(function(){return this._more=!0,this},"more"),reject:f(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:f(function(O){this.unput(this.match.slice(O))},"less"),pastInput:f(function(){var O=this.matched.substr(0,this.matched.length-this.match.length);return(O.length>20?"...":"")+O.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:f(function(){var O=this.match;return O.length<20&&(O+=this._input.substr(0,20-O.length)),(O.substr(0,20)+(O.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:f(function(){var O=this.pastInput(),S=new Array(O.length+1).join("-");return O+this.upcomingInput()+`
`+S+"^"},"showPosition"),test_match:f(function(O,S){var N,_,V;if(this.options.backtrack_lexer&&(V={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&&(V.yylloc.range=this.yylloc.range.slice(0))),_=O[0].match(/(?:\r\n?|\n).*/g),_&&(this.yylineno+=_.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:_?_[_.length-1].length-_[_.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+O[0].length},this.yytext+=O[0],this.match+=O[0],this.matches=O,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(O[0].length),this.matched+=O[0],N=this.performAction.call(this,this.yy,this,S,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),N)return N;if(this._backtrack){for(var c in V)this[c]=V[c];return!1}return!1},"test_match"),next:f(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var O,S,N,_;this._more||(this.yytext="",this.match="");for(var V=this._currentRules(),c=0;c<V.length;c++)if(N=this._input.match(this.rules[V[c]]),N&&(!S||N[0].length>S[0].length)){if(S=N,_=c,this.options.backtrack_lexer){if(O=this.test_match(N,V[c]),O!==!1)return O;if(this._backtrack){S=!1;continue}else return!1}else if(!this.options.flex)break}return S?(O=this.test_match(S,V[_]),O!==!1?O:!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:f(function(){var S=this.next();return S||this.lex()},"lex"),begin:f(function(S){this.conditionStack.push(S)},"begin"),popState:f(function(){var S=this.conditionStack.length-1;return S>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:f(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:f(function(S){return S=this.conditionStack.length-1-Math.abs(S||0),S>=0?this.conditionStack[S]:"INITIAL"},"topState"),pushState:f(function(S){this.begin(S)},"pushState"),stateStackSize:f(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:f(function(S,N,_,V){var c=V;switch(_){case 0:return 5;case 1:break;case 2:break;case 3:break;case 4:break;case 5:break;case 6:return 20;case 7:return this.begin("CONFIG"),75;break;case 8:return 76;case 9:return this.popState(),this.begin("ALIAS"),77;break;case 10:return this.popState(),this.popState(),77;break;case 11:return N.yytext=N.yytext.trim(),73;break;case 12:return N.yytext=N.yytext.trim(),this.begin("ALIAS"),73;break;case 13:return N.yytext=N.yytext.trim(),this.popState(),73;break;case 14:return this.popState(),10;break;case 15:return this.begin("LINE"),15;break;case 16:return this.begin("ID"),51;break;case 17:return this.begin("ID"),53;break;case 18:return 14;case 19:return this.begin("ID"),54;break;case 20:return this.popState(),this.popState(),this.begin("LINE"),52;break;case 21:return this.popState(),this.popState(),5;break;case 22:return this.begin("LINE"),37;break;case 23:return this.begin("LINE"),38;break;case 24:return this.begin("LINE"),39;break;case 25:return this.begin("LINE"),40;break;case 26:return this.begin("LINE"),50;break;case 27:return this.begin("LINE"),42;break;case 28:return this.begin("LINE"),44;break;case 29:return this.begin("LINE"),49;break;case 30:return this.begin("LINE"),45;break;case 31:return this.begin("LINE"),48;break;case 32:return this.begin("LINE"),47;break;case 33:return this.popState(),16;break;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;break;case 44:return this.begin("ID"),24;break;case 45:return 30;case 46:return 31;case 47:return this.begin("acc_title"),32;break;case 48:return this.popState(),"acc_title_value";break;case 49:return this.begin("acc_descr"),34;break;case 50:return this.popState(),"acc_descr_value";break;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 N.yytext=N.yytext.trim(),73;break;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 pt})();zt.lexer=dr;function Ut(){this.yy={}}return f(Ut,"Parser"),Ut.prototype=zt,zt.Parser=Ut,new Ut})();ee.parser=ee;var je=ee;var gr={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},_r={FILLED:0,OPEN:1},xr={LEFTOF:0,RIGHTOF:1,OVER:2},Pt={ACTOR:"actor",BOUNDARY:"boundary",COLLECTIONS:"collections",CONTROL:"control",DATABASE:"database",ENTITY:"entity",PARTICIPANT:"participant",QUEUE:"queue"},vt=class{constructor(){this.state=new $e(()=>({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=jt;this.setAccDescription=Fe;this.setDiagramTitle=He;this.getAccTitle=Ke;this.getAccDescription=qe;this.getDiagramTitle=ze;this.apply=this.apply.bind(this),this.parseBoxData=this.parseBoxData.bind(this),this.parseMessage=this.parseMessage.bind(this),this.clear(),this.setWrap(Q().wrap),this.LINETYPE=gr,this.ARROWTYPE=_r,this.PLACEMENT=xr}static{f(this,"SequenceDB")}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,a,r,n,i){let o=this.state.records.currentBox,h;if(i!==void 0){let s;i.includes(`
`)?s=i+`
`:s=`{
`+i+`
}`,h=Qe(s,{schema:Ze})}n=h?.type??n,h?.alias&&(!r||r.text===a)&&(r={text:h.alias,wrap:r?.wrap,type:n});let l=this.state.records.actors.get(t);if(l){if(this.state.records.currentBox&&l.box&&this.state.records.currentBox!==l.box)throw new Error(`A same participant should only be defined in one Box: ${l.name} can't be in '${l.box.name}' and in '${this.state.records.currentBox.name}' at the same time.`);if(o=l.box?l.box:this.state.records.currentBox,l.box=o,l&&a===l.name&&r==null)return}if(r?.text==null&&(r={text:a,type:n}),(n==null||r.text==null)&&(r={text:a,type:n}),this.state.records.actors.set(t,{box:o,name:a,description:r.text,wrap:r.wrap??this.autoWrap(),prevActor:this.state.records.prevActor,links:{},properties:{},actorCnt:null,rectData:null,type:n??"participant"}),this.state.records.prevActor){let 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 a,r=0;if(!t)return 0;for(a=0;a<this.state.records.messages.length;a++)this.state.records.messages[a].type===this.LINETYPE.ACTIVE_START&&this.state.records.messages[a].from===t&&r++,this.state.records.messages[a].type===this.LINETYPE.ACTIVE_END&&this.state.records.messages[a].from===t&&r--;return r}addMessage(t,a,r,n){this.state.records.messages.push({id:this.state.records.messages.length.toString(),from:t,to:a,message:r.text,wrap:r.wrap??this.autoWrap(),answer:n})}addSignal(t,a,r,n,i=!1,o){if(n===this.LINETYPE.ACTIVE_END&&this.activationCount(t??"")<1){let l=new Error("Trying to inactivate an inactive participant ("+t+")");throw l.hash={text:"->>-",token:"->>-",line:"1",loc:{first_line:1,last_line:1,first_column:1,last_column:1},expected:["'ACTIVE_PARTICIPANT'"]},l}return this.state.records.messages.push({id:this.state.records.messages.length.toString(),from:t,to:a,message:r?.text??"",wrap:r?.wrap??this.autoWrap(),type:n,activate:i,centralConnection:o??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();let a=/^:?wrap:/.exec(t)!==null?!0:/^:?nowrap:/.exec(t)!==null?!1:void 0;return{cleanedText:(a===void 0?t:t.replace(/^:?(?:no)?wrap:/,"")).trim(),wrap:a}}autoWrap(){return this.state.records.wrapEnabled!==void 0?this.state.records.wrapEnabled:Q().sequence?.wrap??!1}clear(){this.state.reset(),We()}parseMessage(t){let a=t.trim(),{wrap:r,cleanedText:n}=this.extractWrap(a),i={text:n,wrap:r};return G.debug(`parseMessage: ${JSON.stringify(i)}`),i}parseBoxData(t){let a=/^((?:rgba?|hsla?)\s*\(.*\)|\w*)(.*)$/.exec(t),r=a?.[1]?a[1].trim():"transparent",n=a?.[2]?a[2].trim():void 0;if(window?.CSS)window.CSS.supports("color",r)||(r="transparent",n=t.trim());else{let h=new Option().style;h.color=r,h.color!==r&&(r="transparent",n=t.trim())}let{wrap:i,cleanedText:o}=this.extractWrap(n);return{text:o?Lt(o,Q()):void 0,color:r,wrap:i}}addNote(t,a,r){let n={actor:t,placement:a,message:r.text,wrap:r.wrap??this.autoWrap()},i=[].concat(t,t);this.state.records.notes.push(n),this.state.records.messages.push({id:this.state.records.messages.length.toString(),from:i[0],to:i[1],message:r.text,wrap:r.wrap??this.autoWrap(),type:this.LINETYPE.NOTE,placement:a})}addLinks(t,a){let r=this.getActor(t);try{let n=Lt(a.text,Q());n=n.replace(/&equals;/g,"="),n=n.replace(/&amp;/g,"&");let i=JSON.parse(n);this.insertLinks(r,i)}catch(n){G.error("error while parsing actor link text",n)}}addALink(t,a){let r=this.getActor(t);try{let n={},i=Lt(a.text,Q()),o=i.indexOf("@");i=i.replace(/&equals;/g,"="),i=i.replace(/&amp;/g,"&");let h=i.slice(0,o-1).trim(),l=i.slice(o+1).trim();n[h]=l,this.insertLinks(r,n)}catch(n){G.error("error while parsing actor link text",n)}}insertLinks(t,a){if(t.links==null)t.links=a;else for(let r in a)t.links[r]=a[r]}addProperties(t,a){let r=this.getActor(t);try{let n=Lt(a.text,Q()),i=JSON.parse(n);this.insertProperties(r,i)}catch(n){G.error("error while parsing actor properties text",n)}}insertProperties(t,a){if(t.properties==null)t.properties=a;else for(let r in a)t.properties[r]=a[r]}boxEnd(){this.state.records.currentBox=void 0}addDetails(t,a){let r=this.getActor(t),n=document.getElementById(a.text);try{let i=n.innerHTML,o=JSON.parse(i);o.properties&&this.insertProperties(r,o.properties),o.links&&this.insertLinks(r,o.links)}catch(i){G.error("error while parsing actor details text",i)}}getActorProperty(t,a){if(t?.properties!==void 0)return t.properties[a]}apply(t){if(Array.isArray(t))t.forEach(a=>{this.apply(a)});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":jt(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 Q().sequence}};var br=f(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"),tr=br;var re=ur(fr(),1);var Tt=36,Et="actor-top",ut="actor-bottom",Wt="actor-box",xt="actor-man",wt=f(function(e,t){return Ge(e,t)},"drawRect"),Ir=f(function(e,t,a,r,n){if(t.links===void 0||t.links===null||Object.keys(t.links).length===0)return{height:0,width:0};let i=t.links,o=t.actorCnt,h=t.rectData;var l="none";n&&(l="block !important");let s=e.append("g");s.attr("id","actor"+o+"_popup"),s.attr("class","actorPopupMenu"),s.attr("display",l);var T="";h.class!==void 0&&(T=" "+h.class);let E=h.width>a?h.width:a,g=s.append("rect");if(g.attr("class","actorPopupMenuPanel"+T),g.attr("x",h.x),g.attr("y",h.height),g.attr("fill",h.fill),g.attr("stroke",h.stroke),g.attr("width",E),g.attr("height",h.height),g.attr("rx",h.rx),g.attr("ry",h.ry),i!=null){var u=20;for(let y in i){var R=s.append("a"),m=(0,re.sanitizeUrl)(i[y]);R.attr("xlink:href",m),R.attr("target","_blank"),Hr(r)(y,R,h.x+10,h.height+u,E,20,{class:"actor"},r),u+=30}}return g.attr("height",u),{height:h.height+u,width:E}},"drawPopup"),Kt=f(function(e){return"var pu = document.getElementById('"+e+"'); if (pu != null) { pu.style.display = pu.style.display == 'block' ? 'none' : 'block'; }"},"popupMenuToggle"),At=f(async function(e,t,a=null){let r=e.append("foreignObject"),n=await $t(t.text,Bt()),o=r.append("xhtml:div").attr("style","width: fit-content;").attr("xmlns","http://www.w3.org/1999/xhtml").html(n).node().getBoundingClientRect();if(r.attr("height",Math.round(o.height)).attr("width",Math.round(o.width)),t.class==="noteText"){let h=e.node().firstChild;h.setAttribute("height",o.height+2*t.textMargin);let l=h.getBBox();r.attr("x",Math.round(l.x+l.width/2-o.width/2)).attr("y",Math.round(l.y+l.height/2-o.height/2))}else if(a){let{startx:h,stopx:l,starty:s}=a;if(h>l){let T=h;h=l,l=T}r.attr("x",Math.round(h+Math.abs(h-l)/2-o.width/2)),t.class==="loopText"?r.attr("y",Math.round(s)):r.attr("y",Math.round(s-o.height))}return[r]},"drawKatex"),bt=f(function(e,t){let a=0,r=0,n=t.text.split(L.lineBreakRegex),[i,o]=te(t.fontSize),h=[],l=0,s=f(()=>t.y,"yfunc");if(t.valign!==void 0&&t.textMargin!==void 0&&t.textMargin>0)switch(t.valign){case"top":case"start":s=f(()=>Math.round(t.y+t.textMargin),"yfunc");break;case"middle":case"center":s=f(()=>Math.round(t.y+(a+r+t.textMargin)/2),"yfunc");break;case"bottom":case"end":s=f(()=>Math.round(t.y+(a+r+2*t.textMargin)-t.textMargin),"yfunc");break}if(t.anchor!==void 0&&t.textMargin!==void 0&&t.width!==void 0)switch(t.anchor){case"left":case"start":t.x=Math.round(t.x+t.textMargin),t.anchor="start",t.dominantBaseline="middle",t.alignmentBaseline="middle";break;case"middle":case"center":t.x=Math.round(t.x+t.width/2),t.anchor="middle",t.dominantBaseline="middle",t.alignmentBaseline="middle";break;case"right":case"end":t.x=Math.round(t.x+t.width-t.textMargin),t.anchor="end",t.dominantBaseline="middle",t.alignmentBaseline="middle";break}for(let[T,E]of n.entries()){t.textMargin!==void 0&&t.textMargin===0&&i!==void 0&&(l=T*i);let g=e.append("text");g.attr("x",t.x),g.attr("y",s()),t.anchor!==void 0&&g.attr("text-anchor",t.anchor).attr("dominant-baseline",t.dominantBaseline).attr("alignment-baseline",t.alignmentBaseline),t.fontFamily!==void 0&&g.style("font-family",t.fontFamily),o!==void 0&&g.style("font-size",o),t.fontWeight!==void 0&&g.style("font-weight",t.fontWeight),t.fill!==void 0&&g.attr("fill",t.fill),t.class!==void 0&&g.attr("class",t.class),t.dy!==void 0?g.attr("dy",t.dy):l!==0&&g.attr("dy",l);let u=E||Je;if(t.tspan){let R=g.append("tspan");R.attr("x",t.x),t.fill!==void 0&&R.attr("fill",t.fill),R.text(u)}else g.text(u);t.valign!==void 0&&t.textMargin!==void 0&&t.textMargin>0&&(r+=(g._groups||g)[0][0].getBBox().height,a=r),h.push(g)}return h},"drawText"),er=f(function(e,t){function a(n,i,o,h,l){return n+","+i+" "+(n+o)+","+i+" "+(n+o)+","+(i+h-l)+" "+(n+o-l*1.2)+","+(i+h)+" "+n+","+(i+h)}f(a,"genPoints");let r=e.append("polygon");return r.attr("points",a(t.x,t.y,t.width,t.height,7)),r.attr("class","labelBox"),t.y=t.y+t.height/2,bt(e,t),r},"drawLabel"),A=-1,se=f((e,t,a,r)=>{e.select&&a.forEach(n=>{let i=t.get(n),o=e.select("#actor"+i.actorCnt);!r.mirrorActors&&i.stopy?o.attr("y2",i.stopy+i.height/2):r.mirrorActors&&o.attr("y2",i.stopy)})},"fixLifeLineHeights"),Rr=f(function(e,t,a,r){let n=r?t.stopy:t.starty,i=t.x+t.width/2,o=n+t.height,h=e.append("g").lower();var l=h;r||(A++,Object.keys(t.links||{}).length&&!a.forceMenus&&l.attr("onclick",Kt(`actor${A}_popup`)).attr("cursor","pointer"),l.append("line").attr("id","actor"+A).attr("x1",i).attr("y1",o).attr("x2",i).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",t.name),l=h.append("g"),t.actorCnt=A,t.links!=null&&l.attr("id","root-"+A));let s=it();var T="actor";t.properties?.class?T=t.properties.class:s.fill="#eaeaea",r?T+=` ${ut}`:T+=` ${Et}`,s.x=t.x,s.y=n,s.width=t.width,s.height=t.height,s.class=T,s.rx=3,s.ry=3,s.name=t.name;let E=wt(l,s);if(t.rectData=s,t.properties?.icon){let u=t.properties.icon.trim();u.charAt(0)==="@"?Yt(l,s.x+s.width-20,s.y+10,u.substr(1)):Vt(l,s.x+s.width-20,s.y+10,u)}ht(a,H(t.description))(t.description,l,s.x,s.y,s.width,s.height,{class:`actor ${Wt}`},a);let g=t.height;if(E.node){let u=E.node().getBBox();t.height=u.height,g=u.height}return g},"drawActorTypeParticipant"),Or=f(function(e,t,a,r){let n=r?t.stopy:t.starty,i=t.x+t.width/2,o=n+t.height,h=e.append("g").lower();var l=h;r||(A++,Object.keys(t.links||{}).length&&!a.forceMenus&&l.attr("onclick",Kt(`actor${A}_popup`)).attr("cursor","pointer"),l.append("line").attr("id","actor"+A).attr("x1",i).attr("y1",o).attr("x2",i).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",t.name),l=h.append("g"),t.actorCnt=A,t.links!=null&&l.attr("id","root-"+A));let s=it();var T="actor";t.properties?.class?T=t.properties.class:s.fill="#eaeaea",r?T+=` ${ut}`:T+=` ${Et}`,s.x=t.x,s.y=n,s.width=t.width,s.height=t.height,s.class=T,s.name=t.name;let E=6,g={...s,x:s.x+-E,y:s.y+ +E,class:"actor"},u=wt(l,s);if(wt(l,g),t.rectData=s,t.properties?.icon){let m=t.properties.icon.trim();m.charAt(0)==="@"?Yt(l,s.x+s.width-20,s.y+10,m.substr(1)):Vt(l,s.x+s.width-20,s.y+10,m)}ht(a,H(t.description))(t.description,l,s.x-E,s.y+E,s.width,s.height,{class:`actor ${Wt}`},a);let R=t.height;if(u.node){let m=u.node().getBBox();t.height=m.height,R=m.height}return R},"drawActorTypeCollections"),yr=f(function(e,t,a,r){let n=r?t.stopy:t.starty,i=t.x+t.width/2,o=n+t.height,h=e.append("g").lower(),l=h;r||(A++,Object.keys(t.links||{}).length&&!a.forceMenus&&l.attr("onclick",Kt(`actor${A}_popup`)).attr("cursor","pointer"),l.append("line").attr("id","actor"+A).attr("x1",i).attr("y1",o).attr("x2",i).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",t.name),l=h.append("g"),t.actorCnt=A,t.links!=null&&l.attr("id","root-"+A));let s=it(),T="actor";t.properties?.class?T=t.properties.class:s.fill="#eaeaea",r?T+=` ${ut}`:T+=` ${Et}`,s.x=t.x,s.y=n,s.width=t.width,s.height=t.height,s.class=T,s.name=t.name;let E=s.height/2,g=E/(2.5+s.height/50),u=l.append("g"),R=l.append("g");if(u.append("path").attr("d",`M ${s.x},${s.y+E}
a ${g},${E} 0 0 0 0,${s.height}
h ${s.width-2*g}
a ${g},${E} 0 0 0 0,-${s.height}
Z
`).attr("class",T),R.append("path").attr("d",`M ${s.x},${s.y+E}
a ${g},${E} 0 0 0 0,${s.height}`).attr("stroke","#666").attr("stroke-width","1px").attr("class",T),u.attr("transform",`translate(${g}, ${-(s.height/2)})`),R.attr("transform",`translate(${s.width-g}, ${-s.height/2})`),t.rectData=s,t.properties?.icon){let w=t.properties.icon.trim(),P=s.x+s.width-20,k=s.y+10;w.charAt(0)==="@"?Yt(l,P,k,w.substr(1)):Vt(l,P,k,w)}ht(a,H(t.description))(t.description,l,s.x,s.y,s.width,s.height,{class:`actor ${Wt}`},a);let m=t.height,y=u.select("path:last-child");if(y.node()){let w=y.node().getBBox();t.height=w.height,m=w.height}return m},"drawActorTypeQueue"),Lr=f(function(e,t,a,r){let n=r?t.stopy:t.starty,i=t.x+t.width/2,o=n+75,h=e.append("g").lower();r||(A++,h.append("line").attr("id","actor"+A).attr("x1",i).attr("y1",o).attr("x2",i).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",t.name),t.actorCnt=A);let l=e.append("g"),s=xt;r?s+=` ${ut}`:s+=` ${Et}`,l.attr("class",s),l.attr("name",t.name);let T=it();T.x=t.x,T.y=n,T.fill="#eaeaea",T.width=t.width,T.height=t.height,T.class="actor";let E=t.x+t.width/2,g=n+32,u=22;l.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"),l.append("circle").attr("cx",E).attr("cy",g).attr("r",u).attr("fill","#eaeaf7").attr("stroke","#666").attr("stroke-width",1.2),l.append("line").attr("marker-end","url(#filled-head-control)").attr("transform",`translate(${E}, ${g-u})`);let R=l.node().getBBox();return t.height=R.height+2*(a?.sequence?.labelBoxHeight??0),ht(a,H(t.description))(t.description,l,T.x,T.y+u+(r?5:12),T.width,T.height,{class:`actor ${xt}`},a),t.height},"drawActorTypeControl"),Nr=f(function(e,t,a,r){let n=r?t.stopy:t.starty,i=t.x+t.width/2,o=n+75,h=e.append("g").lower(),l=e.append("g"),s="actor";r?s+=` ${ut}`:s+=` ${Et}`,l.attr("class",s),l.attr("name",t.name);let T=it();T.x=t.x,T.y=n,T.fill="#eaeaea",T.width=t.width,T.height=t.height,T.class="actor";let E=t.x+t.width/2,g=n+(r?10:25),u=22;l.append("circle").attr("cx",E).attr("cy",g).attr("r",u).attr("width",t.width).attr("height",t.height),l.append("line").attr("x1",E-u).attr("x2",E+u).attr("y1",g+u).attr("y2",g+u).attr("stroke-width",2);let R=l.node().getBBox();return t.height=R.height+(a?.sequence?.labelBoxHeight??0),r||(A++,h.append("line").attr("id","actor"+A).attr("x1",i).attr("y1",o).attr("x2",i).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",t.name),t.actorCnt=A),ht(a,H(t.description))(t.description,l,T.x,T.y+(r?15:30),T.width,T.height,{class:`actor ${xt}`},a),r?l.attr("transform",`translate(0, ${u})`):l.attr("transform",`translate(0, ${u/2-5})`),t.height},"drawActorTypeEntity"),Sr=f(function(e,t,a,r){let n=r?t.stopy:t.starty,i=t.x+t.width/2,o=n+t.height+2*a.boxTextMargin,h=e.append("g").lower(),l=h;r||(A++,Object.keys(t.links||{}).length&&!a.forceMenus&&l.attr("onclick",Kt(`actor${A}_popup`)).attr("cursor","pointer"),l.append("line").attr("id","actor"+A).attr("x1",i).attr("y1",o).attr("x2",i).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",t.name),l=h.append("g"),t.actorCnt=A,t.links!=null&&l.attr("id","root-"+A));let s=it(),T="actor";t.properties?.class?T=t.properties.class:s.fill="#eaeaea",r?T+=` ${ut}`:T+=` ${Et}`,s.x=t.x,s.y=n,s.width=t.width,s.height=t.height,s.class=T,s.name=t.name,s.x=t.x,s.y=n;let E=s.width/3,g=s.width/3,u=E/2,R=u/(2.5+E/50),m=l.append("g"),y=`
M ${s.x},${s.y+R}
a ${u},${R} 0 0 0 ${E},0
a ${u},${R} 0 0 0 -${E},0
l 0,${g-2*R}
a ${u},${R} 0 0 0 ${E},0
l 0,-${g-2*R}
`;m.append("path").attr("d",y).attr("fill","#eaeaea").attr("stroke","#000").attr("stroke-width",1).attr("class",T),m.attr("transform",`translate(${E}, ${R})`),t.rectData=s,ht(a,H(t.description))(t.description,l,s.x,s.y+35,s.width,s.height,{class:`actor ${Wt}`},a);let w=m.select("path:last-child");if(w.node()){let P=w.node().getBBox();t.height=P.height+(a.sequence.labelBoxHeight??0)}return t.height},"drawActorTypeDatabase"),Pr=f(function(e,t,a,r){let n=r?t.stopy:t.starty,i=t.x+t.width/2,o=n+80,h=22,l=e.append("g").lower();r||(A++,l.append("line").attr("id","actor"+A).attr("x1",i).attr("y1",o).attr("x2",i).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",t.name),t.actorCnt=A);let s=e.append("g"),T=xt;r?T+=` ${ut}`:T+=` ${Et}`,s.attr("class",T),s.attr("name",t.name);let E=it();E.x=t.x,E.y=n,E.fill="#eaeaea",E.width=t.width,E.height=t.height,E.class="actor",s.append("line").attr("id","actor-man-torso"+A).attr("x1",t.x+t.width/2-h*2.5).attr("y1",n+12).attr("x2",t.x+t.width/2-15).attr("y2",n+12),s.append("line").attr("id","actor-man-arms"+A).attr("x1",t.x+t.width/2-h*2.5).attr("y1",n+2).attr("x2",t.x+t.width/2-h*2.5).attr("y2",n+22),s.append("circle").attr("cx",t.x+t.width/2).attr("cy",n+12).attr("r",h);let g=s.node().getBBox();return t.height=g.height+(a.sequence.labelBoxHeight??0),ht(a,H(t.description))(t.description,s,E.x,E.y+15,E.width,E.height,{class:`actor ${xt}`},a),r?s.attr("transform",`translate(0,${h/2+10})`):s.attr("transform",`translate(0,${h/2+10})`),t.height},"drawActorTypeBoundary"),wr=f(function(e,t,a,r){let n=r?t.stopy:t.starty,i=t.x+t.width/2,o=n+80,h=e.append("g").lower();r||(A++,h.append("line").attr("id","actor"+A).attr("x1",i).attr("y1",o).attr("x2",i).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",t.name),t.actorCnt=A);let l=e.append("g"),s=xt;r?s+=` ${ut}`:s+=` ${Et}`,l.attr("class",s),l.attr("name",t.name);let T=it();T.x=t.x,T.y=n,T.fill="#eaeaea",T.width=t.width,T.height=t.height,T.class="actor",T.rx=3,T.ry=3,l.append("line").attr("id","actor-man-torso"+A).attr("x1",i).attr("y1",n+25).attr("x2",i).attr("y2",n+45),l.append("line").attr("id","actor-man-arms"+A).attr("x1",i-Tt/2).attr("y1",n+33).attr("x2",i+Tt/2).attr("y2",n+33),l.append("line").attr("x1",i-Tt/2).attr("y1",n+60).attr("x2",i).attr("y2",n+45),l.append("line").attr("x1",i).attr("y1",n+45).attr("x2",i+Tt/2-2).attr("y2",n+60);let E=l.append("circle");E.attr("cx",t.x+t.width/2),E.attr("cy",n+10),E.attr("r",15),E.attr("width",t.width),E.attr("height",t.height);let g=l.node().getBBox();return t.height=g.height,ht(a,H(t.description))(t.description,l,T.x,T.y+35,T.width,T.height,{class:`actor ${xt}`},a),t.height},"drawActorTypeActor"),Ar=f(async function(e,t,a,r){switch(t.type){case"actor":return await wr(e,t,a,r);case"participant":return await Rr(e,t,a,r);case"boundary":return await Pr(e,t,a,r);case"control":return await Lr(e,t,a,r);case"entity":return await Nr(e,t,a,r);case"database":return await Sr(e,t,a,r);case"collections":return await Or(e,t,a,r);case"queue":return await yr(e,t,a,r)}},"drawActor"),kr=f(function(e,t,a){let n=e.append("g");rr(n,t),t.name&&ht(a)(t.name,n,t.x,t.y+a.boxTextMargin+(t.textMaxHeight||0)/2,t.width,0,{class:"text"},a),n.lower()},"drawBox"),Dr=f(function(e){return e.append("g")},"anchorElement"),Cr=f(function(e,t,a,r,n){let i=it(),o=t.anchored;i.x=t.startx,i.y=t.starty,i.class="activation"+n%3,i.width=t.stopx-t.startx,i.height=a-t.starty,wt(o,i)},"drawActivation"),Mr=f(async function(e,t,a,r){let{boxMargin:n,boxTextMargin:i,labelBoxHeight:o,labelBoxWidth:h,messageFontFamily:l,messageFontSize:s,messageFontWeight:T}=r,E=e.append("g"),g=f(function(m,y,w,P){return E.append("line").attr("x1",m).attr("y1",y).attr("x2",w).attr("y2",P).attr("class","loopLine")},"drawLoopLine");g(t.startx,t.starty,t.stopx,t.starty),g(t.stopx,t.starty,t.stopx,t.stopy),g(t.startx,t.stopy,t.stopx,t.stopy),g(t.startx,t.starty,t.startx,t.stopy),t.sections!==void 0&&t.sections.forEach(function(m){g(t.startx,m.y,t.stopx,m.y).style("stroke-dasharray","3, 3")});let u=St();u.text=a,u.x=t.startx,u.y=t.starty,u.fontFamily=l,u.fontSize=s,u.fontWeight=T,u.anchor="middle",u.valign="middle",u.tspan=!1,u.width=h||50,u.height=o||20,u.textMargin=i,u.class="labelText",er(E,u),u=sr(),u.text=t.title,u.x=t.startx+h/2+(t.stopx-t.startx)/2,u.y=t.starty+n+i,u.anchor="middle",u.valign="middle",u.textMargin=i,u.class="loopText",u.fontFamily=l,u.fontSize=s,u.fontWeight=T,u.wrap=!0;let R=H(u.text)?await At(E,u,t):bt(E,u);if(t.sectionTitles!==void 0){for(let[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+n+i,u.class="loopText",u.anchor="middle",u.valign="middle",u.tspan=!1,u.fontFamily=l,u.fontSize=s,u.fontWeight=T,u.wrap=t.wrap,H(u.text)?(t.starty=t.sections[m].y,await At(E,u,t)):bt(E,u);let w=Math.round(R.map(P=>(P._groups||P)[0][0].getBBox().height).reduce((P,k)=>P+k));t.sections[m].height+=w-(n+i)}}return t.height=Math.round(t.stopy-t.starty),E},"drawLoop"),rr=f(function(e,t){Xe(e,t)},"drawBackgroundRect"),Br=f(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"),Vr=f(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"),Yr=f(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"),vr=f(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"),Wr=f(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"),Kr=f(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"),Fr=f(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"),sr=f(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"),qr=f(function(){return{x:0,y:0,fill:"#EDF2AE",stroke:"#666",width:100,anchor:"start",height:100,rx:0,ry:0}},"getNoteRect"),ht=(function(){function e(i,o,h,l,s,T,E){let g=o.append("text").attr("x",h+s/2).attr("y",l+T/2+5).style("text-anchor","middle").text(i);n(g,E)}f(e,"byText");function t(i,o,h,l,s,T,E,g){let{actorFontSize:u,actorFontFamily:R,actorFontWeight:m}=g,[y,w]=te(u),P=i.split(L.lineBreakRegex);for(let k=0;k<P.length;k++){let D=k*y-y*(P.length-1)/2,v=o.append("text").attr("x",h+s/2).attr("y",l).style("text-anchor","middle").style("font-size",w).style("font-weight",m).style("font-family",R);v.append("tspan").attr("x",h+s/2).attr("dy",D).text(P[k]),v.attr("y",l+T/2).attr("dominant-baseline","central").attr("alignment-baseline","central"),n(v,E)}}f(t,"byTspan");function a(i,o,h,l,s,T,E,g){let u=o.append("switch"),m=u.append("foreignObject").attr("x",h).attr("y",l).attr("width",s).attr("height",T).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(i),t(i,u,h,l,s,T,E,g),n(m,E)}f(a,"byFo");async function r(i,o,h,l,s,T,E,g){let u=await _t(i,Bt()),R=o.append("switch"),y=R.append("foreignObject").attr("x",h+s/2-u.width/2).attr("y",l+T/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 $t(i,Bt())),t(i,R,h,l,s,T,E,g),n(y,E)}f(r,"byKatex");function n(i,o){for(let h in o)o.hasOwnProperty(h)&&i.attr(h,o[h])}return f(n,"_setTextAttrs"),function(i,o=!1){return o?r:i.textPlacement==="fo"?a:i.textPlacement==="old"?e:t}})(),Hr=(function(){function e(n,i,o,h,l,s,T){let E=i.append("text").attr("x",o).attr("y",h).style("text-anchor","start").text(n);r(E,T)}f(e,"byText");function t(n,i,o,h,l,s,T,E){let{actorFontSize:g,actorFontFamily:u,actorFontWeight:R}=E,m=n.split(L.lineBreakRegex);for(let y=0;y<m.length;y++){let w=y*g-g*(m.length-1)/2,P=i.append("text").attr("x",o).attr("y",h).style("text-anchor","start").style("font-size",g).style("font-weight",R).style("font-family",u);P.append("tspan").attr("x",o).attr("dy",w).text(m[y]),P.attr("y",h+s/2).attr("dominant-baseline","central").attr("alignment-baseline","central"),r(P,T)}}f(t,"byTspan");function a(n,i,o,h,l,s,T,E){let g=i.append("switch"),R=g.append("foreignObject").attr("x",o).attr("y",h).attr("width",l).attr("height",s).append("xhtml:div").style("display","table").style("height","100%").style("width","100%");R.append("div").style("display","table-cell").style("text-align","center").style("vertical-align","middle").text(n),t(n,g,o,h,l,s,T,E),r(R,T)}f(a,"byFo");function r(n,i){for(let o in i)i.hasOwnProperty(o)&&n.attr(o,i[o])}return f(r,"_setTextAttrs"),function(n){return n.textPlacement==="fo"?a:n.textPlacement==="old"?e:t}})(),zr=f(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"),Ur=f(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"),Gr=f(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"),Xr=f(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"),Y={drawRect:wt,drawText:bt,drawLabel:er,drawActor:Ar,drawBox:kr,drawPopup:Ir,anchorElement:Dr,drawActivation:Cr,drawLoop:Mr,drawBackgroundRect:rr,insertArrowHead:vr,insertArrowFilledHead:Wr,insertSequenceNumber:Kr,insertArrowCrossHead:Fr,insertDatabaseIcon:Br,insertComputerIcon:Vr,insertClockIcon:Yr,getTextObj:sr,getNoteRect:qr,fixLifeLineHeights:se,sanitizeUrl:re.sanitizeUrl,insertSolidTopArrowHead:zr,insertSolidBottomArrowHead:Ur,insertStickTopArrowHead:Gr,insertStickBottomArrowHead:Xr};var d={},x={data:{startx:void 0,stopx:void 0,starty:void 0,stopy:void 0},verticalPos:0,sequenceItems:[],activations:[],models:{getHeight:f(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:f(function(){this.actors=[],this.boxes=[],this.loops=[],this.messages=[],this.notes=[]},"clear"),addBox:f(function(e){this.boxes.push(e)},"addBox"),addActor:f(function(e){this.actors.push(e)},"addActor"),addLoop:f(function(e){this.loops.push(e)},"addLoop"),addMessage:f(function(e){this.messages.push(e)},"addMessage"),addNote:f(function(e){this.notes.push(e)},"addNote"),lastActor:f(function(){return this.actors[this.actors.length-1]},"lastActor"),lastLoop:f(function(){return this.loops[this.loops.length-1]},"lastLoop"),lastMessage:f(function(){return this.messages[this.messages.length-1]},"lastMessage"),lastNote:f(function(){return this.notes[this.notes.length-1]},"lastNote"),actors:[],boxes:[],loops:[],messages:[],notes:[]},init:f(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,or(Q())},"init"),updateVal:f(function(e,t,a,r){e[t]===void 0?e[t]=a:e[t]=r(a,e[t])},"updateVal"),updateBounds:f(function(e,t,a,r){let n=this,i=0;function o(h){return f(function(s){i++;let T=n.sequenceItems.length-i+1;n.updateVal(s,"starty",t-T*d.boxMargin,Math.min),n.updateVal(s,"stopy",r+T*d.boxMargin,Math.max),n.updateVal(x.data,"startx",e-T*d.boxMargin,Math.min),n.updateVal(x.data,"stopx",a+T*d.boxMargin,Math.max),h!=="activation"&&(n.updateVal(s,"startx",e-T*d.boxMargin,Math.min),n.updateVal(s,"stopx",a+T*d.boxMargin,Math.max),n.updateVal(x.data,"starty",t-T*d.boxMargin,Math.min),n.updateVal(x.data,"stopy",r+T*d.boxMargin,Math.max))},"updateItemBounds")}f(o,"updateFn"),this.sequenceItems.forEach(o()),this.activations.forEach(o("activation"))},"updateBounds"),insert:f(function(e,t,a,r){let n=L.getMin(e,a),i=L.getMax(e,a),o=L.getMin(t,r),h=L.getMax(t,r);this.updateVal(x.data,"startx",n,Math.min),this.updateVal(x.data,"starty",o,Math.min),this.updateVal(x.data,"stopx",i,Math.max),this.updateVal(x.data,"stopy",h,Math.max),this.updateBounds(n,o,i,h)},"insert"),newActivation:f(function(e,t,a){let r=a.get(e.from),n=Ft(e.from).length||0,i=r.x+r.width/2+(n-1)*d.activationWidth/2;this.activations.push({startx:i,starty:this.verticalPos+2,stopx:i+d.activationWidth,stopy:void 0,actor:e.from,anchored:Y.anchorElement(t)})},"newActivation"),endActivation:f(function(e){let t=this.activations.map(function(a){return a.actor}).lastIndexOf(e.from);return this.activations.splice(t,1)[0]},"endActivation"),createLoop:f(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:f(function(e={message:void 0,wrap:!1,width:void 0},t){this.sequenceItems.push(this.createLoop(e,t))},"newLoop"),endLoop:f(function(){return this.sequenceItems.pop()},"endLoop"),isLoopOverlap:f(function(){return this.sequenceItems.length?this.sequenceItems[this.sequenceItems.length-1].overlap:!1},"isLoopOverlap"),addSectionToLoop:f(function(e){let 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:f(function(){this.isLoopOverlap()&&(this.savedVerticalPos=this.verticalPos)},"saveVerticalPos"),resetVerticalPos:f(function(){this.isLoopOverlap()&&(this.verticalPos=this.savedVerticalPos)},"resetVerticalPos"),bumpVerticalPos:f(function(e){this.verticalPos=this.verticalPos+e,this.data.stopy=L.getMax(this.data.stopy,this.verticalPos)},"bumpVerticalPos"),getVerticalPos:f(function(){return this.verticalPos},"getVerticalPos"),getBounds:f(function(){return{bounds:this.data,models:this.models}},"getBounds")},Jr=f(async function(e,t){x.bumpVerticalPos(d.boxMargin),t.height=d.boxMargin,t.starty=x.getVerticalPos();let a=it();a.x=t.startx,a.y=t.starty,a.width=t.width||d.width,a.class="note";let r=e.append("g"),n=Y.drawRect(r,a),i=St();i.x=t.startx,i.y=t.starty,i.width=a.width,i.dy="1em",i.text=t.message,i.class="noteText",i.fontFamily=d.noteFontFamily,i.fontSize=d.noteFontSize,i.fontWeight=d.noteFontWeight,i.anchor=d.noteAlign,i.textMargin=d.noteMargin,i.valign="center";let o=H(i.text)?await At(r,i):bt(r,i),h=Math.round(o.map(l=>(l._groups||l)[0][0].getBBox().height).reduce((l,s)=>l+s));n.attr("height",h+2*d.noteMargin),t.height+=h+2*d.noteMargin,x.bumpVerticalPos(h+2*d.noteMargin),t.stopy=t.starty+h+2*d.noteMargin,t.stopx=t.startx+a.width,x.insert(t.startx,t.starty,t.stopx,t.stopy),x.models.addNote(t)},"drawNote"),Zr=f(function(e,t,a,r,n,i,o){let h=r.db.getActors(),l=h.get(t.from),s=h.get(t.to),T=a.sequenceVisible,E=l.x+l.width/2,g=s.x+s.width/2,u=E<=g,R=cr(t,r),m=e.append("g"),y=16.5,w=f((W,K)=>{let z=W?y:-y;return K?-z:z},"getCircleOffset"),P=f(W=>{m.append("circle").attr("cx",W).attr("cy",o).attr("r",5).attr("width",10).attr("height",10)},"drawCircle"),{CENTRAL_CONNECTION:k,CENTRAL_CONNECTION_REVERSE:D,CENTRAL_CONNECTION_DUAL:v}=r.db.LINETYPE;if(T)switch(t.centralConnection){case k:R&&(g+=w(u,!0));break;case D:R||(E+=w(u,!1));break;case v:R?g+=w(u,!0):E+=w(u,!1);break}switch(t.centralConnection){case k:P(g);break;case D:P(E);break;case v:P(E),P(g);break}},"drawCentralConnection"),mt=f(e=>({fontFamily:e.messageFontFamily,fontSize:e.messageFontSize,fontWeight:e.messageFontWeight}),"messageFont"),Rt=f(e=>({fontFamily:e.noteFontFamily,fontSize:e.noteFontSize,fontWeight:e.noteFontWeight}),"noteFont"),ae=f(e=>({fontFamily:e.actorFontFamily,fontSize:e.actorFontSize,fontWeight:e.actorFontWeight}),"actorFont");async function Qr(e,t){x.bumpVerticalPos(10);let{startx:a,stopx:r,message:n}=t,i=L.splitBreaks(n).length,o=H(n),h=o?await _t(n,Q()):F.calculateTextDimensions(n,mt(d));if(!o){let E=h.height/i;t.height+=E,x.bumpVerticalPos(E)}let l,s=h.height-10,T=h.width;if(a===r){l=x.getVerticalPos()+s,d.rightAngles||(s+=d.boxMargin,l=x.getVerticalPos()+s),s+=30;let E=L.getMax(T/2,d.width/2);x.insert(a-E,x.getVerticalPos()-10+s,r+E,x.getVerticalPos()+30+s)}else s+=d.boxMargin,l=x.getVerticalPos()+s,x.insert(a,l-10,r,l);return x.bumpVerticalPos(s),t.height+=s,t.stopy=t.starty+t.height,x.insert(t.fromBounds,t.starty,t.toBounds,t.stopy),l}f(Qr,"boundMessage");var $r=f(async function(e,t,a,r,n){let{startx:i,stopx:o,starty:h,message:l,type:s,sequenceIndex:T,sequenceVisible:E}=t,g=F.calculateTextDimensions(l,mt(d)),u=St();u.x=i,u.y=h+10,u.width=o-i,u.class="messageText",u.dy="1em",u.text=l,u.fontFamily=d.messageFontFamily,u.fontSize=d.messageFontSize,u.fontWeight=d.messageFontWeight,u.anchor=d.messageAlign,u.valign="center",u.textMargin=d.wrapPadding,u.tspan=!1,H(u.text)?await At(e,u,{startx:i,stopx:o,starty:a}):bt(e,u);let R=g.width,m;if(i===o){let w=E||d.showSequenceNumbers,P=cr(n,r),k=ls(n,r),D=i+(w&&(P||k)?10:0);d.rightAngles?m=e.append("path").attr("d",`M ${D},${a} H ${i+L.getMax(d.width/2,R/2)} V ${a+25} H ${i}`):m=e.append("path").attr("d","M "+D+","+a+" C "+(D+60)+","+(a-10)+" "+(i+60)+","+(a+30)+" "+i+","+(a+20))}else m=e.append("line"),m.attr("x1",i),m.attr("y1",a),m.attr("x2",o),m.attr("y2",a),nr(n,r)&&Zr(e,n,t,r,i,o,a);s===r.db.LINETYPE.DOTTED||s===r.db.LINETYPE.DOTTED_CROSS||s===r.db.LINETYPE.DOTTED_POINT||s===r.db.LINETYPE.DOTTED_OPEN||s===r.db.LINETYPE.BIDIRECTIONAL_DOTTED||s===r.db.LINETYPE.SOLID_TOP_DOTTED||s===r.db.LINETYPE.SOLID_BOTTOM_DOTTED||s===r.db.LINETYPE.STICK_TOP_DOTTED||s===r.db.LINETYPE.STICK_BOTTOM_DOTTED||s===r.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED||s===r.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED||s===r.db.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED||s===r.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED?(m.style("stroke-dasharray","3, 3"),m.attr("class","messageLine1")):m.attr("class","messageLine0");let y="";if(d.arrowMarkerAbsolute&&(y=Ye(!0)),m.attr("stroke-width",2),m.attr("stroke","none"),m.style("fill","none"),(s===r.db.LINETYPE.SOLID_TOP||s===r.db.LINETYPE.SOLID_TOP_DOTTED)&&m.attr("marker-end","url("+y+"#solidTopArrowHead)"),(s===r.db.LINETYPE.SOLID_BOTTOM||s===r.db.LINETYPE.SOLID_BOTTOM_DOTTED)&&m.attr("marker-end","url("+y+"#solidBottomArrowHead)"),(s===r.db.LINETYPE.STICK_TOP||s===r.db.LINETYPE.STICK_TOP_DOTTED)&&m.attr("marker-end","url("+y+"#stickTopArrowHead)"),(s===r.db.LINETYPE.STICK_BOTTOM||s===r.db.LINETYPE.STICK_BOTTOM_DOTTED)&&m.attr("marker-end","url("+y+"#stickBottomArrowHead)"),(s===r.db.LINETYPE.SOLID_ARROW_TOP_REVERSE||s===r.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED)&&m.attr("marker-start","url("+y+"#solidBottomArrowHead)"),(s===r.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE||s===r.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED)&&m.attr("marker-start","url("+y+"#solidTopArrowHead)"),(s===r.db.LINETYPE.STICK_ARROW_TOP_REVERSE||s===r.db.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED)&&m.attr("marker-start","url("+y+"#stickBottomArrowHead)"),(s===r.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE||s===r.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED)&&m.attr("marker-start","url("+y+"#stickTopArrowHead)"),(s===r.db.LINETYPE.SOLID||s===r.db.LINETYPE.DOTTED)&&m.attr("marker-end","url("+y+"#arrowhead)"),(s===r.db.LINETYPE.BIDIRECTIONAL_SOLID||s===r.db.LINETYPE.BIDIRECTIONAL_DOTTED)&&(m.attr("marker-start","url("+y+"#arrowhead)"),m.attr("marker-end","url("+y+"#arrowhead)")),(s===r.db.LINETYPE.SOLID_POINT||s===r.db.LINETYPE.DOTTED_POINT)&&m.attr("marker-end","url("+y+"#filled-head)"),(s===r.db.LINETYPE.SOLID_CROSS||s===r.db.LINETYPE.DOTTED_CROSS)&&m.attr("marker-end","url("+y+"#crosshead)"),E||d.showSequenceNumbers){let w=s===r.db.LINETYPE.BIDIRECTIONAL_SOLID||s===r.db.LINETYPE.BIDIRECTIONAL_DOTTED,P=s===r.db.LINETYPE.SOLID_ARROW_TOP_REVERSE||s===r.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED||s===r.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE||s===r.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED||s===r.db.LINETYPE.STICK_ARROW_TOP_REVERSE||s===r.db.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED||s===r.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE||s===r.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED,k=6,D=nr(n,r),v=i,W=o;w?(i<o?v=i+k*2:(v=i-k+(D?-5:0),v+=n?.centralConnection===r.db.LINETYPE.CENTRAL_CONNECTION_DUAL||n?.centralConnection===r.db.LINETYPE.CENTRAL_CONNECTION_REVERSE?-7.5:0),m.attr("x1",v)):P?(o>i?W=o-2*k:(W=o-k,v+=n?.centralConnection===r.db.LINETYPE.CENTRAL_CONNECTION_DUAL||n?.centralConnection===r.db.LINETYPE.CENTRAL_CONNECTION_REVERSE?-7.5:0),W+=D?15:0,m.attr("x2",W),m.attr("x1",v)):m.attr("x1",i+k);let K=0,z=i===o,X=i<=o;z?K=t.fromBounds+1:P?K=X?t.toBounds-1:t.fromBounds+1:K=X?t.fromBounds+1:t.toBounds-1,e.append("line").attr("x1",K).attr("y1",a).attr("x2",K).attr("y2",a).attr("stroke-width",0).attr("marker-start","url("+y+"#sequencenumber)"),e.append("text").attr("x",K).attr("y",a+4).attr("font-family","sans-serif").attr("font-size","12px").attr("text-anchor","middle").attr("class","sequenceNumber").text(T)}},"drawMessage"),jr=f(function(e,t,a,r,n,i,o){let h=0,l=0,s,T=0;for(let E of r){let g=t.get(E),u=g.box;s&&s!=u&&(o||x.models.addBox(s),l+=d.boxMargin+s.margin),u&&u!=s&&(o||(u.x=h+l,u.y=n),l+=u.margin),g.width=g.width||d.width,g.height=L.getMax(g.height||d.height,d.height),g.margin=g.margin||d.actorMargin,T=L.getMax(T,g.height),a.get(g.name)&&(l+=g.width/2),g.x=h+l,g.starty=x.getVerticalPos(),x.insert(g.x,n,g.x+g.width,g.height),h+=g.width+l,g.box&&(g.box.width=h+u.margin-g.box.x),l=g.margin,s=g.box,x.models.addActor(g)}s&&!o&&x.models.addBox(s),x.bumpVerticalPos(T)},"addActorRenderingData"),ne=f(async function(e,t,a,r){if(r){let n=0;x.bumpVerticalPos(d.boxMargin*2);for(let i of a){let o=t.get(i);o.stopy||(o.stopy=x.getVerticalPos());let h=await Y.drawActor(e,o,d,!0);n=L.getMax(n,h)}x.bumpVerticalPos(n+d.boxMargin)}else for(let n of a){let i=t.get(n);await Y.drawActor(e,i,d,!1)}},"drawActors"),ir=f(function(e,t,a,r){let n=0,i=0;for(let o of a){let h=t.get(o),l=ss(h),s=Y.drawPopup(e,h,l,d,d.forceMenus,r);s.height>n&&(n=s.height),s.width+h.x>i&&(i=s.width+h.x)}return{maxHeight:n,maxWidth:i}},"drawActorsPopup"),or=f(function(e){Ve(d,e),e.fontFamily&&(d.actorFontFamily=d.noteFontFamily=d.messageFontFamily=e.fontFamily),e.fontSize&&(d.actorFontSize=d.noteFontSize=d.messageFontSize=e.fontSize),e.fontWeight&&(d.actorFontWeight=d.noteFontWeight=d.messageFontWeight=e.fontWeight)},"setConf"),Ft=f(function(e){return x.activations.filter(function(t){return t.actor===e})},"actorActivations"),ar=f(function(e,t){let a=t.get(e),r=Ft(e),n=r.reduce(function(o,h){return L.getMin(o,h.startx)},a.x+a.width/2-1),i=r.reduce(function(o,h){return L.getMax(o,h.stopx)},a.x+a.width/2+1);return[n,i]},"activationBounds");function lt(e,t,a,r,n){x.bumpVerticalPos(a);let i=r;if(t.id&&t.message&&e[t.id]){let o=e[t.id].width,h=mt(d);t.message=F.wrapLabel(`[${t.message}]`,o-2*d.wrapPadding,h),t.width=o,t.wrap=!0;let l=F.calculateTextDimensions(t.message,h),s=L.getMax(l.height,d.labelBoxHeight);i=r+s,G.debug(`${s} - ${t.message}`)}n(t),x.bumpVerticalPos(i)}f(lt,"adjustLoopHeightForWrap");function ts(e,t,a,r,n,i,o){function h(T,E){T.x<n.get(e.from).x?(x.insert(t.stopx-E,t.starty,t.startx,t.stopy+T.height/2+d.noteMargin),t.stopx=t.stopx+E):(x.insert(t.startx,t.starty,t.stopx+E,t.stopy+T.height/2+d.noteMargin),t.stopx=t.stopx-E)}f(h,"receiverAdjustment");function l(T,E){T.x<n.get(e.to).x?(x.insert(t.startx-E,t.starty,t.stopx,t.stopy+T.height/2+d.noteMargin),t.startx=t.startx+E):(x.insert(t.stopx,t.starty,t.startx+E,t.stopy+T.height/2+d.noteMargin),t.startx=t.startx-E)}f(l,"senderAdjustment");let s=[Pt.ACTOR,Pt.CONTROL,Pt.ENTITY,Pt.DATABASE];if(i.get(e.to)==r){let T=n.get(e.to),E=s.includes(T.type)?Tt/2+3:T.width/2+3;h(T,E),T.starty=a-T.height/2,x.bumpVerticalPos(T.height/2)}else if(o.get(e.from)==r){let T=n.get(e.from);if(d.mirrorActors){let E=s.includes(T.type)?Tt/2:T.width/2;l(T,E)}T.stopy=a-T.height/2,x.bumpVerticalPos(T.height/2)}else if(o.get(e.to)==r){let T=n.get(e.to);if(d.mirrorActors){let E=s.includes(T.type)?Tt/2+3:T.width/2+3;h(T,E)}T.stopy=a-T.height/2,x.bumpVerticalPos(T.height/2)}}f(ts,"adjustCreatedDestroyedData");var es=f(async function(e,t,a,r){let{securityLevel:n,sequence:i}=Q();d=i;let o;n==="sandbox"&&(o=Nt("#i"+t));let h=n==="sandbox"?Nt(o.nodes()[0].contentDocument.body):Nt("body"),l=n==="sandbox"?o.nodes()[0].contentDocument:document;x.init(),G.debug(r.db);let s=n==="sandbox"?h.select(`[id="${t}"]`):Nt(`[id="${t}"]`),T=r.db.getActors(),E=r.db.getCreatedActors(),g=r.db.getDestroyedActors(),u=r.db.getBoxes(),R=r.db.getActorKeys(),m=r.db.getMessages(),y=r.db.getDiagramTitle(),w=r.db.hasAtLeastOneBox(),P=r.db.hasAtLeastOneBoxWithTitle(),k=await rs(T,m,r);if(d.height=await as(T,k,u),Y.insertComputerIcon(s),Y.insertDatabaseIcon(s),Y.insertClockIcon(s),w&&(x.bumpVerticalPos(d.boxMargin),P&&x.bumpVerticalPos(u[0].textMaxHeight)),d.hideUnusedParticipants===!0){let I=new Set;m.forEach(b=>{I.add(b.from),I.add(b.to)}),R=R.filter(b=>I.has(b))}jr(s,T,E,R,0,m,!1);let D=await hs(m,T,k,r);Y.insertArrowHead(s),Y.insertArrowCrossHead(s),Y.insertArrowFilledHead(s),Y.insertSequenceNumber(s),Y.insertSolidTopArrowHead(s),Y.insertSolidBottomArrowHead(s),Y.insertStickTopArrowHead(s),Y.insertStickBottomArrowHead(s);function v(I,b){let ot=x.endActivation(I);ot.starty+18>b&&(ot.starty=b-6,b+=12),Y.drawActivation(s,ot,b,d,Ft(I.from).length),x.insert(ot.startx,b-10,ot.stopx,b)}f(v,"activeEnd");let W=1,K=1,z=[],X=[],J=0;for(let I of m){let b,ot,ct;switch(I.type){case r.db.LINETYPE.NOTE:x.resetVerticalPos(),ot=I.noteModel,await Jr(s,ot);break;case r.db.LINETYPE.ACTIVE_START:x.newActivation(I,s,T);break;case r.db.LINETYPE.CENTRAL_CONNECTION:x.newActivation(I,s,T);break;case r.db.LINETYPE.CENTRAL_CONNECTION_REVERSE:x.newActivation(I,s,T);break;case r.db.LINETYPE.ACTIVE_END:v(I,x.getVerticalPos());break;case r.db.LINETYPE.LOOP_START:lt(D,I,d.boxMargin,d.boxMargin+d.boxTextMargin,M=>x.newLoop(M));break;case r.db.LINETYPE.LOOP_END:b=x.endLoop(),await Y.drawLoop(s,b,"loop",d),x.bumpVerticalPos(b.stopy-x.getVerticalPos()),x.models.addLoop(b);break;case r.db.LINETYPE.RECT_START:lt(D,I,d.boxMargin,d.boxMargin,M=>x.newLoop(void 0,M.message));break;case r.db.LINETYPE.RECT_END:b=x.endLoop(),X.push(b),x.models.addLoop(b),x.bumpVerticalPos(b.stopy-x.getVerticalPos());break;case r.db.LINETYPE.OPT_START:lt(D,I,d.boxMargin,d.boxMargin+d.boxTextMargin,M=>x.newLoop(M));break;case r.db.LINETYPE.OPT_END:b=x.endLoop(),await Y.drawLoop(s,b,"opt",d),x.bumpVerticalPos(b.stopy-x.getVerticalPos()),x.models.addLoop(b);break;case r.db.LINETYPE.ALT_START:lt(D,I,d.boxMargin,d.boxMargin+d.boxTextMargin,M=>x.newLoop(M));break;case r.db.LINETYPE.ALT_ELSE:lt(D,I,d.boxMargin+d.boxTextMargin,d.boxMargin,M=>x.addSectionToLoop(M));break;case r.db.LINETYPE.ALT_END:b=x.endLoop(),await Y.drawLoop(s,b,"alt",d),x.bumpVerticalPos(b.stopy-x.getVerticalPos()),x.models.addLoop(b);break;case r.db.LINETYPE.PAR_START:case r.db.LINETYPE.PAR_OVER_START:lt(D,I,d.boxMargin,d.boxMargin+d.boxTextMargin,M=>x.newLoop(M)),x.saveVerticalPos();break;case r.db.LINETYPE.PAR_AND:lt(D,I,d.boxMargin+d.boxTextMargin,d.boxMargin,M=>x.addSectionToLoop(M));break;case r.db.LINETYPE.PAR_END:b=x.endLoop(),await Y.drawLoop(s,b,"par",d),x.bumpVerticalPos(b.stopy-x.getVerticalPos()),x.models.addLoop(b);break;case r.db.LINETYPE.AUTONUMBER:W=I.message.start||W,K=I.message.step||K,I.message.visible?r.db.enableSequenceNumbers():r.db.disableSequenceNumbers();break;case r.db.LINETYPE.CRITICAL_START:lt(D,I,d.boxMargin,d.boxMargin+d.boxTextMargin,M=>x.newLoop(M));break;case r.db.LINETYPE.CRITICAL_OPTION:lt(D,I,d.boxMargin+d.boxTextMargin,d.boxMargin,M=>x.addSectionToLoop(M));break;case r.db.LINETYPE.CRITICAL_END:b=x.endLoop(),await Y.drawLoop(s,b,"critical",d),x.bumpVerticalPos(b.stopy-x.getVerticalPos()),x.models.addLoop(b);break;case r.db.LINETYPE.BREAK_START:lt(D,I,d.boxMargin,d.boxMargin+d.boxTextMargin,M=>x.newLoop(M));break;case r.db.LINETYPE.BREAK_END:b=x.endLoop(),await Y.drawLoop(s,b,"break",d),x.bumpVerticalPos(b.stopy-x.getVerticalPos()),x.models.addLoop(b);break;default:try{ct=I.msgModel,ct.starty=x.getVerticalPos(),ct.sequenceIndex=W,ct.sequenceVisible=r.db.showSequenceNumbers();let M=await Qr(s,ct);ts(I,ct,M,J,T,E,g),z.push({messageModel:ct,lineStartY:M,msg:I}),x.models.addMessage(ct)}catch(M){G.error("error while drawing message",M)}}[r.db.LINETYPE.SOLID_OPEN,r.db.LINETYPE.DOTTED_OPEN,r.db.LINETYPE.SOLID,r.db.LINETYPE.SOLID_TOP,r.db.LINETYPE.SOLID_BOTTOM,r.db.LINETYPE.STICK_TOP,r.db.LINETYPE.STICK_BOTTOM,r.db.LINETYPE.SOLID_TOP_DOTTED,r.db.LINETYPE.SOLID_BOTTOM_DOTTED,r.db.LINETYPE.STICK_TOP_DOTTED,r.db.LINETYPE.STICK_BOTTOM_DOTTED,r.db.LINETYPE.SOLID_ARROW_TOP_REVERSE,r.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE,r.db.LINETYPE.STICK_ARROW_TOP_REVERSE,r.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE,r.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED,r.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED,r.db.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED,r.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED,r.db.LINETYPE.DOTTED,r.db.LINETYPE.SOLID_CROSS,r.db.LINETYPE.DOTTED_CROSS,r.db.LINETYPE.SOLID_POINT,r.db.LINETYPE.DOTTED_POINT,r.db.LINETYPE.BIDIRECTIONAL_SOLID,r.db.LINETYPE.BIDIRECTIONAL_DOTTED].includes(I.type)&&(W=W+K),J++}G.debug("createdActors",E),G.debug("destroyedActors",g),await ne(s,T,R,!1);for(let I of z)await $r(s,I.messageModel,I.lineStartY,r,I.msg);d.mirrorActors&&await ne(s,T,R,!0),X.forEach(I=>Y.drawBackgroundRect(s,I)),se(s,T,R,d);for(let I of x.models.boxes){I.height=x.getVerticalPos()-I.y,x.insert(I.x,I.y,I.x+I.width,I.height);let b=d.boxMargin*2;I.startx=I.x-b,I.starty=I.y-b*.25,I.stopx=I.startx+I.width+2*b,I.stopy=I.starty+I.height+b*.75,I.stroke="rgb(0,0,0, 0.5)",Y.drawBox(s,I,d)}w&&x.bumpVerticalPos(d.boxMargin);let U=ir(s,T,R,l),{bounds:C}=x.getBounds();C.startx===void 0&&(C.startx=0),C.starty===void 0&&(C.starty=0),C.stopx===void 0&&(C.stopx=0),C.stopy===void 0&&(C.stopy=0);let j=C.stopy-C.starty;j<U.maxHeight&&(j=U.maxHeight);let $=j+2*d.diagramMarginY;d.mirrorActors&&($=$-d.boxMargin+d.bottomMarginAdj);let tt=C.stopx-C.startx;tt<U.maxWidth&&(tt=U.maxWidth);let rt=tt+2*d.diagramMarginX;y&&s.append("text").text(y).attr("x",(C.stopx-C.startx)/2-2*d.diagramMarginX).attr("y",-25),ve(s,$,rt,d.useMaxWidth);let st=y?40:0;s.attr("viewBox",C.startx-d.diagramMarginX+" -"+(d.diagramMarginY+st)+" "+rt+" "+($+st)),G.debug("models:",x.models)},"draw");async function rs(e,t,a){let r={};for(let n of t)if(e.get(n.to)&&e.get(n.from)){let i=e.get(n.to);if(n.placement===a.db.PLACEMENT.LEFTOF&&!i.prevActor||n.placement===a.db.PLACEMENT.RIGHTOF&&!i.nextActor)continue;let o=n.placement!==void 0,h=!o,l=o?Rt(d):mt(d),s=n.wrap?F.wrapLabel(n.message,d.width-2*d.wrapPadding,l):n.message,E=(H(s)?await _t(n.message,Q()):F.calculateTextDimensions(s,l)).width+2*d.wrapPadding;h&&n.from===i.nextActor?r[n.to]=L.getMax(r[n.to]||0,E):h&&n.from===i.prevActor?r[n.from]=L.getMax(r[n.from]||0,E):h&&n.from===n.to?(r[n.from]=L.getMax(r[n.from]||0,E/2),r[n.to]=L.getMax(r[n.to]||0,E/2)):n.placement===a.db.PLACEMENT.RIGHTOF?r[n.from]=L.getMax(r[n.from]||0,E):n.placement===a.db.PLACEMENT.LEFTOF?r[i.prevActor]=L.getMax(r[i.prevActor]||0,E):n.placement===a.db.PLACEMENT.OVER&&(i.prevActor&&(r[i.prevActor]=L.getMax(r[i.prevActor]||0,E/2)),i.nextActor&&(r[n.from]=L.getMax(r[n.from]||0,E/2)))}return G.debug("maxMessageWidthPerActor:",r),r}f(rs,"getMaxMessageWidthPerActor");var ss=f(function(e){let t=0,a=ae(d);for(let r in e.links){let i=F.calculateTextDimensions(r,a).width+2*d.wrapPadding+2*d.boxMargin;t<i&&(t=i)}return t},"getRequiredPopupWidth");async function as(e,t,a){let r=0;for(let i of e.keys()){let o=e.get(i);o.wrap&&(o.description=F.wrapLabel(o.description,d.width-2*d.wrapPadding,ae(d)));let h=H(o.description)?await _t(o.description,Q()):F.calculateTextDimensions(o.description,ae(d));o.width=o.wrap?d.width:L.getMax(d.width,h.width+2*d.wrapPadding),o.height=o.wrap?L.getMax(h.height,d.height):d.height,r=L.getMax(r,o.height)}for(let i in t){let o=e.get(i);if(!o)continue;let h=e.get(o.nextActor);if(!h){let E=t[i]+d.actorMargin-o.width/2;o.margin=L.getMax(E,d.actorMargin);continue}let s=t[i]+d.actorMargin-o.width/2-h.width/2;o.margin=L.getMax(s,d.actorMargin)}let n=0;return a.forEach(i=>{let o=mt(d),h=i.actorKeys.reduce((E,g)=>E+=e.get(g).width+(e.get(g).margin||0),0),l=d.boxMargin*8;h+=l,h-=2*d.boxTextMargin,i.wrap&&(i.name=F.wrapLabel(i.name,h-2*d.wrapPadding,o));let s=F.calculateTextDimensions(i.name,o);n=L.getMax(s.height,n);let T=L.getMax(h,s.width+2*d.wrapPadding);if(i.margin=d.boxTextMargin,h<T){let E=(T-h)/2;i.margin+=E}}),a.forEach(i=>i.textMaxHeight=n),L.getMax(r,d.height)}f(as,"calculateActorMargins");var ns=f(async function(e,t,a){let r=t.get(e.from),n=t.get(e.to),i=r.x,o=n.x,h=e.wrap&&e.message,l=H(e.message)?await _t(e.message,Q()):F.calculateTextDimensions(h?F.wrapLabel(e.message,d.width,Rt(d)):e.message,Rt(d)),s={width:h?d.width:L.getMax(d.width,l.width+2*d.noteMargin),height:0,startx:r.x,stopx:0,starty:0,stopy:0,message:e.message};return e.placement===a.db.PLACEMENT.RIGHTOF?(s.width=h?L.getMax(d.width,l.width):L.getMax(r.width/2+n.width/2,l.width+2*d.noteMargin),s.startx=i+(r.width+d.actorMargin)/2):e.placement===a.db.PLACEMENT.LEFTOF?(s.width=h?L.getMax(d.width,l.width+2*d.noteMargin):L.getMax(r.width/2+n.width/2,l.width+2*d.noteMargin),s.startx=i-s.width+(r.width-d.actorMargin)/2):e.to===e.from?(l=F.calculateTextDimensions(h?F.wrapLabel(e.message,L.getMax(d.width,r.width),Rt(d)):e.message,Rt(d)),s.width=h?L.getMax(d.width,r.width):L.getMax(r.width,d.width,l.width+2*d.noteMargin),s.startx=i+(r.width-s.width)/2):(s.width=Math.abs(i+r.width/2-(o+n.width/2))+d.actorMargin,s.startx=i<o?i+r.width/2-d.actorMargin/2:o+n.width/2-d.actorMargin/2),h&&(s.message=F.wrapLabel(e.message,s.width-2*d.wrapPadding,Rt(d))),G.debug(`NM:[${s.startx},${s.stopx},${s.starty},${s.stopy}:${s.width},${s.height}=${e.message}]`),s},"buildNoteModel"),is=4,os=6,nr=f(function(e,t){let{CENTRAL_CONNECTION:a,CENTRAL_CONNECTION_REVERSE:r,CENTRAL_CONNECTION_DUAL:n}=t.db.LINETYPE;return[a,r,n].includes(e.centralConnection)},"hasCentralConnection"),cs=f(function(e,t,a){let{CENTRAL_CONNECTION_REVERSE:r,CENTRAL_CONNECTION_DUAL:n,BIDIRECTIONAL_SOLID:i,BIDIRECTIONAL_DOTTED:o}=t.db.LINETYPE,h=0;return(e.centralConnection===r||e.centralConnection===n)&&(h+=is),(e.centralConnection===r||e.centralConnection===n)&&(e.type===i||e.type===o)&&(h+=a?0:-os),h},"calculateCentralConnectionOffset"),cr=f(function(e,t){let{SOLID_ARROW_TOP_REVERSE:a,SOLID_ARROW_TOP_REVERSE_DOTTED:r,SOLID_ARROW_BOTTOM_REVERSE:n,SOLID_ARROW_BOTTOM_REVERSE_DOTTED:i,STICK_ARROW_TOP_REVERSE:o,STICK_ARROW_TOP_REVERSE_DOTTED:h,STICK_ARROW_BOTTOM_REVERSE:l,STICK_ARROW_BOTTOM_REVERSE_DOTTED:s}=t.db.LINETYPE;return[a,r,n,i,o,h,l,s].includes(e.type)},"isReverseArrowType"),ls=f(function(e,t){let{BIDIRECTIONAL_SOLID:a,BIDIRECTIONAL_DOTTED:r}=t.db.LINETYPE;return[a,r].includes(e.type)},"isBidirectionalArrowType"),ds=f(function(e,t,a){if(![a.db.LINETYPE.SOLID_OPEN,a.db.LINETYPE.DOTTED_OPEN,a.db.LINETYPE.SOLID,a.db.LINETYPE.SOLID_TOP,a.db.LINETYPE.SOLID_BOTTOM,a.db.LINETYPE.STICK_TOP,a.db.LINETYPE.STICK_BOTTOM,a.db.LINETYPE.SOLID_TOP_DOTTED,a.db.LINETYPE.SOLID_BOTTOM_DOTTED,a.db.LINETYPE.STICK_TOP_DOTTED,a.db.LINETYPE.STICK_BOTTOM_DOTTED,a.db.LINETYPE.SOLID_ARROW_TOP_REVERSE,a.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE,a.db.LINETYPE.STICK_ARROW_TOP_REVERSE,a.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE,a.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED,a.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED,a.db.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED,a.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED,a.db.LINETYPE.DOTTED,a.db.LINETYPE.SOLID_CROSS,a.db.LINETYPE.DOTTED_CROSS,a.db.LINETYPE.SOLID_POINT,a.db.LINETYPE.DOTTED_POINT,a.db.LINETYPE.BIDIRECTIONAL_SOLID,a.db.LINETYPE.BIDIRECTIONAL_DOTTED].includes(e.type))return{};let[r,n]=ar(e.from,t),[i,o]=ar(e.to,t),h=r<=i,l=h?n:r,s=h?i:o;l+=cs(e,a,h);let T=Math.abs(i-o)>2,E=f(m=>h?-m:m,"adjustValue");e.from===e.to?s=l:(e.activate&&!T&&(s+=E(d.activationWidth/2-1)),[a.db.LINETYPE.SOLID_OPEN,a.db.LINETYPE.DOTTED_OPEN,a.db.LINETYPE.STICK_TOP,a.db.LINETYPE.STICK_BOTTOM,a.db.LINETYPE.STICK_TOP_DOTTED,a.db.LINETYPE.STICK_BOTTOM_DOTTED,a.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED,a.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED,a.db.LINETYPE.STICK_ARROW_TOP_REVERSE,a.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE,a.db.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED,a.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED,a.db.LINETYPE.SOLID_ARROW_TOP_REVERSE,a.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE].includes(e.type)||(s+=E(3)),[a.db.LINETYPE.BIDIRECTIONAL_SOLID,a.db.LINETYPE.BIDIRECTIONAL_DOTTED,a.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED,a.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED,a.db.LINETYPE.SOLID_ARROW_TOP_REVERSE,a.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE].includes(e.type)&&(l-=E(3)));let g=[r,n,i,o],u=Math.abs(l-s);e.wrap&&e.message&&(e.message=F.wrapLabel(e.message,L.getMax(u+2*d.wrapPadding,d.width),mt(d)));let R=F.calculateTextDimensions(e.message,mt(d));return{width:L.getMax(e.wrap?0:R.width+2*d.wrapPadding,u+2*d.wrapPadding,d.width),height:0,startx:l,stopx:s,starty:0,stopy:0,message:e.message,type:e.type,wrap:e.wrap,fromBounds:Math.min.apply(null,g),toBounds:Math.max.apply(null,g)}},"buildMessageModel"),hs=f(async function(e,t,a,r){let n={},i=[],o,h,l;for(let s of e){switch(s.type){case r.db.LINETYPE.LOOP_START:case r.db.LINETYPE.ALT_START:case r.db.LINETYPE.OPT_START:case r.db.LINETYPE.PAR_START:case r.db.LINETYPE.PAR_OVER_START:case r.db.LINETYPE.CRITICAL_START:case r.db.LINETYPE.BREAK_START:i.push({id:s.id,msg:s.message,from:Number.MAX_SAFE_INTEGER,to:Number.MIN_SAFE_INTEGER,width:0});break;case r.db.LINETYPE.ALT_ELSE:case r.db.LINETYPE.PAR_AND:case r.db.LINETYPE.CRITICAL_OPTION:s.message&&(o=i.pop(),n[o.id]=o,n[s.id]=o,i.push(o));break;case r.db.LINETYPE.LOOP_END:case r.db.LINETYPE.ALT_END:case r.db.LINETYPE.OPT_END:case r.db.LINETYPE.PAR_END:case r.db.LINETYPE.CRITICAL_END:case r.db.LINETYPE.BREAK_END:o=i.pop(),n[o.id]=o;break;case r.db.LINETYPE.ACTIVE_START:{let E=t.get(s.from?s.from:s.to.actor),g=Ft(s.from?s.from:s.to.actor).length,u=E.x+E.width/2+(g-1)*d.activationWidth/2,R={startx:u,stopx:u+d.activationWidth,actor:s.from,enabled:!0};x.activations.push(R)}break;case r.db.LINETYPE.ACTIVE_END:{let E=x.activations.map(g=>g.actor).lastIndexOf(s.from);x.activations.splice(E,1).splice(0,1)}break}s.placement!==void 0?(h=await ns(s,t,r),s.noteModel=h,i.forEach(E=>{o=E,o.from=L.getMin(o.from,h.startx),o.to=L.getMax(o.to,h.startx+h.width),o.width=L.getMax(o.width,Math.abs(o.from-o.to))-d.labelBoxWidth})):(l=ds(s,t,r),s.msgModel=l,l.startx&&l.stopx&&i.length>0&&i.forEach(E=>{if(o=E,l.startx===l.stopx){let g=t.get(s.from),u=t.get(s.to);o.from=L.getMin(g.x-l.width/2,g.x-g.width/2,o.from),o.to=L.getMax(u.x+l.width/2,u.x+g.width/2,o.to),o.width=L.getMax(o.width,Math.abs(o.to-o.from))-d.labelBoxWidth}else o.from=L.getMin(l.startx,o.from),o.to=L.getMax(l.stopx,o.to),o.width=L.getMax(o.width,l.width)-d.labelBoxWidth}))}return x.activations=[],G.debug("Loop type widths:",n),n},"calculateLoopBounds"),lr={bounds:x,drawActors:ne,drawActorsPopup:ir,setConf:or,draw:es};var Xs={parser:je,get db(){return new vt},renderer:lr,styles:tr,init:f(e=>{e.sequence||(e.sequence={}),e.wrap&&(e.sequence.wrap=e.wrap,Ue({sequence:{wrap:e.wrap}}))},"init")};export{Xs as diagram};