import{g as t,h as e,y as n,x as i}from"./chunk-WONJCSFZ-v7XpFD4T.js";import{o as a}from"./chunk-ZZTKAOFA-H-hr4y7W.js";import{m as r,$ as s,G as o,U as l,H as c,e as h,j as u,a as p,i as y,W as d,N as f,a9 as g}from"./index-BDq3hoFe.js";var m=function(){var t=r(function(t,e,n,i){for(n=n||{},i=t.length;i--;n[t[i]]=e);return n},"o"),e=[6,8,10,11,12,14,16,17,18],n=[1,9],i=[1,10],a=[1,11],s=[1,12],o=[1,13],l=[1,14],c={trace:r(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:r(function(t,e,n,i,a,r,s){var o=r.length-1;switch(a){case 1:return r[o-1];case 2:case 6:case 7:this.$=[];break;case 3:r[o-1].push(r[o]),this.$=r[o-1];break;case 4:case 5:this.$=r[o];break;case 8:i.setDiagramTitle(r[o].substr(6)),this.$=r[o].substr(6);break;case 9:this.$=r[o].trim(),i.setAccTitle(this.$);break;case 10:case 11:this.$=r[o].trim(),i.setAccDescription(this.$);break;case 12:i.addSection(r[o].substr(8)),this.$=r[o].substr(8);break;case 13:i.addTask(r[o-1],r[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:n,12:i,14:a,16:s,17:o,18:l},t(e,[2,7],{1:[2,1]}),t(e,[2,3]),{9:15,11:n,12:i,14:a,16:s,17:o,18:l},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:r(function(t,e){if(!e.recoverable){var n=new Error(t);throw n.hash=e,n}this.trace(t)},"parseError"),parse:r(function(t){var e=this,n=[0],i=[],a=[null],s=[],o=this.table,l="",c=0,h=0,u=s.slice.call(arguments,1),p=Object.create(this.lexer),y={yy:{}};for(var d in this.yy)Object.prototype.hasOwnProperty.call(this.yy,d)&&(y.yy[d]=this.yy[d]);p.setInput(t,y.yy),y.yy.lexer=p,y.yy.parser=this,typeof p.yylloc>"u"&&(p.yylloc={});var f=p.yylloc;s.push(f);var g=p.options&&p.options.ranges;function m(){var t;return"number"!=typeof(t=i.pop()||p.lex()||1)&&(t instanceof Array&&(t=(i=t).pop()),t=e.symbols_[t]||t),t}"function"==typeof y.yy.parseError?this.parseError=y.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError,r(function(t){n.length=n.length-2*t,a.length=a.length-t,s.length=s.length-t},"popStack"),r(m,"lex");for(var x,k,_,b,w,v,$,T,M,S={};;){if(_=n[n.length-1],this.defaultActions[_]?b=this.defaultActions[_]:((null===x||typeof x>"u")&&(x=m()),b=o[_]&&o[_][x]),typeof b>"u"||!b.length||!b[0]){var C="";for(v in M=[],o[_])this.terminals_[v]&&v>2&&M.push("'"+this.terminals_[v]+"'");C=p.showPosition?"Parse error on line "+(c+1)+":\n"+p.showPosition()+"\nExpecting "+M.join(", ")+", got '"+(this.terminals_[x]||x)+"'":"Parse error on line "+(c+1)+": Unexpected "+(1==x?"end of input":"'"+(this.terminals_[x]||x)+"'"),this.parseError(C,{text:p.match,token:this.terminals_[x]||x,line:p.yylineno,loc:f,expected:M})}if(b[0]instanceof Array&&b.length>1)throw new Error("Parse Error: multiple actions possible at state: "+_+", token: "+x);switch(b[0]){case 1:n.push(x),a.push(p.yytext),s.push(p.yylloc),n.push(b[1]),x=null,k?(x=k,k=null):(h=p.yyleng,l=p.yytext,c=p.yylineno,f=p.yylloc);break;case 2:if($=this.productions_[b[1]][1],S.$=a[a.length-$],S._$={first_line:s[s.length-($||1)].first_line,last_line:s[s.length-1].last_line,first_column:s[s.length-($||1)].first_column,last_column:s[s.length-1].last_column},g&&(S._$.range=[s[s.length-($||1)].range[0],s[s.length-1].range[1]]),typeof(w=this.performAction.apply(S,[l,h,c,y.yy,b[1],a,s].concat(u)))<"u")return w;$&&(n=n.slice(0,-1*$*2),a=a.slice(0,-1*$),s=s.slice(0,-1*$)),n.push(this.productions_[b[1]][0]),a.push(S.$),s.push(S._$),T=o[n[n.length-2]][n[n.length-1]],n.push(T);break;case 3:return!0}}return!0},"parse")},h=function(){var t={EOF:1,parseError:r(function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)},"parseError"),setInput:r(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:r(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:r(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 a=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column: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=[a[0],a[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this},"unput"),more:r(function(){return this._more=!0,this},"more"),reject:r(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:r(function(t){this.unput(this.match.slice(t))},"less"),pastInput:r(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:r(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:r(function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"},"showPosition"),test_match:r(function(t,e){var n,i,a;if(this.options.backtrack_lexer&&(a={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(a.yylloc.range=this.yylloc.range.slice(0))),(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 r in a)this[r]=a[r];return!1}return!1},"test_match"),next:r(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 a=this._currentRules(),r=0;re[0].length)){if(e=n,i=r,this.options.backtrack_lexer){if(!1!==(t=this.test_match(n,a[r])))return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?!1!==(t=this.test_match(e,a[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:r(function(){return this.next()||this.lex()},"lex"),begin:r(function(t){this.conditionStack.push(t)},"begin"),popState:r(function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:r(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:r(function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"},"topState"),pushState:r(function(t){this.begin(t)},"pushState"),stateStackSize:r(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:r(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 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}}};return t}();function u(){this.yy={}}return c.lexer=h,r(u,"Parser"),u.prototype=c,c.Parser=u,new u}();m.parser=m;var x=m,k="",_=[],b=[],w=[],v=r(function(){_.length=0,b.length=0,k="",w.length=0,f()},"clear"),$=r(function(t){k=t,_.push(t)},"addSection"),T=r(function(){return _},"getSections"),M=r(function(){let t=A(),e=0;for(;!t&&e<100;)t=A(),e++;return b.push(...w),b},"getTasks"),S=r(function(){let t=[];return b.forEach(e=>{e.people&&t.push(...e.people)}),[...new Set(t)].sort()},"updateActors"),C=r(function(t,e){let n=e.substr(1).split(":"),i=0,a=[];1===n.length?(i=Number(n[0]),a=[]):(i=Number(n[0]),a=n[1].split(","));let r=a.map(t=>t.trim()),s={section:k,type:k,people:r,task:t,score:i};w.push(s)},"addTask"),E=r(function(t){let e={section:k,type:k,description:t,task:t,classes:[]};b.push(e)},"addTaskOrg"),A=r(function(){let t=r(function(t){return w[t].processed},"compileTask"),e=!0;for(let[n,i]of w.entries())t(n),e=e&&i.processed;return e},"compileTasks"),I=r(function(){return S()},"getActors"),P={getConfig:r(()=>p().journey,"getConfig"),clear:v,setDiagramTitle:u,getDiagramTitle:h,setAccTitle:c,getAccTitle:l,setAccDescription:o,getAccDescription:s,addSection:$,getSections:T,getTasks:M,addTask:C,addTaskOrg:E,getActors:I},j=r(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 ${a()}\n`,"getStyles"),F=r(function(t,e){return i(t,e)},"drawRect"),V=r(function(t,e){let n=t.append("circle").attr("cx",e.cx).attr("cy",e.cy).attr("class","face").attr("r",15).attr("stroke-width",2).attr("overflow","visible"),i=t.append("g");function a(t){let n=g().startAngle(Math.PI/2).endAngle(Math.PI/2*3).innerRadius(7.5).outerRadius(6.8181818181818175);t.append("path").attr("class","mouth").attr("d",n).attr("transform","translate("+e.cx+","+(e.cy+2)+")")}function s(t){let n=g().startAngle(3*Math.PI/2).endAngle(Math.PI/2*5).innerRadius(7.5).outerRadius(6.8181818181818175);t.append("path").attr("class","mouth").attr("d",n).attr("transform","translate("+e.cx+","+(e.cy+7)+")")}function o(t){t.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 i.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"),i.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"),r(a,"smile"),r(s,"sad"),r(o,"ambivalent"),e.score>3?a(i):e.score<3?s(i):o(i),n},"drawFace"),B=r(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"),O=r(function(t,e){return n(t,e)},"drawText"),L=r(function(t,e){function n(t,e,n,i,a){return t+","+e+" "+(t+n)+","+e+" "+(t+n)+","+(e+i-a)+" "+(t+n-1.2*a)+","+(e+i)+" "+t+","+(e+i)}r(n,"genPoints");let i=t.append("polygon");i.attr("points",n(e.x,e.y,50,20,7)),i.attr("class","labelBox"),e.y=e.y+e.labelMargin,e.x=e.x+.5*e.labelMargin,O(t,e)},"drawLabel"),R=r(function(t,n,i){let a=t.append("g"),r=e();r.x=n.x,r.y=n.y,r.fill=n.fill,r.width=i.width*n.taskCount+i.diagramMarginX*(n.taskCount-1),r.height=i.height,r.class="journey-section section-type-"+n.num,r.rx=3,r.ry=3,F(a,r),W(i)(n.text,a,r.x,r.y,r.width,r.height,{class:"journey-section section-type-"+n.num},i,n.colour)},"drawSection"),N=-1,D=r(function(t,n,i){let a=n.x+i.width/2,r=t.append("g");N++,r.append("line").attr("id","task"+N).attr("x1",a).attr("y1",n.y).attr("x2",a).attr("y2",450).attr("class","task-line").attr("stroke-width","1px").attr("stroke-dasharray","4 2").attr("stroke","#666"),V(r,{cx:a,cy:300+30*(5-n.score),score:n.score});let s=e();s.x=n.x,s.y=n.y,s.fill=n.fill,s.width=i.width,s.height=i.height,s.class="task task-type-"+n.num,s.rx=3,s.ry=3,F(r,s);let o=n.x+14;n.people.forEach(t=>{let e=n.actors[t].color,i={cx:o,cy:n.y,r:7,fill:e,stroke:"#000",title:t,pos:n.actors[t].position};B(r,i),o+=10}),W(i)(n.task,r,s.x,s.y,s.width,s.height,{class:"task"},i,n.colour)},"drawTask"),z=r(function(e,n){t(e,n)},"drawBackgroundRect"),W=function(){function t(t,e,n,a,r,s,o,l){i(e.append("text").attr("x",n+r/2).attr("y",a+s/2+5).style("font-color",l).style("text-anchor","middle").text(t),o)}function e(t,e,n,a,r,s,o,l,c){let{taskFontSize:h,taskFontFamily:u}=l,p=t.split(//gi);for(let t=0;t{let r=X[a].color,s={cx:20,cy:i,r:7,fill:r,stroke:"#000",pos:X[a].position};q.drawCircle(t,s);let o=t.append("text").attr("visibility","hidden").text(a),l=o.node().getBoundingClientRect().width;o.remove();let c=[];if(l<=n)c=[a];else{let e=a.split(" "),i="";o=t.append("text").attr("visibility","hidden"),e.forEach(t=>{let e=i?`${i} ${t}`:t;if(o.text(e),o.node().getBoundingClientRect().width>n){if(i&&c.push(i),i=t,o.text(t),o.node().getBoundingClientRect().width>n){let e="";for(let i of t)e+=i,o.text(e+"-"),o.node().getBoundingClientRect().width>n&&(c.push(e.slice(0,-1)+"-"),e=i);i=e}}else i=e}),i&&c.push(i),o.remove()}c.forEach((n,a)=>{let r={x:40,y:i+7+20*a,fill:"#666",text:n,textMargin:e.boxTextMargin??5},s=q.drawText(t,r).node().getBoundingClientRect().width;s>Z&&s>e.leftMargin-s&&(Z=s)}),i+=Math.max(20,20*c.length)})}r(U,"drawActorLegend");var H=p().journey,J=0,K=r(function(t,e,n,i){let a,r=p(),s=r.journey.titleColor,o=r.journey.titleFontSize,l=r.journey.titleFontFamily,c=r.securityLevel;"sandbox"===c&&(a=y("#i"+e));let h=y("sandbox"===c?a.nodes()[0].contentDocument.body:"body");Q.init();let u=h.select("#"+e);q.initGraphics(u);let f=i.db.getTasks(),g=i.db.getDiagramTitle(),m=i.db.getActors();for(let t in X)delete X[t];let x=0;m.forEach(t=>{X[t]={color:H.actorColours[x%H.actorColours.length],position:x},x++}),U(u),J=H.leftMargin+Z,Q.insert(0,0,J,50*Object.keys(X).length),nt(u,f,0);let k=Q.getBounds();g&&u.append("text").text(g).attr("x",J).attr("font-size",o).attr("font-weight","bold").attr("y",25).attr("fill",s).attr("font-family",l);let _=k.stopy-k.starty+2*H.diagramMarginY,b=J+k.stopx+2*H.diagramMarginX;d(u,_,b,H.useMaxWidth),u.append("line").attr("x1",J).attr("y1",4*H.height).attr("x2",b-J-4).attr("y2",4*H.height).attr("stroke-width",4).attr("stroke","black").attr("marker-end","url(#arrowhead)");let w=g?70:0;u.attr("viewBox",`${k.startx} -25 ${b} ${_+w}`),u.attr("preserveAspectRatio","xMinYMin meet"),u.attr("height",_+w+25)},"draw"),Q={data:{startx:void 0,stopx:void 0,starty:void 0,stopy:void 0},verticalPos:0,sequenceItems:[],init:r(function(){this.sequenceItems=[],this.data={startx:void 0,stopx:void 0,starty:void 0,stopy:void 0},this.verticalPos=0},"init"),updateVal:r(function(t,e,n,i){void 0===t[e]?t[e]=n:t[e]=i(n,t[e])},"updateVal"),updateBounds:r(function(t,e,n,i){let a=p().journey,s=this,o=0;function l(l){return r(function(r){o++;let c=s.sequenceItems.length-o+1;s.updateVal(r,"starty",e-c*a.boxMargin,Math.min),s.updateVal(r,"stopy",i+c*a.boxMargin,Math.max),s.updateVal(Q.data,"startx",t-c*a.boxMargin,Math.min),s.updateVal(Q.data,"stopx",n+c*a.boxMargin,Math.max),"activation"!==l&&(s.updateVal(r,"startx",t-c*a.boxMargin,Math.min),s.updateVal(r,"stopx",n+c*a.boxMargin,Math.max),s.updateVal(Q.data,"starty",e-c*a.boxMargin,Math.min),s.updateVal(Q.data,"stopy",i+c*a.boxMargin,Math.max))},"updateItemBounds")}r(l,"updateFn"),this.sequenceItems.forEach(l())},"updateBounds"),insert:r(function(t,e,n,i){let a=Math.min(t,n),r=Math.max(t,n),s=Math.min(e,i),o=Math.max(e,i);this.updateVal(Q.data,"startx",a,Math.min),this.updateVal(Q.data,"starty",s,Math.min),this.updateVal(Q.data,"stopx",r,Math.max),this.updateVal(Q.data,"stopy",o,Math.max),this.updateBounds(a,s,r,o)},"insert"),bumpVerticalPos:r(function(t){this.verticalPos=this.verticalPos+t,this.data.stopy=this.verticalPos},"bumpVerticalPos"),getVerticalPos:r(function(){return this.verticalPos},"getVerticalPos"),getBounds:r(function(){return this.data},"getBounds")},tt=H.sectionFills,et=H.sectionColours,nt=r(function(t,e,n){let i=p().journey,a="",r=n+(2*i.height+i.diagramMarginY),s=0,o="#CCC",l="black",c=0;for(let[n,h]of e.entries()){if(a!==h.section){o=tt[s%tt.length],c=s%tt.length,l=et[s%et.length];let r=0,u=h.section;for(let t=n;t(X[e]&&(t[e]=X[e]),t),{});h.x=n*i.taskMargin+n*i.width+J,h.y=r,h.width=i.diagramMarginX,h.height=i.diagramMarginY,h.colour=l,h.fill=o,h.num=c,h.actors=u,q.drawTask(t,h,i),Q.insert(h.x,h.y,h.x+h.width+i.taskMargin,450)}},"drawTasks"),it={setConf:G,draw:K},at={parser:x,db:P,renderer:it,styles:j,init:r(t=>{it.setConf(t.journey),P.clear()},"init")};export{at as diagram}; //# sourceMappingURL=journeyDiagram-E42M6OD5-PpUj7TTA.js.map