@bkm016/basalt 0.1.7 → 0.1.8
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-n981vx1t.js → chunk-0d51ggzj.js} +6 -6
- package/chunk-12trygzx.js +25 -0
- package/{chunk-s6dejhfj.js → chunk-26cz8et8.js} +1 -1
- package/{chunk-zxkq9m8e.js → chunk-2ek3wq4b.js} +2 -2
- package/chunk-2gcp3xdc.js +2 -0
- package/{chunk-x4874m8e.js → chunk-2ks2tnac.js} +2 -2
- package/{chunk-0javrjcm.js → chunk-2nrkqq45.js} +22 -22
- package/chunk-320174qe.js +2 -0
- package/{chunk-ey15ye2h.js → chunk-3hg7yn1t.js} +1 -1
- package/{chunk-benrzwea.js → chunk-3j2kkgsc.js} +1 -1
- package/{chunk-8x21n7y9.js → chunk-47vf66t6.js} +1 -1
- package/chunk-4n49ptbz.js +3 -0
- package/{chunk-7hr6zw2m.js → chunk-5gxj9560.js} +1 -1
- package/{chunk-g0t9c3gv.js → chunk-6vnjg5x9.js} +1 -1
- package/{chunk-dnx91jrd.js → chunk-7kjr9gdx.js} +2 -2
- package/{chunk-y8dkfpmj.js → chunk-7p6e2f5s.js} +3 -3
- package/{chunk-053vb71h.js → chunk-86xhmz7k.js} +1 -1
- package/{chunk-ebpyvs1d.js → chunk-91r5nvth.js} +2 -2
- package/{chunk-c7rcw9fb.js → chunk-adys4qq4.js} +4 -4
- package/{chunk-npez1492.js → chunk-ckjw3b61.js} +2 -2
- package/{chunk-f156y565.js → chunk-d37gemt2.js} +3 -3
- package/{chunk-j7yvh0ae.js → chunk-dcwdmpw2.js} +1 -1
- package/chunk-dvb5nd2x.js +2 -0
- package/{chunk-063vbmtp.js → chunk-e6c2mzxc.js} +2 -2
- package/{chunk-s7skpgm2.js → chunk-ef9yhnk3.js} +1 -1
- package/{chunk-ecf896fz.js → chunk-fpxc6qjr.js} +2 -2
- package/chunk-frt9k18g.js +480 -0
- package/{chunk-bdy4jksd.js → chunk-fzcmzbsq.js} +1 -1
- package/{chunk-q9dd6fhj.js → chunk-g3ed130w.js} +3 -3
- package/{chunk-d48bfd2e.js → chunk-h1kb8b49.js} +2 -2
- package/{chunk-arcqjt91.js → chunk-hd3x1w46.js} +1 -1
- package/{chunk-dpz4hwqb.js → chunk-j781n7ca.js} +2 -2
- package/{chunk-z02sj1je.js → chunk-jp5afrwm.js} +2 -2
- package/{chunk-r8vvcp6c.js → chunk-jyv9cae6.js} +1 -1
- package/{chunk-whj87h4r.js → chunk-k3q5jqjj.js} +3 -3
- package/{chunk-75434aay.js → chunk-k3rmjrf1.js} +1 -1
- package/{chunk-peja51xv.js → chunk-kgkrccr1.js} +2 -2
- package/{chunk-pg5nkf1y.js → chunk-kpvaqb7c.js} +2 -2
- package/{chunk-sjjtxpg2.js → chunk-ky55taar.js} +330 -288
- package/{chunk-10p3mb40.js → chunk-mr807v9n.js} +1 -1
- package/chunk-n015c8nx.js +2 -0
- package/chunk-ndt6rjt9.js +2 -0
- package/{chunk-gv7wqkey.js → chunk-nmtk9xra.js} +2 -2
- package/{chunk-d6p2hgxh.js → chunk-pehyqj8k.js} +1 -1
- package/{chunk-ca982n62.js → chunk-pkpj7s2k.js} +1 -1
- package/{chunk-fx7f4m3c.js → chunk-pn413hjw.js} +1 -1
- package/{chunk-6ptv4g5e.js → chunk-ppxv5q7y.js} +3 -3
- package/{chunk-8wj32837.js → chunk-qmdpgbg3.js} +1 -1
- package/{chunk-8wv5t0w6.js → chunk-rnt1ckk9.js} +6 -6
- package/{chunk-prgm07j4.js → chunk-t40fag3z.js} +2 -2
- package/{chunk-w67dvqtb.js → chunk-t66jqz12.js} +2 -2
- package/{chunk-39vwrg8n.js → chunk-v2srrqcv.js} +2 -2
- package/{chunk-n85qs7cs.js → chunk-x496kg3v.js} +1 -1
- package/{chunk-6kdgk70p.js → chunk-xjw78yey.js} +4 -4
- package/chunk-xy2bxwq8.js +2 -0
- package/{chunk-y69ewdn2.js → chunk-ypqjfv3a.js} +2 -2
- package/{chunk-f544p9rh.js → chunk-yyy2yp6f.js} +10 -10
- package/{chunk-8gw5bvh3.js → chunk-yzevjkms.js} +5 -5
- package/chunk-z3ch1wg6.js +16 -0
- package/chunk-zdyd8hbn.js +2 -0
- package/compiled.js +6 -6
- package/package.json +1 -1
- package/ui-test-worker.js +19 -19
- package/web/{chunk-kjacapzd.js → chunk-0j9a7811.js} +6 -6
- package/web/chunk-0jfda4jw.js +2 -0
- package/web/{chunk-z1geewdf.js → chunk-0zwc2rvh.js} +2 -2
- package/web/{chunk-ht4mx2dt.js → chunk-1gx0zpmp.js} +7 -7
- package/web/{chunk-q3jevm51.js → chunk-1s8zg6fb.js} +51 -51
- package/web/chunk-2axwda8c.js +89 -0
- package/web/chunk-2p3fkhy8.js +1 -0
- package/web/{chunk-tz4twwmw.js → chunk-33w36n91.js} +2 -2
- package/web/{chunk-1s53190z.js → chunk-3q0v8w45.js} +81 -81
- package/web/chunk-3sz5qcwj.js +1 -0
- package/web/chunk-433c80pc.js +1 -0
- package/web/chunk-48cnmhvd.js +106 -0
- package/web/{chunk-da7m1kva.js → chunk-4anjs6yp.js} +2 -2
- package/web/chunk-5r37rwq1.js +4 -0
- package/web/{chunk-pjz30xcp.js → chunk-6e38yf3a.js} +23 -23
- package/web/{chunk-xckxtfp8.js → chunk-7a4xk6j9.js} +72 -72
- package/web/chunk-7f1t7z72.js +2 -0
- package/web/chunk-7qq1ypvj.js +1 -0
- package/web/{chunk-h6k1x096.js → chunk-7tkgbbf9.js} +2 -2
- package/web/chunk-7x35g67d.js +78 -0
- package/web/{chunk-xbpc6x9m.js → chunk-823b7866.js} +15 -15
- package/web/chunk-85gdsmt4.js +1 -0
- package/web/{chunk-gyp6v7jd.js → chunk-8773nwdc.js} +2 -2
- package/web/{chunk-2cem4sv7.js → chunk-8dp7h6w8.js} +24 -24
- package/web/{chunk-y99ed8rd.js → chunk-8nv7q5ac.js} +9 -9
- package/web/chunk-8pzg8qw4.js +1 -0
- package/web/chunk-8wg44w91.js +2 -0
- package/web/chunk-9p5dfvav.js +1 -0
- package/web/chunk-9q9w9pay.js +1 -0
- package/web/chunk-a3teqvz2.js +39 -0
- package/web/chunk-bd8ftfxn.js +3 -0
- package/web/chunk-c03bt2pz.js +1 -0
- package/web/chunk-c1ha2xg6.js +8 -0
- package/web/chunk-cez1k71m.js +1 -0
- package/web/chunk-cgng31df.js +1 -0
- package/web/chunk-cn0tmwjs.js +2 -0
- package/web/{chunk-t6sq85s6.js → chunk-cn1xpg3q.js} +2 -2
- package/web/chunk-cvd4f51j.js +1 -0
- package/web/chunk-cybvxssy.js +1 -0
- package/web/{chunk-geh05ghh.js → chunk-cyjnert7.js} +19 -19
- package/web/{chunk-twdy2f67.js → chunk-d0m0h0eb.js} +1 -1
- package/web/{chunk-sn3tkwme.js → chunk-dgwkqcz6.js} +37 -37
- package/web/{chunk-nfvqjzz5.js → chunk-dtg5yhhs.js} +1 -1
- package/web/chunk-dynajx8x.js +2 -0
- package/web/{chunk-svh4n157.js → chunk-et8q775x.js} +4 -4
- package/web/chunk-f3vv7n52.js +1 -0
- package/web/{chunk-tmndcktk.js → chunk-f93pe4kb.js} +15 -15
- package/web/{chunk-5nda24gv.js → chunk-fe31sv6t.js} +1 -1
- package/web/chunk-fpa81dv7.js +62 -0
- package/web/{chunk-4q7wf0wd.js → chunk-fx4mackk.js} +9 -9
- package/web/chunk-g17n6asp.js +1 -0
- package/web/chunk-g9dzaw9e.js +30 -0
- package/web/chunk-gcwhx3av.js +1139 -0
- package/web/chunk-gf8vm6b5.js +1 -0
- package/web/chunk-gnmeyy4h.js +1 -0
- package/web/chunk-h5cfg3vv.js +2 -0
- package/web/{chunk-femhej5w.js → chunk-hbkasy6c.js} +46 -46
- package/web/chunk-hn7mhsbg.js +1 -0
- package/web/{chunk-tfn0rqg9.js → chunk-hstbgb83.js} +26 -26
- package/web/chunk-jjjtv2r1.js +2 -0
- package/web/chunk-jzte2phh.js +2 -0
- package/web/chunk-k8h8zx6r.js +24 -0
- package/web/chunk-m3ajw575.js +1 -0
- package/web/chunk-m5y2d4zv.js +1 -0
- package/web/chunk-mbwwj216.js +1 -0
- package/web/chunk-mf6xng5b.js +2 -0
- package/web/chunk-nky3bqfg.js +1 -0
- package/web/chunk-np33kmn4.js +1 -0
- package/web/chunk-nvk8mazs.js +1 -0
- package/web/chunk-nyw5ewgv.js +1 -0
- package/web/{chunk-dg3p8db5.js → chunk-p0cjvjdx.js} +1 -1
- package/web/chunk-p56dcqpr.js +1 -0
- package/web/chunk-pdn4r8x4.js +1 -0
- package/web/chunk-q1xxs319.js +41 -0
- package/web/chunk-qpt34d8d.js +1 -0
- package/web/{chunk-4fm55fgb.js → chunk-qq2v8h6d.js} +7 -7
- package/web/chunk-qskt3tqa.js +1 -0
- package/web/chunk-qt3n897m.js +4 -0
- package/web/chunk-r1rt48h9.js +1 -0
- package/web/{chunk-4sve9xrj.js → chunk-r4ffr96e.js} +1 -1
- package/web/chunk-r7tgd2fm.js +7 -0
- package/web/{chunk-gksf7cek.js → chunk-rbdvc8x7.js} +7 -7
- package/web/{chunk-q97hn4j5.js → chunk-rkjkynm3.js} +33 -33
- package/web/chunk-rznszqmy.js +1 -0
- package/web/chunk-s1pefd34.js +1 -0
- package/web/chunk-s38s9ff9.js +370 -0
- package/web/{chunk-n754s8xd.js → chunk-s7e93552.js} +8 -8
- package/web/chunk-sc29azev.js +1 -0
- package/web/{chunk-czjk218p.js → chunk-sda7cyrt.js} +52 -52
- package/web/chunk-svh2gkx8.js +2 -0
- package/web/chunk-t4jc4nac.js +1 -0
- package/web/chunk-t7g366a5.js +24 -0
- package/web/chunk-tj1fn8v2.js +1 -0
- package/web/{chunk-sy7e4dmq.js → chunk-tkp72r9b.js} +1 -1
- package/web/{chunk-5wbnjjhg.js → chunk-v14s4vgc.js} +1 -1
- package/web/chunk-v94v68xg.js +36 -0
- package/web/{chunk-0whceqes.js → chunk-vvvd3grf.js} +2 -2
- package/web/chunk-w37n09px.js +21 -0
- package/web/chunk-wcphswcx.js +2 -0
- package/web/{chunk-aangfjqc.js → chunk-wj3ymejj.js} +38 -38
- package/web/chunk-wwcnvyjh.css +1 -0
- package/web/{chunk-e8yj05t1.js → chunk-xabcx3ry.js} +6 -6
- package/web/chunk-xb9m0092.js +1 -0
- package/web/chunk-xfd3b01q.js +1 -0
- package/web/{chunk-4vjnrz87.js → chunk-xqyazzm7.js} +17 -17
- package/web/{chunk-bdydzbqk.js → chunk-xsz1dfm2.js} +23 -23
- package/web/chunk-z0zrp8n8.js +1 -0
- package/web/index.html +1 -1
- package/worker.js +1 -1
- package/chunk-654cny9a.js +0 -480
- 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-2b63adsj.js +0 -89
- package/web/chunk-3baypnwn.js +0 -4
- package/web/chunk-4067nwjp.js +0 -19
- package/web/chunk-59678wmg.js +0 -1
- package/web/chunk-5k8sv4f5.js +0 -1
- package/web/chunk-5vjhvw1m.js +0 -2
- 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-989jq2h8.js +0 -2
- package/web/chunk-9w5tf22s.js +0 -1
- package/web/chunk-c3nn0vvc.js +0 -1
- package/web/chunk-cpwtt6ny.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-hwsvhst3.js +0 -1
- package/web/chunk-k02b36g1.js +0 -62
- package/web/chunk-kkfrs7d1.js +0 -41
- package/web/chunk-kkyn8yhj.js +0 -106
- package/web/chunk-mh4rx5cf.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-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-tqr80b5w.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-wqsczy57.js +0 -36
- package/web/chunk-wvfmmw1v.js +0 -8
- package/web/chunk-x1jm4zsg.js +0 -1
- package/web/chunk-xmsb2g71.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{_i}from"./chunk-8dp7h6w8.js";export{_i as createGitGraphServices};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Ki,Co,Qi,So,To,Ji}from"./chunk-qt3n897m.js";import"./chunk-mf6xng5b.js";import"./chunk-33w36n91.js";import"./chunk-3q0v8w45.js";export{Co as applyDagreLayoutResult,Ki as getEdgesToRender,So as measureDagreLayout,Qi as prepareLayoutForDagre,Ji as render,To as runDagreLayoutCore};
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import{hn}from"./chunk-h5cfg3vv.js";import{G}from"./chunk-jzte2phh.js";import{t,a,D,x,v,C,S,E,T,A,L,R,l,kr,p,ji,U,M}from"./chunk-3q0v8w45.js";import{ee}from"./chunk-8dp7h6w8.js";var k={NORMAL:0,REVERSE:1,HIGHLIGHT:2,MERGE:3,CHERRY_PICK:4},Ce=D.gitGraph,X=t(()=>U({...Ce,...x().gitGraph}),"getConfig"),m=new hn(()=>{let e=X(),{mainBranchName:r,mainBranchOrder:o}=e;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})}t(ne,"getID");function pe(e,r){let o=Object.create(null);return e.reduce((c,i)=>{let h=r(i);if(!o[h])o[h]=!0,c.push(i);return c},[])}t(pe,"uniqBy");var ve=t(function(e){m.records.direction=e},"setDirection"),Ee=t(function(e){a.debug("options str",e),e=e?.trim(),e=e||"{}";try{m.records.options=JSON.parse(e)}catch(r){a.error("error while parsing gitGraph options",r.message)}},"setOptions"),Te=t(function(){return m.records.options},"getOptions"),Le=t(function(e){let{msg:r,id:o,type:c,tags:i}=e;a.info("commit",r,o,c,i),a.debug("Entering commit:",r,o,c,i);let h=X();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=t(function(e){let{name:r,order:o}=e;if(r=v.sanitizeText(r,X()),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=t((e)=>{let{branch:r,id:o,type:c,tags:i}=e,h=X();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 u=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,u],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=t(function(e){let{id:r,targetId:o,tags:c,parent:i}=e;a.debug("Entering cherryPick:",r,o,c);let h=X();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 u={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=u,m.records.commits.set(u.id,u),m.records.branches.set(m.records.currBranch,u.id),a.debug(m.records.branches),a.debug("in cherryPick")}},"cherryPick"),ye=t(function(e){if(e=v.sanitizeText(e,X()),!m.records.branches.has(e)){let r=Error(`Trying to checkout branch which is not yet created. (Help try using "branch ${e}")`);throw r.hash={text:`checkout ${e}`,token:`checkout ${e}`,expected:[`branch ${e}`]},r}else{m.records.currBranch=e;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(e,r,o){let c=e.indexOf(r);if(c===-1)e.push(o);else e.splice(c,1,o)}t(he,"upsert");function me(e){let r=e.reduce((i,h)=>{if(i.seq>h.seq)return i;return h},e[0]),o="";e.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(e,r,i),r.parents[1])e.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(e,r,i)}e=pe(e,(i)=>i.id),me(e)}t(me,"prettyPrintCommitHistory");var Oe=t(function(){a.debug(m.records.commits);let e=xe()[0];me([e])},"prettyPrint"),Ie=t(function(){m.reset(),C()},"clear"),_e=t(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=t(function(){return m.records.branches},"getBranches"),De=t(function(){return m.records.commits},"getCommits"),xe=t(function(){let e=[...m.records.commits.values()];return e.forEach(function(r){a.debug(r.id)}),e.sort((r,o)=>r.seq-o.seq),e},"getCommitsArray"),We=t(function(){return m.records.currBranch},"getCurrentBranch"),qe=t(function(){return m.records.direction},"getDirection"),Ae=t(function(){return m.records.head},"getHead"),ue={commitType:k,getConfig:X,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:L,getDiagramTitle:R},He=t((e,r)=>{if(G(e,r),e.dir)r.setDirection(e.dir);for(let o of e.statements)Se(o,r)},"populate"),Se=t((e,r)=>{let c={Commit:t((i)=>r.commit(Ne(i)),"Commit"),Branch:t((i)=>r.branch(Fe(i)),"Branch"),Merge:t((i)=>r.merge(ze(i)),"Merge"),Checkout:t((i)=>r.checkout(Ye(i)),"Checkout"),CherryPicking:t((i)=>r.cherryPick(je(i)),"CherryPicking")}[e.$type];if(c)c(e);else a.error(`Unknown statement type: ${e.$type}`)},"parseStatement"),Ne=t((e)=>({id:e.id,msg:e.message??"",type:e.type!==void 0?k[e.type]:k.NORMAL,tags:e.tags??void 0}),"parseCommit"),Fe=t((e)=>({name:e.name,order:e.order??0}),"parseBranch"),ze=t((e)=>({branch:e.branch,id:e.id??"",type:e.type!==void 0?k[e.type]:void 0,tags:e.tags??void 0}),"parseMerge"),Ye=t((e)=>e.branch,"parseCheckout"),je=t((e)=>({id:e.id,targetId:"",tags:e.tags?.length===0?void 0:e.tags,parent:e.parent}),"parseCherryPicking"),Ke={parse:t(async(e)=>{let r=await ee("gitGraph",e);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=t((e,r,o=!1)=>{if(o&&e>0)return(e-1)%(r-1)+1;return e%r},"calcColorIndex"),W=new Map,q=new Map,oe=30,te=new Map,se=[],Y=0,w="LR",Ve=t(()=>{W.clear(),q.clear(),te.clear(),Y=0,se=[],w="LR"},"clear"),be=t((e)=>{let r=document.createElementNS("http://www.w3.org/2000/svg","text");return(typeof e==="string"?e.split(/\\n|\n|<br\s*\/?>/gi):e).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=t((e)=>{let r,o,c;if(w==="BT")o=t((i,h)=>i<=h,"comparisonFunc"),c=1/0;else o=t((i,h)=>i>=h,"comparisonFunc"),c=0;return e.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=t((e)=>{let r="",o=1/0;return e.forEach((c)=>{let i=q.get(c).y;if(i<=o)r=c,o=i}),r||void 0},"findClosestParentBT"),Xe=t((e,r,o)=>{let c=o,i=o,h=[];e.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)}),e.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,u=c-j;q.set(s.id,{x:y,y:u})}})},"setParallelBTPos"),Je=t((e)=>{let r=we(e.parents.filter((c)=>c!==null));if(!r)throw Error(`Closest parent not found for commit ${e.id}`);let o=q.get(r)?.y;if(o===void 0)throw Error(`Closest parent position not found for commit ${e.id}`);return o},"findClosestParentPos"),Qe=t((e)=>Je(e)+K,"calculateCommitPosition"),et=t((e,r)=>{let o=W.get(e.branch);if(!o)throw Error(`Branch not found for commit ${e.id}`);let c=o.pos,i=r+j;return q.set(e.id,{x:c,y:i}),{x:c,y:i}},"setCommitPosition"),tt=t((e,r,o)=>{let c=W.get(e.branch);if(!c)throw Error(`Branch not found for commit ${e.id}`);let i=r+o,h=c.pos;q.set(e.id,{x:h,y:i})},"setRootPosition"),rt=t((e,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)e.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`),e.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)e.append("circle").attr("cx",o.x).attr("cy",o.y).attr("r",s?7:10).attr("class",`commit ${r.id} ${c}`),e.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}`),e.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}`),e.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}`),e.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 u=e.append("circle");if(u.attr("cx",o.x),u.attr("cy",o.y),u.attr("r",s?7:10),u.attr("class",`commit ${r.id} commit${Z(i,V,g)}`),h===k.MERGE){let f=e.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=e.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=t((e,r,o,c,i)=>{if(r.type!==k.CHERRY_PICK&&(r.customId&&r.type===k.MERGE||r.type!==k.MERGE)&&i.showCommitLabel){let h=e.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,u=10+g.width/25*8.5;h.attr("transform","translate("+y+", "+u+") rotate(-45, "+c+", "+o.y+")")}}}},"drawCommitLabel"),ot=t((e,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=e.insert("polygon"),u=e.append("circle"),f=e.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:u,rect:y,yOffset:i}),i+=20}for(let{tag:g,hole:y,rect:u,yOffset:f}of s){let d=n/2,B=o.y-19.2-f;if(u.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 b=c+f;u.attr("class","tag-label-bkg").attr("points",`
|
|
8
|
+
${o.x},${b+2}
|
|
9
|
+
${o.x},${b-2}
|
|
10
|
+
${o.x+j},${b-d-2}
|
|
11
|
+
${o.x+j+h+4},${b-d-2}
|
|
12
|
+
${o.x+j+h+4},${b+d+2}
|
|
13
|
+
${o.x+j},${b+d+2}`).attr("transform","translate(12,12) rotate(45, "+o.x+","+c+")"),y.attr("cx",o.x+N/2).attr("cy",b).attr("transform","translate(12,12) rotate(45, "+o.x+","+c+")"),g.attr("x",o.x+5).attr("y",b+3).attr("transform","translate(14,14) rotate(45, "+o.x+","+c+")")}}}},"drawCommitTags"),st=t((e)=>{switch(e.customType??e.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=t((e,r,o,c)=>{let i={x:0,y:0};if(e.parents.length>0){let h=we(e.parents);if(h){let n=c.get(h)??i;if(r==="TB")return n.y+K;else if(r==="BT")return(c.get(e.id)??i).y-K;else return n.x+K}}else if(r==="TB")return oe;else if(r==="BT")return(c.get(e.id)??i).y-K;else return 0;return 0},"calculatePosition"),ct=t((e,r,o)=>{let c=w==="BT"&&o?r:r+j,i=W.get(e.branch)?.pos,h=w==="TB"||w==="BT"?W.get(e.branch)?.pos:c;if(h===void 0||i===void 0)throw Error(`Position were undefined for commit ${e.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=t((e,r,o,c)=>{let i=e.append("g").attr("class","commit-bullets"),h=e.append("g").attr("class","commit-labels"),n=w==="TB"||w==="BT"?oe:0,s=[...r.keys()],g=c.parallelCommits??!1,y=t((f,d)=>{let B=r.get(f)?.seq,b=r.get(d)?.seq;return B!==void 0&&b!==void 0?B-b:0},"sortKeys"),u=s.sort(y);if(w==="BT"){if(g)Xe(u,r,n);u=u.reverse()}u.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 b=st(d),P=d.customType??d.type,O=W.get(d.branch)?.index??0;rt(i,d,B,b,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=t((e,r,o,c,i)=>{let n=(w==="TB"||w==="BT"?o.x<c.x:o.y<c.y)?r.branch:e.branch,s=t((y)=>y.branch===n,"isOnBranchToGetCurve"),g=t((y)=>y.seq>e.seq&&y.seq<r.seq,"isBetweenCommits");return[...i.values()].some((y)=>g(y)&&s(y))},"shouldRerouteArrow"),re=t((e,r,o=0)=>{let c=e+Math.abs(e-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(e-r);return re(e,r-h/5,o+1)},"findLane"),dt=t((e,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="",u="",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 b;if(g){y="A 10 10, 0, 0, 0,",u="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)b=`M ${n.x} ${n.y} L ${O-f} ${n.y} ${u} ${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,b=`M ${n.x} ${n.y} L ${O+f} ${n.y} ${y} ${O} ${n.y+d} L ${O} ${s.y-f} ${u} ${O-d} ${s.y} L ${s.x} ${s.y}`;else if(w==="BT")if(n.x<s.x)b=`M ${n.x} ${n.y} L ${O-f} ${n.y} ${y} ${O} ${n.y-d} L ${O} ${s.y+f} ${u} ${O+d} ${s.y} L ${s.x} ${s.y}`;else B=W.get(r.branch)?.index,b=`M ${n.x} ${n.y} L ${O+f} ${n.y} ${u} ${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)b=`M ${n.x} ${n.y} L ${n.x} ${P-f} ${y} ${n.x+d} ${P} L ${s.x-f} ${P} ${u} ${s.x} ${P+d} L ${s.x} ${s.y}`;else B=W.get(r.branch)?.index,b=`M ${n.x} ${n.y} L ${n.x} ${P+f} ${u} ${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,",u="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])b=`M ${n.x} ${n.y} L ${n.x} ${s.y-f} ${y} ${n.x+d} ${s.y} L ${s.x} ${s.y}`;else b=`M ${n.x} ${n.y} L ${s.x-f} ${n.y} ${u} ${s.x} ${n.y+d} L ${s.x} ${s.y}`;if(n.x>s.x)if(y="A 20 20, 0, 0, 0,",u="A 20 20, 0, 0, 1,",f=20,d=20,o.type===k.MERGE&&r.id!==o.parents[0])b=`M ${n.x} ${n.y} L ${n.x} ${s.y-f} ${u} ${n.x-d} ${s.y} L ${s.x} ${s.y}`;else b=`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)b=`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])b=`M ${n.x} ${n.y} L ${n.x} ${s.y+f} ${u} ${n.x+d} ${s.y} L ${s.x} ${s.y}`;else b=`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,",u="A 20 20, 0, 0, 1,",f=20,d=20,o.type===k.MERGE&&r.id!==o.parents[0])b=`M ${n.x} ${n.y} L ${n.x} ${s.y+f} ${y} ${n.x-d} ${s.y} L ${s.x} ${s.y}`;else b=`M ${n.x} ${n.y} L ${s.x+f} ${n.y} ${u} ${s.x} ${n.y-d} L ${s.x} ${s.y}`;if(n.x===s.x)b=`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])b=`M ${n.x} ${n.y} L ${s.x-f} ${n.y} ${u} ${s.x} ${n.y+d} L ${s.x} ${s.y}`;else b=`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])b=`M ${n.x} ${n.y} L ${s.x-f} ${n.y} ${y} ${s.x} ${n.y-d} L ${s.x} ${s.y}`;else b=`M ${n.x} ${n.y} L ${n.x} ${s.y+f} ${u} ${n.x+d} ${s.y} L ${s.x} ${s.y}`;if(n.y===s.y)b=`M ${n.x} ${n.y} L ${s.x} ${s.y}`}if(b===void 0)throw Error("Line definition not found");e.append("path").attr("d",b).attr("class","arrow arrow"+Z(B,V,h))},"drawArrow"),ht=t((e,r)=>{let o=e.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=t((e,r,o,c)=>{let{look:i,theme:h,themeVariables:n}=l(),{dropShadow:s,THEME_COLOR_LIMIT:g}=n,y=ce.has(h??""),u=ge.has(h??""),f=e.append("g");r.forEach((d,B)=>{let b=Z(B,y?g:V,u),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"+b),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,Q=be(ie),H=f.insert("rect"),F=f.insert("g").attr("class","branchLabel").insert("g").attr("class","label branch-label"+b);F.node().appendChild(Q);let _=Q.getBBox(),fe=y?0:4,ae=y?16:0,J=y?le:0;if(i==="neo")H.attr("data-look","neo");if(H.attr("class","branchLabelBkg label"+b).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+J),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}, ${-J-10})`),F.attr("transform","translate("+(P-_.width/2-5)+", "+(-J*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}, ${J+10})`),F.attr("transform","translate("+(P-_.width/2-5)+", "+(Y+J*2+4)+")")}else H.attr("transform","translate(-19, "+(O-12-J/2)+")")})},"drawBranches"),mt=t(function(e,r,o,c,i){return W.set(e,{pos:r,index:o}),r+=50+(i?40:0)+(w==="TB"||w==="BT"?c.width/2:0),r},"setBranchPosition"),gt=t(function(e,r,o,c){Ve(),a.debug("in gitgraph renderer",e+`
|
|
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:u,themeVariables:f}=l(),{useGradient:d,gradientStart:B,gradientStop:b,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",b).attr("stop-opacity",1)}if(y==="neo"&&ce.has(u??""))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 Q=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(Q);let _=Q.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=t((e)=>{let{svgId:r}=e,o="";if(e.useGradient&&r)for(let c=0;c<e.THEME_COLOR_LIMIT;c++)o+=`
|
|
15
|
+
.label${c} { fill: ${e.mainBkg}; stroke: url(${r}-gradient); stroke-width: ${e.strokeWidth};}
|
|
16
|
+
`;return o},"genGitGraphGradient"),bt=t((e)=>{let r=x(),{theme:o,themeVariables:c}=r,{borderColorArray:i}=c,h=ke.has(o);if(pt.has(o)){let n="";for(let s=0;s<e.THEME_COLOR_LIMIT;s++)if(s===0)n+=`
|
|
17
|
+
.branch-label${s} { fill: ${e.nodeBorder};}
|
|
18
|
+
.commit${s} { stroke: ${e.nodeBorder}; }
|
|
19
|
+
.commit-highlight${s} { stroke: ${e.nodeBorder}; fill: ${e.nodeBorder}; }
|
|
20
|
+
.arrow${s} { stroke: ${e.nodeBorder}; }
|
|
21
|
+
.commit-bullets { fill: ${e.nodeBorder}; }
|
|
22
|
+
.commit-cherry-pick${s} { stroke: ${e.nodeBorder}; }
|
|
23
|
+
${ut(e)}`;else{let g=s%Be;n+=`
|
|
24
|
+
.branch-label${s} { fill: ${e["gitBranchLabel"+g]}; }
|
|
25
|
+
.commit${s} { stroke: ${e["git"+g]}; fill: ${e["git"+g]}; }
|
|
26
|
+
.commit-highlight${s} { stroke: ${e["gitInv"+g]}; fill: ${e["gitInv"+g]}; }
|
|
27
|
+
.arrow${s} { stroke: ${e["git"+g]}; }
|
|
28
|
+
`}return n}else if(!$t.has(o)){let n="";for(let s=0;s<e.THEME_COLOR_LIMIT;s++)n+=`
|
|
29
|
+
.branch-label${s} { fill: ${e.nodeBorder}; ${h?`font-weight:${e.noteFontWeight}`:""} }
|
|
30
|
+
.commit${s} { stroke: ${e.nodeBorder}; }
|
|
31
|
+
.commit-highlight${s} { stroke: ${e.nodeBorder}; fill: ${e.nodeBorder}; }
|
|
32
|
+
.label${s} { fill: ${e.mainBkg}; stroke: ${e.nodeBorder}; stroke-width: ${e.strokeWidth}; ${h?`font-weight:${e.noteFontWeight}`:""}}
|
|
33
|
+
.arrow${s} { stroke: ${e.nodeBorder}; }
|
|
34
|
+
.commit-bullets { fill: ${e.nodeBorder}; }
|
|
35
|
+
.commit-cherry-pick${s} { stroke: ${e.nodeBorder}; }
|
|
36
|
+
`;return n}else{let n="";for(let s=0;s<e.THEME_COLOR_LIMIT;s++)if(s===0)n+=`
|
|
37
|
+
.branch-label${s} { fill: ${e.nodeBorder}; ${h?`font-weight:${e.noteFontWeight}`:""} }
|
|
38
|
+
.commit${s} { stroke: ${e.nodeBorder}; }
|
|
39
|
+
.commit-highlight${s} { stroke: ${e.nodeBorder}; fill: ${e.mainBkg}; }
|
|
40
|
+
.label${s} { fill: ${e.mainBkg}; stroke: ${e.nodeBorder}; stroke-width: ${e.strokeWidth}; ${h?`font-weight:${e.noteFontWeight}`:""} }
|
|
41
|
+
.arrow${s} { stroke: ${e.nodeBorder}; }
|
|
42
|
+
.commit-bullets { fill: ${e.nodeBorder}; }
|
|
43
|
+
`;else{let g=s%i.length;n+=`
|
|
44
|
+
.branch-label${s} { fill: ${e.nodeBorder}; ${h?`font-weight:${e.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)?e.mainBkg:i[g]}; stroke: ${i[g]}; stroke-width: ${e.strokeWidth}; }
|
|
48
|
+
.arrow${s} { stroke: ${i[g]}; }
|
|
49
|
+
`}return n}},"genColor"),wt=t((e)=>`${Array.from({length:e.THEME_COLOR_LIMIT},(r,o)=>o).map((r)=>{let o=r%Be;return`
|
|
50
|
+
.branch-label${r} { fill: ${e["gitBranchLabel"+o]}; }
|
|
51
|
+
.commit${r} { stroke: ${e["git"+o]}; fill: ${e["git"+o]}; }
|
|
52
|
+
.commit-highlight${r} { stroke: ${e["gitInv"+o]}; fill: ${e["gitInv"+o]}; }
|
|
53
|
+
.label${r} { fill: ${e["git"+o]}; }
|
|
54
|
+
.arrow${r} { stroke: ${e["git"+o]}; }
|
|
55
|
+
`}).join(`
|
|
56
|
+
`)}`,"normalTheme"),Bt=t((e)=>{let r=x(),{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(e):wt(e)}
|
|
67
|
+
|
|
68
|
+
.branch {
|
|
69
|
+
stroke-width: ${e.strokeWidth};
|
|
70
|
+
stroke: ${e.commitLineColor??e.lineColor};
|
|
71
|
+
stroke-dasharray: ${c?"4 2":"2"};
|
|
72
|
+
}
|
|
73
|
+
.commit-label { font-size: ${e.commitLabelFontSize}; fill: ${c?e.nodeBorder:e.commitLabelColor}; ${c?`font-weight:${e.noteFontWeight};`:""}}
|
|
74
|
+
.commit-label-bkg { font-size: ${e.commitLabelFontSize}; fill: ${c?"transparent":e.commitLabelBackground}; opacity: ${c?"":0.5}; }
|
|
75
|
+
.tag-label { font-size: ${e.tagLabelFontSize}; fill: ${e.tagLabelColor};}
|
|
76
|
+
.tag-label-bkg { fill: ${c?e.mainBkg:e.tagLabelBackground}; stroke: ${c?e.nodeBorder:e.tagLabelBorder}; ${c?`filter:${e.dropShadow}`:""} }
|
|
77
|
+
.tag-hole { fill: ${e.textColor}; }
|
|
78
|
+
|
|
79
|
+
.commit-merge {
|
|
80
|
+
stroke: ${c?e.mainBkg:e.primaryColor};
|
|
81
|
+
fill: ${c?e.mainBkg:e.primaryColor};
|
|
82
|
+
}
|
|
83
|
+
.commit-reverse {
|
|
84
|
+
stroke: ${c?e.mainBkg:e.primaryColor};
|
|
85
|
+
fill: ${c?e.mainBkg:e.primaryColor};
|
|
86
|
+
stroke-width: ${c?e.strokeWidth:3};
|
|
87
|
+
}
|
|
88
|
+
.commit-highlight-outer {
|
|
89
|
+
}
|
|
90
|
+
.commit-highlight-inner {
|
|
91
|
+
stroke: ${c?e.mainBkg:e.primaryColor};
|
|
92
|
+
fill: ${c?e.mainBkg:e.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)?e.strokeWidth:8};
|
|
98
|
+
stroke-linecap: round;
|
|
99
|
+
fill: none
|
|
100
|
+
}
|
|
101
|
+
.gitTitleText {
|
|
102
|
+
text-anchor: middle;
|
|
103
|
+
font-size: 18px;
|
|
104
|
+
fill: ${e.textColor};
|
|
105
|
+
}
|
|
106
|
+
`},"getStyles"),kt=Bt,Ot={parser:Ke,db:ue,renderer:ft,styles:kt};export{Ot as diagram};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
function
|
|
2
|
-
export{
|
|
1
|
+
function $n(i,d){let e;if(d===void 0){for(let n of i)if(n!=null&&(e<n||e===void 0&&n>=n))e=n}else{let n=-1;for(let f of i)if((f=d(f,++n,i))!=null&&(e<f||e===void 0&&f>=f))e=f}return e}function gn(i,d){let e;if(d===void 0){for(let n of i)if(n!=null&&(e>n||e===void 0&&n>=n))e=n}else{let n=-1;for(let f of i)if((f=d(f,++n,i))!=null&&(e>f||e===void 0&&f>=f))e=f}return e}
|
|
2
|
+
export{$n,gn};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import{F,o,y,i,r,g,e,n,b,j,ci,xo,Yi,Pr,nr,_o,Zi,wo,ea,ta,On,ui,di}from"./chunk-gcwhx3av.js";var P={sealed:"已封存",folded:"已折叠",archived:"已移出"},E=["bg-accent","bg-accent-strong","bg-warning","bg-success"];function W(t,d){if(t.startsWith("recent-"))return"json";let c=d.trimStart();if(!c)return"markdown";if(c.startsWith("{")||c.startsWith("["))return"json";if(/^<[a-zA-Z_][\w.-]*(?:\s+[^>]*)?>/.test(c))return"xml";return"markdown"}function B(t){if(!t||t.length>32000)return t;if(!t.trimStart().startsWith("<"))return t;let c=[],m=0,a=(p)=>" ".repeat(p),l=/(<([a-zA-Z_][\w.-]*)(?:\s+[^>]*)?>([^\r\n<]*)<\/\2>)|(<\/[a-zA-Z_][\w.-]*>)|(<[a-zA-Z_][\w.-]*(?:\s+[^>]*)?\/>)|(<[a-zA-Z_][\w.-]*(?:\s+[^>]*)?>)|([^<]+)/g,u;while((u=l.exec(t))!==null){let[,p,,,f,s,x,h]=u;if(p)c.push(`${a(m)}${p.trim()}`);else if(f)m=Math.max(0,m-1),c.push(`${a(m)}${f.trim()}`);else if(x)c.push(`${a(m)}${x.trim()}`),m++;else if(s)c.push(`${a(m)}${s.trim()}`);else if(h){let w=h.trim();if(w)for(let N of w.split(/\r?\n/)){let R=N.trim();if(R)c.push(`${a(m)}${R}`)}}}return c.length>0?c.join(`
|
|
2
|
+
`):t}function _(){return n("div",{role:"status","aria-busy":"true","aria-label":"正在加载上下文",className:"space-y-2 animate-pulse",children:[e("div",{className:"h-10 rounded-xl border border-line bg-panel/40"}),e("div",{className:"h-10 rounded-xl border border-line bg-panel/40"}),e("div",{className:"h-10 rounded-xl border border-line bg-panel/40"})]})}function S(t){let{style:d}=b();return e("p",{className:d("surface.empty"),children:t.children})}function A(t){let{cn:d}=b();if(!t.items.length)return e(S,{children:"新会话还没有上下文。发送第一条消息后,这里会显示构成。"});let c=t.items.reduce((m,a)=>m+a.tokens,0)||1;return n("div",{className:"space-y-2.5",children:[e("div",{className:"flex h-2 overflow-hidden rounded-full bg-raised",children:t.items.map((m,a)=>e("span",{className:d(E[a%E.length],"transition-[width] duration-300 ease-out-quint"),title:`${m.label}:${m.tokens.toLocaleString()} token`,style:{width:`${m.tokens/c*100}%`}},m.id))}),e("div",{className:"space-y-1.5",children:t.items.map((m,a)=>e(G,{item:m,total:c,index:a,color:E[a%E.length]??"bg-accent"},m.id))})]})}function G(t){let{cn:d,Chevron:c,CopyButton:m,Code:a,style:l,useTheme:u}=b();u();let[p,f]=r(!1),s=(t.item.tokens/t.total*100).toFixed(1),x=y(()=>p&&t.item.detail?nr(t.item.detail):"",[p,t.item.detail]),h=y(()=>x?W(t.item.id,x):"markdown",[x,t.item.id]),w=y(()=>{if(!x)return"";return h==="xml"?B(x):x},[x,h]);return n("div",{"data-state":p?"open":"closed",className:l("surface.interactive","group/collapsible"),children:[n("button",{type:"button","aria-expanded":p,onClick:()=>f((N)=>!N),className:"flex w-full items-center gap-2 px-3 py-2 text-left text-xs",children:[e("span",{className:d("size-2 shrink-0 rounded-full",t.color),"aria-hidden":!0}),e("span",{className:"min-w-0 flex-1 truncate font-medium text-ink",children:t.item.label}),t.item.state&&e("span",{className:l("control.badge","text-[10px]"),children:P[t.item.state]}),e("span",{className:"font-mono tabular-nums text-dim",children:t.item.tokens.toLocaleString()}),n("span",{className:"w-10 text-right font-mono text-[11px] tabular-nums text-faint",children:[s,"%"]}),e(c,{className:"-rotate-90 text-faint group-data-[state=open]/collapsible:rotate-90"})]}),p&&n("div",{className:"border-t border-line/60 bg-raised/20 px-3 py-2 text-xs text-dim",children:[e("div",{className:"mb-2 h-1 overflow-hidden rounded-full bg-raised",children:e("div",{className:d("h-full",t.color),style:{width:`${s}%`}})}),w?n("div",{className:l("surface.subtle","group/detail relative overflow-hidden rounded-lg bg-panel/70 p-2.5"),children:[e("div",{className:"absolute right-1.5 top-1.5 z-10",children:e(m,{text:t.item.detail,size:"icon-xs",className:"bg-raised/60 hover:bg-raised text-faint hover:text-ink backdrop-blur-sm"})}),e("div",{className:"max-h-80 overflow-y-auto pr-6 text-dim",children:e(a,{code:w,lang:h,className:"text-[11px]! leading-relaxed! [&_pre]:whitespace-pre-wrap [&_pre]:break-words [&_pre]:[overflow-wrap:anywhere]"})})]}):e("p",{className:"py-2 text-center text-xs text-faint",children:"(空)"})]})]})}var I=40,Q={accent:"bg-accent/15 text-accent",success:"bg-success/15 text-success",warning:"bg-warning/15 text-warning",danger:"bg-danger/15 text-danger",neutral:"bg-raised text-dim"};function O(t){let{Button:d,CopyButton:c,style:m,useTheme:a}=b();a();let[l,u]=r(I),p=i(null),f=l<t.entries.length;o(()=>{let x=p.current;if(!x||!f||typeof IntersectionObserver>"u")return;let h=new IntersectionObserver((w)=>{if(w.some((N)=>N.isIntersecting))u((N)=>Math.min(t.entries.length,N+I))},{rootMargin:"480px"});return h.observe(x),()=>h.disconnect()},[f,t.entries.length]);let s=y(()=>t.entries.slice(-l).reverse(),[t.entries,l]);if(!t.entries.length)return e(S,{children:"还没有消息。"});return n("div",{className:"space-y-1.5",children:[n("div",{className:m("surface.subtle","flex items-center justify-between px-3 py-1.5 text-xs text-faint"),children:[n("span",{children:["共 ",t.entries.length," 条记录"]}),e(c,{text:()=>t.entries.map((x)=>JSON.stringify(x,null,2)).join(`
|
|
3
|
+
|
|
4
|
+
`),size:"icon-xs",label:"复制全部原始 JSON",className:"hover:bg-raised text-faint hover:text-ink"})]}),s.map((x)=>e(Y,{entry:x},x.seq)),f&&n("div",{ref:p,className:m("surface.subtle","flex items-center justify-between bg-panel/40 px-3 py-2 text-xs text-faint"),children:[n("span",{children:["已显示 ",s.length," / ",t.entries.length," 条"]}),n("div",{className:"flex items-center gap-1.5",children:[e(d,{size:"sm",variant:"ghost",onClick:()=>u((x)=>Math.min(t.entries.length,x+I)),children:"加载更多"}),e(d,{size:"sm",variant:"ghost",onClick:()=>u(t.entries.length),children:"显示全部"})]})]})]})}var Y=F(function(d){let{Chevron:c,CopyButton:m,style:a,useTheme:l}=b();l();let[u,p]=r(!1),f=_o(d.entry),s=y(()=>xo(d.entry.time),[d.entry.time]);return n("div",{"data-state":u?"open":"closed",className:a("surface.interactive","group/collapsible"),children:[n("button",{type:"button","aria-expanded":u,onClick:()=>p((x)=>!x),className:"flex w-full items-center gap-2 px-3 py-2 text-left text-xs",children:[n("span",{className:"shrink-0 font-mono text-[10.5px] tabular-nums text-faint",children:["#",d.entry.seq]}),e("span",{className:a("control.badge","shrink-0 font-medium text-[10px]",Q[f.tone]),children:f.badge}),e("span",{className:"min-w-0 flex-1 truncate text-ink",children:f.title}),f.meta&&e("span",{className:a("control.badge","shrink-0 font-mono text-[10px] text-faint"),children:f.meta}),e("span",{className:"shrink-0 font-mono text-[10.5px] tabular-nums text-faint",children:s}),e(c,{className:"-rotate-90 text-faint group-data-[state=open]/collapsible:rotate-90"})]}),u&&e("div",{className:"border-t border-line/60 bg-raised/20 px-3 py-2.5 text-xs text-dim",children:n("div",{className:"space-y-2",children:[n("div",{className:"flex items-center justify-between text-[11px] text-faint",children:[n("span",{className:"font-mono",children:[d.entry.type," · #",d.entry.seq]}),e(m,{text:()=>JSON.stringify(d.entry,null,2),size:"icon-xs",label:"复制此条 JSON",className:"bg-raised/60 hover:bg-raised text-faint hover:text-ink"})]}),e(ee,{entry:d.entry})]})})]})});function ee(t){let{Code:d,style:c,useTheme:m}=b();m();let a=t.entry;if(a.type==="user")return n("div",{className:"space-y-2",children:[a.text&&e("pre",{className:c("surface.subtle","max-h-72 overflow-y-auto p-2.5 font-sans text-xs leading-relaxed text-ink whitespace-pre-wrap break-words [overflow-wrap:anywhere]"),children:Pr(a.text)}),a.attachments&&a.attachments.length>0&&n("div",{className:"space-y-1",children:[n("div",{className:"text-[10.5px] font-medium text-faint",children:["附件(",a.attachments.length,")"]}),e("div",{className:"flex flex-wrap gap-1.5",children:a.attachments.map((l,u)=>{let p=l.kind==="image"?Math.floor(l.data.length*0.75):l.data.length;return n("div",{className:c("surface.subtle","inline-flex items-center gap-1.5 px-2 py-1 text-[11px]"),children:[e("span",{className:c("control.badge","text-[10px] text-faint"),children:l.kind==="image"?"图片":l.kind==="path"?"路径":"文本"}),e("span",{className:"max-w-40 truncate font-medium text-ink",children:l.name}),n("span",{className:"font-mono text-[10px] text-faint",children:[l.mimeType," · ",Yi(p)]})]},`${l.name}-${u}`)})})]}),a.notices&&a.notices.length>0&&n("div",{className:"space-y-1",children:[n("div",{className:"text-[10.5px] font-medium text-faint",children:["通知来源(",a.notices.length,")"]}),a.notices.map((l)=>n("div",{className:c("surface.subtle","flex items-center justify-between px-2.5 py-1.5 font-mono text-[11px]"),children:[n("span",{className:"truncate text-ink",children:[l.sourceKind,"/",l.sourceID]}),e("span",{className:"text-faint",children:l.state})]},l.dedupeKey))]})]});if(a.type==="assistant")return n("div",{className:"space-y-2",children:[n("div",{className:"font-mono text-[11px] text-faint",children:["模型:",a.model]}),a.error&&e("div",{className:"rounded-lg border border-danger/30 bg-danger/8 px-2.5 py-2 text-xs text-danger",children:a.error}),a.parts.map((l,u)=>{if(l.type==="thinking")return n("div",{className:c("surface.subtle","p-2.5 space-y-1"),children:[e("div",{className:"text-[10.5px] font-medium text-faint",children:"思考"}),e("pre",{className:"max-h-60 overflow-y-auto font-sans text-xs italic leading-relaxed text-dim whitespace-pre-wrap break-words [overflow-wrap:anywhere]",children:Pr(l.text)})]},`thinking-${u}`);if(l.type==="text")return n("div",{className:c("surface.subtle","p-2.5 space-y-1"),children:[e("div",{className:"text-[10.5px] font-medium text-faint",children:"回复"}),e("pre",{className:"max-h-60 overflow-y-auto font-sans text-xs leading-relaxed text-ink whitespace-pre-wrap break-words [overflow-wrap:anywhere]",children:Pr(l.text)})]},`text-${u}`);return n("div",{className:c("surface.subtle","p-2.5 space-y-1.5"),children:[n("div",{className:"flex items-center justify-between gap-2 text-[11px]",children:[n("span",{className:"font-mono font-medium text-ink",children:["工具调用 · ",l.name]}),e("span",{className:"truncate font-mono text-[10px] text-faint",children:l.id})]}),e("div",{className:"max-h-60 overflow-y-auto text-dim",children:e(d,{code:nr(JSON.stringify(l.input,Zi,2)),lang:"json",className:"text-[11px]! leading-relaxed! [&_pre]:whitespace-pre-wrap [&_pre]:break-words [&_pre]:[overflow-wrap:anywhere]"})})]},l.id||`tool-${u}`)})]});if(a.type==="tool_result")return n("div",{className:"space-y-2",children:[n("div",{className:"flex flex-wrap items-center gap-2 font-mono text-[11px] text-faint",children:[e("span",{className:"text-ink",children:a.name}),e("span",{children:"·"}),e("span",{className:"truncate",children:a.callID}),e("span",{className:c("control.badge","ml-auto font-sans text-[10px]",a.isError?"bg-danger/15 text-danger":"text-dim"),children:a.isError?"执行失败":"执行完成"})]}),a.images&&a.images.length>0&&e("div",{className:"flex flex-wrap gap-1.5",children:a.images.map((l,u)=>n("span",{className:c("surface.subtle","px-2 py-1 font-mono text-[10.5px] text-faint"),children:["图片 #",u+1," · ",l.mimeType," · ",Yi(Math.floor(l.data.length*0.75))]},`${l.mimeType}-${u}`))}),ci(a.output)?e("pre",{className:c("surface.subtle","max-h-72 overflow-y-auto p-2.5 font-mono text-[11px] leading-relaxed whitespace-pre-wrap break-words [overflow-wrap:anywhere]",a.isError?"text-danger":"text-dim"),children:Pr(a.output)}):e("p",{className:"py-1 text-faint",children:"(无文本输出)"})]});return e("pre",{className:c("surface.subtle","max-h-72 overflow-y-auto p-2.5 font-mono text-[11px] leading-relaxed text-dim whitespace-pre-wrap break-words [overflow-wrap:anywhere]"),children:wo(a)})}function D(t){let{cn:d,style:c,useTheme:m}=b();if(m(),!t.todos.length)return e(S,{children:"暂无待办。"});return e("ul",{className:"space-y-1.5",children:t.todos.map((a)=>n("li",{className:c("surface.interactive","flex items-start gap-2.5 px-3 py-2 text-xs"),children:[n("span",{className:d("mt-0.5 flex size-4 shrink-0 items-center justify-center rounded-full border transition-colors duration-300",a.status==="completed"&&"border-success bg-success text-panel",a.status==="in_progress"&&"border-accent",a.status==="pending"&&"border-line-strong"),children:[a.status==="completed"&&e(j,{className:"size-2.5 animate-pop",strokeWidth:3.5}),a.status==="in_progress"&&e("span",{className:"size-1.5 animate-pulse rounded-full bg-accent"})]}),e("span",{className:d("min-w-0 flex-1 break-words leading-relaxed [overflow-wrap:anywhere]",a.status==="completed"&&"text-faint line-through decoration-faint/60",a.status==="in_progress"&&"font-medium text-ink",a.status==="pending"&&"text-dim"),children:a.content})]},`${a.status}-${a.content}`))})}function L(t){let{cn:d,style:c,useTheme:m}=b();m();let[a,l]=r("all"),u=y(()=>t.tools.filter((s)=>s.deferred).length,[t.tools]),p=t.tools.length-u,f=y(()=>{if(a==="deferred")return t.tools.filter((s)=>s.deferred);if(a==="active")return t.tools.filter((s)=>!s.deferred);return t.tools},[t.tools,a]);if(!t.tools.length)return e(S,{children:"当前会话没有可用工具。"});return n("div",{className:"space-y-2",children:[u>0&&n("div",{className:"flex items-center gap-1 text-[11px]",children:[n("button",{type:"button",onClick:()=>l("all"),className:d("rounded-lg px-2 py-1 transition-colors",a==="all"?"bg-raised font-medium text-ink":"text-faint hover:text-dim"),children:["全部 (",t.tools.length,")"]}),n("button",{type:"button",onClick:()=>l("active"),className:d("rounded-lg px-2 py-1 transition-colors",a==="active"?"bg-raised font-medium text-ink":"text-faint hover:text-dim"),children:["常驻 (",p,")"]}),n("button",{type:"button",onClick:()=>l("deferred"),className:d("rounded-lg px-2 py-1 transition-colors",a==="deferred"?"bg-raised font-medium text-ink":"text-faint hover:text-dim"),children:["延迟加载 (",u,")"]})]}),e("div",{className:"space-y-1.5",children:f.map((s)=>e(te,{tool:s},`${s.group}-${s.name}`))})]})}function te(t){let{Chevron:d,CopyButton:c,Code:m,style:a,useTheme:l}=b();l();let[u,p]=r(!1),f=y(()=>u?JSON.stringify(t.tool.schema,null,2):"",[u,t.tool.schema]);return n("div",{"data-state":u?"open":"closed",className:a("surface.interactive","group/collapsible"),children:[n("button",{type:"button","aria-expanded":u,onClick:()=>p((s)=>!s),className:"flex w-full items-center justify-between px-3 py-2 text-left text-xs",children:[n("div",{className:"flex min-w-0 flex-1 items-center gap-1.5 truncate font-mono text-ink",children:[e("span",{className:"truncate",children:t.tool.name}),t.tool.group&&e("span",{className:a("control.badge","font-sans text-[10px]"),children:t.tool.group}),t.tool.deferred&&e("span",{className:a("control.badge","font-sans text-[10px]"),children:"延迟加载"})]}),e(d,{className:"-rotate-90 text-faint group-data-[state=open]/collapsible:rotate-90"})]}),u&&n("div",{className:"border-t border-line/60 bg-raised/20 px-3 py-2 text-xs text-dim",children:[t.tool.deferred&&e("div",{className:a("surface.subtle","mb-2 px-2.5 py-1.5 text-[11px] text-faint"),children:"延迟加载:此工具默认以精简描述挂载,模型通过 toolsearch 取回定义后才向上下文注入完整参数 Schema。"}),t.tool.description&&e("pre",{className:"mb-2 max-h-60 overflow-y-auto font-sans text-xs leading-relaxed text-dim whitespace-pre-wrap break-words [overflow-wrap:anywhere]",children:nr(t.tool.description)}),n("div",{className:a("surface.subtle","group/schema relative overflow-hidden rounded-lg p-2.5"),children:[e("div",{className:"absolute right-1.5 top-1.5 z-10",children:e(c,{text:f,size:"icon-xs",className:"bg-raised/60 hover:bg-raised text-faint hover:text-ink backdrop-blur-sm"})}),e("div",{className:"max-h-72 overflow-y-auto pr-6 text-dim",children:e(m,{code:nr(f),lang:"json",className:"text-[11px]! leading-relaxed! [&_pre]:whitespace-pre-wrap [&_pre]:break-words [&_pre]:[overflow-wrap:anywhere]"})})]})]})]})}function ae(){try{let t=localStorage.getItem("basalt.contextSidebar.tab");if(t==="tools"||t==="todos"||t==="raw")return t}catch{}return"breakdown"}function se(t){let{style:d,useTheme:c}=b();return c(),n("div",{className:d("surface.panel","bg-panel/70 px-3 py-2"),children:[e("div",{className:"text-[10px] font-medium uppercase tracking-wider text-faint",children:t.label}),e("div",{className:"mt-0.5 truncate font-mono text-xs font-semibold tabular-nums text-ink",children:t.value})]})}function Oe(t){let{Button:d,StatusChip:c,Segmented:m,cn:a,style:l,useTheme:u}=b();u();let[p,f]=r(ae),[s,x]=r(()=>On.get(t.session.id)),[h,w]=r(!1),[N,R]=r(0),[H,U]=r(!1);o(()=>{let v=setTimeout(()=>U(!0),140);return()=>clearTimeout(v)},[]),o(()=>{let v=On.get(t.session.id);if(v)x(v);return ui((T,X)=>{if(T===t.session.id)x(X)})},[t.session.id]),o(()=>{let v=new AbortController;return w(!1),t.connection.request(`/api/sessions/${encodeURIComponent(t.session.id)}/context`,{signal:AbortSignal.any([v.signal,AbortSignal.timeout(15000)])}).then((T)=>{if(!v.signal.aborted)di(t.session.id,T),x(T)},()=>{if(!v.signal.aborted)w(!0)}),()=>v.abort()},[t.connection,t.session.id,t.session.updated,t.entries.length,N]);let k=ea(s?.items??[],s?.usableWindow,s?.calibratedTokens,s?.lastInputTokens,s?.hasPendingOutput),C=ta(k.percent),z=s?.lastCacheHitRate,M=s?.usage?.cacheHitRate,J=z===void 0?"—":`${(z*100).toFixed(1)}%`,q=M===void 0?"—":`${(M*100).toFixed(1)}%`,Z=(v)=>{f(v);try{localStorage.setItem("basalt.contextSidebar.tab",v)}catch{}},K=[{value:"breakdown",label:"构成"},{value:"tools",label:n("span",{className:"inline-flex items-center gap-1",children:["工具",s&&e("span",{className:"text-[10px] text-faint tabular-nums",children:s.tools.length})]})},{value:"todos",label:n("span",{className:"inline-flex items-center gap-1",children:["待办",t.session.todos.length>0&&e("span",{className:"text-[10px] text-faint tabular-nums",children:t.session.todos.length})]})},{value:"raw",label:"原始消息"}],V=n("div",{className:"px-3.5 pt-1 pb-3",children:[n("div",{className:"flex items-start justify-between gap-3",children:[n("div",{children:[e("div",{className:"text-[10.5px] font-medium uppercase tracking-wider text-faint",children:"上下文用量"}),n("div",{className:"mt-0.5 flex items-baseline gap-1.5",children:[e("span",{className:"font-mono text-xl font-semibold tabular-nums text-ink",children:s?k.totalTokens.toLocaleString():"—"}),n("span",{className:"font-mono text-xs text-dim",children:["/ ",s?.usableWindow.toLocaleString()??"—"]})]})]}),e(c,{tone:C==="overflow"||C==="near_limit"?"danger":C==="sealing"?"warning":"success",children:C==="overflow"?"预计超限":C==="near_limit"?"接近上限":C==="sealing"?"接近封存":"正常"})]}),k.percent!==null&&e("meter",{className:"sr-only","aria-label":"可用上下文窗口占比",min:0,max:100,value:Math.min(100,k.percent)}),e("div",{"aria-hidden":!0,className:a("relative mt-2.5 h-2 w-full overflow-hidden rounded-full bg-raised",!s&&"animate-pulse"),children:e("div",{className:"h-full rounded-full bg-accent transition-[width] duration-500 ease-out-quint",style:{width:`${Math.min(100,k.percent??0)}%`}})}),n("div",{className:"mt-2 flex items-center justify-between text-[11px]",children:[e("span",{className:"text-dim",children:k.percent===null?"暂无窗口数据":`${k.percent.toFixed(1)}% 可用窗口`}),n("span",{className:"text-faint",children:["总窗口 ",s?.contextWindow.toLocaleString()??"—"," · 80% 封存 · 97% 折叠"]})]}),s?.usage&&(s.usage.input>0||s.usage.output>0||s.usage.cacheRead>0||s.usage.cacheWrite>0||s.usage.cost>0)&&e("div",{className:"mt-3 grid grid-cols-2 gap-2",children:[["Input",s.usage.input.toLocaleString()],["Output",s.usage.output.toLocaleString()],["缓存命中 当前 / 平均",`${J} / ${q}`],["平均 TPS",s.usage.tps!==void 0?`${s.usage.tps.toFixed(1)} tok/s`:"—"]].map(([v,T])=>e(se,{label:v,value:T},v))})]});return n(g,{children:[V,e("div",{className:"px-3 py-2",children:e(m,{value:p,onChange:Z,options:K,className:"w-full grid grid-cols-4"})}),n("div",{className:"min-h-0 flex-1 overflow-y-auto px-3 py-3",children:[h&&!s&&n("div",{role:"alert",className:"flex items-center justify-between rounded-xl border border-danger/30 bg-danger/8 px-3 py-2 text-xs text-danger",children:[e("span",{children:"上下文加载失败。"}),e(d,{size:"sm",variant:"ghost",onClick:()=>R((v)=>v+1),children:"重试"})]}),e("div",{children:!H?e(_,{}):n(g,{children:[p==="raw"&&e(O,{entries:t.entries}),p==="todos"&&e(D,{todos:t.session.todos}),p==="breakdown"&&(s?e(A,{items:k.items}):!h?e(_,{}):null),p==="tools"&&(s?e(L,{tools:s.tools??[]}):!h?e(_,{}):null)]})},p)]})]})}export{Oe as ContextSidebar};
|
|
@@ -1,34 +1,34 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{t,a,X,u,d,D,O,ht,l,V,et,tt,Et,yt,tn}from"./chunk-3q0v8w45.js";import{je}from"./chunk-p0cjvjdx.js";var ae=function(){var e=t(function(R,r,i,o){for(i=i||{},o=R.length;o--;i[R[o]]=r);return i},"o"),f=[1,4],m=[1,13],s=[1,12],y=[1,15],N=[1,16],S=[1,20],g=[1,19],A=[6,7,8],P=[1,26],b=[1,24],j=[1,25],x=[6,7,11],Y=[1,31],L=[6,7,11,24],W=[1,6,13,16,17,20,23],k=[1,35],F=[1,36],T=[1,6,7,11,13,16,17,20,23],J=[1,38],G={trace:t(function(){},"trace"),yy:{},symbols_:{error:2,start:3,mindMap:4,spaceLines:5,SPACELINE:6,NL:7,KANBAN:8,document:9,stop:10,EOF:11,statement:12,SPACELIST:13,node:14,shapeData:15,ICON:16,CLASS:17,nodeWithId:18,nodeWithoutId:19,NODE_DSTART:20,NODE_DESCR:21,NODE_DEND:22,NODE_ID:23,SHAPE_DATA:24,$accept:0,$end:1},terminals_:{2:"error",6:"SPACELINE",7:"NL",8:"KANBAN",11:"EOF",13:"SPACELIST",16:"ICON",17:"CLASS",20:"NODE_DSTART",21:"NODE_DESCR",22:"NODE_DEND",23:"NODE_ID",24:"SHAPE_DATA"},productions_:[0,[3,1],[3,2],[5,1],[5,2],[5,2],[4,2],[4,3],[10,1],[10,1],[10,1],[10,2],[10,2],[9,3],[9,2],[12,3],[12,2],[12,2],[12,2],[12,1],[12,2],[12,1],[12,1],[12,1],[12,1],[14,1],[14,1],[19,3],[18,1],[18,4],[15,2],[15,1]],performAction:t(function(r,i,o,c,p,n,M){var h=n.length-1;switch(p){case 6:case 7:return c;case 8:c.getLogger().trace("Stop NL ");break;case 9:c.getLogger().trace("Stop EOF ");break;case 11:c.getLogger().trace("Stop NL2 ");break;case 12:c.getLogger().trace("Stop EOF2 ");break;case 15:c.getLogger().info("Node: ",n[h-1].id),c.addNode(n[h-2].length,n[h-1].id,n[h-1].descr,n[h-1].type,n[h]);break;case 16:c.getLogger().info("Node: ",n[h].id),c.addNode(n[h-1].length,n[h].id,n[h].descr,n[h].type);break;case 17:c.getLogger().trace("Icon: ",n[h]),c.decorateNode({icon:n[h]});break;case 18:case 23:c.decorateNode({class:n[h]});break;case 19:c.getLogger().trace("SPACELIST");break;case 20:c.getLogger().trace("Node: ",n[h-1].id),c.addNode(0,n[h-1].id,n[h-1].descr,n[h-1].type,n[h]);break;case 21:c.getLogger().trace("Node: ",n[h].id),c.addNode(0,n[h].id,n[h].descr,n[h].type);break;case 22:c.decorateNode({icon:n[h]});break;case 27:c.getLogger().trace("node found ..",n[h-2]),this.$={id:n[h-1],descr:n[h-1],type:c.getType(n[h-2],n[h])};break;case 28:this.$={id:n[h],descr:n[h],type:0};break;case 29:c.getLogger().trace("node found ..",n[h-3]),this.$={id:n[h-3],descr:n[h-1],type:c.getType(n[h-2],n[h])};break;case 30:this.$=n[h-1]+n[h];break;case 31:this.$=n[h];break}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],8:f},{1:[3]},{1:[2,1]},{4:6,6:[1,7],7:[1,8],8:f},{6:m,7:[1,10],9:9,12:11,13:s,14:14,16:y,17:N,18:17,19:18,20:S,23:g},e(A,[2,3]),{1:[2,2]},e(A,[2,4]),e(A,[2,5]),{1:[2,6],6:m,12:21,13:s,14:14,16:y,17:N,18:17,19:18,20:S,23:g},{6:m,9:22,12:11,13:s,14:14,16:y,17:N,18:17,19:18,20:S,23:g},{6:P,7:b,10:23,11:j},e(x,[2,24],{18:17,19:18,14:27,16:[1,28],17:[1,29],20:S,23:g}),e(x,[2,19]),e(x,[2,21],{15:30,24:Y}),e(x,[2,22]),e(x,[2,23]),e(L,[2,25]),e(L,[2,26]),e(L,[2,28],{20:[1,32]}),{21:[1,33]},{6:P,7:b,10:34,11:j},{1:[2,7],6:m,12:21,13:s,14:14,16:y,17:N,18:17,19:18,20:S,23:g},e(W,[2,14],{7:k,11:F}),e(T,[2,8]),e(T,[2,9]),e(T,[2,10]),e(x,[2,16],{15:37,24:Y}),e(x,[2,17]),e(x,[2,18]),e(x,[2,20],{24:J}),e(L,[2,31]),{21:[1,39]},{22:[1,40]},e(W,[2,13],{7:k,11:F}),e(T,[2,11]),e(T,[2,12]),e(x,[2,15],{24:J}),e(L,[2,30]),{22:[1,41]},e(L,[2,27]),e(L,[2,29])],defaultActions:{2:[2,1],6:[2,2]},parseError:t(function(r,i){if(i.recoverable)this.trace(r);else{var o=Error(r);throw o.hash=i,o}},"parseError"),parse:t(function(r){var i=this,o=[0],c=[],p=[null],n=[],M=this.table,h="",q=0,he=0,ue=0,be=2,ge=1,ye=n.slice.call(arguments,1),_=Object.create(this.lexer),U={yy:{}};for(var te in this.yy)if(Object.prototype.hasOwnProperty.call(this.yy,te))U.yy[te]=this.yy[te];if(_.setInput(r,U.yy),U.yy.lexer=_,U.yy.parser=this,typeof _.yylloc>"u")_.yylloc={};var ne=_.yylloc;n.push(ne);var me=_.options&&_.options.ranges;if(typeof U.yy.parseError==="function")this.parseError=U.yy.parseError;else this.parseError=Object.getPrototypeOf(this).parseError;function ke(C){o.length=o.length-2*C,p.length=p.length-C,n.length=n.length-C}t(ke,"popStack");function de(){var C=c.pop()||_.lex()||ge;if(typeof C!=="number"){if(C instanceof Array)c=C,C=c.pop();C=i.symbols_[C]||C}return C}t(de,"lex");var v,ie,H,I,Fe,re,K={},Q,B,pe,Z;while(!0){if(H=o[o.length-1],this.defaultActions[H])I=this.defaultActions[H];else{if(v===null||typeof v>"u")v=de();I=M[H]&&M[H][v]}if(typeof I>"u"||!I.length||!I[0]){var se="";Z=[];for(Q in M[H])if(this.terminals_[Q]&&Q>be)Z.push("'"+this.terminals_[Q]+"'");if(_.showPosition)se="Parse error on line "+(q+1)+`:
|
|
2
2
|
`+_.showPosition()+`
|
|
3
|
-
Expecting `+Z.join(", ")+", got '"+(this.terminals_[v]||v)+"'";else se="Parse error on line "+(q+1)+": Unexpected "+(v==ge?"end of input":"'"+(this.terminals_[v]||v)+"'");this.parseError(se,{text:_.match,token:this.terminals_[v]||v,line:_.yylineno,loc:ne,expected:Z})}if(I[0]instanceof Array&&I.length>1)throw Error("Parse Error: multiple actions possible at state: "+H+", token: "+v);switch(I[0]){case 1:if(o.push(v),p.push(_.yytext),n.push(_.yylloc),o.push(I[1]),v=null,!ie){if(he=_.yyleng,h=_.yytext,q=_.yylineno,ne=_.yylloc,ue>0)ue--}else v=ie,ie=null;break;case 2:if(B=this.productions_[I[1]][1],
|
|
4
|
-
`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:
|
|
5
|
-
`+i+"^"},"showPosition"),test_match:
|
|
6
|
-
`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:
|
|
3
|
+
Expecting `+Z.join(", ")+", got '"+(this.terminals_[v]||v)+"'";else se="Parse error on line "+(q+1)+": Unexpected "+(v==ge?"end of input":"'"+(this.terminals_[v]||v)+"'");this.parseError(se,{text:_.match,token:this.terminals_[v]||v,line:_.yylineno,loc:ne,expected:Z})}if(I[0]instanceof Array&&I.length>1)throw Error("Parse Error: multiple actions possible at state: "+H+", token: "+v);switch(I[0]){case 1:if(o.push(v),p.push(_.yytext),n.push(_.yylloc),o.push(I[1]),v=null,!ie){if(he=_.yyleng,h=_.yytext,q=_.yylineno,ne=_.yylloc,ue>0)ue--}else v=ie,ie=null;break;case 2:if(B=this.productions_[I[1]][1],K.$=p[p.length-B],K._$={first_line:n[n.length-(B||1)].first_line,last_line:n[n.length-1].last_line,first_column:n[n.length-(B||1)].first_column,last_column:n[n.length-1].last_column},me)K._$.range=[n[n.length-(B||1)].range[0],n[n.length-1].range[1]];if(re=this.performAction.apply(K,[h,he,q,U.yy,I[1],p,n].concat(ye)),typeof re<"u")return re;if(B)o=o.slice(0,-1*B*2),p=p.slice(0,-1*B),n=n.slice(0,-1*B);o.push(this.productions_[I[1]][0]),p.push(K.$),n.push(K._$),pe=M[o[o.length-2]][o[o.length-1]],o.push(pe);break;case 3:return!0}}return!0},"parse")},ee=function(){var R={EOF:1,parseError:t(function(i,o){if(this.yy.parser)this.yy.parser.parseError(i,o);else throw Error(i)},"parseError"),setInput:t(function(r,i){if(this.yy=i||this.yy||{},this._input=r,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges)this.yylloc.range=[0,0];return this.offset=0,this},"setInput"),input:t(function(){var r=this._input[0];this.yytext+=r,this.yyleng++,this.offset++,this.match+=r,this.matched+=r;var i=r.match(/(?:\r\n?|\n).*/g);if(i)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),r},"input"),unput:t(function(r){var i=r.length,o=r.split(/(?:\r\n?|\n)/g);this._input=r+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-i),this.offset-=i;var c=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),o.length-1)this.yylineno-=o.length-1;var p=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:o?(o.length===c.length?this.yylloc.first_column:0)+c[c.length-o.length].length-o[0].length:this.yylloc.first_column-i},this.options.ranges)this.yylloc.range=[p[0],p[0]+this.yyleng-i];return this.yyleng=this.yytext.length,this},"unput"),more:t(function(){return this._more=!0,this},"more"),reject:t(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:t(function(r){this.unput(this.match.slice(r))},"less"),pastInput:t(function(){var r=this.matched.substr(0,this.matched.length-this.match.length);return(r.length>20?"...":"")+r.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:t(function(){var r=this.match;if(r.length<20)r+=this._input.substr(0,20-r.length);return(r.substr(0,20)+(r.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:t(function(){var r=this.pastInput(),i=Array(r.length+1).join("-");return r+this.upcomingInput()+`
|
|
5
|
+
`+i+"^"},"showPosition"),test_match:t(function(r,i){var o,c,p;if(this.options.backtrack_lexer){if(p={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)p.yylloc.range=this.yylloc.range.slice(0)}if(c=r[0].match(/(?:\r\n?|\n).*/g),c)this.yylineno+=c.length;if(this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:c?c[c.length-1].length-c[c.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+r[0].length},this.yytext+=r[0],this.match+=r[0],this.matches=r,this.yyleng=this.yytext.length,this.options.ranges)this.yylloc.range=[this.offset,this.offset+=this.yyleng];if(this._more=!1,this._backtrack=!1,this._input=this._input.slice(r[0].length),this.matched+=r[0],o=this.performAction.call(this,this.yy,this,i,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input)this.done=!1;if(o)return o;else if(this._backtrack){for(var n in p)this[n]=p[n];return!1}return!1},"test_match"),next:t(function(){if(this.done)return this.EOF;if(!this._input)this.done=!0;var r,i,o,c;if(!this._more)this.yytext="",this.match="";var p=this._currentRules();for(var n=0;n<p.length;n++)if(o=this._input.match(this.rules[p[n]]),o&&(!i||o[0].length>i[0].length)){if(i=o,c=n,this.options.backtrack_lexer)if(r=this.test_match(o,p[n]),r!==!1)return r;else if(this._backtrack){i=!1;continue}else return!1;else if(!this.options.flex)break}if(i){if(r=this.test_match(i,p[c]),r!==!1)return r;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:t(function(){var i=this.next();if(i)return i;else return this.lex()},"lex"),begin:t(function(i){this.conditionStack.push(i)},"begin"),popState:t(function(){var i=this.conditionStack.length-1;if(i>0)return this.conditionStack.pop();else return this.conditionStack[0]},"popState"),_currentRules:t(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:t(function(i){if(i=this.conditionStack.length-1-Math.abs(i||0),i>=0)return this.conditionStack[i];else return"INITIAL"},"topState"),pushState:t(function(i){this.begin(i)},"pushState"),stateStackSize:t(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:t(function(i,o,c,p){var n=p;switch(c){case 0:return this.pushState("shapeData"),o.yytext="",24;break;case 1:return this.pushState("shapeDataStr"),24;break;case 2:return this.popState(),24;break;case 3:let M=/\n\s*/g;return o.yytext=o.yytext.replace(M,"<br/>"),24;break;case 4:return 24;case 5:this.popState();break;case 6:return i.getLogger().trace("Found comment",o.yytext),6;break;case 7:return 8;case 8:this.begin("CLASS");break;case 9:return this.popState(),17;break;case 10:this.popState();break;case 11:i.getLogger().trace("Begin icon"),this.begin("ICON");break;case 12:return i.getLogger().trace("SPACELINE"),6;break;case 13:return 7;case 14:return 16;case 15:i.getLogger().trace("end icon"),this.popState();break;case 16:return i.getLogger().trace("Exploding node"),this.begin("NODE"),20;break;case 17:return i.getLogger().trace("Cloud"),this.begin("NODE"),20;break;case 18:return i.getLogger().trace("Explosion Bang"),this.begin("NODE"),20;break;case 19:return i.getLogger().trace("Cloud Bang"),this.begin("NODE"),20;break;case 20:return this.begin("NODE"),20;break;case 21:return this.begin("NODE"),20;break;case 22:return this.begin("NODE"),20;break;case 23:return this.begin("NODE"),20;break;case 24:return 13;case 25:return 23;case 26:return 11;case 27:this.begin("NSTR2");break;case 28:return"NODE_DESCR";case 29:this.popState();break;case 30:i.getLogger().trace("Starting NSTR"),this.begin("NSTR");break;case 31:return i.getLogger().trace("description:",o.yytext),"NODE_DESCR";break;case 32:this.popState();break;case 33:return this.popState(),i.getLogger().trace("node end ))"),"NODE_DEND";break;case 34:return this.popState(),i.getLogger().trace("node end )"),"NODE_DEND";break;case 35:return this.popState(),i.getLogger().trace("node end ...",o.yytext),"NODE_DEND";break;case 36:return this.popState(),i.getLogger().trace("node end (("),"NODE_DEND";break;case 37:return this.popState(),i.getLogger().trace("node end (-"),"NODE_DEND";break;case 38:return this.popState(),i.getLogger().trace("node end (-"),"NODE_DEND";break;case 39:return this.popState(),i.getLogger().trace("node end (("),"NODE_DEND";break;case 40:return this.popState(),i.getLogger().trace("node end (("),"NODE_DEND";break;case 41:return i.getLogger().trace("Long description:",o.yytext),21;break;case 42:return i.getLogger().trace("Long description:",o.yytext),21;break}},"anonymous"),rules:[/^(?:@\{)/i,/^(?:["])/i,/^(?:["])/i,/^(?:[^\"]+)/i,/^(?:[^}^"]+)/i,/^(?:\})/i,/^(?:\s*%%.*)/i,/^(?:kanban\b)/i,/^(?::::)/i,/^(?:.+)/i,/^(?:\n)/i,/^(?:::icon\()/i,/^(?:[\s]+[\n])/i,/^(?:[\n]+)/i,/^(?:[^\)]+)/i,/^(?:\))/i,/^(?:-\))/i,/^(?:\(-)/i,/^(?:\)\))/i,/^(?:\))/i,/^(?:\(\()/i,/^(?:\{\{)/i,/^(?:\()/i,/^(?:\[)/i,/^(?:[\s]+)/i,/^(?:[^\(\[\n\)\{\}@]+)/i,/^(?:$)/i,/^(?:["][`])/i,/^(?:[^`"]+)/i,/^(?:[`]["])/i,/^(?:["])/i,/^(?:[^"]+)/i,/^(?:["])/i,/^(?:[\)]\))/i,/^(?:[\)])/i,/^(?:[\]])/i,/^(?:\}\})/i,/^(?:\(-)/i,/^(?:-\))/i,/^(?:\(\()/i,/^(?:\()/i,/^(?:[^\)\]\(\}]+)/i,/^(?:.+(?!\(\())/i],conditions:{shapeDataEndBracket:{rules:[],inclusive:!1},shapeDataStr:{rules:[2,3],inclusive:!1},shapeData:{rules:[1,4,5],inclusive:!1},CLASS:{rules:[9,10],inclusive:!1},ICON:{rules:[14,15],inclusive:!1},NSTR2:{rules:[28,29],inclusive:!1},NSTR:{rules:[31,32],inclusive:!1},NODE:{rules:[27,30,33,34,35,36,37,38,39,40,41,42],inclusive:!1},INITIAL:{rules:[0,6,7,8,11,12,13,16,17,18,19,20,21,22,23,24,25,26],inclusive:!0}}};return R}();G.lexer=ee;function z(){this.yy={}}return t(z,"Parser"),z.prototype=G,G.Parser=z,new z}();ae.parser=ae;var Ee=ae,w=[],ce=[],oe=0,le={},_e=t(()=>{w=[],ce=[],oe=0,le={}},"clear"),Se=t((e)=>{if(w.length===0)return null;let f=w[0].level,m=null;for(let s=w.length-1;s>=0;s--){if(w[s].level===f&&!m)m=w[s];if(w[s].level<f)throw Error('Items without section detected, found section ("'+w[s].label+'")')}if(e===m?.level)return null;return m},"getSection"),fe=t(function(){return ce},"getSections"),Ne=t(function(){let e=[],f=[],m=fe(),s=l();for(let y of m){let N={id:y.id,label:O(y.label??"",s),labelType:"markdown",isGroup:!0,ticket:y.ticket,shape:"kanbanSection",level:y.level,look:s.look};f.push(N);let S=w.filter((g)=>g.parentId===y.id);for(let g of S){let A={id:g.id,parentId:y.id,label:O(g.label??"",s),labelType:"markdown",isGroup:!1,ticket:g?.ticket,priority:g?.priority,assigned:g?.assigned,icon:g?.icon,shape:"kanbanItem",level:g.level,rx:5,ry:5,cssStyles:["text-align: left"]};f.push(A)}}return{nodes:f,edges:e,other:{},config:l()}},"getData"),xe=t((e,f,m,s,y)=>{let N=l(),S=N.mindmap?.padding??D.mindmap.padding;switch(s){case E.ROUNDED_RECT:case E.RECT:case E.HEXAGON:S*=2}let g={id:O(f,N)||"kbn"+oe++,level:e,label:O(m,N),width:N.mindmap?.maxNodeWidth??D.mindmap.maxNodeWidth,padding:S,isGroup:!1};if(y!==void 0){let P;if(!y.includes(`
|
|
7
7
|
`))P=`{
|
|
8
8
|
`+y+`
|
|
9
9
|
}`;else P=y+`
|
|
10
|
-
`;let b=tt(P,{schema:et});if(b.shape&&(b.shape!==b.shape.toLowerCase()||b.shape.includes("_")))throw Error(`No such shape: ${b.shape}. Shape names should be lowercase.`);if(b?.shape&&b.shape==="kanbanItem")g.shape=b?.shape;if(b?.label)g.label=b?.label;if(b?.icon)g.icon=b?.icon.toString();if(b?.assigned)g.assigned=b?.assigned.toString();if(b?.ticket)g.ticket=b?.ticket.toString();if(b?.priority)g.priority=b?.priority}let A=Se(
|
|
11
|
-
`+
|
|
10
|
+
`;let b=tt(P,{schema:et});if(b.shape&&(b.shape!==b.shape.toLowerCase()||b.shape.includes("_")))throw Error(`No such shape: ${b.shape}. Shape names should be lowercase.`);if(b?.shape&&b.shape==="kanbanItem")g.shape=b?.shape;if(b?.label)g.label=b?.label;if(b?.icon)g.icon=b?.icon.toString();if(b?.assigned)g.assigned=b?.assigned.toString();if(b?.ticket)g.ticket=b?.ticket.toString();if(b?.priority)g.priority=b?.priority}let A=Se(e);if(A)g.parentId=A.id||"kbn"+oe++;else ce.push(g);w.push(g)},"addNode"),E={DEFAULT:0,NO_BORDER:0,ROUNDED_RECT:1,RECT:2,CIRCLE:3,CLOUD:4,BANG:5,HEXAGON:6},ve=t((e,f)=>{switch(a.debug("In get type",e,f),e){case"[":return E.RECT;case"(":return f===")"?E.ROUNDED_RECT:E.CLOUD;case"((":return E.CIRCLE;case")":return E.CLOUD;case"))":return E.BANG;case"{{":return E.HEXAGON;default:return E.DEFAULT}},"getType"),De=t((e,f)=>{le[e]=f},"setElementForId"),Le=t((e)=>{if(!e)return;let f=l(),m=w[w.length-1];if(e.icon)m.icon=O(e.icon,f);if(e.class)m.cssClasses=O(e.class,f)},"decorateNode"),Oe=t((e)=>{switch(e){case E.DEFAULT:return"no-border";case E.RECT:return"rect";case E.ROUNDED_RECT:return"rounded-rect";case E.CIRCLE:return"circle";case E.CLOUD:return"cloud";case E.BANG:return"bang";case E.HEXAGON:return"hexgon";default:return"no-border"}},"type2Str"),Ie=t(()=>a,"getLogger"),Ce=t((e)=>le[e],"getElementById"),we={clear:_e,addNode:xe,getSections:fe,getData:Ne,nodeType:E,getType:ve,setElementForId:De,decorateNode:Le,type2Str:Oe,getLogger:Ie,getElementById:Ce},Ae=we,Te=t(async(e,f,m,s)=>{a.debug(`Rendering kanban diagram
|
|
11
|
+
`+e);let N=s.db.getData(),S=l();S.htmlLabels=!1;let g=V(f);for(let k of N.nodes)k.domId=`${f}-${k.id}`;let A=g.append("g");A.attr("class","sections");let P=g.append("g");P.attr("class","items");let b=N.nodes.filter((k)=>k.isGroup),j=0,x=10,Y=[],L=25;for(let k of b){let F=S?.kanban?.sectionWidth||200;j=j+1,k.x=F*j+(j-1)*x/2,k.width=F,k.y=0,k.height=F*3,k.rx=5,k.ry=5,k.cssClasses=k.cssClasses+" section-"+j;let T=await tn(A,k);L=Math.max(L,T?.labelBBox?.height),Y.push(T)}let W=0;for(let k of b){let F=Y[W];W=W+1;let T=S?.kanban?.sectionWidth||200,J=-T*3/2+L,G=J,ee=N.nodes.filter((r)=>r.parentId===k.id);for(let r of ee){if(r.isGroup)throw Error("Groups within groups are not allowed in Kanban diagrams");r.x=k.x,r.width=T-1.5*x;let o=(await Et(P,r,{config:S})).node().getBBox();r.y=G+o.height/2,await yt(r),G=r.y+o.height/2+x/2}let z=F.cluster.select("rect"),R=Math.max(G-J+3*x,50)+(L-25);z.attr("height",R)}ht(void 0,g,S.mindmap?.padding??D.kanban.padding,S.mindmap?.useMaxWidth??D.kanban.useMaxWidth)},"draw"),Re={draw:Te},Pe=t((e)=>{let f="";for(let s=0;s<e.THEME_COLOR_LIMIT;s++)if(e["lineColor"+s]=e["lineColor"+s]||e["cScaleInv"+s],X(e["lineColor"+s]))e["lineColor"+s]=u(e["lineColor"+s],20);else e["lineColor"+s]=d(e["lineColor"+s],20);let m=t((s,y)=>e.darkMode?d(s,y):u(s,y),"adjuster");for(let s=0;s<e.THEME_COLOR_LIMIT;s++){let y=""+(17-3*s);f+=`
|
|
12
12
|
.section-${s-1} rect, .section-${s-1} path, .section-${s-1} circle, .section-${s-1} polygon, .section-${s-1} path {
|
|
13
|
-
fill: ${m(
|
|
14
|
-
stroke: ${m(
|
|
13
|
+
fill: ${m(e["cScale"+s],10)};
|
|
14
|
+
stroke: ${m(e["cScale"+s],10)};
|
|
15
15
|
|
|
16
16
|
}
|
|
17
17
|
.section-${s-1} text {
|
|
18
|
-
fill: ${
|
|
18
|
+
fill: ${e["cScaleLabel"+s]};
|
|
19
19
|
}
|
|
20
20
|
.node-icon-${s-1} {
|
|
21
21
|
font-size: 40px;
|
|
22
|
-
color: ${
|
|
22
|
+
color: ${e["cScaleLabel"+s]};
|
|
23
23
|
}
|
|
24
24
|
.section-edge-${s-1}{
|
|
25
|
-
stroke: ${
|
|
25
|
+
stroke: ${e["cScale"+s]};
|
|
26
26
|
}
|
|
27
27
|
.edge-depth-${s-1}{
|
|
28
28
|
stroke-width: ${y};
|
|
29
29
|
}
|
|
30
30
|
.section-${s-1} line {
|
|
31
|
-
stroke: ${
|
|
31
|
+
stroke: ${e["cScaleInv"+s]} ;
|
|
32
32
|
stroke-width: 3;
|
|
33
33
|
}
|
|
34
34
|
|
|
@@ -44,26 +44,26 @@ Expecting `+Z.join(", ")+", got '"+(this.terminals_[v]||v)+"'";else se="Parse er
|
|
|
44
44
|
.node ellipse,
|
|
45
45
|
.node polygon,
|
|
46
46
|
.node path {
|
|
47
|
-
fill: ${
|
|
48
|
-
stroke: ${
|
|
47
|
+
fill: ${e.background};
|
|
48
|
+
stroke: ${e.nodeBorder};
|
|
49
49
|
stroke-width: 1px;
|
|
50
50
|
}
|
|
51
51
|
|
|
52
52
|
.kanban-ticket-link {
|
|
53
|
-
fill: ${
|
|
54
|
-
stroke: ${
|
|
53
|
+
fill: ${e.background};
|
|
54
|
+
stroke: ${e.nodeBorder};
|
|
55
55
|
text-decoration: underline;
|
|
56
56
|
}
|
|
57
|
-
`}return f},"genSections"),Ve=
|
|
57
|
+
`}return f},"genSections"),Ve=t((e)=>`
|
|
58
58
|
.edge {
|
|
59
59
|
stroke-width: 3;
|
|
60
60
|
}
|
|
61
|
-
${Pe(
|
|
61
|
+
${Pe(e)}
|
|
62
62
|
.section-root rect, .section-root path, .section-root circle, .section-root polygon {
|
|
63
|
-
fill: ${
|
|
63
|
+
fill: ${e.git0};
|
|
64
64
|
}
|
|
65
65
|
.section-root text {
|
|
66
|
-
fill: ${
|
|
66
|
+
fill: ${e.gitBranchLabel0};
|
|
67
67
|
}
|
|
68
68
|
.icon-container {
|
|
69
69
|
height:100%;
|
|
@@ -75,8 +75,8 @@ Expecting `+Z.join(", ")+", got '"+(this.terminals_[v]||v)+"'";else se="Parse er
|
|
|
75
75
|
fill: none;
|
|
76
76
|
}
|
|
77
77
|
.cluster-label, .label {
|
|
78
|
-
color: ${
|
|
79
|
-
fill: ${
|
|
78
|
+
color: ${e.textColor};
|
|
79
|
+
fill: ${e.textColor};
|
|
80
80
|
}
|
|
81
81
|
.kanban-label {
|
|
82
82
|
dy: 1em;
|