PageSourceSearch

https://nickz.ai/assets/js/gitGraphDiagram-K3NZZRJ6-CJuKNLAQ.js

js nickz.ai collected 2026-10-05 14:21:27 UTC 24,408 bytes, 1 lines download raw bytes

1import{p as t}from"./chunk-4BX2VUAB-CJu338GO.js";import{I as r}from"./chunk-QZHKN3VN-D5cQ1iop.js";import{t as e,q as o,s as n,g as a,a as s,b as c,_ as i,l as d,d as h,u as m,E as $,z as l,k as y,F as g,G as p,H as x,I as f}from"./index-C16DHWFp.js";import{p as u}from"./treemap-KZPCXAKY-DdCrRx6w.js";import"./vendor-react-DejgYtBM.js";import"./vendor-semi-D8d7bTtM.js";import"./index-BeIIFw6E.js";import"./vendor-icons-EJvJ5X-w.js";import"./vendor-motion-Chfy_MiU.js";import"./vendor-katex-BuQuj6Fv.js";import"./dayjs.min-CASHsil8.js";import"./purify.es-Bm-lHtoJ.js";import"./index-DcbB2zxU.js";import"./vendor-highlight-CaHTjBxz.js";import"./index-B_PxGnmD.js";import"./_baseUniq-BjWlgG8Y.js";import"./_basePickBy-bVyxPQRR.js";import"./clone-VMOlTGG7.js";var b={NORMAL:0,REVERSE:1,HIGHLIGHT:2,MERGE:3,CHERRY_PICK:4},w=p.gitGraph,B=i(()=>g({...w,...x().gitGraph}),"getConfig"),E=new r(()=>{const t=B(),r=t.mainBranchName,e=t.mainBranchOrder;return{mainBranchName:r,commits:new Map,head:null,branchConfig:new Map([[r,{name:r,order:e}]]),branches:new Map([[r,null]]),currBranch:r,direction:"LR",seq:0,options:{}}});function k(){return f({length:7})}function C(t,r){const e=Object.create(null);return t.reduce((t,o)=>{const n=r(o);return e[n]||(e[n]=!0,t.push(o)),t},[])}i(k,"getID"),i(C,"uniqBy");var L=i(function(t){E.records.direction=t},"setDirection"),T=i(function(t){d.debug("options str",t),t=t?.trim(),t=t||"{}";try{E.records.options=JSON.parse(t)}catch(r){d.error("error while parsing gitGraph options",r.message)}},"setOptions"),M=i(function(){return E.records.options},"getOptions"),v=i(function(t){let r=t.msg,e=t.id;const o=t.type;let n=t.tags;d.info("commit",r,e,o,n),d.debug("Entering commit:",r,e,o,n);const a=B();e=y.sanitizeText(e,a),r=y.sanitizeText(r,a),n=n?.map(t=>y.sanitizeText(t,a));const s={id:e||E.records.seq+"-"+k(),message:r,seq:E.records.seq++,type:o??b.NORMAL,tags:n??[],parents:null==E.records.head?[]:[E.records.head.id],branch:E.records.currBranch};E.records.head=s,d.info("main branch",a.mainBranchName),E.records.commits.has(s.id)&&d.warn(`Commit ID ${s.id} already exists`),E.records.commits.set(s.id,s),E.records.branches.set(E.records.currBranch,s.id),d.debug("in pushCommit "+s.id)},"commit"),P=i(function(t){let r=t.name;const e=t.order;if(r=y.sanitizeText(r,B()),E.records.branches.has(r))throw new 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}")`);E.records.branches.set(r,null!=E.records.head?E.records.head.id:null),E.records.branchConfig.set(r,{name:r,order:e}),A(r),d.debug("in createBranch")},"branch"),R=i(t=>{let r=t.branch,e=t.id;const o=t.type,n=t.tags,a=B();r=y.sanitizeText(r,a),e&&(e=y.sanitizeText(e,a));const s=E.records.branches.get(E.records.currBranch),c=E.records.branches.get(r),i=s?E.records.commits.get(s):void 0,h=c?E.records.commits.get(c):void 0;if(i&&h&&i.branch===r)throw new Error(`Cannot merge branch '${r}' into itself.`);if(E.records.currBranch===r){const t=new Error('Incorrect usage of "merge". Cannot merge a branch to itself');throw t.hash={text:`merge ${r}`,token:`merge ${r}`,expected:["branch abc"]},t}if(void 0===i||!i){const t=new Error(`Incorrect usage of "merge". Current branch (${E.records.currBranch})has no commits`);throw t.hash={text:`merge ${r}`,token:`merge ${r}`,expected:["commit"]},t}if(!E.records.branches.has(r)){const t=new Error('Incorrect usage of "merge". Branch to be merged ('+r+") does not exist");throw t.hash={text:`merge ${r}`,token:`merge ${r}`,expected:[`branch ${r}`]},t}if(void 0===h||!h){const t=new Error('Incorrect usage of "merge". Branch to be merged ('+r+") has no commits");throw t.hash={text:`merge ${r}`,token:`merge ${r}`,expected:['"commit"']},t}if(i===h){const t=new Error('Incorrect usage of "merge". Both branches have same head');throw t.hash={text:`merge ${r}`,token:`merge ${r}`,expected:["branch abc"]},t}if(e&&E.records.commits.has(e)){const t=new Error('Incorrect usage of "merge". Commit with id:'+e+" already exists, use different custom id");throw t.hash={text:`merge ${r} ${e} ${o} ${n?.join(" ")}`,token:`merge ${r} ${e} ${o} ${n?.join(" ")}`,expected:[`merge ${r} ${e}_UNIQUE ${o} ${n?.join(" ")}`]},t}const m=c||"",$={id:e||`${E.records.seq}-${k()}`,message:`merged branch ${r} into ${E.records.currBranch}`,seq:E.records.seq++,parents:null==E.records.head?[]:[E.records.head.id,m],branch:E.records.currBranch,type:b.MERGE,customType:o,customId:!!e,tags:n??[]};E.records.head=$,E.records.commits.set($.id,$),E.records.branches.set(E.records.currBranch,$.id),d.debug(E.records.branches),d.debug("in mergeBranch")},"merge"),I=i(function(t){let r=t.id,e=t.targetId,o=t.tags,n=t.parent;d.debug("Entering cherryPick:",r,e,o);const a=B();if(r=y.sanitizeText(r,a),e=y.sanitizeText(e,a),o=o?.map(t=>y.sanitizeText(t,a)),n=y.sanitizeText(n,a),!r||!E.records.commits.has(r)){const t=new Error('Incorrect usage of "cherryPick". Source commit id should exist and provided');throw t.hash={text:`cherryPick ${r} ${e}`,token:`cherryPick ${r} ${e}`,expected:["cherry-pick abc"]},t}const s=E.records.commits.get(r);if(void 0===s||!s)throw new Error('Incorrect usage of "cherryPick". Source commit id should exist and provided');if(n&&(!Array.isArray(s.parents)||!s.parents.includes(n)))throw new Error("Invalid operation: The specified parent commit is not an immediate parent of the cherry-picked commit.");const c=s.branch;
1if(s.type===b.MERGE&&!n)throw new Error("Incorrect usage of cherry-pick: If the source commit is a merge commit, an immediate parent commit must be specified.");if(!e||!E.records.commits.has(e)){if(c===E.records.currBranch){const t=new Error('Incorrect usage of "cherryPick". Source commit is already on current branch');throw t.hash={text:`cherryPick ${r} ${e}`,token:`cherryPick ${r} ${e}`,expected:["cherry-pick abc"]},t}const t=E.records.branches.get(E.records.currBranch);if(void 0===t||!t){const t=new Error(`Incorrect usage of "cherry-pick". Current branch (${E.records.currBranch})has no commits`);throw t.hash={text:`cherryPick ${r} ${e}`,token:`cherryPick ${r} ${e}`,expected:["cherry-pick abc"]},t}const a=E.records.commits.get(t);if(void 0===a||!a){const t=new Error(`Incorrect usage of "cherry-pick". Current branch (${E.records.currBranch})has no commits`);throw t.hash={text:`cherryPick ${r} ${e}`,token:`cherryPick ${r} ${e}`,expected:["cherry-pick abc"]},t}const i={id:E.records.seq+"-"+k(),message:`cherry-picked ${s?.message} into ${E.records.currBranch}`,seq:E.records.seq++,parents:null==E.records.head?[]:[E.records.head.id,s.id],branch:E.records.currBranch,type:b.CHERRY_PICK,tags:o?o.filter(Boolean):[`cherry-pick:${s.id}${s.type===b.MERGE?`|parent:${n}`:""}`]};E.records.head=i,E.records.commits.set(i.id,i),E.records.branches.set(E.records.currBranch,i.id),d.debug(E.records.branches),d.debug("in cherryPick")}},"cherryPick"),A=i(function(t){if(t=y.sanitizeText(t,B()),!E.records.branches.has(t)){const r=new 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}{E.records.currBranch=t;const r=E.records.branches.get(E.records.currBranch);E.records.head=void 0!==r&&r?E.records.commits.get(r)??null:null}},"checkout");function j(t,r,e){const o=t.indexOf(r);-1===o?t.push(e):t.splice(o,1,e)}function G(t){const r=t.reduce((t,r)=>t.seq>r.seq?t:r,t[0]);let e="";t.forEach(function(t){e+=t===r?"\t*":"\t|"});const o=[e,r.id,r.seq];for(const n in E.records.branches)E.records.branches.get(n)===r.id&&o.push(n);if(d.debug(o.join(" ")),r.parents&&2==r.parents.length&&r.parents[0]&&r.parents[1]){const e=E.records.commits.get(r.parents[0]);j(t,r,e),r.parents[1]&&t.push(E.records.commits.get(r.parents[1]))}else{if(0==r.parents.length)return;if(r.parents[0]){const e=E.records.commits.get(r.parents[0]);j(t,r,e)}}G(t=C(t,t=>t.id))}i(j,"upsert"),i(G,"prettyPrintCommitHistory");var O=i(function(){d.debug(E.records.commits),G([S()[0]])},"prettyPrint"),q=i(function(){E.reset(),l()},"clear"),H=i(function(){return[...E.records.branchConfig.values()].map((t,r)=>null!==t.order&&void 0!==t.order?t:{...t,order:parseFloat(`0.${r}`)}).sort((t,r)=>(t.order??0)-(r.order??0)).map(({name:t})=>({name:t}))},"getBranchesAsObjArray"),z=i(function(){return E.records.branches},"getBranches"),N=i(function(){return E.records.commits},"getCommits"),S=i(function(){const t=[...E.records.commits.values()];return t.forEach(function(t){d.debug(t.id)}),t.sort((t,r)=>t.seq-r.seq),t},"getCommitsArray"),D={commitType:b,getConfig:B,setDirection:L,setOptions:T,getOptions:M,commit:v,branch:P,merge:R,cherryPick:I,checkout:A,prettyPrint:O,clear:q,getBranchesAsObjArray:H,getBranches:z,getCommits:N,getCommitsArray:S,getCurrentBranch:i(function(){return E.records.currBranch},"getCurrentBranch"),getDirection:i(function(){return E.records.direction},"getDirection"),getHead:i(function(){return E.records.head},"getHead"),setAccTitle:c,getAccTitle:s,getAccDescription:a,setAccDescription:n,setDiagramTitle:o,getDiagramTitle:e},W=i((r,e)=>{t(r,e),r.dir&&e.setDirection(r.dir);for(const t of r.statements)K(t,e)},"populate"),K=i((t,r)=>{const e={Commit:i(t=>r.commit(_(t)),"Commit"),Branch:i(t=>r.branch(F(t)),"Branch"),Merge:i(t=>r.merge(Y(t)),"Merge"),Checkout:i(t=>r.checkout(U(t)),"Checkout"),CherryPicking:i(t=>r.cherryPick(V(t)),"CherryPicking")}[t.$type];e?e(t):d.error(`Unknown statement type: ${t.$type}`)},"parseStatement"),_=i(t=>({id:t.id,msg:t.message??"",type:void 0!==t.type?b[t.type]:b.NORMAL,tags:t.tags??void 0}),"parseCommit"),F=i(t=>({name:t.name,order:t.order??0}),"parseBranch"),Y=i(t=>({branch:t.branch,id:t.id??"",type:void 0!==t.type?b[t.type]:void 0,tags:t.tags??void 0}),"parseMerge"),U=i(t=>t.branch,"parseCheckout"),V=i(t=>({id:t.id,targetId:"",tags:0===t.tags?.length?void 0:t.tags,parent:t.parent}),"parseCherryPicking"),X={parse:i(async t=>{const r=await u("gitGraph",t);d.debug(r),W(r,D)},"parse")},Z=10,J=40,Q=new Map,tt=new Map,rt=new Map,et=[],ot=0,nt="LR",at=i(()=>{Q.clear(),tt.clear(),rt.clear(),ot=0,et=[],nt="LR"},"clear"),st=i(t=>{const r=document.createElementNS("http://www.w3.org/2000/svg","text");return("string"==typeof t?t.split(/\\n|\n|<br\s*\/?>/gi):t).forEach(t=>{const e=document.createElementNS("http://www.w3.org/2000/svg","tspan");e.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve"),e.setAttribute("dy","1em"),e.setAttribute("x","0"),e.setAttribute("class","row"),e.textContent=t.trim(),r.appendChild(e)}),r},"drawText"),ct=i(t=>{let r,e,o;
1return"BT"===nt?(e=i((t,r)=>t<=r,"comparisonFunc"),o=1/0):(e=i((t,r)=>t>=r,"comparisonFunc"),o=0),t.forEach(t=>{const n="TB"===nt||"BT"==nt?tt.get(t)?.y:tt.get(t)?.x;void 0!==n&&e(n,o)&&(r=t,o=n)}),r},"findClosestParent"),it=i(t=>{let r="",e=1/0;return t.forEach(t=>{const o=tt.get(t).y;o<=e&&(r=t,e=o)}),r||void 0},"findClosestParentBT"),dt=i((t,r,e)=>{let o=e,n=e;const a=[];t.forEach(t=>{const e=r.get(t);if(!e)throw new Error(`Commit not found for key ${t}`);e.parents.length?(o=mt(e),n=Math.max(o,n)):a.push(e),$t(e,o)}),o=n,a.forEach(t=>{lt(t,o,e)}),t.forEach(t=>{const e=r.get(t);if(e?.parents.length){const t=it(e.parents);o=tt.get(t).y-J,o<=n&&(n=o);const r=Q.get(e.branch).pos,a=o-Z;tt.set(e.id,{x:r,y:a})}})},"setParallelBTPos"),ht=i(t=>{const r=ct(t.parents.filter(t=>null!==t));if(!r)throw new Error(`Closest parent not found for commit ${t.id}`);const e=tt.get(r)?.y;if(void 0===e)throw new Error(`Closest parent position not found for commit ${t.id}`);return e},"findClosestParentPos"),mt=i(t=>ht(t)+J,"calculateCommitPosition"),$t=i((t,r)=>{const e=Q.get(t.branch);if(!e)throw new Error(`Branch not found for commit ${t.id}`);const o=e.pos,n=r+Z;return tt.set(t.id,{x:o,y:n}),{x:o,y:n}},"setCommitPosition"),lt=i((t,r,e)=>{const o=Q.get(t.branch);if(!o)throw new Error(`Branch not found for commit ${t.id}`);const n=r+e,a=o.pos;tt.set(t.id,{x:a,y:n})},"setRootPosition"),yt=i((t,r,e,o,n,a)=>{if(a===b.HIGHLIGHT)t.append("rect").attr("x",e.x-10).attr("y",e.y-10).attr("width",20).attr("height",20).attr("class",`commit ${r.id} commit-highlight${n%8} ${o}-outer`),t.append("rect").attr("x",e.x-6).attr("y",e.y-6).attr("width",12).attr("height",12).attr("class",`commit ${r.id} commit${n%8} ${o}-inner`);else if(a===b.CHERRY_PICK)t.append("circle").attr("cx",e.x).attr("cy",e.y).attr("r",10).attr("class",`commit ${r.id} ${o}`),t.append("circle").attr("cx",e.x-3).attr("cy",e.y+2).attr("r",2.75).attr("fill","#fff").attr("class",`commit ${r.id} ${o}`),t.append("circle").attr("cx",e.x+3).attr("cy",e.y+2).attr("r",2.75).attr("fill","#fff").attr("class",`commit ${r.id} ${o}`),t.append("line").attr("x1",e.x+3).attr("y1",e.y+1).attr("x2",e.x).attr("y2",e.y-5).attr("stroke","#fff").attr("class",`commit ${r.id} ${o}`),t.append("line").attr("x1",e.x-3).attr("y1",e.y+1).attr("x2",e.x).attr("y2",e.y-5).attr("stroke","#fff").attr("class",`commit ${r.id} ${o}`);else{const s=t.append("circle");if(s.attr("cx",e.x),s.attr("cy",e.y),s.attr("r",r.type===b.MERGE?9:10),s.attr("class",`commit ${r.id} commit${n%8}`),a===b.MERGE){const a=t.append("circle");a.attr("cx",e.x),a.attr("cy",e.y),a.attr("r",6),a.attr("class",`commit ${o} ${r.id} commit${n%8}`)}a===b.REVERSE&&t.append("path").attr("d",`M ${e.x-5},${e.y-5}L${e.x+5},${e.y+5}M${e.x-5},${e.y+5}L${e.x+5},${e.y-5}`).attr("class",`commit ${o} ${r.id} commit${n%8}`)}},"drawCommitBullet"),gt=i((t,r,e,o,n)=>{if(r.type!==b.CHERRY_PICK&&(r.customId&&r.type===b.MERGE||r.type!==b.MERGE)&&n.showCommitLabel){const a=t.append("g"),s=a.insert("rect").attr("class","commit-label-bkg"),c=a.append("text").attr("x",o).attr("y",e.y+25).attr("class","commit-label").text(r.id),i=c.node()?.getBBox();if(i&&(s.attr("x",e.posWithOffset-i.width/2-2).attr("y",e.y+13.5).attr("width",i.width+4).attr("height",i.height+4),"TB"===nt||"BT"===nt?(s.attr("x",e.x-(i.width+16+5)).attr("y",e.y-12),c.attr("x",e.x-(i.width+16)).attr("y",e.y+i.height-12)):c.attr("x",e.posWithOffset-i.width/2),n.rotateCommitLabel))if("TB"===nt||"BT"===nt)c.attr("transform","rotate(-45, "+e.x+", "+e.y+")"),s.attr("transform","rotate(-45, "+e.x+", "+e.y+")");else{const t=-7.5-(i.width+10)/25*9.5,r=10+i.width/25*8.5;a.attr("transform","translate("+t+", "+r+") rotate(-45, "+o+", "+e.y+")")}}},"drawCommitLabel"),pt=i((t,r,e,o)=>{if(r.tags.length>0){let n=0,a=0,s=0;const c=[];for(const o of r.tags.reverse()){const r=t.insert("polygon"),i=t.append("circle"),d=t.append("text").attr("y",e.y-16-n).attr("class","tag-label").text(o),h=d.node()?.getBBox();if(!h)throw new Error("Tag bbox not found");a=Math.max(a,h.width),s=Math.max(s,h.height),d.attr("x",e.posWithOffset-h.width/2),c.push({tag:d,hole:i,rect:r,yOffset:n}),n+=20}for(const{tag:t,hole:r,rect:i,yOffset:d}of c){const n=s/2,c=e.y-19.2-d;if(i.attr("class","tag-label-bkg").attr("points",`\n      ${o-a/2-2},${c+2}  \n      ${o-a/2-2},${c-2}\n      ${e.posWithOffset-a/2-4},${c-n-2}\n      ${e.posWithOffset+a/2+4},${c-n-2}\n      ${e.posWithOffset+a/2+4},${c+n+2}\n      ${e.posWithOffset-a/2-4},${c+n+2}`),r.attr("cy",c).attr("cx",o-a/2+2).attr("r",1.5).attr("class","tag-hole"),"TB"===nt||"BT"===nt){const s=o+d;i.attr("class","tag-label-bkg").attr("points",`\n        ${e.x},${s+2}\n        ${e.x},${s-2}\n        ${e.x+Z},${s-n-2}\n        ${e.x+Z+a+4},${s-n-2}\n        ${e.x+Z+a+4},${s+n+2}\n        ${e.x+Z},${s+n+2}`).attr("transform","translate(12,12) rotate(45, "+e.x+","+o+")"),r.attr("cx",e.x+2).attr("cy",s).attr("transform","translate(12,12) rotate(45, "+e.x+","+o+")"),t.attr("x",e.x+5).attr("y",s+3).attr("transform","translate(14,14) rotate(45, "+e.x+","+o+")")}}}},"drawCommitTags"),xt=i(t=>{switch(t.customType??t.type){case b.NORMAL:return"commit-normal";case b.REVERSE:return"commit-reverse";case b.HIGHLIGHT:return"commit-highlight";case b.MERGE:return"commit-merge";
1case b.CHERRY_PICK:return"commit-cherry-pick";default:return"commit-normal"}},"getCommitClassType"),ft=i((t,r,e,o)=>{const n={x:0,y:0};if(!(t.parents.length>0))return"TB"===r?30:"BT"===r?(o.get(t.id)??n).y-J:0;{const e=ct(t.parents);if(e){const a=o.get(e)??n;return"TB"===r?a.y+J:"BT"===r?(o.get(t.id)??n).y-J:a.x+J}}return 0},"calculatePosition"),ut=i((t,r,e)=>{const o="BT"===nt&&e?r:r+Z,n="TB"===nt||"BT"===nt?o:Q.get(t.branch)?.pos,a="TB"===nt||"BT"===nt?Q.get(t.branch)?.pos:o;if(void 0===a||void 0===n)throw new Error(`Position were undefined for commit ${t.id}`);return{x:a,y:n,posWithOffset:o}},"getCommitPosition"),bt=i((t,r,e,o)=>{const n=t.append("g").attr("class","commit-bullets"),a=t.append("g").attr("class","commit-labels");let s="TB"===nt||"BT"===nt?30:0;const c=[...r.keys()],d=o.parallelCommits??!1,h=i((t,e)=>{const o=r.get(t)?.seq,n=r.get(e)?.seq;return void 0!==o&&void 0!==n?o-n:0},"sortKeys");let m=c.sort(h);"BT"===nt&&(d&&dt(m,r,s),m=m.reverse()),m.forEach(t=>{const c=r.get(t);if(!c)throw new Error(`Commit not found for key ${t}`);d&&(s=ft(c,nt,s,tt));const i=ut(c,s,d);if(e){const t=xt(c),r=c.customType??c.type,e=Q.get(c.branch)?.index??0;yt(n,c,i,t,e,r),gt(a,c,i,s,o),pt(a,c,i,s)}"TB"===nt||"BT"===nt?tt.set(c.id,{x:i.x,y:i.posWithOffset}):tt.set(c.id,{x:i.posWithOffset,y:i.y}),s="BT"===nt&&d?s+J:s+J+Z,s>ot&&(ot=s)})},"drawCommits"),wt=i((t,r,e,o,n)=>{const a=("TB"===nt||"BT"===nt?e.x<o.x:e.y<o.y)?r.branch:t.branch,s=i(t=>t.branch===a,"isOnBranchToGetCurve"),c=i(e=>e.seq>t.seq&&e.seq<r.seq,"isBetweenCommits");return[...n.values()].some(t=>c(t)&&s(t))},"shouldRerouteArrow"),Bt=i((t,r,e=0)=>{const o=t+Math.abs(t-r)/2;if(e>5)return o;if(et.every(t=>Math.abs(t-o)>=10))return et.push(o),o;const n=Math.abs(t-r);return Bt(t,r-n/5,e+1)},"findLane"),Et=i((t,r,e,o)=>{const n=tt.get(r.id),a=tt.get(e.id);if(void 0===n||void 0===a)throw new Error(`Commit positions not found for commits ${r.id} and ${e.id}`);const s=wt(r,e,n,a,o);let c,i="",d="",h=0,m=0,$=Q.get(e.branch)?.index;if(e.type===b.MERGE&&r.id!==e.parents[0]&&($=Q.get(r.branch)?.index),s){i="A 10 10, 0, 0, 0,",d="A 10 10, 0, 0, 1,",h=10,m=10;const t=n.y<a.y?Bt(n.y,a.y):Bt(a.y,n.y),e=n.x<a.x?Bt(n.x,a.x):Bt(a.x,n.x);"TB"===nt?n.x<a.x?c=`M ${n.x} ${n.y} L ${e-h} ${n.y} ${d} ${e} ${n.y+m} L ${e} ${a.y-h} ${i} ${e+m} ${a.y} L ${a.x} ${a.y}`:($=Q.get(r.branch)?.index,c=`M ${n.x} ${n.y} L ${e+h} ${n.y} ${i} ${e} ${n.y+m} L ${e} ${a.y-h} ${d} ${e-m} ${a.y} L ${a.x} ${a.y}`):"BT"===nt?n.x<a.x?c=`M ${n.x} ${n.y} L ${e-h} ${n.y} ${i} ${e} ${n.y-m} L ${e} ${a.y+h} ${d} ${e+m} ${a.y} L ${a.x} ${a.y}`:($=Q.get(r.branch)?.index,c=`M ${n.x} ${n.y} L ${e+h} ${n.y} ${d} ${e} ${n.y-m} L ${e} ${a.y+h} ${i} ${e-m} ${a.y} L ${a.x} ${a.y}`):n.y<a.y?c=`M ${n.x} ${n.y} L ${n.x} ${t-h} ${i} ${n.x+m} ${t} L ${a.x-h} ${t} ${d} ${a.x} ${t+m} L ${a.x} ${a.y}`:($=Q.get(r.branch)?.index,c=`M ${n.x} ${n.y} L ${n.x} ${t+h} ${d} ${n.x+m} ${t} L ${a.x-h} ${t} ${i} ${a.x} ${t-m} L ${a.x} ${a.y}`)}else i="A 20 20, 0, 0, 0,",d="A 20 20, 0, 0, 1,",h=20,m=20,"TB"===nt?(n.x<a.x&&(c=e.type===b.MERGE&&r.id!==e.parents[0]?`M ${n.x} ${n.y} L ${n.x} ${a.y-h} ${i} ${n.x+m} ${a.y} L ${a.x} ${a.y}`:`M ${n.x} ${n.y} L ${a.x-h} ${n.y} ${d} ${a.x} ${n.y+m} L ${a.x} ${a.y}`),n.x>a.x&&(i="A 20 20, 0, 0, 0,",d="A 20 20, 0, 0, 1,",h=20,m=20,c=e.type===b.MERGE&&r.id!==e.parents[0]?`M ${n.x} ${n.y} L ${n.x} ${a.y-h} ${d} ${n.x-m} ${a.y} L ${a.x} ${a.y}`:`M ${n.x} ${n.y} L ${a.x+h} ${n.y} ${i} ${a.x} ${n.y+m} L ${a.x} ${a.y}`),n.x===a.x&&(c=`M ${n.x} ${n.y} L ${a.x} ${a.y}`)):"BT"===nt?(n.x<a.x&&(c=e.type===b.MERGE&&r.id!==e.parents[0]?`M ${n.x} ${n.y} L ${n.x} ${a.y+h} ${d} ${n.x+m} ${a.y} L ${a.x} ${a.y}`:`M ${n.x} ${n.y} L ${a.x-h} ${n.y} ${i} ${a.x} ${n.y-m} L ${a.x} ${a.y}`),n.x>a.x&&(i="A 20 20, 0, 0, 0,",d="A 20 20, 0, 0, 1,",h=20,m=20,c=e.type===b.MERGE&&r.id!==e.parents[0]?`M ${n.x} ${n.y} L ${n.x} ${a.y+h} ${i} ${n.x-m} ${a.y} L ${a.x} ${a.y}`:`M ${n.x} ${n.y} L ${a.x+h} ${n.y} ${d} ${a.x} ${n.y-m} L ${a.x} ${a.y}`),n.x===a.x&&(c=`M ${n.x} ${n.y} L ${a.x} ${a.y}`)):(n.y<a.y&&(c=e.type===b.MERGE&&r.id!==e.parents[0]?`M ${n.x} ${n.y} L ${a.x-h} ${n.y} ${d} ${a.x} ${n.y+m} L ${a.x} ${a.y}`:`M ${n.x} ${n.y} L ${n.x} ${a.y-h} ${i} ${n.x+m} ${a.y} L ${a.x} ${a.y}`),n.y>a.y&&(c=e.type===b.MERGE&&r.id!==e.parents[0]?`M ${n.x} ${n.y} L ${a.x-h} ${n.y} ${i} ${a.x} ${n.y-m} L ${a.x} ${a.y}`:`M ${n.x} ${n.y} L ${n.x} ${a.y+h} ${d} ${n.x+m} ${a.y} L ${a.x} ${a.y}`),n.y===a.y&&(c=`M ${n.x} ${n.y} L ${a.x} ${a.y}`));if(void 0===c)throw new Error("Line definition not found");t.append("path").attr("d",c).attr("class","arrow arrow"+$%8)},"drawArrow"),kt=i((t,r)=>{const e=t.append("g").attr("class","commit-arrows");
1[...r.keys()].forEach(t=>{const o=r.get(t);o.parents&&o.parents.length>0&&o.parents.forEach(t=>{Et(e,r.get(t),o,r)})})},"drawArrows"),Ct=i((t,r,e)=>{const o=t.append("g");r.forEach((t,r)=>{const n=r%8,a=Q.get(t.name)?.pos;if(void 0===a)throw new Error(`Position not found for branch ${t.name}`);const s=o.append("line");s.attr("x1",0),s.attr("y1",a),s.attr("x2",ot),s.attr("y2",a),s.attr("class","branch branch"+n),"TB"===nt?(s.attr("y1",30),s.attr("x1",a),s.attr("y2",ot),s.attr("x2",a)):"BT"===nt&&(s.attr("y1",ot),s.attr("x1",a),s.attr("y2",30),s.attr("x2",a)),et.push(a);const c=t.name,i=st(c),d=o.insert("rect"),h=o.insert("g").attr("class","branchLabel").insert("g").attr("class","label branch-label"+n);h.node().appendChild(i);const m=i.getBBox();d.attr("class","branchLabelBkg label"+n).attr("rx",4).attr("ry",4).attr("x",-m.width-4-(!0===e.rotateCommitLabel?30:0)).attr("y",-m.height/2+8).attr("width",m.width+18).attr("height",m.height+4),h.attr("transform","translate("+(-m.width-14-(!0===e.rotateCommitLabel?30:0))+", "+(a-m.height/2-1)+")"),"TB"===nt?(d.attr("x",a-m.width/2-10).attr("y",0),h.attr("transform","translate("+(a-m.width/2-5)+", 0)")):"BT"===nt?(d.attr("x",a-m.width/2-10).attr("y",ot),h.attr("transform","translate("+(a-m.width/2-5)+", "+ot+")")):d.attr("transform","translate(-19, "+(a-m.height/2)+")")})},"drawBranches"),Lt=i(function(t,r,e,o,n){return Q.set(t,{pos:r,index:e}),r+(50+(n?40:0)+("TB"===nt||"BT"===nt?o.width/2:0))},"setBranchPosition"),Tt={parser:X,db:D,renderer:{draw:i(function(t,r,e,o){at(),d.debug("in gitgraph renderer",t+"\n","id:",r,e);const n=o.db;if(!n.getConfig)return void d.error("getConfig method is not available on db");const a=n.getConfig(),s=a.rotateCommitLabel??!1;rt=n.getCommits();const c=n.getBranchesAsObjArray();nt=n.getDirection();const i=h(`[id="${r}"]`);let l=0;c.forEach((t,r)=>{const e=st(t.name),o=i.append("g"),n=o.insert("g").attr("class","branchLabel"),a=n.insert("g").attr("class","label branch-label");a.node()?.appendChild(e);const c=e.getBBox();l=Lt(t.name,l,r,c,s),a.remove(),n.remove(),o.remove()}),bt(i,rt,!1,a),a.showBranches&&Ct(i,c,a),kt(i,rt),bt(i,rt,!0,a),m.insertTitle(i,"gitTitleText",a.titleTopMargin??0,n.getDiagramTitle()),$(void 0,i,a.diagramPadding,a.useMaxWidth)},"draw")},styles:i(t=>`\n  .commit-id,\n  .commit-msg,\n  .branch-label {\n    fill: lightgrey;\n    color: lightgrey;\n    font-family: 'trebuchet ms', verdana, arial, sans-serif;\n    font-family: var(--mermaid-font-family);\n  }\n  ${[0,1,2,3,4,5,6,7].map(r=>`\n        .branch-label${r} { fill: ${t["gitBranchLabel"+r]}; }\n        .commit${r} { stroke: ${t["git"+r]}; fill: ${t["git"+r]}; }\n        .commit-highlight${r} { stroke: ${t["gitInv"+r]}; fill: ${t["gitInv"+r]}; }\n        .label${r}  { fill: ${t["git"+r]}; }\n        .arrow${r} { stroke: ${t["git"+r]}; }\n        `).join("\n")}\n\n  .branch {\n    stroke-width: 1;\n    stroke: ${t.lineColor};\n    stroke-dasharray: 2;\n  }\n  .commit-label { font-size: ${t.commitLabelFontSize}; fill: ${t.commitLabelColor};}\n  .commit-label-bkg { font-size: ${t.commitLabelFontSize}; fill: ${t.commitLabelBackground}; opacity: 0.5; }\n  .tag-label { font-size: ${t.tagLabelFontSize}; fill: ${t.tagLabelColor};}\n  .tag-label-bkg { fill: ${t.tagLabelBackground}; stroke: ${t.tagLabelBorder}; }\n  .tag-hole { fill: ${t.textColor}; }\n\n  .commit-merge {\n    stroke: ${t.primaryColor};\n    fill: ${t.primaryColor};\n  }\n  .commit-reverse {\n    stroke: ${t.primaryColor};\n    fill: ${t.primaryColor};\n    stroke-width: 3;\n  }\n  .commit-highlight-outer {\n  }\n  .commit-highlight-inner {\n    stroke: ${t.primaryColor};\n    fill: ${t.primaryColor};\n  }\n\n  .arrow { stroke-width: 8; stroke-linecap: round; fill: none}\n  .gitTitleText {\n    text-anchor: middle;\n    font-size: 18px;\n    fill: ${t.textColor};\n  }\n`,"getStyles")};export{Tt as diagram};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.