zero-workspace 0.0.4 → 0.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (59) hide show
  1. package/dist/services/TutorialService.d.ts.map +1 -1
  2. package/dist/services/TutorialService.js +16 -4
  3. package/dist/services/TutorialService.js.map +1 -1
  4. package/package.json +1 -1
  5. package/web/dist/assets/{DocsView-CGNNBT-n.js → DocsView-DfmXo6_m.js} +1 -1
  6. package/web/dist/assets/{HomeView-LQ4U-UOU.js → HomeView-DLpZ1veY.js} +2 -2
  7. package/web/dist/assets/{MarkdownContent-yGvS9ll7.js → MarkdownContent-Bui6aG36.js} +4 -4
  8. package/web/dist/assets/{NotFoundView-B0VZ5aOL.js → NotFoundView-l1Kufoa7.js} +1 -1
  9. package/web/dist/assets/{WorkspaceView-Cx_E3CeC.js → WorkspaceView-Dt7RLJq6.js} +1 -1
  10. package/web/dist/assets/{WsConfirmDialog-Ch26VQpi.js → WsConfirmDialog-C_ycN7Jx.js} +1 -1
  11. package/web/dist/assets/{arc-8i_Qn8Ez.js → arc-BBmrR2I5.js} +1 -1
  12. package/web/dist/assets/{architectureDiagram-VXUJARFQ-oMQCxKI4.js → architectureDiagram-VXUJARFQ-7QxzA3uE.js} +1 -1
  13. package/web/dist/assets/{blockDiagram-VD42YOAC-jszjC7wU.js → blockDiagram-VD42YOAC-B2hhviEi.js} +1 -1
  14. package/web/dist/assets/{c4Diagram-YG6GDRKO-CRTMO820.js → c4Diagram-YG6GDRKO-B9XeYWP5.js} +1 -1
  15. package/web/dist/assets/channel-fwcoiS4i.js +1 -0
  16. package/web/dist/assets/{chunk-4BX2VUAB-hJeHd1g9.js → chunk-4BX2VUAB-lg6Mp61u.js} +1 -1
  17. package/web/dist/assets/{chunk-55IACEB6-B_dg6aGT.js → chunk-55IACEB6-CtZhLjLW.js} +1 -1
  18. package/web/dist/assets/{chunk-B4BG7PRW-SdCcMdam.js → chunk-B4BG7PRW-BWhzqp_d.js} +1 -1
  19. package/web/dist/assets/{chunk-DI55MBZ5-Djf-_bc-.js → chunk-DI55MBZ5-D49qqwe_.js} +1 -1
  20. package/web/dist/assets/{chunk-FMBD7UC4-Bjur1RbY.js → chunk-FMBD7UC4-CyUmuJEq.js} +1 -1
  21. package/web/dist/assets/{chunk-QN33PNHL-Da3qJqMt.js → chunk-QN33PNHL--qaN5Oqj.js} +1 -1
  22. package/web/dist/assets/{chunk-QZHKN3VN-DCdkaeM9.js → chunk-QZHKN3VN-CBTwzWuu.js} +1 -1
  23. package/web/dist/assets/{chunk-TZMSLE5B-DkRR2K-y.js → chunk-TZMSLE5B-DAzpqhfJ.js} +1 -1
  24. package/web/dist/assets/classDiagram-2ON5EDUG-Bs2GjxWn.js +1 -0
  25. package/web/dist/assets/classDiagram-v2-WZHVMYZB-Bs2GjxWn.js +1 -0
  26. package/web/dist/assets/{cose-bilkent-S5V4N54A-DIOmb6nP.js → cose-bilkent-S5V4N54A-SXRgr_47.js} +1 -1
  27. package/web/dist/assets/{dagre-6UL2VRFP-CU5mdLCr.js → dagre-6UL2VRFP-CBPCWYA4.js} +1 -1
  28. package/web/dist/assets/{diagram-PSM6KHXK-BWFaWe3v.js → diagram-PSM6KHXK-_d6ZGoZG.js} +1 -1
  29. package/web/dist/assets/{diagram-QEK2KX5R-C5IXO4HK.js → diagram-QEK2KX5R-Chmx8IqJ.js} +1 -1
  30. package/web/dist/assets/{diagram-S2PKOQOG-DsmZab7I.js → diagram-S2PKOQOG-CGUXsaVc.js} +1 -1
  31. package/web/dist/assets/{erDiagram-Q2GNP2WA-F4zIPUNA.js → erDiagram-Q2GNP2WA-Co1B9FQN.js} +1 -1
  32. package/web/dist/assets/{flowDiagram-NV44I4VS-CknX6RGi.js → flowDiagram-NV44I4VS-DUItmTH1.js} +1 -1
  33. package/web/dist/assets/{ganttDiagram-JELNMOA3-BtTUjuoT.js → ganttDiagram-JELNMOA3-BidyAEtb.js} +1 -1
  34. package/web/dist/assets/{gitGraphDiagram-NY62KEGX-DJkli8XJ.js → gitGraphDiagram-NY62KEGX-uEEbLu2T.js} +1 -1
  35. package/web/dist/assets/{graph-B3zPL_QK.js → graph-BN6ojRZR.js} +1 -1
  36. package/web/dist/assets/{index-D8KM69RB.js → index-niFbQLQj.js} +2 -2
  37. package/web/dist/assets/{infoDiagram-WHAUD3N6-mgZkcLBC.js → infoDiagram-WHAUD3N6-hcXt8G4H.js} +1 -1
  38. package/web/dist/assets/{journeyDiagram-XKPGCS4Q-CoCWuxC4.js → journeyDiagram-XKPGCS4Q-DiSF_KtB.js} +1 -1
  39. package/web/dist/assets/{kanban-definition-3W4ZIXB7-D7vjj38c.js → kanban-definition-3W4ZIXB7-ka8qLbDU.js} +1 -1
  40. package/web/dist/assets/{layout-CTUKa2Hf.js → layout-DTmf-Ivv.js} +1 -1
  41. package/web/dist/assets/{linear-BLTGEI9n.js → linear-9iMSNV55.js} +1 -1
  42. package/web/dist/assets/{min-B514QwLw.js → min-B98zcCgP.js} +1 -1
  43. package/web/dist/assets/{mindmap-definition-VGOIOE7T-F5twA5iE.js → mindmap-definition-VGOIOE7T-IW2zmP05.js} +1 -1
  44. package/web/dist/assets/{pieDiagram-ADFJNKIX-CfvJFsik.js → pieDiagram-ADFJNKIX-DKbe86y4.js} +1 -1
  45. package/web/dist/assets/{quadrantDiagram-AYHSOK5B-DKzCcdP6.js → quadrantDiagram-AYHSOK5B-CEQwgq6q.js} +1 -1
  46. package/web/dist/assets/{reduce-CXBbFAWY.js → reduce-D2CQ7vuQ.js} +1 -1
  47. package/web/dist/assets/{requirementDiagram-UZGBJVZJ-Ccc6uT2O.js → requirementDiagram-UZGBJVZJ-CssRZpu5.js} +1 -1
  48. package/web/dist/assets/{sankeyDiagram-TZEHDZUN-COqJJtid.js → sankeyDiagram-TZEHDZUN-C9XC8_CF.js} +1 -1
  49. package/web/dist/assets/{sequenceDiagram-WL72ISMW-B9_sVctp.js → sequenceDiagram-WL72ISMW-Bucdov3N.js} +1 -1
  50. package/web/dist/assets/{stateDiagram-FKZM4ZOC-Cv7yoGUG.js → stateDiagram-FKZM4ZOC-DSEsGI-B.js} +1 -1
  51. package/web/dist/assets/stateDiagram-v2-4FDKWEC3-BX0oUqA7.js +1 -0
  52. package/web/dist/assets/{timeline-definition-IT6M3QCI-ByB70YmE.js → timeline-definition-IT6M3QCI-cWgLquVe.js} +1 -1
  53. package/web/dist/assets/{treemap-KMMF4GRG-C_Lx5CiU.js → treemap-KMMF4GRG-CYPCJAK_.js} +1 -1
  54. package/web/dist/assets/{xychartDiagram-PRI3JC2R-BA_05rlZ.js → xychartDiagram-PRI3JC2R-C9kM6ke8.js} +1 -1
  55. package/web/dist/index.html +1 -1
  56. package/web/dist/assets/channel-dfSGd2K3.js +0 -1
  57. package/web/dist/assets/classDiagram-2ON5EDUG-Dc-YcQ9E.js +0 -1
  58. package/web/dist/assets/classDiagram-v2-WZHVMYZB-Dc-YcQ9E.js +0 -1
  59. package/web/dist/assets/stateDiagram-v2-4FDKWEC3-1H8-PaZx.js +0 -1
@@ -1,4 +1,4 @@
1
- import{G as Le,H as Ni,r as Y,j as G,d as pe,e as D,v as Ce,F as Ne,q as Te,f as h,o as $,_ as ze,s as le,I as ue,ao as Ve,w as q,L as Me,t as B,ap as $i,$ as We,aq as js,ar as yo,J as Re,O as Se,as as Ci,at as zt,au as Mi,K as Ee,av as Js,p as Ii,M as xe,aw as Ie,l as Xe,ax as Qs,ay as Bt,az as gn,aA as ea,n as Ge,aB as Di,aC as ta,aD as ct,aE as _o,aF as na,aG as oa,aH as It,aI as $e,aJ as be,aK as ia,aL as Ti,aM as sa,aN as mn,aO as aa,N as la,T as Pi,a0 as Ut,a3 as ra,P as Ai,a1 as nn,a2 as Xt,aP as Po,a4 as ua,aQ as ca,a6 as da,g as fa,h as ha,aR as Ao}from"./index-D8KM69RB.js";import{u as ht,W as Be,b as Oi,w as zi,g as va,a as Oo}from"./WsConfirmDialog-Ch26VQpi.js";import{aC as Nt}from"./MarkdownContent-yGvS9ll7.js";const St={create(e,t){return Le.post(`/workspaces/${e}/nodes`,t)},list(e,t,n){return Le.get(`/workspaces/${e}/nodes`,{params:{rootId:t,depth:n}})},get(e,t){return Le.get(`/workspaces/${e}/nodes/${t}`)},update(e,t,n){return Le.patch(`/workspaces/${e}/nodes/${t}`,n)},delete(e,t){return Le.delete(`/workspaces/${e}/nodes/${t}`)},transition(e,t,n){return Le.post(`/workspaces/${e}/nodes/${t}/transition`,n)}},zo={get(e,t,n){return Le.get(`/workspaces/${e}/nodes/${t}/context`,{params:n})},focus(e,t){return Le.post(`/workspaces/${e}/focus`,{nodeId:t})},isolate(e,t,n){return Le.patch(`/workspaces/${e}/nodes/${t}/isolate`,{isolate:n})},reference(e,t,n){return Le.post(`/workspaces/${e}/nodes/${t}/references`,n)}},Wn={list(e,t){return Le.get(`/workspaces/${e}/memos`,{params:{tags:t}})},async get(e,t){return(await Le.get(`/workspaces/${e}/memos/${t}`)).memo},delete(e,t){return Le.delete(`/workspaces/${e}/memos/${t}`)}},Bi=Ni("node",()=>{const e=Y(null),t=Y(null),n=Y(null),o=Y(null),i=Y(!1),s=Y(null),a=ht();async function l(){const m=a.currentWorkspace?.id;if(m){i.value=!0,s.value=null;try{const w=await St.list(m);e.value=w.tree}catch(w){throw s.value=w instanceof Error?w.message:"获取节点树失败",w}finally{i.value=!1}}}async function r(m){const w=a.currentWorkspace?.id;if(w){t.value=m,i.value=!0,s.value=null;try{const[g,v]=await Promise.all([St.get(w,m),zo.get(w,m)]);n.value=g.meta,o.value=v}catch(g){throw s.value=g instanceof Error?g.message:"获取节点详情失败",g}finally{i.value=!1}}}async function u(m){const w=a.currentWorkspace?.id;if(!w)throw new Error("未选择工作区");i.value=!0,s.value=null;try{const g=await St.create(w,m);return await l(),g}catch(g){throw s.value=g instanceof Error?g.message:"创建节点失败",g}finally{i.value=!1}}async function c(m){const w=a.currentWorkspace?.id,g=t.value;if(!w||!g)throw new Error("未选择节点");i.value=!0,s.value=null;try{await St.update(w,g,m),await l(),await r(g)}catch(v){throw s.value=v instanceof Error?v.message:"更新节点失败",v}finally{i.value=!1}}async function f(m){const w=a.currentWorkspace?.id;if(!w)throw new Error("未选择工作区");i.value=!0,s.value=null;try{await St.delete(w,m),await l(),t.value===m&&(t.value=null,n.value=null,o.value=null)}catch(g){throw s.value=g instanceof Error?g.message:"删除节点失败",g}finally{i.value=!1}}async function d(m,w,g){const v=a.currentWorkspace?.id,C=t.value;if(!v||!C)throw new Error("未选择节点");i.value=!0,s.value=null;try{const O=await St.transition(v,C,{action:m,reason:w,conclusion:g});return await l(),await r(C),O}catch(O){throw s.value=O instanceof Error?O.message:"状态转换失败",O}finally{i.value=!1}}async function _(m){const w=a.currentWorkspace?.id;if(!w)throw new Error("未选择工作区");i.value=!0,s.value=null;try{await zo.focus(w,m),await a.fetchWorkspace(w)}catch(g){throw s.value=g instanceof Error?g.message:"设置焦点失败",g}finally{i.value=!1}}function k(){t.value=null,n.value=null,o.value=null}function p(){e.value=null,k()}return{nodeTree:e,selectedNodeId:t,selectedNodeMeta:n,nodeContext:o,loading:i,error:s,fetchNodeTree:l,selectNode:r,createNode:u,updateNode:c,deleteNode:f,transition:d,setFocus:_,clearSelection:k,clearAll:p}}),wo=Ni("memo",()=>{const e=Y([]),t=Y([]),n=Y(null),o=Y(!1),i=Y(null),s=G(()=>e.value.length);async function a(c,f){o.value=!0,i.value=null;try{const d=await Wn.list(c,f);e.value=d.memos,t.value=d.allTags}catch(d){throw i.value=d instanceof Error?d.message:"获取 memo 列表失败",d}finally{o.value=!1}}async function l(c,f){o.value=!0,i.value=null;try{const d=await Wn.get(c,f);return n.value=d,d}catch(d){throw i.value=d instanceof Error?d.message:"获取 memo 失败",d}finally{o.value=!1}}function r(){e.value=[],t.value=[],n.value=null,i.value=null}async function u(c,f){o.value=!0,i.value=null;try{await Wn.delete(c,f),e.value=e.value.filter(d=>d.id!==f),n.value?.id===f&&(n.value=null)}catch(d){throw i.value=d instanceof Error?d.message:"删除 memo 失败",d}finally{o.value=!1}}return{memos:e,allTags:t,currentMemo:n,loading:o,error:i,memoCount:s,fetchMemos:a,fetchMemo:l,clearMemos:r,deleteMemo:u}}),pa={key:1,class:"node-plan-wrapper"},ga=pe({__name:"NodeIcon",props:{type:{},status:{},isMemo:{type:Boolean},contentLength:{},memoCount:{}},setup(e){const t=e,n=G(()=>t.type==="planning"),o=G(()=>t.memoCount!==void 0?t.memoCount<=3?1:t.memoCount<=8?2:3:!t.contentLength||t.contentLength<500?1:t.contentLength<=1e3?2:3);return(i,s)=>e.isMemo?($(),D("div",{key:0,class:Ce(["node-memo","lines-"+o.value])},[($(!0),D(Ne,null,Te(o.value,a=>($(),D("span",{class:"memo-line",key:a}))),128))],2)):n.value?($(),D("div",pa,[h("div",{class:Ce(["node-plan",e.status])},null,2)])):($(),D("div",{key:2,class:Ce(["node-exec",e.status])},null,2))}}),Qe=ze(ga,[["__scopeId","data-v-0a165cd6"]]),ma={key:0,class:"focus-wrapper"},ya={key:1,class:"focus-wrapper-diamond"},_a={class:"node-plan-wrapper"},wa=pe({__name:"FocusCrosshair",props:{type:{},status:{}},setup(e){return(t,n)=>e.type==="execution"?($(),D("div",ma,[le(Qe,{type:e.type,status:e.status},null,8,["type","status"]),n[0]||(n[0]=h("div",{class:"focus-crosshair"},[h("span")],-1))])):($(),D("div",ya,[h("div",_a,[le(Qe,{type:e.type,status:e.status},null,8,["type","status"])]),n[1]||(n[1]=h("div",{class:"focus-diamond"},[h("span")],-1))]))}}),Vi=ze(wa,[["__scopeId","data-v-e0c1e480"]]),ba={pending:{icon:"CircleClose",color:"#909399",label:"待执行",emoji:"⚪"},completed:{icon:"CircleCheck",color:"#67C23A",label:"已完成",emoji:"✅"},implementing:{icon:"Loading",color:"#409EFF",label:"执行中",emoji:"🔵"},validating:{icon:"Clock",color:"#E6A23C",label:"验证中",emoji:"🟡"},failed:{icon:"CircleCloseFilled",color:"#F56C6C",label:"失败",emoji:"❌"},planning:{icon:"Edit",color:"#9B59B6",label:"规划中",emoji:"◇"},monitoring:{icon:"View",color:"#3498DB",label:"监控中",emoji:"◈"},cancelled:{icon:"Remove",color:"#95A5A6",label:"已取消",emoji:"⊘"}},Ri={info_collection:{label:"INFO",color:"#E6A23C",textColor:"#000",description:"收集项目信息,完成时自动归档规则和文档到工作区"},info_summary:{label:"SUMM",color:"#909399",textColor:"#fff",description:"信息总结,从已有信息中提取结构化内容"},validation:{label:"VALID",color:"#67C23A",textColor:"#fff",description:"验证类任务(预留)"}},xa={pending:{label:"待派发",color:"#909399",bgColor:"#f4f4f5",description:"等待派发执行"},executing:{label:"执行中",color:"#409EFF",bgColor:"#ecf5ff",description:"Subagent 正在执行"},testing:{label:"测试中",color:"#E6A23C",bgColor:"#fdf6ec",description:"测试节点验证中"},passed:{label:"已通过",color:"#67C23A",bgColor:"#f0f9eb",description:"测试通过"},failed:{label:"已失败",color:"#F56C6C",bgColor:"#fef0f0",description:"执行或测试失败"}},Sa=pe({__name:"RoleBadge",props:{role:{}},setup(e){const t=e,n=G(()=>t.role?Ri[t.role]:null);return(o,i)=>n.value?($(),D("span",{key:0,class:"role-badge",style:Ve({background:n.value.color,color:n.value.textColor})},q(n.value.label),5)):ue("",!0)}}),Hi=ze(Sa,[["__scopeId","data-v-c567ac5e"]]),Ea=pe({__name:"DispatchBadge",props:{status:{}},setup(e){function t(n){switch(n){case"pending":return"WAIT";case"executing":return"RUN";case"testing":return"TEST";case"passed":return"PASS";case"failed":return"FAIL";default:return""}}return(n,o)=>($(),D("span",{class:Ce(["dispatch-badge",e.status])},q(t(e.status)),3))}}),bo=ze(Ea,[["__scopeId","data-v-0ef054ee"]]),ka={key:0,class:"depth-dots"},Na=["title"],$a={class:"node-title"},Ca=pe({__name:"TreeNodeItem",props:{node:{},isFocused:{type:Boolean},isSelected:{type:Boolean},isActivePath:{type:Boolean},depth:{},hasChildren:{type:Boolean},isExpanded:{type:Boolean}},emits:["click","toggleExpand"],setup(e,{emit:t}){const n=e,o=t,i=G(()=>n.node.id.startsWith("memo-")||n.node.id==="__memo_drawer__"),s=n.depth?n.hasChildren?n.depth-1:n.depth:0;function a(){o("click",n.node)}function l(r){r.stopPropagation(),o("toggleExpand")}return(r,u)=>($(),D("div",{class:Ce(["tree-node-item",{selected:e.isSelected,"active-path":e.isActivePath,"is-memo":i.value}]),onClick:a},[B(s)>0?($(),D("span",ka,[($(!0),D(Ne,null,Te(B(s),c=>($(),D("span",{key:c,class:"dot"}))),128))])):ue("",!0),e.hasChildren?($(),D("button",{key:1,class:Ce(["expand-btn",{expanded:e.isExpanded}]),onClick:l,title:e.isExpanded?"收起":"展开"},[...u[0]||(u[0]=[h("span",{class:"expand-icon"},"▶",-1)])],10,Na)):ue("",!0),e.isFocused&&!i.value?($(),Me(Vi,{key:2,type:e.node.type,status:e.node.status},null,8,["type","status"])):($(),Me(Qe,{key:3,type:e.node.type,status:e.node.status,"is-memo":i.value,"content-length":e.node.contentLength,"memo-count":e.node.memoCount},null,8,["type","status","is-memo","content-length","memo-count"])),h("span",$a,q(e.node.title),1),le(Hi,{role:e.node.role},null,8,["role"]),e.node.dispatch?($(),Me(bo,{key:4,status:e.node.dispatch.status},null,8,["status"])):ue("",!0)],2))}}),Li=ze(Ca,[["__scopeId","data-v-13ec9572"]]),Ma={key:0,class:"tree-children"},Ia=pe({__name:"TreeChildren",props:{children:{},selectedId:{},focusId:{},activePathIds:{},depth:{}},emits:["select"],setup(e,{expose:t,emit:n}){const o=e,i=n,s=$i({}),a=Y([]);function l(p){return s[p]!==!1}function r(p){s[p]=!l(p)}function u(p){o.children.forEach(m=>{s[m.id]=p}),a.value.forEach(m=>{m?.setAllExpanded(p)})}t({setAllExpanded:u});function c(p){i("select",p)}function f(p){return o.focusId===p}function d(p){return o.selectedId===p}function _(p){return o.activePathIds.has(p)}function k(p){return!!(p.children&&p.children.length>0)}return(p,m)=>{const w=yo("TreeChildren",!0);return $(!0),D(Ne,null,Te(e.children,g=>($(),D("div",{key:g.id,class:"tree-node-wrapper"},[le(Li,{node:g,"is-focused":f(g.id),"is-selected":d(g.id),"is-active-path":_(g.id),depth:e.depth,"has-children":k(g),"is-expanded":l(g.id),onClick:v=>c(g),onToggleExpand:v=>r(g.id)},null,8,["node","is-focused","is-selected","is-active-path","depth","has-children","is-expanded","onClick","onToggleExpand"]),k(g)?We(($(),D("div",Ma,[le(w,{ref_for:!0,ref:v=>{v&&(a.value[e.children.indexOf(g)]=v)},children:g.children,"selected-id":e.selectedId,"focus-id":e.focusId,"active-path-ids":e.activePathIds,depth:e.depth+1,onSelect:c},null,8,["children","selected-id","focus-id","active-path-ids","depth"])],512)),[[js,l(g.id)]]):ue("",!0)]))),128)}}}),Da=ze(Ia,[["__scopeId","data-v-899ad2a2"]]),Ta={class:"empty-state"},Pa={class:"empty-icon"},Aa={class:"empty-title"},Oa={key:0,class:"empty-description"},za={key:1,class:"empty-action"},Ba=pe({__name:"WsEmpty",props:{title:{default:""},description:{default:""}},setup(e){return(t,n)=>($(),D("div",Ta,[h("div",Pa,[Re(t.$slots,"icon",{},()=>[n[0]||(n[0]=h("svg",{width:"64",height:"64",viewBox:"0 0 64 64",fill:"none"},[h("rect",{x:"12",y:"12",width:"40",height:"40",rx:"4",stroke:"currentColor","stroke-width":"2"}),h("path",{d:"M20 28L28 36L44 20",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",opacity:"0.3"})],-1))],!0)]),h("div",Aa,[Re(t.$slots,"title",{},()=>[Se(q(e.title||"暂无数据"),1)],!0)]),e.description||t.$slots.description?($(),D("div",Oa,[Re(t.$slots,"description",{},()=>[Se(q(e.description),1)],!0)])):ue("",!0),t.$slots.action?($(),D("div",za,[Re(t.$slots,"action",{},void 0,!0)])):ue("",!0)]))}}),Va=ze(Ba,[["__scopeId","data-v-841069d4"]]),Ra={class:"node-tree"},Ha={key:0,class:"tree-container"},La={key:0,class:"tree-children"},Fa=pe({__name:"NodeTree",props:{tree:{},selectedId:{},focusId:{},memos:{}},emits:["select"],setup(e,{emit:t}){const n=e,o=t,i=Y(null),s=Y(!0),a=G(()=>{if(!n.memos||n.memos.length===0)return null;const k=n.memos.map(p=>({id:p.id,type:"execution",title:p.title,status:"pending",contentLength:p.contentLength,children:[]}));return{id:"__memo_drawer__",type:"planning",title:`草稿 (${n.memos.length})`,status:"pending",memoCount:n.memos.length,children:k}}),l=G(()=>{const k=n.tree?.children||[];return a.value?[...k,a.value]:k}),r=G(()=>{const k=new Set;if(!n.selectedId||!n.tree)return k;function p(m,w,g){if(g.push(m.id),m.id===w)return g.forEach(v=>k.add(v)),!0;if(m.children&&m.children.length>0){for(const v of m.children)if(p(v,w,[...g]))return!0}return!1}return p(n.tree,n.selectedId,[]),k.size===0&&a.value&&(n.selectedId==="__memo_drawer__"||n.selectedId.startsWith("memo-"))&&(k.add("__memo_drawer__"),n.selectedId!=="__memo_drawer__"&&k.add(n.selectedId)),k});function u(k){o("select",k.id)}function c(k){return n.focusId===k}function f(k){return n.selectedId===k}function d(k){return r.value.has(k)}function _(){s.value=!s.value,i.value?.setAllExpanded(s.value)}return(k,p)=>($(),D("div",Ra,[e.tree?($(),D("div",Ha,[le(Li,{node:e.tree,"is-focused":c(e.tree.id),"is-selected":f(e.tree.id),"is-active-path":d(e.tree.id),depth:0,onClick:p[0]||(p[0]=m=>u(e.tree)),onDblclick:_},null,8,["node","is-focused","is-selected","is-active-path"]),l.value.length>0?($(),D("div",La,[le(Da,{ref_key:"treeChildrenRef",ref:i,children:l.value,"selected-id":e.selectedId,"focus-id":e.focusId,"active-path-ids":r.value,depth:1,onSelect:u},null,8,["children","selected-id","focus-id","active-path-ids"])])):ue("",!0)])):($(),Me(Va,{key:1,description:"暂无节点"}))]))}}),Ga=ze(Fa,[["__scopeId","data-v-0f71ff3f"]]);function Zt(e){return Ci()?(gn(e),!0):!1}function ot(e){return typeof e=="function"?e():B(e)}const Wa=typeof window<"u"&&typeof document<"u",Ya=e=>typeof e<"u",Ua=Object.prototype.toString,Xa=e=>Ua.call(e)==="[object Object]",Za=()=>{};function Ka(e,t){function n(...o){return new Promise((i,s)=>{Promise.resolve(e(()=>t.apply(this,o),{fn:t,thisArg:this,args:o})).then(i).catch(s)})}return n}const Fi=e=>e();function qa(e=Fi){const t=Y(!0);function n(){t.value=!1}function o(){t.value=!0}const i=(...s)=>{t.value&&e(...s)};return{isActive:aa(t),pause:n,resume:o,eventFilter:i}}function Bo(e,t=!1,n="Timeout"){return new Promise((o,i)=>{setTimeout(t?()=>i(n):o,e)})}function ja(e,t,n={}){const{eventFilter:o=Fi,...i}=n;return Ee(e,Ka(o,t),i)}function Et(e,t,n={}){const{eventFilter:o,...i}=n,{eventFilter:s,pause:a,resume:l,isActive:r}=qa(o);return{stop:ja(e,t,{...i,eventFilter:s}),pause:a,resume:l,isActive:r}}function Ja(e,t={}){if(!_o(e))return na(e);const n=Array.isArray(e.value)?Array.from({length:e.value.length}):{};for(const o in e.value)n[o]=oa(()=>({get(){return e.value[o]},set(i){var s;if((s=ot(t.replaceRef))!=null?s:!0)if(Array.isArray(e.value)){const l=[...e.value];l[o]=i,e.value=l}else{const l={...e.value,[o]:i};Object.setPrototypeOf(l,Object.getPrototypeOf(e.value)),e.value=l}else e.value[o]=i}}));return n}function no(e,t=!1){function n(f,{flush:d="sync",deep:_=!1,timeout:k,throwOnTimeout:p}={}){let m=null;const g=[new Promise(v=>{m=Ee(e,C=>{f(C)!==t&&(m?.(),v(C))},{flush:d,deep:_,immediate:!0})})];return k!=null&&g.push(Bo(k,p).then(()=>ot(e)).finally(()=>m?.())),Promise.race(g)}function o(f,d){if(!_o(f))return n(C=>C===f,d);const{flush:_="sync",deep:k=!1,timeout:p,throwOnTimeout:m}=d??{};let w=null;const v=[new Promise(C=>{w=Ee([e,f],([O,F])=>{t!==(O===F)&&(w?.(),C(O))},{flush:_,deep:k,immediate:!0})})];return p!=null&&v.push(Bo(p,m).then(()=>ot(e)).finally(()=>(w?.(),ot(e)))),Promise.race(v)}function i(f){return n(d=>!!d,f)}function s(f){return o(null,f)}function a(f){return o(void 0,f)}function l(f){return n(Number.isNaN,f)}function r(f,d){return n(_=>{const k=Array.from(_);return k.includes(f)||k.includes(ot(f))},d)}function u(f){return c(1,f)}function c(f=1,d){let _=-1;return n(()=>(_+=1,_>=f),d)}return Array.isArray(ot(e))?{toMatch:n,toContains:r,changed:u,changedTimes:c,get not(){return no(e,!t)}}:{toMatch:n,toBe:o,toBeTruthy:i,toBeNull:s,toBeNaN:l,toBeUndefined:a,changed:u,changedTimes:c,get not(){return no(e,!t)}}}function oo(e){return no(e)}function Qa(e){var t;const n=ot(e);return(t=n?.$el)!=null?t:n}const Gi=Wa?window:void 0;function Wi(...e){let t,n,o,i;if(typeof e[0]=="string"||Array.isArray(e[0])?([n,o,i]=e,t=Gi):[t,n,o,i]=e,!t)return Za;Array.isArray(n)||(n=[n]),Array.isArray(o)||(o=[o]);const s=[],a=()=>{s.forEach(c=>c()),s.length=0},l=(c,f,d,_)=>(c.addEventListener(f,d,_),()=>c.removeEventListener(f,d,_)),r=Ee(()=>[Qa(t),ot(i)],([c,f])=>{if(a(),!c)return;const d=Xa(f)?{...f}:f;s.push(...n.flatMap(_=>o.map(k=>l(c,_,k,d))))},{immediate:!0,flush:"post"}),u=()=>{r(),a()};return Zt(u),u}function el(e){return typeof e=="function"?e:typeof e=="string"?t=>t.key===e:Array.isArray(e)?t=>e.includes(t.key):()=>!0}function Vo(...e){let t,n,o={};e.length===3?(t=e[0],n=e[1],o=e[2]):e.length===2?typeof e[1]=="object"?(t=!0,n=e[0],o=e[1]):(t=e[0],n=e[1]):(t=!0,n=e[0]);const{target:i=Gi,eventName:s="keydown",passive:a=!1,dedupe:l=!1}=o,r=el(t);return Wi(i,s,c=>{c.repeat&&ot(l)||r(c)&&n(c)},a)}function tl(e){return JSON.parse(JSON.stringify(e))}function Yn(e,t,n,o={}){var i,s,a;const{clone:l=!1,passive:r=!1,eventName:u,deep:c=!1,defaultValue:f,shouldEmit:d}=o,_=Bt(),k=n||_?.emit||((i=_?.$emit)==null?void 0:i.bind(_))||((a=(s=_?.proxy)==null?void 0:s.$emit)==null?void 0:a.bind(_?.proxy));let p=u;t||(t="modelValue"),p=p||`update:${t.toString()}`;const m=v=>l?typeof l=="function"?l(v):tl(v):v,w=()=>Ya(e[t])?m(e[t]):f,g=v=>{d?d(v)&&k(p,v):k(p,v)};if(r){const v=w(),C=Y(v);let O=!1;return Ee(()=>e[t],F=>{O||(O=!0,C.value=m(F),Ge(()=>O=!1))}),Ee(C,F=>{!O&&(F!==e[t]||c)&&g(F)},{deep:c}),C}else return G({get(){return w()},set(v){g(v)}})}var nl={value:()=>{}};function Pn(){for(var e=0,t=arguments.length,n={},o;e<t;++e){if(!(o=arguments[e]+"")||o in n||/[\s.]/.test(o))throw new Error("illegal type: "+o);n[o]=[]}return new yn(n)}function yn(e){this._=e}function ol(e,t){return e.trim().split(/^|\s+/).map(function(n){var o="",i=n.indexOf(".");if(i>=0&&(o=n.slice(i+1),n=n.slice(0,i)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:o}})}yn.prototype=Pn.prototype={constructor:yn,on:function(e,t){var n=this._,o=ol(e+"",n),i,s=-1,a=o.length;if(arguments.length<2){for(;++s<a;)if((i=(e=o[s]).type)&&(i=il(n[i],e.name)))return i;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++s<a;)if(i=(e=o[s]).type)n[i]=Ro(n[i],e.name,t);else if(t==null)for(i in n)n[i]=Ro(n[i],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new yn(e)},call:function(e,t){if((i=arguments.length-2)>0)for(var n=new Array(i),o=0,i,s;o<i;++o)n[o]=arguments[o+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(s=this._[e],o=0,i=s.length;o<i;++o)s[o].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var o=this._[e],i=0,s=o.length;i<s;++i)o[i].value.apply(t,n)}};function il(e,t){for(var n=0,o=e.length,i;n<o;++n)if((i=e[n]).name===t)return i.value}function Ro(e,t,n){for(var o=0,i=e.length;o<i;++o)if(e[o].name===t){e[o]=nl,e=e.slice(0,o).concat(e.slice(o+1));break}return n!=null&&e.push({name:t,value:n}),e}var io="http://www.w3.org/1999/xhtml";const Ho={svg:"http://www.w3.org/2000/svg",xhtml:io,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function An(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),Ho.hasOwnProperty(t)?{space:Ho[t],local:e}:e}function sl(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===io&&t.documentElement.namespaceURI===io?t.createElement(e):t.createElementNS(n,e)}}function al(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function Yi(e){var t=An(e);return(t.local?al:sl)(t)}function ll(){}function xo(e){return e==null?ll:function(){return this.querySelector(e)}}function rl(e){typeof e!="function"&&(e=xo(e));for(var t=this._groups,n=t.length,o=new Array(n),i=0;i<n;++i)for(var s=t[i],a=s.length,l=o[i]=new Array(a),r,u,c=0;c<a;++c)(r=s[c])&&(u=e.call(r,r.__data__,c,s))&&("__data__"in r&&(u.__data__=r.__data__),l[c]=u);return new Fe(o,this._parents)}function ul(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function cl(){return[]}function Ui(e){return e==null?cl:function(){return this.querySelectorAll(e)}}function dl(e){return function(){return ul(e.apply(this,arguments))}}function fl(e){typeof e=="function"?e=dl(e):e=Ui(e);for(var t=this._groups,n=t.length,o=[],i=[],s=0;s<n;++s)for(var a=t[s],l=a.length,r,u=0;u<l;++u)(r=a[u])&&(o.push(e.call(r,r.__data__,u,a)),i.push(r));return new Fe(o,i)}function Xi(e){return function(){return this.matches(e)}}function Zi(e){return function(t){return t.matches(e)}}var hl=Array.prototype.find;function vl(e){return function(){return hl.call(this.children,e)}}function pl(){return this.firstElementChild}function gl(e){return this.select(e==null?pl:vl(typeof e=="function"?e:Zi(e)))}var ml=Array.prototype.filter;function yl(){return Array.from(this.children)}function _l(e){return function(){return ml.call(this.children,e)}}function wl(e){return this.selectAll(e==null?yl:_l(typeof e=="function"?e:Zi(e)))}function bl(e){typeof e!="function"&&(e=Xi(e));for(var t=this._groups,n=t.length,o=new Array(n),i=0;i<n;++i)for(var s=t[i],a=s.length,l=o[i]=[],r,u=0;u<a;++u)(r=s[u])&&e.call(r,r.__data__,u,s)&&l.push(r);return new Fe(o,this._parents)}function Ki(e){return new Array(e.length)}function xl(){return new Fe(this._enter||this._groups.map(Ki),this._parents)}function Sn(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}Sn.prototype={constructor:Sn,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function Sl(e){return function(){return e}}function El(e,t,n,o,i,s){for(var a=0,l,r=t.length,u=s.length;a<u;++a)(l=t[a])?(l.__data__=s[a],o[a]=l):n[a]=new Sn(e,s[a]);for(;a<r;++a)(l=t[a])&&(i[a]=l)}function kl(e,t,n,o,i,s,a){var l,r,u=new Map,c=t.length,f=s.length,d=new Array(c),_;for(l=0;l<c;++l)(r=t[l])&&(d[l]=_=a.call(r,r.__data__,l,t)+"",u.has(_)?i[l]=r:u.set(_,r));for(l=0;l<f;++l)_=a.call(e,s[l],l,s)+"",(r=u.get(_))?(o[l]=r,r.__data__=s[l],u.delete(_)):n[l]=new Sn(e,s[l]);for(l=0;l<c;++l)(r=t[l])&&u.get(d[l])===r&&(i[l]=r)}function Nl(e){return e.__data__}function $l(e,t){if(!arguments.length)return Array.from(this,Nl);var n=t?kl:El,o=this._parents,i=this._groups;typeof e!="function"&&(e=Sl(e));for(var s=i.length,a=new Array(s),l=new Array(s),r=new Array(s),u=0;u<s;++u){var c=o[u],f=i[u],d=f.length,_=Cl(e.call(c,c&&c.__data__,u,o)),k=_.length,p=l[u]=new Array(k),m=a[u]=new Array(k),w=r[u]=new Array(d);n(c,f,p,m,w,_,t);for(var g=0,v=0,C,O;g<k;++g)if(C=p[g]){for(g>=v&&(v=g+1);!(O=m[v])&&++v<k;);C._next=O||null}}return a=new Fe(a,o),a._enter=l,a._exit=r,a}function Cl(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function Ml(){return new Fe(this._exit||this._groups.map(Ki),this._parents)}function Il(e,t,n){var o=this.enter(),i=this,s=this.exit();return typeof e=="function"?(o=e(o),o&&(o=o.selection())):o=o.append(e+""),t!=null&&(i=t(i),i&&(i=i.selection())),n==null?s.remove():n(s),o&&i?o.merge(i).order():i}function Dl(e){for(var t=e.selection?e.selection():e,n=this._groups,o=t._groups,i=n.length,s=o.length,a=Math.min(i,s),l=new Array(i),r=0;r<a;++r)for(var u=n[r],c=o[r],f=u.length,d=l[r]=new Array(f),_,k=0;k<f;++k)(_=u[k]||c[k])&&(d[k]=_);for(;r<i;++r)l[r]=n[r];return new Fe(l,this._parents)}function Tl(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var o=e[t],i=o.length-1,s=o[i],a;--i>=0;)(a=o[i])&&(s&&a.compareDocumentPosition(s)^4&&s.parentNode.insertBefore(a,s),s=a);return this}function Pl(e){e||(e=Al);function t(f,d){return f&&d?e(f.__data__,d.__data__):!f-!d}for(var n=this._groups,o=n.length,i=new Array(o),s=0;s<o;++s){for(var a=n[s],l=a.length,r=i[s]=new Array(l),u,c=0;c<l;++c)(u=a[c])&&(r[c]=u);r.sort(t)}return new Fe(i,this._parents).order()}function Al(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function Ol(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function zl(){return Array.from(this)}function Bl(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var o=e[t],i=0,s=o.length;i<s;++i){var a=o[i];if(a)return a}return null}function Vl(){let e=0;for(const t of this)++e;return e}function Rl(){return!this.node()}function Hl(e){for(var t=this._groups,n=0,o=t.length;n<o;++n)for(var i=t[n],s=0,a=i.length,l;s<a;++s)(l=i[s])&&e.call(l,l.__data__,s,i);return this}function Ll(e){return function(){this.removeAttribute(e)}}function Fl(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Gl(e,t){return function(){this.setAttribute(e,t)}}function Wl(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function Yl(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function Ul(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,n)}}function Xl(e,t){var n=An(e);if(arguments.length<2){var o=this.node();return n.local?o.getAttributeNS(n.space,n.local):o.getAttribute(n)}return this.each((t==null?n.local?Fl:Ll:typeof t=="function"?n.local?Ul:Yl:n.local?Wl:Gl)(n,t))}function qi(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function Zl(e){return function(){this.style.removeProperty(e)}}function Kl(e,t,n){return function(){this.style.setProperty(e,t,n)}}function ql(e,t,n){return function(){var o=t.apply(this,arguments);o==null?this.style.removeProperty(e):this.style.setProperty(e,o,n)}}function jl(e,t,n){return arguments.length>1?this.each((t==null?Zl:typeof t=="function"?ql:Kl)(e,t,n??"")):Dt(this.node(),e)}function Dt(e,t){return e.style.getPropertyValue(t)||qi(e).getComputedStyle(e,null).getPropertyValue(t)}function Jl(e){return function(){delete this[e]}}function Ql(e,t){return function(){this[e]=t}}function er(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function tr(e,t){return arguments.length>1?this.each((t==null?Jl:typeof t=="function"?er:Ql)(e,t)):this.node()[e]}function ji(e){return e.trim().split(/^|\s+/)}function So(e){return e.classList||new Ji(e)}function Ji(e){this._node=e,this._names=ji(e.getAttribute("class")||"")}Ji.prototype={add:function(e){var t=this._names.indexOf(e);t<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function Qi(e,t){for(var n=So(e),o=-1,i=t.length;++o<i;)n.add(t[o])}function es(e,t){for(var n=So(e),o=-1,i=t.length;++o<i;)n.remove(t[o])}function nr(e){return function(){Qi(this,e)}}function or(e){return function(){es(this,e)}}function ir(e,t){return function(){(t.apply(this,arguments)?Qi:es)(this,e)}}function sr(e,t){var n=ji(e+"");if(arguments.length<2){for(var o=So(this.node()),i=-1,s=n.length;++i<s;)if(!o.contains(n[i]))return!1;return!0}return this.each((typeof t=="function"?ir:t?nr:or)(n,t))}function ar(){this.textContent=""}function lr(e){return function(){this.textContent=e}}function rr(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function ur(e){return arguments.length?this.each(e==null?ar:(typeof e=="function"?rr:lr)(e)):this.node().textContent}function cr(){this.innerHTML=""}function dr(e){return function(){this.innerHTML=e}}function fr(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function hr(e){return arguments.length?this.each(e==null?cr:(typeof e=="function"?fr:dr)(e)):this.node().innerHTML}function vr(){this.nextSibling&&this.parentNode.appendChild(this)}function pr(){return this.each(vr)}function gr(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function mr(){return this.each(gr)}function yr(e){var t=typeof e=="function"?e:Yi(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function _r(){return null}function wr(e,t){var n=typeof e=="function"?e:Yi(e),o=t==null?_r:typeof t=="function"?t:xo(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),o.apply(this,arguments)||null)})}function br(){var e=this.parentNode;e&&e.removeChild(this)}function xr(){return this.each(br)}function Sr(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function Er(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function kr(e){return this.select(e?Er:Sr)}function Nr(e){return arguments.length?this.property("__data__",e):this.node().__data__}function $r(e){return function(t){e.call(this,t,this.__data__)}}function Cr(e){return e.trim().split(/^|\s+/).map(function(t){var n="",o=t.indexOf(".");return o>=0&&(n=t.slice(o+1),t=t.slice(0,o)),{type:t,name:n}})}function Mr(e){return function(){var t=this.__on;if(t){for(var n=0,o=-1,i=t.length,s;n<i;++n)s=t[n],(!e.type||s.type===e.type)&&s.name===e.name?this.removeEventListener(s.type,s.listener,s.options):t[++o]=s;++o?t.length=o:delete this.__on}}}function Ir(e,t,n){return function(){var o=this.__on,i,s=$r(t);if(o){for(var a=0,l=o.length;a<l;++a)if((i=o[a]).type===e.type&&i.name===e.name){this.removeEventListener(i.type,i.listener,i.options),this.addEventListener(i.type,i.listener=s,i.options=n),i.value=t;return}}this.addEventListener(e.type,s,n),i={type:e.type,name:e.name,value:t,listener:s,options:n},o?o.push(i):this.__on=[i]}}function Dr(e,t,n){var o=Cr(e+""),i,s=o.length,a;if(arguments.length<2){var l=this.node().__on;if(l){for(var r=0,u=l.length,c;r<u;++r)for(i=0,c=l[r];i<s;++i)if((a=o[i]).type===c.type&&a.name===c.name)return c.value}return}for(l=t?Ir:Mr,i=0;i<s;++i)this.each(l(o[i],t,n));return this}function ts(e,t,n){var o=qi(e),i=o.CustomEvent;typeof i=="function"?i=new i(t,n):(i=o.document.createEvent("Event"),n?(i.initEvent(t,n.bubbles,n.cancelable),i.detail=n.detail):i.initEvent(t,!1,!1)),e.dispatchEvent(i)}function Tr(e,t){return function(){return ts(this,e,t)}}function Pr(e,t){return function(){return ts(this,e,t.apply(this,arguments))}}function Ar(e,t){return this.each((typeof t=="function"?Pr:Tr)(e,t))}function*Or(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var o=e[t],i=0,s=o.length,a;i<s;++i)(a=o[i])&&(yield a)}var ns=[null];function Fe(e,t){this._groups=e,this._parents=t}function on(){return new Fe([[document.documentElement]],ns)}function zr(){return this}Fe.prototype=on.prototype={constructor:Fe,select:rl,selectAll:fl,selectChild:gl,selectChildren:wl,filter:bl,data:$l,enter:xl,exit:Ml,join:Il,merge:Dl,selection:zr,order:Tl,sort:Pl,call:Ol,nodes:zl,node:Bl,size:Vl,empty:Rl,each:Hl,attr:Xl,style:jl,property:tr,classed:sr,text:ur,html:hr,raise:pr,lower:mr,append:yr,insert:wr,remove:xr,clone:kr,datum:Nr,on:Dr,dispatch:Ar,[Symbol.iterator]:Or};function Ye(e){return typeof e=="string"?new Fe([[document.querySelector(e)]],[document.documentElement]):new Fe([[e]],ns)}function Br(e){let t;for(;t=e.sourceEvent;)e=t;return e}function Ke(e,t){if(e=Br(e),t===void 0&&(t=e.currentTarget),t){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var o=n.createSVGPoint();return o.x=e.clientX,o.y=e.clientY,o=o.matrixTransform(t.getScreenCTM().inverse()),[o.x,o.y]}if(t.getBoundingClientRect){var i=t.getBoundingClientRect();return[e.clientX-i.left-t.clientLeft,e.clientY-i.top-t.clientTop]}}return[e.pageX,e.pageY]}const Vr={passive:!1},Kt={capture:!0,passive:!1};function Un(e){e.stopImmediatePropagation()}function $t(e){e.preventDefault(),e.stopImmediatePropagation()}function os(e){var t=e.document.documentElement,n=Ye(e).on("dragstart.drag",$t,Kt);"onselectstart"in t?n.on("selectstart.drag",$t,Kt):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function is(e,t){var n=e.document.documentElement,o=Ye(e).on("dragstart.drag",null);t&&(o.on("click.drag",$t,Kt),setTimeout(function(){o.on("click.drag",null)},0)),"onselectstart"in n?o.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}const ln=e=>()=>e;function so(e,{sourceEvent:t,subject:n,target:o,identifier:i,active:s,x:a,y:l,dx:r,dy:u,dispatch:c}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:o,enumerable:!0,configurable:!0},identifier:{value:i,enumerable:!0,configurable:!0},active:{value:s,enumerable:!0,configurable:!0},x:{value:a,enumerable:!0,configurable:!0},y:{value:l,enumerable:!0,configurable:!0},dx:{value:r,enumerable:!0,configurable:!0},dy:{value:u,enumerable:!0,configurable:!0},_:{value:c}})}so.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function Rr(e){return!e.ctrlKey&&!e.button}function Hr(){return this.parentNode}function Lr(e,t){return t??{x:e.x,y:e.y}}function Fr(){return navigator.maxTouchPoints||"ontouchstart"in this}function Gr(){var e=Rr,t=Hr,n=Lr,o=Fr,i={},s=Pn("start","drag","end"),a=0,l,r,u,c,f=0;function d(C){C.on("mousedown.drag",_).filter(o).on("touchstart.drag",m).on("touchmove.drag",w,Vr).on("touchend.drag touchcancel.drag",g).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function _(C,O){if(!(c||!e.call(this,C,O))){var F=v(this,t.call(this,C,O),C,O,"mouse");F&&(Ye(C.view).on("mousemove.drag",k,Kt).on("mouseup.drag",p,Kt),os(C.view),Un(C),u=!1,l=C.clientX,r=C.clientY,F("start",C))}}function k(C){if($t(C),!u){var O=C.clientX-l,F=C.clientY-r;u=O*O+F*F>f}i.mouse("drag",C)}function p(C){Ye(C.view).on("mousemove.drag mouseup.drag",null),is(C.view,u),$t(C),i.mouse("end",C)}function m(C,O){if(e.call(this,C,O)){var F=C.changedTouches,L=t.call(this,C,O),R=F.length,se,K;for(se=0;se<R;++se)(K=v(this,L,C,O,F[se].identifier,F[se]))&&(Un(C),K("start",C,F[se]))}}function w(C){var O=C.changedTouches,F=O.length,L,R;for(L=0;L<F;++L)(R=i[O[L].identifier])&&($t(C),R("drag",C,O[L]))}function g(C){var O=C.changedTouches,F=O.length,L,R;for(c&&clearTimeout(c),c=setTimeout(function(){c=null},500),L=0;L<F;++L)(R=i[O[L].identifier])&&(Un(C),R("end",C,O[L]))}function v(C,O,F,L,R,se){var K=s.copy(),H=Ke(se||F,O),M,oe,x;if((x=n.call(C,new so("beforestart",{sourceEvent:F,target:d,identifier:R,active:a,x:H[0],y:H[1],dx:0,dy:0,dispatch:K}),L))!=null)return M=x.x-H[0]||0,oe=x.y-H[1]||0,function I(b,A,V){var W=H,U;switch(b){case"start":i[R]=I,U=a++;break;case"end":delete i[R],--a;case"drag":H=Ke(V||A,O),U=a;break}K.call(b,C,new so(b,{sourceEvent:A,subject:x,target:d,identifier:R,active:U,x:H[0]+M,y:H[1]+oe,dx:H[0]-W[0],dy:H[1]-W[1],dispatch:K}),L)}}return d.filter=function(C){return arguments.length?(e=typeof C=="function"?C:ln(!!C),d):e},d.container=function(C){return arguments.length?(t=typeof C=="function"?C:ln(C),d):t},d.subject=function(C){return arguments.length?(n=typeof C=="function"?C:ln(C),d):n},d.touchable=function(C){return arguments.length?(o=typeof C=="function"?C:ln(!!C),d):o},d.on=function(){var C=s.on.apply(s,arguments);return C===s?d:C},d.clickDistance=function(C){return arguments.length?(f=(C=+C)*C,d):Math.sqrt(f)},d}function Eo(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function ss(e,t){var n=Object.create(e.prototype);for(var o in t)n[o]=t[o];return n}function sn(){}var qt=.7,En=1/qt,Ct="\\s*([+-]?\\d+)\\s*",jt="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Je="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Wr=/^#([0-9a-f]{3,8})$/,Yr=new RegExp(`^rgb\\(${Ct},${Ct},${Ct}\\)$`),Ur=new RegExp(`^rgb\\(${Je},${Je},${Je}\\)$`),Xr=new RegExp(`^rgba\\(${Ct},${Ct},${Ct},${jt}\\)$`),Zr=new RegExp(`^rgba\\(${Je},${Je},${Je},${jt}\\)$`),Kr=new RegExp(`^hsl\\(${jt},${Je},${Je}\\)$`),qr=new RegExp(`^hsla\\(${jt},${Je},${Je},${jt}\\)$`),Lo={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};Eo(sn,wt,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:Fo,formatHex:Fo,formatHex8:jr,formatHsl:Jr,formatRgb:Go,toString:Go});function Fo(){return this.rgb().formatHex()}function jr(){return this.rgb().formatHex8()}function Jr(){return as(this).formatHsl()}function Go(){return this.rgb().formatRgb()}function wt(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=Wr.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?Wo(t):n===3?new He(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?rn(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?rn(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=Yr.exec(e))?new He(t[1],t[2],t[3],1):(t=Ur.exec(e))?new He(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=Xr.exec(e))?rn(t[1],t[2],t[3],t[4]):(t=Zr.exec(e))?rn(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=Kr.exec(e))?Xo(t[1],t[2]/100,t[3]/100,1):(t=qr.exec(e))?Xo(t[1],t[2]/100,t[3]/100,t[4]):Lo.hasOwnProperty(e)?Wo(Lo[e]):e==="transparent"?new He(NaN,NaN,NaN,0):null}function Wo(e){return new He(e>>16&255,e>>8&255,e&255,1)}function rn(e,t,n,o){return o<=0&&(e=t=n=NaN),new He(e,t,n,o)}function Qr(e){return e instanceof sn||(e=wt(e)),e?(e=e.rgb(),new He(e.r,e.g,e.b,e.opacity)):new He}function ao(e,t,n,o){return arguments.length===1?Qr(e):new He(e,t,n,o??1)}function He(e,t,n,o){this.r=+e,this.g=+t,this.b=+n,this.opacity=+o}Eo(He,ao,ss(sn,{brighter(e){return e=e==null?En:Math.pow(En,e),new He(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?qt:Math.pow(qt,e),new He(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new He(yt(this.r),yt(this.g),yt(this.b),kn(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:Yo,formatHex:Yo,formatHex8:eu,formatRgb:Uo,toString:Uo}));function Yo(){return`#${mt(this.r)}${mt(this.g)}${mt(this.b)}`}function eu(){return`#${mt(this.r)}${mt(this.g)}${mt(this.b)}${mt((isNaN(this.opacity)?1:this.opacity)*255)}`}function Uo(){const e=kn(this.opacity);return`${e===1?"rgb(":"rgba("}${yt(this.r)}, ${yt(this.g)}, ${yt(this.b)}${e===1?")":`, ${e})`}`}function kn(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function yt(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function mt(e){return e=yt(e),(e<16?"0":"")+e.toString(16)}function Xo(e,t,n,o){return o<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Ue(e,t,n,o)}function as(e){if(e instanceof Ue)return new Ue(e.h,e.s,e.l,e.opacity);if(e instanceof sn||(e=wt(e)),!e)return new Ue;if(e instanceof Ue)return e;e=e.rgb();var t=e.r/255,n=e.g/255,o=e.b/255,i=Math.min(t,n,o),s=Math.max(t,n,o),a=NaN,l=s-i,r=(s+i)/2;return l?(t===s?a=(n-o)/l+(n<o)*6:n===s?a=(o-t)/l+2:a=(t-n)/l+4,l/=r<.5?s+i:2-s-i,a*=60):l=r>0&&r<1?0:a,new Ue(a,l,r,e.opacity)}function tu(e,t,n,o){return arguments.length===1?as(e):new Ue(e,t,n,o??1)}function Ue(e,t,n,o){this.h=+e,this.s=+t,this.l=+n,this.opacity=+o}Eo(Ue,tu,ss(sn,{brighter(e){return e=e==null?En:Math.pow(En,e),new Ue(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?qt:Math.pow(qt,e),new Ue(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,o=n+(n<.5?n:1-n)*t,i=2*n-o;return new He(Xn(e>=240?e-240:e+120,i,o),Xn(e,i,o),Xn(e<120?e+240:e-120,i,o),this.opacity)},clamp(){return new Ue(Zo(this.h),un(this.s),un(this.l),kn(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=kn(this.opacity);return`${e===1?"hsl(":"hsla("}${Zo(this.h)}, ${un(this.s)*100}%, ${un(this.l)*100}%${e===1?")":`, ${e})`}`}}));function Zo(e){return e=(e||0)%360,e<0?e+360:e}function un(e){return Math.max(0,Math.min(1,e||0))}function Xn(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}const ko=e=>()=>e;function nu(e,t){return function(n){return e+n*t}}function ou(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(o){return Math.pow(e+o*t,n)}}function iu(e){return(e=+e)==1?ls:function(t,n){return n-t?ou(t,n,e):ko(isNaN(t)?n:t)}}function ls(e,t){var n=t-e;return n?nu(e,n):ko(isNaN(e)?t:e)}const Nn=(function e(t){var n=iu(t);function o(i,s){var a=n((i=ao(i)).r,(s=ao(s)).r),l=n(i.g,s.g),r=n(i.b,s.b),u=ls(i.opacity,s.opacity);return function(c){return i.r=a(c),i.g=l(c),i.b=r(c),i.opacity=u(c),i+""}}return o.gamma=e,o})(1);function su(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,o=t.slice(),i;return function(s){for(i=0;i<n;++i)o[i]=e[i]*(1-s)+t[i]*s;return o}}function au(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function lu(e,t){var n=t?t.length:0,o=e?Math.min(n,e.length):0,i=new Array(o),s=new Array(n),a;for(a=0;a<o;++a)i[a]=Gt(e[a],t[a]);for(;a<n;++a)s[a]=t[a];return function(l){for(a=0;a<o;++a)s[a]=i[a](l);return s}}function ru(e,t){var n=new Date;return e=+e,t=+t,function(o){return n.setTime(e*(1-o)+t*o),n}}function qe(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function uu(e,t){var n={},o={},i;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(i in t)i in e?n[i]=Gt(e[i],t[i]):o[i]=t[i];return function(s){for(i in n)o[i]=n[i](s);return o}}var lo=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Zn=new RegExp(lo.source,"g");function cu(e){return function(){return e}}function du(e){return function(t){return e(t)+""}}function rs(e,t){var n=lo.lastIndex=Zn.lastIndex=0,o,i,s,a=-1,l=[],r=[];for(e=e+"",t=t+"";(o=lo.exec(e))&&(i=Zn.exec(t));)(s=i.index)>n&&(s=t.slice(n,s),l[a]?l[a]+=s:l[++a]=s),(o=o[0])===(i=i[0])?l[a]?l[a]+=i:l[++a]=i:(l[++a]=null,r.push({i:a,x:qe(o,i)})),n=Zn.lastIndex;return n<t.length&&(s=t.slice(n),l[a]?l[a]+=s:l[++a]=s),l.length<2?r[0]?du(r[0].x):cu(t):(t=r.length,function(u){for(var c=0,f;c<t;++c)l[(f=r[c]).i]=f.x(u);return l.join("")})}function Gt(e,t){var n=typeof t,o;return t==null||n==="boolean"?ko(t):(n==="number"?qe:n==="string"?(o=wt(t))?(t=o,Nn):rs:t instanceof wt?Nn:t instanceof Date?ru:au(t)?su:Array.isArray(t)?lu:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?uu:qe)(e,t)}var Ko=180/Math.PI,ro={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function us(e,t,n,o,i,s){var a,l,r;return(a=Math.sqrt(e*e+t*t))&&(e/=a,t/=a),(r=e*n+t*o)&&(n-=e*r,o-=t*r),(l=Math.sqrt(n*n+o*o))&&(n/=l,o/=l,r/=l),e*o<t*n&&(e=-e,t=-t,r=-r,a=-a),{translateX:i,translateY:s,rotate:Math.atan2(t,e)*Ko,skewX:Math.atan(r)*Ko,scaleX:a,scaleY:l}}var cn;function fu(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?ro:us(t.a,t.b,t.c,t.d,t.e,t.f)}function hu(e){return e==null||(cn||(cn=document.createElementNS("http://www.w3.org/2000/svg","g")),cn.setAttribute("transform",e),!(e=cn.transform.baseVal.consolidate()))?ro:(e=e.matrix,us(e.a,e.b,e.c,e.d,e.e,e.f))}function cs(e,t,n,o){function i(u){return u.length?u.pop()+" ":""}function s(u,c,f,d,_,k){if(u!==f||c!==d){var p=_.push("translate(",null,t,null,n);k.push({i:p-4,x:qe(u,f)},{i:p-2,x:qe(c,d)})}else(f||d)&&_.push("translate("+f+t+d+n)}function a(u,c,f,d){u!==c?(u-c>180?c+=360:c-u>180&&(u+=360),d.push({i:f.push(i(f)+"rotate(",null,o)-2,x:qe(u,c)})):c&&f.push(i(f)+"rotate("+c+o)}function l(u,c,f,d){u!==c?d.push({i:f.push(i(f)+"skewX(",null,o)-2,x:qe(u,c)}):c&&f.push(i(f)+"skewX("+c+o)}function r(u,c,f,d,_,k){if(u!==f||c!==d){var p=_.push(i(_)+"scale(",null,",",null,")");k.push({i:p-4,x:qe(u,f)},{i:p-2,x:qe(c,d)})}else(f!==1||d!==1)&&_.push(i(_)+"scale("+f+","+d+")")}return function(u,c){var f=[],d=[];return u=e(u),c=e(c),s(u.translateX,u.translateY,c.translateX,c.translateY,f,d),a(u.rotate,c.rotate,f,d),l(u.skewX,c.skewX,f,d),r(u.scaleX,u.scaleY,c.scaleX,c.scaleY,f,d),u=c=null,function(_){for(var k=-1,p=d.length,m;++k<p;)f[(m=d[k]).i]=m.x(_);return f.join("")}}}var vu=cs(fu,"px, ","px)","deg)"),pu=cs(hu,", ",")",")"),gu=1e-12;function qo(e){return((e=Math.exp(e))+1/e)/2}function mu(e){return((e=Math.exp(e))-1/e)/2}function yu(e){return((e=Math.exp(2*e))-1)/(e+1)}const _n=(function e(t,n,o){function i(s,a){var l=s[0],r=s[1],u=s[2],c=a[0],f=a[1],d=a[2],_=c-l,k=f-r,p=_*_+k*k,m,w;if(p<gu)w=Math.log(d/u)/t,m=function(L){return[l+L*_,r+L*k,u*Math.exp(t*L*w)]};else{var g=Math.sqrt(p),v=(d*d-u*u+o*p)/(2*u*n*g),C=(d*d-u*u-o*p)/(2*d*n*g),O=Math.log(Math.sqrt(v*v+1)-v),F=Math.log(Math.sqrt(C*C+1)-C);w=(F-O)/t,m=function(L){var R=L*w,se=qo(O),K=u/(n*g)*(se*yu(t*R+O)-mu(O));return[l+K*_,r+K*k,u*se/qo(t*R+O)]}}return m.duration=w*1e3*t/Math.SQRT2,m}return i.rho=function(s){var a=Math.max(.001,+s),l=a*a,r=l*l;return e(a,l,r)},i})(Math.SQRT2,2,4);var Tt=0,Ht=0,Vt=0,ds=1e3,$n,Lt,Cn=0,bt=0,On=0,Jt=typeof performance=="object"&&performance.now?performance:Date,fs=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function No(){return bt||(fs(_u),bt=Jt.now()+On)}function _u(){bt=0}function Mn(){this._call=this._time=this._next=null}Mn.prototype=hs.prototype={constructor:Mn,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?No():+n)+(t==null?0:+t),!this._next&&Lt!==this&&(Lt?Lt._next=this:$n=this,Lt=this),this._call=e,this._time=n,uo()},stop:function(){this._call&&(this._call=null,this._time=1/0,uo())}};function hs(e,t,n){var o=new Mn;return o.restart(e,t,n),o}function wu(){No(),++Tt;for(var e=$n,t;e;)(t=bt-e._time)>=0&&e._call.call(void 0,t),e=e._next;--Tt}function jo(){bt=(Cn=Jt.now())+On,Tt=Ht=0;try{wu()}finally{Tt=0,xu(),bt=0}}function bu(){var e=Jt.now(),t=e-Cn;t>ds&&(On-=t,Cn=e)}function xu(){for(var e,t=$n,n,o=1/0;t;)t._call?(o>t._time&&(o=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:$n=n);Lt=e,uo(o)}function uo(e){if(!Tt){Ht&&(Ht=clearTimeout(Ht));var t=e-bt;t>24?(e<1/0&&(Ht=setTimeout(jo,e-Jt.now()-On)),Vt&&(Vt=clearInterval(Vt))):(Vt||(Cn=Jt.now(),Vt=setInterval(bu,ds)),Tt=1,fs(jo))}}function Jo(e,t,n){var o=new Mn;return t=t==null?0:+t,o.restart(i=>{o.stop(),e(i+t)},t,n),o}var Su=Pn("start","end","cancel","interrupt"),Eu=[],vs=0,Qo=1,co=2,wn=3,ei=4,fo=5,bn=6;function zn(e,t,n,o,i,s){var a=e.__transition;if(!a)e.__transition={};else if(n in a)return;ku(e,n,{name:t,index:o,group:i,on:Su,tween:Eu,time:s.time,delay:s.delay,duration:s.duration,ease:s.ease,timer:null,state:vs})}function $o(e,t){var n=Ze(e,t);if(n.state>vs)throw new Error("too late; already scheduled");return n}function et(e,t){var n=Ze(e,t);if(n.state>wn)throw new Error("too late; already running");return n}function Ze(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function ku(e,t,n){var o=e.__transition,i;o[t]=n,n.timer=hs(s,0,n.time);function s(u){n.state=Qo,n.timer.restart(a,n.delay,n.time),n.delay<=u&&a(u-n.delay)}function a(u){var c,f,d,_;if(n.state!==Qo)return r();for(c in o)if(_=o[c],_.name===n.name){if(_.state===wn)return Jo(a);_.state===ei?(_.state=bn,_.timer.stop(),_.on.call("interrupt",e,e.__data__,_.index,_.group),delete o[c]):+c<t&&(_.state=bn,_.timer.stop(),_.on.call("cancel",e,e.__data__,_.index,_.group),delete o[c])}if(Jo(function(){n.state===wn&&(n.state=ei,n.timer.restart(l,n.delay,n.time),l(u))}),n.state=co,n.on.call("start",e,e.__data__,n.index,n.group),n.state===co){for(n.state=wn,i=new Array(d=n.tween.length),c=0,f=-1;c<d;++c)(_=n.tween[c].value.call(e,e.__data__,n.index,n.group))&&(i[++f]=_);i.length=f+1}}function l(u){for(var c=u<n.duration?n.ease.call(null,u/n.duration):(n.timer.restart(r),n.state=fo,1),f=-1,d=i.length;++f<d;)i[f].call(e,c);n.state===fo&&(n.on.call("end",e,e.__data__,n.index,n.group),r())}function r(){n.state=bn,n.timer.stop(),delete o[t];for(var u in o)return;delete e.__transition}}function xn(e,t){var n=e.__transition,o,i,s=!0,a;if(n){t=t==null?null:t+"";for(a in n){if((o=n[a]).name!==t){s=!1;continue}i=o.state>co&&o.state<fo,o.state=bn,o.timer.stop(),o.on.call(i?"interrupt":"cancel",e,e.__data__,o.index,o.group),delete n[a]}s&&delete e.__transition}}function Nu(e){return this.each(function(){xn(this,e)})}function $u(e,t){var n,o;return function(){var i=et(this,e),s=i.tween;if(s!==n){o=n=s;for(var a=0,l=o.length;a<l;++a)if(o[a].name===t){o=o.slice(),o.splice(a,1);break}}i.tween=o}}function Cu(e,t,n){var o,i;if(typeof n!="function")throw new Error;return function(){var s=et(this,e),a=s.tween;if(a!==o){i=(o=a).slice();for(var l={name:t,value:n},r=0,u=i.length;r<u;++r)if(i[r].name===t){i[r]=l;break}r===u&&i.push(l)}s.tween=i}}function Mu(e,t){var n=this._id;if(e+="",arguments.length<2){for(var o=Ze(this.node(),n).tween,i=0,s=o.length,a;i<s;++i)if((a=o[i]).name===e)return a.value;return null}return this.each((t==null?$u:Cu)(n,e,t))}function Co(e,t,n){var o=e._id;return e.each(function(){var i=et(this,o);(i.value||(i.value={}))[t]=n.apply(this,arguments)}),function(i){return Ze(i,o).value[t]}}function ps(e,t){var n;return(typeof t=="number"?qe:t instanceof wt?Nn:(n=wt(t))?(t=n,Nn):rs)(e,t)}function Iu(e){return function(){this.removeAttribute(e)}}function Du(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Tu(e,t,n){var o,i=n+"",s;return function(){var a=this.getAttribute(e);return a===i?null:a===o?s:s=t(o=a,n)}}function Pu(e,t,n){var o,i=n+"",s;return function(){var a=this.getAttributeNS(e.space,e.local);return a===i?null:a===o?s:s=t(o=a,n)}}function Au(e,t,n){var o,i,s;return function(){var a,l=n(this),r;return l==null?void this.removeAttribute(e):(a=this.getAttribute(e),r=l+"",a===r?null:a===o&&r===i?s:(i=r,s=t(o=a,l)))}}function Ou(e,t,n){var o,i,s;return function(){var a,l=n(this),r;return l==null?void this.removeAttributeNS(e.space,e.local):(a=this.getAttributeNS(e.space,e.local),r=l+"",a===r?null:a===o&&r===i?s:(i=r,s=t(o=a,l)))}}function zu(e,t){var n=An(e),o=n==="transform"?pu:ps;return this.attrTween(e,typeof t=="function"?(n.local?Ou:Au)(n,o,Co(this,"attr."+e,t)):t==null?(n.local?Du:Iu)(n):(n.local?Pu:Tu)(n,o,t))}function Bu(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function Vu(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function Ru(e,t){var n,o;function i(){var s=t.apply(this,arguments);return s!==o&&(n=(o=s)&&Vu(e,s)),n}return i._value=t,i}function Hu(e,t){var n,o;function i(){var s=t.apply(this,arguments);return s!==o&&(n=(o=s)&&Bu(e,s)),n}return i._value=t,i}function Lu(e,t){var n="attr."+e;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(t==null)return this.tween(n,null);if(typeof t!="function")throw new Error;var o=An(e);return this.tween(n,(o.local?Ru:Hu)(o,t))}function Fu(e,t){return function(){$o(this,e).delay=+t.apply(this,arguments)}}function Gu(e,t){return t=+t,function(){$o(this,e).delay=t}}function Wu(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?Fu:Gu)(t,e)):Ze(this.node(),t).delay}function Yu(e,t){return function(){et(this,e).duration=+t.apply(this,arguments)}}function Uu(e,t){return t=+t,function(){et(this,e).duration=t}}function Xu(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?Yu:Uu)(t,e)):Ze(this.node(),t).duration}function Zu(e,t){if(typeof t!="function")throw new Error;return function(){et(this,e).ease=t}}function Ku(e){var t=this._id;return arguments.length?this.each(Zu(t,e)):Ze(this.node(),t).ease}function qu(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;et(this,e).ease=n}}function ju(e){if(typeof e!="function")throw new Error;return this.each(qu(this._id,e))}function Ju(e){typeof e!="function"&&(e=Xi(e));for(var t=this._groups,n=t.length,o=new Array(n),i=0;i<n;++i)for(var s=t[i],a=s.length,l=o[i]=[],r,u=0;u<a;++u)(r=s[u])&&e.call(r,r.__data__,u,s)&&l.push(r);return new at(o,this._parents,this._name,this._id)}function Qu(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,n=e._groups,o=t.length,i=n.length,s=Math.min(o,i),a=new Array(o),l=0;l<s;++l)for(var r=t[l],u=n[l],c=r.length,f=a[l]=new Array(c),d,_=0;_<c;++_)(d=r[_]||u[_])&&(f[_]=d);for(;l<o;++l)a[l]=t[l];return new at(a,this._parents,this._name,this._id)}function ec(e){return(e+"").trim().split(/^|\s+/).every(function(t){var n=t.indexOf(".");return n>=0&&(t=t.slice(0,n)),!t||t==="start"})}function tc(e,t,n){var o,i,s=ec(t)?$o:et;return function(){var a=s(this,e),l=a.on;l!==o&&(i=(o=l).copy()).on(t,n),a.on=i}}function nc(e,t){var n=this._id;return arguments.length<2?Ze(this.node(),n).on.on(e):this.each(tc(n,e,t))}function oc(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function ic(){return this.on("end.remove",oc(this._id))}function sc(e){var t=this._name,n=this._id;typeof e!="function"&&(e=xo(e));for(var o=this._groups,i=o.length,s=new Array(i),a=0;a<i;++a)for(var l=o[a],r=l.length,u=s[a]=new Array(r),c,f,d=0;d<r;++d)(c=l[d])&&(f=e.call(c,c.__data__,d,l))&&("__data__"in c&&(f.__data__=c.__data__),u[d]=f,zn(u[d],t,n,d,u,Ze(c,n)));return new at(s,this._parents,t,n)}function ac(e){var t=this._name,n=this._id;typeof e!="function"&&(e=Ui(e));for(var o=this._groups,i=o.length,s=[],a=[],l=0;l<i;++l)for(var r=o[l],u=r.length,c,f=0;f<u;++f)if(c=r[f]){for(var d=e.call(c,c.__data__,f,r),_,k=Ze(c,n),p=0,m=d.length;p<m;++p)(_=d[p])&&zn(_,t,n,p,d,k);s.push(d),a.push(c)}return new at(s,a,t,n)}var lc=on.prototype.constructor;function rc(){return new lc(this._groups,this._parents)}function uc(e,t){var n,o,i;return function(){var s=Dt(this,e),a=(this.style.removeProperty(e),Dt(this,e));return s===a?null:s===n&&a===o?i:i=t(n=s,o=a)}}function gs(e){return function(){this.style.removeProperty(e)}}function cc(e,t,n){var o,i=n+"",s;return function(){var a=Dt(this,e);return a===i?null:a===o?s:s=t(o=a,n)}}function dc(e,t,n){var o,i,s;return function(){var a=Dt(this,e),l=n(this),r=l+"";return l==null&&(r=l=(this.style.removeProperty(e),Dt(this,e))),a===r?null:a===o&&r===i?s:(i=r,s=t(o=a,l))}}function fc(e,t){var n,o,i,s="style."+t,a="end."+s,l;return function(){var r=et(this,e),u=r.on,c=r.value[s]==null?l||(l=gs(t)):void 0;(u!==n||i!==c)&&(o=(n=u).copy()).on(a,i=c),r.on=o}}function hc(e,t,n){var o=(e+="")=="transform"?vu:ps;return t==null?this.styleTween(e,uc(e,o)).on("end.style."+e,gs(e)):typeof t=="function"?this.styleTween(e,dc(e,o,Co(this,"style."+e,t))).each(fc(this._id,e)):this.styleTween(e,cc(e,o,t),n).on("end.style."+e,null)}function vc(e,t,n){return function(o){this.style.setProperty(e,t.call(this,o),n)}}function pc(e,t,n){var o,i;function s(){var a=t.apply(this,arguments);return a!==i&&(o=(i=a)&&vc(e,a,n)),o}return s._value=t,s}function gc(e,t,n){var o="style."+(e+="");if(arguments.length<2)return(o=this.tween(o))&&o._value;if(t==null)return this.tween(o,null);if(typeof t!="function")throw new Error;return this.tween(o,pc(e,t,n??""))}function mc(e){return function(){this.textContent=e}}function yc(e){return function(){var t=e(this);this.textContent=t??""}}function _c(e){return this.tween("text",typeof e=="function"?yc(Co(this,"text",e)):mc(e==null?"":e+""))}function wc(e){return function(t){this.textContent=e.call(this,t)}}function bc(e){var t,n;function o(){var i=e.apply(this,arguments);return i!==n&&(t=(n=i)&&wc(i)),t}return o._value=e,o}function xc(e){var t="text";if(arguments.length<1)return(t=this.tween(t))&&t._value;if(e==null)return this.tween(t,null);if(typeof e!="function")throw new Error;return this.tween(t,bc(e))}function Sc(){for(var e=this._name,t=this._id,n=ms(),o=this._groups,i=o.length,s=0;s<i;++s)for(var a=o[s],l=a.length,r,u=0;u<l;++u)if(r=a[u]){var c=Ze(r,t);zn(r,e,n,u,a,{time:c.time+c.delay+c.duration,delay:0,duration:c.duration,ease:c.ease})}return new at(o,this._parents,e,n)}function Ec(){var e,t,n=this,o=n._id,i=n.size();return new Promise(function(s,a){var l={value:a},r={value:function(){--i===0&&s()}};n.each(function(){var u=et(this,o),c=u.on;c!==e&&(t=(e=c).copy(),t._.cancel.push(l),t._.interrupt.push(l),t._.end.push(r)),u.on=t}),i===0&&s()})}var kc=0;function at(e,t,n,o){this._groups=e,this._parents=t,this._name=n,this._id=o}function ms(){return++kc}var nt=on.prototype;at.prototype={constructor:at,select:sc,selectAll:ac,selectChild:nt.selectChild,selectChildren:nt.selectChildren,filter:Ju,merge:Qu,selection:rc,transition:Sc,call:nt.call,nodes:nt.nodes,node:nt.node,size:nt.size,empty:nt.empty,each:nt.each,on:nc,attr:zu,attrTween:Lu,style:hc,styleTween:gc,text:_c,textTween:xc,remove:ic,tween:Mu,delay:Wu,duration:Xu,ease:Ku,easeVarying:ju,end:Ec,[Symbol.iterator]:nt[Symbol.iterator]};function Nc(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var $c={time:null,delay:0,duration:250,ease:Nc};function Cc(e,t){for(var n;!(n=e.__transition)||!(n=n[t]);)if(!(e=e.parentNode))throw new Error(`transition ${t} not found`);return n}function Mc(e){var t,n;e instanceof at?(t=e._id,e=e._name):(t=ms(),(n=$c).time=No(),e=e==null?null:e+"");for(var o=this._groups,i=o.length,s=0;s<i;++s)for(var a=o[s],l=a.length,r,u=0;u<l;++u)(r=a[u])&&zn(r,e,t,u,a,n||Cc(r,t));return new at(o,this._parents,e,t)}on.prototype.interrupt=Nu;on.prototype.transition=Mc;const dn=e=>()=>e;function Ic(e,{sourceEvent:t,target:n,transform:o,dispatch:i}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:o,enumerable:!0,configurable:!0},_:{value:i}})}function it(e,t,n){this.k=e,this.x=t,this.y=n}it.prototype={constructor:it,scale:function(e){return e===1?this:new it(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new it(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var Pt=new it(1,0,0);it.prototype;function Kn(e){e.stopImmediatePropagation()}function Rt(e){e.preventDefault(),e.stopImmediatePropagation()}function Dc(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function Tc(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e,e.hasAttribute("viewBox")?(e=e.viewBox.baseVal,[[e.x,e.y],[e.x+e.width,e.y+e.height]]):[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]):[[0,0],[e.clientWidth,e.clientHeight]]}function ti(){return this.__zoom||Pt}function Pc(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function Ac(){return navigator.maxTouchPoints||"ontouchstart"in this}function Oc(e,t,n){var o=e.invertX(t[0][0])-n[0][0],i=e.invertX(t[1][0])-n[1][0],s=e.invertY(t[0][1])-n[0][1],a=e.invertY(t[1][1])-n[1][1];return e.translate(i>o?(o+i)/2:Math.min(0,o)||Math.max(0,i),a>s?(s+a)/2:Math.min(0,s)||Math.max(0,a))}function zc(){var e=Dc,t=Tc,n=Oc,o=Pc,i=Ac,s=[0,1/0],a=[[-1/0,-1/0],[1/0,1/0]],l=250,r=_n,u=Pn("start","zoom","end"),c,f,d,_=500,k=150,p=0,m=10;function w(x){x.property("__zoom",ti).on("wheel.zoom",R,{passive:!1}).on("mousedown.zoom",se).on("dblclick.zoom",K).filter(i).on("touchstart.zoom",H).on("touchmove.zoom",M).on("touchend.zoom touchcancel.zoom",oe).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}w.transform=function(x,I,b,A){var V=x.selection?x.selection():x;V.property("__zoom",ti),x!==V?O(x,I,b,A):V.interrupt().each(function(){F(this,arguments).event(A).start().zoom(null,typeof I=="function"?I.apply(this,arguments):I).end()})},w.scaleBy=function(x,I,b,A){w.scaleTo(x,function(){var V=this.__zoom.k,W=typeof I=="function"?I.apply(this,arguments):I;return V*W},b,A)},w.scaleTo=function(x,I,b,A){w.transform(x,function(){var V=t.apply(this,arguments),W=this.__zoom,U=b==null?C(V):typeof b=="function"?b.apply(this,arguments):b,te=W.invert(U),re=typeof I=="function"?I.apply(this,arguments):I;return n(v(g(W,re),U,te),V,a)},b,A)},w.translateBy=function(x,I,b,A){w.transform(x,function(){return n(this.__zoom.translate(typeof I=="function"?I.apply(this,arguments):I,typeof b=="function"?b.apply(this,arguments):b),t.apply(this,arguments),a)},null,A)},w.translateTo=function(x,I,b,A,V){w.transform(x,function(){var W=t.apply(this,arguments),U=this.__zoom,te=A==null?C(W):typeof A=="function"?A.apply(this,arguments):A;return n(Pt.translate(te[0],te[1]).scale(U.k).translate(typeof I=="function"?-I.apply(this,arguments):-I,typeof b=="function"?-b.apply(this,arguments):-b),W,a)},A,V)};function g(x,I){return I=Math.max(s[0],Math.min(s[1],I)),I===x.k?x:new it(I,x.x,x.y)}function v(x,I,b){var A=I[0]-b[0]*x.k,V=I[1]-b[1]*x.k;return A===x.x&&V===x.y?x:new it(x.k,A,V)}function C(x){return[(+x[0][0]+ +x[1][0])/2,(+x[0][1]+ +x[1][1])/2]}function O(x,I,b,A){x.on("start.zoom",function(){F(this,arguments).event(A).start()}).on("interrupt.zoom end.zoom",function(){F(this,arguments).event(A).end()}).tween("zoom",function(){var V=this,W=arguments,U=F(V,W).event(A),te=t.apply(V,W),re=b==null?C(te):typeof b=="function"?b.apply(V,W):b,fe=Math.max(te[1][0]-te[0][0],te[1][1]-te[0][1]),ge=V.__zoom,j=typeof I=="function"?I.apply(V,W):I,ne=r(ge.invert(re).concat(fe/ge.k),j.invert(re).concat(fe/j.k));return function(ee){if(ee===1)ee=j;else{var ce=ne(ee),me=fe/ce[2];ee=new it(me,re[0]-ce[0]*me,re[1]-ce[1]*me)}U.zoom(null,ee)}})}function F(x,I,b){return!b&&x.__zooming||new L(x,I)}function L(x,I){this.that=x,this.args=I,this.active=0,this.sourceEvent=null,this.extent=t.apply(x,I),this.taps=0}L.prototype={event:function(x){return x&&(this.sourceEvent=x),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(x,I){return this.mouse&&x!=="mouse"&&(this.mouse[1]=I.invert(this.mouse[0])),this.touch0&&x!=="touch"&&(this.touch0[1]=I.invert(this.touch0[0])),this.touch1&&x!=="touch"&&(this.touch1[1]=I.invert(this.touch1[0])),this.that.__zoom=I,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(x){var I=Ye(this.that).datum();u.call(x,this.that,new Ic(x,{sourceEvent:this.sourceEvent,target:w,transform:this.that.__zoom,dispatch:u}),I)}};function R(x,...I){if(!e.apply(this,arguments))return;var b=F(this,I).event(x),A=this.__zoom,V=Math.max(s[0],Math.min(s[1],A.k*Math.pow(2,o.apply(this,arguments)))),W=Ke(x);if(b.wheel)(b.mouse[0][0]!==W[0]||b.mouse[0][1]!==W[1])&&(b.mouse[1]=A.invert(b.mouse[0]=W)),clearTimeout(b.wheel);else{if(A.k===V)return;b.mouse=[W,A.invert(W)],xn(this),b.start()}Rt(x),b.wheel=setTimeout(U,k),b.zoom("mouse",n(v(g(A,V),b.mouse[0],b.mouse[1]),b.extent,a));function U(){b.wheel=null,b.end()}}function se(x,...I){if(d||!e.apply(this,arguments))return;var b=x.currentTarget,A=F(this,I,!0).event(x),V=Ye(x.view).on("mousemove.zoom",re,!0).on("mouseup.zoom",fe,!0),W=Ke(x,b),U=x.clientX,te=x.clientY;os(x.view),Kn(x),A.mouse=[W,this.__zoom.invert(W)],xn(this),A.start();function re(ge){if(Rt(ge),!A.moved){var j=ge.clientX-U,ne=ge.clientY-te;A.moved=j*j+ne*ne>p}A.event(ge).zoom("mouse",n(v(A.that.__zoom,A.mouse[0]=Ke(ge,b),A.mouse[1]),A.extent,a))}function fe(ge){V.on("mousemove.zoom mouseup.zoom",null),is(ge.view,A.moved),Rt(ge),A.event(ge).end()}}function K(x,...I){if(e.apply(this,arguments)){var b=this.__zoom,A=Ke(x.changedTouches?x.changedTouches[0]:x,this),V=b.invert(A),W=b.k*(x.shiftKey?.5:2),U=n(v(g(b,W),A,V),t.apply(this,I),a);Rt(x),l>0?Ye(this).transition().duration(l).call(O,U,A,x):Ye(this).call(w.transform,U,A,x)}}function H(x,...I){if(e.apply(this,arguments)){var b=x.touches,A=b.length,V=F(this,I,x.changedTouches.length===A).event(x),W,U,te,re;for(Kn(x),U=0;U<A;++U)te=b[U],re=Ke(te,this),re=[re,this.__zoom.invert(re),te.identifier],V.touch0?!V.touch1&&V.touch0[2]!==re[2]&&(V.touch1=re,V.taps=0):(V.touch0=re,W=!0,V.taps=1+!!c);c&&(c=clearTimeout(c)),W&&(V.taps<2&&(f=re[0],c=setTimeout(function(){c=null},_)),xn(this),V.start())}}function M(x,...I){if(this.__zooming){var b=F(this,I).event(x),A=x.changedTouches,V=A.length,W,U,te,re;for(Rt(x),W=0;W<V;++W)U=A[W],te=Ke(U,this),b.touch0&&b.touch0[2]===U.identifier?b.touch0[0]=te:b.touch1&&b.touch1[2]===U.identifier&&(b.touch1[0]=te);if(U=b.that.__zoom,b.touch1){var fe=b.touch0[0],ge=b.touch0[1],j=b.touch1[0],ne=b.touch1[1],ee=(ee=j[0]-fe[0])*ee+(ee=j[1]-fe[1])*ee,ce=(ce=ne[0]-ge[0])*ce+(ce=ne[1]-ge[1])*ce;U=g(U,Math.sqrt(ee/ce)),te=[(fe[0]+j[0])/2,(fe[1]+j[1])/2],re=[(ge[0]+ne[0])/2,(ge[1]+ne[1])/2]}else if(b.touch0)te=b.touch0[0],re=b.touch0[1];else return;b.zoom("touch",n(v(U,te,re),b.extent,a))}}function oe(x,...I){if(this.__zooming){var b=F(this,I).event(x),A=x.changedTouches,V=A.length,W,U;for(Kn(x),d&&clearTimeout(d),d=setTimeout(function(){d=null},_),W=0;W<V;++W)U=A[W],b.touch0&&b.touch0[2]===U.identifier?delete b.touch0:b.touch1&&b.touch1[2]===U.identifier&&delete b.touch1;if(b.touch1&&!b.touch0&&(b.touch0=b.touch1,delete b.touch1),b.touch0)b.touch0[1]=this.__zoom.invert(b.touch0[0]);else if(b.end(),b.taps===2&&(U=Ke(U,this),Math.hypot(f[0]-U[0],f[1]-U[1])<m)){var te=Ye(this).on("dblclick.zoom");te&&te.apply(this,arguments)}}}return w.wheelDelta=function(x){return arguments.length?(o=typeof x=="function"?x:dn(+x),w):o},w.filter=function(x){return arguments.length?(e=typeof x=="function"?x:dn(!!x),w):e},w.touchable=function(x){return arguments.length?(i=typeof x=="function"?x:dn(!!x),w):i},w.extent=function(x){return arguments.length?(t=typeof x=="function"?x:dn([[+x[0][0],+x[0][1]],[+x[1][0],+x[1][1]]]),w):t},w.scaleExtent=function(x){return arguments.length?(s[0]=+x[0],s[1]=+x[1],w):[s[0],s[1]]},w.translateExtent=function(x){return arguments.length?(a[0][0]=+x[0][0],a[1][0]=+x[1][0],a[0][1]=+x[0][1],a[1][1]=+x[1][1],w):[[a[0][0],a[0][1]],[a[1][0],a[1][1]]]},w.constrain=function(x){return arguments.length?(n=x,w):n},w.duration=function(x){return arguments.length?(l=+x,w):l},w.interpolate=function(x){return arguments.length?(r=x,w):r},w.on=function(){var x=u.on.apply(u,arguments);return x===u?w:x},w.clickDistance=function(x){return arguments.length?(p=(x=+x)*x,w):Math.sqrt(p)},w.tapDistance=function(x){return arguments.length?(m=+x,w):m},w}var ae=(e=>(e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom",e))(ae||{}),Mo=(e=>(e.Partial="partial",e.Full="full",e))(Mo||{}),pt=(e=>(e.Bezier="default",e.SimpleBezier="simple-bezier",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e))(pt||{}),dt=(e=>(e.Strict="strict",e.Loose="loose",e))(dt||{}),ho=(e=>(e.Arrow="arrow",e.ArrowClosed="arrowclosed",e))(ho||{}),Wt=(e=>(e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal",e))(Wt||{});const Bc=["INPUT","SELECT","TEXTAREA"],Vc=typeof document<"u"?document:null;function vo(e){var t,n;const o=((n=(t=e.composedPath)==null?void 0:t.call(e))==null?void 0:n[0])||e.target,i=typeof o?.hasAttribute=="function"?o.hasAttribute("contenteditable"):!1,s=typeof o?.closest=="function"?o.closest(".nokey"):null;return Bc.includes(o?.nodeName)||i||!!s}function Rc(e){return e.ctrlKey||e.metaKey||e.shiftKey||e.altKey}function ni(e,t,n,o){const i=t.replace("+",`
1
+ import{G as Le,H as Ni,r as Y,j as G,d as pe,e as D,v as Ce,F as Ne,q as Te,f as h,o as $,_ as ze,s as le,I as ue,ao as Ve,w as q,L as Me,t as B,ap as $i,$ as We,aq as js,ar as yo,J as Re,O as Se,as as Ci,at as zt,au as Mi,K as Ee,av as Js,p as Ii,M as xe,aw as Ie,l as Xe,ax as Qs,ay as Bt,az as gn,aA as ea,n as Ge,aB as Di,aC as ta,aD as ct,aE as _o,aF as na,aG as oa,aH as It,aI as $e,aJ as be,aK as ia,aL as Ti,aM as sa,aN as mn,aO as aa,N as la,T as Pi,a0 as Ut,a3 as ra,P as Ai,a1 as nn,a2 as Xt,aP as Po,a4 as ua,aQ as ca,a6 as da,g as fa,h as ha,aR as Ao}from"./index-niFbQLQj.js";import{u as ht,W as Be,b as Oi,w as zi,g as va,a as Oo}from"./WsConfirmDialog-C_ycN7Jx.js";import{aC as Nt}from"./MarkdownContent-Bui6aG36.js";const St={create(e,t){return Le.post(`/workspaces/${e}/nodes`,t)},list(e,t,n){return Le.get(`/workspaces/${e}/nodes`,{params:{rootId:t,depth:n}})},get(e,t){return Le.get(`/workspaces/${e}/nodes/${t}`)},update(e,t,n){return Le.patch(`/workspaces/${e}/nodes/${t}`,n)},delete(e,t){return Le.delete(`/workspaces/${e}/nodes/${t}`)},transition(e,t,n){return Le.post(`/workspaces/${e}/nodes/${t}/transition`,n)}},zo={get(e,t,n){return Le.get(`/workspaces/${e}/nodes/${t}/context`,{params:n})},focus(e,t){return Le.post(`/workspaces/${e}/focus`,{nodeId:t})},isolate(e,t,n){return Le.patch(`/workspaces/${e}/nodes/${t}/isolate`,{isolate:n})},reference(e,t,n){return Le.post(`/workspaces/${e}/nodes/${t}/references`,n)}},Wn={list(e,t){return Le.get(`/workspaces/${e}/memos`,{params:{tags:t}})},async get(e,t){return(await Le.get(`/workspaces/${e}/memos/${t}`)).memo},delete(e,t){return Le.delete(`/workspaces/${e}/memos/${t}`)}},Bi=Ni("node",()=>{const e=Y(null),t=Y(null),n=Y(null),o=Y(null),i=Y(!1),s=Y(null),a=ht();async function l(){const m=a.currentWorkspace?.id;if(m){i.value=!0,s.value=null;try{const w=await St.list(m);e.value=w.tree}catch(w){throw s.value=w instanceof Error?w.message:"获取节点树失败",w}finally{i.value=!1}}}async function r(m){const w=a.currentWorkspace?.id;if(w){t.value=m,i.value=!0,s.value=null;try{const[g,v]=await Promise.all([St.get(w,m),zo.get(w,m)]);n.value=g.meta,o.value=v}catch(g){throw s.value=g instanceof Error?g.message:"获取节点详情失败",g}finally{i.value=!1}}}async function u(m){const w=a.currentWorkspace?.id;if(!w)throw new Error("未选择工作区");i.value=!0,s.value=null;try{const g=await St.create(w,m);return await l(),g}catch(g){throw s.value=g instanceof Error?g.message:"创建节点失败",g}finally{i.value=!1}}async function c(m){const w=a.currentWorkspace?.id,g=t.value;if(!w||!g)throw new Error("未选择节点");i.value=!0,s.value=null;try{await St.update(w,g,m),await l(),await r(g)}catch(v){throw s.value=v instanceof Error?v.message:"更新节点失败",v}finally{i.value=!1}}async function f(m){const w=a.currentWorkspace?.id;if(!w)throw new Error("未选择工作区");i.value=!0,s.value=null;try{await St.delete(w,m),await l(),t.value===m&&(t.value=null,n.value=null,o.value=null)}catch(g){throw s.value=g instanceof Error?g.message:"删除节点失败",g}finally{i.value=!1}}async function d(m,w,g){const v=a.currentWorkspace?.id,C=t.value;if(!v||!C)throw new Error("未选择节点");i.value=!0,s.value=null;try{const O=await St.transition(v,C,{action:m,reason:w,conclusion:g});return await l(),await r(C),O}catch(O){throw s.value=O instanceof Error?O.message:"状态转换失败",O}finally{i.value=!1}}async function _(m){const w=a.currentWorkspace?.id;if(!w)throw new Error("未选择工作区");i.value=!0,s.value=null;try{await zo.focus(w,m),await a.fetchWorkspace(w)}catch(g){throw s.value=g instanceof Error?g.message:"设置焦点失败",g}finally{i.value=!1}}function k(){t.value=null,n.value=null,o.value=null}function p(){e.value=null,k()}return{nodeTree:e,selectedNodeId:t,selectedNodeMeta:n,nodeContext:o,loading:i,error:s,fetchNodeTree:l,selectNode:r,createNode:u,updateNode:c,deleteNode:f,transition:d,setFocus:_,clearSelection:k,clearAll:p}}),wo=Ni("memo",()=>{const e=Y([]),t=Y([]),n=Y(null),o=Y(!1),i=Y(null),s=G(()=>e.value.length);async function a(c,f){o.value=!0,i.value=null;try{const d=await Wn.list(c,f);e.value=d.memos,t.value=d.allTags}catch(d){throw i.value=d instanceof Error?d.message:"获取 memo 列表失败",d}finally{o.value=!1}}async function l(c,f){o.value=!0,i.value=null;try{const d=await Wn.get(c,f);return n.value=d,d}catch(d){throw i.value=d instanceof Error?d.message:"获取 memo 失败",d}finally{o.value=!1}}function r(){e.value=[],t.value=[],n.value=null,i.value=null}async function u(c,f){o.value=!0,i.value=null;try{await Wn.delete(c,f),e.value=e.value.filter(d=>d.id!==f),n.value?.id===f&&(n.value=null)}catch(d){throw i.value=d instanceof Error?d.message:"删除 memo 失败",d}finally{o.value=!1}}return{memos:e,allTags:t,currentMemo:n,loading:o,error:i,memoCount:s,fetchMemos:a,fetchMemo:l,clearMemos:r,deleteMemo:u}}),pa={key:1,class:"node-plan-wrapper"},ga=pe({__name:"NodeIcon",props:{type:{},status:{},isMemo:{type:Boolean},contentLength:{},memoCount:{}},setup(e){const t=e,n=G(()=>t.type==="planning"),o=G(()=>t.memoCount!==void 0?t.memoCount<=3?1:t.memoCount<=8?2:3:!t.contentLength||t.contentLength<500?1:t.contentLength<=1e3?2:3);return(i,s)=>e.isMemo?($(),D("div",{key:0,class:Ce(["node-memo","lines-"+o.value])},[($(!0),D(Ne,null,Te(o.value,a=>($(),D("span",{class:"memo-line",key:a}))),128))],2)):n.value?($(),D("div",pa,[h("div",{class:Ce(["node-plan",e.status])},null,2)])):($(),D("div",{key:2,class:Ce(["node-exec",e.status])},null,2))}}),Qe=ze(ga,[["__scopeId","data-v-0a165cd6"]]),ma={key:0,class:"focus-wrapper"},ya={key:1,class:"focus-wrapper-diamond"},_a={class:"node-plan-wrapper"},wa=pe({__name:"FocusCrosshair",props:{type:{},status:{}},setup(e){return(t,n)=>e.type==="execution"?($(),D("div",ma,[le(Qe,{type:e.type,status:e.status},null,8,["type","status"]),n[0]||(n[0]=h("div",{class:"focus-crosshair"},[h("span")],-1))])):($(),D("div",ya,[h("div",_a,[le(Qe,{type:e.type,status:e.status},null,8,["type","status"])]),n[1]||(n[1]=h("div",{class:"focus-diamond"},[h("span")],-1))]))}}),Vi=ze(wa,[["__scopeId","data-v-e0c1e480"]]),ba={pending:{icon:"CircleClose",color:"#909399",label:"待执行",emoji:"⚪"},completed:{icon:"CircleCheck",color:"#67C23A",label:"已完成",emoji:"✅"},implementing:{icon:"Loading",color:"#409EFF",label:"执行中",emoji:"🔵"},validating:{icon:"Clock",color:"#E6A23C",label:"验证中",emoji:"🟡"},failed:{icon:"CircleCloseFilled",color:"#F56C6C",label:"失败",emoji:"❌"},planning:{icon:"Edit",color:"#9B59B6",label:"规划中",emoji:"◇"},monitoring:{icon:"View",color:"#3498DB",label:"监控中",emoji:"◈"},cancelled:{icon:"Remove",color:"#95A5A6",label:"已取消",emoji:"⊘"}},Ri={info_collection:{label:"INFO",color:"#E6A23C",textColor:"#000",description:"收集项目信息,完成时自动归档规则和文档到工作区"},info_summary:{label:"SUMM",color:"#909399",textColor:"#fff",description:"信息总结,从已有信息中提取结构化内容"},validation:{label:"VALID",color:"#67C23A",textColor:"#fff",description:"验证类任务(预留)"}},xa={pending:{label:"待派发",color:"#909399",bgColor:"#f4f4f5",description:"等待派发执行"},executing:{label:"执行中",color:"#409EFF",bgColor:"#ecf5ff",description:"Subagent 正在执行"},testing:{label:"测试中",color:"#E6A23C",bgColor:"#fdf6ec",description:"测试节点验证中"},passed:{label:"已通过",color:"#67C23A",bgColor:"#f0f9eb",description:"测试通过"},failed:{label:"已失败",color:"#F56C6C",bgColor:"#fef0f0",description:"执行或测试失败"}},Sa=pe({__name:"RoleBadge",props:{role:{}},setup(e){const t=e,n=G(()=>t.role?Ri[t.role]:null);return(o,i)=>n.value?($(),D("span",{key:0,class:"role-badge",style:Ve({background:n.value.color,color:n.value.textColor})},q(n.value.label),5)):ue("",!0)}}),Hi=ze(Sa,[["__scopeId","data-v-c567ac5e"]]),Ea=pe({__name:"DispatchBadge",props:{status:{}},setup(e){function t(n){switch(n){case"pending":return"WAIT";case"executing":return"RUN";case"testing":return"TEST";case"passed":return"PASS";case"failed":return"FAIL";default:return""}}return(n,o)=>($(),D("span",{class:Ce(["dispatch-badge",e.status])},q(t(e.status)),3))}}),bo=ze(Ea,[["__scopeId","data-v-0ef054ee"]]),ka={key:0,class:"depth-dots"},Na=["title"],$a={class:"node-title"},Ca=pe({__name:"TreeNodeItem",props:{node:{},isFocused:{type:Boolean},isSelected:{type:Boolean},isActivePath:{type:Boolean},depth:{},hasChildren:{type:Boolean},isExpanded:{type:Boolean}},emits:["click","toggleExpand"],setup(e,{emit:t}){const n=e,o=t,i=G(()=>n.node.id.startsWith("memo-")||n.node.id==="__memo_drawer__"),s=n.depth?n.hasChildren?n.depth-1:n.depth:0;function a(){o("click",n.node)}function l(r){r.stopPropagation(),o("toggleExpand")}return(r,u)=>($(),D("div",{class:Ce(["tree-node-item",{selected:e.isSelected,"active-path":e.isActivePath,"is-memo":i.value}]),onClick:a},[B(s)>0?($(),D("span",ka,[($(!0),D(Ne,null,Te(B(s),c=>($(),D("span",{key:c,class:"dot"}))),128))])):ue("",!0),e.hasChildren?($(),D("button",{key:1,class:Ce(["expand-btn",{expanded:e.isExpanded}]),onClick:l,title:e.isExpanded?"收起":"展开"},[...u[0]||(u[0]=[h("span",{class:"expand-icon"},"▶",-1)])],10,Na)):ue("",!0),e.isFocused&&!i.value?($(),Me(Vi,{key:2,type:e.node.type,status:e.node.status},null,8,["type","status"])):($(),Me(Qe,{key:3,type:e.node.type,status:e.node.status,"is-memo":i.value,"content-length":e.node.contentLength,"memo-count":e.node.memoCount},null,8,["type","status","is-memo","content-length","memo-count"])),h("span",$a,q(e.node.title),1),le(Hi,{role:e.node.role},null,8,["role"]),e.node.dispatch?($(),Me(bo,{key:4,status:e.node.dispatch.status},null,8,["status"])):ue("",!0)],2))}}),Li=ze(Ca,[["__scopeId","data-v-13ec9572"]]),Ma={key:0,class:"tree-children"},Ia=pe({__name:"TreeChildren",props:{children:{},selectedId:{},focusId:{},activePathIds:{},depth:{}},emits:["select"],setup(e,{expose:t,emit:n}){const o=e,i=n,s=$i({}),a=Y([]);function l(p){return s[p]!==!1}function r(p){s[p]=!l(p)}function u(p){o.children.forEach(m=>{s[m.id]=p}),a.value.forEach(m=>{m?.setAllExpanded(p)})}t({setAllExpanded:u});function c(p){i("select",p)}function f(p){return o.focusId===p}function d(p){return o.selectedId===p}function _(p){return o.activePathIds.has(p)}function k(p){return!!(p.children&&p.children.length>0)}return(p,m)=>{const w=yo("TreeChildren",!0);return $(!0),D(Ne,null,Te(e.children,g=>($(),D("div",{key:g.id,class:"tree-node-wrapper"},[le(Li,{node:g,"is-focused":f(g.id),"is-selected":d(g.id),"is-active-path":_(g.id),depth:e.depth,"has-children":k(g),"is-expanded":l(g.id),onClick:v=>c(g),onToggleExpand:v=>r(g.id)},null,8,["node","is-focused","is-selected","is-active-path","depth","has-children","is-expanded","onClick","onToggleExpand"]),k(g)?We(($(),D("div",Ma,[le(w,{ref_for:!0,ref:v=>{v&&(a.value[e.children.indexOf(g)]=v)},children:g.children,"selected-id":e.selectedId,"focus-id":e.focusId,"active-path-ids":e.activePathIds,depth:e.depth+1,onSelect:c},null,8,["children","selected-id","focus-id","active-path-ids","depth"])],512)),[[js,l(g.id)]]):ue("",!0)]))),128)}}}),Da=ze(Ia,[["__scopeId","data-v-899ad2a2"]]),Ta={class:"empty-state"},Pa={class:"empty-icon"},Aa={class:"empty-title"},Oa={key:0,class:"empty-description"},za={key:1,class:"empty-action"},Ba=pe({__name:"WsEmpty",props:{title:{default:""},description:{default:""}},setup(e){return(t,n)=>($(),D("div",Ta,[h("div",Pa,[Re(t.$slots,"icon",{},()=>[n[0]||(n[0]=h("svg",{width:"64",height:"64",viewBox:"0 0 64 64",fill:"none"},[h("rect",{x:"12",y:"12",width:"40",height:"40",rx:"4",stroke:"currentColor","stroke-width":"2"}),h("path",{d:"M20 28L28 36L44 20",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",opacity:"0.3"})],-1))],!0)]),h("div",Aa,[Re(t.$slots,"title",{},()=>[Se(q(e.title||"暂无数据"),1)],!0)]),e.description||t.$slots.description?($(),D("div",Oa,[Re(t.$slots,"description",{},()=>[Se(q(e.description),1)],!0)])):ue("",!0),t.$slots.action?($(),D("div",za,[Re(t.$slots,"action",{},void 0,!0)])):ue("",!0)]))}}),Va=ze(Ba,[["__scopeId","data-v-841069d4"]]),Ra={class:"node-tree"},Ha={key:0,class:"tree-container"},La={key:0,class:"tree-children"},Fa=pe({__name:"NodeTree",props:{tree:{},selectedId:{},focusId:{},memos:{}},emits:["select"],setup(e,{emit:t}){const n=e,o=t,i=Y(null),s=Y(!0),a=G(()=>{if(!n.memos||n.memos.length===0)return null;const k=n.memos.map(p=>({id:p.id,type:"execution",title:p.title,status:"pending",contentLength:p.contentLength,children:[]}));return{id:"__memo_drawer__",type:"planning",title:`草稿 (${n.memos.length})`,status:"pending",memoCount:n.memos.length,children:k}}),l=G(()=>{const k=n.tree?.children||[];return a.value?[...k,a.value]:k}),r=G(()=>{const k=new Set;if(!n.selectedId||!n.tree)return k;function p(m,w,g){if(g.push(m.id),m.id===w)return g.forEach(v=>k.add(v)),!0;if(m.children&&m.children.length>0){for(const v of m.children)if(p(v,w,[...g]))return!0}return!1}return p(n.tree,n.selectedId,[]),k.size===0&&a.value&&(n.selectedId==="__memo_drawer__"||n.selectedId.startsWith("memo-"))&&(k.add("__memo_drawer__"),n.selectedId!=="__memo_drawer__"&&k.add(n.selectedId)),k});function u(k){o("select",k.id)}function c(k){return n.focusId===k}function f(k){return n.selectedId===k}function d(k){return r.value.has(k)}function _(){s.value=!s.value,i.value?.setAllExpanded(s.value)}return(k,p)=>($(),D("div",Ra,[e.tree?($(),D("div",Ha,[le(Li,{node:e.tree,"is-focused":c(e.tree.id),"is-selected":f(e.tree.id),"is-active-path":d(e.tree.id),depth:0,onClick:p[0]||(p[0]=m=>u(e.tree)),onDblclick:_},null,8,["node","is-focused","is-selected","is-active-path"]),l.value.length>0?($(),D("div",La,[le(Da,{ref_key:"treeChildrenRef",ref:i,children:l.value,"selected-id":e.selectedId,"focus-id":e.focusId,"active-path-ids":r.value,depth:1,onSelect:u},null,8,["children","selected-id","focus-id","active-path-ids"])])):ue("",!0)])):($(),Me(Va,{key:1,description:"暂无节点"}))]))}}),Ga=ze(Fa,[["__scopeId","data-v-0f71ff3f"]]);function Zt(e){return Ci()?(gn(e),!0):!1}function ot(e){return typeof e=="function"?e():B(e)}const Wa=typeof window<"u"&&typeof document<"u",Ya=e=>typeof e<"u",Ua=Object.prototype.toString,Xa=e=>Ua.call(e)==="[object Object]",Za=()=>{};function Ka(e,t){function n(...o){return new Promise((i,s)=>{Promise.resolve(e(()=>t.apply(this,o),{fn:t,thisArg:this,args:o})).then(i).catch(s)})}return n}const Fi=e=>e();function qa(e=Fi){const t=Y(!0);function n(){t.value=!1}function o(){t.value=!0}const i=(...s)=>{t.value&&e(...s)};return{isActive:aa(t),pause:n,resume:o,eventFilter:i}}function Bo(e,t=!1,n="Timeout"){return new Promise((o,i)=>{setTimeout(t?()=>i(n):o,e)})}function ja(e,t,n={}){const{eventFilter:o=Fi,...i}=n;return Ee(e,Ka(o,t),i)}function Et(e,t,n={}){const{eventFilter:o,...i}=n,{eventFilter:s,pause:a,resume:l,isActive:r}=qa(o);return{stop:ja(e,t,{...i,eventFilter:s}),pause:a,resume:l,isActive:r}}function Ja(e,t={}){if(!_o(e))return na(e);const n=Array.isArray(e.value)?Array.from({length:e.value.length}):{};for(const o in e.value)n[o]=oa(()=>({get(){return e.value[o]},set(i){var s;if((s=ot(t.replaceRef))!=null?s:!0)if(Array.isArray(e.value)){const l=[...e.value];l[o]=i,e.value=l}else{const l={...e.value,[o]:i};Object.setPrototypeOf(l,Object.getPrototypeOf(e.value)),e.value=l}else e.value[o]=i}}));return n}function no(e,t=!1){function n(f,{flush:d="sync",deep:_=!1,timeout:k,throwOnTimeout:p}={}){let m=null;const g=[new Promise(v=>{m=Ee(e,C=>{f(C)!==t&&(m?.(),v(C))},{flush:d,deep:_,immediate:!0})})];return k!=null&&g.push(Bo(k,p).then(()=>ot(e)).finally(()=>m?.())),Promise.race(g)}function o(f,d){if(!_o(f))return n(C=>C===f,d);const{flush:_="sync",deep:k=!1,timeout:p,throwOnTimeout:m}=d??{};let w=null;const v=[new Promise(C=>{w=Ee([e,f],([O,F])=>{t!==(O===F)&&(w?.(),C(O))},{flush:_,deep:k,immediate:!0})})];return p!=null&&v.push(Bo(p,m).then(()=>ot(e)).finally(()=>(w?.(),ot(e)))),Promise.race(v)}function i(f){return n(d=>!!d,f)}function s(f){return o(null,f)}function a(f){return o(void 0,f)}function l(f){return n(Number.isNaN,f)}function r(f,d){return n(_=>{const k=Array.from(_);return k.includes(f)||k.includes(ot(f))},d)}function u(f){return c(1,f)}function c(f=1,d){let _=-1;return n(()=>(_+=1,_>=f),d)}return Array.isArray(ot(e))?{toMatch:n,toContains:r,changed:u,changedTimes:c,get not(){return no(e,!t)}}:{toMatch:n,toBe:o,toBeTruthy:i,toBeNull:s,toBeNaN:l,toBeUndefined:a,changed:u,changedTimes:c,get not(){return no(e,!t)}}}function oo(e){return no(e)}function Qa(e){var t;const n=ot(e);return(t=n?.$el)!=null?t:n}const Gi=Wa?window:void 0;function Wi(...e){let t,n,o,i;if(typeof e[0]=="string"||Array.isArray(e[0])?([n,o,i]=e,t=Gi):[t,n,o,i]=e,!t)return Za;Array.isArray(n)||(n=[n]),Array.isArray(o)||(o=[o]);const s=[],a=()=>{s.forEach(c=>c()),s.length=0},l=(c,f,d,_)=>(c.addEventListener(f,d,_),()=>c.removeEventListener(f,d,_)),r=Ee(()=>[Qa(t),ot(i)],([c,f])=>{if(a(),!c)return;const d=Xa(f)?{...f}:f;s.push(...n.flatMap(_=>o.map(k=>l(c,_,k,d))))},{immediate:!0,flush:"post"}),u=()=>{r(),a()};return Zt(u),u}function el(e){return typeof e=="function"?e:typeof e=="string"?t=>t.key===e:Array.isArray(e)?t=>e.includes(t.key):()=>!0}function Vo(...e){let t,n,o={};e.length===3?(t=e[0],n=e[1],o=e[2]):e.length===2?typeof e[1]=="object"?(t=!0,n=e[0],o=e[1]):(t=e[0],n=e[1]):(t=!0,n=e[0]);const{target:i=Gi,eventName:s="keydown",passive:a=!1,dedupe:l=!1}=o,r=el(t);return Wi(i,s,c=>{c.repeat&&ot(l)||r(c)&&n(c)},a)}function tl(e){return JSON.parse(JSON.stringify(e))}function Yn(e,t,n,o={}){var i,s,a;const{clone:l=!1,passive:r=!1,eventName:u,deep:c=!1,defaultValue:f,shouldEmit:d}=o,_=Bt(),k=n||_?.emit||((i=_?.$emit)==null?void 0:i.bind(_))||((a=(s=_?.proxy)==null?void 0:s.$emit)==null?void 0:a.bind(_?.proxy));let p=u;t||(t="modelValue"),p=p||`update:${t.toString()}`;const m=v=>l?typeof l=="function"?l(v):tl(v):v,w=()=>Ya(e[t])?m(e[t]):f,g=v=>{d?d(v)&&k(p,v):k(p,v)};if(r){const v=w(),C=Y(v);let O=!1;return Ee(()=>e[t],F=>{O||(O=!0,C.value=m(F),Ge(()=>O=!1))}),Ee(C,F=>{!O&&(F!==e[t]||c)&&g(F)},{deep:c}),C}else return G({get(){return w()},set(v){g(v)}})}var nl={value:()=>{}};function Pn(){for(var e=0,t=arguments.length,n={},o;e<t;++e){if(!(o=arguments[e]+"")||o in n||/[\s.]/.test(o))throw new Error("illegal type: "+o);n[o]=[]}return new yn(n)}function yn(e){this._=e}function ol(e,t){return e.trim().split(/^|\s+/).map(function(n){var o="",i=n.indexOf(".");if(i>=0&&(o=n.slice(i+1),n=n.slice(0,i)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:o}})}yn.prototype=Pn.prototype={constructor:yn,on:function(e,t){var n=this._,o=ol(e+"",n),i,s=-1,a=o.length;if(arguments.length<2){for(;++s<a;)if((i=(e=o[s]).type)&&(i=il(n[i],e.name)))return i;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++s<a;)if(i=(e=o[s]).type)n[i]=Ro(n[i],e.name,t);else if(t==null)for(i in n)n[i]=Ro(n[i],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new yn(e)},call:function(e,t){if((i=arguments.length-2)>0)for(var n=new Array(i),o=0,i,s;o<i;++o)n[o]=arguments[o+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(s=this._[e],o=0,i=s.length;o<i;++o)s[o].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var o=this._[e],i=0,s=o.length;i<s;++i)o[i].value.apply(t,n)}};function il(e,t){for(var n=0,o=e.length,i;n<o;++n)if((i=e[n]).name===t)return i.value}function Ro(e,t,n){for(var o=0,i=e.length;o<i;++o)if(e[o].name===t){e[o]=nl,e=e.slice(0,o).concat(e.slice(o+1));break}return n!=null&&e.push({name:t,value:n}),e}var io="http://www.w3.org/1999/xhtml";const Ho={svg:"http://www.w3.org/2000/svg",xhtml:io,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function An(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),Ho.hasOwnProperty(t)?{space:Ho[t],local:e}:e}function sl(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===io&&t.documentElement.namespaceURI===io?t.createElement(e):t.createElementNS(n,e)}}function al(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function Yi(e){var t=An(e);return(t.local?al:sl)(t)}function ll(){}function xo(e){return e==null?ll:function(){return this.querySelector(e)}}function rl(e){typeof e!="function"&&(e=xo(e));for(var t=this._groups,n=t.length,o=new Array(n),i=0;i<n;++i)for(var s=t[i],a=s.length,l=o[i]=new Array(a),r,u,c=0;c<a;++c)(r=s[c])&&(u=e.call(r,r.__data__,c,s))&&("__data__"in r&&(u.__data__=r.__data__),l[c]=u);return new Fe(o,this._parents)}function ul(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function cl(){return[]}function Ui(e){return e==null?cl:function(){return this.querySelectorAll(e)}}function dl(e){return function(){return ul(e.apply(this,arguments))}}function fl(e){typeof e=="function"?e=dl(e):e=Ui(e);for(var t=this._groups,n=t.length,o=[],i=[],s=0;s<n;++s)for(var a=t[s],l=a.length,r,u=0;u<l;++u)(r=a[u])&&(o.push(e.call(r,r.__data__,u,a)),i.push(r));return new Fe(o,i)}function Xi(e){return function(){return this.matches(e)}}function Zi(e){return function(t){return t.matches(e)}}var hl=Array.prototype.find;function vl(e){return function(){return hl.call(this.children,e)}}function pl(){return this.firstElementChild}function gl(e){return this.select(e==null?pl:vl(typeof e=="function"?e:Zi(e)))}var ml=Array.prototype.filter;function yl(){return Array.from(this.children)}function _l(e){return function(){return ml.call(this.children,e)}}function wl(e){return this.selectAll(e==null?yl:_l(typeof e=="function"?e:Zi(e)))}function bl(e){typeof e!="function"&&(e=Xi(e));for(var t=this._groups,n=t.length,o=new Array(n),i=0;i<n;++i)for(var s=t[i],a=s.length,l=o[i]=[],r,u=0;u<a;++u)(r=s[u])&&e.call(r,r.__data__,u,s)&&l.push(r);return new Fe(o,this._parents)}function Ki(e){return new Array(e.length)}function xl(){return new Fe(this._enter||this._groups.map(Ki),this._parents)}function Sn(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}Sn.prototype={constructor:Sn,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function Sl(e){return function(){return e}}function El(e,t,n,o,i,s){for(var a=0,l,r=t.length,u=s.length;a<u;++a)(l=t[a])?(l.__data__=s[a],o[a]=l):n[a]=new Sn(e,s[a]);for(;a<r;++a)(l=t[a])&&(i[a]=l)}function kl(e,t,n,o,i,s,a){var l,r,u=new Map,c=t.length,f=s.length,d=new Array(c),_;for(l=0;l<c;++l)(r=t[l])&&(d[l]=_=a.call(r,r.__data__,l,t)+"",u.has(_)?i[l]=r:u.set(_,r));for(l=0;l<f;++l)_=a.call(e,s[l],l,s)+"",(r=u.get(_))?(o[l]=r,r.__data__=s[l],u.delete(_)):n[l]=new Sn(e,s[l]);for(l=0;l<c;++l)(r=t[l])&&u.get(d[l])===r&&(i[l]=r)}function Nl(e){return e.__data__}function $l(e,t){if(!arguments.length)return Array.from(this,Nl);var n=t?kl:El,o=this._parents,i=this._groups;typeof e!="function"&&(e=Sl(e));for(var s=i.length,a=new Array(s),l=new Array(s),r=new Array(s),u=0;u<s;++u){var c=o[u],f=i[u],d=f.length,_=Cl(e.call(c,c&&c.__data__,u,o)),k=_.length,p=l[u]=new Array(k),m=a[u]=new Array(k),w=r[u]=new Array(d);n(c,f,p,m,w,_,t);for(var g=0,v=0,C,O;g<k;++g)if(C=p[g]){for(g>=v&&(v=g+1);!(O=m[v])&&++v<k;);C._next=O||null}}return a=new Fe(a,o),a._enter=l,a._exit=r,a}function Cl(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function Ml(){return new Fe(this._exit||this._groups.map(Ki),this._parents)}function Il(e,t,n){var o=this.enter(),i=this,s=this.exit();return typeof e=="function"?(o=e(o),o&&(o=o.selection())):o=o.append(e+""),t!=null&&(i=t(i),i&&(i=i.selection())),n==null?s.remove():n(s),o&&i?o.merge(i).order():i}function Dl(e){for(var t=e.selection?e.selection():e,n=this._groups,o=t._groups,i=n.length,s=o.length,a=Math.min(i,s),l=new Array(i),r=0;r<a;++r)for(var u=n[r],c=o[r],f=u.length,d=l[r]=new Array(f),_,k=0;k<f;++k)(_=u[k]||c[k])&&(d[k]=_);for(;r<i;++r)l[r]=n[r];return new Fe(l,this._parents)}function Tl(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var o=e[t],i=o.length-1,s=o[i],a;--i>=0;)(a=o[i])&&(s&&a.compareDocumentPosition(s)^4&&s.parentNode.insertBefore(a,s),s=a);return this}function Pl(e){e||(e=Al);function t(f,d){return f&&d?e(f.__data__,d.__data__):!f-!d}for(var n=this._groups,o=n.length,i=new Array(o),s=0;s<o;++s){for(var a=n[s],l=a.length,r=i[s]=new Array(l),u,c=0;c<l;++c)(u=a[c])&&(r[c]=u);r.sort(t)}return new Fe(i,this._parents).order()}function Al(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function Ol(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function zl(){return Array.from(this)}function Bl(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var o=e[t],i=0,s=o.length;i<s;++i){var a=o[i];if(a)return a}return null}function Vl(){let e=0;for(const t of this)++e;return e}function Rl(){return!this.node()}function Hl(e){for(var t=this._groups,n=0,o=t.length;n<o;++n)for(var i=t[n],s=0,a=i.length,l;s<a;++s)(l=i[s])&&e.call(l,l.__data__,s,i);return this}function Ll(e){return function(){this.removeAttribute(e)}}function Fl(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Gl(e,t){return function(){this.setAttribute(e,t)}}function Wl(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function Yl(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function Ul(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,n)}}function Xl(e,t){var n=An(e);if(arguments.length<2){var o=this.node();return n.local?o.getAttributeNS(n.space,n.local):o.getAttribute(n)}return this.each((t==null?n.local?Fl:Ll:typeof t=="function"?n.local?Ul:Yl:n.local?Wl:Gl)(n,t))}function qi(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function Zl(e){return function(){this.style.removeProperty(e)}}function Kl(e,t,n){return function(){this.style.setProperty(e,t,n)}}function ql(e,t,n){return function(){var o=t.apply(this,arguments);o==null?this.style.removeProperty(e):this.style.setProperty(e,o,n)}}function jl(e,t,n){return arguments.length>1?this.each((t==null?Zl:typeof t=="function"?ql:Kl)(e,t,n??"")):Dt(this.node(),e)}function Dt(e,t){return e.style.getPropertyValue(t)||qi(e).getComputedStyle(e,null).getPropertyValue(t)}function Jl(e){return function(){delete this[e]}}function Ql(e,t){return function(){this[e]=t}}function er(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function tr(e,t){return arguments.length>1?this.each((t==null?Jl:typeof t=="function"?er:Ql)(e,t)):this.node()[e]}function ji(e){return e.trim().split(/^|\s+/)}function So(e){return e.classList||new Ji(e)}function Ji(e){this._node=e,this._names=ji(e.getAttribute("class")||"")}Ji.prototype={add:function(e){var t=this._names.indexOf(e);t<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function Qi(e,t){for(var n=So(e),o=-1,i=t.length;++o<i;)n.add(t[o])}function es(e,t){for(var n=So(e),o=-1,i=t.length;++o<i;)n.remove(t[o])}function nr(e){return function(){Qi(this,e)}}function or(e){return function(){es(this,e)}}function ir(e,t){return function(){(t.apply(this,arguments)?Qi:es)(this,e)}}function sr(e,t){var n=ji(e+"");if(arguments.length<2){for(var o=So(this.node()),i=-1,s=n.length;++i<s;)if(!o.contains(n[i]))return!1;return!0}return this.each((typeof t=="function"?ir:t?nr:or)(n,t))}function ar(){this.textContent=""}function lr(e){return function(){this.textContent=e}}function rr(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function ur(e){return arguments.length?this.each(e==null?ar:(typeof e=="function"?rr:lr)(e)):this.node().textContent}function cr(){this.innerHTML=""}function dr(e){return function(){this.innerHTML=e}}function fr(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function hr(e){return arguments.length?this.each(e==null?cr:(typeof e=="function"?fr:dr)(e)):this.node().innerHTML}function vr(){this.nextSibling&&this.parentNode.appendChild(this)}function pr(){return this.each(vr)}function gr(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function mr(){return this.each(gr)}function yr(e){var t=typeof e=="function"?e:Yi(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function _r(){return null}function wr(e,t){var n=typeof e=="function"?e:Yi(e),o=t==null?_r:typeof t=="function"?t:xo(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),o.apply(this,arguments)||null)})}function br(){var e=this.parentNode;e&&e.removeChild(this)}function xr(){return this.each(br)}function Sr(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function Er(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function kr(e){return this.select(e?Er:Sr)}function Nr(e){return arguments.length?this.property("__data__",e):this.node().__data__}function $r(e){return function(t){e.call(this,t,this.__data__)}}function Cr(e){return e.trim().split(/^|\s+/).map(function(t){var n="",o=t.indexOf(".");return o>=0&&(n=t.slice(o+1),t=t.slice(0,o)),{type:t,name:n}})}function Mr(e){return function(){var t=this.__on;if(t){for(var n=0,o=-1,i=t.length,s;n<i;++n)s=t[n],(!e.type||s.type===e.type)&&s.name===e.name?this.removeEventListener(s.type,s.listener,s.options):t[++o]=s;++o?t.length=o:delete this.__on}}}function Ir(e,t,n){return function(){var o=this.__on,i,s=$r(t);if(o){for(var a=0,l=o.length;a<l;++a)if((i=o[a]).type===e.type&&i.name===e.name){this.removeEventListener(i.type,i.listener,i.options),this.addEventListener(i.type,i.listener=s,i.options=n),i.value=t;return}}this.addEventListener(e.type,s,n),i={type:e.type,name:e.name,value:t,listener:s,options:n},o?o.push(i):this.__on=[i]}}function Dr(e,t,n){var o=Cr(e+""),i,s=o.length,a;if(arguments.length<2){var l=this.node().__on;if(l){for(var r=0,u=l.length,c;r<u;++r)for(i=0,c=l[r];i<s;++i)if((a=o[i]).type===c.type&&a.name===c.name)return c.value}return}for(l=t?Ir:Mr,i=0;i<s;++i)this.each(l(o[i],t,n));return this}function ts(e,t,n){var o=qi(e),i=o.CustomEvent;typeof i=="function"?i=new i(t,n):(i=o.document.createEvent("Event"),n?(i.initEvent(t,n.bubbles,n.cancelable),i.detail=n.detail):i.initEvent(t,!1,!1)),e.dispatchEvent(i)}function Tr(e,t){return function(){return ts(this,e,t)}}function Pr(e,t){return function(){return ts(this,e,t.apply(this,arguments))}}function Ar(e,t){return this.each((typeof t=="function"?Pr:Tr)(e,t))}function*Or(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var o=e[t],i=0,s=o.length,a;i<s;++i)(a=o[i])&&(yield a)}var ns=[null];function Fe(e,t){this._groups=e,this._parents=t}function on(){return new Fe([[document.documentElement]],ns)}function zr(){return this}Fe.prototype=on.prototype={constructor:Fe,select:rl,selectAll:fl,selectChild:gl,selectChildren:wl,filter:bl,data:$l,enter:xl,exit:Ml,join:Il,merge:Dl,selection:zr,order:Tl,sort:Pl,call:Ol,nodes:zl,node:Bl,size:Vl,empty:Rl,each:Hl,attr:Xl,style:jl,property:tr,classed:sr,text:ur,html:hr,raise:pr,lower:mr,append:yr,insert:wr,remove:xr,clone:kr,datum:Nr,on:Dr,dispatch:Ar,[Symbol.iterator]:Or};function Ye(e){return typeof e=="string"?new Fe([[document.querySelector(e)]],[document.documentElement]):new Fe([[e]],ns)}function Br(e){let t;for(;t=e.sourceEvent;)e=t;return e}function Ke(e,t){if(e=Br(e),t===void 0&&(t=e.currentTarget),t){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var o=n.createSVGPoint();return o.x=e.clientX,o.y=e.clientY,o=o.matrixTransform(t.getScreenCTM().inverse()),[o.x,o.y]}if(t.getBoundingClientRect){var i=t.getBoundingClientRect();return[e.clientX-i.left-t.clientLeft,e.clientY-i.top-t.clientTop]}}return[e.pageX,e.pageY]}const Vr={passive:!1},Kt={capture:!0,passive:!1};function Un(e){e.stopImmediatePropagation()}function $t(e){e.preventDefault(),e.stopImmediatePropagation()}function os(e){var t=e.document.documentElement,n=Ye(e).on("dragstart.drag",$t,Kt);"onselectstart"in t?n.on("selectstart.drag",$t,Kt):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function is(e,t){var n=e.document.documentElement,o=Ye(e).on("dragstart.drag",null);t&&(o.on("click.drag",$t,Kt),setTimeout(function(){o.on("click.drag",null)},0)),"onselectstart"in n?o.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}const ln=e=>()=>e;function so(e,{sourceEvent:t,subject:n,target:o,identifier:i,active:s,x:a,y:l,dx:r,dy:u,dispatch:c}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:o,enumerable:!0,configurable:!0},identifier:{value:i,enumerable:!0,configurable:!0},active:{value:s,enumerable:!0,configurable:!0},x:{value:a,enumerable:!0,configurable:!0},y:{value:l,enumerable:!0,configurable:!0},dx:{value:r,enumerable:!0,configurable:!0},dy:{value:u,enumerable:!0,configurable:!0},_:{value:c}})}so.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function Rr(e){return!e.ctrlKey&&!e.button}function Hr(){return this.parentNode}function Lr(e,t){return t??{x:e.x,y:e.y}}function Fr(){return navigator.maxTouchPoints||"ontouchstart"in this}function Gr(){var e=Rr,t=Hr,n=Lr,o=Fr,i={},s=Pn("start","drag","end"),a=0,l,r,u,c,f=0;function d(C){C.on("mousedown.drag",_).filter(o).on("touchstart.drag",m).on("touchmove.drag",w,Vr).on("touchend.drag touchcancel.drag",g).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function _(C,O){if(!(c||!e.call(this,C,O))){var F=v(this,t.call(this,C,O),C,O,"mouse");F&&(Ye(C.view).on("mousemove.drag",k,Kt).on("mouseup.drag",p,Kt),os(C.view),Un(C),u=!1,l=C.clientX,r=C.clientY,F("start",C))}}function k(C){if($t(C),!u){var O=C.clientX-l,F=C.clientY-r;u=O*O+F*F>f}i.mouse("drag",C)}function p(C){Ye(C.view).on("mousemove.drag mouseup.drag",null),is(C.view,u),$t(C),i.mouse("end",C)}function m(C,O){if(e.call(this,C,O)){var F=C.changedTouches,L=t.call(this,C,O),R=F.length,se,K;for(se=0;se<R;++se)(K=v(this,L,C,O,F[se].identifier,F[se]))&&(Un(C),K("start",C,F[se]))}}function w(C){var O=C.changedTouches,F=O.length,L,R;for(L=0;L<F;++L)(R=i[O[L].identifier])&&($t(C),R("drag",C,O[L]))}function g(C){var O=C.changedTouches,F=O.length,L,R;for(c&&clearTimeout(c),c=setTimeout(function(){c=null},500),L=0;L<F;++L)(R=i[O[L].identifier])&&(Un(C),R("end",C,O[L]))}function v(C,O,F,L,R,se){var K=s.copy(),H=Ke(se||F,O),M,oe,x;if((x=n.call(C,new so("beforestart",{sourceEvent:F,target:d,identifier:R,active:a,x:H[0],y:H[1],dx:0,dy:0,dispatch:K}),L))!=null)return M=x.x-H[0]||0,oe=x.y-H[1]||0,function I(b,A,V){var W=H,U;switch(b){case"start":i[R]=I,U=a++;break;case"end":delete i[R],--a;case"drag":H=Ke(V||A,O),U=a;break}K.call(b,C,new so(b,{sourceEvent:A,subject:x,target:d,identifier:R,active:U,x:H[0]+M,y:H[1]+oe,dx:H[0]-W[0],dy:H[1]-W[1],dispatch:K}),L)}}return d.filter=function(C){return arguments.length?(e=typeof C=="function"?C:ln(!!C),d):e},d.container=function(C){return arguments.length?(t=typeof C=="function"?C:ln(C),d):t},d.subject=function(C){return arguments.length?(n=typeof C=="function"?C:ln(C),d):n},d.touchable=function(C){return arguments.length?(o=typeof C=="function"?C:ln(!!C),d):o},d.on=function(){var C=s.on.apply(s,arguments);return C===s?d:C},d.clickDistance=function(C){return arguments.length?(f=(C=+C)*C,d):Math.sqrt(f)},d}function Eo(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function ss(e,t){var n=Object.create(e.prototype);for(var o in t)n[o]=t[o];return n}function sn(){}var qt=.7,En=1/qt,Ct="\\s*([+-]?\\d+)\\s*",jt="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Je="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Wr=/^#([0-9a-f]{3,8})$/,Yr=new RegExp(`^rgb\\(${Ct},${Ct},${Ct}\\)$`),Ur=new RegExp(`^rgb\\(${Je},${Je},${Je}\\)$`),Xr=new RegExp(`^rgba\\(${Ct},${Ct},${Ct},${jt}\\)$`),Zr=new RegExp(`^rgba\\(${Je},${Je},${Je},${jt}\\)$`),Kr=new RegExp(`^hsl\\(${jt},${Je},${Je}\\)$`),qr=new RegExp(`^hsla\\(${jt},${Je},${Je},${jt}\\)$`),Lo={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};Eo(sn,wt,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:Fo,formatHex:Fo,formatHex8:jr,formatHsl:Jr,formatRgb:Go,toString:Go});function Fo(){return this.rgb().formatHex()}function jr(){return this.rgb().formatHex8()}function Jr(){return as(this).formatHsl()}function Go(){return this.rgb().formatRgb()}function wt(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=Wr.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?Wo(t):n===3?new He(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?rn(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?rn(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=Yr.exec(e))?new He(t[1],t[2],t[3],1):(t=Ur.exec(e))?new He(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=Xr.exec(e))?rn(t[1],t[2],t[3],t[4]):(t=Zr.exec(e))?rn(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=Kr.exec(e))?Xo(t[1],t[2]/100,t[3]/100,1):(t=qr.exec(e))?Xo(t[1],t[2]/100,t[3]/100,t[4]):Lo.hasOwnProperty(e)?Wo(Lo[e]):e==="transparent"?new He(NaN,NaN,NaN,0):null}function Wo(e){return new He(e>>16&255,e>>8&255,e&255,1)}function rn(e,t,n,o){return o<=0&&(e=t=n=NaN),new He(e,t,n,o)}function Qr(e){return e instanceof sn||(e=wt(e)),e?(e=e.rgb(),new He(e.r,e.g,e.b,e.opacity)):new He}function ao(e,t,n,o){return arguments.length===1?Qr(e):new He(e,t,n,o??1)}function He(e,t,n,o){this.r=+e,this.g=+t,this.b=+n,this.opacity=+o}Eo(He,ao,ss(sn,{brighter(e){return e=e==null?En:Math.pow(En,e),new He(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?qt:Math.pow(qt,e),new He(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new He(yt(this.r),yt(this.g),yt(this.b),kn(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:Yo,formatHex:Yo,formatHex8:eu,formatRgb:Uo,toString:Uo}));function Yo(){return`#${mt(this.r)}${mt(this.g)}${mt(this.b)}`}function eu(){return`#${mt(this.r)}${mt(this.g)}${mt(this.b)}${mt((isNaN(this.opacity)?1:this.opacity)*255)}`}function Uo(){const e=kn(this.opacity);return`${e===1?"rgb(":"rgba("}${yt(this.r)}, ${yt(this.g)}, ${yt(this.b)}${e===1?")":`, ${e})`}`}function kn(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function yt(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function mt(e){return e=yt(e),(e<16?"0":"")+e.toString(16)}function Xo(e,t,n,o){return o<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Ue(e,t,n,o)}function as(e){if(e instanceof Ue)return new Ue(e.h,e.s,e.l,e.opacity);if(e instanceof sn||(e=wt(e)),!e)return new Ue;if(e instanceof Ue)return e;e=e.rgb();var t=e.r/255,n=e.g/255,o=e.b/255,i=Math.min(t,n,o),s=Math.max(t,n,o),a=NaN,l=s-i,r=(s+i)/2;return l?(t===s?a=(n-o)/l+(n<o)*6:n===s?a=(o-t)/l+2:a=(t-n)/l+4,l/=r<.5?s+i:2-s-i,a*=60):l=r>0&&r<1?0:a,new Ue(a,l,r,e.opacity)}function tu(e,t,n,o){return arguments.length===1?as(e):new Ue(e,t,n,o??1)}function Ue(e,t,n,o){this.h=+e,this.s=+t,this.l=+n,this.opacity=+o}Eo(Ue,tu,ss(sn,{brighter(e){return e=e==null?En:Math.pow(En,e),new Ue(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?qt:Math.pow(qt,e),new Ue(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,o=n+(n<.5?n:1-n)*t,i=2*n-o;return new He(Xn(e>=240?e-240:e+120,i,o),Xn(e,i,o),Xn(e<120?e+240:e-120,i,o),this.opacity)},clamp(){return new Ue(Zo(this.h),un(this.s),un(this.l),kn(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=kn(this.opacity);return`${e===1?"hsl(":"hsla("}${Zo(this.h)}, ${un(this.s)*100}%, ${un(this.l)*100}%${e===1?")":`, ${e})`}`}}));function Zo(e){return e=(e||0)%360,e<0?e+360:e}function un(e){return Math.max(0,Math.min(1,e||0))}function Xn(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}const ko=e=>()=>e;function nu(e,t){return function(n){return e+n*t}}function ou(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(o){return Math.pow(e+o*t,n)}}function iu(e){return(e=+e)==1?ls:function(t,n){return n-t?ou(t,n,e):ko(isNaN(t)?n:t)}}function ls(e,t){var n=t-e;return n?nu(e,n):ko(isNaN(e)?t:e)}const Nn=(function e(t){var n=iu(t);function o(i,s){var a=n((i=ao(i)).r,(s=ao(s)).r),l=n(i.g,s.g),r=n(i.b,s.b),u=ls(i.opacity,s.opacity);return function(c){return i.r=a(c),i.g=l(c),i.b=r(c),i.opacity=u(c),i+""}}return o.gamma=e,o})(1);function su(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,o=t.slice(),i;return function(s){for(i=0;i<n;++i)o[i]=e[i]*(1-s)+t[i]*s;return o}}function au(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function lu(e,t){var n=t?t.length:0,o=e?Math.min(n,e.length):0,i=new Array(o),s=new Array(n),a;for(a=0;a<o;++a)i[a]=Gt(e[a],t[a]);for(;a<n;++a)s[a]=t[a];return function(l){for(a=0;a<o;++a)s[a]=i[a](l);return s}}function ru(e,t){var n=new Date;return e=+e,t=+t,function(o){return n.setTime(e*(1-o)+t*o),n}}function qe(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function uu(e,t){var n={},o={},i;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(i in t)i in e?n[i]=Gt(e[i],t[i]):o[i]=t[i];return function(s){for(i in n)o[i]=n[i](s);return o}}var lo=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Zn=new RegExp(lo.source,"g");function cu(e){return function(){return e}}function du(e){return function(t){return e(t)+""}}function rs(e,t){var n=lo.lastIndex=Zn.lastIndex=0,o,i,s,a=-1,l=[],r=[];for(e=e+"",t=t+"";(o=lo.exec(e))&&(i=Zn.exec(t));)(s=i.index)>n&&(s=t.slice(n,s),l[a]?l[a]+=s:l[++a]=s),(o=o[0])===(i=i[0])?l[a]?l[a]+=i:l[++a]=i:(l[++a]=null,r.push({i:a,x:qe(o,i)})),n=Zn.lastIndex;return n<t.length&&(s=t.slice(n),l[a]?l[a]+=s:l[++a]=s),l.length<2?r[0]?du(r[0].x):cu(t):(t=r.length,function(u){for(var c=0,f;c<t;++c)l[(f=r[c]).i]=f.x(u);return l.join("")})}function Gt(e,t){var n=typeof t,o;return t==null||n==="boolean"?ko(t):(n==="number"?qe:n==="string"?(o=wt(t))?(t=o,Nn):rs:t instanceof wt?Nn:t instanceof Date?ru:au(t)?su:Array.isArray(t)?lu:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?uu:qe)(e,t)}var Ko=180/Math.PI,ro={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function us(e,t,n,o,i,s){var a,l,r;return(a=Math.sqrt(e*e+t*t))&&(e/=a,t/=a),(r=e*n+t*o)&&(n-=e*r,o-=t*r),(l=Math.sqrt(n*n+o*o))&&(n/=l,o/=l,r/=l),e*o<t*n&&(e=-e,t=-t,r=-r,a=-a),{translateX:i,translateY:s,rotate:Math.atan2(t,e)*Ko,skewX:Math.atan(r)*Ko,scaleX:a,scaleY:l}}var cn;function fu(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?ro:us(t.a,t.b,t.c,t.d,t.e,t.f)}function hu(e){return e==null||(cn||(cn=document.createElementNS("http://www.w3.org/2000/svg","g")),cn.setAttribute("transform",e),!(e=cn.transform.baseVal.consolidate()))?ro:(e=e.matrix,us(e.a,e.b,e.c,e.d,e.e,e.f))}function cs(e,t,n,o){function i(u){return u.length?u.pop()+" ":""}function s(u,c,f,d,_,k){if(u!==f||c!==d){var p=_.push("translate(",null,t,null,n);k.push({i:p-4,x:qe(u,f)},{i:p-2,x:qe(c,d)})}else(f||d)&&_.push("translate("+f+t+d+n)}function a(u,c,f,d){u!==c?(u-c>180?c+=360:c-u>180&&(u+=360),d.push({i:f.push(i(f)+"rotate(",null,o)-2,x:qe(u,c)})):c&&f.push(i(f)+"rotate("+c+o)}function l(u,c,f,d){u!==c?d.push({i:f.push(i(f)+"skewX(",null,o)-2,x:qe(u,c)}):c&&f.push(i(f)+"skewX("+c+o)}function r(u,c,f,d,_,k){if(u!==f||c!==d){var p=_.push(i(_)+"scale(",null,",",null,")");k.push({i:p-4,x:qe(u,f)},{i:p-2,x:qe(c,d)})}else(f!==1||d!==1)&&_.push(i(_)+"scale("+f+","+d+")")}return function(u,c){var f=[],d=[];return u=e(u),c=e(c),s(u.translateX,u.translateY,c.translateX,c.translateY,f,d),a(u.rotate,c.rotate,f,d),l(u.skewX,c.skewX,f,d),r(u.scaleX,u.scaleY,c.scaleX,c.scaleY,f,d),u=c=null,function(_){for(var k=-1,p=d.length,m;++k<p;)f[(m=d[k]).i]=m.x(_);return f.join("")}}}var vu=cs(fu,"px, ","px)","deg)"),pu=cs(hu,", ",")",")"),gu=1e-12;function qo(e){return((e=Math.exp(e))+1/e)/2}function mu(e){return((e=Math.exp(e))-1/e)/2}function yu(e){return((e=Math.exp(2*e))-1)/(e+1)}const _n=(function e(t,n,o){function i(s,a){var l=s[0],r=s[1],u=s[2],c=a[0],f=a[1],d=a[2],_=c-l,k=f-r,p=_*_+k*k,m,w;if(p<gu)w=Math.log(d/u)/t,m=function(L){return[l+L*_,r+L*k,u*Math.exp(t*L*w)]};else{var g=Math.sqrt(p),v=(d*d-u*u+o*p)/(2*u*n*g),C=(d*d-u*u-o*p)/(2*d*n*g),O=Math.log(Math.sqrt(v*v+1)-v),F=Math.log(Math.sqrt(C*C+1)-C);w=(F-O)/t,m=function(L){var R=L*w,se=qo(O),K=u/(n*g)*(se*yu(t*R+O)-mu(O));return[l+K*_,r+K*k,u*se/qo(t*R+O)]}}return m.duration=w*1e3*t/Math.SQRT2,m}return i.rho=function(s){var a=Math.max(.001,+s),l=a*a,r=l*l;return e(a,l,r)},i})(Math.SQRT2,2,4);var Tt=0,Ht=0,Vt=0,ds=1e3,$n,Lt,Cn=0,bt=0,On=0,Jt=typeof performance=="object"&&performance.now?performance:Date,fs=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function No(){return bt||(fs(_u),bt=Jt.now()+On)}function _u(){bt=0}function Mn(){this._call=this._time=this._next=null}Mn.prototype=hs.prototype={constructor:Mn,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?No():+n)+(t==null?0:+t),!this._next&&Lt!==this&&(Lt?Lt._next=this:$n=this,Lt=this),this._call=e,this._time=n,uo()},stop:function(){this._call&&(this._call=null,this._time=1/0,uo())}};function hs(e,t,n){var o=new Mn;return o.restart(e,t,n),o}function wu(){No(),++Tt;for(var e=$n,t;e;)(t=bt-e._time)>=0&&e._call.call(void 0,t),e=e._next;--Tt}function jo(){bt=(Cn=Jt.now())+On,Tt=Ht=0;try{wu()}finally{Tt=0,xu(),bt=0}}function bu(){var e=Jt.now(),t=e-Cn;t>ds&&(On-=t,Cn=e)}function xu(){for(var e,t=$n,n,o=1/0;t;)t._call?(o>t._time&&(o=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:$n=n);Lt=e,uo(o)}function uo(e){if(!Tt){Ht&&(Ht=clearTimeout(Ht));var t=e-bt;t>24?(e<1/0&&(Ht=setTimeout(jo,e-Jt.now()-On)),Vt&&(Vt=clearInterval(Vt))):(Vt||(Cn=Jt.now(),Vt=setInterval(bu,ds)),Tt=1,fs(jo))}}function Jo(e,t,n){var o=new Mn;return t=t==null?0:+t,o.restart(i=>{o.stop(),e(i+t)},t,n),o}var Su=Pn("start","end","cancel","interrupt"),Eu=[],vs=0,Qo=1,co=2,wn=3,ei=4,fo=5,bn=6;function zn(e,t,n,o,i,s){var a=e.__transition;if(!a)e.__transition={};else if(n in a)return;ku(e,n,{name:t,index:o,group:i,on:Su,tween:Eu,time:s.time,delay:s.delay,duration:s.duration,ease:s.ease,timer:null,state:vs})}function $o(e,t){var n=Ze(e,t);if(n.state>vs)throw new Error("too late; already scheduled");return n}function et(e,t){var n=Ze(e,t);if(n.state>wn)throw new Error("too late; already running");return n}function Ze(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function ku(e,t,n){var o=e.__transition,i;o[t]=n,n.timer=hs(s,0,n.time);function s(u){n.state=Qo,n.timer.restart(a,n.delay,n.time),n.delay<=u&&a(u-n.delay)}function a(u){var c,f,d,_;if(n.state!==Qo)return r();for(c in o)if(_=o[c],_.name===n.name){if(_.state===wn)return Jo(a);_.state===ei?(_.state=bn,_.timer.stop(),_.on.call("interrupt",e,e.__data__,_.index,_.group),delete o[c]):+c<t&&(_.state=bn,_.timer.stop(),_.on.call("cancel",e,e.__data__,_.index,_.group),delete o[c])}if(Jo(function(){n.state===wn&&(n.state=ei,n.timer.restart(l,n.delay,n.time),l(u))}),n.state=co,n.on.call("start",e,e.__data__,n.index,n.group),n.state===co){for(n.state=wn,i=new Array(d=n.tween.length),c=0,f=-1;c<d;++c)(_=n.tween[c].value.call(e,e.__data__,n.index,n.group))&&(i[++f]=_);i.length=f+1}}function l(u){for(var c=u<n.duration?n.ease.call(null,u/n.duration):(n.timer.restart(r),n.state=fo,1),f=-1,d=i.length;++f<d;)i[f].call(e,c);n.state===fo&&(n.on.call("end",e,e.__data__,n.index,n.group),r())}function r(){n.state=bn,n.timer.stop(),delete o[t];for(var u in o)return;delete e.__transition}}function xn(e,t){var n=e.__transition,o,i,s=!0,a;if(n){t=t==null?null:t+"";for(a in n){if((o=n[a]).name!==t){s=!1;continue}i=o.state>co&&o.state<fo,o.state=bn,o.timer.stop(),o.on.call(i?"interrupt":"cancel",e,e.__data__,o.index,o.group),delete n[a]}s&&delete e.__transition}}function Nu(e){return this.each(function(){xn(this,e)})}function $u(e,t){var n,o;return function(){var i=et(this,e),s=i.tween;if(s!==n){o=n=s;for(var a=0,l=o.length;a<l;++a)if(o[a].name===t){o=o.slice(),o.splice(a,1);break}}i.tween=o}}function Cu(e,t,n){var o,i;if(typeof n!="function")throw new Error;return function(){var s=et(this,e),a=s.tween;if(a!==o){i=(o=a).slice();for(var l={name:t,value:n},r=0,u=i.length;r<u;++r)if(i[r].name===t){i[r]=l;break}r===u&&i.push(l)}s.tween=i}}function Mu(e,t){var n=this._id;if(e+="",arguments.length<2){for(var o=Ze(this.node(),n).tween,i=0,s=o.length,a;i<s;++i)if((a=o[i]).name===e)return a.value;return null}return this.each((t==null?$u:Cu)(n,e,t))}function Co(e,t,n){var o=e._id;return e.each(function(){var i=et(this,o);(i.value||(i.value={}))[t]=n.apply(this,arguments)}),function(i){return Ze(i,o).value[t]}}function ps(e,t){var n;return(typeof t=="number"?qe:t instanceof wt?Nn:(n=wt(t))?(t=n,Nn):rs)(e,t)}function Iu(e){return function(){this.removeAttribute(e)}}function Du(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Tu(e,t,n){var o,i=n+"",s;return function(){var a=this.getAttribute(e);return a===i?null:a===o?s:s=t(o=a,n)}}function Pu(e,t,n){var o,i=n+"",s;return function(){var a=this.getAttributeNS(e.space,e.local);return a===i?null:a===o?s:s=t(o=a,n)}}function Au(e,t,n){var o,i,s;return function(){var a,l=n(this),r;return l==null?void this.removeAttribute(e):(a=this.getAttribute(e),r=l+"",a===r?null:a===o&&r===i?s:(i=r,s=t(o=a,l)))}}function Ou(e,t,n){var o,i,s;return function(){var a,l=n(this),r;return l==null?void this.removeAttributeNS(e.space,e.local):(a=this.getAttributeNS(e.space,e.local),r=l+"",a===r?null:a===o&&r===i?s:(i=r,s=t(o=a,l)))}}function zu(e,t){var n=An(e),o=n==="transform"?pu:ps;return this.attrTween(e,typeof t=="function"?(n.local?Ou:Au)(n,o,Co(this,"attr."+e,t)):t==null?(n.local?Du:Iu)(n):(n.local?Pu:Tu)(n,o,t))}function Bu(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function Vu(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function Ru(e,t){var n,o;function i(){var s=t.apply(this,arguments);return s!==o&&(n=(o=s)&&Vu(e,s)),n}return i._value=t,i}function Hu(e,t){var n,o;function i(){var s=t.apply(this,arguments);return s!==o&&(n=(o=s)&&Bu(e,s)),n}return i._value=t,i}function Lu(e,t){var n="attr."+e;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(t==null)return this.tween(n,null);if(typeof t!="function")throw new Error;var o=An(e);return this.tween(n,(o.local?Ru:Hu)(o,t))}function Fu(e,t){return function(){$o(this,e).delay=+t.apply(this,arguments)}}function Gu(e,t){return t=+t,function(){$o(this,e).delay=t}}function Wu(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?Fu:Gu)(t,e)):Ze(this.node(),t).delay}function Yu(e,t){return function(){et(this,e).duration=+t.apply(this,arguments)}}function Uu(e,t){return t=+t,function(){et(this,e).duration=t}}function Xu(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?Yu:Uu)(t,e)):Ze(this.node(),t).duration}function Zu(e,t){if(typeof t!="function")throw new Error;return function(){et(this,e).ease=t}}function Ku(e){var t=this._id;return arguments.length?this.each(Zu(t,e)):Ze(this.node(),t).ease}function qu(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;et(this,e).ease=n}}function ju(e){if(typeof e!="function")throw new Error;return this.each(qu(this._id,e))}function Ju(e){typeof e!="function"&&(e=Xi(e));for(var t=this._groups,n=t.length,o=new Array(n),i=0;i<n;++i)for(var s=t[i],a=s.length,l=o[i]=[],r,u=0;u<a;++u)(r=s[u])&&e.call(r,r.__data__,u,s)&&l.push(r);return new at(o,this._parents,this._name,this._id)}function Qu(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,n=e._groups,o=t.length,i=n.length,s=Math.min(o,i),a=new Array(o),l=0;l<s;++l)for(var r=t[l],u=n[l],c=r.length,f=a[l]=new Array(c),d,_=0;_<c;++_)(d=r[_]||u[_])&&(f[_]=d);for(;l<o;++l)a[l]=t[l];return new at(a,this._parents,this._name,this._id)}function ec(e){return(e+"").trim().split(/^|\s+/).every(function(t){var n=t.indexOf(".");return n>=0&&(t=t.slice(0,n)),!t||t==="start"})}function tc(e,t,n){var o,i,s=ec(t)?$o:et;return function(){var a=s(this,e),l=a.on;l!==o&&(i=(o=l).copy()).on(t,n),a.on=i}}function nc(e,t){var n=this._id;return arguments.length<2?Ze(this.node(),n).on.on(e):this.each(tc(n,e,t))}function oc(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function ic(){return this.on("end.remove",oc(this._id))}function sc(e){var t=this._name,n=this._id;typeof e!="function"&&(e=xo(e));for(var o=this._groups,i=o.length,s=new Array(i),a=0;a<i;++a)for(var l=o[a],r=l.length,u=s[a]=new Array(r),c,f,d=0;d<r;++d)(c=l[d])&&(f=e.call(c,c.__data__,d,l))&&("__data__"in c&&(f.__data__=c.__data__),u[d]=f,zn(u[d],t,n,d,u,Ze(c,n)));return new at(s,this._parents,t,n)}function ac(e){var t=this._name,n=this._id;typeof e!="function"&&(e=Ui(e));for(var o=this._groups,i=o.length,s=[],a=[],l=0;l<i;++l)for(var r=o[l],u=r.length,c,f=0;f<u;++f)if(c=r[f]){for(var d=e.call(c,c.__data__,f,r),_,k=Ze(c,n),p=0,m=d.length;p<m;++p)(_=d[p])&&zn(_,t,n,p,d,k);s.push(d),a.push(c)}return new at(s,a,t,n)}var lc=on.prototype.constructor;function rc(){return new lc(this._groups,this._parents)}function uc(e,t){var n,o,i;return function(){var s=Dt(this,e),a=(this.style.removeProperty(e),Dt(this,e));return s===a?null:s===n&&a===o?i:i=t(n=s,o=a)}}function gs(e){return function(){this.style.removeProperty(e)}}function cc(e,t,n){var o,i=n+"",s;return function(){var a=Dt(this,e);return a===i?null:a===o?s:s=t(o=a,n)}}function dc(e,t,n){var o,i,s;return function(){var a=Dt(this,e),l=n(this),r=l+"";return l==null&&(r=l=(this.style.removeProperty(e),Dt(this,e))),a===r?null:a===o&&r===i?s:(i=r,s=t(o=a,l))}}function fc(e,t){var n,o,i,s="style."+t,a="end."+s,l;return function(){var r=et(this,e),u=r.on,c=r.value[s]==null?l||(l=gs(t)):void 0;(u!==n||i!==c)&&(o=(n=u).copy()).on(a,i=c),r.on=o}}function hc(e,t,n){var o=(e+="")=="transform"?vu:ps;return t==null?this.styleTween(e,uc(e,o)).on("end.style."+e,gs(e)):typeof t=="function"?this.styleTween(e,dc(e,o,Co(this,"style."+e,t))).each(fc(this._id,e)):this.styleTween(e,cc(e,o,t),n).on("end.style."+e,null)}function vc(e,t,n){return function(o){this.style.setProperty(e,t.call(this,o),n)}}function pc(e,t,n){var o,i;function s(){var a=t.apply(this,arguments);return a!==i&&(o=(i=a)&&vc(e,a,n)),o}return s._value=t,s}function gc(e,t,n){var o="style."+(e+="");if(arguments.length<2)return(o=this.tween(o))&&o._value;if(t==null)return this.tween(o,null);if(typeof t!="function")throw new Error;return this.tween(o,pc(e,t,n??""))}function mc(e){return function(){this.textContent=e}}function yc(e){return function(){var t=e(this);this.textContent=t??""}}function _c(e){return this.tween("text",typeof e=="function"?yc(Co(this,"text",e)):mc(e==null?"":e+""))}function wc(e){return function(t){this.textContent=e.call(this,t)}}function bc(e){var t,n;function o(){var i=e.apply(this,arguments);return i!==n&&(t=(n=i)&&wc(i)),t}return o._value=e,o}function xc(e){var t="text";if(arguments.length<1)return(t=this.tween(t))&&t._value;if(e==null)return this.tween(t,null);if(typeof e!="function")throw new Error;return this.tween(t,bc(e))}function Sc(){for(var e=this._name,t=this._id,n=ms(),o=this._groups,i=o.length,s=0;s<i;++s)for(var a=o[s],l=a.length,r,u=0;u<l;++u)if(r=a[u]){var c=Ze(r,t);zn(r,e,n,u,a,{time:c.time+c.delay+c.duration,delay:0,duration:c.duration,ease:c.ease})}return new at(o,this._parents,e,n)}function Ec(){var e,t,n=this,o=n._id,i=n.size();return new Promise(function(s,a){var l={value:a},r={value:function(){--i===0&&s()}};n.each(function(){var u=et(this,o),c=u.on;c!==e&&(t=(e=c).copy(),t._.cancel.push(l),t._.interrupt.push(l),t._.end.push(r)),u.on=t}),i===0&&s()})}var kc=0;function at(e,t,n,o){this._groups=e,this._parents=t,this._name=n,this._id=o}function ms(){return++kc}var nt=on.prototype;at.prototype={constructor:at,select:sc,selectAll:ac,selectChild:nt.selectChild,selectChildren:nt.selectChildren,filter:Ju,merge:Qu,selection:rc,transition:Sc,call:nt.call,nodes:nt.nodes,node:nt.node,size:nt.size,empty:nt.empty,each:nt.each,on:nc,attr:zu,attrTween:Lu,style:hc,styleTween:gc,text:_c,textTween:xc,remove:ic,tween:Mu,delay:Wu,duration:Xu,ease:Ku,easeVarying:ju,end:Ec,[Symbol.iterator]:nt[Symbol.iterator]};function Nc(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var $c={time:null,delay:0,duration:250,ease:Nc};function Cc(e,t){for(var n;!(n=e.__transition)||!(n=n[t]);)if(!(e=e.parentNode))throw new Error(`transition ${t} not found`);return n}function Mc(e){var t,n;e instanceof at?(t=e._id,e=e._name):(t=ms(),(n=$c).time=No(),e=e==null?null:e+"");for(var o=this._groups,i=o.length,s=0;s<i;++s)for(var a=o[s],l=a.length,r,u=0;u<l;++u)(r=a[u])&&zn(r,e,t,u,a,n||Cc(r,t));return new at(o,this._parents,e,t)}on.prototype.interrupt=Nu;on.prototype.transition=Mc;const dn=e=>()=>e;function Ic(e,{sourceEvent:t,target:n,transform:o,dispatch:i}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:o,enumerable:!0,configurable:!0},_:{value:i}})}function it(e,t,n){this.k=e,this.x=t,this.y=n}it.prototype={constructor:it,scale:function(e){return e===1?this:new it(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new it(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var Pt=new it(1,0,0);it.prototype;function Kn(e){e.stopImmediatePropagation()}function Rt(e){e.preventDefault(),e.stopImmediatePropagation()}function Dc(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function Tc(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e,e.hasAttribute("viewBox")?(e=e.viewBox.baseVal,[[e.x,e.y],[e.x+e.width,e.y+e.height]]):[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]):[[0,0],[e.clientWidth,e.clientHeight]]}function ti(){return this.__zoom||Pt}function Pc(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function Ac(){return navigator.maxTouchPoints||"ontouchstart"in this}function Oc(e,t,n){var o=e.invertX(t[0][0])-n[0][0],i=e.invertX(t[1][0])-n[1][0],s=e.invertY(t[0][1])-n[0][1],a=e.invertY(t[1][1])-n[1][1];return e.translate(i>o?(o+i)/2:Math.min(0,o)||Math.max(0,i),a>s?(s+a)/2:Math.min(0,s)||Math.max(0,a))}function zc(){var e=Dc,t=Tc,n=Oc,o=Pc,i=Ac,s=[0,1/0],a=[[-1/0,-1/0],[1/0,1/0]],l=250,r=_n,u=Pn("start","zoom","end"),c,f,d,_=500,k=150,p=0,m=10;function w(x){x.property("__zoom",ti).on("wheel.zoom",R,{passive:!1}).on("mousedown.zoom",se).on("dblclick.zoom",K).filter(i).on("touchstart.zoom",H).on("touchmove.zoom",M).on("touchend.zoom touchcancel.zoom",oe).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}w.transform=function(x,I,b,A){var V=x.selection?x.selection():x;V.property("__zoom",ti),x!==V?O(x,I,b,A):V.interrupt().each(function(){F(this,arguments).event(A).start().zoom(null,typeof I=="function"?I.apply(this,arguments):I).end()})},w.scaleBy=function(x,I,b,A){w.scaleTo(x,function(){var V=this.__zoom.k,W=typeof I=="function"?I.apply(this,arguments):I;return V*W},b,A)},w.scaleTo=function(x,I,b,A){w.transform(x,function(){var V=t.apply(this,arguments),W=this.__zoom,U=b==null?C(V):typeof b=="function"?b.apply(this,arguments):b,te=W.invert(U),re=typeof I=="function"?I.apply(this,arguments):I;return n(v(g(W,re),U,te),V,a)},b,A)},w.translateBy=function(x,I,b,A){w.transform(x,function(){return n(this.__zoom.translate(typeof I=="function"?I.apply(this,arguments):I,typeof b=="function"?b.apply(this,arguments):b),t.apply(this,arguments),a)},null,A)},w.translateTo=function(x,I,b,A,V){w.transform(x,function(){var W=t.apply(this,arguments),U=this.__zoom,te=A==null?C(W):typeof A=="function"?A.apply(this,arguments):A;return n(Pt.translate(te[0],te[1]).scale(U.k).translate(typeof I=="function"?-I.apply(this,arguments):-I,typeof b=="function"?-b.apply(this,arguments):-b),W,a)},A,V)};function g(x,I){return I=Math.max(s[0],Math.min(s[1],I)),I===x.k?x:new it(I,x.x,x.y)}function v(x,I,b){var A=I[0]-b[0]*x.k,V=I[1]-b[1]*x.k;return A===x.x&&V===x.y?x:new it(x.k,A,V)}function C(x){return[(+x[0][0]+ +x[1][0])/2,(+x[0][1]+ +x[1][1])/2]}function O(x,I,b,A){x.on("start.zoom",function(){F(this,arguments).event(A).start()}).on("interrupt.zoom end.zoom",function(){F(this,arguments).event(A).end()}).tween("zoom",function(){var V=this,W=arguments,U=F(V,W).event(A),te=t.apply(V,W),re=b==null?C(te):typeof b=="function"?b.apply(V,W):b,fe=Math.max(te[1][0]-te[0][0],te[1][1]-te[0][1]),ge=V.__zoom,j=typeof I=="function"?I.apply(V,W):I,ne=r(ge.invert(re).concat(fe/ge.k),j.invert(re).concat(fe/j.k));return function(ee){if(ee===1)ee=j;else{var ce=ne(ee),me=fe/ce[2];ee=new it(me,re[0]-ce[0]*me,re[1]-ce[1]*me)}U.zoom(null,ee)}})}function F(x,I,b){return!b&&x.__zooming||new L(x,I)}function L(x,I){this.that=x,this.args=I,this.active=0,this.sourceEvent=null,this.extent=t.apply(x,I),this.taps=0}L.prototype={event:function(x){return x&&(this.sourceEvent=x),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(x,I){return this.mouse&&x!=="mouse"&&(this.mouse[1]=I.invert(this.mouse[0])),this.touch0&&x!=="touch"&&(this.touch0[1]=I.invert(this.touch0[0])),this.touch1&&x!=="touch"&&(this.touch1[1]=I.invert(this.touch1[0])),this.that.__zoom=I,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(x){var I=Ye(this.that).datum();u.call(x,this.that,new Ic(x,{sourceEvent:this.sourceEvent,target:w,transform:this.that.__zoom,dispatch:u}),I)}};function R(x,...I){if(!e.apply(this,arguments))return;var b=F(this,I).event(x),A=this.__zoom,V=Math.max(s[0],Math.min(s[1],A.k*Math.pow(2,o.apply(this,arguments)))),W=Ke(x);if(b.wheel)(b.mouse[0][0]!==W[0]||b.mouse[0][1]!==W[1])&&(b.mouse[1]=A.invert(b.mouse[0]=W)),clearTimeout(b.wheel);else{if(A.k===V)return;b.mouse=[W,A.invert(W)],xn(this),b.start()}Rt(x),b.wheel=setTimeout(U,k),b.zoom("mouse",n(v(g(A,V),b.mouse[0],b.mouse[1]),b.extent,a));function U(){b.wheel=null,b.end()}}function se(x,...I){if(d||!e.apply(this,arguments))return;var b=x.currentTarget,A=F(this,I,!0).event(x),V=Ye(x.view).on("mousemove.zoom",re,!0).on("mouseup.zoom",fe,!0),W=Ke(x,b),U=x.clientX,te=x.clientY;os(x.view),Kn(x),A.mouse=[W,this.__zoom.invert(W)],xn(this),A.start();function re(ge){if(Rt(ge),!A.moved){var j=ge.clientX-U,ne=ge.clientY-te;A.moved=j*j+ne*ne>p}A.event(ge).zoom("mouse",n(v(A.that.__zoom,A.mouse[0]=Ke(ge,b),A.mouse[1]),A.extent,a))}function fe(ge){V.on("mousemove.zoom mouseup.zoom",null),is(ge.view,A.moved),Rt(ge),A.event(ge).end()}}function K(x,...I){if(e.apply(this,arguments)){var b=this.__zoom,A=Ke(x.changedTouches?x.changedTouches[0]:x,this),V=b.invert(A),W=b.k*(x.shiftKey?.5:2),U=n(v(g(b,W),A,V),t.apply(this,I),a);Rt(x),l>0?Ye(this).transition().duration(l).call(O,U,A,x):Ye(this).call(w.transform,U,A,x)}}function H(x,...I){if(e.apply(this,arguments)){var b=x.touches,A=b.length,V=F(this,I,x.changedTouches.length===A).event(x),W,U,te,re;for(Kn(x),U=0;U<A;++U)te=b[U],re=Ke(te,this),re=[re,this.__zoom.invert(re),te.identifier],V.touch0?!V.touch1&&V.touch0[2]!==re[2]&&(V.touch1=re,V.taps=0):(V.touch0=re,W=!0,V.taps=1+!!c);c&&(c=clearTimeout(c)),W&&(V.taps<2&&(f=re[0],c=setTimeout(function(){c=null},_)),xn(this),V.start())}}function M(x,...I){if(this.__zooming){var b=F(this,I).event(x),A=x.changedTouches,V=A.length,W,U,te,re;for(Rt(x),W=0;W<V;++W)U=A[W],te=Ke(U,this),b.touch0&&b.touch0[2]===U.identifier?b.touch0[0]=te:b.touch1&&b.touch1[2]===U.identifier&&(b.touch1[0]=te);if(U=b.that.__zoom,b.touch1){var fe=b.touch0[0],ge=b.touch0[1],j=b.touch1[0],ne=b.touch1[1],ee=(ee=j[0]-fe[0])*ee+(ee=j[1]-fe[1])*ee,ce=(ce=ne[0]-ge[0])*ce+(ce=ne[1]-ge[1])*ce;U=g(U,Math.sqrt(ee/ce)),te=[(fe[0]+j[0])/2,(fe[1]+j[1])/2],re=[(ge[0]+ne[0])/2,(ge[1]+ne[1])/2]}else if(b.touch0)te=b.touch0[0],re=b.touch0[1];else return;b.zoom("touch",n(v(U,te,re),b.extent,a))}}function oe(x,...I){if(this.__zooming){var b=F(this,I).event(x),A=x.changedTouches,V=A.length,W,U;for(Kn(x),d&&clearTimeout(d),d=setTimeout(function(){d=null},_),W=0;W<V;++W)U=A[W],b.touch0&&b.touch0[2]===U.identifier?delete b.touch0:b.touch1&&b.touch1[2]===U.identifier&&delete b.touch1;if(b.touch1&&!b.touch0&&(b.touch0=b.touch1,delete b.touch1),b.touch0)b.touch0[1]=this.__zoom.invert(b.touch0[0]);else if(b.end(),b.taps===2&&(U=Ke(U,this),Math.hypot(f[0]-U[0],f[1]-U[1])<m)){var te=Ye(this).on("dblclick.zoom");te&&te.apply(this,arguments)}}}return w.wheelDelta=function(x){return arguments.length?(o=typeof x=="function"?x:dn(+x),w):o},w.filter=function(x){return arguments.length?(e=typeof x=="function"?x:dn(!!x),w):e},w.touchable=function(x){return arguments.length?(i=typeof x=="function"?x:dn(!!x),w):i},w.extent=function(x){return arguments.length?(t=typeof x=="function"?x:dn([[+x[0][0],+x[0][1]],[+x[1][0],+x[1][1]]]),w):t},w.scaleExtent=function(x){return arguments.length?(s[0]=+x[0],s[1]=+x[1],w):[s[0],s[1]]},w.translateExtent=function(x){return arguments.length?(a[0][0]=+x[0][0],a[1][0]=+x[1][0],a[0][1]=+x[0][1],a[1][1]=+x[1][1],w):[[a[0][0],a[0][1]],[a[1][0],a[1][1]]]},w.constrain=function(x){return arguments.length?(n=x,w):n},w.duration=function(x){return arguments.length?(l=+x,w):l},w.interpolate=function(x){return arguments.length?(r=x,w):r},w.on=function(){var x=u.on.apply(u,arguments);return x===u?w:x},w.clickDistance=function(x){return arguments.length?(p=(x=+x)*x,w):Math.sqrt(p)},w.tapDistance=function(x){return arguments.length?(m=+x,w):m},w}var ae=(e=>(e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom",e))(ae||{}),Mo=(e=>(e.Partial="partial",e.Full="full",e))(Mo||{}),pt=(e=>(e.Bezier="default",e.SimpleBezier="simple-bezier",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e))(pt||{}),dt=(e=>(e.Strict="strict",e.Loose="loose",e))(dt||{}),ho=(e=>(e.Arrow="arrow",e.ArrowClosed="arrowclosed",e))(ho||{}),Wt=(e=>(e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal",e))(Wt||{});const Bc=["INPUT","SELECT","TEXTAREA"],Vc=typeof document<"u"?document:null;function vo(e){var t,n;const o=((n=(t=e.composedPath)==null?void 0:t.call(e))==null?void 0:n[0])||e.target,i=typeof o?.hasAttribute=="function"?o.hasAttribute("contenteditable"):!1,s=typeof o?.closest=="function"?o.closest(".nokey"):null;return Bc.includes(o?.nodeName)||i||!!s}function Rc(e){return e.ctrlKey||e.metaKey||e.shiftKey||e.altKey}function ni(e,t,n,o){const i=t.replace("+",`
2
2
  `).replace(`
3
3
 
4
4
  `,`
@@ -1,4 +1,4 @@
1
- import{G as u,H as J,r as v,j as y,d as B,e as M,v as F,I,J as q,o as C,_ as T,K,L as X,s as x,T as Q,M as D,N as Y,f as w,w as E,O as _,P as Z}from"./index-D8KM69RB.js";const f={create(e){return u.post("/workspaces",e)},list(e){return u.get("/workspaces",{params:e})},get(e){return u.get(`/workspaces/${e}`)},status(e,a){return u.get(`/workspaces/${e}/status`,{params:{format:a}})},delete(e,a){return u.delete(`/workspaces/${e}`,{params:{force:a?"true":void 0}})},archive(e){return u.post(`/workspaces/${e}/archive`)},restore(e){return u.post(`/workspaces/${e}/restore`)},togglePin(e){return u.post(`/workspaces/${e}/pin`)},getDevInfo(){return u.get("/dev-info")},enableDispatch(e,a){return u.post(`/workspaces/${e}/dispatch/enable`,{useGit:a})},queryDisableDispatch(e){return u.post(`/workspaces/${e}/dispatch/disable`)},executeDisableDispatch(e,a){return u.post(`/workspaces/${e}/dispatch/disable/execute`,a)},switchDispatchMode(e,a){return u.post(`/workspaces/${e}/dispatch/switch`,{useGit:a})},reload(e){return u.post(`/workspaces/${e}/reload`)},diagnose(e){return u.post(`/workspaces/${e}/diagnose`)},repair(e,a){return u.post(`/workspaces/${e}/repair`,{issueIds:a})},markError(e,a,c){return u.post(`/workspaces/${e}/mark-error`,{message:a,errorType:c})}};function ee(e){const a=[],c=[],i=e.match(/## 规则[\s\S]*?(?=##|$)/);if(i){const n=i[0].split(`
1
+ import{G as u,H as J,r as v,j as y,d as B,e as M,v as F,I,J as q,o as C,_ as T,K,L as X,s as x,T as Q,M as D,N as Y,f as w,w as E,O as _,P as Z}from"./index-niFbQLQj.js";const f={create(e){return u.post("/workspaces",e)},list(e){return u.get("/workspaces",{params:e})},get(e){return u.get(`/workspaces/${e}`)},status(e,a){return u.get(`/workspaces/${e}/status`,{params:{format:a}})},delete(e,a){return u.delete(`/workspaces/${e}`,{params:{force:a?"true":void 0}})},archive(e){return u.post(`/workspaces/${e}/archive`)},restore(e){return u.post(`/workspaces/${e}/restore`)},togglePin(e){return u.post(`/workspaces/${e}/pin`)},getDevInfo(){return u.get("/dev-info")},enableDispatch(e,a){return u.post(`/workspaces/${e}/dispatch/enable`,{useGit:a})},queryDisableDispatch(e){return u.post(`/workspaces/${e}/dispatch/disable`)},executeDisableDispatch(e,a){return u.post(`/workspaces/${e}/dispatch/disable/execute`,a)},switchDispatchMode(e,a){return u.post(`/workspaces/${e}/dispatch/switch`,{useGit:a})},reload(e){return u.post(`/workspaces/${e}/reload`)},diagnose(e){return u.post(`/workspaces/${e}/diagnose`)},repair(e,a){return u.post(`/workspaces/${e}/repair`,{issueIds:a})},markError(e,a,c){return u.post(`/workspaces/${e}/mark-error`,{message:a,errorType:c})}};function ee(e){const a=[],c=[],i=e.match(/## 规则[\s\S]*?(?=##|$)/);if(i){const n=i[0].split(`
2
2
  `);for(const r of n){const s=r.trim();s.startsWith("- ")&&a.push(s.slice(2))}}const d=e.match(/## 文档[\s\S]*?(?=##|$)/);if(d){const n=d[0].split(`
3
3
  `);for(const r of n){const s=r.trim();if(s.startsWith("- ")){const l=s.match(/^- \[(.+?)\]\((.+?)\)(?: - (.+))?$/);l&&l[1]&&l[2]&&c.push({path:l[2],description:l[3]||l[1]})}}}return{rules:a,docs:c}}function te(e){const a=[];if(!e)return a;const c=e.split(`
4
4
  `);for(const i of c){const d=i.trim();if(!d.startsWith("|")||d.includes("---")||d.includes("时间"))continue;const p=d.split("|").map(n=>n.trim()).filter(n=>n);if(p.length>=3){const n=p[0],r=p[1],s=p[2];n&&s&&(r==="AI"||r==="Human"||r==="system")&&a.push({timestamp:n,operator:r,event:s})}}return a}const pe=J("workspace",()=>{const e=v([]),a=v(null),c=v(null),i=v(null),d=v([]),p=v([]),n=v([]),r=v(!1),s=v(null),l=y(()=>e.value.filter(o=>o.status==="active")),h=y(()=>e.value.filter(o=>o.status==="archived")),b=y(()=>c.value?.currentFocus||null),g=y(()=>{const o=a.value?.dispatch;return o?.enabled?o.useGit?"enabled-git":"enabled":"disabled"});async function k(o){r.value=!0,s.value=null;try{const t=await f.list({status:o});e.value=t.workspaces}catch(t){throw s.value=t instanceof Error?t.message:"获取工作区列表失败",t}finally{r.value=!1}}async function S(o){r.value=!0,s.value=null;try{const t=await f.get(o);a.value=t.config,c.value=t.graph;const{rules:m,docs:$}=ee(t.workspaceMd||"");d.value=m,p.value=$,n.value=te(t.logMd||"");const H=await f.status(o);i.value=H.summary}catch(t){throw s.value=t instanceof Error?t.message:"获取工作区详情失败",t}finally{r.value=!1}}async function L(o){try{const t=await f.status(o);i.value=t.summary}catch(t){throw s.value=t instanceof Error?t.message:"获取工作区状态失败",t}}async function N(o){r.value=!0,s.value=null;try{const t=await f.create(o);return await k("all"),t}catch(t){throw s.value=t instanceof Error?t.message:"创建工作区失败",t}finally{r.value=!1}}async function R(o,t){r.value=!0,s.value=null;try{await f.delete(o,t),await k("all"),a.value?.id===o&&(a.value=null,c.value=null)}catch(m){throw s.value=m instanceof Error?m.message:"删除工作区失败",m}finally{r.value=!1}}async function O(o){r.value=!0,s.value=null;try{await f.archive(o),await k("all")}catch(t){throw s.value=t instanceof Error?t.message:"归档工作区失败",t}finally{r.value=!1}}async function P(o){r.value=!0,s.value=null;try{await f.restore(o),await k("all")}catch(t){throw s.value=t instanceof Error?t.message:"恢复工作区失败",t}finally{r.value=!1}}async function j(o){try{const t=await f.togglePin(o),m=e.value.find($=>$.id===o);return m&&(m.pinned=t.pinned),t}catch(t){throw s.value=t instanceof Error?t.message:"切换置顶状态失败",t}}function z(){a.value=null,c.value=null,i.value=null,d.value=[],p.value=[],n.value=[]}async function U(o){if(!a.value)throw new Error("当前没有选中的工作区");r.value=!0,s.value=null;try{const t=await f.enableDispatch(a.value.id,o);return await S(a.value.id),t}catch(t){throw s.value=t instanceof Error?t.message:"启用派发失败",t}finally{r.value=!1}}async function G(o){if(!a.value)throw new Error("当前没有选中的工作区");r.value=!0,s.value=null;try{const t=await f.executeDisableDispatch(a.value.id,o);return await S(a.value.id),t}catch(t){throw s.value=t instanceof Error?t.message:"禁用派发失败",t}finally{r.value=!1}}async function A(o){if(!a.value)throw new Error("当前没有选中的工作区");r.value=!0,s.value=null;try{const t=await f.switchDispatchMode(a.value.id,o);return await S(a.value.id),t}catch(t){throw s.value=t instanceof Error?t.message:"切换派发模式失败",t}finally{r.value=!1}}return{workspaces:e,currentWorkspace:a,currentGraph:c,currentStatus:i,currentRules:d,currentDocs:p,currentLogs:n,loading:r,error:s,activeWorkspaces:l,archivedWorkspaces:h,currentFocus:b,dispatchStatus:g,fetchWorkspaces:k,fetchWorkspace:S,fetchStatus:L,createWorkspace:N,deleteWorkspace:R,archiveWorkspace:O,restoreWorkspace:P,togglePin:j,clearCurrent:z,enableDispatch:U,disableDispatch:G,switchDispatchMode:A}});function ae(){const e=v(!1),a=v(null);let c=null;const i=new Map;function d(){c||(c=new EventSource("/api/events"),c.onopen=()=>{e.value=!0,console.log("[SSE] 连接已建立")},c.onmessage=s=>{try{const l=JSON.parse(s.data);l.type==="connected"&&(a.value=l.clientId||null,console.log("[SSE] 客户端ID:",a.value));const h=i.get(l.type);h&&h.forEach(g=>g(l));const b=i.get("*");b&&b.forEach(g=>g(l))}catch(l){console.error("[SSE] 解析消息失败:",l)}},c.onerror=()=>{e.value=!1,console.log("[SSE] 连接断开,将自动重连...")})}function p(){c&&(c.close(),c=null,e.value=!1,a.value=null,console.log("[SSE] 连接已关闭"))}function n(s,l){return i.has(s)||i.set(s,new Set),i.get(s).add(l),()=>{i.get(s)?.delete(l)}}function r(s,l){i.get(s)?.delete(l)}return{connected:e,clientId:a,connect:d,disconnect:p,on:n,off:r}}let W=null;function fe(){return W||(W=ae()),W}const ve={pickDirectory(){return u.post("/admin/pick-directory",{},{timeout:3e5})},async exportWorkspace(e){const a=await fetch(`/api/admin/export-workspace/${e}`);if(!a.ok){const h=await a.json().catch(()=>({error:"导出失败"}));throw new Error(h.error||"导出失败")}const i=a.headers.get("Content-Disposition")?.match(/filename="(.+)"/),d=i?.[1]?decodeURIComponent(i[1]):"workspace.twsp",p=a.headers.get("X-Export-Warnings"),n=p?JSON.parse(atob(p)):[],r=await a.blob(),s=URL.createObjectURL(r),l=document.createElement("a");return l.href=s,l.download=d,l.click(),URL.revokeObjectURL(s),{filename:d,warnings:n}},async checkExportWorkspace(e){return u.get(`/admin/export-workspace/${e}/check`)},import(e,a){return u.post("/admin/import",{path:e,targetDir:a})},importPreview(e){return u.post("/admin/import-preview",{path:e})},syncCleanPreview(){return u.post("/admin/sync-clean-preview")},syncCleanExecute(){return u.post("/admin/sync-clean-execute")},getIndexStats(){return u.get("/admin/index-stats")},async importTwsp(e){return u.post("/admin/import-twsp",e,{headers:{"Content-Type":"multipart/form-data"},timeout:12e4})}},se=["disabled"],ne={key:0,class:"loading-spinner"},re=B({__name:"WsButton",props:{variant:{default:"primary"},size:{default:"md"},disabled:{type:Boolean,default:!1},loading:{type:Boolean,default:!1}},emits:["click"],setup(e,{emit:a}){const c=e,i=a,d=y(()=>{const n=["ws-button"];switch(c.variant){case"primary":n.push("btn-primary");break;case"secondary":n.push("btn-secondary");break;case"ghost":n.push("btn-ghost");break;case"accent":n.push("btn-accent");break;case"danger":n.push("btn-danger");break;case"icon":n.push("btn-icon");break;case"cancel":n.push("btn-cancel");break}return c.loading&&n.push("is-loading"),n.push(`btn-${c.size}`),n.join(" ")}),p=n=>{c.disabled||i("click",n)};return(n,r)=>(C(),M("button",{class:F(d.value),disabled:e.disabled||e.loading,onClick:p},[e.loading?(C(),M("span",ne)):I("",!0),q(n.$slots,"default",{},void 0,!0)],10,se))}}),V=T(re,[["__scopeId","data-v-cb8b1d12"]]),oe={class:"dialog-header"},ce={class:"dialog-title"},le={class:"dialog-body"},ie={class:"dialog-footer"},ue=B({__name:"WsConfirmDialog",props:{modelValue:{type:Boolean},title:{default:"确认"},message:{},confirmText:{default:"确定"},cancelText:{default:"取消"},type:{default:"info"}},emits:["update:modelValue","confirm","cancel"],setup(e,{emit:a}){const c=e,i=a,d=v(c.modelValue);K(()=>c.modelValue,l=>{d.value=l});function p(){i("update:modelValue",!1),i("confirm")}function n(){i("update:modelValue",!1),i("cancel")}function r(){n()}const s={info:"primary",warning:"accent",danger:"danger"};return(l,h)=>(C(),X(Y,{to:"body"},[x(Q,{name:"modal-fade"},{default:D(()=>[d.value?(C(),M("div",{key:0,class:"dialog-overlay",onClick:r},[w("div",{class:"dialog",onClick:h[0]||(h[0]=Z(()=>{},["stop"]))},[w("div",oe,[w("span",ce,E(e.title),1),w("button",{class:"dialog-close",onClick:n},[...h[1]||(h[1]=[w("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none"},[w("path",{d:"M12 4L4 12M4 4L12 12",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round"})],-1)])])]),w("div",le,E(e.message),1),w("div",ie,[x(V,{variant:"secondary",size:"sm",onClick:n},{default:D(()=>[_(E(e.cancelText),1)]),_:1}),x(V,{variant:s[e.type],size:"sm",onClick:p},{default:D(()=>[_(E(e.confirmText),1)]),_:1},8,["variant"])])])])):I("",!0)]),_:1})]))}}),he=T(ue,[["__scopeId","data-v-9b0cb320"]]);export{V as W,ve as a,he as b,fe as g,pe as u,f as w};
@@ -1 +1 @@
1
- import{a0 as ln,a1 as an,a2 as H,a3 as q,a4 as B,a5 as un,a6 as y,a7 as tn,a8 as L,a9 as _,aa as rn,ab as o,ac as sn,ad as on,ae as fn}from"./MarkdownContent-yGvS9ll7.js";function cn(l){return l.innerRadius}function yn(l){return l.outerRadius}function gn(l){return l.startAngle}function dn(l){return l.endAngle}function mn(l){return l&&l.padAngle}function pn(l,h,I,D,v,A,C,a){var O=I-l,i=D-h,n=C-v,d=a-A,u=d*O-n*i;if(!(u*u<y))return u=(n*(h-A)-d*(l-v))/u,[l+u*O,h+u*i]}function W(l,h,I,D,v,A,C){var a=l-I,O=h-D,i=(C?A:-A)/L(a*a+O*O),n=i*O,d=-i*a,u=l+n,s=h+d,f=I+n,c=D+d,F=(u+f)/2,t=(s+c)/2,m=f-u,g=c-s,R=m*m+g*g,T=v-A,P=u*c-f*s,S=(g<0?-1:1)*L(on(0,T*T*R-P*P)),j=(P*g-m*S)/R,z=(-P*m-g*S)/R,w=(P*g+m*S)/R,p=(-P*m+g*S)/R,x=j-F,e=z-t,r=w-F,G=p-t;return x*x+e*e>r*r+G*G&&(j=w,z=p),{cx:j,cy:z,x01:-n,y01:-d,x11:j*(v/T-1),y11:z*(v/T-1)}}function hn(){var l=cn,h=yn,I=B(0),D=null,v=gn,A=dn,C=mn,a=null,O=ln(i);function i(){var n,d,u=+l.apply(this,arguments),s=+h.apply(this,arguments),f=v.apply(this,arguments)-un,c=A.apply(this,arguments)-un,F=rn(c-f),t=c>f;if(a||(a=n=O()),s<u&&(d=s,s=u,u=d),!(s>y))a.moveTo(0,0);else if(F>tn-y)a.moveTo(s*H(f),s*q(f)),a.arc(0,0,s,f,c,!t),u>y&&(a.moveTo(u*H(c),u*q(c)),a.arc(0,0,u,c,f,t));else{var m=f,g=c,R=f,T=c,P=F,S=F,j=C.apply(this,arguments)/2,z=j>y&&(D?+D.apply(this,arguments):L(u*u+s*s)),w=_(rn(s-u)/2,+I.apply(this,arguments)),p=w,x=w,e,r;if(z>y){var G=sn(z/u*q(j)),M=sn(z/s*q(j));(P-=G*2)>y?(G*=t?1:-1,R+=G,T-=G):(P=0,R=T=(f+c)/2),(S-=M*2)>y?(M*=t?1:-1,m+=M,g-=M):(S=0,m=g=(f+c)/2)}var J=s*H(m),K=s*q(m),N=u*H(T),Q=u*q(T);if(w>y){var U=s*H(g),V=s*q(g),X=u*H(R),Y=u*q(R),E;if(F<an)if(E=pn(J,K,X,Y,U,V,N,Q)){var Z=J-E[0],$=K-E[1],b=U-E[0],k=V-E[1],nn=1/q(fn((Z*b+$*k)/(L(Z*Z+$*$)*L(b*b+k*k)))/2),en=L(E[0]*E[0]+E[1]*E[1]);p=_(w,(u-en)/(nn-1)),x=_(w,(s-en)/(nn+1))}else p=x=0}S>y?x>y?(e=W(X,Y,J,K,s,x,t),r=W(U,V,N,Q,s,x,t),a.moveTo(e.cx+e.x01,e.cy+e.y01),x<w?a.arc(e.cx,e.cy,x,o(e.y01,e.x01),o(r.y01,r.x01),!t):(a.arc(e.cx,e.cy,x,o(e.y01,e.x01),o(e.y11,e.x11),!t),a.arc(0,0,s,o(e.cy+e.y11,e.cx+e.x11),o(r.cy+r.y11,r.cx+r.x11),!t),a.arc(r.cx,r.cy,x,o(r.y11,r.x11),o(r.y01,r.x01),!t))):(a.moveTo(J,K),a.arc(0,0,s,m,g,!t)):a.moveTo(J,K),!(u>y)||!(P>y)?a.lineTo(N,Q):p>y?(e=W(N,Q,U,V,u,-p,t),r=W(J,K,X,Y,u,-p,t),a.lineTo(e.cx+e.x01,e.cy+e.y01),p<w?a.arc(e.cx,e.cy,p,o(e.y01,e.x01),o(r.y01,r.x01),!t):(a.arc(e.cx,e.cy,p,o(e.y01,e.x01),o(e.y11,e.x11),!t),a.arc(0,0,u,o(e.cy+e.y11,e.cx+e.x11),o(r.cy+r.y11,r.cx+r.x11),t),a.arc(r.cx,r.cy,p,o(r.y11,r.x11),o(r.y01,r.x01),!t))):a.arc(0,0,u,T,R,t)}if(a.closePath(),n)return a=null,n+""||null}return i.centroid=function(){var n=(+l.apply(this,arguments)+ +h.apply(this,arguments))/2,d=(+v.apply(this,arguments)+ +A.apply(this,arguments))/2-an/2;return[H(d)*n,q(d)*n]},i.innerRadius=function(n){return arguments.length?(l=typeof n=="function"?n:B(+n),i):l},i.outerRadius=function(n){return arguments.length?(h=typeof n=="function"?n:B(+n),i):h},i.cornerRadius=function(n){return arguments.length?(I=typeof n=="function"?n:B(+n),i):I},i.padRadius=function(n){return arguments.length?(D=n==null?null:typeof n=="function"?n:B(+n),i):D},i.startAngle=function(n){return arguments.length?(v=typeof n=="function"?n:B(+n),i):v},i.endAngle=function(n){return arguments.length?(A=typeof n=="function"?n:B(+n),i):A},i.padAngle=function(n){return arguments.length?(C=typeof n=="function"?n:B(+n),i):C},i.context=function(n){return arguments.length?(a=n??null,i):a},i}export{hn as d};
1
+ import{a0 as ln,a1 as an,a2 as H,a3 as q,a4 as B,a5 as un,a6 as y,a7 as tn,a8 as L,a9 as _,aa as rn,ab as o,ac as sn,ad as on,ae as fn}from"./MarkdownContent-Bui6aG36.js";function cn(l){return l.innerRadius}function yn(l){return l.outerRadius}function gn(l){return l.startAngle}function dn(l){return l.endAngle}function mn(l){return l&&l.padAngle}function pn(l,h,I,D,v,A,C,a){var O=I-l,i=D-h,n=C-v,d=a-A,u=d*O-n*i;if(!(u*u<y))return u=(n*(h-A)-d*(l-v))/u,[l+u*O,h+u*i]}function W(l,h,I,D,v,A,C){var a=l-I,O=h-D,i=(C?A:-A)/L(a*a+O*O),n=i*O,d=-i*a,u=l+n,s=h+d,f=I+n,c=D+d,F=(u+f)/2,t=(s+c)/2,m=f-u,g=c-s,R=m*m+g*g,T=v-A,P=u*c-f*s,S=(g<0?-1:1)*L(on(0,T*T*R-P*P)),j=(P*g-m*S)/R,z=(-P*m-g*S)/R,w=(P*g+m*S)/R,p=(-P*m+g*S)/R,x=j-F,e=z-t,r=w-F,G=p-t;return x*x+e*e>r*r+G*G&&(j=w,z=p),{cx:j,cy:z,x01:-n,y01:-d,x11:j*(v/T-1),y11:z*(v/T-1)}}function hn(){var l=cn,h=yn,I=B(0),D=null,v=gn,A=dn,C=mn,a=null,O=ln(i);function i(){var n,d,u=+l.apply(this,arguments),s=+h.apply(this,arguments),f=v.apply(this,arguments)-un,c=A.apply(this,arguments)-un,F=rn(c-f),t=c>f;if(a||(a=n=O()),s<u&&(d=s,s=u,u=d),!(s>y))a.moveTo(0,0);else if(F>tn-y)a.moveTo(s*H(f),s*q(f)),a.arc(0,0,s,f,c,!t),u>y&&(a.moveTo(u*H(c),u*q(c)),a.arc(0,0,u,c,f,t));else{var m=f,g=c,R=f,T=c,P=F,S=F,j=C.apply(this,arguments)/2,z=j>y&&(D?+D.apply(this,arguments):L(u*u+s*s)),w=_(rn(s-u)/2,+I.apply(this,arguments)),p=w,x=w,e,r;if(z>y){var G=sn(z/u*q(j)),M=sn(z/s*q(j));(P-=G*2)>y?(G*=t?1:-1,R+=G,T-=G):(P=0,R=T=(f+c)/2),(S-=M*2)>y?(M*=t?1:-1,m+=M,g-=M):(S=0,m=g=(f+c)/2)}var J=s*H(m),K=s*q(m),N=u*H(T),Q=u*q(T);if(w>y){var U=s*H(g),V=s*q(g),X=u*H(R),Y=u*q(R),E;if(F<an)if(E=pn(J,K,X,Y,U,V,N,Q)){var Z=J-E[0],$=K-E[1],b=U-E[0],k=V-E[1],nn=1/q(fn((Z*b+$*k)/(L(Z*Z+$*$)*L(b*b+k*k)))/2),en=L(E[0]*E[0]+E[1]*E[1]);p=_(w,(u-en)/(nn-1)),x=_(w,(s-en)/(nn+1))}else p=x=0}S>y?x>y?(e=W(X,Y,J,K,s,x,t),r=W(U,V,N,Q,s,x,t),a.moveTo(e.cx+e.x01,e.cy+e.y01),x<w?a.arc(e.cx,e.cy,x,o(e.y01,e.x01),o(r.y01,r.x01),!t):(a.arc(e.cx,e.cy,x,o(e.y01,e.x01),o(e.y11,e.x11),!t),a.arc(0,0,s,o(e.cy+e.y11,e.cx+e.x11),o(r.cy+r.y11,r.cx+r.x11),!t),a.arc(r.cx,r.cy,x,o(r.y11,r.x11),o(r.y01,r.x01),!t))):(a.moveTo(J,K),a.arc(0,0,s,m,g,!t)):a.moveTo(J,K),!(u>y)||!(P>y)?a.lineTo(N,Q):p>y?(e=W(N,Q,U,V,u,-p,t),r=W(J,K,X,Y,u,-p,t),a.lineTo(e.cx+e.x01,e.cy+e.y01),p<w?a.arc(e.cx,e.cy,p,o(e.y01,e.x01),o(r.y01,r.x01),!t):(a.arc(e.cx,e.cy,p,o(e.y01,e.x01),o(e.y11,e.x11),!t),a.arc(0,0,u,o(e.cy+e.y11,e.cx+e.x11),o(r.cy+r.y11,r.cx+r.x11),t),a.arc(r.cx,r.cy,p,o(r.y11,r.x11),o(r.y01,r.x01),!t))):a.arc(0,0,u,T,R,t)}if(a.closePath(),n)return a=null,n+""||null}return i.centroid=function(){var n=(+l.apply(this,arguments)+ +h.apply(this,arguments))/2,d=(+v.apply(this,arguments)+ +A.apply(this,arguments))/2-an/2;return[H(d)*n,q(d)*n]},i.innerRadius=function(n){return arguments.length?(l=typeof n=="function"?n:B(+n),i):l},i.outerRadius=function(n){return arguments.length?(h=typeof n=="function"?n:B(+n),i):h},i.cornerRadius=function(n){return arguments.length?(I=typeof n=="function"?n:B(+n),i):I},i.padRadius=function(n){return arguments.length?(D=n==null?null:typeof n=="function"?n:B(+n),i):D},i.startAngle=function(n){return arguments.length?(v=typeof n=="function"?n:B(+n),i):v},i.endAngle=function(n){return arguments.length?(A=typeof n=="function"?n:B(+n),i):A},i.padAngle=function(n){return arguments.length?(C=typeof n=="function"?n:B(+n),i):C},i.context=function(n){return arguments.length?(a=n??null,i):a},i}export{hn as d};