tmex-cli 0.12.2 → 0.12.3

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 (70) hide show
  1. package/CHANGELOG.md +3 -15
  2. package/dist/runtime/server.js +241 -8
  3. package/package.json +1 -1
  4. package/resources/fe-dist/assets/DevicePage-EoPdR0a8.js +15 -0
  5. package/resources/fe-dist/assets/{DevicesPage-C7THDzTX.js → DevicesPage-DaO7f0iC.js} +2 -2
  6. package/resources/fe-dist/assets/{FilePage-D8V8P2IA.js → FilePage-BQsLFpIe.js} +2 -2
  7. package/resources/fe-dist/assets/{SettingsPage-BOTyBhHH.js → SettingsPage-DNq70CL7.js} +5 -10
  8. package/resources/fe-dist/assets/{arc-DcujnLz7.js → arc-Bw8pvFsh.js} +2 -2
  9. package/resources/fe-dist/assets/architectureDiagram-3BPJPVTR-ClXPEeos.js +37 -0
  10. package/resources/fe-dist/assets/{blockDiagram-GPEHLZMM-BFh4xZY2.js → blockDiagram-GPEHLZMM-Sp24bCmA.js} +2 -2
  11. package/resources/fe-dist/assets/{c4Diagram-AAUBKEIU-nUyGK7Ke.js → c4Diagram-AAUBKEIU-DjyOwpgl.js} +2 -2
  12. package/resources/fe-dist/assets/{card-BkRqR9zz.js → card-CMyk5OFt.js} +2 -2
  13. package/resources/fe-dist/assets/channel-B9WrZCGJ.js +2 -0
  14. package/resources/fe-dist/assets/{chunk-2J33WTMH-z2oMKYMn.js → chunk-2J33WTMH-_i-tgxvN.js} +2 -2
  15. package/resources/fe-dist/assets/{chunk-4BX2VUAB-CCD_pyAh.js → chunk-4BX2VUAB-CYDjMAJT.js} +2 -2
  16. package/resources/fe-dist/assets/{chunk-55IACEB6-Dx2_9d-z.js → chunk-55IACEB6-CGcgNWHA.js} +2 -2
  17. package/resources/fe-dist/assets/{chunk-727SXJPM-DA36poir.js → chunk-727SXJPM-CVF1o51L.js} +2 -2
  18. package/resources/fe-dist/assets/{chunk-AQP2D5EJ-CQoXkVd4.js → chunk-AQP2D5EJ-BzXiGlmX.js} +2 -2
  19. package/resources/fe-dist/assets/{chunk-FMBD7UC4-A6Yn7A44.js → chunk-FMBD7UC4-DG7P62CK.js} +2 -2
  20. package/resources/fe-dist/assets/{chunk-ND2GUHAM-BsNl2EMT.js → chunk-ND2GUHAM-C82kWDQB.js} +2 -2
  21. package/resources/fe-dist/assets/{chunk-QZHKN3VN-BM_QNxf6.js → chunk-QZHKN3VN-FB0r6Osl.js} +2 -2
  22. package/resources/fe-dist/assets/classDiagram-4FO5ZUOK-B1-CPF_4.js +2 -0
  23. package/resources/fe-dist/assets/classDiagram-v2-Q7XG4LA2-B1-CPF_4.js +2 -0
  24. package/resources/fe-dist/assets/cose-bilkent-S5V4N54A--v8cfu0h.js +2 -0
  25. package/resources/fe-dist/assets/{dagre-BM42HDAG-C9Up3ckQ.js → dagre-BM42HDAG-BTLOD-KX.js} +2 -2
  26. package/resources/fe-dist/assets/{diagram-2AECGRRQ-CtuDndmY.js → diagram-2AECGRRQ-29BFdqPY.js} +2 -2
  27. package/resources/fe-dist/assets/{diagram-5GNKFQAL-BQfskK8S.js → diagram-5GNKFQAL-t_wHTq5Q.js} +2 -2
  28. package/resources/fe-dist/assets/{diagram-KO2AKTUF-CGJi8q81.js → diagram-KO2AKTUF-JNh9Pmt9.js} +2 -2
  29. package/resources/fe-dist/assets/{diagram-LMA3HP47-DAMQIoLQ.js → diagram-LMA3HP47-DAifhNss.js} +2 -2
  30. package/resources/fe-dist/assets/{diagram-OG6HWLK6-D2s__dFc.js → diagram-OG6HWLK6-BOqtQL5W.js} +2 -2
  31. package/resources/fe-dist/assets/{erDiagram-TEJ5UH35-_UJYLIQN.js → erDiagram-TEJ5UH35-W-aJKAOK.js} +2 -2
  32. package/resources/fe-dist/assets/{flowDiagram-I6XJVG4X-DN-qktDh.js → flowDiagram-I6XJVG4X-DEt1TjbJ.js} +2 -2
  33. package/resources/fe-dist/assets/ganttDiagram-6RSMTGT7-CrYu9aI_.js +293 -0
  34. package/resources/fe-dist/assets/{gitGraphDiagram-PVQCEYII-Qar2sVRo.js → gitGraphDiagram-PVQCEYII-BlltYekf.js} +2 -2
  35. package/resources/fe-dist/assets/index-CXIj7HZi.css +1 -0
  36. package/resources/fe-dist/assets/{index-Ra6pj0rt.js → index-FNpsxYPN.js} +53 -53
  37. package/resources/fe-dist/assets/{infoDiagram-5YYISTIA-2e6tU_v9.js → infoDiagram-5YYISTIA-nhdfbNPF.js} +2 -2
  38. package/resources/fe-dist/assets/{ishikawaDiagram-YF4QCWOH-BghKvoM4.js → ishikawaDiagram-YF4QCWOH-CwluZjLD.js} +2 -2
  39. package/resources/fe-dist/assets/{journeyDiagram-JHISSGLW-D-cHSGb_.js → journeyDiagram-JHISSGLW-BkvLX_wz.js} +2 -2
  40. package/resources/fe-dist/assets/{kanban-definition-UN3LZRKU-BE6Cb-OK.js → kanban-definition-UN3LZRKU-DU_bbXWH.js} +2 -2
  41. package/resources/fe-dist/assets/{linear-CwDBnUH0.js → linear-ByJrBbSQ.js} +2 -2
  42. package/resources/fe-dist/assets/{markdown-preview-BlQiC8ND.js → markdown-preview-D9O-wO1U.js} +4 -4
  43. package/resources/fe-dist/assets/{mermaid.core-DDMkLXrp.js → mermaid.core-DR6r9S_a.js} +6 -6
  44. package/resources/fe-dist/assets/{mindmap-definition-RKZ34NQL-C9xVR7Ut.js → mindmap-definition-RKZ34NQL-BYXsfrSb.js} +2 -2
  45. package/resources/fe-dist/assets/{pieDiagram-4H26LBE5-DW_4RcBv.js → pieDiagram-4H26LBE5-leRJNTgW.js} +2 -2
  46. package/resources/fe-dist/assets/{quadrantDiagram-W4KKPZXB-DoIrZmk2.js → quadrantDiagram-W4KKPZXB-BfxS6APJ.js} +2 -2
  47. package/resources/fe-dist/assets/{requirementDiagram-4Y6WPE33-CYcJSuPe.js → requirementDiagram-4Y6WPE33-D1ViYHCD.js} +2 -2
  48. package/resources/fe-dist/assets/{sankeyDiagram-5OEKKPKP-CrIkKM6h.js → sankeyDiagram-5OEKKPKP-CFjujjK9.js} +2 -2
  49. package/resources/fe-dist/assets/{sequenceDiagram-3UESZ5HK-DgzGHhGk.js → sequenceDiagram-3UESZ5HK-DYKl7nA9.js} +2 -2
  50. package/resources/fe-dist/assets/{stateDiagram-AJRCARHV-C6Dhr3fY.js → stateDiagram-AJRCARHV-C3e0GwoJ.js} +2 -2
  51. package/resources/fe-dist/assets/stateDiagram-v2-BHNVJYJU-Bj3cAhsB.js +2 -0
  52. package/resources/fe-dist/assets/terminal-settings-panel-DLuBkEEZ.js +26 -0
  53. package/resources/fe-dist/assets/{timeline-definition-PNZ67QCA-jJ1iauQ0.js → timeline-definition-PNZ67QCA-DO38TAIg.js} +2 -2
  54. package/resources/fe-dist/assets/{vennDiagram-CIIHVFJN-DLRoaoJ9.js → vennDiagram-CIIHVFJN-Co9hBQx5.js} +2 -2
  55. package/resources/fe-dist/assets/{wardley-L42UT6IY-CykeHWp8.js → wardley-L42UT6IY-lf2QB-Cd.js} +2 -2
  56. package/resources/fe-dist/assets/{wardleyDiagram-YWT4CUSO-U22jzD8a.js → wardleyDiagram-YWT4CUSO-fJgWAjlp.js} +2 -2
  57. package/resources/fe-dist/assets/{xychartDiagram-2RQKCTM6-CiXS9PJ2.js → xychartDiagram-2RQKCTM6-DdxhqP-F.js} +2 -2
  58. package/resources/fe-dist/index.html +2 -2
  59. package/resources/gateway-drizzle/0009_lying_lethal_legion.sql +9 -0
  60. package/resources/gateway-drizzle/meta/_journal.json +7 -0
  61. package/resources/fe-dist/assets/DevicePage-B0fQ6yWB.js +0 -25
  62. package/resources/fe-dist/assets/architectureDiagram-3BPJPVTR-i8499Wfc.js +0 -37
  63. package/resources/fe-dist/assets/channel-DqmfsuLY.js +0 -2
  64. package/resources/fe-dist/assets/classDiagram-4FO5ZUOK-D3Z9BeOE.js +0 -2
  65. package/resources/fe-dist/assets/classDiagram-v2-Q7XG4LA2-D3Z9BeOE.js +0 -2
  66. package/resources/fe-dist/assets/cose-bilkent-S5V4N54A-1lMO_Dod.js +0 -2
  67. package/resources/fe-dist/assets/ganttDiagram-6RSMTGT7-CNuuuhXX.js +0 -293
  68. package/resources/fe-dist/assets/index-BhU3LRKb.css +0 -1
  69. package/resources/fe-dist/assets/stateDiagram-v2-BHNVJYJU-BiSh2azE.js +0 -2
  70. package/resources/fe-dist/assets/terminal-settings-panel-CpnmWQtf.js +0 -9
@@ -1,4 +1,4 @@
1
- import{_ as g,n as er,c as j,d as Bt,l as st,j as Me,e as rr,f as ar,k as P,b as De,s as sr,p as ir,a as nr,g as or,q as cr,t as lr,J as hr,z as dr,i as Vt,u as Z,L as $,M as mt,N as Be,Z as Tr,D as Wt,O as pr,P as Ve}from"./mermaid.core-DDMkLXrp.js";import{a as Er,b as re,g as dt,d as ur,e as ae,f as se}from"./chunk-ND2GUHAM-BsNl2EMT.js";import{I as fr}from"./chunk-QZHKN3VN-BM_QNxf6.js";import"./index-Ra6pj0rt.js";var jt=(function(){var e=g(function(ut,N,v,k){for(v=v||{},k=ut.length;k--;v[ut[k]]=N);return v},"o"),t=[1,2],a=[1,3],r=[1,4],i=[2,4],n=[1,9],s=[1,11],o=[1,12],E=[1,14],d=[1,15],l=[1,17],x=[1,18],u=[1,19],O=[1,25],p=[1,26],f=[1,27],_=[1,28],I=[1,29],L=[1,30],b=[1,31],m=[1,32],w=[1,33],S=[1,34],Y=[1,35],M=[1,36],V=[1,37],G=[1,38],W=[1,39],X=[1,40],Q=[1,42],z=[1,43],it=[1,44],tt=[1,45],nt=[1,46],K=[1,47],C=[1,4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,48,49,50,51,53,54,56,61,62,63,64,73],Pt=[1,74],A=[1,80],D=[1,81],et=[1,82],rt=[1,83],F=[1,84],ie=[1,85],ne=[1,86],oe=[1,87],ce=[1,88],le=[1,89],he=[1,90],de=[1,91],Te=[1,92],pe=[1,93],Ee=[1,94],ue=[1,95],fe=[1,96],_e=[1,97],ge=[1,98],xe=[1,99],Ie=[1,100],ye=[1,101],Re=[1,102],Oe=[1,103],Le=[1,104],be=[1,105],Ae=[2,78],St=[4,5,17,51,53,54],kt=[4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,51,53,54,56,61,62,63,64,73],Se=[4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,50,51,53,54,56,61,62,63,64,73],zt=[4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,49,51,53,54,56,61,62,63,64,73],we=[4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,48,51,53,54,56,61,62,63,64,73],Ut=[5,52],q=[70,71,72,73],ct=[1,151],Gt={trace:g(function(){},"trace"),yy:{},symbols_:{error:2,start:3,SPACE:4,NEWLINE:5,SD:6,document:7,line:8,statement:9,INVALID:10,box_section:11,box_line:12,participant_statement:13,create:14,box:15,restOfLine:16,end:17,signal:18,autonumber:19,NUM:20,off:21,activate:22,actor:23,deactivate:24,note_statement:25,links_statement:26,link_statement:27,properties_statement:28,details_statement:29,title:30,legacy_title:31,acc_title:32,acc_title_value:33,acc_descr:34,acc_descr_value:35,acc_descr_multiline_value:36,loop:37,rect:38,opt:39,alt:40,else_sections:41,par:42,par_sections:43,par_over:44,critical:45,option_sections:46,break:47,option:48,and:49,else:50,participant:51,AS:52,participant_actor:53,destroy:54,actor_with_config:55,note:56,placement:57,text2:58,over:59,actor_pair:60,links:61,link:62,properties:63,details:64,spaceList:65,",":66,left_of:67,right_of:68,signaltype:69,"+":70,"-":71,"()":72,ACTOR:73,config_object:74,CONFIG_START:75,CONFIG_CONTENT:76,CONFIG_END:77,SOLID_OPEN_ARROW:78,DOTTED_OPEN_ARROW:79,SOLID_ARROW:80,SOLID_ARROW_TOP:81,SOLID_ARROW_BOTTOM:82,STICK_ARROW_TOP:83,STICK_ARROW_BOTTOM:84,SOLID_ARROW_TOP_DOTTED:85,SOLID_ARROW_BOTTOM_DOTTED:86,STICK_ARROW_TOP_DOTTED:87,STICK_ARROW_BOTTOM_DOTTED:88,SOLID_ARROW_TOP_REVERSE:89,SOLID_ARROW_BOTTOM_REVERSE:90,STICK_ARROW_TOP_REVERSE:91,STICK_ARROW_BOTTOM_REVERSE:92,SOLID_ARROW_TOP_REVERSE_DOTTED:93,SOLID_ARROW_BOTTOM_REVERSE_DOTTED:94,STICK_ARROW_TOP_REVERSE_DOTTED:95,STICK_ARROW_BOTTOM_REVERSE_DOTTED:96,BIDIRECTIONAL_SOLID_ARROW:97,DOTTED_ARROW:98,BIDIRECTIONAL_DOTTED_ARROW:99,SOLID_CROSS:100,DOTTED_CROSS:101,SOLID_POINT:102,DOTTED_POINT:103,TXT:104,$accept:0,$end:1},terminals_:{2:"error",4:"SPACE",5:"NEWLINE",6:"SD",10:"INVALID",14:"create",15:"box",16:"restOfLine",17:"end",19:"autonumber",20:"NUM",21:"off",22:"activate",24:"deactivate",30:"title",31:"legacy_title",32:"acc_title",33:"acc_title_value",34:"acc_descr",35:"acc_descr_value",36:"acc_descr_multiline_value",37:"loop",38:"rect",39:"opt",40:"alt",42:"par",44:"par_over",45:"critical",47:"break",48:"option",49:"and",50:"else",51:"participant",52:"AS",53:"participant_actor",54:"destroy",56:"note",59:"over",61:"links",62:"link",63:"properties",64:"details",66:",",67:"left_of",68:"right_of",70:"+",71:"-",72:"()",73:"ACTOR",75:"CONFIG_START",76:"CONFIG_CONTENT",77:"CONFIG_END",78:"SOLID_OPEN_ARROW",79:"DOTTED_OPEN_ARROW",80:"SOLID_ARROW",81:"SOLID_ARROW_TOP",82:"SOLID_ARROW_BOTTOM",83:"STICK_ARROW_TOP",84:"STICK_ARROW_BOTTOM",85:"SOLID_ARROW_TOP_DOTTED",86:"SOLID_ARROW_BOTTOM_DOTTED",87:"STICK_ARROW_TOP_DOTTED",88:"STICK_ARROW_BOTTOM_DOTTED",89:"SOLID_ARROW_TOP_REVERSE",90:"SOLID_ARROW_BOTTOM_REVERSE",91:"STICK_ARROW_TOP_REVERSE",92:"STICK_ARROW_BOTTOM_REVERSE",93:"SOLID_ARROW_TOP_REVERSE_DOTTED",94:"SOLID_ARROW_BOTTOM_REVERSE_DOTTED",95:"STICK_ARROW_TOP_REVERSE_DOTTED",96:"STICK_ARROW_BOTTOM_REVERSE_DOTTED",97:"BIDIRECTIONAL_SOLID_ARROW",98:"DOTTED_ARROW",99:"BIDIRECTIONAL_DOTTED_ARROW",100:"SOLID_CROSS",101:"DOTTED_CROSS",102:"SOLID_POINT",103:"DOTTED_POINT",104:"TXT"},productions_:[0,[3,2],[3,2],[3,2],[7,0],[7,2],[8,2],[8,1],[8,1],[8,1],[11,0],[11,2],[12,2],[12,1],[12,1],[9,1],[9,2],[9,4],[9,2],[9,4],[9,3],[9,3],[9,2],[9,3],[9,3],[9,2],[9,2],[9,2],[9,2],[9,2],[9,1],[9,1],[9,2],[9,2],[9,1],[9,4],[9,4],[9,4],[9,4],[9,4],[9,4],[9,4],[9,4],[46,1],[46,4],[43,1],[43,4],[41,1],[41,4],[13,5],[13,3],[13,5],[13,3],[13,3],[13,5],[13,3],[13,5],[13,3],[25,4],[25,4],[26,3],[27,3],[28,3],[29,3],[65,2],[65,1],[60,3],[60,1],[57,1],[57,1],[18,5],[18,5],[18,5],[18,5],[18,6],[18,4],[55,2],[74,3],[23,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[58,1]],performAction:g(function(N,v,k,y,U,c,wt){var T=c.length-1;switch(U){case 3:return y.apply(c[T]),c[T];case 4:case 10:this.$=[];break;case 5:case 11:c[T-1].push(c[T]),this.$=c[T-1];break;case 6:case 7:case 12:case 13:this.$=c[T];break;case 8:case 9:case 14:this.$=[];break;case 16:c[T].type="createParticipant",this.$=c[T];break;case 17:c[T-1].unshift({type:"boxStart",boxData:y.parseBoxData(c[T-2])}),c[T-1].push({type:"boxEnd",boxText:c[T-2]}),this.$=c[T-1];break;case 19:this.$={type:"sequenceIndex",sequenceIndex:Number(c[T-2]),sequenceIndexStep:Number(c[T-1]),sequenceVisible:!0,signalType:y.LINETYPE.AUTONUMBER};break;case 20:this.$={type:"sequenceIndex",sequenceIndex:Number(c[T-1]),sequenceIndexStep:1,sequenceVisible:!0,signalType:y.LINETYPE.AUTONUMBER};break;case 21:this.$={type:"sequenceIndex",sequenceVisible:!1,signalType:y.LINETYPE.AUTONUMBER};break;case 22:this.$={type:"sequenceIndex",sequenceVisible:!0,signalType:y.LINETYPE.AUTONUMBER};break;case 23:this.$={type:"activeStart",signalType:y.LINETYPE.ACTIVE_START,actor:c[T-1].actor};break;case 24:this.$={type:"activeEnd",signalType:y.LINETYPE.ACTIVE_END,actor:c[T-1].actor};break;case 30:y.setDiagramTitle(c[T].substring(6)),this.$=c[T].substring(6);break;case 31:y.setDiagramTitle(c[T].substring(7)),this.$=c[T].substring(7);break;case 32:this.$=c[T].trim(),y.setAccTitle(this.$);break;case 33:case 34:this.$=c[T].trim(),y.setAccDescription(this.$);break;case 35:c[T-1].unshift({type:"loopStart",loopText:y.parseMessage(c[T-2]),signalType:y.LINETYPE.LOOP_START}),c[T-1].push({type:"loopEnd",loopText:c[T-2],signalType:y.LINETYPE.LOOP_END}),this.$=c[T-1];break;case 36:c[T-1].unshift({type:"rectStart",color:y.parseMessage(c[T-2]),signalType:y.LINETYPE.RECT_START}),c[T-1].push({type:"rectEnd",color:y.parseMessage(c[T-2]),signalType:y.LINETYPE.RECT_END}),this.$=c[T-1];break;case 37:c[T-1].unshift({type:"optStart",optText:y.parseMessage(c[T-2]),signalType:y.LINETYPE.OPT_START}),c[T-1].push({type:"optEnd",optText:y.parseMessage(c[T-2]),signalType:y.LINETYPE.OPT_END}),this.$=c[T-1];break;case 38:c[T-1].unshift({type:"altStart",altText:y.parseMessage(c[T-2]),signalType:y.LINETYPE.ALT_START}),c[T-1].push({type:"altEnd",signalType:y.LINETYPE.ALT_END}),this.$=c[T-1];break;case 39:c[T-1].unshift({type:"parStart",parText:y.parseMessage(c[T-2]),signalType:y.LINETYPE.PAR_START}),c[T-1].push({type:"parEnd",signalType:y.LINETYPE.PAR_END}),this.$=c[T-1];break;case 40:c[T-1].unshift({type:"parStart",parText:y.parseMessage(c[T-2]),signalType:y.LINETYPE.PAR_OVER_START}),c[T-1].push({type:"parEnd",signalType:y.LINETYPE.PAR_END}),this.$=c[T-1];break;case 41:c[T-1].unshift({type:"criticalStart",criticalText:y.parseMessage(c[T-2]),signalType:y.LINETYPE.CRITICAL_START}),c[T-1].push({type:"criticalEnd",signalType:y.LINETYPE.CRITICAL_END}),this.$=c[T-1];break;case 42:c[T-1].unshift({type:"breakStart",breakText:y.parseMessage(c[T-2]),signalType:y.LINETYPE.BREAK_START}),c[T-1].push({type:"breakEnd",optText:y.parseMessage(c[T-2]),signalType:y.LINETYPE.BREAK_END}),this.$=c[T-1];break;case 44:this.$=c[T-3].concat([{type:"option",optionText:y.parseMessage(c[T-1]),signalType:y.LINETYPE.CRITICAL_OPTION},c[T]]);break;case 46:this.$=c[T-3].concat([{type:"and",parText:y.parseMessage(c[T-1]),signalType:y.LINETYPE.PAR_AND},c[T]]);break;case 48:this.$=c[T-3].concat([{type:"else",altText:y.parseMessage(c[T-1]),signalType:y.LINETYPE.ALT_ELSE},c[T]]);break;case 49:c[T-3].draw="participant",c[T-3].type="addParticipant",c[T-3].description=y.parseMessage(c[T-1]),this.$=c[T-3];break;case 50:c[T-1].draw="participant",c[T-1].type="addParticipant",this.$=c[T-1];break;case 51:c[T-3].draw="actor",c[T-3].type="addParticipant",c[T-3].description=y.parseMessage(c[T-1]),this.$=c[T-3];break;case 52:case 57:c[T-1].draw="actor",c[T-1].type="addParticipant",this.$=c[T-1];break;case 53:c[T-1].type="destroyParticipant",this.$=c[T-1];break;case 54:c[T-3].draw="participant",c[T-3].type="addParticipant",c[T-3].description=y.parseMessage(c[T-1]),this.$=c[T-3];break;case 55:c[T-1].draw="participant",c[T-1].type="addParticipant",this.$=c[T-1];break;case 56:c[T-3].draw="actor",c[T-3].type="addParticipant",c[T-3].description=y.parseMessage(c[T-1]),this.$=c[T-3];break;case 58:this.$=[c[T-1],{type:"addNote",placement:c[T-2],actor:c[T-1].actor,text:c[T]}];break;case 59:c[T-2]=[].concat(c[T-1],c[T-1]).slice(0,2),c[T-2][0]=c[T-2][0].actor,c[T-2][1]=c[T-2][1].actor,this.$=[c[T-1],{type:"addNote",placement:y.PLACEMENT.OVER,actor:c[T-2].slice(0,2),text:c[T]}];break;case 60:this.$=[c[T-1],{type:"addLinks",actor:c[T-1].actor,text:c[T]}];break;case 61:this.$=[c[T-1],{type:"addALink",actor:c[T-1].actor,text:c[T]}];break;case 62:this.$=[c[T-1],{type:"addProperties",actor:c[T-1].actor,text:c[T]}];break;case 63:this.$=[c[T-1],{type:"addDetails",actor:c[T-1].actor,text:c[T]}];break;case 66:this.$=[c[T-2],c[T]];break;case 67:this.$=c[T];break;case 68:this.$=y.PLACEMENT.LEFTOF;break;case 69:this.$=y.PLACEMENT.RIGHTOF;break;case 70:this.$=[c[T-4],c[T-1],{type:"addMessage",from:c[T-4].actor,to:c[T-1].actor,signalType:c[T-3],msg:c[T],activate:!0},{type:"activeStart",signalType:y.LINETYPE.ACTIVE_START,actor:c[T-1].actor}];break;case 71:this.$=[c[T-4],c[T-1],{type:"addMessage",from:c[T-4].actor,to:c[T-1].actor,signalType:c[T-3],msg:c[T]},{type:"activeEnd",signalType:y.LINETYPE.ACTIVE_END,actor:c[T-4].actor}];break;case 72:this.$=[c[T-4],c[T-1],{type:"addMessage",from:c[T-4].actor,to:c[T-1].actor,signalType:c[T-3],msg:c[T],activate:!0,centralConnection:y.LINETYPE.CENTRAL_CONNECTION},{type:"centralConnection",signalType:y.LINETYPE.CENTRAL_CONNECTION,actor:c[T-1].actor}];break;case 73:this.$=[c[T-4],c[T-1],{type:"addMessage",from:c[T-4].actor,to:c[T-1].actor,signalType:c[T-2],msg:c[T],activate:!1,centralConnection:y.LINETYPE.CENTRAL_CONNECTION_REVERSE},{type:"centralConnectionReverse",signalType:y.LINETYPE.CENTRAL_CONNECTION_REVERSE,actor:c[T-4].actor}];break;case 74:this.$=[c[T-5],c[T-1],{type:"addMessage",from:c[T-5].actor,to:c[T-1].actor,signalType:c[T-3],msg:c[T],activate:!0,centralConnection:y.LINETYPE.CENTRAL_CONNECTION_DUAL},{type:"centralConnection",signalType:y.LINETYPE.CENTRAL_CONNECTION,actor:c[T-1].actor},{type:"centralConnectionReverse",signalType:y.LINETYPE.CENTRAL_CONNECTION_REVERSE,actor:c[T-5].actor}];break;case 75:this.$=[c[T-3],c[T-1],{type:"addMessage",from:c[T-3].actor,to:c[T-1].actor,signalType:c[T-2],msg:c[T]}];break;case 76:this.$={type:"addParticipant",actor:c[T-1],config:c[T]};break;case 77:this.$=c[T-1].trim();break;case 78:this.$={type:"addParticipant",actor:c[T]};break;case 79:this.$=y.LINETYPE.SOLID_OPEN;break;case 80:this.$=y.LINETYPE.DOTTED_OPEN;break;case 81:this.$=y.LINETYPE.SOLID;break;case 82:this.$=y.LINETYPE.SOLID_TOP;break;case 83:this.$=y.LINETYPE.SOLID_BOTTOM;break;case 84:this.$=y.LINETYPE.STICK_TOP;break;case 85:this.$=y.LINETYPE.STICK_BOTTOM;break;case 86:this.$=y.LINETYPE.SOLID_TOP_DOTTED;break;case 87:this.$=y.LINETYPE.SOLID_BOTTOM_DOTTED;break;case 88:this.$=y.LINETYPE.STICK_TOP_DOTTED;break;case 89:this.$=y.LINETYPE.STICK_BOTTOM_DOTTED;break;case 90:this.$=y.LINETYPE.SOLID_ARROW_TOP_REVERSE;break;case 91:this.$=y.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE;break;case 92:this.$=y.LINETYPE.STICK_ARROW_TOP_REVERSE;break;case 93:this.$=y.LINETYPE.STICK_ARROW_BOTTOM_REVERSE;break;case 94:this.$=y.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED;break;case 95:this.$=y.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED;break;case 96:this.$=y.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED;break;case 97:this.$=y.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED;break;case 98:this.$=y.LINETYPE.BIDIRECTIONAL_SOLID;break;case 99:this.$=y.LINETYPE.DOTTED;break;case 100:this.$=y.LINETYPE.BIDIRECTIONAL_DOTTED;break;case 101:this.$=y.LINETYPE.SOLID_CROSS;break;case 102:this.$=y.LINETYPE.DOTTED_CROSS;break;case 103:this.$=y.LINETYPE.SOLID_POINT;break;case 104:this.$=y.LINETYPE.DOTTED_POINT;break;case 105:this.$=y.parseMessage(c[T].trim().substring(1));break}},"anonymous"),table:[{3:1,4:t,5:a,6:r},{1:[3]},{3:5,4:t,5:a,6:r},{3:6,4:t,5:a,6:r},e([1,4,5,10,14,15,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,51,53,54,56,61,62,63,64,73],i,{7:7}),{1:[2,1]},{1:[2,2]},{1:[2,3],4:n,5:s,8:8,9:10,10:o,13:13,14:E,15:d,18:16,19:l,22:x,23:41,24:u,25:20,26:21,27:22,28:23,29:24,30:O,31:p,32:f,34:_,36:I,37:L,38:b,39:m,40:w,42:S,44:Y,45:M,47:V,51:G,53:W,54:X,56:Q,61:z,62:it,63:tt,64:nt,73:K},e(C,[2,5]),{9:48,13:13,14:E,15:d,18:16,19:l,22:x,23:41,24:u,25:20,26:21,27:22,28:23,29:24,30:O,31:p,32:f,34:_,36:I,37:L,38:b,39:m,40:w,42:S,44:Y,45:M,47:V,51:G,53:W,54:X,56:Q,61:z,62:it,63:tt,64:nt,73:K},e(C,[2,7]),e(C,[2,8]),e(C,[2,9]),e(C,[2,15]),{13:49,51:G,53:W,54:X},{16:[1,50]},{5:[1,51]},{5:[1,54],20:[1,52],21:[1,53]},{23:55,73:K},{23:56,73:K},{5:[1,57]},{5:[1,58]},{5:[1,59]},{5:[1,60]},{5:[1,61]},e(C,[2,30]),e(C,[2,31]),{33:[1,62]},{35:[1,63]},e(C,[2,34]),{16:[1,64]},{16:[1,65]},{16:[1,66]},{16:[1,67]},{16:[1,68]},{16:[1,69]},{16:[1,70]},{16:[1,71]},{23:72,55:73,73:Pt},{23:75,55:76,73:Pt},{23:77,73:K},{69:78,72:[1,79],78:A,79:D,80:et,81:rt,82:F,83:ie,84:ne,85:oe,86:ce,87:le,88:he,89:de,90:Te,91:pe,92:Ee,93:ue,94:fe,95:_e,96:ge,97:xe,98:Ie,99:ye,100:Re,101:Oe,102:Le,103:be},{57:106,59:[1,107],67:[1,108],68:[1,109]},{23:110,73:K},{23:111,73:K},{23:112,73:K},{23:113,73:K},e([5,66,72,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104],Ae),e(C,[2,6]),e(C,[2,16]),e(St,[2,10],{11:114}),e(C,[2,18]),{5:[1,116],20:[1,115]},{5:[1,117]},e(C,[2,22]),{5:[1,118]},{5:[1,119]},e(C,[2,25]),e(C,[2,26]),e(C,[2,27]),e(C,[2,28]),e(C,[2,29]),e(C,[2,32]),e(C,[2,33]),e(kt,i,{7:120}),e(kt,i,{7:121}),e(kt,i,{7:122}),e(Se,i,{41:123,7:124}),e(zt,i,{43:125,7:126}),e(zt,i,{7:126,43:127}),e(we,i,{46:128,7:129}),e(kt,i,{7:130}),{5:[1,132],52:[1,131]},{5:[1,134],52:[1,133]},e(Ut,Ae,{74:135,75:[1,136]}),{5:[1,138],52:[1,137]},{5:[1,140],52:[1,139]},{5:[1,141]},{23:145,70:[1,142],71:[1,143],72:[1,144],73:K},{69:146,78:A,79:D,80:et,81:rt,82:F,83:ie,84:ne,85:oe,86:ce,87:le,88:he,89:de,90:Te,91:pe,92:Ee,93:ue,94:fe,95:_e,96:ge,97:xe,98:Ie,99:ye,100:Re,101:Oe,102:Le,103:be},e(q,[2,79]),e(q,[2,80]),e(q,[2,81]),e(q,[2,82]),e(q,[2,83]),e(q,[2,84]),e(q,[2,85]),e(q,[2,86]),e(q,[2,87]),e(q,[2,88]),e(q,[2,89]),e(q,[2,90]),e(q,[2,91]),e(q,[2,92]),e(q,[2,93]),e(q,[2,94]),e(q,[2,95]),e(q,[2,96]),e(q,[2,97]),e(q,[2,98]),e(q,[2,99]),e(q,[2,100]),e(q,[2,101]),e(q,[2,102]),e(q,[2,103]),e(q,[2,104]),{23:147,73:K},{23:149,60:148,73:K},{73:[2,68]},{73:[2,69]},{58:150,104:ct},{58:152,104:ct},{58:153,104:ct},{58:154,104:ct},{4:[1,157],5:[1,159],12:156,13:158,17:[1,155],51:G,53:W,54:X},{5:[1,160]},e(C,[2,20]),e(C,[2,21]),e(C,[2,23]),e(C,[2,24]),{4:n,5:s,8:8,9:10,10:o,13:13,14:E,15:d,17:[1,161],18:16,19:l,22:x,23:41,24:u,25:20,26:21,27:22,28:23,29:24,30:O,31:p,32:f,34:_,36:I,37:L,38:b,39:m,40:w,42:S,44:Y,45:M,47:V,51:G,53:W,54:X,56:Q,61:z,62:it,63:tt,64:nt,73:K},{4:n,5:s,8:8,9:10,10:o,13:13,14:E,15:d,17:[1,162],18:16,19:l,22:x,23:41,24:u,25:20,26:21,27:22,28:23,29:24,30:O,31:p,32:f,34:_,36:I,37:L,38:b,39:m,40:w,42:S,44:Y,45:M,47:V,51:G,53:W,54:X,56:Q,61:z,62:it,63:tt,64:nt,73:K},{4:n,5:s,8:8,9:10,10:o,13:13,14:E,15:d,17:[1,163],18:16,19:l,22:x,23:41,24:u,25:20,26:21,27:22,28:23,29:24,30:O,31:p,32:f,34:_,36:I,37:L,38:b,39:m,40:w,42:S,44:Y,45:M,47:V,51:G,53:W,54:X,56:Q,61:z,62:it,63:tt,64:nt,73:K},{17:[1,164]},{4:n,5:s,8:8,9:10,10:o,13:13,14:E,15:d,17:[2,47],18:16,19:l,22:x,23:41,24:u,25:20,26:21,27:22,28:23,29:24,30:O,31:p,32:f,34:_,36:I,37:L,38:b,39:m,40:w,42:S,44:Y,45:M,47:V,50:[1,165],51:G,53:W,54:X,56:Q,61:z,62:it,63:tt,64:nt,73:K},{17:[1,166]},{4:n,5:s,8:8,9:10,10:o,13:13,14:E,15:d,17:[2,45],18:16,19:l,22:x,23:41,24:u,25:20,26:21,27:22,28:23,29:24,30:O,31:p,32:f,34:_,36:I,37:L,38:b,39:m,40:w,42:S,44:Y,45:M,47:V,49:[1,167],51:G,53:W,54:X,56:Q,61:z,62:it,63:tt,64:nt,73:K},{17:[1,168]},{17:[1,169]},{4:n,5:s,8:8,9:10,10:o,13:13,14:E,15:d,17:[2,43],18:16,19:l,22:x,23:41,24:u,25:20,26:21,27:22,28:23,29:24,30:O,31:p,32:f,34:_,36:I,37:L,38:b,39:m,40:w,42:S,44:Y,45:M,47:V,48:[1,170],51:G,53:W,54:X,56:Q,61:z,62:it,63:tt,64:nt,73:K},{4:n,5:s,8:8,9:10,10:o,13:13,14:E,15:d,17:[1,171],18:16,19:l,22:x,23:41,24:u,25:20,26:21,27:22,28:23,29:24,30:O,31:p,32:f,34:_,36:I,37:L,38:b,39:m,40:w,42:S,44:Y,45:M,47:V,51:G,53:W,54:X,56:Q,61:z,62:it,63:tt,64:nt,73:K},{16:[1,172]},e(C,[2,50]),{16:[1,173]},e(C,[2,55]),e(Ut,[2,76]),{76:[1,174]},{16:[1,175]},e(C,[2,52]),{16:[1,176]},e(C,[2,57]),e(C,[2,53]),{23:177,73:K},{23:178,73:K},{23:179,73:K},{58:180,104:ct},{23:181,72:[1,182],73:K},{58:183,104:ct},{58:184,104:ct},{66:[1,185],104:[2,67]},{5:[2,60]},{5:[2,105]},{5:[2,61]},{5:[2,62]},{5:[2,63]},e(C,[2,17]),e(St,[2,11]),{13:186,51:G,53:W,54:X},e(St,[2,13]),e(St,[2,14]),e(C,[2,19]),e(C,[2,35]),e(C,[2,36]),e(C,[2,37]),e(C,[2,38]),{16:[1,187]},e(C,[2,39]),{16:[1,188]},e(C,[2,40]),e(C,[2,41]),{16:[1,189]},e(C,[2,42]),{5:[1,190]},{5:[1,191]},{77:[1,192]},{5:[1,193]},{5:[1,194]},{58:195,104:ct},{58:196,104:ct},{58:197,104:ct},{5:[2,75]},{58:198,104:ct},{23:199,73:K},{5:[2,58]},{5:[2,59]},{23:200,73:K},e(St,[2,12]),e(Se,i,{7:124,41:201}),e(zt,i,{7:126,43:202}),e(we,i,{7:129,46:203}),e(C,[2,49]),e(C,[2,54]),e(Ut,[2,77]),e(C,[2,51]),e(C,[2,56]),{5:[2,70]},{5:[2,71]},{5:[2,72]},{5:[2,73]},{58:204,104:ct},{104:[2,66]},{17:[2,48]},{17:[2,46]},{17:[2,44]},{5:[2,74]}],defaultActions:{5:[2,1],6:[2,2],108:[2,68],109:[2,69],150:[2,60],151:[2,105],152:[2,61],153:[2,62],154:[2,63],180:[2,75],183:[2,58],184:[2,59],195:[2,70],196:[2,71],197:[2,72],198:[2,73],200:[2,66],201:[2,48],202:[2,46],203:[2,44],204:[2,74]},parseError:g(function(N,v){if(v.recoverable)this.trace(N);else{var k=new Error(N);throw k.hash=v,k}},"parseError"),parse:g(function(N){var v=this,k=[0],y=[],U=[null],c=[],wt=this.table,T="",vt=0,Ne=0,Qe=2,me=1,$e=c.slice.call(arguments,1),J=Object.create(this.lexer),gt={yy:{}};for(var Xt in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Xt)&&(gt.yy[Xt]=this.yy[Xt]);J.setInput(N,gt.yy),gt.yy.lexer=J,gt.yy.parser=this,typeof J.yylloc>"u"&&(J.yylloc={});var Jt=J.yylloc;c.push(Jt);var je=J.options&&J.options.ranges;typeof gt.yy.parseError=="function"?this.parseError=gt.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function tr(ot){k.length=k.length-2*ot,U.length=U.length-ot,c.length=c.length-ot}g(tr,"popStack");function Pe(){var ot;return ot=y.pop()||J.lex()||me,typeof ot!="number"&&(ot instanceof Array&&(y=ot,ot=y.pop()),ot=v.symbols_[ot]||ot),ot}g(Pe,"lex");for(var at,xt,lt,Zt,Ot={},Ct,Tt,ke,Mt;;){if(xt=k[k.length-1],this.defaultActions[xt]?lt=this.defaultActions[xt]:((at===null||typeof at>"u")&&(at=Pe()),lt=wt[xt]&&wt[xt][at]),typeof lt>"u"||!lt.length||!lt[0]){var Qt="";Mt=[];for(Ct in wt[xt])this.terminals_[Ct]&&Ct>Qe&&Mt.push("'"+this.terminals_[Ct]+"'");J.showPosition?Qt="Parse error on line "+(vt+1)+`:
1
+ import{_ as g,n as er,c as j,d as Bt,l as st,j as Me,e as rr,f as ar,k as P,b as De,s as sr,p as ir,a as nr,g as or,q as cr,t as lr,J as hr,z as dr,i as Vt,u as Z,L as $,M as mt,N as Be,Z as Tr,D as Wt,O as pr,P as Ve}from"./mermaid.core-DR6r9S_a.js";import{a as Er,b as re,g as dt,d as ur,e as ae,f as se}from"./chunk-ND2GUHAM-C82kWDQB.js";import{I as fr}from"./chunk-QZHKN3VN-FB0r6Osl.js";import"./index-FNpsxYPN.js";var jt=(function(){var e=g(function(ut,N,v,k){for(v=v||{},k=ut.length;k--;v[ut[k]]=N);return v},"o"),t=[1,2],a=[1,3],r=[1,4],i=[2,4],n=[1,9],s=[1,11],o=[1,12],E=[1,14],d=[1,15],l=[1,17],x=[1,18],u=[1,19],O=[1,25],p=[1,26],f=[1,27],_=[1,28],I=[1,29],L=[1,30],b=[1,31],m=[1,32],w=[1,33],S=[1,34],Y=[1,35],M=[1,36],V=[1,37],G=[1,38],W=[1,39],X=[1,40],Q=[1,42],z=[1,43],it=[1,44],tt=[1,45],nt=[1,46],K=[1,47],C=[1,4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,48,49,50,51,53,54,56,61,62,63,64,73],Pt=[1,74],A=[1,80],D=[1,81],et=[1,82],rt=[1,83],F=[1,84],ie=[1,85],ne=[1,86],oe=[1,87],ce=[1,88],le=[1,89],he=[1,90],de=[1,91],Te=[1,92],pe=[1,93],Ee=[1,94],ue=[1,95],fe=[1,96],_e=[1,97],ge=[1,98],xe=[1,99],Ie=[1,100],ye=[1,101],Re=[1,102],Oe=[1,103],Le=[1,104],be=[1,105],Ae=[2,78],St=[4,5,17,51,53,54],kt=[4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,51,53,54,56,61,62,63,64,73],Se=[4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,50,51,53,54,56,61,62,63,64,73],zt=[4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,49,51,53,54,56,61,62,63,64,73],we=[4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,48,51,53,54,56,61,62,63,64,73],Ut=[5,52],q=[70,71,72,73],ct=[1,151],Gt={trace:g(function(){},"trace"),yy:{},symbols_:{error:2,start:3,SPACE:4,NEWLINE:5,SD:6,document:7,line:8,statement:9,INVALID:10,box_section:11,box_line:12,participant_statement:13,create:14,box:15,restOfLine:16,end:17,signal:18,autonumber:19,NUM:20,off:21,activate:22,actor:23,deactivate:24,note_statement:25,links_statement:26,link_statement:27,properties_statement:28,details_statement:29,title:30,legacy_title:31,acc_title:32,acc_title_value:33,acc_descr:34,acc_descr_value:35,acc_descr_multiline_value:36,loop:37,rect:38,opt:39,alt:40,else_sections:41,par:42,par_sections:43,par_over:44,critical:45,option_sections:46,break:47,option:48,and:49,else:50,participant:51,AS:52,participant_actor:53,destroy:54,actor_with_config:55,note:56,placement:57,text2:58,over:59,actor_pair:60,links:61,link:62,properties:63,details:64,spaceList:65,",":66,left_of:67,right_of:68,signaltype:69,"+":70,"-":71,"()":72,ACTOR:73,config_object:74,CONFIG_START:75,CONFIG_CONTENT:76,CONFIG_END:77,SOLID_OPEN_ARROW:78,DOTTED_OPEN_ARROW:79,SOLID_ARROW:80,SOLID_ARROW_TOP:81,SOLID_ARROW_BOTTOM:82,STICK_ARROW_TOP:83,STICK_ARROW_BOTTOM:84,SOLID_ARROW_TOP_DOTTED:85,SOLID_ARROW_BOTTOM_DOTTED:86,STICK_ARROW_TOP_DOTTED:87,STICK_ARROW_BOTTOM_DOTTED:88,SOLID_ARROW_TOP_REVERSE:89,SOLID_ARROW_BOTTOM_REVERSE:90,STICK_ARROW_TOP_REVERSE:91,STICK_ARROW_BOTTOM_REVERSE:92,SOLID_ARROW_TOP_REVERSE_DOTTED:93,SOLID_ARROW_BOTTOM_REVERSE_DOTTED:94,STICK_ARROW_TOP_REVERSE_DOTTED:95,STICK_ARROW_BOTTOM_REVERSE_DOTTED:96,BIDIRECTIONAL_SOLID_ARROW:97,DOTTED_ARROW:98,BIDIRECTIONAL_DOTTED_ARROW:99,SOLID_CROSS:100,DOTTED_CROSS:101,SOLID_POINT:102,DOTTED_POINT:103,TXT:104,$accept:0,$end:1},terminals_:{2:"error",4:"SPACE",5:"NEWLINE",6:"SD",10:"INVALID",14:"create",15:"box",16:"restOfLine",17:"end",19:"autonumber",20:"NUM",21:"off",22:"activate",24:"deactivate",30:"title",31:"legacy_title",32:"acc_title",33:"acc_title_value",34:"acc_descr",35:"acc_descr_value",36:"acc_descr_multiline_value",37:"loop",38:"rect",39:"opt",40:"alt",42:"par",44:"par_over",45:"critical",47:"break",48:"option",49:"and",50:"else",51:"participant",52:"AS",53:"participant_actor",54:"destroy",56:"note",59:"over",61:"links",62:"link",63:"properties",64:"details",66:",",67:"left_of",68:"right_of",70:"+",71:"-",72:"()",73:"ACTOR",75:"CONFIG_START",76:"CONFIG_CONTENT",77:"CONFIG_END",78:"SOLID_OPEN_ARROW",79:"DOTTED_OPEN_ARROW",80:"SOLID_ARROW",81:"SOLID_ARROW_TOP",82:"SOLID_ARROW_BOTTOM",83:"STICK_ARROW_TOP",84:"STICK_ARROW_BOTTOM",85:"SOLID_ARROW_TOP_DOTTED",86:"SOLID_ARROW_BOTTOM_DOTTED",87:"STICK_ARROW_TOP_DOTTED",88:"STICK_ARROW_BOTTOM_DOTTED",89:"SOLID_ARROW_TOP_REVERSE",90:"SOLID_ARROW_BOTTOM_REVERSE",91:"STICK_ARROW_TOP_REVERSE",92:"STICK_ARROW_BOTTOM_REVERSE",93:"SOLID_ARROW_TOP_REVERSE_DOTTED",94:"SOLID_ARROW_BOTTOM_REVERSE_DOTTED",95:"STICK_ARROW_TOP_REVERSE_DOTTED",96:"STICK_ARROW_BOTTOM_REVERSE_DOTTED",97:"BIDIRECTIONAL_SOLID_ARROW",98:"DOTTED_ARROW",99:"BIDIRECTIONAL_DOTTED_ARROW",100:"SOLID_CROSS",101:"DOTTED_CROSS",102:"SOLID_POINT",103:"DOTTED_POINT",104:"TXT"},productions_:[0,[3,2],[3,2],[3,2],[7,0],[7,2],[8,2],[8,1],[8,1],[8,1],[11,0],[11,2],[12,2],[12,1],[12,1],[9,1],[9,2],[9,4],[9,2],[9,4],[9,3],[9,3],[9,2],[9,3],[9,3],[9,2],[9,2],[9,2],[9,2],[9,2],[9,1],[9,1],[9,2],[9,2],[9,1],[9,4],[9,4],[9,4],[9,4],[9,4],[9,4],[9,4],[9,4],[46,1],[46,4],[43,1],[43,4],[41,1],[41,4],[13,5],[13,3],[13,5],[13,3],[13,3],[13,5],[13,3],[13,5],[13,3],[25,4],[25,4],[26,3],[27,3],[28,3],[29,3],[65,2],[65,1],[60,3],[60,1],[57,1],[57,1],[18,5],[18,5],[18,5],[18,5],[18,6],[18,4],[55,2],[74,3],[23,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[58,1]],performAction:g(function(N,v,k,y,U,c,wt){var T=c.length-1;switch(U){case 3:return y.apply(c[T]),c[T];case 4:case 10:this.$=[];break;case 5:case 11:c[T-1].push(c[T]),this.$=c[T-1];break;case 6:case 7:case 12:case 13:this.$=c[T];break;case 8:case 9:case 14:this.$=[];break;case 16:c[T].type="createParticipant",this.$=c[T];break;case 17:c[T-1].unshift({type:"boxStart",boxData:y.parseBoxData(c[T-2])}),c[T-1].push({type:"boxEnd",boxText:c[T-2]}),this.$=c[T-1];break;case 19:this.$={type:"sequenceIndex",sequenceIndex:Number(c[T-2]),sequenceIndexStep:Number(c[T-1]),sequenceVisible:!0,signalType:y.LINETYPE.AUTONUMBER};break;case 20:this.$={type:"sequenceIndex",sequenceIndex:Number(c[T-1]),sequenceIndexStep:1,sequenceVisible:!0,signalType:y.LINETYPE.AUTONUMBER};break;case 21:this.$={type:"sequenceIndex",sequenceVisible:!1,signalType:y.LINETYPE.AUTONUMBER};break;case 22:this.$={type:"sequenceIndex",sequenceVisible:!0,signalType:y.LINETYPE.AUTONUMBER};break;case 23:this.$={type:"activeStart",signalType:y.LINETYPE.ACTIVE_START,actor:c[T-1].actor};break;case 24:this.$={type:"activeEnd",signalType:y.LINETYPE.ACTIVE_END,actor:c[T-1].actor};break;case 30:y.setDiagramTitle(c[T].substring(6)),this.$=c[T].substring(6);break;case 31:y.setDiagramTitle(c[T].substring(7)),this.$=c[T].substring(7);break;case 32:this.$=c[T].trim(),y.setAccTitle(this.$);break;case 33:case 34:this.$=c[T].trim(),y.setAccDescription(this.$);break;case 35:c[T-1].unshift({type:"loopStart",loopText:y.parseMessage(c[T-2]),signalType:y.LINETYPE.LOOP_START}),c[T-1].push({type:"loopEnd",loopText:c[T-2],signalType:y.LINETYPE.LOOP_END}),this.$=c[T-1];break;case 36:c[T-1].unshift({type:"rectStart",color:y.parseMessage(c[T-2]),signalType:y.LINETYPE.RECT_START}),c[T-1].push({type:"rectEnd",color:y.parseMessage(c[T-2]),signalType:y.LINETYPE.RECT_END}),this.$=c[T-1];break;case 37:c[T-1].unshift({type:"optStart",optText:y.parseMessage(c[T-2]),signalType:y.LINETYPE.OPT_START}),c[T-1].push({type:"optEnd",optText:y.parseMessage(c[T-2]),signalType:y.LINETYPE.OPT_END}),this.$=c[T-1];break;case 38:c[T-1].unshift({type:"altStart",altText:y.parseMessage(c[T-2]),signalType:y.LINETYPE.ALT_START}),c[T-1].push({type:"altEnd",signalType:y.LINETYPE.ALT_END}),this.$=c[T-1];break;case 39:c[T-1].unshift({type:"parStart",parText:y.parseMessage(c[T-2]),signalType:y.LINETYPE.PAR_START}),c[T-1].push({type:"parEnd",signalType:y.LINETYPE.PAR_END}),this.$=c[T-1];break;case 40:c[T-1].unshift({type:"parStart",parText:y.parseMessage(c[T-2]),signalType:y.LINETYPE.PAR_OVER_START}),c[T-1].push({type:"parEnd",signalType:y.LINETYPE.PAR_END}),this.$=c[T-1];break;case 41:c[T-1].unshift({type:"criticalStart",criticalText:y.parseMessage(c[T-2]),signalType:y.LINETYPE.CRITICAL_START}),c[T-1].push({type:"criticalEnd",signalType:y.LINETYPE.CRITICAL_END}),this.$=c[T-1];break;case 42:c[T-1].unshift({type:"breakStart",breakText:y.parseMessage(c[T-2]),signalType:y.LINETYPE.BREAK_START}),c[T-1].push({type:"breakEnd",optText:y.parseMessage(c[T-2]),signalType:y.LINETYPE.BREAK_END}),this.$=c[T-1];break;case 44:this.$=c[T-3].concat([{type:"option",optionText:y.parseMessage(c[T-1]),signalType:y.LINETYPE.CRITICAL_OPTION},c[T]]);break;case 46:this.$=c[T-3].concat([{type:"and",parText:y.parseMessage(c[T-1]),signalType:y.LINETYPE.PAR_AND},c[T]]);break;case 48:this.$=c[T-3].concat([{type:"else",altText:y.parseMessage(c[T-1]),signalType:y.LINETYPE.ALT_ELSE},c[T]]);break;case 49:c[T-3].draw="participant",c[T-3].type="addParticipant",c[T-3].description=y.parseMessage(c[T-1]),this.$=c[T-3];break;case 50:c[T-1].draw="participant",c[T-1].type="addParticipant",this.$=c[T-1];break;case 51:c[T-3].draw="actor",c[T-3].type="addParticipant",c[T-3].description=y.parseMessage(c[T-1]),this.$=c[T-3];break;case 52:case 57:c[T-1].draw="actor",c[T-1].type="addParticipant",this.$=c[T-1];break;case 53:c[T-1].type="destroyParticipant",this.$=c[T-1];break;case 54:c[T-3].draw="participant",c[T-3].type="addParticipant",c[T-3].description=y.parseMessage(c[T-1]),this.$=c[T-3];break;case 55:c[T-1].draw="participant",c[T-1].type="addParticipant",this.$=c[T-1];break;case 56:c[T-3].draw="actor",c[T-3].type="addParticipant",c[T-3].description=y.parseMessage(c[T-1]),this.$=c[T-3];break;case 58:this.$=[c[T-1],{type:"addNote",placement:c[T-2],actor:c[T-1].actor,text:c[T]}];break;case 59:c[T-2]=[].concat(c[T-1],c[T-1]).slice(0,2),c[T-2][0]=c[T-2][0].actor,c[T-2][1]=c[T-2][1].actor,this.$=[c[T-1],{type:"addNote",placement:y.PLACEMENT.OVER,actor:c[T-2].slice(0,2),text:c[T]}];break;case 60:this.$=[c[T-1],{type:"addLinks",actor:c[T-1].actor,text:c[T]}];break;case 61:this.$=[c[T-1],{type:"addALink",actor:c[T-1].actor,text:c[T]}];break;case 62:this.$=[c[T-1],{type:"addProperties",actor:c[T-1].actor,text:c[T]}];break;case 63:this.$=[c[T-1],{type:"addDetails",actor:c[T-1].actor,text:c[T]}];break;case 66:this.$=[c[T-2],c[T]];break;case 67:this.$=c[T];break;case 68:this.$=y.PLACEMENT.LEFTOF;break;case 69:this.$=y.PLACEMENT.RIGHTOF;break;case 70:this.$=[c[T-4],c[T-1],{type:"addMessage",from:c[T-4].actor,to:c[T-1].actor,signalType:c[T-3],msg:c[T],activate:!0},{type:"activeStart",signalType:y.LINETYPE.ACTIVE_START,actor:c[T-1].actor}];break;case 71:this.$=[c[T-4],c[T-1],{type:"addMessage",from:c[T-4].actor,to:c[T-1].actor,signalType:c[T-3],msg:c[T]},{type:"activeEnd",signalType:y.LINETYPE.ACTIVE_END,actor:c[T-4].actor}];break;case 72:this.$=[c[T-4],c[T-1],{type:"addMessage",from:c[T-4].actor,to:c[T-1].actor,signalType:c[T-3],msg:c[T],activate:!0,centralConnection:y.LINETYPE.CENTRAL_CONNECTION},{type:"centralConnection",signalType:y.LINETYPE.CENTRAL_CONNECTION,actor:c[T-1].actor}];break;case 73:this.$=[c[T-4],c[T-1],{type:"addMessage",from:c[T-4].actor,to:c[T-1].actor,signalType:c[T-2],msg:c[T],activate:!1,centralConnection:y.LINETYPE.CENTRAL_CONNECTION_REVERSE},{type:"centralConnectionReverse",signalType:y.LINETYPE.CENTRAL_CONNECTION_REVERSE,actor:c[T-4].actor}];break;case 74:this.$=[c[T-5],c[T-1],{type:"addMessage",from:c[T-5].actor,to:c[T-1].actor,signalType:c[T-3],msg:c[T],activate:!0,centralConnection:y.LINETYPE.CENTRAL_CONNECTION_DUAL},{type:"centralConnection",signalType:y.LINETYPE.CENTRAL_CONNECTION,actor:c[T-1].actor},{type:"centralConnectionReverse",signalType:y.LINETYPE.CENTRAL_CONNECTION_REVERSE,actor:c[T-5].actor}];break;case 75:this.$=[c[T-3],c[T-1],{type:"addMessage",from:c[T-3].actor,to:c[T-1].actor,signalType:c[T-2],msg:c[T]}];break;case 76:this.$={type:"addParticipant",actor:c[T-1],config:c[T]};break;case 77:this.$=c[T-1].trim();break;case 78:this.$={type:"addParticipant",actor:c[T]};break;case 79:this.$=y.LINETYPE.SOLID_OPEN;break;case 80:this.$=y.LINETYPE.DOTTED_OPEN;break;case 81:this.$=y.LINETYPE.SOLID;break;case 82:this.$=y.LINETYPE.SOLID_TOP;break;case 83:this.$=y.LINETYPE.SOLID_BOTTOM;break;case 84:this.$=y.LINETYPE.STICK_TOP;break;case 85:this.$=y.LINETYPE.STICK_BOTTOM;break;case 86:this.$=y.LINETYPE.SOLID_TOP_DOTTED;break;case 87:this.$=y.LINETYPE.SOLID_BOTTOM_DOTTED;break;case 88:this.$=y.LINETYPE.STICK_TOP_DOTTED;break;case 89:this.$=y.LINETYPE.STICK_BOTTOM_DOTTED;break;case 90:this.$=y.LINETYPE.SOLID_ARROW_TOP_REVERSE;break;case 91:this.$=y.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE;break;case 92:this.$=y.LINETYPE.STICK_ARROW_TOP_REVERSE;break;case 93:this.$=y.LINETYPE.STICK_ARROW_BOTTOM_REVERSE;break;case 94:this.$=y.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED;break;case 95:this.$=y.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED;break;case 96:this.$=y.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED;break;case 97:this.$=y.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED;break;case 98:this.$=y.LINETYPE.BIDIRECTIONAL_SOLID;break;case 99:this.$=y.LINETYPE.DOTTED;break;case 100:this.$=y.LINETYPE.BIDIRECTIONAL_DOTTED;break;case 101:this.$=y.LINETYPE.SOLID_CROSS;break;case 102:this.$=y.LINETYPE.DOTTED_CROSS;break;case 103:this.$=y.LINETYPE.SOLID_POINT;break;case 104:this.$=y.LINETYPE.DOTTED_POINT;break;case 105:this.$=y.parseMessage(c[T].trim().substring(1));break}},"anonymous"),table:[{3:1,4:t,5:a,6:r},{1:[3]},{3:5,4:t,5:a,6:r},{3:6,4:t,5:a,6:r},e([1,4,5,10,14,15,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,51,53,54,56,61,62,63,64,73],i,{7:7}),{1:[2,1]},{1:[2,2]},{1:[2,3],4:n,5:s,8:8,9:10,10:o,13:13,14:E,15:d,18:16,19:l,22:x,23:41,24:u,25:20,26:21,27:22,28:23,29:24,30:O,31:p,32:f,34:_,36:I,37:L,38:b,39:m,40:w,42:S,44:Y,45:M,47:V,51:G,53:W,54:X,56:Q,61:z,62:it,63:tt,64:nt,73:K},e(C,[2,5]),{9:48,13:13,14:E,15:d,18:16,19:l,22:x,23:41,24:u,25:20,26:21,27:22,28:23,29:24,30:O,31:p,32:f,34:_,36:I,37:L,38:b,39:m,40:w,42:S,44:Y,45:M,47:V,51:G,53:W,54:X,56:Q,61:z,62:it,63:tt,64:nt,73:K},e(C,[2,7]),e(C,[2,8]),e(C,[2,9]),e(C,[2,15]),{13:49,51:G,53:W,54:X},{16:[1,50]},{5:[1,51]},{5:[1,54],20:[1,52],21:[1,53]},{23:55,73:K},{23:56,73:K},{5:[1,57]},{5:[1,58]},{5:[1,59]},{5:[1,60]},{5:[1,61]},e(C,[2,30]),e(C,[2,31]),{33:[1,62]},{35:[1,63]},e(C,[2,34]),{16:[1,64]},{16:[1,65]},{16:[1,66]},{16:[1,67]},{16:[1,68]},{16:[1,69]},{16:[1,70]},{16:[1,71]},{23:72,55:73,73:Pt},{23:75,55:76,73:Pt},{23:77,73:K},{69:78,72:[1,79],78:A,79:D,80:et,81:rt,82:F,83:ie,84:ne,85:oe,86:ce,87:le,88:he,89:de,90:Te,91:pe,92:Ee,93:ue,94:fe,95:_e,96:ge,97:xe,98:Ie,99:ye,100:Re,101:Oe,102:Le,103:be},{57:106,59:[1,107],67:[1,108],68:[1,109]},{23:110,73:K},{23:111,73:K},{23:112,73:K},{23:113,73:K},e([5,66,72,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104],Ae),e(C,[2,6]),e(C,[2,16]),e(St,[2,10],{11:114}),e(C,[2,18]),{5:[1,116],20:[1,115]},{5:[1,117]},e(C,[2,22]),{5:[1,118]},{5:[1,119]},e(C,[2,25]),e(C,[2,26]),e(C,[2,27]),e(C,[2,28]),e(C,[2,29]),e(C,[2,32]),e(C,[2,33]),e(kt,i,{7:120}),e(kt,i,{7:121}),e(kt,i,{7:122}),e(Se,i,{41:123,7:124}),e(zt,i,{43:125,7:126}),e(zt,i,{7:126,43:127}),e(we,i,{46:128,7:129}),e(kt,i,{7:130}),{5:[1,132],52:[1,131]},{5:[1,134],52:[1,133]},e(Ut,Ae,{74:135,75:[1,136]}),{5:[1,138],52:[1,137]},{5:[1,140],52:[1,139]},{5:[1,141]},{23:145,70:[1,142],71:[1,143],72:[1,144],73:K},{69:146,78:A,79:D,80:et,81:rt,82:F,83:ie,84:ne,85:oe,86:ce,87:le,88:he,89:de,90:Te,91:pe,92:Ee,93:ue,94:fe,95:_e,96:ge,97:xe,98:Ie,99:ye,100:Re,101:Oe,102:Le,103:be},e(q,[2,79]),e(q,[2,80]),e(q,[2,81]),e(q,[2,82]),e(q,[2,83]),e(q,[2,84]),e(q,[2,85]),e(q,[2,86]),e(q,[2,87]),e(q,[2,88]),e(q,[2,89]),e(q,[2,90]),e(q,[2,91]),e(q,[2,92]),e(q,[2,93]),e(q,[2,94]),e(q,[2,95]),e(q,[2,96]),e(q,[2,97]),e(q,[2,98]),e(q,[2,99]),e(q,[2,100]),e(q,[2,101]),e(q,[2,102]),e(q,[2,103]),e(q,[2,104]),{23:147,73:K},{23:149,60:148,73:K},{73:[2,68]},{73:[2,69]},{58:150,104:ct},{58:152,104:ct},{58:153,104:ct},{58:154,104:ct},{4:[1,157],5:[1,159],12:156,13:158,17:[1,155],51:G,53:W,54:X},{5:[1,160]},e(C,[2,20]),e(C,[2,21]),e(C,[2,23]),e(C,[2,24]),{4:n,5:s,8:8,9:10,10:o,13:13,14:E,15:d,17:[1,161],18:16,19:l,22:x,23:41,24:u,25:20,26:21,27:22,28:23,29:24,30:O,31:p,32:f,34:_,36:I,37:L,38:b,39:m,40:w,42:S,44:Y,45:M,47:V,51:G,53:W,54:X,56:Q,61:z,62:it,63:tt,64:nt,73:K},{4:n,5:s,8:8,9:10,10:o,13:13,14:E,15:d,17:[1,162],18:16,19:l,22:x,23:41,24:u,25:20,26:21,27:22,28:23,29:24,30:O,31:p,32:f,34:_,36:I,37:L,38:b,39:m,40:w,42:S,44:Y,45:M,47:V,51:G,53:W,54:X,56:Q,61:z,62:it,63:tt,64:nt,73:K},{4:n,5:s,8:8,9:10,10:o,13:13,14:E,15:d,17:[1,163],18:16,19:l,22:x,23:41,24:u,25:20,26:21,27:22,28:23,29:24,30:O,31:p,32:f,34:_,36:I,37:L,38:b,39:m,40:w,42:S,44:Y,45:M,47:V,51:G,53:W,54:X,56:Q,61:z,62:it,63:tt,64:nt,73:K},{17:[1,164]},{4:n,5:s,8:8,9:10,10:o,13:13,14:E,15:d,17:[2,47],18:16,19:l,22:x,23:41,24:u,25:20,26:21,27:22,28:23,29:24,30:O,31:p,32:f,34:_,36:I,37:L,38:b,39:m,40:w,42:S,44:Y,45:M,47:V,50:[1,165],51:G,53:W,54:X,56:Q,61:z,62:it,63:tt,64:nt,73:K},{17:[1,166]},{4:n,5:s,8:8,9:10,10:o,13:13,14:E,15:d,17:[2,45],18:16,19:l,22:x,23:41,24:u,25:20,26:21,27:22,28:23,29:24,30:O,31:p,32:f,34:_,36:I,37:L,38:b,39:m,40:w,42:S,44:Y,45:M,47:V,49:[1,167],51:G,53:W,54:X,56:Q,61:z,62:it,63:tt,64:nt,73:K},{17:[1,168]},{17:[1,169]},{4:n,5:s,8:8,9:10,10:o,13:13,14:E,15:d,17:[2,43],18:16,19:l,22:x,23:41,24:u,25:20,26:21,27:22,28:23,29:24,30:O,31:p,32:f,34:_,36:I,37:L,38:b,39:m,40:w,42:S,44:Y,45:M,47:V,48:[1,170],51:G,53:W,54:X,56:Q,61:z,62:it,63:tt,64:nt,73:K},{4:n,5:s,8:8,9:10,10:o,13:13,14:E,15:d,17:[1,171],18:16,19:l,22:x,23:41,24:u,25:20,26:21,27:22,28:23,29:24,30:O,31:p,32:f,34:_,36:I,37:L,38:b,39:m,40:w,42:S,44:Y,45:M,47:V,51:G,53:W,54:X,56:Q,61:z,62:it,63:tt,64:nt,73:K},{16:[1,172]},e(C,[2,50]),{16:[1,173]},e(C,[2,55]),e(Ut,[2,76]),{76:[1,174]},{16:[1,175]},e(C,[2,52]),{16:[1,176]},e(C,[2,57]),e(C,[2,53]),{23:177,73:K},{23:178,73:K},{23:179,73:K},{58:180,104:ct},{23:181,72:[1,182],73:K},{58:183,104:ct},{58:184,104:ct},{66:[1,185],104:[2,67]},{5:[2,60]},{5:[2,105]},{5:[2,61]},{5:[2,62]},{5:[2,63]},e(C,[2,17]),e(St,[2,11]),{13:186,51:G,53:W,54:X},e(St,[2,13]),e(St,[2,14]),e(C,[2,19]),e(C,[2,35]),e(C,[2,36]),e(C,[2,37]),e(C,[2,38]),{16:[1,187]},e(C,[2,39]),{16:[1,188]},e(C,[2,40]),e(C,[2,41]),{16:[1,189]},e(C,[2,42]),{5:[1,190]},{5:[1,191]},{77:[1,192]},{5:[1,193]},{5:[1,194]},{58:195,104:ct},{58:196,104:ct},{58:197,104:ct},{5:[2,75]},{58:198,104:ct},{23:199,73:K},{5:[2,58]},{5:[2,59]},{23:200,73:K},e(St,[2,12]),e(Se,i,{7:124,41:201}),e(zt,i,{7:126,43:202}),e(we,i,{7:129,46:203}),e(C,[2,49]),e(C,[2,54]),e(Ut,[2,77]),e(C,[2,51]),e(C,[2,56]),{5:[2,70]},{5:[2,71]},{5:[2,72]},{5:[2,73]},{58:204,104:ct},{104:[2,66]},{17:[2,48]},{17:[2,46]},{17:[2,44]},{5:[2,74]}],defaultActions:{5:[2,1],6:[2,2],108:[2,68],109:[2,69],150:[2,60],151:[2,105],152:[2,61],153:[2,62],154:[2,63],180:[2,75],183:[2,58],184:[2,59],195:[2,70],196:[2,71],197:[2,72],198:[2,73],200:[2,66],201:[2,48],202:[2,46],203:[2,44],204:[2,74]},parseError:g(function(N,v){if(v.recoverable)this.trace(N);else{var k=new Error(N);throw k.hash=v,k}},"parseError"),parse:g(function(N){var v=this,k=[0],y=[],U=[null],c=[],wt=this.table,T="",vt=0,Ne=0,Qe=2,me=1,$e=c.slice.call(arguments,1),J=Object.create(this.lexer),gt={yy:{}};for(var Xt in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Xt)&&(gt.yy[Xt]=this.yy[Xt]);J.setInput(N,gt.yy),gt.yy.lexer=J,gt.yy.parser=this,typeof J.yylloc>"u"&&(J.yylloc={});var Jt=J.yylloc;c.push(Jt);var je=J.options&&J.options.ranges;typeof gt.yy.parseError=="function"?this.parseError=gt.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function tr(ot){k.length=k.length-2*ot,U.length=U.length-ot,c.length=c.length-ot}g(tr,"popStack");function Pe(){var ot;return ot=y.pop()||J.lex()||me,typeof ot!="number"&&(ot instanceof Array&&(y=ot,ot=y.pop()),ot=v.symbols_[ot]||ot),ot}g(Pe,"lex");for(var at,xt,lt,Zt,Ot={},Ct,Tt,ke,Mt;;){if(xt=k[k.length-1],this.defaultActions[xt]?lt=this.defaultActions[xt]:((at===null||typeof at>"u")&&(at=Pe()),lt=wt[xt]&&wt[xt][at]),typeof lt>"u"||!lt.length||!lt[0]){var Qt="";Mt=[];for(Ct in wt[xt])this.terminals_[Ct]&&Ct>Qe&&Mt.push("'"+this.terminals_[Ct]+"'");J.showPosition?Qt="Parse error on line "+(vt+1)+`:
2
2
  `+J.showPosition()+`
3
3
  Expecting `+Mt.join(", ")+", got '"+(this.terminals_[at]||at)+"'":Qt="Parse error on line "+(vt+1)+": Unexpected "+(at==me?"end of input":"'"+(this.terminals_[at]||at)+"'"),this.parseError(Qt,{text:J.match,token:this.terminals_[at]||at,line:J.yylineno,loc:Jt,expected:Mt})}if(lt[0]instanceof Array&&lt.length>1)throw new Error("Parse Error: multiple actions possible at state: "+xt+", token: "+at);switch(lt[0]){case 1:k.push(at),U.push(J.yytext),c.push(J.yylloc),k.push(lt[1]),at=null,Ne=J.yyleng,T=J.yytext,vt=J.yylineno,Jt=J.yylloc;break;case 2:if(Tt=this.productions_[lt[1]][1],Ot.$=U[U.length-Tt],Ot._$={first_line:c[c.length-(Tt||1)].first_line,last_line:c[c.length-1].last_line,first_column:c[c.length-(Tt||1)].first_column,last_column:c[c.length-1].last_column},je&&(Ot._$.range=[c[c.length-(Tt||1)].range[0],c[c.length-1].range[1]]),Zt=this.performAction.apply(Ot,[T,Ne,vt,gt.yy,lt[1],U,c].concat($e)),typeof Zt<"u")return Zt;Tt&&(k=k.slice(0,-1*Tt*2),U=U.slice(0,-1*Tt),c=c.slice(0,-1*Tt)),k.push(this.productions_[lt[1]][0]),U.push(Ot.$),c.push(Ot._$),ke=wt[k[k.length-2]][k[k.length-1]],k.push(ke);break;case 3:return!0}}return!0},"parse")},Ze=(function(){var ut={EOF:1,parseError:g(function(v,k){if(this.yy.parser)this.yy.parser.parseError(v,k);else throw new Error(v)},"parseError"),setInput:g(function(N,v){return this.yy=v||this.yy||{},this._input=N,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:g(function(){var N=this._input[0];this.yytext+=N,this.yyleng++,this.offset++,this.match+=N,this.matched+=N;var v=N.match(/(?:\r\n?|\n).*/g);return v?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),N},"input"),unput:g(function(N){var v=N.length,k=N.split(/(?:\r\n?|\n)/g);this._input=N+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-v),this.offset-=v;var y=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),k.length-1&&(this.yylineno-=k.length-1);var U=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:k?(k.length===y.length?this.yylloc.first_column:0)+y[y.length-k.length].length-k[0].length:this.yylloc.first_column-v},this.options.ranges&&(this.yylloc.range=[U[0],U[0]+this.yyleng-v]),this.yyleng=this.yytext.length,this},"unput"),more:g(function(){return this._more=!0,this},"more"),reject:g(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
4
4
  `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:g(function(N){this.unput(this.match.slice(N))},"less"),pastInput:g(function(){var N=this.matched.substr(0,this.matched.length-this.match.length);return(N.length>20?"...":"")+N.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:g(function(){var N=this.match;return N.length<20&&(N+=this._input.substr(0,20-N.length)),(N.substr(0,20)+(N.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:g(function(){var N=this.pastInput(),v=new Array(N.length+1).join("-");return N+this.upcomingInput()+`
@@ -160,4 +160,4 @@ Expecting `+Mt.join(", ")+", got '"+(this.terminals_[at]||at)+"'":Qt="Parse erro
160
160
  a ${m},${w} 0 0 0 ${L},0
161
161
  l 0,-${b-2*w}
162
162
  `;S.append("path").attr("d",Y),l==="neo"&&S.attr("filter","url(#drop-shadow)");const M=i.get(t.name)??0;pt.has(E)?(S.style("stroke",u[M%u.length]),S.style("fill",x[M%u.length])):S.style("stroke",O),S.attr("transform",`translate(${L}, ${w})`),t.rectData=_,Et(a,$(t.description))(t.description,f,_.x,_.y+35,_.width,_.height,{class:`actor ${Ft}`},a);const V=S.select("path:last-child");if(V.node()){const W=V.node().getBBox();t.height=W.height+(a.sequence.labelBoxHeight??0)}return r||(f.attr("data-et","participant"),f.attr("data-type","database"),f.attr("data-id",t.name)),t.height},"drawActorTypeDatabase"),Pr=g(function(e,t,a,r,i){const n=r?t.stopy:t.starty,s=t.x+t.width/2,o=n+80,E=22,d=e.append("g").lower(),{look:l,theme:x,themeVariables:u}=a,{bkgColorArray:O,borderColorArray:p,actorBorder:f}=u;r||(B++,d.append("line").attr("id","actor"+B).attr("x1",s).attr("y1",o).attr("x2",s).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",t.name).attr("data-et","life-line").attr("data-id",t.name),t.actorCnt=B);const _=e.append("g");let I=yt;r?I+=` ${_t}`:I+=` ${ft}`,_.attr("class",I),_.attr("name",t.name);const L=dt();L.x=t.x,L.y=n,L.fill="#eaeaea",L.width=t.width,L.height=t.height,L.class="actor",_.append("line").attr("id","actor-man-torso"+B).attr("x1",t.x+t.width/2-E*2.5).attr("y1",n+12).attr("x2",t.x+t.width/2-15).attr("y2",n+12),_.append("line").attr("id","actor-man-arms"+B).attr("x1",t.x+t.width/2-E*2.5).attr("y1",n+2).attr("x2",t.x+t.width/2-E*2.5).attr("y2",n+22),_.append("circle").attr("cx",t.x+t.width/2).attr("cy",n+12).attr("r",E),l==="neo"&&_.attr("filter","url(#drop-shadow)");const b=i.get(t.name)??0;pt.has(x)?(_.style("stroke",p[b%p.length]),_.style("fill",O[b%p.length])):_.style("stroke",f);const m=_.node().getBBox();return t.height=m.height+(a.sequence.labelBoxHeight??0),Et(a,$(t.description))(t.description,_,L.x,L.y+15,L.width,L.height,{class:`actor ${yt}`},a),_.attr("transform",`translate(0,${E/2+10})`),r||(_.attr("data-et","participant"),_.attr("data-type","boundary"),_.attr("data-id",t.name)),t.height},"drawActorTypeBoundary"),kr=g(function(e,t,a,r,i){const n=r?t.stopy:t.starty,s=t.x+t.width/2,o=n+80,{look:E,theme:d,themeVariables:l}=a,{bkgColorArray:x,borderColorArray:u,actorBorder:O}=l,p=e.append("g").lower();r||(B++,p.append("line").attr("id","actor"+B).attr("x1",s).attr("y1",o).attr("x2",s).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",t.name).attr("data-et","life-line").attr("data-id",t.name),t.actorCnt=B);const f=e.append("g");let _=yt;r?_+=` ${_t}`:_+=` ${ft}`,f.attr("class",_),f.attr("name",t.name),r||f.attr("data-et","participant").attr("data-type","actor").attr("data-id",t.name);const I=E==="neo"?.5:1,L=E==="neo"?n+(1-I)*30:n;f.append("line").attr("id","actor-man-torso"+B).attr("x1",s).attr("y1",L+25*I).attr("x2",s).attr("y2",L+45*I),f.append("line").attr("id","actor-man-arms"+B).attr("x1",s-It/2*I).attr("y1",L+33*I).attr("x2",s+It/2*I).attr("y2",L+33*I),f.append("line").attr("x1",s-It/2*I).attr("y1",L+60*I).attr("x2",s).attr("y2",L+45*I),f.append("line").attr("x1",s).attr("y1",L+45*I).attr("x2",s+(It/2-2)*I).attr("y2",L+60*I);const b=f.append("circle");b.attr("cx",t.x+t.width/2),b.attr("cy",L+10*I),b.attr("r",15*I),b.attr("width",t.width*I),b.attr("height",t.height*I);const m=f.node().getBBox();t.height=m.height;const w=dt();w.x=t.x,w.y=L,w.fill="#eaeaea",w.width=t.width,w.height=t.height/I,w.class="actor",w.rx=3,w.ry=3;const S=i.get(t.name)??0;return pt.has(d)?(f.style("stroke",u[S%u.length]),f.style("fill",x[S%u.length])):f.style("stroke",O),Et(a,$(t.description))(t.description,f,w.x,L+35*I-(E==="neo"?10:0),w.width,w.height,{class:`actor ${yt}`},a),t.height},"drawActorTypeActor"),Dr=g(async function(e,t,a,r,i,n,s){const o=s??new Map([...n.db.getActors().values()].map((E,d)=>[E.name,d]));switch(t.type){case"actor":return await kr(e,t,a,r,o);case"participant":return await br(e,t,a,r,o);case"boundary":return await Pr(e,t,a,r,o);case"control":return await wr(e,t,a,r,i,o);case"entity":return await Nr(e,t,a,r,o);case"database":return await mr(e,t,a,r,o);case"collections":return await Ar(e,t,a,r,o);case"queue":return await Sr(e,t,a,r,o)}},"drawActor"),vr=g(function(e,t,a){const i=e.append("g");Ke(i,t),t.name&&Et(a)(t.name,i,t.x,t.y+a.boxTextMargin+(t.textMaxHeight||0)/2,t.width,0,{class:"text"},a),i.lower()},"drawBox"),Cr=g(function(e){return e.append("g")},"anchorElement"),Mr=g(function(e,t,a,r,i,n,s){const{theme:o,themeVariables:E}=r,{bkgColorArray:d,borderColorArray:l,mainBkg:x}=E,u=dt(),O=t.anchored,p=t.actor;u.x=t.startx,u.y=t.starty,u.class="activation"+i%3,u.width=t.stopx-t.startx,u.height=a-t.starty;const f=Nt(O,u),I=(s??new Map([...n.db.getActors().values()].map((L,b)=>[L.name,b]))).get(p)??0;pt.has(o)&&(f.style("stroke",l[I%l.length]),f.style("fill",d[I%l.length]??x))},"drawActivation"),Br=g(async function(e,t,a,r,i){const{boxMargin:n,boxTextMargin:s,labelBoxHeight:o,labelBoxWidth:E,messageFontFamily:d,messageFontSize:l,messageFontWeight:x}=r,u=e.append("g").attr("data-et","control-structure").attr("data-id","i"+i.id),O=g(function(_,I,L,b){return u.append("line").attr("x1",_).attr("y1",I).attr("x2",L).attr("y2",b).attr("class","loopLine")},"drawLoopLine");O(t.startx,t.starty,t.stopx,t.starty),O(t.stopx,t.starty,t.stopx,t.stopy),O(t.startx,t.stopy,t.stopx,t.stopy),O(t.startx,t.starty,t.startx,t.stopy),t.sections!==void 0&&t.sections.forEach(function(_){O(t.startx,_.y,t.stopx,_.y).style("stroke-dasharray","3, 3")});let p=re();p.text=a,p.x=t.startx,p.y=t.starty,p.fontFamily=d,p.fontSize=l,p.fontWeight=x,p.anchor="middle",p.valign="middle",p.tspan=!1,p.width=Math.max(E??0,50),p.height=o+(r.look==="neo"?15:0)||20,p.textMargin=s,p.class="labelText",Ye(u,p),p=Fe(),p.text=t.title,p.x=t.startx+E/2+(t.stopx-t.startx)/2,p.y=t.starty+n+s,p.anchor="middle",p.valign="middle",p.textMargin=s,p.class="loopText",p.fontFamily=d,p.fontSize=l,p.fontWeight=x,p.wrap=!0;let f=$(p.text)?await Kt(u,p,t):At(u,p);if(t.sectionTitles!==void 0){for(const[_,I]of Object.entries(t.sectionTitles))if(I.message){p.text=I.message,p.x=t.startx+(t.stopx-t.startx)/2,p.y=t.sections[_].y+n+s,p.class="sectionTitle",p.anchor="middle",p.valign="middle",p.tspan=!1,p.fontFamily=d,p.fontSize=l,p.fontWeight=x,p.wrap=t.wrap,$(p.text)?(t.starty=t.sections[_].y,await Kt(u,p,t)):At(u,p);let L=Math.round(f.map(b=>(b._groups||b)[0][0].getBBox().height).reduce((b,m)=>b+m));t.sections[_].height+=L-(n+s)}}return t.height=Math.round(t.stopy-t.starty),u},"drawLoop"),Ke=g(function(e,t){Er(e,t)},"drawBackgroundRect"),Vr=g(function(e,t){e.append("defs").append("symbol").attr("id",t+"-database").attr("fill-rule","evenodd").attr("clip-rule","evenodd").append("path").attr("transform","scale(.5)").attr("d","M12.258.001l.256.004.255.005.253.008.251.01.249.012.247.015.246.016.242.019.241.02.239.023.236.024.233.027.231.028.229.031.225.032.223.034.22.036.217.038.214.04.211.041.208.043.205.045.201.046.198.048.194.05.191.051.187.053.183.054.18.056.175.057.172.059.168.06.163.061.16.063.155.064.15.066.074.033.073.033.071.034.07.034.069.035.068.035.067.035.066.035.064.036.064.036.062.036.06.036.06.037.058.037.058.037.055.038.055.038.053.038.052.038.051.039.05.039.048.039.047.039.045.04.044.04.043.04.041.04.04.041.039.041.037.041.036.041.034.041.033.042.032.042.03.042.029.042.027.042.026.043.024.043.023.043.021.043.02.043.018.044.017.043.015.044.013.044.012.044.011.045.009.044.007.045.006.045.004.045.002.045.001.045v17l-.001.045-.002.045-.004.045-.006.045-.007.045-.009.044-.011.045-.012.044-.013.044-.015.044-.017.043-.018.044-.02.043-.021.043-.023.043-.024.043-.026.043-.027.042-.029.042-.03.042-.032.042-.033.042-.034.041-.036.041-.037.041-.039.041-.04.041-.041.04-.043.04-.044.04-.045.04-.047.039-.048.039-.05.039-.051.039-.052.038-.053.038-.055.038-.055.038-.058.037-.058.037-.06.037-.06.036-.062.036-.064.036-.064.036-.066.035-.067.035-.068.035-.069.035-.07.034-.071.034-.073.033-.074.033-.15.066-.155.064-.16.063-.163.061-.168.06-.172.059-.175.057-.18.056-.183.054-.187.053-.191.051-.194.05-.198.048-.201.046-.205.045-.208.043-.211.041-.214.04-.217.038-.22.036-.223.034-.225.032-.229.031-.231.028-.233.027-.236.024-.239.023-.241.02-.242.019-.246.016-.247.015-.249.012-.251.01-.253.008-.255.005-.256.004-.258.001-.258-.001-.256-.004-.255-.005-.253-.008-.251-.01-.249-.012-.247-.015-.245-.016-.243-.019-.241-.02-.238-.023-.236-.024-.234-.027-.231-.028-.228-.031-.226-.032-.223-.034-.22-.036-.217-.038-.214-.04-.211-.041-.208-.043-.204-.045-.201-.046-.198-.048-.195-.05-.19-.051-.187-.053-.184-.054-.179-.056-.176-.057-.172-.059-.167-.06-.164-.061-.159-.063-.155-.064-.151-.066-.074-.033-.072-.033-.072-.034-.07-.034-.069-.035-.068-.035-.067-.035-.066-.035-.064-.036-.063-.036-.062-.036-.061-.036-.06-.037-.058-.037-.057-.037-.056-.038-.055-.038-.053-.038-.052-.038-.051-.039-.049-.039-.049-.039-.046-.039-.046-.04-.044-.04-.043-.04-.041-.04-.04-.041-.039-.041-.037-.041-.036-.041-.034-.041-.033-.042-.032-.042-.03-.042-.029-.042-.027-.042-.026-.043-.024-.043-.023-.043-.021-.043-.02-.043-.018-.044-.017-.043-.015-.044-.013-.044-.012-.044-.011-.045-.009-.044-.007-.045-.006-.045-.004-.045-.002-.045-.001-.045v-17l.001-.045.002-.045.004-.045.006-.045.007-.045.009-.044.011-.045.012-.044.013-.044.015-.044.017-.043.018-.044.02-.043.021-.043.023-.043.024-.043.026-.043.027-.042.029-.042.03-.042.032-.042.033-.042.034-.041.036-.041.037-.041.039-.041.04-.041.041-.04.043-.04.044-.04.046-.04.046-.039.049-.039.049-.039.051-.039.052-.038.053-.038.055-.038.056-.038.057-.037.058-.037.06-.037.061-.036.062-.036.063-.036.064-.036.066-.035.067-.035.068-.035.069-.035.07-.034.072-.034.072-.033.074-.033.151-.066.155-.064.159-.063.164-.061.167-.06.172-.059.176-.057.179-.056.184-.054.187-.053.19-.051.195-.05.198-.048.201-.046.204-.045.208-.043.211-.041.214-.04.217-.038.22-.036.223-.034.226-.032.228-.031.231-.028.234-.027.236-.024.238-.023.241-.02.243-.019.245-.016.247-.015.249-.012.251-.01.253-.008.255-.005.256-.004.258-.001.258.001zm-9.258 20.499v.01l.001.021.003.021.004.022.005.021.006.022.007.022.009.023.01.022.011.023.012.023.013.023.015.023.016.024.017.023.018.024.019.024.021.024.022.025.023.024.024.025.052.049.056.05.061.051.066.051.07.051.075.051.079.052.084.052.088.052.092.052.097.052.102.051.105.052.11.052.114.051.119.051.123.051.127.05.131.05.135.05.139.048.144.049.147.047.152.047.155.047.16.045.163.045.167.043.171.043.176.041.178.041.183.039.187.039.19.037.194.035.197.035.202.033.204.031.209.03.212.029.216.027.219.025.222.024.226.021.23.02.233.018.236.016.24.015.243.012.246.01.249.008.253.005.256.004.259.001.26-.001.257-.004.254-.005.25-.008.247-.011.244-.012.241-.014.237-.016.233-.018.231-.021.226-.021.224-.024.22-.026.216-.027.212-.028.21-.031.205-.031.202-.034.198-.034.194-.036.191-.037.187-.039.183-.04.179-.04.175-.042.172-.043.168-.044.163-.045.16-.046.155-.046.152-.047.148-.048.143-.049.139-.049.136-.05.131-.05.126-.05.123-.051.118-.052.114-.051.11-.052.106-.052.101-.052.096-.052.092-.052.088-.053.083-.051.079-.052.074-.052.07-.051.065-.051.06-.051.056-.05.051-.05.023-.024.023-.025.021-.024.02-.024.019-.024.018-.024.017-.024.015-.023.014-.024.013-.023.012-.023.01-.023.01-.022.008-.022.006-.022.006-.022.004-.022.004-.021.001-.021.001-.021v-4.127l-.077.055-.08.053-.083.054-.085.053-.087.052-.09.052-.093.051-.095.05-.097.05-.1.049-.102.049-.105.048-.106.047-.109.047-.111.046-.114.045-.115.045-.118.044-.12.043-.122.042-.124.042-.126.041-.128.04-.13.04-.132.038-.134.038-.135.037-.138.037-.139.035-.142.035-.143.034-.144.033-.147.032-.148.031-.15.03-.151.03-.153.029-.154.027-.156.027-.158.026-.159.025-.161.024-.162.023-.163.022-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.011-.178.01-.179.008-.179.008-.181.006-.182.005-.182.004-.184.003-.184.002h-.37l-.184-.002-.184-.003-.182-.004-.182-.005-.181-.006-.179-.008-.179-.008-.178-.01-.176-.011-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.022-.162-.023-.161-.024-.159-.025-.157-.026-.156-.027-.155-.027-.153-.029-.151-.03-.15-.03-.148-.031-.146-.032-.145-.033-.143-.034-.141-.035-.14-.035-.137-.037-.136-.037-.134-.038-.132-.038-.13-.04-.128-.04-.126-.041-.124-.042-.122-.042-.12-.044-.117-.043-.116-.045-.113-.045-.112-.046-.109-.047-.106-.047-.105-.048-.102-.049-.1-.049-.097-.05-.095-.05-.093-.052-.09-.051-.087-.052-.085-.053-.083-.054-.08-.054-.077-.054v4.127zm0-5.654v.011l.001.021.003.021.004.021.005.022.006.022.007.022.009.022.01.022.011.023.012.023.013.023.015.024.016.023.017.024.018.024.019.024.021.024.022.024.023.025.024.024.052.05.056.05.061.05.066.051.07.051.075.052.079.051.084.052.088.052.092.052.097.052.102.052.105.052.11.051.114.051.119.052.123.05.127.051.131.05.135.049.139.049.144.048.147.048.152.047.155.046.16.045.163.045.167.044.171.042.176.042.178.04.183.04.187.038.19.037.194.036.197.034.202.033.204.032.209.03.212.028.216.027.219.025.222.024.226.022.23.02.233.018.236.016.24.014.243.012.246.01.249.008.253.006.256.003.259.001.26-.001.257-.003.254-.006.25-.008.247-.01.244-.012.241-.015.237-.016.233-.018.231-.02.226-.022.224-.024.22-.025.216-.027.212-.029.21-.03.205-.032.202-.033.198-.035.194-.036.191-.037.187-.039.183-.039.179-.041.175-.042.172-.043.168-.044.163-.045.16-.045.155-.047.152-.047.148-.048.143-.048.139-.05.136-.049.131-.05.126-.051.123-.051.118-.051.114-.052.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.051.07-.052.065-.051.06-.05.056-.051.051-.049.023-.025.023-.024.021-.025.02-.024.019-.024.018-.024.017-.024.015-.023.014-.023.013-.024.012-.022.01-.023.01-.023.008-.022.006-.022.006-.022.004-.021.004-.022.001-.021.001-.021v-4.139l-.077.054-.08.054-.083.054-.085.052-.087.053-.09.051-.093.051-.095.051-.097.05-.1.049-.102.049-.105.048-.106.047-.109.047-.111.046-.114.045-.115.044-.118.044-.12.044-.122.042-.124.042-.126.041-.128.04-.13.039-.132.039-.134.038-.135.037-.138.036-.139.036-.142.035-.143.033-.144.033-.147.033-.148.031-.15.03-.151.03-.153.028-.154.028-.156.027-.158.026-.159.025-.161.024-.162.023-.163.022-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.011-.178.009-.179.009-.179.007-.181.007-.182.005-.182.004-.184.003-.184.002h-.37l-.184-.002-.184-.003-.182-.004-.182-.005-.181-.007-.179-.007-.179-.009-.178-.009-.176-.011-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.022-.162-.023-.161-.024-.159-.025-.157-.026-.156-.027-.155-.028-.153-.028-.151-.03-.15-.03-.148-.031-.146-.033-.145-.033-.143-.033-.141-.035-.14-.036-.137-.036-.136-.037-.134-.038-.132-.039-.13-.039-.128-.04-.126-.041-.124-.042-.122-.043-.12-.043-.117-.044-.116-.044-.113-.046-.112-.046-.109-.046-.106-.047-.105-.048-.102-.049-.1-.049-.097-.05-.095-.051-.093-.051-.09-.051-.087-.053-.085-.052-.083-.054-.08-.054-.077-.054v4.139zm0-5.666v.011l.001.02.003.022.004.021.005.022.006.021.007.022.009.023.01.022.011.023.012.023.013.023.015.023.016.024.017.024.018.023.019.024.021.025.022.024.023.024.024.025.052.05.056.05.061.05.066.051.07.051.075.052.079.051.084.052.088.052.092.052.097.052.102.052.105.051.11.052.114.051.119.051.123.051.127.05.131.05.135.05.139.049.144.048.147.048.152.047.155.046.16.045.163.045.167.043.171.043.176.042.178.04.183.04.187.038.19.037.194.036.197.034.202.033.204.032.209.03.212.028.216.027.219.025.222.024.226.021.23.02.233.018.236.017.24.014.243.012.246.01.249.008.253.006.256.003.259.001.26-.001.257-.003.254-.006.25-.008.247-.01.244-.013.241-.014.237-.016.233-.018.231-.02.226-.022.224-.024.22-.025.216-.027.212-.029.21-.03.205-.032.202-.033.198-.035.194-.036.191-.037.187-.039.183-.039.179-.041.175-.042.172-.043.168-.044.163-.045.16-.045.155-.047.152-.047.148-.048.143-.049.139-.049.136-.049.131-.051.126-.05.123-.051.118-.052.114-.051.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.052.07-.051.065-.051.06-.051.056-.05.051-.049.023-.025.023-.025.021-.024.02-.024.019-.024.018-.024.017-.024.015-.023.014-.024.013-.023.012-.023.01-.022.01-.023.008-.022.006-.022.006-.022.004-.022.004-.021.001-.021.001-.021v-4.153l-.077.054-.08.054-.083.053-.085.053-.087.053-.09.051-.093.051-.095.051-.097.05-.1.049-.102.048-.105.048-.106.048-.109.046-.111.046-.114.046-.115.044-.118.044-.12.043-.122.043-.124.042-.126.041-.128.04-.13.039-.132.039-.134.038-.135.037-.138.036-.139.036-.142.034-.143.034-.144.033-.147.032-.148.032-.15.03-.151.03-.153.028-.154.028-.156.027-.158.026-.159.024-.161.024-.162.023-.163.023-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.01-.178.01-.179.009-.179.007-.181.006-.182.006-.182.004-.184.003-.184.001-.185.001-.185-.001-.184-.001-.184-.003-.182-.004-.182-.006-.181-.006-.179-.007-.179-.009-.178-.01-.176-.01-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.023-.162-.023-.161-.024-.159-.024-.157-.026-.156-.027-.155-.028-.153-.028-.151-.03-.15-.03-.148-.032-.146-.032-.145-.033-.143-.034-.141-.034-.14-.036-.137-.036-.136-.037-.134-.038-.132-.039-.13-.039-.128-.041-.126-.041-.124-.041-.122-.043-.12-.043-.117-.044-.116-.044-.113-.046-.112-.046-.109-.046-.106-.048-.105-.048-.102-.048-.1-.05-.097-.049-.095-.051-.093-.051-.09-.052-.087-.052-.085-.053-.083-.053-.08-.054-.077-.054v4.153zm8.74-8.179l-.257.004-.254.005-.25.008-.247.011-.244.012-.241.014-.237.016-.233.018-.231.021-.226.022-.224.023-.22.026-.216.027-.212.028-.21.031-.205.032-.202.033-.198.034-.194.036-.191.038-.187.038-.183.04-.179.041-.175.042-.172.043-.168.043-.163.045-.16.046-.155.046-.152.048-.148.048-.143.048-.139.049-.136.05-.131.05-.126.051-.123.051-.118.051-.114.052-.11.052-.106.052-.101.052-.096.052-.092.052-.088.052-.083.052-.079.052-.074.051-.07.052-.065.051-.06.05-.056.05-.051.05-.023.025-.023.024-.021.024-.02.025-.019.024-.018.024-.017.023-.015.024-.014.023-.013.023-.012.023-.01.023-.01.022-.008.022-.006.023-.006.021-.004.022-.004.021-.001.021-.001.021.001.021.001.021.004.021.004.022.006.021.006.023.008.022.01.022.01.023.012.023.013.023.014.023.015.024.017.023.018.024.019.024.02.025.021.024.023.024.023.025.051.05.056.05.06.05.065.051.07.052.074.051.079.052.083.052.088.052.092.052.096.052.101.052.106.052.11.052.114.052.118.051.123.051.126.051.131.05.136.05.139.049.143.048.148.048.152.048.155.046.16.046.163.045.168.043.172.043.175.042.179.041.183.04.187.038.191.038.194.036.198.034.202.033.205.032.21.031.212.028.216.027.22.026.224.023.226.022.231.021.233.018.237.016.241.014.244.012.247.011.25.008.254.005.257.004.26.001.26-.001.257-.004.254-.005.25-.008.247-.011.244-.012.241-.014.237-.016.233-.018.231-.021.226-.022.224-.023.22-.026.216-.027.212-.028.21-.031.205-.032.202-.033.198-.034.194-.036.191-.038.187-.038.183-.04.179-.041.175-.042.172-.043.168-.043.163-.045.16-.046.155-.046.152-.048.148-.048.143-.048.139-.049.136-.05.131-.05.126-.051.123-.051.118-.051.114-.052.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.051.07-.052.065-.051.06-.05.056-.05.051-.05.023-.025.023-.024.021-.024.02-.025.019-.024.018-.024.017-.023.015-.024.014-.023.013-.023.012-.023.01-.023.01-.022.008-.022.006-.023.006-.021.004-.022.004-.021.001-.021.001-.021-.001-.021-.001-.021-.004-.021-.004-.022-.006-.021-.006-.023-.008-.022-.01-.022-.01-.023-.012-.023-.013-.023-.014-.023-.015-.024-.017-.023-.018-.024-.019-.024-.02-.025-.021-.024-.023-.024-.023-.025-.051-.05-.056-.05-.06-.05-.065-.051-.07-.052-.074-.051-.079-.052-.083-.052-.088-.052-.092-.052-.096-.052-.101-.052-.106-.052-.11-.052-.114-.052-.118-.051-.123-.051-.126-.051-.131-.05-.136-.05-.139-.049-.143-.048-.148-.048-.152-.048-.155-.046-.16-.046-.163-.045-.168-.043-.172-.043-.175-.042-.179-.041-.183-.04-.187-.038-.191-.038-.194-.036-.198-.034-.202-.033-.205-.032-.21-.031-.212-.028-.216-.027-.22-.026-.224-.023-.226-.022-.231-.021-.233-.018-.237-.016-.241-.014-.244-.012-.247-.011-.25-.008-.254-.005-.257-.004-.26-.001-.26.001z")},"insertDatabaseIcon"),Yr=g(function(e,t){e.append("defs").append("symbol").attr("id",t+"-computer").attr("width","24").attr("height","24").append("path").attr("transform","scale(.5)").attr("d","M2 2v13h20v-13h-20zm18 11h-16v-9h16v9zm-10.228 6l.466-1h3.524l.467 1h-4.457zm14.228 3h-24l2-6h2.104l-1.33 4h18.45l-1.297-4h2.073l2 6zm-5-10h-14v-7h14v7z")},"insertComputerIcon"),Wr=g(function(e,t){e.append("defs").append("symbol").attr("id",t+"-clock").attr("width","24").attr("height","24").append("path").attr("transform","scale(.5)").attr("d","M12 2c5.514 0 10 4.486 10 10s-4.486 10-10 10-10-4.486-10-10 4.486-10 10-10zm0-2c-6.627 0-12 5.373-12 12s5.373 12 12 12 12-5.373 12-12-5.373-12-12-12zm5.848 12.459c.202.038.202.333.001.372-1.907.361-6.045 1.111-6.547 1.111-.719 0-1.301-.582-1.301-1.301 0-.512.77-5.447 1.125-7.445.034-.192.312-.181.343.014l.985 6.238 5.394 1.011z")},"insertClockIcon"),Kr=g(function(e,t){e.append("defs").append("marker").attr("id",t+"-arrowhead").attr("refX",7.9).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto-start-reverse").append("path").attr("d","M -1 0 L 10 5 L 0 10 z")},"insertArrowHead"),Fr=g(function(e,t){e.append("defs").append("marker").attr("id",t+"-filled-head").attr("refX",15.5).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L14,7 L9,1 Z")},"insertArrowFilledHead"),qr=g(function(e,t){e.append("defs").append("marker").attr("id",t+"-sequencenumber").attr("refX",15).attr("refY",15).attr("markerWidth",60).attr("markerHeight",40).attr("orient","auto").append("circle").attr("cx",15).attr("cy",15).attr("r",6)},"insertSequenceNumber"),Hr=g(function(e,t){e.append("defs").append("marker").attr("id",t+"-crosshead").attr("markerWidth",15).attr("markerHeight",8).attr("orient","auto").attr("refX",4).attr("refY",4.5).append("path").attr("fill","none").attr("stroke","#000000").style("stroke-dasharray","0, 0").attr("stroke-width","1pt").attr("d","M 1,2 L 6,7 M 6,2 L 1,7")},"insertArrowCrossHead"),zr=g(function(e,t){const{theme:a}=t;e.append("defs").append("filter").attr("id","drop-shadow").attr("height","130%").attr("width","130%").append("feDropShadow").attr("dx","4").attr("dy","4").attr("stdDeviation",0).attr("flood-opacity","0.06").attr("flood-color",`${a==="redux"||a==="redux-color"?"#000000":"#FFFFFF"}`)},"insertDropShadow"),Fe=g(function(){return{x:0,y:0,fill:void 0,anchor:void 0,style:"#666",width:void 0,height:void 0,textMargin:0,rx:0,ry:0,tspan:!0,valign:void 0}},"getTextObj"),Ur=g(function(){return{x:0,y:0,fill:"#EDF2AE",stroke:"#666",width:100,anchor:"start",height:100,rx:0,ry:0}},"getNoteRect"),Et=(function(){function e(n,s,o,E,d,l,x){const u=s.append("text").attr("x",o+d/2).attr("y",E+l/2+5).style("text-anchor","middle").text(n);i(u,x)}g(e,"byText");function t(n,s,o,E,d,l,x,u){const{actorFontSize:O,actorFontFamily:p,actorFontWeight:f}=u,[_,I]=Be(O),L=n.split(P.lineBreakRegex);for(let b=0;b<L.length;b++){const m=b*_-_*(L.length-1)/2,w=s.append("text").attr("x",o+d/2).attr("y",E).style("text-anchor","middle").style("font-size",I).style("font-weight",f).style("font-family",p);w.append("tspan").attr("x",o+d/2).attr("dy",m).text(L[b]),w.attr("y",E+l/2).attr("dominant-baseline","central").attr("alignment-baseline","central"),i(w,x)}}g(t,"byTspan");function a(n,s,o,E,d,l,x,u){const O=s.append("switch"),f=O.append("foreignObject").attr("x",o).attr("y",E).attr("width",d).attr("height",l).append("xhtml:div").style("display","table").style("height","100%").style("width","100%");f.append("div").style("display","table-cell").style("text-align","center").style("vertical-align","middle").text(n),t(n,O,o,E,d,l,x,u),i(f,x)}g(a,"byFo");async function r(n,s,o,E,d,l,x,u){const O=await mt(n,Wt()),p=s.append("switch"),_=p.append("foreignObject").attr("x",o+d/2-O.width/2).attr("y",E+l/2-O.height/2).attr("width",O.width).attr("height",O.height).append("xhtml:div").style("height","100%").style("width","100%");_.append("div").style("text-align","center").style("vertical-align","middle").html(await Ve(n,Wt())),t(n,p,o,E,d,l,x,u),i(_,x)}g(r,"byKatex");function i(n,s){for(const o in s)s.hasOwnProperty(o)&&n.attr(o,s[o])}return g(i,"_setTextAttrs"),function(n,s=!1){return s?r:n.textPlacement==="fo"?a:n.textPlacement==="old"?e:t}})(),Gr=(function(){function e(i,n,s,o,E,d,l){const x=n.append("text").attr("x",s).attr("y",o).style("text-anchor","start").text(i);r(x,l)}g(e,"byText");function t(i,n,s,o,E,d,l,x){const{actorFontSize:u,actorFontFamily:O,actorFontWeight:p}=x,f=i.split(P.lineBreakRegex);for(let _=0;_<f.length;_++){const I=_*u-u*(f.length-1)/2,L=n.append("text").attr("x",s).attr("y",o).style("text-anchor","start").style("font-size",u).style("font-weight",p).style("font-family",O);L.append("tspan").attr("x",s).attr("dy",I).text(f[_]),L.attr("y",o+d/2).attr("dominant-baseline","central").attr("alignment-baseline","central"),r(L,l)}}g(t,"byTspan");function a(i,n,s,o,E,d,l,x){const u=n.append("switch"),p=u.append("foreignObject").attr("x",s).attr("y",o).attr("width",E).attr("height",d).append("xhtml:div").style("display","table").style("height","100%").style("width","100%");p.append("div").style("display","table-cell").style("text-align","center").style("vertical-align","middle").text(i),t(i,u,s,o,E,d,l,x),r(p,l)}g(a,"byFo");function r(i,n){for(const s in n)n.hasOwnProperty(s)&&i.attr(s,n[s])}return g(r,"_setTextAttrs"),function(i){return i.textPlacement==="fo"?a:i.textPlacement==="old"?e:t}})(),Xr=g(function(e,t){e.append("defs").append("marker").attr("id",t+"-solidTopArrowHead").attr("refX",7.9).attr("refY",7.25).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto-start-reverse").append("path").attr("d","M 0 0 L 10 8 L 0 8 z")},"insertSolidTopArrowHead"),Jr=g(function(e,t){e.append("defs").append("marker").attr("id",t+"-solidBottomArrowHead").attr("refX",7.9).attr("refY",.75).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto-start-reverse").append("path").attr("d","M 0 0 L 10 0 L 0 8 z")},"insertSolidBottomArrowHead"),Zr=g(function(e,t){e.append("defs").append("marker").attr("id",t+"-stickTopArrowHead").attr("refX",7.5).attr("refY",7).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto-start-reverse").append("path").attr("d","M 0 0 L 7 7").attr("stroke","black").attr("stroke-width",1.5).attr("fill","none")},"insertStickTopArrowHead"),Qr=g(function(e,t){e.append("defs").append("marker").attr("id",t+"-stickBottomArrowHead").attr("refX",7.5).attr("refY",0).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto-start-reverse").append("path").attr("d","M 0 7 L 7 0").attr("stroke","black").attr("stroke-width",1.5).attr("fill","none")},"insertStickBottomArrowHead"),H={drawRect:Nt,drawText:At,drawLabel:Ye,drawActor:Dr,drawBox:vr,drawPopup:Lr,anchorElement:Cr,drawActivation:Mr,drawLoop:Br,drawBackgroundRect:Ke,insertArrowHead:Kr,insertArrowFilledHead:Fr,insertSequenceNumber:qr,insertArrowCrossHead:Hr,insertDatabaseIcon:Vr,insertComputerIcon:Yr,insertClockIcon:Wr,getTextObj:Fe,getNoteRect:Ur,fixLifeLineHeights:We,sanitizeUrl:Me.sanitizeUrl,insertDropShadow:zr,insertSolidTopArrowHead:Xr,insertSolidBottomArrowHead:Jr,insertStickTopArrowHead:Zr,insertStickBottomArrowHead:Qr},h={},R={data:{startx:void 0,stopx:void 0,starty:void 0,stopy:void 0},verticalPos:0,sequenceItems:[],activations:[],models:{getHeight:g(function(){return Math.max.apply(null,this.actors.length===0?[0]:this.actors.map(e=>e.height||0))+(this.loops.length===0?0:this.loops.map(e=>e.height||0).reduce((e,t)=>e+t))+(this.messages.length===0?0:this.messages.map(e=>e.height||0).reduce((e,t)=>e+t))+(this.notes.length===0?0:this.notes.map(e=>e.height||0).reduce((e,t)=>e+t))},"getHeight"),clear:g(function(){this.actors=[],this.boxes=[],this.loops=[],this.messages=[],this.notes=[]},"clear"),addBox:g(function(e){this.boxes.push(e)},"addBox"),addActor:g(function(e){this.actors.push(e)},"addActor"),addLoop:g(function(e){this.loops.push(e)},"addLoop"),addMessage:g(function(e){this.messages.push(e)},"addMessage"),addNote:g(function(e){this.notes.push(e)},"addNote"),lastActor:g(function(){return this.actors[this.actors.length-1]},"lastActor"),lastLoop:g(function(){return this.loops[this.loops.length-1]},"lastLoop"),lastMessage:g(function(){return this.messages[this.messages.length-1]},"lastMessage"),lastNote:g(function(){return this.notes[this.notes.length-1]},"lastNote"),actors:[],boxes:[],loops:[],messages:[],notes:[]},init:g(function(){this.sequenceItems=[],this.activations=[],this.models.clear(),this.data={startx:void 0,stopx:void 0,starty:void 0,stopy:void 0},this.verticalPos=0,ze(j())},"init"),updateVal:g(function(e,t,a,r){e[t]===void 0?e[t]=a:e[t]=r(a,e[t])},"updateVal"),updateBounds:g(function(e,t,a,r){const i=this;let n=0;function s(o){return g(function(d){n++;const l=i.sequenceItems.length-n+1;i.updateVal(d,"starty",t-l*h.boxMargin,Math.min),i.updateVal(d,"stopy",r+l*h.boxMargin,Math.max),i.updateVal(R.data,"startx",e-l*h.boxMargin,Math.min),i.updateVal(R.data,"stopx",a+l*h.boxMargin,Math.max),o!=="activation"&&(i.updateVal(d,"startx",e-l*h.boxMargin,Math.min),i.updateVal(d,"stopx",a+l*h.boxMargin,Math.max),i.updateVal(R.data,"starty",t-l*h.boxMargin,Math.min),i.updateVal(R.data,"stopy",r+l*h.boxMargin,Math.max))},"updateItemBounds")}g(s,"updateFn"),this.sequenceItems.forEach(s()),this.activations.forEach(s("activation"))},"updateBounds"),insert:g(function(e,t,a,r){const i=P.getMin(e,a),n=P.getMax(e,a),s=P.getMin(t,r),o=P.getMax(t,r);this.updateVal(R.data,"startx",i,Math.min),this.updateVal(R.data,"starty",s,Math.min),this.updateVal(R.data,"stopx",n,Math.max),this.updateVal(R.data,"stopy",o,Math.max),this.updateBounds(i,s,n,o)},"insert"),newActivation:g(function(e,t,a){const r=a.get(e.from),i=Ht(e.from).length||0,n=r.x+r.width/2+(i-1)*h.activationWidth/2;this.activations.push({startx:n,starty:this.verticalPos+2,stopx:n+h.activationWidth,stopy:void 0,actor:e.from,anchored:H.anchorElement(t)})},"newActivation"),endActivation:g(function(e){const t=this.activations.map(function(a){return a.actor}).lastIndexOf(e.from);return this.activations.splice(t,1)[0]},"endActivation"),createLoop:g(function(e={message:void 0,wrap:!1,width:void 0},t){return{startx:void 0,starty:this.verticalPos,stopx:void 0,stopy:void 0,title:e.message,wrap:e.wrap,width:e.width,height:0,fill:t}},"createLoop"),newLoop:g(function(e={message:void 0,wrap:!1,width:void 0},t){this.sequenceItems.push(this.createLoop(e,t))},"newLoop"),endLoop:g(function(){return this.sequenceItems.pop()},"endLoop"),isLoopOverlap:g(function(){return this.sequenceItems.length?this.sequenceItems[this.sequenceItems.length-1].overlap:!1},"isLoopOverlap"),addSectionToLoop:g(function(e){const t=this.sequenceItems.pop();t.sections=t.sections||[],t.sectionTitles=t.sectionTitles||[],t.sections.push({y:R.getVerticalPos(),height:0}),t.sectionTitles.push(e),this.sequenceItems.push(t)},"addSectionToLoop"),saveVerticalPos:g(function(){this.isLoopOverlap()&&(this.savedVerticalPos=this.verticalPos)},"saveVerticalPos"),resetVerticalPos:g(function(){this.isLoopOverlap()&&(this.verticalPos=this.savedVerticalPos)},"resetVerticalPos"),bumpVerticalPos:g(function(e){this.verticalPos=this.verticalPos+e,this.data.stopy=P.getMax(this.data.stopy,this.verticalPos)},"bumpVerticalPos"),getVerticalPos:g(function(){return this.verticalPos},"getVerticalPos"),getBounds:g(function(){return{bounds:this.data,models:this.models}},"getBounds")},$r=g(async function(e,t,a){R.bumpVerticalPos(h.boxMargin),t.height=h.boxMargin,t.starty=R.getVerticalPos();const r=dt();r.x=t.startx,r.y=t.starty,r.width=t.width||h.width,r.class="note";const i=e.append("g");i.attr("data-et","note"),i.attr("data-id","i"+a);const n=H.drawRect(i,r),s=re();s.x=t.startx,s.y=t.starty,s.width=r.width,s.dy="1em",s.text=t.message,s.class="noteText",s.fontFamily=h.noteFontFamily,s.fontSize=h.noteFontSize,s.fontWeight=h.noteFontWeight,s.anchor=h.noteAlign,s.textMargin=h.noteMargin,s.valign="center";const o=$(s.text)?await Kt(i,s):At(i,s),E=Math.round(o.map(d=>(d._groups||d)[0][0].getBBox().height).reduce((d,l)=>d+l));n.attr("height",E+2*h.noteMargin),t.height+=E+2*h.noteMargin,R.bumpVerticalPos(E+2*h.noteMargin),t.stopy=t.starty+E+2*h.noteMargin,t.stopx=t.startx+r.width,R.insert(t.startx,t.starty,t.stopx,t.stopy),R.models.addNote(t)},"drawNote"),ve=g(function(e,t,a,r,i,n,s){const o=r.db.getActors(),E=o.get(t.from),d=o.get(t.to),l=a.sequenceVisible;let x=E.x+E.width/2,u=d.x+d.width/2;const O=x<=u,p=Je(t,r),f=e.append("g"),_=16.5,I=g((S,Y)=>{const M=S?_:-_;return Y?-M:M},"getCircleOffset"),L=g(S=>{f.append("circle").attr("cx",S).attr("cy",s).attr("r",5).attr("width",10).attr("height",10)},"drawCircle"),{CENTRAL_CONNECTION:b,CENTRAL_CONNECTION_REVERSE:m,CENTRAL_CONNECTION_DUAL:w}=r.db.LINETYPE;if(l)switch(t.centralConnection){case b:p&&(u+=I(O,!0));break;case m:p||(x+=I(O,!1));break;case w:p?u+=I(O,!0):x+=I(O,!1);break}switch(t.centralConnection){case b:L(u);break;case m:L(x);break;case w:L(x),L(u);break}},"drawCentralConnection"),Rt=g(e=>({fontFamily:e.messageFontFamily,fontSize:e.messageFontSize,fontWeight:e.messageFontWeight}),"messageFont"),Lt=g(e=>({fontFamily:e.noteFontFamily,fontSize:e.noteFontSize,fontWeight:e.noteFontWeight}),"noteFont"),te=g(e=>({fontFamily:e.actorFontFamily,fontSize:e.actorFontSize,fontWeight:e.actorFontWeight}),"actorFont");async function qe(e,t){R.bumpVerticalPos(10);const{startx:a,stopx:r,message:i}=t,n=P.splitBreaks(i).length,s=$(i),o=s?await mt(i,j()):Z.calculateTextDimensions(i,Rt(h));if(!s){const x=o.height/n;t.height+=x,R.bumpVerticalPos(x)}let E,d=o.height-10;const l=o.width;if(a===r){E=R.getVerticalPos()+d,h.rightAngles||(d+=h.boxMargin,E=R.getVerticalPos()+d),d+=30;const x=P.getMax(l/2,h.width/2);R.insert(a-x,R.getVerticalPos()-10+d,r+x,R.getVerticalPos()+30+d)}else d+=h.boxMargin,E=R.getVerticalPos()+d,R.insert(a,E-10,r,E);return R.bumpVerticalPos(d),t.height+=d,t.stopy=t.starty+t.height,R.insert(t.fromBounds,t.starty,t.toBounds,t.stopy),E}g(qe,"boundMessage");var jr=g(async function(e,t,a,r,i,n){const{startx:s,stopx:o,starty:E,message:d,type:l,sequenceIndex:x,sequenceVisible:u}=t,O=Z.calculateTextDimensions(d,Rt(h)),p=re();p.x=Math.min(s,o),p.y=E+10,p.width=Math.abs(o-s),p.class="messageText",p.dy="1em",p.text=d,p.fontFamily=h.messageFontFamily,p.fontSize=h.messageFontSize,p.fontWeight=h.messageFontWeight,p.anchor=h.messageAlign,p.valign="center",p.textMargin=h.wrapPadding,p.tspan=!1,$(p.text)?await Kt(e,p,{startx:s,stopx:o,starty:a}):At(e,p);const f=O.width;let _;if(s===o){const L=u||h.showSequenceNumbers,b=Je(i,r),m=na(i,r),w=s+(L&&(b||m)?10:0);h.rightAngles?_=e.append("path").attr("d",`M ${w},${a} H ${s+P.getMax(h.width/2,f/2)} V ${a+25} H ${s}`):_=e.append("path").attr("d","M "+w+","+a+" C "+(w+60)+","+(a-10)+" "+(s+60)+","+(a+30)+" "+s+","+(a+20)),$t(i,r)&&ve(e,i,t,r,s,o,a)}else _=e.append("line"),_.attr("x1",s),_.attr("y1",a),_.attr("x2",o),_.attr("y2",a),$t(i,r)&&ve(e,i,t,r,s,o,a);l===r.db.LINETYPE.DOTTED||l===r.db.LINETYPE.DOTTED_CROSS||l===r.db.LINETYPE.DOTTED_POINT||l===r.db.LINETYPE.DOTTED_OPEN||l===r.db.LINETYPE.BIDIRECTIONAL_DOTTED||l===r.db.LINETYPE.SOLID_TOP_DOTTED||l===r.db.LINETYPE.SOLID_BOTTOM_DOTTED||l===r.db.LINETYPE.STICK_TOP_DOTTED||l===r.db.LINETYPE.STICK_BOTTOM_DOTTED||l===r.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED||l===r.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED||l===r.db.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED||l===r.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED?(_.style("stroke-dasharray","3, 3"),_.attr("class","messageLine1")):_.attr("class","messageLine0"),_.attr("data-et","message"),_.attr("data-id","i"+t.id),_.attr("data-from",t.from),_.attr("data-to",t.to);let I="";if(h.arrowMarkerAbsolute&&(I=pr(!0)),_.attr("stroke-width",2),_.attr("stroke","none"),_.style("fill","none"),(l===r.db.LINETYPE.SOLID_TOP||l===r.db.LINETYPE.SOLID_TOP_DOTTED)&&_.attr("marker-end","url("+I+"#"+n+"-solidTopArrowHead)"),(l===r.db.LINETYPE.SOLID_BOTTOM||l===r.db.LINETYPE.SOLID_BOTTOM_DOTTED)&&_.attr("marker-end","url("+I+"#"+n+"-solidBottomArrowHead)"),(l===r.db.LINETYPE.STICK_TOP||l===r.db.LINETYPE.STICK_TOP_DOTTED)&&_.attr("marker-end","url("+I+"#"+n+"-stickTopArrowHead)"),(l===r.db.LINETYPE.STICK_BOTTOM||l===r.db.LINETYPE.STICK_BOTTOM_DOTTED)&&_.attr("marker-end","url("+I+"#"+n+"-stickBottomArrowHead)"),(l===r.db.LINETYPE.SOLID_ARROW_TOP_REVERSE||l===r.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED)&&_.attr("marker-start","url("+I+"#"+n+"-solidBottomArrowHead)"),(l===r.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE||l===r.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED)&&_.attr("marker-start","url("+I+"#"+n+"-solidTopArrowHead)"),(l===r.db.LINETYPE.STICK_ARROW_TOP_REVERSE||l===r.db.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED)&&_.attr("marker-start","url("+I+"#"+n+"-stickBottomArrowHead)"),(l===r.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE||l===r.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED)&&_.attr("marker-start","url("+I+"#"+n+"-stickTopArrowHead)"),(l===r.db.LINETYPE.SOLID||l===r.db.LINETYPE.DOTTED)&&_.attr("marker-end","url("+I+"#"+n+"-arrowhead)"),(l===r.db.LINETYPE.BIDIRECTIONAL_SOLID||l===r.db.LINETYPE.BIDIRECTIONAL_DOTTED)&&(_.attr("marker-start","url("+I+"#"+n+"-arrowhead)"),_.attr("marker-end","url("+I+"#"+n+"-arrowhead)")),(l===r.db.LINETYPE.SOLID_POINT||l===r.db.LINETYPE.DOTTED_POINT)&&_.attr("marker-end","url("+I+"#"+n+"-filled-head)"),(l===r.db.LINETYPE.SOLID_CROSS||l===r.db.LINETYPE.DOTTED_CROSS)&&_.attr("marker-end","url("+I+"#"+n+"-crosshead)"),u||h.showSequenceNumbers){const L=l===r.db.LINETYPE.BIDIRECTIONAL_SOLID||l===r.db.LINETYPE.BIDIRECTIONAL_DOTTED,b=l===r.db.LINETYPE.SOLID_ARROW_TOP_REVERSE||l===r.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED||l===r.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE||l===r.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED||l===r.db.LINETYPE.STICK_ARROW_TOP_REVERSE||l===r.db.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED||l===r.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE||l===r.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED,m=6,w=$t(i,r);let S=s,Y=o;L?(s<o?S=s+m*2:(S=s-m+(w?-5:0),S+=(i==null?void 0:i.centralConnection)===r.db.LINETYPE.CENTRAL_CONNECTION_DUAL||(i==null?void 0:i.centralConnection)===r.db.LINETYPE.CENTRAL_CONNECTION_REVERSE?-7.5:0),_.attr("x1",S)):b?(o>s?Y=o-2*m:(Y=o-m,S+=(i==null?void 0:i.centralConnection)===r.db.LINETYPE.CENTRAL_CONNECTION_DUAL||(i==null?void 0:i.centralConnection)===r.db.LINETYPE.CENTRAL_CONNECTION_REVERSE?-7.5:0),Y+=w?15:0,_.attr("x2",Y),_.attr("x1",S)):_.attr("x1",s+m);let M=0;const V=s===o,G=s<=o;V?M=t.fromBounds+1:b?M=G?t.toBounds-1:t.fromBounds+1:M=G?t.fromBounds+1:t.toBounds-1;let W="12px";const X=x.toString().length;X>5?W="7px":X>3&&(W="9px"),e.append("line").attr("x1",M).attr("y1",a).attr("x2",M).attr("y2",a).attr("stroke-width",0).attr("marker-start","url("+I+"#"+n+"-sequencenumber)"),e.append("text").attr("x",M).attr("y",a+4).attr("font-family","sans-serif").attr("font-size",W).attr("text-anchor","middle").attr("class","sequenceNumber").text(x)}},"drawMessage"),ta=g(function(e,t,a,r,i,n,s){let o=0,E=0,d,l=0;for(const x of r){const u=t.get(x),O=u.box;d&&d!=O&&(s||R.models.addBox(d),E+=h.boxMargin+d.margin),O&&O!=d&&(s||(O.x=o+E,O.y=i),E+=O.margin),u.width=P.getMax(u.width||h.width,h.width),u.height=P.getMax(u.height||h.height,h.height),u.margin=u.margin||h.actorMargin,l=P.getMax(l,u.height),a.get(u.name)&&(E+=u.width/2),u.x=o+E,u.starty=R.getVerticalPos(),R.insert(u.x,i,u.x+u.width,u.height),o+=u.width+E,u.box&&(u.box.width=o+O.margin-u.box.x),E=u.margin,d=u.box,R.models.addActor(u)}d&&!s&&R.models.addBox(d),R.bumpVerticalPos(l)},"addActorRenderingData"),ee=g(async function(e,t,a,r,i,n,s){if(r){let o=0;R.bumpVerticalPos(h.boxMargin*2);for(const E of a){const d=t.get(E);d.stopy||(d.stopy=R.getVerticalPos());const l=await H.drawActor(e,d,h,!0,i,n,s);o=P.getMax(o,l)}R.bumpVerticalPos(o+h.boxMargin)}else for(const o of a){const E=t.get(o);await H.drawActor(e,E,h,!1,i,n,s)}},"drawActors"),He=g(function(e,t,a,r){let i=0,n=0;for(const s of a){const o=t.get(s),E=ra(o),d=H.drawPopup(e,o,E,h,h.forceMenus,r);d.height>i&&(i=d.height),d.width+o.x>n&&(n=d.width+o.x)}return{maxHeight:i,maxWidth:n}},"drawActorsPopup"),ze=g(function(e){ar(h,e),e.fontFamily&&(h.actorFontFamily=h.noteFontFamily=h.messageFontFamily=e.fontFamily),e.fontSize&&(h.actorFontSize=h.noteFontSize=h.messageFontSize=e.fontSize),e.fontWeight&&(h.actorFontWeight=h.noteFontWeight=h.messageFontWeight=e.fontWeight)},"setConf"),Ht=g(function(e){return R.activations.filter(function(t){return t.actor===e})},"actorActivations"),Ce=g(function(e,t){const a=t.get(e),r=Ht(e),i=r.reduce(function(s,o){return P.getMin(s,o.startx)},a.x+a.width/2-1),n=r.reduce(function(s,o){return P.getMax(s,o.stopx)},a.x+a.width/2+1);return[i,n]},"activationBounds");function ht(e,t,a,r,i){R.bumpVerticalPos(a);let n=r;if(t.id&&t.message&&e[t.id]){const s=e[t.id].width,o=Rt(h);t.message=Z.wrapLabel(`[${t.message}]`,s-2*h.wrapPadding,o),t.width=s,t.wrap=!0;const E=Z.calculateTextDimensions(t.message,o),d=P.getMax(E.height,h.labelBoxHeight);n=r+d,st.debug(`${d} - ${t.message}`)}i(t),R.bumpVerticalPos(n)}g(ht,"adjustLoopHeightForWrap");function Ue(e,t,a,r,i,n,s){function o(l,x){l.x<i.get(e.from).x?(R.insert(t.stopx-x,t.starty,t.startx,t.stopy+l.height/2+h.noteMargin),t.stopx=t.stopx+x):(R.insert(t.startx,t.starty,t.stopx+x,t.stopy+l.height/2+h.noteMargin),t.stopx=t.stopx-x)}g(o,"receiverAdjustment");function E(l,x){l.x<i.get(e.to).x?(R.insert(t.startx-x,t.starty,t.stopx,t.stopy+l.height/2+h.noteMargin),t.startx=t.startx+x):(R.insert(t.stopx,t.starty,t.startx+x,t.stopy+l.height/2+h.noteMargin),t.startx=t.startx-x)}g(E,"senderAdjustment");const d=[Yt.ACTOR,Yt.CONTROL,Yt.ENTITY,Yt.DATABASE];if(n.get(e.to)==r){const l=i.get(e.to),x=d.includes(l.type)?It/2+3:l.width/2+3;o(l,x),l.starty=a-l.height/2,R.bumpVerticalPos(l.height/2)}else if(s.get(e.from)==r){const l=i.get(e.from);if(h.mirrorActors){const x=d.includes(l.type)?It/2:l.width/2;E(l,x)}l.stopy=a-l.height/2,R.bumpVerticalPos(l.height/2)}else if(s.get(e.to)==r){const l=i.get(e.to);if(h.mirrorActors){const x=d.includes(l.type)?It/2+3:l.width/2+3;o(l,x)}l.stopy=a-l.height/2,R.bumpVerticalPos(l.height/2)}}g(Ue,"adjustCreatedDestroyedData");var ea=g(async function(e,t,a,r){const{securityLevel:i,sequence:n,look:s}=j();h=n;let o;i==="sandbox"&&(o=Bt("#i"+t));const E=i==="sandbox"?Bt(o.nodes()[0].contentDocument.body):Bt("body"),d=i==="sandbox"?o.nodes()[0].contentDocument:document;R.init(),st.debug(r.db);const l=i==="sandbox"?E.select(`[id="${t}"]`):Bt(`[id="${t}"]`),x=r.db.getActors(),u=r.db.getCreatedActors(),O=r.db.getDestroyedActors(),p=r.db.getBoxes();let f=r.db.getActorKeys();const _=r.db.getMessages(),I=r.db.getDiagramTitle(),L=r.db.hasAtLeastOneBox(),b=r.db.hasAtLeastOneBoxWithTitle(),m=await Ge(x,_,r);if(h.height=await Xe(x,m,p),H.insertComputerIcon(l,t),H.insertDatabaseIcon(l,t),H.insertClockIcon(l,t),L&&(R.bumpVerticalPos(h.boxMargin),b&&R.bumpVerticalPos(p[0].textMaxHeight)),h.hideUnusedParticipants===!0){const A=new Set;_.forEach(D=>{A.add(D.from),A.add(D.to)}),f=f.filter(D=>A.has(D))}const w=new Map(f.map((A,D)=>{var et;return[((et=x.get(A))==null?void 0:et.name)??A,D]}));ta(l,x,u,f,0,_,!1);const S=await ca(_,x,m,r);H.insertArrowHead(l,t),H.insertArrowCrossHead(l,t),H.insertArrowFilledHead(l,t),H.insertSequenceNumber(l,t),H.insertSolidTopArrowHead(l,t),H.insertSolidBottomArrowHead(l,t),H.insertStickTopArrowHead(l,t),H.insertStickBottomArrowHead(l,t),s==="neo"&&H.insertDropShadow(l,h);function Y(A,D){const et=R.endActivation(A);et.starty+18>D&&(et.starty=D-6,D+=12),H.drawActivation(l,et,D,h,Ht(A.from).length,r,w),R.insert(et.startx,D-10,et.stopx,D)}g(Y,"activeEnd");let M=1,V=1;const G=[],W=[];let X=0;for(const A of _){let D,et,rt;switch(A.type){case r.db.LINETYPE.NOTE:R.resetVerticalPos(),et=A.noteModel,await $r(l,et,A.id);break;case r.db.LINETYPE.ACTIVE_START:R.newActivation(A,l,x);break;case r.db.LINETYPE.CENTRAL_CONNECTION:R.newActivation(A,l,x);break;case r.db.LINETYPE.CENTRAL_CONNECTION_REVERSE:R.newActivation(A,l,x);break;case r.db.LINETYPE.ACTIVE_END:Y(A,R.getVerticalPos());break;case r.db.LINETYPE.LOOP_START:ht(S,A,h.boxMargin,h.boxMargin+h.boxTextMargin,F=>R.newLoop(F));break;case r.db.LINETYPE.LOOP_END:D=R.endLoop(),await H.drawLoop(l,D,"loop",h,A),R.bumpVerticalPos(D.stopy-R.getVerticalPos()),R.models.addLoop(D);break;case r.db.LINETYPE.RECT_START:ht(S,A,h.boxMargin,h.boxMargin,F=>R.newLoop(void 0,F.message));break;case r.db.LINETYPE.RECT_END:D=R.endLoop(),W.push(D),R.models.addLoop(D),R.bumpVerticalPos(D.stopy-R.getVerticalPos());break;case r.db.LINETYPE.OPT_START:ht(S,A,h.boxMargin,h.boxMargin+h.boxTextMargin,F=>R.newLoop(F));break;case r.db.LINETYPE.OPT_END:D=R.endLoop(),await H.drawLoop(l,D,"opt",h,A),R.bumpVerticalPos(D.stopy-R.getVerticalPos()),R.models.addLoop(D);break;case r.db.LINETYPE.ALT_START:ht(S,A,h.boxMargin,h.boxMargin+h.boxTextMargin,F=>R.newLoop(F));break;case r.db.LINETYPE.ALT_ELSE:ht(S,A,h.boxMargin+h.boxTextMargin,h.boxMargin,F=>R.addSectionToLoop(F));break;case r.db.LINETYPE.ALT_END:D=R.endLoop(),await H.drawLoop(l,D,"alt",h,A),R.bumpVerticalPos(D.stopy-R.getVerticalPos()),R.models.addLoop(D);break;case r.db.LINETYPE.PAR_START:case r.db.LINETYPE.PAR_OVER_START:ht(S,A,h.boxMargin,h.boxMargin+h.boxTextMargin,F=>R.newLoop(F)),R.saveVerticalPos();break;case r.db.LINETYPE.PAR_AND:ht(S,A,h.boxMargin+h.boxTextMargin,h.boxMargin,F=>R.addSectionToLoop(F));break;case r.db.LINETYPE.PAR_END:D=R.endLoop(),await H.drawLoop(l,D,"par",h,A),R.bumpVerticalPos(D.stopy-R.getVerticalPos()),R.models.addLoop(D);break;case r.db.LINETYPE.AUTONUMBER:M=A.message.start||M,V=A.message.step||V,A.message.visible?r.db.enableSequenceNumbers():r.db.disableSequenceNumbers();break;case r.db.LINETYPE.CRITICAL_START:ht(S,A,h.boxMargin,h.boxMargin+h.boxTextMargin,F=>R.newLoop(F));break;case r.db.LINETYPE.CRITICAL_OPTION:ht(S,A,h.boxMargin+h.boxTextMargin,h.boxMargin,F=>R.addSectionToLoop(F));break;case r.db.LINETYPE.CRITICAL_END:D=R.endLoop(),await H.drawLoop(l,D,"critical",h,A),R.bumpVerticalPos(D.stopy-R.getVerticalPos()),R.models.addLoop(D);break;case r.db.LINETYPE.BREAK_START:ht(S,A,h.boxMargin,h.boxMargin+h.boxTextMargin,F=>R.newLoop(F));break;case r.db.LINETYPE.BREAK_END:D=R.endLoop(),await H.drawLoop(l,D,"break",h,A),R.bumpVerticalPos(D.stopy-R.getVerticalPos()),R.models.addLoop(D);break;default:try{rt=A.msgModel,rt.starty=R.getVerticalPos(),rt.sequenceIndex=M,rt.sequenceVisible=r.db.showSequenceNumbers(),rt.id=A.id,rt.from=A.from,rt.to=A.to;const F=await qe(l,rt);Ue(A,rt,F,X,x,u,O),G.push({messageModel:rt,lineStartY:F,msg:A}),R.models.addMessage(rt)}catch(F){st.error("error while drawing message",F)}}[r.db.LINETYPE.SOLID_OPEN,r.db.LINETYPE.DOTTED_OPEN,r.db.LINETYPE.SOLID,r.db.LINETYPE.SOLID_TOP,r.db.LINETYPE.SOLID_BOTTOM,r.db.LINETYPE.STICK_TOP,r.db.LINETYPE.STICK_BOTTOM,r.db.LINETYPE.SOLID_TOP_DOTTED,r.db.LINETYPE.SOLID_BOTTOM_DOTTED,r.db.LINETYPE.STICK_TOP_DOTTED,r.db.LINETYPE.STICK_BOTTOM_DOTTED,r.db.LINETYPE.SOLID_ARROW_TOP_REVERSE,r.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE,r.db.LINETYPE.STICK_ARROW_TOP_REVERSE,r.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE,r.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED,r.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED,r.db.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED,r.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED,r.db.LINETYPE.DOTTED,r.db.LINETYPE.SOLID_CROSS,r.db.LINETYPE.DOTTED_CROSS,r.db.LINETYPE.SOLID_POINT,r.db.LINETYPE.DOTTED_POINT,r.db.LINETYPE.BIDIRECTIONAL_SOLID,r.db.LINETYPE.BIDIRECTIONAL_DOTTED].includes(A.type)&&(M=Math.round((M+V)*100)/100),X++}st.debug("createdActors",u),st.debug("destroyedActors",O),await ee(l,x,f,!1,t,r,w);for(const A of G)await jr(l,A.messageModel,A.lineStartY,r,A.msg,t);h.mirrorActors&&await ee(l,x,f,!0,t,r,w),W.forEach(A=>H.drawBackgroundRect(l,A)),We(l,x,f,h);for(const A of R.models.boxes){A.height=R.getVerticalPos()-A.y,R.insert(A.x,A.y,A.x+A.width,A.height);const D=h.boxMargin*2;A.startx=A.x-D,A.starty=A.y-D*.25,A.stopx=A.startx+A.width+2*D,A.stopy=A.starty+A.height+D*.75,A.stroke="rgb(0,0,0, 0.5)",H.drawBox(l,A,h)}L&&R.bumpVerticalPos(h.boxMargin);const Q=He(l,x,f,d),{bounds:z}=R.getBounds();z.startx===void 0&&(z.startx=0),z.starty===void 0&&(z.starty=0),z.stopx===void 0&&(z.stopx=0),z.stopy===void 0&&(z.stopy=0);let it=z.stopy-z.starty;it<Q.maxHeight&&(it=Q.maxHeight);let tt=it+2*h.diagramMarginY;h.mirrorActors&&(tt=tt-h.boxMargin+h.bottomMarginAdj);let nt=z.stopx-z.startx;nt<Q.maxWidth&&(nt=Q.maxWidth);const K=nt+2*h.diagramMarginX;I&&l.append("text").text(I).attr("x",(z.stopx-z.startx)/2-2*h.diagramMarginX).attr("y",-25),rr(l,tt,K,h.useMaxWidth);const C=I?40:0,Pt=x.size&&s==="neo"?30:0;l.attr("viewBox",z.startx-h.diagramMarginX+" -"+(h.diagramMarginY+C)+" "+K+" "+(tt+C+Pt)),st.debug("models:",R.models)},"draw");async function Ge(e,t,a){const r={};for(const i of t)if(e.get(i.to)&&e.get(i.from)){const n=e.get(i.to);if(i.placement===a.db.PLACEMENT.LEFTOF&&!n.prevActor||i.placement===a.db.PLACEMENT.RIGHTOF&&!n.nextActor)continue;const s=i.placement!==void 0,o=!s,E=s?Lt(h):Rt(h),d=i.wrap?Z.wrapLabel(i.message,h.width-2*h.wrapPadding,E):i.message,x=($(d)?await mt(i.message,j()):Z.calculateTextDimensions(d,E)).width+2*h.wrapPadding;o&&i.from===n.nextActor?r[i.to]=P.getMax(r[i.to]||0,x):o&&i.from===n.prevActor?r[i.from]=P.getMax(r[i.from]||0,x):o&&i.from===i.to?(r[i.from]=P.getMax(r[i.from]||0,x/2),r[i.to]=P.getMax(r[i.to]||0,x/2)):i.placement===a.db.PLACEMENT.RIGHTOF?r[i.from]=P.getMax(r[i.from]||0,x):i.placement===a.db.PLACEMENT.LEFTOF?r[n.prevActor]=P.getMax(r[n.prevActor]||0,x):i.placement===a.db.PLACEMENT.OVER&&(n.prevActor&&(r[n.prevActor]=P.getMax(r[n.prevActor]||0,x/2)),n.nextActor&&(r[i.from]=P.getMax(r[i.from]||0,x/2)))}return st.debug("maxMessageWidthPerActor:",r),r}g(Ge,"getMaxMessageWidthPerActor");var ra=g(function(e){let t=0;const a=te(h);for(const r in e.links){const n=Z.calculateTextDimensions(r,a).width+2*h.wrapPadding+2*h.boxMargin;t<n&&(t=n)}return t},"getRequiredPopupWidth");async function Xe(e,t,a){let r=0;for(const n of e.keys()){const s=e.get(n);s.wrap&&(s.description=Z.wrapLabel(s.description,h.width-2*h.wrapPadding,te(h)));const o=$(s.description)?await mt(s.description,j()):Z.calculateTextDimensions(s.description,te(h));s.width=s.wrap?h.width:P.getMax(h.width,o.width+2*h.wrapPadding),s.height=s.wrap?P.getMax(o.height,h.height):h.height,r=P.getMax(r,s.height)}for(const n in t){const s=e.get(n);if(!s)continue;const o=e.get(s.nextActor);if(!o){const x=t[n]+h.actorMargin-s.width/2;s.margin=P.getMax(x,h.actorMargin);continue}const d=t[n]+h.actorMargin-s.width/2-o.width/2;s.margin=P.getMax(d,h.actorMargin)}let i=0;return a.forEach(n=>{const s=Rt(h);let o=n.actorKeys.reduce((x,u)=>x+=e.get(u).width+(e.get(u).margin||0),0);const E=h.boxMargin*8;o+=E,o-=2*h.boxTextMargin,n.wrap&&(n.name=Z.wrapLabel(n.name,o-2*h.wrapPadding,s));const d=Z.calculateTextDimensions(n.name,s);i=P.getMax(d.height,i);const l=P.getMax(o,d.width+2*h.wrapPadding);if(n.margin=h.boxTextMargin,o<l){const x=(l-o)/2;n.margin+=x}}),a.forEach(n=>n.textMaxHeight=i),P.getMax(r,h.height)}g(Xe,"calculateActorMargins");var aa=g(async function(e,t,a){const r=t.get(e.from),i=t.get(e.to),n=r.x,s=i.x,o=e.wrap&&e.message;let E=$(e.message)?await mt(e.message,j()):Z.calculateTextDimensions(o?Z.wrapLabel(e.message,h.width,Lt(h)):e.message,Lt(h));const d={width:o?h.width:P.getMax(h.width,E.width+2*h.noteMargin),height:0,startx:r.x,stopx:0,starty:0,stopy:0,message:e.message};return e.placement===a.db.PLACEMENT.RIGHTOF?(d.width=o?P.getMax(h.width,E.width):P.getMax(r.width/2+i.width/2,E.width+2*h.noteMargin),d.startx=n+(r.width+h.actorMargin)/2):e.placement===a.db.PLACEMENT.LEFTOF?(d.width=o?P.getMax(h.width,E.width+2*h.noteMargin):P.getMax(r.width/2+i.width/2,E.width+2*h.noteMargin),d.startx=n-d.width+(r.width-h.actorMargin)/2):e.to===e.from?(E=Z.calculateTextDimensions(o?Z.wrapLabel(e.message,P.getMax(h.width,r.width),Lt(h)):e.message,Lt(h)),d.width=o?P.getMax(h.width,r.width):P.getMax(r.width,h.width,E.width+2*h.noteMargin),d.startx=n+(r.width-d.width)/2):(d.width=Math.abs(n+r.width/2-(s+i.width/2))+h.actorMargin,d.startx=n<s?n+r.width/2-h.actorMargin/2:s+i.width/2-h.actorMargin/2),o&&(d.message=Z.wrapLabel(e.message,d.width-2*h.wrapPadding,Lt(h))),st.debug(`NM:[${d.startx},${d.stopx},${d.starty},${d.stopy}:${d.width},${d.height}=${e.message}]`),d},"buildNoteModel"),sa=4,$t=g(function(e,t){const{CENTRAL_CONNECTION:a,CENTRAL_CONNECTION_REVERSE:r,CENTRAL_CONNECTION_DUAL:i}=t.db.LINETYPE;return[a,r,i].includes(e.centralConnection)},"hasCentralConnection"),ia=g(function(e,t,a){const{CENTRAL_CONNECTION_REVERSE:r,CENTRAL_CONNECTION_DUAL:i,BIDIRECTIONAL_SOLID:n,BIDIRECTIONAL_DOTTED:s}=t.db.LINETYPE;let o=0;return(e.centralConnection===r||e.centralConnection===i)&&(o+=sa),(e.centralConnection===r||e.centralConnection===i)&&(e.type===n||e.type===s)&&(o+=a?0:-6),o},"calculateCentralConnectionOffset"),Je=g(function(e,t){const{SOLID_ARROW_TOP_REVERSE:a,SOLID_ARROW_TOP_REVERSE_DOTTED:r,SOLID_ARROW_BOTTOM_REVERSE:i,SOLID_ARROW_BOTTOM_REVERSE_DOTTED:n,STICK_ARROW_TOP_REVERSE:s,STICK_ARROW_TOP_REVERSE_DOTTED:o,STICK_ARROW_BOTTOM_REVERSE:E,STICK_ARROW_BOTTOM_REVERSE_DOTTED:d}=t.db.LINETYPE;return[a,r,i,n,s,o,E,d].includes(e.type)},"isReverseArrowType"),na=g(function(e,t){const{BIDIRECTIONAL_SOLID:a,BIDIRECTIONAL_DOTTED:r}=t.db.LINETYPE;return[a,r].includes(e.type)},"isBidirectionalArrowType"),oa=g(function(e,t,a){const{look:r}=j();if(![a.db.LINETYPE.SOLID_OPEN,a.db.LINETYPE.DOTTED_OPEN,a.db.LINETYPE.SOLID,a.db.LINETYPE.SOLID_TOP,a.db.LINETYPE.SOLID_BOTTOM,a.db.LINETYPE.STICK_TOP,a.db.LINETYPE.STICK_BOTTOM,a.db.LINETYPE.SOLID_TOP_DOTTED,a.db.LINETYPE.SOLID_BOTTOM_DOTTED,a.db.LINETYPE.STICK_TOP_DOTTED,a.db.LINETYPE.STICK_BOTTOM_DOTTED,a.db.LINETYPE.SOLID_ARROW_TOP_REVERSE,a.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE,a.db.LINETYPE.STICK_ARROW_TOP_REVERSE,a.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE,a.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED,a.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED,a.db.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED,a.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED,a.db.LINETYPE.DOTTED,a.db.LINETYPE.SOLID_CROSS,a.db.LINETYPE.DOTTED_CROSS,a.db.LINETYPE.SOLID_POINT,a.db.LINETYPE.DOTTED_POINT,a.db.LINETYPE.BIDIRECTIONAL_SOLID,a.db.LINETYPE.BIDIRECTIONAL_DOTTED].includes(e.type))return{};const[i,n]=Ce(e.from,t),[s,o]=Ce(e.to,t),E=i<=s;let d=E?n:i,l=E?s:o;r==="neo"&&(e.type!==a.db.LINETYPE.SOLID_OPEN&&(l+=E?-3:3),(e.type===a.db.LINETYPE.BIDIRECTIONAL_SOLID||e.type===a.db.LINETYPE.BIDIRECTIONAL_DOTTED)&&(d+=E?3:-3)),d+=ia(e,a,E);const x=Math.abs(s-o)>2,u=g(_=>E?-_:_,"adjustValue");e.from===e.to?l=d:(e.activate&&!x&&(l+=u(h.activationWidth/2-1)),[a.db.LINETYPE.SOLID_OPEN,a.db.LINETYPE.DOTTED_OPEN,a.db.LINETYPE.STICK_TOP,a.db.LINETYPE.STICK_BOTTOM,a.db.LINETYPE.STICK_TOP_DOTTED,a.db.LINETYPE.STICK_BOTTOM_DOTTED,a.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED,a.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED,a.db.LINETYPE.STICK_ARROW_TOP_REVERSE,a.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE,a.db.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED,a.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED,a.db.LINETYPE.SOLID_ARROW_TOP_REVERSE,a.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE].includes(e.type)||(l+=u(3)),[a.db.LINETYPE.BIDIRECTIONAL_SOLID,a.db.LINETYPE.BIDIRECTIONAL_DOTTED,a.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED,a.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED,a.db.LINETYPE.SOLID_ARROW_TOP_REVERSE,a.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE].includes(e.type)&&(d-=u(3)));const O=[i,n,s,o],p=Math.abs(d-l);e.wrap&&e.message&&(e.message=Z.wrapLabel(e.message,P.getMax(p+2*h.wrapPadding,h.width),Rt(h)));const f=Z.calculateTextDimensions(e.message,Rt(h));return{width:P.getMax(e.wrap?0:f.width+2*h.wrapPadding,p+2*h.wrapPadding,h.width),height:0,startx:d,stopx:l,starty:0,stopy:0,message:e.message,type:e.type,wrap:e.wrap,fromBounds:Math.min.apply(null,O),toBounds:Math.max.apply(null,O)}},"buildMessageModel"),ca=g(async function(e,t,a,r){const i={},n=[];let s,o,E;for(const d of e){switch(d.type){case r.db.LINETYPE.LOOP_START:case r.db.LINETYPE.ALT_START:case r.db.LINETYPE.OPT_START:case r.db.LINETYPE.PAR_START:case r.db.LINETYPE.PAR_OVER_START:case r.db.LINETYPE.CRITICAL_START:case r.db.LINETYPE.BREAK_START:n.push({id:d.id,msg:d.message,from:Number.MAX_SAFE_INTEGER,to:Number.MIN_SAFE_INTEGER,width:0});break;case r.db.LINETYPE.ALT_ELSE:case r.db.LINETYPE.PAR_AND:case r.db.LINETYPE.CRITICAL_OPTION:d.message&&(s=n.pop(),i[s.id]=s,i[d.id]=s,n.push(s));break;case r.db.LINETYPE.LOOP_END:case r.db.LINETYPE.ALT_END:case r.db.LINETYPE.OPT_END:case r.db.LINETYPE.PAR_END:case r.db.LINETYPE.CRITICAL_END:case r.db.LINETYPE.BREAK_END:s=n.pop(),i[s.id]=s;break;case r.db.LINETYPE.ACTIVE_START:{const x=t.get(d.from?d.from:d.to.actor),u=Ht(d.from?d.from:d.to.actor).length,O=x.x+x.width/2+(u-1)*h.activationWidth/2,p={startx:O,stopx:O+h.activationWidth,actor:d.from,enabled:!0};R.activations.push(p)}break;case r.db.LINETYPE.ACTIVE_END:{const x=R.activations.map(u=>u.actor).lastIndexOf(d.from);R.activations.splice(x,1).splice(0,1)}break}d.placement!==void 0?(o=await aa(d,t,r),d.noteModel=o,n.forEach(x=>{s=x,s.from=P.getMin(s.from,o.startx),s.to=P.getMax(s.to,o.startx+o.width),s.width=P.getMax(s.width,Math.abs(s.from-s.to))-h.labelBoxWidth})):(E=oa(d,t,r),d.msgModel=E,E.startx&&E.stopx&&n.length>0&&n.forEach(x=>{if(s=x,E.startx===E.stopx){const u=t.get(d.from),O=t.get(d.to);s.from=P.getMin(u.x-E.width/2,u.x-u.width/2,s.from),s.to=P.getMax(O.x+E.width/2,O.x+u.width/2,s.to),s.width=P.getMax(s.width,Math.abs(s.to-s.from))-h.labelBoxWidth}else s.from=P.getMin(E.startx,s.from),s.to=P.getMax(E.stopx,s.to),s.width=P.getMax(s.width,E.width)-h.labelBoxWidth}))}return R.activations=[],st.debug("Loop type widths:",i),i},"calculateLoopBounds"),la={bounds:R,drawActors:ee,drawActorsPopup:He,setConf:ze,draw:ea},Ea={parser:_r,get db(){return new yr},renderer:la,styles:Or,init:g(e=>{e.sequence||(e.sequence={}),e.wrap&&(e.sequence.wrap=e.wrap,er({sequence:{wrap:e.wrap}}))},"init")};export{Ea as diagram};
163
- //# sourceMappingURL=sequenceDiagram-3UESZ5HK-DgzGHhGk.js.map
163
+ //# sourceMappingURL=sequenceDiagram-3UESZ5HK-DYKl7nA9.js.map
@@ -1,2 +1,2 @@
1
- import{s as A,a as W,S as N}from"./chunk-AQP2D5EJ-CQoXkVd4.js";import{_ as f,c as t,d as H,l as S,e as P,k as z,R as _,S as U,O as C,u as F}from"./mermaid.core-DDMkLXrp.js";import{G as O}from"./graph-CAnANduQ.js";import{l as J}from"./layout-DGIYPm2g.js";import"./chunk-55IACEB6-Dx2_9d-z.js";import"./chunk-2J33WTMH-z2oMKYMn.js";import"./index-Ra6pj0rt.js";var X=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),"drawStartState"),D=f(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),"drawDivider"),Y=f((e,i)=>{const d=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(i.id),c=d.node().getBBox();return e.insert("rect",":first-child").attr("x",t().state.padding).attr("y",t().state.padding).attr("width",c.width+2*t().state.padding).attr("height",c.height+2*t().state.padding).attr("rx",t().state.radius),d},"drawSimpleState"),I=f((e,i)=>{const d=f(function(o,B,y){const v=o.append("tspan").attr("x",2*t().state.padding).text(B);y||v.attr("dy",t().state.textHeight)},"addTspan"),n=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(i.descriptions[0]).node().getBBox(),l=n.height,p=e.append("text").attr("x",t().state.padding).attr("y",l+t().state.padding*.4+t().state.dividerMargin+t().state.textHeight).attr("class","state-description");let a=!0,s=!0;i.descriptions.forEach(function(o){a||(d(p,o,s),s=!1),a=!1});const m=e.append("line").attr("x1",t().state.padding).attr("y1",t().state.padding+l+t().state.dividerMargin/2).attr("y2",t().state.padding+l+t().state.dividerMargin/2).attr("class","descr-divider"),x=p.node().getBBox(),g=Math.max(x.width,n.width);return m.attr("x2",g+3*t().state.padding),e.insert("rect",":first-child").attr("x",t().state.padding).attr("y",t().state.padding).attr("width",g+2*t().state.padding).attr("height",x.height+l+2*t().state.padding).attr("rx",t().state.radius),e},"drawDescrState"),$=f((e,i,d)=>{const c=t().state.padding,n=2*t().state.padding,l=e.node().getBBox(),p=l.width,a=l.x,s=e.append("text").attr("x",0).attr("y",t().state.titleShift).attr("font-size",t().state.fontSize).attr("class","state-title").text(i.id),x=s.node().getBBox().width+n;let g=Math.max(x,p);g===p&&(g=g+n);let o;const B=e.node().getBBox();i.doc,o=a-c,x>p&&(o=(p-g)/2+c),Math.abs(a-B.x)<c&&x>p&&(o=a-(x-p)/2);const y=1-t().state.textHeight;return e.insert("rect",":first-child").attr("x",o).attr("y",y).attr("class",d?"alt-composit":"composit").attr("width",g).attr("height",B.height+t().state.textHeight+t().state.titleShift+1).attr("rx","0"),s.attr("x",o+c),x<=p&&s.attr("x",a+(g-n)/2-x/2+c),e.insert("rect",":first-child").attr("x",o).attr("y",t().state.titleShift-t().state.textHeight-t().state.padding).attr("width",g).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",g).attr("height",B.height+3+2*t().state.textHeight).attr("rx",t().state.radius),e},"addTitleAndBox"),q=f(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)),"drawEndState"),Z=f((e,i)=>{let d=t().state.forkWidth,c=t().state.forkHeight;if(i.parentId){let n=d;d=c,c=n}return e.append("rect").style("stroke","black").style("fill","black").attr("width",d).attr("height",c).attr("x",t().state.padding).attr("y",t().state.padding)},"drawForkJoinState"),j=f((e,i,d,c)=>{let n=0;const l=c.append("text");l.style("text-anchor","start"),l.attr("class","noteText");let p=e.replace(/\r\n/g,"<br/>");p=p.replace(/\n/g,"<br/>");const a=p.split(z.lineBreakRegex);let s=1.25*t().state.noteMargin;for(const m of a){const x=m.trim();if(x.length>0){const g=l.append("tspan");if(g.text(x),s===0){const o=g.node().getBBox();s+=o.height}n+=s,g.attr("x",i+t().state.noteMargin),g.attr("y",d+n+1.25*t().state.noteMargin)}}return{textWidth:l.node().getBBox().width,textHeight:n}},"_drawLongText"),K=f((e,i)=>{i.attr("class","state-note");const d=i.append("rect").attr("x",0).attr("y",t().state.padding),c=i.append("g"),{textWidth:n,textHeight:l}=j(e,0,0,c);return d.attr("height",l+2*t().state.noteMargin),d.attr("width",n+t().state.noteMargin*2),d},"drawNote"),L=f(function(e,i){const d=i.id,c={id:d,label:i.id,width:0,height:0},n=e.append("g").attr("id",d).attr("class","stateGroup");i.type==="start"&&X(n),i.type==="end"&&q(n),(i.type==="fork"||i.type==="join")&&Z(n,i),i.type==="note"&&K(i.note.text,n),i.type==="divider"&&D(n),i.type==="default"&&i.descriptions.length===0&&Y(n,i),i.type==="default"&&i.descriptions.length>0&&I(n,i);const l=n.node().getBBox();return c.width=l.width+2*t().state.padding,c.height=l.height+2*t().state.padding,c},"drawState"),G=0,Q=f(function(e,i,d){const c=f(function(s){switch(s){case N.relationType.AGGREGATION:return"aggregation";case N.relationType.EXTENSION:return"extension";case N.relationType.COMPOSITION:return"composition";case N.relationType.DEPENDENCY:return"dependency"}},"getRelationType");i.points=i.points.filter(s=>!Number.isNaN(s.y));const n=i.points,l=_().x(function(s){return s.x}).y(function(s){return s.y}).curve(U),p=e.append("path").attr("d",l(n)).attr("id","edge"+G).attr("class","transition");let a="";if(t().state.arrowMarkerAbsolute&&(a=C(!0)),p.attr("marker-end","url("+a+"#"+c(N.relationType.DEPENDENCY)+"End)"),d.title!==void 0){const s=e.append("g").attr("class","stateLabel"),{x:m,y:x}=F.calcLabelPosition(i.points),g=z.getRows(d.title);let o=0;const B=[];let y=0,v=0;for(let u=0;u<=g.length;u++){const h=s.append("text").attr("text-anchor","middle").text(g[u]).attr("x",m).attr("y",x+o),w=h.node().getBBox();y=Math.max(y,w.width),v=Math.min(v,w.x),S.info(w.x,m,x+o),o===0&&(o=h.node().getBBox().height,S.info("Title height",o,x)),B.push(h)}let k=o*g.length;if(g.length>1){const u=(g.length-1)*o*.5;B.forEach((h,w)=>h.attr("y",x+w*o-u)),k=o*g.length}const r=s.node().getBBox();s.insert("rect",":first-child").attr("class","box").attr("x",m-y/2-t().state.padding/2).attr("y",x-k/2-t().state.padding/2-3.5).attr("width",y+t().state.padding).attr("height",k+t().state.padding),S.info(r)}G++},"drawEdge"),b,T={},V=f(function(){},"setConf"),tt=f(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")},"insertMarkers"),et=f(function(e,i,d,c){b=t().state;const n=t().securityLevel;let l;n==="sandbox"&&(l=H("#i"+i));const p=n==="sandbox"?H(l.nodes()[0].contentDocument.body):H("body"),a=n==="sandbox"?l.nodes()[0].contentDocument:document;S.debug("Rendering diagram "+e);const s=p.select(`[id='${i}']`);tt(s);const m=c.db.getRootDoc(),x=s.append("g").attr("id",i+"-root");R(m,x,void 0,!1,p,a,c);const g=b.padding,o=s.node().getBBox(),B=o.width+g*2,y=o.height+g*2,v=B*1.75;P(s,y,v,b.useMaxWidth),s.attr("viewBox",`${o.x-b.padding} ${o.y-b.padding} `+B+" "+y)},"draw"),at=f(e=>e?e.length*b.fontSizeFactor:1,"getLabelWidth"),R=f((e,i,d,c,n,l,p)=>{const a=new O({compound:!0,multigraph:!0});let s,m=!0;for(s=0;s<e.length;s++)if(e[s].stmt==="relation"){m=!1;break}d?a.setGraph({rankdir:"LR",multigraph:!0,compound:!0,ranker:"tight-tree",ranksep:m?1:b.edgeLengthFactor,nodeSep:m?1:50,isMultiGraph:!0}):a.setGraph({rankdir:"TB",multigraph:!0,compound:!0,ranksep:m?1:b.edgeLengthFactor,nodeSep:m?1:50,ranker:"tight-tree",isMultiGraph:!0}),a.setDefaultEdgeLabel(function(){return{}});const x=p.db.getStates(),g=p.db.getRelations(),o=Object.keys(x);for(const r of o){const u=x[r];d&&(u.parentId=d);let h;if(u.doc){let w=i.append("g").attr("id",u.id).attr("class","stateGroup");h=R(u.doc,w,u.id,!c,n,l,p);{w=$(w,u,c);let E=w.node().getBBox();h.width=E.width,h.height=E.height+b.padding/2,T[u.id]={y:b.compositTitleSize}}}else h=L(i,u,a);if(u.note){const w={descriptions:[],id:u.id+"-note",note:u.note,type:"note"},E=L(i,w,a);u.note.position==="left of"?(a.setNode(h.id+"-note",E),a.setNode(h.id,h)):(a.setNode(h.id,h),a.setNode(h.id+"-note",E)),a.setParent(h.id,h.id+"-group"),a.setParent(h.id+"-note",h.id+"-group")}else a.setNode(h.id,h)}S.debug("Count=",a.nodeCount(),a);let B=0;g.forEach(function(r){B++,S.debug("Setting edge",r),a.setEdge(r.id1,r.id2,{relation:r,width:at(r.title),height:b.labelHeight*z.getRows(r.title).length,labelpos:"c"},"id"+B)}),J(a),S.debug("Graph after layout",a.nodes());const y=i.node();a.nodes().forEach(function(r){r!==void 0&&a.node(r)!==void 0?(S.warn("Node "+r+": "+JSON.stringify(a.node(r))),n.select("#"+y.id+" #"+r).attr("transform","translate("+(a.node(r).x-a.node(r).width/2)+","+(a.node(r).y+(T[r]?T[r].y:0)-a.node(r).height/2)+" )"),n.select("#"+y.id+" #"+r).attr("data-x-shift",a.node(r).x-a.node(r).width/2),l.querySelectorAll("#"+y.id+" #"+r+" .divider").forEach(h=>{const w=h.parentElement;let E=0,M=0;w&&(w.parentElement&&(E=w.parentElement.getBBox().width),M=parseInt(w.getAttribute("data-x-shift"),10),Number.isNaN(M)&&(M=0)),h.setAttribute("x1",0-M+8),h.setAttribute("x2",E-M-8)})):S.debug("No Node "+r+": "+JSON.stringify(a.node(r)))});let v=y.getBBox();a.edges().forEach(function(r){r!==void 0&&a.edge(r)!==void 0&&(S.debug("Edge "+r.v+" -> "+r.w+": "+JSON.stringify(a.edge(r))),Q(i,a.edge(r),a.edge(r).relation))}),v=y.getBBox();const k={id:d||"root",label:d||"root",width:0,height:0};return k.width=v.width+2*b.padding,k.height=v.height+2*b.padding,S.debug("Doc rendered",k,a),k},"renderDoc"),it={setConf:V,draw:et},lt={parser:W,get db(){return new N(1)},renderer:it,styles:A,init:f(e=>{e.state||(e.state={}),e.state.arrowMarkerAbsolute=e.arrowMarkerAbsolute},"init")};export{lt as diagram};
2
- //# sourceMappingURL=stateDiagram-AJRCARHV-C6Dhr3fY.js.map
1
+ import{s as A,a as W,S as N}from"./chunk-AQP2D5EJ-BzXiGlmX.js";import{_ as f,c as t,d as H,l as S,e as P,k as z,R as _,S as U,O as C,u as F}from"./mermaid.core-DR6r9S_a.js";import{G as O}from"./graph-CAnANduQ.js";import{l as J}from"./layout-DGIYPm2g.js";import"./chunk-55IACEB6-CGcgNWHA.js";import"./chunk-2J33WTMH-_i-tgxvN.js";import"./index-FNpsxYPN.js";var X=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),"drawStartState"),D=f(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),"drawDivider"),Y=f((e,i)=>{const d=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(i.id),c=d.node().getBBox();return e.insert("rect",":first-child").attr("x",t().state.padding).attr("y",t().state.padding).attr("width",c.width+2*t().state.padding).attr("height",c.height+2*t().state.padding).attr("rx",t().state.radius),d},"drawSimpleState"),I=f((e,i)=>{const d=f(function(o,B,y){const v=o.append("tspan").attr("x",2*t().state.padding).text(B);y||v.attr("dy",t().state.textHeight)},"addTspan"),n=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(i.descriptions[0]).node().getBBox(),l=n.height,p=e.append("text").attr("x",t().state.padding).attr("y",l+t().state.padding*.4+t().state.dividerMargin+t().state.textHeight).attr("class","state-description");let a=!0,s=!0;i.descriptions.forEach(function(o){a||(d(p,o,s),s=!1),a=!1});const m=e.append("line").attr("x1",t().state.padding).attr("y1",t().state.padding+l+t().state.dividerMargin/2).attr("y2",t().state.padding+l+t().state.dividerMargin/2).attr("class","descr-divider"),x=p.node().getBBox(),g=Math.max(x.width,n.width);return m.attr("x2",g+3*t().state.padding),e.insert("rect",":first-child").attr("x",t().state.padding).attr("y",t().state.padding).attr("width",g+2*t().state.padding).attr("height",x.height+l+2*t().state.padding).attr("rx",t().state.radius),e},"drawDescrState"),$=f((e,i,d)=>{const c=t().state.padding,n=2*t().state.padding,l=e.node().getBBox(),p=l.width,a=l.x,s=e.append("text").attr("x",0).attr("y",t().state.titleShift).attr("font-size",t().state.fontSize).attr("class","state-title").text(i.id),x=s.node().getBBox().width+n;let g=Math.max(x,p);g===p&&(g=g+n);let o;const B=e.node().getBBox();i.doc,o=a-c,x>p&&(o=(p-g)/2+c),Math.abs(a-B.x)<c&&x>p&&(o=a-(x-p)/2);const y=1-t().state.textHeight;return e.insert("rect",":first-child").attr("x",o).attr("y",y).attr("class",d?"alt-composit":"composit").attr("width",g).attr("height",B.height+t().state.textHeight+t().state.titleShift+1).attr("rx","0"),s.attr("x",o+c),x<=p&&s.attr("x",a+(g-n)/2-x/2+c),e.insert("rect",":first-child").attr("x",o).attr("y",t().state.titleShift-t().state.textHeight-t().state.padding).attr("width",g).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",g).attr("height",B.height+3+2*t().state.textHeight).attr("rx",t().state.radius),e},"addTitleAndBox"),q=f(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)),"drawEndState"),Z=f((e,i)=>{let d=t().state.forkWidth,c=t().state.forkHeight;if(i.parentId){let n=d;d=c,c=n}return e.append("rect").style("stroke","black").style("fill","black").attr("width",d).attr("height",c).attr("x",t().state.padding).attr("y",t().state.padding)},"drawForkJoinState"),j=f((e,i,d,c)=>{let n=0;const l=c.append("text");l.style("text-anchor","start"),l.attr("class","noteText");let p=e.replace(/\r\n/g,"<br/>");p=p.replace(/\n/g,"<br/>");const a=p.split(z.lineBreakRegex);let s=1.25*t().state.noteMargin;for(const m of a){const x=m.trim();if(x.length>0){const g=l.append("tspan");if(g.text(x),s===0){const o=g.node().getBBox();s+=o.height}n+=s,g.attr("x",i+t().state.noteMargin),g.attr("y",d+n+1.25*t().state.noteMargin)}}return{textWidth:l.node().getBBox().width,textHeight:n}},"_drawLongText"),K=f((e,i)=>{i.attr("class","state-note");const d=i.append("rect").attr("x",0).attr("y",t().state.padding),c=i.append("g"),{textWidth:n,textHeight:l}=j(e,0,0,c);return d.attr("height",l+2*t().state.noteMargin),d.attr("width",n+t().state.noteMargin*2),d},"drawNote"),L=f(function(e,i){const d=i.id,c={id:d,label:i.id,width:0,height:0},n=e.append("g").attr("id",d).attr("class","stateGroup");i.type==="start"&&X(n),i.type==="end"&&q(n),(i.type==="fork"||i.type==="join")&&Z(n,i),i.type==="note"&&K(i.note.text,n),i.type==="divider"&&D(n),i.type==="default"&&i.descriptions.length===0&&Y(n,i),i.type==="default"&&i.descriptions.length>0&&I(n,i);const l=n.node().getBBox();return c.width=l.width+2*t().state.padding,c.height=l.height+2*t().state.padding,c},"drawState"),G=0,Q=f(function(e,i,d){const c=f(function(s){switch(s){case N.relationType.AGGREGATION:return"aggregation";case N.relationType.EXTENSION:return"extension";case N.relationType.COMPOSITION:return"composition";case N.relationType.DEPENDENCY:return"dependency"}},"getRelationType");i.points=i.points.filter(s=>!Number.isNaN(s.y));const n=i.points,l=_().x(function(s){return s.x}).y(function(s){return s.y}).curve(U),p=e.append("path").attr("d",l(n)).attr("id","edge"+G).attr("class","transition");let a="";if(t().state.arrowMarkerAbsolute&&(a=C(!0)),p.attr("marker-end","url("+a+"#"+c(N.relationType.DEPENDENCY)+"End)"),d.title!==void 0){const s=e.append("g").attr("class","stateLabel"),{x:m,y:x}=F.calcLabelPosition(i.points),g=z.getRows(d.title);let o=0;const B=[];let y=0,v=0;for(let u=0;u<=g.length;u++){const h=s.append("text").attr("text-anchor","middle").text(g[u]).attr("x",m).attr("y",x+o),w=h.node().getBBox();y=Math.max(y,w.width),v=Math.min(v,w.x),S.info(w.x,m,x+o),o===0&&(o=h.node().getBBox().height,S.info("Title height",o,x)),B.push(h)}let k=o*g.length;if(g.length>1){const u=(g.length-1)*o*.5;B.forEach((h,w)=>h.attr("y",x+w*o-u)),k=o*g.length}const r=s.node().getBBox();s.insert("rect",":first-child").attr("class","box").attr("x",m-y/2-t().state.padding/2).attr("y",x-k/2-t().state.padding/2-3.5).attr("width",y+t().state.padding).attr("height",k+t().state.padding),S.info(r)}G++},"drawEdge"),b,T={},V=f(function(){},"setConf"),tt=f(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")},"insertMarkers"),et=f(function(e,i,d,c){b=t().state;const n=t().securityLevel;let l;n==="sandbox"&&(l=H("#i"+i));const p=n==="sandbox"?H(l.nodes()[0].contentDocument.body):H("body"),a=n==="sandbox"?l.nodes()[0].contentDocument:document;S.debug("Rendering diagram "+e);const s=p.select(`[id='${i}']`);tt(s);const m=c.db.getRootDoc(),x=s.append("g").attr("id",i+"-root");R(m,x,void 0,!1,p,a,c);const g=b.padding,o=s.node().getBBox(),B=o.width+g*2,y=o.height+g*2,v=B*1.75;P(s,y,v,b.useMaxWidth),s.attr("viewBox",`${o.x-b.padding} ${o.y-b.padding} `+B+" "+y)},"draw"),at=f(e=>e?e.length*b.fontSizeFactor:1,"getLabelWidth"),R=f((e,i,d,c,n,l,p)=>{const a=new O({compound:!0,multigraph:!0});let s,m=!0;for(s=0;s<e.length;s++)if(e[s].stmt==="relation"){m=!1;break}d?a.setGraph({rankdir:"LR",multigraph:!0,compound:!0,ranker:"tight-tree",ranksep:m?1:b.edgeLengthFactor,nodeSep:m?1:50,isMultiGraph:!0}):a.setGraph({rankdir:"TB",multigraph:!0,compound:!0,ranksep:m?1:b.edgeLengthFactor,nodeSep:m?1:50,ranker:"tight-tree",isMultiGraph:!0}),a.setDefaultEdgeLabel(function(){return{}});const x=p.db.getStates(),g=p.db.getRelations(),o=Object.keys(x);for(const r of o){const u=x[r];d&&(u.parentId=d);let h;if(u.doc){let w=i.append("g").attr("id",u.id).attr("class","stateGroup");h=R(u.doc,w,u.id,!c,n,l,p);{w=$(w,u,c);let E=w.node().getBBox();h.width=E.width,h.height=E.height+b.padding/2,T[u.id]={y:b.compositTitleSize}}}else h=L(i,u,a);if(u.note){const w={descriptions:[],id:u.id+"-note",note:u.note,type:"note"},E=L(i,w,a);u.note.position==="left of"?(a.setNode(h.id+"-note",E),a.setNode(h.id,h)):(a.setNode(h.id,h),a.setNode(h.id+"-note",E)),a.setParent(h.id,h.id+"-group"),a.setParent(h.id+"-note",h.id+"-group")}else a.setNode(h.id,h)}S.debug("Count=",a.nodeCount(),a);let B=0;g.forEach(function(r){B++,S.debug("Setting edge",r),a.setEdge(r.id1,r.id2,{relation:r,width:at(r.title),height:b.labelHeight*z.getRows(r.title).length,labelpos:"c"},"id"+B)}),J(a),S.debug("Graph after layout",a.nodes());const y=i.node();a.nodes().forEach(function(r){r!==void 0&&a.node(r)!==void 0?(S.warn("Node "+r+": "+JSON.stringify(a.node(r))),n.select("#"+y.id+" #"+r).attr("transform","translate("+(a.node(r).x-a.node(r).width/2)+","+(a.node(r).y+(T[r]?T[r].y:0)-a.node(r).height/2)+" )"),n.select("#"+y.id+" #"+r).attr("data-x-shift",a.node(r).x-a.node(r).width/2),l.querySelectorAll("#"+y.id+" #"+r+" .divider").forEach(h=>{const w=h.parentElement;let E=0,M=0;w&&(w.parentElement&&(E=w.parentElement.getBBox().width),M=parseInt(w.getAttribute("data-x-shift"),10),Number.isNaN(M)&&(M=0)),h.setAttribute("x1",0-M+8),h.setAttribute("x2",E-M-8)})):S.debug("No Node "+r+": "+JSON.stringify(a.node(r)))});let v=y.getBBox();a.edges().forEach(function(r){r!==void 0&&a.edge(r)!==void 0&&(S.debug("Edge "+r.v+" -> "+r.w+": "+JSON.stringify(a.edge(r))),Q(i,a.edge(r),a.edge(r).relation))}),v=y.getBBox();const k={id:d||"root",label:d||"root",width:0,height:0};return k.width=v.width+2*b.padding,k.height=v.height+2*b.padding,S.debug("Doc rendered",k,a),k},"renderDoc"),it={setConf:V,draw:et},lt={parser:W,get db(){return new N(1)},renderer:it,styles:A,init:f(e=>{e.state||(e.state={}),e.state.arrowMarkerAbsolute=e.arrowMarkerAbsolute},"init")};export{lt as diagram};
2
+ //# sourceMappingURL=stateDiagram-AJRCARHV-C3e0GwoJ.js.map
@@ -0,0 +1,2 @@
1
+ import{s as e,b as r,a,S as s}from"./chunk-AQP2D5EJ-BzXiGlmX.js";import{_ as i}from"./mermaid.core-DR6r9S_a.js";import"./chunk-55IACEB6-CGcgNWHA.js";import"./chunk-2J33WTMH-_i-tgxvN.js";import"./index-FNpsxYPN.js";var p={parser:a,get db(){return new s(2)},renderer:r,styles:e,init:i(t=>{t.state||(t.state={}),t.state.arrowMarkerAbsolute=t.arrowMarkerAbsolute},"init")};export{p as diagram};
2
+ //# sourceMappingURL=stateDiagram-v2-BHNVJYJU-Bj3cAhsB.js.map
@@ -0,0 +1,26 @@
1
+ var oe=Object.defineProperty;var re=(e,t,n)=>t in e?oe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var h=(e,t,n)=>re(e,typeof t!="symbol"?t+"":t,n);import{_ as P,av as le,aw as mt,ax as ae,ay as ce,az as de,aA as he,aB as ft,aC as ue,aD as Ft,u as k,j as a,ar as st,aq as $t,B as M,X as A,a as me,c as fe,r as w,aE as pe,aF as V,e as ge,o as pt,ao as ye,aG as xe,aH as Se,aI as be,aJ as Ce,K as _,P as we,aK as Te,aL as Ee,aM as Re,aN as ve,aO as Me,aP as _e,aQ as Ae,T as De,aR as He,a6 as E,a9 as Ne,a8 as gt,a7 as yt,aa as ke,N as Ie,O as Be,Q as Le,aS as Oe,R as Fe,aT as $e,U as Ke,aU as je}from"./index-FNpsxYPN.js";const Ye=[{id:"paste",type:"action",action:"paste",label:""},{id:"enter",type:"send",label:"Enter",payload:"\r"},{id:"shift-tab",type:"send",label:"SHIFT-TAB",payload:"\x1B[Z"},{id:"esc",type:"send",label:"ESC",payload:"\x1B"},{id:"ctrl-c",type:"send",label:"CTRL-C",payload:""},{id:"ctrl-d",type:"send",label:"CTRL-D",payload:""},{id:"arrow-up",type:"send",label:"↑",payload:"\x1B[A"},{id:"arrow-down",type:"send",label:"↓",payload:"\x1B[B"},{id:"arrow-left",type:"send",label:"←",payload:"\x1B[D"},{id:"arrow-right",type:"send",label:"→",payload:"\x1B[C"},{id:"shift-enter",type:"send",label:"SHIFT-Enter",payload:"\x1B[13;2u"},{id:"backspace",type:"send",label:"Backspace",payload:"\b"}];/**
2
+ * @license lucide-react v0.564.0 - ISC
3
+ *
4
+ * This source code is licensed under the ISC license.
5
+ * See the LICENSE file in the root directory of this source tree.
6
+ */const Pe=[["path",{d:"M12 17V3",key:"1cwfxf"}],["path",{d:"m6 11 6 6 6-6",key:"12ii2o"}],["path",{d:"M19 21H5",key:"150jfl"}]],Kt=P("arrow-down-to-line",Pe);/**
7
+ * @license lucide-react v0.564.0 - ISC
8
+ *
9
+ * This source code is licensed under the ISC license.
10
+ * See the LICENSE file in the root directory of this source tree.
11
+ */const Ue=[["path",{d:"M11 14h10",key:"1w8e9d"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v1.344",key:"1e62lh"}],["path",{d:"m17 18 4-4-4-4",key:"z2g111"}],["path",{d:"M8 4H6a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h12a2 2 0 0 0 1.793-1.113",key:"bjbb7m"}],["rect",{x:"8",y:"2",width:"8",height:"4",rx:"1",key:"ublpy"}]],jt=P("clipboard-paste",Ue);/**
12
+ * @license lucide-react v0.564.0 - ISC
13
+ *
14
+ * This source code is licensed under the ISC license.
15
+ * See the LICENSE file in the root directory of this source tree.
16
+ */const Ge=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],vi=P("refresh-cw",Ge);/**
17
+ * @license lucide-react v0.564.0 - ISC
18
+ *
19
+ * This source code is licensed under the ISC license.
20
+ * See the LICENSE file in the root directory of this source tree.
21
+ */const Ve=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]],ze=P("rotate-ccw",Ve);function We(e){return`rgb(${e.r} ${e.g} ${e.b})`}const Xe=new Map([[9622,4],[9623,8],[9624,1],[9625,13],[9626,9],[9627,7],[9628,11],[9629,2],[9630,6],[9631,14]]),qe=new Map([[9617,.25],[9618,.5],[9619,.75]]);function Qe(e){return e>=9600&&e<=9631}function z(e){const t=e.getContext("2d");if(!t)throw new Error("2d canvas context unavailable");return t}class Ze{constructor(t){h(this,"kind","canvas");h(this,"mainCanvas");h(this,"selectionCanvas");h(this,"cursorCanvas");h(this,"mainContext");h(this,"selectionContext");h(this,"cursorContext");h(this,"theme");h(this,"fontFamily");h(this,"fontSize");h(this,"cellDimensions",{width:9,height:17});h(this,"deviceCellWidth",9);h(this,"deviceCellHeight",17);h(this,"deviceFontSize",13);h(this,"textTopGap",0);h(this,"textBaselineY",0);h(this,"glyphBoxHeight",0);h(this,"dpr",1);h(this,"cols",0);h(this,"rows",0);h(this,"lastCursor",null);h(this,"frameCount",0);h(this,"lastDrawnRows",[]);h(this,"colorCache",new Map);h(this,"fontCache",new Map);h(this,"cursorBlinkVisible",!0);h(this,"cursorBlinkTimer",null);this.theme=t.theme,this.fontFamily=t.fontFamily,this.fontSize=t.fontSize,t.screenElement.style.position="relative",t.screenElement.style.overflow="hidden",this.mainCanvas=document.createElement("canvas"),this.selectionCanvas=document.createElement("canvas"),this.cursorCanvas=document.createElement("canvas");for(const[n,i]of[[this.mainCanvas,"main"],[this.selectionCanvas,"selection"],[this.cursorCanvas,"cursor"]])n.dataset.layer=i,n.style.position="absolute",n.style.inset="0",n.style.width="100%",n.style.height="100%",n.style.pointerEvents="none",t.screenElement.appendChild(n);this.mainContext=z(this.mainCanvas),this.selectionContext=z(this.selectionCanvas),this.cursorContext=z(this.cursorCanvas)}setTheme(t){this.theme=t,this.colorCache.clear()}render(t){if(this.frameCount+=1,this.lastDrawnRows=[],this.cellDimensions=t.cellDimensions,this.resize(t.meta.cols,t.meta.rows),this.drawSelection(t.selectionRects??[],t.selectionColor??this.theme.selectionBackground),t.meta.dirty==="clean"){this.drawCursor(t.meta);return}const n=t.meta.dirty==="full",i=n?t.rows:t.rows.filter(s=>s.dirty);let o;if(n)o=t.rows;else{const s=new Set;for(const r of i)s.add(r.y-1),s.add(r.y),s.add(r.y+1);o=t.rows.filter(r=>s.has(r.y))}for(const s of o)this.drawRowBackground(s,t.meta.colors);for(const s of o)this.drawRowForeground(s,t.meta.colors);for(const s of i)this.lastDrawnRows.push(s.y);this.drawCursor(t.meta)}getDebugState(){return{kind:this.kind,frameCount:this.frameCount,lastDrawnRows:[...this.lastDrawnRows]}}dispose(){this.mainCanvas.remove(),this.selectionCanvas.remove(),this.cursorCanvas.remove(),this.colorCache.clear(),this.fontCache.clear(),this.lastCursor=null,this.stopCursorBlink()}startCursorBlink(){this.cursorBlinkTimer||(this.cursorBlinkTimer=setInterval(()=>{this.cursorBlinkVisible=!this.cursorBlinkVisible,this.cursorCanvas.style.opacity=this.cursorBlinkVisible?"1":"0"},1e3))}stopCursorBlink(){this.cursorBlinkTimer&&(clearInterval(this.cursorBlinkTimer),this.cursorBlinkTimer=null),this.cursorBlinkVisible=!0,this.cursorCanvas.style.opacity="1"}resize(t,n){const i=Math.max(1,t),o=Math.max(1,n),s=Math.max(1,globalThis.devicePixelRatio??1),r=Math.max(1,Math.round(this.cellDimensions.width*s)),l=Math.max(1,Math.round(this.cellDimensions.height*s));if(this.cols===i&&this.rows===o&&this.dpr===s&&this.deviceCellWidth===r&&this.deviceCellHeight===l)return;this.cols=i,this.rows=o,this.dpr=s,this.deviceCellWidth=r,this.deviceCellHeight=l,this.deviceFontSize=this.fontSize*s,this.mainContext.font=`${this.deviceFontSize}px ${this.fontFamily}`;const c=this.mainContext.measureText("Mg|qyÅ");let d=c.fontBoundingBoxAscent,m=c.fontBoundingBoxDescent;Number.isFinite(d)&&Number.isFinite(m)&&d>0||(d=this.deviceFontSize*.8,m=this.deviceFontSize*.2),this.glyphBoxHeight=d+m,this.textTopGap=Math.round((l-this.glyphBoxHeight)/2),this.textBaselineY=Math.round(this.textTopGap+d);const g=i*r,S=o*l;for(const y of[this.mainCanvas,this.selectionCanvas,this.cursorCanvas])y.width=g,y.height=S,y.style.width=`${g/s}px`,y.style.height=`${S/s}px`;for(const y of[this.mainContext,this.selectionContext,this.cursorContext])y.setTransform(1,0,0,1,0,0),y.textBaseline="alphabetic",y.imageSmoothingEnabled=!1}drawSelection(t,n){if(this.selectionContext.clearRect(0,0,this.selectionCanvas.width,this.selectionCanvas.height),t.length!==0){this.selectionContext.fillStyle=n;for(const i of t)this.selectionContext.fillRect(i.x*this.deviceCellWidth,i.row*this.deviceCellHeight,i.width*this.deviceCellWidth,this.deviceCellHeight)}}drawRowBackground(t,n){const i=t.y*this.deviceCellHeight,o=this.cols*this.deviceCellWidth,s=this.toCss(n.background);this.mainContext.clearRect(0,i,o,this.deviceCellHeight),this.mainContext.fillStyle=s,this.mainContext.fillRect(0,i,o,this.deviceCellHeight);for(const r of t.cells){if(r.widthKind==="spacer-tail"||r.widthKind==="spacer-head")continue;const l=r.style.inverse?r.fgColor??n.foreground:r.bgColor??n.background;if(l.r!==n.background.r||l.g!==n.background.g||l.b!==n.background.b){const c=r.x*this.deviceCellWidth,d=r.widthKind==="wide"?this.deviceCellWidth*2:this.deviceCellWidth;this.mainContext.fillStyle=this.toCss(l),this.mainContext.fillRect(c,i,d,this.deviceCellHeight)}}}drawRowForeground(t,n){const i=t.y*this.deviceCellHeight,o=Math.max(1,Math.round(this.dpr));for(const s of t.cells){if(s.widthKind==="spacer-tail"||s.widthKind==="spacer-head"||!s.text||s.style.invisible)continue;const r=s.x*this.deviceCellWidth,l=s.style.inverse?s.bgColor??n.background:s.fgColor??n.foreground,c=s.widthKind==="wide"?this.deviceCellWidth*2:this.deviceCellWidth;this.mainContext.fillStyle=this.toCss(l);const d=s.codepoints.length===1&&Qe(s.codepoints[0])?s.codepoints[0]:null;d!==null?this.drawBlockElement(d,r,i,c,this.deviceCellHeight):(this.mainContext.font=this.resolveFont(s.style),this.mainContext.fillText(s.text,r,i+this.textBaselineY));const m=i+this.textTopGap,g=i+this.textTopGap+this.glyphBoxHeight;s.style.underline>0&&this.mainContext.fillRect(r,Math.min(Math.round(g-o),i+this.deviceCellHeight-o),Math.max(c-o,o),o),s.style.strikethrough&&this.mainContext.fillRect(r,Math.round(i+this.textTopGap+this.glyphBoxHeight/2),Math.max(c-o,o),o),s.style.overline&&this.mainContext.fillRect(r,Math.max(i,Math.round(m)),Math.max(c-o,o),o)}}drawBlockElement(t,n,i,o,s){const r=this.mainContext,l=C=>Math.round(o*C/8),c=C=>Math.round(s*C/8),d=(C,p,x,I)=>{r.fillRect(n+C,i+p,x-C,I-p)};if(t===9600){d(0,0,o,c(4));return}if(t>=9601&&t<=9608){d(0,c(8-(t-9600)),o,s);return}if(t>=9609&&t<=9615){d(0,0,l(9616-t),s);return}if(t===9616){d(l(4),0,o,s);return}const m=qe.get(t);if(m!==void 0){const C=r.globalAlpha;r.globalAlpha=C*m,d(0,0,o,s),r.globalAlpha=C;return}if(t===9620){d(0,0,o,c(1));return}if(t===9621){d(l(7),0,o,s);return}const g=Xe.get(t)??0,S=l(4),y=c(4);g&1&&d(0,0,S,y),g&2&&d(S,0,o,y),g&4&&d(0,y,S,s),g&8&&d(S,y,o,s)}drawCursor(t){const n=t.colors,i=t.cursor,o=this.lastCursor;if(this.cursorContext.clearRect(0,0,this.cursorCanvas.width,this.cursorCanvas.height),!i.visible||i.x===null||i.y===null){this.lastCursor=null,this.stopCursorBlink();return}const s=i.x*this.deviceCellWidth,r=i.y*this.deviceCellHeight,l=i.wideTail?this.deviceCellWidth*2:this.deviceCellWidth,c=Math.max(1,Math.round(this.dpr)),d=n.cursor??n.foreground,m=this.toCss(d);this.cursorContext.fillStyle=m,this.cursorContext.strokeStyle=m,this.cursorContext.globalAlpha=.7,this.cursorContext.fillRect(s,r+this.deviceCellHeight-2*c,Math.max(l-c,c),2*c),this.cursorContext.globalAlpha=1,this.startCursorBlink(),this.lastCursor={x:i.x,y:i.y,style:i.style},o&&(o.x!==this.lastCursor.x||o.y!==this.lastCursor.y||o.style!==this.lastCursor.style)&&this.lastDrawnRows.push(o.y)}resolveFont(t){const n=this.deviceFontSize,i=[t.italic?"italic":"normal",t.bold?"700":"400",`${n}px`,this.fontFamily].join("|"),o=this.fontCache.get(i);if(o)return o;const s=`${t.italic?"italic ":""}${t.bold?"700 ":""}${n}px ${this.fontFamily}`;return this.fontCache.set(i,s),s}toCss(t){const n=`${t.r},${t.g},${t.b}`,i=this.colorCache.get(n);if(i)return i;const o=We(t);return this.colorCache.set(n,o),o}}const W=/https?:\/\/[^\s"'`<>()[\]{}]+/g,Je=/[.,;:!?]+$/;function tn(e){let t="";const n=[],i=e.colChars.length;for(let o=0;o<i;o+=1){const s=e.colChars[o];if(!(s===null||s===""))for(let r=0;r<s.length;r+=1)t+=s[r],n.push(o)}return{text:t,colOf:n}}function en(e){let t="";const n=[],i=[];for(let r=0;r<e.length;r+=1){const l=tn(e[r]);for(let c=0;c<l.text.length;c+=1)t+=l.text[c],n.push(r),i.push(l.colOf[c])}const o=[];W.lastIndex=0;let s=W.exec(t);for(;s!==null;){const r=s[0].replace(Je,"");if(r.length>0){const l=s.index,c=l+r.length-1;let d=l;for(let m=l;m<=c;m+=1)(m===c||n[m+1]!==n[m])&&(o.push({lineIndex:n[d],startCol:i[d],endCol:i[m],url:r}),d=m+1)}s=W.exec(t)}return o}const D=0,nn=-2,sn=1,on=2,rn=3,ln=10,an=11,cn=12,dn=13,hn=14,un=15,mn=16,fn=17,pn=1,gn=2,yn=1,xn=2,Sn=3,bn=4,Cn=5,wn=6,Tn=1,En=2,Rn=3,vn=4;function ot(e){if(e.disposed||e.renderStateHandle===0)throw new Error("render state resources already disposed")}function Mn(e){switch(e){case 2:return"full";case 1:return"partial";default:return"clean"}}function _n(e){switch(e){case 0:return"bar";case 2:return"underline";case 3:return"block-hollow";default:return"block"}}function An(e){switch(e){case 1:return"wide";case 2:return"spacer-tail";case 3:return"spacer-head";default:return"narrow"}}function H(e,t){return{r:e.view().getUint8(t),g:e.view().getUint8(t+1),b:e.view().getUint8(t+2)}}function xt(e,t){const n=e.bindings.allocStruct("GhosttyColorRgb");try{const i=t(n.ptr);if(i===nn)return null;if(i!==D)throw new Error(`ghostty optional color read failed with result ${i}`);return H(e.bindings,n.ptr)}finally{n.free()}}function v(e,t){const n=e.bindings.allocU8();try{const i=t(n);if(typeof i=="number"&&i!==D)throw new Error(`ghostty bool read failed with result ${i}`);return e.bindings.readU8(n)!==0}finally{e.bindings.freeU8(n)}}function B(e,t){const n=e.bindings.allocBytes(2);try{const i=t(n);if(typeof i=="number"&&i!==D)throw new Error(`ghostty u16 read failed with result ${i}`);return e.bindings.view().getUint16(n,!0)}finally{e.bindings.freeBytes(n,2)}}function Dn(e,t){const n=e.bindings.allocBytes(4);try{const i=t(n);if(typeof i=="number"&&i!==D)throw new Error(`ghostty u32 read failed with result ${i}`);return e.bindings.view().getUint32(n,!0)}finally{e.bindings.freeBytes(n,4)}}function et(e,t){const n=e.bindings.allocBytes(4);try{const i=t(n);if(typeof i=="number"&&i!==D)throw new Error(`ghostty enum read failed with result ${i}`);return e.bindings.view().getInt32(n,!0)}finally{e.bindings.freeBytes(n,4)}}function St(e,t){const n=e.bindings.allocBytes(8);try{const i=t(n);if(typeof i=="number"&&i!==D)throw new Error(`ghostty u64 read failed with result ${i}`);return e.bindings.readU64(n)}finally{e.bindings.freeBytes(n,8)}}function Hn(e){const t=e.bindings.allocStruct("GhosttyStyle");try{e.bindings.setField(t.view,"GhosttyStyle","size",e.bindings.typeSize("GhosttyStyle")),e.bindings.getRenderStateRowCellValue(e.rowCellsHandle,xn,t.ptr);const n=i=>e.bindings.field("GhosttyStyle",i).offset;return{bold:t.view.getUint8(n("bold"))!==0,italic:t.view.getUint8(n("italic"))!==0,faint:t.view.getUint8(n("faint"))!==0,blink:t.view.getUint8(n("blink"))!==0,inverse:t.view.getUint8(n("inverse"))!==0,invisible:t.view.getUint8(n("invisible"))!==0,strikethrough:t.view.getUint8(n("strikethrough"))!==0,overline:t.view.getUint8(n("overline"))!==0,underline:t.view.getInt32(n("underline"),!0)}}finally{t.free()}}function Nn(e){const t=Dn(e,i=>e.bindings.getRenderStateRowCellValueResult(e.rowCellsHandle,Sn,i));if(t===0)return[];const n=e.bindings.allocBytes(t*4);try{e.bindings.getRenderStateRowCellValue(e.rowCellsHandle,bn,n);const i=[];for(let o=0;o<t;o+=1)i.push(e.bindings.view().getUint32(n+o*4,!0));return i}finally{e.bindings.freeBytes(n,t*4)}}function kn(e){if(e.length===0)return"";try{return String.fromCodePoint(...e)}catch{return""}}function In(e){let t="";for(const n of e)if(!(n.widthKind==="spacer-tail"||n.widthKind==="spacer-head")){if(n.text){t+=n.text;continue}n.widthKind==="narrow"&&(t+=" ")}return t}function Bn(e){const t=e.bindings.allocStruct("GhosttyRenderStateColors");try{e.bindings.setField(t.view,"GhosttyRenderStateColors","size",e.bindings.typeSize("GhosttyRenderStateColors")),e.bindings.getRenderStateColors(e.renderStateHandle,t.ptr);const n=e.bindings.field("GhosttyRenderStateColors","palette").offset,i=[];for(let r=0;r<256;r+=1){const l=t.ptr+n+r*3;i.push(H(e.bindings,l))}const o=t.view.getUint8(e.bindings.field("GhosttyRenderStateColors","cursor_has_value").offset)!==0,s=v(e,r=>e.bindings.getRenderStateValueResult(e.renderStateHandle,hn,r));return{cols:B(e,r=>e.bindings.getRenderStateValueResult(e.renderStateHandle,sn,r)),rows:B(e,r=>e.bindings.getRenderStateValueResult(e.renderStateHandle,on,r)),dirty:Mn(et(e,r=>e.bindings.getRenderStateValueResult(e.renderStateHandle,rn,r))),colors:{background:H(e.bindings,t.ptr+e.bindings.field("GhosttyRenderStateColors","background").offset),foreground:H(e.bindings,t.ptr+e.bindings.field("GhosttyRenderStateColors","foreground").offset),cursor:o?H(e.bindings,t.ptr+e.bindings.field("GhosttyRenderStateColors","cursor").offset):null,palette:i},cursor:{style:_n(et(e,r=>e.bindings.getRenderStateValueResult(e.renderStateHandle,ln,r))),visible:v(e,r=>e.bindings.getRenderStateValueResult(e.renderStateHandle,an,r)),blinking:v(e,r=>e.bindings.getRenderStateValueResult(e.renderStateHandle,cn,r)),passwordInput:v(e,r=>e.bindings.getRenderStateValueResult(e.renderStateHandle,dn,r)),x:s?B(e,r=>e.bindings.getRenderStateValueResult(e.renderStateHandle,un,r)):null,y:s?B(e,r=>e.bindings.getRenderStateValueResult(e.renderStateHandle,mn,r)):null,wideTail:s?v(e,r=>e.bindings.getRenderStateValueResult(e.renderStateHandle,fn,r)):!1}}}finally{t.free()}}function Ln(e,t){const n=St(e,s=>e.bindings.getRenderStateRowValueResult(e.rowIteratorHandle,gn,s));e.bindings.bindRenderStateRowCells(e.rowIteratorHandle,e.rowCellsHandle);const i=[];let o=0;for(;e.bindings.nextRenderStateRowCell(e.rowCellsHandle);){const s=St(e,d=>e.bindings.getRenderStateRowCellValueResult(e.rowCellsHandle,yn,d)),r=Nn(e),l=An(et(e,d=>e.bindings.getRawCellValueResult(s,Rn,d))),c={x:o,text:kn(r),codepoints:r,widthKind:l,hasText:v(e,d=>e.bindings.getRawCellValueResult(s,vn,d)),style:Hn(e),fgColor:xt(e,d=>e.bindings.getRenderStateRowCellValueResult(e.rowCellsHandle,wn,d)),bgColor:xt(e,d=>e.bindings.getRenderStateRowCellValueResult(e.rowCellsHandle,Cn,d))};i.push(c),o+=1}return{y:t,dirty:v(e,s=>e.bindings.getRenderStateRowValueResult(e.rowIteratorHandle,pn,s)),wrap:v(e,s=>e.bindings.getRawRowValueResult(n,Tn,s)),wrapContinuation:v(e,s=>e.bindings.getRawRowValueResult(n,En,s)),text:In(i),cells:i}}function bt(e){return{bindings:e,renderStateHandle:e.createRenderState(),rowIteratorHandle:e.createRenderStateRowIterator(),rowCellsHandle:e.createRenderStateRowCells(),snapshotVersion:0,disposed:!1,cachedMeta:null}}function Ct(e,t){ot(e),e.bindings.updateRenderState(e.renderStateHandle,t),e.bindings.bindRenderStateRowIterator(e.renderStateHandle,e.rowIteratorHandle),e.snapshotVersion+=1,e.cachedMeta=null}function nt(e){return ot(e),e.cachedMeta||(e.cachedMeta=Bn(e)),e.cachedMeta}function*On(e){ot(e);const t=nt(e);e.bindings.bindRenderStateRowIterator(e.renderStateHandle,e.rowIteratorHandle);let n=0;for(;n<t.rows&&e.bindings.nextRenderStateRowIterator(e.rowIteratorHandle);)yield Ln(e,n),n+=1}function X(e){e.disposed||(e.disposed=!0,e.rowCellsHandle!==0&&(e.bindings.freeRenderStateRowCells(e.rowCellsHandle),e.rowCellsHandle=0),e.rowIteratorHandle!==0&&(e.bindings.freeRenderStateRowIterator(e.rowIteratorHandle),e.rowIteratorHandle=0),e.renderStateHandle!==0&&(e.bindings.freeRenderState(e.renderStateHandle),e.renderStateHandle=0),e.cachedMeta=null)}const Fn={colChars:[],contentCols:0,wrappedToNext:!1};function $n(e){for(let t=e.length-1;t>=0;t-=1){const n=e[t];if(n!==null&&n!==""&&n!==" ")return t+1}return 0}function wt(e,t=!1){const n=[];for(const i of e){if(i.widthKind==="spacer-tail"){n.push(null);continue}if(i.widthKind==="spacer-head"){n.push("");continue}n.push(i.text||" ")}return{colChars:n,contentCols:$n(n),wrappedToNext:t}}function Kn(e,t){return Math.max(0,Math.min(Math.max(e.colChars.length-1,0),Math.floor(t)))}function rt(e,t){let n=Kn(e,t);for(;n>0&&e.colChars[n]===null;)n-=1;return n}function q(e,t){let n=t;for(;n>0&&e.colChars[n]===null;)n-=1;return e.colChars[n]||""}function Tt(e,t){let n=t;for(;n+1<e.colChars.length&&e.colChars[n+1]===null;)n+=1;return n}function jn(e,t){return e.line<t.line?{start:e,end:t}:e.line>t.line?{start:t,end:e}:e.col<=t.col?{start:e,end:t}:{start:t,end:e}}function Yn(e,t,n){if(n.colChars.length===0)return{start:{line:e,col:0},end:{line:e,col:0}};const i=rt(n,t),o=l=>/[\p{L}\p{N}_-]/u.test(l);if(!o(q(n,i)))return{start:{line:e,col:i},end:{line:e,col:i}};let s=i,r=i;for(;s>0&&o(q(n,s-1));)s-=1;for(;r+1<n.colChars.length&&o(q(n,r+1));)r+=1;return{start:{line:e,col:s},end:{line:e,col:r}}}function Yt(e,t){const n=Math.max(t.contentCols-1,0);return{start:{line:e,col:0},end:{line:e,col:n}}}function Pt(e,t,n){const i=n(e.line);switch(t){case"word":return Yn(e.line,e.col,i);case"line":return Yt(e.line,i);default:{const o=rt(i,e.col);return{start:{line:e.line,col:o},end:{line:e.line,col:o}}}}}function Ut(){return{anchor:null,focus:null,mode:"character"}}function Et(e){return!!(e.anchor&&e.focus)}function Pn(){return Ut()}function Un(e,t,n){const i=Pt(t,t.mode,n);return{anchor:i.start,focus:i.end,mode:t.mode}}function Rt(e,t,n){return e.anchor?e.mode==="line"?{...e,focus:Yt(t.line,n(t.line)).end}:e.mode==="word"?{...e,focus:Pt(t,"word",n).end}:{...e,focus:{line:t.line,col:rt(n(t.line),t.col)}}:e}function Gt(e){return!e.anchor||!e.focus?null:jn(e.anchor,e.focus)}function Gn(e,t,n){const i=e.wrappedToNext?e.colChars.length-1:e.contentCols-1,o=Math.min(n,i);let s=Math.max(0,t);for(;s>0&&e.colChars[s]===null;)s-=1;if(s>o)return"";let r="";for(let l=s;l<=o;l+=1)r+=e.colChars[l]??"";return r}function Vn(e,t){const n=Gt(e);if(!n)return null;let i="";for(let o=n.start.line;o<=n.end.line;o+=1){const s=t(o),r=o===n.start.line?n.start.col:0,l=o===n.end.line?n.end.col:s.colChars.length-1;i+=Gn(s,r,l),o<n.end.line&&!s.wrappedToNext&&(i+=`
22
+ `)}return i}function zn(e,t,n,i){const o=Gt(e);if(!o)return[];const s=t+n-1,r=[];for(let l=Math.max(o.start.line,t);l<=Math.min(o.end.line,s);l+=1){const c=l-t;if(l===o.start.line&&l===o.end.line){const m=i==null?void 0:i(l),g=m?Tt(m,o.end.col):o.end.col;r.push({row:c,x:o.start.col,width:g-o.start.col+1});continue}if(l===o.start.line){const m=i?Math.max(i(l).colChars.length-o.start.col,0):Number.MAX_SAFE_INTEGER;r.push({row:c,x:o.start.col,width:m});continue}if(l===o.end.line){const m=i==null?void 0:i(l),g=m?Tt(m,o.end.col):o.end.col;r.push({row:c,x:0,width:g+1});continue}const d=i?i(l).colChars.length:Number.MAX_SAFE_INTEGER;r.push({row:c,x:0,width:d})}return r}const vt=80,N=24,Q=9,Z=17,Mt=1.2,Wn=48,Mi="ghostty-official",$=9,K=1e3,j=1002,Y=1003,J=1007,L=1047,O=1049,Xn=[$,K,j,Y],_t=1,At=3,Dt=2,qn=4,Qn=5;class Zn{constructor(t){this.content=t}translateToString(t){return t?this.content.replace(/\s+$/u,""):this.content}}class Jn{constructor(){h(this,"active",{baseY:0,viewportY:0,length:N,getLine:t=>{const n=t-this.active.viewportY,i=this.visibleLines[n];return typeof i=="string"?new Zn(i):null}});h(this,"visibleLines",Array.from({length:N},()=>""))}setViewport(t,n,i,o){this.active.viewportY=t,this.active.baseY=n,this.active.length=i,this.visibleLines=o}}const ti={deleteContentBackward:"Backspace",deleteContentForward:"Delete",insertLineBreak:"Enter",insertParagraph:"Enter"};function ei(e){return!(e.key.length===1&&!e.ctrlKey&&!e.altKey&&!e.metaKey)}function ni(e,t){const n=e.slice(0,t).map(i=>i.text);for(;n.length<t;)n.push("");return n}function F(e){return Ft({shiftKey:!!e.shiftKey,ctrlKey:!!e.ctrlKey,altKey:!!e.altKey,metaKey:!!e.metaKey,getModifierState:()=>!1})}class ii{constructor(){h(this,"terminal",null)}activate(t){this.terminal=t instanceof U?t:null}fit(){const t=this.proposeDimensions();!this.terminal||!t||this.terminal.resize(t.cols,t.rows)}proposeDimensions(){var t;return((t=this.terminal)==null?void 0:t.measureSizeFromElement())??null}dispose(){this.terminal=null}}class U{constructor(t,n,i,o,s,r){h(this,"buffer",new Jn);h(this,"_core",{_renderService:{dimensions:{css:{cell:{width:Q,height:Z}}}}});h(this,"options");h(this,"element",null);h(this,"textarea",null);h(this,"cols",vt);h(this,"rows",N);h(this,"bindings");h(this,"terminalHandle");h(this,"keyEncoderHandle");h(this,"mouseEncoderHandle");h(this,"renderState");h(this,"dataListeners",new Set);h(this,"selectionListeners",new Set);h(this,"linkListeners",new Set);h(this,"linkCursorActive",!1);h(this,"lastNotifiedSelectionText",null);h(this,"addons",new Set);h(this,"screenElement",null);h(this,"renderer",null);h(this,"renderRaf",null);h(this,"lastCursor",null);h(this,"disposed",!1);h(this,"disableStdin");h(this,"customKeyEventHandler",()=>!0);h(this,"imeIsComposing",!1);h(this,"lastCompositionCommit",null);h(this,"selectionState",Ut());h(this,"lineCache",new Map);h(this,"lastViewportOffset",0);h(this,"lastViewportRows",N);h(this,"lastRenderedRows",[]);h(this,"pointerDrag",{active:!1,moved:!1,mode:"character",lastClientX:null,lastClientY:null});h(this,"autoScrollTimer",null);h(this,"domEventDisposers",[]);h(this,"copyShortcutSuppressed",!1);h(this,"scrollbarThumb",null);h(this,"scrollbarFadeTimer",null);h(this,"pressedMouseButtons",new Set);h(this,"wheelPixelDelta",0);h(this,"mouseDragActive",!1);this.bindings=t,this.terminalHandle=n,this.keyEncoderHandle=i,this.mouseEncoderHandle=o,this.renderState=s,this.options=r,this.disableStdin=!!r.disableStdin}static async create(t){const n=await le(),i=n.createTerminal(vt,N,t.scrollback);let o=0,s=0,r=null;try{return n.setTerminalTheme(i,t.theme),o=n.createKeyEncoder(),s=n.createMouseEncoder(),r=bt(n),new U(n,i,o,s,r,t)}catch(l){throw r&&X(r),o!==0&&n.freeKeyEncoder(o),s!==0&&n.freeMouseEncoder(s),n.freeTerminal(i),l}}open(t){if(this.disposed||this.element)return;const n=document.createElement("div");n.className="xterm",n.style.position="absolute",n.style.inset="0",n.style.overflow="hidden",n.style.width="100%",n.style.height="100%",n.style.backgroundColor=this.options.theme.background,n.style.color=this.options.theme.foreground,n.style.fontFamily=this.options.fontFamily,n.style.fontSize=`${this.options.fontSize}px`,n.style.lineHeight=String(this.options.lineHeight??Mt);const i=document.createElement("div");i.className="xterm-viewport",i.style.width="100%",i.style.height="100%",i.style.overflow="hidden",i.style.position="relative";const o=document.createElement("div");o.className="xterm-screen",o.style.width="100%",o.style.height="100%",o.style.position="relative",o.style.userSelect="none",o.style.webkitUserSelect="none",o.style.backgroundColor=this.options.theme.background;const s=document.createElement("div");s.className="xterm-helper-textarea",s.setAttribute("aria-label","Terminal Input"),s.setAttribute("role","textbox"),s.setAttribute("contenteditable","true"),s.setAttribute("autocorrect","off"),s.setAttribute("autocapitalize","off"),s.setAttribute("spellcheck","false"),s.style.position="absolute",s.style.opacity="1",s.style.pointerEvents="none",s.style.left="0",s.style.top="0",s.style.minWidth="1px",s.style.minHeight="1px",s.style.whiteSpace="pre",s.style.border="0",s.style.padding="0",s.style.margin="0",s.style.color=this.options.theme.foreground,s.style.backgroundColor="transparent",s.style.caretColor="transparent",s.style.overflow="visible",s.style.outline="none",s.style.boxShadow="none",s.style.fontFamily=this.options.fontFamily,s.style.fontSize=`${this.options.fontSize}px`,s.style.userSelect="text",s.style.webkitUserSelect="text";const r=document.createElement("div");r.className="xterm-scrollbar-track",r.style.position="absolute",r.style.top="0",r.style.right="0",r.style.width="8px",r.style.height="100%",r.style.backgroundColor="transparent",r.style.pointerEvents="none";const l=document.createElement("div");l.className="xterm-scrollbar-thumb",l.style.position="absolute",l.style.top="0",l.style.right="0",l.style.width="6px",l.style.marginRight="1px",l.style.borderRadius="3px",l.style.backgroundColor="rgba(128, 128, 128, 0.5)",l.style.pointerEvents="none",l.style.transition="opacity 0.15s ease",l.style.opacity="0",r.appendChild(l),i.appendChild(o),n.appendChild(i),n.appendChild(s),n.appendChild(r),t.appendChild(n),this.element=n,this.screenElement=o,this.textarea=s,this.scrollbarThumb=l,this.renderer=new Ze({screenElement:o,theme:this.options.theme,fontFamily:this.options.fontFamily,fontSize:this.options.fontSize}),this.syncInputState(),this.bindDomEvents(),this.updateCellDimensions();const c=this.measureSizeFromElement();c?this.resize(c.cols,c.rows):this.render()}loadAddon(t){t.activate(this),this.addons.add(t)}onData(t){return this.dataListeners.add(t),{dispose:()=>{this.dataListeners.delete(t)}}}attachCustomKeyEventHandler(t){this.customKeyEventHandler=t}onSelectionChange(t){return this.selectionListeners.add(t),{dispose:()=>{this.selectionListeners.delete(t)}}}onLinkActivated(t){return this.linkListeners.add(t),{dispose:()=>{this.linkListeners.delete(t)}}}hasSelection(){return Et(this.selectionState)}getSelection(){return this.getSelectionText()??""}clearSelection(){this.disposed||this.clearSelectionState()}startTouchSelection(t,n,i="word"){return this.disposed?!1:this.beginSelectionAt(t,n,i)}updateTouchSelection(t,n){this.disposed||this.updateSelectionDrag(t,n)}endTouchSelection(){this.disposed||!this.pointerDrag.active||(this.stopAutoScroll(),this.pointerDrag.active=!1,this.render())}write(t){if(this.disposed)return;const n=this.isAltScreenActive();this.bindings.writeVt(this.terminalHandle,t);const i=this.isAltScreenActive();n&&!i&&this.clearMouseTrackingModes(),this.scheduleRender()}clearMouseTrackingModes(){if(!this.disposed){for(const t of Xn)this.bindings.setTerminalMode(this.terminalHandle,t,!1);this.bindings.resetMouseEncoder(this.mouseEncoderHandle),this.pressedMouseButtons.clear(),this.mouseDragActive=!1}}isAltScreenActive(){return this.isModeEnabled(L)||this.isModeEnabled(O)}reset(){this.disposed||(this.lineCache.clear(),this.clearSelectionState(!1),this.bindings.resetTerminal(this.terminalHandle),this.scheduleRender())}refresh(){this.disposed||this.render()}resize(t,n){if(this.disposed)return;const i=Math.max(2,Math.floor(t)),o=Math.max(2,Math.floor(n));this.cols=i,this.rows=o,this.clearSelectionState(!1),this.bindings.resizeTerminal(this.terminalHandle,i,o,this.cellDimensions()),this.bindings.resetMouseEncoder(this.mouseEncoderHandle),this.scheduleRender()}scrollLines(t){this.disposed||t===0||(this.bindings.scrollViewportDelta(this.terminalHandle,t),this.render())}scrollToTop(){this.disposed||(this.bindings.scrollViewportTop(this.terminalHandle),this.render())}scrollToBottom(){this.disposed||(this.bindings.scrollViewportBottom(this.terminalHandle),this.render())}exportModeSnapshot(){return{mouseX10:this.isModeEnabled($),mouseNormal:this.isModeEnabled(K),mouseButton:this.isModeEnabled(j),mouseAny:this.isModeEnabled(Y),mouseUtf8:this.isModeEnabled(1005),mouseSgr:this.isModeEnabled(1006),mouseSgrPixels:this.isModeEnabled(1016),mouseUrxvt:this.isModeEnabled(1015),altScroll:this.isModeEnabled(J),altScreen1047:this.isModeEnabled(L),altScreen1049:this.isModeEnabled(O)}}restoreModeSnapshot(t){this.bindings.setTerminalMode(this.terminalHandle,$,t.mouseX10),this.bindings.setTerminalMode(this.terminalHandle,K,t.mouseNormal),this.bindings.setTerminalMode(this.terminalHandle,j,t.mouseButton),this.bindings.setTerminalMode(this.terminalHandle,Y,t.mouseAny),this.bindings.setTerminalMode(this.terminalHandle,1005,t.mouseUtf8),this.bindings.setTerminalMode(this.terminalHandle,1006,t.mouseSgr),this.bindings.setTerminalMode(this.terminalHandle,1016,t.mouseSgrPixels),this.bindings.setTerminalMode(this.terminalHandle,1015,t.mouseUrxvt),this.bindings.setTerminalMode(this.terminalHandle,J,t.altScroll),this.bindings.setTerminalMode(this.terminalHandle,L,t.altScreen1047),this.bindings.setTerminalMode(this.terminalHandle,O,t.altScreen1049),this.bindings.resetMouseEncoder(this.mouseEncoderHandle)}handleViewportGesture(t){if(this.disposed||t.deltaY===0)return!1;const n=this.gestureToLines(t);if(n===0)return!1;const i=this.getInputRoutingState();if(i.mouseReporting){const o=n<0?qn:Qn;let s=!1;for(let r=0;r<Math.abs(n);r+=1)s=this.emitMouseInput({action:"press",button:o,clientX:t.clientX,clientY:t.clientY,mods:F(t),anyButtonPressed:this.pressedMouseButtons.size>0})||s;return s}return i.altScroll?this.emitAltScrollInput(n):(this.scrollLines(n),!0)}paste(t){if(this.disposed||this.disableStdin||!t)return;const n=this.bindings.encodePaste(this.terminalHandle,t);n&&this.emitData(n)}focus(){var t;(t=this.textarea)==null||t.focus({preventScroll:!0})}getCursorViewportRect(){if(this.disposed)return null;const t=this.screenElement,n=this.lastCursor;if(!t||!n||!n.visible||n.y===null||this.textarea===null||document.activeElement!==this.textarea)return null;const{height:i}=this.cellDimensions();if(i<=0)return null;const o=t.getBoundingClientRect().top+n.y*i;return{top:o,bottom:o+i}}getRendererKind(){var t;return((t=this.renderer)==null?void 0:t.kind)??"unknown"}setTheme(t){var n;this.bindings.setTerminalTheme(this.terminalHandle,t),this.options.theme=t,this.element&&(this.element.style.backgroundColor=t.background,this.element.style.color=t.foreground),this.screenElement&&(this.screenElement.style.backgroundColor=t.background),(n=this.renderer)==null||n.setTheme(t),this.scheduleRender()}setDisableStdin(t){this.disableStdin=t,this.syncInputState()}measureSizeFromElement(){const t=this.element;if(!t)return null;const n=t.getBoundingClientRect(),{width:i,height:o}=this.cellDimensions();return n.width===0||n.height===0||i<=0||o<=0?null:{cols:Math.max(2,Math.floor(n.width/i)),rows:Math.max(2,Math.floor(n.height/o))}}dispose(){var t,n;if(!this.disposed){this.disposed=!0,this.renderRaf!==null&&(cancelAnimationFrame(this.renderRaf),this.renderRaf=null),this.stopAutoScroll(),this.updateSelectionTextProbe(null),this.clearDomEventListeners(),this.scrollbarFadeTimer&&(clearTimeout(this.scrollbarFadeTimer),this.scrollbarFadeTimer=null);for(const i of this.addons)i.dispose();this.addons.clear(),(t=this.renderer)==null||t.dispose(),this.renderer=null,(n=this.element)==null||n.remove(),this.element=null,this.screenElement=null,this.textarea=null,this.scrollbarThumb=null,X(this.renderState),this.bindings.freeMouseEncoder(this.mouseEncoderHandle),this.bindings.freeKeyEncoder(this.keyEncoderHandle),this.bindings.freeTerminal(this.terminalHandle)}}cellDimensions(){return this._core._renderService.dimensions.css.cell}syncInputState(){this.textarea&&(this.textarea.readOnly=this.disableStdin,this.textarea.tabIndex=this.disableStdin?-1:0,this.disableStdin&&document.activeElement===this.textarea&&this.textarea.blur())}bindDomEvents(){const t=this.element,n=this.textarea;if(!t||!n)return;t.addEventListener("click",()=>{this.disableStdin||this.focus()});const i=this.screenElement??t;i.addEventListener("mousedown",s=>{if(s instanceof MouseEvent){if(this.disableStdin||this.focus(),this.getInputRoutingState().mouseReporting){const r=this.mouseButtonFromEvent(s);if(r===null)return;this.clearSelectionState(),this.pressedMouseButtons.add(r),this.mouseDragActive=!0,this.emitMouseInput({action:"press",button:r,clientX:s.clientX,clientY:s.clientY,mods:F(s),anyButtonPressed:!0}),s.preventDefault();return}if(s.button===0&&mt(s)){const r=this.linkAtClient(s.clientX,s.clientY);if(r){this.emitLinkActivated(r),s.preventDefault();return}}s.button===0&&(this.mouseDragActive=!0,this.beginPointerSelection(s),s.preventDefault())}}),i.addEventListener("mousemove",s=>{if(!(!(s instanceof MouseEvent)||this.mouseDragActive)){if(this.getInputRoutingState().mouseReporting){this.setLinkCursor(!1);return}this.setLinkCursor(mt(s)&&this.linkAtClient(s.clientX,s.clientY)!==null)}}),i.addEventListener("mouseleave",()=>{this.setLinkCursor(!1)}),t.addEventListener("wheel",s=>{this.handleViewportGesture({source:"wheel",deltaY:s.deltaY,deltaMode:s.deltaMode,clientX:s.clientX,clientY:s.clientY,shiftKey:s.shiftKey,ctrlKey:s.ctrlKey,altKey:s.altKey,metaKey:s.metaKey})&&s.preventDefault()},{passive:!1});const o=typeof window<"u"&&typeof window.addEventListener=="function"?window:null;if(o){const s=l=>{if(this.mouseDragActive){if(this.getInputRoutingState().mouseReporting){this.emitMouseInput({action:"motion",button:this.mouseButtonFromButtons(l.buttons),clientX:l.clientX,clientY:l.clientY,mods:F(l),anyButtonPressed:this.pressedMouseButtons.size>0||l.buttons>0});return}this.updatePointerSelection(l)}},r=l=>{if(this.mouseDragActive){if(this.mouseDragActive=!1,this.getInputRoutingState().mouseReporting){const c=this.mouseButtonFromEvent(l);c!==null&&this.pressedMouseButtons.delete(c),this.emitMouseInput({action:"release",button:c,clientX:l.clientX,clientY:l.clientY,mods:F(l),anyButtonPressed:this.pressedMouseButtons.size>0});return}this.finishPointerSelection(l)}};o.addEventListener("mousemove",s),o.addEventListener("mouseup",r),this.domEventDisposers.push(()=>{o.removeEventListener("mousemove",s),o.removeEventListener("mouseup",r)})}n.addEventListener("keydown",s=>{const r=this.getSelectionText();if(r&&ae(s)){s.preventDefault(),ce(r).catch(()=>{}),this.clearSelectionState(),this.copyShortcutSuppressed=!0,this.clearTextarea();return}if(!this.customKeyEventHandler(s)||this.disableStdin||this.imeIsComposing||s.keyCode===229||de(s)||!ei(s))return;const l=this.encodeKeyboardEvent(s,s.repeat?"repeat":"press");l&&(s.preventDefault(),this.emitData(l),this.clearTextarea())}),n.addEventListener("keyup",s=>{if(this.copyShortcutSuppressed){const l=s.key.toLowerCase();if(l==="c"){s.preventDefault();return}if(l==="control"||l==="meta"||l==="os"){this.copyShortcutSuppressed=!1,s.preventDefault();return}}if(this.disableStdin||this.imeIsComposing)return;const r=this.encodeKeyboardEvent(s,"release");r&&(s.preventDefault(),this.emitData(r),this.clearTextarea())}),n.addEventListener("compositionstart",()=>{this.imeIsComposing=!0,this.lastCompositionCommit=null,this.syncTextareaPositionToCursor()}),n.addEventListener("compositionupdate",()=>{this.syncTextareaPositionToCursor()}),n.addEventListener("compositionend",s=>{this.imeIsComposing=!1;const r=s.data??"";r&&(this.lastCompositionCommit={data:r,at:Date.now()},this.emitData(r),this.clearTextarea())}),n.addEventListener("beforeinput",s=>{if(this.disableStdin||s.inputType==="insertFromPaste"||s.isComposing||this.imeIsComposing)return;const r=ti[s.inputType??""];if(r){s.preventDefault();const d=this.encodeSyntheticKey(r);d&&this.emitData(d),this.clearTextarea();return}const l=s.data??"";if(!l)return;const c=this.lastCompositionCommit;if(c&&c.data===l&&Date.now()-c.at<40){this.lastCompositionCommit=null,s.preventDefault(),this.clearTextarea();return}this.lastCompositionCommit=null,s.preventDefault(),this.emitData(l),this.clearTextarea()}),n.addEventListener("paste",s=>{var l;if(this.disableStdin)return;const r=((l=s.clipboardData)==null?void 0:l.getData("text/plain"))??"";r&&(s.preventDefault(),this.paste(r),this.clearTextarea())}),n.addEventListener("copy",s=>{const r=this.getSelectionText();r&&he(s,r)}),n.addEventListener("input",()=>{if(this.disableStdin||this.imeIsComposing)return;const s=n.textContent??"";if(!s){this.clearTextarea();return}const r=this.lastCompositionCommit;if(r&&r.data===s&&Date.now()-r.at<40){this.lastCompositionCommit=null,this.clearTextarea();return}this.lastCompositionCommit=null,this.emitData(s),this.clearTextarea()})}encodeKeyboardEvent(t,n){const i=ft(t.code);if(i===0)return null;const o=t.key.length===1&&!t.ctrlKey&&!t.metaKey?t.key:null;return this.bindings.encodeKeyEvent(this.keyEncoderHandle,this.terminalHandle,{action:n,keyCode:i,mods:Ft(t),composing:t.isComposing,utf8:o,unshiftedCodepoint:ue(t.code)})}encodeSyntheticKey(t){const n={code:t,key:t,shiftKey:!1,ctrlKey:!1,altKey:!1,metaKey:!1,repeat:!1,isComposing:!1,getModifierState:()=>!1};return this.encodeKeyboardEvent(n,"press")}getInputRoutingState(){const t=this.isModeEnabled($)||this.isModeEnabled(K)||this.isModeEnabled(j)||this.isModeEnabled(Y),n=this.isModeEnabled(L)||this.isModeEnabled(O);return{mouseReporting:t,altScroll:!t&&n&&this.isModeEnabled(J)}}gestureToLines(t){const n=this.cellDimensions().height||Z;if(t.source==="wheel"){if(t.deltaMode===1)return this.wheelPixelDelta=0,t.deltaY>0?Math.ceil(t.deltaY):Math.floor(t.deltaY);if(t.deltaMode===2){this.wheelPixelDelta=0;const o=Math.max(1,this.rows),s=t.deltaY*o;return s>0?Math.ceil(s):Math.floor(s)}this.wheelPixelDelta+=t.deltaY;const i=this.wheelPixelDelta>0?Math.floor(this.wheelPixelDelta/n):Math.ceil(this.wheelPixelDelta/n);return i!==0&&(this.wheelPixelDelta-=i*n),i}return t.deltaY>0?Math.ceil(t.deltaY/n):Math.floor(t.deltaY/n)}isModeEnabled(t){return this.bindings.isTerminalModeEnabled(this.terminalHandle,t)}mouseButtonFromEvent(t){switch(t.button){case 0:return _t;case 1:return At;case 2:return Dt;default:return null}}mouseButtonFromButtons(t){return t&1?_t:t&4?At:t&2?Dt:null}pointerPositionFromClient(t,n){var r;const i=(r=this.screenElement)==null?void 0:r.getBoundingClientRect();if(!i)return null;const o=Math.max(1,i.width),s=Math.max(1,i.height);return{x:Math.max(0,Math.min(o-1,t-i.left)),y:Math.max(0,Math.min(s-1,n-i.top))}}emitMouseInput(t){var r;if(this.disableStdin)return!1;const n=this.pointerPositionFromClient(t.clientX,t.clientY);if(!n)return!1;const i=this.cellDimensions(),o=(r=this.screenElement)==null?void 0:r.getBoundingClientRect();if(!o)return!1;const s=this.bindings.encodeMouseEvent(this.mouseEncoderHandle,this.terminalHandle,{action:t.action,button:t.button,mods:t.mods,x:n.x,y:n.y,anyButtonPressed:t.anyButtonPressed,screenWidth:Math.max(1,Math.round(o.width)),screenHeight:Math.max(1,Math.round(o.height)),cellWidth:Math.max(1,Math.round(i.width||Q)),cellHeight:Math.max(1,Math.round(i.height||Z))});return s?(this.emitData(s),!0):!1}emitAltScrollInput(t){const n=ft(t<0?"ArrowUp":"ArrowDown");if(n===0)return!1;let i=!1;for(let o=0;o<Math.abs(t);o+=1){const s=this.bindings.encodeKeyEvent(this.keyEncoderHandle,this.terminalHandle,{action:"press",keyCode:n,mods:0,composing:!1,utf8:null,unshiftedCodepoint:null});s&&(this.emitData(s),i=!0)}return i}emitData(t){for(const n of this.dataListeners)n(t)}clearTextarea(){this.textarea&&(this.textarea.textContent="")}syncTextareaPositionToCursor(){const t=this.textarea,n=this.screenElement;if(!t||!n)return;const{width:i,height:o}=this.cellDimensions();if(i<=0||o<=0)return;const s=bt(this.bindings);let r=0,l=0;try{Ct(s,this.terminalHandle);const m=nt(s);m.cursor.x!==null&&m.cursor.y!==null&&(r=m.cursor.x,l=m.cursor.y)}finally{X(s)}const c=r*i,d=l*o;t.style.left=`${c}px`,t.style.top=`${d}px`,t.style.width=`${Math.max(1,i)}px`,t.style.height=`${Math.max(1,o)}px`,t.style.lineHeight=`${o}px`,t.style.fontFamily=this.options.fontFamily,t.style.fontSize=`${this.options.fontSize}px`}scheduleRender(){this.renderRaf===null&&(this.renderRaf=requestAnimationFrame(()=>{this.renderRaf=null,this.render()}))}render(){if(this.disposed||!this.screenElement||!this.renderer)return;const t=this.bindings.readScrollbar(this.terminalHandle),n=Math.max(1,t.len||this.rows);Ct(this.renderState,this.terminalHandle);const i=nt(this.renderState),o=Array.from(On(this.renderState));this.lastCursor=i.cursor,this.cols=Math.max(2,i.cols),this.rows=Math.max(2,i.rows||n),this.lastViewportOffset=t.offset,this.lastViewportRows=this.rows,this.lastRenderedRows=o;for(const d of o)this.lineCache.set(t.offset+d.y,wt(d.cells,d.wrap));const s=zn(this.selectionState,this.lastViewportOffset,this.lastViewportRows,d=>this.getLineModel(d)),r=this.getSelectionText();this.renderer.render({meta:i,rows:o,cellDimensions:this.cellDimensions(),selectionRects:s,selectionColor:this.options.theme.selectionBackground});const l=ni(o,this.rows),c=Math.max(0,t.total-t.len);this.buffer.setViewport(t.offset,c,t.total,l),this.updateSelectionTextProbe(r),this.updateScrollbar(t)}updateScrollbar(t){var c;const n=this.scrollbarThumb;if(!n)return;const i=((c=this.screenElement)==null?void 0:c.clientHeight)??0;if(i===0||t.total<=t.len){n.style.opacity="0";return}const o=t.len/t.total,s=Math.max(20,o*i),l=t.offset/Math.max(1,t.total-t.len)*(i-s);n.style.height=`${s}px`,n.style.transform=`translateY(${l}px)`,n.style.opacity="1",this.scrollbarFadeTimer&&clearTimeout(this.scrollbarFadeTimer),this.scrollbarFadeTimer=setTimeout(()=>{n.style.opacity="0"},800)}updateCellDimensions(){if(!this.element)return;const t=document.createElement("span");t.textContent="WWWWWWWWWW",t.style.position="absolute",t.style.visibility="hidden",t.style.whiteSpace="pre",t.style.fontFamily=this.options.fontFamily,t.style.fontSize=`${this.options.fontSize}px`,this.element.appendChild(t);const n=t.getBoundingClientRect();t.remove();const i=Math.max(1,globalThis.devicePixelRatio??1),o=n.width>0?n.width/10:Q,s=this.options.fontSize*(this.options.lineHeight??Mt);this._core._renderService.dimensions.css.cell.width=Math.max(1,Math.round(o*i))/i,this._core._renderService.dimensions.css.cell.height=Math.max(1,Math.round(s*i))/i}clearSelectionState(t=!0){this.selectionState=Pn(),this.pressedMouseButtons.clear(),this.wheelPixelDelta=0,this.pointerDrag={active:!1,moved:!1,mode:"character",lastClientX:null,lastClientY:null},this.copyShortcutSuppressed=!1,this.stopAutoScroll(),this.updateSelectionTextProbe(null),t&&this.screenElement&&this.renderer&&this.render()}beginSelectionAt(t,n,i){const o=this.hitTest(t,n);return o?(this.pointerDrag={active:!0,moved:!1,mode:i,lastClientX:t,lastClientY:n},this.selectionState=Un(this.selectionState,{...o,mode:i},s=>this.getLineModel(s)),this.updateAutoScroll(),this.render(),!0):!1}updateSelectionDrag(t,n){if(!this.pointerDrag.active)return;const i=this.hitTest(t,n);this.pointerDrag.lastClientX=t,this.pointerDrag.lastClientY=n,i&&(this.pointerDrag.moved=!0,this.selectionState=Rt(this.selectionState,i,o=>this.getLineModel(o)),this.render()),this.updateAutoScroll()}beginPointerSelection(t){this.beginSelectionAt(t.clientX,t.clientY,this.selectionModeFromClickDetail(t.detail))}updatePointerSelection(t){this.updateSelectionDrag(t.clientX,t.clientY)}finishPointerSelection(t){var i,o,s,r;if(!this.pointerDrag.active||t.button!==0)return;this.pointerDrag.lastClientX=t.clientX,this.pointerDrag.lastClientY=t.clientY,this.stopAutoScroll();const n=this.pointerDrag.mode==="character"&&!this.pointerDrag.moved&&((i=this.selectionState.anchor)==null?void 0:i.line)===((o=this.selectionState.focus)==null?void 0:o.line)&&((s=this.selectionState.anchor)==null?void 0:s.col)===((r=this.selectionState.focus)==null?void 0:r.col);if(this.pointerDrag.active=!1,n){this.clearSelectionState();return}this.render()}selectionModeFromClickDetail(t){return t>=3?"line":t===2?"word":"character"}hitTest(t,n){var S;const i=(S=this.screenElement)==null?void 0:S.getBoundingClientRect();if(!i)return null;const{width:o,height:s}=this.cellDimensions();if(o<=0||s<=0)return null;const r=t-i.left,l=n-i.top,c=Math.max(this.cols-1,0),d=Math.max(this.lastViewportRows-1,0),m=Math.max(0,Math.min(c,Math.floor(r/o))),g=Math.max(0,Math.min(d,Math.floor(l/s)));return{line:this.lastViewportOffset+g,col:m}}getLineModel(t){const n=this.lineCache.get(t);if(n)return n;const i=t-this.lastViewportOffset,o=this.lastRenderedRows[i];return o?wt(o.cells,o.wrap):Fn}emitLinkActivated(t){for(const n of this.linkListeners)n(t)}setLinkCursor(t){this.linkCursorActive!==t&&(this.linkCursorActive=t,this.screenElement&&(this.screenElement.style.cursor=t?"pointer":""))}linkAtClient(t,n){const i=this.hitTest(t,n);return i?this.linkAtPoint(i.line,i.col):null}linkAtPoint(t,n){if(this.getLineModel(t).colChars.length===0)return null;let i=t;for(;this.getLineModel(i-1).wrappedToNext;)i-=1;let o=t;for(;this.getLineModel(o).wrappedToNext;)o+=1;const s=[];for(let l=i;l<=o;l+=1)s.push(this.getLineModel(l));const r=t-i;for(const l of en(s))if(l.lineIndex===r&&n>=l.startCol&&n<=l.endCol)return l.url;return null}getSelectionText(){return Et(this.selectionState)?Vn(this.selectionState,t=>this.getLineModel(t)):null}updateSelectionTextProbe(t){if(globalThis.__tmexE2eTerminalSelectionText=t,t!==this.lastNotifiedSelectionText){this.lastNotifiedSelectionText=t;for(const n of this.selectionListeners)n(t)}}updateAutoScroll(){var i;if(!this.pointerDrag.active||this.pointerDrag.lastClientY===null){this.stopAutoScroll();return}const t=(i=this.screenElement)==null?void 0:i.getBoundingClientRect();if(!t){this.stopAutoScroll();return}if(!(this.pointerDrag.lastClientY<t.top||this.pointerDrag.lastClientY>t.bottom)){this.stopAutoScroll();return}this.autoScrollTimer===null&&(this.autoScrollTimer=setInterval(()=>{this.stepAutoScroll()},Wn))}stepAutoScroll(){var o;if(!this.pointerDrag.active||this.pointerDrag.lastClientX===null||this.pointerDrag.lastClientY===null){this.stopAutoScroll();return}const t=(o=this.screenElement)==null?void 0:o.getBoundingClientRect();if(!t){this.stopAutoScroll();return}let n=0;if(this.pointerDrag.lastClientY<t.top?n=-1:this.pointerDrag.lastClientY>t.bottom&&(n=1),n===0){this.stopAutoScroll();return}this.bindings.scrollViewportDelta(this.terminalHandle,n),this.render();const i=this.hitTest(this.pointerDrag.lastClientX,this.pointerDrag.lastClientY);i&&(this.selectionState=Rt(this.selectionState,i,s=>this.getLineModel(s)),this.pointerDrag.moved=!0,this.render())}stopAutoScroll(){this.autoScrollTimer!==null&&(clearInterval(this.autoScrollTimer),this.autoScrollTimer=null)}clearDomEventListeners(){for(;this.domEventDisposers.length>0;){const t=this.domEventDisposers.pop();t==null||t()}}}async function si(e){return U.create(e)}const oi=new Set(["Control","Shift","Alt","Meta","CapsLock","NumLock","ScrollLock","Dead","Unidentified","OS","ContextMenu","Fn","FnLock","Hyper","Super"]),ri={Enter:{label:"Enter",raw:"\r"},Tab:{label:"Tab",raw:" "},Escape:{label:"ESC",raw:"\x1B"},Backspace:{label:"Backspace",raw:"\b"}," ":{label:"Space",raw:" "},ArrowUp:{label:"↑",csiFinal:"A"},ArrowDown:{label:"↓",csiFinal:"B"},ArrowRight:{label:"→",csiFinal:"C"},ArrowLeft:{label:"←",csiFinal:"D"},Home:{label:"Home",csiFinal:"H"},End:{label:"End",csiFinal:"F"},Delete:{label:"Delete",csiNum:3},Insert:{label:"Insert",csiNum:2},PageUp:{label:"PgUp",csiNum:5},PageDown:{label:"PgDn",csiNum:6}},li={F1:"\x1BOP",F2:"\x1BOQ",F3:"\x1BOR",F4:"\x1BOS",F5:"\x1B[15~",F6:"\x1B[17~",F7:"\x1B[18~",F8:"\x1B[19~",F9:"\x1B[20~",F10:"\x1B[21~",F11:"\x1B[23~",F12:"\x1B[24~"},ai={"[":"\x1B","\\":"","]":"","^":"",_:"","@":"\0","?":""};function ci(e){return 1+(e.shiftKey?1:0)+(e.altKey?2:0)+(e.ctrlKey?4:0)+(e.metaKey?8:0)}function di(e){const t=[];return e.ctrlKey&&t.push("CTRL"),e.altKey&&t.push("ALT"),e.metaKey&&t.push("CMD"),e.shiftKey&&t.push("SHIFT"),t.length?`${t.join("-")}-`:""}function hi(e){const t=e.key;if(!t||oi.has(t))return null;const n=ci(e),i=n!==1,o=di(e);if(t==="Tab"&&e.shiftKey&&!e.ctrlKey&&!e.altKey&&!e.metaKey)return{label:"SHIFT-Tab",payload:"\x1B[Z"};if(t==="Enter"&&e.shiftKey&&!e.ctrlKey&&!e.altKey&&!e.metaKey)return{label:"SHIFT-Enter",payload:"\x1B[13;2u"};if(e.ctrlKey&&!e.altKey&&!e.metaKey&&/^[a-zA-Z]$/.test(t)){const l=t.toUpperCase();return{label:`CTRL-${l}`,payload:String.fromCharCode(l.charCodeAt(0)-64)}}const s=li[t];if(s)return{label:o+t,payload:s};const r=ri[t];if(r){if("raw"in r){const c=e.altKey?`\x1B${r.raw}`:r.raw;return{label:o+r.label,payload:c}}if("csiFinal"in r){const c=i?`\x1B[1;${n}${r.csiFinal}`:`\x1B[${r.csiFinal}`;return{label:o+r.label,payload:c}}const l=i?`\x1B[${r.csiNum};${n}~`:`\x1B[${r.csiNum}~`;return{label:o+r.label,payload:l}}if(t.length===1){if(e.altKey&&!e.ctrlKey&&!e.metaKey)return{label:`ALT-${t.toUpperCase()}`,payload:`\x1B${t}`};if(e.ctrlKey){const l=ai[t];return l!==void 0?{label:o+t,payload:l}:null}return{label:t,payload:t}}return null}function Vt(e){return e.replace(/\\(x[0-9a-fA-F]{2}|u[0-9a-fA-F]{4}|.)/g,(t,n)=>{if(n[0]==="x"&&n.length===3||n[0]==="u"&&n.length===5)return String.fromCharCode(Number.parseInt(n.slice(1),16));switch(n){case"r":return"\r";case"n":return`
23
+ `;case"t":return" ";case"e":return"\x1B";case"0":return"\0";case"a":return"\x07";case"b":return"\b";case"f":return"\f";case"v":return"\v";case"\\":return"\\";default:return n}})}function it(e){let t="";for(const n of e){const i=n.codePointAt(0)??0;n==="\\"?t+="\\\\":n==="\r"?t+="\\r":n===`
24
+ `?t+="\\n":n===" "?t+="\\t":n==="\x1B"?t+="\\e":i<32||i>=127&&i<=159?t+=`\\x${i.toString(16).padStart(2,"0")}`:t+=n}return t}const ui={CTRL:"⌃",CONTROL:"⌃",SHIFT:"⇧",ALT:"⌥",OPTION:"⌥",OPT:"⌥",CMD:"⌘",META:"⌘",SUPER:"⌘",WIN:"⌘",ENTER:"⏎",RETURN:"⏎",CR:"⏎",ESC:"⎋",ESCAPE:"⎋",TAB:"⇥",BACKSPACE:"⌫",BS:"⌫",DELETE:"⌦",DEL:"⌦",SPACE:"␣",UP:"↑",DOWN:"↓",LEFT:"←",RIGHT:"→"};function mi(e){return e&&e.split(/[-+]/).map(n=>{const i=n.trim().toUpperCase();return ui[i]??n}).join("")}const fi={paste:jt,toggleKeyboard:$t,newAgentSession:st,scrollToBottom:Kt};function pi({items:e,useIcons:t,onActivate:n,disabled:i=!1,preventFocusSteal:o=!1,className:s,rowTestId:r="editor-shortcuts-row",idPrefix:l="editor-shortcut"}){const{t:c}=k();return a.jsx("div",{className:A("shortcut-row flex items-center gap-1.5 py-2 overflow-x-auto scrollbar-thin",s),"data-testid":r,children:e.map(d=>{const m=d.type==="action",g=m&&d.action?fi[d.action]:null,S=m&&d.action?c(`settings.terminal.shortcuts.action.${d.action}`):"",y=d.label||it(d.payload??""),C=t?mi(y):y,p=m?d.label.trim()||S:y;return a.jsx(M,{type:"button",variant:"ghost",size:"sm",className:"terminal-shortcut-btn h-8 min-w-9 px-2.5 rounded-full font-mono text-[13px] font-medium tracking-wide shrink-0 [@media(any-pointer:coarse)]:h-9 [@media(any-pointer:coarse)]:min-w-10 [@media(any-pointer:coarse)]:px-3",title:p,"aria-label":p,"data-testid":`${l}-${d.id}`,onMouseDown:o?x=>x.preventDefault():void 0,onClick:n?()=>n(d):void 0,disabled:i,children:g?a.jsx(g,{className:"h-4 w-4"}):a.jsx("span",{children:C})},d.id)})})}const Ht=["terminal-shortcuts"];async function zt(e,t){try{return(await e.json()).error??t}catch{return t}}async function gi(){const e=await fetch("/api/settings/terminal-shortcuts");if(!e.ok)throw new Error(await zt(e,"Failed to load terminal shortcuts"));return(await e.json()).settings}async function yi(e){const t=await fetch("/api/settings/terminal-shortcuts",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!t.ok)throw new Error(await zt(t,"Failed to save terminal shortcuts"));return(await t.json()).settings}const Wt=[{action:"paste",icon:jt},{action:"toggleKeyboard",icon:$t},{action:"newAgentSession",icon:st},{action:"scrollToBottom",icon:Kt}];function Nt(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():`sc-${Math.random().toString(36).slice(2)}${Date.now().toString(36)}`}function kt(e){return JSON.stringify([e.id,e.type,e.label,e.payload??null,e.action??null])}function tt(e,t){return e.length!==t.length?!1:e.every((n,i)=>kt(n)===kt(t[i]))}function xi({action:e}){var i;const{t}=k(),n=((i=Wt.find(o=>o.action===e))==null?void 0:i.icon)??st;return a.jsxs("span",{className:"inline-flex shrink-0 items-center gap-1 whitespace-nowrap rounded bg-muted px-1.5 py-0.5 text-muted-foreground text-xs",children:[a.jsx(n,{className:"h-3.5 w-3.5"}),t(`settings.terminal.shortcuts.action.${e}`)]})}function Si({item:e,onLabelChange:t,onPayloadChange:n,onRemove:i}){const{t:o}=k(),{attributes:s,listeners:r,setNodeRef:l,setActivatorNodeRef:c,transform:d,transition:m,isDragging:g}=_e({id:e.id}),S=e.type==="action",[y,C]=w.useState(()=>it(e.payload??""));return w.useEffect(()=>{C(it(e.payload??""))},[e.payload]),a.jsxs("div",{ref:l,style:{transform:He.Translate.toString(d),transition:m},className:A("flex items-center gap-2 rounded-lg border border-border bg-background p-2.5",g&&"opacity-60 shadow-sm"),"data-testid":`shortcut-editor-row-${e.id}`,children:[a.jsx("button",{type:"button",ref:c,...s,...r,"aria-label":o("settings.terminal.shortcuts.dragHandle"),className:"shrink-0 cursor-grab touch-none text-muted-foreground hover:text-foreground",children:a.jsx(Ae,{className:"h-4 w-4"})}),S&&e.action?a.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-2",children:[a.jsx(xi,{action:e.action}),a.jsx(_,{value:e.label,onChange:p=>t(e.id,p.target.value),placeholder:o(`settings.terminal.shortcuts.action.${e.action}`),className:"h-9 min-w-0 flex-1","data-testid":`shortcut-editor-label-${e.id}`})]}):a.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-2",children:[a.jsx(_,{value:e.label,onChange:p=>t(e.id,p.target.value),placeholder:o("settings.terminal.shortcuts.labelPlaceholder"),className:"h-9 w-24 font-mono","data-testid":`shortcut-editor-label-${e.id}`}),a.jsx(_,{value:y,onChange:p=>C(p.target.value),onBlur:()=>n(e.id,Vt(y)),placeholder:o("settings.terminal.shortcuts.payloadPlaceholder"),spellCheck:!1,className:"h-9 min-w-0 flex-1 font-mono text-xs","data-testid":`shortcut-editor-payload-${e.id}`})]}),a.jsx(M,{type:"button",variant:"ghost",size:"icon-sm",onClick:()=>i(e.id),"aria-label":o("settings.terminal.shortcuts.delete"),"data-testid":`shortcut-editor-remove-${e.id}`,children:a.jsx(De,{className:"h-4 w-4"})})]})}function bi(){const{t:e}=k(),t=me(),{data:n,isLoading:i,isError:o,refetch:s}=fe({queryKey:Ht,queryFn:gi}),[r,l]=w.useState([]),[c,d]=w.useState(!1),[m,g]=w.useState(null),[S,y]=w.useState(!1),[C,p]=w.useState(!1),[x,I]=w.useState(""),[lt,at]=w.useState("");w.useEffect(()=>{if(!n)return;if(m===null){l(n.items),d(n.useIcons),g({items:n.items,useIcons:n.useIcons});return}if(tt(m.items,n.items)&&m.useIcons===n.useIcons)return;tt(r,m.items)&&c===m.useIcons&&(l(n.items),d(n.useIcons),g({items:n.items,useIcons:n.useIcons}))},[n,m,r,c]);const Xt=w.useMemo(()=>m?!tt(r,m.items)||c!==m.useIcons:!1,[r,c,m]),qt=pe(V(Me,{activationConstraint:{distance:8}}),V(ve,{activationConstraint:{delay:250,tolerance:5}}),V(Re,{coordinateGetter:Ee})),ct=ge({mutationFn:()=>yi({items:r,useIcons:c}),onSuccess:f=>{t.setQueryData(Ht,f),l(f.items),d(f.useIcons),g({items:f.items,useIcons:f.useIcons}),pt.success(e("settings.terminal.shortcuts.saved"))},onError:f=>{pt.error(f instanceof Error?f.message:e("settings.terminal.shortcuts.saveFailed"))}}),Qt=f=>{const{active:b,over:R}=f;!R||b.id===R.id||l(T=>{const ht=T.findIndex(G=>G.id===b.id),ut=T.findIndex(G=>G.id===R.id);return ht<0||ut<0?T:Te(T,ht,ut)})},Zt=(f,b)=>l(R=>R.map(T=>T.id===f?{...T,label:b}:T)),Jt=(f,b)=>l(R=>R.map(T=>T.id===f?{...T,payload:b}:T)),te=f=>l(b=>b.filter(R=>R.id!==f)),dt=(f,b)=>{b&&l(R=>[...R,{id:Nt(),type:"send",label:f||b,payload:b}])},ee=f=>l(b=>[...b,{id:Nt(),type:"action",action:f,label:""}]),ne=()=>{l(Ye.map(f=>({...f}))),d(!1)},ie=f=>{f.preventDefault(),f.stopPropagation();const b=hi({key:f.key,ctrlKey:f.ctrlKey,shiftKey:f.shiftKey,altKey:f.altKey,metaKey:f.metaKey});b&&(dt(b.label,b.payload),y(!1))},se=()=>{const f=Vt(lt);f&&(dt(x.trim(),f),I(""),at(""))};return o&&!m?a.jsxs("div",{className:"space-y-2","data-testid":"terminal-shortcuts-error",children:[a.jsx("p",{className:"text-destructive text-sm",children:e("settings.terminal.shortcuts.loadFailed")}),a.jsx(M,{type:"button",variant:"outline",size:"sm",onClick:()=>s(),children:e("settings.terminal.shortcuts.retry")})]}):i&&!m?a.jsx("p",{className:"text-muted-foreground text-sm",children:e("settings.terminal.shortcuts.loading")}):a.jsxs("div",{className:"space-y-5","data-testid":"terminal-shortcuts-editor",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx("span",{className:"block font-medium text-sm",children:e("settings.terminal.shortcuts.preview")}),a.jsx("div",{className:"rounded-lg border border-border bg-muted/30 px-3","data-testid":"shortcut-preview",children:a.jsx(pi,{items:r,useIcons:c})})]}),a.jsxs("div",{className:"flex items-center justify-between gap-3 rounded-lg border border-border p-3",children:[a.jsxs("span",{className:"flex min-w-0 flex-col gap-0.5",children:[a.jsx("span",{className:"font-medium text-sm",children:e("settings.terminal.shortcuts.useIcons")}),a.jsx("span",{className:"text-muted-foreground text-xs",children:e("settings.terminal.shortcuts.useIconsDesc")})]}),a.jsx(ye,{checked:c,onCheckedChange:f=>d(f),"aria-label":e("settings.terminal.shortcuts.useIcons"),"data-testid":"shortcut-use-icons"})]}),a.jsx(xe,{sensors:qt,collisionDetection:Se,onDragEnd:Qt,children:a.jsx(be,{items:r.map(f=>f.id),strategy:Ce,children:a.jsx("div",{className:"space-y-2","data-testid":"shortcut-editor-list",children:r.map(f=>a.jsx(Si,{item:f,onLabelChange:Zt,onPayloadChange:Jt,onRemove:te},f.id))})})}),a.jsxs("div",{className:"space-y-3 rounded-lg border border-dashed border-border p-4",children:[a.jsx("span",{className:"block font-medium text-sm",children:e("settings.terminal.shortcuts.addShortcut")}),a.jsx("button",{type:"button",onKeyDown:ie,onFocus:()=>y(!0),onBlur:()=>y(!1),className:A("w-full rounded-lg border px-3 py-2.5 text-center text-sm outline-none transition-colors",S?"border-primary bg-primary/5 text-foreground":"border-border text-muted-foreground"),"data-testid":"shortcut-capture-input",children:e(S?"settings.terminal.shortcuts.capturePrompt":"settings.terminal.shortcuts.captureHint")}),a.jsx("div",{className:"flex flex-wrap gap-1.5",children:Wt.map(({action:f,icon:b})=>a.jsxs(M,{type:"button",variant:"outline",size:"sm",onClick:()=>ee(f),"data-testid":`shortcut-add-action-${f}`,children:[a.jsx(b,{className:"h-3.5 w-3.5"}),e(`settings.terminal.shortcuts.action.${f}`)]},f))}),a.jsx("button",{type:"button",className:"text-muted-foreground text-xs underline underline-offset-2",onClick:()=>p(f=>!f),children:e("settings.terminal.shortcuts.advanced")}),C&&a.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[a.jsx(_,{value:x,onChange:f=>I(f.target.value),placeholder:e("settings.terminal.shortcuts.labelPlaceholder"),className:"h-9 w-24 font-mono","data-testid":"shortcut-manual-label"}),a.jsx(_,{value:lt,onChange:f=>at(f.target.value),placeholder:e("settings.terminal.shortcuts.payloadPlaceholder"),spellCheck:!1,className:"h-9 min-w-0 flex-1 font-mono text-xs","data-testid":"shortcut-manual-payload"}),a.jsxs(M,{type:"button",variant:"outline",size:"sm",onClick:se,"data-testid":"shortcut-manual-add",children:[a.jsx(we,{className:"h-3.5 w-3.5"}),e("settings.terminal.shortcuts.add")]})]})]}),a.jsxs("div",{className:"flex items-center justify-between gap-2 pt-1",children:[a.jsxs(M,{type:"button",variant:"ghost",size:"sm",onClick:ne,"data-testid":"shortcut-reset",children:[a.jsx(ze,{className:"h-3.5 w-3.5"}),e("settings.terminal.shortcuts.reset")]}),a.jsx(M,{type:"button",variant:"default",size:"default",onClick:()=>ct.mutate(),disabled:!Xt||ct.isPending,"data-testid":"shortcut-save",children:e("settings.terminal.shortcuts.save")})]})]})}const u="\x1B",Ci=[`${u}[1;32m  feat/terminal-font${u}[0m ${u}[39m~/projects/tmex${u}[0m`,`${u}[39m// 渲染中文与彩色代码块:字号 / 字体 / 行高 实时预览${u}[0m`,`${u}[35mexport const${u}[0m ${u}[36mgreeting${u}[0m = ${u}[33m"你好,世界 🌏"${u}[0m;`,`${u}[35mfunction${u}[0m ${u}[34mfib${u}[0m(${u}[36mn${u}[0m: ${u}[32mnumber${u}[0m) {`,` ${u}[35mreturn${u}[0m n ${u}[31m<${u}[0m ${u}[33m2${u}[0m ${u}[31m?${u}[0m n ${u}[31m:${u}[0m ${u}[34mfib${u}[0m(n${u}[31m-${u}[0m${u}[33m1${u}[0m) ${u}[31m+${u}[0m ${u}[34mfib${u}[0m(n${u}[31m-${u}[0m${u}[33m2${u}[0m);`,"}",`${u}[32m+ 新增${u}[0m ${u}[31m- 删除${u}[0m ${u}[33m~ 修改${u}[0m ${u}[36m通过测试 ✓${u}[0m`,`${u}[1;34m dir/${u}[0m ${u}[32m file.ts${u}[0m ${u}[33m README.md${u}[0m ${u}[35m config${u}[0m`,`${u}[39m$${u}[0m bun run ${u}[36mbuild:fonts${u}[0m ${u}[32m✓${u}[0m ${u}[39m14MB${u}[0m`,`${u}[7m NORMAL ${u}[0m ${u}[39m UTF-8 LF TypeScript${u}[0m`].join(`\r
25
+ `);function wi({className:e}){const t=E(c=>c.terminalFontId),n=E(c=>c.terminalFontSize),i=E(c=>c.terminalLineHeight),o=E(c=>c.theme),s=w.useRef(null),r=w.useRef(null);w.useEffect(()=>{let c=!1,d=null;return(async()=>{await Ne(t,n);const m=s.current;if(c||!m)return;if(d=await si({fontFamily:ke(t),fontSize:n,lineHeight:i,scrollback:100,theme:o==="light"?gt:yt,disableStdin:!0}),c){d.dispose();return}d.open(m);const g=new ii;d.loadAddon(g),r.current=g,g.fit(),d.write(Ci)})(),()=>{c=!0,r.current=null,d==null||d.dispose()}},[t,n,i,o]),w.useEffect(()=>{const c=s.current;if(!c)return;const d=new ResizeObserver(()=>{var m;return(m=r.current)==null?void 0:m.fit()});return d.observe(c),()=>d.disconnect()},[]);const l=Math.ceil(n*i*12);return a.jsx("div",{className:A("relative w-full overflow-hidden rounded-md border",e),style:{height:`${l}px`,backgroundColor:o==="light"?gt.background:yt.background},children:a.jsx("div",{ref:s,className:"absolute inset-0"})})}const It=8,Bt=28,Lt=1,Ot=2,Ti=[{value:"lift",labelKey:"terminal.keyboardBehavior.modeLift",descKey:"terminal.keyboardBehavior.modeLiftDesc"},{value:"resize",labelKey:"terminal.keyboardBehavior.modeResize",descKey:"terminal.keyboardBehavior.modeResizeDesc"},{value:"follow",labelKey:"terminal.keyboardBehavior.modeFollow",descKey:"terminal.keyboardBehavior.modeFollowDesc"}];function _i({showPreview:e=!0,showShortcuts:t=!0}){const{t:n}=k(),i=E(p=>p.terminalFontSize),o=E(p=>p.setTerminalFontSize),s=E(p=>p.terminalLineHeight),r=E(p=>p.setTerminalLineHeight),l=E(p=>p.terminalFontId),c=E(p=>p.setTerminalFontId),d=E(p=>p.keyboardBehaviorMode),m=E(p=>p.setKeyboardBehaviorMode),[g,S]=w.useState(String(i)),[y,C]=w.useState(String(s));return w.useEffect(()=>{S(String(i))},[i]),w.useEffect(()=>{C(String(s))},[s]),a.jsxs("div",{className:"space-y-6",children:[a.jsx("p",{className:"text-muted-foreground text-sm",children:n("settings.terminal.description")}),e&&a.jsxs("div",{className:"space-y-2",children:[a.jsx("span",{className:"block text-sm font-medium",children:n("settings.terminal.preview")}),a.jsx(wi,{})]}),a.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx("label",{className:"block text-sm font-medium",htmlFor:"terminal-font-size",children:n("settings.terminal.fontSize")}),a.jsx(_,{id:"terminal-font-size","data-testid":"terminal-font-size",type:"number",min:It,max:Bt,step:1,value:g,onChange:p=>{S(p.target.value);const x=Number(p.target.value);Number.isFinite(x)&&x>=It&&x<=Bt&&o(x)},className:"min-h-10"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx("label",{className:"block text-sm font-medium",htmlFor:"terminal-line-height",children:n("settings.terminal.lineHeight")}),a.jsx(_,{id:"terminal-line-height","data-testid":"terminal-line-height",type:"number",min:Lt,max:Ot,step:.1,value:y,onChange:p=>{C(p.target.value);const x=Number(p.target.value);Number.isFinite(x)&&x>=Lt&&x<=Ot&&r(x)},className:"min-h-10"})]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx("label",{className:"block text-sm font-medium",htmlFor:"terminal-font-family",children:n("settings.terminal.fontFamily")}),a.jsxs(Ie,{value:l,onValueChange:p=>{p&&c(p)},children:[a.jsx(Be,{id:"terminal-font-family","data-testid":"terminal-font-family",className:"min-h-10 w-full",children:a.jsx(Le,{children:Oe(l).displayName})}),a.jsx(Fe,{children:$e.map(p=>a.jsx(Ke,{value:p.id,children:p.displayName},p.id))})]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx("span",{className:"block text-sm font-medium",children:n("terminal.keyboardBehavior.title")}),a.jsx("p",{className:"text-muted-foreground text-xs",children:n("terminal.keyboardBehavior.description")}),a.jsx("div",{className:"flex flex-col gap-2",children:Ti.map(p=>{const x=d===p.value;return a.jsxs("button",{type:"button",onClick:()=>m(p.value),"aria-pressed":x,"data-testid":`keyboard-behavior-option-${p.value}`,className:A("flex items-start gap-3 rounded-lg border p-3 text-left transition-colors",x?"border-primary bg-primary/5":"border-border hover:bg-muted/50"),children:[a.jsx("span",{className:A("mt-0.5 flex h-5 w-5 shrink-0 items-center justify-center rounded-full border",x?"border-primary bg-primary text-primary-foreground":"border-muted-foreground/40"),children:x&&a.jsx(je,{className:"h-3.5 w-3.5"})}),a.jsxs("span",{className:"flex min-w-0 flex-col gap-0.5",children:[a.jsx("span",{className:"text-sm font-medium",children:n(p.labelKey)}),a.jsx("span",{className:"text-muted-foreground text-xs leading-snug",children:n(p.descKey)})]})]},p.value)})})]}),a.jsx("p",{className:"text-muted-foreground text-xs",children:n("settings.terminal.savedInBrowser")}),t&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"h-px bg-border"}),a.jsxs("div",{className:"space-y-2",children:[a.jsx("span",{className:"block font-medium text-sm",children:n("settings.terminal.shortcuts.title")}),a.jsx("p",{className:"text-muted-foreground text-xs",children:n("settings.terminal.shortcuts.savedOnServer")}),a.jsx(bi,{})]})]})]})}export{Kt as A,jt as C,ii as F,vi as R,pi as S,_i as T,Mi as a,bi as b,si as c,ze as d,gi as f,Ht as t};
26
+ //# sourceMappingURL=terminal-settings-panel-DLuBkEEZ.js.map
@@ -1,4 +1,4 @@
1
- import{_ as l,D as pt,V as Wt,W as Pt,X as Bt,c as gt,l as S,I as Vt,N as Ft,Y as ft,d as J,C as zt,$ as Gt,z as Ot}from"./mermaid.core-DDMkLXrp.js";import{d as ot}from"./arc-DcujnLz7.js";import"./index-Ra6pj0rt.js";var tt=(function(){var e=l(function(k,s,d,h){for(d=d||{},h=k.length;h--;d[k[h]]=s);return d},"o"),t=[6,11,13,14,15,17,19,20,23,24],n=[1,12],i=[1,13],r=[1,14],o=[1,15],c=[1,16],a=[1,19],p=[1,20],y={trace:l(function(){},"trace"),yy:{},symbols_:{error:2,start:3,timeline_header:4,document:5,EOF:6,timeline:7,timeline_lr:8,timeline_td:9,line:10,SPACE:11,statement:12,NEWLINE:13,title:14,acc_title:15,acc_title_value:16,acc_descr:17,acc_descr_value:18,acc_descr_multiline_value:19,section:20,period_statement:21,event_statement:22,period:23,event:24,$accept:0,$end:1},terminals_:{2:"error",6:"EOF",7:"timeline",8:"timeline_lr",9:"timeline_td",11:"SPACE",13:"NEWLINE",14:"title",15:"acc_title",16:"acc_title_value",17:"acc_descr",18:"acc_descr_value",19:"acc_descr_multiline_value",20:"section",23:"period",24:"event"},productions_:[0,[3,3],[4,1],[4,1],[4,1],[5,0],[5,2],[10,2],[10,1],[10,1],[10,1],[12,1],[12,2],[12,2],[12,1],[12,1],[12,1],[12,1],[21,1],[22,1]],performAction:l(function(s,d,h,g,m,u,w){var v=u.length-1;switch(m){case 1:return u[v-1];case 3:g.setDirection("LR");break;case 4:g.setDirection("TD");break;case 5:this.$=[];break;case 6:u[v-1].push(u[v]),this.$=u[v-1];break;case 7:case 8:this.$=u[v];break;case 9:case 10:this.$=[];break;case 11:g.getCommonDb().setDiagramTitle(u[v].substr(6)),this.$=u[v].substr(6);break;case 12:this.$=u[v].trim(),g.getCommonDb().setAccTitle(this.$);break;case 13:case 14:this.$=u[v].trim(),g.getCommonDb().setAccDescription(this.$);break;case 15:g.addSection(u[v].substr(8)),this.$=u[v].substr(8);break;case 18:g.addTask(u[v],0,""),this.$=u[v];break;case 19:g.addEvent(u[v].substr(2)),this.$=u[v];break}},"anonymous"),table:[{3:1,4:2,7:[1,3],8:[1,4],9:[1,5]},{1:[3]},e(t,[2,5],{5:6}),e(t,[2,2]),e(t,[2,3]),e(t,[2,4]),{6:[1,7],10:8,11:[1,9],12:10,13:[1,11],14:n,15:i,17:r,19:o,20:c,21:17,22:18,23:a,24:p},e(t,[2,10],{1:[2,1]}),e(t,[2,6]),{12:21,14:n,15:i,17:r,19:o,20:c,21:17,22:18,23:a,24:p},e(t,[2,8]),e(t,[2,9]),e(t,[2,11]),{16:[1,22]},{18:[1,23]},e(t,[2,14]),e(t,[2,15]),e(t,[2,16]),e(t,[2,17]),e(t,[2,18]),e(t,[2,19]),e(t,[2,7]),e(t,[2,12]),e(t,[2,13])],defaultActions:{},parseError:l(function(s,d){if(d.recoverable)this.trace(s);else{var h=new Error(s);throw h.hash=d,h}},"parseError"),parse:l(function(s){var d=this,h=[0],g=[],m=[null],u=[],w=this.table,v="",M=0,R=0,P=2,V=1,L=u.slice.call(arguments,1),_=Object.create(this.lexer),C={yy:{}};for(var F in this.yy)Object.prototype.hasOwnProperty.call(this.yy,F)&&(C.yy[F]=this.yy[F]);_.setInput(s,C.yy),C.yy.lexer=_,C.yy.parser=this,typeof _.yylloc>"u"&&(_.yylloc={});var z=_.yylloc;u.push(z);var q=_.options&&_.options.ranges;typeof C.yy.parseError=="function"?this.parseError=C.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function X(A){h.length=h.length-2*A,m.length=m.length-A,u.length=u.length-A}l(X,"popStack");function O(){var A;return A=g.pop()||_.lex()||V,typeof A!="number"&&(A instanceof Array&&(g=A,A=g.pop()),A=d.symbols_[A]||A),A}l(O,"lex");for(var $,N,b,T,E={},H,I,B,D;;){if(N=h[h.length-1],this.defaultActions[N]?b=this.defaultActions[N]:(($===null||typeof $>"u")&&($=O()),b=w[N]&&w[N][$]),typeof b>"u"||!b.length||!b[0]){var K="";D=[];for(H in w[N])this.terminals_[H]&&H>P&&D.push("'"+this.terminals_[H]+"'");_.showPosition?K="Parse error on line "+(M+1)+`:
1
+ import{_ as l,D as pt,V as Wt,W as Pt,X as Bt,c as gt,l as S,I as Vt,N as Ft,Y as ft,d as J,C as zt,$ as Gt,z as Ot}from"./mermaid.core-DR6r9S_a.js";import{d as ot}from"./arc-Bw8pvFsh.js";import"./index-FNpsxYPN.js";var tt=(function(){var e=l(function(k,s,d,h){for(d=d||{},h=k.length;h--;d[k[h]]=s);return d},"o"),t=[6,11,13,14,15,17,19,20,23,24],n=[1,12],i=[1,13],r=[1,14],o=[1,15],c=[1,16],a=[1,19],p=[1,20],y={trace:l(function(){},"trace"),yy:{},symbols_:{error:2,start:3,timeline_header:4,document:5,EOF:6,timeline:7,timeline_lr:8,timeline_td:9,line:10,SPACE:11,statement:12,NEWLINE:13,title:14,acc_title:15,acc_title_value:16,acc_descr:17,acc_descr_value:18,acc_descr_multiline_value:19,section:20,period_statement:21,event_statement:22,period:23,event:24,$accept:0,$end:1},terminals_:{2:"error",6:"EOF",7:"timeline",8:"timeline_lr",9:"timeline_td",11:"SPACE",13:"NEWLINE",14:"title",15:"acc_title",16:"acc_title_value",17:"acc_descr",18:"acc_descr_value",19:"acc_descr_multiline_value",20:"section",23:"period",24:"event"},productions_:[0,[3,3],[4,1],[4,1],[4,1],[5,0],[5,2],[10,2],[10,1],[10,1],[10,1],[12,1],[12,2],[12,2],[12,1],[12,1],[12,1],[12,1],[21,1],[22,1]],performAction:l(function(s,d,h,g,m,u,w){var v=u.length-1;switch(m){case 1:return u[v-1];case 3:g.setDirection("LR");break;case 4:g.setDirection("TD");break;case 5:this.$=[];break;case 6:u[v-1].push(u[v]),this.$=u[v-1];break;case 7:case 8:this.$=u[v];break;case 9:case 10:this.$=[];break;case 11:g.getCommonDb().setDiagramTitle(u[v].substr(6)),this.$=u[v].substr(6);break;case 12:this.$=u[v].trim(),g.getCommonDb().setAccTitle(this.$);break;case 13:case 14:this.$=u[v].trim(),g.getCommonDb().setAccDescription(this.$);break;case 15:g.addSection(u[v].substr(8)),this.$=u[v].substr(8);break;case 18:g.addTask(u[v],0,""),this.$=u[v];break;case 19:g.addEvent(u[v].substr(2)),this.$=u[v];break}},"anonymous"),table:[{3:1,4:2,7:[1,3],8:[1,4],9:[1,5]},{1:[3]},e(t,[2,5],{5:6}),e(t,[2,2]),e(t,[2,3]),e(t,[2,4]),{6:[1,7],10:8,11:[1,9],12:10,13:[1,11],14:n,15:i,17:r,19:o,20:c,21:17,22:18,23:a,24:p},e(t,[2,10],{1:[2,1]}),e(t,[2,6]),{12:21,14:n,15:i,17:r,19:o,20:c,21:17,22:18,23:a,24:p},e(t,[2,8]),e(t,[2,9]),e(t,[2,11]),{16:[1,22]},{18:[1,23]},e(t,[2,14]),e(t,[2,15]),e(t,[2,16]),e(t,[2,17]),e(t,[2,18]),e(t,[2,19]),e(t,[2,7]),e(t,[2,12]),e(t,[2,13])],defaultActions:{},parseError:l(function(s,d){if(d.recoverable)this.trace(s);else{var h=new Error(s);throw h.hash=d,h}},"parseError"),parse:l(function(s){var d=this,h=[0],g=[],m=[null],u=[],w=this.table,v="",M=0,R=0,P=2,V=1,L=u.slice.call(arguments,1),_=Object.create(this.lexer),C={yy:{}};for(var F in this.yy)Object.prototype.hasOwnProperty.call(this.yy,F)&&(C.yy[F]=this.yy[F]);_.setInput(s,C.yy),C.yy.lexer=_,C.yy.parser=this,typeof _.yylloc>"u"&&(_.yylloc={});var z=_.yylloc;u.push(z);var q=_.options&&_.options.ranges;typeof C.yy.parseError=="function"?this.parseError=C.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function X(A){h.length=h.length-2*A,m.length=m.length-A,u.length=u.length-A}l(X,"popStack");function O(){var A;return A=g.pop()||_.lex()||V,typeof A!="number"&&(A instanceof Array&&(g=A,A=g.pop()),A=d.symbols_[A]||A),A}l(O,"lex");for(var $,N,b,T,E={},H,I,B,D;;){if(N=h[h.length-1],this.defaultActions[N]?b=this.defaultActions[N]:(($===null||typeof $>"u")&&($=O()),b=w[N]&&w[N][$]),typeof b>"u"||!b.length||!b[0]){var K="";D=[];for(H in w[N])this.terminals_[H]&&H>P&&D.push("'"+this.terminals_[H]+"'");_.showPosition?K="Parse error on line "+(M+1)+`:
2
2
  `+_.showPosition()+`
3
3
  Expecting `+D.join(", ")+", got '"+(this.terminals_[$]||$)+"'":K="Parse error on line "+(M+1)+": Unexpected "+($==V?"end of input":"'"+(this.terminals_[$]||$)+"'"),this.parseError(K,{text:_.match,token:this.terminals_[$]||$,line:_.yylineno,loc:z,expected:D})}if(b[0]instanceof Array&&b.length>1)throw new Error("Parse Error: multiple actions possible at state: "+N+", token: "+$);switch(b[0]){case 1:h.push($),m.push(_.yytext),u.push(_.yylloc),h.push(b[1]),$=null,R=_.yyleng,v=_.yytext,M=_.yylineno,z=_.yylloc;break;case 2:if(I=this.productions_[b[1]][1],E.$=m[m.length-I],E._$={first_line:u[u.length-(I||1)].first_line,last_line:u[u.length-1].last_line,first_column:u[u.length-(I||1)].first_column,last_column:u[u.length-1].last_column},q&&(E._$.range=[u[u.length-(I||1)].range[0],u[u.length-1].range[1]]),T=this.performAction.apply(E,[v,R,M,C.yy,b[1],m,u].concat(L)),typeof T<"u")return T;I&&(h=h.slice(0,-1*I*2),m=m.slice(0,-1*I),u=u.slice(0,-1*I)),h.push(this.productions_[b[1]][0]),m.push(E.$),u.push(E._$),B=w[h[h.length-2]][h[h.length-1]],h.push(B);break;case 3:return!0}}return!0},"parse")},x=(function(){var k={EOF:1,parseError:l(function(d,h){if(this.yy.parser)this.yy.parser.parseError(d,h);else throw new Error(d)},"parseError"),setInput:l(function(s,d){return this.yy=d||this.yy||{},this._input=s,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:l(function(){var s=this._input[0];this.yytext+=s,this.yyleng++,this.offset++,this.match+=s,this.matched+=s;var d=s.match(/(?:\r\n?|\n).*/g);return d?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),s},"input"),unput:l(function(s){var d=s.length,h=s.split(/(?:\r\n?|\n)/g);this._input=s+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-d),this.offset-=d;var g=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),h.length-1&&(this.yylineno-=h.length-1);var m=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:h?(h.length===g.length?this.yylloc.first_column:0)+g[g.length-h.length].length-h[0].length:this.yylloc.first_column-d},this.options.ranges&&(this.yylloc.range=[m[0],m[0]+this.yyleng-d]),this.yyleng=this.yytext.length,this},"unput"),more:l(function(){return this._more=!0,this},"more"),reject:l(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},"reject"),less:l(function(s){this.unput(this.match.slice(s))},"less"),pastInput:l(function(){var s=this.matched.substr(0,this.matched.length-this.match.length);return(s.length>20?"...":"")+s.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:l(function(){var s=this.match;return s.length<20&&(s+=this._input.substr(0,20-s.length)),(s.substr(0,20)+(s.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:l(function(){var s=this.pastInput(),d=new Array(s.length+1).join("-");return s+this.upcomingInput()+`
@@ -118,4 +118,4 @@ Expecting `+D.join(", ")+", got '"+(this.terminals_[$]||$)+"'":K="Parse error on
118
118
  filter: brightness(120%);
119
119
  }
120
120
  `},"getStyles"),fe=ge,ye={setConf:l(()=>{},"setConf"),draw:l((e,t,n,i)=>{var o,c;return(((c=(o=i==null?void 0:i.db)==null?void 0:o.getDirection)==null?void 0:c.call(o))??"LR")==="TD"?de.draw(e,t,n,i):ie.draw(e,t,n,i)},"draw")},ve={db:yt,renderer:ye,parser:Dt,styles:fe};export{ve as diagram};
121
- //# sourceMappingURL=timeline-definition-PNZ67QCA-jJ1iauQ0.js.map
121
+ //# sourceMappingURL=timeline-definition-PNZ67QCA-DO38TAIg.js.map