cc-viewer 1.6.199 → 1.6.201

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.
Files changed (65) hide show
  1. package/dist/assets/App-B0Cfe4hA.js +1 -0
  2. package/dist/assets/{App-fG2r3jFq.css → App-DOYmReD4.css} +1 -1
  3. package/dist/assets/{AppHeader-pu5K74SB.css → AppHeader-auOOOaQm.css} +2 -2
  4. package/dist/assets/AppHeader.module-CDgQaFoO.js +2 -0
  5. package/dist/assets/{Mobile-DnvC6H2O.js → Mobile-CsKFJYE2.js} +1 -1
  6. package/dist/assets/{_baseUniq-Cnd-_Qe2.js → _baseUniq-C73FOqig.js} +1 -1
  7. package/dist/assets/{arc-CPVCmYmr.js → arc-DAWkd4Du.js} +1 -1
  8. package/dist/assets/{architectureDiagram-Q4EWVU46-CTmPWolC.js → architectureDiagram-Q4EWVU46-CXA8GRiC.js} +1 -1
  9. package/dist/assets/{blockDiagram-DXYQGD6D-BYUa2ljj.js → blockDiagram-DXYQGD6D-BH7SCCtR.js} +1 -1
  10. package/dist/assets/{c4Diagram-AHTNJAMY-BBfrYhDN.js → c4Diagram-AHTNJAMY-DjidAThD.js} +1 -1
  11. package/dist/assets/{channel-D1pwh2Yq.js → channel-fMMU54GK.js} +1 -1
  12. package/dist/assets/{chunk-4BX2VUAB-DYCV-6PI.js → chunk-4BX2VUAB-C7VtouVc.js} +1 -1
  13. package/dist/assets/{chunk-4TB4RGXK-DZWVouv1.js → chunk-4TB4RGXK-E8ZyU2MN.js} +1 -1
  14. package/dist/assets/{chunk-55IACEB6-BnetqbRo.js → chunk-55IACEB6-kKpXz88M.js} +1 -1
  15. package/dist/assets/{chunk-EDXVE4YY-CL4WCxSM.js → chunk-EDXVE4YY-DGxEwZ4m.js} +1 -1
  16. package/dist/assets/{chunk-FMBD7UC4-DLmQmJbs.js → chunk-FMBD7UC4-CD8bIwZQ.js} +1 -1
  17. package/dist/assets/{chunk-OYMX7WX6-B7jkMtrd.js → chunk-OYMX7WX6-gYD4Acaz.js} +1 -1
  18. package/dist/assets/{chunk-QZHKN3VN-tscrjv7L.js → chunk-QZHKN3VN-BjwG7rZm.js} +1 -1
  19. package/dist/assets/{chunk-YZCP3GAM-BreqZYYH.js → chunk-YZCP3GAM-QsYUvoBQ.js} +1 -1
  20. package/dist/assets/classDiagram-6PBFFD2Q-BIdWZE2B.js +1 -0
  21. package/dist/assets/classDiagram-v2-HSJHXN6E-BIdWZE2B.js +1 -0
  22. package/dist/assets/clone-DUPgDT2x.js +1 -0
  23. package/dist/assets/{cose-bilkent-S5V4N54A-BqETFkWe.js → cose-bilkent-S5V4N54A-9ctKMOYC.js} +1 -1
  24. package/dist/assets/{dagre-KV5264BT-C1fQhqsm.js → dagre-KV5264BT-By2HwLaW.js} +1 -1
  25. package/dist/assets/{diagram-5BDNPKRD-BQ_AArZ4.js → diagram-5BDNPKRD-BpgOHENA.js} +1 -1
  26. package/dist/assets/{diagram-G4DWMVQ6-ETR1atoi.js → diagram-G4DWMVQ6-B2x2muJb.js} +1 -1
  27. package/dist/assets/{diagram-MMDJMWI5-BS5YlnF7.js → diagram-MMDJMWI5-un9PMQTJ.js} +1 -1
  28. package/dist/assets/{diagram-TYMM5635-DgEDTcSl.js → diagram-TYMM5635-CoSUmrbF.js} +1 -1
  29. package/dist/assets/{erDiagram-SMLLAGMA-BfJzSJyz.js → erDiagram-SMLLAGMA-D9ycUUrR.js} +1 -1
  30. package/dist/assets/{flowDiagram-DWJPFMVM-CmZyhVxI.js → flowDiagram-DWJPFMVM-CMwSrS0j.js} +1 -1
  31. package/dist/assets/{ganttDiagram-T4ZO3ILL-CyCgF8EH.js → ganttDiagram-T4ZO3ILL-dNzPWJ2v.js} +1 -1
  32. package/dist/assets/{gitGraphDiagram-UUTBAWPF-Ch_lyUYI.js → gitGraphDiagram-UUTBAWPF-5jScxIeV.js} +1 -1
  33. package/dist/assets/{graph-DONA5GRX.js → graph-CSAV79cR.js} +1 -1
  34. package/dist/assets/{index-CP_dJQHF.js → index-BnE1kmli.js} +2 -2
  35. package/dist/assets/{infoDiagram-42DDH7IO-sWbLdJMA.js → infoDiagram-42DDH7IO-BBwe5zCb.js} +1 -1
  36. package/dist/assets/{ishikawaDiagram-UXIWVN3A-B1-Sul49.js → ishikawaDiagram-UXIWVN3A-DxpzhU4G.js} +1 -1
  37. package/dist/assets/{journeyDiagram-VCZTEJTY-B2GzVR2v.js → journeyDiagram-VCZTEJTY-BiLOryhx.js} +1 -1
  38. package/dist/assets/{kanban-definition-6JOO6SKY-BQ369gG9.js → kanban-definition-6JOO6SKY-BwMtkCnE.js} +1 -1
  39. package/dist/assets/{layout-Dg4txuWO.js → layout-DEZivYZo.js} +1 -1
  40. package/dist/assets/{linear-CB6_fADN.js → linear-8H25OaNu.js} +1 -1
  41. package/dist/assets/{mermaid.core-fx56L749.js → mermaid.core-O3WUNQR6.js} +2 -2
  42. package/dist/assets/{min-Cfm_qmEy.js → min-BDNYdllt.js} +1 -1
  43. package/dist/assets/{mindmap-definition-QFDTVHPH-CucfYr3R.js → mindmap-definition-QFDTVHPH-DLa1a2PT.js} +1 -1
  44. package/dist/assets/{pieDiagram-DEJITSTG-B1JuDmET.js → pieDiagram-DEJITSTG-C7a0wkId.js} +1 -1
  45. package/dist/assets/{quadrantDiagram-34T5L4WZ-D45nu4Jo.js → quadrantDiagram-34T5L4WZ-qaO4n-DR.js} +1 -1
  46. package/dist/assets/{requirementDiagram-MS252O5E-C4MR71jH.js → requirementDiagram-MS252O5E-B5elAix1.js} +1 -1
  47. package/dist/assets/{sankeyDiagram-XADWPNL6-BjN93eui.js → sankeyDiagram-XADWPNL6-BxAAO2OT.js} +1 -1
  48. package/dist/assets/{sequenceDiagram-FGHM5R23-DfNydjTE.js → sequenceDiagram-FGHM5R23-D4epWe89.js} +1 -1
  49. package/dist/assets/{stateDiagram-FHFEXIEX-Cth1bRU5.js → stateDiagram-FHFEXIEX-DgLET5fE.js} +1 -1
  50. package/dist/assets/{stateDiagram-v2-QKLJ7IA2-DRKS8TSe.js → stateDiagram-v2-QKLJ7IA2-Ci28Wp9J.js} +1 -1
  51. package/dist/assets/{timeline-definition-GMOUNBTQ-CGI0k2Go.js → timeline-definition-GMOUNBTQ-8JmSnBLT.js} +1 -1
  52. package/dist/assets/{vennDiagram-DHZGUBPP-C1-dVDob.js → vennDiagram-DHZGUBPP-DYVoEvAU.js} +1 -1
  53. package/dist/assets/{wardley-RL74JXVD-Cw6grnZ8.js → wardley-RL74JXVD-DS_huD5U.js} +1 -1
  54. package/dist/assets/{wardleyDiagram-NUSXRM2D-Dz6uGDTV.js → wardleyDiagram-NUSXRM2D-BldFmHzV.js} +1 -1
  55. package/dist/assets/{xychartDiagram-5P7HB3ND-B_Pl_Y8E.js → xychartDiagram-5P7HB3ND-DS97a-id.js} +1 -1
  56. package/dist/index.html +1 -1
  57. package/interceptor.js +141 -10
  58. package/package.json +1 -1
  59. package/proxy.js +8 -0
  60. package/server.js +20 -7
  61. package/dist/assets/App-P57OfZoY.js +0 -1
  62. package/dist/assets/AppHeader.module-BaWqwKOb.js +0 -2
  63. package/dist/assets/classDiagram-6PBFFD2Q-DNn_1CVl.js +0 -1
  64. package/dist/assets/classDiagram-v2-HSJHXN6E-DNn_1CVl.js +0 -1
  65. package/dist/assets/clone-6rNpdByw.js +0 -1
@@ -1 +1 @@
1
- import{p as populateCommonDb}from"./chunk-4BX2VUAB-DYCV-6PI.js";import{I as ImperativeState}from"./chunk-QZHKN3VN-tscrjv7L.js";import{q as getDiagramTitle,p as setDiagramTitle,s as setAccDescription,g as getAccDescription,a as getAccTitle,b as setAccTitle,_ as __name,C as getConfig,l as log,d as select,c as getConfig2,u as utils_default,D as setupGraphViewbox2,y as clear,k as common_default,E as cleanAndMerge,F as defaultConfig_default,G as random}from"./mermaid.core-fx56L749.js";import{p as parse}from"./wardley-RL74JXVD-Cw6grnZ8.js";import"./index-CP_dJQHF.js";import"./vendor-codemirror-BiCbU51m.js";import"./vendor-antd-CAmbzFZk.js";import"./vendor-markdown-Bpu4AByL.js";import"./min-Cfm_qmEy.js";import"./_baseUniq-Cnd-_Qe2.js";var commitType={NORMAL:0,REVERSE:1,HIGHLIGHT:2,MERGE:3,CHERRY_PICK:4},DEFAULT_GITGRAPH_CONFIG=defaultConfig_default.gitGraph,getConfig3=__name(()=>cleanAndMerge({...DEFAULT_GITGRAPH_CONFIG,...getConfig().gitGraph}),"getConfig"),state=new ImperativeState(()=>{const config=getConfig3(),mainBranchName=config.mainBranchName,mainBranchOrder=config.mainBranchOrder;return{mainBranchName:mainBranchName,commits:new Map,head:null,branchConfig:new Map([[mainBranchName,{name:mainBranchName,order:mainBranchOrder}]]),branches:new Map([[mainBranchName,null]]),currBranch:mainBranchName,direction:"LR",seq:0,options:{}}});function getID(){return random({length:7})}function uniqBy(list,fn){const recordMap=Object.create(null);return list.reduce((out,item)=>{const key=fn(item);return recordMap[key]||(recordMap[key]=!0,out.push(item)),out},[])}__name(getID,"getID"),__name(uniqBy,"uniqBy");var setDirection=__name(function(dir2){state.records.direction=dir2},"setDirection"),setOptions=__name(function(rawOptString){log.debug("options str",rawOptString),rawOptString=(rawOptString=null==rawOptString?void 0:rawOptString.trim())||"{}";try{state.records.options=JSON.parse(rawOptString)}catch(e){log.error("error while parsing gitGraph options",e.message)}},"setOptions"),getOptions=__name(function(){return state.records.options},"getOptions"),commit=__name(function(commitDB){let msg=commitDB.msg,id=commitDB.id;const type=commitDB.type;let tags=commitDB.tags;log.info("commit",msg,id,type,tags),log.debug("Entering commit:",msg,id,type,tags);const config=getConfig3();id=common_default.sanitizeText(id,config),msg=common_default.sanitizeText(msg,config),tags=null==tags?void 0:tags.map(tag=>common_default.sanitizeText(tag,config));const newCommit={id:id||state.records.seq+"-"+getID(),message:msg,seq:state.records.seq++,type:type??commitType.NORMAL,tags:tags??[],parents:null==state.records.head?[]:[state.records.head.id],branch:state.records.currBranch};state.records.head=newCommit,log.info("main branch",config.mainBranchName),state.records.commits.has(newCommit.id)&&log.warn(`Commit ID ${newCommit.id} already exists`),state.records.commits.set(newCommit.id,newCommit),state.records.branches.set(state.records.currBranch,newCommit.id),log.debug("in pushCommit "+newCommit.id)},"commit"),branch=__name(function(branchDB){let name=branchDB.name;const order=branchDB.order;if(name=common_default.sanitizeText(name,getConfig3()),state.records.branches.has(name))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 ${name}")`);state.records.branches.set(name,null!=state.records.head?state.records.head.id:null),state.records.branchConfig.set(name,{name:name,order:order}),checkout(name),log.debug("in createBranch")},"branch"),merge=__name(mergeDB=>{let otherBranch=mergeDB.branch,customId=mergeDB.id;const overrideType=mergeDB.type,customTags=mergeDB.tags,config=getConfig3();otherBranch=common_default.sanitizeText(otherBranch,config),customId&&(customId=common_default.sanitizeText(customId,config));const currentBranchCheck=state.records.branches.get(state.records.currBranch),otherBranchCheck=state.records.branches.get(otherBranch),currentCommit=currentBranchCheck?state.records.commits.get(currentBranchCheck):void 0,otherCommit=otherBranchCheck?state.records.commits.get(otherBranchCheck):void 0;if(currentCommit&&otherCommit&&currentCommit.branch===otherBranch)throw new Error(`Cannot merge branch '${otherBranch}' into itself.`);if(state.records.currBranch===otherBranch){const error=new Error('Incorrect usage of "merge". Cannot merge a branch to itself');throw error.hash={text:`merge ${otherBranch}`,token:`merge ${otherBranch}`,expected:["branch abc"]},error}if(void 0===currentCommit||!currentCommit){const error=new Error(`Incorrect usage of "merge". Current branch (${state.records.currBranch})has no commits`);throw error.hash={text:`merge ${otherBranch}`,token:`merge ${otherBranch}`,expected:["commit"]},error}if(!state.records.branches.has(otherBranch)){const error=new Error('Incorrect usage of "merge". Branch to be merged ('+otherBranch+") does not exist");throw error.hash={text:`merge ${otherBranch}`,token:`merge ${otherBranch}`,expected:[`branch ${otherBranch}`]},error}if(void 0===otherCommit||!otherCommit){const error=new Error('Incorrect usage of "merge". Branch to be merged ('+otherBranch+") has no commits");throw error.hash={text:`merge ${otherBranch}`,token:`merge ${otherBranch}`,expected:['"commit"']},error}if(currentCommit===otherCommit){const error=new Error('Incorrect usage of "merge". Both branches have same head');throw error.hash={text:`merge ${otherBranch}`,token:`merge ${otherBranch}`,expected:["branch abc"]},error}if(customId&&state.records.commits.has(customId)){const error=new Error('Incorrect usage of "merge". Commit with id:'+customId+" already exists, use different custom id");throw error.hash={text:`merge ${otherBranch} ${customId} ${overrideType} ${null==customTags?void 0:customTags.join(" ")}`,token:`merge ${otherBranch} ${customId} ${overrideType} ${null==customTags?void 0:customTags.join(" ")}`,expected:[`merge ${otherBranch} ${customId}_UNIQUE ${overrideType} ${null==customTags?void 0:customTags.join(" ")}`]},error}const verifiedBranch=otherBranchCheck||"",commit2={id:customId||`${state.records.seq}-${getID()}`,message:`merged branch ${otherBranch} into ${state.records.currBranch}`,seq:state.records.seq++,parents:null==state.records.head?[]:[state.records.head.id,verifiedBranch],branch:state.records.currBranch,type:commitType.MERGE,customType:overrideType,customId:!!customId,tags:customTags??[]};state.records.head=commit2,state.records.commits.set(commit2.id,commit2),state.records.branches.set(state.records.currBranch,commit2.id),log.debug(state.records.branches),log.debug("in mergeBranch")},"merge"),cherryPick=__name(function(cherryPickDB){let sourceId=cherryPickDB.id,targetId=cherryPickDB.targetId,tags=cherryPickDB.tags,parentCommitId=cherryPickDB.parent;log.debug("Entering cherryPick:",sourceId,targetId,tags);const config=getConfig3();if(sourceId=common_default.sanitizeText(sourceId,config),targetId=common_default.sanitizeText(targetId,config),tags=null==tags?void 0:tags.map(tag=>common_default.sanitizeText(tag,config)),parentCommitId=common_default.sanitizeText(parentCommitId,config),!sourceId||!state.records.commits.has(sourceId)){const error=new Error('Incorrect usage of "cherryPick". Source commit id should exist and provided');throw error.hash={text:`cherryPick ${sourceId} ${targetId}`,token:`cherryPick ${sourceId} ${targetId}`,expected:["cherry-pick abc"]},error}const sourceCommit=state.records.commits.get(sourceId);if(void 0===sourceCommit||!sourceCommit)throw new Error('Incorrect usage of "cherryPick". Source commit id should exist and provided');if(parentCommitId&&(!Array.isArray(sourceCommit.parents)||!sourceCommit.parents.includes(parentCommitId))){throw new Error("Invalid operation: The specified parent commit is not an immediate parent of the cherry-picked commit.")}const sourceCommitBranch=sourceCommit.branch;if(sourceCommit.type===commitType.MERGE&&!parentCommitId){throw new Error("Incorrect usage of cherry-pick: If the source commit is a merge commit, an immediate parent commit must be specified.")}if(!targetId||!state.records.commits.has(targetId)){if(sourceCommitBranch===state.records.currBranch){const error=new Error('Incorrect usage of "cherryPick". Source commit is already on current branch');throw error.hash={text:`cherryPick ${sourceId} ${targetId}`,token:`cherryPick ${sourceId} ${targetId}`,expected:["cherry-pick abc"]},error}const currentCommitId=state.records.branches.get(state.records.currBranch);if(void 0===currentCommitId||!currentCommitId){const error=new Error(`Incorrect usage of "cherry-pick". Current branch (${state.records.currBranch})has no commits`);throw error.hash={text:`cherryPick ${sourceId} ${targetId}`,token:`cherryPick ${sourceId} ${targetId}`,expected:["cherry-pick abc"]},error}const currentCommit=state.records.commits.get(currentCommitId);if(void 0===currentCommit||!currentCommit){const error=new Error(`Incorrect usage of "cherry-pick". Current branch (${state.records.currBranch})has no commits`);throw error.hash={text:`cherryPick ${sourceId} ${targetId}`,token:`cherryPick ${sourceId} ${targetId}`,expected:["cherry-pick abc"]},error}const commit2={id:state.records.seq+"-"+getID(),message:`cherry-picked ${null==sourceCommit?void 0:sourceCommit.message} into ${state.records.currBranch}`,seq:state.records.seq++,parents:null==state.records.head?[]:[state.records.head.id,sourceCommit.id],branch:state.records.currBranch,type:commitType.CHERRY_PICK,tags:tags?tags.filter(Boolean):[`cherry-pick:${sourceCommit.id}${sourceCommit.type===commitType.MERGE?`|parent:${parentCommitId}`:""}`]};state.records.head=commit2,state.records.commits.set(commit2.id,commit2),state.records.branches.set(state.records.currBranch,commit2.id),log.debug(state.records.branches),log.debug("in cherryPick")}},"cherryPick"),checkout=__name(function(branch2){if(branch2=common_default.sanitizeText(branch2,getConfig3()),!state.records.branches.has(branch2)){const error=new Error(`Trying to checkout branch which is not yet created. (Help try using "branch ${branch2}")`);throw error.hash={text:`checkout ${branch2}`,token:`checkout ${branch2}`,expected:[`branch ${branch2}`]},error}{state.records.currBranch=branch2;const id=state.records.branches.get(state.records.currBranch);state.records.head=void 0!==id&&id?state.records.commits.get(id)??null:null}},"checkout");function upsert(arr,key,newVal){const index=arr.indexOf(key);-1===index?arr.push(newVal):arr.splice(index,1,newVal)}function prettyPrintCommitHistory(commitArr){const commit2=commitArr.reduce((out,commit3)=>out.seq>commit3.seq?out:commit3,commitArr[0]);let line="";commitArr.forEach(function(c){line+=c===commit2?"\t*":"\t|"});const label=[line,commit2.id,commit2.seq];for(const branch2 in state.records.branches)state.records.branches.get(branch2)===commit2.id&&label.push(branch2);if(log.debug(label.join(" ")),commit2.parents&&2==commit2.parents.length&&commit2.parents[0]&&commit2.parents[1]){const newCommit=state.records.commits.get(commit2.parents[0]);upsert(commitArr,commit2,newCommit),commit2.parents[1]&&commitArr.push(state.records.commits.get(commit2.parents[1]))}else{if(0==commit2.parents.length)return;if(commit2.parents[0]){const newCommit=state.records.commits.get(commit2.parents[0]);upsert(commitArr,commit2,newCommit)}}prettyPrintCommitHistory(commitArr=uniqBy(commitArr,c=>c.id))}__name(upsert,"upsert"),__name(prettyPrintCommitHistory,"prettyPrintCommitHistory");var prettyPrint=__name(function(){log.debug(state.records.commits);prettyPrintCommitHistory([getCommitsArray()[0]])},"prettyPrint"),clear2=__name(function(){state.reset(),clear()},"clear"),getBranchesAsObjArray=__name(function(){return[...state.records.branchConfig.values()].map((branchConfig,i)=>null!==branchConfig.order&&void 0!==branchConfig.order?branchConfig:{...branchConfig,order:parseFloat(`0.${i}`)}).sort((a,b)=>(a.order??0)-(b.order??0)).map(({name:name})=>({name:name}))},"getBranchesAsObjArray"),getBranches=__name(function(){return state.records.branches},"getBranches"),getCommits=__name(function(){return state.records.commits},"getCommits"),getCommitsArray=__name(function(){const commitArr=[...state.records.commits.values()];return commitArr.forEach(function(o){log.debug(o.id)}),commitArr.sort((a,b)=>a.seq-b.seq),commitArr},"getCommitsArray"),db={commitType:commitType,getConfig:getConfig3,setDirection:setDirection,setOptions:setOptions,getOptions:getOptions,commit:commit,branch:branch,merge:merge,cherryPick:cherryPick,checkout:checkout,prettyPrint:prettyPrint,clear:clear2,getBranchesAsObjArray:getBranchesAsObjArray,getBranches:getBranches,getCommits:getCommits,getCommitsArray:getCommitsArray,getCurrentBranch:__name(function(){return state.records.currBranch},"getCurrentBranch"),getDirection:__name(function(){return state.records.direction},"getDirection"),getHead:__name(function(){return state.records.head},"getHead"),setAccTitle:setAccTitle,getAccTitle:getAccTitle,getAccDescription:getAccDescription,setAccDescription:setAccDescription,setDiagramTitle:setDiagramTitle,getDiagramTitle:getDiagramTitle},populate=__name((ast,db2)=>{populateCommonDb(ast,db2),ast.dir&&db2.setDirection(ast.dir);for(const statement of ast.statements)parseStatement(statement,db2)},"populate"),parseStatement=__name((statement,db2)=>{const parser2={Commit:__name(stmt=>db2.commit(parseCommit(stmt)),"Commit"),Branch:__name(stmt=>db2.branch(parseBranch(stmt)),"Branch"),Merge:__name(stmt=>db2.merge(parseMerge(stmt)),"Merge"),Checkout:__name(stmt=>db2.checkout(parseCheckout(stmt)),"Checkout"),CherryPicking:__name(stmt=>db2.cherryPick(parseCherryPicking(stmt)),"CherryPicking")}[statement.$type];parser2?parser2(statement):log.error(`Unknown statement type: ${statement.$type}`)},"parseStatement"),parseCommit=__name(commit2=>({id:commit2.id,msg:commit2.message??"",type:void 0!==commit2.type?commitType[commit2.type]:commitType.NORMAL,tags:commit2.tags??void 0}),"parseCommit"),parseBranch=__name(branch2=>({name:branch2.name,order:branch2.order??0}),"parseBranch"),parseMerge=__name(merge2=>({branch:merge2.branch,id:merge2.id??"",type:void 0!==merge2.type?commitType[merge2.type]:void 0,tags:merge2.tags??void 0}),"parseMerge"),parseCheckout=__name(checkout2=>checkout2.branch,"parseCheckout"),parseCherryPicking=__name(cherryPicking=>{var _a;return{id:cherryPicking.id,targetId:"",tags:0===(null==(_a=cherryPicking.tags)?void 0:_a.length)?void 0:cherryPicking.tags,parent:cherryPicking.parent}},"parseCherryPicking"),parser={parse:__name(async input=>{const ast=await parse("gitGraph",input);log.debug(ast),populate(ast,db)},"parse")},REDUX_GEOMETRY_THEMES=new Set(["redux","redux-dark","redux-color","redux-dark-color"]),COLOR_THEMES=new Set(["redux-color","redux-dark-color"]),DARK_THEMES=new Set(["dark","redux-dark","redux-dark-color","neo-dark"]),calcColorIndex=__name((rawIndex,limit,avoidDefaultColor=!1)=>avoidDefaultColor&&rawIndex>0?(rawIndex-1)%(limit-1)+1:rawIndex%limit,"calcColorIndex"),branchPos=new Map,commitPos=new Map,allCommitsDict=new Map,lanes=[],maxPos=0,dir="LR",clear3=__name(()=>{branchPos.clear(),commitPos.clear(),allCommitsDict.clear(),maxPos=0,lanes=[],dir="LR"},"clear"),drawText=__name(txt=>{const svgLabel=document.createElementNS("http://www.w3.org/2000/svg","text");return("string"==typeof txt?txt.split(/\\n|\n|<br\s*\/?>/gi):txt).forEach(row=>{const tspan=document.createElementNS("http://www.w3.org/2000/svg","tspan");tspan.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve"),tspan.setAttribute("dy","1em"),tspan.setAttribute("x","0"),tspan.setAttribute("class","row"),tspan.textContent=row.trim(),svgLabel.appendChild(tspan)}),svgLabel},"drawText"),findClosestParent=__name(parents=>{let closestParent,comparisonFunc,targetPosition;return"BT"===dir?(comparisonFunc=__name((a,b)=>a<=b,"comparisonFunc"),targetPosition=1/0):(comparisonFunc=__name((a,b)=>a>=b,"comparisonFunc"),targetPosition=0),parents.forEach(parent=>{var _a,_b;const parentPosition="TB"===dir||"BT"==dir?null==(_a=commitPos.get(parent))?void 0:_a.y:null==(_b=commitPos.get(parent))?void 0:_b.x;void 0!==parentPosition&&comparisonFunc(parentPosition,targetPosition)&&(closestParent=parent,targetPosition=parentPosition)}),closestParent},"findClosestParent"),findClosestParentBT=__name(parents=>{let closestParent="",maxPosition=1/0;return parents.forEach(parent=>{const parentPosition=commitPos.get(parent).y;parentPosition<=maxPosition&&(closestParent=parent,maxPosition=parentPosition)}),closestParent||void 0},"findClosestParentBT"),setParallelBTPos=__name((sortedKeys,commits,defaultPos2)=>{let curPos=defaultPos2,maxPosition=defaultPos2;const roots=[];sortedKeys.forEach(key=>{const commit2=commits.get(key);if(!commit2)throw new Error(`Commit not found for key ${key}`);commit2.parents.length?(curPos=calculateCommitPosition(commit2),maxPosition=Math.max(curPos,maxPosition)):roots.push(commit2),setCommitPosition(commit2,curPos)}),curPos=maxPosition,roots.forEach(commit2=>{setRootPosition(commit2,curPos,defaultPos2)}),sortedKeys.forEach(key=>{const commit2=commits.get(key);if(null==commit2?void 0:commit2.parents.length){const closestParent=findClosestParentBT(commit2.parents);curPos=commitPos.get(closestParent).y-40,curPos<=maxPosition&&(maxPosition=curPos);const x=branchPos.get(commit2.branch).pos,y=curPos-10;commitPos.set(commit2.id,{x:x,y:y})}})},"setParallelBTPos"),findClosestParentPos=__name(commit2=>{var _a;const closestParent=findClosestParent(commit2.parents.filter(p=>null!==p));if(!closestParent)throw new Error(`Closest parent not found for commit ${commit2.id}`);const closestParentPos=null==(_a=commitPos.get(closestParent))?void 0:_a.y;if(void 0===closestParentPos)throw new Error(`Closest parent position not found for commit ${commit2.id}`);return closestParentPos},"findClosestParentPos"),calculateCommitPosition=__name(commit2=>findClosestParentPos(commit2)+40,"calculateCommitPosition"),setCommitPosition=__name((commit2,curPos)=>{const branch2=branchPos.get(commit2.branch);if(!branch2)throw new Error(`Branch not found for commit ${commit2.id}`);const x=branch2.pos,y=curPos+10;return commitPos.set(commit2.id,{x:x,y:y}),{x:x,y:y}},"setCommitPosition"),setRootPosition=__name((commit2,curPos,defaultPos2)=>{const branch2=branchPos.get(commit2.branch);if(!branch2)throw new Error(`Branch not found for commit ${commit2.id}`);const y=curPos+defaultPos2,x=branch2.pos;commitPos.set(commit2.id,{x:x,y:y})},"setRootPosition"),drawCommitBullet=__name((gBullets,commit2,commitPosition,typeClass,branchIndex,commitSymbolType)=>{const{theme:theme}=getConfig2(),useReduxGeometry=REDUX_GEOMETRY_THEMES.has(theme??""),useColorTheme=COLOR_THEMES.has(theme??""),isDark=DARK_THEMES.has(theme??"");if(commitSymbolType===commitType.HIGHLIGHT)gBullets.append("rect").attr("x",commitPosition.x-10+(useReduxGeometry?3:0)).attr("y",commitPosition.y-10+(useReduxGeometry?3:0)).attr("width",useReduxGeometry?14:20).attr("height",useReduxGeometry?14:20).attr("class",`commit ${commit2.id} commit-highlight${calcColorIndex(branchIndex,8,useColorTheme)} ${typeClass}-outer`),gBullets.append("rect").attr("x",commitPosition.x-6+(useReduxGeometry?2:0)).attr("y",commitPosition.y-6+(useReduxGeometry?2:0)).attr("width",useReduxGeometry?8:12).attr("height",useReduxGeometry?8:12).attr("class",`commit ${commit2.id} commit${calcColorIndex(branchIndex,8,useColorTheme)} ${typeClass}-inner`);else if(commitSymbolType===commitType.CHERRY_PICK)gBullets.append("circle").attr("cx",commitPosition.x).attr("cy",commitPosition.y).attr("r",useReduxGeometry?7:10).attr("class",`commit ${commit2.id} ${typeClass}`),gBullets.append("circle").attr("cx",commitPosition.x-3).attr("cy",commitPosition.y+2).attr("r",useReduxGeometry?2.5:2.75).attr("fill",isDark?"#000000":"#fff").attr("class",`commit ${commit2.id} ${typeClass}`),gBullets.append("circle").attr("cx",commitPosition.x+3).attr("cy",commitPosition.y+2).attr("r",useReduxGeometry?2.5:2.75).attr("fill",isDark?"#000000":"#fff").attr("class",`commit ${commit2.id} ${typeClass}`),gBullets.append("line").attr("x1",commitPosition.x+3).attr("y1",commitPosition.y+1).attr("x2",commitPosition.x).attr("y2",commitPosition.y-5).attr("stroke",isDark?"#000000":"#fff").attr("class",`commit ${commit2.id} ${typeClass}`),gBullets.append("line").attr("x1",commitPosition.x-3).attr("y1",commitPosition.y+1).attr("x2",commitPosition.x).attr("y2",commitPosition.y-5).attr("stroke",isDark?"#000000":"#fff").attr("class",`commit ${commit2.id} ${typeClass}`);else{const circle=gBullets.append("circle");if(circle.attr("cx",commitPosition.x),circle.attr("cy",commitPosition.y),circle.attr("r",useReduxGeometry?7:10),circle.attr("class",`commit ${commit2.id} commit${calcColorIndex(branchIndex,8,useColorTheme)}`),commitSymbolType===commitType.MERGE){const circle2=gBullets.append("circle");circle2.attr("cx",commitPosition.x),circle2.attr("cy",commitPosition.y),circle2.attr("r",useReduxGeometry?5:6),circle2.attr("class",`commit ${typeClass} ${commit2.id} commit${calcColorIndex(branchIndex,8,useColorTheme)}`)}if(commitSymbolType===commitType.REVERSE){const constValue=useReduxGeometry?4:5;gBullets.append("path").attr("d",`M ${commitPosition.x-constValue},${commitPosition.y-constValue}L${commitPosition.x+constValue},${commitPosition.y+constValue}M${commitPosition.x-constValue},${commitPosition.y+constValue}L${commitPosition.x+constValue},${commitPosition.y-constValue}`).attr("class",`commit ${typeClass} ${commit2.id} commit${calcColorIndex(branchIndex,8,useColorTheme)}`)}}},"drawCommitBullet"),drawCommitLabel=__name((gLabels,commit2,commitPosition,pos,gitGraphConfig)=>{var _a;if(commit2.type!==commitType.CHERRY_PICK&&(commit2.customId&&commit2.type===commitType.MERGE||commit2.type!==commitType.MERGE)&&gitGraphConfig.showCommitLabel){const wrapper=gLabels.append("g"),labelBkg=wrapper.insert("rect").attr("class","commit-label-bkg"),text=wrapper.append("text").attr("x",pos).attr("y",commitPosition.y+25).attr("class","commit-label").text(commit2.id),bbox=null==(_a=text.node())?void 0:_a.getBBox();if(bbox&&(labelBkg.attr("x",commitPosition.posWithOffset-bbox.width/2-2).attr("y",commitPosition.y+13.5).attr("width",bbox.width+4).attr("height",bbox.height+4),"TB"===dir||"BT"===dir?(labelBkg.attr("x",commitPosition.x-(bbox.width+16+5)).attr("y",commitPosition.y-12),text.attr("x",commitPosition.x-(bbox.width+16)).attr("y",commitPosition.y+bbox.height-12)):text.attr("x",commitPosition.posWithOffset-bbox.width/2),gitGraphConfig.rotateCommitLabel))if("TB"===dir||"BT"===dir)text.attr("transform","rotate(-45, "+commitPosition.x+", "+commitPosition.y+")"),labelBkg.attr("transform","rotate(-45, "+commitPosition.x+", "+commitPosition.y+")");else{const r_x=-7.5-(bbox.width+10)/25*9.5,r_y=10+bbox.width/25*8.5;wrapper.attr("transform","translate("+r_x+", "+r_y+") rotate(-45, "+pos+", "+commitPosition.y+")")}}},"drawCommitLabel"),drawCommitTags=__name((gLabels,commit2,commitPosition,pos)=>{var _a;if(commit2.tags.length>0){let yOffset=0,maxTagBboxWidth=0,maxTagBboxHeight=0;const tagElements=[];for(const tagValue of commit2.tags.reverse()){const rect=gLabels.insert("polygon"),hole=gLabels.append("circle"),tag=gLabels.append("text").attr("y",commitPosition.y-16-yOffset).attr("class","tag-label").text(tagValue),tagBbox=null==(_a=tag.node())?void 0:_a.getBBox();if(!tagBbox)throw new Error("Tag bbox not found");maxTagBboxWidth=Math.max(maxTagBboxWidth,tagBbox.width),maxTagBboxHeight=Math.max(maxTagBboxHeight,tagBbox.height),tag.attr("x",commitPosition.posWithOffset-tagBbox.width/2),tagElements.push({tag:tag,hole:hole,rect:rect,yOffset:yOffset}),yOffset+=20}for(const{tag:tag,hole:hole,rect:rect,yOffset:yOffset2}of tagElements){const h2=maxTagBboxHeight/2,ly=commitPosition.y-19.2-yOffset2;if(rect.attr("class","tag-label-bkg").attr("points",`\n ${pos-maxTagBboxWidth/2-2},${ly+2} \n ${pos-maxTagBboxWidth/2-2},${ly-2}\n ${commitPosition.posWithOffset-maxTagBboxWidth/2-4},${ly-h2-2}\n ${commitPosition.posWithOffset+maxTagBboxWidth/2+4},${ly-h2-2}\n ${commitPosition.posWithOffset+maxTagBboxWidth/2+4},${ly+h2+2}\n ${commitPosition.posWithOffset-maxTagBboxWidth/2-4},${ly+h2+2}`),hole.attr("cy",ly).attr("cx",pos-maxTagBboxWidth/2+2).attr("r",1.5).attr("class","tag-hole"),"TB"===dir||"BT"===dir){const yOrigin=pos+yOffset2;rect.attr("class","tag-label-bkg").attr("points",`\n ${commitPosition.x},${yOrigin+2}\n ${commitPosition.x},${yOrigin-2}\n ${commitPosition.x+10},${yOrigin-h2-2}\n ${commitPosition.x+10+maxTagBboxWidth+4},${yOrigin-h2-2}\n ${commitPosition.x+10+maxTagBboxWidth+4},${yOrigin+h2+2}\n ${commitPosition.x+10},${yOrigin+h2+2}`).attr("transform","translate(12,12) rotate(45, "+commitPosition.x+","+pos+")"),hole.attr("cx",commitPosition.x+2).attr("cy",yOrigin).attr("transform","translate(12,12) rotate(45, "+commitPosition.x+","+pos+")"),tag.attr("x",commitPosition.x+5).attr("y",yOrigin+3).attr("transform","translate(14,14) rotate(45, "+commitPosition.x+","+pos+")")}}}},"drawCommitTags"),getCommitClassType=__name(commit2=>{switch(commit2.customType??commit2.type){case commitType.NORMAL:return"commit-normal";case commitType.REVERSE:return"commit-reverse";case commitType.HIGHLIGHT:return"commit-highlight";case commitType.MERGE:return"commit-merge";case commitType.CHERRY_PICK:return"commit-cherry-pick";default:return"commit-normal"}},"getCommitClassType"),calculatePosition=__name((commit2,dir2,pos,commitPos2)=>{const defaultCommitPosition={x:0,y:0};if(!(commit2.parents.length>0)){if("TB"===dir2)return 30;if("BT"===dir2){return(commitPos2.get(commit2.id)??defaultCommitPosition).y-40}return 0}{const closestParent=findClosestParent(commit2.parents);if(closestParent){const parentPosition=commitPos2.get(closestParent)??defaultCommitPosition;if("TB"===dir2)return parentPosition.y+40;if("BT"===dir2){return(commitPos2.get(commit2.id)??defaultCommitPosition).y-40}return parentPosition.x+40}}return 0},"calculatePosition"),getCommitPosition=__name((commit2,pos,isParallelCommits)=>{var _a,_b;const posWithOffset="BT"===dir&&isParallelCommits?pos:pos+10,branchY=null==(_a=branchPos.get(commit2.branch))?void 0:_a.pos,x="TB"===dir||"BT"===dir?null==(_b=branchPos.get(commit2.branch))?void 0:_b.pos:posWithOffset;if(void 0===x||void 0===branchY)throw new Error(`Position were undefined for commit ${commit2.id}`);const useReduxGeometry=REDUX_GEOMETRY_THEMES.has(getConfig2().theme??"");return{x:x,y:"TB"===dir||"BT"===dir?posWithOffset:branchY+(useReduxGeometry?7:-2),posWithOffset:posWithOffset}},"getCommitPosition"),drawCommits=__name((svg,commits,modifyGraph,gitGraphConfig)=>{const gBullets=svg.append("g").attr("class","commit-bullets"),gLabels=svg.append("g").attr("class","commit-labels");let pos="TB"===dir||"BT"===dir?30:0;const keys=[...commits.keys()],isParallelCommits=gitGraphConfig.parallelCommits??!1,sortKeys=__name((a,b)=>{var _a,_b;const seqA=null==(_a=commits.get(a))?void 0:_a.seq,seqB=null==(_b=commits.get(b))?void 0:_b.seq;return void 0!==seqA&&void 0!==seqB?seqA-seqB:0},"sortKeys");let sortedKeys=keys.sort(sortKeys);"BT"===dir&&(isParallelCommits&&setParallelBTPos(sortedKeys,commits,pos),sortedKeys=sortedKeys.reverse()),sortedKeys.forEach(key=>{var _a;const commit2=commits.get(key);if(!commit2)throw new Error(`Commit not found for key ${key}`);isParallelCommits&&(pos=calculatePosition(commit2,dir,pos,commitPos));const commitPosition=getCommitPosition(commit2,pos,isParallelCommits);if(modifyGraph){const typeClass=getCommitClassType(commit2),commitSymbolType=commit2.customType??commit2.type,branchIndex=(null==(_a=branchPos.get(commit2.branch))?void 0:_a.index)??0;drawCommitBullet(gBullets,commit2,commitPosition,typeClass,branchIndex,commitSymbolType),drawCommitLabel(gLabels,commit2,commitPosition,pos,gitGraphConfig),drawCommitTags(gLabels,commit2,commitPosition,pos)}"TB"===dir||"BT"===dir?commitPos.set(commit2.id,{x:commitPosition.x,y:commitPosition.posWithOffset}):commitPos.set(commit2.id,{x:commitPosition.posWithOffset,y:commitPosition.y}),pos="BT"===dir&&isParallelCommits?pos+40:pos+40+10,pos>maxPos&&(maxPos=pos)})},"drawCommits"),shouldRerouteArrow=__name((commitA,commitB,p1,p2,allCommits)=>{const branchToGetCurve=("TB"===dir||"BT"===dir?p1.x<p2.x:p1.y<p2.y)?commitB.branch:commitA.branch,isOnBranchToGetCurve=__name(x=>x.branch===branchToGetCurve,"isOnBranchToGetCurve"),isBetweenCommits=__name(x=>x.seq>commitA.seq&&x.seq<commitB.seq,"isBetweenCommits");return[...allCommits.values()].some(commitX=>isBetweenCommits(commitX)&&isOnBranchToGetCurve(commitX))},"shouldRerouteArrow"),findLane=__name((y1,y2,depth=0)=>{const candidate=y1+Math.abs(y1-y2)/2;if(depth>5)return candidate;if(lanes.every(lane=>Math.abs(lane-candidate)>=10))return lanes.push(candidate),candidate;const diff=Math.abs(y1-y2);return findLane(y1,y2-diff/5,depth+1)},"findLane"),drawArrow=__name((svg,commitA,commitB,allCommits)=>{var _a,_b,_c,_d,_e;const{theme:arrowTheme}=getConfig2(),useColorTheme=COLOR_THEMES.has(arrowTheme??""),p1=commitPos.get(commitA.id),p2=commitPos.get(commitB.id);if(void 0===p1||void 0===p2)throw new Error(`Commit positions not found for commits ${commitA.id} and ${commitB.id}`);const arrowNeedsRerouting=shouldRerouteArrow(commitA,commitB,p1,p2,allCommits);let lineDef,arc="",arc2="",radius=0,offset=0,colorClassNum=null==(_a=branchPos.get(commitB.branch))?void 0:_a.index;if(commitB.type===commitType.MERGE&&commitA.id!==commitB.parents[0]&&(colorClassNum=null==(_b=branchPos.get(commitA.branch))?void 0:_b.index),arrowNeedsRerouting){arc="A 10 10, 0, 0, 0,",arc2="A 10 10, 0, 0, 1,",radius=10,offset=10;const lineY=p1.y<p2.y?findLane(p1.y,p2.y):findLane(p2.y,p1.y),lineX=p1.x<p2.x?findLane(p1.x,p2.x):findLane(p2.x,p1.x);"TB"===dir?p1.x<p2.x?lineDef=`M ${p1.x} ${p1.y} L ${lineX-radius} ${p1.y} ${arc2} ${lineX} ${p1.y+offset} L ${lineX} ${p2.y-radius} ${arc} ${lineX+offset} ${p2.y} L ${p2.x} ${p2.y}`:(colorClassNum=null==(_c=branchPos.get(commitA.branch))?void 0:_c.index,lineDef=`M ${p1.x} ${p1.y} L ${lineX+radius} ${p1.y} ${arc} ${lineX} ${p1.y+offset} L ${lineX} ${p2.y-radius} ${arc2} ${lineX-offset} ${p2.y} L ${p2.x} ${p2.y}`):"BT"===dir?p1.x<p2.x?lineDef=`M ${p1.x} ${p1.y} L ${lineX-radius} ${p1.y} ${arc} ${lineX} ${p1.y-offset} L ${lineX} ${p2.y+radius} ${arc2} ${lineX+offset} ${p2.y} L ${p2.x} ${p2.y}`:(colorClassNum=null==(_d=branchPos.get(commitA.branch))?void 0:_d.index,lineDef=`M ${p1.x} ${p1.y} L ${lineX+radius} ${p1.y} ${arc2} ${lineX} ${p1.y-offset} L ${lineX} ${p2.y+radius} ${arc} ${lineX-offset} ${p2.y} L ${p2.x} ${p2.y}`):p1.y<p2.y?lineDef=`M ${p1.x} ${p1.y} L ${p1.x} ${lineY-radius} ${arc} ${p1.x+offset} ${lineY} L ${p2.x-radius} ${lineY} ${arc2} ${p2.x} ${lineY+offset} L ${p2.x} ${p2.y}`:(colorClassNum=null==(_e=branchPos.get(commitA.branch))?void 0:_e.index,lineDef=`M ${p1.x} ${p1.y} L ${p1.x} ${lineY+radius} ${arc2} ${p1.x+offset} ${lineY} L ${p2.x-radius} ${lineY} ${arc} ${p2.x} ${lineY-offset} L ${p2.x} ${p2.y}`)}else arc="A 20 20, 0, 0, 0,",arc2="A 20 20, 0, 0, 1,",radius=20,offset=20,"TB"===dir?(p1.x<p2.x&&(lineDef=commitB.type===commitType.MERGE&&commitA.id!==commitB.parents[0]?`M ${p1.x} ${p1.y} L ${p1.x} ${p2.y-radius} ${arc} ${p1.x+offset} ${p2.y} L ${p2.x} ${p2.y}`:`M ${p1.x} ${p1.y} L ${p2.x-radius} ${p1.y} ${arc2} ${p2.x} ${p1.y+offset} L ${p2.x} ${p2.y}`),p1.x>p2.x&&(arc="A 20 20, 0, 0, 0,",arc2="A 20 20, 0, 0, 1,",radius=20,offset=20,lineDef=commitB.type===commitType.MERGE&&commitA.id!==commitB.parents[0]?`M ${p1.x} ${p1.y} L ${p1.x} ${p2.y-radius} ${arc2} ${p1.x-offset} ${p2.y} L ${p2.x} ${p2.y}`:`M ${p1.x} ${p1.y} L ${p2.x+radius} ${p1.y} ${arc} ${p2.x} ${p1.y+offset} L ${p2.x} ${p2.y}`),p1.x===p2.x&&(lineDef=`M ${p1.x} ${p1.y} L ${p2.x} ${p2.y}`)):"BT"===dir?(p1.x<p2.x&&(lineDef=commitB.type===commitType.MERGE&&commitA.id!==commitB.parents[0]?`M ${p1.x} ${p1.y} L ${p1.x} ${p2.y+radius} ${arc2} ${p1.x+offset} ${p2.y} L ${p2.x} ${p2.y}`:`M ${p1.x} ${p1.y} L ${p2.x-radius} ${p1.y} ${arc} ${p2.x} ${p1.y-offset} L ${p2.x} ${p2.y}`),p1.x>p2.x&&(arc="A 20 20, 0, 0, 0,",arc2="A 20 20, 0, 0, 1,",radius=20,offset=20,lineDef=commitB.type===commitType.MERGE&&commitA.id!==commitB.parents[0]?`M ${p1.x} ${p1.y} L ${p1.x} ${p2.y+radius} ${arc} ${p1.x-offset} ${p2.y} L ${p2.x} ${p2.y}`:`M ${p1.x} ${p1.y} L ${p2.x+radius} ${p1.y} ${arc2} ${p2.x} ${p1.y-offset} L ${p2.x} ${p2.y}`),p1.x===p2.x&&(lineDef=`M ${p1.x} ${p1.y} L ${p2.x} ${p2.y}`)):(p1.y<p2.y&&(lineDef=commitB.type===commitType.MERGE&&commitA.id!==commitB.parents[0]?`M ${p1.x} ${p1.y} L ${p2.x-radius} ${p1.y} ${arc2} ${p2.x} ${p1.y+offset} L ${p2.x} ${p2.y}`:`M ${p1.x} ${p1.y} L ${p1.x} ${p2.y-radius} ${arc} ${p1.x+offset} ${p2.y} L ${p2.x} ${p2.y}`),p1.y>p2.y&&(lineDef=commitB.type===commitType.MERGE&&commitA.id!==commitB.parents[0]?`M ${p1.x} ${p1.y} L ${p2.x-radius} ${p1.y} ${arc} ${p2.x} ${p1.y-offset} L ${p2.x} ${p2.y}`:`M ${p1.x} ${p1.y} L ${p1.x} ${p2.y+radius} ${arc2} ${p1.x+offset} ${p2.y} L ${p2.x} ${p2.y}`),p1.y===p2.y&&(lineDef=`M ${p1.x} ${p1.y} L ${p2.x} ${p2.y}`));if(void 0===lineDef)throw new Error("Line definition not found");svg.append("path").attr("d",lineDef).attr("class","arrow arrow"+calcColorIndex(colorClassNum,8,useColorTheme))},"drawArrow"),drawArrows=__name((svg,commits)=>{const gArrows=svg.append("g").attr("class","commit-arrows");[...commits.keys()].forEach(key=>{const commit2=commits.get(key);commit2.parents&&commit2.parents.length>0&&commit2.parents.forEach(parent=>{drawArrow(gArrows,commits.get(parent),commit2,commits)})})},"drawArrows"),drawBranches=__name((svg,branches,gitGraphConfig,id)=>{const{look:look,theme:theme,themeVariables:themeVariables}=getConfig2(),{dropShadow:dropShadow,THEME_COLOR_LIMIT:themeColorLimit}=themeVariables,useReduxGeometry=REDUX_GEOMETRY_THEMES.has(theme??""),useColorTheme=COLOR_THEMES.has(theme??""),g=svg.append("g");branches.forEach((branch2,index)=>{var _a;const adjustIndexForTheme=calcColorIndex(index,useReduxGeometry?themeColorLimit:8,useColorTheme),pos=null==(_a=branchPos.get(branch2.name))?void 0:_a.pos;if(void 0===pos)throw new Error(`Position not found for branch ${branch2.name}`);const spineY="TB"===dir||"BT"===dir?pos:useReduxGeometry?pos+6+1:pos-2,line=g.append("line");line.attr("x1",0),line.attr("y1",spineY),line.attr("x2",maxPos),line.attr("y2",spineY),line.attr("class","branch branch"+adjustIndexForTheme),"TB"===dir?(line.attr("y1",30),line.attr("x1",pos),line.attr("y2",maxPos),line.attr("x2",pos)):"BT"===dir&&(line.attr("y1",maxPos),line.attr("x1",pos),line.attr("y2",30),line.attr("x2",pos)),lanes.push(spineY);const name=branch2.name,labelElement=drawText(name),bkg=g.insert("rect"),label=g.insert("g").attr("class","branchLabel").insert("g").attr("class","label branch-label"+adjustIndexForTheme);label.node().appendChild(labelElement);const bbox=labelElement.getBBox(),borderRadius=useReduxGeometry?0:4,labelPaddingX=useReduxGeometry?16:0,labelPaddingY=useReduxGeometry?12:0;"neo"===look&&bkg.attr("data-look","neo"),bkg.attr("class","branchLabelBkg label"+adjustIndexForTheme).attr("style","neo"===look?`filter:${useReduxGeometry?`url(#${id}-drop-shadow)`:dropShadow}`:"").attr("rx",borderRadius).attr("ry",borderRadius).attr("x",-bbox.width-4-(!0===gitGraphConfig.rotateCommitLabel?30:0)).attr("y",-bbox.height/2+10).attr("width",bbox.width+18+labelPaddingX).attr("height",bbox.height+4+labelPaddingY),label.attr("transform","translate("+(-bbox.width-14-(!0===gitGraphConfig.rotateCommitLabel?30:0)+labelPaddingX/2)+", "+(spineY-bbox.height/2-2)+")"),"TB"===dir?(bkg.attr("x",pos-bbox.width/2-10).attr("y",0),label.attr("transform","translate("+(pos-bbox.width/2-5)+", 0)"),useReduxGeometry&&(bkg.attr("transform",`translate(${-labelPaddingX/2-3}, ${-labelPaddingY-10})`),label.attr("transform","translate("+(pos-bbox.width/2-5)+", "+(2*-labelPaddingY+7)+")"))):"BT"===dir?(bkg.attr("x",pos-bbox.width/2-10).attr("y",maxPos),label.attr("transform","translate("+(pos-bbox.width/2-5)+", "+maxPos+")"),useReduxGeometry&&(bkg.attr("transform",`translate(${-labelPaddingX/2-3}, ${labelPaddingY+10})`),label.attr("transform","translate("+(pos-bbox.width/2-5)+", "+(maxPos+2*labelPaddingY+4)+")"))):bkg.attr("transform","translate(-19, "+(spineY-12-labelPaddingY/2)+")")})},"drawBranches"),setBranchPosition=__name(function(name,pos,index,bbox,rotateCommitLabel){return branchPos.set(name,{pos:pos,index:index}),pos+=50+(rotateCommitLabel?40:0)+("TB"===dir||"BT"===dir?bbox.width/2:0)},"setBranchPosition"),gitGraphRenderer_default={draw:__name(function(txt,id,ver,diagObj){clear3(),log.debug("in gitgraph renderer",txt+"\n","id:",id,ver);const db2=diagObj.db;if(!db2.getConfig)return void log.error("getConfig method is not available on db");const gitGraphConfig=db2.getConfig(),rotateCommitLabel=gitGraphConfig.rotateCommitLabel??!1;allCommitsDict=db2.getCommits();const branches=db2.getBranchesAsObjArray();dir=db2.getDirection();const diagram2=select(`[id="${id}"]`),{look:look,theme:theme,themeVariables:themeVariables}=getConfig2(),{useGradient:useGradient,gradientStart:gradientStart,gradientStop:gradientStop,filterColor:filterColor}=themeVariables;if(useGradient){const gradient=diagram2.append("defs").append("linearGradient").attr("id",id+"-gradient").attr("gradientUnits","objectBoundingBox").attr("x1","0%").attr("y1","0%").attr("x2","100%").attr("y2","0%");gradient.append("stop").attr("offset","0%").attr("stop-color",gradientStart).attr("stop-opacity",1),gradient.append("stop").attr("offset","100%").attr("stop-color",gradientStop).attr("stop-opacity",1)}"neo"===look&&REDUX_GEOMETRY_THEMES.has(theme??"")&&diagram2.append("defs").append("filter").attr("id",id+"-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",filterColor);let pos=0;branches.forEach((branch2,index)=>{var _a;const labelElement=drawText(branch2.name),g=diagram2.append("g"),branchLabel=g.insert("g").attr("class","branchLabel"),label=branchLabel.insert("g").attr("class","label branch-label");null==(_a=label.node())||_a.appendChild(labelElement);const bbox=labelElement.getBBox();pos=setBranchPosition(branch2.name,pos,index,bbox,rotateCommitLabel),label.remove(),branchLabel.remove(),g.remove()}),drawCommits(diagram2,allCommitsDict,!1,gitGraphConfig),gitGraphConfig.showBranches&&drawBranches(diagram2,branches,gitGraphConfig,id),drawArrows(diagram2,allCommitsDict),drawCommits(diagram2,allCommitsDict,!0,gitGraphConfig),utils_default.insertTitle(diagram2,"gitTitleText",gitGraphConfig.titleTopMargin??0,db2.getDiagramTitle()),setupGraphViewbox2(void 0,diagram2,gitGraphConfig.diagramPadding,gitGraphConfig.useMaxWidth)},"draw")},REDUX_GEOMETRY_THEMES2=new Set(["redux","redux-dark","redux-color","redux-dark-color"]),COLOR_THEMES2=new Set(["redux-color","redux-dark-color"]),NEO_THEMES=new Set(["neo","neo-dark"]),DARK_THEMES2=new Set(["dark","redux-dark","redux-dark-color","neo-dark"]),NEO_COLOR_GEN_THEMES=new Set(["redux","redux-dark","redux-color","redux-dark-color","neo","neo-dark"]),genGitGraphGradient=__name(options=>{const{svgId:svgId}=options;let sections="";if(options.useGradient&&svgId)for(let i=0;i<options.THEME_COLOR_LIMIT;i++)sections+=`\n .label${i} { fill: ${options.mainBkg}; stroke: url(${svgId}-gradient); stroke-width: ${options.strokeWidth};}\n `;return sections},"genGitGraphGradient"),genColor=__name(options=>{const config=getConfig(),{theme:theme,themeVariables:themeVariables}=config,{borderColorArray:borderColorArray}=themeVariables,useReduxGeometry=REDUX_GEOMETRY_THEMES2.has(theme);if(NEO_THEMES.has(theme)){let sections="";for(let i=0;i<options.THEME_COLOR_LIMIT;i++)if(0===i)sections+=`\n .branch-label${i} { fill: ${options.nodeBorder};}\n .commit${i} { stroke: ${options.nodeBorder}; }\n .commit-highlight${i} { stroke: ${options.nodeBorder}; fill: ${options.nodeBorder}; }\n .arrow${i} { stroke: ${options.nodeBorder}; }\n .commit-bullets { fill: ${options.nodeBorder}; }\n .commit-cherry-pick${i} { stroke: ${options.nodeBorder}; }\n ${genGitGraphGradient(options)}`;else{const ci=i%8;sections+=`\n .branch-label${i} { fill: ${options["gitBranchLabel"+ci]}; }\n .commit${i} { stroke: ${options["git"+ci]}; fill: ${options["git"+ci]}; }\n .commit-highlight${i} { stroke: ${options["gitInv"+ci]}; fill: ${options["gitInv"+ci]}; }\n .arrow${i} { stroke: ${options["git"+ci]}; }\n `}return sections}if(COLOR_THEMES2.has(theme)){let sections="";for(let i=0;i<options.THEME_COLOR_LIMIT;i++)if(0===i)sections+=`\n .branch-label${i} { fill: ${options.nodeBorder}; ${useReduxGeometry?`font-weight:${options.noteFontWeight}`:""} }\n .commit${i} { stroke: ${options.nodeBorder}; }\n .commit-highlight${i} { stroke: ${options.nodeBorder}; fill: ${options.mainBkg}; }\n .label${i} { fill: ${options.mainBkg}; stroke: ${options.nodeBorder}; stroke-width: ${options.strokeWidth}; ${useReduxGeometry?`font-weight:${options.noteFontWeight}`:""} }\n .arrow${i} { stroke: ${options.nodeBorder}; }\n .commit-bullets { fill: ${options.nodeBorder}; }\n `;else{const colorIndex=i%borderColorArray.length;sections+=`\n .branch-label${i} { fill: ${options.nodeBorder}; ${useReduxGeometry?`font-weight:${options.noteFontWeight}`:""} }\n .commit${i} { stroke: ${borderColorArray[colorIndex]}; fill: ${borderColorArray[colorIndex]}; }\n .commit-highlight${i} { stroke: ${borderColorArray[colorIndex]}; fill: ${borderColorArray[colorIndex]}; }\n .label${i} { fill: ${DARK_THEMES2.has(theme)?options.mainBkg:borderColorArray[colorIndex]}; stroke: ${borderColorArray[colorIndex]}; stroke-width: ${options.strokeWidth}; }\n .arrow${i} { stroke: ${borderColorArray[colorIndex]}; }\n `}return sections}{let sections="";for(let i=0;i<options.THEME_COLOR_LIMIT;i++)sections+=`\n .branch-label${i} { fill: ${options.nodeBorder}; ${useReduxGeometry?`font-weight:${options.noteFontWeight}`:""} }\n .commit${i} { stroke: ${options.nodeBorder}; }\n .commit-highlight${i} { stroke: ${options.nodeBorder}; fill: ${options.nodeBorder}; }\n .label${i} { fill: ${options.mainBkg}; stroke: ${options.nodeBorder}; stroke-width: ${options.strokeWidth}; ${useReduxGeometry?`font-weight:${options.noteFontWeight}`:""}}\n .arrow${i} { stroke: ${options.nodeBorder}; }\n .commit-bullets { fill: ${options.nodeBorder}; }\n .commit-cherry-pick${i} { stroke: ${options.nodeBorder}; }\n `;return sections}},"genColor"),normalTheme=__name(options=>`${Array.from({length:options.THEME_COLOR_LIMIT},(_,i)=>i).map(i=>{const ci=i%8;return`\n .branch-label${i} { fill: ${options["gitBranchLabel"+ci]}; }\n .commit${i} { stroke: ${options["git"+ci]}; fill: ${options["git"+ci]}; }\n .commit-highlight${i} { stroke: ${options["gitInv"+ci]}; fill: ${options["gitInv"+ci]}; }\n .label${i} { fill: ${options["git"+ci]}; }\n .arrow${i} { stroke: ${options["git"+ci]}; }\n `}).join("\n")}`,"normalTheme"),diagram={parser:parser,db:db,renderer:gitGraphRenderer_default,styles:__name(options=>{const config=getConfig(),{theme:theme}=config,useNeoColorGen=NEO_COLOR_GEN_THEMES.has(theme);return`\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 \n ${useNeoColorGen?genColor(options):normalTheme(options)}\n\n .branch {\n stroke-width: ${options.strokeWidth};\n stroke: ${options.commitLineColor??options.lineColor};\n stroke-dasharray: ${useNeoColorGen?"4 2":"2"};\n }\n .commit-label { font-size: ${options.commitLabelFontSize}; fill: ${useNeoColorGen?options.nodeBorder:options.commitLabelColor}; ${useNeoColorGen?`font-weight:${options.noteFontWeight};`:""}}\n .commit-label-bkg { font-size: ${options.commitLabelFontSize}; fill: ${useNeoColorGen?"transparent":options.commitLabelBackground}; opacity: ${useNeoColorGen?"":.5}; }\n .tag-label { font-size: ${options.tagLabelFontSize}; fill: ${options.tagLabelColor};}\n .tag-label-bkg { fill: ${useNeoColorGen?options.mainBkg:options.tagLabelBackground}; stroke: ${useNeoColorGen?options.nodeBorder:options.tagLabelBorder}; ${useNeoColorGen?`filter:${options.dropShadow}`:""} }\n .tag-hole { fill: ${options.textColor}; }\n\n .commit-merge {\n stroke: ${useNeoColorGen?options.mainBkg:options.primaryColor};\n fill: ${useNeoColorGen?options.mainBkg:options.primaryColor};\n }\n .commit-reverse {\n stroke: ${useNeoColorGen?options.mainBkg:options.primaryColor};\n fill: ${useNeoColorGen?options.mainBkg:options.primaryColor};\n stroke-width: ${useNeoColorGen?options.strokeWidth:3};\n }\n .commit-highlight-outer {\n }\n .commit-highlight-inner {\n stroke: ${useNeoColorGen?options.mainBkg:options.primaryColor};\n fill: ${useNeoColorGen?options.mainBkg:options.primaryColor};\n }\n\n .arrow {\n /* Intentional: neo themes keep the bold 8px arrow (like classic themes); only redux-geometry themes use the thinner options.strokeWidth. */\n stroke-width: ${REDUX_GEOMETRY_THEMES2.has(theme)?options.strokeWidth:8};\n stroke-linecap: round;\n fill: none\n }\n .gitTitleText {\n text-anchor: middle;\n font-size: 18px;\n fill: ${options.textColor};\n }\n`},"getStyles")};export{diagram};
1
+ import{p as populateCommonDb}from"./chunk-4BX2VUAB-C7VtouVc.js";import{I as ImperativeState}from"./chunk-QZHKN3VN-BjwG7rZm.js";import{q as getDiagramTitle,p as setDiagramTitle,s as setAccDescription,g as getAccDescription,a as getAccTitle,b as setAccTitle,_ as __name,C as getConfig,l as log,d as select,c as getConfig2,u as utils_default,D as setupGraphViewbox2,y as clear,k as common_default,E as cleanAndMerge,F as defaultConfig_default,G as random}from"./mermaid.core-O3WUNQR6.js";import{p as parse}from"./wardley-RL74JXVD-DS_huD5U.js";import"./index-BnE1kmli.js";import"./vendor-codemirror-BiCbU51m.js";import"./vendor-antd-CAmbzFZk.js";import"./vendor-markdown-Bpu4AByL.js";import"./min-BDNYdllt.js";import"./_baseUniq-C73FOqig.js";var commitType={NORMAL:0,REVERSE:1,HIGHLIGHT:2,MERGE:3,CHERRY_PICK:4},DEFAULT_GITGRAPH_CONFIG=defaultConfig_default.gitGraph,getConfig3=__name(()=>cleanAndMerge({...DEFAULT_GITGRAPH_CONFIG,...getConfig().gitGraph}),"getConfig"),state=new ImperativeState(()=>{const config=getConfig3(),mainBranchName=config.mainBranchName,mainBranchOrder=config.mainBranchOrder;return{mainBranchName:mainBranchName,commits:new Map,head:null,branchConfig:new Map([[mainBranchName,{name:mainBranchName,order:mainBranchOrder}]]),branches:new Map([[mainBranchName,null]]),currBranch:mainBranchName,direction:"LR",seq:0,options:{}}});function getID(){return random({length:7})}function uniqBy(list,fn){const recordMap=Object.create(null);return list.reduce((out,item)=>{const key=fn(item);return recordMap[key]||(recordMap[key]=!0,out.push(item)),out},[])}__name(getID,"getID"),__name(uniqBy,"uniqBy");var setDirection=__name(function(dir2){state.records.direction=dir2},"setDirection"),setOptions=__name(function(rawOptString){log.debug("options str",rawOptString),rawOptString=(rawOptString=null==rawOptString?void 0:rawOptString.trim())||"{}";try{state.records.options=JSON.parse(rawOptString)}catch(e){log.error("error while parsing gitGraph options",e.message)}},"setOptions"),getOptions=__name(function(){return state.records.options},"getOptions"),commit=__name(function(commitDB){let msg=commitDB.msg,id=commitDB.id;const type=commitDB.type;let tags=commitDB.tags;log.info("commit",msg,id,type,tags),log.debug("Entering commit:",msg,id,type,tags);const config=getConfig3();id=common_default.sanitizeText(id,config),msg=common_default.sanitizeText(msg,config),tags=null==tags?void 0:tags.map(tag=>common_default.sanitizeText(tag,config));const newCommit={id:id||state.records.seq+"-"+getID(),message:msg,seq:state.records.seq++,type:type??commitType.NORMAL,tags:tags??[],parents:null==state.records.head?[]:[state.records.head.id],branch:state.records.currBranch};state.records.head=newCommit,log.info("main branch",config.mainBranchName),state.records.commits.has(newCommit.id)&&log.warn(`Commit ID ${newCommit.id} already exists`),state.records.commits.set(newCommit.id,newCommit),state.records.branches.set(state.records.currBranch,newCommit.id),log.debug("in pushCommit "+newCommit.id)},"commit"),branch=__name(function(branchDB){let name=branchDB.name;const order=branchDB.order;if(name=common_default.sanitizeText(name,getConfig3()),state.records.branches.has(name))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 ${name}")`);state.records.branches.set(name,null!=state.records.head?state.records.head.id:null),state.records.branchConfig.set(name,{name:name,order:order}),checkout(name),log.debug("in createBranch")},"branch"),merge=__name(mergeDB=>{let otherBranch=mergeDB.branch,customId=mergeDB.id;const overrideType=mergeDB.type,customTags=mergeDB.tags,config=getConfig3();otherBranch=common_default.sanitizeText(otherBranch,config),customId&&(customId=common_default.sanitizeText(customId,config));const currentBranchCheck=state.records.branches.get(state.records.currBranch),otherBranchCheck=state.records.branches.get(otherBranch),currentCommit=currentBranchCheck?state.records.commits.get(currentBranchCheck):void 0,otherCommit=otherBranchCheck?state.records.commits.get(otherBranchCheck):void 0;if(currentCommit&&otherCommit&&currentCommit.branch===otherBranch)throw new Error(`Cannot merge branch '${otherBranch}' into itself.`);if(state.records.currBranch===otherBranch){const error=new Error('Incorrect usage of "merge". Cannot merge a branch to itself');throw error.hash={text:`merge ${otherBranch}`,token:`merge ${otherBranch}`,expected:["branch abc"]},error}if(void 0===currentCommit||!currentCommit){const error=new Error(`Incorrect usage of "merge". Current branch (${state.records.currBranch})has no commits`);throw error.hash={text:`merge ${otherBranch}`,token:`merge ${otherBranch}`,expected:["commit"]},error}if(!state.records.branches.has(otherBranch)){const error=new Error('Incorrect usage of "merge". Branch to be merged ('+otherBranch+") does not exist");throw error.hash={text:`merge ${otherBranch}`,token:`merge ${otherBranch}`,expected:[`branch ${otherBranch}`]},error}if(void 0===otherCommit||!otherCommit){const error=new Error('Incorrect usage of "merge". Branch to be merged ('+otherBranch+") has no commits");throw error.hash={text:`merge ${otherBranch}`,token:`merge ${otherBranch}`,expected:['"commit"']},error}if(currentCommit===otherCommit){const error=new Error('Incorrect usage of "merge". Both branches have same head');throw error.hash={text:`merge ${otherBranch}`,token:`merge ${otherBranch}`,expected:["branch abc"]},error}if(customId&&state.records.commits.has(customId)){const error=new Error('Incorrect usage of "merge". Commit with id:'+customId+" already exists, use different custom id");throw error.hash={text:`merge ${otherBranch} ${customId} ${overrideType} ${null==customTags?void 0:customTags.join(" ")}`,token:`merge ${otherBranch} ${customId} ${overrideType} ${null==customTags?void 0:customTags.join(" ")}`,expected:[`merge ${otherBranch} ${customId}_UNIQUE ${overrideType} ${null==customTags?void 0:customTags.join(" ")}`]},error}const verifiedBranch=otherBranchCheck||"",commit2={id:customId||`${state.records.seq}-${getID()}`,message:`merged branch ${otherBranch} into ${state.records.currBranch}`,seq:state.records.seq++,parents:null==state.records.head?[]:[state.records.head.id,verifiedBranch],branch:state.records.currBranch,type:commitType.MERGE,customType:overrideType,customId:!!customId,tags:customTags??[]};state.records.head=commit2,state.records.commits.set(commit2.id,commit2),state.records.branches.set(state.records.currBranch,commit2.id),log.debug(state.records.branches),log.debug("in mergeBranch")},"merge"),cherryPick=__name(function(cherryPickDB){let sourceId=cherryPickDB.id,targetId=cherryPickDB.targetId,tags=cherryPickDB.tags,parentCommitId=cherryPickDB.parent;log.debug("Entering cherryPick:",sourceId,targetId,tags);const config=getConfig3();if(sourceId=common_default.sanitizeText(sourceId,config),targetId=common_default.sanitizeText(targetId,config),tags=null==tags?void 0:tags.map(tag=>common_default.sanitizeText(tag,config)),parentCommitId=common_default.sanitizeText(parentCommitId,config),!sourceId||!state.records.commits.has(sourceId)){const error=new Error('Incorrect usage of "cherryPick". Source commit id should exist and provided');throw error.hash={text:`cherryPick ${sourceId} ${targetId}`,token:`cherryPick ${sourceId} ${targetId}`,expected:["cherry-pick abc"]},error}const sourceCommit=state.records.commits.get(sourceId);if(void 0===sourceCommit||!sourceCommit)throw new Error('Incorrect usage of "cherryPick". Source commit id should exist and provided');if(parentCommitId&&(!Array.isArray(sourceCommit.parents)||!sourceCommit.parents.includes(parentCommitId))){throw new Error("Invalid operation: The specified parent commit is not an immediate parent of the cherry-picked commit.")}const sourceCommitBranch=sourceCommit.branch;if(sourceCommit.type===commitType.MERGE&&!parentCommitId){throw new Error("Incorrect usage of cherry-pick: If the source commit is a merge commit, an immediate parent commit must be specified.")}if(!targetId||!state.records.commits.has(targetId)){if(sourceCommitBranch===state.records.currBranch){const error=new Error('Incorrect usage of "cherryPick". Source commit is already on current branch');throw error.hash={text:`cherryPick ${sourceId} ${targetId}`,token:`cherryPick ${sourceId} ${targetId}`,expected:["cherry-pick abc"]},error}const currentCommitId=state.records.branches.get(state.records.currBranch);if(void 0===currentCommitId||!currentCommitId){const error=new Error(`Incorrect usage of "cherry-pick". Current branch (${state.records.currBranch})has no commits`);throw error.hash={text:`cherryPick ${sourceId} ${targetId}`,token:`cherryPick ${sourceId} ${targetId}`,expected:["cherry-pick abc"]},error}const currentCommit=state.records.commits.get(currentCommitId);if(void 0===currentCommit||!currentCommit){const error=new Error(`Incorrect usage of "cherry-pick". Current branch (${state.records.currBranch})has no commits`);throw error.hash={text:`cherryPick ${sourceId} ${targetId}`,token:`cherryPick ${sourceId} ${targetId}`,expected:["cherry-pick abc"]},error}const commit2={id:state.records.seq+"-"+getID(),message:`cherry-picked ${null==sourceCommit?void 0:sourceCommit.message} into ${state.records.currBranch}`,seq:state.records.seq++,parents:null==state.records.head?[]:[state.records.head.id,sourceCommit.id],branch:state.records.currBranch,type:commitType.CHERRY_PICK,tags:tags?tags.filter(Boolean):[`cherry-pick:${sourceCommit.id}${sourceCommit.type===commitType.MERGE?`|parent:${parentCommitId}`:""}`]};state.records.head=commit2,state.records.commits.set(commit2.id,commit2),state.records.branches.set(state.records.currBranch,commit2.id),log.debug(state.records.branches),log.debug("in cherryPick")}},"cherryPick"),checkout=__name(function(branch2){if(branch2=common_default.sanitizeText(branch2,getConfig3()),!state.records.branches.has(branch2)){const error=new Error(`Trying to checkout branch which is not yet created. (Help try using "branch ${branch2}")`);throw error.hash={text:`checkout ${branch2}`,token:`checkout ${branch2}`,expected:[`branch ${branch2}`]},error}{state.records.currBranch=branch2;const id=state.records.branches.get(state.records.currBranch);state.records.head=void 0!==id&&id?state.records.commits.get(id)??null:null}},"checkout");function upsert(arr,key,newVal){const index=arr.indexOf(key);-1===index?arr.push(newVal):arr.splice(index,1,newVal)}function prettyPrintCommitHistory(commitArr){const commit2=commitArr.reduce((out,commit3)=>out.seq>commit3.seq?out:commit3,commitArr[0]);let line="";commitArr.forEach(function(c){line+=c===commit2?"\t*":"\t|"});const label=[line,commit2.id,commit2.seq];for(const branch2 in state.records.branches)state.records.branches.get(branch2)===commit2.id&&label.push(branch2);if(log.debug(label.join(" ")),commit2.parents&&2==commit2.parents.length&&commit2.parents[0]&&commit2.parents[1]){const newCommit=state.records.commits.get(commit2.parents[0]);upsert(commitArr,commit2,newCommit),commit2.parents[1]&&commitArr.push(state.records.commits.get(commit2.parents[1]))}else{if(0==commit2.parents.length)return;if(commit2.parents[0]){const newCommit=state.records.commits.get(commit2.parents[0]);upsert(commitArr,commit2,newCommit)}}prettyPrintCommitHistory(commitArr=uniqBy(commitArr,c=>c.id))}__name(upsert,"upsert"),__name(prettyPrintCommitHistory,"prettyPrintCommitHistory");var prettyPrint=__name(function(){log.debug(state.records.commits);prettyPrintCommitHistory([getCommitsArray()[0]])},"prettyPrint"),clear2=__name(function(){state.reset(),clear()},"clear"),getBranchesAsObjArray=__name(function(){return[...state.records.branchConfig.values()].map((branchConfig,i)=>null!==branchConfig.order&&void 0!==branchConfig.order?branchConfig:{...branchConfig,order:parseFloat(`0.${i}`)}).sort((a,b)=>(a.order??0)-(b.order??0)).map(({name:name})=>({name:name}))},"getBranchesAsObjArray"),getBranches=__name(function(){return state.records.branches},"getBranches"),getCommits=__name(function(){return state.records.commits},"getCommits"),getCommitsArray=__name(function(){const commitArr=[...state.records.commits.values()];return commitArr.forEach(function(o){log.debug(o.id)}),commitArr.sort((a,b)=>a.seq-b.seq),commitArr},"getCommitsArray"),db={commitType:commitType,getConfig:getConfig3,setDirection:setDirection,setOptions:setOptions,getOptions:getOptions,commit:commit,branch:branch,merge:merge,cherryPick:cherryPick,checkout:checkout,prettyPrint:prettyPrint,clear:clear2,getBranchesAsObjArray:getBranchesAsObjArray,getBranches:getBranches,getCommits:getCommits,getCommitsArray:getCommitsArray,getCurrentBranch:__name(function(){return state.records.currBranch},"getCurrentBranch"),getDirection:__name(function(){return state.records.direction},"getDirection"),getHead:__name(function(){return state.records.head},"getHead"),setAccTitle:setAccTitle,getAccTitle:getAccTitle,getAccDescription:getAccDescription,setAccDescription:setAccDescription,setDiagramTitle:setDiagramTitle,getDiagramTitle:getDiagramTitle},populate=__name((ast,db2)=>{populateCommonDb(ast,db2),ast.dir&&db2.setDirection(ast.dir);for(const statement of ast.statements)parseStatement(statement,db2)},"populate"),parseStatement=__name((statement,db2)=>{const parser2={Commit:__name(stmt=>db2.commit(parseCommit(stmt)),"Commit"),Branch:__name(stmt=>db2.branch(parseBranch(stmt)),"Branch"),Merge:__name(stmt=>db2.merge(parseMerge(stmt)),"Merge"),Checkout:__name(stmt=>db2.checkout(parseCheckout(stmt)),"Checkout"),CherryPicking:__name(stmt=>db2.cherryPick(parseCherryPicking(stmt)),"CherryPicking")}[statement.$type];parser2?parser2(statement):log.error(`Unknown statement type: ${statement.$type}`)},"parseStatement"),parseCommit=__name(commit2=>({id:commit2.id,msg:commit2.message??"",type:void 0!==commit2.type?commitType[commit2.type]:commitType.NORMAL,tags:commit2.tags??void 0}),"parseCommit"),parseBranch=__name(branch2=>({name:branch2.name,order:branch2.order??0}),"parseBranch"),parseMerge=__name(merge2=>({branch:merge2.branch,id:merge2.id??"",type:void 0!==merge2.type?commitType[merge2.type]:void 0,tags:merge2.tags??void 0}),"parseMerge"),parseCheckout=__name(checkout2=>checkout2.branch,"parseCheckout"),parseCherryPicking=__name(cherryPicking=>{var _a;return{id:cherryPicking.id,targetId:"",tags:0===(null==(_a=cherryPicking.tags)?void 0:_a.length)?void 0:cherryPicking.tags,parent:cherryPicking.parent}},"parseCherryPicking"),parser={parse:__name(async input=>{const ast=await parse("gitGraph",input);log.debug(ast),populate(ast,db)},"parse")},REDUX_GEOMETRY_THEMES=new Set(["redux","redux-dark","redux-color","redux-dark-color"]),COLOR_THEMES=new Set(["redux-color","redux-dark-color"]),DARK_THEMES=new Set(["dark","redux-dark","redux-dark-color","neo-dark"]),calcColorIndex=__name((rawIndex,limit,avoidDefaultColor=!1)=>avoidDefaultColor&&rawIndex>0?(rawIndex-1)%(limit-1)+1:rawIndex%limit,"calcColorIndex"),branchPos=new Map,commitPos=new Map,allCommitsDict=new Map,lanes=[],maxPos=0,dir="LR",clear3=__name(()=>{branchPos.clear(),commitPos.clear(),allCommitsDict.clear(),maxPos=0,lanes=[],dir="LR"},"clear"),drawText=__name(txt=>{const svgLabel=document.createElementNS("http://www.w3.org/2000/svg","text");return("string"==typeof txt?txt.split(/\\n|\n|<br\s*\/?>/gi):txt).forEach(row=>{const tspan=document.createElementNS("http://www.w3.org/2000/svg","tspan");tspan.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve"),tspan.setAttribute("dy","1em"),tspan.setAttribute("x","0"),tspan.setAttribute("class","row"),tspan.textContent=row.trim(),svgLabel.appendChild(tspan)}),svgLabel},"drawText"),findClosestParent=__name(parents=>{let closestParent,comparisonFunc,targetPosition;return"BT"===dir?(comparisonFunc=__name((a,b)=>a<=b,"comparisonFunc"),targetPosition=1/0):(comparisonFunc=__name((a,b)=>a>=b,"comparisonFunc"),targetPosition=0),parents.forEach(parent=>{var _a,_b;const parentPosition="TB"===dir||"BT"==dir?null==(_a=commitPos.get(parent))?void 0:_a.y:null==(_b=commitPos.get(parent))?void 0:_b.x;void 0!==parentPosition&&comparisonFunc(parentPosition,targetPosition)&&(closestParent=parent,targetPosition=parentPosition)}),closestParent},"findClosestParent"),findClosestParentBT=__name(parents=>{let closestParent="",maxPosition=1/0;return parents.forEach(parent=>{const parentPosition=commitPos.get(parent).y;parentPosition<=maxPosition&&(closestParent=parent,maxPosition=parentPosition)}),closestParent||void 0},"findClosestParentBT"),setParallelBTPos=__name((sortedKeys,commits,defaultPos2)=>{let curPos=defaultPos2,maxPosition=defaultPos2;const roots=[];sortedKeys.forEach(key=>{const commit2=commits.get(key);if(!commit2)throw new Error(`Commit not found for key ${key}`);commit2.parents.length?(curPos=calculateCommitPosition(commit2),maxPosition=Math.max(curPos,maxPosition)):roots.push(commit2),setCommitPosition(commit2,curPos)}),curPos=maxPosition,roots.forEach(commit2=>{setRootPosition(commit2,curPos,defaultPos2)}),sortedKeys.forEach(key=>{const commit2=commits.get(key);if(null==commit2?void 0:commit2.parents.length){const closestParent=findClosestParentBT(commit2.parents);curPos=commitPos.get(closestParent).y-40,curPos<=maxPosition&&(maxPosition=curPos);const x=branchPos.get(commit2.branch).pos,y=curPos-10;commitPos.set(commit2.id,{x:x,y:y})}})},"setParallelBTPos"),findClosestParentPos=__name(commit2=>{var _a;const closestParent=findClosestParent(commit2.parents.filter(p=>null!==p));if(!closestParent)throw new Error(`Closest parent not found for commit ${commit2.id}`);const closestParentPos=null==(_a=commitPos.get(closestParent))?void 0:_a.y;if(void 0===closestParentPos)throw new Error(`Closest parent position not found for commit ${commit2.id}`);return closestParentPos},"findClosestParentPos"),calculateCommitPosition=__name(commit2=>findClosestParentPos(commit2)+40,"calculateCommitPosition"),setCommitPosition=__name((commit2,curPos)=>{const branch2=branchPos.get(commit2.branch);if(!branch2)throw new Error(`Branch not found for commit ${commit2.id}`);const x=branch2.pos,y=curPos+10;return commitPos.set(commit2.id,{x:x,y:y}),{x:x,y:y}},"setCommitPosition"),setRootPosition=__name((commit2,curPos,defaultPos2)=>{const branch2=branchPos.get(commit2.branch);if(!branch2)throw new Error(`Branch not found for commit ${commit2.id}`);const y=curPos+defaultPos2,x=branch2.pos;commitPos.set(commit2.id,{x:x,y:y})},"setRootPosition"),drawCommitBullet=__name((gBullets,commit2,commitPosition,typeClass,branchIndex,commitSymbolType)=>{const{theme:theme}=getConfig2(),useReduxGeometry=REDUX_GEOMETRY_THEMES.has(theme??""),useColorTheme=COLOR_THEMES.has(theme??""),isDark=DARK_THEMES.has(theme??"");if(commitSymbolType===commitType.HIGHLIGHT)gBullets.append("rect").attr("x",commitPosition.x-10+(useReduxGeometry?3:0)).attr("y",commitPosition.y-10+(useReduxGeometry?3:0)).attr("width",useReduxGeometry?14:20).attr("height",useReduxGeometry?14:20).attr("class",`commit ${commit2.id} commit-highlight${calcColorIndex(branchIndex,8,useColorTheme)} ${typeClass}-outer`),gBullets.append("rect").attr("x",commitPosition.x-6+(useReduxGeometry?2:0)).attr("y",commitPosition.y-6+(useReduxGeometry?2:0)).attr("width",useReduxGeometry?8:12).attr("height",useReduxGeometry?8:12).attr("class",`commit ${commit2.id} commit${calcColorIndex(branchIndex,8,useColorTheme)} ${typeClass}-inner`);else if(commitSymbolType===commitType.CHERRY_PICK)gBullets.append("circle").attr("cx",commitPosition.x).attr("cy",commitPosition.y).attr("r",useReduxGeometry?7:10).attr("class",`commit ${commit2.id} ${typeClass}`),gBullets.append("circle").attr("cx",commitPosition.x-3).attr("cy",commitPosition.y+2).attr("r",useReduxGeometry?2.5:2.75).attr("fill",isDark?"#000000":"#fff").attr("class",`commit ${commit2.id} ${typeClass}`),gBullets.append("circle").attr("cx",commitPosition.x+3).attr("cy",commitPosition.y+2).attr("r",useReduxGeometry?2.5:2.75).attr("fill",isDark?"#000000":"#fff").attr("class",`commit ${commit2.id} ${typeClass}`),gBullets.append("line").attr("x1",commitPosition.x+3).attr("y1",commitPosition.y+1).attr("x2",commitPosition.x).attr("y2",commitPosition.y-5).attr("stroke",isDark?"#000000":"#fff").attr("class",`commit ${commit2.id} ${typeClass}`),gBullets.append("line").attr("x1",commitPosition.x-3).attr("y1",commitPosition.y+1).attr("x2",commitPosition.x).attr("y2",commitPosition.y-5).attr("stroke",isDark?"#000000":"#fff").attr("class",`commit ${commit2.id} ${typeClass}`);else{const circle=gBullets.append("circle");if(circle.attr("cx",commitPosition.x),circle.attr("cy",commitPosition.y),circle.attr("r",useReduxGeometry?7:10),circle.attr("class",`commit ${commit2.id} commit${calcColorIndex(branchIndex,8,useColorTheme)}`),commitSymbolType===commitType.MERGE){const circle2=gBullets.append("circle");circle2.attr("cx",commitPosition.x),circle2.attr("cy",commitPosition.y),circle2.attr("r",useReduxGeometry?5:6),circle2.attr("class",`commit ${typeClass} ${commit2.id} commit${calcColorIndex(branchIndex,8,useColorTheme)}`)}if(commitSymbolType===commitType.REVERSE){const constValue=useReduxGeometry?4:5;gBullets.append("path").attr("d",`M ${commitPosition.x-constValue},${commitPosition.y-constValue}L${commitPosition.x+constValue},${commitPosition.y+constValue}M${commitPosition.x-constValue},${commitPosition.y+constValue}L${commitPosition.x+constValue},${commitPosition.y-constValue}`).attr("class",`commit ${typeClass} ${commit2.id} commit${calcColorIndex(branchIndex,8,useColorTheme)}`)}}},"drawCommitBullet"),drawCommitLabel=__name((gLabels,commit2,commitPosition,pos,gitGraphConfig)=>{var _a;if(commit2.type!==commitType.CHERRY_PICK&&(commit2.customId&&commit2.type===commitType.MERGE||commit2.type!==commitType.MERGE)&&gitGraphConfig.showCommitLabel){const wrapper=gLabels.append("g"),labelBkg=wrapper.insert("rect").attr("class","commit-label-bkg"),text=wrapper.append("text").attr("x",pos).attr("y",commitPosition.y+25).attr("class","commit-label").text(commit2.id),bbox=null==(_a=text.node())?void 0:_a.getBBox();if(bbox&&(labelBkg.attr("x",commitPosition.posWithOffset-bbox.width/2-2).attr("y",commitPosition.y+13.5).attr("width",bbox.width+4).attr("height",bbox.height+4),"TB"===dir||"BT"===dir?(labelBkg.attr("x",commitPosition.x-(bbox.width+16+5)).attr("y",commitPosition.y-12),text.attr("x",commitPosition.x-(bbox.width+16)).attr("y",commitPosition.y+bbox.height-12)):text.attr("x",commitPosition.posWithOffset-bbox.width/2),gitGraphConfig.rotateCommitLabel))if("TB"===dir||"BT"===dir)text.attr("transform","rotate(-45, "+commitPosition.x+", "+commitPosition.y+")"),labelBkg.attr("transform","rotate(-45, "+commitPosition.x+", "+commitPosition.y+")");else{const r_x=-7.5-(bbox.width+10)/25*9.5,r_y=10+bbox.width/25*8.5;wrapper.attr("transform","translate("+r_x+", "+r_y+") rotate(-45, "+pos+", "+commitPosition.y+")")}}},"drawCommitLabel"),drawCommitTags=__name((gLabels,commit2,commitPosition,pos)=>{var _a;if(commit2.tags.length>0){let yOffset=0,maxTagBboxWidth=0,maxTagBboxHeight=0;const tagElements=[];for(const tagValue of commit2.tags.reverse()){const rect=gLabels.insert("polygon"),hole=gLabels.append("circle"),tag=gLabels.append("text").attr("y",commitPosition.y-16-yOffset).attr("class","tag-label").text(tagValue),tagBbox=null==(_a=tag.node())?void 0:_a.getBBox();if(!tagBbox)throw new Error("Tag bbox not found");maxTagBboxWidth=Math.max(maxTagBboxWidth,tagBbox.width),maxTagBboxHeight=Math.max(maxTagBboxHeight,tagBbox.height),tag.attr("x",commitPosition.posWithOffset-tagBbox.width/2),tagElements.push({tag:tag,hole:hole,rect:rect,yOffset:yOffset}),yOffset+=20}for(const{tag:tag,hole:hole,rect:rect,yOffset:yOffset2}of tagElements){const h2=maxTagBboxHeight/2,ly=commitPosition.y-19.2-yOffset2;if(rect.attr("class","tag-label-bkg").attr("points",`\n ${pos-maxTagBboxWidth/2-2},${ly+2} \n ${pos-maxTagBboxWidth/2-2},${ly-2}\n ${commitPosition.posWithOffset-maxTagBboxWidth/2-4},${ly-h2-2}\n ${commitPosition.posWithOffset+maxTagBboxWidth/2+4},${ly-h2-2}\n ${commitPosition.posWithOffset+maxTagBboxWidth/2+4},${ly+h2+2}\n ${commitPosition.posWithOffset-maxTagBboxWidth/2-4},${ly+h2+2}`),hole.attr("cy",ly).attr("cx",pos-maxTagBboxWidth/2+2).attr("r",1.5).attr("class","tag-hole"),"TB"===dir||"BT"===dir){const yOrigin=pos+yOffset2;rect.attr("class","tag-label-bkg").attr("points",`\n ${commitPosition.x},${yOrigin+2}\n ${commitPosition.x},${yOrigin-2}\n ${commitPosition.x+10},${yOrigin-h2-2}\n ${commitPosition.x+10+maxTagBboxWidth+4},${yOrigin-h2-2}\n ${commitPosition.x+10+maxTagBboxWidth+4},${yOrigin+h2+2}\n ${commitPosition.x+10},${yOrigin+h2+2}`).attr("transform","translate(12,12) rotate(45, "+commitPosition.x+","+pos+")"),hole.attr("cx",commitPosition.x+2).attr("cy",yOrigin).attr("transform","translate(12,12) rotate(45, "+commitPosition.x+","+pos+")"),tag.attr("x",commitPosition.x+5).attr("y",yOrigin+3).attr("transform","translate(14,14) rotate(45, "+commitPosition.x+","+pos+")")}}}},"drawCommitTags"),getCommitClassType=__name(commit2=>{switch(commit2.customType??commit2.type){case commitType.NORMAL:return"commit-normal";case commitType.REVERSE:return"commit-reverse";case commitType.HIGHLIGHT:return"commit-highlight";case commitType.MERGE:return"commit-merge";case commitType.CHERRY_PICK:return"commit-cherry-pick";default:return"commit-normal"}},"getCommitClassType"),calculatePosition=__name((commit2,dir2,pos,commitPos2)=>{const defaultCommitPosition={x:0,y:0};if(!(commit2.parents.length>0)){if("TB"===dir2)return 30;if("BT"===dir2){return(commitPos2.get(commit2.id)??defaultCommitPosition).y-40}return 0}{const closestParent=findClosestParent(commit2.parents);if(closestParent){const parentPosition=commitPos2.get(closestParent)??defaultCommitPosition;if("TB"===dir2)return parentPosition.y+40;if("BT"===dir2){return(commitPos2.get(commit2.id)??defaultCommitPosition).y-40}return parentPosition.x+40}}return 0},"calculatePosition"),getCommitPosition=__name((commit2,pos,isParallelCommits)=>{var _a,_b;const posWithOffset="BT"===dir&&isParallelCommits?pos:pos+10,branchY=null==(_a=branchPos.get(commit2.branch))?void 0:_a.pos,x="TB"===dir||"BT"===dir?null==(_b=branchPos.get(commit2.branch))?void 0:_b.pos:posWithOffset;if(void 0===x||void 0===branchY)throw new Error(`Position were undefined for commit ${commit2.id}`);const useReduxGeometry=REDUX_GEOMETRY_THEMES.has(getConfig2().theme??"");return{x:x,y:"TB"===dir||"BT"===dir?posWithOffset:branchY+(useReduxGeometry?7:-2),posWithOffset:posWithOffset}},"getCommitPosition"),drawCommits=__name((svg,commits,modifyGraph,gitGraphConfig)=>{const gBullets=svg.append("g").attr("class","commit-bullets"),gLabels=svg.append("g").attr("class","commit-labels");let pos="TB"===dir||"BT"===dir?30:0;const keys=[...commits.keys()],isParallelCommits=gitGraphConfig.parallelCommits??!1,sortKeys=__name((a,b)=>{var _a,_b;const seqA=null==(_a=commits.get(a))?void 0:_a.seq,seqB=null==(_b=commits.get(b))?void 0:_b.seq;return void 0!==seqA&&void 0!==seqB?seqA-seqB:0},"sortKeys");let sortedKeys=keys.sort(sortKeys);"BT"===dir&&(isParallelCommits&&setParallelBTPos(sortedKeys,commits,pos),sortedKeys=sortedKeys.reverse()),sortedKeys.forEach(key=>{var _a;const commit2=commits.get(key);if(!commit2)throw new Error(`Commit not found for key ${key}`);isParallelCommits&&(pos=calculatePosition(commit2,dir,pos,commitPos));const commitPosition=getCommitPosition(commit2,pos,isParallelCommits);if(modifyGraph){const typeClass=getCommitClassType(commit2),commitSymbolType=commit2.customType??commit2.type,branchIndex=(null==(_a=branchPos.get(commit2.branch))?void 0:_a.index)??0;drawCommitBullet(gBullets,commit2,commitPosition,typeClass,branchIndex,commitSymbolType),drawCommitLabel(gLabels,commit2,commitPosition,pos,gitGraphConfig),drawCommitTags(gLabels,commit2,commitPosition,pos)}"TB"===dir||"BT"===dir?commitPos.set(commit2.id,{x:commitPosition.x,y:commitPosition.posWithOffset}):commitPos.set(commit2.id,{x:commitPosition.posWithOffset,y:commitPosition.y}),pos="BT"===dir&&isParallelCommits?pos+40:pos+40+10,pos>maxPos&&(maxPos=pos)})},"drawCommits"),shouldRerouteArrow=__name((commitA,commitB,p1,p2,allCommits)=>{const branchToGetCurve=("TB"===dir||"BT"===dir?p1.x<p2.x:p1.y<p2.y)?commitB.branch:commitA.branch,isOnBranchToGetCurve=__name(x=>x.branch===branchToGetCurve,"isOnBranchToGetCurve"),isBetweenCommits=__name(x=>x.seq>commitA.seq&&x.seq<commitB.seq,"isBetweenCommits");return[...allCommits.values()].some(commitX=>isBetweenCommits(commitX)&&isOnBranchToGetCurve(commitX))},"shouldRerouteArrow"),findLane=__name((y1,y2,depth=0)=>{const candidate=y1+Math.abs(y1-y2)/2;if(depth>5)return candidate;if(lanes.every(lane=>Math.abs(lane-candidate)>=10))return lanes.push(candidate),candidate;const diff=Math.abs(y1-y2);return findLane(y1,y2-diff/5,depth+1)},"findLane"),drawArrow=__name((svg,commitA,commitB,allCommits)=>{var _a,_b,_c,_d,_e;const{theme:arrowTheme}=getConfig2(),useColorTheme=COLOR_THEMES.has(arrowTheme??""),p1=commitPos.get(commitA.id),p2=commitPos.get(commitB.id);if(void 0===p1||void 0===p2)throw new Error(`Commit positions not found for commits ${commitA.id} and ${commitB.id}`);const arrowNeedsRerouting=shouldRerouteArrow(commitA,commitB,p1,p2,allCommits);let lineDef,arc="",arc2="",radius=0,offset=0,colorClassNum=null==(_a=branchPos.get(commitB.branch))?void 0:_a.index;if(commitB.type===commitType.MERGE&&commitA.id!==commitB.parents[0]&&(colorClassNum=null==(_b=branchPos.get(commitA.branch))?void 0:_b.index),arrowNeedsRerouting){arc="A 10 10, 0, 0, 0,",arc2="A 10 10, 0, 0, 1,",radius=10,offset=10;const lineY=p1.y<p2.y?findLane(p1.y,p2.y):findLane(p2.y,p1.y),lineX=p1.x<p2.x?findLane(p1.x,p2.x):findLane(p2.x,p1.x);"TB"===dir?p1.x<p2.x?lineDef=`M ${p1.x} ${p1.y} L ${lineX-radius} ${p1.y} ${arc2} ${lineX} ${p1.y+offset} L ${lineX} ${p2.y-radius} ${arc} ${lineX+offset} ${p2.y} L ${p2.x} ${p2.y}`:(colorClassNum=null==(_c=branchPos.get(commitA.branch))?void 0:_c.index,lineDef=`M ${p1.x} ${p1.y} L ${lineX+radius} ${p1.y} ${arc} ${lineX} ${p1.y+offset} L ${lineX} ${p2.y-radius} ${arc2} ${lineX-offset} ${p2.y} L ${p2.x} ${p2.y}`):"BT"===dir?p1.x<p2.x?lineDef=`M ${p1.x} ${p1.y} L ${lineX-radius} ${p1.y} ${arc} ${lineX} ${p1.y-offset} L ${lineX} ${p2.y+radius} ${arc2} ${lineX+offset} ${p2.y} L ${p2.x} ${p2.y}`:(colorClassNum=null==(_d=branchPos.get(commitA.branch))?void 0:_d.index,lineDef=`M ${p1.x} ${p1.y} L ${lineX+radius} ${p1.y} ${arc2} ${lineX} ${p1.y-offset} L ${lineX} ${p2.y+radius} ${arc} ${lineX-offset} ${p2.y} L ${p2.x} ${p2.y}`):p1.y<p2.y?lineDef=`M ${p1.x} ${p1.y} L ${p1.x} ${lineY-radius} ${arc} ${p1.x+offset} ${lineY} L ${p2.x-radius} ${lineY} ${arc2} ${p2.x} ${lineY+offset} L ${p2.x} ${p2.y}`:(colorClassNum=null==(_e=branchPos.get(commitA.branch))?void 0:_e.index,lineDef=`M ${p1.x} ${p1.y} L ${p1.x} ${lineY+radius} ${arc2} ${p1.x+offset} ${lineY} L ${p2.x-radius} ${lineY} ${arc} ${p2.x} ${lineY-offset} L ${p2.x} ${p2.y}`)}else arc="A 20 20, 0, 0, 0,",arc2="A 20 20, 0, 0, 1,",radius=20,offset=20,"TB"===dir?(p1.x<p2.x&&(lineDef=commitB.type===commitType.MERGE&&commitA.id!==commitB.parents[0]?`M ${p1.x} ${p1.y} L ${p1.x} ${p2.y-radius} ${arc} ${p1.x+offset} ${p2.y} L ${p2.x} ${p2.y}`:`M ${p1.x} ${p1.y} L ${p2.x-radius} ${p1.y} ${arc2} ${p2.x} ${p1.y+offset} L ${p2.x} ${p2.y}`),p1.x>p2.x&&(arc="A 20 20, 0, 0, 0,",arc2="A 20 20, 0, 0, 1,",radius=20,offset=20,lineDef=commitB.type===commitType.MERGE&&commitA.id!==commitB.parents[0]?`M ${p1.x} ${p1.y} L ${p1.x} ${p2.y-radius} ${arc2} ${p1.x-offset} ${p2.y} L ${p2.x} ${p2.y}`:`M ${p1.x} ${p1.y} L ${p2.x+radius} ${p1.y} ${arc} ${p2.x} ${p1.y+offset} L ${p2.x} ${p2.y}`),p1.x===p2.x&&(lineDef=`M ${p1.x} ${p1.y} L ${p2.x} ${p2.y}`)):"BT"===dir?(p1.x<p2.x&&(lineDef=commitB.type===commitType.MERGE&&commitA.id!==commitB.parents[0]?`M ${p1.x} ${p1.y} L ${p1.x} ${p2.y+radius} ${arc2} ${p1.x+offset} ${p2.y} L ${p2.x} ${p2.y}`:`M ${p1.x} ${p1.y} L ${p2.x-radius} ${p1.y} ${arc} ${p2.x} ${p1.y-offset} L ${p2.x} ${p2.y}`),p1.x>p2.x&&(arc="A 20 20, 0, 0, 0,",arc2="A 20 20, 0, 0, 1,",radius=20,offset=20,lineDef=commitB.type===commitType.MERGE&&commitA.id!==commitB.parents[0]?`M ${p1.x} ${p1.y} L ${p1.x} ${p2.y+radius} ${arc} ${p1.x-offset} ${p2.y} L ${p2.x} ${p2.y}`:`M ${p1.x} ${p1.y} L ${p2.x+radius} ${p1.y} ${arc2} ${p2.x} ${p1.y-offset} L ${p2.x} ${p2.y}`),p1.x===p2.x&&(lineDef=`M ${p1.x} ${p1.y} L ${p2.x} ${p2.y}`)):(p1.y<p2.y&&(lineDef=commitB.type===commitType.MERGE&&commitA.id!==commitB.parents[0]?`M ${p1.x} ${p1.y} L ${p2.x-radius} ${p1.y} ${arc2} ${p2.x} ${p1.y+offset} L ${p2.x} ${p2.y}`:`M ${p1.x} ${p1.y} L ${p1.x} ${p2.y-radius} ${arc} ${p1.x+offset} ${p2.y} L ${p2.x} ${p2.y}`),p1.y>p2.y&&(lineDef=commitB.type===commitType.MERGE&&commitA.id!==commitB.parents[0]?`M ${p1.x} ${p1.y} L ${p2.x-radius} ${p1.y} ${arc} ${p2.x} ${p1.y-offset} L ${p2.x} ${p2.y}`:`M ${p1.x} ${p1.y} L ${p1.x} ${p2.y+radius} ${arc2} ${p1.x+offset} ${p2.y} L ${p2.x} ${p2.y}`),p1.y===p2.y&&(lineDef=`M ${p1.x} ${p1.y} L ${p2.x} ${p2.y}`));if(void 0===lineDef)throw new Error("Line definition not found");svg.append("path").attr("d",lineDef).attr("class","arrow arrow"+calcColorIndex(colorClassNum,8,useColorTheme))},"drawArrow"),drawArrows=__name((svg,commits)=>{const gArrows=svg.append("g").attr("class","commit-arrows");[...commits.keys()].forEach(key=>{const commit2=commits.get(key);commit2.parents&&commit2.parents.length>0&&commit2.parents.forEach(parent=>{drawArrow(gArrows,commits.get(parent),commit2,commits)})})},"drawArrows"),drawBranches=__name((svg,branches,gitGraphConfig,id)=>{const{look:look,theme:theme,themeVariables:themeVariables}=getConfig2(),{dropShadow:dropShadow,THEME_COLOR_LIMIT:themeColorLimit}=themeVariables,useReduxGeometry=REDUX_GEOMETRY_THEMES.has(theme??""),useColorTheme=COLOR_THEMES.has(theme??""),g=svg.append("g");branches.forEach((branch2,index)=>{var _a;const adjustIndexForTheme=calcColorIndex(index,useReduxGeometry?themeColorLimit:8,useColorTheme),pos=null==(_a=branchPos.get(branch2.name))?void 0:_a.pos;if(void 0===pos)throw new Error(`Position not found for branch ${branch2.name}`);const spineY="TB"===dir||"BT"===dir?pos:useReduxGeometry?pos+6+1:pos-2,line=g.append("line");line.attr("x1",0),line.attr("y1",spineY),line.attr("x2",maxPos),line.attr("y2",spineY),line.attr("class","branch branch"+adjustIndexForTheme),"TB"===dir?(line.attr("y1",30),line.attr("x1",pos),line.attr("y2",maxPos),line.attr("x2",pos)):"BT"===dir&&(line.attr("y1",maxPos),line.attr("x1",pos),line.attr("y2",30),line.attr("x2",pos)),lanes.push(spineY);const name=branch2.name,labelElement=drawText(name),bkg=g.insert("rect"),label=g.insert("g").attr("class","branchLabel").insert("g").attr("class","label branch-label"+adjustIndexForTheme);label.node().appendChild(labelElement);const bbox=labelElement.getBBox(),borderRadius=useReduxGeometry?0:4,labelPaddingX=useReduxGeometry?16:0,labelPaddingY=useReduxGeometry?12:0;"neo"===look&&bkg.attr("data-look","neo"),bkg.attr("class","branchLabelBkg label"+adjustIndexForTheme).attr("style","neo"===look?`filter:${useReduxGeometry?`url(#${id}-drop-shadow)`:dropShadow}`:"").attr("rx",borderRadius).attr("ry",borderRadius).attr("x",-bbox.width-4-(!0===gitGraphConfig.rotateCommitLabel?30:0)).attr("y",-bbox.height/2+10).attr("width",bbox.width+18+labelPaddingX).attr("height",bbox.height+4+labelPaddingY),label.attr("transform","translate("+(-bbox.width-14-(!0===gitGraphConfig.rotateCommitLabel?30:0)+labelPaddingX/2)+", "+(spineY-bbox.height/2-2)+")"),"TB"===dir?(bkg.attr("x",pos-bbox.width/2-10).attr("y",0),label.attr("transform","translate("+(pos-bbox.width/2-5)+", 0)"),useReduxGeometry&&(bkg.attr("transform",`translate(${-labelPaddingX/2-3}, ${-labelPaddingY-10})`),label.attr("transform","translate("+(pos-bbox.width/2-5)+", "+(2*-labelPaddingY+7)+")"))):"BT"===dir?(bkg.attr("x",pos-bbox.width/2-10).attr("y",maxPos),label.attr("transform","translate("+(pos-bbox.width/2-5)+", "+maxPos+")"),useReduxGeometry&&(bkg.attr("transform",`translate(${-labelPaddingX/2-3}, ${labelPaddingY+10})`),label.attr("transform","translate("+(pos-bbox.width/2-5)+", "+(maxPos+2*labelPaddingY+4)+")"))):bkg.attr("transform","translate(-19, "+(spineY-12-labelPaddingY/2)+")")})},"drawBranches"),setBranchPosition=__name(function(name,pos,index,bbox,rotateCommitLabel){return branchPos.set(name,{pos:pos,index:index}),pos+=50+(rotateCommitLabel?40:0)+("TB"===dir||"BT"===dir?bbox.width/2:0)},"setBranchPosition"),gitGraphRenderer_default={draw:__name(function(txt,id,ver,diagObj){clear3(),log.debug("in gitgraph renderer",txt+"\n","id:",id,ver);const db2=diagObj.db;if(!db2.getConfig)return void log.error("getConfig method is not available on db");const gitGraphConfig=db2.getConfig(),rotateCommitLabel=gitGraphConfig.rotateCommitLabel??!1;allCommitsDict=db2.getCommits();const branches=db2.getBranchesAsObjArray();dir=db2.getDirection();const diagram2=select(`[id="${id}"]`),{look:look,theme:theme,themeVariables:themeVariables}=getConfig2(),{useGradient:useGradient,gradientStart:gradientStart,gradientStop:gradientStop,filterColor:filterColor}=themeVariables;if(useGradient){const gradient=diagram2.append("defs").append("linearGradient").attr("id",id+"-gradient").attr("gradientUnits","objectBoundingBox").attr("x1","0%").attr("y1","0%").attr("x2","100%").attr("y2","0%");gradient.append("stop").attr("offset","0%").attr("stop-color",gradientStart).attr("stop-opacity",1),gradient.append("stop").attr("offset","100%").attr("stop-color",gradientStop).attr("stop-opacity",1)}"neo"===look&&REDUX_GEOMETRY_THEMES.has(theme??"")&&diagram2.append("defs").append("filter").attr("id",id+"-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",filterColor);let pos=0;branches.forEach((branch2,index)=>{var _a;const labelElement=drawText(branch2.name),g=diagram2.append("g"),branchLabel=g.insert("g").attr("class","branchLabel"),label=branchLabel.insert("g").attr("class","label branch-label");null==(_a=label.node())||_a.appendChild(labelElement);const bbox=labelElement.getBBox();pos=setBranchPosition(branch2.name,pos,index,bbox,rotateCommitLabel),label.remove(),branchLabel.remove(),g.remove()}),drawCommits(diagram2,allCommitsDict,!1,gitGraphConfig),gitGraphConfig.showBranches&&drawBranches(diagram2,branches,gitGraphConfig,id),drawArrows(diagram2,allCommitsDict),drawCommits(diagram2,allCommitsDict,!0,gitGraphConfig),utils_default.insertTitle(diagram2,"gitTitleText",gitGraphConfig.titleTopMargin??0,db2.getDiagramTitle()),setupGraphViewbox2(void 0,diagram2,gitGraphConfig.diagramPadding,gitGraphConfig.useMaxWidth)},"draw")},REDUX_GEOMETRY_THEMES2=new Set(["redux","redux-dark","redux-color","redux-dark-color"]),COLOR_THEMES2=new Set(["redux-color","redux-dark-color"]),NEO_THEMES=new Set(["neo","neo-dark"]),DARK_THEMES2=new Set(["dark","redux-dark","redux-dark-color","neo-dark"]),NEO_COLOR_GEN_THEMES=new Set(["redux","redux-dark","redux-color","redux-dark-color","neo","neo-dark"]),genGitGraphGradient=__name(options=>{const{svgId:svgId}=options;let sections="";if(options.useGradient&&svgId)for(let i=0;i<options.THEME_COLOR_LIMIT;i++)sections+=`\n .label${i} { fill: ${options.mainBkg}; stroke: url(${svgId}-gradient); stroke-width: ${options.strokeWidth};}\n `;return sections},"genGitGraphGradient"),genColor=__name(options=>{const config=getConfig(),{theme:theme,themeVariables:themeVariables}=config,{borderColorArray:borderColorArray}=themeVariables,useReduxGeometry=REDUX_GEOMETRY_THEMES2.has(theme);if(NEO_THEMES.has(theme)){let sections="";for(let i=0;i<options.THEME_COLOR_LIMIT;i++)if(0===i)sections+=`\n .branch-label${i} { fill: ${options.nodeBorder};}\n .commit${i} { stroke: ${options.nodeBorder}; }\n .commit-highlight${i} { stroke: ${options.nodeBorder}; fill: ${options.nodeBorder}; }\n .arrow${i} { stroke: ${options.nodeBorder}; }\n .commit-bullets { fill: ${options.nodeBorder}; }\n .commit-cherry-pick${i} { stroke: ${options.nodeBorder}; }\n ${genGitGraphGradient(options)}`;else{const ci=i%8;sections+=`\n .branch-label${i} { fill: ${options["gitBranchLabel"+ci]}; }\n .commit${i} { stroke: ${options["git"+ci]}; fill: ${options["git"+ci]}; }\n .commit-highlight${i} { stroke: ${options["gitInv"+ci]}; fill: ${options["gitInv"+ci]}; }\n .arrow${i} { stroke: ${options["git"+ci]}; }\n `}return sections}if(COLOR_THEMES2.has(theme)){let sections="";for(let i=0;i<options.THEME_COLOR_LIMIT;i++)if(0===i)sections+=`\n .branch-label${i} { fill: ${options.nodeBorder}; ${useReduxGeometry?`font-weight:${options.noteFontWeight}`:""} }\n .commit${i} { stroke: ${options.nodeBorder}; }\n .commit-highlight${i} { stroke: ${options.nodeBorder}; fill: ${options.mainBkg}; }\n .label${i} { fill: ${options.mainBkg}; stroke: ${options.nodeBorder}; stroke-width: ${options.strokeWidth}; ${useReduxGeometry?`font-weight:${options.noteFontWeight}`:""} }\n .arrow${i} { stroke: ${options.nodeBorder}; }\n .commit-bullets { fill: ${options.nodeBorder}; }\n `;else{const colorIndex=i%borderColorArray.length;sections+=`\n .branch-label${i} { fill: ${options.nodeBorder}; ${useReduxGeometry?`font-weight:${options.noteFontWeight}`:""} }\n .commit${i} { stroke: ${borderColorArray[colorIndex]}; fill: ${borderColorArray[colorIndex]}; }\n .commit-highlight${i} { stroke: ${borderColorArray[colorIndex]}; fill: ${borderColorArray[colorIndex]}; }\n .label${i} { fill: ${DARK_THEMES2.has(theme)?options.mainBkg:borderColorArray[colorIndex]}; stroke: ${borderColorArray[colorIndex]}; stroke-width: ${options.strokeWidth}; }\n .arrow${i} { stroke: ${borderColorArray[colorIndex]}; }\n `}return sections}{let sections="";for(let i=0;i<options.THEME_COLOR_LIMIT;i++)sections+=`\n .branch-label${i} { fill: ${options.nodeBorder}; ${useReduxGeometry?`font-weight:${options.noteFontWeight}`:""} }\n .commit${i} { stroke: ${options.nodeBorder}; }\n .commit-highlight${i} { stroke: ${options.nodeBorder}; fill: ${options.nodeBorder}; }\n .label${i} { fill: ${options.mainBkg}; stroke: ${options.nodeBorder}; stroke-width: ${options.strokeWidth}; ${useReduxGeometry?`font-weight:${options.noteFontWeight}`:""}}\n .arrow${i} { stroke: ${options.nodeBorder}; }\n .commit-bullets { fill: ${options.nodeBorder}; }\n .commit-cherry-pick${i} { stroke: ${options.nodeBorder}; }\n `;return sections}},"genColor"),normalTheme=__name(options=>`${Array.from({length:options.THEME_COLOR_LIMIT},(_,i)=>i).map(i=>{const ci=i%8;return`\n .branch-label${i} { fill: ${options["gitBranchLabel"+ci]}; }\n .commit${i} { stroke: ${options["git"+ci]}; fill: ${options["git"+ci]}; }\n .commit-highlight${i} { stroke: ${options["gitInv"+ci]}; fill: ${options["gitInv"+ci]}; }\n .label${i} { fill: ${options["git"+ci]}; }\n .arrow${i} { stroke: ${options["git"+ci]}; }\n `}).join("\n")}`,"normalTheme"),diagram={parser:parser,db:db,renderer:gitGraphRenderer_default,styles:__name(options=>{const config=getConfig(),{theme:theme}=config,useNeoColorGen=NEO_COLOR_GEN_THEMES.has(theme);return`\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 \n ${useNeoColorGen?genColor(options):normalTheme(options)}\n\n .branch {\n stroke-width: ${options.strokeWidth};\n stroke: ${options.commitLineColor??options.lineColor};\n stroke-dasharray: ${useNeoColorGen?"4 2":"2"};\n }\n .commit-label { font-size: ${options.commitLabelFontSize}; fill: ${useNeoColorGen?options.nodeBorder:options.commitLabelColor}; ${useNeoColorGen?`font-weight:${options.noteFontWeight};`:""}}\n .commit-label-bkg { font-size: ${options.commitLabelFontSize}; fill: ${useNeoColorGen?"transparent":options.commitLabelBackground}; opacity: ${useNeoColorGen?"":.5}; }\n .tag-label { font-size: ${options.tagLabelFontSize}; fill: ${options.tagLabelColor};}\n .tag-label-bkg { fill: ${useNeoColorGen?options.mainBkg:options.tagLabelBackground}; stroke: ${useNeoColorGen?options.nodeBorder:options.tagLabelBorder}; ${useNeoColorGen?`filter:${options.dropShadow}`:""} }\n .tag-hole { fill: ${options.textColor}; }\n\n .commit-merge {\n stroke: ${useNeoColorGen?options.mainBkg:options.primaryColor};\n fill: ${useNeoColorGen?options.mainBkg:options.primaryColor};\n }\n .commit-reverse {\n stroke: ${useNeoColorGen?options.mainBkg:options.primaryColor};\n fill: ${useNeoColorGen?options.mainBkg:options.primaryColor};\n stroke-width: ${useNeoColorGen?options.strokeWidth:3};\n }\n .commit-highlight-outer {\n }\n .commit-highlight-inner {\n stroke: ${useNeoColorGen?options.mainBkg:options.primaryColor};\n fill: ${useNeoColorGen?options.mainBkg:options.primaryColor};\n }\n\n .arrow {\n /* Intentional: neo themes keep the bold 8px arrow (like classic themes); only redux-geometry themes use the thinner options.strokeWidth. */\n stroke-width: ${REDUX_GEOMETRY_THEMES2.has(theme)?options.strokeWidth:8};\n stroke-linecap: round;\n fill: none\n }\n .gitTitleText {\n text-anchor: middle;\n font-size: 18px;\n fill: ${options.textColor};\n }\n`},"getStyles")};export{diagram};
@@ -1 +1 @@
1
- import{aQ as copyObject,aR as keysIn,aS as getPrototype,aT as cloneArrayBuffer,aU as Symbol$1,aV as cloneTypedArray,aW as isObjectLike,aX as getTag,aY as baseUnary,aZ as nodeUtil,a_ as isObject,a$ as copyArray,b0 as isBuffer,b1 as cloneBuffer,b2 as initCloneObject,b3 as Stack,aG as isArray,b4 as assignValue,b5 as baseRest,b6 as isArrayLikeObject,b7 as constant,b8 as isFunction,b9 as isEmpty}from"./mermaid.core-fx56L749.js";import{k as keys,g as getSymbols,s as stubArray,e as arrayPush,f as baseGetAllKeys,h as arrayEach,j as getAllKeys,d as arrayMap,l as baseUniq,b as baseFlatten,m as filter,n as forEach,r as reduce}from"./_baseUniq-Cnd-_Qe2.js";var getSymbolsIn=Object.getOwnPropertySymbols?function(object){for(var result=[];object;)arrayPush(result,getSymbols(object)),object=getPrototype(object);return result}:stubArray;function getAllKeysIn(object){return baseGetAllKeys(object,keysIn,getSymbolsIn)}var hasOwnProperty=Object.prototype.hasOwnProperty;var reFlags=/\w*$/;var symbolProto=Symbol$1?Symbol$1.prototype:void 0,symbolValueOf=symbolProto?symbolProto.valueOf:void 0;function initCloneByTag(object,tag,isDeep){var symbol,regexp,result,Ctor=object.constructor;switch(tag){case"[object ArrayBuffer]":return cloneArrayBuffer(object);case"[object Boolean]":case"[object Date]":return new Ctor(+object);case"[object DataView]":return function(dataView,isDeep){var buffer=isDeep?cloneArrayBuffer(dataView.buffer):dataView.buffer;return new dataView.constructor(buffer,dataView.byteOffset,dataView.byteLength)}(object,isDeep);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return cloneTypedArray(object,isDeep);case"[object Map]":case"[object Set]":return new Ctor;case"[object Number]":case"[object String]":return new Ctor(object);case"[object RegExp]":return(result=new(regexp=object).constructor(regexp.source,reFlags.exec(regexp))).lastIndex=regexp.lastIndex,result;case"[object Symbol]":return symbol=object,symbolValueOf?Object(symbolValueOf.call(symbol)):{}}}var nodeIsMap=nodeUtil&&nodeUtil.isMap,isMap=nodeIsMap?baseUnary(nodeIsMap):function(value){return isObjectLike(value)&&"[object Map]"==getTag(value)};var nodeIsSet=nodeUtil&&nodeUtil.isSet,isSet=nodeIsSet?baseUnary(nodeIsSet):function(value){return isObjectLike(value)&&"[object Set]"==getTag(value)},cloneableTags={};function baseClone(value,bitmask,customizer,key,object,stack){var result,isDeep=1&bitmask,isFlat=2&bitmask,isFull=4&bitmask;if(void 0!==result)return result;if(!isObject(value))return value;var isArr=isArray(value);if(isArr){if(result=function(array){var length=array.length,result=new array.constructor(length);return length&&"string"==typeof array[0]&&hasOwnProperty.call(array,"index")&&(result.index=array.index,result.input=array.input),result}(value),!isDeep)return copyArray(value,result)}else{var tag=getTag(value),isFunc="[object Function]"==tag||"[object GeneratorFunction]"==tag;if(isBuffer(value))return cloneBuffer(value,isDeep);if("[object Object]"==tag||"[object Arguments]"==tag||isFunc&&!object){if(result=isFlat||isFunc?{}:initCloneObject(value),!isDeep)return isFlat?function(source,object){return copyObject(source,getSymbolsIn(source),object)}(value,function(object,source){return object&&copyObject(source,keysIn(source),object)}(result,value)):function(source,object){return copyObject(source,getSymbols(source),object)}(value,function(object,source){return object&&copyObject(source,keys(source),object)}(result,value))}else{if(!cloneableTags[tag])return object?value:{};result=initCloneByTag(value,tag,isDeep)}}stack||(stack=new Stack);var stacked=stack.get(value);if(stacked)return stacked;stack.set(value,result),isSet(value)?value.forEach(function(subValue){result.add(baseClone(subValue,bitmask,customizer,subValue,value,stack))}):isMap(value)&&value.forEach(function(subValue,key2){result.set(key2,baseClone(subValue,bitmask,customizer,key2,value,stack))});var props=isArr?void 0:(isFull?isFlat?getAllKeysIn:getAllKeys:isFlat?keysIn:keys)(value);return arrayEach(props||value,function(subValue,key2){props&&(subValue=value[key2=subValue]),assignValue(result,key2,baseClone(subValue,bitmask,customizer,key2,value,stack))}),result}function values(object){return null==object?[]:function(object,props){return arrayMap(props,function(key){return object[key]})}(object,keys(object))}function isUndefined(value){return void 0===value}cloneableTags["[object Arguments]"]=cloneableTags["[object Array]"]=cloneableTags["[object ArrayBuffer]"]=cloneableTags["[object DataView]"]=cloneableTags["[object Boolean]"]=cloneableTags["[object Date]"]=cloneableTags["[object Float32Array]"]=cloneableTags["[object Float64Array]"]=cloneableTags["[object Int8Array]"]=cloneableTags["[object Int16Array]"]=cloneableTags["[object Int32Array]"]=cloneableTags["[object Map]"]=cloneableTags["[object Number]"]=cloneableTags["[object Object]"]=cloneableTags["[object RegExp]"]=cloneableTags["[object Set]"]=cloneableTags["[object String]"]=cloneableTags["[object Symbol]"]=cloneableTags["[object Uint8Array]"]=cloneableTags["[object Uint8ClampedArray]"]=cloneableTags["[object Uint16Array]"]=cloneableTags["[object Uint32Array]"]=!0,cloneableTags["[object Error]"]=cloneableTags["[object Function]"]=cloneableTags["[object WeakMap]"]=!1;var union=baseRest(function(arrays){return baseUniq(baseFlatten(arrays,1,isArrayLikeObject,!0))});class Graph{constructor(opts={}){this._isDirected=!Object.prototype.hasOwnProperty.call(opts,"directed")||opts.directed,this._isMultigraph=!!Object.prototype.hasOwnProperty.call(opts,"multigraph")&&opts.multigraph,this._isCompound=!!Object.prototype.hasOwnProperty.call(opts,"compound")&&opts.compound,this._label=void 0,this._defaultNodeLabelFn=constant(void 0),this._defaultEdgeLabelFn=constant(void 0),this._nodes={},this._isCompound&&(this._parent={},this._children={},this._children["\0"]={}),this._in={},this._preds={},this._out={},this._sucs={},this._edgeObjs={},this._edgeLabels={}}isDirected(){return this._isDirected}isMultigraph(){return this._isMultigraph}isCompound(){return this._isCompound}setGraph(label){return this._label=label,this}graph(){return this._label}setDefaultNodeLabel(newDefault){return isFunction(newDefault)||(newDefault=constant(newDefault)),this._defaultNodeLabelFn=newDefault,this}nodeCount(){return this._nodeCount}nodes(){return keys(this._nodes)}sources(){var self=this;return filter(this.nodes(),function(v){return isEmpty(self._in[v])})}sinks(){var self=this;return filter(this.nodes(),function(v){return isEmpty(self._out[v])})}setNodes(vs,value){var args=arguments,self=this;return forEach(vs,function(v){args.length>1?self.setNode(v,value):self.setNode(v)}),this}setNode(v,value){return Object.prototype.hasOwnProperty.call(this._nodes,v)?(arguments.length>1&&(this._nodes[v]=value),this):(this._nodes[v]=arguments.length>1?value:this._defaultNodeLabelFn(v),this._isCompound&&(this._parent[v]="\0",this._children[v]={},this._children["\0"][v]=!0),this._in[v]={},this._preds[v]={},this._out[v]={},this._sucs[v]={},++this._nodeCount,this)}node(v){return this._nodes[v]}hasNode(v){return Object.prototype.hasOwnProperty.call(this._nodes,v)}removeNode(v){if(Object.prototype.hasOwnProperty.call(this._nodes,v)){var removeEdge=e=>this.removeEdge(this._edgeObjs[e]);delete this._nodes[v],this._isCompound&&(this._removeFromParentsChildList(v),delete this._parent[v],forEach(this.children(v),child=>{this.setParent(child)}),delete this._children[v]),forEach(keys(this._in[v]),removeEdge),delete this._in[v],delete this._preds[v],forEach(keys(this._out[v]),removeEdge),delete this._out[v],delete this._sucs[v],--this._nodeCount}return this}setParent(v,parent){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(isUndefined(parent))parent="\0";else{for(var ancestor=parent+="";!isUndefined(ancestor);ancestor=this.parent(ancestor))if(ancestor===v)throw new Error("Setting "+parent+" as parent of "+v+" would create a cycle");this.setNode(parent)}return this.setNode(v),this._removeFromParentsChildList(v),this._parent[v]=parent,this._children[parent][v]=!0,this}_removeFromParentsChildList(v){delete this._children[this._parent[v]][v]}parent(v){if(this._isCompound){var parent=this._parent[v];if("\0"!==parent)return parent}}children(v){if(isUndefined(v)&&(v="\0"),this._isCompound){var children=this._children[v];if(children)return keys(children)}else{if("\0"===v)return this.nodes();if(this.hasNode(v))return[]}}predecessors(v){var predsV=this._preds[v];if(predsV)return keys(predsV)}successors(v){var sucsV=this._sucs[v];if(sucsV)return keys(sucsV)}neighbors(v){var preds=this.predecessors(v);if(preds)return union(preds,this.successors(v))}isLeaf(v){return 0===(this.isDirected()?this.successors(v):this.neighbors(v)).length}filterNodes(filter2){var copy=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});copy.setGraph(this.graph());var self=this;forEach(this._nodes,function(value,v){filter2(v)&&copy.setNode(v,value)}),forEach(this._edgeObjs,function(e){copy.hasNode(e.v)&&copy.hasNode(e.w)&&copy.setEdge(e,self.edge(e))});var parents={};function findParent(v){var parent=self.parent(v);return void 0===parent||copy.hasNode(parent)?(parents[v]=parent,parent):parent in parents?parents[parent]:findParent(parent)}return this._isCompound&&forEach(copy.nodes(),function(v){copy.setParent(v,findParent(v))}),copy}setDefaultEdgeLabel(newDefault){return isFunction(newDefault)||(newDefault=constant(newDefault)),this._defaultEdgeLabelFn=newDefault,this}edgeCount(){return this._edgeCount}edges(){return values(this._edgeObjs)}setPath(vs,value){var self=this,args=arguments;return reduce(vs,function(v,w){return args.length>1?self.setEdge(v,w,value):self.setEdge(v,w),w}),this}setEdge(){var v,w,name,value,valueSpecified=!1,arg0=arguments[0];"object"==typeof arg0&&null!==arg0&&"v"in arg0?(v=arg0.v,w=arg0.w,name=arg0.name,2===arguments.length&&(value=arguments[1],valueSpecified=!0)):(v=arg0,w=arguments[1],name=arguments[3],arguments.length>2&&(value=arguments[2],valueSpecified=!0)),v=""+v,w=""+w,isUndefined(name)||(name=""+name);var e=edgeArgsToId(this._isDirected,v,w,name);if(Object.prototype.hasOwnProperty.call(this._edgeLabels,e))return valueSpecified&&(this._edgeLabels[e]=value),this;if(!isUndefined(name)&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(v),this.setNode(w),this._edgeLabels[e]=valueSpecified?value:this._defaultEdgeLabelFn(v,w,name);var edgeObj=function(isDirected,v_,w_,name){var v=""+v_,w=""+w_;if(!isDirected&&v>w){var tmp=v;v=w,w=tmp}var edgeObj={v:v,w:w};name&&(edgeObj.name=name);return edgeObj}(this._isDirected,v,w,name);return v=edgeObj.v,w=edgeObj.w,Object.freeze(edgeObj),this._edgeObjs[e]=edgeObj,incrementOrInitEntry(this._preds[w],v),incrementOrInitEntry(this._sucs[v],w),this._in[w][e]=edgeObj,this._out[v][e]=edgeObj,this._edgeCount++,this}edge(v,w,name){var e=1===arguments.length?edgeObjToId(this._isDirected,arguments[0]):edgeArgsToId(this._isDirected,v,w,name);return this._edgeLabels[e]}hasEdge(v,w,name){var e=1===arguments.length?edgeObjToId(this._isDirected,arguments[0]):edgeArgsToId(this._isDirected,v,w,name);return Object.prototype.hasOwnProperty.call(this._edgeLabels,e)}removeEdge(v,w,name){var e=1===arguments.length?edgeObjToId(this._isDirected,arguments[0]):edgeArgsToId(this._isDirected,v,w,name),edge=this._edgeObjs[e];return edge&&(v=edge.v,w=edge.w,delete this._edgeLabels[e],delete this._edgeObjs[e],decrementOrRemoveEntry(this._preds[w],v),decrementOrRemoveEntry(this._sucs[v],w),delete this._in[w][e],delete this._out[v][e],this._edgeCount--),this}inEdges(v,u){var inV=this._in[v];if(inV){var edges=values(inV);return u?filter(edges,function(edge){return edge.v===u}):edges}}outEdges(v,w){var outV=this._out[v];if(outV){var edges=values(outV);return w?filter(edges,function(edge){return edge.w===w}):edges}}nodeEdges(v,w){var inEdges=this.inEdges(v,w);if(inEdges)return inEdges.concat(this.outEdges(v,w))}}function incrementOrInitEntry(map,k){map[k]?map[k]++:map[k]=1}function decrementOrRemoveEntry(map,k){--map[k]||delete map[k]}function edgeArgsToId(isDirected,v_,w_,name){var v=""+v_,w=""+w_;if(!isDirected&&v>w){var tmp=v;v=w,w=tmp}return v+""+w+""+(isUndefined(name)?"\0":name)}function edgeObjToId(isDirected,edgeObj){return edgeArgsToId(isDirected,edgeObj.v,edgeObj.w,edgeObj.name)}Graph.prototype._nodeCount=0,Graph.prototype._edgeCount=0;export{Graph as G,baseClone as b,isUndefined as i,values as v};
1
+ import{aQ as copyObject,aR as keysIn,aS as getPrototype,aT as cloneArrayBuffer,aU as Symbol$1,aV as cloneTypedArray,aW as isObjectLike,aX as getTag,aY as baseUnary,aZ as nodeUtil,a_ as isObject,a$ as copyArray,b0 as isBuffer,b1 as cloneBuffer,b2 as initCloneObject,b3 as Stack,aG as isArray,b4 as assignValue,b5 as baseRest,b6 as isArrayLikeObject,b7 as constant,b8 as isFunction,b9 as isEmpty}from"./mermaid.core-O3WUNQR6.js";import{k as keys,g as getSymbols,s as stubArray,e as arrayPush,f as baseGetAllKeys,h as arrayEach,j as getAllKeys,d as arrayMap,l as baseUniq,b as baseFlatten,m as filter,n as forEach,r as reduce}from"./_baseUniq-C73FOqig.js";var getSymbolsIn=Object.getOwnPropertySymbols?function(object){for(var result=[];object;)arrayPush(result,getSymbols(object)),object=getPrototype(object);return result}:stubArray;function getAllKeysIn(object){return baseGetAllKeys(object,keysIn,getSymbolsIn)}var hasOwnProperty=Object.prototype.hasOwnProperty;var reFlags=/\w*$/;var symbolProto=Symbol$1?Symbol$1.prototype:void 0,symbolValueOf=symbolProto?symbolProto.valueOf:void 0;function initCloneByTag(object,tag,isDeep){var symbol,regexp,result,Ctor=object.constructor;switch(tag){case"[object ArrayBuffer]":return cloneArrayBuffer(object);case"[object Boolean]":case"[object Date]":return new Ctor(+object);case"[object DataView]":return function(dataView,isDeep){var buffer=isDeep?cloneArrayBuffer(dataView.buffer):dataView.buffer;return new dataView.constructor(buffer,dataView.byteOffset,dataView.byteLength)}(object,isDeep);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return cloneTypedArray(object,isDeep);case"[object Map]":case"[object Set]":return new Ctor;case"[object Number]":case"[object String]":return new Ctor(object);case"[object RegExp]":return(result=new(regexp=object).constructor(regexp.source,reFlags.exec(regexp))).lastIndex=regexp.lastIndex,result;case"[object Symbol]":return symbol=object,symbolValueOf?Object(symbolValueOf.call(symbol)):{}}}var nodeIsMap=nodeUtil&&nodeUtil.isMap,isMap=nodeIsMap?baseUnary(nodeIsMap):function(value){return isObjectLike(value)&&"[object Map]"==getTag(value)};var nodeIsSet=nodeUtil&&nodeUtil.isSet,isSet=nodeIsSet?baseUnary(nodeIsSet):function(value){return isObjectLike(value)&&"[object Set]"==getTag(value)},cloneableTags={};function baseClone(value,bitmask,customizer,key,object,stack){var result,isDeep=1&bitmask,isFlat=2&bitmask,isFull=4&bitmask;if(void 0!==result)return result;if(!isObject(value))return value;var isArr=isArray(value);if(isArr){if(result=function(array){var length=array.length,result=new array.constructor(length);return length&&"string"==typeof array[0]&&hasOwnProperty.call(array,"index")&&(result.index=array.index,result.input=array.input),result}(value),!isDeep)return copyArray(value,result)}else{var tag=getTag(value),isFunc="[object Function]"==tag||"[object GeneratorFunction]"==tag;if(isBuffer(value))return cloneBuffer(value,isDeep);if("[object Object]"==tag||"[object Arguments]"==tag||isFunc&&!object){if(result=isFlat||isFunc?{}:initCloneObject(value),!isDeep)return isFlat?function(source,object){return copyObject(source,getSymbolsIn(source),object)}(value,function(object,source){return object&&copyObject(source,keysIn(source),object)}(result,value)):function(source,object){return copyObject(source,getSymbols(source),object)}(value,function(object,source){return object&&copyObject(source,keys(source),object)}(result,value))}else{if(!cloneableTags[tag])return object?value:{};result=initCloneByTag(value,tag,isDeep)}}stack||(stack=new Stack);var stacked=stack.get(value);if(stacked)return stacked;stack.set(value,result),isSet(value)?value.forEach(function(subValue){result.add(baseClone(subValue,bitmask,customizer,subValue,value,stack))}):isMap(value)&&value.forEach(function(subValue,key2){result.set(key2,baseClone(subValue,bitmask,customizer,key2,value,stack))});var props=isArr?void 0:(isFull?isFlat?getAllKeysIn:getAllKeys:isFlat?keysIn:keys)(value);return arrayEach(props||value,function(subValue,key2){props&&(subValue=value[key2=subValue]),assignValue(result,key2,baseClone(subValue,bitmask,customizer,key2,value,stack))}),result}function values(object){return null==object?[]:function(object,props){return arrayMap(props,function(key){return object[key]})}(object,keys(object))}function isUndefined(value){return void 0===value}cloneableTags["[object Arguments]"]=cloneableTags["[object Array]"]=cloneableTags["[object ArrayBuffer]"]=cloneableTags["[object DataView]"]=cloneableTags["[object Boolean]"]=cloneableTags["[object Date]"]=cloneableTags["[object Float32Array]"]=cloneableTags["[object Float64Array]"]=cloneableTags["[object Int8Array]"]=cloneableTags["[object Int16Array]"]=cloneableTags["[object Int32Array]"]=cloneableTags["[object Map]"]=cloneableTags["[object Number]"]=cloneableTags["[object Object]"]=cloneableTags["[object RegExp]"]=cloneableTags["[object Set]"]=cloneableTags["[object String]"]=cloneableTags["[object Symbol]"]=cloneableTags["[object Uint8Array]"]=cloneableTags["[object Uint8ClampedArray]"]=cloneableTags["[object Uint16Array]"]=cloneableTags["[object Uint32Array]"]=!0,cloneableTags["[object Error]"]=cloneableTags["[object Function]"]=cloneableTags["[object WeakMap]"]=!1;var union=baseRest(function(arrays){return baseUniq(baseFlatten(arrays,1,isArrayLikeObject,!0))});class Graph{constructor(opts={}){this._isDirected=!Object.prototype.hasOwnProperty.call(opts,"directed")||opts.directed,this._isMultigraph=!!Object.prototype.hasOwnProperty.call(opts,"multigraph")&&opts.multigraph,this._isCompound=!!Object.prototype.hasOwnProperty.call(opts,"compound")&&opts.compound,this._label=void 0,this._defaultNodeLabelFn=constant(void 0),this._defaultEdgeLabelFn=constant(void 0),this._nodes={},this._isCompound&&(this._parent={},this._children={},this._children["\0"]={}),this._in={},this._preds={},this._out={},this._sucs={},this._edgeObjs={},this._edgeLabels={}}isDirected(){return this._isDirected}isMultigraph(){return this._isMultigraph}isCompound(){return this._isCompound}setGraph(label){return this._label=label,this}graph(){return this._label}setDefaultNodeLabel(newDefault){return isFunction(newDefault)||(newDefault=constant(newDefault)),this._defaultNodeLabelFn=newDefault,this}nodeCount(){return this._nodeCount}nodes(){return keys(this._nodes)}sources(){var self=this;return filter(this.nodes(),function(v){return isEmpty(self._in[v])})}sinks(){var self=this;return filter(this.nodes(),function(v){return isEmpty(self._out[v])})}setNodes(vs,value){var args=arguments,self=this;return forEach(vs,function(v){args.length>1?self.setNode(v,value):self.setNode(v)}),this}setNode(v,value){return Object.prototype.hasOwnProperty.call(this._nodes,v)?(arguments.length>1&&(this._nodes[v]=value),this):(this._nodes[v]=arguments.length>1?value:this._defaultNodeLabelFn(v),this._isCompound&&(this._parent[v]="\0",this._children[v]={},this._children["\0"][v]=!0),this._in[v]={},this._preds[v]={},this._out[v]={},this._sucs[v]={},++this._nodeCount,this)}node(v){return this._nodes[v]}hasNode(v){return Object.prototype.hasOwnProperty.call(this._nodes,v)}removeNode(v){if(Object.prototype.hasOwnProperty.call(this._nodes,v)){var removeEdge=e=>this.removeEdge(this._edgeObjs[e]);delete this._nodes[v],this._isCompound&&(this._removeFromParentsChildList(v),delete this._parent[v],forEach(this.children(v),child=>{this.setParent(child)}),delete this._children[v]),forEach(keys(this._in[v]),removeEdge),delete this._in[v],delete this._preds[v],forEach(keys(this._out[v]),removeEdge),delete this._out[v],delete this._sucs[v],--this._nodeCount}return this}setParent(v,parent){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(isUndefined(parent))parent="\0";else{for(var ancestor=parent+="";!isUndefined(ancestor);ancestor=this.parent(ancestor))if(ancestor===v)throw new Error("Setting "+parent+" as parent of "+v+" would create a cycle");this.setNode(parent)}return this.setNode(v),this._removeFromParentsChildList(v),this._parent[v]=parent,this._children[parent][v]=!0,this}_removeFromParentsChildList(v){delete this._children[this._parent[v]][v]}parent(v){if(this._isCompound){var parent=this._parent[v];if("\0"!==parent)return parent}}children(v){if(isUndefined(v)&&(v="\0"),this._isCompound){var children=this._children[v];if(children)return keys(children)}else{if("\0"===v)return this.nodes();if(this.hasNode(v))return[]}}predecessors(v){var predsV=this._preds[v];if(predsV)return keys(predsV)}successors(v){var sucsV=this._sucs[v];if(sucsV)return keys(sucsV)}neighbors(v){var preds=this.predecessors(v);if(preds)return union(preds,this.successors(v))}isLeaf(v){return 0===(this.isDirected()?this.successors(v):this.neighbors(v)).length}filterNodes(filter2){var copy=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});copy.setGraph(this.graph());var self=this;forEach(this._nodes,function(value,v){filter2(v)&&copy.setNode(v,value)}),forEach(this._edgeObjs,function(e){copy.hasNode(e.v)&&copy.hasNode(e.w)&&copy.setEdge(e,self.edge(e))});var parents={};function findParent(v){var parent=self.parent(v);return void 0===parent||copy.hasNode(parent)?(parents[v]=parent,parent):parent in parents?parents[parent]:findParent(parent)}return this._isCompound&&forEach(copy.nodes(),function(v){copy.setParent(v,findParent(v))}),copy}setDefaultEdgeLabel(newDefault){return isFunction(newDefault)||(newDefault=constant(newDefault)),this._defaultEdgeLabelFn=newDefault,this}edgeCount(){return this._edgeCount}edges(){return values(this._edgeObjs)}setPath(vs,value){var self=this,args=arguments;return reduce(vs,function(v,w){return args.length>1?self.setEdge(v,w,value):self.setEdge(v,w),w}),this}setEdge(){var v,w,name,value,valueSpecified=!1,arg0=arguments[0];"object"==typeof arg0&&null!==arg0&&"v"in arg0?(v=arg0.v,w=arg0.w,name=arg0.name,2===arguments.length&&(value=arguments[1],valueSpecified=!0)):(v=arg0,w=arguments[1],name=arguments[3],arguments.length>2&&(value=arguments[2],valueSpecified=!0)),v=""+v,w=""+w,isUndefined(name)||(name=""+name);var e=edgeArgsToId(this._isDirected,v,w,name);if(Object.prototype.hasOwnProperty.call(this._edgeLabels,e))return valueSpecified&&(this._edgeLabels[e]=value),this;if(!isUndefined(name)&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(v),this.setNode(w),this._edgeLabels[e]=valueSpecified?value:this._defaultEdgeLabelFn(v,w,name);var edgeObj=function(isDirected,v_,w_,name){var v=""+v_,w=""+w_;if(!isDirected&&v>w){var tmp=v;v=w,w=tmp}var edgeObj={v:v,w:w};name&&(edgeObj.name=name);return edgeObj}(this._isDirected,v,w,name);return v=edgeObj.v,w=edgeObj.w,Object.freeze(edgeObj),this._edgeObjs[e]=edgeObj,incrementOrInitEntry(this._preds[w],v),incrementOrInitEntry(this._sucs[v],w),this._in[w][e]=edgeObj,this._out[v][e]=edgeObj,this._edgeCount++,this}edge(v,w,name){var e=1===arguments.length?edgeObjToId(this._isDirected,arguments[0]):edgeArgsToId(this._isDirected,v,w,name);return this._edgeLabels[e]}hasEdge(v,w,name){var e=1===arguments.length?edgeObjToId(this._isDirected,arguments[0]):edgeArgsToId(this._isDirected,v,w,name);return Object.prototype.hasOwnProperty.call(this._edgeLabels,e)}removeEdge(v,w,name){var e=1===arguments.length?edgeObjToId(this._isDirected,arguments[0]):edgeArgsToId(this._isDirected,v,w,name),edge=this._edgeObjs[e];return edge&&(v=edge.v,w=edge.w,delete this._edgeLabels[e],delete this._edgeObjs[e],decrementOrRemoveEntry(this._preds[w],v),decrementOrRemoveEntry(this._sucs[v],w),delete this._in[w][e],delete this._out[v][e],this._edgeCount--),this}inEdges(v,u){var inV=this._in[v];if(inV){var edges=values(inV);return u?filter(edges,function(edge){return edge.v===u}):edges}}outEdges(v,w){var outV=this._out[v];if(outV){var edges=values(outV);return w?filter(edges,function(edge){return edge.w===w}):edges}}nodeEdges(v,w){var inEdges=this.inEdges(v,w);if(inEdges)return inEdges.concat(this.outEdges(v,w))}}function incrementOrInitEntry(map,k){map[k]?map[k]++:map[k]=1}function decrementOrRemoveEntry(map,k){--map[k]||delete map[k]}function edgeArgsToId(isDirected,v_,w_,name){var v=""+v_,w=""+w_;if(!isDirected&&v>w){var tmp=v;v=w,w=tmp}return v+""+w+""+(isUndefined(name)?"\0":name)}function edgeObjToId(isDirected,edgeObj){return edgeArgsToId(isDirected,edgeObj.v,edgeObj.w,edgeObj.name)}Graph.prototype._nodeCount=0,Graph.prototype._edgeCount=0;export{Graph as G,baseClone as b,isUndefined as i,values as v};
@@ -1,2 +1,2 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/Mobile-DnvC6H2O.js","assets/vendor-codemirror-BiCbU51m.js","assets/vendor-antd-CAmbzFZk.js","assets/AppHeader.module-BaWqwKOb.js","assets/vendor-markdown-Bpu4AByL.js","assets/vendor-xterm-DckPrCx1.js","assets/vendor-highlight-IFTJ9nxW.js","assets/vendor-virtuoso-DfOWZHqr.js","assets/AppHeader-pu5K74SB.css","assets/Mobile-DolwHzoQ.css","assets/App-P57OfZoY.js","assets/vendor-qrcode-yTomWyAx.js","assets/App-fG2r3jFq.css"])))=>i.map(i=>d[i]);
2
- import{j as jsxRuntimeExports}from"./vendor-codemirror-BiCbU51m.js";import{k as requireReactDom,g as getDefaultExportFromCjs}from"./vendor-antd-CAmbzFZk.js";!function(){const relList=document.createElement("link").relList;if(!(relList&&relList.supports&&relList.supports("modulepreload"))){for(const link of document.querySelectorAll('link[rel="modulepreload"]'))processPreload(link);new MutationObserver(mutations=>{for(const mutation of mutations)if("childList"===mutation.type)for(const node of mutation.addedNodes)"LINK"===node.tagName&&"modulepreload"===node.rel&&processPreload(node)}).observe(document,{childList:!0,subtree:!0})}function processPreload(link){if(link.ep)return;link.ep=!0;const fetchOpts=function(link){const fetchOpts={};return link.integrity&&(fetchOpts.integrity=link.integrity),link.referrerPolicy&&(fetchOpts.referrerPolicy=link.referrerPolicy),"use-credentials"===link.crossOrigin?fetchOpts.credentials="include":"anonymous"===link.crossOrigin?fetchOpts.credentials="omit":fetchOpts.credentials="same-origin",fetchOpts}(link);fetch(link.href,fetchOpts)}}();const seen={},__vitePreload=function(baseModule,deps,importerUrl){let promise=Promise.resolve();if(deps&&deps.length>0){let allSettled2=function(promises){return Promise.all(promises.map(p=>Promise.resolve(p).then(value=>({status:"fulfilled",value:value}),reason=>({status:"rejected",reason:reason}))))};document.getElementsByTagName("link");const cspNonceMeta=document.querySelector("meta[property=csp-nonce]"),cspNonce=(null==cspNonceMeta?void 0:cspNonceMeta.nonce)||(null==cspNonceMeta?void 0:cspNonceMeta.getAttribute("nonce"));promise=allSettled2(deps.map(dep=>{if((dep=function(dep){return"/"+dep}(dep))in seen)return;seen[dep]=!0;const isCss=dep.endsWith(".css"),cssSelector=isCss?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${dep}"]${cssSelector}`))return;const link=document.createElement("link");return link.rel=isCss?"stylesheet":"modulepreload",isCss||(link.as="script"),link.crossOrigin="",link.href=dep,cspNonce&&link.setAttribute("nonce",cspNonce),document.head.appendChild(link),isCss?new Promise((res,rej)=>{link.addEventListener("load",res),link.addEventListener("error",()=>rej(new Error(`Unable to preload CSS for ${dep}`)))}):void 0}))}function handlePreloadError(err){const e=new Event("vite:preloadError",{cancelable:!0});if(e.payload=err,window.dispatchEvent(e),!e.defaultPrevented)throw err}return promise.then(res=>{for(const item of res||[])"rejected"===item.status&&handlePreloadError(item.reason);return baseModule().catch(handlePreloadError)})};!function(){let token=null;function addToken(url){const t=function(){if(token)return token;const params=new URLSearchParams(window.location.search);return token=params.get("token")||"",token}();if(!t)return url;if(url.startsWith("/")){const separator=url.includes("?")?"&":"?";return`${url}${separator}token=${encodeURIComponent(t)}`}try{const urlObj=new URL(url);if(urlObj.origin===window.location.origin)return urlObj.searchParams.set("token",t),urlObj.toString()}catch{}return url}const originalFetch=window.fetch;window.fetch=function(url,options){return originalFetch(addToken(url),options)};const OriginalEventSource=window.EventSource;window.EventSource=function(url,config){return new OriginalEventSource(addToken(url),config)};const OriginalWebSocket=window.WebSocket;window.WebSocket=function(url,protocols){return new OriginalWebSocket(addToken(url),protocols)},window.WebSocket.prototype=OriginalWebSocket.prototype,window.WebSocket.CONNECTING=OriginalWebSocket.CONNECTING,window.WebSocket.OPEN=OriginalWebSocket.OPEN,window.WebSocket.CLOSING=OriginalWebSocket.CLOSING,window.WebSocket.CLOSED=OriginalWebSocket.CLOSED}();var hasRequiredClient,client={};const ReactDOM=getDefaultExportFromCjs(function(){if(hasRequiredClient)return client;hasRequiredClient=1;var m=requireReactDom();return client.createRoot=m.createRoot,client.hydrateRoot=m.hydrateRoot,client}()),_isIPadOS=navigator.maxTouchPoints>1&&/Macintosh/i.test(navigator.userAgent),_params=new URLSearchParams(window.location.search),_forceMobile="1"===_params.get("mobile"),_forcePad="1"===_params.get("ipad"),_savedMode=_forceMobile||_forcePad?null:localStorage.getItem("ccv_viewMode"),_autoNarrow=!_forceMobile&&!_forcePad&&!_savedMode&&!/Android|iPhone|iPad|iPod|Mobile/i.test(navigator.userAgent)&&!_isIPadOS&&window.innerWidth<750,isPad=_forcePad||"pad"===_savedMode||_autoNarrow,isMobile=_forcePad||_forceMobile||"pad"===_savedMode||_autoNarrow||"pc"!==_savedMode&&(/Android|iPhone|iPad|iPod|Mobile/i.test(navigator.userAgent)||_isIPadOS),isIOS=/iPhone|iPad|iPod/i.test(navigator.userAgent)||_isIPadOS;function setViewMode(mode){localStorage.setItem("ccv_viewMode",mode),location.reload()}isPad&&document.documentElement.classList.add("pad-mode"),isMobile&&isIOS&&!isPad&&document.documentElement.classList.add("mobile-ios");const root=ReactDOM.createRoot(document.getElementById("root")),onLoadError=err=>{console.error("Failed to load app module:",err),document.getElementById("root").textContent="Loading failed. Please refresh the page."};isMobile?__vitePreload(async()=>{const{default:Mobile}=await import("./Mobile-DnvC6H2O.js");return{default:Mobile}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9])).then(({default:Mobile})=>{root.render(jsxRuntimeExports.jsx(Mobile,{}))}).catch(onLoadError):__vitePreload(async()=>{const{default:App}=await import("./App-P57OfZoY.js");return{default:App}},__vite__mapDeps([10,1,2,3,4,5,6,7,8,11,12])).then(({default:App})=>{root.render(jsxRuntimeExports.jsx(App,{}))}).catch(onLoadError);export{__vitePreload as _,isPad as a,isMobile as b,isIOS as i,setViewMode as s};
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/Mobile-CsKFJYE2.js","assets/vendor-codemirror-BiCbU51m.js","assets/vendor-antd-CAmbzFZk.js","assets/AppHeader.module-CDgQaFoO.js","assets/vendor-markdown-Bpu4AByL.js","assets/vendor-xterm-DckPrCx1.js","assets/vendor-highlight-IFTJ9nxW.js","assets/vendor-virtuoso-DfOWZHqr.js","assets/AppHeader-auOOOaQm.css","assets/Mobile-DolwHzoQ.css","assets/App-B0Cfe4hA.js","assets/vendor-qrcode-yTomWyAx.js","assets/App-DOYmReD4.css"])))=>i.map(i=>d[i]);
2
+ import{j as jsxRuntimeExports}from"./vendor-codemirror-BiCbU51m.js";import{k as requireReactDom,g as getDefaultExportFromCjs}from"./vendor-antd-CAmbzFZk.js";!function(){const relList=document.createElement("link").relList;if(!(relList&&relList.supports&&relList.supports("modulepreload"))){for(const link of document.querySelectorAll('link[rel="modulepreload"]'))processPreload(link);new MutationObserver(mutations=>{for(const mutation of mutations)if("childList"===mutation.type)for(const node of mutation.addedNodes)"LINK"===node.tagName&&"modulepreload"===node.rel&&processPreload(node)}).observe(document,{childList:!0,subtree:!0})}function processPreload(link){if(link.ep)return;link.ep=!0;const fetchOpts=function(link){const fetchOpts={};return link.integrity&&(fetchOpts.integrity=link.integrity),link.referrerPolicy&&(fetchOpts.referrerPolicy=link.referrerPolicy),"use-credentials"===link.crossOrigin?fetchOpts.credentials="include":"anonymous"===link.crossOrigin?fetchOpts.credentials="omit":fetchOpts.credentials="same-origin",fetchOpts}(link);fetch(link.href,fetchOpts)}}();const seen={},__vitePreload=function(baseModule,deps,importerUrl){let promise=Promise.resolve();if(deps&&deps.length>0){let allSettled2=function(promises){return Promise.all(promises.map(p=>Promise.resolve(p).then(value=>({status:"fulfilled",value:value}),reason=>({status:"rejected",reason:reason}))))};document.getElementsByTagName("link");const cspNonceMeta=document.querySelector("meta[property=csp-nonce]"),cspNonce=(null==cspNonceMeta?void 0:cspNonceMeta.nonce)||(null==cspNonceMeta?void 0:cspNonceMeta.getAttribute("nonce"));promise=allSettled2(deps.map(dep=>{if((dep=function(dep){return"/"+dep}(dep))in seen)return;seen[dep]=!0;const isCss=dep.endsWith(".css"),cssSelector=isCss?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${dep}"]${cssSelector}`))return;const link=document.createElement("link");return link.rel=isCss?"stylesheet":"modulepreload",isCss||(link.as="script"),link.crossOrigin="",link.href=dep,cspNonce&&link.setAttribute("nonce",cspNonce),document.head.appendChild(link),isCss?new Promise((res,rej)=>{link.addEventListener("load",res),link.addEventListener("error",()=>rej(new Error(`Unable to preload CSS for ${dep}`)))}):void 0}))}function handlePreloadError(err){const e=new Event("vite:preloadError",{cancelable:!0});if(e.payload=err,window.dispatchEvent(e),!e.defaultPrevented)throw err}return promise.then(res=>{for(const item of res||[])"rejected"===item.status&&handlePreloadError(item.reason);return baseModule().catch(handlePreloadError)})};!function(){let token=null;function addToken(url){const t=function(){if(token)return token;const params=new URLSearchParams(window.location.search);return token=params.get("token")||"",token}();if(!t)return url;if(url.startsWith("/")){const separator=url.includes("?")?"&":"?";return`${url}${separator}token=${encodeURIComponent(t)}`}try{const urlObj=new URL(url);if(urlObj.origin===window.location.origin)return urlObj.searchParams.set("token",t),urlObj.toString()}catch{}return url}const originalFetch=window.fetch;window.fetch=function(url,options){return originalFetch(addToken(url),options)};const OriginalEventSource=window.EventSource;window.EventSource=function(url,config){return new OriginalEventSource(addToken(url),config)};const OriginalWebSocket=window.WebSocket;window.WebSocket=function(url,protocols){return new OriginalWebSocket(addToken(url),protocols)},window.WebSocket.prototype=OriginalWebSocket.prototype,window.WebSocket.CONNECTING=OriginalWebSocket.CONNECTING,window.WebSocket.OPEN=OriginalWebSocket.OPEN,window.WebSocket.CLOSING=OriginalWebSocket.CLOSING,window.WebSocket.CLOSED=OriginalWebSocket.CLOSED}();var hasRequiredClient,client={};const ReactDOM=getDefaultExportFromCjs(function(){if(hasRequiredClient)return client;hasRequiredClient=1;var m=requireReactDom();return client.createRoot=m.createRoot,client.hydrateRoot=m.hydrateRoot,client}()),_isIPadOS=navigator.maxTouchPoints>1&&/Macintosh/i.test(navigator.userAgent),_params=new URLSearchParams(window.location.search),_forceMobile="1"===_params.get("mobile"),_forcePad="1"===_params.get("ipad"),_savedMode=_forceMobile||_forcePad?null:localStorage.getItem("ccv_viewMode"),_autoNarrow=!_forceMobile&&!_forcePad&&!_savedMode&&!/Android|iPhone|iPad|iPod|Mobile/i.test(navigator.userAgent)&&!_isIPadOS&&window.innerWidth<750,isPad=_forcePad||"pad"===_savedMode||_autoNarrow,isMobile=_forcePad||_forceMobile||"pad"===_savedMode||_autoNarrow||"pc"!==_savedMode&&(/Android|iPhone|iPad|iPod|Mobile/i.test(navigator.userAgent)||_isIPadOS),isIOS=/iPhone|iPad|iPod/i.test(navigator.userAgent)||_isIPadOS;function setViewMode(mode){localStorage.setItem("ccv_viewMode",mode),location.reload()}isPad&&document.documentElement.classList.add("pad-mode"),isMobile&&isIOS&&!isPad&&document.documentElement.classList.add("mobile-ios");const root=ReactDOM.createRoot(document.getElementById("root")),onLoadError=err=>{console.error("Failed to load app module:",err),document.getElementById("root").textContent="Loading failed. Please refresh the page."};isMobile?__vitePreload(async()=>{const{default:Mobile}=await import("./Mobile-CsKFJYE2.js");return{default:Mobile}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9])).then(({default:Mobile})=>{root.render(jsxRuntimeExports.jsx(Mobile,{}))}).catch(onLoadError):__vitePreload(async()=>{const{default:App}=await import("./App-B0Cfe4hA.js");return{default:App}},__vite__mapDeps([10,1,2,3,4,5,6,7,8,11,12])).then(({default:App})=>{root.render(jsxRuntimeExports.jsx(App,{}))}).catch(onLoadError);export{__vitePreload as _,isPad as a,isMobile as b,isIOS as i,setViewMode as s};
@@ -1 +1 @@
1
- import{_ as __name,l as log,H as selectSvgElement,e as configureSvgSize}from"./mermaid.core-fx56L749.js";import{p as parse}from"./wardley-RL74JXVD-Cw6grnZ8.js";import"./index-CP_dJQHF.js";import"./vendor-codemirror-BiCbU51m.js";import"./vendor-antd-CAmbzFZk.js";import"./vendor-markdown-Bpu4AByL.js";import"./min-Cfm_qmEy.js";import"./_baseUniq-Cnd-_Qe2.js";var DEFAULT_INFO_DB_version="11.14.0",diagram={parser:{parse:__name(async input=>{const ast=await parse("info",input);log.debug(ast)},"parse")},db:{getVersion:__name(()=>DEFAULT_INFO_DB_version,"getVersion")},renderer:{draw:__name((text,id,version)=>{log.debug("rendering info diagram\n"+text);const svg=selectSvgElement(id);configureSvgSize(svg,100,400,!0);svg.append("g").append("text").attr("x",100).attr("y",40).attr("class","version").attr("font-size",32).style("text-anchor","middle").text(`v${version}`)},"draw")}};export{diagram};
1
+ import{_ as __name,l as log,H as selectSvgElement,e as configureSvgSize}from"./mermaid.core-O3WUNQR6.js";import{p as parse}from"./wardley-RL74JXVD-DS_huD5U.js";import"./index-BnE1kmli.js";import"./vendor-codemirror-BiCbU51m.js";import"./vendor-antd-CAmbzFZk.js";import"./vendor-markdown-Bpu4AByL.js";import"./min-BDNYdllt.js";import"./_baseUniq-C73FOqig.js";var DEFAULT_INFO_DB_version="11.14.0",diagram={parser:{parse:__name(async input=>{const ast=await parse("info",input);log.debug(ast)},"parse")},db:{getVersion:__name(()=>DEFAULT_INFO_DB_version,"getVersion")},renderer:{draw:__name((text,id,version)=>{log.debug("rendering info diagram\n"+text);const svg=selectSvgElement(id);configureSvgSize(svg,100,400,!0);svg.append("g").append("text").attr("x",100).attr("y",40).attr("class","version").attr("font-size",32).style("text-anchor","middle").text(`v${version}`)},"draw")}};export{diagram};
@@ -1 +1 @@
1
- var _a;import{_ as __name,c as getConfig2,M as parseFontSize,H as selectSvgElement,ar as at,y as clear,k as common_default,p as setDiagramTitle,a as getAccTitle,b as setAccTitle,g as getAccDescription,s as setAccDescription,q as getDiagramTitle,e as configureSvgSize}from"./mermaid.core-fx56L749.js";import"./index-CP_dJQHF.js";import"./vendor-codemirror-BiCbU51m.js";import"./vendor-antd-CAmbzFZk.js";import"./vendor-markdown-Bpu4AByL.js";var parser=function(){var o=__name(function(k,v,o2,l){for(o2=o2||{},l=k.length;l--;o2[k[l]]=v);return o2},"o"),$V0=[1,4],$V1=[1,14],$V2=[1,12],$V3=[1,13],$V4=[6,7,8],$V5=[1,20],$V6=[1,18],$V7=[1,19],$V8=[6,7,11],$V9=[1,6,13,14],$Va=[1,23],$Vb=[1,24],$Vc=[1,6,7,11,13,14],parser2={trace:__name(function(){},"trace"),yy:{},symbols_:{error:2,start:3,ishikawa:4,spaceLines:5,SPACELINE:6,NL:7,ISHIKAWA:8,document:9,stop:10,EOF:11,statement:12,SPACELIST:13,TEXT:14,$accept:0,$end:1},terminals_:{2:"error",6:"SPACELINE",7:"NL",8:"ISHIKAWA",11:"EOF",13:"SPACELIST",14:"TEXT"},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,2],[12,1],[12,1],[12,1]],performAction:__name(function(yytext,yyleng,yylineno,yy,yystate,$$,_$){var $0=$$.length-1;switch(yystate){case 6:case 7:return yy;case 15:yy.addNode($$[$0-1].length,$$[$0].trim());break;case 16:yy.addNode(0,$$[$0].trim())}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],8:$V0},{1:[3]},{1:[2,1]},{4:6,6:[1,7],7:[1,8],8:$V0},{6:$V1,7:[1,10],9:9,12:11,13:$V2,14:$V3},o($V4,[2,3]),{1:[2,2]},o($V4,[2,4]),o($V4,[2,5]),{1:[2,6],6:$V1,12:15,13:$V2,14:$V3},{6:$V1,9:16,12:11,13:$V2,14:$V3},{6:$V5,7:$V6,10:17,11:$V7},o($V8,[2,18],{14:[1,21]}),o($V8,[2,16]),o($V8,[2,17]),{6:$V5,7:$V6,10:22,11:$V7},{1:[2,7],6:$V1,12:15,13:$V2,14:$V3},o($V9,[2,14],{7:$Va,11:$Vb}),o($Vc,[2,8]),o($Vc,[2,9]),o($Vc,[2,10]),o($V8,[2,15]),o($V9,[2,13],{7:$Va,11:$Vb}),o($Vc,[2,11]),o($Vc,[2,12])],defaultActions:{2:[2,1],6:[2,2]},parseError:__name(function(str,hash){if(!hash.recoverable){var error=new Error(str);throw error.hash=hash,error}this.trace(str)},"parseError"),parse:__name(function(input){var self=this,stack=[0],tstack=[],vstack=[null],lstack=[],table=this.table,yytext="",yylineno=0,yyleng=0,args=lstack.slice.call(arguments,1),lexer2=Object.create(this.lexer),sharedState={yy:{}};for(var k in this.yy)Object.prototype.hasOwnProperty.call(this.yy,k)&&(sharedState.yy[k]=this.yy[k]);lexer2.setInput(input,sharedState.yy),sharedState.yy.lexer=lexer2,sharedState.yy.parser=this,void 0===lexer2.yylloc&&(lexer2.yylloc={});var yyloc=lexer2.yylloc;lstack.push(yyloc);var ranges=lexer2.options&&lexer2.options.ranges;function lex(){var token;return"number"!=typeof(token=tstack.pop()||lexer2.lex()||1)&&(token instanceof Array&&(token=(tstack=token).pop()),token=self.symbols_[token]||token),token}"function"==typeof sharedState.yy.parseError?this.parseError=sharedState.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError,__name(function(n){stack.length=stack.length-2*n,vstack.length=vstack.length-n,lstack.length=lstack.length-n},"popStack"),__name(lex,"lex");for(var symbol,state,action,r,p,len,newState,expected,yyval={};;){if(state=stack[stack.length-1],this.defaultActions[state]?action=this.defaultActions[state]:(null==symbol&&(symbol=lex()),action=table[state]&&table[state][symbol]),void 0===action||!action.length||!action[0]){var errStr="";for(p in expected=[],table[state])this.terminals_[p]&&p>2&&expected.push("'"+this.terminals_[p]+"'");errStr=lexer2.showPosition?"Parse error on line "+(yylineno+1)+":\n"+lexer2.showPosition()+"\nExpecting "+expected.join(", ")+", got '"+(this.terminals_[symbol]||symbol)+"'":"Parse error on line "+(yylineno+1)+": Unexpected "+(1==symbol?"end of input":"'"+(this.terminals_[symbol]||symbol)+"'"),this.parseError(errStr,{text:lexer2.match,token:this.terminals_[symbol]||symbol,line:lexer2.yylineno,loc:yyloc,expected:expected})}if(action[0]instanceof Array&&action.length>1)throw new Error("Parse Error: multiple actions possible at state: "+state+", token: "+symbol);switch(action[0]){case 1:stack.push(symbol),vstack.push(lexer2.yytext),lstack.push(lexer2.yylloc),stack.push(action[1]),symbol=null,yyleng=lexer2.yyleng,yytext=lexer2.yytext,yylineno=lexer2.yylineno,yyloc=lexer2.yylloc;break;case 2:if(len=this.productions_[action[1]][1],yyval.$=vstack[vstack.length-len],yyval._$={first_line:lstack[lstack.length-(len||1)].first_line,last_line:lstack[lstack.length-1].last_line,first_column:lstack[lstack.length-(len||1)].first_column,last_column:lstack[lstack.length-1].last_column},ranges&&(yyval._$.range=[lstack[lstack.length-(len||1)].range[0],lstack[lstack.length-1].range[1]]),void 0!==(r=this.performAction.apply(yyval,[yytext,yyleng,yylineno,sharedState.yy,action[1],vstack,lstack].concat(args))))return r;len&&(stack=stack.slice(0,-1*len*2),vstack=vstack.slice(0,-1*len),lstack=lstack.slice(0,-1*len)),stack.push(this.productions_[action[1]][0]),vstack.push(yyval.$),lstack.push(yyval._$),newState=table[stack[stack.length-2]][stack[stack.length-1]],stack.push(newState);break;case 3:return!0}}return!0},"parse")},lexer=function(){return{EOF:1,parseError:__name(function(str,hash){if(!this.yy.parser)throw new Error(str);this.yy.parser.parseError(str,hash)},"parseError"),setInput:__name(function(input,yy){return this.yy=yy||this.yy||{},this._input=input,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:__name(function(){var ch=this._input[0];return this.yytext+=ch,this.yyleng++,this.offset++,this.match+=ch,this.matched+=ch,ch.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),ch},"input"),unput:__name(function(ch){var len=ch.length,lines=ch.split(/(?:\r\n?|\n)/g);this._input=ch+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-len),this.offset-=len;var oldLines=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),lines.length-1&&(this.yylineno-=lines.length-1);var r=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:lines?(lines.length===oldLines.length?this.yylloc.first_column:0)+oldLines[oldLines.length-lines.length].length-lines[0].length:this.yylloc.first_column-len},this.options.ranges&&(this.yylloc.range=[r[0],r[0]+this.yyleng-len]),this.yyleng=this.yytext.length,this},"unput"),more:__name(function(){return this._more=!0,this},"more"),reject:__name(function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):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).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},"reject"),less:__name(function(n){this.unput(this.match.slice(n))},"less"),pastInput:__name(function(){var past=this.matched.substr(0,this.matched.length-this.match.length);return(past.length>20?"...":"")+past.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:__name(function(){var next=this.match;return next.length<20&&(next+=this._input.substr(0,20-next.length)),(next.substr(0,20)+(next.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:__name(function(){var pre=this.pastInput(),c=new Array(pre.length+1).join("-");return pre+this.upcomingInput()+"\n"+c+"^"},"showPosition"),test_match:__name(function(match,indexed_rule){var token,lines,backup;if(this.options.backtrack_lexer&&(backup={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&&(backup.yylloc.range=this.yylloc.range.slice(0))),(lines=match[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=lines.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:lines?lines[lines.length-1].length-lines[lines.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+match[0].length},this.yytext+=match[0],this.match+=match[0],this.matches=match,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(match[0].length),this.matched+=match[0],token=this.performAction.call(this,this.yy,this,indexed_rule,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),token)return token;if(this._backtrack){for(var k in backup)this[k]=backup[k];return!1}return!1},"test_match"),next:__name(function(){if(this.done)return this.EOF;var token,match,tempMatch,index;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var rules=this._currentRules(),i=0;i<rules.length;i++)if((tempMatch=this._input.match(this.rules[rules[i]]))&&(!match||tempMatch[0].length>match[0].length)){if(match=tempMatch,index=i,this.options.backtrack_lexer){if(!1!==(token=this.test_match(tempMatch,rules[i])))return token;if(this._backtrack){match=!1;continue}return!1}if(!this.options.flex)break}return match?!1!==(token=this.test_match(match,rules[index]))&&token:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:__name(function(){var r=this.next();return r||this.lex()},"lex"),begin:__name(function(condition){this.conditionStack.push(condition)},"begin"),popState:__name(function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:__name(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:__name(function(n){return(n=this.conditionStack.length-1-Math.abs(n||0))>=0?this.conditionStack[n]:"INITIAL"},"topState"),pushState:__name(function(condition){this.begin(condition)},"pushState"),stateStackSize:__name(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:__name(function(yy,yy_,$avoiding_name_collisions,YY_START){switch($avoiding_name_collisions){case 0:case 3:return 6;case 1:case 2:return 8;case 4:return 7;case 5:return 13;case 6:return 14;case 7:return 11}},"anonymous"),rules:[/^(?:\s*%%.*)/i,/^(?:ishikawa-beta\b)/i,/^(?:ishikawa\b)/i,/^(?:[\s]+[\n])/i,/^(?:[\n]+)/i,/^(?:[\s]+)/i,/^(?:[^\n]+)/i,/^(?:$)/i],conditions:{INITIAL:{rules:[0,1,2,3,4,5,6,7],inclusive:!0}}}}();function Parser(){this.yy={}}return parser2.lexer=lexer,__name(Parser,"Parser"),Parser.prototype=parser2,parser2.Parser=Parser,new Parser}();parser.parser=parser;var ishikawa_default=parser,IshikawaDB=(__name(_a=class{constructor(){this.stack=[],this.clear=this.clear.bind(this),this.addNode=this.addNode.bind(this),this.getRoot=this.getRoot.bind(this)}clear(){this.root=void 0,this.stack=[],this.baseLevel=void 0,clear()}getRoot(){return this.root}addNode(rawLevel,text){const label=common_default.sanitizeText(text,getConfig2());if(!this.root)return this.root={text:label,children:[]},this.stack=[{level:0,node:this.root}],void setDiagramTitle(label);this.baseLevel??(this.baseLevel=rawLevel);let level=rawLevel-this.baseLevel+1;for(level<=0&&(level=1);this.stack.length>1&&this.stack[this.stack.length-1].level>=level;)this.stack.pop();const node={text:label,children:[]};this.stack[this.stack.length-1].node.children.push(node),this.stack.push({level:level,node:node})}getAccTitle(){return getAccTitle()}setAccTitle(title){setAccTitle(title)}getAccDescription(){return getAccDescription()}setAccDescription(description){setAccDescription(description)}getDiagramTitle(){return getDiagramTitle()}setDiagramTitle(title){setDiagramTitle(title)}},"IshikawaDB"),_a),ANGLE=82*Math.PI/180,COS_A=Math.cos(ANGLE),SIN_A=Math.sin(ANGLE),applyPaddedViewBox=__name((svgEl,pad,maxW)=>{const bbox=svgEl.node().getBBox(),w=bbox.width+2*pad,h=bbox.height+2*pad;configureSvgSize(svgEl,h,w,maxW),svgEl.attr("viewBox",`${bbox.x-pad} ${bbox.y-pad} ${w} ${h}`)},"applyPaddedViewBox"),draw=__name((_text,id,_version,diagram2)=>{var _a2,_b;const root=diagram2.db.getRoot();if(!root)return;const drawConfig=getConfig2(),{look:look,handDrawnSeed:handDrawnSeed,themeVariables:themeVariables}=drawConfig,fontSize=parseFontSize(drawConfig.fontSize)[0]??14,isHandDrawn="handDrawn"===look,causes=root.children??[],padding=(null==(_a2=drawConfig.ishikawa)?void 0:_a2.diagramPadding)??20,useMaxWidth=(null==(_b=drawConfig.ishikawa)?void 0:_b.useMaxWidth)??!1,svg=selectSvgElement(id),g=svg.append("g").attr("class","ishikawa"),roughSvg=isHandDrawn?at.svg(svg.node()):void 0,roughContext=roughSvg?{roughSvg:roughSvg,seed:handDrawnSeed??0,lineColor:(null==themeVariables?void 0:themeVariables.lineColor)??"#333",fillColor:(null==themeVariables?void 0:themeVariables.mainBkg)??"#fff"}:void 0,markerId=`ishikawa-arrow-${id}`;isHandDrawn||g.append("defs").append("marker").attr("id",markerId).attr("viewBox","0 0 10 10").attr("refX",0).attr("refY",5).attr("markerWidth",6).attr("markerHeight",6).attr("orient","auto").append("path").attr("d","M 10 0 L 0 5 L 10 10 Z").attr("class","ishikawa-arrow");let spineX=0,spineY=250;const spineLine=isHandDrawn?void 0:drawLine(g,spineX,spineY,spineX,spineY,"ishikawa-spine");if(drawHead(g,spineX,spineY,root.text,fontSize,roughContext),!causes.length)return isHandDrawn&&drawLine(g,spineX,spineY,spineX,spineY,"ishikawa-spine",roughContext),void applyPaddedViewBox(svg,padding,useMaxWidth);spineX-=20;const upperCauses=causes.filter((_,i)=>i%2==0),lowerCauses=causes.filter((_,i)=>i%2==1),upperStats=sideStats(upperCauses),lowerStats=sideStats(lowerCauses),descendantTotal=upperStats.total+lowerStats.total;let upperLen=250,lowerLen=250;if(descendantTotal>0){const pool=500,minLen=75;upperLen=Math.max(minLen,pool*(upperStats.total/descendantTotal)),lowerLen=Math.max(minLen,pool*(lowerStats.total/descendantTotal))}const minSpacing=2*fontSize;upperLen=Math.max(upperLen,upperStats.max*minSpacing),lowerLen=Math.max(lowerLen,lowerStats.max*minSpacing),spineY=Math.max(upperLen,250),spineLine&&spineLine.attr("y1",spineY).attr("y2",spineY),g.select(".ishikawa-head-group").attr("transform",`translate(0,${spineY})`);const pairCount=Math.ceil(causes.length/2);for(let p=0;p<pairCount;p++){const pg=g.append("g").attr("class","ishikawa-pair");for(const[cause,dir,len]of[[causes[2*p],-1,upperLen],[causes[2*p+1],1,lowerLen]])cause&&drawBranch(pg,cause,spineX,spineY,dir,len,fontSize,roughContext);spineX=pg.selectAll("text").nodes().reduce((left,n)=>Math.min(left,n.getBBox().x),1/0)}if(isHandDrawn)drawLine(g,spineX,spineY,0,spineY,"ishikawa-spine",roughContext);else{spineLine.attr("x1",spineX);const markerUrl=`url(#${markerId})`;g.selectAll("line.ishikawa-branch, line.ishikawa-sub-branch").attr("marker-start",markerUrl)}applyPaddedViewBox(svg,padding,useMaxWidth)},"draw"),sideStats=__name(nodes=>{const countDescendants=__name(node=>node.children.reduce((sum,child)=>sum+1+countDescendants(child),0),"countDescendants");return nodes.reduce((stats,node)=>{const descendants=countDescendants(node);return stats.total+=descendants,stats.max=Math.max(stats.max,descendants),stats},{total:0,max:0})},"sideStats"),drawHead=__name((svg,x,y,label,fontSize,roughContext)=>{const maxChars=Math.max(6,Math.floor(110/(.6*fontSize))),headGroup=svg.append("g").attr("class","ishikawa-head-group").attr("transform",`translate(${x},${y})`),textEl=drawMultilineText(headGroup,wrapText(label,maxChars),0,0,"ishikawa-head-label","start",fontSize),tb=textEl.node().getBBox(),w=Math.max(60,tb.width+6),h=Math.max(40,2*tb.height+40),headPath=`M 0 ${-h/2} L 0 ${h/2} Q ${2.4*w} 0 0 ${-h/2} Z`;if(roughContext){const roughNode=roughContext.roughSvg.path(headPath,{roughness:1.5,seed:roughContext.seed,fill:roughContext.fillColor,fillStyle:"hachure",fillWeight:2.5,hachureGap:5,stroke:roughContext.lineColor,strokeWidth:2});headGroup.insert(()=>roughNode,":first-child").attr("class","ishikawa-head")}else headGroup.insert("path",":first-child").attr("class","ishikawa-head").attr("d",headPath);textEl.attr("transform",`translate(${(w-tb.width)/2-tb.x+3},${-tb.y-tb.height/2})`)},"drawHead"),flattenTree=__name((children,direction)=>{const entries=[],yOrder=[],walk=__name((nodes,pid,depth)=>{const ordered=-1===direction?[...nodes].reverse():nodes;for(const child of ordered){const idx=entries.length,gc=child.children??[];entries.push({depth:depth,text:wrapText(child.text,15),parentIndex:pid,childCount:gc.length}),depth%2==0?(yOrder.push(idx),gc.length&&walk(gc,idx,depth+1)):(gc.length&&walk(gc,idx,depth+1),yOrder.push(idx))}},"walk");return walk(children,-1,2),{entries:entries,yOrder:yOrder}},"flattenTree"),drawCauseLabel=__name((svg,text,x,y,direction,fontSize,roughContext)=>{const lg=svg.append("g").attr("class","ishikawa-label-group"),tb=drawMultilineText(lg,text,x,y+11*direction,"ishikawa-label cause","middle",fontSize).node().getBBox();if(roughContext){const roughNode=roughContext.roughSvg.rectangle(tb.x-20,tb.y-2,tb.width+40,tb.height+4,{roughness:1.5,seed:roughContext.seed,fill:roughContext.fillColor,fillStyle:"hachure",fillWeight:2.5,hachureGap:5,stroke:roughContext.lineColor,strokeWidth:2});lg.insert(()=>roughNode,":first-child").attr("class","ishikawa-label-box")}else lg.insert("rect",":first-child").attr("class","ishikawa-label-box").attr("x",tb.x-20).attr("y",tb.y-2).attr("width",tb.width+40).attr("height",tb.height+4)},"drawCauseLabel"),drawArrowMarker=__name((g,x,y,dx,dy,roughContext)=>{const len=Math.sqrt(dx*dx+dy*dy);if(0===len)return;const ux=dx/len,uy=dy/len,px=6*-uy,py=6*ux,d=`M ${x} ${y} L ${x-6*ux*2+px} ${y-6*uy*2+py} L ${x-6*ux*2-px} ${y-6*uy*2-py} Z`,roughNode=roughContext.roughSvg.path(d,{roughness:1,seed:roughContext.seed,fill:roughContext.lineColor,fillStyle:"solid",stroke:roughContext.lineColor,strokeWidth:1});g.append(()=>roughNode)},"drawArrowMarker"),drawBranch=__name((svg,node,startX,startY,direction,length,fontSize,roughContext)=>{const children=node.children??[],lineLen=length*(children.length?1:.2),dy=SIN_A*lineLen*direction,endX=startX+-COS_A*lineLen,endY=startY+dy;if(drawLine(svg,startX,startY,endX,endY,"ishikawa-branch",roughContext),roughContext&&drawArrowMarker(svg,startX,startY,startX-endX,startY-endY,roughContext),drawCauseLabel(svg,node.text,endX,endY,direction,fontSize,roughContext),!children.length)return;const{entries:entries,yOrder:yOrder}=flattenTree(children,direction),entryCount=entries.length,ys=new Array(entryCount);for(const[slot,entryIdx]of yOrder.entries())ys[entryIdx]=startY+dy*((slot+1)/(entryCount+1));const bones=new Map;bones.set(-1,{x0:startX,y0:startY,x1:endX,y1:endY,childCount:children.length,childrenDrawn:0});const diagonalX=-COS_A,diagonalY=SIN_A*direction,oddLabel=direction<0?"ishikawa-label up":"ishikawa-label down";for(const[i,e]of entries.entries()){const y=ys[i],par=bones.get(e.parentIndex),grp=svg.append("g").attr("class","ishikawa-sub-group");let bx0=0,by0=0,bx1=0;if(e.depth%2==0){const dyP=par.y1-par.y0;bx0=lerp(par.x0,par.x1,dyP?(y-par.y0)/dyP:.5),by0=y,bx1=bx0-(e.childCount>0?60+5*e.childCount:30),drawLine(grp,bx0,y,bx1,y,"ishikawa-sub-branch",roughContext),roughContext&&drawArrowMarker(grp,bx0,y,1,0,roughContext),drawMultilineText(grp,e.text,bx1,y,"ishikawa-label align","end",fontSize)}else{const k=par.childrenDrawn++;bx0=lerp(par.x0,par.x1,(par.childCount-k)/(par.childCount+1)),by0=par.y0,bx1=bx0+diagonalX*((y-by0)/diagonalY),drawLine(grp,bx0,by0,bx1,y,"ishikawa-sub-branch",roughContext),roughContext&&drawArrowMarker(grp,bx0,by0,bx0-bx1,by0-y,roughContext),drawMultilineText(grp,e.text,bx1,y,oddLabel,"end",fontSize)}e.childCount>0&&bones.set(i,{x0:bx0,y0:by0,x1:bx1,y1:y,childCount:e.childCount,childrenDrawn:0})}},"drawBranch"),splitLines=__name(text=>text.split(/<br\s*\/?>|\n/),"splitLines"),wrapText=__name((text,maxChars)=>{if(text.length<=maxChars)return text;const lines=[];for(const word of text.split(/\s+/)){const last=lines.length-1;last>=0&&lines[last].length+1+word.length<=maxChars?lines[last]+=" "+word:lines.push(word)}return lines.join("\n")},"wrapText"),drawMultilineText=__name((g,text,x,y,cls,anchor,fontSize)=>{const lines=splitLines(text),lh=1.05*fontSize,el=g.append("text").attr("class",cls).attr("text-anchor",anchor).attr("x",x).attr("y",y-(lines.length-1)*lh/2);for(const[i,line]of lines.entries())el.append("tspan").attr("x",x).attr("dy",0===i?0:lh).text(line);return el},"drawMultilineText"),lerp=__name((a,b,t)=>a+(b-a)*t,"lerp"),drawLine=__name((g,x1,y1,x2,y2,cls,roughContext)=>{if(roughContext){const roughNode=roughContext.roughSvg.line(x1,y1,x2,y2,{roughness:1.5,seed:roughContext.seed,stroke:roughContext.lineColor,strokeWidth:2});return void g.append(()=>roughNode).attr("class",cls)}return g.append("line").attr("class",cls).attr("x1",x1).attr("y1",y1).attr("x2",x2).attr("y2",y2)},"drawLine"),renderer={draw:draw},ishikawaStyles_default=__name(options=>`\n.ishikawa .ishikawa-spine,\n.ishikawa .ishikawa-branch,\n.ishikawa .ishikawa-sub-branch {\n stroke: ${options.lineColor};\n stroke-width: 2;\n fill: none;\n}\n\n.ishikawa .ishikawa-sub-branch {\n stroke-width: 1;\n}\n\n.ishikawa .ishikawa-arrow {\n fill: ${options.lineColor};\n}\n\n.ishikawa .ishikawa-head {\n fill: ${options.mainBkg};\n stroke: ${options.lineColor};\n stroke-width: 2;\n}\n\n.ishikawa .ishikawa-label-box {\n fill: ${options.mainBkg};\n stroke: ${options.lineColor};\n stroke-width: 2;\n}\n\n.ishikawa text {\n font-family: ${options.fontFamily};\n font-size: ${options.fontSize};\n fill: ${options.textColor};\n}\n\n.ishikawa .ishikawa-head-label {\n font-weight: 600;\n text-anchor: middle;\n dominant-baseline: middle;\n font-size: 14px;\n}\n\n.ishikawa .ishikawa-label {\n text-anchor: end;\n}\n\n.ishikawa .ishikawa-label.cause {\n text-anchor: middle;\n dominant-baseline: middle;\n}\n\n.ishikawa .ishikawa-label.align {\n text-anchor: end;\n dominant-baseline: middle;\n}\n\n.ishikawa .ishikawa-label.up {\n dominant-baseline: baseline;\n}\n\n.ishikawa .ishikawa-label.down {\n dominant-baseline: hanging;\n}\n`,"getStyles"),diagram={parser:ishikawa_default,get db(){return new IshikawaDB},renderer:renderer,styles:ishikawaStyles_default};export{diagram};
1
+ var _a;import{_ as __name,c as getConfig2,M as parseFontSize,H as selectSvgElement,ar as at,y as clear,k as common_default,p as setDiagramTitle,a as getAccTitle,b as setAccTitle,g as getAccDescription,s as setAccDescription,q as getDiagramTitle,e as configureSvgSize}from"./mermaid.core-O3WUNQR6.js";import"./index-BnE1kmli.js";import"./vendor-codemirror-BiCbU51m.js";import"./vendor-antd-CAmbzFZk.js";import"./vendor-markdown-Bpu4AByL.js";var parser=function(){var o=__name(function(k,v,o2,l){for(o2=o2||{},l=k.length;l--;o2[k[l]]=v);return o2},"o"),$V0=[1,4],$V1=[1,14],$V2=[1,12],$V3=[1,13],$V4=[6,7,8],$V5=[1,20],$V6=[1,18],$V7=[1,19],$V8=[6,7,11],$V9=[1,6,13,14],$Va=[1,23],$Vb=[1,24],$Vc=[1,6,7,11,13,14],parser2={trace:__name(function(){},"trace"),yy:{},symbols_:{error:2,start:3,ishikawa:4,spaceLines:5,SPACELINE:6,NL:7,ISHIKAWA:8,document:9,stop:10,EOF:11,statement:12,SPACELIST:13,TEXT:14,$accept:0,$end:1},terminals_:{2:"error",6:"SPACELINE",7:"NL",8:"ISHIKAWA",11:"EOF",13:"SPACELIST",14:"TEXT"},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,2],[12,1],[12,1],[12,1]],performAction:__name(function(yytext,yyleng,yylineno,yy,yystate,$$,_$){var $0=$$.length-1;switch(yystate){case 6:case 7:return yy;case 15:yy.addNode($$[$0-1].length,$$[$0].trim());break;case 16:yy.addNode(0,$$[$0].trim())}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],8:$V0},{1:[3]},{1:[2,1]},{4:6,6:[1,7],7:[1,8],8:$V0},{6:$V1,7:[1,10],9:9,12:11,13:$V2,14:$V3},o($V4,[2,3]),{1:[2,2]},o($V4,[2,4]),o($V4,[2,5]),{1:[2,6],6:$V1,12:15,13:$V2,14:$V3},{6:$V1,9:16,12:11,13:$V2,14:$V3},{6:$V5,7:$V6,10:17,11:$V7},o($V8,[2,18],{14:[1,21]}),o($V8,[2,16]),o($V8,[2,17]),{6:$V5,7:$V6,10:22,11:$V7},{1:[2,7],6:$V1,12:15,13:$V2,14:$V3},o($V9,[2,14],{7:$Va,11:$Vb}),o($Vc,[2,8]),o($Vc,[2,9]),o($Vc,[2,10]),o($V8,[2,15]),o($V9,[2,13],{7:$Va,11:$Vb}),o($Vc,[2,11]),o($Vc,[2,12])],defaultActions:{2:[2,1],6:[2,2]},parseError:__name(function(str,hash){if(!hash.recoverable){var error=new Error(str);throw error.hash=hash,error}this.trace(str)},"parseError"),parse:__name(function(input){var self=this,stack=[0],tstack=[],vstack=[null],lstack=[],table=this.table,yytext="",yylineno=0,yyleng=0,args=lstack.slice.call(arguments,1),lexer2=Object.create(this.lexer),sharedState={yy:{}};for(var k in this.yy)Object.prototype.hasOwnProperty.call(this.yy,k)&&(sharedState.yy[k]=this.yy[k]);lexer2.setInput(input,sharedState.yy),sharedState.yy.lexer=lexer2,sharedState.yy.parser=this,void 0===lexer2.yylloc&&(lexer2.yylloc={});var yyloc=lexer2.yylloc;lstack.push(yyloc);var ranges=lexer2.options&&lexer2.options.ranges;function lex(){var token;return"number"!=typeof(token=tstack.pop()||lexer2.lex()||1)&&(token instanceof Array&&(token=(tstack=token).pop()),token=self.symbols_[token]||token),token}"function"==typeof sharedState.yy.parseError?this.parseError=sharedState.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError,__name(function(n){stack.length=stack.length-2*n,vstack.length=vstack.length-n,lstack.length=lstack.length-n},"popStack"),__name(lex,"lex");for(var symbol,state,action,r,p,len,newState,expected,yyval={};;){if(state=stack[stack.length-1],this.defaultActions[state]?action=this.defaultActions[state]:(null==symbol&&(symbol=lex()),action=table[state]&&table[state][symbol]),void 0===action||!action.length||!action[0]){var errStr="";for(p in expected=[],table[state])this.terminals_[p]&&p>2&&expected.push("'"+this.terminals_[p]+"'");errStr=lexer2.showPosition?"Parse error on line "+(yylineno+1)+":\n"+lexer2.showPosition()+"\nExpecting "+expected.join(", ")+", got '"+(this.terminals_[symbol]||symbol)+"'":"Parse error on line "+(yylineno+1)+": Unexpected "+(1==symbol?"end of input":"'"+(this.terminals_[symbol]||symbol)+"'"),this.parseError(errStr,{text:lexer2.match,token:this.terminals_[symbol]||symbol,line:lexer2.yylineno,loc:yyloc,expected:expected})}if(action[0]instanceof Array&&action.length>1)throw new Error("Parse Error: multiple actions possible at state: "+state+", token: "+symbol);switch(action[0]){case 1:stack.push(symbol),vstack.push(lexer2.yytext),lstack.push(lexer2.yylloc),stack.push(action[1]),symbol=null,yyleng=lexer2.yyleng,yytext=lexer2.yytext,yylineno=lexer2.yylineno,yyloc=lexer2.yylloc;break;case 2:if(len=this.productions_[action[1]][1],yyval.$=vstack[vstack.length-len],yyval._$={first_line:lstack[lstack.length-(len||1)].first_line,last_line:lstack[lstack.length-1].last_line,first_column:lstack[lstack.length-(len||1)].first_column,last_column:lstack[lstack.length-1].last_column},ranges&&(yyval._$.range=[lstack[lstack.length-(len||1)].range[0],lstack[lstack.length-1].range[1]]),void 0!==(r=this.performAction.apply(yyval,[yytext,yyleng,yylineno,sharedState.yy,action[1],vstack,lstack].concat(args))))return r;len&&(stack=stack.slice(0,-1*len*2),vstack=vstack.slice(0,-1*len),lstack=lstack.slice(0,-1*len)),stack.push(this.productions_[action[1]][0]),vstack.push(yyval.$),lstack.push(yyval._$),newState=table[stack[stack.length-2]][stack[stack.length-1]],stack.push(newState);break;case 3:return!0}}return!0},"parse")},lexer=function(){return{EOF:1,parseError:__name(function(str,hash){if(!this.yy.parser)throw new Error(str);this.yy.parser.parseError(str,hash)},"parseError"),setInput:__name(function(input,yy){return this.yy=yy||this.yy||{},this._input=input,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:__name(function(){var ch=this._input[0];return this.yytext+=ch,this.yyleng++,this.offset++,this.match+=ch,this.matched+=ch,ch.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),ch},"input"),unput:__name(function(ch){var len=ch.length,lines=ch.split(/(?:\r\n?|\n)/g);this._input=ch+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-len),this.offset-=len;var oldLines=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),lines.length-1&&(this.yylineno-=lines.length-1);var r=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:lines?(lines.length===oldLines.length?this.yylloc.first_column:0)+oldLines[oldLines.length-lines.length].length-lines[0].length:this.yylloc.first_column-len},this.options.ranges&&(this.yylloc.range=[r[0],r[0]+this.yyleng-len]),this.yyleng=this.yytext.length,this},"unput"),more:__name(function(){return this._more=!0,this},"more"),reject:__name(function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):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).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},"reject"),less:__name(function(n){this.unput(this.match.slice(n))},"less"),pastInput:__name(function(){var past=this.matched.substr(0,this.matched.length-this.match.length);return(past.length>20?"...":"")+past.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:__name(function(){var next=this.match;return next.length<20&&(next+=this._input.substr(0,20-next.length)),(next.substr(0,20)+(next.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:__name(function(){var pre=this.pastInput(),c=new Array(pre.length+1).join("-");return pre+this.upcomingInput()+"\n"+c+"^"},"showPosition"),test_match:__name(function(match,indexed_rule){var token,lines,backup;if(this.options.backtrack_lexer&&(backup={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&&(backup.yylloc.range=this.yylloc.range.slice(0))),(lines=match[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=lines.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:lines?lines[lines.length-1].length-lines[lines.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+match[0].length},this.yytext+=match[0],this.match+=match[0],this.matches=match,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(match[0].length),this.matched+=match[0],token=this.performAction.call(this,this.yy,this,indexed_rule,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),token)return token;if(this._backtrack){for(var k in backup)this[k]=backup[k];return!1}return!1},"test_match"),next:__name(function(){if(this.done)return this.EOF;var token,match,tempMatch,index;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var rules=this._currentRules(),i=0;i<rules.length;i++)if((tempMatch=this._input.match(this.rules[rules[i]]))&&(!match||tempMatch[0].length>match[0].length)){if(match=tempMatch,index=i,this.options.backtrack_lexer){if(!1!==(token=this.test_match(tempMatch,rules[i])))return token;if(this._backtrack){match=!1;continue}return!1}if(!this.options.flex)break}return match?!1!==(token=this.test_match(match,rules[index]))&&token:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:__name(function(){var r=this.next();return r||this.lex()},"lex"),begin:__name(function(condition){this.conditionStack.push(condition)},"begin"),popState:__name(function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:__name(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:__name(function(n){return(n=this.conditionStack.length-1-Math.abs(n||0))>=0?this.conditionStack[n]:"INITIAL"},"topState"),pushState:__name(function(condition){this.begin(condition)},"pushState"),stateStackSize:__name(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:__name(function(yy,yy_,$avoiding_name_collisions,YY_START){switch($avoiding_name_collisions){case 0:case 3:return 6;case 1:case 2:return 8;case 4:return 7;case 5:return 13;case 6:return 14;case 7:return 11}},"anonymous"),rules:[/^(?:\s*%%.*)/i,/^(?:ishikawa-beta\b)/i,/^(?:ishikawa\b)/i,/^(?:[\s]+[\n])/i,/^(?:[\n]+)/i,/^(?:[\s]+)/i,/^(?:[^\n]+)/i,/^(?:$)/i],conditions:{INITIAL:{rules:[0,1,2,3,4,5,6,7],inclusive:!0}}}}();function Parser(){this.yy={}}return parser2.lexer=lexer,__name(Parser,"Parser"),Parser.prototype=parser2,parser2.Parser=Parser,new Parser}();parser.parser=parser;var ishikawa_default=parser,IshikawaDB=(__name(_a=class{constructor(){this.stack=[],this.clear=this.clear.bind(this),this.addNode=this.addNode.bind(this),this.getRoot=this.getRoot.bind(this)}clear(){this.root=void 0,this.stack=[],this.baseLevel=void 0,clear()}getRoot(){return this.root}addNode(rawLevel,text){const label=common_default.sanitizeText(text,getConfig2());if(!this.root)return this.root={text:label,children:[]},this.stack=[{level:0,node:this.root}],void setDiagramTitle(label);this.baseLevel??(this.baseLevel=rawLevel);let level=rawLevel-this.baseLevel+1;for(level<=0&&(level=1);this.stack.length>1&&this.stack[this.stack.length-1].level>=level;)this.stack.pop();const node={text:label,children:[]};this.stack[this.stack.length-1].node.children.push(node),this.stack.push({level:level,node:node})}getAccTitle(){return getAccTitle()}setAccTitle(title){setAccTitle(title)}getAccDescription(){return getAccDescription()}setAccDescription(description){setAccDescription(description)}getDiagramTitle(){return getDiagramTitle()}setDiagramTitle(title){setDiagramTitle(title)}},"IshikawaDB"),_a),ANGLE=82*Math.PI/180,COS_A=Math.cos(ANGLE),SIN_A=Math.sin(ANGLE),applyPaddedViewBox=__name((svgEl,pad,maxW)=>{const bbox=svgEl.node().getBBox(),w=bbox.width+2*pad,h=bbox.height+2*pad;configureSvgSize(svgEl,h,w,maxW),svgEl.attr("viewBox",`${bbox.x-pad} ${bbox.y-pad} ${w} ${h}`)},"applyPaddedViewBox"),draw=__name((_text,id,_version,diagram2)=>{var _a2,_b;const root=diagram2.db.getRoot();if(!root)return;const drawConfig=getConfig2(),{look:look,handDrawnSeed:handDrawnSeed,themeVariables:themeVariables}=drawConfig,fontSize=parseFontSize(drawConfig.fontSize)[0]??14,isHandDrawn="handDrawn"===look,causes=root.children??[],padding=(null==(_a2=drawConfig.ishikawa)?void 0:_a2.diagramPadding)??20,useMaxWidth=(null==(_b=drawConfig.ishikawa)?void 0:_b.useMaxWidth)??!1,svg=selectSvgElement(id),g=svg.append("g").attr("class","ishikawa"),roughSvg=isHandDrawn?at.svg(svg.node()):void 0,roughContext=roughSvg?{roughSvg:roughSvg,seed:handDrawnSeed??0,lineColor:(null==themeVariables?void 0:themeVariables.lineColor)??"#333",fillColor:(null==themeVariables?void 0:themeVariables.mainBkg)??"#fff"}:void 0,markerId=`ishikawa-arrow-${id}`;isHandDrawn||g.append("defs").append("marker").attr("id",markerId).attr("viewBox","0 0 10 10").attr("refX",0).attr("refY",5).attr("markerWidth",6).attr("markerHeight",6).attr("orient","auto").append("path").attr("d","M 10 0 L 0 5 L 10 10 Z").attr("class","ishikawa-arrow");let spineX=0,spineY=250;const spineLine=isHandDrawn?void 0:drawLine(g,spineX,spineY,spineX,spineY,"ishikawa-spine");if(drawHead(g,spineX,spineY,root.text,fontSize,roughContext),!causes.length)return isHandDrawn&&drawLine(g,spineX,spineY,spineX,spineY,"ishikawa-spine",roughContext),void applyPaddedViewBox(svg,padding,useMaxWidth);spineX-=20;const upperCauses=causes.filter((_,i)=>i%2==0),lowerCauses=causes.filter((_,i)=>i%2==1),upperStats=sideStats(upperCauses),lowerStats=sideStats(lowerCauses),descendantTotal=upperStats.total+lowerStats.total;let upperLen=250,lowerLen=250;if(descendantTotal>0){const pool=500,minLen=75;upperLen=Math.max(minLen,pool*(upperStats.total/descendantTotal)),lowerLen=Math.max(minLen,pool*(lowerStats.total/descendantTotal))}const minSpacing=2*fontSize;upperLen=Math.max(upperLen,upperStats.max*minSpacing),lowerLen=Math.max(lowerLen,lowerStats.max*minSpacing),spineY=Math.max(upperLen,250),spineLine&&spineLine.attr("y1",spineY).attr("y2",spineY),g.select(".ishikawa-head-group").attr("transform",`translate(0,${spineY})`);const pairCount=Math.ceil(causes.length/2);for(let p=0;p<pairCount;p++){const pg=g.append("g").attr("class","ishikawa-pair");for(const[cause,dir,len]of[[causes[2*p],-1,upperLen],[causes[2*p+1],1,lowerLen]])cause&&drawBranch(pg,cause,spineX,spineY,dir,len,fontSize,roughContext);spineX=pg.selectAll("text").nodes().reduce((left,n)=>Math.min(left,n.getBBox().x),1/0)}if(isHandDrawn)drawLine(g,spineX,spineY,0,spineY,"ishikawa-spine",roughContext);else{spineLine.attr("x1",spineX);const markerUrl=`url(#${markerId})`;g.selectAll("line.ishikawa-branch, line.ishikawa-sub-branch").attr("marker-start",markerUrl)}applyPaddedViewBox(svg,padding,useMaxWidth)},"draw"),sideStats=__name(nodes=>{const countDescendants=__name(node=>node.children.reduce((sum,child)=>sum+1+countDescendants(child),0),"countDescendants");return nodes.reduce((stats,node)=>{const descendants=countDescendants(node);return stats.total+=descendants,stats.max=Math.max(stats.max,descendants),stats},{total:0,max:0})},"sideStats"),drawHead=__name((svg,x,y,label,fontSize,roughContext)=>{const maxChars=Math.max(6,Math.floor(110/(.6*fontSize))),headGroup=svg.append("g").attr("class","ishikawa-head-group").attr("transform",`translate(${x},${y})`),textEl=drawMultilineText(headGroup,wrapText(label,maxChars),0,0,"ishikawa-head-label","start",fontSize),tb=textEl.node().getBBox(),w=Math.max(60,tb.width+6),h=Math.max(40,2*tb.height+40),headPath=`M 0 ${-h/2} L 0 ${h/2} Q ${2.4*w} 0 0 ${-h/2} Z`;if(roughContext){const roughNode=roughContext.roughSvg.path(headPath,{roughness:1.5,seed:roughContext.seed,fill:roughContext.fillColor,fillStyle:"hachure",fillWeight:2.5,hachureGap:5,stroke:roughContext.lineColor,strokeWidth:2});headGroup.insert(()=>roughNode,":first-child").attr("class","ishikawa-head")}else headGroup.insert("path",":first-child").attr("class","ishikawa-head").attr("d",headPath);textEl.attr("transform",`translate(${(w-tb.width)/2-tb.x+3},${-tb.y-tb.height/2})`)},"drawHead"),flattenTree=__name((children,direction)=>{const entries=[],yOrder=[],walk=__name((nodes,pid,depth)=>{const ordered=-1===direction?[...nodes].reverse():nodes;for(const child of ordered){const idx=entries.length,gc=child.children??[];entries.push({depth:depth,text:wrapText(child.text,15),parentIndex:pid,childCount:gc.length}),depth%2==0?(yOrder.push(idx),gc.length&&walk(gc,idx,depth+1)):(gc.length&&walk(gc,idx,depth+1),yOrder.push(idx))}},"walk");return walk(children,-1,2),{entries:entries,yOrder:yOrder}},"flattenTree"),drawCauseLabel=__name((svg,text,x,y,direction,fontSize,roughContext)=>{const lg=svg.append("g").attr("class","ishikawa-label-group"),tb=drawMultilineText(lg,text,x,y+11*direction,"ishikawa-label cause","middle",fontSize).node().getBBox();if(roughContext){const roughNode=roughContext.roughSvg.rectangle(tb.x-20,tb.y-2,tb.width+40,tb.height+4,{roughness:1.5,seed:roughContext.seed,fill:roughContext.fillColor,fillStyle:"hachure",fillWeight:2.5,hachureGap:5,stroke:roughContext.lineColor,strokeWidth:2});lg.insert(()=>roughNode,":first-child").attr("class","ishikawa-label-box")}else lg.insert("rect",":first-child").attr("class","ishikawa-label-box").attr("x",tb.x-20).attr("y",tb.y-2).attr("width",tb.width+40).attr("height",tb.height+4)},"drawCauseLabel"),drawArrowMarker=__name((g,x,y,dx,dy,roughContext)=>{const len=Math.sqrt(dx*dx+dy*dy);if(0===len)return;const ux=dx/len,uy=dy/len,px=6*-uy,py=6*ux,d=`M ${x} ${y} L ${x-6*ux*2+px} ${y-6*uy*2+py} L ${x-6*ux*2-px} ${y-6*uy*2-py} Z`,roughNode=roughContext.roughSvg.path(d,{roughness:1,seed:roughContext.seed,fill:roughContext.lineColor,fillStyle:"solid",stroke:roughContext.lineColor,strokeWidth:1});g.append(()=>roughNode)},"drawArrowMarker"),drawBranch=__name((svg,node,startX,startY,direction,length,fontSize,roughContext)=>{const children=node.children??[],lineLen=length*(children.length?1:.2),dy=SIN_A*lineLen*direction,endX=startX+-COS_A*lineLen,endY=startY+dy;if(drawLine(svg,startX,startY,endX,endY,"ishikawa-branch",roughContext),roughContext&&drawArrowMarker(svg,startX,startY,startX-endX,startY-endY,roughContext),drawCauseLabel(svg,node.text,endX,endY,direction,fontSize,roughContext),!children.length)return;const{entries:entries,yOrder:yOrder}=flattenTree(children,direction),entryCount=entries.length,ys=new Array(entryCount);for(const[slot,entryIdx]of yOrder.entries())ys[entryIdx]=startY+dy*((slot+1)/(entryCount+1));const bones=new Map;bones.set(-1,{x0:startX,y0:startY,x1:endX,y1:endY,childCount:children.length,childrenDrawn:0});const diagonalX=-COS_A,diagonalY=SIN_A*direction,oddLabel=direction<0?"ishikawa-label up":"ishikawa-label down";for(const[i,e]of entries.entries()){const y=ys[i],par=bones.get(e.parentIndex),grp=svg.append("g").attr("class","ishikawa-sub-group");let bx0=0,by0=0,bx1=0;if(e.depth%2==0){const dyP=par.y1-par.y0;bx0=lerp(par.x0,par.x1,dyP?(y-par.y0)/dyP:.5),by0=y,bx1=bx0-(e.childCount>0?60+5*e.childCount:30),drawLine(grp,bx0,y,bx1,y,"ishikawa-sub-branch",roughContext),roughContext&&drawArrowMarker(grp,bx0,y,1,0,roughContext),drawMultilineText(grp,e.text,bx1,y,"ishikawa-label align","end",fontSize)}else{const k=par.childrenDrawn++;bx0=lerp(par.x0,par.x1,(par.childCount-k)/(par.childCount+1)),by0=par.y0,bx1=bx0+diagonalX*((y-by0)/diagonalY),drawLine(grp,bx0,by0,bx1,y,"ishikawa-sub-branch",roughContext),roughContext&&drawArrowMarker(grp,bx0,by0,bx0-bx1,by0-y,roughContext),drawMultilineText(grp,e.text,bx1,y,oddLabel,"end",fontSize)}e.childCount>0&&bones.set(i,{x0:bx0,y0:by0,x1:bx1,y1:y,childCount:e.childCount,childrenDrawn:0})}},"drawBranch"),splitLines=__name(text=>text.split(/<br\s*\/?>|\n/),"splitLines"),wrapText=__name((text,maxChars)=>{if(text.length<=maxChars)return text;const lines=[];for(const word of text.split(/\s+/)){const last=lines.length-1;last>=0&&lines[last].length+1+word.length<=maxChars?lines[last]+=" "+word:lines.push(word)}return lines.join("\n")},"wrapText"),drawMultilineText=__name((g,text,x,y,cls,anchor,fontSize)=>{const lines=splitLines(text),lh=1.05*fontSize,el=g.append("text").attr("class",cls).attr("text-anchor",anchor).attr("x",x).attr("y",y-(lines.length-1)*lh/2);for(const[i,line]of lines.entries())el.append("tspan").attr("x",x).attr("dy",0===i?0:lh).text(line);return el},"drawMultilineText"),lerp=__name((a,b,t)=>a+(b-a)*t,"lerp"),drawLine=__name((g,x1,y1,x2,y2,cls,roughContext)=>{if(roughContext){const roughNode=roughContext.roughSvg.line(x1,y1,x2,y2,{roughness:1.5,seed:roughContext.seed,stroke:roughContext.lineColor,strokeWidth:2});return void g.append(()=>roughNode).attr("class",cls)}return g.append("line").attr("class",cls).attr("x1",x1).attr("y1",y1).attr("x2",x2).attr("y2",y2)},"drawLine"),renderer={draw:draw},ishikawaStyles_default=__name(options=>`\n.ishikawa .ishikawa-spine,\n.ishikawa .ishikawa-branch,\n.ishikawa .ishikawa-sub-branch {\n stroke: ${options.lineColor};\n stroke-width: 2;\n fill: none;\n}\n\n.ishikawa .ishikawa-sub-branch {\n stroke-width: 1;\n}\n\n.ishikawa .ishikawa-arrow {\n fill: ${options.lineColor};\n}\n\n.ishikawa .ishikawa-head {\n fill: ${options.mainBkg};\n stroke: ${options.lineColor};\n stroke-width: 2;\n}\n\n.ishikawa .ishikawa-label-box {\n fill: ${options.mainBkg};\n stroke: ${options.lineColor};\n stroke-width: 2;\n}\n\n.ishikawa text {\n font-family: ${options.fontFamily};\n font-size: ${options.fontSize};\n fill: ${options.textColor};\n}\n\n.ishikawa .ishikawa-head-label {\n font-weight: 600;\n text-anchor: middle;\n dominant-baseline: middle;\n font-size: 14px;\n}\n\n.ishikawa .ishikawa-label {\n text-anchor: end;\n}\n\n.ishikawa .ishikawa-label.cause {\n text-anchor: middle;\n dominant-baseline: middle;\n}\n\n.ishikawa .ishikawa-label.align {\n text-anchor: end;\n dominant-baseline: middle;\n}\n\n.ishikawa .ishikawa-label.up {\n dominant-baseline: baseline;\n}\n\n.ishikawa .ishikawa-label.down {\n dominant-baseline: hanging;\n}\n`,"getStyles"),diagram={parser:ishikawa_default,get db(){return new IshikawaDB},renderer:renderer,styles:ishikawaStyles_default};export{diagram};