You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
1 line
23 KiB
1 line
23 KiB
"use strict";(self.webpackChunkjupyter_web=self.webpackChunkjupyter_web||[]).push([[7806],{87806:(Bt,J,C)=>{C.r(J),C.d(J,{diagram:()=>Ct});var V=C(90152),n=C(3685),F=C(31083),z=function(){var t=(0,n.eW)(function(g,r,a,l){for(a=a||{},l=g.length;l--;a[g[l]]=r);return a},"o"),e=[6,8,10,11,12,14,16,17,18],i=[1,9],c=[1,10],s=[1,11],u=[1,12],h=[1,13],f=[1,14],d={trace:(0,n.eW)(function(){},"trace"),yy:{},symbols_:{error:2,start:3,journey: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,taskName:18,taskData:19,$accept:0,$end:1},terminals_:{2:"error",4:"journey",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",18:"taskName",19:"taskData"},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,2]],performAction:(0,n.eW)(function(r,a,l,y,p,o,M){var _=o.length-1;switch(p){case 1:return o[_-1];case 2:case 6:case 7:this.$=[];break;case 3:o[_-1].push(o[_]),this.$=o[_-1];break;case 4:case 5:this.$=o[_];break;case 8:y.setDiagramTitle(o[_].substr(6)),this.$=o[_].substr(6);break;case 9:this.$=o[_].trim(),y.setAccTitle(this.$);break;case 10:case 11:this.$=o[_].trim(),y.setAccDescription(this.$);break;case 12:y.addSection(o[_].substr(8)),this.$=o[_].substr(8);break;case 13:y.addTask(o[_-1],o[_]),this.$="task"}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},t(e,[2,2],{5:3}),{6:[1,4],7:5,8:[1,6],9:7,10:[1,8],11:i,12:c,14:s,16:u,17:h,18:f},t(e,[2,7],{1:[2,1]}),t(e,[2,3]),{9:15,11:i,12:c,14:s,16:u,17:h,18:f},t(e,[2,5]),t(e,[2,6]),t(e,[2,8]),{13:[1,16]},{15:[1,17]},t(e,[2,11]),t(e,[2,12]),{19:[1,18]},t(e,[2,4]),t(e,[2,9]),t(e,[2,10]),t(e,[2,13])],defaultActions:{},parseError:(0,n.eW)(function(r,a){if(!a.recoverable){var l=new Error(r);throw l.hash=a,l}this.trace(r)},"parseError"),parse:(0,n.eW)(function(r){var a=this,l=[0],y=[],p=[null],o=[],M=this.table,_="",j=0,ot=0,ct=0,Vt=2,ht=1,Ft=o.slice.call(arguments,1),x=Object.create(this.lexer),$={yy:{}};for(var K in this.yy)Object.prototype.hasOwnProperty.call(this.yy,K)&&($.yy[K]=this.yy[K]);x.setInput(r,$.yy),$.yy.lexer=x,$.yy.parser=this,typeof x.yylloc>"u"&&(x.yylloc={});var X=x.yylloc;o.push(X);var Lt=x.options&&x.options.ranges;function Rt(v){l.length=l.length-2*v,p.length=p.length-v,o.length=o.length-v}function ut(){var v;return"number"!=typeof(v=y.pop()||x.lex()||ht)&&(v instanceof Array&&(v=(y=v).pop()),v=a.symbols_[v]||v),v}"function"==typeof $.yy.parseError?this.parseError=$.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError,(0,n.eW)(Rt,"popStack"),(0,n.eW)(ut,"lex");for(var b,D,P,W,Z,O,S,yt,Y,A={};;){if(P=l[l.length-1],this.defaultActions[P]?W=this.defaultActions[P]:((null===b||typeof b>"u")&&(b=ut()),W=M[P]&&M[P][b]),typeof W>"u"||!W.length||!W[0]){var q="";for(O in Y=[],M[P])this.terminals_[O]&&O>Vt&&Y.push("'"+this.terminals_[O]+"'");q=x.showPosition?"Parse error on line "+(j+1)+":\n"+x.showPosition()+"\nExpecting "+Y.join(", ")+", got '"+(this.terminals_[b]||b)+"'":"Parse error on line "+(j+1)+": Unexpected "+(b==ht?"end of input":"'"+(this.terminals_[b]||b)+"'"),this.parseError(q,{text:x.match,token:this.terminals_[b]||b,line:x.yylineno,loc:X,expected:Y})}if(W[0]instanceof Array&&W.length>1)throw new Error("Parse Error: multiple actions possible at state: "+P+", token: "+b);switch(W[0]){case 1:l.push(b),p.push(x.yytext),o.push(x.yylloc),l.push(W[1]),b=null,D?(b=D,D=null):(ot=x.yyleng,_=x.yytext,j=x.yylineno,X=x.yylloc,ct>0&&ct--);break;case 2:if(S=this.productions_[W[1]][1],A.$=p[p.length-S],A._$={first_line:o[o.length-(S||1)].first_line,last_line:o[o.length-1].last_line,first_column:o[o.length-(S||1)].first_column,last_column:o[o.length-1].last_column},Lt&&(A._$.range=[o[o.length-(S||1)].range[0],o[o.length-1].range[1]]),typeof(Z=this.performAction.apply(A,[_,ot,j,$.yy,W[1],p,o].concat(Ft)))<"u")return Z;S&&(l=l.slice(0,-1*S*2),p=p.slice(0,-1*S),o=o.slice(0,-1*S)),l.push(this.productions_[W[1]][0]),p.push(A.$),o.push(A._$),yt=M[l[l.length-2]][l[l.length-1]],l.push(yt);break;case 3:return!0}}return!0},"parse")},k=function(){return{EOF:1,parseError:(0,n.eW)(function(a,l){if(!this.yy.parser)throw new Error(a);this.yy.parser.parseError(a,l)},"parseError"),setInput:(0,n.eW)(function(r,a){return this.yy=a||this.yy||{},this._input=r,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:(0,n.eW)(function(){var r=this._input[0];return this.yytext+=r,this.yyleng++,this.offset++,this.match+=r,this.matched+=r,r.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),r},"input"),unput:(0,n.eW)(function(r){var a=r.length,l=r.split(/(?:\r\n?|\n)/g);this._input=r+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-a),this.offset-=a;var y=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),l.length-1&&(this.yylineno-=l.length-1);var p=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:l?(l.length===y.length?this.yylloc.first_column:0)+y[y.length-l.length].length-l[0].length:this.yylloc.first_column-a},this.options.ranges&&(this.yylloc.range=[p[0],p[0]+this.yyleng-a]),this.yyleng=this.yytext.length,this},"unput"),more:(0,n.eW)(function(){return this._more=!0,this},"more"),reject:(0,n.eW)(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:(0,n.eW)(function(r){this.unput(this.match.slice(r))},"less"),pastInput:(0,n.eW)(function(){var r=this.matched.substr(0,this.matched.length-this.match.length);return(r.length>20?"...":"")+r.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:(0,n.eW)(function(){var r=this.match;return r.length<20&&(r+=this._input.substr(0,20-r.length)),(r.substr(0,20)+(r.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:(0,n.eW)(function(){var r=this.pastInput(),a=new Array(r.length+1).join("-");return r+this.upcomingInput()+"\n"+a+"^"},"showPosition"),test_match:(0,n.eW)(function(r,a){var l,y,p;if(this.options.backtrack_lexer&&(p={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&&(p.yylloc.range=this.yylloc.range.slice(0))),(y=r[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=y.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:y?y[y.length-1].length-y[y.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+r[0].length},this.yytext+=r[0],this.match+=r[0],this.matches=r,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(r[0].length),this.matched+=r[0],l=this.performAction.call(this,this.yy,this,a,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),l)return l;if(this._backtrack){for(var o in p)this[o]=p[o];return!1}return!1},"test_match"),next:(0,n.eW)(function(){if(this.done)return this.EOF;var r,a,l,y;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var p=this._currentRules(),o=0;o<p.length;o++)if((l=this._input.match(this.rules[p[o]]))&&(!a||l[0].length>a[0].length)){if(a=l,y=o,this.options.backtrack_lexer){if(!1!==(r=this.test_match(l,p[o])))return r;if(this._backtrack){a=!1;continue}return!1}if(!this.options.flex)break}return a?!1!==(r=this.test_match(a,p[y]))&&r:""===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:(0,n.eW)(function(){return this.next()||this.lex()},"lex"),begin:(0,n.eW)(function(a){this.conditionStack.push(a)},"begin"),popState:(0,n.eW)(function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:(0,n.eW)(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:(0,n.eW)(function(a){return(a=this.conditionStack.length-1-Math.abs(a||0))>=0?this.conditionStack[a]:"INITIAL"},"topState"),pushState:(0,n.eW)(function(a){this.begin(a)},"pushState"),stateStackSize:(0,n.eW)(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:(0,n.eW)(function(a,l,y,p){switch(y){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 18;case 16:return 19;case 17:return":";case 18:return 6;case 19:return"INVALID"}},"anonymous"),rules:[/^(?:%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:#[^\n]*)/i,/^(?:journey\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,/^(?:[^#:\n;]+)/i,/^(?::[^#\n;]+)/i,/^(?::)/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,19],inclusive:!0}}}}();function m(){this.yy={}}return d.lexer=k,(0,n.eW)(m,"Parser"),m.prototype=d,d.Parser=m,new m}();z.parser=z;var dt=z,I="",U=[],L=[],R=[],pt=(0,n.eW)(function(){U.length=0,L.length=0,I="",R.length=0,(0,n.ZH)()},"clear"),ft=(0,n.eW)(function(t){I=t,U.push(t)},"addSection"),gt=(0,n.eW)(function(){return U},"getSections"),mt=(0,n.eW)(function(){let t=Q();let i=0;for(;!t&&i<100;)t=Q(),i++;return L.push(...R),L},"getTasks"),kt=(0,n.eW)(function(){const t=[];return L.forEach(i=>{i.people&&t.push(...i.people)}),[...new Set(t)].sort()},"updateActors"),xt=(0,n.eW)(function(t,e){const i=e.substr(1).split(":");let c=0,s=[];1===i.length?(c=Number(i[0]),s=[]):(c=Number(i[0]),s=i[1].split(","));const u=s.map(f=>f.trim()),h={section:I,type:I,people:u,task:t,score:c};R.push(h)},"addTask"),_t=(0,n.eW)(function(t){const e={section:I,type:I,description:t,task:t,classes:[]};L.push(e)},"addTaskOrg"),Q=(0,n.eW)(function(){const t=(0,n.eW)(function(i){return R[i].processed},"compileTask");let e=!0;for(const[i,c]of R.entries())t(i),e=e&&c.processed;return e},"compileTasks"),bt=(0,n.eW)(function(){return kt()},"getActors"),tt={getConfig:(0,n.eW)(()=>(0,n.nV)().journey,"getConfig"),clear:pt,setDiagramTitle:n.g2,getDiagramTitle:n.Kr,setAccTitle:n.GN,getAccTitle:n.eu,setAccDescription:n.U$,getAccDescription:n.Mx,addSection:ft,getSections:gt,getTasks:mt,addTask:xt,addTaskOrg:_t,getActors:bt},wt=(0,n.eW)(t=>`.label {\n font-family: ${t.fontFamily};\n color: ${t.textColor};\n }\n .mouth {\n stroke: #666;\n }\n\n line {\n stroke: ${t.textColor}\n }\n\n .legend {\n fill: ${t.textColor};\n font-family: ${t.fontFamily};\n }\n\n .label text {\n fill: #333;\n }\n .label {\n color: ${t.textColor}\n }\n\n .face {\n ${t.faceColor?`fill: ${t.faceColor}`:"fill: #FFF8DC"};\n stroke: #999;\n }\n\n .node rect,\n .node circle,\n .node ellipse,\n .node polygon,\n .node path {\n fill: ${t.mainBkg};\n stroke: ${t.nodeBorder};\n stroke-width: 1px;\n }\n\n .node .label {\n text-align: center;\n }\n .node.clickable {\n cursor: pointer;\n }\n\n .arrowheadPath {\n fill: ${t.arrowheadColor};\n }\n\n .edgePath .path {\n stroke: ${t.lineColor};\n stroke-width: 1.5px;\n }\n\n .flowchart-link {\n stroke: ${t.lineColor};\n fill: none;\n }\n\n .edgeLabel {\n background-color: ${t.edgeLabelBackground};\n rect {\n opacity: 0.5;\n }\n text-align: center;\n }\n\n .cluster rect {\n }\n\n .cluster text {\n fill: ${t.titleColor};\n }\n\n div.mermaidTooltip {\n position: absolute;\n text-align: center;\n max-width: 200px;\n padding: 2px;\n font-family: ${t.fontFamily};\n font-size: 12px;\n background: ${t.tertiaryColor};\n border: 1px solid ${t.border2};\n border-radius: 2px;\n pointer-events: none;\n z-index: 100;\n }\n\n .task-type-0, .section-type-0 {\n ${t.fillType0?`fill: ${t.fillType0}`:""};\n }\n .task-type-1, .section-type-1 {\n ${t.fillType0?`fill: ${t.fillType1}`:""};\n }\n .task-type-2, .section-type-2 {\n ${t.fillType0?`fill: ${t.fillType2}`:""};\n }\n .task-type-3, .section-type-3 {\n ${t.fillType0?`fill: ${t.fillType3}`:""};\n }\n .task-type-4, .section-type-4 {\n ${t.fillType0?`fill: ${t.fillType4}`:""};\n }\n .task-type-5, .section-type-5 {\n ${t.fillType0?`fill: ${t.fillType5}`:""};\n }\n .task-type-6, .section-type-6 {\n ${t.fillType0?`fill: ${t.fillType6}`:""};\n }\n .task-type-7, .section-type-7 {\n ${t.fillType0?`fill: ${t.fillType7}`:""};\n }\n\n .actor-0 {\n ${t.actor0?`fill: ${t.actor0}`:""};\n }\n .actor-1 {\n ${t.actor1?`fill: ${t.actor1}`:""};\n }\n .actor-2 {\n ${t.actor2?`fill: ${t.actor2}`:""};\n }\n .actor-3 {\n ${t.actor3?`fill: ${t.actor3}`:""};\n }\n .actor-4 {\n ${t.actor4?`fill: ${t.actor4}`:""};\n }\n .actor-5 {\n ${t.actor5?`fill: ${t.actor5}`:""};\n }\n`,"getStyles"),G=(0,n.eW)(function(t,e){return(0,V.Mu)(t,e)},"drawRect"),Wt=(0,n.eW)(function(t,e){const c=t.append("circle").attr("cx",e.cx).attr("cy",e.cy).attr("class","face").attr("r",15).attr("stroke-width",2).attr("overflow","visible"),s=t.append("g");function u(d){const k=(0,F.Nb1)().startAngle(Math.PI/2).endAngle(Math.PI/2*3).innerRadius(7.5).outerRadius(6.8181818181818175);d.append("path").attr("class","mouth").attr("d",k).attr("transform","translate("+e.cx+","+(e.cy+2)+")")}function h(d){const k=(0,F.Nb1)().startAngle(3*Math.PI/2).endAngle(Math.PI/2*5).innerRadius(7.5).outerRadius(6.8181818181818175);d.append("path").attr("class","mouth").attr("d",k).attr("transform","translate("+e.cx+","+(e.cy+7)+")")}function f(d){d.append("line").attr("class","mouth").attr("stroke",2).attr("x1",e.cx-5).attr("y1",e.cy+7).attr("x2",e.cx+5).attr("y2",e.cy+7).attr("class","mouth").attr("stroke-width","1px").attr("stroke","#666")}return s.append("circle").attr("cx",e.cx-5).attr("cy",e.cy-5).attr("r",1.5).attr("stroke-width",2).attr("fill","#666").attr("stroke","#666"),s.append("circle").attr("cx",e.cx+5).attr("cy",e.cy-5).attr("r",1.5).attr("stroke-width",2).attr("fill","#666").attr("stroke","#666"),(0,n.eW)(u,"smile"),(0,n.eW)(h,"sad"),(0,n.eW)(f,"ambivalent"),e.score>3?u(s):e.score<3?h(s):f(s),c},"drawFace"),et=(0,n.eW)(function(t,e){const i=t.append("circle");return i.attr("cx",e.cx),i.attr("cy",e.cy),i.attr("class","actor-"+e.pos),i.attr("fill",e.fill),i.attr("stroke",e.stroke),i.attr("r",e.r),void 0!==i.class&&i.attr("class",i.class),void 0!==e.title&&i.append("title").text(e.title),i},"drawCircle"),rt=(0,n.eW)(function(t,e){return(0,V.yU)(t,e)},"drawText"),Tt=(0,n.eW)(function(t,e){function i(s,u,h,f,d){return s+","+u+" "+(s+h)+","+u+" "+(s+h)+","+(u+f-d)+" "+(s+h-1.2*d)+","+(u+f)+" "+s+","+(u+f)}(0,n.eW)(i,"genPoints");const c=t.append("polygon");c.attr("points",i(e.x,e.y,50,20,7)),c.attr("class","labelBox"),e.y=e.y+e.labelMargin,e.x=e.x+.5*e.labelMargin,rt(t,e)},"drawLabel"),Mt=(0,n.eW)(function(t,e,i){const c=t.append("g"),s=(0,V.kc)();s.x=e.x,s.y=e.y,s.fill=e.fill,s.width=i.width*e.taskCount+i.diagramMarginX*(e.taskCount-1),s.height=i.height,s.class="journey-section section-type-"+e.num,s.rx=3,s.ry=3,G(c,s),st(i)(e.text,c,s.x,s.y,s.width,s.height,{class:"journey-section section-type-"+e.num},i,e.colour)},"drawSection"),nt=-1,St=(0,n.eW)(function(t,e,i){const c=e.x+i.width/2,s=t.append("g");nt++;s.append("line").attr("id","task"+nt).attr("x1",c).attr("y1",e.y).attr("x2",c).attr("y2",450).attr("class","task-line").attr("stroke-width","1px").attr("stroke-dasharray","4 2").attr("stroke","#666"),Wt(s,{cx:c,cy:300+30*(5-e.score),score:e.score});const h=(0,V.kc)();h.x=e.x,h.y=e.y,h.fill=e.fill,h.width=i.width,h.height=i.height,h.class="task task-type-"+e.num,h.rx=3,h.ry=3,G(s,h);let f=e.x+14;e.people.forEach(d=>{const k=e.actors[d].color,m={cx:f,cy:e.y,r:7,fill:k,stroke:"#000",title:d,pos:e.actors[d].position};et(s,m),f+=10}),st(i)(e.task,s,h.x,h.y,h.width,h.height,{class:"task"},i,e.colour)},"drawTask"),Et=(0,n.eW)(function(t,e){(0,V.O)(t,e)},"drawBackgroundRect"),st=function(){function t(s,u,h,f,d,k,m,g){c(u.append("text").attr("x",h+d/2).attr("y",f+k/2+5).style("font-color",g).style("text-anchor","middle").text(s),m)}function e(s,u,h,f,d,k,m,g,r){const{taskFontSize:a,taskFontFamily:l}=g,y=s.split(/<br\s*\/?>/gi);for(let p=0;p<y.length;p++){const o=p*a-a*(y.length-1)/2,M=u.append("text").attr("x",h+d/2).attr("y",f).attr("fill",r).style("text-anchor","middle").style("font-size",a).style("font-family",l);M.append("tspan").attr("x",h+d/2).attr("dy",o).text(y[p]),M.attr("y",f+k/2).attr("dominant-baseline","central").attr("alignment-baseline","central"),c(M,m)}}function i(s,u,h,f,d,k,m,g){const r=u.append("switch"),l=r.append("foreignObject").attr("x",h).attr("y",f).attr("width",d).attr("height",k).attr("position","fixed").append("xhtml:div").style("display","table").style("height","100%").style("width","100%");l.append("div").attr("class","label").style("display","table-cell").style("text-align","center").style("vertical-align","middle").text(s),e(s,r,h,f,d,k,m,g),c(l,m)}function c(s,u){for(const h in u)h in u&&s.attr(h,u[h])}return(0,n.eW)(t,"byText"),(0,n.eW)(e,"byTspan"),(0,n.eW)(i,"byFo"),(0,n.eW)(c,"_setTextAttrs"),function(s){return"fo"===s.textPlacement?i:"old"===s.textPlacement?t:e}}(),B={drawRect:G,drawCircle:et,drawSection:Mt,drawText:rt,drawLabel:Tt,drawTask:St,drawBackgroundRect:Et,initGraphics:(0,n.eW)(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")},Pt=(0,n.eW)(function(t){Object.keys(t).forEach(function(i){N[i]=t[i]})},"setConf"),T={};function it(t){const e=(0,n.nV)().journey;let i=60;Object.keys(T).forEach(c=>{const s=T[c].color,u={cx:20,cy:i,r:7,fill:s,stroke:"#000",pos:T[c].position};B.drawCircle(t,u);const h={x:40,y:i+7,fill:"#666",text:c,textMargin:5|e.boxTextMargin};B.drawText(t,h),i+=20})}(0,n.eW)(it,"drawActorLegend");var N=(0,n.nV)().journey,E=N.leftMargin,It=(0,n.eW)(function(t,e,i,c){const s=(0,n.nV)().journey,u=(0,n.nV)().securityLevel;let h;"sandbox"===u&&(h=(0,F.Ys)("#i"+e));const f="sandbox"===u?(0,F.Ys)(h.nodes()[0].contentDocument.body):(0,F.Ys)("body");w.init();const d=f.select("#"+e);B.initGraphics(d);const k=c.db.getTasks(),m=c.db.getDiagramTitle(),g=c.db.getActors();for(const o in T)delete T[o];let r=0;g.forEach(o=>{T[o]={color:s.actorColours[r%s.actorColours.length],position:r},r++}),it(d),w.insert(0,0,E,50*Object.keys(T).length),At(d,k,0);const a=w.getBounds();m&&d.append("text").text(m).attr("x",E).attr("font-size","4ex").attr("font-weight","bold").attr("y",25);const l=a.stopy-a.starty+2*s.diagramMarginY,y=E+a.stopx+2*s.diagramMarginX;(0,n.v2)(d,l,y,s.useMaxWidth),d.append("line").attr("x1",E).attr("y1",4*s.height).attr("x2",y-E-4).attr("y2",4*s.height).attr("stroke-width",4).attr("stroke","black").attr("marker-end","url(#arrowhead)");const p=m?70:0;d.attr("viewBox",`${a.startx} -25 ${y} ${l+p}`),d.attr("preserveAspectRatio","xMinYMin meet"),d.attr("height",l+p+25)},"draw"),w={data:{startx:void 0,stopx:void 0,starty:void 0,stopy:void 0},verticalPos:0,sequenceItems:[],init:(0,n.eW)(function(){this.sequenceItems=[],this.data={startx:void 0,stopx:void 0,starty:void 0,stopy:void 0},this.verticalPos=0},"init"),updateVal:(0,n.eW)(function(t,e,i,c){void 0===t[e]?t[e]=i:t[e]=c(i,t[e])},"updateVal"),updateBounds:(0,n.eW)(function(t,e,i,c){const s=(0,n.nV)().journey,u=this;let h=0;function f(d){return(0,n.eW)(function(m){h++;const g=u.sequenceItems.length-h+1;u.updateVal(m,"starty",e-g*s.boxMargin,Math.min),u.updateVal(m,"stopy",c+g*s.boxMargin,Math.max),u.updateVal(w.data,"startx",t-g*s.boxMargin,Math.min),u.updateVal(w.data,"stopx",i+g*s.boxMargin,Math.max),"activation"!==d&&(u.updateVal(m,"startx",t-g*s.boxMargin,Math.min),u.updateVal(m,"stopx",i+g*s.boxMargin,Math.max),u.updateVal(w.data,"starty",e-g*s.boxMargin,Math.min),u.updateVal(w.data,"stopy",c+g*s.boxMargin,Math.max))},"updateItemBounds")}(0,n.eW)(f,"updateFn"),this.sequenceItems.forEach(f())},"updateBounds"),insert:(0,n.eW)(function(t,e,i,c){const s=Math.min(t,i),u=Math.max(t,i),h=Math.min(e,c),f=Math.max(e,c);this.updateVal(w.data,"startx",s,Math.min),this.updateVal(w.data,"starty",h,Math.min),this.updateVal(w.data,"stopx",u,Math.max),this.updateVal(w.data,"stopy",f,Math.max),this.updateBounds(s,h,u,f)},"insert"),bumpVerticalPos:(0,n.eW)(function(t){this.verticalPos=this.verticalPos+t,this.data.stopy=this.verticalPos},"bumpVerticalPos"),getVerticalPos:(0,n.eW)(function(){return this.verticalPos},"getVerticalPos"),getBounds:(0,n.eW)(function(){return this.data},"getBounds")},H=N.sectionFills,at=N.sectionColours,At=(0,n.eW)(function(t,e,i){const c=(0,n.nV)().journey;let s="";const h=i+(2*c.height+c.diagramMarginY);let f=0,d="#CCC",k="black",m=0;for(const[g,r]of e.entries()){if(s!==r.section){d=H[f%H.length],m=f%H.length,k=at[f%at.length];let l=0;const y=r.section;for(let o=g;o<e.length&&e[o].section==y;o++)l+=1;const p={x:g*c.taskMargin+g*c.width+E,y:50,text:r.section,fill:d,num:m,colour:k,taskCount:l};B.drawSection(t,p,c),s=r.section,f++}const a=r.people.reduce((l,y)=>(T[y]&&(l[y]=T[y]),l),{});r.x=g*c.taskMargin+g*c.width+E,r.y=h,r.width=c.diagramMarginX,r.height=c.diagramMarginY,r.colour=k,r.fill=d,r.num=m,r.actors=a,B.drawTask(t,r,c),w.insert(r.x,r.y,r.x+r.width+c.taskMargin,450)}},"drawTasks"),lt={setConf:Pt,draw:It},Ct={parser:dt,db:tt,renderer:lt,styles:wt,init:(0,n.eW)(t=>{lt.setConf(t.journey),tt.clear()},"init")}}}]); |