UNPKG

code-server

Version:

Run VS Code on a remote server.

86 lines (74 loc) • 27.2 kB
import{a as je}from"./chunk-4JVZL74Y.js";import{a as We}from"./chunk-GEXIQSUR.js";import{b as Ue,c as Ze}from"./chunk-FEQH2MWK.js";import"./chunk-CL2PNEZF.js";import"./chunk-MI7L3JDQ.js";import"./chunk-EWILYK3H.js";import"./chunk-IR42YTGA.js";import"./chunk-MX6DGWIA.js";import"./chunk-JDBNYPCC.js";import"./chunk-623C5XAY.js";import{p as Ge,s as Ke}from"./chunk-PKRYIESI.js";import"./chunk-JBQZ5UCE.js";import{T as we,U as Ve,V as Me,W as Be,X as Fe,Y as Ye,Z as Pe,_ as j,a as De,b as Le}from"./chunk-VBOJ6TJX.js";import{b as l,c as ve,d as D,j as ze}from"./chunk-XDY7PRES.js";import"./chunk-OOJM4CTU.js";var ye=(function(){var t=l(function(C,a,o,c){for(o=o||{},c=C.length;c--;o[C[c]]=a);return o},"o"),i=[6,8,10,22,24,26,28,33,34,35,36,37,40,43,44,48,50,51,52],h=[1,10],n=[1,11],u=[1,12],d=[1,13],f=[1,23],p=[1,24],m=[1,25],W=[1,26],Q=[1,27],S=[1,19],X=[1,28],M=[1,29],L=[1,20],I=[1,18],T=[1,21],R=[1,22],ae=[1,36],ne=[1,37],oe=[1,38],ce=[1,39],le=[1,40],B=[6,8,10,13,15,17,20,21,22,24,26,28,33,34,35,36,37,40,43,44,48,50,51,52,65,66,67,68,69],O=[1,45],N=[1,46],F=[1,55],Y=[40,48,50,51,52,70,71],P=[1,66],z=[1,64],A=[1,61],G=[1,65],K=[1,67],H=[6,8,10,13,17,22,24,26,28,33,34,35,36,37,40,41,42,43,44,48,49,50,51,52,65,66,67,68,69],_e=[65,66,67,68,69],ge=[1,84],me=[1,83],Ee=[1,81],Se=[1,82],Te=[6,10,42,47],w=[6,10,13,41,42,47,48,49],q=[1,92],J=[1,91],$=[1,90],U=[19,58],Oe=[1,101],Ne=[1,100],he=[19,58,60,62],ue={trace:l(function(){},"trace"),yy:{},symbols_:{error:2,start:3,ER_DIAGRAM:4,document:5,EOF:6,line:7,SPACE:8,statement:9,NEWLINE:10,entityName:11,relSpec:12,COLON:13,role:14,STYLE_SEPARATOR:15,idList:16,BLOCK_START:17,attributes:18,BLOCK_STOP:19,SQS:20,SQE:21,title:22,title_value:23,acc_title:24,acc_title_value:25,acc_descr:26,acc_descr_value:27,acc_descr_multiline_value:28,direction:29,classDefStatement:30,classStatement:31,styleStatement:32,direction_tb:33,direction_bt:34,direction_rl:35,direction_lr:36,CLASSDEF:37,stylesOpt:38,separator:39,UNICODE_TEXT:40,STYLE_TEXT:41,COMMA:42,CLASS:43,STYLE:44,style:45,styleComponent:46,SEMI:47,NUM:48,BRKT:49,ENTITY_NAME:50,DECIMAL_NUM:51,ENTITY_ONE:52,attribute:53,attributeType:54,attributeName:55,attributeKeyTypeList:56,attributeComment:57,ATTRIBUTE_WORD:58,attributeKeyType:59,",":60,ATTRIBUTE_KEY:61,COMMENT:62,cardinality:63,relType:64,ZERO_OR_ONE:65,ZERO_OR_MORE:66,ONE_OR_MORE:67,ONLY_ONE:68,MD_PARENT:69,NON_IDENTIFYING:70,IDENTIFYING:71,WORD:72,$accept:0,$end:1},terminals_:{2:"error",4:"ER_DIAGRAM",6:"EOF",8:"SPACE",10:"NEWLINE",13:"COLON",15:"STYLE_SEPARATOR",17:"BLOCK_START",19:"BLOCK_STOP",20:"SQS",21:"SQE",22:"title",23:"title_value",24:"acc_title",25:"acc_title_value",26:"acc_descr",27:"acc_descr_value",28:"acc_descr_multiline_value",33:"direction_tb",34:"direction_bt",35:"direction_rl",36:"direction_lr",37:"CLASSDEF",40:"UNICODE_TEXT",41:"STYLE_TEXT",42:"COMMA",43:"CLASS",44:"STYLE",47:"SEMI",48:"NUM",49:"BRKT",50:"ENTITY_NAME",51:"DECIMAL_NUM",52:"ENTITY_ONE",58:"ATTRIBUTE_WORD",60:",",61:"ATTRIBUTE_KEY",62:"COMMENT",65:"ZERO_OR_ONE",66:"ZERO_OR_MORE",67:"ONE_OR_MORE",68:"ONLY_ONE",69:"MD_PARENT",70:"NON_IDENTIFYING",71:"IDENTIFYING",72:"WORD"},productions_:[0,[3,3],[5,0],[5,2],[7,2],[7,1],[7,1],[7,1],[9,5],[9,9],[9,7],[9,7],[9,4],[9,6],[9,3],[9,5],[9,1],[9,3],[9,7],[9,9],[9,6],[9,8],[9,4],[9,6],[9,2],[9,2],[9,2],[9,1],[9,1],[9,1],[9,1],[9,1],[29,1],[29,1],[29,1],[29,1],[30,4],[16,1],[16,1],[16,3],[16,3],[31,3],[32,4],[38,1],[38,3],[45,1],[45,2],[39,1],[39,1],[39,1],[46,1],[46,1],[46,1],[46,1],[11,1],[11,1],[11,1],[11,1],[11,1],[18,1],[18,2],[53,2],[53,3],[53,3],[53,4],[54,1],[55,1],[56,1],[56,3],[59,1],[57,1],[12,3],[63,1],[63,1],[63,1],[63,1],[63,1],[64,1],[64,1],[14,1],[14,1],[14,1]],performAction:l(function(a,o,c,r,b,e,Z){var s=e.length-1;switch(b){case 1:break;case 2:this.$=[];break;case 3:e[s-1].push(e[s]),this.$=e[s-1];break;case 4:case 5:this.$=e[s];break;case 6:case 7:this.$=[];break;case 8:r.addEntity(e[s-4]),r.addEntity(e[s-2]),r.addRelationship(e[s-4],e[s],e[s-2],e[s-3]);break;case 9:r.addEntity(e[s-8]),r.addEntity(e[s-4]),r.addRelationship(e[s-8],e[s],e[s-4],e[s-5]),r.setClass([e[s-8]],e[s-6]),r.setClass([e[s-4]],e[s-2]);break;case 10:r.addEntity(e[s-6]),r.addEntity(e[s-2]),r.addRelationship(e[s-6],e[s],e[s-2],e[s-3]),r.setClass([e[s-6]],e[s-4]);break;case 11:r.addEntity(e[s-6]),r.addEntity(e[s-4]),r.addRelationship(e[s-6],e[s],e[s-4],e[s-5]),r.setClass([e[s-4]],e[s-2]);break;case 12:r.addEntity(e[s-3]),r.addAttributes(e[s-3],e[s-1]);break;case 13:r.addEntity(e[s-5]),r.addAttributes(e[s-5],e[s-1]),r.setClass([e[s-5]],e[s-3]);break;case 14:r.addEntity(e[s-2]);break;case 15:r.addEntity(e[s-4]),r.setClass([e[s-4]],e[s-2]);break;case 16:r.addEntity(e[s]);break;case 17:r.addEntity(e[s-2]),r.setClass([e[s-2]],e[s]);break;case 18:r.addEntity(e[s-6],e[s-4]),r.addAttributes(e[s-6],e[s-1]);break;case 19:r.addEntity(e[s-8],e[s-6]),r.addAttributes(e[s-8],e[s-1]),r.setClass([e[s-8]],e[s-3]);break;case 20:r.addEntity(e[s-5],e[s-3]);break;case 21:r.addEntity(e[s-7],e[s-5]),r.setClass([e[s-7]],e[s-2]);break;case 22:r.addEntity(e[s-3],e[s-1]);break;case 23:r.addEntity(e[s-5],e[s-3]),r.setClass([e[s-5]],e[s]);break;case 24:case 25:this.$=e[s].trim(),r.setAccTitle(this.$);break;case 26:case 27:this.$=e[s].trim(),r.setAccDescription(this.$);break;case 32:r.setDirection("TB");break;case 33:r.setDirection("BT");break;case 34:r.setDirection("RL");break;case 35:r.setDirection("LR");break;case 36:this.$=e[s-3],r.addClass(e[s-2],e[s-1]);break;case 37:case 38:case 59:case 67:this.$=[e[s]];break;case 39:case 40:this.$=e[s-2].concat([e[s]]);break;case 41:this.$=e[s-2],r.setClass(e[s-1],e[s]);break;case 42:this.$=e[s-3],r.addCssStyles(e[s-2],e[s-1]);break;case 43:this.$=[e[s]];break;case 44:e[s-2].push(e[s]),this.$=e[s-2];break;case 46:this.$=e[s-1]+e[s];break;case 54:case 79:case 80:this.$=e[s].replace(/"/g,"");break;case 55:case 56:case 57:case 58:case 81:this.$=e[s];break;case 60:e[s].push(e[s-1]),this.$=e[s];break;case 61:this.$={type:e[s-1],name:e[s]};break;case 62:this.$={type:e[s-2],name:e[s-1],keys:e[s]};break;case 63:this.$={type:e[s-2],name:e[s-1],comment:e[s]};break;case 64:this.$={type:e[s-3],name:e[s-2],keys:e[s-1],comment:e[s]};break;case 65:case 66:case 69:this.$=e[s];break;case 68:e[s-2].push(e[s]),this.$=e[s-2];break;case 70:this.$=e[s].replace(/"/g,"");break;case 71:this.$={cardA:e[s],relType:e[s-1],cardB:e[s-2]};break;case 72:this.$=r.Cardinality.ZERO_OR_ONE;break;case 73:this.$=r.Cardinality.ZERO_OR_MORE;break;case 74:this.$=r.Cardinality.ONE_OR_MORE;break;case 75:this.$=r.Cardinality.ONLY_ONE;break;case 76:this.$=r.Cardinality.MD_PARENT;break;case 77:this.$=r.Identification.NON_IDENTIFYING;break;case 78:this.$=r.Identification.IDENTIFYING;break}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},t(i,[2,2],{5:3}),{6:[1,4],7:5,8:[1,6],9:7,10:[1,8],11:9,22:h,24:n,26:u,28:d,29:14,30:15,31:16,32:17,33:f,34:p,35:m,36:W,37:Q,40:S,43:X,44:M,48:L,50:I,51:T,52:R},t(i,[2,7],{1:[2,1]}),t(i,[2,3]),{9:30,11:9,22:h,24:n,26:u,28:d,29:14,30:15,31:16,32:17,33:f,34:p,35:m,36:W,37:Q,40:S,43:X,44:M,48:L,50:I,51:T,52:R},t(i,[2,5]),t(i,[2,6]),t(i,[2,16],{12:31,63:35,15:[1,32],17:[1,33],20:[1,34],65:ae,66:ne,67:oe,68:ce,69:le}),{23:[1,41]},{25:[1,42]},{27:[1,43]},t(i,[2,27]),t(i,[2,28]),t(i,[2,29]),t(i,[2,30]),t(i,[2,31]),t(B,[2,54]),t(B,[2,55]),t(B,[2,56]),t(B,[2,57]),t(B,[2,58]),t(i,[2,32]),t(i,[2,33]),t(i,[2,34]),t(i,[2,35]),{16:44,40:O,41:N},{16:47,40:O,41:N},{16:48,40:O,41:N},t(i,[2,4]),{11:49,40:S,48:L,50:I,51:T,52:R},{16:50,40:O,41:N},{18:51,19:[1,52],53:53,54:54,58:F},{11:56,40:S,48:L,50:I,51:T,52:R},{64:57,70:[1,58],71:[1,59]},t(Y,[2,72]),t(Y,[2,73]),t(Y,[2,74]),t(Y,[2,75]),t(Y,[2,76]),t(i,[2,24]),t(i,[2,25]),t(i,[2,26]),{13:P,38:60,41:z,42:A,45:62,46:63,48:G,49:K},t(H,[2,37]),t(H,[2,38]),{16:68,40:O,41:N,42:A},{13:P,38:69,41:z,42:A,45:62,46:63,48:G,49:K},{13:[1,70],15:[1,71]},t(i,[2,17],{63:35,12:72,17:[1,73],42:A,65:ae,66:ne,67:oe,68:ce,69:le}),{19:[1,74]},t(i,[2,14]),{18:75,19:[2,59],53:53,54:54,58:F},{55:76,58:[1,77]},{58:[2,65]},{21:[1,78]},{63:79,65:ae,66:ne,67:oe,68:ce,69:le},t(_e,[2,77]),t(_e,[2,78]),{6:ge,10:me,39:80,42:Ee,47:Se},{40:[1,85],41:[1,86]},t(Te,[2,43],{46:87,13:P,41:z,48:G,49:K}),t(w,[2,45]),t(w,[2,50]),t(w,[2,51]),t(w,[2,52]),t(w,[2,53]),t(i,[2,41],{42:A}),{6:ge,10:me,39:88,42:Ee,47:Se},{14:89,40:q,50:J,72:$},{16:93,40:O,41:N},{11:94,40:S,48:L,50:I,51:T,52:R},{18:95,19:[1,96],53:53,54:54,58:F},t(i,[2,12]),{19:[2,60]},t(U,[2,61],{56:97,57:98,59:99,61:Oe,62:Ne}),t([19,58,61,62],[2,66]),t(i,[2,22],{15:[1,103],17:[1,102]}),t([40,48,50,51,52],[2,71]),t(i,[2,36]),{13:P,41:z,45:104,46:63,48:G,49:K},t(i,[2,47]),t(i,[2,48]),t(i,[2,49]),t(H,[2,39]),t(H,[2,40]),t(w,[2,46]),t(i,[2,42]),t(i,[2,8]),t(i,[2,79]),t(i,[2,80]),t(i,[2,81]),{13:[1,105],42:A},{13:[1,107],15:[1,106]},{19:[1,108]},t(i,[2,15]),t(U,[2,62],{57:109,60:[1,110],62:Ne}),t(U,[2,63]),t(he,[2,67]),t(U,[2,70]),t(he,[2,69]),{18:111,19:[1,112],53:53,54:54,58:F},{16:113,40:O,41:N},t(Te,[2,44],{46:87,13:P,41:z,48:G,49:K}),{14:114,40:q,50:J,72:$},{16:115,40:O,41:N},{14:116,40:q,50:J,72:$},t(i,[2,13]),t(U,[2,64]),{59:117,61:Oe},{19:[1,118]},t(i,[2,20]),t(i,[2,23],{17:[1,119],42:A}),t(i,[2,11]),{13:[1,120],42:A},t(i,[2,10]),t(he,[2,68]),t(i,[2,18]),{18:121,19:[1,122],53:53,54:54,58:F},{14:123,40:q,50:J,72:$},{19:[1,124]},t(i,[2,21]),t(i,[2,9]),t(i,[2,19])],defaultActions:{55:[2,65],75:[2,60]},parseError:l(function(a,o){if(o.recoverable)this.trace(a);else{var c=new Error(a);throw c.hash=o,c}},"parseError"),parse:l(function(a){var o=this,c=[0],r=[],b=[null],e=[],Z=this.table,s="",te=0,Ae=0,Ce=0,qe=2,Ie=1,Je=e.slice.call(arguments,1),k=Object.create(this.lexer),x={yy:{}};for(var de in this.yy)Object.prototype.hasOwnProperty.call(this.yy,de)&&(x.yy[de]=this.yy[de]);k.setInput(a,x.yy),x.yy.lexer=k,x.yy.parser=this,typeof k.yylloc>"u"&&(k.yylloc={});var be=k.yylloc;e.push(be);var $e=k.options&&k.options.ranges;typeof x.yy.parseError=="function"?this.parseError=x.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function et(_){c.length=c.length-2*_,b.length=b.length-_,e.length=e.length-_}l(et,"popStack");function Re(){var _;return _=r.pop()||k.lex()||Ie,typeof _!="number"&&(_ instanceof Array&&(r=_,_=r.pop()),_=o.symbols_[_]||_),_}l(Re,"lex");for(var y,pe,v,g,ot,fe,V={},se,E,xe,ie;;){if(v=c[c.length-1],this.defaultActions[v]?g=this.defaultActions[v]:((y===null||typeof y>"u")&&(y=Re()),g=Z[v]&&Z[v][y]),typeof g>"u"||!g.length||!g[0]){var ke="";ie=[];for(se in Z[v])this.terminals_[se]&&se>qe&&ie.push("'"+this.terminals_[se]+"'");k.showPosition?ke="Parse error on line "+(te+1)+`: `+k.showPosition()+` Expecting `+ie.join(", ")+", got '"+(this.terminals_[y]||y)+"'":ke="Parse error on line "+(te+1)+": Unexpected "+(y==Ie?"end of input":"'"+(this.terminals_[y]||y)+"'"),this.parseError(ke,{text:k.match,token:this.terminals_[y]||y,line:k.yylineno,loc:be,expected:ie})}if(g[0]instanceof Array&&g.length>1)throw new Error("Parse Error: multiple actions possible at state: "+v+", token: "+y);switch(g[0]){case 1:c.push(y),b.push(k.yytext),e.push(k.yylloc),c.push(g[1]),y=null,pe?(y=pe,pe=null):(Ae=k.yyleng,s=k.yytext,te=k.yylineno,be=k.yylloc,Ce>0&&Ce--);break;case 2:if(E=this.productions_[g[1]][1],V.$=b[b.length-E],V._$={first_line:e[e.length-(E||1)].first_line,last_line:e[e.length-1].last_line,first_column:e[e.length-(E||1)].first_column,last_column:e[e.length-1].last_column},$e&&(V._$.range=[e[e.length-(E||1)].range[0],e[e.length-1].range[1]]),fe=this.performAction.apply(V,[s,Ae,te,x.yy,g[1],b,e].concat(Je)),typeof fe<"u")return fe;E&&(c=c.slice(0,-1*E*2),b=b.slice(0,-1*E),e=e.slice(0,-1*E)),c.push(this.productions_[g[1]][0]),b.push(V.$),e.push(V._$),xe=Z[c[c.length-2]][c[c.length-1]],c.push(xe);break;case 3:return!0}}return!0},"parse")},He=(function(){var C={EOF:1,parseError:l(function(o,c){if(this.yy.parser)this.yy.parser.parseError(o,c);else throw new Error(o)},"parseError"),setInput:l(function(a,o){return this.yy=o||this.yy||{},this._input=a,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 a=this._input[0];this.yytext+=a,this.yyleng++,this.offset++,this.match+=a,this.matched+=a;var o=a.match(/(?:\r\n?|\n).*/g);return o?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),a},"input"),unput:l(function(a){var o=a.length,c=a.split(/(?:\r\n?|\n)/g);this._input=a+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-o),this.offset-=o;var r=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),c.length-1&&(this.yylineno-=c.length-1);var b=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:c?(c.length===r.length?this.yylloc.first_column:0)+r[r.length-c.length].length-c[0].length:this.yylloc.first_column-o},this.options.ranges&&(this.yylloc.range=[b[0],b[0]+this.yyleng-o]),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). `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:l(function(a){this.unput(this.match.slice(a))},"less"),pastInput:l(function(){var a=this.matched.substr(0,this.matched.length-this.match.length);return(a.length>20?"...":"")+a.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:l(function(){var a=this.match;return a.length<20&&(a+=this._input.substr(0,20-a.length)),(a.substr(0,20)+(a.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:l(function(){var a=this.pastInput(),o=new Array(a.length+1).join("-");return a+this.upcomingInput()+` `+o+"^"},"showPosition"),test_match:l(function(a,o){var c,r,b;if(this.options.backtrack_lexer&&(b={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(b.yylloc.range=this.yylloc.range.slice(0))),r=a[0].match(/(?:\r\n?|\n).*/g),r&&(this.yylineno+=r.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:r?r[r.length-1].length-r[r.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+a[0].length},this.yytext+=a[0],this.match+=a[0],this.matches=a,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(a[0].length),this.matched+=a[0],c=this.performAction.call(this,this.yy,this,o,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),c)return c;if(this._backtrack){for(var e in b)this[e]=b[e];return!1}return!1},"test_match"),next:l(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var a,o,c,r;this._more||(this.yytext="",this.match="");for(var b=this._currentRules(),e=0;e<b.length;e++)if(c=this._input.match(this.rules[b[e]]),c&&(!o||c[0].length>o[0].length)){if(o=c,r=e,this.options.backtrack_lexer){if(a=this.test_match(c,b[e]),a!==!1)return a;if(this._backtrack){o=!1;continue}else return!1}else if(!this.options.flex)break}return o?(a=this.test_match(o,b[r]),a!==!1?a:!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:l(function(){var o=this.next();return o||this.lex()},"lex"),begin:l(function(o){this.conditionStack.push(o)},"begin"),popState:l(function(){var o=this.conditionStack.length-1;return o>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:l(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:l(function(o){return o=this.conditionStack.length-1-Math.abs(o||0),o>=0?this.conditionStack[o]:"INITIAL"},"topState"),pushState:l(function(o){this.begin(o)},"pushState"),stateStackSize:l(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:l(function(o,c,r,b){var e=b;switch(r){case 0:return this.begin("acc_title"),24;break;case 1:return this.popState(),"acc_title_value";break;case 2:return this.begin("acc_descr"),26;break;case 3:return this.popState(),"acc_descr_value";break;case 4:this.begin("acc_descr_multiline");break;case 5:this.popState();break;case 6:return"acc_descr_multiline_value";case 7:return 33;case 8:return 34;case 9:return 35;case 10:return 36;case 11:return 10;case 12:break;case 13:return 8;case 14:return 50;case 15:return 72;case 16:return 4;case 17:return this.begin("block"),17;break;case 18:return 49;case 19:return 49;case 20:return 42;case 21:return 15;case 22:return 13;case 23:break;case 24:return 61;case 25:return 58;case 26:return 58;case 27:return 62;case 28:break;case 29:return this.popState(),19;break;case 30:return c.yytext[0];case 31:return 20;case 32:return 21;case 33:return this.begin("style"),44;break;case 34:return this.popState(),10;break;case 35:break;case 36:return 13;case 37:return 42;case 38:return 49;case 39:return this.begin("style"),37;break;case 40:return 43;case 41:return 65;case 42:return 67;case 43:return 67;case 44:return 67;case 45:return 65;case 46:return 65;case 47:return 66;case 48:return 66;case 49:return 66;case 50:return 66;case 51:return 66;case 52:return 67;case 53:return 66;case 54:return 67;case 55:return 68;case 56:return 68;case 57:return 51;case 58:return 68;case 59:return 68;case 60:return 68;case 61:return 52;case 62:return 48;case 63:return 68;case 64:return 65;case 65:return 66;case 66:return 67;case 67:return 69;case 68:return 70;case 69:return 71;case 70:return 71;case 71:return 70;case 72:return 70;case 73:return 70;case 74:return 41;case 75:return 47;case 76:return 40;case 77:return c.yytext[0];case 78:return 6}},"anonymous"),rules:[/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:.*direction\s+TB[^\n]*)/i,/^(?:.*direction\s+BT[^\n]*)/i,/^(?:.*direction\s+RL[^\n]*)/i,/^(?:.*direction\s+LR[^\n]*)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:[\s]+)/i,/^(?:"[^"%\r\n\v\b\\]+")/i,/^(?:"[^"]*")/i,/^(?:erDiagram\b)/i,/^(?:\{)/i,/^(?:#)/i,/^(?:#)/i,/^(?:,)/i,/^(?::::)/i,/^(?::)/i,/^(?:\s+)/i,/^(?:\b((?:PK)|(?:FK)|(?:UK))\b)/i,/^(?:([^\s]*)[~].*[~]([^\s]*))/i,/^(?:([\*A-Za-z_\u00C0-\uFFFF][A-Za-z0-9\-\_\[\]\(\)\u00C0-\uFFFF\*]*))/i,/^(?:"[^"]*")/i,/^(?:[\n]+)/i,/^(?:\})/i,/^(?:.)/i,/^(?:\[)/i,/^(?:\])/i,/^(?:style\b)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?::)/i,/^(?:,)/i,/^(?:#)/i,/^(?:classDef\b)/i,/^(?:class\b)/i,/^(?:one or zero\b)/i,/^(?:one or more\b)/i,/^(?:one or many\b)/i,/^(?:1\+)/i,/^(?:\|o\b)/i,/^(?:zero or one\b)/i,/^(?:zero or more\b)/i,/^(?:zero or many\b)/i,/^(?:0\+)/i,/^(?:\}o\b)/i,/^(?:many\(0\))/i,/^(?:many\(1\))/i,/^(?:many\b)/i,/^(?:\}\|)/i,/^(?:one\b)/i,/^(?:only one\b)/i,/^(?:[0-9]+\.[0-9]+)/i,/^(?:1(?=\s+[A-Za-z_"']))/i,/^(?:1(?=\s+[0-9]))/i,/^(?:1(?=(--|\.\.|\.-|-\.)))/i,/^(?:1\b)/i,/^(?:[0-9]+)/i,/^(?:\|\|)/i,/^(?:o\|)/i,/^(?:o\{)/i,/^(?:\|\{)/i,/^(?:u(?=[\.\-\|]))/i,/^(?:\.\.)/i,/^(?:--)/i,/^(?:to\b)/i,/^(?:optionally to\b)/i,/^(?:\.-)/i,/^(?:-\.)/i,/^(?:([^\x00-\x7F]|\w|-|\*)+)/i,/^(?:;)/i,/^(?:([^\x00-\x7F]|\w|-|\*|\.)+)/i,/^(?:.)/i,/^(?:$)/i],conditions:{style:{rules:[34,35,36,37,38,74,75],inclusive:!1},acc_descr_multiline:{rules:[5,6],inclusive:!1},acc_descr:{rules:[3],inclusive:!1},acc_title:{rules:[1],inclusive:!1},block:{rules:[23,24,25,26,27,28,29,30],inclusive:!1},INITIAL:{rules:[0,2,4,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,31,32,33,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,65,66,67,68,69,70,71,72,73,76,77,78],inclusive:!0}}};return C})();ue.lexer=He;function ee(){this.yy={}}return l(ee,"Parser"),ee.prototype=ue,ue.Parser=ee,new ee})();ye.parser=ye;var tt=ye,st=class{constructor(){this.entities=new Map,this.relationships=[],this.classes=new Map,this.direction="TB",this.Cardinality={ZERO_OR_ONE:"ZERO_OR_ONE",ZERO_OR_MORE:"ZERO_OR_MORE",ONE_OR_MORE:"ONE_OR_MORE",ONLY_ONE:"ONLY_ONE",MD_PARENT:"MD_PARENT"},this.Identification={NON_IDENTIFYING:"NON_IDENTIFYING",IDENTIFYING:"IDENTIFYING"},this.setAccTitle=Ve,this.getAccTitle=Me,this.setAccDescription=Be,this.getAccDescription=Fe,this.setDiagramTitle=Ye,this.getDiagramTitle=Pe,this.getConfig=l(()=>j().er,"getConfig"),this.clear(),this.addEntity=this.addEntity.bind(this),this.addAttributes=this.addAttributes.bind(this),this.addRelationship=this.addRelationship.bind(this),this.setDirection=this.setDirection.bind(this),this.addCssStyles=this.addCssStyles.bind(this),this.addClass=this.addClass.bind(this),this.setClass=this.setClass.bind(this),this.setAccTitle=this.setAccTitle.bind(this),this.setAccDescription=this.setAccDescription.bind(this)}static{l(this,"ErDB")}addEntity(t,i=""){return this.entities.has(t)?!this.entities.get(t)?.alias&&i&&(this.entities.get(t).alias=i,D.info(`Add alias '${i}' to entity '${t}'`)):(this.entities.set(t,{id:`entity-${t}-${this.entities.size}`,label:t,attributes:[],alias:i,shape:"erBox",look:j().look??"default",cssClasses:"default",cssStyles:[],labelType:"markdown"}),D.info("Added new entity :",t)),this.entities.get(t)}getEntity(t){return this.entities.get(t)}getEntities(){return this.entities}getClasses(){return this.classes}addAttributes(t,i){let h=this.addEntity(t),n;for(n=i.length-1;n>=0;n--)i[n].keys||(i[n].keys=[]),i[n].comment||(i[n].comment=""),h.attributes.push(i[n]),D.debug("Added attribute ",i[n].name)}addRelationship(t,i,h,n){let u=this.entities.get(t),d=this.entities.get(h);if(!u||!d)return;let f={entityA:u.id,roleA:i,entityB:d.id,relSpec:n};this.relationships.push(f),D.debug("Added new relationship :",f)}getRelationships(){return this.relationships}getDirection(){return this.direction}setDirection(t){this.direction=t}getCompiledStyles(t){let i=[];for(let h of t){let n=this.classes.get(h);n?.styles&&(i=[...i,...n.styles??[]].map(u=>u.trim())),n?.textStyles&&(i=[...i,...n.textStyles??[]].map(u=>u.trim()))}return i}addCssStyles(t,i){for(let h of t){let n=this.entities.get(h);if(!i||!n)return;for(let u of i)n.cssStyles.push(u)}}addClass(t,i){t.forEach(h=>{let n=this.classes.get(h);n===void 0&&(n={id:h,styles:[],textStyles:[]},this.classes.set(h,n)),i&&i.forEach(function(u){if(/color/.exec(u)){let d=u.replace("fill","bgFill");n.textStyles.push(d)}n.styles.push(u)})})}setClass(t,i){for(let h of t){let n=this.entities.get(h);if(n)for(let u of i)n.cssClasses+=" "+u}}clear(){this.entities=new Map,this.classes=new Map,this.relationships=[],we()}getData(){let t=[],i=[],h=j(),n=0;for(let d of this.entities.keys()){let f=this.entities.get(d);f&&(f.cssCompiledStyles=this.getCompiledStyles(f.cssClasses.split(" ")),f.colorIndex=n++,t.push(f))}let u=0;for(let d of this.relationships){let f={id:Ke(d.entityA,d.entityB,{prefix:"id",counter:u++}),type:"normal",curve:"basis",start:d.entityA,end:d.entityB,label:d.roleA,labelpos:"c",thickness:"normal",classes:"relationshipLine",arrowTypeStart:d.relSpec.cardB.toLowerCase(),arrowTypeEnd:d.relSpec.cardA.toLowerCase(),pattern:d.relSpec.relType=="IDENTIFYING"?"solid":"dashed",look:h.look,labelType:"markdown"};i.push(f)}return{nodes:t,edges:i,other:{},config:h,direction:"TB"}}},Xe={};ve(Xe,{draw:()=>it});var it=l(async function(t,i,h,n){D.info("REF0:"),D.info("Drawing er diagram (unified)",i);let{securityLevel:u,er:d,layout:f}=j(),p=n.db.getData(),m=je(i,u);p.type=n.type,p.layoutAlgorithm=Ze(f),p.config.flowchart.nodeSpacing=d?.nodeSpacing||140,p.config.flowchart.rankSpacing=d?.rankSpacing||80,p.direction=n.db.getDirection();let{config:W}=p,{look:Q}=W;Q==="neo"?p.markers=["only_one_neo","zero_or_one_neo","one_or_more_neo","zero_or_more_neo"]:p.markers=["only_one","zero_or_one","one_or_more","zero_or_more"],p.diagramId=i,await Ue(p,m),p.layoutAlgorithm==="elk"&&m.select(".edges").lower();let S=m.selectAll('[id*="-background"]');Array.from(S).length>0&&S.each(function(){let M=ze(this),I=M.attr("id").replace("-background",""),T=m.select(`#${CSS.escape(I)}`);if(!T.empty()){let R=T.attr("transform");M.attr("transform",R)}});let X=8;Ge.insertTitle(m,"erDiagramTitleText",d?.titleTopMargin??25,n.db.getDiagramTitle()),We(m,X,"erDiagram",d?.useMaxWidth??!0)},"draw"),Qe=l((t,i)=>{let h=Le,n=h(t,"r"),u=h(t,"g"),d=h(t,"b");return De(n,u,d,i)},"fade"),re=new Set(["redux-color","redux-dark-color"]),rt=l(t=>{let{theme:i,look:h,bkgColorArray:n,borderColorArray:u}=t;if(!re.has(i))return"";let d=n?.length>0,f="";for(let p=0;p<t.THEME_COLOR_LIMIT;p++)f+=` [data-look="${h}"][data-color-id="color-${p}"].node path { stroke: ${u[p]}; ${d?`fill: ${n[p]};`:""} } [data-look="${h}"][data-color-id="color-${p}"].node rect { stroke: ${u[p]}; ${d?`fill: ${n[p]};`:""} } `;return f},"genColor"),at=l(t=>{let{look:i,theme:h,erEdgeLabelBackground:n,strokeWidth:u}=t;return` ${rt(t)} .entityBox { fill: ${t.mainBkg}; stroke: ${t.nodeBorder}; } .relationshipLabelBox { fill: ${t.tertiaryColor}; opacity: 0.7; background-color: ${t.tertiaryColor}; rect { opacity: 0.5; } } .labelBkg { background-color: ${re.has(h)&&n?n:Qe(t.tertiaryColor,.5)}; } .edgeLabel { background-color: ${re.has(h)&&n?n:t.edgeLabelBackground}; } .edgeLabel .label rect { fill: ${re.has(h)&&n?n:t.edgeLabelBackground}; } .edgeLabel .label text { fill: ${t.textColor}; } .edgeLabel .label { fill: ${t.nodeBorder}; font-size: 14px; } .label { font-family: ${t.fontFamily}; color: ${t.nodeTextColor||t.textColor}; } .edge-pattern-dashed { stroke-dasharray: 8,8; } .node rect, .node circle, .node ellipse, .node polygon { fill: ${t.mainBkg}; stroke: ${t.nodeBorder}; stroke-width: ${i==="neo"?u:"1px"}; } .relationshipLine { stroke: ${t.lineColor}; stroke-width: ${i==="neo"?u:"1px"}; fill: none; } .marker { fill: none !important; stroke: ${t.lineColor} !important; stroke-width: 1; } [data-look=neo].labelBkg { background-color: ${Qe(t.tertiaryColor,.5)}; } `},"getStyles"),nt=at,St={parser:tt,get db(){return new st},renderer:Xe,styles:nt};export{St as diagram};