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