mermaid
Version:
Markdown-ish syntax for generating flowcharts, mindmaps, sequence diagrams, class diagrams, gantt charts, git graphs and more.
39 lines • 66.2 kB
JavaScript
import{a as Te}from"./chunk-3SEI7E7V.mjs";import{d as Pe,g as Re}from"./chunk-TECWHJ6D.mjs";import"./chunk-F6PIGZHG.mjs";import"./chunk-JGXDHUYS.mjs";import"./chunk-TINYC7RT.mjs";import"./chunk-TDFULVG6.mjs";import"./chunk-MIE3LDYP.mjs";import{i as De,j as se,k as Rt}from"./chunk-QADHU5CF.mjs";import"./chunk-ZZ52EIBP.mjs";import{$ as z,B as re,H as At,P as _e,U as Ce,V as Ee,W as ke,X as Se,a as xe}from"./chunk-FE53TMRB.mjs";import{b as ne,h as Yt}from"./chunk-L2B47AAZ.mjs";import{a as d}from"./chunk-QVIEFLGF.mjs";var Ot=(function(){var t=d(function(yt,g,_,E){for(_=_||{},E=yt.length;E--;_[yt[E]]=g);return _},"o"),e=[1,24],s=[1,25],o=[1,26],u=[1,27],i=[1,28],n=[1,63],l=[1,64],r=[1,65],h=[1,66],m=[1,67],p=[1,68],y=[1,69],C=[1,29],R=[1,30],O=[1,31],w=[1,32],v=[1,33],B=[1,34],q=[1,35],G=[1,36],H=[1,37],Q=[1,38],K=[1,39],J=[1,40],Z=[1,41],$=[1,42],tt=[1,43],et=[1,44],nt=[1,45],rt=[1,46],st=[1,47],it=[1,48],at=[1,50],ot=[1,51],lt=[1,52],ct=[1,53],ut=[1,54],dt=[1,55],ht=[1,56],pt=[1,57],ft=[1,58],mt=[1,59],bt=[1,60],Dt=[14,42],Gt=[14,34,36,37,38,39,40,41,42,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74],wt=[12,14,34,36,37,38,39,40,41,42,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74],k=[1,82],S=[1,83],T=[1,84],D=[1,85],P=[12,14,42],fe=[12,14,33,42],It=[12,14,33,42,76,77,79,80],_t=[12,33],Ht=[34,36,37,38,39,40,41,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74],Qt={trace:d(function(){},"trace"),yy:{},symbols_:{error:2,start:3,mermaidDoc:4,direction:5,direction_tb:6,direction_bt:7,direction_rl:8,direction_lr:9,graphConfig:10,C4_CONTEXT:11,NEWLINE:12,statements:13,EOF:14,C4_CONTAINER:15,C4_COMPONENT:16,C4_DYNAMIC:17,C4_DEPLOYMENT:18,otherStatements:19,diagramStatements:20,otherStatement:21,title:22,accDescription:23,acc_title:24,acc_title_value:25,acc_descr:26,acc_descr_value:27,acc_descr_multiline_value:28,boundaryStatement:29,boundaryStartStatement:30,boundaryStopStatement:31,boundaryStart:32,LBRACE:33,ENTERPRISE_BOUNDARY:34,attributes:35,SYSTEM_BOUNDARY:36,BOUNDARY:37,CONTAINER_BOUNDARY:38,NODE:39,NODE_L:40,NODE_R:41,RBRACE:42,diagramStatement:43,PERSON:44,PERSON_EXT:45,SYSTEM:46,SYSTEM_DB:47,SYSTEM_QUEUE:48,SYSTEM_EXT:49,SYSTEM_EXT_DB:50,SYSTEM_EXT_QUEUE:51,CONTAINER:52,CONTAINER_DB:53,CONTAINER_QUEUE:54,CONTAINER_EXT:55,CONTAINER_EXT_DB:56,CONTAINER_EXT_QUEUE:57,COMPONENT:58,COMPONENT_DB:59,COMPONENT_QUEUE:60,COMPONENT_EXT:61,COMPONENT_EXT_DB:62,COMPONENT_EXT_QUEUE:63,REL:64,BIREL:65,REL_U:66,REL_D:67,REL_L:68,REL_R:69,REL_B:70,REL_INDEX:71,UPDATE_EL_STYLE:72,UPDATE_REL_STYLE:73,UPDATE_LAYOUT_CONFIG:74,attribute:75,STR:76,STR_KEY:77,STR_VALUE:78,ATTRIBUTE:79,ATTRIBUTE_EMPTY:80,$accept:0,$end:1},terminals_:{2:"error",6:"direction_tb",7:"direction_bt",8:"direction_rl",9:"direction_lr",11:"C4_CONTEXT",12:"NEWLINE",14:"EOF",15:"C4_CONTAINER",16:"C4_COMPONENT",17:"C4_DYNAMIC",18:"C4_DEPLOYMENT",22:"title",23:"accDescription",24:"acc_title",25:"acc_title_value",26:"acc_descr",27:"acc_descr_value",28:"acc_descr_multiline_value",33:"LBRACE",34:"ENTERPRISE_BOUNDARY",36:"SYSTEM_BOUNDARY",37:"BOUNDARY",38:"CONTAINER_BOUNDARY",39:"NODE",40:"NODE_L",41:"NODE_R",42:"RBRACE",44:"PERSON",45:"PERSON_EXT",46:"SYSTEM",47:"SYSTEM_DB",48:"SYSTEM_QUEUE",49:"SYSTEM_EXT",50:"SYSTEM_EXT_DB",51:"SYSTEM_EXT_QUEUE",52:"CONTAINER",53:"CONTAINER_DB",54:"CONTAINER_QUEUE",55:"CONTAINER_EXT",56:"CONTAINER_EXT_DB",57:"CONTAINER_EXT_QUEUE",58:"COMPONENT",59:"COMPONENT_DB",60:"COMPONENT_QUEUE",61:"COMPONENT_EXT",62:"COMPONENT_EXT_DB",63:"COMPONENT_EXT_QUEUE",64:"REL",65:"BIREL",66:"REL_U",67:"REL_D",68:"REL_L",69:"REL_R",70:"REL_B",71:"REL_INDEX",72:"UPDATE_EL_STYLE",73:"UPDATE_REL_STYLE",74:"UPDATE_LAYOUT_CONFIG",76:"STR",77:"STR_KEY",78:"STR_VALUE",79:"ATTRIBUTE",80:"ATTRIBUTE_EMPTY"},productions_:[0,[3,1],[3,1],[5,1],[5,1],[5,1],[5,1],[4,1],[10,4],[10,4],[10,4],[10,4],[10,4],[13,1],[13,1],[13,2],[19,1],[19,2],[19,3],[21,1],[21,1],[21,2],[21,2],[21,1],[29,3],[30,3],[30,3],[30,4],[32,2],[32,2],[32,2],[32,2],[32,2],[32,2],[32,2],[31,1],[20,1],[20,2],[20,3],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,1],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[35,1],[35,2],[75,1],[75,2],[75,1],[75,1]],performAction:d(function(g,_,E,b,A,a,vt){var f=a.length-1;switch(A){case 3:b.setDirection("TB");break;case 4:b.setDirection("BT");break;case 5:b.setDirection("RL");break;case 6:b.setDirection("LR");break;case 8:case 9:case 10:case 11:case 12:b.setC4Type(a[f-3]);break;case 19:b.setTitle(a[f].substring(6)),this.$=a[f].substring(6);break;case 20:b.setAccDescription(a[f].substring(15)),this.$=a[f].substring(15);break;case 21:this.$=a[f].trim(),b.setTitle(this.$);break;case 22:case 23:this.$=a[f].trim(),b.setAccDescription(this.$);break;case 28:a[f].splice(2,0,"ENTERPRISE"),b.addPersonOrSystemBoundary(...a[f]),this.$=a[f];break;case 29:a[f].splice(2,0,"SYSTEM"),b.addPersonOrSystemBoundary(...a[f]),this.$=a[f];break;case 30:b.addPersonOrSystemBoundary(...a[f]),this.$=a[f];break;case 31:a[f].splice(2,0,"CONTAINER"),b.addContainerBoundary(...a[f]),this.$=a[f];break;case 32:b.addDeploymentNode("node",...a[f]),this.$=a[f];break;case 33:b.addDeploymentNode("nodeL",...a[f]),this.$=a[f];break;case 34:b.addDeploymentNode("nodeR",...a[f]),this.$=a[f];break;case 35:b.popBoundaryParseStack();break;case 39:b.addPersonOrSystem("person",...a[f]),this.$=a[f];break;case 40:b.addPersonOrSystem("external_person",...a[f]),this.$=a[f];break;case 41:b.addPersonOrSystem("system",...a[f]),this.$=a[f];break;case 42:b.addPersonOrSystem("system_db",...a[f]),this.$=a[f];break;case 43:b.addPersonOrSystem("system_queue",...a[f]),this.$=a[f];break;case 44:b.addPersonOrSystem("external_system",...a[f]),this.$=a[f];break;case 45:b.addPersonOrSystem("external_system_db",...a[f]),this.$=a[f];break;case 46:b.addPersonOrSystem("external_system_queue",...a[f]),this.$=a[f];break;case 47:b.addContainer("container",...a[f]),this.$=a[f];break;case 48:b.addContainer("container_db",...a[f]),this.$=a[f];break;case 49:b.addContainer("container_queue",...a[f]),this.$=a[f];break;case 50:b.addContainer("external_container",...a[f]),this.$=a[f];break;case 51:b.addContainer("external_container_db",...a[f]),this.$=a[f];break;case 52:b.addContainer("external_container_queue",...a[f]),this.$=a[f];break;case 53:b.addComponent("component",...a[f]),this.$=a[f];break;case 54:b.addComponent("component_db",...a[f]),this.$=a[f];break;case 55:b.addComponent("component_queue",...a[f]),this.$=a[f];break;case 56:b.addComponent("external_component",...a[f]),this.$=a[f];break;case 57:b.addComponent("external_component_db",...a[f]),this.$=a[f];break;case 58:b.addComponent("external_component_queue",...a[f]),this.$=a[f];break;case 60:b.addRel("rel",...a[f]),this.$=a[f];break;case 61:b.addRel("birel",...a[f]),this.$=a[f];break;case 62:b.addRel("rel_u",...a[f]),this.$=a[f];break;case 63:b.addRel("rel_d",...a[f]),this.$=a[f];break;case 64:b.addRel("rel_l",...a[f]),this.$=a[f];break;case 65:b.addRel("rel_r",...a[f]),this.$=a[f];break;case 66:b.addRel("rel_b",...a[f]),this.$=a[f];break;case 67:a[f].splice(0,1),b.addRel("rel",...a[f]),this.$=a[f];break;case 68:b.updateElStyle("update_el_style",...a[f]),this.$=a[f];break;case 69:b.updateRelStyle("update_rel_style",...a[f]),this.$=a[f];break;case 70:b.updateLayoutConfig("update_layout_config",...a[f]),this.$=a[f];break;case 71:this.$=[a[f]];break;case 72:a[f].unshift(a[f-1]),this.$=a[f];break;case 73:case 75:this.$=a[f].trim();break;case 74:let Ct={};Ct[a[f-1].trim()]=a[f].trim(),this.$=Ct;break;case 76:this.$="";break}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],7:[1,6],8:[1,7],9:[1,8],10:4,11:[1,9],15:[1,10],16:[1,11],17:[1,12],18:[1,13]},{1:[3]},{1:[2,1]},{1:[2,2]},{1:[2,7]},{1:[2,3]},{1:[2,4]},{1:[2,5]},{1:[2,6]},{12:[1,14]},{12:[1,15]},{12:[1,16]},{12:[1,17]},{12:[1,18]},{13:19,19:20,20:21,21:22,22:e,23:s,24:o,26:u,28:i,29:49,30:61,32:62,34:n,36:l,37:r,38:h,39:m,40:p,41:y,43:23,44:C,45:R,46:O,47:w,48:v,49:B,50:q,51:G,52:H,53:Q,54:K,55:J,56:Z,57:$,58:tt,59:et,60:nt,61:rt,62:st,63:it,64:at,65:ot,66:lt,67:ct,68:ut,69:dt,70:ht,71:pt,72:ft,73:mt,74:bt},{13:70,19:20,20:21,21:22,22:e,23:s,24:o,26:u,28:i,29:49,30:61,32:62,34:n,36:l,37:r,38:h,39:m,40:p,41:y,43:23,44:C,45:R,46:O,47:w,48:v,49:B,50:q,51:G,52:H,53:Q,54:K,55:J,56:Z,57:$,58:tt,59:et,60:nt,61:rt,62:st,63:it,64:at,65:ot,66:lt,67:ct,68:ut,69:dt,70:ht,71:pt,72:ft,73:mt,74:bt},{13:71,19:20,20:21,21:22,22:e,23:s,24:o,26:u,28:i,29:49,30:61,32:62,34:n,36:l,37:r,38:h,39:m,40:p,41:y,43:23,44:C,45:R,46:O,47:w,48:v,49:B,50:q,51:G,52:H,53:Q,54:K,55:J,56:Z,57:$,58:tt,59:et,60:nt,61:rt,62:st,63:it,64:at,65:ot,66:lt,67:ct,68:ut,69:dt,70:ht,71:pt,72:ft,73:mt,74:bt},{13:72,19:20,20:21,21:22,22:e,23:s,24:o,26:u,28:i,29:49,30:61,32:62,34:n,36:l,37:r,38:h,39:m,40:p,41:y,43:23,44:C,45:R,46:O,47:w,48:v,49:B,50:q,51:G,52:H,53:Q,54:K,55:J,56:Z,57:$,58:tt,59:et,60:nt,61:rt,62:st,63:it,64:at,65:ot,66:lt,67:ct,68:ut,69:dt,70:ht,71:pt,72:ft,73:mt,74:bt},{13:73,19:20,20:21,21:22,22:e,23:s,24:o,26:u,28:i,29:49,30:61,32:62,34:n,36:l,37:r,38:h,39:m,40:p,41:y,43:23,44:C,45:R,46:O,47:w,48:v,49:B,50:q,51:G,52:H,53:Q,54:K,55:J,56:Z,57:$,58:tt,59:et,60:nt,61:rt,62:st,63:it,64:at,65:ot,66:lt,67:ct,68:ut,69:dt,70:ht,71:pt,72:ft,73:mt,74:bt},{14:[1,74]},t(Dt,[2,13],{43:23,29:49,30:61,32:62,20:75,34:n,36:l,37:r,38:h,39:m,40:p,41:y,44:C,45:R,46:O,47:w,48:v,49:B,50:q,51:G,52:H,53:Q,54:K,55:J,56:Z,57:$,58:tt,59:et,60:nt,61:rt,62:st,63:it,64:at,65:ot,66:lt,67:ct,68:ut,69:dt,70:ht,71:pt,72:ft,73:mt,74:bt}),t(Dt,[2,14]),t(Gt,[2,16],{12:[1,76]}),t(Dt,[2,36],{12:[1,77]}),t(wt,[2,19]),t(wt,[2,20]),{25:[1,78]},{27:[1,79]},t(wt,[2,23]),{35:80,75:81,76:k,77:S,79:T,80:D},{35:86,75:81,76:k,77:S,79:T,80:D},{35:87,75:81,76:k,77:S,79:T,80:D},{35:88,75:81,76:k,77:S,79:T,80:D},{35:89,75:81,76:k,77:S,79:T,80:D},{35:90,75:81,76:k,77:S,79:T,80:D},{35:91,75:81,76:k,77:S,79:T,80:D},{35:92,75:81,76:k,77:S,79:T,80:D},{35:93,75:81,76:k,77:S,79:T,80:D},{35:94,75:81,76:k,77:S,79:T,80:D},{35:95,75:81,76:k,77:S,79:T,80:D},{35:96,75:81,76:k,77:S,79:T,80:D},{35:97,75:81,76:k,77:S,79:T,80:D},{35:98,75:81,76:k,77:S,79:T,80:D},{35:99,75:81,76:k,77:S,79:T,80:D},{35:100,75:81,76:k,77:S,79:T,80:D},{35:101,75:81,76:k,77:S,79:T,80:D},{35:102,75:81,76:k,77:S,79:T,80:D},{35:103,75:81,76:k,77:S,79:T,80:D},{35:104,75:81,76:k,77:S,79:T,80:D},t(P,[2,59]),{35:105,75:81,76:k,77:S,79:T,80:D},{35:106,75:81,76:k,77:S,79:T,80:D},{35:107,75:81,76:k,77:S,79:T,80:D},{35:108,75:81,76:k,77:S,79:T,80:D},{35:109,75:81,76:k,77:S,79:T,80:D},{35:110,75:81,76:k,77:S,79:T,80:D},{35:111,75:81,76:k,77:S,79:T,80:D},{35:112,75:81,76:k,77:S,79:T,80:D},{35:113,75:81,76:k,77:S,79:T,80:D},{35:114,75:81,76:k,77:S,79:T,80:D},{35:115,75:81,76:k,77:S,79:T,80:D},{20:116,29:49,30:61,32:62,34:n,36:l,37:r,38:h,39:m,40:p,41:y,43:23,44:C,45:R,46:O,47:w,48:v,49:B,50:q,51:G,52:H,53:Q,54:K,55:J,56:Z,57:$,58:tt,59:et,60:nt,61:rt,62:st,63:it,64:at,65:ot,66:lt,67:ct,68:ut,69:dt,70:ht,71:pt,72:ft,73:mt,74:bt},{12:[1,118],33:[1,117]},{35:119,75:81,76:k,77:S,79:T,80:D},{35:120,75:81,76:k,77:S,79:T,80:D},{35:121,75:81,76:k,77:S,79:T,80:D},{35:122,75:81,76:k,77:S,79:T,80:D},{35:123,75:81,76:k,77:S,79:T,80:D},{35:124,75:81,76:k,77:S,79:T,80:D},{35:125,75:81,76:k,77:S,79:T,80:D},{14:[1,126]},{14:[1,127]},{14:[1,128]},{14:[1,129]},{1:[2,8]},t(Dt,[2,15]),t(Gt,[2,17],{21:22,19:130,22:e,23:s,24:o,26:u,28:i}),t(Dt,[2,37],{19:20,20:21,21:22,43:23,29:49,30:61,32:62,13:131,22:e,23:s,24:o,26:u,28:i,34:n,36:l,37:r,38:h,39:m,40:p,41:y,44:C,45:R,46:O,47:w,48:v,49:B,50:q,51:G,52:H,53:Q,54:K,55:J,56:Z,57:$,58:tt,59:et,60:nt,61:rt,62:st,63:it,64:at,65:ot,66:lt,67:ct,68:ut,69:dt,70:ht,71:pt,72:ft,73:mt,74:bt}),t(wt,[2,21]),t(wt,[2,22]),t(P,[2,39]),t(fe,[2,71],{75:81,35:132,76:k,77:S,79:T,80:D}),t(It,[2,73]),{78:[1,133]},t(It,[2,75]),t(It,[2,76]),t(P,[2,40]),t(P,[2,41]),t(P,[2,42]),t(P,[2,43]),t(P,[2,44]),t(P,[2,45]),t(P,[2,46]),t(P,[2,47]),t(P,[2,48]),t(P,[2,49]),t(P,[2,50]),t(P,[2,51]),t(P,[2,52]),t(P,[2,53]),t(P,[2,54]),t(P,[2,55]),t(P,[2,56]),t(P,[2,57]),t(P,[2,58]),t(P,[2,60]),t(P,[2,61]),t(P,[2,62]),t(P,[2,63]),t(P,[2,64]),t(P,[2,65]),t(P,[2,66]),t(P,[2,67]),t(P,[2,68]),t(P,[2,69]),t(P,[2,70]),{31:134,42:[1,135]},{12:[1,136]},{33:[1,137]},t(_t,[2,28]),t(_t,[2,29]),t(_t,[2,30]),t(_t,[2,31]),t(_t,[2,32]),t(_t,[2,33]),t(_t,[2,34]),{1:[2,9]},{1:[2,10]},{1:[2,11]},{1:[2,12]},t(Gt,[2,18]),t(Dt,[2,38]),t(fe,[2,72]),t(It,[2,74]),t(P,[2,24]),t(P,[2,35]),t(Ht,[2,25]),t(Ht,[2,26],{12:[1,138]}),t(Ht,[2,27])],defaultActions:{2:[2,1],3:[2,2],4:[2,7],5:[2,3],6:[2,4],7:[2,5],8:[2,6],74:[2,8],126:[2,9],127:[2,10],128:[2,11],129:[2,12]},parseError:d(function(g,_){if(_.recoverable)this.trace(g);else{var E=new Error(g);throw E.hash=_,E}},"parseError"),parse:d(function(g){var _=this,E=[0],b=[],A=[null],a=[],vt=this.table,f="",Ct=0,me=0,be=0,We=2,ye=1,Xe=a.slice.call(arguments,1),N=Object.create(this.lexer),Et={yy:{}};for(var Jt in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Jt)&&(Et.yy[Jt]=this.yy[Jt]);N.setInput(g,Et.yy),Et.yy.lexer=N,Et.yy.parser=this,typeof N.yylloc>"u"&&(N.yylloc={});var Zt=N.yylloc;a.push(Zt);var qe=N.options&&N.options.ranges;typeof Et.yy.parseError=="function"?this.parseError=Et.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function G0(V){E.length=E.length-2*V,A.length=A.length-V,a.length=a.length-V}d(G0,"popStack");function Ge(){var V;return V=b.pop()||N.lex()||ye,typeof V!="number"&&(V instanceof Array&&(b=V,V=b.pop()),V=_.symbols_[V]||V),V}d(Ge,"lex");for(var L,$t,kt,I,H0,te,Pt={},Ft,X,ge,jt;;){if(kt=E[E.length-1],this.defaultActions[kt]?I=this.defaultActions[kt]:((L===null||typeof L>"u")&&(L=Ge()),I=vt[kt]&&vt[kt][L]),typeof I>"u"||!I.length||!I[0]){var ee="";jt=[];for(Ft in vt[kt])this.terminals_[Ft]&&Ft>We&&jt.push("'"+this.terminals_[Ft]+"'");N.showPosition?ee="Parse error on line "+(Ct+1)+`:
`+N.showPosition()+`
Expecting `+jt.join(", ")+", got '"+(this.terminals_[L]||L)+"'":ee="Parse error on line "+(Ct+1)+": Unexpected "+(L==ye?"end of input":"'"+(this.terminals_[L]||L)+"'"),this.parseError(ee,{text:N.match,token:this.terminals_[L]||L,line:N.yylineno,loc:Zt,expected:jt})}if(I[0]instanceof Array&&I.length>1)throw new Error("Parse Error: multiple actions possible at state: "+kt+", token: "+L);switch(I[0]){case 1:E.push(L),A.push(N.yytext),a.push(N.yylloc),E.push(I[1]),L=null,$t?(L=$t,$t=null):(me=N.yyleng,f=N.yytext,Ct=N.yylineno,Zt=N.yylloc,be>0&&be--);break;case 2:if(X=this.productions_[I[1]][1],Pt.$=A[A.length-X],Pt._$={first_line:a[a.length-(X||1)].first_line,last_line:a[a.length-1].last_line,first_column:a[a.length-(X||1)].first_column,last_column:a[a.length-1].last_column},qe&&(Pt._$.range=[a[a.length-(X||1)].range[0],a[a.length-1].range[1]]),te=this.performAction.apply(Pt,[f,me,Ct,Et.yy,I[1],A,a].concat(Xe)),typeof te<"u")return te;X&&(E=E.slice(0,-1*X*2),A=A.slice(0,-1*X),a=a.slice(0,-1*X)),E.push(this.productions_[I[1]][0]),A.push(Pt.$),a.push(Pt._$),ge=vt[E[E.length-2]][E[E.length-1]],E.push(ge);break;case 3:return!0}}return!0},"parse")},ze=(function(){var yt={EOF:1,parseError:d(function(_,E){if(this.yy.parser)this.yy.parser.parseError(_,E);else throw new Error(_)},"parseError"),setInput:d(function(g,_){return this.yy=_||this.yy||{},this._input=g,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:d(function(){var g=this._input[0];this.yytext+=g,this.yyleng++,this.offset++,this.match+=g,this.matched+=g;var _=g.match(/(?:\r\n?|\n).*/g);return _?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),g},"input"),unput:d(function(g){var _=g.length,E=g.split(/(?:\r\n?|\n)/g);this._input=g+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-_),this.offset-=_;var b=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),E.length-1&&(this.yylineno-=E.length-1);var A=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:E?(E.length===b.length?this.yylloc.first_column:0)+b[b.length-E.length].length-E[0].length:this.yylloc.first_column-_},this.options.ranges&&(this.yylloc.range=[A[0],A[0]+this.yyleng-_]),this.yyleng=this.yytext.length,this},"unput"),more:d(function(){return this._more=!0,this},"more"),reject:d(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:d(function(g){this.unput(this.match.slice(g))},"less"),pastInput:d(function(){var g=this.matched.substr(0,this.matched.length-this.match.length);return(g.length>20?"...":"")+g.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:d(function(){var g=this.match;return g.length<20&&(g+=this._input.substr(0,20-g.length)),(g.substr(0,20)+(g.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:d(function(){var g=this.pastInput(),_=new Array(g.length+1).join("-");return g+this.upcomingInput()+`
`+_+"^"},"showPosition"),test_match:d(function(g,_){var E,b,A;if(this.options.backtrack_lexer&&(A={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(A.yylloc.range=this.yylloc.range.slice(0))),b=g[0].match(/(?:\r\n?|\n).*/g),b&&(this.yylineno+=b.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:b?b[b.length-1].length-b[b.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+g[0].length},this.yytext+=g[0],this.match+=g[0],this.matches=g,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(g[0].length),this.matched+=g[0],E=this.performAction.call(this,this.yy,this,_,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),E)return E;if(this._backtrack){for(var a in A)this[a]=A[a];return!1}return!1},"test_match"),next:d(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var g,_,E,b;this._more||(this.yytext="",this.match="");for(var A=this._currentRules(),a=0;a<A.length;a++)if(E=this._input.match(this.rules[A[a]]),E&&(!_||E[0].length>_[0].length)){if(_=E,b=a,this.options.backtrack_lexer){if(g=this.test_match(E,A[a]),g!==!1)return g;if(this._backtrack){_=!1;continue}else return!1}else if(!this.options.flex)break}return _?(g=this.test_match(_,A[b]),g!==!1?g:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text.
`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:d(function(){var _=this.next();return _||this.lex()},"lex"),begin:d(function(_){this.conditionStack.push(_)},"begin"),popState:d(function(){var _=this.conditionStack.length-1;return _>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:d(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:d(function(_){return _=this.conditionStack.length-1-Math.abs(_||0),_>=0?this.conditionStack[_]:"INITIAL"},"topState"),pushState:d(function(_){this.begin(_)},"pushState"),stateStackSize:d(function(){return this.conditionStack.length},"stateStackSize"),options:{},performAction:d(function(_,E,b,A){var a=A;switch(b){case 0:return 6;case 1:return 7;case 2:return 8;case 3:return 9;case 4:return 22;case 5:return 23;case 6:return this.begin("acc_title"),24;break;case 7:return this.popState(),"acc_title_value";break;case 8:return this.begin("acc_descr"),26;break;case 9:return this.popState(),"acc_descr_value";break;case 10:this.begin("acc_descr_multiline");break;case 11:this.popState();break;case 12:return"acc_descr_multiline_value";case 13:break;case 14:c;break;case 15:return 12;case 16:break;case 17:return 11;case 18:return 15;case 19:return 16;case 20:return 17;case 21:return 18;case 22:return this.begin("person_ext"),45;break;case 23:return this.begin("person"),44;break;case 24:return this.begin("system_ext_queue"),51;break;case 25:return this.begin("system_ext_db"),50;break;case 26:return this.begin("system_ext"),49;break;case 27:return this.begin("system_queue"),48;break;case 28:return this.begin("system_db"),47;break;case 29:return this.begin("system"),46;break;case 30:return this.begin("boundary"),37;break;case 31:return this.begin("enterprise_boundary"),34;break;case 32:return this.begin("system_boundary"),36;break;case 33:return this.begin("container_ext_queue"),57;break;case 34:return this.begin("container_ext_db"),56;break;case 35:return this.begin("container_ext"),55;break;case 36:return this.begin("container_queue"),54;break;case 37:return this.begin("container_db"),53;break;case 38:return this.begin("container"),52;break;case 39:return this.begin("container_boundary"),38;break;case 40:return this.begin("component_ext_queue"),63;break;case 41:return this.begin("component_ext_db"),62;break;case 42:return this.begin("component_ext"),61;break;case 43:return this.begin("component_queue"),60;break;case 44:return this.begin("component_db"),59;break;case 45:return this.begin("component"),58;break;case 46:return this.begin("node"),39;break;case 47:return this.begin("node"),39;break;case 48:return this.begin("node_l"),40;break;case 49:return this.begin("node_r"),41;break;case 50:return this.begin("rel"),64;break;case 51:return this.begin("birel"),65;break;case 52:return this.begin("rel_u"),66;break;case 53:return this.begin("rel_u"),66;break;case 54:return this.begin("rel_d"),67;break;case 55:return this.begin("rel_d"),67;break;case 56:return this.begin("rel_l"),68;break;case 57:return this.begin("rel_l"),68;break;case 58:return this.begin("rel_r"),69;break;case 59:return this.begin("rel_r"),69;break;case 60:return this.begin("rel_b"),70;break;case 61:return this.begin("rel_index"),71;break;case 62:return this.begin("update_el_style"),72;break;case 63:return this.begin("update_rel_style"),73;break;case 64:return this.begin("update_layout_config"),74;break;case 65:return"EOF_IN_STRUCT";case 66:return this.begin("attribute"),"ATTRIBUTE_EMPTY";break;case 67:this.begin("attribute");break;case 68:this.popState(),this.popState();break;case 69:return 80;case 70:break;case 71:return 80;case 72:this.begin("string");break;case 73:this.popState();break;case 74:return"STR";case 75:this.begin("string_kv");break;case 76:return this.begin("string_kv_key"),"STR_KEY";break;case 77:this.popState(),this.begin("string_kv_value");break;case 78:return"STR_VALUE";case 79:this.popState(),this.popState();break;case 80:return"STR";case 81:return"LBRACE";case 82:return"RBRACE";case 83:return"SPACE";case 84:return"EOL";case 85:return 14}},"anonymous"),rules:[/^(?:.*direction\s+TB[^\n]*)/,/^(?:.*direction\s+BT[^\n]*)/,/^(?:.*direction\s+RL[^\n]*)/,/^(?:.*direction\s+LR[^\n]*)/,/^(?:title\s[^#\n;]+)/,/^(?:accDescription\s[^#\n;]+)/,/^(?:accTitle\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*\{\s*)/,/^(?:[\}])/,/^(?:[^\}]*)/,/^(?:%%(?!\{)*[^\n]*(\r?\n?)+)/,/^(?:%%[^\n]*(\r?\n)*)/,/^(?:\s*(\r?\n)+)/,/^(?:\s+)/,/^(?:C4Context\b)/,/^(?:C4Container\b)/,/^(?:C4Component\b)/,/^(?:C4Dynamic\b)/,/^(?:C4Deployment\b)/,/^(?:Person_Ext\b)/,/^(?:Person\b)/,/^(?:SystemQueue_Ext\b)/,/^(?:SystemDb_Ext\b)/,/^(?:System_Ext\b)/,/^(?:SystemQueue\b)/,/^(?:SystemDb\b)/,/^(?:System\b)/,/^(?:Boundary\b)/,/^(?:Enterprise_Boundary\b)/,/^(?:System_Boundary\b)/,/^(?:ContainerQueue_Ext\b)/,/^(?:ContainerDb_Ext\b)/,/^(?:Container_Ext\b)/,/^(?:ContainerQueue\b)/,/^(?:ContainerDb\b)/,/^(?:Container\b)/,/^(?:Container_Boundary\b)/,/^(?:ComponentQueue_Ext\b)/,/^(?:ComponentDb_Ext\b)/,/^(?:Component_Ext\b)/,/^(?:ComponentQueue\b)/,/^(?:ComponentDb\b)/,/^(?:Component\b)/,/^(?:Deployment_Node\b)/,/^(?:Node\b)/,/^(?:Node_L\b)/,/^(?:Node_R\b)/,/^(?:Rel\b)/,/^(?:BiRel\b)/,/^(?:Rel_Up\b)/,/^(?:Rel_U\b)/,/^(?:Rel_Down\b)/,/^(?:Rel_D\b)/,/^(?:Rel_Left\b)/,/^(?:Rel_L\b)/,/^(?:Rel_Right\b)/,/^(?:Rel_R\b)/,/^(?:Rel_Back\b)/,/^(?:RelIndex\b)/,/^(?:UpdateElementStyle\b)/,/^(?:UpdateRelStyle\b)/,/^(?:UpdateLayoutConfig\b)/,/^(?:$)/,/^(?:[(][ ]*[,])/,/^(?:[(])/,/^(?:[)])/,/^(?:,,)/,/^(?:,)/,/^(?:[ ]*["]["])/,/^(?:[ ]*["])/,/^(?:["])/,/^(?:[^"]*)/,/^(?:[ ]*[\$])/,/^(?:[^=]*)/,/^(?:[=][ ]*["])/,/^(?:[^"]+)/,/^(?:["])/,/^(?:[^,]+)/,/^(?:\{)/,/^(?:\})/,/^(?:[\s]+)/,/^(?:[\n\r]+)/,/^(?:$)/],conditions:{acc_descr_multiline:{rules:[11,12],inclusive:!1},acc_descr:{rules:[9],inclusive:!1},acc_title:{rules:[7],inclusive:!1},string_kv_value:{rules:[78,79],inclusive:!1},string_kv_key:{rules:[77],inclusive:!1},string_kv:{rules:[76],inclusive:!1},string:{rules:[73,74],inclusive:!1},attribute:{rules:[68,69,70,71,72,75,80],inclusive:!1},update_layout_config:{rules:[65,66,67,68],inclusive:!1},update_rel_style:{rules:[65,66,67,68],inclusive:!1},update_el_style:{rules:[65,66,67,68],inclusive:!1},rel_b:{rules:[65,66,67,68],inclusive:!1},rel_r:{rules:[65,66,67,68],inclusive:!1},rel_l:{rules:[65,66,67,68],inclusive:!1},rel_d:{rules:[65,66,67,68],inclusive:!1},rel_u:{rules:[65,66,67,68],inclusive:!1},rel_bi:{rules:[],inclusive:!1},rel:{rules:[65,66,67,68],inclusive:!1},node_r:{rules:[65,66,67,68],inclusive:!1},node_l:{rules:[65,66,67,68],inclusive:!1},node:{rules:[65,66,67,68],inclusive:!1},index:{rules:[],inclusive:!1},rel_index:{rules:[65,66,67,68],inclusive:!1},component_ext_queue:{rules:[65,66,67,68],inclusive:!1},component_ext_db:{rules:[65,66,67,68],inclusive:!1},component_ext:{rules:[65,66,67,68],inclusive:!1},component_queue:{rules:[65,66,67,68],inclusive:!1},component_db:{rules:[65,66,67,68],inclusive:!1},component:{rules:[65,66,67,68],inclusive:!1},container_boundary:{rules:[65,66,67,68],inclusive:!1},container_ext_queue:{rules:[65,66,67,68],inclusive:!1},container_ext_db:{rules:[65,66,67,68],inclusive:!1},container_ext:{rules:[65,66,67,68],inclusive:!1},container_queue:{rules:[65,66,67,68],inclusive:!1},container_db:{rules:[65,66,67,68],inclusive:!1},container:{rules:[65,66,67,68],inclusive:!1},birel:{rules:[65,66,67,68],inclusive:!1},system_boundary:{rules:[65,66,67,68],inclusive:!1},enterprise_boundary:{rules:[65,66,67,68],inclusive:!1},boundary:{rules:[65,66,67,68],inclusive:!1},system_ext_queue:{rules:[65,66,67,68],inclusive:!1},system_ext_db:{rules:[65,66,67,68],inclusive:!1},system_ext:{rules:[65,66,67,68],inclusive:!1},system_queue:{rules:[65,66,67,68],inclusive:!1},system_db:{rules:[65,66,67,68],inclusive:!1},system:{rules:[65,66,67,68],inclusive:!1},person_ext:{rules:[65,66,67,68],inclusive:!1},person:{rules:[65,66,67,68],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,8,10,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,81,82,83,84,85],inclusive:!0}}};return yt})();Qt.lexer=ze;function Kt(){this.yy={}}return d(Kt,"Parser"),Kt.prototype=Qt,Qt.Parser=Kt,new Kt})();Ot.parser=Ot;var we=Ot;var Ut=d(t=>z()[t],"getRequiredConfig");var F=new Set(["label","descr","techn","type"]),St=d((t,e)=>{for(let[s,o]of Object.entries(e))if(o!==void 0)if(typeof o=="object"){let[u,i]=Object.entries(o)[0];t[u]=F.has(u)?{text:i}:i}else t[s]=o},"assignAttributes"),ve=d(()=>({alias:"global",label:{text:"global"},type:{text:"global"},tags:null,link:null,parentBoundary:""}),"createGlobalBoundary"),Y=[],gt=[""],M="global",j="",U=[ve()],Nt=[],ie="",ae=!1,zt=4,Wt=2,Ae,He=d(function(){return Ae},"getC4Type"),Qe=d(function(t){Ae=re(t,z())},"setC4Type"),Ke=d(function(t,e,s,o,u,i,n,l,r){if(t==null||e===void 0||e===null||s===void 0||s===null||o===void 0||o===null)return;let h={},m=Nt.find(p=>p.from===e&&p.to===s);if(m?h=m:Nt.push(h),h.type=t,h.from=e,h.to=s,h.label={text:o},u==null)h.techn??={text:""};else if(typeof u=="object"){let[p,y]=Object.entries(u)[0];h[p]=F.has(p)?{text:y}:y}else h.techn={text:u};if(i==null)h.descr??={text:""};else if(typeof i=="object"){let[p,y]=Object.entries(i)[0];h[p]=F.has(p)?{text:y}:y}else h.descr={text:i};St(h,{sprite:n,tags:l,link:r}),h.wrap=xt()},"addRel"),Je=d(function(t,e,s,o,u,i,n){if(e===null||s===null)return;let l={},r=Y.find(h=>h.alias===e);if(r&&e===r.alias?l=r:(l.alias=e,Y.push(l)),s==null?l.label={text:""}:l.label={text:s},o==null)l.descr??={text:""};else if(typeof o=="object"){let[h,m]=Object.entries(o)[0];l[h]=F.has(h)?{text:m}:m}else l.descr={text:o};St(l,{sprite:u,tags:i,link:n}),l.typeC4Shape={text:t},l.parentBoundary=M,l.wrap=xt()},"addPersonOrSystem"),Ze=d(function(t,e,s,o,u,i,n,l){if(e===null||s===null)return;let r={},h=Y.find(m=>m.alias===e);if(h&&e===h.alias?r=h:(r.alias=e,Y.push(r)),s==null?r.label={text:""}:r.label={text:s},o==null)r.techn??={text:""};else if(typeof o=="object"){let[m,p]=Object.entries(o)[0];r[m]=F.has(m)?{text:p}:p}else r.techn={text:o};if(u==null)r.descr??={text:""};else if(typeof u=="object"){let[m,p]=Object.entries(u)[0];r[m]=F.has(m)?{text:p}:p}else r.descr={text:u};St(r,{sprite:i,tags:n,link:l}),r.wrap=xt(),r.typeC4Shape={text:t},r.parentBoundary=M},"addContainer"),$e=d(function(t,e,s,o,u,i,n,l){if(e===null||s===null)return;let r={},h=Y.find(m=>m.alias===e);if(h&&e===h.alias?r=h:(r.alias=e,Y.push(r)),s==null?r.label={text:""}:r.label={text:s},o==null)r.techn??={text:""};else if(typeof o=="object"){let[m,p]=Object.entries(o)[0];r[m]=F.has(m)?{text:p}:p}else r.techn={text:o};if(u==null)r.descr??={text:""};else if(typeof u=="object"){let[m,p]=Object.entries(u)[0];r[m]=F.has(m)?{text:p}:p}else r.descr={text:u};St(r,{sprite:i,tags:n,link:l}),r.wrap=xt(),r.typeC4Shape={text:t},r.parentBoundary=M},"addComponent"),t0=d(function(t,e,s,o,u){if(t===null||e===null)return;let i={},n=U.find(l=>l.alias===t);if(n&&t===n.alias?i=n:(i.alias=t,U.push(i)),e==null?i.label={text:""}:i.label={text:e},s==null)i.type={text:"system"};else if(typeof s=="object"){let[l,r]=Object.entries(s)[0];i[l]=F.has(l)?{text:r}:r}else i.type={text:s};St(i,{tags:o,link:u}),i.parentBoundary=M,i.wrap=xt(),j=M,M=t,gt.push(j)},"addPersonOrSystemBoundary"),e0=d(function(t,e,s,o,u){if(t===null||e===null)return;let i={},n=U.find(l=>l.alias===t);if(n&&t===n.alias?i=n:(i.alias=t,U.push(i)),e==null?i.label={text:""}:i.label={text:e},s==null)i.type={text:"container"};else if(typeof s=="object"){let[l,r]=Object.entries(s)[0];i[l]=F.has(l)?{text:r}:r}else i.type={text:s};St(i,{tags:o,link:u}),i.parentBoundary=M,i.wrap=xt(),j=M,M=t,gt.push(j)},"addContainerBoundary"),n0=d(function(t,e,s,o,u,i,n,l){if(e===null||s===null)return;let r={},h=U.find(m=>m.alias===e);if(h&&e===h.alias?r=h:(r.alias=e,U.push(r)),s==null?r.label={text:""}:r.label={text:s},o==null)r.type={text:"node"};else if(typeof o=="object"){let[m,p]=Object.entries(o)[0];r[m]=F.has(m)?{text:p}:p}else r.type={text:o};if(u==null)r.descr??={text:""};else if(typeof u=="object"){let[m,p]=Object.entries(u)[0];r[m]=F.has(m)?{text:p}:p}else r.descr={text:u};St(r,{tags:n,link:l}),r.nodeType=t,r.parentBoundary=M,r.wrap=xt(),j=M,M=e,gt.push(j)},"addDeploymentNode"),r0=d(function(){M=j,gt.pop(),j=gt.pop(),gt.push(j)},"popBoundaryParseStack"),s0=d(function(t,e,s,o,u,i,n,l,r,h,m){let p=Y.find(y=>y.alias===e);if(!(p===void 0&&(p=U.find(y=>y.alias===e),p===void 0))){if(s!=null)if(typeof s=="object"){let[y,C]=Object.entries(s)[0];p[y]=C}else p.bgColor=s;if(o!=null)if(typeof o=="object"){let[y,C]=Object.entries(o)[0];p[y]=C}else p.fontColor=o;if(u!=null)if(typeof u=="object"){let[y,C]=Object.entries(u)[0];p[y]=C}else p.borderColor=u;if(i!=null)if(typeof i=="object"){let[y,C]=Object.entries(i)[0];p[y]=C}else p.shadowing=i;if(n!=null)if(typeof n=="object"){let[y,C]=Object.entries(n)[0];p[y]=C}else p.shape=n;if(l!=null)if(typeof l=="object"){let[y,C]=Object.entries(l)[0];p[y]=C}else p.sprite=l;if(r!=null)if(typeof r=="object"){let[y,C]=Object.entries(r)[0];p[y]=C}else p.techn=r;if(h!=null)if(typeof h=="object"){let[y,C]=Object.entries(h)[0];p[y]=C}else p.legendText=h;if(m!=null)if(typeof m=="object"){let[y,C]=Object.entries(m)[0];p[y]=C}else p.legendSprite=m}},"updateElStyle"),i0=d(function(t,e,s,o,u,i,n){let l=Nt.find(r=>r.from===e&&r.to===s);if(l!==void 0){if(o!=null)if(typeof o=="object"){let[r,h]=Object.entries(o)[0];l[r]=h}else l.textColor=o;if(u!=null)if(typeof u=="object"){let[r,h]=Object.entries(u)[0];l[r]=h}else l.lineColor=u;if(i!=null)if(typeof i=="object"){let[r,h]=Object.entries(i)[0];l[r]=parseInt(h)}else l.offsetX=parseInt(i);if(n!=null)if(typeof n=="object"){let[r,h]=Object.entries(n)[0];l[r]=parseInt(h)}else l.offsetY=parseInt(n)}},"updateRelStyle"),a0=d(function(t,e,s){let o=zt,u=Wt;if(typeof e=="object"){let i=Object.values(e)[0];o=parseInt(i)}else o=parseInt(e);if(typeof s=="object"){let i=Object.values(s)[0];u=parseInt(i)}else u=parseInt(s);o>=1&&(zt=o),u>=1&&(Wt=u)},"updateLayoutConfig"),o0=d(function(){return zt},"getC4ShapeInRow"),l0=d(function(){return Wt},"getC4BoundaryInRow"),c0=d(function(){return M},"getCurrentBoundaryParse"),u0=d(function(){return j},"getParentBoundaryParse"),Oe=d(function(t){return t==null?Y:Y.filter(e=>e.parentBoundary===t)},"getC4ShapeArray"),d0=d(function(t){return Y.find(e=>e.alias===t)??U.find(e=>e.alias===t)},"getC4Shape"),h0=d(function(t){return Object.keys(Oe(t))},"getC4ShapeKeys"),Ne=d(function(t){return t==null?U:U.filter(e=>e.parentBoundary===t)},"getBoundaries"),p0=Ne,f0=d(function(){return Nt},"getRels"),m0=d(function(){return ie},"getTitle"),b0=d(function(t){ae=t},"setWrap"),xt=d(function(){return ae},"autoWrap"),y0=d(function(){Y=[],U=[ve()],j="",M="global",gt=[""],Nt=[],gt=[""],ie="",ae=!1,zt=4,Wt=2},"clear"),g0={SOLID:0,DOTTED:1,NOTE:2,SOLID_CROSS:3,DOTTED_CROSS:4,SOLID_OPEN:5,DOTTED_OPEN:6,LOOP_START:10,LOOP_END:11,ALT_START:12,ALT_ELSE:13,ALT_END:14,OPT_START:15,OPT_END:16,ACTIVE_START:17,ACTIVE_END:18,PAR_START:19,PAR_AND:20,PAR_END:21,RECT_START:22,RECT_END:23,SOLID_POINT:24,DOTTED_POINT:25},x0={FILLED:0,OPEN:1},_0={LEFTOF:0,RIGHTOF:1,OVER:2},C0=d(function(t){ie=re(t,z())},"setTitle"),Lt={addPersonOrSystem:Je,addPersonOrSystemBoundary:t0,addContainer:Ze,addContainerBoundary:e0,addComponent:$e,addDeploymentNode:n0,popBoundaryParseStack:r0,addRel:Ke,updateElStyle:s0,updateRelStyle:i0,updateLayoutConfig:a0,autoWrap:xt,setWrap:b0,getC4ShapeArray:Oe,getC4Shape:d0,getC4ShapeKeys:h0,getBoundaries:Ne,getBoundarys:p0,getCurrentBoundaryParse:c0,getParentBoundaryParse:u0,getRels:f0,getTitle:m0,getC4Type:He,getC4ShapeInRow:o0,getC4BoundaryInRow:l0,setAccTitle:Ce,getAccTitle:Ee,getAccDescription:Se,setAccDescription:ke,getConfig:d(()=>Ut("c4"),"getConfig"),clear:y0,LINETYPE:g0,ARROWTYPE:x0,PLACEMENT:_0,setTitle:C0,setC4Type:Qe};var Le=d(function(t,e){return Te(t,e)},"drawRect"),E0=d((t,e,s,o)=>{let u=t.append("g"),i=0;for(let n of e){let l=n.textColor?n.textColor:"#444444",r=n.lineColor?n.lineColor:"#444444",h=n.offsetX?parseInt(String(n.offsetX)):0,m=n.offsetY?parseInt(String(n.offsetY)):0,p="";if(i===0){let R=u.append("line");R.attr("x1",n.startPoint.x),R.attr("y1",n.startPoint.y),R.attr("x2",n.endPoint.x),R.attr("y2",n.endPoint.y),R.attr("stroke-width","1"),R.attr("stroke",r),R.style("fill","none"),n.type!=="rel_b"&&R.attr("marker-end","url("+p+"#"+o+"-arrowhead)"),(n.type==="birel"||n.type==="rel_b")&&R.attr("marker-start","url("+p+"#"+o+"-arrowend)"),i=-1}else{let R=u.append("path");R.attr("fill","none").attr("stroke-width","1").attr("stroke",r).attr("d","Mstartx,starty Qcontrolx,controly stopx,stopy ".replaceAll("startx",n.startPoint.x).replaceAll("starty",n.startPoint.y).replaceAll("controlx",n.startPoint.x+(n.endPoint.x-n.startPoint.x)/2-(n.endPoint.x-n.startPoint.x)/4).replaceAll("controly",n.startPoint.y+(n.endPoint.y-n.startPoint.y)/2).replaceAll("stopx",n.endPoint.x).replaceAll("stopy",n.endPoint.y)),n.type!=="rel_b"&&R.attr("marker-end","url("+p+"#"+o+"-arrowhead)"),(n.type==="birel"||n.type==="rel_b")&&R.attr("marker-start","url("+p+"#"+o+"-arrowend)")}let y=n.label.width,C=s.messageFont();Mt(s)(n.label.text,u,Math.min(n.startPoint.x,n.endPoint.x)+Math.abs(n.endPoint.x-n.startPoint.x)/2+h,Math.min(n.startPoint.y,n.endPoint.y)+Math.abs(n.endPoint.y-n.startPoint.y)/2+m,y,n.label.height,{fill:l},C),n.techn&&n.techn.text!==""&&(C=s.messageFont(),Mt(s)("["+n.techn.text+"]",u,Math.min(n.startPoint.x,n.endPoint.x)+Math.abs(n.endPoint.x-n.startPoint.x)/2+h,Math.min(n.startPoint.y,n.endPoint.y)+Math.abs(n.endPoint.y-n.startPoint.y)/2+s.messageFontSize+5+m,Math.max(y,n.techn.width),n.techn.height,{fill:l,"font-style":"italic"},C))}},"drawRels"),k0=d(function(t,e,s){let o=t.append("g"),u=e.bgColor?e.bgColor:"none",i=e.borderColor?e.borderColor:"#444444",n=e.fontColor?e.fontColor:"black",l={"stroke-width":1,"stroke-dasharray":"7.0,7.0"};e.nodeType&&(l={"stroke-width":1});let r={x:e.x,y:e.y,fill:u,stroke:i,width:e.width,height:e.height,rx:2.5,ry:2.5,attrs:l};Le(o,r);let h=s.boundaryFont();h.fontWeight="bold",h.fontSize=h.fontSize+2,h.fontColor=n,Mt(s)(e.label.text,o,e.x,e.y+e.label.Y,e.width,e.height,{fill:"#444444"},h),e.type&&e.type.text!==""&&(h=s.boundaryFont(),h.fontColor=n,Mt(s)(e.type.text,o,e.x,e.y+e.type.Y,e.width,e.height,{fill:"#444444"},h)),e.descr&&e.descr.text!==""&&(h=s.boundaryFont(),h.fontSize=h.fontSize-2,h.fontColor=n,Mt(s)(e.descr.text,o,e.x,e.y+e.descr.Y,e.width,e.height,{fill:"#444444"},h))},"drawBoundary"),S0=d(function(t,e){t.append("defs").append("symbol").attr("id",e+"-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"),T0=d(function(t,e){t.append("defs").append("symbol").attr("id",e+"-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"),D0=d(function(t,e){t.append("defs").append("symbol").attr("id",e+"-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"),P0=d(function(t,e){t.append("defs").append("marker").attr("id",e+"-arrowhead").attr("refX",9).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto").append("path").attr("d","M 0 0 L 10 5 L 0 10 z")},"insertArrowHead"),R0=d(function(t,e){t.append("defs").append("marker").attr("id",e+"-arrowend").attr("refX",1).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto").append("path").attr("d","M 10 0 L 0 5 L 10 10 z")},"insertArrowEnd"),w0=d(function(t,e){t.append("defs").append("marker").attr("id",e+"-filled-head").attr("refX",18).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"),v0=d(function(t,e){let o=t.append("defs").append("marker").attr("id",e+"-crosshead").attr("markerWidth",15).attr("markerHeight",8).attr("orient","auto").attr("refX",16).attr("refY",4);o.append("path").attr("fill","black").attr("stroke","#000000").style("stroke-dasharray","0, 0").attr("stroke-width","1px").attr("d","M 9,2 V 6 L16,4 Z"),o.append("path").attr("fill","none").attr("stroke","#000000").style("stroke-dasharray","0, 0").attr("stroke-width","1px").attr("d","M 0,1 L 6,7 M 6,1 L 0,7")},"insertArrowCrossHead"),Mt=(function(){function t(u,i,n,l,r,h,m){let p=i.append("text").attr("x",n+r/2).attr("y",l+h/2+5).style("text-anchor","middle").text(u);o(p,m)}d(t,"byText");function e(u,i,n,l,r,h,m,p){let{fontSize:y,fontFamily:C,fontWeight:R}=p,O=u.split(At.lineBreakRegex);for(let w=0;w<O.length;w++){let v=w*y-y*(O.length-1)/2,B=i.append("text").attr("x",n+r/2).attr("y",l).style("text-anchor","middle").attr("dominant-baseline","middle").style("font-size",y).style("font-weight",R).style("font-family",C);B.append("tspan").attr("dy",v).text(O[w]).attr("alignment-baseline","mathematical"),o(B,m)}}d(e,"byTspan");function s(u,i,n,l,r,h,m,p){let y=i.append("switch"),R=y.append("foreignObject").attr("x",n).attr("y",l).attr("width",r).attr("height",h).append("xhtml:div").style("display","table").style("height","100%").style("width","100%");R.append("div").style("display","table-cell").style("text-align","center").style("vertical-align","middle").text(u),e(u,y,n,l,r,h,m,p),o(R,m)}d(s,"byFo");function o(u,i){for(let n in i)i.hasOwnProperty(n)&&u.attr(n,i[n])}return d(o,"_setTextAttrs"),function(u){return u.textPlacement==="fo"?s:u.textPlacement==="old"?t:e}})(),W={drawRect:Le,drawBoundary:k0,drawRels:E0,insertArrowHead:P0,insertArrowEnd:R0,insertArrowFilledHead:w0,insertArrowCrossHead:v0,insertDatabaseIcon:S0,insertComputerIcon:T0,insertClockIcon:D0};var Me=d((t,e)=>{if(e==="sandbox"){let o=Yt("#i"+t).node()?.contentDocument;if(!o)throw new Error(`Sandbox iframe #i${t} is missing its content document`);return{root:Yt(o.body),doc:o}}return{root:Yt("body"),doc:document}},"getDiagramRoot");var A0=new Set(["system_queue","external_system_queue","container_queue","external_container_queue","component_queue","external_component_queue"]),O0=new Set(["system_db","external_system_db","container_db","external_container_db","component_db","external_component_db"]),N0={person:"person",box:"rounded",rounded:"rounded",cylinder:"cylinder",database:"cylinder",db:"cylinder",queue:"h-cyl",pipe:"h-cyl",component:"fr-rect"},oe=d(t=>t?N0[t.toLowerCase()]:void 0,"keywordShape"),L0=d(t=>{let e=oe(t.shape)??oe(t.sprite);if(e)return e;if(t.tags)for(let o of t.tags.split(",")){let u=oe(o.trim());if(u)return u}let s=t.typeC4Shape.text;return s==="person"||s==="external_person"?"person":O0.has(s)?"cylinder":A0.has(s)?"h-cyl":"rounded"},"resolveNodeShape"),M0={person:"Person",system:"Software System",container:"Container",component:"Component"},B0=d(t=>{let e=t.replace(/^external_/,"").replace(/_(db|queue)$/,"");return M0[e]??e.replace(/_/g," ")},"stereotypeLabel"),V0=d(t=>t.startsWith("external_"),"isExternal"),I0=d(t=>{let e=B0(t.typeC4Shape.text);return t.techn?.text?`[${e}: ${t.techn.text}]`:`[${e}]`},"stereotypeText"),le=["person","system","system_db","system_queue","container","container_db","container_queue","component","component_db","component_queue"].flatMap(t=>[t,`external_${t}`]),F0=new Set(le),Be=d(t=>F0.has(t),"isC4ElementType"),j0=d((t,e)=>{let s=t.typeC4Shape.text,o=t.bgColor??(Be(s)&&e[`${s}_bg_color`]),u=t.borderColor??(Be(s)&&e[`${s}_border_color`]),i=[];return o&&i.push(`fill:${o}`),u&&i.push(`stroke:${u}`),i.push(`color:${t.fontColor??"#FFFFFF"}`),i},"elementCssStyles"),ce=d((t,e,s,o,u)=>{let i=t.typeC4Shape.text,n=["c4-shape",`c4-${i}`];V0(i)&&n.push("c4-external");let l=L0(t),r=j0(t,e);return(l==="rounded"||l==="fr-rect")&&r.push("rx:12px","ry:12px"),{id:t.alias,label:t.label.text,stereotype:I0(t),description:t.descr?.text?[t.descr.text]:void 0,labelType:"string",isGroup:!1,shape:l,cssClasses:n.join(" "),cssStyles:r,padding:s,look:o,useHtmlLabels:!1,width:u}},"buildC4Node");var Bt=0,Vt=0,Ie=4,ue=2;Ot.yy=Lt;var x={},qt=class{static{d(this,"Bounds")}constructor(e){this.name="",this.data={},this.data.startx=void 0,this.data.stopx=void 0,this.data.starty=void 0,this.data.stopy=void 0,this.data.widthLimit=void 0,this.nextData={},this.nextData.startx=void 0,this.nextData.stopx=void 0,this.nextData.starty=void 0,this.nextData.stopy=void 0,this.nextData.cnt=0,de(e.db.getConfig())}setData(e,s,o,u){this.nextData.startx=this.data.startx=e,this.nextData.stopx=this.data.stopx=s,this.nextData.starty=this.data.starty=o,this.nextData.stopy=this.data.stopy=u}updateVal(e,s,o,u){e[s]===void 0?e[s]=o:e[s]=u(o,e[s])}insert(e){this.nextData.cnt=this.nextData.cnt+1;let s=this.nextData.stopx,o=this.data.widthLimit,u=this.nextData.startx===this.nextData.stopx?s+e.margin:s+e.margin*2,i=u+e.width,n=this.nextData.starty+e.margin*2,l=n+e.height;(u>=o||i>=o||this.nextData.cnt>Ie)&&(u=this.nextData.startx+e.margin+x.nextLinePaddingX,n=this.nextData.stopy+e.margin*2,this.nextData.stopx=i=u+e.width,this.nextData.starty=this.nextData.stopy,this.nextData.stopy=l=n+e.height,this.nextData.cnt=1),e.x=u,e.y=n,this.updateVal(this.data,"startx",u,Math.min),this.updateVal(this.data,"starty",n,Math.min),this.updateVal(this.data,"stopx",i,Math.max),this.updateVal(this.data,"stopy",l,Math.max),this.updateVal(this.nextData,"startx",u,Math.min),this.updateVal(this.nextData,"starty",n,Math.min),this.updateVal(this.nextData,"stopx",i,Math.max),this.updateVal(this.nextData,"stopy",l,Math.max)}init(e){this.name="",this.data={startx:void 0,stopx:void 0,starty:void 0,stopy:void 0,widthLimit:void 0},this.nextData={startx:void 0,stopx:void 0,starty:void 0,stopy:void 0,cnt:0},de(e.db.getConfig())}bumpLastMargin(e){this.data.stopx+=e,this.data.stopy+=e}},de=d(function(t){xe(x,t),t?.fontFamily&&(x.personFontFamily=x.systemFontFamily=x.messageFontFamily=t.fontFamily),t?.fontSize&&(x.personFontSize=x.systemFontSize=x.messageFontSize=t.fontSize),t?.fontWeight&&(x.personFontWeight=x.systemFontWeight=x.messageFontWeight=t.fontWeight)},"setConf"),Xt=d(t=>({fontFamily:t.boundaryFontFamily,fontSize:t.boundaryFontSize,fontWeight:t.boundaryFontWeight}),"boundaryFont"),Y0=d(t=>({fontFamily:t.messageFontFamily,fontSize:t.messageFontSize,fontWeight:t.messageFontWeight}),"messageFont");function Tt(t,e,s,o,u){let i=e[t];if(!i.width)if(s)i.text=De(i.text,u,o),i.textLines=i.text.split(At.lineBreakRegex).length,i.width=u,i.height=se(i.text,o);else{let n=i.text.split(At.lineBreakRegex);i.textLines=n.length;let l=0;i.height=0,i.width=0;for(let r of n)i.width=Math.max(Rt(r,o),i.width),l=se(r,o),i.height=i.height+l}return i}d(Tt,"calcC4ShapeTextWH");var Fe=d(function(t,e,s){let o=s.data.startx,u=s.data.starty;e.x=o,e.y=u,e.width=s.data.stopx-o,e.height=s.data.stopy-u,e.intersect=r=>Pe.rect({x:e.x+e.width/2,y:e.y+e.height/2,width:e.width,height:e.height},r),e.label.y=x.c4ShapeMargin-35;let i=e.wrap&&x.wrap,n=Xt(x);n.fontSize=n.fontSize+2,n.fontWeight="bold";let l=Rt(e.label.text,n);Tt("label",e,i,n,l),W.drawBoundary(t,e,x)},"drawBoundary"),je=d(async function(t,e,s,o){let u=z(),i=u.look??"classic",n={config:u},l=e.attr("id")??"",r=o.map(m=>s[Number(m)]),h=d(m=>{let p=m.shape?Re[m.shape]:void 0;if(!p)throw new Error(`C4: no shape handler for "${m.shape}"`);return p},"shapeHandlerFor");await Promise.all(r.map(async m=>{let p=ce(m,x,x.c4ShapePadding,i,x.width);p.domId=`${l}-${p.id}`;let y=await h(p)(e,p,n);m.width=p.width??x.width,m.height=p.height??x.height,m.margin=x.c4ShapeMargin,y.remove()}));for(let m of r)t.insert(m);await Promise.all(r.map(async m=>{let p=ce(m,x,x.c4ShapePadding,i,x.width);p.domId=`${l}-${p.id}`,p.x=m.x+m.width/2,p.y=m.y+m.height/2;let y=e.append("g").attr("transform",`translate(${m.x+m.width/2}, ${m.y+m.height/2})`);await h(p)(y,p,n),m.intersect=p.intersect})),t.bumpLastMargin(x.c4ShapeMargin)},"drawC4ShapeArray"),he=class{static{d(this,"Point")}constructor(e,s){this.x=e,this.y=s}},Ve=d(function(t,e){if(!t.intersect)throw new Error(`C4 element "${t.alias}" has no intersect function. Please report this to https://github.com/mermaid-js/mermaid/issues`);let{x:s,y:o}=t.intersect(e);return new he(s,o)},"getIntersectPoint"),U0=d(function(t,e){let s={x:0,y:0};s.x=e.x+e.width/2,s.y=e.y+e.height/2;let o=Ve(t,s);s.x=t.x+t.width/2,s.y=t.y+t.height/2;let u=Ve(e,s);return{startPoint:o,endPoint:u}},"getIntersectPoints"),z0=d(function(t,e,s,o,u){let i=o.db.getC4Type(),n=0;for(let l of e){n=n+1;let r=l.wrap&&x.wrap,h=Y0(x);i==="C4Dynamic"&&(l.label.text=n+": "+l.label.text);let m=Rt(l.label.text,h);Tt("label",l,r,h,m),l.techn&&l.techn.text!==""&&(m=Rt(l.techn.text,h),Tt("techn",l,r,h,m)),l.descr&&l.descr.text!==""&&(m=Rt(l.descr.text,h),Tt("descr",l,r,h,m));let p=s(l.from),y=s(l.to);if(!p||!y)throw new Error(`C4 rel "${l.from}" -> "${l.to}" references an unknown shape or boundary`);let C=U0(p,y);if(!C.startPoint||!C.endPoint)throw new Error(`Could not calculate intersection points for rel "${l.from}" -> "${l.to}"`);l.startPoint=C.startPoint,l.endPoint=C.endPoint}W.drawRels(t,e,x,u)},"drawRels");async function Ye(t,e,s,o,u){let i=u.db,n=new qt(u);n.data.widthLimit=s.data.widthLimit/Math.min(ue,o.length);for(let[l,r]of o.entries()){let h=0;r.image={width:0,height:0,Y:0},r.sprite&&(r.image.width=48,r.image.height=48,r.image.Y=h,h=r.image.Y+r.image.height);let m=r.wrap&&x.wrap,p=Xt(x);p.fontSize=p.fontSize+2,p.fontWeight="bold";let y=Tt("label",r,m,p,n.data.widthLimit);if(y.Y=h+8,h=y.Y+y.height,r.type&&r.type.text!==""){r.type.text="["+r.type.text+"]";let w=Xt(x),v=Tt("type",r,m,w,n.data.widthLimit);v.Y=h+5,h=v.Y+v.height}if(r.descr&&r.descr.text!==""){let w=Xt(x);w.fontSize=w.fontSize-2;let v=Tt("descr",r,m,w,n.data.widthLimit);v.Y=h+20,h=v.Y+v.height}if(l==0||l%ue===0){let w=s.data.startx+x.diagramMarginX,v=s.data.stopy+x.diagramMarginY+h;n.setData(w,w,v,v)}else{let w=n.data.stopx!==n.data.startx?n.data.stopx+x.diagramMarginX:n.data.startx,v=n.data.starty;n.setData(w,w,v,v)}n.name=r.alias;let C=i.getC4ShapeArray(r.alias),R=i.getC4ShapeKeys(r.alias);R.length>0&&await je(n,t,C,R),e=r.alias;let O=i.getBoundaries(e);O.length>0&&await Ye(t,e,n,O,u),r.alias!=="global"&&Fe(t,r,n),s.data.stopy=Math.max(n.data.stopy+x.c4ShapeMargin,s.data.stopy),s.data.stopx=Math.max(n.data.stopx+x.c4ShapeMargin,s.data.stopx),Bt=Math.max(Bt,s.data.stopx),Vt=Math.max(Vt,s.data.stopy)}}d(Ye,"drawInsideBoundary");var W0=d(async function(t,e,s,o){x=Ut("c4");let u=z().securityLevel,{root:i}=Me(e,u),n=o.db;n.setWrap(x.wrap),Ie=n.getC4ShapeInRow(),ue=n.getC4BoundaryInRow(),ne.debug(`C:${JSON.stringify(x,null,2)}`);let l=i.select(`[id="${e}"]`);W.insertComputerIcon(l,e),W.insertDatabaseIcon(l,e),W.insertClockIcon(l,e);let r=new qt(o);r.setData(x.diagramMarginX,x.diagramMarginX,x.diagramMarginY,x.diagramMarginY),r.data.widthLimit=screen.availWidth,Bt=x.diagramMarginX,Vt=x.diagramMarginY;let h=n.getTitle(),m=n.getBoundaries("");await Ye(l,"",r,m,o),W.insertArrowHead(l,e),W.insertArrowEnd(l,e),W.insertArrowCrossHead(l,e),W.insertArrowFilledHead(l,e),z0(l,n.getRels(),n.getC4Shape,o,e),r.data.stopx=Bt,r.data.stopy=Vt;let p=r.data,y=p.startx,C=p.starty,O=Vt-C+2*x.diagramMarginY,w=Bt-y,v=w+2*x.diagramMarginX;h&&l.append("text").text(h).attr("x",w/2-4*x.diagramMarginX).attr("y",C+x.diagramMarginY),_e(l,O,v,x.useMaxWidth);let B=h?60:0;l.attr("viewBox",y-x.diagramMarginX+" -"+(x.diagramMarginY+B)+" "+v+" "+(O+B)),ne.debug("models:",p)},"draw"),pe={drawPersonOrSystemArray:je,drawBoundary:Fe,setConf:de,draw:W0};var X0=d(()=>{let t=z().c4??{},e=new CSSStyleSheet;for(let s of le){let o=e.cssRules[e.insertRule(`.c4-shape.c4-${s} .label {}`,e.cssRules.length)],u=t[`${s}FontFamily`],i=t[`${s}FontSize`],n=t[`${s}FontWeight`];u&&o.style.setProperty("font-family",u),i&&o.style.setProperty("font-size",typeof i=="number"?`${i}px`:i),n&&o.style.setProperty("font-weight",String(n))}return[...e.cssRules].filter(s=>s.style.length>0).map(s=>` ${s.cssText}`).join(`
`)},"elementFontStyles"),q0=d(t=>`.person {
stroke: ${t.personBorder};
fill: ${t.personBkg};
}
${X0()}
/* The element font colour is set inline per element (default white); the
label text takes it via currentColor. */
.c4-shape .label,
.c4-shape .label text {
color: inherit;
fill: currentColor;
}
/* Structurizr typography: bold name, smaller stereotype/type and description lines. */
.c4-shape .label .c4-name {
font-weight: bold;
}
.c4-shape .label .c4-type {
font-size: 0.75em;
}
.c4-shape .label .c4-descr {
font-size: 0.82em;
}
.c4-shape .basic,
.c4-shape rect,
.c4-shape path,
.c4-shape circle,
.c4-shape ellipse,
.c4-shape line {
stroke-width: 2px;
}
`,"getStyles"),Ue=q0;var jn={parser:we,db:Lt,renderer:pe,styles:Ue,init:d(({c4:t,wrap:e})=>{pe.setConf(t),Lt.setWrap(e)},"init")};export{jn as diagram};