mermaid
Version:
Markdown-ish syntax for generating flowcharts, mindmaps, sequence diagrams, class diagrams, gantt charts, git graphs and more.
2 lines (1 loc) • 1.94 kB
JavaScript
import{_ as c}from"./chunk-QJSWEUOL.mjs";import{a as n}from"./chunk-AQ6EADP3.mjs";var m=n(t=>{let{handDrawnSeed:r}=c();return{fill:t,hachureAngle:120,hachureGap:4,fillWeight:2,roughness:.7,stroke:t,seed:r}},"solidStateFill"),g=n(t=>Array.isArray(t)?t:t?t.split(";").map(r=>r.trim()).filter(Boolean):[],"normalizeStyleList"),p=n(t=>{let r=h([...t.cssCompiledStyles||[],...t.cssStyles||[],...g(t.labelStyle)]);return{stylesMap:r,stylesArray:[...r]}},"compileStyles"),h=n(t=>{let r=new Map;return t.forEach(o=>{let[i,s]=o.split(":");r.set(i.trim(),s?.trim())}),r},"styles2Map"),d=n(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"),S=n(t=>{let{stylesArray:r}=p(t),o=[],i=[],s=[],a=[];return r.forEach(e=>{let l=e[0];d(l)?o.push(e.join(":")+" !important"):(i.push(e.join(":")+" !important"),l.includes("stroke")&&s.push(e.join(":")+" !important"),l==="fill"&&a.push(e.join(":")+" !important"))}),{labelStyles:o.join(";"),nodeStyles:i.join(";"),stylesArray:r,borderStyles:s,backgroundStyles:a}},"styles2String"),w=n((t,r)=>{let{themeVariables:o,handDrawnSeed:i}=c(),{nodeBorder:s,mainBkg:a}=o,{stylesMap:e}=p(t);return Object.assign({roughness:.7,fill:e.get("fill")||a,fillStyle:"hachure",fillWeight:4,hachureGap:5.2,stroke:e.get("stroke")||s,seed:i,strokeWidth:e.get("stroke-width")?.replace("px","")||1.3,fillLineDash:[0,0],strokeLineDash:f(e.get("stroke-dasharray"))},r)},"userNodeOverrides"),f=n(t=>{if(!t)return[0,0];let r=t.trim().split(/\s+/).map(Number);if(r.length===1){let s=isNaN(r[0])?0:r[0];return[s,s]}let o=isNaN(r[0])?0:r[0],i=isNaN(r[1])?0:r[1];return[o,i]},"getStrokeDashArray");export{m as a,p as b,d as c,S as d,w as e};