cc-viewer 1.7.8 → 1.7.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/{App-DtsIVPu6.js → App-shurMzn5.js} +2 -2
- package/dist/assets/{MdxEditorPanel-DWPAEnpm.js → MdxEditorPanel-BKAywPEt.js} +1 -1
- package/dist/assets/{Mobile-DHwMZG4N.js → Mobile-C05_paB4.js} +1 -1
- package/dist/assets/{ProxyStatsModal-D9lTz0-T.js → ProxyStatsModal-C9ENPPkE.js} +1 -1
- package/dist/assets/_baseUniq-aTokVjQN.js +1 -0
- package/dist/assets/arc-mxp8gSRQ.js +1 -0
- package/dist/assets/architectureDiagram-Q4EWVU46-msh8IODx.js +1 -0
- package/dist/assets/blockDiagram-DXYQGD6D-BUatNJTI.js +1 -0
- package/dist/assets/{c4Diagram-LMCZKHZV-C2QvkF2i.js → c4Diagram-AHTNJAMY-CJ92TNZe.js} +1 -1
- package/dist/assets/{channel-ClOiNc35.js → channel-CTM7CJrB.js} +1 -1
- package/dist/assets/{chunk-JWPE2WC7-D5RR93-U.js → chunk-4BX2VUAB-Bdv98T9c.js} +1 -1
- package/dist/assets/chunk-4TB4RGXK-DaIEuSP0.js +1 -0
- package/dist/assets/{chunk-XXDRQBXY-Blw-tThR.js → chunk-55IACEB6-Bi9130Nu.js} +1 -1
- package/dist/assets/{chunk-VR4S4FIN-BR0zG1Ep.js → chunk-EDXVE4YY-CZw-Vwwn.js} +1 -1
- package/dist/assets/{chunk-5VM5RSS4-CMJWLQsQ.js → chunk-FMBD7UC4-BBI7swjg.js} +1 -1
- package/dist/assets/chunk-OYMX7WX6-CHKotm_J.js +1 -0
- package/dist/assets/{chunk-2Q5K7J3B-BvZ7-Ft4.js → chunk-QZHKN3VN-ECW0McUe.js} +1 -1
- package/dist/assets/{chunk-32BRIVSS-Dg3PlJIt.js → chunk-YZCP3GAM-DLdAqU2z.js} +1 -1
- package/dist/assets/classDiagram-6PBFFD2Q-CkmfHfqf.js +1 -0
- package/dist/assets/classDiagram-v2-HSJHXN6E-CkmfHfqf.js +1 -0
- package/dist/assets/clone-pjnYCaC4.js +1 -0
- package/dist/assets/{cose-bilkent-JH36ORCC-BnDDyyuN.js → cose-bilkent-S5V4N54A-CfMuBnZy.js} +1 -1
- package/dist/assets/cytoscape.esm-CT1mZavR.js +9 -0
- package/dist/assets/dagre-KV5264BT-xxdATAWV.js +1 -0
- package/dist/assets/diagram-5BDNPKRD-s8izYXws.js +1 -0
- package/dist/assets/diagram-G4DWMVQ6-BaZWrq-d.js +1 -0
- package/dist/assets/diagram-MMDJMWI5-DlzU0RKB.js +1 -0
- package/dist/assets/diagram-TYMM5635-Fej8ir1x.js +1 -0
- package/dist/assets/erDiagram-SMLLAGMA-Bwg0_DNs.js +1 -0
- package/dist/assets/flowDiagram-DWJPFMVM-pJ8Bv6wt.js +1 -0
- package/dist/assets/{ganttDiagram-NO4QXBWP-_4nnZ3ta.js → ganttDiagram-T4ZO3ILL-DvgJ4Q6n.js} +1 -1
- package/dist/assets/gitGraphDiagram-UUTBAWPF-Du8KitZ0.js +1 -0
- package/dist/assets/graph-57Q-0mNG.js +1 -0
- package/dist/assets/{index-CPAQ767L.js → index-BOryMxum.js} +1 -1
- package/dist/assets/{index-DuUUHxox.js → index-Bt7QsK9T.js} +1 -1
- package/dist/assets/{index-BJ9Xm7_G.js → index-CVh-Zo2A.js} +1 -1
- package/dist/assets/{index-BiYKFU6w.js → index-Cf77lzSr.js} +1 -1
- package/dist/assets/{index-By8aqIvN.js → index-ClB3znal.js} +2 -2
- package/dist/assets/{index-7VeS_xrl.js → index-Cn0akK9k.js} +1 -1
- package/dist/assets/{index-CBix0zSu.js → index-EFFRo37G.js} +1 -1
- package/dist/assets/{index-_pxC-jz_.js → index-zljZK-NO.js} +1 -1
- package/dist/assets/infoDiagram-42DDH7IO-DZz6OAQe.js +1 -0
- package/dist/assets/{ishikawaDiagram-FXEZZL3T-DHHu_UGe.js → ishikawaDiagram-UXIWVN3A-Chrlpw73.js} +1 -1
- package/dist/assets/{journeyDiagram-5HDEW3XC-Bx06Sp3y.js → journeyDiagram-VCZTEJTY-D-fCEwg9.js} +1 -1
- package/dist/assets/{jszip.min-Bn5J9HN-.js → jszip.min-mU_-As7x.js} +1 -1
- package/dist/assets/{kanban-definition-HUTT4EX6-BuEuKkQp.js → kanban-definition-6JOO6SKY-DFdrm5t-.js} +1 -1
- package/dist/assets/layout-Dh-E01gA.js +1 -0
- package/dist/assets/{linear-BJRZNsdX.js → linear-BjXnK-6T.js} +1 -1
- package/dist/assets/mermaid.core-Cbqxn86C.js +7 -0
- package/dist/assets/min-B4n9eIGL.js +1 -0
- package/dist/assets/{mindmap-definition-LN4V7U3C-DYtgJ2f4.js → mindmap-definition-QFDTVHPH-Bw49x4oU.js} +1 -1
- package/dist/assets/pieDiagram-DEJITSTG-D-iq9rKK.js +1 -0
- package/dist/assets/quadrantDiagram-34T5L4WZ-QtFjo8i4.js +1 -0
- package/dist/assets/{requirementDiagram-TGXJPOKE-Cwb2FU3N.js → requirementDiagram-MS252O5E-BwmEZf4F.js} +1 -1
- package/dist/assets/sankeyDiagram-XADWPNL6-CTtXN32x.js +1 -0
- package/dist/assets/{seqResourceLoaders-C-pxCjNh.js → seqResourceLoaders-CYkWTxGA.js} +2 -2
- package/dist/assets/sequenceDiagram-FGHM5R23-DC00gRqs.js +1 -0
- package/dist/assets/stateDiagram-FHFEXIEX-CT963BWJ.js +1 -0
- package/dist/assets/stateDiagram-v2-QKLJ7IA2-1T7yDlvQ.js +1 -0
- package/dist/assets/{timeline-definition-FHXFAJF6-CK8MkCLz.js → timeline-definition-GMOUNBTQ-CDu66c9j.js} +1 -1
- package/dist/assets/{vendor-antd-DNUTLr77.js → vendor-antd-DADYo_zg.js} +3 -3
- package/dist/assets/{vendor-codemirror-6ck0hLRU.js → vendor-codemirror-tF6HNoR6.js} +1 -1
- package/dist/assets/vendor-markdown-DOJHsAxX.js +3 -0
- package/dist/assets/{vendor-mdxeditor-DT0rad22.js → vendor-mdxeditor-CFAmRN3Y.js} +2 -2
- package/dist/assets/{vendor-qrcode-CPmWG6hm.js → vendor-qrcode-DYKmbePy.js} +1 -1
- package/dist/assets/{vendor-virtuoso-YwK7i7L6.js → vendor-virtuoso-TxPxvPjL.js} +1 -1
- package/dist/assets/{vennDiagram-L72KCM5P-CWA2Gdi_.js → vennDiagram-DHZGUBPP-DSm6yR_C.js} +1 -1
- package/dist/assets/wardley-RL74JXVD-kFdCN4XL.js +1 -0
- package/dist/assets/wardleyDiagram-NUSXRM2D-BY1GQbCO.js +1 -0
- package/dist/assets/xychartDiagram-5P7HB3ND-ONnFdWbS.js +1 -0
- package/dist/index.html +4 -4
- package/findcc.js +7 -2
- package/package.json +1 -1
- package/dist/assets/abnfDiagram-VRR7QNED-9ax220Vv.js +0 -1
- package/dist/assets/arc-Cshrl52z.js +0 -1
- package/dist/assets/architectureDiagram-ZJ3FMSHR-QtERolgF.js +0 -1
- package/dist/assets/blockDiagram-677ZJIJ3-BaCd4R0Z.js +0 -1
- package/dist/assets/chunk-EX3LRPZG-CmoC-M2G.js +0 -1
- package/dist/assets/chunk-MOJQB5TN-JXgBLjCY.js +0 -1
- package/dist/assets/chunk-RYQCIY6F-gT-v276m.js +0 -1
- package/dist/assets/chunk-V7JOEXUC-Cl-E_fxl.js +0 -1
- package/dist/assets/classDiagram-OUVF2IWQ-ClkcbuHu.js +0 -1
- package/dist/assets/classDiagram-v2-EOCWNBFH-ClkcbuHu.js +0 -1
- package/dist/assets/cynefin-VYW2F7L2-Ch8_Ihra.js +0 -15
- package/dist/assets/cynefinDiagram-TSTJHNR4-CuX_xTSU.js +0 -1
- package/dist/assets/cytoscape.esm-D0POlJZ1.js +0 -9
- package/dist/assets/dagre-VKFMJZFB-DHDO7DUw.js +0 -1
- package/dist/assets/diagram-FQU43EPY-CxDVpL25.js +0 -1
- package/dist/assets/diagram-G47NLZAW-DHX7L6pT.js +0 -1
- package/dist/assets/diagram-NH7WQ7WH-HlwtIdWA.js +0 -1
- package/dist/assets/diagram-OA4YK3LP-BnTSu9CG.js +0 -1
- package/dist/assets/diagram-WEI45ONY-C712tBJk.js +0 -1
- package/dist/assets/ebnfDiagram-CCIWWBDH-DzMcH3cz.js +0 -1
- package/dist/assets/erDiagram-Q63AITRT-0fyhQG92.js +0 -1
- package/dist/assets/flowDiagram-23GEKE2U-lgfs10IO.js +0 -1
- package/dist/assets/gitGraphDiagram-IHSO6WYX-DrgEKJkZ.js +0 -1
- package/dist/assets/graph-CnJdn47S.js +0 -1
- package/dist/assets/infoDiagram-FWYZ7A6U-Cki8RIbq.js +0 -1
- package/dist/assets/layout-CCUE9ZRw.js +0 -1
- package/dist/assets/map-DQeg2hXV.js +0 -1
- package/dist/assets/mermaid.core-DH-sQJgr.js +0 -7
- package/dist/assets/pegDiagram-2B236MQR-BVN6OIEN.js +0 -1
- package/dist/assets/pieDiagram-ENE6RG2P-mVeQtQTD.js +0 -1
- package/dist/assets/quadrantDiagram-ABIIQ3AL-Croqf1qH.js +0 -1
- package/dist/assets/railroadDiagram-RFXS5EU6-jkGuNfMY.js +0 -1
- package/dist/assets/sankeyDiagram-HTMAVEWB-D-HWOuX0.js +0 -1
- package/dist/assets/sequenceDiagram-DBY2YBRQ-Bh3XgPxy.js +0 -1
- package/dist/assets/sizeCapture-X5ZJPWSS-C_acEkFf.js +0 -1
- package/dist/assets/stateDiagram-2N3HPSRC-CmbRj6R7.js +0 -1
- package/dist/assets/stateDiagram-v2-6OUMAXLB-ClrX-Ofc.js +0 -1
- package/dist/assets/swimlanes-5IMT3BWC-CIfoRrLM.js +0 -2
- package/dist/assets/swimlanesDiagram-G3AALYLV-DZuW0-dQ.js +0 -1
- package/dist/assets/vendor-markdown-DBlfs4dR.js +0 -3
- package/dist/assets/wardleyDiagram-EHGQE667-U22kgZ8v.js +0 -1
- package/dist/assets/xychartDiagram-FW5EYKEG-BiGsMUKC.js +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{I as ImperativeState}from"./chunk-2Q5K7J3B-BvZ7-Ft4.js";import{p as populateCommonDb}from"./chunk-JWPE2WC7-D5RR93-U.js";import{o as getDiagramTitle,n as setDiagramTitle,s as setAccDescription,g as getAccDescription,a as getAccTitle,b as setAccTitle,_ as __name,y as getConfig,l as log,d as select,c as getConfig2,x as utils_default,z as setupGraphViewbox2,p as clear,k as common_default,A as cleanAndMerge,B as defaultConfig_default,C as random}from"./mermaid.core-DH-sQJgr.js";import{p as parse}from"./cynefin-VYW2F7L2-Ch8_Ihra.js";import"./vendor-mdxeditor-DT0rad22.js";import"./vendor-antd-DNUTLr77.js";import"./vendor-codemirror-6ck0hLRU.js";import"./vendor-markdown-DBlfs4dR.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&¤tCommit.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 +0,0 @@
|
|
|
1
|
-
var freeGlobal="object"==typeof global&&global&&global.Object===Object&&global,freeSelf="object"==typeof self&&self&&self.Object===Object&&self,root=freeGlobal||freeSelf||Function("return this")(),Symbol$1=root.Symbol,objectProto$c=Object.prototype,hasOwnProperty$9=objectProto$c.hasOwnProperty,nativeObjectToString$1=objectProto$c.toString,symToStringTag$1=Symbol$1?Symbol$1.toStringTag:void 0;var nativeObjectToString=Object.prototype.toString;var symToStringTag=Symbol$1?Symbol$1.toStringTag:void 0;function baseGetTag(value){return null==value?void 0===value?"[object Undefined]":"[object Null]":symToStringTag&&symToStringTag in Object(value)?function(value){var isOwn=hasOwnProperty$9.call(value,symToStringTag$1),tag=value[symToStringTag$1];try{value[symToStringTag$1]=void 0;var unmasked=!0}catch(e){}var result=nativeObjectToString$1.call(value);return unmasked&&(isOwn?value[symToStringTag$1]=tag:delete value[symToStringTag$1]),result}(value):function(value){return nativeObjectToString.call(value)}(value)}function isObjectLike(value){return null!=value&&"object"==typeof value}function isSymbol(value){return"symbol"==typeof value||isObjectLike(value)&&"[object Symbol]"==baseGetTag(value)}function arrayMap(array,iteratee){for(var index=-1,length=null==array?0:array.length,result=Array(length);++index<length;)result[index]=iteratee(array[index],index,array);return result}var isArray=Array.isArray,symbolProto$1=Symbol$1?Symbol$1.prototype:void 0,symbolToString=symbolProto$1?symbolProto$1.toString:void 0;function baseToString(value){if("string"==typeof value)return value;if(isArray(value))return arrayMap(value,baseToString)+"";if(isSymbol(value))return symbolToString?symbolToString.call(value):"";var result=value+"";return"0"==result&&1/value==-1/0?"-0":result}function isObject(value){var type=typeof value;return null!=value&&("object"==type||"function"==type)}function identity(value){return value}function isFunction(value){if(!isObject(value))return!1;var tag=baseGetTag(value);return"[object Function]"==tag||"[object GeneratorFunction]"==tag||"[object AsyncFunction]"==tag||"[object Proxy]"==tag}var uid,coreJsData=root["__core-js_shared__"],maskSrcKey=(uid=/[^.]+$/.exec(coreJsData&&coreJsData.keys&&coreJsData.keys.IE_PROTO||""))?"Symbol(src)_1."+uid:"";var funcToString$1=Function.prototype.toString;function toSource(func){if(null!=func){try{return funcToString$1.call(func)}catch(e){}try{return func+""}catch(e){}}return""}var reIsHostCtor=/^\[object .+?Constructor\]$/,funcProto=Function.prototype,objectProto$a=Object.prototype,funcToString=funcProto.toString,hasOwnProperty$8=objectProto$a.hasOwnProperty,reIsNative=RegExp("^"+funcToString.call(hasOwnProperty$8).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function baseIsNative(value){return!(!isObject(value)||(func=value,maskSrcKey&&maskSrcKey in func))&&(isFunction(value)?reIsNative:reIsHostCtor).test(toSource(value));var func}function getNative(object,key){var value=function(object,key){return null==object?void 0:object[key]}(object,key);return baseIsNative(value)?value:void 0}var WeakMap=getNative(root,"WeakMap");var nativeNow=Date.now;function constant(value){return function(){return value}}var func,count,lastCalled,defineProperty=function(){try{var func=getNative(Object,"defineProperty");return func({},"",{}),func}catch(e){}}(),baseSetToString=defineProperty?function(func,string){return defineProperty(func,"toString",{configurable:!0,enumerable:!1,value:constant(string),writable:!0})}:identity,setToString=(func=baseSetToString,count=0,lastCalled=0,function(){var stamp=nativeNow(),remaining=16-(stamp-lastCalled);if(lastCalled=stamp,remaining>0){if(++count>=800)return arguments[0]}else count=0;return func.apply(void 0,arguments)});function arrayEach(array,iteratee){for(var index=-1,length=null==array?0:array.length;++index<length&&!1!==iteratee(array[index],index,array););return array}function baseFindIndex(array,predicate,fromIndex,fromRight){for(var length=array.length,index=fromIndex+-1;++index<length;)if(predicate(array[index],index,array))return index;return-1}function baseIsNaN(value){return value!=value}function arrayIncludes(array,value){return!!(null==array?0:array.length)&&function(array,value,fromIndex){return value==value?function(array,value,fromIndex){for(var index=fromIndex-1,length=array.length;++index<length;)if(array[index]===value)return index;return-1}(array,value,fromIndex):baseFindIndex(array,baseIsNaN,fromIndex)}(array,value,0)>-1}var reIsUint=/^(?:0|[1-9]\d*)$/;function isIndex(value,length){var type=typeof value;return!!(length=null==length?9007199254740991:length)&&("number"==type||"symbol"!=type&&reIsUint.test(value))&&value>-1&&value%1==0&&value<length}function eq(value,other){return value===other||value!=value&&other!=other}var nativeMax=Math.max;function overRest(func,start,transform){return start=nativeMax(void 0===start?func.length-1:start,0),function(){for(var args=arguments,index=-1,length=nativeMax(args.length-start,0),array=Array(length);++index<length;)array[index]=args[start+index];index=-1;for(var otherArgs=Array(start+1);++index<start;)otherArgs[index]=args[index];return otherArgs[start]=transform(array),function(func,thisArg,args){switch(args.length){case 0:return func.call(thisArg);case 1:return func.call(thisArg,args[0]);case 2:return func.call(thisArg,args[0],args[1]);case 3:return func.call(thisArg,args[0],args[1],args[2])}return func.apply(thisArg,args)}(func,this,otherArgs)}}function baseRest(func,start){return setToString(overRest(func,start,identity),func+"")}function isLength(value){return"number"==typeof value&&value>-1&&value%1==0&&value<=9007199254740991}function isArrayLike(value){return null!=value&&isLength(value.length)&&!isFunction(value)}var objectProto$9=Object.prototype;function isPrototype(value){var Ctor=value&&value.constructor;return value===("function"==typeof Ctor&&Ctor.prototype||objectProto$9)}function baseIsArguments(value){return isObjectLike(value)&&"[object Arguments]"==baseGetTag(value)}var objectProto$8=Object.prototype,hasOwnProperty$7=objectProto$8.hasOwnProperty,propertyIsEnumerable$1=objectProto$8.propertyIsEnumerable,isArguments=baseIsArguments(function(){return arguments}())?baseIsArguments:function(value){return isObjectLike(value)&&hasOwnProperty$7.call(value,"callee")&&!propertyIsEnumerable$1.call(value,"callee")};var freeExports$1="object"==typeof exports&&exports&&!exports.nodeType&&exports,freeModule$1=freeExports$1&&"object"==typeof module&&module&&!module.nodeType&&module,Buffer=freeModule$1&&freeModule$1.exports===freeExports$1?root.Buffer:void 0,isBuffer=(Buffer?Buffer.isBuffer:void 0)||function(){return!1},typedArrayTags={};function baseUnary(func){return function(value){return func(value)}}typedArrayTags["[object Float32Array]"]=typedArrayTags["[object Float64Array]"]=typedArrayTags["[object Int8Array]"]=typedArrayTags["[object Int16Array]"]=typedArrayTags["[object Int32Array]"]=typedArrayTags["[object Uint8Array]"]=typedArrayTags["[object Uint8ClampedArray]"]=typedArrayTags["[object Uint16Array]"]=typedArrayTags["[object Uint32Array]"]=!0,typedArrayTags["[object Arguments]"]=typedArrayTags["[object Array]"]=typedArrayTags["[object ArrayBuffer]"]=typedArrayTags["[object Boolean]"]=typedArrayTags["[object DataView]"]=typedArrayTags["[object Date]"]=typedArrayTags["[object Error]"]=typedArrayTags["[object Function]"]=typedArrayTags["[object Map]"]=typedArrayTags["[object Number]"]=typedArrayTags["[object Object]"]=typedArrayTags["[object RegExp]"]=typedArrayTags["[object Set]"]=typedArrayTags["[object String]"]=typedArrayTags["[object WeakMap]"]=!1;var freeExports="object"==typeof exports&&exports&&!exports.nodeType&&exports,freeModule=freeExports&&"object"==typeof module&&module&&!module.nodeType&&module,freeProcess=freeModule&&freeModule.exports===freeExports&&freeGlobal.process,nodeUtil=function(){try{var types=freeModule&&freeModule.require&&freeModule.require("util").types;return types||freeProcess&&freeProcess.binding&&freeProcess.binding("util")}catch(e){}}(),nodeIsTypedArray=nodeUtil&&nodeUtil.isTypedArray,isTypedArray=nodeIsTypedArray?baseUnary(nodeIsTypedArray):function(value){return isObjectLike(value)&&isLength(value.length)&&!!typedArrayTags[baseGetTag(value)]},hasOwnProperty$6=Object.prototype.hasOwnProperty;function arrayLikeKeys(value,inherited){var isArr=isArray(value),isArg=!isArr&&isArguments(value),isBuff=!isArr&&!isArg&&isBuffer(value),isType=!isArr&&!isArg&&!isBuff&&isTypedArray(value),skipIndexes=isArr||isArg||isBuff||isType,result=skipIndexes?function(n,iteratee){for(var index=-1,result=Array(n);++index<n;)result[index]=iteratee(index);return result}(value.length,String):[],length=result.length;for(var key in value)!inherited&&!hasOwnProperty$6.call(value,key)||skipIndexes&&("length"==key||isBuff&&("offset"==key||"parent"==key)||isType&&("buffer"==key||"byteLength"==key||"byteOffset"==key)||isIndex(key,length))||result.push(key);return result}function overArg(func,transform){return function(arg){return func(transform(arg))}}var nativeKeys=overArg(Object.keys,Object),hasOwnProperty$5=Object.prototype.hasOwnProperty;function baseKeys(object){if(!isPrototype(object))return nativeKeys(object);var result=[];for(var key in Object(object))hasOwnProperty$5.call(object,key)&&"constructor"!=key&&result.push(key);return result}function keys(object){return isArrayLike(object)?arrayLikeKeys(object):baseKeys(object)}var reIsDeepProp=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,reIsPlainProp=/^\w*$/;function isKey(value,object){if(isArray(value))return!1;var type=typeof value;return!("number"!=type&&"symbol"!=type&&"boolean"!=type&&null!=value&&!isSymbol(value))||(reIsPlainProp.test(value)||!reIsDeepProp.test(value)||null!=object&&value in Object(object))}var nativeCreate=getNative(Object,"create");var hasOwnProperty$4=Object.prototype.hasOwnProperty;var hasOwnProperty$3=Object.prototype.hasOwnProperty;function Hash(entries){var index=-1,length=null==entries?0:entries.length;for(this.clear();++index<length;){var entry=entries[index];this.set(entry[0],entry[1])}}function assocIndexOf(array,key){for(var length=array.length;length--;)if(eq(array[length][0],key))return length;return-1}Hash.prototype.clear=function(){this.__data__=nativeCreate?nativeCreate(null):{},this.size=0},Hash.prototype.delete=function(key){var result=this.has(key)&&delete this.__data__[key];return this.size-=result?1:0,result},Hash.prototype.get=function(key){var data=this.__data__;if(nativeCreate){var result=data[key];return"__lodash_hash_undefined__"===result?void 0:result}return hasOwnProperty$4.call(data,key)?data[key]:void 0},Hash.prototype.has=function(key){var data=this.__data__;return nativeCreate?void 0!==data[key]:hasOwnProperty$3.call(data,key)},Hash.prototype.set=function(key,value){var data=this.__data__;return this.size+=this.has(key)?0:1,data[key]=nativeCreate&&void 0===value?"__lodash_hash_undefined__":value,this};var splice=Array.prototype.splice;function ListCache(entries){var index=-1,length=null==entries?0:entries.length;for(this.clear();++index<length;){var entry=entries[index];this.set(entry[0],entry[1])}}ListCache.prototype.clear=function(){this.__data__=[],this.size=0},ListCache.prototype.delete=function(key){var data=this.__data__,index=assocIndexOf(data,key);return!(index<0)&&(index==data.length-1?data.pop():splice.call(data,index,1),--this.size,!0)},ListCache.prototype.get=function(key){var data=this.__data__,index=assocIndexOf(data,key);return index<0?void 0:data[index][1]},ListCache.prototype.has=function(key){return assocIndexOf(this.__data__,key)>-1},ListCache.prototype.set=function(key,value){var data=this.__data__,index=assocIndexOf(data,key);return index<0?(++this.size,data.push([key,value])):data[index][1]=value,this};var Map=getNative(root,"Map");function getMapData(map,key){var value,type,data=map.__data__;return("string"==(type=typeof(value=key))||"number"==type||"symbol"==type||"boolean"==type?"__proto__"!==value:null===value)?data["string"==typeof key?"string":"hash"]:data.map}function MapCache(entries){var index=-1,length=null==entries?0:entries.length;for(this.clear();++index<length;){var entry=entries[index];this.set(entry[0],entry[1])}}MapCache.prototype.clear=function(){this.size=0,this.__data__={hash:new Hash,map:new(Map||ListCache),string:new Hash}},MapCache.prototype.delete=function(key){var result=getMapData(this,key).delete(key);return this.size-=result?1:0,result},MapCache.prototype.get=function(key){return getMapData(this,key).get(key)},MapCache.prototype.has=function(key){return getMapData(this,key).has(key)},MapCache.prototype.set=function(key,value){var data=getMapData(this,key),size=data.size;return data.set(key,value),this.size+=data.size==size?0:1,this};function memoize(func,resolver){if("function"!=typeof func||null!=resolver&&"function"!=typeof resolver)throw new TypeError("Expected a function");var memoized=function(){var args=arguments,key=resolver?resolver.apply(this,args):args[0],cache=memoized.cache;if(cache.has(key))return cache.get(key);var result=func.apply(this,args);return memoized.cache=cache.set(key,result)||cache,result};return memoized.cache=new(memoize.Cache||MapCache),memoized}memoize.Cache=MapCache;var rePropName=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,reEscapeChar=/\\(\\)?/g,stringToPath=function(func){var result=memoize(func,function(key){return 500===cache.size&&cache.clear(),key}),cache=result.cache;return result}(function(string){var result=[];return 46===string.charCodeAt(0)&&result.push(""),string.replace(rePropName,function(match,number,quote,subString){result.push(quote?subString.replace(reEscapeChar,"$1"):number||match)}),result});function toString(value){return null==value?"":baseToString(value)}function castPath(value,object){return isArray(value)?value:isKey(value,object)?[value]:stringToPath(toString(value))}function toKey(value){if("string"==typeof value||isSymbol(value))return value;var result=value+"";return"0"==result&&1/value==-1/0?"-0":result}function baseGet(object,path){for(var index=0,length=(path=castPath(path,object)).length;null!=object&&index<length;)object=object[toKey(path[index++])];return index&&index==length?object:void 0}function arrayPush(array,values2){for(var index=-1,length=values2.length,offset=array.length;++index<length;)array[offset+index]=values2[index];return array}var spreadableSymbol=Symbol$1?Symbol$1.isConcatSpreadable:void 0;function isFlattenable(value){return isArray(value)||isArguments(value)||!!(spreadableSymbol&&value&&value[spreadableSymbol])}function baseFlatten(array,depth,predicate,isStrict,result){var index=-1,length=array.length;for(predicate||(predicate=isFlattenable),result||(result=[]);++index<length;){var value=array[index];predicate(value)?arrayPush(result,value):isStrict||(result[result.length]=value)}return result}function arrayReduce(array,iteratee,accumulator,initAccum){var index=-1,length=null==array?0:array.length;for(initAccum&&length&&(accumulator=array[++index]);++index<length;)accumulator=iteratee(accumulator,array[index],index,array);return accumulator}function Stack(entries){var data=this.__data__=new ListCache(entries);this.size=data.size}function arrayFilter(array,predicate){for(var index=-1,length=null==array?0:array.length,resIndex=0,result=[];++index<length;){var value=array[index];predicate(value,index,array)&&(result[resIndex++]=value)}return result}function stubArray(){return[]}Stack.prototype.clear=function(){this.__data__=new ListCache,this.size=0},Stack.prototype.delete=function(key){var data=this.__data__,result=data.delete(key);return this.size=data.size,result},Stack.prototype.get=function(key){return this.__data__.get(key)},Stack.prototype.has=function(key){return this.__data__.has(key)},Stack.prototype.set=function(key,value){var data=this.__data__;if(data instanceof ListCache){var pairs=data.__data__;if(!Map||pairs.length<199)return pairs.push([key,value]),this.size=++data.size,this;data=this.__data__=new MapCache(pairs)}return data.set(key,value),this.size=data.size,this};var propertyIsEnumerable=Object.prototype.propertyIsEnumerable,nativeGetSymbols=Object.getOwnPropertySymbols,getSymbols=nativeGetSymbols?function(object){return null==object?[]:(object=Object(object),arrayFilter(nativeGetSymbols(object),function(symbol){return propertyIsEnumerable.call(object,symbol)}))}:stubArray;function baseGetAllKeys(object,keysFunc,symbolsFunc){var result=keysFunc(object);return isArray(object)?result:arrayPush(result,symbolsFunc(object))}function getAllKeys(object){return baseGetAllKeys(object,keys,getSymbols)}var DataView=getNative(root,"DataView"),Promise$1=getNative(root,"Promise"),Set=getNative(root,"Set"),dataViewCtorString=toSource(DataView),mapCtorString=toSource(Map),promiseCtorString=toSource(Promise$1),setCtorString=toSource(Set),weakMapCtorString=toSource(WeakMap),getTag=baseGetTag;(DataView&&"[object DataView]"!=getTag(new DataView(new ArrayBuffer(1)))||Map&&"[object Map]"!=getTag(new Map)||Promise$1&&"[object Promise]"!=getTag(Promise$1.resolve())||Set&&"[object Set]"!=getTag(new Set)||WeakMap&&"[object WeakMap]"!=getTag(new WeakMap))&&(getTag=function(value){var result=baseGetTag(value),Ctor="[object Object]"==result?value.constructor:void 0,ctorString=Ctor?toSource(Ctor):"";if(ctorString)switch(ctorString){case dataViewCtorString:return"[object DataView]";case mapCtorString:return"[object Map]";case promiseCtorString:return"[object Promise]";case setCtorString:return"[object Set]";case weakMapCtorString:return"[object WeakMap]"}return result});var Uint8Array=root.Uint8Array;function SetCache(values2){var index=-1,length=null==values2?0:values2.length;for(this.__data__=new MapCache;++index<length;)this.add(values2[index])}function arraySome(array,predicate){for(var index=-1,length=null==array?0:array.length;++index<length;)if(predicate(array[index],index,array))return!0;return!1}function cacheHas(cache,key){return cache.has(key)}SetCache.prototype.add=SetCache.prototype.push=function(value){return this.__data__.set(value,"__lodash_hash_undefined__"),this},SetCache.prototype.has=function(value){return this.__data__.has(value)};function equalArrays(array,other,bitmask,customizer,equalFunc,stack){var isPartial=1&bitmask,arrLength=array.length,othLength=other.length;if(arrLength!=othLength&&!(isPartial&&othLength>arrLength))return!1;var arrStacked=stack.get(array),othStacked=stack.get(other);if(arrStacked&&othStacked)return arrStacked==other&&othStacked==array;var index=-1,result=!0,seen=2&bitmask?new SetCache:void 0;for(stack.set(array,other),stack.set(other,array);++index<arrLength;){var arrValue=array[index],othValue=other[index];if(customizer)var compared=isPartial?customizer(othValue,arrValue,index,other,array,stack):customizer(arrValue,othValue,index,array,other,stack);if(void 0!==compared){if(compared)continue;result=!1;break}if(seen){if(!arraySome(other,function(othValue2,othIndex){if(!cacheHas(seen,othIndex)&&(arrValue===othValue2||equalFunc(arrValue,othValue2,bitmask,customizer,stack)))return seen.push(othIndex)})){result=!1;break}}else if(arrValue!==othValue&&!equalFunc(arrValue,othValue,bitmask,customizer,stack)){result=!1;break}}return stack.delete(array),stack.delete(other),result}function mapToArray(map){var index=-1,result=Array(map.size);return map.forEach(function(value,key){result[++index]=[key,value]}),result}function setToArray(set){var index=-1,result=Array(set.size);return set.forEach(function(value){result[++index]=value}),result}var symbolProto=Symbol$1?Symbol$1.prototype:void 0,symbolValueOf=symbolProto?symbolProto.valueOf:void 0;var hasOwnProperty$2=Object.prototype.hasOwnProperty;var objectTag="[object Object]",hasOwnProperty$1=Object.prototype.hasOwnProperty;function baseIsEqualDeep(object,other,bitmask,customizer,equalFunc,stack){var objIsArr=isArray(object),othIsArr=isArray(other),objTag=objIsArr?"[object Array]":getTag(object),othTag=othIsArr?"[object Array]":getTag(other),objIsObj=(objTag="[object Arguments]"==objTag?objectTag:objTag)==objectTag,othIsObj=(othTag="[object Arguments]"==othTag?objectTag:othTag)==objectTag,isSameTag=objTag==othTag;if(isSameTag&&isBuffer(object)){if(!isBuffer(other))return!1;objIsArr=!0,objIsObj=!1}if(isSameTag&&!objIsObj)return stack||(stack=new Stack),objIsArr||isTypedArray(object)?equalArrays(object,other,bitmask,customizer,equalFunc,stack):function(object,other,tag,bitmask,customizer,equalFunc,stack){switch(tag){case"[object DataView]":if(object.byteLength!=other.byteLength||object.byteOffset!=other.byteOffset)return!1;object=object.buffer,other=other.buffer;case"[object ArrayBuffer]":return!(object.byteLength!=other.byteLength||!equalFunc(new Uint8Array(object),new Uint8Array(other)));case"[object Boolean]":case"[object Date]":case"[object Number]":return eq(+object,+other);case"[object Error]":return object.name==other.name&&object.message==other.message;case"[object RegExp]":case"[object String]":return object==other+"";case"[object Map]":var convert=mapToArray;case"[object Set]":var isPartial=1&bitmask;if(convert||(convert=setToArray),object.size!=other.size&&!isPartial)return!1;var stacked=stack.get(object);if(stacked)return stacked==other;bitmask|=2,stack.set(object,other);var result=equalArrays(convert(object),convert(other),bitmask,customizer,equalFunc,stack);return stack.delete(object),result;case"[object Symbol]":if(symbolValueOf)return symbolValueOf.call(object)==symbolValueOf.call(other)}return!1}(object,other,objTag,bitmask,customizer,equalFunc,stack);if(!(1&bitmask)){var objIsWrapped=objIsObj&&hasOwnProperty$1.call(object,"__wrapped__"),othIsWrapped=othIsObj&&hasOwnProperty$1.call(other,"__wrapped__");if(objIsWrapped||othIsWrapped){var objUnwrapped=objIsWrapped?object.value():object,othUnwrapped=othIsWrapped?other.value():other;return stack||(stack=new Stack),equalFunc(objUnwrapped,othUnwrapped,bitmask,customizer,stack)}}return!!isSameTag&&(stack||(stack=new Stack),function(object,other,bitmask,customizer,equalFunc,stack){var isPartial=1&bitmask,objProps=getAllKeys(object),objLength=objProps.length;if(objLength!=getAllKeys(other).length&&!isPartial)return!1;for(var index=objLength;index--;){var key=objProps[index];if(!(isPartial?key in other:hasOwnProperty$2.call(other,key)))return!1}var objStacked=stack.get(object),othStacked=stack.get(other);if(objStacked&&othStacked)return objStacked==other&&othStacked==object;var result=!0;stack.set(object,other),stack.set(other,object);for(var skipCtor=isPartial;++index<objLength;){var objValue=object[key=objProps[index]],othValue=other[key];if(customizer)var compared=isPartial?customizer(othValue,objValue,key,other,object,stack):customizer(objValue,othValue,key,object,other,stack);if(!(void 0===compared?objValue===othValue||equalFunc(objValue,othValue,bitmask,customizer,stack):compared)){result=!1;break}skipCtor||(skipCtor="constructor"==key)}if(result&&!skipCtor){var objCtor=object.constructor,othCtor=other.constructor;objCtor==othCtor||!("constructor"in object)||!("constructor"in other)||"function"==typeof objCtor&&objCtor instanceof objCtor&&"function"==typeof othCtor&&othCtor instanceof othCtor||(result=!1)}return stack.delete(object),stack.delete(other),result}(object,other,bitmask,customizer,equalFunc,stack))}function baseIsEqual(value,other,bitmask,customizer,stack){return value===other||(null==value||null==other||!isObjectLike(value)&&!isObjectLike(other)?value!=value&&other!=other:baseIsEqualDeep(value,other,bitmask,customizer,baseIsEqual,stack))}function isStrictComparable(value){return value==value&&!isObject(value)}function matchesStrictComparable(key,srcValue){return function(object){return null!=object&&(object[key]===srcValue&&(void 0!==srcValue||key in Object(object)))}}function baseMatches(source){var matchData=function(object){for(var result=keys(object),length=result.length;length--;){var key=result[length],value=object[key];result[length]=[key,value,isStrictComparable(value)]}return result}(source);return 1==matchData.length&&matchData[0][2]?matchesStrictComparable(matchData[0][0],matchData[0][1]):function(object){return object===source||function(object,source,matchData,customizer){var index=matchData.length,length=index;if(null==object)return!length;for(object=Object(object);index--;){var data=matchData[index];if(data[2]?data[1]!==object[data[0]]:!(data[0]in object))return!1}for(;++index<length;){var key=(data=matchData[index])[0],objValue=object[key],srcValue=data[1];if(data[2]){if(void 0===objValue&&!(key in object))return!1}else if(!baseIsEqual(srcValue,objValue,3,customizer,new Stack))return!1}return!0}(object,0,matchData)}}function baseHasIn(object,key){return null!=object&&key in Object(object)}function hasPath(object,path,hasFunc){for(var index=-1,length=(path=castPath(path,object)).length,result=!1;++index<length;){var key=toKey(path[index]);if(!(result=null!=object&&hasFunc(object,key)))break;object=object[key]}return result||++index!=length?result:!!(length=null==object?0:object.length)&&isLength(length)&&isIndex(key,length)&&(isArray(object)||isArguments(object))}function hasIn(object,path){return null!=object&&hasPath(object,path,baseHasIn)}function baseMatchesProperty(path,srcValue){return isKey(path)&&isStrictComparable(srcValue)?matchesStrictComparable(toKey(path),srcValue):function(object){var objValue=function(object,path,defaultValue){var result=null==object?void 0:baseGet(object,path);return void 0===result?defaultValue:result}(object,path);return void 0===objValue&&objValue===srcValue?hasIn(object,path):baseIsEqual(srcValue,objValue,3)}}function property(path){return isKey(path)?(key=toKey(path),function(object){return null==object?void 0:object[key]}):function(path){return function(object){return baseGet(object,path)}}(path);var key}function baseIteratee(value){return"function"==typeof value?value:null==value?identity:"object"==typeof value?isArray(value)?baseMatchesProperty(value[0],value[1]):baseMatches(value):property(value)}var baseFor=function(object,iteratee,keysFunc){for(var index=-1,iterable=Object(object),props=keysFunc(object),length=props.length;length--;){var key=props[++index];if(!1===iteratee(iterable[key],key,iterable))break}return object};function baseForOwn(object,iteratee){return object&&baseFor(object,iteratee,keys)}var eachFunc,baseEach=(eachFunc=baseForOwn,function(collection,iteratee){if(null==collection)return collection;if(!isArrayLike(collection))return eachFunc(collection,iteratee);for(var length=collection.length,index=-1,iterable=Object(collection);++index<length&&!1!==iteratee(iterable[index],index,iterable););return collection});function isArrayLikeObject(value){return isObjectLike(value)&&isArrayLike(value)}function castFunction(value){return"function"==typeof value?value:identity}function forEach(collection,iteratee){return(isArray(collection)?arrayEach:baseEach)(collection,castFunction(iteratee))}function baseFilter(collection,predicate){var result=[];return baseEach(collection,function(value,index,collection2){predicate(value,index,collection2)&&result.push(value)}),result}function filter(collection,predicate){return(isArray(collection)?arrayFilter:baseFilter)(collection,baseIteratee(predicate))}function values(object){return null==object?[]:function(object,props){return arrayMap(props,function(key){return object[key]})}(object,keys(object))}var hasOwnProperty=Object.prototype.hasOwnProperty;function isEmpty(value){if(null==value)return!0;if(isArrayLike(value)&&(isArray(value)||"string"==typeof value||"function"==typeof value.splice||isBuffer(value)||isTypedArray(value)||isArguments(value)))return!value.length;var tag=getTag(value);if("[object Map]"==tag||"[object Set]"==tag)return!value.size;if(isPrototype(value))return!baseKeys(value).length;for(var key in value)if(hasOwnProperty.call(value,key))return!1;return!0}function isUndefined(value){return void 0===value}function baseReduce(collection,iteratee,accumulator,initAccum,eachFunc){return eachFunc(collection,function(value,index,collection2){accumulator=initAccum?(initAccum=!1,value):iteratee(accumulator,value,index,collection2)}),accumulator}function reduce(collection,iteratee,accumulator){var func=isArray(collection)?arrayReduce:baseReduce,initAccum=arguments.length<3;return func(collection,baseIteratee(iteratee),accumulator,initAccum,baseEach)}var createSet=Set&&1/setToArray(new Set([,-0]))[1]==1/0?function(values2){return new Set(values2)}:function(){};var union=baseRest(function(arrays){return function(array,iteratee,comparator){var index=-1,includes=arrayIncludes,length=array.length,isCommon=!0,result=[],seen=result;if(length>=200){var set=createSet(array);if(set)return setToArray(set);isCommon=!1,includes=cacheHas,seen=new SetCache}else seen=result;outer:for(;++index<length;){var value=array[index],computed=value;if(value=0!==value?value:0,isCommon&&computed==computed){for(var seenIndex=seen.length;seenIndex--;)if(seen[seenIndex]===computed)continue outer;result.push(value)}else includes(seen,computed,comparator)||(seen!==result&&seen.push(computed),result.push(value))}return result}(baseFlatten(arrays,0,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 self2=this;return filter(this.nodes(),function(v){return isEmpty(self2._in[v])})}sinks(){var self2=this;return filter(this.nodes(),function(v){return isEmpty(self2._out[v])})}setNodes(vs,value){var args=arguments,self2=this;return forEach(vs,function(v){args.length>1?self2.setNode(v,value):self2.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 self2=this;forEach(this._nodes,function(value,v){filter2(v)&©.setNode(v,value)}),forEach(this._edgeObjs,function(e){copy.hasNode(e.v)&©.hasNode(e.w)&©.setEdge(e,self2.edge(e))});var parents={};function findParent(v){var parent=self2.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 self2=this,args=arguments;return reduce(vs,function(v,w){return args.length>1?self2.setEdge(v,w,value):self2.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{filter as $,isSymbol as A,isIndex as B,baseRest as C,baseFlatten as D,setToString as E,overRest as F,Graph as G,baseGetTag as H,isTypedArray as I,isArrayLikeObject as J,isArguments as K,isFunction as L,baseFor as M,baseFindIndex as N,castFunction as O,baseForOwn as P,hasPath as Q,identity as R,Symbol$1 as S,castPath as T,Uint8Array as U,toKey as V,baseGet as W,hasIn as X,toString as Y,forEach as Z,constant as _,isObject as a,values as a0,reduce as a1,isPrototype as b,isArrayLike as c,defineProperty as d,eq as e,arrayLikeKeys as f,getSymbols as g,arrayPush as h,isUndefined as i,baseGetAllKeys as j,keys as k,isObjectLike as l,getTag as m,baseUnary as n,overArg as o,nodeUtil as p,isBuffer as q,root as r,stubArray as s,Stack as t,arrayEach as u,isArray as v,getAllKeys as w,baseEach as x,baseIteratee as y,arrayMap as z};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{_ as __name,l as log,D as selectSvgElement,e as configureSvgSize}from"./mermaid.core-DH-sQJgr.js";import{p as parse}from"./cynefin-VYW2F7L2-Ch8_Ihra.js";import"./vendor-mdxeditor-DT0rad22.js";import"./vendor-antd-DNUTLr77.js";import"./vendor-codemirror-6ck0hLRU.js";import"./vendor-markdown-DBlfs4dR.js";var DEFAULT_INFO_DB_version="11.16.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 +0,0 @@
|
|
|
1
|
-
import{A as isSymbol,a as isObject,c as isArrayLike,B as isIndex,e as eq,C as baseRest,D as baseFlatten,E as setToString,F as overRest,l as isObjectLike,H as baseGetTag,q as isBuffer,I as isTypedArray,v as isArray,J as isArrayLikeObject,K as isArguments,L as isFunction,M as baseFor,t as Stack,y as baseIteratee,k as keys,N as baseFindIndex,O as castFunction,P as baseForOwn,Q as hasPath,R as identity,T as castPath,V as toKey,W as baseGet,z as arrayMap,n as baseUnary,X as hasIn,Y as toString,G as Graph,Z as forEach,_ as constant,i as isUndefined,$ as filter,a0 as values,a1 as reduce}from"./graph-CnJdn47S.js";import{g as getPrototype,b as baseClone,k as keysIn,a as baseAssignValue,c as copyObject,d as copyArray,e as cloneBuffer,f as cloneTypedArray,i as initCloneObject,h as assignValue,j as baseMap,m as map}from"./map-DQeg2hXV.js";var reWhitespace=/\s/;var reTrimStart=/^\s+/;function baseTrim(string){return string?string.slice(0,function(string){for(var index=string.length;index--&&reWhitespace.test(string.charAt(index)););return index}(string)+1).replace(reTrimStart,""):string}var reIsBadHex=/^[-+]0x[0-9a-f]+$/i,reIsBinary=/^0b[01]+$/i,reIsOctal=/^0o[0-7]+$/i,freeParseInt=parseInt;function toFinite(value){return value?Infinity===(value=function(value){if("number"==typeof value)return value;if(isSymbol(value))return NaN;if(isObject(value)){var other="function"==typeof value.valueOf?value.valueOf():value;value=isObject(other)?other+"":other}if("string"!=typeof value)return 0===value?value:+value;value=baseTrim(value);var isBinary=reIsBinary.test(value);return isBinary||reIsOctal.test(value)?freeParseInt(value.slice(2),isBinary?2:8):reIsBadHex.test(value)?NaN:+value}(value))||-Infinity===value?17976931348623157e292*(value<0?-1:1):value==value?value:0:0===value?value:0}function isIterateeCall(value,index,object){if(!isObject(object))return!1;var type=typeof index;return!!("number"==type?isArrayLike(object)&&isIndex(index,object.length):"string"==type&&index in object)&&eq(object[index],value)}function flatten(array){return(null==array?0:array.length)?baseFlatten(array):[]}var funcProto=Function.prototype,objectProto$2=Object.prototype,funcToString=funcProto.toString,hasOwnProperty$2=objectProto$2.hasOwnProperty,objectCtorString=funcToString.call(Object);function cloneDeep(value){return baseClone(value,5)}var objectProto$1=Object.prototype,hasOwnProperty$1=objectProto$1.hasOwnProperty,defaults=baseRest(function(object,sources){object=Object(object);var index=-1,length=sources.length,guard=length>2?sources[2]:void 0;for(guard&&isIterateeCall(sources[0],sources[1],guard)&&(length=1);++index<length;)for(var source=sources[index],props=keysIn(source),propsIndex=-1,propsLength=props.length;++propsIndex<propsLength;){var key=props[propsIndex],value=object[key];(void 0===value||eq(value,objectProto$1[key])&&!hasOwnProperty$1.call(object,key))&&(object[key]=source[key])}return object});function assignMergeValue(object,key,value){(void 0!==value&&!eq(object[key],value)||void 0===value&&!(key in object))&&baseAssignValue(object,key,value)}function safeGet(object,key){if(("constructor"!==key||"function"!=typeof object[key])&&"__proto__"!=key)return object[key]}function baseMergeDeep(object,source,key,srcIndex,mergeFunc,customizer,stack){var objValue=safeGet(object,key),srcValue=safeGet(source,key),stacked=stack.get(srcValue);if(stacked)assignMergeValue(object,key,stacked);else{var value,newValue=customizer?customizer(objValue,srcValue,key+"",object,source,stack):void 0,isCommon=void 0===newValue;if(isCommon){var isArr=isArray(srcValue),isBuff=!isArr&&isBuffer(srcValue),isTyped=!isArr&&!isBuff&&isTypedArray(srcValue);newValue=srcValue,isArr||isBuff||isTyped?isArray(objValue)?newValue=objValue:isArrayLikeObject(objValue)?newValue=copyArray(objValue):isBuff?(isCommon=!1,newValue=cloneBuffer(srcValue,!0)):isTyped?(isCommon=!1,newValue=cloneTypedArray(srcValue,!0)):newValue=[]:function(value){if(!isObjectLike(value)||"[object Object]"!=baseGetTag(value))return!1;var proto=getPrototype(value);if(null===proto)return!0;var Ctor=hasOwnProperty$2.call(proto,"constructor")&&proto.constructor;return"function"==typeof Ctor&&Ctor instanceof Ctor&&funcToString.call(Ctor)==objectCtorString}(srcValue)||isArguments(srcValue)?(newValue=objValue,isArguments(objValue)?newValue=copyObject(value=objValue,keysIn(value)):isObject(objValue)&&!isFunction(objValue)||(newValue=initCloneObject(srcValue))):isCommon=!1}isCommon&&(stack.set(srcValue,newValue),mergeFunc(newValue,srcValue,srcIndex,customizer,stack),stack.delete(srcValue)),assignMergeValue(object,key,newValue)}}function baseMerge(object,source,srcIndex,customizer,stack){object!==source&&baseFor(source,function(srcValue,key){if(stack||(stack=new Stack),isObject(srcValue))baseMergeDeep(object,source,key,srcIndex,baseMerge,customizer,stack);else{var newValue=customizer?customizer(safeGet(object,key),srcValue,key+"",object,source,stack):void 0;void 0===newValue&&(newValue=srcValue),assignMergeValue(object,key,newValue)}},keysIn)}function last(array){var length=null==array?0:array.length;return length?array[length-1]:void 0}var nativeMax$1=Math.max;var findIndexFunc,find=(findIndexFunc=function(array,predicate,fromIndex){var length=null==array?0:array.length;if(!length)return-1;var result,remainder,index=null==fromIndex?0:(result=toFinite(fromIndex),remainder=result%1,result==result?remainder?result-remainder:result:0);return index<0&&(index=nativeMax$1(length+index,0)),baseFindIndex(array,baseIteratee(predicate),index)},function(collection,predicate,fromIndex){var iterable=Object(collection);if(!isArrayLike(collection)){var iteratee=baseIteratee(predicate);collection=keys(collection),predicate=function(key){return iteratee(iterable[key],key,iterable)}}var index=findIndexFunc(collection,predicate,fromIndex);return index>-1?iterable[iteratee?collection[index]:index]:void 0});function baseGt(value,other){return value>other}var hasOwnProperty=Object.prototype.hasOwnProperty;function baseHas(object,key){return null!=object&&hasOwnProperty.call(object,key)}function has(object,path){return null!=object&&hasPath(object,path,baseHas)}function baseLt(value,other){return value<other}function mapValues(object,iteratee){var result={};return iteratee=baseIteratee(iteratee),baseForOwn(object,function(value,key,object2){baseAssignValue(result,key,iteratee(value,key,object2))}),result}function baseExtremum(array,iteratee,comparator){for(var index=-1,length=array.length;++index<length;){var value=array[index],current=iteratee(value);if(null!=current&&(void 0===computed?current==current&&!isSymbol(current):comparator(current,computed)))var computed=current,result=value}return result}function max(array){return array&&array.length?baseExtremum(array,identity,baseGt):void 0}var assigner,merge=(assigner=function(object,source,srcIndex){baseMerge(object,source,srcIndex)},baseRest(function(object,sources){var index=-1,length=sources.length,customizer=length>1?sources[length-1]:void 0,guard=length>2?sources[2]:void 0;for(customizer=assigner.length>3&&"function"==typeof customizer?(length--,customizer):void 0,guard&&isIterateeCall(sources[0],sources[1],guard)&&(customizer=length<3?void 0:customizer,length=1),object=Object(object);++index<length;){var source=sources[index];source&&assigner(object,source,index,customizer)}return object}));function min(array){return array&&array.length?baseExtremum(array,identity,baseLt):void 0}function minBy(array,iteratee){return array&&array.length?baseExtremum(array,baseIteratee(iteratee),baseLt):void 0}function baseSet(object,path,value,customizer){if(!isObject(object))return object;for(var index=-1,length=(path=castPath(path,object)).length,lastIndex=length-1,nested=object;null!=nested&&++index<length;){var key=toKey(path[index]),newValue=value;if("__proto__"===key||"constructor"===key||"prototype"===key)return object;if(index!=lastIndex){var objValue=nested[key];void 0===(newValue=void 0)&&(newValue=isObject(objValue)?objValue:isIndex(path[index+1])?[]:{})}assignValue(nested,key,newValue),nested=nested[key]}return object}function compareAscending(value,other){if(value!==other){var valIsDefined=void 0!==value,valIsNull=null===value,valIsReflexive=value==value,valIsSymbol=isSymbol(value),othIsDefined=void 0!==other,othIsNull=null===other,othIsReflexive=other==other,othIsSymbol=isSymbol(other);if(!othIsNull&&!othIsSymbol&&!valIsSymbol&&value>other||valIsSymbol&&othIsDefined&&othIsReflexive&&!othIsNull&&!othIsSymbol||valIsNull&&othIsDefined&&othIsReflexive||!valIsDefined&&othIsReflexive||!valIsReflexive)return 1;if(!valIsNull&&!valIsSymbol&&!othIsSymbol&&value<other||othIsSymbol&&valIsDefined&&valIsReflexive&&!valIsNull&&!valIsSymbol||othIsNull&&valIsDefined&&valIsReflexive||!othIsDefined&&valIsReflexive||!othIsReflexive)return-1}return 0}function baseOrderBy(collection,iteratees,orders){iteratees=iteratees.length?arrayMap(iteratees,function(iteratee){return isArray(iteratee)?function(value){return baseGet(value,1===iteratee.length?iteratee[0]:iteratee)}:iteratee}):[identity];var index=-1;return iteratees=arrayMap(iteratees,baseUnary(baseIteratee)),function(array,comparer){var length=array.length;for(array.sort(comparer);length--;)array[length]=array[length].value;return array}(baseMap(collection,function(value,key,collection2){return{criteria:arrayMap(iteratees,function(iteratee){return iteratee(value)}),index:++index,value:value}}),function(object,other){return function(object,other,orders){for(var index=-1,objCriteria=object.criteria,othCriteria=other.criteria,length=objCriteria.length,ordersLength=orders.length;++index<length;){var result=compareAscending(objCriteria[index],othCriteria[index]);if(result)return index>=ordersLength?result:result*("desc"==orders[index]?-1:1)}return object.index-other.index}(object,other,orders)})}function basePick(object,paths){return function(object,paths,predicate){for(var index=-1,length=paths.length,result={};++index<length;){var path=paths[index],value=baseGet(object,path);predicate(value,path)&&baseSet(result,castPath(path,object),value)}return result}(object,paths,function(value,path){return hasIn(object,path)})}var func,pick=setToString(overRest(func=function(object,paths){return null==object?{}:basePick(object,paths)},void 0,flatten),func+""),nativeCeil=Math.ceil,nativeMax=Math.max;var range=function(start,end,step){return step&&"number"!=typeof step&&isIterateeCall(start,end,step)&&(end=step=void 0),start=toFinite(start),void 0===end?(end=start,start=0):end=toFinite(end),function(start,end,step){for(var index=-1,length=nativeMax(nativeCeil((end-start)/(step||1)),0),result=Array(length);length--;)result[++index]=start,start+=step;return result}(start,end,step=void 0===step?start<end?1:-1:toFinite(step))},sortBy=baseRest(function(collection,iteratees){if(null==collection)return[];var length=iteratees.length;return length>1&&isIterateeCall(collection,iteratees[0],iteratees[1])?iteratees=[]:length>2&&isIterateeCall(iteratees[0],iteratees[1],iteratees[2])&&(iteratees=[iteratees[0]]),baseOrderBy(collection,baseFlatten(iteratees),[])}),idCounter=0;function uniqueId(prefix){var id=++idCounter;return toString(prefix)+id}class List{constructor(){var sentinel={};sentinel._next=sentinel._prev=sentinel,this._sentinel=sentinel}dequeue(){var sentinel=this._sentinel,entry=sentinel._prev;if(entry!==sentinel)return unlink(entry),entry}enqueue(entry){var sentinel=this._sentinel;entry._prev&&entry._next&&unlink(entry),entry._next=sentinel._next,sentinel._next._prev=entry,sentinel._next=entry,entry._prev=sentinel}toString(){for(var strs=[],sentinel=this._sentinel,curr=sentinel._prev;curr!==sentinel;)strs.push(JSON.stringify(curr,filterOutLinks)),curr=curr._prev;return"["+strs.join(", ")+"]"}}function unlink(entry){entry._prev._next=entry._next,entry._next._prev=entry._prev,delete entry._next,delete entry._prev}function filterOutLinks(k,v){if("_next"!==k&&"_prev"!==k)return v}var DEFAULT_WEIGHT_FN=constant(1);function greedyFAS(g,weightFn){if(g.nodeCount()<=1)return[];var state=function(g,weightFn){var fasGraph=new Graph,maxIn=0,maxOut=0;forEach(g.nodes(),function(v){fasGraph.setNode(v,{v:v,in:0,out:0})}),forEach(g.edges(),function(e){var prevWeight=fasGraph.edge(e.v,e.w)||0,weight=weightFn(e),edgeWeight=prevWeight+weight;fasGraph.setEdge(e.v,e.w,edgeWeight),maxOut=Math.max(maxOut,fasGraph.node(e.v).out+=weight),maxIn=Math.max(maxIn,fasGraph.node(e.w).in+=weight)});var buckets=range(maxOut+maxIn+3).map(function(){return new List}),zeroIdx=maxIn+1;return forEach(fasGraph.nodes(),function(v){assignBucket(buckets,zeroIdx,fasGraph.node(v))}),{graph:fasGraph,buckets:buckets,zeroIdx:zeroIdx}}(g,weightFn||DEFAULT_WEIGHT_FN),results=function(g,buckets,zeroIdx){var entry,results=[],sources=buckets[buckets.length-1],sinks=buckets[0];for(;g.nodeCount();){for(;entry=sinks.dequeue();)removeNode(g,buckets,zeroIdx,entry);for(;entry=sources.dequeue();)removeNode(g,buckets,zeroIdx,entry);if(g.nodeCount())for(var i=buckets.length-2;i>0;--i)if(entry=buckets[i].dequeue()){results=results.concat(removeNode(g,buckets,zeroIdx,entry,!0));break}}return results}(state.graph,state.buckets,state.zeroIdx);return flatten(map(results,function(e){return g.outEdges(e.v,e.w)}))}function removeNode(g,buckets,zeroIdx,entry,collectPredecessors){var results=collectPredecessors?[]:void 0;return forEach(g.inEdges(entry.v),function(edge){var weight=g.edge(edge),uEntry=g.node(edge.v);collectPredecessors&&results.push({v:edge.v,w:edge.w}),uEntry.out-=weight,assignBucket(buckets,zeroIdx,uEntry)}),forEach(g.outEdges(entry.v),function(edge){var weight=g.edge(edge),w=edge.w,wEntry=g.node(w);wEntry.in-=weight,assignBucket(buckets,zeroIdx,wEntry)}),g.removeNode(entry.v),results}function assignBucket(buckets,zeroIdx,entry){entry.out?entry.in?buckets[entry.out-entry.in+zeroIdx].enqueue(entry):buckets[buckets.length-1].enqueue(entry):buckets[0].enqueue(entry)}function run$2(g){var g2,fas="greedy"===g.graph().acyclicer?greedyFAS(g,(g2=g,function(e){return g2.edge(e).weight})):function(g){var fas=[],stack={},visited={};function dfs2(v){Object.prototype.hasOwnProperty.call(visited,v)||(visited[v]=!0,stack[v]=!0,forEach(g.outEdges(v),function(e){Object.prototype.hasOwnProperty.call(stack,e.w)?fas.push(e):dfs2(e.w)}),delete stack[v])}return forEach(g.nodes(),dfs2),fas}(g);forEach(fas,function(e){var label=g.edge(e);g.removeEdge(e),label.forwardName=e.name,label.reversed=!0,g.setEdge(e.w,e.v,label,uniqueId("rev"))})}function addDummyNode(g,type,attrs,name){var v;do{v=uniqueId(name)}while(g.hasNode(v));return attrs.dummy=type,g.setNode(v,attrs),v}function asNonCompoundGraph(g){var simplified=new Graph({multigraph:g.isMultigraph()}).setGraph(g.graph());return forEach(g.nodes(),function(v){g.children(v).length||simplified.setNode(v,g.node(v))}),forEach(g.edges(),function(e){simplified.setEdge(e,g.edge(e))}),simplified}function intersectRect(rect,point){var sx,sy,x=rect.x,y=rect.y,dx=point.x-x,dy=point.y-y,w=rect.width/2,h=rect.height/2;if(!dx&&!dy)throw new Error("Not possible to find intersection inside of the rectangle");return Math.abs(dy)*w>Math.abs(dx)*h?(dy<0&&(h=-h),sx=h*dx/dy,sy=h):(dx<0&&(w=-w),sx=w,sy=w*dy/dx),{x:x+sx,y:y+sy}}function buildLayerMatrix(g){var layering=map(range(maxRank(g)+1),function(){return[]});return forEach(g.nodes(),function(v){var node=g.node(v),rank2=node.rank;isUndefined(rank2)||(layering[rank2][node.order]=v)}),layering}function addBorderNode$1(g,prefix,rank2,order2){var node={width:0,height:0};return arguments.length>=4&&(node.rank=rank2,node.order=order2),addDummyNode(g,"border",node,prefix)}function maxRank(g){return max(map(g.nodes(),function(v){var rank2=g.node(v).rank;if(!isUndefined(rank2))return rank2}))}function notime(name,fn){return fn()}function addBorderNode(g,prop,prefix,sg,sgNode,rank2){var label={width:0,height:0,rank:rank2,borderType:prop},prev=sgNode[prop][rank2-1],curr=addDummyNode(g,"border",label,prefix);sgNode[prop][rank2]=curr,g.setParent(curr,sg),prev&&g.setEdge(prev,curr,{weight:1})}function undo$1(g){var rankDir=g.graph().rankdir.toLowerCase();"bt"!==rankDir&&"rl"!==rankDir||function(g){forEach(g.nodes(),function(v){reverseYOne(g.node(v))}),forEach(g.edges(),function(e){var edge=g.edge(e);forEach(edge.points,reverseYOne),Object.prototype.hasOwnProperty.call(edge,"y")&&reverseYOne(edge)})}(g),"lr"!==rankDir&&"rl"!==rankDir||(!function(g){forEach(g.nodes(),function(v){swapXYOne(g.node(v))}),forEach(g.edges(),function(e){var edge=g.edge(e);forEach(edge.points,swapXYOne),Object.prototype.hasOwnProperty.call(edge,"x")&&swapXYOne(edge)})}(g),swapWidthHeight(g))}function swapWidthHeight(g){forEach(g.nodes(),function(v){swapWidthHeightOne(g.node(v))}),forEach(g.edges(),function(e){swapWidthHeightOne(g.edge(e))})}function swapWidthHeightOne(attrs){var w=attrs.width;attrs.width=attrs.height,attrs.height=w}function reverseYOne(attrs){attrs.y=-attrs.y}function swapXYOne(attrs){var x=attrs.x;attrs.x=attrs.y,attrs.y=x}function run$1(g){g.graph().dummyChains=[],forEach(g.edges(),function(edge){!function(g,e){var v=e.v,vRank=g.node(v).rank,w=e.w,wRank=g.node(w).rank,name=e.name,edgeLabel=g.edge(e),labelRank=edgeLabel.labelRank;if(wRank===vRank+1)return;g.removeEdge(e);var dummy,i,attrs=void 0;for(i=0,++vRank;vRank<wRank;++i,++vRank)edgeLabel.points=[],dummy=addDummyNode(g,"edge",attrs={width:0,height:0,edgeLabel:edgeLabel,edgeObj:e,rank:vRank},"_d"),vRank===labelRank&&(attrs.width=edgeLabel.width,attrs.height=edgeLabel.height,attrs.dummy="edge-label",attrs.labelpos=edgeLabel.labelpos),g.setEdge(v,dummy,{weight:edgeLabel.weight},name),0===i&&g.graph().dummyChains.push(dummy),v=dummy;g.setEdge(v,w,{weight:edgeLabel.weight},name)}(g,edge)})}function longestPath(g){var visited={};forEach(g.sources(),function dfs2(v){var label=g.node(v);if(Object.prototype.hasOwnProperty.call(visited,v))return label.rank;visited[v]=!0;var rank2=min(map(g.outEdges(v),function(e){return dfs2(e.w)-g.edge(e).minlen}));return rank2!==Number.POSITIVE_INFINITY&&null!=rank2||(rank2=0),label.rank=rank2})}function slack(g,e){return g.node(e.w).rank-g.node(e.v).rank-g.edge(e).minlen}function feasibleTree(g){var edge,delta,t=new Graph({directed:!1}),start=g.nodes()[0],size=g.nodeCount();for(t.setNode(start,{});tightTree(t,g)<size;)edge=findMinSlackEdge(t,g),delta=t.hasNode(edge.v)?slack(g,edge):-slack(g,edge),shiftRanks(t,g,delta);return t}function tightTree(t,g){return forEach(t.nodes(),function dfs2(v){forEach(g.nodeEdges(v),function(e){var edgeV=e.v,w=v===edgeV?e.w:edgeV;t.hasNode(w)||slack(g,e)||(t.setNode(w,{}),t.setEdge(v,w,{}),dfs2(w))})}),t.nodeCount()}function findMinSlackEdge(t,g){return minBy(g.edges(),function(e){if(t.hasNode(e.v)!==t.hasNode(e.w))return slack(g,e)})}function shiftRanks(t,g,delta){forEach(t.nodes(),function(v){g.node(v).rank+=delta})}function dfs$1(g,vs,order2){isArray(vs)||(vs=[vs]);var navigation=(g.isDirected()?g.successors:g.neighbors).bind(g),acc=[],visited={};return forEach(vs,function(v){if(!g.hasNode(v))throw new Error("Graph does not have node: "+v);doDfs(g,v,"post"===order2,visited,navigation,acc)}),acc}function doDfs(g,v,postorder2,visited,navigation,acc){Object.prototype.hasOwnProperty.call(visited,v)||(visited[v]=!0,postorder2||acc.push(v),forEach(navigation(v),function(w){doDfs(g,w,postorder2,visited,navigation,acc)}),postorder2&&acc.push(v))}function networkSimplex(g){g=function(g){var simplified=(new Graph).setGraph(g.graph());return forEach(g.nodes(),function(v){simplified.setNode(v,g.node(v))}),forEach(g.edges(),function(e){var simpleLabel=simplified.edge(e.v,e.w)||{weight:0,minlen:1},label=g.edge(e);simplified.setEdge(e.v,e.w,{weight:simpleLabel.weight+label.weight,minlen:Math.max(simpleLabel.minlen,label.minlen)})}),simplified}(g),longestPath(g);var e,t=feasibleTree(g);for(initLowLimValues(t),initCutValues(t,g);e=leaveEdge(t);)exchangeEdges(t,g,e,enterEdge(t,g,e))}function initCutValues(t,g){var vs=function(g,vs){return dfs$1(g,vs,"post")}(t,t.nodes());vs=vs.slice(0,vs.length-1),forEach(vs,function(v){!function(t,g,child){var childLab=t.node(child),parent=childLab.parent;t.edge(child,parent).cutvalue=calcCutValue(t,g,child)}(t,g,v)})}function calcCutValue(t,g,child){var parent=t.node(child).parent,childIsTail=!0,graphEdge=g.edge(child,parent),cutValue=0;return graphEdge||(childIsTail=!1,graphEdge=g.edge(parent,child)),cutValue=graphEdge.weight,forEach(g.nodeEdges(child),function(e){var u,v,isOutEdge=e.v===child,other=isOutEdge?e.w:e.v;if(other!==parent){var pointsToHead=isOutEdge===childIsTail,otherWeight=g.edge(e).weight;if(cutValue+=pointsToHead?otherWeight:-otherWeight,u=child,v=other,t.hasEdge(u,v)){var otherCutValue=t.edge(child,other).cutvalue;cutValue+=pointsToHead?-otherCutValue:otherCutValue}}}),cutValue}function initLowLimValues(tree,root){arguments.length<2&&(root=tree.nodes()[0]),dfsAssignLowLim(tree,{},1,root)}function dfsAssignLowLim(tree,visited,nextLim,v,parent){var low=nextLim,label=tree.node(v);return visited[v]=!0,forEach(tree.neighbors(v),function(w){Object.prototype.hasOwnProperty.call(visited,w)||(nextLim=dfsAssignLowLim(tree,visited,nextLim,w,v))}),label.low=low,label.lim=nextLim++,parent?label.parent=parent:delete label.parent,nextLim}function leaveEdge(tree){return find(tree.edges(),function(e){return tree.edge(e).cutvalue<0})}function enterEdge(t,g,edge){var v=edge.v,w=edge.w;g.hasEdge(v,w)||(v=edge.w,w=edge.v);var vLabel=t.node(v),wLabel=t.node(w),tailLabel=vLabel,flip=!1;return vLabel.lim>wLabel.lim&&(tailLabel=wLabel,flip=!0),minBy(filter(g.edges(),function(edge2){return flip===isDescendant(t,t.node(edge2.v),tailLabel)&&flip!==isDescendant(t,t.node(edge2.w),tailLabel)}),function(edge2){return slack(g,edge2)})}function exchangeEdges(t,g,e,f){var v=e.v,w=e.w;t.removeEdge(v,w),t.setEdge(f.v,f.w,{}),initLowLimValues(t),initCutValues(t,g),function(t,g){var root=find(t.nodes(),function(v){return!g.node(v).parent}),vs=function(g,vs){return dfs$1(g,vs,"pre")}(t,root);vs=vs.slice(1),forEach(vs,function(v){var parent=t.node(v).parent,edge=g.edge(v,parent),flipped=!1;edge||(edge=g.edge(parent,v),flipped=!0),g.node(v).rank=g.node(parent).rank+(flipped?edge.minlen:-edge.minlen)})}(t,g)}function isDescendant(tree,vLabel,rootLabel){return rootLabel.low<=vLabel.lim&&vLabel.lim<=rootLabel.lim}function rank(g){switch(g.graph().ranker){case"network-simplex":default:networkSimplexRanker(g);break;case"tight-tree":!function(g){longestPath(g),feasibleTree(g)}(g);break;case"longest-path":longestPathRanker(g)}}new Error,networkSimplex.initLowLimValues=initLowLimValues,networkSimplex.initCutValues=initCutValues,networkSimplex.calcCutValue=calcCutValue,networkSimplex.leaveEdge=leaveEdge,networkSimplex.enterEdge=enterEdge,networkSimplex.exchangeEdges=exchangeEdges;var longestPathRanker=longestPath;function networkSimplexRanker(g){networkSimplex(g)}function run(g){var root=addDummyNode(g,"root",{},"_root"),depths=function(g){var depths={};function dfs2(v,depth){var children=g.children(v);children&&children.length&&forEach(children,function(child){dfs2(child,depth+1)}),depths[v]=depth}return forEach(g.children(),function(v){dfs2(v,1)}),depths}(g),height=max(values(depths))-1,nodeSep=2*height+1;g.graph().nestingRoot=root,forEach(g.edges(),function(e){g.edge(e).minlen*=nodeSep});var weight=function(g){return reduce(g.edges(),function(acc,e){return acc+g.edge(e).weight},0)}(g)+1;forEach(g.children(),function(child){dfs(g,root,nodeSep,weight,height,depths,child)}),g.graph().nodeRankFactor=nodeSep}function dfs(g,root,nodeSep,weight,height,depths,v){var children=g.children(v);if(children.length){var top=addBorderNode$1(g,"_bt"),bottom=addBorderNode$1(g,"_bb"),label=g.node(v);g.setParent(top,v),label.borderTop=top,g.setParent(bottom,v),label.borderBottom=bottom,forEach(children,function(child){dfs(g,root,nodeSep,weight,height,depths,child);var childNode=g.node(child),childTop=childNode.borderTop?childNode.borderTop:child,childBottom=childNode.borderBottom?childNode.borderBottom:child,thisWeight=childNode.borderTop?weight:2*weight,minlen=childTop!==childBottom?1:height-depths[v]+1;g.setEdge(top,childTop,{weight:thisWeight,minlen:minlen,nestingEdge:!0}),g.setEdge(childBottom,bottom,{weight:thisWeight,minlen:minlen,nestingEdge:!0})}),g.parent(v)||g.setEdge(root,top,{weight:0,minlen:height+depths[v]})}else v!==root&&g.setEdge(root,v,{weight:0,minlen:nodeSep})}function buildLayerGraph(g,rank2,relationship){var root=function(g){var v;for(;g.hasNode(v=uniqueId("_root")););return v}(g),result=new Graph({compound:!0}).setGraph({root:root}).setDefaultNodeLabel(function(v){return g.node(v)});return forEach(g.nodes(),function(v){var node=g.node(v),parent=g.parent(v);(node.rank===rank2||node.minRank<=rank2&&rank2<=node.maxRank)&&(result.setNode(v),result.setParent(v,parent||root),forEach(g[relationship](v),function(e){var u=e.v===v?e.w:e.v,edge=result.edge(u,v),weight=isUndefined(edge)?0:edge.weight;result.setEdge(u,v,{weight:g.edge(e).weight+weight})}),Object.prototype.hasOwnProperty.call(node,"minRank")&&result.setNode(v,{borderLeft:node.borderLeft[rank2],borderRight:node.borderRight[rank2]}))}),result}function crossCount(g,layering){for(var cc=0,i=1;i<layering.length;++i)cc+=twoLayerCrossCount(g,layering[i-1],layering[i]);return cc}function twoLayerCrossCount(g,northLayer,southLayer){for(var props,values2,southPos=(props=southLayer,values2=map(southLayer,function(v,i){return i}),function(props,values2,assignFunc){for(var index=-1,length=props.length,valsLength=values2.length,result={};++index<length;){var value=index<valsLength?values2[index]:void 0;assignFunc(result,props[index],value)}return result}(props||[],values2||[],assignValue)),southEntries=flatten(map(northLayer,function(v){return sortBy(map(g.outEdges(v),function(e){return{pos:southPos[e.w],weight:g.edge(e).weight}}),"pos")})),firstIndex=1;firstIndex<southLayer.length;)firstIndex<<=1;var treeSize=2*firstIndex-1;firstIndex-=1;var tree=map(new Array(treeSize),function(){return 0}),cc=0;return forEach(southEntries.forEach(function(entry){var index=entry.pos+firstIndex;tree[index]+=entry.weight;for(var weightSum=0;index>0;)index%2&&(weightSum+=tree[index+1]),tree[index=index-1>>1]+=entry.weight;cc+=entry.weight*weightSum})),cc}function resolveConflicts(entries,cg){var mappedEntries={};return forEach(entries,function(entry,i){var tmp=mappedEntries[entry.v]={indegree:0,in:[],out:[],vs:[entry.v],i:i};isUndefined(entry.barycenter)||(tmp.barycenter=entry.barycenter,tmp.weight=entry.weight)}),forEach(cg.edges(),function(e){var entryV=mappedEntries[e.v],entryW=mappedEntries[e.w];isUndefined(entryV)||isUndefined(entryW)||(entryW.indegree++,entryV.out.push(mappedEntries[e.w]))}),function(sourceSet){var entries=[];function handleIn(vEntry){return function(uEntry){uEntry.merged||(isUndefined(uEntry.barycenter)||isUndefined(vEntry.barycenter)||uEntry.barycenter>=vEntry.barycenter)&&function(target,source){var sum=0,weight=0;target.weight&&(sum+=target.barycenter*target.weight,weight+=target.weight);source.weight&&(sum+=source.barycenter*source.weight,weight+=source.weight);target.vs=source.vs.concat(target.vs),target.barycenter=sum/weight,target.weight=weight,target.i=Math.min(source.i,target.i),source.merged=!0}(vEntry,uEntry)}}function handleOut(vEntry){return function(wEntry){wEntry.in.push(vEntry),0===--wEntry.indegree&&sourceSet.push(wEntry)}}for(;sourceSet.length;){var entry=sourceSet.pop();entries.push(entry),forEach(entry.in.reverse(),handleIn(entry)),forEach(entry.out,handleOut(entry))}return map(filter(entries,function(entry2){return!entry2.merged}),function(entry2){return pick(entry2,["vs","i","barycenter","weight"])})}(filter(mappedEntries,function(entry){return!entry.indegree}))}function sort(entries,biasRight){var bias,parts=function(collection,fn){var result={lhs:[],rhs:[]};return forEach(collection,function(value){fn(value)?result.lhs.push(value):result.rhs.push(value)}),result}(entries,function(entry){return Object.prototype.hasOwnProperty.call(entry,"barycenter")}),sortable=parts.lhs,unsortable=sortBy(parts.rhs,function(entry){return-entry.i}),vs=[],sum=0,weight=0,vsIndex=0;sortable.sort((bias=!!biasRight,function(entryV,entryW){return entryV.barycenter<entryW.barycenter?-1:entryV.barycenter>entryW.barycenter?1:bias?entryW.i-entryV.i:entryV.i-entryW.i})),vsIndex=consumeUnsortable(vs,unsortable,vsIndex),forEach(sortable,function(entry){vsIndex+=entry.vs.length,vs.push(entry.vs),sum+=entry.barycenter*entry.weight,weight+=entry.weight,vsIndex=consumeUnsortable(vs,unsortable,vsIndex)});var result={vs:flatten(vs)};return weight&&(result.barycenter=sum/weight,result.weight=weight),result}function consumeUnsortable(vs,unsortable,index){for(var last$1;unsortable.length&&(last$1=last(unsortable)).i<=index;)unsortable.pop(),vs.push(last$1.vs),index++;return index}function sortSubgraph(g,v,cg,biasRight){var movable=g.children(v),node=g.node(v),bl=node?node.borderLeft:void 0,br=node?node.borderRight:void 0,subgraphs={};bl&&(movable=filter(movable,function(w){return w!==bl&&w!==br}));var barycenters=function(g,movable){return map(movable,function(v){var inV=g.inEdges(v);if(inV.length){var result=reduce(inV,function(acc,e){var edge=g.edge(e),nodeU=g.node(e.v);return{sum:acc.sum+edge.weight*nodeU.order,weight:acc.weight+edge.weight}},{sum:0,weight:0});return{v:v,barycenter:result.sum/result.weight,weight:result.weight}}return{v:v}})}(g,movable);forEach(barycenters,function(entry){if(g.children(entry.v).length){var subgraphResult=sortSubgraph(g,entry.v,cg,biasRight);subgraphs[entry.v]=subgraphResult,Object.prototype.hasOwnProperty.call(subgraphResult,"barycenter")&&(other=subgraphResult,isUndefined((target=entry).barycenter)?(target.barycenter=other.barycenter,target.weight=other.weight):(target.barycenter=(target.barycenter*target.weight+other.barycenter*other.weight)/(target.weight+other.weight),target.weight+=other.weight))}var target,other});var entries=resolveConflicts(barycenters,cg);!function(entries,subgraphs){forEach(entries,function(entry){entry.vs=flatten(entry.vs.map(function(v){return subgraphs[v]?subgraphs[v].vs:v}))})}(entries,subgraphs);var result=sort(entries,biasRight);if(bl&&(result.vs=flatten([bl,result.vs,br]),g.predecessors(bl).length)){var blPred=g.node(g.predecessors(bl)[0]),brPred=g.node(g.predecessors(br)[0]);Object.prototype.hasOwnProperty.call(result,"barycenter")||(result.barycenter=0,result.weight=0),result.barycenter=(result.barycenter*result.weight+blPred.order+brPred.order)/(result.weight+2),result.weight+=2}return result}function order(g){var maxRank$1=maxRank(g),downLayerGraphs=buildLayerGraphs(g,range(1,maxRank$1+1),"inEdges"),upLayerGraphs=buildLayerGraphs(g,range(maxRank$1-1,-1,-1),"outEdges"),layering=function(g){var visited={},simpleNodes=filter(g.nodes(),function(v){return!g.children(v).length}),maxRank2=max(map(simpleNodes,function(v){return g.node(v).rank})),layers=map(range(maxRank2+1),function(){return[]}),orderedVs=sortBy(simpleNodes,function(v){return g.node(v).rank});return forEach(orderedVs,function dfs2(v){if(!has(visited,v)){visited[v]=!0;var node=g.node(v);layers[node.rank].push(v),forEach(g.successors(v),dfs2)}}),layers}(g);assignOrder(g,layering);for(var best,bestCC=Number.POSITIVE_INFINITY,i=0,lastBest=0;lastBest<4;++i,++lastBest){sweepLayerGraphs(i%2?downLayerGraphs:upLayerGraphs,i%4>=2);var cc=crossCount(g,layering=buildLayerMatrix(g));cc<bestCC&&(lastBest=0,best=cloneDeep(layering),bestCC=cc)}assignOrder(g,best)}function buildLayerGraphs(g,ranks,relationship){return map(ranks,function(rank2){return buildLayerGraph(g,rank2,relationship)})}function sweepLayerGraphs(layerGraphs,biasRight){var cg=new Graph;forEach(layerGraphs,function(lg){var root=lg.graph().root,sorted=sortSubgraph(lg,root,cg,biasRight);forEach(sorted.vs,function(v,i){lg.node(v).order=i}),function(g,cg,vs){var rootPrev,prev={};forEach(vs,function(v){for(var parent,prevChild,child=g.parent(v);child;){if((parent=g.parent(child))?(prevChild=prev[parent],prev[parent]=child):(prevChild=rootPrev,rootPrev=child),prevChild&&prevChild!==child)return void cg.setEdge(prevChild,child);child=parent}})}(lg,cg,sorted.vs)})}function assignOrder(g,layering){forEach(layering,function(layer){forEach(layer,function(v,i){g.node(v).order=i})})}function parentDummyChains(g){var postorderNums=function(g){var result={},lim=0;function dfs2(v){var low=lim;forEach(g.children(v),dfs2),result[v]={low:low,lim:lim++}}return forEach(g.children(),dfs2),result}(g);forEach(g.graph().dummyChains,function(v){for(var node=g.node(v),edgeObj=node.edgeObj,pathData=function(g,postorderNums,v,w){var parent,lca,vPath=[],wPath=[],low=Math.min(postorderNums[v].low,postorderNums[w].low),lim=Math.max(postorderNums[v].lim,postorderNums[w].lim);parent=v;do{parent=g.parent(parent),vPath.push(parent)}while(parent&&(postorderNums[parent].low>low||lim>postorderNums[parent].lim));lca=parent,parent=w;for(;(parent=g.parent(parent))!==lca;)wPath.push(parent);return{path:vPath.concat(wPath.reverse()),lca:lca}}(g,postorderNums,edgeObj.v,edgeObj.w),path=pathData.path,lca=pathData.lca,pathIdx=0,pathV=path[pathIdx],ascending=!0;v!==edgeObj.w;){if(node=g.node(v),ascending){for(;(pathV=path[pathIdx])!==lca&&g.node(pathV).maxRank<node.rank;)pathIdx++;pathV===lca&&(ascending=!1)}if(!ascending){for(;pathIdx<path.length-1&&g.node(pathV=path[pathIdx+1]).minRank<=node.rank;)pathIdx++;pathV=path[pathIdx]}g.setParent(v,pathV),v=g.successors(v)[0]}})}function findType1Conflicts(g,layering){var conflicts={};return reduce(layering,function(prevLayer,layer){var k0=0,scanPos=0,prevLayerLength=prevLayer.length,lastNode=last(layer);return forEach(layer,function(v,i){var w=function(g,v){if(g.node(v).dummy)return find(g.predecessors(v),function(u){return g.node(u).dummy})}(g,v),k1=w?g.node(w).order:prevLayerLength;(w||v===lastNode)&&(forEach(layer.slice(scanPos,i+1),function(scanNode){forEach(g.predecessors(scanNode),function(u){var uLabel=g.node(u),uPos=uLabel.order;!(uPos<k0||k1<uPos)||uLabel.dummy&&g.node(scanNode).dummy||addConflict(conflicts,u,scanNode)})}),scanPos=i+1,k0=k1)}),layer}),conflicts}function addConflict(conflicts,v,w){if(v>w){var tmp=v;v=w,w=tmp}Object.prototype.hasOwnProperty.call(conflicts,v)||Object.defineProperty(conflicts,v,{enumerable:!0,configurable:!0,value:{},writable:!0});var conflictsV=conflicts[v];Object.defineProperty(conflictsV,w,{enumerable:!0,configurable:!0,value:!0,writable:!0})}function hasConflict(conflicts,v,w){if(v>w){var tmp=v;v=w,w=tmp}return!!conflicts[v]&&Object.prototype.hasOwnProperty.call(conflicts[v],w)}function horizontalCompaction(g,layering,root,align,reverseSep){var xs={},blockG=function(g,layering,root,reverseSep){var blockGraph=new Graph,graphLabel=g.graph(),sepFn=function(nodeSep,edgeSep,reverseSep){return function(g,v,w){var delta,vLabel=g.node(v),wLabel=g.node(w),sum=0;if(sum+=vLabel.width/2,Object.prototype.hasOwnProperty.call(vLabel,"labelpos"))switch(vLabel.labelpos.toLowerCase()){case"l":delta=-vLabel.width/2;break;case"r":delta=vLabel.width/2}if(delta&&(sum+=reverseSep?delta:-delta),delta=0,sum+=(vLabel.dummy?edgeSep:nodeSep)/2,sum+=(wLabel.dummy?edgeSep:nodeSep)/2,sum+=wLabel.width/2,Object.prototype.hasOwnProperty.call(wLabel,"labelpos"))switch(wLabel.labelpos.toLowerCase()){case"l":delta=wLabel.width/2;break;case"r":delta=-wLabel.width/2}return delta&&(sum+=reverseSep?delta:-delta),delta=0,sum}}(graphLabel.nodesep,graphLabel.edgesep,reverseSep);return forEach(layering,function(layer){var u;forEach(layer,function(v){var vRoot=root[v];if(blockGraph.setNode(vRoot),u){var uRoot=root[u],prevMax=blockGraph.edge(uRoot,vRoot);blockGraph.setEdge(uRoot,vRoot,Math.max(sepFn(g,v,u),prevMax||0))}u=v})}),blockGraph}(g,layering,root,reverseSep),borderType=reverseSep?"borderLeft":"borderRight";function iterate(setXsFunc,nextNodesFunc){for(var stack=blockG.nodes(),elem=stack.pop(),visited={};elem;)visited[elem]?setXsFunc(elem):(visited[elem]=!0,stack.push(elem),stack=stack.concat(nextNodesFunc(elem))),elem=stack.pop()}return iterate(function(elem){xs[elem]=blockG.inEdges(elem).reduce(function(acc,e){return Math.max(acc,xs[e.v]+blockG.edge(e))},0)},blockG.predecessors.bind(blockG)),iterate(function(elem){var min2=blockG.outEdges(elem).reduce(function(acc,e){return Math.min(acc,xs[e.w]-blockG.edge(e))},Number.POSITIVE_INFINITY),node=g.node(elem);min2!==Number.POSITIVE_INFINITY&&node.borderType!==borderType&&(xs[elem]=Math.max(xs[elem],min2))},blockG.successors.bind(blockG)),forEach(align,function(v){xs[v]=xs[root[v]]}),xs}function findSmallestWidthAlignment(g,xss){return minBy(values(xss),function(xs){var object,iteratee,max2=Number.NEGATIVE_INFINITY,min2=Number.POSITIVE_INFINITY;return iteratee=function(x,v){var halfWidth=function(g,v){return g.node(v).width}(g,v)/2;max2=Math.max(x+halfWidth,max2),min2=Math.min(x-halfWidth,min2)},null==(object=xs)||baseFor(object,castFunction(iteratee),keysIn),max2-min2})}function positionX(g){var adjustedLayering,layering=buildLayerMatrix(g),conflicts=merge(findType1Conflicts(g,layering),function(g,layering){var conflicts={};function scan(south,southPos,southEnd,prevNorthBorder,nextNorthBorder){var v;forEach(range(southPos,southEnd),function(i){v=south[i],g.node(v).dummy&&forEach(g.predecessors(v),function(u){var uNode=g.node(u);uNode.dummy&&(uNode.order<prevNorthBorder||uNode.order>nextNorthBorder)&&addConflict(conflicts,u,v)})})}return reduce(layering,function(north,south){var nextNorthPos,prevNorthPos=-1,southPos=0;return forEach(south,function(v,southLookahead){if("border"===g.node(v).dummy){var predecessors=g.predecessors(v);predecessors.length&&(nextNorthPos=g.node(predecessors[0]).order,scan(south,southPos,southLookahead,prevNorthPos,nextNorthPos),southPos=southLookahead,prevNorthPos=nextNorthPos)}scan(south,southPos,south.length,nextNorthPos,north.length)}),south}),conflicts}(g,layering)),xss={};forEach(["u","d"],function(vert){adjustedLayering="u"===vert?layering:values(layering).reverse(),forEach(["l","r"],function(horiz){"r"===horiz&&(adjustedLayering=map(adjustedLayering,function(inner){return values(inner).reverse()}));var neighborFn=("u"===vert?g.predecessors:g.successors).bind(g),align=function(g,layering,conflicts,neighborFn){var root={},align={},pos={};return forEach(layering,function(layer){forEach(layer,function(v,order2){root[v]=v,align[v]=v,pos[v]=order2})}),forEach(layering,function(layer){var prevIdx=-1;forEach(layer,function(v){var ws=neighborFn(v);if(ws.length)for(var mp=((ws=sortBy(ws,function(w2){return pos[w2]})).length-1)/2,i=Math.floor(mp),il=Math.ceil(mp);i<=il;++i){var w=ws[i];align[v]===v&&prevIdx<pos[w]&&!hasConflict(conflicts,v,w)&&(align[w]=v,align[v]=root[v]=root[w],prevIdx=pos[w])}})}),{root:root,align:align}}(0,adjustedLayering,conflicts,neighborFn),xs=horizontalCompaction(g,adjustedLayering,align.root,align.align,"r"===horiz);"r"===horiz&&(xs=mapValues(xs,function(x){return-x})),xss[vert+horiz]=xs})});var smallestWidth=findSmallestWidthAlignment(g,xss);return function(xss,alignTo){var alignToVals=values(alignTo),alignToMin=min(alignToVals),alignToMax=max(alignToVals);forEach(["u","d"],function(vert){forEach(["l","r"],function(horiz){var delta,alignment=vert+horiz,xs=xss[alignment];if(xs!==alignTo){var xsVals=values(xs);(delta="l"===horiz?alignToMin-min(xsVals):alignToMax-max(xsVals))&&(xss[alignment]=mapValues(xs,function(x){return x+delta}))}})})}(xss,smallestWidth),function(xss,align){return mapValues(xss.ul,function(ignore,v){if(align)return xss[align.toLowerCase()][v];var xs=sortBy(map(xss,v));return(xs[1]+xs[2])/2})}(xss,g.graph().align)}function position(g){var object,iteratee;(function(g){var layering=buildLayerMatrix(g),rankSep=g.graph().ranksep,prevY=0;forEach(layering,function(layer){var maxHeight=max(map(layer,function(v){return g.node(v).height}));forEach(layer,function(v){g.node(v).y=prevY+maxHeight/2}),prevY+=maxHeight+rankSep})})(g=asNonCompoundGraph(g)),object=positionX(g),iteratee=function(x,v){g.node(v).x=x},object&&baseForOwn(object,castFunction(iteratee))}function layout(g,opts){var time=notime;time("layout",()=>{var layoutGraph=time(" buildLayoutGraph",()=>function(inputGraph){var g=new Graph({multigraph:!0,compound:!0}),graph=canonicalize(inputGraph.graph());return g.setGraph(merge({},graphDefaults,selectNumberAttrs(graph,graphNumAttrs),pick(graph,graphAttrs))),forEach(inputGraph.nodes(),function(v){var node=canonicalize(inputGraph.node(v));g.setNode(v,defaults(selectNumberAttrs(node,nodeNumAttrs),nodeDefaults)),g.setParent(v,inputGraph.parent(v))}),forEach(inputGraph.edges(),function(e){var edge=canonicalize(inputGraph.edge(e));g.setEdge(e,merge({},edgeDefaults,selectNumberAttrs(edge,edgeNumAttrs),pick(edge,edgeAttrs)))}),g}(g));time(" runLayout",()=>function(g,time){time(" makeSpaceForEdgeLabels",()=>function(g){var graph=g.graph();graph.ranksep/=2,forEach(g.edges(),function(e){var edge=g.edge(e);edge.minlen*=2,"c"!==edge.labelpos.toLowerCase()&&("TB"===graph.rankdir||"BT"===graph.rankdir?edge.width+=edge.labeloffset:edge.height+=edge.labeloffset)})}(g)),time(" removeSelfEdges",()=>function(g){forEach(g.edges(),function(e){if(e.v===e.w){var node=g.node(e.v);node.selfEdges||(node.selfEdges=[]),node.selfEdges.push({e:e,label:g.edge(e)}),g.removeEdge(e)}})}(g)),time(" acyclic",()=>run$2(g)),time(" nestingGraph.run",()=>run(g)),time(" rank",()=>rank(asNonCompoundGraph(g))),time(" injectEdgeLabelProxies",()=>function(g){forEach(g.edges(),function(e){var edge=g.edge(e);if(edge.width&&edge.height){var v=g.node(e.v),label={rank:(g.node(e.w).rank-v.rank)/2+v.rank,e:e};addDummyNode(g,"edge-proxy",label,"_ep")}})}(g)),time(" removeEmptyRanks",()=>function(g){var offset=min(map(g.nodes(),function(v){return g.node(v).rank})),layers=[];forEach(g.nodes(),function(v){var rank2=g.node(v).rank-offset;layers[rank2]||(layers[rank2]=[]),layers[rank2].push(v)});var delta=0,nodeRankFactor=g.graph().nodeRankFactor;forEach(layers,function(vs,i){isUndefined(vs)&&i%nodeRankFactor!==0?--delta:delta&&forEach(vs,function(v){g.node(v).rank+=delta})})}(g)),time(" nestingGraph.cleanup",()=>function(g){var graphLabel=g.graph();g.removeNode(graphLabel.nestingRoot),delete graphLabel.nestingRoot,forEach(g.edges(),function(e){g.edge(e).nestingEdge&&g.removeEdge(e)})}(g)),time(" normalizeRanks",()=>function(g){var min$1=min(map(g.nodes(),function(v){return g.node(v).rank}));forEach(g.nodes(),function(v){var node=g.node(v);has(node,"rank")&&(node.rank-=min$1)})}(g)),time(" assignRankMinMax",()=>function(g){var maxRank2=0;forEach(g.nodes(),function(v){var node=g.node(v);node.borderTop&&(node.minRank=g.node(node.borderTop).rank,node.maxRank=g.node(node.borderBottom).rank,maxRank2=max(maxRank2,node.maxRank))}),g.graph().maxRank=maxRank2}(g)),time(" removeEdgeLabelProxies",()=>function(g){forEach(g.nodes(),function(v){var node=g.node(v);"edge-proxy"===node.dummy&&(g.edge(node.e).labelRank=node.rank,g.removeNode(v))})}(g)),time(" normalize.run",()=>run$1(g)),time(" parentDummyChains",()=>parentDummyChains(g)),time(" addBorderSegments",()=>function(g){forEach(g.children(),function dfs2(v){var children=g.children(v),node=g.node(v);if(children.length&&forEach(children,dfs2),Object.prototype.hasOwnProperty.call(node,"minRank")){node.borderLeft=[],node.borderRight=[];for(var rank2=node.minRank,maxRank2=node.maxRank+1;rank2<maxRank2;++rank2)addBorderNode(g,"borderLeft","_bl",v,node,rank2),addBorderNode(g,"borderRight","_br",v,node,rank2)}})}(g)),time(" order",()=>order(g)),time(" insertSelfEdges",()=>function(g){var layers=buildLayerMatrix(g);forEach(layers,function(layer){var orderShift=0;forEach(layer,function(v,i){var node=g.node(v);node.order=i+orderShift,forEach(node.selfEdges,function(selfEdge){addDummyNode(g,"selfedge",{width:selfEdge.label.width,height:selfEdge.label.height,rank:node.rank,order:i+ ++orderShift,e:selfEdge.e,label:selfEdge.label},"_se")}),delete node.selfEdges})})}(g)),time(" adjustCoordinateSystem",()=>function(g){var rankDir=g.graph().rankdir.toLowerCase();"lr"!==rankDir&&"rl"!==rankDir||swapWidthHeight(g)}(g)),time(" position",()=>position(g)),time(" positionSelfEdges",()=>function(g){forEach(g.nodes(),function(v){var node=g.node(v);if("selfedge"===node.dummy){var selfNode=g.node(node.e.v),x=selfNode.x+selfNode.width/2,y=selfNode.y,dx=node.x-x,dy=selfNode.height/2;g.setEdge(node.e,node.label),g.removeNode(v),node.label.points=[{x:x+2*dx/3,y:y-dy},{x:x+5*dx/6,y:y-dy},{x:x+dx,y:y},{x:x+5*dx/6,y:y+dy},{x:x+2*dx/3,y:y+dy}],node.label.x=node.x,node.label.y=node.y}})}(g)),time(" removeBorderNodes",()=>function(g){forEach(g.nodes(),function(v){if(g.children(v).length){var node=g.node(v),t=g.node(node.borderTop),b=g.node(node.borderBottom),l=g.node(last(node.borderLeft)),r=g.node(last(node.borderRight));node.width=Math.abs(r.x-l.x),node.height=Math.abs(b.y-t.y),node.x=l.x+node.width/2,node.y=t.y+node.height/2}}),forEach(g.nodes(),function(v){"border"===g.node(v).dummy&&g.removeNode(v)})}(g)),time(" normalize.undo",()=>function(g){forEach(g.graph().dummyChains,function(v){var w,node=g.node(v),origLabel=node.edgeLabel;for(g.setEdge(node.edgeObj,origLabel);node.dummy;)w=g.successors(v)[0],g.removeNode(v),origLabel.points.push({x:node.x,y:node.y}),"edge-label"===node.dummy&&(origLabel.x=node.x,origLabel.y=node.y,origLabel.width=node.width,origLabel.height=node.height),v=w,node=g.node(v)})}(g)),time(" fixupEdgeLabelCoords",()=>function(g){forEach(g.edges(),function(e){var edge=g.edge(e);if(Object.prototype.hasOwnProperty.call(edge,"x"))switch("l"!==edge.labelpos&&"r"!==edge.labelpos||(edge.width-=edge.labeloffset),edge.labelpos){case"l":edge.x-=edge.width/2+edge.labeloffset;break;case"r":edge.x+=edge.width/2+edge.labeloffset}})}(g)),time(" undoCoordinateSystem",()=>undo$1(g)),time(" translateGraph",()=>function(g){var minX=Number.POSITIVE_INFINITY,maxX=0,minY=Number.POSITIVE_INFINITY,maxY=0,graphLabel=g.graph(),marginX=graphLabel.marginx||0,marginY=graphLabel.marginy||0;function getExtremes(attrs){var x=attrs.x,y=attrs.y,w=attrs.width,h=attrs.height;minX=Math.min(minX,x-w/2),maxX=Math.max(maxX,x+w/2),minY=Math.min(minY,y-h/2),maxY=Math.max(maxY,y+h/2)}forEach(g.nodes(),function(v){getExtremes(g.node(v))}),forEach(g.edges(),function(e){var edge=g.edge(e);Object.prototype.hasOwnProperty.call(edge,"x")&&getExtremes(edge)}),minX-=marginX,minY-=marginY,forEach(g.nodes(),function(v){var node=g.node(v);node.x-=minX,node.y-=minY}),forEach(g.edges(),function(e){var edge=g.edge(e);forEach(edge.points,function(p){p.x-=minX,p.y-=minY}),Object.prototype.hasOwnProperty.call(edge,"x")&&(edge.x-=minX),Object.prototype.hasOwnProperty.call(edge,"y")&&(edge.y-=minY)}),graphLabel.width=maxX-minX+marginX,graphLabel.height=maxY-minY+marginY}(g)),time(" assignNodeIntersects",()=>function(g){forEach(g.edges(),function(e){var p1,p2,edge=g.edge(e),nodeV=g.node(e.v),nodeW=g.node(e.w);edge.points?(p1=edge.points[0],p2=edge.points[edge.points.length-1]):(edge.points=[],p1=nodeW,p2=nodeV),edge.points.unshift(intersectRect(nodeV,p1)),edge.points.push(intersectRect(nodeW,p2))})}(g)),time(" reversePoints",()=>function(g){forEach(g.edges(),function(e){var edge=g.edge(e);edge.reversed&&edge.points.reverse()})}(g)),time(" acyclic.undo",()=>function(g){forEach(g.edges(),function(e){var label=g.edge(e);if(label.reversed){g.removeEdge(e);var forwardName=label.forwardName;delete label.reversed,delete label.forwardName,g.setEdge(e.w,e.v,label,forwardName)}})}(g))}(layoutGraph,time)),time(" updateInputGraph",()=>function(inputGraph,layoutGraph){forEach(inputGraph.nodes(),function(v){var inputLabel=inputGraph.node(v),layoutLabel=layoutGraph.node(v);inputLabel&&(inputLabel.x=layoutLabel.x,inputLabel.y=layoutLabel.y,layoutGraph.children(v).length&&(inputLabel.width=layoutLabel.width,inputLabel.height=layoutLabel.height))}),forEach(inputGraph.edges(),function(e){var inputLabel=inputGraph.edge(e),layoutLabel=layoutGraph.edge(e);inputLabel.points=layoutLabel.points,Object.prototype.hasOwnProperty.call(layoutLabel,"x")&&(inputLabel.x=layoutLabel.x,inputLabel.y=layoutLabel.y)}),inputGraph.graph().width=layoutGraph.graph().width,inputGraph.graph().height=layoutGraph.graph().height}(g,layoutGraph))})}var graphNumAttrs=["nodesep","edgesep","ranksep","marginx","marginy"],graphDefaults={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},graphAttrs=["acyclicer","ranker","rankdir","align"],nodeNumAttrs=["width","height"],nodeDefaults={width:0,height:0},edgeNumAttrs=["minlen","weight","width","height","labeloffset"],edgeDefaults={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},edgeAttrs=["labelpos"];function selectNumberAttrs(obj,attrs){return mapValues(pick(obj,attrs),Number)}function canonicalize(attrs){var newAttrs={};return forEach(attrs,function(v,k){newAttrs[k.toLowerCase()]=v}),newAttrs}export{layout as l};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as isObject,d as defineProperty,e as eq,b as isPrototype,c as isArrayLike,f as arrayLikeKeys,o as overArg,k as keys,r as root,g as getSymbols,s as stubArray,h as arrayPush,j as baseGetAllKeys,U as Uint8Array,S as Symbol$1,l as isObjectLike,m as getTag,n as baseUnary,p as nodeUtil,q as isBuffer,t as Stack,u as arrayEach,v as isArray,w as getAllKeys,x as baseEach,y as baseIteratee,z as arrayMap}from"./graph-CnJdn47S.js";var objectCreate=Object.create,baseCreate=function(){function object(){}return function(proto){if(!isObject(proto))return{};if(objectCreate)return objectCreate(proto);object.prototype=proto;var result=new object;return object.prototype=void 0,result}}();function copyArray(source,array){var index=-1,length=source.length;for(array||(array=Array(length));++index<length;)array[index]=source[index];return array}function baseAssignValue(object,key,value){"__proto__"==key&&defineProperty?defineProperty(object,key,{configurable:!0,enumerable:!0,value:value,writable:!0}):object[key]=value}var hasOwnProperty$2=Object.prototype.hasOwnProperty;function assignValue(object,key,value){var objValue=object[key];hasOwnProperty$2.call(object,key)&&eq(objValue,value)&&(void 0!==value||key in object)||baseAssignValue(object,key,value)}function copyObject(source,props,object,customizer){var isNew=!object;object||(object={});for(var index=-1,length=props.length;++index<length;){var key=props[index],newValue=void 0;void 0===newValue&&(newValue=source[key]),isNew?baseAssignValue(object,key,newValue):assignValue(object,key,newValue)}return object}var hasOwnProperty$1=Object.prototype.hasOwnProperty;function baseKeysIn(object){if(!isObject(object))return function(object){var result=[];if(null!=object)for(var key in Object(object))result.push(key);return result}(object);var isProto=isPrototype(object),result=[];for(var key in object)("constructor"!=key||!isProto&&hasOwnProperty$1.call(object,key))&&result.push(key);return result}function keysIn(object){return isArrayLike(object)?arrayLikeKeys(object,!0):baseKeysIn(object)}var getPrototype=overArg(Object.getPrototypeOf,Object);var freeExports="object"==typeof exports&&exports&&!exports.nodeType&&exports,freeModule=freeExports&&"object"==typeof module&&module&&!module.nodeType&&module,Buffer=freeModule&&freeModule.exports===freeExports?root.Buffer:void 0,allocUnsafe=Buffer?Buffer.allocUnsafe:void 0;function cloneBuffer(buffer,isDeep){if(isDeep)return buffer.slice();var length=buffer.length,result=allocUnsafe?allocUnsafe(length):new buffer.constructor(length);return buffer.copy(result),result}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;function cloneArrayBuffer(arrayBuffer){var result=new arrayBuffer.constructor(arrayBuffer.byteLength);return new Uint8Array(result).set(new Uint8Array(arrayBuffer)),result}var reFlags=/\w*$/;var symbolProto=Symbol$1?Symbol$1.prototype:void 0,symbolValueOf=symbolProto?symbolProto.valueOf:void 0;function cloneTypedArray(typedArray,isDeep){var buffer=isDeep?cloneArrayBuffer(typedArray.buffer):typedArray.buffer;return new typedArray.constructor(buffer,typedArray.byteOffset,typedArray.length)}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)):{}}}function initCloneObject(object){return"function"!=typeof object.constructor||isPrototype(object)?{}:baseCreate(getPrototype(object))}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&©Object(source,keysIn(source),object)}(result,value)):function(source,object){return copyObject(source,getSymbols(source),object)}(value,function(object,source){return object&©Object(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 baseMap(collection,iteratee){var index=-1,result=isArrayLike(collection)?Array(collection.length):[];return baseEach(collection,function(value,key,collection2){result[++index]=iteratee(value,key,collection2)}),result}function map(collection,iteratee){return(isArray(collection)?arrayMap:baseMap)(collection,baseIteratee(iteratee))}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;export{baseAssignValue as a,baseClone as b,copyObject as c,copyArray as d,cloneBuffer as e,cloneTypedArray as f,getPrototype as g,assignValue as h,initCloneObject as i,baseMap as j,keysIn as k,map as m};
|