@oversk7/pi-web-dsh-style 1.3.2 → 1.3.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/THIRD_PARTY_NOTICES.md +32 -3
- package/package.json +4 -1
- package/server.ts +190 -17
- package/web/app.css +9 -1
- package/web/app.js +7 -3
- package/web/assets/fonts/KaTeX_AMS-Regular.ttf +0 -0
- package/web/assets/fonts/KaTeX_AMS-Regular.woff +0 -0
- package/web/assets/fonts/KaTeX_AMS-Regular.woff2 +0 -0
- package/web/assets/fonts/KaTeX_Caligraphic-Bold.ttf +0 -0
- package/web/assets/fonts/KaTeX_Caligraphic-Bold.woff +0 -0
- package/web/assets/fonts/KaTeX_Caligraphic-Bold.woff2 +0 -0
- package/web/assets/fonts/KaTeX_Caligraphic-Regular.ttf +0 -0
- package/web/assets/fonts/KaTeX_Caligraphic-Regular.woff +0 -0
- package/web/assets/fonts/KaTeX_Caligraphic-Regular.woff2 +0 -0
- package/web/assets/fonts/KaTeX_Fraktur-Bold.ttf +0 -0
- package/web/assets/fonts/KaTeX_Fraktur-Bold.woff +0 -0
- package/web/assets/fonts/KaTeX_Fraktur-Bold.woff2 +0 -0
- package/web/assets/fonts/KaTeX_Fraktur-Regular.ttf +0 -0
- package/web/assets/fonts/KaTeX_Fraktur-Regular.woff +0 -0
- package/web/assets/fonts/KaTeX_Fraktur-Regular.woff2 +0 -0
- package/web/assets/fonts/KaTeX_Main-Bold.ttf +0 -0
- package/web/assets/fonts/KaTeX_Main-Bold.woff +0 -0
- package/web/assets/fonts/KaTeX_Main-Bold.woff2 +0 -0
- package/web/assets/fonts/KaTeX_Main-BoldItalic.ttf +0 -0
- package/web/assets/fonts/KaTeX_Main-BoldItalic.woff +0 -0
- package/web/assets/fonts/KaTeX_Main-BoldItalic.woff2 +0 -0
- package/web/assets/fonts/KaTeX_Main-Italic.ttf +0 -0
- package/web/assets/fonts/KaTeX_Main-Italic.woff +0 -0
- package/web/assets/fonts/KaTeX_Main-Italic.woff2 +0 -0
- package/web/assets/fonts/KaTeX_Main-Regular.ttf +0 -0
- package/web/assets/fonts/KaTeX_Main-Regular.woff +0 -0
- package/web/assets/fonts/KaTeX_Main-Regular.woff2 +0 -0
- package/web/assets/fonts/KaTeX_Math-BoldItalic.ttf +0 -0
- package/web/assets/fonts/KaTeX_Math-BoldItalic.woff +0 -0
- package/web/assets/fonts/KaTeX_Math-BoldItalic.woff2 +0 -0
- package/web/assets/fonts/KaTeX_Math-Italic.ttf +0 -0
- package/web/assets/fonts/KaTeX_Math-Italic.woff +0 -0
- package/web/assets/fonts/KaTeX_Math-Italic.woff2 +0 -0
- package/web/assets/fonts/KaTeX_SansSerif-Bold.ttf +0 -0
- package/web/assets/fonts/KaTeX_SansSerif-Bold.woff +0 -0
- package/web/assets/fonts/KaTeX_SansSerif-Bold.woff2 +0 -0
- package/web/assets/fonts/KaTeX_SansSerif-Italic.ttf +0 -0
- package/web/assets/fonts/KaTeX_SansSerif-Italic.woff +0 -0
- package/web/assets/fonts/KaTeX_SansSerif-Italic.woff2 +0 -0
- package/web/assets/fonts/KaTeX_SansSerif-Regular.ttf +0 -0
- package/web/assets/fonts/KaTeX_SansSerif-Regular.woff +0 -0
- package/web/assets/fonts/KaTeX_SansSerif-Regular.woff2 +0 -0
- package/web/assets/fonts/KaTeX_Script-Regular.ttf +0 -0
- package/web/assets/fonts/KaTeX_Script-Regular.woff +0 -0
- package/web/assets/fonts/KaTeX_Script-Regular.woff2 +0 -0
- package/web/assets/fonts/KaTeX_Size1-Regular.ttf +0 -0
- package/web/assets/fonts/KaTeX_Size1-Regular.woff +0 -0
- package/web/assets/fonts/KaTeX_Size1-Regular.woff2 +0 -0
- package/web/assets/fonts/KaTeX_Size2-Regular.ttf +0 -0
- package/web/assets/fonts/KaTeX_Size2-Regular.woff +0 -0
- package/web/assets/fonts/KaTeX_Size2-Regular.woff2 +0 -0
- package/web/assets/fonts/KaTeX_Size3-Regular.ttf +0 -0
- package/web/assets/fonts/KaTeX_Size3-Regular.woff +0 -0
- package/web/assets/fonts/KaTeX_Size3-Regular.woff2 +0 -0
- package/web/assets/fonts/KaTeX_Size4-Regular.ttf +0 -0
- package/web/assets/fonts/KaTeX_Size4-Regular.woff +0 -0
- package/web/assets/fonts/KaTeX_Size4-Regular.woff2 +0 -0
- package/web/assets/fonts/KaTeX_Typewriter-Regular.ttf +0 -0
- package/web/assets/fonts/KaTeX_Typewriter-Regular.woff +0 -0
- package/web/assets/fonts/KaTeX_Typewriter-Regular.woff2 +0 -0
- package/web/assets/katex.min.css +1 -0
- package/web/assets/markdown.LICENSE.txt +78 -0
- package/web/assets/markdown.js +536 -21
- package/web/assets/mermaid/chunks/abnfDiagram-YUKMZFIV-FZYDJU67.js +1 -0
- package/web/assets/mermaid/chunks/architecture-WOLXFQ4H-BZVX64AA.js +1 -0
- package/web/assets/mermaid/chunks/architectureDiagram-47P4ROYG-2BMC2Z7S.js +36 -0
- package/web/assets/mermaid/chunks/blockDiagram-E7TT5TSB-FH6ZULKF.js +140 -0
- package/web/assets/mermaid/chunks/c4Diagram-CRA5TL53-OG62EAHM.js +38 -0
- package/web/assets/mermaid/chunks/chunk-22D53RF2.js +2 -0
- package/web/assets/mermaid/chunks/chunk-25KVF5ZE.js +1 -0
- package/web/assets/mermaid/chunks/chunk-4HYFSIZT.js +1 -0
- package/web/assets/mermaid/chunks/chunk-4W4OQ3QY.js +1 -0
- package/web/assets/mermaid/chunks/chunk-5TQRX2ND.js +1 -0
- package/web/assets/mermaid/chunks/chunk-64OFLKGX.js +322 -0
- package/web/assets/mermaid/chunks/chunk-64OFLKGX.js.LEGAL.txt +17 -0
- package/web/assets/mermaid/chunks/chunk-6UFWKTSA.js +1 -0
- package/web/assets/mermaid/chunks/chunk-6ZAAIG6Q.js +10 -0
- package/web/assets/mermaid/chunks/chunk-76QEHT4T.js +1 -0
- package/web/assets/mermaid/chunks/chunk-A7665WVC.js +1 -0
- package/web/assets/mermaid/chunks/chunk-AECJS4LP.js +130 -0
- package/web/assets/mermaid/chunks/chunk-AECJS4LP.js.LEGAL.txt +5 -0
- package/web/assets/mermaid/chunks/chunk-ATQQWCXO.js +2 -0
- package/web/assets/mermaid/chunks/chunk-DQVO43GU.js +1 -0
- package/web/assets/mermaid/chunks/chunk-DSKRGV6V.js +1 -0
- package/web/assets/mermaid/chunks/chunk-EIBFAW37.js +1 -0
- package/web/assets/mermaid/chunks/chunk-FBC3PYSO.js +1 -0
- package/web/assets/mermaid/chunks/chunk-FQ5IIL54.js +88 -0
- package/web/assets/mermaid/chunks/chunk-GZYY6JMP.js +1 -0
- package/web/assets/mermaid/chunks/chunk-HIGPS4L2.js +1 -0
- package/web/assets/mermaid/chunks/chunk-HP75Y56I.js +2 -0
- package/web/assets/mermaid/chunks/chunk-JRAHLUQM.js +32 -0
- package/web/assets/mermaid/chunks/chunk-KNYDPLLK.js +1 -0
- package/web/assets/mermaid/chunks/chunk-L465623K.js +136 -0
- package/web/assets/mermaid/chunks/chunk-L7BMR7WL.js +1 -0
- package/web/assets/mermaid/chunks/chunk-LLGPMHB6.js +1 -0
- package/web/assets/mermaid/chunks/chunk-NBH7YOBD.js +15 -0
- package/web/assets/mermaid/chunks/chunk-NCOVM3YF.js +1 -0
- package/web/assets/mermaid/chunks/chunk-PHKIAKHS.js +1 -0
- package/web/assets/mermaid/chunks/chunk-PM2IFX5O.js +1 -0
- package/web/assets/mermaid/chunks/chunk-PN62QGJW.js +72 -0
- package/web/assets/mermaid/chunks/chunk-QHMFFOZZ.js +1 -0
- package/web/assets/mermaid/chunks/chunk-QQZBUVKZ.js +1 -0
- package/web/assets/mermaid/chunks/chunk-RV7WQMNL.js +1 -0
- package/web/assets/mermaid/chunks/chunk-STBOPOHX.js +1 -0
- package/web/assets/mermaid/chunks/chunk-T3FZWEYV.js +1 -0
- package/web/assets/mermaid/chunks/chunk-TMMWB6NQ.js +1 -0
- package/web/assets/mermaid/chunks/chunk-TPW5CADB.js +1 -0
- package/web/assets/mermaid/chunks/chunk-TSOLLCID.js +2 -0
- package/web/assets/mermaid/chunks/chunk-TWGPYWIY.js +1 -0
- package/web/assets/mermaid/chunks/chunk-WGMEMLED.js +1 -0
- package/web/assets/mermaid/chunks/chunk-XC2LKMMW.js +1 -0
- package/web/assets/mermaid/chunks/chunk-XHVVPFJ5.js +1 -0
- package/web/assets/mermaid/chunks/chunk-YIN5CSIF.js +2 -0
- package/web/assets/mermaid/chunks/chunk-YIN5CSIF.js.LEGAL.txt +12 -0
- package/web/assets/mermaid/chunks/chunk-YORIST7Z.js +1 -0
- package/web/assets/mermaid/chunks/chunk-YPXVLPXW.js +3 -0
- package/web/assets/mermaid/chunks/chunk-Z4WODCD2.js +213 -0
- package/web/assets/mermaid/chunks/chunk-ZAERIUBF.js +1 -0
- package/web/assets/mermaid/chunks/chunk-ZDOBOOWG.js +62 -0
- package/web/assets/mermaid/chunks/classDiagram-v2-K4WV4PDN-HXQD675C.js +217 -0
- package/web/assets/mermaid/chunks/cose-bilkent-JH36ORCC-3VHNHM7I.js +1 -0
- package/web/assets/mermaid/chunks/cynefin-EF2NZ3EQ-ZO5PPXJG.js +1 -0
- package/web/assets/mermaid/chunks/cynefinDiagram-3GCD6N5R-LFWDWE4E.js +62 -0
- package/web/assets/mermaid/chunks/dagre-W4DXFKR2-SDBBVBGG.js +4 -0
- package/web/assets/mermaid/chunks/diagram-2UJZ2QOL-YCKW3WNJ.js +200 -0
- package/web/assets/mermaid/chunks/diagram-OVF4WLC6-62NNPE34.js +24 -0
- package/web/assets/mermaid/chunks/diagram-PFPMY2P6-7RR2GTZ5.js +30 -0
- package/web/assets/mermaid/chunks/diagram-UMYRVEAY-Q4I25SMR.js +24 -0
- package/web/assets/mermaid/chunks/diagram-YEKJPTXX-VNUTOPRK.js +41 -0
- package/web/assets/mermaid/chunks/diagram-ZIFT7M5P-KALXX5CE.js +3 -0
- package/web/assets/mermaid/chunks/ebnfDiagram-VR2GEFS7-WIFBISHL.js +1 -0
- package/web/assets/mermaid/chunks/elk-IJKZMXRS-LGG232IL.js +27 -0
- package/web/assets/mermaid/chunks/erDiagram-O2IAPWRE-KWX2J2TX.js +99 -0
- package/web/assets/mermaid/chunks/eventmodeling-K75KTNOO-3JNV4VSP.js +1 -0
- package/web/assets/mermaid/chunks/flowDiagram-OXPTDLAJ-CUMOBDC3.js +1 -0
- package/web/assets/mermaid/chunks/ganttDiagram-R7TSEDQI-GCS3MRFX.js +292 -0
- package/web/assets/mermaid/chunks/gitGraph-VSP46ZUC-HSAXKLAG.js +1 -0
- package/web/assets/mermaid/chunks/gitGraphDiagram-XJZIOB7I-FB763ROZ.js +106 -0
- package/web/assets/mermaid/chunks/info-OHQRW6UA-C4R2B34T.js +1 -0
- package/web/assets/mermaid/chunks/infoDiagram-5W2HQ5XZ-XCQU5T5D.js +2 -0
- package/web/assets/mermaid/chunks/ishikawaDiagram-K3B6WC7H-UWYT66G7.js +70 -0
- package/web/assets/mermaid/chunks/journeyDiagram-COXZFDF6-DOW66RYW.js +139 -0
- package/web/assets/mermaid/chunks/kanban-definition-P3RFRI5V-K55BXDLO.js +89 -0
- package/web/assets/mermaid/chunks/katex-5AUD5AJN.js +257 -0
- package/web/assets/mermaid/chunks/mindmap-definition-LZFPQGKD-WG3FIZ5U.js +96 -0
- package/web/assets/mermaid/chunks/packet-JDAUHWVQ-SFUSDIUN.js +1 -0
- package/web/assets/mermaid/chunks/pegDiagram-BGZESJAR-MQOH3WII.js +1 -0
- package/web/assets/mermaid/chunks/pie-XZMESJXO-M76QC4CD.js +1 -0
- package/web/assets/mermaid/chunks/pieDiagram-CAPJLFHJ-V3WNR4Y2.js +39 -0
- package/web/assets/mermaid/chunks/quadrantDiagram-GDMTTRAM-DJLTATHS.js +7 -0
- package/web/assets/mermaid/chunks/radar-ABXABTNO-HSBJ6SSD.js +1 -0
- package/web/assets/mermaid/chunks/railroad-I3PHUGI6-4QJMJ7LG.js +1 -0
- package/web/assets/mermaid/chunks/railroad-abnf-LNEFI6M7-ZLNZ5ZRH.js +1 -0
- package/web/assets/mermaid/chunks/railroad-ebnf-DWYD2UWJ-EBV6ZOUW.js +1 -0
- package/web/assets/mermaid/chunks/railroad-peg-JR7BVNR7-X3E47TO7.js +1 -0
- package/web/assets/mermaid/chunks/railroadDiagram-SM67HX2B-ZHEERYJS.js +1 -0
- package/web/assets/mermaid/chunks/requirementDiagram-X7JNWC4A-TVHJNPPI.js +84 -0
- package/web/assets/mermaid/chunks/sankeyDiagram-UM26HJRW-FXHWY3MM.js +40 -0
- package/web/assets/mermaid/chunks/sequenceDiagram-ZO4K6R2Y-OP7DCVPK.js +169 -0
- package/web/assets/mermaid/chunks/sizeCapture-INFHLROL-2GUJIKNX.js +1 -0
- package/web/assets/mermaid/chunks/stateDiagram-v2-TBUQTH76-R26D6XHK.js +291 -0
- package/web/assets/mermaid/chunks/swimlanes-N4OXWK64-FPGACWHE.js +1 -0
- package/web/assets/mermaid/chunks/swimlanesDiagram-K3J5GTZL-YMNX34Q2.js +8 -0
- package/web/assets/mermaid/chunks/timeline-definition-YOQAKGHF-R2U2UR4K.js +120 -0
- package/web/assets/mermaid/chunks/treeView-D4JQ5SDB-3BQHZUCI.js +1 -0
- package/web/assets/mermaid/chunks/treemap-SAJKECNS-6NJPJ5NM.js +1 -0
- package/web/assets/mermaid/chunks/usecaseDiagram-VIAY4XPW-BCEIGXDX.js +370 -0
- package/web/assets/mermaid/chunks/vennDiagram-BLWOH2XV-DOV5W2IV.js +34 -0
- package/web/assets/mermaid/chunks/wardley-7MLQ67FV-ITOM4KQ2.js +1 -0
- package/web/assets/mermaid/chunks/wardleyDiagram-YMQ3BMBF-CGJ7AG4L.js +78 -0
- package/web/assets/mermaid/chunks/xychartDiagram-TAQBALBS-2MTP7IBV.js +7 -0
- package/web/assets/mermaid/mermaid.js +11 -0
- package/web/assets/mermaid/mermaid.js.LEGAL.txt +7 -0
- package/web/index.html +1 -0
- package/web/markdown-diagrams.js +147 -0
- package/web/markdown.ts +41 -2
- package/web/slash-commands.js +1 -0
- package/web/themes.css +46 -0
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import{a as Pt}from"./chunk-XC2LKMMW.js";import{a as Bt}from"./chunk-YORIST7Z.js";import{p as Vt}from"./chunk-22D53RF2.js";import"./chunk-STBOPOHX.js";import{C as ct,P as Dt,U as Rt,V as Ct,W as Nt,X as Ot,Y as Lt,Z as Ft,_ as jt,c as Et,d as Tt,e as zt,f as lt,r as At}from"./chunk-AECJS4LP.js";import{h as it}from"./chunk-4HYFSIZT.js";import{a as w}from"./chunk-EIBFAW37.js";import"./chunk-PHKIAKHS.js";function rt(t,n){let s=fe(t),e=s.filter(l=>ue(l,t)),i=0,r=0,o=[];if(e.length>1){let l=Wt(e);for(let u=0;u<e.length;++u){let a=e[u];a.angle=Math.atan2(a.x-l.x,a.y-l.y)}e.sort((u,a)=>a.angle-u.angle);let f=e[e.length-1];for(let u=0;u<e.length;++u){let a=e[u];r+=(f.x+a.x)*(a.y-f.y);let y={x:(a.x+f.x)/2,y:(a.y+f.y)/2},d=null;for(let b=0;b<a.parentIndex.length;++b)if(f.parentIndex.includes(a.parentIndex[b])){let p=t[a.parentIndex[b]],M=Math.atan2(a.x-p.x,a.y-p.y),T=Math.atan2(f.x-p.x,f.y-p.y),_=T-M;_<0&&(_+=2*Math.PI);let S=T-_/2,g=U(y,{x:p.x+p.radius*Math.sin(S),y:p.y+p.radius*Math.cos(S)});g>p.radius*2&&(g=p.radius*2),(d==null||d.width>g)&&(d={circle:p,width:g,p1:a,p2:f,large:g>p.radius,sweep:!0})}d!=null&&(o.push(d),i+=ht(d.circle.radius,d.width),f=a)}}else{let l=t[0];for(let u=1;u<t.length;++u)t[u].radius<l.radius&&(l=t[u]);let f=!1;for(let u=0;u<t.length;++u)if(U(t[u],l)>Math.abs(l.radius-t[u].radius)){f=!0;break}f?i=r=0:(i=l.radius*l.radius*Math.PI,o.push({circle:l,p1:{x:l.x,y:l.y+l.radius},p2:{x:l.x-1e-10,y:l.y+l.radius},width:l.radius*2,large:!0,sweep:!0}))}return r/=2,n&&(n.area=i+r,n.arcArea=i,n.polygonArea=r,n.arcs=o,n.innerPoints=e,n.intersectionPoints=s),i+r}function ue(t,n){return n.every(s=>U(t,s)<s.radius+1e-10)}function fe(t){let n=[];for(let s=0;s<t.length;++s)for(let e=s+1;e<t.length;++e){let i=Gt(t[s],t[e]);for(let r of i)r.parentIndex=[s,e],n.push(r)}return n}function ht(t,n){return t*t*Math.acos(1-n/t)-(t-n)*Math.sqrt(n*(2*t-n))}function U(t,n){return Math.sqrt((t.x-n.x)*(t.x-n.x)+(t.y-n.y)*(t.y-n.y))}function mt(t,n,s){if(s>=t+n)return 0;if(s<=Math.abs(t-n))return Math.PI*Math.min(t,n)*Math.min(t,n);let e=t-(s*s-n*n+t*t)/(2*s),i=n-(s*s-t*t+n*n)/(2*s);return ht(t,e)+ht(n,i)}function Gt(t,n){let s=U(t,n),e=t.radius,i=n.radius;if(s>=e+i||s<=Math.abs(e-i))return[];let r=(e*e-i*i+s*s)/(2*s),o=Math.sqrt(e*e-r*r),l=t.x+r*(n.x-t.x)/s,f=t.y+r*(n.y-t.y)/s,u=-(n.y-t.y)*(o/s),a=-(n.x-t.x)*(o/s);return[{x:l+u,y:f-a},{x:l-u,y:f+a}]}function Wt(t){let n={x:0,y:0};for(let s of t)n.x+=s.x,n.y+=s.y;return n.x/=t.length,n.y/=t.length,n}function he(t,n,s,e){e=e||{};let i=e.maxIterations||100,r=e.tolerance||1e-10,o=t(n),l=t(s),f=s-n;if(o*l>0)throw"Initial bisect points must have opposite signs";if(o===0)return n;if(l===0)return s;for(let u=0;u<i;++u){f/=2;let a=n+f,y=t(a);if(y*o>=0&&(n=a),Math.abs(f)<r||y===0)return a}return n+f}function dt(t){let n=new Array(t);for(let s=0;s<t;++s)n[s]=0;return n}function qt(t,n){return dt(t).map(()=>dt(n))}function tt(t,n){let s=0;for(let e=0;e<t.length;++e)s+=t[e]*n[e];return s}function gt(t){return Math.sqrt(tt(t,t))}function xt(t,n,s){for(let e=0;e<n.length;++e)t[e]=n[e]*s}function J(t,n,s,e,i){for(let r=0;r<t.length;++r)t[r]=n*s[r]+e*i[r]}function Kt(t,n,s){s=s||{};let e=s.maxIterations||n.length*200,i=s.nonZeroDelta||1.05,r=s.zeroDelta||.001,o=s.minErrorDelta||1e-6,l=s.minErrorDelta||1e-5,f=s.rho!==void 0?s.rho:1,u=s.chi!==void 0?s.chi:2,a=s.psi!==void 0?s.psi:-.5,y=s.sigma!==void 0?s.sigma:.5,d,b=n.length,p=new Array(b+1);p[0]=n,p[0].fx=t(n),p[0].id=0;for(let v=0;v<b;++v){let c=n.slice();c[v]=c[v]?c[v]*i:r,p[v+1]=c,p[v+1].fx=t(c),p[v+1].id=v+1}function M(v){for(let c=0;c<v.length;c++)p[b][c]=v[c];p[b].fx=v.fx}let T=(v,c)=>v.fx-c.fx,_=n.slice(),S=n.slice(),g=n.slice(),m=n.slice();for(let v=0;v<e;++v){if(p.sort(T),s.history){let x=p.map(h=>{let D=h.slice();return D.fx=h.fx,D.id=h.id,D});x.sort((h,D)=>h.id-D.id),s.history.push({x:p[0].slice(),fx:p[0].fx,simplex:x})}d=0;for(let x=0;x<b;++x)d=Math.max(d,Math.abs(p[0][x]-p[1][x]));if(Math.abs(p[0].fx-p[b].fx)<o&&d<l)break;for(let x=0;x<b;++x){_[x]=0;for(let h=0;h<b;++h)_[x]+=p[h][x];_[x]/=b}let c=p[b];if(J(S,1+f,_,-f,c),S.fx=t(S),S.fx<p[0].fx)J(m,1+u,_,-u,c),m.fx=t(m),m.fx<S.fx?M(m):M(S);else if(S.fx>=p[b-1].fx){let x=!1;if(S.fx>c.fx?(J(g,1+a,_,-a,c),g.fx=t(g),g.fx<c.fx?M(g):x=!0):(J(g,1-a*f,_,a*f,c),g.fx=t(g),g.fx<S.fx?M(g):x=!0),x){if(y>=1)break;for(let h=1;h<p.length;++h)J(p[h],1-y,p[0],y,p[h]),p[h].fx=t(p[h])}}else M(S)}return p.sort(T),{fx:p[0].fx,x:p[0]}}function de(t,n,s,e,i,r,o){let l=s.fx,f=tt(s.fxprime,n),u=l,a=l,y=f,d=0;i=i||1,r=r||1e-6,o=o||.1;function b(p,M,T){for(let _=0;_<16;++_)if(i=(p+M)/2,J(e.x,1,s.x,i,n),u=e.fx=t(e.x,e.fxprime),y=tt(e.fxprime,n),u>l+r*i*f||u>=T)M=i;else{if(Math.abs(y)<=-o*f)return i;y*(M-p)>=0&&(M=p),p=i,T=u}return 0}for(let p=0;p<10;++p){if(J(e.x,1,s.x,i,n),u=e.fx=t(e.x,e.fxprime),y=tt(e.fxprime,n),u>l+r*i*f||p&&u>=a)return b(d,i,a);if(Math.abs(y)<=-o*f)return i;if(y>=0)return b(i,d,u);a=u,d=i,i*=2}return i}function ge(t,n,s){let e={x:n.slice(),fx:0,fxprime:n.slice()},i={x:n.slice(),fx:0,fxprime:n.slice()},r=n.slice(),o,l,f=1,u;s=s||{},u=s.maxIterations||n.length*20,e.fx=t(e.x,e.fxprime),o=e.fxprime.slice(),xt(o,e.fxprime,-1);for(let a=0;a<u;++a){if(f=de(t,o,e,i,f),s.history&&s.history.push({x:e.x.slice(),fx:e.fx,fxprime:e.fxprime.slice(),alpha:f}),!f)xt(o,e.fxprime,-1);else{J(r,1,i.fxprime,-1,e.fxprime);let y=tt(e.fxprime,e.fxprime),d=Math.max(0,tt(r,i.fxprime)/y);J(o,d,o,-1,i.fxprime),l=e,e=i,i=l}if(gt(e.fxprime)<=1e-5)break}return s.history&&s.history.push({x:e.x.slice(),fx:e.fx,fxprime:e.fxprime.slice(),alpha:f}),e}function Ht(t,n={}){n.maxIterations=n.maxIterations||500;let s=n.initialLayout||me,e=n.lossFunction||et,i=xe(t,n),r=s(i,n),o=Object.keys(r),l=[];for(let a of o)l.push(r[a].x),l.push(r[a].y);let u=Kt(a=>{let y={};for(let d=0;d<o.length;++d){let b=o[d];y[b]={x:a[2*d],y:a[2*d+1],radius:r[b].radius}}return e(y,i)},l,n).x;for(let a=0;a<o.length;++a){let y=o[a];r[y].x=u[2*a],r[y].y=u[2*a+1]}return r}var Yt=1e-10;function yt(t,n,s){return Math.min(t,n)*Math.min(t,n)*Math.PI<=s+Yt?Math.abs(t-n):he(e=>mt(t,n,e)-s,0,t+n)}function xe(t,n={}){let s=n.distinct,e=t.map(l=>Object.assign({},l));function i(l){return l.join(";")}if(s){let l=new Map;for(let f of e)for(let u=0;u<f.sets.length;u++){let a=String(f.sets[u]);l.set(a,f.size+(l.get(a)||0));for(let y=u+1;y<f.sets.length;y++){let d=String(f.sets[y]),b=`${a};${d}`,p=`${d};${a}`;l.set(b,f.size+(l.get(b)||0)),l.set(p,f.size+(l.get(p)||0))}}for(let f of e)f.sets.length<3&&(f.size=l.get(i(f.sets)))}let r=[],o=new Set;for(let l of e)if(l.sets.length===1)r.push(l.sets[0]);else if(l.sets.length===2){let f=l.sets[0],u=l.sets[1];o.add(i(l.sets)),o.add(i([u,f]))}r.sort((l,f)=>l===f?0:l<f?-1:1);for(let l=0;l<r.length;++l){let f=r[l];for(let u=l+1;u<r.length;++u){let a=r[u];o.has(i([f,a]))||e.push({sets:[f,a],size:0})}}return e}function ye(t,n,s){let e=qt(n.length,n.length),i=qt(n.length,n.length);return t.filter(r=>r.sets.length===2).forEach(r=>{let o=s[r.sets[0]],l=s[r.sets[1]],f=Math.sqrt(n[o].size/Math.PI),u=Math.sqrt(n[l].size/Math.PI),a=yt(f,u,r.size);e[o][l]=e[l][o]=a;let y=0;r.size+1e-10>=Math.min(n[o].size,n[l].size)?y=1:r.size<=1e-10&&(y=-1),i[o][l]=i[l][o]=y}),{distances:e,constraints:i}}function pe(t,n,s,e){for(let r=0;r<n.length;++r)n[r]=0;let i=0;for(let r=0;r<s.length;++r){let o=t[2*r],l=t[2*r+1];for(let f=r+1;f<s.length;++f){let u=t[2*f],a=t[2*f+1],y=s[r][f],d=e[r][f],b=(u-o)*(u-o)+(a-l)*(a-l),p=Math.sqrt(b),M=b-y*y;d>0&&p<=y||d<0&&p>=y||(i+=2*M*M,n[2*r]+=4*M*(o-u),n[2*r+1]+=4*M*(l-a),n[2*f]+=4*M*(u-o),n[2*f+1]+=4*M*(a-l))}}return i}function me(t,n={}){let s=ve(t,n),e=n.lossFunction||et;if(t.length>=8){let i=be(t,n),r=e(i,t),o=e(s,t);r+1e-8<o&&(s=i)}return s}function be(t,n={}){let s=n.restarts||10,e=[],i={};for(let d of t)d.sets.length===1&&(i[d.sets[0]]=e.length,e.push(d));let{distances:r,constraints:o}=ye(t,e,i),l=gt(r.map(gt))/r.length;r=r.map(d=>d.map(b=>b/l));let f=(d,b)=>pe(d,b,r,o),u=null;for(let d=0;d<s;++d){let b=dt(r.length*2).map(Math.random),p=ge(f,b,n);(!u||p.fx<u.fx)&&(u=p)}let a=u.x,y={};for(let d=0;d<e.length;++d){let b=e[d];y[b.sets[0]]={x:a[2*d]*l,y:a[2*d+1]*l,radius:Math.sqrt(b.size/Math.PI)}}if(n.history)for(let d of n.history)xt(d.x,l);return y}function ve(t,n){let s=n&&n.lossFunction?n.lossFunction:et,e={},i={};for(let y of t)if(y.sets.length===1){let d=y.sets[0];e[d]={x:1e10,y:1e10,rowid:e.length,size:y.size,radius:Math.sqrt(y.size/Math.PI)},i[d]=[]}t=t.filter(y=>y.sets.length===2);for(let y of t){let d=y.weight!=null?y.weight:1,b=y.sets[0],p=y.sets[1];y.size+Yt>=Math.min(e[b].size,e[p].size)&&(d=0),i[b].push({set:p,size:y.size,weight:d}),i[p].push({set:b,size:y.size,weight:d})}let r=[];Object.keys(i).forEach(y=>{let d=0;for(let b=0;b<i[y].length;++b)d+=i[y][b].size*i[y][b].weight;r.push({set:y,size:d})});function o(y,d){return d.size-y.size}r.sort(o);let l={};function f(y){return y.set in l}function u(y,d){e[d].x=y.x,e[d].y=y.y,l[d]=!0}u({x:0,y:0},r[0].set);for(let y=1;y<r.length;++y){let d=r[y].set,b=i[d].filter(f),p=e[d];if(b.sort(o),b.length===0)throw"ERROR: missing pairwise overlap information";let M=[];for(var a=0;a<b.length;++a){let S=e[b[a].set],g=yt(p.radius,S.radius,b[a].size);M.push({x:S.x+g,y:S.y}),M.push({x:S.x-g,y:S.y}),M.push({y:S.y+g,x:S.x}),M.push({y:S.y-g,x:S.x});for(let m=a+1;m<b.length;++m){let v=e[b[m].set],c=yt(p.radius,v.radius,b[m].size),x=Gt({x:S.x,y:S.y,radius:g},{x:v.x,y:v.y,radius:c});M.push(...x)}}let T=1e50,_=M[0];for(let S of M){e[d].x=S.x,e[d].y=S.y;let g=s(e,t);g<T&&(T=g,_=S)}u(_,d)}return e}function et(t,n){let s=0;for(let e of n){if(e.sets.length===1)continue;let i;if(e.sets.length===2){let o=t[e.sets[0]],l=t[e.sets[1]];i=mt(o.radius,l.radius,U(o,l))}else i=rt(e.sets.map(o=>t[o]));let r=e.weight!=null?e.weight:1;s+=r*(i-e.size)*(i-e.size)}return s}function Xt(t,n){let s=0;for(let e of n){if(e.sets.length===1)continue;let i;if(e.sets.length===2){let l=t[e.sets[0]],f=t[e.sets[1]];i=mt(l.radius,f.radius,U(l,f))}else i=rt(e.sets.map(l=>t[l]));let r=e.weight!=null?e.weight:1,o=Math.log((i+1)/(e.size+1));s+=r*o*o}return s}function ke(t,n,s){if(s==null?t.sort((i,r)=>r.radius-i.radius):t.sort(s),t.length>0){let i=t[0].x,r=t[0].y;for(let o of t)o.x-=i,o.y-=r}if(t.length===2&&U(t[0],t[1])<Math.abs(t[1].radius-t[0].radius)&&(t[1].x=t[0].x+t[0].radius-t[1].radius-1e-10,t[1].y=t[0].y),t.length>1){let i=Math.atan2(t[1].x,t[1].y)-n,r=Math.cos(i),o=Math.sin(i);for(let l of t){let f=l.x,u=l.y;l.x=r*f-o*u,l.y=o*f+r*u}}if(t.length>2){let i=Math.atan2(t[2].x,t[2].y)-n;for(;i<0;)i+=2*Math.PI;for(;i>2*Math.PI;)i-=2*Math.PI;if(i>Math.PI){let r=t[1].y/(1e-10+t[1].x);for(let o of t){var e=(o.x+r*o.y)/(1+r*r);o.x=2*e-o.x,o.y=2*e*r-o.y}}}}function Ie(t){t.forEach(i=>{i.parent=i});function n(i){return i.parent!==i&&(i.parent=n(i.parent)),i.parent}function s(i,r){let o=n(i),l=n(r);o.parent=l}for(let i=0;i<t.length;++i)for(let r=i+1;r<t.length;++r){let o=t[i].radius+t[r].radius;U(t[i],t[r])+1e-10<o&&s(t[r],t[i])}let e=new Map;for(let i=0;i<t.length;++i){let r=n(t[i]).parent.setid;e.has(r)||e.set(r,[]),e.get(r).push(t[i])}return t.forEach(i=>{delete i.parent}),Array.from(e.values())}function pt(t){let n=s=>{let e=t.reduce((r,o)=>Math.max(r,o[s]+o.radius),Number.NEGATIVE_INFINITY),i=t.reduce((r,o)=>Math.min(r,o[s]-o.radius),Number.POSITIVE_INFINITY);return{max:e,min:i}};return{xRange:n("x"),yRange:n("y")}}function Zt(t,n,s){n==null&&(n=Math.PI/2);let e=$t(t).map(u=>Object.assign({},u)),i=Ie(e);for(let u of i){ke(u,n,s);let a=pt(u);u.size=(a.xRange.max-a.xRange.min)*(a.yRange.max-a.yRange.min),u.bounds=a}i.sort((u,a)=>a.size-u.size),e=i[0];let r=e.bounds,o=(r.xRange.max-r.xRange.min)/50;function l(u,a,y){if(!u)return;let d=u.bounds,b,p;if(a)b=r.xRange.max-d.xRange.min+o;else{b=r.xRange.max-d.xRange.max;let M=(d.xRange.max-d.xRange.min)/2-(r.xRange.max-r.xRange.min)/2;M<0&&(b+=M)}if(y)p=r.yRange.max-d.yRange.min+o;else{p=r.yRange.max-d.yRange.max;let M=(d.yRange.max-d.yRange.min)/2-(r.yRange.max-r.yRange.min)/2;M<0&&(p+=M)}for(let M of u)M.x+=b,M.y+=p,e.push(M)}let f=1;for(;f<i.length;)l(i[f],!0,!1),l(i[f+1],!1,!0),l(i[f+2],!0,!0),f+=3,r=pt(e);return Qt(e)}function Jt(t,n,s,e,i){let r=$t(t);n-=2*e,s-=2*e;let{xRange:o,yRange:l}=pt(r);if(o.max===o.min||l.max===l.min)return console.log("not scaling solution: zero size detected"),t;let f,u;if(i){let b=Math.sqrt(i/Math.PI)*2;f=n/b,u=s/b}else f=n/(o.max-o.min),u=s/(l.max-l.min);let a=Math.min(u,f),y=(n-(o.max-o.min)*a)/2,d=(s-(l.max-l.min)*a)/2;return Qt(r.map(b=>({radius:a*b.radius,x:e+y+(b.x-o.min)*a,y:e+d+(b.y-l.min)*a,setid:b.setid})))}function Qt(t){let n={};for(let s of t)n[s.setid]=s;return n}function $t(t){return Object.keys(t).map(s=>Object.assign(t[s],{setid:s}))}function te(t={}){let n=!1,s=600,e=350,i=15,r=1e3,o=Math.PI/2,l=!0,f=null,u=!0,a=!0,y=null,d=null,b=!1,p=null,M=t&&t.symmetricalTextCentre?t.symmetricalTextCentre:!1,T={},_=t&&t.colourScheme?t.colourScheme:t&&t.colorScheme?t.colorScheme:["#1f77b4","#ff7f0e","#2ca02c","#d62728","#9467bd","#8c564b","#e377c2","#7f7f7f","#bcbd22","#17becf"],S=0,g=function(x){if(x in T)return T[x];var h=T[x]=_[S];return S+=1,S>=_.length&&(S=0),h},m=Ht,v=et;function c(x){let h=x.datum(),D=new Set;h.forEach(k=>{k.size==0&&k.sets.length==1&&D.add(k.sets[0])}),h=h.filter(k=>!k.sets.some(O=>D.has(O)));let I={},R={};if(h.length>0){let k=m(h,{lossFunction:v,distinct:b});l&&(k=Zt(k,o,d)),I=Jt(k,s,e,i,f),R=ne(I,h,M)}let G={};h.forEach(k=>{k.label&&(G[k.sets]=k.label)});function P(k){if(k.sets in G)return G[k.sets];if(k.sets.length==1)return""+k.sets[0]}x.selectAll("svg").data([I]).enter().append("svg");let N=x.select("svg");n?N.attr("viewBox",`0 0 ${s} ${e}`):N.attr("width",s).attr("height",e);let A={},C=!1;N.selectAll(".venn-area path").each(function(k){let O=this.getAttribute("d");k.sets.length==1&&O&&!b&&(C=!0,A[k.sets[0]]=we(O))});function E(k){return O=>{let $=k.sets.map(Z=>{let X=A[Z],q=I[Z];return X||(X={x:s/2,y:e/2,radius:1}),q||(q={x:s/2,y:e/2,radius:1}),{x:X.x*(1-O)+q.x*O,y:X.y*(1-O)+q.y*O,radius:X.radius*(1-O)+q.radius*O}});return Ut($,p)}}let L=N.selectAll(".venn-area").data(h,k=>k.sets),V=L.enter().append("g").attr("class",k=>`venn-area venn-${k.sets.length==1?"circle":"intersection"}${k.colour||k.color?" venn-coloured":""}`).attr("data-venn-sets",k=>k.sets.join("_")),F=V.append("path"),W=V.append("text").attr("class","label").text(k=>P(k)).attr("text-anchor","middle").attr("dy",".35em").attr("x",s/2).attr("y",e/2);a&&(F.style("fill-opacity","0").filter(k=>k.sets.length==1).style("fill",k=>k.colour?k.colour:k.color?k.color:g(k.sets)).style("fill-opacity",".25"),W.style("fill",k=>k.colour||k.color?"#FFF":t.textFill?t.textFill:k.sets.length==1?g(k.sets):"#444"));function B(k){return typeof k.transition=="function"?k.transition("venn").duration(r):k}let j=x;C&&typeof j.transition=="function"?(j=B(x),j.selectAll("path").attrTween("d",E)):j.selectAll("path").attr("d",k=>Ut(k.sets.map(O=>I[O])),p);let z=j.selectAll("text").filter(k=>k.sets in R).text(k=>P(k)).attr("x",k=>Math.floor(R[k.sets].x)).attr("y",k=>Math.floor(R[k.sets].y));u&&(C?"on"in z?z.on("end",ut(I,P)):z.each("end",ut(I,P)):z.each(ut(I,P)));let Y=B(L.exit()).remove();typeof L.transition=="function"&&Y.selectAll("path").attrTween("d",E);let H=Y.selectAll("text").attr("x",s/2).attr("y",e/2);return y!==null&&(W.style("font-size","0px"),z.style("font-size",y),H.style("font-size","0px")),{circles:I,textCentres:R,nodes:L,enter:V,update:j,exit:Y}}return c.wrap=function(x){return arguments.length?(u=x,c):u},c.useViewBox=function(){return n=!0,c},c.width=function(x){return arguments.length?(s=x,c):s},c.height=function(x){return arguments.length?(e=x,c):e},c.padding=function(x){return arguments.length?(i=x,c):i},c.distinct=function(x){return arguments.length?(b=x,c):b},c.colours=function(x){return arguments.length?(g=x,c):g},c.colors=function(x){return arguments.length?(g=x,c):g},c.fontSize=function(x){return arguments.length?(y=x,c):y},c.round=function(x){return arguments.length?(p=x,c):p},c.duration=function(x){return arguments.length?(r=x,c):r},c.layoutFunction=function(x){return arguments.length?(m=x,c):m},c.normalize=function(x){return arguments.length?(l=x,c):l},c.scaleToFit=function(x){return arguments.length?(f=x,c):f},c.styled=function(x){return arguments.length?(a=x,c):a},c.orientation=function(x){return arguments.length?(o=x,c):o},c.orientationOrder=function(x){return arguments.length?(d=x,c):d},c.lossFunction=function(x){return arguments.length?(v=x==="default"?et:x==="logRatio"?Xt:x,c):v},c}function ut(t,n){return function(s){let e=this,i=t[s.sets[0]].radius||50,r=n(s)||"",o=r.split(/\s+/).reverse(),f=(r.length+o.length)/3,u=o.pop(),a=[u],y=0,d=1.1;e.textContent=null;let b=[];function p(g){let m=e.ownerDocument.createElementNS(e.namespaceURI,"tspan");return m.textContent=g,b.push(m),e.append(m),m}let M=p(u);for(;u=o.pop(),!!u;){a.push(u);let g=a.join(" ");M.textContent=g,g.length>f&&M.getComputedTextLength()>i&&(a.pop(),M.textContent=a.join(" "),a=[u],M=p(u),y++)}let T=.35-y*d/2,_=e.getAttribute("x"),S=e.getAttribute("y");b.forEach((g,m)=>{g.setAttribute("x",_),g.setAttribute("y",S),g.setAttribute("dy",`${T+m*d}em`)})}}function ft(t,n,s){let e=n[0].radius-U(n[0],t);for(let i=1;i<n.length;++i){let r=n[i].radius-U(n[i],t);r<=e&&(e=r)}for(let i=0;i<s.length;++i){let r=U(s[i],t)-s[i].radius;r<=e&&(e=r)}return e}function ee(t,n,s){let e=[];for(let a of t)e.push({x:a.x,y:a.y}),e.push({x:a.x+a.radius/2,y:a.y}),e.push({x:a.x-a.radius/2,y:a.y}),e.push({x:a.x,y:a.y+a.radius/2}),e.push({x:a.x,y:a.y-a.radius/2});let i=e[0],r=ft(e[0],t,n);for(let a=1;a<e.length;++a){let y=ft(e[a],t,n);y>=r&&(i=e[a],r=y)}let o=Kt(a=>-1*ft({x:a[0],y:a[1]},t,n),[i.x,i.y],{maxIterations:500,minErrorDelta:1e-10}).x,l={x:s?0:o[0],y:o[1]},f=!0;for(let a of t)if(U(l,a)>a.radius){f=!1;break}for(let a of n)if(U(l,a)<a.radius){f=!1;break}if(f)return l;if(t.length==1)return{x:t[0].x,y:t[0].y};let u={};return rt(t,u),u.arcs.length===0?{x:0,y:-1e3,disjoint:!0}:u.arcs.length==1?{x:u.arcs[0].circle.x,y:u.arcs[0].circle.y}:n.length?ee(t,[]):Wt(u.arcs.map(a=>a.p1))}function Me(t){let n={},s=Object.keys(t);for(let e of s)n[e]=[];for(let e=0;e<s.length;e++){let i=s[e],r=t[i];for(let o=e+1;o<s.length;++o){let l=s[o],f=t[l],u=U(r,f);u+f.radius<=r.radius+1e-10?n[l].push(i):u+r.radius<=f.radius+1e-10&&n[i].push(l)}}return n}function ne(t,n,s){let e={},i=Me(t);for(let r=0;r<n.length;++r){let o=n[r].sets,l={},f={};for(let d=0;d<o.length;++d){l[o[d]]=!0;let b=i[o[d]];for(let p=0;p<b.length;++p)f[b[p]]=!0}let u=[],a=[];for(let d in t)d in l?u.push(t[d]):d in f||a.push(t[d]);let y=ee(u,a,s);e[o]=y,y.disjoint&&n[r].size>0&&console.log("WARNING: area "+o+" not represented on screen")}return e}function Se(t,n,s){let e=[];return e.push(`
|
|
2
|
+
M`,t,n),e.push(`
|
|
3
|
+
m`,-s,0),e.push(`
|
|
4
|
+
a`,s,s,0,1,0,s*2,0),e.push(`
|
|
5
|
+
a`,s,s,0,1,0,-s*2,0),e.join(" ")}function we(t){let n=t.split(" ");return{x:Number.parseFloat(n[1]),y:Number.parseFloat(n[2]),radius:-Number.parseFloat(n[4])}}function se(t){if(t.length===0)return[];let n={};return rt(t,n),n.arcs}function ie(t,n){if(t.length===0)return"M 0 0";let s=Math.pow(10,n||0),e=n!=null?r=>Math.round(r*s)/s:r=>r;if(t.length==1){let r=t[0].circle;return Se(e(r.x),e(r.y),e(r.radius))}let i=[`
|
|
6
|
+
M`,e(t[0].p2.x),e(t[0].p2.y)];for(let r of t){let o=e(r.circle.radius);i.push(`
|
|
7
|
+
A`,o,o,0,r.large?1:0,r.sweep?1:0,e(r.p1.x),e(r.p1.y))}return i.join(" ")}function Ut(t,n){return ie(se(t),n)}function re(t,n={}){let{lossFunction:s,layoutFunction:e=Ht,normalize:i=!0,orientation:r=Math.PI/2,orientationOrder:o,width:l=600,height:f=350,padding:u=15,scaleToFit:a=!1,symmetricalTextCentre:y=!1,distinct:d,round:b=2}=n,p=e(t,{lossFunction:s==="default"||!s?et:s==="logRatio"?Xt:s,distinct:d});i&&(p=Zt(p,r,o));let M=Jt(p,l,f,u,a),T=ne(M,t,y),_=new Map(Object.keys(M).map(m=>[m,{set:m,x:M[m].x,y:M[m].y,radius:M[m].radius}])),S=t.map(m=>{let v=m.sets.map(h=>_.get(h)),c=se(v),x=ie(c,b);return{circles:v,arcs:c,path:x,area:m,has:new Set(m.sets)}});function g(m){let v="";for(let c of S)c.has.size>m.length&&m.every(x=>c.has.has(x))&&(v+=" "+c.path);return v}return S.map(({circles:m,arcs:v,path:c,area:x})=>({data:x,text:T[x.sets],circles:m,arcs:v,path:c,distinctPath:c+g(x.sets)}))}var bt=(function(){var t=w(function(S,g,m,v){for(m=m||{},v=S.length;v--;m[S[v]]=g);return m},"o"),n=[5,8],s=[7,8,11,12,17,19,22,24],e=[1,17],i=[1,18],r=[7,8,11,12,14,15,16,17,19,20,21,22,24,27],o=[1,31],l=[1,39],f=[7,8,11,12,17,19,22,24,27],u=[1,57],a=[1,56],y=[1,58],d=[1,59],b=[1,60],p=[7,8,11,12,16,17,19,20,22,24,27,31,32,33],M={trace:w(function(){},"trace"),yy:{},symbols_:{error:2,start:3,optNewlines:4,VENN:5,document:6,EOF:7,NEWLINE:8,line:9,statement:10,TITLE:11,SET:12,identifier:13,BRACKET_LABEL:14,COLON:15,NUMERIC:16,UNION:17,identifierList:18,TEXT:19,IDENTIFIER:20,STRING:21,INDENT_TEXT:22,indentedTextTail:23,STYLE:24,stylesOpt:25,styleField:26,COMMA:27,styleValue:28,valueTokens:29,valueToken:30,HEXCOLOR:31,RGBCOLOR:32,RGBACOLOR:33,$accept:0,$end:1},terminals_:{2:"error",5:"VENN",7:"EOF",8:"NEWLINE",11:"TITLE",12:"SET",14:"BRACKET_LABEL",15:"COLON",16:"NUMERIC",17:"UNION",19:"TEXT",20:"IDENTIFIER",21:"STRING",22:"INDENT_TEXT",24:"STYLE",27:"COMMA",31:"HEXCOLOR",32:"RGBCOLOR",33:"RGBACOLOR"},productions_:[0,[3,4],[4,0],[4,2],[6,0],[6,2],[9,1],[9,1],[10,1],[10,2],[10,3],[10,4],[10,5],[10,2],[10,3],[10,4],[10,5],[10,3],[10,3],[10,3],[10,4],[10,4],[10,2],[10,3],[23,1],[23,1],[23,1],[23,2],[23,2],[25,1],[25,3],[26,3],[28,1],[28,1],[29,1],[29,2],[30,1],[30,1],[30,1],[30,1],[30,1],[18,1],[18,3],[13,1],[13,1]],performAction:w(function(g,m,v,c,x,h,D){var I=h.length-1;switch(x){case 1:return h[I-1];case 2:case 3:case 4:this.$=[];break;case 5:h[I-1].push(h[I]),this.$=h[I-1];break;case 6:this.$=[];break;case 7:case 22:case 32:case 36:case 37:case 38:case 39:case 40:this.$=h[I];break;case 8:c.setDiagramTitle(h[I].substr(6)),this.$=h[I].substr(6);break;case 9:c.addSubsetData([h[I]],void 0,void 0),c.setIndentMode&&c.setIndentMode(!0);break;case 10:c.addSubsetData([h[I-1]],h[I],void 0),c.setIndentMode&&c.setIndentMode(!0);break;case 11:c.addSubsetData([h[I-2]],void 0,parseFloat(h[I])),c.setIndentMode&&c.setIndentMode(!0);break;case 12:c.addSubsetData([h[I-3]],h[I-2],parseFloat(h[I])),c.setIndentMode&&c.setIndentMode(!0);break;case 13:if(h[I].length<2)throw new Error("union requires multiple identifiers");c.validateUnionIdentifiers&&c.validateUnionIdentifiers(h[I]),c.addSubsetData(h[I],void 0,void 0),c.setIndentMode&&c.setIndentMode(!0);break;case 14:if(h[I-1].length<2)throw new Error("union requires multiple identifiers");c.validateUnionIdentifiers&&c.validateUnionIdentifiers(h[I-1]),c.addSubsetData(h[I-1],h[I],void 0),c.setIndentMode&&c.setIndentMode(!0);break;case 15:if(h[I-2].length<2)throw new Error("union requires multiple identifiers");c.validateUnionIdentifiers&&c.validateUnionIdentifiers(h[I-2]),c.addSubsetData(h[I-2],void 0,parseFloat(h[I])),c.setIndentMode&&c.setIndentMode(!0);break;case 16:if(h[I-3].length<2)throw new Error("union requires multiple identifiers");c.validateUnionIdentifiers&&c.validateUnionIdentifiers(h[I-3]),c.addSubsetData(h[I-3],h[I-2],parseFloat(h[I])),c.setIndentMode&&c.setIndentMode(!0);break;case 17:case 18:case 19:c.addTextData(h[I-1],h[I],void 0);break;case 20:case 21:c.addTextData(h[I-2],h[I-1],h[I]);break;case 23:c.addStyleData(h[I-1],h[I]);break;case 24:case 25:case 26:var R=c.getCurrentSets();if(!R)throw new Error("text requires set");c.addTextData(R,h[I],void 0);break;case 27:case 28:var R=c.getCurrentSets();if(!R)throw new Error("text requires set");c.addTextData(R,h[I-1],h[I]);break;case 29:case 41:this.$=[h[I]];break;case 30:case 42:this.$=[...h[I-2],h[I]];break;case 31:this.$=[h[I-2],h[I]];break;case 33:this.$=h[I].join(" ");break;case 34:this.$=[h[I]];break;case 35:h[I-1].push(h[I]),this.$=h[I-1];break;case 43:case 44:this.$=h[I];break}},"anonymous"),table:[t(n,[2,2],{3:1,4:2}),{1:[3]},{5:[1,3],8:[1,4]},t(s,[2,4],{6:5}),t(n,[2,3]),{7:[1,6],8:[1,8],9:7,10:9,11:[1,10],12:[1,11],17:[1,12],19:[1,13],22:[1,14],24:[1,15]},{1:[2,1]},t(s,[2,5]),t(s,[2,6]),t(s,[2,7]),t(s,[2,8]),{13:16,20:e,21:i},{13:20,18:19,20:e,21:i},{13:20,18:21,20:e,21:i},{16:[1,25],20:[1,23],21:[1,24],23:22},{13:20,18:26,20:e,21:i},t(s,[2,9],{14:[1,27],15:[1,28]}),t(r,[2,43]),t(r,[2,44]),t(s,[2,13],{14:[1,29],15:[1,30],27:o}),t(r,[2,41]),{16:[1,34],20:[1,32],21:[1,33],27:o},t(s,[2,22]),t(s,[2,24],{14:[1,35]}),t(s,[2,25],{14:[1,36]}),t(s,[2,26]),{20:l,25:37,26:38,27:o},t(s,[2,10],{15:[1,40]}),{16:[1,41]},t(s,[2,14],{15:[1,42]}),{16:[1,43]},{13:44,20:e,21:i},t(s,[2,17],{14:[1,45]}),t(s,[2,18],{14:[1,46]}),t(s,[2,19]),t(s,[2,27]),t(s,[2,28]),t(s,[2,23],{27:[1,47]}),t(f,[2,29]),{15:[1,48]},{16:[1,49]},t(s,[2,11]),{16:[1,50]},t(s,[2,15]),t(r,[2,42]),t(s,[2,20]),t(s,[2,21]),{20:l,26:51},{16:u,20:a,21:[1,53],28:52,29:54,30:55,31:y,32:d,33:b},t(s,[2,12]),t(s,[2,16]),t(f,[2,30]),t(f,[2,31]),t(f,[2,32]),t(f,[2,33],{30:61,16:u,20:a,31:y,32:d,33:b}),t(p,[2,34]),t(p,[2,36]),t(p,[2,37]),t(p,[2,38]),t(p,[2,39]),t(p,[2,40]),t(p,[2,35])],defaultActions:{6:[2,1]},parseError:w(function(g,m){if(m.recoverable)this.trace(g);else{var v=new Error(g);throw v.hash=m,v}},"parseError"),parse:w(function(g){var m=this,v=[0],c=[],x=[null],h=[],D=this.table,I="",R=0,G=0,P=0,N=2,A=1,C=h.slice.call(arguments,1),E=Object.create(this.lexer),L={yy:{}};for(var V in this.yy)Object.prototype.hasOwnProperty.call(this.yy,V)&&(L.yy[V]=this.yy[V]);E.setInput(g,L.yy),L.yy.lexer=E,L.yy.parser=this,typeof E.yylloc>"u"&&(E.yylloc={});var F=E.yylloc;h.push(F);var W=E.options&&E.options.ranges;typeof L.yy.parseError=="function"?this.parseError=L.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function B(K){v.length=v.length-2*K,x.length=x.length-K,h.length=h.length-K}w(B,"popStack");function j(){var K;return K=c.pop()||E.lex()||A,typeof K!="number"&&(K instanceof Array&&(c=K,K=c.pop()),K=m.symbols_[K]||K),K}w(j,"lex");for(var z,Y,H,k,O,$,Z={},X,q,_t,st;;){if(H=v[v.length-1],this.defaultActions[H]?k=this.defaultActions[H]:((z===null||typeof z>"u")&&(z=j()),k=D[H]&&D[H][z]),typeof k>"u"||!k.length||!k[0]){var at="";st=[];for(X in D[H])this.terminals_[X]&&X>N&&st.push("'"+this.terminals_[X]+"'");E.showPosition?at="Parse error on line "+(R+1)+`:
|
|
8
|
+
`+E.showPosition()+`
|
|
9
|
+
Expecting `+st.join(", ")+", got '"+(this.terminals_[z]||z)+"'":at="Parse error on line "+(R+1)+": Unexpected "+(z==A?"end of input":"'"+(this.terminals_[z]||z)+"'"),this.parseError(at,{text:E.match,token:this.terminals_[z]||z,line:E.yylineno,loc:F,expected:st})}if(k[0]instanceof Array&&k.length>1)throw new Error("Parse Error: multiple actions possible at state: "+H+", token: "+z);switch(k[0]){case 1:v.push(z),x.push(E.yytext),h.push(E.yylloc),v.push(k[1]),z=null,Y?(z=Y,Y=null):(G=E.yyleng,I=E.yytext,R=E.yylineno,F=E.yylloc,P>0&&P--);break;case 2:if(q=this.productions_[k[1]][1],Z.$=x[x.length-q],Z._$={first_line:h[h.length-(q||1)].first_line,last_line:h[h.length-1].last_line,first_column:h[h.length-(q||1)].first_column,last_column:h[h.length-1].last_column},W&&(Z._$.range=[h[h.length-(q||1)].range[0],h[h.length-1].range[1]]),$=this.performAction.apply(Z,[I,G,R,L.yy,k[1],x,h].concat(C)),typeof $<"u")return $;q&&(v=v.slice(0,-1*q*2),x=x.slice(0,-1*q),h=h.slice(0,-1*q)),v.push(this.productions_[k[1]][0]),x.push(Z.$),h.push(Z._$),_t=D[v[v.length-2]][v[v.length-1]],v.push(_t);break;case 3:return!0}}return!0},"parse")},T=(function(){var S={EOF:1,parseError:w(function(m,v){if(this.yy.parser)this.yy.parser.parseError(m,v);else throw new Error(m)},"parseError"),setInput:w(function(g,m){return this.yy=m||this.yy||{},this._input=g,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:w(function(){var g=this._input[0];this.yytext+=g,this.yyleng++,this.offset++,this.match+=g,this.matched+=g;var m=g.match(/(?:\r\n?|\n).*/g);return m?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),g},"input"),unput:w(function(g){var m=g.length,v=g.split(/(?:\r\n?|\n)/g);this._input=g+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-m),this.offset-=m;var c=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),v.length-1&&(this.yylineno-=v.length-1);var x=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:v?(v.length===c.length?this.yylloc.first_column:0)+c[c.length-v.length].length-v[0].length:this.yylloc.first_column-m},this.options.ranges&&(this.yylloc.range=[x[0],x[0]+this.yyleng-m]),this.yyleng=this.yytext.length,this},"unput"),more:w(function(){return this._more=!0,this},"more"),reject:w(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
|
|
10
|
+
`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:w(function(g){this.unput(this.match.slice(g))},"less"),pastInput:w(function(){var g=this.matched.substr(0,this.matched.length-this.match.length);return(g.length>20?"...":"")+g.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:w(function(){var g=this.match;return g.length<20&&(g+=this._input.substr(0,20-g.length)),(g.substr(0,20)+(g.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:w(function(){var g=this.pastInput(),m=new Array(g.length+1).join("-");return g+this.upcomingInput()+`
|
|
11
|
+
`+m+"^"},"showPosition"),test_match:w(function(g,m){var v,c,x;if(this.options.backtrack_lexer&&(x={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(x.yylloc.range=this.yylloc.range.slice(0))),c=g[0].match(/(?:\r\n?|\n).*/g),c&&(this.yylineno+=c.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:c?c[c.length-1].length-c[c.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+g[0].length},this.yytext+=g[0],this.match+=g[0],this.matches=g,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(g[0].length),this.matched+=g[0],v=this.performAction.call(this,this.yy,this,m,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),v)return v;if(this._backtrack){for(var h in x)this[h]=x[h];return!1}return!1},"test_match"),next:w(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var g,m,v,c;this._more||(this.yytext="",this.match="");for(var x=this._currentRules(),h=0;h<x.length;h++)if(v=this._input.match(this.rules[x[h]]),v&&(!m||v[0].length>m[0].length)){if(m=v,c=h,this.options.backtrack_lexer){if(g=this.test_match(v,x[h]),g!==!1)return g;if(this._backtrack){m=!1;continue}else return!1}else if(!this.options.flex)break}return m?(g=this.test_match(m,x[c]),g!==!1?g:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text.
|
|
12
|
+
`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:w(function(){var m=this.next();return m||this.lex()},"lex"),begin:w(function(m){this.conditionStack.push(m)},"begin"),popState:w(function(){var m=this.conditionStack.length-1;return m>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:w(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:w(function(m){return m=this.conditionStack.length-1-Math.abs(m||0),m>=0?this.conditionStack[m]:"INITIAL"},"topState"),pushState:w(function(m){this.begin(m)},"pushState"),stateStackSize:w(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:w(function(m,v,c,x){var h=x;switch(c){case 0:break;case 1:break;case 2:break;case 3:if(m.getIndentMode&&m.getIndentMode())return m.consumeIndentText=!0,this.begin("INITIAL"),22;break;case 4:break;case 5:m.setIndentMode&&m.setIndentMode(!1),this.begin("INITIAL"),this.unput(v.yytext);break;case 6:return this.begin("bol"),8;break;case 7:break;case 8:break;case 9:return 7;case 10:return 11;case 11:return 5;case 12:return 12;case 13:return 17;case 14:if(m.consumeIndentText)m.consumeIndentText=!1;else return 19;break;case 15:return 24;case 16:return v.yytext=v.yytext.slice(2,-2),14;break;case 17:return v.yytext=v.yytext.slice(1,-1).trim(),14;break;case 18:return 16;case 19:return 31;case 20:return 33;case 21:return 32;case 22:return 20;case 23:return 21;case 24:return 27;case 25:return 15}},"anonymous"),rules:[/^(?:%%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[ \t]+(?=[\n\r]))/i,/^(?:[ \t]+(?=text\b))/i,/^(?:[ \t]+)/i,/^(?:[^ \t\n\r])/i,/^(?:[\n\r]+)/i,/^(?:%%[^\n]*)/i,/^(?:[ \t]+)/i,/^(?:$)/i,/^(?:title\s[^#\n;]+)/i,/^(?:venn-beta\b)/i,/^(?:set\b)/i,/^(?:union\b)/i,/^(?:text\b)/i,/^(?:style\b)/i,/^(?:\["[^\"]*"\])/i,/^(?:\[[^\]\"]+\])/i,/^(?:[+-]?(\d+(\.\d+)?|\.\d+))/i,/^(?:#[0-9a-fA-F]{3,8})/i,/^(?:rgba\(\s*[0-9.]+\s*[,]\s*[0-9.]+\s*[,]\s*[0-9.]+\s*[,]\s*[0-9.]+\s*\))/i,/^(?:rgb\(\s*[0-9.]+\s*[,]\s*[0-9.]+\s*[,]\s*[0-9.]+\s*\))/i,/^(?:[A-Za-z_][A-Za-z0-9\-_]*)/i,/^(?:"[^\"]*")/i,/^(?:,)/i,/^(?::)/i],conditions:{bol:{rules:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25],inclusive:!0},INITIAL:{rules:[0,1,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25],inclusive:!0}}};return S})();M.lexer=T;function _(){this.yy={}}return w(_,"Parser"),_.prototype=M,M.Parser=_,new _})();bt.parser=bt;var Ee=bt,vt=[],kt=[],It=[],Mt=new Set,St,wt=!1,Te=w((t,n,s)=>{let e=ot(t).sort(),i=s??10/Math.pow(t.length,2);St=e,e.length===1&&Mt.add(e[0]),vt.push({sets:e,size:i,label:n?nt(n):void 0})},"addSubsetData"),ze=w(()=>vt,"getSubsetData"),nt=w(t=>{let n=t.trim();return n.length>=2&&n.startsWith('"')&&n.endsWith('"')?n.slice(1,-1):n},"normalizeText"),Ae=w(t=>t&&nt(t),"normalizeStyleValue"),De=w((t,n,s)=>{let e=nt(n);kt.push({sets:ot(t).sort(),id:e,label:s?nt(s):void 0})},"addTextData"),Re=w((t,n)=>{let s=ot(t).sort(),e={};for(let[i,r]of n)e[i]=Ae(r)??r;It.push({targets:s,styles:e})},"addStyleData"),Ce=w(()=>It,"getStyleData"),ot=w(t=>t.map(n=>nt(n)),"normalizeIdentifierList"),Ne=w(t=>{let s=ot(t).filter(e=>!Mt.has(e));if(s.length>0)throw new Error(`unknown set identifier: ${s.join(", ")}`)},"validateUnionIdentifiers"),Oe=w(()=>kt,"getTextData"),Le=w(()=>St,"getCurrentSets"),Fe=w(()=>wt,"getIndentMode"),je=w(t=>{wt=t},"setIndentMode"),Pe=At.venn;function oe(){return Vt(Pe,ct().venn)}w(oe,"getConfig");var Ve=w(()=>{Rt(),vt.length=0,kt.length=0,It.length=0,Mt.clear(),St=void 0,wt=!1},"customClear"),Be={getConfig:oe,clear:Ve,setAccTitle:Ct,getAccTitle:Nt,setDiagramTitle:Ft,getDiagramTitle:jt,getAccDescription:Lt,setAccDescription:Ot,addSubsetData:Te,getSubsetData:ze,addTextData:De,addStyleData:Re,validateUnionIdentifiers:Ne,getTextData:Oe,getStyleData:Ce,getCurrentSets:Le,getIndentMode:Fe,setIndentMode:je},qe=w(t=>`
|
|
13
|
+
.venn-title {
|
|
14
|
+
font-size: 32px;
|
|
15
|
+
fill: ${t.vennTitleTextColor};
|
|
16
|
+
font-family: ${t.fontFamily};
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.venn-circle text {
|
|
20
|
+
font-size: 48px;
|
|
21
|
+
font-family: ${t.fontFamily};
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.venn-intersection text {
|
|
25
|
+
font-size: 48px;
|
|
26
|
+
fill: ${t.vennSetTextColor};
|
|
27
|
+
font-family: ${t.fontFamily};
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.venn-text-node {
|
|
31
|
+
font-family: ${t.fontFamily};
|
|
32
|
+
color: ${t.vennSetTextColor};
|
|
33
|
+
}
|
|
34
|
+
`,"getStyles"),Ue=qe;function ae(t){let n=new Map;for(let s of t){let e=s.targets.join("|"),i=n.get(e);i?Object.assign(i,s.styles):n.set(e,{...s.styles})}return n}w(ae,"buildStyleByKey");var Ge=w((t,n,s,e)=>{let i=e.db,r=i.getConfig?.(),{themeVariables:o,look:l,handDrawnSeed:f}=ct(),u=l==="handDrawn",a=[o.venn1,o.venn2,o.venn3,o.venn4,o.venn5,o.venn6,o.venn7,o.venn8].filter(Boolean),y=i.getDiagramTitle?.(),d=i.getSubsetData(),b=i.getTextData(),p=ae(i.getStyleData()),M=ce(d),T=r?.width??800,_=r?.height??450,g=T/1600,m=y?48*g:0,v=o.primaryTextColor??o.textColor,c=Pt(n);c.attr("viewBox",`0 0 ${T} ${_}`),y&&c.append("text").text(y).attr("class","venn-title").attr("font-size",`${32*g}px`).attr("text-anchor","middle").attr("dominant-baseline","middle").attr("x","50%").attr("y",32*g).style("fill",o.vennTitleTextColor||o.titleColor);let x=it(document.createElement("div")),h=te().width(T).height(_-m);x.datum(M).call(h);let D=u?Bt.svg(x.select("svg").node()):void 0,I=re(M,{width:T,height:_-m,padding:r?.padding??15}),R=new Map;for(let A of I){let C=Q([...A.data.sets].sort());R.set(C,A)}b.length>0&&le(r,R,x,b,g,p);let G=Et(o.background||"#f4f4f4");x.selectAll(".venn-circle").each(function(A,C){let E=it(this),V=Q([...A.sets].sort()),F=p.get(V),W=a.length>0?a[C%a.length]:void 0,B=F?.fill||W||o.primaryColor;E.classed(`venn-set-${C%8}`,!0);let j=F?.["fill-opacity"]??.1,z=F?.stroke||B,Y=F?.["stroke-width"]||`${5*g}`;if(u&&D){let k=R.get(V);if(k&&k.circles.length>0){let O=k.circles[0],$=D.circle(O.x,O.y,O.radius*2,{roughness:.7,seed:f,fill:lt(B,.7),fillStyle:"hachure",fillWeight:2,hachureGap:8,hachureAngle:-41+C*60,stroke:z,strokeWidth:parseFloat(String(Y))});E.select("path").remove(),E.node()?.insertBefore($,E.select("text").node())}}else E.select("path").style("fill",B).style("fill-opacity",j).style("stroke",z).style("stroke-width",Y).style("stroke-opacity",.95);let H=F?.color||(G?Tt(B,30):zt(B,30));E.select("text").style("font-size",`${48*g}px`).style("fill",H)}),u&&D?x.selectAll(".venn-intersection").each(function(A){let C=it(this),L=Q([...A.sets].sort()),V=p.get(L),F=V?.fill;if(F){let W=C.select("path"),B=W.attr("d");if(B){let j=D.path(B,{roughness:.7,seed:f,fill:lt(F,.3),fillStyle:"cross-hatch",fillWeight:2,hachureGap:6,hachureAngle:60,stroke:"none"}),z=W.node();z?.parentNode?.insertBefore(j,z),W.remove()}}else C.select("path").style("fill-opacity",0);C.select("text").style("font-size",`${48*g}px`).style("fill",V?.color??o.vennSetTextColor??v)}):(x.selectAll(".venn-intersection text").style("font-size",`${48*g}px`).style("fill",A=>{let E=Q([...A.sets].sort());return p.get(E)?.color??o.vennSetTextColor??v}),x.selectAll(".venn-intersection path").style("fill-opacity",A=>{let E=Q([...A.sets].sort());return p.get(E)?.fill?1:0}).style("fill",A=>{let E=Q([...A.sets].sort());return p.get(E)?.fill??"transparent"}));let P=c.append("g").attr("transform",`translate(0, ${m})`),N=x.select("svg").node();if(N&&"childNodes"in N)for(let A of[...N.childNodes])P.node()?.appendChild(A);Dt(c,_,T,r?.useMaxWidth??!0)},"draw");function Q(t){return t.join("|")}w(Q,"stableSetsKey");function le(t,n,s,e,i,r){let o=t?.useDebugLayout??!1,f=s.select("svg").append("g").attr("class","venn-text-nodes"),u=new Map;for(let a of e){let y=Q(a.sets),d=u.get(y);d?d.push(a):u.set(y,[a])}for(let[a,y]of u.entries()){let d=n.get(a);if(!d?.text)continue;let b=d.text.x,p=d.text.y,M=Math.min(...d.circles.map(N=>N.radius)),T=Math.min(...d.circles.map(N=>N.radius-Math.hypot(b-N.x,p-N.y))),_=Number.isFinite(T)?Math.max(0,T):0;_===0&&Number.isFinite(M)&&(_=M*.6);let S=f.append("g").attr("class","venn-text-area").attr("font-size",`${40*i}px`);o&&S.append("circle").attr("class","venn-text-debug-circle").attr("cx",b).attr("cy",p).attr("r",_).attr("fill","none").attr("stroke","purple").attr("stroke-width",1.5*i).attr("stroke-dasharray",`${6*i} ${4*i}`);let g=Math.max(80*i,_*2*.95),m=Math.max(60*i,_*2*.95),x=(d.data.label&&d.data.label.length>0?Math.min(32*i,_*.25):0)+(y.length<=2?30*i:0),h=b-g/2,D=p-m/2+x,I=Math.max(1,Math.ceil(Math.sqrt(y.length))),R=Math.max(1,Math.ceil(y.length/I)),G=g/I,P=m/R;for(let[N,A]of y.entries()){let C=N%I,E=Math.floor(N/I),L=h+G*(C+.5),V=D+P*(E+.5);o&&S.append("rect").attr("class","venn-text-debug-cell").attr("x",h+G*C).attr("y",D+P*E).attr("width",G).attr("height",P).attr("fill","none").attr("stroke","teal").attr("stroke-width",1*i).attr("stroke-dasharray",`${4*i} ${3*i}`);let F=G*.9,W=P*.9,B=S.append("foreignObject").attr("class","venn-text-node-fo").attr("width",F).attr("height",W).attr("x",L-F/2).attr("y",V-W/2).attr("overflow","visible"),j=r.get(A.id)?.color,z=B.append("xhtml:span").attr("class","venn-text-node").style("display","flex").style("width","100%").style("height","100%").style("white-space","normal").style("align-items","center").style("justify-content","center").style("text-align","center").style("overflow-wrap","normal").style("word-break","normal").text(A.label??A.id);j&&z.style("color",j)}}}w(le,"renderTextNodes");function ce(t){let n=new Set(t.map(i=>[...i.sets].sort().join("|"))),s=new Map(t.filter(i=>i.sets.length===1&&i.size!==void 0).map(i=>[i.sets[0],i.size])),e=[];for(let i of t){if(i.sets.length<3)continue;let r=[...i.sets].sort();for(let o=0;o<r.length-1;o++)for(let l=o+1;l<r.length;l++){let f=[r[o],r[l]],u=f.join("|");if(!n.has(u)){n.add(u);let a=s.get(f[0]),y=s.get(f[1]),d=a!==void 0&&y!==void 0?Math.min(a,y)/4:2.5;e.push({sets:f,size:d,label:""})}}}return e.length>0?[...t,...e]:t}w(ce,"ensurePairwiseSubsets");var We={draw:Ge},tn={parser:Ee,db:Be,renderer:We,styles:Ue};export{tn as diagram};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as e,b as r}from"./chunk-TMMWB6NQ.js";import"./chunk-L465623K.js";import"./chunk-PHKIAKHS.js";export{e as WardleyModule,r as createWardleyServices};
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import{a as lt}from"./chunk-NCOVM3YF.js";import{a as ct}from"./chunk-YPXVLPXW.js";import"./chunk-TPW5CADB.js";import"./chunk-TMMWB6NQ.js";import"./chunk-TWGPYWIY.js";import"./chunk-4W4OQ3QY.js";import"./chunk-RV7WQMNL.js";import"./chunk-WGMEMLED.js";import"./chunk-KNYDPLLK.js";import"./chunk-HP75Y56I.js";import"./chunk-TSOLLCID.js";import"./chunk-6UFWKTSA.js";import"./chunk-ATQQWCXO.js";import"./chunk-76QEHT4T.js";import"./chunk-A7665WVC.js";import"./chunk-T3FZWEYV.js";import"./chunk-FBC3PYSO.js";import"./chunk-L465623K.js";import{a as dt}from"./chunk-XC2LKMMW.js";import{p as _}from"./chunk-22D53RF2.js";import"./chunk-STBOPOHX.js";import{$ as D,C as Q,P as tt,U as et,V as at,W as rt,X as ot,Y as nt,Z as st,_ as it,p as K}from"./chunk-AECJS4LP.js";import{b as V}from"./chunk-4HYFSIZT.js";import{a as u}from"./chunk-EIBFAW37.js";import"./chunk-PHKIAKHS.js";var G=u((e,n)=>{let r=e<=1?e*100:e;if(r<0||r>100)throw new Error(`${n} must be between 0-1 (decimal) or 0-100 (percentage). Received: ${e}`);return r},"toPercent"),A=u((e,n,r)=>({x:G(n,`${r} evolution`),y:G(e,`${r} visibility`)}),"toCoordinates"),pt=u(e=>{if(e){if(e==="+<>")return"bidirectional";if(e==="+<")return"backward";if(e==="+>")return"forward"}},"getFlowFromPort"),Rt=u(e=>{if(!e?.startsWith("+"))return{};let r=/^\+'([^']*)'/.exec(e)?.[1];return e.includes("<>")?{flow:"bidirectional",label:r}:e.includes("<")?{flow:"backward",label:r}:e.includes(">")?{flow:"forward",label:r}:{label:r}},"extractFlowFromArrow"),Ot=u((e,n)=>{if(lt(e,n),e.size&&n.setSize(e.size.width,e.size.height),e.evolution){let r=e.evolution.stages.map(a=>a.secondName?`${a.name.trim()} / ${a.secondName.trim()}`:a.name.trim()),x=e.evolution.stages.filter(a=>a.boundary!==void 0).map(a=>a.boundary);n.updateAxes({stages:r,stageBoundaries:x})}if(e.anchors.forEach(r=>{let x=A(r.visibility,r.evolution,`Anchor "${r.name}"`);n.addNode(r.name,r.name,x.x,x.y,"anchor")}),e.components.forEach(r=>{let x=A(r.visibility,r.evolution,`Component "${r.name}"`),a=r.label?(r.label.negX?-1:1)*r.label.offsetX:void 0,d=r.label?(r.label.negY?-1:1)*r.label.offsetY:void 0,m=r.decorator?.strategy;n.addNode(r.name,r.name,x.x,x.y,"component",a,d,r.inertia,m)}),e.notes.forEach(r=>{let x=A(r.visibility,r.evolution,`Note "${r.text}"`);n.addNote(r.text,x.x,x.y)}),e.pipelines.forEach(r=>{let x=n.getNode(r.parent);if(!x||typeof x.y!="number")throw new Error(`Pipeline "${r.parent}" must reference an existing component with coordinates.`);let a=x.y;n.startPipeline(r.parent),r.components.forEach(d=>{let m=`${r.parent}_${d.name}`,C=d.label?(d.label.negX?-1:1)*d.label.offsetX:void 0,g=d.label?(d.label.negY?-1:1)*d.label.offsetY:void 0,F=G(d.evolution,`Pipeline component "${d.name}" evolution`);n.addNode(m,d.name,F,a,"pipeline-component",C,g),n.addPipelineComponent(r.parent,m)})}),e.links.forEach(r=>{let x=!!r.arrow&&(r.arrow.includes("-.->")||r.arrow.includes(".-.")),a=pt(r.fromPort)??pt(r.toPort),{flow:d,label:m}=Rt(r.arrow);!a&&d&&(a=d);let C=r.linkLabel,g=m??C;n.addLink(n.resolveNodeId(r.from),n.resolveNodeId(r.to),x,g,a)}),e.evolves.forEach(r=>{let x=n.getNode(r.component);if(x?.y!==void 0){let a=G(r.target,`Evolve target for "${r.component}"`);n.addTrend(r.component,a,x.y)}}),e.annotations.length>0){let r=e.annotations[0],x=A(r.x,r.y,"Annotations box");n.setAnnotationsBox(x.x,x.y)}e.annotation.forEach(r=>{let x=A(r.x,r.y,`Annotation ${r.number}`);n.addAnnotation(r.number,[{x:x.x,y:x.y}],r.text)}),e.accelerators.forEach(r=>{let x=A(r.x,r.y,`Accelerator "${r.name}"`);n.addAccelerator(r.name,x.x,x.y)}),e.deaccelerators.forEach(r=>{let x=A(r.x,r.y,`Deaccelerator "${r.name}"`);n.addDeaccelerator(r.name,x.x,x.y)})},"populateDb"),ft={parser:{yy:void 0},parse:u(async e=>{let n=await ct("wardley",e);V.debug(n);let r=ft.parser?.yy;if(!r||typeof r.addNode!="function")throw new Error("parser.parser?.yy was not a WardleyDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");Ot(n,r)},"parse")},Wt=class{constructor(){this.nodes=new Map,this.links=[],this.trends=new Map,this.pipelines=new Map,this.annotations=[],this.notes=[],this.accelerators=[],this.deaccelerators=[],this.axes={}}static{u(this,"WardleyBuilder")}addNode(e){let n=this.nodes.get(e.id)??{id:e.id,label:e.label},r={...n,...e,className:e.className??n.className,labelOffsetX:e.labelOffsetX??n.labelOffsetX,labelOffsetY:e.labelOffsetY??n.labelOffsetY};this.nodes.set(e.id,r)}addLink(e){this.links.push(e)}addTrend(e){this.trends.set(e.nodeId,e)}startPipeline(e){this.pipelines.set(e,{nodeId:e,componentIds:[]});let n=this.nodes.get(e);n&&(n.isPipelineParent=!0)}addPipelineComponent(e,n){let r=this.pipelines.get(e);r&&r.componentIds.push(n);let x=this.nodes.get(n);x&&(x.inPipeline=!0)}addAnnotation(e){this.annotations.push(e)}addNote(e){this.notes.push(e)}addAccelerator(e){this.accelerators.push(e)}addDeaccelerator(e){this.deaccelerators.push(e)}setAnnotationsBox(e,n){this.annotationsBox={x:e,y:n}}setAxes(e){this.axes={...this.axes,...e}}setSize(e,n){this.size={width:e,height:n}}getNode(e){return this.nodes.get(e)}resolveNodeId(e){if(this.nodes.has(e))return e;for(let[n,r]of this.nodes)if(r.label===e)return n;return e}build(){let e=[];for(let n of this.nodes.values()){if(typeof n.x!="number"||typeof n.y!="number")throw new Error(`Node "${n.label}" is missing coordinates`);e.push(n)}return{nodes:e,links:[...this.links],trends:[...this.trends.values()],pipelines:[...this.pipelines.values()],annotations:[...this.annotations],notes:[...this.notes],accelerators:[...this.accelerators],deaccelerators:[...this.deaccelerators],annotationsBox:this.annotationsBox,axes:{...this.axes},size:this.size}}clear(){this.nodes.clear(),this.links=[],this.trends.clear(),this.pipelines.clear(),this.annotations=[],this.notes=[],this.accelerators=[],this.deaccelerators=[],this.annotationsBox=void 0,this.axes={},this.size=void 0}},k=new Wt;function ht(){return D()["wardley-beta"]}u(ht,"getConfig");function xt(e,n,r,x,a,d,m,C,g){k.addNode({id:e,label:n,x:r,y:x,className:a,labelOffsetX:d,labelOffsetY:m,inertia:C,sourceStrategy:g})}u(xt,"addNode");function gt(e,n,r=!1,x,a){k.addLink({source:e,target:n,dashed:r,label:x,flow:a})}u(gt,"addLink");function yt(e,n,r){k.addTrend({nodeId:e,targetX:n,targetY:r})}u(yt,"addTrend");function ut(e,n,r){k.addAnnotation({number:e,coordinates:n,text:r})}u(ut,"addAnnotation");function mt(e,n,r){k.addNote({text:e,x:n,y:r})}u(mt,"addNote");function wt(e,n,r){k.addAccelerator({name:e,x:n,y:r})}u(wt,"addAccelerator");function kt(e,n,r){k.addDeaccelerator({name:e,x:n,y:r})}u(kt,"addDeaccelerator");function bt(e,n){k.setAnnotationsBox(e,n)}u(bt,"setAnnotationsBox");function $t(e,n){k.setSize(e,n)}u($t,"setSize");function vt(e){k.startPipeline(e)}u(vt,"startPipeline");function Pt(e,n){k.addPipelineComponent(e,n)}u(Pt,"addPipelineComponent");function Ct(e){k.setAxes(e)}u(Ct,"updateAxes");function St(e){return k.getNode(e)}u(St,"getNode");function Mt(e){return k.resolveNodeId(e)}u(Mt,"resolveNodeId");function Nt(){return k.build()}u(Nt,"getWardleyData");function zt(){k.clear(),et()}u(zt,"clear");var Dt={getConfig:ht,addNode:xt,addLink:gt,addTrend:yt,addAnnotation:ut,addNote:mt,addAccelerator:wt,addDeaccelerator:kt,setAnnotationsBox:bt,setSize:$t,startPipeline:vt,addPipelineComponent:Pt,updateAxes:Ct,getNode:St,resolveNodeId:Mt,getWardleyData:Nt,clear:zt,setAccTitle:at,getAccTitle:rt,setDiagramTitle:st,getDiagramTitle:it,getAccDescription:nt,setAccDescription:ot},Gt=["Genesis","Custom Built","Product","Commodity"],qt=u(()=>{let{themeVariables:e}=D();return{backgroundColor:e.wardley?.backgroundColor??e.background??"#fff",axisColor:e.wardley?.axisColor??"#000",axisTextColor:e.wardley?.axisTextColor??e.primaryTextColor??"#222",gridColor:e.wardley?.gridColor??"rgba(100, 100, 100, 0.2)",componentFill:e.wardley?.componentFill??"#fff",componentStroke:e.wardley?.componentStroke??"#000",componentLabelColor:e.wardley?.componentLabelColor??e.primaryTextColor??"#222",linkStroke:e.wardley?.linkStroke??"#000",evolutionStroke:e.wardley?.evolutionStroke??"#dc3545",annotationStroke:e.wardley?.annotationStroke??"#000",annotationTextColor:e.wardley?.annotationTextColor??e.primaryTextColor??"#222",annotationFill:e.wardley?.annotationFill??e.background??"#fff"}},"getTheme"),Ht=u(()=>{let e=D()["wardley-beta"];return{width:e?.width??900,height:e?.height??600,padding:e?.padding??48,nodeRadius:e?.nodeRadius??6,nodeLabelOffset:e?.nodeLabelOffset??8,axisFontSize:e?.axisFontSize??12,labelFontSize:e?.labelFontSize??10,showGrid:e?.showGrid??!1,useMaxWidth:e?.useMaxWidth??!0}},"getConfigValues"),jt=u((e,n,r,x)=>{V.debug(`Rendering Wardley map
|
|
2
|
+
`+e);let a=Ht(),d=qt(),m=a.nodeRadius*1.6,C=x.db,g=C.getWardleyData(),F=C.getDiagramTitle(),S=g.size?.width??a.width,b=g.size?.height??a.height,E=dt(n);E.selectAll("*").remove(),tt(E,b,S,a.useMaxWidth),E.attr("viewBox",`0 0 ${S} ${b}`);let v=E.append("g").attr("class","wardley-map"),q=E.append("defs");q.append("marker").attr("id",`arrow-${n}`).attr("viewBox","0 0 10 10").attr("refX",9).attr("refY",5).attr("markerWidth",6).attr("markerHeight",6).attr("orient","auto-start-reverse").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("fill",d.evolutionStroke).attr("stroke","none"),q.append("marker").attr("id",`link-arrow-end-${n}`).attr("viewBox","0 0 10 10").attr("refX",9).attr("refY",5).attr("markerWidth",5).attr("markerHeight",5).attr("orient","auto").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("fill",d.linkStroke).attr("stroke","none"),q.append("marker").attr("id",`link-arrow-start-${n}`).attr("viewBox","0 0 10 10").attr("refX",1).attr("refY",5).attr("markerWidth",5).attr("markerHeight",5).attr("orient","auto").append("path").attr("d","M 10 0 L 0 5 L 10 10 z").attr("fill",d.linkStroke).attr("stroke","none"),v.append("rect").attr("class","wardley-background").attr("width",S).attr("height",b).attr("fill",d.backgroundColor);let Y=S-a.padding*2,I=b-a.padding*2;F&&v.append("text").attr("class","wardley-title").attr("x",S/2).attr("y",a.padding/2).attr("fill",d.axisTextColor).attr("font-size",a.axisFontSize*1.05).attr("font-weight","bold").attr("text-anchor","middle").attr("dominant-baseline","middle").text(F);let z=u(t=>a.padding+t/100*Y,"projectX"),L=u(t=>b-a.padding-t/100*I,"projectY"),R=v.append("g").attr("class","wardley-axes");R.append("line").attr("x1",a.padding).attr("x2",S-a.padding).attr("y1",b-a.padding).attr("y2",b-a.padding).attr("stroke",d.axisColor).attr("stroke-width",1),R.append("line").attr("x1",a.padding).attr("x2",a.padding).attr("y1",a.padding).attr("y2",b-a.padding).attr("stroke",d.axisColor).attr("stroke-width",1);let Lt=g.axes.xLabel??"Evolution",Tt=g.axes.yLabel??"Visibility";R.append("text").attr("class","wardley-axis-label wardley-axis-label-x").attr("x",a.padding+Y/2).attr("y",b-a.padding/4).attr("fill",d.axisTextColor).attr("font-size",a.axisFontSize).attr("font-weight","bold").attr("text-anchor","middle").text(Lt),R.append("text").attr("class","wardley-axis-label wardley-axis-label-y").attr("x",a.padding/3).attr("y",a.padding+I/2).attr("fill",d.axisTextColor).attr("font-size",a.axisFontSize).attr("font-weight","bold").attr("text-anchor","middle").attr("transform",`rotate(-90 ${a.padding/3} ${a.padding+I/2})`).text(Tt);let B=g.axes.stages&&g.axes.stages.length>0?g.axes.stages:Gt;if(B.length>0){let t=v.append("g").attr("class","wardley-stages"),s=g.axes.stageBoundaries,o=[];if(s&&s.length===B.length){let i=0;s.forEach(p=>{o.push({start:i,end:p}),i=p})}else{let i=1/B.length;B.forEach((p,l)=>{o.push({start:l*i,end:(l+1)*i})})}B.forEach((i,p)=>{let l=o[p],f=a.padding+l.start*Y,h=a.padding+l.end*Y,y=(f+h)/2;p>0&&t.append("line").attr("x1",f).attr("x2",f).attr("y1",a.padding).attr("y2",b-a.padding).attr("stroke","#000").attr("stroke-width",1).attr("stroke-dasharray","5 5").attr("opacity",.8),t.append("text").attr("class","wardley-stage-label").attr("x",y).attr("y",b-a.padding/1.5).attr("fill",d.axisTextColor).attr("font-size",a.axisFontSize-2).attr("text-anchor","middle").text(i)})}if(a.showGrid){let t=v.append("g").attr("class","wardley-grid");for(let s=1;s<4;s++){let o=s/4,i=a.padding+Y*o;t.append("line").attr("x1",i).attr("x2",i).attr("y1",a.padding).attr("y2",b-a.padding).attr("stroke",d.gridColor).attr("stroke-dasharray","2 6"),t.append("line").attr("x1",a.padding).attr("x2",S-a.padding).attr("y1",b-a.padding-I*o).attr("y2",b-a.padding-I*o).attr("stroke",d.gridColor).attr("stroke-dasharray","2 6")}}let c=new Map;if(g.nodes.forEach(t=>{c.set(t.id,{x:z(t.x),y:L(t.y),node:t})}),g.pipelines.length>0){let t=v.append("g").attr("class","wardley-pipelines"),s=v.append("g").attr("class","wardley-pipeline-links");g.pipelines.forEach(o=>{if(o.componentIds.length===0)return;let i=o.componentIds.map(h=>({id:h,pos:c.get(h),node:g.nodes.find(y=>y.id===h)})).filter(h=>h.pos&&h.node).sort((h,y)=>h.node.x-y.node.x);for(let h=0;h<i.length-1;h++){let y=i[h],w=i[h+1];s.append("line").attr("class","wardley-pipeline-evolution-link").attr("x1",y.pos.x).attr("y1",y.pos.y).attr("x2",w.pos.x).attr("y2",w.pos.y).attr("stroke",d.linkStroke).attr("stroke-width",1).attr("stroke-dasharray","4 4")}let p=1/0,l=-1/0,f=0;if(o.componentIds.forEach(h=>{let y=c.get(h);y&&(p=Math.min(p,y.x),l=Math.max(l,y.x),f=y.y)}),p!==1/0&&l!==-1/0){let y=a.nodeRadius*4,w=f-y/2,P=c.get(o.nodeId);if(P){let N=(p+l)/2;P.x=N,P.y=w-m/6}t.append("rect").attr("class","wardley-pipeline-box").attr("x",p-15).attr("y",w).attr("width",l-p+30).attr("height",y).attr("fill","none").attr("stroke",d.axisColor).attr("stroke-width",1.5).attr("rx",4).attr("ry",4)}})}let Z=v.append("g").attr("class","wardley-links"),U=new Map;g.pipelines.forEach(t=>{U.set(t.nodeId,new Set(t.componentIds))});let J=g.links.filter(t=>!(!c.has(t.source)||!c.has(t.target)||U.get(t.target)?.has(t.source)));Z.selectAll("line").data(J).enter().append("line").attr("class",t=>`wardley-link${t.dashed?" wardley-link--dashed":""}`).attr("x1",t=>{let s=c.get(t.source),o=c.get(t.target),p=g.nodes.find(y=>y.id===t.source).isPipelineParent?m/Math.sqrt(2):a.nodeRadius,l=o.x-s.x,f=o.y-s.y,h=Math.sqrt(l*l+f*f);return s.x+l/h*p}).attr("y1",t=>{let s=c.get(t.source),o=c.get(t.target),p=g.nodes.find(y=>y.id===t.source).isPipelineParent?m/Math.sqrt(2):a.nodeRadius,l=o.x-s.x,f=o.y-s.y,h=Math.sqrt(l*l+f*f);return s.y+f/h*p}).attr("x2",t=>{let s=c.get(t.source),o=c.get(t.target),p=g.nodes.find(y=>y.id===t.target).isPipelineParent?m/Math.sqrt(2):a.nodeRadius,l=s.x-o.x,f=s.y-o.y,h=Math.sqrt(l*l+f*f);return o.x+l/h*p}).attr("y2",t=>{let s=c.get(t.source),o=c.get(t.target),p=g.nodes.find(y=>y.id===t.target).isPipelineParent?m/Math.sqrt(2):a.nodeRadius,l=s.x-o.x,f=s.y-o.y,h=Math.sqrt(l*l+f*f);return o.y+f/h*p}).attr("stroke",d.linkStroke).attr("stroke-width",1).attr("stroke-dasharray",t=>t.dashed?"6 6":null).attr("marker-end",t=>t.flow==="forward"||t.flow==="bidirectional"?`url(#link-arrow-end-${n})`:null).attr("marker-start",t=>t.flow==="backward"||t.flow==="bidirectional"?`url(#link-arrow-start-${n})`:null),Z.selectAll("text").data(J.filter(t=>t.label)).enter().append("text").attr("class","wardley-link-label").attr("x",t=>{let s=c.get(t.source),o=c.get(t.target),i=(s.x+o.x)/2,p=o.y-s.y,l=o.x-s.x,f=Math.sqrt(l*l+p*p),h=8,y=p/f;return i+y*h}).attr("y",t=>{let s=c.get(t.source),o=c.get(t.target),i=(s.y+o.y)/2,p=o.x-s.x,l=o.y-s.y,f=Math.sqrt(p*p+l*l),h=8,y=-p/f;return i+y*h}).attr("fill",d.axisTextColor).attr("font-size",a.labelFontSize).attr("text-anchor","middle").attr("dominant-baseline","middle").attr("transform",t=>{let s=c.get(t.source),o=c.get(t.target),i=(s.x+o.x)/2,p=(s.y+o.y)/2,l=o.x-s.x,f=o.y-s.y,h=Math.sqrt(l*l+f*f),y=8,w=f/h,P=-l/h,N=i+w*y,O=p+P*y,X=Math.atan2(f,l)*180/Math.PI;return(X>90||X<-90)&&(X+=180),`rotate(${X} ${N} ${O})`}).text(t=>t.label);let At=v.append("g").attr("class","wardley-trends"),Xt=g.trends.map(t=>{let s=c.get(t.nodeId);if(!s)return null;let o=z(t.targetX),i=L(t.targetY),p=o-s.x,l=i-s.y,f=Math.sqrt(p*p+l*l),h=a.nodeRadius+2,y=f>h?o-p/f*h:o,w=f>h?i-l/f*h:i;return{origin:s,targetX:o,targetY:i,adjustedX2:y,adjustedY2:w}}).filter(t=>t!==null);At.selectAll("line").data(Xt).enter().append("line").attr("class","wardley-trend").attr("x1",t=>t.origin.x).attr("y1",t=>t.origin.y).attr("x2",t=>t.adjustedX2).attr("y2",t=>t.adjustedY2).attr("stroke",d.evolutionStroke).attr("stroke-width",1).attr("stroke-dasharray","4 4").attr("marker-end",`url(#arrow-${n})`);let M=v.append("g").attr("class","wardley-nodes").selectAll("g").data(g.nodes).enter().append("g").attr("class",t=>["wardley-node",t.className?`wardley-node--${t.className}`:""].filter(Boolean).join(" "));M.filter(t=>t.sourceStrategy==="outsource").append("circle").attr("class","wardley-outsource-overlay").attr("cx",t=>c.get(t.id).x).attr("cy",t=>c.get(t.id).y).attr("r",a.nodeRadius*2).attr("fill","#666").attr("stroke",d.componentStroke).attr("stroke-width",1),M.filter(t=>t.sourceStrategy==="buy").append("circle").attr("class","wardley-buy-overlay").attr("cx",t=>c.get(t.id).x).attr("cy",t=>c.get(t.id).y).attr("r",a.nodeRadius*2).attr("fill","#ccc").attr("stroke",d.componentStroke).attr("stroke-width",1),M.filter(t=>t.sourceStrategy==="build").append("circle").attr("class","wardley-build-overlay").attr("cx",t=>c.get(t.id).x).attr("cy",t=>c.get(t.id).y).attr("r",a.nodeRadius*2).attr("fill","#eee").attr("stroke","#000").attr("stroke-width",1);let T=M.filter(t=>t.sourceStrategy==="market");T.append("circle").attr("class","wardley-market-overlay").attr("cx",t=>c.get(t.id).x).attr("cy",t=>c.get(t.id).y).attr("r",a.nodeRadius*2).attr("fill","white").attr("stroke",d.componentStroke).attr("stroke-width",1),M.filter(t=>!t.isPipelineParent&&t.sourceStrategy!=="market"&&t.className!=="anchor").append("circle").attr("cx",t=>c.get(t.id).x).attr("cy",t=>c.get(t.id).y).attr("r",a.nodeRadius).attr("fill",d.componentFill).attr("stroke",d.componentStroke).attr("stroke-width",1);let H=a.nodeRadius*.7,$=a.nodeRadius*1.2;if(T.append("line").attr("class","wardley-market-line").attr("x1",t=>c.get(t.id).x).attr("y1",t=>c.get(t.id).y-$).attr("x2",t=>c.get(t.id).x-$*Math.cos(Math.PI/6)).attr("y2",t=>c.get(t.id).y+$*Math.sin(Math.PI/6)).attr("stroke",d.componentStroke).attr("stroke-width",1),T.append("line").attr("class","wardley-market-line").attr("x1",t=>c.get(t.id).x-$*Math.cos(Math.PI/6)).attr("y1",t=>c.get(t.id).y+$*Math.sin(Math.PI/6)).attr("x2",t=>c.get(t.id).x+$*Math.cos(Math.PI/6)).attr("y2",t=>c.get(t.id).y+$*Math.sin(Math.PI/6)).attr("stroke",d.componentStroke).attr("stroke-width",1),T.append("line").attr("class","wardley-market-line").attr("x1",t=>c.get(t.id).x+$*Math.cos(Math.PI/6)).attr("y1",t=>c.get(t.id).y+$*Math.sin(Math.PI/6)).attr("x2",t=>c.get(t.id).x).attr("y2",t=>c.get(t.id).y-$).attr("stroke",d.componentStroke).attr("stroke-width",1),T.append("circle").attr("class","wardley-market-dot").attr("cx",t=>c.get(t.id).x).attr("cy",t=>c.get(t.id).y-$).attr("r",H).attr("fill","white").attr("stroke",d.componentStroke).attr("stroke-width",2),T.append("circle").attr("class","wardley-market-dot").attr("cx",t=>c.get(t.id).x-$*Math.cos(Math.PI/6)).attr("cy",t=>c.get(t.id).y+$*Math.sin(Math.PI/6)).attr("r",H).attr("fill","white").attr("stroke",d.componentStroke).attr("stroke-width",2),T.append("circle").attr("class","wardley-market-dot").attr("cx",t=>c.get(t.id).x+$*Math.cos(Math.PI/6)).attr("cy",t=>c.get(t.id).y+$*Math.sin(Math.PI/6)).attr("r",H).attr("fill","white").attr("stroke",d.componentStroke).attr("stroke-width",2),M.filter(t=>t.isPipelineParent===!0).append("rect").attr("x",t=>c.get(t.id).x-m/2).attr("y",t=>c.get(t.id).y-m/2).attr("width",m).attr("height",m).attr("fill",d.componentFill).attr("stroke",d.componentStroke).attr("stroke-width",1),M.filter(t=>t.inertia===!0).append("line").attr("class","wardley-inertia").attr("x1",t=>{let s=c.get(t.id),o=t.isPipelineParent?m/2+15:a.nodeRadius+15;return t.sourceStrategy&&(o+=a.nodeRadius+10),s.x+o}).attr("y1",t=>{let s=c.get(t.id),o=t.isPipelineParent?m:a.nodeRadius*2;return s.y-o/2}).attr("x2",t=>{let s=c.get(t.id),o=t.isPipelineParent?m/2+15:a.nodeRadius+15;return t.sourceStrategy&&(o+=a.nodeRadius+10),s.x+o}).attr("y2",t=>{let s=c.get(t.id),o=t.isPipelineParent?m:a.nodeRadius*2;return s.y+o/2}).attr("stroke",d.componentStroke).attr("stroke-width",6),M.append("text").attr("x",t=>{let s=c.get(t.id);if(t.className==="anchor")return t.labelOffsetX!==void 0?s.x+t.labelOffsetX:s.x;let o=a.nodeLabelOffset;t.sourceStrategy&&t.labelOffsetX===void 0&&(o+=10);let i=t.labelOffsetX??o;return s.x+i}).attr("y",t=>{let s=c.get(t.id);if(t.className==="anchor")return t.labelOffsetY!==void 0?s.y+t.labelOffsetY:s.y-3;let o=-a.nodeLabelOffset;t.sourceStrategy&&t.labelOffsetY===void 0&&(o-=10);let i=t.labelOffsetY??o;return s.y+i}).attr("class","wardley-node-label").attr("fill",t=>t.className==="evolved"?d.evolutionStroke:t.className==="anchor"?"#000":d.componentLabelColor).attr("font-size",a.labelFontSize).attr("font-weight",t=>t.className==="anchor"?"bold":"normal").attr("text-anchor",t=>t.className==="anchor"?"middle":"start").attr("dominant-baseline",t=>t.className==="anchor"?"middle":"auto").text(t=>t.label),g.annotations.length>0){let t=v.append("g").attr("class","wardley-annotations");if(g.annotations.forEach(s=>{let o=s.coordinates.map(i=>({x:z(i.x),y:L(i.y)}));if(o.length>1)for(let i=0;i<o.length-1;i++)t.append("line").attr("class","wardley-annotation-line").attr("x1",o[i].x).attr("y1",o[i].y).attr("x2",o[i+1].x).attr("y2",o[i+1].y).attr("stroke",d.axisColor).attr("stroke-width",1.5).attr("stroke-dasharray","4 4");o.forEach(i=>{let p=t.append("g").attr("class","wardley-annotation");p.append("circle").attr("cx",i.x).attr("cy",i.y).attr("r",10).attr("fill","white").attr("stroke",d.axisColor).attr("stroke-width",1.5),p.append("text").attr("x",i.x).attr("y",i.y).attr("text-anchor","middle").attr("dominant-baseline","central").attr("font-size",10).attr("fill",d.axisTextColor).attr("font-weight","bold").text(s.number)})}),g.annotationsBox){let s=z(g.annotationsBox.x),o=L(g.annotationsBox.y),i=10,p=16,l=11,f=t.append("g").attr("class","wardley-annotations-box"),h=[...g.annotations].filter(w=>w.text).sort((w,P)=>w.number-P.number),y=[];if(h.forEach((w,P)=>{let N=f.append("text").attr("x",s+i).attr("y",o+i+(P+1)*p).attr("font-size",l).attr("fill",d.axisTextColor).attr("text-anchor","start").attr("dominant-baseline","middle").text(`${w.number}. ${w.text}`);y.push(N)}),y.length>0){let w=0,P=0;y.forEach(j=>{let W=j.node(),Bt=W.getComputedTextLength();w=Math.max(w,Bt);let Ft=W.getBBox();P=Math.max(P,Ft.height)});let N=w+i*2+105,O=h.length*p+i*2+P/2,X=a.padding,Et=S-a.padding-N,Yt=a.padding,It=b-a.padding-O;s=Math.max(X,Math.min(s,Et)),o=Math.max(Yt,Math.min(o,It)),y.forEach((j,W)=>{j.attr("x",s+i).attr("y",o+i+(W+1)*p)}),f.insert("rect","text").attr("x",s).attr("y",o).attr("width",N).attr("height",O).attr("fill","white").attr("stroke",d.axisColor).attr("stroke-width",1.5).attr("rx",4).attr("ry",4)}}}if(g.notes.length>0){let t=v.append("g").attr("class","wardley-notes");g.notes.forEach(s=>{let o=z(s.x),i=L(s.y);t.append("text").attr("x",o).attr("y",i).attr("text-anchor","start").attr("font-size",11).attr("fill",d.axisTextColor).attr("font-weight","bold").text(s.text)})}if(g.accelerators.length>0){let t=v.append("g").attr("class","wardley-accelerators");g.accelerators.forEach(s=>{let o=z(s.x),i=L(s.y),p=60,l=30,f=20,h=`
|
|
3
|
+
M ${o} ${i-l/2}
|
|
4
|
+
L ${o+p-f} ${i-l/2}
|
|
5
|
+
L ${o+p-f} ${i-l/2-8}
|
|
6
|
+
L ${o+p} ${i}
|
|
7
|
+
L ${o+p-f} ${i+l/2+8}
|
|
8
|
+
L ${o+p-f} ${i+l/2}
|
|
9
|
+
L ${o} ${i+l/2}
|
|
10
|
+
Z
|
|
11
|
+
`;t.append("path").attr("d",h).attr("fill","white").attr("stroke",d.componentStroke).attr("stroke-width",1),t.append("text").attr("x",o+p/2).attr("y",i+l/2+15).attr("text-anchor","middle").attr("font-size",10).attr("fill",d.axisTextColor).attr("font-weight","bold").text(s.name)})}if(g.deaccelerators.length>0){let t=v.append("g").attr("class","wardley-deaccelerators");g.deaccelerators.forEach(s=>{let o=z(s.x),i=L(s.y),p=60,l=30,f=20,h=`
|
|
12
|
+
M ${o+p} ${i-l/2}
|
|
13
|
+
L ${o+f} ${i-l/2}
|
|
14
|
+
L ${o+f} ${i-l/2-8}
|
|
15
|
+
L ${o} ${i}
|
|
16
|
+
L ${o+f} ${i+l/2+8}
|
|
17
|
+
L ${o+f} ${i+l/2}
|
|
18
|
+
L ${o+p} ${i+l/2}
|
|
19
|
+
Z
|
|
20
|
+
`;t.append("path").attr("d",h).attr("fill","white").attr("stroke",d.componentStroke).attr("stroke-width",1),t.append("text").attr("x",o+p/2).attr("y",i+l/2+15).attr("text-anchor","middle").attr("font-size",10).attr("fill",d.axisTextColor).attr("font-weight","bold").text(s.name)})}},"draw"),Vt={draw:jt},_t=u(({wardley:e}={})=>{let n=K(),r=Q(),x=_(n,r.themeVariables),a=_(x.wardley,e);return`
|
|
21
|
+
.wardley-background {
|
|
22
|
+
fill: ${a.backgroundColor};
|
|
23
|
+
}
|
|
24
|
+
.wardley-axes line, .wardley-axes path {
|
|
25
|
+
stroke: ${a.axisColor};
|
|
26
|
+
}
|
|
27
|
+
.wardley-axis-label {
|
|
28
|
+
fill: ${a.axisTextColor};
|
|
29
|
+
}
|
|
30
|
+
.wardley-stage-label {
|
|
31
|
+
fill: ${a.axisTextColor};
|
|
32
|
+
}
|
|
33
|
+
.wardley-grid line {
|
|
34
|
+
stroke: ${a.gridColor};
|
|
35
|
+
}
|
|
36
|
+
.wardley-node circle {
|
|
37
|
+
fill: ${a.componentFill};
|
|
38
|
+
stroke: ${a.componentStroke};
|
|
39
|
+
}
|
|
40
|
+
.wardley-node-label {
|
|
41
|
+
fill: ${a.componentLabelColor};
|
|
42
|
+
}
|
|
43
|
+
.wardley-link {
|
|
44
|
+
stroke: ${a.linkStroke};
|
|
45
|
+
}
|
|
46
|
+
.wardley-link--dashed {
|
|
47
|
+
stroke-dasharray: 4 4;
|
|
48
|
+
}
|
|
49
|
+
.wardley-link-label {
|
|
50
|
+
fill: ${a.axisTextColor};
|
|
51
|
+
}
|
|
52
|
+
.wardley-trend line {
|
|
53
|
+
stroke: ${a.evolutionStroke};
|
|
54
|
+
}
|
|
55
|
+
.wardley-annotation-line {
|
|
56
|
+
stroke: ${a.annotationStroke};
|
|
57
|
+
}
|
|
58
|
+
.wardley-annotation circle {
|
|
59
|
+
fill: ${a.annotationFill};
|
|
60
|
+
stroke: ${a.annotationStroke};
|
|
61
|
+
}
|
|
62
|
+
.wardley-annotation text {
|
|
63
|
+
fill: ${a.annotationTextColor};
|
|
64
|
+
}
|
|
65
|
+
.wardley-annotations-box rect {
|
|
66
|
+
fill: ${a.annotationFill};
|
|
67
|
+
stroke: ${a.annotationStroke};
|
|
68
|
+
}
|
|
69
|
+
.wardley-annotations-box text {
|
|
70
|
+
fill: ${a.annotationTextColor};
|
|
71
|
+
}
|
|
72
|
+
.wardley-pipeline-box {
|
|
73
|
+
stroke: ${a.componentStroke};
|
|
74
|
+
}
|
|
75
|
+
.wardley-notes text {
|
|
76
|
+
fill: ${a.axisTextColor};
|
|
77
|
+
}
|
|
78
|
+
`},"styles"),re={parser:ft,db:Dt,renderer:Vt,styles:_t};export{re as diagram};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import{a as Gt}from"./chunk-XC2LKMMW.js";import{d as qt}from"./chunk-PN62QGJW.js";import"./chunk-DSKRGV6V.js";import{p as yt}from"./chunk-22D53RF2.js";import"./chunk-STBOPOHX.js";import{C as nt,I as Wt,P as Ft,U as Xt,V as Yt,W as Nt,X as Ht,Y as $t,Z as Ut,_ as ft,p as Ot,r as Vt}from"./chunk-AECJS4LP.js";import{H as bt,b as xt,n as pt,o as mt}from"./chunk-4HYFSIZT.js";import{a}from"./chunk-EIBFAW37.js";import"./chunk-PHKIAKHS.js";var wt=(function(){var t=a(function(z,r,h,g){for(h=h||{},g=z.length;g--;h[z[g]]=r);return h},"o"),e=[1,10,12,14,16,18,19,21,23],i=[2,6],s=[1,3],n=[1,5],d=[1,6],l=[1,7],f=[1,5,10,12,14,16,18,19,21,23,36,37,38],u=[1,25],A=[1,26],R=[1,28],_=[1,29],B=[1,30],F=[1,31],X=[1,32],v=[1,33],V=[1,34],Y=[1,35],N=[1,36],b=[1,37],E=[1,43],c=[1,42],L=[1,47],I=[1,50],w=[1,10,12,14,16,18,19,21,23,36,37,38],$=[1,10,12,14,16,18,19,21,23,24,26,28,29,36,37,38],D=[1,10,12,14,16,18,19,21,23,24,26,28,29,36,37,38,42,43,44,45,46,47,48,49,50,51],Q=[1,65],S=[26,28],y={trace:a(function(){},"trace"),yy:{},symbols_:{error:2,start:3,eol:4,XYCHART:5,chartConfig:6,document:7,CHART_ORIENTATION:8,statement:9,title:10,text:11,X_AXIS:12,parseXAxis:13,Y_AXIS:14,parseYAxis:15,LINE:16,plotData:17,BAR:18,acc_title:19,acc_title_value:20,acc_descr:21,acc_descr_value:22,acc_descr_multiline_value:23,SQUARE_BRACES_START:24,dataPoints:25,SQUARE_BRACES_END:26,dataPoint:27,COMMA:28,NUMBER_WITH_DECIMAL:29,STR:30,xAxisData:31,bandData:32,ARROW_DELIMITER:33,commaSeparatedTexts:34,yAxisData:35,NEWLINE:36,SEMI:37,EOF:38,alphaNum:39,MD_STR:40,alphaNumToken:41,AMP:42,NUM:43,ALPHA:44,PLUS:45,EQUALS:46,MULT:47,DOT:48,BRKT:49,MINUS:50,UNDERSCORE:51,$accept:0,$end:1},terminals_:{2:"error",5:"XYCHART",8:"CHART_ORIENTATION",10:"title",12:"X_AXIS",14:"Y_AXIS",16:"LINE",18:"BAR",19:"acc_title",20:"acc_title_value",21:"acc_descr",22:"acc_descr_value",23:"acc_descr_multiline_value",24:"SQUARE_BRACES_START",26:"SQUARE_BRACES_END",28:"COMMA",29:"NUMBER_WITH_DECIMAL",30:"STR",33:"ARROW_DELIMITER",36:"NEWLINE",37:"SEMI",38:"EOF",40:"MD_STR",42:"AMP",43:"NUM",44:"ALPHA",45:"PLUS",46:"EQUALS",47:"MULT",48:"DOT",49:"BRKT",50:"MINUS",51:"UNDERSCORE"},productions_:[0,[3,2],[3,3],[3,2],[3,1],[6,1],[7,0],[7,2],[9,2],[9,2],[9,2],[9,2],[9,2],[9,3],[9,2],[9,3],[9,2],[9,2],[9,1],[17,3],[25,3],[25,1],[27,2],[27,1],[13,1],[13,2],[13,1],[31,1],[31,3],[32,3],[34,3],[34,1],[15,1],[15,2],[15,1],[35,3],[4,1],[4,1],[4,1],[11,1],[11,1],[11,1],[39,1],[39,2],[41,1],[41,1],[41,1],[41,1],[41,1],[41,1],[41,1],[41,1],[41,1],[41,1]],performAction:a(function(r,h,g,x,k,o,U){var p=o.length-1;switch(k){case 5:x.setOrientation(o[p]);break;case 9:x.setDiagramTitle(o[p].text.trim());break;case 12:x.setLineData({text:"",type:"text"},o[p]);break;case 13:x.setLineData(o[p-1],o[p]);break;case 14:x.setBarData({text:"",type:"text"},o[p]);break;case 15:x.setBarData(o[p-1],o[p]);break;case 16:this.$=o[p].trim(),x.setAccTitle(this.$);break;case 17:case 18:this.$=o[p].trim(),x.setAccDescription(this.$);break;case 19:this.$=o[p-1];break;case 20:case 30:this.$=[o[p-2],...o[p]];break;case 21:case 31:this.$=[o[p]];break;case 22:this.$={value:Number(o[p-1]),label:o[p]};break;case 23:this.$={value:Number(o[p]),label:""};break;case 24:x.setXAxisTitle(o[p]);break;case 25:x.setXAxisTitle(o[p-1]);break;case 26:x.setXAxisTitle({type:"text",text:""});break;case 27:x.setXAxisBand(o[p]);break;case 28:x.setXAxisRangeData(Number(o[p-2]),Number(o[p]));break;case 29:this.$=o[p-1];break;case 32:x.setYAxisTitle(o[p]);break;case 33:x.setYAxisTitle(o[p-1]);break;case 34:x.setYAxisTitle({type:"text",text:""});break;case 35:x.setYAxisRangeData(Number(o[p-2]),Number(o[p]));break;case 39:this.$={text:o[p],type:"text"};break;case 40:this.$={text:o[p],type:"text"};break;case 41:this.$={text:o[p],type:"markdown"};break;case 42:this.$=o[p];break;case 43:this.$=o[p-1]+""+o[p];break}},"anonymous"),table:[t(e,i,{3:1,4:2,7:4,5:s,36:n,37:d,38:l}),{1:[3]},t(e,i,{4:2,7:4,3:8,5:s,36:n,37:d,38:l}),t(e,i,{4:2,7:4,6:9,3:10,5:s,8:[1,11],36:n,37:d,38:l}),{1:[2,4],9:12,10:[1,13],12:[1,14],14:[1,15],16:[1,16],18:[1,17],19:[1,18],21:[1,19],23:[1,20]},t(f,[2,36]),t(f,[2,37]),t(f,[2,38]),{1:[2,1]},t(e,i,{4:2,7:4,3:21,5:s,36:n,37:d,38:l}),{1:[2,3]},t(f,[2,5]),t(e,[2,7],{4:22,36:n,37:d,38:l}),{11:23,30:u,39:24,40:A,41:27,42:R,43:_,44:B,45:F,46:X,47:v,48:V,49:Y,50:N,51:b},{11:39,13:38,24:E,29:c,30:u,31:40,32:41,39:24,40:A,41:27,42:R,43:_,44:B,45:F,46:X,47:v,48:V,49:Y,50:N,51:b},{11:45,15:44,29:L,30:u,35:46,39:24,40:A,41:27,42:R,43:_,44:B,45:F,46:X,47:v,48:V,49:Y,50:N,51:b},{11:49,17:48,24:I,30:u,39:24,40:A,41:27,42:R,43:_,44:B,45:F,46:X,47:v,48:V,49:Y,50:N,51:b},{11:52,17:51,24:I,30:u,39:24,40:A,41:27,42:R,43:_,44:B,45:F,46:X,47:v,48:V,49:Y,50:N,51:b},{20:[1,53]},{22:[1,54]},t(w,[2,18]),{1:[2,2]},t(w,[2,8]),t(w,[2,9]),t($,[2,39],{41:55,42:R,43:_,44:B,45:F,46:X,47:v,48:V,49:Y,50:N,51:b}),t($,[2,40]),t($,[2,41]),t(D,[2,42]),t(D,[2,44]),t(D,[2,45]),t(D,[2,46]),t(D,[2,47]),t(D,[2,48]),t(D,[2,49]),t(D,[2,50]),t(D,[2,51]),t(D,[2,52]),t(D,[2,53]),t(w,[2,10]),t(w,[2,24],{32:41,31:56,24:E,29:c}),t(w,[2,26]),t(w,[2,27]),{33:[1,57]},{11:59,30:u,34:58,39:24,40:A,41:27,42:R,43:_,44:B,45:F,46:X,47:v,48:V,49:Y,50:N,51:b},t(w,[2,11]),t(w,[2,32],{35:60,29:L}),t(w,[2,34]),{33:[1,61]},t(w,[2,12]),{17:62,24:I},{25:63,27:64,29:Q},t(w,[2,14]),{17:66,24:I},t(w,[2,16]),t(w,[2,17]),t(D,[2,43]),t(w,[2,25]),{29:[1,67]},{26:[1,68]},{26:[2,31],28:[1,69]},t(w,[2,33]),{29:[1,70]},t(w,[2,13]),{26:[1,71]},{26:[2,21],28:[1,72]},t(S,[2,23],{30:[1,73]}),t(w,[2,15]),t(w,[2,28]),t(w,[2,29]),{11:59,30:u,34:74,39:24,40:A,41:27,42:R,43:_,44:B,45:F,46:X,47:v,48:V,49:Y,50:N,51:b},t(w,[2,35]),t(w,[2,19]),{25:75,27:64,29:Q},t(S,[2,22]),{26:[2,30]},{26:[2,20]}],defaultActions:{8:[2,1],10:[2,3],21:[2,2],74:[2,30],75:[2,20]},parseError:a(function(r,h){if(h.recoverable)this.trace(r);else{var g=new Error(r);throw g.hash=h,g}},"parseError"),parse:a(function(r){var h=this,g=[0],x=[],k=[null],o=[],U=this.table,p="",it=0,Et=0,It=0,fe=2,Mt=1,pe=o.slice.call(arguments,1),T=Object.create(this.lexer),G={yy:{}};for(var lt in this.yy)Object.prototype.hasOwnProperty.call(this.yy,lt)&&(G.yy[lt]=this.yy[lt]);T.setInput(r,G.yy),G.yy.lexer=T,G.yy.parser=this,typeof T.yylloc>"u"&&(T.yylloc={});var ct=T.yylloc;o.push(ct);var me=T.options&&T.options.ranges;typeof G.yy.parseError=="function"?this.parseError=G.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function be(M){g.length=g.length-2*M,k.length=k.length-M,o.length=o.length-M}a(be,"popStack");function Bt(){var M;return M=x.pop()||T.lex()||Mt,typeof M!="number"&&(M instanceof Array&&(x=M,M=x.pop()),M=h.symbols_[M]||M),M}a(Bt,"lex");for(var P,gt,q,O,ze,ut,K={},st,H,zt,at;;){if(q=g[g.length-1],this.defaultActions[q]?O=this.defaultActions[q]:((P===null||typeof P>"u")&&(P=Bt()),O=U[q]&&U[q][P]),typeof O>"u"||!O.length||!O[0]){var dt="";at=[];for(st in U[q])this.terminals_[st]&&st>fe&&at.push("'"+this.terminals_[st]+"'");T.showPosition?dt="Parse error on line "+(it+1)+`:
|
|
2
|
+
`+T.showPosition()+`
|
|
3
|
+
Expecting `+at.join(", ")+", got '"+(this.terminals_[P]||P)+"'":dt="Parse error on line "+(it+1)+": Unexpected "+(P==Mt?"end of input":"'"+(this.terminals_[P]||P)+"'"),this.parseError(dt,{text:T.match,token:this.terminals_[P]||P,line:T.yylineno,loc:ct,expected:at})}if(O[0]instanceof Array&&O.length>1)throw new Error("Parse Error: multiple actions possible at state: "+q+", token: "+P);switch(O[0]){case 1:g.push(P),k.push(T.yytext),o.push(T.yylloc),g.push(O[1]),P=null,gt?(P=gt,gt=null):(Et=T.yyleng,p=T.yytext,it=T.yylineno,ct=T.yylloc,It>0&&It--);break;case 2:if(H=this.productions_[O[1]][1],K.$=k[k.length-H],K._$={first_line:o[o.length-(H||1)].first_line,last_line:o[o.length-1].last_line,first_column:o[o.length-(H||1)].first_column,last_column:o[o.length-1].last_column},me&&(K._$.range=[o[o.length-(H||1)].range[0],o[o.length-1].range[1]]),ut=this.performAction.apply(K,[p,Et,it,G.yy,O[1],k,o].concat(pe)),typeof ut<"u")return ut;H&&(g=g.slice(0,-1*H*2),k=k.slice(0,-1*H),o=o.slice(0,-1*H)),g.push(this.productions_[O[1]][0]),k.push(K.$),o.push(K._$),zt=U[g[g.length-2]][g[g.length-1]],g.push(zt);break;case 3:return!0}}return!0},"parse")},W=(function(){var z={EOF:1,parseError:a(function(h,g){if(this.yy.parser)this.yy.parser.parseError(h,g);else throw new Error(h)},"parseError"),setInput:a(function(r,h){return this.yy=h||this.yy||{},this._input=r,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:a(function(){var r=this._input[0];this.yytext+=r,this.yyleng++,this.offset++,this.match+=r,this.matched+=r;var h=r.match(/(?:\r\n?|\n).*/g);return h?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),r},"input"),unput:a(function(r){var h=r.length,g=r.split(/(?:\r\n?|\n)/g);this._input=r+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-h),this.offset-=h;var x=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),g.length-1&&(this.yylineno-=g.length-1);var k=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:g?(g.length===x.length?this.yylloc.first_column:0)+x[x.length-g.length].length-g[0].length:this.yylloc.first_column-h},this.options.ranges&&(this.yylloc.range=[k[0],k[0]+this.yyleng-h]),this.yyleng=this.yytext.length,this},"unput"),more:a(function(){return this._more=!0,this},"more"),reject:a(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
|
|
4
|
+
`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:a(function(r){this.unput(this.match.slice(r))},"less"),pastInput:a(function(){var r=this.matched.substr(0,this.matched.length-this.match.length);return(r.length>20?"...":"")+r.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:a(function(){var r=this.match;return r.length<20&&(r+=this._input.substr(0,20-r.length)),(r.substr(0,20)+(r.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:a(function(){var r=this.pastInput(),h=new Array(r.length+1).join("-");return r+this.upcomingInput()+`
|
|
5
|
+
`+h+"^"},"showPosition"),test_match:a(function(r,h){var g,x,k;if(this.options.backtrack_lexer&&(k={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(k.yylloc.range=this.yylloc.range.slice(0))),x=r[0].match(/(?:\r\n?|\n).*/g),x&&(this.yylineno+=x.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:x?x[x.length-1].length-x[x.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+r[0].length},this.yytext+=r[0],this.match+=r[0],this.matches=r,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(r[0].length),this.matched+=r[0],g=this.performAction.call(this,this.yy,this,h,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),g)return g;if(this._backtrack){for(var o in k)this[o]=k[o];return!1}return!1},"test_match"),next:a(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var r,h,g,x;this._more||(this.yytext="",this.match="");for(var k=this._currentRules(),o=0;o<k.length;o++)if(g=this._input.match(this.rules[k[o]]),g&&(!h||g[0].length>h[0].length)){if(h=g,x=o,this.options.backtrack_lexer){if(r=this.test_match(g,k[o]),r!==!1)return r;if(this._backtrack){h=!1;continue}else return!1}else if(!this.options.flex)break}return h?(r=this.test_match(h,k[x]),r!==!1?r:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text.
|
|
6
|
+
`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:a(function(){var h=this.next();return h||this.lex()},"lex"),begin:a(function(h){this.conditionStack.push(h)},"begin"),popState:a(function(){var h=this.conditionStack.length-1;return h>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:a(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:a(function(h){return h=this.conditionStack.length-1-Math.abs(h||0),h>=0?this.conditionStack[h]:"INITIAL"},"topState"),pushState:a(function(h){this.begin(h)},"pushState"),stateStackSize:a(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:a(function(h,g,x,k){var o=k;switch(x){case 0:break;case 1:break;case 2:return this.popState(),36;break;case 3:return this.popState(),36;break;case 4:return 36;case 5:break;case 6:return 10;case 7:return this.pushState("acc_title"),19;break;case 8:return this.popState(),"acc_title_value";break;case 9:return this.pushState("acc_descr"),21;break;case 10:return this.popState(),"acc_descr_value";break;case 11:this.pushState("acc_descr_multiline");break;case 12:this.popState();break;case 13:return"acc_descr_multiline_value";case 14:return 5;case 15:return 5;case 16:return 8;case 17:return this.pushState("axis_data"),"X_AXIS";break;case 18:return this.pushState("axis_data"),"Y_AXIS";break;case 19:return this.pushState("axis_band_data"),24;break;case 20:return 33;case 21:return this.pushState("data"),16;break;case 22:return this.pushState("data"),18;break;case 23:return this.pushState("data_inner"),24;break;case 24:return 29;case 25:return this.popState(),26;break;case 26:this.popState();break;case 27:this.pushState("string");break;case 28:this.popState();break;case 29:return"STR";case 30:return 24;case 31:return 26;case 32:return 44;case 33:return"COLON";case 34:return 45;case 35:return 28;case 36:return 46;case 37:return 47;case 38:return 49;case 39:return 51;case 40:return 48;case 41:return 42;case 42:return 50;case 43:return 43;case 44:break;case 45:return 37;case 46:return 38}},"anonymous"),rules:[/^(?:%%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:(\r?\n))/i,/^(?:(\r?\n))/i,/^(?:[\n\r]+)/i,/^(?:%%[^\n]*)/i,/^(?:title\b)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:\})/i,/^(?:[^\}]*)/i,/^(?:xychart-beta\b)/i,/^(?:xychart\b)/i,/^(?:(?:vertical|horizontal))/i,/^(?:x-axis\b)/i,/^(?:y-axis\b)/i,/^(?:\[)/i,/^(?:-->)/i,/^(?:line\b)/i,/^(?:bar\b)/i,/^(?:\[)/i,/^(?:[+-]?(?:\d+(?:\.\d+)?|\.\d+))/i,/^(?:\])/i,/^(?:(?:`\) \{ this\.pushState\(md_string\); \}\n<md_string>\(\?:\(\?!`"\)\.\)\+ \{ return MD_STR; \}\n<md_string>\(\?:`))/i,/^(?:["])/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:\[)/i,/^(?:\])/i,/^(?:[A-Za-z]+)/i,/^(?::)/i,/^(?:\+)/i,/^(?:,)/i,/^(?:=)/i,/^(?:\*)/i,/^(?:#)/i,/^(?:[\_])/i,/^(?:\.)/i,/^(?:&)/i,/^(?:-)/i,/^(?:[0-9]+)/i,/^(?:\s+)/i,/^(?:;)/i,/^(?:$)/i],conditions:{data_inner:{rules:[0,1,4,5,6,7,9,11,14,15,16,17,18,21,22,24,25,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0},data:{rules:[0,1,3,4,5,6,7,9,11,14,15,16,17,18,21,22,23,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0},axis_band_data:{rules:[0,1,4,5,6,7,9,11,14,15,16,17,18,21,22,25,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0},axis_data:{rules:[0,1,2,4,5,6,7,9,11,14,15,16,17,18,19,20,21,22,24,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0},acc_descr_multiline:{rules:[12,13],inclusive:!1},acc_descr:{rules:[10],inclusive:!1},acc_title:{rules:[8],inclusive:!1},title:{rules:[],inclusive:!1},md_string:{rules:[],inclusive:!1},string:{rules:[28,29],inclusive:!1},INITIAL:{rules:[0,1,4,5,6,7,9,11,14,15,16,17,18,21,22,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0}}};return z})();y.lexer=W;function C(){this.yy={}}return a(C,"Parser"),C.prototype=y,y.Parser=C,new C})();wt.parser=wt;var ye=wt;function ot(t){return t.type==="bar"}a(ot,"isBarPlot");function rt(t){return t.type==="band"}a(rt,"isBandAxisData");function Z(t){return t.type==="linear"}a(Z,"isLinearAxisData");var St=class{constructor(t){this.parentGroup=t}static{a(this,"TextDimensionCalculatorWithFont")}getMaxDimension(t,e){if(!this.parentGroup)return{width:t.reduce((u,A)=>Math.max(A.length,u),0)*e,height:e};let i={width:0,height:0},s=this.parentGroup.append("g").attr("visibility","hidden").attr("font-size",e),n=s.node()?.getScreenCTM?.(),d=a(u=>u&&u>0?u:1,"toScale"),l=d(n?.a),f=d(n?.d);for(let u of t){let A=qt(s,1,u),R=A?A.width/l:u.length*e,_=A?A.height/f:e;i.width=Math.max(i.width,R),i.height=Math.max(i.height,_)}return s.remove(),i}},jt=.7,Qt=.2,Kt=class{constructor(t,e,i,s){this.axisConfig=t,this.title=e,this.textDimensionCalculator=i,this.axisThemeConfig=s,this.boundingRect={x:0,y:0,width:0,height:0},this.axisPosition="left",this.showTitle=!1,this.showLabel=!1,this.showTick=!1,this.showAxisLine=!1,this.outerPadding=0,this.titleTextHeight=0,this.labelTextHeight=0,this.normalizedLabelRotationInRad=0,this.range=[0,10],this.boundingRect={x:0,y:0,width:0,height:0},this.axisPosition="left",this.normalizedLabelRotationInRad=this.axisConfig.labelRotation>=-90&&this.axisConfig.labelRotation<=90?this.axisConfig.labelRotation*Math.PI/180:0}static{a(this,"BaseAxis")}setRange(t){this.range=t,this.axisPosition==="left"||this.axisPosition==="right"?this.boundingRect.height=t[1]-t[0]:this.boundingRect.width=t[1]-t[0],this.recalculateScale()}getRange(){return[this.range[0]+this.outerPadding,this.range[1]-this.outerPadding]}setAxisPosition(t){this.axisPosition=t,this.setRange(this.range)}getTickDistance(){let t=this.getRange();return Math.abs(t[0]-t[1])/this.getTickValues().length}getAxisOuterPadding(){return this.outerPadding}getLabelDimension(){return this.textDimensionCalculator.getMaxDimension(this.getTickValues().map(t=>t.toString()),this.axisConfig.labelFontSize)}recalculateOuterPaddingToDrawBar(){jt*this.getTickDistance()>this.outerPadding*2&&(this.outerPadding=Math.floor(jt*this.getTickDistance()/2)),this.recalculateScale()}calculateSpaceIfDrawnHorizontally(t){let e=t.height;if(this.axisConfig.showAxisLine&&e>this.axisConfig.axisLineWidth&&(e-=this.axisConfig.axisLineWidth,this.showAxisLine=!0),this.axisConfig.showLabel){let i=this.getLabelDimension(),s=Qt*t.width;this.outerPadding=Math.min(i.width/2,s);let n=i.height;this.axisPosition==="bottom"&&this.normalizedLabelRotationInRad!==0&&(n=Math.max(n,Math.abs(Math.sin(this.normalizedLabelRotationInRad)*i.width)+Math.abs(Math.cos(this.normalizedLabelRotationInRad)*i.height))),n+=this.axisConfig.labelPadding*2,this.labelTextHeight=i.height,n<=e&&(e-=n,this.showLabel=!0)}if(this.axisConfig.showTick&&e>=this.axisConfig.tickLength&&(this.showTick=!0,e-=this.axisConfig.tickLength),this.axisConfig.showTitle&&this.title){let i=this.textDimensionCalculator.getMaxDimension([this.title],this.axisConfig.titleFontSize),s=i.height+this.axisConfig.titlePadding*2;this.titleTextHeight=i.height,s<=e&&(e-=s,this.showTitle=!0)}this.boundingRect.width=t.width,this.boundingRect.height=t.height-e}calculateSpaceIfDrawnVertical(t){let e=t.width;if(this.axisConfig.showAxisLine&&e>this.axisConfig.axisLineWidth&&(e-=this.axisConfig.axisLineWidth,this.showAxisLine=!0),this.axisConfig.showLabel){let i=this.getLabelDimension(),s=Qt*t.height;this.outerPadding=Math.min(i.height/2,s);let n=i.width+this.axisConfig.labelPadding*2;n<=e&&(e-=n,this.showLabel=!0)}if(this.axisConfig.showTick&&e>=this.axisConfig.tickLength&&(this.showTick=!0,e-=this.axisConfig.tickLength),this.axisConfig.showTitle&&this.title){let i=this.textDimensionCalculator.getMaxDimension([this.title],this.axisConfig.titleFontSize),s=i.height+this.axisConfig.titlePadding*2;this.titleTextHeight=i.height,s<=e&&(e-=s,this.showTitle=!0)}this.boundingRect.width=t.width-e,this.boundingRect.height=t.height}calculateSpace(t){return this.axisPosition==="left"||this.axisPosition==="right"?this.calculateSpaceIfDrawnVertical(t):this.calculateSpaceIfDrawnHorizontally(t),this.recalculateScale(),{width:this.boundingRect.width,height:this.boundingRect.height}}setBoundingBoxXY(t){this.boundingRect.x=t.x,this.boundingRect.y=t.y}calculateOffsetByRotation(t){let e=this.normalizedLabelRotationInRad;return e===0?0:Math.sin(e)*this.getLabelDimension()[t]/2}getDrawableElementsForLeftAxis(){let t=[];if(this.showAxisLine){let e=this.boundingRect.x+this.boundingRect.width-this.axisConfig.axisLineWidth/2;t.push({type:"path",groupTexts:["left-axis","axisl-line"],data:[{path:`M ${e},${this.boundingRect.y} L ${e},${this.boundingRect.y+this.boundingRect.height} `,strokeFill:this.axisThemeConfig.axisLineColor,strokeWidth:this.axisConfig.axisLineWidth}]})}if(this.showLabel&&t.push({type:"text",groupTexts:["left-axis","label"],data:this.getTickValues().map(e=>({text:e.toString(),x:this.boundingRect.x+this.boundingRect.width-(this.showLabel?this.axisConfig.labelPadding:0)-(this.showTick?this.axisConfig.tickLength:0)-(this.showAxisLine?this.axisConfig.axisLineWidth:0),y:this.getScaleValue(e),fill:this.axisThemeConfig.labelColor,fontSize:this.axisConfig.labelFontSize,rotation:0,verticalPos:"middle",horizontalPos:"right"}))}),this.showTick){let e=this.boundingRect.x+this.boundingRect.width-(this.showAxisLine?this.axisConfig.axisLineWidth:0);t.push({type:"path",groupTexts:["left-axis","ticks"],data:this.getTickValues().map(i=>({path:`M ${e},${this.getScaleValue(i)} L ${e-this.axisConfig.tickLength},${this.getScaleValue(i)}`,strokeFill:this.axisThemeConfig.tickColor,strokeWidth:this.axisConfig.tickWidth}))})}return this.showTitle&&t.push({type:"text",groupTexts:["left-axis","title"],data:[{text:this.title,x:this.boundingRect.x+this.axisConfig.titlePadding,y:this.boundingRect.y+this.boundingRect.height/2,fill:this.axisThemeConfig.titleColor,fontSize:this.axisConfig.titleFontSize,rotation:270,verticalPos:"top",horizontalPos:"center"}]}),t}getDrawableElementsForBottomAxis(){let t=[];if(this.showAxisLine){let e=this.boundingRect.y+this.axisConfig.axisLineWidth/2;t.push({type:"path",groupTexts:["bottom-axis","axis-line"],data:[{path:`M ${this.boundingRect.x},${e} L ${this.boundingRect.x+this.boundingRect.width},${e}`,strokeFill:this.axisThemeConfig.axisLineColor,strokeWidth:this.axisConfig.axisLineWidth}]})}if(this.showLabel&&t.push({type:"text",groupTexts:["bottom-axis","label"],data:this.getTickValues().map(e=>({text:e.toString(),x:this.getScaleValue(e)+this.calculateOffsetByRotation("height"),y:this.boundingRect.y+this.axisConfig.labelPadding+(this.showTick?this.axisConfig.tickLength:0)+(this.showAxisLine?this.axisConfig.axisLineWidth:0)+Math.abs(this.calculateOffsetByRotation("width")),fill:this.axisThemeConfig.labelColor,fontSize:this.axisConfig.labelFontSize,rotation:this.normalizedLabelRotationInRad*180/Math.PI,verticalPos:"top",horizontalPos:"center"}))}),this.showTick){let e=this.boundingRect.y+(this.showAxisLine?this.axisConfig.axisLineWidth:0);t.push({type:"path",groupTexts:["bottom-axis","ticks"],data:this.getTickValues().map(i=>({path:`M ${this.getScaleValue(i)},${e} L ${this.getScaleValue(i)},${e+this.axisConfig.tickLength}`,strokeFill:this.axisThemeConfig.tickColor,strokeWidth:this.axisConfig.tickWidth}))})}return this.showTitle&&t.push({type:"text",groupTexts:["bottom-axis","title"],data:[{text:this.title,x:this.range[0]+(this.range[1]-this.range[0])/2,y:this.boundingRect.y+this.boundingRect.height-this.axisConfig.titlePadding-this.titleTextHeight,fill:this.axisThemeConfig.titleColor,fontSize:this.axisConfig.titleFontSize,rotation:0,verticalPos:"top",horizontalPos:"center"}]}),t}getDrawableElementsForTopAxis(){let t=[];if(this.showAxisLine){let e=this.boundingRect.y+this.boundingRect.height-this.axisConfig.axisLineWidth/2;t.push({type:"path",groupTexts:["top-axis","axis-line"],data:[{path:`M ${this.boundingRect.x},${e} L ${this.boundingRect.x+this.boundingRect.width},${e}`,strokeFill:this.axisThemeConfig.axisLineColor,strokeWidth:this.axisConfig.axisLineWidth}]})}if(this.showLabel&&t.push({type:"text",groupTexts:["top-axis","label"],data:this.getTickValues().map(e=>({text:e.toString(),x:this.getScaleValue(e),y:this.boundingRect.y+(this.showTitle?this.titleTextHeight+this.axisConfig.titlePadding*2:0)+this.axisConfig.labelPadding,fill:this.axisThemeConfig.labelColor,fontSize:this.axisConfig.labelFontSize,rotation:0,verticalPos:"top",horizontalPos:"center"}))}),this.showTick){let e=this.boundingRect.y;t.push({type:"path",groupTexts:["top-axis","ticks"],data:this.getTickValues().map(i=>({path:`M ${this.getScaleValue(i)},${e+this.boundingRect.height-(this.showAxisLine?this.axisConfig.axisLineWidth:0)} L ${this.getScaleValue(i)},${e+this.boundingRect.height-this.axisConfig.tickLength-(this.showAxisLine?this.axisConfig.axisLineWidth:0)}`,strokeFill:this.axisThemeConfig.tickColor,strokeWidth:this.axisConfig.tickWidth}))})}return this.showTitle&&t.push({type:"text",groupTexts:["top-axis","title"],data:[{text:this.title,x:this.boundingRect.x+this.boundingRect.width/2,y:this.boundingRect.y+this.axisConfig.titlePadding,fill:this.axisThemeConfig.titleColor,fontSize:this.axisConfig.titleFontSize,rotation:0,verticalPos:"top",horizontalPos:"center"}]}),t}getDrawableElements(){if(this.axisPosition==="left")return this.getDrawableElementsForLeftAxis();if(this.axisPosition==="right")throw Error("Drawing of right axis is not implemented");return this.axisPosition==="bottom"?this.getDrawableElementsForBottomAxis():this.axisPosition==="top"?this.getDrawableElementsForTopAxis():[]}},we=class extends Kt{static{a(this,"BandAxis")}constructor(t,e,i,s,n){super(t,s,n,e),this.categories=i,this.scale=pt().domain(this.categories).range(this.getRange())}setRange(t){super.setRange(t)}recalculateScale(){this.scale=pt().domain(this.categories).range(this.getRange()).paddingInner(1).paddingOuter(0).align(.5),xt.trace("BandAxis axis final categories, range: ",this.categories,this.getRange())}getTickValues(){return this.categories}getScaleValue(t){return this.scale(t)??this.getRange()[0]}},Ae=class extends Kt{static{a(this,"LinearAxis")}constructor(t,e,i,s,n){super(t,s,n,e),this.domain=i,this.scale=mt().domain(this.domain).range(this.getRange())}getTickValues(){return this.scale.ticks()}recalculateScale(){let t=[...this.domain];this.axisPosition==="left"&&t.reverse(),this.scale=mt().domain(t).range(this.getRange())}getScaleValue(t){return this.scale(t)}};function At(t,e,i,s){let n=new St(s);return rt(t)?new we(e,i,t.categories,t.title,n):new Ae(e,i,[t.min,t.max],t.title,n)}a(At,"getAxis");var ke=class{constructor(t,e,i,s){this.textDimensionCalculator=t,this.chartConfig=e,this.chartData=i,this.chartThemeConfig=s,this.titleWidth=0,this.boundingRect={x:0,y:0,width:0,height:0},this.showChartTitle=!1}static{a(this,"ChartTitle")}setBoundingBoxXY(t){this.boundingRect.x=t.x,this.boundingRect.y=t.y}calculateSpace(t){let e=this.textDimensionCalculator.getMaxDimension([this.chartData.title],this.chartConfig.titleFontSize),i=Math.max(e.width,t.width),s=e.height+2*this.chartConfig.titlePadding;return s<=t.height&&this.chartConfig.showTitle&&this.chartData.title&&(this.boundingRect.width=i,this.boundingRect.height=s,this.titleWidth=e.width,this.showChartTitle=!0),{width:this.boundingRect.width,height:this.boundingRect.height}}alignTo(t,e){let i=Math.min(this.titleWidth,this.chartConfig.width)/2,s=Math.min(Math.max((t+e)/2,i),this.chartConfig.width-i);this.boundingRect.x=s-i,this.boundingRect.width=i*2}getDrawableElements(){let t=[];return this.showChartTitle&&t.push({groupTexts:["chart-title"],type:"text",data:[{fontSize:this.chartConfig.titleFontSize,text:this.chartData.title,verticalPos:"middle",horizontalPos:"center",x:this.boundingRect.x+this.boundingRect.width/2,y:this.boundingRect.y+this.boundingRect.height/2,fill:this.chartThemeConfig.titleColor,rotation:0}]}),t}};function Zt(t,e,i,s){let n=new St(s);return new ke(n,t,e,i)}a(Zt,"getChartTitleComponent");var Ce=.75,Se=.5,Re=.35;function kt(t){return{fontSize:t,markerSize:t*Ce,markerSpacing:t*Re,itemSpacing:t*Se}}a(kt,"getLegendLayout");var _e=class{constructor(t,e,i,s){this.textDimensionCalculator=t,this.chartConfig=e,this.chartData=i,this.chartThemeConfig=s,this.boundingRect={x:0,y:0,width:0,height:0},this.visiblePlots=[]}static{a(this,"ChartLegend")}setBoundingBoxXY(t){this.boundingRect.x=t.x,this.boundingRect.y=t.y}calculateSpace(t){if(this.visiblePlots=this.chartConfig.showLegend?this.chartData.plots.filter(u=>u.title):[],this.visiblePlots.length===0)return this.boundingRect.width=0,this.boundingRect.height=0,{width:0,height:0};let{fontSize:e,markerSize:i,markerSpacing:s,itemSpacing:n}=kt(this.chartConfig.legendFontSize),d=this.textDimensionCalculator.getMaxDimension(this.visiblePlots.map(u=>u.title),e),l=this.chartConfig.legendPadding*2+i+s+d.width,f=this.chartConfig.legendPadding*2+this.visiblePlots.length*e+(this.visiblePlots.length-1)*n;return l<=t.width&&f<=t.height?(this.boundingRect.width=l,this.boundingRect.height=f):(this.visiblePlots=[],this.boundingRect.width=0,this.boundingRect.height=0),{width:this.boundingRect.width,height:this.boundingRect.height}}getDrawableElements(){if(this.visiblePlots.length===0)return[];let{fontSize:t,markerSize:e,markerSpacing:i,itemSpacing:s}=kt(this.chartConfig.legendFontSize),n=t+s,d=this.boundingRect.x+this.chartConfig.legendPadding,l=this.boundingRect.y+this.chartConfig.legendPadding,f=[],u=[];for(let[A,R]of this.visiblePlots.entries())if(ot(R))f.push({x:d,y:l+A*n,width:e,height:e,fill:R.fill,strokeFill:R.fill,strokeWidth:0});else{let _=l+A*n+e/2;u.push({path:`M ${d},${_} L ${d+e},${_}`,strokeFill:R.strokeFill,strokeWidth:R.strokeWidth})}return[{groupTexts:["legend","markers"],type:"rect",data:f},{groupTexts:["legend","markers"],type:"path",data:u},{groupTexts:["legend","label"],type:"text",data:this.visiblePlots.map((A,R)=>({text:A.title,x:d+e+i,y:l+R*n+e/2,fill:this.chartThemeConfig.legendTextColor,fontSize:t,rotation:0,verticalPos:"middle",horizontalPos:"left"}))}]}};function Jt(t,e,i,s){let n=new St(s);return new _e(n,t,e,i)}a(Jt,"getChartLegendComponent");var Te=class{constructor(t,e,i,s,n){this.plotData=t,this.xAxis=e,this.yAxis=i,this.orientation=s,this.plotIndex=n}static{a(this,"LinePlot")}getDrawableElement(){let t=this.plotData.data.map(s=>[this.xAxis.getScaleValue(s[0]),this.yAxis.getScaleValue(s[1])]),e;if(this.orientation==="horizontal"?e=bt().y(s=>s[0]).x(s=>s[1])(t):e=bt().x(s=>s[0]).y(s=>s[1])(t),!e)return[];let i=[{groupTexts:["plot",`line-plot-${this.plotIndex}`],type:"path",data:[{path:e,strokeFill:this.plotData.strokeFill,strokeWidth:this.plotData.strokeWidth}]}];if(this.plotData.pointLabels&&this.plotData.pointLabels.length>0){let d=[];for(let[l,[f,u]]of t.entries()){let A=this.plotData.pointLabels[l];A&&(this.orientation==="horizontal"?d.push({x:u+10,y:f,text:A,fill:this.plotData.strokeFill,verticalPos:"middle",horizontalPos:"left",fontSize:12,rotation:0}):d.push({x:f,y:u-10,text:A,fill:this.plotData.strokeFill,verticalPos:"middle",horizontalPos:"center",fontSize:12,rotation:0}))}d.length>0&&i.push({groupTexts:["plot",`line-plot-${this.plotIndex}`,"labels"],type:"text",data:d})}return i}},De=class{constructor(t,e,i,s,n,d){this.barData=t,this.boundingRect=e,this.xAxis=i,this.yAxis=s,this.orientation=n,this.plotIndex=d}static{a(this,"BarPlot")}getDrawableElement(){let t=this.barData.data.map(n=>[this.xAxis.getScaleValue(n[0]),this.yAxis.getScaleValue(n[1])]),i=Math.min(this.xAxis.getAxisOuterPadding()*2,this.xAxis.getTickDistance())*(1-.05),s=i/2;return this.orientation==="horizontal"?[{groupTexts:["plot",`bar-plot-${this.plotIndex}`],type:"rect",data:t.map(n=>({x:this.boundingRect.x,y:n[0]-s,height:i,width:n[1]-this.boundingRect.x,fill:this.barData.fill,strokeWidth:0,strokeFill:this.barData.fill}))}]:[{groupTexts:["plot",`bar-plot-${this.plotIndex}`],type:"rect",data:t.map(n=>({x:n[0]-s,y:n[1],width:i,height:this.boundingRect.y+this.boundingRect.height-n[1],fill:this.barData.fill,strokeWidth:0,strokeFill:this.barData.fill}))}]}},Pe=class{constructor(t,e,i){this.chartConfig=t,this.chartData=e,this.chartThemeConfig=i,this.boundingRect={x:0,y:0,width:0,height:0}}static{a(this,"BasePlot")}setAxes(t,e){this.xAxis=t,this.yAxis=e}setBoundingBoxXY(t){this.boundingRect.x=t.x,this.boundingRect.y=t.y}calculateSpace(t){return this.boundingRect.width=t.width,this.boundingRect.height=t.height,{width:this.boundingRect.width,height:this.boundingRect.height}}getDrawableElements(){if(!(this.xAxis&&this.yAxis))throw Error("Axes must be passed to render Plots");let t=[];for(let[e,i]of this.chartData.plots.entries())switch(i.type){case"line":{let s=new Te(i,this.xAxis,this.yAxis,this.chartConfig.chartOrientation,e);t.push(...s.getDrawableElement())}break;case"bar":{let s=new De(i,this.boundingRect,this.xAxis,this.yAxis,this.chartConfig.chartOrientation,e);t.push(...s.getDrawableElement())}break}return t}};function te(t,e,i){return new Pe(t,e,i)}a(te,"getPlotComponent");var Le=class{constructor(t,e,i,s){this.chartConfig=t,this.chartData=e,this.componentStore={title:Zt(t,e,i,s),plot:te(t,e,i),legend:Jt(t,e,i,s),xAxis:At(e.xAxis,t.xAxis,{titleColor:i.xAxisTitleColor,labelColor:i.xAxisLabelColor,tickColor:i.xAxisTickColor,axisLineColor:i.xAxisLineColor},s),yAxis:At(e.yAxis,t.yAxis,{titleColor:i.yAxisTitleColor,labelColor:i.yAxisLabelColor,tickColor:i.yAxisTickColor,axisLineColor:i.yAxisLineColor},s)}}static{a(this,"Orchestrator")}calculateVerticalSpace(){let t=this.chartConfig.width,e=this.chartConfig.height,i=0,s=0,n={width:0,height:0},d=Math.floor(t*this.chartConfig.plotReservedSpacePercent/100),l=Math.floor(e*this.chartConfig.plotReservedSpacePercent/100),f=this.componentStore.plot.calculateSpace({width:d,height:l});t-=f.width,e-=f.height,f=this.componentStore.title.calculateSpace({width:this.chartConfig.width,height:e}),s=f.height,e-=f.height,this.componentStore.xAxis.setAxisPosition("bottom"),f=this.componentStore.xAxis.calculateSpace({width:t,height:e}),e-=f.height,this.componentStore.yAxis.setAxisPosition("left"),f=this.componentStore.yAxis.calculateSpace({width:t,height:e}),i=f.width,t-=f.width,n=this.componentStore.legend.calculateSpace({width:t,height:l}),t-=n.width,t>0&&(d+=t,t=0),e>0&&(l+=e,e=0),this.componentStore.plot.calculateSpace({width:d,height:l}),this.componentStore.plot.setBoundingBoxXY({x:i,y:s}),this.componentStore.title.alignTo(i,i+d),this.componentStore.legend.setBoundingBoxXY({x:i+d,y:s+Math.max((l-n.height)/2,0)}),this.componentStore.xAxis.setRange([i,i+d]),this.componentStore.xAxis.setBoundingBoxXY({x:i,y:s+l}),this.componentStore.yAxis.setRange([s,s+l]),this.componentStore.yAxis.setBoundingBoxXY({x:0,y:s}),this.chartData.plots.some(u=>ot(u))&&this.componentStore.xAxis.recalculateOuterPaddingToDrawBar()}calculateHorizontalSpace(){let t=this.chartConfig.width,e=this.chartConfig.height,i=0,s=0,n=0,d={width:0,height:0},l=Math.floor(t*this.chartConfig.plotReservedSpacePercent/100),f=Math.floor(e*this.chartConfig.plotReservedSpacePercent/100),u=this.componentStore.plot.calculateSpace({width:l,height:f});t-=u.width,e-=u.height,u=this.componentStore.title.calculateSpace({width:this.chartConfig.width,height:e}),i=u.height,e-=u.height,this.componentStore.xAxis.setAxisPosition("left"),u=this.componentStore.xAxis.calculateSpace({width:t,height:e}),t-=u.width,s=u.width,this.componentStore.yAxis.setAxisPosition("top"),u=this.componentStore.yAxis.calculateSpace({width:t,height:e}),e-=u.height,n=i+u.height,d=this.componentStore.legend.calculateSpace({width:t,height:f}),t-=d.width,t>0&&(l+=t,t=0),e>0&&(f+=e,e=0),this.componentStore.plot.calculateSpace({width:l,height:f}),this.componentStore.plot.setBoundingBoxXY({x:s,y:n}),this.componentStore.title.alignTo(s,s+l),this.componentStore.legend.setBoundingBoxXY({x:s+l,y:n+Math.max((f-d.height)/2,0)}),this.componentStore.yAxis.setRange([s,s+l]),this.componentStore.yAxis.setBoundingBoxXY({x:s,y:i}),this.componentStore.xAxis.setRange([n,n+f]),this.componentStore.xAxis.setBoundingBoxXY({x:0,y:n}),this.chartData.plots.some(A=>ot(A))&&this.componentStore.xAxis.recalculateOuterPaddingToDrawBar()}calculateSpace(){this.chartConfig.chartOrientation==="horizontal"?this.calculateHorizontalSpace():this.calculateVerticalSpace()}getDrawableElement(){this.calculateSpace();let t=[];this.componentStore.plot.setAxes(this.componentStore.xAxis,this.componentStore.yAxis);for(let e of Object.values(this.componentStore))t.push(...e.getDrawableElements());return t}},ve=class{static{a(this,"XYChartBuilder")}static build(t,e,i,s){return new Le(t,e,i,s).getDrawableElement()}},J=0,ee,tt=Tt(),et=_t(),m=Dt(),Ct=et.plotColorPalette.split(",").map(t=>t.trim()),ht=!1,Rt=!1;function _t(){let t=Ot(),e=nt();return yt(t.xyChart,e.themeVariables.xyChart)}a(_t,"getChartDefaultThemeConfig");function Tt(){let t=nt();return yt(Vt.xyChart,t.xyChart)}a(Tt,"getChartDefaultConfig");function Dt(){return{yAxis:{type:"linear",title:"",min:1/0,max:-1/0},xAxis:{type:"band",title:"",categories:[]},title:"",plots:[]}}a(Dt,"getChartDefaultData");function j(t){let e=nt();return Wt(t.trim(),e)}a(j,"textSanitizer");function ie(t){ee=t}a(ie,"setTmpSVGG");function se(t){t==="horizontal"?tt.chartOrientation="horizontal":tt.chartOrientation="vertical"}a(se,"setOrientation");function ae(t){m.xAxis.title=j(t.text)}a(ae,"setXAxisTitle");function Pt(t,e){m.xAxis={type:"linear",title:m.xAxis.title,min:t,max:e},ht=!0}a(Pt,"setXAxisRangeData");function ne(t){m.xAxis={type:"band",title:m.xAxis.title,categories:t.map(e=>j(e.text))},ht=!0}a(ne,"setXAxisBand");function oe(t){m.yAxis.title=j(t.text)}a(oe,"setYAxisTitle");function re(t,e){m.yAxis={type:"linear",title:m.yAxis.title,min:t,max:e},Rt=!0}a(re,"setYAxisRangeData");function he(t){let e=Math.min(...t),i=Math.max(...t),s=Z(m.yAxis)?m.yAxis.min:1/0,n=Z(m.yAxis)?m.yAxis.max:-1/0;m.yAxis={type:"linear",title:m.yAxis.title,min:Math.min(s,e),max:Math.max(n,i)}}a(he,"setYAxisRangeFromPlotData");function Lt(t){let e=[];if(t.length===0)return e;if(!ht){let i=Z(m.xAxis)?m.xAxis.min:1/0,s=Z(m.xAxis)?m.xAxis.max:-1/0;Pt(Math.min(i,1),Math.max(s,t.length))}if(rt(m.xAxis)&&t.length>m.xAxis.categories.length&&(t=t.slice(0,m.xAxis.categories.length)),Rt||he(t),rt(m.xAxis)&&(e=m.xAxis.categories.map((i,s)=>[i,t[s]])),Z(m.xAxis)){let i=m.xAxis.min,s=m.xAxis.max;if(t.length===1)e=[[`${i}`,t[0]]];else{let n=(s-i)/(t.length-1);e=t.map((d,l)=>[`${i+l*n}`,d])}}return e}a(Lt,"transformDataWithoutCategory");function vt(t){return Ct[t===0?0:t%Ct.length]}a(vt,"getPlotColorFromPalette");function le(t,e){let i=e.map(l=>l.value),s=e.map(l=>l.label?j(l.label):""),n=Lt(i),d=s.some(l=>l!=="");m.plots.push({type:"line",title:j(t.text),strokeFill:vt(J),strokeWidth:2,data:n,...d?{pointLabels:s}:{}}),J++}a(le,"setLineData");function ce(t,e){let i=e.map(n=>n.value),s=Lt(i);m.plots.push({type:"bar",title:j(t.text),fill:vt(J),data:s}),J++}a(ce,"setBarData");function ge(){if(m.plots.length===0)throw Error("No Plot to render, please provide a plot with some data");return m.title=ft(),ve.build(tt,m,et,ee)}a(ge,"getDrawableElem");function ue(){return et}a(ue,"getChartThemeConfig");function de(){return tt}a(de,"getChartConfig");function xe(){return m}a(xe,"getXYChartData");var Ee=a(function(){Xt(),J=0,tt=Tt(),m=Dt(),et=_t(),Ct=et.plotColorPalette.split(",").map(t=>t.trim()),ht=!1,Rt=!1},"clear"),Ie={getDrawableElem:ge,clear:Ee,setAccTitle:Yt,getAccTitle:Nt,setDiagramTitle:Ut,getDiagramTitle:ft,getAccDescription:$t,setAccDescription:Ht,setOrientation:se,setXAxisTitle:ae,setXAxisRangeData:Pt,setXAxisBand:ne,setYAxisTitle:oe,setYAxisRangeData:re,setLineData:le,setBarData:ce,setTmpSVGG:ie,getChartThemeConfig:ue,getChartConfig:de,getXYChartData:xe},Me=a((t,e,i,s)=>{let n=s.db,d=n.getChartThemeConfig(),l=n.getChartConfig(),f=n.getXYChartData().plots[0].data.map(b=>b[1]);function u(b){return b==="top"?"text-before-edge":"middle"}a(u,"getDominantBaseLine");function A(b){return b==="left"?"start":b==="right"?"end":"middle"}a(A,"getTextAnchor");function R(b){return`translate(${b.x}, ${b.y}) rotate(${b.rotation||0})`}a(R,"getTextTransformation"),xt.debug(`Rendering xychart chart
|
|
7
|
+
`+t);let _=Gt(e),B=_.append("g").attr("class","main"),F=B.append("rect").attr("width",l.width).attr("height",l.height).attr("class","background");Ft(_,l.height,l.width,!0),_.attr("viewBox",`0 0 ${l.width} ${l.height}`),F.attr("fill",d.backgroundColor),n.setTmpSVGG(_.append("g").attr("class","mermaid-tmp-group"));let X=n.getDrawableElem(),v={};function V(b){let E=B,c="";for(let[L]of b.entries()){let I=B;L>0&&v[c]&&(I=v[c]),c+=b[L],E=v[c],E||(E=v[c]=I.append("g").attr("class",b[L]))}return E}a(V,"getGroup");for(let b of X){if(b.data.length===0)continue;let E=V(b.groupTexts);switch(b.type){case"rect":if(E.selectAll("rect").data(b.data).enter().append("rect").attr("x",c=>c.x).attr("y",c=>c.y).attr("width",c=>c.width).attr("height",c=>c.height).attr("fill",c=>c.fill).attr("stroke",c=>c.strokeFill).attr("stroke-width",c=>c.strokeWidth),l.showDataLabel){let c=l.showDataLabelOutsideBar;if(l.chartOrientation==="horizontal"){let L=function(y,W){let{data:C,label:z}=y;return W*z.length*I<=C.width-w};var Y=L;a(L,"fitsHorizontally");let I=.7,w=10,$=b.data.map((y,W)=>({data:y,label:f[W].toString()})).filter(y=>y.data.width>0&&y.data.height>0),D=$.map(y=>{let{data:W}=y,C=W.height*.7;for(;!L(y,C)&&C>0;)C-=1;return C}),Q=Math.floor(Math.min(...D)),S=a(y=>c?y.data.x+y.data.width+w:y.data.x+y.data.width-w,"determineLabelXPosition");E.selectAll("text").data($).enter().append("text").attr("x",S).attr("y",y=>y.data.y+y.data.height/2).attr("text-anchor",c?"start":"end").attr("dominant-baseline","middle").attr("fill",d.dataLabelColor).attr("font-size",`${Q}px`).text(y=>y.label)}else{let L=function(S,y,W){let{data:C,label:z}=S,h=y*z.length*.7,g=C.x+C.width/2,x=g-h/2,k=g+h/2,o=x>=C.x&&k<=C.x+C.width,U=C.y+W+y<=C.y+C.height;return o&&U};var N=L;a(L,"fitsInBar");let I=10,w=b.data.map((S,y)=>({data:S,label:f[y].toString()})).filter(S=>S.data.width>0&&S.data.height>0),$=w.map(S=>{let{data:y,label:W}=S,C=y.width/(W.length*.7);for(;!L(S,C,I)&&C>0;)C-=1;return C}),D=Math.floor(Math.min(...$)),Q=a(S=>c?S.data.y-I:S.data.y+I,"determineLabelYPosition");E.selectAll("text").data(w).enter().append("text").attr("x",S=>S.data.x+S.data.width/2).attr("y",Q).attr("text-anchor","middle").attr("dominant-baseline",c?"auto":"hanging").attr("fill",d.dataLabelColor).attr("font-size",`${D}px`).text(S=>S.label)}}break;case"text":E.selectAll("text").data(b.data).enter().append("text").attr("x",0).attr("y",0).attr("fill",c=>c.fill).attr("font-size",c=>c.fontSize).attr("dominant-baseline",c=>u(c.verticalPos)).attr("text-anchor",c=>A(c.horizontalPos)).attr("transform",c=>R(c)).text(c=>c.text);break;case"path":E.selectAll("path").data(b.data).enter().append("path").attr("d",c=>c.path).attr("fill",c=>c.fill?c.fill:"none").attr("stroke",c=>c.strokeFill).attr("stroke-width",c=>c.strokeWidth);break}}},"draw"),Be={draw:Me},Ge={parser:ye,db:Ie,renderer:Be};export{Ge as diagram};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import{a as Xr}from"./chunks/chunk-XC2LKMMW.js";import{a as Wr,b as Kr}from"./chunks/chunk-JRAHLUQM.js";import{a as ie}from"./chunks/chunk-QQZBUVKZ.js";import"./chunks/chunk-25KVF5ZE.js";import"./chunks/chunk-5TQRX2ND.js";import"./chunks/chunk-6ZAAIG6Q.js";import"./chunks/chunk-QHMFFOZZ.js";import"./chunks/chunk-ZDOBOOWG.js";import"./chunks/chunk-YORIST7Z.js";import"./chunks/chunk-PM2IFX5O.js";import{a as ae}from"./chunks/chunk-PN62QGJW.js";import{b as Qr}from"./chunks/chunk-DSKRGV6V.js";import"./chunks/chunk-HIGPS4L2.js";import{b as Dr,d as Zr,m as Tr,n as Jr,p as re,q as V,r as ee,s as te}from"./chunks/chunk-22D53RF2.js";import"./chunks/chunk-STBOPOHX.js";import{A as Sr,B as Hr,C as $,D as Br,E as q,G as Yr,P as jr,R as Er,S as qr,ea as X,fa as or,g as Rr,i as Ir,j as Fr,k as J,l as rr,m as er,n as Or,o as $r,q as tr,r as zr,t as Pr,u as ar,v as Nr,w as ir,x as Vr,y as Ur,z as Gr}from"./chunks/chunk-AECJS4LP.js";import{b as g,c as br,h as k}from"./chunks/chunk-4HYFSIZT.js";import{a as i}from"./chunks/chunk-EIBFAW37.js";import"./chunks/chunk-PHKIAKHS.js";var U="comm",nr="rule",sr="decl";var oe="@media",ne="@import";var se="@supports";var de="@namespace",W="@keyframes";var dr="@layer",ce="@scope";var le=Math.abs,z=String.fromCharCode;function cr(r){return r.trim()}function K(r,e,t){return r.replace(e,t)}function R(r,e){return r.charCodeAt(e)|0}function I(r,e,t){return r.slice(e,t)}function S(r){return r.length}function lr(r){return r.length}function G(r,e){return e.push(r),r}var mr=1,H=1,me=0,_=0,h=0,Y="";function ur(r,e,t,a,o,n,d,s){return{value:r,root:e,parent:t,type:a,props:o,children:n,line:mr,column:H,length:d,return:"",siblings:s}}function ue(){return h}function pe(){return h=_>0?R(Y,--_):0,H--,h===10&&(H=1,mr--),h}function M(){return h=_<me?R(Y,_++):0,H++,h===10&&(H=1,mr++),h}function F(){return R(Y,_)}function Q(){return _}function pr(r,e){return I(Y,r,e)}function B(r){switch(r){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function fe(r){return mr=H=1,me=S(Y=r),_=0,[]}function ge(r){return Y="",r}function fr(r){return cr(pr(_-1,Ar(r===91?r+2:r===40?r+1:r)))}function ve(r){for(;(h=F())&&h<33;)M();return B(r)>2||B(h)>3?"":" "}function he(r,e){for(;--e&&M()&&!(h<48||h>102||h>57&&h<65||h>70&&h<97););return pr(r,Q()+(e<6&&F()==32&&M()==32))}function Ar(r){for(;M();)switch(h){case r:return _;case 34:case 39:r!==34&&r!==39&&Ar(h);break;case 40:r===41&&Ar(r);break;case 92:M();break}return _}function ye(r,e){for(;M()&&r+h!==57;)if(r+h===84&&F()===47)break;return"/*"+pr(e,_-1)+"*"+z(r===47?r:M())}function we(r){for(;!B(F());)M();return pr(r,_)}function Se(r){return ge(gr("",null,null,null,[""],r=fe(r),0,[0],r))}function gr(r,e,t,a,o,n,d,s,c){for(var u=0,f=0,p=d,m=0,x=0,E=0,b=1,w=1,D=1,T=0,v=0,C="",N=o,L=n,A=a,l=C;w;)switch(E=v,v=M()){case 40:E!=108&&R(l,p-1)==58?(T++,l+="("):l+=fr(v);break;case 41:T--,l+=")";break;case 34:case 39:case 91:l+=fr(v);break;case 9:case 10:case 13:case 32:if(T>0){l+=z(v);break}l+=ve(E);break;case 92:l+=he(Q()-1,7);continue;case 47:switch(F()){case 42:case 47:G(kt(ye(M(),Q()),e,t,c),c),(B(E||1)==5||B(F()||1)==5)&&S(l)&&I(l,-1,void 0)!==" "&&(l+=" ");break;default:l+="/"}break;case 123*b:s[u++]=S(l)*D;case 125*b:case 59:case 0:if(T>0&&v){l+=z(v);break}switch(v){case 0:case 125:w=0;case 59+f:D==-1&&(l=K(l,/\f/g,"")),x>0&&(S(l)-p||b===0)&&G(x>32?be(l+";",a,t,p-1,c):be(K(l," ","")+";",a,t,p-2,c),c);break;case 59:l+=";";default:if(G(A=xe(l,e,t,u,f,o,s,C,N=[],L=[],p,n),n),v===123)if(f===0)gr(l,e,A,A,N,n,p,s,L);else{switch(m){case 99:if(R(l,3)===110)break;case 108:if(R(l,2)===97)break;default:f=0;case 100:case 109:case 115:}f?gr(r,A,A,a&&G(xe(r,A,A,0,0,o,s,C,o,N=[],p,L),L),o,L,p,s,a?N:L):gr(l,A,A,A,[""],L,0,s,L)}}u=f=x=0,b=D=1,C=l="",p=d;break;case 58:p=1+S(l),x=E;default:if(b<1){if(v==123)--b;else if(v==125&&b++==0&&pe()==125)continue}switch(l+=z(v),v*b){case 38:D=f>0?1:(l+="\f",-1);break;case 44:if(T>0)break;s[u++]=(S(l)-1)*D,D=1;break;case 64:F()===45&&(l+=fr(M())),m=F(),f=p=S(C=l+=we(Q())),v++;break;case 45:E===45&&S(l)==2&&(b=0)}}return n}function xe(r,e,t,a,o,n,d,s,c,u,f,p){for(var m=o-1,x=o===0?n:[""],E=lr(x),b=0,w=0,D=0;b<a;++b)for(var T=0,v=I(r,m+1,m=le(w=d[b])),C=r;T<E;++T)(C=cr(w>0?x[T]+" "+v:K(v,/&\f/g,x[T])))&&(c[D++]=C);return ur(r,e,t,o===0?nr:s,c,u,f,p)}function kt(r,e,t,a){return ur(r,e,t,U,z(ue()),I(r,2,-2),0,a)}function be(r,e,t,a,o){return ur(r,e,t,sr,I(r,0,a),I(r,a+1,-1),a,o)}function vr(r,e){for(var t="",a=0;a<r.length;a++)t+=e(r[a],a,r,e)||"";return t}function Ee(r,e,t,a){switch(r.type){case dr:if(r.children.length)break;case ne:case de:case sr:return r.return=r.return||r.value;case U:return"";case W:return r.return=r.value+"{"+vr(r.children,a)+"}";case nr:if(!S(r.value=r.props.join(",")))return""}return S(t=vr(r.children,a))?r.return=r.value+"{"+t+"}":""}function De(r){var e=lr(r);return function(t,a,o,n){for(var d="",s=0;s<e;s++)d+=r[s](t,a,o,n)||"";return d}}var Ce="c4",Rt=i(r=>/^\s*C4Context|C4Container|C4Component|C4Dynamic|C4Deployment/.test(r),"detector"),It=i(async()=>{let{diagram:r}=await import("./chunks/c4Diagram-CRA5TL53-OG62EAHM.js");return{id:Ce,diagram:r}},"loader"),Ft={id:Ce,detector:Rt,loader:It},Ot=Ft,Le="flowchart-v2",$t=i(r=>/^\s*(graph|flowchart)/.test(r),"detector"),zt=i(async()=>{let{diagram:r}=await import("./chunks/flowDiagram-OXPTDLAJ-CUMOBDC3.js");return{id:Le,diagram:r}},"loader"),Pt={id:Le,detector:$t,loader:zt},Nt=Pt,ke="agentflow",Vt=i(r=>/^\s*agentflow-beta\b/.test(r),"detector"),Ut=i(async()=>{let{diagram:r}=await import("./chunks/diagram-2UJZ2QOL-YCKW3WNJ.js");return{id:ke,diagram:r}},"loader"),Gt={id:ke,detector:Vt,loader:Ut},Ht=Gt,Re="swimlane",Bt=i(r=>/^\s*swimlane-beta\b/.test(r),"detector"),Yt=i(async()=>{let{diagram:r}=await import("./chunks/swimlanesDiagram-K3J5GTZL-YMNX34Q2.js");return{id:Re,diagram:r}},"loader"),jt={id:Re,detector:Bt,loader:Yt},qt=jt,Ie="er",Xt=i(r=>/^\s*erDiagram/.test(r),"detector"),Wt=i(async()=>{let{diagram:r}=await import("./chunks/erDiagram-O2IAPWRE-KWX2J2TX.js");return{id:Ie,diagram:r}},"loader"),Kt={id:Ie,detector:Xt,loader:Wt},Qt=Kt,Fe="gitGraph",Zt=i(r=>/^\s*gitGraph/.test(r),"detector"),Jt=i(async()=>{let{diagram:r}=await import("./chunks/gitGraphDiagram-XJZIOB7I-FB763ROZ.js");return{id:Fe,diagram:r}},"loader"),ra={id:Fe,detector:Zt,loader:Jt},ea=ra,Oe="gantt",ta=i(r=>/^\s*gantt/.test(r),"detector"),aa=i(async()=>{let{diagram:r}=await import("./chunks/ganttDiagram-R7TSEDQI-GCS3MRFX.js");return{id:Oe,diagram:r}},"loader"),ia={id:Oe,detector:ta,loader:aa},oa=ia,$e="info",na=i(r=>/^\s*info/.test(r),"detector"),sa=i(async()=>{let{diagram:r}=await import("./chunks/infoDiagram-5W2HQ5XZ-XCQU5T5D.js");return{id:$e,diagram:r}},"loader"),da={id:$e,detector:na,loader:sa},ze="pie",ca=i(r=>/^\s*pie/.test(r),"detector"),la=i(async()=>{let{diagram:r}=await import("./chunks/pieDiagram-CAPJLFHJ-V3WNR4Y2.js");return{id:ze,diagram:r}},"loader"),ma={id:ze,detector:ca,loader:la},Pe="quadrantChart",ua=i(r=>/^\s*quadrantChart/.test(r),"detector"),pa=i(async()=>{let{diagram:r}=await import("./chunks/quadrantDiagram-GDMTTRAM-DJLTATHS.js");return{id:Pe,diagram:r}},"loader"),fa={id:Pe,detector:ua,loader:pa},ga=fa,Ne="xychart",va=i(r=>/^\s*xychart(-beta)?/.test(r),"detector"),ha=i(async()=>{let{diagram:r}=await import("./chunks/xychartDiagram-TAQBALBS-2MTP7IBV.js");return{id:Ne,diagram:r}},"loader"),ya={id:Ne,detector:va,loader:ha},wa=ya,Ve="requirement",xa=i(r=>/^\s*requirement(Diagram)?/.test(r),"detector"),ba=i(async()=>{let{diagram:r}=await import("./chunks/requirementDiagram-X7JNWC4A-TVHJNPPI.js");return{id:Ve,diagram:r}},"loader"),Sa={id:Ve,detector:xa,loader:ba},Ea=Sa,Ue="sequence",Da=i(r=>/^\s*sequenceDiagram/.test(r),"detector"),Ta=i(async()=>{let{diagram:r}=await import("./chunks/sequenceDiagram-ZO4K6R2Y-OP7DCVPK.js");return{id:Ue,diagram:r}},"loader"),Aa={id:Ue,detector:Da,loader:Ta},_a=Aa,Ge="classDiagram",Ma=i(r=>/^\s*classDiagram/.test(r),"detector"),Ca=i(async()=>{let{diagram:r}=await import("./chunks/classDiagram-v2-K4WV4PDN-HXQD675C.js");return{id:Ge,diagram:r}},"loader"),La={id:Ge,detector:Ma,loader:Ca},ka=La,He="stateDiagram",Ra=i(r=>/^\s*stateDiagram/.test(r),"detector"),Ia=i(async()=>{let{diagram:r}=await import("./chunks/stateDiagram-v2-TBUQTH76-R26D6XHK.js");return{id:He,diagram:r}},"loader"),Fa={id:He,detector:Ra,loader:Ia},Oa=Fa,Be="journey",$a=i(r=>/^\s*journey/.test(r),"detector"),za=i(async()=>{let{diagram:r}=await import("./chunks/journeyDiagram-COXZFDF6-DOW66RYW.js");return{id:Be,diagram:r}},"loader"),Pa={id:Be,detector:$a,loader:za},Na=Pa,hr=4,Z=75,Va=i(r=>{let e=[];for(let o of r.split(/\s+/)){let n=[...o];for(;n.length>Z;)e.push(n.slice(0,Z).join("")),n=n.slice(Z);n.length>0&&e.push(n.join(""))}let t=[],a="";for(let o of e){let n=a?`${a} ${o}`:o;[...n].length>Z?(t.push(a),a=o):a=n}if(a&&t.push(a),t.length>hr){t.length=hr;let o=t[hr-1]??"";t[hr-1]=`${[...o].slice(0,Z-3).join("")}...`}return t},"wrapErrorMessage"),Ua=i((r,e,t,a)=>{g.debug(`rendering svg for syntax error
|
|
2
|
+
`);let o=Xr(e),n=o.append("g"),d=Va(a?.db.getErrorMessage?.()??""),s=d.length>0?500+d.length*56:512;o.attr("viewBox",`0 0 2412 ${s}`),jr(o,100,s,!0),n.append("path").attr("class","error-icon").attr("d","m411.313,123.313c6.25-6.25 6.25-16.375 0-22.625s-16.375-6.25-22.625,0l-32,32-9.375,9.375-20.688-20.688c-12.484-12.5-32.766-12.5-45.25,0l-16,16c-1.261,1.261-2.304,2.648-3.31,4.051-21.739-8.561-45.324-13.426-70.065-13.426-105.867,0-192,86.133-192,192s86.133,192 192,192 192-86.133 192-192c0-24.741-4.864-48.327-13.426-70.065 1.402-1.007 2.79-2.049 4.051-3.31l16-16c12.5-12.492 12.5-32.758 0-45.25l-20.688-20.688 9.375-9.375 32.001-31.999zm-219.313,100.687c-52.938,0-96,43.063-96,96 0,8.836-7.164,16-16,16s-16-7.164-16-16c0-70.578 57.422-128 128-128 8.836,0 16,7.164 16,16s-7.164,16-16,16z"),n.append("path").attr("class","error-icon").attr("d","m459.02,148.98c-6.25-6.25-16.375-6.25-22.625,0s-6.25,16.375 0,22.625l16,16c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688 6.25-6.25 6.25-16.375 0-22.625l-16.001-16z"),n.append("path").attr("class","error-icon").attr("d","m340.395,75.605c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688 6.25-6.25 6.25-16.375 0-22.625l-16-16c-6.25-6.25-16.375-6.25-22.625,0s-6.25,16.375 0,22.625l15.999,16z"),n.append("path").attr("class","error-icon").attr("d","m400,64c8.844,0 16-7.164 16-16v-32c0-8.836-7.156-16-16-16-8.844,0-16,7.164-16,16v32c0,8.836 7.156,16 16,16z"),n.append("path").attr("class","error-icon").attr("d","m496,96.586h-32c-8.844,0-16,7.164-16,16 0,8.836 7.156,16 16,16h32c8.844,0 16-7.164 16-16 0-8.836-7.156-16-16-16z"),n.append("path").attr("class","error-icon").attr("d","m436.98,75.605c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688l32-32c6.25-6.25 6.25-16.375 0-22.625s-16.375-6.25-22.625,0l-32,32c-6.251,6.25-6.251,16.375-0.001,22.625z"),n.append("text").attr("class","error-text").attr("x",1440).attr("y",250).attr("font-size","150px").style("text-anchor","middle").text("Syntax error in text"),n.append("text").attr("class","error-text").attr("x",1250).attr("y",400).attr("font-size","100px").style("text-anchor","middle").text(`mermaid version ${t}`),d.forEach((c,u)=>{n.append("text").attr("class","error-text").attr("x",1440).attr("y",510+u*56).attr("font-size","42px").style("text-anchor","middle").text(c)})},"draw"),Ye={draw:Ua},Ga=Ye,_r,Ha={clear(){_r=void 0},setErrorMessage(r){_r=r},getErrorMessage(){return _r}},Ba={db:Ha,renderer:Ye,parser:{parse:i(()=>{},"parse")}},Ya=Ba,je="flowchart-elk",ja=i((r,e={})=>/^\s*flowchart-elk/.test(r)?(e.layout="elk",!0):!1,"detector"),qa=i(async()=>{let{diagram:r}=await import("./chunks/flowDiagram-OXPTDLAJ-CUMOBDC3.js");return{id:je,diagram:r}},"loader"),Xa={id:je,detector:ja,loader:qa},Wa=Xa,qe="timeline",Ka=i(r=>/^\s*timeline/.test(r),"detector"),Qa=i(async()=>{let{diagram:r}=await import("./chunks/timeline-definition-YOQAKGHF-R2U2UR4K.js");return{id:qe,diagram:r}},"loader"),Za={id:qe,detector:Ka,loader:Qa},Ja=Za,Xe="mindmap",ri=i(r=>/^\s*mindmap/.test(r),"detector"),ei=i(async()=>{let{diagram:r}=await import("./chunks/mindmap-definition-LZFPQGKD-WG3FIZ5U.js");return{id:Xe,diagram:r}},"loader"),ti={id:Xe,detector:ri,loader:ei},ai=ti,We="kanban",ii=i(r=>/^\s*kanban/.test(r),"detector"),oi=i(async()=>{let{diagram:r}=await import("./chunks/kanban-definition-P3RFRI5V-K55BXDLO.js");return{id:We,diagram:r}},"loader"),ni={id:We,detector:ii,loader:oi},si=ni,Ke="sankey",di=i(r=>/^\s*sankey(-beta)?/.test(r),"detector"),ci=i(async()=>{let{diagram:r}=await import("./chunks/sankeyDiagram-UM26HJRW-FXHWY3MM.js");return{id:Ke,diagram:r}},"loader"),li={id:Ke,detector:di,loader:ci},mi=li,Qe="packet",ui=i(r=>/^\s*packet(-beta)?/.test(r),"detector"),pi=i(async()=>{let{diagram:r}=await import("./chunks/diagram-UMYRVEAY-Q4I25SMR.js");return{id:Qe,diagram:r}},"loader"),fi={id:Qe,detector:ui,loader:pi},Ze="radar",gi=i(r=>/^\s*radar-beta/.test(r),"detector"),vi=i(async()=>{let{diagram:r}=await import("./chunks/diagram-YEKJPTXX-VNUTOPRK.js");return{id:Ze,diagram:r}},"loader"),hi={id:Ze,detector:gi,loader:vi},Je="block",yi=i(r=>/^\s*block(-beta)?/.test(r),"detector"),wi=i(async()=>{let{diagram:r}=await import("./chunks/blockDiagram-E7TT5TSB-FH6ZULKF.js");return{id:Je,diagram:r}},"loader"),xi={id:Je,detector:yi,loader:wi},bi=xi,rt="treeView",Si=i(r=>/^\s*treeView-beta/.test(r),"detector"),Ei=i(async()=>{let{diagram:r}=await import("./chunks/diagram-PFPMY2P6-7RR2GTZ5.js");return{id:rt,diagram:r}},"loader"),Di={id:rt,detector:Si,loader:Ei},Ti=Di,et="architecture",Ai=i(r=>/^\s*architecture/.test(r),"detector"),_i=i(async()=>{let{diagram:r}=await import("./chunks/architectureDiagram-47P4ROYG-2BMC2Z7S.js");return{id:et,diagram:r}},"loader"),Mi={id:et,detector:Ai,loader:_i},Ci=Mi,tt="eventmodeling",Li=i(r=>/^\s*eventmodeling/.test(r),"detector"),ki=i(async()=>{let{diagram:r}=await import("./chunks/diagram-ZIFT7M5P-KALXX5CE.js");return{id:tt,diagram:r}},"loader"),Ri={id:tt,detector:Li,loader:ki},Ii=Ri,at="ishikawa",Fi=i(r=>/^\s*ishikawa(-beta)?\b/i.test(r),"detector"),Oi=i(async()=>{let{diagram:r}=await import("./chunks/ishikawaDiagram-K3B6WC7H-UWYT66G7.js");return{id:at,diagram:r}},"loader"),$i={id:at,detector:Fi,loader:Oi},it="venn",zi=i(r=>/^\s*venn-beta/.test(r),"detector"),Pi=i(async()=>{let{diagram:r}=await import("./chunks/vennDiagram-BLWOH2XV-DOV5W2IV.js");return{id:it,diagram:r}},"loader"),Ni={id:it,detector:zi,loader:Pi},Vi=Ni,ot="treemap",Ui=i(r=>/^\s*treemap/.test(r),"detector"),Gi=i(async()=>{let{diagram:r}=await import("./chunks/diagram-OVF4WLC6-62NNPE34.js");return{id:ot,diagram:r}},"loader"),Hi={id:ot,detector:Ui,loader:Gi},nt="usecase",Bi=i(r=>/^\s*usecase-beta(?:\s|$)/.test(r),"detector"),Yi=i(async()=>{let{diagram:r}=await import("./chunks/usecaseDiagram-VIAY4XPW-BCEIGXDX.js");return{id:nt,diagram:r}},"loader"),ji={id:nt,detector:Bi,loader:Yi},st="wardley",qi=i(r=>/^\s*wardley-beta/i.test(r),"detector"),Xi=i(async()=>{let{diagram:r}=await import("./chunks/wardleyDiagram-YMQ3BMBF-CGJ7AG4L.js");return{id:st,diagram:r}},"loader"),Wi={id:st,detector:qi,loader:Xi},Ki=Wi,dt="cynefin",Qi=i(r=>/^\s*cynefin-beta(?:[\s:]|$)/.test(r),"detector"),Zi=i(async()=>{let{diagram:r}=await import("./chunks/cynefinDiagram-3GCD6N5R-LFWDWE4E.js");return{id:dt,diagram:r}},"loader"),Ji={id:dt,detector:Qi,loader:Zi},ct="railroad",ro=i(r=>/^\s*railroad-beta/i.test(r),"detector"),eo=i(async()=>{let{diagram:r}=await import("./chunks/railroadDiagram-SM67HX2B-ZHEERYJS.js");return{id:ct,diagram:r}},"loader"),to={id:ct,detector:ro,loader:eo},lt="railroadEbnf",ao=i(r=>/^\s*railroad-ebnf-beta/i.test(r),"detector"),io=i(async()=>{let{diagram:r}=await import("./chunks/ebnfDiagram-VR2GEFS7-WIFBISHL.js");return{id:lt,diagram:r}},"loader"),oo={id:lt,detector:ao,loader:io},mt="railroadAbnf",no=i(r=>/^\s*railroad-abnf-beta/i.test(r),"detector"),so=i(async()=>{let{diagram:r}=await import("./chunks/abnfDiagram-YUKMZFIV-FZYDJU67.js");return{id:mt,diagram:r}},"loader"),co={id:mt,detector:no,loader:so},ut="railroadPeg",lo=i(r=>/^\s*railroad-peg-beta/i.test(r),"detector"),mo=i(async()=>{let{diagram:r}=await import("./chunks/pegDiagram-BGZESJAR-MQOH3WII.js");return{id:ut,diagram:r}},"loader"),uo={id:ut,detector:lo,loader:mo},Te=!1,xr=i(()=>{Te||(Te=!0,X("error",Ya,r=>r.toLowerCase().trim()==="error"),X("---",{db:{clear:i(()=>{},"clear")},styles:{},renderer:{draw:i(()=>{},"draw")},parser:{parse:i(()=>{throw new Error("Diagrams beginning with --- are not valid. If you were trying to use a YAML front-matter, please ensure that you've correctly opened and closed the YAML front-matter with un-indented `---` blocks")},"parse")},init:i(()=>null,"init")},r=>r.toLowerCase().trimStart().startsWith("---")),er(Wa,ai,Ci),er(Ht,Ot,si,ka,Qt,oa,da,ma,Ea,_a,qt,Nt,Ja,ea,Oa,Na,ga,mi,fi,wa,bi,Ii,Ti,hi,$i,Hi,to,oo,co,uo,Vi,Ki,Ji,ji))},"addDiagrams"),po=i(async()=>{g.debug("Loading registered diagrams");let e=(await Promise.allSettled(Object.entries(J).map(async([t,{detector:a,loader:o}])=>{if(o)try{or(t)}catch{try{let{diagram:n,id:d}=await o();X(d,n,a)}catch(n){throw g.error(`Failed to load external diagram with key ${t}. Removing from detectors.`),delete J[t],n}}}))).filter(t=>t.status==="rejected");if(e.length>0){g.error(`Failed to load ${e.length} external diagrams`);for(let t of e)g.error(t);throw new Error(`Failed to load ${e.length} external diagrams`)}},"loadRegisteredDiagrams"),fo="graphics-document document";function pt(r,e){r.attr("role",fo),e!==""&&r.attr("aria-roledescription",e)}i(pt,"setA11yDiagramInfo");function ft(r,e,t,a){if(r.insert!==void 0){if(t){let o=`chart-desc-${a}`;r.attr("aria-describedby",o),r.insert("desc",":first-child").attr("id",o).text(t)}if(e){let o=`chart-title-${a}`;r.attr("aria-labelledby",o),r.insert("title",":first-child").attr("id",o).text(e)}}}i(ft,"addSVGa11yTitleDescription");var yr=class gt{constructor(e,t,a,o,n){this.type=e,this.text=t,this.db=a,this.parser=o,this.renderer=n}static{i(this,"Diagram")}static async fromText(e,t={}){let a=typeof e=="string"?{raw:e,cleaned:e}:e,o=$(),n=rr(a.cleaned,o);try{or(n)}catch{let m=Or(n);if(!m)throw new Fr(`Diagram ${n} not found.`);let{id:x,diagram:E}=await m();X(x,E)}let{db:d,parser:s,renderer:c,init:u}=or(n);s.parser&&(s.parser.yy=d),d.clear?.(),u?.(o),t.title&&d.setDiagramTitle?.(t.title);let f=a.cleaned;if(d.preserveCommentsWhenParsing&&a.withComments){let m=o.maxTextSize??zr.maxTextSize;a.withComments.length>m?g.warn(`Comment-preserving source exceeds maxTextSize (${a.withComments.length} > ${m}); parsing the comment-stripped text instead. Reported source positions will not account for comment lines.`):f=a.withComments}let p=ee(f)+`
|
|
3
|
+
`;return a.frontmatterLineOffset&&d.setFrontmatterLineOffset?.(a.frontmatterLineOffset),await s.parse(p),new gt(n,p,d,s,c)}async render(e,t){await this.renderer.draw(this.text,e,t,this)}getParser(){return this.parser}getType(){return this.type}},Ae=[],go=i(()=>{Ae.forEach(r=>{r()}),Ae=[]},"attachFunctions"),vo=i(r=>r.replace(/^\s*%%(?!{)[^\n]+\n?/gm,"").trimStart(),"cleanupComments");function vt(r){let e=Ir(r);if(!e)return{text:r,metadata:{}};let t=e.indent,a=t?e.body.split(`
|
|
4
|
+
`).map(d=>d.startsWith(t)?d.slice(t.length):d).join(`
|
|
5
|
+
`):e.body,o=Kr(a,{schema:Wr})??{};o=typeof o=="object"&&!Array.isArray(o)?o:{};let n={};return o.displayMode&&(n.displayMode=o.displayMode.toString()),o.title&&(n.title=o.title.toString()),o.config&&(n.config=o.config),{text:r.slice(e.length),metadata:n}}i(vt,"extractFrontMatter");var ho=i(r=>r.replace(/\r\n?/g,`
|
|
6
|
+
`).replace(/<(\w+)([^>]*)>/g,(e,t,a)=>"<"+t+a.replace(/="([^"]*)"/g,"='$1'")+">"),"cleanupText"),yo=i(r=>{let{text:e,metadata:t}=vt(r),{displayMode:a,title:o,config:n={}}=t;return a&&(n.gantt||(n.gantt={}),n.gantt.displayMode=a),{title:o,config:n,text:e}},"processFrontmatter"),wo=i(r=>{let e=V.detectInit(r)??{},t=V.detectDirective(r,"wrap");return Array.isArray(t)?e.wrap=t.some(({type:a})=>a==="wrap"):t?.type==="wrap"&&(e.wrap=!0),{text:Zr(r),directive:e}},"processDirectives");function Lr(r){let e=r,t=ho(r),a=yo(t),o=wo(a.text),n=re(a.config,o.directive),d=o.text,s=vo(d),c=t.length>a.text.length?(t.substring(0,t.length-a.text.length).match(/\n/g)??[]).length:0;return{code:{raw:e,cleaned:s,withComments:d,frontmatterLineOffset:c},title:a.title,config:n}}i(Lr,"preprocessDiagram");function ht(r){let e=new TextEncoder().encode(r),t=Array.from(e,a=>String.fromCodePoint(a)).join("");return btoa(t)}i(ht,"toBase64");var xo=5e4,bo="graph TB;a[Maximum text size in diagram exceeded];style a fill:#faa",So="sandbox",Eo="loose",Do="http://www.w3.org/2000/svg",To="http://www.w3.org/1999/xlink",Ao="http://www.w3.org/1999/xhtml",_o="100%",Mo="100%",Co="border:0;margin:0;",Lo="margin:0",ko="allow-top-navigation-by-user-activation allow-popups",Ro='The "iframe" tag is not supported by your browser.',Io=["foreignobject"],Fo=["dominant-baseline"];function kr(r){let e=Lr(r);q();let t;try{t=rr(e.code.cleaned,$())}catch{t=void 0}return ir(t),Br(e.config??{}),e}i(kr,"processAndSetConfigs");async function yt(r,e){xr();try{let{code:t,config:a}=kr(r);return{diagramType:(await yr.fromText(t)).type,config:a}}catch(t){if(e?.suppressErrors)return!1;throw t}finally{ir(void 0)}}i(yt,"parse");var _e=i((r,e,t=[])=>{let a=Pr(`{ ${t.join(" !important; ")} !important; }`);return`.${r} ${e} ${a}`},"cssImportantStyles"),Oo=i((r,e=new Map)=>{let t=new CSSStyleSheet;if(r.fontFamily!==void 0&&t.insertRule(`:root { --mermaid-font-family: ${r.fontFamily}}`,t.cssRules.length),r.altFontFamily!==void 0&&t.insertRule(`:root { --mermaid-alt-font-family: ${r.altFontFamily}}`,t.cssRules.length),e instanceof Map){let s=Yr(r)?["> *","span"]:["rect","polygon","ellipse","circle","path"];e.forEach(c=>{Dr(c.styles)||s.forEach(u=>{t.insertRule(_e(c.id,u,c.styles),t.cssRules.length)}),Dr(c.textStyles)||t.insertRule(_e(c.id,"tspan",(c?.textStyles||[]).map(u=>u.replace("color","fill"))),t.cssRules.length)})}let a="";if(r.themeCSS!==void 0)if(typeof t.replaceSync=="function"){let o=new CSSStyleSheet;o.replaceSync(r.themeCSS),a=Er(o)+`
|
|
7
|
+
`}else a+=`${r.themeCSS}
|
|
8
|
+
`;return a+Er(t)},"createCssStyles"),$o=i((r,e)=>vr(Se(`${r}{${e}}`),De([i(function(a,o,n,d){if(a.type==="rule"&&Array.isArray(a.props)){if(a.parent&&a.parent.type===W)return;a.props=a.props.map(s=>s===r&&Array.isArray(a.children)&&a.children.every(u=>u.type!=="decl"?!1:new Set(["font-family","font-size","fill"]).has(u.props))||(s.startsWith(`${r} `)||s.startsWith(`${r}>`))&&!s.startsWith(`${r} ||`)?s:`${r} ${s}`)}else a.type.startsWith("@")&&([...[oe,se,dr,ce,"@container","@starting-style"],W].includes(a.type)||(g.warn(`Removing unsupported at-rule ${a.type} from CSS`),a.type=U))},"addNamespace"),Ee])),"compileCSS"),zo=i((r,e,t,a)=>{let o=Oo(r,t),n=qr(e,o,{...r.themeVariables,theme:r.theme,look:r.look},a);return $o(a,n)},"createUserStyles"),Po=i((r="",e,t)=>{let a=r;return!t&&!e&&(a=a.replace(/marker-end="url\([\d+./:=?A-Za-z-]*?#/g,'marker-end="url(#')),a=te(a),a=a.replace(/<br>/g,"<br/>"),a},"cleanUpSvgCode"),No=i((r="",e)=>{let t=e?.viewBox?.baseVal?.height?e.viewBox.baseVal.height+"px":Mo,a=ht(`<body style="${Lo}">${r}</body>`);return`<iframe style="width:${_o};height:${t};${Co}" src="data:text/html;charset=UTF-8;base64,${a}" sandbox="${ko}">
|
|
9
|
+
${Ro}
|
|
10
|
+
</iframe>`},"putIntoIFrame"),Me=i((r,e,t,a,o)=>{let n=r.append("div");n.attr("id",t),a&&n.attr("style",a);let d=n.append("svg").attr("id",e).attr("width","100%").attr("xmlns",Do);return o&&d.attr("xmlns:xlink",o),d.append("g"),r},"appendDivSvgG");function Cr(r,e){return r.append("iframe").attr("id",e).attr("style","width: 100%; height: 100%;").attr("sandbox","")}i(Cr,"sandboxedIframe");var Vo=i((r,e,t,a)=>{r.getElementById(e)?.remove(),r.getElementById(t)?.remove(),r.getElementById(a)?.remove()},"removeExistingElements"),Uo=i(async function(r,e,t){xr();let a=kr(e),o=a.code;e=o.cleaned;let n=$();g.debug(n),e.length>(n?.maxTextSize??xo)&&(e=bo,o={raw:e,cleaned:e});let d=`#${r}`,s="i"+r,c="#"+s,u="d"+r,f="#"+u,p=i(()=>{let j=k(x?c:f).node();j&&"remove"in j&&j.remove()},"removeTempElements"),m=k(document.body),x=n.securityLevel===So,E=n.securityLevel===Eo,b=n.fontFamily;if(t!==void 0){if(t&&(t.innerHTML=""),x){let y=Cr(k(t),s);m=k(y.nodes()[0].contentDocument.body),m.node().style.margin="0"}else m=k(t);Me(m,r,u,`font-family: ${b}`,To)}else{if(Vo(document,r,u,s),x){let y=Cr(k(document.body),s);m=k(y.nodes()[0].contentDocument.body),m.node().style.margin="0"}else m=k("body");Me(m,r,u)}let w,D;try{w=await yr.fromText(o,{title:a.title})}catch(y){if(n.suppressErrorRendering)throw p(),y;w=await yr.fromText("error"),D=y,w.db.setErrorMessage?.(Jr(y))}let T=m.select(f).node(),v=w.type,C=T.firstChild,N=C.firstChild,L=w.renderer.getClasses?.(e,w),A=zo(n,v,L,d),l=document.createElement("style");l.innerHTML=A,C.insertBefore(l,N);try{await w.renderer.draw(e,r,"12.1.0",w)}catch(y){throw n.suppressErrorRendering?p():Ga.draw(e,r,"12.1.0"),y}let At=m.select(`${f} svg`),_t=w.db.getAccTitle?.(),Mt=w.db.getAccDescription?.();xt(v,At,_t,Mt);let Ct=i(()=>{m.select(`[id="${r}"]`).selectAll("foreignobject > *").attr("xmlns",Ao);let y=m.select(f).node().innerHTML;if(g.debug("config.arrowMarkerAbsolute",n.arrowMarkerAbsolute),y=Po(y,x,Nr(n.arrowMarkerAbsolute)),x){let j=m.select(f+" svg").node();y=No(y,j)}else E||(y=Rr.sanitize(y,{ADD_TAGS:Io,ADD_ATTR:Fo,HTML_INTEGRATION_POINTS:{foreignobject:!0}}));return go(),y},"serializeSvg")();if(D)throw D;return p(),{diagramType:v,svg:Ct,bindFunctions:w.db.bindFunctions}},"renderDiagram"),Go=i(async function(r,e,t){try{return await Uo(r,e,t)}finally{ir(void 0)}},"render");function wt(r={}){let e=$r({},r);e?.fontFamily&&!e.themeVariables?.fontFamily&&(e.themeVariables||(e.themeVariables={}),e.themeVariables.fontFamily=e.fontFamily),Ur(e);let t=ar.theme;e?.theme&&Object.hasOwn(tr,e.theme)?e.themeVariables=tr[e.theme].getThemeVariables(e.themeVariables):e&&(e.theme!=null&&e.theme!=="null"&&(e.theme=t),e.themeVariables=tr[t].getThemeVariables(e.themeVariables));let a=typeof e=="object"?Vr(e):Sr();br(a.logLevel),xr()}i(wt,"initialize");var Ho=i((r,e={})=>{let{code:t}=Lr(r);return yr.fromText(t,e)},"getDiagramFromText");function xt(r,e,t,a){pt(e,r),ft(e,t,a,e.attr("id"))}i(xt,"addA11yInfo");var P=Object.freeze({render:Go,parse:yt,getDiagramFromText:Ho,initialize:wt,getConfig:$,setConfig:Hr,getSiteConfig:Sr,updateSiteConfig:Gr,reset:i(()=>{q()},"reset"),globalReset:i(()=>{q(ar)},"globalReset"),defaultConfig:ar});br($().logLevel);q($());var Bo=i((r,e,t)=>{g.warn(r),Tr(r)?(t&&t(r.str,r.hash),e.push({...r,message:r.str,error:r})):(t&&t(r),r instanceof Error&&e.push({str:r.message,message:r.message,hash:r.name,error:r}))},"handleError"),bt=i(async function(r={querySelector:".mermaid"}){try{await Yo(r)}catch(e){if(Tr(e)&&g.error(e.str),O.parseError&&O.parseError(e),!r.suppressErrors)throw g.error("Use the suppressErrors option to suppress these errors"),e}},"run"),Yo=i(async function({postRenderCallback:r,querySelector:e,nodes:t}={querySelector:".mermaid"}){let a=P.getConfig();g.debug(`${r?"":"No "}Callback function found`);let o;if(t)o=t;else if(e)o=document.querySelectorAll(e);else throw new Error("Nodes and querySelector are both undefined");g.debug(`Found ${o.length} diagrams`),a?.startOnLoad!==void 0&&(g.debug("Start On Load: "+a?.startOnLoad),P.updateSiteConfig({startOnLoad:a?.startOnLoad}));let n=new V.InitIDGenerator(a.deterministicIds,a.deterministicIDSeed),d,s=[];for(let c of Array.from(o)){if(g.info("Rendering diagram: "+c.id),c.getAttribute("data-processed"))continue;c.setAttribute("data-processed","true");let u=`mermaid-${n.next()}`;d=c.innerHTML,d=ae(V.entityDecode(d)).trim().replace(/<br\s*\/?>/gi,"<br/>");let f=V.detectInit(d);f&&g.debug("Detected early reinit: ",f);try{let{svg:p,bindFunctions:m}=await Tt(u,d,c);c.innerHTML=p,r&&await r(u),m&&m(c)}catch(p){Bo(p,s,O.parseError)}}if(s.length>0)throw s[0]},"runThrowsErrors"),St=i(function(r){P.initialize(r)},"initialize"),jo=i(async function(r,e,t){g.warn("mermaid.init is deprecated. Please use run instead."),r&&St(r);let a={postRenderCallback:t,querySelector:".mermaid"};typeof e=="string"?a.querySelector=e:e&&(e instanceof HTMLElement?a.nodes=[e]:a.nodes=e),await bt(a)},"init"),qo=i(async(r,{lazyLoad:e=!0}={})=>{xr(),er(...r),e===!1&&await po()},"registerExternalDiagrams"),Et=i(function(){if(O.startOnLoad){let{startOnLoad:r}=P.getConfig();r&&O.run().catch(e=>g.error("Mermaid failed to initialize",e))}},"contentLoaded");typeof document<"u"&&window.addEventListener("load",Et,!1);var Xo=i(function(r){O.parseError=r},"setParseErrorHandler"),wr=[],Mr=!1,Dt=i(async()=>{if(!Mr){for(Mr=!0;wr.length>0;){let r=wr.shift();if(r)try{await r()}catch(e){g.error("Error executing queue",e)}}Mr=!1}},"executeQueue"),Wo=i(async(r,e)=>new Promise((t,a)=>{let o=i(()=>new Promise((n,d)=>{P.parse(r,e).then(s=>{n(s),t(s)},s=>{g.error("Error parsing",s),O.parseError?.(s),d(s),a(s)})}),"performCall");wr.push(o),Dt().catch(a)}),"parse"),Tt=i((r,e,t)=>new Promise((a,o)=>{let n=i(()=>new Promise((d,s)=>{P.render(r,e,t).then(c=>{d(c),a(c)},c=>{g.error("Error parsing",c),O.parseError?.(c),s(c),o(c)})}),"performCall");wr.push(n),Dt().catch(o)}),"render"),Ko=i(()=>Object.keys(J).map(r=>({id:r})),"getRegisteredDiagramsMetadata"),O={startOnLoad:!0,mermaidAPI:P,parse:Wo,render:Tt,init:jo,run:bt,registerExternalDiagrams:qo,registerLayoutLoaders:ie,initialize:St,parseError:void 0,contentLoaded:Et,setParseErrorHandler:Xo,detectType:rr,registerIconPacks:Qr,getRegisteredDiagramsMetadata:Ko},$n=O;export{$n as default};
|
|
11
|
+
/*! For license information please see mermaid.js.LEGAL.txt */
|
package/web/index.html
CHANGED
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
|
|
8
8
|
<link rel="manifest" href="/manifest.webmanifest" />
|
|
9
9
|
<title>Pi Web</title>
|
|
10
|
+
<link rel="stylesheet" href="/assets/katex.min.css" />
|
|
10
11
|
<link rel="stylesheet" href="/app.css" />
|
|
11
12
|
<link rel="stylesheet" href="/themes.css" />
|
|
12
13
|
</head>
|