129 lines
222 KiB
JavaScript
Raw Normal View History

2026-05-31 13:21:13 +02:00
import{b,c as vr}from"./chunk-7W6UQGC5.mjs";import{a as s,c as Yo}from"./chunk-AQ6EADP3.mjs";var Mr=/^-{3}\s*[\n\r](.*?)[\n\r]-{3}\s*[\n\r]+/s,qr=/%{2}{\s*(?:(\w+)\s*:|(\w+))\s*(?:(\w+)|((?:(?!}%{2}).|\r?\n)*))?\s*(?:}%{2})?/gi,wr=/\s*%%.*\n/gm;var Qt=class extends Error{static{s(this,"UnknownDiagramError")}constructor(t){super(t),this.name="UnknownDiagramError"}};var ti={},ks=s(function(r,t){r=r.replace(Mr,"").replace(qr,"").replace(wr,`
`);for(let[i,{detector:e}]of Object.entries(ti))if(e(r,t))return i;throw new Qt(`No diagram type detected matching given configuration for text: ${r}`)},"detectType"),Ts=s((...r)=>{for(let{id:t,detector:i,loader:e}of r)_i(t,i,e)},"registerLazyLoadedDiagrams"),_i=s((r,t,i)=>{ti[r]&&b.warn(`Detector with key ${r} already exists. Overwriting.`),ti[r]={detector:t,loader:i},b.debug(`Detector with key ${r} added${i?" with loader":""}`)},"addDetector"),bs=s(r=>ti[r].loader,"getDiagramLoader");var Ai=s((r,t,{depth:i=2,clobber:e=!1}={})=>{let d={depth:i,clobber:e};return Array.isArray(t)&&!Array.isArray(r)?(t.forEach(h=>Ai(r,h,d)),r):Array.isArray(t)&&Array.isArray(r)?(t.forEach(h=>{r.includes(h)||r.push(h)}),r):r===void 0||i<=0?r!=null&&typeof r=="object"&&typeof t=="object"?Object.assign(r,t):t:(t!==void 0&&typeof r=="object"&&typeof t=="object"&&Object.keys(t).forEach(h=>{typeof t[h]=="object"&&t[h]!==null&&(r[h]===void 0||typeof r[h]=="object")?(r[h]===void 0&&(r[h]=Array.isArray(t[h])?[]:{}),r[h]=Ai(r[h],t[h],{depth:i-1,clobber:e})):(e||typeof r[h]!="object"&&typeof t[h]!="object")&&(r[h]=t[h])}),r)},"assignWithDepth"),D=Ai;var ii={min:{r:0,g:0,b:0,s:0,l:0,a:0},max:{r:255,g:255,b:255,h:360,s:100,l:100,a:1},clamp:{r:s(r=>r>=255?255:r<0?0:r,"r"),g:s(r=>r>=255?255:r<0?0:r,"g"),b:s(r=>r>=255?255:r<0?0:r,"b"),h:s(r=>r%360,"h"),s:s(r=>r>=100?100:r<0?0:r,"s"),l:s(r=>r>=100?100:r<0?0:r,"l"),a:s(r=>r>=1?1:r<0?0:r,"a")},toLinear:s(r=>{let t=r/255;return r>.03928?Math.pow((t+.055)/1.055,2.4):t/12.92},"toLinear"),hue2rgb:s((r,t,i)=>(i<0&&(i+=1),i>1&&(i-=1),i<.16666666666666666?r+(t-r)*6*i:i<.5?t:i<.6666666666666666?r+(t-r)*(.6666666666666666-i)*6:r),"hue2rgb"),hsl2rgb:s(({h:r,s:t,l:i},e)=>{if(!t)return i*2.55;r/=360,t/=100,i/=100;let d=i<.5?i*(1+t):i+t-i*t,h=2*i-d;switch(e){case"r":return ii.hue2rgb(h,d,r+.3333333333333333)*255;case"g":return ii.hue2rgb(h,d,r)*255;case"b":return ii.hue2rgb(h,d,r-.3333333333333333)*255}},"hsl2rgb"),rgb2hsl:s(({r,g:t,b:i},e)=>{r/=255,t/=255,i/=255;let d=Math.max(r,t,i),h=Math.min(r,t,i),y=(d+h)/2;if(e==="l")return y*100;if(d===h)return 0;let f=d-h,M=y>.5?f/(2-d-h):f/(d+h);if(e==="s")return M*100;switch(d){case r:return((t-i)/f+(t<i?6:0))*60;case t:return((i-r)/f+2)*60;case i:return((r-t)/f+4)*60;default:return-1}},"rgb2hsl")},Or=ii;var Xo={clamp:s((r,t,i)=>t>i?Math.min(t,Math.max(i,r)):Math.min(i,Math.max(t,r)),"clamp"),round:s(r=>Math.round(r*1e10)/1e10,"round")},Ir=Xo;var Ko={dec2hex:s(r=>{let t=Math.round(r).toString(16);return t.length>1?t:`0${t}`},"dec2hex")},Dr=Ko;var Zo={channel:Or,lang:Ir,unit:Dr},u=Zo;var it={};for(let r=0;r<=255;r++)it[r]=u.unit.dec2hex(r);var _={ALL:0,RGB:1,HSL:2};var vi=class{static{s(this,"Type")}constructor(){this.type=_.ALL}get(){return this.type}set(t){if(this.type&&this.type!==t)throw new Error("Cannot change both RGB and HSL channels at the same time");this.type=t}reset(){this.type=_.ALL}is(t){return this.type===t}},zr=vi;var Mi=class{static{s(this,"Channels")}constructor(t,i){this.color=i,this.changed=!1,this.data=t,this.type=new zr}set(t,i){return this.color=i,this.changed=!1,this.data=t,this.type.type=_.ALL,this}_ensureHSL(){let t=this.data,{h:i,s:e,l:d}=t;i===void 0&&(t.h=u.channel.rgb2hsl(t,"h")),e===void 0&&(t.s=u.channel.rgb2hsl(t,"s")),d===void 0&&(t.l=u.channel.rgb2hsl(t,"l"))}_ensureRGB(){let t=this.data,{r:i,g:e,b:d}=t;i===void 0&&(t.r=u.channel.hsl2rgb(t,"r")),e===void 0&&(t.g=u.channel.hsl2rgb(t,"g")),d===void 0&&(t.b=u.channel.hsl2rgb(t,"b"))}get r(){let t=this.data,i=t.r;return!this.type.is(_.HSL)&&i!==void 0?i:(this._ensureHSL(),u.channel.hsl2rgb(t,"r"))}get g(){let t=this.data,i=t.g;return!this.type.is(_.HSL)&&i!==void 0?i:(this._ensureHSL(),u.channel.hsl2rgb(t,"g"))}get b(){let t=this.data,i=t.b;return!this.type.is(_.HSL)&&i!==void 0?i:(this._ensureHSL(),u.channel.hsl2rgb(t,"b"))}get h(){let t=this.data,i=t.h;return!this.type.is(_.RGB)&&i!==void 0?i:(this._ensureRGB(),u.channel.rgb2hsl(t,"h"))}get s(){let t=this.data,i=t.s;return!this.type.is(_.RGB)&&i!==void 0?i:(this._ensureRGB(),u.channel.rgb2hsl(t,"s"))}get l(){let t=this.data,i=t.l;return!this.typ
`+G),ht&&Dt([Ut,Gt,$t],j=>{G=bt(G,j," ")}),w&&Yt?w.createHTML(G):G},t.setConfig=function(){let m=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Si(m),xi=!0},t.clearConfig=function(){kt=null,xi=!1},t.isValidAttribute=function(m,l,C){kt||Si({});let g=E(m),k=E(l);return Sr(g,k,C)},t.addHook=function(m,l){typeof l=="function"&&zt(W[m],l)},t.removeHook=function(m,l){if(l!==void 0){let C=Te(W[m],l);return C===-1?void 0:be(W[m],C,1)[0]}return go(W[m])},t.removeHooks=function(m){W[m]=[]},t.removeAllHooks=function(){W=fo()},t}s(Bo,"createDOMPurify");var Bt=Bo();var Ht=/<br\s*\/?>/gi,We=s(r=>r?_o(r).replace(/\\n/g,"#br#").split("#br#"):[""],"getRows"),Pe=(()=>{let r=!1;return()=>{r||(Ne(),r=!0)}})();function Ne(){let r="data-temp-href-target";Bt.addHook("beforeSanitizeAttributes",t=>{t.tagName==="A"&&t.hasAttribute("target")&&t.setAttribute(r,t.getAttribute("target")??"")}),Bt.addHook("afterSanitizeAttributes",t=>{t.tagName==="A"&&t.hasAttribute(r)&&(t.setAttribute("target",t.getAttribute(r)??""),t.removeAttribute(r),t.getAttribute("target")==="_blank"&&t.setAttribute("rel","noopener"))})}s(Ne,"setupDompurifyHooks");var Eo=s(r=>(Pe(),Bt.sanitize(r)),"removeScript"),So=s((r,t)=>{if(co(t)){let i=t.securityLevel;i==="antiscript"||i==="strict"||i==="sandbox"?r=Eo(r):i!=="loose"&&(r=_o(r),r=r.replace(/</g,"&lt;").replace(/>/g,"&gt;"),r=r.replace(/=/g,"&equals;"),r=$e(r))}return r},"sanitizeMore"),at=s((r,t)=>r&&(t.dompurifyConfig?r=Bt.sanitize(So(r,t),t.dompurifyConfig).toString():r=Bt.sanitize(So(r,t),{FORBID_TAGS:["style"]}).toString(),r),"sanitizeText"),He=s((r,t)=>typeof r=="string"?at(r,t):r.flat().map(i=>at(i,t)),"sanitizeTextOrArray"),Ue=s(r=>Ht.test(r),"hasBreaks"),Ge=s(r=>r.split(Ht),"splitBreaks"),$e=s(r=>r.replace(/#br#/g,"<br/>"),"placeholderToBreak"),_o=s(r=>r.replace(Ht,"#br#"),"breakToPlaceholder"),je=s(r=>{let t="";return r&&(t=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,t=CSS.escape(t)),t},"getUrl");var Ve=s(function(...r){let t=r.filter(i=>!isNaN(i));return Math.max(...t)},"getMax"),Ye=s(function(...r){let t=r.filter(i=>!isNaN(i));return Math.min(...t)},"getMin"),cn=s(function(r){let t=r.split(/(,)/),i=[];for(let e=0;e<t.length;e++){let d=t[e];if(d===","&&e>0&&e+1<t.length){let h=t[e-1],y=t[e+1];Xe(h,y)&&(d=h+","+y,e++,i.pop())}i.push(Ke(d))}return i.join("")},"parseGenericTypes"),Qi=s((r,t)=>Math.max(0,r.split(t).length-1),"countOccurrence"),Xe=s((r,t)=>{let i=Qi(r,"~"),e=Qi(t,"~");return i===1&&e===1},"shouldCombineSets"),Ke=s(r=>{let t=Qi(r,"~"),i=!1;if(t<=1)return r;t%2!==0&&r.startsWith("~")&&(r=r.substring(1),i=!0);let e=[...r],d=e.indexOf("~"),h=e.lastIndexOf("~");for(;d!==-1&&h!==-1&&d!==h;)e[d]="<",e[h]=">",d=e.indexOf("~"),h=e.lastIndexOf("~");return i&&e.unshift("~"),e.join("")},"processSet"),Fo=s(()=>window.MathMLElement!==void 0,"isMathMLSupported"),ci=/\$\$(.*)\$\$/g,Lo=s(r=>(r.match(ci)?.length??0)>0,"hasKatex"),dn=s(async(r,t)=>{let i=document.createElement("div");i.innerHTML=await Je(r,t),i.id="katex-temp",i.style.visibility="hidden",i.style.position="absolute",i.style.top="0",document.querySelector("body")?.insertAdjacentElement("beforeend",i);let d={width:i.clientWidth,height:i.clientHeight};return i.remove(),d},"calculateMathMLDimensions"),Ze=s(async(r,t)=>{if(!Lo(r))return r;if(!(Fo()||t.legacyMathML||t.forceLegacyMathML))return r.replace(ci,"MathML is unsupported in this environment.");{let{default:i}=await import("./katex-K3KEBU37.mjs"),e=t.forceLegacyMathML||!Fo()&&t.legacyMathML?"htmlAndMathml":"mathml";return r.split(Ht).map(d=>Lo(d)?`<div style="display: flex; align-items: center; justify-content: center; white-space: nowrap;">${d}</div>`:`<div>${d}</div>`).join("").replace(ci,(d,h)=>i.renderToString(h,{throwOnError:!0,displayMode:!0,output:e}).replace(/\n/g," ").replace(/<annotation.*<\/annotation>/g,""))}return r.replace(ci,"Katex is not supported in @mermaid-js/tiny. Please use the full mermaid library.")},"renderKatexUnsanitized"),Je=s(async(r,t)=>at(await Ze(r,t),t),"renderKatexSanitized"),Cn={getRows:We,sanitizeText:at,
`)}s(fn,"cssStyleSheetToString");var rs=s((r,t,i,e)=>{let d="";return r in di&&di[r]?d=di[r]({...i,svgId:e}):b.warn(`No theme found for ${r}`),` & {
font-family: ${i.fontFamily};
font-size: ${i.fontSize};
fill: ${i.textColor}
}
@keyframes edge-animation-frame {
from {
stroke-dashoffset: 0;
}
}
@keyframes dash {
to {
stroke-dashoffset: 0;
}
}
& .edge-animation-slow {
stroke-dasharray: 9,5 !important;
stroke-dashoffset: 900;
animation: dash 50s linear infinite;
stroke-linecap: round;
}
& .edge-animation-fast {
stroke-dasharray: 9,5 !important;
stroke-dashoffset: 900;
animation: dash 20s linear infinite;
stroke-linecap: round;
}
/* Classes common for multiple diagrams */
& .error-icon {
fill: ${i.errorBkgColor};
}
& .error-text {
fill: ${i.errorTextColor};
stroke: ${i.errorTextColor};
}
& .edge-thickness-normal {
stroke-width: ${i.strokeWidth??1}px;
}
& .edge-thickness-thick {
stroke-width: 3.5px
}
& .edge-pattern-solid {
stroke-dasharray: 0;
}
& .edge-thickness-invisible {
stroke-width: 0;
fill: none;
}
& .edge-pattern-dashed{
stroke-dasharray: 3;
}
.edge-pattern-dotted {
stroke-dasharray: 2;
}
& .marker {
fill: ${i.lineColor};
stroke: ${i.lineColor};
}
& .marker.cross {
stroke: ${i.lineColor};
}
& svg {
font-family: ${i.fontFamily};
font-size: ${i.fontSize};
}
& p {
margin: 0
}
${d}
.node .neo-node {
stroke: ${i.nodeBorder};
}
[data-look="neo"].node rect, [data-look="neo"].cluster rect, [data-look="neo"].node polygon {
stroke: ${i.useGradient?"url("+e+"-gradient)":i.nodeBorder};
filter: ${i.dropShadow?i.dropShadow.replace("url(#drop-shadow)",`url(${e}-drop-shadow)`):"none"};
}
[data-look="neo"].node path {
stroke: ${i.useGradient?"url("+e+"-gradient)":i.nodeBorder};
stroke-width: ${i.strokeWidth??1}px;
}
[data-look="neo"].node .outer-path {
filter: ${i.dropShadow?i.dropShadow.replace("url(#drop-shadow)",`url(${e}-drop-shadow)`):"none"};
}
[data-look="neo"].node .neo-line path {
stroke: ${i.nodeBorder};
filter: none;
}
[data-look="neo"].node circle{
stroke: ${i.useGradient?"url("+e+"-gradient)":i.nodeBorder};
filter: ${i.dropShadow?i.dropShadow.replace("url(#drop-shadow)",`url(${e}-drop-shadow)`):"none"};
}
[data-look="neo"].node circle .state-start{
fill: #000000;
}
[data-look="neo"].icon-shape .icon {
fill: ${i.useGradient?"url("+e+"-gradient)":i.nodeBorder};
filter: ${i.dropShadow?i.dropShadow.replace("url(#drop-shadow)",`url(${e}-drop-shadow)`):"none"};
}
[data-look="neo"].icon-shape .icon-neo path {
stroke: ${i.useGradient?"url("+e+"-gradient)":i.nodeBorder};
filter: ${i.dropShadow?i.dropShadow.replace("url(#drop-shadow)",`url(${e}-drop-shadow)`):"none"};
}
${t}
`},"getStyles"),vo=s((r,t)=>{t!==void 0&&(di[r]=t)},"addStylesForDiagram"),kn=rs;var er={};Yo(er,{clear:()=>os,getAccDescription:()=>as,getAccTitle:()=>ss,getDiagramTitle:()=>ns,setAccDescription:()=>ls,setAccTitle:()=>es,setDiagramTitle:()=>hs});var tr="",ir="",rr="",or=s(r=>at(r,It()),"sanitizeText"),os=s(()=>{tr="",rr="",ir=""},"clear"),es=s(r=>{tr=or(r).replace(/^\s+/g,"")},"setAccTitle"),ss=s(()=>tr,"getAccTitle"),ls=s(r=>{rr=or(r).replace(/\n\s+/g,`
`)},"setAccDescription"),as=s(()=>rr,"getAccDescription"),hs=s(r=>{ir=or(r)},"setDiagramTitle"),ns=s(()=>ir,"getDiagramTitle");var Mo=b,cs=vr,qo=It,qn=lo,wn=Ot;var ds=s(r=>at(r,qo()),"sanitizeText"),Cs=Ao,gs=s(()=>er,"getCommonDb"),Ci={},On=s((r,t,i)=>{Ci[r]&&Mo.warn(`Diagram with id ${r} already registered. Overwriting.`),Ci[r]=t,i&&_i(r,i),vo(r,t.styles),t.injectUtils?.(Mo,cs,qo,ds,Cs,gs(),()=>{})},"registerDiagram"),In=s(r=>{if(r in Ci)return Ci[r];throw new sr(r)},"getDiagram"),sr=class extends Error{static{s(this,"DiagramNotFoundError")}constructor(t){super(`Diagram ${t} not found.`)}};export{D as a,P as b,oe as c,T as d,n as e,c as f,de as g,jr as h,lt as i,eo as j,si as k,ue as l,Ot as m,Gi as n,me as o,Zh as p,Jh as q,Qh as r,lo as s,It as t,tn as u,rn as v,on as w,co as x,Bt as y,Ht as z,at as A,je as B,cn as C,Lo as D,dn as E,Je as F,Cn as G,Mr as H,qr as I,Qt as J,ti as K,ks as L,Ts as M,bs as N,is as O,Ao as P,fn as Q,kn as R,os as S,es as T,ss as U,ls as V,as as W,hs as X,ns as Y,er as Z,qo as _,qn as $,wn as aa,ds as ba,Cs as ca,On as da,In as ea};
/*! Bundled license information:
dompurify/dist/purify.es.mjs:
(*! @license DOMPurify 3.4.0 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.4.0/LICENSE *)
*/