@inkeep/open-knowledge 0.75.0 → 0.76.0-beta.1

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 (173) hide show
  1. package/dist/assets/skills/project/SKILL.md +1 -1
  2. package/dist/{chunk-XKWWSDBF-CiyukTrj.mjs → chunk-XKWWSDBF-D2uvTQ0O.mjs} +2 -2
  3. package/dist/cli.mjs +56 -56
  4. package/dist/constants-CqleiXu2.mjs +1 -0
  5. package/dist/dist-BYaz0taZ.mjs +1 -0
  6. package/dist/{dist-CwMAFvDv.mjs → dist-D0pUzrgW.mjs} +467 -467
  7. package/dist/{flag-coverage-6JEX67RU-Byy8DkC9.mjs → flag-coverage-6JEX67RU-DTi4Xp7_.mjs} +1 -1
  8. package/dist/index.mjs +55 -55
  9. package/dist/init-CzdH5YhF.mjs +1 -0
  10. package/dist/{init-DLDxilxo.mjs → init-D35_7qCz.mjs} +14 -14
  11. package/dist/{js-exec-VXN6TZ7U-D--44jnh.mjs → js-exec-VXN6TZ7U-CMKRxSof.mjs} +3 -3
  12. package/dist/{js-exec-VXN6TZ7U-Z8_USGOo.mjs → js-exec-VXN6TZ7U-DW1z0_f3.mjs} +4 -4
  13. package/dist/{launch-json-removal-Dne2MJOy.mjs → launch-json-removal-DfVWRHc2.mjs} +1 -1
  14. package/dist/{loader-0uPLVRGr.mjs → loader-Il_r9h-s.mjs} +1 -1
  15. package/dist/loader-TircuzL8.mjs +1 -0
  16. package/dist/{md-manager-BGnqyqi1-Bwg54lLG.mjs → md-manager-BGnqyqi1-BZhj8566.mjs} +1 -1
  17. package/dist/{open-browser-BhyyMblU.mjs → open-browser-5wS5161m.mjs} +1 -1
  18. package/dist/parse-worker.mjs +1 -1
  19. package/dist/{preview-Bs9fHq-d.mjs → preview-B_F6SpZs.mjs} +1 -1
  20. package/dist/preview-D14ciGsV.mjs +1 -0
  21. package/dist/public/assets/{ActivityModeContent-CzSm_J9T.js → ActivityModeContent-CdOOmDnv.js} +1 -1
  22. package/dist/public/assets/{AddPropertiesButton-BSIajwKD.js → AddPropertiesButton-D94DERhh.js} +2 -2
  23. package/dist/public/assets/{AgentDiffPane-Vp3earvv.js → AgentDiffPane-BYWv05nU.js} +1 -1
  24. package/dist/public/assets/{AgentIconCluster-CfR3DGT6.js → AgentIconCluster-BjhMMJvg.js} +1 -1
  25. package/dist/public/assets/AgentThreadClientBinder-9BUeCC2i.js +1 -0
  26. package/dist/public/assets/{BugReportHistory-wGv5lBCh.js → BugReportHistory-DRk2wfmX.js} +1 -1
  27. package/dist/public/assets/{BugReportHistoryDialog-BO-UIVXb.js → BugReportHistoryDialog-BRt_mvxb.js} +1 -1
  28. package/dist/public/assets/{CodeMirrorPropInput-s4NvdTOo.js → CodeMirrorPropInput-BfFHUIPT.js} +1 -1
  29. package/dist/public/assets/{ConsentDialogBody-Bf0K9cnD.js → ConsentDialogBody-LH1oK-K1.js} +1 -1
  30. package/dist/public/assets/{DiffViewBoundary-DBwmHY1V.js → DiffViewBoundary-CHGMiI3o.js} +1 -1
  31. package/dist/public/assets/{DocumentContext-VTBMqEb0.js → DocumentContext-CmobwhDV.js} +1 -1
  32. package/dist/public/assets/{EditorModeToggle-Cpv-xFsl.js → EditorModeToggle-Ceb7UENC.js} +1 -1
  33. package/dist/public/assets/{EnableSyncConfirmDialog-rknOqm6H.js → EnableSyncConfirmDialog-3Y8YTBbR.js} +1 -1
  34. package/dist/public/assets/{ExcalidrawDocEditor-CBg9Pna8.js → ExcalidrawDocEditor-BGifKKc5.js} +1 -1
  35. package/dist/public/assets/FeedbackForm-DcQmM7vN.js +1 -0
  36. package/dist/public/assets/{GraphPanel-m6aQydCS.js → GraphPanel-7OJGN-lc.js} +1 -1
  37. package/dist/public/assets/{ImageAttachments-D7kmZzVk.js → ImageAttachments-NcjC3Vh7.js} +1 -1
  38. package/dist/public/assets/{ImportSkillDialog-BI9tnsOw.js → ImportSkillDialog-uibV-E0W.js} +1 -1
  39. package/dist/public/assets/{LintConfigEditor-CfOGOym9.js → LintConfigEditor-oHvdt6bD.js} +1 -1
  40. package/dist/public/assets/ManagedArtifactProperties-BPFT0XnN.js +1 -0
  41. package/dist/public/assets/{ManagedArtifactProperties-DRTI5JKU.js → ManagedArtifactProperties-DYixzgyO.js} +1 -1
  42. package/dist/public/assets/{MermaidDocEditor-QKcOaTIl.js → MermaidDocEditor-BAXy9Wq3.js} +1 -1
  43. package/dist/public/assets/{OpenInAgentMenuItem-eAQLnvt7.js → OpenInAgentMenuItem-BOkiSyJj.js} +1 -1
  44. package/dist/public/assets/{PropertyDisplayRow-C9msjkJt.js → PropertyDisplayRow-CpY_83p_.js} +1 -1
  45. package/dist/public/assets/{RegisteredAgentIcon-Dgk7CcwE.js → RegisteredAgentIcon-wza-YtV5.js} +1 -1
  46. package/dist/public/assets/{ReportBugDialogBody-BveANp3B.js → ReportBugDialogBody-DzspPXQX.js} +1 -1
  47. package/dist/public/assets/{ReportBugMenuTrigger-NLoVL3Gm.js → ReportBugMenuTrigger-lEPMbjE8.js} +2 -2
  48. package/dist/public/assets/{SchemaConfigEditor-bEeFeqG6.js → SchemaConfigEditor-eP12D_vE.js} +1 -1
  49. package/dist/public/assets/SessionsHost-CzyeLm35.js +2 -0
  50. package/dist/public/assets/{SettingsDialogBody-DFXMWMS1.js → SettingsDialogBody-C2rIl4ig.js} +1 -1
  51. package/dist/public/assets/{ShareBranchSwitchDialog-jrcdgIkL.js → ShareBranchSwitchDialog-Cf-6mqfV.js} +1 -1
  52. package/dist/public/assets/{ShareReceiveDialog-CDTgu8xc.js → ShareReceiveDialog-BhARlQ5y.js} +1 -1
  53. package/dist/public/assets/{ShareReceiveMissDialog-BykGxE_N.js → ShareReceiveMissDialog-gQIfuuKz.js} +1 -1
  54. package/dist/public/assets/{SkillCostValue-r8mvVMOq.js → SkillCostValue-yjmq3zbE.js} +1 -1
  55. package/dist/public/assets/{SkillEditBanner-c7ur7sSM.js → SkillEditBanner-Dm70GN3t.js} +1 -1
  56. package/dist/public/assets/{SkillForkDialog-Ic7tntCg.js → SkillForkDialog-C11FyNmp.js} +1 -1
  57. package/dist/public/assets/{SkillInstallMenu-BGASnDM4.js → SkillInstallMenu-B6dyzecr.js} +1 -1
  58. package/dist/public/assets/{SkillOriginInline-DwtGd5e7.js → SkillOriginInline-DE7ODwX7.js} +1 -1
  59. package/dist/public/assets/{SkillToolbarControls-B8D29s9Q.js → SkillToolbarControls-BIaHc8_B.js} +1 -1
  60. package/dist/public/assets/{SlidesToolbarControls-BgRd-P2G.js → SlidesToolbarControls-DFQKJb27.js} +1 -1
  61. package/dist/public/assets/{SourceEditor-Ctz1tHsS.js → SourceEditor-CFRWKhn6.js} +1 -1
  62. package/dist/public/assets/{TerminalPanel-BJyuuxKR.js → TerminalPanel-DJScfB1V.js} +1 -1
  63. package/dist/public/assets/{TerminalWindowApp-Y7aeyyGV.js → TerminalWindowApp-BeR-4EEA.js} +1 -1
  64. package/dist/public/assets/{TextDocEditor-BLQhPeRb.js → TextDocEditor-DzoiPoBH.js} +1 -1
  65. package/dist/public/assets/ThreadView-NfCjKVQa.js +18 -0
  66. package/dist/public/assets/{TimelineDiffPane-wNltJ4Ra.js → TimelineDiffPane-BY_OH8iK.js} +1 -1
  67. package/dist/public/assets/{agent-connection-status-B2_APHCy.js → agent-connection-status-GVtpWcVR.js} +1 -1
  68. package/dist/public/assets/{auth-state-cache-DCTSUKSp.js → auth-state-cache-DjjuYX83.js} +1 -1
  69. package/dist/public/assets/{bug-report-send-manager-Bo0jFt7g.js → bug-report-send-manager-nPQrCST0.js} +1 -1
  70. package/dist/public/assets/client-version-BEkfNJSO.js +1 -0
  71. package/dist/public/assets/{comment-chips-Ow_-FlnX.js → comment-chips-Bk3eU3-K.js} +1 -1
  72. package/dist/public/assets/{config-provider-C_s4gZBL.js → config-provider-CMsrN7B5.js} +1 -1
  73. package/dist/public/assets/{css-color-to-hex-B5CKvtuo.js → css-color-to-hex-SSX32gXw.js} +1 -1
  74. package/dist/public/assets/{dist-C7TUqndm.js → dist-868Gd8gd.js} +1 -1
  75. package/dist/public/assets/{doc-paths-DVIJKJSX.js → doc-paths-ZgPMU9hv.js} +1 -1
  76. package/dist/public/assets/{doc-undo-manager-Djgkf6Ty.js → doc-undo-manager-B9iAscTZ.js} +1 -1
  77. package/dist/public/assets/{documents-events-Bns9VJKK.js → documents-events-DyVmV0Qo.js} +1 -1
  78. package/dist/public/assets/{file-tree-adapter-BmZKZ3bW.js → file-tree-adapter-gYa-13I5.js} +1 -1
  79. package/dist/public/assets/{file-tree-utils-C1D_vfHU.js → file-tree-utils-Cz4iVcHq.js} +1 -1
  80. package/dist/public/assets/{folder-config-api-BfxvdHun.js → folder-config-api-CL7I86xK.js} +1 -1
  81. package/dist/public/assets/{index-BnGYK33w.js → index-CqL8TQF5.js} +8 -8
  82. package/dist/public/assets/{launch-agent-thread-BwjhT4xd.js → launch-agent-thread-CssNYKh8.js} +1 -1
  83. package/dist/public/assets/{lint-config-client-CGzxmNPs.js → lint-config-client-DkLK3D4G.js} +1 -1
  84. package/dist/public/assets/{markdownlint-rule-browser-DMrzttBP.js → markdownlint-rule-browser-D9Z_1KbZ.js} +1 -1
  85. package/dist/public/assets/messages-BAMdRODV.js +1 -0
  86. package/dist/public/assets/messages-BAY3MkPp.js +1 -0
  87. package/dist/public/assets/messages-BDdtHSCo.js +1 -0
  88. package/dist/public/assets/messages-BEF3wxiG.js +1 -0
  89. package/dist/public/assets/messages-BT0aZGab.js +1 -0
  90. package/dist/public/assets/messages-BmlevpVU.js +1 -0
  91. package/dist/public/assets/messages-CR-7ufDn.js +1 -0
  92. package/dist/public/assets/messages-CYKphHSL.js +1 -0
  93. package/dist/public/assets/messages-DiEzyUul.js +1 -0
  94. package/dist/public/assets/messages-gadlKE8F.js +1 -0
  95. package/dist/public/assets/messages-phBEtaqq.js +1 -0
  96. package/dist/public/assets/messages-q0qKAdXk.js +1 -0
  97. package/dist/public/assets/{navigation-targets-BgJZCIoO.js → navigation-targets-Dz7Mj6yW.js} +1 -1
  98. package/dist/public/assets/{page-list-cache-BZw1nTat.js → page-list-cache-CLQGWEib.js} +1 -1
  99. package/dist/public/assets/{pending-receive-nav-store-BdbD8RKg.js → pending-receive-nav-store-BIPhAGuN.js} +1 -1
  100. package/dist/public/assets/{progress-aeBz2HU-.js → progress-65clsNyb.js} +1 -1
  101. package/dist/public/assets/{project-paths-DuOPax72.js → project-paths-BXwPEPQG.js} +1 -1
  102. package/dist/public/assets/{prop-types-Dftq6RlG.js → prop-types-xcUPxUpJ.js} +1 -1
  103. package/dist/public/assets/{receive-store-BbICc2Yx.js → receive-store-C_l3XIQE.js} +1 -1
  104. package/dist/public/assets/{selection-context-DP-78Xcc.js → selection-context-Daqo73OD.js} +1 -1
  105. package/dist/public/assets/{skill-scope-CkRSHwP9.js → skill-scope-BUi8busH.js} +1 -1
  106. package/dist/public/assets/{skills-api-GG_S3DLj.js → skills-api-Cx2rJHH9.js} +1 -1
  107. package/dist/public/assets/{src-Ct05JYMM.js → src-CsTdoUyS.js} +1 -1
  108. package/dist/public/assets/{startup-marks-CKAHlbx0.js → startup-marks-C-4hCO0g.js} +1 -1
  109. package/dist/public/assets/{tag-pill-input-A3lclZkc.js → tag-pill-input-nlqSiq7s.js} +1 -1
  110. package/dist/public/assets/{target-navigation-intent-DQczLMCj.js → target-navigation-intent-B26HXIhC.js} +1 -1
  111. package/dist/public/assets/{telemetry-impl-FpJNQg4h.js → telemetry-impl-D_RVw4yU.js} +1 -1
  112. package/dist/public/assets/{telemetry-startup-Djr7mtRi.js → telemetry-startup-DP4JWcg4.js} +1 -1
  113. package/dist/public/assets/{terminal-cli-display-BJNZ23_x.js → terminal-cli-display-OF8nDzxb.js} +1 -1
  114. package/dist/public/assets/{terminal-command-events-D8Y8z7dv.js → terminal-command-events-DQbD5--h.js} +1 -1
  115. package/dist/public/assets/{terminal-launch-events-QgAdHjFE.js → terminal-launch-events-BI8c6JIE.js} +1 -1
  116. package/dist/public/assets/{terminal-telemetry-CRewSDIM.js → terminal-telemetry-BiZK7c9d.js} +1 -1
  117. package/dist/public/assets/thread-client-CIJy1Jbh.js +4 -0
  118. package/dist/public/assets/{typing-burst-detector-CgSdfwf_.js → typing-burst-detector-CoSim2VF.js} +1 -1
  119. package/dist/public/assets/{uninstall-DUiCf7pq.js → uninstall-DxE_1wQZ.js} +1 -1
  120. package/dist/public/assets/{use-activity-panel-DyfkOyNE.js → use-activity-panel-BMVu95Hl.js} +1 -1
  121. package/dist/public/assets/{use-apply-config-language-CVLULaMd.js → use-apply-config-language-DmbZDqgv.js} +2 -2
  122. package/dist/public/assets/{use-collab-url-DwsJjcme.js → use-collab-url-Bm6gv2VZ.js} +1 -1
  123. package/dist/public/assets/{use-conflicts-DA5fcbwd.js → use-conflicts-D-6loWer.js} +1 -1
  124. package/dist/public/assets/{use-live-xterm-theme-CD1keqML.js → use-live-xterm-theme-BSNONOSQ.js} +1 -1
  125. package/dist/public/assets/{use-open-skill-DTAAdX5Q.js → use-open-skill-DpbstiSZ.js} +1 -1
  126. package/dist/public/assets/{use-settings-route-1U5FeWiG.js → use-settings-route-Dmjvvjxd.js} +1 -1
  127. package/dist/public/assets/{use-skill-origin-B5IZoMvy.js → use-skill-origin-BJ_uQdjo.js} +1 -1
  128. package/dist/public/assets/{use-skills-BBxerxq6.js → use-skills-CpkfrpBl.js} +1 -1
  129. package/dist/public/assets/{use-terminal-enabled-BpShfZnI.js → use-terminal-enabled-3W1PH2lM.js} +1 -1
  130. package/dist/public/assets/{use-timeline-entry-diff-B64sKe7y.js → use-timeline-entry-diff-CmQbpKDX.js} +1 -1
  131. package/dist/public/assets/{use-workspace-Bs75Zv0f.js → use-workspace-uVXshHxD.js} +1 -1
  132. package/dist/public/index.html +56 -56
  133. package/dist/public/uninstall.html +4 -4
  134. package/dist/{python3-DNGS4G3E-CixyRGKv.mjs → python3-DNGS4G3E-DSWx_2Ia.mjs} +3 -3
  135. package/dist/{python3-DNGS4G3E-CRyO5yp1.mjs → python3-DNGS4G3E-Dpff_XiH.mjs} +2 -2
  136. package/dist/{registry-probes-CExYC4JQ.mjs → registry-probes-DNinJw94.mjs} +9 -9
  137. package/dist/{removal-file-path-C4FKyv5P.mjs → removal-file-path-dEH5rj0t.mjs} +1 -1
  138. package/dist/{repair-launch-json-q0aPdNfe.mjs → repair-launch-json-C_rI6C8x.mjs} +1 -1
  139. package/dist/{repair-mcp-configs-B_953vzu.mjs → repair-mcp-configs-CrbbtGdf.mjs} +1 -1
  140. package/dist/{sqlite3-TE5AIOTF-BK092fD6.mjs → sqlite3-TE5AIOTF-ButYCorg.mjs} +1 -1
  141. package/dist/{sqlite3-TE5AIOTF-DVwda1Ow.mjs → sqlite3-TE5AIOTF-D4yhY7wL.mjs} +3 -3
  142. package/dist/{src-CW_nJTbi.mjs → src-B76XllMS.mjs} +5 -5
  143. package/dist/src-BRZrtrdn.mjs +1 -0
  144. package/dist/start-BJfBxH26.mjs +5 -0
  145. package/dist/start-Dyk3zIJw.mjs +1 -0
  146. package/package.json +4 -4
  147. package/dist/constants-DKYqY2-e.mjs +0 -1
  148. package/dist/dist-Cv5tSkiZ.mjs +0 -1
  149. package/dist/init-CbL29jRL.mjs +0 -1
  150. package/dist/loader-CI812yys.mjs +0 -1
  151. package/dist/preview-OfoLn7xp.mjs +0 -1
  152. package/dist/public/assets/AgentThreadClientBinder-CdZPAsLH.js +0 -1
  153. package/dist/public/assets/FeedbackForm-Du0fmw9j.js +0 -1
  154. package/dist/public/assets/ManagedArtifactProperties-DaAHI3fg.js +0 -1
  155. package/dist/public/assets/SessionsHost-B_1YvEBI.js +0 -2
  156. package/dist/public/assets/ThreadView-0u0o8ib8.js +0 -18
  157. package/dist/public/assets/client-version-f7m94OcB.js +0 -1
  158. package/dist/public/assets/messages-B1nSTUib.js +0 -1
  159. package/dist/public/assets/messages-Bpy2LxD1.js +0 -1
  160. package/dist/public/assets/messages-CX7QlbB5.js +0 -1
  161. package/dist/public/assets/messages-ChaFm4nX.js +0 -1
  162. package/dist/public/assets/messages-ClP1rPcb.js +0 -1
  163. package/dist/public/assets/messages-DSWauZRi.js +0 -1
  164. package/dist/public/assets/messages-DYZGu9n6.js +0 -1
  165. package/dist/public/assets/messages-DZlA_YKm.js +0 -1
  166. package/dist/public/assets/messages-Dg6rGsBw.js +0 -1
  167. package/dist/public/assets/messages-DrhSLGBr.js +0 -1
  168. package/dist/public/assets/messages-M06K4cBB.js +0 -1
  169. package/dist/public/assets/messages-ZbMG_CHm.js +0 -1
  170. package/dist/public/assets/thread-client-B90HGYWT.js +0 -4
  171. package/dist/src-D2iK9raE.mjs +0 -1
  172. package/dist/start-2RZWW7tN.mjs +0 -1
  173. package/dist/start-BbiKYI_Y.mjs +0 -5
@@ -1,4 +1,4 @@
1
- import{o as e,t}from"./chunk-CYidjpOJ.js";import{t as n}from"./jsx-runtime-BUgB2tll.js";import{B as r,O as i,Sr as a,at as o,dt as s,gi as c,lt as l,sr as u,st as d,ut as f,z as p}from"./DocumentContext-VTBMqEb0.js";import{t as m}from"./react-f2sANaYj.js";import{n as h,r as g}from"./dist-Nvb76hAm.js";import{t as _}from"./useQuery-ZeEDLtxh.js";import{n as v}from"./dist-PQ5KMVDh.js";import{t as y}from"./react-dom-DPxgxlDT.js";import{t as b}from"./compiler-runtime-BfE3aGVn.js";import{t as x}from"./utils-CPqDy6Hr.js";import{n as S,r as C,t as w}from"./AgentIconCluster-CfR3DGT6.js";import{t as T}from"./button-Cym3gapE.js";import{i as E,n as D,r as O,t as k}from"./tooltip-BnyyQDRs.js";import{n as A,r as j,t as M}from"./collapsible-DYySK8La.js";import{a as N,c as P,i as F,n as I,o as L,r as R,s as z,t as B}from"./dialog-DgIQr9zS.js";import{a as V,c as H,i as ee,l as U,n as W,o as G,r as te,s as ne,t as K}from"./alert-dialog-CrZSZ5Zj.js";import{n as q,t as J}from"./with-selector-PRoyWQiu.js";import{t as re}from"./checkbox-Crs_F_Np.js";import{A as ie,C as ae,D as oe,E as se,O as ce,S as le,T as ue,_ as de,b as fe,f as pe,g as me,h as he,j as ge,k as _e,m as ve,p as ye,r as be,v as xe,w as Se,x as Ce,y as we}from"./floating-ui.dom-CDtYEnEj.js";import{c as Te,d as Ee,l as De,o as Oe,s as ke,u as Ae}from"./dist-DYso7MCm.js";import{t as je}from"./label-D-K3fWtj.js";import{i as Me,n as Ne,o as Pe,s as Fe,t as Ie}from"./select-ByJwKu6h.js";import{n as Le,t as Re}from"./radio-group-npdxiS6E.js";import{t as ze}from"./switch-iwBsEWej.js";import{n as Be,r as Ve,t as He}from"./toggle-group-C2_37kV5.js";import{a as Ue,c as We,d as Ge,f as Ke,g as qe,h as Je,i as Ye,l as Xe,s as Ze,t as Qe,u as $e,y as et}from"./RegisteredAgentIcon-Dgk7CcwE.js";import{a as tt,i as nt,o as rt}from"./terminal-telemetry-CRewSDIM.js";import{$o as it,Ao as at,Cc as Y,Cn as ot,Cs as st,Dt as ct,Fo as lt,Go as ut,Ho as dt,Ic as ft,Is as pt,Jn as mt,Jo as ht,Ko as gt,Mo as _t,Nc as vt,No as yt,Ns as bt,Oo as xt,Po as St,Qo as Ct,Ro as wt,Sc as Tt,Sn as Et,Ss as Dt,Uo as Ot,Vn as kt,Wc as At,Wo as jt,Zo as Mt,_s as Nt,at as Pt,bc as Ft,bs as It,ci as Lt,cs as Rt,ds as zt,ft as Bt,gs as Vt,hi as Ht,hs as Ut,ii as Wt,js as Gt,ko as Kt,kr as qt,lc as Jt,mc as Yt,ms as Xt,ns as Zt,pc as Qt,pt as $t,qo as en,rs as tn,ts as nn,ua as rn,wc as an,ws as on,xc as sn,xs as cn,zc as ln}from"./dist-C7TUqndm.js";import{t as un}from"./trace-api-BP9dN1Hz.js";import{n as X}from"./dist-CJhtNlOm2.js";import{d as dn,f as fn,h as pn,n as mn,o as hn,p as gn,r as _n,u as vn,v as yn}from"./use-settings-route-1U5FeWiG.js";import{t as bn}from"./dist-Cr4-nBVI.js";import{c as xn}from"./documents-events-Bns9VJKK.js";import{a as Sn,i as Cn}from"./local-menu-action-bus-BQUa_HQ5.js";import{a as wn,i as Tn,t as En}from"./use-apply-config-theme-B5w38X1P.js";import{t as Dn}from"./OpenInAgentMenuItem-eAQLnvt7.js";import{t as On}from"./createLucideIcon-B6ULg5PN.js";import{a as kn,c as An,f as jn,g as Mn,l as Nn,m as Pn,p as Fn,s as In,t as Ln}from"./EnableSyncConfirmDialog-rknOqm6H.js";import{p as Rn}from"./Mermaid-C8EPNkJP.js";import{t as zn}from"./arrow-up-right-B3B9a7te.js";import{t as Bn}from"./check-BzfGb3KU.js";import{t as Vn}from"./chevron-right-C-g4JuT4.js";import{n as Hn,t as Un}from"./lint-plugin-meta-zA9wHIBR.js";import{n as Wn}from"./upload-DGQJhdiQ.js";import{i as Gn,r as Kn}from"./prop-types-Dftq6RlG.js";import{a as qn,m as Jn,r as Yn,t as Xn}from"./dropdown-menu-DjQ8GtwR.js";import{A as Zn,B as Qn,C as $n,F as er,G as tr,H as nr,J as rr,K as ir,L as ar,M as or,N as sr,O as cr,P as lr,Q as ur,R as dr,S as fr,U as pr,V as mr,W as hr,Y as gr,at as _r,b as vr,c as yr,d as br,et as xr,f as Sr,h as Cr,i as wr,j as Tr,k as Er,l as Dr,m as Or,n as kr,nt as Ar,o as jr,p as Mr,q as Nr,v as Pr,w as Fr,x as Ir,y as Lr}from"./auth-state-cache-DCTSUKSp.js";import{_ as Rr,g as zr,m as Br,p as Vr}from"./SkillInstallMenu-BGASnDM4.js";import{It as Hr}from"./CodeMirrorPropInput-s4NvdTOo.js";import{o as Ur}from"./folder-config-api-BfxvdHun.js";import{t as Wr}from"./info-CilGMBpP.js";import{t as Gr}from"./spinner-Bp2_BYkl.js";import{n as Kr,r as qr,t as Jr}from"./ThemePicker-wGe4WU58.js";import{t as Yr}from"./rotate-ccw-B05K_aam.js";import{t as Xr}from"./square-pen-BhqhPrdL.js";import{t as Zr}from"./terminal-DGmaW797.js";import{t as Qr}from"./trash-2-B9Flu-41.js";import{t as $r}from"./triangle-alert-CCeXtPLU.js";import{t as ei}from"./x-DIayTyoR.js";import{d as ti}from"./doc-paths-DVIJKJSX.js";import{a as ni}from"./startup-marks-CKAHlbx0.js";import{n as ri}from"./config-provider-C_s4gZBL.js";import{a as ii}from"./skill-scope-CkRSHwP9.js";import{m as ai}from"./skills-api-GG_S3DLj.js";import{t as oi}from"./input-BJqFvbJL.js";import{a as si,i as ci,t as li}from"./popover-CfUn4Hx9.js";import{_ as ui,a as di,d as fi,f as pi,g as mi,h as hi,m as gi,p as _i,u as vi,v as yi,y as bi}from"./css-color-to-hex-B5CKvtuo.js";import{n as xi}from"./use-apply-config-language-CVLULaMd.js";import{t as Si}from"./external-link-B7FVOsOS.js";import{t as Ci}from"./badge-Ct5y0ScC.js";import{t as wi}from"./tool-list-format-CAqZbZya.js";import{i as Ti,o as Ei,r as Di,t as Oi}from"./field-CuGdn_wl.js";import{t as ki}from"./ConfigSharingInfoTooltip-FQm0hA62.js";import{t as Ai}from"./use-skills-BBxerxq6.js";import{o as ji,s as Mi,t as Ni}from"./use-open-skill-DTAAdX5Q.js";import{n as Pi}from"./terminal-cli-display-BJNZ23_x.js";import{t as Fi}from"./skeleton-DMzJWQXU.js";import{d as Ii,n as Li,r as Ri,t as zi,u as Bi}from"./lint-config-client-CGzxmNPs.js";import{_ as Vi,a as Hi,d as Ui,f as Wi,g as Gi,h as Ki,i as qi,o as Ji,s as Yi,t as Xi,u as Zi}from"./sortable.esm-CYI6PMLc.js";import{t as Qi}from"./textarea-CGEv5cav.js";import{n as $i,r as ea,t as ta}from"./input-group-BQk3VlAG.js";import{a as na,f as ra,i as ia,n as aa,o as oa,p as sa,r as ca,s as la,t as ua}from"./form-rIUGRVwK.js";import{r as da,t as fa}from"./terminal-command-events-D8Y8z7dv.js";import{t as pa}from"./tag-pill-input-A3lclZkc.js";import{t as ma}from"./markdownlint-rule-browser-DMrzttBP.js";import{n as ha}from"./schema-fields-view-intent-DUTDX7_n.js";import{n as ga,t as _a}from"./use-terminal-enabled-BpShfZnI.js";import{_ as va,a as ya,c as ba,d as xa,f as Sa,g as Ca,h as wa,i as Ta,l as Ea,m as Da,n as Oa,o as ka,p as Aa,r as ja,s as Ma,t as Na,u as Pa,v as Fa}from"./agent-connection-status-B2_APHCy.js";var Ia=On(`folder-tree`,[[`path`,{d:`M20 10a1 1 0 0 0 1-1V6a1 1 0 0 0-1-1h-2.5a1 1 0 0 1-.8-.4l-.9-1.2A1 1 0 0 0 15 3h-2a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z`,key:`hod4my`}],[`path`,{d:`M20 21a1 1 0 0 0 1-1v-3a1 1 0 0 0-1-1h-2.9a1 1 0 0 1-.88-.55l-.42-.85a1 1 0 0 0-.92-.6H13a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z`,key:`w4yl2u`}],[`path`,{d:`M3 5a2 2 0 0 0 2 2h3`,key:`f2jnh7`}],[`path`,{d:`M3 3v13a2 2 0 0 0 2 2h3`,key:`k8epm1`}]]),La=On(`power`,[[`path`,{d:`M12 2v10`,key:`mnfbl`}],[`path`,{d:`M18.4 6.6a9 9 0 1 1-12.77.04`,key:`obofu9`}]]),Ra=On(`unlink`,[[`path`,{d:`m18.84 12.25 1.72-1.71h-.02a5.004 5.004 0 0 0-.12-7.07 5.006 5.006 0 0 0-6.95 0l-1.72 1.71`,key:`yqzxt4`}],[`path`,{d:`m5.17 11.75-1.71 1.71a5.004 5.004 0 0 0 .12 7.07 5.006 5.006 0 0 0 6.95 0l1.71-1.71`,key:`4qinb0`}],[`line`,{x1:`8`,x2:`8`,y1:`2`,y2:`5`,key:`1041cp`}],[`line`,{x1:`2`,x2:`5`,y1:`8`,y2:`8`,key:`14m1p5`}],[`line`,{x1:`16`,x2:`16`,y1:`19`,y2:`22`,key:`rzdirn`}],[`line`,{x1:`19`,x2:`22`,y1:`16`,y2:`16`,key:`ox905f`}]]),za=On(`wifi-off`,[[`path`,{d:`M12 20h.01`,key:`zekei9`}],[`path`,{d:`M8.5 16.429a5 5 0 0 1 7 0`,key:`1bycff`}],[`path`,{d:`M5 12.859a10 10 0 0 1 5.17-2.69`,key:`1dl1wf`}],[`path`,{d:`M19 12.859a10 10 0 0 0-2.007-1.523`,key:`4k23kn`}],[`path`,{d:`M2 8.82a15 15 0 0 1 4.177-2.643`,key:`1grhjp`}],[`path`,{d:`M22 8.82a15 15 0 0 0-11.288-3.764`,key:`z3jwby`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]),Z=e(m(),1),Q=b(),$=n();function Ba(){let e=(0,Q.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,$.jsx)(Ci,{variant:`gray`,children:(0,$.jsx)(h,{id:`YBt9YP`})}),e[0]=t):t=e[0],t}function Va(e){let t=(0,Q.c)(10),{scope:n}=e,r=`settings-scope-badge-${n}`,i;t[0]===n?i=t[1]:(i=n===`user`?(0,$.jsx)(h,{id:`7PzzBU`}):n===`project-local`?(0,$.jsx)(h,{id:`ImTzPZ`}):(0,$.jsx)(h,{id:`e0NrBM`}),t[0]=n,t[1]=i);let a;t[2]!==r||t[3]!==i?(a=(0,$.jsx)(E,{asChild:!0,children:(0,$.jsx)(Ci,{variant:`gray`,tabIndex:0,className:`focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring`,"data-testid":r,children:i})}),t[2]=r,t[3]=i,t[4]=a):a=t[4];let o;t[5]===n?o=t[6]:(o=(0,$.jsx)(D,{children:n===`user`?(0,$.jsx)(h,{id:`cFSbbh`}):n===`project-local`?(0,$.jsx)(h,{id:`YlwI5F`}):(0,$.jsx)(h,{id:`ebqMh6`})}),t[5]=n,t[6]=o);let s;return t[7]!==a||t[8]!==o?(s=(0,$.jsx)(O,{children:(0,$.jsxs)(k,{children:[a,o]})}),t[7]=a,t[8]=o,t[9]=s):s=t[9],s}function Ha(e){let t=(0,Q.c)(27),{titleId:n,title:r,scope:i,level:a,beta:o,adornment:s,docUrl:c,children:l}=e,u=a===void 0?`page`:a,{_:d}=g(),f=u===`page`?`h3`:`h4`,p=u===`page`?`text-lg`:`text-base`,m;t[0]===p?m=t[1]:(m=x(`font-semibold`,p),t[0]=p,t[1]=m);let _;t[2]!==f||t[3]!==m||t[4]!==r||t[5]!==n?(_=(0,$.jsx)(f,{id:n,className:m,children:r}),t[2]=f,t[3]=m,t[4]=r,t[5]=n,t[6]=_):_=t[6];let v;t[7]===o?v=t[8]:(v=o?(0,$.jsx)(Ba,{}):null,t[7]=o,t[8]=v);let y;t[9]===i?y=t[10]:(y=i?(0,$.jsx)(Va,{scope:i}):null,t[9]=i,t[10]=y);let b;t[11]!==s||t[12]!==_||t[13]!==v||t[14]!==y?(b=(0,$.jsxs)(`div`,{className:`flex items-center gap-2`,children:[_,s,v,y]}),t[11]=s,t[12]=_,t[13]=v,t[14]=y,t[15]=b):b=t[15];let S;t[16]===l?S=t[17]:(S=l?(0,$.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:l}):null,t[16]=l,t[17]=S);let C;t[18]!==d||t[19]!==c||t[20]!==r||t[21]!==n?(C=c===void 0?null:(0,$.jsxs)(`a`,{href:c,target:`_blank`,rel:`noopener noreferrer`,onClick:e=>Si(e,c),onAuxClick:e=>Si(e,c),"aria-label":d(typeof r==`string`?{id:`Li4U-T`,values:{title:r}}:{id:`zwWKhA`}),className:`inline-flex items-center gap-0.5 text-sm text-muted-foreground underline-offset-2 hover:text-foreground hover:underline`,"data-testid":`${n}-docs-link`,children:[(0,$.jsx)(h,{id:`zwWKhA`}),(0,$.jsx)(zn,{"aria-hidden":!0,className:`size-3`})]}),t[18]=d,t[19]=c,t[20]=r,t[21]=n,t[22]=C):C=t[22];let w;return t[23]!==b||t[24]!==S||t[25]!==C?(w=(0,$.jsxs)(`div`,{className:`space-y-1`,children:[b,S,C]}),t[23]=b,t[24]=S,t[25]=C,t[26]=w):w=t[26],w}var Ua=`settings-sharing-title`;function Wa(){let e=(0,Q.c)(1),t=(typeof window<`u`?window.okDesktop:void 0)?.sharing,n;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(n=t===void 0?(0,$.jsx)(Ga,{}):(0,$.jsx)(Ka,{}),e[0]=n):n=e[0],n}function Ga(){let e=(0,Q.c)(2),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,$.jsx)(h,{id:`cs4mps`}),e[0]=t):t=e[0];let n;return e[1]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,$.jsx)(`section`,{"aria-labelledby":Ua,className:`space-y-3`,"data-field":`section:sharing`,children:(0,$.jsx)(Ha,{titleId:Ua,title:t,scope:`project`,level:`block`,children:(0,$.jsx)(h,{id:`7YRrJ9`,components:{0:(0,$.jsx)(`code`,{}),1:(0,$.jsx)(`code`,{}),2:(0,$.jsx)(`code`,{})}})})}),e[1]=n):n=e[1],n}function Ka(){let e=(0,Q.c)(29),{_:t}=g(),[n,r]=(0,Z.useState)(null),[i,a]=(0,Z.useState)(!1),[o,s]=(0,Z.useState)(null),c;e[0]===t?c=e[1]:(c=async function(){let e=window.okDesktop?.sharing;if(e)try{r(await e.status())}catch(e){let n=e;X.error(n instanceof Error?n.message:t({id:`K0N7zS`})),r(Ja)}},e[0]=t,e[1]=c);let l=c,u;e[2]===l?u=e[3]:(u=()=>{l()},e[2]=l,e[3]=u);let d;e[4]===Symbol.for(`react.memo_cache_sentinel`)?(d=[],e[4]=d):d=e[4],(0,Z.useEffect)(u,d);let f;e[5]!==t||e[6]!==i||e[7]!==l||e[8]!==n?(f=async function(e){let r=window.okDesktop?.sharing;if(!r||n===null||i||n.mode===e)return;a(!0),s(null);let o=null,c=null;try{o=await r.setMode(e)}catch(e){c=e}if(a(!1),c!==null){X.error(c instanceof Error?c.message:t({id:`qZv5ZR`}));return}o!==null&&(o.kind===`refused-tracked`?(s({tracked:o.tracked,remediation:o.remediation}),X.error(t({id:`z2JdQ-`}),{duration:5e3})):o.kind===`no-exclude`?X.warning(o.reason===`no-git`?t({id:`YSFv5w`}):t({id:`8cS0nH`,values:{0:o.reason}})):X.success(t(e===`local-only`?{id:`wdzBgi`}:{id:`k_pade`})),await l())},e[5]=t,e[6]=i,e[7]=l,e[8]=n,e[9]=f):f=e[9];let p=f;if(n===null){let t;e[10]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,$.jsx)(Ha,{titleId:Ua,title:(0,$.jsx)(h,{id:`cs4mps`}),scope:`project`,level:`block`}),e[10]=t):t=e[10];let n;return e[11]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,$.jsxs)(`section`,{"aria-labelledby":Ua,className:`space-y-3`,"data-field":`section:sharing`,children:[t,(0,$.jsxs)(`div`,{role:`status`,"aria-live":`polite`,"aria-busy":`true`,children:[(0,$.jsx)(`span`,{className:`sr-only`,children:(0,$.jsx)(h,{id:`eQn7nI`})}),(0,$.jsx)(Fi,{className:`h-24`})]})]}),e[11]=n):n=e[11],n}let m=n.mode===`no-git`,_;e[12]===Symbol.for(`react.memo_cache_sentinel`)?(_=(0,$.jsx)(h,{id:`cs4mps`}),e[12]=_):_=e[12];let v;e[13]===Symbol.for(`react.memo_cache_sentinel`)?(v=(0,$.jsx)(Ha,{titleId:Ua,title:_,scope:`project`,level:`block`,adornment:(0,$.jsx)(ki,{}),children:(0,$.jsx)(h,{id:`N55YNr`})}),e[13]=v):v=e[13];let y;e[14]!==i||e[15]!==m||e[16]!==p||e[17]!==n.mode?(y=m?(0,$.jsx)(`p`,{className:`rounded-md border border-amber-300 bg-amber-50 px-3 py-2 text-sm text-amber-900 dark:border-amber-700 dark:bg-amber-950 dark:text-amber-200`,role:`status`,"data-testid":`settings-sharing-no-git`,children:(0,$.jsx)(h,{id:`ju38ms`})}):(0,$.jsxs)(Re,{value:n.mode,onValueChange:e=>void p(e),disabled:i,className:`gap-2`,"aria-labelledby":Ua,"data-testid":`settings-sharing-radiogroup`,children:[(0,$.jsxs)(`label`,{htmlFor:`settings-sharing-local-only`,className:`flex items-start gap-2 text-sm`,children:[(0,$.jsx)(Le,{id:`settings-sharing-local-only`,value:`local-only`,"data-testid":`settings-sharing-local-only`,className:`mt-1`}),(0,$.jsxs)(`span`,{children:[(0,$.jsx)(`span`,{className:`font-medium`,children:(0,$.jsx)(h,{id:`QjzFZj`})}),(0,$.jsx)(`span`,{className:`block text-1sm text-muted-foreground`,children:(0,$.jsx)(h,{id:`un-K1H`})})]})]}),(0,$.jsxs)(`label`,{htmlFor:`settings-sharing-shared`,className:`flex items-start gap-2 text-sm`,children:[(0,$.jsx)(Le,{id:`settings-sharing-shared`,value:`shared`,"data-testid":`settings-sharing-shared`,className:`mt-1`}),(0,$.jsxs)(`span`,{children:[(0,$.jsx)(`span`,{className:`font-medium`,children:(0,$.jsx)(h,{id:`0Gd0NU`})}),(0,$.jsx)(`span`,{className:`block text-1sm text-muted-foreground`,children:(0,$.jsx)(h,{id:`dJw2_7`})})]})]})]}),e[14]=i,e[15]=m,e[16]=p,e[17]=n.mode,e[18]=y):y=e[18];let b;e[19]===o?b=e[20]:(b=o===null?null:(0,$.jsxs)(`div`,{className:`space-y-2 rounded-md border border-destructive bg-destructive/10 p-3 text-sm`,role:`alert`,"data-testid":`settings-sharing-refusal`,children:[(0,$.jsx)(`p`,{className:`font-semibold`,children:(0,$.jsx)(h,{id:`ZscwQ0`})}),(0,$.jsx)(`pre`,{className:`whitespace-pre-wrap font-mono text-xs leading-relaxed`,children:o.remediation}),(0,$.jsx)(T,{variant:`outline`,size:`sm`,onClick:()=>s(null),children:(0,$.jsx)(h,{id:`1QfxQT`})})]}),e[19]=o,e[20]=b);let x;e[21]!==o||e[22]!==n.mode||e[23]!==n.trackedUpstream?(x=n.trackedUpstream.length>0&&n.mode!==`no-git`&&o===null?(0,$.jsxs)(`div`,{className:`space-y-1 rounded-md border border-muted-foreground/30 bg-muted/40 p-3 text-sm`,"data-testid":`settings-sharing-tracked-info`,children:[(0,$.jsx)(`p`,{className:`font-medium`,children:(0,$.jsx)(h,{id:`LhWYpm`})}),(0,$.jsx)(`ul`,{className:`list-disc pl-5 font-mono text-xs text-muted-foreground`,children:n.trackedUpstream.map(qa)}),(0,$.jsx)(`p`,{className:`text-1sm text-muted-foreground`,children:(0,$.jsx)(h,{id:`1XSMhZ`,components:{0:(0,$.jsx)(`code`,{}),1:(0,$.jsx)(`code`,{})}})})]}):null,e[21]=o,e[22]=n.mode,e[23]=n.trackedUpstream,e[24]=x):x=e[24];let S;return e[25]!==y||e[26]!==b||e[27]!==x?(S=(0,$.jsxs)(`section`,{"aria-labelledby":Ua,className:`space-y-4`,"data-testid":`settings-sharing`,"data-field":`section:sharing`,children:[v,y,b,x]}),e[25]=y,e[26]=b,e[27]=x,e[28]=S):S=e[28],S}function qa(e){return(0,$.jsx)(`li`,{children:e},e)}function Ja(e){return e??{kind:`status`,mode:`no-git`,excluded:[],trackedUpstream:[]}}function Ya(e){let t=(0,Q.c)(35),{authQueryTransport:n,authTransport:r}=e,{_:i}=g(),a;t[0]===n?a=t[1]:(a=n??ur(),t[0]=n,t[1]=a);let o=a,s;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(s={phase:`loading`},t[2]=s):s=t[2];let[c,l]=(0,Z.useState)(s),[u,d]=(0,Z.useState)(!1),[f,p]=(0,Z.useState)(!1),[m,_]=(0,Z.useState)(null),v=(0,Z.useRef)(!1),y;t[3]===o?y=t[4]:(y=async function(){l({phase:`loading`});try{let e=await o.status();l({phase:`loaded`,result:e}),kr(e.authenticated)}catch(e){console.warn(`[AccountSection] GitHub status check failed`,e),l({phase:`check-failed`})}},t[3]=o,t[4]=y);let b=y,x;t[5]===b?x=t[6]:(x=()=>{b()},t[5]=b,t[6]=x);let S;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(S=[],t[7]=S):S=t[7],(0,Z.useEffect)(x,S);let C;t[8]!==i||t[9]!==b||t[10]!==o?(C=async function(){if(v.current)return;v.current=!0,d(!1),p(!0),_(null);let e=null;try{let t=o.signout?await o.signout():{ok:!1,error:i({id:`8cpOa8`})};t.ok||(e=t.error??i({id:`8cpOa8`}))}catch(t){console.warn(`[AccountSection] GitHub disconnect failed`,t),e=i({id:`8cpOa8`})}await b(),e&&_(e),p(!1),v.current=!1},t[8]=i,t[9]=b,t[10]=o,t[11]=C):C=t[11];let w=C,E;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(E=(0,$.jsx)(h,{id:`AeXO77`}),t[12]=E):E=t[12];let D;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(D=(0,$.jsx)(Ha,{titleId:`settings-account-title`,title:E,scope:`user`,children:(0,$.jsx)(h,{id:`E6lrpp`})}),t[13]=D):D=t[13];let O;t[14]!==m||t[15]!==f||t[16]!==w||t[17]!==b||t[18]!==c.phase||t[19]!==c.result?(O=c.phase===`loading`?(0,$.jsxs)(`div`,{role:`status`,"aria-live":`polite`,"aria-busy":`true`,className:`space-y-2 rounded-md border p-3`,"data-testid":`settings-account-loading`,children:[(0,$.jsx)(`span`,{className:`sr-only`,children:(0,$.jsx)(h,{id:`IWGfGF`})}),(0,$.jsx)(Fi,{className:`h-4 w-40`}),(0,$.jsx)(Fi,{className:`h-8 w-32`})]}):c.phase===`check-failed`?(0,$.jsxs)(`div`,{className:`space-y-2 rounded-md border p-3`,"data-testid":`settings-account-check-failed`,children:[(0,$.jsx)(`p`,{role:`status`,className:`text-sm text-muted-foreground`,children:(0,$.jsx)(h,{id:`T_wG4n`})}),(0,$.jsx)(T,{variant:`outline`,size:`sm`,onClick:()=>void b(),children:(0,$.jsx)(h,{id:`KDw4GX`})})]}):c.result.authenticated?c.result.tier===`A`?(0,$.jsx)(Za,{login:c.result.login}):(0,$.jsx)(Xa,{login:c.result.login,disconnecting:f,error:m,onDisconnect:()=>void w()}):(0,$.jsx)(Qa,{onConnect:()=>d(!0)}),t[14]=m,t[15]=f,t[16]=w,t[17]=b,t[18]=c.phase,t[19]=c.result,t[20]=O):O=t[20];let k;t[21]===b?k=t[22]:(k=e=>{d(e),e||b()},t[21]=b,t[22]=k);let A=c.phase===`loaded`?c.result.host:void 0,j=c.phase===`loaded`?c.result.ghAvailable:void 0,M;t[23]===b?M=t[24]:(M=()=>{b()},t[23]=b,t[24]=M);let N;t[25]!==u||t[26]!==r||t[27]!==k||t[28]!==A||t[29]!==j||t[30]!==M?(N=(0,$.jsx)(gr,{open:u,onOpenChange:k,transport:r,host:A,ghAvailable:j,onSuccess:M}),t[25]=u,t[26]=r,t[27]=k,t[28]=A,t[29]=j,t[30]=M,t[31]=N):N=t[31];let P;return t[32]!==N||t[33]!==O?(P=(0,$.jsxs)(`section`,{"aria-labelledby":`settings-account-title`,className:`space-y-3`,"data-testid":`settings-account`,children:[D,O,N]}),t[32]=N,t[33]=O,t[34]=P):P=t[34],P}function Xa(e){let t=(0,Q.c)(20),{login:n,disconnecting:r,error:i,onDisconnect:a}=e,o;t[0]===n?o=t[1]:(o=(0,$.jsx)(`div`,{className:`text-sm font-medium`,children:(0,$.jsx)(h,{id:`E_tNGD`,values:{login:n}})}),t[0]=n,t[1]=o);let s;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,$.jsx)(`p`,{className:`text-muted-foreground text-1sm`,children:(0,$.jsx)(h,{id:`nxlOpL`})}),t[2]=s):s=t[2];let c;t[3]===o?c=t[4]:(c=(0,$.jsxs)(`div`,{className:`min-w-0`,children:[o,s]}),t[3]=o,t[4]=c);let l;t[5]===r?l=t[6]:(l=r?(0,$.jsx)(h,{id:`rppgXF`}):(0,$.jsx)(h,{id:`-K0AvT`}),t[5]=r,t[6]=l);let u;t[7]!==r||t[8]!==a||t[9]!==l?(u=(0,$.jsx)(T,{variant:`outline`,onClick:a,disabled:r,"aria-describedby":`settings-account-disconnect-caveat`,"data-testid":`settings-account-disconnect`,children:l}),t[7]=r,t[8]=a,t[9]=l,t[10]=u):u=t[10];let d;t[11]!==c||t[12]!==u?(d=(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[c,u]}),t[11]=c,t[12]=u,t[13]=d):d=t[13];let f;t[14]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,$.jsx)(`p`,{id:`settings-account-disconnect-caveat`,className:`text-muted-foreground text-1sm`,"data-testid":`settings-account-disconnect-caveat`,children:(0,$.jsx)(h,{id:`msOK6I`})}),t[14]=f):f=t[14];let p;t[15]===i?p=t[16]:(p=i?(0,$.jsx)(`p`,{role:`alert`,className:`text-sm text-destructive`,"data-testid":`settings-account-disconnect-error`,children:i}):null,t[15]=i,t[16]=p);let m;return t[17]!==d||t[18]!==p?(m=(0,$.jsxs)(`div`,{className:`space-y-2 rounded-md border p-3`,"data-testid":`settings-account-connected`,children:[d,f,p]}),t[17]=d,t[18]=p,t[19]=m):m=t[19],m}function Za(e){let t=(0,Q.c)(5),{login:n}=e,r;t[0]===n?r=t[1]:(r=(0,$.jsx)(`div`,{className:`text-sm font-medium`,children:(0,$.jsx)(h,{id:`E_tNGD`,values:{login:n}})}),t[0]=n,t[1]=r);let i;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,$.jsx)(`p`,{className:`text-muted-foreground text-1sm`,children:(0,$.jsx)(h,{id:`ny6vNn`})}),t[2]=i):i=t[2];let a;return t[3]===r?a=t[4]:(a=(0,$.jsx)(`div`,{className:`rounded-md border p-3`,"data-testid":`settings-account-gh-cli`,children:(0,$.jsxs)(`div`,{className:`min-w-0 space-y-1`,children:[r,i]})}),t[3]=r,t[4]=a),a}function Qa(e){let t=(0,Q.c)(5),{onConnect:n}=e,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,$.jsx)(`div`,{className:`text-sm font-medium`,children:(0,$.jsx)(h,{id:`S33tz3`})}),t[0]=r):r=t[0];let i;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,$.jsxs)(`div`,{className:`min-w-0`,children:[r,(0,$.jsx)(`p`,{className:`text-muted-foreground text-1sm`,children:(0,$.jsx)(h,{id:`EJuO7B`})})]}),t[1]=i):i=t[1];let a;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,$.jsx)(h,{id:`5lWFkC`}),t[2]=a):a=t[2];let o;return t[3]===n?o=t[4]:(o=(0,$.jsx)(`div`,{className:`rounded-md border p-3`,"data-testid":`settings-account-disconnected`,children:(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[i,(0,$.jsx)(T,{onClick:n,"data-testid":`settings-account-connect`,children:a})]})}),t[3]=n,t[4]=o),o}function $a(e){if(e===void 0)return null;let t=e.params?.agent;if(typeof t!=`string`)return null;let n=At[t]??t;return e.id===`followup.enable-manually`?bn._({id:`followup.enable-manually`,values:{agent:n}}):null}function eo(e){let{enabled:t,installedCount:n,presence:r,configurable:i,setupDocSlug:a,installUrl:o}=e,s=n>0,c=r===`absent`,l=()=>a===null?{kind:`none`}:{kind:`setup-doc`,slug:a};return c?o==null||o===``?l():{kind:`install`,url:o}:i?t?s?{kind:`manage`}:{kind:`connect`}:s?{kind:`remove`}:{kind:`none`}:s?{kind:`remove`}:l()}function to(e){return e.presence===`absent`&&e.installedCount>0}function no(e){let t=(0,Q.c)(32),{icon:n,name:r,hint:i,status:a,action:o,checked:s,disabled:c,ariaLabel:l,testId:u,rowTestId:d,statusId:f,onToggle:p}=e,m=i?`${d}-hint`:void 0,h;t[0]===n?h=t[1]:(h=(0,$.jsx)(`span`,{className:`flex h-5 shrink-0 items-center`,children:n}),t[0]=n,t[1]=h);let g;t[2]===r?g=t[3]:(g=(0,$.jsx)(`span`,{className:`truncate text-sm leading-5`,children:r}),t[2]=r,t[3]=g);let _;t[4]!==i||t[5]!==m?(_=i?(0,$.jsxs)(`span`,{className:`flex min-w-0 items-center gap-1.5`,children:[(0,$.jsx)(`span`,{id:m,className:`truncate text-muted-foreground text-1sm`,children:i.text}),i.action]}):null,t[4]=i,t[5]=m,t[6]=_):_=t[6];let v;t[7]!==a||t[8]!==f?(v=a?(0,$.jsx)(`span`,{id:f,children:a}):null,t[7]=a,t[8]=f,t[9]=v):v=t[9];let y;t[10]!==g||t[11]!==_||t[12]!==v?(y=(0,$.jsxs)(`div`,{className:`flex min-w-0 flex-col`,children:[g,_,v]}),t[10]=g,t[11]=_,t[12]=v,t[13]=y):y=t[13];let b;t[14]!==h||t[15]!==y?(b=(0,$.jsxs)(`div`,{className:`flex min-w-0 items-start gap-2.5`,children:[h,y]}),t[14]=h,t[15]=y,t[16]=b):b=t[16];let x;t[17]!==l||t[18]!==s||t[19]!==c||t[20]!==m||t[21]!==p||t[22]!==f||t[23]!==u?(x=p===void 0?null:(0,$.jsx)(ze,{checked:s??!1,disabled:c,onCheckedChange:p,"aria-label":l,"aria-describedby":[m,f].filter(Boolean).join(` `)||void 0,"data-testid":u}),t[17]=l,t[18]=s,t[19]=c,t[20]=m,t[21]=p,t[22]=f,t[23]=u,t[24]=x):x=t[24];let S;t[25]!==o||t[26]!==x?(S=(0,$.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2`,children:[o,x]}),t[25]=o,t[26]=x,t[27]=S):S=t[27];let C;return t[28]!==d||t[29]!==b||t[30]!==S?(C=(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-3 px-3 py-2.5`,"data-testid":d,children:[b,S]}),t[28]=d,t[29]=b,t[30]=S,t[31]=C):C=t[31],C}function ro(e,t){return e===`absent`&&!t}function io(e){let t=(0,Q.c)(15),{label:n,labelIcon:r,subtitle:i,children:a,labelId:o}=e,s;t[0]!==n||t[1]!==r||t[2]!==o?(s=(0,$.jsxs)(`h4`,{id:o,tabIndex:-1,className:`flex items-center gap-1.5 font-mono text-muted-foreground text-xs uppercase tracking-wide`,children:[n,r]}),t[0]=n,t[1]=r,t[2]=o,t[3]=s):s=t[3];let c;t[4]===i?c=t[5]:(c=i?(0,$.jsx)(`p`,{className:`mt-1 text-muted-foreground text-xs`,children:i}):null,t[4]=i,t[5]=c);let l;t[6]!==s||t[7]!==c?(l=(0,$.jsxs)(`div`,{className:`mb-2`,children:[s,c]}),t[6]=s,t[7]=c,t[8]=l):l=t[8];let u;t[9]===a?u=t[10]:(u=(0,$.jsx)(`div`,{className:`divide-y overflow-hidden rounded-md border`,children:a}),t[9]=a,t[10]=u);let d;return t[11]!==o||t[12]!==l||t[13]!==u?(d=(0,$.jsxs)(`section`,{"aria-labelledby":o,children:[l,u]}),t[11]=o,t[12]=l,t[13]=u,t[14]=d):d=t[14],d}function ao(e){if(e)return()=>{e.ownerDocument.activeElement===e&&va(e)?.focus()}}function oo(e){let t=(0,Q.c)(9),{hiddenCount:n,expanded:r,onToggle:i,testId:a}=e,{_:o}=g();if(n<=0)return null;let s;t[0]!==o||t[1]!==r||t[2]!==n?(s=o(r?{id:`6lGV3K`}:{id:`INN7OX`,values:{hiddenCount:n}}),t[0]=o,t[1]=r,t[2]=n,t[3]=s):s=t[3];let c;return t[4]!==r||t[5]!==i||t[6]!==s||t[7]!==a?(c=(0,$.jsx)(T,{ref:ao,type:`button`,variant:`ghost`,onClick:i,"aria-expanded":r,className:`w-full justify-center rounded-none font-normal text-1sm text-muted-foreground`,"data-testid":a,children:s}),t[4]=r,t[5]=i,t[6]=s,t[7]=a,t[8]=c):c=t[8],c}function so(e){let t=(0,Q.c)(10),{status:n,enabled:r}=e,{_:i}=g();if(n===`connected`){let e;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(Bn,{"aria-hidden":!0,className:`size-3.5`}),t[0]=e):e=t[0];let n;t[1]===i?n=t[2]:(n=i({id:`QHcLEN`}),t[1]=i,t[2]=n);let r;return t[3]===n?r=t[4]:(r=(0,$.jsxs)(`span`,{className:`mt-0.5 inline-flex items-center gap-1 text-muted-foreground text-xs`,children:[e,n]}),t[3]=n,t[4]=r),r}if(n===`not-connected`&&r){let e;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)($r,{"aria-hidden":!0,className:`size-3.5`}),t[5]=e):e=t[5];let n;t[6]===i?n=t[7]:(n=i({id:`S33tz3`}),t[6]=i,t[7]=n);let r;return t[8]===n?r=t[9]:(r=(0,$.jsxs)(`span`,{className:`mt-0.5 inline-flex items-center gap-1 text-amber-700 text-xs dark:text-amber-400`,children:[e,n]}),t[8]=n,t[9]=r),r}return null}function co(e){let t=(0,Q.c)(52),{action:n,rowLabel:r,describedById:i,onConfigure:a,onRemove:o}=e,{_:s}=g();switch(n.kind){case`none`:return null;case`install`:{let e=n.url,a;t[0]!==s||t[1]!==r?(a=s({id:`wfZwqe`,values:{rowLabel:r}}),t[0]=s,t[1]=r,t[2]=a):a=t[2];let o;t[3]===s?o=t[4]:(o=s({id:`TKQ7K-`}),t[3]=s,t[4]=o);let c;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,$.jsx)(zn,{"aria-hidden":!0}),t[5]=c):c=t[5];let l;return t[6]!==n.url||t[7]!==i||t[8]!==a||t[9]!==o?(l=(0,$.jsx)(T,{variant:`link`,size:`sm`,className:`shrink-0 text-muted-foreground hover:text-foreground`,asChild:!0,children:(0,$.jsxs)(`a`,{href:e,target:`_blank`,rel:`noreferrer`,"aria-label":a,"aria-describedby":i,children:[o,c]})}),t[6]=n.url,t[7]=i,t[8]=a,t[9]=o,t[10]=l):l=t[10],l}case`setup-doc`:{let e=`https://openknowledge.ai/docs/integrations/${n.slug}`,a;t[11]!==s||t[12]!==r?(a=s({id:`Kuw5NN`,values:{rowLabel:r}}),t[11]=s,t[12]=r,t[13]=a):a=t[13];let o;t[14]===s?o=t[15]:(o=s({id:`P_bX4O`}),t[14]=s,t[15]=o);let c;t[16]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,$.jsx)(zn,{"aria-hidden":!0}),t[16]=c):c=t[16];let l;return t[17]!==i||t[18]!==e||t[19]!==a||t[20]!==o?(l=(0,$.jsx)(T,{variant:`link`,size:`sm`,className:`shrink-0 text-muted-foreground hover:text-foreground`,asChild:!0,children:(0,$.jsxs)(`a`,{href:e,target:`_blank`,rel:`noreferrer`,"aria-label":a,"aria-describedby":i,children:[o,c]})}),t[17]=i,t[18]=e,t[19]=a,t[20]=o,t[21]=l):l=t[21],l}case`connect`:{let e;t[22]!==s||t[23]!==r?(e=s({id:`_uxBz5`,values:{rowLabel:r}}),t[22]=s,t[23]=r,t[24]=e):e=t[24];let n;t[25]===s?n=t[26]:(n=s({id:`q63KUv`}),t[25]=s,t[26]=n);let o;return t[27]!==i||t[28]!==a||t[29]!==e||t[30]!==n?(o=(0,$.jsx)(T,{size:`sm`,className:`shrink-0 font-mono uppercase`,onClick:a,"aria-label":e,"aria-describedby":i,children:n}),t[27]=i,t[28]=a,t[29]=e,t[30]=n,t[31]=o):o=t[31],o}case`manage`:{let e;t[32]!==s||t[33]!==r?(e=s({id:`wSBXaS`,values:{rowLabel:r}}),t[32]=s,t[33]=r,t[34]=e):e=t[34];let n;t[35]===s?n=t[36]:(n=s({id:`wckWOP`}),t[35]=s,t[36]=n);let o;return t[37]!==i||t[38]!==a||t[39]!==e||t[40]!==n?(o=(0,$.jsx)(T,{variant:`outline`,size:`sm`,className:`shrink-0 font-mono uppercase`,onClick:a,"aria-label":e,"aria-describedby":i,children:n}),t[37]=i,t[38]=a,t[39]=e,t[40]=n,t[41]=o):o=t[41],o}case`remove`:{let e;t[42]!==s||t[43]!==r?(e=s({id:`vRlzx-`,values:{rowLabel:r}}),t[42]=s,t[43]=r,t[44]=e):e=t[44];let n;t[45]===s?n=t[46]:(n=s({id:`t_YqKh`}),t[45]=s,t[46]=n);let a;return t[47]!==i||t[48]!==o||t[49]!==e||t[50]!==n?(a=(0,$.jsx)(T,{variant:`outline`,size:`sm`,className:`shrink-0 font-mono uppercase`,onClick:o,"aria-label":e,"aria-describedby":i,children:n}),t[47]=i,t[48]=o,t[49]=e,t[50]=n,t[51]=a):a=t[51],a}}}function lo(e){let t=(0,Q.c)(9),{rowLabel:n,onRemove:r}=e,{_:i}=g(),a;t[0]!==i||t[1]!==n?(a=i({id:`vRlzx-`,values:{rowLabel:n}}),t[0]=i,t[1]=n,t[2]=a):a=t[2];let o;t[3]===i?o=t[4]:(o=i({id:`t_YqKh`}),t[3]=i,t[4]=o);let s;return t[5]!==r||t[6]!==a||t[7]!==o?(s=(0,$.jsx)(T,{type:`button`,variant:`link-muted`,className:`h-auto p-0 text-1sm underline underline-offset-4 hover:text-destructive`,onClick:r,"aria-label":a,children:o}),t[5]=r,t[6]=a,t[7]=o,t[8]=s):s=t[8],s}function uo(e){return e===void 0?null:Qt[e].external?.installUrl??null}function fo(e){return e!==null&&Object.values(e.probes.satisfiers).some(e=>e!==void 0&&e.state!==`unprobed`)}function po(e){let t=(0,Q.c)(112),n;t[0]===e?n=t[1]:(n=e===void 0?{}:e,t[0]=e,t[1]=n);let{applyConnections:r}=n,i=r===void 0?Fa:r,{_:a}=g(),o=Ke(),s=et(),{states:c,refresh:l}=Rr(),d=zr(),[f,p]=(0,Z.useState)(``),[m,h]=(0,Z.useState)(!1),[v,y]=(0,Z.useState)(!1),[b,x]=(0,Z.useState)(!1),[S,C]=(0,Z.useState)(null),[w,E]=(0,Z.useState)(!1),[D,O]=(0,Z.useState)(!1),[k,A]=(0,Z.useState)(0),[j,M]=(0,Z.useState)(null),[N,P]=(0,Z.useState)(null),F=(0,Z.useRef)(null),I=(0,Z.useRef)(0),L;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(L={queryKey:[`acp-catalog`],queryFn:wo,staleTime:3e5},t[2]=L):L=t[2];let R=_(L),z;t[3]===l?z=t[4]:(z=()=>{l()},t[3]=l,t[4]=z);let B=(0,Z.useEffectEvent)(z),V;t[5]===B?V=t[6]:(V=()=>{B()},t[5]=B,t[6]=V);let H;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(H=[],t[7]=H):H=t[7],(0,Z.useEffect)(V,H);let ee;t[8]===i?ee=t[9]:(ee=()=>{let e=!0,t=I.current+=1;return i([]).then(n=>{!e||I.current!==t||(n.snapshot!==null&&C(n.snapshot),E(!fo(n.snapshot)),O(n.unavailable===!0))}).catch(()=>{e&&I.current===t&&E(!0)}),()=>{e=!1}},t[8]=i,t[9]=ee);let U;t[10]!==i||t[11]!==k?(U=[i,k],t[10]=i,t[11]=k,t[12]=U):U=t[12],(0,Z.useEffect)(ee,U);let W=R.data?.agents,G;t[13]===s?G=t[14]:(G=new Set(s.map(Co)),t[13]=s,t[14]=G);let te=G,ne;t[15]===d?.installedClis?ne=t[16]:(ne=d?.installedClis??{},t[15]=d?.installedClis,t[16]=ne);let K=ne,q=S===null?[]:Pa(S),J=q.find(e=>e.id===j)??null,re=q.find(e=>e.id===N)??null,ie;t[17]===i?ie=t[18]:(ie=async function(e){let t=await i(e);return I.current+=1,t.snapshot!==null&&C(t.snapshot),E(!fo(t.snapshot)),t.unavailable===!0&&O(!0),t},t[17]=i,t[18]=ie);let ae=ie,oe;t[19]===S?oe=t[20]:(oe=function(e,t){return t===!1?`absent`:t===!0?`present`:e===void 0?`unknown`:Ta(e,S,t)},t[19]=S,t[20]=oe);let se=oe,ce;t[21]===Symbol.for(`react.memo_cache_sentinel`)?(ce=new Set(sn.map(an).filter(So)),t[21]=ce):ce=t[21];let le=ce,ue;t[22]===Symbol.for(`react.memo_cache_sentinel`)?(ue=new Set(Tt.map(xo).filter(bo)),t[22]=ue):ue=t[22];let de=ue,fe;t[23]!==K||t[24]!==se||t[25]!==c?(fe=function(e,t){if(t===`terminal`){let t=Qt[e].external?.targetId;return t===void 0?`unknown`:se(e,c[t]?.installed??null)}let n=sn.find(t=>an(t)===e);return n===void 0?`unknown`:se(e,K[n]??null)},t[23]=K,t[24]=se,t[25]=c,t[26]=fe):fe=t[26];let pe=fe,me=function(e,t,n,r,i,a,o,s){let c=e===void 0?void 0:q.find(t=>t.id===e);if(c===void 0||e===void 0||S===null||!fo(S))return{status:void 0,action:void 0,hintAction:void 0,residualFiles:!1,statusId:void 0};let l={enabled:i,installedCount:Aa(wa(c)),presence:o,configurable:xa(c),setupDocSlug:c.row.setupDocSlug,installUrl:s===void 0?Qt[e].external?.installUrl??null:s},u=eo(l),d=Sa(e)&&pe(e,r)!==`absent`,f=to(l)&&!d,p=Na({agentId:e,mode:r,snapshot:S,detected:a}),m=p===`connected`||p===`not-connected`&&i,h=m?`${n}-status`:void 0,g=!D||u.kind===`install`||u.kind===`setup-doc`,_=c.cells.projectMcp,v=_===void 0||!Sa(e)||ja(_.consentClass)===r?$a(Oa({agentId:e,mode:r,snapshot:S,detected:a,projectMcp:_})):null;return{status:m?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(so,{status:p,enabled:i}),v===null?null:(0,$.jsx)(`span`,{className:`mt-0.5 block text-muted-foreground text-xs`,"data-testid":`${n}-followup`,children:v})]}):void 0,action:g?(0,$.jsx)(co,{action:u,rowLabel:t,describedById:h,onConfigure:()=>M(e),onRemove:()=>P(e)}):void 0,hintAction:f&&!D?(0,$.jsx)(lo,{rowLabel:t,onRemove:()=>P(e)}):void 0,residualFiles:f,statusId:h}},he;t[27]===a?he=t[28]:(he=function(e,t){return a(e===`not-installed`?t?{id:`06Ucfz`}:{id:`5SwVv1`}:t?{id:`V0Jk_K`}:{id:`EDD3UL`})},t[27]=a,t[28]=he);let ge=he,_e=function(e,t,n,r,i){if($e(e,r),!r||D||t===void 0||S===null)return;let a=q.find(e=>e.id===t);a===void 0||!xa(a)||Na({agentId:t,mode:n,snapshot:S,detected:i})===`not-connected`&&(F.current=e,M(t))},ve=f.trim().toLowerCase(),ye=e=>ve===``||e.toLowerCase().includes(ve),be=(W??[]).filter(e=>ye(e.name)),xe;t[29]===K?xe=t[30]:(xe=e=>K[e]!==!1,t[29]=K,t[30]=xe);let Se=xe,Ce;t[31]===Se?Ce=t[32]:(Ce=(e,t)=>Number(Se(t))-Number(Se(e))||Ft[e].displayName.localeCompare(Ft[t].displayName),t[31]=Se,t[32]=Ce);let we=sn.filter(e=>{let{displayName:t}=Ft[e];return ye(t)||ye(a({id:`QYfQdv`,values:{displayName:t}}))||ye(e)}).sort(Ce),Te;t[33]!==se||t[34]!==c?(Te=e=>se(Y(e),c[e]?.installed??null),t[33]=se,t[34]=c,t[35]=Te):Te=t[35];let Ee=Te,De;t[36]===Ee?De=t[37]:(De=(e,t)=>Number(Ee(e.id)===`absent`)-Number(Ee(t.id)===`absent`),t[36]=Ee,t[37]=De);let Oe=Tt.filter(e=>{let{displayName:t}=e;return ye(a({id:`CZBqrX`,values:{displayName:t}}))||ye(e.id)}).sort(De),ke=d!==null,Ae;t[38]===Symbol.for(`react.memo_cache_sentinel`)?(Ae=new Set([...le,...de]),t[38]=Ae):Ae=t[38];let je=Ae,Me=Yt.filter(e=>!je.has(e)&&ye(Ea(e))),Ne=ve!==``,Pe=!R.isLoading&&!R.isError,Fe=Ne&&Pe&&be.length===0&&we.length===0&&Oe.length===0&&Me.length===0,Ie=!Ne||R.isLoading||R.isError||be.length>0,Le=!Ne||we.length>0,Re=!Ne||Oe.length>0||Me.length>0,ze;t[39]!==o||t[40]!==te?(ze=e=>{let t=te.has(`${e.source}:${e.id}`),n=rt(e);return Ue(o,e.source,e.id,t||n,e.supported)},t[39]=o,t[40]=te,t[41]=ze):ze=t[41];let Be=ze,Ve;t[42]===Be?Ve=t[43]:(Ve=e=>e.harness!==void 0&&tt(e)===0||Be(e),t[42]=Be,t[43]=Ve);let He=Ve,nt=be.filter(He),it;t[44]===He?it=t[45]:(it=(e,t)=>Number(He(t))-Number(He(e))||e.name.localeCompare(t.name),t[44]=He,t[45]=it);let at=[...Ne||m?be:nt].sort(it),ot=Ne?0:be.length-nt.length,st=we.filter(Se),ct=st.length>0&&st.length<we.length,lt=!ct||Ne||v?we:st,ut=ct&&!Ne?we.length-st.length:0,dt;t[46]===Ee?dt=t[47]:(dt=e=>Ee(e.id)!==`absent`,t[46]=Ee,t[47]=dt);let ft=Oe.filter(dt),pt=Me.filter(e=>se(e,q.find(t=>t.id===e)?.row.detected??null)!==`absent`),mt=ft.length+pt.length,ht=Oe.length+Me.length,gt=mt>0&&mt<ht,_t=!gt||Ne||b,vt=_t?Oe:ft,yt=_t?Me:pt,bt=gt&&!Ne?ht-mt:0,xt=!Pe||be.some(rt),St=ke&&we.some(Se),Ct;t[48]===c?Ct=t[49]:(Ct=e=>c[e.id]?.installed===!0,t[48]=c,t[49]=Ct);let wt=Oe.some(Ct),Et=Ie?(0,$.jsx)(io,{label:a({id:`RXEbZy`}),labelId:`settings-configure-agents-in-app`,children:R.isLoading?(0,$.jsxs)(`div`,{className:`flex items-center justify-center gap-2 px-3 py-6 text-muted-foreground text-sm`,children:[(0,$.jsx)(Gr,{className:`size-4`,"aria-hidden":`true`}),a({id:`ucXZ0k`})]}):R.isError?(0,$.jsxs)(`div`,{className:`flex flex-col items-center gap-2 px-3 py-6 text-center text-muted-foreground text-sm`,children:[(0,$.jsx)(za,{className:`size-5`,"aria-hidden":`true`}),(0,$.jsx)(`span`,{children:a({id:`FqGWeR`})}),(0,$.jsx)(T,{type:`button`,variant:`outline`,size:`sm`,onClick:()=>void R.refetch(),children:a({id:`6gRgw8`})})]}):(W?.length??0)===0?(0,$.jsx)(`p`,{className:`px-3 py-6 text-center text-muted-foreground text-sm`,children:a({id:`QQbwzK`})}):(0,$.jsxs)($.Fragment,{children:[at.map(e=>{let t=Be(e),n=e.supported?e.description:a({id:`5jEnaB`});return(0,$.jsx)(no,{icon:(0,$.jsx)(Qe,{agentId:e.id,iconUrl:e.iconUrl,className:`size-4`}),name:e.name,hint:n===void 0?void 0:{text:n},checked:t,disabled:!e.supported,ariaLabel:a({id:`FZtBeR`,values:{0:e.name}}),testId:`configure-agents-in-app-${e.source}:${e.id}`,rowTestId:`configure-agents-in-app-row-${e.source}:${e.id}`,onToggle:t=>{t?(qe({source:e.source,id:e.id,name:e.name,supported:e.supported,featured:e.featured,...e.iconUrl===void 0?{}:{iconUrl:e.iconUrl}},{makeDefault:!1}),$e(Xe(e.source,e.id),!0)):($e(Xe(e.source,e.id),!1),Je(`${e.source}:${e.id}`,e=>Ue(o,e.source,e.id,!0,e.supported)))}},`${e.source}:${e.id}`)}),(0,$.jsx)(oo,{hiddenCount:ot,expanded:m,onToggle:()=>h(yo),testId:`configure-agents-in-app-show-more`})]})},`in-app`):null,Dt=Le?(0,$.jsxs)(io,{label:a({id:`ALhMYW`}),labelId:`settings-configure-agents-terminal`,children:[lt.map(e=>{let{displayName:t}=Ft[e],n=K[e]??null,r=se(an(e),n),i=Ze(o,e,r===`absent`),s=`configure-agents-terminal-row-${e}`,{status:c,action:l,hintAction:u,residualFiles:d,statusId:f}=me(an(e),a({id:`QYfQdv`,values:{displayName:t}}),s,`terminal`,i,n,r,uo(an(e))??Ft[e].docsUrl);return(0,$.jsx)(no,{icon:(0,$.jsx)(Dn,{id:Pi(e),className:`size-4`,"aria-hidden":`true`}),name:a({id:`QYfQdv`,values:{displayName:t}}),hint:r===`absent`?{text:ge(`not-installed`,d),action:u}:void 0,status:c,action:l,checked:i,disabled:ro(r,i),ariaLabel:a({id:`27TLNq`,values:{displayName:t}}),testId:`configure-agents-terminal-${e}`,rowTestId:s,statusId:f,onToggle:ke?t=>_e(Ge(e),an(e),`terminal`,t,K[e]??null):void 0},e)}),(0,$.jsx)(oo,{hiddenCount:ut,expanded:v,onToggle:()=>y(vo),testId:`configure-agents-terminal-show-more`})]},`terminal`):null,Ot=Re?(0,$.jsxs)(io,{label:a({id:`BwKH4d`}),labelId:`settings-configure-agents-desktop`,labelIcon:(0,$.jsx)(zn,{"aria-hidden":`true`,className:`size-3`}),children:[vt.map(e=>{let t=c[e.id]?.installed??null,{displayName:n}=e,r=Ye(o,e.id,t),i=se(Y(e.id),t),s=`configure-agents-desktop-row-${e.id}`,{status:l,action:u,hintAction:d,residualFiles:f,statusId:p}=me(Y(e.id),a({id:`CZBqrX`,values:{displayName:n}}),s,`external`,r,t,i);return(0,$.jsx)(no,{icon:(0,$.jsx)(Dn,{id:e.id,className:`size-4`,"aria-hidden":`true`}),name:a({id:`CZBqrX`,values:{displayName:n}}),hint:i===`absent`?{text:ge(`not-installed`,f),action:d}:void 0,status:l,action:u,checked:r,disabled:ro(i,r),ariaLabel:a({id:`cdBape`,values:{displayName:n}}),testId:`configure-agents-desktop-${e.id}`,rowTestId:s,statusId:p,onToggle:n=>_e(We(e.id),Y(e.id),`external`,n,t)},e.id)}),yt.map(e=>{let t=q.find(t=>t.id===e)??null,n=t?.row.detected??null,r=Ea(e),i=se(e,n),a=`agent-connection-${e}`,o=me(e,r,a,`external`,t===null||!ba(t),n,i);return(0,$.jsx)(no,{icon:(0,$.jsx)(ka,{agentId:e,className:`size-4 text-muted-foreground`}),name:r,hint:i===`absent`?{text:ge(`not-detected`,o.residualFiles),action:o.hintAction}:void 0,status:o.status,action:o.action,ariaLabel:r,testId:`configure-agents-unlaunchable-${e}`,rowTestId:a,statusId:o.statusId},e)}),(0,$.jsx)(oo,{hiddenCount:bt,expanded:b,onToggle:()=>x(_o),testId:`configure-agents-desktop-show-more`})]},`desktop`):null,kt=[{node:Et,hasPresent:xt},{node:Dt,hasPresent:St},{node:Ot,hasPresent:wt}].sort(go).map(ho),At;t[50]===a?At=t[51]:(At=a({id:`lBN3T6`}),t[50]=a,t[51]=At);let jt;t[52]===a?jt=t[53]:(jt=a({id:`D4I0F9`}),t[52]=a,t[53]=jt);let Mt;t[54]!==At||t[55]!==jt?(Mt=(0,$.jsx)(Ha,{titleId:`settings-configure-agents-title`,title:At,children:jt}),t[54]=At,t[55]=jt,t[56]=Mt):Mt=t[56];let Nt;t[57]===Symbol.for(`react.memo_cache_sentinel`)?(Nt=(0,$.jsx)(u,{className:`-translate-y-1/2 absolute top-1/2 start-2.5 size-4 text-muted-foreground`,"aria-hidden":`true`}),t[57]=Nt):Nt=t[57];let Pt;t[58]===Symbol.for(`react.memo_cache_sentinel`)?(Pt=e=>p(e.target.value),t[58]=Pt):Pt=t[58];let It;t[59]===a?It=t[60]:(It=a({id:`-7s4fw`}),t[59]=a,t[60]=It);let Lt;t[61]===a?Lt=t[62]:(Lt=a({id:`-7s4fw`}),t[61]=a,t[62]=Lt);let Rt;t[63]!==f||t[64]!==It||t[65]!==Lt?(Rt=(0,$.jsxs)(`div`,{className:`relative`,children:[Nt,(0,$.jsx)(oi,{value:f,onChange:Pt,placeholder:It,"aria-label":Lt,className:`ps-8`,"data-testid":`configure-agents-search`})]}),t[63]=f,t[64]=It,t[65]=Lt,t[66]=Rt):Rt=t[66];let zt;t[67]!==a||t[68]!==D?(zt=D?(0,$.jsxs)(`div`,{role:`status`,className:`flex items-center gap-2 rounded-md border px-3 py-2.5 text-muted-foreground text-sm`,"data-testid":`configure-agents-read-only`,children:[(0,$.jsx)($r,{"aria-hidden":!0,className:`size-4 shrink-0`}),(0,$.jsx)(`span`,{children:a({id:`RD8cCw`})})]}):null,t[67]=a,t[68]=D,t[69]=zt):zt=t[69];let Bt;t[70]!==a||t[71]!==w?(Bt=w?(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-3 rounded-md border px-3 py-2.5 text-muted-foreground text-sm`,children:[(0,$.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[(0,$.jsx)(za,{"aria-hidden":!0,className:`size-4 shrink-0`}),(0,$.jsx)(`span`,{role:`status`,children:a({id:`4sE6E9`})})]}),(0,$.jsx)(T,{type:`button`,variant:`outline`,size:`sm`,className:`shrink-0`,onClick:()=>A(mo),children:a({id:`6gRgw8`})})]}):null,t[70]=a,t[71]=w,t[72]=Bt):Bt=t[72];let Vt;t[73]!==a||t[74]!==Fe?(Vt=Fe?(0,$.jsx)(`p`,{className:`py-6 text-center text-muted-foreground text-sm`,"data-testid":`configure-agents-no-results`,children:a({id:`Nay2Yr`})}):null,t[73]=a,t[74]=Fe,t[75]=Vt):Vt=t[75];let Ht=`configure:${j??`closed`}`,Ut;t[76]===j?Ut=t[77]:(Ut=j!==null&&Sa(j),t[76]=j,t[77]=Ut);let Wt=J!==null,Gt;t[78]===F?Gt=t[79]:(Gt=e=>{e||(F.current!==null&&($e(F.current,!1),F.current=null),M(null))},t[78]=F,t[79]=Gt);let Kt;t[80]!==ae||t[81]!==J||t[82]!==F?(Kt=(e,t)=>J===null?Promise.resolve({ok:!1,report:{actions:[],conflicts:[],withheld:[]},snapshot:null}):ae(Da(J,e,t)).then(e=>(e.ok&&(F.current=null),e)),t[80]=ae,t[81]=J,t[82]=F,t[83]=Kt):Kt=t[83];let qt;t[84]!==J||t[85]!==Ht||t[86]!==Ut||t[87]!==Wt||t[88]!==Gt||t[89]!==Kt?(qt=(0,$.jsx)(ya,{connection:J,paired:Ut,open:Wt,onOpenChange:Gt,onSave:Kt},Ht),t[84]=J,t[85]=Ht,t[86]=Ut,t[87]=Wt,t[88]=Gt,t[89]=Kt,t[90]=qt):qt=t[90];let Jt=`remove:${N??`closed`}`,Xt;t[91]===N?Xt=t[92]:(Xt=N!==null&&Sa(N),t[91]=N,t[92]=Xt);let Zt=re!==null,$t;t[93]===Symbol.for(`react.memo_cache_sentinel`)?($t=e=>{e||P(null)},t[93]=$t):$t=t[93];let en;t[94]!==ae||t[95]!==re?(en=e=>re===null?Promise.resolve({ok:!1,report:{actions:[],conflicts:[],withheld:[]},snapshot:null}):ae(Ca(re,e===void 0?[]:e)),t[94]=ae,t[95]=re,t[96]=en):en=t[96];let tn;t[97]!==re||t[98]!==Jt||t[99]!==Xt||t[100]!==Zt||t[101]!==en?(tn=(0,$.jsx)(Ma,{connection:re,paired:Xt,open:Zt,onOpenChange:$t,onRemove:en},Jt),t[97]=re,t[98]=Jt,t[99]=Xt,t[100]=Zt,t[101]=en,t[102]=tn):tn=t[102];let nn;return t[103]!==kt||t[104]!==Mt||t[105]!==Rt||t[106]!==zt||t[107]!==Bt||t[108]!==Vt||t[109]!==qt||t[110]!==tn?(nn=(0,$.jsxs)(`section`,{"aria-labelledby":`settings-configure-agents-title`,className:`space-y-6`,"data-field":`section:agent-connections`,"data-testid":`settings-configure-agents`,children:[Mt,Rt,zt,Bt,Vt,kt,qt,tn]}),t[103]=kt,t[104]=Mt,t[105]=Rt,t[106]=zt,t[107]=Bt,t[108]=Vt,t[109]=qt,t[110]=tn,t[111]=nn):nn=t[111],nn}function mo(e){return e+1}function ho(e){return e.node}function go(e,t){return Number(t.hasPresent)-Number(e.hasPresent)}function _o(e){return!e}function vo(e){return!e}function yo(e){return!e}function bo(e){return e!==void 0}function xo(e){return Y(e.id)}function So(e){return e!==void 0}function Co(e){return`${e.source}:${e.id}`}function wo(e){let{signal:t}=e;return nt(t)}var To=`open-knowledge-app`;function Eo({from:e,to:t}){try{un.getTracer(To).startSpan(`ok.language.preferenceChanged`,{attributes:{"ok.language.from":e,"ok.language.to":t}}).end()}catch(e){console.warn(`[language-telemetry] span emit failed:`,e instanceof Error?e:String(e))}}var Do=`open-knowledge-app`;function Oo(e){let t=e.light.startsWith(`saved-`),n=e.dark.startsWith(`saved-`);return!t||!n?`incomplete`:e.light===e.dark?`same`:`different`}function ko(e){try{un.getTracer(Do).startSpan(`ok.saved_themes.assignment`,{attributes:{"saved_theme.pair":Oo(e)}}).end()}catch(e){console.warn(`[saved-theme-telemetry] assignment span emit failed:`,e instanceof Error?e:String(e))}}var Ao=`system`;function jo(e){return typeof e==`string`&&gt.includes(e)}function Mo(e){return jo(e)?e:Ao}function No(e){return new Intl.DisplayNames([e],{type:`language`}).of(e)??e}function Po(e){let t=(0,Q.c)(6),{choice:n}=e;if(n===Ao){let e;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(h,{id:`D-NlUC`}),t[0]=e):e=t[0],e}let r;t[1]===n?r=t[2]:(r=No(n),t[1]=n,t[2]=r);let i;return t[3]!==n||t[4]!==r?(i=(0,$.jsx)(`span`,{lang:n,className:`capitalize`,children:r}),t[3]=n,t[4]=r,t[5]=i):i=t[5],i}function Fo(e){let t=(0,Q.c)(22),n,r,i,a,o;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],o=t[5]):({value:o,onValueChange:r,onBlur:n,ref:i,...a}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o);let s;t[6]===o?s=t[7]:(s=Mo(o),t[6]=o,t[7]=s);let c=s,l;t[8]===r?l=t[9]:(l=e=>r(Mo(e)),t[8]=r,t[9]=l);let u;t[10]===c?u=t[11]:(u=(0,$.jsx)(Fe,{children:(0,$.jsx)(Po,{choice:c})}),t[10]=c,t[11]=u);let d;t[12]!==n||t[13]!==i||t[14]!==a||t[15]!==u?(d=(0,$.jsx)(Pe,{...a,ref:i,onBlur:n,size:`sm`,className:`w-48`,children:u}),t[12]=n,t[13]=i,t[14]=a,t[15]=u,t[16]=d):d=t[16];let f;t[17]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,$.jsxs)(Ne,{children:[(0,$.jsx)(Me,{value:Ao,children:(0,$.jsx)(Po,{choice:Ao})}),ut.map(Io)]}),t[17]=f):f=t[17];let p;return t[18]!==c||t[19]!==l||t[20]!==d?(p=(0,$.jsxs)(Ie,{value:c,onValueChange:l,children:[d,f]}),t[18]=c,t[19]=l,t[20]=d,t[21]=p):p=t[21],p}function Io(e){return(0,$.jsx)(Me,{value:e,children:(0,$.jsx)(Po,{choice:e})},e)}function Lo(e){return{chrome:e.sidebar,surface:e.background,bar:e.primary,line:e.border,dots:[e[`syntax-string`],e[`syntax-keyword`],e[`syntax-atom`]]}}function Ro(e,t,n){return e.id===`custom`?Lo(Mt(bi(t))):e.scheme?Lo(Mt(e.scheme)):Lo(mi(n))}function zo(e){let t=(0,Q.c)(38),{theme:n,customSeed:r,slotMode:i}=e,a,o,s,c,l,u,d,f,p,m;t[0]!==r||t[1]!==i||t[2]!==n?(a=Ro(n,r,i),u=!0,d=``,f=`aspect-[4/3] w-full overflow-hidden rounded-md border`,p={backgroundColor:a.surface,borderColor:a.line},m=(0,$.jsxs)(`div`,{className:`flex h-1/3 items-center gap-1 px-1.5`,style:{backgroundColor:a.chrome,borderBottom:`1px solid ${a.line}`},children:[(0,$.jsx)(`span`,{className:`h-1.5 w-5 rounded-full`,style:{backgroundColor:a.bar}}),(0,$.jsx)(`span`,{className:`h-1.5 flex-1 rounded-full opacity-50`,style:{backgroundColor:a.line}})]}),l=`flex h-2/3`,o=`flex w-1/4 flex-col items-center justify-center gap-1`,s={backgroundColor:a.chrome,borderRight:`1px solid ${a.line}`},c=a.dots.map(Bo),t[0]=r,t[1]=i,t[2]=n,t[3]=a,t[4]=o,t[5]=s,t[6]=c,t[7]=l,t[8]=u,t[9]=d,t[10]=f,t[11]=p,t[12]=m):(a=t[3],o=t[4],s=t[5],c=t[6],l=t[7],u=t[8],d=t[9],f=t[10],p=t[11],m=t[12]);let h;t[13]!==o||t[14]!==s||t[15]!==c?(h=(0,$.jsx)(`div`,{className:o,style:s,children:c}),t[13]=o,t[14]=s,t[15]=c,t[16]=h):h=t[16];let g;t[17]===a.dots[1]?g=t[18]:(g=(0,$.jsx)(`span`,{className:`h-1.5 w-3/4 rounded-full`,style:{backgroundColor:a.dots[1]}}),t[17]=a.dots[1],t[18]=g);let _;t[19]===a.line?_=t[20]:(_=(0,$.jsx)(`span`,{className:`h-1.5 w-1/2 rounded-full opacity-60`,style:{backgroundColor:a.line}}),t[19]=a.line,t[20]=_);let v;t[21]===a.dots[0]?v=t[22]:(v=(0,$.jsx)(`span`,{className:`h-1.5 w-2/3 rounded-full`,style:{backgroundColor:a.dots[0]}}),t[21]=a.dots[0],t[22]=v);let y;t[23]!==g||t[24]!==_||t[25]!==v?(y=(0,$.jsxs)(`div`,{className:`flex flex-1 flex-col justify-center gap-1 px-1.5`,children:[g,_,v]}),t[23]=g,t[24]=_,t[25]=v,t[26]=y):y=t[26];let b;t[27]!==h||t[28]!==y||t[29]!==l?(b=(0,$.jsxs)(`div`,{className:l,children:[h,y]}),t[27]=h,t[28]=y,t[29]=l,t[30]=b):b=t[30];let x;return t[31]!==b||t[32]!==u||t[33]!==d||t[34]!==f||t[35]!==p||t[36]!==m?(x=(0,$.jsxs)(`div`,{"aria-hidden":u,"data-theme-swatch":d,className:f,style:p,children:[m,b]}),t[31]=b,t[32]=u,t[33]=d,t[34]=f,t[35]=p,t[36]=m,t[37]=x):x=t[37],x}function Bo(e,t){return(0,$.jsx)(`span`,{className:`size-1.5 rounded-full`,style:{backgroundColor:e}},t)}function Vo(e){return x(`size-6 min-w-6 rounded-md border p-0 transition-colors`,e?`border-primary bg-primary/15 text-primary hover:bg-primary/20 data-[state=on]:bg-primary/15`:`border-border/70 text-muted-foreground/70 hover:text-foreground`)}function Ho(e){return x(`size-3.5`,e&&`fill-current`)}function Uo(e){let t=(0,Q.c)(33),{selection:n,themes:r,unavailableThemes:i,onAssign:a,editControl:o,deleteControl:s,createControl:c,slotMode:l,customSeed:u,firstItemId:d,"aria-label":f,"aria-describedby":p,"aria-invalid":m}=e,h=r===void 0?ht:r,_;t[0]===i?_=t[1]:(_=i===void 0?[]:i,t[0]=i,t[1]=_);let v=_,y=l===void 0?`light`:l,{_:b}=g(),S;if(t[2]!==b||t[3]!==u||t[4]!==s||t[5]!==o||t[6]!==d||t[7]!==a||t[8]!==n||t[9]!==y||t[10]!==h){let e;t[12]!==b||t[13]!==u||t[14]!==s||t[15]!==o||t[16]!==d||t[17]!==a||t[18]!==n||t[19]!==y?(e=(e,t)=>{let r=n.light===e.id,i=n.dark===e.id,c=o?.themeIds.includes(e.id)??!1,l=s?.themeIds.includes(e.id)??!1,f=o?.selectedId===e.id,p=b(y===`light`?{id:`hgF0al`,values:{0:e.label}}:{id:`6Nea1q`,values:{0:e.label}});return(0,$.jsxs)(`fieldset`,{"aria-label":e.label,className:x(`relative flex min-w-0 flex-col gap-1.5 rounded-lg border-2 p-1 text-left`,n[y]===e.id?`border-primary`:`border-transparent`),children:[(0,$.jsx)(T,{type:`button`,variant:`ghost`,"aria-label":p,"data-theme-focus-target":``,onClick:()=>a(y,e.id),className:`h-auto w-full cursor-pointer p-0 transition-opacity hover:bg-transparent hover:opacity-90`,children:(0,$.jsx)(zo,{theme:e,customSeed:u,slotMode:y})}),l?(0,$.jsx)(T,{type:`button`,variant:`outline`,size:`icon-sm`,title:b({id:`Y2tU6I`,values:{0:e.label}}),"aria-label":b({id:`Y2tU6I`,values:{0:e.label}}),className:`absolute top-2 end-2 z-10 border-border/80 bg-background/85 text-muted-foreground shadow-sm backdrop-blur-sm hover:border-destructive/50 hover:bg-destructive/15 hover:text-destructive focus-visible:border-destructive/50 focus-visible:text-destructive focus-visible:ring-destructive/20 dark:bg-background/80 dark:hover:bg-destructive/20`,onClick:async t=>{let n=t.currentTarget.closest(`fieldset`),r=n?.previousElementSibling?.querySelector(`[data-theme-focus-target]`)??n?.nextElementSibling?.querySelector(`[data-theme-focus-target]`);await s?.onDelete(e.id)!==!1&&r?.focus()},children:(0,$.jsx)(Qr,{"aria-hidden":!0})}):null,(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-1 px-0.5`,children:[(0,$.jsx)(`span`,{className:`truncate text-1sm font-medium text-foreground`,children:e.label}),(0,$.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1`,children:[c?(0,$.jsx)(Ve,{className:Vo(f),pressed:f,onPressedChange:t=>{o?.onSelect(t?e.id:null)},"aria-label":b(f?{id:`8x6zk9`,values:{0:e.label}}:{id:`N6j2JH`,values:{0:e.label}}),children:(0,$.jsx)(Sn,{className:`size-3.5`})}):null,(0,$.jsx)(Ve,{id:t===0?d:void 0,className:Vo(r),pressed:r,onPressedChange:t=>{t&&a(`light`,e.id)},"aria-label":b({id:`sq4WQH`,values:{0:e.label}}),children:(0,$.jsx)(Kr,{className:Ho(r)})}),(0,$.jsx)(Ve,{className:Vo(i),pressed:i,onPressedChange:t=>{t&&a(`dark`,e.id)},"aria-label":b({id:`lZvQrY`,values:{0:e.label}}),children:(0,$.jsx)(qr,{className:Ho(i)})})]})]})]},e.id)},t[12]=b,t[13]=u,t[14]=s,t[15]=o,t[16]=d,t[17]=a,t[18]=n,t[19]=y,t[20]=e):e=t[20],S=h.map(e),t[2]=b,t[3]=u,t[4]=s,t[5]=o,t[6]=d,t[7]=a,t[8]=n,t[9]=y,t[10]=h,t[11]=S}else S=t[11];let C;t[21]!==b||t[22]!==c?(C=c?(0,$.jsxs)(T,{type:`button`,variant:`ghost`,onClick:c.onCreate,className:`group h-auto min-w-0 flex-col items-stretch gap-1.5 rounded-lg border-2 border-transparent p-1 text-left text-muted-foreground hover:bg-transparent hover:text-foreground`,children:[(0,$.jsx)(`span`,{className:`flex aspect-[4/3] w-full items-center justify-center rounded-md border border-dashed border-border bg-muted/10 transition-colors group-hover:border-foreground/40`,children:(0,$.jsx)(Cn,{"aria-hidden":!0,className:`size-6`})}),(0,$.jsx)(`span`,{className:`truncate px-0.5 text-1sm font-medium`,children:b({id:`AJ7_B2`})})]}):null,t[21]=b,t[22]=c,t[23]=C):C=t[23];let w;t[24]===v?w=t[25]:(w=v.map(Wo),t[24]=v,t[25]=w);let E;return t[26]!==p||t[27]!==m||t[28]!==f||t[29]!==S||t[30]!==C||t[31]!==w?(E=(0,$.jsxs)(`fieldset`,{"aria-label":f,"aria-describedby":p,"aria-invalid":m,className:`grid w-full min-w-0 grid-cols-2 gap-2 sm:grid-cols-3`,children:[S,C,w]}),t[26]=p,t[27]=m,t[28]=f,t[29]=S,t[30]=C,t[31]=w,t[32]=E):E=t[32],E}function Wo(e){return(0,$.jsxs)(`fieldset`,{"aria-label":e.label,className:`flex min-w-0 flex-col gap-1.5 rounded-lg border-2 border-destructive/40 bg-destructive/5 p-1 text-left`,children:[(0,$.jsx)(`div`,{"aria-hidden":!0,className:`flex aspect-[4/3] w-full items-center justify-center rounded-md border border-destructive/30 bg-muted/40 text-destructive`,children:(0,$.jsx)(Wn,{className:`size-6`})}),(0,$.jsx)(`span`,{className:`truncate px-0.5 text-1sm font-medium text-foreground`,children:e.label}),(0,$.jsx)(`span`,{className:`px-0.5 text-xs font-medium text-destructive`,children:e.problem}),(0,$.jsx)(`span`,{className:`px-0.5 pb-0.5 text-xs text-muted-foreground`,children:e.detail})]},e.key)}var Go=12e3;function Ko(e){let t=(0,Q.c)(210),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({appearance:n,onAssign:r,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let{_:a}=g(),{themes:o,warnings:s,truncated:c,loadError:l,refresh:u,deleteTheme:d,restoreTheme:f,editingThemeId:p,themeEditorOpen:m,selectThemeToEdit:h}=ri(),[_,v]=(0,Z.useState)(!1),[y,b]=(0,Z.useState)(``),[x,S]=(0,Z.useState)(null),[C,w]=(0,Z.useState)(!1),E=(0,Z.useRef)(null),D,O;t[4]===u?(D=t[5],O=t[6]):(D=()=>{u()},O=[u],t[4]=u,t[5]=D,t[6]=O),(0,Z.useEffect)(D,O);let k;t[7]!==n||t[8]!==o?(k=cn(n,o),t[7]=n,t[8]=o,t[9]=k):k=t[9];let A=k,j,M,R,V,H,ee,U,W,G,te,ne,K,q,J,re,ie,ae,oe,se,ce,le;if(t[10]!==a||t[11]!==x||t[12]!==y||t[13]!==_||t[14]!==d||t[15]!==p||t[16]!==C||t[17]!==l||t[18]!==r||t[19]!==i||t[20]!==u||t[21]!==f||t[22]!==h||t[23]!==A||t[24]!==m||t[25]!==o||t[26]!==c||t[27]!==s){let e=nn(y),n;t[49]===o?n=t[50]:(n=o.filter(Zo),t[49]=o,t[50]=n);let g=n,D,O,k,L,ue,de,fe,pe,me;if(t[51]!==a||t[52]!==y||t[53]!==d||t[54]!==p||t[55]!==g||t[56]!==C||t[57]!==l||t[58]!==r||t[59]!==i||t[60]!==u||t[61]!==f||t[62]!==h||t[63]!==A||t[64]!==m||t[65]!==o||t[66]!==c||t[67]!==s){let e=o.flatMap(Xo),n;t[80]!==a||t[81]!==u||t[82]!==f?(n=async function(e){let t=await f({id:e.id,name:e.scheme.name,stem:e.stem,scheme:{...e.scheme,palette:{...e.scheme.palette}},extension:e.filename.endsWith(`.yml`)?`.yml`:`.yaml`});if(t.ok){await u(),X.success(a({id:`Kx881F`,values:{0:e.label}}));return}if(t.reason===`name-taken`){X.error(a({id:`oZUYMv`,values:{0:e.label}}));return}X.error(a({id:`7O7REc`,values:{0:e.label}}))},t[80]=a,t[81]=u,t[82]=f,t[83]=n):n=t[83];let _=n;k=async function(t){let n=e.find(e=>e.id===t);if(!n)return X.error(a({id:`ANFxWn`})),!1;let r=await d(n.id);if(!r.ok)return X.error(a({id:`kkux8f`,values:{0:n.label}})),!1;if(p===n.id&&h(null),await u(),!r.existed)return X(a({id:`ekSPiP`,values:{0:n.label}})),!0;let i={...n,filename:r.filename,label:r.scheme.name,scheme:r.scheme};return X(a({id:`YCmS3k`,values:{0:i.label}}),{duration:Go,action:{label:a({id:`9uI_rE`}),onClick:()=>_(i)}}),!0};let x;t[84]!==a||t[85]!==y||t[86]!==C||t[87]!==r||t[88]!==i||t[89]!==u||t[90]!==f||t[91]!==h||t[92]!==A||t[93]!==o?(x=async function(e){if(e.preventDefault(),C)return;let t=nn(y);if(!t.ok){S(a({id:`RG3yW6`})),E.current?.focus();return}let n=i.slotMode??`light`,s=o.find(e=>e.id===A[n])?.scheme??bi(i.customSeed),c={name:t.name,variant:s.variant,palette:{...s.palette}};S(null),w(!0);let l=await f({id:t.id,name:t.name,scheme:c});if(!l.ok){S(l.reason===`name-taken`?a({id:`_IfSZn`}):l.reason===`name-invalid`?a({id:`qtnmEX`}):a({id:`DmkTrb`})),w(!1),E.current?.focus();return}let d={id:l.id,label:c.name,kind:c.variant,scheme:c,toTokens:()=>Mt(c)};r(n,l.id,A,[...o,d]),await u(),b(``),v(!1),w(!1),h(l.id)},t[84]=a,t[85]=y,t[86]=C,t[87]=r,t[88]=i,t[89]=u,t[90]=f,t[91]=h,t[92]=A,t[93]=o,t[94]=x):x=t[94],O=x;let j;if(t[95]!==a||t[96]!==s){let e;t[98]===a?e=t[99]:(e=e=>{let t;bb90:switch(e.code){case`unparseable`:t=a({id:`g12y1g`});break bb90;case`not-a-scheme`:t=a({id:`p7Utw8`});break bb90;case`missing-slots`:t=a({id:`GUZHkL`});break bb90;case`bad-hex`:t=a({id:`IMLUBh`});break bb90;case`empty`:t=a({id:`k_tFzX`});break bb90;case`too-long`:t=a({id:`FyyIjH`});break bb90;case`invalid-chars`:t=a({id:`JaU1ld`});break bb90;case`unsupported-extension-case`:t=a({id:`R30SFt`});break bb90;case`duplicate-identity`:t=a({id:`DUb7Ax`});break bb90;case`symlink`:t=a({id:`hFmYGU`});break bb90;case`not-regular-file`:t=a({id:`UH0Zqw`});break bb90;case`file-too-large`:t=a({id:`-othoN`});break bb90;case`read-failed`:t=a({id:`cLn264`});break bb90;default:t=a({id:`WBNpt9`,values:{0:e.code}})}return{key:e.filename,label:e.filename,problem:t,detail:e.conflictingFilenames?a({id:`QwG_zJ`,values:{0:e.conflictingFilenames.join(`, `)}}):a({id:`kwNS82`})}},t[98]=a,t[99]=e),j=s.map(e),t[95]=a,t[96]=s,t[97]=j}else j=t[97];let M=j;K=`flex w-full min-w-0 flex-col gap-2`,t[100]!==a||t[101]!==l||t[102]!==u?(q=l?(0,$.jsxs)(`div`,{role:`alert`,className:`flex items-center justify-between gap-2 rounded-md border border-destructive/30 bg-destructive/5 px-3 py-2 text-sm text-foreground`,children:[(0,$.jsx)(`span`,{children:a({id:`hVzt9x`})}),(0,$.jsx)(T,{type:`button`,variant:`outline`,size:`xs`,onClick:()=>void u(),children:a({id:`KDw4GX`})})]}):null,t[100]=a,t[101]=l,t[102]=u,t[103]=q):q=t[103];let N;t[104]!==a||t[105]!==c?(N=c?(0,$.jsxs)(`div`,{className:`flex items-start gap-2 rounded-md border border-amber-500/30 bg-amber-500/5 px-3 py-2 text-sm text-foreground`,children:[(0,$.jsx)($r,{"aria-hidden":`true`,className:`mt-0.5 size-4 shrink-0 text-amber-600`}),(0,$.jsx)(`span`,{children:a({id:`DLIljL`})})]}):null,t[104]=a,t[105]=c,t[106]=N):N=t[106],t[107]===N?J=t[108]:(J=(0,$.jsx)(`div`,{role:`status`,children:N}),t[107]=N,t[108]=J),D=Uo,ue=i,de=A,fe=g,pe=M;let P;t[109]===o?P=t[110]:(P=o.filter(Yo).map(Jo),t[109]=o,t[110]=P);let F=m?p:null;t[111]!==h||t[112]!==P||t[113]!==F?(me={themeIds:P,selectedId:F,onSelect:h},t[111]=h,t[112]=P,t[113]=F,t[114]=me):me=t[114],L=e.map(qo),t[51]=a,t[52]=y,t[53]=d,t[54]=p,t[55]=g,t[56]=C,t[57]=l,t[58]=r,t[59]=i,t[60]=u,t[61]=f,t[62]=h,t[63]=A,t[64]=m,t[65]=o,t[66]=c,t[67]=s,t[68]=D,t[69]=O,t[70]=k,t[71]=K,t[72]=q,t[73]=J,t[74]=L,t[75]=ue,t[76]=de,t[77]=fe,t[78]=pe,t[79]=me}else D=t[68],O=t[69],k=t[70],K=t[71],q=t[72],J=t[73],L=t[74],ue=t[75],de=t[76],fe=t[77],pe=t[78],me=t[79];let he;t[115]!==k||t[116]!==L?(he={themeIds:L,onDelete:k},t[115]=k,t[116]=L,t[117]=he):he=t[117];let ge;t[118]===Symbol.for(`react.memo_cache_sentinel`)?(ge={onCreate:()=>v(!0)},t[118]=ge):ge=t[118];let _e;t[119]!==r||t[120]!==A||t[121]!==o?(_e=(e,t)=>r(e,t,A,o),t[119]=r,t[120]=A,t[121]=o,t[122]=_e):_e=t[122],t[123]!==D||t[124]!==ue||t[125]!==de||t[126]!==fe||t[127]!==pe||t[128]!==me||t[129]!==he||t[130]!==_e?(re=(0,$.jsx)(D,{...ue,selection:de,themes:fe,unavailableThemes:pe,editControl:me,deleteControl:he,createControl:ge,onAssign:_e}),t[123]=D,t[124]=ue,t[125]=de,t[126]=fe,t[127]=pe,t[128]=me,t[129]=he,t[130]=_e,t[131]=re):re=t[131],H=B,te=_,t[132]===C?ne=t[133]:(ne=e=>{C||v(e)},t[132]=C,t[133]=ne),V=F;let ve;t[134]===a?ve=t[135]:(ve=a({id:`Z_nNa2`}),t[134]=a,t[135]=ve);let ye;t[136]===ve?ye=t[137]:(ye=(0,$.jsx)(P,{children:ve}),t[136]=ve,t[137]=ye);let be;t[138]===a?be=t[139]:(be=a({id:`nTM8ab`}),t[138]=a,t[139]=be);let xe;t[140]===be?xe=t[141]:(xe=(0,$.jsx)(N,{children:be}),t[140]=be,t[141]=xe),t[142]!==ye||t[143]!==xe?(G=(0,$.jsxs)(z,{className:`gap-2`,children:[ye,xe]}),t[142]=ye,t[143]=xe,t[144]=G):G=t[144],R=I,ee=`create-saved-theme-form`,U=!0,W=O,M=Oi,se=x!==null;let Se;t[145]===a?Se=t[146]:(Se=a({id:`HZ7fEu`}),t[145]=a,t[146]=Se),t[147]===Se?ce=t[148]:(ce=(0,$.jsx)(Ei,{htmlFor:`create-saved-theme-name`,children:Se}),t[147]=Se,t[148]=ce);let Ce=x!==null,we=x?`create-saved-theme-help create-saved-theme-error`:`create-saved-theme-help`,Te;t[149]===x?Te=t[150]:(Te=e=>{b(e.target.value),x&&S(null)},t[149]=x,t[150]=Te),t[151]!==y||t[152]!==C||t[153]!==Ce||t[154]!==we||t[155]!==Te?(le=(0,$.jsx)(oi,{ref:E,id:`create-saved-theme-name`,value:y,autoFocus:!0,autoComplete:`off`,required:!0,readOnly:C,"aria-invalid":Ce,"aria-describedby":we,onChange:Te}),t[151]=y,t[152]=C,t[153]=Ce,t[154]=we,t[155]=Te,t[156]=le):le=t[156],j=Di,ie=`create-saved-theme-help`,ae=`font-mono`,oe=e.ok?a({id:`Yb82LN`,values:{0:e.stem}}):a({id:`4d0VYJ`}),t[10]=a,t[11]=x,t[12]=y,t[13]=_,t[14]=d,t[15]=p,t[16]=C,t[17]=l,t[18]=r,t[19]=i,t[20]=u,t[21]=f,t[22]=h,t[23]=A,t[24]=m,t[25]=o,t[26]=c,t[27]=s,t[28]=j,t[29]=M,t[30]=R,t[31]=V,t[32]=H,t[33]=ee,t[34]=U,t[35]=W,t[36]=G,t[37]=te,t[38]=ne,t[39]=K,t[40]=q,t[41]=J,t[42]=re,t[43]=ie,t[44]=ae,t[45]=oe,t[46]=se,t[47]=ce,t[48]=le}else j=t[28],M=t[29],R=t[30],V=t[31],H=t[32],ee=t[33],U=t[34],W=t[35],G=t[36],te=t[37],ne=t[38],K=t[39],q=t[40],J=t[41],re=t[42],ie=t[43],ae=t[44],oe=t[45],se=t[46],ce=t[47],le=t[48];let ue;t[157]!==j||t[158]!==ie||t[159]!==ae||t[160]!==oe?(ue=(0,$.jsx)(j,{id:ie,className:ae,children:oe}),t[157]=j,t[158]=ie,t[159]=ae,t[160]=oe,t[161]=ue):ue=t[161];let de;t[162]===x?de=t[163]:(de=x?(0,$.jsx)(Ti,{id:`create-saved-theme-error`,children:x}):null,t[162]=x,t[163]=de);let fe;t[164]!==M||t[165]!==ue||t[166]!==de||t[167]!==se||t[168]!==ce||t[169]!==le?(fe=(0,$.jsxs)(M,{"data-invalid":se,children:[ce,le,ue,de]}),t[164]=M,t[165]=ue,t[166]=de,t[167]=se,t[168]=ce,t[169]=le,t[170]=fe):fe=t[170];let pe;t[171]!==ee||t[172]!==U||t[173]!==W||t[174]!==fe?(pe=(0,$.jsx)(`form`,{id:ee,noValidate:U,onSubmit:W,children:fe}),t[171]=ee,t[172]=U,t[173]=W,t[174]=fe,t[175]=pe):pe=t[175];let me;t[176]!==R||t[177]!==pe?(me=(0,$.jsx)(R,{children:pe}),t[176]=R,t[177]=pe,t[178]=me):me=t[178];let he;t[179]===Symbol.for(`react.memo_cache_sentinel`)?(he=()=>v(!1),t[179]=he):he=t[179];let ge;t[180]===a?ge=t[181]:(ge=a({id:`dEgA5A`}),t[180]=a,t[181]=ge);let _e;t[182]!==C||t[183]!==ge?(_e=(0,$.jsx)(T,{type:`button`,variant:`outline`,disabled:C,onClick:he,children:ge}),t[182]=C,t[183]=ge,t[184]=_e):_e=t[184];let ve;t[185]!==a||t[186]!==C?(ve=a(C?{id:`_DwR-n`}:{id:`cuHhjo`}),t[185]=a,t[186]=C,t[187]=ve):ve=t[187];let ye;t[188]!==C||t[189]!==ve?(ye=(0,$.jsx)(T,{type:`submit`,form:`create-saved-theme-form`,disabled:C,children:ve}),t[188]=C,t[189]=ve,t[190]=ye):ye=t[190];let be;t[191]!==_e||t[192]!==ye?(be=(0,$.jsxs)(L,{children:[_e,ye]}),t[191]=_e,t[192]=ye,t[193]=be):be=t[193];let xe;t[194]!==V||t[195]!==G||t[196]!==me||t[197]!==be?(xe=(0,$.jsxs)(V,{children:[G,me,be]}),t[194]=V,t[195]=G,t[196]=me,t[197]=be,t[198]=xe):xe=t[198];let Se;t[199]!==H||t[200]!==te||t[201]!==ne||t[202]!==xe?(Se=(0,$.jsx)(H,{open:te,onOpenChange:ne,children:xe}),t[199]=H,t[200]=te,t[201]=ne,t[202]=xe,t[203]=Se):Se=t[203];let Ce;return t[204]!==K||t[205]!==q||t[206]!==J||t[207]!==re||t[208]!==Se?(Ce=(0,$.jsxs)(`div`,{className:K,children:[q,J,re,Se]}),t[204]=K,t[205]=q,t[206]=J,t[207]=re,t[208]=Se,t[209]=Ce):Ce=t[209],Ce}function qo(e){return e.id}function Jo(e){return e.id}function Yo(e){return e.id.startsWith(`saved-`)}function Xo(e){let t=Nt(e.id);return!t.ok||!e.scheme?[]:[{id:e.id,stem:t.stem,label:e.label,scheme:e.scheme}]}function Zo(e){return e.id!==`custom`}function Qo(e,t){if(e.length===0)throw Error(`buildPatch: path must be non-empty`);let[n,...r]=e;return r.length===0?{[String(n)]:t}:{[String(n)]:Qo(r,t)}}function $o(e){let t=e;for(let e=0;e<16;e++){if(t==null)return;let e=t?._zod?.def;if(e?.type===`default`){let t=e.defaultValue;return typeof t==`function`?t():t}let n=t?._zod?.def?.innerType;if(n===void 0)return;t=n}}function es(e){let t=e;for(let e=0;e<16;e++){if(t==null)return;let e=t?._zod?.def;if(!e)return;if(e.type===`default`||e.type===`optional`||e.type===`nullable`){t=e.innerType;continue}return e.type}}function ts(e){let t=e;for(let e=0;e<16;e++){if(t==null)return;let e=t?._zod?.def;if(!e)return;if(e.type===`enum`)return e.entries?Object.values(e.entries):void 0;if(e.innerType!==void 0){t=e.innerType;continue}return}}function ns(e){let t=(0,Q.c)(14),n;t[0]===e?n=t[1]:(n=e.current(),t[0]=e,t[1]=n);let r=n,i;t[2]===r?i=t[3]:(i={defaultValues:r,mode:`onBlur`},t[2]=r,t[3]=i);let a=ra(i),o,s;t[4]!==e||t[5]!==a?(o=()=>e.subscribe(e=>{rs(a,e)}),s=[e,a],t[4]=e,t[5]=a,t[6]=o,t[7]=s):(o=t[6],s=t[7]),(0,Z.useEffect)(o,s);let c;t[8]!==e||t[9]!==a?(c=t=>is(a,e,t),t[8]=e,t[9]=a,t[10]=c):c=t[10];let l=c,u;return t[11]!==l||t[12]!==a?(u={form:a,commitField:l},t[11]=l,t[12]=a,t[13]=u):u=t[13],u}function rs(e,t){e.reset(t,{keepDirtyValues:!0,keepDirty:!0,keepTouched:!0})}function is(e,t,n){let r=e.getValues(n),i=Qo(ss(n),r),a=t.patch(i);if(a.ok)return e.clearErrors(n),e.resetField(n,{defaultValue:r,keepError:!1}),!0;if(Rt(a.error)&&a.error.code===`SCHEMA_INVALID`&&a.error.issues.length>0){e.clearErrors(n);for(let t of a.error.issues){let r=t.path.length>0?t.path.map(String).join(`.`):n;e.setError(r,{type:`config-binding`,message:t.message})}}else e.setError(n,{type:`config-binding`,message:as(a.error,n)});return!1}function as(e,t){if(Rt(e)&&e.code===`SCHEMA_INVALID`){let n=e.issues.find(e=>os(e,t));if(n)return n.message}return tn(e)}function os(e,t){return e.path.map(String).join(`.`)===t}function ss(e){return e.split(`.`)}function cs(e){if(!Rt(e)||e.code!==`SCHEMA_INVALID`)return null;let t=e.issues[0];return!t||t.path.length===0?null:t.path.map(String).join(`.`)}function ls(){let e=(0,Q.c)(3),t,n;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,$.jsx)(Fi,{className:`h-5 w-32`}),n=(0,$.jsx)(Fi,{className:`h-4 w-64`}),e[0]=t,e[1]=n):(t=e[0],n=e[1]);let r;return e[2]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,$.jsxs)(`div`,{className:`space-y-3`,children:[t,n,(0,$.jsxs)(`div`,{className:`space-y-2`,children:[(0,$.jsx)(Fi,{className:`h-9 w-full`}),(0,$.jsx)(Fi,{className:`h-9 w-full`})]})]}),e[2]=r):r=e[2],r}function us({field:e,scope:t,commitField:n,isFlashed:r}){"use no memo";let{_:i}=g(),a=sa(),{setTheme:o}=v(),s=wn(),c=Dt(at,e.path),l=c?es(c):void 0,u=c?$o(c):void 0,d=c?ts(c):void 0,f=c?Zt(c):void 0,p=f?.scope===`project`&&t!==`project`||f?.scope===`user`&&t!==`user`,m=e.path.join(`.`),_=i(e.label),[y,b]=(0,Z.useState)(!1),S=(0,Z.useRef)(null);(0,Z.useEffect)(()=>()=>{S.current&&clearTimeout(S.current)},[]);let C=()=>{b(!0),S.current&&clearTimeout(S.current),S.current=setTimeout(()=>b(!1),1200)},w=()=>{let e=n(m);return e&&C(),e},O=()=>a.getFieldState(m).isDirty?w():!0,A=()=>{if(e.control===`theme-tiles`){let e=s?.userBinding;if(!e)return;let t=e.patch({appearance:pi()});t.ok?C():a.setError(m,{type:`manual`,message:as(t.error,m)});return}let t=u===void 0?null:u;a.setValue(m,t,{shouldDirty:!1}),e.control===`theme-cards`&&o(En(t)),w()},j=x(`relative`,r&&`animate-settings-flash`);return(0,$.jsx)(ia,{control:a.control,name:m,render:({field:n})=>{let r=!p&&(u!==void 0||n.value!==void 0);return(0,$.jsxs)(na,{className:j,"data-field":e.path.join(`.`),"data-scope":t,children:[(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,$.jsx)(oa,{className:`text-sm font-medium`,children:_}),r?(0,$.jsxs)(k,{children:[(0,$.jsx)(E,{asChild:!0,children:(0,$.jsx)(T,{variant:`ghost`,size:`icon`,className:`h-5 w-5 text-muted-foreground opacity-60 hover:opacity-100`,onClick:A,"aria-label":i({id:`lhjq3G`,values:{labelText:_}}),children:(0,$.jsx)(Yr,{className:`size-3.5`})})}),(0,$.jsx)(D,{children:(0,$.jsx)(h,{id:`L-rMC9`})})]}):null]}),e.description?(0,$.jsx)(ca,{className:`text-muted-foreground text-1sm`,children:i(e.description)}):null,(0,$.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,$.jsx)(aa,{children:(0,$.jsx)(fs,{field:e,ctl:n,typeTag:l,enumOptions:d,onCommit:O,onRevertToBaseline:()=>a.resetField(m,{keepError:!0}),onSavedOutsideForm:C,onWriteRejected:e=>{a.setError(m,{type:`manual`,message:as(e,m)})}})}),(0,$.jsx)(gs,{visible:y,srOnly:ds(e.control)})]}),(0,$.jsx)(la,{"data-field-error":e.path.join(`.`)})]})}})}function ds(e){return e===`theme-tiles`||e===`theme-cards`}function fs({field:e,ctl:t,typeTag:n,enumOptions:r,onCommit:i,onRevertToBaseline:a,onSavedOutsideForm:o,onWriteRejected:s,...c}){"use no memo";let{_:l}=g(),{setTheme:u,systemTheme:d}=v(),f=wn(),p=f?.merged??null;if(e.control===`language-select`)return(0,$.jsx)(Fo,{...c,value:t.value,ref:t.ref,onBlur:t.onBlur,onValueChange:e=>{let n=xi(t.value)??`system`;n!==e&&Eo({from:n,to:e}),t.onChange(e),i()}});if(e.control===`theme-cards`){let{id:n,...r}=c;return(0,$.jsx)(Jr,{...r,firstItemId:n,value:En(t.value),"aria-label":l(e.label),onValueChange:e=>{let n=En(t.value);u(e),t.onChange(e),!i()&&(u(n),a())}})}if(e.control===`theme-tiles`){let{id:t,...n}=c,r=p?.appearance?.customTheme,i=p?.appearance?.theme,a=on(i,d===`dark`);return(0,$.jsx)(Ko,{...n,firstItemId:t,appearance:p?.appearance,customSeed:r,slotMode:a,"aria-label":l(e.label),onAssign:(e,t,n,c)=>{let l=f?.userBinding;if(!l)return;let d={...n,[e]:t},p=e=>{let t=e[a];return t===`custom`?gi(bi(r)):fi(t,c)};di({selection:d,modePreference:i,slotMode:a,customSeed:r,themes:c});let m=p(d);m&&u(m);let h=l.patch({appearance:_i(d)});if(h.ok){ko(d),o();return}di({selection:n,modePreference:i,slotMode:a,customSeed:r,themes:c}),u(p(n)??i??`system`),s(h.error)}})}if(n===`boolean`)return(0,$.jsx)(ze,{...c,checked:!!t.value,ref:t.ref,onCheckedChange:e=>{t.onChange(e),i()},onBlur:t.onBlur});if(n===`enum`&&r&&r.length>0&&(e.control===`enum-toggle`||r.length<=4)){let{id:n,...a}=c;return(0,$.jsx)(He,{...a,type:`single`,value:typeof t.value==`string`?t.value:``,ref:t.ref,onValueChange:e=>{e&&(t.onChange(e),i())},onBlur:t.onBlur,variant:`segmented`,size:`sm`,spacing:1,className:`bg-muted dark:bg-background p-0.5 rounded-lg`,"aria-label":l(e.label),children:r.map((e,t)=>(0,$.jsx)(Be,{value:e,id:t===0?n:void 0,className:`text-1sm capitalize`,children:e},e))})}return n===`number`||n===`int`?(0,$.jsx)(ms,{ctl:t,onCommit:i,...c}):n===`array`?(0,$.jsx)(hs,{ctl:t,onCommit:i,...c}):(0,$.jsx)(ps,{ctl:t,onCommit:i,...c})}function ps({ctl:e,onCommit:t,...n}){"use no memo";return(0,$.jsx)(oi,{...n,value:typeof e.value==`string`?e.value:``,ref:e.ref,onChange:t=>e.onChange(t.target.value),onBlur:()=>{e.onBlur(),t()},onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),t())},className:`h-8 text-sm`})}function ms({ctl:e,onCommit:t,...n}){"use no memo";let[r,i]=(0,Z.useState)(e.value===void 0?``:String(e.value)),a=(0,Z.useRef)(e.value);(0,Z.useEffect)(()=>{a.current!==e.value&&(i(e.value===void 0?``:String(e.value)),a.current=e.value)},[e.value]);let o=()=>{let n=Number(r);if(!Number.isFinite(n)){e.onChange(r),t();return}e.onChange(n),t(),a.current=n};return(0,$.jsx)(oi,{...n,type:`number`,value:r,ref:e.ref,onChange:e=>i(e.target.value),onBlur:()=>{e.onBlur(),o()},onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),o())},className:`h-8 w-28 text-sm tabular-nums`})}function hs({ctl:e,onCommit:t,...n}){"use no memo";let r=Array.isArray(e.value)?e.value.join(`
1
+ import{o as e,t}from"./chunk-CYidjpOJ.js";import{t as n}from"./jsx-runtime-BUgB2tll.js";import{B as r,O as i,Sr as a,at as o,dt as s,gi as c,lt as l,sr as u,st as d,ut as f,z as p}from"./DocumentContext-CmobwhDV.js";import{t as m}from"./react-f2sANaYj.js";import{n as h,r as g}from"./dist-Nvb76hAm.js";import{t as _}from"./useQuery-ZeEDLtxh.js";import{n as v}from"./dist-PQ5KMVDh.js";import{t as y}from"./react-dom-DPxgxlDT.js";import{t as b}from"./compiler-runtime-BfE3aGVn.js";import{t as x}from"./utils-CPqDy6Hr.js";import{n as S,r as C,t as w}from"./AgentIconCluster-BjhMMJvg.js";import{t as T}from"./button-Cym3gapE.js";import{i as E,n as D,r as O,t as k}from"./tooltip-BnyyQDRs.js";import{n as A,r as j,t as M}from"./collapsible-DYySK8La.js";import{a as N,c as P,i as F,n as I,o as L,r as R,s as z,t as B}from"./dialog-DgIQr9zS.js";import{a as V,c as H,i as ee,l as U,n as W,o as G,r as te,s as ne,t as K}from"./alert-dialog-CrZSZ5Zj.js";import{n as q,t as J}from"./with-selector-PRoyWQiu.js";import{t as re}from"./checkbox-Crs_F_Np.js";import{A as ie,C as ae,D as oe,E as se,O as ce,S as le,T as ue,_ as de,b as fe,f as pe,g as me,h as he,j as ge,k as _e,m as ve,p as ye,r as be,v as xe,w as Se,x as Ce,y as we}from"./floating-ui.dom-CDtYEnEj.js";import{c as Te,d as Ee,l as De,o as Oe,s as ke,u as Ae}from"./dist-DYso7MCm.js";import{t as je}from"./label-D-K3fWtj.js";import{i as Me,n as Ne,o as Pe,s as Fe,t as Ie}from"./select-ByJwKu6h.js";import{n as Le,t as Re}from"./radio-group-npdxiS6E.js";import{t as ze}from"./switch-iwBsEWej.js";import{n as Be,r as Ve,t as He}from"./toggle-group-C2_37kV5.js";import{a as Ue,c as We,d as Ge,f as Ke,g as qe,h as Je,i as Ye,l as Xe,s as Ze,t as Qe,u as $e,y as et}from"./RegisteredAgentIcon-wza-YtV5.js";import{a as tt,i as nt,o as rt}from"./terminal-telemetry-BiZK7c9d.js";import{$o as it,Ao as at,Cc as Y,Cn as ot,Cs as st,Dt as ct,Fo as lt,Go as ut,Ho as dt,Ic as ft,Is as pt,Jn as mt,Jo as ht,Ko as gt,Mo as _t,Nc as vt,No as yt,Ns as bt,Oo as xt,Po as St,Qo as Ct,Ro as wt,Sc as Tt,Sn as Et,Ss as Dt,Uo as Ot,Vn as kt,Wc as At,Wo as jt,Zo as Mt,_s as Nt,at as Pt,bc as Ft,bs as It,ci as Lt,cs as Rt,ds as zt,ft as Bt,gs as Vt,hi as Ht,hs as Ut,ii as Wt,js as Gt,ko as Kt,kr as qt,lc as Jt,mc as Yt,ms as Xt,ns as Zt,pc as Qt,pt as $t,qo as en,rs as tn,ts as nn,ua as rn,wc as an,ws as on,xc as sn,xs as cn,zc as ln}from"./dist-868Gd8gd.js";import{t as un}from"./trace-api-BP9dN1Hz.js";import{n as X}from"./dist-CJhtNlOm2.js";import{d as dn,f as fn,h as pn,n as mn,o as hn,p as gn,r as _n,u as vn,v as yn}from"./use-settings-route-Dmjvvjxd.js";import{t as bn}from"./dist-Cr4-nBVI.js";import{c as xn}from"./documents-events-DyVmV0Qo.js";import{a as Sn,i as Cn}from"./local-menu-action-bus-BQUa_HQ5.js";import{a as wn,i as Tn,t as En}from"./use-apply-config-theme-B5w38X1P.js";import{t as Dn}from"./OpenInAgentMenuItem-BOkiSyJj.js";import{t as On}from"./createLucideIcon-B6ULg5PN.js";import{a as kn,c as An,f as jn,g as Mn,l as Nn,m as Pn,p as Fn,s as In,t as Ln}from"./EnableSyncConfirmDialog-3Y8YTBbR.js";import{p as Rn}from"./Mermaid-C8EPNkJP.js";import{t as zn}from"./arrow-up-right-B3B9a7te.js";import{t as Bn}from"./check-BzfGb3KU.js";import{t as Vn}from"./chevron-right-C-g4JuT4.js";import{n as Hn,t as Un}from"./lint-plugin-meta-zA9wHIBR.js";import{n as Wn}from"./upload-DGQJhdiQ.js";import{i as Gn,r as Kn}from"./prop-types-xcUPxUpJ.js";import{a as qn,m as Jn,r as Yn,t as Xn}from"./dropdown-menu-DjQ8GtwR.js";import{A as Zn,B as Qn,C as $n,F as er,G as tr,H as nr,J as rr,K as ir,L as ar,M as or,N as sr,O as cr,P as lr,Q as ur,R as dr,S as fr,U as pr,V as mr,W as hr,Y as gr,at as _r,b as vr,c as yr,d as br,et as xr,f as Sr,h as Cr,i as wr,j as Tr,k as Er,l as Dr,m as Or,n as kr,nt as Ar,o as jr,p as Mr,q as Nr,v as Pr,w as Fr,x as Ir,y as Lr}from"./auth-state-cache-DjjuYX83.js";import{_ as Rr,g as zr,m as Br,p as Vr}from"./SkillInstallMenu-B6dyzecr.js";import{It as Hr}from"./CodeMirrorPropInput-BfFHUIPT.js";import{o as Ur}from"./folder-config-api-CL7I86xK.js";import{t as Wr}from"./info-CilGMBpP.js";import{t as Gr}from"./spinner-Bp2_BYkl.js";import{n as Kr,r as qr,t as Jr}from"./ThemePicker-wGe4WU58.js";import{t as Yr}from"./rotate-ccw-B05K_aam.js";import{t as Xr}from"./square-pen-BhqhPrdL.js";import{t as Zr}from"./terminal-DGmaW797.js";import{t as Qr}from"./trash-2-B9Flu-41.js";import{t as $r}from"./triangle-alert-CCeXtPLU.js";import{t as ei}from"./x-DIayTyoR.js";import{d as ti}from"./doc-paths-ZgPMU9hv.js";import{a as ni}from"./startup-marks-C-4hCO0g.js";import{n as ri}from"./config-provider-CMsrN7B5.js";import{a as ii}from"./skill-scope-BUi8busH.js";import{m as ai}from"./skills-api-Cx2rJHH9.js";import{t as oi}from"./input-BJqFvbJL.js";import{a as si,i as ci,t as li}from"./popover-CfUn4Hx9.js";import{_ as ui,a as di,d as fi,f as pi,g as mi,h as hi,m as gi,p as _i,u as vi,v as yi,y as bi}from"./css-color-to-hex-SSX32gXw.js";import{n as xi}from"./use-apply-config-language-DmbZDqgv.js";import{t as Si}from"./external-link-B7FVOsOS.js";import{t as Ci}from"./badge-Ct5y0ScC.js";import{t as wi}from"./tool-list-format-CAqZbZya.js";import{i as Ti,o as Ei,r as Di,t as Oi}from"./field-CuGdn_wl.js";import{t as ki}from"./ConfigSharingInfoTooltip-FQm0hA62.js";import{t as Ai}from"./use-skills-CpkfrpBl.js";import{o as ji,s as Mi,t as Ni}from"./use-open-skill-DpbstiSZ.js";import{n as Pi}from"./terminal-cli-display-OF8nDzxb.js";import{t as Fi}from"./skeleton-DMzJWQXU.js";import{d as Ii,n as Li,r as Ri,t as zi,u as Bi}from"./lint-config-client-DkLK3D4G.js";import{_ as Vi,a as Hi,d as Ui,f as Wi,g as Gi,h as Ki,i as qi,o as Ji,s as Yi,t as Xi,u as Zi}from"./sortable.esm-CYI6PMLc.js";import{t as Qi}from"./textarea-CGEv5cav.js";import{n as $i,r as ea,t as ta}from"./input-group-BQk3VlAG.js";import{a as na,f as ra,i as ia,n as aa,o as oa,p as sa,r as ca,s as la,t as ua}from"./form-rIUGRVwK.js";import{r as da,t as fa}from"./terminal-command-events-DQbD5--h.js";import{t as pa}from"./tag-pill-input-nlqSiq7s.js";import{t as ma}from"./markdownlint-rule-browser-D9Z_1KbZ.js";import{n as ha}from"./schema-fields-view-intent-DUTDX7_n.js";import{n as ga,t as _a}from"./use-terminal-enabled-3W1PH2lM.js";import{_ as va,a as ya,c as ba,d as xa,f as Sa,g as Ca,h as wa,i as Ta,l as Ea,m as Da,n as Oa,o as ka,p as Aa,r as ja,s as Ma,t as Na,u as Pa,v as Fa}from"./agent-connection-status-GVtpWcVR.js";var Ia=On(`folder-tree`,[[`path`,{d:`M20 10a1 1 0 0 0 1-1V6a1 1 0 0 0-1-1h-2.5a1 1 0 0 1-.8-.4l-.9-1.2A1 1 0 0 0 15 3h-2a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z`,key:`hod4my`}],[`path`,{d:`M20 21a1 1 0 0 0 1-1v-3a1 1 0 0 0-1-1h-2.9a1 1 0 0 1-.88-.55l-.42-.85a1 1 0 0 0-.92-.6H13a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z`,key:`w4yl2u`}],[`path`,{d:`M3 5a2 2 0 0 0 2 2h3`,key:`f2jnh7`}],[`path`,{d:`M3 3v13a2 2 0 0 0 2 2h3`,key:`k8epm1`}]]),La=On(`power`,[[`path`,{d:`M12 2v10`,key:`mnfbl`}],[`path`,{d:`M18.4 6.6a9 9 0 1 1-12.77.04`,key:`obofu9`}]]),Ra=On(`unlink`,[[`path`,{d:`m18.84 12.25 1.72-1.71h-.02a5.004 5.004 0 0 0-.12-7.07 5.006 5.006 0 0 0-6.95 0l-1.72 1.71`,key:`yqzxt4`}],[`path`,{d:`m5.17 11.75-1.71 1.71a5.004 5.004 0 0 0 .12 7.07 5.006 5.006 0 0 0 6.95 0l1.71-1.71`,key:`4qinb0`}],[`line`,{x1:`8`,x2:`8`,y1:`2`,y2:`5`,key:`1041cp`}],[`line`,{x1:`2`,x2:`5`,y1:`8`,y2:`8`,key:`14m1p5`}],[`line`,{x1:`16`,x2:`16`,y1:`19`,y2:`22`,key:`rzdirn`}],[`line`,{x1:`19`,x2:`22`,y1:`16`,y2:`16`,key:`ox905f`}]]),za=On(`wifi-off`,[[`path`,{d:`M12 20h.01`,key:`zekei9`}],[`path`,{d:`M8.5 16.429a5 5 0 0 1 7 0`,key:`1bycff`}],[`path`,{d:`M5 12.859a10 10 0 0 1 5.17-2.69`,key:`1dl1wf`}],[`path`,{d:`M19 12.859a10 10 0 0 0-2.007-1.523`,key:`4k23kn`}],[`path`,{d:`M2 8.82a15 15 0 0 1 4.177-2.643`,key:`1grhjp`}],[`path`,{d:`M22 8.82a15 15 0 0 0-11.288-3.764`,key:`z3jwby`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]),Z=e(m(),1),Q=b(),$=n();function Ba(){let e=(0,Q.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,$.jsx)(Ci,{variant:`gray`,children:(0,$.jsx)(h,{id:`YBt9YP`})}),e[0]=t):t=e[0],t}function Va(e){let t=(0,Q.c)(10),{scope:n}=e,r=`settings-scope-badge-${n}`,i;t[0]===n?i=t[1]:(i=n===`user`?(0,$.jsx)(h,{id:`7PzzBU`}):n===`project-local`?(0,$.jsx)(h,{id:`ImTzPZ`}):(0,$.jsx)(h,{id:`e0NrBM`}),t[0]=n,t[1]=i);let a;t[2]!==r||t[3]!==i?(a=(0,$.jsx)(E,{asChild:!0,children:(0,$.jsx)(Ci,{variant:`gray`,tabIndex:0,className:`focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring`,"data-testid":r,children:i})}),t[2]=r,t[3]=i,t[4]=a):a=t[4];let o;t[5]===n?o=t[6]:(o=(0,$.jsx)(D,{children:n===`user`?(0,$.jsx)(h,{id:`cFSbbh`}):n===`project-local`?(0,$.jsx)(h,{id:`YlwI5F`}):(0,$.jsx)(h,{id:`ebqMh6`})}),t[5]=n,t[6]=o);let s;return t[7]!==a||t[8]!==o?(s=(0,$.jsx)(O,{children:(0,$.jsxs)(k,{children:[a,o]})}),t[7]=a,t[8]=o,t[9]=s):s=t[9],s}function Ha(e){let t=(0,Q.c)(27),{titleId:n,title:r,scope:i,level:a,beta:o,adornment:s,docUrl:c,children:l}=e,u=a===void 0?`page`:a,{_:d}=g(),f=u===`page`?`h3`:`h4`,p=u===`page`?`text-lg`:`text-base`,m;t[0]===p?m=t[1]:(m=x(`font-semibold`,p),t[0]=p,t[1]=m);let _;t[2]!==f||t[3]!==m||t[4]!==r||t[5]!==n?(_=(0,$.jsx)(f,{id:n,className:m,children:r}),t[2]=f,t[3]=m,t[4]=r,t[5]=n,t[6]=_):_=t[6];let v;t[7]===o?v=t[8]:(v=o?(0,$.jsx)(Ba,{}):null,t[7]=o,t[8]=v);let y;t[9]===i?y=t[10]:(y=i?(0,$.jsx)(Va,{scope:i}):null,t[9]=i,t[10]=y);let b;t[11]!==s||t[12]!==_||t[13]!==v||t[14]!==y?(b=(0,$.jsxs)(`div`,{className:`flex items-center gap-2`,children:[_,s,v,y]}),t[11]=s,t[12]=_,t[13]=v,t[14]=y,t[15]=b):b=t[15];let S;t[16]===l?S=t[17]:(S=l?(0,$.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:l}):null,t[16]=l,t[17]=S);let C;t[18]!==d||t[19]!==c||t[20]!==r||t[21]!==n?(C=c===void 0?null:(0,$.jsxs)(`a`,{href:c,target:`_blank`,rel:`noopener noreferrer`,onClick:e=>Si(e,c),onAuxClick:e=>Si(e,c),"aria-label":d(typeof r==`string`?{id:`Li4U-T`,values:{title:r}}:{id:`zwWKhA`}),className:`inline-flex items-center gap-0.5 text-sm text-muted-foreground underline-offset-2 hover:text-foreground hover:underline`,"data-testid":`${n}-docs-link`,children:[(0,$.jsx)(h,{id:`zwWKhA`}),(0,$.jsx)(zn,{"aria-hidden":!0,className:`size-3`})]}),t[18]=d,t[19]=c,t[20]=r,t[21]=n,t[22]=C):C=t[22];let w;return t[23]!==b||t[24]!==S||t[25]!==C?(w=(0,$.jsxs)(`div`,{className:`space-y-1`,children:[b,S,C]}),t[23]=b,t[24]=S,t[25]=C,t[26]=w):w=t[26],w}var Ua=`settings-sharing-title`;function Wa(){let e=(0,Q.c)(1),t=(typeof window<`u`?window.okDesktop:void 0)?.sharing,n;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(n=t===void 0?(0,$.jsx)(Ga,{}):(0,$.jsx)(Ka,{}),e[0]=n):n=e[0],n}function Ga(){let e=(0,Q.c)(2),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,$.jsx)(h,{id:`cs4mps`}),e[0]=t):t=e[0];let n;return e[1]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,$.jsx)(`section`,{"aria-labelledby":Ua,className:`space-y-3`,"data-field":`section:sharing`,children:(0,$.jsx)(Ha,{titleId:Ua,title:t,scope:`project`,level:`block`,children:(0,$.jsx)(h,{id:`7YRrJ9`,components:{0:(0,$.jsx)(`code`,{}),1:(0,$.jsx)(`code`,{}),2:(0,$.jsx)(`code`,{})}})})}),e[1]=n):n=e[1],n}function Ka(){let e=(0,Q.c)(29),{_:t}=g(),[n,r]=(0,Z.useState)(null),[i,a]=(0,Z.useState)(!1),[o,s]=(0,Z.useState)(null),c;e[0]===t?c=e[1]:(c=async function(){let e=window.okDesktop?.sharing;if(e)try{r(await e.status())}catch(e){let n=e;X.error(n instanceof Error?n.message:t({id:`K0N7zS`})),r(Ja)}},e[0]=t,e[1]=c);let l=c,u;e[2]===l?u=e[3]:(u=()=>{l()},e[2]=l,e[3]=u);let d;e[4]===Symbol.for(`react.memo_cache_sentinel`)?(d=[],e[4]=d):d=e[4],(0,Z.useEffect)(u,d);let f;e[5]!==t||e[6]!==i||e[7]!==l||e[8]!==n?(f=async function(e){let r=window.okDesktop?.sharing;if(!r||n===null||i||n.mode===e)return;a(!0),s(null);let o=null,c=null;try{o=await r.setMode(e)}catch(e){c=e}if(a(!1),c!==null){X.error(c instanceof Error?c.message:t({id:`qZv5ZR`}));return}o!==null&&(o.kind===`refused-tracked`?(s({tracked:o.tracked,remediation:o.remediation}),X.error(t({id:`z2JdQ-`}),{duration:5e3})):o.kind===`no-exclude`?X.warning(o.reason===`no-git`?t({id:`YSFv5w`}):t({id:`8cS0nH`,values:{0:o.reason}})):X.success(t(e===`local-only`?{id:`wdzBgi`}:{id:`k_pade`})),await l())},e[5]=t,e[6]=i,e[7]=l,e[8]=n,e[9]=f):f=e[9];let p=f;if(n===null){let t;e[10]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,$.jsx)(Ha,{titleId:Ua,title:(0,$.jsx)(h,{id:`cs4mps`}),scope:`project`,level:`block`}),e[10]=t):t=e[10];let n;return e[11]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,$.jsxs)(`section`,{"aria-labelledby":Ua,className:`space-y-3`,"data-field":`section:sharing`,children:[t,(0,$.jsxs)(`div`,{role:`status`,"aria-live":`polite`,"aria-busy":`true`,children:[(0,$.jsx)(`span`,{className:`sr-only`,children:(0,$.jsx)(h,{id:`eQn7nI`})}),(0,$.jsx)(Fi,{className:`h-24`})]})]}),e[11]=n):n=e[11],n}let m=n.mode===`no-git`,_;e[12]===Symbol.for(`react.memo_cache_sentinel`)?(_=(0,$.jsx)(h,{id:`cs4mps`}),e[12]=_):_=e[12];let v;e[13]===Symbol.for(`react.memo_cache_sentinel`)?(v=(0,$.jsx)(Ha,{titleId:Ua,title:_,scope:`project`,level:`block`,adornment:(0,$.jsx)(ki,{}),children:(0,$.jsx)(h,{id:`N55YNr`})}),e[13]=v):v=e[13];let y;e[14]!==i||e[15]!==m||e[16]!==p||e[17]!==n.mode?(y=m?(0,$.jsx)(`p`,{className:`rounded-md border border-amber-300 bg-amber-50 px-3 py-2 text-sm text-amber-900 dark:border-amber-700 dark:bg-amber-950 dark:text-amber-200`,role:`status`,"data-testid":`settings-sharing-no-git`,children:(0,$.jsx)(h,{id:`ju38ms`})}):(0,$.jsxs)(Re,{value:n.mode,onValueChange:e=>void p(e),disabled:i,className:`gap-2`,"aria-labelledby":Ua,"data-testid":`settings-sharing-radiogroup`,children:[(0,$.jsxs)(`label`,{htmlFor:`settings-sharing-local-only`,className:`flex items-start gap-2 text-sm`,children:[(0,$.jsx)(Le,{id:`settings-sharing-local-only`,value:`local-only`,"data-testid":`settings-sharing-local-only`,className:`mt-1`}),(0,$.jsxs)(`span`,{children:[(0,$.jsx)(`span`,{className:`font-medium`,children:(0,$.jsx)(h,{id:`QjzFZj`})}),(0,$.jsx)(`span`,{className:`block text-1sm text-muted-foreground`,children:(0,$.jsx)(h,{id:`un-K1H`})})]})]}),(0,$.jsxs)(`label`,{htmlFor:`settings-sharing-shared`,className:`flex items-start gap-2 text-sm`,children:[(0,$.jsx)(Le,{id:`settings-sharing-shared`,value:`shared`,"data-testid":`settings-sharing-shared`,className:`mt-1`}),(0,$.jsxs)(`span`,{children:[(0,$.jsx)(`span`,{className:`font-medium`,children:(0,$.jsx)(h,{id:`0Gd0NU`})}),(0,$.jsx)(`span`,{className:`block text-1sm text-muted-foreground`,children:(0,$.jsx)(h,{id:`dJw2_7`})})]})]})]}),e[14]=i,e[15]=m,e[16]=p,e[17]=n.mode,e[18]=y):y=e[18];let b;e[19]===o?b=e[20]:(b=o===null?null:(0,$.jsxs)(`div`,{className:`space-y-2 rounded-md border border-destructive bg-destructive/10 p-3 text-sm`,role:`alert`,"data-testid":`settings-sharing-refusal`,children:[(0,$.jsx)(`p`,{className:`font-semibold`,children:(0,$.jsx)(h,{id:`ZscwQ0`})}),(0,$.jsx)(`pre`,{className:`whitespace-pre-wrap font-mono text-xs leading-relaxed`,children:o.remediation}),(0,$.jsx)(T,{variant:`outline`,size:`sm`,onClick:()=>s(null),children:(0,$.jsx)(h,{id:`1QfxQT`})})]}),e[19]=o,e[20]=b);let x;e[21]!==o||e[22]!==n.mode||e[23]!==n.trackedUpstream?(x=n.trackedUpstream.length>0&&n.mode!==`no-git`&&o===null?(0,$.jsxs)(`div`,{className:`space-y-1 rounded-md border border-muted-foreground/30 bg-muted/40 p-3 text-sm`,"data-testid":`settings-sharing-tracked-info`,children:[(0,$.jsx)(`p`,{className:`font-medium`,children:(0,$.jsx)(h,{id:`LhWYpm`})}),(0,$.jsx)(`ul`,{className:`list-disc pl-5 font-mono text-xs text-muted-foreground`,children:n.trackedUpstream.map(qa)}),(0,$.jsx)(`p`,{className:`text-1sm text-muted-foreground`,children:(0,$.jsx)(h,{id:`1XSMhZ`,components:{0:(0,$.jsx)(`code`,{}),1:(0,$.jsx)(`code`,{})}})})]}):null,e[21]=o,e[22]=n.mode,e[23]=n.trackedUpstream,e[24]=x):x=e[24];let S;return e[25]!==y||e[26]!==b||e[27]!==x?(S=(0,$.jsxs)(`section`,{"aria-labelledby":Ua,className:`space-y-4`,"data-testid":`settings-sharing`,"data-field":`section:sharing`,children:[v,y,b,x]}),e[25]=y,e[26]=b,e[27]=x,e[28]=S):S=e[28],S}function qa(e){return(0,$.jsx)(`li`,{children:e},e)}function Ja(e){return e??{kind:`status`,mode:`no-git`,excluded:[],trackedUpstream:[]}}function Ya(e){let t=(0,Q.c)(35),{authQueryTransport:n,authTransport:r}=e,{_:i}=g(),a;t[0]===n?a=t[1]:(a=n??ur(),t[0]=n,t[1]=a);let o=a,s;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(s={phase:`loading`},t[2]=s):s=t[2];let[c,l]=(0,Z.useState)(s),[u,d]=(0,Z.useState)(!1),[f,p]=(0,Z.useState)(!1),[m,_]=(0,Z.useState)(null),v=(0,Z.useRef)(!1),y;t[3]===o?y=t[4]:(y=async function(){l({phase:`loading`});try{let e=await o.status();l({phase:`loaded`,result:e}),kr(e.authenticated)}catch(e){console.warn(`[AccountSection] GitHub status check failed`,e),l({phase:`check-failed`})}},t[3]=o,t[4]=y);let b=y,x;t[5]===b?x=t[6]:(x=()=>{b()},t[5]=b,t[6]=x);let S;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(S=[],t[7]=S):S=t[7],(0,Z.useEffect)(x,S);let C;t[8]!==i||t[9]!==b||t[10]!==o?(C=async function(){if(v.current)return;v.current=!0,d(!1),p(!0),_(null);let e=null;try{let t=o.signout?await o.signout():{ok:!1,error:i({id:`8cpOa8`})};t.ok||(e=t.error??i({id:`8cpOa8`}))}catch(t){console.warn(`[AccountSection] GitHub disconnect failed`,t),e=i({id:`8cpOa8`})}await b(),e&&_(e),p(!1),v.current=!1},t[8]=i,t[9]=b,t[10]=o,t[11]=C):C=t[11];let w=C,E;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(E=(0,$.jsx)(h,{id:`AeXO77`}),t[12]=E):E=t[12];let D;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(D=(0,$.jsx)(Ha,{titleId:`settings-account-title`,title:E,scope:`user`,children:(0,$.jsx)(h,{id:`E6lrpp`})}),t[13]=D):D=t[13];let O;t[14]!==m||t[15]!==f||t[16]!==w||t[17]!==b||t[18]!==c.phase||t[19]!==c.result?(O=c.phase===`loading`?(0,$.jsxs)(`div`,{role:`status`,"aria-live":`polite`,"aria-busy":`true`,className:`space-y-2 rounded-md border p-3`,"data-testid":`settings-account-loading`,children:[(0,$.jsx)(`span`,{className:`sr-only`,children:(0,$.jsx)(h,{id:`IWGfGF`})}),(0,$.jsx)(Fi,{className:`h-4 w-40`}),(0,$.jsx)(Fi,{className:`h-8 w-32`})]}):c.phase===`check-failed`?(0,$.jsxs)(`div`,{className:`space-y-2 rounded-md border p-3`,"data-testid":`settings-account-check-failed`,children:[(0,$.jsx)(`p`,{role:`status`,className:`text-sm text-muted-foreground`,children:(0,$.jsx)(h,{id:`T_wG4n`})}),(0,$.jsx)(T,{variant:`outline`,size:`sm`,onClick:()=>void b(),children:(0,$.jsx)(h,{id:`KDw4GX`})})]}):c.result.authenticated?c.result.tier===`A`?(0,$.jsx)(Za,{login:c.result.login}):(0,$.jsx)(Xa,{login:c.result.login,disconnecting:f,error:m,onDisconnect:()=>void w()}):(0,$.jsx)(Qa,{onConnect:()=>d(!0)}),t[14]=m,t[15]=f,t[16]=w,t[17]=b,t[18]=c.phase,t[19]=c.result,t[20]=O):O=t[20];let k;t[21]===b?k=t[22]:(k=e=>{d(e),e||b()},t[21]=b,t[22]=k);let A=c.phase===`loaded`?c.result.host:void 0,j=c.phase===`loaded`?c.result.ghAvailable:void 0,M;t[23]===b?M=t[24]:(M=()=>{b()},t[23]=b,t[24]=M);let N;t[25]!==u||t[26]!==r||t[27]!==k||t[28]!==A||t[29]!==j||t[30]!==M?(N=(0,$.jsx)(gr,{open:u,onOpenChange:k,transport:r,host:A,ghAvailable:j,onSuccess:M}),t[25]=u,t[26]=r,t[27]=k,t[28]=A,t[29]=j,t[30]=M,t[31]=N):N=t[31];let P;return t[32]!==N||t[33]!==O?(P=(0,$.jsxs)(`section`,{"aria-labelledby":`settings-account-title`,className:`space-y-3`,"data-testid":`settings-account`,children:[D,O,N]}),t[32]=N,t[33]=O,t[34]=P):P=t[34],P}function Xa(e){let t=(0,Q.c)(20),{login:n,disconnecting:r,error:i,onDisconnect:a}=e,o;t[0]===n?o=t[1]:(o=(0,$.jsx)(`div`,{className:`text-sm font-medium`,children:(0,$.jsx)(h,{id:`E_tNGD`,values:{login:n}})}),t[0]=n,t[1]=o);let s;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,$.jsx)(`p`,{className:`text-muted-foreground text-1sm`,children:(0,$.jsx)(h,{id:`nxlOpL`})}),t[2]=s):s=t[2];let c;t[3]===o?c=t[4]:(c=(0,$.jsxs)(`div`,{className:`min-w-0`,children:[o,s]}),t[3]=o,t[4]=c);let l;t[5]===r?l=t[6]:(l=r?(0,$.jsx)(h,{id:`rppgXF`}):(0,$.jsx)(h,{id:`-K0AvT`}),t[5]=r,t[6]=l);let u;t[7]!==r||t[8]!==a||t[9]!==l?(u=(0,$.jsx)(T,{variant:`outline`,onClick:a,disabled:r,"aria-describedby":`settings-account-disconnect-caveat`,"data-testid":`settings-account-disconnect`,children:l}),t[7]=r,t[8]=a,t[9]=l,t[10]=u):u=t[10];let d;t[11]!==c||t[12]!==u?(d=(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[c,u]}),t[11]=c,t[12]=u,t[13]=d):d=t[13];let f;t[14]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,$.jsx)(`p`,{id:`settings-account-disconnect-caveat`,className:`text-muted-foreground text-1sm`,"data-testid":`settings-account-disconnect-caveat`,children:(0,$.jsx)(h,{id:`msOK6I`})}),t[14]=f):f=t[14];let p;t[15]===i?p=t[16]:(p=i?(0,$.jsx)(`p`,{role:`alert`,className:`text-sm text-destructive`,"data-testid":`settings-account-disconnect-error`,children:i}):null,t[15]=i,t[16]=p);let m;return t[17]!==d||t[18]!==p?(m=(0,$.jsxs)(`div`,{className:`space-y-2 rounded-md border p-3`,"data-testid":`settings-account-connected`,children:[d,f,p]}),t[17]=d,t[18]=p,t[19]=m):m=t[19],m}function Za(e){let t=(0,Q.c)(5),{login:n}=e,r;t[0]===n?r=t[1]:(r=(0,$.jsx)(`div`,{className:`text-sm font-medium`,children:(0,$.jsx)(h,{id:`E_tNGD`,values:{login:n}})}),t[0]=n,t[1]=r);let i;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,$.jsx)(`p`,{className:`text-muted-foreground text-1sm`,children:(0,$.jsx)(h,{id:`ny6vNn`})}),t[2]=i):i=t[2];let a;return t[3]===r?a=t[4]:(a=(0,$.jsx)(`div`,{className:`rounded-md border p-3`,"data-testid":`settings-account-gh-cli`,children:(0,$.jsxs)(`div`,{className:`min-w-0 space-y-1`,children:[r,i]})}),t[3]=r,t[4]=a),a}function Qa(e){let t=(0,Q.c)(5),{onConnect:n}=e,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,$.jsx)(`div`,{className:`text-sm font-medium`,children:(0,$.jsx)(h,{id:`S33tz3`})}),t[0]=r):r=t[0];let i;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,$.jsxs)(`div`,{className:`min-w-0`,children:[r,(0,$.jsx)(`p`,{className:`text-muted-foreground text-1sm`,children:(0,$.jsx)(h,{id:`EJuO7B`})})]}),t[1]=i):i=t[1];let a;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,$.jsx)(h,{id:`5lWFkC`}),t[2]=a):a=t[2];let o;return t[3]===n?o=t[4]:(o=(0,$.jsx)(`div`,{className:`rounded-md border p-3`,"data-testid":`settings-account-disconnected`,children:(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[i,(0,$.jsx)(T,{onClick:n,"data-testid":`settings-account-connect`,children:a})]})}),t[3]=n,t[4]=o),o}function $a(e){if(e===void 0)return null;let t=e.params?.agent;if(typeof t!=`string`)return null;let n=At[t]??t;return e.id===`followup.enable-manually`?bn._({id:`followup.enable-manually`,values:{agent:n}}):null}function eo(e){let{enabled:t,installedCount:n,presence:r,configurable:i,setupDocSlug:a,installUrl:o}=e,s=n>0,c=r===`absent`,l=()=>a===null?{kind:`none`}:{kind:`setup-doc`,slug:a};return c?o==null||o===``?l():{kind:`install`,url:o}:i?t?s?{kind:`manage`}:{kind:`connect`}:s?{kind:`remove`}:{kind:`none`}:s?{kind:`remove`}:l()}function to(e){return e.presence===`absent`&&e.installedCount>0}function no(e){let t=(0,Q.c)(32),{icon:n,name:r,hint:i,status:a,action:o,checked:s,disabled:c,ariaLabel:l,testId:u,rowTestId:d,statusId:f,onToggle:p}=e,m=i?`${d}-hint`:void 0,h;t[0]===n?h=t[1]:(h=(0,$.jsx)(`span`,{className:`flex h-5 shrink-0 items-center`,children:n}),t[0]=n,t[1]=h);let g;t[2]===r?g=t[3]:(g=(0,$.jsx)(`span`,{className:`truncate text-sm leading-5`,children:r}),t[2]=r,t[3]=g);let _;t[4]!==i||t[5]!==m?(_=i?(0,$.jsxs)(`span`,{className:`flex min-w-0 items-center gap-1.5`,children:[(0,$.jsx)(`span`,{id:m,className:`truncate text-muted-foreground text-1sm`,children:i.text}),i.action]}):null,t[4]=i,t[5]=m,t[6]=_):_=t[6];let v;t[7]!==a||t[8]!==f?(v=a?(0,$.jsx)(`span`,{id:f,children:a}):null,t[7]=a,t[8]=f,t[9]=v):v=t[9];let y;t[10]!==g||t[11]!==_||t[12]!==v?(y=(0,$.jsxs)(`div`,{className:`flex min-w-0 flex-col`,children:[g,_,v]}),t[10]=g,t[11]=_,t[12]=v,t[13]=y):y=t[13];let b;t[14]!==h||t[15]!==y?(b=(0,$.jsxs)(`div`,{className:`flex min-w-0 items-start gap-2.5`,children:[h,y]}),t[14]=h,t[15]=y,t[16]=b):b=t[16];let x;t[17]!==l||t[18]!==s||t[19]!==c||t[20]!==m||t[21]!==p||t[22]!==f||t[23]!==u?(x=p===void 0?null:(0,$.jsx)(ze,{checked:s??!1,disabled:c,onCheckedChange:p,"aria-label":l,"aria-describedby":[m,f].filter(Boolean).join(` `)||void 0,"data-testid":u}),t[17]=l,t[18]=s,t[19]=c,t[20]=m,t[21]=p,t[22]=f,t[23]=u,t[24]=x):x=t[24];let S;t[25]!==o||t[26]!==x?(S=(0,$.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2`,children:[o,x]}),t[25]=o,t[26]=x,t[27]=S):S=t[27];let C;return t[28]!==d||t[29]!==b||t[30]!==S?(C=(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-3 px-3 py-2.5`,"data-testid":d,children:[b,S]}),t[28]=d,t[29]=b,t[30]=S,t[31]=C):C=t[31],C}function ro(e,t){return e===`absent`&&!t}function io(e){let t=(0,Q.c)(15),{label:n,labelIcon:r,subtitle:i,children:a,labelId:o}=e,s;t[0]!==n||t[1]!==r||t[2]!==o?(s=(0,$.jsxs)(`h4`,{id:o,tabIndex:-1,className:`flex items-center gap-1.5 font-mono text-muted-foreground text-xs uppercase tracking-wide`,children:[n,r]}),t[0]=n,t[1]=r,t[2]=o,t[3]=s):s=t[3];let c;t[4]===i?c=t[5]:(c=i?(0,$.jsx)(`p`,{className:`mt-1 text-muted-foreground text-xs`,children:i}):null,t[4]=i,t[5]=c);let l;t[6]!==s||t[7]!==c?(l=(0,$.jsxs)(`div`,{className:`mb-2`,children:[s,c]}),t[6]=s,t[7]=c,t[8]=l):l=t[8];let u;t[9]===a?u=t[10]:(u=(0,$.jsx)(`div`,{className:`divide-y overflow-hidden rounded-md border`,children:a}),t[9]=a,t[10]=u);let d;return t[11]!==o||t[12]!==l||t[13]!==u?(d=(0,$.jsxs)(`section`,{"aria-labelledby":o,children:[l,u]}),t[11]=o,t[12]=l,t[13]=u,t[14]=d):d=t[14],d}function ao(e){if(e)return()=>{e.ownerDocument.activeElement===e&&va(e)?.focus()}}function oo(e){let t=(0,Q.c)(9),{hiddenCount:n,expanded:r,onToggle:i,testId:a}=e,{_:o}=g();if(n<=0)return null;let s;t[0]!==o||t[1]!==r||t[2]!==n?(s=o(r?{id:`6lGV3K`}:{id:`INN7OX`,values:{hiddenCount:n}}),t[0]=o,t[1]=r,t[2]=n,t[3]=s):s=t[3];let c;return t[4]!==r||t[5]!==i||t[6]!==s||t[7]!==a?(c=(0,$.jsx)(T,{ref:ao,type:`button`,variant:`ghost`,onClick:i,"aria-expanded":r,className:`w-full justify-center rounded-none font-normal text-1sm text-muted-foreground`,"data-testid":a,children:s}),t[4]=r,t[5]=i,t[6]=s,t[7]=a,t[8]=c):c=t[8],c}function so(e){let t=(0,Q.c)(10),{status:n,enabled:r}=e,{_:i}=g();if(n===`connected`){let e;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(Bn,{"aria-hidden":!0,className:`size-3.5`}),t[0]=e):e=t[0];let n;t[1]===i?n=t[2]:(n=i({id:`QHcLEN`}),t[1]=i,t[2]=n);let r;return t[3]===n?r=t[4]:(r=(0,$.jsxs)(`span`,{className:`mt-0.5 inline-flex items-center gap-1 text-muted-foreground text-xs`,children:[e,n]}),t[3]=n,t[4]=r),r}if(n===`not-connected`&&r){let e;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)($r,{"aria-hidden":!0,className:`size-3.5`}),t[5]=e):e=t[5];let n;t[6]===i?n=t[7]:(n=i({id:`S33tz3`}),t[6]=i,t[7]=n);let r;return t[8]===n?r=t[9]:(r=(0,$.jsxs)(`span`,{className:`mt-0.5 inline-flex items-center gap-1 text-amber-700 text-xs dark:text-amber-400`,children:[e,n]}),t[8]=n,t[9]=r),r}return null}function co(e){let t=(0,Q.c)(52),{action:n,rowLabel:r,describedById:i,onConfigure:a,onRemove:o}=e,{_:s}=g();switch(n.kind){case`none`:return null;case`install`:{let e=n.url,a;t[0]!==s||t[1]!==r?(a=s({id:`wfZwqe`,values:{rowLabel:r}}),t[0]=s,t[1]=r,t[2]=a):a=t[2];let o;t[3]===s?o=t[4]:(o=s({id:`TKQ7K-`}),t[3]=s,t[4]=o);let c;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,$.jsx)(zn,{"aria-hidden":!0}),t[5]=c):c=t[5];let l;return t[6]!==n.url||t[7]!==i||t[8]!==a||t[9]!==o?(l=(0,$.jsx)(T,{variant:`link`,size:`sm`,className:`shrink-0 text-muted-foreground hover:text-foreground`,asChild:!0,children:(0,$.jsxs)(`a`,{href:e,target:`_blank`,rel:`noreferrer`,"aria-label":a,"aria-describedby":i,children:[o,c]})}),t[6]=n.url,t[7]=i,t[8]=a,t[9]=o,t[10]=l):l=t[10],l}case`setup-doc`:{let e=`https://openknowledge.ai/docs/integrations/${n.slug}`,a;t[11]!==s||t[12]!==r?(a=s({id:`Kuw5NN`,values:{rowLabel:r}}),t[11]=s,t[12]=r,t[13]=a):a=t[13];let o;t[14]===s?o=t[15]:(o=s({id:`P_bX4O`}),t[14]=s,t[15]=o);let c;t[16]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,$.jsx)(zn,{"aria-hidden":!0}),t[16]=c):c=t[16];let l;return t[17]!==i||t[18]!==e||t[19]!==a||t[20]!==o?(l=(0,$.jsx)(T,{variant:`link`,size:`sm`,className:`shrink-0 text-muted-foreground hover:text-foreground`,asChild:!0,children:(0,$.jsxs)(`a`,{href:e,target:`_blank`,rel:`noreferrer`,"aria-label":a,"aria-describedby":i,children:[o,c]})}),t[17]=i,t[18]=e,t[19]=a,t[20]=o,t[21]=l):l=t[21],l}case`connect`:{let e;t[22]!==s||t[23]!==r?(e=s({id:`_uxBz5`,values:{rowLabel:r}}),t[22]=s,t[23]=r,t[24]=e):e=t[24];let n;t[25]===s?n=t[26]:(n=s({id:`q63KUv`}),t[25]=s,t[26]=n);let o;return t[27]!==i||t[28]!==a||t[29]!==e||t[30]!==n?(o=(0,$.jsx)(T,{size:`sm`,className:`shrink-0 font-mono uppercase`,onClick:a,"aria-label":e,"aria-describedby":i,children:n}),t[27]=i,t[28]=a,t[29]=e,t[30]=n,t[31]=o):o=t[31],o}case`manage`:{let e;t[32]!==s||t[33]!==r?(e=s({id:`wSBXaS`,values:{rowLabel:r}}),t[32]=s,t[33]=r,t[34]=e):e=t[34];let n;t[35]===s?n=t[36]:(n=s({id:`wckWOP`}),t[35]=s,t[36]=n);let o;return t[37]!==i||t[38]!==a||t[39]!==e||t[40]!==n?(o=(0,$.jsx)(T,{variant:`outline`,size:`sm`,className:`shrink-0 font-mono uppercase`,onClick:a,"aria-label":e,"aria-describedby":i,children:n}),t[37]=i,t[38]=a,t[39]=e,t[40]=n,t[41]=o):o=t[41],o}case`remove`:{let e;t[42]!==s||t[43]!==r?(e=s({id:`vRlzx-`,values:{rowLabel:r}}),t[42]=s,t[43]=r,t[44]=e):e=t[44];let n;t[45]===s?n=t[46]:(n=s({id:`t_YqKh`}),t[45]=s,t[46]=n);let a;return t[47]!==i||t[48]!==o||t[49]!==e||t[50]!==n?(a=(0,$.jsx)(T,{variant:`outline`,size:`sm`,className:`shrink-0 font-mono uppercase`,onClick:o,"aria-label":e,"aria-describedby":i,children:n}),t[47]=i,t[48]=o,t[49]=e,t[50]=n,t[51]=a):a=t[51],a}}}function lo(e){let t=(0,Q.c)(9),{rowLabel:n,onRemove:r}=e,{_:i}=g(),a;t[0]!==i||t[1]!==n?(a=i({id:`vRlzx-`,values:{rowLabel:n}}),t[0]=i,t[1]=n,t[2]=a):a=t[2];let o;t[3]===i?o=t[4]:(o=i({id:`t_YqKh`}),t[3]=i,t[4]=o);let s;return t[5]!==r||t[6]!==a||t[7]!==o?(s=(0,$.jsx)(T,{type:`button`,variant:`link-muted`,className:`h-auto p-0 text-1sm underline underline-offset-4 hover:text-destructive`,onClick:r,"aria-label":a,children:o}),t[5]=r,t[6]=a,t[7]=o,t[8]=s):s=t[8],s}function uo(e){return e===void 0?null:Qt[e].external?.installUrl??null}function fo(e){return e!==null&&Object.values(e.probes.satisfiers).some(e=>e!==void 0&&e.state!==`unprobed`)}function po(e){let t=(0,Q.c)(112),n;t[0]===e?n=t[1]:(n=e===void 0?{}:e,t[0]=e,t[1]=n);let{applyConnections:r}=n,i=r===void 0?Fa:r,{_:a}=g(),o=Ke(),s=et(),{states:c,refresh:l}=Rr(),d=zr(),[f,p]=(0,Z.useState)(``),[m,h]=(0,Z.useState)(!1),[v,y]=(0,Z.useState)(!1),[b,x]=(0,Z.useState)(!1),[S,C]=(0,Z.useState)(null),[w,E]=(0,Z.useState)(!1),[D,O]=(0,Z.useState)(!1),[k,A]=(0,Z.useState)(0),[j,M]=(0,Z.useState)(null),[N,P]=(0,Z.useState)(null),F=(0,Z.useRef)(null),I=(0,Z.useRef)(0),L;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(L={queryKey:[`acp-catalog`],queryFn:wo,staleTime:3e5},t[2]=L):L=t[2];let R=_(L),z;t[3]===l?z=t[4]:(z=()=>{l()},t[3]=l,t[4]=z);let B=(0,Z.useEffectEvent)(z),V;t[5]===B?V=t[6]:(V=()=>{B()},t[5]=B,t[6]=V);let H;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(H=[],t[7]=H):H=t[7],(0,Z.useEffect)(V,H);let ee;t[8]===i?ee=t[9]:(ee=()=>{let e=!0,t=I.current+=1;return i([]).then(n=>{!e||I.current!==t||(n.snapshot!==null&&C(n.snapshot),E(!fo(n.snapshot)),O(n.unavailable===!0))}).catch(()=>{e&&I.current===t&&E(!0)}),()=>{e=!1}},t[8]=i,t[9]=ee);let U;t[10]!==i||t[11]!==k?(U=[i,k],t[10]=i,t[11]=k,t[12]=U):U=t[12],(0,Z.useEffect)(ee,U);let W=R.data?.agents,G;t[13]===s?G=t[14]:(G=new Set(s.map(Co)),t[13]=s,t[14]=G);let te=G,ne;t[15]===d?.installedClis?ne=t[16]:(ne=d?.installedClis??{},t[15]=d?.installedClis,t[16]=ne);let K=ne,q=S===null?[]:Pa(S),J=q.find(e=>e.id===j)??null,re=q.find(e=>e.id===N)??null,ie;t[17]===i?ie=t[18]:(ie=async function(e){let t=await i(e);return I.current+=1,t.snapshot!==null&&C(t.snapshot),E(!fo(t.snapshot)),t.unavailable===!0&&O(!0),t},t[17]=i,t[18]=ie);let ae=ie,oe;t[19]===S?oe=t[20]:(oe=function(e,t){return t===!1?`absent`:t===!0?`present`:e===void 0?`unknown`:Ta(e,S,t)},t[19]=S,t[20]=oe);let se=oe,ce;t[21]===Symbol.for(`react.memo_cache_sentinel`)?(ce=new Set(sn.map(an).filter(So)),t[21]=ce):ce=t[21];let le=ce,ue;t[22]===Symbol.for(`react.memo_cache_sentinel`)?(ue=new Set(Tt.map(xo).filter(bo)),t[22]=ue):ue=t[22];let de=ue,fe;t[23]!==K||t[24]!==se||t[25]!==c?(fe=function(e,t){if(t===`terminal`){let t=Qt[e].external?.targetId;return t===void 0?`unknown`:se(e,c[t]?.installed??null)}let n=sn.find(t=>an(t)===e);return n===void 0?`unknown`:se(e,K[n]??null)},t[23]=K,t[24]=se,t[25]=c,t[26]=fe):fe=t[26];let pe=fe,me=function(e,t,n,r,i,a,o,s){let c=e===void 0?void 0:q.find(t=>t.id===e);if(c===void 0||e===void 0||S===null||!fo(S))return{status:void 0,action:void 0,hintAction:void 0,residualFiles:!1,statusId:void 0};let l={enabled:i,installedCount:Aa(wa(c)),presence:o,configurable:xa(c),setupDocSlug:c.row.setupDocSlug,installUrl:s===void 0?Qt[e].external?.installUrl??null:s},u=eo(l),d=Sa(e)&&pe(e,r)!==`absent`,f=to(l)&&!d,p=Na({agentId:e,mode:r,snapshot:S,detected:a}),m=p===`connected`||p===`not-connected`&&i,h=m?`${n}-status`:void 0,g=!D||u.kind===`install`||u.kind===`setup-doc`,_=c.cells.projectMcp,v=_===void 0||!Sa(e)||ja(_.consentClass)===r?$a(Oa({agentId:e,mode:r,snapshot:S,detected:a,projectMcp:_})):null;return{status:m?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(so,{status:p,enabled:i}),v===null?null:(0,$.jsx)(`span`,{className:`mt-0.5 block text-muted-foreground text-xs`,"data-testid":`${n}-followup`,children:v})]}):void 0,action:g?(0,$.jsx)(co,{action:u,rowLabel:t,describedById:h,onConfigure:()=>M(e),onRemove:()=>P(e)}):void 0,hintAction:f&&!D?(0,$.jsx)(lo,{rowLabel:t,onRemove:()=>P(e)}):void 0,residualFiles:f,statusId:h}},he;t[27]===a?he=t[28]:(he=function(e,t){return a(e===`not-installed`?t?{id:`06Ucfz`}:{id:`5SwVv1`}:t?{id:`V0Jk_K`}:{id:`EDD3UL`})},t[27]=a,t[28]=he);let ge=he,_e=function(e,t,n,r,i){if($e(e,r),!r||D||t===void 0||S===null)return;let a=q.find(e=>e.id===t);a===void 0||!xa(a)||Na({agentId:t,mode:n,snapshot:S,detected:i})===`not-connected`&&(F.current=e,M(t))},ve=f.trim().toLowerCase(),ye=e=>ve===``||e.toLowerCase().includes(ve),be=(W??[]).filter(e=>ye(e.name)),xe;t[29]===K?xe=t[30]:(xe=e=>K[e]!==!1,t[29]=K,t[30]=xe);let Se=xe,Ce;t[31]===Se?Ce=t[32]:(Ce=(e,t)=>Number(Se(t))-Number(Se(e))||Ft[e].displayName.localeCompare(Ft[t].displayName),t[31]=Se,t[32]=Ce);let we=sn.filter(e=>{let{displayName:t}=Ft[e];return ye(t)||ye(a({id:`QYfQdv`,values:{displayName:t}}))||ye(e)}).sort(Ce),Te;t[33]!==se||t[34]!==c?(Te=e=>se(Y(e),c[e]?.installed??null),t[33]=se,t[34]=c,t[35]=Te):Te=t[35];let Ee=Te,De;t[36]===Ee?De=t[37]:(De=(e,t)=>Number(Ee(e.id)===`absent`)-Number(Ee(t.id)===`absent`),t[36]=Ee,t[37]=De);let Oe=Tt.filter(e=>{let{displayName:t}=e;return ye(a({id:`CZBqrX`,values:{displayName:t}}))||ye(e.id)}).sort(De),ke=d!==null,Ae;t[38]===Symbol.for(`react.memo_cache_sentinel`)?(Ae=new Set([...le,...de]),t[38]=Ae):Ae=t[38];let je=Ae,Me=Yt.filter(e=>!je.has(e)&&ye(Ea(e))),Ne=ve!==``,Pe=!R.isLoading&&!R.isError,Fe=Ne&&Pe&&be.length===0&&we.length===0&&Oe.length===0&&Me.length===0,Ie=!Ne||R.isLoading||R.isError||be.length>0,Le=!Ne||we.length>0,Re=!Ne||Oe.length>0||Me.length>0,ze;t[39]!==o||t[40]!==te?(ze=e=>{let t=te.has(`${e.source}:${e.id}`),n=rt(e);return Ue(o,e.source,e.id,t||n,e.supported)},t[39]=o,t[40]=te,t[41]=ze):ze=t[41];let Be=ze,Ve;t[42]===Be?Ve=t[43]:(Ve=e=>e.harness!==void 0&&tt(e)===0||Be(e),t[42]=Be,t[43]=Ve);let He=Ve,nt=be.filter(He),it;t[44]===He?it=t[45]:(it=(e,t)=>Number(He(t))-Number(He(e))||e.name.localeCompare(t.name),t[44]=He,t[45]=it);let at=[...Ne||m?be:nt].sort(it),ot=Ne?0:be.length-nt.length,st=we.filter(Se),ct=st.length>0&&st.length<we.length,lt=!ct||Ne||v?we:st,ut=ct&&!Ne?we.length-st.length:0,dt;t[46]===Ee?dt=t[47]:(dt=e=>Ee(e.id)!==`absent`,t[46]=Ee,t[47]=dt);let ft=Oe.filter(dt),pt=Me.filter(e=>se(e,q.find(t=>t.id===e)?.row.detected??null)!==`absent`),mt=ft.length+pt.length,ht=Oe.length+Me.length,gt=mt>0&&mt<ht,_t=!gt||Ne||b,vt=_t?Oe:ft,yt=_t?Me:pt,bt=gt&&!Ne?ht-mt:0,xt=!Pe||be.some(rt),St=ke&&we.some(Se),Ct;t[48]===c?Ct=t[49]:(Ct=e=>c[e.id]?.installed===!0,t[48]=c,t[49]=Ct);let wt=Oe.some(Ct),Et=Ie?(0,$.jsx)(io,{label:a({id:`RXEbZy`}),labelId:`settings-configure-agents-in-app`,children:R.isLoading?(0,$.jsxs)(`div`,{className:`flex items-center justify-center gap-2 px-3 py-6 text-muted-foreground text-sm`,children:[(0,$.jsx)(Gr,{className:`size-4`,"aria-hidden":`true`}),a({id:`ucXZ0k`})]}):R.isError?(0,$.jsxs)(`div`,{className:`flex flex-col items-center gap-2 px-3 py-6 text-center text-muted-foreground text-sm`,children:[(0,$.jsx)(za,{className:`size-5`,"aria-hidden":`true`}),(0,$.jsx)(`span`,{children:a({id:`FqGWeR`})}),(0,$.jsx)(T,{type:`button`,variant:`outline`,size:`sm`,onClick:()=>void R.refetch(),children:a({id:`6gRgw8`})})]}):(W?.length??0)===0?(0,$.jsx)(`p`,{className:`px-3 py-6 text-center text-muted-foreground text-sm`,children:a({id:`QQbwzK`})}):(0,$.jsxs)($.Fragment,{children:[at.map(e=>{let t=Be(e),n=e.supported?e.description:a({id:`5jEnaB`});return(0,$.jsx)(no,{icon:(0,$.jsx)(Qe,{agentId:e.id,iconUrl:e.iconUrl,className:`size-4`}),name:e.name,hint:n===void 0?void 0:{text:n},checked:t,disabled:!e.supported,ariaLabel:a({id:`FZtBeR`,values:{0:e.name}}),testId:`configure-agents-in-app-${e.source}:${e.id}`,rowTestId:`configure-agents-in-app-row-${e.source}:${e.id}`,onToggle:t=>{t?(qe({source:e.source,id:e.id,name:e.name,supported:e.supported,featured:e.featured,...e.iconUrl===void 0?{}:{iconUrl:e.iconUrl}},{makeDefault:!1}),$e(Xe(e.source,e.id),!0)):($e(Xe(e.source,e.id),!1),Je(`${e.source}:${e.id}`,e=>Ue(o,e.source,e.id,!0,e.supported)))}},`${e.source}:${e.id}`)}),(0,$.jsx)(oo,{hiddenCount:ot,expanded:m,onToggle:()=>h(yo),testId:`configure-agents-in-app-show-more`})]})},`in-app`):null,Dt=Le?(0,$.jsxs)(io,{label:a({id:`ALhMYW`}),labelId:`settings-configure-agents-terminal`,children:[lt.map(e=>{let{displayName:t}=Ft[e],n=K[e]??null,r=se(an(e),n),i=Ze(o,e,r===`absent`),s=`configure-agents-terminal-row-${e}`,{status:c,action:l,hintAction:u,residualFiles:d,statusId:f}=me(an(e),a({id:`QYfQdv`,values:{displayName:t}}),s,`terminal`,i,n,r,uo(an(e))??Ft[e].docsUrl);return(0,$.jsx)(no,{icon:(0,$.jsx)(Dn,{id:Pi(e),className:`size-4`,"aria-hidden":`true`}),name:a({id:`QYfQdv`,values:{displayName:t}}),hint:r===`absent`?{text:ge(`not-installed`,d),action:u}:void 0,status:c,action:l,checked:i,disabled:ro(r,i),ariaLabel:a({id:`27TLNq`,values:{displayName:t}}),testId:`configure-agents-terminal-${e}`,rowTestId:s,statusId:f,onToggle:ke?t=>_e(Ge(e),an(e),`terminal`,t,K[e]??null):void 0},e)}),(0,$.jsx)(oo,{hiddenCount:ut,expanded:v,onToggle:()=>y(vo),testId:`configure-agents-terminal-show-more`})]},`terminal`):null,Ot=Re?(0,$.jsxs)(io,{label:a({id:`BwKH4d`}),labelId:`settings-configure-agents-desktop`,labelIcon:(0,$.jsx)(zn,{"aria-hidden":`true`,className:`size-3`}),children:[vt.map(e=>{let t=c[e.id]?.installed??null,{displayName:n}=e,r=Ye(o,e.id,t),i=se(Y(e.id),t),s=`configure-agents-desktop-row-${e.id}`,{status:l,action:u,hintAction:d,residualFiles:f,statusId:p}=me(Y(e.id),a({id:`CZBqrX`,values:{displayName:n}}),s,`external`,r,t,i);return(0,$.jsx)(no,{icon:(0,$.jsx)(Dn,{id:e.id,className:`size-4`,"aria-hidden":`true`}),name:a({id:`CZBqrX`,values:{displayName:n}}),hint:i===`absent`?{text:ge(`not-installed`,f),action:d}:void 0,status:l,action:u,checked:r,disabled:ro(i,r),ariaLabel:a({id:`cdBape`,values:{displayName:n}}),testId:`configure-agents-desktop-${e.id}`,rowTestId:s,statusId:p,onToggle:n=>_e(We(e.id),Y(e.id),`external`,n,t)},e.id)}),yt.map(e=>{let t=q.find(t=>t.id===e)??null,n=t?.row.detected??null,r=Ea(e),i=se(e,n),a=`agent-connection-${e}`,o=me(e,r,a,`external`,t===null||!ba(t),n,i);return(0,$.jsx)(no,{icon:(0,$.jsx)(ka,{agentId:e,className:`size-4 text-muted-foreground`}),name:r,hint:i===`absent`?{text:ge(`not-detected`,o.residualFiles),action:o.hintAction}:void 0,status:o.status,action:o.action,ariaLabel:r,testId:`configure-agents-unlaunchable-${e}`,rowTestId:a,statusId:o.statusId},e)}),(0,$.jsx)(oo,{hiddenCount:bt,expanded:b,onToggle:()=>x(_o),testId:`configure-agents-desktop-show-more`})]},`desktop`):null,kt=[{node:Et,hasPresent:xt},{node:Dt,hasPresent:St},{node:Ot,hasPresent:wt}].sort(go).map(ho),At;t[50]===a?At=t[51]:(At=a({id:`lBN3T6`}),t[50]=a,t[51]=At);let jt;t[52]===a?jt=t[53]:(jt=a({id:`D4I0F9`}),t[52]=a,t[53]=jt);let Mt;t[54]!==At||t[55]!==jt?(Mt=(0,$.jsx)(Ha,{titleId:`settings-configure-agents-title`,title:At,children:jt}),t[54]=At,t[55]=jt,t[56]=Mt):Mt=t[56];let Nt;t[57]===Symbol.for(`react.memo_cache_sentinel`)?(Nt=(0,$.jsx)(u,{className:`-translate-y-1/2 absolute top-1/2 start-2.5 size-4 text-muted-foreground`,"aria-hidden":`true`}),t[57]=Nt):Nt=t[57];let Pt;t[58]===Symbol.for(`react.memo_cache_sentinel`)?(Pt=e=>p(e.target.value),t[58]=Pt):Pt=t[58];let It;t[59]===a?It=t[60]:(It=a({id:`-7s4fw`}),t[59]=a,t[60]=It);let Lt;t[61]===a?Lt=t[62]:(Lt=a({id:`-7s4fw`}),t[61]=a,t[62]=Lt);let Rt;t[63]!==f||t[64]!==It||t[65]!==Lt?(Rt=(0,$.jsxs)(`div`,{className:`relative`,children:[Nt,(0,$.jsx)(oi,{value:f,onChange:Pt,placeholder:It,"aria-label":Lt,className:`ps-8`,"data-testid":`configure-agents-search`})]}),t[63]=f,t[64]=It,t[65]=Lt,t[66]=Rt):Rt=t[66];let zt;t[67]!==a||t[68]!==D?(zt=D?(0,$.jsxs)(`div`,{role:`status`,className:`flex items-center gap-2 rounded-md border px-3 py-2.5 text-muted-foreground text-sm`,"data-testid":`configure-agents-read-only`,children:[(0,$.jsx)($r,{"aria-hidden":!0,className:`size-4 shrink-0`}),(0,$.jsx)(`span`,{children:a({id:`RD8cCw`})})]}):null,t[67]=a,t[68]=D,t[69]=zt):zt=t[69];let Bt;t[70]!==a||t[71]!==w?(Bt=w?(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-3 rounded-md border px-3 py-2.5 text-muted-foreground text-sm`,children:[(0,$.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[(0,$.jsx)(za,{"aria-hidden":!0,className:`size-4 shrink-0`}),(0,$.jsx)(`span`,{role:`status`,children:a({id:`4sE6E9`})})]}),(0,$.jsx)(T,{type:`button`,variant:`outline`,size:`sm`,className:`shrink-0`,onClick:()=>A(mo),children:a({id:`6gRgw8`})})]}):null,t[70]=a,t[71]=w,t[72]=Bt):Bt=t[72];let Vt;t[73]!==a||t[74]!==Fe?(Vt=Fe?(0,$.jsx)(`p`,{className:`py-6 text-center text-muted-foreground text-sm`,"data-testid":`configure-agents-no-results`,children:a({id:`Nay2Yr`})}):null,t[73]=a,t[74]=Fe,t[75]=Vt):Vt=t[75];let Ht=`configure:${j??`closed`}`,Ut;t[76]===j?Ut=t[77]:(Ut=j!==null&&Sa(j),t[76]=j,t[77]=Ut);let Wt=J!==null,Gt;t[78]===F?Gt=t[79]:(Gt=e=>{e||(F.current!==null&&($e(F.current,!1),F.current=null),M(null))},t[78]=F,t[79]=Gt);let Kt;t[80]!==ae||t[81]!==J||t[82]!==F?(Kt=(e,t)=>J===null?Promise.resolve({ok:!1,report:{actions:[],conflicts:[],withheld:[]},snapshot:null}):ae(Da(J,e,t)).then(e=>(e.ok&&(F.current=null),e)),t[80]=ae,t[81]=J,t[82]=F,t[83]=Kt):Kt=t[83];let qt;t[84]!==J||t[85]!==Ht||t[86]!==Ut||t[87]!==Wt||t[88]!==Gt||t[89]!==Kt?(qt=(0,$.jsx)(ya,{connection:J,paired:Ut,open:Wt,onOpenChange:Gt,onSave:Kt},Ht),t[84]=J,t[85]=Ht,t[86]=Ut,t[87]=Wt,t[88]=Gt,t[89]=Kt,t[90]=qt):qt=t[90];let Jt=`remove:${N??`closed`}`,Xt;t[91]===N?Xt=t[92]:(Xt=N!==null&&Sa(N),t[91]=N,t[92]=Xt);let Zt=re!==null,$t;t[93]===Symbol.for(`react.memo_cache_sentinel`)?($t=e=>{e||P(null)},t[93]=$t):$t=t[93];let en;t[94]!==ae||t[95]!==re?(en=e=>re===null?Promise.resolve({ok:!1,report:{actions:[],conflicts:[],withheld:[]},snapshot:null}):ae(Ca(re,e===void 0?[]:e)),t[94]=ae,t[95]=re,t[96]=en):en=t[96];let tn;t[97]!==re||t[98]!==Jt||t[99]!==Xt||t[100]!==Zt||t[101]!==en?(tn=(0,$.jsx)(Ma,{connection:re,paired:Xt,open:Zt,onOpenChange:$t,onRemove:en},Jt),t[97]=re,t[98]=Jt,t[99]=Xt,t[100]=Zt,t[101]=en,t[102]=tn):tn=t[102];let nn;return t[103]!==kt||t[104]!==Mt||t[105]!==Rt||t[106]!==zt||t[107]!==Bt||t[108]!==Vt||t[109]!==qt||t[110]!==tn?(nn=(0,$.jsxs)(`section`,{"aria-labelledby":`settings-configure-agents-title`,className:`space-y-6`,"data-field":`section:agent-connections`,"data-testid":`settings-configure-agents`,children:[Mt,Rt,zt,Bt,Vt,kt,qt,tn]}),t[103]=kt,t[104]=Mt,t[105]=Rt,t[106]=zt,t[107]=Bt,t[108]=Vt,t[109]=qt,t[110]=tn,t[111]=nn):nn=t[111],nn}function mo(e){return e+1}function ho(e){return e.node}function go(e,t){return Number(t.hasPresent)-Number(e.hasPresent)}function _o(e){return!e}function vo(e){return!e}function yo(e){return!e}function bo(e){return e!==void 0}function xo(e){return Y(e.id)}function So(e){return e!==void 0}function Co(e){return`${e.source}:${e.id}`}function wo(e){let{signal:t}=e;return nt(t)}var To=`open-knowledge-app`;function Eo({from:e,to:t}){try{un.getTracer(To).startSpan(`ok.language.preferenceChanged`,{attributes:{"ok.language.from":e,"ok.language.to":t}}).end()}catch(e){console.warn(`[language-telemetry] span emit failed:`,e instanceof Error?e:String(e))}}var Do=`open-knowledge-app`;function Oo(e){let t=e.light.startsWith(`saved-`),n=e.dark.startsWith(`saved-`);return!t||!n?`incomplete`:e.light===e.dark?`same`:`different`}function ko(e){try{un.getTracer(Do).startSpan(`ok.saved_themes.assignment`,{attributes:{"saved_theme.pair":Oo(e)}}).end()}catch(e){console.warn(`[saved-theme-telemetry] assignment span emit failed:`,e instanceof Error?e:String(e))}}var Ao=`system`;function jo(e){return typeof e==`string`&&gt.includes(e)}function Mo(e){return jo(e)?e:Ao}function No(e){return new Intl.DisplayNames([e],{type:`language`}).of(e)??e}function Po(e){let t=(0,Q.c)(6),{choice:n}=e;if(n===Ao){let e;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(h,{id:`D-NlUC`}),t[0]=e):e=t[0],e}let r;t[1]===n?r=t[2]:(r=No(n),t[1]=n,t[2]=r);let i;return t[3]!==n||t[4]!==r?(i=(0,$.jsx)(`span`,{lang:n,className:`capitalize`,children:r}),t[3]=n,t[4]=r,t[5]=i):i=t[5],i}function Fo(e){let t=(0,Q.c)(22),n,r,i,a,o;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],o=t[5]):({value:o,onValueChange:r,onBlur:n,ref:i,...a}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o);let s;t[6]===o?s=t[7]:(s=Mo(o),t[6]=o,t[7]=s);let c=s,l;t[8]===r?l=t[9]:(l=e=>r(Mo(e)),t[8]=r,t[9]=l);let u;t[10]===c?u=t[11]:(u=(0,$.jsx)(Fe,{children:(0,$.jsx)(Po,{choice:c})}),t[10]=c,t[11]=u);let d;t[12]!==n||t[13]!==i||t[14]!==a||t[15]!==u?(d=(0,$.jsx)(Pe,{...a,ref:i,onBlur:n,size:`sm`,className:`w-48`,children:u}),t[12]=n,t[13]=i,t[14]=a,t[15]=u,t[16]=d):d=t[16];let f;t[17]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,$.jsxs)(Ne,{children:[(0,$.jsx)(Me,{value:Ao,children:(0,$.jsx)(Po,{choice:Ao})}),ut.map(Io)]}),t[17]=f):f=t[17];let p;return t[18]!==c||t[19]!==l||t[20]!==d?(p=(0,$.jsxs)(Ie,{value:c,onValueChange:l,children:[d,f]}),t[18]=c,t[19]=l,t[20]=d,t[21]=p):p=t[21],p}function Io(e){return(0,$.jsx)(Me,{value:e,children:(0,$.jsx)(Po,{choice:e})},e)}function Lo(e){return{chrome:e.sidebar,surface:e.background,bar:e.primary,line:e.border,dots:[e[`syntax-string`],e[`syntax-keyword`],e[`syntax-atom`]]}}function Ro(e,t,n){return e.id===`custom`?Lo(Mt(bi(t))):e.scheme?Lo(Mt(e.scheme)):Lo(mi(n))}function zo(e){let t=(0,Q.c)(38),{theme:n,customSeed:r,slotMode:i}=e,a,o,s,c,l,u,d,f,p,m;t[0]!==r||t[1]!==i||t[2]!==n?(a=Ro(n,r,i),u=!0,d=``,f=`aspect-[4/3] w-full overflow-hidden rounded-md border`,p={backgroundColor:a.surface,borderColor:a.line},m=(0,$.jsxs)(`div`,{className:`flex h-1/3 items-center gap-1 px-1.5`,style:{backgroundColor:a.chrome,borderBottom:`1px solid ${a.line}`},children:[(0,$.jsx)(`span`,{className:`h-1.5 w-5 rounded-full`,style:{backgroundColor:a.bar}}),(0,$.jsx)(`span`,{className:`h-1.5 flex-1 rounded-full opacity-50`,style:{backgroundColor:a.line}})]}),l=`flex h-2/3`,o=`flex w-1/4 flex-col items-center justify-center gap-1`,s={backgroundColor:a.chrome,borderRight:`1px solid ${a.line}`},c=a.dots.map(Bo),t[0]=r,t[1]=i,t[2]=n,t[3]=a,t[4]=o,t[5]=s,t[6]=c,t[7]=l,t[8]=u,t[9]=d,t[10]=f,t[11]=p,t[12]=m):(a=t[3],o=t[4],s=t[5],c=t[6],l=t[7],u=t[8],d=t[9],f=t[10],p=t[11],m=t[12]);let h;t[13]!==o||t[14]!==s||t[15]!==c?(h=(0,$.jsx)(`div`,{className:o,style:s,children:c}),t[13]=o,t[14]=s,t[15]=c,t[16]=h):h=t[16];let g;t[17]===a.dots[1]?g=t[18]:(g=(0,$.jsx)(`span`,{className:`h-1.5 w-3/4 rounded-full`,style:{backgroundColor:a.dots[1]}}),t[17]=a.dots[1],t[18]=g);let _;t[19]===a.line?_=t[20]:(_=(0,$.jsx)(`span`,{className:`h-1.5 w-1/2 rounded-full opacity-60`,style:{backgroundColor:a.line}}),t[19]=a.line,t[20]=_);let v;t[21]===a.dots[0]?v=t[22]:(v=(0,$.jsx)(`span`,{className:`h-1.5 w-2/3 rounded-full`,style:{backgroundColor:a.dots[0]}}),t[21]=a.dots[0],t[22]=v);let y;t[23]!==g||t[24]!==_||t[25]!==v?(y=(0,$.jsxs)(`div`,{className:`flex flex-1 flex-col justify-center gap-1 px-1.5`,children:[g,_,v]}),t[23]=g,t[24]=_,t[25]=v,t[26]=y):y=t[26];let b;t[27]!==h||t[28]!==y||t[29]!==l?(b=(0,$.jsxs)(`div`,{className:l,children:[h,y]}),t[27]=h,t[28]=y,t[29]=l,t[30]=b):b=t[30];let x;return t[31]!==b||t[32]!==u||t[33]!==d||t[34]!==f||t[35]!==p||t[36]!==m?(x=(0,$.jsxs)(`div`,{"aria-hidden":u,"data-theme-swatch":d,className:f,style:p,children:[m,b]}),t[31]=b,t[32]=u,t[33]=d,t[34]=f,t[35]=p,t[36]=m,t[37]=x):x=t[37],x}function Bo(e,t){return(0,$.jsx)(`span`,{className:`size-1.5 rounded-full`,style:{backgroundColor:e}},t)}function Vo(e){return x(`size-6 min-w-6 rounded-md border p-0 transition-colors`,e?`border-primary bg-primary/15 text-primary hover:bg-primary/20 data-[state=on]:bg-primary/15`:`border-border/70 text-muted-foreground/70 hover:text-foreground`)}function Ho(e){return x(`size-3.5`,e&&`fill-current`)}function Uo(e){let t=(0,Q.c)(33),{selection:n,themes:r,unavailableThemes:i,onAssign:a,editControl:o,deleteControl:s,createControl:c,slotMode:l,customSeed:u,firstItemId:d,"aria-label":f,"aria-describedby":p,"aria-invalid":m}=e,h=r===void 0?ht:r,_;t[0]===i?_=t[1]:(_=i===void 0?[]:i,t[0]=i,t[1]=_);let v=_,y=l===void 0?`light`:l,{_:b}=g(),S;if(t[2]!==b||t[3]!==u||t[4]!==s||t[5]!==o||t[6]!==d||t[7]!==a||t[8]!==n||t[9]!==y||t[10]!==h){let e;t[12]!==b||t[13]!==u||t[14]!==s||t[15]!==o||t[16]!==d||t[17]!==a||t[18]!==n||t[19]!==y?(e=(e,t)=>{let r=n.light===e.id,i=n.dark===e.id,c=o?.themeIds.includes(e.id)??!1,l=s?.themeIds.includes(e.id)??!1,f=o?.selectedId===e.id,p=b(y===`light`?{id:`hgF0al`,values:{0:e.label}}:{id:`6Nea1q`,values:{0:e.label}});return(0,$.jsxs)(`fieldset`,{"aria-label":e.label,className:x(`relative flex min-w-0 flex-col gap-1.5 rounded-lg border-2 p-1 text-left`,n[y]===e.id?`border-primary`:`border-transparent`),children:[(0,$.jsx)(T,{type:`button`,variant:`ghost`,"aria-label":p,"data-theme-focus-target":``,onClick:()=>a(y,e.id),className:`h-auto w-full cursor-pointer p-0 transition-opacity hover:bg-transparent hover:opacity-90`,children:(0,$.jsx)(zo,{theme:e,customSeed:u,slotMode:y})}),l?(0,$.jsx)(T,{type:`button`,variant:`outline`,size:`icon-sm`,title:b({id:`Y2tU6I`,values:{0:e.label}}),"aria-label":b({id:`Y2tU6I`,values:{0:e.label}}),className:`absolute top-2 end-2 z-10 border-border/80 bg-background/85 text-muted-foreground shadow-sm backdrop-blur-sm hover:border-destructive/50 hover:bg-destructive/15 hover:text-destructive focus-visible:border-destructive/50 focus-visible:text-destructive focus-visible:ring-destructive/20 dark:bg-background/80 dark:hover:bg-destructive/20`,onClick:async t=>{let n=t.currentTarget.closest(`fieldset`),r=n?.previousElementSibling?.querySelector(`[data-theme-focus-target]`)??n?.nextElementSibling?.querySelector(`[data-theme-focus-target]`);await s?.onDelete(e.id)!==!1&&r?.focus()},children:(0,$.jsx)(Qr,{"aria-hidden":!0})}):null,(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-1 px-0.5`,children:[(0,$.jsx)(`span`,{className:`truncate text-1sm font-medium text-foreground`,children:e.label}),(0,$.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1`,children:[c?(0,$.jsx)(Ve,{className:Vo(f),pressed:f,onPressedChange:t=>{o?.onSelect(t?e.id:null)},"aria-label":b(f?{id:`8x6zk9`,values:{0:e.label}}:{id:`N6j2JH`,values:{0:e.label}}),children:(0,$.jsx)(Sn,{className:`size-3.5`})}):null,(0,$.jsx)(Ve,{id:t===0?d:void 0,className:Vo(r),pressed:r,onPressedChange:t=>{t&&a(`light`,e.id)},"aria-label":b({id:`sq4WQH`,values:{0:e.label}}),children:(0,$.jsx)(Kr,{className:Ho(r)})}),(0,$.jsx)(Ve,{className:Vo(i),pressed:i,onPressedChange:t=>{t&&a(`dark`,e.id)},"aria-label":b({id:`lZvQrY`,values:{0:e.label}}),children:(0,$.jsx)(qr,{className:Ho(i)})})]})]})]},e.id)},t[12]=b,t[13]=u,t[14]=s,t[15]=o,t[16]=d,t[17]=a,t[18]=n,t[19]=y,t[20]=e):e=t[20],S=h.map(e),t[2]=b,t[3]=u,t[4]=s,t[5]=o,t[6]=d,t[7]=a,t[8]=n,t[9]=y,t[10]=h,t[11]=S}else S=t[11];let C;t[21]!==b||t[22]!==c?(C=c?(0,$.jsxs)(T,{type:`button`,variant:`ghost`,onClick:c.onCreate,className:`group h-auto min-w-0 flex-col items-stretch gap-1.5 rounded-lg border-2 border-transparent p-1 text-left text-muted-foreground hover:bg-transparent hover:text-foreground`,children:[(0,$.jsx)(`span`,{className:`flex aspect-[4/3] w-full items-center justify-center rounded-md border border-dashed border-border bg-muted/10 transition-colors group-hover:border-foreground/40`,children:(0,$.jsx)(Cn,{"aria-hidden":!0,className:`size-6`})}),(0,$.jsx)(`span`,{className:`truncate px-0.5 text-1sm font-medium`,children:b({id:`AJ7_B2`})})]}):null,t[21]=b,t[22]=c,t[23]=C):C=t[23];let w;t[24]===v?w=t[25]:(w=v.map(Wo),t[24]=v,t[25]=w);let E;return t[26]!==p||t[27]!==m||t[28]!==f||t[29]!==S||t[30]!==C||t[31]!==w?(E=(0,$.jsxs)(`fieldset`,{"aria-label":f,"aria-describedby":p,"aria-invalid":m,className:`grid w-full min-w-0 grid-cols-2 gap-2 sm:grid-cols-3`,children:[S,C,w]}),t[26]=p,t[27]=m,t[28]=f,t[29]=S,t[30]=C,t[31]=w,t[32]=E):E=t[32],E}function Wo(e){return(0,$.jsxs)(`fieldset`,{"aria-label":e.label,className:`flex min-w-0 flex-col gap-1.5 rounded-lg border-2 border-destructive/40 bg-destructive/5 p-1 text-left`,children:[(0,$.jsx)(`div`,{"aria-hidden":!0,className:`flex aspect-[4/3] w-full items-center justify-center rounded-md border border-destructive/30 bg-muted/40 text-destructive`,children:(0,$.jsx)(Wn,{className:`size-6`})}),(0,$.jsx)(`span`,{className:`truncate px-0.5 text-1sm font-medium text-foreground`,children:e.label}),(0,$.jsx)(`span`,{className:`px-0.5 text-xs font-medium text-destructive`,children:e.problem}),(0,$.jsx)(`span`,{className:`px-0.5 pb-0.5 text-xs text-muted-foreground`,children:e.detail})]},e.key)}var Go=12e3;function Ko(e){let t=(0,Q.c)(210),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({appearance:n,onAssign:r,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let{_:a}=g(),{themes:o,warnings:s,truncated:c,loadError:l,refresh:u,deleteTheme:d,restoreTheme:f,editingThemeId:p,themeEditorOpen:m,selectThemeToEdit:h}=ri(),[_,v]=(0,Z.useState)(!1),[y,b]=(0,Z.useState)(``),[x,S]=(0,Z.useState)(null),[C,w]=(0,Z.useState)(!1),E=(0,Z.useRef)(null),D,O;t[4]===u?(D=t[5],O=t[6]):(D=()=>{u()},O=[u],t[4]=u,t[5]=D,t[6]=O),(0,Z.useEffect)(D,O);let k;t[7]!==n||t[8]!==o?(k=cn(n,o),t[7]=n,t[8]=o,t[9]=k):k=t[9];let A=k,j,M,R,V,H,ee,U,W,G,te,ne,K,q,J,re,ie,ae,oe,se,ce,le;if(t[10]!==a||t[11]!==x||t[12]!==y||t[13]!==_||t[14]!==d||t[15]!==p||t[16]!==C||t[17]!==l||t[18]!==r||t[19]!==i||t[20]!==u||t[21]!==f||t[22]!==h||t[23]!==A||t[24]!==m||t[25]!==o||t[26]!==c||t[27]!==s){let e=nn(y),n;t[49]===o?n=t[50]:(n=o.filter(Zo),t[49]=o,t[50]=n);let g=n,D,O,k,L,ue,de,fe,pe,me;if(t[51]!==a||t[52]!==y||t[53]!==d||t[54]!==p||t[55]!==g||t[56]!==C||t[57]!==l||t[58]!==r||t[59]!==i||t[60]!==u||t[61]!==f||t[62]!==h||t[63]!==A||t[64]!==m||t[65]!==o||t[66]!==c||t[67]!==s){let e=o.flatMap(Xo),n;t[80]!==a||t[81]!==u||t[82]!==f?(n=async function(e){let t=await f({id:e.id,name:e.scheme.name,stem:e.stem,scheme:{...e.scheme,palette:{...e.scheme.palette}},extension:e.filename.endsWith(`.yml`)?`.yml`:`.yaml`});if(t.ok){await u(),X.success(a({id:`Kx881F`,values:{0:e.label}}));return}if(t.reason===`name-taken`){X.error(a({id:`oZUYMv`,values:{0:e.label}}));return}X.error(a({id:`7O7REc`,values:{0:e.label}}))},t[80]=a,t[81]=u,t[82]=f,t[83]=n):n=t[83];let _=n;k=async function(t){let n=e.find(e=>e.id===t);if(!n)return X.error(a({id:`ANFxWn`})),!1;let r=await d(n.id);if(!r.ok)return X.error(a({id:`kkux8f`,values:{0:n.label}})),!1;if(p===n.id&&h(null),await u(),!r.existed)return X(a({id:`ekSPiP`,values:{0:n.label}})),!0;let i={...n,filename:r.filename,label:r.scheme.name,scheme:r.scheme};return X(a({id:`YCmS3k`,values:{0:i.label}}),{duration:Go,action:{label:a({id:`9uI_rE`}),onClick:()=>_(i)}}),!0};let x;t[84]!==a||t[85]!==y||t[86]!==C||t[87]!==r||t[88]!==i||t[89]!==u||t[90]!==f||t[91]!==h||t[92]!==A||t[93]!==o?(x=async function(e){if(e.preventDefault(),C)return;let t=nn(y);if(!t.ok){S(a({id:`RG3yW6`})),E.current?.focus();return}let n=i.slotMode??`light`,s=o.find(e=>e.id===A[n])?.scheme??bi(i.customSeed),c={name:t.name,variant:s.variant,palette:{...s.palette}};S(null),w(!0);let l=await f({id:t.id,name:t.name,scheme:c});if(!l.ok){S(l.reason===`name-taken`?a({id:`_IfSZn`}):l.reason===`name-invalid`?a({id:`qtnmEX`}):a({id:`DmkTrb`})),w(!1),E.current?.focus();return}let d={id:l.id,label:c.name,kind:c.variant,scheme:c,toTokens:()=>Mt(c)};r(n,l.id,A,[...o,d]),await u(),b(``),v(!1),w(!1),h(l.id)},t[84]=a,t[85]=y,t[86]=C,t[87]=r,t[88]=i,t[89]=u,t[90]=f,t[91]=h,t[92]=A,t[93]=o,t[94]=x):x=t[94],O=x;let j;if(t[95]!==a||t[96]!==s){let e;t[98]===a?e=t[99]:(e=e=>{let t;bb90:switch(e.code){case`unparseable`:t=a({id:`g12y1g`});break bb90;case`not-a-scheme`:t=a({id:`p7Utw8`});break bb90;case`missing-slots`:t=a({id:`GUZHkL`});break bb90;case`bad-hex`:t=a({id:`IMLUBh`});break bb90;case`empty`:t=a({id:`k_tFzX`});break bb90;case`too-long`:t=a({id:`FyyIjH`});break bb90;case`invalid-chars`:t=a({id:`JaU1ld`});break bb90;case`unsupported-extension-case`:t=a({id:`R30SFt`});break bb90;case`duplicate-identity`:t=a({id:`DUb7Ax`});break bb90;case`symlink`:t=a({id:`hFmYGU`});break bb90;case`not-regular-file`:t=a({id:`UH0Zqw`});break bb90;case`file-too-large`:t=a({id:`-othoN`});break bb90;case`read-failed`:t=a({id:`cLn264`});break bb90;default:t=a({id:`WBNpt9`,values:{0:e.code}})}return{key:e.filename,label:e.filename,problem:t,detail:e.conflictingFilenames?a({id:`QwG_zJ`,values:{0:e.conflictingFilenames.join(`, `)}}):a({id:`kwNS82`})}},t[98]=a,t[99]=e),j=s.map(e),t[95]=a,t[96]=s,t[97]=j}else j=t[97];let M=j;K=`flex w-full min-w-0 flex-col gap-2`,t[100]!==a||t[101]!==l||t[102]!==u?(q=l?(0,$.jsxs)(`div`,{role:`alert`,className:`flex items-center justify-between gap-2 rounded-md border border-destructive/30 bg-destructive/5 px-3 py-2 text-sm text-foreground`,children:[(0,$.jsx)(`span`,{children:a({id:`hVzt9x`})}),(0,$.jsx)(T,{type:`button`,variant:`outline`,size:`xs`,onClick:()=>void u(),children:a({id:`KDw4GX`})})]}):null,t[100]=a,t[101]=l,t[102]=u,t[103]=q):q=t[103];let N;t[104]!==a||t[105]!==c?(N=c?(0,$.jsxs)(`div`,{className:`flex items-start gap-2 rounded-md border border-amber-500/30 bg-amber-500/5 px-3 py-2 text-sm text-foreground`,children:[(0,$.jsx)($r,{"aria-hidden":`true`,className:`mt-0.5 size-4 shrink-0 text-amber-600`}),(0,$.jsx)(`span`,{children:a({id:`DLIljL`})})]}):null,t[104]=a,t[105]=c,t[106]=N):N=t[106],t[107]===N?J=t[108]:(J=(0,$.jsx)(`div`,{role:`status`,children:N}),t[107]=N,t[108]=J),D=Uo,ue=i,de=A,fe=g,pe=M;let P;t[109]===o?P=t[110]:(P=o.filter(Yo).map(Jo),t[109]=o,t[110]=P);let F=m?p:null;t[111]!==h||t[112]!==P||t[113]!==F?(me={themeIds:P,selectedId:F,onSelect:h},t[111]=h,t[112]=P,t[113]=F,t[114]=me):me=t[114],L=e.map(qo),t[51]=a,t[52]=y,t[53]=d,t[54]=p,t[55]=g,t[56]=C,t[57]=l,t[58]=r,t[59]=i,t[60]=u,t[61]=f,t[62]=h,t[63]=A,t[64]=m,t[65]=o,t[66]=c,t[67]=s,t[68]=D,t[69]=O,t[70]=k,t[71]=K,t[72]=q,t[73]=J,t[74]=L,t[75]=ue,t[76]=de,t[77]=fe,t[78]=pe,t[79]=me}else D=t[68],O=t[69],k=t[70],K=t[71],q=t[72],J=t[73],L=t[74],ue=t[75],de=t[76],fe=t[77],pe=t[78],me=t[79];let he;t[115]!==k||t[116]!==L?(he={themeIds:L,onDelete:k},t[115]=k,t[116]=L,t[117]=he):he=t[117];let ge;t[118]===Symbol.for(`react.memo_cache_sentinel`)?(ge={onCreate:()=>v(!0)},t[118]=ge):ge=t[118];let _e;t[119]!==r||t[120]!==A||t[121]!==o?(_e=(e,t)=>r(e,t,A,o),t[119]=r,t[120]=A,t[121]=o,t[122]=_e):_e=t[122],t[123]!==D||t[124]!==ue||t[125]!==de||t[126]!==fe||t[127]!==pe||t[128]!==me||t[129]!==he||t[130]!==_e?(re=(0,$.jsx)(D,{...ue,selection:de,themes:fe,unavailableThemes:pe,editControl:me,deleteControl:he,createControl:ge,onAssign:_e}),t[123]=D,t[124]=ue,t[125]=de,t[126]=fe,t[127]=pe,t[128]=me,t[129]=he,t[130]=_e,t[131]=re):re=t[131],H=B,te=_,t[132]===C?ne=t[133]:(ne=e=>{C||v(e)},t[132]=C,t[133]=ne),V=F;let ve;t[134]===a?ve=t[135]:(ve=a({id:`Z_nNa2`}),t[134]=a,t[135]=ve);let ye;t[136]===ve?ye=t[137]:(ye=(0,$.jsx)(P,{children:ve}),t[136]=ve,t[137]=ye);let be;t[138]===a?be=t[139]:(be=a({id:`nTM8ab`}),t[138]=a,t[139]=be);let xe;t[140]===be?xe=t[141]:(xe=(0,$.jsx)(N,{children:be}),t[140]=be,t[141]=xe),t[142]!==ye||t[143]!==xe?(G=(0,$.jsxs)(z,{className:`gap-2`,children:[ye,xe]}),t[142]=ye,t[143]=xe,t[144]=G):G=t[144],R=I,ee=`create-saved-theme-form`,U=!0,W=O,M=Oi,se=x!==null;let Se;t[145]===a?Se=t[146]:(Se=a({id:`HZ7fEu`}),t[145]=a,t[146]=Se),t[147]===Se?ce=t[148]:(ce=(0,$.jsx)(Ei,{htmlFor:`create-saved-theme-name`,children:Se}),t[147]=Se,t[148]=ce);let Ce=x!==null,we=x?`create-saved-theme-help create-saved-theme-error`:`create-saved-theme-help`,Te;t[149]===x?Te=t[150]:(Te=e=>{b(e.target.value),x&&S(null)},t[149]=x,t[150]=Te),t[151]!==y||t[152]!==C||t[153]!==Ce||t[154]!==we||t[155]!==Te?(le=(0,$.jsx)(oi,{ref:E,id:`create-saved-theme-name`,value:y,autoFocus:!0,autoComplete:`off`,required:!0,readOnly:C,"aria-invalid":Ce,"aria-describedby":we,onChange:Te}),t[151]=y,t[152]=C,t[153]=Ce,t[154]=we,t[155]=Te,t[156]=le):le=t[156],j=Di,ie=`create-saved-theme-help`,ae=`font-mono`,oe=e.ok?a({id:`Yb82LN`,values:{0:e.stem}}):a({id:`4d0VYJ`}),t[10]=a,t[11]=x,t[12]=y,t[13]=_,t[14]=d,t[15]=p,t[16]=C,t[17]=l,t[18]=r,t[19]=i,t[20]=u,t[21]=f,t[22]=h,t[23]=A,t[24]=m,t[25]=o,t[26]=c,t[27]=s,t[28]=j,t[29]=M,t[30]=R,t[31]=V,t[32]=H,t[33]=ee,t[34]=U,t[35]=W,t[36]=G,t[37]=te,t[38]=ne,t[39]=K,t[40]=q,t[41]=J,t[42]=re,t[43]=ie,t[44]=ae,t[45]=oe,t[46]=se,t[47]=ce,t[48]=le}else j=t[28],M=t[29],R=t[30],V=t[31],H=t[32],ee=t[33],U=t[34],W=t[35],G=t[36],te=t[37],ne=t[38],K=t[39],q=t[40],J=t[41],re=t[42],ie=t[43],ae=t[44],oe=t[45],se=t[46],ce=t[47],le=t[48];let ue;t[157]!==j||t[158]!==ie||t[159]!==ae||t[160]!==oe?(ue=(0,$.jsx)(j,{id:ie,className:ae,children:oe}),t[157]=j,t[158]=ie,t[159]=ae,t[160]=oe,t[161]=ue):ue=t[161];let de;t[162]===x?de=t[163]:(de=x?(0,$.jsx)(Ti,{id:`create-saved-theme-error`,children:x}):null,t[162]=x,t[163]=de);let fe;t[164]!==M||t[165]!==ue||t[166]!==de||t[167]!==se||t[168]!==ce||t[169]!==le?(fe=(0,$.jsxs)(M,{"data-invalid":se,children:[ce,le,ue,de]}),t[164]=M,t[165]=ue,t[166]=de,t[167]=se,t[168]=ce,t[169]=le,t[170]=fe):fe=t[170];let pe;t[171]!==ee||t[172]!==U||t[173]!==W||t[174]!==fe?(pe=(0,$.jsx)(`form`,{id:ee,noValidate:U,onSubmit:W,children:fe}),t[171]=ee,t[172]=U,t[173]=W,t[174]=fe,t[175]=pe):pe=t[175];let me;t[176]!==R||t[177]!==pe?(me=(0,$.jsx)(R,{children:pe}),t[176]=R,t[177]=pe,t[178]=me):me=t[178];let he;t[179]===Symbol.for(`react.memo_cache_sentinel`)?(he=()=>v(!1),t[179]=he):he=t[179];let ge;t[180]===a?ge=t[181]:(ge=a({id:`dEgA5A`}),t[180]=a,t[181]=ge);let _e;t[182]!==C||t[183]!==ge?(_e=(0,$.jsx)(T,{type:`button`,variant:`outline`,disabled:C,onClick:he,children:ge}),t[182]=C,t[183]=ge,t[184]=_e):_e=t[184];let ve;t[185]!==a||t[186]!==C?(ve=a(C?{id:`_DwR-n`}:{id:`cuHhjo`}),t[185]=a,t[186]=C,t[187]=ve):ve=t[187];let ye;t[188]!==C||t[189]!==ve?(ye=(0,$.jsx)(T,{type:`submit`,form:`create-saved-theme-form`,disabled:C,children:ve}),t[188]=C,t[189]=ve,t[190]=ye):ye=t[190];let be;t[191]!==_e||t[192]!==ye?(be=(0,$.jsxs)(L,{children:[_e,ye]}),t[191]=_e,t[192]=ye,t[193]=be):be=t[193];let xe;t[194]!==V||t[195]!==G||t[196]!==me||t[197]!==be?(xe=(0,$.jsxs)(V,{children:[G,me,be]}),t[194]=V,t[195]=G,t[196]=me,t[197]=be,t[198]=xe):xe=t[198];let Se;t[199]!==H||t[200]!==te||t[201]!==ne||t[202]!==xe?(Se=(0,$.jsx)(H,{open:te,onOpenChange:ne,children:xe}),t[199]=H,t[200]=te,t[201]=ne,t[202]=xe,t[203]=Se):Se=t[203];let Ce;return t[204]!==K||t[205]!==q||t[206]!==J||t[207]!==re||t[208]!==Se?(Ce=(0,$.jsxs)(`div`,{className:K,children:[q,J,re,Se]}),t[204]=K,t[205]=q,t[206]=J,t[207]=re,t[208]=Se,t[209]=Ce):Ce=t[209],Ce}function qo(e){return e.id}function Jo(e){return e.id}function Yo(e){return e.id.startsWith(`saved-`)}function Xo(e){let t=Nt(e.id);return!t.ok||!e.scheme?[]:[{id:e.id,stem:t.stem,label:e.label,scheme:e.scheme}]}function Zo(e){return e.id!==`custom`}function Qo(e,t){if(e.length===0)throw Error(`buildPatch: path must be non-empty`);let[n,...r]=e;return r.length===0?{[String(n)]:t}:{[String(n)]:Qo(r,t)}}function $o(e){let t=e;for(let e=0;e<16;e++){if(t==null)return;let e=t?._zod?.def;if(e?.type===`default`){let t=e.defaultValue;return typeof t==`function`?t():t}let n=t?._zod?.def?.innerType;if(n===void 0)return;t=n}}function es(e){let t=e;for(let e=0;e<16;e++){if(t==null)return;let e=t?._zod?.def;if(!e)return;if(e.type===`default`||e.type===`optional`||e.type===`nullable`){t=e.innerType;continue}return e.type}}function ts(e){let t=e;for(let e=0;e<16;e++){if(t==null)return;let e=t?._zod?.def;if(!e)return;if(e.type===`enum`)return e.entries?Object.values(e.entries):void 0;if(e.innerType!==void 0){t=e.innerType;continue}return}}function ns(e){let t=(0,Q.c)(14),n;t[0]===e?n=t[1]:(n=e.current(),t[0]=e,t[1]=n);let r=n,i;t[2]===r?i=t[3]:(i={defaultValues:r,mode:`onBlur`},t[2]=r,t[3]=i);let a=ra(i),o,s;t[4]!==e||t[5]!==a?(o=()=>e.subscribe(e=>{rs(a,e)}),s=[e,a],t[4]=e,t[5]=a,t[6]=o,t[7]=s):(o=t[6],s=t[7]),(0,Z.useEffect)(o,s);let c;t[8]!==e||t[9]!==a?(c=t=>is(a,e,t),t[8]=e,t[9]=a,t[10]=c):c=t[10];let l=c,u;return t[11]!==l||t[12]!==a?(u={form:a,commitField:l},t[11]=l,t[12]=a,t[13]=u):u=t[13],u}function rs(e,t){e.reset(t,{keepDirtyValues:!0,keepDirty:!0,keepTouched:!0})}function is(e,t,n){let r=e.getValues(n),i=Qo(ss(n),r),a=t.patch(i);if(a.ok)return e.clearErrors(n),e.resetField(n,{defaultValue:r,keepError:!1}),!0;if(Rt(a.error)&&a.error.code===`SCHEMA_INVALID`&&a.error.issues.length>0){e.clearErrors(n);for(let t of a.error.issues){let r=t.path.length>0?t.path.map(String).join(`.`):n;e.setError(r,{type:`config-binding`,message:t.message})}}else e.setError(n,{type:`config-binding`,message:as(a.error,n)});return!1}function as(e,t){if(Rt(e)&&e.code===`SCHEMA_INVALID`){let n=e.issues.find(e=>os(e,t));if(n)return n.message}return tn(e)}function os(e,t){return e.path.map(String).join(`.`)===t}function ss(e){return e.split(`.`)}function cs(e){if(!Rt(e)||e.code!==`SCHEMA_INVALID`)return null;let t=e.issues[0];return!t||t.path.length===0?null:t.path.map(String).join(`.`)}function ls(){let e=(0,Q.c)(3),t,n;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,$.jsx)(Fi,{className:`h-5 w-32`}),n=(0,$.jsx)(Fi,{className:`h-4 w-64`}),e[0]=t,e[1]=n):(t=e[0],n=e[1]);let r;return e[2]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,$.jsxs)(`div`,{className:`space-y-3`,children:[t,n,(0,$.jsxs)(`div`,{className:`space-y-2`,children:[(0,$.jsx)(Fi,{className:`h-9 w-full`}),(0,$.jsx)(Fi,{className:`h-9 w-full`})]})]}),e[2]=r):r=e[2],r}function us({field:e,scope:t,commitField:n,isFlashed:r}){"use no memo";let{_:i}=g(),a=sa(),{setTheme:o}=v(),s=wn(),c=Dt(at,e.path),l=c?es(c):void 0,u=c?$o(c):void 0,d=c?ts(c):void 0,f=c?Zt(c):void 0,p=f?.scope===`project`&&t!==`project`||f?.scope===`user`&&t!==`user`,m=e.path.join(`.`),_=i(e.label),[y,b]=(0,Z.useState)(!1),S=(0,Z.useRef)(null);(0,Z.useEffect)(()=>()=>{S.current&&clearTimeout(S.current)},[]);let C=()=>{b(!0),S.current&&clearTimeout(S.current),S.current=setTimeout(()=>b(!1),1200)},w=()=>{let e=n(m);return e&&C(),e},O=()=>a.getFieldState(m).isDirty?w():!0,A=()=>{if(e.control===`theme-tiles`){let e=s?.userBinding;if(!e)return;let t=e.patch({appearance:pi()});t.ok?C():a.setError(m,{type:`manual`,message:as(t.error,m)});return}let t=u===void 0?null:u;a.setValue(m,t,{shouldDirty:!1}),e.control===`theme-cards`&&o(En(t)),w()},j=x(`relative`,r&&`animate-settings-flash`);return(0,$.jsx)(ia,{control:a.control,name:m,render:({field:n})=>{let r=!p&&(u!==void 0||n.value!==void 0);return(0,$.jsxs)(na,{className:j,"data-field":e.path.join(`.`),"data-scope":t,children:[(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,$.jsx)(oa,{className:`text-sm font-medium`,children:_}),r?(0,$.jsxs)(k,{children:[(0,$.jsx)(E,{asChild:!0,children:(0,$.jsx)(T,{variant:`ghost`,size:`icon`,className:`h-5 w-5 text-muted-foreground opacity-60 hover:opacity-100`,onClick:A,"aria-label":i({id:`lhjq3G`,values:{labelText:_}}),children:(0,$.jsx)(Yr,{className:`size-3.5`})})}),(0,$.jsx)(D,{children:(0,$.jsx)(h,{id:`L-rMC9`})})]}):null]}),e.description?(0,$.jsx)(ca,{className:`text-muted-foreground text-1sm`,children:i(e.description)}):null,(0,$.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,$.jsx)(aa,{children:(0,$.jsx)(fs,{field:e,ctl:n,typeTag:l,enumOptions:d,onCommit:O,onRevertToBaseline:()=>a.resetField(m,{keepError:!0}),onSavedOutsideForm:C,onWriteRejected:e=>{a.setError(m,{type:`manual`,message:as(e,m)})}})}),(0,$.jsx)(gs,{visible:y,srOnly:ds(e.control)})]}),(0,$.jsx)(la,{"data-field-error":e.path.join(`.`)})]})}})}function ds(e){return e===`theme-tiles`||e===`theme-cards`}function fs({field:e,ctl:t,typeTag:n,enumOptions:r,onCommit:i,onRevertToBaseline:a,onSavedOutsideForm:o,onWriteRejected:s,...c}){"use no memo";let{_:l}=g(),{setTheme:u,systemTheme:d}=v(),f=wn(),p=f?.merged??null;if(e.control===`language-select`)return(0,$.jsx)(Fo,{...c,value:t.value,ref:t.ref,onBlur:t.onBlur,onValueChange:e=>{let n=xi(t.value)??`system`;n!==e&&Eo({from:n,to:e}),t.onChange(e),i()}});if(e.control===`theme-cards`){let{id:n,...r}=c;return(0,$.jsx)(Jr,{...r,firstItemId:n,value:En(t.value),"aria-label":l(e.label),onValueChange:e=>{let n=En(t.value);u(e),t.onChange(e),!i()&&(u(n),a())}})}if(e.control===`theme-tiles`){let{id:t,...n}=c,r=p?.appearance?.customTheme,i=p?.appearance?.theme,a=on(i,d===`dark`);return(0,$.jsx)(Ko,{...n,firstItemId:t,appearance:p?.appearance,customSeed:r,slotMode:a,"aria-label":l(e.label),onAssign:(e,t,n,c)=>{let l=f?.userBinding;if(!l)return;let d={...n,[e]:t},p=e=>{let t=e[a];return t===`custom`?gi(bi(r)):fi(t,c)};di({selection:d,modePreference:i,slotMode:a,customSeed:r,themes:c});let m=p(d);m&&u(m);let h=l.patch({appearance:_i(d)});if(h.ok){ko(d),o();return}di({selection:n,modePreference:i,slotMode:a,customSeed:r,themes:c}),u(p(n)??i??`system`),s(h.error)}})}if(n===`boolean`)return(0,$.jsx)(ze,{...c,checked:!!t.value,ref:t.ref,onCheckedChange:e=>{t.onChange(e),i()},onBlur:t.onBlur});if(n===`enum`&&r&&r.length>0&&(e.control===`enum-toggle`||r.length<=4)){let{id:n,...a}=c;return(0,$.jsx)(He,{...a,type:`single`,value:typeof t.value==`string`?t.value:``,ref:t.ref,onValueChange:e=>{e&&(t.onChange(e),i())},onBlur:t.onBlur,variant:`segmented`,size:`sm`,spacing:1,className:`bg-muted dark:bg-background p-0.5 rounded-lg`,"aria-label":l(e.label),children:r.map((e,t)=>(0,$.jsx)(Be,{value:e,id:t===0?n:void 0,className:`text-1sm capitalize`,children:e},e))})}return n===`number`||n===`int`?(0,$.jsx)(ms,{ctl:t,onCommit:i,...c}):n===`array`?(0,$.jsx)(hs,{ctl:t,onCommit:i,...c}):(0,$.jsx)(ps,{ctl:t,onCommit:i,...c})}function ps({ctl:e,onCommit:t,...n}){"use no memo";return(0,$.jsx)(oi,{...n,value:typeof e.value==`string`?e.value:``,ref:e.ref,onChange:t=>e.onChange(t.target.value),onBlur:()=>{e.onBlur(),t()},onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),t())},className:`h-8 text-sm`})}function ms({ctl:e,onCommit:t,...n}){"use no memo";let[r,i]=(0,Z.useState)(e.value===void 0?``:String(e.value)),a=(0,Z.useRef)(e.value);(0,Z.useEffect)(()=>{a.current!==e.value&&(i(e.value===void 0?``:String(e.value)),a.current=e.value)},[e.value]);let o=()=>{let n=Number(r);if(!Number.isFinite(n)){e.onChange(r),t();return}e.onChange(n),t(),a.current=n};return(0,$.jsx)(oi,{...n,type:`number`,value:r,ref:e.ref,onChange:e=>i(e.target.value),onBlur:()=>{e.onBlur(),o()},onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),o())},className:`h-8 w-28 text-sm tabular-nums`})}function hs({ctl:e,onCommit:t,...n}){"use no memo";let r=Array.isArray(e.value)?e.value.join(`
2
2
  `):``,[i,a]=(0,Z.useState)(r),o=(0,Z.useRef)(r);(0,Z.useEffect)(()=>{let t=Array.isArray(e.value)?e.value.join(`
3
3
  `):``;t!==o.current&&(a(t),o.current=t)},[e.value]);let s=()=>{let n=i.split(`
4
4
  `).map(e=>e.trim()).filter(e=>e.length>0);e.onChange(n),t(),o.current=n.join(`
@@ -1 +1 @@
1
- import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./jsx-runtime-BUgB2tll.js";import{t as n}from"./react-f2sANaYj.js";import{n as r,r as i}from"./dist-Nvb76hAm.js";import{t as a}from"./compiler-runtime-BfE3aGVn.js";import{t as o}from"./button-Cym3gapE.js";import{a as ee,c as te,i as s,n as ne,o as re,s as ie,t as ae}from"./dialog-DgIQr9zS.js";import{n as c}from"./dist-CJhtNlOm2.js";import{t as l}from"./desktop-bridge-types-oYPdTDmz.js";import{n as u,t as oe}from"./git-branch-B_QTfwFA.js";import{t as d}from"./spinner-Bp2_BYkl.js";import{n as se,t as f}from"./miss-dialog-store-CNJRdTPE.js";import{r as p,t as m}from"./auth-prompt-store-DfthAUSi.js";import{a as h,n as g}from"./receive-store-BbICc2Yx.js";import{t as ce}from"./share-metadata-rows-Bj7HLyQc.js";var _=e(n(),1),le=a();function ue(e){let t=e.shareTargetExists,n=e.dirtyConflicts.conflicts,r=e.dirtyConflicts.files;return t&&!n?{kind:`A`,openCurrentEnabled:!0,switchEnabled:!0,conflictingFiles:r}:!t&&!n?{kind:`B`,openCurrentEnabled:!1,switchEnabled:!0,conflictingFiles:r}:t&&n?{kind:`C`,openCurrentEnabled:!0,switchEnabled:!1,conflictingFiles:r}:{kind:`D`,openCurrentEnabled:!1,switchEnabled:!1,conflictingFiles:r}}function de(e){return e.detached?e.currentHeadSha:e.currentBranch??`HEAD`}function v(e){if(e.ok)return{action:`await-cc1`};switch(e.reason){case`dirty-conflict`:return{action:`rerender-conflict`,files:e.files??[]};case`branch-not-found`:return{action:`dismiss-with-toast`,reason:`branch-not-found`};case`fetch-failed`:case`checkout-failed`:return{action:`stay-with-toast`,reason:e.reason};case`branch-in-other-worktree`:{let t=e.otherWorktreePath;return t===void 0||t.length===0?{action:`stay-with-toast`,reason:`checkout-failed`}:{action:`pivot-to-other-worktree`,otherWorktreePath:t}}case`ff-diverged`:return{action:`branch-diverged`};default:{let t=e.reason;throw Error(`Unhandled CheckoutFailureReason: ${String(t)}`)}}}var fe={phase:`loading`};function pe(e,t){return e.phase===`loading`?t===null?{phase:`error`}:{phase:`ready`,info:t}:e}function me(e,t){return e.phase!==`ready`&&e.phase!==`verdict`?e:{phase:`switching`,info:e.info,pendingDoc:t}}function he(e){return e.phase===`ready`?{phase:`creating-worktree`,info:e.info}:e}function ge(e){return ue(e).kind===`B`&&e.shareTargetOnOriginBranch===!1}function _e(e){return e.phase===`ready`?{phase:`verdict-pending`,info:e.info}:e}function ve(e,t){if(e.phase!==`verdict-pending`)return e;if(t===null||t.verdict===`unknown`||t.verdict===`changed-locally`)return{phase:`ready`,info:e.info};let n=t.verdict===`renamed`?{kind:`renamed`,renamedTo:t.renamedTo}:{kind:t.verdict};return{phase:`verdict`,info:e.info,resolution:n}}function ye(e,t){if(e.phase!==`switching`)return{state:e};if(t===null)return{state:{phase:`ready`,info:e.info},sideEffect:{kind:`toast`,reason:`proxy-null`}};let n=v(t);return n.action===`await-cc1`?{state:{phase:`awaiting-cc1-recycle`,pendingDoc:e.pendingDoc}}:n.action===`rerender-conflict`?{state:{phase:`ready`,info:{...e.info,dirtyConflicts:{conflicts:!0,files:n.files.slice()}}}}:n.action===`pivot-to-other-worktree`?{state:{phase:`branch-in-other-worktree`,info:e.info,otherWorktreePath:n.otherWorktreePath,pendingDoc:e.pendingDoc}}:n.action===`dismiss-with-toast`?{state:{phase:`dismissed`,reason:n.reason},sideEffect:{kind:`toast`,reason:n.reason}}:n.action===`branch-diverged`?{state:{phase:`verdict`,info:e.info,resolution:{kind:`diverged`}}}:{state:{phase:`ready`,info:e.info},sideEffect:{kind:`toast`,reason:n.reason}}}function be(e,t){return e.phase===`creating-worktree`?t===null?{state:{phase:`ready`,info:e.info},sideEffect:{kind:`toast`,reason:`proxy-null`}}:t.ok?{state:{phase:`opening-worktree`,path:t.path}}:t.reason===`branch-not-found`?{state:{phase:`dismissed`,reason:`branch-not-found`},sideEffect:{kind:`toast`,reason:`branch-not-found`}}:{state:{phase:`ready`,info:e.info},sideEffect:{kind:`toast`,reason:t.reason,helper:t.helper,authFailed:t.reason===`fetch-failed`?t.authFailed:void 0,notFoundAsIdentity:t.reason===`fetch-failed`?t.notFoundAsIdentity:void 0}}:{state:e}}var y=t();function xe(e){return l(e.repositoryTarget)}function Se(e,t=l(e.target)){let n=e.contentRootDepth===null?t:[...xe(e).split(`/`).slice(0,e.contentRootDepth),...t===``?[]:t.split(`/`)].join(`/`);return{kind:e.target.kind,path:t,repositoryPath:n,...e.contentRootDepth===null?{}:{contentRootDepth:e.contentRootDepth}}}function Ce(e){return e!==null&&e.kind===`project-branch-switch`}function b(e){let t=(0,le.c)(217),{bridge:n,store:a}=e,m=a===void 0?g:a,{_:v}=i(),b=(0,_.useSyncExternalStore)(m.subscribe,m.getSnapshot,je),[x,S]=(0,_.useState)(fe),Me=(0,_.useRef)(!1),Ne=(0,_.useRef)(!1),Pe=(0,_.useRef)(!1),Fe=(0,_.useRef)(null),Ie;t[0]===b?Ie=t[1]:(Ie=Ce(b)?b:null,t[0]=b,t[1]=Ie);let C=Ie,Le;t[2]!==v||t[3]!==C?.share.target.kind?(Le=C?.share.target.kind===`folder`?v({id:`ugoTXs`}):v({id:`XH30C4`}),t[2]=v,t[3]=C?.share.target.kind,t[4]=Le):Le=t[4];let w=Le,Re;t[5]===C?Re=t[6]:(Re=()=>{S(fe),Me.current=!1,Ne.current=!1,Pe.current=!1,Fe.current=C},t[5]=C,t[6]=Re);let ze;t[7]===b?ze=t[8]:(ze=[b],t[7]=b,t[8]=ze),(0,_.useEffect)(Re,ze);let Be;t[9]!==C||t[10]!==n?(Be=()=>{if(!C||Me.current)return;Me.current=!0;let e=!1;return n.project.fetchBranchInfo({projectPath:C.projectPath,branch:C.share.branch,kind:C.share.repositoryTarget.kind,path:xe(C.share)}).then(t=>{e||S(e=>pe(e,t))}).catch(t=>{e||(console.warn(`[receive] branch-info-fetch-failed`,t instanceof Error?t.message:t),S(Ae))}),()=>{e=!0}},t[9]=C,t[10]=n,t[11]=Be):Be=t[11];let Ve;t[12]===C?Ve=t[13]:(Ve=[C],t[12]=C,t[13]=Ve),(0,_.useEffect)(Be,Ve);let He;t[14]!==C||t[15]!==x.info||t[16]!==x.phase||t[17]!==n?(He=()=>{if(!C||x.phase!==`ready`||Pe.current||!ge(x.info))return;Pe.current=!0,S(_e);let e=C;n.project.fetchTargetStatus({projectPath:C.projectPath,branch:C.share.branch,kind:C.share.target.kind,path:xe(C.share),...C.share.contentRootDepth===null?{}:{contentRootDepth:C.share.contentRootDepth}}).then(t=>{Fe.current===e&&S(e=>ve(e,t))}).catch(t=>{Fe.current===e&&(console.warn(`[receive] target-status-fetch-failed`,t instanceof Error?t.message:t),S(ke))})},t[14]=C,t[15]=x.info,t[16]=x.phase,t[17]=n,t[18]=He):He=t[18];let Ue;t[19]!==C||t[20]!==x.phase?(Ue=[x.phase,C],t[19]=C,t[20]=x.phase,t[21]=Ue):Ue=t[21],(0,_.useEffect)(He,Ue);let We;t[22]!==C||t[23]!==x.phase||t[24]!==x.resolution||t[25]!==m?(We=()=>{if(x.phase!==`verdict`)return;let{kind:e}=x.resolution;e!==`deleted`&&e!==`never-on-branch`||C&&(f.arm({kind:C.share.target.kind,path:l(C.share.target),repositoryPath:xe(C.share),...C.share.contentRootDepth===null?{}:{contentRootDepth:C.share.contentRootDepth},branch:C.share.branch}),m.dismiss())},t[22]=C,t[23]=x.phase,t[24]=x.resolution,t[25]=m,t[26]=We):We=t[26];let Ge;t[27]!==C||t[28]!==x||t[29]!==m?(Ge=[x,C,m],t[27]=C,t[28]=x,t[29]=m,t[30]=Ge):Ge=t[30],(0,_.useEffect)(We,Ge);let Ke;t[31]!==x.phase||t[32]!==x.resolution?(Ke=()=>{x.phase===`verdict`&&console.log(h({verdict_cell:x.resolution.kind}))},t[31]=x.phase,t[32]=x.resolution,t[33]=Ke):Ke=t[33];let qe;t[34]===x?qe=t[35]:(qe=[x],t[34]=x,t[35]=qe),(0,_.useEffect)(Ke,qe);let Je;t[36]!==v||t[37]!==C||t[38]!==x.pendingDoc||t[39]!==x.phase||t[40]!==n||t[41]!==m||t[42]!==w?(Je=()=>{if(x.phase!==`awaiting-cc1-recycle`||!C)return;let e=C.share.branch,t=x.pendingDoc;if(!e){m.dismiss();return}if(Ne.current)return;Ne.current=!0;let r=!1;return n.project.awaitBranchSwitched({projectPath:C.projectPath,branch:e,timeoutMs:3e4}).then(i=>{if(!r){if(i.ok){console.log(h({branch_dialog_action:`branch-switch-complete`,branch:e})),n.project.open({path:C.projectPath,target:`new-window`,entryPoint:`share-receive`,pendingDeepLinkTarget:Se(C.share,t),pendingBranch:e}).catch(e=>{console.warn(`[receive] warm-focus-dispatch-failed branch_action=switch`,e instanceof Error?e.message:e),c.error(v({id:`gQV-9w`,values:{targetNoun:w}}))}),m.dismiss();return}console.log(h({branch_dialog_action:`branch-switch-timeout`,branch:e})),c.error(v({id:`LBwUR6`,values:{targetNoun:w}})),m.dismiss()}}).catch(e=>{r||(console.warn(`[receive] awaitBranchSwitched rejected`,e instanceof Error?e.message:e),c.error(v({id:`Jw6EC4`,values:{targetNoun:w}})),m.dismiss())}),()=>{r=!0}},t[36]=v,t[37]=C,t[38]=x.pendingDoc,t[39]=x.phase,t[40]=n,t[41]=m,t[42]=w,t[43]=Je):Je=t[43];let Ye;if(t[44]!==C||t[45]!==x.phase?(Ye=[x.phase,C],t[44]=C,t[45]=x.phase,t[46]=Ye):Ye=t[46],(0,_.useEffect)(Je,Ye),!C)return null;let{share:T,projectPath:E,currentBranch:Xe}=C,D=T.branch,Ze;t[47]!==v||t[48]!==n.project||t[49]!==E||t[50]!==D||t[51]!==m?(Ze=function(e,t,r){console.log(h({branch_dialog_action:`switch`,branch_action:`switch`,branch:D,verdict_cell:r})),S(t=>me(t,e)),n.project.runCheckout(t?{projectPath:E,branch:D,fastForward:!0}:{projectPath:E,branch:D}).then(e=>{let t=null,n=!1;S(r=>{let{state:i,sideEffect:a}=ye(r,e);return a&&(t=a.reason,n=i.phase===`dismissed`),i}),t===`branch-not-found`?c.error(v({id:`NJyQi_`,values:{shareBranch:D}})):t===`fetch-failed`?c.error(v({id:`bWLmRK`})):(t===`checkout-failed`||t===`proxy-null`)&&c.error(v({id:`c863eW`,values:{shareBranch:D}})),n&&m.dismiss()}).catch(e=>{console.warn(`[receive] runCheckout rejected branch_action=switch`,e instanceof Error?e.message:e),S(Oe),c.error(v({id:`c863eW`,values:{shareBranch:D}}))})},t[47]=v,t[48]=n.project,t[49]=E,t[50]=D,t[51]=m,t[52]=Ze):Ze=t[52];let O=Ze,Qe;t[53]!==x.info||t[54]!==x.phase||t[55]!==O||t[56]!==T.target?(Qe=function(){x.phase===`ready`&&ue(x.info).switchEnabled&&O(l(T.target),!1)},t[53]=x.info,t[54]=x.phase,t[55]=O,t[56]=T.target,t[57]=Qe):Qe=t[57];let $e=Qe,et;t[58]!==x.phase||t[59]!==x.resolution||t[60]!==O||t[61]!==T.target?(et=function(){x.phase===`verdict`&&O(l(T.target),!0,x.resolution.kind)},t[58]=x.phase,t[59]=x.resolution,t[60]=O,t[61]=T.target,t[62]=et):et=t[62];let tt=et,nt;t[63]!==x.phase||t[64]!==x.resolution||t[65]!==O?(nt=function(){x.phase===`verdict`&&x.resolution.kind===`renamed`&&O(x.resolution.renamedTo,!0,x.resolution.kind)},t[63]=x.phase,t[64]=x.resolution,t[65]=O,t[66]=nt):nt=t[66];let rt=nt,it;t[67]!==x.phase||t[68]!==x.resolution||t[69]!==O||t[70]!==T.target?(it=function(){x.phase===`verdict`&&O(l(T.target),!1,x.resolution.kind)},t[67]=x.phase,t[68]=x.resolution,t[69]=O,t[70]=T.target,t[71]=it):it=t[71];let at=it,ot;t[72]!==v||t[73]!==n.project||t[74]!==E||t[75]!==T||t[76]!==D||t[77]!==m||t[78]!==w?(ot=function(){console.log(h({branch_dialog_action:`open-current`,branch:D})),n.project.open({path:E,target:`new-window`,entryPoint:`share-receive`,pendingDeepLinkTarget:Se(T)}).catch(e=>{console.warn(`[receive] warm-focus-dispatch-failed branch_action=open-current`,e instanceof Error?e.message:e),c.error(v({id:`b5aNbi`,values:{targetNoun:w}}))}),m.dismiss()},t[72]=v,t[73]=n.project,t[74]=E,t[75]=T,t[76]=D,t[77]=m,t[78]=w,t[79]=ot):ot=t[79];let st=ot,ct;t[80]!==v||t[81]!==D?(ct=function(e,t){let{helper:n,authFailed:r,notFoundAsIdentity:i}=t===void 0?{}:t;if(e===`fetch-failed`&&i){c.error(v({id:`jRsjlF`}));return}if(e===`fetch-failed`&&r){c.error(v({id:`gfb-CM`}),{action:{label:v({id:`5lWFkC`}),onClick:De}});return}switch(e){case`helper-not-found`:{let e=n??v({id:`cHhH3i`});c.error(v({id:`Z7x_Zh`,values:{tool:e}}));return}case`branch-not-found`:c.error(v({id:`NJyQi_`,values:{shareBranch:D}}));return;case`fetch-failed`:c.error(v({id:`bWLmRK`}));return;case`already-checked-out`:c.error(v({id:`ljHjfg`}));return;case`branch-exists`:c.error(v({id:`h3QZcB`,values:{shareBranch:D}}));return;case`path-exists`:c.error(v({id:`cN1Gcp`,values:{shareBranch:D}}));return;case`no-git`:c.error(v({id:`CFnavk`}));return;case`empty-repo`:c.error(v({id:`5IgYAM`}));return;case`invalid-branch`:c.error(v({id:`JfPuv7`,values:{shareBranch:D}}));return;case`proxy-null`:case`error`:c.error(v({id:`e8zYa8`,values:{shareBranch:D}}));return;default:throw Error(`Unhandled worktree failure reason: ${String(e)}`)}},t[80]=v,t[81]=D,t[82]=ct):ct=t[82];let lt=ct,ut;t[83]!==v||t[84]!==n.project||t[85]!==T||t[86]!==D||t[87]!==lt||t[88]!==m?(ut=function(e){let t=null,r,i,a,o=!1,ee=null;if(S(n=>{let{state:te,sideEffect:s}=be(n,e);return s&&(t=s.reason,r=s.helper,i=s.authFailed,a=s.notFoundAsIdentity,o=te.phase===`dismissed`),te.phase===`opening-worktree`&&(ee=te.path),te}),t!==null&&(console.log(h({branch_dialog_action:`open-worktree-failed:${t}`,branch:D})),lt(t,{helper:r,authFailed:i,notFoundAsIdentity:a})),ee!==null){p();let e=ee;n.project.open({path:e,target:`new-window`,entryPoint:`worktree`,pendingDeepLinkTarget:Se(T),pendingBranch:D}).catch(t=>{console.warn(`[receive] worktree-open-failed branch_dialog_action=open-worktree`,t instanceof Error?t.message:t),c.error(v({id:`LdABLa`,values:{target:e}}))}),m.dismiss()}o&&m.dismiss()},t[83]=v,t[84]=n.project,t[85]=T,t[86]=D,t[87]=lt,t[88]=m,t[89]=ut):ut=t[89];let dt=ut,ft;t[90]!==dt||t[91]!==x.phase||t[92]!==n.worktree||t[93]!==D?(ft=function(){x.phase===`ready`&&(console.log(h({branch_dialog_action:`open-worktree`,branch:D})),S(he),n.worktree.checkout({branch:D}).then(e=>{dt(e)}).catch(e=>{console.warn(`[receive] worktree-checkout rejected branch_dialog_action=open-worktree`,e instanceof Error?e.message:e),dt(null)}))},t[90]=dt,t[91]=x.phase,t[92]=n.worktree,t[93]=D,t[94]=ft):ft=t[94];let pt=ft,mt;t[95]!==v||t[96]!==x.otherWorktreePath||t[97]!==x.phase||t[98]!==n.project||t[99]!==T||t[100]!==D||t[101]!==m?(mt=function(){if(x.phase!==`branch-in-other-worktree`)return;let e=x.otherWorktreePath;console.log(h({branch_dialog_action:`pivot-to-other-worktree`,branch:D})),n.project.open({path:e,target:`new-window`,entryPoint:`share-receive`,pendingDeepLinkTarget:Se(T),pendingBranch:D}).catch(t=>{console.warn(`[receive] pivot-open-failed branch_action=pivot-to-other-worktree`,t instanceof Error?t.message:t),c.error(v({id:`LdABLa`,values:{target:e}}))}),m.dismiss()},t[95]=v,t[96]=x.otherWorktreePath,t[97]=x.phase,t[98]=n.project,t[99]=T,t[100]=D,t[101]=m,t[102]=mt):mt=t[102];let ht=mt,gt;t[103]!==x.phase||t[104]!==x.resolution||t[105]!==m?(gt=function(){console.log(h({branch_dialog_action:`cancel`,verdict_cell:x.phase===`verdict`?x.resolution.kind:void 0})),m.dismiss()},t[103]=x.phase,t[104]=x.resolution,t[105]=m,t[106]=gt):gt=t[106];let k=gt,A,j,M,N,P,F,I,L,R,z,B,V,H,U,W,G,K,q,J;if(t[107]!==v||t[108]!==x.info||t[109]!==x.otherWorktreePath||t[110]!==x.phase||t[111]!==x.resolution||t[112]!==k||t[113]!==Xe||t[114]!==T.branch||t[115]!==T.owner||t[116]!==T.repo||t[117]!==T.target||t[118]!==D||t[119]!==w){q=x.phase===`ready`||x.phase===`switching`||x.phase===`creating-worktree`?ue(x.info):null;let e;t[139]!==x.info||t[140]!==x.phase||t[141]!==Xe?(e=x.phase===`ready`||x.phase===`switching`||x.phase===`creating-worktree`?de(x.info):Xe??`HEAD`,t[139]=x.info,t[140]=x.phase,t[141]=Xe,t[142]=e):e=t[142];let n=e;I=x.phase===`switching`||x.phase===`awaiting-cc1-recycle`,N=x.phase===`creating-worktree`;let i;t[143]===v?i=t[144]:(i=v({id:`OuY8t9`}),t[143]=v,t[144]=i),P=i;let a;t[145]===v?a=t[146]:(a=v({id:`XZkdtg`}),t[145]=v,t[146]=a),F=a;let o;t[147]===v?o=t[148]:(o=v({id:`VTulZj`}),t[147]=v,t[148]=o),J=o;let re=x.phase===`loading`,c=x.phase===`error`;M=ae,G=!0,t[149]===k?K=t[150]:(K=e=>{e||k()},t[149]=k,t[150]=K),j=s,B=`sm:max-w-xl`,V=`share-branch-switch-dialog`,H=Ee,U=Te;let u;t[151]===w?u=t[152]:(u=(0,y.jsx)(te,{children:(0,y.jsx)(r,{id:`RY6Bq1`,values:{targetNoun:w}})}),t[151]=w,t[152]=u);let oe=T.owner,se=T.repo,f;t[153]===T.target?f=t[154]:(f=l(T.target),t[153]=T.target,t[154]=f);let p;t[155]!==T.owner||t[156]!==T.repo||t[157]!==f?(p=(0,y.jsx)(ee,{className:`sr-only`,children:(0,y.jsx)(r,{id:`f8jU-L`,values:{0:oe,1:se,2:f}})}),t[155]=T.owner,t[156]=T.repo,t[157]=f,t[158]=p):p=t[158],t[159]!==u||t[160]!==p?(W=(0,y.jsxs)(ie,{children:[u,p]}),t[159]=u,t[160]=p,t[161]=W):W=t[161],A=ne;let m=T.owner,h=T.repo,g;t[162]===T.target?g=t[163]:(g=l(T.target),t[162]=T.target,t[163]=g),t[164]!==T.branch||t[165]!==T.owner||t[166]!==T.repo||t[167]!==T.target.kind||t[168]!==g?(L=(0,y.jsx)(`div`,{className:`mb-4`,children:(0,y.jsx)(ce,{owner:m,repo:h,path:g,kind:T.target.kind,branch:T.branch,testId:`share-branch-switch-metadata`,branchTestId:`share-branch-switch-metadata-branch`})}),t[164]=T.branch,t[165]=T.owner,t[166]=T.repo,t[167]=T.target.kind,t[168]=g,t[169]=L):L=t[169],R=x.phase===`branch-in-other-worktree`?(0,y.jsxs)(`div`,{className:`text-sm text-muted-foreground`,"data-testid":`share-branch-switch-in-other-worktree`,children:[(0,y.jsx)(`p`,{className:`leading-6`,children:(0,y.jsx)(r,{id:`yjExfe`,values:{shareBranch:D},components:{0:(0,y.jsx)(`code`,{className:`rounded-sm bg-muted px-1 py-0.5 text-foreground/80`})}})}),(0,y.jsx)(`p`,{className:`mt-2 break-all rounded bg-muted px-2 py-1 font-mono text-xs text-foreground/80`,"data-testid":`share-branch-switch-in-other-worktree-path`,children:x.otherWorktreePath})]}):x.phase===`verdict-pending`?(0,y.jsxs)(`p`,{className:`flex items-center gap-2 text-sm text-muted-foreground`,"data-testid":`share-branch-switch-verdict-pending`,role:`status`,"aria-live":`polite`,children:[(0,y.jsx)(d,{className:`h-4 w-4`,"aria-hidden":`true`}),(0,y.jsx)(r,{id:`c8jBgX`})]}):x.phase===`verdict`?x.resolution.kind===`on-origin`?(0,y.jsx)(`p`,{className:`text-sm leading-6 text-muted-foreground`,"data-testid":`share-branch-switch-verdict-on-origin`,children:(0,y.jsx)(r,{id:`Uay5NL`,values:{targetNoun:w,shareBranch:D},components:{0:(0,y.jsx)(`code`,{className:`rounded-sm bg-muted px-1 py-0.5 text-foreground/80`})}})}):x.resolution.kind===`renamed`?(0,y.jsx)(`p`,{className:`text-sm leading-6 text-muted-foreground`,"data-testid":`share-branch-switch-verdict-renamed`,children:(0,y.jsx)(r,{id:`P0HC30`,values:{0:x.resolution.renamedTo,targetNoun:w},components:{0:(0,y.jsx)(`code`,{className:`rounded-sm bg-muted px-1 py-0.5 text-foreground/80`})}})}):x.resolution.kind===`diverged`?(0,y.jsx)(`p`,{className:`text-sm leading-6 text-muted-foreground`,"data-testid":`share-branch-switch-verdict-diverged`,children:(0,y.jsx)(r,{id:`kLv8d3`,values:{shareBranch:D,targetNoun:w},components:{0:(0,y.jsx)(`code`,{className:`rounded-sm bg-muted px-1 py-0.5 text-foreground/80`})}})}):(0,y.jsxs)(`p`,{className:`flex items-center gap-2 text-sm text-muted-foreground`,"data-testid":`share-branch-switch-verdict-handoff`,role:`status`,"aria-live":`polite`,children:[(0,y.jsx)(d,{className:`h-4 w-4`,"aria-hidden":`true`}),(0,y.jsx)(r,{id:`c8jBgX`})]}):re?(0,y.jsxs)(`p`,{className:`flex items-center gap-2 text-sm text-muted-foreground`,"data-testid":`share-branch-switch-loading`,role:`status`,"aria-live":`polite`,children:[(0,y.jsx)(d,{className:`h-4 w-4`,"aria-hidden":`true`}),(0,y.jsx)(r,{id:`jerqF0`})]}):c?(0,y.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:(0,y.jsx)(r,{id:`w4hMYl`})}):q?.kind===`D`?(0,y.jsx)(`p`,{className:`text-sm leading-6 text-muted-foreground`,children:(0,y.jsx)(r,{id:`DTI-fp`,values:{targetNoun:w,shareBranch:D},components:{0:(0,y.jsx)(`code`,{className:`rounded-sm bg-muted px-1 py-0.5 text-foreground/80`})}})}):q?.kind===`B`?(0,y.jsx)(`p`,{className:`text-sm leading-6 text-muted-foreground`,children:(0,y.jsx)(r,{id:`sZ2IOu`,values:{targetNoun:w,shareBranch:D,currentLabel:n},components:{0:(0,y.jsx)(`code`,{className:`rounded-sm bg-muted px-1 py-0.5 text-foreground/80`}),1:(0,y.jsx)(`code`,{className:`rounded-sm bg-muted px-1 py-0.5 text-foreground/80`})}})}):(0,y.jsx)(`p`,{className:`text-sm leading-6 text-muted-foreground`,children:(0,y.jsx)(r,{id:`_902BE`,values:{targetNoun:w,shareBranch:D,currentLabel:n},components:{0:(0,y.jsx)(`code`,{className:`rounded-sm bg-muted px-1 py-0.5 text-foreground/80`}),1:(0,y.jsx)(`code`,{className:`rounded-sm bg-muted px-1 py-0.5 text-foreground/80`})}})}),z=q&&!q.switchEnabled&&q.conflictingFiles.length>0?(0,y.jsxs)(`div`,{className:`mt-3 rounded-md border border-border bg-muted/30 p-3 text-1sm`,"data-testid":`share-branch-switch-conflict`,children:[(0,y.jsx)(`p`,{className:`font-medium text-foreground/90`,children:(0,y.jsx)(r,{id:`n2lRue`})}),(0,y.jsx)(`ul`,{id:`share-receive-branch-conflict-files`,className:`mt-1 list-disc space-y-0.5 pl-5 text-muted-foreground`,children:q.conflictingFiles.map(we)})]}):null,t[107]=v,t[108]=x.info,t[109]=x.otherWorktreePath,t[110]=x.phase,t[111]=x.resolution,t[112]=k,t[113]=Xe,t[114]=T.branch,t[115]=T.owner,t[116]=T.repo,t[117]=T.target,t[118]=D,t[119]=w,t[120]=A,t[121]=j,t[122]=M,t[123]=N,t[124]=P,t[125]=F,t[126]=I,t[127]=L,t[128]=R,t[129]=z,t[130]=B,t[131]=V,t[132]=H,t[133]=U,t[134]=W,t[135]=G,t[136]=K,t[137]=q,t[138]=J}else A=t[120],j=t[121],M=t[122],N=t[123],P=t[124],F=t[125],I=t[126],L=t[127],R=t[128],z=t[129],B=t[130],V=t[131],H=t[132],U=t[133],W=t[134],G=t[135],K=t[136],q=t[137],J=t[138];let Y;t[170]===I?Y=t[171]:(Y=I?(0,y.jsxs)(`p`,{className:`mt-3 flex items-center gap-2 text-sm text-muted-foreground`,"data-testid":`share-branch-switch-switching`,role:`status`,"aria-live":`polite`,children:[(0,y.jsx)(d,{className:`h-4 w-4`,"aria-hidden":`true`}),(0,y.jsx)(r,{id:`CU3AiE`})]}):null,t[170]=I,t[171]=Y);let X;t[172]===N?X=t[173]:(X=N?(0,y.jsxs)(`p`,{className:`mt-3 flex items-center gap-2 text-sm text-muted-foreground`,"data-testid":`share-branch-switch-creating-worktree`,role:`status`,"aria-live":`polite`,children:[(0,y.jsx)(d,{className:`h-4 w-4`,"aria-hidden":`true`}),(0,y.jsx)(r,{id:`PZtgO0`})]}):null,t[172]=N,t[173]=X);let Z;t[174]!==A||t[175]!==L||t[176]!==R||t[177]!==z||t[178]!==Y||t[179]!==X?(Z=(0,y.jsxs)(A,{children:[L,R,z,Y,X]}),t[174]=A,t[175]=L,t[176]=R,t[177]=z,t[178]=Y,t[179]=X,t[180]=Z):Z=t[180];let _t;t[181]===Symbol.for(`react.memo_cache_sentinel`)?(_t=(0,y.jsx)(r,{id:`dEgA5A`}),t[181]=_t):_t=t[181];let Q;t[182]===k?Q=t[183]:(Q=(0,y.jsx)(o,{variant:`ghost`,onClick:k,"data-testid":`share-branch-switch-cancel`,children:_t}),t[182]=k,t[183]=Q);let vt;t[184]!==x.phase||t[185]!==x.resolution||t[186]!==N||t[187]!==st||t[188]!==rt||t[189]!==pt||t[190]!==ht||t[191]!==at||t[192]!==$e||t[193]!==tt||t[194]!==P||t[195]!==F||t[196]!==I||t[197]!==q||t[198]!==J?(vt=x.phase===`branch-in-other-worktree`?(0,y.jsx)(o,{onClick:ht,"data-testid":`share-branch-switch-in-other-worktree-pivot`,children:(0,y.jsx)(r,{id:`hyCxJY`})}):x.phase===`verdict`?x.resolution.kind===`on-origin`?(0,y.jsxs)(o,{onClick:tt,"data-testid":`share-branch-switch-verdict-switch-update`,children:[(0,y.jsx)(oe,{className:`size-3.5`,"aria-hidden":!0}),(0,y.jsx)(r,{id:`uA_jXp`})]}):x.resolution.kind===`renamed`?(0,y.jsxs)(o,{onClick:rt,"data-testid":`share-branch-switch-verdict-open-renamed`,children:[(0,y.jsx)(se,{className:`size-3.5`,"aria-hidden":!0}),(0,y.jsx)(r,{id:`AItsE5`})]}):x.resolution.kind===`diverged`?(0,y.jsxs)(o,{onClick:at,"data-testid":`share-branch-switch-verdict-plain-switch`,children:[(0,y.jsx)(oe,{className:`size-3.5`,"aria-hidden":!0}),F]}):null:(0,y.jsxs)(`div`,{className:`flex min-w-0 flex-col-reverse gap-2 sm:flex-row sm:flex-wrap sm:justify-end sm:gap-2`,children:[q?.openCurrentEnabled?(0,y.jsxs)(o,{variant:`outline`,onClick:st,disabled:I||N,"data-testid":`share-branch-switch-open-current`,children:[(0,y.jsx)(se,{className:`size-3.5`,"aria-hidden":!0}),P]}):null,(0,y.jsx)(o,{variant:`outline`,onClick:$e,disabled:!q?.switchEnabled||I||N,"aria-disabled":!q?.switchEnabled||I||N,"aria-describedby":q&&!q.switchEnabled&&q.conflictingFiles.length>0?`share-receive-branch-conflict-files`:void 0,"data-testid":`share-branch-switch-switch`,children:I?(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(d,{className:`size-3.5`,"aria-hidden":`true`}),F]}):(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(oe,{className:`size-3.5`,"aria-hidden":!0}),F]})}),(0,y.jsx)(o,{onClick:pt,disabled:!q||I||N,"data-testid":`share-branch-switch-worktree`,children:N?(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(d,{className:`size-3.5`,"aria-hidden":`true`}),J]}):(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(u,{className:`size-3.5`,"aria-hidden":!0}),J]})})]}),t[184]=x.phase,t[185]=x.resolution,t[186]=N,t[187]=st,t[188]=rt,t[189]=pt,t[190]=ht,t[191]=at,t[192]=$e,t[193]=tt,t[194]=P,t[195]=F,t[196]=I,t[197]=q,t[198]=J,t[199]=vt):vt=t[199];let yt;t[200]!==Q||t[201]!==vt?(yt=(0,y.jsxs)(re,{className:`sm:justify-between`,children:[Q,vt]}),t[200]=Q,t[201]=vt,t[202]=yt):yt=t[202];let $;t[203]!==j||t[204]!==B||t[205]!==V||t[206]!==H||t[207]!==U||t[208]!==W||t[209]!==Z||t[210]!==yt?($=(0,y.jsxs)(j,{className:B,"data-testid":V,onInteractOutside:H,onPointerDownOutside:U,children:[W,Z,yt]}),t[203]=j,t[204]=B,t[205]=V,t[206]=H,t[207]=U,t[208]=W,t[209]=Z,t[210]=yt,t[211]=$):$=t[211];let bt;return t[212]!==M||t[213]!==G||t[214]!==K||t[215]!==$?(bt=(0,y.jsx)(M,{open:G,onOpenChange:K,children:$}),t[212]=M,t[213]=G,t[214]=K,t[215]=$,t[216]=bt):bt=t[216],bt}function we(e){return(0,y.jsx)(`li`,{children:(0,y.jsx)(`code`,{className:`text-foreground/80`,children:e})},e)}function Te(e){e.preventDefault()}function Ee(e){e.preventDefault()}function De(){return m.request()}function Oe(e){return ye(e,null).state}function ke(e){return ve(e,null)}function Ae(e){return pe(e,null)}function je(){return null}export{b as ShareBranchSwitchDialog};
1
+ import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./jsx-runtime-BUgB2tll.js";import{t as n}from"./react-f2sANaYj.js";import{n as r,r as i}from"./dist-Nvb76hAm.js";import{t as a}from"./compiler-runtime-BfE3aGVn.js";import{t as o}from"./button-Cym3gapE.js";import{a as ee,c as te,i as s,n as ne,o as re,s as ie,t as ae}from"./dialog-DgIQr9zS.js";import{n as c}from"./dist-CJhtNlOm2.js";import{t as l}from"./desktop-bridge-types-oYPdTDmz.js";import{n as u,t as oe}from"./git-branch-B_QTfwFA.js";import{t as d}from"./spinner-Bp2_BYkl.js";import{n as se,t as f}from"./miss-dialog-store-CNJRdTPE.js";import{r as p,t as m}from"./auth-prompt-store-DfthAUSi.js";import{a as h,n as g}from"./receive-store-C_l3XIQE.js";import{t as ce}from"./share-metadata-rows-Bj7HLyQc.js";var _=e(n(),1),le=a();function ue(e){let t=e.shareTargetExists,n=e.dirtyConflicts.conflicts,r=e.dirtyConflicts.files;return t&&!n?{kind:`A`,openCurrentEnabled:!0,switchEnabled:!0,conflictingFiles:r}:!t&&!n?{kind:`B`,openCurrentEnabled:!1,switchEnabled:!0,conflictingFiles:r}:t&&n?{kind:`C`,openCurrentEnabled:!0,switchEnabled:!1,conflictingFiles:r}:{kind:`D`,openCurrentEnabled:!1,switchEnabled:!1,conflictingFiles:r}}function de(e){return e.detached?e.currentHeadSha:e.currentBranch??`HEAD`}function v(e){if(e.ok)return{action:`await-cc1`};switch(e.reason){case`dirty-conflict`:return{action:`rerender-conflict`,files:e.files??[]};case`branch-not-found`:return{action:`dismiss-with-toast`,reason:`branch-not-found`};case`fetch-failed`:case`checkout-failed`:return{action:`stay-with-toast`,reason:e.reason};case`branch-in-other-worktree`:{let t=e.otherWorktreePath;return t===void 0||t.length===0?{action:`stay-with-toast`,reason:`checkout-failed`}:{action:`pivot-to-other-worktree`,otherWorktreePath:t}}case`ff-diverged`:return{action:`branch-diverged`};default:{let t=e.reason;throw Error(`Unhandled CheckoutFailureReason: ${String(t)}`)}}}var fe={phase:`loading`};function pe(e,t){return e.phase===`loading`?t===null?{phase:`error`}:{phase:`ready`,info:t}:e}function me(e,t){return e.phase!==`ready`&&e.phase!==`verdict`?e:{phase:`switching`,info:e.info,pendingDoc:t}}function he(e){return e.phase===`ready`?{phase:`creating-worktree`,info:e.info}:e}function ge(e){return ue(e).kind===`B`&&e.shareTargetOnOriginBranch===!1}function _e(e){return e.phase===`ready`?{phase:`verdict-pending`,info:e.info}:e}function ve(e,t){if(e.phase!==`verdict-pending`)return e;if(t===null||t.verdict===`unknown`||t.verdict===`changed-locally`)return{phase:`ready`,info:e.info};let n=t.verdict===`renamed`?{kind:`renamed`,renamedTo:t.renamedTo}:{kind:t.verdict};return{phase:`verdict`,info:e.info,resolution:n}}function ye(e,t){if(e.phase!==`switching`)return{state:e};if(t===null)return{state:{phase:`ready`,info:e.info},sideEffect:{kind:`toast`,reason:`proxy-null`}};let n=v(t);return n.action===`await-cc1`?{state:{phase:`awaiting-cc1-recycle`,pendingDoc:e.pendingDoc}}:n.action===`rerender-conflict`?{state:{phase:`ready`,info:{...e.info,dirtyConflicts:{conflicts:!0,files:n.files.slice()}}}}:n.action===`pivot-to-other-worktree`?{state:{phase:`branch-in-other-worktree`,info:e.info,otherWorktreePath:n.otherWorktreePath,pendingDoc:e.pendingDoc}}:n.action===`dismiss-with-toast`?{state:{phase:`dismissed`,reason:n.reason},sideEffect:{kind:`toast`,reason:n.reason}}:n.action===`branch-diverged`?{state:{phase:`verdict`,info:e.info,resolution:{kind:`diverged`}}}:{state:{phase:`ready`,info:e.info},sideEffect:{kind:`toast`,reason:n.reason}}}function be(e,t){return e.phase===`creating-worktree`?t===null?{state:{phase:`ready`,info:e.info},sideEffect:{kind:`toast`,reason:`proxy-null`}}:t.ok?{state:{phase:`opening-worktree`,path:t.path}}:t.reason===`branch-not-found`?{state:{phase:`dismissed`,reason:`branch-not-found`},sideEffect:{kind:`toast`,reason:`branch-not-found`}}:{state:{phase:`ready`,info:e.info},sideEffect:{kind:`toast`,reason:t.reason,helper:t.helper,authFailed:t.reason===`fetch-failed`?t.authFailed:void 0,notFoundAsIdentity:t.reason===`fetch-failed`?t.notFoundAsIdentity:void 0}}:{state:e}}var y=t();function xe(e){return l(e.repositoryTarget)}function Se(e,t=l(e.target)){let n=e.contentRootDepth===null?t:[...xe(e).split(`/`).slice(0,e.contentRootDepth),...t===``?[]:t.split(`/`)].join(`/`);return{kind:e.target.kind,path:t,repositoryPath:n,...e.contentRootDepth===null?{}:{contentRootDepth:e.contentRootDepth}}}function Ce(e){return e!==null&&e.kind===`project-branch-switch`}function b(e){let t=(0,le.c)(217),{bridge:n,store:a}=e,m=a===void 0?g:a,{_:v}=i(),b=(0,_.useSyncExternalStore)(m.subscribe,m.getSnapshot,je),[x,S]=(0,_.useState)(fe),Me=(0,_.useRef)(!1),Ne=(0,_.useRef)(!1),Pe=(0,_.useRef)(!1),Fe=(0,_.useRef)(null),Ie;t[0]===b?Ie=t[1]:(Ie=Ce(b)?b:null,t[0]=b,t[1]=Ie);let C=Ie,Le;t[2]!==v||t[3]!==C?.share.target.kind?(Le=C?.share.target.kind===`folder`?v({id:`ugoTXs`}):v({id:`XH30C4`}),t[2]=v,t[3]=C?.share.target.kind,t[4]=Le):Le=t[4];let w=Le,Re;t[5]===C?Re=t[6]:(Re=()=>{S(fe),Me.current=!1,Ne.current=!1,Pe.current=!1,Fe.current=C},t[5]=C,t[6]=Re);let ze;t[7]===b?ze=t[8]:(ze=[b],t[7]=b,t[8]=ze),(0,_.useEffect)(Re,ze);let Be;t[9]!==C||t[10]!==n?(Be=()=>{if(!C||Me.current)return;Me.current=!0;let e=!1;return n.project.fetchBranchInfo({projectPath:C.projectPath,branch:C.share.branch,kind:C.share.repositoryTarget.kind,path:xe(C.share)}).then(t=>{e||S(e=>pe(e,t))}).catch(t=>{e||(console.warn(`[receive] branch-info-fetch-failed`,t instanceof Error?t.message:t),S(Ae))}),()=>{e=!0}},t[9]=C,t[10]=n,t[11]=Be):Be=t[11];let Ve;t[12]===C?Ve=t[13]:(Ve=[C],t[12]=C,t[13]=Ve),(0,_.useEffect)(Be,Ve);let He;t[14]!==C||t[15]!==x.info||t[16]!==x.phase||t[17]!==n?(He=()=>{if(!C||x.phase!==`ready`||Pe.current||!ge(x.info))return;Pe.current=!0,S(_e);let e=C;n.project.fetchTargetStatus({projectPath:C.projectPath,branch:C.share.branch,kind:C.share.target.kind,path:xe(C.share),...C.share.contentRootDepth===null?{}:{contentRootDepth:C.share.contentRootDepth}}).then(t=>{Fe.current===e&&S(e=>ve(e,t))}).catch(t=>{Fe.current===e&&(console.warn(`[receive] target-status-fetch-failed`,t instanceof Error?t.message:t),S(ke))})},t[14]=C,t[15]=x.info,t[16]=x.phase,t[17]=n,t[18]=He):He=t[18];let Ue;t[19]!==C||t[20]!==x.phase?(Ue=[x.phase,C],t[19]=C,t[20]=x.phase,t[21]=Ue):Ue=t[21],(0,_.useEffect)(He,Ue);let We;t[22]!==C||t[23]!==x.phase||t[24]!==x.resolution||t[25]!==m?(We=()=>{if(x.phase!==`verdict`)return;let{kind:e}=x.resolution;e!==`deleted`&&e!==`never-on-branch`||C&&(f.arm({kind:C.share.target.kind,path:l(C.share.target),repositoryPath:xe(C.share),...C.share.contentRootDepth===null?{}:{contentRootDepth:C.share.contentRootDepth},branch:C.share.branch}),m.dismiss())},t[22]=C,t[23]=x.phase,t[24]=x.resolution,t[25]=m,t[26]=We):We=t[26];let Ge;t[27]!==C||t[28]!==x||t[29]!==m?(Ge=[x,C,m],t[27]=C,t[28]=x,t[29]=m,t[30]=Ge):Ge=t[30],(0,_.useEffect)(We,Ge);let Ke;t[31]!==x.phase||t[32]!==x.resolution?(Ke=()=>{x.phase===`verdict`&&console.log(h({verdict_cell:x.resolution.kind}))},t[31]=x.phase,t[32]=x.resolution,t[33]=Ke):Ke=t[33];let qe;t[34]===x?qe=t[35]:(qe=[x],t[34]=x,t[35]=qe),(0,_.useEffect)(Ke,qe);let Je;t[36]!==v||t[37]!==C||t[38]!==x.pendingDoc||t[39]!==x.phase||t[40]!==n||t[41]!==m||t[42]!==w?(Je=()=>{if(x.phase!==`awaiting-cc1-recycle`||!C)return;let e=C.share.branch,t=x.pendingDoc;if(!e){m.dismiss();return}if(Ne.current)return;Ne.current=!0;let r=!1;return n.project.awaitBranchSwitched({projectPath:C.projectPath,branch:e,timeoutMs:3e4}).then(i=>{if(!r){if(i.ok){console.log(h({branch_dialog_action:`branch-switch-complete`,branch:e})),n.project.open({path:C.projectPath,target:`new-window`,entryPoint:`share-receive`,pendingDeepLinkTarget:Se(C.share,t),pendingBranch:e}).catch(e=>{console.warn(`[receive] warm-focus-dispatch-failed branch_action=switch`,e instanceof Error?e.message:e),c.error(v({id:`gQV-9w`,values:{targetNoun:w}}))}),m.dismiss();return}console.log(h({branch_dialog_action:`branch-switch-timeout`,branch:e})),c.error(v({id:`LBwUR6`,values:{targetNoun:w}})),m.dismiss()}}).catch(e=>{r||(console.warn(`[receive] awaitBranchSwitched rejected`,e instanceof Error?e.message:e),c.error(v({id:`Jw6EC4`,values:{targetNoun:w}})),m.dismiss())}),()=>{r=!0}},t[36]=v,t[37]=C,t[38]=x.pendingDoc,t[39]=x.phase,t[40]=n,t[41]=m,t[42]=w,t[43]=Je):Je=t[43];let Ye;if(t[44]!==C||t[45]!==x.phase?(Ye=[x.phase,C],t[44]=C,t[45]=x.phase,t[46]=Ye):Ye=t[46],(0,_.useEffect)(Je,Ye),!C)return null;let{share:T,projectPath:E,currentBranch:Xe}=C,D=T.branch,Ze;t[47]!==v||t[48]!==n.project||t[49]!==E||t[50]!==D||t[51]!==m?(Ze=function(e,t,r){console.log(h({branch_dialog_action:`switch`,branch_action:`switch`,branch:D,verdict_cell:r})),S(t=>me(t,e)),n.project.runCheckout(t?{projectPath:E,branch:D,fastForward:!0}:{projectPath:E,branch:D}).then(e=>{let t=null,n=!1;S(r=>{let{state:i,sideEffect:a}=ye(r,e);return a&&(t=a.reason,n=i.phase===`dismissed`),i}),t===`branch-not-found`?c.error(v({id:`NJyQi_`,values:{shareBranch:D}})):t===`fetch-failed`?c.error(v({id:`bWLmRK`})):(t===`checkout-failed`||t===`proxy-null`)&&c.error(v({id:`c863eW`,values:{shareBranch:D}})),n&&m.dismiss()}).catch(e=>{console.warn(`[receive] runCheckout rejected branch_action=switch`,e instanceof Error?e.message:e),S(Oe),c.error(v({id:`c863eW`,values:{shareBranch:D}}))})},t[47]=v,t[48]=n.project,t[49]=E,t[50]=D,t[51]=m,t[52]=Ze):Ze=t[52];let O=Ze,Qe;t[53]!==x.info||t[54]!==x.phase||t[55]!==O||t[56]!==T.target?(Qe=function(){x.phase===`ready`&&ue(x.info).switchEnabled&&O(l(T.target),!1)},t[53]=x.info,t[54]=x.phase,t[55]=O,t[56]=T.target,t[57]=Qe):Qe=t[57];let $e=Qe,et;t[58]!==x.phase||t[59]!==x.resolution||t[60]!==O||t[61]!==T.target?(et=function(){x.phase===`verdict`&&O(l(T.target),!0,x.resolution.kind)},t[58]=x.phase,t[59]=x.resolution,t[60]=O,t[61]=T.target,t[62]=et):et=t[62];let tt=et,nt;t[63]!==x.phase||t[64]!==x.resolution||t[65]!==O?(nt=function(){x.phase===`verdict`&&x.resolution.kind===`renamed`&&O(x.resolution.renamedTo,!0,x.resolution.kind)},t[63]=x.phase,t[64]=x.resolution,t[65]=O,t[66]=nt):nt=t[66];let rt=nt,it;t[67]!==x.phase||t[68]!==x.resolution||t[69]!==O||t[70]!==T.target?(it=function(){x.phase===`verdict`&&O(l(T.target),!1,x.resolution.kind)},t[67]=x.phase,t[68]=x.resolution,t[69]=O,t[70]=T.target,t[71]=it):it=t[71];let at=it,ot;t[72]!==v||t[73]!==n.project||t[74]!==E||t[75]!==T||t[76]!==D||t[77]!==m||t[78]!==w?(ot=function(){console.log(h({branch_dialog_action:`open-current`,branch:D})),n.project.open({path:E,target:`new-window`,entryPoint:`share-receive`,pendingDeepLinkTarget:Se(T)}).catch(e=>{console.warn(`[receive] warm-focus-dispatch-failed branch_action=open-current`,e instanceof Error?e.message:e),c.error(v({id:`b5aNbi`,values:{targetNoun:w}}))}),m.dismiss()},t[72]=v,t[73]=n.project,t[74]=E,t[75]=T,t[76]=D,t[77]=m,t[78]=w,t[79]=ot):ot=t[79];let st=ot,ct;t[80]!==v||t[81]!==D?(ct=function(e,t){let{helper:n,authFailed:r,notFoundAsIdentity:i}=t===void 0?{}:t;if(e===`fetch-failed`&&i){c.error(v({id:`jRsjlF`}));return}if(e===`fetch-failed`&&r){c.error(v({id:`gfb-CM`}),{action:{label:v({id:`5lWFkC`}),onClick:De}});return}switch(e){case`helper-not-found`:{let e=n??v({id:`cHhH3i`});c.error(v({id:`Z7x_Zh`,values:{tool:e}}));return}case`branch-not-found`:c.error(v({id:`NJyQi_`,values:{shareBranch:D}}));return;case`fetch-failed`:c.error(v({id:`bWLmRK`}));return;case`already-checked-out`:c.error(v({id:`ljHjfg`}));return;case`branch-exists`:c.error(v({id:`h3QZcB`,values:{shareBranch:D}}));return;case`path-exists`:c.error(v({id:`cN1Gcp`,values:{shareBranch:D}}));return;case`no-git`:c.error(v({id:`CFnavk`}));return;case`empty-repo`:c.error(v({id:`5IgYAM`}));return;case`invalid-branch`:c.error(v({id:`JfPuv7`,values:{shareBranch:D}}));return;case`proxy-null`:case`error`:c.error(v({id:`e8zYa8`,values:{shareBranch:D}}));return;default:throw Error(`Unhandled worktree failure reason: ${String(e)}`)}},t[80]=v,t[81]=D,t[82]=ct):ct=t[82];let lt=ct,ut;t[83]!==v||t[84]!==n.project||t[85]!==T||t[86]!==D||t[87]!==lt||t[88]!==m?(ut=function(e){let t=null,r,i,a,o=!1,ee=null;if(S(n=>{let{state:te,sideEffect:s}=be(n,e);return s&&(t=s.reason,r=s.helper,i=s.authFailed,a=s.notFoundAsIdentity,o=te.phase===`dismissed`),te.phase===`opening-worktree`&&(ee=te.path),te}),t!==null&&(console.log(h({branch_dialog_action:`open-worktree-failed:${t}`,branch:D})),lt(t,{helper:r,authFailed:i,notFoundAsIdentity:a})),ee!==null){p();let e=ee;n.project.open({path:e,target:`new-window`,entryPoint:`worktree`,pendingDeepLinkTarget:Se(T),pendingBranch:D}).catch(t=>{console.warn(`[receive] worktree-open-failed branch_dialog_action=open-worktree`,t instanceof Error?t.message:t),c.error(v({id:`LdABLa`,values:{target:e}}))}),m.dismiss()}o&&m.dismiss()},t[83]=v,t[84]=n.project,t[85]=T,t[86]=D,t[87]=lt,t[88]=m,t[89]=ut):ut=t[89];let dt=ut,ft;t[90]!==dt||t[91]!==x.phase||t[92]!==n.worktree||t[93]!==D?(ft=function(){x.phase===`ready`&&(console.log(h({branch_dialog_action:`open-worktree`,branch:D})),S(he),n.worktree.checkout({branch:D}).then(e=>{dt(e)}).catch(e=>{console.warn(`[receive] worktree-checkout rejected branch_dialog_action=open-worktree`,e instanceof Error?e.message:e),dt(null)}))},t[90]=dt,t[91]=x.phase,t[92]=n.worktree,t[93]=D,t[94]=ft):ft=t[94];let pt=ft,mt;t[95]!==v||t[96]!==x.otherWorktreePath||t[97]!==x.phase||t[98]!==n.project||t[99]!==T||t[100]!==D||t[101]!==m?(mt=function(){if(x.phase!==`branch-in-other-worktree`)return;let e=x.otherWorktreePath;console.log(h({branch_dialog_action:`pivot-to-other-worktree`,branch:D})),n.project.open({path:e,target:`new-window`,entryPoint:`share-receive`,pendingDeepLinkTarget:Se(T),pendingBranch:D}).catch(t=>{console.warn(`[receive] pivot-open-failed branch_action=pivot-to-other-worktree`,t instanceof Error?t.message:t),c.error(v({id:`LdABLa`,values:{target:e}}))}),m.dismiss()},t[95]=v,t[96]=x.otherWorktreePath,t[97]=x.phase,t[98]=n.project,t[99]=T,t[100]=D,t[101]=m,t[102]=mt):mt=t[102];let ht=mt,gt;t[103]!==x.phase||t[104]!==x.resolution||t[105]!==m?(gt=function(){console.log(h({branch_dialog_action:`cancel`,verdict_cell:x.phase===`verdict`?x.resolution.kind:void 0})),m.dismiss()},t[103]=x.phase,t[104]=x.resolution,t[105]=m,t[106]=gt):gt=t[106];let k=gt,A,j,M,N,P,F,I,L,R,z,B,V,H,U,W,G,K,q,J;if(t[107]!==v||t[108]!==x.info||t[109]!==x.otherWorktreePath||t[110]!==x.phase||t[111]!==x.resolution||t[112]!==k||t[113]!==Xe||t[114]!==T.branch||t[115]!==T.owner||t[116]!==T.repo||t[117]!==T.target||t[118]!==D||t[119]!==w){q=x.phase===`ready`||x.phase===`switching`||x.phase===`creating-worktree`?ue(x.info):null;let e;t[139]!==x.info||t[140]!==x.phase||t[141]!==Xe?(e=x.phase===`ready`||x.phase===`switching`||x.phase===`creating-worktree`?de(x.info):Xe??`HEAD`,t[139]=x.info,t[140]=x.phase,t[141]=Xe,t[142]=e):e=t[142];let n=e;I=x.phase===`switching`||x.phase===`awaiting-cc1-recycle`,N=x.phase===`creating-worktree`;let i;t[143]===v?i=t[144]:(i=v({id:`OuY8t9`}),t[143]=v,t[144]=i),P=i;let a;t[145]===v?a=t[146]:(a=v({id:`XZkdtg`}),t[145]=v,t[146]=a),F=a;let o;t[147]===v?o=t[148]:(o=v({id:`VTulZj`}),t[147]=v,t[148]=o),J=o;let re=x.phase===`loading`,c=x.phase===`error`;M=ae,G=!0,t[149]===k?K=t[150]:(K=e=>{e||k()},t[149]=k,t[150]=K),j=s,B=`sm:max-w-xl`,V=`share-branch-switch-dialog`,H=Ee,U=Te;let u;t[151]===w?u=t[152]:(u=(0,y.jsx)(te,{children:(0,y.jsx)(r,{id:`RY6Bq1`,values:{targetNoun:w}})}),t[151]=w,t[152]=u);let oe=T.owner,se=T.repo,f;t[153]===T.target?f=t[154]:(f=l(T.target),t[153]=T.target,t[154]=f);let p;t[155]!==T.owner||t[156]!==T.repo||t[157]!==f?(p=(0,y.jsx)(ee,{className:`sr-only`,children:(0,y.jsx)(r,{id:`f8jU-L`,values:{0:oe,1:se,2:f}})}),t[155]=T.owner,t[156]=T.repo,t[157]=f,t[158]=p):p=t[158],t[159]!==u||t[160]!==p?(W=(0,y.jsxs)(ie,{children:[u,p]}),t[159]=u,t[160]=p,t[161]=W):W=t[161],A=ne;let m=T.owner,h=T.repo,g;t[162]===T.target?g=t[163]:(g=l(T.target),t[162]=T.target,t[163]=g),t[164]!==T.branch||t[165]!==T.owner||t[166]!==T.repo||t[167]!==T.target.kind||t[168]!==g?(L=(0,y.jsx)(`div`,{className:`mb-4`,children:(0,y.jsx)(ce,{owner:m,repo:h,path:g,kind:T.target.kind,branch:T.branch,testId:`share-branch-switch-metadata`,branchTestId:`share-branch-switch-metadata-branch`})}),t[164]=T.branch,t[165]=T.owner,t[166]=T.repo,t[167]=T.target.kind,t[168]=g,t[169]=L):L=t[169],R=x.phase===`branch-in-other-worktree`?(0,y.jsxs)(`div`,{className:`text-sm text-muted-foreground`,"data-testid":`share-branch-switch-in-other-worktree`,children:[(0,y.jsx)(`p`,{className:`leading-6`,children:(0,y.jsx)(r,{id:`yjExfe`,values:{shareBranch:D},components:{0:(0,y.jsx)(`code`,{className:`rounded-sm bg-muted px-1 py-0.5 text-foreground/80`})}})}),(0,y.jsx)(`p`,{className:`mt-2 break-all rounded bg-muted px-2 py-1 font-mono text-xs text-foreground/80`,"data-testid":`share-branch-switch-in-other-worktree-path`,children:x.otherWorktreePath})]}):x.phase===`verdict-pending`?(0,y.jsxs)(`p`,{className:`flex items-center gap-2 text-sm text-muted-foreground`,"data-testid":`share-branch-switch-verdict-pending`,role:`status`,"aria-live":`polite`,children:[(0,y.jsx)(d,{className:`h-4 w-4`,"aria-hidden":`true`}),(0,y.jsx)(r,{id:`c8jBgX`})]}):x.phase===`verdict`?x.resolution.kind===`on-origin`?(0,y.jsx)(`p`,{className:`text-sm leading-6 text-muted-foreground`,"data-testid":`share-branch-switch-verdict-on-origin`,children:(0,y.jsx)(r,{id:`Uay5NL`,values:{targetNoun:w,shareBranch:D},components:{0:(0,y.jsx)(`code`,{className:`rounded-sm bg-muted px-1 py-0.5 text-foreground/80`})}})}):x.resolution.kind===`renamed`?(0,y.jsx)(`p`,{className:`text-sm leading-6 text-muted-foreground`,"data-testid":`share-branch-switch-verdict-renamed`,children:(0,y.jsx)(r,{id:`P0HC30`,values:{0:x.resolution.renamedTo,targetNoun:w},components:{0:(0,y.jsx)(`code`,{className:`rounded-sm bg-muted px-1 py-0.5 text-foreground/80`})}})}):x.resolution.kind===`diverged`?(0,y.jsx)(`p`,{className:`text-sm leading-6 text-muted-foreground`,"data-testid":`share-branch-switch-verdict-diverged`,children:(0,y.jsx)(r,{id:`kLv8d3`,values:{shareBranch:D,targetNoun:w},components:{0:(0,y.jsx)(`code`,{className:`rounded-sm bg-muted px-1 py-0.5 text-foreground/80`})}})}):(0,y.jsxs)(`p`,{className:`flex items-center gap-2 text-sm text-muted-foreground`,"data-testid":`share-branch-switch-verdict-handoff`,role:`status`,"aria-live":`polite`,children:[(0,y.jsx)(d,{className:`h-4 w-4`,"aria-hidden":`true`}),(0,y.jsx)(r,{id:`c8jBgX`})]}):re?(0,y.jsxs)(`p`,{className:`flex items-center gap-2 text-sm text-muted-foreground`,"data-testid":`share-branch-switch-loading`,role:`status`,"aria-live":`polite`,children:[(0,y.jsx)(d,{className:`h-4 w-4`,"aria-hidden":`true`}),(0,y.jsx)(r,{id:`jerqF0`})]}):c?(0,y.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:(0,y.jsx)(r,{id:`w4hMYl`})}):q?.kind===`D`?(0,y.jsx)(`p`,{className:`text-sm leading-6 text-muted-foreground`,children:(0,y.jsx)(r,{id:`DTI-fp`,values:{targetNoun:w,shareBranch:D},components:{0:(0,y.jsx)(`code`,{className:`rounded-sm bg-muted px-1 py-0.5 text-foreground/80`})}})}):q?.kind===`B`?(0,y.jsx)(`p`,{className:`text-sm leading-6 text-muted-foreground`,children:(0,y.jsx)(r,{id:`sZ2IOu`,values:{targetNoun:w,shareBranch:D,currentLabel:n},components:{0:(0,y.jsx)(`code`,{className:`rounded-sm bg-muted px-1 py-0.5 text-foreground/80`}),1:(0,y.jsx)(`code`,{className:`rounded-sm bg-muted px-1 py-0.5 text-foreground/80`})}})}):(0,y.jsx)(`p`,{className:`text-sm leading-6 text-muted-foreground`,children:(0,y.jsx)(r,{id:`_902BE`,values:{targetNoun:w,shareBranch:D,currentLabel:n},components:{0:(0,y.jsx)(`code`,{className:`rounded-sm bg-muted px-1 py-0.5 text-foreground/80`}),1:(0,y.jsx)(`code`,{className:`rounded-sm bg-muted px-1 py-0.5 text-foreground/80`})}})}),z=q&&!q.switchEnabled&&q.conflictingFiles.length>0?(0,y.jsxs)(`div`,{className:`mt-3 rounded-md border border-border bg-muted/30 p-3 text-1sm`,"data-testid":`share-branch-switch-conflict`,children:[(0,y.jsx)(`p`,{className:`font-medium text-foreground/90`,children:(0,y.jsx)(r,{id:`n2lRue`})}),(0,y.jsx)(`ul`,{id:`share-receive-branch-conflict-files`,className:`mt-1 list-disc space-y-0.5 pl-5 text-muted-foreground`,children:q.conflictingFiles.map(we)})]}):null,t[107]=v,t[108]=x.info,t[109]=x.otherWorktreePath,t[110]=x.phase,t[111]=x.resolution,t[112]=k,t[113]=Xe,t[114]=T.branch,t[115]=T.owner,t[116]=T.repo,t[117]=T.target,t[118]=D,t[119]=w,t[120]=A,t[121]=j,t[122]=M,t[123]=N,t[124]=P,t[125]=F,t[126]=I,t[127]=L,t[128]=R,t[129]=z,t[130]=B,t[131]=V,t[132]=H,t[133]=U,t[134]=W,t[135]=G,t[136]=K,t[137]=q,t[138]=J}else A=t[120],j=t[121],M=t[122],N=t[123],P=t[124],F=t[125],I=t[126],L=t[127],R=t[128],z=t[129],B=t[130],V=t[131],H=t[132],U=t[133],W=t[134],G=t[135],K=t[136],q=t[137],J=t[138];let Y;t[170]===I?Y=t[171]:(Y=I?(0,y.jsxs)(`p`,{className:`mt-3 flex items-center gap-2 text-sm text-muted-foreground`,"data-testid":`share-branch-switch-switching`,role:`status`,"aria-live":`polite`,children:[(0,y.jsx)(d,{className:`h-4 w-4`,"aria-hidden":`true`}),(0,y.jsx)(r,{id:`CU3AiE`})]}):null,t[170]=I,t[171]=Y);let X;t[172]===N?X=t[173]:(X=N?(0,y.jsxs)(`p`,{className:`mt-3 flex items-center gap-2 text-sm text-muted-foreground`,"data-testid":`share-branch-switch-creating-worktree`,role:`status`,"aria-live":`polite`,children:[(0,y.jsx)(d,{className:`h-4 w-4`,"aria-hidden":`true`}),(0,y.jsx)(r,{id:`PZtgO0`})]}):null,t[172]=N,t[173]=X);let Z;t[174]!==A||t[175]!==L||t[176]!==R||t[177]!==z||t[178]!==Y||t[179]!==X?(Z=(0,y.jsxs)(A,{children:[L,R,z,Y,X]}),t[174]=A,t[175]=L,t[176]=R,t[177]=z,t[178]=Y,t[179]=X,t[180]=Z):Z=t[180];let _t;t[181]===Symbol.for(`react.memo_cache_sentinel`)?(_t=(0,y.jsx)(r,{id:`dEgA5A`}),t[181]=_t):_t=t[181];let Q;t[182]===k?Q=t[183]:(Q=(0,y.jsx)(o,{variant:`ghost`,onClick:k,"data-testid":`share-branch-switch-cancel`,children:_t}),t[182]=k,t[183]=Q);let vt;t[184]!==x.phase||t[185]!==x.resolution||t[186]!==N||t[187]!==st||t[188]!==rt||t[189]!==pt||t[190]!==ht||t[191]!==at||t[192]!==$e||t[193]!==tt||t[194]!==P||t[195]!==F||t[196]!==I||t[197]!==q||t[198]!==J?(vt=x.phase===`branch-in-other-worktree`?(0,y.jsx)(o,{onClick:ht,"data-testid":`share-branch-switch-in-other-worktree-pivot`,children:(0,y.jsx)(r,{id:`hyCxJY`})}):x.phase===`verdict`?x.resolution.kind===`on-origin`?(0,y.jsxs)(o,{onClick:tt,"data-testid":`share-branch-switch-verdict-switch-update`,children:[(0,y.jsx)(oe,{className:`size-3.5`,"aria-hidden":!0}),(0,y.jsx)(r,{id:`uA_jXp`})]}):x.resolution.kind===`renamed`?(0,y.jsxs)(o,{onClick:rt,"data-testid":`share-branch-switch-verdict-open-renamed`,children:[(0,y.jsx)(se,{className:`size-3.5`,"aria-hidden":!0}),(0,y.jsx)(r,{id:`AItsE5`})]}):x.resolution.kind===`diverged`?(0,y.jsxs)(o,{onClick:at,"data-testid":`share-branch-switch-verdict-plain-switch`,children:[(0,y.jsx)(oe,{className:`size-3.5`,"aria-hidden":!0}),F]}):null:(0,y.jsxs)(`div`,{className:`flex min-w-0 flex-col-reverse gap-2 sm:flex-row sm:flex-wrap sm:justify-end sm:gap-2`,children:[q?.openCurrentEnabled?(0,y.jsxs)(o,{variant:`outline`,onClick:st,disabled:I||N,"data-testid":`share-branch-switch-open-current`,children:[(0,y.jsx)(se,{className:`size-3.5`,"aria-hidden":!0}),P]}):null,(0,y.jsx)(o,{variant:`outline`,onClick:$e,disabled:!q?.switchEnabled||I||N,"aria-disabled":!q?.switchEnabled||I||N,"aria-describedby":q&&!q.switchEnabled&&q.conflictingFiles.length>0?`share-receive-branch-conflict-files`:void 0,"data-testid":`share-branch-switch-switch`,children:I?(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(d,{className:`size-3.5`,"aria-hidden":`true`}),F]}):(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(oe,{className:`size-3.5`,"aria-hidden":!0}),F]})}),(0,y.jsx)(o,{onClick:pt,disabled:!q||I||N,"data-testid":`share-branch-switch-worktree`,children:N?(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(d,{className:`size-3.5`,"aria-hidden":`true`}),J]}):(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(u,{className:`size-3.5`,"aria-hidden":!0}),J]})})]}),t[184]=x.phase,t[185]=x.resolution,t[186]=N,t[187]=st,t[188]=rt,t[189]=pt,t[190]=ht,t[191]=at,t[192]=$e,t[193]=tt,t[194]=P,t[195]=F,t[196]=I,t[197]=q,t[198]=J,t[199]=vt):vt=t[199];let yt;t[200]!==Q||t[201]!==vt?(yt=(0,y.jsxs)(re,{className:`sm:justify-between`,children:[Q,vt]}),t[200]=Q,t[201]=vt,t[202]=yt):yt=t[202];let $;t[203]!==j||t[204]!==B||t[205]!==V||t[206]!==H||t[207]!==U||t[208]!==W||t[209]!==Z||t[210]!==yt?($=(0,y.jsxs)(j,{className:B,"data-testid":V,onInteractOutside:H,onPointerDownOutside:U,children:[W,Z,yt]}),t[203]=j,t[204]=B,t[205]=V,t[206]=H,t[207]=U,t[208]=W,t[209]=Z,t[210]=yt,t[211]=$):$=t[211];let bt;return t[212]!==M||t[213]!==G||t[214]!==K||t[215]!==$?(bt=(0,y.jsx)(M,{open:G,onOpenChange:K,children:$}),t[212]=M,t[213]=G,t[214]=K,t[215]=$,t[216]=bt):bt=t[216],bt}function we(e){return(0,y.jsx)(`li`,{children:(0,y.jsx)(`code`,{className:`text-foreground/80`,children:e})},e)}function Te(e){e.preventDefault()}function Ee(e){e.preventDefault()}function De(){return m.request()}function Oe(e){return ye(e,null).state}function ke(e){return ve(e,null)}function Ae(e){return pe(e,null)}function je(){return null}export{b as ShareBranchSwitchDialog};
@@ -1 +1 @@
1
- import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./jsx-runtime-BUgB2tll.js";import{t as n}from"./react-f2sANaYj.js";import{n as r,r as i}from"./dist-Nvb76hAm.js";import{t as a}from"./compiler-runtime-BfE3aGVn.js";import{t as o}from"./button-Cym3gapE.js";import{a as ee,c as te,i as ne,n as re,o as s,s as c,t as l}from"./dialog-DgIQr9zS.js";import{In as u,zn as d}from"./dist-C7TUqndm.js";import{n as f}from"./dist-CJhtNlOm2.js";import{t as p}from"./desktop-bridge-types-oYPdTDmz.js";import{t as ie}from"./spinner-Bp2_BYkl.js";import{a as ae,i as m,n as h,o as g,r as oe,s as _}from"./receive-store-BbICc2Yx.js";import{t as se}from"./share-metadata-rows-Bj7HLyQc.js";var v=e(n(),1),y=a(),b=e=>({phase:`ready`,seed:e});function x(e){return e.phase===`ready`?{phase:`initializing`,seed:e.seed}:e}function S(e,t){return e.phase===`initializing`?t.ok?{phase:`opening`,seed:e.seed}:{phase:`error`,seed:e.seed,reason:t.reason,message:t.message}:e}function C(e,t){return e.phase===`opening`?t.ok?{phase:`done`,seed:e.seed}:{phase:`error`,seed:e.seed,reason:`network-error`,message:t.message}:e}function w(e){return e.phase===`done`||e.phase===`cancelled`||e.phase===`error`?e:{phase:`cancelled`,seed:e.seed}}var T=t();function E(e){return{kind:e.target.kind,path:p(e.target),repositoryPath:p(e.repositoryTarget),...e.contentRootDepth===null?{}:{contentRootDepth:e.contentRootDepth}}}function D(e){return e!==null&&e.kind===`launcher-consent`}function O(e){return e!==null&&e.kind===`launcher-miss`}function k(e){let t=(0,y.c)(14),{bridge:n,cloneController:r,store:i}=e,a=i===void 0?h:i,o=(0,v.useSyncExternalStore)(a.subscribe,a.getSnapshot,j),[ee,te]=(0,v.useState)(0),[ne,re]=(0,v.useState)(o);o!==ne&&(re(o),te(A));let s,c;t[0]!==o||t[1]!==a?(s=()=>{if(!o)return;let e=_(o);e&&(f.error(e.message),a.dismiss())},c=[o,a],t[0]=o,t[1]=a,t[2]=s,t[3]=c):(s=t[2],c=t[3]),(0,v.useEffect)(s,c);let l;t[4]===o?l=t[5]:(l=O(o)?o:null,t[4]=o,t[5]=l);let u=l,d;t[6]===o?d=t[7]:(d=D(o)?o:null,t[6]=o,t[7]=d);let p=d??u;if(!p)return null;let ie;return t[8]!==p||t[9]!==n||t[10]!==r||t[11]!==ee||t[12]!==a?(ie=(0,T.jsx)(M,{payload:p,bridge:n,cloneController:r,store:a},ee),t[8]=p,t[9]=n,t[10]=r,t[11]=ee,t[12]=a,t[13]=ie):ie=t[13],ie}function A(e){return e+1}function j(){return null}function M(e){let t=(0,y.c)(165),{payload:n,bridge:a,cloneController:h,store:_}=e,{_:x}=i(),[w,k]=(0,v.useState)(!1),[A,j]=(0,v.useState)(null),[M,pe]=(0,v.useState)(!1),[N,me]=(0,v.useState)(!1),[P,he]=(0,v.useState)(null),[F,I]=(0,v.useState)(null),ge=(0,v.useRef)(!1),_e=(0,v.useRef)(null),ve,ye;t[0]===P?(ve=t[1],ye=t[2]):(ve=()=>{P&&_e.current?.focus()},ye=[P],t[0]=P,t[1]=ve,t[2]=ye),(0,v.useEffect)(ve,ye);let be;t[3]!==F||t[4]!==n?(be=()=>{D(n)&&F===null&&(console.warn(`[receive] q1_hit=true selection=branch_match_non_ok candidate=${n.candidatePath}`),I(b({candidatePath:n.candidatePath,branch:n.share.branch,targetPath:p(n.share.target),targetKind:n.share.target.kind,repositoryPath:p(n.share.repositoryTarget),...n.share.contentRootDepth===null?{}:{contentRootDepth:n.share.contentRootDepth},parentProjectName:n.parentProjectName})))},t[3]=F,t[4]=n,t[5]=be):be=t[5];let xe;t[6]===n?xe=t[7]:(xe=[n],t[6]=n,t[7]=xe),(0,v.useEffect)(be,xe);let Se;t[8]!==A||t[9]!==h||t[10]!==n?(Se=()=>{if(!h||!O(n)||A!==null||ge.current)return;ge.current=!0,pe(!0);let e=n.share.host;h.getAuthStatus(e).then(e=>{j(e)}).catch(t=>{console.warn(`[receive] auth pre-flight probe failed`,t instanceof Error?t.message:t),j({authenticated:!1,host:e})}).finally(()=>{pe(!1)})},t[8]=A,t[9]=h,t[10]=n,t[11]=Se):Se=t[11];let Ce;t[12]!==A||t[13]!==n?(Ce=[n,A],t[12]=A,t[13]=n,t[14]=Ce):Ce=t[14],(0,v.useEffect)(Se,Ce);let L=O(n)?n:null,we=D(n)?n:null,R=L?.share??we?.share??null,z,Te,B,V,H,Ee,U,W;if(t[15]!==x||t[16]!==M||t[17]!==a||t[18]!==h||t[19]!==N||t[20]!==F||t[21]!==L||t[22]!==w||t[23]!==R||t[24]!==_){U=Symbol.for(`react.early_return_sentinel`);bb0:{let e=R?{host:R.host,owner:R.owner,repo:R.repo}:null,n;t[33]!==x||t[34]!==R?.target.kind?(n=R?.target.kind===`folder`?x({id:`ugoTXs`}):x({id:`XH30C4`}),t[33]=x,t[34]=R?.target.kind,t[35]=n):n=t[35],W=n,B=async function(){if(!L||!e)return;if(console.log(ae({q2_path:`clone`})),!h){f.info(x({id:`27XW26`}),{action:{label:x({id:`B3NAZC`}),onClick:()=>{a.navigator.open()}},duration:8e3});return}if(N)return;he(null),me(!0);let t=oe(e),n;try{n=await h.runClone({url:t,branch:L.share.branch})}catch(e){let t=e;console.warn(`[receive] runClone threw unexpectedly`,t),me(!1),he({detail:t instanceof Error?t.message:String(t)});return}if(me(!1),n.kind===`error`){he({detail:n.detail??null});return}if(n.kind===`ok`){try{await a.project.open({path:n.dir,target:`new-window`,entryPoint:`share-receive`,pendingDeepLinkTarget:E(L.share)}),_.dismiss()}catch(e){let t=e;console.warn(`[receive] project open after clone failed`,t instanceof Error?t.message:t),f.error(x({id:`438Fca`}))}return}};let i;t[36]!==x||t[37]!==M||t[38]!==h?(i=async function(){if(!(!h||M)){pe(!0);try{let e=await h.startSignIn();pe(!1),e!==null&&j(e)}catch(e){let t=e;pe(!1),console.warn(`[receive] startSignIn failed`,t instanceof Error?t.message:t),f.error(x({id:`lzwo7p`}))}}},t[36]=x,t[37]=M,t[38]=h,t[39]=i):i=t[39],H=i,V=async function(){if(!(!L||!e||w)){he(null),k(!0),console.log(ae({q2_path:`local`}));try{for(;;){let t=await a.dialog.openFolder();if(!t)break;let n=await a.share.validateLocalFolder({folderPath:t,host:e.host,owner:e.owner,repo:e.repo});if(console.log(ae({folder_validate:n.kind})),n.kind===`ok`){let e=L.share.branch,n={currentBranch:null,headSha:null,detached:!1};try{n=await a.project.readHeadBranch(t)}catch(e){let t=e;console.warn(`[receive] local-folder readHeadBranch failed`,t instanceof Error?t.message:t)}let r=d(e,n)!==`true`;try{await a.project.open({path:t,target:`new-window`,entryPoint:`share-receive`,...r?{pendingShareBranchSwitch:{share:L.share,projectPath:t,currentBranch:n.currentBranch}}:{pendingDeepLinkTarget:E(L.share)}}),_.dismiss()}catch(e){let t=e;console.warn(`[receive] local-folder-open failed`,t instanceof Error?t.message:t),f.error(x({id:`phM8Kh`}))}break}let r=g(n,e);r&&f.error(r)}}catch(e){let t=e;console.warn(`[receive] local-folder-validate failed`,t instanceof Error?t.message:t),f.error(x({id:`rlUzXK`}))}k(!1)}};let m;t[40]!==x||t[41]!==a||t[42]!==F||t[43]!==_?(m=function(){if(F===null||F.phase!==`ready`)return;let e=F.seed;console.warn(`[receive] consent_dialog action=initialize worktree=${e.candidatePath}`),I(fe),a.project.okInit({projectPath:e.candidatePath}).then(async t=>{if(t.ok===!0){I(e=>e===null?e:S(e,{ok:!0,projectPath:t.projectPath}));try{await a.project.open({path:t.projectPath,target:`new-window`,entryPoint:`share-receive`,pendingDeepLinkTarget:{kind:e.targetKind,path:e.targetPath,repositoryPath:e.repositoryPath??e.targetPath,...e.contentRootDepth===void 0?{}:{contentRootDepth:e.contentRootDepth}},pendingBranch:e.branch}),I(de),_.dismiss()}catch(t){let n=t,r=n instanceof Error?n.message:String(n);I(e=>e===null?e:C(e,{ok:!1,message:r})),f.error(x({id:`nDT8qt`,values:{0:e.candidatePath}}))}return}let n=t.reason,r=t.message||`Initialization failed.`;I(e=>e===null?e:S(e,{ok:!1,reason:n,message:r})),f.error(r)}).catch(t=>{let n=t instanceof Error?t.message:String(t);I(e=>e===null?e:S(e,{ok:!1,reason:`network-error`,message:n})),f.error(x({id:`3Mwaly`,values:{0:e.candidatePath}}))})},t[40]=x,t[41]=a,t[42]=F,t[43]=_,t[44]=m):m=t[44];let v=m,y;t[45]!==F||t[46]!==_?(y=function(){F!==null&&console.warn(`[receive] consent_dialog action=cancel worktree=${F.seed.candidatePath}`),I(ue),_.dismiss()},t[45]=F,t[46]=_,t[47]=y):y=t[47];let b=y;if(F!==null&&F.phase!==`cancelled`&&F.phase!==`done`&&R!==null){let e=F.seed,n=F.phase===`initializing`||F.phase===`opening`,i;t[48]===b?i=t[49]:(i=e=>{e||b()},t[48]=b,t[49]=i);let a;t[50]===W?a=t[51]:(a=(0,T.jsx)(te,{children:(0,T.jsx)(r,{id:`RY6Bq1`,values:{targetNoun:W}})}),t[50]=W,t[51]=a);let u;t[52]===R.target?u=t[53]:(u=p(R.target)?`— ${p(R.target)}`:``,t[52]=R.target,t[53]=u);let d;t[54]!==R.owner||t[55]!==R.repo||t[56]!==u?(d=(0,T.jsx)(ee,{className:`sr-only`,children:(0,T.jsx)(r,{id:`pgq_xf`,values:{0:R.owner,1:R.repo,2:u}})}),t[54]=R.owner,t[55]=R.repo,t[56]=u,t[57]=d):d=t[57];let f=R.owner,ae=R.repo,m;t[58]===R.target?m=t[59]:(m=p(R.target),t[58]=R.target,t[59]=m);let h;t[60]!==R.branch||t[61]!==R.owner||t[62]!==R.repo||t[63]!==R.target.kind||t[64]!==m?(h=(0,T.jsx)(se,{owner:f,repo:ae,path:m,kind:R.target.kind,branch:R.branch,testId:`share-receive-metadata`,branchTestId:`share-receive-metadata-branch`}),t[60]=R.branch,t[61]=R.owner,t[62]=R.repo,t[63]=R.target.kind,t[64]=m,t[65]=h):h=t[65];let g;t[66]!==a||t[67]!==d||t[68]!==h?(g=(0,T.jsxs)(c,{children:[a,d,h]}),t[66]=a,t[67]=d,t[68]=h,t[69]=g):g=t[69];let oe;t[70]===Symbol.for(`react.memo_cache_sentinel`)?(oe=(0,T.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:(0,T.jsx)(r,{id:`KsAPaB`})}),t[70]=oe):oe=t[70];let _;t[71]===e.candidatePath?_=t[72]:(_=(0,T.jsx)(`p`,{className:`mt-2 break-all rounded bg-muted px-2 py-1 font-mono text-xs text-foreground/80`,"data-testid":`share-receive-consent-path`,children:e.candidatePath}),t[71]=e.candidatePath,t[72]=_);let y;t[73]===e.parentProjectName?y=t[74]:(y=e.parentProjectName===null?null:(0,T.jsx)(`p`,{className:`mt-2 text-xs text-muted-foreground`,"data-testid":`share-receive-consent-parent`,children:(0,T.jsx)(r,{id:`JmfgFc`,values:{0:e.parentProjectName}})}),t[73]=e.parentProjectName,t[74]=y);let x;t[75]===Symbol.for(`react.memo_cache_sentinel`)?(x=(0,T.jsx)(`p`,{className:`mt-3 text-sm text-muted-foreground`,children:(0,T.jsx)(r,{id:`w7SsvI`})}),t[75]=x):x=t[75];let S;t[76]!==F.message||t[77]!==F.phase?(S=F.phase===`error`?(0,T.jsx)(`p`,{className:`mt-3 text-sm text-destructive`,"data-testid":`share-receive-consent-error`,role:`alert`,children:F.message}):null,t[76]=F.message,t[77]=F.phase,t[78]=S):S=t[78];let C;t[79]!==_||t[80]!==y||t[81]!==S?(C=(0,T.jsxs)(re,{children:[oe,_,y,x,S]}),t[79]=_,t[80]=y,t[81]=S,t[82]=C):C=t[82];let w;t[83]===Symbol.for(`react.memo_cache_sentinel`)?(w=(0,T.jsx)(r,{id:`dEgA5A`}),t[83]=w):w=t[83];let E;t[84]===b?E=t[85]:(E=(0,T.jsx)(o,{variant:`ghost`,onClick:b,"data-testid":`share-receive-consent-cancel`,children:w}),t[84]=b,t[85]=E);let D=n||F.phase===`error`,O=n||F.phase===`error`,k;t[86]===n?k=t[87]:(k=n?(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(ie,{className:`mr-2 h-4 w-4`,"aria-hidden":`true`}),(0,T.jsx)(r,{id:`NKkZXl`})]}):(0,T.jsx)(r,{id:`NKkZXl`}),t[86]=n,t[87]=k);let A;t[88]!==v||t[89]!==D||t[90]!==O||t[91]!==k?(A=(0,T.jsx)(o,{onClick:v,disabled:D,"aria-disabled":O,"data-testid":`share-receive-consent-initialize`,children:k}),t[88]=v,t[89]=D,t[90]=O,t[91]=k,t[92]=A):A=t[92];let j;t[93]!==E||t[94]!==A?(j=(0,T.jsxs)(s,{children:[E,A]}),t[93]=E,t[94]=A,t[95]=j):j=t[95];let M;t[96]!==g||t[97]!==C||t[98]!==j?(M=(0,T.jsxs)(ne,{className:`sm:max-w-xl`,"data-testid":`share-receive-consent-dialog`,onInteractOutside:le,onPointerDownOutside:ce,children:[g,C,j]}),t[96]=g,t[97]=C,t[98]=j,t[99]=M):M=t[99];let ue;t[100]!==i||t[101]!==M?(ue=(0,T.jsx)(l,{open:!0,onOpenChange:i,children:M}),t[100]=i,t[101]=M,t[102]=ue):ue=t[102],U=ue;break bb0}if(!L||!R||!e){U=null;break bb0}z=h!==void 0&&!N;let D;t[103]!==x||t[104]!==N?(D=x(N?{id:`YjhKI5`}:{id:`LE7t79`}),t[103]=x,t[104]=N,t[105]=D):D=t[105],Te=D,Ee=u(e)}t[15]=x,t[16]=M,t[17]=a,t[18]=h,t[19]=N,t[20]=F,t[21]=L,t[22]=w,t[23]=R,t[24]=_,t[25]=z,t[26]=Te,t[27]=B,t[28]=V,t[29]=H,t[30]=Ee,t[31]=U,t[32]=W}else z=t[25],Te=t[26],B=t[27],V=t[28],H=t[29],Ee=t[30],U=t[31],W=t[32];if(U!==Symbol.for(`react.early_return_sentinel`))return U;let De=Ee,Oe=A?.authenticated?A.login:void 0,ke;t[106]===P?ke=t[107]:(ke=P?.detail?m(P.detail):``,t[106]=P,t[107]=ke);let Ae=ke,G;t[108]===_?G=t[109]:(G=e=>{e||_.dismiss()},t[108]=_,t[109]=G);let K;t[110]===W?K=t[111]:(K=(0,T.jsx)(te,{children:(0,T.jsx)(r,{id:`RY6Bq1`,values:{targetNoun:W}})}),t[110]=W,t[111]=K);let q;t[112]===R.target?q=t[113]:(q=p(R.target)?` — ${p(R.target)}`:null,t[112]=R.target,t[113]=q);let J;t[114]!==R.owner||t[115]!==R.repo||t[116]!==q?(J=(0,T.jsxs)(ee,{className:`sr-only`,children:[R.owner,`/`,R.repo,q]}),t[114]=R.owner,t[115]=R.repo,t[116]=q,t[117]=J):J=t[117];let je=R.owner,Me=R.repo,Y;t[118]===R.target?Y=t[119]:(Y=p(R.target),t[118]=R.target,t[119]=Y);let X;t[120]!==R.branch||t[121]!==R.owner||t[122]!==R.repo||t[123]!==R.target.kind||t[124]!==Y?(X=(0,T.jsx)(se,{owner:je,repo:Me,path:Y,kind:R.target.kind,branch:R.branch,testId:`share-receive-metadata`,branchTestId:`share-receive-metadata-branch`}),t[120]=R.branch,t[121]=R.owner,t[122]=R.repo,t[123]=R.target.kind,t[124]=Y,t[125]=X):X=t[125];let Z;t[126]!==K||t[127]!==J||t[128]!==X?(Z=(0,T.jsxs)(c,{children:[K,J,X]}),t[126]=K,t[127]=J,t[128]=X,t[129]=Z):Z=t[129];let Q;t[130]!==h||t[131]!==z||t[132]!==P||t[133]!==Ae||t[134]!==Te||t[135]!==N||t[136]!==B||t[137]!==V||t[138]!==w?(Q=P?(0,T.jsxs)(`div`,{ref:_e,tabIndex:-1,className:`rounded-lg border border-destructive/40 bg-destructive/5 p-4 outline-none`,"data-testid":`share-receive-clone-error`,children:[(0,T.jsx)(`p`,{className:`text-sm font-semibold text-foreground`,role:`alert`,children:(0,T.jsx)(r,{id:`aiArms`})}),Ae?(0,T.jsxs)(`p`,{className:`mt-2 break-words text-xs text-destructive`,"data-testid":`share-receive-clone-error-message`,children:[(0,T.jsx)(r,{id:`4BITzH`}),` `,(0,T.jsxs)(`span`,{className:`font-mono text-foreground/80`,children:[`"`,Ae,`"`]})]}):null,(0,T.jsx)(`p`,{className:`mt-3 text-sm text-muted-foreground`,children:(0,T.jsx)(r,{id:`Llyqvo`})}),(0,T.jsxs)(`ul`,{className:`mt-1 list-disc space-y-1 pl-5 text-sm text-muted-foreground`,"data-testid":`share-receive-clone-error-reasons`,children:[(0,T.jsx)(`li`,{children:(0,T.jsx)(r,{id:`6LbUG7`})}),(0,T.jsx)(`li`,{children:(0,T.jsx)(r,{id:`_pY_Vq`})}),(0,T.jsx)(`li`,{children:(0,T.jsx)(r,{id:`J6mxC1`})})]}),(0,T.jsxs)(`div`,{className:`mt-4 flex flex-wrap gap-2`,children:[(0,T.jsx)(o,{onClick:()=>{B()},"data-testid":`share-receive-clone-retry`,children:(0,T.jsx)(r,{id:`KDw4GX`})}),(0,T.jsx)(o,{variant:`outline`,onClick:()=>{V()},disabled:w||N,"data-testid":`share-receive-error-local`,children:(0,T.jsx)(r,{id:`xFQRu4`})})]})]}):(0,T.jsxs)(`div`,{className:`grid grid-cols-2 gap-3`,children:[(0,T.jsxs)(`button`,{type:`button`,"data-testid":`share-receive-clone`,className:`flex flex-col items-start gap-2 rounded-lg border border-primary/50 bg-primary/5 p-4 text-left transition hover:border-primary hover:bg-primary/10 focus-visible:border-ring focus-visible:outline-none focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 disabled:hover:border-primary/50 disabled:hover:bg-primary/5`,onClick:()=>{B()},disabled:h!==void 0&&!z,"aria-disabled":h!==void 0&&!z,children:[(0,T.jsx)(`span`,{className:`text-sm font-semibold`,children:Te}),(0,T.jsx)(`span`,{className:`line-clamp-2 text-1sm text-muted-foreground`,children:(0,T.jsx)(r,{id:`fj5YiP`})})]}),(0,T.jsxs)(`button`,{type:`button`,"data-testid":`share-receive-local`,className:`flex flex-col items-start gap-2 rounded-lg border border-border bg-card p-4 text-left transition hover:border-foreground/50 hover:bg-accent focus-visible:border-ring focus-visible:outline-none focus-visible:ring-3 focus-visible:ring-ring/50`,onClick:()=>{V()},disabled:w||N,children:[(0,T.jsx)(`span`,{className:`text-sm font-semibold`,children:(0,T.jsx)(r,{id:`HfI1dR`})}),(0,T.jsx)(`span`,{className:`line-clamp-2 text-1sm text-muted-foreground`,children:(0,T.jsx)(r,{id:`_qD6mn`})})]})]}),t[130]=h,t[131]=z,t[132]=P,t[133]=Ae,t[134]=Te,t[135]=N,t[136]=B,t[137]=V,t[138]=w,t[139]=Q):Q=t[139];let Ne;t[140]!==M||t[141]!==A||t[142]!==h||t[143]!==H||t[144]!==Oe?(Ne=h?(0,T.jsx)(`div`,{className:`mt-3 flex items-center justify-between rounded-md border border-border bg-muted/30 px-3 py-2 text-xs`,"data-testid":`share-receive-auth-banner`,role:`status`,"aria-live":`polite`,children:A===null?(0,T.jsx)(`span`,{className:`text-muted-foreground`,children:(0,T.jsx)(r,{id:`UDFrWm`})}):A.authenticated?(0,T.jsx)(`span`,{className:`text-muted-foreground`,children:(0,T.jsx)(r,{id:`VAHWL_`,values:{signedInLogin:Oe},components:{0:(0,T.jsx)(`span`,{className:`font-medium text-foreground/90`})}})}):(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(`span`,{className:`text-muted-foreground`,children:(0,T.jsx)(r,{id:`SgKLfA`})}),(0,T.jsx)(`button`,{type:`button`,"data-testid":`share-receive-signin`,className:`font-medium text-primary underline-offset-2 hover:underline focus:outline-none focus-visible:ring-2 focus-visible:ring-ring rounded`,onClick:()=>{H()},disabled:M,children:M?(0,T.jsx)(r,{id:`PKLY-1`}):(0,T.jsx)(r,{id:`3jod3l`})})]})}):null,t[140]=M,t[141]=A,t[142]=h,t[143]=H,t[144]=Oe,t[145]=Ne):Ne=t[145];let Pe;t[146]!==P||t[147]!==De?(Pe=P?null:(0,T.jsx)(`p`,{className:`mt-3 text-1sm text-muted-foreground`,children:(0,T.jsx)(r,{id:`RJ3a8Z`,values:{lookingForUrl:De},components:{0:(0,T.jsx)(`code`,{className:`rounded-sm bg-muted px-1 py-0.5 text-foreground/80`})}})}),t[146]=P,t[147]=De,t[148]=Pe):Pe=t[148];let Fe;t[149]!==Q||t[150]!==Ne||t[151]!==Pe?(Fe=(0,T.jsxs)(re,{children:[Q,Ne,Pe]}),t[149]=Q,t[150]=Ne,t[151]=Pe,t[152]=Fe):Fe=t[152];let Ie;t[153]===_?Ie=t[154]:(Ie=()=>_.dismiss(),t[153]=_,t[154]=Ie);let Le;t[155]===Symbol.for(`react.memo_cache_sentinel`)?(Le=(0,T.jsx)(r,{id:`dEgA5A`}),t[155]=Le):Le=t[155];let Re;t[156]===Ie?Re=t[157]:(Re=(0,T.jsx)(s,{children:(0,T.jsx)(o,{variant:`outline`,onClick:Ie,children:Le})}),t[156]=Ie,t[157]=Re);let $;t[158]!==Z||t[159]!==Fe||t[160]!==Re?($=(0,T.jsxs)(ne,{className:`sm:max-w-xl`,"data-testid":`share-receive-dialog`,children:[Z,Fe,Re]}),t[158]=Z,t[159]=Fe,t[160]=Re,t[161]=$):$=t[161];let ze;return t[162]!==G||t[163]!==$?(ze=(0,T.jsx)(l,{open:!0,onOpenChange:G,children:$}),t[162]=G,t[163]=$,t[164]=ze):ze=t[164],ze}function ce(e){return e.preventDefault()}function le(e){return e.preventDefault()}function ue(e){return e===null?e:w(e)}function de(e){return e===null?e:C(e,{ok:!0})}function fe(e){return e===null?e:x(e)}export{k as ShareReceiveDialog};
1
+ import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./jsx-runtime-BUgB2tll.js";import{t as n}from"./react-f2sANaYj.js";import{n as r,r as i}from"./dist-Nvb76hAm.js";import{t as a}from"./compiler-runtime-BfE3aGVn.js";import{t as o}from"./button-Cym3gapE.js";import{a as ee,c as te,i as ne,n as re,o as s,s as c,t as l}from"./dialog-DgIQr9zS.js";import{In as u,zn as d}from"./dist-868Gd8gd.js";import{n as f}from"./dist-CJhtNlOm2.js";import{t as p}from"./desktop-bridge-types-oYPdTDmz.js";import{t as ie}from"./spinner-Bp2_BYkl.js";import{a as ae,i as m,n as h,o as g,r as oe,s as _}from"./receive-store-C_l3XIQE.js";import{t as se}from"./share-metadata-rows-Bj7HLyQc.js";var v=e(n(),1),y=a(),b=e=>({phase:`ready`,seed:e});function x(e){return e.phase===`ready`?{phase:`initializing`,seed:e.seed}:e}function S(e,t){return e.phase===`initializing`?t.ok?{phase:`opening`,seed:e.seed}:{phase:`error`,seed:e.seed,reason:t.reason,message:t.message}:e}function C(e,t){return e.phase===`opening`?t.ok?{phase:`done`,seed:e.seed}:{phase:`error`,seed:e.seed,reason:`network-error`,message:t.message}:e}function w(e){return e.phase===`done`||e.phase===`cancelled`||e.phase===`error`?e:{phase:`cancelled`,seed:e.seed}}var T=t();function E(e){return{kind:e.target.kind,path:p(e.target),repositoryPath:p(e.repositoryTarget),...e.contentRootDepth===null?{}:{contentRootDepth:e.contentRootDepth}}}function D(e){return e!==null&&e.kind===`launcher-consent`}function O(e){return e!==null&&e.kind===`launcher-miss`}function k(e){let t=(0,y.c)(14),{bridge:n,cloneController:r,store:i}=e,a=i===void 0?h:i,o=(0,v.useSyncExternalStore)(a.subscribe,a.getSnapshot,j),[ee,te]=(0,v.useState)(0),[ne,re]=(0,v.useState)(o);o!==ne&&(re(o),te(A));let s,c;t[0]!==o||t[1]!==a?(s=()=>{if(!o)return;let e=_(o);e&&(f.error(e.message),a.dismiss())},c=[o,a],t[0]=o,t[1]=a,t[2]=s,t[3]=c):(s=t[2],c=t[3]),(0,v.useEffect)(s,c);let l;t[4]===o?l=t[5]:(l=O(o)?o:null,t[4]=o,t[5]=l);let u=l,d;t[6]===o?d=t[7]:(d=D(o)?o:null,t[6]=o,t[7]=d);let p=d??u;if(!p)return null;let ie;return t[8]!==p||t[9]!==n||t[10]!==r||t[11]!==ee||t[12]!==a?(ie=(0,T.jsx)(M,{payload:p,bridge:n,cloneController:r,store:a},ee),t[8]=p,t[9]=n,t[10]=r,t[11]=ee,t[12]=a,t[13]=ie):ie=t[13],ie}function A(e){return e+1}function j(){return null}function M(e){let t=(0,y.c)(165),{payload:n,bridge:a,cloneController:h,store:_}=e,{_:x}=i(),[w,k]=(0,v.useState)(!1),[A,j]=(0,v.useState)(null),[M,pe]=(0,v.useState)(!1),[N,me]=(0,v.useState)(!1),[P,he]=(0,v.useState)(null),[F,I]=(0,v.useState)(null),ge=(0,v.useRef)(!1),_e=(0,v.useRef)(null),ve,ye;t[0]===P?(ve=t[1],ye=t[2]):(ve=()=>{P&&_e.current?.focus()},ye=[P],t[0]=P,t[1]=ve,t[2]=ye),(0,v.useEffect)(ve,ye);let be;t[3]!==F||t[4]!==n?(be=()=>{D(n)&&F===null&&(console.warn(`[receive] q1_hit=true selection=branch_match_non_ok candidate=${n.candidatePath}`),I(b({candidatePath:n.candidatePath,branch:n.share.branch,targetPath:p(n.share.target),targetKind:n.share.target.kind,repositoryPath:p(n.share.repositoryTarget),...n.share.contentRootDepth===null?{}:{contentRootDepth:n.share.contentRootDepth},parentProjectName:n.parentProjectName})))},t[3]=F,t[4]=n,t[5]=be):be=t[5];let xe;t[6]===n?xe=t[7]:(xe=[n],t[6]=n,t[7]=xe),(0,v.useEffect)(be,xe);let Se;t[8]!==A||t[9]!==h||t[10]!==n?(Se=()=>{if(!h||!O(n)||A!==null||ge.current)return;ge.current=!0,pe(!0);let e=n.share.host;h.getAuthStatus(e).then(e=>{j(e)}).catch(t=>{console.warn(`[receive] auth pre-flight probe failed`,t instanceof Error?t.message:t),j({authenticated:!1,host:e})}).finally(()=>{pe(!1)})},t[8]=A,t[9]=h,t[10]=n,t[11]=Se):Se=t[11];let Ce;t[12]!==A||t[13]!==n?(Ce=[n,A],t[12]=A,t[13]=n,t[14]=Ce):Ce=t[14],(0,v.useEffect)(Se,Ce);let L=O(n)?n:null,we=D(n)?n:null,R=L?.share??we?.share??null,z,Te,B,V,H,Ee,U,W;if(t[15]!==x||t[16]!==M||t[17]!==a||t[18]!==h||t[19]!==N||t[20]!==F||t[21]!==L||t[22]!==w||t[23]!==R||t[24]!==_){U=Symbol.for(`react.early_return_sentinel`);bb0:{let e=R?{host:R.host,owner:R.owner,repo:R.repo}:null,n;t[33]!==x||t[34]!==R?.target.kind?(n=R?.target.kind===`folder`?x({id:`ugoTXs`}):x({id:`XH30C4`}),t[33]=x,t[34]=R?.target.kind,t[35]=n):n=t[35],W=n,B=async function(){if(!L||!e)return;if(console.log(ae({q2_path:`clone`})),!h){f.info(x({id:`27XW26`}),{action:{label:x({id:`B3NAZC`}),onClick:()=>{a.navigator.open()}},duration:8e3});return}if(N)return;he(null),me(!0);let t=oe(e),n;try{n=await h.runClone({url:t,branch:L.share.branch})}catch(e){let t=e;console.warn(`[receive] runClone threw unexpectedly`,t),me(!1),he({detail:t instanceof Error?t.message:String(t)});return}if(me(!1),n.kind===`error`){he({detail:n.detail??null});return}if(n.kind===`ok`){try{await a.project.open({path:n.dir,target:`new-window`,entryPoint:`share-receive`,pendingDeepLinkTarget:E(L.share)}),_.dismiss()}catch(e){let t=e;console.warn(`[receive] project open after clone failed`,t instanceof Error?t.message:t),f.error(x({id:`438Fca`}))}return}};let i;t[36]!==x||t[37]!==M||t[38]!==h?(i=async function(){if(!(!h||M)){pe(!0);try{let e=await h.startSignIn();pe(!1),e!==null&&j(e)}catch(e){let t=e;pe(!1),console.warn(`[receive] startSignIn failed`,t instanceof Error?t.message:t),f.error(x({id:`lzwo7p`}))}}},t[36]=x,t[37]=M,t[38]=h,t[39]=i):i=t[39],H=i,V=async function(){if(!(!L||!e||w)){he(null),k(!0),console.log(ae({q2_path:`local`}));try{for(;;){let t=await a.dialog.openFolder();if(!t)break;let n=await a.share.validateLocalFolder({folderPath:t,host:e.host,owner:e.owner,repo:e.repo});if(console.log(ae({folder_validate:n.kind})),n.kind===`ok`){let e=L.share.branch,n={currentBranch:null,headSha:null,detached:!1};try{n=await a.project.readHeadBranch(t)}catch(e){let t=e;console.warn(`[receive] local-folder readHeadBranch failed`,t instanceof Error?t.message:t)}let r=d(e,n)!==`true`;try{await a.project.open({path:t,target:`new-window`,entryPoint:`share-receive`,...r?{pendingShareBranchSwitch:{share:L.share,projectPath:t,currentBranch:n.currentBranch}}:{pendingDeepLinkTarget:E(L.share)}}),_.dismiss()}catch(e){let t=e;console.warn(`[receive] local-folder-open failed`,t instanceof Error?t.message:t),f.error(x({id:`phM8Kh`}))}break}let r=g(n,e);r&&f.error(r)}}catch(e){let t=e;console.warn(`[receive] local-folder-validate failed`,t instanceof Error?t.message:t),f.error(x({id:`rlUzXK`}))}k(!1)}};let m;t[40]!==x||t[41]!==a||t[42]!==F||t[43]!==_?(m=function(){if(F===null||F.phase!==`ready`)return;let e=F.seed;console.warn(`[receive] consent_dialog action=initialize worktree=${e.candidatePath}`),I(fe),a.project.okInit({projectPath:e.candidatePath}).then(async t=>{if(t.ok===!0){I(e=>e===null?e:S(e,{ok:!0,projectPath:t.projectPath}));try{await a.project.open({path:t.projectPath,target:`new-window`,entryPoint:`share-receive`,pendingDeepLinkTarget:{kind:e.targetKind,path:e.targetPath,repositoryPath:e.repositoryPath??e.targetPath,...e.contentRootDepth===void 0?{}:{contentRootDepth:e.contentRootDepth}},pendingBranch:e.branch}),I(de),_.dismiss()}catch(t){let n=t,r=n instanceof Error?n.message:String(n);I(e=>e===null?e:C(e,{ok:!1,message:r})),f.error(x({id:`nDT8qt`,values:{0:e.candidatePath}}))}return}let n=t.reason,r=t.message||`Initialization failed.`;I(e=>e===null?e:S(e,{ok:!1,reason:n,message:r})),f.error(r)}).catch(t=>{let n=t instanceof Error?t.message:String(t);I(e=>e===null?e:S(e,{ok:!1,reason:`network-error`,message:n})),f.error(x({id:`3Mwaly`,values:{0:e.candidatePath}}))})},t[40]=x,t[41]=a,t[42]=F,t[43]=_,t[44]=m):m=t[44];let v=m,y;t[45]!==F||t[46]!==_?(y=function(){F!==null&&console.warn(`[receive] consent_dialog action=cancel worktree=${F.seed.candidatePath}`),I(ue),_.dismiss()},t[45]=F,t[46]=_,t[47]=y):y=t[47];let b=y;if(F!==null&&F.phase!==`cancelled`&&F.phase!==`done`&&R!==null){let e=F.seed,n=F.phase===`initializing`||F.phase===`opening`,i;t[48]===b?i=t[49]:(i=e=>{e||b()},t[48]=b,t[49]=i);let a;t[50]===W?a=t[51]:(a=(0,T.jsx)(te,{children:(0,T.jsx)(r,{id:`RY6Bq1`,values:{targetNoun:W}})}),t[50]=W,t[51]=a);let u;t[52]===R.target?u=t[53]:(u=p(R.target)?`— ${p(R.target)}`:``,t[52]=R.target,t[53]=u);let d;t[54]!==R.owner||t[55]!==R.repo||t[56]!==u?(d=(0,T.jsx)(ee,{className:`sr-only`,children:(0,T.jsx)(r,{id:`pgq_xf`,values:{0:R.owner,1:R.repo,2:u}})}),t[54]=R.owner,t[55]=R.repo,t[56]=u,t[57]=d):d=t[57];let f=R.owner,ae=R.repo,m;t[58]===R.target?m=t[59]:(m=p(R.target),t[58]=R.target,t[59]=m);let h;t[60]!==R.branch||t[61]!==R.owner||t[62]!==R.repo||t[63]!==R.target.kind||t[64]!==m?(h=(0,T.jsx)(se,{owner:f,repo:ae,path:m,kind:R.target.kind,branch:R.branch,testId:`share-receive-metadata`,branchTestId:`share-receive-metadata-branch`}),t[60]=R.branch,t[61]=R.owner,t[62]=R.repo,t[63]=R.target.kind,t[64]=m,t[65]=h):h=t[65];let g;t[66]!==a||t[67]!==d||t[68]!==h?(g=(0,T.jsxs)(c,{children:[a,d,h]}),t[66]=a,t[67]=d,t[68]=h,t[69]=g):g=t[69];let oe;t[70]===Symbol.for(`react.memo_cache_sentinel`)?(oe=(0,T.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:(0,T.jsx)(r,{id:`KsAPaB`})}),t[70]=oe):oe=t[70];let _;t[71]===e.candidatePath?_=t[72]:(_=(0,T.jsx)(`p`,{className:`mt-2 break-all rounded bg-muted px-2 py-1 font-mono text-xs text-foreground/80`,"data-testid":`share-receive-consent-path`,children:e.candidatePath}),t[71]=e.candidatePath,t[72]=_);let y;t[73]===e.parentProjectName?y=t[74]:(y=e.parentProjectName===null?null:(0,T.jsx)(`p`,{className:`mt-2 text-xs text-muted-foreground`,"data-testid":`share-receive-consent-parent`,children:(0,T.jsx)(r,{id:`JmfgFc`,values:{0:e.parentProjectName}})}),t[73]=e.parentProjectName,t[74]=y);let x;t[75]===Symbol.for(`react.memo_cache_sentinel`)?(x=(0,T.jsx)(`p`,{className:`mt-3 text-sm text-muted-foreground`,children:(0,T.jsx)(r,{id:`w7SsvI`})}),t[75]=x):x=t[75];let S;t[76]!==F.message||t[77]!==F.phase?(S=F.phase===`error`?(0,T.jsx)(`p`,{className:`mt-3 text-sm text-destructive`,"data-testid":`share-receive-consent-error`,role:`alert`,children:F.message}):null,t[76]=F.message,t[77]=F.phase,t[78]=S):S=t[78];let C;t[79]!==_||t[80]!==y||t[81]!==S?(C=(0,T.jsxs)(re,{children:[oe,_,y,x,S]}),t[79]=_,t[80]=y,t[81]=S,t[82]=C):C=t[82];let w;t[83]===Symbol.for(`react.memo_cache_sentinel`)?(w=(0,T.jsx)(r,{id:`dEgA5A`}),t[83]=w):w=t[83];let E;t[84]===b?E=t[85]:(E=(0,T.jsx)(o,{variant:`ghost`,onClick:b,"data-testid":`share-receive-consent-cancel`,children:w}),t[84]=b,t[85]=E);let D=n||F.phase===`error`,O=n||F.phase===`error`,k;t[86]===n?k=t[87]:(k=n?(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(ie,{className:`mr-2 h-4 w-4`,"aria-hidden":`true`}),(0,T.jsx)(r,{id:`NKkZXl`})]}):(0,T.jsx)(r,{id:`NKkZXl`}),t[86]=n,t[87]=k);let A;t[88]!==v||t[89]!==D||t[90]!==O||t[91]!==k?(A=(0,T.jsx)(o,{onClick:v,disabled:D,"aria-disabled":O,"data-testid":`share-receive-consent-initialize`,children:k}),t[88]=v,t[89]=D,t[90]=O,t[91]=k,t[92]=A):A=t[92];let j;t[93]!==E||t[94]!==A?(j=(0,T.jsxs)(s,{children:[E,A]}),t[93]=E,t[94]=A,t[95]=j):j=t[95];let M;t[96]!==g||t[97]!==C||t[98]!==j?(M=(0,T.jsxs)(ne,{className:`sm:max-w-xl`,"data-testid":`share-receive-consent-dialog`,onInteractOutside:le,onPointerDownOutside:ce,children:[g,C,j]}),t[96]=g,t[97]=C,t[98]=j,t[99]=M):M=t[99];let ue;t[100]!==i||t[101]!==M?(ue=(0,T.jsx)(l,{open:!0,onOpenChange:i,children:M}),t[100]=i,t[101]=M,t[102]=ue):ue=t[102],U=ue;break bb0}if(!L||!R||!e){U=null;break bb0}z=h!==void 0&&!N;let D;t[103]!==x||t[104]!==N?(D=x(N?{id:`YjhKI5`}:{id:`LE7t79`}),t[103]=x,t[104]=N,t[105]=D):D=t[105],Te=D,Ee=u(e)}t[15]=x,t[16]=M,t[17]=a,t[18]=h,t[19]=N,t[20]=F,t[21]=L,t[22]=w,t[23]=R,t[24]=_,t[25]=z,t[26]=Te,t[27]=B,t[28]=V,t[29]=H,t[30]=Ee,t[31]=U,t[32]=W}else z=t[25],Te=t[26],B=t[27],V=t[28],H=t[29],Ee=t[30],U=t[31],W=t[32];if(U!==Symbol.for(`react.early_return_sentinel`))return U;let De=Ee,Oe=A?.authenticated?A.login:void 0,ke;t[106]===P?ke=t[107]:(ke=P?.detail?m(P.detail):``,t[106]=P,t[107]=ke);let Ae=ke,G;t[108]===_?G=t[109]:(G=e=>{e||_.dismiss()},t[108]=_,t[109]=G);let K;t[110]===W?K=t[111]:(K=(0,T.jsx)(te,{children:(0,T.jsx)(r,{id:`RY6Bq1`,values:{targetNoun:W}})}),t[110]=W,t[111]=K);let q;t[112]===R.target?q=t[113]:(q=p(R.target)?` — ${p(R.target)}`:null,t[112]=R.target,t[113]=q);let J;t[114]!==R.owner||t[115]!==R.repo||t[116]!==q?(J=(0,T.jsxs)(ee,{className:`sr-only`,children:[R.owner,`/`,R.repo,q]}),t[114]=R.owner,t[115]=R.repo,t[116]=q,t[117]=J):J=t[117];let je=R.owner,Me=R.repo,Y;t[118]===R.target?Y=t[119]:(Y=p(R.target),t[118]=R.target,t[119]=Y);let X;t[120]!==R.branch||t[121]!==R.owner||t[122]!==R.repo||t[123]!==R.target.kind||t[124]!==Y?(X=(0,T.jsx)(se,{owner:je,repo:Me,path:Y,kind:R.target.kind,branch:R.branch,testId:`share-receive-metadata`,branchTestId:`share-receive-metadata-branch`}),t[120]=R.branch,t[121]=R.owner,t[122]=R.repo,t[123]=R.target.kind,t[124]=Y,t[125]=X):X=t[125];let Z;t[126]!==K||t[127]!==J||t[128]!==X?(Z=(0,T.jsxs)(c,{children:[K,J,X]}),t[126]=K,t[127]=J,t[128]=X,t[129]=Z):Z=t[129];let Q;t[130]!==h||t[131]!==z||t[132]!==P||t[133]!==Ae||t[134]!==Te||t[135]!==N||t[136]!==B||t[137]!==V||t[138]!==w?(Q=P?(0,T.jsxs)(`div`,{ref:_e,tabIndex:-1,className:`rounded-lg border border-destructive/40 bg-destructive/5 p-4 outline-none`,"data-testid":`share-receive-clone-error`,children:[(0,T.jsx)(`p`,{className:`text-sm font-semibold text-foreground`,role:`alert`,children:(0,T.jsx)(r,{id:`aiArms`})}),Ae?(0,T.jsxs)(`p`,{className:`mt-2 break-words text-xs text-destructive`,"data-testid":`share-receive-clone-error-message`,children:[(0,T.jsx)(r,{id:`4BITzH`}),` `,(0,T.jsxs)(`span`,{className:`font-mono text-foreground/80`,children:[`"`,Ae,`"`]})]}):null,(0,T.jsx)(`p`,{className:`mt-3 text-sm text-muted-foreground`,children:(0,T.jsx)(r,{id:`Llyqvo`})}),(0,T.jsxs)(`ul`,{className:`mt-1 list-disc space-y-1 pl-5 text-sm text-muted-foreground`,"data-testid":`share-receive-clone-error-reasons`,children:[(0,T.jsx)(`li`,{children:(0,T.jsx)(r,{id:`6LbUG7`})}),(0,T.jsx)(`li`,{children:(0,T.jsx)(r,{id:`_pY_Vq`})}),(0,T.jsx)(`li`,{children:(0,T.jsx)(r,{id:`J6mxC1`})})]}),(0,T.jsxs)(`div`,{className:`mt-4 flex flex-wrap gap-2`,children:[(0,T.jsx)(o,{onClick:()=>{B()},"data-testid":`share-receive-clone-retry`,children:(0,T.jsx)(r,{id:`KDw4GX`})}),(0,T.jsx)(o,{variant:`outline`,onClick:()=>{V()},disabled:w||N,"data-testid":`share-receive-error-local`,children:(0,T.jsx)(r,{id:`xFQRu4`})})]})]}):(0,T.jsxs)(`div`,{className:`grid grid-cols-2 gap-3`,children:[(0,T.jsxs)(`button`,{type:`button`,"data-testid":`share-receive-clone`,className:`flex flex-col items-start gap-2 rounded-lg border border-primary/50 bg-primary/5 p-4 text-left transition hover:border-primary hover:bg-primary/10 focus-visible:border-ring focus-visible:outline-none focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 disabled:hover:border-primary/50 disabled:hover:bg-primary/5`,onClick:()=>{B()},disabled:h!==void 0&&!z,"aria-disabled":h!==void 0&&!z,children:[(0,T.jsx)(`span`,{className:`text-sm font-semibold`,children:Te}),(0,T.jsx)(`span`,{className:`line-clamp-2 text-1sm text-muted-foreground`,children:(0,T.jsx)(r,{id:`fj5YiP`})})]}),(0,T.jsxs)(`button`,{type:`button`,"data-testid":`share-receive-local`,className:`flex flex-col items-start gap-2 rounded-lg border border-border bg-card p-4 text-left transition hover:border-foreground/50 hover:bg-accent focus-visible:border-ring focus-visible:outline-none focus-visible:ring-3 focus-visible:ring-ring/50`,onClick:()=>{V()},disabled:w||N,children:[(0,T.jsx)(`span`,{className:`text-sm font-semibold`,children:(0,T.jsx)(r,{id:`HfI1dR`})}),(0,T.jsx)(`span`,{className:`line-clamp-2 text-1sm text-muted-foreground`,children:(0,T.jsx)(r,{id:`_qD6mn`})})]})]}),t[130]=h,t[131]=z,t[132]=P,t[133]=Ae,t[134]=Te,t[135]=N,t[136]=B,t[137]=V,t[138]=w,t[139]=Q):Q=t[139];let Ne;t[140]!==M||t[141]!==A||t[142]!==h||t[143]!==H||t[144]!==Oe?(Ne=h?(0,T.jsx)(`div`,{className:`mt-3 flex items-center justify-between rounded-md border border-border bg-muted/30 px-3 py-2 text-xs`,"data-testid":`share-receive-auth-banner`,role:`status`,"aria-live":`polite`,children:A===null?(0,T.jsx)(`span`,{className:`text-muted-foreground`,children:(0,T.jsx)(r,{id:`UDFrWm`})}):A.authenticated?(0,T.jsx)(`span`,{className:`text-muted-foreground`,children:(0,T.jsx)(r,{id:`VAHWL_`,values:{signedInLogin:Oe},components:{0:(0,T.jsx)(`span`,{className:`font-medium text-foreground/90`})}})}):(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(`span`,{className:`text-muted-foreground`,children:(0,T.jsx)(r,{id:`SgKLfA`})}),(0,T.jsx)(`button`,{type:`button`,"data-testid":`share-receive-signin`,className:`font-medium text-primary underline-offset-2 hover:underline focus:outline-none focus-visible:ring-2 focus-visible:ring-ring rounded`,onClick:()=>{H()},disabled:M,children:M?(0,T.jsx)(r,{id:`PKLY-1`}):(0,T.jsx)(r,{id:`3jod3l`})})]})}):null,t[140]=M,t[141]=A,t[142]=h,t[143]=H,t[144]=Oe,t[145]=Ne):Ne=t[145];let Pe;t[146]!==P||t[147]!==De?(Pe=P?null:(0,T.jsx)(`p`,{className:`mt-3 text-1sm text-muted-foreground`,children:(0,T.jsx)(r,{id:`RJ3a8Z`,values:{lookingForUrl:De},components:{0:(0,T.jsx)(`code`,{className:`rounded-sm bg-muted px-1 py-0.5 text-foreground/80`})}})}),t[146]=P,t[147]=De,t[148]=Pe):Pe=t[148];let Fe;t[149]!==Q||t[150]!==Ne||t[151]!==Pe?(Fe=(0,T.jsxs)(re,{children:[Q,Ne,Pe]}),t[149]=Q,t[150]=Ne,t[151]=Pe,t[152]=Fe):Fe=t[152];let Ie;t[153]===_?Ie=t[154]:(Ie=()=>_.dismiss(),t[153]=_,t[154]=Ie);let Le;t[155]===Symbol.for(`react.memo_cache_sentinel`)?(Le=(0,T.jsx)(r,{id:`dEgA5A`}),t[155]=Le):Le=t[155];let Re;t[156]===Ie?Re=t[157]:(Re=(0,T.jsx)(s,{children:(0,T.jsx)(o,{variant:`outline`,onClick:Ie,children:Le})}),t[156]=Ie,t[157]=Re);let $;t[158]!==Z||t[159]!==Fe||t[160]!==Re?($=(0,T.jsxs)(ne,{className:`sm:max-w-xl`,"data-testid":`share-receive-dialog`,children:[Z,Fe,Re]}),t[158]=Z,t[159]=Fe,t[160]=Re,t[161]=$):$=t[161];let ze;return t[162]!==G||t[163]!==$?(ze=(0,T.jsx)(l,{open:!0,onOpenChange:G,children:$}),t[162]=G,t[163]=$,t[164]=ze):ze=t[164],ze}function ce(e){return e.preventDefault()}function le(e){return e.preventDefault()}function ue(e){return e===null?e:w(e)}function de(e){return e===null?e:C(e,{ok:!0})}function fe(e){return e===null?e:x(e)}export{k as ShareReceiveDialog};
@@ -1 +1 @@
1
- import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./jsx-runtime-BUgB2tll.js";import{t as n}from"./react-f2sANaYj.js";import{t as r}from"./compiler-runtime-BfE3aGVn.js";import{c as i,i as a,n as o,s,t as c}from"./dialog-DgIQr9zS.js";import{a as l,i as u,n as d,o as f,r as p}from"./pending-receive-nav-store-BdbD8RKg.js";import{t as m}from"./miss-dialog-store-CNJRdTPE.js";import{f as h,p as g}from"./doc-paths-DVIJKJSX.js";var _=r(),v=e(n(),1),y=t();function b(e){let t=e.split(`/`).filter(Boolean);return t.length>0?t[t.length-1]:e}function x(){let e=(0,_.c)(2),t=(0,v.useSyncExternalStore)(m.subscribe,m.getSnapshot,S);if(t===null)return null;let n;return e[0]===t?n=e[1]:(n=(0,y.jsx)(C,{nav:t},t.path),e[0]=t,e[1]=n),n}function S(){return null}function C(e){let t=(0,_.c)(28),{nav:n}=e,{state:r,refetch:v}=f(n),x;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(x=function(){m.dismiss()},t[0]=x):x=t[0];let S=x,C;t[1]===n.path?C=t[2]:(C=function(){window.location.hash=g(l(n.path)),S()},t[1]=n.path,t[2]=C);let w=C,T;t[3]===n?T=t[4]:(T=function(e){p.arm(d(n,e)),window.location.hash=n.kind===`folder`?g(e):h(e),S()},t[3]=n,t[4]=T);let E=T,D;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(D=e=>{e||S()},t[5]=D):D=t[5];let O=r.phase,k=r.phase===`resolved`?r.resolution.verdict:void 0,A;t[6]===n.path?A=t[7]:(A=b(n.path),t[6]=n.path,t[7]=A);let j;t[8]===A?j=t[9]:(j=(0,y.jsx)(s,{children:(0,y.jsx)(i,{className:`truncate`,children:A})}),t[8]=A,t[9]=j);let M=r.phase===`pending`?`flex flex-col items-center justify-center gap-3 py-6 text-center text-sm text-muted-foreground`:`flex flex-col items-center justify-center gap-6 py-2 text-center`,N;t[10]!==n.path||t[11]!==E?(N=()=>E(n.path),t[10]=n.path,t[11]=E,t[12]=N):N=t[12];let P;t[13]!==w||t[14]!==n||t[15]!==E||t[16]!==v||t[17]!==r||t[18]!==N?(P=(0,y.jsx)(u,{nav:n,state:r,onBrowseFolder:w,onOpenRenamed:E,onEnableAutoSync:S,onSyncCompleted:v,onPullApplied:N}),t[13]=w,t[14]=n,t[15]=E,t[16]=v,t[17]=r,t[18]=N,t[19]=P):P=t[19];let F;t[20]!==P||t[21]!==M?(F=(0,y.jsx)(o,{className:M,children:P}),t[20]=P,t[21]=M,t[22]=F):F=t[22];let I;return t[23]!==r.phase||t[24]!==F||t[25]!==k||t[26]!==j?(I=(0,y.jsx)(c,{open:!0,onOpenChange:D,children:(0,y.jsxs)(a,{className:`sm:max-w-md`,"data-testid":`share-receive-miss-dialog`,"data-phase":O,"data-verdict":k,children:[j,F]})}),t[23]=r.phase,t[24]=F,t[25]=k,t[26]=j,t[27]=I):I=t[27],I}export{x as ShareReceiveMissDialog};
1
+ import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./jsx-runtime-BUgB2tll.js";import{t as n}from"./react-f2sANaYj.js";import{t as r}from"./compiler-runtime-BfE3aGVn.js";import{c as i,i as a,n as o,s,t as c}from"./dialog-DgIQr9zS.js";import{a as l,i as u,n as d,o as f,r as p}from"./pending-receive-nav-store-BIPhAGuN.js";import{t as m}from"./miss-dialog-store-CNJRdTPE.js";import{f as h,p as g}from"./doc-paths-ZgPMU9hv.js";var _=r(),v=e(n(),1),y=t();function b(e){let t=e.split(`/`).filter(Boolean);return t.length>0?t[t.length-1]:e}function x(){let e=(0,_.c)(2),t=(0,v.useSyncExternalStore)(m.subscribe,m.getSnapshot,S);if(t===null)return null;let n;return e[0]===t?n=e[1]:(n=(0,y.jsx)(C,{nav:t},t.path),e[0]=t,e[1]=n),n}function S(){return null}function C(e){let t=(0,_.c)(28),{nav:n}=e,{state:r,refetch:v}=f(n),x;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(x=function(){m.dismiss()},t[0]=x):x=t[0];let S=x,C;t[1]===n.path?C=t[2]:(C=function(){window.location.hash=g(l(n.path)),S()},t[1]=n.path,t[2]=C);let w=C,T;t[3]===n?T=t[4]:(T=function(e){p.arm(d(n,e)),window.location.hash=n.kind===`folder`?g(e):h(e),S()},t[3]=n,t[4]=T);let E=T,D;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(D=e=>{e||S()},t[5]=D):D=t[5];let O=r.phase,k=r.phase===`resolved`?r.resolution.verdict:void 0,A;t[6]===n.path?A=t[7]:(A=b(n.path),t[6]=n.path,t[7]=A);let j;t[8]===A?j=t[9]:(j=(0,y.jsx)(s,{children:(0,y.jsx)(i,{className:`truncate`,children:A})}),t[8]=A,t[9]=j);let M=r.phase===`pending`?`flex flex-col items-center justify-center gap-3 py-6 text-center text-sm text-muted-foreground`:`flex flex-col items-center justify-center gap-6 py-2 text-center`,N;t[10]!==n.path||t[11]!==E?(N=()=>E(n.path),t[10]=n.path,t[11]=E,t[12]=N):N=t[12];let P;t[13]!==w||t[14]!==n||t[15]!==E||t[16]!==v||t[17]!==r||t[18]!==N?(P=(0,y.jsx)(u,{nav:n,state:r,onBrowseFolder:w,onOpenRenamed:E,onEnableAutoSync:S,onSyncCompleted:v,onPullApplied:N}),t[13]=w,t[14]=n,t[15]=E,t[16]=v,t[17]=r,t[18]=N,t[19]=P):P=t[19];let F;t[20]!==P||t[21]!==M?(F=(0,y.jsx)(o,{className:M,children:P}),t[20]=P,t[21]=M,t[22]=F):F=t[22];let I;return t[23]!==r.phase||t[24]!==F||t[25]!==k||t[26]!==j?(I=(0,y.jsx)(c,{open:!0,onOpenChange:D,children:(0,y.jsxs)(a,{className:`sm:max-w-md`,"data-testid":`share-receive-miss-dialog`,"data-phase":O,"data-verdict":k,children:[j,F]})}),t[23]=r.phase,t[24]=F,t[25]=k,t[26]=j,t[27]=I):I=t[27],I}export{x as ShareReceiveMissDialog};