@bkm016/basalt 0.1.7 → 0.1.9
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 +1 -1
- package/{chunk-0039s4jt.js → chunk-02d3x4mj.js} +3 -3
- package/{chunk-sjjtxpg2.js → chunk-0xd9mnc2.js} +394 -341
- package/{chunk-npez1492.js → chunk-13gvs0ax.js} +2 -2
- package/{chunk-n981vx1t.js → chunk-1n7dat03.js} +6 -6
- package/{chunk-6ptv4g5e.js → chunk-1zj3zvw5.js} +3 -3
- package/{chunk-zxkq9m8e.js → chunk-29qrxygd.js} +2 -2
- package/{chunk-y8dkfpmj.js → chunk-30rjf7my.js} +4 -4
- package/{chunk-39vwrg8n.js → chunk-38g3gctw.js} +2 -2
- package/{chunk-benrzwea.js → chunk-4dw43syb.js} +1 -1
- package/{chunk-w67dvqtb.js → chunk-4gtgqcct.js} +2 -2
- package/chunk-66h5qpc6.js +479 -0
- package/{chunk-8wj32837.js → chunk-755sy11p.js} +1 -1
- package/chunk-7zkswxvk.js +2 -0
- package/{chunk-ebpyvs1d.js → chunk-82v8jh1h.js} +2 -2
- package/chunk-95964592.js +25 -0
- package/{chunk-gv7wqkey.js → chunk-9as0p561.js} +2 -2
- package/{chunk-fx7f4m3c.js → chunk-a1352w87.js} +1 -1
- package/{chunk-8wv5t0w6.js → chunk-a1rb1a48.js} +6 -6
- package/{chunk-bdy4jksd.js → chunk-a98wma9j.js} +1 -1
- package/{chunk-peja51xv.js → chunk-asyr3gnq.js} +2 -2
- package/{chunk-7hr6zw2m.js → chunk-ax04trym.js} +1 -1
- package/chunk-b2bxqeb4.js +2 -0
- package/{chunk-6kdgk70p.js → chunk-bdjr0kfr.js} +4 -4
- package/{chunk-dnx91jrd.js → chunk-bk4rpnm8.js} +2 -2
- package/{chunk-8x21n7y9.js → chunk-c0zfefq8.js} +1 -1
- package/{chunk-pg5nkf1y.js → chunk-c6q04xrd.js} +2 -2
- package/chunk-c71173py.js +25 -0
- package/{chunk-c7rcw9fb.js → chunk-cmwdjes8.js} +5 -5
- package/{chunk-j7yvh0ae.js → chunk-d0a1jxk5.js} +1 -1
- package/{chunk-0javrjcm.js → chunk-d5j74pcp.js} +22 -22
- package/{chunk-ca982n62.js → chunk-dfh9m9n7.js} +1 -1
- package/{chunk-s6dejhfj.js → chunk-dq01v5eq.js} +1 -1
- package/{chunk-ecf896fz.js → chunk-e1x629v0.js} +2 -2
- package/{chunk-053vb71h.js → chunk-en218k4y.js} +1 -1
- package/{chunk-ey15ye2h.js → chunk-fgwda4m0.js} +1 -1
- package/chunk-gbjn6d81.js +2 -0
- package/{chunk-n85qs7cs.js → chunk-gkf5jwvj.js} +1 -1
- package/{chunk-d48bfd2e.js → chunk-h1kb8b49.js} +2 -2
- package/{chunk-whj87h4r.js → chunk-hb4f2v34.js} +3 -3
- package/{chunk-10p3mb40.js → chunk-hbnmymaq.js} +1 -1
- package/{chunk-818nd6s1.js → chunk-jj4hqbrx.js} +2 -2
- package/{chunk-r8vvcp6c.js → chunk-jn5pqy5v.js} +1 -1
- package/{chunk-f544p9rh.js → chunk-jtsve11b.js} +10 -10
- package/chunk-m1eam0s5.js +2 -0
- package/{chunk-g0t9c3gv.js → chunk-mbpb5c7w.js} +1 -1
- package/{chunk-prgm07j4.js → chunk-msm9hmk9.js} +2 -2
- package/{chunk-dpz4hwqb.js → chunk-n0ybj4h9.js} +2 -2
- package/{chunk-z02sj1je.js → chunk-n2jcx65v.js} +2 -2
- package/{chunk-x4874m8e.js → chunk-nrsd810j.js} +2 -2
- package/chunk-pnspvnyd.js +2 -0
- package/chunk-pz2afna8.js +2 -0
- package/{chunk-f156y565.js → chunk-q9f4xb0w.js} +3 -3
- package/{chunk-arcqjt91.js → chunk-qaeyhe65.js} +1 -1
- package/chunk-qnkrrwmg.js +2 -0
- package/{chunk-063vbmtp.js → chunk-r4ttdkrz.js} +2 -2
- package/{chunk-r9aatvwm.js → chunk-stj493dn.js} +2 -2
- package/{chunk-q9dd6fhj.js → chunk-tevejprz.js} +4 -4
- package/{chunk-75434aay.js → chunk-v3ee9z3f.js} +1 -1
- package/chunk-vtqr7dm8.js +3 -0
- package/chunk-xh444pfn.js +16 -0
- package/{chunk-y69ewdn2.js → chunk-ypqjfv3a.js} +2 -2
- package/{chunk-d6p2hgxh.js → chunk-zc9ar0r4.js} +1 -1
- package/{chunk-s7skpgm2.js → chunk-zyyzk5ha.js} +1 -1
- package/compiled.js +9 -9
- package/package.json +1 -1
- package/ui-test-worker.js +19 -19
- package/web/chunk-08sq3cwm.js +1 -0
- package/web/chunk-0pghpg4y.js +2 -0
- package/web/{chunk-z1geewdf.js → chunk-0zwc2rvh.js} +2 -2
- package/web/chunk-12qf1r6m.js +1 -0
- package/web/chunk-24fjnnee.js +1 -0
- package/web/chunk-24jhbz82.js +24 -0
- package/web/{chunk-5wbnjjhg.js → chunk-2dvbeqt0.js} +1 -1
- package/web/chunk-2hrswh3d.js +2 -0
- package/web/chunk-2j2atyjw.js +1 -0
- package/web/{chunk-n754s8xd.js → chunk-2x4g9t37.js} +8 -8
- package/web/{chunk-tfn0rqg9.js → chunk-3ak5dg10.js} +25 -25
- package/web/chunk-3ecrkvr3.js +106 -0
- package/web/chunk-3h3g3ca3.js +1 -0
- package/web/chunk-3hr3ew9w.js +1 -0
- package/web/chunk-3pcrxg6m.js +1 -0
- package/web/{chunk-xckxtfp8.js → chunk-3pd0qt83.js} +72 -72
- package/web/chunk-3txxt0a7.js +1 -0
- package/web/chunk-43g4wd7a.js +1 -0
- package/web/chunk-4a6gdrbs.js +1 -0
- package/web/{chunk-twdy2f67.js → chunk-5a4mj3qz.js} +1 -1
- package/web/{chunk-q97hn4j5.js → chunk-5baeh8q7.js} +38 -38
- package/web/{chunk-4fm55fgb.js → chunk-5dr4tkem.js} +7 -7
- package/web/{chunk-wqsczy57.js → chunk-5jdrev9p.js} +9 -9
- package/web/{chunk-dg3p8db5.js → chunk-5v2c0aqk.js} +1 -1
- package/web/chunk-5z2n4z9x.css +1 -0
- package/web/{chunk-pjz30xcp.js → chunk-601k823s.js} +23 -23
- package/web/{chunk-2cem4sv7.js → chunk-60axh4sa.js} +25 -25
- package/web/chunk-66wb0p6e.js +62 -0
- package/web/{chunk-qcge7d6s.js → chunk-6e87m0nm.js} +2 -2
- package/web/chunk-6y55gk1n.js +1 -0
- package/web/chunk-79e08rk1.js +2 -0
- package/web/chunk-7qkav30b.js +2 -0
- package/web/chunk-7qq1ypvj.js +1 -0
- package/web/{chunk-h6k1x096.js → chunk-7tkgbbf9.js} +2 -2
- package/web/chunk-814kkkmq.js +8 -0
- package/web/chunk-8jcvdd5d.js +2 -0
- package/web/{chunk-gksf7cek.js → chunk-8w7fyb3v.js} +7 -7
- package/web/chunk-8w8atrdh.js +1 -0
- package/web/{chunk-czjk218p.js → chunk-8z0r0wtk.js} +62 -62
- package/web/chunk-935mjq1c.js +39 -0
- package/web/chunk-942g3eqn.js +1 -0
- package/web/{chunk-ht4mx2dt.js → chunk-98y92vmh.js} +9 -9
- package/web/chunk-9ctg0f30.js +3 -0
- package/web/chunk-9fnr00kv.js +4 -0
- package/web/{chunk-5nda24gv.js → chunk-9yfftz38.js} +1 -1
- package/web/chunk-a0ryzdnp.js +7 -0
- package/web/chunk-a61zrp66.js +1 -0
- package/web/{chunk-nfvqjzz5.js → chunk-af9evdza.js} +1 -1
- package/web/chunk-arnzrqnm.js +1 -0
- package/web/chunk-avxk6jpc.js +2 -0
- package/web/{chunk-c01176kn.js → chunk-awkdw9rw.js} +2 -2
- package/web/{chunk-sy7e4dmq.js → chunk-b5h52neg.js} +1 -1
- package/web/chunk-bwy3e58v.js +1 -0
- package/web/{chunk-ja7w629n.js → chunk-c57f714b.js} +2 -2
- package/web/chunk-c6yacwbc.js +30 -0
- package/web/chunk-ctzkqx2g.js +169 -0
- package/web/chunk-db3twjvk.js +21 -0
- package/web/{chunk-femhej5w.js → chunk-ddyyc20r.js} +57 -57
- package/web/chunk-dnv8dx72.js +1 -0
- package/web/chunk-dwjmr0zj.js +2 -0
- package/web/chunk-dz7g1gnv.js +2 -0
- package/web/chunk-eadfxfkw.js +1 -0
- package/web/{chunk-d9wdsjkk.js → chunk-eqndhs21.js} +2 -2
- package/web/chunk-ewx42c11.js +55 -0
- package/web/chunk-f7jpakwh.js +1 -0
- package/web/{chunk-4sve9xrj.js → chunk-ff1pmd3g.js} +1 -1
- package/web/chunk-fjb3ksfd.js +78 -0
- package/web/chunk-fpb2dd2d.js +2 -0
- package/web/{chunk-fv6vm14n.js → chunk-frnh4zqf.js} +2 -2
- package/web/chunk-gn8kyz76.js +7 -0
- package/web/chunk-gv99c8zv.js +1 -0
- package/web/chunk-h0767tjv.js +1 -0
- package/web/chunk-hqynf99g.js +1 -0
- package/web/{chunk-jam45rqg.js → chunk-jccz14ye.js} +2 -2
- package/web/chunk-kcjz03h5.js +2 -0
- package/web/chunk-ket6g0yd.js +1 -0
- package/web/chunk-m9q5nr8f.js +1 -0
- package/web/chunk-mbwwj216.js +1 -0
- package/web/chunk-mdfksj61.js +1 -0
- package/web/chunk-me7dza1c.js +1 -0
- package/web/{chunk-gyp6v7jd.js → chunk-myd6sc76.js} +2 -2
- package/web/{chunk-sf101c23.js → chunk-mykrm8ba.js} +2 -2
- package/web/chunk-mzzaet63.js +1 -0
- package/web/chunk-n0wazxgz.js +1 -0
- package/web/chunk-nnyc889n.js +292 -0
- package/web/{chunk-e8yj05t1.js → chunk-nvpp0ghj.js} +6 -6
- package/web/chunk-nvt9tkt4.js +1139 -0
- package/web/{chunk-sn3tkwme.js → chunk-p9hfcamx.js} +37 -37
- package/web/chunk-ph1dgffm.js +1 -0
- package/web/chunk-q34as3v6.js +1 -0
- package/web/{chunk-sd3cdqcm.js → chunk-qh62nkem.js} +2 -2
- package/web/{chunk-j1bw5v1g.js → chunk-qq6m2my8.js} +2 -2
- package/web/{chunk-tmndcktk.js → chunk-qsqtwf34.js} +15 -15
- package/web/chunk-qz6r9v1z.js +1 -0
- package/web/chunk-rad2s9ha.js +1 -0
- package/web/{chunk-y99ed8rd.js → chunk-rasjtvsb.js} +16 -16
- package/web/chunk-rayf24gy.js +370 -0
- package/web/chunk-rrpn5r5w.js +2 -0
- package/web/chunk-s37beysw.js +1 -0
- package/web/chunk-s60s09mb.js +1 -0
- package/web/chunk-sk1wkgjw.js +4 -0
- package/web/chunk-spbs56wz.js +34 -0
- package/web/chunk-t893141g.js +2 -0
- package/web/chunk-tftc5v89.js +24 -0
- package/web/chunk-tfvcs2xx.js +1 -0
- package/web/chunk-tj1fn8v2.js +1 -0
- package/web/chunk-ts6jsfdk.js +41 -0
- package/web/chunk-v1exk5wd.js +324 -0
- package/web/chunk-veam6vk4.js +303 -0
- package/web/chunk-vqmj6peg.js +1 -0
- package/web/{chunk-t6sq85s6.js → chunk-vsjpnwsr.js} +2 -2
- package/web/{chunk-0whceqes.js → chunk-vvvd3grf.js} +2 -2
- package/web/{chunk-svh4n157.js → chunk-w3w18stt.js} +5 -5
- package/web/chunk-wdq2tp9e.js +1 -0
- package/web/chunk-wkf5xfyr.js +1 -0
- package/web/{chunk-4q7wf0wd.js → chunk-wzd2a4k5.js} +9 -9
- package/web/chunk-xa43ndfj.js +2 -0
- package/web/chunk-xh4xn1az.js +1 -0
- package/web/chunk-xx11yv61.js +89 -0
- package/web/chunk-xzwxcxb4.js +1 -0
- package/web/chunk-y1qty77a.js +1 -0
- package/web/{chunk-da7m1kva.js → chunk-y2rzeb4v.js} +2 -2
- package/web/chunk-ys2tns0p.js +1 -0
- package/web/chunk-z05x9cbm.js +1 -0
- package/web/chunk-zb2bkr7f.js +2 -0
- package/web/{chunk-aangfjqc.js → chunk-zdyys4ar.js} +38 -38
- package/web/chunk-zgavhnt8.js +1 -0
- package/web/index.html +1 -1
- package/worker.js +1 -1
- package/chunk-654cny9a.js +0 -480
- package/chunk-8gw5bvh3.js +0 -25
- package/chunk-8saewt61.js +0 -3
- package/chunk-a0c989ky.js +0 -2
- package/chunk-a5apjjcn.js +0 -16
- package/chunk-a81p46j7.js +0 -2
- package/chunk-agsfy9w7.js +0 -2
- package/chunk-d20p02ny.js +0 -2
- package/chunk-ejsneb6f.js +0 -2
- package/chunk-fmq3zwzk.js +0 -2
- package/chunk-rfb85nj7.js +0 -2
- package/chunk-rfdt992v.js +0 -25
- package/web/chunk-079091ar.js +0 -39
- package/web/chunk-083r4f80.js +0 -1
- package/web/chunk-0cng7r2x.js +0 -2
- package/web/chunk-0k0ande6.js +0 -1
- package/web/chunk-14deqqhr.js +0 -2
- package/web/chunk-1s53190z.js +0 -303
- package/web/chunk-2b63adsj.js +0 -89
- package/web/chunk-3baypnwn.js +0 -4
- package/web/chunk-4067nwjp.js +0 -19
- package/web/chunk-4vjnrz87.js +0 -34
- package/web/chunk-59678wmg.js +0 -1
- package/web/chunk-5k8sv4f5.js +0 -1
- package/web/chunk-5vjhvw1m.js +0 -2
- package/web/chunk-6bwgdvf6.js +0 -1
- package/web/chunk-6ft5pz3c.js +0 -1
- package/web/chunk-7c8rwqtx.js +0 -1
- package/web/chunk-7qzz025k.js +0 -1
- package/web/chunk-7xbaqqd7.css +0 -1
- package/web/chunk-80eyv2mk.js +0 -1
- package/web/chunk-89paytbk.js +0 -4
- package/web/chunk-8ceej2g7.js +0 -1
- package/web/chunk-8nyhy122.js +0 -1
- package/web/chunk-8r0s8tx7.js +0 -1
- package/web/chunk-989jq2h8.js +0 -2
- package/web/chunk-9w5tf22s.js +0 -1
- package/web/chunk-ahztazsg.js +0 -1
- package/web/chunk-bdydzbqk.js +0 -324
- package/web/chunk-c3nn0vvc.js +0 -1
- package/web/chunk-cpwtt6ny.js +0 -1
- package/web/chunk-d22wq71s.js +0 -1
- package/web/chunk-dsw5t58p.js +0 -1
- package/web/chunk-dv72fat3.js +0 -1
- package/web/chunk-dvvs1jjq.js +0 -3
- package/web/chunk-e131rg6p.js +0 -2
- package/web/chunk-ekw54h1q.js +0 -1
- package/web/chunk-geh05ghh.js +0 -55
- package/web/chunk-hwsvhst3.js +0 -1
- package/web/chunk-jfvxxp5c.js +0 -1
- package/web/chunk-k02b36g1.js +0 -62
- package/web/chunk-kjacapzd.js +0 -7
- package/web/chunk-kkfrs7d1.js +0 -41
- package/web/chunk-kkyn8yhj.js +0 -106
- package/web/chunk-mh4rx5cf.js +0 -1
- package/web/chunk-mz9b5bsa.js +0 -1
- package/web/chunk-n448vaba.js +0 -1
- package/web/chunk-n8j88qxy.js +0 -1
- package/web/chunk-nmpbsvwb.js +0 -2
- package/web/chunk-nws1s56b.js +0 -1
- package/web/chunk-p7126wwy.js +0 -7
- package/web/chunk-phnqnhj9.js +0 -1
- package/web/chunk-q3jevm51.js +0 -292
- package/web/chunk-qg31p6cn.js +0 -1
- package/web/chunk-qhm3cfq9.js +0 -1
- package/web/chunk-qsd595b9.js +0 -1
- package/web/chunk-r7frwjqx.js +0 -2
- package/web/chunk-rddft5ce.js +0 -1139
- package/web/chunk-rgbdf2m9.js +0 -370
- package/web/chunk-rsbkbg6x.js +0 -78
- package/web/chunk-s2bs5vxh.js +0 -2
- package/web/chunk-sgwccs54.js +0 -1
- package/web/chunk-sjh8gtm9.js +0 -30
- package/web/chunk-t3658ehb.js +0 -2
- package/web/chunk-t81p4wqc.js +0 -24
- package/web/chunk-tewmsd7t.js +0 -1
- package/web/chunk-tf57s7ry.js +0 -1
- package/web/chunk-thbqwq6b.js +0 -1
- package/web/chunk-tqr80b5w.js +0 -2
- package/web/chunk-tz4twwmw.js +0 -2
- package/web/chunk-v282r683.js +0 -24
- package/web/chunk-v4vjjtn7.js +0 -1
- package/web/chunk-vbwdwcdp.js +0 -1
- package/web/chunk-vjngfh0q.js +0 -1
- package/web/chunk-vnt34mkb.js +0 -1
- package/web/chunk-wbgkwxrc.js +0 -1
- package/web/chunk-wjbk50hn.js +0 -2
- package/web/chunk-wjy848e2.js +0 -1
- package/web/chunk-wvfmmw1v.js +0 -8
- package/web/chunk-x1jm4zsg.js +0 -1
- package/web/chunk-xbpc6x9m.js +0 -169
- package/web/chunk-xce8n339.js +0 -1
- package/web/chunk-xmsb2g71.js +0 -1
- package/web/chunk-xtss82z2.js +0 -1
package/web/chunk-hwsvhst3.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{_i}from"./chunk-2cem4sv7.js";export{_i as createGitGraphServices};
|
package/web/chunk-jfvxxp5c.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{pi}from"./chunk-j1bw5v1g.js";export{pi as default};
|
package/web/chunk-k02b36g1.js
DELETED
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
import{G}from"./chunk-14deqqhr.js";import{e,a,ke,D,b,B,C,S,E,T,A,R,L,V,U}from"./chunk-1s53190z.js";import{X}from"./chunk-2cem4sv7.js";var ht=e(()=>({domains:new Map,transitions:[]}),"createDefaultData"),ot=ht(),St=e(()=>ot.domains,"getDomains"),Mt=e(()=>ot.transitions,"getTransitions"),zt=e((t)=>{if(!t)return;for(let n of t){let o=n.domain,r=(n.items??[]).map((l)=>({label:l.label}));ot.domains.set(o,{name:o,items:r})}},"setDomains"),Lt=e((t)=>{if(!t)return;ot.transitions=t.filter((n)=>{if(n.from===n.to)return a.warn(`Cynefin: self-loop transition on domain "${n.from}" is not meaningful and will be skipped.`),!1;return!0}).map((n)=>({from:n.from,to:n.to,label:n.label||void 0}))},"setTransitions"),Nt=e(()=>U({...D.cynefin,...b().cynefin}),"getConfig"),Pt=e(()=>{C(),ot=ht()},"clear"),it={getDomains:St,getTransitions:Mt,setDomains:zt,setTransitions:Lt,getConfig:Nt,clear:Pt,setAccTitle:S,getAccTitle:E,setDiagramTitle:R,getDiagramTitle:L,getAccDescription:A,setAccDescription:T},It=e((t)=>{G(t,it),it.setDomains(t.domains),it.setTransitions(t.transitions)},"populate"),Wt={parse:e(async(t)=>{let n=await X("cynefin",t);a.debug(n),It(n)},"parse")};function nt(t){let n=t+1831565813|0;return n=Math.imul(n^n>>>15,n|1),n^=n+Math.imul(n^n>>>7,n|61),((n^n>>>14)>>>0)/4294967296}e(nt,"seededRandom");function xt(t){let n=0;for(let o=0;o<t.length;o++){let r=t.charCodeAt(o);n=(n<<5)-n+r,n|=0}return n}e(xt,"hashString");function $t(t,n){if(typeof t==="number"&&Number.isFinite(t)&&t!==0)return t;return xt(n)}e($t,"resolveSeed");function bt(t,n,o,r){let l=t/2,p=r??t*0.015,at=7,Z=n/7,f=[];for(let i=0;i<=7;i++){let y=nt(o+i*17)*p*2-p;f.push({x:l+y,y:i*Z})}let N=`M${f[0].x},${f[0].y}`;for(let i=0;i<f.length-1;i++){let y=f[i],c=f[i+1],m=(y.y+c.y)/2,k=i%2===0?1:-1,h=p*1.5*k*nt(o+i*31+7),J=y.x+h,K=m,tt=c.x-h;N+=` C${J},${K} ${tt},${m} ${c.x},${c.y}`}return N}e(bt,"generateFoldPath");function wt(t,n,o,r){let l=n/2,p=r??n*0.015,at=7,Z=t/7,f=[];for(let i=0;i<=7;i++){let y=nt(o+i*23)*p*2-p;f.push({x:i*Z,y:l+y})}let N=`M${f[0].x},${f[0].y}`;for(let i=0;i<f.length-1;i++){let y=f[i],c=f[i+1],m=(y.x+c.x)/2,k=i%2===0?1:-1,h=p*1.5*k*nt(o+i*37+11),J=m,K=y.y+h,tt=m,Y=c.y-h;N+=` C${J},${K} ${tt},${Y} ${c.x},${c.y}`}return N}e(wt,"generateHorizontalBoundary");function Ct(t,n){let o=t/2,r=n*0.5,l=n,p=t*0.03;return[`M${o},${r}`,`C${o+p},${r+(l-r)*0.2}`,`${o-p*1.5},${r+(l-r)*0.55}`,`${o+p*0.5},${r+(l-r)*0.75}`,`C${o-p},${r+(l-r)*0.85}`,`${o+p*0.3},${r+(l-r)*0.95}`,`${o},${l}`].join(" ")}e(Ct,"generateCliffPath");function vt(t,n,o,r){return[`M${t-o},${n}`,`A${o},${r} 0 1,1 ${t+o},${n}`,`A${o},${r} 0 1,1 ${t-o},${n}`,"Z"].join(" ")}e(vt,"generateConfusionPath");var gt={complex:{model:"Probe → Sense → Respond",practice:"Emergent Practices"},complicated:{model:"Sense → Analyse → Respond",practice:"Good Practices"},clear:{model:"Sense → Categorise → Respond",practice:"Best Practices"},chaotic:{model:"Act → Sense → Respond",practice:"Novel Practices"},confusion:{model:"",practice:"Disorder"}},Rt=e((t,n)=>{let o=t/2,r=n/2;return{complex:{cx:o/2,cy:r/2,x:0,y:0,w:o,h:r},complicated:{cx:o+o/2,cy:r/2,x:o,y:0,w:o,h:r},chaotic:{cx:o/2,cy:r+r/2,x:0,y:r,w:o,h:r},clear:{cx:o+o/2,cy:r+r/2,x:o,y:r,w:o,h:r},confusion:{cx:o,cy:r,x:o*0.7,y:r*0.7,w:o*0.6,h:r*0.6}}},"getDomainLayouts"),Ft=e(()=>{let t=ke(),n=b();return U(t,n.themeVariables).cynefin},"getCynefinDomainColors"),lt=3,Vt=e((t,n,o,r)=>{let l=r.db,p=l.getDomains(),at=l.getTransitions(),Z=l.getDiagramTitle(),f=l.getAccTitle(),N=l.getAccDescription(),i=l.getConfig(),y=Ft();a.debug("Rendering Cynefin diagram");let{width:c,height:m,padding:k,showDomainDescriptions:h,boundaryAmplitude:J}=i,K=c+k*2,tt=m+k*2,Y={complex:y.complexBg,complicated:y.complicatedBg,clear:y.clearBg,chaotic:y.chaoticBg,confusion:y.confusionBg},P=V(n);if(B(P,tt,K,i.useMaxWidth??!0),P.attr("viewBox",`0 0 ${K} ${tt}`),f)P.append("title").text(f);if(N)P.append("desc").text(N);let I=P.append("g").attr("transform",`translate(${k}, ${k})`),et=Rt(c,m),dt=$t(i.seed,n),Dt=I.append("g").attr("class","cynefin-backgrounds"),st=["complex","complicated","chaotic","clear"];for(let d of st){let s=et[d];Dt.append("rect").attr("class","cynefinDomain").attr("x",s.x).attr("y",s.y).attr("width",s.w).attr("height",s.h).attr("fill",Y[d]).attr("fill-opacity",0.4).attr("stroke","none")}let ct=I.append("g").attr("class","cynefin-boundaries");ct.append("path").attr("class","cynefinBoundary").attr("d",bt(c,m,dt,J)).attr("fill","none"),ct.append("path").attr("class","cynefinBoundary").attr("d",wt(c,m,dt+100,J)).attr("fill","none"),ct.append("path").attr("class","cynefinCliff").attr("d",Ct(c,m)).attr("fill","none");let kt=c*0.15,Tt=m*0.15;I.append("path").attr("class","cynefinConfusion").attr("d",vt(c/2,m/2,kt,Tt)).attr("fill",Y.confusion).attr("fill-opacity",0.5);let ft=I.append("g").attr("class","cynefin-labels");for(let d of st){let s=et[d];ft.append("text").attr("class","cynefinDomainLabel").attr("x",s.cx).attr("y",h?s.cy-30:s.cy).attr("text-anchor","middle").attr("dominant-baseline","middle").text(d.charAt(0).toUpperCase()+d.slice(1))}if(ft.append("text").attr("class","cynefinDomainLabel").attr("x",c/2).attr("y",h?m/2-10:m/2).attr("text-anchor","middle").attr("dominant-baseline","middle").text("Confusion"),h){let d=I.append("g").attr("class","cynefin-subtitles");for(let s of st){let g=et[s],u=gt[s];d.append("text").attr("class","cynefinSubtitle").attr("x",g.cx).attr("y",g.cy-10).attr("text-anchor","middle").attr("dominant-baseline","middle").text(u.model),d.append("text").attr("class","cynefinSubtitle").attr("x",g.cx).attr("y",g.cy+5).attr("text-anchor","middle").attr("dominant-baseline","middle").text(u.practice)}d.append("text").attr("class","cynefinSubtitle").attr("x",c/2).attr("y",m/2+8).attr("text-anchor","middle").attr("dominant-baseline","middle").text(gt.confusion.practice)}let mt=I.append("g").attr("class","cynefin-items"),W=26,pt=10,At=["complex","complicated","chaotic","clear","confusion"];for(let d of At){let s=p.get(d);if(!s||s.items.length===0)continue;let g=et[d],u=d==="confusion",O=s.items,j=0;if(u&&s.items.length>lt)j=s.items.length-lt,O=s.items.slice(0,lt);let F;if(u){let w=h?22:14;F=g.cy+w}else F=g.cy+(h?25:15);if([...O].forEach((w,_)=>{let M=F+_*(W+4),H=mt.append("g"),q=H.append("text").attr("class","cynefinItemText").attr("x",0).attr("y",W/2).attr("text-anchor","middle").attr("dominant-baseline","central").text(w.label),v=w.label.length*7,x=q.node();if(x&&typeof x.getBBox==="function"){let rt=x.getBBox();if(rt.width>0)v=rt.width}let z=v+pt*2,Q=g.cx-z/2;H.attr("transform",`translate(${Q}, ${M})`),H.insert("rect","text").attr("class","cynefinItem").attr("x",0).attr("y",0).attr("width",z).attr("height",W).attr("rx",4).attr("ry",4).attr("fill",Y[d]).attr("fill-opacity",0.95),q.attr("x",z/2).attr("y",W/2)}),j>0){let w=F+O.length*(W+4),_=`+${j} more`,M=mt.append("g"),H=M.append("text").attr("class","cynefinItemText").attr("x",0).attr("y",W/2).attr("text-anchor","middle").attr("dominant-baseline","central").text(_),q=_.length*7,v=H.node();if(v&&typeof v.getBBox==="function"){let Q=v.getBBox();if(Q.width>0)q=Q.width}let x=q+pt*2,z=g.cx-x/2;M.attr("transform",`translate(${z}, ${w})`),M.insert("rect","text").attr("class","cynefinItemOverflow").attr("x",0).attr("y",0).attr("width",x).attr("height",W).attr("rx",4).attr("ry",4).attr("fill",Y[d]).attr("fill-opacity",0.6),H.attr("x",x/2).attr("y",W/2)}}if(at.length>0){let d=P.select("defs").empty()?P.append("defs"):P.select("defs"),s=`cynefin-arrow-${n}`;d.append("marker").attr("id",s).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("class","cynefinArrowHead");let g=I.append("g").attr("class","cynefin-arrows");at.forEach((u)=>{let O=et[u.from],j=et[u.to];if(!O||!j)return;if(u.from===u.to){a.warn(`Cynefin renderer: skipping self-loop on domain "${u.from}"`);return}let{cx:F,cy:w}=O,{cx:_,cy:M}=j,H=(F+_)/2,q=(w+M)/2,v=_-F,x=M-w,z=Math.sqrt(v*v+x*x),Q=z*0.15,rt=-x/z,Bt=v/z,yt=H+rt*Q,ut=q+Bt*Q;if(g.append("path").attr("class","cynefinArrowLine").attr("d",`M${F},${w} Q${yt},${ut} ${_},${M}`).attr("fill","none").attr("marker-end",`url(#${s})`),u.label)g.append("text").attr("class","cynefinArrowLabel").attr("x",yt).attr("y",ut-6).attr("text-anchor","middle").attr("dominant-baseline","auto").text(u.label)})}if(Z)I.append("text").attr("class","cynefinTitle").attr("x",c/2).attr("y",-k/2).attr("text-anchor","middle").attr("dominant-baseline","middle").text(Z)},"draw"),_t={draw:Vt},Et=e(()=>{let t=ke(),n=b();return U(t,n.themeVariables).cynefin},"getCynefinTheme"),Ht=e(()=>{let t=Et();return`
|
|
2
|
-
.cynefinDomain {
|
|
3
|
-
stroke: none;
|
|
4
|
-
}
|
|
5
|
-
.cynefinDomainLabel {
|
|
6
|
-
font-size: ${t.domainFontSize}px;
|
|
7
|
-
font-weight: bold;
|
|
8
|
-
fill: ${t.labelColor};
|
|
9
|
-
}
|
|
10
|
-
.cynefinSubtitle {
|
|
11
|
-
font-size: ${t.itemFontSize-1}px;
|
|
12
|
-
fill: ${t.textColor};
|
|
13
|
-
font-style: italic;
|
|
14
|
-
}
|
|
15
|
-
.cynefinItem {
|
|
16
|
-
fill-opacity: 0.95;
|
|
17
|
-
stroke: ${t.boundaryColor};
|
|
18
|
-
stroke-width: 1;
|
|
19
|
-
}
|
|
20
|
-
.cynefinItemText {
|
|
21
|
-
font-size: ${t.itemFontSize}px;
|
|
22
|
-
fill: ${t.textColor};
|
|
23
|
-
}
|
|
24
|
-
.cynefinItemOverflow {
|
|
25
|
-
fill-opacity: 0.6;
|
|
26
|
-
stroke: ${t.boundaryColor};
|
|
27
|
-
stroke-width: 1;
|
|
28
|
-
stroke-dasharray: 3 2;
|
|
29
|
-
}
|
|
30
|
-
.cynefinBoundary {
|
|
31
|
-
stroke: ${t.boundaryColor};
|
|
32
|
-
stroke-width: ${t.boundaryWidth};
|
|
33
|
-
stroke-dasharray: 6 3;
|
|
34
|
-
}
|
|
35
|
-
.cynefinCliff {
|
|
36
|
-
stroke: ${t.cliffColor};
|
|
37
|
-
stroke-width: ${t.cliffWidth};
|
|
38
|
-
}
|
|
39
|
-
.cynefinConfusion {
|
|
40
|
-
stroke: ${t.boundaryColor};
|
|
41
|
-
stroke-width: 1.5;
|
|
42
|
-
stroke-dasharray: 4 2;
|
|
43
|
-
}
|
|
44
|
-
.cynefinArrowLine {
|
|
45
|
-
stroke: ${t.arrowColor};
|
|
46
|
-
stroke-width: ${t.arrowWidth};
|
|
47
|
-
fill: none;
|
|
48
|
-
}
|
|
49
|
-
.cynefinArrowHead {
|
|
50
|
-
fill: ${t.arrowColor};
|
|
51
|
-
stroke: none;
|
|
52
|
-
}
|
|
53
|
-
.cynefinArrowLabel {
|
|
54
|
-
font-size: ${t.itemFontSize-1}px;
|
|
55
|
-
fill: ${t.textColor};
|
|
56
|
-
}
|
|
57
|
-
.cynefinTitle {
|
|
58
|
-
font-size: ${t.domainFontSize+2}px;
|
|
59
|
-
font-weight: bold;
|
|
60
|
-
fill: ${t.labelColor};
|
|
61
|
-
}
|
|
62
|
-
`},"styles"),Gt=Ht,Zt={parser:Wt,db:it,renderer:_t,styles:Gt};export{Zt as diagram};
|
package/web/chunk-kjacapzd.js
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import{e,a,ke,D,b,O,B,C,S,E,T,A,R,L,Wn,V,U,Vi}from"./chunk-1s53190z.js";import"./chunk-5nda24gv.js";import{Xe}from"./chunk-07agqp8h.js";import{wt}from"./chunk-t6sq85s6.js";import{Ot}from"./chunk-h0c42zy3.js";function Pt(t,i,s){t=+t,i=+i,s=(o=arguments.length)<2?(i=t,t=0,1):o<3?1:+s;var n=-1,o=Math.max(0,Math.ceil((i-t)/s))|0,c=Array(o);while(++n<o)c[n]=t+n*s;return c}function xt(){var t=Xe().unknown(void 0),{domain:i,range:s}=t,n=0,o=1,c,l,f=!1,g=0,y=0,z=0.5;delete t.unknown;function M(){var k=i().length,G=o<n,Y=G?o:n,N=G?n:o;if(c=(N-Y)/Math.max(1,k-g+y*2),f)c=Math.floor(c);if(Y+=(N-Y-c*(k-g))*z,l=c*(1-g),f)Y=Math.round(Y),l=Math.round(l);var j=Pt(k).map(function(it){return Y+c*it});return s(G?j.reverse():j)}return t.domain=function(k){return arguments.length?(i(k),M()):i()},t.range=function(k){return arguments.length?([n,o]=k,n=+n,o=+o,M()):[n,o]},t.rangeRound=function(k){return[n,o]=k,n=+n,o=+o,f=!0,M()},t.bandwidth=function(){return l},t.step=function(){return c},t.round=function(k){return arguments.length?(f=!!k,M()):f},t.padding=function(k){return arguments.length?(g=Math.min(1,y=+k),M()):g},t.paddingInner=function(k){return arguments.length?(g=Math.min(1,k),M()):g},t.paddingOuter=function(k){return arguments.length?(y=+k,M()):y},t.align=function(k){return arguments.length?(z=Math.max(0,Math.min(1,k)),M()):z},t.copy=function(){return xt(i(),[n,o]).round(f).paddingInner(g).paddingOuter(y).align(z)},Ot.apply(M(),arguments)}var Lt=function(){var t=e(function(J,h,u,x){for(u=u||{},x=J.length;x--;u[J[x]]=h);return u},"o"),i=[1,10,12,14,16,18,19,21,23],s=[2,6],n=[1,3],o=[1,5],c=[1,6],l=[1,7],f=[1,5,10,12,14,16,18,19,21,23,36,37,38],g=[1,25],y=[1,26],z=[1,28],M=[1,29],k=[1,30],G=[1,31],Y=[1,32],N=[1,33],j=[1,34],it=[1,35],nt=[1,36],_=[1,37],K=[1,43],d=[1,42],Q=[1,47],Z=[1,50],P=[1,10,12,14,16,18,19,21,23,36,37,38],ot=[1,10,12,14,16,18,19,21,23,24,26,28,29,36,37,38],H=[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],gt=[1,65],F=[26,28],v={trace:e(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:e(function(h,u,x,p,I,r,rt){var m=r.length-1;switch(I){case 5:p.setOrientation(r[m]);break;case 9:p.setDiagramTitle(r[m].text.trim());break;case 12:p.setLineData({text:"",type:"text"},r[m]);break;case 13:p.setLineData(r[m-1],r[m]);break;case 14:p.setBarData({text:"",type:"text"},r[m]);break;case 15:p.setBarData(r[m-1],r[m]);break;case 16:this.$=r[m].trim(),p.setAccTitle(this.$);break;case 17:case 18:this.$=r[m].trim(),p.setAccDescription(this.$);break;case 19:this.$=r[m-1];break;case 20:case 30:this.$=[r[m-2],...r[m]];break;case 21:case 31:this.$=[r[m]];break;case 22:this.$={value:Number(r[m-1]),label:r[m]};break;case 23:this.$={value:Number(r[m]),label:""};break;case 24:p.setXAxisTitle(r[m]);break;case 25:p.setXAxisTitle(r[m-1]);break;case 26:p.setXAxisTitle({type:"text",text:""});break;case 27:p.setXAxisBand(r[m]);break;case 28:p.setXAxisRangeData(Number(r[m-2]),Number(r[m]));break;case 29:this.$=r[m-1];break;case 32:p.setYAxisTitle(r[m]);break;case 33:p.setYAxisTitle(r[m-1]);break;case 34:p.setYAxisTitle({type:"text",text:""});break;case 35:p.setYAxisRangeData(Number(r[m-2]),Number(r[m]));break;case 39:this.$={text:r[m],type:"text"};break;case 40:this.$={text:r[m],type:"text"};break;case 41:this.$={text:r[m],type:"markdown"};break;case 42:this.$=r[m];break;case 43:this.$=r[m-1]+""+r[m];break}},"anonymous"),table:[t(i,s,{3:1,4:2,7:4,5:n,36:o,37:c,38:l}),{1:[3]},t(i,s,{4:2,7:4,3:8,5:n,36:o,37:c,38:l}),t(i,s,{4:2,7:4,6:9,3:10,5:n,8:[1,11],36:o,37:c,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(i,s,{4:2,7:4,3:21,5:n,36:o,37:c,38:l}),{1:[2,3]},t(f,[2,5]),t(i,[2,7],{4:22,36:o,37:c,38:l}),{11:23,30:g,39:24,40:y,41:27,42:z,43:M,44:k,45:G,46:Y,47:N,48:j,49:it,50:nt,51:_},{11:39,13:38,24:K,29:d,30:g,31:40,32:41,39:24,40:y,41:27,42:z,43:M,44:k,45:G,46:Y,47:N,48:j,49:it,50:nt,51:_},{11:45,15:44,29:Q,30:g,35:46,39:24,40:y,41:27,42:z,43:M,44:k,45:G,46:Y,47:N,48:j,49:it,50:nt,51:_},{11:49,17:48,24:Z,30:g,39:24,40:y,41:27,42:z,43:M,44:k,45:G,46:Y,47:N,48:j,49:it,50:nt,51:_},{11:52,17:51,24:Z,30:g,39:24,40:y,41:27,42:z,43:M,44:k,45:G,46:Y,47:N,48:j,49:it,50:nt,51:_},{20:[1,53]},{22:[1,54]},t(P,[2,18]),{1:[2,2]},t(P,[2,8]),t(P,[2,9]),t(ot,[2,39],{41:55,42:z,43:M,44:k,45:G,46:Y,47:N,48:j,49:it,50:nt,51:_}),t(ot,[2,40]),t(ot,[2,41]),t(H,[2,42]),t(H,[2,44]),t(H,[2,45]),t(H,[2,46]),t(H,[2,47]),t(H,[2,48]),t(H,[2,49]),t(H,[2,50]),t(H,[2,51]),t(H,[2,52]),t(H,[2,53]),t(P,[2,10]),t(P,[2,24],{32:41,31:56,24:K,29:d}),t(P,[2,26]),t(P,[2,27]),{33:[1,57]},{11:59,30:g,34:58,39:24,40:y,41:27,42:z,43:M,44:k,45:G,46:Y,47:N,48:j,49:it,50:nt,51:_},t(P,[2,11]),t(P,[2,32],{35:60,29:Q}),t(P,[2,34]),{33:[1,61]},t(P,[2,12]),{17:62,24:Z},{25:63,27:64,29:gt},t(P,[2,14]),{17:66,24:Z},t(P,[2,16]),t(P,[2,17]),t(H,[2,43]),t(P,[2,25]),{29:[1,67]},{26:[1,68]},{26:[2,31],28:[1,69]},t(P,[2,33]),{29:[1,70]},t(P,[2,13]),{26:[1,71]},{26:[2,21],28:[1,72]},t(F,[2,23],{30:[1,73]}),t(P,[2,15]),t(P,[2,28]),t(P,[2,29]),{11:59,30:g,34:74,39:24,40:y,41:27,42:z,43:M,44:k,45:G,46:Y,47:N,48:j,49:it,50:nt,51:_},t(P,[2,35]),t(P,[2,19]),{25:75,27:64,29:gt},t(F,[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:e(function(h,u){if(u.recoverable)this.trace(h);else{var x=Error(h);throw x.hash=u,x}},"parseError"),parse:e(function(h){var u=this,x=[0],p=[],I=[null],r=[],rt=this.table,m="",bt=0,Ht=0,$t=0,fe=2,Ut=1,pe=r.slice.call(arguments,1),X=Object.create(this.lexer),ht={yy:{}};for(var Rt in this.yy)if(Object.prototype.hasOwnProperty.call(this.yy,Rt))ht.yy[Rt]=this.yy[Rt];if(X.setInput(h,ht.yy),ht.yy.lexer=X,ht.yy.parser=this,typeof X.yylloc>"u")X.yylloc={};var _t=X.yylloc;r.push(_t);var me=X.options&&X.options.ranges;if(typeof ht.yy.parseError==="function")this.parseError=ht.yy.parseError;else this.parseError=Object.getPrototypeOf(this).parseError;function be(et){x.length=x.length-2*et,I.length=I.length-et,r.length=r.length-et}e(be,"popStack");function qt(){var et=p.pop()||X.lex()||Ut;if(typeof et!=="number"){if(et instanceof Array)p=et,et=p.pop();et=u.symbols_[et]||et}return et}e(qt,"lex");var q,Tt,lt,tt,Oe,Dt,ut={},yt,at,Gt,kt;while(!0){if(lt=x[x.length-1],this.defaultActions[lt])tt=this.defaultActions[lt];else{if(q===null||typeof q>"u")q=qt();tt=rt[lt]&&rt[lt][q]}if(typeof tt>"u"||!tt.length||!tt[0]){var vt="";kt=[];for(yt in rt[lt])if(this.terminals_[yt]&&yt>fe)kt.push("'"+this.terminals_[yt]+"'");if(X.showPosition)vt="Parse error on line "+(bt+1)+`:
|
|
2
|
-
`+X.showPosition()+`
|
|
3
|
-
Expecting `+kt.join(", ")+", got '"+(this.terminals_[q]||q)+"'";else vt="Parse error on line "+(bt+1)+": Unexpected "+(q==Ut?"end of input":"'"+(this.terminals_[q]||q)+"'");this.parseError(vt,{text:X.match,token:this.terminals_[q]||q,line:X.yylineno,loc:_t,expected:kt})}if(tt[0]instanceof Array&&tt.length>1)throw Error("Parse Error: multiple actions possible at state: "+lt+", token: "+q);switch(tt[0]){case 1:if(x.push(q),I.push(X.yytext),r.push(X.yylloc),x.push(tt[1]),q=null,!Tt){if(Ht=X.yyleng,m=X.yytext,bt=X.yylineno,_t=X.yylloc,$t>0)$t--}else q=Tt,Tt=null;break;case 2:if(at=this.productions_[tt[1]][1],ut.$=I[I.length-at],ut._$={first_line:r[r.length-(at||1)].first_line,last_line:r[r.length-1].last_line,first_column:r[r.length-(at||1)].first_column,last_column:r[r.length-1].last_column},me)ut._$.range=[r[r.length-(at||1)].range[0],r[r.length-1].range[1]];if(Dt=this.performAction.apply(ut,[m,Ht,bt,ht.yy,tt[1],I,r].concat(pe)),typeof Dt<"u")return Dt;if(at)x=x.slice(0,-1*at*2),I=I.slice(0,-1*at),r=r.slice(0,-1*at);x.push(this.productions_[tt[1]][0]),I.push(ut.$),r.push(ut._$),Gt=rt[x[x.length-2]][x[x.length-1]],x.push(Gt);break;case 3:return!0}}return!0},"parse")},st=function(){var J={EOF:1,parseError:e(function(u,x){if(this.yy.parser)this.yy.parser.parseError(u,x);else throw Error(u)},"parseError"),setInput:e(function(h,u){if(this.yy=u||this.yy||{},this._input=h,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];return this.offset=0,this},"setInput"),input:e(function(){var h=this._input[0];this.yytext+=h,this.yyleng++,this.offset++,this.match+=h,this.matched+=h;var u=h.match(/(?:\r\n?|\n).*/g);if(u)this.yylineno++,this.yylloc.last_line++;else this.yylloc.last_column++;if(this.options.ranges)this.yylloc.range[1]++;return this._input=this._input.slice(1),h},"input"),unput:e(function(h){var u=h.length,x=h.split(/(?:\r\n?|\n)/g);this._input=h+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-u),this.offset-=u;var p=this.match.split(/(?:\r\n?|\n)/g);if(this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),x.length-1)this.yylineno-=x.length-1;var I=this.yylloc.range;if(this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:x?(x.length===p.length?this.yylloc.first_column:0)+p[p.length-x.length].length-x[0].length:this.yylloc.first_column-u},this.options.ranges)this.yylloc.range=[I[0],I[0]+this.yyleng-u];return this.yyleng=this.yytext.length,this},"unput"),more:e(function(){return this._more=!0,this},"more"),reject:e(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:e(function(h){this.unput(this.match.slice(h))},"less"),pastInput:e(function(){var h=this.matched.substr(0,this.matched.length-this.match.length);return(h.length>20?"...":"")+h.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:e(function(){var h=this.match;if(h.length<20)h+=this._input.substr(0,20-h.length);return(h.substr(0,20)+(h.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:e(function(){var h=this.pastInput(),u=Array(h.length+1).join("-");return h+this.upcomingInput()+`
|
|
5
|
-
`+u+"^"},"showPosition"),test_match:e(function(h,u){var x,p,I;if(this.options.backtrack_lexer){if(I={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)I.yylloc.range=this.yylloc.range.slice(0)}if(p=h[0].match(/(?:\r\n?|\n).*/g),p)this.yylineno+=p.length;if(this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:p?p[p.length-1].length-p[p.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+h[0].length},this.yytext+=h[0],this.match+=h[0],this.matches=h,this.yyleng=this.yytext.length,this.options.ranges)this.yylloc.range=[this.offset,this.offset+=this.yyleng];if(this._more=!1,this._backtrack=!1,this._input=this._input.slice(h[0].length),this.matched+=h[0],x=this.performAction.call(this,this.yy,this,u,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input)this.done=!1;if(x)return x;else if(this._backtrack){for(var r in I)this[r]=I[r];return!1}return!1},"test_match"),next:e(function(){if(this.done)return this.EOF;if(!this._input)this.done=!0;var h,u,x,p;if(!this._more)this.yytext="",this.match="";var I=this._currentRules();for(var r=0;r<I.length;r++)if(x=this._input.match(this.rules[I[r]]),x&&(!u||x[0].length>u[0].length)){if(u=x,p=r,this.options.backtrack_lexer)if(h=this.test_match(x,I[r]),h!==!1)return h;else if(this._backtrack){u=!1;continue}else return!1;else if(!this.options.flex)break}if(u){if(h=this.test_match(u,I[p]),h!==!1)return h;return!1}if(this._input==="")return this.EOF;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text.
|
|
6
|
-
`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:e(function(){var u=this.next();if(u)return u;else return this.lex()},"lex"),begin:e(function(u){this.conditionStack.push(u)},"begin"),popState:e(function(){var u=this.conditionStack.length-1;if(u>0)return this.conditionStack.pop();else return this.conditionStack[0]},"popState"),_currentRules:e(function(){if(this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1])return this.conditions[this.conditionStack[this.conditionStack.length-1]].rules;else return this.conditions.INITIAL.rules},"_currentRules"),topState:e(function(u){if(u=this.conditionStack.length-1-Math.abs(u||0),u>=0)return this.conditionStack[u];else return"INITIAL"},"topState"),pushState:e(function(u){this.begin(u)},"pushState"),stateStackSize:e(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:e(function(u,x,p,I){var r=I;switch(p){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 J}();v.lexer=st;function W(){this.yy={}}return e(W,"Parser"),W.prototype=v,v.Parser=W,new W}();Lt.parser=Lt;var ye=Lt;function At(t){return t.type==="bar"}e(At,"isBarPlot");function Ct(t){return t.type==="band"}e(Ct,"isBandAxisData");function dt(t){return t.type==="linear"}e(dt,"isLinearAxisData");var Bt=class{constructor(t){this.parentGroup=t}static{e(this,"TextDimensionCalculatorWithFont")}getMaxDimension(t,i){if(!this.parentGroup)return{width:t.reduce((g,y)=>Math.max(y.length,g),0)*i,height:i};let s={width:0,height:0},n=this.parentGroup.append("g").attr("visibility","hidden").attr("font-size",i),o=n.node()?.getScreenCTM?.(),c=e((g)=>g&&g>0?g:1,"toScale"),l=c(o?.a),f=c(o?.d);for(let g of t){let y=Vi(n,1,g),z=y?y.width/l:g.length*i,M=y?y.height/f:i;s.width=Math.max(s.width,z),s.height=Math.max(s.height,M)}return n.remove(),s}},jt=0.7,Qt=0.2,Kt=class{constructor(t,i,s,n){this.axisConfig=t,this.title=i,this.textDimensionCalculator=s,this.axisThemeConfig=n,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{e(this,"BaseAxis")}setRange(t){if(this.range=t,this.axisPosition==="left"||this.axisPosition==="right")this.boundingRect.height=t[1]-t[0];else 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(){if(jt*this.getTickDistance()>this.outerPadding*2)this.outerPadding=Math.floor(jt*this.getTickDistance()/2);this.recalculateScale()}calculateSpaceIfDrawnHorizontally(t){let i=t.height;if(this.axisConfig.showAxisLine&&i>this.axisConfig.axisLineWidth)i-=this.axisConfig.axisLineWidth,this.showAxisLine=!0;if(this.axisConfig.showLabel){let s=this.getLabelDimension(),n=Qt*t.width;this.outerPadding=Math.min(s.width/2,n);let o=s.height;if(this.axisPosition==="bottom"&&this.normalizedLabelRotationInRad!==0)o=Math.max(o,Math.abs(Math.sin(this.normalizedLabelRotationInRad)*s.width)+Math.abs(Math.cos(this.normalizedLabelRotationInRad)*s.height));if(o+=this.axisConfig.labelPadding*2,this.labelTextHeight=s.height,o<=i)i-=o,this.showLabel=!0}if(this.axisConfig.showTick&&i>=this.axisConfig.tickLength)this.showTick=!0,i-=this.axisConfig.tickLength;if(this.axisConfig.showTitle&&this.title){let s=this.textDimensionCalculator.getMaxDimension([this.title],this.axisConfig.titleFontSize),n=s.height+this.axisConfig.titlePadding*2;if(this.titleTextHeight=s.height,n<=i)i-=n,this.showTitle=!0}this.boundingRect.width=t.width,this.boundingRect.height=t.height-i}calculateSpaceIfDrawnVertical(t){let i=t.width;if(this.axisConfig.showAxisLine&&i>this.axisConfig.axisLineWidth)i-=this.axisConfig.axisLineWidth,this.showAxisLine=!0;if(this.axisConfig.showLabel){let s=this.getLabelDimension(),n=Qt*t.height;this.outerPadding=Math.min(s.height/2,n);let o=s.width+this.axisConfig.labelPadding*2;if(o<=i)i-=o,this.showLabel=!0}if(this.axisConfig.showTick&&i>=this.axisConfig.tickLength)this.showTick=!0,i-=this.axisConfig.tickLength;if(this.axisConfig.showTitle&&this.title){let s=this.textDimensionCalculator.getMaxDimension([this.title],this.axisConfig.titleFontSize),n=s.height+this.axisConfig.titlePadding*2;if(this.titleTextHeight=s.height,n<=i)i-=n,this.showTitle=!0}this.boundingRect.width=t.width-i,this.boundingRect.height=t.height}calculateSpace(t){if(this.axisPosition==="left"||this.axisPosition==="right")this.calculateSpaceIfDrawnVertical(t);else this.calculateSpaceIfDrawnHorizontally(t);return 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 i=this.normalizedLabelRotationInRad;if(i===0)return 0;return Math.sin(i)*this.getLabelDimension()[t]/2}getDrawableElementsForLeftAxis(){let t=[];if(this.showAxisLine){let i=this.boundingRect.x+this.boundingRect.width-this.axisConfig.axisLineWidth/2;t.push({type:"path",groupTexts:["left-axis","axisl-line"],data:[{path:`M ${i},${this.boundingRect.y} L ${i},${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((i)=>({text:i.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(i),fill:this.axisThemeConfig.labelColor,fontSize:this.axisConfig.labelFontSize,rotation:0,verticalPos:"middle",horizontalPos:"right"}))});if(this.showTick){let i=this.boundingRect.x+this.boundingRect.width-(this.showAxisLine?this.axisConfig.axisLineWidth:0);t.push({type:"path",groupTexts:["left-axis","ticks"],data:this.getTickValues().map((s)=>({path:`M ${i},${this.getScaleValue(s)} L ${i-this.axisConfig.tickLength},${this.getScaleValue(s)}`,strokeFill:this.axisThemeConfig.tickColor,strokeWidth:this.axisConfig.tickWidth}))})}if(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"}]});return t}getDrawableElementsForBottomAxis(){let t=[];if(this.showAxisLine){let i=this.boundingRect.y+this.axisConfig.axisLineWidth/2;t.push({type:"path",groupTexts:["bottom-axis","axis-line"],data:[{path:`M ${this.boundingRect.x},${i} L ${this.boundingRect.x+this.boundingRect.width},${i}`,strokeFill:this.axisThemeConfig.axisLineColor,strokeWidth:this.axisConfig.axisLineWidth}]})}if(this.showLabel)t.push({type:"text",groupTexts:["bottom-axis","label"],data:this.getTickValues().map((i)=>({text:i.toString(),x:this.getScaleValue(i)+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"}))});if(this.showTick){let i=this.boundingRect.y+(this.showAxisLine?this.axisConfig.axisLineWidth:0);t.push({type:"path",groupTexts:["bottom-axis","ticks"],data:this.getTickValues().map((s)=>({path:`M ${this.getScaleValue(s)},${i} L ${this.getScaleValue(s)},${i+this.axisConfig.tickLength}`,strokeFill:this.axisThemeConfig.tickColor,strokeWidth:this.axisConfig.tickWidth}))})}if(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"}]});return t}getDrawableElementsForTopAxis(){let t=[];if(this.showAxisLine){let i=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},${i} L ${this.boundingRect.x+this.boundingRect.width},${i}`,strokeFill:this.axisThemeConfig.axisLineColor,strokeWidth:this.axisConfig.axisLineWidth}]})}if(this.showLabel)t.push({type:"text",groupTexts:["top-axis","label"],data:this.getTickValues().map((i)=>({text:i.toString(),x:this.getScaleValue(i),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"}))});if(this.showTick){let i=this.boundingRect.y;t.push({type:"path",groupTexts:["top-axis","ticks"],data:this.getTickValues().map((s)=>({path:`M ${this.getScaleValue(s)},${i+this.boundingRect.height-(this.showAxisLine?this.axisConfig.axisLineWidth:0)} L ${this.getScaleValue(s)},${i+this.boundingRect.height-this.axisConfig.tickLength-(this.showAxisLine?this.axisConfig.axisLineWidth:0)}`,strokeFill:this.axisThemeConfig.tickColor,strokeWidth:this.axisConfig.tickWidth}))})}if(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"}]});return t}getDrawableElements(){if(this.axisPosition==="left")return this.getDrawableElementsForLeftAxis();if(this.axisPosition==="right")throw Error("Drawing of right axis is not implemented");if(this.axisPosition==="bottom")return this.getDrawableElementsForBottomAxis();if(this.axisPosition==="top")return this.getDrawableElementsForTopAxis();return[]}},we=class extends Kt{static{e(this,"BandAxis")}constructor(t,i,s,n,o){super(t,n,o,i);this.categories=s,this.scale=xt().domain(this.categories).range(this.getRange())}setRange(t){super.setRange(t)}recalculateScale(){this.scale=xt().domain(this.categories).range(this.getRange()).paddingInner(1).paddingOuter(0).align(0.5),a.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{e(this,"LinearAxis")}constructor(t,i,s,n,o){super(t,n,o,i);this.domain=s,this.scale=wt().domain(this.domain).range(this.getRange())}getTickValues(){return this.scale.ticks()}recalculateScale(){let t=[...this.domain];if(this.axisPosition==="left")t.reverse();this.scale=wt().domain(t).range(this.getRange())}getScaleValue(t){return this.scale(t)}};function Et(t,i,s,n){let o=new Bt(n);if(Ct(t))return new we(i,s,t.categories,t.title,o);return new Ae(i,s,[t.min,t.max],t.title,o)}e(Et,"getAxis");var Ce=class{constructor(t,i,s,n){this.textDimensionCalculator=t,this.chartConfig=i,this.chartData=s,this.chartThemeConfig=n,this.titleWidth=0,this.boundingRect={x:0,y:0,width:0,height:0},this.showChartTitle=!1}static{e(this,"ChartTitle")}setBoundingBoxXY(t){this.boundingRect.x=t.x,this.boundingRect.y=t.y}calculateSpace(t){let i=this.textDimensionCalculator.getMaxDimension([this.chartData.title],this.chartConfig.titleFontSize),s=Math.max(i.width,t.width),n=i.height+2*this.chartConfig.titlePadding;if(n<=t.height&&this.chartConfig.showTitle&&this.chartData.title)this.boundingRect.width=s,this.boundingRect.height=n,this.titleWidth=i.width,this.showChartTitle=!0;return{width:this.boundingRect.width,height:this.boundingRect.height}}alignTo(t,i){let s=Math.min(this.titleWidth,this.chartConfig.width)/2,n=Math.min(Math.max((t+i)/2,s),this.chartConfig.width-s);this.boundingRect.x=n-s,this.boundingRect.width=s*2}getDrawableElements(){let t=[];if(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}]});return t}};function Zt(t,i,s,n){let o=new Bt(n);return new Ce(o,t,i,s)}e(Zt,"getChartTitleComponent");var Se=0.75,Re=0.5,_e=0.35;function Mt(t){return{fontSize:t,markerSize:t*Se,markerSpacing:t*_e,itemSpacing:t*Re}}e(Mt,"getLegendLayout");var Te=class{constructor(t,i,s,n){this.textDimensionCalculator=t,this.chartConfig=i,this.chartData=s,this.chartThemeConfig=n,this.boundingRect={x:0,y:0,width:0,height:0},this.visiblePlots=[]}static{e(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((g)=>g.title):[],this.visiblePlots.length===0)return this.boundingRect.width=0,this.boundingRect.height=0,{width:0,height:0};let{fontSize:i,markerSize:s,markerSpacing:n,itemSpacing:o}=Mt(this.chartConfig.legendFontSize),c=this.textDimensionCalculator.getMaxDimension(this.visiblePlots.map((g)=>g.title),i),l=this.chartConfig.legendPadding*2+s+n+c.width,f=this.chartConfig.legendPadding*2+this.visiblePlots.length*i+(this.visiblePlots.length-1)*o;if(l<=t.width&&f<=t.height)this.boundingRect.width=l,this.boundingRect.height=f;else this.visiblePlots=[],this.boundingRect.width=0,this.boundingRect.height=0;return{width:this.boundingRect.width,height:this.boundingRect.height}}getDrawableElements(){if(this.visiblePlots.length===0)return[];let{fontSize:t,markerSize:i,markerSpacing:s,itemSpacing:n}=Mt(this.chartConfig.legendFontSize),o=t+n,c=this.boundingRect.x+this.chartConfig.legendPadding,l=this.boundingRect.y+this.chartConfig.legendPadding,f=[],g=[];for(let[y,z]of this.visiblePlots.entries())if(At(z))f.push({x:c,y:l+y*o,width:i,height:i,fill:z.fill,strokeFill:z.fill,strokeWidth:0});else{let M=l+y*o+i/2;g.push({path:`M ${c},${M} L ${c+i},${M}`,strokeFill:z.strokeFill,strokeWidth:z.strokeWidth})}return[{groupTexts:["legend","markers"],type:"rect",data:f},{groupTexts:["legend","markers"],type:"path",data:g},{groupTexts:["legend","label"],type:"text",data:this.visiblePlots.map((y,z)=>({text:y.title,x:c+i+s,y:l+z*o+i/2,fill:this.chartThemeConfig.legendTextColor,fontSize:t,rotation:0,verticalPos:"middle",horizontalPos:"left"}))}]}};function Jt(t,i,s,n){let o=new Bt(n);return new Te(o,t,i,s)}e(Jt,"getChartLegendComponent");var De=class{constructor(t,i,s,n,o){this.plotData=t,this.xAxis=i,this.yAxis=s,this.orientation=n,this.plotIndex=o}static{e(this,"LinePlot")}getDrawableElement(){let t=this.plotData.data.map((n)=>[this.xAxis.getScaleValue(n[0]),this.yAxis.getScaleValue(n[1])]),i;if(this.orientation==="horizontal")i=Wn().y((n)=>n[0]).x((n)=>n[1])(t);else i=Wn().x((n)=>n[0]).y((n)=>n[1])(t);if(!i)return[];let s=[{groupTexts:["plot",`line-plot-${this.plotIndex}`],type:"path",data:[{path:i,strokeFill:this.plotData.strokeFill,strokeWidth:this.plotData.strokeWidth}]}];if(this.plotData.pointLabels&&this.plotData.pointLabels.length>0){let c=[];for(let[l,[f,g]]of t.entries()){let y=this.plotData.pointLabels[l];if(!y)continue;if(this.orientation==="horizontal")c.push({x:g+10,y:f,text:y,fill:this.plotData.strokeFill,verticalPos:"middle",horizontalPos:"left",fontSize:12,rotation:0});else c.push({x:f,y:g-10,text:y,fill:this.plotData.strokeFill,verticalPos:"middle",horizontalPos:"center",fontSize:12,rotation:0})}if(c.length>0)s.push({groupTexts:["plot",`line-plot-${this.plotIndex}`,"labels"],type:"text",data:c})}return s}},ve=class{constructor(t,i,s,n,o,c){this.barData=t,this.boundingRect=i,this.xAxis=s,this.yAxis=n,this.orientation=o,this.plotIndex=c}static{e(this,"BarPlot")}getDrawableElement(){let t=this.barData.data.map((o)=>[this.xAxis.getScaleValue(o[0]),this.yAxis.getScaleValue(o[1])]),i=0.05,s=Math.min(this.xAxis.getAxisOuterPadding()*2,this.xAxis.getTickDistance())*0.95,n=s/2;if(this.orientation==="horizontal")return[{groupTexts:["plot",`bar-plot-${this.plotIndex}`],type:"rect",data:t.map((o)=>({x:this.boundingRect.x,y:o[0]-n,height:s,width:o[1]-this.boundingRect.x,fill:this.barData.fill,strokeWidth:0,strokeFill:this.barData.fill}))}];return[{groupTexts:["plot",`bar-plot-${this.plotIndex}`],type:"rect",data:t.map((o)=>({x:o[0]-n,y:o[1],width:s,height:this.boundingRect.y+this.boundingRect.height-o[1],fill:this.barData.fill,strokeWidth:0,strokeFill:this.barData.fill}))}]}},Pe=class{constructor(t,i,s){this.chartConfig=t,this.chartData=i,this.chartThemeConfig=s,this.boundingRect={x:0,y:0,width:0,height:0}}static{e(this,"BasePlot")}setAxes(t,i){this.xAxis=t,this.yAxis=i}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[i,s]of this.chartData.plots.entries())switch(s.type){case"line":{let n=new De(s,this.xAxis,this.yAxis,this.chartConfig.chartOrientation,i);t.push(...n.getDrawableElement())}break;case"bar":{let n=new ve(s,this.boundingRect,this.xAxis,this.yAxis,this.chartConfig.chartOrientation,i);t.push(...n.getDrawableElement())}break}return t}};function te(t,i,s){return new Pe(t,i,s)}e(te,"getPlotComponent");var Le=class{constructor(t,i,s,n){this.chartConfig=t,this.chartData=i,this.componentStore={title:Zt(t,i,s,n),plot:te(t,i,s),legend:Jt(t,i,s,n),xAxis:Et(i.xAxis,t.xAxis,{titleColor:s.xAxisTitleColor,labelColor:s.xAxisLabelColor,tickColor:s.xAxisTickColor,axisLineColor:s.xAxisLineColor},n),yAxis:Et(i.yAxis,t.yAxis,{titleColor:s.yAxisTitleColor,labelColor:s.yAxisLabelColor,tickColor:s.yAxisTickColor,axisLineColor:s.yAxisLineColor},n)}}static{e(this,"Orchestrator")}calculateVerticalSpace(){let t=this.chartConfig.width,i=this.chartConfig.height,s=0,n=0,o={width:0,height:0},c=Math.floor(t*this.chartConfig.plotReservedSpacePercent/100),l=Math.floor(i*this.chartConfig.plotReservedSpacePercent/100),f=this.componentStore.plot.calculateSpace({width:c,height:l});if(t-=f.width,i-=f.height,f=this.componentStore.title.calculateSpace({width:this.chartConfig.width,height:i}),n=f.height,i-=f.height,this.componentStore.xAxis.setAxisPosition("bottom"),f=this.componentStore.xAxis.calculateSpace({width:t,height:i}),i-=f.height,this.componentStore.yAxis.setAxisPosition("left"),f=this.componentStore.yAxis.calculateSpace({width:t,height:i}),s=f.width,t-=f.width,o=this.componentStore.legend.calculateSpace({width:t,height:l}),t-=o.width,t>0)c+=t,t=0;if(i>0)l+=i,i=0;if(this.componentStore.plot.calculateSpace({width:c,height:l}),this.componentStore.plot.setBoundingBoxXY({x:s,y:n}),this.componentStore.title.alignTo(s,s+c),this.componentStore.legend.setBoundingBoxXY({x:s+c,y:n+Math.max((l-o.height)/2,0)}),this.componentStore.xAxis.setRange([s,s+c]),this.componentStore.xAxis.setBoundingBoxXY({x:s,y:n+l}),this.componentStore.yAxis.setRange([n,n+l]),this.componentStore.yAxis.setBoundingBoxXY({x:0,y:n}),this.chartData.plots.some((g)=>At(g)))this.componentStore.xAxis.recalculateOuterPaddingToDrawBar()}calculateHorizontalSpace(){let t=this.chartConfig.width,i=this.chartConfig.height,s=0,n=0,o=0,c={width:0,height:0},l=Math.floor(t*this.chartConfig.plotReservedSpacePercent/100),f=Math.floor(i*this.chartConfig.plotReservedSpacePercent/100),g=this.componentStore.plot.calculateSpace({width:l,height:f});if(t-=g.width,i-=g.height,g=this.componentStore.title.calculateSpace({width:this.chartConfig.width,height:i}),s=g.height,i-=g.height,this.componentStore.xAxis.setAxisPosition("left"),g=this.componentStore.xAxis.calculateSpace({width:t,height:i}),t-=g.width,n=g.width,this.componentStore.yAxis.setAxisPosition("top"),g=this.componentStore.yAxis.calculateSpace({width:t,height:i}),i-=g.height,o=s+g.height,c=this.componentStore.legend.calculateSpace({width:t,height:f}),t-=c.width,t>0)l+=t,t=0;if(i>0)f+=i,i=0;if(this.componentStore.plot.calculateSpace({width:l,height:f}),this.componentStore.plot.setBoundingBoxXY({x:n,y:o}),this.componentStore.title.alignTo(n,n+l),this.componentStore.legend.setBoundingBoxXY({x:n+l,y:o+Math.max((f-c.height)/2,0)}),this.componentStore.yAxis.setRange([n,n+l]),this.componentStore.yAxis.setBoundingBoxXY({x:n,y:s}),this.componentStore.xAxis.setRange([o,o+f]),this.componentStore.xAxis.setBoundingBoxXY({x:0,y:o}),this.chartData.plots.some((y)=>At(y)))this.componentStore.xAxis.recalculateOuterPaddingToDrawBar()}calculateSpace(){if(this.chartConfig.chartOrientation==="horizontal")this.calculateHorizontalSpace();else this.calculateVerticalSpace()}getDrawableElement(){this.calculateSpace();let t=[];this.componentStore.plot.setAxes(this.componentStore.xAxis,this.componentStore.yAxis);for(let i of Object.values(this.componentStore))t.push(...i.getDrawableElements());return t}},Ee=class{static{e(this,"XYChartBuilder")}static build(t,i,s,n){return new Le(t,i,s,n).getDrawableElement()}},ft=0,ee,pt=Wt(),mt=Vt(),w=Ft(),It=mt.plotColorPalette.split(",").map((t)=>t.trim()),St=!1,zt=!1;function Vt(){let t=ke(),i=b();return U(t.xyChart,i.themeVariables.xyChart)}e(Vt,"getChartDefaultThemeConfig");function Wt(){let t=b();return U(D.xyChart,t.xyChart)}e(Wt,"getChartDefaultConfig");function Ft(){return{yAxis:{type:"linear",title:"",min:1/0,max:-1/0},xAxis:{type:"band",title:"",categories:[]},title:"",plots:[]}}e(Ft,"getChartDefaultData");function ct(t){let i=b();return O(t.trim(),i)}e(ct,"textSanitizer");function ie(t){ee=t}e(ie,"setTmpSVGG");function se(t){if(t==="horizontal")pt.chartOrientation="horizontal";else pt.chartOrientation="vertical"}e(se,"setOrientation");function ne(t){w.xAxis.title=ct(t.text)}e(ne,"setXAxisTitle");function Xt(t,i){w.xAxis={type:"linear",title:w.xAxis.title,min:t,max:i},St=!0}e(Xt,"setXAxisRangeData");function ae(t){w.xAxis={type:"band",title:w.xAxis.title,categories:t.map((i)=>ct(i.text))},St=!0}e(ae,"setXAxisBand");function oe(t){w.yAxis.title=ct(t.text)}e(oe,"setYAxisTitle");function re(t,i){w.yAxis={type:"linear",title:w.yAxis.title,min:t,max:i},zt=!0}e(re,"setYAxisRangeData");function he(t){let i=Math.min(...t),s=Math.max(...t),n=dt(w.yAxis)?w.yAxis.min:1/0,o=dt(w.yAxis)?w.yAxis.max:-1/0;w.yAxis={type:"linear",title:w.yAxis.title,min:Math.min(n,i),max:Math.max(o,s)}}e(he,"setYAxisRangeFromPlotData");function Yt(t){let i=[];if(t.length===0)return i;if(!St){let s=dt(w.xAxis)?w.xAxis.min:1/0,n=dt(w.xAxis)?w.xAxis.max:-1/0;Xt(Math.min(s,1),Math.max(n,t.length))}if(Ct(w.xAxis)&&t.length>w.xAxis.categories.length)t=t.slice(0,w.xAxis.categories.length);if(!zt)he(t);if(Ct(w.xAxis))i=w.xAxis.categories.map((s,n)=>[s,t[n]]);if(dt(w.xAxis)){let s=w.xAxis.min,n=w.xAxis.max;if(t.length===1)i=[[`${s}`,t[0]]];else{let o=(n-s)/(t.length-1);i=t.map((c,l)=>[`${s+l*o}`,c])}}return i}e(Yt,"transformDataWithoutCategory");function Nt(t){return It[t===0?0:t%It.length]}e(Nt,"getPlotColorFromPalette");function le(t,i){let s=i.map((l)=>l.value),n=i.map((l)=>l.label?ct(l.label):""),o=Yt(s),c=n.some((l)=>l!=="");w.plots.push({type:"line",title:ct(t.text),strokeFill:Nt(ft),strokeWidth:2,data:o,...c?{pointLabels:n}:{}}),ft++}e(le,"setLineData");function ce(t,i){let s=i.map((o)=>o.value),n=Yt(s);w.plots.push({type:"bar",title:ct(t.text),fill:Nt(ft),data:n}),ft++}e(ce,"setBarData");function ge(){if(w.plots.length===0)throw Error("No Plot to render, please provide a plot with some data");return w.title=L(),Ee.build(pt,w,mt,ee)}e(ge,"getDrawableElem");function ue(){return mt}e(ue,"getChartThemeConfig");function de(){return pt}e(de,"getChartConfig");function xe(){return w}e(xe,"getXYChartData");var Me=e(function(){C(),ft=0,pt=Wt(),w=Ft(),mt=Vt(),It=mt.plotColorPalette.split(",").map((t)=>t.trim()),St=!1,zt=!1},"clear"),Ie={getDrawableElem:ge,clear:Me,setAccTitle:S,getAccTitle:E,setDiagramTitle:R,getDiagramTitle:L,getAccDescription:A,setAccDescription:T,setOrientation:se,setXAxisTitle:ne,setXAxisRangeData:Xt,setXAxisBand:ae,setYAxisTitle:oe,setYAxisRangeData:re,setLineData:le,setBarData:ce,setTmpSVGG:ie,getChartThemeConfig:ue,getChartConfig:de,getXYChartData:xe},Be=e((t,i,s,n)=>{let o=n.db,c=o.getChartThemeConfig(),l=o.getChartConfig(),f=o.getXYChartData().plots[0].data.map((_)=>_[1]);function g(_){return _==="top"?"text-before-edge":"middle"}e(g,"getDominantBaseLine");function y(_){return _==="left"?"start":_==="right"?"end":"middle"}e(y,"getTextAnchor");function z(_){return`translate(${_.x}, ${_.y}) rotate(${_.rotation||0})`}e(z,"getTextTransformation"),a.debug(`Rendering xychart chart
|
|
7
|
-
`+t);let M=V(i),k=M.append("g").attr("class","main"),G=k.append("rect").attr("width",l.width).attr("height",l.height).attr("class","background");B(M,l.height,l.width,!0),M.attr("viewBox",`0 0 ${l.width} ${l.height}`),G.attr("fill",c.backgroundColor),o.setTmpSVGG(M.append("g").attr("class","mermaid-tmp-group"));let Y=o.getDrawableElem(),N={};function j(_){let K=k,d="";for(let[Q]of _.entries()){let Z=k;if(Q>0&&N[d])Z=N[d];if(d+=_[Q],K=N[d],!K)K=N[d]=Z.append("g").attr("class",_[Q])}return K}e(j,"getGroup");for(let _ of Y){if(_.data.length===0)continue;let K=j(_.groupTexts);switch(_.type){case"rect":if(K.selectAll("rect").data(_.data).enter().append("rect").attr("x",(d)=>d.x).attr("y",(d)=>d.y).attr("width",(d)=>d.width).attr("height",(d)=>d.height).attr("fill",(d)=>d.fill).attr("stroke",(d)=>d.strokeFill).attr("stroke-width",(d)=>d.strokeWidth),l.showDataLabel){let d=l.showDataLabelOutsideBar;if(l.chartOrientation==="horizontal"){let Q=function(v,st){let{data:W,label:J}=v;return st*J.length*Z<=W.width-P};var it=Q;e(Q,"fitsHorizontally");let Z=0.7,P=10,ot=_.data.map((v,st)=>({data:v,label:f[st].toString()})).filter((v)=>v.data.width>0&&v.data.height>0),H=ot.map((v)=>{let{data:st}=v,W=st.height*0.7;while(!Q(v,W)&&W>0)W-=1;return W}),gt=Math.floor(Math.min(...H)),F=e((v)=>{if(d)return v.data.x+v.data.width+P;else return v.data.x+v.data.width-P},"determineLabelXPosition");K.selectAll("text").data(ot).enter().append("text").attr("x",F).attr("y",(v)=>v.data.y+v.data.height/2).attr("text-anchor",d?"start":"end").attr("dominant-baseline","middle").attr("fill",c.dataLabelColor).attr("font-size",`${gt}px`).text((v)=>v.label)}else{let Q=function(F,v,st){let{data:W,label:J}=F,h=0.7,u=v*J.length*0.7,x=W.x+W.width/2,p=x-u/2,I=x+u/2,r=p>=W.x&&I<=W.x+W.width,rt=W.y+st+v<=W.y+W.height;return r&&rt};var nt=Q;e(Q,"fitsInBar");let Z=10,P=_.data.map((F,v)=>({data:F,label:f[v].toString()})).filter((F)=>F.data.width>0&&F.data.height>0),ot=P.map((F)=>{let{data:v,label:st}=F,W=v.width/(st.length*0.7);while(!Q(F,W,Z)&&W>0)W-=1;return W}),H=Math.floor(Math.min(...ot)),gt=e((F)=>{if(d)return F.data.y-Z;else return F.data.y+Z},"determineLabelYPosition");K.selectAll("text").data(P).enter().append("text").attr("x",(F)=>F.data.x+F.data.width/2).attr("y",gt).attr("text-anchor","middle").attr("dominant-baseline",d?"auto":"hanging").attr("fill",c.dataLabelColor).attr("font-size",`${H}px`).text((F)=>F.label)}}break;case"text":K.selectAll("text").data(_.data).enter().append("text").attr("x",0).attr("y",0).attr("fill",(d)=>d.fill).attr("font-size",(d)=>d.fontSize).attr("dominant-baseline",(d)=>g(d.verticalPos)).attr("text-anchor",(d)=>y(d.horizontalPos)).attr("transform",(d)=>z(d)).text((d)=>d.text);break;case"path":K.selectAll("path").data(_.data).enter().append("path").attr("d",(d)=>d.path).attr("fill",(d)=>d.fill?d.fill:"none").attr("stroke",(d)=>d.strokeFill).attr("stroke-width",(d)=>d.strokeWidth);break}}},"draw"),ze={draw:Be},ti={parser:ye,db:Ie,renderer:ze};export{ti as diagram};
|
package/web/chunk-kkfrs7d1.js
DELETED
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import{G}from"./chunk-14deqqhr.js";import{e,a,ke,D,b,B,C,S,E,T,A,R,L,V,U}from"./chunk-1s53190z.js";import{X}from"./chunk-2cem4sv7.js";var h={showLegend:!0,ticks:5,max:null,min:0,graticule:"circle"},M=32,k={axes:[],curves:[],options:h},x=structuredClone(k),H=D.radar,j=e(()=>U({...H,...b().radar}),"getConfig"),O=e(()=>x.axes,"getAxes"),K=e(()=>x.curves,"getCurves"),N=e(()=>x.options,"getOptions"),Y=e((n)=>{x.axes=n.map((t)=>({name:t.name,label:t.label??t.name}))},"setAxes"),Z=e((n)=>{x.curves=n.map((t)=>({name:t.name,label:t.label??t.name,entries:q(t.entries)}))},"setCurves"),q=e((n)=>{if(n[0].axis==null)return n.map((r)=>r.value);let t=O();if(t.length===0)throw Error("Axes must be populated before curves for reference entries");return t.map((r)=>{let s=n.find((o)=>o.axis?.$refText===r.name);if(s===void 0)throw Error("Missing entry for axis "+r.label);return s.value})},"computeCurveEntries"),J=e((n)=>{let t=n.reduce((r,s)=>(r[s.name]=s,r),{});if(x.options={showLegend:t.showLegend?.value??h.showLegend,ticks:t.ticks?.value??h.ticks,max:t.max?.value??h.max,min:t.min?.value??h.min,graticule:t.graticule?.value??h.graticule},x.options.ticks>M)a.warn(`Radar diagram ticks (${x.options.ticks}) exceeds maximum allowed (${M}). Using ${M} instead.`),x.options.ticks=M},"setOptions"),Q=e(()=>{C(),x=structuredClone(k)},"clear"),y={getAxes:O,getCurves:K,getOptions:N,setAxes:Y,setCurves:Z,setOptions:J,getConfig:j,clear:Q,setAccTitle:S,getAccTitle:E,setDiagramTitle:R,getDiagramTitle:L,getAccDescription:A,setAccDescription:T},tt=e((n)=>{G(n,y);let{axes:t,curves:r,options:s}=n;y.setAxes(t),y.setCurves(r),y.setOptions(s)},"populate"),et={parse:e(async(n)=>{let t=await X("radar",n);a.debug(t),tt(t)},"parse")},at=e((n,t,r,s)=>{let o=s.db,c=o.getAxes(),d=o.getCurves(),i=o.getOptions(),l=o.getConfig(),u=o.getDiagramTitle(),m=V(t),p=rt(m,l),g=i.max??Math.max(...d.map((w)=>Math.max(...w.entries))),v=i.min,f=Math.min(l.width,l.height)/2;nt(p,c,f,i.ticks,i.graticule),st(p,c,f,l),I(p,c,d,v,g,i.graticule,l),P(p,d,i.showLegend,l),p.append("text").attr("class","radarTitle").text(u).attr("x",0).attr("y",-l.height/2-l.marginTop)},"draw"),rt=e((n,t)=>{let r=t.width+t.marginLeft+t.marginRight,s=t.height+t.marginTop+t.marginBottom,o={x:t.marginLeft+t.width/2,y:t.marginTop+t.height/2};return B(n,s,r,t.useMaxWidth??!0),n.attr("viewBox",`0 0 ${r} ${s}`).attr("overflow","visible"),n.append("g").attr("transform",`translate(${o.x}, ${o.y})`)},"drawFrame"),nt=e((n,t,r,s,o)=>{if(o==="circle")for(let c=0;c<s;c++){let d=r*(c+1)/s;n.append("circle").attr("r",d).attr("class","radarGraticule")}else if(o==="polygon"){let c=t.length;for(let d=0;d<s;d++){let i=r*(d+1)/s,l=t.map((u,m)=>{let p=2*m*Math.PI/c-Math.PI/2,g=i*Math.cos(p),v=i*Math.sin(p);return`${g},${v}`}).join(" ");n.append("polygon").attr("points",l).attr("class","radarGraticule")}}},"drawGraticule"),st=e((n,t,r,s)=>{let o=t.length;for(let c=0;c<o;c++){let d=t[c].label,i=2*c*Math.PI/o-Math.PI/2,l=Math.cos(i),u=Math.sin(i);n.append("line").attr("x1",0).attr("y1",0).attr("x2",r*s.axisScaleFactor*l).attr("y2",r*s.axisScaleFactor*u).attr("class","radarAxisLine");let m=l>0.01?"start":l<-0.01?"end":"middle",p=u>0.01?"hanging":u<-0.01?"auto":"central",g=4;n.append("text").text(d).attr("x",r*s.axisLabelFactor*l+g*l).attr("y",r*s.axisLabelFactor*u+g*u).attr("text-anchor",m).attr("dominant-baseline",p).attr("class","radarAxisLabel")}},"drawAxes");function I(n,t,r,s,o,c,d){let i=t.length,l=Math.min(d.width,d.height)/2;r.forEach((u,m)=>{if(u.entries.length!==i)return;let p=u.entries.map((g,v)=>{let f=2*Math.PI*v/i-Math.PI/2,w=_(g,s,o,l),z=w*Math.cos(f),W=w*Math.sin(f);return{x:z,y:W}});if(c==="circle")n.append("path").attr("d",F(p,d.curveTension)).attr("class",`radarCurve-${m}`);else if(c==="polygon")n.append("polygon").attr("points",p.map((g)=>`${g.x},${g.y}`).join(" ")).attr("class",`radarCurve-${m}`)})}e(I,"drawCurves");function _(n,t,r,s){let o=Math.min(Math.max(n,t),r);return s*(o-t)/(r-t)}e(_,"relativeRadius");function F(n,t){let r=n.length,s=`M${n[0].x},${n[0].y}`;for(let o=0;o<r;o++){let c=n[(o-1+r)%r],d=n[o],i=n[(o+1)%r],l=n[(o+2)%r],u={x:d.x+(i.x-c.x)*t,y:d.y+(i.y-c.y)*t},m={x:i.x-(l.x-d.x)*t,y:i.y-(l.y-d.y)*t};s+=` C${u.x},${u.y} ${m.x},${m.y} ${i.x},${i.y}`}return`${s} Z`}e(F,"closedRoundCurve");function P(n,t,r,s){if(!r)return;let o=(s.width/2+s.marginRight)*3/4,c=-(s.height/2+s.marginTop)*3/4,d=20;t.forEach((i,l)=>{let u=n.append("g").attr("transform",`translate(${o}, ${c+l*d})`);u.append("rect").attr("width",12).attr("height",12).attr("class",`radarLegendBox-${l}`),u.append("text").attr("x",16).attr("y",0).attr("class","radarLegendText").text(i.label)})}e(P,"drawLegend");var ot={draw:at},it=e((n,t)=>{let r="";for(let s=0;s<n.THEME_COLOR_LIMIT;s++){let o=n[`cScale${s}`];r+=`
|
|
2
|
-
.radarCurve-${s} {
|
|
3
|
-
color: ${o};
|
|
4
|
-
fill: ${o};
|
|
5
|
-
fill-opacity: ${t.curveOpacity};
|
|
6
|
-
stroke: ${o};
|
|
7
|
-
stroke-width: ${t.curveStrokeWidth};
|
|
8
|
-
}
|
|
9
|
-
.radarLegendBox-${s} {
|
|
10
|
-
fill: ${o};
|
|
11
|
-
fill-opacity: ${t.curveOpacity};
|
|
12
|
-
stroke: ${o};
|
|
13
|
-
}
|
|
14
|
-
`}return r},"genIndexStyles"),lt=e((n)=>{let t=ke(),r=b(),s=U(t,r.themeVariables),o=U(s.radar,n);return{themeVariables:s,radarOptions:o}},"buildRadarStyleOptions"),ct=e(({radar:n}={})=>{let{themeVariables:t,radarOptions:r}=lt(n);return`
|
|
15
|
-
.radarTitle {
|
|
16
|
-
font-size: ${t.fontSize};
|
|
17
|
-
color: ${t.titleColor};
|
|
18
|
-
dominant-baseline: hanging;
|
|
19
|
-
text-anchor: middle;
|
|
20
|
-
}
|
|
21
|
-
.radarAxisLine {
|
|
22
|
-
stroke: ${r.axisColor};
|
|
23
|
-
stroke-width: ${r.axisStrokeWidth};
|
|
24
|
-
}
|
|
25
|
-
.radarAxisLabel {
|
|
26
|
-
font-size: ${r.axisLabelFontSize}px;
|
|
27
|
-
color: ${r.axisColor};
|
|
28
|
-
}
|
|
29
|
-
.radarGraticule {
|
|
30
|
-
fill: ${r.graticuleColor};
|
|
31
|
-
fill-opacity: ${r.graticuleOpacity};
|
|
32
|
-
stroke: ${r.graticuleColor};
|
|
33
|
-
stroke-width: ${r.graticuleStrokeWidth};
|
|
34
|
-
}
|
|
35
|
-
.radarLegendText {
|
|
36
|
-
text-anchor: start;
|
|
37
|
-
font-size: ${r.legendFontSize}px;
|
|
38
|
-
dominant-baseline: hanging;
|
|
39
|
-
}
|
|
40
|
-
${it(t,r)}
|
|
41
|
-
`},"styles"),vt={parser:et,db:y,renderer:ot,styles:ct};export{vt as diagram};
|
package/web/chunk-kkyn8yhj.js
DELETED
|
@@ -1,106 +0,0 @@
|
|
|
1
|
-
import{yn}from"./chunk-wjbk50hn.js";import{G}from"./chunk-14deqqhr.js";import{e,a,D,b,v,C,S,E,T,A,R,L,l,kr,p,ji,U,M}from"./chunk-1s53190z.js";import{X}from"./chunk-2cem4sv7.js";var k={NORMAL:0,REVERSE:1,HIGHLIGHT:2,MERGE:3,CHERRY_PICK:4},Ce=D.gitGraph,J=e(()=>U({...Ce,...b().gitGraph}),"getConfig"),m=new yn(()=>{let t=J(),{mainBranchName:r,mainBranchOrder:o}=t;return{mainBranchName:r,commits:new Map,head:null,branchConfig:new Map([[r,{name:r,order:o}]]),branches:new Map([[r,null]]),currBranch:r,direction:"LR",seq:0,options:{}}});function ne(){return ji({length:7})}e(ne,"getID");function pe(t,r){let o=Object.create(null);return t.reduce((c,i)=>{let h=r(i);if(!o[h])o[h]=!0,c.push(i);return c},[])}e(pe,"uniqBy");var ve=e(function(t){m.records.direction=t},"setDirection"),Ee=e(function(t){a.debug("options str",t),t=t?.trim(),t=t||"{}";try{m.records.options=JSON.parse(t)}catch(r){a.error("error while parsing gitGraph options",r.message)}},"setOptions"),Te=e(function(){return m.records.options},"getOptions"),Le=e(function(t){let{msg:r,id:o,type:c,tags:i}=t;a.info("commit",r,o,c,i),a.debug("Entering commit:",r,o,c,i);let h=J();o=v.sanitizeText(o,h),r=v.sanitizeText(r,h),i=i?.map((s)=>v.sanitizeText(s,h));let n={id:o?o:m.records.seq+"-"+ne(),message:r,seq:m.records.seq++,type:c??k.NORMAL,tags:i??[],parents:m.records.head==null?[]:[m.records.head.id],branch:m.records.currBranch};if(m.records.head=n,a.info("main branch",h.mainBranchName),m.records.commits.has(n.id))a.warn(`Commit ID ${n.id} already exists`);m.records.commits.set(n.id,n),m.records.branches.set(m.records.currBranch,n.id),a.debug("in pushCommit "+n.id)},"commit"),Me=e(function(t){let{name:r,order:o}=t;if(r=v.sanitizeText(r,J()),m.records.branches.has(r))throw Error(`Trying to create an existing branch. (Help: Either use a new name if you want create a new branch or try using "checkout ${r}")`);m.records.branches.set(r,m.records.head!=null?m.records.head.id:null),m.records.branchConfig.set(r,{name:r,order:o}),ye(r),a.debug("in createBranch")},"branch"),Pe=e((t)=>{let{branch:r,id:o,type:c,tags:i}=t,h=J();if(r=v.sanitizeText(r,h),o)o=v.sanitizeText(o,h);let n=m.records.branches.get(m.records.currBranch),s=m.records.branches.get(r),g=n?m.records.commits.get(n):void 0,y=s?m.records.commits.get(s):void 0;if(g&&y&&g.branch===r)throw Error(`Cannot merge branch '${r}' into itself.`);if(m.records.currBranch===r){let d=Error('Incorrect usage of "merge". Cannot merge a branch to itself');throw d.hash={text:`merge ${r}`,token:`merge ${r}`,expected:["branch abc"]},d}if(g===void 0||!g){let d=Error(`Incorrect usage of "merge". Current branch (${m.records.currBranch})has no commits`);throw d.hash={text:`merge ${r}`,token:`merge ${r}`,expected:["commit"]},d}if(!m.records.branches.has(r)){let d=Error('Incorrect usage of "merge". Branch to be merged ('+r+") does not exist");throw d.hash={text:`merge ${r}`,token:`merge ${r}`,expected:[`branch ${r}`]},d}if(y===void 0||!y){let d=Error('Incorrect usage of "merge". Branch to be merged ('+r+") has no commits");throw d.hash={text:`merge ${r}`,token:`merge ${r}`,expected:['"commit"']},d}if(g===y){let d=Error('Incorrect usage of "merge". Both branches have same head');throw d.hash={text:`merge ${r}`,token:`merge ${r}`,expected:["branch abc"]},d}if(o&&m.records.commits.has(o)){let d=Error('Incorrect usage of "merge". Commit with id:'+o+" already exists, use different custom id");throw d.hash={text:`merge ${r} ${o} ${c} ${i?.join(" ")}`,token:`merge ${r} ${o} ${c} ${i?.join(" ")}`,expected:[`merge ${r} ${o}_UNIQUE ${c} ${i?.join(" ")}`]},d}let x=s?s:"",f={id:o||`${m.records.seq}-${ne()}`,message:`merged branch ${r} into ${m.records.currBranch}`,seq:m.records.seq++,parents:m.records.head==null?[]:[m.records.head.id,x],branch:m.records.currBranch,type:k.MERGE,customType:c,customId:o?!0:!1,tags:i??[]};m.records.head=f,m.records.commits.set(f.id,f),m.records.branches.set(m.records.currBranch,f.id),a.debug(m.records.branches),a.debug("in mergeBranch")},"merge"),Re=e(function(t){let{id:r,targetId:o,tags:c,parent:i}=t;a.debug("Entering cherryPick:",r,o,c);let h=J();if(r=v.sanitizeText(r,h),o=v.sanitizeText(o,h),c=c?.map((g)=>v.sanitizeText(g,h)),i=v.sanitizeText(i,h),!r||!m.records.commits.has(r)){let g=Error('Incorrect usage of "cherryPick". Source commit id should exist and provided');throw g.hash={text:`cherryPick ${r} ${o}`,token:`cherryPick ${r} ${o}`,expected:["cherry-pick abc"]},g}let n=m.records.commits.get(r);if(n===void 0||!n)throw Error('Incorrect usage of "cherryPick". Source commit id should exist and provided');if(i&&!(Array.isArray(n.parents)&&n.parents.includes(i)))throw Error("Invalid operation: The specified parent commit is not an immediate parent of the cherry-picked commit.");let s=n.branch;if(n.type===k.MERGE&&!i)throw Error("Incorrect usage of cherry-pick: If the source commit is a merge commit, an immediate parent commit must be specified.");if(!o||!m.records.commits.has(o)){if(s===m.records.currBranch){let f=Error('Incorrect usage of "cherryPick". Source commit is already on current branch');throw f.hash={text:`cherryPick ${r} ${o}`,token:`cherryPick ${r} ${o}`,expected:["cherry-pick abc"]},f}let g=m.records.branches.get(m.records.currBranch);if(g===void 0||!g){let f=Error(`Incorrect usage of "cherry-pick". Current branch (${m.records.currBranch})has no commits`);throw f.hash={text:`cherryPick ${r} ${o}`,token:`cherryPick ${r} ${o}`,expected:["cherry-pick abc"]},f}let y=m.records.commits.get(g);if(y===void 0||!y){let f=Error(`Incorrect usage of "cherry-pick". Current branch (${m.records.currBranch})has no commits`);throw f.hash={text:`cherryPick ${r} ${o}`,token:`cherryPick ${r} ${o}`,expected:["cherry-pick abc"]},f}let x={id:m.records.seq+"-"+ne(),message:`cherry-picked ${n?.message} into ${m.records.currBranch}`,seq:m.records.seq++,parents:m.records.head==null?[]:[m.records.head.id,n.id],branch:m.records.currBranch,type:k.CHERRY_PICK,tags:c?c.filter(Boolean):[`cherry-pick:${n.id}${n.type===k.MERGE?`|parent:${i}`:""}`]};m.records.head=x,m.records.commits.set(x.id,x),m.records.branches.set(m.records.currBranch,x.id),a.debug(m.records.branches),a.debug("in cherryPick")}},"cherryPick"),ye=e(function(t){if(t=v.sanitizeText(t,J()),!m.records.branches.has(t)){let r=Error(`Trying to checkout branch which is not yet created. (Help try using "branch ${t}")`);throw r.hash={text:`checkout ${t}`,token:`checkout ${t}`,expected:[`branch ${t}`]},r}else{m.records.currBranch=t;let r=m.records.branches.get(m.records.currBranch);if(r===void 0||!r)m.records.head=null;else m.records.head=m.records.commits.get(r)??null}},"checkout");function he(t,r,o){let c=t.indexOf(r);if(c===-1)t.push(o);else t.splice(c,1,o)}e(he,"upsert");function me(t){let r=t.reduce((i,h)=>{if(i.seq>h.seq)return i;return h},t[0]),o="";t.forEach(function(i){if(i===r)o+="\t*";else o+="\t|"});let c=[o,r.id,r.seq];for(let i in m.records.branches)if(m.records.branches.get(i)===r.id)c.push(i);if(a.debug(c.join(" ")),r.parents&&r.parents.length==2&&r.parents[0]&&r.parents[1]){let i=m.records.commits.get(r.parents[0]);if(he(t,r,i),r.parents[1])t.push(m.records.commits.get(r.parents[1]))}else if(r.parents.length==0)return;else if(r.parents[0]){let i=m.records.commits.get(r.parents[0]);he(t,r,i)}t=pe(t,(i)=>i.id),me(t)}e(me,"prettyPrintCommitHistory");var Oe=e(function(){a.debug(m.records.commits);let t=xe()[0];me([t])},"prettyPrint"),Ie=e(function(){m.reset(),C()},"clear"),_e=e(function(){return[...m.records.branchConfig.values()].map((r,o)=>{if(r.order!==null&&r.order!==void 0)return r;return{...r,order:parseFloat(`0.${o}`)}}).sort((r,o)=>(r.order??0)-(o.order??0)).map(({name:r})=>({name:r}))},"getBranchesAsObjArray"),Ge=e(function(){return m.records.branches},"getBranches"),De=e(function(){return m.records.commits},"getCommits"),xe=e(function(){let t=[...m.records.commits.values()];return t.forEach(function(r){a.debug(r.id)}),t.sort((r,o)=>r.seq-o.seq),t},"getCommitsArray"),We=e(function(){return m.records.currBranch},"getCurrentBranch"),qe=e(function(){return m.records.direction},"getDirection"),Ae=e(function(){return m.records.head},"getHead"),ue={commitType:k,getConfig:J,setDirection:ve,setOptions:Ee,getOptions:Te,commit:Le,branch:Me,merge:Pe,cherryPick:Re,checkout:ye,prettyPrint:Oe,clear:Ie,getBranchesAsObjArray:_e,getBranches:Ge,getCommits:De,getCommitsArray:xe,getCurrentBranch:We,getDirection:qe,getHead:Ae,setAccTitle:S,getAccTitle:E,getAccDescription:A,setAccDescription:T,setDiagramTitle:R,getDiagramTitle:L},He=e((t,r)=>{if(G(t,r),t.dir)r.setDirection(t.dir);for(let o of t.statements)Se(o,r)},"populate"),Se=e((t,r)=>{let c={Commit:e((i)=>r.commit(Ne(i)),"Commit"),Branch:e((i)=>r.branch(Fe(i)),"Branch"),Merge:e((i)=>r.merge(ze(i)),"Merge"),Checkout:e((i)=>r.checkout(Ye(i)),"Checkout"),CherryPicking:e((i)=>r.cherryPick(je(i)),"CherryPicking")}[t.$type];if(c)c(t);else a.error(`Unknown statement type: ${t.$type}`)},"parseStatement"),Ne=e((t)=>({id:t.id,msg:t.message??"",type:t.type!==void 0?k[t.type]:k.NORMAL,tags:t.tags??void 0}),"parseCommit"),Fe=e((t)=>({name:t.name,order:t.order??0}),"parseBranch"),ze=e((t)=>({branch:t.branch,id:t.id??"",type:t.type!==void 0?k[t.type]:void 0,tags:t.tags??void 0}),"parseMerge"),Ye=e((t)=>t.branch,"parseCheckout"),je=e((t)=>({id:t.id,targetId:"",tags:t.tags?.length===0?void 0:t.tags,parent:t.parent}),"parseCherryPicking"),Ke={parse:e(async(t)=>{let r=await X("gitGraph",t);a.debug(r),He(r,ue)},"parse")},j=10,K=40,N=4,z=2,V=8,ce=new Set(["redux","redux-dark","redux-color","redux-dark-color"]),le=12,ge=new Set(["redux-color","redux-dark-color"]),Ue=new Set(["dark","redux-dark","redux-dark-color","neo-dark"]),Z=e((t,r,o=!1)=>{if(o&&t>0)return(t-1)%(r-1)+1;return t%r},"calcColorIndex"),W=new Map,q=new Map,oe=30,te=new Map,se=[],Y=0,w="LR",Ve=e(()=>{W.clear(),q.clear(),te.clear(),Y=0,se=[],w="LR"},"clear"),be=e((t)=>{let r=document.createElementNS("http://www.w3.org/2000/svg","text");return(typeof t==="string"?t.split(/\\n|\n|<br\s*\/?>/gi):t).forEach((c)=>{let i=document.createElementNS("http://www.w3.org/2000/svg","tspan");i.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve"),i.setAttribute("dy","1em"),i.setAttribute("x","0"),i.setAttribute("class","row"),i.textContent=c.trim(),r.appendChild(i)}),r},"drawText"),we=e((t)=>{let r,o,c;if(w==="BT")o=e((i,h)=>i<=h,"comparisonFunc"),c=1/0;else o=e((i,h)=>i>=h,"comparisonFunc"),c=0;return t.forEach((i)=>{let h=w==="TB"||w=="BT"?q.get(i)?.y:q.get(i)?.x;if(h!==void 0&&o(h,c))r=i,c=h}),r},"findClosestParent"),Ze=e((t)=>{let r="",o=1/0;return t.forEach((c)=>{let i=q.get(c).y;if(i<=o)r=c,o=i}),r||void 0},"findClosestParentBT"),Xe=e((t,r,o)=>{let c=o,i=o,h=[];t.forEach((n)=>{let s=r.get(n);if(!s)throw Error(`Commit not found for key ${n}`);if(s.parents.length)c=Qe(s),i=Math.max(c,i);else h.push(s);et(s,c)}),c=i,h.forEach((n)=>{tt(n,c,o)}),t.forEach((n)=>{let s=r.get(n);if(s?.parents.length){let g=Ze(s.parents);if(c=q.get(g).y-K,c<=i)i=c;let y=W.get(s.branch).pos,x=c-j;q.set(s.id,{x:y,y:x})}})},"setParallelBTPos"),Je=e((t)=>{let r=we(t.parents.filter((c)=>c!==null));if(!r)throw Error(`Closest parent not found for commit ${t.id}`);let o=q.get(r)?.y;if(o===void 0)throw Error(`Closest parent position not found for commit ${t.id}`);return o},"findClosestParentPos"),Qe=e((t)=>Je(t)+K,"calculateCommitPosition"),et=e((t,r)=>{let o=W.get(t.branch);if(!o)throw Error(`Branch not found for commit ${t.id}`);let c=o.pos,i=r+j;return q.set(t.id,{x:c,y:i}),{x:c,y:i}},"setCommitPosition"),tt=e((t,r,o)=>{let c=W.get(t.branch);if(!c)throw Error(`Branch not found for commit ${t.id}`);let i=r+o,h=c.pos;q.set(t.id,{x:h,y:i})},"setRootPosition"),rt=e((t,r,o,c,i,h)=>{let{theme:n}=l(),s=ce.has(n??""),g=ge.has(n??""),y=Ue.has(n??"");if(h===k.HIGHLIGHT)t.append("rect").attr("x",o.x-10+(s?3:0)).attr("y",o.y-10+(s?3:0)).attr("width",s?14:20).attr("height",s?14:20).attr("class",`commit ${r.id} commit-highlight${Z(i,V,g)} ${c}-outer`),t.append("rect").attr("x",o.x-6+(s?2:0)).attr("y",o.y-6+(s?2:0)).attr("width",s?8:12).attr("height",s?8:12).attr("class",`commit ${r.id} commit${Z(i,V,g)} ${c}-inner`);else if(h===k.CHERRY_PICK)t.append("circle").attr("cx",o.x).attr("cy",o.y).attr("r",s?7:10).attr("class",`commit ${r.id} ${c}`),t.append("circle").attr("cx",o.x-3).attr("cy",o.y+2).attr("r",s?2.5:2.75).attr("fill",y?"#000000":"#fff").attr("class",`commit ${r.id} ${c}`),t.append("circle").attr("cx",o.x+3).attr("cy",o.y+2).attr("r",s?2.5:2.75).attr("fill",y?"#000000":"#fff").attr("class",`commit ${r.id} ${c}`),t.append("line").attr("x1",o.x+3).attr("y1",o.y+1).attr("x2",o.x).attr("y2",o.y-5).attr("stroke",y?"#000000":"#fff").attr("class",`commit ${r.id} ${c}`),t.append("line").attr("x1",o.x-3).attr("y1",o.y+1).attr("x2",o.x).attr("y2",o.y-5).attr("stroke",y?"#000000":"#fff").attr("class",`commit ${r.id} ${c}`);else{let x=t.append("circle");if(x.attr("cx",o.x),x.attr("cy",o.y),x.attr("r",s?7:10),x.attr("class",`commit ${r.id} commit${Z(i,V,g)}`),h===k.MERGE){let f=t.append("circle");f.attr("cx",o.x),f.attr("cy",o.y),f.attr("r",s?5:6),f.attr("class",`commit ${c} ${r.id} commit${Z(i,V,g)}`)}if(h===k.REVERSE){let f=t.append("path"),d=s?4:5;f.attr("d",`M ${o.x-d},${o.y-d}L${o.x+d},${o.y+d}M${o.x-d},${o.y+d}L${o.x+d},${o.y-d}`).attr("class",`commit ${c} ${r.id} commit${Z(i,V,g)}`)}}},"drawCommitBullet"),at=e((t,r,o,c,i)=>{if(r.type!==k.CHERRY_PICK&&(r.customId&&r.type===k.MERGE||r.type!==k.MERGE)&&i.showCommitLabel){let h=t.append("g"),n=h.insert("rect").attr("class","commit-label-bkg"),s=h.append("text").attr("x",c).attr("y",o.y+25).attr("class","commit-label").text(r.id),g=s.node()?.getBBox();if(g){if(n.attr("x",o.posWithOffset-g.width/2-z).attr("y",o.y+13.5).attr("width",g.width+2*z).attr("height",g.height+2*z),w==="TB"||w==="BT")n.attr("x",o.x-(g.width+4*N+5)).attr("y",o.y-12),s.attr("x",o.x-(g.width+4*N)).attr("y",o.y+g.height-12);else s.attr("x",o.posWithOffset-g.width/2);if(i.rotateCommitLabel)if(w==="TB"||w==="BT")s.attr("transform","rotate(-45, "+o.x+", "+o.y+")"),n.attr("transform","rotate(-45, "+o.x+", "+o.y+")");else{let y=-7.5-(g.width+10)/25*9.5,x=10+g.width/25*8.5;h.attr("transform","translate("+y+", "+x+") rotate(-45, "+c+", "+o.y+")")}}}},"drawCommitLabel"),ot=e((t,r,o,c)=>{if(r.tags.length>0){let i=0,h=0,n=0,s=[];for(let g of r.tags.reverse()){let y=t.insert("polygon"),x=t.append("circle"),f=t.append("text").attr("y",o.y-16-i).attr("class","tag-label").text(g),d=f.node()?.getBBox();if(!d)throw Error("Tag bbox not found");h=Math.max(h,d.width),n=Math.max(n,d.height),f.attr("x",o.posWithOffset-d.width/2),s.push({tag:f,hole:x,rect:y,yOffset:i}),i+=20}for(let{tag:g,hole:y,rect:x,yOffset:f}of s){let d=n/2,B=o.y-19.2-f;if(x.attr("class","tag-label-bkg").attr("points",`
|
|
2
|
-
${c-h/2-N/2},${B+z}
|
|
3
|
-
${c-h/2-N/2},${B-z}
|
|
4
|
-
${o.posWithOffset-h/2-N},${B-d-z}
|
|
5
|
-
${o.posWithOffset+h/2+N},${B-d-z}
|
|
6
|
-
${o.posWithOffset+h/2+N},${B+d+z}
|
|
7
|
-
${o.posWithOffset-h/2-N},${B+d+z}`),y.attr("cy",B).attr("cx",c-h/2+N/2).attr("r",1.5).attr("class","tag-hole"),w==="TB"||w==="BT"){let u=c+f;x.attr("class","tag-label-bkg").attr("points",`
|
|
8
|
-
${o.x},${u+2}
|
|
9
|
-
${o.x},${u-2}
|
|
10
|
-
${o.x+j},${u-d-2}
|
|
11
|
-
${o.x+j+h+4},${u-d-2}
|
|
12
|
-
${o.x+j+h+4},${u+d+2}
|
|
13
|
-
${o.x+j},${u+d+2}`).attr("transform","translate(12,12) rotate(45, "+o.x+","+c+")"),y.attr("cx",o.x+N/2).attr("cy",u).attr("transform","translate(12,12) rotate(45, "+o.x+","+c+")"),g.attr("x",o.x+5).attr("y",u+3).attr("transform","translate(14,14) rotate(45, "+o.x+","+c+")")}}}},"drawCommitTags"),st=e((t)=>{switch(t.customType??t.type){case k.NORMAL:return"commit-normal";case k.REVERSE:return"commit-reverse";case k.HIGHLIGHT:return"commit-highlight";case k.MERGE:return"commit-merge";case k.CHERRY_PICK:return"commit-cherry-pick";default:return"commit-normal"}},"getCommitClassType"),nt=e((t,r,o,c)=>{let i={x:0,y:0};if(t.parents.length>0){let h=we(t.parents);if(h){let n=c.get(h)??i;if(r==="TB")return n.y+K;else if(r==="BT")return(c.get(t.id)??i).y-K;else return n.x+K}}else if(r==="TB")return oe;else if(r==="BT")return(c.get(t.id)??i).y-K;else return 0;return 0},"calculatePosition"),ct=e((t,r,o)=>{let c=w==="BT"&&o?r:r+j,i=W.get(t.branch)?.pos,h=w==="TB"||w==="BT"?W.get(t.branch)?.pos:c;if(h===void 0||i===void 0)throw Error(`Position were undefined for commit ${t.id}`);let n=ce.has(l().theme??""),s=w==="TB"||w==="BT"?c:i+(n?le/2+1:-2);return{x:h,y:s,posWithOffset:c}},"getCommitPosition"),$e=e((t,r,o,c)=>{let i=t.append("g").attr("class","commit-bullets"),h=t.append("g").attr("class","commit-labels"),n=w==="TB"||w==="BT"?oe:0,s=[...r.keys()],g=c.parallelCommits??!1,y=e((f,d)=>{let B=r.get(f)?.seq,u=r.get(d)?.seq;return B!==void 0&&u!==void 0?B-u:0},"sortKeys"),x=s.sort(y);if(w==="BT"){if(g)Xe(x,r,n);x=x.reverse()}x.forEach((f)=>{let d=r.get(f);if(!d)throw Error(`Commit not found for key ${f}`);if(g)n=nt(d,w,n,q);let B=ct(d,n,g);if(o){let u=st(d),P=d.customType??d.type,O=W.get(d.branch)?.index??0;rt(i,d,B,u,O,P),at(h,d,B,n,c),ot(h,d,B,n)}if(w==="TB"||w==="BT")q.set(d.id,{x:B.x,y:B.posWithOffset});else q.set(d.id,{x:B.posWithOffset,y:B.y});if(n=w==="BT"&&g?n+K:n+K+j,n>Y)Y=n})},"drawCommits"),it=e((t,r,o,c,i)=>{let n=(w==="TB"||w==="BT"?o.x<c.x:o.y<c.y)?r.branch:t.branch,s=e((y)=>y.branch===n,"isOnBranchToGetCurve"),g=e((y)=>y.seq>t.seq&&y.seq<r.seq,"isBetweenCommits");return[...i.values()].some((y)=>g(y)&&s(y))},"shouldRerouteArrow"),re=e((t,r,o=0)=>{let c=t+Math.abs(t-r)/2;if(o>5)return c;if(se.every((n)=>Math.abs(n-c)>=10))return se.push(c),c;let h=Math.abs(t-r);return re(t,r-h/5,o+1)},"findLane"),dt=e((t,r,o,c)=>{let{theme:i}=l(),h=ge.has(i??""),n=q.get(r.id),s=q.get(o.id);if(n===void 0||s===void 0)throw Error(`Commit positions not found for commits ${r.id} and ${o.id}`);let g=it(r,o,n,s,c),y="",x="",f=0,d=0,B=W.get(o.branch)?.index;if(o.type===k.MERGE&&r.id!==o.parents[0])B=W.get(r.branch)?.index;let u;if(g){y="A 10 10, 0, 0, 0,",x="A 10 10, 0, 0, 1,",f=10,d=10;let P=n.y<s.y?re(n.y,s.y):re(s.y,n.y),O=n.x<s.x?re(n.x,s.x):re(s.x,n.x);if(w==="TB")if(n.x<s.x)u=`M ${n.x} ${n.y} L ${O-f} ${n.y} ${x} ${O} ${n.y+d} L ${O} ${s.y-f} ${y} ${O+d} ${s.y} L ${s.x} ${s.y}`;else B=W.get(r.branch)?.index,u=`M ${n.x} ${n.y} L ${O+f} ${n.y} ${y} ${O} ${n.y+d} L ${O} ${s.y-f} ${x} ${O-d} ${s.y} L ${s.x} ${s.y}`;else if(w==="BT")if(n.x<s.x)u=`M ${n.x} ${n.y} L ${O-f} ${n.y} ${y} ${O} ${n.y-d} L ${O} ${s.y+f} ${x} ${O+d} ${s.y} L ${s.x} ${s.y}`;else B=W.get(r.branch)?.index,u=`M ${n.x} ${n.y} L ${O+f} ${n.y} ${x} ${O} ${n.y-d} L ${O} ${s.y+f} ${y} ${O-d} ${s.y} L ${s.x} ${s.y}`;else if(n.y<s.y)u=`M ${n.x} ${n.y} L ${n.x} ${P-f} ${y} ${n.x+d} ${P} L ${s.x-f} ${P} ${x} ${s.x} ${P+d} L ${s.x} ${s.y}`;else B=W.get(r.branch)?.index,u=`M ${n.x} ${n.y} L ${n.x} ${P+f} ${x} ${n.x+d} ${P} L ${s.x-f} ${P} ${y} ${s.x} ${P-d} L ${s.x} ${s.y}`}else if(y="A 20 20, 0, 0, 0,",x="A 20 20, 0, 0, 1,",f=20,d=20,w==="TB"){if(n.x<s.x)if(o.type===k.MERGE&&r.id!==o.parents[0])u=`M ${n.x} ${n.y} L ${n.x} ${s.y-f} ${y} ${n.x+d} ${s.y} L ${s.x} ${s.y}`;else u=`M ${n.x} ${n.y} L ${s.x-f} ${n.y} ${x} ${s.x} ${n.y+d} L ${s.x} ${s.y}`;if(n.x>s.x)if(y="A 20 20, 0, 0, 0,",x="A 20 20, 0, 0, 1,",f=20,d=20,o.type===k.MERGE&&r.id!==o.parents[0])u=`M ${n.x} ${n.y} L ${n.x} ${s.y-f} ${x} ${n.x-d} ${s.y} L ${s.x} ${s.y}`;else u=`M ${n.x} ${n.y} L ${s.x+f} ${n.y} ${y} ${s.x} ${n.y+d} L ${s.x} ${s.y}`;if(n.x===s.x)u=`M ${n.x} ${n.y} L ${s.x} ${s.y}`}else if(w==="BT"){if(n.x<s.x)if(o.type===k.MERGE&&r.id!==o.parents[0])u=`M ${n.x} ${n.y} L ${n.x} ${s.y+f} ${x} ${n.x+d} ${s.y} L ${s.x} ${s.y}`;else u=`M ${n.x} ${n.y} L ${s.x-f} ${n.y} ${y} ${s.x} ${n.y-d} L ${s.x} ${s.y}`;if(n.x>s.x)if(y="A 20 20, 0, 0, 0,",x="A 20 20, 0, 0, 1,",f=20,d=20,o.type===k.MERGE&&r.id!==o.parents[0])u=`M ${n.x} ${n.y} L ${n.x} ${s.y+f} ${y} ${n.x-d} ${s.y} L ${s.x} ${s.y}`;else u=`M ${n.x} ${n.y} L ${s.x+f} ${n.y} ${x} ${s.x} ${n.y-d} L ${s.x} ${s.y}`;if(n.x===s.x)u=`M ${n.x} ${n.y} L ${s.x} ${s.y}`}else{if(n.y<s.y)if(o.type===k.MERGE&&r.id!==o.parents[0])u=`M ${n.x} ${n.y} L ${s.x-f} ${n.y} ${x} ${s.x} ${n.y+d} L ${s.x} ${s.y}`;else u=`M ${n.x} ${n.y} L ${n.x} ${s.y-f} ${y} ${n.x+d} ${s.y} L ${s.x} ${s.y}`;if(n.y>s.y)if(o.type===k.MERGE&&r.id!==o.parents[0])u=`M ${n.x} ${n.y} L ${s.x-f} ${n.y} ${y} ${s.x} ${n.y-d} L ${s.x} ${s.y}`;else u=`M ${n.x} ${n.y} L ${n.x} ${s.y+f} ${x} ${n.x+d} ${s.y} L ${s.x} ${s.y}`;if(n.y===s.y)u=`M ${n.x} ${n.y} L ${s.x} ${s.y}`}if(u===void 0)throw Error("Line definition not found");t.append("path").attr("d",u).attr("class","arrow arrow"+Z(B,V,h))},"drawArrow"),ht=e((t,r)=>{let o=t.append("g").attr("class","commit-arrows");[...r.keys()].forEach((c)=>{let i=r.get(c);if(i.parents&&i.parents.length>0)i.parents.forEach((h)=>{dt(o,r.get(h),i,r)})})},"drawArrows"),lt=e((t,r,o,c)=>{let{look:i,theme:h,themeVariables:n}=l(),{dropShadow:s,THEME_COLOR_LIMIT:g}=n,y=ce.has(h??""),x=ge.has(h??""),f=t.append("g");r.forEach((d,B)=>{let u=Z(B,y?g:V,x),P=W.get(d.name)?.pos;if(P===void 0)throw Error(`Position not found for branch ${d.name}`);let O=w==="TB"||w==="BT"?P:y?P+le/2+1:P-2,I=f.append("line");if(I.attr("x1",0),I.attr("y1",O),I.attr("x2",Y),I.attr("y2",O),I.attr("class","branch branch"+u),w==="TB")I.attr("y1",oe),I.attr("x1",P),I.attr("y2",Y),I.attr("x2",P);else if(w==="BT")I.attr("y1",Y),I.attr("x1",P),I.attr("y2",oe),I.attr("x2",P);se.push(O);let ie=d.name,ee=be(ie),H=f.insert("rect"),F=f.insert("g").attr("class","branchLabel").insert("g").attr("class","label branch-label"+u);F.node().appendChild(ee);let _=ee.getBBox(),fe=y?0:4,ae=y?16:0,Q=y?le:0;if(i==="neo")H.attr("data-look","neo");if(H.attr("class","branchLabelBkg label"+u).attr("style",i==="neo"?`filter:${y?`url(#${c}-drop-shadow)`:s}`:"").attr("rx",fe).attr("ry",fe).attr("x",-_.width-4-(o.rotateCommitLabel===!0?30:0)).attr("y",-_.height/2+10).attr("width",_.width+18+ae).attr("height",_.height+4+Q),F.attr("transform","translate("+(-_.width-14-(o.rotateCommitLabel===!0?30:0)+ae/2)+", "+(O-_.height/2-2)+")"),w==="TB"){if(H.attr("x",P-_.width/2-10).attr("y",0),F.attr("transform","translate("+(P-_.width/2-5)+", 0)"),y)H.attr("transform",`translate(${-ae/2-3}, ${-Q-10})`),F.attr("transform","translate("+(P-_.width/2-5)+", "+(-Q*2+7)+")")}else if(w==="BT"){if(H.attr("x",P-_.width/2-10).attr("y",Y),F.attr("transform","translate("+(P-_.width/2-5)+", "+Y+")"),y)H.attr("transform",`translate(${-ae/2-3}, ${Q+10})`),F.attr("transform","translate("+(P-_.width/2-5)+", "+(Y+Q*2+4)+")")}else H.attr("transform","translate(-19, "+(O-12-Q/2)+")")})},"drawBranches"),mt=e(function(t,r,o,c,i){return W.set(t,{pos:r,index:o}),r+=50+(i?40:0)+(w==="TB"||w==="BT"?c.width/2:0),r},"setBranchPosition"),gt=e(function(t,r,o,c){Ve(),a.debug("in gitgraph renderer",t+`
|
|
14
|
-
`,"id:",r,o);let i=c.db;if(!i.getConfig){a.error("getConfig method is not available on db");return}let h=i.getConfig(),n=h.rotateCommitLabel??!1;te=i.getCommits();let s=i.getBranchesAsObjArray();w=i.getDirection();let g=p(`[id="${r}"]`),{look:y,theme:x,themeVariables:f}=l(),{useGradient:d,gradientStart:B,gradientStop:u,filterColor:P}=f;if(d){let I=g.append("defs").append("linearGradient").attr("id",r+"-gradient").attr("gradientUnits","objectBoundingBox").attr("x1","0%").attr("y1","0%").attr("x2","100%").attr("y2","0%");I.append("stop").attr("offset","0%").attr("stop-color",B).attr("stop-opacity",1),I.append("stop").attr("offset","100%").attr("stop-color",u).attr("stop-opacity",1)}if(y==="neo"&&ce.has(x??""))g.append("defs").append("filter").attr("id",r+"-drop-shadow").attr("height","130%").attr("width","130%").append("feDropShadow").attr("dx","4").attr("dy","4").attr("stdDeviation",0).attr("flood-opacity","0.06").attr("flood-color",P);let O=0;if(s.forEach((I,ie)=>{let ee=be(I.name),H=g.append("g"),de=H.insert("g").attr("class","branchLabel"),F=de.insert("g").attr("class","label branch-label");F.node()?.appendChild(ee);let _=ee.getBBox();O=mt(I.name,O,ie,_,n),F.remove(),de.remove(),H.remove()}),$e(g,te,!1,h),h.showBranches)lt(g,s,h,r);ht(g,te),$e(g,te,!0,h),M.insertTitle(g,"gitTitleText",h.titleTopMargin??0,i.getDiagramTitle()),kr(void 0,g,h.diagramPadding,h.useMaxWidth)},"draw"),ft={draw:gt},Be=8,ke=new Set(["redux","redux-dark","redux-color","redux-dark-color"]),$t=new Set(["redux-color","redux-dark-color"]),pt=new Set(["neo","neo-dark"]),yt=new Set(["dark","redux-dark","redux-dark-color","neo-dark"]),xt=new Set(["redux","redux-dark","redux-color","redux-dark-color","neo","neo-dark"]),ut=e((t)=>{let{svgId:r}=t,o="";if(t.useGradient&&r)for(let c=0;c<t.THEME_COLOR_LIMIT;c++)o+=`
|
|
15
|
-
.label${c} { fill: ${t.mainBkg}; stroke: url(${r}-gradient); stroke-width: ${t.strokeWidth};}
|
|
16
|
-
`;return o},"genGitGraphGradient"),bt=e((t)=>{let r=b(),{theme:o,themeVariables:c}=r,{borderColorArray:i}=c,h=ke.has(o);if(pt.has(o)){let n="";for(let s=0;s<t.THEME_COLOR_LIMIT;s++)if(s===0)n+=`
|
|
17
|
-
.branch-label${s} { fill: ${t.nodeBorder};}
|
|
18
|
-
.commit${s} { stroke: ${t.nodeBorder}; }
|
|
19
|
-
.commit-highlight${s} { stroke: ${t.nodeBorder}; fill: ${t.nodeBorder}; }
|
|
20
|
-
.arrow${s} { stroke: ${t.nodeBorder}; }
|
|
21
|
-
.commit-bullets { fill: ${t.nodeBorder}; }
|
|
22
|
-
.commit-cherry-pick${s} { stroke: ${t.nodeBorder}; }
|
|
23
|
-
${ut(t)}`;else{let g=s%Be;n+=`
|
|
24
|
-
.branch-label${s} { fill: ${t["gitBranchLabel"+g]}; }
|
|
25
|
-
.commit${s} { stroke: ${t["git"+g]}; fill: ${t["git"+g]}; }
|
|
26
|
-
.commit-highlight${s} { stroke: ${t["gitInv"+g]}; fill: ${t["gitInv"+g]}; }
|
|
27
|
-
.arrow${s} { stroke: ${t["git"+g]}; }
|
|
28
|
-
`}return n}else if(!$t.has(o)){let n="";for(let s=0;s<t.THEME_COLOR_LIMIT;s++)n+=`
|
|
29
|
-
.branch-label${s} { fill: ${t.nodeBorder}; ${h?`font-weight:${t.noteFontWeight}`:""} }
|
|
30
|
-
.commit${s} { stroke: ${t.nodeBorder}; }
|
|
31
|
-
.commit-highlight${s} { stroke: ${t.nodeBorder}; fill: ${t.nodeBorder}; }
|
|
32
|
-
.label${s} { fill: ${t.mainBkg}; stroke: ${t.nodeBorder}; stroke-width: ${t.strokeWidth}; ${h?`font-weight:${t.noteFontWeight}`:""}}
|
|
33
|
-
.arrow${s} { stroke: ${t.nodeBorder}; }
|
|
34
|
-
.commit-bullets { fill: ${t.nodeBorder}; }
|
|
35
|
-
.commit-cherry-pick${s} { stroke: ${t.nodeBorder}; }
|
|
36
|
-
`;return n}else{let n="";for(let s=0;s<t.THEME_COLOR_LIMIT;s++)if(s===0)n+=`
|
|
37
|
-
.branch-label${s} { fill: ${t.nodeBorder}; ${h?`font-weight:${t.noteFontWeight}`:""} }
|
|
38
|
-
.commit${s} { stroke: ${t.nodeBorder}; }
|
|
39
|
-
.commit-highlight${s} { stroke: ${t.nodeBorder}; fill: ${t.mainBkg}; }
|
|
40
|
-
.label${s} { fill: ${t.mainBkg}; stroke: ${t.nodeBorder}; stroke-width: ${t.strokeWidth}; ${h?`font-weight:${t.noteFontWeight}`:""} }
|
|
41
|
-
.arrow${s} { stroke: ${t.nodeBorder}; }
|
|
42
|
-
.commit-bullets { fill: ${t.nodeBorder}; }
|
|
43
|
-
`;else{let g=s%i.length;n+=`
|
|
44
|
-
.branch-label${s} { fill: ${t.nodeBorder}; ${h?`font-weight:${t.noteFontWeight}`:""} }
|
|
45
|
-
.commit${s} { stroke: ${i[g]}; fill: ${i[g]}; }
|
|
46
|
-
.commit-highlight${s} { stroke: ${i[g]}; fill: ${i[g]}; }
|
|
47
|
-
.label${s} { fill: ${yt.has(o)?t.mainBkg:i[g]}; stroke: ${i[g]}; stroke-width: ${t.strokeWidth}; }
|
|
48
|
-
.arrow${s} { stroke: ${i[g]}; }
|
|
49
|
-
`}return n}},"genColor"),wt=e((t)=>`${Array.from({length:t.THEME_COLOR_LIMIT},(r,o)=>o).map((r)=>{let o=r%Be;return`
|
|
50
|
-
.branch-label${r} { fill: ${t["gitBranchLabel"+o]}; }
|
|
51
|
-
.commit${r} { stroke: ${t["git"+o]}; fill: ${t["git"+o]}; }
|
|
52
|
-
.commit-highlight${r} { stroke: ${t["gitInv"+o]}; fill: ${t["gitInv"+o]}; }
|
|
53
|
-
.label${r} { fill: ${t["git"+o]}; }
|
|
54
|
-
.arrow${r} { stroke: ${t["git"+o]}; }
|
|
55
|
-
`}).join(`
|
|
56
|
-
`)}`,"normalTheme"),Bt=e((t)=>{let r=b(),{theme:o}=r,c=xt.has(o);return`
|
|
57
|
-
.commit-id,
|
|
58
|
-
.commit-msg,
|
|
59
|
-
.branch-label {
|
|
60
|
-
fill: lightgrey;
|
|
61
|
-
color: lightgrey;
|
|
62
|
-
font-family: 'trebuchet ms', verdana, arial, sans-serif;
|
|
63
|
-
font-family: var(--mermaid-font-family);
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
${c?bt(t):wt(t)}
|
|
67
|
-
|
|
68
|
-
.branch {
|
|
69
|
-
stroke-width: ${t.strokeWidth};
|
|
70
|
-
stroke: ${t.commitLineColor??t.lineColor};
|
|
71
|
-
stroke-dasharray: ${c?"4 2":"2"};
|
|
72
|
-
}
|
|
73
|
-
.commit-label { font-size: ${t.commitLabelFontSize}; fill: ${c?t.nodeBorder:t.commitLabelColor}; ${c?`font-weight:${t.noteFontWeight};`:""}}
|
|
74
|
-
.commit-label-bkg { font-size: ${t.commitLabelFontSize}; fill: ${c?"transparent":t.commitLabelBackground}; opacity: ${c?"":0.5}; }
|
|
75
|
-
.tag-label { font-size: ${t.tagLabelFontSize}; fill: ${t.tagLabelColor};}
|
|
76
|
-
.tag-label-bkg { fill: ${c?t.mainBkg:t.tagLabelBackground}; stroke: ${c?t.nodeBorder:t.tagLabelBorder}; ${c?`filter:${t.dropShadow}`:""} }
|
|
77
|
-
.tag-hole { fill: ${t.textColor}; }
|
|
78
|
-
|
|
79
|
-
.commit-merge {
|
|
80
|
-
stroke: ${c?t.mainBkg:t.primaryColor};
|
|
81
|
-
fill: ${c?t.mainBkg:t.primaryColor};
|
|
82
|
-
}
|
|
83
|
-
.commit-reverse {
|
|
84
|
-
stroke: ${c?t.mainBkg:t.primaryColor};
|
|
85
|
-
fill: ${c?t.mainBkg:t.primaryColor};
|
|
86
|
-
stroke-width: ${c?t.strokeWidth:3};
|
|
87
|
-
}
|
|
88
|
-
.commit-highlight-outer {
|
|
89
|
-
}
|
|
90
|
-
.commit-highlight-inner {
|
|
91
|
-
stroke: ${c?t.mainBkg:t.primaryColor};
|
|
92
|
-
fill: ${c?t.mainBkg:t.primaryColor};
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
.arrow {
|
|
96
|
-
/* Intentional: neo themes keep the bold 8px arrow (like classic themes); only redux-geometry themes use the thinner options.strokeWidth. */
|
|
97
|
-
stroke-width: ${ke.has(o)?t.strokeWidth:8};
|
|
98
|
-
stroke-linecap: round;
|
|
99
|
-
fill: none
|
|
100
|
-
}
|
|
101
|
-
.gitTitleText {
|
|
102
|
-
text-anchor: middle;
|
|
103
|
-
font-size: 18px;
|
|
104
|
-
fill: ${t.textColor};
|
|
105
|
-
}
|
|
106
|
-
`},"getStyles"),kt=Bt,Ot={parser:Ke,db:ue,renderer:ft,styles:kt};export{Ot as diagram};
|
package/web/chunk-mh4rx5cf.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{ir}from"./chunk-2cem4sv7.js";export{ir as createRailroadEbnfServices};
|
package/web/chunk-mz9b5bsa.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{mi}from"./chunk-fv6vm14n.js";export{mi as default};
|
package/web/chunk-n448vaba.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{e,a}from"./chunk-1s53190z.js";import{K,Dt,Mt}from"./chunk-2b63adsj.js";import{G}from"./chunk-14deqqhr.js";import{ar,kt}from"./chunk-2cem4sv7.js";var o=ar().Railroad.parser.LangiumParser,n=e((r)=>{switch(r.$type){case"RailroadTerminalExpr":return{type:"terminal",value:r.value};case"RailroadNonTerminalExpr":return{type:"nonterminal",name:r.name};case"RailroadSpecialExpr":return{type:"special",text:r.text};case"RailroadSequenceExpr":{let t=r.elements.map(n);return t.length===1?t[0]:{type:"sequence",elements:t}}case"RailroadChoiceExpr":{let t=r.alternatives.map(n);return t.length===1?t[0]:{type:"choice",alternatives:t}}case"RailroadOptionalExpr":return{type:"optional",element:n(r.element)};case"RailroadOneOrMoreExpr":return{type:"repetition",element:n(r.element),min:1,max:1/0};case"RailroadZeroOrMoreExpr":return{type:"repetition",element:n(r.element),min:0,max:1/0};default:throw Error(`Unsupported railroad expression: ${r.$type}`)}},"transformExpression"),l=e((r)=>({name:r.name,definition:n(r.definition)}),"transformRule"),s=e((r)=>{if(G(r,K),r.title)K.setTitle(r.title);r.rules.map((t)=>K.addRule(l(t)))},"populateDb"),m={parse:e((r)=>{K.clear(),a.debug("[Railroad Parser] Starting Langium parse");let t=o.parse(r);if(t.lexerErrors.length>0||t.parserErrors.length>0)throw new kt(t);let i=t.value;a.debug("[Railroad Parser] Parsed rules:",i.rules.length),s(i),a.debug("[Railroad Parser] Parse complete")},"parse"),parser:{yy:K}},R={parser:m,db:K,renderer:Mt,styles:Dt};export{R as diagram};
|
package/web/chunk-n8j88qxy.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{Ei}from"./chunk-2cem4sv7.js";export{Ei as createEventModelingServices};
|
package/web/chunk-nmpbsvwb.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{o,r,g,t,n,_,rn,qt,ve,Le}from"./chunk-rddft5ce.js";var L={running:"运行中",waiting:"等待回答",context_exhausted:"上下文耗尽",done:"完成",error:"失败",failed:"失败",aborted:"已取消",cancelled:"已取消",interrupted:"已中断"},W={running:"warning",waiting:"warning",context_exhausted:"warning",done:"success",error:"danger",failed:"danger",aborted:"neutral",cancelled:"neutral",interrupted:"warning"},N=(a)=>a>=1000?`${(a/1000).toFixed(a>=1e4?0:1)}k`:String(a),H=(a)=>a>=60000?`${Math.floor(a/60000)} 分 ${Math.round(a%60000/1000)} 秒`:`${Math.round(a/1000)} 秒`;function X(a){let{Button:I,Panel:R,StatusChip:T,Markdown:z,ModelIcon:M,cn:c,style:B,useTheme:U}=_();U();let{connection:x,sessionID:f,payload:A,onOpen:E}=a,e=A,[s,Q]=r(),[k,b]=r(),[S,C]=r(!1),[d,q]=r(!1),[F,O]=r(!1),p=F||e.state==="aborted"||e.state==="cancelled",m=p?"aborted":e.state,u=(e.state==="running"||e.state==="waiting")&&!p;o(()=>{let i,v=!1,D=()=>{x.request(`/api/sessions/${encodeURIComponent(f)}/tasks/${encodeURIComponent(e.childSessionID)}`).then((h)=>{if(!v)Q(h),b(void 0)}).catch((h)=>{if(!v)b(h instanceof Error?h.message:"任务详情加载失败")})};if(D(),u)i=setInterval(D,1500);return()=>{if(v=!0,i)clearInterval(i)}},[x,f,e.childSessionID,u]);let j=async()=>{if(S)return;C(!0);try{await x.request(`/api/sessions/${encodeURIComponent(f)}/tasks/${encodeURIComponent(e.childSessionID)}/kill`,{method:"POST"}),O(!0)}catch(i){b(i instanceof Error?i.message:"取消任务失败")}finally{C(!1)}},l=e.summary?.trim()||e.handoff?.conclusion.trim()||"",w=l.length>360||l.split(`
|
|
2
|
-
`).length>8,y=[s&&u&&s.lastTool&&`最近 ${s.lastTool}`,s&&H(s.elapsedMs),s&&`输入 ${N(s.usage.input)}`,s&&`输出 ${N(s.usage.output)}`,s&&s.usage.cacheRead>0&&`缓存 ${N(s.usage.cacheRead)}`,s&&s.usage.cost>0&&`$${s.usage.cost.toFixed(4)}`].filter(Boolean),G=Boolean(l||e.state==="waiting"&&!p||k),P=e.model||s?.session.model;return t(R,{className:"my-2 animate-fade",header:n(g,{children:[P?t(M,{modelID:P,className:"size-3.5 shrink-0",size:14}):t(Le,{className:c("size-3.5 shrink-0",u?"text-warning":"text-faint")}),t("h4",{className:"truncate font-medium text-ink",title:e.description,children:e.description}),y.length>0&&n("span",{className:"min-w-0 truncate text-faint tabular-nums",title:y.join(" · "),children:["· ",y.join(" · ")]})]}),actions:n(g,{children:[t(T,{tone:W[m]??"neutral",pulse:m==="running",children:L[m]??m}),u&&t(I,{size:"sm",variant:"danger-ghost",className:"h-6 rounded-md px-2 text-xs",disabled:S,onClick:()=>{j()},children:"取消"}),n(I,{size:"sm",variant:"ghost",className:"h-6 gap-1 rounded-md px-2 text-xs text-faint hover:text-ink",onClick:()=>E(e.childSessionID),children:["进入子会话",t(qt,{className:"size-3.5"})]})]}),children:G&&n(g,{children:[e.state==="waiting"&&!p&&n("div",{className:c("px-4 py-3",l&&"border-b border-line"),children:[n("p",{className:"flex items-center gap-1.5 text-xs font-medium text-warning",children:[t(rn,{className:"size-3.5"}),"子任务向主代理提问,等待回答"]}),e.pendingQuestions&&e.pendingQuestions.length>0&&t("ul",{className:"mt-1.5 flex flex-col gap-1 text-[13px] leading-relaxed text-ink",children:e.pendingQuestions.map((i)=>t("li",{className:"break-words",children:i.text},i.askedAt))})]}),l&&n("div",{className:"px-4 py-3",children:[n("div",{className:c("relative text-[13.5px] leading-[1.65] break-words text-ink/90 overflow-hidden transition-[max-height] duration-300 ease-out-quint [&_p]:my-1.5 [&>*:first-child]:mt-0 [&>*:last-child]:mb-0",w&&!d?"max-h-40":"max-h-[1800px]"),children:[t(z,{text:l}),w&&t("div",{className:c("pointer-events-none absolute inset-x-0 bottom-0 h-10 bg-gradient-to-t from-panel via-panel/70 to-transparent transition-opacity duration-300",d?"opacity-0":"opacity-100")})]}),w&&n("button",{type:"button",className:B("chat.timelineRow","cursor-pointer select-none"),onClick:()=>q(!d),children:[t("span",{children:d?"收起":"展开全部"}),t(ve,{className:c("size-3.5 transition-transform duration-300 ease-out-quint",d&&"rotate-180")})]})]}),k&&t("p",{role:"status",className:"px-4 py-2.5 text-xs text-danger",children:k})]})})}export{X as TaskCard};
|
package/web/chunk-nws1s56b.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{Ti}from"./chunk-2cem4sv7.js";export{Ti as createArchitectureServices};
|
package/web/chunk-p7126wwy.js
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import{h,o,y,i,r,g,t,n,_,rt}from"./chunk-rddft5ce.js";var U="__chat__";function N(a){if(!Number.isFinite(a)||a<=0)return"0";if(a<1000)return Math.round(a).toString();if(a<1e6)return`${(a/1000).toFixed(1)}K`;if(a<1e9)return`${(a/1e6).toFixed(2)}M`;return`${(a/1e9).toFixed(2)}B`}function B(a){let c=Number.isFinite(a)?Math.max(0,a):0;return Math.round(c).toLocaleString("en-US")}function P(a){if(!Number.isFinite(a)||a<=0)return"0s";if(a<1000)return"<1s";if(a<60000)return`${Math.floor(a/1000)}s`;if(a<3600000){let u=Math.floor(a/1000),e=Math.floor(u/60),d=u%60;return d>0?`${e}m ${d}s`:`${e}m`}if(a<259200000){let u=Math.floor(a/60000),e=Math.floor(u/60),d=u%60;return d>0?`${e}h ${d}m`:`${e}h`}let c=Math.floor(a/3600000),x=Math.floor(c/24),p=c%24;return p>0?`${x}d ${p}h`:`${x}d`}function X(a){if(!Number.isFinite(a)||a<=0)return"0s";if(a<1000)return"<1s";if(a<60000)return`${Math.round(a/1000)}s`;if(a<3600000)return`${Math.round(a/60000)}m`;if(a<86400000){let p=a/3600000;return`${p>=10?Math.round(p).toString():p.toFixed(1).replace(/\.0$/,"")}h`}let c=a/86400000;return`${c>=10?Math.round(c).toString():c.toFixed(1).replace(/\.0$/,"")}d`}function L(a,c=1){if(!Number.isFinite(a)||a<=0)return"0%";let x=10**-c/100;if(a<x)return`<${(x*100).toFixed(c)}%`;return`${(a*100).toFixed(c)}%`}function K(a){if(!Number.isFinite(a)||a<=0)return"0 B";if(a<1024)return`${Math.round(a)} B`;if(a<1048576)return`${(a/1024).toFixed(1)} KB`;if(a<1073741824)return`${(a/1048576).toFixed(2)} MB`;return`${(a/1073741824).toFixed(2)} GB`}function G(a){let c=a.split("-"),x=c[1],p=c[2];if(x!==void 0&&p!==void 0)return`${x}/${p}`;return a}function Y(a){let c=a.split("-"),x=c[0],p=c[1],u=c[2];if(x===void 0||p===void 0||u===void 0)return a;let e=Number(x),d=Number(p)-1,v=Number(u),w=new Date(Date.UTC(e,d,v)),R=["周日","周一","周二","周三","周四","周五","周六"],M=w.getUTCDay(),F=R[M]??"";return`${a} ${F}`}function ee(a,c=Date.now()){if(a===null||a===void 0||!Number.isFinite(a)||a<=0)return"从未";let x=Math.max(0,c-a);if(x<60000)return"刚刚";if(x<3600000)return`${Math.max(1,Math.floor(x/60000))} 分钟前`;if(x<86400000)return`${Math.max(1,Math.floor(x/3600000))} 小时前`;if(x<2592000000)return`${Math.max(1,Math.floor(x/86400000))} 天前`;let p=new Date(a),u=p.getFullYear(),e=String(p.getMonth()+1).padStart(2,"0"),d=String(p.getDate()).padStart(2,"0");return`${u}-${e}-${d}`}function te(a){let{projects:c,selectedProjectID:x,onSelectProject:p}=a,{style:u}=_();if(c.length===0)return t("div",{className:u("surface.empty"),children:"暂无项目统计数据"});return t("div",{className:"divide-y divide-line",children:c.map((e)=>{let d=e.projectID??U,v=x===d,w=Math.max(e.tokenShare>0?1:0,e.tokenShare*100);return n("div",{className:"p-4 space-y-2.5",children:[n("div",{className:"flex flex-wrap items-center justify-between gap-2 text-xs",children:[n("div",{className:"flex min-w-0 items-center gap-2",children:[t("span",{className:"font-medium text-sm text-ink truncate",children:e.name}),t("span",{className:u("control.badge","font-mono truncate max-w-[240px]"),title:e.directory||"未绑定项目目录",children:e.directory||"独立会话"}),t("button",{type:"button",onClick:()=>p(v?null:d),className:"rounded px-1.5 py-0.5 text-[11px] text-accent hover:bg-accent/10 transition-colors cursor-pointer shrink-0",children:v?"取消筛选":"筛选"})]}),n("div",{className:"flex items-baseline gap-1.5 font-mono tabular-nums shrink-0",children:[t("span",{className:"text-xs font-medium text-ink",title:B(e.totalTokens),children:N(e.totalTokens)}),n("span",{className:"text-[11px] text-faint",children:["(",L(e.tokenShare),")"]})]})]}),t("div",{className:"h-1.5 w-full overflow-hidden rounded-full bg-raised",children:t("div",{className:"h-full rounded-full bg-accent transition-all duration-300",style:{width:`${w}%`}})}),n("div",{className:"flex flex-wrap items-center justify-between gap-x-4 gap-y-1 font-mono text-[11px] text-dim tabular-nums",children:[n("div",{className:"flex flex-wrap items-center gap-x-3 gap-y-1",children:[n("span",{children:["输入 ",t("span",{className:"text-ink",children:N(e.inputTokens)})]}),n("span",{children:["输出 ",t("span",{className:"text-ink",children:N(e.outputTokens)})]}),n("span",{children:["缓存读 ",t("span",{className:"text-ink",children:N(e.cacheReadTokens)}),n("span",{className:"text-faint",children:[" (",L(e.cacheHitRate),")"]})]})]}),n("div",{className:"flex flex-wrap items-center gap-x-3 gap-y-1",children:[n("span",{children:["耗时 ",t("span",{className:"text-ink",children:P(e.activeDurationMs)})]}),n("span",{children:[t("span",{className:"text-ink",children:e.sessionCount.toLocaleString()})," 会话"]}),n("span",{children:["工具 ",t("span",{className:"text-ink",children:e.toolCalls.toLocaleString()})," 次"]})]})]})]},d)})})}function ae(a){let{models:c}=a,{ModelIcon:x,style:p}=_();if(c.length===0)return t("div",{className:p("surface.empty"),children:"暂无模型调用数据"});return t("div",{className:"divide-y divide-line",children:c.map((u)=>{let e=Math.max(u.share>0?1:0,u.share*100);return n("div",{className:"p-4 space-y-2.5",children:[n("div",{className:"flex flex-wrap items-center justify-between gap-2 text-xs",children:[n("div",{className:"flex min-w-0 items-center gap-2",children:[t(x,{modelID:u.model,className:"size-4 shrink-0"}),t("span",{className:"font-mono text-sm font-medium text-ink truncate",children:u.shortName}),t("span",{className:p("control.badge","font-mono shrink-0"),children:u.provider})]}),n("div",{className:"flex items-baseline gap-2.5 font-mono tabular-nums shrink-0",children:[u.avgTps!==null&&n("span",{className:"text-[11px] text-dim",children:[u.avgTps.toFixed(1)," tok/s"]}),n("span",{className:"text-xs font-medium text-ink",title:B(u.totalTokens),children:[N(u.totalTokens)," ",n("span",{className:"text-[11px] font-normal text-faint",children:["(",L(u.share),")"]})]})]})]}),t("div",{className:"h-1.5 w-full overflow-hidden rounded-full bg-raised",children:t("div",{className:"h-full rounded-full bg-accent transition-all duration-300",style:{width:`${e}%`}})}),n("div",{className:"flex flex-wrap items-center justify-between gap-x-4 gap-y-1 font-mono text-[11px] text-dim tabular-nums",children:[n("div",{className:"flex flex-wrap items-center gap-x-3 gap-y-1",children:[n("span",{children:["输入 ",t("span",{className:"text-ink",children:N(u.inputTokens)})]}),n("span",{children:["输出 ",t("span",{className:"text-ink",children:N(u.outputTokens)})]}),n("span",{children:["缓存读 ",t("span",{className:"text-ink",children:N(u.cacheReadTokens)}),n("span",{className:"text-faint",children:[" (",L(u.cacheHitRate),")"]})]})]}),n("div",{className:"flex flex-wrap items-center gap-x-3 gap-y-1",children:[n("span",{children:[t("span",{className:"text-ink",children:u.turns.toLocaleString()})," 轮",u.errors>0?n("span",{className:"text-danger",children:[" (",u.errors," 错)"]}):null]}),n("span",{children:["工具 ",t("span",{className:"text-ink",children:u.toolCalls.toLocaleString()})," 次"]}),u.generationMs>0&&n("span",{children:["推理 ",t("span",{className:"text-ink",children:X(u.generationMs)})]})]})]})]},u.model)})})}function ne(a){let{tools:c}=a,{StatusChip:x,style:p}=_();if(c.length===0)return t("div",{className:p("surface.empty"),children:"暂无工具调用数据"});return t("div",{className:"divide-y divide-line",children:c.map((u)=>{let e=Math.max(u.share>0?1:0,u.share*100),d=u.successRate>=0.95?"success":u.successRate>=0.8?"warning":"danger",v=Math.max(0,u.calls-u.errors),w=u.calls>0?Math.round(u.outputBytes/u.calls):0;return n("div",{className:"p-4 space-y-2.5",children:[n("div",{className:"flex flex-wrap items-center justify-between gap-2 text-xs",children:[n("div",{className:"flex min-w-0 items-center gap-2",children:[t("span",{className:"font-mono text-sm font-medium text-ink truncate",children:u.name}),n(x,{tone:d,children:["成功率 ",L(u.successRate)]})]}),n("div",{className:"flex items-baseline gap-1.5 font-mono tabular-nums shrink-0",children:[n("span",{className:"text-xs font-medium text-ink",children:[u.calls.toLocaleString()," 次"]}),n("span",{className:"text-[11px] text-faint",children:["(",L(u.share),")"]})]})]}),t("div",{className:"h-1.5 w-full overflow-hidden rounded-full bg-raised",children:t("div",{className:"h-full rounded-full bg-accent transition-all duration-300",style:{width:`${e}%`}})}),n("div",{className:"flex flex-wrap items-center justify-between gap-x-4 gap-y-1 font-mono text-[11px] text-dim tabular-nums",children:[n("div",{className:"flex flex-wrap items-center gap-x-3 gap-y-1",children:[n("span",{children:["成功 ",t("span",{className:"text-ink",children:v.toLocaleString()})," 次"]}),n("span",{children:["失败 ",t("span",{className:u.errors>0?"text-danger":"text-ink",children:u.errors.toLocaleString()})," 次"]})]}),n("div",{className:"flex flex-wrap items-center gap-x-3 gap-y-1",children:[n("span",{children:["累计输出 ",t("span",{className:"text-ink",children:K(u.outputBytes)})]}),n("span",{children:["单次均值 ",t("span",{className:"text-ink",children:K(w)})]})]})]})]},u.name)})})}function se(a){let{sessions:c,onOpenSession:x}=a,{style:p}=_();if(c.length===0)return t("div",{className:p("surface.empty"),children:"暂无高消耗会话记录"});let u=Math.max(1,...c.map((e)=>e.totalTokens));return t("div",{className:"divide-y divide-line",children:c.map((e)=>{let d=u>0?Math.max(1,e.totalTokens/u*100):0,v=e.model.split("/").pop()??e.model;return n("button",{type:"button",onClick:()=>x(e.id),className:"group block w-full p-4 text-left space-y-2.5 hover:bg-raised/40 transition-colors cursor-pointer",children:[n("div",{className:"flex flex-wrap items-center justify-between gap-2 text-xs",children:[n("div",{className:"flex min-w-0 flex-1 items-center gap-2",children:[t("span",{className:"font-medium text-sm text-ink truncate group-hover:text-accent transition-colors",children:e.title.trim()||"新会话"}),t("span",{className:p("control.badge","font-mono truncate max-w-[140px] shrink-0"),title:e.projectName,children:e.projectName}),e.kind==="sub"&&t("span",{className:"rounded bg-accent/15 px-1.5 py-0.5 text-[10.5px] text-accent shrink-0",children:"子代理"}),e.archivedAt!==null&&t("span",{className:p("control.badge","shrink-0"),children:"已归档"})]}),n("div",{className:"flex items-center gap-1.5 font-mono tabular-nums shrink-0",children:[t("span",{className:"text-xs font-medium text-ink",title:B(e.totalTokens),children:N(e.totalTokens)}),t(rt,{className:"size-3.5 text-faint group-hover:text-ink group-hover:translate-x-0.5 transition-all"})]})]}),t("div",{className:"h-1.5 w-full overflow-hidden rounded-full bg-raised",children:t("div",{className:"h-full rounded-full bg-accent transition-all duration-300",style:{width:`${d}%`}})}),n("div",{className:"flex flex-wrap items-center justify-between gap-x-4 gap-y-1 font-mono text-[11px] text-dim tabular-nums",children:[n("div",{className:"flex flex-wrap items-center gap-x-3 gap-y-1",children:[n("span",{children:["输入 ",t("span",{className:"text-ink",children:N(e.inputTokens)})]}),n("span",{children:["输出 ",t("span",{className:"text-ink",children:N(e.outputTokens)})]}),n("span",{children:["缓存读 ",t("span",{className:"text-ink",children:N(e.cacheReadTokens)})]})]}),n("div",{className:"flex flex-wrap items-center gap-x-3 gap-y-1",children:[t("span",{className:"text-ink",children:v}),n("span",{children:["耗时 ",t("span",{className:"text-ink",children:P(e.activeDurationMs)})]}),n("span",{children:[t("span",{className:"text-ink",children:e.assistantTurns})," 轮"]}),t("span",{className:"text-faint",children:ee(e.updated)})]})]})]},e.id)})})}var oe=[{value:"tokens",label:"Token 用量"},{value:"duration",label:"活跃耗时"},{value:"activity",label:"交互轮次"}];function re(a){let{cn:c,Segmented:x,SettingGroup:p,style:u}=_(),{daily:e}=a,[d,v]=r("tokens"),[w,R]=r(null),M=y(()=>e.some((s)=>s.totalTokens>0||s.activeDurationMs>0||s.runs>0),[e]),F=y(()=>{if(e.length===0)return{totalText:"0",avgText:"0",peakDate:"—",peakValueText:"0"};if(d==="tokens"){let S=e.reduce((C,I)=>C+I.totalTokens,0),j=e.filter((C)=>C.totalTokens>0).length,T=e[0];for(let C of e)if(!T||C.totalTokens>T.totalTokens)T=C;return{totalText:N(S),totalFullText:B(S),avgText:j>0?N(Math.round(S/j)):"0",peakDate:T&&T.totalTokens>0?G(T.date):"—",peakValueText:T&&T.totalTokens>0?N(T.totalTokens):"0"}}if(d==="duration"){let S=e.reduce((C,I)=>C+I.activeDurationMs,0),j=e.filter((C)=>C.activeDurationMs>0).length,T=e[0];for(let C of e)if(!T||C.activeDurationMs>T.activeDurationMs)T=C;return{totalText:P(S),totalFullText:P(S),avgText:j>0?P(Math.round(S/j)):"0s",peakDate:T&&T.activeDurationMs>0?G(T.date):"—",peakValueText:T&&T.activeDurationMs>0?P(T.activeDurationMs):"0s"}}let s=e.reduce((S,j)=>S+j.assistantTurns,0),l=e.reduce((S,j)=>S+j.userMessages,0),f=s+l,k=e.filter((S)=>S.assistantTurns>0||S.userMessages>0).length,b=e[0];for(let S of e){let j=b?b.assistantTurns+b.userMessages:0;if(!b||S.assistantTurns+S.userMessages>j)b=S}let A=b?b.assistantTurns+b.userMessages:0;return{totalText:`${f.toLocaleString()} 轮`,totalFullText:`助手 ${s.toLocaleString()} 轮 · 用户 ${l.toLocaleString()} 问`,avgText:k>0?`${(f/k).toFixed(1)} 轮/天`:"0 轮/天",peakDate:b&&A>0?G(b.date):"—",peakValueText:b&&A>0?`${A.toLocaleString()} 轮`:"0 轮"}},[e,d]),D=y(()=>{if(w){let s=e.find((l)=>l.date===w);if(s)return s}for(let s=e.length-1;s>=0;s--){let l=e[s];if(l&&(l.totalTokens>0||l.activeDurationMs>0||l.runs>0))return l}return e[e.length-1]},[e,w]),z=y(()=>{if(d==="tokens")return Math.max(1,...e.map((s)=>s.totalTokens));if(d==="duration")return Math.max(1000,...e.map((s)=>s.activeDurationMs));return Math.max(1,...e.map((s)=>s.assistantTurns+s.userMessages))},[e,d]),m=y(()=>{if(e.length<=7)return e.map((f)=>f.date);let s=6,l=[];for(let f=0;f<s;f++){let k=Math.round(f*(e.length-1)/(s-1)),b=e[k];if(b)l.push(b.date)}return l},[e]);if(!M)return t(p,{title:"每日趋势",action:t(x,{value:d,onChange:(s)=>v(s),options:oe}),children:t("div",{className:u("surface.empty"),children:"当前时间范围内暂无活跃数据"})});return t(p,{title:"每日趋势",action:t(x,{value:d,onChange:(s)=>v(s),options:oe}),children:n("div",{className:"p-4 space-y-4",children:[n("div",{className:"flex flex-wrap items-center justify-between gap-2 text-xs",children:[n("div",{className:"flex flex-wrap items-center gap-x-3.5 gap-y-1 font-mono text-dim tabular-nums",children:[n("span",{children:["汇总 ",t("span",{className:"text-ink",children:F.totalText})]}),n("span",{children:["日均 ",t("span",{className:"text-ink",children:F.avgText})]}),n("span",{children:["峰值 ",t("span",{className:"text-ink",children:F.peakValueText}),F.peakDate!=="—"?n("span",{className:"text-faint",children:[" (",F.peakDate,")"]}):null]})]}),n("div",{className:"flex items-center gap-3 text-[11px] text-dim",children:[d==="tokens"&&n(g,{children:[n("span",{className:"inline-flex items-center gap-1.5",children:[t("span",{className:"size-2 rounded-full bg-accent/40"}),"缓存读"]}),n("span",{className:"inline-flex items-center gap-1.5",children:[t("span",{className:"size-2 rounded-full bg-accent"}),"输入"]}),n("span",{className:"inline-flex items-center gap-1.5",children:[t("span",{className:"size-2 rounded-full bg-success"}),"输出"]})]}),d==="duration"&&n(g,{children:[n("span",{className:"inline-flex items-center gap-1.5",children:[t("span",{className:"size-2 rounded-full bg-accent"}),"工作调度"]}),n("span",{className:"inline-flex items-center gap-1.5",children:[t("span",{className:"size-2 rounded-full bg-success"}),"模型推理"]})]}),d==="activity"&&n(g,{children:[n("span",{className:"inline-flex items-center gap-1.5",children:[t("span",{className:"size-2 rounded-full bg-accent"}),"助手回复"]}),n("span",{className:"inline-flex items-center gap-1.5",children:[t("span",{className:"size-2 rounded-full bg-success"}),"用户提问"]})]})]})]}),n("div",{className:"relative h-44 w-full pt-1",children:[n("div",{className:"absolute inset-0 flex flex-col justify-between pointer-events-none pb-5 text-[10px] text-faint/60",children:[t("div",{className:"border-b border-line/40 w-full"}),t("div",{className:"border-b border-line/30 w-full"}),t("div",{className:"border-b border-line/40 w-full"})]}),n("section",{"aria-label":"每日趋势柱状序列",className:"relative h-full flex flex-col justify-between",onMouseLeave:()=>R(null),children:[t("div",{className:"flex-1 flex items-end gap-1 sm:gap-1.5 pb-2",children:e.map((s)=>{let l=s.totalTokens;if(d==="duration")l=s.activeDurationMs;else if(d==="activity")l=s.assistantTurns+s.userMessages;let f=l<=0,k=f?0:Math.max(3,Math.min(100,l/z*100)),b=D?.date===s.date;return n("button",{type:"button","aria-label":`${s.date} 统计数据`,className:"flex-1 h-full flex flex-col justify-end items-center group cursor-pointer relative min-w-0 bg-transparent p-0 border-0 focus:outline-hidden",onMouseEnter:()=>R(s.date),onFocus:()=>R(s.date),onClick:()=>R(s.date),children:[t("div",{className:c("absolute inset-y-0 w-full rounded-xs transition-colors pointer-events-none",b?"bg-accent/10":"group-hover:bg-raised/60")}),f?t("div",{className:"h-1 w-full max-w-[24px] rounded-full bg-raised group-hover:bg-dim/30"}):n("div",{className:"w-full max-w-[24px] rounded-t-xs overflow-hidden flex flex-col justify-end transition-all duration-150",style:{height:`${k}%`},children:[d==="tokens"&&n(g,{children:[s.outputTokens>0&&t("div",{className:"bg-success transition-all duration-200",style:{height:`${s.outputTokens/s.totalTokens*100}%`}}),s.inputTokens+s.cacheWriteTokens>0&&t("div",{className:"bg-accent transition-all duration-200",style:{height:`${(s.inputTokens+s.cacheWriteTokens)/s.totalTokens*100}%`}}),s.cacheReadTokens>0&&t("div",{className:"bg-accent/40 transition-all duration-200",style:{height:`${s.cacheReadTokens/s.totalTokens*100}%`}})]}),d==="duration"&&n(g,{children:[s.generationMs>0&&t("div",{className:"bg-success transition-all duration-200",style:{height:`${Math.min(100,s.generationMs/Math.max(1,s.activeDurationMs)*100)}%`}}),t("div",{className:"bg-accent flex-1 transition-all duration-200"})]}),d==="activity"&&n(g,{children:[s.userMessages>0&&t("div",{className:"bg-success transition-all duration-200",style:{height:`${s.userMessages/Math.max(1,s.assistantTurns+s.userMessages)*100}%`}}),t("div",{className:"bg-accent flex-1 transition-all duration-200"})]})]}),b&&t("div",{className:"absolute -bottom-1 size-1 rounded-full bg-accent"})]},s.date)})}),t("div",{className:c("flex items-center pt-1.5 text-[10px] text-faint font-mono tabular-nums",e.length<=7?"gap-1 sm:gap-1.5":"justify-between"),children:m.map((s)=>t("div",{className:c("whitespace-nowrap",e.length<=7&&"flex-1 text-center"),children:G(s)},s))})]})]}),t("div",{className:"flex flex-wrap items-center justify-between gap-2 border-t border-line pt-3 font-mono text-xs tabular-nums",children:D?n(g,{children:[t("span",{className:"text-ink",children:Y(D.date)}),n("div",{className:"flex flex-wrap items-center gap-x-3.5 gap-y-1 text-dim",children:[n("span",{children:["Token ",t("span",{className:"text-ink",children:N(D.totalTokens)})]}),n("span",{children:["耗时 ",t("span",{className:"text-ink",children:P(D.activeDurationMs)})]}),n("span",{children:["交互 ",n("span",{className:"text-ink",children:[D.assistantTurns+D.userMessages," 轮"]})]}),n("span",{children:["工具 ",n("span",{className:"text-ink",children:[D.toolCalls," 次"]})]})]})]}):t("span",{className:"font-sans text-faint",children:"悬停柱状图查看单日明细"})})]})})}function ie(a){let{cn:c,SettingGroup:x}=_(),{daily:p,hourly:u}=a,[e,d]=r(null),v=y(()=>{let l=new Map;for(let k of u)l.set(k.hour,k);let f=[];for(let k=0;k<24;k++){let b=l.get(k);if(b)f.push(b);else f.push({hour:k,totalTokens:0,activeDurationMs:0,userMessages:0,assistantTurns:0,runs:0})}return f},[u]),w=y(()=>{let l=v[0];for(let f of v)if(!l||f.totalTokens>l.totalTokens)l=f;return l&&l.totalTokens>0?l:null},[v]),R=y(()=>v.reduce((l,f)=>l+f.totalTokens,0),[v]),M=y(()=>Math.max(1,...v.map((l)=>l.totalTokens)),[v]),F=y(()=>{if(R<=0)return 0;return v.filter((f)=>f.hour>=8&&f.hour<20).reduce((f,k)=>f+k.totalTokens,0)/R},[v,R]),D=y(()=>Math.max(1,...p.map((l)=>l.totalTokens)),[p]),z=y(()=>{let l=0,f=0;for(let k of p)if(k.totalTokens>0||k.activeDurationMs>0||k.runs>0){if(f++,f>l)l=f}else f=0;return l},[p]),m=y(()=>p.filter((l)=>l.totalTokens>0||l.activeDurationMs>0||l.runs>0).length,[p]),s=e!==null?v[e]:w;return n(x,{title:"活跃时段与热力",action:n("div",{className:"flex items-center gap-3 font-mono text-xs text-faint tabular-nums",children:[n("span",{children:["日间占比 ",L(F)]}),n("span",{children:["连续活跃 ",z," 天"]}),n("span",{children:["活跃 ",m,"/",p.length," 天"]})]}),children:[n("div",{className:"p-4 space-y-3",children:[n("div",{className:"flex flex-wrap items-center justify-between gap-2 text-xs",children:[t("span",{className:"text-dim",children:"24 小时分布"}),s?n("div",{className:"flex items-center gap-3 font-mono text-dim tabular-nums",children:[n("span",{className:"text-ink",children:[e!==null?"时段 ":"高峰 ",String(s.hour).padStart(2,"0"),":00 -"," ",String((s.hour+1)%24).padStart(2,"0"),":00"]}),t("span",{className:"text-ink",children:N(s.totalTokens)}),s.activeDurationMs>0&&t("span",{children:P(s.activeDurationMs)})]}):t("span",{className:"text-faint",children:"暂无时段分布"})]}),n("section",{"aria-label":"24 小时活跃分布序列",className:"h-28 w-full flex flex-col justify-between pt-1",onMouseLeave:()=>d(null),children:[t("div",{className:"flex-1 flex items-end gap-1.5 pb-1.5",children:v.map((l)=>{let f=w?.hour===l.hour,k=e===l.hour,b=l.totalTokens>0?Math.max(6,l.totalTokens/M*100):0,A=`${String(l.hour).padStart(2,"0")}:00 - ${String((l.hour+1)%24).padStart(2,"0")}:00
|
|
2
|
-
消耗: ${B(l.totalTokens)} Token
|
|
3
|
-
耗时: ${P(l.activeDurationMs)}
|
|
4
|
-
助手轮次: ${l.assistantTurns} 轮`;return t("button",{type:"button","aria-label":`${String(l.hour).padStart(2,"0")}:00 时段统计`,className:"flex-1 h-full flex flex-col justify-end items-center group relative cursor-pointer bg-transparent p-0 border-0 focus:outline-hidden",title:A,onMouseEnter:()=>d(l.hour),onFocus:()=>d(l.hour),onClick:()=>d(l.hour),children:b>0?t("div",{className:c("w-full max-w-[20px] rounded-t-xs transition-all duration-200",f||k?"bg-accent":"bg-accent/55 group-hover:bg-accent"),style:{height:`${b}%`}}):t("div",{className:"h-1 w-full max-w-[20px] rounded-full bg-raised group-hover:bg-dim/30"})},l.hour)})}),n("div",{className:"flex justify-between items-center text-[10px] text-faint font-mono pt-1.5 border-t border-line/40",children:[t("span",{children:"00:00"}),t("span",{children:"04:00"}),t("span",{children:"08:00"}),t("span",{children:"12:00"}),t("span",{children:"16:00"}),t("span",{children:"20:00"}),t("span",{children:"23:00"})]})]})]}),n("div",{className:"p-4 space-y-2.5",children:[n("div",{className:"text-xs text-dim",children:["自然日热力 (",p.length," 天)"]}),t("div",{className:"flex flex-wrap items-center gap-1.5",children:p.map((l)=>{let f="bg-raised";if(l.totalTokens>0){let b=l.totalTokens/D;if(b<=0.33)f="bg-accent/30";else if(b<=0.66)f="bg-accent/60";else f="bg-accent"}let k=`${Y(l.date)}
|
|
5
|
-
消耗: ${B(l.totalTokens)} Token
|
|
6
|
-
耗时: ${P(l.activeDurationMs)}
|
|
7
|
-
助手轮次: ${l.assistantTurns} 轮`;return t("div",{className:c("size-3.5 rounded-xs transition-transform hover:scale-125 cursor-pointer",f),title:k},l.date)})})]})]})}var pe=[{value:"7d",label:"近 7 天"},{value:"30d",label:"近 30 天"},{value:"90d",label:"近 90 天"},{value:"all",label:"全部"}],V=new Map,le=[];function q(a,c){return`${a}:${c??"all"}`}function _e(a){let{connection:c,onOpen:x}=a,{Button:p,PageLayout:u,Segmented:e,SettingGroup:d,style:v}=_(),[w,R]=r("30d"),[M,F]=r(null),[D,z]=r("projects"),[m,s]=r(()=>V.get(q("30d",null))??null),[l,f]=r(()=>!V.has(q("30d",null))),[k,b]=r(null),[A,S]=r(()=>le),j=i(0),T=h(async()=>{let I=++j.current,O=q(w,M),Q=V.get(O);if(Q)s(Q);f(!0);try{let E=new URLSearchParams({range:w,tzOffset:String(new Date().getTimezoneOffset())});if(M)E.set("projectID",M);let W=await c.request(`/api/stats?${E.toString()}`);if(I!==j.current)return;if(V.set(O,W),s(W),b(null),W.projects)S((ue)=>{let Z=new Map(ue.map((H)=>[H.id,H.name]));for(let H of W.projects)if(H.projectID)Z.set(H.projectID,H.name);let J=Array.from(Z.entries()).map(([H,ce])=>({id:H,name:ce}));return le=J,J})}catch(E){if(I===j.current)b(E instanceof Error?E.message:"加载统计数据失败")}finally{if(I===j.current)f(!1)}},[c,w,M]);o(()=>(T(),()=>{j.current++}),[T]);let C=y(()=>{if(!M)return null;if(M===U)return"独立聊天";return(A.find((O)=>O.id===M)??m?.projects.find((O)=>O.projectID===M))?.name??"指定项目"},[M,A,m]);return n(u,{title:C?n(g,{children:["统计 ",n("span",{className:"text-dim",children:["· ",C]})]}):"统计",description:"按项目、模型与工具统计活跃耗时与 Token 消耗。",actions:n(g,{children:[M&&t(p,{size:"sm",variant:"ghost",onClick:()=>F(null),children:"返回全部"}),t(e,{value:w,onChange:R,options:pe})]}),children:[k&&n("div",{className:"mb-4 flex items-center justify-between rounded-lg bg-danger/10 px-3 py-2 text-xs text-danger",children:[t("span",{children:k}),t(p,{size:"sm",variant:"ghost",onClick:()=>{T()},className:"text-danger hover:text-danger",children:"重试"})]}),l&&!m?t("div",{className:"flex justify-center py-12 text-xs text-faint",children:"正在加载统计…"}):!m?t("div",{className:v("surface.card","p-12 text-center text-sm text-dim"),children:"暂无统计数据"}):n("div",{className:"space-y-8",children:[t(d,{title:"核心总览",unboxed:!0,children:n("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2",children:[n("div",{className:v("surface.card","p-4"),children:[n("div",{className:"flex items-center justify-between gap-2 text-xs text-faint",children:[t("span",{children:"总 Token 消耗"}),n("span",{className:"font-mono tabular-nums",children:["缓存命中 ",L(m.overview.cacheHitRate)]})]}),t("div",{className:"mt-1.5 font-mono text-xl font-semibold tracking-tight text-ink tabular-nums",title:`${B(m.overview.totalTokens)} Token`,children:N(m.overview.totalTokens)}),n("div",{className:"mt-1 flex flex-wrap items-center gap-x-3 gap-y-1 font-mono text-[11px] text-dim tabular-nums",children:[n("span",{children:["输入 ",N(m.overview.inputTokens)]}),n("span",{children:["输出 ",N(m.overview.outputTokens)]}),n("span",{children:["缓存读 ",N(m.overview.cacheReadTokens)]})]})]}),n("div",{className:v("surface.card","p-4"),children:[n("div",{className:"flex items-center justify-between gap-2 text-xs text-faint",children:[t("span",{children:"活跃工作耗时"}),n("span",{className:"font-mono tabular-nums",children:["日均"," ",m.overview.activeDays>0?P(m.overview.activeDurationMs/m.overview.activeDays):"0s"]})]}),t("div",{className:"mt-1.5 font-mono text-xl font-semibold tracking-tight text-ink tabular-nums",children:P(m.overview.activeDurationMs)}),n("div",{className:"mt-1 flex flex-wrap items-center gap-x-3 gap-y-1 font-mono text-[11px] text-dim tabular-nums",children:[n("span",{children:["模型推理 ",P(m.overview.generationMs)]}),n("span",{children:["并发累计 ",P(m.overview.cumulativeRunDurationMs)]})]})]}),n("div",{className:v("surface.card","p-4"),children:[n("div",{className:"flex items-center justify-between gap-2 text-xs text-faint",children:[t("span",{children:"会话与工作流"}),n("span",{className:"font-mono tabular-nums",children:[m.overview.activeProjects,"/",m.overview.totalProjects," 活跃项目"]})]}),n("div",{className:"mt-1.5 font-mono text-xl font-semibold tracking-tight text-ink tabular-nums",children:[m.overview.sessionCount.toLocaleString()," 个会话"]}),n("div",{className:"mt-1 flex flex-wrap items-center gap-x-3 gap-y-1 font-mono text-[11px] text-dim tabular-nums",children:[n("span",{children:[m.overview.mainSessionCount," 主会话 / ",m.overview.subSessionCount," 子代理"]}),n("span",{children:[m.overview.userMessages," 提问 / ",m.overview.assistantTurns," 回复"]})]})]}),n("div",{className:v("surface.card","p-4"),children:[n("div",{className:"flex items-center justify-between gap-2 text-xs text-faint",children:[t("span",{children:"吞吐效率与调用"}),n("span",{className:"font-mono tabular-nums",children:[m.overview.compactions," 次折叠"]})]}),t("div",{className:"mt-1.5 font-mono text-xl font-semibold tracking-tight text-ink tabular-nums",children:m.overview.avgTps!==null?`${m.overview.avgTps.toFixed(1)} tok/s`:`${m.overview.toolCalls.toLocaleString()} 次调用`}),n("div",{className:"mt-1 flex flex-wrap items-center gap-x-3 gap-y-1 font-mono text-[11px] text-dim tabular-nums",children:[n("span",{children:[m.overview.toolCalls.toLocaleString()," 次工具调用"]}),n("span",{children:[m.overview.runCount.toLocaleString()," 次运行"]})]})]})]})}),t(re,{daily:m.daily}),t(ie,{daily:m.daily,hourly:m.hourly}),t(d,{title:"分类明细",action:t(e,{value:D,onChange:z,options:[{value:"projects",label:`项目消耗 (${m.projects.length})`},{value:"models",label:`模型分析 (${m.models.length})`},{value:"tools",label:`工具调用 (${m.tools.length})`},{value:"sessions",label:`高消耗会话 (${m.topSessions.length})`}]}),children:n("div",{className:"animate-fade",children:[D==="projects"&&t(te,{projects:m.projects,selectedProjectID:M,onSelectProject:F,onOpenSession:x}),D==="models"&&t(ae,{models:m.models}),D==="tools"&&t(ne,{tools:m.tools}),D==="sessions"&&t(se,{sessions:m.topSessions,onOpenSession:x})]},D)})]})]})}export{_e as StatsPage};
|
package/web/chunk-phnqnhj9.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{sr}from"./chunk-2cem4sv7.js";export{sr as createRailroadPegServices};
|