Lines Matching refs:Jk

710 `);super(`Parsing failed: ${e} ${r}`),this.result=t}static{Tt(this,"MermaidParseError")}}});function cf(t,e){t.accDescr&&e.setAccDescription?.(t.accDescr),t.accTitle&&e.setAccTitle?.(t.accTitle),t.title&&e.setDiagramTitle?.(t.title)}var sx=R(()=>{"use strict";o(cf,"populateCommonDb")});var Hr,Zk=R(()=>{"use strict";Hr={NORMAL:0,REVERSE:1,HIGHLIGHT:2,MERGE:3,CHERRY_PICK:4}});var uf,Jk=R(()=>{"use strict";uf=class{constructor(e){this.init=e;this.records=this.init()}static{o(this,"ImperativeState")}reset(){this.records=this.init()}}});function kI(){return J_({length:7})}function $Pe(t,e){let r=Object.create(null);return t.reduce((n,i)=>{let a=e(i);return r[a]||(r[a]=!0,n.push(i)),n},[])}function Sle(t,e,r){let n=t.indexOf(e);n===-1?t.push(r):t.splice(n,1,r)}function _le(t){let e=t.reduce((i,a)=>i.seq>a.seq?i:a,t[0]),r="";t.forEach(function(i){i===e?r+="	*":r+="	|"});let n=[r,e.id,e.seq];for(let i in pt.records.branches)pt.records.branches.get(i)===e.id&&n.push(i);if(V.debug(n.join(" ")),e.parents&&e.parents.length==2&&e.parents[0]&&e.parents[1]){let i=pt.records.commits.get(e.parents[0]);Sle(t,e,i),e.parents[1]&&t.push(pt.records.commits.get(e.parents[1]))}else{if(e.parents.length==0)return;if(e.parents[0]){let i=pt.records.commits.get(e.parents[0]);Sle(t,e,i)}}t=$Pe(t,i=>i.id),_le(t)}var GPe,k0,pt,VPe,UPe,HPe,YPe,WPe,qPe,XPe,Ale,jPe,KPe,QPe,ZPe,JPe,Lle,eBe,tBe,rBe,eE,EI=R(()=>{"use strict";ut();xr();qs();rr();bi();Zk();Jk();sl();GPe=mr.gitGraph,k0=o(()=>Ts({...GPe,...Or().gitGraph}),"getConfig"),pt=new uf(()=>{let t=k0(),e=t.mainBranchName,r=t.mainBranchOrder;return{mainBranchName:e,commits:new Map,head:null,branchConfig:new Map([[e,{name:e,order:r}]]),branches:new Map([[e,null]]),currBranch:e,direction:"LR",seq:0,options:{}}});o(kI,"getID");o($Pe,"uniqBy");VPe=o(function(t){pt.records.direction=t},"setDirection"),UPe=o(function(t){V.debug("options str",t),t=t?.trim(),t=t||"{}";try{pt.records.options=JSON.parse(t)}catch(e){V.error("error while parsing gitGraph options",e.message)}},"setOptions"),HPe=o(function(){return pt.records.options},"getOptions"),YPe=o(function(t){let e=t.msg,r=t.id,n=t.type,i=t.tags;V.info("commit",e,r,n,i),V.debug("Entering commit:",e,r,n,i);let a=k0();r=We.sanitizeText(r,a),e=We.sanitizeText(e,a),i=i?.map(l=>We.sanitizeText(l,a));let s={id:r||pt.records.seq+"-"+kI(),message:e,seq:pt.records.seq++,type:n??Hr.NORMAL,tags:i??[],parents:pt.records.head==null?[]:[pt.records.head.id],branch:pt.records.currBranch};pt.records.head=s,V.info("main branch",a.mainBranchName),pt.records.commits.set(s.id,s),pt.records.branches.set(pt.records.currBranch,s.id),V.debug("in pushCommit "+s.id)},"commit"),WPe=o(function(t){let e=t.name,r=t.order;if(e=We.sanitizeText(e,k0()),pt.records.branches.has(e))throw new Error(`Trying to create an existing branch. (Help: Either use a new name if you want create a new branch or try using "checkout ${e}")`);pt.records.branches.set(e,pt.records.head!=null?pt.records.head.id:null),pt.records.branchConfig.set(e,{name:e,order:r}),Ale(e),V.debug("in createBranch")},"branch"),qPe=o(t=>{let e=t.branch,r=t.id,n=t.type,i=t.tags,a=k0();e=We.sanitizeText(e,a),r&&(r=We.sanitizeText(r,a));let s=pt.records.branches.get(pt.records.currBranch),l=pt.records.branches.get(e),u=s?pt.records.commits.get(s):void 0,h=l?pt.records.commits.get(l):void 0;if(u&&h&&u.branch===e)throw new Error(`Cannot merge branch '${e}' into itself.`);if(pt.records.currBranch===e){let p=new Error('Incorrect usage of "merge". Cannot merge a branch to itself');throw p.hash={text:`merge ${e}`,token:`merge ${e}`,expected:["branch abc"]},p}if(u===void 0||!u){let p=new Error(`Incorrect usage of "merge". Current branch (${pt.records.currBranch})has no commits`);throw p.hash={text:`merge ${e}`,token:`merge ${e}`,expected:["commit"]},p}if(!pt.records.branches.has(e)){let p=new Error('Incorrect usage of "merge". Branch to be merged ('+e+") does not exist");throw p.hash={text:`merge ${e}`,token:`merge ${e}`,expected:[`branch ${e}`]},p}if(h===void 0||!h){let p=new Error('Incorrect usage of "merge". Branch to be merged ('+e+") has no commits");throw p.hash={text:`merge ${e}`,token:`merge ${e}`,expected:['"commit"']},p}if(u===h){let p=new Error('Incorrect usage of "merge". Both branches have same head');throw p.hash={text:`merge ${e}`,token:`merge ${e}`,expected:["branch abc"]},p}if(r&&pt.records.commits.has(r)){let p=new Error('Incorrect usage of "merge". Commit with id:'+r+" already exists, use different custom Id");throw p.hash={text:`merge ${e} ${r} ${n} ${i?.join(" ")}`,token:`merge ${e} ${r} ${n} ${i?.join(" ")}`,expected:[`merge ${e} ${r}_UNIQUE ${n} ${i?.join(" ")}`]},p}let f=l||"",d={id:r||`${pt.records.seq}-${kI()}`,message:`merged branch ${e} into ${pt.records.currBranch}`,seq:pt.records.seq++,parents:pt.records.head==null?[]:[pt.records.head.id,f],branch:pt.records.currBranch,type:Hr.MERGE,customType:n,customId:!!r,tags:i??[]};pt.records.head=d,pt.records.commits.set(d.id,d),pt.records.branches.set(pt.records.currBranch,d.id),V.debug(pt.records.branches),V.debug("in mergeBranch")},"merge"),XPe=o(function(t){let e=t.id,r=t.targetId,n=t.tags,i=t.parent;V.debug("Entering cherryPick:",e,r,n);let a=k0();if(e=We.sanitizeText(e,a),r=We.sanitizeText(r,a),n=n?.map(u=>We.sanitizeText(u,a)),i=We.sanitizeText(i,a),!e||!pt.records.commits.has(e)){let u=new Error('Incorrect usage of "cherryPick". Source commit id should exist and provided');throw u.hash={text:`cherryPick ${e} ${r}`,token:`cherryPick ${e} ${r}`,expected:["cherry-pick abc"]},u}let s=pt.records.commits.get(e);if(s===void 0||!s)throw new Error('Incorrect usage of "cherryPick". Source commit id should exist and provided');if(i&&!(Array.isArray(s.parents)&&s.parents.includes(i)))throw new Error("Invalid operation: The specified parent commit is not an immediate parent of the cherry-picked commit.");let l=s.branch;if(s.type===Hr.MERGE&&!i)throw new Error("Incorrect usage of cherry-pick: If the source commit is a merge commit, an immediate parent commit must be specified.");if(!r||!pt.records.commits.has(r)){if(l===pt.records.currBranch){let d=new Error('Incorrect usage of "cherryPick". Source commit is already on current branch');throw d.hash={text:`cherryPick ${e} ${r}`,token:`cherryPick ${e} ${r}`,expected:["cherry-pick abc"]},d}let u=pt.records.branches.get(pt.records.currBranch);if(u===void 0||!u){let d=new Error(`Incorrect usage of "cherry-pick". Current branch (${pt.records.currBranch})has no commits`);throw d.hash={text:`cherryPick ${e} ${r}`,token:`cherryPick ${e} ${r}`,expected:["cherry-pick abc"]},d}let h=pt.records.commits.get(u);if(h===void 0||!h){let d=new Error(`Incorrect usage of "cherry-pick". Current branch (${pt.records.currBranch})has no commits`);throw d.hash={text:`cherryPick ${e} ${r}`,token:`cherryPick ${e} ${r}`,expected:["cherry-pick abc"]},d}let f={id:pt.records.seq+"-"+kI(),message:`cherry-picked ${s?.message} into ${pt.records.currBranch}`,seq:pt.records.seq++,parents:pt.records.head==null?[]:[pt.records.head.id,s.id],branch:pt.records.currBranch,type:Hr.CHERRY_PICK,tags:n?n.filter(Boolean):[`cherry-pick:${s.id}${s.type===Hr.MERGE?`|parent:${i}`:""}`]};pt.records.head=f,pt.records.commits.set(f.id,f),pt.records.branches.set(pt.records.currBranch,f.id),V.debug(pt.records.branches),V.debug("in cherryPick")}},"cherryPick"),Ale=o(function(t){if(t=We.sanitizeText(t,k0()),pt.records.branches.has(t)){pt.records.currBranch=t;let e=pt.records.branches.get(pt.records.currBranch);e===void 0||!e?pt.records.head=null:pt.records.head=pt.records.commits.get(e)??null}else{let e=new Error(`Trying to checkout branch which is not yet created. (Help try using "branch ${t}")`);throw e.hash={text:`checkout ${t}`,token:`checkout ${t}`,expected:[`branch ${t}`]},e}},"checkout");o(Sle,"upsert");o(_le,"prettyPrintCommitHistory");jPe=o(function(){V.debug(pt.records.commits);let t=Lle()[0];_le([t])},"prettyPrint"),KPe=o(function(){pt.reset(),vr()},"clear"),QPe=o(function(){return[...pt.records.branchConfig.values()].map((e,r)=>e.order!==null&&e.order!==void 0?e:{...e,order:parseFloat(`0.${r}`)}).sort((e,r)=>(e.order??0)-(r.order??0)).map(({name:e})=>({name:e}))},"getBranchesAsObjArray"),ZPe=o(function(){return pt.records.branches},"getBranches"),JPe=o(function(){return pt.records.commits},"getCommits"),Lle=o(function(){let t=[...pt.records.commits.values()];return t.forEach(function(e){V.debug(e.id)}),t.sort((e,r)=>e.seq-r.seq),t},"getCommitsArray"),eBe=o(function(){return pt.records.currBranch},"getCurrentBranch"),tBe=o(function(){return pt.records.direction},"getDirection"),rBe=o(function(){return pt.records.head},"getHead"),eE={commitType:Hr,getConfig:k0,setDirection:VPe,setOptions:UPe,getOptions:HPe,commit:YPe,branch:WPe,merge:qPe,cherryPick:XPe,checkout:Ale,prettyPrint:jPe,clear:KPe,getBranchesAsObjArray:QPe,getBranches:ZPe,getCommits:JPe,getCommitsArray:Lle,getCurrentBranch:eBe,getDirection:tBe,getHead:rBe,setAccTitle:kr,getAccTitle:Ar,getAccDescription:Lr,setAccDescription:_r,setDiagramTitle:nn,getDiagramTitle:Xr}});var nBe,iBe,aBe,sBe,oBe,lBe,cBe,Dle,Rle=R(()=>{"use strict";Lg();ut();sx();EI();Zk();nBe=o((t,e)=>{cf(t,e),t.dir&&e.setDirection(t.dir);for(let r of t.statements)iBe(r,e)},"populate"),iBe=o((t,e)=>{let n={Commit:o(i=>e.commit(aBe(i)),"Commit"),Branch:o(i=>e.branch(sBe(i)),"Branch"),Merge:o(i=>e.merge(oBe(i)),"Merge"),Checkout:o(i=>e.checkout(lBe(i)),"Checkout"),CherryPicking:o(i=>e.cherryPick(cBe(i)),"CherryPicking")}[t.$type];n?n(t):V.error(`Unknown statement type: ${t.$type}`)},"parseStatement"),aBe=o(t=>({id:t.id,msg:t.message??"",type:t.type!==void 0?Hr[t.type]:Hr.NORMAL,tags:t.tags??void 0}),"parseCommit"),sBe=o(t=>({name:t.name,order:t.order??0}),"parseBranch"),oBe=o(t=>({branch:t.branch,id:t.id??"",type:t.type!==void 0?Hr[t.type]:void 0,tags:t.tags??void 0}),"parseMerge"),lBe=o(t=>t.branch,"parseCheckout"),cBe=o(t=>({id:t.id,targetId:"",tags:t.tags?.length===0?void 0:t.tags,parent:t.parent}),"parseCherryPicking"),Dle={parse:o(async t=>{let e=await Fl("gitGraph",t);V.debug(e),nBe(e,eE)},"parse")}});var uBe,Ko,ff,df,Oc,Hu,E0,Is,Os,tE,ox,rE,hf,Tr,hBe,Mle,Ile,fBe,dBe,pBe,mBe,gBe,yBe,vBe,xBe,bBe,wBe,TBe,kBe,Nle,EBe,lx,CBe,SBe,ABe,_Be,LBe,Ole,Ple=R(()=>{"use strict";Zt();_t();ut();xr();Zk();uBe=de(),Ko=uBe?.gitGraph,ff=10,df=40,Oc=4,Hu=2,E0=8,Is=new Map,Os=new Map,tE=30,ox=new Map,rE=[],hf=0,Tr="LR",hBe=o(()=>{Is.clear(),Os.clear(),ox.clear(),hf=0,rE=[],Tr="LR"},"clear"),Mle=o(t=>{let e=document.createElementNS("http://www.w3.org/2000/svg","text");return(typeof t=="string"?t.split(/\\n|\n|<br\s*\/?>/gi):t).forEach(n=>{let i=document.createElementNS("http://www.w3.org/2000/svg","tspan");i.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve"),i.setAttribute("dy","1em"),i.setAttribute("x","0"),i.setAttribute("class","row"),i.textContent=n.trim(),e.appendChild(i)}),e},"drawText"),Ile=o(t=>{let e,r,n;return Tr==="BT"?(r=o((i,a)=>i<=a,"comparisonFunc"),n=1/0):(r=o((i,a)=>i>=a,"comparisonFunc"),n=0),t.forEach(i=>{let a=Tr==="TB"||Tr=="BT"?Os.get(i)?.y:Os.get(i)?.x;a!==void 0&&r(a,n)&&(e=i,n=a)}),e},"findClosestParent"),fBe=o(t=>{let e="",r=1/0;return t.forEach(n=>{let i=Os.get(n).y;i<=r&&(e=n,r=i)}),e||void 0},"findClosestParentBT"),dBe=o((t,e,r)=>{let n=r,i=r,a=[];t.forEach(s=>{let l=e.get(s);if(!l)throw new Error(`Commit not found for key ${s}`);l.parents.length?(n=mBe(l),i=Math.max(n,i)):a.push(l),gBe(l,n)}),n=i,a.forEach(s=>{yBe(s,n,r)}),t.forEach(s=>{let l=e.get(s);if(l?.parents.length){let u=fBe(l.parents);n=Os.get(u).y-df,n<=i&&(i=n);let h=Is.get(l.branch).pos,f=n-ff;Os.set(l.id,{x:h,y:f})}})},"setParallelBTPos"),pBe=o(t=>{let e=Ile(t.parents.filter(n=>n!==null));if(!e)throw new Error(`Closest parent not found for commit ${t.id}`);let r=Os.get(e)?.y;if(r===void 0)throw new Error(`Closest parent position not found for commit ${t.id}`);return r},"findClosestParentPos"),mBe=o(t=>pBe(t)+df,"calculateCommitPosition"),gBe=o((t,e)=>{let r=Is.get(t.branch);if(!r)throw new Error(`Branch not found for commit ${t.id}`);let n=r.pos,i=e+ff;return Os.set(t.id,{x:n,y:i}),{x:n,y:i}},"setCommitPosition"),yBe=o((t,e,r)=>{let n=Is.get(t.branch);if(!n)throw new Error(`Branch not found for commit ${t.id}`);let i=e+r,a=n.pos;Os.set(t.id,{x:a,y:i})},"setRootPosition"),vBe=o((t,e,r,n,i,a)=>{if(a===Hr.HIGHLIGHT)t.append("rect").attr("x",r.x-10).attr("y",r.y-10).attr("width",20).attr("height",20).attr("class",`commit ${e.id} commit-highlight${i%E0} ${n}-outer`),t.append("rect").attr("x",r.x-6).attr("y",r.y-6).attr("width",12).attr("height",12).attr("class",`commit ${e.id} commit${i%E0} ${n}-inner`);else if(a===Hr.CHERRY_PICK)t.append("circle").attr("cx",r.x).attr("cy",r.y).attr("r",10).attr("class",`commit ${e.id} ${n}`),t.append("circle").attr("cx",r.x-3).attr("cy",r.y+2).attr("r",2.75).attr("fill","#fff").attr("class",`commit ${e.id} ${n}`),t.append("circle").attr("cx",r.x+3).attr("cy",r.y+2).attr("r",2.75).attr("fill","#fff").attr("class",`commit ${e.id} ${n}`),t.append("line").attr("x1",r.x+3).attr("y1",r.y+1).attr("x2",r.x).attr("y2",r.y-5).attr("stroke","#fff").attr("class",`commit ${e.id} ${n}`),t.append("line").attr("x1",r.x-3).attr("y1",r.y+1).attr("x2",r.x).attr("y2",r.y-5).attr("stroke","#fff").attr("class",`commit ${e.id} ${n}`);else{let s=t.append("circle");if(s.attr("cx",r.x),s.attr("cy",r.y),s.attr("r",e.type===Hr.MERGE?9:10),s.attr("class",`commit ${e.id} commit${i%E0}`),a===Hr.MERGE){let l=t.append("circle");l.attr("cx",r.x),l.attr("cy",r.y),l.attr("r",6),l.attr("class",`commit ${n} ${e.id} commit${i%E0}`)}a===Hr.REVERSE&&t.append("path").attr("d",`M ${r.x-5},${r.y-5}L${r.x+5},${r.y+5}M${r.x-5},${r.y+5}L${r.x+5},${r.y-5}`).attr("class",`commit ${n} ${e.id} commit${i%E0}`)}},"drawCommitBullet"),xBe=o((t,e,r,n)=>{if(e.type!==Hr.CHERRY_PICK&&(e.customId&&e.type===Hr.MERGE||e.type!==Hr.MERGE)&&Ko?.showCommitLabel){let i=t.append("g"),a=i.insert("rect").attr("class","commit-label-bkg"),s=i.append("text").attr("x",n).attr("y",r.y+25).attr("class","commit-label").text(e.id),l=s.node()?.getBBox();if(l&&(a.attr("x",r.posWithOffset-l.width/2-Hu).attr("y",r.y+13.5).attr("width",l.width+2*Hu).attr("height",l.height+2*Hu),Tr==="TB"||Tr==="BT"?(a.attr("x",r.x-(l.width+4*Oc+5)).attr("y",r.y-12),s.attr("x",r.x-(l.width+4*Oc)).attr("y",r.y+l.height-12)):s.attr("x",r.posWithOffset-l.width/2),Ko.rotateCommitLabel))if(Tr==="TB"||Tr==="BT")s.attr("transform","rotate(-45, "+r.x+", "+r.y+")"),a.attr("transform","rotate(-45, "+r.x+", "+r.y+")");else{let u=-7.5-(l.width+10)/25*9.5,h=10+l.width/25*8.5;i.attr("transform","translate("+u+", "+h+") rotate(-45, "+n+", "+r.y+")")}}},"drawCommitLabel"),bBe=o((t,e,r,n)=>{if(e.tags.length>0){let i=0,a=0,s=0,l=[];for(let u of e.tags.reverse()){let h=t.insert("polygon"),f=t.append("circle"),d=t.append("text").attr("y",r.y-16-i).attr("class","tag-label").text(u),p=d.node()?.getBBox();if(!p)throw new Error("Tag bbox not found");a=Math.max(a,p.width),s=Math.max(s,p.height),d.attr("x",r.posWithOffset-p.width/2),l.push({tag:d,hole:f,rect:h,yOffset:i}),i+=20}for(let{tag:u,hole:h,rect:f,yOffset:d}of l){let p=s/2,m=r.y-19.2-d;if(f.attr("class","tag-label-bkg").attr("points",`
1128 `+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:o(function(){var K=this.next();return K||this.lex()},"lex"),begin:o(function(K){this.conditionStack.push(K)},"begin"),popState:o(function(){var K=this.conditionStack.length-1;return K>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:o(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:o(function(K){return K=this.conditionStack.length-1-Math.abs(K||0),K>=0?this.conditionStack[K]:"INITIAL"},"topState"),pushState:o(function(K){this.begin(K)},"pushState"),stateStackSize:o(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:o(function(K,se,ce,ue){var te=ue;switch(ce){case 0:return 5;case 1:break;case 2:break;case 3:break;case 4:break;case 5:break;case 6:return 19;case 7:return this.begin("LINE"),14;break;case 8:return this.begin("ID"),50;break;case 9:return this.begin("ID"),52;break;case 10:return 13;case 11:return this.begin("ID"),53;break;case 12:return se.yytext=se.yytext.trim(),this.begin("ALIAS"),70;break;case 13:return this.popState(),this.popState(),this.begin("LINE"),51;break;case 14:return this.popState(),this.popState(),5;break;case 15:return this.begin("LINE"),36;break;case 16:return this.begin("LINE"),37;break;case 17:return this.begin("LINE"),38;break;case 18:return this.begin("LINE"),39;break;case 19:return this.begin("LINE"),49;break;case 20:return this.begin("LINE"),41;break;case 21:return this.begin("LINE"),43;break;case 22:return this.begin("LINE"),48;break;case 23:return this.begin("LINE"),44;break;case 24:return this.begin("LINE"),47;break;case 25:return this.begin("LINE"),46;break;case 26:return this.popState(),15;break;case 27:return 16;case 28:return 65;case 29:return 66;case 30:return 59;case 31:return 60;case 32:return 61;case 33:return 62;case 34:return 57;case 35:return 54;case 36:return this.begin("ID"),21;break;case 37:return this.begin("ID"),23;break;case 38:return 29;case 39:return 30;case 40:return this.begin("acc_title"),31;break;case 41:return this.popState(),"acc_title_value";break;case 42:return this.begin("acc_descr"),33;break;case 43:return this.popState(),"acc_descr_value";break;case 44:this.begin("acc_descr_multiline");break;case 45:this.popState();break;case 46:return"acc_descr_multiline_value";case 47:return 6;case 48:return 18;case 49:return 20;case 50:return 64;case 51:return 5;case 52:return se.yytext=se.yytext.trim(),70;break;case 53:return 73;case 54:return 74;case 55:return 75;case 56:return 76;case 57:return 71;case 58:return 72;case 59:return 77;case 60:return 78;case 61:return 79;case 62:return 80;case 63:return 81;case 64:return 68;case 65:return 69;case 66:return 5;case 67:return"INVALID"}},"anonymous"),rules:[/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:((?!\n)\s)+)/i,/^(?:#[^\n]*)/i,/^(?:%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[0-9]+(?=[ \n]+))/i,/^(?:box\b)/i,/^(?:participant\b)/i,/^(?:actor\b)/i,/^(?:create\b)/i,/^(?:destroy\b)/i,/^(?:[^\<->\->:\n,;]+?([\-]*[^\<->\->:\n,;]+?)*?(?=((?!\n)\s)+as(?!\n)\s|[#\n;]|$))/i,/^(?:as\b)/i,/^(?:(?:))/i,/^(?:loop\b)/i,/^(?:rect\b)/i,/^(?:opt\b)/i,/^(?:alt\b)/i,/^(?:else\b)/i,/^(?:par\b)/i,/^(?:par_over\b)/i,/^(?:and\b)/i,/^(?:critical\b)/i,/^(?:option\b)/i,/^(?:break\b)/i,/^(?:(?:[:]?(?:no)?wrap)?[^#\n;]*)/i,/^(?:end\b)/i,/^(?:left of\b)/i,/^(?:right of\b)/i,/^(?:links\b)/i,/^(?:link\b)/i,/^(?:properties\b)/i,/^(?:details\b)/i,/^(?:over\b)/i,/^(?:note\b)/i,/^(?:activate\b)/i,/^(?:deactivate\b)/i,/^(?:title\s[^#\n;]+)/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,/^(?:sequenceDiagram\b)/i,/^(?:autonumber\b)/i,/^(?:off\b)/i,/^(?:,)/i,/^(?:;)/i,/^(?:[^\+\<->\->:\n,;]+((?!(-x|--x|-\)|--\)))[\-]*[^\+\<->\->:\n,;]+)*)/i,/^(?:->>)/i,/^(?:<<->>)/i,/^(?:-->>)/i,/^(?:<<-->>)/i,/^(?:->)/i,/^(?:-->)/i,/^(?:-[x])/i,/^(?:--[x])/i,/^(?:-[\)])/i,/^(?:--[\)])/i,/^(?::(?:(?:no)?wrap)?[^#\n;]+)/i,/^(?:\+)/i,/^(?:-)/i,/^(?:$)/i,/^(?:.)/i],conditions:{acc_descr_multiline:{rules:[45,46],inclusive:!1},acc_descr:{rules:[43],inclusive:!1},acc_title:{rules:[41],inclusive:!1},ID:{rules:[2,3,12],inclusive:!1},ALIAS:{rules:[2,3,13,14],inclusive:!1},LINE:{rules:[2,3,26],inclusive:!1},INITIAL:{rules:[0,1,3,4,5,6,7,8,9,10,11,15,16,17,18,19,20,21,22,23,24,25,27,28,29,30,31,32,33,34,35,36,37,38,39,40,42,44,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67],inclusive:!0}}};return H}();j.lexer=J;function Z(){this.yy={}}return o(Z,"Parser"),Z.prototype=j,j.Parser=Z,new Z}();hO.parser=hO;Wue=hO});function dO(t,e){if(t.links==null)t.links=e;else for(let r in e)t.links[r]=e[r]}function Zue(t,e){if(t.properties==null)t.properties=e;else for(let r in e)t.properties[r]=e[r]}function SGe(){Mt.records.currentBox=void 0}var Mt,aGe,fO,sGe,oGe,pi,lGe,cGe,uGe,hGe,fGe,dGe,pGe,xx,mGe,gGe,yGe,vGe,xGe,Xue,A0,bGe,wGe,TGe,vx,kGe,EGe,jue,Kue,CGe,Que,Jue,AGe,ehe,pO,the=R(()=>{"use strict";_t();ut();Jk();rr();bi();Mt=new uf(()=>({prevActor:void 0,actors:new Map,createdActors:new Map,destroyedActors:new Map,boxes:[],messages:[],notes:[],sequenceNumbersEnabled:!1,wrapEnabled:void 0,currentBox:void 0,lastCreated:void 0,lastDestroyed:void 0})),aGe=o(function(t){Mt.records.boxes.push({name:t.text,wrap:t.wrap??A0(),fill:t.color,actorKeys:[]}),Mt.records.currentBox=Mt.records.boxes.slice(-1)[0]},"addBox"),fO=o(function(t,e,r,n){let i=Mt.records.currentBox,a=Mt.records.actors.get(t);if(a){if(Mt.records.currentBox&&a.box&&Mt.records.currentBox!==a.box)throw new Error(`A same participant should only be defined in one Box: ${a.name} can't be in '${a.box.name}' and in '${Mt.records.currentBox.name}' at the same time.`);if(i=a.box?a.box:Mt.records.currentBox,a.box=i,a&&e===a.name&&r==null)return}if(r?.text==null&&(r={text:e,type:n}),(n==null||r.text==null)&&(r={text:e,type:n}),Mt.records.actors.set(t,{box:i,name:e,description:r.text,wrap:r.wrap??A0(),prevActor:Mt.records.prevActor,links:{},properties:{},actorCnt:null,rectData:null,type:n??"participant"}),Mt.records.prevActor){let s=Mt.records.actors.get(Mt.records.prevActor);s&&(s.nextActor=t)}Mt.records.currentBox&&Mt.records.currentBox.actorKeys.push(t),Mt.records.prevActor=t},"addActor"),sGe=o(t=>{let e,r=0;if(!t)return 0;for(e=0;e<Mt.records.messages.length;e++)Mt.records.messages[e].type===vx.ACTIVE_START&&Mt.records.messages[e].from===t&&r++,Mt.records.messages[e].type===vx.ACTIVE_END&&Mt.records.messages[e].from===t&&r--;return r},"activationCount"),oGe=o(function(t,e,r,n){Mt.records.messages.push({from:t,to:e,message:r.text,wrap:r.wrap??A0(),answer:n})},"addMessage"),pi=o(function(t,e,r,n,i=!1){if(n===vx.ACTIVE_END&&sGe(t??"")<1){let s=new Error("Trying to inactivate an inactive participant ("+t+")");throw s.hash={text:"->>-",token:"->>-",line:"1",loc:{first_line:1,last_line:1,first_column:1,last_column:1},expected:["'ACTIVE_PARTICIPANT'"]},s}return Mt.records.messages.push({from:t,to:e,message:r?.text??"",wrap:r?.wrap??A0(),type:n,activate:i}),!0},"addSignal"),lGe=o(function(){return Mt.records.boxes.length>0},"hasAtLeastOneBox"),cGe=o(function(){return Mt.records.boxes.some(t=>t.name)},"hasAtLeastOneBoxWithTitle"),uGe=o(function(){return Mt.records.messages},"getMessages"),hGe=o(function(){return Mt.records.boxes},"getBoxes"),fGe=o(function(){return Mt.records.actors},"getActors"),dGe=o(function(){return Mt.records.createdActors},"getCreatedActors"),pGe=o(function(){return Mt.records.destroyedActors},"getDestroyedActors"),xx=o(function(t){return Mt.records.actors.get(t)},"getActor"),mGe=o(function(){return[...Mt.records.actors.keys()]},"getActorKeys"),gGe=o(function(){Mt.records.sequenceNumbersEnabled=!0},"enableSequenceNumbers"),yGe=o(function(){Mt.records.sequenceNumbersEnabled=!1},"disableSequenceNumbers"),vGe=o(()=>Mt.records.sequenceNumbersEnabled,"showSequenceNumbers"),xGe=o(function(t){Mt.records.wrapEnabled=t},"setWrap"),Xue=o(t=>{if(t===void 0)return{};t=t.trim();let e=/^:?wrap:/.exec(t)!==null?!0:/^:?nowrap:/.exec(t)!==null?!1:void 0;return{cleanedText:(e===void 0?t:t.replace(/^:?(?:no)?wrap:/,"")).trim(),wrap:e}},"extractWrap"),A0=o(()=>Mt.records.wrapEnabled!==void 0?Mt.records.wrapEnabled:de().sequence?.wrap??!1,"autoWrap"),bGe=o(function(){Mt.reset(),vr()},"clear"),wGe=o(function(t){let e=t.trim(),{wrap:r,cleanedText:n}=Xue(e),i={text:n,wrap:r};return V.debug(`parseMessage: ${JSON.stringify(i)}`),i},"parseMessage"),TGe=o(function(t){let e=/^((?:rgba?|hsla?)\s*\(.*\)|\w*)(.*)$/.exec(t),r=e?.[1]?e[1].trim():"transparent",n=e?.[2]?e[2].trim():void 0;if(window?.CSS)window.CSS.supports("color",r)||(r="transparent",n=t.trim());else{let s=new Option().style;s.color=r,s.color!==r&&(r="transparent",n=t.trim())}let{wrap:i,cleanedText:a}=Xue(n);return{text:a?qr(a,de()):void 0,color:r,wrap:i}},"parseBoxData"),vx={SOLID:0,DOTTED:1,NOTE:2,SOLID_CROSS:3,DOTTED_CROSS:4,SOLID_OPEN:5,DOTTED_OPEN:6,LOOP_START:10,LOOP_END:11,ALT_START:12,ALT_ELSE:13,ALT_END:14,OPT_START:15,OPT_END:16,ACTIVE_START:17,ACTIVE_END:18,PAR_START:19,PAR_AND:20,PAR_END:21,RECT_START:22,RECT_END:23,SOLID_POINT:24,DOTTED_POINT:25,AUTONUMBER:26,CRITICAL_START:27,CRITICAL_OPTION:28,CRITICAL_END:29,BREAK_START:30,BREAK_END:31,PAR_OVER_START:32,BIDIRECTIONAL_SOLID:33,BIDIRECTIONAL_DOTTED:34},kGe={FILLED:0,OPEN:1},EGe={LEFTOF:0,RIGHTOF:1,OVER:2},jue=o(function(t,e,r){let n={actor:t,placement:e,message:r.text,wrap:r.wrap??A0()},i=[].concat(t,t);Mt.records.notes.push(n),Mt.records.messages.push({from:i[0],to:i[1],message:r.text,wrap:r.wrap??A0(),type:vx.NOTE,placement:e})},"addNote"),Kue=o(function(t,e){let r=xx(t);try{let n=qr(e.text,de());n=n.replace(/&amp;/g,"&"),n=n.replace(/&equals;/g,"=");let i=JSON.parse(n);dO(r,i)}catch(n){V.error("error while parsing actor link text",n)}},"addLinks"),CGe=o(function(t,e){let r=xx(t);try{let n={},i=qr(e.text,de()),a=i.indexOf("@");i=i.replace(/&amp;/g,"&"),i=i.replace(/&equals;/g,"=");let s=i.slice(0,a-1).trim(),l=i.slice(a+1).trim();n[s]=l,dO(r,n)}catch(n){V.error("error while parsing actor link text",n)}},"addALink");o(dO,"insertLinks");Que=o(function(t,e){let r=xx(t);try{let n=qr(e.text,de()),i=JSON.parse(n);Zue(r,i)}catch(n){V.error("error while parsing actor properties text",n)}},"addProperties");o(Zue,"insertProperties");o(SGe,"boxEnd");Jue=o(function(t,e){let r=xx(t),n=document.getElementById(e.text);try{let i=n.innerHTML,a=JSON.parse(i);a.properties&&Zue(r,a.properties),a.links&&dO(r,a.links)}catch(i){V.error("error while parsing actor details text",i)}},"addDetails"),AGe=o(function(t,e){if(t?.properties!==void 0)return t.properties[e]},"getActorProperty"),ehe=o(function(t){if(Array.isArray(t))t.forEach(function(e){ehe(e)});else switch(t.type){case"sequenceIndex":Mt.records.messages.push({from:void 0,to:void 0,message:{start:t.sequenceIndex,step:t.sequenceIndexStep,visible:t.sequenceVisible},wrap:!1,type:t.signalType});break;case"addParticipant":fO(t.actor,t.actor,t.description,t.draw);break;case"createParticipant":if(Mt.records.actors.has(t.actor))throw new Error("It is not possible to have actors with the same id, even if one is destroyed before the next is created. Use 'AS' aliases to simulate the behavior");Mt.records.lastCreated=t.actor,fO(t.actor,t.actor,t.description,t.draw),Mt.records.createdActors.set(t.actor,Mt.records.messages.length);break;case"destroyParticipant":Mt.records.lastDestroyed=t.actor,Mt.records.destroyedActors.set(t.actor,Mt.records.messages.length);break;case"activeStart":pi(t.actor,void 0,void 0,t.signalType);break;case"activeEnd":pi(t.actor,void 0,void 0,t.signalType);break;case"addNote":jue(t.actor,t.placement,t.text);break;case"addLinks":Kue(t.actor,t.text);break;case"addALink":CGe(t.actor,t.text);break;case"addProperties":Que(t.actor,t.text);break;case"addDetails":Jue(t.actor,t.text);break;case"addMessage":if(Mt.records.lastCreated){if(t.to!==Mt.records.lastCreated)throw new Error("The created participant "+Mt.records.lastCreated.name+" does not have an associated creating message after its declaration. Please check the sequence diagram.");Mt.records.lastCreated=void 0}else if(Mt.records.lastDestroyed){if(t.to!==Mt.records.lastDestroyed&&t.from!==Mt.records.lastDestroyed)throw new Error("The destroyed participant "+Mt.records.lastDestroyed.name+" does not have an associated destroying message after its declaration. Please check the sequence diagram.");Mt.records.lastDestroyed=void 0}pi(t.from,t.to,t.msg,t.signalType,t.activate);break;case"boxStart":aGe(t.boxData);break;case"boxEnd":SGe();break;case"loopStart":pi(void 0,void 0,t.loopText,t.signalType);break;case"loopEnd":pi(void 0,void 0,void 0,t.signalType);break;case"rectStart":pi(void 0,void 0,t.color,t.signalType);break;case"rectEnd":pi(void 0,void 0,void 0,t.signalType);break;case"optStart":pi(void 0,void 0,t.optText,t.signalType);break;case"optEnd":pi(void 0,void 0,void 0,t.signalType);break;case"altStart":pi(void 0,void 0,t.altText,t.signalType);break;case"else":pi(void 0,void 0,t.altText,t.signalType);break;case"altEnd":pi(void 0,void 0,void 0,t.signalType);break;case"setAccTitle":kr(t.text);break;case"parStart":pi(void 0,void 0,t.parText,t.signalType);break;case"and":pi(void 0,void 0,t.parText,t.signalType);break;case"parEnd":pi(void 0,void 0,void 0,t.signalType);break;case"criticalStart":pi(void 0,void 0,t.criticalText,t.signalType);break;case"option":pi(void 0,void 0,t.optionText,t.signalType);break;case"criticalEnd":pi(void 0,void 0,void 0,t.signalType);break;case"breakStart":pi(void 0,void 0,t.breakText,t.signalType);break;case"breakEnd":pi(void 0,void 0,void 0,t.signalType);break}},"apply"),pO={addActor:fO,addMessage:oGe,addSignal:pi,addLinks:Kue,addDetails:Jue,addProperties:Que,autoWrap:A0,setWrap:xGe,enableSequenceNumbers:gGe,disableSequenceNumbers:yGe,showSequenceNumbers:vGe,getMessages:uGe,getActors:fGe,getCreatedActors:dGe,getDestroyedActors:pGe,getActor:xx,getActorKeys:mGe,getActorProperty:AGe,getAccTitle:Ar,getBoxes:hGe,getDiagramTitle:Xr,setDiagramTitle:nn,getConfig:o(()=>de().sequence,"getConfig"),clear:bGe,parseMessage:wGe,parseBoxData:TGe,LINETYPE:vx,ARROWTYPE:kGe,PLACEMENT:EGe,addNote:jue,setAccTitle:kr,apply:ehe,setAccDescription:_r,getAccDescription:Lr,hasAtLeastOneBox:lGe,hasAtLeastOneBoxWithTitle:cGe}});var _Ge,rhe,nhe=R(()=>{"use strict";_Ge=o(t=>`.actor {
2071 `,"getStyles"),b1e=DJe});function RJe(t,e){if(t===0||!Number.isInteger(t))throw new Error("Columns must be an integer !== 0.");if(e<0||!Number.isInteger(e))throw new Error("Position must be a non-negative integer."+e);if(t<0)return{px:e,py:0};if(t===1)return{px:0,py:e};let r=e%t,n=Math.floor(e/t);return{px:r,py:n}}function HB(t,e,r=0,n=0){V.debug("setBlockSizes abc95 (start)",t.id,t?.size?.x,"block width =",t?.size,"sieblingWidth",r),t?.size?.width||(t.size={width:r,height:n,x:0,y:0});let i=0,a=0;if(t.children?.length>0){for(let m of t.children)HB(m,e);let s=NJe(t);i=s.width,a=s.height,V.debug("setBlockSizes abc95 maxWidth of",t.id,":s children is ",i,a);for(let m of t.children)m.size&&(V.debug(`abc95 Setting size of children of ${t.id} id=${m.id} ${i} ${a} ${JSON.stringify(m.size)}`),m.size.width=i*(m.widthInColumns??1)+mi*((m.widthInColumns??1)-1),m.size.height=a,m.size.x=0,m.size.y=0,V.debug(`abc95 updating size of ${t.id} children child:${m.id} maxWidth:${i} maxHeight:${a}`));for(let m of t.children)HB(m,e,i,a);let l=t.columns??-1,u=0;for(let m of t.children)u+=m.widthInColumns??1;let h=t.children.length;l>0&&l<u&&(h=l);let f=Math.ceil(u/h),d=h*(i+mi)+mi,p=f*(a+mi)+mi;if(d<r){V.debug(`Detected to small siebling: abc95 ${t.id} sieblingWidth ${r} sieblingHeight ${n} width ${d}`),d=r,p=n;let m=(r-h*mi-mi)/h,g=(n-f*mi-mi)/f;V.debug("Size indata abc88",t.id,"childWidth",m,"maxWidth",i),V.debug("Size indata abc88",t.id,"childHeight",g,"maxHeight",a),V.debug("Size indata abc88 xSize",h,"padding",mi);for(let y of t.children)y.size&&(y.size.width=m,y.size.height=g,y.size.x=0,y.size.y=0)}if(V.debug(`abc95 (finale calc) ${t.id} xSize ${h} ySize ${f} columns ${l}${t.children.length} width=${Math.max(d,t.size?.width||0)}`),d<(t?.size?.width||0)){d=t?.size?.width||0;let m=l>0?Math.min(t.children.length,l):t.children.length;if(m>0){let g=(d-m*mi-mi)/m;V.debug("abc95 (growing to fit) width",t.id,d,t.size?.width,g);for(let y of t.children)y.size&&(y.size.width=g)}}t.size={width:d,height:p,x:0,y:0}}V.debug("setBlockSizes abc94 (done)",t.id,t?.size?.x,t?.size?.width,t?.size?.y,t?.size?.height)}function T1e(t,e){V.debug(`abc85 layout blocks (=>layoutBlocks) ${t.id} x: ${t?.size?.x} y: ${t?.size?.y} width: ${t?.size?.width}`);let r=t.columns??-1;if(V.debug("layoutBlocks columns abc95",t.id,"=>",r,t),t.children&&t.children.length>0){let n=t?.children[0]?.size?.width??0,i=t.children.length*n+(t.children.length-1)*mi;V.debug("widthOfChildren 88",i,"posX");let a=0;V.debug("abc91 block?.size?.x",t.id,t?.size?.x);let s=t?.size?.x?t?.size?.x+(-t?.size?.width/2||0):-mi,l=0;for(let u of t.children){let h=t;if(!u.size)continue;let{width:f,height:d}=u.size,{px:p,py:m}=RJe(r,a);if(m!=l&&(l=m,s=t?.size?.x?t?.size?.x+(-t?.size?.width/2||0):-mi,V.debug("New row in layout for block",t.id," and child ",u.id,l)),V.debug(`abc89 layout blocks (child) id: ${u.id} Pos: ${a} (px, py) ${p},${m} (${h?.size?.x},${h?.size?.y}) parent: ${h.id} width: ${f}${mi}`),h.size){let g=f/2;u.size.x=s+mi+g,V.debug(`abc91 layout blocks (calc) px, pyid:${u.id} startingPos=X${s} new startingPosX${u.size.x} ${g} padding=${mi} width=${f} halfWidth=${g} => x:${u.size.x} y:${u.size.y} ${u.widthInColumns} (width * (child?.w || 1)) / 2 ${f*(u?.widthInColumns??1)/2}`),s=u.size.x+g,u.size.y=h.size.y-h.size.height/2+m*(d+mi)+d/2+mi,V.debug(`abc88 layout blocks (calc) px, pyid:${u.id}startingPosX${s}${mi}${g}=>x:${u.size.x}y:${u.size.y}${u.widthInColumns}(width * (child?.w || 1)) / 2${f*(u?.widthInColumns??1)/2}`)}u.children&&T1e(u,e),a+=u?.widthInColumns??1,V.debug("abc88 columnsPos",u,a)}}V.debug(`layout blocks (<==layoutBlocks) ${t.id} x: ${t?.size?.x} y: ${t?.size?.y} width: ${t?.size?.width}`)}function k1e(t,{minX:e,minY:r,maxX:n,maxY:i}={minX:0,minY:0,maxX:0,maxY:0}){if(t.size&&t.id!=="root"){let{x:a,y:s,width:l,height:u}=t.size;a-l/2<e&&(e=a-l/2),s-u/2<r&&(r=s-u/2),a+l/2>n&&(n=a+l/2),s+u/2>i&&(i=s+u/2)}if(t.children)for(let a of t.children)({minX:e,minY:r,maxX:n,maxY:i}=k1e(a,{minX:e,minY:r,maxX:n,maxY:i}));return{minX:e,minY:r,maxX:n,maxY:i}}function E1e(t){let e=t.getBlock("root");if(!e)return;HB(e,t,0,0),T1e(e,t),V.debug("getBlocks",JSON.stringify(e,null,2));let{minX:r,minY:n,maxX:i,maxY:a}=k1e(e),s=a-n,l=i-r;return{x:r,y:n,width:l,height:s}}var mi,NJe,C1e=R(()=>{"use strict";ut();_t();mi=de()?.block?.padding??8;o(RJe,"calculateBlockPosition");NJe=o(t=>{let e=0,r=0;for(let n of t.children){let{width:i,height:a,x:s,y:l}=n.size??{width:0,height:0,x:0,y:0};V.debug("getMaxChildSize abc95 child:",n.id,"width:",i,"height:",a,"x:",s,"y:",l,n.type),n.type!=="space"&&(i>e&&(e=i/(t.widthInColumns??1)),a>r&&(r=a))}return{width:e,height:r}},"getMaxChildSize");o(HB,"setBlockSizes");o(T1e,"layoutBlocks");o(k1e,"findBounds");o(E1e,"layout")});function S1e(t,e,r=!1){let n=t,i="default";(n?.classes?.length||0)>0&&(i=(n?.classes??[]).join(" ")),i=i+" flowchart-label";let a=0,s="",l;switch(n.type){case"round":a=5,s="rect";break;case"composite":a=0,s="composite",l=0;break;case"square":s="rect";break;case"diamond":s="question";break;case"hexagon":s="hexagon";break;case"block_arrow":s="block_arrow";break;case"odd":s="rect_left_inv_arrow";break;case"lean_right":s="lean_right";break;case"lean_left":s="lean_left";break;case"trapezoid":s="trapezoid";break;case"inv_trapezoid":s="inv_trapezoid";break;case"rect_left_inv_arrow":s="rect_left_inv_arrow";break;case"circle":s="circle";break;case"ellipse":s="ellipse";break;case"stadium":s="stadium";break;case"subroutine":s="subroutine";break;case"cylinder":s="cylinder";break;case"group":s="rect";break;case"doublecircle":s="doublecircle";break;default:s="rect"}let u=lm(n?.styles??[]),h=n.label,f=n.size??{width:0,height:0,x:0,y:0};return{labelStyle:u.labelStyle,shape:s,labelText:h,rx:a,ry:a,class:i,style:u.style,id:n.id,directions:n.directions,width:f.width,height:f.height,x:f.x,y:f.y,positioned:r,intersect:void 0,type:n.type,padding:l??Or()?.block?.padding??0}}async function MJe(t,e,r){let n=S1e(e,r,!1);if(n.type==="group")return;let i=await pm(t,n),a=i.node().getBBox(),s=r.getBlock(n.id);s.size={width:a.width,height:a.height,x:0,y:0,node:i},r.setBlock(s),i.remove()}async function IJe(t,e,r){let n=S1e(e,r,!0);r.getBlock(n.id).type!=="space"&&(await pm(t,n),e.intersect=n?.intersect,wv(n))}async function YB(t,e,r,n){for(let i of e)await n(t,i,r),i.children&&await YB(t,i.children,r,n)}async function A1e(t,e,r){await YB(t,e,r,MJe)}async function _1e(t,e,r){await YB(t,e,r,IJe)}async function L1e(t,e,r,n,i){let a=new lr({multigraph:!0,compound:!0});a.setGraph({rankdir:"TB",nodesep:10,ranksep:10,marginx:8,marginy:8});for(let s of r)s.size&&a.setNode(s.id,{width:s.size.width,height:s.size.height,intersect:s.intersect});for(let s of e)if(s.start&&s.end){let l=n.getBlock(s.start),u=n.getBlock(s.end);if(l?.size&&u?.size){let h=l.size,f=u.size,d=[{x:h.x,y:h.y},{x:h.x+(f.x-h.x)/2,y:h.y+(f.y-h.y)/2},{x:f.x,y:f.y}];PE(t,{v:s.start,w:s.end,name:s.id},{...s,arrowTypeEnd:s.arrowTypeEnd,arrowTypeStart:s.arrowTypeStart,points:d,classes:"edge-thickness-normal edge-pattern-solid flowchart-link LS-a1 LE-b1"},void 0,"block",a,i),s.label&&(await IE(t,{...s,label:s.label,labelStyle:"stroke: #333; stroke-width: 1.5px;fill:none;",arrowTypeEnd:s.arrowTypeEnd,arrowTypeStart:s.arrowTypeStart,points:d,classes:"edge-thickness-normal edge-pattern-solid flowchart-link LS-a1 LE-b1"}),OE({...s,x:d[1].x,y:d[1].y},{originalPath:d}))}}}var D1e=R(()=>{"use strict";ya();qs();DO();M5();xr();o(S1e,"getNodeFromBlock");o(MJe,"calculateBlockSize");o(IJe,"insertBlockPositioned");o(YB,"performOperations");o(A1e,"calculateBlockSizes");o(_1e,"insertBlocks");o(L1e,"insertEdges")});var OJe,PJe,R1e,N1e=R(()=>{"use strict";Zt();qs();LO();ut();Yn();C1e();D1e();OJe=o(function(t,e){return e.db.getClasses()},"getClasses"),PJe=o(async function(t,e,r,n){let{securityLevel:i,block:a}=Or(),s=n.db,l;i==="sandbox"&&(l=$e("#i"+e));let u=i==="sandbox"?$e(l.nodes()[0].contentDocument.body):$e("body"),h=i==="sandbox"?u.select(`[id="${e}"]`):$e(`[id="${e}"]`);LE(h,["point","circle","cross"],n.type,e);let d=s.getBlocks(),p=s.getBlocksFlat(),m=s.getEdges(),g=h.insert("g").attr("class","block");await A1e(g,d,s);let y=E1e(s);if(await _1e(g,d,s),await L1e(g,m,p,s,e),y){let v=y,x=Math.max(1,Math.round(.125*(v.width/v.height))),b=v.height+x+10,w=v.width+10,{useMaxWidth:S}=a;Sr(h,b,w,!!S),V.debug("Here Bounds",y,v),h.attr("viewBox",`${v.x-5} ${v.y-5} ${v.width+10} ${v.height+10}`)}},"draw"),R1e={draw:PJe,getClasses:OJe}});var M1e={};hr(M1e,{diagram:()=>BJe});var BJe,I1e=R(()=>{"use strict";f1e();x1e();w1e();N1e();BJe={parser:h1e,db:v1e,renderer:R1e,styles:b1e}});var WB,qB,pb,B1e,XB,cs,Wc,oC,F1e,$Je,mb,z1e,G1e,$1e,V1e,lC,If,cC=R(()=>{"use strict";WB={L:"left",R:"right",T:"top",B:"bottom"},qB={L:o(t=>`${t},${t/2} 0,${t} 0,0`,"L"),R:o(t=>`0,${t/2} ${t},0 ${t},${t}`,"R"),T:o(t=>`0,0 ${t},0 ${t/2},${t}`,"T"),B:o(t=>`${t/2},0 ${t},${t} 0,${t}`,"B")},pb={L:o((t,e)=>t-e+2,"L"),R:o((t,e)=>t-2,"R"),T:o((t,e)=>t-e+2,"T"),B:o((t,e)=>t-2,"B")},B1e=o(function(t){return cs(t)?t==="L"?"R":"L":t==="T"?"B":"T"},"getOppositeArchitectureDirection"),XB=o(function(t){let e=t;return e==="L"||e==="R"||e==="T"||e==="B"},"isArchitectureDirection"),cs=o(function(t){let e=t;return e==="L"||e==="R"},"isArchitectureDirectionX"),Wc=o(function(t){let e=t;return e==="T"||e==="B"},"isArchitectureDirectionY"),oC=o(function(t,e){let r=cs(t)&&Wc(e),n=Wc(t)&&cs(e);return r||n},"isArchitectureDirectionXY"),F1e=o(function(t){let e=t[0],r=t[1],n=cs(e)&&Wc(r),i=Wc(e)&&cs(r);return n||i},"isArchitecturePairXY"),$Je=o(function(t){return t!=="LL"&&t!=="RR"&&t!=="TT"&&t!=="BB"},"isValidArchitectureDirectionPair"),mb=o(function(t,e){let r=`${t}${e}`;return $Je(r)?r:void 0},"getArchitectureDirectionPair"),z1e=o(function([t,e],r){let n=r[0],i=r[1];return cs(n)?Wc(i)?[t+(n==="L"?-1:1),e+(i==="T"?1:-1)]:[t+(n==="L"?-1:1),e]:cs(i)?[t+(i==="L"?1:-1),e+(n==="T"?1:-1)]:[t,e+(n==="T"?1:-1)]},"shiftPositionByArchitectureDirectionPair"),G1e=o(function(t){return t==="LT"||t==="TL"?[1,1]:t==="BL"||t==="LB"?[1,-1]:t==="BR"||t==="RB"?[-1,-1]:[-1,1]},"getArchitectureDirectionXYFactors"),$1e=o(function(t){return t.type==="service"},"isArchitectureService"),V1e=o(function(t){return t.type==="junction"},"isArchitectureJunction"),lC=o(t=>t.data(),"edgeData"),If=o(t=>t.data(),"nodeData")});function Ci(t){let e=de().architecture;return e?.[t]?e[t]:U1e[t]}var U1e,nr,VJe,UJe,HJe,YJe,WJe,qJe,XJe,jJe,KJe,QJe,ZJe,JJe,eet,tet,Z0,gb=R(()=>{"use strict";sl();_t();Jk();bi();cC();U1e=mr.architecture,nr=new uf(()=>({nodes:{},groups:{},edges:[],registeredIds:{},config:U1e,dataStructures:void 0,elements:{}})),VJe=o(()=>{nr.reset(),vr()},"clear"),UJe=o(function({id:t,icon:e,in:r,title:n,iconText:i}){if(nr.records.registeredIds[t]!==void 0)throw new Error(`The service id [${t}] is already in use by another ${nr.records.registeredIds[t]}`);if(r!==void 0){if(t===r)throw new Error(`The service [${t}] cannot be placed within itself`);if(nr.records.registeredIds[r]===void 0)throw new Error(`The service [${t}]'s parent does not exist. Please make sure the parent is created before this service`);if(nr.records.registeredIds[r]==="node")throw new Error(`The service [${t}]'s parent is not a group`)}nr.records.registeredIds[t]="node",nr.records.nodes[t]={id:t,type:"service",icon:e,iconText:i,title:n,edges:[],in:r}},"addService"),HJe=o(()=>Object.values(nr.records.nodes).filter($1e),"getServices"),YJe=o(function({id:t,in:e}){nr.records.registeredIds[t]="node",nr.records.nodes[t]={id:t,type:"junction",edges:[],in:e}},"addJunction"),WJe=o(()=>Object.values(nr.records.nodes).filter(V1e),"getJunctions"),qJe=o(()=>Object.values(nr.records.nodes),"getNodes"),XJe=o(t=>nr.records.nodes[t],"getNode"),jJe=o(function({id:t,icon:e,in:r,title:n}){if(nr.records.registeredIds[t]!==void 0)throw new Error(`The group id [${t}] is already in use by another ${nr.records.registeredIds[t]}`);if(r!==void 0){if(t===r)throw new Error(`The group [${t}] cannot be placed within itself`);if(nr.records.registeredIds[r]===void 0)throw new Error(`The group [${t}]'s parent does not exist. Please make sure the parent is created before this group`);if(nr.records.registeredIds[r]==="node")throw new Error(`The group [${t}]'s parent is not a group`)}nr.records.registeredIds[t]="group",nr.records.groups[t]={id:t,icon:e,title:n,in:r}},"addGroup"),KJe=o(()=>Object.values(nr.records.groups),"getGroups"),QJe=o(function({lhsId:t,rhsId:e,lhsDir:r,rhsDir:n,lhsInto:i,rhsInto:a,lhsGroup:s,rhsGroup:l,title:u}){if(!XB(r))throw new Error(`Invalid direction given for left hand side of edge ${t}--${e}. Expected (L,R,T,B) got ${r}`);if(!XB(n))throw new Error(`Invalid direction given for right hand side of edge ${t}--${e}. Expected (L,R,T,B) got ${n}`);if(nr.records.nodes[t]===void 0&&nr.records.groups[t]===void 0)throw new Error(`The left-hand id [${t}] does not yet exist. Please create the service/group before declaring an edge to it.`);if(nr.records.nodes[e]===void 0&&nr.records.groups[t]===void 0)throw new Error(`The right-hand id [${e}] does not yet exist. Please create the service/group before declaring an edge to it.`);let h=nr.records.nodes[t].in,f=nr.records.nodes[e].in;if(s&&h&&f&&h==f)throw new Error(`The left-hand id [${t}] is modified to traverse the group boundary, but the edge does not pass through two groups.`);if(l&&h&&f&&h==f)throw new Error(`The right-hand id [${e}] is modified to traverse the group boundary, but the edge does not pass through two groups.`);let d={lhsId:t,lhsDir:r,lhsInto:i,lhsGroup:s,rhsId:e,rhsDir:n,rhsInto:a,rhsGroup:l,title:u};nr.records.edges.push(d),nr.records.nodes[t]&&nr.records.nodes[e]&&(nr.records.nodes[t].edges.push(nr.records.edges[nr.records.edges.length-1]),nr.records.nodes[e].edges.push(nr.records.edges[nr.records.edges.length-1]))},"addEdge"),ZJe=o(()=>nr.records.edges,"getEdges"),JJe=o(()=>{if(nr.records.dataStructures===void 0){let t=Object.entries(nr.records.nodes).reduce((s,[l,u])=>(s[l]=u.edges.reduce((h,f)=>{if(f.lhsId===l){let d=mb(f.lhsDir,f.rhsDir);d&&(h[d]=f.rhsId)}else{let d=mb(f.rhsDir,f.lhsDir);d&&(h[d]=f.lhsId)}return h},{}),s),{}),e=Object.keys(t)[0],r={[e]:1},n=Object.keys(t).reduce((s,l)=>l===e?s:{...s,[l]:1},{}),i=o(s=>{let l={[s]:[0,0]},u=[s];for(;u.length>0;){let h=u.shift();if(h){r[h]=1,delete n[h];let f=t[h],[d,p]=l[h];Object.entries(f).forEach(([m,g])=>{r[g]||(l[g]=z1e([d,p],m),u.push(g))})}}return l},"BFS"),a=[i(e)];for(;Object.keys(n).length>0;)a.push(i(Object.keys(n)[0]));nr.records.dataStructures={adjList:t,spatialMaps:a}}return nr.records.dataStructures},"getDataStructures"),eet=o((t,e)=>{nr.records.elements[t]=e},"setElementForId"),tet=o(t=>nr.records.elements[t],"getElementById"),Z0={clear:VJe,setDiagramTitle:nn,getDiagramTitle:Xr,setAccTitle:kr,getAccTitle:Ar,setAccDescription:_r,getAccDescription:Lr,addService:UJe,getServices:HJe,addJunction:YJe,getJunctions:WJe,getNodes:qJe,getNode:XJe,addGroup:jJe,getGroups:KJe,addEdge:QJe,getEdges:ZJe,setElementForId:eet,getElementById:tet,getDataStructures:JJe};o(Ci,"getConfigField")});var ret,H1e,Y1e=R(()=>{"use strict";Lg();ut();sx();gb();ret=o((t,e)=>{cf(t,e),t.groups.map(e.addGroup),t.services.map(r=>e.addService({...r,type:"service"})),t.junctions.map(r=>e.addJunction({...r,type:"junction"})),t.edges.map(e.addEdge)},"populateDb"),H1e={parse:o(async t=>{let e=await Fl("architecture",t);V.debug(e),ret(e,Z0)},"parse")}});var net,W1e,q1e=R(()=>{"use strict";net=o(t=>`