(n=s.call({lexer:this},e,r))?(e=e.substring(n.raw.length),r.push(n),!0):!1))continue;if(n=this.tokenizer.space(e)){e=e.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(e)){e=e.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(e)){e=e.substring(n.raw.length),r.push(n);continue}if(n=this.tokenizer.heading(e)){e=e.substring(n.raw.length),r.push(n);continue}if(n=this.tokenizer.hr(e)){e=e.substring(n.raw.length),r.push(n);continue}if(n=this.tokenizer.blockquote(e)){e=e.substring(n.raw.length),r.push(n);continue}if(n=this.tokenizer.list(e)){e=e.substring(n.raw.length),r.push(n);continue}if(n=this.tokenizer.html(e)){e=e.substring(n.raw.length),r.push(n);continue}if(n=this.tokenizer.def(e)){e=e.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(e)){e=e.substring(n.raw.length),r.push(n);continue}if(n=this.tokenizer.lheading(e)){e=e.substring(n.raw.length),r.push(n);continue}let a=e;if(this.options.extensions?.startBlock){let s=1/0,l=e.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=e.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!==e.length,e=e.substring(n.raw.length);continue}if(n=this.tokenizer.text(e)){e=e.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(e){let s="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(s);break}else throw new Error(s)}}return this.state.top=!0,r}inline(e,r=[]){return this.inlineQueue.push({src:e,tokens:r}),r}inlineTokens(e,r=[]){let i=e,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(;e;){a||(s=""),a=!1;let l;if(this.options.extensions?.inline?.some(h=>(l=h.call({lexer:this},e,r))?(e=e.substring(l.raw.length),r.push(l),!0):!1))continue;if(l=this.tokenizer.escape(e)){e=e.substring(l.raw.length),r.push(l);continue}if(l=this.tokenizer.tag(e)){e=e.substring(l.raw.length),r.push(l);continue}if(l=this.tokenizer.link(e)){e=e.substring(l.raw.length),r.push(l);continue}if(l=this.tokenizer.reflink(e,this.tokens.links)){e=e.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(e,i,s)){e=e.substring(l.raw.length),r.push(l);continue}if(l=this.tokenizer.codespan(e)){e=e.substring(l.raw.length),r.push(l);continue}if(l=this.tokenizer.br(e)){e=e.substring(l.raw.length),r.push(l);continue}if(l=this.tokenizer.del(e)){e=e.substring(l.raw.length),r.push(l);continue}if(l=this.tokenizer.autolink(e)){e=e.substring(l.raw.length),r.push(l);continue}if(!this.state.inLink&&(l=this.tokenizer.url(e))){e=e.substring(l.raw.length),r.push(l);continue}let u=e;if(this.options.extensions?.startInline){let h=1/0,f=e.slice(1),d;this.options.extensions.startInline.forEach(p=>{d=p.call({lexer:this},f),typeof d=="number"&&d>=0&&(h=Math.min(h,d))}),h<1/0&&h>=0&&(u=e.substring(0,h+1))}if(l=this.tokenizer.inlineText(u)){e=e.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(e){let h="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(h);break}else throw new Error(h)}}return r}},o5=class{static{o(this,"P")}options;parser;constructor(t){this.options=t||_0}space(t){return""}code({text:t,lang:e,escaped:r}){let i=(e||"").match(Gs.notSpaceStart)?.[0],n=t.replace(Gs.endingNewline,"")+`
`;return i?''+(r?n:Eu(n,!0))+`
`:""+(r?n:Eu(n,!0))+`
`}blockquote({tokens:t}){return`
${this.parser.parse(t)}
`}html({text:t}){return t}def(t){return""}heading({tokens:t,depth:e}){return`${this.parser.parseInline(t)}
`}hr(t){return`
`}list(t){let e=t.ordered,r=t.start,i="";for(let s=0;s
`+i+""+n+`>
`}listitem(t){let e="";if(t.task){let r=this.checkbox({checked:!!t.checked});t.loose?t.tokens[0]?.type==="paragraph"?(t.tokens[0].text=r+" "+t.tokens[0].text,t.tokens[0].tokens&&t.tokens[0].tokens.length>0&&t.tokens[0].tokens[0].type==="text"&&(t.tokens[0].tokens[0].text=r+" "+Eu(t.tokens[0].tokens[0].text),t.tokens[0].tokens[0].escaped=!0)):t.tokens.unshift({type:"text",raw:r+" ",text:r+" ",escaped:!0}):e+=r+" "}return e+=this.parser.parse(t.tokens,!!t.loose),`${e}
`}checkbox({checked:t}){return" '}paragraph({tokens:t}){return`${this.parser.parseInline(t)}
`}table(t){let e="",r="";for(let n=0;n${i}`),`
`}tablerow({text:t}){return`
${t}
`}tablecell(t){let e=this.parser.parseInline(t.tokens),r=t.header?"th":"td";return(t.align?`<${r} align="${t.align}">`:`<${r}>`)+e+`${r}>
`}strong({tokens:t}){return`${this.parser.parseInline(t)} `}em({tokens:t}){return`${this.parser.parseInline(t)} `}codespan({text:t}){return`${Eu(t,!0)}`}br(t){return" "}del({tokens:t}){return`${this.parser.parseInline(t)}`}link({href:t,title:e,tokens:r}){let i=this.parser.parseInline(r),n=pae(t);if(n===null)return i;t=n;let a='"+i+" ",a}image({href:t,title:e,text:r,tokens:i}){i&&(r=this.parser.parseInline(i,this.parser.textRenderer));let n=pae(t);if(n===null)return Eu(r);t=n;let a=` ",a}text(t){return"tokens"in t&&t.tokens?this.parser.parseInline(t.tokens):"escaped"in t&&t.escaped?t.text:Eu(t.text)}},ZI=class{static{o(this,"$")}strong({text:t}){return t}em({text:t}){return t}codespan({text:t}){return t}del({text:t}){return t}html({text:t}){return t}text({text:t}){return t}link({text:t}){return""+t}image({text:t}){return""+t}br(){return""}},Gh=class qI{static{o(this,"l")}options;renderer;textRenderer;constructor(e){this.options=e||_0,this.options.renderer=this.options.renderer||new o5,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new ZI}static parse(e,r){return new qI(r).parse(e)}static parseInline(e,r){return new qI(r).parseInline(e)}parse(e,r=!0){let i="";for(let n=0;n{let s=n[a].flat(1/0);r=r.concat(this.walkTokens(s,e))}):n.tokens&&(r=r.concat(this.walkTokens(n.tokens,e)))}}return r}use(...t){let e=this.defaults.extensions||{renderers:{},childTokens:{}};return t.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=e.renderers[n.name];a?e.renderers[n.name]=function(...s){let l=n.renderer.apply(this,s);return l===!1&&(l=a.apply(this,s)),l}:e.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=e[n.level];a?a.unshift(n.tokenizer):e[n.level]=[n.tokenizer],n.start&&(n.level==="block"?e.startBlock?e.startBlock.push(n.start):e.startBlock=[n.start]:n.level==="inline"&&(e.startInline?e.startInline.push(n.start):e.startInline=[n.start]))}"childTokens"in n&&n.childTokens&&(e.childTokens[n.name]=n.childTokens)}),i.extensions=e),r.renderer){let n=this.defaults.renderer||new o5(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 f=l.apply(n,h);return f===!1&&(f=u.apply(n,h)),f||""}}i.renderer=n}if(r.tokenizer){let n=this.defaults.tokenizer||new s5(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 f=l.apply(n,h);return f===!1&&(f=u.apply(n,h)),f}}i.tokenizer=n}if(r.hooks){let n=this.defaults.hooks||new kb;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];kb.passThroughHooks.has(a)?n[s]=h=>{if(this.defaults.async&&kb.passThroughHooksRespectAsync.has(a))return Promise.resolve(l.call(n,h)).then(d=>u.call(n,d));let f=l.call(n,h);return u.call(n,f)}:n[s]=(...h)=>{let f=l.apply(n,h);return f===!1&&(f=u.apply(n,h)),f}}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(t){return this.defaults={...this.defaults,...t},this}lexer(t,e){return zh.lex(t,e??this.defaults)}parser(t,e){return Gh.parse(t,e??this.defaults)}parseMarkdown(t){return(e,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 e>"u"||e===null)return a(new Error("marked(): input parameter is undefined or null"));if(typeof e!="string")return a(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(e)+", string expected"));n.hooks&&(n.hooks.options=n,n.hooks.block=t);let s=n.hooks?n.hooks.provideLexer():t?zh.lex:zh.lexInline,l=n.hooks?n.hooks.provideParser():t?Gh.parse:Gh.parseInline;if(n.async)return Promise.resolve(n.hooks?n.hooks.preprocess(e):e).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&&(e=n.hooks.preprocess(e));let u=s(e,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(t,e){return r=>{if(r.message+=`
Please report this to https://github.com/markedjs/marked.`,t){let i="An error occurred:
"+Eu(r.message+"",!0)+" ";return e?Promise.resolve(i):i}if(e)return Promise.reject(r);throw r}}},A0=new tVe;o(bi,"d");bi.options=bi.setOptions=function(t){return A0.setOptions(t),bi.defaults=A0.defaults,yae(bi.defaults),bi};bi.getDefaults=WI;bi.defaults=_0;bi.use=function(...t){return A0.use(...t),bi.defaults=A0.defaults,yae(bi.defaults),bi};bi.walkTokens=function(t,e){return A0.walkTokens(t,e)};bi.parseInline=A0.parseInline;bi.Parser=Gh;bi.parser=Gh.parse;bi.Renderer=o5;bi.TextRenderer=ZI;bi.Lexer=zh;bi.lexer=zh.lex;bi.Tokenizer=s5;bi.Hooks=kb;bi.parse=bi;sFt=bi.options,oFt=bi.setOptions,lFt=bi.use,cFt=bi.walkTokens,uFt=bi.parseInline,hFt=Gh.parse,fFt=zh.lex});function rVe(t,{markdownAutoWrap:e}){let i=t.replace(/ /g,`
`).replace(/\n{2,}/g,`
`);return Z4(i)}function Dae(t){return t.split(/\\n|\n| /gi).map(e=>e.trim().match(/<[^>]+>|[^\s<>]+/g)?.map(r=>({content:r,type:"normal"}))??[])}function Lae(t,e={}){let r=rVe(t,e),i=bi.lexer(r),n=[[]],a=0;function s(l,u="normal"){l.type==="text"?l.text.split(`
`).forEach((f,d)=>{d!==0&&(a++,n.push([])),f.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 Rae(t){return t?`${t.replace(/\\n|\n/g," ")}
`:""}function Nae(t,{markdownAutoWrap:e}={}){let r=bi.lexer(t);function i(n){return n.type==="text"?e===!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:(Q.warn(`Unsupported markdown: ${n.type}`),n.raw)}return o(i,"output"),r.map(i).join("")}var Iae=P(()=>{"use strict";_ae();oL();bt();o(rVe,"preprocessMarkdown");o(Dae,"nonMarkdownToLines");o(Lae,"markdownToLines");o(Rae,"nonMarkdownToHTML");o(Nae,"markdownToHTML")});function iVe(t){return Intl.Segmenter?[...new Intl.Segmenter().segment(t)].map(e=>e.segment):[...t]}function nVe(t,e){let r=iVe(e.content);return Mae(t,[],r,e.type)}function Mae(t,e,r,i){if(r.length===0)return[{content:e.join(""),type:i},{content:"",type:i}];let[n,...a]=r,s=[...e,n];return t([{content:s.join(""),type:i}])?Mae(t,s,a,i):(e.length===0&&n&&(e.push(n),r.shift()),[{content:e.join(""),type:i},{content:r.join(""),type:i}])}function Oae(t,e){if(t.some(({content:r})=>r.includes(`
`)))throw new Error("splitLineToFitWidth does not support newlines in the line");return JI(t,e)}function JI(t,e,r=[],i=[]){if(t.length===0)return i.length>0&&r.push(i),r.length>0?r:[];let n="";t[0].content===" "&&(n=" ",t.shift());let a=t.shift()??{content:" ",type:"normal"},s=[...i];if(n!==""&&s.push({content:n,type:"normal"}),s.push(a),e(s))return JI(t,e,r,s);if(i.length>0)r.push(i),t.unshift(a);else if(a.content){let[l,u]=nVe(e,a);r.push([l]),u.content&&t.unshift(u)}return JI(t,e,r)}var Pae=P(()=>{"use strict";o(iVe,"splitTextToChars");o(nVe,"splitWordToFitWidth");o(Mae,"splitWordToFitWidthRecursion");o(Oae,"splitLineToFitWidth");o(JI,"splitLineToFitWidthRecursion")});function Bae(t,e){e&&t.attr("style",e)}async function aVe(t,e,r,i,n=!1,a=Lt()){let s=t.append("foreignObject");s.attr("width",`${Math.min(10*r,Fae)}px`),s.attr("height",`${Math.min(10*r,Fae)}px`);let l=s.append("xhtml:div"),u=sn(e.label)?await Rg(e.label.replace(lt.lineBreakRegex,`
`),a):Tr(e.label,a),h=e.isNode?"nodeLabel":"edgeLabel",f=l.append("span");f.html(u),Bae(f,e.labelStyle),f.attr("class",`${h} ${i}`),Bae(l,e.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 d=l.node().getBoundingClientRect();return d.width===r&&(l.style("display","table"),l.style("white-space","break-spaces"),l.style("width",r+"px"),d=l.node().getBoundingClientRect()),s.node()}function eM(t,e,r,i=!1){let n=t.append("tspan").attr("class","text-outer-tspan").attr("x",0).attr("y",e*r-.1+"em").attr("dy",r+"em");return i&&n.attr("text-anchor","middle"),n}function sVe(t,e,r){let i=t.append("text"),n=eM(i,1,e);tM(n,r);let a=n.node().getComputedTextLength();return i.remove(),a}function zae(t,e,r){let i=t.append("text"),n=eM(i,1,e);tM(n,[{content:r,type:"normal"}]);let a=n.node()?.getBoundingClientRect();return a&&i.remove(),a}function oVe(t,e,r,i=!1,n=!1){let s=e.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 f of r){let d=o(m=>sVe(s,1.1,m)<=t,"checkWidth"),p=d(f)?[f]:Oae(f,d);for(let m of p){let g=eM(u,h,1.1,n);tM(g,m),h++}}if(i){let f=u.node().getBBox(),d=2;return l.attr("x",f.x-d).attr("y",f.y-d).attr("width",f.width+2*d).attr("height",f.height+2*d),s.node()}else return u.node()}function $ae(t){let e=/&(amp|lt|gt);/g;return t.replace(e,(r,i)=>{switch(i){case"amp":return"&";case"lt":return"<";case"gt":return">";default:return r}})}function tM(t,e){t.text(""),e.forEach((r,i)=>{let n=t.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($ae(r.content)):n.text(" "+$ae(r.content))})}async function lVe(t,e={}){let r=[];t.replace(/(fa[bklrs]?):fa-([\w-]+)/g,(n,a,s)=>(r.push((async()=>{let l=`${a}:${s}`;return await WK(l)?await fo(l,void 0,{class:"label-icon"}):` `})()),n));let i=await Promise.all(r);return t.replace(/(fa[bklrs]?):fa-([\w-]+)/g,()=>i.shift()??"")}var Fae,Vi,To=P(()=>{"use strict";Pr();Vr();bt();Iae();er();lu();Pae();Sr();o(Bae,"applyStyle");Fae=16384;o(aVe,"addHtmlSpan");o(eM,"createTspan");o(sVe,"computeWidthOfText");o(zae,"computeDimensionOfText");o(oVe,"createFormattedText");o($ae,"decodeHTMLEntities");o(tM,"updateTextContentAndStyles");o(lVe,"replaceIconSubstring");Vi=o(async(t,e="",{style:r="",isTitle:i=!1,classes:n="",useHtmlLabels:a=!0,markdown:s=!0,isNode:l=!0,width:u=200,addSvgBackground:h=!1}={},f)=>{if(Q.debug("XYZ createText",e,r,i,n,a,l,"addSvgBackground: ",h),a){let d=s?Nae(e,f):Rae(e),p=await lVe(zs(d),f),m=e.replace(/\\\\/g,"\\"),g={isNode:l,label:sn(e)?m:p,labelStyle:r.replace("fill:","color:")};return await aVe(t,g,u,n,h,f)}else{let d=zs(e.replace(/ /g," ")),p=s?Lae(d.replace(" "," "),f):Dae(d),m=oVe(u,t,p,e?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:");Ze(m).attr("style",g)}else{let g=r.replace(/stroke:[^;]+;?/g,"").replace(/stroke-width:[^;]+;?/g,"").replace(/fill:[^;]+;?/g,"").replace(/background:/g,"fill:");Ze(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:");Ze(m).select("text").attr("style",y)}return i?Ze(m).selectAll("tspan.text-outer-tspan").classed("title-row",!0):Ze(m).selectAll("tspan.text-outer-tspan").classed("row",!0),m}},"createText")});async function u5(t,e){let r=t.getElementsByTagName("img");if(!r||r.length===0)return;let i=e.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=fr.fontSize]=$s(l),f=h*u+"px";n.style.minWidth=f,n.style.maxWidth=f}else n.style.width="100%";a(n)}o(s,"setupImage"),setTimeout(()=>{n.complete&&s()}),n.addEventListener("error",s),n.addEventListener("load",s)})))}var rM=P(()=>{"use strict";Ut();wa();er();o(u5,"configureLabelImages")});function rr(t){let e=t.map((r,i)=>`${i===0?"M":"L"}${r.x},${r.y}`);return e.push("Z"),e.join(" ")}function Ml(t,e,r,i,n,a){let s=[],u=r-t,h=i-e,f=u/a,d=2*Math.PI/f,p=e+h/2;for(let m=0;m<=50;m++){let g=m/50,y=t+g*u,v=p+n*Math.sin(d*(y-t));s.push({x:y,y:v})}return s}function D0(t,e,r,i,n,a){let s=[],l=n*Math.PI/180,f=(a*Math.PI/180-l)/(i-1);for(let d=0;du.tagName==="path"),r=document.createElementNS("http://www.w3.org/2000/svg","path"),i=e.map(u=>u.getAttribute("d")).filter(u=>u!==null).join(" ");r.setAttribute("d",i);let n=e.find(u=>u.getAttribute("fill")!=="none"),a=e.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,f])=>{f&&r.setAttribute(h,f)})}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,f])=>{f&&r.setAttribute(h,f)})}let l=document.createElementNS("http://www.w3.org/2000/svg","g");return l.appendChild(r),l}var vt,h5,at,mt,zt=P(()=>{"use strict";To();Ut();Sr();Pr();Vr();er();rM();vt=o(async(t,e,r)=>{let i,n=e.useHtmlLabels||ls(ge()?.htmlLabels);r?i=r:i="node default";let a=t.insert("g").attr("class",i).attr("id",e.domId||e.id),s=a.insert("g").attr("class","label").attr("style",xi(e.labelStyle)),l;e.label===void 0?l="":l=typeof e.label=="string"?e.label:e.label[0];let u=!!e.icon||!!e.img,h=e.labelType==="markdown",f=await Vi(s,Tr(zs(l),ge()),{useHtmlLabels:n,width:e.width||ge().flowchart?.wrappingWidth,classes:h?"markdown-node-label":"",style:e.labelStyle,addSvgBackground:u,markdown:h},ge()),d=f.getBBox(),p=(e?.padding??0)/2;if(n){let m=f.children[0],g=Ze(f);await u5(m,l),d=m.getBoundingClientRect(),g.attr("width",d.width),g.attr("height",d.height)}return n?s.attr("transform","translate("+-d.width/2+", "+-d.height/2+")"):s.attr("transform","translate(0, "+-d.height/2+")"),e.centerLabel&&s.attr("transform","translate("+-d.width/2+", "+-d.height/2+")"),s.insert("rect",":first-child"),{shapeSvg:a,bbox:d,halfPadding:p,label:s}},"labelHelper"),h5=o(async(t,e,r)=>{let i=r.useHtmlLabels??Or(ge()),n=t.insert("g").attr("class","label").attr("style",r.labelStyle||""),a=await Vi(n,Tr(zs(e),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(Or(ge())){let u=a.children[0],h=Ze(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:t,bbox:s,halfPadding:l,label:n}},"insertLabel"),at=o((t,e)=>{let r=e.node().getBBox();t.width=r.width,t.height=r.height},"updateNodeBounds"),mt=o((t,e)=>(t.look==="handDrawn"?"rough-node":"node")+" "+t.cssClasses+" "+(e||""),"getNodeClasses");o(rr,"createPathFromPoints");o(Ml,"generateFullSineWavePoints");o(D0,"generateCirclePoints");o(iM,"mergePaths")});function cVe(t,e){return t.intersect(e)}var Gae,Vae=P(()=>{"use strict";o(cVe,"intersectNode");Gae=cVe});function uVe(t,e,r,i){var n=t.x,a=t.y,s=n-i.x,l=a-i.y,u=Math.sqrt(e*e*l*l+r*r*s*s),h=Math.abs(e*r*s/u);i.x{"use strict";o(uVe,"intersectEllipse");f5=uVe});function hVe(t,e,r){return f5(t,e,e,r)}var qae,Wae=P(()=>{"use strict";nM();o(hVe,"intersectCircle");qae=hVe});function fVe(t,e,r,i){{let n=e.y-t.y,a=t.x-e.x,s=e.x*t.y-t.x*e.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&&Uae(l,u))return;let f=i.y-r.y,d=r.x-i.x,p=i.x*r.y-r.x*i.y,m=f*t.x+d*t.y+p,g=f*e.x+d*e.y+p;if(Math.abs(m)0}var Hae,Yae=P(()=>{"use strict";o(fVe,"intersectLine");o(Uae,"sameSign");Hae=fVe});function dVe(t,e,r){let i=t.x,n=t.y,a=[],s=Number.POSITIVE_INFINITY,l=Number.POSITIVE_INFINITY;typeof e.forEach=="function"?e.forEach(function(f){s=Math.min(s,f.x),l=Math.min(l,f.y)}):(s=Math.min(s,e.x),l=Math.min(l,e.y));let u=i-t.width/2-s,h=n-t.height/2-l;for(let f=0;f1&&a.sort(function(f,d){let p=f.x-r.x,m=f.y-r.y,g=Math.sqrt(p*p+m*m),y=d.x-r.x,v=d.y-r.y,x=Math.sqrt(y*y+v*v);return g{"use strict";Yae();o(dVe,"intersectPolygon");jae=dVe});var pVe,hd,aM=P(()=>{"use strict";pVe=o((t,e)=>{var r=t.x,i=t.y,n=e.x-r,a=e.y-i,s=t.width/2,l=t.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"),hd=pVe});var et,Xt=P(()=>{"use strict";Vae();Wae();nM();Xae();aM();et={node:Gae,circle:qae,ellipse:f5,polygon:jae,rect:hd}});var Kae,Su,mVe,Eb,tt,st,gVe,Ht=P(()=>{"use strict";Ut();Kae=o(t=>{let{handDrawnSeed:e}=ge();return{fill:t,hachureAngle:120,hachureGap:4,fillWeight:2,roughness:.7,stroke:t,seed:e}},"solidStateFill"),Su=o(t=>{let e=mVe([...t.cssCompiledStyles||[],...t.cssStyles||[],...t.labelStyle||[]]);return{stylesMap:e,stylesArray:[...e]}},"compileStyles"),mVe=o(t=>{let e=new Map;return t.forEach(r=>{let[i,n]=r.split(":");e.set(i.trim(),n?.trim())}),e},"styles2Map"),Eb=o(t=>t==="color"||t==="font-size"||t==="font-family"||t==="font-weight"||t==="font-style"||t==="text-decoration"||t==="text-align"||t==="text-transform"||t==="line-height"||t==="letter-spacing"||t==="word-spacing"||t==="text-shadow"||t==="text-overflow"||t==="white-space"||t==="word-wrap"||t==="word-break"||t==="overflow-wrap"||t==="hyphens","isLabelStyle"),tt=o(t=>{let{stylesArray:e}=Su(t),r=[],i=[],n=[],a=[];return e.forEach(s=>{let l=s[0];Eb(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:e,borderStyles:n,backgroundStyles:a}},"styles2String"),st=o((t,e)=>{let{themeVariables:r,handDrawnSeed:i}=ge(),{nodeBorder:n,mainBkg:a}=r,{stylesMap:s}=Su(t);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:gVe(s.get("stroke-dasharray"))},e)},"userNodeOverrides"),gVe=o(t=>{if(!t)return[0,0];let e=t.trim().split(/\s+/).map(Number);if(e.length===1){let n=isNaN(e[0])?0:e[0];return[n,n]}let r=isNaN(e[0])?0:e[0],i=isNaN(e[1])?0:e[1];return[r,i]},"getStrokeDashArray")});function sM(t,e,r){if(t&&t.length){let[i,n]=e,a=Math.PI/180*r,s=Math.cos(a),l=Math.sin(a);for(let u of t){let[h,f]=u;u[0]=(h-i)*s-(f-n)*l+i,u[1]=(h-i)*l+(f-n)*s+n}}}function yVe(t,e){return t[0]===e[0]&&t[1]===e[1]}function vVe(t,e,r,i=1){let n=r,a=Math.max(e,.1),s=t[0]&&t[0][0]&&typeof t[0][0]=="number"?[t]:t,l=[0,0];if(n)for(let h of s)sM(h,l,n);let u=(function(h,f,d){let p=[];for(let b of h){let T=[...b];yVe(T[0],T[T.length-1])||T.push([T[0][0],T[0][1]]),T.length>2&&p.push(T)}let m=[];f=Math.max(f,.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))),(d!==1||x%f==0)&&y.length>1)for(let b=0;b=y.length)break;let w=y[b].edge,k=y[T].edge;m.push([[Math.round(w.x),v],[Math.round(k.x),v]])}v+=d,y.forEach((b=>{b.edge.x=b.edge.x+d*b.edge.islope})),x++}return m})(s,a,i);if(n){for(let h of s)sM(h,l,-n);(function(h,f,d){let p=[];h.forEach((m=>p.push(...m))),sM(p,f,d)})(u,l,-n)}return u}function Db(t,e){var r;let i=e.hachureAngle+90,n=e.hachureGap;n<0&&(n=4*e.strokeWidth),n=Math.round(Math.max(n,.1));let a=1;return e.roughness>=1&&(((r=e.randomizer)===null||r===void 0?void 0:r.next())||Math.random())>.7&&(a=n),vVe(t,n,i,a||1)}function T5(t){let e=t[0],r=t[1];return Math.sqrt(Math.pow(e[0]-r[0],2)+Math.pow(e[1]-r[1],2))}function lM(t,e){return t.type===e}function kM(t){let e=[],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:xVe,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:oM,text:`${parseFloat(RegExp.$1)}`},s=s.substr(RegExp.$1.length)}return l[l.length]={type:Qae,text:""},l})(t),i="BOD",n=0,a=r[n];for(;!lM(a,Qae);){let s=0,l=[];if(i==="BOD"){if(a.text!=="M"&&a.text!=="m")return kM("M0,0"+t);n++,s=d5[a.text],i=a.text}else lM(a,oM)?s=d5[i]:(n++,s=d5[a.text],i=a.text);if(!(n+sf%2?h+r:h+e));a.push({key:"C",data:u}),e=u[4],r=u[5];break}case"Q":a.push({key:"Q",data:[...l]}),e=l[2],r=l[3];break;case"q":{let u=l.map(((h,f)=>f%2?h+r:h+e));a.push({key:"Q",data:u}),e=u[2],r=u[3];break}case"A":a.push({key:"A",data:[...l]}),e=l[5],r=l[6];break;case"a":e+=l[5],r+=l[6],a.push({key:"A",data:[l[0],l[1],l[2],l[3],l[4],e,r]});break;case"H":a.push({key:"H",data:[...l]}),e=l[0];break;case"h":e+=l[0],a.push({key:"H",data:[e]});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]}),e=l[2],r=l[3];break;case"s":{let u=l.map(((h,f)=>f%2?h+r:h+e));a.push({key:"S",data:u}),e=u[2],r=u[3];break}case"T":a.push({key:"T",data:[...l]}),e=l[0],r=l[1];break;case"t":e+=l[0],r+=l[1],a.push({key:"T",data:[e,r]});break;case"Z":case"z":a.push({key:"Z",data:[]}),e=i,r=n}return a}function sse(t){let e=[],r="",i=0,n=0,a=0,s=0,l=0,u=0;for(let{key:h,data:f}of t){switch(h){case"M":e.push({key:"M",data:[...f]}),[i,n]=f,[a,s]=f;break;case"C":e.push({key:"C",data:[...f]}),i=f[4],n=f[5],l=f[2],u=f[3];break;case"L":e.push({key:"L",data:[...f]}),[i,n]=f;break;case"H":i=f[0],e.push({key:"L",data:[i,n]});break;case"V":n=f[0],e.push({key:"L",data:[i,n]});break;case"S":{let d=0,p=0;r==="C"||r==="S"?(d=i+(i-l),p=n+(n-u)):(d=i,p=n),e.push({key:"C",data:[d,p,...f]}),l=f[0],u=f[1],i=f[2],n=f[3];break}case"T":{let[d,p]=f,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=d+2*(m-d)/3,b=p+2*(g-p)/3;e.push({key:"C",data:[y,v,x,b,d,p]}),l=m,u=g,i=d,n=p;break}case"Q":{let[d,p,m,g]=f,y=i+2*(d-i)/3,v=n+2*(p-n)/3,x=m+2*(d-m)/3,b=g+2*(p-g)/3;e.push({key:"C",data:[y,v,x,b,m,g]}),l=d,u=p,i=m,n=g;break}case"A":{let d=Math.abs(f[0]),p=Math.abs(f[1]),m=f[2],g=f[3],y=f[4],v=f[5],x=f[6];d===0||p===0?(e.push({key:"C",data:[i,n,v,x,v,x]}),i=v,n=x):(i!==v||n!==x)&&(ose(i,n,v,x,d,p,m,g,y).forEach((function(b){e.push({key:"C",data:b})})),i=v,n=x);break}case"Z":e.push({key:"Z",data:[]}),i=a,n=s}r=h}return e}function Sb(t,e,r){return[t*Math.cos(r)-e*Math.sin(r),t*Math.sin(r)+e*Math.cos(r)]}function ose(t,e,r,i,n,a,s,l,u,h){let f=(d=s,Math.PI*d/180);var d;let p=[],m=0,g=0,y=0,v=0;if(h)[m,g,y,v]=h;else{[t,e]=Sb(t,e,-f),[r,i]=Sb(r,i,-f);let _=(t-r)/2,D=(e-i)/2,N=_*_/(n*n)+D*D/(a*a);N>1&&(N=Math.sqrt(N),n*=N,a*=N);let R=n*n,B=a*a,O=R*B-R*D*D-B*_*_,$=R*D*D+B*_*_,z=(l===u?-1:1)*Math.sqrt(Math.abs(O/$));y=z*n*D/a+(t+r)/2,v=z*-a*_/n+(e+i)/2,m=Math.asin(parseFloat(((e-v)/a).toFixed(9))),g=Math.asin(parseFloat(((i-v)/a).toFixed(9))),tg&&(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,D=r,N=i;g=u&&g>m?m+120*Math.PI/180*1:m+120*Math.PI/180*-1,p=ose(r=y+n*Math.cos(g),i=v+a*Math.sin(g),D,N,n,a,s,0,u,[g,_,y,v])}x=g-m;let b=Math.cos(m),T=Math.sin(m),w=Math.cos(g),k=Math.sin(g),C=Math.tan(x/4),E=4/3*n*C,S=4/3*a*C,L=[t,e],M=[t+E*T,e-S*b],I=[r+E*k,i-S*w],A=[r,i];if(M[0]=2*L[0]-M[0],M[1]=2*L[1]-M[1],h)return[M,I,A].concat(p);{p=[M,I,A].concat(p);let _=[];for(let D=0;D2){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=ise(v,h,f,d,p,m,g,1,u);if(!u.disableMultiStroke){let b=ise(v,h,f,d,p,m,g,1.5,u);x.push(...b)}return s&&(l?x.push(...fd(h,f,h+d*Math.cos(m),f+p*Math.sin(m),u),...fd(h,f,h+d*Math.cos(g),f+p*Math.sin(g),u)):x.push({op:"lineTo",data:[h,f]},{op:"lineTo",data:[h+d*Math.cos(m),f+p*Math.sin(m)]})),{type:"path",ops:x}}function ese(t,e){let r=sse(ase(kM(t))),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(...fd(a[0],a[1],l[0],l[1],e)),a=[l[0],l[1]];break;case"C":{let[u,h,f,d,p,m]=l;i.push(...kVe(u,h,f,d,p,m,a,e)),a=[p,m];break}case"Z":i.push(...fd(a[0],a[1],n[0],n[1],e)),a=[n[0],n[1]]}return{type:"path",ops:i}}function cM(t,e){let r=[];for(let i of t)if(i.length){let n=e.maxRandomnessOffset||0,a=i.length;if(a>2){r.push({op:"move",data:[i[0][0]+xr(n,e),i[0][1]+xr(n,e)]});for(let s=1;s500?.4:-.0016668*u+1.233334;let f=n.maxRandomnessOffset||0;f*f*100>l&&(f=u/10);let d=f/2,p=.2+.2*use(n),m=n.bowing*n.maxRandomnessOffset*(i-e)/200,g=n.bowing*n.maxRandomnessOffset*(t-r)/200;m=xr(m,n,h),g=xr(g,n,h);let y=[],v=o(()=>xr(d,n,h),"M"),x=o(()=>xr(f,n,h),"k"),b=n.preserveVertices;return a&&(s?y.push({op:"move",data:[t+(b?0:v()),e+(b?0:v())]}):y.push({op:"move",data:[t+(b?0:xr(f,n,h)),e+(b?0:xr(f,n,h))]})),s?y.push({op:"bcurveTo",data:[m+t+(r-t)*p+v(),g+e+(i-e)*p+v(),m+t+2*(r-t)*p+v(),g+e+2*(i-e)*p+v(),r+(b?0:v()),i+(b?0:v())]}):y.push({op:"bcurveTo",data:[m+t+(r-t)*p+x(),g+e+(i-e)*p+x(),m+t+2*(r-t)*p+x(),g+e+2*(i-e)*p+x(),r+(b?0:x()),i+(b?0:x())]}),y}function p5(t,e,r){if(!t.length)return[];let i=[];i.push([t[0][0]+xr(e,r),t[0][1]+xr(e,r)]),i.push([t[0][0]+xr(e,r),t[0][1]+xr(e,r)]);for(let n=1;n3){let a=[],s=1-r.curveTightness;n.push({op:"move",data:[t[1][0],t[1][1]]});for(let l=1;l+21&&n.push(l)):n.push(l),n.push(t[e+3])}else{let u=t[e+0],h=t[e+1],f=t[e+2],d=t[e+3],p=L0(u,h,.5),m=L0(h,f,.5),g=L0(f,d,.5),y=L0(p,m,.5),v=L0(m,g,.5),x=L0(y,v,.5);xM([u,p,y,x],0,r,n),xM([x,v,g,d],0,r,n)}var a,s;return n}function wVe(t,e){return b5(t,0,t.length,e)}function b5(t,e,r,i,n){let a=n||[],s=t[e],l=t[r-1],u=0,h=1;for(let f=e+1;fu&&(u=d,h=f)}return Math.sqrt(u)>i?(b5(t,e,h+1,i,a),b5(t,h,r,i,a)):(a.length||a.push(s),a.push(l)),a}function uM(t,e=.15,r){let i=[],n=(t.length-1)/3;for(let a=0;a0?b5(i,0,i.length,r):i}var _b,hM,fM,dM,pM,mM,ko,gM,xVe,oM,Qae,d5,bVe,el,D1,bM,m5,TM,rt,Yt=P(()=>{"use strict";o(sM,"t");o(yVe,"e");o(vVe,"s");o(Db,"n");_b=class{static{o(this,"o")}constructor(e){this.helper=e}fillPolygons(e,r){return this._fillPolygons(e,r)}_fillPolygons(e,r){let i=Db(e,r);return{type:"fillSketch",ops:this.renderLines(i,r)}}renderLines(e,r){let i=[];for(let n of e)i.push(...this.helper.doubleLineOps(n[0][0],n[0][1],n[1][0],n[1][1],r));return i}};o(T5,"a");hM=class extends _b{static{o(this,"h")}fillPolygons(e,r){let i=r.hachureGap;i<0&&(i=4*r.strokeWidth),i=Math.max(i,.1);let n=Db(e,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,f]of n)T5([h,f])&&s.push([[h[0]-l,h[1]+u],[...f]],[[h[0]+l,h[1]-u],[...f]]);return{type:"fillSketch",ops:this.renderLines(s,r)}}},fM=class extends _b{static{o(this,"r")}fillPolygons(e,r){let i=this._fillPolygons(e,r),n=Object.assign({},r,{hachureAngle:r.hachureAngle+90}),a=this._fillPolygons(e,n);return i.ops=i.ops.concat(a.ops),i}},dM=class{static{o(this,"i")}constructor(e){this.helper=e}fillPolygons(e,r){let i=Db(e,r=Object.assign({},r,{hachureAngle:0}));return this.dotsOnLines(i,r)}dotsOnLines(e,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 e){let u=T5(l),h=u/n,f=Math.ceil(h)-1,d=u-f*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=T5(s),u=Math.floor(l/(i+n)),h=(l+n-u*(i+n))/2,f=s[0],d=s[1];f[0]>d[0]&&(f=s[1],d=s[0]);let p=Math.atan((d[1]-f[1])/(d[0]-f[0]));for(let m=0;m{let s=T5(a),l=Math.round(s/(2*r)),u=a[0],h=a[1];u[0]>h[0]&&(u=a[1],h=a[0]);let f=Math.atan((h[1]-u[1])/(h[0]-u[0]));for(let d=0;d2*Math.PI&&(E=0,S=2*Math.PI);let L=(S-E)/b.curveStepCount,M=[];for(let I=E;I<=S;I+=L)M.push([T+k*Math.cos(I),w+C*Math.sin(I)]);return M.push([T+k*Math.cos(S),w+C*Math.sin(S)]),M.push([T,w]),_1([M],b)})(e,r,i,n,a,s,h));return h.stroke!==el&&f.push(d),this._d("arc",f,h)}curve(e,r){let i=this._o(r),n=[],a=Zae(e,i);if(i.fill&&i.fill!==el)if(i.fillStyle==="solid"){let s=Zae(e,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=e;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(...uM(nse([h[0],h[0],h[1],h[2]]),10,(1+i.roughness)/2)):s.push(...uM(nse(h),10,(1+i.roughness)/2))}s.length&&n.push(_1([s],i))}return i.stroke!==el&&n.push(a),this._d("curve",n,i)}polygon(e,r){let i=this._o(r),n=[],a=g5(e,!0,i);return i.fill&&(i.fillStyle==="solid"?n.push(cM([e],i)):n.push(_1([e],i))),i.stroke!==el&&n.push(a),this._d("polygon",n,i)}path(e,r){let i=this._o(r),n=[];if(!e)return this._d("path",n,i);e=(e||"").replace(/\n/g," ").replace(/(-\s)/g,"-").replace("/(ss)/g"," ");let a=i.fill&&i.fill!=="transparent"&&i.fill!==el,s=i.stroke!==el,l=!!(i.simplification&&i.simplification<1),u=(function(f,d,p){let m=sse(ase(kM(f))),g=[],y=[],v=[0,0],x=[],b=o(()=>{x.length>=4&&y.push(...uM(x,d)),x=[]},"i"),T=o(()=>{b(),y.length&&(g.push(y),y=[])},"c");for(let{key:k,data:C}of m)switch(k){case"M":T(),v=[C[0],C[1]],y.push(v);break;case"L":b(),y.push([C[0],C[1]]);break;case"C":if(!x.length){let E=y.length?y[y.length-1]:v;x.push([E[0],E[1]])}x.push([C[0],C[1]]),x.push([C[2],C[3]]),x.push([C[4],C[5]]);break;case"Z":b(),y.push([v[0],v[1]])}if(T(),!p)return g;let w=[];for(let k of g){let C=wVe(k,p);C.length&&w.push(C)}return w})(e,1,l?4-4*(i.simplification||1):(1+i.roughness)/2),h=ese(e,i);if(a)if(i.fillStyle==="solid")if(u.length===1){let f=ese(e,Object.assign(Object.assign({},i),{disableMultiStroke:!0,roughness:i.roughness?i.roughness+i.fillShapeRoughnessGain:0}));n.push({type:"fillPath",ops:this._mergedShape(f.ops)})}else n.push(cM(u,i));else n.push(_1(u,i));return s&&(l?u.forEach((f=>{n.push(g5(f,!1,i))})):n.push(h)),this._d("path",n,i)}opsToPath(e,r){let i="";for(let n of e.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(e){let r=e.sets||[],i=e.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:el};break;case"fillPath":s={d:this.opsToPath(a),stroke:el,strokeWidth:0,fill:i.fill||el};break;case"fillSketch":s=this.fillSketch(a,i)}s&&n.push(s)}return n}fillSketch(e,r){let i=r.fillWeight;return i<0&&(i=r.strokeWidth/2),{d:this.opsToPath(e),stroke:r.fill||el,strokeWidth:i,fill:el}}_mergedShape(e){return e.filter(((r,i)=>i===0||r.op!=="move"))}},bM=class{static{o(this,"st")}constructor(e,r){this.canvas=e,this.ctx=this.canvas.getContext("2d"),this.gen=new D1(r)}draw(e){let r=e.sets||[],i=e.options||this.getDefaultOptions(),n=this.ctx,a=e.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=e.shape==="curve"||e.shape==="polygon"||e.shape==="path"?"evenodd":"nonzero";this._drawToContext(n,s,a,l),n.restore();break}case"fillSketch":this.fillSketch(n,s,i)}}fillSketch(e,r,i){let n=i.fillWeight;n<0&&(n=i.strokeWidth/2),e.save(),i.fillLineDash&&e.setLineDash(i.fillLineDash),i.fillLineDashOffset&&(e.lineDashOffset=i.fillLineDashOffset),e.strokeStyle=i.fill||"",e.lineWidth=n,this._drawToContext(e,r,i.fixedDecimalPlaceDigits),e.restore()}_drawToContext(e,r,i,n="nonzero"){e.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":e.moveTo(s[0],s[1]);break;case"bcurveTo":e.bezierCurveTo(s[0],s[1],s[2],s[3],s[4],s[5]);break;case"lineTo":e.lineTo(s[0],s[1])}}r.type==="fillPath"?e.fill(n):e.stroke()}get generator(){return this.gen}getDefaultOptions(){return this.gen.defaultOptions}line(e,r,i,n,a){let s=this.gen.line(e,r,i,n,a);return this.draw(s),s}rectangle(e,r,i,n,a){let s=this.gen.rectangle(e,r,i,n,a);return this.draw(s),s}ellipse(e,r,i,n,a){let s=this.gen.ellipse(e,r,i,n,a);return this.draw(s),s}circle(e,r,i,n){let a=this.gen.circle(e,r,i,n);return this.draw(a),a}linearPath(e,r){let i=this.gen.linearPath(e,r);return this.draw(i),i}polygon(e,r){let i=this.gen.polygon(e,r);return this.draw(i),i}arc(e,r,i,n,a,s,l=!1,u){let h=this.gen.arc(e,r,i,n,a,s,l,u);return this.draw(h),h}curve(e,r){let i=this.gen.curve(e,r);return this.draw(i),i}path(e,r){let i=this.gen.path(e,r);return this.draw(i),i}},m5="http://www.w3.org/2000/svg",TM=class{static{o(this,"ot")}constructor(e,r){this.svg=e,this.gen=new D1(r)}draw(e){let r=e.sets||[],i=e.options||this.getDefaultOptions(),n=this.svg.ownerDocument||window.document,a=n.createElementNS(m5,"g"),s=e.options.fixedDecimalPlaceDigits;for(let l of r){let u=null;switch(l.type){case"path":u=n.createElementNS(m5,"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(m5,"path"),u.setAttribute("d",this.opsToPath(l,s)),u.setAttribute("stroke","none"),u.setAttribute("stroke-width","0"),u.setAttribute("fill",i.fill||""),e.shape!=="curve"&&e.shape!=="polygon"||u.setAttribute("fill-rule","evenodd");break;case"fillSketch":u=this.fillSketch(n,l,i)}u&&a.appendChild(u)}return a}fillSketch(e,r,i){let n=i.fillWeight;n<0&&(n=i.strokeWidth/2);let a=e.createElementNS(m5,"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(e,r){return this.gen.opsToPath(e,r)}line(e,r,i,n,a){let s=this.gen.line(e,r,i,n,a);return this.draw(s)}rectangle(e,r,i,n,a){let s=this.gen.rectangle(e,r,i,n,a);return this.draw(s)}ellipse(e,r,i,n,a){let s=this.gen.ellipse(e,r,i,n,a);return this.draw(s)}circle(e,r,i,n){let a=this.gen.circle(e,r,i,n);return this.draw(a)}linearPath(e,r){let i=this.gen.linearPath(e,r);return this.draw(i)}polygon(e,r){let i=this.gen.polygon(e,r);return this.draw(i)}arc(e,r,i,n,a,s,l=!1,u){let h=this.gen.arc(e,r,i,n,a,s,l,u);return this.draw(h)}curve(e,r){let i=this.gen.curve(e,r);return this.draw(i)}path(e,r){let i=this.gen.path(e,r);return this.draw(i)}},rt={canvas:o((t,e)=>new bM(t,e),"canvas"),svg:o((t,e)=>new TM(t,e),"svg"),generator:o(t=>new D1(t),"generator"),newSeed:o(()=>D1.newSeed(),"newSeed")}});function hse(t,e){let{labelStyles:r}=tt(e);e.labelStyle=r;let i=mt(e),n=i;i||(n="anchor");let a=t.insert("g").attr("class",n).attr("id",e.domId||e.id),s=1,{cssStyles:l}=e,u=rt.svg(a),h=st(e,{fill:"black",stroke:"none",fillStyle:"solid"});e.look!=="handDrawn"&&(h.roughness=0);let f=u.circle(0,0,s*2,h),d=a.insert(()=>f,":first-child");return d.attr("class","anchor").attr("style",xi(l)),at(e,d),e.intersect=function(p){return Q.info("Circle intersect",e,s,p),et.circle(e,s,p)},a}var fse=P(()=>{"use strict";bt();zt();Xt();Ht();Yt();er();o(hse,"anchor")});function dse(t,e,r,i,n,a,s){let u=(t+r)/2,h=(e+i)/2,f=Math.atan2(i-e,r-t),d=(r-t)/2,p=(i-e)/2,m=d/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(f)*(s?-1:1),b=h-v*n*Math.cos(f)*(s?-1:1),T=Math.atan2((e-b)/a,(t-x)/n),k=Math.atan2((i-b)/a,(r-x)/n)-T;s&&k<0&&(k+=2*Math.PI),!s&&k>0&&(k-=2*Math.PI);let C=[];for(let E=0;E<20;E++){let S=E/19,L=T+S*k,M=x+n*Math.cos(L),I=b+a*Math.sin(L);C.push({x:M,y:I})}return C}function EVe(t,e,r){let[i,n]=[e,r].sort((a,s)=>s-a);return n*(1-Math.sqrt(1-(t/i/2)**2))}async function pse(t,e){let{labelStyles:r,nodeStyles:i}=tt(e);e.labelStyle=r;let n=e.padding??0,a=e.look==="neo"?16:n,s=e.look==="neo"?12:n,l=o(L=>L+s,"calcTotalHeight"),u=o(L=>{let M=L/2;return[M/(2.5+L/50),M]},"calcEllipseRadius"),{shapeSvg:h,bbox:f}=await vt(t,e,mt(e)),d=l(e?.height?e?.height:f.height),[p,m]=u(d),g=EVe(d,p,m),v=(e?.width?e?.width:f.width)+a*2+g-g,x=d,{cssStyles:b}=e,T=[{x:v/2,y:-x/2},{x:-v/2,y:-x/2},...dse(-v/2,-x/2,-v/2,x/2,p,m,!1),{x:v/2,y:x/2},...dse(v/2,x/2,v/2,-x/2,p,m,!0)],w=rt.svg(h),k=st(e,{});e.look!=="handDrawn"&&(k.roughness=0,k.fillStyle="solid");let C=rr(T),E=w.path(C,k),S=h.insert(()=>E,":first-child");return S.attr("class","basic label-container outer-path"),b&&e.look!=="handDrawn"&&S.selectAll("path").attr("style",b),i&&e.look!=="handDrawn"&&S.selectAll("path").attr("style",i),S.attr("transform",`translate(${p/2}, 0)`),at(e,S),e.intersect=function(L){return et.polygon(e,T,L)},h}var mse=P(()=>{"use strict";zt();Xt();Ht();Yt();o(dse,"generateArcPoints");o(EVe,"calculateArcSagitta");o(pse,"bowTieRect")});function ds(t,e,r,i){return t.insert("polygon",":first-child").attr("points",i.map(function(n){return n.x+","+n.y}).join(" ")).attr("class","label-container").attr("transform","translate("+-e/2+","+r/2+")")}var Vh=P(()=>{"use strict";o(ds,"insertPolygonShape")});async function gse(t,e){let{labelStyles:r,nodeStyles:i}=tt(e);e.labelStyle=r;let n=e.padding??0,a=e.look==="neo"?28:n,s=e.look==="neo"?24:n,{shapeSvg:l,bbox:u}=await vt(t,e,mt(e)),h=(e?.width??u.width)+(e.look==="neo"?a*2:a+k5),f=(e?.height??u.height)+(e.look==="neo"?s*2:s),d=0,p=h,m=-f,g=0,y=[{x:d+k5,y:m},{x:p,y:m},{x:p,y:g},{x:d,y:g},{x:d,y:m+k5},{x:d+k5,y:m}],v,{cssStyles:x}=e;if(e.look==="handDrawn"){let b=rt.svg(l),T=st(e,{}),w=rr(y),k=b.path(w,T);v=l.insert(()=>k,":first-child").attr("transform",`translate(${-h/2}, ${f/2})`),x&&v.attr("style",x)}else v=ds(l,h,f,y);return i&&v.attr("style",i),at(e,v),e.intersect=function(b){return et.polygon(e,y,b)},l}var k5,yse=P(()=>{"use strict";zt();Xt();Ht();Yt();Vh();zt();k5=12;o(gse,"card")});function vse(t,e){let{nodeStyles:r}=tt(e);e.label="";let i=t.insert("g").attr("class",mt(e)).attr("id",e.domId??e.id),{cssStyles:n}=e,a=Math.max(28,e.width??0),s=[{x:0,y:a/2},{x:a/2,y:0},{x:0,y:-a/2},{x:-a/2,y:0}],l=rt.svg(i),u=st(e,{});e.look!=="handDrawn"&&(u.roughness=0,u.fillStyle="solid");let h=rr(s),f=l.path(h,u),d=i.insert(()=>f,":first-child");return n&&e.look!=="handDrawn"&&d.selectAll("path").attr("style",n),r&&e.look!=="handDrawn"&&d.selectAll("path").attr("style",r),e.width=28,e.height=28,e.intersect=function(p){return et.polygon(e,s,p)},i}var xse=P(()=>{"use strict";Xt();Yt();Ht();zt();o(vse,"choice")});async function C5(t,e,r){let{labelStyles:i,nodeStyles:n}=tt(e);e.labelStyle=i;let{shapeSvg:a,bbox:s,halfPadding:l}=await vt(t,e,mt(e)),u=16,h=r?.padding??l,f=e.look==="neo"?s.width/2+u*2:s.width/2+h,d,{cssStyles:p}=e;if(e.look==="handDrawn"){let m=rt.svg(a),g=st(e,{}),y=m.circle(0,0,f*2,g);d=a.insert(()=>y,":first-child"),d.attr("class","basic label-container").attr("style",xi(p))}else d=a.insert("circle",":first-child").attr("class","basic label-container").attr("style",n).attr("r",f).attr("cx",0).attr("cy",0);return at(e,d),e.calcIntersect=function(m,g){let y=m.width/2;return et.circle(m,y,g)},e.intersect=function(m){return Q.info("Circle intersect",e,f,m),et.circle(e,f,m)},a}var CM=P(()=>{"use strict";Yt();bt();er();Xt();Ht();zt();o(C5,"circle")});function SVe(t){let e=Math.cos(Math.PI/4),r=Math.sin(Math.PI/4),i=t*2,n={x:i/2*e,y:i/2*r},a={x:-(i/2)*e,y:i/2*r},s={x:-(i/2)*e,y:-(i/2)*r},l={x:i/2*e,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 bse(t,e){let{labelStyles:r,nodeStyles:i}=tt(e);e.labelStyle=r,e.label="";let n=t.insert("g").attr("class",mt(e)).attr("id",e.domId??e.id),a=Math.max(30,e?.width??0),{cssStyles:s}=e,l=rt.svg(n),u=st(e,{});e.look!=="handDrawn"&&(u.roughness=0,u.fillStyle="solid");let h=l.circle(0,0,a*2,u),f=SVe(a),d=l.path(f,u),p=n.insert(()=>h,":first-child");return p.insert(()=>d),p.attr("class","outer-path"),s&&e.look!=="handDrawn"&&p.selectAll("path").attr("style",s),i&&e.look!=="handDrawn"&&p.selectAll("path").attr("style",i),at(e,p),e.intersect=function(m){return Q.info("crossedCircle intersect",e,{radius:a,point:m}),et.circle(e,a,m)},n}var Tse=P(()=>{"use strict";bt();zt();Ht();Yt();Xt();o(SVe,"createLine");o(bse,"crossedCircle")});function dd(t,e,r,i=100,n=0,a=180){let s=[],l=n*Math.PI/180,f=(a*Math.PI/180-l)/(i-1);for(let d=0;dk,":first-child").attr("stroke-opacity",0),C.insert(()=>T,":first-child"),C.attr("class","text"),p&&e.look!=="handDrawn"&&C.selectAll("path").attr("style",p),i&&e.look!=="handDrawn"&&C.selectAll("path").attr("style",i),C.attr("transform",`translate(${d}, 0)`),s.attr("transform",`translate(${-h/2+d-(a.x-(a.left??0))},${-f/2+(e.padding??0)/2-(a.y-(a.top??0))})`),at(e,C),e.intersect=function(E){return et.polygon(e,g,E)},n}var Cse=P(()=>{"use strict";zt();Xt();Ht();Yt();o(dd,"generateCirclePoints");o(kse,"curlyBraceLeft")});function pd(t,e,r,i=100,n=0,a=180){let s=[],l=n*Math.PI/180,f=(a*Math.PI/180-l)/(i-1);for(let d=0;dk,":first-child").attr("stroke-opacity",0),C.insert(()=>T,":first-child"),C.attr("class","text"),p&&e.look!=="handDrawn"&&C.selectAll("path").attr("style",p),i&&e.look!=="handDrawn"&&C.selectAll("path").attr("style",i),C.attr("transform",`translate(${-d}, 0)`),s.attr("transform",`translate(${-h/2+(e.padding??0)/2-(a.x-(a.left??0))},${-f/2+(e.padding??0)/2-(a.y-(a.top??0))})`),at(e,C),e.intersect=function(E){return et.polygon(e,g,E)},n}var Ese=P(()=>{"use strict";zt();Xt();Ht();Yt();o(pd,"generateCirclePoints");o(wse,"curlyBraceRight")});function ps(t,e,r,i=100,n=0,a=180){let s=[],l=n*Math.PI/180,f=(a*Math.PI/180-l)/(i-1);for(let d=0;dL,":first-child").attr("stroke-opacity",0),M.insert(()=>w,":first-child"),M.insert(()=>E,":first-child"),M.attr("class","text"),p&&e.look!=="handDrawn"&&M.selectAll("path").attr("style",p),i&&e.look!=="handDrawn"&&M.selectAll("path").attr("style",i),M.attr("transform",`translate(${d-d/4}, 0)`),s.attr("transform",`translate(${-h/2+(e.padding??0)/2-(a.x-(a.left??0))},${-f/2+(e.padding??0)/2-(a.y-(a.top??0))})`),at(e,M),e.intersect=function(I){return et.polygon(e,y,I)},n}var Ase=P(()=>{"use strict";zt();Xt();Ht();Yt();o(ps,"generateCirclePoints");o(Sse,"curlyBraces")});async function _se(t,e){let{labelStyles:r,nodeStyles:i}=tt(e);e.labelStyle=r;let n=e.padding??0,a=e.look==="neo"?16:n,s=e.look==="neo"?12:n,l=20,u=5,{shapeSvg:h,bbox:f}=await vt(t,e,mt(e)),d=Math.max(l,(f.width+a*2)*1.25,e?.width??0),p=Math.max(u,f.height+s*2,e?.height??0),m=p/2,{cssStyles:g}=e,y=rt.svg(h),v=st(e,{});e.look!=="handDrawn"&&(v.roughness=0,v.fillStyle="solid");let x=d,b=p,T=x-m,w=b/4,k=[{x:T,y:0},{x:w,y:0},{x:0,y:b/2},{x:w,y:b},{x:T,y:b},...D0(-T,-b/2,m,50,270,90)],C=rr(k),E=y.path(C,v),S=h.insert(()=>E,":first-child");return S.attr("class","basic label-container outer-path"),g&&e.look!=="handDrawn"&&S.selectChildren("path").attr("style",g),i&&e.look!=="handDrawn"&&S.selectChildren("path").attr("style",i),S.attr("transform",`translate(${-d/2}, ${-p/2})`),at(e,S),e.intersect=function(L){return et.polygon(e,k,L)},h}var Dse=P(()=>{"use strict";zt();Xt();Ht();Yt();o(_se,"curvedTrapezoid")});async function Nse(t,e){let{labelStyles:r,nodeStyles:i}=tt(e);e.labelStyle=r;let n=e.padding??0,a=e.look==="neo"?24:n,s=e.look==="neo"?24:n;if(e.width||e.height){let v=e.width??0;e.width=(e.width??0)-s,e.widthk,":first-child"),g=l.insert(()=>w,":first-child"),g.attr("class","basic label-container"),y&&g.attr("style",y)}else{let v=AVe(0,0,f,m,d,p);g=l.insert("path",":first-child").attr("d",v).attr("class","basic label-container outer-path").attr("style",xi(y)).attr("style",i)}return g.attr("label-offset-y",p),g.attr("transform",`translate(${-f/2}, ${-(m/2+p)})`),at(e,g),h.attr("transform",`translate(${-(u.width/2)-(u.x-(u.left??0))}, ${-(u.height/2)+(e.padding??0)/1.5-(u.y-(u.top??0))})`),e.intersect=function(v){let x=et.rect(e,v),b=x.x-(e.x??0);if(d!=0&&(Math.abs(b)<(e.width??0)/2||Math.abs(b)==(e.width??0)/2&&Math.abs(x.y-(e.y??0))>(e.height??0)/2-p)){let T=p*p*(1-b*b/(d*d));T>0&&(T=Math.sqrt(T)),T=p-T,v.y-(e.y??0)>0&&(T=-T),x.y+=T}return x},l}var AVe,_Ve,DVe,Lse,Rse,Ise=P(()=>{"use strict";zt();Xt();Ht();Yt();er();AVe=o((t,e,r,i,n,a)=>[`M${t},${e+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"),_Ve=o((t,e,r,i,n,a)=>[`M${t},${e+a}`,`M${t+r},${e+a}`,`a${n},${a} 0,0,0 ${-r},0`,`l0,${i}`,`a${n},${a} 0,0,0 ${r},0`,`l0,${-i}`].join(" "),"createOuterCylinderPathD"),DVe=o((t,e,r,i,n,a)=>[`M${t-r/2},${-i/2}`,`a${n},${a} 0,0,0 ${r},0`].join(" "),"createInnerCylinderPathD"),Lse=8,Rse=8;o(Nse,"cylinder")});async function Mse(t,e){let{labelStyles:r,nodeStyles:i}=tt(e);e.labelStyle=r;let n=e.look==="neo"?16:e.padding??0,a=e.look==="neo"?16:e.padding??0,{shapeSvg:s,bbox:l,label:u}=await vt(t,e,mt(e)),h=l.width+n,f=l.height+a,d=f*.2,p=-h/2,m=-f/2-d/2,{cssStyles:g}=e,y=rt.svg(s),v=st(e,{});e.look!=="handDrawn"&&(v.roughness=0,v.fillStyle="solid");let x=[{x:p,y:m+d},{x:-p,y:m+d},{x:-p,y:-m},{x:p,y:-m},{x:p,y:m},{x:-p,y:m},{x:-p,y:m+d}],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&&e.look!=="handDrawn"&&T.selectAll("path").attr("style",g),i&&e.look!=="handDrawn"&&T.selectAll("path").attr("style",i),u.attr("transform",`translate(${p+(e.padding??0)/2-(l.x-(l.left??0))}, ${m+d+(e.padding??0)/2-(l.y-(l.top??0))})`),at(e,T),e.intersect=function(w){return et.rect(e,w)},s}var Ose=P(()=>{"use strict";zt();Xt();Ht();Yt();o(Mse,"dividedRectangle")});async function Pse(t,e){let{labelStyles:r,nodeStyles:i}=tt(e),n=e.look==="neo"?12:5;e.labelStyle=r;let a=e.padding??0,s=e.look==="neo"?16:a,{shapeSvg:l,bbox:u}=await vt(t,e,mt(e)),h=(e?.width?e?.width/2:u.width/2)+(s??0),f=h-n,d,{cssStyles:p}=e;if(e.look==="handDrawn"){let m=rt.svg(l),g=st(e,{roughness:.2,strokeWidth:2.5}),y=st(e,{roughness:.2,strokeWidth:1.5}),v=m.circle(0,0,h*2,g),x=m.circle(0,0,f*2,y);d=l.insert("g",":first-child"),d.attr("class",xi(e.cssClasses)).attr("style",xi(p)),d.node()?.appendChild(v),d.node()?.appendChild(x)}else{d=l.insert("g",":first-child");let m=d.insert("circle",":first-child"),g=d.insert("circle");d.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",f).attr("cx",0).attr("cy",0)}return at(e,d),e.intersect=function(m){return Q.info("DoubleCircle intersect",e,h,m),et.circle(e,h,m)},l}var Bse=P(()=>{"use strict";bt();zt();Xt();Ht();Yt();er();o(Pse,"doublecircle")});function Fse(t,e,{config:{themeVariables:r}}){let{labelStyles:i,nodeStyles:n}=tt(e);e.label="",e.labelStyle=i;let a=t.insert("g").attr("class",mt(e)).attr("id",e.domId??e.id),s=7,{cssStyles:l}=e,u=rt.svg(a),{nodeBorder:h}=r,f=st(e,{fillStyle:"solid"});e.look!=="handDrawn"&&(f.roughness=0);let d=u.circle(0,0,s*2,f),p=a.insert(()=>d,":first-child");return p.selectAll("path").attr("style",`fill: ${h} !important;`),l&&l.length>0&&e.look!=="handDrawn"&&p.selectAll("path").attr("style",l),n&&e.look!=="handDrawn"&&p.selectAll("path").attr("style",n),at(e,p),e.intersect=function(m){return Q.info("filledCircle intersect",e,{radius:s,point:m}),et.circle(e,s,m)},a}var $se=P(()=>{"use strict";Yt();bt();Xt();Ht();zt();o(Fse,"filledCircle")});async function Vse(t,e){let{labelStyles:r,nodeStyles:i}=tt(e);e.labelStyle=r;let n=e.padding??0,a=e.look==="neo"?n*2:n;(e.width||e.height)&&(e.height=e?.height??0,e.heightx,":first-child").attr("transform",`translate(${-f/2}, ${f/2})`).attr("class","outer-path");return m&&e.look!=="handDrawn"&&b.selectChildren("path").attr("style",m),i&&e.look!=="handDrawn"&&b.selectChildren("path").attr("style",i),e.width=h,e.height=f,at(e,b),u.attr("transform",`translate(${-l.width/2-(l.x-(l.left??0))}, ${-f/2+(e.padding??0)/2+(l.y-(l.top??0))})`),e.intersect=function(T){return Q.info("Triangle intersect",e,p,T),et.polygon(e,p,T)},s}var zse,Gse,qse=P(()=>{"use strict";bt();zt();Xt();Ht();Yt();zt();zse=10,Gse=10;o(Vse,"flippedTriangle")});function Wse(t,e,{dir:r,config:{state:i,themeVariables:n}}){let{nodeStyles:a}=tt(e);e.label="";let s=t.insert("g").attr("class",mt(e)).attr("id",e.domId??e.id),{cssStyles:l}=e,u=Math.max(70,e?.width??0),h=Math.max(10,e?.height??0);r==="LR"&&(u=Math.max(10,e?.width??0),h=Math.max(70,e?.height??0));let f=-1*u/2,d=-1*h/2,p=rt.svg(s),m=st(e,{stroke:n.lineColor,fill:n.lineColor});e.look!=="handDrawn"&&(m.roughness=0,m.fillStyle="solid");let g=p.rectangle(f,d,u,h,m),y=s.insert(()=>g,":first-child");l&&e.look!=="handDrawn"&&y.selectAll("path").attr("style",l),a&&e.look!=="handDrawn"&&y.selectAll("path").attr("style",a),at(e,y);let v=i?.padding??0;return e.width&&e.height&&(e.width+=v/2||0,e.height+=v/2||0),e.intersect=function(x){return et.rect(e,x)},s}var Use=P(()=>{"use strict";Yt();Xt();Ht();zt();o(Wse,"forkJoin")});async function Hse(t,e){let{labelStyles:r,nodeStyles:i}=tt(e);e.labelStyle=r;let n=15,a=10,s=e.look==="neo"?16:e.padding??0,l=e.look==="neo"?12:e.padding??0;(e.width||e.height)&&(e.height=(e?.height??0)-l*2,e.heightb,":first-child");return T.attr("class","basic label-container outer-path"),m&&e.look!=="handDrawn"&&T.selectChildren("path").attr("style",m),i&&e.look!=="handDrawn"&&T.selectChildren("path").attr("style",i),at(e,T),e.intersect=function(w){return Q.info("Pill intersect",e,{radius:p,point:w}),et.polygon(e,v,w)},u}var Yse=P(()=>{"use strict";bt();zt();Xt();Ht();Yt();o(Hse,"halfRoundedRectangle")});async function jse(t,e){let{labelStyles:r,nodeStyles:i}=tt(e),n=e.look==="neo"?3.5:4;e.labelStyle=r;let a=e.padding??0,s=70,l=32,u=e.look==="neo"?s:a,h=e.look==="neo"?l:a;if(e.width||e.height){let T=(e.height??0)/n;e.width=(e?.width??0)-2*T-h,e.height=(e.height??0)-u}let{shapeSvg:f,bbox:d}=await vt(t,e,mt(e)),p=(e?.height?e?.height:d.height)+u,m=p/n,g=(e?.width?e?.width:d.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}=e;if(e.look==="handDrawn"){let b=rt.svg(f),T=st(e,{}),w=LVe(0,0,g,p,m),k=b.path(w,T);v=f.insert(()=>k,":first-child").attr("transform",`translate(${-g/2}, ${p/2})`),x&&v.attr("style",x)}else v=ds(f,g,p,y);return i&&v.attr("style",i),e.width=g,e.height=p,at(e,v),e.intersect=function(b){return et.polygon(e,y,b)},f}var LVe,Xse=P(()=>{"use strict";zt();Xt();Ht();Yt();Vh();LVe=o((t,e,r,i,n)=>[`M${t+n},${e}`,`L${t+r-n},${e}`,`L${t+r},${e-i/2}`,`L${t+r-n},${e-i}`,`L${t+n},${e-i}`,`L${t},${e-i/2}`,"Z"].join(" "),"createHexagonPathD");o(jse,"hexagon")});async function Kse(t,e){let{labelStyles:r,nodeStyles:i}=tt(e);e.label="",e.labelStyle=r;let{shapeSvg:n}=await vt(t,e,mt(e)),a=Math.max(30,e?.width??0),s=Math.max(30,e?.height??0),{cssStyles:l}=e,u=rt.svg(n),h=st(e,{});e.look!=="handDrawn"&&(h.roughness=0,h.fillStyle="solid");let f=[{x:0,y:0},{x:a,y:0},{x:0,y:s},{x:a,y:s}],d=rr(f),p=u.path(d,h),m=n.insert(()=>p,":first-child");return m.attr("class","basic label-container outer-path"),l&&e.look!=="handDrawn"&&m.selectChildren("path").attr("style",l),i&&e.look!=="handDrawn"&&m.selectChildren("path").attr("style",i),m.attr("transform",`translate(${-a/2}, ${-s/2})`),at(e,m),e.intersect=function(g){return Q.info("Pill intersect",e,{points:f}),et.polygon(e,f,g)},n}var Qse=P(()=>{"use strict";bt();zt();Xt();Ht();Yt();o(Kse,"hourglass")});async function Zse(t,e,{config:{themeVariables:r,flowchart:i}}){let{labelStyles:n}=tt(e);e.labelStyle=n;let a=e.assetHeight??48,s=e.assetWidth??48,l=Math.max(a,s),u=i?.wrappingWidth;e.width=Math.max(l,u??0);let{shapeSvg:h,bbox:f,label:d}=await vt(t,e,"icon-shape default"),p=e.pos==="t",m=l,g=l,{nodeBorder:y}=r,{stylesMap:v}=Su(e),x=-g/2,b=-m/2,T=e.label?8:0,w=rt.svg(h),k=st(e,{stroke:"none",fill:"none"});e.look!=="handDrawn"&&(k.roughness=0,k.fillStyle="solid");let C=w.rectangle(x,b,g,m,k),E=Math.max(g,f.width),S=m+f.height+T,L=w.rectangle(-E/2,-S/2,E,S,{...k,fill:"transparent",stroke:"none"}),M=h.insert(()=>C,":first-child"),I=h.insert(()=>L);if(e.icon){let A=h.append("g");A.html(`${await fo(e.icon,{height:l,width:l,fallbackPrefix:""})} `);let _=A.node().getBBox(),D=_.width,N=_.height,R=_.x,B=_.y;A.attr("transform",`translate(${-D/2-R},${p?f.height/2+T/2-N/2-B:-f.height/2-T/2-N/2-B})`),A.attr("style",`color: ${v.get("stroke")??y};`)}return d.attr("transform",`translate(${-f.width/2-(f.x-(f.left??0))},${p?-S/2:S/2-f.height})`),M.attr("transform",`translate(0,${p?f.height/2+T/2:-f.height/2-T/2})`),at(e,I),e.intersect=function(A){if(Q.info("iconSquare intersect",e,A),!e.label)return et.rect(e,A);let _=e.x??0,D=e.y??0,N=e.height??0,R=[];return p?R=[{x:_-f.width/2,y:D-N/2},{x:_+f.width/2,y:D-N/2},{x:_+f.width/2,y:D-N/2+f.height+T},{x:_+g/2,y:D-N/2+f.height+T},{x:_+g/2,y:D+N/2},{x:_-g/2,y:D+N/2},{x:_-g/2,y:D-N/2+f.height+T},{x:_-f.width/2,y:D-N/2+f.height+T}]:R=[{x:_-g/2,y:D-N/2},{x:_+g/2,y:D-N/2},{x:_+g/2,y:D-N/2+m},{x:_+f.width/2,y:D-N/2+m},{x:_+f.width/2/2,y:D+N/2},{x:_-f.width/2,y:D+N/2},{x:_-f.width/2,y:D-N/2+m},{x:_-g/2,y:D-N/2+m}],et.polygon(e,R,A)},h}var Jse=P(()=>{"use strict";Yt();bt();lu();Xt();Ht();zt();o(Zse,"icon")});async function eoe(t,e,{config:{themeVariables:r,flowchart:i}}){let{labelStyles:n}=tt(e);e.labelStyle=n;let a=e.assetHeight??48,s=e.assetWidth??48,l=Math.max(a,s),u=i?.wrappingWidth;e.width=Math.max(l,u??0);let{shapeSvg:h,bbox:f,label:d}=await vt(t,e,"icon-shape default"),p=20,m=e.label?8:0,g=e.pos==="t",{nodeBorder:y,mainBkg:v}=r,{stylesMap:x}=Su(e),b=rt.svg(h),T=st(e,{});e.look!=="handDrawn"&&(T.roughness=0,T.fillStyle="solid");let w=x.get("fill");T.stroke=w??v;let k=h.append("g");e.icon&&k.html(`${await fo(e.icon,{height:l,width:l,fallbackPrefix:""})} `);let C=k.node().getBBox(),E=C.width,S=C.height,L=C.x,M=C.y,I=Math.max(E,S)*Math.SQRT2+p*2,A=b.circle(0,0,I,T),_=Math.max(I,f.width),D=I+f.height+m,N=b.rectangle(-_/2,-D/2,_,D,{...T,fill:"transparent",stroke:"none"}),R=h.insert(()=>A,":first-child"),B=h.insert(()=>N);return k.attr("transform",`translate(${-E/2-L},${g?f.height/2+m/2-S/2-M:-f.height/2-m/2-S/2-M})`),k.attr("style",`color: ${x.get("stroke")??y};`),d.attr("transform",`translate(${-f.width/2-(f.x-(f.left??0))},${g?-D/2:D/2-f.height})`),R.attr("transform",`translate(0,${g?f.height/2+m/2:-f.height/2-m/2})`),at(e,B),e.intersect=function(O){return Q.info("iconSquare intersect",e,O),et.rect(e,O)},h}var toe=P(()=>{"use strict";Yt();bt();lu();Xt();Ht();zt();o(eoe,"iconCircle")});var Co,R0=P(()=>{"use strict";Co=o((t,e,r,i,n)=>["M",t+n,e,"H",t+r-n,"A",n,n,0,0,1,t+r,e+n,"V",e+i-n,"A",n,n,0,0,1,t+r-n,e+i,"H",t+n,"A",n,n,0,0,1,t,e+i-n,"V",e+n,"A",n,n,0,0,1,t+n,e,"Z"].join(" "),"createRoundedRectPathD")});async function roe(t,e,{config:{themeVariables:r,flowchart:i}}){let{labelStyles:n}=tt(e);e.labelStyle=n;let a=e.assetHeight??48,s=e.assetWidth??48,l=Math.max(a,s),u=i?.wrappingWidth;e.width=Math.max(l,u??0);let{shapeSvg:h,bbox:f,halfPadding:d,label:p}=await vt(t,e,"icon-shape default"),m=e.pos==="t",g=l+d*2,y=l+d*2,{nodeBorder:v,mainBkg:x}=r,{stylesMap:b}=Su(e),T=-y/2,w=-g/2,k=e.label?8:0,C=rt.svg(h),E=st(e,{});e.look!=="handDrawn"&&(E.roughness=0,E.fillStyle="solid");let S=b.get("fill");E.stroke=S??x;let L=C.path(Co(T,w,y,g,5),E),M=Math.max(y,f.width),I=g+f.height+k,A=C.rectangle(-M/2,-I/2,M,I,{...E,fill:"transparent",stroke:"none"}),_=h.insert(()=>L,":first-child").attr("class","icon-shape2"),D=h.insert(()=>A);if(e.icon){let N=h.append("g");N.html(`${await fo(e.icon,{height:l,width:l,fallbackPrefix:""})} `);let R=N.node().getBBox(),B=R.width,O=R.height,$=R.x,z=R.y;N.attr("transform",`translate(${-B/2-$},${m?f.height/2+k/2-O/2-z:-f.height/2-k/2-O/2-z})`),N.attr("style",`color: ${b.get("stroke")??v};`)}return p.attr("transform",`translate(${-f.width/2-(f.x-(f.left??0))},${m?-I/2:I/2-f.height})`),_.attr("transform",`translate(0,${m?f.height/2+k/2:-f.height/2-k/2})`),at(e,D),e.intersect=function(N){if(Q.info("iconSquare intersect",e,N),!e.label)return et.rect(e,N);let R=e.x??0,B=e.y??0,O=e.height??0,$=[];return m?$=[{x:R-f.width/2,y:B-O/2},{x:R+f.width/2,y:B-O/2},{x:R+f.width/2,y:B-O/2+f.height+k},{x:R+y/2,y:B-O/2+f.height+k},{x:R+y/2,y:B+O/2},{x:R-y/2,y:B+O/2},{x:R-y/2,y:B-O/2+f.height+k},{x:R-f.width/2,y:B-O/2+f.height+k}]:$=[{x:R-y/2,y:B-O/2},{x:R+y/2,y:B-O/2},{x:R+y/2,y:B-O/2+g},{x:R+f.width/2,y:B-O/2+g},{x:R+f.width/2/2,y:B+O/2},{x:R-f.width/2,y:B+O/2},{x:R-f.width/2,y:B-O/2+g},{x:R-y/2,y:B-O/2+g}],et.polygon(e,$,N)},h}var ioe=P(()=>{"use strict";Yt();bt();lu();Xt();Ht();R0();zt();o(roe,"iconRounded")});async function noe(t,e,{config:{themeVariables:r,flowchart:i}}){let{labelStyles:n}=tt(e);e.labelStyle=n;let a=e.assetHeight??48,s=e.assetWidth??48,l=Math.max(a,s),u=i?.wrappingWidth;e.width=Math.max(l,u??0);let{shapeSvg:h,bbox:f,halfPadding:d,label:p}=await vt(t,e,"icon-shape default"),m=e.pos==="t",g=l+d*2,y=l+d*2,{nodeBorder:v,mainBkg:x}=r,{stylesMap:b}=Su(e),T=-y/2,w=-g/2,k=e.label?8:0,C=rt.svg(h),E=st(e,{});e.look!=="handDrawn"&&(E.roughness=0,E.fillStyle="solid");let S=b.get("fill");E.stroke=S??x;let L=C.path(Co(T,w,y,g,.1),E),M=Math.max(y,f.width),I=g+f.height+k,A=C.rectangle(-M/2,-I/2,M,I,{...E,fill:"transparent",stroke:"none"}),_=h.insert(()=>L,":first-child"),D=h.insert(()=>A);if(e.icon){let N=h.append("g");N.html(`${await fo(e.icon,{height:l,width:l,fallbackPrefix:""})} `);let R=N.node().getBBox(),B=R.width,O=R.height,$=R.x,z=R.y;N.attr("transform",`translate(${-B/2-$},${m?f.height/2+k/2-O/2-z:-f.height/2-k/2-O/2-z})`),N.attr("style",`color: ${b.get("stroke")??v};`)}return p.attr("transform",`translate(${-f.width/2-(f.x-(f.left??0))},${m?-I/2:I/2-f.height})`),_.attr("transform",`translate(0,${m?f.height/2+k/2:-f.height/2-k/2})`),at(e,D),e.intersect=function(N){if(Q.info("iconSquare intersect",e,N),!e.label)return et.rect(e,N);let R=e.x??0,B=e.y??0,O=e.height??0,$=[];return m?$=[{x:R-f.width/2,y:B-O/2},{x:R+f.width/2,y:B-O/2},{x:R+f.width/2,y:B-O/2+f.height+k},{x:R+y/2,y:B-O/2+f.height+k},{x:R+y/2,y:B+O/2},{x:R-y/2,y:B+O/2},{x:R-y/2,y:B-O/2+f.height+k},{x:R-f.width/2,y:B-O/2+f.height+k}]:$=[{x:R-y/2,y:B-O/2},{x:R+y/2,y:B-O/2},{x:R+y/2,y:B-O/2+g},{x:R+f.width/2,y:B-O/2+g},{x:R+f.width/2/2,y:B+O/2},{x:R-f.width/2,y:B+O/2},{x:R-f.width/2,y:B-O/2+g},{x:R-y/2,y:B-O/2+g}],et.polygon(e,$,N)},h}var aoe=P(()=>{"use strict";Yt();bt();lu();Xt();R0();Ht();zt();o(noe,"iconSquare")});async function soe(t,e,{config:{flowchart:r}}){let i=new Image;i.src=e?.img??"",await i.decode();let n=Number(i.naturalWidth.toString().replace("px","")),a=Number(i.naturalHeight.toString().replace("px",""));e.imageAspectRatio=n/a;let{labelStyles:s}=tt(e);e.labelStyle=s;let l=r?.wrappingWidth;e.defaultWidth=r?.wrappingWidth;let u=Math.max(e.label?l??0:0,e?.assetWidth??n),h=e.constraint==="on"&&e?.assetHeight?e.assetHeight*e.imageAspectRatio:u,f=e.constraint==="on"?h/e.imageAspectRatio:e?.assetHeight??a;e.width=Math.max(h,l??0);let{shapeSvg:d,bbox:p,label:m}=await vt(t,e,"image-shape default"),g=e.pos==="t",y=-h/2,v=-f/2,x=e.label?8:0,b=rt.svg(d),T=st(e,{});e.look!=="handDrawn"&&(T.roughness=0,T.fillStyle="solid");let w=b.rectangle(y,v,h,f,T),k=Math.max(h,p.width),C=f+p.height+x,E=b.rectangle(-k/2,-C/2,k,C,{...T,fill:"none",stroke:"none"}),S=d.insert(()=>w,":first-child"),L=d.insert(()=>E);if(e.img){let M=d.append("image");M.attr("href",e.img),M.attr("width",h),M.attr("height",f),M.attr("preserveAspectRatio","none"),M.attr("transform",`translate(${-h/2},${g?C/2-f:-C/2})`)}return m.attr("transform",`translate(${-p.width/2-(p.x-(p.left??0))},${g?-f/2-p.height/2-x/2:f/2-p.height/2+x/2})`),S.attr("transform",`translate(0,${g?p.height/2+x/2:-p.height/2-x/2})`),at(e,L),e.intersect=function(M){if(Q.info("iconSquare intersect",e,M),!e.label)return et.rect(e,M);let I=e.x??0,A=e.y??0,_=e.height??0,D=[];return g?D=[{x:I-p.width/2,y:A-_/2},{x:I+p.width/2,y:A-_/2},{x:I+p.width/2,y:A-_/2+p.height+x},{x:I+h/2,y:A-_/2+p.height+x},{x:I+h/2,y:A+_/2},{x:I-h/2,y:A+_/2},{x:I-h/2,y:A-_/2+p.height+x},{x:I-p.width/2,y:A-_/2+p.height+x}]:D=[{x:I-h/2,y:A-_/2},{x:I+h/2,y:A-_/2},{x:I+h/2,y:A-_/2+f},{x:I+p.width/2,y:A-_/2+f},{x:I+p.width/2/2,y:A+_/2},{x:I-p.width/2,y:A+_/2},{x:I-p.width/2,y:A-_/2+f},{x:I-h/2,y:A-_/2+f}],et.polygon(e,D,M)},d}var ooe=P(()=>{"use strict";Yt();bt();Xt();Ht();zt();o(soe,"imageSquare")});async function loe(t,e){let{labelStyles:r,nodeStyles:i}=tt(e);e.labelStyle=r;let n=e.padding??0,a=n,s=e.look==="neo"?n*2:n,{shapeSvg:l,bbox:u}=await vt(t,e,mt(e)),h=Math.max(u.width+(s??0)*2,e?.width??0),f=Math.max(u.height+(a??0)*2,e?.height??0),d=[{x:0,y:0},{x:h,y:0},{x:h+3*f/6,y:-f},{x:-3*f/6,y:-f}],p,{cssStyles:m}=e;if(e.look==="handDrawn"){let g=rt.svg(l),y=st(e,{}),v=rr(d),x=g.path(v,y);p=l.insert(()=>x,":first-child").attr("transform",`translate(${-h/2}, ${f/2})`),m&&p.attr("style",m)}else p=ds(l,h,f,d);return i&&p.attr("style",i),e.width=h,e.height=f,at(e,p),e.intersect=function(g){return et.polygon(e,d,g)},l}var coe=P(()=>{"use strict";zt();Xt();Ht();Yt();Vh();o(loe,"inv_trapezoid")});async function qh(t,e,r){let{labelStyles:i,nodeStyles:n}=tt(e);e.labelStyle=i;let{shapeSvg:a,bbox:s}=await vt(t,e,mt(e)),l=Math.max(s.width+r.labelPaddingX*2,e?.width||0),u=Math.max(s.height+r.labelPaddingY*2,e?.height||0),h=-l/2,f=-u/2,d,{rx:p,ry:m}=e,{cssStyles:g}=e;if(r?.rx&&r.ry&&(p=r.rx,m=r.ry),e.look==="handDrawn"){let y=rt.svg(a),v=st(e,{}),x=p||m?y.path(Co(h,f,l,u,p||0),v):y.rectangle(h,f,l,u,v);d=a.insert(()=>x,":first-child"),d.attr("class","basic label-container").attr("style",xi(g))}else d=a.insert("rect",":first-child"),d.attr("class","basic label-container").attr("style",n).attr("rx",xi(p)).attr("ry",xi(m)).attr("x",h).attr("y",f).attr("width",l).attr("height",u);return at(e,d),e.calcIntersect=function(y,v){return et.rect(y,v)},e.intersect=function(y){return et.rect(e,y)},a}var L1=P(()=>{"use strict";zt();Xt();R0();Ht();Yt();er();o(qh,"drawRect")});async function uoe(t,e){let{shapeSvg:r,bbox:i,label:n}=await vt(t,e,"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))})`),at(e,a),e.intersect=function(u){return et.rect(e,u)},r}var hoe=P(()=>{"use strict";L1();zt();Xt();o(uoe,"labelRect")});async function foe(t,e){let{labelStyles:r,nodeStyles:i}=tt(e);e.labelStyle=r;let n=e.padding??0,a=n,s=e.look==="neo"?n*2:n,{shapeSvg:l,bbox:u}=await vt(t,e,mt(e)),h=(e?.height??u.height)+a,f=(e?.width??u.width)+s,d=[{x:0,y:0},{x:f+3*h/6,y:0},{x:f,y:-h},{x:-(3*h)/6,y:-h}],p,{cssStyles:m}=e;if(e.look==="handDrawn"){let g=rt.svg(l),y=st(e,{}),v=rr(d),x=g.path(v,y);p=l.insert(()=>x,":first-child").attr("transform",`translate(${-f/2}, ${h/2})`),m&&p.attr("style",m)}else p=ds(l,f,h,d);return i&&p.attr("style",i),e.width=f,e.height=h,at(e,p),e.intersect=function(g){return et.polygon(e,d,g)},l}var doe=P(()=>{"use strict";zt();Xt();Ht();Yt();Vh();o(foe,"lean_left")});async function poe(t,e){let{labelStyles:r,nodeStyles:i}=tt(e);e.labelStyle=r;let n=e.padding??0,a=n,s=e.look==="neo"?n*2:n,{shapeSvg:l,bbox:u}=await vt(t,e,mt(e)),h=(e?.height??u.height)+a,f=(e?.width??u.width)+s,d=[{x:-3*h/6,y:0},{x:f,y:0},{x:f+3*h/6,y:-h},{x:0,y:-h}],p,{cssStyles:m}=e;if(e.look==="handDrawn"){let g=rt.svg(l),y=st(e,{}),v=rr(d),x=g.path(v,y);p=l.insert(()=>x,":first-child").attr("transform",`translate(${-f/2}, ${h/2})`),m&&p.attr("style",m)}else p=ds(l,f,h,d);return i&&p.attr("style",i),e.width=f,e.height=h,at(e,p),e.intersect=function(g){return et.polygon(e,d,g)},l}var moe=P(()=>{"use strict";zt();Xt();Ht();Yt();Vh();o(poe,"lean_right")});function goe(t,e){let{labelStyles:r,nodeStyles:i}=tt(e);e.label="",e.labelStyle=r;let n=t.insert("g").attr("class",mt(e)).attr("id",e.domId??e.id),{cssStyles:a}=e,s=Math.max(35,e?.width??0),l=Math.max(35,e?.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}],f=rt.svg(n),d=st(e,{});e.look!=="handDrawn"&&(d.roughness=0,d.fillStyle="solid");let p=rr(h),m=f.path(p,d),g=n.insert(()=>m,":first-child");return g.attr("class","outer-path"),a&&e.look!=="handDrawn"&&g.selectAll("path").attr("style",a),i&&e.look!=="handDrawn"&&g.selectAll("path").attr("style",i),g.attr("transform",`translate(-${s/2},${-l})`),at(e,g),e.intersect=function(y){return Q.info("lightningBolt intersect",e,y),et.polygon(e,h,y)},n}var yoe=P(()=>{"use strict";bt();zt();Ht();Yt();Xt();zt();o(goe,"lightningBolt")});async function boe(t,e){let{labelStyles:r,nodeStyles:i}=tt(e);e.labelStyle=r;let n=e.padding??0,a=e.look==="neo"?16:n,s=e.look==="neo"?24:n;if(e.width||e.height){let x=e.width??0;e.width=(e.width??0)-a,e.widthC,":first-child").attr("class","line"),y=l.insert(()=>k,":first-child"),y.attr("class","basic label-container"),v&&y.attr("style",v)}else{let x=RVe(0,0,f,m,d,p,g);y=l.insert("path",":first-child").attr("d",x).attr("class","basic label-container outer-path").attr("style",xi(v)).attr("style",i)}return y.attr("label-offset-y",p),y.attr("transform",`translate(${-f/2}, ${-(m/2+p)})`),at(e,y),h.attr("transform",`translate(${-(u.width/2)-(u.x-(u.left??0))}, ${-(u.height/2)+p-(u.y-(u.top??0))})`),e.intersect=function(x){let b=et.rect(e,x),T=b.x-(e.x??0);if(d!=0&&(Math.abs(T)<(e.width??0)/2||Math.abs(T)==(e.width??0)/2&&Math.abs(b.y-(e.y??0))>(e.height??0)/2-p)){let w=p*p*(1-T*T/(d*d));w>0&&(w=Math.sqrt(w)),w=p-w,x.y-(e.y??0)>0&&(w=-w),b.y+=w}return b},l}var RVe,NVe,IVe,voe,xoe,Toe=P(()=>{"use strict";zt();Xt();Ht();Yt();er();RVe=o((t,e,r,i,n,a,s)=>[`M${t},${e+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${t},${e+a+s}`,`a${n},${a} 0,0,0 ${r},0`].join(" "),"createCylinderPathD"),NVe=o((t,e,r,i,n,a,s)=>[`M${t},${e+a}`,`M${t+r},${e+a}`,`a${n},${a} 0,0,0 ${-r},0`,`l0,${i}`,`a${n},${a} 0,0,0 ${r},0`,`l0,${-i}`,`M${t},${e+a+s}`,`a${n},${a} 0,0,0 ${r},0`].join(" "),"createOuterCylinderPathD"),IVe=o((t,e,r,i,n,a)=>[`M${t-r/2},${-i/2}`,`a${n},${a} 0,0,0 ${r},0`].join(" "),"createInnerCylinderPathD"),voe=10,xoe=10;o(boe,"linedCylinder")});async function koe(t,e){let{labelStyles:r,nodeStyles:i}=tt(e);e.labelStyle=r;let n=e.padding??0,a=e.look==="neo"?16:n,s=e.look==="neo"?12:n;if(e.width||e.height){let w=e.width;e.width=(w??0)*10/11-a*2,e.width<10&&(e.width=10),e.height=(e?.height??0)-s*2,e.height<10&&(e.height=10)}let{shapeSvg:l,bbox:u,label:h}=await vt(t,e,mt(e)),f=(e?.width?e?.width:u.width)+(a??0)*2,d=(e?.height?e?.height:u.height)+(s??0)*2,p=e.look==="neo"?d/4:d/8,m=d+p,{cssStyles:g}=e,y=rt.svg(l),v=st(e,{});e.look!=="handDrawn"&&(v.roughness=0,v.fillStyle="solid");let x=[{x:-f/2-f/2*.1,y:-m/2},{x:-f/2-f/2*.1,y:m/2},...Ml(-f/2-f/2*.1,m/2,f/2+f/2*.1,m/2,p,.8),{x:f/2+f/2*.1,y:-m/2},{x:-f/2-f/2*.1,y:-m/2},{x:-f/2,y:-m/2},{x:-f/2,y:m/2*1.1},{x:-f/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&&e.look!=="handDrawn"&&T.selectAll("path").attr("style",g),i&&e.look!=="handDrawn"&&T.selectAll("path").attr("style",i),T.attr("transform",`translate(0,${-p/2})`),h.attr("transform",`translate(${-f/2+(e.padding??0)+f/2*.1/2-(u.x-(u.left??0))},${-d/2+(e.padding??0)-p/2-(u.y-(u.top??0))})`),at(e,T),e.intersect=function(w){return et.polygon(e,x,w)},l}var Coe=P(()=>{"use strict";zt();Xt();Yt();Ht();o(koe,"linedWaveEdgedRect")});async function woe(t,e){let{labelStyles:r,nodeStyles:i}=tt(e);e.labelStyle=r;let n=e.padding??0,a=e.look==="neo"?16:n,s=e.look==="neo"?12:n,l=e.look==="neo"?10:5;(e.width||e.height)&&(e.width=Math.max((e?.width??0)-a*2-2*l,10),e.height=Math.max((e?.height??0)-s*2-2*l,10));let{shapeSvg:u,bbox:h,label:f}=await vt(t,e,mt(e)),d=(e?.width?e?.width:h.width)+a*2+2*l,p=(e?.height?e?.height:h.height)+s*2+2*l,m=d-2*l,g=p-2*l,y=-m/2,v=-g/2,{cssStyles:x}=e,b=rt.svg(u),T=st(e,{}),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}],k=[{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}];e.look!=="handDrawn"&&(T.roughness=0,T.fillStyle="solid");let C=rr(w),E=b.path(C,T),S=rr(k),L=b.path(S,T);e.look!=="handDrawn"&&(E=iM(E),L=iM(L));let M=u.insert("g",":first-child");return M.insert(()=>E),M.insert(()=>L),M.attr("class","basic label-container outer-path"),x&&e.look!=="handDrawn"&&M.selectAll("path").attr("style",x),i&&e.look!=="handDrawn"&&M.selectAll("path").attr("style",i),f.attr("transform",`translate(${-(h.width/2)-l-(h.x-(h.left??0))}, ${-(h.height/2)+l-(h.y-(h.top??0))})`),at(e,M),e.intersect=function(I){return et.polygon(e,w,I)},u}var Eoe=P(()=>{"use strict";zt();Ht();Yt();Xt();o(woe,"multiRect")});async function Soe(t,e){let{labelStyles:r,nodeStyles:i}=tt(e);e.labelStyle=r;let{shapeSvg:n,bbox:a,label:s}=await vt(t,e,mt(e)),l=e.padding??0,u=e.look==="neo"?16:l,h=e.look==="neo"?12:l,f=!0;(e.width||e.height)&&(f=!1,e.width=(e?.width??0)-u*2,e.height=(e?.height??0)-h*3);let d=Math.max(a.width,e?.width??0)+u*2,p=Math.max(a.height,e?.height??0)+h*3,m=e.look==="neo"?p/4:p/8,g=p+(f?m/2:-m/2),y=-d/2,v=-g/2,x=10,{cssStyles:b}=e,T=Ml(y-x,v+g+x,y+d-x,v+g+x,m,.8),w=T?.[T.length-1],k=[{x:y-x,y:v+x},{x:y-x,y:v+g+x},...T,{x:y+d-x,y:w.y-x},{x:y+d,y:w.y-x},{x:y+d,y:w.y-2*x},{x:y+d+x,y:w.y-2*x},{x:y+d+x,y:v-x},{x:y+x,y:v-x},{x:y+x,y:v},{x:y,y:v},{x:y,y:v+x}],C=[{x:y,y:v+x},{x:y+d-x,y:v+x},{x:y+d-x,y:w.y-x},{x:y+d,y:w.y-x},{x:y+d,y:v},{x:y,y:v}],E=rt.svg(n),S=st(e,{});e.look!=="handDrawn"&&(S.roughness=0,S.fillStyle="solid");let L=rr(k),M=E.path(L,S),I=rr(C),A=E.path(I,S),_=n.insert(()=>M,":first-child");return _.insert(()=>A),_.attr("class","basic label-container outer-path"),b&&e.look!=="handDrawn"&&_.selectAll("path").attr("style",b),i&&e.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))})`),at(e,_),e.intersect=function(D){return et.polygon(e,k,D)},n}var Aoe=P(()=>{"use strict";zt();Xt();Yt();Ht();o(Soe,"multiWaveEdgedRectangle")});async function _oe(t,e,{config:{themeVariables:r}}){let{labelStyles:i,nodeStyles:n}=tt(e);e.labelStyle=i,e.useHtmlLabels||Or(Lt())||(e.centerLabel=!0);let{shapeSvg:s,bbox:l,label:u}=await vt(t,e,mt(e)),h=Math.max(l.width+(e.padding??0)*2,e?.width??0),f=Math.max(l.height+(e.padding??0)*2,e?.height??0),d=-h/2,p=-f/2,{cssStyles:m}=e,g=rt.svg(s),y=st(e,{fill:r.noteBkgColor,stroke:r.noteBorderColor});e.look!=="handDrawn"&&(y.roughness=0,y.fillStyle="solid");let v=g.rectangle(d,p,h,f,y),x=s.insert(()=>v,":first-child");return x.attr("class","basic label-container outer-path"),u.attr("class","label noteLabel"),m&&e.look!=="handDrawn"&&x.selectAll("path").attr("style",m),n&&e.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))})`),at(e,x),e.intersect=function(b){return et.rect(e,b)},s}var Doe=P(()=>{"use strict";Yt();Xt();Ht();zt();Sr();Sr();o(_oe,"note")});async function Loe(t,e){let{labelStyles:r,nodeStyles:i}=tt(e);e.labelStyle=r;let{shapeSvg:n,bbox:a}=await vt(t,e,mt(e)),s=a.width+(e.padding??0),l=a.height+(e.padding??0),u=s+l,h=.5,f=[{x:u/2,y:0},{x:u,y:-u/2},{x:u/2,y:-u},{x:0,y:-u/2}],d,{cssStyles:p}=e;if(e.look==="handDrawn"){let m=rt.svg(n),g=st(e,{}),y=MVe(0,0,u),v=m.path(y,g);d=n.insert(()=>v,":first-child").attr("transform",`translate(${-u/2+h}, ${u/2})`),p&&d.attr("style",p)}else d=ds(n,u,u,f),d.attr("transform",`translate(${-u/2+h}, ${u/2})`);return i&&d.attr("style",i),at(e,d),e.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=et.polygon(m,v,g);return{x:x.x-.5,y:x.y-.5}},e.intersect=function(m){return this.calcIntersect(e,m)},n}var MVe,Roe=P(()=>{"use strict";zt();Xt();Ht();Yt();Vh();MVe=o((t,e,r)=>[`M${t+r/2},${e}`,`L${t+r},${e-r/2}`,`L${t+r/2},${e-r}`,`L${t},${e-r/2}`,"Z"].join(" "),"createDecisionBoxPathD");o(Loe,"question")});async function Noe(t,e){let{labelStyles:r,nodeStyles:i}=tt(e);e.labelStyle=r;let n=e.padding??0,a=e.look==="neo"?21:n??0,s=e.look==="neo"?12:n??0,{shapeSvg:l,bbox:u,label:h}=await vt(t,e,mt(e)),f=(e?.width??u.width)+(e.look==="neo"?a*2:a),d=(e?.height??u.height)+(e.look==="neo"?s*2:s),p=-f/2,m=-d/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}=e,x=rt.svg(l),b=st(e,{});e.look!=="handDrawn"&&(b.roughness=0,b.fillStyle="solid");let T=rr(y),w=x.path(T,b),k=l.insert(()=>w,":first-child");return k.attr("class","basic label-container outer-path"),v&&e.look!=="handDrawn"&&k.selectAll("path").attr("style",v),i&&e.look!=="handDrawn"&&k.selectAll("path").attr("style",i),k.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))})`),at(e,k),e.intersect=function(C){return et.polygon(e,y,C)},l}var Ioe=P(()=>{"use strict";zt();Xt();Ht();Yt();o(Noe,"rect_left_inv_arrow")});var OVe,Dc,w5=P(()=>{"use strict";Sr();Ut();To();OVe=o(async(t,e,r,i=!1,n=!1)=>{let a=e||"";typeof a=="object"&&(a=a[0]);let s=ge(),l=Or(s);return await Vi(t,a,{style:r,isTitle:i,useHtmlLabels:l,markdown:!1,isNode:n,width:Number.POSITIVE_INFINITY},s)},"createLabel"),Dc=OVe});async function Moe(t,e){let{labelStyles:r,nodeStyles:i}=tt(e);e.labelStyle=r;let n;e.cssClasses?n="node "+e.cssClasses:n="node default";let a=t.insert("g").attr("class",n).attr("id",e.domId||e.id),s=a.insert("g"),l=a.insert("g").attr("class","label").attr("style",i),u=e.description,h=e.label,f=await Dc(l,h,e.labelStyle,!0,!0),d={width:0,height:0};if(Or(ge())){let S=f.children[0],L=Ze(f);d=S.getBoundingClientRect(),L.attr("width",d.width),L.attr("height",d.height)}Q.info("Text 2",u);let p=u||[],m=f.getBBox(),g=await Dc(l,Array.isArray(p)?p.join(" "):p,e.labelStyle,!0,!0),y=g.children[0],v=Ze(g);d=y.getBoundingClientRect(),v.attr("width",d.width),v.attr("height",d.height);let x=(e.padding||0)/2;Ze(g).attr("transform","translate( "+(d.width>m.width?0:(m.width-d.width)/2)+", "+(m.height+x+5)+")"),Ze(f).attr("transform","translate( "+(d.width(Q.debug("Rough node insert CXC",M),I),":first-child"),C=a.insert(()=>(Q.debug("Rough node insert CXC",M),M),":first-child")}else C=s.insert("rect",":first-child"),E=s.insert("line"),C.attr("class","outer title-state").attr("style",i).attr("x",-d.width/2-x).attr("y",-d.height/2-x).attr("width",d.width+(e.padding||0)).attr("height",d.height+(e.padding||0)),E.attr("class","divider").attr("x1",-d.width/2-x).attr("x2",d.width/2+x).attr("y1",-d.height/2-x+m.height+x).attr("y2",-d.height/2-x+m.height+x);return at(e,C),e.intersect=function(S){return et.rect(e,S)},a}var Ooe=P(()=>{"use strict";Pr();zt();w5();Xt();Ht();Yt();Ut();R0();bt();Sr();o(Moe,"rectWithTitle")});async function Poe(t,e,{config:{themeVariables:r}}){let i=r?.radius??5,n={rx:i,ry:i,classes:"",labelPaddingX:(e?.padding??0)*1,labelPaddingY:(e?.padding??0)*1};return qh(t,e,n)}var Boe=P(()=>{"use strict";L1();o(Poe,"roundedRect")});async function Foe(t,e){let{labelStyles:r,nodeStyles:i}=tt(e);e.labelStyle=r;let n=e.look==="neo"?16:e.padding??0,a=e.look==="neo"?12:e.padding??0,{shapeSvg:s,bbox:l,label:u}=await vt(t,e,mt(e)),h=(e?.width??l.width)+n*2+(e.look==="neo"?N0:N0*2),f=(e?.height??l.height)+a*2,d=h-N0,p=f,m=N0-h/2,g=-f/2,{cssStyles:y}=e,v=rt.svg(s),x=st(e,{});e.look!=="handDrawn"&&(x.roughness=0,x.fillStyle="solid");let b=[{x:m,y:g},{x:m+d,y:g},{x:m+d,y:g+p},{x:m-N0,y:g+p},{x:m-N0,y:g},{x:m,y:g},{x:m,y:g+p}],T=v.polygon(b.map(k=>[k.x,k.y]),x),w=s.insert(()=>T,":first-child");return w.attr("class","basic label-container outer-path").attr("style",xi(y)),i&&e.look!=="handDrawn"&&w.selectAll("path").attr("style",i),y&&e.look!=="handDrawn"&&w.selectAll("path").attr("style",i),u.attr("transform",`translate(${N0/2-l.width/2-(l.x-(l.left??0))}, ${-(l.height/2)-(l.y-(l.top??0))})`),at(e,w),e.intersect=function(k){return et.rect(e,k)},s}var N0,$oe=P(()=>{"use strict";zt();Xt();Ht();Yt();er();N0=8;o(Foe,"shadedProcess")});async function zoe(t,e){let{labelStyles:r,nodeStyles:i}=tt(e);e.labelStyle=r;let n=e.padding??0,a=e.look==="neo"?16:n,s=e.look==="neo"?12:n;(e.width||e.height)&&(e.width=Math.max((e?.width??0)-a*2,10),e.height=Math.max((e?.height??0)/1.5-s*2,10));let{shapeSvg:l,bbox:u,label:h}=await vt(t,e,mt(e)),f=(e?.width?e?.width:u.width)+a*2,d=((e?.height?e?.height:u.height)+s*2)*1.5,p=f,m=d/1.5,g=-p/2,y=-m/2,{cssStyles:v}=e,x=rt.svg(l),b=st(e,{});e.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=rr(T),k=x.path(w,b),C=l.insert(()=>k,":first-child");return C.attr("class","basic label-container outer-path"),v&&e.look!=="handDrawn"&&C.selectChildren("path").attr("style",v),i&&e.look!=="handDrawn"&&C.selectChildren("path").attr("style",i),C.attr("transform",`translate(0, ${m/4})`),h.attr("transform",`translate(${-p/2+(e.padding??0)-(u.x-(u.left??0))}, ${-m/4+(e.padding??0)-(u.y-(u.top??0))})`),at(e,C),e.intersect=function(E){return et.polygon(e,T,E)},l}var Goe=P(()=>{"use strict";zt();Xt();Ht();Yt();o(zoe,"slopedRect")});async function Voe(t,e){let r=e.padding??0,i=e.look==="neo"?16:r*2,n=e.look==="neo"?12:r,a={rx:0,ry:0,classes:"",labelPaddingX:e.labelPaddingX??i,labelPaddingY:n};return qh(t,e,a)}var qoe=P(()=>{"use strict";L1();o(Voe,"squareRect")});async function Woe(t,e){let{labelStyles:r,nodeStyles:i}=tt(e);e.labelStyle=r;let n=e.padding??0,a=e.look==="neo"?20:n,s=e.look==="neo"?12:n,{shapeSvg:l,bbox:u}=await vt(t,e,mt(e)),h=u.height+(e.look==="neo"?s*2:s),f=u.width+h/4+(e.look==="neo"?a*2:a),d=h/2,{cssStyles:p}=e,m=rt.svg(l),g=st(e,{});e.look!=="handDrawn"&&(g.roughness=0,g.fillStyle="solid");let y=[{x:-f/2+d,y:-h/2},{x:f/2-d,y:-h/2},...D0(-f/2+d,0,d,50,90,270),{x:f/2-d,y:h/2},...D0(f/2-d,0,d,50,270,450)],v=rr(y),x=m.path(v,g),b=l.insert(()=>x,":first-child");return b.attr("class","basic label-container outer-path"),p&&e.look!=="handDrawn"&&b.selectChildren("path").attr("style",p),i&&e.look!=="handDrawn"&&b.selectChildren("path").attr("style",i),at(e,b),e.intersect=function(T){return et.polygon(e,y,T)},l}var Uoe=P(()=>{"use strict";zt();Xt();Ht();Yt();o(Woe,"stadium")});async function Hoe(t,e){let r={rx:e.look==="neo"?3:5,ry:e.look==="neo"?3:5,classes:"flowchart-node"};return qh(t,e,r)}var Yoe=P(()=>{"use strict";L1();o(Hoe,"state")});function joe(t,e,{config:{themeVariables:r}}){let{labelStyles:i,nodeStyles:n}=tt(e);e.labelStyle=i;let{cssStyles:a}=e,{lineColor:s,stateBorder:l,nodeBorder:u,nodeShadow:h}=r;(e.width||e.height)&&((e.width??0)<14&&(e.width=14),(e.height??0)<14&&(e.height=14)),e.width||(e.width=14),e.height||(e.height=14);let f=t.insert("g").attr("class","node default").attr("id",e.domId??e.id),d=rt.svg(f),p=st(e,{});e.look!=="handDrawn"&&(p.roughness=0,p.fillStyle="solid");let m=d.circle(0,0,e.width,{...p,stroke:s,strokeWidth:2}),g=l??u,y=(e.width??0)*5/14,v=d.circle(0,0,y,{...p,fill:g,stroke:g,strokeWidth:2,fillStyle:"solid"}),x=f.insert(()=>m,":first-child");if(x.insert(()=>v),e.look!=="handDrawn"&&x.attr("class","outer-path"),a&&x.selectAll("path").attr("style",a),n&&x.selectAll("path").attr("style",n),e.width<25&&h&&e.look!=="handDrawn"){let b=t.node()?.ownerSVGElement?.id??"",T=b?`${b}-drop-shadow-small`:"drop-shadow-small";x.attr("style",`filter:url(#${T})`)}return at(e,x),e.intersect=function(b){return et.circle(e,(e.width??0)/2,b)},f}var Xoe=P(()=>{"use strict";Yt();Xt();Ht();zt();o(joe,"stateEnd")});function Koe(t,e,{config:{themeVariables:r}}){let{lineColor:i,nodeShadow:n}=r;(e.width||e.height)&&((e.width??0)<14&&(e.width=14),(e.height??0)<14&&(e.height=14)),e.width||(e.width=14),e.height||(e.height=14);let a=t.insert("g").attr("class","node default").attr("id",e.domId||e.id),s;if(e.look==="handDrawn"){let u=rt.svg(a).circle(0,0,e.width,Kae(i));s=a.insert(()=>u),s.attr("class","state-start").attr("r",(e.width??7)/2).attr("width",e.width??14).attr("height",e.height??14)}else s=a.insert("circle",":first-child"),s.attr("class","state-start").attr("r",(e.width??7)/2).attr("width",e.width??14).attr("height",e.height??14);if(e.width<25&&n&&e.look!=="handDrawn"){let l=t.node()?.ownerSVGElement?.id??"",u=l?`${l}-drop-shadow-small`:"drop-shadow-small";s.attr("style",`filter:url(#${u})`)}return at(e,s),e.intersect=function(l){return et.circle(e,(e.width??7)/2,l)},a}var Qoe=P(()=>{"use strict";Yt();Xt();Ht();zt();o(Koe,"stateStart")});async function Zoe(t,e){let{labelStyles:r,nodeStyles:i}=tt(e);e.labelStyle=r;let n=e?.padding??8,a=e.look==="neo"?28:n,s=e.look==="neo"?12:n,{shapeSvg:l,bbox:u}=await vt(t,e,mt(e)),h=(e?.width??u.width)+2*R1+a,f=(e?.height??u.height)+s,d=h-2*R1,p=f,m=-h/2,g=-f/2,y=[{x:0,y:0},{x:d,y:0},{x:d,y:-p},{x:0,y:-p},{x:0,y:0},{x:-8,y:0},{x:d+8,y:0},{x:d+8,y:-p},{x:-8,y:-p},{x:-8,y:0}];if(e.look==="handDrawn"){let v=rt.svg(l),x=st(e,{}),b=v.rectangle(m,g,d+16,p,x),T=v.line(m+R1,g,m+R1,g+p,x),w=v.line(m+R1+d,g,m+R1+d,g+p,x);l.insert(()=>T,":first-child"),l.insert(()=>w,":first-child");let k=l.insert(()=>b,":first-child"),{cssStyles:C}=e;k.attr("class","basic label-container").attr("style",xi(C)),at(e,k)}else{let v=ds(l,d,p,y);i&&v.attr("style",i),at(e,v)}return e.intersect=function(v){return et.polygon(e,y,v)},l}var R1,Joe=P(()=>{"use strict";zt();Xt();Ht();Yt();Vh();er();R1=8;o(Zoe,"subroutine")});async function ele(t,e){let{labelStyles:r,nodeStyles:i}=tt(e);e.labelStyle=r;let n=e.padding??0,a=e.look==="neo"?16:n,s=e.look==="neo"?12:n;(e.width||e.height)&&(e.height=Math.max((e?.height??0)-s*2,10),e.width=Math.max((e?.width??0)-a*2-wM*(e.height+s*2),10));let{shapeSvg:l,bbox:u}=await vt(t,e,mt(e)),h=(e?.height?e?.height:u.height)+s*2,f=wM*h,d=wM*h,m=(e?.width?e?.width:u.width)+a*2+f-f,g=h,y=-m/2,v=-g/2,{cssStyles:x}=e,b=rt.svg(l),T=st(e,{}),w=[{x:y-f/2,y:v},{x:y+m+f/2,y:v},{x:y+m+f/2,y:v+g},{x:y-f/2,y:v+g}],k=[{x:y+m-f/2,y:v+g},{x:y+m+f/2,y:v+g},{x:y+m+f/2,y:v+g-d}];e.look!=="handDrawn"&&(T.roughness=0,T.fillStyle="solid");let C=rr(w),E=b.path(C,T),S=rr(k),L=b.path(S,{...T,fillStyle:"solid"}),M=l.insert(()=>L,":first-child");return M.insert(()=>E,":first-child"),M.attr("class","basic label-container outer-path"),x&&e.look!=="handDrawn"&&M.selectAll("path").attr("style",x),i&&e.look!=="handDrawn"&&M.selectAll("path").attr("style",i),at(e,M),e.intersect=function(I){return et.polygon(e,w,I)},l}var wM,tle=P(()=>{"use strict";zt();Ht();Yt();Xt();wM=.2;o(ele,"taggedRect")});async function rle(t,e){let{labelStyles:r,nodeStyles:i}=tt(e);e.labelStyle=r;let{shapeSvg:n,bbox:a,label:s}=await vt(t,e,mt(e)),l=Math.max(a.width+(e.padding??0)*2,e?.width??0),u=Math.max(a.height+(e.padding??0)*2,e?.height??0),h=u/8,f=.2*l,d=.2*u,p=u+h,{cssStyles:m}=e,g=rt.svg(n),y=st(e,{});e.look!=="handDrawn"&&(y.roughness=0,y.fillStyle="solid");let v=[{x:-l/2-l/2*.1,y:p/2},...Ml(-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-d*.4,T=[{x:x+l-f,y:(b+u)*1.3},{x:x+l,y:b+u-d},{x:x+l,y:(b+u)*.9},...Ml(x+l,(b+u)*1.25,x+l-f,(b+u)*1.3,-u*.02,.5)],w=rr(v),k=g.path(w,y),C=rr(T),E=g.path(C,{...y,fillStyle:"solid"}),S=n.insert(()=>E,":first-child");return S.insert(()=>k,":first-child"),S.attr("class","basic label-container outer-path"),m&&e.look!=="handDrawn"&&S.selectAll("path").attr("style",m),i&&e.look!=="handDrawn"&&S.selectAll("path").attr("style",i),S.attr("transform",`translate(0,${-h/2})`),s.attr("transform",`translate(${-l/2+(e.padding??0)-(a.x-(a.left??0))},${-u/2+(e.padding??0)-h/2-(a.y-(a.top??0))})`),at(e,S),e.intersect=function(L){return et.polygon(e,v,L)},n}var ile=P(()=>{"use strict";zt();Xt();Yt();Ht();o(rle,"taggedWaveEdgedRectangle")});async function nle(t,e){let{labelStyles:r,nodeStyles:i}=tt(e);e.labelStyle=r;let{shapeSvg:n,bbox:a}=await vt(t,e,mt(e)),s=Math.max(a.width+(e.padding??0),e?.width||0),l=Math.max(a.height+(e.padding??0),e?.height||0),u=-s/2,h=-l/2,f=n.insert("rect",":first-child");return f.attr("class","text").attr("style",i).attr("rx",0).attr("ry",0).attr("x",u).attr("y",h).attr("width",s).attr("height",l),at(e,f),e.intersect=function(d){return et.rect(e,d)},n}var ale=P(()=>{"use strict";zt();Xt();Ht();o(nle,"text")});async function lle(t,e){let{labelStyles:r,nodeStyles:i}=tt(e);e.labelStyle=r;let n=e.padding??0,a=e.look==="neo"?12:n/2;if(e.width||e.height){let y=e.height??0;e.height=(e.height??0)-a,e.heightT,":first-child"),g=s.insert(()=>b,":first-child"),g.attr("class","basic label-container"),m&&g.attr("style",m)}else{let y=PVe(0,0,p,h,d,f);g=s.insert("path",":first-child").attr("d",y).attr("class","basic label-container").attr("style",xi(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",d),g.attr("transform",`translate(${-p/2}, ${h/2} )`),u.attr("transform",`translate(${-(l.width/2)-d-(l.x-(l.left??0))}, ${-(l.height/2)-(l.y-(l.top??0))})`),at(e,g),e.intersect=function(y){let v=et.rect(e,y),x=v.y-(e.y??0);if(f!=0&&(Math.abs(x)<(e.height??0)/2||Math.abs(x)==(e.height??0)/2&&Math.abs(v.x-(e.x??0))>(e.width??0)/2-d)){let b=d*d*(1-x*x/(f*f));b!=0&&(b=Math.sqrt(Math.abs(b))),b=d-b,y.x-(e.x??0)>0&&(b=-b),v.x+=b}return v},s}var PVe,BVe,FVe,sle,ole,cle=P(()=>{"use strict";zt();Ht();Yt();Xt();er();PVe=o((t,e,r,i,n,a)=>`M${t},${e}
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"),BVe=o((t,e,r,i,n,a)=>[`M${t},${e}`,`M${t+r},${e}`,`a${n},${a} 0,0,0 0,${-i}`,`l${-r},0`,`a${n},${a} 0,0,0 0,${i}`,`l${r},0`].join(" "),"createOuterCylinderPathD"),FVe=o((t,e,r,i,n,a)=>[`M${t+r/2},${-i/2}`,`a${n},${a} 0,0,0 0,${i}`].join(" "),"createInnerCylinderPathD"),sle=5,ole=10;o(lle,"tiltedCylinder")});async function ule(t,e){let{labelStyles:r,nodeStyles:i}=tt(e);e.labelStyle=r;let n=e.padding??0,a=(e.look==="neo",n),s=e.look==="neo"?n*2:n,{shapeSvg:l,bbox:u}=await vt(t,e,mt(e)),h=(e?.height??u.height)+a,f=(e?.width??u.width)+s,d=[{x:-3*h/6,y:0},{x:f+3*h/6,y:0},{x:f,y:-h},{x:0,y:-h}],p,{cssStyles:m}=e;if(e.look==="handDrawn"){let g=rt.svg(l),y=st(e,{}),v=rr(d),x=g.path(v,y);p=l.insert(()=>x,":first-child").attr("transform",`translate(${-f/2}, ${h/2})`),m&&p.attr("style",m)}else p=ds(l,f,h,d);return i&&p.attr("style",i),e.width=f,e.height=h,at(e,p),e.intersect=function(g){return et.polygon(e,d,g)},l}var hle=P(()=>{"use strict";zt();Xt();Ht();Yt();Vh();o(ule,"trapezoid")});async function fle(t,e){let{labelStyles:r,nodeStyles:i}=tt(e);e.labelStyle=r;let n=e.padding??0,a=e.look==="neo"?16:n,s=e.look==="neo"?12:n,l=15,u=5;(e.width||e.height)&&(e.height=(e.height??0)-s*2,e.heightb,":first-child");return T.attr("class","basic label-container outer-path"),m&&e.look!=="handDrawn"&&T.selectChildren("path").attr("style",m),i&&e.look!=="handDrawn"&&T.selectChildren("path").attr("style",i),at(e,T),e.intersect=function(w){return et.polygon(e,v,w)},h}var dle=P(()=>{"use strict";zt();Xt();Ht();Yt();o(fle,"trapezoidalPentagon")});async function gle(t,e){let{labelStyles:r,nodeStyles:i}=tt(e);e.labelStyle=r;let n=e.padding??0,a=e.look==="neo"?n*2:n;(e.width||e.height)&&(e.width=((e?.width??0)-a)/2,e.widthb,":first-child").attr("transform",`translate(${-d/2}, ${d/2})`).attr("class","outer-path");return g&&e.look!=="handDrawn"&&T.selectChildren("path").attr("style",g),i&&e.look!=="handDrawn"&&T.selectChildren("path").attr("style",i),e.width=f,e.height=d,at(e,T),u.attr("transform",`translate(${-l.width/2-(l.x-(l.left??0))}, ${d/2-(l.height+(e.padding??0)/(h?2:1)-(l.y-(l.top??0)))})`),e.intersect=function(w){return Q.info("Triangle intersect",e,m,w),et.polygon(e,m,w)},s}var ple,mle,yle=P(()=>{"use strict";bt();zt();Xt();Ht();Yt();zt();Vr();Ut();ple=10,mle=10;o(gle,"triangle")});async function vle(t,e){let{labelStyles:r,nodeStyles:i}=tt(e);e.labelStyle=r;let n=e.padding??0,a=e.look==="neo"?16:n,s=e.look==="neo"?12:n,l=!0;(e.width||e.height)&&(l=!1,e.width=(e?.width??0)-a*2,e.width<10&&(e.width=10),e.height=(e?.height??0)-s*2,e.height<10&&(e.height=10));let{shapeSvg:u,bbox:h,label:f}=await vt(t,e,mt(e)),d=(e?.width?e?.width:h.width)+(a??0)*2,p=(e?.height?e?.height:h.height)+(s??0)*2,m=e.look==="neo"?p/4:p/8,g=p+(l?m:-m),{cssStyles:y}=e,x=14-d,b=x>0?x/2:0,T=rt.svg(u),w=st(e,{});e.look!=="handDrawn"&&(w.roughness=0,w.fillStyle="solid");let k=[{x:-d/2-b,y:g/2},...Ml(-d/2-b,g/2,d/2+b,g/2,m,.8),{x:d/2+b,y:-g/2},{x:-d/2-b,y:-g/2}],C=rr(k),E=T.path(C,w),S=u.insert(()=>E,":first-child");return S.attr("class","basic label-container outer-path"),y&&e.look!=="handDrawn"&&S.selectAll("path").attr("style",y),i&&e.look!=="handDrawn"&&S.selectAll("path").attr("style",i),S.attr("transform",`translate(0,${-m/2})`),f.attr("transform",`translate(${-d/2+(e.padding??0)-(h.x-(h.left??0))},${-p/2+(e.padding??0)-m-(h.y-(h.top??0))})`),at(e,S),e.intersect=function(L){return et.polygon(e,k,L)},u}var xle=P(()=>{"use strict";zt();Xt();Yt();Ht();o(vle,"waveEdgedRectangle")});async function ble(t,e){let{labelStyles:r,nodeStyles:i}=tt(e);e.labelStyle=r;let n=e.padding??0,a=e.look==="neo"?16:n,s=e.look==="neo"?20:n;if(e.width||e.height){e.width=e?.width??0,e.width<20&&(e.width=20),e.height=e?.height??0,e.height<10&&(e.height=10);let w=Math.min(e.height*.2,e.height/4);e.height=Math.ceil(e.height-s-w*(20/9)),e.width=e.width-a*2}let{shapeSvg:l,bbox:u}=await vt(t,e,mt(e)),h=(e?.width?e?.width:u.width)+a*2,f=(e?.height?e?.height:u.height)+s,d=f/8,p=f+d*2,{cssStyles:m}=e,g=rt.svg(l),y=st(e,{});e.look!=="handDrawn"&&(y.roughness=0,y.fillStyle="solid");let v=[{x:-h/2,y:p/2},...Ml(-h/2,p/2,h/2,p/2,d,1),{x:h/2,y:-p/2},...Ml(h/2,-p/2,-h/2,-p/2,d,-1)],x=rr(v),b=g.path(x,y),T=l.insert(()=>b,":first-child");return T.attr("class","basic label-container"),m&&e.look!=="handDrawn"&&T.selectAll("path").attr("style",m),i&&e.look!=="handDrawn"&&T.selectAll("path").attr("style",i),at(e,T),e.intersect=function(w){return et.polygon(e,v,w)},l}var Tle=P(()=>{"use strict";zt();Xt();Ht();Yt();o(ble,"waveRectangle")});async function kle(t,e){let{labelStyles:r,nodeStyles:i}=tt(e);e.labelStyle=r;let n=e.look==="neo"?16:e.padding??0,a=e.look==="neo"?12:e.padding??0;(e.width||e.height)&&(e.width=Math.max((e?.width??0)-n*2-On,10),e.height=Math.max((e?.height??0)-a*2-On,10));let{shapeSvg:s,bbox:l,label:u}=await vt(t,e,mt(e)),h=(e?.width?e?.width:l.width)+n*2+On,f=(e?.height?e?.height:l.height)+a*2+On,d=h-On,p=f-On,m=-d/2,g=-p/2,{cssStyles:y}=e,v=rt.svg(s),x=st(e,{}),b=[{x:m-On,y:g-On},{x:m-On,y:g+p},{x:m+d,y:g+p},{x:m+d,y:g-On}],T=`M${m-On},${g-On} L${m+d},${g-On} L${m+d},${g+p} L${m-On},${g+p} L${m-On},${g-On}
M${m-On},${g} L${m+d},${g}
M${m},${g-On} L${m},${g+p}`;e.look!=="handDrawn"&&(x.roughness=0,x.fillStyle="solid");let w=v.path(T,x),k=s.insert(()=>w,":first-child");return k.attr("transform",`translate(${On/2}, ${On/2})`),k.attr("class","basic label-container outer-path"),y&&e.look!=="handDrawn"&&k.selectAll("path").attr("style",y),i&&e.look!=="handDrawn"&&k.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))})`),at(e,k),e.intersect=function(C){return et.polygon(e,b,C)},s}var On,Cle=P(()=>{"use strict";zt();Ht();Yt();Xt();On=10;o(kle,"windowPane")});async function EM(t,e){let r=e;r.alias&&(e.label=r.alias);let{theme:i,themeVariables:n}=Lt(),{rowEven:a,rowOdd:s,nodeBorder:l,borderColorArray:u}=n;if(e.look==="handDrawn"){let{themeVariables:Z}=Lt(),{background:Y}=Z,ae={...e,id:e.id+"-background",domId:(e.domId||e.id)+"-background",look:"default",cssStyles:["stroke: none",`fill: ${Y}`]};await EM(t,ae)}let h=Lt();e.useHtmlLabels=h.htmlLabels;let f=h.er?.diagramPadding??10,d=h.er?.entityPadding??6,{cssStyles:p}=e,{labelStyles:m,nodeStyles:g}=tt(e);if(r.attributes.length===0&&e.label){let Z={rx:0,ry:0,labelPaddingX:f,labelPaddingY:f*1.5,classes:""};Ra(e.label,h)+Z.labelPaddingX*20){let Z=x.width+f*2-(k+C+E+S);k+=Z/I,C+=Z/I,E>0&&(E+=Z/I),S>0&&(S+=Z/I)}let _=k+C+E+S,D=rt.svg(v),N=st(e,{});e.look!=="handDrawn"&&(N.roughness=0,N.fillStyle="solid");let R=0;w.length>0&&(R=w.reduce((Z,Y)=>Z+(Y?.rowHeight??0),0));let B=Math.max(A.width+f*2,e?.width||0,_),O=Math.max((R??0)+x.height,e?.height||0),$=-B/2,z=-O/2;if(v.selectAll("g:not(:first-child)").each((Z,Y,ae)=>{let J=Ze(ae[Y]),ee=J.attr("transform"),re=0,te=0;if(ee){let de=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(ee);de&&(re=parseFloat(de[1]),te=parseFloat(de[2]),J.attr("class").includes("attribute-name")?re+=k:J.attr("class").includes("attribute-keys")?re+=k+C:J.attr("class").includes("attribute-comment")&&(re+=k+C+E))}J.attr("transform",`translate(${$+f/2+re}, ${te+z+x.height+d/2})`)}),v.select(".name").attr("transform","translate("+-x.width/2+", "+(z+d/2)+")"),i!=null&&wle.has(i)){let Z=r.colorIndex??0;v.attr("data-color-id",`color-${Z%u.length}`)}let F=D.rectangle($,z,B,O,N),V=v.insert(()=>F,":first-child").attr("class","outer-path").attr("style",p.join(""));T.push(0);for(let[Z,Y]of w.entries()){let J=(Z+1)%2===0&&Y.yOffset!==0,ee=D.rectangle($,x.height+z+Y?.yOffset,B,Y?.rowHeight,{...N,fill:J?a:s,stroke:l});v.insert(()=>ee,"g.label").attr("style",p.join("")).attr("class",`row-rect-${J?"even":"odd"}`)}let H=1e-4,X=Rb($,x.height+z,B+$,x.height+z,H),W=D.polygon(X.map(Z=>[Z.x,Z.y]),N);if(v.insert(()=>W).attr("class","divider"),X=Rb(k+$,x.height+z,k+$,O+z,H),W=D.polygon(X.map(Z=>[Z.x,Z.y]),N),v.insert(()=>W).attr("class","divider"),L){let Z=k+C+$;X=Rb(Z,x.height+z,Z,O+z,H),W=D.polygon(X.map(Y=>[Y.x,Y.y]),N),v.insert(()=>W).attr("class","divider")}if(M){let Z=k+C+E+$;X=Rb(Z,x.height+z,Z,O+z,H),W=D.polygon(X.map(Y=>[Y.x,Y.y]),N),v.insert(()=>W).attr("class","divider")}for(let Z of T){let Y=x.height+z+Z;X=Rb($,Y,B+$,Y,H),W=D.polygon(X.map(ae=>[ae.x,ae.y]),N),v.insert(()=>W).attr("class","divider")}if(at(e,V),g&&e.look!=="handDrawn")if(i!=null&&$Ve.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 e.intersect=function(Z){return et.rect(e,Z)},v}async function Lb(t,e,r,i=0,n=0,a=[],s=""){let l=t.insert("g").attr("class",`label ${a.join(" ")}`).attr("transform",`translate(${i}, ${n})`).attr("style",s);e!==ou(e)&&(e=ou(e),e=e.replaceAll("<","<").replaceAll(">",">"));let u=l.node().appendChild(await Vi(l,e,{width:Ra(e,r)+100,style:s,useHtmlLabels:r.htmlLabels},r));if(e.includes("<")||e.includes(">")){let f=u.children[0];for(f.textContent=f.textContent.replaceAll("<","<").replaceAll(">",">");f.childNodes[0];)f=f.childNodes[0],f.textContent=f.textContent.replaceAll("<","<").replaceAll(">",">")}let h=u.getBBox();if(ls(r.htmlLabels)){let f=u.children[0];f.style.textAlign="start";let d=Ze(u);h=f.getBoundingClientRect(),d.attr("width",h.width),d.attr("height",h.height)}return h}function Rb(t,e,r,i,n){return t===r?[{x:t-n/2,y:e},{x:t+n/2,y:e},{x:r+n/2,y:i},{x:r-n/2,y:i}]:[{x:t,y:e-n/2},{x:t,y:e+n/2},{x:r,y:i+n/2},{x:r,y:i-n/2}]}var wle,$Ve,Ele=P(()=>{"use strict";zt();Xt();Ht();Yt();L1();Sr();To();Vr();Pr();er();wle=new Set(["redux-color","redux-dark-color"]),$Ve=new Set(["redux","redux-dark","redux-color","redux-dark-color"]);o(EM,"erBox");o(Lb,"addText");o(Rb,"lineToPolygon")});async function Sle(t,e,r,i,n=r.class.padding??12){let a=i?0:3,s=t.insert("g").attr("class",mt(e)).attr("id",e.domId||e.id),l=null,u=null,h=null,f=null,d=0,p=0,m=0;if(l=s.insert("g").attr("class","annotation-group text"),e.annotations.length>0){let b=e.annotations[0];await E5(l,{text:`\xAB${b}\xBB`},0),d=l.node().getBBox().height}u=s.insert("g").attr("class","label-group text"),await E5(u,e,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 e.members){let T=await E5(h,b,y,[b.parseClassifier()]);y+=T+a}m=h.node().getBBox().height,m<=0&&(m=n/2),f=s.insert("g").attr("class","methods-group text");let v=0;for(let b of e.methods){let T=await E5(f,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}, ${d})`),x=s.node().getBBox(),h.attr("transform",`translate(0, ${d+p+n*2})`),x=s.node().getBBox(),f.attr("transform",`translate(0, ${d+p+(m?m+n*4:n*2)})`),x=s.node().getBBox(),{shapeSvg:s,bbox:x}}async function E5(t,e,r,i=[]){let n=t.insert("g").attr("class","label").attr("style",i.join("; ")),a=Lt(),s="useHtmlLabels"in e?e.useHtmlLabels:ls(a.htmlLabels)??!0,l="";"text"in e?l=e.text:l=e.label,!s&&l.startsWith("\\")&&(l=l.substring(1)),sn(l)&&(s=!0);let u=await Vi(n,r2(zs(l)),{width:Ra(l,a)+50,classes:"markdown-node-label",useHtmlLabels:s},a),h,f=1;if(s){let d=u.children[0],p=Ze(u);f=d.innerHTML.split(" ").length,d.innerHTML.includes("")&&(f+=d.innerHTML.split("").length-1);let m=d.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=d.getBoundingClientRect(),p.attr("width",h.width),p.attr("height",h.height)}else{i.includes("font-weight: bolder")&&Ze(u).selectAll("tspan").attr("font-weight",""),f=u.children.length;let d=u.children[0];(u.textContent===""||u.textContent.includes(">"))&&(d.textContent=l[0]+l.substring(1).replaceAll(">",">").replaceAll("<","<").trim(),l[1]===" "&&(d.textContent=d.textContent[0]+" "+d.textContent.substring(1))),d.textContent==="undefined"&&(d.textContent=""),h=u.getBBox()}return n.attr("transform","translate(0,"+(-h.height/(2*f)+r)+")"),h.height}var Ale=P(()=>{"use strict";Pr();Sr();zt();er();Ut();To();Vr();o(Sle,"textHelper");o(E5,"addText")});async function _le(t,e){let r=ge(),{themeVariables:i}=r,{useGradient:n}=i,a=r.class.padding??12,s=a,l=e.useHtmlLabels??ls(r.htmlLabels)??!0,u=e;u.annotations=u.annotations??[],u.members=u.members??[],u.methods=u.methods??[];let{shapeSvg:h,bbox:f}=await Sle(t,e,r,l,s),{labelStyles:d,nodeStyles:p}=tt(e);e.labelStyle=d,e.cssStyles=u.styles||"";let m=u.styles?.join(";")||p||"";e.cssStyles||(e.cssStyles=m.replaceAll("!important","").split(";"));let g=u.members.length===0&&u.methods.length===0&&!r.class?.hideEmptyMembersBox,y=rt.svg(h),v=st(e,{});e.look!=="handDrawn"&&(v.roughness=0,v.fillStyle="solid");let x=Math.max(e.width??0,f.width),b=Math.max(e.height??0,f.height),T=(e.height??0)>f.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,k=-b/2,C=g?a*2:u.members.length===0&&u.methods.length===0?-a:0;T&&(C=a*2);let E=y.rectangle(w-a,k-a-(g?a:u.members.length===0&&u.methods.length===0?-a/2:0),x+2*a,b+2*a+C,v),S=h.insert(()=>E,":first-child");S.attr("class","basic label-container outer-path");let L=S.node().getBBox(),M=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,A=h.select(".members-group").node().getBBox().height-(g?a/2:0)||0,_=(M+I+k+a-(k-a-(g?a:u.members.length===0&&u.methods.length===0?-a/2:0)))/2;if(h.selectAll(".text").each((D,N,R)=>{let B=Ze(R[N]),O=B.attr("transform"),$=0;if(O){let H=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(O);H&&($=parseFloat(H[2]))}let z=$+k+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(A,s/2);T?z=Math.max(_,M+I+V+k+s*2+a)+s*2:z=M+I+V+k+s*4+a}u.members.length===0&&u.methods.length===0&&r.class?.hideEmptyMembersBox&&(u.annotations.length>0?z=$-s:z=$),l||(z-=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,X){window.getComputedStyle(X[H]).textAnchor==="middle"&&(F=0)})),B.attr("transform",`translate(${F}, ${z})`)}),u.members.length>0||u.methods.length>0||g){let D=M+I+k+a,N=y.line(L.x,D,L.x+L.width,D+.001,v);h.insert(()=>N).attr("class",`divider${e.look==="neo"&&!n?" neo-line":""}`).attr("style",m)}if(g||u.members.length>0||u.methods.length>0){let D=M+I+A+k+s*2+a,N=y.line(L.x,T?Math.max(_,D):D,L.x+L.width,(T?Math.max(_,D):D)+.001,v);h.insert(()=>N).attr("class",`divider${e.look==="neo"&&!n?" neo-line":""}`).attr("style",m)}if(u.look!=="handDrawn"&&h.selectAll("path").attr("style",m),S.select(":nth-child(2)").attr("style",m),h.selectAll(".divider").select("path").attr("style",m),e.labelStyle?h.selectAll("span").attr("style",e.labelStyle):h.selectAll("span").attr("style",m),!l){let D=RegExp(/color\s*:\s*([^;]*)/),N=D.exec(m);if(N){let R=N[0].replace("color","fill");h.selectAll("tspan").attr("style",R)}else if(d){let R=D.exec(d);if(R){let B=R[0].replace("color","fill");h.selectAll("tspan").attr("style",B)}}}return at(e,S),e.intersect=function(D){return et.rect(e,D)},h}var Dle=P(()=>{"use strict";zt();Ut();Pr();Yt();Ht();Xt();Ale();Vr();o(_le,"classBox")});async function Lle(t,e){let{labelStyles:r,nodeStyles:i}=tt(e);e.labelStyle=r;let n=e,a=e,s=20,l=20,u="verifyMethod"in e,h=mt(e),{themeVariables:f}=ge(),{borderColorArray:d,requirementEdgeLabelBackground:p}=f,m=t.insert("g").attr("class",h).attr("id",e.domId??e.id),g;u?g=await Wh(m,`<<${n.type}>>`,0,e.labelStyle):g=await Wh(m,"<<Element>>",0,e.labelStyle);let y=g,v=await Wh(m,n.name,y,e.labelStyle+"; font-weight: bold;");if(y+=v+l,u){let L=await Wh(m,`${n.requirementId?`ID: ${n.requirementId}`:""}`,y,e.labelStyle);y+=L;let M=await Wh(m,`${n.text?`Text: ${n.text}`:""}`,y,e.labelStyle);y+=M;let I=await Wh(m,`${n.risk?`Risk: ${n.risk}`:""}`,y,e.labelStyle);y+=I,await Wh(m,`${n.verifyMethod?`Verification: ${n.verifyMethod}`:""}`,y,e.labelStyle)}else{let L=await Wh(m,`${a.type?`Type: ${a.type}`:""}`,y,e.labelStyle);y+=L,await Wh(m,`${a.docRef?`Doc Ref: ${a.docRef}`:""}`,y,e.labelStyle)}let x=(m.node()?.getBBox().width??200)+s,b=(m.node()?.getBBox().height??200)+s,T=-x/2,w=-b/2,k=rt.svg(m),C=st(e,{});e.look!=="handDrawn"&&(C.roughness=0,C.fillStyle="solid");let E=k.rectangle(T,w,x,b,C),S=m.insert(()=>E,":first-child");if(S.attr("class","basic label-container outer-path").attr("style",i),d?.length){let L=e.colorIndex??0;m.attr("data-color-id",`color-${L%d.length}`)}if(m.selectAll(".label").each((L,M,I)=>{let A=Ze(I[M]),_=A.attr("transform"),D=0,N=0;if(_){let $=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(_);$&&(D=parseFloat($[1]),N=parseFloat($[2]))}let R=N-b/2,B=T+s/2;(M===0||M===1)&&(B=D),A.attr("transform",`translate(${B}, ${R+s})`)}),y>g+v+l){let L=w+g+v+l,M;if(e.look==="neo"){let _=[[T,L],[T+x,L],[T+x,L+.001],[T,L+.001]];M=k.polygon(_,C)}else M=k.line(T,L,T+x,L,C);m.insert(()=>M).attr("class","divider")}return at(e,S),e.intersect=function(L){return et.rect(e,L)},i&&e.look!=="handDrawn"&&(p||d?.length)&&m.selectAll("path").attr("style",i),m}async function Wh(t,e,r,i=""){if(e==="")return 0;let n=t.insert("g").attr("class","label").attr("style",i),a=ge(),s=a.htmlLabels??!0,l=await Vi(n,r2(zs(e)),{width:Ra(e,a)+50,classes:"markdown-node-label",useHtmlLabels:s,style:i},a),u;if(s){let h=l.children[0],f=Ze(l);u=h.getBoundingClientRect(),f.attr("width",u.width),f.attr("height",u.height)}else{let h=l.children[0];for(let f of h.children)i&&f.setAttribute("style",i);u=l.getBBox(),u.height+=6}return n.attr("transform",`translate(${-u.width/2},${-u.height/2+r})`),u.height}var Rle=P(()=>{"use strict";zt();Xt();Ht();Yt();er();Ut();To();Pr();o(Lle,"requirementBox");o(Wh,"addText")});async function Nle(t,e,{config:r}){let{labelStyles:i,nodeStyles:n}=tt(e);e.labelStyle=i||"";let a=10,s=e.width;e.width=(e.width??200)-10;let{shapeSvg:l,bbox:u,label:h}=await vt(t,e,mt(e)),f=e.padding||10,d="",p;"ticket"in e&&e.ticket&&r?.kanban?.ticketBaseUrl&&(d=r?.kanban?.ticketBaseUrl.replace("#TICKET#",e.ticket),p=l.insert("svg:a",":first-child").attr("class","kanban-ticket-link").attr("xlink:href",d).attr("target","_blank"));let m={useHtmlLabels:e.useHtmlLabels,labelStyle:e.labelStyle||"",width:e.width,img:e.img,padding:e.padding||8,centerLabel:!1},g,y;p?{label:g,bbox:y}=await h5(p,"ticket"in e&&e.ticket||"",m):{label:g,bbox:y}=await h5(l,"ticket"in e&&e.ticket||"",m);let{label:v,bbox:x}=await h5(l,"assigned"in e&&e.assigned||"",m);e.width=s;let b=10,T=e?.width||0,w=Math.max(y.height,x.height)/2,k=Math.max(u.height+b*2,e?.height||0)+w,C=-T/2,E=-k/2;h.attr("transform","translate("+(f-T/2)+", "+(-w-u.height/2)+")"),g.attr("transform","translate("+(f-T/2)+", "+(-w+u.height/2)+")"),v.attr("transform","translate("+(f+T/2-x.width-2*a)+", "+(-w+u.height/2)+")");let S,{rx:L,ry:M}=e,{cssStyles:I}=e;if(e.look==="handDrawn"){let A=rt.svg(l),_=st(e,{}),D=L||M?A.path(Co(C,E,T,k,L||0),_):A.rectangle(C,E,T,k,_);S=l.insert(()=>D,":first-child"),S.attr("class","basic label-container").attr("style",I||null)}else{S=l.insert("rect",":first-child"),S.attr("class","basic label-container __APA__").attr("style",n).attr("rx",L??5).attr("ry",M??5).attr("x",C).attr("y",E).attr("width",T).attr("height",k);let A="priority"in e&&e.priority;if(A){let _=l.append("line"),D=C+2,N=E+Math.floor((L??0)/2),R=E+k-Math.floor((L??0)/2);_.attr("x1",D).attr("y1",N).attr("x2",D).attr("y2",R).attr("stroke-width","4").attr("stroke",zVe(A))}}return at(e,S),e.height=k,e.intersect=function(A){return et.rect(e,A)},l}var zVe,Ile=P(()=>{"use strict";zt();Xt();R0();Ht();Yt();zVe=o(t=>{switch(t){case"Very High":return"red";case"High":return"orange";case"Medium":return null;case"Low":return"blue";case"Very Low":return"lightblue"}},"colorFromPriority");o(Nle,"kanbanItem")});async function Mle(t,e){let{labelStyles:r,nodeStyles:i}=tt(e);e.labelStyle=r;let{shapeSvg:n,bbox:a,halfPadding:s,label:l}=await vt(t,e,mt(e)),u=a.width+10*s,h=a.height+8*s,f=.15*u,{cssStyles:d}=e,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${f},${f} 1 0,0 ${g*.25},${-1*y*.1}
a${f},${f} 1 0,0 ${g*.25},0
a${f},${f} 1 0,0 ${g*.25},0
a${f},${f} 1 0,0 ${g*.25},${y*.1}
a${f},${f} 1 0,0 ${g*.15},${y*.33}
a${f*.8},${f*.8} 1 0,0 0,${y*.34}
a${f},${f} 1 0,0 ${-1*g*.15},${y*.33}
a${f},${f} 1 0,0 ${-1*g*.25},${y*.15}
a${f},${f} 1 0,0 ${-1*g*.25},0
a${f},${f} 1 0,0 ${-1*g*.25},0
a${f},${f} 1 0,0 ${-1*g*.25},${-1*y*.15}
a${f},${f} 1 0,0 ${-1*g*.1},${-1*y*.33}
a${f*.8},${f*.8} 1 0,0 0,${-1*y*.34}
a${f},${f} 1 0,0 ${g*.1},${-1*y*.33}
H0 V0 Z`;if(e.look==="handDrawn"){let b=rt.svg(n),T=st(e,{}),w=b.path(x,T);v=n.insert(()=>w,":first-child"),v.attr("class","basic label-container").attr("style",xi(d))}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})`),at(e,v),e.calcIntersect=function(b,T){return et.rect(b,T)},e.intersect=function(b){return Q.info("Bang intersect",e,b),et.rect(e,b)},n}var Ole=P(()=>{"use strict";bt();zt();Xt();Ht();Yt();er();o(Mle,"bang")});async function Ple(t,e){let{labelStyles:r,nodeStyles:i}=tt(e);e.labelStyle=r;let{shapeSvg:n,bbox:a,halfPadding:s,label:l}=await vt(t,e,mt(e)),u=a.width+2*s,h=a.height+2*s,f=.15*u,d=.25*u,p=.35*u,m=.2*u,{cssStyles:g}=e,y,v=`M0 0
a${f},${f} 0 0,1 ${u*.25},${-1*u*.1}
a${p},${p} 1 0,1 ${u*.4},${-1*u*.1}
a${d},${d} 1 0,1 ${u*.35},${u*.2}
a${f},${f} 1 0,1 ${u*.15},${h*.35}
a${m},${m} 1 0,1 ${-1*u*.15},${h*.65}
a${d},${f} 1 0,1 ${-1*u*.25},${u*.15}
a${p},${p} 1 0,1 ${-1*u*.5},0
a${f},${f} 1 0,1 ${-1*u*.25},${-1*u*.15}
a${f},${f} 1 0,1 ${-1*u*.1},${-1*h*.35}
a${m},${m} 1 0,1 ${u*.1},${-1*h*.65}
H0 V0 Z`;if(e.look==="handDrawn"){let x=rt.svg(n),b=st(e,{}),T=x.path(v,b);y=n.insert(()=>T,":first-child"),y.attr("class","basic label-container").attr("style",xi(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})`),at(e,y),e.calcIntersect=function(x,b){return et.rect(x,b)},e.intersect=function(x){return Q.info("Cloud intersect",e,x),et.rect(e,x)},n}var Ble=P(()=>{"use strict";Yt();bt();er();Xt();Ht();zt();o(Ple,"cloud")});async function Fle(t,e){let{labelStyles:r,nodeStyles:i}=tt(e);e.labelStyle=r;let{shapeSvg:n,bbox:a,halfPadding:s,label:l}=await vt(t,e,mt(e)),u=a.width+8*s,h=a.height+2*s,f=5,d=e.look==="neo"?`
M${-u/2} ${h/2-f}
v${-h+2*f}
q0,-${f} ${f},-${f}
h${u-2*f}
q${f},0 ${f},${f}
v${h-f}
H${-u/2}
Z
`:`
M${-u/2} ${h/2-f}
v${-h+2*f}
q0,-${f} ${f},-${f}
h${u-2*f}
q${f},0 ${f},${f}
v${h-2*f}
q0,${f} ${-f},${f}
h${-(u-2*f)}
q${-f},0 ${-f},${-f}
Z
`;if(!e.domId)throw new Error(`defaultMindmapNode: node "${e.id}" is missing a domId \u2014 was render.ts domId prefixing skipped?`);let p=n.append("path").attr("id",e.domId).attr("class","node-bkg node-"+e.type).attr("style",i).attr("d",d);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()),at(e,p),e.calcIntersect=function(m,g){return et.rect(m,g)},e.intersect=function(m){return et.rect(e,m)},n}var $le=P(()=>{"use strict";Xt();Ht();zt();o(Fle,"defaultMindmapNode")});async function zle(t,e){let r={padding:e.padding??0};return C5(t,e,r)}var Gle=P(()=>{"use strict";CM();o(zle,"mindmapCircle")});function Vle(t){return t in SM}var GVe,VVe,SM,AM=P(()=>{"use strict";fse();mse();yse();xse();CM();Tse();Cse();Ese();Ase();Dse();Ise();Ose();Bse();$se();qse();Use();Yse();Xse();Qse();Jse();toe();ioe();aoe();ooe();coe();hoe();doe();moe();yoe();Toe();Coe();Eoe();Aoe();Doe();Roe();Ioe();Ooe();Boe();$oe();Goe();qoe();Uoe();Yoe();Xoe();Qoe();Joe();tle();ile();ale();cle();hle();dle();yle();xle();Tle();Cle();Ele();Dle();Rle();Ile();Ole();Ble();$le();Gle();GVe=[{semanticName:"Process",name:"Rectangle",shortName:"rect",description:"Standard process shape",aliases:["proc","process","rectangle"],internalAliases:["squareRect"],handler:Voe},{semanticName:"Event",name:"Rounded Rectangle",shortName:"rounded",description:"Represents an event",aliases:["event"],internalAliases:["roundedRect"],handler:Poe},{semanticName:"Terminal Point",name:"Stadium",shortName:"stadium",description:"Terminal point",aliases:["terminal","pill"],handler:Woe},{semanticName:"Subprocess",name:"Framed Rectangle",shortName:"fr-rect",description:"Subprocess",aliases:["subprocess","subproc","framed-rectangle","subroutine"],handler:Zoe},{semanticName:"Database",name:"Cylinder",shortName:"cyl",description:"Database storage",aliases:["db","database","cylinder"],handler:Nse},{semanticName:"Start",name:"Circle",shortName:"circle",description:"Starting point",aliases:["circ"],handler:C5},{semanticName:"Bang",name:"Bang",shortName:"bang",description:"Bang",aliases:["bang"],handler:Mle},{semanticName:"Cloud",name:"Cloud",shortName:"cloud",description:"cloud",aliases:["cloud"],handler:Ple},{semanticName:"Decision",name:"Diamond",shortName:"diam",description:"Decision-making step",aliases:["decision","diamond","question"],handler:Loe},{semanticName:"Prepare Conditional",name:"Hexagon",shortName:"hex",description:"Preparation or condition step",aliases:["hexagon","prepare"],handler:jse},{semanticName:"Data Input/Output",name:"Lean Right",shortName:"lean-r",description:"Represents input or output",aliases:["lean-right","in-out"],internalAliases:["lean_right"],handler:poe},{semanticName:"Data Input/Output",name:"Lean Left",shortName:"lean-l",description:"Represents output or input",aliases:["lean-left","out-in"],internalAliases:["lean_left"],handler:foe},{semanticName:"Priority Action",name:"Trapezoid Base Bottom",shortName:"trap-b",description:"Priority action",aliases:["priority","trapezoid-bottom","trapezoid"],handler:ule},{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:loe},{semanticName:"Stop",name:"Double Circle",shortName:"dbl-circ",description:"Represents a stop point",aliases:["double-circle"],internalAliases:["doublecircle"],handler:Pse},{semanticName:"Text Block",name:"Text Block",shortName:"text",description:"Text block",handler:nle},{semanticName:"Card",name:"Notched Rectangle",shortName:"notch-rect",description:"Represents a card",aliases:["card","notched-rectangle"],handler:gse},{semanticName:"Lined/Shaded Process",name:"Lined Rectangle",shortName:"lin-rect",description:"Lined process shape",aliases:["lined-rectangle","lined-process","lin-proc","shaded-process"],handler:Foe},{semanticName:"Start",name:"Small Circle",shortName:"sm-circ",description:"Small starting point",aliases:["start","small-circle"],internalAliases:["stateStart"],handler:Koe},{semanticName:"Stop",name:"Framed Circle",shortName:"fr-circ",description:"Stop point",aliases:["stop","framed-circle"],internalAliases:["stateEnd"],handler:joe},{semanticName:"Fork/Join",name:"Filled Rectangle",shortName:"fork",description:"Fork or join in process flow",aliases:["join"],internalAliases:["forkJoin"],handler:Wse},{semanticName:"Collate",name:"Hourglass",shortName:"hourglass",description:"Represents a collate operation",aliases:["hourglass","collate"],handler:Kse},{semanticName:"Comment",name:"Curly Brace",shortName:"brace",description:"Adds a comment",aliases:["comment","brace-l"],handler:kse},{semanticName:"Comment Right",name:"Curly Brace",shortName:"brace-r",description:"Adds a comment",handler:wse},{semanticName:"Comment with braces on both sides",name:"Curly Braces",shortName:"braces",description:"Adds a comment",handler:Sse},{semanticName:"Com Link",name:"Lightning Bolt",shortName:"bolt",description:"Communication link",aliases:["com-link","lightning-bolt"],handler:goe},{semanticName:"Document",name:"Document",shortName:"doc",description:"Represents a document",aliases:["doc","document"],handler:vle},{semanticName:"Delay",name:"Half-Rounded Rectangle",shortName:"delay",description:"Represents a delay",aliases:["half-rounded-rectangle"],handler:Hse},{semanticName:"Direct Access Storage",name:"Horizontal Cylinder",shortName:"h-cyl",description:"Direct access storage",aliases:["das","horizontal-cylinder"],handler:lle},{semanticName:"Disk Storage",name:"Lined Cylinder",shortName:"lin-cyl",description:"Disk storage",aliases:["disk","lined-cylinder"],handler:boe},{semanticName:"Display",name:"Curved Trapezoid",shortName:"curv-trap",description:"Represents a display",aliases:["curved-trapezoid","display"],handler:_se},{semanticName:"Divided Process",name:"Divided Rectangle",shortName:"div-rect",description:"Divided process shape",aliases:["div-proc","divided-rectangle","divided-process"],handler:Mse},{semanticName:"Extract",name:"Triangle",shortName:"tri",description:"Extraction process",aliases:["extract","triangle"],handler:gle},{semanticName:"Internal Storage",name:"Window Pane",shortName:"win-pane",description:"Internal storage",aliases:["internal-storage","window-pane"],handler:kle},{semanticName:"Junction",name:"Filled Circle",shortName:"f-circ",description:"Junction point",aliases:["junction","filled-circle"],handler:Fse},{semanticName:"Loop Limit",name:"Trapezoidal Pentagon",shortName:"notch-pent",description:"Loop limit step",aliases:["loop-limit","notched-pentagon"],handler:fle},{semanticName:"Manual File",name:"Flipped Triangle",shortName:"flip-tri",description:"Manual file operation",aliases:["manual-file","flipped-triangle"],handler:Vse},{semanticName:"Manual Input",name:"Sloped Rectangle",shortName:"sl-rect",description:"Manual input step",aliases:["manual-input","sloped-rectangle"],handler:zoe},{semanticName:"Multi-Document",name:"Stacked Document",shortName:"docs",description:"Multiple documents",aliases:["documents","st-doc","stacked-document"],handler:Soe},{semanticName:"Multi-Process",name:"Stacked Rectangle",shortName:"st-rect",description:"Multiple processes",aliases:["procs","processes","stacked-rectangle"],handler:woe},{semanticName:"Stored Data",name:"Bow Tie Rectangle",shortName:"bow-rect",description:"Stored data",aliases:["stored-data","bow-tie-rectangle"],handler:pse},{semanticName:"Summary",name:"Crossed Circle",shortName:"cross-circ",description:"Summary",aliases:["summary","crossed-circle"],handler:bse},{semanticName:"Tagged Document",name:"Tagged Document",shortName:"tag-doc",description:"Tagged document",aliases:["tag-doc","tagged-document"],handler:rle},{semanticName:"Tagged Process",name:"Tagged Rectangle",shortName:"tag-rect",description:"Tagged process",aliases:["tagged-rectangle","tag-proc","tagged-process"],handler:ele},{semanticName:"Paper Tape",name:"Flag",shortName:"flag",description:"Paper tape",aliases:["paper-tape"],handler:ble},{semanticName:"Odd",name:"Odd",shortName:"odd",description:"Odd shape",internalAliases:["rect_left_inv_arrow"],handler:Noe},{semanticName:"Lined Document",name:"Lined Document",shortName:"lin-doc",description:"Lined document",aliases:["lined-document"],handler:koe}],VVe=o(()=>{let e=[...Object.entries({state:Hoe,choice:vse,note:_oe,rectWithTitle:Moe,labelRect:uoe,iconSquare:noe,iconCircle:eoe,icon:Zse,iconRounded:roe,imageSquare:soe,anchor:hse,kanbanItem:Nle,mindmapCircle:zle,defaultMindmapNode:Fle,classBox:_le,erBox:EM,requirementBox:Lle}),...GVe.flatMap(r=>[r.shortName,..."aliases"in r?r.aliases:[],..."internalAliases"in r?r.internalAliases:[]].map(n=>[n,r.handler]))];return Object.fromEntries(e)},"generateShapeMap"),SM=VVe();o(Vle,"isValidShape")});var qVe,S5,qle=P(()=>{"use strict";Pr();xb();Ut();bt();AM();er();Vr();Ki();y0();zx();qVe="flowchart-",S5=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=Ar;this.setAccDescription=Lr;this.setDiagramTitle=Mr;this.getAccTitle=Dr;this.getAccDescription=Rr;this.getDiagramTitle=Nr;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(e){return lt.sanitizeText(e,this.config)}sanitizeNodeLabelType(e){switch(e){case"markdown":case"string":case"text":return e;default:return"markdown"}}setDiagramId(e){this.diagramId=e}lookUpDomId(e){for(let r of this.vertices.values())if(r.id===e)return this.diagramId?`${this.diagramId}-${r.domId}`:r.domId;return this.diagramId?`${this.diagramId}-${e}`:e}addVertex(e,r,i,n,a,s,l={},u){if(!e||e.trim().length===0)return;let h;if(u!==void 0){let m;u.includes(`
`)?m=u+`
`:m=`{
`+u+`
}`,h=ud(m,{schema:cd})}let f=this.edges.find(m=>m.id===e);if(f){let m=h;m?.animate!==void 0&&(f.animate=m.animate),m?.animation!==void 0&&(f.animation=m.animation),m?.curve!==void 0&&(f.interpolate=m.curve);return}let d,p=this.vertices.get(e);if(p===void 0&&(r===void 0&&i===void 0&&n!==void 0&&n!==null&&Q.warn(`Style applied to unknown node "${e}". This may indicate a typo. The node will be created automatically.`),p={id:e,labelType:"text",domId:qVe+e+"-"+this.vertexCounter,styles:[],classes:[]},this.vertices.set(e,p)),this.vertexCounter++,r!==void 0?(this.config=ge(),d=this.sanitizeText(r.text.trim()),p.labelType=r.type,d.startsWith('"')&&d.endsWith('"')&&(d=d.substring(1,d.length-1)),p.text=d):p.text===void 0&&(p.text=e),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(!Vle(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===e&&(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===e&&(p.text="")),h?.constraint&&(p.constraint=h.constraint),h.w&&(p.assetWidth=Number(h.w)),h.h&&(p.assetHeight=Number(h.h))}}addSingleLink(e,r,i,n){let l={start:e,end:r,type:void 0,text:"",labelType:"text",classes:[],isUserDefinedId:!1,interpolate:this.edges.defaultInterpolate};Q.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(f=>f.start===l.start&&f.end===l.end);h.length===0?l.id=Cu(l.start,l.end,{counter:0,prefix:"L"}):l.id=Cu(l.start,l.end,{counter:h.length+1,prefix:"L"})}if(this.edges.length<(this.config.maxEdges??500))Q.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(e){return e!==null&&typeof e=="object"&&"id"in e&&typeof e.id=="string"}addLink(e,r,i){let n=this.isLinkData(i)?i.id.replace("@",""):void 0;Q.info("addLink",e,r,n);for(let a of e)for(let s of r){let l=a===e[e.length-1],u=s===r[0];l&&u?this.addSingleLink(a,s,i,n):this.addSingleLink(a,s,i,void 0)}}updateLinkInterpolate(e,r){e.forEach(i=>{i==="default"?this.edges.defaultInterpolate=r:this.edges[i].interpolate=r})}updateLink(e,r){e.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(e,r){let i=r.join().replace(/\\,/g,"\xA7\xA7\xA7").replace(/,/g,";").replace(/ยงยงยง/g,",").split(";");e.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(e){this.direction=e.trim(),/.*/.exec(this.direction)&&(this.direction="LR"),/.*v/.exec(this.direction)&&(this.direction="TB"),this.direction==="TD"&&(this.direction="TB")}setClass(e,r){for(let i of e.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(e,r){if(r!==void 0){r=this.sanitizeText(r);for(let i of e.split(","))this.tooltips.set(this.version==="gen-1"?this.lookUpDomId(i):i,r)}}setClickFun(e,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(e),l=document.querySelector(`[id="${s}"]`);l!==null&&l.addEventListener("click",()=>{Kt.runFunc(r,...n)},!1)}))}setLink(e,r,i){e.split(",").forEach(n=>{let a=this.vertices.get(n);a!==void 0&&(a.link=Kt.formatUrl(r,this.config),a.linkTarget=i)}),this.setClass(e,"clickable")}getTooltip(e){return this.tooltips.get(e)}setClickEvent(e,r,i){e.split(",").forEach(n=>{this.setClickFun(n,r,i)}),this.setClass(e,"clickable")}bindFunctions(e){this.funs.forEach(r=>{r(e)})}getDirection(){return this.direction?.trim()}getVertices(){return this.vertices}getEdges(){return this.edges}getClasses(){return this.classes}setupToolTips(e){let r=E3();Ze(e).select("svg").selectAll("g.node").on("mouseover",a=>{let s=Ze(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(Tl.sanitize(l)),s.classed("hover",!0)}).on("mouseout",a=>{r.transition().duration(500).style("opacity",0),Ze(a.currentTarget).classed("hover",!1)})}clear(e="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=e,this.config=ge(),wr()}setGen(e){this.version=e||"gen-2"}defaultStyle(){return"fill:#ffa;stroke: #f66; stroke-width: 3px; stroke-dasharray: 5, 5;fill:#ffa;stroke: #666;"}addSubGraph(e,r,i){let n=e.text.trim(),a=i.text;e===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,f=ge().flowchart??{};if(h=h??(f.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===e)return{result:!0,count:0};let n=0,a=1;for(;n=0){let l=this.indexNodes2(e,s);if(l.result)return{result:!0,count:a+l.count};a=a+l.count}n=n+1}return{result:!1,count:a}}getDepthFirstPos(e){return this.posCrossRef[e]}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(e){let r=e.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(e,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(e,r){let i=this.destructEndLink(e),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(e,r){for(let i of e)if(i.nodes.includes(r))return!0;return!1}makeUniq(e,r){let i=[];return e.nodes.forEach((n,a)=>{this.exists(r,n)||i.push(e.nodes[a])}),{nodes:i}}getTypeFromVertex(e){if(e.img)return"imageSquare";if(e.icon)return e.form==="circle"?"iconCircle":e.form==="square"?"iconSquare":e.form==="rounded"?"iconRounded":"icon";switch(e.type){case"square":case void 0:return"squareRect";case"round":return"roundedRect";case"ellipse":return"ellipse";default:return e.type}}findNode(e,r){return e.find(i=>i.id===r)}destructEdgeType(e){let r="none",i="arrow_point";switch(e){case"arrow_point":case"arrow_circle":case"arrow_cross":i=e;break;case"double_arrow_point":case"double_arrow_circle":case"double_arrow_cross":r=e.replace("double_",""),i=r;break}return{arrowTypeStart:r,arrowTypeEnd:i}}addNodeFromVertex(e,r,i,n,a,s){let l=i.get(e.id),u=n.get(e.id)??!1,h=this.findNode(r,e.id);if(h)h.cssStyles=e.styles,h.cssCompiledStyles=this.getCompiledStyles(e.classes),h.cssClasses=e.classes.join(" ");else{let f={id:e.id,label:e.text,labelType:e.labelType,labelStyle:"",parentId:l,padding:a.flowchart?.padding||8,cssStyles:e.styles,cssCompiledStyles:this.getCompiledStyles(["default","node",...e.classes]),cssClasses:"default "+e.classes.join(" "),dir:e.dir,domId:e.domId,look:s,link:e.link,linkTarget:e.linkTarget,tooltip:this.getTooltip(e.id),icon:e.icon,pos:e.pos,img:e.img,assetWidth:e.assetWidth,assetHeight:e.assetHeight,constraint:e.constraint};u?r.push({...f,isGroup:!0,shape:"rect"}):r.push({...f,isGroup:!1,shape:this.getTypeFromVertex(e)})}}getCompiledStyles(e){let r=[];for(let i of e){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 e=ge(),r=[],i=[],n=this.getSubGraphs(),a=new Map,s=new Map;for(let h=n.length-1;h>=0;h--){let f=n[h];f.nodes.length>0&&s.set(f.id,!0);for(let d of f.nodes)a.set(d,f.id)}for(let h=n.length-1;h>=0;h--){let f=n[h];r.push({id:f.id,label:f.title,labelStyle:"",labelType:f.labelType,parentId:a.get(f.id),padding:8,cssCompiledStyles:this.getCompiledStyles(f.classes),cssClasses:f.classes.join(" "),shape:"rect",dir:f.dir,isGroup:!0,look:e.look})}this.getVertices().forEach(h=>{this.addNodeFromVertex(h,r,a,s,e,e.look||"classic")});let u=this.getEdges();return u.forEach((h,f)=>{let{arrowTypeStart:d,arrowTypeEnd:p}=this.destructEdgeType(h.type),m=[...u.defaultStyle??[]];h.style&&m.push(...h.style);let g={id:Cu(h.start,h.end,{counter:f,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":d,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:e.look,animate:h.animate,animation:h.animation,curve:h.interpolate||this.edges.defaultInterpolate||e.flowchart?.curve};i.push(g)}),{nodes:r,edges:i,other:{},config:e}}defaultConfig(){return iw.flowchart}}});var Ol,I0=P(()=>{"use strict";Pr();Ol=o((t,e)=>{let r;return e==="sandbox"&&(r=Ze("#i"+t)),(e==="sandbox"?Ze(r.nodes()[0].contentDocument.body):Ze("body")).select(`[id="${t}"]`)},"getDiagramElement")});var Uh,Nb=P(()=>{"use strict";Uh=o(({flowchart:t})=>{let e=t?.subGraphTitleMargin?.top??0,r=t?.subGraphTitleMargin?.bottom??0,i=e+r;return{subGraphTitleTopMargin:e,subGraphTitleBottomMargin:r,subGraphTitleTotalMargin:i}},"getSubGraphTitleMargins")});var Wle,WVe,UVe,HVe,YVe,jVe,XVe,Ule,N1,Hle,A5=P(()=>{"use strict";Ut();Sr();bt();Nb();Pr();Yt();To();aM();w5();R0();Ht();Wle=o(async(t,e)=>{Q.info("Creating subgraph rect for ",e.id,e);let r=ge(),{themeVariables:i,handDrawnSeed:n}=r,{clusterBkg:a,clusterBorder:s}=i,{labelStyles:l,nodeStyles:u,borderStyles:h,backgroundStyles:f}=tt(e),d=t.insert("g").attr("class","cluster "+e.cssClasses).attr("id",e.domId).attr("data-look",e.look),p=Or(r),m=d.insert("g").attr("class","cluster-label "),g;e.labelType==="markdown"?g=await Vi(m,e.label,{style:e.labelStyle,useHtmlLabels:p,isNode:!0,width:e.width}):g=await Dc(m,e.label,e.labelStyle||"",!1,!0);let y=g.getBBox();if(Or(r)){let E=g.children[0],S=Ze(g);y=E.getBoundingClientRect(),S.attr("width",y.width),S.attr("height",y.height)}let v=e.width<=y.width+e.padding?y.width+e.padding:e.width;e.width<=y.width+e.padding?e.diff=(v-e.width)/2-e.padding:e.diff=-e.padding;let x=e.height,b=e.x-v/2,T=e.y-x/2;Q.trace("Data ",e,JSON.stringify(e));let w;if(e.look==="handDrawn"){let E=rt.svg(d),S=st(e,{roughness:.7,fill:a,stroke:s,fillWeight:3,seed:n}),L=E.path(Co(b,T,v,x,0),S);w=d.insert(()=>(Q.debug("Rough node insert CXC",L),L),":first-child"),w.select("path:nth-child(2)").attr("style",h.join(";")),w.select("path").attr("style",f.join(";").replace("fill","stroke"))}else w=d.insert("rect",":first-child"),w.attr("style",u).attr("rx",e.rx).attr("ry",e.ry).attr("x",b).attr("y",T).attr("width",v).attr("height",x);let{subGraphTitleTopMargin:k}=Uh(r);if(m.attr("transform",`translate(${e.x-y.width/2}, ${e.y-e.height/2+k})`),l){let E=m.select("span");E&&E.attr("style",l)}let C=w.node().getBBox();return e.offsetX=0,e.width=C.width,e.height=C.height,e.offsetY=y.height-e.padding/2,e.intersect=function(E){return hd(e,E)},{cluster:d,labelBBox:y}},"rect"),WVe=o((t,e)=>{let r=t.insert("g").attr("class","note-cluster").attr("id",e.domId),i=r.insert("rect",":first-child"),n=0*e.padding,a=n/2;i.attr("rx",e.rx).attr("ry",e.ry).attr("x",e.x-e.width/2-a).attr("y",e.y-e.height/2-a).attr("width",e.width+n).attr("height",e.height+n).attr("fill","none");let s=i.node().getBBox();return e.width=s.width,e.height=s.height,e.intersect=function(l){return hd(e,l)},{cluster:r,labelBBox:{width:0,height:0}}},"noteGroup"),UVe=o(async(t,e)=>{let r=ge(),{themeVariables:i,handDrawnSeed:n}=r,{altBackground:a,compositeBackground:s,compositeTitleBackground:l,nodeBorder:u}=i,h=t.insert("g").attr("class",e.cssClasses).attr("id",e.domId).attr("data-id",e.id).attr("data-look",e.look),f=h.insert("g",":first-child"),d=h.insert("g").attr("class","cluster-label"),p=h.append("rect"),m=await Dc(d,e.label,e.labelStyle,void 0,!0),g=m.getBBox();if(Or(r)){let L=m.children[0],M=Ze(m);g=L.getBoundingClientRect(),M.attr("width",g.width),M.attr("height",g.height)}let y=0*e.padding,v=y/2,x=(e.width<=g.width+e.padding?g.width+e.padding:e.width)+y;e.width<=g.width+e.padding?e.diff=(x-e.width)/2-e.padding:e.diff=-e.padding;let b=e.height+y,T=e.height+y-g.height-6,w=e.x-x/2,k=e.y-b/2;e.width=x;let C=e.y-e.height/2-v+g.height+2,E;if(e.look==="handDrawn"){let L=e.cssClasses.includes("statediagram-cluster-alt"),M=rt.svg(h),I=e.rx||e.ry?M.path(Co(w,k,x,b,10),{roughness:.7,fill:l,fillStyle:"solid",stroke:u,seed:n}):M.rectangle(w,k,x,b,{seed:n});E=h.insert(()=>I,":first-child");let A=M.rectangle(w,C,x,T,{fill:L?a:s,fillStyle:L?"hachure":"solid",stroke:u,seed:n});E=h.insert(()=>I,":first-child"),p=h.insert(()=>A)}else E=f.insert("rect",":first-child"),E.attr("class","outer").attr("x",w).attr("y",k).attr("width",x).attr("height",b).attr("data-look",e.look),p.attr("class","inner").attr("x",w).attr("y",C).attr("width",x).attr("height",T);d.attr("transform",`translate(${e.x-g.width/2}, ${k+1-(Or(r)?0:3)})`);let S=E.node().getBBox();return e.height=S.height,e.offsetX=0,e.offsetY=g.height-e.padding/2,e.labelBBox=g,e.intersect=function(L){return hd(e,L)},{cluster:h,labelBBox:g}},"roundedWithTitle"),HVe=o(async(t,e)=>{Q.info("Creating subgraph rect for ",e.id,e);let r=ge(),{themeVariables:i,handDrawnSeed:n}=r,{clusterBkg:a,clusterBorder:s}=i,{labelStyles:l,nodeStyles:u,borderStyles:h,backgroundStyles:f}=tt(e),d=t.insert("g").attr("class","cluster "+e.cssClasses).attr("id",e.domId).attr("data-look",e.look),p=Or(r),m=d.insert("g").attr("class","cluster-label "),g=await Vi(m,e.label,{style:e.labelStyle,useHtmlLabels:p,isNode:!0,width:e.width}),y=g.getBBox();if(Or(r)){let E=g.children[0],S=Ze(g);y=E.getBoundingClientRect(),S.attr("width",y.width),S.attr("height",y.height)}let v=e.width<=y.width+e.padding?y.width+e.padding:e.width;e.width<=y.width+e.padding?e.diff=(v-e.width)/2-e.padding:e.diff=-e.padding;let x=e.height,b=e.x-v/2,T=e.y-x/2;Q.trace("Data ",e,JSON.stringify(e));let w;if(e.look==="handDrawn"){let E=rt.svg(d),S=st(e,{roughness:.7,fill:a,stroke:s,fillWeight:4,seed:n}),L=E.path(Co(b,T,v,x,e.rx),S);w=d.insert(()=>(Q.debug("Rough node insert CXC",L),L),":first-child"),w.select("path:nth-child(2)").attr("style",h.join(";")),w.select("path").attr("style",f.join(";").replace("fill","stroke"))}else w=d.insert("rect",":first-child"),w.attr("style",u).attr("rx",e.rx).attr("ry",e.ry).attr("x",b).attr("y",T).attr("width",v).attr("height",x);let{subGraphTitleTopMargin:k}=Uh(r);if(m.attr("transform",`translate(${e.x-y.width/2}, ${e.y-e.height/2+k})`),l){let E=m.select("span");E&&E.attr("style",l)}let C=w.node().getBBox();return e.offsetX=0,e.width=C.width,e.height=C.height,e.offsetY=y.height-e.padding/2,e.intersect=function(E){return hd(e,E)},{cluster:d,labelBBox:y}},"kanbanSection"),YVe=o((t,e)=>{let r=ge(),{themeVariables:i,handDrawnSeed:n}=r,{nodeBorder:a}=i,s=t.insert("g").attr("class",e.cssClasses).attr("id",e.domId).attr("data-look",e.look),l=s.insert("g",":first-child"),u=0*e.padding,h=e.width+u;e.diff=-e.padding;let f=e.height+u,d=e.x-h/2,p=e.y-f/2;e.width=h;let m;if(e.look==="handDrawn"){let v=rt.svg(s).rectangle(d,p,h,f,{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";e.look,y="divider",m.attr("class",y).attr("x",d).attr("y",p).attr("width",h).attr("height",f).attr("data-look",e.look)}let g=m.node().getBBox();return e.height=g.height,e.offsetX=0,e.offsetY=0,e.intersect=function(y){return hd(e,y)},{cluster:s,labelBBox:{}}},"divider"),jVe=Wle,XVe={rect:Wle,squareRect:jVe,roundedWithTitle:UVe,noteGroup:WVe,divider:YVe,kanbanSection:HVe},Ule=new Map,N1=o(async(t,e)=>{let r=e.shape||"rect",i=await XVe[r](t,e);return Ule.set(e.id,i),i},"insertCluster"),Hle=o(()=>{Ule=new Map},"clear")});var Pl,_M=P(()=>{"use strict";Pl=o((t,e)=>{if(e)return"translate("+-t.width/2+", "+-t.height/2+")";let r=t.x??0,i=t.y??0;return"translate("+-(r+t.width/2)+", "+-(i+t.height/2)+")"},"computeLabelTransform")});function _5(t,e){if(t===void 0||e===void 0)return{angle:0,deltaX:0,deltaY:0};t=dn(t),e=dn(e);let[r,i]=[t.x,t.y],[n,a]=[e.x,e.y],s=n-r,l=a-i;return{angle:Math.atan(l/s),deltaX:s,deltaY:l}}var Ka,DM,dn,D5,LM=P(()=>{"use strict";Ka={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},DM={arrow_point:4,arrow_cross:12.5,arrow_circle:12.5};o(_5,"calculateDeltaAndAngle");dn=o(t=>Array.isArray(t)?{x:t[0],y:t[1]}:t,"pointTransformer"),D5=o(t=>({x:o(function(e,r,i){let n=0,a=dn(i[0]).x=0?1:-1)}else if(r===i.length-1&&Object.hasOwn(Ka,t.arrowTypeEnd)){let{angle:m,deltaX:g}=_5(i[i.length-1],i[i.length-2]);n=Ka[t.arrowTypeEnd]*Math.cos(m)*(g>=0?1:-1)}let s=Math.abs(dn(e).x-dn(i[i.length-1]).x),l=Math.abs(dn(e).y-dn(i[i.length-1]).y),u=Math.abs(dn(e).x-dn(i[0]).x),h=Math.abs(dn(e).y-dn(i[0]).y),f=Ka[t.arrowTypeStart],d=Ka[t.arrowTypeEnd],p=1;if(s0&&l0&&h=0?1:-1)}else if(r===i.length-1&&Object.hasOwn(Ka,t.arrowTypeEnd)){let{angle:m,deltaY:g}=_5(i[i.length-1],i[i.length-2]);n=Ka[t.arrowTypeEnd]*Math.abs(Math.sin(m))*(g>=0?1:-1)}let s=Math.abs(dn(e).y-dn(i[i.length-1]).y),l=Math.abs(dn(e).x-dn(i[i.length-1]).x),u=Math.abs(dn(e).y-dn(i[0]).y),h=Math.abs(dn(e).x-dn(i[0]).x),f=Ka[t.arrowTypeStart],d=Ka[t.arrowTypeEnd],p=1;if(s0&&l0&&h{"use strict";bt();jle=o((t,e,r,i,n,a=!1,s)=>{e.arrowTypeStart&&Yle(t,"start",e.arrowTypeStart,r,i,n,a,s),e.arrowTypeEnd&&Yle(t,"end",e.arrowTypeEnd,r,i,n,a,s)},"addEdgeMarkers"),KVe={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}},QVe=["cross","point","circle","lollipop","aggregation","extension","composition","dependency","barb"],Yle=o((t,e,r,i,n,a,s=!1,l)=>{let u=KVe[r],h=u&&QVe.includes(u.type);if(!u){Q.warn(`Unknown arrow type: ${r}`);return}let f=u.type,m=`${n}_${a}-${f}${e==="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)}}t.attr(`marker-${e}`,`url(${i}#${y})`)}else t.attr(`marker-${e}`,`url(${i}#${m})`)},"addEdgeMarker")});function L5(t,e){Or(ge())&&t&&(t.style.width=e.length*9+"px",t.style.height="12px")}function tqe(t){let e=[],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)&&(e.push(a),r.push(i))}return{cornerPoints:e,cornerPointPositions:r}}function nqe(t,e){if(t.length<2)return"";let r="",i=t.length,n=1e-5;for(let a=0;a({...n}));if(t.length>=2&&Ka[e.arrowTypeStart]){let n=Ka[e.arrowTypeStart],a=t[0],s=t[1],{angle:l}=Zle(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=t.length;if(i>=2&&Ka[e.arrowTypeEnd]){let n=Ka[e.arrowTypeEnd],a=t[i-1],s=t[i-2],{angle:l}=Zle(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 ZVe,R5,Qa,Jle,Ib,N5,I5,JVe,eqe,Kle,Qle,rqe,iqe,M5,RM=P(()=>{"use strict";Ut();Sr();bt();To();_M();er();LM();Nb();Pr();Yt();w5();Xle();Ht();ZVe=o(t=>typeof t=="string"?t:ge()?.flowchart?.curve,"resolveEdgeCurveType"),R5=new Map,Qa=new Map,Jle=o(()=>{R5.clear(),Qa.clear()},"clear"),Ib=o(t=>t?typeof t=="string"?t:t.reduce((e,r)=>e+";"+r,""):"","getLabelStyles"),N5=o(async(t,e)=>{let r=ge(),i=Or(r),{labelStyles:n}=tt(e);e.labelStyle=n;let a=t.insert("g").attr("class","edgeLabel"),s=a.insert("g").attr("class","label").attr("data-id",e.id),l=e.labelType==="markdown",h=await Vi(t,e.label,{style:Ib(e.labelStyle),useHtmlLabels:i,addSvgBackground:!0,isNode:!1,markdown:l,width:l?void 0:void 0},r);s.node().appendChild(h),Q.info("abc82",e,e.labelType);let f=h.getBBox(),d=f;if(i){let m=h.children[0],g=Ze(h);f=m.getBoundingClientRect(),d=f,g.attr("width",f.width),g.attr("height",f.height)}else{let m=Ze(h).select("text").node();m&&typeof m.getBBox=="function"&&(d=m.getBBox())}s.attr("transform",Pl(d,i)),R5.set(e.id,a),e.width=f.width,e.height=f.height;let p;if(e.startLabelLeft){let m=t.insert("g").attr("class","edgeTerminals"),g=m.insert("g").attr("class","inner"),y=await Dc(g,e.startLabelLeft,Ib(e.labelStyle)||"",!1,!1);p=y;let v=y.getBBox();if(i){let x=y.children[0],b=Ze(y);v=x.getBoundingClientRect(),b.attr("width",v.width),b.attr("height",v.height)}g.attr("transform",Pl(v,i)),Qa.get(e.id)||Qa.set(e.id,{}),Qa.get(e.id).startLeft=m,L5(p,e.startLabelLeft)}if(e.startLabelRight){let m=t.insert("g").attr("class","edgeTerminals"),g=m.insert("g").attr("class","inner"),y=await Dc(g,e.startLabelRight,Ib(e.labelStyle)||"",!1,!1);p=y,g.node().appendChild(y);let v=y.getBBox();if(i){let x=y.children[0],b=Ze(y);v=x.getBoundingClientRect(),b.attr("width",v.width),b.attr("height",v.height)}g.attr("transform",Pl(v,i)),Qa.get(e.id)||Qa.set(e.id,{}),Qa.get(e.id).startRight=m,L5(p,e.startLabelRight)}if(e.endLabelLeft){let m=t.insert("g").attr("class","edgeTerminals"),g=m.insert("g").attr("class","inner"),y=await Dc(g,e.endLabelLeft,Ib(e.labelStyle)||"",!1,!1);p=y;let v=y.getBBox();if(i){let x=y.children[0],b=Ze(y);v=x.getBoundingClientRect(),b.attr("width",v.width),b.attr("height",v.height)}g.attr("transform",Pl(v,i)),m.node().appendChild(y),Qa.get(e.id)||Qa.set(e.id,{}),Qa.get(e.id).endLeft=m,L5(p,e.endLabelLeft)}if(e.endLabelRight){let m=t.insert("g").attr("class","edgeTerminals"),g=m.insert("g").attr("class","inner"),y=await Dc(g,e.endLabelRight,Ib(e.labelStyle)||"",!1,!1);p=y;let v=y.getBBox();if(i){let x=y.children[0],b=Ze(y);v=x.getBoundingClientRect(),b.attr("width",v.width),b.attr("height",v.height)}g.attr("transform",Pl(v,i)),m.node().appendChild(y),Qa.get(e.id)||Qa.set(e.id,{}),Qa.get(e.id).endRight=m,L5(p,e.endLabelRight)}return h},"insertEdgeLabel");o(L5,"setTerminalWidth");I5=o((t,e)=>{Q.debug("Moving label abc88 ",t.id,t.label,R5.get(t.id),e);let r=e.updatedPath?e.updatedPath:e.originalPath,i=ge(),{subGraphTitleTotalMargin:n}=Uh(i);if(t.label){let a=R5.get(t.id),s=t.x,l=t.y;if(r){let u=Kt.calcLabelPosition(r);Q.debug("Moving label "+t.label+" from (",s,",",l,") to (",u.x,",",u.y,") abc88"),e.updatedPath&&(s=u.x,l=u.y)}a.attr("transform",`translate(${s}, ${l+n/2})`)}if(t.startLabelLeft){let a=Qa.get(t.id).startLeft,s=t.x,l=t.y;if(r){let u=Kt.calcTerminalLabelPosition(t.arrowTypeStart?10:0,"start_left",r);s=u.x,l=u.y}a.attr("transform",`translate(${s}, ${l})`)}if(t.startLabelRight){let a=Qa.get(t.id).startRight,s=t.x,l=t.y;if(r){let u=Kt.calcTerminalLabelPosition(t.arrowTypeStart?10:0,"start_right",r);s=u.x,l=u.y}a.attr("transform",`translate(${s}, ${l})`)}if(t.endLabelLeft){let a=Qa.get(t.id).endLeft,s=t.x,l=t.y;if(r){let u=Kt.calcTerminalLabelPosition(t.arrowTypeEnd?10:0,"end_left",r);s=u.x,l=u.y}a.attr("transform",`translate(${s}, ${l})`)}if(t.endLabelRight){let a=Qa.get(t.id).endRight,s=t.x,l=t.y;if(r){let u=Kt.calcTerminalLabelPosition(t.arrowTypeEnd?10:0,"end_right",r);s=u.x,l=u.y}a.attr("transform",`translate(${s}, ${l})`)}},"positionEdgeLabel"),JVe=o((t,e)=>{let r=t.x,i=t.y,n=Math.abs(e.x-r),a=Math.abs(e.y-i),s=t.width/2,l=t.height/2;return n>=s||a>=l},"outsideNode"),eqe=o((t,e,r)=>{Q.debug(`intersection calc abc89:
outsidePoint: ${JSON.stringify(e)}
insidePoint : ${JSON.stringify(r)}
node : x:${t.x} y:${t.y} w:${t.width} h:${t.height}`);let i=t.x,n=t.y,a=Math.abs(i-r.x),s=t.width/2,l=r.xMath.abs(i-e.x)*u){let d=r.y