orbitchat 2.1.7 → 2.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (54) hide show
  1. package/README.md +21 -0
  2. package/bin/dev-server.js +62 -0
  3. package/bin/orbitchat.js +223 -71
  4. package/dist/assets/{api-DZkCbfw-.js → api-iWGWe9XZ.js} +1 -1
  5. package/dist/assets/arc-m8RC5oDD-DxtXpPlf.js +1 -0
  6. package/dist/assets/{blockDiagram-c4efeb88-NvaZhZFT-2jTGmfzw.js → blockDiagram-c4efeb88-CZ2mpei3-B_3saIkQ.js} +7 -7
  7. package/dist/assets/{c4Diagram-c83219d4-gPr1eF38-DMPWXy6y.js → c4Diagram-c83219d4-DL2EmCLj-Dv5sdkpm.js} +2 -2
  8. package/dist/assets/channel-BKp1WYnX-Cc6fwi-B.js +1 -0
  9. package/dist/assets/classDiagram-beda092f-vKbJ2bcD-CpzCwdb3.js +2 -0
  10. package/dist/assets/classDiagram-v2-2358418a-BHXpn1Du-ClzQ61Pm.js +2 -0
  11. package/dist/assets/clone-B1V2003j-Cr3Uw-Zs.js +1 -0
  12. package/dist/assets/{createText-1719965b-D9Y3vUMn-DDdadCK5.js → createText-1719965b-C2-AT0ab-CWg8fDWo.js} +2 -2
  13. package/dist/assets/edges-96097737-Zk-qG_8u-HnJhTil4.js +4 -0
  14. package/dist/assets/{erDiagram-0228fc6a-BLw8FsIp-Cs8VClxW.js → erDiagram-0228fc6a-B94anMjz-ocfxI7NV.js} +3 -3
  15. package/dist/assets/{flowDb-c6c81e3f-DXVkMlSE-lHya7k5v.js → flowDb-c6c81e3f-CRRW-bQO-G1WHNmUV.js} +4 -4
  16. package/dist/assets/{flowDiagram-50d868cf-mkkB0hFd-S2mNfjcZ.js → flowDiagram-50d868cf-DPzQMhJv-DgwkjDqI.js} +4 -4
  17. package/dist/assets/flowDiagram-v2-4f6560a1-Si9enBmB-DYUBnRO1.js +1 -0
  18. package/dist/assets/{flowchart-elk-definition-6af322e1-D9IbjnSJ-RN3qt1rV.js → flowchart-elk-definition-6af322e1-CULhtvD--GZ9ilB9C.js} +1 -1
  19. package/dist/assets/{ganttDiagram-a2739b55-Cqs5_Zht-C5tqANPy.js → ganttDiagram-a2739b55-Bp8yOLEz-CqM7mRjt.js} +3 -3
  20. package/dist/assets/{gitGraphDiagram-82fe8481-txBzFn40-CsYRcfiT.js → gitGraphDiagram-82fe8481-BYtOQJl0-C2naxeTp.js} +1 -1
  21. package/dist/assets/{graph-BZahQKIN-CenQ9kLM.js → graph-BV6jB5rk-CELreG_k.js} +1 -1
  22. package/dist/assets/index-42QQgFVq.css +1 -0
  23. package/dist/assets/{index-5325376f-DsNDppci-BmtId_7h.js → index-5325376f-DrY72DrM-CA0ZD5ej.js} +1 -1
  24. package/dist/assets/index-BaIhc-dj.js +1008 -0
  25. package/dist/assets/index-DlFdZiHl-BkXTu13U.js +134 -0
  26. package/dist/assets/{infoDiagram-8eee0895-SbmhgTjv-DWbp8qIg.js → infoDiagram-8eee0895-C6GFnrZ7-BhM7Tkvh.js} +4 -4
  27. package/dist/assets/{journeyDiagram-c64418c1-C7AiwbKr-CR4ESCM3.js → journeyDiagram-c64418c1-daS1W8qe-DipmPDM8.js} +4 -4
  28. package/dist/assets/{layout-j-hMNqAM-d_O0ZYu6.js → layout-LXMv3mSS-fzT-WsR4.js} +1 -1
  29. package/dist/assets/{mindmap-definition-8da855dc-B1WjnfxE-C_ekkGNm.js → mindmap-definition-8da855dc-DmNQYVT1-BupnMO6G.js} +1 -1
  30. package/dist/assets/{pieDiagram-a8764435-zrkaw4r--nNryZ7xt.js → pieDiagram-a8764435-381urBY5-CJU6X8kv.js} +5 -5
  31. package/dist/assets/{quadrantDiagram-1e28029f-C2Wa5n16-DJsmIh09.js → quadrantDiagram-1e28029f-hgRmK2bX-fzcWnYUM.js} +4 -4
  32. package/dist/assets/{requirementDiagram-08caed73-BtHxx079-DyPYX9i4.js → requirementDiagram-08caed73-BB0Q-cI9-CPFdXDhT.js} +1 -1
  33. package/dist/assets/{sankeyDiagram-a04cb91d-DXlmqTKB-DF_MhieU.js → sankeyDiagram-a04cb91d-BpsipZNt-B3YPu4J8.js} +5 -5
  34. package/dist/assets/{sequenceDiagram-c5b8d532-BVQF3vcA-OQvBng6Z.js → sequenceDiagram-c5b8d532-xoAvPcQJ-B9rDXSoA.js} +4 -4
  35. package/dist/assets/{stateDiagram-1ecb1508-Dybc3i2m-DpShq5Fv.js → stateDiagram-1ecb1508-b721R49K-CWcqUIUo.js} +1 -1
  36. package/dist/assets/stateDiagram-v2-c2b004d7-BmSbrbqZ-DlbnZV5y.js +1 -0
  37. package/dist/assets/{styles-b4e223ce-BSiU4oYL-D8WR6bxO.js → styles-b4e223ce-TYmJC5IN-BHQXJFVt.js} +3 -3
  38. package/dist/assets/{styles-ca3715f6-DU7x0doE-BqM8h3vG.js → styles-ca3715f6-CfJZu0Yn-DtD2x1No.js} +2 -2
  39. package/dist/assets/{styles-d45a18b0-B_CU21kM-BP9RAefH.js → styles-d45a18b0-DZ8oSYcV-CvugbGS9.js} +3 -3
  40. package/dist/assets/{svgDrawCommon-b86b1483-sbEe2n2v-CFwc1_jc.js → svgDrawCommon-b86b1483-CXPkN8HW-DH97F0YX.js} +1 -1
  41. package/dist/assets/{timeline-definition-faaaa080-b82QCnJ9-D_9su1EE.js → timeline-definition-faaaa080-LDFf1jfb-DxM6VoSn.js} +6 -6
  42. package/dist/assets/{xychartDiagram-f5964ef8-BtRcO0uy-C_Ru9X19.js → xychartDiagram-f5964ef8-DdhO5-Bp-CevMp6HN.js} +3 -3
  43. package/dist/index.html +2 -2
  44. package/package.json +7 -3
  45. package/dist/assets/arc-CvECY7sY-CCUjLJq2.js +0 -1
  46. package/dist/assets/channel-6PI3wNcc-BxckuQvX.js +0 -1
  47. package/dist/assets/classDiagram-beda092f-B8axaKGu-Cu_ZIJ6u.js +0 -2
  48. package/dist/assets/classDiagram-v2-2358418a-DPdf2DxR-BZsTNggP.js +0 -2
  49. package/dist/assets/clone-D01vUIhD-DmY5mrln.js +0 -1
  50. package/dist/assets/edges-96097737-Zc6U9nQz-BzB5ko4h.js +0 -4
  51. package/dist/assets/flowDiagram-v2-4f6560a1-BRIhxQ3y-DOhW7LIb.js +0 -1
  52. package/dist/assets/index-CITIGg-2.css +0 -1
  53. package/dist/assets/index-CVRNWcf-.js +0 -1006
  54. package/dist/assets/stateDiagram-v2-c2b004d7-Bp8rRkv2-9nDDCxFS.js +0 -1
@@ -1,9 +1,9 @@
1
- import{D as Ee,R as we,I as Zt,S as at,L as ve,M as _e,N as ke,F as Pt,O as K,T as Gt,J as Pe,P as Le,p as v,G as It,j as Ie,u as C,am as Et,an as nt,ad as te,ao as Me,g as ee,ak as Ct}from"./index-CVRNWcf-.js";import{x as Ne,g as qt,l as Ae,p as Mt,y as Oe,h as Se}from"./svgDrawCommon-b86b1483-sbEe2n2v-CFwc1_jc.js";var Yt=function(){var t=function(st,T,_,f){for(_=_||{},f=st.length;f--;_[st[f]]=T);return _},e=[1,2],c=[1,3],a=[1,4],i=[2,4],s=[1,9],l=[1,11],n=[1,13],h=[1,14],r=[1,16],u=[1,17],b=[1,18],g=[1,24],y=[1,25],w=[1,26],k=[1,27],L=[1,28],R=[1,29],N=[1,30],$=[1,31],O=[1,32],F=[1,33],q=[1,34],X=[1,35],G=[1,36],W=[1,37],z=[1,38],B=[1,39],V=[1,41],J=[1,42],H=[1,43],Q=[1,44],tt=[1,45],M=[1,46],m=[1,4,5,13,14,16,18,21,23,29,30,31,33,35,36,37,38,39,41,43,44,46,47,48,49,50,52,53,54,59,60,61,62,70],P=[4,5,16,50,52,53],Z=[4,5,13,14,16,18,21,23,29,30,31,33,35,36,37,38,39,41,43,44,46,50,52,53,54,59,60,61,62,70],rt=[4,5,13,14,16,18,21,23,29,30,31,33,35,36,37,38,39,41,43,44,46,49,50,52,53,54,59,60,61,62,70],I=[4,5,13,14,16,18,21,23,29,30,31,33,35,36,37,38,39,41,43,44,46,48,50,52,53,54,59,60,61,62,70],Ut=[4,5,13,14,16,18,21,23,29,30,31,33,35,36,37,38,39,41,43,44,46,47,50,52,53,54,59,60,61,62,70],pt=[68,69,70],ct=[1,120],At={trace:function(){},yy:{},symbols_:{error:2,start:3,SPACE:4,NEWLINE:5,SD:6,document:7,line:8,statement:9,box_section:10,box_line:11,participant_statement:12,create:13,box:14,restOfLine:15,end:16,signal:17,autonumber:18,NUM:19,off:20,activate:21,actor:22,deactivate:23,note_statement:24,links_statement:25,link_statement:26,properties_statement:27,details_statement:28,title:29,legacy_title:30,acc_title:31,acc_title_value:32,acc_descr:33,acc_descr_value:34,acc_descr_multiline_value:35,loop:36,rect:37,opt:38,alt:39,else_sections:40,par:41,par_sections:42,par_over:43,critical:44,option_sections:45,break:46,option:47,and:48,else:49,participant:50,AS:51,participant_actor:52,destroy:53,note:54,placement:55,text2:56,over:57,actor_pair:58,links:59,link:60,properties:61,details:62,spaceList:63,",":64,left_of:65,right_of:66,signaltype:67,"+":68,"-":69,ACTOR:70,SOLID_OPEN_ARROW:71,DOTTED_OPEN_ARROW:72,SOLID_ARROW:73,DOTTED_ARROW:74,SOLID_CROSS:75,DOTTED_CROSS:76,SOLID_POINT:77,DOTTED_POINT:78,TXT:79,$accept:0,$end:1},terminals_:{2:"error",4:"SPACE",5:"NEWLINE",6:"SD",13:"create",14:"box",15:"restOfLine",16:"end",18:"autonumber",19:"NUM",20:"off",21:"activate",23:"deactivate",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",41:"par",43:"par_over",44:"critical",46:"break",47:"option",48:"and",49:"else",50:"participant",51:"AS",52:"participant_actor",53:"destroy",54:"note",57:"over",59:"links",60:"link",61:"properties",62:"details",64:",",65:"left_of",66:"right_of",68:"+",69:"-",70:"ACTOR",71:"SOLID_OPEN_ARROW",72:"DOTTED_OPEN_ARROW",73:"SOLID_ARROW",74:"DOTTED_ARROW",75:"SOLID_CROSS",76:"DOTTED_CROSS",77:"SOLID_POINT",78:"DOTTED_POINT",79:"TXT"},productions_:[0,[3,2],[3,2],[3,2],[7,0],[7,2],[8,2],[8,1],[8,1],[10,0],[10,2],[11,2],[11,1],[11,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],[45,1],[45,4],[42,1],[42,4],[40,1],[40,4],[12,5],[12,3],[12,5],[12,3],[12,3],[24,4],[24,4],[25,3],[26,3],[27,3],[28,3],[63,2],[63,1],[58,3],[58,1],[55,1],[55,1],[17,5],[17,5],[17,4],[22,1],[67,1],[67,1],[67,1],[67,1],[67,1],[67,1],[67,1],[67,1],[56,1]],performAction:function(st,T,_,f,A,d,U){var p=d.length-1;switch(A){case 3:return f.apply(d[p]),d[p];case 4:case 9:this.$=[];break;case 5:case 10:d[p-1].push(d[p]),this.$=d[p-1];break;case 6:case 7:case 11:case 12:this.$=d[p];break;case 8:case 13:this.$=[];break;case 15:d[p].type="createParticipant",this.$=d[p];break;case 16:d[p-1].unshift({type:"boxStart",boxData:f.parseBoxData(d[p-2])}),d[p-1].push({type:"boxEnd",boxText:d[p-2]}),this.$=d[p-1];break;case 18:this.$={type:"sequenceIndex",sequenceIndex:Number(d[p-2]),sequenceIndexStep:Number(d[p-1]),sequenceVisible:!0,signalType:f.LINETYPE.AUTONUMBER};break;case 19:this.$={type:"sequenceIndex",sequenceIndex:Number(d[p-1]),sequenceIndexStep:1,sequenceVisible:!0,signalType:f.LINETYPE.AUTONUMBER};break;case 20:this.$={type:"sequenceIndex",sequenceVisible:!1,signalType:f.LINETYPE.AUTONUMBER};break;case 21:this.$={type:"sequenceIndex",sequenceVisible:!0,signalType:f.LINETYPE.AUTONUMBER};break;case 22:this.$={type:"activeStart",signalType:f.LINETYPE.ACTIVE_START,actor:d[p-1]};break;case 23:this.$={type:"activeEnd",signalType:f.LINETYPE.ACTIVE_END,actor:d[p-1]};break;case 29:f.setDiagramTitle(d[p].substring(6)),this.$=d[p].substring(6);break;case 30:f.setDiagramTitle(d[p].substring(7)),this.$=d[p].substring(7);break;case 31:this.$=d[p].trim(),f.setAccTitle(this.$);break;case 32:case 33:this.$=d[p].trim(),f.setAccDescription(this.$);break;case 34:d[p-1].unshift({type:"loopStart",loopText:f.parseMessage(d[p-2]),signalType:f.LINETYPE.LOOP_START}),d[p-1].push({type:"loopEnd",loopText:d[p-2],signalType:f.LINETYPE.LOOP_END}),this.$=d[p-1];break;case 35:d[p-1].unshift({type:"rectStart",color:f.parseMessage(d[p-2]),signalType:f.LINETYPE.RECT_START}),d[p-1].push({type:"rectEnd",color:f.parseMessage(d[p-2]),signalType:f.LINETYPE.RECT_END}),this.$=d[p-1];break;case 36:d[p-1].unshift({type:"optStart",optText:f.parseMessage(d[p-2]),signalType:f.LINETYPE.OPT_START}),d[p-1].push({type:"optEnd",optText:f.parseMessage(d[p-2]),signalType:f.LINETYPE.OPT_END}),this.$=d[p-1];break;case 37:d[p-1].unshift({type:"altStart",altText:f.parseMessage(d[p-2]),signalType:f.LINETYPE.ALT_START}),d[p-1].push({type:"altEnd",signalType:f.LINETYPE.ALT_END}),this.$=d[p-1];break;case 38:d[p-1].unshift({type:"parStart",parText:f.parseMessage(d[p-2]),signalType:f.LINETYPE.PAR_START}),d[p-1].push({type:"parEnd",signalType:f.LINETYPE.PAR_END}),this.$=d[p-1];break;case 39:d[p-1].unshift({type:"parStart",parText:f.parseMessage(d[p-2]),signalType:f.LINETYPE.PAR_OVER_START}),d[p-1].push({type:"parEnd",signalType:f.LINETYPE.PAR_END}),this.$=d[p-1];break;case 40:d[p-1].unshift({type:"criticalStart",criticalText:f.parseMessage(d[p-2]),signalType:f.LINETYPE.CRITICAL_START}),d[p-1].push({type:"criticalEnd",signalType:f.LINETYPE.CRITICAL_END}),this.$=d[p-1];break;case 41:d[p-1].unshift({type:"breakStart",breakText:f.parseMessage(d[p-2]),signalType:f.LINETYPE.BREAK_START}),d[p-1].push({type:"breakEnd",optText:f.parseMessage(d[p-2]),signalType:f.LINETYPE.BREAK_END}),this.$=d[p-1];break;case 43:this.$=d[p-3].concat([{type:"option",optionText:f.parseMessage(d[p-1]),signalType:f.LINETYPE.CRITICAL_OPTION},d[p]]);break;case 45:this.$=d[p-3].concat([{type:"and",parText:f.parseMessage(d[p-1]),signalType:f.LINETYPE.PAR_AND},d[p]]);break;case 47:this.$=d[p-3].concat([{type:"else",altText:f.parseMessage(d[p-1]),signalType:f.LINETYPE.ALT_ELSE},d[p]]);break;case 48:d[p-3].draw="participant",d[p-3].type="addParticipant",d[p-3].description=f.parseMessage(d[p-1]),this.$=d[p-3];break;case 49:d[p-1].draw="participant",d[p-1].type="addParticipant",this.$=d[p-1];break;case 50:d[p-3].draw="actor",d[p-3].type="addParticipant",d[p-3].description=f.parseMessage(d[p-1]),this.$=d[p-3];break;case 51:d[p-1].draw="actor",d[p-1].type="addParticipant",this.$=d[p-1];break;case 52:d[p-1].type="destroyParticipant",this.$=d[p-1];break;case 53:this.$=[d[p-1],{type:"addNote",placement:d[p-2],actor:d[p-1].actor,text:d[p]}];break;case 54:d[p-2]=[].concat(d[p-1],d[p-1]).slice(0,2),d[p-2][0]=d[p-2][0].actor,d[p-2][1]=d[p-2][1].actor,this.$=[d[p-1],{type:"addNote",placement:f.PLACEMENT.OVER,actor:d[p-2].slice(0,2),text:d[p]}];break;case 55:this.$=[d[p-1],{type:"addLinks",actor:d[p-1].actor,text:d[p]}];break;case 56:this.$=[d[p-1],{type:"addALink",actor:d[p-1].actor,text:d[p]}];break;case 57:this.$=[d[p-1],{type:"addProperties",actor:d[p-1].actor,text:d[p]}];break;case 58:this.$=[d[p-1],{type:"addDetails",actor:d[p-1].actor,text:d[p]}];break;case 61:this.$=[d[p-2],d[p]];break;case 62:this.$=d[p];break;case 63:this.$=f.PLACEMENT.LEFTOF;break;case 64:this.$=f.PLACEMENT.RIGHTOF;break;case 65:this.$=[d[p-4],d[p-1],{type:"addMessage",from:d[p-4].actor,to:d[p-1].actor,signalType:d[p-3],msg:d[p],activate:!0},{type:"activeStart",signalType:f.LINETYPE.ACTIVE_START,actor:d[p-1]}];break;case 66:this.$=[d[p-4],d[p-1],{type:"addMessage",from:d[p-4].actor,to:d[p-1].actor,signalType:d[p-3],msg:d[p]},{type:"activeEnd",signalType:f.LINETYPE.ACTIVE_END,actor:d[p-4]}];break;case 67:this.$=[d[p-3],d[p-1],{type:"addMessage",from:d[p-3].actor,to:d[p-1].actor,signalType:d[p-2],msg:d[p]}];break;case 68:this.$={type:"addParticipant",actor:d[p]};break;case 69:this.$=f.LINETYPE.SOLID_OPEN;break;case 70:this.$=f.LINETYPE.DOTTED_OPEN;break;case 71:this.$=f.LINETYPE.SOLID;break;case 72:this.$=f.LINETYPE.DOTTED;break;case 73:this.$=f.LINETYPE.SOLID_CROSS;break;case 74:this.$=f.LINETYPE.DOTTED_CROSS;break;case 75:this.$=f.LINETYPE.SOLID_POINT;break;case 76:this.$=f.LINETYPE.DOTTED_POINT;break;case 77:this.$=f.parseMessage(d[p].trim().substring(1));break}},table:[{3:1,4:e,5:c,6:a},{1:[3]},{3:5,4:e,5:c,6:a},{3:6,4:e,5:c,6:a},t([1,4,5,13,14,18,21,23,29,30,31,33,35,36,37,38,39,41,43,44,46,50,52,53,54,59,60,61,62,70],i,{7:7}),{1:[2,1]},{1:[2,2]},{1:[2,3],4:s,5:l,8:8,9:10,12:12,13:n,14:h,17:15,18:r,21:u,22:40,23:b,24:19,25:20,26:21,27:22,28:23,29:g,30:y,31:w,33:k,35:L,36:R,37:N,38:$,39:O,41:F,43:q,44:X,46:G,50:W,52:z,53:B,54:V,59:J,60:H,61:Q,62:tt,70:M},t(m,[2,5]),{9:47,12:12,13:n,14:h,17:15,18:r,21:u,22:40,23:b,24:19,25:20,26:21,27:22,28:23,29:g,30:y,31:w,33:k,35:L,36:R,37:N,38:$,39:O,41:F,43:q,44:X,46:G,50:W,52:z,53:B,54:V,59:J,60:H,61:Q,62:tt,70:M},t(m,[2,7]),t(m,[2,8]),t(m,[2,14]),{12:48,50:W,52:z,53:B},{15:[1,49]},{5:[1,50]},{5:[1,53],19:[1,51],20:[1,52]},{22:54,70:M},{22:55,70:M},{5:[1,56]},{5:[1,57]},{5:[1,58]},{5:[1,59]},{5:[1,60]},t(m,[2,29]),t(m,[2,30]),{32:[1,61]},{34:[1,62]},t(m,[2,33]),{15:[1,63]},{15:[1,64]},{15:[1,65]},{15:[1,66]},{15:[1,67]},{15:[1,68]},{15:[1,69]},{15:[1,70]},{22:71,70:M},{22:72,70:M},{22:73,70:M},{67:74,71:[1,75],72:[1,76],73:[1,77],74:[1,78],75:[1,79],76:[1,80],77:[1,81],78:[1,82]},{55:83,57:[1,84],65:[1,85],66:[1,86]},{22:87,70:M},{22:88,70:M},{22:89,70:M},{22:90,70:M},t([5,51,64,71,72,73,74,75,76,77,78,79],[2,68]),t(m,[2,6]),t(m,[2,15]),t(P,[2,9],{10:91}),t(m,[2,17]),{5:[1,93],19:[1,92]},{5:[1,94]},t(m,[2,21]),{5:[1,95]},{5:[1,96]},t(m,[2,24]),t(m,[2,25]),t(m,[2,26]),t(m,[2,27]),t(m,[2,28]),t(m,[2,31]),t(m,[2,32]),t(Z,i,{7:97}),t(Z,i,{7:98}),t(Z,i,{7:99}),t(rt,i,{40:100,7:101}),t(I,i,{42:102,7:103}),t(I,i,{7:103,42:104}),t(Ut,i,{45:105,7:106}),t(Z,i,{7:107}),{5:[1,109],51:[1,108]},{5:[1,111],51:[1,110]},{5:[1,112]},{22:115,68:[1,113],69:[1,114],70:M},t(pt,[2,69]),t(pt,[2,70]),t(pt,[2,71]),t(pt,[2,72]),t(pt,[2,73]),t(pt,[2,74]),t(pt,[2,75]),t(pt,[2,76]),{22:116,70:M},{22:118,58:117,70:M},{70:[2,63]},{70:[2,64]},{56:119,79:ct},{56:121,79:ct},{56:122,79:ct},{56:123,79:ct},{4:[1,126],5:[1,128],11:125,12:127,16:[1,124],50:W,52:z,53:B},{5:[1,129]},t(m,[2,19]),t(m,[2,20]),t(m,[2,22]),t(m,[2,23]),{4:s,5:l,8:8,9:10,12:12,13:n,14:h,16:[1,130],17:15,18:r,21:u,22:40,23:b,24:19,25:20,26:21,27:22,28:23,29:g,30:y,31:w,33:k,35:L,36:R,37:N,38:$,39:O,41:F,43:q,44:X,46:G,50:W,52:z,53:B,54:V,59:J,60:H,61:Q,62:tt,70:M},{4:s,5:l,8:8,9:10,12:12,13:n,14:h,16:[1,131],17:15,18:r,21:u,22:40,23:b,24:19,25:20,26:21,27:22,28:23,29:g,30:y,31:w,33:k,35:L,36:R,37:N,38:$,39:O,41:F,43:q,44:X,46:G,50:W,52:z,53:B,54:V,59:J,60:H,61:Q,62:tt,70:M},{4:s,5:l,8:8,9:10,12:12,13:n,14:h,16:[1,132],17:15,18:r,21:u,22:40,23:b,24:19,25:20,26:21,27:22,28:23,29:g,30:y,31:w,33:k,35:L,36:R,37:N,38:$,39:O,41:F,43:q,44:X,46:G,50:W,52:z,53:B,54:V,59:J,60:H,61:Q,62:tt,70:M},{16:[1,133]},{4:s,5:l,8:8,9:10,12:12,13:n,14:h,16:[2,46],17:15,18:r,21:u,22:40,23:b,24:19,25:20,26:21,27:22,28:23,29:g,30:y,31:w,33:k,35:L,36:R,37:N,38:$,39:O,41:F,43:q,44:X,46:G,49:[1,134],50:W,52:z,53:B,54:V,59:J,60:H,61:Q,62:tt,70:M},{16:[1,135]},{4:s,5:l,8:8,9:10,12:12,13:n,14:h,16:[2,44],17:15,18:r,21:u,22:40,23:b,24:19,25:20,26:21,27:22,28:23,29:g,30:y,31:w,33:k,35:L,36:R,37:N,38:$,39:O,41:F,43:q,44:X,46:G,48:[1,136],50:W,52:z,53:B,54:V,59:J,60:H,61:Q,62:tt,70:M},{16:[1,137]},{16:[1,138]},{4:s,5:l,8:8,9:10,12:12,13:n,14:h,16:[2,42],17:15,18:r,21:u,22:40,23:b,24:19,25:20,26:21,27:22,28:23,29:g,30:y,31:w,33:k,35:L,36:R,37:N,38:$,39:O,41:F,43:q,44:X,46:G,47:[1,139],50:W,52:z,53:B,54:V,59:J,60:H,61:Q,62:tt,70:M},{4:s,5:l,8:8,9:10,12:12,13:n,14:h,16:[1,140],17:15,18:r,21:u,22:40,23:b,24:19,25:20,26:21,27:22,28:23,29:g,30:y,31:w,33:k,35:L,36:R,37:N,38:$,39:O,41:F,43:q,44:X,46:G,50:W,52:z,53:B,54:V,59:J,60:H,61:Q,62:tt,70:M},{15:[1,141]},t(m,[2,49]),{15:[1,142]},t(m,[2,51]),t(m,[2,52]),{22:143,70:M},{22:144,70:M},{56:145,79:ct},{56:146,79:ct},{56:147,79:ct},{64:[1,148],79:[2,62]},{5:[2,55]},{5:[2,77]},{5:[2,56]},{5:[2,57]},{5:[2,58]},t(m,[2,16]),t(P,[2,10]),{12:149,50:W,52:z,53:B},t(P,[2,12]),t(P,[2,13]),t(m,[2,18]),t(m,[2,34]),t(m,[2,35]),t(m,[2,36]),t(m,[2,37]),{15:[1,150]},t(m,[2,38]),{15:[1,151]},t(m,[2,39]),t(m,[2,40]),{15:[1,152]},t(m,[2,41]),{5:[1,153]},{5:[1,154]},{56:155,79:ct},{56:156,79:ct},{5:[2,67]},{5:[2,53]},{5:[2,54]},{22:157,70:M},t(P,[2,11]),t(rt,i,{7:101,40:158}),t(I,i,{7:103,42:159}),t(Ut,i,{7:106,45:160}),t(m,[2,48]),t(m,[2,50]),{5:[2,65]},{5:[2,66]},{79:[2,61]},{16:[2,47]},{16:[2,45]},{16:[2,43]}],defaultActions:{5:[2,1],6:[2,2],85:[2,63],86:[2,64],119:[2,55],120:[2,77],121:[2,56],122:[2,57],123:[2,58],145:[2,67],146:[2,53],147:[2,54],155:[2,65],156:[2,66],157:[2,61],158:[2,47],159:[2,45],160:[2,43]},parseError:function(st,T){if(T.recoverable)this.trace(st);else{var _=new Error(st);throw _.hash=T,_}},parse:function(st){var T=this,_=[0],f=[],A=[null],d=[],U=this.table,p="",vt=0,jt=0,me=2,Kt=1,fe=d.slice.call(arguments,1),Y=Object.create(this.lexer),ht={yy:{}};for(var St in this.yy)Object.prototype.hasOwnProperty.call(this.yy,St)&&(ht.yy[St]=this.yy[St]);Y.setInput(st,ht.yy),ht.yy.lexer=Y,ht.yy.parser=this,typeof Y.yylloc>"u"&&(Y.yylloc={});var Dt=Y.yylloc;d.push(Dt);var be=Y.options&&Y.options.ranges;typeof ht.yy.parseError=="function"?this.parseError=ht.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Te(){var dt;return dt=f.pop()||Y.lex()||Kt,typeof dt!="number"&&(dt instanceof Array&&(f=dt,dt=f.pop()),dt=T.symbols_[dt]||dt),dt}for(var j,gt,et,Rt,mt={},_t,lt,Xt,kt;;){if(gt=_[_.length-1],this.defaultActions[gt]?et=this.defaultActions[gt]:((j===null||typeof j>"u")&&(j=Te()),et=U[gt]&&U[gt][j]),typeof et>"u"||!et.length||!et[0]){var $t="";kt=[];for(_t in U[gt])this.terminals_[_t]&&_t>me&&kt.push("'"+this.terminals_[_t]+"'");Y.showPosition?$t="Parse error on line "+(vt+1)+`:
1
+ import{L as Ee,D as we,N as Zt,E as at,M as ve,j as _e,R as Pe,F as kt,O as K,T as Gt,Q as ke,P as Le,m as v,W as It,I as Ie,f as $,am as Et,an as nt,ad as te,ao as Me,c as ee,ak as $t}from"./index-BaIhc-dj.js";import{x as Ne,g as Wt,l as Ae,p as Mt,y as Oe,h as Se}from"./svgDrawCommon-b86b1483-CXPkN8HW-DH97F0YX.js";var Yt=function(){var t=function(st,T,_,f){for(_=_||{},f=st.length;f--;_[st[f]]=T);return _},e=[1,2],c=[1,3],a=[1,4],i=[2,4],s=[1,9],l=[1,11],n=[1,13],h=[1,14],r=[1,16],u=[1,17],b=[1,18],g=[1,24],y=[1,25],w=[1,26],P=[1,27],L=[1,28],R=[1,29],N=[1,30],C=[1,31],O=[1,32],F=[1,33],W=[1,34],X=[1,35],G=[1,36],q=[1,37],z=[1,38],B=[1,39],V=[1,41],J=[1,42],H=[1,43],Q=[1,44],tt=[1,45],M=[1,46],m=[1,4,5,13,14,16,18,21,23,29,30,31,33,35,36,37,38,39,41,43,44,46,47,48,49,50,52,53,54,59,60,61,62,70],k=[4,5,16,50,52,53],Z=[4,5,13,14,16,18,21,23,29,30,31,33,35,36,37,38,39,41,43,44,46,50,52,53,54,59,60,61,62,70],rt=[4,5,13,14,16,18,21,23,29,30,31,33,35,36,37,38,39,41,43,44,46,49,50,52,53,54,59,60,61,62,70],I=[4,5,13,14,16,18,21,23,29,30,31,33,35,36,37,38,39,41,43,44,46,48,50,52,53,54,59,60,61,62,70],Ut=[4,5,13,14,16,18,21,23,29,30,31,33,35,36,37,38,39,41,43,44,46,47,50,52,53,54,59,60,61,62,70],pt=[68,69,70],ct=[1,120],At={trace:function(){},yy:{},symbols_:{error:2,start:3,SPACE:4,NEWLINE:5,SD:6,document:7,line:8,statement:9,box_section:10,box_line:11,participant_statement:12,create:13,box:14,restOfLine:15,end:16,signal:17,autonumber:18,NUM:19,off:20,activate:21,actor:22,deactivate:23,note_statement:24,links_statement:25,link_statement:26,properties_statement:27,details_statement:28,title:29,legacy_title:30,acc_title:31,acc_title_value:32,acc_descr:33,acc_descr_value:34,acc_descr_multiline_value:35,loop:36,rect:37,opt:38,alt:39,else_sections:40,par:41,par_sections:42,par_over:43,critical:44,option_sections:45,break:46,option:47,and:48,else:49,participant:50,AS:51,participant_actor:52,destroy:53,note:54,placement:55,text2:56,over:57,actor_pair:58,links:59,link:60,properties:61,details:62,spaceList:63,",":64,left_of:65,right_of:66,signaltype:67,"+":68,"-":69,ACTOR:70,SOLID_OPEN_ARROW:71,DOTTED_OPEN_ARROW:72,SOLID_ARROW:73,DOTTED_ARROW:74,SOLID_CROSS:75,DOTTED_CROSS:76,SOLID_POINT:77,DOTTED_POINT:78,TXT:79,$accept:0,$end:1},terminals_:{2:"error",4:"SPACE",5:"NEWLINE",6:"SD",13:"create",14:"box",15:"restOfLine",16:"end",18:"autonumber",19:"NUM",20:"off",21:"activate",23:"deactivate",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",41:"par",43:"par_over",44:"critical",46:"break",47:"option",48:"and",49:"else",50:"participant",51:"AS",52:"participant_actor",53:"destroy",54:"note",57:"over",59:"links",60:"link",61:"properties",62:"details",64:",",65:"left_of",66:"right_of",68:"+",69:"-",70:"ACTOR",71:"SOLID_OPEN_ARROW",72:"DOTTED_OPEN_ARROW",73:"SOLID_ARROW",74:"DOTTED_ARROW",75:"SOLID_CROSS",76:"DOTTED_CROSS",77:"SOLID_POINT",78:"DOTTED_POINT",79:"TXT"},productions_:[0,[3,2],[3,2],[3,2],[7,0],[7,2],[8,2],[8,1],[8,1],[10,0],[10,2],[11,2],[11,1],[11,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],[45,1],[45,4],[42,1],[42,4],[40,1],[40,4],[12,5],[12,3],[12,5],[12,3],[12,3],[24,4],[24,4],[25,3],[26,3],[27,3],[28,3],[63,2],[63,1],[58,3],[58,1],[55,1],[55,1],[17,5],[17,5],[17,4],[22,1],[67,1],[67,1],[67,1],[67,1],[67,1],[67,1],[67,1],[67,1],[56,1]],performAction:function(st,T,_,f,A,d,U){var p=d.length-1;switch(A){case 3:return f.apply(d[p]),d[p];case 4:case 9:this.$=[];break;case 5:case 10:d[p-1].push(d[p]),this.$=d[p-1];break;case 6:case 7:case 11:case 12:this.$=d[p];break;case 8:case 13:this.$=[];break;case 15:d[p].type="createParticipant",this.$=d[p];break;case 16:d[p-1].unshift({type:"boxStart",boxData:f.parseBoxData(d[p-2])}),d[p-1].push({type:"boxEnd",boxText:d[p-2]}),this.$=d[p-1];break;case 18:this.$={type:"sequenceIndex",sequenceIndex:Number(d[p-2]),sequenceIndexStep:Number(d[p-1]),sequenceVisible:!0,signalType:f.LINETYPE.AUTONUMBER};break;case 19:this.$={type:"sequenceIndex",sequenceIndex:Number(d[p-1]),sequenceIndexStep:1,sequenceVisible:!0,signalType:f.LINETYPE.AUTONUMBER};break;case 20:this.$={type:"sequenceIndex",sequenceVisible:!1,signalType:f.LINETYPE.AUTONUMBER};break;case 21:this.$={type:"sequenceIndex",sequenceVisible:!0,signalType:f.LINETYPE.AUTONUMBER};break;case 22:this.$={type:"activeStart",signalType:f.LINETYPE.ACTIVE_START,actor:d[p-1]};break;case 23:this.$={type:"activeEnd",signalType:f.LINETYPE.ACTIVE_END,actor:d[p-1]};break;case 29:f.setDiagramTitle(d[p].substring(6)),this.$=d[p].substring(6);break;case 30:f.setDiagramTitle(d[p].substring(7)),this.$=d[p].substring(7);break;case 31:this.$=d[p].trim(),f.setAccTitle(this.$);break;case 32:case 33:this.$=d[p].trim(),f.setAccDescription(this.$);break;case 34:d[p-1].unshift({type:"loopStart",loopText:f.parseMessage(d[p-2]),signalType:f.LINETYPE.LOOP_START}),d[p-1].push({type:"loopEnd",loopText:d[p-2],signalType:f.LINETYPE.LOOP_END}),this.$=d[p-1];break;case 35:d[p-1].unshift({type:"rectStart",color:f.parseMessage(d[p-2]),signalType:f.LINETYPE.RECT_START}),d[p-1].push({type:"rectEnd",color:f.parseMessage(d[p-2]),signalType:f.LINETYPE.RECT_END}),this.$=d[p-1];break;case 36:d[p-1].unshift({type:"optStart",optText:f.parseMessage(d[p-2]),signalType:f.LINETYPE.OPT_START}),d[p-1].push({type:"optEnd",optText:f.parseMessage(d[p-2]),signalType:f.LINETYPE.OPT_END}),this.$=d[p-1];break;case 37:d[p-1].unshift({type:"altStart",altText:f.parseMessage(d[p-2]),signalType:f.LINETYPE.ALT_START}),d[p-1].push({type:"altEnd",signalType:f.LINETYPE.ALT_END}),this.$=d[p-1];break;case 38:d[p-1].unshift({type:"parStart",parText:f.parseMessage(d[p-2]),signalType:f.LINETYPE.PAR_START}),d[p-1].push({type:"parEnd",signalType:f.LINETYPE.PAR_END}),this.$=d[p-1];break;case 39:d[p-1].unshift({type:"parStart",parText:f.parseMessage(d[p-2]),signalType:f.LINETYPE.PAR_OVER_START}),d[p-1].push({type:"parEnd",signalType:f.LINETYPE.PAR_END}),this.$=d[p-1];break;case 40:d[p-1].unshift({type:"criticalStart",criticalText:f.parseMessage(d[p-2]),signalType:f.LINETYPE.CRITICAL_START}),d[p-1].push({type:"criticalEnd",signalType:f.LINETYPE.CRITICAL_END}),this.$=d[p-1];break;case 41:d[p-1].unshift({type:"breakStart",breakText:f.parseMessage(d[p-2]),signalType:f.LINETYPE.BREAK_START}),d[p-1].push({type:"breakEnd",optText:f.parseMessage(d[p-2]),signalType:f.LINETYPE.BREAK_END}),this.$=d[p-1];break;case 43:this.$=d[p-3].concat([{type:"option",optionText:f.parseMessage(d[p-1]),signalType:f.LINETYPE.CRITICAL_OPTION},d[p]]);break;case 45:this.$=d[p-3].concat([{type:"and",parText:f.parseMessage(d[p-1]),signalType:f.LINETYPE.PAR_AND},d[p]]);break;case 47:this.$=d[p-3].concat([{type:"else",altText:f.parseMessage(d[p-1]),signalType:f.LINETYPE.ALT_ELSE},d[p]]);break;case 48:d[p-3].draw="participant",d[p-3].type="addParticipant",d[p-3].description=f.parseMessage(d[p-1]),this.$=d[p-3];break;case 49:d[p-1].draw="participant",d[p-1].type="addParticipant",this.$=d[p-1];break;case 50:d[p-3].draw="actor",d[p-3].type="addParticipant",d[p-3].description=f.parseMessage(d[p-1]),this.$=d[p-3];break;case 51:d[p-1].draw="actor",d[p-1].type="addParticipant",this.$=d[p-1];break;case 52:d[p-1].type="destroyParticipant",this.$=d[p-1];break;case 53:this.$=[d[p-1],{type:"addNote",placement:d[p-2],actor:d[p-1].actor,text:d[p]}];break;case 54:d[p-2]=[].concat(d[p-1],d[p-1]).slice(0,2),d[p-2][0]=d[p-2][0].actor,d[p-2][1]=d[p-2][1].actor,this.$=[d[p-1],{type:"addNote",placement:f.PLACEMENT.OVER,actor:d[p-2].slice(0,2),text:d[p]}];break;case 55:this.$=[d[p-1],{type:"addLinks",actor:d[p-1].actor,text:d[p]}];break;case 56:this.$=[d[p-1],{type:"addALink",actor:d[p-1].actor,text:d[p]}];break;case 57:this.$=[d[p-1],{type:"addProperties",actor:d[p-1].actor,text:d[p]}];break;case 58:this.$=[d[p-1],{type:"addDetails",actor:d[p-1].actor,text:d[p]}];break;case 61:this.$=[d[p-2],d[p]];break;case 62:this.$=d[p];break;case 63:this.$=f.PLACEMENT.LEFTOF;break;case 64:this.$=f.PLACEMENT.RIGHTOF;break;case 65:this.$=[d[p-4],d[p-1],{type:"addMessage",from:d[p-4].actor,to:d[p-1].actor,signalType:d[p-3],msg:d[p],activate:!0},{type:"activeStart",signalType:f.LINETYPE.ACTIVE_START,actor:d[p-1]}];break;case 66:this.$=[d[p-4],d[p-1],{type:"addMessage",from:d[p-4].actor,to:d[p-1].actor,signalType:d[p-3],msg:d[p]},{type:"activeEnd",signalType:f.LINETYPE.ACTIVE_END,actor:d[p-4]}];break;case 67:this.$=[d[p-3],d[p-1],{type:"addMessage",from:d[p-3].actor,to:d[p-1].actor,signalType:d[p-2],msg:d[p]}];break;case 68:this.$={type:"addParticipant",actor:d[p]};break;case 69:this.$=f.LINETYPE.SOLID_OPEN;break;case 70:this.$=f.LINETYPE.DOTTED_OPEN;break;case 71:this.$=f.LINETYPE.SOLID;break;case 72:this.$=f.LINETYPE.DOTTED;break;case 73:this.$=f.LINETYPE.SOLID_CROSS;break;case 74:this.$=f.LINETYPE.DOTTED_CROSS;break;case 75:this.$=f.LINETYPE.SOLID_POINT;break;case 76:this.$=f.LINETYPE.DOTTED_POINT;break;case 77:this.$=f.parseMessage(d[p].trim().substring(1));break}},table:[{3:1,4:e,5:c,6:a},{1:[3]},{3:5,4:e,5:c,6:a},{3:6,4:e,5:c,6:a},t([1,4,5,13,14,18,21,23,29,30,31,33,35,36,37,38,39,41,43,44,46,50,52,53,54,59,60,61,62,70],i,{7:7}),{1:[2,1]},{1:[2,2]},{1:[2,3],4:s,5:l,8:8,9:10,12:12,13:n,14:h,17:15,18:r,21:u,22:40,23:b,24:19,25:20,26:21,27:22,28:23,29:g,30:y,31:w,33:P,35:L,36:R,37:N,38:C,39:O,41:F,43:W,44:X,46:G,50:q,52:z,53:B,54:V,59:J,60:H,61:Q,62:tt,70:M},t(m,[2,5]),{9:47,12:12,13:n,14:h,17:15,18:r,21:u,22:40,23:b,24:19,25:20,26:21,27:22,28:23,29:g,30:y,31:w,33:P,35:L,36:R,37:N,38:C,39:O,41:F,43:W,44:X,46:G,50:q,52:z,53:B,54:V,59:J,60:H,61:Q,62:tt,70:M},t(m,[2,7]),t(m,[2,8]),t(m,[2,14]),{12:48,50:q,52:z,53:B},{15:[1,49]},{5:[1,50]},{5:[1,53],19:[1,51],20:[1,52]},{22:54,70:M},{22:55,70:M},{5:[1,56]},{5:[1,57]},{5:[1,58]},{5:[1,59]},{5:[1,60]},t(m,[2,29]),t(m,[2,30]),{32:[1,61]},{34:[1,62]},t(m,[2,33]),{15:[1,63]},{15:[1,64]},{15:[1,65]},{15:[1,66]},{15:[1,67]},{15:[1,68]},{15:[1,69]},{15:[1,70]},{22:71,70:M},{22:72,70:M},{22:73,70:M},{67:74,71:[1,75],72:[1,76],73:[1,77],74:[1,78],75:[1,79],76:[1,80],77:[1,81],78:[1,82]},{55:83,57:[1,84],65:[1,85],66:[1,86]},{22:87,70:M},{22:88,70:M},{22:89,70:M},{22:90,70:M},t([5,51,64,71,72,73,74,75,76,77,78,79],[2,68]),t(m,[2,6]),t(m,[2,15]),t(k,[2,9],{10:91}),t(m,[2,17]),{5:[1,93],19:[1,92]},{5:[1,94]},t(m,[2,21]),{5:[1,95]},{5:[1,96]},t(m,[2,24]),t(m,[2,25]),t(m,[2,26]),t(m,[2,27]),t(m,[2,28]),t(m,[2,31]),t(m,[2,32]),t(Z,i,{7:97}),t(Z,i,{7:98}),t(Z,i,{7:99}),t(rt,i,{40:100,7:101}),t(I,i,{42:102,7:103}),t(I,i,{7:103,42:104}),t(Ut,i,{45:105,7:106}),t(Z,i,{7:107}),{5:[1,109],51:[1,108]},{5:[1,111],51:[1,110]},{5:[1,112]},{22:115,68:[1,113],69:[1,114],70:M},t(pt,[2,69]),t(pt,[2,70]),t(pt,[2,71]),t(pt,[2,72]),t(pt,[2,73]),t(pt,[2,74]),t(pt,[2,75]),t(pt,[2,76]),{22:116,70:M},{22:118,58:117,70:M},{70:[2,63]},{70:[2,64]},{56:119,79:ct},{56:121,79:ct},{56:122,79:ct},{56:123,79:ct},{4:[1,126],5:[1,128],11:125,12:127,16:[1,124],50:q,52:z,53:B},{5:[1,129]},t(m,[2,19]),t(m,[2,20]),t(m,[2,22]),t(m,[2,23]),{4:s,5:l,8:8,9:10,12:12,13:n,14:h,16:[1,130],17:15,18:r,21:u,22:40,23:b,24:19,25:20,26:21,27:22,28:23,29:g,30:y,31:w,33:P,35:L,36:R,37:N,38:C,39:O,41:F,43:W,44:X,46:G,50:q,52:z,53:B,54:V,59:J,60:H,61:Q,62:tt,70:M},{4:s,5:l,8:8,9:10,12:12,13:n,14:h,16:[1,131],17:15,18:r,21:u,22:40,23:b,24:19,25:20,26:21,27:22,28:23,29:g,30:y,31:w,33:P,35:L,36:R,37:N,38:C,39:O,41:F,43:W,44:X,46:G,50:q,52:z,53:B,54:V,59:J,60:H,61:Q,62:tt,70:M},{4:s,5:l,8:8,9:10,12:12,13:n,14:h,16:[1,132],17:15,18:r,21:u,22:40,23:b,24:19,25:20,26:21,27:22,28:23,29:g,30:y,31:w,33:P,35:L,36:R,37:N,38:C,39:O,41:F,43:W,44:X,46:G,50:q,52:z,53:B,54:V,59:J,60:H,61:Q,62:tt,70:M},{16:[1,133]},{4:s,5:l,8:8,9:10,12:12,13:n,14:h,16:[2,46],17:15,18:r,21:u,22:40,23:b,24:19,25:20,26:21,27:22,28:23,29:g,30:y,31:w,33:P,35:L,36:R,37:N,38:C,39:O,41:F,43:W,44:X,46:G,49:[1,134],50:q,52:z,53:B,54:V,59:J,60:H,61:Q,62:tt,70:M},{16:[1,135]},{4:s,5:l,8:8,9:10,12:12,13:n,14:h,16:[2,44],17:15,18:r,21:u,22:40,23:b,24:19,25:20,26:21,27:22,28:23,29:g,30:y,31:w,33:P,35:L,36:R,37:N,38:C,39:O,41:F,43:W,44:X,46:G,48:[1,136],50:q,52:z,53:B,54:V,59:J,60:H,61:Q,62:tt,70:M},{16:[1,137]},{16:[1,138]},{4:s,5:l,8:8,9:10,12:12,13:n,14:h,16:[2,42],17:15,18:r,21:u,22:40,23:b,24:19,25:20,26:21,27:22,28:23,29:g,30:y,31:w,33:P,35:L,36:R,37:N,38:C,39:O,41:F,43:W,44:X,46:G,47:[1,139],50:q,52:z,53:B,54:V,59:J,60:H,61:Q,62:tt,70:M},{4:s,5:l,8:8,9:10,12:12,13:n,14:h,16:[1,140],17:15,18:r,21:u,22:40,23:b,24:19,25:20,26:21,27:22,28:23,29:g,30:y,31:w,33:P,35:L,36:R,37:N,38:C,39:O,41:F,43:W,44:X,46:G,50:q,52:z,53:B,54:V,59:J,60:H,61:Q,62:tt,70:M},{15:[1,141]},t(m,[2,49]),{15:[1,142]},t(m,[2,51]),t(m,[2,52]),{22:143,70:M},{22:144,70:M},{56:145,79:ct},{56:146,79:ct},{56:147,79:ct},{64:[1,148],79:[2,62]},{5:[2,55]},{5:[2,77]},{5:[2,56]},{5:[2,57]},{5:[2,58]},t(m,[2,16]),t(k,[2,10]),{12:149,50:q,52:z,53:B},t(k,[2,12]),t(k,[2,13]),t(m,[2,18]),t(m,[2,34]),t(m,[2,35]),t(m,[2,36]),t(m,[2,37]),{15:[1,150]},t(m,[2,38]),{15:[1,151]},t(m,[2,39]),t(m,[2,40]),{15:[1,152]},t(m,[2,41]),{5:[1,153]},{5:[1,154]},{56:155,79:ct},{56:156,79:ct},{5:[2,67]},{5:[2,53]},{5:[2,54]},{22:157,70:M},t(k,[2,11]),t(rt,i,{7:101,40:158}),t(I,i,{7:103,42:159}),t(Ut,i,{7:106,45:160}),t(m,[2,48]),t(m,[2,50]),{5:[2,65]},{5:[2,66]},{79:[2,61]},{16:[2,47]},{16:[2,45]},{16:[2,43]}],defaultActions:{5:[2,1],6:[2,2],85:[2,63],86:[2,64],119:[2,55],120:[2,77],121:[2,56],122:[2,57],123:[2,58],145:[2,67],146:[2,53],147:[2,54],155:[2,65],156:[2,66],157:[2,61],158:[2,47],159:[2,45],160:[2,43]},parseError:function(st,T){if(T.recoverable)this.trace(st);else{var _=new Error(st);throw _.hash=T,_}},parse:function(st){var T=this,_=[0],f=[],A=[null],d=[],U=this.table,p="",vt=0,jt=0,me=2,Kt=1,fe=d.slice.call(arguments,1),Y=Object.create(this.lexer),ht={yy:{}};for(var St in this.yy)Object.prototype.hasOwnProperty.call(this.yy,St)&&(ht.yy[St]=this.yy[St]);Y.setInput(st,ht.yy),ht.yy.lexer=Y,ht.yy.parser=this,typeof Y.yylloc>"u"&&(Y.yylloc={});var Dt=Y.yylloc;d.push(Dt);var be=Y.options&&Y.options.ranges;typeof ht.yy.parseError=="function"?this.parseError=ht.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Te(){var dt;return dt=f.pop()||Y.lex()||Kt,typeof dt!="number"&&(dt instanceof Array&&(f=dt,dt=f.pop()),dt=T.symbols_[dt]||dt),dt}for(var j,gt,et,Rt,mt={},_t,lt,Xt,Pt;;){if(gt=_[_.length-1],this.defaultActions[gt]?et=this.defaultActions[gt]:((j===null||typeof j>"u")&&(j=Te()),et=U[gt]&&U[gt][j]),typeof et>"u"||!et.length||!et[0]){var Ct="";Pt=[];for(_t in U[gt])this.terminals_[_t]&&_t>me&&Pt.push("'"+this.terminals_[_t]+"'");Y.showPosition?Ct="Parse error on line "+(vt+1)+`:
2
2
  `+Y.showPosition()+`
3
- Expecting `+kt.join(", ")+", got '"+(this.terminals_[j]||j)+"'":$t="Parse error on line "+(vt+1)+": Unexpected "+(j==Kt?"end of input":"'"+(this.terminals_[j]||j)+"'"),this.parseError($t,{text:Y.match,token:this.terminals_[j]||j,line:Y.yylineno,loc:Dt,expected:kt})}if(et[0]instanceof Array&&et.length>1)throw new Error("Parse Error: multiple actions possible at state: "+gt+", token: "+j);switch(et[0]){case 1:_.push(j),A.push(Y.yytext),d.push(Y.yylloc),_.push(et[1]),j=null,jt=Y.yyleng,p=Y.yytext,vt=Y.yylineno,Dt=Y.yylloc;break;case 2:if(lt=this.productions_[et[1]][1],mt.$=A[A.length-lt],mt._$={first_line:d[d.length-(lt||1)].first_line,last_line:d[d.length-1].last_line,first_column:d[d.length-(lt||1)].first_column,last_column:d[d.length-1].last_column},be&&(mt._$.range=[d[d.length-(lt||1)].range[0],d[d.length-1].range[1]]),Rt=this.performAction.apply(mt,[p,jt,vt,ht.yy,et[1],A,d].concat(fe)),typeof Rt<"u")return Rt;lt&&(_=_.slice(0,-1*lt*2),A=A.slice(0,-1*lt),d=d.slice(0,-1*lt)),_.push(this.productions_[et[1]][0]),A.push(mt.$),d.push(mt._$),Xt=U[_[_.length-2]][_[_.length-1]],_.push(Xt);break;case 3:return!0}}return!0}},ye=function(){var st={EOF:1,parseError:function(T,_){if(this.yy.parser)this.yy.parser.parseError(T,_);else throw new Error(T)},setInput:function(T,_){return this.yy=_||this.yy||{},this._input=T,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var T=this._input[0];this.yytext+=T,this.yyleng++,this.offset++,this.match+=T,this.matched+=T;var _=T.match(/(?:\r\n?|\n).*/g);return _?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),T},unput:function(T){var _=T.length,f=T.split(/(?:\r\n?|\n)/g);this._input=T+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-_),this.offset-=_;var A=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),f.length-1&&(this.yylineno-=f.length-1);var d=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:f?(f.length===A.length?this.yylloc.first_column:0)+A[A.length-f.length].length-f[0].length:this.yylloc.first_column-_},this.options.ranges&&(this.yylloc.range=[d[0],d[0]+this.yyleng-_]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
3
+ Expecting `+Pt.join(", ")+", got '"+(this.terminals_[j]||j)+"'":Ct="Parse error on line "+(vt+1)+": Unexpected "+(j==Kt?"end of input":"'"+(this.terminals_[j]||j)+"'"),this.parseError(Ct,{text:Y.match,token:this.terminals_[j]||j,line:Y.yylineno,loc:Dt,expected:Pt})}if(et[0]instanceof Array&&et.length>1)throw new Error("Parse Error: multiple actions possible at state: "+gt+", token: "+j);switch(et[0]){case 1:_.push(j),A.push(Y.yytext),d.push(Y.yylloc),_.push(et[1]),j=null,jt=Y.yyleng,p=Y.yytext,vt=Y.yylineno,Dt=Y.yylloc;break;case 2:if(lt=this.productions_[et[1]][1],mt.$=A[A.length-lt],mt._$={first_line:d[d.length-(lt||1)].first_line,last_line:d[d.length-1].last_line,first_column:d[d.length-(lt||1)].first_column,last_column:d[d.length-1].last_column},be&&(mt._$.range=[d[d.length-(lt||1)].range[0],d[d.length-1].range[1]]),Rt=this.performAction.apply(mt,[p,jt,vt,ht.yy,et[1],A,d].concat(fe)),typeof Rt<"u")return Rt;lt&&(_=_.slice(0,-1*lt*2),A=A.slice(0,-1*lt),d=d.slice(0,-1*lt)),_.push(this.productions_[et[1]][0]),A.push(mt.$),d.push(mt._$),Xt=U[_[_.length-2]][_[_.length-1]],_.push(Xt);break;case 3:return!0}}return!0}},ye=function(){var st={EOF:1,parseError:function(T,_){if(this.yy.parser)this.yy.parser.parseError(T,_);else throw new Error(T)},setInput:function(T,_){return this.yy=_||this.yy||{},this._input=T,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var T=this._input[0];this.yytext+=T,this.yyleng++,this.offset++,this.match+=T,this.matched+=T;var _=T.match(/(?:\r\n?|\n).*/g);return _?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),T},unput:function(T){var _=T.length,f=T.split(/(?:\r\n?|\n)/g);this._input=T+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-_),this.offset-=_;var A=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),f.length-1&&(this.yylineno-=f.length-1);var d=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:f?(f.length===A.length?this.yylloc.first_column:0)+A[A.length-f.length].length-f[0].length:this.yylloc.first_column-_},this.options.ranges&&(this.yylloc.range=[d[0],d[0]+this.yyleng-_]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
4
4
  `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},less:function(T){this.unput(this.match.slice(T))},pastInput:function(){var T=this.matched.substr(0,this.matched.length-this.match.length);return(T.length>20?"...":"")+T.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var T=this.match;return T.length<20&&(T+=this._input.substr(0,20-T.length)),(T.substr(0,20)+(T.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var T=this.pastInput(),_=new Array(T.length+1).join("-");return T+this.upcomingInput()+`
5
5
  `+_+"^"},test_match:function(T,_){var f,A,d;if(this.options.backtrack_lexer&&(d={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&&(d.yylloc.range=this.yylloc.range.slice(0))),A=T[0].match(/(?:\r\n?|\n).*/g),A&&(this.yylineno+=A.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:A?A[A.length-1].length-A[A.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+T[0].length},this.yytext+=T[0],this.match+=T[0],this.matches=T,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(T[0].length),this.matched+=T[0],f=this.performAction.call(this,this.yy,this,_,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),f)return f;if(this._backtrack){for(var U in d)this[U]=d[U];return!1}return!1},next:function(){if(this.done)return this.EOF;this._input||(this.done=!0);var T,_,f,A;this._more||(this.yytext="",this.match="");for(var d=this._currentRules(),U=0;U<d.length;U++)if(f=this._input.match(this.rules[d[U]]),f&&(!_||f[0].length>_[0].length)){if(_=f,A=U,this.options.backtrack_lexer){if(T=this.test_match(f,d[U]),T!==!1)return T;if(this._backtrack){_=!1;continue}else return!1}else if(!this.options.flex)break}return _?(T=this.test_match(_,d[A]),T!==!1?T:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text.
6
- `+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var T=this.next();return T||this.lex()},begin:function(T){this.conditionStack.push(T)},popState:function(){var T=this.conditionStack.length-1;return T>0?this.conditionStack.pop():this.conditionStack[0]},_currentRules:function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},topState:function(T){return T=this.conditionStack.length-1-Math.abs(T||0),T>=0?this.conditionStack[T]:"INITIAL"},pushState:function(T){this.begin(T)},stateStackSize:function(){return this.conditionStack.length},options:{"case-insensitive":!0},performAction:function(T,_,f,A){switch(f){case 0:return 5;case 1:break;case 2:break;case 3:break;case 4:break;case 5:break;case 6:return 19;case 7:return this.begin("LINE"),14;case 8:return this.begin("ID"),50;case 9:return this.begin("ID"),52;case 10:return 13;case 11:return this.begin("ID"),53;case 12:return _.yytext=_.yytext.trim(),this.begin("ALIAS"),70;case 13:return this.popState(),this.popState(),this.begin("LINE"),51;case 14:return this.popState(),this.popState(),5;case 15:return this.begin("LINE"),36;case 16:return this.begin("LINE"),37;case 17:return this.begin("LINE"),38;case 18:return this.begin("LINE"),39;case 19:return this.begin("LINE"),49;case 20:return this.begin("LINE"),41;case 21:return this.begin("LINE"),43;case 22:return this.begin("LINE"),48;case 23:return this.begin("LINE"),44;case 24:return this.begin("LINE"),47;case 25:return this.begin("LINE"),46;case 26:return this.popState(),15;case 27:return 16;case 28:return 65;case 29:return 66;case 30:return 59;case 31:return 60;case 32:return 61;case 33:return 62;case 34:return 57;case 35:return 54;case 36:return this.begin("ID"),21;case 37:return this.begin("ID"),23;case 38:return 29;case 39:return 30;case 40:return this.begin("acc_title"),31;case 41:return this.popState(),"acc_title_value";case 42:return this.begin("acc_descr"),33;case 43:return this.popState(),"acc_descr_value";case 44:this.begin("acc_descr_multiline");break;case 45:this.popState();break;case 46:return"acc_descr_multiline_value";case 47:return 6;case 48:return 18;case 49:return 20;case 50:return 64;case 51:return 5;case 52:return _.yytext=_.yytext.trim(),70;case 53:return 73;case 54:return 74;case 55:return 71;case 56:return 72;case 57:return 75;case 58:return 76;case 59:return 77;case 60:return 78;case 61:return 79;case 62:return 68;case 63:return 69;case 64:return 5;case 65:return"INVALID"}},rules:[/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:((?!\n)\s)+)/i,/^(?:#[^\n]*)/i,/^(?:%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[0-9]+(?=[ \n]+))/i,/^(?:box\b)/i,/^(?:participant\b)/i,/^(?:actor\b)/i,/^(?:create\b)/i,/^(?:destroy\b)/i,/^(?:[^\->:\n,;]+?([\-]*[^\->:\n,;]+?)*?(?=((?!\n)\s)+as(?!\n)\s|[#\n;]|$))/i,/^(?:as\b)/i,/^(?:(?:))/i,/^(?:loop\b)/i,/^(?:rect\b)/i,/^(?:opt\b)/i,/^(?:alt\b)/i,/^(?:else\b)/i,/^(?:par\b)/i,/^(?:par_over\b)/i,/^(?:and\b)/i,/^(?:critical\b)/i,/^(?:option\b)/i,/^(?:break\b)/i,/^(?:(?:[:]?(?:no)?wrap)?[^#\n;]*)/i,/^(?:end\b)/i,/^(?:left of\b)/i,/^(?:right of\b)/i,/^(?:links\b)/i,/^(?:link\b)/i,/^(?:properties\b)/i,/^(?:details\b)/i,/^(?:over\b)/i,/^(?:note\b)/i,/^(?:activate\b)/i,/^(?:deactivate\b)/i,/^(?:title\s[^#\n;]+)/i,/^(?:title:\s[^#\n;]+)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:sequenceDiagram\b)/i,/^(?:autonumber\b)/i,/^(?:off\b)/i,/^(?:,)/i,/^(?:;)/i,/^(?:[^\+\->:\n,;]+((?!(-x|--x|-\)|--\)))[\-]*[^\+\->:\n,;]+)*)/i,/^(?:->>)/i,/^(?:-->>)/i,/^(?:->)/i,/^(?:-->)/i,/^(?:-[x])/i,/^(?:--[x])/i,/^(?:-[\)])/i,/^(?:--[\)])/i,/^(?::(?:(?:no)?wrap)?[^#\n;]+)/i,/^(?:\+)/i,/^(?:-)/i,/^(?:$)/i,/^(?:.)/i],conditions:{acc_descr_multiline:{rules:[45,46],inclusive:!1},acc_descr:{rules:[43],inclusive:!1},acc_title:{rules:[41],inclusive:!1},ID:{rules:[2,3,12],inclusive:!1},ALIAS:{rules:[2,3,13,14],inclusive:!1},LINE:{rules:[2,3,26],inclusive:!1},INITIAL:{rules:[0,1,3,4,5,6,7,8,9,10,11,15,16,17,18,19,20,21,22,23,24,25,27,28,29,30,31,32,33,34,35,36,37,38,39,40,42,44,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65],inclusive:!0}}};return st}();At.lexer=ye;function Ot(){this.yy={}}return Ot.prototype=At,At.Parser=Ot,new Ot}();Yt.parser=Yt;const De=Yt;class Re{constructor(e){this.init=e,this.records=this.init()}reset(){this.records=this.init()}}const E=new Re(()=>({prevActor:void 0,actors:{},createdActors:{},destroyedActors:{},boxes:[],messages:[],notes:[],sequenceNumbersEnabled:!1,wrapEnabled:void 0,currentBox:void 0,lastCreated:void 0,lastDestroyed:void 0})),$e=function(t){E.records.boxes.push({name:t.text,wrap:t.wrap===void 0&&xt()||!!t.wrap,fill:t.color,actorKeys:[]}),E.records.currentBox=E.records.boxes.slice(-1)[0]},Bt=function(t,e,c,a){let i=E.records.currentBox;const s=E.records.actors[t];if(s){if(E.records.currentBox&&s.box&&E.records.currentBox!==s.box)throw new Error("A same participant should only be defined in one Box: "+s.name+" can't be in '"+s.box.name+"' and in '"+E.records.currentBox.name+"' at the same time.");if(i=s.box?s.box:E.records.currentBox,s.box=i,s&&e===s.name&&c==null)return}(c==null||c.text==null)&&(c={text:e,wrap:null,type:a}),(a==null||c.text==null)&&(c={text:e,wrap:null,type:a}),E.records.actors[t]={box:i,name:e,description:c.text,wrap:c.wrap===void 0&&xt()||!!c.wrap,prevActor:E.records.prevActor,links:{},properties:{},actorCnt:null,rectData:null,type:a||"participant"},E.records.prevActor&&E.records.actors[E.records.prevActor]&&(E.records.actors[E.records.prevActor].nextActor=t),E.records.currentBox&&E.records.currentBox.actorKeys.push(t),E.records.prevActor=t},Ce=t=>{let e,c=0;for(e=0;e<E.records.messages.length;e++)E.records.messages[e].type===Tt.ACTIVE_START&&E.records.messages[e].from.actor===t&&c++,E.records.messages[e].type===Tt.ACTIVE_END&&E.records.messages[e].from.actor===t&&c--;return c},Ye=function(t,e,c,a){E.records.messages.push({from:t,to:e,message:c.text,wrap:c.wrap===void 0&&xt()||!!c.wrap,answer:a})},S=function(t,e,c={text:void 0,wrap:void 0},a,i=!1){if(a===Tt.ACTIVE_END&&Ce(t.actor)<1){let s=new Error("Trying to inactivate an inactive participant ("+t.actor+")");throw s.hash={text:"->>-",token:"->>-",line:"1",loc:{first_line:1,last_line:1,first_column:1,last_column:1},expected:["'ACTIVE_PARTICIPANT'"]},s}return E.records.messages.push({from:t,to:e,message:c.text,wrap:c.wrap===void 0&&xt()||!!c.wrap,type:a,activate:i}),!0},Be=function(){return E.records.boxes.length>0},Ve=function(){return E.records.boxes.some(t=>t.name)},Fe=function(){return E.records.messages},qe=function(){return E.records.boxes},We=function(){return E.records.actors},ze=function(){return E.records.createdActors},He=function(){return E.records.destroyedActors},wt=function(t){return E.records.actors[t]},Ue=function(){return Object.keys(E.records.actors)},je=function(){E.records.sequenceNumbersEnabled=!0},Ke=function(){E.records.sequenceNumbersEnabled=!1},Xe=()=>E.records.sequenceNumbersEnabled,Je=function(t){E.records.wrapEnabled=t},xt=()=>E.records.wrapEnabled!==void 0?E.records.wrapEnabled:at().sequence.wrap,Qe=function(){E.reset(),Ie()},Ze=function(t){const e=t.trim(),c={text:e.replace(/^:?(?:no)?wrap:/,"").trim(),wrap:e.match(/^:?wrap:/)!==null?!0:e.match(/^:?nowrap:/)!==null?!1:void 0};return K.debug("parseMessage:",c),c},Ge=function(t){const e=t.match(/^((?:rgba?|hsla?)\s*\(.*\)|\w*)(.*)$/);let c=e!=null&&e[1]?e[1].trim():"transparent",a=e!=null&&e[2]?e[2].trim():void 0;if(window&&window.CSS)window.CSS.supports("color",c)||(c="transparent",a=t.trim());else{const i=new Option().style;i.color=c,i.color!==c&&(c="transparent",a=t.trim())}return{color:c,text:a!==void 0?It(a.replace(/^:?(?:no)?wrap:/,""),at()):void 0,wrap:a!==void 0?a.match(/^:?wrap:/)!==null?!0:a.match(/^:?nowrap:/)!==null?!1:void 0:void 0}},Tt={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},t0={FILLED:0,OPEN:1},e0={LEFTOF:0,RIGHTOF:1,OVER:2},ae=function(t,e,c){const a={actor:t,placement:e,message:c.text,wrap:c.wrap===void 0&&xt()||!!c.wrap},i=[].concat(t,t);E.records.notes.push(a),E.records.messages.push({from:i[0],to:i[1],message:c.text,wrap:c.wrap===void 0&&xt()||!!c.wrap,type:Tt.NOTE,placement:e})},re=function(t,e){const c=wt(t);try{let a=It(e.text,at());a=a.replace(/&amp;/g,"&"),a=a.replace(/&equals;/g,"=");const i=JSON.parse(a);Wt(c,i)}catch(a){K.error("error while parsing actor link text",a)}},a0=function(t,e){const c=wt(t);try{const l={};let n=It(e.text,at());var a=n.indexOf("@");n=n.replace(/&amp;/g,"&"),n=n.replace(/&equals;/g,"=");var i=n.slice(0,a-1).trim(),s=n.slice(a+1).trim();l[i]=s,Wt(c,l)}catch(l){K.error("error while parsing actor link text",l)}};function Wt(t,e){if(t.links==null)t.links=e;else for(let c in e)t.links[c]=e[c]}const se=function(t,e){const c=wt(t);try{let a=It(e.text,at());const i=JSON.parse(a);ie(c,i)}catch(a){K.error("error while parsing actor properties text",a)}};function ie(t,e){if(t.properties==null)t.properties=e;else for(let c in e)t.properties[c]=e[c]}function r0(){E.records.currentBox=void 0}const oe=function(t,e){const c=wt(t),a=document.getElementById(e.text);try{const i=a.innerHTML,s=JSON.parse(i);s.properties&&ie(c,s.properties),s.links&&Wt(c,s.links)}catch(i){K.error("error while parsing actor details text",i)}},s0=function(t,e){if(t!==void 0&&t.properties!==void 0)return t.properties[e]},ne=function(t){if(Array.isArray(t))t.forEach(function(e){ne(e)});else switch(t.type){case"sequenceIndex":E.records.messages.push({from:void 0,to:void 0,message:{start:t.sequenceIndex,step:t.sequenceIndexStep,visible:t.sequenceVisible},wrap:!1,type:t.signalType});break;case"addParticipant":Bt(t.actor,t.actor,t.description,t.draw);break;case"createParticipant":if(E.records.actors[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");E.records.lastCreated=t.actor,Bt(t.actor,t.actor,t.description,t.draw),E.records.createdActors[t.actor]=E.records.messages.length;break;case"destroyParticipant":E.records.lastDestroyed=t.actor,E.records.destroyedActors[t.actor]=E.records.messages.length;break;case"activeStart":S(t.actor,void 0,void 0,t.signalType);break;case"activeEnd":S(t.actor,void 0,void 0,t.signalType);break;case"addNote":ae(t.actor,t.placement,t.text);break;case"addLinks":re(t.actor,t.text);break;case"addALink":a0(t.actor,t.text);break;case"addProperties":se(t.actor,t.text);break;case"addDetails":oe(t.actor,t.text);break;case"addMessage":if(E.records.lastCreated){if(t.to!==E.records.lastCreated)throw new Error("The created participant "+E.records.lastCreated+" does not have an associated creating message after its declaration. Please check the sequence diagram.");E.records.lastCreated=void 0}else if(E.records.lastDestroyed){if(t.to!==E.records.lastDestroyed&&t.from!==E.records.lastDestroyed)throw new Error("The destroyed participant "+E.records.lastDestroyed+" does not have an associated destroying message after its declaration. Please check the sequence diagram.");E.records.lastDestroyed=void 0}S(t.from,t.to,t.msg,t.signalType,t.activate);break;case"boxStart":$e(t.boxData);break;case"boxEnd":r0();break;case"loopStart":S(void 0,void 0,t.loopText,t.signalType);break;case"loopEnd":S(void 0,void 0,void 0,t.signalType);break;case"rectStart":S(void 0,void 0,t.color,t.signalType);break;case"rectEnd":S(void 0,void 0,void 0,t.signalType);break;case"optStart":S(void 0,void 0,t.optText,t.signalType);break;case"optEnd":S(void 0,void 0,void 0,t.signalType);break;case"altStart":S(void 0,void 0,t.altText,t.signalType);break;case"else":S(void 0,void 0,t.altText,t.signalType);break;case"altEnd":S(void 0,void 0,void 0,t.signalType);break;case"setAccTitle":Zt(t.text);break;case"parStart":S(void 0,void 0,t.parText,t.signalType);break;case"and":S(void 0,void 0,t.parText,t.signalType);break;case"parEnd":S(void 0,void 0,void 0,t.signalType);break;case"criticalStart":S(void 0,void 0,t.criticalText,t.signalType);break;case"option":S(void 0,void 0,t.optionText,t.signalType);break;case"criticalEnd":S(void 0,void 0,void 0,t.signalType);break;case"breakStart":S(void 0,void 0,t.breakText,t.signalType);break;case"breakEnd":S(void 0,void 0,void 0,t.signalType);break}},Jt={addActor:Bt,addMessage:Ye,addSignal:S,addLinks:re,addDetails:oe,addProperties:se,autoWrap:xt,setWrap:Je,enableSequenceNumbers:je,disableSequenceNumbers:Ke,showSequenceNumbers:Xe,getMessages:Fe,getActors:We,getCreatedActors:ze,getDestroyedActors:He,getActor:wt,getActorKeys:Ue,getActorProperty:s0,getAccTitle:ke,getBoxes:qe,getDiagramTitle:_e,setDiagramTitle:ve,getConfig:()=>at().sequence,clear:Qe,parseMessage:Ze,parseBoxData:Ge,LINETYPE:Tt,ARROWTYPE:t0,PLACEMENT:e0,addNote:ae,setAccTitle:Zt,apply:ne,setAccDescription:we,getAccDescription:Ee,hasAtLeastOneBox:Be,hasAtLeastOneBoxWithTitle:Ve},i0=t=>`.actor {
6
+ `+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var T=this.next();return T||this.lex()},begin:function(T){this.conditionStack.push(T)},popState:function(){var T=this.conditionStack.length-1;return T>0?this.conditionStack.pop():this.conditionStack[0]},_currentRules:function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},topState:function(T){return T=this.conditionStack.length-1-Math.abs(T||0),T>=0?this.conditionStack[T]:"INITIAL"},pushState:function(T){this.begin(T)},stateStackSize:function(){return this.conditionStack.length},options:{"case-insensitive":!0},performAction:function(T,_,f,A){switch(f){case 0:return 5;case 1:break;case 2:break;case 3:break;case 4:break;case 5:break;case 6:return 19;case 7:return this.begin("LINE"),14;case 8:return this.begin("ID"),50;case 9:return this.begin("ID"),52;case 10:return 13;case 11:return this.begin("ID"),53;case 12:return _.yytext=_.yytext.trim(),this.begin("ALIAS"),70;case 13:return this.popState(),this.popState(),this.begin("LINE"),51;case 14:return this.popState(),this.popState(),5;case 15:return this.begin("LINE"),36;case 16:return this.begin("LINE"),37;case 17:return this.begin("LINE"),38;case 18:return this.begin("LINE"),39;case 19:return this.begin("LINE"),49;case 20:return this.begin("LINE"),41;case 21:return this.begin("LINE"),43;case 22:return this.begin("LINE"),48;case 23:return this.begin("LINE"),44;case 24:return this.begin("LINE"),47;case 25:return this.begin("LINE"),46;case 26:return this.popState(),15;case 27:return 16;case 28:return 65;case 29:return 66;case 30:return 59;case 31:return 60;case 32:return 61;case 33:return 62;case 34:return 57;case 35:return 54;case 36:return this.begin("ID"),21;case 37:return this.begin("ID"),23;case 38:return 29;case 39:return 30;case 40:return this.begin("acc_title"),31;case 41:return this.popState(),"acc_title_value";case 42:return this.begin("acc_descr"),33;case 43:return this.popState(),"acc_descr_value";case 44:this.begin("acc_descr_multiline");break;case 45:this.popState();break;case 46:return"acc_descr_multiline_value";case 47:return 6;case 48:return 18;case 49:return 20;case 50:return 64;case 51:return 5;case 52:return _.yytext=_.yytext.trim(),70;case 53:return 73;case 54:return 74;case 55:return 71;case 56:return 72;case 57:return 75;case 58:return 76;case 59:return 77;case 60:return 78;case 61:return 79;case 62:return 68;case 63:return 69;case 64:return 5;case 65:return"INVALID"}},rules:[/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:((?!\n)\s)+)/i,/^(?:#[^\n]*)/i,/^(?:%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[0-9]+(?=[ \n]+))/i,/^(?:box\b)/i,/^(?:participant\b)/i,/^(?:actor\b)/i,/^(?:create\b)/i,/^(?:destroy\b)/i,/^(?:[^\->:\n,;]+?([\-]*[^\->:\n,;]+?)*?(?=((?!\n)\s)+as(?!\n)\s|[#\n;]|$))/i,/^(?:as\b)/i,/^(?:(?:))/i,/^(?:loop\b)/i,/^(?:rect\b)/i,/^(?:opt\b)/i,/^(?:alt\b)/i,/^(?:else\b)/i,/^(?:par\b)/i,/^(?:par_over\b)/i,/^(?:and\b)/i,/^(?:critical\b)/i,/^(?:option\b)/i,/^(?:break\b)/i,/^(?:(?:[:]?(?:no)?wrap)?[^#\n;]*)/i,/^(?:end\b)/i,/^(?:left of\b)/i,/^(?:right of\b)/i,/^(?:links\b)/i,/^(?:link\b)/i,/^(?:properties\b)/i,/^(?:details\b)/i,/^(?:over\b)/i,/^(?:note\b)/i,/^(?:activate\b)/i,/^(?:deactivate\b)/i,/^(?:title\s[^#\n;]+)/i,/^(?:title:\s[^#\n;]+)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:sequenceDiagram\b)/i,/^(?:autonumber\b)/i,/^(?:off\b)/i,/^(?:,)/i,/^(?:;)/i,/^(?:[^\+\->:\n,;]+((?!(-x|--x|-\)|--\)))[\-]*[^\+\->:\n,;]+)*)/i,/^(?:->>)/i,/^(?:-->>)/i,/^(?:->)/i,/^(?:-->)/i,/^(?:-[x])/i,/^(?:--[x])/i,/^(?:-[\)])/i,/^(?:--[\)])/i,/^(?::(?:(?:no)?wrap)?[^#\n;]+)/i,/^(?:\+)/i,/^(?:-)/i,/^(?:$)/i,/^(?:.)/i],conditions:{acc_descr_multiline:{rules:[45,46],inclusive:!1},acc_descr:{rules:[43],inclusive:!1},acc_title:{rules:[41],inclusive:!1},ID:{rules:[2,3,12],inclusive:!1},ALIAS:{rules:[2,3,13,14],inclusive:!1},LINE:{rules:[2,3,26],inclusive:!1},INITIAL:{rules:[0,1,3,4,5,6,7,8,9,10,11,15,16,17,18,19,20,21,22,23,24,25,27,28,29,30,31,32,33,34,35,36,37,38,39,40,42,44,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65],inclusive:!0}}};return st}();At.lexer=ye;function Ot(){this.yy={}}return Ot.prototype=At,At.Parser=Ot,new Ot}();Yt.parser=Yt;const De=Yt;class Re{constructor(e){this.init=e,this.records=this.init()}reset(){this.records=this.init()}}const E=new Re(()=>({prevActor:void 0,actors:{},createdActors:{},destroyedActors:{},boxes:[],messages:[],notes:[],sequenceNumbersEnabled:!1,wrapEnabled:void 0,currentBox:void 0,lastCreated:void 0,lastDestroyed:void 0})),Ce=function(t){E.records.boxes.push({name:t.text,wrap:t.wrap===void 0&&xt()||!!t.wrap,fill:t.color,actorKeys:[]}),E.records.currentBox=E.records.boxes.slice(-1)[0]},Bt=function(t,e,c,a){let i=E.records.currentBox;const s=E.records.actors[t];if(s){if(E.records.currentBox&&s.box&&E.records.currentBox!==s.box)throw new Error("A same participant should only be defined in one Box: "+s.name+" can't be in '"+s.box.name+"' and in '"+E.records.currentBox.name+"' at the same time.");if(i=s.box?s.box:E.records.currentBox,s.box=i,s&&e===s.name&&c==null)return}(c==null||c.text==null)&&(c={text:e,wrap:null,type:a}),(a==null||c.text==null)&&(c={text:e,wrap:null,type:a}),E.records.actors[t]={box:i,name:e,description:c.text,wrap:c.wrap===void 0&&xt()||!!c.wrap,prevActor:E.records.prevActor,links:{},properties:{},actorCnt:null,rectData:null,type:a||"participant"},E.records.prevActor&&E.records.actors[E.records.prevActor]&&(E.records.actors[E.records.prevActor].nextActor=t),E.records.currentBox&&E.records.currentBox.actorKeys.push(t),E.records.prevActor=t},$e=t=>{let e,c=0;for(e=0;e<E.records.messages.length;e++)E.records.messages[e].type===Tt.ACTIVE_START&&E.records.messages[e].from.actor===t&&c++,E.records.messages[e].type===Tt.ACTIVE_END&&E.records.messages[e].from.actor===t&&c--;return c},Ye=function(t,e,c,a){E.records.messages.push({from:t,to:e,message:c.text,wrap:c.wrap===void 0&&xt()||!!c.wrap,answer:a})},S=function(t,e,c={text:void 0,wrap:void 0},a,i=!1){if(a===Tt.ACTIVE_END&&$e(t.actor)<1){let s=new Error("Trying to inactivate an inactive participant ("+t.actor+")");throw s.hash={text:"->>-",token:"->>-",line:"1",loc:{first_line:1,last_line:1,first_column:1,last_column:1},expected:["'ACTIVE_PARTICIPANT'"]},s}return E.records.messages.push({from:t,to:e,message:c.text,wrap:c.wrap===void 0&&xt()||!!c.wrap,type:a,activate:i}),!0},Be=function(){return E.records.boxes.length>0},Ve=function(){return E.records.boxes.some(t=>t.name)},Fe=function(){return E.records.messages},We=function(){return E.records.boxes},qe=function(){return E.records.actors},ze=function(){return E.records.createdActors},He=function(){return E.records.destroyedActors},wt=function(t){return E.records.actors[t]},Ue=function(){return Object.keys(E.records.actors)},je=function(){E.records.sequenceNumbersEnabled=!0},Ke=function(){E.records.sequenceNumbersEnabled=!1},Xe=()=>E.records.sequenceNumbersEnabled,Je=function(t){E.records.wrapEnabled=t},xt=()=>E.records.wrapEnabled!==void 0?E.records.wrapEnabled:at().sequence.wrap,Qe=function(){E.reset(),Ie()},Ze=function(t){const e=t.trim(),c={text:e.replace(/^:?(?:no)?wrap:/,"").trim(),wrap:e.match(/^:?wrap:/)!==null?!0:e.match(/^:?nowrap:/)!==null?!1:void 0};return K.debug("parseMessage:",c),c},Ge=function(t){const e=t.match(/^((?:rgba?|hsla?)\s*\(.*\)|\w*)(.*)$/);let c=e!=null&&e[1]?e[1].trim():"transparent",a=e!=null&&e[2]?e[2].trim():void 0;if(window&&window.CSS)window.CSS.supports("color",c)||(c="transparent",a=t.trim());else{const i=new Option().style;i.color=c,i.color!==c&&(c="transparent",a=t.trim())}return{color:c,text:a!==void 0?It(a.replace(/^:?(?:no)?wrap:/,""),at()):void 0,wrap:a!==void 0?a.match(/^:?wrap:/)!==null?!0:a.match(/^:?nowrap:/)!==null?!1:void 0:void 0}},Tt={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},t0={FILLED:0,OPEN:1},e0={LEFTOF:0,RIGHTOF:1,OVER:2},ae=function(t,e,c){const a={actor:t,placement:e,message:c.text,wrap:c.wrap===void 0&&xt()||!!c.wrap},i=[].concat(t,t);E.records.notes.push(a),E.records.messages.push({from:i[0],to:i[1],message:c.text,wrap:c.wrap===void 0&&xt()||!!c.wrap,type:Tt.NOTE,placement:e})},re=function(t,e){const c=wt(t);try{let a=It(e.text,at());a=a.replace(/&amp;/g,"&"),a=a.replace(/&equals;/g,"=");const i=JSON.parse(a);qt(c,i)}catch(a){K.error("error while parsing actor link text",a)}},a0=function(t,e){const c=wt(t);try{const l={};let n=It(e.text,at());var a=n.indexOf("@");n=n.replace(/&amp;/g,"&"),n=n.replace(/&equals;/g,"=");var i=n.slice(0,a-1).trim(),s=n.slice(a+1).trim();l[i]=s,qt(c,l)}catch(l){K.error("error while parsing actor link text",l)}};function qt(t,e){if(t.links==null)t.links=e;else for(let c in e)t.links[c]=e[c]}const se=function(t,e){const c=wt(t);try{let a=It(e.text,at());const i=JSON.parse(a);ie(c,i)}catch(a){K.error("error while parsing actor properties text",a)}};function ie(t,e){if(t.properties==null)t.properties=e;else for(let c in e)t.properties[c]=e[c]}function r0(){E.records.currentBox=void 0}const oe=function(t,e){const c=wt(t),a=document.getElementById(e.text);try{const i=a.innerHTML,s=JSON.parse(i);s.properties&&ie(c,s.properties),s.links&&qt(c,s.links)}catch(i){K.error("error while parsing actor details text",i)}},s0=function(t,e){if(t!==void 0&&t.properties!==void 0)return t.properties[e]},ne=function(t){if(Array.isArray(t))t.forEach(function(e){ne(e)});else switch(t.type){case"sequenceIndex":E.records.messages.push({from:void 0,to:void 0,message:{start:t.sequenceIndex,step:t.sequenceIndexStep,visible:t.sequenceVisible},wrap:!1,type:t.signalType});break;case"addParticipant":Bt(t.actor,t.actor,t.description,t.draw);break;case"createParticipant":if(E.records.actors[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");E.records.lastCreated=t.actor,Bt(t.actor,t.actor,t.description,t.draw),E.records.createdActors[t.actor]=E.records.messages.length;break;case"destroyParticipant":E.records.lastDestroyed=t.actor,E.records.destroyedActors[t.actor]=E.records.messages.length;break;case"activeStart":S(t.actor,void 0,void 0,t.signalType);break;case"activeEnd":S(t.actor,void 0,void 0,t.signalType);break;case"addNote":ae(t.actor,t.placement,t.text);break;case"addLinks":re(t.actor,t.text);break;case"addALink":a0(t.actor,t.text);break;case"addProperties":se(t.actor,t.text);break;case"addDetails":oe(t.actor,t.text);break;case"addMessage":if(E.records.lastCreated){if(t.to!==E.records.lastCreated)throw new Error("The created participant "+E.records.lastCreated+" does not have an associated creating message after its declaration. Please check the sequence diagram.");E.records.lastCreated=void 0}else if(E.records.lastDestroyed){if(t.to!==E.records.lastDestroyed&&t.from!==E.records.lastDestroyed)throw new Error("The destroyed participant "+E.records.lastDestroyed+" does not have an associated destroying message after its declaration. Please check the sequence diagram.");E.records.lastDestroyed=void 0}S(t.from,t.to,t.msg,t.signalType,t.activate);break;case"boxStart":Ce(t.boxData);break;case"boxEnd":r0();break;case"loopStart":S(void 0,void 0,t.loopText,t.signalType);break;case"loopEnd":S(void 0,void 0,void 0,t.signalType);break;case"rectStart":S(void 0,void 0,t.color,t.signalType);break;case"rectEnd":S(void 0,void 0,void 0,t.signalType);break;case"optStart":S(void 0,void 0,t.optText,t.signalType);break;case"optEnd":S(void 0,void 0,void 0,t.signalType);break;case"altStart":S(void 0,void 0,t.altText,t.signalType);break;case"else":S(void 0,void 0,t.altText,t.signalType);break;case"altEnd":S(void 0,void 0,void 0,t.signalType);break;case"setAccTitle":Zt(t.text);break;case"parStart":S(void 0,void 0,t.parText,t.signalType);break;case"and":S(void 0,void 0,t.parText,t.signalType);break;case"parEnd":S(void 0,void 0,void 0,t.signalType);break;case"criticalStart":S(void 0,void 0,t.criticalText,t.signalType);break;case"option":S(void 0,void 0,t.optionText,t.signalType);break;case"criticalEnd":S(void 0,void 0,void 0,t.signalType);break;case"breakStart":S(void 0,void 0,t.breakText,t.signalType);break;case"breakEnd":S(void 0,void 0,void 0,t.signalType);break}},Jt={addActor:Bt,addMessage:Ye,addSignal:S,addLinks:re,addDetails:oe,addProperties:se,autoWrap:xt,setWrap:Je,enableSequenceNumbers:je,disableSequenceNumbers:Ke,showSequenceNumbers:Xe,getMessages:Fe,getActors:qe,getCreatedActors:ze,getDestroyedActors:He,getActor:wt,getActorKeys:Ue,getActorProperty:s0,getAccTitle:Pe,getBoxes:We,getDiagramTitle:_e,setDiagramTitle:ve,getConfig:()=>at().sequence,clear:Qe,parseMessage:Ze,parseBoxData:Ge,LINETYPE:Tt,ARROWTYPE:t0,PLACEMENT:e0,addNote:ae,setAccTitle:Zt,apply:ne,setAccDescription:we,getAccDescription:Ee,hasAtLeastOneBox:Be,hasAtLeastOneBoxWithTitle:Ve},i0=t=>`.actor {
7
7
  stroke: ${t.actorBorder};
8
8
  fill: ${t.actorBkg};
9
9
  }
@@ -119,4 +119,4 @@ Expecting `+kt.join(", ")+", got '"+(this.terminals_[j]||j)+"'":$t="Parse error
119
119
  fill: ${t.actorBkg};
120
120
  stroke-width: 2px;
121
121
  }
122
- `,o0=i0,ut=36,ce="actor-top",le="actor-bottom",zt=function(t,e){return Ae(t,e)},n0=function(t,e,c,a,i){if(e.links===void 0||e.links===null||Object.keys(e.links).length===0)return{height:0,width:0};const s=e.links,l=e.actorCnt,n=e.rectData;var h="none";i&&(h="block !important");const r=t.append("g");r.attr("id","actor"+l+"_popup"),r.attr("class","actorPopupMenu"),r.attr("display",h);var u="";n.class!==void 0&&(u=" "+n.class);let b=n.width>c?n.width:c;const g=r.append("rect");if(g.attr("class","actorPopupMenuPanel"+u),g.attr("x",n.x),g.attr("y",n.height),g.attr("fill",n.fill),g.attr("stroke",n.stroke),g.attr("width",b),g.attr("height",n.height),g.attr("rx",n.rx),g.attr("ry",n.ry),s!=null){var y=20;for(let L in s){var w=r.append("a"),k=Gt.sanitizeUrl(s[L]);w.attr("xlink:href",k),w.attr("target","_blank"),_0(a)(L,w,n.x+10,n.height+y,b,20,{class:"actor"},a),y+=30}}return g.attr("height",y),{height:n.height+y,width:b}},c0=function(t){return"var pu = document.getElementById('"+t+"'); if (pu != null) { pu.style.display = pu.style.display == 'block' ? 'none' : 'block'; }"},Lt=async function(t,e,c=null){let a=t.append("foreignObject");const i=await ee(e.text,Ct()),s=a.append("xhtml:div").attr("style","width: fit-content;").attr("xmlns","http://www.w3.org/1999/xhtml").html(i).node().getBoundingClientRect();if(a.attr("height",Math.round(s.height)).attr("width",Math.round(s.width)),e.class==="noteText"){const l=t.node().firstChild;l.setAttribute("height",s.height+2*e.textMargin);const n=l.getBBox();a.attr("x",Math.round(n.x+n.width/2-s.width/2)).attr("y",Math.round(n.y+n.height/2-s.height/2))}else if(c){let{startx:l,stopx:n,starty:h}=c;if(l>n){const r=l;l=n,n=r}a.attr("x",Math.round(l+Math.abs(l-n)/2-s.width/2)),e.class==="loopText"?a.attr("y",Math.round(h)):a.attr("y",Math.round(h-s.height))}return[a]},bt=function(t,e){let c=0,a=0;const i=e.text.split(v.lineBreakRegex),[s,l]=te(e.fontSize);let n=[],h=0,r=()=>e.y;if(e.valign!==void 0&&e.textMargin!==void 0&&e.textMargin>0)switch(e.valign){case"top":case"start":r=()=>Math.round(e.y+e.textMargin);break;case"middle":case"center":r=()=>Math.round(e.y+(c+a+e.textMargin)/2);break;case"bottom":case"end":r=()=>Math.round(e.y+(c+a+2*e.textMargin)-e.textMargin);break}if(e.anchor!==void 0&&e.textMargin!==void 0&&e.width!==void 0)switch(e.anchor){case"left":case"start":e.x=Math.round(e.x+e.textMargin),e.anchor="start",e.dominantBaseline="middle",e.alignmentBaseline="middle";break;case"middle":case"center":e.x=Math.round(e.x+e.width/2),e.anchor="middle",e.dominantBaseline="middle",e.alignmentBaseline="middle";break;case"right":case"end":e.x=Math.round(e.x+e.width-e.textMargin),e.anchor="end",e.dominantBaseline="middle",e.alignmentBaseline="middle";break}for(let[u,b]of i.entries()){e.textMargin!==void 0&&e.textMargin===0&&s!==void 0&&(h=u*s);const g=t.append("text");g.attr("x",e.x),g.attr("y",r()),e.anchor!==void 0&&g.attr("text-anchor",e.anchor).attr("dominant-baseline",e.dominantBaseline).attr("alignment-baseline",e.alignmentBaseline),e.fontFamily!==void 0&&g.style("font-family",e.fontFamily),l!==void 0&&g.style("font-size",l),e.fontWeight!==void 0&&g.style("font-weight",e.fontWeight),e.fill!==void 0&&g.attr("fill",e.fill),e.class!==void 0&&g.attr("class",e.class),e.dy!==void 0?g.attr("dy",e.dy):h!==0&&g.attr("dy",h);const y=b||Me;if(e.tspan){const w=g.append("tspan");w.attr("x",e.x),e.fill!==void 0&&w.attr("fill",e.fill),w.text(y)}else g.text(y);e.valign!==void 0&&e.textMargin!==void 0&&e.textMargin>0&&(a+=(g._groups||g)[0][0].getBBox().height,c=a),n.push(g)}return n},de=function(t,e){function c(i,s,l,n,h){return i+","+s+" "+(i+l)+","+s+" "+(i+l)+","+(s+n-h)+" "+(i+l-h*1.2)+","+(s+n)+" "+i+","+(s+n)}const a=t.append("polygon");return a.attr("points",c(e.x,e.y,e.width,e.height,7)),a.attr("class","labelBox"),e.y=e.y+e.height/2,bt(t,e),a};let ot=-1;const pe=(t,e,c,a)=>{t.select&&c.forEach(i=>{const s=e[i],l=t.select("#actor"+s.actorCnt);!a.mirrorActors&&s.stopy?l.attr("y2",s.stopy+s.height/2):a.mirrorActors&&l.attr("y2",s.stopy)})},l0=async function(t,e,c,a){const i=a?e.stopy:e.starty,s=e.x+e.width/2,l=i+5,n=t.append("g").lower();var h=n;a||(ot++,Object.keys(e.links||{}).length&&!c.forceMenus&&h.attr("onclick",c0(`actor${ot}_popup`)).attr("cursor","pointer"),h.append("line").attr("id","actor"+ot).attr("x1",s).attr("y1",l).attr("x2",s).attr("y2",2e3).attr("class","actor-line").attr("class","200").attr("stroke-width","0.5px").attr("stroke","#999"),h=n.append("g"),e.actorCnt=ot,e.links!=null&&h.attr("id","root-"+ot));const r=Mt();var u="actor";e.properties!=null&&e.properties.class?u=e.properties.class:r.fill="#eaeaea",a?u+=` ${le}`:u+=` ${ce}`,r.x=e.x,r.y=i,r.width=e.width,r.height=e.height,r.class=u,r.rx=3,r.ry=3,r.name=e.name;const b=zt(h,r);if(e.rectData=r,e.properties!=null&&e.properties.icon){const y=e.properties.icon.trim();y.charAt(0)==="@"?Oe(h,r.x+r.width-20,r.y+10,y.substr(1)):Se(h,r.x+r.width-20,r.y+10,y)}await Ht(c,nt(e.description))(e.description,h,r.x,r.y,r.width,r.height,{class:"actor"},c);let g=e.height;if(b.node){const y=b.node().getBBox();e.height=y.height,g=y.height}return g},d0=async function(t,e,c,a){const i=a?e.stopy:e.starty,s=e.x+e.width/2,l=i+80;t.lower(),a||(ot++,t.append("line").attr("id","actor"+ot).attr("x1",s).attr("y1",l).attr("x2",s).attr("y2",2e3).attr("class","actor-line").attr("class","200").attr("stroke-width","0.5px").attr("stroke","#999"),e.actorCnt=ot);const n=t.append("g");let h="actor-man";a?h+=` ${le}`:h+=` ${ce}`,n.attr("class",h),n.attr("name",e.name);const r=Mt();r.x=e.x,r.y=i,r.fill="#eaeaea",r.width=e.width,r.height=e.height,r.class="actor",r.rx=3,r.ry=3,n.append("line").attr("id","actor-man-torso"+ot).attr("x1",s).attr("y1",i+25).attr("x2",s).attr("y2",i+45),n.append("line").attr("id","actor-man-arms"+ot).attr("x1",s-ut/2).attr("y1",i+33).attr("x2",s+ut/2).attr("y2",i+33),n.append("line").attr("x1",s-ut/2).attr("y1",i+60).attr("x2",s).attr("y2",i+45),n.append("line").attr("x1",s).attr("y1",i+45).attr("x2",s+ut/2-2).attr("y2",i+60);const u=n.append("circle");u.attr("cx",e.x+e.width/2),u.attr("cy",i+10),u.attr("r",15),u.attr("width",e.width),u.attr("height",e.height);const b=n.node().getBBox();return e.height=b.height,await Ht(c,nt(e.description))(e.description,n,r.x,r.y+35,r.width,r.height,{class:"actor"},c),e.height},p0=async function(t,e,c,a){switch(e.type){case"actor":return await d0(t,e,c,a);case"participant":return await l0(t,e,c,a)}},h0=async function(t,e,c){const a=t.append("g");he(a,e),e.name&&await Ht(c)(e.name,a,e.x,e.y+(e.textMaxHeight||0)/2,e.width,0,{class:"text"},c),a.lower()},g0=function(t){return t.append("g")},u0=function(t,e,c,a,i){const s=Mt(),l=e.anchored;s.x=e.startx,s.y=e.starty,s.class="activation"+i%3,s.width=e.stopx-e.startx,s.height=c-e.starty,zt(l,s)},x0=async function(t,e,c,a){const{boxMargin:i,boxTextMargin:s,labelBoxHeight:l,labelBoxWidth:n,messageFontFamily:h,messageFontSize:r,messageFontWeight:u}=a,b=t.append("g"),g=function(k,L,R,N){return b.append("line").attr("x1",k).attr("y1",L).attr("x2",R).attr("y2",N).attr("class","loopLine")};g(e.startx,e.starty,e.stopx,e.starty),g(e.stopx,e.starty,e.stopx,e.stopy),g(e.startx,e.stopy,e.stopx,e.stopy),g(e.startx,e.starty,e.startx,e.stopy),e.sections!==void 0&&e.sections.forEach(function(k){g(e.startx,k.y,e.stopx,k.y).style("stroke-dasharray","3, 3")});let y=qt();y.text=c,y.x=e.startx,y.y=e.starty,y.fontFamily=h,y.fontSize=r,y.fontWeight=u,y.anchor="middle",y.valign="middle",y.tspan=!1,y.width=n||50,y.height=l||20,y.textMargin=s,y.class="labelText",de(b,y),y=ge(),y.text=e.title,y.x=e.startx+n/2+(e.stopx-e.startx)/2,y.y=e.starty+i+s,y.anchor="middle",y.valign="middle",y.textMargin=s,y.class="loopText",y.fontFamily=h,y.fontSize=r,y.fontWeight=u,y.wrap=!0;let w=nt(y.text)?await Lt(b,y,e):bt(b,y);if(e.sectionTitles!==void 0){for(const[k,L]of Object.entries(e.sectionTitles))if(L.message){y.text=L.message,y.x=e.startx+(e.stopx-e.startx)/2,y.y=e.sections[k].y+i+s,y.class="loopText",y.anchor="middle",y.valign="middle",y.tspan=!1,y.fontFamily=h,y.fontSize=r,y.fontWeight=u,y.wrap=e.wrap,nt(y.text)?(e.starty=e.sections[k].y,await Lt(b,y,e)):bt(b,y);let R=Math.round(w.map(N=>(N._groups||N)[0][0].getBBox().height).reduce((N,$)=>N+$));e.sections[k].height+=R-(i+s)}}return e.height=Math.round(e.stopy-e.starty),b},he=function(t,e){Ne(t,e)},y0=function(t){t.append("defs").append("symbol").attr("id","database").attr("fill-rule","evenodd").attr("clip-rule","evenodd").append("path").attr("transform","scale(.5)").attr("d","M12.258.001l.256.004.255.005.253.008.251.01.249.012.247.015.246.016.242.019.241.02.239.023.236.024.233.027.231.028.229.031.225.032.223.034.22.036.217.038.214.04.211.041.208.043.205.045.201.046.198.048.194.05.191.051.187.053.183.054.18.056.175.057.172.059.168.06.163.061.16.063.155.064.15.066.074.033.073.033.071.034.07.034.069.035.068.035.067.035.066.035.064.036.064.036.062.036.06.036.06.037.058.037.058.037.055.038.055.038.053.038.052.038.051.039.05.039.048.039.047.039.045.04.044.04.043.04.041.04.04.041.039.041.037.041.036.041.034.041.033.042.032.042.03.042.029.042.027.042.026.043.024.043.023.043.021.043.02.043.018.044.017.043.015.044.013.044.012.044.011.045.009.044.007.045.006.045.004.045.002.045.001.045v17l-.001.045-.002.045-.004.045-.006.045-.007.045-.009.044-.011.045-.012.044-.013.044-.015.044-.017.043-.018.044-.02.043-.021.043-.023.043-.024.043-.026.043-.027.042-.029.042-.03.042-.032.042-.033.042-.034.041-.036.041-.037.041-.039.041-.04.041-.041.04-.043.04-.044.04-.045.04-.047.039-.048.039-.05.039-.051.039-.052.038-.053.038-.055.038-.055.038-.058.037-.058.037-.06.037-.06.036-.062.036-.064.036-.064.036-.066.035-.067.035-.068.035-.069.035-.07.034-.071.034-.073.033-.074.033-.15.066-.155.064-.16.063-.163.061-.168.06-.172.059-.175.057-.18.056-.183.054-.187.053-.191.051-.194.05-.198.048-.201.046-.205.045-.208.043-.211.041-.214.04-.217.038-.22.036-.223.034-.225.032-.229.031-.231.028-.233.027-.236.024-.239.023-.241.02-.242.019-.246.016-.247.015-.249.012-.251.01-.253.008-.255.005-.256.004-.258.001-.258-.001-.256-.004-.255-.005-.253-.008-.251-.01-.249-.012-.247-.015-.245-.016-.243-.019-.241-.02-.238-.023-.236-.024-.234-.027-.231-.028-.228-.031-.226-.032-.223-.034-.22-.036-.217-.038-.214-.04-.211-.041-.208-.043-.204-.045-.201-.046-.198-.048-.195-.05-.19-.051-.187-.053-.184-.054-.179-.056-.176-.057-.172-.059-.167-.06-.164-.061-.159-.063-.155-.064-.151-.066-.074-.033-.072-.033-.072-.034-.07-.034-.069-.035-.068-.035-.067-.035-.066-.035-.064-.036-.063-.036-.062-.036-.061-.036-.06-.037-.058-.037-.057-.037-.056-.038-.055-.038-.053-.038-.052-.038-.051-.039-.049-.039-.049-.039-.046-.039-.046-.04-.044-.04-.043-.04-.041-.04-.04-.041-.039-.041-.037-.041-.036-.041-.034-.041-.033-.042-.032-.042-.03-.042-.029-.042-.027-.042-.026-.043-.024-.043-.023-.043-.021-.043-.02-.043-.018-.044-.017-.043-.015-.044-.013-.044-.012-.044-.011-.045-.009-.044-.007-.045-.006-.045-.004-.045-.002-.045-.001-.045v-17l.001-.045.002-.045.004-.045.006-.045.007-.045.009-.044.011-.045.012-.044.013-.044.015-.044.017-.043.018-.044.02-.043.021-.043.023-.043.024-.043.026-.043.027-.042.029-.042.03-.042.032-.042.033-.042.034-.041.036-.041.037-.041.039-.041.04-.041.041-.04.043-.04.044-.04.046-.04.046-.039.049-.039.049-.039.051-.039.052-.038.053-.038.055-.038.056-.038.057-.037.058-.037.06-.037.061-.036.062-.036.063-.036.064-.036.066-.035.067-.035.068-.035.069-.035.07-.034.072-.034.072-.033.074-.033.151-.066.155-.064.159-.063.164-.061.167-.06.172-.059.176-.057.179-.056.184-.054.187-.053.19-.051.195-.05.198-.048.201-.046.204-.045.208-.043.211-.041.214-.04.217-.038.22-.036.223-.034.226-.032.228-.031.231-.028.234-.027.236-.024.238-.023.241-.02.243-.019.245-.016.247-.015.249-.012.251-.01.253-.008.255-.005.256-.004.258-.001.258.001zm-9.258 20.499v.01l.001.021.003.021.004.022.005.021.006.022.007.022.009.023.01.022.011.023.012.023.013.023.015.023.016.024.017.023.018.024.019.024.021.024.022.025.023.024.024.025.052.049.056.05.061.051.066.051.07.051.075.051.079.052.084.052.088.052.092.052.097.052.102.051.105.052.11.052.114.051.119.051.123.051.127.05.131.05.135.05.139.048.144.049.147.047.152.047.155.047.16.045.163.045.167.043.171.043.176.041.178.041.183.039.187.039.19.037.194.035.197.035.202.033.204.031.209.03.212.029.216.027.219.025.222.024.226.021.23.02.233.018.236.016.24.015.243.012.246.01.249.008.253.005.256.004.259.001.26-.001.257-.004.254-.005.25-.008.247-.011.244-.012.241-.014.237-.016.233-.018.231-.021.226-.021.224-.024.22-.026.216-.027.212-.028.21-.031.205-.031.202-.034.198-.034.194-.036.191-.037.187-.039.183-.04.179-.04.175-.042.172-.043.168-.044.163-.045.16-.046.155-.046.152-.047.148-.048.143-.049.139-.049.136-.05.131-.05.126-.05.123-.051.118-.052.114-.051.11-.052.106-.052.101-.052.096-.052.092-.052.088-.053.083-.051.079-.052.074-.052.07-.051.065-.051.06-.051.056-.05.051-.05.023-.024.023-.025.021-.024.02-.024.019-.024.018-.024.017-.024.015-.023.014-.024.013-.023.012-.023.01-.023.01-.022.008-.022.006-.022.006-.022.004-.022.004-.021.001-.021.001-.021v-4.127l-.077.055-.08.053-.083.054-.085.053-.087.052-.09.052-.093.051-.095.05-.097.05-.1.049-.102.049-.105.048-.106.047-.109.047-.111.046-.114.045-.115.045-.118.044-.12.043-.122.042-.124.042-.126.041-.128.04-.13.04-.132.038-.134.038-.135.037-.138.037-.139.035-.142.035-.143.034-.144.033-.147.032-.148.031-.15.03-.151.03-.153.029-.154.027-.156.027-.158.026-.159.025-.161.024-.162.023-.163.022-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.011-.178.01-.179.008-.179.008-.181.006-.182.005-.182.004-.184.003-.184.002h-.37l-.184-.002-.184-.003-.182-.004-.182-.005-.181-.006-.179-.008-.179-.008-.178-.01-.176-.011-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.022-.162-.023-.161-.024-.159-.025-.157-.026-.156-.027-.155-.027-.153-.029-.151-.03-.15-.03-.148-.031-.146-.032-.145-.033-.143-.034-.141-.035-.14-.035-.137-.037-.136-.037-.134-.038-.132-.038-.13-.04-.128-.04-.126-.041-.124-.042-.122-.042-.12-.044-.117-.043-.116-.045-.113-.045-.112-.046-.109-.047-.106-.047-.105-.048-.102-.049-.1-.049-.097-.05-.095-.05-.093-.052-.09-.051-.087-.052-.085-.053-.083-.054-.08-.054-.077-.054v4.127zm0-5.654v.011l.001.021.003.021.004.021.005.022.006.022.007.022.009.022.01.022.011.023.012.023.013.023.015.024.016.023.017.024.018.024.019.024.021.024.022.024.023.025.024.024.052.05.056.05.061.05.066.051.07.051.075.052.079.051.084.052.088.052.092.052.097.052.102.052.105.052.11.051.114.051.119.052.123.05.127.051.131.05.135.049.139.049.144.048.147.048.152.047.155.046.16.045.163.045.167.044.171.042.176.042.178.04.183.04.187.038.19.037.194.036.197.034.202.033.204.032.209.03.212.028.216.027.219.025.222.024.226.022.23.02.233.018.236.016.24.014.243.012.246.01.249.008.253.006.256.003.259.001.26-.001.257-.003.254-.006.25-.008.247-.01.244-.012.241-.015.237-.016.233-.018.231-.02.226-.022.224-.024.22-.025.216-.027.212-.029.21-.03.205-.032.202-.033.198-.035.194-.036.191-.037.187-.039.183-.039.179-.041.175-.042.172-.043.168-.044.163-.045.16-.045.155-.047.152-.047.148-.048.143-.048.139-.05.136-.049.131-.05.126-.051.123-.051.118-.051.114-.052.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.051.07-.052.065-.051.06-.05.056-.051.051-.049.023-.025.023-.024.021-.025.02-.024.019-.024.018-.024.017-.024.015-.023.014-.023.013-.024.012-.022.01-.023.01-.023.008-.022.006-.022.006-.022.004-.021.004-.022.001-.021.001-.021v-4.139l-.077.054-.08.054-.083.054-.085.052-.087.053-.09.051-.093.051-.095.051-.097.05-.1.049-.102.049-.105.048-.106.047-.109.047-.111.046-.114.045-.115.044-.118.044-.12.044-.122.042-.124.042-.126.041-.128.04-.13.039-.132.039-.134.038-.135.037-.138.036-.139.036-.142.035-.143.033-.144.033-.147.033-.148.031-.15.03-.151.03-.153.028-.154.028-.156.027-.158.026-.159.025-.161.024-.162.023-.163.022-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.011-.178.009-.179.009-.179.007-.181.007-.182.005-.182.004-.184.003-.184.002h-.37l-.184-.002-.184-.003-.182-.004-.182-.005-.181-.007-.179-.007-.179-.009-.178-.009-.176-.011-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.022-.162-.023-.161-.024-.159-.025-.157-.026-.156-.027-.155-.028-.153-.028-.151-.03-.15-.03-.148-.031-.146-.033-.145-.033-.143-.033-.141-.035-.14-.036-.137-.036-.136-.037-.134-.038-.132-.039-.13-.039-.128-.04-.126-.041-.124-.042-.122-.043-.12-.043-.117-.044-.116-.044-.113-.046-.112-.046-.109-.046-.106-.047-.105-.048-.102-.049-.1-.049-.097-.05-.095-.051-.093-.051-.09-.051-.087-.053-.085-.052-.083-.054-.08-.054-.077-.054v4.139zm0-5.666v.011l.001.02.003.022.004.021.005.022.006.021.007.022.009.023.01.022.011.023.012.023.013.023.015.023.016.024.017.024.018.023.019.024.021.025.022.024.023.024.024.025.052.05.056.05.061.05.066.051.07.051.075.052.079.051.084.052.088.052.092.052.097.052.102.052.105.051.11.052.114.051.119.051.123.051.127.05.131.05.135.05.139.049.144.048.147.048.152.047.155.046.16.045.163.045.167.043.171.043.176.042.178.04.183.04.187.038.19.037.194.036.197.034.202.033.204.032.209.03.212.028.216.027.219.025.222.024.226.021.23.02.233.018.236.017.24.014.243.012.246.01.249.008.253.006.256.003.259.001.26-.001.257-.003.254-.006.25-.008.247-.01.244-.013.241-.014.237-.016.233-.018.231-.02.226-.022.224-.024.22-.025.216-.027.212-.029.21-.03.205-.032.202-.033.198-.035.194-.036.191-.037.187-.039.183-.039.179-.041.175-.042.172-.043.168-.044.163-.045.16-.045.155-.047.152-.047.148-.048.143-.049.139-.049.136-.049.131-.051.126-.05.123-.051.118-.052.114-.051.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.052.07-.051.065-.051.06-.051.056-.05.051-.049.023-.025.023-.025.021-.024.02-.024.019-.024.018-.024.017-.024.015-.023.014-.024.013-.023.012-.023.01-.022.01-.023.008-.022.006-.022.006-.022.004-.022.004-.021.001-.021.001-.021v-4.153l-.077.054-.08.054-.083.053-.085.053-.087.053-.09.051-.093.051-.095.051-.097.05-.1.049-.102.048-.105.048-.106.048-.109.046-.111.046-.114.046-.115.044-.118.044-.12.043-.122.043-.124.042-.126.041-.128.04-.13.039-.132.039-.134.038-.135.037-.138.036-.139.036-.142.034-.143.034-.144.033-.147.032-.148.032-.15.03-.151.03-.153.028-.154.028-.156.027-.158.026-.159.024-.161.024-.162.023-.163.023-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.01-.178.01-.179.009-.179.007-.181.006-.182.006-.182.004-.184.003-.184.001-.185.001-.185-.001-.184-.001-.184-.003-.182-.004-.182-.006-.181-.006-.179-.007-.179-.009-.178-.01-.176-.01-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.023-.162-.023-.161-.024-.159-.024-.157-.026-.156-.027-.155-.028-.153-.028-.151-.03-.15-.03-.148-.032-.146-.032-.145-.033-.143-.034-.141-.034-.14-.036-.137-.036-.136-.037-.134-.038-.132-.039-.13-.039-.128-.041-.126-.041-.124-.041-.122-.043-.12-.043-.117-.044-.116-.044-.113-.046-.112-.046-.109-.046-.106-.048-.105-.048-.102-.048-.1-.05-.097-.049-.095-.051-.093-.051-.09-.052-.087-.052-.085-.053-.083-.053-.08-.054-.077-.054v4.153zm8.74-8.179l-.257.004-.254.005-.25.008-.247.011-.244.012-.241.014-.237.016-.233.018-.231.021-.226.022-.224.023-.22.026-.216.027-.212.028-.21.031-.205.032-.202.033-.198.034-.194.036-.191.038-.187.038-.183.04-.179.041-.175.042-.172.043-.168.043-.163.045-.16.046-.155.046-.152.048-.148.048-.143.048-.139.049-.136.05-.131.05-.126.051-.123.051-.118.051-.114.052-.11.052-.106.052-.101.052-.096.052-.092.052-.088.052-.083.052-.079.052-.074.051-.07.052-.065.051-.06.05-.056.05-.051.05-.023.025-.023.024-.021.024-.02.025-.019.024-.018.024-.017.023-.015.024-.014.023-.013.023-.012.023-.01.023-.01.022-.008.022-.006.023-.006.021-.004.022-.004.021-.001.021-.001.021.001.021.001.021.004.021.004.022.006.021.006.023.008.022.01.022.01.023.012.023.013.023.014.023.015.024.017.023.018.024.019.024.02.025.021.024.023.024.023.025.051.05.056.05.06.05.065.051.07.052.074.051.079.052.083.052.088.052.092.052.096.052.101.052.106.052.11.052.114.052.118.051.123.051.126.051.131.05.136.05.139.049.143.048.148.048.152.048.155.046.16.046.163.045.168.043.172.043.175.042.179.041.183.04.187.038.191.038.194.036.198.034.202.033.205.032.21.031.212.028.216.027.22.026.224.023.226.022.231.021.233.018.237.016.241.014.244.012.247.011.25.008.254.005.257.004.26.001.26-.001.257-.004.254-.005.25-.008.247-.011.244-.012.241-.014.237-.016.233-.018.231-.021.226-.022.224-.023.22-.026.216-.027.212-.028.21-.031.205-.032.202-.033.198-.034.194-.036.191-.038.187-.038.183-.04.179-.041.175-.042.172-.043.168-.043.163-.045.16-.046.155-.046.152-.048.148-.048.143-.048.139-.049.136-.05.131-.05.126-.051.123-.051.118-.051.114-.052.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.051.07-.052.065-.051.06-.05.056-.05.051-.05.023-.025.023-.024.021-.024.02-.025.019-.024.018-.024.017-.023.015-.024.014-.023.013-.023.012-.023.01-.023.01-.022.008-.022.006-.023.006-.021.004-.022.004-.021.001-.021.001-.021-.001-.021-.001-.021-.004-.021-.004-.022-.006-.021-.006-.023-.008-.022-.01-.022-.01-.023-.012-.023-.013-.023-.014-.023-.015-.024-.017-.023-.018-.024-.019-.024-.02-.025-.021-.024-.023-.024-.023-.025-.051-.05-.056-.05-.06-.05-.065-.051-.07-.052-.074-.051-.079-.052-.083-.052-.088-.052-.092-.052-.096-.052-.101-.052-.106-.052-.11-.052-.114-.052-.118-.051-.123-.051-.126-.051-.131-.05-.136-.05-.139-.049-.143-.048-.148-.048-.152-.048-.155-.046-.16-.046-.163-.045-.168-.043-.172-.043-.175-.042-.179-.041-.183-.04-.187-.038-.191-.038-.194-.036-.198-.034-.202-.033-.205-.032-.21-.031-.212-.028-.216-.027-.22-.026-.224-.023-.226-.022-.231-.021-.233-.018-.237-.016-.241-.014-.244-.012-.247-.011-.25-.008-.254-.005-.257-.004-.26-.001-.26.001z")},m0=function(t){t.append("defs").append("symbol").attr("id","computer").attr("width","24").attr("height","24").append("path").attr("transform","scale(.5)").attr("d","M2 2v13h20v-13h-20zm18 11h-16v-9h16v9zm-10.228 6l.466-1h3.524l.467 1h-4.457zm14.228 3h-24l2-6h2.104l-1.33 4h18.45l-1.297-4h2.073l2 6zm-5-10h-14v-7h14v7z")},f0=function(t){t.append("defs").append("symbol").attr("id","clock").attr("width","24").attr("height","24").append("path").attr("transform","scale(.5)").attr("d","M12 2c5.514 0 10 4.486 10 10s-4.486 10-10 10-10-4.486-10-10 4.486-10 10-10zm0-2c-6.627 0-12 5.373-12 12s5.373 12 12 12 12-5.373 12-12-5.373-12-12-12zm5.848 12.459c.202.038.202.333.001.372-1.907.361-6.045 1.111-6.547 1.111-.719 0-1.301-.582-1.301-1.301 0-.512.77-5.447 1.125-7.445.034-.192.312-.181.343.014l.985 6.238 5.394 1.011z")},b0=function(t){t.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").append("path").attr("d","M 0 0 L 10 5 L 0 10 z")},T0=function(t){t.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")},E0=function(t){t.append("defs").append("marker").attr("id","sequencenumber").attr("refX",15).attr("refY",15).attr("markerWidth",60).attr("markerHeight",40).attr("orient","auto").append("circle").attr("cx",15).attr("cy",15).attr("r",6)},w0=function(t){t.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")},ge=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}},v0=function(){return{x:0,y:0,fill:"#EDF2AE",stroke:"#666",width:100,anchor:"start",height:100,rx:0,ry:0}},Ht=function(){function t(s,l,n,h,r,u,b){const g=l.append("text").attr("x",n+r/2).attr("y",h+u/2+5).style("text-anchor","middle").text(s);i(g,b)}function e(s,l,n,h,r,u,b,g){const{actorFontSize:y,actorFontFamily:w,actorFontWeight:k}=g,[L,R]=te(y),N=s.split(v.lineBreakRegex);for(let $=0;$<N.length;$++){const O=$*L-L*(N.length-1)/2,F=l.append("text").attr("x",n+r/2).attr("y",h).style("text-anchor","middle").style("font-size",R).style("font-weight",k).style("font-family",w);F.append("tspan").attr("x",n+r/2).attr("dy",O).text(N[$]),F.attr("y",h+u/2).attr("dominant-baseline","central").attr("alignment-baseline","central"),i(F,b)}}function c(s,l,n,h,r,u,b,g){const y=l.append("switch"),w=y.append("foreignObject").attr("x",n).attr("y",h).attr("width",r).attr("height",u).append("xhtml:div").style("display","table").style("height","100%").style("width","100%");w.append("div").style("display","table-cell").style("text-align","center").style("vertical-align","middle").text(s),e(s,y,n,h,r,u,b,g),i(w,b)}async function a(s,l,n,h,r,u,b,g){const y=await Et(s,Ct()),w=l.append("switch"),k=w.append("foreignObject").attr("x",n+r/2-y.width/2).attr("y",h+u/2-y.height/2).attr("width",y.width).attr("height",y.height).append("xhtml:div").style("height","100%").style("width","100%");k.append("div").style("text-align","center").style("vertical-align","middle").html(await ee(s,Ct())),e(s,w,n,h,r,u,b,g),i(k,b)}function i(s,l){for(const n in l)l.hasOwnProperty(n)&&s.attr(n,l[n])}return function(s,l=!1){return l?a:s.textPlacement==="fo"?c:s.textPlacement==="old"?t:e}}(),_0=function(){function t(i,s,l,n,h,r,u){const b=s.append("text").attr("x",l).attr("y",n).style("text-anchor","start").text(i);a(b,u)}function e(i,s,l,n,h,r,u,b){const{actorFontSize:g,actorFontFamily:y,actorFontWeight:w}=b,k=i.split(v.lineBreakRegex);for(let L=0;L<k.length;L++){const R=L*g-g*(k.length-1)/2,N=s.append("text").attr("x",l).attr("y",n).style("text-anchor","start").style("font-size",g).style("font-weight",w).style("font-family",y);N.append("tspan").attr("x",l).attr("dy",R).text(k[L]),N.attr("y",n+r/2).attr("dominant-baseline","central").attr("alignment-baseline","central"),a(N,u)}}function c(i,s,l,n,h,r,u,b){const g=s.append("switch"),y=g.append("foreignObject").attr("x",l).attr("y",n).attr("width",h).attr("height",r).append("xhtml:div").style("display","table").style("height","100%").style("width","100%");y.append("div").style("display","table-cell").style("text-align","center").style("vertical-align","middle").text(i),e(i,g,l,n,h,r,u,b),a(y,u)}function a(i,s){for(const l in s)s.hasOwnProperty(l)&&i.attr(l,s[l])}return function(i){return i.textPlacement==="fo"?c:i.textPlacement==="old"?t:e}}(),D={drawRect:zt,drawText:bt,drawLabel:de,drawActor:p0,drawBox:h0,drawPopup:n0,anchorElement:g0,drawActivation:u0,drawLoop:x0,drawBackgroundRect:he,insertArrowHead:b0,insertArrowFilledHead:T0,insertSequenceNumber:E0,insertArrowCrossHead:w0,insertDatabaseIcon:y0,insertComputerIcon:m0,insertClockIcon:f0,getTextObj:ge,getNoteRect:v0,fixLifeLineHeights:pe,sanitizeUrl:Gt.sanitizeUrl};let o={};const x={data:{startx:void 0,stopx:void 0,starty:void 0,stopy:void 0},verticalPos:0,sequenceItems:[],activations:[],models:{getHeight:function(){return Math.max.apply(null,this.actors.length===0?[0]:this.actors.map(t=>t.height||0))+(this.loops.length===0?0:this.loops.map(t=>t.height||0).reduce((t,e)=>t+e))+(this.messages.length===0?0:this.messages.map(t=>t.height||0).reduce((t,e)=>t+e))+(this.notes.length===0?0:this.notes.map(t=>t.height||0).reduce((t,e)=>t+e))},clear:function(){this.actors=[],this.boxes=[],this.loops=[],this.messages=[],this.notes=[]},addBox:function(t){this.boxes.push(t)},addActor:function(t){this.actors.push(t)},addLoop:function(t){this.loops.push(t)},addMessage:function(t){this.messages.push(t)},addNote:function(t){this.notes.push(t)},lastActor:function(){return this.actors[this.actors.length-1]},lastLoop:function(){return this.loops[this.loops.length-1]},lastMessage:function(){return this.messages[this.messages.length-1]},lastNote:function(){return this.notes[this.notes.length-1]},actors:[],boxes:[],loops:[],messages:[],notes:[]},init:function(){this.sequenceItems=[],this.activations=[],this.models.clear(),this.data={startx:void 0,stopx:void 0,starty:void 0,stopy:void 0},this.verticalPos=0,xe(at())},updateVal:function(t,e,c,a){t[e]===void 0?t[e]=c:t[e]=a(c,t[e])},updateBounds:function(t,e,c,a){const i=this;let s=0;function l(n){return function(h){s++;const r=i.sequenceItems.length-s+1;i.updateVal(h,"starty",e-r*o.boxMargin,Math.min),i.updateVal(h,"stopy",a+r*o.boxMargin,Math.max),i.updateVal(x.data,"startx",t-r*o.boxMargin,Math.min),i.updateVal(x.data,"stopx",c+r*o.boxMargin,Math.max),n!=="activation"&&(i.updateVal(h,"startx",t-r*o.boxMargin,Math.min),i.updateVal(h,"stopx",c+r*o.boxMargin,Math.max),i.updateVal(x.data,"starty",e-r*o.boxMargin,Math.min),i.updateVal(x.data,"stopy",a+r*o.boxMargin,Math.max))}}this.sequenceItems.forEach(l()),this.activations.forEach(l("activation"))},insert:function(t,e,c,a){const i=v.getMin(t,c),s=v.getMax(t,c),l=v.getMin(e,a),n=v.getMax(e,a);this.updateVal(x.data,"startx",i,Math.min),this.updateVal(x.data,"starty",l,Math.min),this.updateVal(x.data,"stopx",s,Math.max),this.updateVal(x.data,"stopy",n,Math.max),this.updateBounds(i,l,s,n)},newActivation:function(t,e,c){const a=c[t.from.actor],i=Nt(t.from.actor).length||0,s=a.x+a.width/2+(i-1)*o.activationWidth/2;this.activations.push({startx:s,starty:this.verticalPos+2,stopx:s+o.activationWidth,stopy:void 0,actor:t.from.actor,anchored:D.anchorElement(e)})},endActivation:function(t){const e=this.activations.map(function(c){return c.actor}).lastIndexOf(t.from.actor);return this.activations.splice(e,1)[0]},createLoop:function(t={message:void 0,wrap:!1,width:void 0},e){return{startx:void 0,starty:this.verticalPos,stopx:void 0,stopy:void 0,title:t.message,wrap:t.wrap,width:t.width,height:0,fill:e}},newLoop:function(t={message:void 0,wrap:!1,width:void 0},e){this.sequenceItems.push(this.createLoop(t,e))},endLoop:function(){return this.sequenceItems.pop()},isLoopOverlap:function(){return this.sequenceItems.length?this.sequenceItems[this.sequenceItems.length-1].overlap:!1},addSectionToLoop:function(t){const e=this.sequenceItems.pop();e.sections=e.sections||[],e.sectionTitles=e.sectionTitles||[],e.sections.push({y:x.getVerticalPos(),height:0}),e.sectionTitles.push(t),this.sequenceItems.push(e)},saveVerticalPos:function(){this.isLoopOverlap()&&(this.savedVerticalPos=this.verticalPos)},resetVerticalPos:function(){this.isLoopOverlap()&&(this.verticalPos=this.savedVerticalPos)},bumpVerticalPos:function(t){this.verticalPos=this.verticalPos+t,this.data.stopy=v.getMax(this.data.stopy,this.verticalPos)},getVerticalPos:function(){return this.verticalPos},getBounds:function(){return{bounds:this.data,models:this.models}}},k0=async function(t,e){x.bumpVerticalPos(o.boxMargin),e.height=o.boxMargin,e.starty=x.getVerticalPos();const c=Mt();c.x=e.startx,c.y=e.starty,c.width=e.width||o.width,c.class="note";const a=t.append("g"),i=D.drawRect(a,c),s=qt();s.x=e.startx,s.y=e.starty,s.width=c.width,s.dy="1em",s.text=e.message,s.class="noteText",s.fontFamily=o.noteFontFamily,s.fontSize=o.noteFontSize,s.fontWeight=o.noteFontWeight,s.anchor=o.noteAlign,s.textMargin=o.noteMargin,s.valign="center";const l=nt(s.text)?await Lt(a,s):bt(a,s),n=Math.round(l.map(h=>(h._groups||h)[0][0].getBBox().height).reduce((h,r)=>h+r));i.attr("height",n+2*o.noteMargin),e.height+=n+2*o.noteMargin,x.bumpVerticalPos(n+2*o.noteMargin),e.stopy=e.starty+n+2*o.noteMargin,e.stopx=e.startx+c.width,x.insert(e.startx,e.starty,e.stopx,e.stopy),x.models.addNote(e)},yt=t=>({fontFamily:t.messageFontFamily,fontSize:t.messageFontSize,fontWeight:t.messageFontWeight}),ft=t=>({fontFamily:t.noteFontFamily,fontSize:t.noteFontSize,fontWeight:t.noteFontWeight}),Vt=t=>({fontFamily:t.actorFontFamily,fontSize:t.actorFontSize,fontWeight:t.actorFontWeight});async function P0(t,e){x.bumpVerticalPos(10);const{startx:c,stopx:a,message:i}=e,s=v.splitBreaks(i).length,l=nt(i),n=l?await Et(i,at()):C.calculateTextDimensions(i,yt(o));if(!l){const b=n.height/s;e.height+=b,x.bumpVerticalPos(b)}let h,r=n.height-10;const u=n.width;if(c===a){h=x.getVerticalPos()+r,o.rightAngles||(r+=o.boxMargin,h=x.getVerticalPos()+r),r+=30;const b=v.getMax(u/2,o.width/2);x.insert(c-b,x.getVerticalPos()-10+r,a+b,x.getVerticalPos()+30+r)}else r+=o.boxMargin,h=x.getVerticalPos()+r,x.insert(c,h-10,a,h);return x.bumpVerticalPos(r),e.height+=r,e.stopy=e.starty+e.height,x.insert(e.fromBounds,e.starty,e.toBounds,e.stopy),h}const L0=async function(t,e,c,a){const{startx:i,stopx:s,starty:l,message:n,type:h,sequenceIndex:r,sequenceVisible:u}=e,b=C.calculateTextDimensions(n,yt(o)),g=qt();g.x=i,g.y=l+10,g.width=s-i,g.class="messageText",g.dy="1em",g.text=n,g.fontFamily=o.messageFontFamily,g.fontSize=o.messageFontSize,g.fontWeight=o.messageFontWeight,g.anchor=o.messageAlign,g.valign="center",g.textMargin=o.wrapPadding,g.tspan=!1,nt(g.text)?await Lt(t,g,{startx:i,stopx:s,starty:c}):bt(t,g);const y=b.width;let w;i===s?o.rightAngles?w=t.append("path").attr("d",`M ${i},${c} H ${i+v.getMax(o.width/2,y/2)} V ${c+25} H ${i}`):w=t.append("path").attr("d","M "+i+","+c+" C "+(i+60)+","+(c-10)+" "+(i+60)+","+(c+30)+" "+i+","+(c+20)):(w=t.append("line"),w.attr("x1",i),w.attr("y1",c),w.attr("x2",s),w.attr("y2",c)),h===a.db.LINETYPE.DOTTED||h===a.db.LINETYPE.DOTTED_CROSS||h===a.db.LINETYPE.DOTTED_POINT||h===a.db.LINETYPE.DOTTED_OPEN?(w.style("stroke-dasharray","3, 3"),w.attr("class","messageLine1")):w.attr("class","messageLine0");let k="";o.arrowMarkerAbsolute&&(k=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,k=k.replace(/\(/g,"\\("),k=k.replace(/\)/g,"\\)")),w.attr("stroke-width",2),w.attr("stroke","none"),w.style("fill","none"),(h===a.db.LINETYPE.SOLID||h===a.db.LINETYPE.DOTTED)&&w.attr("marker-end","url("+k+"#arrowhead)"),(h===a.db.LINETYPE.SOLID_POINT||h===a.db.LINETYPE.DOTTED_POINT)&&w.attr("marker-end","url("+k+"#filled-head)"),(h===a.db.LINETYPE.SOLID_CROSS||h===a.db.LINETYPE.DOTTED_CROSS)&&w.attr("marker-end","url("+k+"#crosshead)"),(u||o.showSequenceNumbers)&&(w.attr("marker-start","url("+k+"#sequencenumber)"),t.append("text").attr("x",i).attr("y",c+4).attr("font-family","sans-serif").attr("font-size","12px").attr("text-anchor","middle").attr("class","sequenceNumber").text(r))},I0=async function(t,e,c,a,i,s,l){let n=0,h=0,r,u=0;for(const b of a){const g=e[b],y=g.box;r&&r!=y&&(x.models.addBox(r),h+=o.boxMargin+r.margin),y&&y!=r&&(y.x=n+h,y.y=i,h+=y.margin),g.width=g.width||o.width,g.height=v.getMax(g.height||o.height,o.height),g.margin=g.margin||o.actorMargin,u=v.getMax(u,g.height),c[g.name]&&(h+=g.width/2),g.x=n+h,g.starty=x.getVerticalPos(),x.insert(g.x,i,g.x+g.width,g.height),n+=g.width+h,g.box&&(g.box.width=n+y.margin-g.box.x),h=g.margin,r=g.box,x.models.addActor(g)}r&&x.models.addBox(r),x.bumpVerticalPos(u)},Ft=async function(t,e,c,a){if(a){let i=0;x.bumpVerticalPos(o.boxMargin*2);for(const s of c){const l=e[s];l.stopy||(l.stopy=x.getVerticalPos());const n=await D.drawActor(t,l,o,!0);i=v.getMax(i,n)}x.bumpVerticalPos(i+o.boxMargin)}else for(const i of c){const s=e[i];await D.drawActor(t,s,o,!1)}},ue=function(t,e,c,a){let i=0,s=0;for(const l of c){const n=e[l],h=O0(n),r=D.drawPopup(t,n,h,o,o.forceMenus,a);r.height>i&&(i=r.height),r.width+n.x>s&&(s=r.width+n.x)}return{maxHeight:i,maxWidth:s}},xe=function(t){Le(o,t),t.fontFamily&&(o.actorFontFamily=o.noteFontFamily=o.messageFontFamily=t.fontFamily),t.fontSize&&(o.actorFontSize=o.noteFontSize=o.messageFontSize=t.fontSize),t.fontWeight&&(o.actorFontWeight=o.noteFontWeight=o.messageFontWeight=t.fontWeight)},Nt=function(t){return x.activations.filter(function(e){return e.actor===t})},Qt=function(t,e){const c=e[t],a=Nt(t),i=a.reduce(function(l,n){return v.getMin(l,n.startx)},c.x+c.width/2-1),s=a.reduce(function(l,n){return v.getMax(l,n.stopx)},c.x+c.width/2+1);return[i,s]};function it(t,e,c,a,i){x.bumpVerticalPos(c);let s=a;if(e.id&&e.message&&t[e.id]){const l=t[e.id].width,n=yt(o);e.message=C.wrapLabel(`[${e.message}]`,l-2*o.wrapPadding,n),e.width=l,e.wrap=!0;const h=C.calculateTextDimensions(e.message,n),r=v.getMax(h.height,o.labelBoxHeight);s=a+r,K.debug(`${r} - ${e.message}`)}i(e),x.bumpVerticalPos(s)}function M0(t,e,c,a,i,s,l){function n(r,u){r.x<i[t.from].x?(x.insert(e.stopx-u,e.starty,e.startx,e.stopy+r.height/2+o.noteMargin),e.stopx=e.stopx+u):(x.insert(e.startx,e.starty,e.stopx+u,e.stopy+r.height/2+o.noteMargin),e.stopx=e.stopx-u)}function h(r,u){r.x<i[t.to].x?(x.insert(e.startx-u,e.starty,e.stopx,e.stopy+r.height/2+o.noteMargin),e.startx=e.startx+u):(x.insert(e.stopx,e.starty,e.startx+u,e.stopy+r.height/2+o.noteMargin),e.startx=e.startx-u)}if(s[t.to]==a){const r=i[t.to],u=r.type=="actor"?ut/2+3:r.width/2+3;n(r,u),r.starty=c-r.height/2,x.bumpVerticalPos(r.height/2)}else if(l[t.from]==a){const r=i[t.from];if(o.mirrorActors){const u=r.type=="actor"?ut/2:r.width/2;h(r,u)}r.stopy=c-r.height/2,x.bumpVerticalPos(r.height/2)}else if(l[t.to]==a){const r=i[t.to];if(o.mirrorActors){const u=r.type=="actor"?ut/2+3:r.width/2+3;n(r,u)}r.stopy=c-r.height/2,x.bumpVerticalPos(r.height/2)}}const N0=async function(t,e,c,a){const{securityLevel:i,sequence:s}=at();o=s;let l;i==="sandbox"&&(l=Pt("#i"+e));const n=i==="sandbox"?Pt(l.nodes()[0].contentDocument.body):Pt("body"),h=i==="sandbox"?l.nodes()[0].contentDocument:document;x.init(),K.debug(a.db);const r=i==="sandbox"?n.select(`[id="${e}"]`):Pt(`[id="${e}"]`),u=a.db.getActors(),b=a.db.getCreatedActors(),g=a.db.getDestroyedActors(),y=a.db.getBoxes();let w=a.db.getActorKeys();const k=a.db.getMessages(),L=a.db.getDiagramTitle(),R=a.db.hasAtLeastOneBox(),N=a.db.hasAtLeastOneBoxWithTitle(),$=await A0(u,k,a);if(o.height=await S0(u,$,y),D.insertComputerIcon(r),D.insertDatabaseIcon(r),D.insertClockIcon(r),R&&(x.bumpVerticalPos(o.boxMargin),N&&x.bumpVerticalPos(y[0].textMaxHeight)),o.hideUnusedParticipants===!0){const m=new Set;k.forEach(P=>{m.add(P.from),m.add(P.to)}),w=w.filter(P=>m.has(P))}await I0(r,u,b,w,0);const O=await $0(k,u,$,a);D.insertArrowHead(r),D.insertArrowCrossHead(r),D.insertArrowFilledHead(r),D.insertSequenceNumber(r);function F(m,P){const Z=x.endActivation(m);Z.starty+18>P&&(Z.starty=P-6,P+=12),D.drawActivation(r,Z,P,o,Nt(m.from.actor).length),x.insert(Z.startx,P-10,Z.stopx,P)}let q=1,X=1;const G=[],W=[];let z=0;for(const m of k){let P,Z,rt;switch(m.type){case a.db.LINETYPE.NOTE:x.resetVerticalPos(),Z=m.noteModel,await k0(r,Z);break;case a.db.LINETYPE.ACTIVE_START:x.newActivation(m,r,u);break;case a.db.LINETYPE.ACTIVE_END:F(m,x.getVerticalPos());break;case a.db.LINETYPE.LOOP_START:it(O,m,o.boxMargin,o.boxMargin+o.boxTextMargin,I=>x.newLoop(I));break;case a.db.LINETYPE.LOOP_END:P=x.endLoop(),await D.drawLoop(r,P,"loop",o),x.bumpVerticalPos(P.stopy-x.getVerticalPos()),x.models.addLoop(P);break;case a.db.LINETYPE.RECT_START:it(O,m,o.boxMargin,o.boxMargin,I=>x.newLoop(void 0,I.message));break;case a.db.LINETYPE.RECT_END:P=x.endLoop(),W.push(P),x.models.addLoop(P),x.bumpVerticalPos(P.stopy-x.getVerticalPos());break;case a.db.LINETYPE.OPT_START:it(O,m,o.boxMargin,o.boxMargin+o.boxTextMargin,I=>x.newLoop(I));break;case a.db.LINETYPE.OPT_END:P=x.endLoop(),await D.drawLoop(r,P,"opt",o),x.bumpVerticalPos(P.stopy-x.getVerticalPos()),x.models.addLoop(P);break;case a.db.LINETYPE.ALT_START:it(O,m,o.boxMargin,o.boxMargin+o.boxTextMargin,I=>x.newLoop(I));break;case a.db.LINETYPE.ALT_ELSE:it(O,m,o.boxMargin+o.boxTextMargin,o.boxMargin,I=>x.addSectionToLoop(I));break;case a.db.LINETYPE.ALT_END:P=x.endLoop(),await D.drawLoop(r,P,"alt",o),x.bumpVerticalPos(P.stopy-x.getVerticalPos()),x.models.addLoop(P);break;case a.db.LINETYPE.PAR_START:case a.db.LINETYPE.PAR_OVER_START:it(O,m,o.boxMargin,o.boxMargin+o.boxTextMargin,I=>x.newLoop(I)),x.saveVerticalPos();break;case a.db.LINETYPE.PAR_AND:it(O,m,o.boxMargin+o.boxTextMargin,o.boxMargin,I=>x.addSectionToLoop(I));break;case a.db.LINETYPE.PAR_END:P=x.endLoop(),await D.drawLoop(r,P,"par",o),x.bumpVerticalPos(P.stopy-x.getVerticalPos()),x.models.addLoop(P);break;case a.db.LINETYPE.AUTONUMBER:q=m.message.start||q,X=m.message.step||X,m.message.visible?a.db.enableSequenceNumbers():a.db.disableSequenceNumbers();break;case a.db.LINETYPE.CRITICAL_START:it(O,m,o.boxMargin,o.boxMargin+o.boxTextMargin,I=>x.newLoop(I));break;case a.db.LINETYPE.CRITICAL_OPTION:it(O,m,o.boxMargin+o.boxTextMargin,o.boxMargin,I=>x.addSectionToLoop(I));break;case a.db.LINETYPE.CRITICAL_END:P=x.endLoop(),await D.drawLoop(r,P,"critical",o),x.bumpVerticalPos(P.stopy-x.getVerticalPos()),x.models.addLoop(P);break;case a.db.LINETYPE.BREAK_START:it(O,m,o.boxMargin,o.boxMargin+o.boxTextMargin,I=>x.newLoop(I));break;case a.db.LINETYPE.BREAK_END:P=x.endLoop(),await D.drawLoop(r,P,"break",o),x.bumpVerticalPos(P.stopy-x.getVerticalPos()),x.models.addLoop(P);break;default:try{rt=m.msgModel,rt.starty=x.getVerticalPos(),rt.sequenceIndex=q,rt.sequenceVisible=a.db.showSequenceNumbers();const I=await P0(r,rt);M0(m,rt,I,z,u,b,g),G.push({messageModel:rt,lineStartY:I}),x.models.addMessage(rt)}catch(I){K.error("error while drawing message",I)}}[a.db.LINETYPE.SOLID_OPEN,a.db.LINETYPE.DOTTED_OPEN,a.db.LINETYPE.SOLID,a.db.LINETYPE.DOTTED,a.db.LINETYPE.SOLID_CROSS,a.db.LINETYPE.DOTTED_CROSS,a.db.LINETYPE.SOLID_POINT,a.db.LINETYPE.DOTTED_POINT].includes(m.type)&&(q=q+X),z++}K.debug("createdActors",b),K.debug("destroyedActors",g),await Ft(r,u,w,!1);for(const m of G)await L0(r,m.messageModel,m.lineStartY,a);o.mirrorActors&&await Ft(r,u,w,!0),W.forEach(m=>D.drawBackgroundRect(r,m)),pe(r,u,w,o);for(const m of x.models.boxes)m.height=x.getVerticalPos()-m.y,x.insert(m.x,m.y,m.x+m.width,m.height),m.startx=m.x,m.starty=m.y,m.stopx=m.startx+m.width,m.stopy=m.starty+m.height,m.stroke="rgb(0,0,0, 0.5)",await D.drawBox(r,m,o);R&&x.bumpVerticalPos(o.boxMargin);const B=ue(r,u,w,h),{bounds:V}=x.getBounds();let J=V.stopy-V.starty;J<B.maxHeight&&(J=B.maxHeight);let H=J+2*o.diagramMarginY;o.mirrorActors&&(H=H-o.boxMargin+o.bottomMarginAdj);let Q=V.stopx-V.startx;Q<B.maxWidth&&(Q=B.maxWidth);const tt=Q+2*o.diagramMarginX;L&&r.append("text").text(L).attr("x",(V.stopx-V.startx)/2-2*o.diagramMarginX).attr("y",-25),Pe(r,H,tt,o.useMaxWidth);const M=L?40:0;r.attr("viewBox",V.startx-o.diagramMarginX+" -"+(o.diagramMarginY+M)+" "+tt+" "+(H+M)),K.debug("models:",x.models)};async function A0(t,e,c){const a={};for(const i of e)if(t[i.to]&&t[i.from]){const s=t[i.to];if(i.placement===c.db.PLACEMENT.LEFTOF&&!s.prevActor||i.placement===c.db.PLACEMENT.RIGHTOF&&!s.nextActor)continue;const l=i.placement!==void 0,n=!l,h=l?ft(o):yt(o),r=i.wrap?C.wrapLabel(i.message,o.width-2*o.wrapPadding,h):i.message,u=(nt(r)?await Et(i.message,at()):C.calculateTextDimensions(r,h)).width+2*o.wrapPadding;n&&i.from===s.nextActor?a[i.to]=v.getMax(a[i.to]||0,u):n&&i.from===s.prevActor?a[i.from]=v.getMax(a[i.from]||0,u):n&&i.from===i.to?(a[i.from]=v.getMax(a[i.from]||0,u/2),a[i.to]=v.getMax(a[i.to]||0,u/2)):i.placement===c.db.PLACEMENT.RIGHTOF?a[i.from]=v.getMax(a[i.from]||0,u):i.placement===c.db.PLACEMENT.LEFTOF?a[s.prevActor]=v.getMax(a[s.prevActor]||0,u):i.placement===c.db.PLACEMENT.OVER&&(s.prevActor&&(a[s.prevActor]=v.getMax(a[s.prevActor]||0,u/2)),s.nextActor&&(a[i.from]=v.getMax(a[i.from]||0,u/2)))}return K.debug("maxMessageWidthPerActor:",a),a}const O0=function(t){let e=0;const c=Vt(o);for(const a in t.links){const i=C.calculateTextDimensions(a,c).width+2*o.wrapPadding+2*o.boxMargin;e<i&&(e=i)}return e};async function S0(t,e,c){let a=0;for(const s of Object.keys(t)){const l=t[s];l.wrap&&(l.description=C.wrapLabel(l.description,o.width-2*o.wrapPadding,Vt(o)));const n=nt(l.description)?await Et(l.description,at()):C.calculateTextDimensions(l.description,Vt(o));l.width=l.wrap?o.width:v.getMax(o.width,n.width+2*o.wrapPadding),l.height=l.wrap?v.getMax(n.height,o.height):o.height,a=v.getMax(a,l.height)}for(const s in e){const l=t[s];if(!l)continue;const n=t[l.nextActor];if(!n){const r=e[s]+o.actorMargin-l.width/2;l.margin=v.getMax(r,o.actorMargin);continue}const h=e[s]+o.actorMargin-l.width/2-n.width/2;l.margin=v.getMax(h,o.actorMargin)}let i=0;return c.forEach(s=>{const l=yt(o);let n=s.actorKeys.reduce((u,b)=>u+=t[b].width+(t[b].margin||0),0);n-=2*o.boxTextMargin,s.wrap&&(s.name=C.wrapLabel(s.name,n-2*o.wrapPadding,l));const h=C.calculateTextDimensions(s.name,l);i=v.getMax(h.height,i);const r=v.getMax(n,h.width+2*o.wrapPadding);if(s.margin=o.boxTextMargin,n<r){const u=(r-n)/2;s.margin+=u}}),c.forEach(s=>s.textMaxHeight=i),v.getMax(a,o.height)}const D0=async function(t,e,c){const a=e[t.from].x,i=e[t.to].x,s=t.wrap&&t.message;let l=nt(t.message)?await Et(t.message,at()):C.calculateTextDimensions(s?C.wrapLabel(t.message,o.width,ft(o)):t.message,ft(o));const n={width:s?o.width:v.getMax(o.width,l.width+2*o.noteMargin),height:0,startx:e[t.from].x,stopx:0,starty:0,stopy:0,message:t.message};return t.placement===c.db.PLACEMENT.RIGHTOF?(n.width=s?v.getMax(o.width,l.width):v.getMax(e[t.from].width/2+e[t.to].width/2,l.width+2*o.noteMargin),n.startx=a+(e[t.from].width+o.actorMargin)/2):t.placement===c.db.PLACEMENT.LEFTOF?(n.width=s?v.getMax(o.width,l.width+2*o.noteMargin):v.getMax(e[t.from].width/2+e[t.to].width/2,l.width+2*o.noteMargin),n.startx=a-n.width+(e[t.from].width-o.actorMargin)/2):t.to===t.from?(l=C.calculateTextDimensions(s?C.wrapLabel(t.message,v.getMax(o.width,e[t.from].width),ft(o)):t.message,ft(o)),n.width=s?v.getMax(o.width,e[t.from].width):v.getMax(e[t.from].width,o.width,l.width+2*o.noteMargin),n.startx=a+(e[t.from].width-n.width)/2):(n.width=Math.abs(a+e[t.from].width/2-(i+e[t.to].width/2))+o.actorMargin,n.startx=a<i?a+e[t.from].width/2-o.actorMargin/2:i+e[t.to].width/2-o.actorMargin/2),s&&(n.message=C.wrapLabel(t.message,n.width-2*o.wrapPadding,ft(o))),K.debug(`NM:[${n.startx},${n.stopx},${n.starty},${n.stopy}:${n.width},${n.height}=${t.message}]`),n},R0=function(t,e,c){if(![c.db.LINETYPE.SOLID_OPEN,c.db.LINETYPE.DOTTED_OPEN,c.db.LINETYPE.SOLID,c.db.LINETYPE.DOTTED,c.db.LINETYPE.SOLID_CROSS,c.db.LINETYPE.DOTTED_CROSS,c.db.LINETYPE.SOLID_POINT,c.db.LINETYPE.DOTTED_POINT].includes(t.type))return{};const[a,i]=Qt(t.from,e),[s,l]=Qt(t.to,e),n=a<=s,h=n?i:a;let r=n?s:l;const u=Math.abs(s-l)>2,b=k=>n?-k:k;t.from===t.to?r=h:(t.activate&&!u&&(r+=b(o.activationWidth/2-1)),[c.db.LINETYPE.SOLID_OPEN,c.db.LINETYPE.DOTTED_OPEN].includes(t.type)||(r+=b(3)));const g=[a,i,s,l],y=Math.abs(h-r);t.wrap&&t.message&&(t.message=C.wrapLabel(t.message,v.getMax(y+2*o.wrapPadding,o.width),yt(o)));const w=C.calculateTextDimensions(t.message,yt(o));return{width:v.getMax(t.wrap?0:w.width+2*o.wrapPadding,y+2*o.wrapPadding,o.width),height:0,startx:h,stopx:r,starty:0,stopy:0,message:t.message,type:t.type,wrap:t.wrap,fromBounds:Math.min.apply(null,g),toBounds:Math.max.apply(null,g)}},$0=async function(t,e,c,a){const i={},s=[];let l,n,h;for(const r of t){switch(r.id=C.random({length:10}),r.type){case a.db.LINETYPE.LOOP_START:case a.db.LINETYPE.ALT_START:case a.db.LINETYPE.OPT_START:case a.db.LINETYPE.PAR_START:case a.db.LINETYPE.PAR_OVER_START:case a.db.LINETYPE.CRITICAL_START:case a.db.LINETYPE.BREAK_START:s.push({id:r.id,msg:r.message,from:Number.MAX_SAFE_INTEGER,to:Number.MIN_SAFE_INTEGER,width:0});break;case a.db.LINETYPE.ALT_ELSE:case a.db.LINETYPE.PAR_AND:case a.db.LINETYPE.CRITICAL_OPTION:r.message&&(l=s.pop(),i[l.id]=l,i[r.id]=l,s.push(l));break;case a.db.LINETYPE.LOOP_END:case a.db.LINETYPE.ALT_END:case a.db.LINETYPE.OPT_END:case a.db.LINETYPE.PAR_END:case a.db.LINETYPE.CRITICAL_END:case a.db.LINETYPE.BREAK_END:l=s.pop(),i[l.id]=l;break;case a.db.LINETYPE.ACTIVE_START:{const u=e[r.from?r.from.actor:r.to.actor],b=Nt(r.from?r.from.actor:r.to.actor).length,g=u.x+u.width/2+(b-1)*o.activationWidth/2,y={startx:g,stopx:g+o.activationWidth,actor:r.from.actor,enabled:!0};x.activations.push(y)}break;case a.db.LINETYPE.ACTIVE_END:{const u=x.activations.map(b=>b.actor).lastIndexOf(r.from.actor);delete x.activations.splice(u,1)[0]}break}r.placement!==void 0?(n=await D0(r,e,a),r.noteModel=n,s.forEach(u=>{l=u,l.from=v.getMin(l.from,n.startx),l.to=v.getMax(l.to,n.startx+n.width),l.width=v.getMax(l.width,Math.abs(l.from-l.to))-o.labelBoxWidth})):(h=R0(r,e,a),r.msgModel=h,h.startx&&h.stopx&&s.length>0&&s.forEach(u=>{if(l=u,h.startx===h.stopx){const b=e[r.from],g=e[r.to];l.from=v.getMin(b.x-h.width/2,b.x-b.width/2,l.from),l.to=v.getMax(g.x+h.width/2,g.x+b.width/2,l.to),l.width=v.getMax(l.width,Math.abs(l.to-l.from))-o.labelBoxWidth}else l.from=v.getMin(h.startx,l.from),l.to=v.getMax(h.stopx,l.to),l.width=v.getMax(l.width,h.width)-o.labelBoxWidth}))}return x.activations=[],K.debug("Loop type widths:",i),i},C0={bounds:x,drawActors:Ft,drawActorsPopup:ue,setConf:xe,draw:N0},V0={parser:De,db:Jt,renderer:C0,styles:o0,init:({wrap:t})=>{Jt.setWrap(t)}};export{V0 as diagram};
122
+ `,o0=i0,ut=36,ce="actor-top",le="actor-bottom",zt=function(t,e){return Ae(t,e)},n0=function(t,e,c,a,i){if(e.links===void 0||e.links===null||Object.keys(e.links).length===0)return{height:0,width:0};const s=e.links,l=e.actorCnt,n=e.rectData;var h="none";i&&(h="block !important");const r=t.append("g");r.attr("id","actor"+l+"_popup"),r.attr("class","actorPopupMenu"),r.attr("display",h);var u="";n.class!==void 0&&(u=" "+n.class);let b=n.width>c?n.width:c;const g=r.append("rect");if(g.attr("class","actorPopupMenuPanel"+u),g.attr("x",n.x),g.attr("y",n.height),g.attr("fill",n.fill),g.attr("stroke",n.stroke),g.attr("width",b),g.attr("height",n.height),g.attr("rx",n.rx),g.attr("ry",n.ry),s!=null){var y=20;for(let L in s){var w=r.append("a"),P=Gt.sanitizeUrl(s[L]);w.attr("xlink:href",P),w.attr("target","_blank"),_0(a)(L,w,n.x+10,n.height+y,b,20,{class:"actor"},a),y+=30}}return g.attr("height",y),{height:n.height+y,width:b}},c0=function(t){return"var pu = document.getElementById('"+t+"'); if (pu != null) { pu.style.display = pu.style.display == 'block' ? 'none' : 'block'; }"},Lt=async function(t,e,c=null){let a=t.append("foreignObject");const i=await ee(e.text,$t()),s=a.append("xhtml:div").attr("style","width: fit-content;").attr("xmlns","http://www.w3.org/1999/xhtml").html(i).node().getBoundingClientRect();if(a.attr("height",Math.round(s.height)).attr("width",Math.round(s.width)),e.class==="noteText"){const l=t.node().firstChild;l.setAttribute("height",s.height+2*e.textMargin);const n=l.getBBox();a.attr("x",Math.round(n.x+n.width/2-s.width/2)).attr("y",Math.round(n.y+n.height/2-s.height/2))}else if(c){let{startx:l,stopx:n,starty:h}=c;if(l>n){const r=l;l=n,n=r}a.attr("x",Math.round(l+Math.abs(l-n)/2-s.width/2)),e.class==="loopText"?a.attr("y",Math.round(h)):a.attr("y",Math.round(h-s.height))}return[a]},bt=function(t,e){let c=0,a=0;const i=e.text.split(v.lineBreakRegex),[s,l]=te(e.fontSize);let n=[],h=0,r=()=>e.y;if(e.valign!==void 0&&e.textMargin!==void 0&&e.textMargin>0)switch(e.valign){case"top":case"start":r=()=>Math.round(e.y+e.textMargin);break;case"middle":case"center":r=()=>Math.round(e.y+(c+a+e.textMargin)/2);break;case"bottom":case"end":r=()=>Math.round(e.y+(c+a+2*e.textMargin)-e.textMargin);break}if(e.anchor!==void 0&&e.textMargin!==void 0&&e.width!==void 0)switch(e.anchor){case"left":case"start":e.x=Math.round(e.x+e.textMargin),e.anchor="start",e.dominantBaseline="middle",e.alignmentBaseline="middle";break;case"middle":case"center":e.x=Math.round(e.x+e.width/2),e.anchor="middle",e.dominantBaseline="middle",e.alignmentBaseline="middle";break;case"right":case"end":e.x=Math.round(e.x+e.width-e.textMargin),e.anchor="end",e.dominantBaseline="middle",e.alignmentBaseline="middle";break}for(let[u,b]of i.entries()){e.textMargin!==void 0&&e.textMargin===0&&s!==void 0&&(h=u*s);const g=t.append("text");g.attr("x",e.x),g.attr("y",r()),e.anchor!==void 0&&g.attr("text-anchor",e.anchor).attr("dominant-baseline",e.dominantBaseline).attr("alignment-baseline",e.alignmentBaseline),e.fontFamily!==void 0&&g.style("font-family",e.fontFamily),l!==void 0&&g.style("font-size",l),e.fontWeight!==void 0&&g.style("font-weight",e.fontWeight),e.fill!==void 0&&g.attr("fill",e.fill),e.class!==void 0&&g.attr("class",e.class),e.dy!==void 0?g.attr("dy",e.dy):h!==0&&g.attr("dy",h);const y=b||Me;if(e.tspan){const w=g.append("tspan");w.attr("x",e.x),e.fill!==void 0&&w.attr("fill",e.fill),w.text(y)}else g.text(y);e.valign!==void 0&&e.textMargin!==void 0&&e.textMargin>0&&(a+=(g._groups||g)[0][0].getBBox().height,c=a),n.push(g)}return n},de=function(t,e){function c(i,s,l,n,h){return i+","+s+" "+(i+l)+","+s+" "+(i+l)+","+(s+n-h)+" "+(i+l-h*1.2)+","+(s+n)+" "+i+","+(s+n)}const a=t.append("polygon");return a.attr("points",c(e.x,e.y,e.width,e.height,7)),a.attr("class","labelBox"),e.y=e.y+e.height/2,bt(t,e),a};let ot=-1;const pe=(t,e,c,a)=>{t.select&&c.forEach(i=>{const s=e[i],l=t.select("#actor"+s.actorCnt);!a.mirrorActors&&s.stopy?l.attr("y2",s.stopy+s.height/2):a.mirrorActors&&l.attr("y2",s.stopy)})},l0=async function(t,e,c,a){const i=a?e.stopy:e.starty,s=e.x+e.width/2,l=i+5,n=t.append("g").lower();var h=n;a||(ot++,Object.keys(e.links||{}).length&&!c.forceMenus&&h.attr("onclick",c0(`actor${ot}_popup`)).attr("cursor","pointer"),h.append("line").attr("id","actor"+ot).attr("x1",s).attr("y1",l).attr("x2",s).attr("y2",2e3).attr("class","actor-line").attr("class","200").attr("stroke-width","0.5px").attr("stroke","#999"),h=n.append("g"),e.actorCnt=ot,e.links!=null&&h.attr("id","root-"+ot));const r=Mt();var u="actor";e.properties!=null&&e.properties.class?u=e.properties.class:r.fill="#eaeaea",a?u+=` ${le}`:u+=` ${ce}`,r.x=e.x,r.y=i,r.width=e.width,r.height=e.height,r.class=u,r.rx=3,r.ry=3,r.name=e.name;const b=zt(h,r);if(e.rectData=r,e.properties!=null&&e.properties.icon){const y=e.properties.icon.trim();y.charAt(0)==="@"?Oe(h,r.x+r.width-20,r.y+10,y.substr(1)):Se(h,r.x+r.width-20,r.y+10,y)}await Ht(c,nt(e.description))(e.description,h,r.x,r.y,r.width,r.height,{class:"actor"},c);let g=e.height;if(b.node){const y=b.node().getBBox();e.height=y.height,g=y.height}return g},d0=async function(t,e,c,a){const i=a?e.stopy:e.starty,s=e.x+e.width/2,l=i+80;t.lower(),a||(ot++,t.append("line").attr("id","actor"+ot).attr("x1",s).attr("y1",l).attr("x2",s).attr("y2",2e3).attr("class","actor-line").attr("class","200").attr("stroke-width","0.5px").attr("stroke","#999"),e.actorCnt=ot);const n=t.append("g");let h="actor-man";a?h+=` ${le}`:h+=` ${ce}`,n.attr("class",h),n.attr("name",e.name);const r=Mt();r.x=e.x,r.y=i,r.fill="#eaeaea",r.width=e.width,r.height=e.height,r.class="actor",r.rx=3,r.ry=3,n.append("line").attr("id","actor-man-torso"+ot).attr("x1",s).attr("y1",i+25).attr("x2",s).attr("y2",i+45),n.append("line").attr("id","actor-man-arms"+ot).attr("x1",s-ut/2).attr("y1",i+33).attr("x2",s+ut/2).attr("y2",i+33),n.append("line").attr("x1",s-ut/2).attr("y1",i+60).attr("x2",s).attr("y2",i+45),n.append("line").attr("x1",s).attr("y1",i+45).attr("x2",s+ut/2-2).attr("y2",i+60);const u=n.append("circle");u.attr("cx",e.x+e.width/2),u.attr("cy",i+10),u.attr("r",15),u.attr("width",e.width),u.attr("height",e.height);const b=n.node().getBBox();return e.height=b.height,await Ht(c,nt(e.description))(e.description,n,r.x,r.y+35,r.width,r.height,{class:"actor"},c),e.height},p0=async function(t,e,c,a){switch(e.type){case"actor":return await d0(t,e,c,a);case"participant":return await l0(t,e,c,a)}},h0=async function(t,e,c){const a=t.append("g");he(a,e),e.name&&await Ht(c)(e.name,a,e.x,e.y+(e.textMaxHeight||0)/2,e.width,0,{class:"text"},c),a.lower()},g0=function(t){return t.append("g")},u0=function(t,e,c,a,i){const s=Mt(),l=e.anchored;s.x=e.startx,s.y=e.starty,s.class="activation"+i%3,s.width=e.stopx-e.startx,s.height=c-e.starty,zt(l,s)},x0=async function(t,e,c,a){const{boxMargin:i,boxTextMargin:s,labelBoxHeight:l,labelBoxWidth:n,messageFontFamily:h,messageFontSize:r,messageFontWeight:u}=a,b=t.append("g"),g=function(P,L,R,N){return b.append("line").attr("x1",P).attr("y1",L).attr("x2",R).attr("y2",N).attr("class","loopLine")};g(e.startx,e.starty,e.stopx,e.starty),g(e.stopx,e.starty,e.stopx,e.stopy),g(e.startx,e.stopy,e.stopx,e.stopy),g(e.startx,e.starty,e.startx,e.stopy),e.sections!==void 0&&e.sections.forEach(function(P){g(e.startx,P.y,e.stopx,P.y).style("stroke-dasharray","3, 3")});let y=Wt();y.text=c,y.x=e.startx,y.y=e.starty,y.fontFamily=h,y.fontSize=r,y.fontWeight=u,y.anchor="middle",y.valign="middle",y.tspan=!1,y.width=n||50,y.height=l||20,y.textMargin=s,y.class="labelText",de(b,y),y=ge(),y.text=e.title,y.x=e.startx+n/2+(e.stopx-e.startx)/2,y.y=e.starty+i+s,y.anchor="middle",y.valign="middle",y.textMargin=s,y.class="loopText",y.fontFamily=h,y.fontSize=r,y.fontWeight=u,y.wrap=!0;let w=nt(y.text)?await Lt(b,y,e):bt(b,y);if(e.sectionTitles!==void 0){for(const[P,L]of Object.entries(e.sectionTitles))if(L.message){y.text=L.message,y.x=e.startx+(e.stopx-e.startx)/2,y.y=e.sections[P].y+i+s,y.class="loopText",y.anchor="middle",y.valign="middle",y.tspan=!1,y.fontFamily=h,y.fontSize=r,y.fontWeight=u,y.wrap=e.wrap,nt(y.text)?(e.starty=e.sections[P].y,await Lt(b,y,e)):bt(b,y);let R=Math.round(w.map(N=>(N._groups||N)[0][0].getBBox().height).reduce((N,C)=>N+C));e.sections[P].height+=R-(i+s)}}return e.height=Math.round(e.stopy-e.starty),b},he=function(t,e){Ne(t,e)},y0=function(t){t.append("defs").append("symbol").attr("id","database").attr("fill-rule","evenodd").attr("clip-rule","evenodd").append("path").attr("transform","scale(.5)").attr("d","M12.258.001l.256.004.255.005.253.008.251.01.249.012.247.015.246.016.242.019.241.02.239.023.236.024.233.027.231.028.229.031.225.032.223.034.22.036.217.038.214.04.211.041.208.043.205.045.201.046.198.048.194.05.191.051.187.053.183.054.18.056.175.057.172.059.168.06.163.061.16.063.155.064.15.066.074.033.073.033.071.034.07.034.069.035.068.035.067.035.066.035.064.036.064.036.062.036.06.036.06.037.058.037.058.037.055.038.055.038.053.038.052.038.051.039.05.039.048.039.047.039.045.04.044.04.043.04.041.04.04.041.039.041.037.041.036.041.034.041.033.042.032.042.03.042.029.042.027.042.026.043.024.043.023.043.021.043.02.043.018.044.017.043.015.044.013.044.012.044.011.045.009.044.007.045.006.045.004.045.002.045.001.045v17l-.001.045-.002.045-.004.045-.006.045-.007.045-.009.044-.011.045-.012.044-.013.044-.015.044-.017.043-.018.044-.02.043-.021.043-.023.043-.024.043-.026.043-.027.042-.029.042-.03.042-.032.042-.033.042-.034.041-.036.041-.037.041-.039.041-.04.041-.041.04-.043.04-.044.04-.045.04-.047.039-.048.039-.05.039-.051.039-.052.038-.053.038-.055.038-.055.038-.058.037-.058.037-.06.037-.06.036-.062.036-.064.036-.064.036-.066.035-.067.035-.068.035-.069.035-.07.034-.071.034-.073.033-.074.033-.15.066-.155.064-.16.063-.163.061-.168.06-.172.059-.175.057-.18.056-.183.054-.187.053-.191.051-.194.05-.198.048-.201.046-.205.045-.208.043-.211.041-.214.04-.217.038-.22.036-.223.034-.225.032-.229.031-.231.028-.233.027-.236.024-.239.023-.241.02-.242.019-.246.016-.247.015-.249.012-.251.01-.253.008-.255.005-.256.004-.258.001-.258-.001-.256-.004-.255-.005-.253-.008-.251-.01-.249-.012-.247-.015-.245-.016-.243-.019-.241-.02-.238-.023-.236-.024-.234-.027-.231-.028-.228-.031-.226-.032-.223-.034-.22-.036-.217-.038-.214-.04-.211-.041-.208-.043-.204-.045-.201-.046-.198-.048-.195-.05-.19-.051-.187-.053-.184-.054-.179-.056-.176-.057-.172-.059-.167-.06-.164-.061-.159-.063-.155-.064-.151-.066-.074-.033-.072-.033-.072-.034-.07-.034-.069-.035-.068-.035-.067-.035-.066-.035-.064-.036-.063-.036-.062-.036-.061-.036-.06-.037-.058-.037-.057-.037-.056-.038-.055-.038-.053-.038-.052-.038-.051-.039-.049-.039-.049-.039-.046-.039-.046-.04-.044-.04-.043-.04-.041-.04-.04-.041-.039-.041-.037-.041-.036-.041-.034-.041-.033-.042-.032-.042-.03-.042-.029-.042-.027-.042-.026-.043-.024-.043-.023-.043-.021-.043-.02-.043-.018-.044-.017-.043-.015-.044-.013-.044-.012-.044-.011-.045-.009-.044-.007-.045-.006-.045-.004-.045-.002-.045-.001-.045v-17l.001-.045.002-.045.004-.045.006-.045.007-.045.009-.044.011-.045.012-.044.013-.044.015-.044.017-.043.018-.044.02-.043.021-.043.023-.043.024-.043.026-.043.027-.042.029-.042.03-.042.032-.042.033-.042.034-.041.036-.041.037-.041.039-.041.04-.041.041-.04.043-.04.044-.04.046-.04.046-.039.049-.039.049-.039.051-.039.052-.038.053-.038.055-.038.056-.038.057-.037.058-.037.06-.037.061-.036.062-.036.063-.036.064-.036.066-.035.067-.035.068-.035.069-.035.07-.034.072-.034.072-.033.074-.033.151-.066.155-.064.159-.063.164-.061.167-.06.172-.059.176-.057.179-.056.184-.054.187-.053.19-.051.195-.05.198-.048.201-.046.204-.045.208-.043.211-.041.214-.04.217-.038.22-.036.223-.034.226-.032.228-.031.231-.028.234-.027.236-.024.238-.023.241-.02.243-.019.245-.016.247-.015.249-.012.251-.01.253-.008.255-.005.256-.004.258-.001.258.001zm-9.258 20.499v.01l.001.021.003.021.004.022.005.021.006.022.007.022.009.023.01.022.011.023.012.023.013.023.015.023.016.024.017.023.018.024.019.024.021.024.022.025.023.024.024.025.052.049.056.05.061.051.066.051.07.051.075.051.079.052.084.052.088.052.092.052.097.052.102.051.105.052.11.052.114.051.119.051.123.051.127.05.131.05.135.05.139.048.144.049.147.047.152.047.155.047.16.045.163.045.167.043.171.043.176.041.178.041.183.039.187.039.19.037.194.035.197.035.202.033.204.031.209.03.212.029.216.027.219.025.222.024.226.021.23.02.233.018.236.016.24.015.243.012.246.01.249.008.253.005.256.004.259.001.26-.001.257-.004.254-.005.25-.008.247-.011.244-.012.241-.014.237-.016.233-.018.231-.021.226-.021.224-.024.22-.026.216-.027.212-.028.21-.031.205-.031.202-.034.198-.034.194-.036.191-.037.187-.039.183-.04.179-.04.175-.042.172-.043.168-.044.163-.045.16-.046.155-.046.152-.047.148-.048.143-.049.139-.049.136-.05.131-.05.126-.05.123-.051.118-.052.114-.051.11-.052.106-.052.101-.052.096-.052.092-.052.088-.053.083-.051.079-.052.074-.052.07-.051.065-.051.06-.051.056-.05.051-.05.023-.024.023-.025.021-.024.02-.024.019-.024.018-.024.017-.024.015-.023.014-.024.013-.023.012-.023.01-.023.01-.022.008-.022.006-.022.006-.022.004-.022.004-.021.001-.021.001-.021v-4.127l-.077.055-.08.053-.083.054-.085.053-.087.052-.09.052-.093.051-.095.05-.097.05-.1.049-.102.049-.105.048-.106.047-.109.047-.111.046-.114.045-.115.045-.118.044-.12.043-.122.042-.124.042-.126.041-.128.04-.13.04-.132.038-.134.038-.135.037-.138.037-.139.035-.142.035-.143.034-.144.033-.147.032-.148.031-.15.03-.151.03-.153.029-.154.027-.156.027-.158.026-.159.025-.161.024-.162.023-.163.022-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.011-.178.01-.179.008-.179.008-.181.006-.182.005-.182.004-.184.003-.184.002h-.37l-.184-.002-.184-.003-.182-.004-.182-.005-.181-.006-.179-.008-.179-.008-.178-.01-.176-.011-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.022-.162-.023-.161-.024-.159-.025-.157-.026-.156-.027-.155-.027-.153-.029-.151-.03-.15-.03-.148-.031-.146-.032-.145-.033-.143-.034-.141-.035-.14-.035-.137-.037-.136-.037-.134-.038-.132-.038-.13-.04-.128-.04-.126-.041-.124-.042-.122-.042-.12-.044-.117-.043-.116-.045-.113-.045-.112-.046-.109-.047-.106-.047-.105-.048-.102-.049-.1-.049-.097-.05-.095-.05-.093-.052-.09-.051-.087-.052-.085-.053-.083-.054-.08-.054-.077-.054v4.127zm0-5.654v.011l.001.021.003.021.004.021.005.022.006.022.007.022.009.022.01.022.011.023.012.023.013.023.015.024.016.023.017.024.018.024.019.024.021.024.022.024.023.025.024.024.052.05.056.05.061.05.066.051.07.051.075.052.079.051.084.052.088.052.092.052.097.052.102.052.105.052.11.051.114.051.119.052.123.05.127.051.131.05.135.049.139.049.144.048.147.048.152.047.155.046.16.045.163.045.167.044.171.042.176.042.178.04.183.04.187.038.19.037.194.036.197.034.202.033.204.032.209.03.212.028.216.027.219.025.222.024.226.022.23.02.233.018.236.016.24.014.243.012.246.01.249.008.253.006.256.003.259.001.26-.001.257-.003.254-.006.25-.008.247-.01.244-.012.241-.015.237-.016.233-.018.231-.02.226-.022.224-.024.22-.025.216-.027.212-.029.21-.03.205-.032.202-.033.198-.035.194-.036.191-.037.187-.039.183-.039.179-.041.175-.042.172-.043.168-.044.163-.045.16-.045.155-.047.152-.047.148-.048.143-.048.139-.05.136-.049.131-.05.126-.051.123-.051.118-.051.114-.052.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.051.07-.052.065-.051.06-.05.056-.051.051-.049.023-.025.023-.024.021-.025.02-.024.019-.024.018-.024.017-.024.015-.023.014-.023.013-.024.012-.022.01-.023.01-.023.008-.022.006-.022.006-.022.004-.021.004-.022.001-.021.001-.021v-4.139l-.077.054-.08.054-.083.054-.085.052-.087.053-.09.051-.093.051-.095.051-.097.05-.1.049-.102.049-.105.048-.106.047-.109.047-.111.046-.114.045-.115.044-.118.044-.12.044-.122.042-.124.042-.126.041-.128.04-.13.039-.132.039-.134.038-.135.037-.138.036-.139.036-.142.035-.143.033-.144.033-.147.033-.148.031-.15.03-.151.03-.153.028-.154.028-.156.027-.158.026-.159.025-.161.024-.162.023-.163.022-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.011-.178.009-.179.009-.179.007-.181.007-.182.005-.182.004-.184.003-.184.002h-.37l-.184-.002-.184-.003-.182-.004-.182-.005-.181-.007-.179-.007-.179-.009-.178-.009-.176-.011-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.022-.162-.023-.161-.024-.159-.025-.157-.026-.156-.027-.155-.028-.153-.028-.151-.03-.15-.03-.148-.031-.146-.033-.145-.033-.143-.033-.141-.035-.14-.036-.137-.036-.136-.037-.134-.038-.132-.039-.13-.039-.128-.04-.126-.041-.124-.042-.122-.043-.12-.043-.117-.044-.116-.044-.113-.046-.112-.046-.109-.046-.106-.047-.105-.048-.102-.049-.1-.049-.097-.05-.095-.051-.093-.051-.09-.051-.087-.053-.085-.052-.083-.054-.08-.054-.077-.054v4.139zm0-5.666v.011l.001.02.003.022.004.021.005.022.006.021.007.022.009.023.01.022.011.023.012.023.013.023.015.023.016.024.017.024.018.023.019.024.021.025.022.024.023.024.024.025.052.05.056.05.061.05.066.051.07.051.075.052.079.051.084.052.088.052.092.052.097.052.102.052.105.051.11.052.114.051.119.051.123.051.127.05.131.05.135.05.139.049.144.048.147.048.152.047.155.046.16.045.163.045.167.043.171.043.176.042.178.04.183.04.187.038.19.037.194.036.197.034.202.033.204.032.209.03.212.028.216.027.219.025.222.024.226.021.23.02.233.018.236.017.24.014.243.012.246.01.249.008.253.006.256.003.259.001.26-.001.257-.003.254-.006.25-.008.247-.01.244-.013.241-.014.237-.016.233-.018.231-.02.226-.022.224-.024.22-.025.216-.027.212-.029.21-.03.205-.032.202-.033.198-.035.194-.036.191-.037.187-.039.183-.039.179-.041.175-.042.172-.043.168-.044.163-.045.16-.045.155-.047.152-.047.148-.048.143-.049.139-.049.136-.049.131-.051.126-.05.123-.051.118-.052.114-.051.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.052.07-.051.065-.051.06-.051.056-.05.051-.049.023-.025.023-.025.021-.024.02-.024.019-.024.018-.024.017-.024.015-.023.014-.024.013-.023.012-.023.01-.022.01-.023.008-.022.006-.022.006-.022.004-.022.004-.021.001-.021.001-.021v-4.153l-.077.054-.08.054-.083.053-.085.053-.087.053-.09.051-.093.051-.095.051-.097.05-.1.049-.102.048-.105.048-.106.048-.109.046-.111.046-.114.046-.115.044-.118.044-.12.043-.122.043-.124.042-.126.041-.128.04-.13.039-.132.039-.134.038-.135.037-.138.036-.139.036-.142.034-.143.034-.144.033-.147.032-.148.032-.15.03-.151.03-.153.028-.154.028-.156.027-.158.026-.159.024-.161.024-.162.023-.163.023-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.01-.178.01-.179.009-.179.007-.181.006-.182.006-.182.004-.184.003-.184.001-.185.001-.185-.001-.184-.001-.184-.003-.182-.004-.182-.006-.181-.006-.179-.007-.179-.009-.178-.01-.176-.01-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.023-.162-.023-.161-.024-.159-.024-.157-.026-.156-.027-.155-.028-.153-.028-.151-.03-.15-.03-.148-.032-.146-.032-.145-.033-.143-.034-.141-.034-.14-.036-.137-.036-.136-.037-.134-.038-.132-.039-.13-.039-.128-.041-.126-.041-.124-.041-.122-.043-.12-.043-.117-.044-.116-.044-.113-.046-.112-.046-.109-.046-.106-.048-.105-.048-.102-.048-.1-.05-.097-.049-.095-.051-.093-.051-.09-.052-.087-.052-.085-.053-.083-.053-.08-.054-.077-.054v4.153zm8.74-8.179l-.257.004-.254.005-.25.008-.247.011-.244.012-.241.014-.237.016-.233.018-.231.021-.226.022-.224.023-.22.026-.216.027-.212.028-.21.031-.205.032-.202.033-.198.034-.194.036-.191.038-.187.038-.183.04-.179.041-.175.042-.172.043-.168.043-.163.045-.16.046-.155.046-.152.048-.148.048-.143.048-.139.049-.136.05-.131.05-.126.051-.123.051-.118.051-.114.052-.11.052-.106.052-.101.052-.096.052-.092.052-.088.052-.083.052-.079.052-.074.051-.07.052-.065.051-.06.05-.056.05-.051.05-.023.025-.023.024-.021.024-.02.025-.019.024-.018.024-.017.023-.015.024-.014.023-.013.023-.012.023-.01.023-.01.022-.008.022-.006.023-.006.021-.004.022-.004.021-.001.021-.001.021.001.021.001.021.004.021.004.022.006.021.006.023.008.022.01.022.01.023.012.023.013.023.014.023.015.024.017.023.018.024.019.024.02.025.021.024.023.024.023.025.051.05.056.05.06.05.065.051.07.052.074.051.079.052.083.052.088.052.092.052.096.052.101.052.106.052.11.052.114.052.118.051.123.051.126.051.131.05.136.05.139.049.143.048.148.048.152.048.155.046.16.046.163.045.168.043.172.043.175.042.179.041.183.04.187.038.191.038.194.036.198.034.202.033.205.032.21.031.212.028.216.027.22.026.224.023.226.022.231.021.233.018.237.016.241.014.244.012.247.011.25.008.254.005.257.004.26.001.26-.001.257-.004.254-.005.25-.008.247-.011.244-.012.241-.014.237-.016.233-.018.231-.021.226-.022.224-.023.22-.026.216-.027.212-.028.21-.031.205-.032.202-.033.198-.034.194-.036.191-.038.187-.038.183-.04.179-.041.175-.042.172-.043.168-.043.163-.045.16-.046.155-.046.152-.048.148-.048.143-.048.139-.049.136-.05.131-.05.126-.051.123-.051.118-.051.114-.052.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.051.07-.052.065-.051.06-.05.056-.05.051-.05.023-.025.023-.024.021-.024.02-.025.019-.024.018-.024.017-.023.015-.024.014-.023.013-.023.012-.023.01-.023.01-.022.008-.022.006-.023.006-.021.004-.022.004-.021.001-.021.001-.021-.001-.021-.001-.021-.004-.021-.004-.022-.006-.021-.006-.023-.008-.022-.01-.022-.01-.023-.012-.023-.013-.023-.014-.023-.015-.024-.017-.023-.018-.024-.019-.024-.02-.025-.021-.024-.023-.024-.023-.025-.051-.05-.056-.05-.06-.05-.065-.051-.07-.052-.074-.051-.079-.052-.083-.052-.088-.052-.092-.052-.096-.052-.101-.052-.106-.052-.11-.052-.114-.052-.118-.051-.123-.051-.126-.051-.131-.05-.136-.05-.139-.049-.143-.048-.148-.048-.152-.048-.155-.046-.16-.046-.163-.045-.168-.043-.172-.043-.175-.042-.179-.041-.183-.04-.187-.038-.191-.038-.194-.036-.198-.034-.202-.033-.205-.032-.21-.031-.212-.028-.216-.027-.22-.026-.224-.023-.226-.022-.231-.021-.233-.018-.237-.016-.241-.014-.244-.012-.247-.011-.25-.008-.254-.005-.257-.004-.26-.001-.26.001z")},m0=function(t){t.append("defs").append("symbol").attr("id","computer").attr("width","24").attr("height","24").append("path").attr("transform","scale(.5)").attr("d","M2 2v13h20v-13h-20zm18 11h-16v-9h16v9zm-10.228 6l.466-1h3.524l.467 1h-4.457zm14.228 3h-24l2-6h2.104l-1.33 4h18.45l-1.297-4h2.073l2 6zm-5-10h-14v-7h14v7z")},f0=function(t){t.append("defs").append("symbol").attr("id","clock").attr("width","24").attr("height","24").append("path").attr("transform","scale(.5)").attr("d","M12 2c5.514 0 10 4.486 10 10s-4.486 10-10 10-10-4.486-10-10 4.486-10 10-10zm0-2c-6.627 0-12 5.373-12 12s5.373 12 12 12 12-5.373 12-12-5.373-12-12-12zm5.848 12.459c.202.038.202.333.001.372-1.907.361-6.045 1.111-6.547 1.111-.719 0-1.301-.582-1.301-1.301 0-.512.77-5.447 1.125-7.445.034-.192.312-.181.343.014l.985 6.238 5.394 1.011z")},b0=function(t){t.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").append("path").attr("d","M 0 0 L 10 5 L 0 10 z")},T0=function(t){t.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")},E0=function(t){t.append("defs").append("marker").attr("id","sequencenumber").attr("refX",15).attr("refY",15).attr("markerWidth",60).attr("markerHeight",40).attr("orient","auto").append("circle").attr("cx",15).attr("cy",15).attr("r",6)},w0=function(t){t.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")},ge=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}},v0=function(){return{x:0,y:0,fill:"#EDF2AE",stroke:"#666",width:100,anchor:"start",height:100,rx:0,ry:0}},Ht=function(){function t(s,l,n,h,r,u,b){const g=l.append("text").attr("x",n+r/2).attr("y",h+u/2+5).style("text-anchor","middle").text(s);i(g,b)}function e(s,l,n,h,r,u,b,g){const{actorFontSize:y,actorFontFamily:w,actorFontWeight:P}=g,[L,R]=te(y),N=s.split(v.lineBreakRegex);for(let C=0;C<N.length;C++){const O=C*L-L*(N.length-1)/2,F=l.append("text").attr("x",n+r/2).attr("y",h).style("text-anchor","middle").style("font-size",R).style("font-weight",P).style("font-family",w);F.append("tspan").attr("x",n+r/2).attr("dy",O).text(N[C]),F.attr("y",h+u/2).attr("dominant-baseline","central").attr("alignment-baseline","central"),i(F,b)}}function c(s,l,n,h,r,u,b,g){const y=l.append("switch"),w=y.append("foreignObject").attr("x",n).attr("y",h).attr("width",r).attr("height",u).append("xhtml:div").style("display","table").style("height","100%").style("width","100%");w.append("div").style("display","table-cell").style("text-align","center").style("vertical-align","middle").text(s),e(s,y,n,h,r,u,b,g),i(w,b)}async function a(s,l,n,h,r,u,b,g){const y=await Et(s,$t()),w=l.append("switch"),P=w.append("foreignObject").attr("x",n+r/2-y.width/2).attr("y",h+u/2-y.height/2).attr("width",y.width).attr("height",y.height).append("xhtml:div").style("height","100%").style("width","100%");P.append("div").style("text-align","center").style("vertical-align","middle").html(await ee(s,$t())),e(s,w,n,h,r,u,b,g),i(P,b)}function i(s,l){for(const n in l)l.hasOwnProperty(n)&&s.attr(n,l[n])}return function(s,l=!1){return l?a:s.textPlacement==="fo"?c:s.textPlacement==="old"?t:e}}(),_0=function(){function t(i,s,l,n,h,r,u){const b=s.append("text").attr("x",l).attr("y",n).style("text-anchor","start").text(i);a(b,u)}function e(i,s,l,n,h,r,u,b){const{actorFontSize:g,actorFontFamily:y,actorFontWeight:w}=b,P=i.split(v.lineBreakRegex);for(let L=0;L<P.length;L++){const R=L*g-g*(P.length-1)/2,N=s.append("text").attr("x",l).attr("y",n).style("text-anchor","start").style("font-size",g).style("font-weight",w).style("font-family",y);N.append("tspan").attr("x",l).attr("dy",R).text(P[L]),N.attr("y",n+r/2).attr("dominant-baseline","central").attr("alignment-baseline","central"),a(N,u)}}function c(i,s,l,n,h,r,u,b){const g=s.append("switch"),y=g.append("foreignObject").attr("x",l).attr("y",n).attr("width",h).attr("height",r).append("xhtml:div").style("display","table").style("height","100%").style("width","100%");y.append("div").style("display","table-cell").style("text-align","center").style("vertical-align","middle").text(i),e(i,g,l,n,h,r,u,b),a(y,u)}function a(i,s){for(const l in s)s.hasOwnProperty(l)&&i.attr(l,s[l])}return function(i){return i.textPlacement==="fo"?c:i.textPlacement==="old"?t:e}}(),D={drawRect:zt,drawText:bt,drawLabel:de,drawActor:p0,drawBox:h0,drawPopup:n0,anchorElement:g0,drawActivation:u0,drawLoop:x0,drawBackgroundRect:he,insertArrowHead:b0,insertArrowFilledHead:T0,insertSequenceNumber:E0,insertArrowCrossHead:w0,insertDatabaseIcon:y0,insertComputerIcon:m0,insertClockIcon:f0,getTextObj:ge,getNoteRect:v0,fixLifeLineHeights:pe,sanitizeUrl:Gt.sanitizeUrl};let o={};const x={data:{startx:void 0,stopx:void 0,starty:void 0,stopy:void 0},verticalPos:0,sequenceItems:[],activations:[],models:{getHeight:function(){return Math.max.apply(null,this.actors.length===0?[0]:this.actors.map(t=>t.height||0))+(this.loops.length===0?0:this.loops.map(t=>t.height||0).reduce((t,e)=>t+e))+(this.messages.length===0?0:this.messages.map(t=>t.height||0).reduce((t,e)=>t+e))+(this.notes.length===0?0:this.notes.map(t=>t.height||0).reduce((t,e)=>t+e))},clear:function(){this.actors=[],this.boxes=[],this.loops=[],this.messages=[],this.notes=[]},addBox:function(t){this.boxes.push(t)},addActor:function(t){this.actors.push(t)},addLoop:function(t){this.loops.push(t)},addMessage:function(t){this.messages.push(t)},addNote:function(t){this.notes.push(t)},lastActor:function(){return this.actors[this.actors.length-1]},lastLoop:function(){return this.loops[this.loops.length-1]},lastMessage:function(){return this.messages[this.messages.length-1]},lastNote:function(){return this.notes[this.notes.length-1]},actors:[],boxes:[],loops:[],messages:[],notes:[]},init:function(){this.sequenceItems=[],this.activations=[],this.models.clear(),this.data={startx:void 0,stopx:void 0,starty:void 0,stopy:void 0},this.verticalPos=0,xe(at())},updateVal:function(t,e,c,a){t[e]===void 0?t[e]=c:t[e]=a(c,t[e])},updateBounds:function(t,e,c,a){const i=this;let s=0;function l(n){return function(h){s++;const r=i.sequenceItems.length-s+1;i.updateVal(h,"starty",e-r*o.boxMargin,Math.min),i.updateVal(h,"stopy",a+r*o.boxMargin,Math.max),i.updateVal(x.data,"startx",t-r*o.boxMargin,Math.min),i.updateVal(x.data,"stopx",c+r*o.boxMargin,Math.max),n!=="activation"&&(i.updateVal(h,"startx",t-r*o.boxMargin,Math.min),i.updateVal(h,"stopx",c+r*o.boxMargin,Math.max),i.updateVal(x.data,"starty",e-r*o.boxMargin,Math.min),i.updateVal(x.data,"stopy",a+r*o.boxMargin,Math.max))}}this.sequenceItems.forEach(l()),this.activations.forEach(l("activation"))},insert:function(t,e,c,a){const i=v.getMin(t,c),s=v.getMax(t,c),l=v.getMin(e,a),n=v.getMax(e,a);this.updateVal(x.data,"startx",i,Math.min),this.updateVal(x.data,"starty",l,Math.min),this.updateVal(x.data,"stopx",s,Math.max),this.updateVal(x.data,"stopy",n,Math.max),this.updateBounds(i,l,s,n)},newActivation:function(t,e,c){const a=c[t.from.actor],i=Nt(t.from.actor).length||0,s=a.x+a.width/2+(i-1)*o.activationWidth/2;this.activations.push({startx:s,starty:this.verticalPos+2,stopx:s+o.activationWidth,stopy:void 0,actor:t.from.actor,anchored:D.anchorElement(e)})},endActivation:function(t){const e=this.activations.map(function(c){return c.actor}).lastIndexOf(t.from.actor);return this.activations.splice(e,1)[0]},createLoop:function(t={message:void 0,wrap:!1,width:void 0},e){return{startx:void 0,starty:this.verticalPos,stopx:void 0,stopy:void 0,title:t.message,wrap:t.wrap,width:t.width,height:0,fill:e}},newLoop:function(t={message:void 0,wrap:!1,width:void 0},e){this.sequenceItems.push(this.createLoop(t,e))},endLoop:function(){return this.sequenceItems.pop()},isLoopOverlap:function(){return this.sequenceItems.length?this.sequenceItems[this.sequenceItems.length-1].overlap:!1},addSectionToLoop:function(t){const e=this.sequenceItems.pop();e.sections=e.sections||[],e.sectionTitles=e.sectionTitles||[],e.sections.push({y:x.getVerticalPos(),height:0}),e.sectionTitles.push(t),this.sequenceItems.push(e)},saveVerticalPos:function(){this.isLoopOverlap()&&(this.savedVerticalPos=this.verticalPos)},resetVerticalPos:function(){this.isLoopOverlap()&&(this.verticalPos=this.savedVerticalPos)},bumpVerticalPos:function(t){this.verticalPos=this.verticalPos+t,this.data.stopy=v.getMax(this.data.stopy,this.verticalPos)},getVerticalPos:function(){return this.verticalPos},getBounds:function(){return{bounds:this.data,models:this.models}}},P0=async function(t,e){x.bumpVerticalPos(o.boxMargin),e.height=o.boxMargin,e.starty=x.getVerticalPos();const c=Mt();c.x=e.startx,c.y=e.starty,c.width=e.width||o.width,c.class="note";const a=t.append("g"),i=D.drawRect(a,c),s=Wt();s.x=e.startx,s.y=e.starty,s.width=c.width,s.dy="1em",s.text=e.message,s.class="noteText",s.fontFamily=o.noteFontFamily,s.fontSize=o.noteFontSize,s.fontWeight=o.noteFontWeight,s.anchor=o.noteAlign,s.textMargin=o.noteMargin,s.valign="center";const l=nt(s.text)?await Lt(a,s):bt(a,s),n=Math.round(l.map(h=>(h._groups||h)[0][0].getBBox().height).reduce((h,r)=>h+r));i.attr("height",n+2*o.noteMargin),e.height+=n+2*o.noteMargin,x.bumpVerticalPos(n+2*o.noteMargin),e.stopy=e.starty+n+2*o.noteMargin,e.stopx=e.startx+c.width,x.insert(e.startx,e.starty,e.stopx,e.stopy),x.models.addNote(e)},yt=t=>({fontFamily:t.messageFontFamily,fontSize:t.messageFontSize,fontWeight:t.messageFontWeight}),ft=t=>({fontFamily:t.noteFontFamily,fontSize:t.noteFontSize,fontWeight:t.noteFontWeight}),Vt=t=>({fontFamily:t.actorFontFamily,fontSize:t.actorFontSize,fontWeight:t.actorFontWeight});async function k0(t,e){x.bumpVerticalPos(10);const{startx:c,stopx:a,message:i}=e,s=v.splitBreaks(i).length,l=nt(i),n=l?await Et(i,at()):$.calculateTextDimensions(i,yt(o));if(!l){const b=n.height/s;e.height+=b,x.bumpVerticalPos(b)}let h,r=n.height-10;const u=n.width;if(c===a){h=x.getVerticalPos()+r,o.rightAngles||(r+=o.boxMargin,h=x.getVerticalPos()+r),r+=30;const b=v.getMax(u/2,o.width/2);x.insert(c-b,x.getVerticalPos()-10+r,a+b,x.getVerticalPos()+30+r)}else r+=o.boxMargin,h=x.getVerticalPos()+r,x.insert(c,h-10,a,h);return x.bumpVerticalPos(r),e.height+=r,e.stopy=e.starty+e.height,x.insert(e.fromBounds,e.starty,e.toBounds,e.stopy),h}const L0=async function(t,e,c,a){const{startx:i,stopx:s,starty:l,message:n,type:h,sequenceIndex:r,sequenceVisible:u}=e,b=$.calculateTextDimensions(n,yt(o)),g=Wt();g.x=i,g.y=l+10,g.width=s-i,g.class="messageText",g.dy="1em",g.text=n,g.fontFamily=o.messageFontFamily,g.fontSize=o.messageFontSize,g.fontWeight=o.messageFontWeight,g.anchor=o.messageAlign,g.valign="center",g.textMargin=o.wrapPadding,g.tspan=!1,nt(g.text)?await Lt(t,g,{startx:i,stopx:s,starty:c}):bt(t,g);const y=b.width;let w;i===s?o.rightAngles?w=t.append("path").attr("d",`M ${i},${c} H ${i+v.getMax(o.width/2,y/2)} V ${c+25} H ${i}`):w=t.append("path").attr("d","M "+i+","+c+" C "+(i+60)+","+(c-10)+" "+(i+60)+","+(c+30)+" "+i+","+(c+20)):(w=t.append("line"),w.attr("x1",i),w.attr("y1",c),w.attr("x2",s),w.attr("y2",c)),h===a.db.LINETYPE.DOTTED||h===a.db.LINETYPE.DOTTED_CROSS||h===a.db.LINETYPE.DOTTED_POINT||h===a.db.LINETYPE.DOTTED_OPEN?(w.style("stroke-dasharray","3, 3"),w.attr("class","messageLine1")):w.attr("class","messageLine0");let P="";o.arrowMarkerAbsolute&&(P=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,P=P.replace(/\(/g,"\\("),P=P.replace(/\)/g,"\\)")),w.attr("stroke-width",2),w.attr("stroke","none"),w.style("fill","none"),(h===a.db.LINETYPE.SOLID||h===a.db.LINETYPE.DOTTED)&&w.attr("marker-end","url("+P+"#arrowhead)"),(h===a.db.LINETYPE.SOLID_POINT||h===a.db.LINETYPE.DOTTED_POINT)&&w.attr("marker-end","url("+P+"#filled-head)"),(h===a.db.LINETYPE.SOLID_CROSS||h===a.db.LINETYPE.DOTTED_CROSS)&&w.attr("marker-end","url("+P+"#crosshead)"),(u||o.showSequenceNumbers)&&(w.attr("marker-start","url("+P+"#sequencenumber)"),t.append("text").attr("x",i).attr("y",c+4).attr("font-family","sans-serif").attr("font-size","12px").attr("text-anchor","middle").attr("class","sequenceNumber").text(r))},I0=async function(t,e,c,a,i,s,l){let n=0,h=0,r,u=0;for(const b of a){const g=e[b],y=g.box;r&&r!=y&&(x.models.addBox(r),h+=o.boxMargin+r.margin),y&&y!=r&&(y.x=n+h,y.y=i,h+=y.margin),g.width=g.width||o.width,g.height=v.getMax(g.height||o.height,o.height),g.margin=g.margin||o.actorMargin,u=v.getMax(u,g.height),c[g.name]&&(h+=g.width/2),g.x=n+h,g.starty=x.getVerticalPos(),x.insert(g.x,i,g.x+g.width,g.height),n+=g.width+h,g.box&&(g.box.width=n+y.margin-g.box.x),h=g.margin,r=g.box,x.models.addActor(g)}r&&x.models.addBox(r),x.bumpVerticalPos(u)},Ft=async function(t,e,c,a){if(a){let i=0;x.bumpVerticalPos(o.boxMargin*2);for(const s of c){const l=e[s];l.stopy||(l.stopy=x.getVerticalPos());const n=await D.drawActor(t,l,o,!0);i=v.getMax(i,n)}x.bumpVerticalPos(i+o.boxMargin)}else for(const i of c){const s=e[i];await D.drawActor(t,s,o,!1)}},ue=function(t,e,c,a){let i=0,s=0;for(const l of c){const n=e[l],h=O0(n),r=D.drawPopup(t,n,h,o,o.forceMenus,a);r.height>i&&(i=r.height),r.width+n.x>s&&(s=r.width+n.x)}return{maxHeight:i,maxWidth:s}},xe=function(t){Le(o,t),t.fontFamily&&(o.actorFontFamily=o.noteFontFamily=o.messageFontFamily=t.fontFamily),t.fontSize&&(o.actorFontSize=o.noteFontSize=o.messageFontSize=t.fontSize),t.fontWeight&&(o.actorFontWeight=o.noteFontWeight=o.messageFontWeight=t.fontWeight)},Nt=function(t){return x.activations.filter(function(e){return e.actor===t})},Qt=function(t,e){const c=e[t],a=Nt(t),i=a.reduce(function(l,n){return v.getMin(l,n.startx)},c.x+c.width/2-1),s=a.reduce(function(l,n){return v.getMax(l,n.stopx)},c.x+c.width/2+1);return[i,s]};function it(t,e,c,a,i){x.bumpVerticalPos(c);let s=a;if(e.id&&e.message&&t[e.id]){const l=t[e.id].width,n=yt(o);e.message=$.wrapLabel(`[${e.message}]`,l-2*o.wrapPadding,n),e.width=l,e.wrap=!0;const h=$.calculateTextDimensions(e.message,n),r=v.getMax(h.height,o.labelBoxHeight);s=a+r,K.debug(`${r} - ${e.message}`)}i(e),x.bumpVerticalPos(s)}function M0(t,e,c,a,i,s,l){function n(r,u){r.x<i[t.from].x?(x.insert(e.stopx-u,e.starty,e.startx,e.stopy+r.height/2+o.noteMargin),e.stopx=e.stopx+u):(x.insert(e.startx,e.starty,e.stopx+u,e.stopy+r.height/2+o.noteMargin),e.stopx=e.stopx-u)}function h(r,u){r.x<i[t.to].x?(x.insert(e.startx-u,e.starty,e.stopx,e.stopy+r.height/2+o.noteMargin),e.startx=e.startx+u):(x.insert(e.stopx,e.starty,e.startx+u,e.stopy+r.height/2+o.noteMargin),e.startx=e.startx-u)}if(s[t.to]==a){const r=i[t.to],u=r.type=="actor"?ut/2+3:r.width/2+3;n(r,u),r.starty=c-r.height/2,x.bumpVerticalPos(r.height/2)}else if(l[t.from]==a){const r=i[t.from];if(o.mirrorActors){const u=r.type=="actor"?ut/2:r.width/2;h(r,u)}r.stopy=c-r.height/2,x.bumpVerticalPos(r.height/2)}else if(l[t.to]==a){const r=i[t.to];if(o.mirrorActors){const u=r.type=="actor"?ut/2+3:r.width/2+3;n(r,u)}r.stopy=c-r.height/2,x.bumpVerticalPos(r.height/2)}}const N0=async function(t,e,c,a){const{securityLevel:i,sequence:s}=at();o=s;let l;i==="sandbox"&&(l=kt("#i"+e));const n=i==="sandbox"?kt(l.nodes()[0].contentDocument.body):kt("body"),h=i==="sandbox"?l.nodes()[0].contentDocument:document;x.init(),K.debug(a.db);const r=i==="sandbox"?n.select(`[id="${e}"]`):kt(`[id="${e}"]`),u=a.db.getActors(),b=a.db.getCreatedActors(),g=a.db.getDestroyedActors(),y=a.db.getBoxes();let w=a.db.getActorKeys();const P=a.db.getMessages(),L=a.db.getDiagramTitle(),R=a.db.hasAtLeastOneBox(),N=a.db.hasAtLeastOneBoxWithTitle(),C=await A0(u,P,a);if(o.height=await S0(u,C,y),D.insertComputerIcon(r),D.insertDatabaseIcon(r),D.insertClockIcon(r),R&&(x.bumpVerticalPos(o.boxMargin),N&&x.bumpVerticalPos(y[0].textMaxHeight)),o.hideUnusedParticipants===!0){const m=new Set;P.forEach(k=>{m.add(k.from),m.add(k.to)}),w=w.filter(k=>m.has(k))}await I0(r,u,b,w,0);const O=await C0(P,u,C,a);D.insertArrowHead(r),D.insertArrowCrossHead(r),D.insertArrowFilledHead(r),D.insertSequenceNumber(r);function F(m,k){const Z=x.endActivation(m);Z.starty+18>k&&(Z.starty=k-6,k+=12),D.drawActivation(r,Z,k,o,Nt(m.from.actor).length),x.insert(Z.startx,k-10,Z.stopx,k)}let W=1,X=1;const G=[],q=[];let z=0;for(const m of P){let k,Z,rt;switch(m.type){case a.db.LINETYPE.NOTE:x.resetVerticalPos(),Z=m.noteModel,await P0(r,Z);break;case a.db.LINETYPE.ACTIVE_START:x.newActivation(m,r,u);break;case a.db.LINETYPE.ACTIVE_END:F(m,x.getVerticalPos());break;case a.db.LINETYPE.LOOP_START:it(O,m,o.boxMargin,o.boxMargin+o.boxTextMargin,I=>x.newLoop(I));break;case a.db.LINETYPE.LOOP_END:k=x.endLoop(),await D.drawLoop(r,k,"loop",o),x.bumpVerticalPos(k.stopy-x.getVerticalPos()),x.models.addLoop(k);break;case a.db.LINETYPE.RECT_START:it(O,m,o.boxMargin,o.boxMargin,I=>x.newLoop(void 0,I.message));break;case a.db.LINETYPE.RECT_END:k=x.endLoop(),q.push(k),x.models.addLoop(k),x.bumpVerticalPos(k.stopy-x.getVerticalPos());break;case a.db.LINETYPE.OPT_START:it(O,m,o.boxMargin,o.boxMargin+o.boxTextMargin,I=>x.newLoop(I));break;case a.db.LINETYPE.OPT_END:k=x.endLoop(),await D.drawLoop(r,k,"opt",o),x.bumpVerticalPos(k.stopy-x.getVerticalPos()),x.models.addLoop(k);break;case a.db.LINETYPE.ALT_START:it(O,m,o.boxMargin,o.boxMargin+o.boxTextMargin,I=>x.newLoop(I));break;case a.db.LINETYPE.ALT_ELSE:it(O,m,o.boxMargin+o.boxTextMargin,o.boxMargin,I=>x.addSectionToLoop(I));break;case a.db.LINETYPE.ALT_END:k=x.endLoop(),await D.drawLoop(r,k,"alt",o),x.bumpVerticalPos(k.stopy-x.getVerticalPos()),x.models.addLoop(k);break;case a.db.LINETYPE.PAR_START:case a.db.LINETYPE.PAR_OVER_START:it(O,m,o.boxMargin,o.boxMargin+o.boxTextMargin,I=>x.newLoop(I)),x.saveVerticalPos();break;case a.db.LINETYPE.PAR_AND:it(O,m,o.boxMargin+o.boxTextMargin,o.boxMargin,I=>x.addSectionToLoop(I));break;case a.db.LINETYPE.PAR_END:k=x.endLoop(),await D.drawLoop(r,k,"par",o),x.bumpVerticalPos(k.stopy-x.getVerticalPos()),x.models.addLoop(k);break;case a.db.LINETYPE.AUTONUMBER:W=m.message.start||W,X=m.message.step||X,m.message.visible?a.db.enableSequenceNumbers():a.db.disableSequenceNumbers();break;case a.db.LINETYPE.CRITICAL_START:it(O,m,o.boxMargin,o.boxMargin+o.boxTextMargin,I=>x.newLoop(I));break;case a.db.LINETYPE.CRITICAL_OPTION:it(O,m,o.boxMargin+o.boxTextMargin,o.boxMargin,I=>x.addSectionToLoop(I));break;case a.db.LINETYPE.CRITICAL_END:k=x.endLoop(),await D.drawLoop(r,k,"critical",o),x.bumpVerticalPos(k.stopy-x.getVerticalPos()),x.models.addLoop(k);break;case a.db.LINETYPE.BREAK_START:it(O,m,o.boxMargin,o.boxMargin+o.boxTextMargin,I=>x.newLoop(I));break;case a.db.LINETYPE.BREAK_END:k=x.endLoop(),await D.drawLoop(r,k,"break",o),x.bumpVerticalPos(k.stopy-x.getVerticalPos()),x.models.addLoop(k);break;default:try{rt=m.msgModel,rt.starty=x.getVerticalPos(),rt.sequenceIndex=W,rt.sequenceVisible=a.db.showSequenceNumbers();const I=await k0(r,rt);M0(m,rt,I,z,u,b,g),G.push({messageModel:rt,lineStartY:I}),x.models.addMessage(rt)}catch(I){K.error("error while drawing message",I)}}[a.db.LINETYPE.SOLID_OPEN,a.db.LINETYPE.DOTTED_OPEN,a.db.LINETYPE.SOLID,a.db.LINETYPE.DOTTED,a.db.LINETYPE.SOLID_CROSS,a.db.LINETYPE.DOTTED_CROSS,a.db.LINETYPE.SOLID_POINT,a.db.LINETYPE.DOTTED_POINT].includes(m.type)&&(W=W+X),z++}K.debug("createdActors",b),K.debug("destroyedActors",g),await Ft(r,u,w,!1);for(const m of G)await L0(r,m.messageModel,m.lineStartY,a);o.mirrorActors&&await Ft(r,u,w,!0),q.forEach(m=>D.drawBackgroundRect(r,m)),pe(r,u,w,o);for(const m of x.models.boxes)m.height=x.getVerticalPos()-m.y,x.insert(m.x,m.y,m.x+m.width,m.height),m.startx=m.x,m.starty=m.y,m.stopx=m.startx+m.width,m.stopy=m.starty+m.height,m.stroke="rgb(0,0,0, 0.5)",await D.drawBox(r,m,o);R&&x.bumpVerticalPos(o.boxMargin);const B=ue(r,u,w,h),{bounds:V}=x.getBounds();let J=V.stopy-V.starty;J<B.maxHeight&&(J=B.maxHeight);let H=J+2*o.diagramMarginY;o.mirrorActors&&(H=H-o.boxMargin+o.bottomMarginAdj);let Q=V.stopx-V.startx;Q<B.maxWidth&&(Q=B.maxWidth);const tt=Q+2*o.diagramMarginX;L&&r.append("text").text(L).attr("x",(V.stopx-V.startx)/2-2*o.diagramMarginX).attr("y",-25),ke(r,H,tt,o.useMaxWidth);const M=L?40:0;r.attr("viewBox",V.startx-o.diagramMarginX+" -"+(o.diagramMarginY+M)+" "+tt+" "+(H+M)),K.debug("models:",x.models)};async function A0(t,e,c){const a={};for(const i of e)if(t[i.to]&&t[i.from]){const s=t[i.to];if(i.placement===c.db.PLACEMENT.LEFTOF&&!s.prevActor||i.placement===c.db.PLACEMENT.RIGHTOF&&!s.nextActor)continue;const l=i.placement!==void 0,n=!l,h=l?ft(o):yt(o),r=i.wrap?$.wrapLabel(i.message,o.width-2*o.wrapPadding,h):i.message,u=(nt(r)?await Et(i.message,at()):$.calculateTextDimensions(r,h)).width+2*o.wrapPadding;n&&i.from===s.nextActor?a[i.to]=v.getMax(a[i.to]||0,u):n&&i.from===s.prevActor?a[i.from]=v.getMax(a[i.from]||0,u):n&&i.from===i.to?(a[i.from]=v.getMax(a[i.from]||0,u/2),a[i.to]=v.getMax(a[i.to]||0,u/2)):i.placement===c.db.PLACEMENT.RIGHTOF?a[i.from]=v.getMax(a[i.from]||0,u):i.placement===c.db.PLACEMENT.LEFTOF?a[s.prevActor]=v.getMax(a[s.prevActor]||0,u):i.placement===c.db.PLACEMENT.OVER&&(s.prevActor&&(a[s.prevActor]=v.getMax(a[s.prevActor]||0,u/2)),s.nextActor&&(a[i.from]=v.getMax(a[i.from]||0,u/2)))}return K.debug("maxMessageWidthPerActor:",a),a}const O0=function(t){let e=0;const c=Vt(o);for(const a in t.links){const i=$.calculateTextDimensions(a,c).width+2*o.wrapPadding+2*o.boxMargin;e<i&&(e=i)}return e};async function S0(t,e,c){let a=0;for(const s of Object.keys(t)){const l=t[s];l.wrap&&(l.description=$.wrapLabel(l.description,o.width-2*o.wrapPadding,Vt(o)));const n=nt(l.description)?await Et(l.description,at()):$.calculateTextDimensions(l.description,Vt(o));l.width=l.wrap?o.width:v.getMax(o.width,n.width+2*o.wrapPadding),l.height=l.wrap?v.getMax(n.height,o.height):o.height,a=v.getMax(a,l.height)}for(const s in e){const l=t[s];if(!l)continue;const n=t[l.nextActor];if(!n){const r=e[s]+o.actorMargin-l.width/2;l.margin=v.getMax(r,o.actorMargin);continue}const h=e[s]+o.actorMargin-l.width/2-n.width/2;l.margin=v.getMax(h,o.actorMargin)}let i=0;return c.forEach(s=>{const l=yt(o);let n=s.actorKeys.reduce((u,b)=>u+=t[b].width+(t[b].margin||0),0);n-=2*o.boxTextMargin,s.wrap&&(s.name=$.wrapLabel(s.name,n-2*o.wrapPadding,l));const h=$.calculateTextDimensions(s.name,l);i=v.getMax(h.height,i);const r=v.getMax(n,h.width+2*o.wrapPadding);if(s.margin=o.boxTextMargin,n<r){const u=(r-n)/2;s.margin+=u}}),c.forEach(s=>s.textMaxHeight=i),v.getMax(a,o.height)}const D0=async function(t,e,c){const a=e[t.from].x,i=e[t.to].x,s=t.wrap&&t.message;let l=nt(t.message)?await Et(t.message,at()):$.calculateTextDimensions(s?$.wrapLabel(t.message,o.width,ft(o)):t.message,ft(o));const n={width:s?o.width:v.getMax(o.width,l.width+2*o.noteMargin),height:0,startx:e[t.from].x,stopx:0,starty:0,stopy:0,message:t.message};return t.placement===c.db.PLACEMENT.RIGHTOF?(n.width=s?v.getMax(o.width,l.width):v.getMax(e[t.from].width/2+e[t.to].width/2,l.width+2*o.noteMargin),n.startx=a+(e[t.from].width+o.actorMargin)/2):t.placement===c.db.PLACEMENT.LEFTOF?(n.width=s?v.getMax(o.width,l.width+2*o.noteMargin):v.getMax(e[t.from].width/2+e[t.to].width/2,l.width+2*o.noteMargin),n.startx=a-n.width+(e[t.from].width-o.actorMargin)/2):t.to===t.from?(l=$.calculateTextDimensions(s?$.wrapLabel(t.message,v.getMax(o.width,e[t.from].width),ft(o)):t.message,ft(o)),n.width=s?v.getMax(o.width,e[t.from].width):v.getMax(e[t.from].width,o.width,l.width+2*o.noteMargin),n.startx=a+(e[t.from].width-n.width)/2):(n.width=Math.abs(a+e[t.from].width/2-(i+e[t.to].width/2))+o.actorMargin,n.startx=a<i?a+e[t.from].width/2-o.actorMargin/2:i+e[t.to].width/2-o.actorMargin/2),s&&(n.message=$.wrapLabel(t.message,n.width-2*o.wrapPadding,ft(o))),K.debug(`NM:[${n.startx},${n.stopx},${n.starty},${n.stopy}:${n.width},${n.height}=${t.message}]`),n},R0=function(t,e,c){if(![c.db.LINETYPE.SOLID_OPEN,c.db.LINETYPE.DOTTED_OPEN,c.db.LINETYPE.SOLID,c.db.LINETYPE.DOTTED,c.db.LINETYPE.SOLID_CROSS,c.db.LINETYPE.DOTTED_CROSS,c.db.LINETYPE.SOLID_POINT,c.db.LINETYPE.DOTTED_POINT].includes(t.type))return{};const[a,i]=Qt(t.from,e),[s,l]=Qt(t.to,e),n=a<=s,h=n?i:a;let r=n?s:l;const u=Math.abs(s-l)>2,b=P=>n?-P:P;t.from===t.to?r=h:(t.activate&&!u&&(r+=b(o.activationWidth/2-1)),[c.db.LINETYPE.SOLID_OPEN,c.db.LINETYPE.DOTTED_OPEN].includes(t.type)||(r+=b(3)));const g=[a,i,s,l],y=Math.abs(h-r);t.wrap&&t.message&&(t.message=$.wrapLabel(t.message,v.getMax(y+2*o.wrapPadding,o.width),yt(o)));const w=$.calculateTextDimensions(t.message,yt(o));return{width:v.getMax(t.wrap?0:w.width+2*o.wrapPadding,y+2*o.wrapPadding,o.width),height:0,startx:h,stopx:r,starty:0,stopy:0,message:t.message,type:t.type,wrap:t.wrap,fromBounds:Math.min.apply(null,g),toBounds:Math.max.apply(null,g)}},C0=async function(t,e,c,a){const i={},s=[];let l,n,h;for(const r of t){switch(r.id=$.random({length:10}),r.type){case a.db.LINETYPE.LOOP_START:case a.db.LINETYPE.ALT_START:case a.db.LINETYPE.OPT_START:case a.db.LINETYPE.PAR_START:case a.db.LINETYPE.PAR_OVER_START:case a.db.LINETYPE.CRITICAL_START:case a.db.LINETYPE.BREAK_START:s.push({id:r.id,msg:r.message,from:Number.MAX_SAFE_INTEGER,to:Number.MIN_SAFE_INTEGER,width:0});break;case a.db.LINETYPE.ALT_ELSE:case a.db.LINETYPE.PAR_AND:case a.db.LINETYPE.CRITICAL_OPTION:r.message&&(l=s.pop(),i[l.id]=l,i[r.id]=l,s.push(l));break;case a.db.LINETYPE.LOOP_END:case a.db.LINETYPE.ALT_END:case a.db.LINETYPE.OPT_END:case a.db.LINETYPE.PAR_END:case a.db.LINETYPE.CRITICAL_END:case a.db.LINETYPE.BREAK_END:l=s.pop(),i[l.id]=l;break;case a.db.LINETYPE.ACTIVE_START:{const u=e[r.from?r.from.actor:r.to.actor],b=Nt(r.from?r.from.actor:r.to.actor).length,g=u.x+u.width/2+(b-1)*o.activationWidth/2,y={startx:g,stopx:g+o.activationWidth,actor:r.from.actor,enabled:!0};x.activations.push(y)}break;case a.db.LINETYPE.ACTIVE_END:{const u=x.activations.map(b=>b.actor).lastIndexOf(r.from.actor);delete x.activations.splice(u,1)[0]}break}r.placement!==void 0?(n=await D0(r,e,a),r.noteModel=n,s.forEach(u=>{l=u,l.from=v.getMin(l.from,n.startx),l.to=v.getMax(l.to,n.startx+n.width),l.width=v.getMax(l.width,Math.abs(l.from-l.to))-o.labelBoxWidth})):(h=R0(r,e,a),r.msgModel=h,h.startx&&h.stopx&&s.length>0&&s.forEach(u=>{if(l=u,h.startx===h.stopx){const b=e[r.from],g=e[r.to];l.from=v.getMin(b.x-h.width/2,b.x-b.width/2,l.from),l.to=v.getMax(g.x+h.width/2,g.x+b.width/2,l.to),l.width=v.getMax(l.width,Math.abs(l.to-l.from))-o.labelBoxWidth}else l.from=v.getMin(h.startx,l.from),l.to=v.getMax(h.stopx,l.to),l.width=v.getMax(l.width,h.width)-o.labelBoxWidth}))}return x.activations=[],K.debug("Loop type widths:",i),i},$0={bounds:x,drawActors:Ft,drawActorsPopup:ue,setConf:xe,draw:N0},V0={parser:De,db:Jt,renderer:$0,styles:o0,init:({wrap:t})=>{Jt.setWrap(t)}};export{V0 as diagram};
@@ -1 +1 @@
1
- import{A as O,v as N,D as T}from"./styles-ca3715f6-DU7x0doE-BqM8h3vG.js";import{S as t,F as M,O as k,J as G,p as z,e as L,l as P,u as U}from"./index-CVRNWcf-.js";import{K as I}from"./graph-BZahQKIN-CenQ9kLM.js";import{A as R}from"./layout-j-hMNqAM-d_O0ZYu6.js";const F=e=>e.append("circle").attr("class","start-state").attr("r",t().state.sizeUnit).attr("cx",t().state.padding+t().state.sizeUnit).attr("cy",t().state.padding+t().state.sizeUnit),C=e=>e.append("line").style("stroke","grey").style("stroke-dasharray","3").attr("x1",t().state.textHeight).attr("class","divider").attr("x2",t().state.textHeight*2).attr("y1",0).attr("y2",0),J=(e,r)=>{const g=e.append("text").attr("x",2*t().state.padding).attr("y",t().state.textHeight+2*t().state.padding).attr("font-size",t().state.fontSize).attr("class","state-title").text(r.id),s=g.node().getBBox();return e.insert("rect",":first-child").attr("x",t().state.padding).attr("y",t().state.padding).attr("width",s.width+2*t().state.padding).attr("height",s.height+2*t().state.padding).attr("rx",t().state.radius),g},W=(e,r)=>{const g=function(o,u,B){const w=o.append("tspan").attr("x",2*t().state.padding).text(u);B||w.attr("dy",t().state.textHeight)},s=e.append("text").attr("x",2*t().state.padding).attr("y",t().state.textHeight+1.3*t().state.padding).attr("font-size",t().state.fontSize).attr("class","state-title").text(r.descriptions[0]).node().getBBox(),d=s.height,h=e.append("text").attr("x",t().state.padding).attr("y",d+t().state.padding*.4+t().state.dividerMargin+t().state.textHeight).attr("class","state-description");let l=!0,a=!0;r.descriptions.forEach(function(o){l||(g(h,o,a),a=!1),l=!1});const n=e.append("line").attr("x1",t().state.padding).attr("y1",t().state.padding+d+t().state.dividerMargin/2).attr("y2",t().state.padding+d+t().state.dividerMargin/2).attr("class","descr-divider"),x=h.node().getBBox(),c=Math.max(x.width,s.width);return n.attr("x2",c+3*t().state.padding),e.insert("rect",":first-child").attr("x",t().state.padding).attr("y",t().state.padding).attr("width",c+2*t().state.padding).attr("height",x.height+d+2*t().state.padding).attr("rx",t().state.radius),e},Y=(e,r,g)=>{const s=t().state.padding,d=2*t().state.padding,h=e.node().getBBox(),l=h.width,a=h.x,n=e.append("text").attr("x",0).attr("y",t().state.titleShift).attr("font-size",t().state.fontSize).attr("class","state-title").text(r.id),x=n.node().getBBox().width+d;let c=Math.max(x,l);c===l&&(c=c+d);let o;const u=e.node().getBBox();r.doc,o=a-s,x>l&&(o=(l-c)/2+s),Math.abs(a-u.x)<s&&x>l&&(o=a-(x-l)/2);const B=1-t().state.textHeight;return e.insert("rect",":first-child").attr("x",o).attr("y",B).attr("class",g?"alt-composit":"composit").attr("width",c).attr("height",u.height+t().state.textHeight+t().state.titleShift+1).attr("rx","0"),n.attr("x",o+s),x<=l&&n.attr("x",a+(c-d)/2-x/2+s),e.insert("rect",":first-child").attr("x",o).attr("y",t().state.titleShift-t().state.textHeight-t().state.padding).attr("width",c).attr("height",t().state.textHeight*3).attr("rx",t().state.radius),e.insert("rect",":first-child").attr("x",o).attr("y",t().state.titleShift-t().state.textHeight-t().state.padding).attr("width",c).attr("height",u.height+3+2*t().state.textHeight).attr("rx",t().state.radius),e},j=e=>(e.append("circle").attr("class","end-state-outer").attr("r",t().state.sizeUnit+t().state.miniPadding).attr("cx",t().state.padding+t().state.sizeUnit+t().state.miniPadding).attr("cy",t().state.padding+t().state.sizeUnit+t().state.miniPadding),e.append("circle").attr("class","end-state-inner").attr("r",t().state.sizeUnit).attr("cx",t().state.padding+t().state.sizeUnit+2).attr("cy",t().state.padding+t().state.sizeUnit+2)),K=(e,r)=>{let g=t().state.forkWidth,s=t().state.forkHeight;if(r.parentId){let d=g;g=s,s=d}return e.append("rect").style("stroke","black").style("fill","black").attr("width",g).attr("height",s).attr("x",t().state.padding).attr("y",t().state.padding)},X=(e,r,g,s)=>{let d=0;const h=s.append("text");h.style("text-anchor","start"),h.attr("class","noteText");let l=e.replace(/\r\n/g,"<br/>");l=l.replace(/\n/g,"<br/>");const a=l.split(z.lineBreakRegex);let n=1.25*t().state.noteMargin;for(const x of a){const c=x.trim();if(c.length>0){const o=h.append("tspan");if(o.text(c),n===0){const u=o.node().getBBox();n+=u.height}d+=n,o.attr("x",r+t().state.noteMargin),o.attr("y",g+d+1.25*t().state.noteMargin)}}return{textWidth:h.node().getBBox().width,textHeight:d}},$=(e,r)=>{r.attr("class","state-note");const g=r.append("rect").attr("x",0).attr("y",t().state.padding),s=r.append("g"),{textWidth:d,textHeight:h}=X(e,0,0,s);return g.attr("height",h+2*t().state.noteMargin),g.attr("width",d+t().state.noteMargin*2),g},H=function(e,r){const g=r.id,s={id:g,label:r.id,width:0,height:0},d=e.append("g").attr("id",g).attr("class","stateGroup");r.type==="start"&&F(d),r.type==="end"&&j(d),(r.type==="fork"||r.type==="join")&&K(d,r),r.type==="note"&&$(r.note.text,d),r.type==="divider"&&C(d),r.type==="default"&&r.descriptions.length===0&&J(d,r),r.type==="default"&&r.descriptions.length>0&&W(d,r);const h=d.node().getBBox();return s.width=h.width+2*t().state.padding,s.height=h.height+2*t().state.padding,s};let A=0;const q=function(e,r,g){const s=function(n){switch(n){case N.relationType.AGGREGATION:return"aggregation";case N.relationType.EXTENSION:return"extension";case N.relationType.COMPOSITION:return"composition";case N.relationType.DEPENDENCY:return"dependency"}};r.points=r.points.filter(n=>!Number.isNaN(n.y));const d=r.points,h=L().x(function(n){return n.x}).y(function(n){return n.y}).curve(P),l=e.append("path").attr("d",h(d)).attr("id","edge"+A).attr("class","transition");let a="";if(t().state.arrowMarkerAbsolute&&(a=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,a=a.replace(/\(/g,"\\("),a=a.replace(/\)/g,"\\)")),l.attr("marker-end","url("+a+"#"+s(N.relationType.DEPENDENCY)+"End)"),g.title!==void 0){const n=e.append("g").attr("class","stateLabel"),{x,y:c}=U.calcLabelPosition(r.points),o=z.getRows(g.title);let u=0;const B=[];let w=0,S=0;for(let f=0;f<=o.length;f++){const p=n.append("text").attr("text-anchor","middle").text(o[f]).attr("x",x).attr("y",c+u),y=p.node().getBBox();w=Math.max(w,y.width),S=Math.min(S,y.x),k.info(y.x,x,c+u),u===0&&(u=p.node().getBBox().height,k.info("Title height",u,c)),B.push(p)}let E=u*o.length;if(o.length>1){const f=(o.length-1)*u*.5;B.forEach((p,y)=>p.attr("y",c+y*u-f)),E=u*o.length}const i=n.node().getBBox();n.insert("rect",":first-child").attr("class","box").attr("x",x-w/2-t().state.padding/2).attr("y",c-E/2-t().state.padding/2-3.5).attr("width",w+t().state.padding).attr("height",E+t().state.padding),k.info(i)}A++};let m;const v={},Z=function(){},Q=function(e){e.append("defs").append("marker").attr("id","dependencyEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 19,7 L9,13 L14,7 L9,1 Z")},V=function(e,r,g,s){m=t().state;const d=t().securityLevel;let h;d==="sandbox"&&(h=M("#i"+r));const l=d==="sandbox"?M(h.nodes()[0].contentDocument.body):M("body"),a=d==="sandbox"?h.nodes()[0].contentDocument:document;k.debug("Rendering diagram "+e);const n=l.select(`[id='${r}']`);Q(n);const x=s.db.getRootDoc();D(x,n,void 0,!1,l,a,s);const c=m.padding,o=n.node().getBBox(),u=o.width+c*2,B=o.height+c*2,w=u*1.75;G(n,B,w,m.useMaxWidth),n.attr("viewBox",`${o.x-m.padding} ${o.y-m.padding} `+u+" "+B)},_=e=>e?e.length*m.fontSizeFactor:1,D=(e,r,g,s,d,h,l)=>{const a=new I({compound:!0,multigraph:!0});let n,x=!0;for(n=0;n<e.length;n++)if(e[n].stmt==="relation"){x=!1;break}g?a.setGraph({rankdir:"LR",multigraph:!0,compound:!0,ranker:"tight-tree",ranksep:x?1:m.edgeLengthFactor,nodeSep:x?1:50,isMultiGraph:!0}):a.setGraph({rankdir:"TB",multigraph:!0,compound:!0,ranksep:x?1:m.edgeLengthFactor,nodeSep:x?1:50,ranker:"tight-tree",isMultiGraph:!0}),a.setDefaultEdgeLabel(function(){return{}}),l.db.extract(e);const c=l.db.getStates(),o=l.db.getRelations(),u=Object.keys(c);for(const i of u){const f=c[i];g&&(f.parentId=g);let p;if(f.doc){let y=r.append("g").attr("id",f.id).attr("class","stateGroup");p=D(f.doc,y,f.id,!s,d,h,l);{y=Y(y,f,s);let b=y.node().getBBox();p.width=b.width,p.height=b.height+m.padding/2,v[f.id]={y:m.compositTitleSize}}}else p=H(r,f);if(f.note){const y={descriptions:[],id:f.id+"-note",note:f.note,type:"note"},b=H(r,y);f.note.position==="left of"?(a.setNode(p.id+"-note",b),a.setNode(p.id,p)):(a.setNode(p.id,p),a.setNode(p.id+"-note",b)),a.setParent(p.id,p.id+"-group"),a.setParent(p.id+"-note",p.id+"-group")}else a.setNode(p.id,p)}k.debug("Count=",a.nodeCount(),a);let B=0;o.forEach(function(i){B++,k.debug("Setting edge",i),a.setEdge(i.id1,i.id2,{relation:i,width:_(i.title),height:m.labelHeight*z.getRows(i.title).length,labelpos:"c"},"id"+B)}),R(a),k.debug("Graph after layout",a.nodes());const w=r.node();a.nodes().forEach(function(i){i!==void 0&&a.node(i)!==void 0?(k.warn("Node "+i+": "+JSON.stringify(a.node(i))),d.select("#"+w.id+" #"+i).attr("transform","translate("+(a.node(i).x-a.node(i).width/2)+","+(a.node(i).y+(v[i]?v[i].y:0)-a.node(i).height/2)+" )"),d.select("#"+w.id+" #"+i).attr("data-x-shift",a.node(i).x-a.node(i).width/2),h.querySelectorAll("#"+w.id+" #"+i+" .divider").forEach(f=>{const p=f.parentElement;let y=0,b=0;p&&(p.parentElement&&(y=p.parentElement.getBBox().width),b=parseInt(p.getAttribute("data-x-shift"),10),Number.isNaN(b)&&(b=0)),f.setAttribute("x1",0-b+8),f.setAttribute("x2",y-b-8)})):k.debug("No Node "+i+": "+JSON.stringify(a.node(i)))});let S=w.getBBox();a.edges().forEach(function(i){i!==void 0&&a.edge(i)!==void 0&&(k.debug("Edge "+i.v+" -> "+i.w+": "+JSON.stringify(a.edge(i))),q(r,a.edge(i),a.edge(i).relation))}),S=w.getBBox();const E={id:g||"root",label:g||"root",width:0,height:0};return E.width=S.width+2*m.padding,E.height=S.height+2*m.padding,k.debug("Doc rendered",E,a),E},tt={setConf:Z,draw:V},dt={parser:T,db:N,renderer:tt,styles:O,init:e=>{e.state||(e.state={}),e.state.arrowMarkerAbsolute=e.arrowMarkerAbsolute,N.clear()}};export{dt as diagram};
1
+ import{A as O,v as N,D as T}from"./styles-ca3715f6-CfJZu0Yn-DtD2x1No.js";import{E as t,F as M,O as E,Q as G,m as z,d as L,o as P,f as U}from"./index-BaIhc-dj.js";import{K as I}from"./graph-BV6jB5rk-CELreG_k.js";import{A as R}from"./layout-LXMv3mSS-fzT-WsR4.js";const F=e=>e.append("circle").attr("class","start-state").attr("r",t().state.sizeUnit).attr("cx",t().state.padding+t().state.sizeUnit).attr("cy",t().state.padding+t().state.sizeUnit),C=e=>e.append("line").style("stroke","grey").style("stroke-dasharray","3").attr("x1",t().state.textHeight).attr("class","divider").attr("x2",t().state.textHeight*2).attr("y1",0).attr("y2",0),W=(e,r)=>{const g=e.append("text").attr("x",2*t().state.padding).attr("y",t().state.textHeight+2*t().state.padding).attr("font-size",t().state.fontSize).attr("class","state-title").text(r.id),s=g.node().getBBox();return e.insert("rect",":first-child").attr("x",t().state.padding).attr("y",t().state.padding).attr("width",s.width+2*t().state.padding).attr("height",s.height+2*t().state.padding).attr("rx",t().state.radius),g},J=(e,r)=>{const g=function(o,u,b){const w=o.append("tspan").attr("x",2*t().state.padding).text(u);b||w.attr("dy",t().state.textHeight)},s=e.append("text").attr("x",2*t().state.padding).attr("y",t().state.textHeight+1.3*t().state.padding).attr("font-size",t().state.fontSize).attr("class","state-title").text(r.descriptions[0]).node().getBBox(),d=s.height,h=e.append("text").attr("x",t().state.padding).attr("y",d+t().state.padding*.4+t().state.dividerMargin+t().state.textHeight).attr("class","state-description");let l=!0,a=!0;r.descriptions.forEach(function(o){l||(g(h,o,a),a=!1),l=!1});const n=e.append("line").attr("x1",t().state.padding).attr("y1",t().state.padding+d+t().state.dividerMargin/2).attr("y2",t().state.padding+d+t().state.dividerMargin/2).attr("class","descr-divider"),x=h.node().getBBox(),p=Math.max(x.width,s.width);return n.attr("x2",p+3*t().state.padding),e.insert("rect",":first-child").attr("x",t().state.padding).attr("y",t().state.padding).attr("width",p+2*t().state.padding).attr("height",x.height+d+2*t().state.padding).attr("rx",t().state.radius),e},Y=(e,r,g)=>{const s=t().state.padding,d=2*t().state.padding,h=e.node().getBBox(),l=h.width,a=h.x,n=e.append("text").attr("x",0).attr("y",t().state.titleShift).attr("font-size",t().state.fontSize).attr("class","state-title").text(r.id),x=n.node().getBBox().width+d;let p=Math.max(x,l);p===l&&(p=p+d);let o;const u=e.node().getBBox();r.doc,o=a-s,x>l&&(o=(l-p)/2+s),Math.abs(a-u.x)<s&&x>l&&(o=a-(x-l)/2);const b=1-t().state.textHeight;return e.insert("rect",":first-child").attr("x",o).attr("y",b).attr("class",g?"alt-composit":"composit").attr("width",p).attr("height",u.height+t().state.textHeight+t().state.titleShift+1).attr("rx","0"),n.attr("x",o+s),x<=l&&n.attr("x",a+(p-d)/2-x/2+s),e.insert("rect",":first-child").attr("x",o).attr("y",t().state.titleShift-t().state.textHeight-t().state.padding).attr("width",p).attr("height",t().state.textHeight*3).attr("rx",t().state.radius),e.insert("rect",":first-child").attr("x",o).attr("y",t().state.titleShift-t().state.textHeight-t().state.padding).attr("width",p).attr("height",u.height+3+2*t().state.textHeight).attr("rx",t().state.radius),e},j=e=>(e.append("circle").attr("class","end-state-outer").attr("r",t().state.sizeUnit+t().state.miniPadding).attr("cx",t().state.padding+t().state.sizeUnit+t().state.miniPadding).attr("cy",t().state.padding+t().state.sizeUnit+t().state.miniPadding),e.append("circle").attr("class","end-state-inner").attr("r",t().state.sizeUnit).attr("cx",t().state.padding+t().state.sizeUnit+2).attr("cy",t().state.padding+t().state.sizeUnit+2)),K=(e,r)=>{let g=t().state.forkWidth,s=t().state.forkHeight;if(r.parentId){let d=g;g=s,s=d}return e.append("rect").style("stroke","black").style("fill","black").attr("width",g).attr("height",s).attr("x",t().state.padding).attr("y",t().state.padding)},Q=(e,r,g,s)=>{let d=0;const h=s.append("text");h.style("text-anchor","start"),h.attr("class","noteText");let l=e.replace(/\r\n/g,"<br/>");l=l.replace(/\n/g,"<br/>");const a=l.split(z.lineBreakRegex);let n=1.25*t().state.noteMargin;for(const x of a){const p=x.trim();if(p.length>0){const o=h.append("tspan");if(o.text(p),n===0){const u=o.node().getBBox();n+=u.height}d+=n,o.attr("x",r+t().state.noteMargin),o.attr("y",g+d+1.25*t().state.noteMargin)}}return{textWidth:h.node().getBBox().width,textHeight:d}},X=(e,r)=>{r.attr("class","state-note");const g=r.append("rect").attr("x",0).attr("y",t().state.padding),s=r.append("g"),{textWidth:d,textHeight:h}=Q(e,0,0,s);return g.attr("height",h+2*t().state.noteMargin),g.attr("width",d+t().state.noteMargin*2),g},H=function(e,r){const g=r.id,s={id:g,label:r.id,width:0,height:0},d=e.append("g").attr("id",g).attr("class","stateGroup");r.type==="start"&&F(d),r.type==="end"&&j(d),(r.type==="fork"||r.type==="join")&&K(d,r),r.type==="note"&&X(r.note.text,d),r.type==="divider"&&C(d),r.type==="default"&&r.descriptions.length===0&&W(d,r),r.type==="default"&&r.descriptions.length>0&&J(d,r);const h=d.node().getBBox();return s.width=h.width+2*t().state.padding,s.height=h.height+2*t().state.padding,s};let A=0;const $=function(e,r,g){const s=function(n){switch(n){case N.relationType.AGGREGATION:return"aggregation";case N.relationType.EXTENSION:return"extension";case N.relationType.COMPOSITION:return"composition";case N.relationType.DEPENDENCY:return"dependency"}};r.points=r.points.filter(n=>!Number.isNaN(n.y));const d=r.points,h=L().x(function(n){return n.x}).y(function(n){return n.y}).curve(P),l=e.append("path").attr("d",h(d)).attr("id","edge"+A).attr("class","transition");let a="";if(t().state.arrowMarkerAbsolute&&(a=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,a=a.replace(/\(/g,"\\("),a=a.replace(/\)/g,"\\)")),l.attr("marker-end","url("+a+"#"+s(N.relationType.DEPENDENCY)+"End)"),g.title!==void 0){const n=e.append("g").attr("class","stateLabel"),{x,y:p}=U.calcLabelPosition(r.points),o=z.getRows(g.title);let u=0;const b=[];let w=0,S=0;for(let f=0;f<=o.length;f++){const c=n.append("text").attr("text-anchor","middle").text(o[f]).attr("x",x).attr("y",p+u),y=c.node().getBBox();w=Math.max(w,y.width),S=Math.min(S,y.x),E.info(y.x,x,p+u),u===0&&(u=c.node().getBBox().height,E.info("Title height",u,p)),b.push(c)}let k=u*o.length;if(o.length>1){const f=(o.length-1)*u*.5;b.forEach((c,y)=>c.attr("y",p+y*u-f)),k=u*o.length}const i=n.node().getBBox();n.insert("rect",":first-child").attr("class","box").attr("x",x-w/2-t().state.padding/2).attr("y",p-k/2-t().state.padding/2-3.5).attr("width",w+t().state.padding).attr("height",k+t().state.padding),E.info(i)}A++};let m;const v={},q=function(){},Z=function(e){e.append("defs").append("marker").attr("id","dependencyEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 19,7 L9,13 L14,7 L9,1 Z")},V=function(e,r,g,s){m=t().state;const d=t().securityLevel;let h;d==="sandbox"&&(h=M("#i"+r));const l=d==="sandbox"?M(h.nodes()[0].contentDocument.body):M("body"),a=d==="sandbox"?h.nodes()[0].contentDocument:document;E.debug("Rendering diagram "+e);const n=l.select(`[id='${r}']`);Z(n);const x=s.db.getRootDoc();D(x,n,void 0,!1,l,a,s);const p=m.padding,o=n.node().getBBox(),u=o.width+p*2,b=o.height+p*2,w=u*1.75;G(n,b,w,m.useMaxWidth),n.attr("viewBox",`${o.x-m.padding} ${o.y-m.padding} `+u+" "+b)},_=e=>e?e.length*m.fontSizeFactor:1,D=(e,r,g,s,d,h,l)=>{const a=new I({compound:!0,multigraph:!0});let n,x=!0;for(n=0;n<e.length;n++)if(e[n].stmt==="relation"){x=!1;break}g?a.setGraph({rankdir:"LR",multigraph:!0,compound:!0,ranker:"tight-tree",ranksep:x?1:m.edgeLengthFactor,nodeSep:x?1:50,isMultiGraph:!0}):a.setGraph({rankdir:"TB",multigraph:!0,compound:!0,ranksep:x?1:m.edgeLengthFactor,nodeSep:x?1:50,ranker:"tight-tree",isMultiGraph:!0}),a.setDefaultEdgeLabel(function(){return{}}),l.db.extract(e);const p=l.db.getStates(),o=l.db.getRelations(),u=Object.keys(p);for(const i of u){const f=p[i];g&&(f.parentId=g);let c;if(f.doc){let y=r.append("g").attr("id",f.id).attr("class","stateGroup");c=D(f.doc,y,f.id,!s,d,h,l);{y=Y(y,f,s);let B=y.node().getBBox();c.width=B.width,c.height=B.height+m.padding/2,v[f.id]={y:m.compositTitleSize}}}else c=H(r,f);if(f.note){const y={descriptions:[],id:f.id+"-note",note:f.note,type:"note"},B=H(r,y);f.note.position==="left of"?(a.setNode(c.id+"-note",B),a.setNode(c.id,c)):(a.setNode(c.id,c),a.setNode(c.id+"-note",B)),a.setParent(c.id,c.id+"-group"),a.setParent(c.id+"-note",c.id+"-group")}else a.setNode(c.id,c)}E.debug("Count=",a.nodeCount(),a);let b=0;o.forEach(function(i){b++,E.debug("Setting edge",i),a.setEdge(i.id1,i.id2,{relation:i,width:_(i.title),height:m.labelHeight*z.getRows(i.title).length,labelpos:"c"},"id"+b)}),R(a),E.debug("Graph after layout",a.nodes());const w=r.node();a.nodes().forEach(function(i){i!==void 0&&a.node(i)!==void 0?(E.warn("Node "+i+": "+JSON.stringify(a.node(i))),d.select("#"+w.id+" #"+i).attr("transform","translate("+(a.node(i).x-a.node(i).width/2)+","+(a.node(i).y+(v[i]?v[i].y:0)-a.node(i).height/2)+" )"),d.select("#"+w.id+" #"+i).attr("data-x-shift",a.node(i).x-a.node(i).width/2),h.querySelectorAll("#"+w.id+" #"+i+" .divider").forEach(f=>{const c=f.parentElement;let y=0,B=0;c&&(c.parentElement&&(y=c.parentElement.getBBox().width),B=parseInt(c.getAttribute("data-x-shift"),10),Number.isNaN(B)&&(B=0)),f.setAttribute("x1",0-B+8),f.setAttribute("x2",y-B-8)})):E.debug("No Node "+i+": "+JSON.stringify(a.node(i)))});let S=w.getBBox();a.edges().forEach(function(i){i!==void 0&&a.edge(i)!==void 0&&(E.debug("Edge "+i.v+" -> "+i.w+": "+JSON.stringify(a.edge(i))),$(r,a.edge(i),a.edge(i).relation))}),S=w.getBBox();const k={id:g||"root",label:g||"root",width:0,height:0};return k.width=S.width+2*m.padding,k.height=S.height+2*m.padding,E.debug("Doc rendered",k,a),k},tt={setConf:q,draw:V},dt={parser:T,db:N,renderer:tt,styles:O,init:e=>{e.state||(e.state={}),e.state.arrowMarkerAbsolute=e.arrowMarkerAbsolute,N.clear()}};export{dt as diagram};
@@ -0,0 +1 @@
1
+ import{A as J,v as z,D as U,C as Y,E as L,t as H,I as X,_ as Z}from"./styles-ca3715f6-CfJZu0Yn-DtD2x1No.js";import{K as tt}from"./graph-BV6jB5rk-CELreG_k.js";import{O as p,E as S,F as A,f as et,Q as st,m as E}from"./index-BaIhc-dj.js";import{b as ot}from"./index-5325376f-DrY72DrM-CA0ZD5ej.js";import"./layout-LXMv3mSS-fzT-WsR4.js";import"./clone-B1V2003j-Cr3Uw-Zs.js";import"./edges-96097737-Zk-qG_8u-HnJhTil4.js";import"./createText-1719965b-C2-AT0ab-CWg8fDWo.js";const w="rect",k="rectWithTitle",at="start",rt="end",it="divider",nt="roundedWithTitle",dt="note",lt="noteGroup",h="statediagram",ct="state",pt=`${h}-${ct}`,M="transition",bt="note",gt="note-edge",ut=`${M} ${gt}`,ht=`${h}-${bt}`,yt="cluster",ft=`${h}-${yt}`,mt="cluster-alt",$t=`${h}-${mt}`,P="parent",W="note",xt="state",C="----",wt=`${C}${W}`,I=`${C}${P}`,j="fill:none",G="fill: #333",K="c",q="text",F="normal";let T={},c=0;const Tt=function(t){const a=Object.keys(t);for(const e of a)t[e]},St=function(t,a){return a.db.extract(a.db.getRootDocV2()),a.db.getClasses()};function Dt(t){return t==null?"":t.classes?t.classes.join(" "):""}function v(t="",a=0,e="",r=C){const i=e!==null&&e.length>0?`${r}${e}`:"";return`${xt}-${t}${i}-${a}`}const x=(t,a,e,r,i,n)=>{const s=e.id,y=Dt(r[s]);if(s!=="root"){let g=w;e.start===!0&&(g=at),e.start===!1&&(g=rt),e.type!==L&&(g=e.type),T[s]||(T[s]={id:s,shape:g,description:E.sanitizeText(s,S()),classes:`${y} ${pt}`});const o=T[s];e.description&&(Array.isArray(o.description)?(o.shape=k,o.description.push(e.description)):o.description.length>0?(o.shape=k,o.description===s?o.description=[e.description]:o.description=[o.description,e.description]):(o.shape=w,o.description=e.description),o.description=E.sanitizeTextOrArray(o.description,S())),o.description.length===1&&o.shape===k&&(o.shape=w),!o.type&&e.doc&&(p.info("Setting cluster for ",s,B(e)),o.type="group",o.dir=B(e),o.shape=e.type===H?it:nt,o.classes=o.classes+" "+ft+" "+(n?$t:""));const u={labelStyle:"",shape:o.shape,labelText:o.description,classes:o.classes,style:"",id:s,dir:o.dir,domId:v(s,c),type:o.type,padding:15};if(u.centerLabel=!0,e.note){const d={labelStyle:"",shape:dt,labelText:e.note.text,classes:ht,style:"",id:s+wt+"-"+c,domId:v(s,c,W),type:o.type,padding:15},l={labelStyle:"",shape:lt,labelText:e.note.text,classes:o.classes,style:"",id:s+I,domId:v(s,c,P),type:"group",padding:0};c++;const f=s+I;t.setNode(f,l),t.setNode(d.id,d),t.setNode(s,u),t.setParent(s,f),t.setParent(d.id,f);let b=s,m=d.id;e.note.position==="left of"&&(b=d.id,m=s),t.setEdge(b,m,{arrowhead:"none",arrowType:"",style:j,labelStyle:"",classes:ut,arrowheadStyle:G,labelpos:K,labelType:q,thickness:F})}else t.setNode(s,u)}a&&a.id!=="root"&&(p.trace("Setting node ",s," to be child of its parent ",a.id),t.setParent(s,a.id)),e.doc&&(p.trace("Adding nodes children "),At(t,e,e.doc,r,i,!n))},At=(t,a,e,r,i,n)=>{p.trace("items",e),e.forEach(s=>{switch(s.stmt){case Z:x(t,a,s,r,i,n);break;case L:x(t,a,s,r,i,n);break;case X:{x(t,a,s.state1,r,i,n),x(t,a,s.state2,r,i,n);const y={id:"edge"+c,arrowhead:"normal",arrowTypeEnd:"arrow_barb",style:j,labelStyle:"",label:E.sanitizeText(s.description,S()),arrowheadStyle:G,labelpos:K,labelType:q,thickness:F,classes:M};t.setEdge(s.state1.id,s.state2.id,y,c),c++}break}})},B=(t,a=Y)=>{let e=a;if(t.doc)for(let r=0;r<t.doc.length;r++){const i=t.doc[r];i.stmt==="dir"&&(e=i.value)}return e},kt=async function(t,a,e,r){p.info("Drawing state diagram (v2)",a),T={},r.db.getDirection();const{securityLevel:i,state:n}=S(),s=n.nodeSpacing||50,y=n.rankSpacing||50;p.info(r.db.getRootDocV2()),r.db.extract(r.db.getRootDocV2()),p.info(r.db.getRootDocV2());const g=r.db.getStates(),o=new tt({multigraph:!0,compound:!0}).setGraph({rankdir:B(r.db.getRootDocV2()),nodesep:s,ranksep:y,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}});x(o,void 0,r.db.getRootDocV2(),g,r.db,!0);let u;i==="sandbox"&&(u=A("#i"+a));const d=i==="sandbox"?A(u.nodes()[0].contentDocument.body):A("body"),l=d.select(`[id="${a}"]`),f=d.select("#"+a+" g");await ot(f,o,["barb"],h,a);const b=8;et.insertTitle(l,"statediagramTitleText",n.titleTopMargin,r.db.getDiagramTitle());const m=l.node().getBBox(),R=m.width+b*2,V=m.height+b*2;l.attr("class",h);const N=l.node().getBBox();st(l,V,R,n.useMaxWidth);const O=`${N.x-b} ${N.y-b} ${R} ${V}`;p.debug(`viewBox ${O}`),l.attr("viewBox",O);const Q=document.querySelectorAll('[id="'+a+'"] .edgeLabel .label');for(const D of Q){const _=D.getBBox(),$=document.createElementNS("http://www.w3.org/2000/svg",w);$.setAttribute("rx",0),$.setAttribute("ry",0),$.setAttribute("width",_.width),$.setAttribute("height",_.height),D.insertBefore($,D.firstChild)}},vt={setConf:Tt,getClasses:St,draw:kt},zt={parser:U,db:z,renderer:vt,styles:J,init:t=>{t.state||(t.state={}),t.state.arrowMarkerAbsolute=t.arrowMarkerAbsolute,z.clear()}};export{zt as diagram};