tide-commander 1.182.0 → 1.183.0

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 (119) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/dist/assets/{AudioPlayer-BwhOjJ2c.js → AudioPlayer-DntjtmFY.js} +1 -1
  3. package/dist/assets/{BossLogsModal-DAHZQ1pi.js → BossLogsModal-DG0qGyyQ.js} +1 -1
  4. package/dist/assets/{BossSpawnModal-E7SGuXA2.js → BossSpawnModal-BE3fqrEQ.js} +1 -1
  5. package/dist/assets/{ControlsModal-bAaYejMT.js → ControlsModal-BxUj2hcx.js} +1 -1
  6. package/dist/assets/{DockerLogsModal-BJx8N4kK.js → DockerLogsModal-DXXdFMWk.js} +1 -1
  7. package/dist/assets/{EmbeddedEditor-Be-cO4-9.js → EmbeddedEditor-DIfzYNe4.js} +1 -1
  8. package/dist/assets/FcStdViewer-CpbcvCQH.js +1 -0
  9. package/dist/assets/{GcodeViewer-ncf61wWb.js → GcodeViewer-GZKkHWus.js} +1 -1
  10. package/dist/assets/{GlbViewer-D12gmnGd.js → GlbViewer-CypOmYH4.js} +1 -1
  11. package/dist/assets/{GmailOAuthSetup-C-GvDGQm.js → GmailOAuthSetup-CWO65KoU.js} +1 -1
  12. package/dist/assets/{GoogleOAuthSetup-BDjIAgur.js → GoogleOAuthSetup-ouG98zZm.js} +1 -1
  13. package/dist/assets/{IframeModal-CCocGfa7.js → IframeModal-jC4LWAqj.js} +1 -1
  14. package/dist/assets/{IntegrationsPanel-CBpaeiJG.js → IntegrationsPanel-CFrTJ4yI.js} +2 -2
  15. package/dist/assets/{LogViewerModal-CaN7XU8z.js → LogViewerModal-BYGOn-UY.js} +1 -1
  16. package/dist/assets/{MonitoringModal-I3nCNlbU.js → MonitoringModal-ChTpAg5E.js} +1 -1
  17. package/dist/assets/{PM2LogsModal-Bki_LCvj.js → PM2LogsModal-C6ilFV5X.js} +1 -1
  18. package/dist/assets/{RestoreArchivedAreaModal-Ciy6t7et.js → RestoreArchivedAreaModal-20aGB6m1.js} +1 -1
  19. package/dist/assets/{Scene2DCanvas-DR56E5p7.js → Scene2DCanvas-B0JqO0Zp.js} +1 -1
  20. package/dist/assets/{SceneManager-DKg8ugY_.js → SceneManager-DXwGU3ni.js} +1 -1
  21. package/dist/assets/{SkillsPanel-C_dxzS6F.js → SkillsPanel-zL-QL8-4.js} +1 -1
  22. package/dist/assets/{SlackMultiInstanceSetup-BwiTMMvL.js → SlackMultiInstanceSetup-Cj4LKpWi.js} +1 -1
  23. package/dist/assets/{SpawnModal-DUMcIHoz.js → SpawnModal-Dccw_k2y.js} +1 -1
  24. package/dist/assets/{StatisticsModal-BKXcBthy.js → StatisticsModal-BbGUKCIz.js} +1 -1
  25. package/dist/assets/{StlViewer-DjdLvysP.js → StlViewer-BuS5d6ze.js} +1 -1
  26. package/dist/assets/{SubordinateAssignmentModal-Rl4cdHpe.js → SubordinateAssignmentModal-DpVxp2ta.js} +1 -1
  27. package/dist/assets/{ThreeAreaSelector-C-9JJ1Hh.js → ThreeAreaSelector-C7TNtwtl.js} +1 -1
  28. package/dist/assets/{ThreeViewShortcuts-DL0Hmuj0.js → ThreeViewShortcuts-D5ZfDVjp.js} +1 -1
  29. package/dist/assets/{TriggerManagerPanel-BtCOoX1g.js → TriggerManagerPanel-BrN4V9vK.js} +1 -1
  30. package/dist/assets/{VideoPlayer-BoTr9gkT.js → VideoPlayer-9wDovE5Z.js} +1 -1
  31. package/dist/assets/{WorkflowEditorPanel-DlcSaDPD.js → WorkflowEditorPanel-DvkV8Z4_.js} +1 -1
  32. package/dist/assets/{abnfDiagram-VRR7QNED-CEBRXYsw.js → abnfDiagram-VRR7QNED-Con3z51e.js} +1 -1
  33. package/dist/assets/{arc-COf9R405.js → arc-CWWQYHaK.js} +1 -1
  34. package/dist/assets/{architectureDiagram-ZJ3FMSHR-DGBRfu4B.js → architectureDiagram-ZJ3FMSHR-CrrniEMZ.js} +1 -1
  35. package/dist/assets/{area-logos-BRuKyQ5J.js → area-logos-F5U_sfIW.js} +1 -1
  36. package/dist/assets/{blockDiagram-677ZJIJ3-CN0t4U2k.js → blockDiagram-677ZJIJ3-MlV0Bx2X.js} +1 -1
  37. package/dist/assets/{c4Diagram-LMCZKHZV-Cq0IftW5.js → c4Diagram-LMCZKHZV-Bczl4ceN.js} +1 -1
  38. package/dist/assets/channel-DhJKhZOl.js +1 -0
  39. package/dist/assets/{chunk-2Q5K7J3B-adR2VoGA.js → chunk-2Q5K7J3B-uMf2zApa.js} +1 -1
  40. package/dist/assets/{chunk-32BRIVSS-B6LCChZq.js → chunk-32BRIVSS-YQLvcU-w.js} +1 -1
  41. package/dist/assets/{chunk-5VM5RSS4-CcH2c7y_.js → chunk-5VM5RSS4-Bv44lK_C.js} +1 -1
  42. package/dist/assets/{chunk-EX3LRPZG-zBWa-mu2.js → chunk-EX3LRPZG-BoWkmPlS.js} +1 -1
  43. package/dist/assets/{chunk-JWPE2WC7-DBQlYiWn.js → chunk-JWPE2WC7-B71OUFoy.js} +1 -1
  44. package/dist/assets/{chunk-MOJQB5TN-BjbsCplS.js → chunk-MOJQB5TN-DGpbFjEE.js} +1 -1
  45. package/dist/assets/{chunk-RYQCIY6F-B946ZxlN.js → chunk-RYQCIY6F-CUaqIbqz.js} +1 -1
  46. package/dist/assets/{chunk-V7JOEXUC-DEeYHnRT.js → chunk-V7JOEXUC-DoRxLReN.js} +1 -1
  47. package/dist/assets/{chunk-VR4S4FIN-B_QmrVGt.js → chunk-VR4S4FIN-B4AQrVEa.js} +1 -1
  48. package/dist/assets/{chunk-XXDRQBXY-cgYh6YrW.js → chunk-XXDRQBXY-DZVLCDKR.js} +1 -1
  49. package/dist/assets/classDiagram-OUVF2IWQ-F4DdT1bz.js +1 -0
  50. package/dist/assets/classDiagram-v2-EOCWNBFH-F4DdT1bz.js +1 -0
  51. package/dist/assets/{cose-bilkent-JH36ORCC-DJUmw0Ip.js → cose-bilkent-JH36ORCC-CcOIOt1P.js} +1 -1
  52. package/dist/assets/{cynefin-VYW2F7L2-BUxR220i.js → cynefin-VYW2F7L2-BwwhPetI.js} +1 -1
  53. package/dist/assets/{cynefinDiagram-TSTJHNR4-nYR1MwE2.js → cynefinDiagram-TSTJHNR4--V66_WT7.js} +1 -1
  54. package/dist/assets/{dagre-VKFMJZFB-A5VPim2l.js → dagre-VKFMJZFB-CQidxhQe.js} +1 -1
  55. package/dist/assets/{diagram-FQU43EPY-wdgwDoVg.js → diagram-FQU43EPY-gVCH6npm.js} +1 -1
  56. package/dist/assets/{diagram-G47NLZAW-CylyJQBQ.js → diagram-G47NLZAW-Crm2bCwK.js} +1 -1
  57. package/dist/assets/{diagram-NH7WQ7WH-BOF1uKhH.js → diagram-NH7WQ7WH-B5-91Me5.js} +1 -1
  58. package/dist/assets/{diagram-OA4YK3LP-B0B5zmh5.js → diagram-OA4YK3LP-BL92CL4n.js} +1 -1
  59. package/dist/assets/{diagram-WEI45ONY-vKP2IU9q.js → diagram-WEI45ONY-Ct4Y-e1G.js} +1 -1
  60. package/dist/assets/{ebnfDiagram-CCIWWBDH-DM8hIEJM.js → ebnfDiagram-CCIWWBDH-CgFnpcpk.js} +1 -1
  61. package/dist/assets/{erDiagram-Q63AITRT-iuRH3hWX.js → erDiagram-Q63AITRT-F93obfaw.js} +1 -1
  62. package/dist/assets/{fcstd.worker-BSFnALBZ.js → fcstd.worker-bs9ZyQJN.js} +17 -17
  63. package/dist/assets/{flowDiagram-23GEKE2U-CddCUoGB.js → flowDiagram-23GEKE2U-BjK3Ns-v.js} +1 -1
  64. package/dist/assets/{ganttDiagram-NO4QXBWP-CIfvQLcu.js → ganttDiagram-NO4QXBWP-Dhg1PlEG.js} +1 -1
  65. package/dist/assets/{gitGraphDiagram-IHSO6WYX-CbW0FQci.js → gitGraphDiagram-IHSO6WYX-BIvk5Sbm.js} +1 -1
  66. package/dist/assets/{index-DHuT10Pa.js → index-9tgJKfUx.js} +1 -1
  67. package/dist/assets/{index-BmD7ycmn.js → index-B4lIIYnl.js} +1 -1
  68. package/dist/assets/{index-CIcFjlRX.js → index-B8QkgKiD.js} +2 -2
  69. package/dist/assets/{index-CRhUiTuD.js → index-B9On-Gc2.js} +1 -1
  70. package/dist/assets/{index-B4YklnOy.js → index-BpuIdv2X.js} +1 -1
  71. package/dist/assets/{index-HhAZ3SIm.js → index-C-LSKhvC.js} +1 -1
  72. package/dist/assets/{index-Du8eK_OX.js → index-CGbeEcuO.js} +1 -1
  73. package/dist/assets/index-DT_iBBpR.js +19 -0
  74. package/dist/assets/{index-DoJdznbY.js → index-DyAtzN3k.js} +1 -1
  75. package/dist/assets/{infoDiagram-FWYZ7A6U-C0it9hLc.js → infoDiagram-FWYZ7A6U-D8y97kfq.js} +1 -1
  76. package/dist/assets/{ishikawaDiagram-FXEZZL3T-pKZnNgqp.js → ishikawaDiagram-FXEZZL3T-RsNvLRNJ.js} +1 -1
  77. package/dist/assets/{journeyDiagram-5HDEW3XC-Ib9FpXdB.js → journeyDiagram-5HDEW3XC-DDu6O4Xa.js} +1 -1
  78. package/dist/assets/{kanban-definition-HUTT4EX6-aOTfe6f6.js → kanban-definition-HUTT4EX6-BdyQRxVX.js} +1 -1
  79. package/dist/assets/{linear-B_ipWlyx.js → linear-CmFTyYvd.js} +1 -1
  80. package/dist/assets/main-CA-vQSSx.css +1 -0
  81. package/dist/assets/{main-m3NNcAo4.js → main-DXG9arLM.js} +143 -142
  82. package/dist/assets/{mermaid.core-EY9hyXLz.js → mermaid.core-Bt-11G2g.js} +4 -4
  83. package/dist/assets/{mindmap-definition-LN4V7U3C-B_p1LOAa.js → mindmap-definition-LN4V7U3C-SmMMV-FP.js} +1 -1
  84. package/dist/assets/{pegDiagram-2B236MQR-BgCd9rWg.js → pegDiagram-2B236MQR-CWwvj4kG.js} +1 -1
  85. package/dist/assets/{pieDiagram-ENE6RG2P-d8ofNooq.js → pieDiagram-ENE6RG2P-gBVnKXU2.js} +1 -1
  86. package/dist/assets/{quadrantDiagram-ABIIQ3AL-27DPJdZF.js → quadrantDiagram-ABIIQ3AL-DsI4SV_G.js} +1 -1
  87. package/dist/assets/{railroadDiagram-RFXS5EU6-C7S8pppU.js → railroadDiagram-RFXS5EU6-Xgn2AqX_.js} +1 -1
  88. package/dist/assets/{requirementDiagram-TGXJPOKE-BbTkDbLO.js → requirementDiagram-TGXJPOKE-CNJSWaII.js} +1 -1
  89. package/dist/assets/{sankeyDiagram-HTMAVEWB-lU57KWVw.js → sankeyDiagram-HTMAVEWB-7R-oTObT.js} +1 -1
  90. package/dist/assets/{sequenceDiagram-DBY2YBRQ-Bg18P0LT.js → sequenceDiagram-DBY2YBRQ-DAJ_SkXi.js} +1 -1
  91. package/dist/assets/{sizeCapture-X5ZJPWSS-FDhyxAiu.js → sizeCapture-X5ZJPWSS-dXg2Btjz.js} +1 -1
  92. package/dist/assets/{stateDiagram-2N3HPSRC-pp9KUH2d.js → stateDiagram-2N3HPSRC-QOa2unB0.js} +1 -1
  93. package/dist/assets/stateDiagram-v2-6OUMAXLB-BoRtqceU.js +1 -0
  94. package/dist/assets/{swimlanes-5IMT3BWC-BCUZKORl.js → swimlanes-5IMT3BWC-DpGkTD0b.js} +2 -2
  95. package/dist/assets/swimlanesDiagram-G3AALYLV-UzuviI8q.js +8 -0
  96. package/dist/assets/{timeline-definition-FHXFAJF6-BaeOwVlH.js → timeline-definition-FHXFAJF6-B3wYo6Z0.js} +1 -1
  97. package/dist/assets/{vennDiagram-L72KCM5P-BkhqU_hz.js → vennDiagram-L72KCM5P-DxRpcVln.js} +1 -1
  98. package/dist/assets/{wardleyDiagram-EHGQE667-DvPxIC6q.js → wardleyDiagram-EHGQE667-B-nj2Zec.js} +1 -1
  99. package/dist/assets/{web-DOiXCdVs.js → web-Bq407zt-.js} +1 -1
  100. package/dist/assets/{web-BhVPxATx.js → web-CZDCjMgt.js} +1 -1
  101. package/dist/assets/{web-CR-app3U.js → web-CaPWqQkM.js} +1 -1
  102. package/dist/assets/{xychartDiagram-FW5EYKEG-B9MrBAD_.js → xychartDiagram-FW5EYKEG-D2S19oqW.js} +1 -1
  103. package/dist/build-info.json +1 -1
  104. package/dist/index.html +2 -2
  105. package/dist/src/packages/server/app.js +9 -1
  106. package/dist/src/packages/server/index.js +9 -0
  107. package/dist/src/packages/server/routes/files.js +95 -2
  108. package/dist/src/packages/server/services/agent-service.js +9 -0
  109. package/dist/src/packages/server/services/instruction-refresh.js +40 -0
  110. package/dist/src/packages/server/websocket/handlers/sync-handler.js +21 -1
  111. package/package.json +1 -1
  112. package/dist/assets/FcStdViewer-DEwQ08Bb.js +0 -1
  113. package/dist/assets/channel-DF_pUJhw.js +0 -1
  114. package/dist/assets/classDiagram-OUVF2IWQ-CeYNs9YM.js +0 -1
  115. package/dist/assets/classDiagram-v2-EOCWNBFH-CeYNs9YM.js +0 -1
  116. package/dist/assets/index-HYcYan1q.js +0 -19
  117. package/dist/assets/main-Bvn8CMZc.css +0 -1
  118. package/dist/assets/stateDiagram-v2-6OUMAXLB-BmoS7QDQ.js +0 -1
  119. package/dist/assets/swimlanesDiagram-G3AALYLV-Da6QbdiL.js +0 -8
@@ -1,4 +1,4 @@
1
- import{g as Xt}from"./chunk-5VM5RSS4-CcH2c7y_.js";import{g as Qt}from"./chunk-XXDRQBXY-cgYh6YrW.js";import{s as Zt}from"./chunk-VR4S4FIN-B_QmrVGt.js";import{_ as m,b6 as Jt,X as Mt,l as Z,c as g1,v as $t,x as te,y as rt,b as ee,s as se,o as ie,a as re,g as ae,p as ne,k as ue,Y as le,Z as oe,bo as ce,r as st,d as it,a5 as he,q as de,b8 as pe,t as fe}from"./mermaid.core-EY9hyXLz.js";import{f as ge}from"./chunk-32BRIVSS-B6LCChZq.js";import{c as be}from"./channel-DF_pUJhw.js";var Ae="flowchart-",G1,ke=(G1=class{constructor(){this.vertexCounter=0,this.config=g1(),this.diagramId="",this.vertices=new Map,this.edges=[],this.classes=new Map,this.subGraphs=[],this.subGraphLookup=new Map,this.tooltips=new Map,this.subCount=0,this.firstGraphFlag=!0,this.secCount=-1,this.posCrossRef=[],this.funs=[],this.setAccTitle=ee,this.setAccDescription=se,this.setDiagramTitle=ie,this.getAccTitle=re,this.getAccDescription=ae,this.getDiagramTitle=ne,this.funs.push(this.setupToolTips.bind(this)),this.addVertex=this.addVertex.bind(this),this.firstGraph=this.firstGraph.bind(this),this.setDirection=this.setDirection.bind(this),this.addSubGraph=this.addSubGraph.bind(this),this.addLink=this.addLink.bind(this),this.setLink=this.setLink.bind(this),this.updateLink=this.updateLink.bind(this),this.addClass=this.addClass.bind(this),this.setClass=this.setClass.bind(this),this.destructLink=this.destructLink.bind(this),this.setClickEvent=this.setClickEvent.bind(this),this.setTooltip=this.setTooltip.bind(this),this.updateLinkInterpolate=this.updateLinkInterpolate.bind(this),this.setClickFun=this.setClickFun.bind(this),this.bindFunctions=this.bindFunctions.bind(this),this.lex={firstGraph:this.firstGraph.bind(this)},this.clear(),this.setGen("gen-2")}sanitizeText(i){return ue.sanitizeText(i,this.config)}sanitizeNodeLabelType(i){switch(i){case"markdown":case"string":case"text":return i;default:return"markdown"}}setDiagramId(i){this.diagramId=i}lookUpDomId(i){for(const a of this.vertices.values())if(a.id===i)return this.diagramId?`${this.diagramId}-${a.domId}`:a.domId;return this.diagramId?`${this.diagramId}-${i}`:i}addVertex(i,a,n,u,o,h,c={},g){var L,y;if(!i||i.trim().length===0)return;let r;if(g!==void 0){let f;g.includes(`
1
+ import{g as Xt}from"./chunk-5VM5RSS4-Bv44lK_C.js";import{g as Qt}from"./chunk-XXDRQBXY-DZVLCDKR.js";import{s as Zt}from"./chunk-VR4S4FIN-B4AQrVEa.js";import{_ as m,b6 as Jt,X as Mt,l as Z,c as g1,v as $t,x as te,y as rt,b as ee,s as se,o as ie,a as re,g as ae,p as ne,k as ue,Y as le,Z as oe,bo as ce,r as st,d as it,a5 as he,q as de,b8 as pe,t as fe}from"./mermaid.core-Bt-11G2g.js";import{f as ge}from"./chunk-32BRIVSS-YQLvcU-w.js";import{c as be}from"./channel-DhJKhZOl.js";var Ae="flowchart-",G1,ke=(G1=class{constructor(){this.vertexCounter=0,this.config=g1(),this.diagramId="",this.vertices=new Map,this.edges=[],this.classes=new Map,this.subGraphs=[],this.subGraphLookup=new Map,this.tooltips=new Map,this.subCount=0,this.firstGraphFlag=!0,this.secCount=-1,this.posCrossRef=[],this.funs=[],this.setAccTitle=ee,this.setAccDescription=se,this.setDiagramTitle=ie,this.getAccTitle=re,this.getAccDescription=ae,this.getDiagramTitle=ne,this.funs.push(this.setupToolTips.bind(this)),this.addVertex=this.addVertex.bind(this),this.firstGraph=this.firstGraph.bind(this),this.setDirection=this.setDirection.bind(this),this.addSubGraph=this.addSubGraph.bind(this),this.addLink=this.addLink.bind(this),this.setLink=this.setLink.bind(this),this.updateLink=this.updateLink.bind(this),this.addClass=this.addClass.bind(this),this.setClass=this.setClass.bind(this),this.destructLink=this.destructLink.bind(this),this.setClickEvent=this.setClickEvent.bind(this),this.setTooltip=this.setTooltip.bind(this),this.updateLinkInterpolate=this.updateLinkInterpolate.bind(this),this.setClickFun=this.setClickFun.bind(this),this.bindFunctions=this.bindFunctions.bind(this),this.lex={firstGraph:this.firstGraph.bind(this)},this.clear(),this.setGen("gen-2")}sanitizeText(i){return ue.sanitizeText(i,this.config)}sanitizeNodeLabelType(i){switch(i){case"markdown":case"string":case"text":return i;default:return"markdown"}}setDiagramId(i){this.diagramId=i}lookUpDomId(i){for(const a of this.vertices.values())if(a.id===i)return this.diagramId?`${this.diagramId}-${a.domId}`:a.domId;return this.diagramId?`${this.diagramId}-${i}`:i}addVertex(i,a,n,u,o,h,c={},g){var L,y;if(!i||i.trim().length===0)return;let r;if(g!==void 0){let f;g.includes(`
2
2
  `)?f=g+`
3
3
  `:f=`{
4
4
  `+g+`
@@ -1,4 +1,4 @@
1
- import{bg as on,bh as On,bi as cn,bj as un,bk as ln,bl as ue,bm as Hn,g as Nn,s as Pn,p as Vn,o as Rn,a as zn,b as qn,_ as d,c as Yt,d as Zt,e as Bn,bn as it,l as Tt,k as Zn,j as Xn,q as Gn,y as jn}from"./mermaid.core-EY9hyXLz.js";import{g as oe}from"./vendor-react--Eh9ivFN.js";import{b as Qn,t as Ne,c as Jn,a as Kn,l as tr}from"./linear-B_ipWlyx.js";import{i as er}from"./init-Gi6I4Gst.js";import"./main-m3NNcAo4.js";import"./vendor-three-CBPuP1jE.js";import"./defaultLocale-DX6XiGOO.js";function nr(t,e){let n;if(e===void 0)for(const r of t)r!=null&&(n<r||n===void 0&&r>=r)&&(n=r);else{let r=-1;for(let i of t)(i=e(i,++r,t))!=null&&(n<i||n===void 0&&i>=i)&&(n=i)}return n}function rr(t,e){let n;if(e===void 0)for(const r of t)r!=null&&(n>r||n===void 0&&r>=r)&&(n=r);else{let r=-1;for(let i of t)(i=e(i,++r,t))!=null&&(n>i||n===void 0&&i>=i)&&(n=i)}return n}function ir(t){return t}var Gt=1,le=2,xe=3,Xt=4,Pe=1e-6;function sr(t){return"translate("+t+",0)"}function ar(t){return"translate(0,"+t+")"}function or(t){return e=>+t(e)}function cr(t,e){return e=Math.max(0,t.bandwidth()-e*2)/2,t.round()&&(e=Math.round(e)),n=>+t(n)+e}function ur(){return!this.__axis}function fn(t,e){var n=[],r=null,i=null,s=6,a=6,y=3,F=typeof window<"u"&&window.devicePixelRatio>1?0:.5,S=t===Gt||t===Xt?-1:1,w=t===Xt||t===le?"x":"y",P=t===Gt||t===xe?sr:ar;function _(Y){var X=r??(e.ticks?e.ticks.apply(e,n):e.domain()),B=i??(e.tickFormat?e.tickFormat.apply(e,n):ir),v=Math.max(s,0)+y,U=e.range(),R=+U[0]+F,E=+U[U.length-1]+F,z=(e.bandwidth?cr:or)(e.copy(),F),G=Y.selection?Y.selection():Y,T=G.selectAll(".domain").data([null]),k=G.selectAll(".tick").data(X,e).order(),p=k.exit(),L=k.enter().append("g").attr("class","tick"),x=k.select("line"),C=k.select("text");T=T.merge(T.enter().insert("path",".tick").attr("class","domain").attr("stroke","currentColor")),k=k.merge(L),x=x.merge(L.append("line").attr("stroke","currentColor").attr(w+"2",S*s)),C=C.merge(L.append("text").attr("fill","currentColor").attr(w,S*v).attr("dy",t===Gt?"0em":t===xe?"0.71em":"0.32em")),Y!==G&&(T=T.transition(Y),k=k.transition(Y),x=x.transition(Y),C=C.transition(Y),p=p.transition(Y).attr("opacity",Pe).attr("transform",function(M){return isFinite(M=z(M))?P(M+F):this.getAttribute("transform")}),L.attr("opacity",Pe).attr("transform",function(M){var D=this.parentNode.__axis;return P((D&&isFinite(D=D(M))?D:z(M))+F)})),p.remove(),T.attr("d",t===Xt||t===le?a?"M"+S*a+","+R+"H"+F+"V"+E+"H"+S*a:"M"+F+","+R+"V"+E:a?"M"+R+","+S*a+"V"+F+"H"+E+"V"+S*a:"M"+R+","+F+"H"+E),k.attr("opacity",1).attr("transform",function(M){return P(z(M)+F)}),x.attr(w+"2",S*s),C.attr(w,S*v).text(B),G.filter(ur).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",t===le?"start":t===Xt?"end":"middle"),G.each(function(){this.__axis=z})}return _.scale=function(Y){return arguments.length?(e=Y,_):e},_.ticks=function(){return n=Array.from(arguments),_},_.tickArguments=function(Y){return arguments.length?(n=Y==null?[]:Array.from(Y),_):n.slice()},_.tickValues=function(Y){return arguments.length?(r=Y==null?null:Array.from(Y),_):r&&r.slice()},_.tickFormat=function(Y){return arguments.length?(i=Y,_):i},_.tickSize=function(Y){return arguments.length?(s=a=+Y,_):s},_.tickSizeInner=function(Y){return arguments.length?(s=+Y,_):s},_.tickSizeOuter=function(Y){return arguments.length?(a=+Y,_):a},_.tickPadding=function(Y){return arguments.length?(y=+Y,_):y},_.offset=function(Y){return arguments.length?(F=+Y,_):F},_}function lr(t){return fn(Gt,t)}function fr(t){return fn(xe,t)}const dr=Math.PI/180,hr=180/Math.PI,ne=18,dn=.96422,hn=1,mn=.82521,gn=4/29,Ft=6/29,yn=3*Ft*Ft,mr=Ft*Ft*Ft;function kn(t){if(t instanceof ft)return new ft(t.l,t.a,t.b,t.opacity);if(t instanceof ht)return pn(t);t instanceof on||(t=On(t));var e=me(t.r),n=me(t.g),r=me(t.b),i=fe((.2225045*e+.7168786*n+.0606169*r)/hn),s,a;return e===n&&n===r?s=a=i:(s=fe((.4360747*e+.3850649*n+.1430804*r)/dn),a=fe((.0139322*e+.0971045*n+.7141733*r)/mn)),new ft(116*i-16,500*(s-i),200*(i-a),t.opacity)}function gr(t,e,n,r){return arguments.length===1?kn(t):new ft(t,e,n,r??1)}function ft(t,e,n,r){this.l=+t,this.a=+e,this.b=+n,this.opacity=+r}cn(ft,gr,un(ln,{brighter(t){return new ft(this.l+ne*(t??1),this.a,this.b,this.opacity)},darker(t){return new ft(this.l-ne*(t??1),this.a,this.b,this.opacity)},rgb(){var t=(this.l+16)/116,e=isNaN(this.a)?t:t+this.a/500,n=isNaN(this.b)?t:t-this.b/200;return e=dn*de(e),t=hn*de(t),n=mn*de(n),new on(he(3.1338561*e-1.6168667*t-.4906146*n),he(-.9787684*e+1.9161415*t+.033454*n),he(.0719453*e-.2289914*t+1.4052427*n),this.opacity)}}));function fe(t){return t>mr?Math.pow(t,1/3):t/yn+gn}function de(t){return t>Ft?t*t*t:yn*(t-gn)}function he(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function me(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function yr(t){if(t instanceof ht)return new ht(t.h,t.c,t.l,t.opacity);if(t instanceof ft||(t=kn(t)),t.a===0&&t.b===0)return new ht(NaN,0<t.l&&t.l<100?0:NaN,t.l,t.opacity);var e=Math.atan2(t.b,t.a)*hr;return new ht(e<0?e+360:e,Math.sqrt(t.a*t.a+t.b*t.b),t.l,t.opacity)}function be(t,e,n,r){return arguments.length===1?yr(t):new ht(t,e,n,r??1)}function ht(t,e,n,r){this.h=+t,this.c=+e,this.l=+n,this.opacity=+r}function pn(t){if(isNaN(t.h))return new ft(t.l,0,0,t.opacity);var e=t.h*dr;return new ft(t.l,Math.cos(e)*t.c,Math.sin(e)*t.c,t.opacity)}cn(ht,be,un(ln,{brighter(t){return new ht(this.h,this.c,this.l+ne*(t??1),this.opacity)},darker(t){return new ht(this.h,this.c,this.l-ne*(t??1),this.opacity)},rgb(){return pn(this).rgb()}}));function kr(t){return function(e,n){var r=t((e=be(e)).h,(n=be(n)).h),i=ue(e.c,n.c),s=ue(e.l,n.l),a=ue(e.opacity,n.opacity);return function(y){return e.h=r(y),e.c=i(y),e.l=s(y),e.opacity=a(y),e+""}}}const pr=kr(Hn);function vr(t,e){t=t.slice();var n=0,r=t.length-1,i=t[n],s=t[r],a;return s<i&&(a=n,n=r,r=a,a=i,i=s,s=a),t[n]=e.floor(i),t[r]=e.ceil(s),t}const ge=new Date,ye=new Date;function nt(t,e,n,r){function i(s){return t(s=arguments.length===0?new Date:new Date(+s)),s}return i.floor=s=>(t(s=new Date(+s)),s),i.ceil=s=>(t(s=new Date(s-1)),e(s,1),t(s),s),i.round=s=>{const a=i(s),y=i.ceil(s);return s-a<y-s?a:y},i.offset=(s,a)=>(e(s=new Date(+s),a==null?1:Math.floor(a)),s),i.range=(s,a,y)=>{const F=[];if(s=i.ceil(s),y=y==null?1:Math.floor(y),!(s<a)||!(y>0))return F;let S;do F.push(S=new Date(+s)),e(s,y),t(s);while(S<s&&s<a);return F},i.filter=s=>nt(a=>{if(a>=a)for(;t(a),!s(a);)a.setTime(a-1)},(a,y)=>{if(a>=a)if(y<0)for(;++y<=0;)for(;e(a,-1),!s(a););else for(;--y>=0;)for(;e(a,1),!s(a););}),n&&(i.count=(s,a)=>(ge.setTime(+s),ye.setTime(+a),t(ge),t(ye),Math.floor(n(ge,ye))),i.every=s=>(s=Math.floor(s),!isFinite(s)||!(s>0)?null:s>1?i.filter(r?a=>r(a)%s===0:a=>i.count(0,a)%s===0):i)),i}const Et=nt(()=>{},(t,e)=>{t.setTime(+t+e)},(t,e)=>e-t);Et.every=t=>(t=Math.floor(t),!isFinite(t)||!(t>0)?null:t>1?nt(e=>{e.setTime(Math.floor(e/t)*t)},(e,n)=>{e.setTime(+e+n*t)},(e,n)=>(n-e)/t):Et);Et.range;const mt=1e3,ct=mt*60,gt=ct*60,yt=gt*24,Se=yt*7,Ve=yt*30,ke=yt*365,vt=nt(t=>{t.setTime(t-t.getMilliseconds())},(t,e)=>{t.setTime(+t+e*mt)},(t,e)=>(e-t)/mt,t=>t.getUTCSeconds());vt.range;const Nt=nt(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*mt)},(t,e)=>{t.setTime(+t+e*ct)},(t,e)=>(e-t)/ct,t=>t.getMinutes());Nt.range;const Tr=nt(t=>{t.setUTCSeconds(0,0)},(t,e)=>{t.setTime(+t+e*ct)},(t,e)=>(e-t)/ct,t=>t.getUTCMinutes());Tr.range;const Pt=nt(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*mt-t.getMinutes()*ct)},(t,e)=>{t.setTime(+t+e*gt)},(t,e)=>(e-t)/gt,t=>t.getHours());Pt.range;const xr=nt(t=>{t.setUTCMinutes(0,0,0)},(t,e)=>{t.setTime(+t+e*gt)},(t,e)=>(e-t)/gt,t=>t.getUTCHours());xr.range;const xt=nt(t=>t.setHours(0,0,0,0),(t,e)=>t.setDate(t.getDate()+e),(t,e)=>(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*ct)/yt,t=>t.getDate()-1);xt.range;const _e=nt(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/yt,t=>t.getUTCDate()-1);_e.range;const br=nt(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/yt,t=>Math.floor(t/yt));br.range;function Dt(t){return nt(e=>{e.setDate(e.getDate()-(e.getDay()+7-t)%7),e.setHours(0,0,0,0)},(e,n)=>{e.setDate(e.getDate()+n*7)},(e,n)=>(n-e-(n.getTimezoneOffset()-e.getTimezoneOffset())*ct)/Se)}const zt=Dt(0),Vt=Dt(1),vn=Dt(2),Tn=Dt(3),bt=Dt(4),xn=Dt(5),bn=Dt(6);zt.range;Vt.range;vn.range;Tn.range;bt.range;xn.range;bn.range;function Mt(t){return nt(e=>{e.setUTCDate(e.getUTCDate()-(e.getUTCDay()+7-t)%7),e.setUTCHours(0,0,0,0)},(e,n)=>{e.setUTCDate(e.getUTCDate()+n*7)},(e,n)=>(n-e)/Se)}const wn=Mt(0),re=Mt(1),wr=Mt(2),Dr=Mt(3),It=Mt(4),Mr=Mt(5),Cr=Mt(6);wn.range;re.range;wr.range;Dr.range;It.range;Mr.range;Cr.range;const Rt=nt(t=>{t.setDate(1),t.setHours(0,0,0,0)},(t,e)=>{t.setMonth(t.getMonth()+e)},(t,e)=>e.getMonth()-t.getMonth()+(e.getFullYear()-t.getFullYear())*12,t=>t.getMonth());Rt.range;const Sr=nt(t=>{t.setUTCDate(1),t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCMonth(t.getUTCMonth()+e)},(t,e)=>e.getUTCMonth()-t.getUTCMonth()+(e.getUTCFullYear()-t.getUTCFullYear())*12,t=>t.getUTCMonth());Sr.range;const kt=nt(t=>{t.setMonth(0,1),t.setHours(0,0,0,0)},(t,e)=>{t.setFullYear(t.getFullYear()+e)},(t,e)=>e.getFullYear()-t.getFullYear(),t=>t.getFullYear());kt.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:nt(e=>{e.setFullYear(Math.floor(e.getFullYear()/t)*t),e.setMonth(0,1),e.setHours(0,0,0,0)},(e,n)=>{e.setFullYear(e.getFullYear()+n*t)});kt.range;const wt=nt(t=>{t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCFullYear(t.getUTCFullYear()+e)},(t,e)=>e.getUTCFullYear()-t.getUTCFullYear(),t=>t.getUTCFullYear());wt.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:nt(e=>{e.setUTCFullYear(Math.floor(e.getUTCFullYear()/t)*t),e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,n)=>{e.setUTCFullYear(e.getUTCFullYear()+n*t)});wt.range;function _r(t,e,n,r,i,s){const a=[[vt,1,mt],[vt,5,5*mt],[vt,15,15*mt],[vt,30,30*mt],[s,1,ct],[s,5,5*ct],[s,15,15*ct],[s,30,30*ct],[i,1,gt],[i,3,3*gt],[i,6,6*gt],[i,12,12*gt],[r,1,yt],[r,2,2*yt],[n,1,Se],[e,1,Ve],[e,3,3*Ve],[t,1,ke]];function y(S,w,P){const _=w<S;_&&([S,w]=[w,S]);const Y=P&&typeof P.range=="function"?P:F(S,w,P),X=Y?Y.range(S,+w+1):[];return _?X.reverse():X}function F(S,w,P){const _=Math.abs(w-S)/P,Y=Qn(([,,v])=>v).right(a,_);if(Y===a.length)return t.every(Ne(S/ke,w/ke,P));if(Y===0)return Et.every(Math.max(Ne(S,w,P),1));const[X,B]=a[_/a[Y-1][2]<a[Y][2]/_?Y-1:Y];return X.every(B)}return[y,F]}const[Yr,Fr]=_r(kt,Rt,zt,xt,Pt,Nt);function pe(t){if(0<=t.y&&t.y<100){var e=new Date(-1,t.m,t.d,t.H,t.M,t.S,t.L);return e.setFullYear(t.y),e}return new Date(t.y,t.m,t.d,t.H,t.M,t.S,t.L)}function ve(t){if(0<=t.y&&t.y<100){var e=new Date(Date.UTC(-1,t.m,t.d,t.H,t.M,t.S,t.L));return e.setUTCFullYear(t.y),e}return new Date(Date.UTC(t.y,t.m,t.d,t.H,t.M,t.S,t.L))}function $t(t,e,n){return{y:t,m:e,d:n,H:0,M:0,S:0,L:0}}function Ur(t){var e=t.dateTime,n=t.date,r=t.time,i=t.periods,s=t.days,a=t.shortDays,y=t.months,F=t.shortMonths,S=Ot(i),w=Ht(i),P=Ot(s),_=Ht(s),Y=Ot(a),X=Ht(a),B=Ot(y),v=Ht(y),U=Ot(F),R=Ht(F),E={a:m,A:I,b:o,B:W,c:null,d:Xe,e:Xe,f:ti,g:li,G:di,H:Qr,I:Jr,j:Kr,L:Dn,m:ei,M:ni,p:u,q:K,Q:Qe,s:Je,S:ri,u:ii,U:si,V:ai,w:oi,W:ci,x:null,X:null,y:ui,Y:fi,Z:hi,"%":je},z={a:l,A:$,b:O,B:j,c:null,d:Ge,e:Ge,f:ki,g:Si,G:Yi,H:mi,I:gi,j:yi,L:Cn,m:pi,M:vi,p:H,q:J,Q:Qe,s:Je,S:Ti,u:xi,U:bi,V:wi,w:Di,W:Mi,x:null,X:null,y:Ci,Y:_i,Z:Fi,"%":je},G={a:x,A:C,b:M,B:D,c,d:Be,e:Be,f:Zr,g:qe,G:ze,H:Ze,I:Ze,j:Rr,L:Br,m:Vr,M:zr,p:L,q:Pr,Q:Gr,s:jr,S:qr,u:Wr,U:$r,V:Or,w:Ar,W:Hr,x:g,X:b,y:qe,Y:ze,Z:Nr,"%":Xr};E.x=T(n,E),E.X=T(r,E),E.c=T(e,E),z.x=T(n,z),z.X=T(r,z),z.c=T(e,z);function T(h,N){return function(V){var f=[],tt=-1,A=0,Q=h.length,Z,st,at;for(V instanceof Date||(V=new Date(+V));++tt<Q;)h.charCodeAt(tt)===37&&(f.push(h.slice(A,tt)),(st=Re[Z=h.charAt(++tt)])!=null?Z=h.charAt(++tt):st=Z==="e"?" ":"0",(at=N[Z])&&(Z=at(V,st)),f.push(Z),A=tt+1);return f.push(h.slice(A,tt)),f.join("")}}function k(h,N){return function(V){var f=$t(1900,void 0,1),tt=p(f,h,V+="",0),A,Q;if(tt!=V.length)return null;if("Q"in f)return new Date(f.Q);if("s"in f)return new Date(f.s*1e3+("L"in f?f.L:0));if(N&&!("Z"in f)&&(f.Z=0),"p"in f&&(f.H=f.H%12+f.p*12),f.m===void 0&&(f.m="q"in f?f.q:0),"V"in f){if(f.V<1||f.V>53)return null;"w"in f||(f.w=1),"Z"in f?(A=ve($t(f.y,0,1)),Q=A.getUTCDay(),A=Q>4||Q===0?re.ceil(A):re(A),A=_e.offset(A,(f.V-1)*7),f.y=A.getUTCFullYear(),f.m=A.getUTCMonth(),f.d=A.getUTCDate()+(f.w+6)%7):(A=pe($t(f.y,0,1)),Q=A.getDay(),A=Q>4||Q===0?Vt.ceil(A):Vt(A),A=xt.offset(A,(f.V-1)*7),f.y=A.getFullYear(),f.m=A.getMonth(),f.d=A.getDate()+(f.w+6)%7)}else("W"in f||"U"in f)&&("w"in f||(f.w="u"in f?f.u%7:"W"in f?1:0),Q="Z"in f?ve($t(f.y,0,1)).getUTCDay():pe($t(f.y,0,1)).getDay(),f.m=0,f.d="W"in f?(f.w+6)%7+f.W*7-(Q+5)%7:f.w+f.U*7-(Q+6)%7);return"Z"in f?(f.H+=f.Z/100|0,f.M+=f.Z%100,ve(f)):pe(f)}}function p(h,N,V,f){for(var tt=0,A=N.length,Q=V.length,Z,st;tt<A;){if(f>=Q)return-1;if(Z=N.charCodeAt(tt++),Z===37){if(Z=N.charAt(tt++),st=G[Z in Re?N.charAt(tt++):Z],!st||(f=st(h,V,f))<0)return-1}else if(Z!=V.charCodeAt(f++))return-1}return f}function L(h,N,V){var f=S.exec(N.slice(V));return f?(h.p=w.get(f[0].toLowerCase()),V+f[0].length):-1}function x(h,N,V){var f=Y.exec(N.slice(V));return f?(h.w=X.get(f[0].toLowerCase()),V+f[0].length):-1}function C(h,N,V){var f=P.exec(N.slice(V));return f?(h.w=_.get(f[0].toLowerCase()),V+f[0].length):-1}function M(h,N,V){var f=U.exec(N.slice(V));return f?(h.m=R.get(f[0].toLowerCase()),V+f[0].length):-1}function D(h,N,V){var f=B.exec(N.slice(V));return f?(h.m=v.get(f[0].toLowerCase()),V+f[0].length):-1}function c(h,N,V){return p(h,e,N,V)}function g(h,N,V){return p(h,n,N,V)}function b(h,N,V){return p(h,r,N,V)}function m(h){return a[h.getDay()]}function I(h){return s[h.getDay()]}function o(h){return F[h.getMonth()]}function W(h){return y[h.getMonth()]}function u(h){return i[+(h.getHours()>=12)]}function K(h){return 1+~~(h.getMonth()/3)}function l(h){return a[h.getUTCDay()]}function $(h){return s[h.getUTCDay()]}function O(h){return F[h.getUTCMonth()]}function j(h){return y[h.getUTCMonth()]}function H(h){return i[+(h.getUTCHours()>=12)]}function J(h){return 1+~~(h.getUTCMonth()/3)}return{format:function(h){var N=T(h+="",E);return N.toString=function(){return h},N},parse:function(h){var N=k(h+="",!1);return N.toString=function(){return h},N},utcFormat:function(h){var N=T(h+="",z);return N.toString=function(){return h},N},utcParse:function(h){var N=k(h+="",!0);return N.toString=function(){return h},N}}}var Re={"-":"",_:" ",0:"0"},rt=/^\s*\d+/,Er=/^%/,Ir=/[\\^$*+?|[\]().{}]/g;function q(t,e,n){var r=t<0?"-":"",i=(r?-t:t)+"",s=i.length;return r+(s<n?new Array(n-s+1).join(e)+i:i)}function Lr(t){return t.replace(Ir,"\\$&")}function Ot(t){return new RegExp("^(?:"+t.map(Lr).join("|")+")","i")}function Ht(t){return new Map(t.map((e,n)=>[e.toLowerCase(),n]))}function Ar(t,e,n){var r=rt.exec(e.slice(n,n+1));return r?(t.w=+r[0],n+r[0].length):-1}function Wr(t,e,n){var r=rt.exec(e.slice(n,n+1));return r?(t.u=+r[0],n+r[0].length):-1}function $r(t,e,n){var r=rt.exec(e.slice(n,n+2));return r?(t.U=+r[0],n+r[0].length):-1}function Or(t,e,n){var r=rt.exec(e.slice(n,n+2));return r?(t.V=+r[0],n+r[0].length):-1}function Hr(t,e,n){var r=rt.exec(e.slice(n,n+2));return r?(t.W=+r[0],n+r[0].length):-1}function ze(t,e,n){var r=rt.exec(e.slice(n,n+4));return r?(t.y=+r[0],n+r[0].length):-1}function qe(t,e,n){var r=rt.exec(e.slice(n,n+2));return r?(t.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function Nr(t,e,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(e.slice(n,n+6));return r?(t.Z=r[1]?0:-(r[2]+(r[3]||"00")),n+r[0].length):-1}function Pr(t,e,n){var r=rt.exec(e.slice(n,n+1));return r?(t.q=r[0]*3-3,n+r[0].length):-1}function Vr(t,e,n){var r=rt.exec(e.slice(n,n+2));return r?(t.m=r[0]-1,n+r[0].length):-1}function Be(t,e,n){var r=rt.exec(e.slice(n,n+2));return r?(t.d=+r[0],n+r[0].length):-1}function Rr(t,e,n){var r=rt.exec(e.slice(n,n+3));return r?(t.m=0,t.d=+r[0],n+r[0].length):-1}function Ze(t,e,n){var r=rt.exec(e.slice(n,n+2));return r?(t.H=+r[0],n+r[0].length):-1}function zr(t,e,n){var r=rt.exec(e.slice(n,n+2));return r?(t.M=+r[0],n+r[0].length):-1}function qr(t,e,n){var r=rt.exec(e.slice(n,n+2));return r?(t.S=+r[0],n+r[0].length):-1}function Br(t,e,n){var r=rt.exec(e.slice(n,n+3));return r?(t.L=+r[0],n+r[0].length):-1}function Zr(t,e,n){var r=rt.exec(e.slice(n,n+6));return r?(t.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function Xr(t,e,n){var r=Er.exec(e.slice(n,n+1));return r?n+r[0].length:-1}function Gr(t,e,n){var r=rt.exec(e.slice(n));return r?(t.Q=+r[0],n+r[0].length):-1}function jr(t,e,n){var r=rt.exec(e.slice(n));return r?(t.s=+r[0],n+r[0].length):-1}function Xe(t,e){return q(t.getDate(),e,2)}function Qr(t,e){return q(t.getHours(),e,2)}function Jr(t,e){return q(t.getHours()%12||12,e,2)}function Kr(t,e){return q(1+xt.count(kt(t),t),e,3)}function Dn(t,e){return q(t.getMilliseconds(),e,3)}function ti(t,e){return Dn(t,e)+"000"}function ei(t,e){return q(t.getMonth()+1,e,2)}function ni(t,e){return q(t.getMinutes(),e,2)}function ri(t,e){return q(t.getSeconds(),e,2)}function ii(t){var e=t.getDay();return e===0?7:e}function si(t,e){return q(zt.count(kt(t)-1,t),e,2)}function Mn(t){var e=t.getDay();return e>=4||e===0?bt(t):bt.ceil(t)}function ai(t,e){return t=Mn(t),q(bt.count(kt(t),t)+(kt(t).getDay()===4),e,2)}function oi(t){return t.getDay()}function ci(t,e){return q(Vt.count(kt(t)-1,t),e,2)}function ui(t,e){return q(t.getFullYear()%100,e,2)}function li(t,e){return t=Mn(t),q(t.getFullYear()%100,e,2)}function fi(t,e){return q(t.getFullYear()%1e4,e,4)}function di(t,e){var n=t.getDay();return t=n>=4||n===0?bt(t):bt.ceil(t),q(t.getFullYear()%1e4,e,4)}function hi(t){var e=t.getTimezoneOffset();return(e>0?"-":(e*=-1,"+"))+q(e/60|0,"0",2)+q(e%60,"0",2)}function Ge(t,e){return q(t.getUTCDate(),e,2)}function mi(t,e){return q(t.getUTCHours(),e,2)}function gi(t,e){return q(t.getUTCHours()%12||12,e,2)}function yi(t,e){return q(1+_e.count(wt(t),t),e,3)}function Cn(t,e){return q(t.getUTCMilliseconds(),e,3)}function ki(t,e){return Cn(t,e)+"000"}function pi(t,e){return q(t.getUTCMonth()+1,e,2)}function vi(t,e){return q(t.getUTCMinutes(),e,2)}function Ti(t,e){return q(t.getUTCSeconds(),e,2)}function xi(t){var e=t.getUTCDay();return e===0?7:e}function bi(t,e){return q(wn.count(wt(t)-1,t),e,2)}function Sn(t){var e=t.getUTCDay();return e>=4||e===0?It(t):It.ceil(t)}function wi(t,e){return t=Sn(t),q(It.count(wt(t),t)+(wt(t).getUTCDay()===4),e,2)}function Di(t){return t.getUTCDay()}function Mi(t,e){return q(re.count(wt(t)-1,t),e,2)}function Ci(t,e){return q(t.getUTCFullYear()%100,e,2)}function Si(t,e){return t=Sn(t),q(t.getUTCFullYear()%100,e,2)}function _i(t,e){return q(t.getUTCFullYear()%1e4,e,4)}function Yi(t,e){var n=t.getUTCDay();return t=n>=4||n===0?It(t):It.ceil(t),q(t.getUTCFullYear()%1e4,e,4)}function Fi(){return"+0000"}function je(){return"%"}function Qe(t){return+t}function Je(t){return Math.floor(+t/1e3)}var St,ie;Ui({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function Ui(t){return St=Ur(t),ie=St.format,St.parse,St.utcFormat,St.utcParse,St}function Ei(t){return new Date(t)}function Ii(t){return t instanceof Date?+t:+new Date(+t)}function _n(t,e,n,r,i,s,a,y,F,S){var w=Jn(),P=w.invert,_=w.domain,Y=S(".%L"),X=S(":%S"),B=S("%I:%M"),v=S("%I %p"),U=S("%a %d"),R=S("%b %d"),E=S("%B"),z=S("%Y");function G(T){return(F(T)<T?Y:y(T)<T?X:a(T)<T?B:s(T)<T?v:r(T)<T?i(T)<T?U:R:n(T)<T?E:z)(T)}return w.invert=function(T){return new Date(P(T))},w.domain=function(T){return arguments.length?_(Array.from(T,Ii)):_().map(Ei)},w.ticks=function(T){var k=_();return t(k[0],k[k.length-1],T??10)},w.tickFormat=function(T,k){return k==null?G:S(k)},w.nice=function(T){var k=_();return(!T||typeof T.range!="function")&&(T=e(k[0],k[k.length-1],T??10)),T?_(vr(k,T)):w},w.copy=function(){return Kn(w,_n(t,e,n,r,i,s,a,y,F,S))},w}function Li(){return er.apply(_n(Yr,Fr,kt,Rt,zt,xt,Pt,Nt,vt,ie).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}var jt={exports:{}},Ai=jt.exports,Ke;function Wi(){return Ke||(Ke=1,(function(t,e){(function(n,r){t.exports=r()})(Ai,(function(){var n="day";return function(r,i,s){var a=function(S){return S.add(4-S.isoWeekday(),n)},y=i.prototype;y.isoWeekYear=function(){return a(this).year()},y.isoWeek=function(S){if(!this.$utils().u(S))return this.add(7*(S-this.isoWeek()),n);var w,P,_,Y,X=a(this),B=(w=this.isoWeekYear(),P=this.$u,_=(P?s.utc:s)().year(w).startOf("year"),Y=4-_.isoWeekday(),_.isoWeekday()>4&&(Y+=7),_.add(Y,n));return X.diff(B,"week")+1},y.isoWeekday=function(S){return this.$utils().u(S)?this.day()||7:this.day(this.day()%7?S:S-7)};var F=y.startOf;y.startOf=function(S,w){var P=this.$utils(),_=!!P.u(w)||w;return P.p(S)==="isoweek"?_?this.date(this.date()-(this.isoWeekday()-1)).startOf("day"):this.date(this.date()-1-(this.isoWeekday()-1)+7).endOf("day"):F.bind(this)(S,w)}}}))})(jt)),jt.exports}var $i=Wi();const Oi=oe($i);var Qt={exports:{}},Hi=Qt.exports,tn;function Ni(){return tn||(tn=1,(function(t,e){(function(n,r){t.exports=r()})(Hi,(function(){var n={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},r=/(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|Q|YYYY|YY?|ww?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,i=/\d/,s=/\d\d/,a=/\d\d?/,y=/\d*[^-_:/,()\s\d]+/,F={},S=function(v){return(v=+v)+(v>68?1900:2e3)},w=function(v){return function(U){this[v]=+U}},P=[/[+-]\d\d:?(\d\d)?|Z/,function(v){(this.zone||(this.zone={})).offset=(function(U){if(!U||U==="Z")return 0;var R=U.match(/([+-]|\d\d)/g),E=60*R[1]+(+R[2]||0);return E===0?0:R[0]==="+"?-E:E})(v)}],_=function(v){var U=F[v];return U&&(U.indexOf?U:U.s.concat(U.f))},Y=function(v,U){var R,E=F.meridiem;if(E){for(var z=1;z<=24;z+=1)if(v.indexOf(E(z,0,U))>-1){R=z>12;break}}else R=v===(U?"pm":"PM");return R},X={A:[y,function(v){this.afternoon=Y(v,!1)}],a:[y,function(v){this.afternoon=Y(v,!0)}],Q:[i,function(v){this.month=3*(v-1)+1}],S:[i,function(v){this.milliseconds=100*+v}],SS:[s,function(v){this.milliseconds=10*+v}],SSS:[/\d{3}/,function(v){this.milliseconds=+v}],s:[a,w("seconds")],ss:[a,w("seconds")],m:[a,w("minutes")],mm:[a,w("minutes")],H:[a,w("hours")],h:[a,w("hours")],HH:[a,w("hours")],hh:[a,w("hours")],D:[a,w("day")],DD:[s,w("day")],Do:[y,function(v){var U=F.ordinal,R=v.match(/\d+/);if(this.day=R[0],U)for(var E=1;E<=31;E+=1)U(E).replace(/\[|\]/g,"")===v&&(this.day=E)}],w:[a,w("week")],ww:[s,w("week")],M:[a,w("month")],MM:[s,w("month")],MMM:[y,function(v){var U=_("months"),R=(_("monthsShort")||U.map((function(E){return E.slice(0,3)}))).indexOf(v)+1;if(R<1)throw new Error;this.month=R%12||R}],MMMM:[y,function(v){var U=_("months").indexOf(v)+1;if(U<1)throw new Error;this.month=U%12||U}],Y:[/[+-]?\d+/,w("year")],YY:[s,function(v){this.year=S(v)}],YYYY:[/\d{4}/,w("year")],Z:P,ZZ:P};function B(v){var U,R;U=v,R=F&&F.formats;for(var E=(v=U.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,(function(x,C,M){var D=M&&M.toUpperCase();return C||R[M]||n[M]||R[D].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,(function(c,g,b){return g||b.slice(1)}))}))).match(r),z=E.length,G=0;G<z;G+=1){var T=E[G],k=X[T],p=k&&k[0],L=k&&k[1];E[G]=L?{regex:p,parser:L}:T.replace(/^\[|\]$/g,"")}return function(x){for(var C={},M=0,D=0;M<z;M+=1){var c=E[M];if(typeof c=="string")D+=c.length;else{var g=c.regex,b=c.parser,m=x.slice(D),I=g.exec(m)[0];b.call(C,I),x=x.replace(I,"")}}return(function(o){var W=o.afternoon;if(W!==void 0){var u=o.hours;W?u<12&&(o.hours+=12):u===12&&(o.hours=0),delete o.afternoon}})(C),C}}return function(v,U,R){R.p.customParseFormat=!0,v&&v.parseTwoDigitYear&&(S=v.parseTwoDigitYear);var E=U.prototype,z=E.parse;E.parse=function(G){var T=G.date,k=G.utc,p=G.args;this.$u=k;var L=p[1];if(typeof L=="string"){var x=p[2]===!0,C=p[3]===!0,M=x||C,D=p[2];C&&(D=p[2]),F=this.$locale(),!x&&D&&(F=R.Ls[D]),this.$d=(function(m,I,o,W){try{if(["x","X"].indexOf(I)>-1)return new Date((I==="X"?1e3:1)*m);var u=B(I)(m),K=u.year,l=u.month,$=u.day,O=u.hours,j=u.minutes,H=u.seconds,J=u.milliseconds,h=u.zone,N=u.week,V=new Date,f=$||(K||l?1:V.getDate()),tt=K||V.getFullYear(),A=0;K&&!l||(A=l>0?l-1:V.getMonth());var Q,Z=O||0,st=j||0,at=H||0,pt=J||0;return h?new Date(Date.UTC(tt,A,f,Z,st,at,pt+60*h.offset*1e3)):o?new Date(Date.UTC(tt,A,f,Z,st,at,pt)):(Q=new Date(tt,A,f,Z,st,at,pt),N&&(Q=W(Q).week(N).toDate()),Q)}catch{return new Date("")}})(T,L,k,R),this.init(),D&&D!==!0&&(this.$L=this.locale(D).$L),M&&T!=this.format(L)&&(this.$d=new Date("")),F={}}else if(L instanceof Array)for(var c=L.length,g=1;g<=c;g+=1){p[1]=L[g-1];var b=R.apply(this,p);if(b.isValid()){this.$d=b.$d,this.$L=b.$L,this.init();break}g===c&&(this.$d=new Date(""))}else z.call(this,G)}}}))})(Qt)),Qt.exports}var Pi=Ni();const Vi=oe(Pi);var Jt={exports:{}},Ri=Jt.exports,en;function zi(){return en||(en=1,(function(t,e){(function(n,r){t.exports=r()})(Ri,(function(){return function(n,r){var i=r.prototype,s=i.format;i.format=function(a){var y=this,F=this.$locale();if(!this.isValid())return s.bind(this)(a);var S=this.$utils(),w=(a||"YYYY-MM-DDTHH:mm:ssZ").replace(/\[([^\]]+)]|Q|wo|ww|w|WW|W|zzz|z|gggg|GGGG|Do|X|x|k{1,2}|S/g,(function(P){switch(P){case"Q":return Math.ceil((y.$M+1)/3);case"Do":return F.ordinal(y.$D);case"gggg":return y.weekYear();case"GGGG":return y.isoWeekYear();case"wo":return F.ordinal(y.week(),"W");case"w":case"ww":return S.s(y.week(),P==="w"?1:2,"0");case"W":case"WW":return S.s(y.isoWeek(),P==="W"?1:2,"0");case"k":case"kk":return S.s(String(y.$H===0?24:y.$H),P==="k"?1:2,"0");case"X":return Math.floor(y.$d.getTime()/1e3);case"x":return y.$d.getTime();case"z":return"["+y.offsetName()+"]";case"zzz":return"["+y.offsetName("long")+"]";default:return P}}));return s.bind(this)(w)}}}))})(Jt)),Jt.exports}var qi=zi();const Bi=oe(qi);var Kt={exports:{}},Zi=Kt.exports,nn;function Xi(){return nn||(nn=1,(function(t,e){(function(n,r){t.exports=r()})(Zi,(function(){var n,r,i=1e3,s=6e4,a=36e5,y=864e5,F=31536e6,S=2628e6,w=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/,P=/\[([^\]]+)]|YYYY|YY|Y|M{1,2}|D{1,2}|H{1,2}|m{1,2}|s{1,2}|SSS/g,_={years:F,months:S,days:y,hours:a,minutes:s,seconds:i,milliseconds:1,weeks:6048e5},Y=function(T){return T instanceof z},X=function(T,k,p){return new z(T,p,k.$l)},B=function(T){return r.p(T)+"s"},v=function(T){return T<0},U=function(T){return v(T)?Math.ceil(T):Math.floor(T)},R=function(T){return Math.abs(T)},E=function(T,k){return T?v(T)?{negative:!0,format:""+R(T)+k}:{negative:!1,format:""+T+k}:{negative:!1,format:""}},z=(function(){function T(p,L,x){var C=this;if(this.$d={},this.$l=x,p===void 0&&(this.$ms=0,this.parseFromMilliseconds()),L)return X(p*_[B(L)],this);if(typeof p=="number")return this.$ms=p,this.parseFromMilliseconds(),this;if(typeof p=="object")return Object.keys(p).forEach((function(c){C.$d[B(c)]=p[c]})),this.calMilliseconds(),this;if(typeof p=="string"){var M=p.match(w);if(M){var D=M.slice(2).map((function(c){return c!=null?Number(c):0}));return this.$d.years=D[0],this.$d.months=D[1],this.$d.weeks=D[2],this.$d.days=D[3],this.$d.hours=D[4],this.$d.minutes=D[5],this.$d.seconds=D[6],this.calMilliseconds(),this}}return this}var k=T.prototype;return k.calMilliseconds=function(){var p=this;this.$ms=Object.keys(this.$d).reduce((function(L,x){return L+(p.$d[x]||0)*_[x]}),0)},k.parseFromMilliseconds=function(){var p=this.$ms;this.$d.years=U(p/F),p%=F,this.$d.months=U(p/S),p%=S,this.$d.days=U(p/y),p%=y,this.$d.hours=U(p/a),p%=a,this.$d.minutes=U(p/s),p%=s,this.$d.seconds=U(p/i),p%=i,this.$d.milliseconds=p},k.toISOString=function(){var p=E(this.$d.years,"Y"),L=E(this.$d.months,"M"),x=+this.$d.days||0;this.$d.weeks&&(x+=7*this.$d.weeks);var C=E(x,"D"),M=E(this.$d.hours,"H"),D=E(this.$d.minutes,"M"),c=this.$d.seconds||0;this.$d.milliseconds&&(c+=this.$d.milliseconds/1e3,c=Math.round(1e3*c)/1e3);var g=E(c,"S"),b=p.negative||L.negative||C.negative||M.negative||D.negative||g.negative,m=M.format||D.format||g.format?"T":"",I=(b?"-":"")+"P"+p.format+L.format+C.format+m+M.format+D.format+g.format;return I==="P"||I==="-P"?"P0D":I},k.toJSON=function(){return this.toISOString()},k.format=function(p){var L=p||"YYYY-MM-DDTHH:mm:ss",x={Y:this.$d.years,YY:r.s(this.$d.years,2,"0"),YYYY:r.s(this.$d.years,4,"0"),M:this.$d.months,MM:r.s(this.$d.months,2,"0"),D:this.$d.days,DD:r.s(this.$d.days,2,"0"),H:this.$d.hours,HH:r.s(this.$d.hours,2,"0"),m:this.$d.minutes,mm:r.s(this.$d.minutes,2,"0"),s:this.$d.seconds,ss:r.s(this.$d.seconds,2,"0"),SSS:r.s(this.$d.milliseconds,3,"0")};return L.replace(P,(function(C,M){return M||String(x[C])}))},k.as=function(p){return this.$ms/_[B(p)]},k.get=function(p){var L=this.$ms,x=B(p);return x==="milliseconds"?L%=1e3:L=x==="weeks"?U(L/_[x]):this.$d[x],L||0},k.add=function(p,L,x){var C;return C=L?p*_[B(L)]:Y(p)?p.$ms:X(p,this).$ms,X(this.$ms+C*(x?-1:1),this)},k.subtract=function(p,L){return this.add(p,L,!0)},k.locale=function(p){var L=this.clone();return L.$l=p,L},k.clone=function(){return X(this.$ms,this)},k.humanize=function(p){return n().add(this.$ms,"ms").locale(this.$l).fromNow(!p)},k.valueOf=function(){return this.asMilliseconds()},k.milliseconds=function(){return this.get("milliseconds")},k.asMilliseconds=function(){return this.as("milliseconds")},k.seconds=function(){return this.get("seconds")},k.asSeconds=function(){return this.as("seconds")},k.minutes=function(){return this.get("minutes")},k.asMinutes=function(){return this.as("minutes")},k.hours=function(){return this.get("hours")},k.asHours=function(){return this.as("hours")},k.days=function(){return this.get("days")},k.asDays=function(){return this.as("days")},k.weeks=function(){return this.get("weeks")},k.asWeeks=function(){return this.as("weeks")},k.months=function(){return this.get("months")},k.asMonths=function(){return this.as("months")},k.years=function(){return this.get("years")},k.asYears=function(){return this.as("years")},T})(),G=function(T,k,p){return T.add(k.years()*p,"y").add(k.months()*p,"M").add(k.days()*p,"d").add(k.hours()*p,"h").add(k.minutes()*p,"m").add(k.seconds()*p,"s").add(k.milliseconds()*p,"ms")};return function(T,k,p){n=p,r=p().$utils(),p.duration=function(C,M){var D=p.locale();return X(C,{$l:D},M)},p.isDuration=Y;var L=k.prototype.add,x=k.prototype.subtract;k.prototype.add=function(C,M){return Y(C)?G(this,C,1):L.bind(this)(C,M)},k.prototype.subtract=function(C,M){return Y(C)?G(this,C,-1):x.bind(this)(C,M)}}}))})(Kt)),Kt.exports}var Gi=Xi();const ji=oe(Gi);var we=(function(){var t=d(function(D,c,g,b){for(g=g||{},b=D.length;b--;g[D[b]]=c);return g},"o"),e=[6,8,10,12,13,14,15,16,17,18,20,21,22,23,24,25,26,27,28,29,30,31,33,35,36,38,40],n=[1,26],r=[1,27],i=[1,28],s=[1,29],a=[1,30],y=[1,31],F=[1,32],S=[1,33],w=[1,34],P=[1,9],_=[1,10],Y=[1,11],X=[1,12],B=[1,13],v=[1,14],U=[1,15],R=[1,16],E=[1,19],z=[1,20],G=[1,21],T=[1,22],k=[1,23],p=[1,25],L=[1,35],x={trace:d(function(){},"trace"),yy:{},symbols_:{error:2,start:3,gantt:4,document:5,EOF:6,line:7,SPACE:8,statement:9,NL:10,weekday:11,weekday_monday:12,weekday_tuesday:13,weekday_wednesday:14,weekday_thursday:15,weekday_friday:16,weekday_saturday:17,weekday_sunday:18,weekend:19,weekend_friday:20,weekend_saturday:21,dateFormat:22,inclusiveEndDates:23,topAxis:24,axisFormat:25,tickInterval:26,excludes:27,includes:28,todayMarker:29,title:30,acc_title:31,acc_title_value:32,acc_descr:33,acc_descr_value:34,acc_descr_multiline_value:35,section:36,clickStatement:37,taskTxt:38,taskData:39,click:40,callbackname:41,callbackargs:42,href:43,clickStatementDebug:44,$accept:0,$end:1},terminals_:{2:"error",4:"gantt",6:"EOF",8:"SPACE",10:"NL",12:"weekday_monday",13:"weekday_tuesday",14:"weekday_wednesday",15:"weekday_thursday",16:"weekday_friday",17:"weekday_saturday",18:"weekday_sunday",20:"weekend_friday",21:"weekend_saturday",22:"dateFormat",23:"inclusiveEndDates",24:"topAxis",25:"axisFormat",26:"tickInterval",27:"excludes",28:"includes",29:"todayMarker",30:"title",31:"acc_title",32:"acc_title_value",33:"acc_descr",34:"acc_descr_value",35:"acc_descr_multiline_value",36:"section",38:"taskTxt",39:"taskData",40:"click",41:"callbackname",42:"callbackargs",43:"href"},productions_:[0,[3,3],[5,0],[5,2],[7,2],[7,1],[7,1],[7,1],[11,1],[11,1],[11,1],[11,1],[11,1],[11,1],[11,1],[19,1],[19,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,2],[9,2],[9,1],[9,1],[9,1],[9,2],[37,2],[37,3],[37,3],[37,4],[37,3],[37,4],[37,2],[44,2],[44,3],[44,3],[44,4],[44,3],[44,4],[44,2]],performAction:d(function(c,g,b,m,I,o,W){var u=o.length-1;switch(I){case 1:return o[u-1];case 2:this.$=[];break;case 3:o[u-1].push(o[u]),this.$=o[u-1];break;case 4:case 5:this.$=o[u];break;case 6:case 7:this.$=[];break;case 8:m.setWeekday("monday");break;case 9:m.setWeekday("tuesday");break;case 10:m.setWeekday("wednesday");break;case 11:m.setWeekday("thursday");break;case 12:m.setWeekday("friday");break;case 13:m.setWeekday("saturday");break;case 14:m.setWeekday("sunday");break;case 15:m.setWeekend("friday");break;case 16:m.setWeekend("saturday");break;case 17:m.setDateFormat(o[u].substr(11)),this.$=o[u].substr(11);break;case 18:m.enableInclusiveEndDates(),this.$=o[u].substr(18);break;case 19:m.TopAxis(),this.$=o[u].substr(8);break;case 20:m.setAxisFormat(o[u].substr(11)),this.$=o[u].substr(11);break;case 21:m.setTickInterval(o[u].substr(13)),this.$=o[u].substr(13);break;case 22:m.setExcludes(o[u].substr(9)),this.$=o[u].substr(9);break;case 23:m.setIncludes(o[u].substr(9)),this.$=o[u].substr(9);break;case 24:m.setTodayMarker(o[u].substr(12)),this.$=o[u].substr(12);break;case 27:m.setDiagramTitle(o[u].substr(6)),this.$=o[u].substr(6);break;case 28:this.$=o[u].trim(),m.setAccTitle(this.$);break;case 29:case 30:this.$=o[u].trim(),m.setAccDescription(this.$);break;case 31:m.addSection(o[u].substr(8)),this.$=o[u].substr(8);break;case 33:m.addTask(o[u-1],o[u]),this.$="task";break;case 34:this.$=o[u-1],m.setClickEvent(o[u-1],o[u],null);break;case 35:this.$=o[u-2],m.setClickEvent(o[u-2],o[u-1],o[u]);break;case 36:this.$=o[u-2],m.setClickEvent(o[u-2],o[u-1],null),m.setLink(o[u-2],o[u]);break;case 37:this.$=o[u-3],m.setClickEvent(o[u-3],o[u-2],o[u-1]),m.setLink(o[u-3],o[u]);break;case 38:this.$=o[u-2],m.setClickEvent(o[u-2],o[u],null),m.setLink(o[u-2],o[u-1]);break;case 39:this.$=o[u-3],m.setClickEvent(o[u-3],o[u-1],o[u]),m.setLink(o[u-3],o[u-2]);break;case 40:this.$=o[u-1],m.setLink(o[u-1],o[u]);break;case 41:case 47:this.$=o[u-1]+" "+o[u];break;case 42:case 43:case 45:this.$=o[u-2]+" "+o[u-1]+" "+o[u];break;case 44:case 46:this.$=o[u-3]+" "+o[u-2]+" "+o[u-1]+" "+o[u];break}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},t(e,[2,2],{5:3}),{6:[1,4],7:5,8:[1,6],9:7,10:[1,8],11:17,12:n,13:r,14:i,15:s,16:a,17:y,18:F,19:18,20:S,21:w,22:P,23:_,24:Y,25:X,26:B,27:v,28:U,29:R,30:E,31:z,33:G,35:T,36:k,37:24,38:p,40:L},t(e,[2,7],{1:[2,1]}),t(e,[2,3]),{9:36,11:17,12:n,13:r,14:i,15:s,16:a,17:y,18:F,19:18,20:S,21:w,22:P,23:_,24:Y,25:X,26:B,27:v,28:U,29:R,30:E,31:z,33:G,35:T,36:k,37:24,38:p,40:L},t(e,[2,5]),t(e,[2,6]),t(e,[2,17]),t(e,[2,18]),t(e,[2,19]),t(e,[2,20]),t(e,[2,21]),t(e,[2,22]),t(e,[2,23]),t(e,[2,24]),t(e,[2,25]),t(e,[2,26]),t(e,[2,27]),{32:[1,37]},{34:[1,38]},t(e,[2,30]),t(e,[2,31]),t(e,[2,32]),{39:[1,39]},t(e,[2,8]),t(e,[2,9]),t(e,[2,10]),t(e,[2,11]),t(e,[2,12]),t(e,[2,13]),t(e,[2,14]),t(e,[2,15]),t(e,[2,16]),{41:[1,40],43:[1,41]},t(e,[2,4]),t(e,[2,28]),t(e,[2,29]),t(e,[2,33]),t(e,[2,34],{42:[1,42],43:[1,43]}),t(e,[2,40],{41:[1,44]}),t(e,[2,35],{43:[1,45]}),t(e,[2,36]),t(e,[2,38],{42:[1,46]}),t(e,[2,37]),t(e,[2,39])],defaultActions:{},parseError:d(function(c,g){if(g.recoverable)this.trace(c);else{var b=new Error(c);throw b.hash=g,b}},"parseError"),parse:d(function(c){var g=this,b=[0],m=[],I=[null],o=[],W=this.table,u="",K=0,l=0,$=2,O=1,j=o.slice.call(arguments,1),H=Object.create(this.lexer),J={yy:{}};for(var h in this.yy)Object.prototype.hasOwnProperty.call(this.yy,h)&&(J.yy[h]=this.yy[h]);H.setInput(c,J.yy),J.yy.lexer=H,J.yy.parser=this,typeof H.yylloc>"u"&&(H.yylloc={});var N=H.yylloc;o.push(N);var V=H.options&&H.options.ranges;typeof J.yy.parseError=="function"?this.parseError=J.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function f(ot){b.length=b.length-2*ot,I.length=I.length-ot,o.length=o.length-ot}d(f,"popStack");function tt(){var ot;return ot=m.pop()||H.lex()||O,typeof ot!="number"&&(ot instanceof Array&&(m=ot,ot=m.pop()),ot=g.symbols_[ot]||ot),ot}d(tt,"lex");for(var A,Q,Z,st,at={},pt,ut,He,Bt;;){if(Q=b[b.length-1],this.defaultActions[Q]?Z=this.defaultActions[Q]:((A===null||typeof A>"u")&&(A=tt()),Z=W[Q]&&W[Q][A]),typeof Z>"u"||!Z.length||!Z[0]){var ce="";Bt=[];for(pt in W[Q])this.terminals_[pt]&&pt>$&&Bt.push("'"+this.terminals_[pt]+"'");H.showPosition?ce="Parse error on line "+(K+1)+`:
1
+ import{bg as on,bh as On,bi as cn,bj as un,bk as ln,bl as ue,bm as Hn,g as Nn,s as Pn,p as Vn,o as Rn,a as zn,b as qn,_ as d,c as Yt,d as Zt,e as Bn,bn as it,l as Tt,k as Zn,j as Xn,q as Gn,y as jn}from"./mermaid.core-Bt-11G2g.js";import{g as oe}from"./vendor-react--Eh9ivFN.js";import{b as Qn,t as Ne,c as Jn,a as Kn,l as tr}from"./linear-CmFTyYvd.js";import{i as er}from"./init-Gi6I4Gst.js";import"./main-DXG9arLM.js";import"./vendor-three-CBPuP1jE.js";import"./defaultLocale-DX6XiGOO.js";function nr(t,e){let n;if(e===void 0)for(const r of t)r!=null&&(n<r||n===void 0&&r>=r)&&(n=r);else{let r=-1;for(let i of t)(i=e(i,++r,t))!=null&&(n<i||n===void 0&&i>=i)&&(n=i)}return n}function rr(t,e){let n;if(e===void 0)for(const r of t)r!=null&&(n>r||n===void 0&&r>=r)&&(n=r);else{let r=-1;for(let i of t)(i=e(i,++r,t))!=null&&(n>i||n===void 0&&i>=i)&&(n=i)}return n}function ir(t){return t}var Gt=1,le=2,xe=3,Xt=4,Pe=1e-6;function sr(t){return"translate("+t+",0)"}function ar(t){return"translate(0,"+t+")"}function or(t){return e=>+t(e)}function cr(t,e){return e=Math.max(0,t.bandwidth()-e*2)/2,t.round()&&(e=Math.round(e)),n=>+t(n)+e}function ur(){return!this.__axis}function fn(t,e){var n=[],r=null,i=null,s=6,a=6,y=3,F=typeof window<"u"&&window.devicePixelRatio>1?0:.5,S=t===Gt||t===Xt?-1:1,w=t===Xt||t===le?"x":"y",P=t===Gt||t===xe?sr:ar;function _(Y){var X=r??(e.ticks?e.ticks.apply(e,n):e.domain()),B=i??(e.tickFormat?e.tickFormat.apply(e,n):ir),v=Math.max(s,0)+y,U=e.range(),R=+U[0]+F,E=+U[U.length-1]+F,z=(e.bandwidth?cr:or)(e.copy(),F),G=Y.selection?Y.selection():Y,T=G.selectAll(".domain").data([null]),k=G.selectAll(".tick").data(X,e).order(),p=k.exit(),L=k.enter().append("g").attr("class","tick"),x=k.select("line"),C=k.select("text");T=T.merge(T.enter().insert("path",".tick").attr("class","domain").attr("stroke","currentColor")),k=k.merge(L),x=x.merge(L.append("line").attr("stroke","currentColor").attr(w+"2",S*s)),C=C.merge(L.append("text").attr("fill","currentColor").attr(w,S*v).attr("dy",t===Gt?"0em":t===xe?"0.71em":"0.32em")),Y!==G&&(T=T.transition(Y),k=k.transition(Y),x=x.transition(Y),C=C.transition(Y),p=p.transition(Y).attr("opacity",Pe).attr("transform",function(M){return isFinite(M=z(M))?P(M+F):this.getAttribute("transform")}),L.attr("opacity",Pe).attr("transform",function(M){var D=this.parentNode.__axis;return P((D&&isFinite(D=D(M))?D:z(M))+F)})),p.remove(),T.attr("d",t===Xt||t===le?a?"M"+S*a+","+R+"H"+F+"V"+E+"H"+S*a:"M"+F+","+R+"V"+E:a?"M"+R+","+S*a+"V"+F+"H"+E+"V"+S*a:"M"+R+","+F+"H"+E),k.attr("opacity",1).attr("transform",function(M){return P(z(M)+F)}),x.attr(w+"2",S*s),C.attr(w,S*v).text(B),G.filter(ur).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",t===le?"start":t===Xt?"end":"middle"),G.each(function(){this.__axis=z})}return _.scale=function(Y){return arguments.length?(e=Y,_):e},_.ticks=function(){return n=Array.from(arguments),_},_.tickArguments=function(Y){return arguments.length?(n=Y==null?[]:Array.from(Y),_):n.slice()},_.tickValues=function(Y){return arguments.length?(r=Y==null?null:Array.from(Y),_):r&&r.slice()},_.tickFormat=function(Y){return arguments.length?(i=Y,_):i},_.tickSize=function(Y){return arguments.length?(s=a=+Y,_):s},_.tickSizeInner=function(Y){return arguments.length?(s=+Y,_):s},_.tickSizeOuter=function(Y){return arguments.length?(a=+Y,_):a},_.tickPadding=function(Y){return arguments.length?(y=+Y,_):y},_.offset=function(Y){return arguments.length?(F=+Y,_):F},_}function lr(t){return fn(Gt,t)}function fr(t){return fn(xe,t)}const dr=Math.PI/180,hr=180/Math.PI,ne=18,dn=.96422,hn=1,mn=.82521,gn=4/29,Ft=6/29,yn=3*Ft*Ft,mr=Ft*Ft*Ft;function kn(t){if(t instanceof ft)return new ft(t.l,t.a,t.b,t.opacity);if(t instanceof ht)return pn(t);t instanceof on||(t=On(t));var e=me(t.r),n=me(t.g),r=me(t.b),i=fe((.2225045*e+.7168786*n+.0606169*r)/hn),s,a;return e===n&&n===r?s=a=i:(s=fe((.4360747*e+.3850649*n+.1430804*r)/dn),a=fe((.0139322*e+.0971045*n+.7141733*r)/mn)),new ft(116*i-16,500*(s-i),200*(i-a),t.opacity)}function gr(t,e,n,r){return arguments.length===1?kn(t):new ft(t,e,n,r??1)}function ft(t,e,n,r){this.l=+t,this.a=+e,this.b=+n,this.opacity=+r}cn(ft,gr,un(ln,{brighter(t){return new ft(this.l+ne*(t??1),this.a,this.b,this.opacity)},darker(t){return new ft(this.l-ne*(t??1),this.a,this.b,this.opacity)},rgb(){var t=(this.l+16)/116,e=isNaN(this.a)?t:t+this.a/500,n=isNaN(this.b)?t:t-this.b/200;return e=dn*de(e),t=hn*de(t),n=mn*de(n),new on(he(3.1338561*e-1.6168667*t-.4906146*n),he(-.9787684*e+1.9161415*t+.033454*n),he(.0719453*e-.2289914*t+1.4052427*n),this.opacity)}}));function fe(t){return t>mr?Math.pow(t,1/3):t/yn+gn}function de(t){return t>Ft?t*t*t:yn*(t-gn)}function he(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function me(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function yr(t){if(t instanceof ht)return new ht(t.h,t.c,t.l,t.opacity);if(t instanceof ft||(t=kn(t)),t.a===0&&t.b===0)return new ht(NaN,0<t.l&&t.l<100?0:NaN,t.l,t.opacity);var e=Math.atan2(t.b,t.a)*hr;return new ht(e<0?e+360:e,Math.sqrt(t.a*t.a+t.b*t.b),t.l,t.opacity)}function be(t,e,n,r){return arguments.length===1?yr(t):new ht(t,e,n,r??1)}function ht(t,e,n,r){this.h=+t,this.c=+e,this.l=+n,this.opacity=+r}function pn(t){if(isNaN(t.h))return new ft(t.l,0,0,t.opacity);var e=t.h*dr;return new ft(t.l,Math.cos(e)*t.c,Math.sin(e)*t.c,t.opacity)}cn(ht,be,un(ln,{brighter(t){return new ht(this.h,this.c,this.l+ne*(t??1),this.opacity)},darker(t){return new ht(this.h,this.c,this.l-ne*(t??1),this.opacity)},rgb(){return pn(this).rgb()}}));function kr(t){return function(e,n){var r=t((e=be(e)).h,(n=be(n)).h),i=ue(e.c,n.c),s=ue(e.l,n.l),a=ue(e.opacity,n.opacity);return function(y){return e.h=r(y),e.c=i(y),e.l=s(y),e.opacity=a(y),e+""}}}const pr=kr(Hn);function vr(t,e){t=t.slice();var n=0,r=t.length-1,i=t[n],s=t[r],a;return s<i&&(a=n,n=r,r=a,a=i,i=s,s=a),t[n]=e.floor(i),t[r]=e.ceil(s),t}const ge=new Date,ye=new Date;function nt(t,e,n,r){function i(s){return t(s=arguments.length===0?new Date:new Date(+s)),s}return i.floor=s=>(t(s=new Date(+s)),s),i.ceil=s=>(t(s=new Date(s-1)),e(s,1),t(s),s),i.round=s=>{const a=i(s),y=i.ceil(s);return s-a<y-s?a:y},i.offset=(s,a)=>(e(s=new Date(+s),a==null?1:Math.floor(a)),s),i.range=(s,a,y)=>{const F=[];if(s=i.ceil(s),y=y==null?1:Math.floor(y),!(s<a)||!(y>0))return F;let S;do F.push(S=new Date(+s)),e(s,y),t(s);while(S<s&&s<a);return F},i.filter=s=>nt(a=>{if(a>=a)for(;t(a),!s(a);)a.setTime(a-1)},(a,y)=>{if(a>=a)if(y<0)for(;++y<=0;)for(;e(a,-1),!s(a););else for(;--y>=0;)for(;e(a,1),!s(a););}),n&&(i.count=(s,a)=>(ge.setTime(+s),ye.setTime(+a),t(ge),t(ye),Math.floor(n(ge,ye))),i.every=s=>(s=Math.floor(s),!isFinite(s)||!(s>0)?null:s>1?i.filter(r?a=>r(a)%s===0:a=>i.count(0,a)%s===0):i)),i}const Et=nt(()=>{},(t,e)=>{t.setTime(+t+e)},(t,e)=>e-t);Et.every=t=>(t=Math.floor(t),!isFinite(t)||!(t>0)?null:t>1?nt(e=>{e.setTime(Math.floor(e/t)*t)},(e,n)=>{e.setTime(+e+n*t)},(e,n)=>(n-e)/t):Et);Et.range;const mt=1e3,ct=mt*60,gt=ct*60,yt=gt*24,Se=yt*7,Ve=yt*30,ke=yt*365,vt=nt(t=>{t.setTime(t-t.getMilliseconds())},(t,e)=>{t.setTime(+t+e*mt)},(t,e)=>(e-t)/mt,t=>t.getUTCSeconds());vt.range;const Nt=nt(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*mt)},(t,e)=>{t.setTime(+t+e*ct)},(t,e)=>(e-t)/ct,t=>t.getMinutes());Nt.range;const Tr=nt(t=>{t.setUTCSeconds(0,0)},(t,e)=>{t.setTime(+t+e*ct)},(t,e)=>(e-t)/ct,t=>t.getUTCMinutes());Tr.range;const Pt=nt(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*mt-t.getMinutes()*ct)},(t,e)=>{t.setTime(+t+e*gt)},(t,e)=>(e-t)/gt,t=>t.getHours());Pt.range;const xr=nt(t=>{t.setUTCMinutes(0,0,0)},(t,e)=>{t.setTime(+t+e*gt)},(t,e)=>(e-t)/gt,t=>t.getUTCHours());xr.range;const xt=nt(t=>t.setHours(0,0,0,0),(t,e)=>t.setDate(t.getDate()+e),(t,e)=>(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*ct)/yt,t=>t.getDate()-1);xt.range;const _e=nt(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/yt,t=>t.getUTCDate()-1);_e.range;const br=nt(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/yt,t=>Math.floor(t/yt));br.range;function Dt(t){return nt(e=>{e.setDate(e.getDate()-(e.getDay()+7-t)%7),e.setHours(0,0,0,0)},(e,n)=>{e.setDate(e.getDate()+n*7)},(e,n)=>(n-e-(n.getTimezoneOffset()-e.getTimezoneOffset())*ct)/Se)}const zt=Dt(0),Vt=Dt(1),vn=Dt(2),Tn=Dt(3),bt=Dt(4),xn=Dt(5),bn=Dt(6);zt.range;Vt.range;vn.range;Tn.range;bt.range;xn.range;bn.range;function Mt(t){return nt(e=>{e.setUTCDate(e.getUTCDate()-(e.getUTCDay()+7-t)%7),e.setUTCHours(0,0,0,0)},(e,n)=>{e.setUTCDate(e.getUTCDate()+n*7)},(e,n)=>(n-e)/Se)}const wn=Mt(0),re=Mt(1),wr=Mt(2),Dr=Mt(3),It=Mt(4),Mr=Mt(5),Cr=Mt(6);wn.range;re.range;wr.range;Dr.range;It.range;Mr.range;Cr.range;const Rt=nt(t=>{t.setDate(1),t.setHours(0,0,0,0)},(t,e)=>{t.setMonth(t.getMonth()+e)},(t,e)=>e.getMonth()-t.getMonth()+(e.getFullYear()-t.getFullYear())*12,t=>t.getMonth());Rt.range;const Sr=nt(t=>{t.setUTCDate(1),t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCMonth(t.getUTCMonth()+e)},(t,e)=>e.getUTCMonth()-t.getUTCMonth()+(e.getUTCFullYear()-t.getUTCFullYear())*12,t=>t.getUTCMonth());Sr.range;const kt=nt(t=>{t.setMonth(0,1),t.setHours(0,0,0,0)},(t,e)=>{t.setFullYear(t.getFullYear()+e)},(t,e)=>e.getFullYear()-t.getFullYear(),t=>t.getFullYear());kt.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:nt(e=>{e.setFullYear(Math.floor(e.getFullYear()/t)*t),e.setMonth(0,1),e.setHours(0,0,0,0)},(e,n)=>{e.setFullYear(e.getFullYear()+n*t)});kt.range;const wt=nt(t=>{t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCFullYear(t.getUTCFullYear()+e)},(t,e)=>e.getUTCFullYear()-t.getUTCFullYear(),t=>t.getUTCFullYear());wt.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:nt(e=>{e.setUTCFullYear(Math.floor(e.getUTCFullYear()/t)*t),e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,n)=>{e.setUTCFullYear(e.getUTCFullYear()+n*t)});wt.range;function _r(t,e,n,r,i,s){const a=[[vt,1,mt],[vt,5,5*mt],[vt,15,15*mt],[vt,30,30*mt],[s,1,ct],[s,5,5*ct],[s,15,15*ct],[s,30,30*ct],[i,1,gt],[i,3,3*gt],[i,6,6*gt],[i,12,12*gt],[r,1,yt],[r,2,2*yt],[n,1,Se],[e,1,Ve],[e,3,3*Ve],[t,1,ke]];function y(S,w,P){const _=w<S;_&&([S,w]=[w,S]);const Y=P&&typeof P.range=="function"?P:F(S,w,P),X=Y?Y.range(S,+w+1):[];return _?X.reverse():X}function F(S,w,P){const _=Math.abs(w-S)/P,Y=Qn(([,,v])=>v).right(a,_);if(Y===a.length)return t.every(Ne(S/ke,w/ke,P));if(Y===0)return Et.every(Math.max(Ne(S,w,P),1));const[X,B]=a[_/a[Y-1][2]<a[Y][2]/_?Y-1:Y];return X.every(B)}return[y,F]}const[Yr,Fr]=_r(kt,Rt,zt,xt,Pt,Nt);function pe(t){if(0<=t.y&&t.y<100){var e=new Date(-1,t.m,t.d,t.H,t.M,t.S,t.L);return e.setFullYear(t.y),e}return new Date(t.y,t.m,t.d,t.H,t.M,t.S,t.L)}function ve(t){if(0<=t.y&&t.y<100){var e=new Date(Date.UTC(-1,t.m,t.d,t.H,t.M,t.S,t.L));return e.setUTCFullYear(t.y),e}return new Date(Date.UTC(t.y,t.m,t.d,t.H,t.M,t.S,t.L))}function $t(t,e,n){return{y:t,m:e,d:n,H:0,M:0,S:0,L:0}}function Ur(t){var e=t.dateTime,n=t.date,r=t.time,i=t.periods,s=t.days,a=t.shortDays,y=t.months,F=t.shortMonths,S=Ot(i),w=Ht(i),P=Ot(s),_=Ht(s),Y=Ot(a),X=Ht(a),B=Ot(y),v=Ht(y),U=Ot(F),R=Ht(F),E={a:m,A:I,b:o,B:W,c:null,d:Xe,e:Xe,f:ti,g:li,G:di,H:Qr,I:Jr,j:Kr,L:Dn,m:ei,M:ni,p:u,q:K,Q:Qe,s:Je,S:ri,u:ii,U:si,V:ai,w:oi,W:ci,x:null,X:null,y:ui,Y:fi,Z:hi,"%":je},z={a:l,A:$,b:O,B:j,c:null,d:Ge,e:Ge,f:ki,g:Si,G:Yi,H:mi,I:gi,j:yi,L:Cn,m:pi,M:vi,p:H,q:J,Q:Qe,s:Je,S:Ti,u:xi,U:bi,V:wi,w:Di,W:Mi,x:null,X:null,y:Ci,Y:_i,Z:Fi,"%":je},G={a:x,A:C,b:M,B:D,c,d:Be,e:Be,f:Zr,g:qe,G:ze,H:Ze,I:Ze,j:Rr,L:Br,m:Vr,M:zr,p:L,q:Pr,Q:Gr,s:jr,S:qr,u:Wr,U:$r,V:Or,w:Ar,W:Hr,x:g,X:b,y:qe,Y:ze,Z:Nr,"%":Xr};E.x=T(n,E),E.X=T(r,E),E.c=T(e,E),z.x=T(n,z),z.X=T(r,z),z.c=T(e,z);function T(h,N){return function(V){var f=[],tt=-1,A=0,Q=h.length,Z,st,at;for(V instanceof Date||(V=new Date(+V));++tt<Q;)h.charCodeAt(tt)===37&&(f.push(h.slice(A,tt)),(st=Re[Z=h.charAt(++tt)])!=null?Z=h.charAt(++tt):st=Z==="e"?" ":"0",(at=N[Z])&&(Z=at(V,st)),f.push(Z),A=tt+1);return f.push(h.slice(A,tt)),f.join("")}}function k(h,N){return function(V){var f=$t(1900,void 0,1),tt=p(f,h,V+="",0),A,Q;if(tt!=V.length)return null;if("Q"in f)return new Date(f.Q);if("s"in f)return new Date(f.s*1e3+("L"in f?f.L:0));if(N&&!("Z"in f)&&(f.Z=0),"p"in f&&(f.H=f.H%12+f.p*12),f.m===void 0&&(f.m="q"in f?f.q:0),"V"in f){if(f.V<1||f.V>53)return null;"w"in f||(f.w=1),"Z"in f?(A=ve($t(f.y,0,1)),Q=A.getUTCDay(),A=Q>4||Q===0?re.ceil(A):re(A),A=_e.offset(A,(f.V-1)*7),f.y=A.getUTCFullYear(),f.m=A.getUTCMonth(),f.d=A.getUTCDate()+(f.w+6)%7):(A=pe($t(f.y,0,1)),Q=A.getDay(),A=Q>4||Q===0?Vt.ceil(A):Vt(A),A=xt.offset(A,(f.V-1)*7),f.y=A.getFullYear(),f.m=A.getMonth(),f.d=A.getDate()+(f.w+6)%7)}else("W"in f||"U"in f)&&("w"in f||(f.w="u"in f?f.u%7:"W"in f?1:0),Q="Z"in f?ve($t(f.y,0,1)).getUTCDay():pe($t(f.y,0,1)).getDay(),f.m=0,f.d="W"in f?(f.w+6)%7+f.W*7-(Q+5)%7:f.w+f.U*7-(Q+6)%7);return"Z"in f?(f.H+=f.Z/100|0,f.M+=f.Z%100,ve(f)):pe(f)}}function p(h,N,V,f){for(var tt=0,A=N.length,Q=V.length,Z,st;tt<A;){if(f>=Q)return-1;if(Z=N.charCodeAt(tt++),Z===37){if(Z=N.charAt(tt++),st=G[Z in Re?N.charAt(tt++):Z],!st||(f=st(h,V,f))<0)return-1}else if(Z!=V.charCodeAt(f++))return-1}return f}function L(h,N,V){var f=S.exec(N.slice(V));return f?(h.p=w.get(f[0].toLowerCase()),V+f[0].length):-1}function x(h,N,V){var f=Y.exec(N.slice(V));return f?(h.w=X.get(f[0].toLowerCase()),V+f[0].length):-1}function C(h,N,V){var f=P.exec(N.slice(V));return f?(h.w=_.get(f[0].toLowerCase()),V+f[0].length):-1}function M(h,N,V){var f=U.exec(N.slice(V));return f?(h.m=R.get(f[0].toLowerCase()),V+f[0].length):-1}function D(h,N,V){var f=B.exec(N.slice(V));return f?(h.m=v.get(f[0].toLowerCase()),V+f[0].length):-1}function c(h,N,V){return p(h,e,N,V)}function g(h,N,V){return p(h,n,N,V)}function b(h,N,V){return p(h,r,N,V)}function m(h){return a[h.getDay()]}function I(h){return s[h.getDay()]}function o(h){return F[h.getMonth()]}function W(h){return y[h.getMonth()]}function u(h){return i[+(h.getHours()>=12)]}function K(h){return 1+~~(h.getMonth()/3)}function l(h){return a[h.getUTCDay()]}function $(h){return s[h.getUTCDay()]}function O(h){return F[h.getUTCMonth()]}function j(h){return y[h.getUTCMonth()]}function H(h){return i[+(h.getUTCHours()>=12)]}function J(h){return 1+~~(h.getUTCMonth()/3)}return{format:function(h){var N=T(h+="",E);return N.toString=function(){return h},N},parse:function(h){var N=k(h+="",!1);return N.toString=function(){return h},N},utcFormat:function(h){var N=T(h+="",z);return N.toString=function(){return h},N},utcParse:function(h){var N=k(h+="",!0);return N.toString=function(){return h},N}}}var Re={"-":"",_:" ",0:"0"},rt=/^\s*\d+/,Er=/^%/,Ir=/[\\^$*+?|[\]().{}]/g;function q(t,e,n){var r=t<0?"-":"",i=(r?-t:t)+"",s=i.length;return r+(s<n?new Array(n-s+1).join(e)+i:i)}function Lr(t){return t.replace(Ir,"\\$&")}function Ot(t){return new RegExp("^(?:"+t.map(Lr).join("|")+")","i")}function Ht(t){return new Map(t.map((e,n)=>[e.toLowerCase(),n]))}function Ar(t,e,n){var r=rt.exec(e.slice(n,n+1));return r?(t.w=+r[0],n+r[0].length):-1}function Wr(t,e,n){var r=rt.exec(e.slice(n,n+1));return r?(t.u=+r[0],n+r[0].length):-1}function $r(t,e,n){var r=rt.exec(e.slice(n,n+2));return r?(t.U=+r[0],n+r[0].length):-1}function Or(t,e,n){var r=rt.exec(e.slice(n,n+2));return r?(t.V=+r[0],n+r[0].length):-1}function Hr(t,e,n){var r=rt.exec(e.slice(n,n+2));return r?(t.W=+r[0],n+r[0].length):-1}function ze(t,e,n){var r=rt.exec(e.slice(n,n+4));return r?(t.y=+r[0],n+r[0].length):-1}function qe(t,e,n){var r=rt.exec(e.slice(n,n+2));return r?(t.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function Nr(t,e,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(e.slice(n,n+6));return r?(t.Z=r[1]?0:-(r[2]+(r[3]||"00")),n+r[0].length):-1}function Pr(t,e,n){var r=rt.exec(e.slice(n,n+1));return r?(t.q=r[0]*3-3,n+r[0].length):-1}function Vr(t,e,n){var r=rt.exec(e.slice(n,n+2));return r?(t.m=r[0]-1,n+r[0].length):-1}function Be(t,e,n){var r=rt.exec(e.slice(n,n+2));return r?(t.d=+r[0],n+r[0].length):-1}function Rr(t,e,n){var r=rt.exec(e.slice(n,n+3));return r?(t.m=0,t.d=+r[0],n+r[0].length):-1}function Ze(t,e,n){var r=rt.exec(e.slice(n,n+2));return r?(t.H=+r[0],n+r[0].length):-1}function zr(t,e,n){var r=rt.exec(e.slice(n,n+2));return r?(t.M=+r[0],n+r[0].length):-1}function qr(t,e,n){var r=rt.exec(e.slice(n,n+2));return r?(t.S=+r[0],n+r[0].length):-1}function Br(t,e,n){var r=rt.exec(e.slice(n,n+3));return r?(t.L=+r[0],n+r[0].length):-1}function Zr(t,e,n){var r=rt.exec(e.slice(n,n+6));return r?(t.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function Xr(t,e,n){var r=Er.exec(e.slice(n,n+1));return r?n+r[0].length:-1}function Gr(t,e,n){var r=rt.exec(e.slice(n));return r?(t.Q=+r[0],n+r[0].length):-1}function jr(t,e,n){var r=rt.exec(e.slice(n));return r?(t.s=+r[0],n+r[0].length):-1}function Xe(t,e){return q(t.getDate(),e,2)}function Qr(t,e){return q(t.getHours(),e,2)}function Jr(t,e){return q(t.getHours()%12||12,e,2)}function Kr(t,e){return q(1+xt.count(kt(t),t),e,3)}function Dn(t,e){return q(t.getMilliseconds(),e,3)}function ti(t,e){return Dn(t,e)+"000"}function ei(t,e){return q(t.getMonth()+1,e,2)}function ni(t,e){return q(t.getMinutes(),e,2)}function ri(t,e){return q(t.getSeconds(),e,2)}function ii(t){var e=t.getDay();return e===0?7:e}function si(t,e){return q(zt.count(kt(t)-1,t),e,2)}function Mn(t){var e=t.getDay();return e>=4||e===0?bt(t):bt.ceil(t)}function ai(t,e){return t=Mn(t),q(bt.count(kt(t),t)+(kt(t).getDay()===4),e,2)}function oi(t){return t.getDay()}function ci(t,e){return q(Vt.count(kt(t)-1,t),e,2)}function ui(t,e){return q(t.getFullYear()%100,e,2)}function li(t,e){return t=Mn(t),q(t.getFullYear()%100,e,2)}function fi(t,e){return q(t.getFullYear()%1e4,e,4)}function di(t,e){var n=t.getDay();return t=n>=4||n===0?bt(t):bt.ceil(t),q(t.getFullYear()%1e4,e,4)}function hi(t){var e=t.getTimezoneOffset();return(e>0?"-":(e*=-1,"+"))+q(e/60|0,"0",2)+q(e%60,"0",2)}function Ge(t,e){return q(t.getUTCDate(),e,2)}function mi(t,e){return q(t.getUTCHours(),e,2)}function gi(t,e){return q(t.getUTCHours()%12||12,e,2)}function yi(t,e){return q(1+_e.count(wt(t),t),e,3)}function Cn(t,e){return q(t.getUTCMilliseconds(),e,3)}function ki(t,e){return Cn(t,e)+"000"}function pi(t,e){return q(t.getUTCMonth()+1,e,2)}function vi(t,e){return q(t.getUTCMinutes(),e,2)}function Ti(t,e){return q(t.getUTCSeconds(),e,2)}function xi(t){var e=t.getUTCDay();return e===0?7:e}function bi(t,e){return q(wn.count(wt(t)-1,t),e,2)}function Sn(t){var e=t.getUTCDay();return e>=4||e===0?It(t):It.ceil(t)}function wi(t,e){return t=Sn(t),q(It.count(wt(t),t)+(wt(t).getUTCDay()===4),e,2)}function Di(t){return t.getUTCDay()}function Mi(t,e){return q(re.count(wt(t)-1,t),e,2)}function Ci(t,e){return q(t.getUTCFullYear()%100,e,2)}function Si(t,e){return t=Sn(t),q(t.getUTCFullYear()%100,e,2)}function _i(t,e){return q(t.getUTCFullYear()%1e4,e,4)}function Yi(t,e){var n=t.getUTCDay();return t=n>=4||n===0?It(t):It.ceil(t),q(t.getUTCFullYear()%1e4,e,4)}function Fi(){return"+0000"}function je(){return"%"}function Qe(t){return+t}function Je(t){return Math.floor(+t/1e3)}var St,ie;Ui({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function Ui(t){return St=Ur(t),ie=St.format,St.parse,St.utcFormat,St.utcParse,St}function Ei(t){return new Date(t)}function Ii(t){return t instanceof Date?+t:+new Date(+t)}function _n(t,e,n,r,i,s,a,y,F,S){var w=Jn(),P=w.invert,_=w.domain,Y=S(".%L"),X=S(":%S"),B=S("%I:%M"),v=S("%I %p"),U=S("%a %d"),R=S("%b %d"),E=S("%B"),z=S("%Y");function G(T){return(F(T)<T?Y:y(T)<T?X:a(T)<T?B:s(T)<T?v:r(T)<T?i(T)<T?U:R:n(T)<T?E:z)(T)}return w.invert=function(T){return new Date(P(T))},w.domain=function(T){return arguments.length?_(Array.from(T,Ii)):_().map(Ei)},w.ticks=function(T){var k=_();return t(k[0],k[k.length-1],T??10)},w.tickFormat=function(T,k){return k==null?G:S(k)},w.nice=function(T){var k=_();return(!T||typeof T.range!="function")&&(T=e(k[0],k[k.length-1],T??10)),T?_(vr(k,T)):w},w.copy=function(){return Kn(w,_n(t,e,n,r,i,s,a,y,F,S))},w}function Li(){return er.apply(_n(Yr,Fr,kt,Rt,zt,xt,Pt,Nt,vt,ie).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}var jt={exports:{}},Ai=jt.exports,Ke;function Wi(){return Ke||(Ke=1,(function(t,e){(function(n,r){t.exports=r()})(Ai,(function(){var n="day";return function(r,i,s){var a=function(S){return S.add(4-S.isoWeekday(),n)},y=i.prototype;y.isoWeekYear=function(){return a(this).year()},y.isoWeek=function(S){if(!this.$utils().u(S))return this.add(7*(S-this.isoWeek()),n);var w,P,_,Y,X=a(this),B=(w=this.isoWeekYear(),P=this.$u,_=(P?s.utc:s)().year(w).startOf("year"),Y=4-_.isoWeekday(),_.isoWeekday()>4&&(Y+=7),_.add(Y,n));return X.diff(B,"week")+1},y.isoWeekday=function(S){return this.$utils().u(S)?this.day()||7:this.day(this.day()%7?S:S-7)};var F=y.startOf;y.startOf=function(S,w){var P=this.$utils(),_=!!P.u(w)||w;return P.p(S)==="isoweek"?_?this.date(this.date()-(this.isoWeekday()-1)).startOf("day"):this.date(this.date()-1-(this.isoWeekday()-1)+7).endOf("day"):F.bind(this)(S,w)}}}))})(jt)),jt.exports}var $i=Wi();const Oi=oe($i);var Qt={exports:{}},Hi=Qt.exports,tn;function Ni(){return tn||(tn=1,(function(t,e){(function(n,r){t.exports=r()})(Hi,(function(){var n={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},r=/(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|Q|YYYY|YY?|ww?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,i=/\d/,s=/\d\d/,a=/\d\d?/,y=/\d*[^-_:/,()\s\d]+/,F={},S=function(v){return(v=+v)+(v>68?1900:2e3)},w=function(v){return function(U){this[v]=+U}},P=[/[+-]\d\d:?(\d\d)?|Z/,function(v){(this.zone||(this.zone={})).offset=(function(U){if(!U||U==="Z")return 0;var R=U.match(/([+-]|\d\d)/g),E=60*R[1]+(+R[2]||0);return E===0?0:R[0]==="+"?-E:E})(v)}],_=function(v){var U=F[v];return U&&(U.indexOf?U:U.s.concat(U.f))},Y=function(v,U){var R,E=F.meridiem;if(E){for(var z=1;z<=24;z+=1)if(v.indexOf(E(z,0,U))>-1){R=z>12;break}}else R=v===(U?"pm":"PM");return R},X={A:[y,function(v){this.afternoon=Y(v,!1)}],a:[y,function(v){this.afternoon=Y(v,!0)}],Q:[i,function(v){this.month=3*(v-1)+1}],S:[i,function(v){this.milliseconds=100*+v}],SS:[s,function(v){this.milliseconds=10*+v}],SSS:[/\d{3}/,function(v){this.milliseconds=+v}],s:[a,w("seconds")],ss:[a,w("seconds")],m:[a,w("minutes")],mm:[a,w("minutes")],H:[a,w("hours")],h:[a,w("hours")],HH:[a,w("hours")],hh:[a,w("hours")],D:[a,w("day")],DD:[s,w("day")],Do:[y,function(v){var U=F.ordinal,R=v.match(/\d+/);if(this.day=R[0],U)for(var E=1;E<=31;E+=1)U(E).replace(/\[|\]/g,"")===v&&(this.day=E)}],w:[a,w("week")],ww:[s,w("week")],M:[a,w("month")],MM:[s,w("month")],MMM:[y,function(v){var U=_("months"),R=(_("monthsShort")||U.map((function(E){return E.slice(0,3)}))).indexOf(v)+1;if(R<1)throw new Error;this.month=R%12||R}],MMMM:[y,function(v){var U=_("months").indexOf(v)+1;if(U<1)throw new Error;this.month=U%12||U}],Y:[/[+-]?\d+/,w("year")],YY:[s,function(v){this.year=S(v)}],YYYY:[/\d{4}/,w("year")],Z:P,ZZ:P};function B(v){var U,R;U=v,R=F&&F.formats;for(var E=(v=U.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,(function(x,C,M){var D=M&&M.toUpperCase();return C||R[M]||n[M]||R[D].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,(function(c,g,b){return g||b.slice(1)}))}))).match(r),z=E.length,G=0;G<z;G+=1){var T=E[G],k=X[T],p=k&&k[0],L=k&&k[1];E[G]=L?{regex:p,parser:L}:T.replace(/^\[|\]$/g,"")}return function(x){for(var C={},M=0,D=0;M<z;M+=1){var c=E[M];if(typeof c=="string")D+=c.length;else{var g=c.regex,b=c.parser,m=x.slice(D),I=g.exec(m)[0];b.call(C,I),x=x.replace(I,"")}}return(function(o){var W=o.afternoon;if(W!==void 0){var u=o.hours;W?u<12&&(o.hours+=12):u===12&&(o.hours=0),delete o.afternoon}})(C),C}}return function(v,U,R){R.p.customParseFormat=!0,v&&v.parseTwoDigitYear&&(S=v.parseTwoDigitYear);var E=U.prototype,z=E.parse;E.parse=function(G){var T=G.date,k=G.utc,p=G.args;this.$u=k;var L=p[1];if(typeof L=="string"){var x=p[2]===!0,C=p[3]===!0,M=x||C,D=p[2];C&&(D=p[2]),F=this.$locale(),!x&&D&&(F=R.Ls[D]),this.$d=(function(m,I,o,W){try{if(["x","X"].indexOf(I)>-1)return new Date((I==="X"?1e3:1)*m);var u=B(I)(m),K=u.year,l=u.month,$=u.day,O=u.hours,j=u.minutes,H=u.seconds,J=u.milliseconds,h=u.zone,N=u.week,V=new Date,f=$||(K||l?1:V.getDate()),tt=K||V.getFullYear(),A=0;K&&!l||(A=l>0?l-1:V.getMonth());var Q,Z=O||0,st=j||0,at=H||0,pt=J||0;return h?new Date(Date.UTC(tt,A,f,Z,st,at,pt+60*h.offset*1e3)):o?new Date(Date.UTC(tt,A,f,Z,st,at,pt)):(Q=new Date(tt,A,f,Z,st,at,pt),N&&(Q=W(Q).week(N).toDate()),Q)}catch{return new Date("")}})(T,L,k,R),this.init(),D&&D!==!0&&(this.$L=this.locale(D).$L),M&&T!=this.format(L)&&(this.$d=new Date("")),F={}}else if(L instanceof Array)for(var c=L.length,g=1;g<=c;g+=1){p[1]=L[g-1];var b=R.apply(this,p);if(b.isValid()){this.$d=b.$d,this.$L=b.$L,this.init();break}g===c&&(this.$d=new Date(""))}else z.call(this,G)}}}))})(Qt)),Qt.exports}var Pi=Ni();const Vi=oe(Pi);var Jt={exports:{}},Ri=Jt.exports,en;function zi(){return en||(en=1,(function(t,e){(function(n,r){t.exports=r()})(Ri,(function(){return function(n,r){var i=r.prototype,s=i.format;i.format=function(a){var y=this,F=this.$locale();if(!this.isValid())return s.bind(this)(a);var S=this.$utils(),w=(a||"YYYY-MM-DDTHH:mm:ssZ").replace(/\[([^\]]+)]|Q|wo|ww|w|WW|W|zzz|z|gggg|GGGG|Do|X|x|k{1,2}|S/g,(function(P){switch(P){case"Q":return Math.ceil((y.$M+1)/3);case"Do":return F.ordinal(y.$D);case"gggg":return y.weekYear();case"GGGG":return y.isoWeekYear();case"wo":return F.ordinal(y.week(),"W");case"w":case"ww":return S.s(y.week(),P==="w"?1:2,"0");case"W":case"WW":return S.s(y.isoWeek(),P==="W"?1:2,"0");case"k":case"kk":return S.s(String(y.$H===0?24:y.$H),P==="k"?1:2,"0");case"X":return Math.floor(y.$d.getTime()/1e3);case"x":return y.$d.getTime();case"z":return"["+y.offsetName()+"]";case"zzz":return"["+y.offsetName("long")+"]";default:return P}}));return s.bind(this)(w)}}}))})(Jt)),Jt.exports}var qi=zi();const Bi=oe(qi);var Kt={exports:{}},Zi=Kt.exports,nn;function Xi(){return nn||(nn=1,(function(t,e){(function(n,r){t.exports=r()})(Zi,(function(){var n,r,i=1e3,s=6e4,a=36e5,y=864e5,F=31536e6,S=2628e6,w=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/,P=/\[([^\]]+)]|YYYY|YY|Y|M{1,2}|D{1,2}|H{1,2}|m{1,2}|s{1,2}|SSS/g,_={years:F,months:S,days:y,hours:a,minutes:s,seconds:i,milliseconds:1,weeks:6048e5},Y=function(T){return T instanceof z},X=function(T,k,p){return new z(T,p,k.$l)},B=function(T){return r.p(T)+"s"},v=function(T){return T<0},U=function(T){return v(T)?Math.ceil(T):Math.floor(T)},R=function(T){return Math.abs(T)},E=function(T,k){return T?v(T)?{negative:!0,format:""+R(T)+k}:{negative:!1,format:""+T+k}:{negative:!1,format:""}},z=(function(){function T(p,L,x){var C=this;if(this.$d={},this.$l=x,p===void 0&&(this.$ms=0,this.parseFromMilliseconds()),L)return X(p*_[B(L)],this);if(typeof p=="number")return this.$ms=p,this.parseFromMilliseconds(),this;if(typeof p=="object")return Object.keys(p).forEach((function(c){C.$d[B(c)]=p[c]})),this.calMilliseconds(),this;if(typeof p=="string"){var M=p.match(w);if(M){var D=M.slice(2).map((function(c){return c!=null?Number(c):0}));return this.$d.years=D[0],this.$d.months=D[1],this.$d.weeks=D[2],this.$d.days=D[3],this.$d.hours=D[4],this.$d.minutes=D[5],this.$d.seconds=D[6],this.calMilliseconds(),this}}return this}var k=T.prototype;return k.calMilliseconds=function(){var p=this;this.$ms=Object.keys(this.$d).reduce((function(L,x){return L+(p.$d[x]||0)*_[x]}),0)},k.parseFromMilliseconds=function(){var p=this.$ms;this.$d.years=U(p/F),p%=F,this.$d.months=U(p/S),p%=S,this.$d.days=U(p/y),p%=y,this.$d.hours=U(p/a),p%=a,this.$d.minutes=U(p/s),p%=s,this.$d.seconds=U(p/i),p%=i,this.$d.milliseconds=p},k.toISOString=function(){var p=E(this.$d.years,"Y"),L=E(this.$d.months,"M"),x=+this.$d.days||0;this.$d.weeks&&(x+=7*this.$d.weeks);var C=E(x,"D"),M=E(this.$d.hours,"H"),D=E(this.$d.minutes,"M"),c=this.$d.seconds||0;this.$d.milliseconds&&(c+=this.$d.milliseconds/1e3,c=Math.round(1e3*c)/1e3);var g=E(c,"S"),b=p.negative||L.negative||C.negative||M.negative||D.negative||g.negative,m=M.format||D.format||g.format?"T":"",I=(b?"-":"")+"P"+p.format+L.format+C.format+m+M.format+D.format+g.format;return I==="P"||I==="-P"?"P0D":I},k.toJSON=function(){return this.toISOString()},k.format=function(p){var L=p||"YYYY-MM-DDTHH:mm:ss",x={Y:this.$d.years,YY:r.s(this.$d.years,2,"0"),YYYY:r.s(this.$d.years,4,"0"),M:this.$d.months,MM:r.s(this.$d.months,2,"0"),D:this.$d.days,DD:r.s(this.$d.days,2,"0"),H:this.$d.hours,HH:r.s(this.$d.hours,2,"0"),m:this.$d.minutes,mm:r.s(this.$d.minutes,2,"0"),s:this.$d.seconds,ss:r.s(this.$d.seconds,2,"0"),SSS:r.s(this.$d.milliseconds,3,"0")};return L.replace(P,(function(C,M){return M||String(x[C])}))},k.as=function(p){return this.$ms/_[B(p)]},k.get=function(p){var L=this.$ms,x=B(p);return x==="milliseconds"?L%=1e3:L=x==="weeks"?U(L/_[x]):this.$d[x],L||0},k.add=function(p,L,x){var C;return C=L?p*_[B(L)]:Y(p)?p.$ms:X(p,this).$ms,X(this.$ms+C*(x?-1:1),this)},k.subtract=function(p,L){return this.add(p,L,!0)},k.locale=function(p){var L=this.clone();return L.$l=p,L},k.clone=function(){return X(this.$ms,this)},k.humanize=function(p){return n().add(this.$ms,"ms").locale(this.$l).fromNow(!p)},k.valueOf=function(){return this.asMilliseconds()},k.milliseconds=function(){return this.get("milliseconds")},k.asMilliseconds=function(){return this.as("milliseconds")},k.seconds=function(){return this.get("seconds")},k.asSeconds=function(){return this.as("seconds")},k.minutes=function(){return this.get("minutes")},k.asMinutes=function(){return this.as("minutes")},k.hours=function(){return this.get("hours")},k.asHours=function(){return this.as("hours")},k.days=function(){return this.get("days")},k.asDays=function(){return this.as("days")},k.weeks=function(){return this.get("weeks")},k.asWeeks=function(){return this.as("weeks")},k.months=function(){return this.get("months")},k.asMonths=function(){return this.as("months")},k.years=function(){return this.get("years")},k.asYears=function(){return this.as("years")},T})(),G=function(T,k,p){return T.add(k.years()*p,"y").add(k.months()*p,"M").add(k.days()*p,"d").add(k.hours()*p,"h").add(k.minutes()*p,"m").add(k.seconds()*p,"s").add(k.milliseconds()*p,"ms")};return function(T,k,p){n=p,r=p().$utils(),p.duration=function(C,M){var D=p.locale();return X(C,{$l:D},M)},p.isDuration=Y;var L=k.prototype.add,x=k.prototype.subtract;k.prototype.add=function(C,M){return Y(C)?G(this,C,1):L.bind(this)(C,M)},k.prototype.subtract=function(C,M){return Y(C)?G(this,C,-1):x.bind(this)(C,M)}}}))})(Kt)),Kt.exports}var Gi=Xi();const ji=oe(Gi);var we=(function(){var t=d(function(D,c,g,b){for(g=g||{},b=D.length;b--;g[D[b]]=c);return g},"o"),e=[6,8,10,12,13,14,15,16,17,18,20,21,22,23,24,25,26,27,28,29,30,31,33,35,36,38,40],n=[1,26],r=[1,27],i=[1,28],s=[1,29],a=[1,30],y=[1,31],F=[1,32],S=[1,33],w=[1,34],P=[1,9],_=[1,10],Y=[1,11],X=[1,12],B=[1,13],v=[1,14],U=[1,15],R=[1,16],E=[1,19],z=[1,20],G=[1,21],T=[1,22],k=[1,23],p=[1,25],L=[1,35],x={trace:d(function(){},"trace"),yy:{},symbols_:{error:2,start:3,gantt:4,document:5,EOF:6,line:7,SPACE:8,statement:9,NL:10,weekday:11,weekday_monday:12,weekday_tuesday:13,weekday_wednesday:14,weekday_thursday:15,weekday_friday:16,weekday_saturday:17,weekday_sunday:18,weekend:19,weekend_friday:20,weekend_saturday:21,dateFormat:22,inclusiveEndDates:23,topAxis:24,axisFormat:25,tickInterval:26,excludes:27,includes:28,todayMarker:29,title:30,acc_title:31,acc_title_value:32,acc_descr:33,acc_descr_value:34,acc_descr_multiline_value:35,section:36,clickStatement:37,taskTxt:38,taskData:39,click:40,callbackname:41,callbackargs:42,href:43,clickStatementDebug:44,$accept:0,$end:1},terminals_:{2:"error",4:"gantt",6:"EOF",8:"SPACE",10:"NL",12:"weekday_monday",13:"weekday_tuesday",14:"weekday_wednesday",15:"weekday_thursday",16:"weekday_friday",17:"weekday_saturday",18:"weekday_sunday",20:"weekend_friday",21:"weekend_saturday",22:"dateFormat",23:"inclusiveEndDates",24:"topAxis",25:"axisFormat",26:"tickInterval",27:"excludes",28:"includes",29:"todayMarker",30:"title",31:"acc_title",32:"acc_title_value",33:"acc_descr",34:"acc_descr_value",35:"acc_descr_multiline_value",36:"section",38:"taskTxt",39:"taskData",40:"click",41:"callbackname",42:"callbackargs",43:"href"},productions_:[0,[3,3],[5,0],[5,2],[7,2],[7,1],[7,1],[7,1],[11,1],[11,1],[11,1],[11,1],[11,1],[11,1],[11,1],[19,1],[19,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,2],[9,2],[9,1],[9,1],[9,1],[9,2],[37,2],[37,3],[37,3],[37,4],[37,3],[37,4],[37,2],[44,2],[44,3],[44,3],[44,4],[44,3],[44,4],[44,2]],performAction:d(function(c,g,b,m,I,o,W){var u=o.length-1;switch(I){case 1:return o[u-1];case 2:this.$=[];break;case 3:o[u-1].push(o[u]),this.$=o[u-1];break;case 4:case 5:this.$=o[u];break;case 6:case 7:this.$=[];break;case 8:m.setWeekday("monday");break;case 9:m.setWeekday("tuesday");break;case 10:m.setWeekday("wednesday");break;case 11:m.setWeekday("thursday");break;case 12:m.setWeekday("friday");break;case 13:m.setWeekday("saturday");break;case 14:m.setWeekday("sunday");break;case 15:m.setWeekend("friday");break;case 16:m.setWeekend("saturday");break;case 17:m.setDateFormat(o[u].substr(11)),this.$=o[u].substr(11);break;case 18:m.enableInclusiveEndDates(),this.$=o[u].substr(18);break;case 19:m.TopAxis(),this.$=o[u].substr(8);break;case 20:m.setAxisFormat(o[u].substr(11)),this.$=o[u].substr(11);break;case 21:m.setTickInterval(o[u].substr(13)),this.$=o[u].substr(13);break;case 22:m.setExcludes(o[u].substr(9)),this.$=o[u].substr(9);break;case 23:m.setIncludes(o[u].substr(9)),this.$=o[u].substr(9);break;case 24:m.setTodayMarker(o[u].substr(12)),this.$=o[u].substr(12);break;case 27:m.setDiagramTitle(o[u].substr(6)),this.$=o[u].substr(6);break;case 28:this.$=o[u].trim(),m.setAccTitle(this.$);break;case 29:case 30:this.$=o[u].trim(),m.setAccDescription(this.$);break;case 31:m.addSection(o[u].substr(8)),this.$=o[u].substr(8);break;case 33:m.addTask(o[u-1],o[u]),this.$="task";break;case 34:this.$=o[u-1],m.setClickEvent(o[u-1],o[u],null);break;case 35:this.$=o[u-2],m.setClickEvent(o[u-2],o[u-1],o[u]);break;case 36:this.$=o[u-2],m.setClickEvent(o[u-2],o[u-1],null),m.setLink(o[u-2],o[u]);break;case 37:this.$=o[u-3],m.setClickEvent(o[u-3],o[u-2],o[u-1]),m.setLink(o[u-3],o[u]);break;case 38:this.$=o[u-2],m.setClickEvent(o[u-2],o[u],null),m.setLink(o[u-2],o[u-1]);break;case 39:this.$=o[u-3],m.setClickEvent(o[u-3],o[u-1],o[u]),m.setLink(o[u-3],o[u-2]);break;case 40:this.$=o[u-1],m.setLink(o[u-1],o[u]);break;case 41:case 47:this.$=o[u-1]+" "+o[u];break;case 42:case 43:case 45:this.$=o[u-2]+" "+o[u-1]+" "+o[u];break;case 44:case 46:this.$=o[u-3]+" "+o[u-2]+" "+o[u-1]+" "+o[u];break}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},t(e,[2,2],{5:3}),{6:[1,4],7:5,8:[1,6],9:7,10:[1,8],11:17,12:n,13:r,14:i,15:s,16:a,17:y,18:F,19:18,20:S,21:w,22:P,23:_,24:Y,25:X,26:B,27:v,28:U,29:R,30:E,31:z,33:G,35:T,36:k,37:24,38:p,40:L},t(e,[2,7],{1:[2,1]}),t(e,[2,3]),{9:36,11:17,12:n,13:r,14:i,15:s,16:a,17:y,18:F,19:18,20:S,21:w,22:P,23:_,24:Y,25:X,26:B,27:v,28:U,29:R,30:E,31:z,33:G,35:T,36:k,37:24,38:p,40:L},t(e,[2,5]),t(e,[2,6]),t(e,[2,17]),t(e,[2,18]),t(e,[2,19]),t(e,[2,20]),t(e,[2,21]),t(e,[2,22]),t(e,[2,23]),t(e,[2,24]),t(e,[2,25]),t(e,[2,26]),t(e,[2,27]),{32:[1,37]},{34:[1,38]},t(e,[2,30]),t(e,[2,31]),t(e,[2,32]),{39:[1,39]},t(e,[2,8]),t(e,[2,9]),t(e,[2,10]),t(e,[2,11]),t(e,[2,12]),t(e,[2,13]),t(e,[2,14]),t(e,[2,15]),t(e,[2,16]),{41:[1,40],43:[1,41]},t(e,[2,4]),t(e,[2,28]),t(e,[2,29]),t(e,[2,33]),t(e,[2,34],{42:[1,42],43:[1,43]}),t(e,[2,40],{41:[1,44]}),t(e,[2,35],{43:[1,45]}),t(e,[2,36]),t(e,[2,38],{42:[1,46]}),t(e,[2,37]),t(e,[2,39])],defaultActions:{},parseError:d(function(c,g){if(g.recoverable)this.trace(c);else{var b=new Error(c);throw b.hash=g,b}},"parseError"),parse:d(function(c){var g=this,b=[0],m=[],I=[null],o=[],W=this.table,u="",K=0,l=0,$=2,O=1,j=o.slice.call(arguments,1),H=Object.create(this.lexer),J={yy:{}};for(var h in this.yy)Object.prototype.hasOwnProperty.call(this.yy,h)&&(J.yy[h]=this.yy[h]);H.setInput(c,J.yy),J.yy.lexer=H,J.yy.parser=this,typeof H.yylloc>"u"&&(H.yylloc={});var N=H.yylloc;o.push(N);var V=H.options&&H.options.ranges;typeof J.yy.parseError=="function"?this.parseError=J.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function f(ot){b.length=b.length-2*ot,I.length=I.length-ot,o.length=o.length-ot}d(f,"popStack");function tt(){var ot;return ot=m.pop()||H.lex()||O,typeof ot!="number"&&(ot instanceof Array&&(m=ot,ot=m.pop()),ot=g.symbols_[ot]||ot),ot}d(tt,"lex");for(var A,Q,Z,st,at={},pt,ut,He,Bt;;){if(Q=b[b.length-1],this.defaultActions[Q]?Z=this.defaultActions[Q]:((A===null||typeof A>"u")&&(A=tt()),Z=W[Q]&&W[Q][A]),typeof Z>"u"||!Z.length||!Z[0]){var ce="";Bt=[];for(pt in W[Q])this.terminals_[pt]&&pt>$&&Bt.push("'"+this.terminals_[pt]+"'");H.showPosition?ce="Parse error on line "+(K+1)+`:
2
2
  `+H.showPosition()+`
3
3
  Expecting `+Bt.join(", ")+", got '"+(this.terminals_[A]||A)+"'":ce="Parse error on line "+(K+1)+": Unexpected "+(A==O?"end of input":"'"+(this.terminals_[A]||A)+"'"),this.parseError(ce,{text:H.match,token:this.terminals_[A]||A,line:H.yylineno,loc:N,expected:Bt})}if(Z[0]instanceof Array&&Z.length>1)throw new Error("Parse Error: multiple actions possible at state: "+Q+", token: "+A);switch(Z[0]){case 1:b.push(A),I.push(H.yytext),o.push(H.yylloc),b.push(Z[1]),A=null,l=H.yyleng,u=H.yytext,K=H.yylineno,N=H.yylloc;break;case 2:if(ut=this.productions_[Z[1]][1],at.$=I[I.length-ut],at._$={first_line:o[o.length-(ut||1)].first_line,last_line:o[o.length-1].last_line,first_column:o[o.length-(ut||1)].first_column,last_column:o[o.length-1].last_column},V&&(at._$.range=[o[o.length-(ut||1)].range[0],o[o.length-1].range[1]]),st=this.performAction.apply(at,[u,l,K,J.yy,Z[1],I,o].concat(j)),typeof st<"u")return st;ut&&(b=b.slice(0,-1*ut*2),I=I.slice(0,-1*ut),o=o.slice(0,-1*ut)),b.push(this.productions_[Z[1]][0]),I.push(at.$),o.push(at._$),He=W[b[b.length-2]][b[b.length-1]],b.push(He);break;case 3:return!0}}return!0},"parse")},C=(function(){var D={EOF:1,parseError:d(function(g,b){if(this.yy.parser)this.yy.parser.parseError(g,b);else throw new Error(g)},"parseError"),setInput:d(function(c,g){return this.yy=g||this.yy||{},this._input=c,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:d(function(){var c=this._input[0];this.yytext+=c,this.yyleng++,this.offset++,this.match+=c,this.matched+=c;var g=c.match(/(?:\r\n?|\n).*/g);return g?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),c},"input"),unput:d(function(c){var g=c.length,b=c.split(/(?:\r\n?|\n)/g);this._input=c+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-g),this.offset-=g;var m=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),b.length-1&&(this.yylineno-=b.length-1);var I=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:b?(b.length===m.length?this.yylloc.first_column:0)+m[m.length-b.length].length-b[0].length:this.yylloc.first_column-g},this.options.ranges&&(this.yylloc.range=[I[0],I[0]+this.yyleng-g]),this.yyleng=this.yytext.length,this},"unput"),more:d(function(){return this._more=!0,this},"more"),reject:d(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
4
4
  `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:d(function(c){this.unput(this.match.slice(c))},"less"),pastInput:d(function(){var c=this.matched.substr(0,this.matched.length-this.match.length);return(c.length>20?"...":"")+c.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:d(function(){var c=this.match;return c.length<20&&(c+=this._input.substr(0,20-c.length)),(c.substr(0,20)+(c.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:d(function(){var c=this.pastInput(),g=new Array(c.length+1).join("-");return c+this.upcomingInput()+`
@@ -1,4 +1,4 @@
1
- import{I as he}from"./chunk-2Q5K7J3B-adR2VoGA.js";import{p as $e}from"./chunk-JWPE2WC7-DBQlYiWn.js";import{p as fe,o as ge,s as ue,g as ye,a as xe,b as me,_ as $,z as Q,l as k,d as pe,c as z,y as be,A as we,q as ke,k as L,B as ve,D as Ee,E as Be}from"./mermaid.core-EY9hyXLz.js";import{p as Ce}from"./cynefin-VYW2F7L2-BUxR220i.js";import"./main-m3NNcAo4.js";import"./vendor-react--Eh9ivFN.js";import"./vendor-three-CBPuP1jE.js";var p={NORMAL:0,REVERSE:1,HIGHLIGHT:2,MERGE:3,CHERRY_PICK:4},Te=Ee.gitGraph,D=$(()=>ve({...Te,...Q().gitGraph}),"getConfig"),i=new he(()=>{const e=D(),r=e.mainBranchName,t=e.mainBranchOrder;return{mainBranchName:r,commits:new Map,head:null,branchConfig:new Map([[r,{name:r,order:t}]]),branches:new Map([[r,null]]),currBranch:r,direction:"LR",seq:0,options:{}}});function K(){return Be({length:7})}$(K,"getID");function ae(e,r){const t=Object.create(null);return e.reduce((o,s)=>{const d=r(s);return t[d]||(t[d]=!0,o.push(s)),o},[])}$(ae,"uniqBy");var Le=$(function(e){i.records.direction=e},"setDirection"),Me=$(function(e){k.debug("options str",e),e=e==null?void 0:e.trim(),e=e||"{}";try{i.records.options=JSON.parse(e)}catch(r){k.error("error while parsing gitGraph options",r.message)}},"setOptions"),Re=$(function(){return i.records.options},"getOptions"),Ie=$(function(e){let r=e.msg,t=e.id;const o=e.type;let s=e.tags;k.info("commit",r,t,o,s),k.debug("Entering commit:",r,t,o,s);const d=D();t=L.sanitizeText(t,d),r=L.sanitizeText(r,d),s=s==null?void 0:s.map(a=>L.sanitizeText(a,d));const n={id:t||i.records.seq+"-"+K(),message:r,seq:i.records.seq++,type:o??p.NORMAL,tags:s??[],parents:i.records.head==null?[]:[i.records.head.id],branch:i.records.currBranch};i.records.head=n,k.info("main branch",d.mainBranchName),i.records.commits.has(n.id)&&k.warn(`Commit ID ${n.id} already exists`),i.records.commits.set(n.id,n),i.records.branches.set(i.records.currBranch,n.id),k.debug("in pushCommit "+n.id)},"commit"),Oe=$(function(e){let r=e.name;const t=e.order;if(r=L.sanitizeText(r,D()),i.records.branches.has(r))throw new Error(`Trying to create an existing branch. (Help: Either use a new name if you want create a new branch or try using "checkout ${r}")`);i.records.branches.set(r,i.records.head!=null?i.records.head.id:null),i.records.branchConfig.set(r,{name:r,order:t}),ne(r),k.debug("in createBranch")},"branch"),_e=$(e=>{let r=e.branch,t=e.id;const o=e.type,s=e.tags,d=D();r=L.sanitizeText(r,d),t&&(t=L.sanitizeText(t,d));const n=i.records.branches.get(i.records.currBranch),a=i.records.branches.get(r),l=n?i.records.commits.get(n):void 0,h=a?i.records.commits.get(a):void 0;if(l&&h&&l.branch===r)throw new Error(`Cannot merge branch '${r}' into itself.`);if(i.records.currBranch===r){const c=new Error('Incorrect usage of "merge". Cannot merge a branch to itself');throw c.hash={text:`merge ${r}`,token:`merge ${r}`,expected:["branch abc"]},c}if(l===void 0||!l){const c=new Error(`Incorrect usage of "merge". Current branch (${i.records.currBranch})has no commits`);throw c.hash={text:`merge ${r}`,token:`merge ${r}`,expected:["commit"]},c}if(!i.records.branches.has(r)){const c=new Error('Incorrect usage of "merge". Branch to be merged ('+r+") does not exist");throw c.hash={text:`merge ${r}`,token:`merge ${r}`,expected:[`branch ${r}`]},c}if(h===void 0||!h){const c=new Error('Incorrect usage of "merge". Branch to be merged ('+r+") has no commits");throw c.hash={text:`merge ${r}`,token:`merge ${r}`,expected:['"commit"']},c}if(l===h){const c=new Error('Incorrect usage of "merge". Both branches have same head');throw c.hash={text:`merge ${r}`,token:`merge ${r}`,expected:["branch abc"]},c}if(t&&i.records.commits.has(t)){const c=new Error('Incorrect usage of "merge". Commit with id:'+t+" already exists, use different custom id");throw c.hash={text:`merge ${r} ${t} ${o} ${s==null?void 0:s.join(" ")}`,token:`merge ${r} ${t} ${o} ${s==null?void 0:s.join(" ")}`,expected:[`merge ${r} ${t}_UNIQUE ${o} ${s==null?void 0:s.join(" ")}`]},c}const g=a||"",f={id:t||`${i.records.seq}-${K()}`,message:`merged branch ${r} into ${i.records.currBranch}`,seq:i.records.seq++,parents:i.records.head==null?[]:[i.records.head.id,g],branch:i.records.currBranch,type:p.MERGE,customType:o,customId:!!t,tags:s??[]};i.records.head=f,i.records.commits.set(f.id,f),i.records.branches.set(i.records.currBranch,f.id),k.debug(i.records.branches),k.debug("in mergeBranch")},"merge"),Ge=$(function(e){let r=e.id,t=e.targetId,o=e.tags,s=e.parent;k.debug("Entering cherryPick:",r,t,o);const d=D();if(r=L.sanitizeText(r,d),t=L.sanitizeText(t,d),o=o==null?void 0:o.map(l=>L.sanitizeText(l,d)),s=L.sanitizeText(s,d),!r||!i.records.commits.has(r)){const l=new Error('Incorrect usage of "cherryPick". Source commit id should exist and provided');throw l.hash={text:`cherryPick ${r} ${t}`,token:`cherryPick ${r} ${t}`,expected:["cherry-pick abc"]},l}const n=i.records.commits.get(r);if(n===void 0||!n)throw new Error('Incorrect usage of "cherryPick". Source commit id should exist and provided');if(s&&!(Array.isArray(n.parents)&&n.parents.includes(s)))throw new Error("Invalid operation: The specified parent commit is not an immediate parent of the cherry-picked commit.");const a=n.branch;if(n.type===p.MERGE&&!s)throw new Error("Incorrect usage of cherry-pick: If the source commit is a merge commit, an immediate parent commit must be specified.");if(!t||!i.records.commits.has(t)){if(a===i.records.currBranch){const f=new Error('Incorrect usage of "cherryPick". Source commit is already on current branch');throw f.hash={text:`cherryPick ${r} ${t}`,token:`cherryPick ${r} ${t}`,expected:["cherry-pick abc"]},f}const l=i.records.branches.get(i.records.currBranch);if(l===void 0||!l){const f=new Error(`Incorrect usage of "cherry-pick". Current branch (${i.records.currBranch})has no commits`);throw f.hash={text:`cherryPick ${r} ${t}`,token:`cherryPick ${r} ${t}`,expected:["cherry-pick abc"]},f}const h=i.records.commits.get(l);if(h===void 0||!h){const f=new Error(`Incorrect usage of "cherry-pick". Current branch (${i.records.currBranch})has no commits`);throw f.hash={text:`cherryPick ${r} ${t}`,token:`cherryPick ${r} ${t}`,expected:["cherry-pick abc"]},f}const g={id:i.records.seq+"-"+K(),message:`cherry-picked ${n==null?void 0:n.message} into ${i.records.currBranch}`,seq:i.records.seq++,parents:i.records.head==null?[]:[i.records.head.id,n.id],branch:i.records.currBranch,type:p.CHERRY_PICK,tags:o?o.filter(Boolean):[`cherry-pick:${n.id}${n.type===p.MERGE?`|parent:${s}`:""}`]};i.records.head=g,i.records.commits.set(g.id,g),i.records.branches.set(i.records.currBranch,g.id),k.debug(i.records.branches),k.debug("in cherryPick")}},"cherryPick"),ne=$(function(e){if(e=L.sanitizeText(e,D()),i.records.branches.has(e)){i.records.currBranch=e;const r=i.records.branches.get(i.records.currBranch);r===void 0||!r?i.records.head=null:i.records.head=i.records.commits.get(r)??null}else{const r=new Error(`Trying to checkout branch which is not yet created. (Help try using "branch ${e}")`);throw r.hash={text:`checkout ${e}`,token:`checkout ${e}`,expected:[`branch ${e}`]},r}},"checkout");function X(e,r,t){const o=e.indexOf(r);o===-1?e.push(t):e.splice(o,1,t)}$(X,"upsert");function Z(e){const r=e.reduce((s,d)=>s.seq>d.seq?s:d,e[0]);let t="";e.forEach(function(s){s===r?t+=" *":t+=" |"});const o=[t,r.id,r.seq];for(const s in i.records.branches)i.records.branches.get(s)===r.id&&o.push(s);if(k.debug(o.join(" ")),r.parents&&r.parents.length==2&&r.parents[0]&&r.parents[1]){const s=i.records.commits.get(r.parents[0]);X(e,r,s),r.parents[1]&&e.push(i.records.commits.get(r.parents[1]))}else{if(r.parents.length==0)return;if(r.parents[0]){const s=i.records.commits.get(r.parents[0]);X(e,r,s)}}e=ae(e,s=>s.id),Z(e)}$(Z,"prettyPrintCommitHistory");var He=$(function(){k.debug(i.records.commits);const e=se()[0];Z([e])},"prettyPrint"),Ae=$(function(){i.reset(),ke()},"clear"),Se=$(function(){return[...i.records.branchConfig.values()].map((r,t)=>r.order!==null&&r.order!==void 0?r:{...r,order:parseFloat(`0.${t}`)}).sort((r,t)=>(r.order??0)-(t.order??0)).map(({name:r})=>({name:r}))},"getBranchesAsObjArray"),De=$(function(){return i.records.branches},"getBranches"),qe=$(function(){return i.records.commits},"getCommits"),se=$(function(){const e=[...i.records.commits.values()];return e.forEach(function(r){k.debug(r.id)}),e.sort((r,t)=>r.seq-t.seq),e},"getCommitsArray"),Pe=$(function(){return i.records.currBranch},"getCurrentBranch"),We=$(function(){return i.records.direction},"getDirection"),Ne=$(function(){return i.records.head},"getHead"),oe={commitType:p,getConfig:D,setDirection:Le,setOptions:Me,getOptions:Re,commit:Ie,branch:Oe,merge:_e,cherryPick:Ge,checkout:ne,prettyPrint:He,clear:Ae,getBranchesAsObjArray:Se,getBranches:De,getCommits:qe,getCommitsArray:se,getCurrentBranch:Pe,getDirection:We,getHead:Ne,setAccTitle:me,getAccTitle:xe,getAccDescription:ye,setAccDescription:ue,setDiagramTitle:ge,getDiagramTitle:fe},Fe=$((e,r)=>{$e(e,r),e.dir&&r.setDirection(e.dir);for(const t of e.statements)ze(t,r)},"populate"),ze=$((e,r)=>{const o={Commit:$(s=>r.commit(Ye(s)),"Commit"),Branch:$(s=>r.branch(je(s)),"Branch"),Merge:$(s=>r.merge(Ue(s)),"Merge"),Checkout:$(s=>r.checkout(Ke(s)),"Checkout"),CherryPicking:$(s=>r.cherryPick(Ve(s)),"CherryPicking")}[e.$type];o?o(e):k.error(`Unknown statement type: ${e.$type}`)},"parseStatement"),Ye=$(e=>({id:e.id,msg:e.message??"",type:e.type!==void 0?p[e.type]:p.NORMAL,tags:e.tags??void 0}),"parseCommit"),je=$(e=>({name:e.name,order:e.order??0}),"parseBranch"),Ue=$(e=>({branch:e.branch,id:e.id??"",type:e.type!==void 0?p[e.type]:void 0,tags:e.tags??void 0}),"parseMerge"),Ke=$(e=>e.branch,"parseCheckout"),Ve=$(e=>{var t;return{id:e.id,targetId:"",tags:((t=e.tags)==null?void 0:t.length)===0?void 0:e.tags,parent:e.parent}},"parseCherryPicking"),Xe={parse:$(async e=>{const r=await Ce("gitGraph",e);k.debug(r),Fe(r,oe)},"parse")},G=10,H=40,M=4,I=2,A=8,V=new Set(["redux","redux-dark","redux-color","redux-dark-color"]),J=12,ee=new Set(["redux-color","redux-dark-color"]),Je=new Set(["dark","redux-dark","redux-dark-color","neo-dark"]),S=$((e,r,t=!1)=>t&&e>0?(e-1)%(r-1)+1:e%r,"calcColorIndex"),C=new Map,T=new Map,j=30,N=new Map,U=[],O=0,y="LR",Qe=$(()=>{C.clear(),T.clear(),N.clear(),O=0,U=[],y="LR"},"clear"),ce=$(e=>{const r=document.createElementNS("http://www.w3.org/2000/svg","text");return(typeof e=="string"?e.split(/\\n|\n|<br\s*\/?>/gi):e).forEach(o=>{const s=document.createElementNS("http://www.w3.org/2000/svg","tspan");s.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve"),s.setAttribute("dy","1em"),s.setAttribute("x","0"),s.setAttribute("class","row"),s.textContent=o.trim(),r.appendChild(s)}),r},"drawText"),ie=$(e=>{let r,t,o;return y==="BT"?(t=$((s,d)=>s<=d,"comparisonFunc"),o=1/0):(t=$((s,d)=>s>=d,"comparisonFunc"),o=0),e.forEach(s=>{var n,a;const d=y==="TB"||y=="BT"?(n=T.get(s))==null?void 0:n.y:(a=T.get(s))==null?void 0:a.x;d!==void 0&&t(d,o)&&(r=s,o=d)}),r},"findClosestParent"),Ze=$(e=>{let r="",t=1/0;return e.forEach(o=>{const s=T.get(o).y;s<=t&&(r=o,t=s)}),r||void 0},"findClosestParentBT"),er=$((e,r,t)=>{let o=t,s=t;const d=[];e.forEach(n=>{const a=r.get(n);if(!a)throw new Error(`Commit not found for key ${n}`);a.parents.length?(o=tr(a),s=Math.max(o,s)):d.push(a),ar(a,o)}),o=s,d.forEach(n=>{nr(n,o,t)}),e.forEach(n=>{const a=r.get(n);if(a!=null&&a.parents.length){const l=Ze(a.parents);o=T.get(l).y-H,o<=s&&(s=o);const h=C.get(a.branch).pos,g=o-G;T.set(a.id,{x:h,y:g})}})},"setParallelBTPos"),rr=$(e=>{var o;const r=ie(e.parents.filter(s=>s!==null));if(!r)throw new Error(`Closest parent not found for commit ${e.id}`);const t=(o=T.get(r))==null?void 0:o.y;if(t===void 0)throw new Error(`Closest parent position not found for commit ${e.id}`);return t},"findClosestParentPos"),tr=$(e=>rr(e)+H,"calculateCommitPosition"),ar=$((e,r)=>{const t=C.get(e.branch);if(!t)throw new Error(`Branch not found for commit ${e.id}`);const o=t.pos,s=r+G;return T.set(e.id,{x:o,y:s}),{x:o,y:s}},"setCommitPosition"),nr=$((e,r,t)=>{const o=C.get(e.branch);if(!o)throw new Error(`Branch not found for commit ${e.id}`);const s=r+t,d=o.pos;T.set(e.id,{x:d,y:s})},"setRootPosition"),sr=$((e,r,t,o,s,d)=>{const{theme:n}=z(),a=V.has(n??""),l=ee.has(n??""),h=Je.has(n??"");if(d===p.HIGHLIGHT)e.append("rect").attr("x",t.x-10+(a?3:0)).attr("y",t.y-10+(a?3:0)).attr("width",a?14:20).attr("height",a?14:20).attr("class",`commit ${r.id} commit-highlight${S(s,A,l)} ${o}-outer`),e.append("rect").attr("x",t.x-6+(a?2:0)).attr("y",t.y-6+(a?2:0)).attr("width",a?8:12).attr("height",a?8:12).attr("class",`commit ${r.id} commit${S(s,A,l)} ${o}-inner`);else if(d===p.CHERRY_PICK)e.append("circle").attr("cx",t.x).attr("cy",t.y).attr("r",a?7:10).attr("class",`commit ${r.id} ${o}`),e.append("circle").attr("cx",t.x-3).attr("cy",t.y+2).attr("r",a?2.5:2.75).attr("fill",h?"#000000":"#fff").attr("class",`commit ${r.id} ${o}`),e.append("circle").attr("cx",t.x+3).attr("cy",t.y+2).attr("r",a?2.5:2.75).attr("fill",h?"#000000":"#fff").attr("class",`commit ${r.id} ${o}`),e.append("line").attr("x1",t.x+3).attr("y1",t.y+1).attr("x2",t.x).attr("y2",t.y-5).attr("stroke",h?"#000000":"#fff").attr("class",`commit ${r.id} ${o}`),e.append("line").attr("x1",t.x-3).attr("y1",t.y+1).attr("x2",t.x).attr("y2",t.y-5).attr("stroke",h?"#000000":"#fff").attr("class",`commit ${r.id} ${o}`);else{const g=e.append("circle");if(g.attr("cx",t.x),g.attr("cy",t.y),g.attr("r",a?7:10),g.attr("class",`commit ${r.id} commit${S(s,A,l)}`),d===p.MERGE){const f=e.append("circle");f.attr("cx",t.x),f.attr("cy",t.y),f.attr("r",a?5:6),f.attr("class",`commit ${o} ${r.id} commit${S(s,A,l)}`)}if(d===p.REVERSE){const f=e.append("path"),c=a?4:5;f.attr("d",`M ${t.x-c},${t.y-c}L${t.x+c},${t.y+c}M${t.x-c},${t.y+c}L${t.x+c},${t.y-c}`).attr("class",`commit ${o} ${r.id} commit${S(s,A,l)}`)}}},"drawCommitBullet"),or=$((e,r,t,o,s)=>{var d;if(r.type!==p.CHERRY_PICK&&(r.customId&&r.type===p.MERGE||r.type!==p.MERGE)&&s.showCommitLabel){const n=e.append("g"),a=n.insert("rect").attr("class","commit-label-bkg"),l=n.append("text").attr("x",o).attr("y",t.y+25).attr("class","commit-label").text(r.id),h=(d=l.node())==null?void 0:d.getBBox();if(h&&(a.attr("x",t.posWithOffset-h.width/2-I).attr("y",t.y+13.5).attr("width",h.width+2*I).attr("height",h.height+2*I),y==="TB"||y==="BT"?(a.attr("x",t.x-(h.width+4*M+5)).attr("y",t.y-12),l.attr("x",t.x-(h.width+4*M)).attr("y",t.y+h.height-12)):l.attr("x",t.posWithOffset-h.width/2),s.rotateCommitLabel))if(y==="TB"||y==="BT")l.attr("transform","rotate(-45, "+t.x+", "+t.y+")"),a.attr("transform","rotate(-45, "+t.x+", "+t.y+")");else{const g=-7.5-(h.width+10)/25*9.5,f=10+h.width/25*8.5;n.attr("transform","translate("+g+", "+f+") rotate(-45, "+o+", "+t.y+")")}}},"drawCommitLabel"),cr=$((e,r,t,o)=>{var s;if(r.tags.length>0){let d=0,n=0,a=0;const l=[];for(const h of r.tags.reverse()){const g=e.insert("polygon"),f=e.append("circle"),c=e.append("text").attr("y",t.y-16-d).attr("class","tag-label").text(h),x=(s=c.node())==null?void 0:s.getBBox();if(!x)throw new Error("Tag bbox not found");n=Math.max(n,x.width),a=Math.max(a,x.height),c.attr("x",t.posWithOffset-x.width/2),l.push({tag:c,hole:f,rect:g,yOffset:d}),d+=20}for(const{tag:h,hole:g,rect:f,yOffset:c}of l){const x=a/2,u=t.y-19.2-c;if(f.attr("class","tag-label-bkg").attr("points",`
1
+ import{I as he}from"./chunk-2Q5K7J3B-uMf2zApa.js";import{p as $e}from"./chunk-JWPE2WC7-B71OUFoy.js";import{p as fe,o as ge,s as ue,g as ye,a as xe,b as me,_ as $,z as Q,l as k,d as pe,c as z,y as be,A as we,q as ke,k as L,B as ve,D as Ee,E as Be}from"./mermaid.core-Bt-11G2g.js";import{p as Ce}from"./cynefin-VYW2F7L2-BwwhPetI.js";import"./main-DXG9arLM.js";import"./vendor-react--Eh9ivFN.js";import"./vendor-three-CBPuP1jE.js";var p={NORMAL:0,REVERSE:1,HIGHLIGHT:2,MERGE:3,CHERRY_PICK:4},Te=Ee.gitGraph,D=$(()=>ve({...Te,...Q().gitGraph}),"getConfig"),i=new he(()=>{const e=D(),r=e.mainBranchName,t=e.mainBranchOrder;return{mainBranchName:r,commits:new Map,head:null,branchConfig:new Map([[r,{name:r,order:t}]]),branches:new Map([[r,null]]),currBranch:r,direction:"LR",seq:0,options:{}}});function K(){return Be({length:7})}$(K,"getID");function ae(e,r){const t=Object.create(null);return e.reduce((o,s)=>{const d=r(s);return t[d]||(t[d]=!0,o.push(s)),o},[])}$(ae,"uniqBy");var Le=$(function(e){i.records.direction=e},"setDirection"),Me=$(function(e){k.debug("options str",e),e=e==null?void 0:e.trim(),e=e||"{}";try{i.records.options=JSON.parse(e)}catch(r){k.error("error while parsing gitGraph options",r.message)}},"setOptions"),Re=$(function(){return i.records.options},"getOptions"),Ie=$(function(e){let r=e.msg,t=e.id;const o=e.type;let s=e.tags;k.info("commit",r,t,o,s),k.debug("Entering commit:",r,t,o,s);const d=D();t=L.sanitizeText(t,d),r=L.sanitizeText(r,d),s=s==null?void 0:s.map(a=>L.sanitizeText(a,d));const n={id:t||i.records.seq+"-"+K(),message:r,seq:i.records.seq++,type:o??p.NORMAL,tags:s??[],parents:i.records.head==null?[]:[i.records.head.id],branch:i.records.currBranch};i.records.head=n,k.info("main branch",d.mainBranchName),i.records.commits.has(n.id)&&k.warn(`Commit ID ${n.id} already exists`),i.records.commits.set(n.id,n),i.records.branches.set(i.records.currBranch,n.id),k.debug("in pushCommit "+n.id)},"commit"),Oe=$(function(e){let r=e.name;const t=e.order;if(r=L.sanitizeText(r,D()),i.records.branches.has(r))throw new Error(`Trying to create an existing branch. (Help: Either use a new name if you want create a new branch or try using "checkout ${r}")`);i.records.branches.set(r,i.records.head!=null?i.records.head.id:null),i.records.branchConfig.set(r,{name:r,order:t}),ne(r),k.debug("in createBranch")},"branch"),_e=$(e=>{let r=e.branch,t=e.id;const o=e.type,s=e.tags,d=D();r=L.sanitizeText(r,d),t&&(t=L.sanitizeText(t,d));const n=i.records.branches.get(i.records.currBranch),a=i.records.branches.get(r),l=n?i.records.commits.get(n):void 0,h=a?i.records.commits.get(a):void 0;if(l&&h&&l.branch===r)throw new Error(`Cannot merge branch '${r}' into itself.`);if(i.records.currBranch===r){const c=new Error('Incorrect usage of "merge". Cannot merge a branch to itself');throw c.hash={text:`merge ${r}`,token:`merge ${r}`,expected:["branch abc"]},c}if(l===void 0||!l){const c=new Error(`Incorrect usage of "merge". Current branch (${i.records.currBranch})has no commits`);throw c.hash={text:`merge ${r}`,token:`merge ${r}`,expected:["commit"]},c}if(!i.records.branches.has(r)){const c=new Error('Incorrect usage of "merge". Branch to be merged ('+r+") does not exist");throw c.hash={text:`merge ${r}`,token:`merge ${r}`,expected:[`branch ${r}`]},c}if(h===void 0||!h){const c=new Error('Incorrect usage of "merge". Branch to be merged ('+r+") has no commits");throw c.hash={text:`merge ${r}`,token:`merge ${r}`,expected:['"commit"']},c}if(l===h){const c=new Error('Incorrect usage of "merge". Both branches have same head');throw c.hash={text:`merge ${r}`,token:`merge ${r}`,expected:["branch abc"]},c}if(t&&i.records.commits.has(t)){const c=new Error('Incorrect usage of "merge". Commit with id:'+t+" already exists, use different custom id");throw c.hash={text:`merge ${r} ${t} ${o} ${s==null?void 0:s.join(" ")}`,token:`merge ${r} ${t} ${o} ${s==null?void 0:s.join(" ")}`,expected:[`merge ${r} ${t}_UNIQUE ${o} ${s==null?void 0:s.join(" ")}`]},c}const g=a||"",f={id:t||`${i.records.seq}-${K()}`,message:`merged branch ${r} into ${i.records.currBranch}`,seq:i.records.seq++,parents:i.records.head==null?[]:[i.records.head.id,g],branch:i.records.currBranch,type:p.MERGE,customType:o,customId:!!t,tags:s??[]};i.records.head=f,i.records.commits.set(f.id,f),i.records.branches.set(i.records.currBranch,f.id),k.debug(i.records.branches),k.debug("in mergeBranch")},"merge"),Ge=$(function(e){let r=e.id,t=e.targetId,o=e.tags,s=e.parent;k.debug("Entering cherryPick:",r,t,o);const d=D();if(r=L.sanitizeText(r,d),t=L.sanitizeText(t,d),o=o==null?void 0:o.map(l=>L.sanitizeText(l,d)),s=L.sanitizeText(s,d),!r||!i.records.commits.has(r)){const l=new Error('Incorrect usage of "cherryPick". Source commit id should exist and provided');throw l.hash={text:`cherryPick ${r} ${t}`,token:`cherryPick ${r} ${t}`,expected:["cherry-pick abc"]},l}const n=i.records.commits.get(r);if(n===void 0||!n)throw new Error('Incorrect usage of "cherryPick". Source commit id should exist and provided');if(s&&!(Array.isArray(n.parents)&&n.parents.includes(s)))throw new Error("Invalid operation: The specified parent commit is not an immediate parent of the cherry-picked commit.");const a=n.branch;if(n.type===p.MERGE&&!s)throw new Error("Incorrect usage of cherry-pick: If the source commit is a merge commit, an immediate parent commit must be specified.");if(!t||!i.records.commits.has(t)){if(a===i.records.currBranch){const f=new Error('Incorrect usage of "cherryPick". Source commit is already on current branch');throw f.hash={text:`cherryPick ${r} ${t}`,token:`cherryPick ${r} ${t}`,expected:["cherry-pick abc"]},f}const l=i.records.branches.get(i.records.currBranch);if(l===void 0||!l){const f=new Error(`Incorrect usage of "cherry-pick". Current branch (${i.records.currBranch})has no commits`);throw f.hash={text:`cherryPick ${r} ${t}`,token:`cherryPick ${r} ${t}`,expected:["cherry-pick abc"]},f}const h=i.records.commits.get(l);if(h===void 0||!h){const f=new Error(`Incorrect usage of "cherry-pick". Current branch (${i.records.currBranch})has no commits`);throw f.hash={text:`cherryPick ${r} ${t}`,token:`cherryPick ${r} ${t}`,expected:["cherry-pick abc"]},f}const g={id:i.records.seq+"-"+K(),message:`cherry-picked ${n==null?void 0:n.message} into ${i.records.currBranch}`,seq:i.records.seq++,parents:i.records.head==null?[]:[i.records.head.id,n.id],branch:i.records.currBranch,type:p.CHERRY_PICK,tags:o?o.filter(Boolean):[`cherry-pick:${n.id}${n.type===p.MERGE?`|parent:${s}`:""}`]};i.records.head=g,i.records.commits.set(g.id,g),i.records.branches.set(i.records.currBranch,g.id),k.debug(i.records.branches),k.debug("in cherryPick")}},"cherryPick"),ne=$(function(e){if(e=L.sanitizeText(e,D()),i.records.branches.has(e)){i.records.currBranch=e;const r=i.records.branches.get(i.records.currBranch);r===void 0||!r?i.records.head=null:i.records.head=i.records.commits.get(r)??null}else{const r=new Error(`Trying to checkout branch which is not yet created. (Help try using "branch ${e}")`);throw r.hash={text:`checkout ${e}`,token:`checkout ${e}`,expected:[`branch ${e}`]},r}},"checkout");function X(e,r,t){const o=e.indexOf(r);o===-1?e.push(t):e.splice(o,1,t)}$(X,"upsert");function Z(e){const r=e.reduce((s,d)=>s.seq>d.seq?s:d,e[0]);let t="";e.forEach(function(s){s===r?t+=" *":t+=" |"});const o=[t,r.id,r.seq];for(const s in i.records.branches)i.records.branches.get(s)===r.id&&o.push(s);if(k.debug(o.join(" ")),r.parents&&r.parents.length==2&&r.parents[0]&&r.parents[1]){const s=i.records.commits.get(r.parents[0]);X(e,r,s),r.parents[1]&&e.push(i.records.commits.get(r.parents[1]))}else{if(r.parents.length==0)return;if(r.parents[0]){const s=i.records.commits.get(r.parents[0]);X(e,r,s)}}e=ae(e,s=>s.id),Z(e)}$(Z,"prettyPrintCommitHistory");var He=$(function(){k.debug(i.records.commits);const e=se()[0];Z([e])},"prettyPrint"),Ae=$(function(){i.reset(),ke()},"clear"),Se=$(function(){return[...i.records.branchConfig.values()].map((r,t)=>r.order!==null&&r.order!==void 0?r:{...r,order:parseFloat(`0.${t}`)}).sort((r,t)=>(r.order??0)-(t.order??0)).map(({name:r})=>({name:r}))},"getBranchesAsObjArray"),De=$(function(){return i.records.branches},"getBranches"),qe=$(function(){return i.records.commits},"getCommits"),se=$(function(){const e=[...i.records.commits.values()];return e.forEach(function(r){k.debug(r.id)}),e.sort((r,t)=>r.seq-t.seq),e},"getCommitsArray"),Pe=$(function(){return i.records.currBranch},"getCurrentBranch"),We=$(function(){return i.records.direction},"getDirection"),Ne=$(function(){return i.records.head},"getHead"),oe={commitType:p,getConfig:D,setDirection:Le,setOptions:Me,getOptions:Re,commit:Ie,branch:Oe,merge:_e,cherryPick:Ge,checkout:ne,prettyPrint:He,clear:Ae,getBranchesAsObjArray:Se,getBranches:De,getCommits:qe,getCommitsArray:se,getCurrentBranch:Pe,getDirection:We,getHead:Ne,setAccTitle:me,getAccTitle:xe,getAccDescription:ye,setAccDescription:ue,setDiagramTitle:ge,getDiagramTitle:fe},Fe=$((e,r)=>{$e(e,r),e.dir&&r.setDirection(e.dir);for(const t of e.statements)ze(t,r)},"populate"),ze=$((e,r)=>{const o={Commit:$(s=>r.commit(Ye(s)),"Commit"),Branch:$(s=>r.branch(je(s)),"Branch"),Merge:$(s=>r.merge(Ue(s)),"Merge"),Checkout:$(s=>r.checkout(Ke(s)),"Checkout"),CherryPicking:$(s=>r.cherryPick(Ve(s)),"CherryPicking")}[e.$type];o?o(e):k.error(`Unknown statement type: ${e.$type}`)},"parseStatement"),Ye=$(e=>({id:e.id,msg:e.message??"",type:e.type!==void 0?p[e.type]:p.NORMAL,tags:e.tags??void 0}),"parseCommit"),je=$(e=>({name:e.name,order:e.order??0}),"parseBranch"),Ue=$(e=>({branch:e.branch,id:e.id??"",type:e.type!==void 0?p[e.type]:void 0,tags:e.tags??void 0}),"parseMerge"),Ke=$(e=>e.branch,"parseCheckout"),Ve=$(e=>{var t;return{id:e.id,targetId:"",tags:((t=e.tags)==null?void 0:t.length)===0?void 0:e.tags,parent:e.parent}},"parseCherryPicking"),Xe={parse:$(async e=>{const r=await Ce("gitGraph",e);k.debug(r),Fe(r,oe)},"parse")},G=10,H=40,M=4,I=2,A=8,V=new Set(["redux","redux-dark","redux-color","redux-dark-color"]),J=12,ee=new Set(["redux-color","redux-dark-color"]),Je=new Set(["dark","redux-dark","redux-dark-color","neo-dark"]),S=$((e,r,t=!1)=>t&&e>0?(e-1)%(r-1)+1:e%r,"calcColorIndex"),C=new Map,T=new Map,j=30,N=new Map,U=[],O=0,y="LR",Qe=$(()=>{C.clear(),T.clear(),N.clear(),O=0,U=[],y="LR"},"clear"),ce=$(e=>{const r=document.createElementNS("http://www.w3.org/2000/svg","text");return(typeof e=="string"?e.split(/\\n|\n|<br\s*\/?>/gi):e).forEach(o=>{const s=document.createElementNS("http://www.w3.org/2000/svg","tspan");s.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve"),s.setAttribute("dy","1em"),s.setAttribute("x","0"),s.setAttribute("class","row"),s.textContent=o.trim(),r.appendChild(s)}),r},"drawText"),ie=$(e=>{let r,t,o;return y==="BT"?(t=$((s,d)=>s<=d,"comparisonFunc"),o=1/0):(t=$((s,d)=>s>=d,"comparisonFunc"),o=0),e.forEach(s=>{var n,a;const d=y==="TB"||y=="BT"?(n=T.get(s))==null?void 0:n.y:(a=T.get(s))==null?void 0:a.x;d!==void 0&&t(d,o)&&(r=s,o=d)}),r},"findClosestParent"),Ze=$(e=>{let r="",t=1/0;return e.forEach(o=>{const s=T.get(o).y;s<=t&&(r=o,t=s)}),r||void 0},"findClosestParentBT"),er=$((e,r,t)=>{let o=t,s=t;const d=[];e.forEach(n=>{const a=r.get(n);if(!a)throw new Error(`Commit not found for key ${n}`);a.parents.length?(o=tr(a),s=Math.max(o,s)):d.push(a),ar(a,o)}),o=s,d.forEach(n=>{nr(n,o,t)}),e.forEach(n=>{const a=r.get(n);if(a!=null&&a.parents.length){const l=Ze(a.parents);o=T.get(l).y-H,o<=s&&(s=o);const h=C.get(a.branch).pos,g=o-G;T.set(a.id,{x:h,y:g})}})},"setParallelBTPos"),rr=$(e=>{var o;const r=ie(e.parents.filter(s=>s!==null));if(!r)throw new Error(`Closest parent not found for commit ${e.id}`);const t=(o=T.get(r))==null?void 0:o.y;if(t===void 0)throw new Error(`Closest parent position not found for commit ${e.id}`);return t},"findClosestParentPos"),tr=$(e=>rr(e)+H,"calculateCommitPosition"),ar=$((e,r)=>{const t=C.get(e.branch);if(!t)throw new Error(`Branch not found for commit ${e.id}`);const o=t.pos,s=r+G;return T.set(e.id,{x:o,y:s}),{x:o,y:s}},"setCommitPosition"),nr=$((e,r,t)=>{const o=C.get(e.branch);if(!o)throw new Error(`Branch not found for commit ${e.id}`);const s=r+t,d=o.pos;T.set(e.id,{x:d,y:s})},"setRootPosition"),sr=$((e,r,t,o,s,d)=>{const{theme:n}=z(),a=V.has(n??""),l=ee.has(n??""),h=Je.has(n??"");if(d===p.HIGHLIGHT)e.append("rect").attr("x",t.x-10+(a?3:0)).attr("y",t.y-10+(a?3:0)).attr("width",a?14:20).attr("height",a?14:20).attr("class",`commit ${r.id} commit-highlight${S(s,A,l)} ${o}-outer`),e.append("rect").attr("x",t.x-6+(a?2:0)).attr("y",t.y-6+(a?2:0)).attr("width",a?8:12).attr("height",a?8:12).attr("class",`commit ${r.id} commit${S(s,A,l)} ${o}-inner`);else if(d===p.CHERRY_PICK)e.append("circle").attr("cx",t.x).attr("cy",t.y).attr("r",a?7:10).attr("class",`commit ${r.id} ${o}`),e.append("circle").attr("cx",t.x-3).attr("cy",t.y+2).attr("r",a?2.5:2.75).attr("fill",h?"#000000":"#fff").attr("class",`commit ${r.id} ${o}`),e.append("circle").attr("cx",t.x+3).attr("cy",t.y+2).attr("r",a?2.5:2.75).attr("fill",h?"#000000":"#fff").attr("class",`commit ${r.id} ${o}`),e.append("line").attr("x1",t.x+3).attr("y1",t.y+1).attr("x2",t.x).attr("y2",t.y-5).attr("stroke",h?"#000000":"#fff").attr("class",`commit ${r.id} ${o}`),e.append("line").attr("x1",t.x-3).attr("y1",t.y+1).attr("x2",t.x).attr("y2",t.y-5).attr("stroke",h?"#000000":"#fff").attr("class",`commit ${r.id} ${o}`);else{const g=e.append("circle");if(g.attr("cx",t.x),g.attr("cy",t.y),g.attr("r",a?7:10),g.attr("class",`commit ${r.id} commit${S(s,A,l)}`),d===p.MERGE){const f=e.append("circle");f.attr("cx",t.x),f.attr("cy",t.y),f.attr("r",a?5:6),f.attr("class",`commit ${o} ${r.id} commit${S(s,A,l)}`)}if(d===p.REVERSE){const f=e.append("path"),c=a?4:5;f.attr("d",`M ${t.x-c},${t.y-c}L${t.x+c},${t.y+c}M${t.x-c},${t.y+c}L${t.x+c},${t.y-c}`).attr("class",`commit ${o} ${r.id} commit${S(s,A,l)}`)}}},"drawCommitBullet"),or=$((e,r,t,o,s)=>{var d;if(r.type!==p.CHERRY_PICK&&(r.customId&&r.type===p.MERGE||r.type!==p.MERGE)&&s.showCommitLabel){const n=e.append("g"),a=n.insert("rect").attr("class","commit-label-bkg"),l=n.append("text").attr("x",o).attr("y",t.y+25).attr("class","commit-label").text(r.id),h=(d=l.node())==null?void 0:d.getBBox();if(h&&(a.attr("x",t.posWithOffset-h.width/2-I).attr("y",t.y+13.5).attr("width",h.width+2*I).attr("height",h.height+2*I),y==="TB"||y==="BT"?(a.attr("x",t.x-(h.width+4*M+5)).attr("y",t.y-12),l.attr("x",t.x-(h.width+4*M)).attr("y",t.y+h.height-12)):l.attr("x",t.posWithOffset-h.width/2),s.rotateCommitLabel))if(y==="TB"||y==="BT")l.attr("transform","rotate(-45, "+t.x+", "+t.y+")"),a.attr("transform","rotate(-45, "+t.x+", "+t.y+")");else{const g=-7.5-(h.width+10)/25*9.5,f=10+h.width/25*8.5;n.attr("transform","translate("+g+", "+f+") rotate(-45, "+o+", "+t.y+")")}}},"drawCommitLabel"),cr=$((e,r,t,o)=>{var s;if(r.tags.length>0){let d=0,n=0,a=0;const l=[];for(const h of r.tags.reverse()){const g=e.insert("polygon"),f=e.append("circle"),c=e.append("text").attr("y",t.y-16-d).attr("class","tag-label").text(h),x=(s=c.node())==null?void 0:s.getBBox();if(!x)throw new Error("Tag bbox not found");n=Math.max(n,x.width),a=Math.max(a,x.height),c.attr("x",t.posWithOffset-x.width/2),l.push({tag:c,hole:f,rect:g,yOffset:d}),d+=20}for(const{tag:h,hole:g,rect:f,yOffset:c}of l){const x=a/2,u=t.y-19.2-c;if(f.attr("class","tag-label-bkg").attr("points",`
2
2
  ${o-n/2-M/2},${u+I}
3
3
  ${o-n/2-M/2},${u-I}
4
4
  ${t.posWithOffset-n/2-M},${u-x-I}
@@ -1 +1 @@
1
- import{c as Rt,d as Tt,z as $t,a0 as Lt,f as kt,bp as jt,bN as Nt,bO as Pt,aa as Kt,r as d,y as zt,S as pe,bP as it,bQ as Qt,bR as Gt,ar as Ut,bS as fe,s as k,bT as Ot,j as m,I as Z,V as ot,bU as ct,n as at,bV as Wt,bW as ut,bX as Ie,U as $e,m as Ht,aq as At,u as be,bY as lt}from"./main-m3NNcAo4.js";import{bZ as tr,b_ as sr,b$ as rr,c0 as nr,c1 as ir}from"./main-m3NNcAo4.js";import"./vendor-react--Eh9ivFN.js";import"./vendor-three-CBPuP1jE.js";function ie(s){return Array.isArray?Array.isArray(s):xt(s)==="[object Array]"}function Yt(s){if(typeof s=="string")return s;let e=s+"";return e=="0"&&1/s==-1/0?"-0":e}function Vt(s){return s==null?"":Yt(s)}function te(s){return typeof s=="string"}function yt(s){return typeof s=="number"}function qt(s){return s===!0||s===!1||Xt(s)&&xt(s)=="[object Boolean]"}function Et(s){return typeof s=="object"}function Xt(s){return Et(s)&&s!==null}function W(s){return s!=null}function Le(s){return!s.trim().length}function xt(s){return s==null?s===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(s)}const Jt="Incorrect 'index' type",Zt=s=>`Invalid value for key ${s}`,es=s=>`Pattern length exceeds max of ${s}.`,ts=s=>`Missing ${s} property in key`,ss=s=>`Property 'weight' in key '${s}' must be a positive integer`,ht=Object.prototype.hasOwnProperty;class rs{constructor(e){this._keys=[],this._keyMap={};let r=0;e.forEach(n=>{let i=Mt(n);this._keys.push(i),this._keyMap[i.id]=i,r+=i.weight}),this._keys.forEach(n=>{n.weight/=r})}get(e){return this._keyMap[e]}keys(){return this._keys}toJSON(){return JSON.stringify(this._keys)}}function Mt(s){let e=null,r=null,n=null,i=1,o=null;if(te(s)||ie(s))n=s,e=dt(s),r=ke(s);else{if(!ht.call(s,"name"))throw new Error(ts("name"));const c=s.name;if(n=c,ht.call(s,"weight")&&(i=s.weight,i<=0))throw new Error(ss(c));e=dt(c),r=ke(c),o=s.getFn}return{path:e,id:r,weight:i,src:n,getFn:o}}function dt(s){return ie(s)?s:s.split(".")}function ke(s){return ie(s)?s.join("."):s}function ns(s,e){let r=[],n=!1;const i=(o,c,a)=>{if(W(o))if(!c[a])r.push(o);else{let u=c[a];const h=o[u];if(!W(h))return;if(a===c.length-1&&(te(h)||yt(h)||qt(h)))r.push(Vt(h));else if(ie(h)){n=!0;for(let f=0,x=h.length;f<x;f+=1)i(h[f],c,a+1)}else c.length&&i(h,c,a+1)}};return i(s,te(e)?e.split("."):e,0),n?r:r[0]}const is={includeMatches:!1,findAllMatches:!1,minMatchCharLength:1},os={isCaseSensitive:!1,ignoreDiacritics:!1,includeScore:!1,keys:[],shouldSort:!0,sortFn:(s,e)=>s.score===e.score?s.idx<e.idx?-1:1:s.score<e.score?-1:1},cs={location:0,threshold:.6,distance:100},as={useExtendedSearch:!1,getFn:ns,ignoreLocation:!1,ignoreFieldNorm:!1,fieldNormWeight:1};var C={...os,...is,...cs,...as};const us=/[^ ]+/g;function ls(s=1,e=3){const r=new Map,n=Math.pow(10,e);return{get(i){const o=i.match(us).length;if(r.has(o))return r.get(o);const c=1/Math.pow(o,.5*s),a=parseFloat(Math.round(c*n)/n);return r.set(o,a),a},clear(){r.clear()}}}class Qe{constructor({getFn:e=C.getFn,fieldNormWeight:r=C.fieldNormWeight}={}){this.norm=ls(r,3),this.getFn=e,this.isCreated=!1,this.setIndexRecords()}setSources(e=[]){this.docs=e}setIndexRecords(e=[]){this.records=e}setKeys(e=[]){this.keys=e,this._keysMap={},e.forEach((r,n)=>{this._keysMap[r.id]=n})}create(){this.isCreated||!this.docs.length||(this.isCreated=!0,te(this.docs[0])?this.docs.forEach((e,r)=>{this._addString(e,r)}):this.docs.forEach((e,r)=>{this._addObject(e,r)}),this.norm.clear())}add(e){const r=this.size();te(e)?this._addString(e,r):this._addObject(e,r)}removeAt(e){this.records.splice(e,1);for(let r=e,n=this.size();r<n;r+=1)this.records[r].i-=1}getValueForItemAtKeyId(e,r){return e[this._keysMap[r]]}size(){return this.records.length}_addString(e,r){if(!W(e)||Le(e))return;let n={v:e,i:r,n:this.norm.get(e)};this.records.push(n)}_addObject(e,r){let n={i:r,$:{}};this.keys.forEach((i,o)=>{let c=i.getFn?i.getFn(e):this.getFn(e,i.path);if(W(c)){if(ie(c)){let a=[];const u=[{nestedArrIndex:-1,value:c}];for(;u.length;){const{nestedArrIndex:h,value:f}=u.pop();if(W(f))if(te(f)&&!Le(f)){let x={v:f,i:h,n:this.norm.get(f)};a.push(x)}else ie(f)&&f.forEach((x,S)=>{u.push({nestedArrIndex:S,value:x})})}n.$[o]=a}else if(te(c)&&!Le(c)){let a={v:c,n:this.norm.get(c)};n.$[o]=a}}}),this.records.push(n)}toJSON(){return{keys:this.keys,records:this.records}}}function Ct(s,e,{getFn:r=C.getFn,fieldNormWeight:n=C.fieldNormWeight}={}){const i=new Qe({getFn:r,fieldNormWeight:n});return i.setKeys(s.map(Mt)),i.setSources(e),i.create(),i}function hs(s,{getFn:e=C.getFn,fieldNormWeight:r=C.fieldNormWeight}={}){const{keys:n,records:i}=s,o=new Qe({getFn:e,fieldNormWeight:r});return o.setKeys(n),o.setIndexRecords(i),o}function we(s,{errors:e=0,currentLocation:r=0,expectedLocation:n=0,distance:i=C.distance,ignoreLocation:o=C.ignoreLocation}={}){const c=e/s.length;if(o)return c;const a=Math.abs(n-r);return i?c+a/i:a?1:c}function ds(s=[],e=C.minMatchCharLength){let r=[],n=-1,i=-1,o=0;for(let c=s.length;o<c;o+=1){let a=s[o];a&&n===-1?n=o:!a&&n!==-1&&(i=o-1,i-n+1>=e&&r.push([n,i]),n=-1)}return s[o-1]&&o-n>=e&&r.push([n,o-1]),r}const ue=32;function fs(s,e,r,{location:n=C.location,distance:i=C.distance,threshold:o=C.threshold,findAllMatches:c=C.findAllMatches,minMatchCharLength:a=C.minMatchCharLength,includeMatches:u=C.includeMatches,ignoreLocation:h=C.ignoreLocation}={}){if(e.length>ue)throw new Error(es(ue));const f=e.length,x=s.length,S=Math.max(0,Math.min(n,x));let E=o,y=S;const I=a>1||u,v=I?Array(x):[];let K;for(;(K=s.indexOf(e,y))>-1;){let P=we(e,{currentLocation:K,expectedLocation:S,distance:i,ignoreLocation:h});if(E=Math.min(P,E),y=K+f,I){let U=0;for(;U<f;)v[K+U]=1,U+=1}}y=-1;let b=[],H=1,G=f+x;const le=1<<f-1;for(let P=0;P<f;P+=1){let U=0,O=G;for(;U<O;)we(e,{errors:P,currentLocation:S+O,expectedLocation:S,distance:i,ignoreLocation:h})<=E?U=O:G=O,O=Math.floor((G-U)/2+U);G=O;let X=Math.max(1,S-O+1),J=c?x:Math.min(S+O,x)+f,B=Array(J+2);B[J+1]=(1<<P)-1;for(let M=J;M>=X;M-=1){let R=M-1,Y=r[s.charAt(R)];if(I&&(v[R]=+!!Y),B[M]=(B[M+1]<<1|1)&Y,P&&(B[M]|=(b[M+1]|b[M])<<1|1|b[M+1]),B[M]&le&&(H=we(e,{errors:P,currentLocation:R,expectedLocation:S,distance:i,ignoreLocation:h}),H<=E)){if(E=H,y=R,y<=S)break;X=Math.max(1,2*S-y)}}if(we(e,{errors:P+1,currentLocation:S,expectedLocation:S,distance:i,ignoreLocation:h})>E)break;b=B}const se={isMatch:y>=0,score:Math.max(.001,H)};if(I){const P=ds(v,a);P.length?u&&(se.indices=P):se.isMatch=!1}return se}function ms(s){let e={};for(let r=0,n=s.length;r<n;r+=1){const i=s.charAt(r);e[i]=(e[i]||0)|1<<n-r-1}return e}const _e=String.prototype.normalize?(s=>s.normalize("NFD").replace(/[\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08D3-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C04\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D82\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u1885\u1886\u18A9\u1920-\u192B\u1930-\u193B\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1AB0-\u1ABE\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF2-\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DF9\u1DFB-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA880\uA881\uA8B4-\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F]/g,"")):(s=>s);class St{constructor(e,{location:r=C.location,threshold:n=C.threshold,distance:i=C.distance,includeMatches:o=C.includeMatches,findAllMatches:c=C.findAllMatches,minMatchCharLength:a=C.minMatchCharLength,isCaseSensitive:u=C.isCaseSensitive,ignoreDiacritics:h=C.ignoreDiacritics,ignoreLocation:f=C.ignoreLocation}={}){if(this.options={location:r,threshold:n,distance:i,includeMatches:o,findAllMatches:c,minMatchCharLength:a,isCaseSensitive:u,ignoreDiacritics:h,ignoreLocation:f},e=u?e:e.toLowerCase(),e=h?_e(e):e,this.pattern=e,this.chunks=[],!this.pattern.length)return;const x=(E,y)=>{this.chunks.push({pattern:E,alphabet:ms(E),startIndex:y})},S=this.pattern.length;if(S>ue){let E=0;const y=S%ue,I=S-y;for(;E<I;)x(this.pattern.substr(E,ue),E),E+=ue;if(y){const v=S-ue;x(this.pattern.substr(v),v)}}else x(this.pattern,0)}searchIn(e){const{isCaseSensitive:r,ignoreDiacritics:n,includeMatches:i}=this.options;if(e=r?e:e.toLowerCase(),e=n?_e(e):e,this.pattern===e){let I={isMatch:!0,score:0};return i&&(I.indices=[[0,e.length-1]]),I}const{location:o,distance:c,threshold:a,findAllMatches:u,minMatchCharLength:h,ignoreLocation:f}=this.options;let x=[],S=0,E=!1;this.chunks.forEach(({pattern:I,alphabet:v,startIndex:K})=>{const{isMatch:b,score:H,indices:G}=fs(e,I,v,{location:o+K,distance:c,threshold:a,findAllMatches:u,minMatchCharLength:h,includeMatches:i,ignoreLocation:f});b&&(E=!0),S+=H,b&&G&&(x=[...x,...G])});let y={isMatch:E,score:E?S/this.chunks.length:1};return E&&i&&(y.indices=x),y}}class oe{constructor(e){this.pattern=e}static isMultiMatch(e){return ft(e,this.multiRegex)}static isSingleMatch(e){return ft(e,this.singleRegex)}search(){}}function ft(s,e){const r=s.match(e);return r?r[1]:null}class ps extends oe{constructor(e){super(e)}static get type(){return"exact"}static get multiRegex(){return/^="(.*)"$/}static get singleRegex(){return/^=(.*)$/}search(e){const r=e===this.pattern;return{isMatch:r,score:r?0:1,indices:[0,this.pattern.length-1]}}}class gs extends oe{constructor(e){super(e)}static get type(){return"inverse-exact"}static get multiRegex(){return/^!"(.*)"$/}static get singleRegex(){return/^!(.*)$/}search(e){const n=e.indexOf(this.pattern)===-1;return{isMatch:n,score:n?0:1,indices:[0,e.length-1]}}}class As extends oe{constructor(e){super(e)}static get type(){return"prefix-exact"}static get multiRegex(){return/^\^"(.*)"$/}static get singleRegex(){return/^\^(.*)$/}search(e){const r=e.startsWith(this.pattern);return{isMatch:r,score:r?0:1,indices:[0,this.pattern.length-1]}}}class ys extends oe{constructor(e){super(e)}static get type(){return"inverse-prefix-exact"}static get multiRegex(){return/^!\^"(.*)"$/}static get singleRegex(){return/^!\^(.*)$/}search(e){const r=!e.startsWith(this.pattern);return{isMatch:r,score:r?0:1,indices:[0,e.length-1]}}}class Es extends oe{constructor(e){super(e)}static get type(){return"suffix-exact"}static get multiRegex(){return/^"(.*)"\$$/}static get singleRegex(){return/^(.*)\$$/}search(e){const r=e.endsWith(this.pattern);return{isMatch:r,score:r?0:1,indices:[e.length-this.pattern.length,e.length-1]}}}class xs extends oe{constructor(e){super(e)}static get type(){return"inverse-suffix-exact"}static get multiRegex(){return/^!"(.*)"\$$/}static get singleRegex(){return/^!(.*)\$$/}search(e){const r=!e.endsWith(this.pattern);return{isMatch:r,score:r?0:1,indices:[0,e.length-1]}}}class Ft extends oe{constructor(e,{location:r=C.location,threshold:n=C.threshold,distance:i=C.distance,includeMatches:o=C.includeMatches,findAllMatches:c=C.findAllMatches,minMatchCharLength:a=C.minMatchCharLength,isCaseSensitive:u=C.isCaseSensitive,ignoreDiacritics:h=C.ignoreDiacritics,ignoreLocation:f=C.ignoreLocation}={}){super(e),this._bitapSearch=new St(e,{location:r,threshold:n,distance:i,includeMatches:o,findAllMatches:c,minMatchCharLength:a,isCaseSensitive:u,ignoreDiacritics:h,ignoreLocation:f})}static get type(){return"fuzzy"}static get multiRegex(){return/^"(.*)"$/}static get singleRegex(){return/^(.*)$/}search(e){return this._bitapSearch.searchIn(e)}}class It extends oe{constructor(e){super(e)}static get type(){return"include"}static get multiRegex(){return/^'"(.*)"$/}static get singleRegex(){return/^'(.*)$/}search(e){let r=0,n;const i=[],o=this.pattern.length;for(;(n=e.indexOf(this.pattern,r))>-1;)r=n+o,i.push([n,r-1]);const c=!!i.length;return{isMatch:c,score:c?0:1,indices:i}}}const je=[ps,It,As,ys,xs,Es,gs,Ft],mt=je.length,Ms=/ +(?=(?:[^\"]*\"[^\"]*\")*[^\"]*$)/,Cs="|";function Ss(s,e={}){return s.split(Cs).map(r=>{let n=r.trim().split(Ms).filter(o=>o&&!!o.trim()),i=[];for(let o=0,c=n.length;o<c;o+=1){const a=n[o];let u=!1,h=-1;for(;!u&&++h<mt;){const f=je[h];let x=f.isMultiMatch(a);x&&(i.push(new f(x,e)),u=!0)}if(!u)for(h=-1;++h<mt;){const f=je[h];let x=f.isSingleMatch(a);if(x){i.push(new f(x,e));break}}}return i})}const Fs=new Set([Ft.type,It.type]);class Is{constructor(e,{isCaseSensitive:r=C.isCaseSensitive,ignoreDiacritics:n=C.ignoreDiacritics,includeMatches:i=C.includeMatches,minMatchCharLength:o=C.minMatchCharLength,ignoreLocation:c=C.ignoreLocation,findAllMatches:a=C.findAllMatches,location:u=C.location,threshold:h=C.threshold,distance:f=C.distance}={}){this.query=null,this.options={isCaseSensitive:r,ignoreDiacritics:n,includeMatches:i,minMatchCharLength:o,findAllMatches:a,ignoreLocation:c,location:u,threshold:h,distance:f},e=r?e:e.toLowerCase(),e=n?_e(e):e,this.pattern=e,this.query=Ss(this.pattern,this.options)}static condition(e,r){return r.useExtendedSearch}searchIn(e){const r=this.query;if(!r)return{isMatch:!1,score:1};const{includeMatches:n,isCaseSensitive:i,ignoreDiacritics:o}=this.options;e=i?e:e.toLowerCase(),e=o?_e(e):e;let c=0,a=[],u=0;for(let h=0,f=r.length;h<f;h+=1){const x=r[h];a.length=0,c=0;for(let S=0,E=x.length;S<E;S+=1){const y=x[S],{isMatch:I,indices:v,score:K}=y.search(e);if(I){if(c+=1,u+=K,n){const b=y.constructor.type;Fs.has(b)?a=[...a,...v]:a.push(v)}}else{u=0,c=0,a.length=0;break}}if(c){let S={isMatch:!0,score:u/c};return n&&(S.indices=a),S}}return{isMatch:!1,score:1}}}const Ne=[];function ws(...s){Ne.push(...s)}function Pe(s,e){for(let r=0,n=Ne.length;r<n;r+=1){let i=Ne[r];if(i.condition(s,e))return new i(s,e)}return new St(s,e)}const De={AND:"$and",OR:"$or"},Ke={PATH:"$path",PATTERN:"$val"},ze=s=>!!(s[De.AND]||s[De.OR]),_s=s=>!!s[Ke.PATH],Ds=s=>!ie(s)&&Et(s)&&!ze(s),pt=s=>({[De.AND]:Object.keys(s).map(e=>({[e]:s[e]}))});function wt(s,e,{auto:r=!0}={}){const n=i=>{let o=Object.keys(i);const c=_s(i);if(!c&&o.length>1&&!ze(i))return n(pt(i));if(Ds(i)){const u=c?i[Ke.PATH]:o[0],h=c?i[Ke.PATTERN]:i[u];if(!te(h))throw new Error(Zt(u));const f={keyId:ke(u),pattern:h};return r&&(f.searcher=Pe(h,e)),f}let a={children:[],operator:o[0]};return o.forEach(u=>{const h=i[u];ie(h)&&h.forEach(f=>{a.children.push(n(f))})}),a};return ze(s)||(s=pt(s)),n(s)}function bs(s,{ignoreFieldNorm:e=C.ignoreFieldNorm}){s.forEach(r=>{let n=1;r.matches.forEach(({key:i,norm:o,score:c})=>{const a=i?i.weight:null;n*=Math.pow(c===0&&a?Number.EPSILON:c,(a||1)*(e?1:o))}),r.score=n})}function vs(s,e){const r=s.matches;e.matches=[],W(r)&&r.forEach(n=>{if(!W(n.indices)||!n.indices.length)return;const{indices:i,value:o}=n;let c={indices:i,value:o};n.key&&(c.key=n.key.src),n.idx>-1&&(c.refIndex=n.idx),e.matches.push(c)})}function Bs(s,e){e.score=s.score}function Rs(s,e,{includeMatches:r=C.includeMatches,includeScore:n=C.includeScore}={}){const i=[];return r&&i.push(vs),n&&i.push(Bs),s.map(o=>{const{idx:c}=o,a={item:e[c],refIndex:c};return i.length&&i.forEach(u=>{u(o,a)}),a})}class ee{constructor(e,r={},n){this.options={...C,...r},this.options.useExtendedSearch,this._keyStore=new rs(this.options.keys),this.setCollection(e,n)}setCollection(e,r){if(this._docs=e,r&&!(r instanceof Qe))throw new Error(Jt);this._myIndex=r||Ct(this.options.keys,this._docs,{getFn:this.options.getFn,fieldNormWeight:this.options.fieldNormWeight})}add(e){W(e)&&(this._docs.push(e),this._myIndex.add(e))}remove(e=()=>!1){const r=[];for(let n=0,i=this._docs.length;n<i;n+=1){const o=this._docs[n];e(o,n)&&(this.removeAt(n),n-=1,i-=1,r.push(o))}return r}removeAt(e){this._docs.splice(e,1),this._myIndex.removeAt(e)}getIndex(){return this._myIndex}search(e,{limit:r=-1}={}){const{includeMatches:n,includeScore:i,shouldSort:o,sortFn:c,ignoreFieldNorm:a}=this.options;let u=te(e)?te(this._docs[0])?this._searchStringList(e):this._searchObjectList(e):this._searchLogical(e);return bs(u,{ignoreFieldNorm:a}),o&&u.sort(c),yt(r)&&r>-1&&(u=u.slice(0,r)),Rs(u,this._docs,{includeMatches:n,includeScore:i})}_searchStringList(e){const r=Pe(e,this.options),{records:n}=this._myIndex,i=[];return n.forEach(({v:o,i:c,n:a})=>{if(!W(o))return;const{isMatch:u,score:h,indices:f}=r.searchIn(o);u&&i.push({item:o,idx:c,matches:[{score:h,value:o,norm:a,indices:f}]})}),i}_searchLogical(e){const r=wt(e,this.options),n=(a,u,h)=>{if(!a.children){const{keyId:x,searcher:S}=a,E=this._findMatches({key:this._keyStore.get(x),value:this._myIndex.getValueForItemAtKeyId(u,x),searcher:S});return E&&E.length?[{idx:h,item:u,matches:E}]:[]}const f=[];for(let x=0,S=a.children.length;x<S;x+=1){const E=a.children[x],y=n(E,u,h);if(y.length)f.push(...y);else if(a.operator===De.AND)return[]}return f},i=this._myIndex.records,o={},c=[];return i.forEach(({$:a,i:u})=>{if(W(a)){let h=n(r,a,u);h.length&&(o[u]||(o[u]={idx:u,item:a,matches:[]},c.push(o[u])),h.forEach(({matches:f})=>{o[u].matches.push(...f)}))}}),c}_searchObjectList(e){const r=Pe(e,this.options),{keys:n,records:i}=this._myIndex,o=[];return i.forEach(({$:c,i:a})=>{if(!W(c))return;let u=[];n.forEach((h,f)=>{u.push(...this._findMatches({key:h,value:c[f],searcher:r}))}),u.length&&o.push({idx:a,item:c,matches:u})}),o}_findMatches({key:e,value:r,searcher:n}){if(!W(r))return[];let i=[];if(ie(r))r.forEach(({v:o,i:c,n:a})=>{if(!W(o))return;const{isMatch:u,score:h,indices:f}=n.searchIn(o);u&&i.push({score:h,key:e,value:o,idx:c,norm:a,indices:f})});else{const{v:o,n:c}=r,{isMatch:a,score:u,indices:h}=n.searchIn(o);a&&i.push({score:u,key:e,value:o,norm:c,indices:h})}return i}}ee.version="7.1.0";ee.createIndex=Ct;ee.parseIndex=hs;ee.config=C;ee.parseQuery=wt;ws(Is);async function Ts(s){const e=new URLSearchParams({q:s}),r=await Rt(Tt(`/api/folders/search?${e.toString()}`));if(!r.ok){const i=await r.json().catch(()=>({}));throw new Error(i.error||`Failed to search folders: ${r.statusText}`)}const n=await r.json();return Array.isArray(n.folders)?n.folders:[]}const $s=["command","agent","building","area","folder","file","modified-file","session"],Ls=2,ks=2,js=50,Ns=10,Ps=3,Ks=6;function zs(){const s=At(pe.SPOTLIGHT_TAB,"all");return fe.includes(s)?s:"all"}function gt(){return Ht(pe.SPOTLIGHT_QUERY,"")}function Qs(){const s=At(pe.AOP_CONFIG,{});return s.sortMode==="name"||s.sortMode==="status"||s.sortMode==="recent"?s.sortMode:"recent"}function Gs({isOpen:s,onClose:e,onOpenSpawnModal:r,onOpenCommanderView:n,onOpenToolbox:i,onOpenFileExplorer:o,onOpenPM2LogsModal:c,onOpenBossLogsModal:a,onOpenDatabasePanel:u,onOpenMonitoringModal:h,onOpenSessionFinder:f}){const x=$t(),S=Lt(),E=kt(),y=jt(),I=Nt(),v=Pt(),K=Kt(),b=d.useRef(e);b.current=e;const H=d.useRef(r);H.current=r;const G=d.useRef(n);G.current=n;const le=d.useRef(i);le.current=i;const se=d.useRef(o);se.current=o;const P=d.useRef(c);P.current=c;const U=d.useRef(a);U.current=a;const O=d.useRef(u);O.current=u;const X=d.useRef(h);X.current=h;const J=d.useRef(f);J.current=f;const[B,L]=d.useState(gt),[M,R]=d.useState(0),[Y,ce]=d.useState(zs),[Ge,ge]=d.useState([]),[Ue,Ae]=d.useState([]),[ye,Ee]=d.useState({query:"",rows:[]}),_t=d.useCallback(t=>{L(t),zt(pe.SPOTLIGHT_QUERY,t)},[]);d.useEffect(()=>{s&&(L(gt()),R(0))},[s]),d.useEffect(()=>{if(!s){ge([]);return}const t=B.trim();if(t.length<Ls){ge([]);return}let l=!1;const p=setTimeout(()=>{Ts(t).then(A=>{l||ge(A)}).catch(()=>{l||ge([])})},250);return()=>{l=!0,clearTimeout(p)}},[s,B]);const Dt=(y.fileSearchExcludeDirs??it).join(",");d.useEffect(()=>{if(!s){Ae([]);return}const t=B.trim();if(t.length<ks){Ae([]);return}let l=!1;const p=setTimeout(()=>{Qt(t,{exclude:y.fileSearchExcludeDirs??[...it],limit:js}).then(A=>{l||Ae(A)}).catch(()=>{l||Ae([])})},250);return()=>{l=!0,clearTimeout(p)}},[s,B,Dt,y.fileSearchExcludeDirs]),d.useEffect(()=>{if(!s){Ee({query:"",rows:[]});return}const t=B.trim();if(t.length<Ps){Ee({query:"",rows:[]});return}let l=!1;const p=setTimeout(()=>{Gt(t,{limit:Ks}).then(A=>{l||Ee({query:t,rows:A})}).catch(()=>{l||Ee({query:"",rows:[]})})},250);return()=>{l=!0,clearTimeout(p)}},[s,B]);const ve=d.useCallback(t=>{ce(t),Ut(pe.SPOTLIGHT_TAB,t)},[]),Oe=d.useRef(Y);Oe.current=Y;const bt=d.useCallback(t=>{const l=fe.indexOf(Oe.current),p=fe[(l+t+fe.length)%fe.length];ve(p)},[ve]);d.useEffect(()=>{R(0)},[Y]);const Be=k.getShortcuts(),me=d.useMemo(()=>s?Ot():{},[s]),xe=d.useMemo(()=>{if(!s)return[];const t=window.matchMedia("(pointer: coarse)").matches,l=Be.find(A=>A.id==="spawn-agent"),p=Be.find(A=>A.id==="toggle-commander");return[{id:"cmd-spawn",type:"command",title:"Spawn New Agent",subtitle:t?"":l?ot(l):"Alt+N",icon:m.jsx(Z,{name:"plus",size:16}),action:()=>{b.current(),H.current()}},{id:"cmd-commander",type:"command",title:"Commander View",subtitle:t?"":p!=null&&p.key?ot(p):"Tab",icon:m.jsx(Z,{name:"dashboard",size:16}),action:()=>{b.current(),G.current()}},{id:"cmd-settings",type:"command",title:"Settings & Tools",subtitle:"Configure Tide Commander",icon:m.jsx(Z,{name:"gear",size:16}),action:()=>{b.current(),le.current()}},{id:"cmd-monitoring",type:"command",title:"Monitoring & Logs",subtitle:"Triggers, workflows, events",icon:m.jsx(Z,{name:"chart-line",size:16}),action:()=>{var A;b.current(),(A=X.current)==null||A.call(X)}}]},[s,Be]),he=d.useMemo(()=>s?Array.from(x.values()).map(t=>{const l=(I||[]).filter(z=>z.agentId===t.id).map(z=>z.filePath),p=[...new Set(l)],A=p.map(z=>z.split("/").pop()||z),F=[];t.lastAssignedTask&&F.push(t.lastAssignedTask);const T=`${t.class} • ${t.cwd}`;let _=`${t.name} ${t.class} ${t.status} ${t.cwd}`;t.taskLabel&&(_+=` ${t.taskLabel}`),A.length>0&&(_+=` ${A.join(" ")} ${p.join(" ")}`),F.length>0&&(_+=` ${F.join(" ")}`);const j=Date.now()-t.lastActivity;let V;return t.lastAssignedTask&&(t.lastAssignedTask.length>150?V=t.lastAssignedTask.slice(0,150)+"...":V=t.lastAssignedTask),{id:`agent-${t.id}`,type:"agent",title:t.name,subtitle:T,lastUserInput:V,timeAway:j,icon:m.jsx(at,{agent:t,size:20}),_searchText:_,_modifiedFiles:p,_userQueries:F,_agentId:t.id,_lastActivity:t.lastActivity,_taskLabel:t.taskLabel,_status:t.status,action:()=>{b.current(),ct(t.id),k.selectAgent(t.id),k.getState().viewMode!=="flat"&&k.requestTerminalExpand()}}}):[],[s,x,I]),Me=d.useMemo(()=>s?Array.from(S.values()).map(t=>{var l;return{id:`area-${t.id}`,type:"area",title:t.name,subtitle:`${t.assignedAgentIds.length} agents • ${((l=t.directories)==null?void 0:l.length)||0} folders`,icon:m.jsx(Z,{name:"map",size:16}),action:()=>{b.current(),k.selectArea(t.id)}}}):[],[s,S]),We=d.useMemo(()=>{const t=new Map;for(const l of he)l._agentId&&t.set(l._agentId,l);return t},[he]),He=d.useMemo(()=>{const t=new Map;if(!s)return t;for(const l of x.values()){const p=k.getAreaForAgent(l.id);if(!p||p.archived)continue;const A=t.get(p.id);A?A.push(l):t.set(p.id,[l])}return t},[s,x,S]),Ye=d.useMemo(()=>{const t=new Map;for(const l of v)t.has(l.agentId)||t.set(l.agentId,l.timestamp);return t},[v]),Re=d.useMemo(()=>{if(!s)return[];const t=B.trim().toLowerCase(),l=Wt({sortMode:Qs(),agentsWithUnseenOutput:K,getLatestToolTimestamp:F=>Ye.get(F)}),p=Array.from(S.values()).filter(F=>!F.archived).filter(F=>t?F.name.toLowerCase().includes(t):!0).sort((F,T)=>F.name.localeCompare(T.name,void 0,{sensitivity:"base"})),A=[];for(const F of p){const _=(He.get(F.id)||[]).slice().sort(l).map(j=>We.get(j.id)).filter(j=>!!j);!t&&_.length===0||A.push({areaId:F.id,areaName:F.name,areaColor:F.color,agents:_})}return A},[s,B,S,He,We,K,Ye]),Ce=d.useMemo(()=>s?Array.from(E.values()).filter(t=>t.type==="server"||t.type==="boss"||t.type==="database"||t.type==="tests").map(t=>{var j,V,z,Fe,ae;const l=t.status==="running"?"#4ade80":t.status==="stopped"?"#f87171":"#facc15",p=t.type==="boss"?"crown":t.type==="database"?"database":t.type==="tests"?"flask":"desktop",A=t.type==="boss"?"Boss":t.type==="database"?"Database":t.type==="tests"?"Tests":"Server";let F=`${A} • ${t.status}`;if(t.type==="database"&&((V=(j=t.database)==null?void 0:j.connections)!=null&&V.length)){const N=t.database.connections[0];F+=` • ${N.engine} @ ${N.host}`}else t.type==="tests"&&t.folderPath?F=`${A} • ${t.folderPath}`:t.cwd&&(F+=` • ${t.cwd}`);const T=((z=t.pm2Status)==null?void 0:z.ports)||[];let _=`${t.name} ${t.type} ${t.status} ${t.cwd||""} ${((Fe=t.pm2)==null?void 0:Fe.name)||""}`;if(t.type==="tests"&&(_+=` ${t.folderPath||""} tests junit maven`),T.length>0&&(_+=` ${T.join(" ")}`),t.type==="database"&&((ae=t.database)!=null&&ae.connections))for(const N of t.database.connections)_+=` ${N.name} ${N.engine} ${N.host} ${N.database||""} mysql postgresql sql`;return{id:`building-${t.id}`,type:"building",title:t.name,subtitle:F,_ports:T,icon:m.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:4},children:[m.jsx(Z,{name:"status-pending",size:10,weight:"fill",color:l}),m.jsx(Z,{name:p,size:16})]}),_searchText:_,action:()=>{var N;b.current(),t.type==="boss"?U.current(t.id):t.type==="database"?O.current(t.id):t.type==="tests"?k.openTestsBuilding(t.id):t.type==="http"?k.openHttpBuilding(t.id):(N=t.pm2)!=null&&N.enabled&&P.current(t.id)}}}):[],[s,E]),Ve=d.useMemo(()=>{if(!s)return[];const t=I||[],l=new Set,p=[];for(const A of t){if(l.has(A.filePath))continue;l.add(A.filePath);const F=A.filePath.split("/").pop()||A.filePath,T=A.action==="created"?"Created":A.action==="modified"?"Modified":A.action==="deleted"?"Deleted":"Read";if(p.push({id:`modified-${A.filePath}-${A.timestamp}`,type:"modified-file",title:F,subtitle:`${T} by ${A.agentName} • ${A.filePath}`,matchedText:A.filePath,icon:A.action==="deleted"?m.jsx(Z,{name:"trash",size:16}):ut(A.filePath),action:()=>{b.current();const _=Array.from(k.getState().areas.values());for(const j of _)for(const V of j.directories||[])if(A.filePath.startsWith(V)){k.setFileViewerPath(A.filePath),se.current(j.id);return}k.selectAgent(A.agentId)}}),p.length>=50)break}return p},[s,I]),qe=d.useMemo(()=>s?Ge.map(t=>{const l=t.isGitRepo&&t.gitBranch?`${t.path} • ${t.gitBranch}`:t.path;return{id:`folder-${t.path}`,type:"folder",title:t.name,subtitle:l,matchedText:t.path,icon:m.jsx(Z,{name:t.isGitRepo?"git-branch":"folder",size:16}),_searchText:`${t.name} ${t.path}`,_isGitRepo:t.isGitRepo,_gitBranch:t.gitBranch,action:()=>{b.current(),k.openFileExplorer(t.path)}}}):[],[s,Ge]),Se=d.useMemo(()=>s?Ue.map(t=>{const l=t.areaName&&t.areaName!==t.projectName?`${t.projectName} · ${t.areaName}`:t.projectName;return{id:`file-${t.path}`,type:"file",title:t.name,subtitle:t.relativePath,matchedText:`${t.path} ${l}`,icon:ut(t.path),_searchText:`${t.name} ${t.relativePath} ${t.path} ${t.projectName} ${t.areaName}`,_projectName:t.projectName,_areaName:t.areaName,action:()=>{b.current();const p=k.getState().areas.get(t.areaId),A=((p==null?void 0:p.directories)||[]).find(F=>F.replace(/\\/g,"/").replace(/\/+$/,"")===t.projectRoot.replace(/\/+$/,""))||t.projectRoot;k.revealFileInExplorer(t.path,A)}}}):[],[s,Ue]),Xe=d.useMemo(()=>{if(!s)return[];const t=l=>{const p=Date.now()-new Date(l).getTime();return!Number.isFinite(p)||p<0?"":p<36e5?`${Math.max(1,Math.floor(p/6e4))}m`:p<864e5?`${Math.floor(p/36e5)}h`:`${Math.floor(p/864e5)}d`};return ye.rows.map(l=>{const p=Array.from(x.values()).find(_=>_.sessionId===l.sessionId),A=(l.firstPrompt||l.snippet||l.sessionId).slice(0,90),F=[l.projectPath||l.projectDir];p&&F.push(`→ ${p.name}`);const T=t(l.lastModified);return T&&F.push(T),F.push(`${l.totalMatches}×`),{id:`session-${l.sessionId}`,type:"session",title:A,subtitle:F.join(" • "),matchedQuery:l.snippet||void 0,icon:p?m.jsx(at,{agent:p,size:20}):m.jsx(Z,{name:"history",size:16}),action:()=>{var j;b.current();const _=Array.from(k.getState().agents.values()).find(V=>V.sessionId===l.sessionId);_?(ct(_.id),k.selectAgent(_.id),k.getState().viewMode!=="flat"&&k.requestTerminalExpand(),k.requestTerminalSearch(_.id,ye.query)):(j=J.current)==null||j.call(J,{initialQuery:ye.query,initialSessionKey:`${l.projectPath}::${l.sessionId}`})}}})},[s,ye,x]),Je=d.useMemo(()=>new ee(he,{keys:["title","subtitle","_searchText","lastUserInput"],threshold:.4,ignoreLocation:!0,includeScore:!0,includeMatches:!0}),[he]),Ze=d.useMemo(()=>new ee(xe,{keys:["title","subtitle"],threshold:.4,includeScore:!0,includeMatches:!0}),[xe]),et=d.useMemo(()=>new ee(Me,{keys:["title","subtitle"],threshold:.4,includeScore:!0,includeMatches:!0}),[Me]),tt=d.useMemo(()=>new ee(Ve,{keys:["title","subtitle","matchedText"],threshold:.4,ignoreLocation:!0,includeScore:!0,includeMatches:!0}),[Ve]),st=d.useMemo(()=>new ee(Ce,{keys:["title","subtitle","_searchText"],threshold:.4,ignoreLocation:!0,includeScore:!0,includeMatches:!0}),[Ce]),de=d.useMemo(()=>{if(!B.trim()){const g=[];g.push(...Ce);const w=[...he].sort(($,Q)=>{const re=Ie($._agentId,$._lastActivity,me);return Ie(Q._agentId,Q._lastActivity,me)-re});g.push(...w),g.push(...xe.slice(0,2)),g.push(...Me.slice(0,2));const D={};return $s.forEach(($,Q)=>{D[$]=Q}),g.sort(($,Q)=>(D[$.type]??999)-(D[Q.type]??999)),g}const t=B.trim().toLowerCase(),l=Je.search(B).slice(0,8),p=Ze.search(B).slice(0,3),A=et.search(B).slice(0,2),F=tt.search(B).slice(0,3),T=qe.slice(0,8),_=Se.slice(0,Ns),j=st.search(B).filter(g=>{const w=g.score??1;return`${g.item.title} ${g.item.subtitle||""} ${g.item._searchText||""}`.toLowerCase().includes(t)||w<=.2}).slice(0,4),V={agent:6,building:5,folder:4,file:4,command:3,area:2,"modified-file":1,session:0},z=g=>{if(!t)return 1;const w=g.title.toLowerCase();return w===t?6:w.startsWith(t)?5:w.split(/[^a-z0-9]+/i).includes(t)?4:w.includes(t)?3:`${g.subtitle||""} ${g._searchText||""} ${g.matchedText||""}`.toLowerCase().includes(t)?2:1},Fe=(g,w)=>{const D=(1-Math.min(1,w??1))*4;return z(g)*100+(V[g.type]??0)*5+D},ae=new Map,N=(g,w)=>{const D=ae.get(g.type),$={item:g,score:Fe(g,w)};D?D.push($):ae.set(g.type,[$])};for(const g of l){const w={...g.item};if(w._modifiedFiles&&w._modifiedFiles.length>0){const D=w._modifiedFiles.filter($=>{var ne;const Q=((ne=$.split("/").pop())==null?void 0:ne.toLowerCase())||"",re=$.toLowerCase();return Q.includes(t)||re.includes(t)});D.length>0&&(w.matchedFiles=D)}if(w._userQueries&&w._userQueries.length>0){const D=w._userQueries.find($=>$.toLowerCase().includes(t));if(D)if(D.length>200){const Q=D.toLowerCase().indexOf(t),re=Math.max(0,Q-60),ne=Math.min(D.length,Q+t.length+100);w.matchedQuery=(re>0?"...":"")+D.slice(re,ne)+(ne<D.length?"...":"")}else w.matchedQuery=D}N(w,g.score)}for(const g of j)N(g.item,g.score);for(const g of p)N(g.item,g.score);for(const g of A)N(g.item,g.score);for(const g of F)N(g.item,g.score);for(const g of T)N(g,void 0);for(const g of _)N(g,void 0);for(const[g,w]of ae)g==="agent"?w.sort((D,$)=>{const Q=z(D.item),re=z($.item);if(re!==Q)return re-Q;const ne=Ie(D.item._agentId,D.item._lastActivity,me),nt=Ie($.item._agentId,$.item._lastActivity,me);return nt!==ne?nt-ne:$.score-D.score}):w.sort((D,$)=>$.score-D.score);const rt=g=>g.reduce((w,D)=>Math.max(w,D.score),-1),Te=[];Array.from(ae.values()).sort((g,w)=>rt(w)-rt(g)).forEach(g=>{for(const w of g)Te.push(w.item)});for(const g of Xe)Te.push(g);return Te},[B,Je,Ze,et,tt,st,xe,he,Me,Ce,qe,Se,Xe,me]),q=d.useMemo(()=>{switch(Y){case"agents":return de.filter(t=>t.type==="agent");case"buildings":return de.filter(t=>t.type==="building");case"commands":return de.filter(t=>t.type==="command");case"folders":return de.filter(t=>t.type==="folder");case"files":return Se;case"areas":return Re.flatMap(t=>t.agents);case"all":default:return de}},[Y,de,Re,Se]);d.useEffect(()=>{M>=q.length&&R(Math.max(0,q.length-1))},[q.length,M]);const vt=d.useCallback(t=>{if(t.altKey&&!t.ctrlKey&&!t.metaKey&&(t.key==="p"||t.key==="n"||t.key==="P"||t.key==="N")){t.preventDefault(),t.stopPropagation(),t.nativeEvent.stopImmediatePropagation();const l=t.key.toLowerCase();R(l==="p"?p=>p>0?p-1:q.length-1:p=>p<q.length-1?p+1:0);return}switch(t.key){case"Escape":t.preventDefault(),b.current();break;case"ArrowUp":t.preventDefault(),R(l=>l>0?l-1:q.length-1);break;case"ArrowDown":t.preventDefault(),R(l=>l<q.length-1?l+1:0);break;case"Enter":t.preventDefault(),q[M]&&q[M].action();break}},[q,M]),Bt=d.useCallback((t,l)=>{if(!l||!t)return t;const p=t.toLowerCase(),A=l.toLowerCase(),F=[];let T=0,_=p.indexOf(A),j=0;for(;_!==-1;)_>T&&F.push(t.slice(T,_)),F.push($e.createElement("mark",{key:j++,className:"spotlight-highlight"},t.slice(_,_+l.length))),T=_+l.length,_=p.indexOf(A,T);return T<t.length&&F.push(t.slice(T)),F.length>0?$e.createElement($e.Fragment,null,...F):t},[]);return{query:B,setQuery:_t,selectedIndex:M,setSelectedIndex:R,results:q,activeTab:Y,setActiveTab:ve,cycleTab:bt,areaSections:Re,handleKeyDown:vt,highlightMatch:Bt}}const Us=d.forwardRef(function({query:e,onQueryChange:r,onKeyDown:n,onResetSelection:i},o){const{t:c}=be(["common"]);return m.jsxs("div",{className:"spotlight-input-wrapper",children:[m.jsx("span",{className:"spotlight-search-icon",children:"⌘"}),m.jsx("input",{ref:o,type:"text",className:"spotlight-input",placeholder:c("common:search.spotlightPlaceholder"),value:e,onChange:a=>{r(a.target.value),i()},onKeyDown:n,autoFocus:!0,spellCheck:!1}),m.jsxs("div",{className:"spotlight-input-hints",children:[m.jsx("span",{className:"spotlight-shortcut-hint",children:"↑↓"}),m.jsx("span",{className:"spotlight-shortcut-hint",children:"Enter"}),m.jsx("span",{className:"spotlight-shortcut-hint",children:"Esc"})]})]})}),Os=d.memo(function({activeTab:e,onSelect:r}){const{t:n}=be(["terminal"]);return m.jsxs("div",{className:"spotlight-tabs",role:"tablist","aria-label":n("terminal:spotlight.tabsLabel"),children:[fe.map(i=>m.jsx("button",{type:"button",role:"tab","aria-selected":i===e,tabIndex:-1,className:`spotlight-tab${i===e?" active":""}`,onClick:()=>r(i),children:n(`terminal:spotlight.tabs.${i}`)},i)),m.jsx("span",{className:"spotlight-tabs-hint",children:m.jsx("kbd",{children:"Tab"})})]})}),Ws=d.forwardRef(function({results:e,selectedIndex:r,query:n,activeTab:i,areaSections:o,highlightMatch:c,onSelectIndex:a},u){const{t:h}=be(["terminal"]),f=d.useRef(!1);d.useEffect(()=>{f.current=!1},[e]),d.useEffect(()=>{const E=typeof u=="function"?null:u==null?void 0:u.current;if(!E)return;const y=()=>{f.current=!0};return E.addEventListener("mousemove",y),()=>{E.removeEventListener("mousemove",y)}},[u,e]);const x={command:h("terminal:spotlight.categories.commands"),agent:h("terminal:spotlight.categories.agents"),building:h("terminal:spotlight.categories.infrastructure"),area:h("terminal:spotlight.categories.areas"),folder:h("terminal:spotlight.categories.folders"),file:h("terminal:spotlight.categories.files"),"modified-file":h("terminal:spotlight.categories.modifiedFiles"),session:h("terminal:spotlight.categories.sessions")},S=d.useMemo(()=>{const E=[];let y=null,I=[];return e.forEach((v,K)=>{v.type!==y&&(y!==null&&I.length>0&&E.push([y,I]),y=v.type,I=[]),I.push({result:v,index:K})}),y!==null&&I.length>0&&E.push([y,I]),E},[e]);if(d.useEffect(()=>{if(!u||typeof u=="function")return;const E=u.current;if(!E)return;const y=E.querySelector(".spotlight-item.selected");y&&y.scrollIntoView({block:"nearest",behavior:"smooth"})},[r,u]),i==="areas"){if(o.length===0)return m.jsx("div",{className:"spotlight-results",ref:u,children:m.jsx("div",{className:"spotlight-empty",children:h("terminal:spotlight.noResults")})});let E=0;return m.jsx("div",{className:"spotlight-results",ref:u,children:o.map(y=>m.jsxs("div",{children:[m.jsxs("div",{className:"spotlight-category-header spotlight-area-section-header",children:[m.jsx("span",{className:"spotlight-area-dot",style:{background:y.areaColor},"aria-hidden":"true"}),m.jsx("span",{className:"spotlight-area-name",children:y.areaName}),m.jsx("span",{className:"spotlight-area-count",children:y.agents.length})]}),y.agents.length===0?m.jsx("div",{className:"spotlight-area-empty",children:h("terminal:spotlight.noAgentsInArea")}):y.agents.map(I=>{const v=E++;return m.jsx(lt,{result:I,isSelected:v===r,query:n,highlightMatch:c,onClick:()=>I.action(),onMouseEnter:()=>{f.current&&a(v)}},I.id)})]},y.areaId))})}return e.length===0?m.jsx("div",{className:"spotlight-results",ref:u,children:m.jsx("div",{className:"spotlight-empty",children:h("terminal:spotlight.noResults")})}):m.jsx("div",{className:"spotlight-results",ref:u,children:S.map(([E,y])=>m.jsxs("div",{children:[S.length>1&&m.jsx("div",{className:"spotlight-category-header",children:x[E]||E}),y.map(({result:I,index:v})=>m.jsx(lt,{result:I,isSelected:v===r,query:n,highlightMatch:c,onClick:()=>I.action(),onMouseEnter:()=>{f.current&&a(v)}},I.id))]},E))})}),Hs=d.memo(function(){const{t:e}=be(["terminal"]);return m.jsxs("div",{className:"spotlight-footer",children:[m.jsxs("div",{className:"spotlight-footer-left",children:[m.jsxs("span",{className:"spotlight-footer-hint",children:[m.jsx("kbd",{children:"↑"}),m.jsx("kbd",{children:"↓"})," ",m.jsx("kbd",{children:"Alt+N"}),m.jsx("kbd",{children:"Alt+P"})," ",e("terminal:spotlight.navigate")]}),m.jsxs("span",{className:"spotlight-footer-hint",children:[m.jsx("kbd",{children:"Enter"})," ",e("terminal:spotlight.select")]}),m.jsxs("span",{className:"spotlight-footer-hint",children:[m.jsx("kbd",{children:"Tab"})," ",e("terminal:spotlight.switchTabs")]})]}),m.jsx("div",{className:"spotlight-footer-right",children:m.jsxs("span",{className:"spotlight-footer-hint",children:[m.jsx("kbd",{children:"Esc"})," ",e("common:buttons.close")]})})]})}),Ys=768;function Js({isOpen:s,onClose:e,onOpenSpawnModal:r,onOpenCommanderView:n,onOpenToolbox:i,onOpenFileExplorer:o,onOpenPM2LogsModal:c,onOpenBossLogsModal:a,onOpenDatabasePanel:u,onOpenMonitoringModal:h,onOpenSessionFinder:f}){const x=d.useRef(null),S=d.useRef(null),E=d.useRef(null),y=d.useRef(0),{query:I,setQuery:v,selectedIndex:K,setSelectedIndex:b,results:H,activeTab:G,setActiveTab:le,cycleTab:se,areaSections:P,handleKeyDown:U,highlightMatch:O}=Gs({isOpen:s,onClose:e,onOpenSpawnModal:r,onOpenCommanderView:n,onOpenToolbox:i,onOpenFileExplorer:o,onOpenPM2LogsModal:c,onOpenBossLogsModal:a,onOpenDatabasePanel:u,onOpenMonitoringModal:h,onOpenSessionFinder:f});y.current=H.length;const X=d.useRef(se);X.current=se,d.useEffect(()=>{s&&setTimeout(()=>{var L,M;(L=x.current)==null||L.focus(),(M=x.current)==null||M.select()},50)},[s]),d.useEffect(()=>{if(!s)return;const L=window.visualViewport;if(!L||window.innerWidth>Ys)return;const M=()=>{const R=S.current;R&&(R.style.height=`${L.height}px`,R.style.top=`${L.offsetTop}px`)};return M(),L.addEventListener("resize",M),L.addEventListener("scroll",M),()=>{L.removeEventListener("resize",M),L.removeEventListener("scroll",M);const R=S.current;R&&(R.style.height="",R.style.top="")}},[s]),d.useEffect(()=>{if(!s)return;const L=M=>{if(M.key==="Escape"){M.preventDefault(),M.stopPropagation(),M.stopImmediatePropagation(),e();return}if(M.key==="Tab"){M.preventDefault(),M.stopPropagation(),M.stopImmediatePropagation(),X.current(M.shiftKey?-1:1);return}if(M.altKey&&!M.ctrlKey&&!M.metaKey&&(M.key==="n"||M.key==="p"||M.key==="N"||M.key==="P")){M.preventDefault(),M.stopPropagation(),M.stopImmediatePropagation();const R=M.key.toLowerCase(),Y=y.current;b(R==="p"?ce=>ce>0?ce-1:Y-1:ce=>ce<Y-1?ce+1:0);return}};return window.addEventListener("keydown",L,{capture:!0}),()=>{window.removeEventListener("keydown",L,{capture:!0})}},[s,e]);const J=d.useCallback(L=>{L.target===L.currentTarget&&e()},[e]),B=d.useCallback(()=>{b(0)},[b]);return s?m.jsx("div",{ref:S,className:"spotlight-overlay",onClick:J,children:m.jsxs("div",{className:"spotlight-modal",children:[m.jsx(Us,{ref:x,query:I,onQueryChange:v,onKeyDown:U,onResetSelection:B}),m.jsx(Os,{activeTab:G,onSelect:le}),m.jsx(Ws,{ref:E,results:H,selectedIndex:K,query:I,activeTab:G,areaSections:P,highlightMatch:O,onSelectIndex:b}),m.jsx(Hs,{})]})}):null}export{tr as FILE_ICON_NAMES,Js as Spotlight,Hs as SpotlightFooter,Us as SpotlightInput,lt as SpotlightItem,Ws as SpotlightResults,sr as formatDuration,rr as formatRelativeTime,nr as getAgentIcon,ut as getFileIconFromPath,ir as getTypeLabel,Gs as useSpotlightSearch};
1
+ import{c as Rt,d as Tt,z as $t,a0 as Lt,f as kt,bp as jt,bN as Nt,bO as Pt,aa as Kt,r as d,y as zt,S as pe,bP as it,bQ as Qt,bR as Gt,ar as Ut,bS as fe,s as k,bT as Ot,j as m,I as Z,V as ot,bU as ct,n as at,bV as Wt,bW as ut,bX as Ie,U as $e,m as Ht,aq as At,u as be,bY as lt}from"./main-DXG9arLM.js";import{bZ as tr,b_ as sr,b$ as rr,c0 as nr,c1 as ir}from"./main-DXG9arLM.js";import"./vendor-react--Eh9ivFN.js";import"./vendor-three-CBPuP1jE.js";function ie(s){return Array.isArray?Array.isArray(s):xt(s)==="[object Array]"}function Yt(s){if(typeof s=="string")return s;let e=s+"";return e=="0"&&1/s==-1/0?"-0":e}function Vt(s){return s==null?"":Yt(s)}function te(s){return typeof s=="string"}function yt(s){return typeof s=="number"}function qt(s){return s===!0||s===!1||Xt(s)&&xt(s)=="[object Boolean]"}function Et(s){return typeof s=="object"}function Xt(s){return Et(s)&&s!==null}function W(s){return s!=null}function Le(s){return!s.trim().length}function xt(s){return s==null?s===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(s)}const Jt="Incorrect 'index' type",Zt=s=>`Invalid value for key ${s}`,es=s=>`Pattern length exceeds max of ${s}.`,ts=s=>`Missing ${s} property in key`,ss=s=>`Property 'weight' in key '${s}' must be a positive integer`,ht=Object.prototype.hasOwnProperty;class rs{constructor(e){this._keys=[],this._keyMap={};let r=0;e.forEach(n=>{let i=Mt(n);this._keys.push(i),this._keyMap[i.id]=i,r+=i.weight}),this._keys.forEach(n=>{n.weight/=r})}get(e){return this._keyMap[e]}keys(){return this._keys}toJSON(){return JSON.stringify(this._keys)}}function Mt(s){let e=null,r=null,n=null,i=1,o=null;if(te(s)||ie(s))n=s,e=dt(s),r=ke(s);else{if(!ht.call(s,"name"))throw new Error(ts("name"));const c=s.name;if(n=c,ht.call(s,"weight")&&(i=s.weight,i<=0))throw new Error(ss(c));e=dt(c),r=ke(c),o=s.getFn}return{path:e,id:r,weight:i,src:n,getFn:o}}function dt(s){return ie(s)?s:s.split(".")}function ke(s){return ie(s)?s.join("."):s}function ns(s,e){let r=[],n=!1;const i=(o,c,a)=>{if(W(o))if(!c[a])r.push(o);else{let u=c[a];const h=o[u];if(!W(h))return;if(a===c.length-1&&(te(h)||yt(h)||qt(h)))r.push(Vt(h));else if(ie(h)){n=!0;for(let f=0,x=h.length;f<x;f+=1)i(h[f],c,a+1)}else c.length&&i(h,c,a+1)}};return i(s,te(e)?e.split("."):e,0),n?r:r[0]}const is={includeMatches:!1,findAllMatches:!1,minMatchCharLength:1},os={isCaseSensitive:!1,ignoreDiacritics:!1,includeScore:!1,keys:[],shouldSort:!0,sortFn:(s,e)=>s.score===e.score?s.idx<e.idx?-1:1:s.score<e.score?-1:1},cs={location:0,threshold:.6,distance:100},as={useExtendedSearch:!1,getFn:ns,ignoreLocation:!1,ignoreFieldNorm:!1,fieldNormWeight:1};var C={...os,...is,...cs,...as};const us=/[^ ]+/g;function ls(s=1,e=3){const r=new Map,n=Math.pow(10,e);return{get(i){const o=i.match(us).length;if(r.has(o))return r.get(o);const c=1/Math.pow(o,.5*s),a=parseFloat(Math.round(c*n)/n);return r.set(o,a),a},clear(){r.clear()}}}class Qe{constructor({getFn:e=C.getFn,fieldNormWeight:r=C.fieldNormWeight}={}){this.norm=ls(r,3),this.getFn=e,this.isCreated=!1,this.setIndexRecords()}setSources(e=[]){this.docs=e}setIndexRecords(e=[]){this.records=e}setKeys(e=[]){this.keys=e,this._keysMap={},e.forEach((r,n)=>{this._keysMap[r.id]=n})}create(){this.isCreated||!this.docs.length||(this.isCreated=!0,te(this.docs[0])?this.docs.forEach((e,r)=>{this._addString(e,r)}):this.docs.forEach((e,r)=>{this._addObject(e,r)}),this.norm.clear())}add(e){const r=this.size();te(e)?this._addString(e,r):this._addObject(e,r)}removeAt(e){this.records.splice(e,1);for(let r=e,n=this.size();r<n;r+=1)this.records[r].i-=1}getValueForItemAtKeyId(e,r){return e[this._keysMap[r]]}size(){return this.records.length}_addString(e,r){if(!W(e)||Le(e))return;let n={v:e,i:r,n:this.norm.get(e)};this.records.push(n)}_addObject(e,r){let n={i:r,$:{}};this.keys.forEach((i,o)=>{let c=i.getFn?i.getFn(e):this.getFn(e,i.path);if(W(c)){if(ie(c)){let a=[];const u=[{nestedArrIndex:-1,value:c}];for(;u.length;){const{nestedArrIndex:h,value:f}=u.pop();if(W(f))if(te(f)&&!Le(f)){let x={v:f,i:h,n:this.norm.get(f)};a.push(x)}else ie(f)&&f.forEach((x,S)=>{u.push({nestedArrIndex:S,value:x})})}n.$[o]=a}else if(te(c)&&!Le(c)){let a={v:c,n:this.norm.get(c)};n.$[o]=a}}}),this.records.push(n)}toJSON(){return{keys:this.keys,records:this.records}}}function Ct(s,e,{getFn:r=C.getFn,fieldNormWeight:n=C.fieldNormWeight}={}){const i=new Qe({getFn:r,fieldNormWeight:n});return i.setKeys(s.map(Mt)),i.setSources(e),i.create(),i}function hs(s,{getFn:e=C.getFn,fieldNormWeight:r=C.fieldNormWeight}={}){const{keys:n,records:i}=s,o=new Qe({getFn:e,fieldNormWeight:r});return o.setKeys(n),o.setIndexRecords(i),o}function we(s,{errors:e=0,currentLocation:r=0,expectedLocation:n=0,distance:i=C.distance,ignoreLocation:o=C.ignoreLocation}={}){const c=e/s.length;if(o)return c;const a=Math.abs(n-r);return i?c+a/i:a?1:c}function ds(s=[],e=C.minMatchCharLength){let r=[],n=-1,i=-1,o=0;for(let c=s.length;o<c;o+=1){let a=s[o];a&&n===-1?n=o:!a&&n!==-1&&(i=o-1,i-n+1>=e&&r.push([n,i]),n=-1)}return s[o-1]&&o-n>=e&&r.push([n,o-1]),r}const ue=32;function fs(s,e,r,{location:n=C.location,distance:i=C.distance,threshold:o=C.threshold,findAllMatches:c=C.findAllMatches,minMatchCharLength:a=C.minMatchCharLength,includeMatches:u=C.includeMatches,ignoreLocation:h=C.ignoreLocation}={}){if(e.length>ue)throw new Error(es(ue));const f=e.length,x=s.length,S=Math.max(0,Math.min(n,x));let E=o,y=S;const I=a>1||u,v=I?Array(x):[];let K;for(;(K=s.indexOf(e,y))>-1;){let P=we(e,{currentLocation:K,expectedLocation:S,distance:i,ignoreLocation:h});if(E=Math.min(P,E),y=K+f,I){let U=0;for(;U<f;)v[K+U]=1,U+=1}}y=-1;let b=[],H=1,G=f+x;const le=1<<f-1;for(let P=0;P<f;P+=1){let U=0,O=G;for(;U<O;)we(e,{errors:P,currentLocation:S+O,expectedLocation:S,distance:i,ignoreLocation:h})<=E?U=O:G=O,O=Math.floor((G-U)/2+U);G=O;let X=Math.max(1,S-O+1),J=c?x:Math.min(S+O,x)+f,B=Array(J+2);B[J+1]=(1<<P)-1;for(let M=J;M>=X;M-=1){let R=M-1,Y=r[s.charAt(R)];if(I&&(v[R]=+!!Y),B[M]=(B[M+1]<<1|1)&Y,P&&(B[M]|=(b[M+1]|b[M])<<1|1|b[M+1]),B[M]&le&&(H=we(e,{errors:P,currentLocation:R,expectedLocation:S,distance:i,ignoreLocation:h}),H<=E)){if(E=H,y=R,y<=S)break;X=Math.max(1,2*S-y)}}if(we(e,{errors:P+1,currentLocation:S,expectedLocation:S,distance:i,ignoreLocation:h})>E)break;b=B}const se={isMatch:y>=0,score:Math.max(.001,H)};if(I){const P=ds(v,a);P.length?u&&(se.indices=P):se.isMatch=!1}return se}function ms(s){let e={};for(let r=0,n=s.length;r<n;r+=1){const i=s.charAt(r);e[i]=(e[i]||0)|1<<n-r-1}return e}const _e=String.prototype.normalize?(s=>s.normalize("NFD").replace(/[\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08D3-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C04\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D82\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u1885\u1886\u18A9\u1920-\u192B\u1930-\u193B\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1AB0-\u1ABE\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF2-\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DF9\u1DFB-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA880\uA881\uA8B4-\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F]/g,"")):(s=>s);class St{constructor(e,{location:r=C.location,threshold:n=C.threshold,distance:i=C.distance,includeMatches:o=C.includeMatches,findAllMatches:c=C.findAllMatches,minMatchCharLength:a=C.minMatchCharLength,isCaseSensitive:u=C.isCaseSensitive,ignoreDiacritics:h=C.ignoreDiacritics,ignoreLocation:f=C.ignoreLocation}={}){if(this.options={location:r,threshold:n,distance:i,includeMatches:o,findAllMatches:c,minMatchCharLength:a,isCaseSensitive:u,ignoreDiacritics:h,ignoreLocation:f},e=u?e:e.toLowerCase(),e=h?_e(e):e,this.pattern=e,this.chunks=[],!this.pattern.length)return;const x=(E,y)=>{this.chunks.push({pattern:E,alphabet:ms(E),startIndex:y})},S=this.pattern.length;if(S>ue){let E=0;const y=S%ue,I=S-y;for(;E<I;)x(this.pattern.substr(E,ue),E),E+=ue;if(y){const v=S-ue;x(this.pattern.substr(v),v)}}else x(this.pattern,0)}searchIn(e){const{isCaseSensitive:r,ignoreDiacritics:n,includeMatches:i}=this.options;if(e=r?e:e.toLowerCase(),e=n?_e(e):e,this.pattern===e){let I={isMatch:!0,score:0};return i&&(I.indices=[[0,e.length-1]]),I}const{location:o,distance:c,threshold:a,findAllMatches:u,minMatchCharLength:h,ignoreLocation:f}=this.options;let x=[],S=0,E=!1;this.chunks.forEach(({pattern:I,alphabet:v,startIndex:K})=>{const{isMatch:b,score:H,indices:G}=fs(e,I,v,{location:o+K,distance:c,threshold:a,findAllMatches:u,minMatchCharLength:h,includeMatches:i,ignoreLocation:f});b&&(E=!0),S+=H,b&&G&&(x=[...x,...G])});let y={isMatch:E,score:E?S/this.chunks.length:1};return E&&i&&(y.indices=x),y}}class oe{constructor(e){this.pattern=e}static isMultiMatch(e){return ft(e,this.multiRegex)}static isSingleMatch(e){return ft(e,this.singleRegex)}search(){}}function ft(s,e){const r=s.match(e);return r?r[1]:null}class ps extends oe{constructor(e){super(e)}static get type(){return"exact"}static get multiRegex(){return/^="(.*)"$/}static get singleRegex(){return/^=(.*)$/}search(e){const r=e===this.pattern;return{isMatch:r,score:r?0:1,indices:[0,this.pattern.length-1]}}}class gs extends oe{constructor(e){super(e)}static get type(){return"inverse-exact"}static get multiRegex(){return/^!"(.*)"$/}static get singleRegex(){return/^!(.*)$/}search(e){const n=e.indexOf(this.pattern)===-1;return{isMatch:n,score:n?0:1,indices:[0,e.length-1]}}}class As extends oe{constructor(e){super(e)}static get type(){return"prefix-exact"}static get multiRegex(){return/^\^"(.*)"$/}static get singleRegex(){return/^\^(.*)$/}search(e){const r=e.startsWith(this.pattern);return{isMatch:r,score:r?0:1,indices:[0,this.pattern.length-1]}}}class ys extends oe{constructor(e){super(e)}static get type(){return"inverse-prefix-exact"}static get multiRegex(){return/^!\^"(.*)"$/}static get singleRegex(){return/^!\^(.*)$/}search(e){const r=!e.startsWith(this.pattern);return{isMatch:r,score:r?0:1,indices:[0,e.length-1]}}}class Es extends oe{constructor(e){super(e)}static get type(){return"suffix-exact"}static get multiRegex(){return/^"(.*)"\$$/}static get singleRegex(){return/^(.*)\$$/}search(e){const r=e.endsWith(this.pattern);return{isMatch:r,score:r?0:1,indices:[e.length-this.pattern.length,e.length-1]}}}class xs extends oe{constructor(e){super(e)}static get type(){return"inverse-suffix-exact"}static get multiRegex(){return/^!"(.*)"\$$/}static get singleRegex(){return/^!(.*)\$$/}search(e){const r=!e.endsWith(this.pattern);return{isMatch:r,score:r?0:1,indices:[0,e.length-1]}}}class Ft extends oe{constructor(e,{location:r=C.location,threshold:n=C.threshold,distance:i=C.distance,includeMatches:o=C.includeMatches,findAllMatches:c=C.findAllMatches,minMatchCharLength:a=C.minMatchCharLength,isCaseSensitive:u=C.isCaseSensitive,ignoreDiacritics:h=C.ignoreDiacritics,ignoreLocation:f=C.ignoreLocation}={}){super(e),this._bitapSearch=new St(e,{location:r,threshold:n,distance:i,includeMatches:o,findAllMatches:c,minMatchCharLength:a,isCaseSensitive:u,ignoreDiacritics:h,ignoreLocation:f})}static get type(){return"fuzzy"}static get multiRegex(){return/^"(.*)"$/}static get singleRegex(){return/^(.*)$/}search(e){return this._bitapSearch.searchIn(e)}}class It extends oe{constructor(e){super(e)}static get type(){return"include"}static get multiRegex(){return/^'"(.*)"$/}static get singleRegex(){return/^'(.*)$/}search(e){let r=0,n;const i=[],o=this.pattern.length;for(;(n=e.indexOf(this.pattern,r))>-1;)r=n+o,i.push([n,r-1]);const c=!!i.length;return{isMatch:c,score:c?0:1,indices:i}}}const je=[ps,It,As,ys,xs,Es,gs,Ft],mt=je.length,Ms=/ +(?=(?:[^\"]*\"[^\"]*\")*[^\"]*$)/,Cs="|";function Ss(s,e={}){return s.split(Cs).map(r=>{let n=r.trim().split(Ms).filter(o=>o&&!!o.trim()),i=[];for(let o=0,c=n.length;o<c;o+=1){const a=n[o];let u=!1,h=-1;for(;!u&&++h<mt;){const f=je[h];let x=f.isMultiMatch(a);x&&(i.push(new f(x,e)),u=!0)}if(!u)for(h=-1;++h<mt;){const f=je[h];let x=f.isSingleMatch(a);if(x){i.push(new f(x,e));break}}}return i})}const Fs=new Set([Ft.type,It.type]);class Is{constructor(e,{isCaseSensitive:r=C.isCaseSensitive,ignoreDiacritics:n=C.ignoreDiacritics,includeMatches:i=C.includeMatches,minMatchCharLength:o=C.minMatchCharLength,ignoreLocation:c=C.ignoreLocation,findAllMatches:a=C.findAllMatches,location:u=C.location,threshold:h=C.threshold,distance:f=C.distance}={}){this.query=null,this.options={isCaseSensitive:r,ignoreDiacritics:n,includeMatches:i,minMatchCharLength:o,findAllMatches:a,ignoreLocation:c,location:u,threshold:h,distance:f},e=r?e:e.toLowerCase(),e=n?_e(e):e,this.pattern=e,this.query=Ss(this.pattern,this.options)}static condition(e,r){return r.useExtendedSearch}searchIn(e){const r=this.query;if(!r)return{isMatch:!1,score:1};const{includeMatches:n,isCaseSensitive:i,ignoreDiacritics:o}=this.options;e=i?e:e.toLowerCase(),e=o?_e(e):e;let c=0,a=[],u=0;for(let h=0,f=r.length;h<f;h+=1){const x=r[h];a.length=0,c=0;for(let S=0,E=x.length;S<E;S+=1){const y=x[S],{isMatch:I,indices:v,score:K}=y.search(e);if(I){if(c+=1,u+=K,n){const b=y.constructor.type;Fs.has(b)?a=[...a,...v]:a.push(v)}}else{u=0,c=0,a.length=0;break}}if(c){let S={isMatch:!0,score:u/c};return n&&(S.indices=a),S}}return{isMatch:!1,score:1}}}const Ne=[];function ws(...s){Ne.push(...s)}function Pe(s,e){for(let r=0,n=Ne.length;r<n;r+=1){let i=Ne[r];if(i.condition(s,e))return new i(s,e)}return new St(s,e)}const De={AND:"$and",OR:"$or"},Ke={PATH:"$path",PATTERN:"$val"},ze=s=>!!(s[De.AND]||s[De.OR]),_s=s=>!!s[Ke.PATH],Ds=s=>!ie(s)&&Et(s)&&!ze(s),pt=s=>({[De.AND]:Object.keys(s).map(e=>({[e]:s[e]}))});function wt(s,e,{auto:r=!0}={}){const n=i=>{let o=Object.keys(i);const c=_s(i);if(!c&&o.length>1&&!ze(i))return n(pt(i));if(Ds(i)){const u=c?i[Ke.PATH]:o[0],h=c?i[Ke.PATTERN]:i[u];if(!te(h))throw new Error(Zt(u));const f={keyId:ke(u),pattern:h};return r&&(f.searcher=Pe(h,e)),f}let a={children:[],operator:o[0]};return o.forEach(u=>{const h=i[u];ie(h)&&h.forEach(f=>{a.children.push(n(f))})}),a};return ze(s)||(s=pt(s)),n(s)}function bs(s,{ignoreFieldNorm:e=C.ignoreFieldNorm}){s.forEach(r=>{let n=1;r.matches.forEach(({key:i,norm:o,score:c})=>{const a=i?i.weight:null;n*=Math.pow(c===0&&a?Number.EPSILON:c,(a||1)*(e?1:o))}),r.score=n})}function vs(s,e){const r=s.matches;e.matches=[],W(r)&&r.forEach(n=>{if(!W(n.indices)||!n.indices.length)return;const{indices:i,value:o}=n;let c={indices:i,value:o};n.key&&(c.key=n.key.src),n.idx>-1&&(c.refIndex=n.idx),e.matches.push(c)})}function Bs(s,e){e.score=s.score}function Rs(s,e,{includeMatches:r=C.includeMatches,includeScore:n=C.includeScore}={}){const i=[];return r&&i.push(vs),n&&i.push(Bs),s.map(o=>{const{idx:c}=o,a={item:e[c],refIndex:c};return i.length&&i.forEach(u=>{u(o,a)}),a})}class ee{constructor(e,r={},n){this.options={...C,...r},this.options.useExtendedSearch,this._keyStore=new rs(this.options.keys),this.setCollection(e,n)}setCollection(e,r){if(this._docs=e,r&&!(r instanceof Qe))throw new Error(Jt);this._myIndex=r||Ct(this.options.keys,this._docs,{getFn:this.options.getFn,fieldNormWeight:this.options.fieldNormWeight})}add(e){W(e)&&(this._docs.push(e),this._myIndex.add(e))}remove(e=()=>!1){const r=[];for(let n=0,i=this._docs.length;n<i;n+=1){const o=this._docs[n];e(o,n)&&(this.removeAt(n),n-=1,i-=1,r.push(o))}return r}removeAt(e){this._docs.splice(e,1),this._myIndex.removeAt(e)}getIndex(){return this._myIndex}search(e,{limit:r=-1}={}){const{includeMatches:n,includeScore:i,shouldSort:o,sortFn:c,ignoreFieldNorm:a}=this.options;let u=te(e)?te(this._docs[0])?this._searchStringList(e):this._searchObjectList(e):this._searchLogical(e);return bs(u,{ignoreFieldNorm:a}),o&&u.sort(c),yt(r)&&r>-1&&(u=u.slice(0,r)),Rs(u,this._docs,{includeMatches:n,includeScore:i})}_searchStringList(e){const r=Pe(e,this.options),{records:n}=this._myIndex,i=[];return n.forEach(({v:o,i:c,n:a})=>{if(!W(o))return;const{isMatch:u,score:h,indices:f}=r.searchIn(o);u&&i.push({item:o,idx:c,matches:[{score:h,value:o,norm:a,indices:f}]})}),i}_searchLogical(e){const r=wt(e,this.options),n=(a,u,h)=>{if(!a.children){const{keyId:x,searcher:S}=a,E=this._findMatches({key:this._keyStore.get(x),value:this._myIndex.getValueForItemAtKeyId(u,x),searcher:S});return E&&E.length?[{idx:h,item:u,matches:E}]:[]}const f=[];for(let x=0,S=a.children.length;x<S;x+=1){const E=a.children[x],y=n(E,u,h);if(y.length)f.push(...y);else if(a.operator===De.AND)return[]}return f},i=this._myIndex.records,o={},c=[];return i.forEach(({$:a,i:u})=>{if(W(a)){let h=n(r,a,u);h.length&&(o[u]||(o[u]={idx:u,item:a,matches:[]},c.push(o[u])),h.forEach(({matches:f})=>{o[u].matches.push(...f)}))}}),c}_searchObjectList(e){const r=Pe(e,this.options),{keys:n,records:i}=this._myIndex,o=[];return i.forEach(({$:c,i:a})=>{if(!W(c))return;let u=[];n.forEach((h,f)=>{u.push(...this._findMatches({key:h,value:c[f],searcher:r}))}),u.length&&o.push({idx:a,item:c,matches:u})}),o}_findMatches({key:e,value:r,searcher:n}){if(!W(r))return[];let i=[];if(ie(r))r.forEach(({v:o,i:c,n:a})=>{if(!W(o))return;const{isMatch:u,score:h,indices:f}=n.searchIn(o);u&&i.push({score:h,key:e,value:o,idx:c,norm:a,indices:f})});else{const{v:o,n:c}=r,{isMatch:a,score:u,indices:h}=n.searchIn(o);a&&i.push({score:u,key:e,value:o,norm:c,indices:h})}return i}}ee.version="7.1.0";ee.createIndex=Ct;ee.parseIndex=hs;ee.config=C;ee.parseQuery=wt;ws(Is);async function Ts(s){const e=new URLSearchParams({q:s}),r=await Rt(Tt(`/api/folders/search?${e.toString()}`));if(!r.ok){const i=await r.json().catch(()=>({}));throw new Error(i.error||`Failed to search folders: ${r.statusText}`)}const n=await r.json();return Array.isArray(n.folders)?n.folders:[]}const $s=["command","agent","building","area","folder","file","modified-file","session"],Ls=2,ks=2,js=50,Ns=10,Ps=3,Ks=6;function zs(){const s=At(pe.SPOTLIGHT_TAB,"all");return fe.includes(s)?s:"all"}function gt(){return Ht(pe.SPOTLIGHT_QUERY,"")}function Qs(){const s=At(pe.AOP_CONFIG,{});return s.sortMode==="name"||s.sortMode==="status"||s.sortMode==="recent"?s.sortMode:"recent"}function Gs({isOpen:s,onClose:e,onOpenSpawnModal:r,onOpenCommanderView:n,onOpenToolbox:i,onOpenFileExplorer:o,onOpenPM2LogsModal:c,onOpenBossLogsModal:a,onOpenDatabasePanel:u,onOpenMonitoringModal:h,onOpenSessionFinder:f}){const x=$t(),S=Lt(),E=kt(),y=jt(),I=Nt(),v=Pt(),K=Kt(),b=d.useRef(e);b.current=e;const H=d.useRef(r);H.current=r;const G=d.useRef(n);G.current=n;const le=d.useRef(i);le.current=i;const se=d.useRef(o);se.current=o;const P=d.useRef(c);P.current=c;const U=d.useRef(a);U.current=a;const O=d.useRef(u);O.current=u;const X=d.useRef(h);X.current=h;const J=d.useRef(f);J.current=f;const[B,L]=d.useState(gt),[M,R]=d.useState(0),[Y,ce]=d.useState(zs),[Ge,ge]=d.useState([]),[Ue,Ae]=d.useState([]),[ye,Ee]=d.useState({query:"",rows:[]}),_t=d.useCallback(t=>{L(t),zt(pe.SPOTLIGHT_QUERY,t)},[]);d.useEffect(()=>{s&&(L(gt()),R(0))},[s]),d.useEffect(()=>{if(!s){ge([]);return}const t=B.trim();if(t.length<Ls){ge([]);return}let l=!1;const p=setTimeout(()=>{Ts(t).then(A=>{l||ge(A)}).catch(()=>{l||ge([])})},250);return()=>{l=!0,clearTimeout(p)}},[s,B]);const Dt=(y.fileSearchExcludeDirs??it).join(",");d.useEffect(()=>{if(!s){Ae([]);return}const t=B.trim();if(t.length<ks){Ae([]);return}let l=!1;const p=setTimeout(()=>{Qt(t,{exclude:y.fileSearchExcludeDirs??[...it],limit:js}).then(A=>{l||Ae(A)}).catch(()=>{l||Ae([])})},250);return()=>{l=!0,clearTimeout(p)}},[s,B,Dt,y.fileSearchExcludeDirs]),d.useEffect(()=>{if(!s){Ee({query:"",rows:[]});return}const t=B.trim();if(t.length<Ps){Ee({query:"",rows:[]});return}let l=!1;const p=setTimeout(()=>{Gt(t,{limit:Ks}).then(A=>{l||Ee({query:t,rows:A})}).catch(()=>{l||Ee({query:"",rows:[]})})},250);return()=>{l=!0,clearTimeout(p)}},[s,B]);const ve=d.useCallback(t=>{ce(t),Ut(pe.SPOTLIGHT_TAB,t)},[]),Oe=d.useRef(Y);Oe.current=Y;const bt=d.useCallback(t=>{const l=fe.indexOf(Oe.current),p=fe[(l+t+fe.length)%fe.length];ve(p)},[ve]);d.useEffect(()=>{R(0)},[Y]);const Be=k.getShortcuts(),me=d.useMemo(()=>s?Ot():{},[s]),xe=d.useMemo(()=>{if(!s)return[];const t=window.matchMedia("(pointer: coarse)").matches,l=Be.find(A=>A.id==="spawn-agent"),p=Be.find(A=>A.id==="toggle-commander");return[{id:"cmd-spawn",type:"command",title:"Spawn New Agent",subtitle:t?"":l?ot(l):"Alt+N",icon:m.jsx(Z,{name:"plus",size:16}),action:()=>{b.current(),H.current()}},{id:"cmd-commander",type:"command",title:"Commander View",subtitle:t?"":p!=null&&p.key?ot(p):"Tab",icon:m.jsx(Z,{name:"dashboard",size:16}),action:()=>{b.current(),G.current()}},{id:"cmd-settings",type:"command",title:"Settings & Tools",subtitle:"Configure Tide Commander",icon:m.jsx(Z,{name:"gear",size:16}),action:()=>{b.current(),le.current()}},{id:"cmd-monitoring",type:"command",title:"Monitoring & Logs",subtitle:"Triggers, workflows, events",icon:m.jsx(Z,{name:"chart-line",size:16}),action:()=>{var A;b.current(),(A=X.current)==null||A.call(X)}}]},[s,Be]),he=d.useMemo(()=>s?Array.from(x.values()).map(t=>{const l=(I||[]).filter(z=>z.agentId===t.id).map(z=>z.filePath),p=[...new Set(l)],A=p.map(z=>z.split("/").pop()||z),F=[];t.lastAssignedTask&&F.push(t.lastAssignedTask);const T=`${t.class} • ${t.cwd}`;let _=`${t.name} ${t.class} ${t.status} ${t.cwd}`;t.taskLabel&&(_+=` ${t.taskLabel}`),A.length>0&&(_+=` ${A.join(" ")} ${p.join(" ")}`),F.length>0&&(_+=` ${F.join(" ")}`);const j=Date.now()-t.lastActivity;let V;return t.lastAssignedTask&&(t.lastAssignedTask.length>150?V=t.lastAssignedTask.slice(0,150)+"...":V=t.lastAssignedTask),{id:`agent-${t.id}`,type:"agent",title:t.name,subtitle:T,lastUserInput:V,timeAway:j,icon:m.jsx(at,{agent:t,size:20}),_searchText:_,_modifiedFiles:p,_userQueries:F,_agentId:t.id,_lastActivity:t.lastActivity,_taskLabel:t.taskLabel,_status:t.status,action:()=>{b.current(),ct(t.id),k.selectAgent(t.id),k.getState().viewMode!=="flat"&&k.requestTerminalExpand()}}}):[],[s,x,I]),Me=d.useMemo(()=>s?Array.from(S.values()).map(t=>{var l;return{id:`area-${t.id}`,type:"area",title:t.name,subtitle:`${t.assignedAgentIds.length} agents • ${((l=t.directories)==null?void 0:l.length)||0} folders`,icon:m.jsx(Z,{name:"map",size:16}),action:()=>{b.current(),k.selectArea(t.id)}}}):[],[s,S]),We=d.useMemo(()=>{const t=new Map;for(const l of he)l._agentId&&t.set(l._agentId,l);return t},[he]),He=d.useMemo(()=>{const t=new Map;if(!s)return t;for(const l of x.values()){const p=k.getAreaForAgent(l.id);if(!p||p.archived)continue;const A=t.get(p.id);A?A.push(l):t.set(p.id,[l])}return t},[s,x,S]),Ye=d.useMemo(()=>{const t=new Map;for(const l of v)t.has(l.agentId)||t.set(l.agentId,l.timestamp);return t},[v]),Re=d.useMemo(()=>{if(!s)return[];const t=B.trim().toLowerCase(),l=Wt({sortMode:Qs(),agentsWithUnseenOutput:K,getLatestToolTimestamp:F=>Ye.get(F)}),p=Array.from(S.values()).filter(F=>!F.archived).filter(F=>t?F.name.toLowerCase().includes(t):!0).sort((F,T)=>F.name.localeCompare(T.name,void 0,{sensitivity:"base"})),A=[];for(const F of p){const _=(He.get(F.id)||[]).slice().sort(l).map(j=>We.get(j.id)).filter(j=>!!j);!t&&_.length===0||A.push({areaId:F.id,areaName:F.name,areaColor:F.color,agents:_})}return A},[s,B,S,He,We,K,Ye]),Ce=d.useMemo(()=>s?Array.from(E.values()).filter(t=>t.type==="server"||t.type==="boss"||t.type==="database"||t.type==="tests").map(t=>{var j,V,z,Fe,ae;const l=t.status==="running"?"#4ade80":t.status==="stopped"?"#f87171":"#facc15",p=t.type==="boss"?"crown":t.type==="database"?"database":t.type==="tests"?"flask":"desktop",A=t.type==="boss"?"Boss":t.type==="database"?"Database":t.type==="tests"?"Tests":"Server";let F=`${A} • ${t.status}`;if(t.type==="database"&&((V=(j=t.database)==null?void 0:j.connections)!=null&&V.length)){const N=t.database.connections[0];F+=` • ${N.engine} @ ${N.host}`}else t.type==="tests"&&t.folderPath?F=`${A} • ${t.folderPath}`:t.cwd&&(F+=` • ${t.cwd}`);const T=((z=t.pm2Status)==null?void 0:z.ports)||[];let _=`${t.name} ${t.type} ${t.status} ${t.cwd||""} ${((Fe=t.pm2)==null?void 0:Fe.name)||""}`;if(t.type==="tests"&&(_+=` ${t.folderPath||""} tests junit maven`),T.length>0&&(_+=` ${T.join(" ")}`),t.type==="database"&&((ae=t.database)!=null&&ae.connections))for(const N of t.database.connections)_+=` ${N.name} ${N.engine} ${N.host} ${N.database||""} mysql postgresql sql`;return{id:`building-${t.id}`,type:"building",title:t.name,subtitle:F,_ports:T,icon:m.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:4},children:[m.jsx(Z,{name:"status-pending",size:10,weight:"fill",color:l}),m.jsx(Z,{name:p,size:16})]}),_searchText:_,action:()=>{var N;b.current(),t.type==="boss"?U.current(t.id):t.type==="database"?O.current(t.id):t.type==="tests"?k.openTestsBuilding(t.id):t.type==="http"?k.openHttpBuilding(t.id):(N=t.pm2)!=null&&N.enabled&&P.current(t.id)}}}):[],[s,E]),Ve=d.useMemo(()=>{if(!s)return[];const t=I||[],l=new Set,p=[];for(const A of t){if(l.has(A.filePath))continue;l.add(A.filePath);const F=A.filePath.split("/").pop()||A.filePath,T=A.action==="created"?"Created":A.action==="modified"?"Modified":A.action==="deleted"?"Deleted":"Read";if(p.push({id:`modified-${A.filePath}-${A.timestamp}`,type:"modified-file",title:F,subtitle:`${T} by ${A.agentName} • ${A.filePath}`,matchedText:A.filePath,icon:A.action==="deleted"?m.jsx(Z,{name:"trash",size:16}):ut(A.filePath),action:()=>{b.current();const _=Array.from(k.getState().areas.values());for(const j of _)for(const V of j.directories||[])if(A.filePath.startsWith(V)){k.setFileViewerPath(A.filePath),se.current(j.id);return}k.selectAgent(A.agentId)}}),p.length>=50)break}return p},[s,I]),qe=d.useMemo(()=>s?Ge.map(t=>{const l=t.isGitRepo&&t.gitBranch?`${t.path} • ${t.gitBranch}`:t.path;return{id:`folder-${t.path}`,type:"folder",title:t.name,subtitle:l,matchedText:t.path,icon:m.jsx(Z,{name:t.isGitRepo?"git-branch":"folder",size:16}),_searchText:`${t.name} ${t.path}`,_isGitRepo:t.isGitRepo,_gitBranch:t.gitBranch,action:()=>{b.current(),k.openFileExplorer(t.path)}}}):[],[s,Ge]),Se=d.useMemo(()=>s?Ue.map(t=>{const l=t.areaName&&t.areaName!==t.projectName?`${t.projectName} · ${t.areaName}`:t.projectName;return{id:`file-${t.path}`,type:"file",title:t.name,subtitle:t.relativePath,matchedText:`${t.path} ${l}`,icon:ut(t.path),_searchText:`${t.name} ${t.relativePath} ${t.path} ${t.projectName} ${t.areaName}`,_projectName:t.projectName,_areaName:t.areaName,action:()=>{b.current();const p=k.getState().areas.get(t.areaId),A=((p==null?void 0:p.directories)||[]).find(F=>F.replace(/\\/g,"/").replace(/\/+$/,"")===t.projectRoot.replace(/\/+$/,""))||t.projectRoot;k.revealFileInExplorer(t.path,A)}}}):[],[s,Ue]),Xe=d.useMemo(()=>{if(!s)return[];const t=l=>{const p=Date.now()-new Date(l).getTime();return!Number.isFinite(p)||p<0?"":p<36e5?`${Math.max(1,Math.floor(p/6e4))}m`:p<864e5?`${Math.floor(p/36e5)}h`:`${Math.floor(p/864e5)}d`};return ye.rows.map(l=>{const p=Array.from(x.values()).find(_=>_.sessionId===l.sessionId),A=(l.firstPrompt||l.snippet||l.sessionId).slice(0,90),F=[l.projectPath||l.projectDir];p&&F.push(`→ ${p.name}`);const T=t(l.lastModified);return T&&F.push(T),F.push(`${l.totalMatches}×`),{id:`session-${l.sessionId}`,type:"session",title:A,subtitle:F.join(" • "),matchedQuery:l.snippet||void 0,icon:p?m.jsx(at,{agent:p,size:20}):m.jsx(Z,{name:"history",size:16}),action:()=>{var j;b.current();const _=Array.from(k.getState().agents.values()).find(V=>V.sessionId===l.sessionId);_?(ct(_.id),k.selectAgent(_.id),k.getState().viewMode!=="flat"&&k.requestTerminalExpand(),k.requestTerminalSearch(_.id,ye.query)):(j=J.current)==null||j.call(J,{initialQuery:ye.query,initialSessionKey:`${l.projectPath}::${l.sessionId}`})}}})},[s,ye,x]),Je=d.useMemo(()=>new ee(he,{keys:["title","subtitle","_searchText","lastUserInput"],threshold:.4,ignoreLocation:!0,includeScore:!0,includeMatches:!0}),[he]),Ze=d.useMemo(()=>new ee(xe,{keys:["title","subtitle"],threshold:.4,includeScore:!0,includeMatches:!0}),[xe]),et=d.useMemo(()=>new ee(Me,{keys:["title","subtitle"],threshold:.4,includeScore:!0,includeMatches:!0}),[Me]),tt=d.useMemo(()=>new ee(Ve,{keys:["title","subtitle","matchedText"],threshold:.4,ignoreLocation:!0,includeScore:!0,includeMatches:!0}),[Ve]),st=d.useMemo(()=>new ee(Ce,{keys:["title","subtitle","_searchText"],threshold:.4,ignoreLocation:!0,includeScore:!0,includeMatches:!0}),[Ce]),de=d.useMemo(()=>{if(!B.trim()){const g=[];g.push(...Ce);const w=[...he].sort(($,Q)=>{const re=Ie($._agentId,$._lastActivity,me);return Ie(Q._agentId,Q._lastActivity,me)-re});g.push(...w),g.push(...xe.slice(0,2)),g.push(...Me.slice(0,2));const D={};return $s.forEach(($,Q)=>{D[$]=Q}),g.sort(($,Q)=>(D[$.type]??999)-(D[Q.type]??999)),g}const t=B.trim().toLowerCase(),l=Je.search(B).slice(0,8),p=Ze.search(B).slice(0,3),A=et.search(B).slice(0,2),F=tt.search(B).slice(0,3),T=qe.slice(0,8),_=Se.slice(0,Ns),j=st.search(B).filter(g=>{const w=g.score??1;return`${g.item.title} ${g.item.subtitle||""} ${g.item._searchText||""}`.toLowerCase().includes(t)||w<=.2}).slice(0,4),V={agent:6,building:5,folder:4,file:4,command:3,area:2,"modified-file":1,session:0},z=g=>{if(!t)return 1;const w=g.title.toLowerCase();return w===t?6:w.startsWith(t)?5:w.split(/[^a-z0-9]+/i).includes(t)?4:w.includes(t)?3:`${g.subtitle||""} ${g._searchText||""} ${g.matchedText||""}`.toLowerCase().includes(t)?2:1},Fe=(g,w)=>{const D=(1-Math.min(1,w??1))*4;return z(g)*100+(V[g.type]??0)*5+D},ae=new Map,N=(g,w)=>{const D=ae.get(g.type),$={item:g,score:Fe(g,w)};D?D.push($):ae.set(g.type,[$])};for(const g of l){const w={...g.item};if(w._modifiedFiles&&w._modifiedFiles.length>0){const D=w._modifiedFiles.filter($=>{var ne;const Q=((ne=$.split("/").pop())==null?void 0:ne.toLowerCase())||"",re=$.toLowerCase();return Q.includes(t)||re.includes(t)});D.length>0&&(w.matchedFiles=D)}if(w._userQueries&&w._userQueries.length>0){const D=w._userQueries.find($=>$.toLowerCase().includes(t));if(D)if(D.length>200){const Q=D.toLowerCase().indexOf(t),re=Math.max(0,Q-60),ne=Math.min(D.length,Q+t.length+100);w.matchedQuery=(re>0?"...":"")+D.slice(re,ne)+(ne<D.length?"...":"")}else w.matchedQuery=D}N(w,g.score)}for(const g of j)N(g.item,g.score);for(const g of p)N(g.item,g.score);for(const g of A)N(g.item,g.score);for(const g of F)N(g.item,g.score);for(const g of T)N(g,void 0);for(const g of _)N(g,void 0);for(const[g,w]of ae)g==="agent"?w.sort((D,$)=>{const Q=z(D.item),re=z($.item);if(re!==Q)return re-Q;const ne=Ie(D.item._agentId,D.item._lastActivity,me),nt=Ie($.item._agentId,$.item._lastActivity,me);return nt!==ne?nt-ne:$.score-D.score}):w.sort((D,$)=>$.score-D.score);const rt=g=>g.reduce((w,D)=>Math.max(w,D.score),-1),Te=[];Array.from(ae.values()).sort((g,w)=>rt(w)-rt(g)).forEach(g=>{for(const w of g)Te.push(w.item)});for(const g of Xe)Te.push(g);return Te},[B,Je,Ze,et,tt,st,xe,he,Me,Ce,qe,Se,Xe,me]),q=d.useMemo(()=>{switch(Y){case"agents":return de.filter(t=>t.type==="agent");case"buildings":return de.filter(t=>t.type==="building");case"commands":return de.filter(t=>t.type==="command");case"folders":return de.filter(t=>t.type==="folder");case"files":return Se;case"areas":return Re.flatMap(t=>t.agents);case"all":default:return de}},[Y,de,Re,Se]);d.useEffect(()=>{M>=q.length&&R(Math.max(0,q.length-1))},[q.length,M]);const vt=d.useCallback(t=>{if(t.altKey&&!t.ctrlKey&&!t.metaKey&&(t.key==="p"||t.key==="n"||t.key==="P"||t.key==="N")){t.preventDefault(),t.stopPropagation(),t.nativeEvent.stopImmediatePropagation();const l=t.key.toLowerCase();R(l==="p"?p=>p>0?p-1:q.length-1:p=>p<q.length-1?p+1:0);return}switch(t.key){case"Escape":t.preventDefault(),b.current();break;case"ArrowUp":t.preventDefault(),R(l=>l>0?l-1:q.length-1);break;case"ArrowDown":t.preventDefault(),R(l=>l<q.length-1?l+1:0);break;case"Enter":t.preventDefault(),q[M]&&q[M].action();break}},[q,M]),Bt=d.useCallback((t,l)=>{if(!l||!t)return t;const p=t.toLowerCase(),A=l.toLowerCase(),F=[];let T=0,_=p.indexOf(A),j=0;for(;_!==-1;)_>T&&F.push(t.slice(T,_)),F.push($e.createElement("mark",{key:j++,className:"spotlight-highlight"},t.slice(_,_+l.length))),T=_+l.length,_=p.indexOf(A,T);return T<t.length&&F.push(t.slice(T)),F.length>0?$e.createElement($e.Fragment,null,...F):t},[]);return{query:B,setQuery:_t,selectedIndex:M,setSelectedIndex:R,results:q,activeTab:Y,setActiveTab:ve,cycleTab:bt,areaSections:Re,handleKeyDown:vt,highlightMatch:Bt}}const Us=d.forwardRef(function({query:e,onQueryChange:r,onKeyDown:n,onResetSelection:i},o){const{t:c}=be(["common"]);return m.jsxs("div",{className:"spotlight-input-wrapper",children:[m.jsx("span",{className:"spotlight-search-icon",children:"⌘"}),m.jsx("input",{ref:o,type:"text",className:"spotlight-input",placeholder:c("common:search.spotlightPlaceholder"),value:e,onChange:a=>{r(a.target.value),i()},onKeyDown:n,autoFocus:!0,spellCheck:!1}),m.jsxs("div",{className:"spotlight-input-hints",children:[m.jsx("span",{className:"spotlight-shortcut-hint",children:"↑↓"}),m.jsx("span",{className:"spotlight-shortcut-hint",children:"Enter"}),m.jsx("span",{className:"spotlight-shortcut-hint",children:"Esc"})]})]})}),Os=d.memo(function({activeTab:e,onSelect:r}){const{t:n}=be(["terminal"]);return m.jsxs("div",{className:"spotlight-tabs",role:"tablist","aria-label":n("terminal:spotlight.tabsLabel"),children:[fe.map(i=>m.jsx("button",{type:"button",role:"tab","aria-selected":i===e,tabIndex:-1,className:`spotlight-tab${i===e?" active":""}`,onClick:()=>r(i),children:n(`terminal:spotlight.tabs.${i}`)},i)),m.jsx("span",{className:"spotlight-tabs-hint",children:m.jsx("kbd",{children:"Tab"})})]})}),Ws=d.forwardRef(function({results:e,selectedIndex:r,query:n,activeTab:i,areaSections:o,highlightMatch:c,onSelectIndex:a},u){const{t:h}=be(["terminal"]),f=d.useRef(!1);d.useEffect(()=>{f.current=!1},[e]),d.useEffect(()=>{const E=typeof u=="function"?null:u==null?void 0:u.current;if(!E)return;const y=()=>{f.current=!0};return E.addEventListener("mousemove",y),()=>{E.removeEventListener("mousemove",y)}},[u,e]);const x={command:h("terminal:spotlight.categories.commands"),agent:h("terminal:spotlight.categories.agents"),building:h("terminal:spotlight.categories.infrastructure"),area:h("terminal:spotlight.categories.areas"),folder:h("terminal:spotlight.categories.folders"),file:h("terminal:spotlight.categories.files"),"modified-file":h("terminal:spotlight.categories.modifiedFiles"),session:h("terminal:spotlight.categories.sessions")},S=d.useMemo(()=>{const E=[];let y=null,I=[];return e.forEach((v,K)=>{v.type!==y&&(y!==null&&I.length>0&&E.push([y,I]),y=v.type,I=[]),I.push({result:v,index:K})}),y!==null&&I.length>0&&E.push([y,I]),E},[e]);if(d.useEffect(()=>{if(!u||typeof u=="function")return;const E=u.current;if(!E)return;const y=E.querySelector(".spotlight-item.selected");y&&y.scrollIntoView({block:"nearest",behavior:"smooth"})},[r,u]),i==="areas"){if(o.length===0)return m.jsx("div",{className:"spotlight-results",ref:u,children:m.jsx("div",{className:"spotlight-empty",children:h("terminal:spotlight.noResults")})});let E=0;return m.jsx("div",{className:"spotlight-results",ref:u,children:o.map(y=>m.jsxs("div",{children:[m.jsxs("div",{className:"spotlight-category-header spotlight-area-section-header",children:[m.jsx("span",{className:"spotlight-area-dot",style:{background:y.areaColor},"aria-hidden":"true"}),m.jsx("span",{className:"spotlight-area-name",children:y.areaName}),m.jsx("span",{className:"spotlight-area-count",children:y.agents.length})]}),y.agents.length===0?m.jsx("div",{className:"spotlight-area-empty",children:h("terminal:spotlight.noAgentsInArea")}):y.agents.map(I=>{const v=E++;return m.jsx(lt,{result:I,isSelected:v===r,query:n,highlightMatch:c,onClick:()=>I.action(),onMouseEnter:()=>{f.current&&a(v)}},I.id)})]},y.areaId))})}return e.length===0?m.jsx("div",{className:"spotlight-results",ref:u,children:m.jsx("div",{className:"spotlight-empty",children:h("terminal:spotlight.noResults")})}):m.jsx("div",{className:"spotlight-results",ref:u,children:S.map(([E,y])=>m.jsxs("div",{children:[S.length>1&&m.jsx("div",{className:"spotlight-category-header",children:x[E]||E}),y.map(({result:I,index:v})=>m.jsx(lt,{result:I,isSelected:v===r,query:n,highlightMatch:c,onClick:()=>I.action(),onMouseEnter:()=>{f.current&&a(v)}},I.id))]},E))})}),Hs=d.memo(function(){const{t:e}=be(["terminal"]);return m.jsxs("div",{className:"spotlight-footer",children:[m.jsxs("div",{className:"spotlight-footer-left",children:[m.jsxs("span",{className:"spotlight-footer-hint",children:[m.jsx("kbd",{children:"↑"}),m.jsx("kbd",{children:"↓"})," ",m.jsx("kbd",{children:"Alt+N"}),m.jsx("kbd",{children:"Alt+P"})," ",e("terminal:spotlight.navigate")]}),m.jsxs("span",{className:"spotlight-footer-hint",children:[m.jsx("kbd",{children:"Enter"})," ",e("terminal:spotlight.select")]}),m.jsxs("span",{className:"spotlight-footer-hint",children:[m.jsx("kbd",{children:"Tab"})," ",e("terminal:spotlight.switchTabs")]})]}),m.jsx("div",{className:"spotlight-footer-right",children:m.jsxs("span",{className:"spotlight-footer-hint",children:[m.jsx("kbd",{children:"Esc"})," ",e("common:buttons.close")]})})]})}),Ys=768;function Js({isOpen:s,onClose:e,onOpenSpawnModal:r,onOpenCommanderView:n,onOpenToolbox:i,onOpenFileExplorer:o,onOpenPM2LogsModal:c,onOpenBossLogsModal:a,onOpenDatabasePanel:u,onOpenMonitoringModal:h,onOpenSessionFinder:f}){const x=d.useRef(null),S=d.useRef(null),E=d.useRef(null),y=d.useRef(0),{query:I,setQuery:v,selectedIndex:K,setSelectedIndex:b,results:H,activeTab:G,setActiveTab:le,cycleTab:se,areaSections:P,handleKeyDown:U,highlightMatch:O}=Gs({isOpen:s,onClose:e,onOpenSpawnModal:r,onOpenCommanderView:n,onOpenToolbox:i,onOpenFileExplorer:o,onOpenPM2LogsModal:c,onOpenBossLogsModal:a,onOpenDatabasePanel:u,onOpenMonitoringModal:h,onOpenSessionFinder:f});y.current=H.length;const X=d.useRef(se);X.current=se,d.useEffect(()=>{s&&setTimeout(()=>{var L,M;(L=x.current)==null||L.focus(),(M=x.current)==null||M.select()},50)},[s]),d.useEffect(()=>{if(!s)return;const L=window.visualViewport;if(!L||window.innerWidth>Ys)return;const M=()=>{const R=S.current;R&&(R.style.height=`${L.height}px`,R.style.top=`${L.offsetTop}px`)};return M(),L.addEventListener("resize",M),L.addEventListener("scroll",M),()=>{L.removeEventListener("resize",M),L.removeEventListener("scroll",M);const R=S.current;R&&(R.style.height="",R.style.top="")}},[s]),d.useEffect(()=>{if(!s)return;const L=M=>{if(M.key==="Escape"){M.preventDefault(),M.stopPropagation(),M.stopImmediatePropagation(),e();return}if(M.key==="Tab"){M.preventDefault(),M.stopPropagation(),M.stopImmediatePropagation(),X.current(M.shiftKey?-1:1);return}if(M.altKey&&!M.ctrlKey&&!M.metaKey&&(M.key==="n"||M.key==="p"||M.key==="N"||M.key==="P")){M.preventDefault(),M.stopPropagation(),M.stopImmediatePropagation();const R=M.key.toLowerCase(),Y=y.current;b(R==="p"?ce=>ce>0?ce-1:Y-1:ce=>ce<Y-1?ce+1:0);return}};return window.addEventListener("keydown",L,{capture:!0}),()=>{window.removeEventListener("keydown",L,{capture:!0})}},[s,e]);const J=d.useCallback(L=>{L.target===L.currentTarget&&e()},[e]),B=d.useCallback(()=>{b(0)},[b]);return s?m.jsx("div",{ref:S,className:"spotlight-overlay",onClick:J,children:m.jsxs("div",{className:"spotlight-modal",children:[m.jsx(Us,{ref:x,query:I,onQueryChange:v,onKeyDown:U,onResetSelection:B}),m.jsx(Os,{activeTab:G,onSelect:le}),m.jsx(Ws,{ref:E,results:H,selectedIndex:K,query:I,activeTab:G,areaSections:P,highlightMatch:O,onSelectIndex:b}),m.jsx(Hs,{})]})}):null}export{tr as FILE_ICON_NAMES,Js as Spotlight,Hs as SpotlightFooter,Us as SpotlightInput,lt as SpotlightItem,Ws as SpotlightResults,sr as formatDuration,rr as formatRelativeTime,nr as getAgentIcon,ut as getFileIconFromPath,ir as getTypeLabel,Gs as useSpotlightSearch};