"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1758],{49127:(t,e,r)=>{r.d(e,{m:()=>a});var o=r(85448),a=class{constructor(t){this.init=t,this.records=this.init()}static{(0,o.K2)(this,"ImperativeState")}reset(){this.records=this.init()}}},61758:(t,e,r)=>{r.d(e,{diagram:()=>tK});var o=r(73018),a=r(49127),i=r(50001),n=r(93913),s=r(85448),c=r(46229),d=r(51874),l={NORMAL:0,REVERSE:1,HIGHLIGHT:2,MERGE:3,CHERRY_PICK:4},h=n.UI.gitGraph,$=(0,s.K2)(()=>(0,i.$t)({...h,...(0,n.zj)().gitGraph}),"getConfig"),m=new a.m(()=>{let t=$(),e=t.mainBranchName,r=t.mainBranchOrder;return{mainBranchName:e,commits:new Map,head:null,branchConfig:new Map([[e,{name:e,order:r}]]),branches:new Map([[e,null]]),currBranch:e,direction:"LR",seq:0,options:{}}});function g(){return(0,i.yT)({length:7})}function p(t,e){let r=Object.create(null);return t.reduce((t,o)=>{let a=e(o);return r[a]||(r[a]=!0,t.push(o)),t},[])}(0,s.K2)(g,"getID"),(0,s.K2)(p,"uniqBy");var y=(0,s.K2)(function(t){m.records.direction=t},"setDirection"),f=(0,s.K2)(function(t){s.Rm.debug("options str",t),t=(t=t?.trim())||"{}";try{m.records.options=JSON.parse(t)}catch(t){s.Rm.error("error while parsing gitGraph options",t.message)}},"setOptions"),x=(0,s.K2)(function(){return m.records.options},"getOptions"),u=(0,s.K2)(function(t){let e=t.msg,r=t.id,o=t.type,a=t.tags;s.Rm.info("commit",e,r,o,a),s.Rm.debug("Entering commit:",e,r,o,a);let i=$();r=n.Y2.sanitizeText(r,i),e=n.Y2.sanitizeText(e,i),a=a?.map(t=>n.Y2.sanitizeText(t,i));let c={id:r||m.records.seq+"-"+g(),message:e,seq:m.records.seq++,type:o??l.NORMAL,tags:a??[],parents:null==m.records.head?[]:[m.records.head.id],branch:m.records.currBranch};m.records.head=c,s.Rm.info("main branch",i.mainBranchName),m.records.commits.has(c.id)&&s.Rm.warn(`Commit ID ${c.id} already exists`),m.records.commits.set(c.id,c),m.records.branches.set(m.records.currBranch,c.id),s.Rm.debug("in pushCommit "+c.id)},"commit"),b=(0,s.K2)(function(t){let e=t.name,r=t.order;if(e=n.Y2.sanitizeText(e,$()),m.records.branches.has(e))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 ${e}")`);m.records.branches.set(e,null!=m.records.head?m.records.head.id:null),m.records.branchConfig.set(e,{name:e,order:r}),w(e),s.Rm.debug("in createBranch")},"branch"),k=(0,s.K2)(t=>{let e=t.branch,r=t.id,o=t.type,a=t.tags,i=$();e=n.Y2.sanitizeText(e,i),r&&(r=n.Y2.sanitizeText(r,i));let c=m.records.branches.get(m.records.currBranch),d=m.records.branches.get(e),h=c?m.records.commits.get(c):void 0,p=d?m.records.commits.get(d):void 0;if(h&&p&&h.branch===e)throw Error(`Cannot merge branch '${e}' into itself.`);if(m.records.currBranch===e){let t=Error('Incorrect usage of "merge". Cannot merge a branch to itself');throw t.hash={text:`merge ${e}`,token:`merge ${e}`,expected:["branch abc"]},t}if(void 0===h||!h){let t=Error(`Incorrect usage of "merge". Current branch (${m.records.currBranch})has no commits`);throw t.hash={text:`merge ${e}`,token:`merge ${e}`,expected:["commit"]},t}if(!m.records.branches.has(e)){let t=Error('Incorrect usage of "merge". Branch to be merged ('+e+") does not exist");throw t.hash={text:`merge ${e}`,token:`merge ${e}`,expected:[`branch ${e}`]},t}if(void 0===p||!p){let t=Error('Incorrect usage of "merge". Branch to be merged ('+e+") has no commits");throw t.hash={text:`merge ${e}`,token:`merge ${e}`,expected:['"commit"']},t}if(h===p){let t=Error('Incorrect usage of "merge". Both branches have same head');throw t.hash={text:`merge ${e}`,token:`merge ${e}`,expected:["branch abc"]},t}if(r&&m.records.commits.has(r)){let t=Error('Incorrect usage of "merge". Commit with id:'+r+" already exists, use different custom id");throw t.hash={text:`merge ${e} ${r} ${o} ${a?.join(" ")}`,token:`merge ${e} ${r} ${o} ${a?.join(" ")}`,expected:[`merge ${e} ${r}_UNIQUE ${o} ${a?.join(" ")}`]},t}let y={id:r||`${m.records.seq}-${g()}`,message:`merged branch ${e} into ${m.records.currBranch}`,seq:m.records.seq++,parents:null==m.records.head?[]:[m.records.head.id,d||""],branch:m.records.currBranch,type:l.MERGE,customType:o,customId:!!r,tags:a??[]};m.records.head=y,m.records.commits.set(y.id,y),m.records.branches.set(m.records.currBranch,y.id),s.Rm.debug(m.records.branches),s.Rm.debug("in mergeBranch")},"merge"),B=(0,s.K2)(function(t){let e=t.id,r=t.targetId,o=t.tags,a=t.parent;s.Rm.debug("Entering cherryPick:",e,r,o);let i=$();if(e=n.Y2.sanitizeText(e,i),r=n.Y2.sanitizeText(r,i),o=o?.map(t=>n.Y2.sanitizeText(t,i)),a=n.Y2.sanitizeText(a,i),!e||!m.records.commits.has(e)){let t=Error('Incorrect usage of "cherryPick". Source commit id should exist and provided');throw t.hash={text:`cherryPick ${e} ${r}`,token:`cherryPick ${e} ${r}`,expected:["cherry-pick abc"]},t}let c=m.records.commits.get(e);if(void 0===c||!c)throw Error('Incorrect usage of "cherryPick". Source commit id should exist and provided');if(a&&!(Array.isArray(c.parents)&&c.parents.includes(a)))throw Error("Invalid operation: The specified parent commit is not an immediate parent of the cherry-picked commit.");let d=c.branch;if(c.type===l.MERGE&&!a)throw Error("Incorrect usage of cherry-pick: If the source commit is a merge commit, an immediate parent commit must be specified.");if(!r||!m.records.commits.has(r)){if(d===m.records.currBranch){let t=Error('Incorrect usage of "cherryPick". Source commit is already on current branch');throw t.hash={text:`cherryPick ${e} ${r}`,token:`cherryPick ${e} ${r}`,expected:["cherry-pick abc"]},t}let t=m.records.branches.get(m.records.currBranch);if(void 0===t||!t){let t=Error(`Incorrect usage of "cherry-pick". Current branch (${m.records.currBranch})has no commits`);throw t.hash={text:`cherryPick ${e} ${r}`,token:`cherryPick ${e} ${r}`,expected:["cherry-pick abc"]},t}let i=m.records.commits.get(t);if(void 0===i||!i){let t=Error(`Incorrect usage of "cherry-pick". Current branch (${m.records.currBranch})has no commits`);throw t.hash={text:`cherryPick ${e} ${r}`,token:`cherryPick ${e} ${r}`,expected:["cherry-pick abc"]},t}let n={id:m.records.seq+"-"+g(),message:`cherry-picked ${c?.message} into ${m.records.currBranch}`,seq:m.records.seq++,parents:null==m.records.head?[]:[m.records.head.id,c.id],branch:m.records.currBranch,type:l.CHERRY_PICK,tags:o?o.filter(Boolean):[`cherry-pick:${c.id}${c.type===l.MERGE?`|parent:${a}`:""}`]};m.records.head=n,m.records.commits.set(n.id,n),m.records.branches.set(m.records.currBranch,n.id),s.Rm.debug(m.records.branches),s.Rm.debug("in cherryPick")}},"cherryPick"),w=(0,s.K2)(function(t){if(t=n.Y2.sanitizeText(t,$()),m.records.branches.has(t)){m.records.currBranch=t;let e=m.records.branches.get(m.records.currBranch);void 0!==e&&e?m.records.head=m.records.commits.get(e)??null:m.records.head=null}else{let e=Error(`Trying to checkout branch which is not yet created. (Help try using "branch ${t}")`);throw e.hash={text:`checkout ${t}`,token:`checkout ${t}`,expected:[`branch ${t}`]},e}},"checkout");function E(t,e,r){let o=t.indexOf(e);-1===o?t.push(r):t.splice(o,1,r)}function T(t){let e=t.reduce((t,e)=>t.seq>e.seq?t:e,t[0]),r="";t.forEach(function(t){t===e?r+=" *":r+=" |"});let o=[r,e.id,e.seq];for(let t in m.records.branches)m.records.branches.get(t)===e.id&&o.push(t);if(s.Rm.debug(o.join(" ")),e.parents&&2==e.parents.length&&e.parents[0]&&e.parents[1]){let r=m.records.commits.get(e.parents[0]);E(t,e,r),e.parents[1]&&t.push(m.records.commits.get(e.parents[1]))}else if(0==e.parents.length)return;else if(e.parents[0]){let r=m.records.commits.get(e.parents[0]);E(t,e,r)}T(t=p(t,t=>t.id))}(0,s.K2)(E,"upsert"),(0,s.K2)(T,"prettyPrintCommitHistory");var C=(0,s.K2)(function(){s.Rm.debug(m.records.commits),T([v()[0]])},"prettyPrint"),L=(0,s.K2)(function(){m.reset(),(0,n.IU)()},"clear"),K=(0,s.K2)(function(){return[...m.records.branchConfig.values()].map((t,e)=>null!==t.order&&void 0!==t.order?t:{...t,order:parseFloat(`0.${e}`)}).sort((t,e)=>(t.order??0)-(e.order??0)).map(({name:t})=>({name:t}))},"getBranchesAsObjArray"),M=(0,s.K2)(function(){return m.records.branches},"getBranches"),R=(0,s.K2)(function(){return m.records.commits},"getCommits"),v=(0,s.K2)(function(){let t=[...m.records.commits.values()];return t.forEach(function(t){s.Rm.debug(t.id)}),t.sort((t,e)=>t.seq-e.seq),t},"getCommitsArray"),I={commitType:l,getConfig:$,setDirection:y,setOptions:f,getOptions:x,commit:u,branch:b,merge:k,cherryPick:B,checkout:w,prettyPrint:C,clear:L,getBranchesAsObjArray:K,getBranches:M,getCommits:R,getCommitsArray:v,getCurrentBranch:(0,s.K2)(function(){return m.records.currBranch},"getCurrentBranch"),getDirection:(0,s.K2)(function(){return m.records.direction},"getDirection"),getHead:(0,s.K2)(function(){return m.records.head},"getHead"),setAccTitle:n.SV,getAccTitle:n.iN,getAccDescription:n.m7,setAccDescription:n.EI,setDiagramTitle:n.ke,getDiagramTitle:n.ab},P=(0,s.K2)((t,e)=>{for(let r of((0,o.S)(t,e),t.dir&&e.setDirection(t.dir),t.statements))O(r,e)},"populate"),O=(0,s.K2)((t,e)=>{let r={Commit:(0,s.K2)(t=>e.commit(A(t)),"Commit"),Branch:(0,s.K2)(t=>e.branch(G(t)),"Branch"),Merge:(0,s.K2)(t=>e.merge(S(t)),"Merge"),Checkout:(0,s.K2)(t=>e.checkout(H(t)),"Checkout"),CherryPicking:(0,s.K2)(t=>e.cherryPick(D(t)),"CherryPicking")}[t.$type];r?r(t):s.Rm.error(`Unknown statement type: ${t.$type}`)},"parseStatement"),A=(0,s.K2)(t=>({id:t.id,msg:t.message??"",type:void 0!==t.type?l[t.type]:l.NORMAL,tags:t.tags??void 0}),"parseCommit"),G=(0,s.K2)(t=>({name:t.name,order:t.order??0}),"parseBranch"),S=(0,s.K2)(t=>({branch:t.branch,id:t.id??"",type:void 0!==t.type?l[t.type]:void 0,tags:t.tags??void 0}),"parseMerge"),H=(0,s.K2)(t=>t.branch,"parseCheckout"),D=(0,s.K2)(t=>({id:t.id,targetId:"",tags:t.tags?.length===0?void 0:t.tags,parent:t.parent}),"parseCherryPicking"),W={parse:(0,s.K2)(async t=>{let e=await (0,c.qg)("gitGraph",t);s.Rm.debug(e),P(e,I)},"parse")},q=new Set(["redux","redux-dark","redux-color","redux-dark-color"]),_=new Set(["redux-color","redux-dark-color"]),z=new Set(["dark","redux-dark","redux-dark-color","neo-dark"]),Y=(0,s.K2)((t,e,r=!1)=>r&&t>0?(t-1)%(e-1)+1:t%e,"calcColorIndex"),N=new Map,j=new Map,F=new Map,U=[],V=0,J="LR",Q=(0,s.K2)(()=>{N.clear(),j.clear(),F.clear(),V=0,U=[],J="LR"},"clear"),X=(0,s.K2)(t=>{let e=document.createElementNS("http://www.w3.org/2000/svg","text");return("string"==typeof t?t.split(/\\n|\n|/gi):t).forEach(t=>{let r=document.createElementNS("http://www.w3.org/2000/svg","tspan");r.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve"),r.setAttribute("dy","1em"),r.setAttribute("x","0"),r.setAttribute("class","row"),r.textContent=t.trim(),e.appendChild(r)}),e},"drawText"),Z=(0,s.K2)(t=>{let e,r,o;return"BT"===J?(r=(0,s.K2)((t,e)=>t<=e,"comparisonFunc"),o=1/0):(r=(0,s.K2)((t,e)=>t>=e,"comparisonFunc"),o=0),t.forEach(t=>{let a="TB"===J||"BT"==J?j.get(t)?.y:j.get(t)?.x;void 0!==a&&r(a,o)&&(e=t,o=a)}),e},"findClosestParent"),tt=(0,s.K2)(t=>{let e="",r=1/0;return t.forEach(t=>{let o=j.get(t).y;o<=r&&(e=t,r=o)}),e||void 0},"findClosestParentBT"),te=(0,s.K2)((t,e,r)=>{let o=r,a=r,i=[];t.forEach(t=>{let r=e.get(t);if(!r)throw Error(`Commit not found for key ${t}`);r.parents.length?a=Math.max(o=to(r),a):i.push(r),ta(r,o)}),o=a,i.forEach(t=>{ti(t,o,r)}),t.forEach(t=>{let r=e.get(t);if(r?.parents.length){let t=tt(r.parents);(o=j.get(t).y-40)<=a&&(a=o);let e=N.get(r.branch).pos,i=o-10;j.set(r.id,{x:e,y:i})}})},"setParallelBTPos"),tr=(0,s.K2)(t=>{let e=Z(t.parents.filter(t=>null!==t));if(!e)throw Error(`Closest parent not found for commit ${t.id}`);let r=j.get(e)?.y;if(void 0===r)throw Error(`Closest parent position not found for commit ${t.id}`);return r},"findClosestParentPos"),to=(0,s.K2)(t=>tr(t)+40,"calculateCommitPosition"),ta=(0,s.K2)((t,e)=>{let r=N.get(t.branch);if(!r)throw Error(`Branch not found for commit ${t.id}`);let o=r.pos,a=e+10;return j.set(t.id,{x:o,y:a}),{x:o,y:a}},"setCommitPosition"),ti=(0,s.K2)((t,e,r)=>{let o=N.get(t.branch);if(!o)throw Error(`Branch not found for commit ${t.id}`);let a=o.pos;j.set(t.id,{x:a,y:e+r})},"setRootPosition"),tn=(0,s.K2)((t,e,r,o,a,i)=>{let{theme:s}=(0,n.D7)(),c=q.has(s??""),d=_.has(s??""),h=z.has(s??"");if(i===l.HIGHLIGHT)t.append("rect").attr("x",r.x-10+3*!!c).attr("y",r.y-10+3*!!c).attr("width",c?14:20).attr("height",c?14:20).attr("class",`commit ${e.id} commit-highlight${Y(a,8,d)} ${o}-outer`),t.append("rect").attr("x",r.x-6+2*!!c).attr("y",r.y-6+2*!!c).attr("width",c?8:12).attr("height",c?8:12).attr("class",`commit ${e.id} commit${Y(a,8,d)} ${o}-inner`);else if(i===l.CHERRY_PICK)t.append("circle").attr("cx",r.x).attr("cy",r.y).attr("r",c?7:10).attr("class",`commit ${e.id} ${o}`),t.append("circle").attr("cx",r.x-3).attr("cy",r.y+2).attr("r",c?2.5:2.75).attr("fill",h?"#000000":"#fff").attr("class",`commit ${e.id} ${o}`),t.append("circle").attr("cx",r.x+3).attr("cy",r.y+2).attr("r",c?2.5:2.75).attr("fill",h?"#000000":"#fff").attr("class",`commit ${e.id} ${o}`),t.append("line").attr("x1",r.x+3).attr("y1",r.y+1).attr("x2",r.x).attr("y2",r.y-5).attr("stroke",h?"#000000":"#fff").attr("class",`commit ${e.id} ${o}`),t.append("line").attr("x1",r.x-3).attr("y1",r.y+1).attr("x2",r.x).attr("y2",r.y-5).attr("stroke",h?"#000000":"#fff").attr("class",`commit ${e.id} ${o}`);else{let n=t.append("circle");if(n.attr("cx",r.x),n.attr("cy",r.y),n.attr("r",c?7:10),n.attr("class",`commit ${e.id} commit${Y(a,8,d)}`),i===l.MERGE){let i=t.append("circle");i.attr("cx",r.x),i.attr("cy",r.y),i.attr("r",c?5:6),i.attr("class",`commit ${o} ${e.id} commit${Y(a,8,d)}`)}if(i===l.REVERSE){let i=t.append("path"),n=c?4:5;i.attr("d",`M ${r.x-n},${r.y-n}L${r.x+n},${r.y+n}M${r.x-n},${r.y+n}L${r.x+n},${r.y-n}`).attr("class",`commit ${o} ${e.id} commit${Y(a,8,d)}`)}}},"drawCommitBullet"),ts=(0,s.K2)((t,e,r,o,a)=>{if(e.type!==l.CHERRY_PICK&&(e.customId&&e.type===l.MERGE||e.type!==l.MERGE)&&a.showCommitLabel){let i=t.append("g"),n=i.insert("rect").attr("class","commit-label-bkg"),s=i.append("text").attr("x",o).attr("y",r.y+25).attr("class","commit-label").text(e.id),c=s.node()?.getBBox();if(c&&(n.attr("x",r.posWithOffset-c.width/2-2).attr("y",r.y+13.5).attr("width",c.width+4).attr("height",c.height+4),"TB"===J||"BT"===J?(n.attr("x",r.x-(c.width+16+5)).attr("y",r.y-12),s.attr("x",r.x-(c.width+16)).attr("y",r.y+c.height-12)):s.attr("x",r.posWithOffset-c.width/2),a.rotateCommitLabel))if("TB"===J||"BT"===J)s.attr("transform","rotate(-45, "+r.x+", "+r.y+")"),n.attr("transform","rotate(-45, "+r.x+", "+r.y+")");else{let t=-7.5-(c.width+10)/25*9.5,e=10+c.width/25*8.5;i.attr("transform","translate("+t+", "+e+") rotate(-45, "+o+", "+r.y+")")}}},"drawCommitLabel"),tc=(0,s.K2)((t,e,r,o)=>{if(e.tags.length>0){let a=0,i=0,n=0,s=[];for(let o of e.tags.reverse()){let e=t.insert("polygon"),c=t.append("circle"),d=t.append("text").attr("y",r.y-16-a).attr("class","tag-label").text(o),l=d.node()?.getBBox();if(!l)throw Error("Tag bbox not found");i=Math.max(i,l.width),n=Math.max(n,l.height),d.attr("x",r.posWithOffset-l.width/2),s.push({tag:d,hole:c,rect:e,yOffset:a}),a+=20}for(let{tag:t,hole:e,rect:a,yOffset:c}of s){let s=n/2,d=r.y-19.2-c;if(a.attr("class","tag-label-bkg").attr("points",` ${o-i/2-2},${d+2} ${o-i/2-2},${d-2} ${r.posWithOffset-i/2-4},${d-s-2} ${r.posWithOffset+i/2+4},${d-s-2} ${r.posWithOffset+i/2+4},${d+s+2} ${r.posWithOffset-i/2-4},${d+s+2}`),e.attr("cy",d).attr("cx",o-i/2+2).attr("r",1.5).attr("class","tag-hole"),"TB"===J||"BT"===J){let n=o+c;a.attr("class","tag-label-bkg").attr("points",` ${r.x},${n+2} ${r.x},${n-2} ${r.x+10},${n-s-2} ${r.x+10+i+4},${n-s-2} ${r.x+10+i+4},${n+s+2} ${r.x+10},${n+s+2}`).attr("transform","translate(12,12) rotate(45, "+r.x+","+o+")"),e.attr("cx",r.x+2).attr("cy",n).attr("transform","translate(12,12) rotate(45, "+r.x+","+o+")"),t.attr("x",r.x+5).attr("y",n+3).attr("transform","translate(14,14) rotate(45, "+r.x+","+o+")")}}}},"drawCommitTags"),td=(0,s.K2)(t=>{switch(t.customType??t.type){case l.NORMAL:return"commit-normal";case l.REVERSE:return"commit-reverse";case l.HIGHLIGHT:return"commit-highlight";case l.MERGE:return"commit-merge";case l.CHERRY_PICK:return"commit-cherry-pick";default:return"commit-normal"}},"getCommitClassType"),tl=(0,s.K2)((t,e,r,o)=>{let a={x:0,y:0};if(t.parents.length>0){let r=Z(t.parents);if(r){let i=o.get(r)??a;return"TB"===e?i.y+40:"BT"===e?(o.get(t.id)??a).y-40:i.x+40}}else if("TB"===e)return 30;else if("BT"===e)return(o.get(t.id)??a).y-40;return 0},"calculatePosition"),th=(0,s.K2)((t,e,r)=>{let o="BT"===J&&r?e:e+10,a=N.get(t.branch)?.pos,i="TB"===J||"BT"===J?N.get(t.branch)?.pos:o;if(void 0===i||void 0===a)throw Error(`Position were undefined for commit ${t.id}`);let s=q.has((0,n.D7)().theme??"");return{x:i,y:"TB"===J||"BT"===J?o:a+(s?7:-2),posWithOffset:o}},"getCommitPosition"),t$=(0,s.K2)((t,e,r,o)=>{let a=t.append("g").attr("class","commit-bullets"),i=t.append("g").attr("class","commit-labels"),n=30*("TB"===J||"BT"===J),c=[...e.keys()],d=o.parallelCommits??!1,l=c.sort((0,s.K2)((t,r)=>{let o=e.get(t)?.seq,a=e.get(r)?.seq;return void 0!==o&&void 0!==a?o-a:0},"sortKeys"));"BT"===J&&(d&&te(l,e,n),l=l.reverse()),l.forEach(t=>{let s=e.get(t);if(!s)throw Error(`Commit not found for key ${t}`);d&&(n=tl(s,J,n,j));let c=th(s,n,d);if(r){let t=td(s),e=s.customType??s.type,r=N.get(s.branch)?.index??0;tn(a,s,c,t,r,e),ts(i,s,c,n,o),tc(i,s,c,n)}"TB"===J||"BT"===J?j.set(s.id,{x:c.x,y:c.posWithOffset}):j.set(s.id,{x:c.posWithOffset,y:c.y}),(n="BT"===J&&d?n+40:n+40+10)>V&&(V=n)})},"drawCommits"),tm=(0,s.K2)((t,e,r,o,a)=>{let i=("TB"===J||"BT"===J?r.xt.branch===i,"isOnBranchToGetCurve"),c=(0,s.K2)(r=>r.seq>t.seq&&r.seqc(t)&&n(t))},"shouldRerouteArrow"),tg=(0,s.K2)((t,e,r=0)=>{let o=t+Math.abs(t-e)/2;if(r>5)return o;if(U.every(t=>Math.abs(t-o)>=10))return U.push(o),o;let a=Math.abs(t-e);return tg(t,e-a/5,r+1)},"findLane"),tp=(0,s.K2)((t,e,r,o)=>{let a,{theme:i}=(0,n.D7)(),s=_.has(i??""),c=j.get(e.id),d=j.get(r.id);if(void 0===c||void 0===d)throw Error(`Commit positions not found for commits ${e.id} and ${r.id}`);let h=tm(e,r,c,d,o),$="",m="",g=0,p=0,y=N.get(r.branch)?.index;if(r.type===l.MERGE&&e.id!==r.parents[0]&&(y=N.get(e.branch)?.index),h){$="A 10 10, 0, 0, 0,",m="A 10 10, 0, 0, 1,",g=10,p=10;let t=c.yd.x&&($="A 20 20, 0, 0, 0,",m="A 20 20, 0, 0, 1,",g=20,p=20,a=r.type===l.MERGE&&e.id!==r.parents[0]?`M ${c.x} ${c.y} L ${c.x} ${d.y-g} ${m} ${c.x-p} ${d.y} L ${d.x} ${d.y}`:`M ${c.x} ${c.y} L ${d.x+g} ${c.y} ${$} ${d.x} ${c.y+p} L ${d.x} ${d.y}`),c.x===d.x&&(a=`M ${c.x} ${c.y} L ${d.x} ${d.y}`)):"BT"===J?(c.xd.x&&($="A 20 20, 0, 0, 0,",m="A 20 20, 0, 0, 1,",g=20,p=20,a=r.type===l.MERGE&&e.id!==r.parents[0]?`M ${c.x} ${c.y} L ${c.x} ${d.y+g} ${$} ${c.x-p} ${d.y} L ${d.x} ${d.y}`:`M ${c.x} ${c.y} L ${d.x+g} ${c.y} ${m} ${d.x} ${c.y-p} L ${d.x} ${d.y}`),c.x===d.x&&(a=`M ${c.x} ${c.y} L ${d.x} ${d.y}`)):(c.yd.y&&(a=r.type===l.MERGE&&e.id!==r.parents[0]?`M ${c.x} ${c.y} L ${d.x-g} ${c.y} ${$} ${d.x} ${c.y-p} L ${d.x} ${d.y}`:`M ${c.x} ${c.y} L ${c.x} ${d.y+g} ${m} ${c.x+p} ${d.y} L ${d.x} ${d.y}`),c.y===d.y&&(a=`M ${c.x} ${c.y} L ${d.x} ${d.y}`));if(void 0===a)throw Error("Line definition not found");t.append("path").attr("d",a).attr("class","arrow arrow"+Y(y,8,s))},"drawArrow"),ty=(0,s.K2)((t,e)=>{let r=t.append("g").attr("class","commit-arrows");[...e.keys()].forEach(t=>{let o=e.get(t);o.parents&&o.parents.length>0&&o.parents.forEach(t=>{tp(r,e.get(t),o,e)})})},"drawArrows"),tf=(0,s.K2)((t,e,r,o)=>{let{look:a,theme:i,themeVariables:s}=(0,n.D7)(),{dropShadow:c,THEME_COLOR_LIMIT:d}=s,l=q.has(i??""),h=_.has(i??""),$=t.append("g");e.forEach((t,e)=>{let i=Y(e,l?d:8,h),n=N.get(t.name)?.pos;if(void 0===n)throw Error(`Position not found for branch ${t.name}`);let s="TB"===J||"BT"===J?n:l?n+6+1:n-2,m=$.append("line");m.attr("x1",0),m.attr("y1",s),m.attr("x2",V),m.attr("y2",s),m.attr("class","branch branch"+i),"TB"===J?(m.attr("y1",30),m.attr("x1",n),m.attr("y2",V),m.attr("x2",n)):"BT"===J&&(m.attr("y1",V),m.attr("x1",n),m.attr("y2",30),m.attr("x2",n)),U.push(s);let g=X(t.name),p=$.insert("rect"),y=$.insert("g").attr("class","branchLabel").insert("g").attr("class","label branch-label"+i);y.node().appendChild(g);let f=g.getBBox(),x=4*!l,u=16*!!l,b=12*!!l;"neo"===a&&p.attr("data-look","neo"),p.attr("class","branchLabelBkg label"+i).attr("style","neo"===a?`filter:${l?`url(#${o}-drop-shadow)`:c}`:"").attr("rx",x).attr("ry",x).attr("x",-f.width-4-30*(!0===r.rotateCommitLabel)).attr("y",-f.height/2+10).attr("width",f.width+18+u).attr("height",f.height+4+b),y.attr("transform","translate("+(-f.width-14-30*(!0===r.rotateCommitLabel)+u/2)+", "+(s-f.height/2-2)+")"),"TB"===J?(p.attr("x",n-f.width/2-10).attr("y",0),y.attr("transform","translate("+(n-f.width/2-5)+", 0)"),l&&(p.attr("transform",`translate(${-u/2-3}, ${-b-10})`),y.attr("transform","translate("+(n-f.width/2-5)+", "+(-(2*b)+7)+")"))):"BT"===J?(p.attr("x",n-f.width/2-10).attr("y",V),y.attr("transform","translate("+(n-f.width/2-5)+", "+V+")"),l&&(p.attr("transform",`translate(${-u/2-3}, ${b+10})`),y.attr("transform","translate("+(n-f.width/2-5)+", "+(V+2*b+4)+")"))):p.attr("transform","translate(-19, "+(s-12-b/2)+")")})},"drawBranches"),tx=(0,s.K2)(function(t,e,r,o,a){return N.set(t,{pos:e,index:r}),e+=50+40*!!a+("TB"===J||"BT"===J?o.width/2:0)},"setBranchPosition"),tu=(0,s.K2)(function(t,e,r,o){Q(),s.Rm.debug("in gitgraph renderer",t+"\n","id:",e,r);let a=o.db;if(!a.getConfig)return void s.Rm.error("getConfig method is not available on db");let c=a.getConfig(),l=c.rotateCommitLabel??!1;F=a.getCommits();let h=a.getBranchesAsObjArray();J=a.getDirection();let $=(0,d.Ltv)(`[id="${e}"]`),{look:m,theme:g,themeVariables:p}=(0,n.D7)(),{useGradient:y,gradientStart:f,gradientStop:x,filterColor:u}=p;if(y){let t=$.append("defs").append("linearGradient").attr("id",e+"-gradient").attr("gradientUnits","objectBoundingBox").attr("x1","0%").attr("y1","0%").attr("x2","100%").attr("y2","0%");t.append("stop").attr("offset","0%").attr("stop-color",f).attr("stop-opacity",1),t.append("stop").attr("offset","100%").attr("stop-color",x).attr("stop-opacity",1)}"neo"===m&&q.has(g??"")&&$.append("defs").append("filter").attr("id",e+"-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",u);let b=0;h.forEach((t,e)=>{let r=X(t.name),o=$.append("g"),a=o.insert("g").attr("class","branchLabel"),i=a.insert("g").attr("class","label branch-label");i.node()?.appendChild(r);let n=r.getBBox();b=tx(t.name,b,e,n,l),i.remove(),a.remove(),o.remove()}),t$($,F,!1,c),c.showBranches&&tf($,h,c,e),ty($,F),t$($,F,!0,c),i._K.insertTitle($,"gitTitleText",c.titleTopMargin??0,a.getDiagramTitle()),(0,n.mj)(void 0,$,c.diagramPadding,c.useMaxWidth)},"draw"),tb=new Set(["redux","redux-dark","redux-color","redux-dark-color"]),tk=new Set(["redux-color","redux-dark-color"]),tB=new Set(["neo","neo-dark"]),tw=new Set(["dark","redux-dark","redux-dark-color","neo-dark"]),tE=new Set(["redux","redux-dark","redux-color","redux-dark-color","neo","neo-dark"]),tT=(0,s.K2)(t=>{let{svgId:e}=t,r="";if(t.useGradient&&e)for(let o=0;o{let{theme:e,themeVariables:r}=(0,n.zj)(),{borderColorArray:o}=r,a=tb.has(e);if(tB.has(e)){let e="";for(let r=0;r`${Array.from({length:t.THEME_COLOR_LIMIT},(t,e)=>e).map(e=>{let r=e%8;return` .branch-label${e} { fill: ${t["gitBranchLabel"+r]}; } .commit${e} { stroke: ${t["git"+r]}; fill: ${t["git"+r]}; } .commit-highlight${e} { stroke: ${t["gitInv"+r]}; fill: ${t["gitInv"+r]}; } .label${e} { fill: ${t["git"+r]}; } .arrow${e} { stroke: ${t["git"+r]}; } `}).join("\n")}`,"normalTheme"),tK={parser:W,db:I,renderer:{draw:tu},styles:(0,s.K2)(t=>{let{theme:e}=(0,n.zj)(),r=tE.has(e);return` .commit-id, .commit-msg, .branch-label { fill: lightgrey; color: lightgrey; font-family: 'trebuchet ms', verdana, arial, sans-serif; font-family: var(--mermaid-font-family); } ${r?tC(t):tL(t)} .branch { stroke-width: ${t.strokeWidth}; stroke: ${t.commitLineColor??t.lineColor}; stroke-dasharray: ${r?"4 2":"2"}; } .commit-label { font-size: ${t.commitLabelFontSize}; fill: ${r?t.nodeBorder:t.commitLabelColor}; ${r?`font-weight:${t.noteFontWeight};`:""}} .commit-label-bkg { font-size: ${t.commitLabelFontSize}; fill: ${r?"transparent":t.commitLabelBackground}; opacity: ${r?"":.5}; } .tag-label { font-size: ${t.tagLabelFontSize}; fill: ${t.tagLabelColor};} .tag-label-bkg { fill: ${r?t.mainBkg:t.tagLabelBackground}; stroke: ${r?t.nodeBorder:t.tagLabelBorder}; ${r?`filter:${t.dropShadow}`:""} } .tag-hole { fill: ${t.textColor}; } .commit-merge { stroke: ${r?t.mainBkg:t.primaryColor}; fill: ${r?t.mainBkg:t.primaryColor}; } .commit-reverse { stroke: ${r?t.mainBkg:t.primaryColor}; fill: ${r?t.mainBkg:t.primaryColor}; stroke-width: ${r?t.strokeWidth:3}; } .commit-highlight-outer { } .commit-highlight-inner { stroke: ${r?t.mainBkg:t.primaryColor}; fill: ${r?t.mainBkg:t.primaryColor}; } .arrow { /* Intentional: neo themes keep the bold 8px arrow (like classic themes); only redux-geometry themes use the thinner options.strokeWidth. */ stroke-width: ${tb.has(e)?t.strokeWidth:8}; stroke-linecap: round; fill: none } .gitTitleText { text-anchor: middle; font-size: 18px; fill: ${t.textColor}; } `},"getStyles")}},73018:(t,e,r)=>{function o(t,e){t.accDescr&&e.setAccDescription?.(t.accDescr),t.accTitle&&e.setAccTitle?.(t.accTitle),t.title&&e.setDiagramTitle?.(t.title)}r.d(e,{S:()=>o}),(0,r(85448).K2)(o,"populateCommonDb")}}]);