mirror of
https://github.com/livebook-dev/livebook.git
synced 2025-09-07 13:34:55 +08:00
61 lines
23 KiB
JavaScript
61 lines
23 KiB
JavaScript
import{Da as Y,P as ct,R as ht,S as dt,Z as ut,d as st,e as at,f as lt,h as s,i as ot,ia as B,j as S}from"./chunk-KRX7QNR4.js";import"./chunk-MGYUK2XN.js";var D=function(){var n=s(function(f,i,a,d){for(a=a||{},d=f.length;d--;a[f[d]]=i);return a},"o"),t=[6,8,10,11,12,14,16,17,20,21],e=[1,9],l=[1,10],r=[1,11],h=[1,12],c=[1,13],g=[1,16],m=[1,17],p={trace:s(function(){},"trace"),yy:{},symbols_:{error:2,start:3,timeline:4,document:5,EOF:6,line:7,SPACE:8,statement:9,NEWLINE:10,title:11,acc_title:12,acc_title_value:13,acc_descr:14,acc_descr_value:15,acc_descr_multiline_value:16,section:17,period_statement:18,event_statement:19,period:20,event:21,$accept:0,$end:1},terminals_:{2:"error",4:"timeline",6:"EOF",8:"SPACE",10:"NEWLINE",11:"title",12:"acc_title",13:"acc_title_value",14:"acc_descr",15:"acc_descr_value",16:"acc_descr_multiline_value",17:"section",20:"period",21:"event"},productions_:[0,[3,3],[5,0],[5,2],[7,2],[7,1],[7,1],[7,1],[9,1],[9,2],[9,2],[9,1],[9,1],[9,1],[9,1],[18,1],[19,1]],performAction:s(function(i,a,d,u,y,o,E){var k=o.length-1;switch(y){case 1:return o[k-1];case 2:this.$=[];break;case 3:o[k-1].push(o[k]),this.$=o[k-1];break;case 4:case 5:this.$=o[k];break;case 6:case 7:this.$=[];break;case 8:u.getCommonDb().setDiagramTitle(o[k].substr(6)),this.$=o[k].substr(6);break;case 9:this.$=o[k].trim(),u.getCommonDb().setAccTitle(this.$);break;case 10:case 11:this.$=o[k].trim(),u.getCommonDb().setAccDescription(this.$);break;case 12:u.addSection(o[k].substr(8)),this.$=o[k].substr(8);break;case 15:u.addTask(o[k],0,""),this.$=o[k];break;case 16:u.addEvent(o[k].substr(2)),this.$=o[k];break}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},n(t,[2,2],{5:3}),{6:[1,4],7:5,8:[1,6],9:7,10:[1,8],11:e,12:l,14:r,16:h,17:c,18:14,19:15,20:g,21:m},n(t,[2,7],{1:[2,1]}),n(t,[2,3]),{9:18,11:e,12:l,14:r,16:h,17:c,18:14,19:15,20:g,21:m},n(t,[2,5]),n(t,[2,6]),n(t,[2,8]),{13:[1,19]},{15:[1,20]},n(t,[2,11]),n(t,[2,12]),n(t,[2,13]),n(t,[2,14]),n(t,[2,15]),n(t,[2,16]),n(t,[2,4]),n(t,[2,9]),n(t,[2,10])],defaultActions:{},parseError:s(function(i,a){if(a.recoverable)this.trace(i);else{var d=new Error(i);throw d.hash=a,d}},"parseError"),parse:s(function(i){var a=this,d=[0],u=[],y=[null],o=[],E=this.table,k="",M=0,H=0,z=0,rt=2,G=1,q=o.slice.call(arguments,1),b=Object.create(this.lexer),N={yy:{}};for(var V in this.yy)Object.prototype.hasOwnProperty.call(this.yy,V)&&(N.yy[V]=this.yy[V]);b.setInput(i,N.yy),N.yy.lexer=b,N.yy.parser=this,typeof b.yylloc=="undefined"&&(b.yylloc={});var L=b.yylloc;o.push(L);var w=b.options&&b.options.ranges;typeof N.yy.parseError=="function"?this.parseError=N.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function $(T){d.length=d.length-2*T,y.length=y.length-T,o.length=o.length-T}s($,"popStack");function C(){var T;return T=u.pop()||b.lex()||G,typeof T!="number"&&(T instanceof Array&&(u=T,T=u.pop()),T=a.symbols_[T]||T),T}s(C,"lex");for(var _,R,P,I,Jt,Q,W={},U,A,it,Z;;){if(P=d[d.length-1],this.defaultActions[P]?I=this.defaultActions[P]:((_===null||typeof _=="undefined")&&(_=C()),I=E[P]&&E[P][_]),typeof I=="undefined"||!I.length||!I[0]){var X="";Z=[];for(U in E[P])this.terminals_[U]&&U>rt&&Z.push("'"+this.terminals_[U]+"'");b.showPosition?X="Parse error on line "+(M+1)+`:
|
|
`+b.showPosition()+`
|
|
Expecting `+Z.join(", ")+", got '"+(this.terminals_[_]||_)+"'":X="Parse error on line "+(M+1)+": Unexpected "+(_==G?"end of input":"'"+(this.terminals_[_]||_)+"'"),this.parseError(X,{text:b.match,token:this.terminals_[_]||_,line:b.yylineno,loc:L,expected:Z})}if(I[0]instanceof Array&&I.length>1)throw new Error("Parse Error: multiple actions possible at state: "+P+", token: "+_);switch(I[0]){case 1:d.push(_),y.push(b.yytext),o.push(b.yylloc),d.push(I[1]),_=null,R?(_=R,R=null):(H=b.yyleng,k=b.yytext,M=b.yylineno,L=b.yylloc,z>0&&z--);break;case 2:if(A=this.productions_[I[1]][1],W.$=y[y.length-A],W._$={first_line:o[o.length-(A||1)].first_line,last_line:o[o.length-1].last_line,first_column:o[o.length-(A||1)].first_column,last_column:o[o.length-1].last_column},w&&(W._$.range=[o[o.length-(A||1)].range[0],o[o.length-1].range[1]]),Q=this.performAction.apply(W,[k,H,M,N.yy,I[1],y,o].concat(q)),typeof Q!="undefined")return Q;A&&(d=d.slice(0,-1*A*2),y=y.slice(0,-1*A),o=o.slice(0,-1*A)),d.push(this.productions_[I[1]][0]),y.push(W.$),o.push(W._$),it=E[d[d.length-2]][d[d.length-1]],d.push(it);break;case 3:return!0}}return!0},"parse")},x=function(){var f={EOF:1,parseError:s(function(a,d){if(this.yy.parser)this.yy.parser.parseError(a,d);else throw new Error(a)},"parseError"),setInput:s(function(i,a){return this.yy=a||this.yy||{},this._input=i,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:s(function(){var i=this._input[0];this.yytext+=i,this.yyleng++,this.offset++,this.match+=i,this.matched+=i;var a=i.match(/(?:\r\n?|\n).*/g);return a?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),i},"input"),unput:s(function(i){var a=i.length,d=i.split(/(?:\r\n?|\n)/g);this._input=i+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-a),this.offset-=a;var u=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),d.length-1&&(this.yylineno-=d.length-1);var y=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:d?(d.length===u.length?this.yylloc.first_column:0)+u[u.length-d.length].length-d[0].length:this.yylloc.first_column-a},this.options.ranges&&(this.yylloc.range=[y[0],y[0]+this.yyleng-a]),this.yyleng=this.yytext.length,this},"unput"),more:s(function(){return this._more=!0,this},"more"),reject:s(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:s(function(i){this.unput(this.match.slice(i))},"less"),pastInput:s(function(){var i=this.matched.substr(0,this.matched.length-this.match.length);return(i.length>20?"...":"")+i.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:s(function(){var i=this.match;return i.length<20&&(i+=this._input.substr(0,20-i.length)),(i.substr(0,20)+(i.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:s(function(){var i=this.pastInput(),a=new Array(i.length+1).join("-");return i+this.upcomingInput()+`
|
|
`+a+"^"},"showPosition"),test_match:s(function(i,a){var d,u,y;if(this.options.backtrack_lexer&&(y={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&&(y.yylloc.range=this.yylloc.range.slice(0))),u=i[0].match(/(?:\r\n?|\n).*/g),u&&(this.yylineno+=u.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:u?u[u.length-1].length-u[u.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+i[0].length},this.yytext+=i[0],this.match+=i[0],this.matches=i,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(i[0].length),this.matched+=i[0],d=this.performAction.call(this,this.yy,this,a,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),d)return d;if(this._backtrack){for(var o in y)this[o]=y[o];return!1}return!1},"test_match"),next:s(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var i,a,d,u;this._more||(this.yytext="",this.match="");for(var y=this._currentRules(),o=0;o<y.length;o++)if(d=this._input.match(this.rules[y[o]]),d&&(!a||d[0].length>a[0].length)){if(a=d,u=o,this.options.backtrack_lexer){if(i=this.test_match(d,y[o]),i!==!1)return i;if(this._backtrack){a=!1;continue}else return!1}else if(!this.options.flex)break}return a?(i=this.test_match(a,y[u]),i!==!1?i:!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:s(function(){var a=this.next();return a||this.lex()},"lex"),begin:s(function(a){this.conditionStack.push(a)},"begin"),popState:s(function(){var a=this.conditionStack.length-1;return a>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:s(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:s(function(a){return a=this.conditionStack.length-1-Math.abs(a||0),a>=0?this.conditionStack[a]:"INITIAL"},"topState"),pushState:s(function(a){this.begin(a)},"pushState"),stateStackSize:s(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:s(function(a,d,u,y){var o=y;switch(u){case 0:break;case 1:break;case 2:return 10;case 3:break;case 4:break;case 5:return 4;case 6:return 11;case 7:return this.begin("acc_title"),12;break;case 8:return this.popState(),"acc_title_value";break;case 9:return this.begin("acc_descr"),14;break;case 10:return this.popState(),"acc_descr_value";break;case 11:this.begin("acc_descr_multiline");break;case 12:this.popState();break;case 13:return"acc_descr_multiline_value";case 14:return 17;case 15:return 21;case 16:return 20;case 17:return 6;case 18:return"INVALID"}},"anonymous"),rules:[/^(?:%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:#[^\n]*)/i,/^(?:timeline\b)/i,/^(?:title\s[^\n]+)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:section\s[^:\n]+)/i,/^(?::\s[^:\n]+)/i,/^(?:[^#:\n]+)/i,/^(?:$)/i,/^(?:.)/i],conditions:{acc_descr_multiline:{rules:[12,13],inclusive:!1},acc_descr:{rules:[10],inclusive:!1},acc_title:{rules:[8],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,9,11,14,15,16,17,18],inclusive:!0}}};return f}();p.lexer=x;function v(){this.yy={}}return s(v,"Parser"),v.prototype=p,p.Parser=v,new v}();D.parser=D;var Nt=D,ft={};ot(ft,{addEvent:()=>St,addSection:()=>bt,addTask:()=>wt,addTaskOrg:()=>Et,clear:()=>kt,default:()=>Lt,getCommonDb:()=>xt,getSections:()=>vt,getTasks:()=>_t});var O="",mt=0,tt=[],J=[],j=[],xt=s(()=>ht,"getCommonDb"),kt=s(function(){tt.length=0,J.length=0,O="",j.length=0,dt()},"clear"),bt=s(function(n){O=n,tt.push(n)},"addSection"),vt=s(function(){return tt},"getSections"),_t=s(function(){let n=pt(),t=100,e=0;for(;!n&&e<t;)n=pt(),e++;return J.push(...j),J},"getTasks"),wt=s(function(n,t,e){let l={id:mt++,section:O,type:O,task:n,score:t||0,events:e?[e]:[]};j.push(l)},"addTask"),St=s(function(n){j.find(e=>e.id===mt-1).events.push(n)},"addEvent"),Et=s(function(n){let t={section:O,type:O,description:n,task:n,classes:[]};J.push(t)},"addTaskOrg"),pt=s(function(){let n=s(function(e){return j[e].processed},"compileTask"),t=!0;for(let[e,l]of j.entries())n(e),t=t&&l.processed;return t},"compileTasks"),Lt={clear:kt,getCommonDb:xt,addSection:bt,getSections:vt,getTasks:_t,addTask:wt,addTaskOrg:Et,addEvent:St},Mt=12,K=s(function(n,t){let e=n.append("rect");return e.attr("x",t.x),e.attr("y",t.y),e.attr("fill",t.fill),e.attr("stroke",t.stroke),e.attr("width",t.width),e.attr("height",t.height),e.attr("rx",t.rx),e.attr("ry",t.ry),t.class!==void 0&&e.attr("class",t.class),e},"drawRect"),$t=s(function(n,t){let l=n.append("circle").attr("cx",t.cx).attr("cy",t.cy).attr("class","face").attr("r",15).attr("stroke-width",2).attr("overflow","visible"),r=n.append("g");r.append("circle").attr("cx",t.cx-15/3).attr("cy",t.cy-15/3).attr("r",1.5).attr("stroke-width",2).attr("fill","#666").attr("stroke","#666"),r.append("circle").attr("cx",t.cx+15/3).attr("cy",t.cy-15/3).attr("r",1.5).attr("stroke-width",2).attr("fill","#666").attr("stroke","#666");function h(m){let p=Y().startAngle(Math.PI/2).endAngle(3*(Math.PI/2)).innerRadius(7.5).outerRadius(6.8181818181818175);m.append("path").attr("class","mouth").attr("d",p).attr("transform","translate("+t.cx+","+(t.cy+2)+")")}s(h,"smile");function c(m){let p=Y().startAngle(3*Math.PI/2).endAngle(5*(Math.PI/2)).innerRadius(7.5).outerRadius(6.8181818181818175);m.append("path").attr("class","mouth").attr("d",p).attr("transform","translate("+t.cx+","+(t.cy+7)+")")}s(c,"sad");function g(m){m.append("line").attr("class","mouth").attr("stroke",2).attr("x1",t.cx-5).attr("y1",t.cy+7).attr("x2",t.cx+5).attr("y2",t.cy+7).attr("class","mouth").attr("stroke-width","1px").attr("stroke","#666")}return s(g,"ambivalent"),t.score>3?h(r):t.score<3?c(r):g(r),l},"drawFace"),Pt=s(function(n,t){let e=n.append("circle");return e.attr("cx",t.cx),e.attr("cy",t.cy),e.attr("class","actor-"+t.pos),e.attr("fill",t.fill),e.attr("stroke",t.stroke),e.attr("r",t.r),e.class!==void 0&&e.attr("class",e.class),t.title!==void 0&&e.append("title").text(t.title),e},"drawCircle"),Tt=s(function(n,t){let e=t.text.replace(/<br\s*\/?>/gi," "),l=n.append("text");l.attr("x",t.x),l.attr("y",t.y),l.attr("class","legend"),l.style("text-anchor",t.anchor),t.class!==void 0&&l.attr("class",t.class);let r=l.append("tspan");return r.attr("x",t.x+t.textMargin*2),r.text(e),l},"drawText"),At=s(function(n,t){function e(r,h,c,g,m){return r+","+h+" "+(r+c)+","+h+" "+(r+c)+","+(h+g-m)+" "+(r+c-m*1.2)+","+(h+g)+" "+r+","+(h+g)}s(e,"genPoints");let l=n.append("polygon");l.attr("points",e(t.x,t.y,50,20,7)),l.attr("class","labelBox"),t.y=t.y+t.labelMargin,t.x=t.x+.5*t.labelMargin,Tt(n,t)},"drawLabel"),Ct=s(function(n,t,e){let l=n.append("g"),r=et();r.x=t.x,r.y=t.y,r.fill=t.fill,r.width=e.width,r.height=e.height,r.class="journey-section section-type-"+t.num,r.rx=3,r.ry=3,K(l,r),It(e)(t.text,l,r.x,r.y,r.width,r.height,{class:"journey-section section-type-"+t.num},e,t.colour)},"drawSection"),yt=-1,Ht=s(function(n,t,e){let l=t.x+e.width/2,r=n.append("g");yt++;let h=300+5*30;r.append("line").attr("id","task"+yt).attr("x1",l).attr("y1",t.y).attr("x2",l).attr("y2",h).attr("class","task-line").attr("stroke-width","1px").attr("stroke-dasharray","4 2").attr("stroke","#666"),$t(r,{cx:l,cy:300+(5-t.score)*30,score:t.score});let c=et();c.x=t.x,c.y=t.y,c.fill=t.fill,c.width=e.width,c.height=e.height,c.class="task task-type-"+t.num,c.rx=3,c.ry=3,K(r,c),It(e)(t.task,r,c.x,c.y,c.width,c.height,{class:"task"},e,t.colour)},"drawTask"),Rt=s(function(n,t){K(n,{x:t.startx,y:t.starty,width:t.stopx-t.startx,height:t.stopy-t.starty,fill:t.fill,class:"rect"}).lower()},"drawBackgroundRect"),Ft=s(function(){return{x:0,y:0,fill:void 0,"text-anchor":"start",width:100,height:100,textMargin:0,rx:0,ry:0}},"getTextObj"),et=s(function(){return{x:0,y:0,width:100,anchor:"start",height:100,rx:0,ry:0}},"getNoteRect"),It=function(){function n(r,h,c,g,m,p,x,v){let f=h.append("text").attr("x",c+m/2).attr("y",g+p/2+5).style("font-color",v).style("text-anchor","middle").text(r);l(f,x)}s(n,"byText");function t(r,h,c,g,m,p,x,v,f){let{taskFontSize:i,taskFontFamily:a}=v,d=r.split(/<br\s*\/?>/gi);for(let u=0;u<d.length;u++){let y=u*i-i*(d.length-1)/2,o=h.append("text").attr("x",c+m/2).attr("y",g).attr("fill",f).style("text-anchor","middle").style("font-size",i).style("font-family",a);o.append("tspan").attr("x",c+m/2).attr("dy",y).text(d[u]),o.attr("y",g+p/2).attr("dominant-baseline","central").attr("alignment-baseline","central"),l(o,x)}}s(t,"byTspan");function e(r,h,c,g,m,p,x,v){let f=h.append("switch"),a=f.append("foreignObject").attr("x",c).attr("y",g).attr("width",m).attr("height",p).attr("position","fixed").append("xhtml:div").style("display","table").style("height","100%").style("width","100%");a.append("div").attr("class","label").style("display","table-cell").style("text-align","center").style("vertical-align","middle").text(r),t(r,f,c,g,m,p,x,v),l(a,x)}s(e,"byFo");function l(r,h){for(let c in h)c in h&&r.attr(c,h[c])}return s(l,"_setTextAttrs"),function(r){return r.textPlacement==="fo"?e:r.textPlacement==="old"?n:t}}(),zt=s(function(n){n.append("defs").append("marker").attr("id","arrowhead").attr("refX",5).attr("refY",2).attr("markerWidth",6).attr("markerHeight",4).attr("orient","auto").append("path").attr("d","M 0,0 V 4 L6,2 Z")},"initGraphics");function nt(n,t){n.each(function(){var e=B(this),l=e.text().split(/(\s+|<br>)/).reverse(),r,h=[],c=1.1,g=e.attr("y"),m=parseFloat(e.attr("dy")),p=e.text(null).append("tspan").attr("x",0).attr("y",g).attr("dy",m+"em");for(let x=0;x<l.length;x++)r=l[l.length-1-x],h.push(r),p.text(h.join(" ").trim()),(p.node().getComputedTextLength()>t||r==="<br>")&&(h.pop(),p.text(h.join(" ").trim()),r==="<br>"?h=[""]:h=[r],p=e.append("tspan").attr("x",0).attr("y",g).attr("dy",c+"em").text(r))})}s(nt,"wrap");var Vt=s(function(n,t,e,l){var v;let r=e%Mt-1,h=n.append("g");t.section=r,h.attr("class",(t.class?t.class+" ":"")+"timeline-node "+("section-"+r));let c=h.append("g"),g=h.append("g"),p=g.append("text").text(t.descr).attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle").call(nt,t.width).node().getBBox(),x=(v=l.fontSize)!=null&&v.replace?l.fontSize.replace("px",""):l.fontSize;return t.height=p.height+x*1.1*.5+t.padding,t.height=Math.max(t.height,t.maxHeight),t.width=t.width+2*t.padding,g.attr("transform","translate("+t.width/2+", "+t.padding/2+")"),Bt(c,t,r,l),t},"drawNode"),Wt=s(function(n,t,e){var g;let l=n.append("g"),h=l.append("text").text(t.descr).attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle").call(nt,t.width).node().getBBox(),c=(g=e.fontSize)!=null&&g.replace?e.fontSize.replace("px",""):e.fontSize;return l.remove(),h.height+c*1.1*.5+t.padding},"getVirtualNodeHeight"),Bt=s(function(n,t,e){n.append("path").attr("id","node-"+t.id).attr("class","node-bkg node-"+t.type).attr("d",`M0 ${t.height-5} v${-t.height+2*5} q0,-5 5,-5 h${t.width-2*5} q5,0 5,5 v${t.height-5} H0 Z`),n.append("line").attr("class","node-line-"+e).attr("x1",0).attr("y1",t.height).attr("x2",t.width).attr("y2",t.height)},"defaultBkg"),F={drawRect:K,drawCircle:Pt,drawSection:Ct,drawText:Tt,drawLabel:At,drawTask:Ht,drawBackgroundRect:Rt,getTextObj:Ft,getNoteRect:et,initGraphics:zt,drawNode:Vt,getVirtualNodeHeight:Wt},Ot=s(function(n,t,e,l){var G,q,b,N,V;let r=ut(),h=(G=r.leftMargin)!=null?G:50;S.debug("timeline",l.db);let c=r.securityLevel,g;c==="sandbox"&&(g=B("#i"+t));let p=(c==="sandbox"?B(g.nodes()[0].contentDocument.body):B("body")).select("#"+t);p.append("g");let x=l.db.getTasks(),v=l.db.getCommonDb().getDiagramTitle();S.debug("task",x),F.initGraphics(p);let f=l.db.getSections();S.debug("sections",f);let i=0,a=0,d=0,u=0,y=50+h,o=50;u=50;let E=0,k=!0;f.forEach(function(L){let w={number:E,descr:L,section:E,width:150,padding:20,maxHeight:i},$=F.getVirtualNodeHeight(p,w,r);S.debug("sectionHeight before draw",$),i=Math.max(i,$+20)});let M=0,H=0;S.debug("tasks.length",x.length);for(let[L,w]of x.entries()){let $={number:L,descr:w,section:w.section,width:150,padding:20,maxHeight:a},C=F.getVirtualNodeHeight(p,$,r);S.debug("taskHeight before draw",C),a=Math.max(a,C+20),M=Math.max(M,w.events.length);let _=0;for(let R of w.events){let P={descr:R,section:w.section,number:w.section,width:150,padding:20,maxHeight:50};_+=F.getVirtualNodeHeight(p,P,r)}H=Math.max(H,_)}S.debug("maxSectionHeight before draw",i),S.debug("maxTaskHeight before draw",a),f&&f.length>0?f.forEach(L=>{let w=x.filter(R=>R.section===L),$={number:E,descr:L,section:E,width:200*Math.max(w.length,1)-50,padding:20,maxHeight:i};S.debug("sectionNode",$);let C=p.append("g"),_=F.drawNode(C,$,E,r);S.debug("sectionNode output",_),C.attr("transform",`translate(${y}, ${u})`),o+=i+50,w.length>0&>(p,w,E,y,o,a,r,M,H,i,!1),y+=200*Math.max(w.length,1),o=u,E++}):(k=!1,gt(p,x,E,y,o,a,r,M,H,i,!0));let z=p.node().getBBox();S.debug("bounds",z),v&&p.append("text").text(v).attr("x",z.width/2-h).attr("font-size","4ex").attr("font-weight","bold").attr("y",20),d=k?i+a+150:a+100,p.append("g").attr("class","lineWrapper").append("line").attr("x1",h).attr("y1",d).attr("x2",z.width+3*h).attr("y2",d).attr("stroke-width",4).attr("stroke","black").attr("marker-end","url(#arrowhead)"),ct(void 0,p,(b=(q=r.timeline)==null?void 0:q.padding)!=null?b:50,(V=(N=r.timeline)==null?void 0:N.useMaxWidth)!=null?V:!1)},"draw"),gt=s(function(n,t,e,l,r,h,c,g,m,p,x){var v;for(let f of t){let i={descr:f.task,section:e,number:e,width:150,padding:20,maxHeight:h};S.debug("taskNode",i);let a=n.append("g").attr("class","taskWrapper"),u=F.drawNode(a,i,e,c).height;if(S.debug("taskHeight after draw",u),a.attr("transform",`translate(${l}, ${r})`),h=Math.max(h,u),f.events){let y=n.append("g").attr("class","lineWrapper"),o=h;r+=100,o=o+jt(n,f.events,e,l,r,c),r-=100,y.append("line").attr("x1",l+190/2).attr("y1",r+h).attr("x2",l+190/2).attr("y2",r+h+(x?h:p)+m+120).attr("stroke-width",2).attr("stroke","black").attr("marker-end","url(#arrowhead)").attr("stroke-dasharray","5,5")}l=l+200,x&&!((v=c.timeline)!=null&&v.disableMulticolor)&&e++}r=r-10},"drawTasks"),jt=s(function(n,t,e,l,r,h){let c=0,g=r;r=r+100;for(let m of t){let p={descr:m,section:e,number:e,width:150,padding:20,maxHeight:50};S.debug("eventNode",p);let x=n.append("g").attr("class","eventWrapper"),f=F.drawNode(x,p,e,h).height;c=c+f,x.attr("transform",`translate(${l}, ${r})`),r=r+10+f}return r=g,c},"drawEvents"),Gt={setConf:s(()=>{},"setConf"),draw:Ot},qt=s(n=>{let t="";for(let e=0;e<n.THEME_COLOR_LIMIT;e++)n["lineColor"+e]=n["lineColor"+e]||n["cScaleInv"+e],st(n["lineColor"+e])?n["lineColor"+e]=at(n["lineColor"+e],20):n["lineColor"+e]=lt(n["lineColor"+e],20);for(let e=0;e<n.THEME_COLOR_LIMIT;e++){let l=""+(17-3*e);t+=`
|
|
.section-${e-1} rect, .section-${e-1} path, .section-${e-1} circle, .section-${e-1} path {
|
|
fill: ${n["cScale"+e]};
|
|
}
|
|
.section-${e-1} text {
|
|
fill: ${n["cScaleLabel"+e]};
|
|
}
|
|
.node-icon-${e-1} {
|
|
font-size: 40px;
|
|
color: ${n["cScaleLabel"+e]};
|
|
}
|
|
.section-edge-${e-1}{
|
|
stroke: ${n["cScale"+e]};
|
|
}
|
|
.edge-depth-${e-1}{
|
|
stroke-width: ${l};
|
|
}
|
|
.section-${e-1} line {
|
|
stroke: ${n["cScaleInv"+e]} ;
|
|
stroke-width: 3;
|
|
}
|
|
|
|
.lineWrapper line{
|
|
stroke: ${n["cScaleLabel"+e]} ;
|
|
}
|
|
|
|
.disabled, .disabled circle, .disabled text {
|
|
fill: lightgray;
|
|
}
|
|
.disabled text {
|
|
fill: #efefef;
|
|
}
|
|
`}return t},"genSections"),Ut=s(n=>`
|
|
.edge {
|
|
stroke-width: 3;
|
|
}
|
|
${qt(n)}
|
|
.section-root rect, .section-root path, .section-root circle {
|
|
fill: ${n.git0};
|
|
}
|
|
.section-root text {
|
|
fill: ${n.gitBranchLabel0};
|
|
}
|
|
.icon-container {
|
|
height:100%;
|
|
display: flex;
|
|
justify-content: center;
|
|
align-items: center;
|
|
}
|
|
.edge {
|
|
fill: none;
|
|
}
|
|
.eventWrapper {
|
|
filter: brightness(120%);
|
|
}
|
|
`,"getStyles"),Zt=Ut,Dt={db:ft,renderer:Gt,parser:Nt,styles:Zt};export{Dt as diagram};
|