(n=s.call({lexer:this},t,r))?(t=t.substring(n.raw.length),r.push(n),!0):!1))continue;if(n=this.tokenizer.space(t)){t=t.substring(n.raw.length);let s=r.at(-1);n.raw.length===1&&s!==void 0?s.raw+=`
`:r.push(n);continue}if(n=this.tokenizer.code(t)){t=t.substring(n.raw.length);let s=r.at(-1);s?.type==="paragraph"||s?.type==="text"?(s.raw+=(s.raw.endsWith(`
`)?"":`
`)+n.raw,s.text+=`
`+n.text,this.inlineQueue.at(-1).src=s.text):r.push(n);continue}if(n=this.tokenizer.fences(t)){t=t.substring(n.raw.length),r.push(n);continue}if(n=this.tokenizer.heading(t)){t=t.substring(n.raw.length),r.push(n);continue}if(n=this.tokenizer.hr(t)){t=t.substring(n.raw.length),r.push(n);continue}if(n=this.tokenizer.blockquote(t)){t=t.substring(n.raw.length),r.push(n);continue}if(n=this.tokenizer.list(t)){t=t.substring(n.raw.length),r.push(n);continue}if(n=this.tokenizer.html(t)){t=t.substring(n.raw.length),r.push(n);continue}if(n=this.tokenizer.def(t)){t=t.substring(n.raw.length);let s=r.at(-1);s?.type==="paragraph"||s?.type==="text"?(s.raw+=(s.raw.endsWith(`
`)?"":`
`)+n.raw,s.text+=`
`+n.raw,this.inlineQueue.at(-1).src=s.text):this.tokens.links[n.tag]||(this.tokens.links[n.tag]={href:n.href,title:n.title},r.push(n));continue}if(n=this.tokenizer.table(t)){t=t.substring(n.raw.length),r.push(n);continue}if(n=this.tokenizer.lheading(t)){t=t.substring(n.raw.length),r.push(n);continue}let a=t;if(this.options.extensions?.startBlock){let s=1/0,l=t.slice(1),u;this.options.extensions.startBlock.forEach(h=>{u=h.call({lexer:this},l),typeof u=="number"&&u>=0&&(s=Math.min(s,u))}),s<1/0&&s>=0&&(a=t.substring(0,s+1))}if(this.state.top&&(n=this.tokenizer.paragraph(a))){let s=r.at(-1);i&&s?.type==="paragraph"?(s.raw+=(s.raw.endsWith(`
`)?"":`
`)+n.raw,s.text+=`
`+n.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=s.text):r.push(n),i=a.length!==t.length,t=t.substring(n.raw.length);continue}if(n=this.tokenizer.text(t)){t=t.substring(n.raw.length);let s=r.at(-1);s?.type==="text"?(s.raw+=(s.raw.endsWith(`
`)?"":`
`)+n.raw,s.text+=`
`+n.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=s.text):r.push(n);continue}if(t){let s="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(s);break}else throw new Error(s)}}return this.state.top=!0,r}inline(t,r=[]){return this.inlineQueue.push({src:t,tokens:r}),r}inlineTokens(t,r=[]){let i=t,n=null;if(this.tokens.links){let l=Object.keys(this.tokens.links);if(l.length>0)for(;(n=this.tokenizer.rules.inline.reflinkSearch.exec(i))!=null;)l.includes(n[0].slice(n[0].lastIndexOf("[")+1,-1))&&(i=i.slice(0,n.index)+"["+"a".repeat(n[0].length-2)+"]"+i.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(n=this.tokenizer.rules.inline.anyPunctuation.exec(i))!=null;)i=i.slice(0,n.index)+"++"+i.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;(n=this.tokenizer.rules.inline.blockSkip.exec(i))!=null;)i=i.slice(0,n.index)+"["+"a".repeat(n[0].length-2)+"]"+i.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);i=this.options.hooks?.emStrongMask?.call({lexer:this},i)??i;let a=!1,s="";for(;t;){a||(s=""),a=!1;let l;if(this.options.extensions?.inline?.some(h=>(l=h.call({lexer:this},t,r))?(t=t.substring(l.raw.length),r.push(l),!0):!1))continue;if(l=this.tokenizer.escape(t)){t=t.substring(l.raw.length),r.push(l);continue}if(l=this.tokenizer.tag(t)){t=t.substring(l.raw.length),r.push(l);continue}if(l=this.tokenizer.link(t)){t=t.substring(l.raw.length),r.push(l);continue}if(l=this.tokenizer.reflink(t,this.tokens.links)){t=t.substring(l.raw.length);let h=r.at(-1);l.type==="text"&&h?.type==="text"?(h.raw+=l.raw,h.text+=l.text):r.push(l);continue}if(l=this.tokenizer.emStrong(t,i,s)){t=t.substring(l.raw.length),r.push(l);continue}if(l=this.tokenizer.codespan(t)){t=t.substring(l.raw.length),r.push(l);continue}if(l=this.tokenizer.br(t)){t=t.substring(l.raw.length),r.push(l);continue}if(l=this.tokenizer.del(t)){t=t.substring(l.raw.length),r.push(l);continue}if(l=this.tokenizer.autolink(t)){t=t.substring(l.raw.length),r.push(l);continue}if(!this.state.inLink&&(l=this.tokenizer.url(t))){t=t.substring(l.raw.length),r.push(l);continue}let u=t;if(this.options.extensions?.startInline){let h=1/0,d=t.slice(1),f;this.options.extensions.startInline.forEach(p=>{f=p.call({lexer:this},d),typeof f=="number"&&f>=0&&(h=Math.min(h,f))}),h<1/0&&h>=0&&(u=t.substring(0,h+1))}if(l=this.tokenizer.inlineText(u)){t=t.substring(l.raw.length),l.raw.slice(-1)!=="_"&&(s=l.raw.slice(-1)),a=!0;let h=r.at(-1);h?.type==="text"?(h.raw+=l.raw,h.text+=l.text):r.push(l);continue}if(t){let h="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(h);break}else throw new Error(h)}}return r}},k4=class{static{o(this,"P")}options;parser;constructor(e){this.options=e||Sp}space(e){return""}code({text:e,lang:t,escaped:r}){let i=(t||"").match(Ja.notSpaceStart)?.[0],n=e.replace(Ja.endingNewline,"")+`
`;return i?''+(r?n:Cc(n,!0))+`
`:""+(r?n:Cc(n,!0))+`
`}blockquote({tokens:e}){return`
${this.parser.parse(e)}
`}html({text:e}){return e}def(e){return""}heading({tokens:e,depth:t}){return`${this.parser.parseInline(e)}
`}hr(e){return`
`}list(e){let t=e.ordered,r=e.start,i="";for(let s=0;s
`+i+""+n+`>
`}listitem(e){let t="";if(e.task){let r=this.checkbox({checked:!!e.checked});e.loose?e.tokens[0]?.type==="paragraph"?(e.tokens[0].text=r+" "+e.tokens[0].text,e.tokens[0].tokens&&e.tokens[0].tokens.length>0&&e.tokens[0].tokens[0].type==="text"&&(e.tokens[0].tokens[0].text=r+" "+Cc(e.tokens[0].tokens[0].text),e.tokens[0].tokens[0].escaped=!0)):e.tokens.unshift({type:"text",raw:r+" ",text:r+" ",escaped:!0}):t+=r+" "}return t+=this.parser.parse(e.tokens,!!e.loose),`${t}
`}checkbox({checked:e}){return" '}paragraph({tokens:e}){return`${this.parser.parseInline(e)}
`}table(e){let t="",r="";for(let n=0;n${i}`),`
`}tablerow({text:e}){return`
${e}
`}tablecell(e){let t=this.parser.parseInline(e.tokens),r=e.header?"th":"td";return(e.align?`<${r} align="${e.align}">`:`<${r}>`)+t+`${r}>
`}strong({tokens:e}){return`${this.parser.parseInline(e)} `}em({tokens:e}){return`${this.parser.parseInline(e)} `}codespan({text:e}){return`${Cc(e,!0)}`}br(e){return" "}del({tokens:e}){return`${this.parser.parseInline(e)}`}link({href:e,title:t,tokens:r}){let i=this.parser.parseInline(r),n=tre(e);if(n===null)return i;e=n;let a='"+i+" ",a}image({href:e,title:t,text:r,tokens:i}){i&&(r=this.parser.parseInline(i,this.parser.textRenderer));let n=tre(e);if(n===null)return Cc(r);e=n;let a=` ",a}text(e){return"tokens"in e&&e.tokens?this.parser.parseInline(e.tokens):"escaped"in e&&e.escaped?e.text:Cc(e.text)}},aN=class{static{o(this,"$")}strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return""+e}image({text:e}){return""+e}br(){return""}},Bu=class KM{static{o(this,"l")}options;renderer;textRenderer;constructor(t){this.options=t||Sp,this.options.renderer=this.options.renderer||new k4,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new aN}static parse(t,r){return new KM(r).parse(t)}static parseInline(t,r){return new KM(r).parseInline(t)}parse(t,r=!0){let i="";for(let n=0;n{let s=n[a].flat(1/0);r=r.concat(this.walkTokens(s,t))}):n.tokens&&(r=r.concat(this.walkTokens(n.tokens,t)))}}return r}use(...e){let t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(r=>{let i={...r};if(i.async=this.defaults.async||i.async||!1,r.extensions&&(r.extensions.forEach(n=>{if(!n.name)throw new Error("extension name required");if("renderer"in n){let a=t.renderers[n.name];a?t.renderers[n.name]=function(...s){let l=n.renderer.apply(this,s);return l===!1&&(l=a.apply(this,s)),l}:t.renderers[n.name]=n.renderer}if("tokenizer"in n){if(!n.level||n.level!=="block"&&n.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let a=t[n.level];a?a.unshift(n.tokenizer):t[n.level]=[n.tokenizer],n.start&&(n.level==="block"?t.startBlock?t.startBlock.push(n.start):t.startBlock=[n.start]:n.level==="inline"&&(t.startInline?t.startInline.push(n.start):t.startInline=[n.start]))}"childTokens"in n&&n.childTokens&&(t.childTokens[n.name]=n.childTokens)}),i.extensions=t),r.renderer){let n=this.defaults.renderer||new k4(this.defaults);for(let a in r.renderer){if(!(a in n))throw new Error(`renderer '${a}' does not exist`);if(["options","parser"].includes(a))continue;let s=a,l=r.renderer[s],u=n[s];n[s]=(...h)=>{let d=l.apply(n,h);return d===!1&&(d=u.apply(n,h)),d||""}}i.renderer=n}if(r.tokenizer){let n=this.defaults.tokenizer||new C4(this.defaults);for(let a in r.tokenizer){if(!(a in n))throw new Error(`tokenizer '${a}' does not exist`);if(["options","rules","lexer"].includes(a))continue;let s=a,l=r.tokenizer[s],u=n[s];n[s]=(...h)=>{let d=l.apply(n,h);return d===!1&&(d=u.apply(n,h)),d}}i.tokenizer=n}if(r.hooks){let n=this.defaults.hooks||new Hx;for(let a in r.hooks){if(!(a in n))throw new Error(`hook '${a}' does not exist`);if(["options","block"].includes(a))continue;let s=a,l=r.hooks[s],u=n[s];Hx.passThroughHooks.has(a)?n[s]=h=>{if(this.defaults.async&&Hx.passThroughHooksRespectAsync.has(a))return Promise.resolve(l.call(n,h)).then(f=>u.call(n,f));let d=l.call(n,h);return u.call(n,d)}:n[s]=(...h)=>{let d=l.apply(n,h);return d===!1&&(d=u.apply(n,h)),d}}i.hooks=n}if(r.walkTokens){let n=this.defaults.walkTokens,a=r.walkTokens;i.walkTokens=function(s){let l=[];return l.push(a.call(this,s)),n&&(l=l.concat(n.call(this,s))),l}}this.defaults={...this.defaults,...i}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return Pu.lex(e,t??this.defaults)}parser(e,t){return Bu.parse(e,t??this.defaults)}parseMarkdown(e){return(t,r)=>{let i={...r},n={...this.defaults,...i},a=this.onError(!!n.silent,!!n.async);if(this.defaults.async===!0&&i.async===!1)return a(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof t>"u"||t===null)return a(new Error("marked(): input parameter is undefined or null"));if(typeof t!="string")return a(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(t)+", string expected"));n.hooks&&(n.hooks.options=n,n.hooks.block=e);let s=n.hooks?n.hooks.provideLexer():e?Pu.lex:Pu.lexInline,l=n.hooks?n.hooks.provideParser():e?Bu.parse:Bu.parseInline;if(n.async)return Promise.resolve(n.hooks?n.hooks.preprocess(t):t).then(u=>s(u,n)).then(u=>n.hooks?n.hooks.processAllTokens(u):u).then(u=>n.walkTokens?Promise.all(this.walkTokens(u,n.walkTokens)).then(()=>u):u).then(u=>l(u,n)).then(u=>n.hooks?n.hooks.postprocess(u):u).catch(a);try{n.hooks&&(t=n.hooks.preprocess(t));let u=s(t,n);n.hooks&&(u=n.hooks.processAllTokens(u)),n.walkTokens&&this.walkTokens(u,n.walkTokens);let h=l(u,n);return n.hooks&&(h=n.hooks.postprocess(h)),h}catch(u){return a(u)}}}onError(e,t){return r=>{if(r.message+=`
Please report this to https://github.com/markedjs/marked.`,e){let i="An error occurred:
"+Cc(r.message+"",!0)+" ";return t?Promise.resolve(i):i}if(t)return Promise.reject(r);throw r}}},wp=new QWe;o(ni,"d");ni.options=ni.setOptions=function(e){return wp.setOptions(e),ni.defaults=wp.defaults,nre(ni.defaults),ni};ni.getDefaults=ZM;ni.defaults=Sp;ni.use=function(...e){return wp.use(...e),ni.defaults=wp.defaults,nre(ni.defaults),ni};ni.walkTokens=function(e,t){return wp.walkTokens(e,t)};ni.parseInline=wp.parseInline;ni.Parser=Bu;ni.parser=Bu.parse;ni.Renderer=k4;ni.TextRenderer=aN;ni.Lexer=Pu;ni.lexer=Pu.lex;ni.Tokenizer=C4;ni.Hooks=Hx;ni.parse=ni;kYt=ni.options,wYt=ni.setOptions,SYt=ni.use,EYt=ni.walkTokens,AYt=ni.parseInline,_Yt=Bu.parse,DYt=Pu.lex});function JWe(e,{markdownAutoWrap:t}){let i=e.replace(/ /g,`
`).replace(/\n{2,}/g,`
`);return fk(i)}function gre(e){return e.split(/\\n|\n| /gi).map(t=>t.trim().match(/<[^>]+>|[^\s<>]+/g)?.map(r=>({content:r,type:"normal"}))??[])}function yre(e,t={}){let r=JWe(e,t),i=ni.lexer(r),n=[[]],a=0;function s(l,u="normal"){l.type==="text"?l.text.split(`
`).forEach((d,f)=>{f!==0&&(a++,n.push([])),d.split(" ").forEach(p=>{p=p.replace(/'/g,"'"),p&&n[a].push({content:p,type:u})})}):l.type==="strong"||l.type==="em"?l.tokens.forEach(h=>{s(h,l.type)}):l.type==="html"&&n[a].push({content:l.text,type:"normal"})}return o(s,"processNode"),i.forEach(l=>{l.type==="paragraph"?l.tokens?.forEach(u=>{s(u)}):l.type==="html"?n[a].push({content:l.text,type:"normal"}):n[a].push({content:l.raw,type:"normal"})}),n}function vre(e){return e?`${e.replace(/\\n|\n/g," ")}
`:""}function xre(e,{markdownAutoWrap:t}={}){let r=ni.lexer(e);function i(n){return n.type==="text"?t===!1?n.text.replace(/\n */g," ").replace(/ /g," "):n.text.replace(/\n */g," "):n.type==="strong"?`${n.tokens?.map(i).join("")} `:n.type==="em"?`${n.tokens?.map(i).join("")} `:n.type==="paragraph"?`${n.tokens?.map(i).join("")}
`:n.type==="space"?"":n.type==="html"?`${n.text}`:n.type==="escape"?n.text:(Z.warn(`Unsupported markdown: ${n.type}`),n.raw)}return o(i,"output"),r.map(i).join("")}var bre=z(()=>{"use strict";mre();RD();St();o(JWe,"preprocessMarkdown");o(gre,"nonMarkdownToLines");o(yre,"markdownToLines");o(vre,"nonMarkdownToHTML");o(xre,"markdownToHTML")});function eqe(e){return Intl.Segmenter?[...new Intl.Segmenter().segment(e)].map(t=>t.segment):[...e]}function tqe(e,t){let r=eqe(t.content);return Tre(e,[],r,t.type)}function Tre(e,t,r,i){if(r.length===0)return[{content:t.join(""),type:i},{content:"",type:i}];let[n,...a]=r,s=[...t,n];return e([{content:s.join(""),type:i}])?Tre(e,s,a,i):(t.length===0&&n&&(t.push(n),r.shift()),[{content:t.join(""),type:i},{content:r.join(""),type:i}])}function Cre(e,t){if(e.some(({content:r})=>r.includes(`
`)))throw new Error("splitLineToFitWidth does not support newlines in the line");return sN(e,t)}function sN(e,t,r=[],i=[]){if(e.length===0)return i.length>0&&r.push(i),r.length>0?r:[];let n="";e[0].content===" "&&(n=" ",e.shift());let a=e.shift()??{content:" ",type:"normal"},s=[...i];if(n!==""&&s.push({content:n,type:"normal"}),s.push(a),t(s))return sN(e,t,r,s);if(i.length>0)r.push(i),e.unshift(a);else if(a.content){let[l,u]=tqe(t,a);r.push([l]),u.content&&e.unshift(u)}return sN(e,t,r)}var kre=z(()=>{"use strict";o(eqe,"splitTextToChars");o(tqe,"splitWordToFitWidth");o(Tre,"splitWordToFitWidthRecursion");o(Cre,"splitLineToFitWidth");o(sN,"splitLineToFitWidthRecursion")});function wre(e,t){t&&e.attr("style",t)}async function rqe(e,t,r,i,n=!1,a=Nt()){let s=e.append("foreignObject");s.attr("width",`${Math.min(10*r,Sre)}px`),s.attr("height",`${Math.min(10*r,Sre)}px`);let l=s.append("xhtml:div"),u=Bi(t.label)?await Fm(t.label.replace(vt.lineBreakRegex,`
`),a):fr(t.label,a),h=t.isNode?"nodeLabel":"edgeLabel",d=l.append("span");d.html(u),wre(d,t.labelStyle),d.attr("class",`${h} ${i}`),wre(l,t.labelStyle),l.style("display","table-cell"),l.style("white-space","nowrap"),l.style("line-height","1.5"),r!==Number.POSITIVE_INFINITY&&(l.style("max-width",r+"px"),l.style("text-align","center")),l.attr("xmlns","http://www.w3.org/1999/xhtml"),n&&l.attr("class","labelBkg");let f=l.node().getBoundingClientRect();return f.width===r&&(l.style("display","table"),l.style("white-space","break-spaces"),l.style("width",r+"px"),f=l.node().getBoundingClientRect()),s.node()}function oN(e,t,r,i=!1){let n=e.append("tspan").attr("class","text-outer-tspan").attr("x",0).attr("y",t*r-.1+"em").attr("dy",r+"em");return i&&n.attr("text-anchor","middle"),n}function iqe(e,t,r){let i=e.append("text"),n=oN(i,1,t);lN(n,r);let a=n.node().getComputedTextLength();return i.remove(),a}function Are(e,t,r){let i=e.append("text"),n=oN(i,1,t);lN(n,[{content:r,type:"normal"}]);let a=n.node()?.getBoundingClientRect();return a&&i.remove(),a}function nqe(e,t,r,i=!1,n=!1){let s=t.append("g"),l=s.insert("rect").attr("class","background").attr("style","stroke: none"),u=s.append("text").attr("y","-10.1");n&&u.attr("text-anchor","middle");let h=0;for(let d of r){let f=o(m=>iqe(s,1.1,m)<=e,"checkWidth"),p=f(d)?[d]:Cre(d,f);for(let m of p){let g=oN(u,h,1.1,n);lN(g,m),h++}}if(i){let d=u.node().getBBox(),f=2;return l.attr("x",d.x-f).attr("y",d.y-f).attr("width",d.width+2*f).attr("height",d.height+2*f),s.node()}else return u.node()}function Ere(e){let t=/&(amp|lt|gt);/g;return e.replace(t,(r,i)=>{switch(i){case"amp":return"&";case"lt":return"<";case"gt":return">";default:return r}})}function lN(e,t){e.text(""),t.forEach((r,i)=>{let n=e.append("tspan").attr("font-style",r.type==="em"?"italic":"normal").attr("class","text-inner-tspan").attr("font-weight",r.type==="strong"?"bold":"normal");i===0?n.text(Ere(r.content)):n.text(" "+Ere(r.content))})}async function aqe(e,t={}){let r=[];e.replace(/(fa[bklrs]?):fa-([\w-]+)/g,(n,a,s)=>(r.push((async()=>{let l=`${a}:${s}`;return await Zj(l)?await ks(l,void 0,{class:"label-icon"}):` `})()),n));let i=await Promise.all(r);return e.replace(/(fa[bklrs]?):fa-([\w-]+)/g,()=>i.shift()??"")}var Sre,wi,_s=z(()=>{"use strict";Rr();Ir();St();bre();Xt();uc();kre();br();o(wre,"applyStyle");Sre=16384;o(rqe,"addHtmlSpan");o(oN,"createTspan");o(iqe,"computeWidthOfText");o(Are,"computeDimensionOfText");o(nqe,"createFormattedText");o(Ere,"decodeHTMLEntities");o(lN,"updateTextContentAndStyles");o(aqe,"replaceIconSubstring");wi=o(async(e,t="",{style:r="",isTitle:i=!1,classes:n="",useHtmlLabels:a=!0,markdown:s=!0,isNode:l=!0,width:u=200,addSvgBackground:h=!1}={},d)=>{if(Z.debug("XYZ createText",t,r,i,n,a,l,"addSvgBackground: ",h),a){let f=s?xre(t,d):vre(t),p=await aqe(Qa(f),d),m=t.replace(/\\\\/g,"\\"),g={isNode:l,label:Bi(t)?m:p,labelStyle:r.replace("fill:","color:")};return await rqe(e,g,u,n,h,d)}else{let f=Qa(t.replace(/ /g," ")),p=s?yre(f.replace(" "," "),d):gre(f),m=nqe(u,e,p,t?h:!1,!l);if(l){/stroke:/.exec(r)&&(r=r.replace("stroke:","lineColor:"));let g=r.replace(/stroke:[^;]+;?/g,"").replace(/stroke-width:[^;]+;?/g,"").replace(/fill:[^;]+;?/g,"").replace(/color:/g,"fill:");Je(m).attr("style",g)}else{let g=r.replace(/stroke:[^;]+;?/g,"").replace(/stroke-width:[^;]+;?/g,"").replace(/fill:[^;]+;?/g,"").replace(/background:/g,"fill:");Je(m).select("rect").attr("style",g.replace(/background:/g,"fill:"));let y=r.replace(/stroke:[^;]+;?/g,"").replace(/stroke-width:[^;]+;?/g,"").replace(/fill:[^;]+;?/g,"").replace(/color:/g,"fill:");Je(m).select("text").attr("style",y)}return i?Je(m).selectAll("tspan.text-outer-tspan").classed("title-row",!0):Je(m).selectAll("tspan.text-outer-tspan").classed("row",!0),m}},"createText")});async function E4(e,t){let r=e.getElementsByTagName("img");if(!r||r.length===0)return;let i=t.replace(/ ]*>/g,"").trim()==="";await Promise.all([...r].map(n=>new Promise(a=>{function s(){if(n.style.display="flex",n.style.flexDirection="column",i){let l=ge().fontSize?ge().fontSize:window.getComputedStyle(document.body).fontSize,u=5,[h=or.fontSize]=Za(l),d=h*u+"px";n.style.minWidth=d,n.style.maxWidth=d}else n.style.width="100%";a(n)}o(s,"setupImage"),setTimeout(()=>{n.complete&&s()}),n.addEventListener("error",s),n.addEventListener("load",s)})))}var cN=z(()=>{"use strict";Ut();Bn();Xt();o(E4,"configureLabelImages")});function tr(e){let t=e.map((r,i)=>`${i===0?"M":"L"}${r.x},${r.y}`);return t.push("Z"),t.join(" ")}function Bo(e,t,r,i,n,a){let s=[],u=r-e,h=i-t,d=u/a,f=2*Math.PI/d,p=t+h/2;for(let m=0;m<=50;m++){let g=m/50,y=e+g*u,v=p+n*Math.sin(f*(y-e));s.push({x:y,y:v})}return s}function Ep(e,t,r,i,n,a){let s=[],l=n*Math.PI/180,d=(a*Math.PI/180-l)/(i-1);for(let f=0;fu.tagName==="path"),r=document.createElementNS("http://www.w3.org/2000/svg","path"),i=t.map(u=>u.getAttribute("d")).filter(u=>u!==null).join(" ");r.setAttribute("d",i);let n=t.find(u=>u.getAttribute("fill")!=="none"),a=t.find(u=>u.getAttribute("stroke")!=="none"),s=o((u,h)=>u?.getAttribute(h)??void 0,"getAttr");if(n){let u={fill:s(n,"fill"),"fill-opacity":s(n,"fill-opacity")??"1"};Object.entries(u).forEach(([h,d])=>{d&&r.setAttribute(h,d)})}if(a){let u={stroke:s(a,"stroke"),"stroke-width":s(a,"stroke-width")??"1","stroke-opacity":s(a,"stroke-opacity")??"1"};Object.entries(u).forEach(([h,d])=>{d&&r.setAttribute(h,d)})}let l=document.createElementNS("http://www.w3.org/2000/svg","g");return l.appendChild(r),l}var At,A4,ft,Ct,Wt=z(()=>{"use strict";_s();Ut();br();Rr();Ir();Xt();cN();At=o(async(e,t,r)=>{let i,n=t.useHtmlLabels||Aa(ge()?.htmlLabels);r?i=r:i="node default";let a=e.insert("g").attr("class",i).attr("id",t.domId||t.id),s=a.insert("g").attr("class","label").attr("style",ii(t.labelStyle)),l;t.label===void 0?l="":l=typeof t.label=="string"?t.label:t.label[0];let u=!!t.icon||!!t.img,h=t.labelType==="markdown",d=await wi(s,fr(Qa(l),ge()),{useHtmlLabels:n,width:t.width||ge().flowchart?.wrappingWidth,classes:h?"markdown-node-label":"",style:t.labelStyle,addSvgBackground:u,markdown:h},ge()),f=d.getBBox(),p=(t?.padding??0)/2;if(n){let m=d.children[0],g=Je(d);await E4(m,l),f=m.getBoundingClientRect(),g.attr("width",f.width),g.attr("height",f.height)}return n?s.attr("transform","translate("+-f.width/2+", "+-f.height/2+")"):s.attr("transform","translate(0, "+-f.height/2+")"),t.centerLabel&&s.attr("transform","translate("+-f.width/2+", "+-f.height/2+")"),s.insert("rect",":first-child"),{shapeSvg:a,bbox:f,halfPadding:p,label:s}},"labelHelper"),A4=o(async(e,t,r)=>{let i=r.useHtmlLabels??Mr(ge()),n=e.insert("g").attr("class","label").attr("style",r.labelStyle||""),a=await wi(n,fr(Qa(t),ge()),{useHtmlLabels:i,width:r.width||ge()?.flowchart?.wrappingWidth,style:r.labelStyle,addSvgBackground:!!r.icon||!!r.img}),s=a.getBBox(),l=r.padding/2;if(Mr(ge())){let u=a.children[0],h=Je(a);s=u.getBoundingClientRect(),h.attr("width",s.width),h.attr("height",s.height)}return i?n.attr("transform","translate("+-s.width/2+", "+-s.height/2+")"):n.attr("transform","translate(0, "+-s.height/2+")"),r.centerLabel&&n.attr("transform","translate("+-s.width/2+", "+-s.height/2+")"),n.insert("rect",":first-child"),{shapeSvg:e,bbox:s,halfPadding:l,label:n}},"insertLabel"),ft=o((e,t)=>{let r=t.node().getBBox();e.width=r.width,e.height=r.height},"updateNodeBounds"),Ct=o((e,t)=>(e.look==="handDrawn"?"rough-node":"node")+" "+e.cssClasses+" "+(t||""),"getNodeClasses");o(tr,"createPathFromPoints");o(Bo,"generateFullSineWavePoints");o(Ep,"generateCirclePoints");o(uN,"mergePaths")});function sqe(e,t){return e.intersect(t)}var _re,Dre=z(()=>{"use strict";o(sqe,"intersectNode");_re=sqe});function oqe(e,t,r,i){var n=e.x,a=e.y,s=n-i.x,l=a-i.y,u=Math.sqrt(t*t*l*l+r*r*s*s),h=Math.abs(t*r*s/u);i.x{"use strict";o(oqe,"intersectEllipse");_4=oqe});function lqe(e,t,r){return _4(e,t,t,r)}var Rre,Lre=z(()=>{"use strict";hN();o(lqe,"intersectCircle");Rre=lqe});function cqe(e,t,r,i){{let n=t.y-e.y,a=e.x-t.x,s=t.x*e.y-e.x*t.y,l=n*r.x+a*r.y+s,u=n*i.x+a*i.y+s,h=1e-6;if(l!==0&&u!==0&&Mre(l,u))return;let d=i.y-r.y,f=r.x-i.x,p=i.x*r.y-r.x*i.y,m=d*e.x+f*e.y+p,g=d*t.x+f*t.y+p;if(Math.abs(m)0}var Nre,Ire=z(()=>{"use strict";o(cqe,"intersectLine");o(Mre,"sameSign");Nre=cqe});function uqe(e,t,r){let i=e.x,n=e.y,a=[],s=Number.POSITIVE_INFINITY,l=Number.POSITIVE_INFINITY;typeof t.forEach=="function"?t.forEach(function(d){s=Math.min(s,d.x),l=Math.min(l,d.y)}):(s=Math.min(s,t.x),l=Math.min(l,t.y));let u=i-e.width/2-s,h=n-e.height/2-l;for(let d=0;d1&&a.sort(function(d,f){let p=d.x-r.x,m=d.y-r.y,g=Math.sqrt(p*p+m*m),y=f.x-r.x,v=f.y-r.y,x=Math.sqrt(y*y+v*v);return g{"use strict";Ire();o(uqe,"intersectPolygon");Ore=uqe});var hqe,cd,dN=z(()=>{"use strict";hqe=o((e,t)=>{var r=e.x,i=e.y,n=t.x-r,a=t.y-i,s=e.width/2,l=e.height/2,u,h;return Math.abs(a)*s>Math.abs(n)*l?(a<0&&(l=-l),u=a===0?0:l*n/a,h=l):(n<0&&(s=-s),u=s,h=n===0?0:s*a/n),{x:r+u,y:i+h}},"intersectRect"),cd=hqe});var lt,Kt=z(()=>{"use strict";Dre();Lre();hN();Pre();dN();lt={node:_re,circle:Rre,ellipse:_4,polygon:Ore,rect:cd}});var Bre,kc,dqe,Xx,ct,mt,fqe,Ht=z(()=>{"use strict";Ut();Bre=o(e=>{let{handDrawnSeed:t}=ge();return{fill:e,hachureAngle:120,hachureGap:4,fillWeight:2,roughness:.7,stroke:e,seed:t}},"solidStateFill"),kc=o(e=>{let t=dqe([...e.cssCompiledStyles||[],...e.cssStyles||[],...e.labelStyle||[]]);return{stylesMap:t,stylesArray:[...t]}},"compileStyles"),dqe=o(e=>{let t=new Map;return e.forEach(r=>{let[i,n]=r.split(":");t.set(i.trim(),n?.trim())}),t},"styles2Map"),Xx=o(e=>e==="color"||e==="font-size"||e==="font-family"||e==="font-weight"||e==="font-style"||e==="text-decoration"||e==="text-align"||e==="text-transform"||e==="line-height"||e==="letter-spacing"||e==="word-spacing"||e==="text-shadow"||e==="text-overflow"||e==="white-space"||e==="word-wrap"||e==="word-break"||e==="overflow-wrap"||e==="hyphens","isLabelStyle"),ct=o(e=>{let{stylesArray:t}=kc(e),r=[],i=[],n=[],a=[];return t.forEach(s=>{let l=s[0];Xx(l)?r.push(s.join(":")+" !important"):(i.push(s.join(":")+" !important"),l.includes("stroke")&&n.push(s.join(":")+" !important"),l==="fill"&&a.push(s.join(":")+" !important"))}),{labelStyles:r.join(";"),nodeStyles:i.join(";"),stylesArray:t,borderStyles:n,backgroundStyles:a}},"styles2String"),mt=o((e,t)=>{let{themeVariables:r,handDrawnSeed:i}=ge(),{nodeBorder:n,mainBkg:a}=r,{stylesMap:s}=kc(e);return Object.assign({roughness:.7,fill:s.get("fill")||a,fillStyle:"hachure",fillWeight:4,hachureGap:5.2,stroke:s.get("stroke")||n,seed:i,strokeWidth:s.get("stroke-width")?.replace("px","")||1.3,fillLineDash:[0,0],strokeLineDash:fqe(s.get("stroke-dasharray"))},t)},"userNodeOverrides"),fqe=o(e=>{if(!e)return[0,0];let t=e.trim().split(/\s+/).map(Number);if(t.length===1){let n=isNaN(t[0])?0:t[0];return[n,n]}let r=isNaN(t[0])?0:t[0],i=isNaN(t[1])?0:t[1];return[r,i]},"getStrokeDashArray")});function fN(e,t,r){if(e&&e.length){let[i,n]=t,a=Math.PI/180*r,s=Math.cos(a),l=Math.sin(a);for(let u of e){let[h,d]=u;u[0]=(h-i)*s-(d-n)*l+i,u[1]=(h-i)*l+(d-n)*s+n}}}function pqe(e,t){return e[0]===t[0]&&e[1]===t[1]}function mqe(e,t,r,i=1){let n=r,a=Math.max(t,.1),s=e[0]&&e[0][0]&&typeof e[0][0]=="number"?[e]:e,l=[0,0];if(n)for(let h of s)fN(h,l,n);let u=(function(h,d,f){let p=[];for(let b of h){let T=[...b];pqe(T[0],T[T.length-1])||T.push([T[0][0],T[0][1]]),T.length>2&&p.push(T)}let m=[];d=Math.max(d,.1);let g=[];for(let b of p)for(let T=0;Tb.yminT.ymin?1:b.xT.x?1:b.ymax===T.ymax?0:(b.ymax-T.ymax)/Math.abs(b.ymax-T.ymax))),!g.length)return m;let y=[],v=g[0].ymin,x=0;for(;y.length||g.length;){if(g.length){let b=-1;for(let T=0;Tv);T++)b=T;g.splice(0,b+1).forEach((T=>{y.push({s:v,edge:T})}))}if(y=y.filter((b=>!(b.edge.ymax<=v))),y.sort(((b,T)=>b.edge.x===T.edge.x?0:(b.edge.x-T.edge.x)/Math.abs(b.edge.x-T.edge.x))),(f!==1||x%d==0)&&y.length>1)for(let b=0;b=y.length)break;let w=y[b].edge,C=y[T].edge;m.push([[Math.round(w.x),v],[Math.round(C.x),v]])}v+=f,y.forEach((b=>{b.edge.x=b.edge.x+f*b.edge.islope})),x++}return m})(s,a,i);if(n){for(let h of s)fN(h,l,-n);(function(h,d,f){let p=[];h.forEach((m=>p.push(...m))),fN(p,d,f)})(u,l,-n)}return u}function Jx(e,t){var r;let i=t.hachureAngle+90,n=t.hachureGap;n<0&&(n=4*t.strokeWidth),n=Math.round(Math.max(n,.1));let a=1;return t.roughness>=1&&(((r=t.randomizer)===null||r===void 0?void 0:r.next())||Math.random())>.7&&(a=n),mqe(e,n,i,a||1)}function B4(e){let t=e[0],r=e[1];return Math.sqrt(Math.pow(t[0]-r[0],2)+Math.pow(t[1]-r[1],2))}function mN(e,t){return e.type===t}function DN(e){let t=[],r=(function(s){let l=new Array;for(;s!=="";)if(s.match(/^([ \t\r\n,]+)/))s=s.substr(RegExp.$1.length);else if(s.match(/^([aAcChHlLmMqQsStTvVzZ])/))l[l.length]={type:gqe,text:RegExp.$1},s=s.substr(RegExp.$1.length);else{if(!s.match(/^(([-+]?[0-9]+(\.[0-9]*)?|[-+]?\.[0-9]+)([eE][-+]?[0-9]+)?)/))return[];l[l.length]={type:pN,text:`${parseFloat(RegExp.$1)}`},s=s.substr(RegExp.$1.length)}return l[l.length]={type:Fre,text:""},l})(e),i="BOD",n=0,a=r[n];for(;!mN(a,Fre);){let s=0,l=[];if(i==="BOD"){if(a.text!=="M"&&a.text!=="m")return DN("M0,0"+e);n++,s=D4[a.text],i=a.text}else mN(a,pN)?s=D4[i]:(n++,s=D4[a.text],i=a.text);if(!(n+sd%2?h+r:h+t));a.push({key:"C",data:u}),t=u[4],r=u[5];break}case"Q":a.push({key:"Q",data:[...l]}),t=l[2],r=l[3];break;case"q":{let u=l.map(((h,d)=>d%2?h+r:h+t));a.push({key:"Q",data:u}),t=u[2],r=u[3];break}case"A":a.push({key:"A",data:[...l]}),t=l[5],r=l[6];break;case"a":t+=l[5],r+=l[6],a.push({key:"A",data:[l[0],l[1],l[2],l[3],l[4],t,r]});break;case"H":a.push({key:"H",data:[...l]}),t=l[0];break;case"h":t+=l[0],a.push({key:"H",data:[t]});break;case"V":a.push({key:"V",data:[...l]}),r=l[0];break;case"v":r+=l[0],a.push({key:"V",data:[r]});break;case"S":a.push({key:"S",data:[...l]}),t=l[2],r=l[3];break;case"s":{let u=l.map(((h,d)=>d%2?h+r:h+t));a.push({key:"S",data:u}),t=u[2],r=u[3];break}case"T":a.push({key:"T",data:[...l]}),t=l[0],r=l[1];break;case"t":t+=l[0],r+=l[1],a.push({key:"T",data:[t,r]});break;case"Z":case"z":a.push({key:"Z",data:[]}),t=i,r=n}return a}function Yre(e){let t=[],r="",i=0,n=0,a=0,s=0,l=0,u=0;for(let{key:h,data:d}of e){switch(h){case"M":t.push({key:"M",data:[...d]}),[i,n]=d,[a,s]=d;break;case"C":t.push({key:"C",data:[...d]}),i=d[4],n=d[5],l=d[2],u=d[3];break;case"L":t.push({key:"L",data:[...d]}),[i,n]=d;break;case"H":i=d[0],t.push({key:"L",data:[i,n]});break;case"V":n=d[0],t.push({key:"L",data:[i,n]});break;case"S":{let f=0,p=0;r==="C"||r==="S"?(f=i+(i-l),p=n+(n-u)):(f=i,p=n),t.push({key:"C",data:[f,p,...d]}),l=d[0],u=d[1],i=d[2],n=d[3];break}case"T":{let[f,p]=d,m=0,g=0;r==="Q"||r==="T"?(m=i+(i-l),g=n+(n-u)):(m=i,g=n);let y=i+2*(m-i)/3,v=n+2*(g-n)/3,x=f+2*(m-f)/3,b=p+2*(g-p)/3;t.push({key:"C",data:[y,v,x,b,f,p]}),l=m,u=g,i=f,n=p;break}case"Q":{let[f,p,m,g]=d,y=i+2*(f-i)/3,v=n+2*(p-n)/3,x=m+2*(f-m)/3,b=g+2*(p-g)/3;t.push({key:"C",data:[y,v,x,b,m,g]}),l=f,u=p,i=m,n=g;break}case"A":{let f=Math.abs(d[0]),p=Math.abs(d[1]),m=d[2],g=d[3],y=d[4],v=d[5],x=d[6];f===0||p===0?(t.push({key:"C",data:[i,n,v,x,v,x]}),i=v,n=x):(i!==v||n!==x)&&(jre(i,n,v,x,f,p,m,g,y).forEach((function(b){t.push({key:"C",data:b})})),i=v,n=x);break}case"Z":t.push({key:"Z",data:[]}),i=a,n=s}r=h}return t}function Kx(e,t,r){return[e*Math.cos(r)-t*Math.sin(r),e*Math.sin(r)+t*Math.cos(r)]}function jre(e,t,r,i,n,a,s,l,u,h){let d=(f=s,Math.PI*f/180);var f;let p=[],m=0,g=0,y=0,v=0;if(h)[m,g,y,v]=h;else{[e,t]=Kx(e,t,-d),[r,i]=Kx(r,i,-d);let _=(e-r)/2,R=(t-i)/2,M=_*_/(n*n)+R*R/(a*a);M>1&&(M=Math.sqrt(M),n*=M,a*=M);let L=n*n,B=a*a,O=L*B-L*R*R-B*_*_,$=L*R*R+B*_*_,G=(l===u?-1:1)*Math.sqrt(Math.abs(O/$));y=G*n*R/a+(e+r)/2,v=G*-a*_/n+(t+i)/2,m=Math.asin(parseFloat(((t-v)/a).toFixed(9))),g=Math.asin(parseFloat(((i-v)/a).toFixed(9))),eg&&(m-=2*Math.PI),!u&&g>m&&(g-=2*Math.PI)}let x=g-m;if(Math.abs(x)>120*Math.PI/180){let _=g,R=r,M=i;g=u&&g>m?m+120*Math.PI/180*1:m+120*Math.PI/180*-1,p=jre(r=y+n*Math.cos(g),i=v+a*Math.sin(g),R,M,n,a,s,0,u,[g,_,y,v])}x=g-m;let b=Math.cos(m),T=Math.sin(m),w=Math.cos(g),C=Math.sin(g),k=Math.tan(x/4),E=4/3*n*k,A=4/3*a*k,N=[e,t],P=[e+E*T,t-A*b],I=[r+E*C,i-A*w],D=[r,i];if(P[0]=2*N[0]-P[0],P[1]=2*N[1]-P[1],h)return[P,I,D].concat(p);{p=[P,I,D].concat(p);let _=[];for(let R=0;R2){let n=[];for(let a=0;a2*Math.PI&&(m=0,g=2*Math.PI);let y=2*Math.PI/u.curveStepCount,v=Math.min(y/2,(g-m)/2),x=qre(v,h,d,f,p,m,g,1,u);if(!u.disableMultiStroke){let b=qre(v,h,d,f,p,m,g,1.5,u);x.push(...b)}return s&&(l?x.push(...ud(h,d,h+f*Math.cos(m),d+p*Math.sin(m),u),...ud(h,d,h+f*Math.cos(g),d+p*Math.sin(g),u)):x.push({op:"lineTo",data:[h,d]},{op:"lineTo",data:[h+f*Math.cos(m),d+p*Math.sin(m)]})),{type:"path",ops:x}}function Gre(e,t){let r=Yre(Hre(DN(e))),i=[],n=[0,0],a=[0,0];for(let{key:s,data:l}of r)switch(s){case"M":a=[l[0],l[1]],n=[l[0],l[1]];break;case"L":i.push(...ud(a[0],a[1],l[0],l[1],t)),a=[l[0],l[1]];break;case"C":{let[u,h,d,f,p,m]=l;i.push(...xqe(u,h,d,f,p,m,a,t)),a=[p,m];break}case"Z":i.push(...ud(a[0],a[1],n[0],n[1],t)),a=[n[0],n[1]]}return{type:"path",ops:i}}function gN(e,t){let r=[];for(let i of e)if(i.length){let n=t.maxRandomnessOffset||0,a=i.length;if(a>2){r.push({op:"move",data:[i[0][0]+pr(n,t),i[0][1]+pr(n,t)]});for(let s=1;s500?.4:-.0016668*u+1.233334;let d=n.maxRandomnessOffset||0;d*d*100>l&&(d=u/10);let f=d/2,p=.2+.2*Zre(n),m=n.bowing*n.maxRandomnessOffset*(i-t)/200,g=n.bowing*n.maxRandomnessOffset*(e-r)/200;m=pr(m,n,h),g=pr(g,n,h);let y=[],v=o(()=>pr(f,n,h),"M"),x=o(()=>pr(d,n,h),"k"),b=n.preserveVertices;return a&&(s?y.push({op:"move",data:[e+(b?0:v()),t+(b?0:v())]}):y.push({op:"move",data:[e+(b?0:pr(d,n,h)),t+(b?0:pr(d,n,h))]})),s?y.push({op:"bcurveTo",data:[m+e+(r-e)*p+v(),g+t+(i-t)*p+v(),m+e+2*(r-e)*p+v(),g+t+2*(i-t)*p+v(),r+(b?0:v()),i+(b?0:v())]}):y.push({op:"bcurveTo",data:[m+e+(r-e)*p+x(),g+t+(i-t)*p+x(),m+e+2*(r-e)*p+x(),g+t+2*(i-t)*p+x(),r+(b?0:x()),i+(b?0:x())]}),y}function R4(e,t,r){if(!e.length)return[];let i=[];i.push([e[0][0]+pr(t,r),e[0][1]+pr(t,r)]),i.push([e[0][0]+pr(t,r),e[0][1]+pr(t,r)]);for(let n=1;n3){let a=[],s=1-r.curveTightness;n.push({op:"move",data:[e[1][0],e[1][1]]});for(let l=1;l+21&&n.push(l)):n.push(l),n.push(e[t+3])}else{let u=e[t+0],h=e[t+1],d=e[t+2],f=e[t+3],p=Ap(u,h,.5),m=Ap(h,d,.5),g=Ap(d,f,.5),y=Ap(p,m,.5),v=Ap(m,g,.5),x=Ap(y,v,.5);EN([u,p,y,x],0,r,n),EN([x,v,g,f],0,r,n)}var a,s;return n}function Tqe(e,t){return P4(e,0,e.length,t)}function P4(e,t,r,i,n){let a=n||[],s=e[t],l=e[r-1],u=0,h=1;for(let d=t+1;du&&(u=f,h=d)}return Math.sqrt(u)>i?(P4(e,t,h+1,i,a),P4(e,h,r,i,a)):(a.length||a.push(s),a.push(l)),a}function yN(e,t=.15,r){let i=[],n=(e.length-1)/3;for(let a=0;a0?P4(i,0,i.length,r):i}var Qx,vN,xN,bN,TN,CN,Ds,kN,gqe,pN,Fre,D4,yqe,so,Cg,AN,L4,_N,ut,jt=z(()=>{"use strict";o(fN,"t");o(pqe,"e");o(mqe,"s");o(Jx,"n");Qx=class{static{o(this,"o")}constructor(t){this.helper=t}fillPolygons(t,r){return this._fillPolygons(t,r)}_fillPolygons(t,r){let i=Jx(t,r);return{type:"fillSketch",ops:this.renderLines(i,r)}}renderLines(t,r){let i=[];for(let n of t)i.push(...this.helper.doubleLineOps(n[0][0],n[0][1],n[1][0],n[1][1],r));return i}};o(B4,"a");vN=class extends Qx{static{o(this,"h")}fillPolygons(t,r){let i=r.hachureGap;i<0&&(i=4*r.strokeWidth),i=Math.max(i,.1);let n=Jx(t,Object.assign({},r,{hachureGap:i})),a=Math.PI/180*r.hachureAngle,s=[],l=.5*i*Math.cos(a),u=.5*i*Math.sin(a);for(let[h,d]of n)B4([h,d])&&s.push([[h[0]-l,h[1]+u],[...d]],[[h[0]+l,h[1]-u],[...d]]);return{type:"fillSketch",ops:this.renderLines(s,r)}}},xN=class extends Qx{static{o(this,"r")}fillPolygons(t,r){let i=this._fillPolygons(t,r),n=Object.assign({},r,{hachureAngle:r.hachureAngle+90}),a=this._fillPolygons(t,n);return i.ops=i.ops.concat(a.ops),i}},bN=class{static{o(this,"i")}constructor(t){this.helper=t}fillPolygons(t,r){let i=Jx(t,r=Object.assign({},r,{hachureAngle:0}));return this.dotsOnLines(i,r)}dotsOnLines(t,r){let i=[],n=r.hachureGap;n<0&&(n=4*r.strokeWidth),n=Math.max(n,.1);let a=r.fillWeight;a<0&&(a=r.strokeWidth/2);let s=n/4;for(let l of t){let u=B4(l),h=u/n,d=Math.ceil(h)-1,f=u-d*n,p=(l[0][0]+l[1][0])/2-n/4,m=Math.min(l[0][1],l[1][1]);for(let g=0;g{let l=B4(s),u=Math.floor(l/(i+n)),h=(l+n-u*(i+n))/2,d=s[0],f=s[1];d[0]>f[0]&&(d=s[1],f=s[0]);let p=Math.atan((f[1]-d[1])/(f[0]-d[0]));for(let m=0;m{let s=B4(a),l=Math.round(s/(2*r)),u=a[0],h=a[1];u[0]>h[0]&&(u=a[1],h=a[0]);let d=Math.atan((h[1]-u[1])/(h[0]-u[0]));for(let f=0;f2*Math.PI&&(E=0,A=2*Math.PI);let N=(A-E)/b.curveStepCount,P=[];for(let I=E;I<=A;I+=N)P.push([T+C*Math.cos(I),w+k*Math.sin(I)]);return P.push([T+C*Math.cos(A),w+k*Math.sin(A)]),P.push([T,w]),Tg([P],b)})(t,r,i,n,a,s,h));return h.stroke!==so&&d.push(f),this._d("arc",d,h)}curve(t,r){let i=this._o(r),n=[],a=$re(t,i);if(i.fill&&i.fill!==so)if(i.fillStyle==="solid"){let s=$re(t,Object.assign(Object.assign({},i),{disableMultiStroke:!0,roughness:i.roughness?i.roughness+i.fillShapeRoughnessGain:0}));n.push({type:"fillPath",ops:this._mergedShape(s.ops)})}else{let s=[],l=t;if(l.length){let u=typeof l[0][0]=="number"?[l]:l;for(let h of u)h.length<3?s.push(...h):h.length===3?s.push(...yN(Ure([h[0],h[0],h[1],h[2]]),10,(1+i.roughness)/2)):s.push(...yN(Ure(h),10,(1+i.roughness)/2))}s.length&&n.push(Tg([s],i))}return i.stroke!==so&&n.push(a),this._d("curve",n,i)}polygon(t,r){let i=this._o(r),n=[],a=M4(t,!0,i);return i.fill&&(i.fillStyle==="solid"?n.push(gN([t],i)):n.push(Tg([t],i))),i.stroke!==so&&n.push(a),this._d("polygon",n,i)}path(t,r){let i=this._o(r),n=[];if(!t)return this._d("path",n,i);t=(t||"").replace(/\n/g," ").replace(/(-\s)/g,"-").replace("/(ss)/g"," ");let a=i.fill&&i.fill!=="transparent"&&i.fill!==so,s=i.stroke!==so,l=!!(i.simplification&&i.simplification<1),u=(function(d,f,p){let m=Yre(Hre(DN(d))),g=[],y=[],v=[0,0],x=[],b=o(()=>{x.length>=4&&y.push(...yN(x,f)),x=[]},"i"),T=o(()=>{b(),y.length&&(g.push(y),y=[])},"c");for(let{key:C,data:k}of m)switch(C){case"M":T(),v=[k[0],k[1]],y.push(v);break;case"L":b(),y.push([k[0],k[1]]);break;case"C":if(!x.length){let E=y.length?y[y.length-1]:v;x.push([E[0],E[1]])}x.push([k[0],k[1]]),x.push([k[2],k[3]]),x.push([k[4],k[5]]);break;case"Z":b(),y.push([v[0],v[1]])}if(T(),!p)return g;let w=[];for(let C of g){let k=Tqe(C,p);k.length&&w.push(k)}return w})(t,1,l?4-4*(i.simplification||1):(1+i.roughness)/2),h=Gre(t,i);if(a)if(i.fillStyle==="solid")if(u.length===1){let d=Gre(t,Object.assign(Object.assign({},i),{disableMultiStroke:!0,roughness:i.roughness?i.roughness+i.fillShapeRoughnessGain:0}));n.push({type:"fillPath",ops:this._mergedShape(d.ops)})}else n.push(gN(u,i));else n.push(Tg(u,i));return s&&(l?u.forEach((d=>{n.push(M4(d,!1,i))})):n.push(h)),this._d("path",n,i)}opsToPath(t,r){let i="";for(let n of t.ops){let a=typeof r=="number"&&r>=0?n.data.map((s=>+s.toFixed(r))):n.data;switch(n.op){case"move":i+=`M${a[0]} ${a[1]} `;break;case"bcurveTo":i+=`C${a[0]} ${a[1]}, ${a[2]} ${a[3]}, ${a[4]} ${a[5]} `;break;case"lineTo":i+=`L${a[0]} ${a[1]} `}}return i.trim()}toPaths(t){let r=t.sets||[],i=t.options||this.defaultOptions,n=[];for(let a of r){let s=null;switch(a.type){case"path":s={d:this.opsToPath(a),stroke:i.stroke,strokeWidth:i.strokeWidth,fill:so};break;case"fillPath":s={d:this.opsToPath(a),stroke:so,strokeWidth:0,fill:i.fill||so};break;case"fillSketch":s=this.fillSketch(a,i)}s&&n.push(s)}return n}fillSketch(t,r){let i=r.fillWeight;return i<0&&(i=r.strokeWidth/2),{d:this.opsToPath(t),stroke:r.fill||so,strokeWidth:i,fill:so}}_mergedShape(t){return t.filter(((r,i)=>i===0||r.op!=="move"))}},AN=class{static{o(this,"st")}constructor(t,r){this.canvas=t,this.ctx=this.canvas.getContext("2d"),this.gen=new Cg(r)}draw(t){let r=t.sets||[],i=t.options||this.getDefaultOptions(),n=this.ctx,a=t.options.fixedDecimalPlaceDigits;for(let s of r)switch(s.type){case"path":n.save(),n.strokeStyle=i.stroke==="none"?"transparent":i.stroke,n.lineWidth=i.strokeWidth,i.strokeLineDash&&n.setLineDash(i.strokeLineDash),i.strokeLineDashOffset&&(n.lineDashOffset=i.strokeLineDashOffset),this._drawToContext(n,s,a),n.restore();break;case"fillPath":{n.save(),n.fillStyle=i.fill||"";let l=t.shape==="curve"||t.shape==="polygon"||t.shape==="path"?"evenodd":"nonzero";this._drawToContext(n,s,a,l),n.restore();break}case"fillSketch":this.fillSketch(n,s,i)}}fillSketch(t,r,i){let n=i.fillWeight;n<0&&(n=i.strokeWidth/2),t.save(),i.fillLineDash&&t.setLineDash(i.fillLineDash),i.fillLineDashOffset&&(t.lineDashOffset=i.fillLineDashOffset),t.strokeStyle=i.fill||"",t.lineWidth=n,this._drawToContext(t,r,i.fixedDecimalPlaceDigits),t.restore()}_drawToContext(t,r,i,n="nonzero"){t.beginPath();for(let a of r.ops){let s=typeof i=="number"&&i>=0?a.data.map((l=>+l.toFixed(i))):a.data;switch(a.op){case"move":t.moveTo(s[0],s[1]);break;case"bcurveTo":t.bezierCurveTo(s[0],s[1],s[2],s[3],s[4],s[5]);break;case"lineTo":t.lineTo(s[0],s[1])}}r.type==="fillPath"?t.fill(n):t.stroke()}get generator(){return this.gen}getDefaultOptions(){return this.gen.defaultOptions}line(t,r,i,n,a){let s=this.gen.line(t,r,i,n,a);return this.draw(s),s}rectangle(t,r,i,n,a){let s=this.gen.rectangle(t,r,i,n,a);return this.draw(s),s}ellipse(t,r,i,n,a){let s=this.gen.ellipse(t,r,i,n,a);return this.draw(s),s}circle(t,r,i,n){let a=this.gen.circle(t,r,i,n);return this.draw(a),a}linearPath(t,r){let i=this.gen.linearPath(t,r);return this.draw(i),i}polygon(t,r){let i=this.gen.polygon(t,r);return this.draw(i),i}arc(t,r,i,n,a,s,l=!1,u){let h=this.gen.arc(t,r,i,n,a,s,l,u);return this.draw(h),h}curve(t,r){let i=this.gen.curve(t,r);return this.draw(i),i}path(t,r){let i=this.gen.path(t,r);return this.draw(i),i}},L4="http://www.w3.org/2000/svg",_N=class{static{o(this,"ot")}constructor(t,r){this.svg=t,this.gen=new Cg(r)}draw(t){let r=t.sets||[],i=t.options||this.getDefaultOptions(),n=this.svg.ownerDocument||window.document,a=n.createElementNS(L4,"g"),s=t.options.fixedDecimalPlaceDigits;for(let l of r){let u=null;switch(l.type){case"path":u=n.createElementNS(L4,"path"),u.setAttribute("d",this.opsToPath(l,s)),u.setAttribute("stroke",i.stroke),u.setAttribute("stroke-width",i.strokeWidth+""),u.setAttribute("fill","none"),i.strokeLineDash&&u.setAttribute("stroke-dasharray",i.strokeLineDash.join(" ").trim()),i.strokeLineDashOffset&&u.setAttribute("stroke-dashoffset",`${i.strokeLineDashOffset}`);break;case"fillPath":u=n.createElementNS(L4,"path"),u.setAttribute("d",this.opsToPath(l,s)),u.setAttribute("stroke","none"),u.setAttribute("stroke-width","0"),u.setAttribute("fill",i.fill||""),t.shape!=="curve"&&t.shape!=="polygon"||u.setAttribute("fill-rule","evenodd");break;case"fillSketch":u=this.fillSketch(n,l,i)}u&&a.appendChild(u)}return a}fillSketch(t,r,i){let n=i.fillWeight;n<0&&(n=i.strokeWidth/2);let a=t.createElementNS(L4,"path");return a.setAttribute("d",this.opsToPath(r,i.fixedDecimalPlaceDigits)),a.setAttribute("stroke",i.fill||""),a.setAttribute("stroke-width",n+""),a.setAttribute("fill","none"),i.fillLineDash&&a.setAttribute("stroke-dasharray",i.fillLineDash.join(" ").trim()),i.fillLineDashOffset&&a.setAttribute("stroke-dashoffset",`${i.fillLineDashOffset}`),a}get generator(){return this.gen}getDefaultOptions(){return this.gen.defaultOptions}opsToPath(t,r){return this.gen.opsToPath(t,r)}line(t,r,i,n,a){let s=this.gen.line(t,r,i,n,a);return this.draw(s)}rectangle(t,r,i,n,a){let s=this.gen.rectangle(t,r,i,n,a);return this.draw(s)}ellipse(t,r,i,n,a){let s=this.gen.ellipse(t,r,i,n,a);return this.draw(s)}circle(t,r,i,n){let a=this.gen.circle(t,r,i,n);return this.draw(a)}linearPath(t,r){let i=this.gen.linearPath(t,r);return this.draw(i)}polygon(t,r){let i=this.gen.polygon(t,r);return this.draw(i)}arc(t,r,i,n,a,s,l=!1,u){let h=this.gen.arc(t,r,i,n,a,s,l,u);return this.draw(h)}curve(t,r){let i=this.gen.curve(t,r);return this.draw(i)}path(t,r){let i=this.gen.path(t,r);return this.draw(i)}},ut={canvas:o((e,t)=>new AN(e,t),"canvas"),svg:o((e,t)=>new _N(e,t),"svg"),generator:o(e=>new Cg(e),"generator"),newSeed:o(()=>Cg.newSeed(),"newSeed")}});function Qre(e,t){let{labelStyles:r}=ct(t);t.labelStyle=r;let i=Ct(t),n=i;i||(n="anchor");let a=e.insert("g").attr("class",n).attr("id",t.domId||t.id),s=1,{cssStyles:l}=t,u=ut.svg(a),h=mt(t,{fill:"black",stroke:"none",fillStyle:"solid"});t.look!=="handDrawn"&&(h.roughness=0);let d=u.circle(0,0,s*2,h),f=a.insert(()=>d,":first-child");return f.attr("class","anchor").attr("style",ii(l)),ft(t,f),t.intersect=function(p){return Z.info("Circle intersect",t,s,p),lt.circle(t,s,p)},a}var Jre=z(()=>{"use strict";St();Wt();Kt();Ht();jt();Xt();o(Qre,"anchor")});function eie(e,t,r,i,n,a,s){let u=(e+r)/2,h=(t+i)/2,d=Math.atan2(i-t,r-e),f=(r-e)/2,p=(i-t)/2,m=f/n,g=p/a,y=Math.sqrt(m**2+g**2);if(y>1)throw new Error("The given radii are too small to create an arc between the points.");let v=Math.sqrt(1-y**2),x=u+v*a*Math.sin(d)*(s?-1:1),b=h-v*n*Math.cos(d)*(s?-1:1),T=Math.atan2((t-b)/a,(e-x)/n),C=Math.atan2((i-b)/a,(r-x)/n)-T;s&&C<0&&(C+=2*Math.PI),!s&&C>0&&(C-=2*Math.PI);let k=[];for(let E=0;E<20;E++){let A=E/19,N=T+A*C,P=x+n*Math.cos(N),I=b+a*Math.sin(N);k.push({x:P,y:I})}return k}function Cqe(e,t,r){let[i,n]=[t,r].sort((a,s)=>s-a);return n*(1-Math.sqrt(1-(e/i/2)**2))}async function tie(e,t){let{labelStyles:r,nodeStyles:i}=ct(t);t.labelStyle=r;let n=t.padding??0,a=t.look==="neo"?16:n,s=t.look==="neo"?12:n,l=o(N=>N+s,"calcTotalHeight"),u=o(N=>{let P=N/2;return[P/(2.5+N/50),P]},"calcEllipseRadius"),{shapeSvg:h,bbox:d}=await At(e,t,Ct(t)),f=l(t?.height?t?.height:d.height),[p,m]=u(f),g=Cqe(f,p,m),v=(t?.width?t?.width:d.width)+a*2+g-g,x=f,{cssStyles:b}=t,T=[{x:v/2,y:-x/2},{x:-v/2,y:-x/2},...eie(-v/2,-x/2,-v/2,x/2,p,m,!1),{x:v/2,y:x/2},...eie(v/2,x/2,v/2,-x/2,p,m,!0)],w=ut.svg(h),C=mt(t,{});t.look!=="handDrawn"&&(C.roughness=0,C.fillStyle="solid");let k=tr(T),E=w.path(k,C),A=h.insert(()=>E,":first-child");return A.attr("class","basic label-container outer-path"),b&&t.look!=="handDrawn"&&A.selectAll("path").attr("style",b),i&&t.look!=="handDrawn"&&A.selectAll("path").attr("style",i),A.attr("transform",`translate(${p/2}, 0)`),ft(t,A),t.intersect=function(N){return lt.polygon(t,T,N)},h}var rie=z(()=>{"use strict";Wt();Kt();Ht();jt();o(eie,"generateArcPoints");o(Cqe,"calculateArcSagitta");o(tie,"bowTieRect")});function Ma(e,t,r,i){return e.insert("polygon",":first-child").attr("points",i.map(function(n){return n.x+","+n.y}).join(" ")).attr("class","label-container").attr("transform","translate("+-t/2+","+r/2+")")}var Fu=z(()=>{"use strict";o(Ma,"insertPolygonShape")});async function iie(e,t){let{labelStyles:r,nodeStyles:i}=ct(t);t.labelStyle=r;let n=t.padding??0,a=t.look==="neo"?28:n,s=t.look==="neo"?24:n,{shapeSvg:l,bbox:u}=await At(e,t,Ct(t)),h=(t?.width??u.width)+(t.look==="neo"?a*2:a+F4),d=(t?.height??u.height)+(t.look==="neo"?s*2:s),f=0,p=h,m=-d,g=0,y=[{x:f+F4,y:m},{x:p,y:m},{x:p,y:g},{x:f,y:g},{x:f,y:m+F4},{x:f+F4,y:m}],v,{cssStyles:x}=t;if(t.look==="handDrawn"){let b=ut.svg(l),T=mt(t,{}),w=tr(y),C=b.path(w,T);v=l.insert(()=>C,":first-child").attr("transform",`translate(${-h/2}, ${d/2})`),x&&v.attr("style",x)}else v=Ma(l,h,d,y);return i&&v.attr("style",i),ft(t,v),t.intersect=function(b){return lt.polygon(t,y,b)},l}var F4,nie=z(()=>{"use strict";Wt();Kt();Ht();jt();Fu();Wt();F4=12;o(iie,"card")});function aie(e,t){let{nodeStyles:r}=ct(t);t.label="";let i=e.insert("g").attr("class",Ct(t)).attr("id",t.domId??t.id),{cssStyles:n}=t,a=Math.max(28,t.width??0),s=[{x:0,y:a/2},{x:a/2,y:0},{x:0,y:-a/2},{x:-a/2,y:0}],l=ut.svg(i),u=mt(t,{});t.look!=="handDrawn"&&(u.roughness=0,u.fillStyle="solid");let h=tr(s),d=l.path(h,u),f=i.insert(()=>d,":first-child");return n&&t.look!=="handDrawn"&&f.selectAll("path").attr("style",n),r&&t.look!=="handDrawn"&&f.selectAll("path").attr("style",r),t.width=28,t.height=28,t.intersect=function(p){return lt.polygon(t,s,p)},i}var sie=z(()=>{"use strict";Kt();jt();Ht();Wt();o(aie,"choice")});async function $4(e,t,r){let{labelStyles:i,nodeStyles:n}=ct(t);t.labelStyle=i;let{shapeSvg:a,bbox:s,halfPadding:l}=await At(e,t,Ct(t)),u=16,h=r?.padding??l,d=t.look==="neo"?s.width/2+u*2:s.width/2+h,f,{cssStyles:p}=t;if(t.look==="handDrawn"){let m=ut.svg(a),g=mt(t,{}),y=m.circle(0,0,d*2,g);f=a.insert(()=>y,":first-child"),f.attr("class","basic label-container").attr("style",ii(p))}else f=a.insert("circle",":first-child").attr("class","basic label-container").attr("style",n).attr("r",d).attr("cx",0).attr("cy",0);return ft(t,f),t.calcIntersect=function(m,g){let y=m.width/2;return lt.circle(m,y,g)},t.intersect=function(m){return Z.info("Circle intersect",t,d,m),lt.circle(t,d,m)},a}var RN=z(()=>{"use strict";jt();St();Xt();Kt();Ht();Wt();o($4,"circle")});function kqe(e){let t=Math.cos(Math.PI/4),r=Math.sin(Math.PI/4),i=e*2,n={x:i/2*t,y:i/2*r},a={x:-(i/2)*t,y:i/2*r},s={x:-(i/2)*t,y:-(i/2)*r},l={x:i/2*t,y:-(i/2)*r};return`M ${a.x},${a.y} L ${l.x},${l.y}
M ${n.x},${n.y} L ${s.x},${s.y}`}function oie(e,t){let{labelStyles:r,nodeStyles:i}=ct(t);t.labelStyle=r,t.label="";let n=e.insert("g").attr("class",Ct(t)).attr("id",t.domId??t.id),a=Math.max(30,t?.width??0),{cssStyles:s}=t,l=ut.svg(n),u=mt(t,{});t.look!=="handDrawn"&&(u.roughness=0,u.fillStyle="solid");let h=l.circle(0,0,a*2,u),d=kqe(a),f=l.path(d,u),p=n.insert(()=>h,":first-child");return p.insert(()=>f),p.attr("class","outer-path"),s&&t.look!=="handDrawn"&&p.selectAll("path").attr("style",s),i&&t.look!=="handDrawn"&&p.selectAll("path").attr("style",i),ft(t,p),t.intersect=function(m){return Z.info("crossedCircle intersect",t,{radius:a,point:m}),lt.circle(t,a,m)},n}var lie=z(()=>{"use strict";St();Wt();Ht();jt();Kt();o(kqe,"createLine");o(oie,"crossedCircle")});function hd(e,t,r,i=100,n=0,a=180){let s=[],l=n*Math.PI/180,d=(a*Math.PI/180-l)/(i-1);for(let f=0;fC,":first-child").attr("stroke-opacity",0),k.insert(()=>T,":first-child"),k.attr("class","text"),p&&t.look!=="handDrawn"&&k.selectAll("path").attr("style",p),i&&t.look!=="handDrawn"&&k.selectAll("path").attr("style",i),k.attr("transform",`translate(${f}, 0)`),s.attr("transform",`translate(${-h/2+f-(a.x-(a.left??0))},${-d/2+(t.padding??0)/2-(a.y-(a.top??0))})`),ft(t,k),t.intersect=function(E){return lt.polygon(t,g,E)},n}var uie=z(()=>{"use strict";Wt();Kt();Ht();jt();o(hd,"generateCirclePoints");o(cie,"curlyBraceLeft")});function dd(e,t,r,i=100,n=0,a=180){let s=[],l=n*Math.PI/180,d=(a*Math.PI/180-l)/(i-1);for(let f=0;fC,":first-child").attr("stroke-opacity",0),k.insert(()=>T,":first-child"),k.attr("class","text"),p&&t.look!=="handDrawn"&&k.selectAll("path").attr("style",p),i&&t.look!=="handDrawn"&&k.selectAll("path").attr("style",i),k.attr("transform",`translate(${-f}, 0)`),s.attr("transform",`translate(${-h/2+(t.padding??0)/2-(a.x-(a.left??0))},${-d/2+(t.padding??0)/2-(a.y-(a.top??0))})`),ft(t,k),t.intersect=function(E){return lt.polygon(t,g,E)},n}var die=z(()=>{"use strict";Wt();Kt();Ht();jt();o(dd,"generateCirclePoints");o(hie,"curlyBraceRight")});function Na(e,t,r,i=100,n=0,a=180){let s=[],l=n*Math.PI/180,d=(a*Math.PI/180-l)/(i-1);for(let f=0;fN,":first-child").attr("stroke-opacity",0),P.insert(()=>w,":first-child"),P.insert(()=>E,":first-child"),P.attr("class","text"),p&&t.look!=="handDrawn"&&P.selectAll("path").attr("style",p),i&&t.look!=="handDrawn"&&P.selectAll("path").attr("style",i),P.attr("transform",`translate(${f-f/4}, 0)`),s.attr("transform",`translate(${-h/2+(t.padding??0)/2-(a.x-(a.left??0))},${-d/2+(t.padding??0)/2-(a.y-(a.top??0))})`),ft(t,P),t.intersect=function(I){return lt.polygon(t,y,I)},n}var pie=z(()=>{"use strict";Wt();Kt();Ht();jt();o(Na,"generateCirclePoints");o(fie,"curlyBraces")});async function mie(e,t){let{labelStyles:r,nodeStyles:i}=ct(t);t.labelStyle=r;let n=t.padding??0,a=t.look==="neo"?16:n,s=t.look==="neo"?12:n,l=20,u=5,{shapeSvg:h,bbox:d}=await At(e,t,Ct(t)),f=Math.max(l,(d.width+a*2)*1.25,t?.width??0),p=Math.max(u,d.height+s*2,t?.height??0),m=p/2,{cssStyles:g}=t,y=ut.svg(h),v=mt(t,{});t.look!=="handDrawn"&&(v.roughness=0,v.fillStyle="solid");let x=f,b=p,T=x-m,w=b/4,C=[{x:T,y:0},{x:w,y:0},{x:0,y:b/2},{x:w,y:b},{x:T,y:b},...Ep(-T,-b/2,m,50,270,90)],k=tr(C),E=y.path(k,v),A=h.insert(()=>E,":first-child");return A.attr("class","basic label-container outer-path"),g&&t.look!=="handDrawn"&&A.selectChildren("path").attr("style",g),i&&t.look!=="handDrawn"&&A.selectChildren("path").attr("style",i),A.attr("transform",`translate(${-f/2}, ${-p/2})`),ft(t,A),t.intersect=function(N){return lt.polygon(t,C,N)},h}var gie=z(()=>{"use strict";Wt();Kt();Ht();jt();o(mie,"curvedTrapezoid")});async function xie(e,t){let{labelStyles:r,nodeStyles:i}=ct(t);t.labelStyle=r;let n=t.padding??0,a=t.look==="neo"?24:n,s=t.look==="neo"?24:n;if(t.width||t.height){let v=t.width??0;t.width=(t.width??0)-s,t.widthC,":first-child"),g=l.insert(()=>w,":first-child"),g.attr("class","basic label-container"),y&&g.attr("style",y)}else{let v=wqe(0,0,d,m,f,p);g=l.insert("path",":first-child").attr("d",v).attr("class","basic label-container outer-path").attr("style",ii(y)).attr("style",i)}return g.attr("label-offset-y",p),g.attr("transform",`translate(${-d/2}, ${-(m/2+p)})`),ft(t,g),h.attr("transform",`translate(${-(u.width/2)-(u.x-(u.left??0))}, ${-(u.height/2)+(t.padding??0)/1.5-(u.y-(u.top??0))})`),t.intersect=function(v){let x=lt.rect(t,v),b=x.x-(t.x??0);if(f!=0&&(Math.abs(b)<(t.width??0)/2||Math.abs(b)==(t.width??0)/2&&Math.abs(x.y-(t.y??0))>(t.height??0)/2-p)){let T=p*p*(1-b*b/(f*f));T>0&&(T=Math.sqrt(T)),T=p-T,v.y-(t.y??0)>0&&(T=-T),x.y+=T}return x},l}var wqe,Sqe,Eqe,yie,vie,bie=z(()=>{"use strict";Wt();Kt();Ht();jt();Xt();wqe=o((e,t,r,i,n,a)=>[`M${e},${t+a}`,`a${n},${a} 0,0,0 ${r},0`,`a${n},${a} 0,0,0 ${-r},0`,`l0,${i}`,`a${n},${a} 0,0,0 ${r},0`,`l0,${-i}`].join(" "),"createCylinderPathD"),Sqe=o((e,t,r,i,n,a)=>[`M${e},${t+a}`,`M${e+r},${t+a}`,`a${n},${a} 0,0,0 ${-r},0`,`l0,${i}`,`a${n},${a} 0,0,0 ${r},0`,`l0,${-i}`].join(" "),"createOuterCylinderPathD"),Eqe=o((e,t,r,i,n,a)=>[`M${e-r/2},${-i/2}`,`a${n},${a} 0,0,0 ${r},0`].join(" "),"createInnerCylinderPathD"),yie=8,vie=8;o(xie,"cylinder")});var Rs,_p=z(()=>{"use strict";Rs=o((e,t,r,i,n)=>["M",e+n,t,"H",e+r-n,"A",n,n,0,0,1,e+r,t+n,"V",t+i-n,"A",n,n,0,0,1,e+r-n,t+i,"H",e+n,"A",n,n,0,0,1,e,t+i-n,"V",t+n,"A",n,n,0,0,1,e+n,t,"Z"].join(" "),"createRoundedRectPathD")});async function Ml(e,t,r){let{labelStyles:i,nodeStyles:n}=ct(t);t.labelStyle=i;let{shapeSvg:a,bbox:s}=await At(e,t,Ct(t)),l=Math.max(s.width+r.labelPaddingX*2,t?.width||0),u=Math.max(s.height+r.labelPaddingY*2,t?.height||0),h=-l/2,d=-u/2,f,{rx:p,ry:m}=t,{cssStyles:g}=t;if(r?.rx&&r.ry&&(p=r.rx,m=r.ry),t.look==="handDrawn"){let y=ut.svg(a),v=mt(t,{}),x=p||m?y.path(Rs(h,d,l,u,p||0),v):y.rectangle(h,d,l,u,v);f=a.insert(()=>x,":first-child"),f.attr("class","basic label-container").attr("style",ii(g))}else f=a.insert("rect",":first-child"),f.attr("class","basic label-container").attr("style",n).attr("rx",ii(p)).attr("ry",ii(m)).attr("x",h).attr("y",d).attr("width",l).attr("height",u);return ft(t,f),t.calcIntersect=function(y,v){return lt.rect(y,v)},t.intersect=function(y){return lt.rect(t,y)},a}var Dp=z(()=>{"use strict";Wt();Kt();_p();Ht();jt();Xt();o(Ml,"drawRect")});async function Tie(e,t){let{cssClasses:r,labelPaddingX:i,labelPaddingY:n,padding:a,width:s,height:l}=t,u={rx:0,ry:0,classes:r??"",labelPaddingX:i??(a??0)*2,labelPaddingY:n??a??0},h=await Ml(e,t,u);if(t.look==="handDrawn"){let m=ut.svg(h),g=mt(t,{}),y=h.select(".basic.label-container > path:nth-child(2)"),v=y.node();if(!v)return h;let x=null;if(v instanceof SVGGraphicsElement)x=v.getBBox();else return h;return h.insert(()=>m.line(x.x,x.y,x.x+x.width,x.y,g),".basic.label-container g.label"),h.insert(()=>m.line(x.x,x.y+x.height,x.x+x.width,x.y+x.height,g),".basic.label-container g.label"),y.remove(),h}let d=h.select(".basic.label-container"),f=(Number(d.attr("width"))||s)??0,p=(Number(d.attr("height"))||l)??0;return f>0&&p>0&&d.attr("stroke-dasharray",`${f} ${p}`),h}var Cie=z(()=>{"use strict";Dp();Ht();jt();o(Tie,"datastore")});async function kie(e,t){let{labelStyles:r,nodeStyles:i}=ct(t);t.labelStyle=r;let n=t.look==="neo"?16:t.padding??0,a=t.look==="neo"?16:t.padding??0,{shapeSvg:s,bbox:l,label:u}=await At(e,t,Ct(t)),h=l.width+n,d=l.height+a,f=d*.2,p=-h/2,m=-d/2-f/2,{cssStyles:g}=t,y=ut.svg(s),v=mt(t,{});t.look!=="handDrawn"&&(v.roughness=0,v.fillStyle="solid");let x=[{x:p,y:m+f},{x:-p,y:m+f},{x:-p,y:-m},{x:p,y:-m},{x:p,y:m},{x:-p,y:m},{x:-p,y:m+f}],b=y.polygon(x.map(w=>[w.x,w.y]),v),T=s.insert(()=>b,":first-child");return T.attr("class","basic label-container outer-path"),g&&t.look!=="handDrawn"&&T.selectAll("path").attr("style",g),i&&t.look!=="handDrawn"&&T.selectAll("path").attr("style",i),u.attr("transform",`translate(${p+(t.padding??0)/2-(l.x-(l.left??0))}, ${m+f+(t.padding??0)/2-(l.y-(l.top??0))})`),ft(t,T),t.intersect=function(w){return lt.rect(t,w)},s}var wie=z(()=>{"use strict";Wt();Kt();Ht();jt();o(kie,"dividedRectangle")});async function Sie(e,t){let{labelStyles:r,nodeStyles:i}=ct(t),n=t.look==="neo"?12:5;t.labelStyle=r;let a=t.padding??0,s=t.look==="neo"?16:a,{shapeSvg:l,bbox:u}=await At(e,t,Ct(t)),h=(t?.width?t?.width/2:u.width/2)+(s??0),d=h-n,f,{cssStyles:p}=t;if(t.look==="handDrawn"){let m=ut.svg(l),g=mt(t,{roughness:.2,strokeWidth:2.5}),y=mt(t,{roughness:.2,strokeWidth:1.5}),v=m.circle(0,0,h*2,g),x=m.circle(0,0,d*2,y);f=l.insert("g",":first-child"),f.attr("class",ii(t.cssClasses)).attr("style",ii(p)),f.node()?.appendChild(v),f.node()?.appendChild(x)}else{f=l.insert("g",":first-child");let m=f.insert("circle",":first-child"),g=f.insert("circle");f.attr("class","basic label-container").attr("style",i),m.attr("class","outer-circle").attr("style",i).attr("r",h).attr("cx",0).attr("cy",0),g.attr("class","inner-circle").attr("style",i).attr("r",d).attr("cx",0).attr("cy",0)}return ft(t,f),t.intersect=function(m){return Z.info("DoubleCircle intersect",t,h,m),lt.circle(t,h,m)},l}var Eie=z(()=>{"use strict";St();Wt();Kt();Ht();jt();Xt();o(Sie,"doublecircle")});function Aie(e,t,{config:{themeVariables:r}}){let{labelStyles:i,nodeStyles:n}=ct(t);t.label="",t.labelStyle=i;let a=e.insert("g").attr("class",Ct(t)).attr("id",t.domId??t.id),s=7,{cssStyles:l}=t,u=ut.svg(a),{nodeBorder:h}=r,d=mt(t,{fillStyle:"solid"});t.look!=="handDrawn"&&(d.roughness=0);let f=u.circle(0,0,s*2,d),p=a.insert(()=>f,":first-child");return p.selectAll("path").attr("style",`fill: ${h} !important;`),l&&l.length>0&&t.look!=="handDrawn"&&p.selectAll("path").attr("style",l),n&&t.look!=="handDrawn"&&p.selectAll("path").attr("style",n),ft(t,p),t.intersect=function(m){return Z.info("filledCircle intersect",t,{radius:s,point:m}),lt.circle(t,s,m)},a}var _ie=z(()=>{"use strict";jt();St();Kt();Ht();Wt();o(Aie,"filledCircle")});async function Lie(e,t){let{labelStyles:r,nodeStyles:i}=ct(t);t.labelStyle=r;let n=t.padding??0,a=t.look==="neo"?n*2:n;(t.width||t.height)&&(t.height=t?.height??0,t.heightx,":first-child").attr("transform",`translate(${-d/2}, ${d/2})`).attr("class","outer-path");return m&&t.look!=="handDrawn"&&b.selectChildren("path").attr("style",m),i&&t.look!=="handDrawn"&&b.selectChildren("path").attr("style",i),t.width=h,t.height=d,ft(t,b),u.attr("transform",`translate(${-l.width/2-(l.x-(l.left??0))}, ${-d/2+(t.padding??0)/2+(l.y-(l.top??0))})`),t.intersect=function(T){return Z.info("Triangle intersect",t,p,T),lt.polygon(t,p,T)},s}var Die,Rie,Mie=z(()=>{"use strict";St();Wt();Kt();Ht();jt();Wt();Die=10,Rie=10;o(Lie,"flippedTriangle")});function Nie(e,t,{dir:r,config:{state:i,themeVariables:n}}){let{nodeStyles:a}=ct(t);t.label="";let s=e.insert("g").attr("class",Ct(t)).attr("id",t.domId??t.id),{cssStyles:l}=t,u=Math.max(70,t?.width??0),h=Math.max(10,t?.height??0);r==="LR"&&(u=Math.max(10,t?.width??0),h=Math.max(70,t?.height??0));let d=-1*u/2,f=-1*h/2,p=ut.svg(s),m=mt(t,{stroke:n.lineColor,fill:n.lineColor});t.look!=="handDrawn"&&(m.roughness=0,m.fillStyle="solid");let g=p.rectangle(d,f,u,h,m),y=s.insert(()=>g,":first-child");l&&t.look!=="handDrawn"&&y.selectAll("path").attr("style",l),a&&t.look!=="handDrawn"&&y.selectAll("path").attr("style",a),ft(t,y);let v=i?.padding??0;return t.width&&t.height&&(t.width+=v/2||0,t.height+=v/2||0),t.intersect=function(x){return lt.rect(t,x)},s}var Iie=z(()=>{"use strict";jt();Kt();Ht();Wt();o(Nie,"forkJoin")});async function Oie(e,t){let{labelStyles:r,nodeStyles:i}=ct(t);t.labelStyle=r;let n=15,a=10,s=t.look==="neo"?16:t.padding??0,l=t.look==="neo"?12:t.padding??0;(t.width||t.height)&&(t.height=(t?.height??0)-l*2,t.heightb,":first-child");return T.attr("class","basic label-container outer-path"),m&&t.look!=="handDrawn"&&T.selectChildren("path").attr("style",m),i&&t.look!=="handDrawn"&&T.selectChildren("path").attr("style",i),ft(t,T),t.intersect=function(w){return Z.info("Pill intersect",t,{radius:p,point:w}),lt.polygon(t,v,w)},u}var Pie=z(()=>{"use strict";St();Wt();Kt();Ht();jt();o(Oie,"halfRoundedRectangle")});async function Bie(e,t){let{labelStyles:r,nodeStyles:i}=ct(t),n=t.look==="neo"?3.5:4;t.labelStyle=r;let a=t.padding??0,s=70,l=32,u=t.look==="neo"?s:a,h=t.look==="neo"?l:a;if(t.width||t.height){let T=(t.height??0)/n;t.width=(t?.width??0)-2*T-h,t.height=(t.height??0)-u}let{shapeSvg:d,bbox:f}=await At(e,t,Ct(t)),p=(t?.height?t?.height:f.height)+u,m=p/n,g=(t?.width?t?.width:f.width)+2*m+h,y=[{x:m,y:0},{x:g-m,y:0},{x:g,y:-p/2},{x:g-m,y:-p},{x:m,y:-p},{x:0,y:-p/2}],v,{cssStyles:x}=t;if(t.look==="handDrawn"){let b=ut.svg(d),T=mt(t,{}),w=Aqe(0,0,g,p,m),C=b.path(w,T);v=d.insert(()=>C,":first-child").attr("transform",`translate(${-g/2}, ${p/2})`),x&&v.attr("style",x)}else v=Ma(d,g,p,y);return i&&v.attr("style",i),t.width=g,t.height=p,ft(t,v),t.intersect=function(b){return lt.polygon(t,y,b)},d}var Aqe,Fie=z(()=>{"use strict";Wt();Kt();Ht();jt();Fu();Aqe=o((e,t,r,i,n)=>[`M${e+n},${t}`,`L${e+r-n},${t}`,`L${e+r},${t-i/2}`,`L${e+r-n},${t-i}`,`L${e+n},${t-i}`,`L${e},${t-i/2}`,"Z"].join(" "),"createHexagonPathD");o(Bie,"hexagon")});async function $ie(e,t){let{labelStyles:r,nodeStyles:i}=ct(t);t.label="",t.labelStyle=r;let{shapeSvg:n}=await At(e,t,Ct(t)),a=Math.max(30,t?.width??0),s=Math.max(30,t?.height??0),{cssStyles:l}=t,u=ut.svg(n),h=mt(t,{});t.look!=="handDrawn"&&(h.roughness=0,h.fillStyle="solid");let d=[{x:0,y:0},{x:a,y:0},{x:0,y:s},{x:a,y:s}],f=tr(d),p=u.path(f,h),m=n.insert(()=>p,":first-child");return m.attr("class","basic label-container outer-path"),l&&t.look!=="handDrawn"&&m.selectChildren("path").attr("style",l),i&&t.look!=="handDrawn"&&m.selectChildren("path").attr("style",i),m.attr("transform",`translate(${-a/2}, ${-s/2})`),ft(t,m),t.intersect=function(g){return Z.info("Pill intersect",t,{points:d}),lt.polygon(t,d,g)},n}var zie=z(()=>{"use strict";St();Wt();Kt();Ht();jt();o($ie,"hourglass")});async function Gie(e,t,{config:{themeVariables:r,flowchart:i}}){let{labelStyles:n}=ct(t);t.labelStyle=n;let a=t.assetHeight??48,s=t.assetWidth??48,l=Math.max(a,s),u=i?.wrappingWidth;t.width=Math.max(l,u??0);let{shapeSvg:h,bbox:d,label:f}=await At(e,t,"icon-shape default"),p=t.pos==="t",m=l,g=l,{nodeBorder:y}=r,{stylesMap:v}=kc(t),x=-g/2,b=-m/2,T=t.label?8:0,w=ut.svg(h),C=mt(t,{stroke:"none",fill:"none"});t.look!=="handDrawn"&&(C.roughness=0,C.fillStyle="solid");let k=w.rectangle(x,b,g,m,C),E=Math.max(g,d.width),A=m+d.height+T,N=w.rectangle(-E/2,-A/2,E,A,{...C,fill:"transparent",stroke:"none"}),P=h.insert(()=>k,":first-child"),I=h.insert(()=>N);if(t.icon){let D=h.append("g");D.html(`${await ks(t.icon,{height:l,width:l,fallbackPrefix:""})} `);let _=D.node().getBBox(),R=_.width,M=_.height,L=_.x,B=_.y;D.attr("transform",`translate(${-R/2-L},${p?d.height/2+T/2-M/2-B:-d.height/2-T/2-M/2-B})`),D.attr("style",`color: ${v.get("stroke")??y};`)}return f.attr("transform",`translate(${-d.width/2-(d.x-(d.left??0))},${p?-A/2:A/2-d.height})`),P.attr("transform",`translate(0,${p?d.height/2+T/2:-d.height/2-T/2})`),ft(t,I),t.intersect=function(D){if(Z.info("iconSquare intersect",t,D),!t.label)return lt.rect(t,D);let _=t.x??0,R=t.y??0,M=t.height??0,L=[];return p?L=[{x:_-d.width/2,y:R-M/2},{x:_+d.width/2,y:R-M/2},{x:_+d.width/2,y:R-M/2+d.height+T},{x:_+g/2,y:R-M/2+d.height+T},{x:_+g/2,y:R+M/2},{x:_-g/2,y:R+M/2},{x:_-g/2,y:R-M/2+d.height+T},{x:_-d.width/2,y:R-M/2+d.height+T}]:L=[{x:_-g/2,y:R-M/2},{x:_+g/2,y:R-M/2},{x:_+g/2,y:R-M/2+m},{x:_+d.width/2,y:R-M/2+m},{x:_+d.width/2/2,y:R+M/2},{x:_-d.width/2,y:R+M/2},{x:_-d.width/2,y:R-M/2+m},{x:_-g/2,y:R-M/2+m}],lt.polygon(t,L,D)},h}var Vie=z(()=>{"use strict";jt();St();uc();Kt();Ht();Wt();o(Gie,"icon")});async function Wie(e,t,{config:{themeVariables:r,flowchart:i}}){let{labelStyles:n}=ct(t);t.labelStyle=n;let a=t.assetHeight??48,s=t.assetWidth??48,l=Math.max(a,s),u=i?.wrappingWidth;t.width=Math.max(l,u??0);let{shapeSvg:h,bbox:d,label:f}=await At(e,t,"icon-shape default"),p=20,m=t.label?8:0,g=t.pos==="t",{nodeBorder:y,mainBkg:v}=r,{stylesMap:x}=kc(t),b=ut.svg(h),T=mt(t,{});t.look!=="handDrawn"&&(T.roughness=0,T.fillStyle="solid");let w=x.get("fill");T.stroke=w??v;let C=h.append("g");t.icon&&C.html(`${await ks(t.icon,{height:l,width:l,fallbackPrefix:""})} `);let k=C.node().getBBox(),E=k.width,A=k.height,N=k.x,P=k.y,I=Math.max(E,A)*Math.SQRT2+p*2,D=b.circle(0,0,I,T),_=Math.max(I,d.width),R=I+d.height+m,M=b.rectangle(-_/2,-R/2,_,R,{...T,fill:"transparent",stroke:"none"}),L=h.insert(()=>D,":first-child"),B=h.insert(()=>M);return C.attr("transform",`translate(${-E/2-N},${g?d.height/2+m/2-A/2-P:-d.height/2-m/2-A/2-P})`),C.attr("style",`color: ${x.get("stroke")??y};`),f.attr("transform",`translate(${-d.width/2-(d.x-(d.left??0))},${g?-R/2:R/2-d.height})`),L.attr("transform",`translate(0,${g?d.height/2+m/2:-d.height/2-m/2})`),ft(t,B),t.intersect=function(O){return Z.info("iconSquare intersect",t,O),lt.rect(t,O)},h}var qie=z(()=>{"use strict";jt();St();uc();Kt();Ht();Wt();o(Wie,"iconCircle")});async function Uie(e,t,{config:{themeVariables:r,flowchart:i}}){let{labelStyles:n}=ct(t);t.labelStyle=n;let a=t.assetHeight??48,s=t.assetWidth??48,l=Math.max(a,s),u=i?.wrappingWidth;t.width=Math.max(l,u??0);let{shapeSvg:h,bbox:d,halfPadding:f,label:p}=await At(e,t,"icon-shape default"),m=t.pos==="t",g=l+f*2,y=l+f*2,{nodeBorder:v,mainBkg:x}=r,{stylesMap:b}=kc(t),T=-y/2,w=-g/2,C=t.label?8:0,k=ut.svg(h),E=mt(t,{});t.look!=="handDrawn"&&(E.roughness=0,E.fillStyle="solid");let A=b.get("fill");E.stroke=A??x;let N=k.path(Rs(T,w,y,g,5),E),P=Math.max(y,d.width),I=g+d.height+C,D=k.rectangle(-P/2,-I/2,P,I,{...E,fill:"transparent",stroke:"none"}),_=h.insert(()=>N,":first-child").attr("class","icon-shape2"),R=h.insert(()=>D);if(t.icon){let M=h.append("g");M.html(`${await ks(t.icon,{height:l,width:l,fallbackPrefix:""})} `);let L=M.node().getBBox(),B=L.width,O=L.height,$=L.x,G=L.y;M.attr("transform",`translate(${-B/2-$},${m?d.height/2+C/2-O/2-G:-d.height/2-C/2-O/2-G})`),M.attr("style",`color: ${b.get("stroke")??v};`)}return p.attr("transform",`translate(${-d.width/2-(d.x-(d.left??0))},${m?-I/2:I/2-d.height})`),_.attr("transform",`translate(0,${m?d.height/2+C/2:-d.height/2-C/2})`),ft(t,R),t.intersect=function(M){if(Z.info("iconSquare intersect",t,M),!t.label)return lt.rect(t,M);let L=t.x??0,B=t.y??0,O=t.height??0,$=[];return m?$=[{x:L-d.width/2,y:B-O/2},{x:L+d.width/2,y:B-O/2},{x:L+d.width/2,y:B-O/2+d.height+C},{x:L+y/2,y:B-O/2+d.height+C},{x:L+y/2,y:B+O/2},{x:L-y/2,y:B+O/2},{x:L-y/2,y:B-O/2+d.height+C},{x:L-d.width/2,y:B-O/2+d.height+C}]:$=[{x:L-y/2,y:B-O/2},{x:L+y/2,y:B-O/2},{x:L+y/2,y:B-O/2+g},{x:L+d.width/2,y:B-O/2+g},{x:L+d.width/2/2,y:B+O/2},{x:L-d.width/2,y:B+O/2},{x:L-d.width/2,y:B-O/2+g},{x:L-y/2,y:B-O/2+g}],lt.polygon(t,$,M)},h}var Hie=z(()=>{"use strict";jt();St();uc();Kt();Ht();_p();Wt();o(Uie,"iconRounded")});async function Yie(e,t,{config:{themeVariables:r,flowchart:i}}){let{labelStyles:n}=ct(t);t.labelStyle=n;let a=t.assetHeight??48,s=t.assetWidth??48,l=Math.max(a,s),u=i?.wrappingWidth;t.width=Math.max(l,u??0);let{shapeSvg:h,bbox:d,halfPadding:f,label:p}=await At(e,t,"icon-shape default"),m=t.pos==="t",g=l+f*2,y=l+f*2,{nodeBorder:v,mainBkg:x}=r,{stylesMap:b}=kc(t),T=-y/2,w=-g/2,C=t.label?8:0,k=ut.svg(h),E=mt(t,{});t.look!=="handDrawn"&&(E.roughness=0,E.fillStyle="solid");let A=b.get("fill");E.stroke=A??x;let N=k.path(Rs(T,w,y,g,.1),E),P=Math.max(y,d.width),I=g+d.height+C,D=k.rectangle(-P/2,-I/2,P,I,{...E,fill:"transparent",stroke:"none"}),_=h.insert(()=>N,":first-child"),R=h.insert(()=>D);if(t.icon){let M=h.append("g");M.html(`${await ks(t.icon,{height:l,width:l,fallbackPrefix:""})} `);let L=M.node().getBBox(),B=L.width,O=L.height,$=L.x,G=L.y;M.attr("transform",`translate(${-B/2-$},${m?d.height/2+C/2-O/2-G:-d.height/2-C/2-O/2-G})`),M.attr("style",`color: ${b.get("stroke")??v};`)}return p.attr("transform",`translate(${-d.width/2-(d.x-(d.left??0))},${m?-I/2:I/2-d.height})`),_.attr("transform",`translate(0,${m?d.height/2+C/2:-d.height/2-C/2})`),ft(t,R),t.intersect=function(M){if(Z.info("iconSquare intersect",t,M),!t.label)return lt.rect(t,M);let L=t.x??0,B=t.y??0,O=t.height??0,$=[];return m?$=[{x:L-d.width/2,y:B-O/2},{x:L+d.width/2,y:B-O/2},{x:L+d.width/2,y:B-O/2+d.height+C},{x:L+y/2,y:B-O/2+d.height+C},{x:L+y/2,y:B+O/2},{x:L-y/2,y:B+O/2},{x:L-y/2,y:B-O/2+d.height+C},{x:L-d.width/2,y:B-O/2+d.height+C}]:$=[{x:L-y/2,y:B-O/2},{x:L+y/2,y:B-O/2},{x:L+y/2,y:B-O/2+g},{x:L+d.width/2,y:B-O/2+g},{x:L+d.width/2/2,y:B+O/2},{x:L-d.width/2,y:B+O/2},{x:L-d.width/2,y:B-O/2+g},{x:L-y/2,y:B-O/2+g}],lt.polygon(t,$,M)},h}var jie=z(()=>{"use strict";jt();St();uc();Kt();_p();Ht();Wt();o(Yie,"iconSquare")});async function Xie(e,t,{config:{flowchart:r}}){let i=new Image;i.src=t?.img??"",await i.decode();let n=Number(i.naturalWidth.toString().replace("px","")),a=Number(i.naturalHeight.toString().replace("px",""));t.imageAspectRatio=n/a;let{labelStyles:s}=ct(t);t.labelStyle=s;let l=r?.wrappingWidth;t.defaultWidth=r?.wrappingWidth;let u=Math.max(t.label?l??0:0,t?.assetWidth??n),h=t.constraint==="on"&&t?.assetHeight?t.assetHeight*t.imageAspectRatio:u,d=t.constraint==="on"?h/t.imageAspectRatio:t?.assetHeight??a;t.width=Math.max(h,l??0);let{shapeSvg:f,bbox:p,label:m}=await At(e,t,"image-shape default"),g=t.pos==="t",y=-h/2,v=-d/2,x=t.label?8:0,b=ut.svg(f),T=mt(t,{});t.look!=="handDrawn"&&(T.roughness=0,T.fillStyle="solid");let w=b.rectangle(y,v,h,d,T),C=Math.max(h,p.width),k=d+p.height+x,E=b.rectangle(-C/2,-k/2,C,k,{...T,fill:"none",stroke:"none"}),A=f.insert(()=>w,":first-child"),N=f.insert(()=>E);if(t.img){let P=f.append("image");P.attr("href",t.img),P.attr("width",h),P.attr("height",d),P.attr("preserveAspectRatio","none"),P.attr("transform",`translate(${-h/2},${g?k/2-d:-k/2})`)}return m.attr("transform",`translate(${-p.width/2-(p.x-(p.left??0))},${g?-d/2-p.height/2-x/2:d/2-p.height/2+x/2})`),A.attr("transform",`translate(0,${g?p.height/2+x/2:-p.height/2-x/2})`),ft(t,N),t.intersect=function(P){if(Z.info("iconSquare intersect",t,P),!t.label)return lt.rect(t,P);let I=t.x??0,D=t.y??0,_=t.height??0,R=[];return g?R=[{x:I-p.width/2,y:D-_/2},{x:I+p.width/2,y:D-_/2},{x:I+p.width/2,y:D-_/2+p.height+x},{x:I+h/2,y:D-_/2+p.height+x},{x:I+h/2,y:D+_/2},{x:I-h/2,y:D+_/2},{x:I-h/2,y:D-_/2+p.height+x},{x:I-p.width/2,y:D-_/2+p.height+x}]:R=[{x:I-h/2,y:D-_/2},{x:I+h/2,y:D-_/2},{x:I+h/2,y:D-_/2+d},{x:I+p.width/2,y:D-_/2+d},{x:I+p.width/2/2,y:D+_/2},{x:I-p.width/2,y:D+_/2},{x:I-p.width/2,y:D-_/2+d},{x:I-h/2,y:D-_/2+d}],lt.polygon(t,R,P)},f}var Kie=z(()=>{"use strict";jt();St();Kt();Ht();Wt();o(Xie,"imageSquare")});async function Zie(e,t){let{labelStyles:r,nodeStyles:i}=ct(t);t.labelStyle=r;let n=t.padding??0,a=n,s=t.look==="neo"?n*2:n,{shapeSvg:l,bbox:u}=await At(e,t,Ct(t)),h=Math.max(u.width+(s??0)*2,t?.width??0),d=Math.max(u.height+(a??0)*2,t?.height??0),f=[{x:0,y:0},{x:h,y:0},{x:h+3*d/6,y:-d},{x:-3*d/6,y:-d}],p,{cssStyles:m}=t;if(t.look==="handDrawn"){let g=ut.svg(l),y=mt(t,{}),v=tr(f),x=g.path(v,y);p=l.insert(()=>x,":first-child").attr("transform",`translate(${-h/2}, ${d/2})`),m&&p.attr("style",m)}else p=Ma(l,h,d,f);return i&&p.attr("style",i),t.width=h,t.height=d,ft(t,p),t.intersect=function(g){return lt.polygon(t,f,g)},l}var Qie=z(()=>{"use strict";Wt();Kt();Ht();jt();Fu();o(Zie,"inv_trapezoid")});async function Jie(e,t){let{shapeSvg:r,bbox:i,label:n}=await At(e,t,"label"),a=r.insert("rect",":first-child");return a.attr("width",.1).attr("height",.1),r.attr("class","label edgeLabel"),n.attr("transform",`translate(${-(i.width/2)-(i.x-(i.left??0))}, ${-(i.height/2)-(i.y-(i.top??0))})`),ft(t,a),t.intersect=function(u){return lt.rect(t,u)},r}var ene=z(()=>{"use strict";Dp();Wt();Kt();o(Jie,"labelRect")});async function tne(e,t){let{labelStyles:r,nodeStyles:i}=ct(t);t.labelStyle=r;let n=t.padding??0,a=n,s=t.look==="neo"?n*2:n,{shapeSvg:l,bbox:u}=await At(e,t,Ct(t)),h=(t?.height??u.height)+a,d=(t?.width??u.width)+s,f=[{x:0,y:0},{x:d+3*h/6,y:0},{x:d,y:-h},{x:-(3*h)/6,y:-h}],p,{cssStyles:m}=t;if(t.look==="handDrawn"){let g=ut.svg(l),y=mt(t,{}),v=tr(f),x=g.path(v,y);p=l.insert(()=>x,":first-child").attr("transform",`translate(${-d/2}, ${h/2})`),m&&p.attr("style",m)}else p=Ma(l,d,h,f);return i&&p.attr("style",i),t.width=d,t.height=h,ft(t,p),t.intersect=function(g){return lt.polygon(t,f,g)},l}var rne=z(()=>{"use strict";Wt();Kt();Ht();jt();Fu();o(tne,"lean_left")});async function ine(e,t){let{labelStyles:r,nodeStyles:i}=ct(t);t.labelStyle=r;let n=t.padding??0,a=n,s=t.look==="neo"?n*2:n,{shapeSvg:l,bbox:u}=await At(e,t,Ct(t)),h=(t?.height??u.height)+a,d=(t?.width??u.width)+s,f=[{x:-3*h/6,y:0},{x:d,y:0},{x:d+3*h/6,y:-h},{x:0,y:-h}],p,{cssStyles:m}=t;if(t.look==="handDrawn"){let g=ut.svg(l),y=mt(t,{}),v=tr(f),x=g.path(v,y);p=l.insert(()=>x,":first-child").attr("transform",`translate(${-d/2}, ${h/2})`),m&&p.attr("style",m)}else p=Ma(l,d,h,f);return i&&p.attr("style",i),t.width=d,t.height=h,ft(t,p),t.intersect=function(g){return lt.polygon(t,f,g)},l}var nne=z(()=>{"use strict";Wt();Kt();Ht();jt();Fu();o(ine,"lean_right")});function ane(e,t){let{labelStyles:r,nodeStyles:i}=ct(t);t.label="",t.labelStyle=r;let n=e.insert("g").attr("class",Ct(t)).attr("id",t.domId??t.id),{cssStyles:a}=t,s=Math.max(35,t?.width??0),l=Math.max(35,t?.height??0),u=7,h=[{x:s,y:0},{x:0,y:l+u/2},{x:s-2*u,y:l+u/2},{x:0,y:2*l},{x:s,y:l-u/2},{x:2*u,y:l-u/2}],d=ut.svg(n),f=mt(t,{});t.look!=="handDrawn"&&(f.roughness=0,f.fillStyle="solid");let p=tr(h),m=d.path(p,f),g=n.insert(()=>m,":first-child");return g.attr("class","outer-path"),a&&t.look!=="handDrawn"&&g.selectAll("path").attr("style",a),i&&t.look!=="handDrawn"&&g.selectAll("path").attr("style",i),g.attr("transform",`translate(-${s/2},${-l})`),ft(t,g),t.intersect=function(y){return Z.info("lightningBolt intersect",t,y),lt.polygon(t,h,y)},n}var sne=z(()=>{"use strict";St();Wt();Ht();jt();Kt();Wt();o(ane,"lightningBolt")});async function cne(e,t){let{labelStyles:r,nodeStyles:i}=ct(t);t.labelStyle=r;let n=t.padding??0,a=t.look==="neo"?16:n,s=t.look==="neo"?24:n;if(t.width||t.height){let x=t.width??0;t.width=(t.width??0)-a,t.widthk,":first-child").attr("class","line"),y=l.insert(()=>C,":first-child"),y.attr("class","basic label-container"),v&&y.attr("style",v)}else{let x=_qe(0,0,d,m,f,p,g);y=l.insert("path",":first-child").attr("d",x).attr("class","basic label-container outer-path").attr("style",ii(v)).attr("style",i)}return y.attr("label-offset-y",p),y.attr("transform",`translate(${-d/2}, ${-(m/2+p)})`),ft(t,y),h.attr("transform",`translate(${-(u.width/2)-(u.x-(u.left??0))}, ${-(u.height/2)+p-(u.y-(u.top??0))})`),t.intersect=function(x){let b=lt.rect(t,x),T=b.x-(t.x??0);if(f!=0&&(Math.abs(T)<(t.width??0)/2||Math.abs(T)==(t.width??0)/2&&Math.abs(b.y-(t.y??0))>(t.height??0)/2-p)){let w=p*p*(1-T*T/(f*f));w>0&&(w=Math.sqrt(w)),w=p-w,x.y-(t.y??0)>0&&(w=-w),b.y+=w}return b},l}var _qe,Dqe,Rqe,one,lne,une=z(()=>{"use strict";Wt();Kt();Ht();jt();Xt();_qe=o((e,t,r,i,n,a,s)=>[`M${e},${t+a}`,`a${n},${a} 0,0,0 ${r},0`,`a${n},${a} 0,0,0 ${-r},0`,`l0,${i}`,`a${n},${a} 0,0,0 ${r},0`,`l0,${-i}`,`M${e},${t+a+s}`,`a${n},${a} 0,0,0 ${r},0`].join(" "),"createCylinderPathD"),Dqe=o((e,t,r,i,n,a,s)=>[`M${e},${t+a}`,`M${e+r},${t+a}`,`a${n},${a} 0,0,0 ${-r},0`,`l0,${i}`,`a${n},${a} 0,0,0 ${r},0`,`l0,${-i}`,`M${e},${t+a+s}`,`a${n},${a} 0,0,0 ${r},0`].join(" "),"createOuterCylinderPathD"),Rqe=o((e,t,r,i,n,a)=>[`M${e-r/2},${-i/2}`,`a${n},${a} 0,0,0 ${r},0`].join(" "),"createInnerCylinderPathD"),one=10,lne=10;o(cne,"linedCylinder")});async function hne(e,t){let{labelStyles:r,nodeStyles:i}=ct(t);t.labelStyle=r;let n=t.padding??0,a=t.look==="neo"?16:n,s=t.look==="neo"?12:n;if(t.width||t.height){let w=t.width;t.width=(w??0)*10/11-a*2,t.width<10&&(t.width=10),t.height=(t?.height??0)-s*2,t.height<10&&(t.height=10)}let{shapeSvg:l,bbox:u,label:h}=await At(e,t,Ct(t)),d=(t?.width?t?.width:u.width)+(a??0)*2,f=(t?.height?t?.height:u.height)+(s??0)*2,p=t.look==="neo"?f/4:f/8,m=f+p,{cssStyles:g}=t,y=ut.svg(l),v=mt(t,{});t.look!=="handDrawn"&&(v.roughness=0,v.fillStyle="solid");let x=[{x:-d/2-d/2*.1,y:-m/2},{x:-d/2-d/2*.1,y:m/2},...Bo(-d/2-d/2*.1,m/2,d/2+d/2*.1,m/2,p,.8),{x:d/2+d/2*.1,y:-m/2},{x:-d/2-d/2*.1,y:-m/2},{x:-d/2,y:-m/2},{x:-d/2,y:m/2*1.1},{x:-d/2,y:-m/2}],b=y.polygon(x.map(w=>[w.x,w.y]),v),T=l.insert(()=>b,":first-child");return T.attr("class","basic label-container outer-path"),g&&t.look!=="handDrawn"&&T.selectAll("path").attr("style",g),i&&t.look!=="handDrawn"&&T.selectAll("path").attr("style",i),T.attr("transform",`translate(0,${-p/2})`),h.attr("transform",`translate(${-d/2+(t.padding??0)+d/2*.1/2-(u.x-(u.left??0))},${-f/2+(t.padding??0)-p/2-(u.y-(u.top??0))})`),ft(t,T),t.intersect=function(w){return lt.polygon(t,x,w)},l}var dne=z(()=>{"use strict";Wt();Kt();jt();Ht();o(hne,"linedWaveEdgedRect")});async function fne(e,t){let{labelStyles:r,nodeStyles:i}=ct(t);t.labelStyle=r;let n=t.padding??0,a=t.look==="neo"?16:n,s=t.look==="neo"?12:n,l=t.look==="neo"?10:5;(t.width||t.height)&&(t.width=Math.max((t?.width??0)-a*2-2*l,10),t.height=Math.max((t?.height??0)-s*2-2*l,10));let{shapeSvg:u,bbox:h,label:d}=await At(e,t,Ct(t)),f=(t?.width?t?.width:h.width)+a*2+2*l,p=(t?.height?t?.height:h.height)+s*2+2*l,m=f-2*l,g=p-2*l,y=-m/2,v=-g/2,{cssStyles:x}=t,b=ut.svg(u),T=mt(t,{}),w=[{x:y-l,y:v+l},{x:y-l,y:v+g+l},{x:y+m-l,y:v+g+l},{x:y+m-l,y:v+g},{x:y+m,y:v+g},{x:y+m,y:v+g-l},{x:y+m+l,y:v+g-l},{x:y+m+l,y:v-l},{x:y+l,y:v-l},{x:y+l,y:v},{x:y,y:v},{x:y,y:v+l}],C=[{x:y,y:v+l},{x:y+m-l,y:v+l},{x:y+m-l,y:v+g},{x:y+m,y:v+g},{x:y+m,y:v},{x:y,y:v}];t.look!=="handDrawn"&&(T.roughness=0,T.fillStyle="solid");let k=tr(w),E=b.path(k,T),A=tr(C),N=b.path(A,T);t.look!=="handDrawn"&&(E=uN(E),N=uN(N));let P=u.insert("g",":first-child");return P.insert(()=>E),P.insert(()=>N),P.attr("class","basic label-container outer-path"),x&&t.look!=="handDrawn"&&P.selectAll("path").attr("style",x),i&&t.look!=="handDrawn"&&P.selectAll("path").attr("style",i),d.attr("transform",`translate(${-(h.width/2)-l-(h.x-(h.left??0))}, ${-(h.height/2)+l-(h.y-(h.top??0))})`),ft(t,P),t.intersect=function(I){return lt.polygon(t,w,I)},u}var pne=z(()=>{"use strict";Wt();Ht();jt();Kt();o(fne,"multiRect")});async function mne(e,t){let{labelStyles:r,nodeStyles:i}=ct(t);t.labelStyle=r;let{shapeSvg:n,bbox:a,label:s}=await At(e,t,Ct(t)),l=t.padding??0,u=t.look==="neo"?16:l,h=t.look==="neo"?12:l,d=!0;(t.width||t.height)&&(d=!1,t.width=(t?.width??0)-u*2,t.height=(t?.height??0)-h*3);let f=Math.max(a.width,t?.width??0)+u*2,p=Math.max(a.height,t?.height??0)+h*3,m=t.look==="neo"?p/4:p/8,g=p+(d?m/2:-m/2),y=-f/2,v=-g/2,x=10,{cssStyles:b}=t,T=Bo(y-x,v+g+x,y+f-x,v+g+x,m,.8),w=T?.[T.length-1],C=[{x:y-x,y:v+x},{x:y-x,y:v+g+x},...T,{x:y+f-x,y:w.y-x},{x:y+f,y:w.y-x},{x:y+f,y:w.y-2*x},{x:y+f+x,y:w.y-2*x},{x:y+f+x,y:v-x},{x:y+x,y:v-x},{x:y+x,y:v},{x:y,y:v},{x:y,y:v+x}],k=[{x:y,y:v+x},{x:y+f-x,y:v+x},{x:y+f-x,y:w.y-x},{x:y+f,y:w.y-x},{x:y+f,y:v},{x:y,y:v}],E=ut.svg(n),A=mt(t,{});t.look!=="handDrawn"&&(A.roughness=0,A.fillStyle="solid");let N=tr(C),P=E.path(N,A),I=tr(k),D=E.path(I,A),_=n.insert(()=>P,":first-child");return _.insert(()=>D),_.attr("class","basic label-container outer-path"),b&&t.look!=="handDrawn"&&_.selectAll("path").attr("style",b),i&&t.look!=="handDrawn"&&_.selectAll("path").attr("style",i),_.attr("transform",`translate(0,${-m/2})`),s.attr("transform",`translate(${-(a.width/2)-x-(a.x-(a.left??0))}, ${-(a.height/2)+x-m/2-(a.y-(a.top??0))})`),ft(t,_),t.intersect=function(R){return lt.polygon(t,C,R)},n}var gne=z(()=>{"use strict";Wt();Kt();jt();Ht();o(mne,"multiWaveEdgedRectangle")});async function yne(e,t,{config:{themeVariables:r}}){let{labelStyles:i,nodeStyles:n}=ct(t);t.labelStyle=i,t.useHtmlLabels||Mr(Nt())||(t.centerLabel=!0);let{shapeSvg:s,bbox:l,label:u}=await At(e,t,Ct(t)),h=Math.max(l.width+(t.padding??0)*2,t?.width??0),d=Math.max(l.height+(t.padding??0)*2,t?.height??0),f=-h/2,p=-d/2,{cssStyles:m}=t,g=ut.svg(s),y=mt(t,{fill:r.noteBkgColor,stroke:r.noteBorderColor});t.look!=="handDrawn"&&(y.roughness=0,y.fillStyle="solid");let v=g.rectangle(f,p,h,d,y),x=s.insert(()=>v,":first-child");return x.attr("class","basic label-container outer-path"),u.attr("class","label noteLabel"),m&&t.look!=="handDrawn"&&x.selectAll("path").attr("style",m),n&&t.look!=="handDrawn"&&x.selectAll("path").attr("style",n),u.attr("transform",`translate(${-l.width/2-(l.x-(l.left??0))}, ${-(l.height/2)-(l.y-(l.top??0))})`),ft(t,x),t.intersect=function(b){return lt.rect(t,b)},s}var vne=z(()=>{"use strict";jt();Kt();Ht();Wt();br();br();o(yne,"note")});async function xne(e,t){let{labelStyles:r,nodeStyles:i}=ct(t);t.labelStyle=r;let{shapeSvg:n,bbox:a}=await At(e,t,Ct(t)),s=a.width+(t.padding??0),l=a.height+(t.padding??0),u=s+l,h=.5,d=[{x:u/2,y:0},{x:u,y:-u/2},{x:u/2,y:-u},{x:0,y:-u/2}],f,{cssStyles:p}=t;if(t.look==="handDrawn"){let m=ut.svg(n),g=mt(t,{}),y=Lqe(0,0,u),v=m.path(y,g);f=n.insert(()=>v,":first-child").attr("transform",`translate(${-u/2+h}, ${u/2})`),p&&f.attr("style",p)}else f=Ma(n,u,u,d),f.attr("transform",`translate(${-u/2+h}, ${u/2})`);return i&&f.attr("style",i),ft(t,f),t.calcIntersect=function(m,g){let y=m.width,v=[{x:y/2,y:0},{x:y,y:-y/2},{x:y/2,y:-y},{x:0,y:-y/2}],x=lt.polygon(m,v,g);return{x:x.x-.5,y:x.y-.5}},t.intersect=function(m){return this.calcIntersect(t,m)},n}var Lqe,bne=z(()=>{"use strict";Wt();Kt();Ht();jt();Fu();Lqe=o((e,t,r)=>[`M${e+r/2},${t}`,`L${e+r},${t-r/2}`,`L${e+r/2},${t-r}`,`L${e},${t-r/2}`,"Z"].join(" "),"createDecisionBoxPathD");o(xne,"question")});async function Tne(e,t){let{labelStyles:r,nodeStyles:i}=ct(t);t.labelStyle=r;let n=t.padding??0,a=t.look==="neo"?21:n??0,s=t.look==="neo"?12:n??0,{shapeSvg:l,bbox:u,label:h}=await At(e,t,Ct(t)),d=(t?.width??u.width)+(t.look==="neo"?a*2:a),f=(t?.height??u.height)+(t.look==="neo"?s*2:s),p=-d/2,m=-f/2,g=m/2,y=[{x:p+g,y:m},{x:p,y:0},{x:p+g,y:-m},{x:-p,y:-m},{x:-p,y:m}],{cssStyles:v}=t,x=ut.svg(l),b=mt(t,{});t.look!=="handDrawn"&&(b.roughness=0,b.fillStyle="solid");let T=tr(y),w=x.path(T,b),C=l.insert(()=>w,":first-child");return C.attr("class","basic label-container outer-path"),v&&t.look!=="handDrawn"&&C.selectAll("path").attr("style",v),i&&t.look!=="handDrawn"&&C.selectAll("path").attr("style",i),C.attr("transform",`translate(${-g/2},0)`),h.attr("transform",`translate(${-g/2-u.width/2-(u.x-(u.left??0))}, ${-(u.height/2)-(u.y-(u.top??0))})`),ft(t,C),t.intersect=function(k){return lt.polygon(t,y,k)},l}var Cne=z(()=>{"use strict";Wt();Kt();Ht();jt();o(Tne,"rect_left_inv_arrow")});var Mqe,Nl,z4=z(()=>{"use strict";br();Ut();_s();Mqe=o(async(e,t,r,i=!1,n=!1)=>{let a=t||"";typeof a=="object"&&(a=a[0]);let s=ge(),l=Mr(s);return await wi(e,a,{style:r,isTitle:i,useHtmlLabels:l,markdown:!1,isNode:n,width:Number.POSITIVE_INFINITY},s)},"createLabel"),Nl=Mqe});async function kne(e,t){let{labelStyles:r,nodeStyles:i}=ct(t);t.labelStyle=r;let n;t.cssClasses?n="node "+t.cssClasses:n="node default";let a=e.insert("g").attr("class",n).attr("id",t.domId||t.id),s=a.insert("g"),l=a.insert("g").attr("class","label").attr("style",i),u=t.description,h=t.label,d=await Nl(l,h,t.labelStyle,!0,!0),f={width:0,height:0};if(Mr(ge())){let A=d.children[0],N=Je(d);f=A.getBoundingClientRect(),N.attr("width",f.width),N.attr("height",f.height)}Z.info("Text 2",u);let p=u||[],m=d.getBBox(),g=await Nl(l,Array.isArray(p)?p.join(" "):p,t.labelStyle,!0,!0),y=g.children[0],v=Je(g);f=y.getBoundingClientRect(),v.attr("width",f.width),v.attr("height",f.height);let x=(t.padding||0)/2;Je(g).attr("transform","translate( "+(f.width>m.width?0:(m.width-f.width)/2)+", "+(m.height+x+5)+")"),Je(d).attr("transform","translate( "+(f.width(Z.debug("Rough node insert CXC",P),I),":first-child"),k=a.insert(()=>(Z.debug("Rough node insert CXC",P),P),":first-child")}else k=s.insert("rect",":first-child"),E=s.insert("line"),k.attr("class","outer title-state").attr("style",i).attr("x",-f.width/2-x).attr("y",-f.height/2-x).attr("width",f.width+(t.padding||0)).attr("height",f.height+(t.padding||0)),E.attr("class","divider").attr("x1",-f.width/2-x).attr("x2",f.width/2+x).attr("y1",-f.height/2-x+m.height+x).attr("y2",-f.height/2-x+m.height+x);return ft(t,k),t.intersect=function(A){return lt.rect(t,A)},a}var wne=z(()=>{"use strict";Rr();Wt();z4();Kt();Ht();jt();Ut();_p();St();br();o(kne,"rectWithTitle")});async function Sne(e,t,{config:{themeVariables:r}}){let i=r?.radius??5,n={rx:i,ry:i,classes:"",labelPaddingX:(t?.padding??0)*1,labelPaddingY:(t?.padding??0)*1};return Ml(e,t,n)}var Ene=z(()=>{"use strict";Dp();o(Sne,"roundedRect")});async function Ane(e,t){let{labelStyles:r,nodeStyles:i}=ct(t);t.labelStyle=r;let n=t.look==="neo"?16:t.padding??0,a=t.look==="neo"?12:t.padding??0,{shapeSvg:s,bbox:l,label:u}=await At(e,t,Ct(t)),h=(t?.width??l.width)+n*2+(t.look==="neo"?Rp:Rp*2),d=(t?.height??l.height)+a*2,f=h-Rp,p=d,m=Rp-h/2,g=-d/2,{cssStyles:y}=t,v=ut.svg(s),x=mt(t,{});t.look!=="handDrawn"&&(x.roughness=0,x.fillStyle="solid");let b=[{x:m,y:g},{x:m+f,y:g},{x:m+f,y:g+p},{x:m-Rp,y:g+p},{x:m-Rp,y:g},{x:m,y:g},{x:m,y:g+p}],T=v.polygon(b.map(C=>[C.x,C.y]),x),w=s.insert(()=>T,":first-child");return w.attr("class","basic label-container outer-path").attr("style",ii(y)),i&&t.look!=="handDrawn"&&w.selectAll("path").attr("style",i),y&&t.look!=="handDrawn"&&w.selectAll("path").attr("style",i),u.attr("transform",`translate(${Rp/2-l.width/2-(l.x-(l.left??0))}, ${-(l.height/2)-(l.y-(l.top??0))})`),ft(t,w),t.intersect=function(C){return lt.rect(t,C)},s}var Rp,_ne=z(()=>{"use strict";Wt();Kt();Ht();jt();Xt();Rp=8;o(Ane,"shadedProcess")});async function Dne(e,t){let{labelStyles:r,nodeStyles:i}=ct(t);t.labelStyle=r;let n=t.padding??0,a=t.look==="neo"?16:n,s=t.look==="neo"?12:n;(t.width||t.height)&&(t.width=Math.max((t?.width??0)-a*2,10),t.height=Math.max((t?.height??0)/1.5-s*2,10));let{shapeSvg:l,bbox:u,label:h}=await At(e,t,Ct(t)),d=(t?.width?t?.width:u.width)+a*2,f=((t?.height?t?.height:u.height)+s*2)*1.5,p=d,m=f/1.5,g=-p/2,y=-m/2,{cssStyles:v}=t,x=ut.svg(l),b=mt(t,{});t.look!=="handDrawn"&&(b.roughness=0,b.fillStyle="solid");let T=[{x:g,y},{x:g,y:y+m},{x:g+p,y:y+m},{x:g+p,y:y-m/2}],w=tr(T),C=x.path(w,b),k=l.insert(()=>C,":first-child");return k.attr("class","basic label-container outer-path"),v&&t.look!=="handDrawn"&&k.selectChildren("path").attr("style",v),i&&t.look!=="handDrawn"&&k.selectChildren("path").attr("style",i),k.attr("transform",`translate(0, ${m/4})`),h.attr("transform",`translate(${-p/2+(t.padding??0)-(u.x-(u.left??0))}, ${-m/4+(t.padding??0)-(u.y-(u.top??0))})`),ft(t,k),t.intersect=function(E){return lt.polygon(t,T,E)},l}var Rne=z(()=>{"use strict";Wt();Kt();Ht();jt();o(Dne,"slopedRect")});async function Lne(e,t){let r=t.padding??0,i=t.look==="neo"?16:r*2,n=t.look==="neo"?12:r,a={rx:0,ry:0,classes:"",labelPaddingX:t.labelPaddingX??i,labelPaddingY:n};return Ml(e,t,a)}var Mne=z(()=>{"use strict";Dp();o(Lne,"squareRect")});async function Nne(e,t){let{labelStyles:r,nodeStyles:i}=ct(t);t.labelStyle=r;let n=t.padding??0,a=t.look==="neo"?20:n,s=t.look==="neo"?12:n,{shapeSvg:l,bbox:u}=await At(e,t,Ct(t)),h=u.height+(t.look==="neo"?s*2:s),d=u.width+h/4+(t.look==="neo"?a*2:a),f=h/2,{cssStyles:p}=t,m=ut.svg(l),g=mt(t,{});t.look!=="handDrawn"&&(g.roughness=0,g.fillStyle="solid");let y=[{x:-d/2+f,y:-h/2},{x:d/2-f,y:-h/2},...Ep(-d/2+f,0,f,50,90,270),{x:d/2-f,y:h/2},...Ep(d/2-f,0,f,50,270,450)],v=tr(y),x=m.path(v,g),b=l.insert(()=>x,":first-child");return b.attr("class","basic label-container outer-path"),p&&t.look!=="handDrawn"&&b.selectChildren("path").attr("style",p),i&&t.look!=="handDrawn"&&b.selectChildren("path").attr("style",i),ft(t,b),t.intersect=function(T){return lt.polygon(t,y,T)},l}var Ine=z(()=>{"use strict";Wt();Kt();Ht();jt();o(Nne,"stadium")});async function One(e,t){let r={rx:t.look==="neo"?3:5,ry:t.look==="neo"?3:5,classes:"flowchart-node"};return Ml(e,t,r)}var Pne=z(()=>{"use strict";Dp();o(One,"state")});function Bne(e,t,{config:{themeVariables:r}}){let{labelStyles:i,nodeStyles:n}=ct(t);t.labelStyle=i;let{cssStyles:a}=t,{lineColor:s,stateBorder:l,nodeBorder:u,nodeShadow:h}=r;(t.width||t.height)&&((t.width??0)<14&&(t.width=14),(t.height??0)<14&&(t.height=14)),t.width||(t.width=14),t.height||(t.height=14);let d=e.insert("g").attr("class","node default").attr("id",t.domId??t.id),f=ut.svg(d),p=mt(t,{});t.look!=="handDrawn"&&(p.roughness=0,p.fillStyle="solid");let m=f.circle(0,0,t.width,{...p,stroke:s,strokeWidth:2}),g=l??u,y=(t.width??0)*5/14,v=f.circle(0,0,y,{...p,fill:g,stroke:g,strokeWidth:2,fillStyle:"solid"}),x=d.insert(()=>m,":first-child");if(x.insert(()=>v),t.look!=="handDrawn"&&x.attr("class","outer-path"),a&&x.selectAll("path").attr("style",a),n&&x.selectAll("path").attr("style",n),t.width<25&&h&&t.look!=="handDrawn"){let b=e.node()?.ownerSVGElement?.id??"",T=b?`${b}-drop-shadow-small`:"drop-shadow-small";x.attr("style",`filter:url(#${T})`)}return ft(t,x),t.intersect=function(b){return lt.circle(t,(t.width??0)/2,b)},d}var Fne=z(()=>{"use strict";jt();Kt();Ht();Wt();o(Bne,"stateEnd")});function $ne(e,t,{config:{themeVariables:r}}){let{lineColor:i,nodeShadow:n}=r;(t.width||t.height)&&((t.width??0)<14&&(t.width=14),(t.height??0)<14&&(t.height=14)),t.width||(t.width=14),t.height||(t.height=14);let a=e.insert("g").attr("class","node default").attr("id",t.domId||t.id),s;if(t.look==="handDrawn"){let u=ut.svg(a).circle(0,0,t.width,Bre(i));s=a.insert(()=>u),s.attr("class","state-start").attr("r",(t.width??7)/2).attr("width",t.width??14).attr("height",t.height??14)}else s=a.insert("circle",":first-child"),s.attr("class","state-start").attr("r",(t.width??7)/2).attr("width",t.width??14).attr("height",t.height??14);if(t.width<25&&n&&t.look!=="handDrawn"){let l=e.node()?.ownerSVGElement?.id??"",u=l?`${l}-drop-shadow-small`:"drop-shadow-small";s.attr("style",`filter:url(#${u})`)}return ft(t,s),t.intersect=function(l){return lt.circle(t,(t.width??7)/2,l)},a}var zne=z(()=>{"use strict";jt();Kt();Ht();Wt();o($ne,"stateStart")});async function Gne(e,t){let{labelStyles:r,nodeStyles:i}=ct(t);t.labelStyle=r;let n=t?.padding??8,a=t.look==="neo"?28:n,s=t.look==="neo"?12:n,{shapeSvg:l,bbox:u}=await At(e,t,Ct(t)),h=(t?.width??u.width)+2*kg+a,d=(t?.height??u.height)+s,f=h-2*kg,p=d,m=-h/2,g=-d/2,y=[{x:0,y:0},{x:f,y:0},{x:f,y:-p},{x:0,y:-p},{x:0,y:0},{x:-8,y:0},{x:f+8,y:0},{x:f+8,y:-p},{x:-8,y:-p},{x:-8,y:0}];if(t.look==="handDrawn"){let v=ut.svg(l),x=mt(t,{}),b=v.rectangle(m,g,f+16,p,x),T=v.line(m+kg,g,m+kg,g+p,x),w=v.line(m+kg+f,g,m+kg+f,g+p,x);l.insert(()=>T,":first-child"),l.insert(()=>w,":first-child");let C=l.insert(()=>b,":first-child"),{cssStyles:k}=t;C.attr("class","basic label-container").attr("style",ii(k)),ft(t,C)}else{let v=Ma(l,f,p,y);i&&v.attr("style",i),ft(t,v)}return t.intersect=function(v){return lt.polygon(t,y,v)},l}var kg,Vne=z(()=>{"use strict";Wt();Kt();Ht();jt();Fu();Xt();kg=8;o(Gne,"subroutine")});async function Wne(e,t){let{labelStyles:r,nodeStyles:i}=ct(t);t.labelStyle=r;let n=t.padding??0,a=t.look==="neo"?16:n,s=t.look==="neo"?12:n;(t.width||t.height)&&(t.height=Math.max((t?.height??0)-s*2,10),t.width=Math.max((t?.width??0)-a*2-LN*(t.height+s*2),10));let{shapeSvg:l,bbox:u}=await At(e,t,Ct(t)),h=(t?.height?t?.height:u.height)+s*2,d=LN*h,f=LN*h,m=(t?.width?t?.width:u.width)+a*2+d-d,g=h,y=-m/2,v=-g/2,{cssStyles:x}=t,b=ut.svg(l),T=mt(t,{}),w=[{x:y-d/2,y:v},{x:y+m+d/2,y:v},{x:y+m+d/2,y:v+g},{x:y-d/2,y:v+g}],C=[{x:y+m-d/2,y:v+g},{x:y+m+d/2,y:v+g},{x:y+m+d/2,y:v+g-f}];t.look!=="handDrawn"&&(T.roughness=0,T.fillStyle="solid");let k=tr(w),E=b.path(k,T),A=tr(C),N=b.path(A,{...T,fillStyle:"solid"}),P=l.insert(()=>N,":first-child");return P.insert(()=>E,":first-child"),P.attr("class","basic label-container outer-path"),x&&t.look!=="handDrawn"&&P.selectAll("path").attr("style",x),i&&t.look!=="handDrawn"&&P.selectAll("path").attr("style",i),ft(t,P),t.intersect=function(I){return lt.polygon(t,w,I)},l}var LN,qne=z(()=>{"use strict";Wt();Ht();jt();Kt();LN=.2;o(Wne,"taggedRect")});async function Une(e,t){let{labelStyles:r,nodeStyles:i}=ct(t);t.labelStyle=r;let{shapeSvg:n,bbox:a,label:s}=await At(e,t,Ct(t)),l=Math.max(a.width+(t.padding??0)*2,t?.width??0),u=Math.max(a.height+(t.padding??0)*2,t?.height??0),h=u/8,d=.2*l,f=.2*u,p=u+h,{cssStyles:m}=t,g=ut.svg(n),y=mt(t,{});t.look!=="handDrawn"&&(y.roughness=0,y.fillStyle="solid");let v=[{x:-l/2-l/2*.1,y:p/2},...Bo(-l/2-l/2*.1,p/2,l/2+l/2*.1,p/2,h,.8),{x:l/2+l/2*.1,y:-p/2},{x:-l/2-l/2*.1,y:-p/2}],x=-l/2+l/2*.1,b=-p/2-f*.4,T=[{x:x+l-d,y:(b+u)*1.3},{x:x+l,y:b+u-f},{x:x+l,y:(b+u)*.9},...Bo(x+l,(b+u)*1.25,x+l-d,(b+u)*1.3,-u*.02,.5)],w=tr(v),C=g.path(w,y),k=tr(T),E=g.path(k,{...y,fillStyle:"solid"}),A=n.insert(()=>E,":first-child");return A.insert(()=>C,":first-child"),A.attr("class","basic label-container outer-path"),m&&t.look!=="handDrawn"&&A.selectAll("path").attr("style",m),i&&t.look!=="handDrawn"&&A.selectAll("path").attr("style",i),A.attr("transform",`translate(0,${-h/2})`),s.attr("transform",`translate(${-l/2+(t.padding??0)-(a.x-(a.left??0))},${-u/2+(t.padding??0)-h/2-(a.y-(a.top??0))})`),ft(t,A),t.intersect=function(N){return lt.polygon(t,v,N)},n}var Hne=z(()=>{"use strict";Wt();Kt();jt();Ht();o(Une,"taggedWaveEdgedRectangle")});async function Yne(e,t){let{labelStyles:r,nodeStyles:i}=ct(t);t.labelStyle=r;let{shapeSvg:n,bbox:a}=await At(e,t,Ct(t)),s=Math.max(a.width+(t.padding??0),t?.width||0),l=Math.max(a.height+(t.padding??0),t?.height||0),u=-s/2,h=-l/2,d=n.insert("rect",":first-child");return d.attr("class","text").attr("style",i).attr("rx",0).attr("ry",0).attr("x",u).attr("y",h).attr("width",s).attr("height",l),ft(t,d),t.intersect=function(f){return lt.rect(t,f)},n}var jne=z(()=>{"use strict";Wt();Kt();Ht();o(Yne,"text")});async function Zne(e,t){let{labelStyles:r,nodeStyles:i}=ct(t);t.labelStyle=r;let n=t.padding??0,a=t.look==="neo"?12:n/2;if(t.width||t.height){let y=t.height??0;t.height=(t.height??0)-a,t.heightT,":first-child"),g=s.insert(()=>b,":first-child"),g.attr("class","basic label-container"),m&&g.attr("style",m)}else{let y=Nqe(0,0,p,h,f,d);g=s.insert("path",":first-child").attr("d",y).attr("class","basic label-container").attr("style",ii(m)).attr("style",i),g.attr("class","basic label-container outer-path"),m&&g.selectAll("path").attr("style",m),i&&g.selectAll("path").attr("style",i)}return g.attr("label-offset-x",f),g.attr("transform",`translate(${-p/2}, ${h/2} )`),u.attr("transform",`translate(${-(l.width/2)-f-(l.x-(l.left??0))}, ${-(l.height/2)-(l.y-(l.top??0))})`),ft(t,g),t.intersect=function(y){let v=lt.rect(t,y),x=v.y-(t.y??0);if(d!=0&&(Math.abs(x)<(t.height??0)/2||Math.abs(x)==(t.height??0)/2&&Math.abs(v.x-(t.x??0))>(t.width??0)/2-f)){let b=f*f*(1-x*x/(d*d));b!=0&&(b=Math.sqrt(Math.abs(b))),b=f-b,y.x-(t.x??0)>0&&(b=-b),v.x+=b}return v},s}var Nqe,Iqe,Oqe,Xne,Kne,Qne=z(()=>{"use strict";Wt();Ht();jt();Kt();Xt();Nqe=o((e,t,r,i,n,a)=>`M${e},${t}
a${n},${a} 0,0,1 0,${-i}
l${r},0
a${n},${a} 0,0,1 0,${i}
M${r},${-i}
a${n},${a} 0,0,0 0,${i}
l${-r},0`,"createCylinderPathD"),Iqe=o((e,t,r,i,n,a)=>[`M${e},${t}`,`M${e+r},${t}`,`a${n},${a} 0,0,0 0,${-i}`,`l${-r},0`,`a${n},${a} 0,0,0 0,${i}`,`l${r},0`].join(" "),"createOuterCylinderPathD"),Oqe=o((e,t,r,i,n,a)=>[`M${e+r/2},${-i/2}`,`a${n},${a} 0,0,0 0,${i}`].join(" "),"createInnerCylinderPathD"),Xne=5,Kne=10;o(Zne,"tiltedCylinder")});async function Jne(e,t){let{labelStyles:r,nodeStyles:i}=ct(t);t.labelStyle=r;let n=t.padding??0,a=(t.look==="neo",n),s=t.look==="neo"?n*2:n,{shapeSvg:l,bbox:u}=await At(e,t,Ct(t)),h=(t?.height??u.height)+a,d=(t?.width??u.width)+s,f=[{x:-3*h/6,y:0},{x:d+3*h/6,y:0},{x:d,y:-h},{x:0,y:-h}],p,{cssStyles:m}=t;if(t.look==="handDrawn"){let g=ut.svg(l),y=mt(t,{}),v=tr(f),x=g.path(v,y);p=l.insert(()=>x,":first-child").attr("transform",`translate(${-d/2}, ${h/2})`),m&&p.attr("style",m)}else p=Ma(l,d,h,f);return i&&p.attr("style",i),t.width=d,t.height=h,ft(t,p),t.intersect=function(g){return lt.polygon(t,f,g)},l}var eae=z(()=>{"use strict";Wt();Kt();Ht();jt();Fu();o(Jne,"trapezoid")});async function tae(e,t){let{labelStyles:r,nodeStyles:i}=ct(t);t.labelStyle=r;let n=t.padding??0,a=t.look==="neo"?16:n,s=t.look==="neo"?12:n,l=15,u=5;(t.width||t.height)&&(t.height=(t.height??0)-s*2,t.heightb,":first-child");return T.attr("class","basic label-container outer-path"),m&&t.look!=="handDrawn"&&T.selectChildren("path").attr("style",m),i&&t.look!=="handDrawn"&&T.selectChildren("path").attr("style",i),ft(t,T),t.intersect=function(w){return lt.polygon(t,v,w)},h}var rae=z(()=>{"use strict";Wt();Kt();Ht();jt();o(tae,"trapezoidalPentagon")});async function aae(e,t){let{labelStyles:r,nodeStyles:i}=ct(t);t.labelStyle=r;let n=t.padding??0,a=t.look==="neo"?n*2:n;(t.width||t.height)&&(t.width=((t?.width??0)-a)/2,t.widthb,":first-child").attr("transform",`translate(${-f/2}, ${f/2})`).attr("class","outer-path");return g&&t.look!=="handDrawn"&&T.selectChildren("path").attr("style",g),i&&t.look!=="handDrawn"&&T.selectChildren("path").attr("style",i),t.width=d,t.height=f,ft(t,T),u.attr("transform",`translate(${-l.width/2-(l.x-(l.left??0))}, ${f/2-(l.height+(t.padding??0)/(h?2:1)-(l.y-(l.top??0)))})`),t.intersect=function(w){return Z.info("Triangle intersect",t,m,w),lt.polygon(t,m,w)},s}var iae,nae,sae=z(()=>{"use strict";St();Wt();Kt();Ht();jt();Wt();Ir();Ut();iae=10,nae=10;o(aae,"triangle")});async function oae(e,t){let{labelStyles:r,nodeStyles:i}=ct(t);t.labelStyle=r;let n=t.padding??0,a=t.look==="neo"?16:n,s=t.look==="neo"?12:n,l=!0;(t.width||t.height)&&(l=!1,t.width=(t?.width??0)-a*2,t.width<10&&(t.width=10),t.height=(t?.height??0)-s*2,t.height<10&&(t.height=10));let{shapeSvg:u,bbox:h,label:d}=await At(e,t,Ct(t)),f=(t?.width?t?.width:h.width)+(a??0)*2,p=(t?.height?t?.height:h.height)+(s??0)*2,m=t.look==="neo"?p/4:p/8,g=p+(l?m:-m),{cssStyles:y}=t,x=14-f,b=x>0?x/2:0,T=ut.svg(u),w=mt(t,{});t.look!=="handDrawn"&&(w.roughness=0,w.fillStyle="solid");let C=[{x:-f/2-b,y:g/2},...Bo(-f/2-b,g/2,f/2+b,g/2,m,.8),{x:f/2+b,y:-g/2},{x:-f/2-b,y:-g/2}],k=tr(C),E=T.path(k,w),A=u.insert(()=>E,":first-child");return A.attr("class","basic label-container outer-path"),y&&t.look!=="handDrawn"&&A.selectAll("path").attr("style",y),i&&t.look!=="handDrawn"&&A.selectAll("path").attr("style",i),A.attr("transform",`translate(0,${-m/2})`),d.attr("transform",`translate(${-f/2+(t.padding??0)-(h.x-(h.left??0))},${-p/2+(t.padding??0)-m-(h.y-(h.top??0))})`),ft(t,A),t.intersect=function(N){return lt.polygon(t,C,N)},u}var lae=z(()=>{"use strict";Wt();Kt();jt();Ht();o(oae,"waveEdgedRectangle")});async function cae(e,t){let{labelStyles:r,nodeStyles:i}=ct(t);t.labelStyle=r;let n=t.padding??0,a=t.look==="neo"?16:n,s=t.look==="neo"?20:n;if(t.width||t.height){t.width=t?.width??0,t.width<20&&(t.width=20),t.height=t?.height??0,t.height<10&&(t.height=10);let w=Math.min(t.height*.2,t.height/4);t.height=Math.ceil(t.height-s-w*(20/9)),t.width=t.width-a*2}let{shapeSvg:l,bbox:u}=await At(e,t,Ct(t)),h=(t?.width?t?.width:u.width)+a*2,d=(t?.height?t?.height:u.height)+s,f=d/8,p=d+f*2,{cssStyles:m}=t,g=ut.svg(l),y=mt(t,{});t.look!=="handDrawn"&&(y.roughness=0,y.fillStyle="solid");let v=[{x:-h/2,y:p/2},...Bo(-h/2,p/2,h/2,p/2,f,1),{x:h/2,y:-p/2},...Bo(h/2,-p/2,-h/2,-p/2,f,-1)],x=tr(v),b=g.path(x,y),T=l.insert(()=>b,":first-child");return T.attr("class","basic label-container"),m&&t.look!=="handDrawn"&&T.selectAll("path").attr("style",m),i&&t.look!=="handDrawn"&&T.selectAll("path").attr("style",i),ft(t,T),t.intersect=function(w){return lt.polygon(t,v,w)},l}var uae=z(()=>{"use strict";Wt();Kt();Ht();jt();o(cae,"waveRectangle")});async function hae(e,t){let{labelStyles:r,nodeStyles:i}=ct(t);t.labelStyle=r;let n=t.look==="neo"?16:t.padding??0,a=t.look==="neo"?12:t.padding??0;(t.width||t.height)&&(t.width=Math.max((t?.width??0)-n*2-on,10),t.height=Math.max((t?.height??0)-a*2-on,10));let{shapeSvg:s,bbox:l,label:u}=await At(e,t,Ct(t)),h=(t?.width?t?.width:l.width)+n*2+on,d=(t?.height?t?.height:l.height)+a*2+on,f=h-on,p=d-on,m=-f/2,g=-p/2,{cssStyles:y}=t,v=ut.svg(s),x=mt(t,{}),b=[{x:m-on,y:g-on},{x:m-on,y:g+p},{x:m+f,y:g+p},{x:m+f,y:g-on}],T=`M${m-on},${g-on} L${m+f},${g-on} L${m+f},${g+p} L${m-on},${g+p} L${m-on},${g-on}
M${m-on},${g} L${m+f},${g}
M${m},${g-on} L${m},${g+p}`;t.look!=="handDrawn"&&(x.roughness=0,x.fillStyle="solid");let w=v.path(T,x),C=s.insert(()=>w,":first-child");return C.attr("transform",`translate(${on/2}, ${on/2})`),C.attr("class","basic label-container outer-path"),y&&t.look!=="handDrawn"&&C.selectAll("path").attr("style",y),i&&t.look!=="handDrawn"&&C.selectAll("path").attr("style",i),u.attr("transform",`translate(${-(l.width/2)+on/2-(l.x-(l.left??0))}, ${-(l.height/2)+on/2-(l.y-(l.top??0))})`),ft(t,C),t.intersect=function(k){return lt.polygon(t,b,k)},s}var on,dae=z(()=>{"use strict";Wt();Ht();jt();Kt();on=10;o(hae,"windowPane")});async function MN(e,t){let r=t;r.alias&&(t.label=r.alias);let{theme:i,themeVariables:n}=Nt(),{rowEven:a,rowOdd:s,nodeBorder:l,borderColorArray:u}=n;if(t.look==="handDrawn"){let{themeVariables:Q}=Nt(),{background:Y}=Q,ae={...t,id:t.id+"-background",domId:(t.domId||t.id)+"-background",look:"default",cssStyles:["stroke: none",`fill: ${Y}`]};await MN(e,ae)}let h=Nt();t.useHtmlLabels=h.htmlLabels;let d=h.er?.diagramPadding??10,f=h.er?.entityPadding??6,{cssStyles:p}=t,{labelStyles:m,nodeStyles:g}=ct(t);if(r.attributes.length===0&&t.label){let Q={rx:0,ry:0,labelPaddingX:d,labelPaddingY:d*1.5,classes:""};ta(t.label,h)+Q.labelPaddingX*20){let Q=x.width+d*2-(C+k+E+A);C+=Q/I,k+=Q/I,E>0&&(E+=Q/I),A>0&&(A+=Q/I)}let _=C+k+E+A,R=ut.svg(v),M=mt(t,{});t.look!=="handDrawn"&&(M.roughness=0,M.fillStyle="solid");let L=0;w.length>0&&(L=w.reduce((Q,Y)=>Q+(Y?.rowHeight??0),0));let B=Math.max(D.width+d*2,t?.width||0,_),O=Math.max((L??0)+x.height,t?.height||0),$=-B/2,G=-O/2;if(v.selectAll("g:not(:first-child)").each((Q,Y,ae)=>{let J=Je(ae[Y]),te=J.attr("transform"),re=0,ee=0;if(te){let ue=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(te);ue&&(re=parseFloat(ue[1]),ee=parseFloat(ue[2]),J.attr("class").includes("attribute-name")?re+=C:J.attr("class").includes("attribute-keys")?re+=C+k:J.attr("class").includes("attribute-comment")&&(re+=C+k+E))}J.attr("transform",`translate(${$+d/2+re}, ${ee+G+x.height+f/2})`)}),v.select(".name").attr("transform","translate("+-x.width/2+", "+(G+f/2)+")"),i!=null&&fae.has(i)){let Q=r.colorIndex??0;v.attr("data-color-id",`color-${Q%u.length}`)}let F=R.rectangle($,G,B,O,M),V=v.insert(()=>F,":first-child").attr("class","outer-path").attr("style",p.join(""));T.push(0);for(let[Q,Y]of w.entries()){let J=(Q+1)%2===0&&Y.yOffset!==0,te=R.rectangle($,x.height+G+Y?.yOffset,B,Y?.rowHeight,{...M,fill:J?a:s,stroke:l});v.insert(()=>te,"g.label").attr("style",p.join("")).attr("class",`row-rect-${J?"even":"odd"}`)}let H=1e-4,j=tb($,x.height+G,B+$,x.height+G,H),U=R.polygon(j.map(Q=>[Q.x,Q.y]),M);if(v.insert(()=>U).attr("class","divider"),j=tb(C+$,x.height+G,C+$,O+G,H),U=R.polygon(j.map(Q=>[Q.x,Q.y]),M),v.insert(()=>U).attr("class","divider"),N){let Q=C+k+$;j=tb(Q,x.height+G,Q,O+G,H),U=R.polygon(j.map(Y=>[Y.x,Y.y]),M),v.insert(()=>U).attr("class","divider")}if(P){let Q=C+k+E+$;j=tb(Q,x.height+G,Q,O+G,H),U=R.polygon(j.map(Y=>[Y.x,Y.y]),M),v.insert(()=>U).attr("class","divider")}for(let Q of T){let Y=x.height+G+Q;j=tb($,Y,B+$,Y,H),U=R.polygon(j.map(ae=>[ae.x,ae.y]),M),v.insert(()=>U).attr("class","divider")}if(ft(t,V),g&&t.look!=="handDrawn")if(i!=null&&Pqe.has(i))v.selectAll("path").attr("style",g);else{let Y=g.split(";")?.filter(ae=>ae.includes("stroke"))?.map(ae=>`${ae}`).join("; ");v.selectAll("path").attr("style",Y??""),v.selectAll(".row-rect-even path").attr("style",g)}return t.intersect=function(Q){return lt.rect(t,Q)},v}async function eb(e,t,r,i=0,n=0,a=[],s=""){let l=e.insert("g").attr("class",`label ${a.join(" ")}`).attr("transform",`translate(${i}, ${n})`).attr("style",s);t!==cc(t)&&(t=cc(t),t=t.replaceAll("<","<").replaceAll(">",">"));let u=l.node().appendChild(await wi(l,t,{width:ta(t,r)+100,style:s,useHtmlLabels:r.htmlLabels},r));if(t.includes("<")||t.includes(">")){let d=u.children[0];for(d.textContent=d.textContent.replaceAll("<","<").replaceAll(">",">");d.childNodes[0];)d=d.childNodes[0],d.textContent=d.textContent.replaceAll("<","<").replaceAll(">",">")}let h=u.getBBox();if(Aa(r.htmlLabels)){let d=u.children[0];d.style.textAlign="start";let f=Je(u);h=d.getBoundingClientRect(),f.attr("width",h.width),f.attr("height",h.height)}return h}function tb(e,t,r,i,n){return e===r?[{x:e-n/2,y:t},{x:e+n/2,y:t},{x:r+n/2,y:i},{x:r-n/2,y:i}]:[{x:e,y:t-n/2},{x:e,y:t+n/2},{x:r,y:i+n/2},{x:r,y:i-n/2}]}var fae,Pqe,pae=z(()=>{"use strict";Wt();Kt();Ht();jt();Dp();br();_s();Ir();Rr();Xt();fae=new Set(["redux-color","redux-dark-color"]),Pqe=new Set(["redux","redux-dark","redux-color","redux-dark-color"]);o(MN,"erBox");o(eb,"addText");o(tb,"lineToPolygon")});async function mae(e,t,r,i,n=r.class.padding??12){let a=i?0:3,s=e.insert("g").attr("class",Ct(t)).attr("id",t.domId||t.id),l=null,u=null,h=null,d=null,f=0,p=0,m=0;if(l=s.insert("g").attr("class","annotation-group text"),t.annotations.length>0){let b=t.annotations[0];await G4(l,{text:`\xAB${b}\xBB`},0),f=l.node().getBBox().height}u=s.insert("g").attr("class","label-group text"),await G4(u,t,0,["font-weight: bolder"]);let g=u.node().getBBox();p=g.height,h=s.insert("g").attr("class","members-group text");let y=0;for(let b of t.members){let T=await G4(h,b,y,[b.parseClassifier()]);y+=T+a}m=h.node().getBBox().height,m<=0&&(m=n/2),d=s.insert("g").attr("class","methods-group text");let v=0;for(let b of t.methods){let T=await G4(d,b,v,[b.parseClassifier()]);v+=T+a}let x=s.node().getBBox();if(l!==null){let b=l.node().getBBox();l.attr("transform",`translate(${-b.width/2})`)}return u.attr("transform",`translate(${-g.width/2}, ${f})`),x=s.node().getBBox(),h.attr("transform",`translate(0, ${f+p+n*2})`),x=s.node().getBBox(),d.attr("transform",`translate(0, ${f+p+(m?m+n*4:n*2)})`),x=s.node().getBBox(),{shapeSvg:s,bbox:x}}async function G4(e,t,r,i=[]){let n=e.insert("g").attr("class","label").attr("style",i.join("; ")),a=Nt(),s="useHtmlLabels"in t?t.useHtmlLabels:Aa(a.htmlLabels)??!0,l="";"text"in t?l=t.text:l=t.label,!s&&l.startsWith("\\")&&(l=l.substring(1)),Bi(l)&&(s=!0);let u=await wi(n,Ev(Qa(l)),{width:ta(l,a)+50,classes:"markdown-node-label",useHtmlLabels:s},a),h,d=1;if(s){let f=u.children[0],p=Je(u);d=f.innerHTML.split(" ").length,f.innerHTML.includes("")&&(d+=f.innerHTML.split("").length-1);let m=f.getElementsByTagName("img");if(m){let g=l.replace(/ ]*>/g,"").trim()==="";await Promise.all([...m].map(y=>new Promise(v=>{function x(){if(y.style.display="flex",y.style.flexDirection="column",g){let b=a.fontSize?.toString()??window.getComputedStyle(document.body).fontSize,w=parseInt(b,10)*5+"px";y.style.minWidth=w,y.style.maxWidth=w}else y.style.width="100%";v(y)}o(x,"setupImage"),setTimeout(()=>{y.complete&&x()}),y.addEventListener("error",x),y.addEventListener("load",x)})))}h=f.getBoundingClientRect(),p.attr("width",h.width),p.attr("height",h.height)}else{i.includes("font-weight: bolder")&&Je(u).selectAll("tspan").attr("font-weight",""),d=u.children.length;let f=u.children[0];(u.textContent===""||u.textContent.includes(">"))&&(f.textContent=l[0]+l.substring(1).replaceAll(">",">").replaceAll("<","<").trim(),l[1]===" "&&(f.textContent=f.textContent[0]+" "+f.textContent.substring(1))),f.textContent==="undefined"&&(f.textContent=""),h=u.getBBox()}return n.attr("transform","translate(0,"+(-h.height/(2*d)+r)+")"),h.height}var gae=z(()=>{"use strict";Rr();br();Wt();Xt();Ut();_s();Ir();o(mae,"textHelper");o(G4,"addText")});async function yae(e,t){let r=ge(),{themeVariables:i}=r,{useGradient:n}=i,a=r.class.padding??12,s=a,l=t.useHtmlLabels??Aa(r.htmlLabels)??!0,u=t;u.annotations=u.annotations??[],u.members=u.members??[],u.methods=u.methods??[];let{shapeSvg:h,bbox:d}=await mae(e,t,r,l,s),{labelStyles:f,nodeStyles:p}=ct(t);t.labelStyle=f,t.cssStyles=u.styles||"";let m=u.styles?.join(";")||p||"";t.cssStyles||(t.cssStyles=m.replaceAll("!important","").split(";"));let g=u.members.length===0&&u.methods.length===0&&!r.class?.hideEmptyMembersBox,y=ut.svg(h),v=mt(t,{});t.look!=="handDrawn"&&(v.roughness=0,v.fillStyle="solid");let x=Math.max(t.width??0,d.width),b=Math.max(t.height??0,d.height),T=(t.height??0)>d.height;u.members.length===0&&u.methods.length===0?b+=s:u.members.length>0&&u.methods.length===0&&(b+=s*2);let w=-x/2,C=-b/2,k=g?a*2:u.members.length===0&&u.methods.length===0?-a:0;T&&(k=a*2);let E=y.rectangle(w-a,C-a-(g?a:u.members.length===0&&u.methods.length===0?-a/2:0),x+2*a,b+2*a+k,v),A=h.insert(()=>E,":first-child");A.attr("class","basic label-container outer-path");let N=A.node().getBBox(),P=h.select(".annotation-group").node().getBBox().height-(g?a/2:0)||0,I=h.select(".label-group").node().getBBox().height-(g?a/2:0)||0,D=h.select(".members-group").node().getBBox().height-(g?a/2:0)||0,_=(P+I+C+a-(C-a-(g?a:u.members.length===0&&u.methods.length===0?-a/2:0)))/2;if(h.selectAll(".text").each((R,M,L)=>{let B=Je(L[M]),O=B.attr("transform"),$=0;if(O){let H=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(O);H&&($=parseFloat(H[2]))}let G=$+C+a-(g?a:u.members.length===0&&u.methods.length===0?-a/2:0);if(B.attr("class").includes("methods-group")){let V=Math.max(D,s/2);T?G=Math.max(_,P+I+V+C+s*2+a)+s*2:G=P+I+V+C+s*4+a}u.members.length===0&&u.methods.length===0&&r.class?.hideEmptyMembersBox&&(u.annotations.length>0?G=$-s:G=$),l||(G-=4);let F=w;(B.attr("class").includes("label-group")||B.attr("class").includes("annotation-group"))&&(F=-B.node()?.getBBox().width/2||0,h.selectAll("text").each(function(V,H,j){window.getComputedStyle(j[H]).textAnchor==="middle"&&(F=0)})),B.attr("transform",`translate(${F}, ${G})`)}),u.members.length>0||u.methods.length>0||g){let R=P+I+C+a,M=y.line(N.x,R,N.x+N.width,R+.001,v);h.insert(()=>M).attr("class",`divider${t.look==="neo"&&!n?" neo-line":""}`).attr("style",m)}if(g||u.members.length>0||u.methods.length>0){let R=P+I+D+C+s*2+a,M=y.line(N.x,T?Math.max(_,R):R,N.x+N.width,(T?Math.max(_,R):R)+.001,v);h.insert(()=>M).attr("class",`divider${t.look==="neo"&&!n?" neo-line":""}`).attr("style",m)}if(u.look!=="handDrawn"&&h.selectAll("path").attr("style",m),A.select(":nth-child(2)").attr("style",m),h.selectAll(".divider").select("path").attr("style",m),t.labelStyle?h.selectAll("span").attr("style",t.labelStyle):h.selectAll("span").attr("style",m),!l){let R=RegExp(/color\s*:\s*([^;]*)/),M=R.exec(m);if(M){let L=M[0].replace("color","fill");h.selectAll("tspan").attr("style",L)}else if(f){let L=R.exec(f);if(L){let B=L[0].replace("color","fill");h.selectAll("tspan").attr("style",B)}}}return ft(t,A),t.intersect=function(R){return lt.rect(t,R)},h}var vae=z(()=>{"use strict";Wt();Ut();Rr();jt();Ht();Kt();gae();Ir();o(yae,"classBox")});async function xae(e,t){let{labelStyles:r,nodeStyles:i}=ct(t);t.labelStyle=r;let n=t,a=t,s=20,l=20,u="verifyMethod"in t,h=Ct(t),{themeVariables:d}=ge(),{borderColorArray:f,requirementEdgeLabelBackground:p}=d,m=e.insert("g").attr("class",h).attr("id",t.domId??t.id),g;u?g=await $u(m,`<<${n.type}>>`,0,t.labelStyle):g=await $u(m,"<<Element>>",0,t.labelStyle);let y=g,v=await $u(m,n.name,y,t.labelStyle+"; font-weight: bold;");if(y+=v+l,u){let N=await $u(m,`${n.requirementId?`ID: ${n.requirementId}`:""}`,y,t.labelStyle);y+=N;let P=await $u(m,`${n.text?`Text: ${n.text}`:""}`,y,t.labelStyle);y+=P;let I=await $u(m,`${n.risk?`Risk: ${n.risk}`:""}`,y,t.labelStyle);y+=I,await $u(m,`${n.verifyMethod?`Verification: ${n.verifyMethod}`:""}`,y,t.labelStyle)}else{let N=await $u(m,`${a.type?`Type: ${a.type}`:""}`,y,t.labelStyle);y+=N,await $u(m,`${a.docRef?`Doc Ref: ${a.docRef}`:""}`,y,t.labelStyle)}let x=(m.node()?.getBBox().width??200)+s,b=(m.node()?.getBBox().height??200)+s,T=-x/2,w=-b/2,C=ut.svg(m),k=mt(t,{});t.look!=="handDrawn"&&(k.roughness=0,k.fillStyle="solid");let E=C.rectangle(T,w,x,b,k),A=m.insert(()=>E,":first-child");if(A.attr("class","basic label-container outer-path").attr("style",i),f?.length){let N=t.colorIndex??0;m.attr("data-color-id",`color-${N%f.length}`)}if(m.selectAll(".label").each((N,P,I)=>{let D=Je(I[P]),_=D.attr("transform"),R=0,M=0;if(_){let $=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(_);$&&(R=parseFloat($[1]),M=parseFloat($[2]))}let L=M-b/2,B=T+s/2;(P===0||P===1)&&(B=R),D.attr("transform",`translate(${B}, ${L+s})`)}),y>g+v+l){let N=w+g+v+l,P;if(t.look==="neo"){let _=[[T,N],[T+x,N],[T+x,N+.001],[T,N+.001]];P=C.polygon(_,k)}else P=C.line(T,N,T+x,N,k);m.insert(()=>P).attr("class","divider")}return ft(t,A),t.intersect=function(N){return lt.rect(t,N)},i&&t.look!=="handDrawn"&&(p||f?.length)&&m.selectAll("path").attr("style",i),m}async function $u(e,t,r,i=""){if(t==="")return 0;let n=e.insert("g").attr("class","label").attr("style",i),a=ge(),s=a.htmlLabels??!0,l=await wi(n,Ev(Qa(t)),{width:ta(t,a)+50,classes:"markdown-node-label",useHtmlLabels:s,style:i},a),u;if(s){let h=l.children[0],d=Je(l);u=h.getBoundingClientRect(),d.attr("width",u.width),d.attr("height",u.height)}else{let h=l.children[0];for(let d of h.children)i&&d.setAttribute("style",i);u=l.getBBox(),u.height+=6}return n.attr("transform",`translate(${-u.width/2},${-u.height/2+r})`),u.height}var bae=z(()=>{"use strict";Wt();Kt();Ht();jt();Xt();Ut();_s();Rr();o(xae,"requirementBox");o($u,"addText")});async function Tae(e,t,{config:r}){let{labelStyles:i,nodeStyles:n}=ct(t);t.labelStyle=i||"";let a=10,s=t.width;t.width=(t.width??200)-10;let{shapeSvg:l,bbox:u,label:h}=await At(e,t,Ct(t)),d=t.padding||10,f="",p;"ticket"in t&&t.ticket&&r?.kanban?.ticketBaseUrl&&(f=r?.kanban?.ticketBaseUrl.replace("#TICKET#",t.ticket),p=l.insert("svg:a",":first-child").attr("class","kanban-ticket-link").attr("xlink:href",f).attr("target","_blank"));let m={useHtmlLabels:t.useHtmlLabels,labelStyle:t.labelStyle||"",width:t.width,img:t.img,padding:t.padding||8,centerLabel:!1},g,y;p?{label:g,bbox:y}=await A4(p,"ticket"in t&&t.ticket||"",m):{label:g,bbox:y}=await A4(l,"ticket"in t&&t.ticket||"",m);let{label:v,bbox:x}=await A4(l,"assigned"in t&&t.assigned||"",m);t.width=s;let b=10,T=t?.width||0,w=Math.max(y.height,x.height)/2,C=Math.max(u.height+b*2,t?.height||0)+w,k=-T/2,E=-C/2;h.attr("transform","translate("+(d-T/2)+", "+(-w-u.height/2)+")"),g.attr("transform","translate("+(d-T/2)+", "+(-w+u.height/2)+")"),v.attr("transform","translate("+(d+T/2-x.width-2*a)+", "+(-w+u.height/2)+")");let A,{rx:N,ry:P}=t,{cssStyles:I}=t;if(t.look==="handDrawn"){let D=ut.svg(l),_=mt(t,{}),R=N||P?D.path(Rs(k,E,T,C,N||0),_):D.rectangle(k,E,T,C,_);A=l.insert(()=>R,":first-child"),A.attr("class","basic label-container").attr("style",I||null)}else{A=l.insert("rect",":first-child"),A.attr("class","basic label-container __APA__").attr("style",n).attr("rx",N??5).attr("ry",P??5).attr("x",k).attr("y",E).attr("width",T).attr("height",C);let D="priority"in t&&t.priority;if(D){let _=l.append("line"),R=k+2,M=E+Math.floor((N??0)/2),L=E+C-Math.floor((N??0)/2);_.attr("x1",R).attr("y1",M).attr("x2",R).attr("y2",L).attr("stroke-width","4").attr("stroke",Bqe(D))}}return ft(t,A),t.height=C,t.intersect=function(D){return lt.rect(t,D)},l}var Bqe,Cae=z(()=>{"use strict";Wt();Kt();_p();Ht();jt();Bqe=o(e=>{switch(e){case"Very High":return"red";case"High":return"orange";case"Medium":return null;case"Low":return"blue";case"Very Low":return"lightblue"}},"colorFromPriority");o(Tae,"kanbanItem")});async function kae(e,t){let{labelStyles:r,nodeStyles:i}=ct(t);t.labelStyle=r;let{shapeSvg:n,bbox:a,halfPadding:s,label:l}=await At(e,t,Ct(t)),u=a.width+10*s,h=a.height+8*s,d=.15*u,{cssStyles:f}=t,p=a.width+20,m=a.height+20,g=Math.max(u,p),y=Math.max(h,m);l.attr("transform",`translate(${-a.width/2}, ${-a.height/2})`);let v,x=`M0 0
a${d},${d} 1 0,0 ${g*.25},${-1*y*.1}
a${d},${d} 1 0,0 ${g*.25},0
a${d},${d} 1 0,0 ${g*.25},0
a${d},${d} 1 0,0 ${g*.25},${y*.1}
a${d},${d} 1 0,0 ${g*.15},${y*.33}
a${d*.8},${d*.8} 1 0,0 0,${y*.34}
a${d},${d} 1 0,0 ${-1*g*.15},${y*.33}
a${d},${d} 1 0,0 ${-1*g*.25},${y*.15}
a${d},${d} 1 0,0 ${-1*g*.25},0
a${d},${d} 1 0,0 ${-1*g*.25},0
a${d},${d} 1 0,0 ${-1*g*.25},${-1*y*.15}
a${d},${d} 1 0,0 ${-1*g*.1},${-1*y*.33}
a${d*.8},${d*.8} 1 0,0 0,${-1*y*.34}
a${d},${d} 1 0,0 ${g*.1},${-1*y*.33}
H0 V0 Z`;if(t.look==="handDrawn"){let b=ut.svg(n),T=mt(t,{}),w=b.path(x,T);v=n.insert(()=>w,":first-child"),v.attr("class","basic label-container").attr("style",ii(f))}else v=n.insert("path",":first-child").attr("class","basic label-container").attr("style",i).attr("d",x);return v.attr("transform",`translate(${-g/2}, ${-y/2})`),ft(t,v),t.calcIntersect=function(b,T){return lt.rect(b,T)},t.intersect=function(b){return Z.info("Bang intersect",t,b),lt.rect(t,b)},n}var wae=z(()=>{"use strict";St();Wt();Kt();Ht();jt();Xt();o(kae,"bang")});async function Sae(e,t){let{labelStyles:r,nodeStyles:i}=ct(t);t.labelStyle=r;let{shapeSvg:n,bbox:a,halfPadding:s,label:l}=await At(e,t,Ct(t)),u=a.width+2*s,h=a.height+2*s,d=.15*u,f=.25*u,p=.35*u,m=.2*u,{cssStyles:g}=t,y,v=`M0 0
a${d},${d} 0 0,1 ${u*.25},${-1*u*.1}
a${p},${p} 1 0,1 ${u*.4},${-1*u*.1}
a${f},${f} 1 0,1 ${u*.35},${u*.2}
a${d},${d} 1 0,1 ${u*.15},${h*.35}
a${m},${m} 1 0,1 ${-1*u*.15},${h*.65}
a${f},${d} 1 0,1 ${-1*u*.25},${u*.15}
a${p},${p} 1 0,1 ${-1*u*.5},0
a${d},${d} 1 0,1 ${-1*u*.25},${-1*u*.15}
a${d},${d} 1 0,1 ${-1*u*.1},${-1*h*.35}
a${m},${m} 1 0,1 ${u*.1},${-1*h*.65}
H0 V0 Z`;if(t.look==="handDrawn"){let x=ut.svg(n),b=mt(t,{}),T=x.path(v,b);y=n.insert(()=>T,":first-child"),y.attr("class","basic label-container").attr("style",ii(g))}else y=n.insert("path",":first-child").attr("class","basic label-container").attr("style",i).attr("d",v);return l.attr("transform",`translate(${-a.width/2}, ${-a.height/2})`),y.attr("transform",`translate(${-u/2}, ${-h/2})`),ft(t,y),t.calcIntersect=function(x,b){return lt.rect(x,b)},t.intersect=function(x){return Z.info("Cloud intersect",t,x),lt.rect(t,x)},n}var Eae=z(()=>{"use strict";jt();St();Xt();Kt();Ht();Wt();o(Sae,"cloud")});async function Aae(e,t){let{labelStyles:r,nodeStyles:i}=ct(t);t.labelStyle=r;let{shapeSvg:n,bbox:a,halfPadding:s,label:l}=await At(e,t,Ct(t)),u=a.width+8*s,h=a.height+2*s,d=5,f=t.look==="neo"?`
M${-u/2} ${h/2-d}
v${-h+2*d}
q0,-${d} ${d},-${d}
h${u-2*d}
q${d},0 ${d},${d}
v${h-d}
H${-u/2}
Z
`:`
M${-u/2} ${h/2-d}
v${-h+2*d}
q0,-${d} ${d},-${d}
h${u-2*d}
q${d},0 ${d},${d}
v${h-2*d}
q0,${d} ${-d},${d}
h${-(u-2*d)}
q${-d},0 ${-d},${-d}
Z
`;if(!t.domId)throw new Error(`defaultMindmapNode: node "${t.id}" is missing a domId \u2014 was render.ts domId prefixing skipped?`);let p=n.append("path").attr("id",t.domId).attr("class","node-bkg node-"+t.type).attr("style",i).attr("d",f);return n.append("line").attr("class","node-line-").attr("x1",-u/2).attr("y1",h/2).attr("x2",u/2).attr("y2",h/2),l.attr("transform",`translate(${-a.width/2}, ${-a.height/2})`),n.append(()=>l.node()),ft(t,p),t.calcIntersect=function(m,g){return lt.rect(m,g)},t.intersect=function(m){return lt.rect(t,m)},n}var _ae=z(()=>{"use strict";Kt();Ht();Wt();o(Aae,"defaultMindmapNode")});async function Dae(e,t){let r={padding:t.padding??0};return $4(e,t,r)}var Rae=z(()=>{"use strict";RN();o(Dae,"mindmapCircle")});function Lae(e){return e in NN}var Fqe,$qe,NN,IN=z(()=>{"use strict";Jre();rie();nie();sie();RN();lie();uie();die();pie();gie();bie();Cie();wie();Eie();_ie();Mie();Iie();Pie();Fie();zie();Vie();qie();Hie();jie();Kie();Qie();ene();rne();nne();sne();une();dne();pne();gne();vne();bne();Cne();wne();Ene();_ne();Rne();Mne();Ine();Pne();Fne();zne();Vne();qne();Hne();jne();Qne();eae();rae();sae();lae();uae();dae();pae();vae();bae();Cae();wae();Eae();_ae();Rae();Fqe=[{semanticName:"Process",name:"Rectangle",shortName:"rect",description:"Standard process shape",aliases:["proc","process","rectangle"],internalAliases:["squareRect"],handler:Lne},{semanticName:"Event",name:"Rounded Rectangle",shortName:"rounded",description:"Represents an event",aliases:["event"],internalAliases:["roundedRect"],handler:Sne},{semanticName:"Terminal Point",name:"Stadium",shortName:"stadium",description:"Terminal point",aliases:["terminal","pill"],handler:Nne},{semanticName:"Subprocess",name:"Framed Rectangle",shortName:"fr-rect",description:"Subprocess",aliases:["subprocess","subproc","framed-rectangle","subroutine"],handler:Gne},{semanticName:"Database",name:"Cylinder",shortName:"cyl",description:"Database storage",aliases:["db","database","cylinder"],handler:xie},{semanticName:"Data Store",name:"Data Store",shortName:"datastore",description:"Data flow diagram data store",aliases:["data-store"],handler:Tie},{semanticName:"Start",name:"Circle",shortName:"circle",description:"Starting point",aliases:["circ"],handler:$4},{semanticName:"Bang",name:"Bang",shortName:"bang",description:"Bang",aliases:["bang"],handler:kae},{semanticName:"Cloud",name:"Cloud",shortName:"cloud",description:"cloud",aliases:["cloud"],handler:Sae},{semanticName:"Decision",name:"Diamond",shortName:"diam",description:"Decision-making step",aliases:["decision","diamond","question"],handler:xne},{semanticName:"Prepare Conditional",name:"Hexagon",shortName:"hex",description:"Preparation or condition step",aliases:["hexagon","prepare"],handler:Bie},{semanticName:"Data Input/Output",name:"Lean Right",shortName:"lean-r",description:"Represents input or output",aliases:["lean-right","in-out"],internalAliases:["lean_right"],handler:ine},{semanticName:"Data Input/Output",name:"Lean Left",shortName:"lean-l",description:"Represents output or input",aliases:["lean-left","out-in"],internalAliases:["lean_left"],handler:tne},{semanticName:"Priority Action",name:"Trapezoid Base Bottom",shortName:"trap-b",description:"Priority action",aliases:["priority","trapezoid-bottom","trapezoid"],handler:Jne},{semanticName:"Manual Operation",name:"Trapezoid Base Top",shortName:"trap-t",description:"Represents a manual task",aliases:["manual","trapezoid-top","inv-trapezoid"],internalAliases:["inv_trapezoid"],handler:Zie},{semanticName:"Stop",name:"Double Circle",shortName:"dbl-circ",description:"Represents a stop point",aliases:["double-circle"],internalAliases:["doublecircle"],handler:Sie},{semanticName:"Text Block",name:"Text Block",shortName:"text",description:"Text block",handler:Yne},{semanticName:"Card",name:"Notched Rectangle",shortName:"notch-rect",description:"Represents a card",aliases:["card","notched-rectangle"],handler:iie},{semanticName:"Lined/Shaded Process",name:"Lined Rectangle",shortName:"lin-rect",description:"Lined process shape",aliases:["lined-rectangle","lined-process","lin-proc","shaded-process"],handler:Ane},{semanticName:"Start",name:"Small Circle",shortName:"sm-circ",description:"Small starting point",aliases:["start","small-circle"],internalAliases:["stateStart"],handler:$ne},{semanticName:"Stop",name:"Framed Circle",shortName:"fr-circ",description:"Stop point",aliases:["stop","framed-circle"],internalAliases:["stateEnd"],handler:Bne},{semanticName:"Fork/Join",name:"Filled Rectangle",shortName:"fork",description:"Fork or join in process flow",aliases:["join"],internalAliases:["forkJoin"],handler:Nie},{semanticName:"Collate",name:"Hourglass",shortName:"hourglass",description:"Represents a collate operation",aliases:["hourglass","collate"],handler:$ie},{semanticName:"Comment",name:"Curly Brace",shortName:"brace",description:"Adds a comment",aliases:["comment","brace-l"],handler:cie},{semanticName:"Comment Right",name:"Curly Brace",shortName:"brace-r",description:"Adds a comment",handler:hie},{semanticName:"Comment with braces on both sides",name:"Curly Braces",shortName:"braces",description:"Adds a comment",handler:fie},{semanticName:"Com Link",name:"Lightning Bolt",shortName:"bolt",description:"Communication link",aliases:["com-link","lightning-bolt"],handler:ane},{semanticName:"Document",name:"Document",shortName:"doc",description:"Represents a document",aliases:["doc","document"],handler:oae},{semanticName:"Delay",name:"Half-Rounded Rectangle",shortName:"delay",description:"Represents a delay",aliases:["half-rounded-rectangle"],handler:Oie},{semanticName:"Direct Access Storage",name:"Horizontal Cylinder",shortName:"h-cyl",description:"Direct access storage",aliases:["das","horizontal-cylinder"],handler:Zne},{semanticName:"Disk Storage",name:"Lined Cylinder",shortName:"lin-cyl",description:"Disk storage",aliases:["disk","lined-cylinder"],handler:cne},{semanticName:"Display",name:"Curved Trapezoid",shortName:"curv-trap",description:"Represents a display",aliases:["curved-trapezoid","display"],handler:mie},{semanticName:"Divided Process",name:"Divided Rectangle",shortName:"div-rect",description:"Divided process shape",aliases:["div-proc","divided-rectangle","divided-process"],handler:kie},{semanticName:"Extract",name:"Triangle",shortName:"tri",description:"Extraction process",aliases:["extract","triangle"],handler:aae},{semanticName:"Internal Storage",name:"Window Pane",shortName:"win-pane",description:"Internal storage",aliases:["internal-storage","window-pane"],handler:hae},{semanticName:"Junction",name:"Filled Circle",shortName:"f-circ",description:"Junction point",aliases:["junction","filled-circle"],handler:Aie},{semanticName:"Loop Limit",name:"Trapezoidal Pentagon",shortName:"notch-pent",description:"Loop limit step",aliases:["loop-limit","notched-pentagon"],handler:tae},{semanticName:"Manual File",name:"Flipped Triangle",shortName:"flip-tri",description:"Manual file operation",aliases:["manual-file","flipped-triangle"],handler:Lie},{semanticName:"Manual Input",name:"Sloped Rectangle",shortName:"sl-rect",description:"Manual input step",aliases:["manual-input","sloped-rectangle"],handler:Dne},{semanticName:"Multi-Document",name:"Stacked Document",shortName:"docs",description:"Multiple documents",aliases:["documents","st-doc","stacked-document"],handler:mne},{semanticName:"Multi-Process",name:"Stacked Rectangle",shortName:"st-rect",description:"Multiple processes",aliases:["procs","processes","stacked-rectangle"],handler:fne},{semanticName:"Stored Data",name:"Bow Tie Rectangle",shortName:"bow-rect",description:"Stored data",aliases:["stored-data","bow-tie-rectangle"],handler:tie},{semanticName:"Summary",name:"Crossed Circle",shortName:"cross-circ",description:"Summary",aliases:["summary","crossed-circle"],handler:oie},{semanticName:"Tagged Document",name:"Tagged Document",shortName:"tag-doc",description:"Tagged document",aliases:["tag-doc","tagged-document"],handler:Une},{semanticName:"Tagged Process",name:"Tagged Rectangle",shortName:"tag-rect",description:"Tagged process",aliases:["tagged-rectangle","tag-proc","tagged-process"],handler:Wne},{semanticName:"Paper Tape",name:"Flag",shortName:"flag",description:"Paper tape",aliases:["paper-tape"],handler:cae},{semanticName:"Odd",name:"Odd",shortName:"odd",description:"Odd shape",internalAliases:["rect_left_inv_arrow"],handler:Tne},{semanticName:"Lined Document",name:"Lined Document",shortName:"lin-doc",description:"Lined document",aliases:["lined-document"],handler:hne}],$qe=o(()=>{let t=[...Object.entries({state:One,choice:aie,note:yne,rectWithTitle:kne,labelRect:Jie,iconSquare:Yie,iconCircle:Wie,icon:Gie,iconRounded:Uie,imageSquare:Xie,anchor:Qre,kanbanItem:Tae,mindmapCircle:Dae,defaultMindmapNode:Aae,classBox:yae,erBox:MN,requirementBox:xae}),...Fqe.flatMap(r=>[r.shortName,..."aliases"in r?r.aliases:[],..."internalAliases"in r?r.internalAliases:[]].map(n=>[n,r.handler]))];return Object.fromEntries(t)},"generateShapeMap"),NN=$qe();o(Lae,"isValidShape")});var zqe,V4,Mae=z(()=>{"use strict";Rr();Wx();Ut();St();IN();Xt();Ir();Ci();gp();uv();zqe="flowchart-",V4=class{constructor(){this.vertexCounter=0;this.config=ge();this.diagramId="";this.vertices=new Map;this.edges=[];this.classes=new Map;this.subGraphs=[];this.subGraphLookup=new Map;this.tooltips=new Map;this.subCount=0;this.firstGraphFlag=!0;this.secCount=-1;this.posCrossRef=[];this.funs=[];this.setAccTitle=Cr;this.setAccDescription=wr;this.setDiagramTitle=Ar;this.getAccTitle=kr;this.getAccDescription=Sr;this.getDiagramTitle=Er;this.funs.push(this.setupToolTips.bind(this)),this.addVertex=this.addVertex.bind(this),this.firstGraph=this.firstGraph.bind(this),this.setDirection=this.setDirection.bind(this),this.addSubGraph=this.addSubGraph.bind(this),this.addLink=this.addLink.bind(this),this.setLink=this.setLink.bind(this),this.updateLink=this.updateLink.bind(this),this.addClass=this.addClass.bind(this),this.setClass=this.setClass.bind(this),this.destructLink=this.destructLink.bind(this),this.setClickEvent=this.setClickEvent.bind(this),this.setTooltip=this.setTooltip.bind(this),this.updateLinkInterpolate=this.updateLinkInterpolate.bind(this),this.setClickFun=this.setClickFun.bind(this),this.bindFunctions=this.bindFunctions.bind(this),this.lex={firstGraph:this.firstGraph.bind(this)},this.clear(),this.setGen("gen-2")}static{o(this,"FlowDB")}sanitizeText(t){return vt.sanitizeText(t,this.config)}sanitizeNodeLabelType(t){switch(t){case"markdown":case"string":case"text":return t;default:return"markdown"}}setDiagramId(t){this.diagramId=t}lookUpDomId(t){for(let r of this.vertices.values())if(r.id===t)return this.diagramId?`${this.diagramId}-${r.domId}`:r.domId;return this.diagramId?`${this.diagramId}-${t}`:t}addVertex(t,r,i,n,a,s,l={},u){if(!t||t.trim().length===0)return;let h;if(u!==void 0){let m;u.includes(`
`)?m=u+`
`:m=`{
`+u+`
}`,h=ld(m,{schema:od})}let d=this.edges.find(m=>m.id===t);if(d){let m=h;m?.animate!==void 0&&(d.animate=m.animate),m?.animation!==void 0&&(d.animation=m.animation),m?.curve!==void 0&&(d.interpolate=m.curve);return}let f,p=this.vertices.get(t);if(p===void 0&&(r===void 0&&i===void 0&&n!==void 0&&n!==null&&Z.warn(`Style applied to unknown node "${t}". This may indicate a typo. The node will be created automatically.`),p={id:t,labelType:"text",domId:zqe+t+"-"+this.vertexCounter,styles:[],classes:[]},this.vertices.set(t,p)),this.vertexCounter++,r!==void 0?(this.config=ge(),f=this.sanitizeText(r.text.trim()),p.labelType=r.type,f.startsWith('"')&&f.endsWith('"')&&(f=f.substring(1,f.length-1)),p.text=f):p.text===void 0&&(p.text=t),i!==void 0&&(p.type=i),n?.forEach(m=>{p.styles.push(m)}),a?.forEach(m=>{p.classes.push(m)}),s!==void 0&&(p.dir=s),p.props===void 0?p.props=l:l!==void 0&&Object.assign(p.props,l),h!==void 0){if(h.shape){if(h.shape!==h.shape.toLowerCase()||h.shape.includes("_"))throw new Error(`No such shape: ${h.shape}. Shape names should be lowercase.`);if(!Lae(h.shape))throw new Error(`No such shape: ${h.shape}.`);p.type=h?.shape}h?.label&&(p.text=h?.label,p.labelType=this.sanitizeNodeLabelType(h?.labelType)),h?.icon&&(p.icon=h?.icon,!h.label?.trim()&&p.text===t&&(p.text="")),h?.form&&(p.form=h?.form),h?.pos&&(p.pos=h?.pos),h?.img&&(p.img=h?.img,!h.label?.trim()&&p.text===t&&(p.text="")),h?.constraint&&(p.constraint=h.constraint),h.w&&(p.assetWidth=Number(h.w)),h.h&&(p.assetHeight=Number(h.h))}}addSingleLink(t,r,i,n){let l={start:t,end:r,type:void 0,text:"",labelType:"text",classes:[],isUserDefinedId:!1,interpolate:this.edges.defaultInterpolate};Z.info("abc78 Got edge...",l);let u=i.text;if(u!==void 0&&(l.text=this.sanitizeText(u.text.trim()),l.text.startsWith('"')&&l.text.endsWith('"')&&(l.text=l.text.substring(1,l.text.length-1)),l.labelType=this.sanitizeNodeLabelType(u.type)),i!==void 0&&(l.type=i.type,l.stroke=i.stroke,l.length=i.length>10?10:i.length),n&&!this.edges.some(h=>h.id===n))l.id=n,l.isUserDefinedId=!0;else{let h=this.edges.filter(d=>d.start===l.start&&d.end===l.end);h.length===0?l.id=bc(l.start,l.end,{counter:0,prefix:"L"}):l.id=bc(l.start,l.end,{counter:h.length+1,prefix:"L"})}if(this.edges.length<(this.config.maxEdges??500))Z.info("Pushing edge..."),this.edges.push(l);else throw new Error(`Edge limit exceeded. ${this.edges.length} edges found, but the limit is ${this.config.maxEdges}.
Initialize mermaid with maxEdges set to a higher number to allow more edges.
You cannot set this config via configuration inside the diagram as it is a secure config.
You have to call mermaid.initialize.`)}isLinkData(t){return t!==null&&typeof t=="object"&&"id"in t&&typeof t.id=="string"}addLink(t,r,i){let n=this.isLinkData(i)?i.id.replace("@",""):void 0;Z.info("addLink",t,r,n);for(let a of t)for(let s of r){let l=a===t[t.length-1],u=s===r[0];l&&u?this.addSingleLink(a,s,i,n):this.addSingleLink(a,s,i,void 0)}}updateLinkInterpolate(t,r){t.forEach(i=>{i==="default"?this.edges.defaultInterpolate=r:this.edges[i].interpolate=r})}updateLink(t,r){t.forEach(i=>{if(typeof i=="number"&&i>=this.edges.length)throw new Error(`The index ${i} for linkStyle is out of bounds. Valid indices for linkStyle are between 0 and ${this.edges.length-1}. (Help: Ensure that the index is within the range of existing edges.)`);i==="default"?this.edges.defaultStyle=r:(this.edges[i].style=r,(this.edges[i]?.style?.length??0)>0&&!this.edges[i]?.style?.some(n=>n?.startsWith("fill"))&&this.edges[i]?.style?.push("fill:none"))})}addClass(t,r){let i=r.join().replace(/\\,/g,"\xA7\xA7\xA7").replace(/,/g,";").replace(/ยงยงยง/g,",").split(";");t.split(",").forEach(n=>{let a=this.classes.get(n);a===void 0&&(a={id:n,styles:[],textStyles:[]},this.classes.set(n,a)),i?.forEach(s=>{if(/color/.exec(s)){let l=s.replace("fill","bgFill");a.textStyles.push(l)}a.styles.push(s)})})}setDirection(t){this.direction=t.trim(),/.*/.exec(this.direction)&&(this.direction="LR"),/.*v/.exec(this.direction)&&(this.direction="TB"),this.direction==="TD"&&(this.direction="TB")}setClass(t,r){for(let i of t.split(",")){let n=this.vertices.get(i);n&&n.classes.push(r);let a=this.edges.find(l=>l.id===i);a&&a.classes.push(r);let s=this.subGraphLookup.get(i);s&&s.classes.push(r)}}setTooltip(t,r){if(r!==void 0){r=this.sanitizeText(r);for(let i of t.split(","))this.tooltips.set(this.version==="gen-1"?this.lookUpDomId(i):i,r)}}setClickFun(t,r,i){if(ge().securityLevel!=="loose"||r===void 0)return;let n=[];if(typeof i=="string"){n=i.split(/,(?=(?:(?:[^"]*"){2})*[^"]*$)/);for(let s=0;s{let s=this.lookUpDomId(t),l=document.querySelector(`[id="${s}"]`);l!==null&&l.addEventListener("click",()=>{Zt.runFunc(r,...n)},!1)}))}setLink(t,r,i){t.split(",").forEach(n=>{let a=this.vertices.get(n);a!==void 0&&(a.link=Zt.formatUrl(r,this.config),a.linkTarget=i)}),this.setClass(t,"clickable")}getTooltip(t){return this.tooltips.get(t)}setClickEvent(t,r,i){t.split(",").forEach(n=>{this.setClickFun(n,r,i)}),this.setClass(t,"clickable")}bindFunctions(t){this.funs.forEach(r=>{r(t)})}getDirection(){return this.direction?.trim()}getVertices(){return this.vertices}getEdges(){return this.edges}getClasses(){return this.classes}setupToolTips(t){let r=zw();Je(t).select("svg").selectAll("g.node").on("mouseover",a=>{let s=Je(a.currentTarget),l=s.attr("title");if(l===null)return;let u=a.currentTarget?.getBoundingClientRect();r.transition().duration(200).style("opacity",".9"),r.text(s.attr("title")).style("left",window.scrollX+u.left+(u.right-u.left)/2+"px").style("top",window.scrollY+u.bottom+"px"),r.html(Ro.sanitize(l)),s.classed("hover",!0)}).on("mouseout",a=>{r.transition().duration(500).style("opacity",0),Je(a.currentTarget).classed("hover",!1)})}clear(t="gen-2"){this.vertices=new Map,this.classes=new Map,this.edges=[],this.funs=[this.setupToolTips.bind(this)],this.diagramId="",this.subGraphs=[],this.subGraphLookup=new Map,this.subCount=0,this.tooltips=new Map,this.firstGraphFlag=!0,this.version=t,this.config=ge(),gr()}setGen(t){this.version=t||"gen-2"}defaultStyle(){return"fill:#ffa;stroke: #f66; stroke-width: 3px; stroke-dasharray: 5, 5;fill:#ffa;stroke: #666;"}addSubGraph(t,r,i){let n=t.text.trim(),a=i.text;t===i&&/\s/.exec(i.text)&&(n=void 0);let l=o(p=>{let m={boolean:{},number:{},string:{}},g=[],y;return{nodeList:p.filter(function(x){let b=typeof x;return x.stmt&&x.stmt==="dir"?(y=x.value,!1):x.trim()===""?!1:b in m?m[b].hasOwnProperty(x)?!1:m[b][x]=!0:g.includes(x)?!1:g.push(x)}),dir:y}},"uniq")(r.flat()),u=l.nodeList,h=l.dir,d=ge().flowchart??{};if(h=h??(d.inheritDir?this.getDirection()??ge().direction??void 0:void 0),this.version==="gen-1")for(let p=0;p2e3)return{result:!1,count:0};if(this.posCrossRef[this.secCount]=r,this.subGraphs[r].id===t)return{result:!0,count:0};let n=0,a=1;for(;n=0){let l=this.indexNodes2(t,s);if(l.result)return{result:!0,count:a+l.count};a=a+l.count}n=n+1}return{result:!1,count:a}}getDepthFirstPos(t){return this.posCrossRef[t]}indexNodes(){this.secCount=-1,this.subGraphs.length>0&&this.indexNodes2("none",this.subGraphs.length-1)}getSubGraphs(){return this.subGraphs}firstGraph(){return this.firstGraphFlag?(this.firstGraphFlag=!1,!0):!1}destructStartLink(t){let r=t.trim(),i="arrow_open";switch(r[0]){case"<":i="arrow_point",r=r.slice(1);break;case"x":i="arrow_cross",r=r.slice(1);break;case"o":i="arrow_circle",r=r.slice(1);break}let n="normal";return r.includes("=")&&(n="thick"),r.includes(".")&&(n="dotted"),{type:i,stroke:n}}countChar(t,r){let i=r.length,n=0;for(let a=0;a":n="arrow_point",r.startsWith("<")&&(n="double_"+n,i=i.slice(1));break;case"o":n="arrow_circle",r.startsWith("o")&&(n="double_"+n,i=i.slice(1));break}let a="normal",s=i.length-1;i.startsWith("=")&&(a="thick"),i.startsWith("~")&&(a="invisible");let l=this.countChar(".",i);return l&&(a="dotted",s=l),{type:n,stroke:a,length:s}}destructLink(t,r){let i=this.destructEndLink(t),n;if(r){if(n=this.destructStartLink(r),n.stroke!==i.stroke)return{type:"INVALID",stroke:"INVALID"};if(n.type==="arrow_open")n.type=i.type;else{if(n.type!==i.type)return{type:"INVALID",stroke:"INVALID"};n.type="double_"+n.type}return n.type==="double_arrow"&&(n.type="double_arrow_point"),n.length=i.length,n}return i}exists(t,r){for(let i of t)if(i.nodes.includes(r))return!0;return!1}makeUniq(t,r){let i=[];return t.nodes.forEach((n,a)=>{this.exists(r,n)||i.push(t.nodes[a])}),{nodes:i}}getTypeFromVertex(t){if(t.img)return"imageSquare";if(t.icon)return t.form==="circle"?"iconCircle":t.form==="square"?"iconSquare":t.form==="rounded"?"iconRounded":"icon";switch(t.type){case"square":case void 0:return"squareRect";case"round":return"roundedRect";case"ellipse":return"ellipse";default:return t.type}}findNode(t,r){return t.find(i=>i.id===r)}destructEdgeType(t){let r="none",i="arrow_point";switch(t){case"arrow_point":case"arrow_circle":case"arrow_cross":i=t;break;case"double_arrow_point":case"double_arrow_circle":case"double_arrow_cross":r=t.replace("double_",""),i=r;break}return{arrowTypeStart:r,arrowTypeEnd:i}}addNodeFromVertex(t,r,i,n,a,s){let l=i.get(t.id),u=n.get(t.id)??!1,h=this.findNode(r,t.id);if(h)h.cssStyles=t.styles,h.cssCompiledStyles=this.getCompiledStyles(t.classes),h.cssClasses=t.classes.join(" ");else{let d={id:t.id,label:t.text,labelType:t.labelType,labelStyle:"",parentId:l,padding:a.flowchart?.padding||8,cssStyles:t.styles,cssCompiledStyles:this.getCompiledStyles(["default","node",...t.classes]),cssClasses:"default "+t.classes.join(" "),dir:t.dir,domId:t.domId,look:s,link:t.link,linkTarget:t.linkTarget,tooltip:this.getTooltip(t.id),icon:t.icon,pos:t.pos,img:t.img,assetWidth:t.assetWidth,assetHeight:t.assetHeight,constraint:t.constraint};u?r.push({...d,isGroup:!0,shape:"rect"}):r.push({...d,isGroup:!1,shape:this.getTypeFromVertex(t)})}}getCompiledStyles(t){let r=[];for(let i of t){let n=this.classes.get(i);n?.styles&&(r=[...r,...n.styles??[]].map(a=>a.trim())),n?.textStyles&&(r=[...r,...n.textStyles??[]].map(a=>a.trim()))}return r}getData(){let t=ge(),r=[],i=[],n=this.getSubGraphs(),a=new Map,s=new Map;for(let h=n.length-1;h>=0;h--){let d=n[h];d.nodes.length>0&&s.set(d.id,!0);for(let f of d.nodes)a.set(f,d.id)}for(let h=n.length-1;h>=0;h--){let d=n[h];r.push({id:d.id,label:d.title,labelStyle:"",labelType:d.labelType,parentId:a.get(d.id),padding:8,cssCompiledStyles:this.getCompiledStyles(d.classes),cssClasses:d.classes.join(" "),shape:"rect",dir:d.dir,isGroup:!0,look:t.look})}this.getVertices().forEach(h=>{this.addNodeFromVertex(h,r,a,s,t,t.look||"classic")});let u=this.getEdges();return u.forEach((h,d)=>{let{arrowTypeStart:f,arrowTypeEnd:p}=this.destructEdgeType(h.type),m=[...u.defaultStyle??[]];h.style&&m.push(...h.style);let g={id:bc(h.start,h.end,{counter:d,prefix:"L"},h.id),isUserDefinedId:h.isUserDefinedId,start:h.start,end:h.end,type:h.type??"normal",label:h.text,labelType:h.labelType,labelpos:"c",thickness:h.stroke,minlen:h.length,classes:h?.stroke==="invisible"?"":"edge-thickness-normal edge-pattern-solid flowchart-link",arrowTypeStart:h?.stroke==="invisible"||h?.type==="arrow_open"?"none":f,arrowTypeEnd:h?.stroke==="invisible"||h?.type==="arrow_open"?"none":p,arrowheadStyle:"fill: #333",cssCompiledStyles:this.getCompiledStyles(h.classes),labelStyle:m,style:m,pattern:h.stroke,look:t.look,animate:h.animate,animation:h.animation,curve:h.interpolate||this.edges.defaultInterpolate||t.flowchart?.curve};i.push(g)}),{nodes:r,edges:i,other:{},config:t}}defaultConfig(){return vk.flowchart}}});var Fo,Lp=z(()=>{"use strict";Rr();Fo=o((e,t)=>{let r;return t==="sandbox"&&(r=Je("#i"+e)),(t==="sandbox"?Je(r.nodes()[0].contentDocument.body):Je("body")).select(`[id="${e}"]`)},"getDiagramElement")});var zu,rb=z(()=>{"use strict";zu=o(({flowchart:e})=>{let t=e?.subGraphTitleMargin?.top??0,r=e?.subGraphTitleMargin?.bottom??0,i=t+r;return{subGraphTitleTopMargin:t,subGraphTitleBottomMargin:r,subGraphTitleTotalMargin:i}},"getSubGraphTitleMargins")});var Nae,Gqe,Vqe,Wqe,qqe,Uqe,Hqe,Iae,wg,Oae,W4=z(()=>{"use strict";Ut();br();St();rb();Rr();jt();_s();dN();z4();_p();Ht();Nae=o(async(e,t)=>{Z.info("Creating subgraph rect for ",t.id,t);let r=ge(),{themeVariables:i,handDrawnSeed:n}=r,{clusterBkg:a,clusterBorder:s}=i,{labelStyles:l,nodeStyles:u,borderStyles:h,backgroundStyles:d}=ct(t),f=e.insert("g").attr("class","cluster "+t.cssClasses).attr("id",t.domId).attr("data-look",t.look),p=Mr(r),m=f.insert("g").attr("class","cluster-label "),g;t.labelType==="markdown"?g=await wi(m,t.label,{style:t.labelStyle,useHtmlLabels:p,isNode:!0,width:t.width}):g=await Nl(m,t.label,t.labelStyle||"",!1,!0);let y=g.getBBox();if(Mr(r)){let E=g.children[0],A=Je(g);y=E.getBoundingClientRect(),A.attr("width",y.width),A.attr("height",y.height)}let v=t.width<=y.width+t.padding?y.width+t.padding:t.width;t.width<=y.width+t.padding?t.diff=(v-t.width)/2-t.padding:t.diff=-t.padding;let x=t.height,b=t.x-v/2,T=t.y-x/2;Z.trace("Data ",t,JSON.stringify(t));let w;if(t.look==="handDrawn"){let E=ut.svg(f),A=mt(t,{roughness:.7,fill:a,stroke:s,fillWeight:3,seed:n}),N=E.path(Rs(b,T,v,x,0),A);w=f.insert(()=>(Z.debug("Rough node insert CXC",N),N),":first-child"),w.select("path:nth-child(2)").attr("style",h.join(";")),w.select("path").attr("style",d.join(";").replace("fill","stroke"))}else w=f.insert("rect",":first-child"),w.attr("style",u).attr("rx",t.rx).attr("ry",t.ry).attr("x",b).attr("y",T).attr("width",v).attr("height",x);let{subGraphTitleTopMargin:C}=zu(r);if(m.attr("transform",`translate(${t.x-y.width/2}, ${t.y-t.height/2+C})`),l){let E=m.select("span");E&&E.attr("style",l)}let k=w.node().getBBox();return t.offsetX=0,t.width=k.width,t.height=k.height,t.offsetY=y.height-t.padding/2,t.intersect=function(E){return cd(t,E)},{cluster:f,labelBBox:y}},"rect"),Gqe=o((e,t)=>{let r=e.insert("g").attr("class","note-cluster").attr("id",t.domId),i=r.insert("rect",":first-child"),n=0*t.padding,a=n/2;i.attr("rx",t.rx).attr("ry",t.ry).attr("x",t.x-t.width/2-a).attr("y",t.y-t.height/2-a).attr("width",t.width+n).attr("height",t.height+n).attr("fill","none");let s=i.node().getBBox();return t.width=s.width,t.height=s.height,t.intersect=function(l){return cd(t,l)},{cluster:r,labelBBox:{width:0,height:0}}},"noteGroup"),Vqe=o(async(e,t)=>{let r=ge(),{themeVariables:i,handDrawnSeed:n}=r,{altBackground:a,compositeBackground:s,compositeTitleBackground:l,nodeBorder:u}=i,h=e.insert("g").attr("class",t.cssClasses).attr("id",t.domId).attr("data-id",t.id).attr("data-look",t.look),d=h.insert("g",":first-child"),f=h.insert("g").attr("class","cluster-label"),p=h.append("rect"),m=await Nl(f,t.label,t.labelStyle,void 0,!0),g=m.getBBox();if(Mr(r)){let N=m.children[0],P=Je(m);g=N.getBoundingClientRect(),P.attr("width",g.width),P.attr("height",g.height)}let y=0*t.padding,v=y/2,x=(t.width<=g.width+t.padding?g.width+t.padding:t.width)+y;t.width<=g.width+t.padding?t.diff=(x-t.width)/2-t.padding:t.diff=-t.padding;let b=t.height+y,T=t.height+y-g.height-6,w=t.x-x/2,C=t.y-b/2;t.width=x;let k=t.y-t.height/2-v+g.height+2,E;if(t.look==="handDrawn"){let N=t.cssClasses.includes("statediagram-cluster-alt"),P=ut.svg(h),I=t.rx||t.ry?P.path(Rs(w,C,x,b,10),{roughness:.7,fill:l,fillStyle:"solid",stroke:u,seed:n}):P.rectangle(w,C,x,b,{seed:n});E=h.insert(()=>I,":first-child");let D=P.rectangle(w,k,x,T,{fill:N?a:s,fillStyle:N?"hachure":"solid",stroke:u,seed:n});E=h.insert(()=>I,":first-child"),p=h.insert(()=>D)}else E=d.insert("rect",":first-child"),E.attr("class","outer").attr("x",w).attr("y",C).attr("width",x).attr("height",b).attr("data-look",t.look),p.attr("class","inner").attr("x",w).attr("y",k).attr("width",x).attr("height",T);f.attr("transform",`translate(${t.x-g.width/2}, ${C+1-(Mr(r)?0:3)})`);let A=E.node().getBBox();return t.height=A.height,t.offsetX=0,t.offsetY=g.height-t.padding/2,t.labelBBox=g,t.intersect=function(N){return cd(t,N)},{cluster:h,labelBBox:g}},"roundedWithTitle"),Wqe=o(async(e,t)=>{Z.info("Creating subgraph rect for ",t.id,t);let r=ge(),{themeVariables:i,handDrawnSeed:n}=r,{clusterBkg:a,clusterBorder:s}=i,{labelStyles:l,nodeStyles:u,borderStyles:h,backgroundStyles:d}=ct(t),f=e.insert("g").attr("class","cluster "+t.cssClasses).attr("id",t.domId).attr("data-look",t.look),p=Mr(r),m=f.insert("g").attr("class","cluster-label "),g=await wi(m,t.label,{style:t.labelStyle,useHtmlLabels:p,isNode:!0,width:t.width}),y=g.getBBox();if(Mr(r)){let E=g.children[0],A=Je(g);y=E.getBoundingClientRect(),A.attr("width",y.width),A.attr("height",y.height)}let v=t.width<=y.width+t.padding?y.width+t.padding:t.width;t.width<=y.width+t.padding?t.diff=(v-t.width)/2-t.padding:t.diff=-t.padding;let x=t.height,b=t.x-v/2,T=t.y-x/2;Z.trace("Data ",t,JSON.stringify(t));let w;if(t.look==="handDrawn"){let E=ut.svg(f),A=mt(t,{roughness:.7,fill:a,stroke:s,fillWeight:4,seed:n}),N=E.path(Rs(b,T,v,x,t.rx),A);w=f.insert(()=>(Z.debug("Rough node insert CXC",N),N),":first-child"),w.select("path:nth-child(2)").attr("style",h.join(";")),w.select("path").attr("style",d.join(";").replace("fill","stroke"))}else w=f.insert("rect",":first-child"),w.attr("style",u).attr("rx",t.rx).attr("ry",t.ry).attr("x",b).attr("y",T).attr("width",v).attr("height",x);let{subGraphTitleTopMargin:C}=zu(r);if(m.attr("transform",`translate(${t.x-y.width/2}, ${t.y-t.height/2+C})`),l){let E=m.select("span");E&&E.attr("style",l)}let k=w.node().getBBox();return t.offsetX=0,t.width=k.width,t.height=k.height,t.offsetY=y.height-t.padding/2,t.intersect=function(E){return cd(t,E)},{cluster:f,labelBBox:y}},"kanbanSection"),qqe=o((e,t)=>{let r=ge(),{themeVariables:i,handDrawnSeed:n}=r,{nodeBorder:a}=i,s=e.insert("g").attr("class",t.cssClasses).attr("id",t.domId).attr("data-look",t.look),l=s.insert("g",":first-child"),u=0*t.padding,h=t.width+u;t.diff=-t.padding;let d=t.height+u,f=t.x-h/2,p=t.y-d/2;t.width=h;let m;if(t.look==="handDrawn"){let v=ut.svg(s).rectangle(f,p,h,d,{fill:"lightgrey",roughness:.5,strokeLineDash:[5],stroke:a,seed:n});m=s.insert(()=>v,":first-child")}else{m=l.insert("rect",":first-child");let y="outer";t.look,y="divider",m.attr("class",y).attr("x",f).attr("y",p).attr("width",h).attr("height",d).attr("data-look",t.look)}let g=m.node().getBBox();return t.height=g.height,t.offsetX=0,t.offsetY=0,t.intersect=function(y){return cd(t,y)},{cluster:s,labelBBox:{}}},"divider"),Uqe=Nae,Hqe={rect:Nae,squareRect:Uqe,roundedWithTitle:Vqe,noteGroup:Gqe,divider:qqe,kanbanSection:Wqe},Iae=new Map,wg=o(async(e,t)=>{let r=t.shape||"rect",i=await Hqe[r](e,t);return Iae.set(t.id,i),i},"insertCluster"),Oae=o(()=>{Iae=new Map},"clear")});var $o,ON=z(()=>{"use strict";$o=o((e,t)=>{if(t)return"translate("+-e.width/2+", "+-e.height/2+")";let r=e.x??0,i=e.y??0;return"translate("+-(r+e.width/2)+", "+-(i+e.height/2)+")"},"computeLabelTransform")});function q4(e,t){if(e===void 0||t===void 0)return{angle:0,deltaX:0,deltaY:0};e=Ui(e),t=Ui(t);let[r,i]=[e.x,e.y],[n,a]=[t.x,t.y],s=n-r,l=a-i;return{angle:Math.atan(l/s),deltaX:s,deltaY:l}}var pa,PN,Ui,U4,BN=z(()=>{"use strict";pa={aggregation:17.25,extension:17.25,composition:17.25,dependency:6,lollipop:13.5,arrow_point:4,arrow_barb:0,arrow_barb_neo:5.5},PN={arrow_point:4,arrow_cross:12.5,arrow_circle:12.5};o(q4,"calculateDeltaAndAngle");Ui=o(e=>Array.isArray(e)?{x:e[0],y:e[1]}:e,"pointTransformer"),U4=o(e=>({x:o(function(t,r,i){let n=0,a=Ui(i[0]).x=0?1:-1)}else if(r===i.length-1&&Object.hasOwn(pa,e.arrowTypeEnd)){let{angle:m,deltaX:g}=q4(i[i.length-1],i[i.length-2]);n=pa[e.arrowTypeEnd]*Math.cos(m)*(g>=0?1:-1)}let s=Math.abs(Ui(t).x-Ui(i[i.length-1]).x),l=Math.abs(Ui(t).y-Ui(i[i.length-1]).y),u=Math.abs(Ui(t).x-Ui(i[0]).x),h=Math.abs(Ui(t).y-Ui(i[0]).y),d=pa[e.arrowTypeStart],f=pa[e.arrowTypeEnd],p=1;if(s0&&l0&&h=0?1:-1)}else if(r===i.length-1&&Object.hasOwn(pa,e.arrowTypeEnd)){let{angle:m,deltaY:g}=q4(i[i.length-1],i[i.length-2]);n=pa[e.arrowTypeEnd]*Math.abs(Math.sin(m))*(g>=0?1:-1)}let s=Math.abs(Ui(t).y-Ui(i[i.length-1]).y),l=Math.abs(Ui(t).x-Ui(i[i.length-1]).x),u=Math.abs(Ui(t).y-Ui(i[0]).y),h=Math.abs(Ui(t).x-Ui(i[0]).x),d=pa[e.arrowTypeStart],f=pa[e.arrowTypeEnd],p=1;if(s0&&l0&&h{"use strict";St();Bae=o((e,t,r,i,n,a=!1,s)=>{t.arrowTypeStart&&Pae(e,"start",t.arrowTypeStart,r,i,n,a,s),t.arrowTypeEnd&&Pae(e,"end",t.arrowTypeEnd,r,i,n,a,s)},"addEdgeMarkers"),Yqe={arrow_cross:{type:"cross",fill:!1},arrow_point:{type:"point",fill:!0},arrow_barb:{type:"barb",fill:!0},arrow_barb_neo:{type:"barb",fill:!0},arrow_circle:{type:"circle",fill:!1},aggregation:{type:"aggregation",fill:!1},extension:{type:"extension",fill:!1},composition:{type:"composition",fill:!0},dependency:{type:"dependency",fill:!0},lollipop:{type:"lollipop",fill:!1},only_one:{type:"onlyOne",fill:!1},zero_or_one:{type:"zeroOrOne",fill:!1},one_or_more:{type:"oneOrMore",fill:!1},zero_or_more:{type:"zeroOrMore",fill:!1},requirement_arrow:{type:"requirement_arrow",fill:!1},requirement_contains:{type:"requirement_contains",fill:!1}},jqe=["cross","point","circle","lollipop","aggregation","extension","composition","dependency","barb"],Pae=o((e,t,r,i,n,a,s=!1,l)=>{let u=Yqe[r],h=u&&jqe.includes(u.type);if(!u){Z.warn(`Unknown arrow type: ${r}`);return}let d=u.type,m=`${n}_${a}-${d}${t==="start"?"Start":"End"}${s&&h?"-margin":""}`;if(l&&l.trim()!==""){let g=l.replace(/[^\dA-Za-z]/g,"_"),y=`${m}_${g}`;if(!document.getElementById(y)){let v=document.getElementById(m);if(v){let x=v.cloneNode(!0);x.id=y,x.querySelectorAll("path, circle, line").forEach(T=>{T.setAttribute("stroke",l),u.fill&&T.setAttribute("fill",l)}),v.parentNode?.appendChild(x)}}e.attr(`marker-${t}`,`url(${i}#${y})`)}else e.attr(`marker-${t}`,`url(${i}#${m})`)},"addEdgeMarker")});function H4(e,t){Mr(ge())&&e&&(e.style.width=t.length*9+"px",e.style.height="12px")}function Qqe(e){let t=[],r=[];for(let i=1;i5&&Math.abs(a.y-n.y)>5||n.y===a.y&&a.x===s.x&&Math.abs(a.x-n.x)>5&&Math.abs(a.y-s.y)>5)&&(t.push(a),r.push(i))}return{cornerPoints:t,cornerPointPositions:r}}function tUe(e,t){if(e.length<2)return"";let r="",i=e.length,n=1e-5;for(let a=0;a({...n}));if(e.length>=2&&pa[t.arrowTypeStart]){let n=pa[t.arrowTypeStart],a=e[0],s=e[1],{angle:l}=Gae(a,s),u=n*Math.cos(l),h=n*Math.sin(l);r[0].x=a.x+u,r[0].y=a.y+h}let i=e.length;if(i>=2&&pa[t.arrowTypeEnd]){let n=pa[t.arrowTypeEnd],a=e[i-1],s=e[i-2],{angle:l}=Gae(s,a),u=n*Math.cos(l),h=n*Math.sin(l);r[i-1].x=a.x-u,r[i-1].y=a.y-h}return r}var Xqe,Y4,ma,Vae,ib,j4,X4,Kqe,Zqe,$ae,zae,Jqe,eUe,K4,FN=z(()=>{"use strict";Ut();br();St();_s();ON();Xt();BN();rb();Rr();jt();z4();Fae();Ht();Xqe=o(e=>typeof e=="string"?e:ge()?.flowchart?.curve,"resolveEdgeCurveType"),Y4=new Map,ma=new Map,Vae=o(()=>{Y4.clear(),ma.clear()},"clear"),ib=o(e=>e?typeof e=="string"?e:e.reduce((t,r)=>t+";"+r,""):"","getLabelStyles"),j4=o(async(e,t)=>{let r=ge(),i=Mr(r),{labelStyles:n}=ct(t);t.labelStyle=n;let a=e.insert("g").attr("class","edgeLabel"),s=a.insert("g").attr("class","label").attr("data-id",t.id),l=t.labelType==="markdown",h=await wi(e,t.label,{style:ib(t.labelStyle),useHtmlLabels:i,addSvgBackground:!0,isNode:!1,markdown:l,width:l?void 0:void 0},r);s.node().appendChild(h),Z.info("abc82",t,t.labelType);let d=h.getBBox(),f=d;if(i){let m=h.children[0],g=Je(h);d=m.getBoundingClientRect(),f=d,g.attr("width",d.width),g.attr("height",d.height)}else{let m=Je(h).select("text").node();m&&typeof m.getBBox=="function"&&(f=m.getBBox())}s.attr("transform",$o(f,i)),Y4.set(t.id,a),t.width=d.width,t.height=d.height;let p;if(t.startLabelLeft){let m=e.insert("g").attr("class","edgeTerminals"),g=m.insert("g").attr("class","inner"),y=await Nl(g,t.startLabelLeft,ib(t.labelStyle)||"",!1,!1);p=y;let v=y.getBBox();if(i){let x=y.children[0],b=Je(y);v=x.getBoundingClientRect(),b.attr("width",v.width),b.attr("height",v.height)}g.attr("transform",$o(v,i)),ma.get(t.id)||ma.set(t.id,{}),ma.get(t.id).startLeft=m,H4(p,t.startLabelLeft)}if(t.startLabelRight){let m=e.insert("g").attr("class","edgeTerminals"),g=m.insert("g").attr("class","inner"),y=await Nl(g,t.startLabelRight,ib(t.labelStyle)||"",!1,!1);p=y;let v=y.getBBox();if(i){let x=y.children[0],b=Je(y);v=x.getBoundingClientRect(),b.attr("width",v.width),b.attr("height",v.height)}g.attr("transform",$o(v,i)),ma.get(t.id)||ma.set(t.id,{}),ma.get(t.id).startRight=m,H4(p,t.startLabelRight)}if(t.endLabelLeft){let m=e.insert("g").attr("class","edgeTerminals"),g=m.insert("g").attr("class","inner"),y=await Nl(m,t.endLabelLeft,ib(t.labelStyle)||"",!1,!1);p=y;let v=y.getBBox();if(i){let x=y.children[0],b=Je(y);v=x.getBoundingClientRect(),b.attr("width",v.width),b.attr("height",v.height)}g.attr("transform",$o(v,i)),ma.get(t.id)||ma.set(t.id,{}),ma.get(t.id).endLeft=m,H4(p,t.endLabelLeft)}if(t.endLabelRight){let m=e.insert("g").attr("class","edgeTerminals"),g=m.insert("g").attr("class","inner"),y=await Nl(m,t.endLabelRight,ib(t.labelStyle)||"",!1,!1);p=y;let v=y.getBBox();if(i){let x=y.children[0],b=Je(y);v=x.getBoundingClientRect(),b.attr("width",v.width),b.attr("height",v.height)}g.attr("transform",$o(v,i)),ma.get(t.id)||ma.set(t.id,{}),ma.get(t.id).endRight=m,H4(p,t.endLabelRight)}return h},"insertEdgeLabel");o(H4,"setTerminalWidth");X4=o((e,t)=>{Z.debug("Moving label abc88 ",e.id,e.label,Y4.get(e.id),t);let r=t.updatedPath?t.updatedPath:t.originalPath,i=ge(),{subGraphTitleTotalMargin:n}=zu(i);if(e.label){let a=Y4.get(e.id),s=e.x,l=e.y;if(r){let u=Zt.calcLabelPosition(r);Z.debug("Moving label "+e.label+" from (",s,",",l,") to (",u.x,",",u.y,") abc88"),t.updatedPath&&(s=u.x,l=u.y)}a.attr("transform",`translate(${s}, ${l+n/2})`)}if(e.startLabelLeft){let a=ma.get(e.id).startLeft,s=e.x,l=e.y;if(r){let u=Zt.calcTerminalLabelPosition(e.arrowTypeStart?10:0,"start_left",r);s=u.x,l=u.y}a.attr("transform",`translate(${s}, ${l})`)}if(e.startLabelRight){let a=ma.get(e.id).startRight,s=e.x,l=e.y;if(r){let u=Zt.calcTerminalLabelPosition(e.arrowTypeStart?10:0,"start_right",r);s=u.x,l=u.y}a.attr("transform",`translate(${s}, ${l})`)}if(e.endLabelLeft){let a=ma.get(e.id).endLeft,s=e.x,l=e.y;if(r){let u=Zt.calcTerminalLabelPosition(e.arrowTypeEnd?10:0,"end_left",r);s=u.x,l=u.y}a.attr("transform",`translate(${s}, ${l})`)}if(e.endLabelRight){let a=ma.get(e.id).endRight,s=e.x,l=e.y;if(r){let u=Zt.calcTerminalLabelPosition(e.arrowTypeEnd?10:0,"end_right",r);s=u.x,l=u.y}a.attr("transform",`translate(${s}, ${l})`)}},"positionEdgeLabel"),Kqe=o((e,t)=>{let r=e.x,i=e.y,n=Math.abs(t.x-r),a=Math.abs(t.y-i),s=e.width/2,l=e.height/2;return n>=s||a>=l},"outsideNode"),Zqe=o((e,t,r)=>{Z.debug(`intersection calc abc89:
outsidePoint: ${JSON.stringify(t)}
insidePoint : ${JSON.stringify(r)}
node : x:${e.x} y:${e.y} w:${e.width} h:${e.height}`);let i=e.x,n=e.y,a=Math.abs(i-r.x),s=e.width/2,l=r.xMath.abs(i-t.x)*u){let f=r.y{Z.warn("abc88 cutPathAtIntersect",e,t);let r=[],i=e[0],n=!1;return e.forEach(a=>{if(Z.info("abc88 checking point",a,t),!Kqe(t,a)&&!n){let s=Zqe(t,i,a);Z.debug("abc88 inside",a,i,s),Z.debug("abc88 intersection",s,t);let l=!1;r.forEach(u=>{l=l||u.x===s.x&&u.y===s.y}),r.some(u=>u.x===s.x&&u.y===s.y)?Z.warn("abc88 no intersect",s,r):r.push(s),n=!0}else Z.warn("abc88 outside",a,i),i=a,n||r.push(a)}),Z.debug("returning points",r),r},"cutPathAtIntersect");o(Qqe,"extractCornerPoints");zae=o(function(e,t,r){let i=t.x-e.x,n=t.y-e.y,a=Math.sqrt(i*i+n*n),s=r/a;return{x:t.x-s*i,y:t.y-s*n}},"findAdjacentPoint"),Jqe=o(function(e){let{cornerPointPositions:t}=Qqe(e),r=[];for(let i=0;i10&&Math.abs(a.y-n.y)>=10){Z.debug("Corner point fixing",Math.abs(a.x-n.x),Math.abs(a.y-n.y));let m=5;s.x===l.x?p={x:h<0?l.x-m+f:l.x+m-f,y:d<0?l.y-f:l.y+f}:p={x:h<0?l.x-f:l.x+f,y:d<0?l.y-m+f:l.y+m-f}}else Z.debug("Corner point skipping fixing",Math.abs(a.x-n.x),Math.abs(a.y-n.y));r.push(p,u)}else r.push(e[i]);return r},"fixCorners"),eUe=o((e,t,r)=>{let i=e-t-r,n=2,a=2,s=n+a,l=Math.floor(i/s),u=Array(l).fill(`${n} ${a}`).join(" ");return`0 ${t} ${u} ${r}`},"generateDashArray"),K4=o(function(e,t,r,i,n,a,s,l=!1){if(!s)throw new Error(`insertEdge: missing diagramId for edge "${t.id}" \u2014 edge IDs require a diagram prefix for uniqueness`);let{handDrawnSeed:u}=ge(),h=t.points,d=!1,f=n;var p=a;let m=[];for(let B in t.cssCompiledStyles)Xx(B)||m.push(t.cssCompiledStyles[B]);Z.debug("UIO intersect check",t.points,p.x,f.x),p.intersect&&f.intersect&&!l&&(h=h.slice(1,t.points.length-1),h.unshift(f.intersect(h[0])),Z.debug("Last point UIO",t.start,"-->",t.end,h[h.length-1],p,p.intersect(h[h.length-1])),h.push(p.intersect(h[h.length-1])));let g=btoa(JSON.stringify(h));t.toCluster&&(Z.info("to cluster abc88",r.get(t.toCluster)),h=$ae(t.points,r.get(t.toCluster).node),d=!0),t.fromCluster&&(Z.debug("from cluster abc88",r.get(t.fromCluster),JSON.stringify(h,null,2)),h=$ae(h.reverse(),r.get(t.fromCluster).node).reverse(),d=!0);let y=h.filter(B=>!Number.isNaN(B.y)),v=Xqe(t.curve);v!=="rounded"&&(y=Jqe(y));let x=xc;switch(v){case"linear":x=xc;break;case"basis":x=Dl;break;case"cardinal":x=gx;break;case"bumpX":x=hx;break;case"bumpY":x=dx;break;case"catmullRom":x=xx;break;case"monotoneX":x=bx;break;case"monotoneY":x=Tx;break;case"natural":x=hg;break;case"step":x=dg;break;case"stepAfter":x=kx;break;case"stepBefore":x=Cx;break;case"rounded":x=xc;break;default:x=Dl}let{x:b,y:T}=U4(t),w=_l().x(b).y(T).curve(x),C;switch(t.thickness){case"normal":C="edge-thickness-normal";break;case"thick":C="edge-thickness-thick";break;case"invisible":C="edge-thickness-invisible";break;default:C="edge-thickness-normal"}switch(t.pattern){case"solid":C+=" edge-pattern-solid";break;case"dotted":C+=" edge-pattern-dotted";break;case"dashed":C+=" edge-pattern-dashed";break;default:C+=" edge-pattern-solid"}let k,E=v==="rounded"?tUe(rUe(y,t),5):w(y),A=Array.isArray(t.style)?t.style:[t.style],N=A.find(B=>B?.startsWith("stroke:")),P="";t.animate&&(P="edge-animation-fast"),t.animation&&(P="edge-animation-"+t.animation);let I=!1;if(t.look==="handDrawn"){let B=ut.svg(e);Object.assign([],y);let O=B.path(E,{roughness:.3,seed:u});C+=" transition",k=Je(O).select("path").attr("id",`${s}-${t.id}`).attr("class"," "+C+(t.classes?" "+t.classes:"")+(P?" "+P:"")).attr("style",A?A.reduce((G,F)=>G+";"+F,""):"");let $=k.attr("d");k.attr("d",$),e.node().appendChild(k.node())}else{let B=m.join(";"),O=A?A.reduce((j,U)=>j+U+";",""):"",$=(B?B+";"+O+";":O)+";"+(A?A.reduce((j,U)=>j+";"+U,""):"");k=e.append("path").attr("d",E).attr("id",`${s}-${t.id}`).attr("class"," "+C+(t.classes?" "+t.classes:"")+(P?" "+P:"")).attr("style",$),N=$.match(/stroke:([^;]+)/)?.[1],I=t.animate===!0||!!t.animation||B.includes("animation");let G=k.node(),F=typeof G.getTotalLength=="function"?G.getTotalLength():0,V=PN[t.arrowTypeStart]||0,H=PN[t.arrowTypeEnd]||0;if(t.look==="neo"&&!I){let U=`stroke-dasharray: ${t.pattern==="dotted"||t.pattern==="dashed"?eUe(F,V,H):`0 ${V} ${F-V-H} ${H}`}; stroke-dashoffset: 0;`;k.attr("style",U+k.attr("style"))}}k.attr("data-edge",!0),k.attr("data-et","edge"),k.attr("data-id",t.id),k.attr("data-points",g),k.attr("data-look",ii(t.look)),t.showPoints&&y.forEach(B=>{e.append("circle").style("stroke","red").style("fill","red").attr("r",1).attr("cx",B.x).attr("cy",B.y)});let D="";(ge().flowchart.arrowMarkerAbsolute||ge().state.arrowMarkerAbsolute)&&(D=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,D=D.replace(/\(/g,"\\(").replace(/\)/g,"\\)")),Z.info("arrowTypeStart",t.arrowTypeStart),Z.info("arrowTypeEnd",t.arrowTypeEnd);let _=!I&&t?.look==="neo";Bae(k,t,D,s,i,_,N);let R=Math.floor(h.length/2),M=h[R];Zt.isLabelCoordinateInPath(M,k.attr("d"))||(d=!0);let L={};return d&&(L.updatedPath=h),L.originalPath=t.points,L},"insertEdge");o(tUe,"generateRoundedPath");o(Gae,"calculateDeltaAndAngle");o(rUe,"applyMarkerOffsetsToPoints")});var iUe,nUe,aUe,sUe,oUe,lUe,cUe,uUe,hUe,dUe,fUe,pUe,mUe,gUe,yUe,vUe,xUe,bUe,TUe,CUe,kUe,wUe,SUe,EUe,Z4,$N=z(()=>{"use strict";St();br();iUe=o((e,t,r,i)=>{t.forEach(n=>{EUe[n](e,r,i)})},"insertMarkers"),nUe=o((e,t,r)=>{Z.trace("Making markers for ",r),e.append("defs").append("marker").attr("id",r+"_"+t+"-extensionStart").attr("class","marker extension "+t).attr("refX",18).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").attr("d","M 1,7 L18,13 V 1 Z"),e.append("defs").append("marker").attr("id",r+"_"+t+"-extensionEnd").attr("class","marker extension "+t).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 1,1 V 13 L18,7 Z"),e.append("marker").attr("id",r+"_"+t+"-extensionStart-margin").attr("class","marker extension "+t).attr("refX",18).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").attr("viewBox","0 0 20 14").append("polygon").attr("points","10,7 18,13 18,1").style("stroke-width",2).style("stroke-dasharray","0"),e.append("defs").append("marker").attr("id",r+"_"+t+"-extensionEnd-margin").attr("class","marker extension "+t).attr("refX",9).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").attr("viewBox","0 0 20 14").append("polygon").attr("points","10,1 10,13 18,7").style("stroke-width",2).style("stroke-dasharray","0")},"extension"),aUe=o((e,t,r)=>{e.append("defs").append("marker").attr("id",r+"_"+t+"-compositionStart").attr("class","marker composition "+t).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),e.append("defs").append("marker").attr("id",r+"_"+t+"-compositionEnd").attr("class","marker composition "+t).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),e.append("defs").append("marker").attr("id",r+"_"+t+"-compositionStart-margin").attr("class","marker composition "+t).attr("refX",15).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").style("stroke-width",0).attr("viewBox","0 0 15 15").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),e.append("defs").append("marker").attr("id",r+"_"+t+"-compositionEnd-margin").attr("class","marker composition "+t).attr("refX",3.5).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").style("stroke-width",0).attr("d","M 18,7 L9,13 L1,7 L9,1 Z")},"composition"),sUe=o((e,t,r)=>{e.append("defs").append("marker").attr("id",r+"_"+t+"-aggregationStart").attr("class","marker aggregation "+t).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),e.append("defs").append("marker").attr("id",r+"_"+t+"-aggregationEnd").attr("class","marker aggregation "+t).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),e.append("defs").append("marker").attr("id",r+"_"+t+"-aggregationStart-margin").attr("class","marker aggregation "+t).attr("refX",15).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").style("stroke-width",2).attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),e.append("defs").append("marker").attr("id",r+"_"+t+"-aggregationEnd-margin").attr("class","marker aggregation "+t).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").style("stroke-width",2).attr("d","M 18,7 L9,13 L1,7 L9,1 Z")},"aggregation"),oUe=o((e,t,r)=>{e.append("defs").append("marker").attr("id",r+"_"+t+"-dependencyStart").attr("class","marker dependency "+t).attr("refX",6).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 5,7 L9,13 L1,7 L9,1 Z"),e.append("defs").append("marker").attr("id",r+"_"+t+"-dependencyEnd").attr("class","marker dependency "+t).attr("refX",13).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L14,7 L9,1 Z"),e.append("defs").append("marker").attr("id",r+"_"+t+"-dependencyStart-margin").attr("class","marker dependency "+t).attr("refX",4).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").style("stroke-width",0).attr("d","M 5,7 L9,13 L1,7 L9,1 Z"),e.append("defs").append("marker").attr("id",r+"_"+t+"-dependencyEnd-margin").attr("class","marker dependency "+t).attr("refX",16).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").style("stroke-width",0).attr("d","M 18,7 L9,13 L14,7 L9,1 Z")},"dependency"),lUe=o((e,t,r)=>{e.append("defs").append("marker").attr("id",r+"_"+t+"-lollipopStart").attr("class","marker lollipop "+t).attr("refX",13).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("circle").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6),e.append("defs").append("marker").attr("id",r+"_"+t+"-lollipopEnd").attr("class","marker lollipop "+t).attr("refX",1).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("circle").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6),e.append("defs").append("marker").attr("id",r+"_"+t+"-lollipopStart-margin").attr("class","marker lollipop "+t).attr("refX",13).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("circle").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6).attr("stroke-width",2),e.append("defs").append("marker").attr("id",r+"_"+t+"-lollipopEnd-margin").attr("class","marker lollipop "+t).attr("refX",1).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("circle").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6).attr("stroke-width",2)},"lollipop"),cUe=o((e,t,r)=>{e.append("marker").attr("id",r+"_"+t+"-pointEnd").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refX",5).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",8).attr("markerHeight",8).attr("orient","auto").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),e.append("marker").attr("id",r+"_"+t+"-pointStart").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refX",4.5).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",8).attr("markerHeight",8).attr("orient","auto").append("path").attr("d","M 0 5 L 10 10 L 10 0 z").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),e.append("marker").attr("id",r+"_"+t+"-pointEnd-margin").attr("class","marker "+t).attr("viewBox","0 0 11.5 14").attr("refX",11.5).attr("refY",7).attr("markerUnits","userSpaceOnUse").attr("markerWidth",10.5).attr("markerHeight",14).attr("orient","auto").append("path").attr("d","M 0 0 L 11.5 7 L 0 14 z").attr("class","arrowMarkerPath").style("stroke-width",0).style("stroke-dasharray","1,0"),e.append("marker").attr("id",r+"_"+t+"-pointStart-margin").attr("class","marker "+t).attr("viewBox","0 0 11.5 14").attr("refX",1).attr("refY",7).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11.5).attr("markerHeight",14).attr("orient","auto").append("polygon").attr("points","0,7 11.5,14 11.5,0").attr("class","arrowMarkerPath").style("stroke-width",0).style("stroke-dasharray","1,0")},"point"),uUe=o((e,t,r)=>{e.append("marker").attr("id",r+"_"+t+"-circleEnd").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refX",11).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),e.append("marker").attr("id",r+"_"+t+"-circleStart").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refX",-1).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),e.append("marker").attr("id",r+"_"+t+"-circleEnd-margin").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refY",5).attr("refX",12.25).attr("markerUnits","userSpaceOnUse").attr("markerWidth",14).attr("markerHeight",14).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",0).style("stroke-dasharray","1,0"),e.append("marker").attr("id",r+"_"+t+"-circleStart-margin").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refX",-2).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",14).attr("markerHeight",14).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",0).style("stroke-dasharray","1,0")},"circle"),hUe=o((e,t,r)=>{e.append("marker").attr("id",r+"_"+t+"-crossEnd").attr("class","marker cross "+t).attr("viewBox","0 0 11 11").attr("refX",12).attr("refY",5.2).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("path").attr("d","M 1,1 l 9,9 M 10,1 l -9,9").attr("class","arrowMarkerPath").style("stroke-width",2).style("stroke-dasharray","1,0"),e.append("marker").attr("id",r+"_"+t+"-crossStart").attr("class","marker cross "+t).attr("viewBox","0 0 11 11").attr("refX",-1).attr("refY",5.2).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("path").attr("d","M 1,1 l 9,9 M 10,1 l -9,9").attr("class","arrowMarkerPath").style("stroke-width",2).style("stroke-dasharray","1,0"),e.append("marker").attr("id",r+"_"+t+"-crossEnd-margin").attr("class","marker cross "+t).attr("viewBox","0 0 15 15").attr("refX",17.7).attr("refY",7.5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto").append("path").attr("d","M 1,1 L 14,14 M 1,14 L 14,1").attr("class","arrowMarkerPath").style("stroke-width",2.5),e.append("marker").attr("id",r+"_"+t+"-crossStart-margin").attr("class","marker cross "+t).attr("viewBox","0 0 15 15").attr("refX",-3.5).attr("refY",7.5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto").append("path").attr("d","M 1,1 L 14,14 M 1,14 L 14,1").attr("class","arrowMarkerPath").style("stroke-width",2.5).style("stroke-dasharray","1,0")},"cross"),dUe=o((e,t,r)=>{e.append("defs").append("marker").attr("id",r+"_"+t+"-barbEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",14).attr("markerUnits","userSpaceOnUse").attr("orient","auto").append("path").attr("d","M 19,7 L9,13 L14,7 L9,1 Z")},"barb"),fUe=o((e,t,r)=>{let i=Nt(),{themeVariables:n}=i,{transitionColor:a}=n;e.append("defs").append("marker").attr("id",r+"_"+t+"-barbEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",14).attr("markerUnits","strokeWidth").attr("orient","auto").append("path").attr("d","M 19,7 L11,14 L13,7 L11,0 Z"),e.append("defs").append("marker").attr("id",r+"_"+t+"-barbEnd-margin").attr("refX",17).attr("refY",7).attr("markerWidth",20).attr("markerHeight",14).attr("markerUnits","userSpaceOnUse").attr("orient","auto").append("path").attr("d","M 19,7 L11,14 L13,7 L11,0 Z").attr("fill",`${a}`)},"barbNeo"),pUe=o((e,t,r)=>{e.append("defs").append("marker").attr("id",r+"_"+t+"-onlyOneStart").attr("class","marker onlyOne "+t).attr("refX",0).attr("refY",9).attr("markerWidth",18).attr("markerHeight",18).attr("orient","auto").append("path").attr("d","M9,0 L9,18 M15,0 L15,18"),e.append("defs").append("marker").attr("id",r+"_"+t+"-onlyOneEnd").attr("class","marker onlyOne "+t).attr("refX",18).attr("refY",9).attr("markerWidth",18).attr("markerHeight",18).attr("orient","auto").append("path").attr("d","M3,0 L3,18 M9,0 L9,18")},"only_one"),mUe=o((e,t,r)=>{let i=e.append("defs").append("marker").attr("id",r+"_"+t+"-zeroOrOneStart").attr("class","marker zeroOrOne "+t).attr("refX",0).attr("refY",9).attr("markerWidth",30).attr("markerHeight",18).attr("orient","auto");i.append("circle").attr("fill","white").attr("cx",21).attr("cy",9).attr("r",6),i.append("path").attr("d","M9,0 L9,18");let n=e.append("defs").append("marker").attr("id",r+"_"+t+"-zeroOrOneEnd").attr("class","marker zeroOrOne "+t).attr("refX",30).attr("refY",9).attr("markerWidth",30).attr("markerHeight",18).attr("orient","auto");n.append("circle").attr("fill","white").attr("cx",9).attr("cy",9).attr("r",6),n.append("path").attr("d","M21,0 L21,18")},"zero_or_one"),gUe=o((e,t,r)=>{e.append("defs").append("marker").attr("id",r+"_"+t+"-oneOrMoreStart").attr("class","marker oneOrMore "+t).attr("refX",18).attr("refY",18).attr("markerWidth",45).attr("markerHeight",36).attr("orient","auto").append("path").attr("d","M0,18 Q 18,0 36,18 Q 18,36 0,18 M42,9 L42,27"),e.append("defs").append("marker").attr("id",r+"_"+t+"-oneOrMoreEnd").attr("class","marker oneOrMore "+t).attr("refX",27).attr("refY",18).attr("markerWidth",45).attr("markerHeight",36).attr("orient","auto").append("path").attr("d","M3,9 L3,27 M9,18 Q27,0 45,18 Q27,36 9,18")},"one_or_more"),yUe=o((e,t,r)=>{let i=e.append("defs").append("marker").attr("id",r+"_"+t+"-zeroOrMoreStart").attr("class","marker zeroOrMore "+t).attr("refX",18).attr("refY",18).attr("markerWidth",57).attr("markerHeight",36).attr("orient","auto");i.append("circle").attr("fill","white").attr("cx",48).attr("cy",18).attr("r",6),i.append("path").attr("d","M0,18 Q18,0 36,18 Q18,36 0,18");let n=e.append("defs").append("marker").attr("id",r+"_"+t+"-zeroOrMoreEnd").attr("class","marker zeroOrMore "+t).attr("refX",39).attr("refY",18).attr("markerWidth",57).attr("markerHeight",36).attr("orient","auto");n.append("circle").attr("fill","white").attr("cx",9).attr("cy",18).attr("r",6),n.append("path").attr("d","M21,18 Q39,0 57,18 Q39,36 21,18")},"zero_or_more"),vUe=o((e,t,r)=>{let i=Nt(),{themeVariables:n}=i,{strokeWidth:a}=n;e.append("defs").append("marker").attr("id",r+"_"+t+"-onlyOneStart").attr("class","marker onlyOne "+t).attr("refX",0).attr("refY",9).attr("markerWidth",18).attr("markerHeight",18).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").attr("d","M9,0 L9,18 M15,0 L15,18").attr("stroke-width",`${a}`),e.append("defs").append("marker").attr("id",r+"_"+t+"-onlyOneEnd").attr("class","marker onlyOne "+t).attr("refX",18).attr("refY",9).attr("markerWidth",18).attr("markerHeight",18).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").attr("d","M3,0 L3,18 M9,0 L9,18").attr("stroke-width",`${a}`)},"only_one_neo"),xUe=o((e,t,r)=>{let i=Nt(),{themeVariables:n}=i,{strokeWidth:a,mainBkg:s}=n,l=e.append("defs").append("marker").attr("id",r+"_"+t+"-zeroOrOneStart").attr("class","marker zeroOrOne "+t).attr("refX",0).attr("refY",9).attr("markerWidth",30).attr("markerHeight",18).attr("orient","auto").attr("markerUnits","userSpaceOnUse");l.append("circle").attr("fill",s??"white").attr("cx",21).attr("cy",9).attr("stroke-width",`${a}`).attr("r",6),l.append("path").attr("d","M9,0 L9,18").attr("stroke-width",`${a}`);let u=e.append("defs").append("marker").attr("id",r+"_"+t+"-zeroOrOneEnd").attr("class","marker zeroOrOne "+t).attr("refX",30).attr("refY",9).attr("markerWidth",30).attr("markerHeight",18).attr("markerUnits","userSpaceOnUse").attr("orient","auto");u.append("circle").attr("fill",s??"white").attr("cx",9).attr("cy",9).attr("stroke-width",`${a}`).attr("r",6),u.append("path").attr("d","M21,0 L21,18").attr("stroke-width",`${a}`)},"zero_or_one_neo"),bUe=o((e,t,r)=>{let i=Nt(),{themeVariables:n}=i,{strokeWidth:a}=n;e.append("defs").append("marker").attr("id",r+"_"+t+"-oneOrMoreStart").attr("class","marker oneOrMore "+t).attr("refX",18).attr("refY",18).attr("markerWidth",45).attr("markerHeight",36).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").attr("d","M0,18 Q 18,0 36,18 Q 18,36 0,18 M42,9 L42,27").attr("stroke-width",`${a}`),e.append("defs").append("marker").attr("id",r+"_"+t+"-oneOrMoreEnd").attr("class","marker oneOrMore "+t).attr("refX",27).attr("refY",18).attr("markerWidth",45).attr("markerHeight",36).attr("markerUnits","userSpaceOnUse").attr("orient","auto").append("path").attr("d","M3,9 L3,27 M9,18 Q27,0 45,18 Q27,36 9,18").attr("stroke-width",`${a}`)},"one_or_more_neo"),TUe=o((e,t,r)=>{let i=Nt(),{themeVariables:n}=i,{strokeWidth:a,mainBkg:s}=n,l=e.append("defs").append("marker").attr("id",r+"_"+t+"-zeroOrMoreStart").attr("class","marker zeroOrMore "+t).attr("refX",18).attr("refY",18).attr("markerWidth",57).attr("markerHeight",36).attr("markerUnits","userSpaceOnUse").attr("orient","auto");l.append("circle").attr("fill",s??"white").attr("cx",45.5).attr("cy",18).attr("r",6).attr("stroke-width",`${a}`),l.append("path").attr("d","M0,18 Q18,0 36,18 Q18,36 0,18").attr("stroke-width",`${a}`);let u=e.append("defs").append("marker").attr("id",r+"_"+t+"-zeroOrMoreEnd").attr("class","marker zeroOrMore "+t).attr("refX",39).attr("refY",18).attr("markerWidth",57).attr("markerHeight",36).attr("orient","auto").attr("markerUnits","userSpaceOnUse");u.append("circle").attr("fill",s??"white").attr("cx",11).attr("cy",18).attr("r",6).attr("stroke-width",`${a}`),u.append("path").attr("d","M21,18 Q39,0 57,18 Q39,36 21,18").attr("stroke-width",`${a}`)},"zero_or_more_neo"),CUe=o((e,t,r)=>{e.append("defs").append("marker").attr("id",r+"_"+t+"-requirement_arrowEnd").attr("refX",20).attr("refY",10).attr("markerWidth",20).attr("markerHeight",20).attr("orient","auto").append("path").attr("d",`M0,0
L20,10
M20,10
L0,20`)},"requirement_arrow"),kUe=o((e,t,r)=>{let i=Nt(),{themeVariables:n}=i,{strokeWidth:a}=n;e.append("defs").append("marker").attr("id",r+"_"+t+"-requirement_arrowEnd").attr("refX",20).attr("refY",10).attr("markerWidth",20).attr("markerHeight",20).attr("orient","auto").attr("markerUnits","userSpaceOnUse").attr("stroke-width",`${a}`).attr("viewBox","0 0 25 20").append("path").attr("d",`M0,0
L20,10
M20,10
L0,20`).attr("stroke-linejoin","miter")},"requirement_arrow_neo"),wUe=o((e,t,r)=>{let i=e.append("defs").append("marker").attr("id",r+"_"+t+"-requirement_containsStart").attr("refX",0).attr("refY",10).attr("markerWidth",20).attr("markerHeight",20).attr("orient","auto").append("g");i.append("circle").attr("cx",10).attr("cy",10).attr("r",9).attr("fill","none"),i.append("line").attr("x1",1).attr("x2",19).attr("y1",10).attr("y2",10),i.append("line").attr("y1",1).attr("y2",19).attr("x1",10).attr("x2",10)},"requirement_contains"),SUe=o((e,t,r)=>{let i=Nt(),{themeVariables:n}=i,{strokeWidth:a}=n,s=e.append("defs").append("marker").attr("id",r+"_"+t+"-requirement_containsStart").attr("refX",0).attr("refY",10).attr("markerWidth",20).attr("markerHeight",20).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("g");s.append("circle").attr("cx",10).attr("cy",10).attr("r",9).attr("fill","none"),s.append("line").attr("x1",1).attr("x2",19).attr("y1",10).attr("y2",10),s.append("line").attr("y1",1).attr("y2",19).attr("x1",10).attr("x2",10),s.selectAll("*").attr("stroke-width",`${a}`)},"requirement_contains_neo"),EUe={extension:nUe,composition:aUe,aggregation:sUe,dependency:oUe,lollipop:lUe,point:cUe,circle:uUe,cross:hUe,barb:dUe,barbNeo:fUe,only_one:pUe,zero_or_one:mUe,one_or_more:gUe,zero_or_more:yUe,only_one_neo:vUe,zero_or_one_neo:xUe,one_or_more_neo:bUe,zero_or_more_neo:TUe,requirement_arrow:CUe,requirement_contains:wUe,requirement_arrow_neo:kUe,requirement_contains_neo:SUe},Z4=iUe});async function Sg(e,t,r){let i,n;t.shape==="rect"&&(t.rx&&t.ry?t.shape="roundedRect":t.shape="squareRect");let a=t.shape?NN[t.shape]:void 0;if(!a)throw new Error(`No such shape: ${t.shape}. Please check your syntax.`);if(t.link){let s;r.config.securityLevel==="sandbox"?s="_top":t.linkTarget&&(s=t.linkTarget||"_blank"),i=e.insert("svg:a").attr("xlink:href",t.link).attr("target",s??null),n=await a(i,t,r)}else n=await a(e,t,r),i=n;return i.attr("data-look",ii(t.look)),t.tooltip&&n.attr("title",t.tooltip),Q4.set(t.id,i),t.haveCallback&&i.attr("class",i.attr("class")+" clickable"),i}var Q4,Wae,qae,nb,J4=z(()=>{"use strict";St();IN();Xt();Q4=new Map;o(Sg,"insertNode");Wae=o((e,t)=>{Q4.set(t.id,e)},"setNodeElem"),qae=o(()=>{Q4.clear()},"clear"),nb=o(e=>{let t=Q4.get(e.id);Z.trace("Transforming node",e.diff,e,"translate("+(e.x-e.width/2-5)+", "+e.width/2+")");let r=8,i=e.diff||0;return e.clusterNode?t.attr("transform","translate("+(e.x+i-e.width/2)+", "+(e.y-e.height/2-r)+")"):t.attr("transform","translate("+e.x+", "+e.y+")"),i},"positionNode")});var Uae,Hae=z(()=>{"use strict";br();Ir();St();W4();FN();$N();J4();Wt();Xt();Uae={common:vt,getConfig:Nt,insertCluster:wg,insertEdge:K4,insertEdgeLabel:j4,insertMarkers:Z4,insertNode:Sg,interpolateToCurve:EM,labelHelper:At,log:Z,positionEdgeLabel:X4}});var AUe,eS,zN=z(()=>{"use strict";AUe=typeof global=="object"&&global&&global.Object===Object&&global,eS=AUe});var _Ue,DUe,ln,zo=z(()=>{"use strict";zN();_Ue=typeof self=="object"&&self&&self.Object===Object&&self,DUe=eS||_Ue||Function("return this")(),ln=DUe});var RUe,ra,Mp=z(()=>{"use strict";zo();RUe=ln.Symbol,ra=RUe});function NUe(e){var t=LUe.call(e,ab),r=e[ab];try{e[ab]=void 0;var i=!0}catch{}var n=MUe.call(e);return i&&(t?e[ab]=r:delete e[ab]),n}var Yae,LUe,MUe,ab,jae,Xae=z(()=>{"use strict";Mp();Yae=Object.prototype,LUe=Yae.hasOwnProperty,MUe=Yae.toString,ab=ra?ra.toStringTag:void 0;o(NUe,"getRawTag");jae=NUe});function PUe(e){return OUe.call(e)}var IUe,OUe,Kae,Zae=z(()=>{"use strict";IUe=Object.prototype,OUe=IUe.toString;o(PUe,"objectToString");Kae=PUe});function $Ue(e){return e==null?e===void 0?FUe:BUe:Qae&&Qae in Object(e)?jae(e):Kae(e)}var BUe,FUe,Qae,es,fd=z(()=>{"use strict";Mp();Xae();Zae();BUe="[object Null]",FUe="[object Undefined]",Qae=ra?ra.toStringTag:void 0;o($Ue,"baseGetTag");es=$Ue});function zUe(e){return e!=null&&typeof e=="object"}var yn,Il=z(()=>{"use strict";o(zUe,"isObjectLike");yn=zUe});function VUe(e){return typeof e=="symbol"||yn(e)&&es(e)==GUe}var GUe,oo,Np=z(()=>{"use strict";fd();Il();GUe="[object Symbol]";o(VUe,"isSymbol");oo=VUe});function WUe(e,t){for(var r=-1,i=e==null?0:e.length,n=Array(i);++r{"use strict";o(WUe,"arrayMap");wc=WUe});var qUe,Or,An=z(()=>{"use strict";qUe=Array.isArray,Or=qUe});function tse(e){if(typeof e=="string")return e;if(Or(e))return wc(e,tse)+"";if(oo(e))return ese?ese.call(e):"";var t=e+"";return t=="0"&&1/e==-UUe?"-0":t}var UUe,Jae,ese,rse,ise=z(()=>{"use strict";Mp();sb();An();Np();UUe=1/0,Jae=ra?ra.prototype:void 0,ese=Jae?Jae.toString:void 0;o(tse,"baseToString");rse=tse});function YUe(e){for(var t=e.length;t--&&HUe.test(e.charAt(t)););return t}var HUe,nse,ase=z(()=>{"use strict";HUe=/\s/;o(YUe,"trimmedEndIndex");nse=YUe});function XUe(e){return e&&e.slice(0,nse(e)+1).replace(jUe,"")}var jUe,sse,ose=z(()=>{"use strict";ase();jUe=/^\s+/;o(XUe,"baseTrim");sse=XUe});function KUe(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var Hi,Go=z(()=>{"use strict";o(KUe,"isObject");Hi=KUe});function tHe(e){if(typeof e=="number")return e;if(oo(e))return lse;if(Hi(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=Hi(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=sse(e);var r=QUe.test(e);return r||JUe.test(e)?eHe(e.slice(2),r?2:8):ZUe.test(e)?lse:+e}var lse,ZUe,QUe,JUe,eHe,cse,use=z(()=>{"use strict";ose();Go();Np();lse=NaN,ZUe=/^[-+]0x[0-9a-f]+$/i,QUe=/^0b[01]+$/i,JUe=/^0o[0-7]+$/i,eHe=parseInt;o(tHe,"toNumber");cse=tHe});function iHe(e){if(!e)return e===0?e:0;if(e=cse(e),e===hse||e===-hse){var t=e<0?-1:1;return t*rHe}return e===e?e:0}var hse,rHe,Eg,GN=z(()=>{"use strict";use();hse=1/0,rHe=17976931348623157e292;o(iHe,"toFinite");Eg=iHe});function nHe(e){var t=Eg(e),r=t%1;return t===t?r?t-r:t:0}var dse,fse=z(()=>{"use strict";GN();o(nHe,"toInteger");dse=nHe});function aHe(e){return e}var Ls,pd=z(()=>{"use strict";o(aHe,"identity");Ls=aHe});function uHe(e){if(!Hi(e))return!1;var t=es(e);return t==oHe||t==lHe||t==sHe||t==cHe}var sHe,oHe,lHe,cHe,Sc,ob=z(()=>{"use strict";fd();Go();sHe="[object AsyncFunction]",oHe="[object Function]",lHe="[object GeneratorFunction]",cHe="[object Proxy]";o(uHe,"isFunction");Sc=uHe});var hHe,tS,pse=z(()=>{"use strict";zo();hHe=ln["__core-js_shared__"],tS=hHe});function dHe(e){return!!mse&&mse in e}var mse,gse,yse=z(()=>{"use strict";pse();mse=(function(){var e=/[^.]+$/.exec(tS&&tS.keys&&tS.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""})();o(dHe,"isMasked");gse=dHe});function mHe(e){if(e!=null){try{return pHe.call(e)}catch{}try{return e+""}catch{}}return""}var fHe,pHe,Gu,VN=z(()=>{"use strict";fHe=Function.prototype,pHe=fHe.toString;o(mHe,"toSource");Gu=mHe});function kHe(e){if(!Hi(e)||gse(e))return!1;var t=Sc(e)?CHe:yHe;return t.test(Gu(e))}var gHe,yHe,vHe,xHe,bHe,THe,CHe,vse,xse=z(()=>{"use strict";ob();yse();Go();VN();gHe=/[\\^$.*+?()[\]{}|]/g,yHe=/^\[object .+?Constructor\]$/,vHe=Function.prototype,xHe=Object.prototype,bHe=vHe.toString,THe=xHe.hasOwnProperty,CHe=RegExp("^"+bHe.call(THe).replace(gHe,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");o(kHe,"baseIsNative");vse=kHe});function wHe(e,t){return e?.[t]}var bse,Tse=z(()=>{"use strict";o(wHe,"getValue");bse=wHe});function SHe(e,t){var r=bse(e,t);return vse(r)?r:void 0}var Ms,md=z(()=>{"use strict";xse();Tse();o(SHe,"getNative");Ms=SHe});var EHe,rS,Cse=z(()=>{"use strict";md();zo();EHe=Ms(ln,"WeakMap"),rS=EHe});var kse,AHe,wse,Sse=z(()=>{"use strict";Go();kse=Object.create,AHe=(function(){function e(){}return o(e,"object"),function(t){if(!Hi(t))return{};if(kse)return kse(t);e.prototype=t;var r=new e;return e.prototype=void 0,r}})(),wse=AHe});function _He(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}var Ese,Ase=z(()=>{"use strict";o(_He,"apply");Ese=_He});function DHe(){}var _se,Dse=z(()=>{"use strict";o(DHe,"noop");_se=DHe});function RHe(e,t){var r=-1,i=e.length;for(t||(t=Array(i));++r{"use strict";o(RHe,"copyArray");iS=RHe});function IHe(e){var t=0,r=0;return function(){var i=NHe(),n=MHe-(i-r);if(r=i,n>0){if(++t>=LHe)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}var LHe,MHe,NHe,Rse,Lse=z(()=>{"use strict";LHe=800,MHe=16,NHe=Date.now;o(IHe,"shortOut");Rse=IHe});function OHe(e){return function(){return e}}var Ns,qN=z(()=>{"use strict";o(OHe,"constant");Ns=OHe});var PHe,Ag,UN=z(()=>{"use strict";md();PHe=(function(){try{var e=Ms(Object,"defineProperty");return e({},"",{}),e}catch{}})(),Ag=PHe});var BHe,Mse,Nse=z(()=>{"use strict";qN();UN();pd();BHe=Ag?function(e,t){return Ag(e,"toString",{configurable:!0,enumerable:!1,value:Ns(t),writable:!0})}:Ls,Mse=BHe});var FHe,nS,HN=z(()=>{"use strict";Nse();Lse();FHe=Rse(Mse),nS=FHe});function $He(e,t){for(var r=-1,i=e==null?0:e.length;++r{"use strict";o($He,"arrayEach");aS=$He});function zHe(e,t,r,i){for(var n=e.length,a=r+(i?1:-1);i?a--:++a{"use strict";o(zHe,"baseFindIndex");sS=zHe});function GHe(e){return e!==e}var Ise,Ose=z(()=>{"use strict";o(GHe,"baseIsNaN");Ise=GHe});function VHe(e,t,r){for(var i=r-1,n=e.length;++i{"use strict";o(VHe,"strictIndexOf");Pse=VHe});function WHe(e,t,r){return t===t?Pse(e,t,r):sS(e,Ise,r)}var Fse,$se=z(()=>{"use strict";jN();Ose();Bse();o(WHe,"baseIndexOf");Fse=WHe});function qHe(e,t){var r=e==null?0:e.length;return!!r&&Fse(e,t,0)>-1}var zse,Gse=z(()=>{"use strict";$se();o(qHe,"arrayIncludes");zse=qHe});function YHe(e,t){var r=typeof e;return t=t??UHe,!!t&&(r=="number"||r!="symbol"&&HHe.test(e))&&e>-1&&e%1==0&&e{"use strict";UHe=9007199254740991,HHe=/^(?:0|[1-9]\d*)$/;o(YHe,"isIndex");gd=YHe});function jHe(e,t,r){t=="__proto__"&&Ag?Ag(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}var yd,cb=z(()=>{"use strict";UN();o(jHe,"baseAssignValue");yd=jHe});function XHe(e,t){return e===t||e!==e&&t!==t}var Vo,Ip=z(()=>{"use strict";o(XHe,"eq");Vo=XHe});function QHe(e,t,r){var i=e[t];(!(ZHe.call(e,t)&&Vo(i,r))||r===void 0&&!(t in e))&&yd(e,t,r)}var KHe,ZHe,vd,ub=z(()=>{"use strict";cb();Ip();KHe=Object.prototype,ZHe=KHe.hasOwnProperty;o(QHe,"assignValue");vd=QHe});function JHe(e,t,r,i){var n=!r;r||(r={});for(var a=-1,s=t.length;++a