@p4code/cli 0.9.13 → 0.9.14

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 (335) hide show
  1. package/dist/AcpMcpStdioBridge-BinVfs5k.mjs +3 -0
  2. package/dist/{AcpMcpStdioBridge-DGUY2q8q.mjs → AcpMcpStdioBridge-z_p02VlR.mjs} +3 -3
  3. package/dist/{Effect-Cus50zSB.mjs → Effect-Bwkv2ifD.mjs} +25 -2
  4. package/dist/{Schema-B1iWvOKX.mjs → Schema-CFgoTmE6.mjs} +2 -2
  5. package/dist/{Stream-XZd8srjf.mjs → Stream-B4Gds95A.mjs} +2 -2
  6. package/dist/bin.mjs +2 -2
  7. package/dist/{binCli-D22yxtxv.mjs → binCli-BGRfVnO9.mjs} +4702 -3660
  8. package/dist/claude-history-worker.mjs +1 -1
  9. package/dist/{claudeHistoryWorker-Ew_jxLJH.mjs → claudeHistoryWorker-DVpahhef.mjs} +2 -2
  10. package/dist/client/.vite/manifest.json +2140 -2099
  11. package/dist/client/assets/{2NI2N5EU-DBKJSvEQ.js → 2NI2N5EU-Bk2qNhha.js} +2 -2
  12. package/dist/client/assets/{4UO7MD6I-1JuY3zN7.js → 4UO7MD6I-CPV9277r.js} +2 -2
  13. package/dist/client/assets/{5B3SVYGG-CwgmePuE.js → 5B3SVYGG-LgRjxbnj.js} +2 -2
  14. package/dist/client/assets/{5GK6JWQ2-D9VJsozU.js → 5GK6JWQ2-9ndiKpIs.js} +2 -2
  15. package/dist/client/assets/{5N7A7DKN-CFgZoUw5.js → 5N7A7DKN-DnUhiayz.js} +2 -2
  16. package/dist/client/assets/{5OC2THR4-Cx6keXWX.js → 5OC2THR4-DxmpZihk.js} +2 -2
  17. package/dist/client/assets/{5S6HY5KT-Ce1reKKv.js → 5S6HY5KT-C4cUz8RB.js} +2 -2
  18. package/dist/client/assets/{6IMQ5BUJ-D7X0q9kf.js → 6IMQ5BUJ-2G8Rrp9t.js} +2 -2
  19. package/dist/client/assets/{6OLKWJ4F-YLfMA9aH.js → 6OLKWJ4F-CW3F_AM6.js} +2 -2
  20. package/dist/client/assets/{74OO7NKP-Wm5pZPTC.js → 74OO7NKP-z5ujM5KH.js} +2 -2
  21. package/dist/client/assets/{75O6YZUN-D2He6_fp.js → 75O6YZUN-CSeaYNtt.js} +2 -2
  22. package/dist/client/assets/{77XECAW3-CV_JLSeU.js → 77XECAW3-DxL0AHyZ.js} +2 -2
  23. package/dist/client/assets/{ABYRPUBD-D0xOVN1A.js → ABYRPUBD-DvBcJj7G.js} +2 -2
  24. package/dist/client/assets/AlertDialogRoot-z7O2CaB2.js +2 -0
  25. package/dist/client/assets/{AnimatedHeight-yuTG4G03.js → AnimatedHeight-DChvigzz.js} +2 -2
  26. package/dist/client/assets/{AuthSurfaceShell-CCBOJP5G.js → AuthSurfaceShell-29ykag3m.js} +2 -2
  27. package/dist/client/assets/{BB2UYUI2-BdXGRPif.js → BB2UYUI2-Cun87LIm.js} +2 -2
  28. package/dist/client/assets/{BUM34MOA-isqGnSvm.js → BUM34MOA-D6aIFnwf.js} +2 -2
  29. package/dist/client/assets/{CEQABKGZ-DE0PWXRq.js → CEQABKGZ-DYzEk-9p.js} +2 -2
  30. package/dist/client/assets/{CXAC5362-0Zr5tv4C.js → CXAC5362-CdQgNtpk.js} +2 -2
  31. package/dist/client/assets/ChatGptUsageButton-DQjnXjt6.js +2 -0
  32. package/dist/client/assets/ChatMarkdown-C7ocX514.js +48 -0
  33. package/dist/client/assets/{CheckboxIndicator-lkbFKbE7.js → CheckboxIndicator-D2jNOqVc.js} +2 -2
  34. package/dist/client/assets/{ClippedText-Bf8FSQkX.js → ClippedText-CDOkzr7r.js} +2 -2
  35. package/dist/client/assets/{CodexSetupSection.logic-SHExnMKR.js → CodexSetupSection.logic-BIpypa3y.js} +2 -2
  36. package/dist/client/assets/{ComboboxClear-B0HJXjbz.js → ComboboxClear-CPvB2whi.js} +2 -2
  37. package/dist/client/assets/{ComboboxGroupLabel-CMc5xUrd.js → ComboboxGroupLabel-DN75A_2f.js} +2 -2
  38. package/dist/client/assets/{CommandBlock-CluJmhVo.js → CommandBlock-DBGDwDRu.js} +2 -2
  39. package/dist/client/assets/{CompositeRoot-BMHKb-nN.js → CompositeRoot-Jf3zEGLN.js} +2 -2
  40. package/dist/client/assets/{ConnectAgentSurface-CNWdh9ck.js → ConnectAgentSurface-Cv2oB5Cw.js} +2 -2
  41. package/dist/client/assets/{ConnectionStatusDot-CpmZ8NE5.js → ConnectionStatusDot-C_9jtSee.js} +2 -2
  42. package/dist/client/assets/{DRLTVNUE-Dttc5MrD.js → DRLTVNUE-CftE6Aa3.js} +2 -2
  43. package/dist/client/assets/{DYY6UVD2-DTrZAR1D.js → DYY6UVD2-DezK9sBO.js} +2 -2
  44. package/dist/client/assets/DevicePanel-CKWUjHEE.js +2 -0
  45. package/dist/client/assets/DeviceSetup-BrOsu1Y4.js +2 -0
  46. package/dist/client/assets/{DialogTitle-pLX9Mw1n.js → DialogTitle-COHuuWBE.js} +2 -2
  47. package/dist/client/assets/{DiffCommentAnnotation-6V9nI3Cm.js → DiffCommentAnnotation-QtrnUuSs.js} +2 -2
  48. package/dist/client/assets/{DiffFileTree-CBEjDul5.js → DiffFileTree-B_4bn5J8.js} +2 -2
  49. package/dist/client/assets/DiffPanel-CGIIHSDI.js +2 -0
  50. package/dist/client/assets/{DiffWorkerPoolProvider-f4-YQsHo.js → DiffWorkerPoolProvider-CtpHksSf.js} +3 -3
  51. package/dist/client/assets/{EmbeddedDesign-DSEjf0KK.js → EmbeddedDesign-BU5m6_ou.js} +5 -5
  52. package/dist/client/assets/{EnvironmentMachineIcon-B6wAZat7.js → EnvironmentMachineIcon-DTUBsEaI.js} +2 -2
  53. package/dist/client/assets/{ExpandableText-Cjat32hh.js → ExpandableText-Wij8nL6W.js} +2 -2
  54. package/dist/client/assets/{FNOVOB4O-LisHSqAM.js → FNOVOB4O-DHCmE6LN.js} +2 -2
  55. package/dist/client/assets/{FieldControl-DwBVFJAI.js → FieldControl-Yp1Yjlg7.js} +2 -2
  56. package/dist/client/assets/{FileDiff-Bj9kBLN2.js → FileDiff-CAtJtUC5.js} +2 -2
  57. package/dist/client/assets/FilePreviewPanel-CjKP3Q7G.js +34 -0
  58. package/dist/client/assets/{FoldedSettingsSection-DIlgxayr.js → FoldedSettingsSection-CAZumPht.js} +2 -2
  59. package/dist/client/assets/{FormContext-DcnLkh-4.js → FormContext-BEFZtJu9.js} +2 -2
  60. package/dist/client/assets/{HDGCDEEZ-Bn1jLSys.js → HDGCDEEZ-DNHIctoG.js} +2 -2
  61. package/dist/client/assets/{HSJLKHB7-CHpiqxlA.js → HSJLKHB7-BfNhUjhw.js} +2 -2
  62. package/dist/client/assets/{Icons-Be1TL1sN.js → Icons-DYaY7Otq.js} +2 -2
  63. package/dist/client/assets/Input-CVeLgfX4.js +2 -0
  64. package/dist/client/assets/JZOYTAAL-Bngs0npp.js +1 -0
  65. package/dist/client/assets/{K3MD6TGW-D5oCFPkP.js → K3MD6TGW-D-q4Z_68.js} +2 -2
  66. package/dist/client/assets/{K7RP3OMA-ZIPW--CU.js → K7RP3OMA-C5AEGeo9.js} +2 -2
  67. package/dist/client/assets/{KeybindingsSettings.logic-Ctmq4InP.js → KeybindingsSettings.logic-A_266dBm.js} +2 -2
  68. package/dist/client/assets/{LHDIQX7Q-BkDTNH4X.js → LHDIQX7Q-CY4nmSyZ.js} +2 -2
  69. package/dist/client/assets/{LUXOKEGN-BMFFLlMk.js → LUXOKEGN-BHmzrQMD.js} +2 -2
  70. package/dist/client/assets/{LinkMachineSelect-DGm4EDKi.js → LinkMachineSelect-tm04n5mK.js} +2 -2
  71. package/dist/client/assets/{MathTypeset-DpXMOBGY.js → MathTypeset-C1sAcsZE.js} +2 -2
  72. package/dist/client/assets/{N3JZAHOW-CV9TIlCo.js → N3JZAHOW-D1VvHXNc.js} +2 -2
  73. package/dist/client/assets/{NUIALGQ3-WBqakHka.js → NUIALGQ3-DKQw5Xvm.js} +2 -2
  74. package/dist/client/assets/{NoProjectsHero-BfU7AxbB.js → NoProjectsHero-DVJOMY01.js} +2 -2
  75. package/dist/client/assets/{O65XPQGZ-CYhr2tYZ.js → O65XPQGZ-B7xlpxd0.js} +2 -2
  76. package/dist/client/assets/{O7XIQ6OM-D2JMbFqc.js → O7XIQ6OM-D_yohKEz.js} +2 -2
  77. package/dist/client/assets/{OFQON5FD-B1aTfx9o.js → OFQON5FD-Eb1UafMJ.js} +2 -2
  78. package/dist/client/assets/{P4ConnectAccountPages-J205rNHS.js → P4ConnectAccountPages-BkOCG7hq.js} +2 -2
  79. package/dist/client/assets/{P4ConnectSidebarSignIn-Bc4xlsJh.js → P4ConnectSidebarSignIn-BarFXVdD.js} +2 -2
  80. package/dist/client/assets/{PJQHF43J-Dm3RMjWi.js → PJQHF43J-xu8MNrTl.js} +2 -2
  81. package/dist/client/assets/PanelLayoutControls-amKHUz1V.js +216 -0
  82. package/dist/client/assets/{PierreEntryIcon-CHy821MU.js → PierreEntryIcon-CbhCWTjd.js} +2 -2
  83. package/dist/client/assets/{PopoverHandle-BkzqaTB6.js → PopoverHandle-DbGxLy3d.js} +2 -2
  84. package/dist/client/assets/PreviewPanel-B1KmgL5R.js +2 -0
  85. package/dist/client/assets/ProjectDefaultsSettings-D_2ixmme.js +2 -0
  86. package/dist/client/assets/{ProjectFavicon-LcyFYpHB.js → ProjectFavicon-BXd2O1Gh.js} +3 -3
  87. package/dist/client/assets/{ProjectIconPickerDialog-D03-Jrsi.js → ProjectIconPickerDialog-Ccwf3eo1.js} +2 -2
  88. package/dist/client/assets/{ProjectMonogram-C8FlNLaU.js → ProjectMonogram-Bui44V7z.js} +2 -2
  89. package/dist/client/assets/{ProviderAuthTerminal-DMTbKboR.js → ProviderAuthTerminal-DjIpg2-V.js} +2 -2
  90. package/dist/client/assets/ProviderModelPicker-DJl5IM1n.js +2 -0
  91. package/dist/client/assets/{ProviderSettingsForm-DrCFln8c.js → ProviderSettingsForm-sjzQFb8p.js} +2 -2
  92. package/dist/client/assets/PullRequestCodeTab-BcFFbURH.js +6 -0
  93. package/dist/client/assets/{RHNBAITX-C7mnxleL.js → RHNBAITX-DWaFNhmX.js} +2 -2
  94. package/dist/client/assets/ReadOnlySourcePreview-DDDARz8g.js +2 -0
  95. package/dist/client/assets/{RedactedSensitiveText-DACYfm7e.js → RedactedSensitiveText-BFwVjGRJ.js} +2 -2
  96. package/dist/client/assets/{RenderErrorBoundary-CIVNp8r9.js → RenderErrorBoundary-DianZAsM.js} +4 -4
  97. package/dist/client/assets/RightPanelResizeHandle-DstJn39I.js +2 -0
  98. package/dist/client/assets/{SLD4V6NK-BkeVs7gb.js → SLD4V6NK-kuRIO20K.js} +2 -2
  99. package/dist/client/assets/ScheduledTasksSettings-BHT9WAFD.js +6 -0
  100. package/dist/client/assets/{ScopedSwitch-D1uscoF8.js → ScopedSwitch-B7HEwool.js} +2 -2
  101. package/dist/client/assets/{ScrollAreaCorner-DBtks1xb.js → ScrollAreaCorner-DW6lxPPn.js} +2 -2
  102. package/dist/client/assets/{SecretInput-ZW3hnCoN.js → SecretInput-CxRazSuj.js} +2 -2
  103. package/dist/client/assets/{SelectScrollUpArrow-Bq-GYRhT.js → SelectScrollUpArrow-DZfqWvZD.js} +2 -2
  104. package/dist/client/assets/SelfImproveSettingsSection-BxPUr-AT.js +2 -0
  105. package/dist/client/assets/SettingsPanels-CrMsCqvq.js +46 -0
  106. package/dist/client/assets/{SettingsPanels.logic-H5v8FTnu.js → SettingsPanels.logic-B406HX50.js} +2 -2
  107. package/dist/client/assets/{SettingsScopeNotice-gFtgpybO.js → SettingsScopeNotice-Dt7vuLO5.js} +2 -2
  108. package/dist/client/assets/{SidebarStageBackdrop-DSuAw8Ob.js → SidebarStageBackdrop-BzsUCj2G.js} +2 -2
  109. package/dist/client/assets/{T3PCR2KE-D6MHoseG.js → T3PCR2KE-C14xVwSj.js} +2 -2
  110. package/dist/client/assets/{TKWO2OVW-gZK7dLQZ.js → TKWO2OVW-CC_4uZad.js} +2 -2
  111. package/dist/client/assets/{TSHNXIZL-BKUmF3Cu.js → TSHNXIZL-Kizqv5oh.js} +2 -2
  112. package/dist/client/assets/{ThemeEditorPanel-lI_9CbBH.js → ThemeEditorPanel-BuMI6s2A.js} +3 -3
  113. package/dist/client/assets/{ComposerPromptEditor-DR1WsmjD.js → ThreadDetailsItemsMenu-CSCIFtTP.js} +60 -60
  114. package/dist/client/assets/ThreadTerminalDrawer-FZ0zyNm1.js +5 -0
  115. package/dist/client/assets/TooltipViewport-DjveMpIl.js +2 -0
  116. package/dist/client/assets/{UQJE5E4I-D6av033t.js → UQJE5E4I-KUX5qtvS.js} +2 -2
  117. package/dist/client/assets/{USNYFO5S-Cy6sDMEU.js → USNYFO5S-XMF6TRXj.js} +2 -2
  118. package/dist/client/assets/{Virtualizer-B_IsUzcr.js → Virtualizer-CqFZ9IgG.js} +2 -2
  119. package/dist/client/assets/{WEVWDWVA-Cq1fZcng.js → WEVWDWVA-BNUvxLQd.js} +2 -2
  120. package/dist/client/assets/{WorkspaceBreadcrumb-DbQW7iNE.js → WorkspaceBreadcrumb-DyZsM9TF.js} +2 -2
  121. package/dist/client/assets/{WorkspacePageContainer-BxI-x0oV.js → WorkspacePageContainer-DFXSkFyh.js} +2 -2
  122. package/dist/client/assets/{WorkspacePageHeader-Bc_F6Uog.js → WorkspacePageHeader-FTc6UfB-.js} +2 -2
  123. package/dist/client/assets/{X5RFHQXM-DdtKPA-W.js → X5RFHQXM-BtifjFQb.js} +2 -2
  124. package/dist/client/assets/{X62E3GBT-C7OjB5pB.js → X62E3GBT-DT_qCIPw.js} +2 -2
  125. package/dist/client/assets/{XBNEOJTC-_Tbl2Kwh.js → XBNEOJTC-7FdMX9IP.js} +2 -2
  126. package/dist/client/assets/{YHV2MVVZ-CA4YS5f4.js → YHV2MVVZ-D6KCo9Qp.js} +2 -2
  127. package/dist/client/assets/{YURCZMG2-DSnhUUsH.js → YURCZMG2-D0_CST6F.js} +2 -2
  128. package/dist/client/assets/{YVG2LODB-D-qFsH5t.js → YVG2LODB-CRU4fKD2.js} +2 -2
  129. package/dist/client/assets/_chat-P2jEGe91.js +47 -0
  130. package/dist/client/assets/{_chat.design-SX7SShjI.js → _chat.design-k56_YrCY.js} +2 -2
  131. package/dist/client/assets/{_chat.index-Bz1lJLpv.js → _chat.index-CUR_1FMo.js} +2 -2
  132. package/dist/client/assets/{_chat.new-BEqc5oJc.js → _chat.new-7EgBpaGD.js} +2 -2
  133. package/dist/client/assets/_chat.pull-requests-C97pdH91.js +2 -0
  134. package/dist/client/assets/{alert-BOVMKHDy.js → alert-D0u2-4Zh.js} +2 -2
  135. package/dist/client/assets/{alert-dialog-Du3fYY3I.js → alert-dialog-DK40IDMO.js} +2 -2
  136. package/dist/client/assets/{assetUrls-CYjvy6P4.js → assetUrls-ChygJppW.js} +2 -2
  137. package/dist/client/assets/assets-Cv1qxio9.js +2 -0
  138. package/dist/client/assets/{browserHistoryStore-CdncPjG8.js → browserHistoryStore-PB9BBl0N.js} +2 -2
  139. package/dist/client/assets/{browserLinkTarget-Bf9H9UVe.js → browserLinkTarget-BOF3rlV5.js} +2 -2
  140. package/dist/client/assets/{checkbox-d50pgAVe.js → checkbox-bsJs8Zu-.js} +2 -2
  141. package/dist/client/assets/{color-picker-zcQshxaE.js → color-picker-W4KTEgfL.js} +2 -2
  142. package/dist/client/assets/{combobox-BrCd1kH5.js → combobox-UDn50qHb.js} +2 -2
  143. package/dist/client/assets/{command-DFkhX6wm.js → command-C7CgDZ25.js} +2 -2
  144. package/dist/client/assets/{connect-DkH09d_M.js → connect-CguaBRtJ.js} +2 -2
  145. package/dist/client/assets/connect-agent-BitywHYq.js +2 -0
  146. package/dist/client/assets/{design-DrpehYJf.js → design-NrL4Xyzh.js} +2 -2
  147. package/dist/client/assets/device-DsIsK_g9.js +2 -0
  148. package/dist/client/assets/{dialog-BpR3dRVS.js → dialog-BEXthTAp.js} +2 -2
  149. package/dist/client/assets/{diffRendering-BuOJdnZ8.js → diffRendering-DosiBwUN.js} +2 -2
  150. package/dist/client/assets/{dist-CMJL98Oz.js → dist-p5OtQFc9.js} +3 -3
  151. package/dist/client/assets/{draft-input-CzfhM72Z.js → draft-input-Cp7zSsLs.js} +2 -2
  152. package/dist/client/assets/{duoViewer-ChrCWcjO.js → duoViewer-BcsodgGy.js} +2 -2
  153. package/dist/client/assets/{dynamic-CVt07u2H.js → dynamic-XOmtS0-B.js} +3 -3
  154. package/dist/client/assets/{embeddedScripts-BWqMWwOU.js → embeddedScripts-BQl_ld6u.js} +2 -2
  155. package/dist/client/assets/{empty-Cy-8us9l.js → empty-CTv2Unxd.js} +2 -2
  156. package/dist/client/assets/entities-Ci9sZwRJ.js +2 -0
  157. package/dist/client/assets/env-BfPir1X4.js +2 -0
  158. package/dist/client/assets/{fileLinks-BgHa8yE4.js → fileLinks-T2ko6Qmp.js} +2 -2
  159. package/dist/client/assets/{fileTreeExpansion-CBn1SzSX.js → fileTreeExpansion-BOutPxUH.js} +2 -2
  160. package/dist/client/assets/{getDiffFileInput-IQ1TDM4E.js → getDiffFileInput-Do7OSxYn.js} +2 -2
  161. package/dist/client/assets/{guideRunStore-DfNfJUIu.js → guideRunStore-DGAK_XSV.js} +2 -2
  162. package/dist/client/assets/{htmlRender-lwQ3HyqS.js → htmlRender-DAhG7IlW.js} +2 -2
  163. package/dist/client/assets/index-4XHdM2Yx.js +3 -0
  164. package/dist/client/assets/{input-FUjAUGXY.js → input-BGKmQVHf.js} +2 -2
  165. package/dist/client/assets/{input-group-BdZ_CKvG.js → input-group-BdgWY0OZ.js} +2 -2
  166. package/dist/client/assets/{kbd-CGgmav-Q.js → kbd-BIypvknl.js} +2 -2
  167. package/dist/client/assets/key-round-POn1aRXW.js +2 -0
  168. package/dist/client/assets/{keybindings-DuCyi9aT.js → keybindings-C0ntbKmL.js} +2 -2
  169. package/dist/client/assets/{lazy-Bs2SFpYS.js → lazy-DudfZwDr.js} +4 -4
  170. package/dist/client/assets/{lazyRouteComponent-CYNRqeNP.js → lazyRouteComponent-VtherrNw.js} +2 -2
  171. package/dist/client/assets/{link-DW1IQk5s.js → link--eZ8ZXuK.js} +2 -2
  172. package/dist/client/assets/{linkedPrompt-yo2xi4Z8.js → linkedPrompt-DRNVlalr.js} +2 -2
  173. package/dist/client/assets/main-CKOKCTSr.css +2 -0
  174. package/dist/client/assets/main-CRJyb41E.js +37 -0
  175. package/dist/client/assets/{mediaReference-BQ9J-tjl.js → mediaReference-CMwg4kE3.js} +2 -2
  176. package/dist/client/assets/mediaSource-BQpgJ9hG.js +2 -0
  177. package/dist/client/assets/number-field-pjPmm2hH.js +2 -0
  178. package/dist/client/assets/{observeResize-CZuDzlcZ.js → observeResize-CV41SgJr.js} +2 -2
  179. package/dist/client/assets/{onboarding-CE8pzS12.js → onboarding-C7BynXti.js} +2 -2
  180. package/dist/client/assets/openFileInPreview-Cs7GoIEO.js +2 -0
  181. package/dist/client/assets/{p4ProjectFile-jwYvYDE-.js → p4ProjectFile-DqqWNGdD.js} +2 -2
  182. package/dist/client/assets/{pair-OPslYcM9.js → pair-Wl7C9P9c.js} +2 -2
  183. package/dist/client/assets/{pendingSendStore-CLwMM17y.js → pendingSendStore-CFKdq-QP.js} +2 -2
  184. package/dist/client/assets/{phoneViewer-CkTxyA9N.js → phoneViewer-C1sFfV5x.js} +2 -2
  185. package/dist/client/assets/{pierre-icons-DY8ZeGCr.js → pierre-icons-2mAt8csu.js} +2 -2
  186. package/dist/client/assets/{popover-hYAmvSJj.js → popover-oNrAhEOs.js} +2 -2
  187. package/dist/client/assets/{preview-CI9HEdfV.js → preview-CAzlFJXG.js} +2 -2
  188. package/dist/client/assets/{preview-YhZE3kRt.js → preview-D8H2Itzr.js} +2 -2
  189. package/dist/client/assets/{previewMiniPlayerStore-DUPe1gGI.js → previewMiniPlayerStore-DwJUVJAq.js} +2 -2
  190. package/dist/client/assets/primary-BdVzsWIK.js +2 -0
  191. package/dist/client/assets/primaryCloudLinkState-eu2avrjG.js +2 -0
  192. package/dist/client/assets/projectFilesQueryState-f8odJKc-.js +2 -0
  193. package/dist/client/assets/{projectScriptEditor-C0FBhCbn.js → projectScriptEditor-D8Os7g21.js} +2 -2
  194. package/dist/client/assets/{providerSkills-Ca_7EbAx.js → providerSkills-B9Q5OmXk.js} +2 -2
  195. package/dist/client/assets/{pullRequestDetail.logic-DYx7bEwE.js → pullRequestDetail.logic-CVJbFct1.js} +4 -4
  196. package/dist/client/assets/{pullRequestIcons-csprKuju.js → pullRequestIcons-ZE5MB0dW.js} +2 -2
  197. package/dist/client/assets/{pullRequestReviewStore-_uEYgfaW.js → pullRequestReviewStore-CF0UmQoG.js} +2 -2
  198. package/dist/client/assets/pullRequests-p7FMtHTx.js +2 -0
  199. package/dist/client/assets/queries-C1_RUJ-8.js +2 -0
  200. package/dist/client/assets/query-DszcgUku.js +2 -0
  201. package/dist/client/assets/{radio-group-IyWHDcIP.js → radio-group-Cb2KobOI.js} +2 -2
  202. package/dist/client/assets/{renderScheduler-DR2WAtIH.js → renderScheduler-BLYWx2Dl.js} +2 -2
  203. package/dist/client/assets/rightPanelStore-BzpX6F8n.js +2 -0
  204. package/dist/client/assets/runtime-CcgzOADx.js +6 -0
  205. package/dist/client/assets/runtime-D2NRh41I.js +3 -0
  206. package/dist/client/assets/{runtimeModeConfig-DFxXOIlV.js → runtimeModeConfig-DTaQ5JjA.js} +2 -2
  207. package/dist/client/assets/{scheduledTasksSettings.logic-W9AQpJk4.js → scheduledTasksSettings.logic-FST8Bc6V.js} +3 -3
  208. package/dist/client/assets/{scroll-area-Cf7uLi_s.js → scroll-area-BN4-XX3T.js} +2 -2
  209. package/dist/client/assets/{select-vBkqTMKL.js → select-CHOl11x1.js} +2 -2
  210. package/dist/client/assets/{selfImproveFindings-4GGN9cRm.js → selfImproveFindings-BTdfhZ3z.js} +2 -2
  211. package/dist/client/assets/server-C-cSQN_G.js +2 -0
  212. package/dist/client/assets/{session-BIwsf8Q4.js → session-D6BRf77P.js} +2 -2
  213. package/dist/client/assets/{session-logic-D8FbVFDm.js → session-logic-BwAELIPU.js} +5 -5
  214. package/dist/client/assets/{settings-C58Y7hMl.js → settings-fuKhbSed.js} +2 -2
  215. package/dist/client/assets/{settings.appearance-C9ZmuG-n.js → settings.appearance-K-0McYk9.js} +2 -2
  216. package/dist/client/assets/settings.archived-CalSrYkZ.js +2 -0
  217. package/dist/client/assets/{settings.computer-use-CeIs-8zf.js → settings.computer-use-C8dDJqmo.js} +2 -2
  218. package/dist/client/assets/settings.connections-D_XSkcFH.js +2 -0
  219. package/dist/client/assets/{settings.data-controls-BbzJxjBi.js → settings.data-controls-CTlXbRrO.js} +2 -2
  220. package/dist/client/assets/{settings.decisions-DagsCV4K.js → settings.decisions-C1RgAwXn.js} +2 -2
  221. package/dist/client/assets/{settings.designs-DEThhuEj.js → settings.designs-BgEqEGXM.js} +2 -2
  222. package/dist/client/assets/settings.diagnostics-BxqI_9bx.js +2 -0
  223. package/dist/client/assets/{settings.general-RgU1jNmB.js → settings.general-BeLPMggF.js} +2 -2
  224. package/dist/client/assets/settings.integrations-4rKfTDFW.js +2 -0
  225. package/dist/client/assets/{settings.keybindings-CU8fBQaI.js → settings.keybindings-DSavoJxs.js} +2 -2
  226. package/dist/client/assets/{settings.open-source-licenses-rG8Neftl.js → settings.open-source-licenses-DWVgu9MJ.js} +2 -2
  227. package/dist/client/assets/{settings.plugins-Dr0VpcPy.js → settings.plugins-DsfEfMST.js} +4 -4
  228. package/dist/client/assets/settings.projects-CJzRAMVM.js +4 -0
  229. package/dist/client/assets/settings.providers-BoTCdGuy.js +3 -0
  230. package/dist/client/assets/{settings.scheduled-tasks-DwUd14Xj.js → settings.scheduled-tasks-BJMUub-y.js} +2 -2
  231. package/dist/client/assets/settings.secrets-Ch_XS6ak.js +2 -0
  232. package/dist/client/assets/{settings.snap-shot-CTMJRtJe.js → settings.snap-shot-6aF3J4Zd.js} +2 -2
  233. package/dist/client/assets/{settings.source-control-BHD5KE8W.js → settings.source-control-B7PW3yi5.js} +2 -2
  234. package/dist/client/assets/{settings.storage-Bhd9ragP.js → settings.storage-PmxiGFaE.js} +2 -2
  235. package/dist/client/assets/settingsLayout-fG812pJ2.js +3 -0
  236. package/dist/client/assets/{sidebar-O52WtiJv.js → sidebar-Dt9UYgk1.js} +2 -2
  237. package/dist/client/assets/{sidebarProjectGrouping-BYVdJp_w.js → sidebarProjectGrouping-lpBYOlht.js} +2 -2
  238. package/dist/client/assets/{skeleton-PlPtYr_f.js → skeleton-BiqtjWsk.js} +2 -2
  239. package/dist/client/assets/{sourceControl-BkJeQRrv.js → sourceControl-BUEFlHbW.js} +2 -2
  240. package/dist/client/assets/{sourceControlClients-CtMx7u86.js → sourceControlClients-Bcd4sqEi.js} +2 -2
  241. package/dist/client/assets/{spinner-BZ5ohCyO.js → spinner-C64jtA3m.js} +2 -2
  242. package/dist/client/assets/{terminal-links-UI2UJn0y.js → terminal-links-DxE1mEi0.js} +2 -2
  243. package/dist/client/assets/{terminalSessions-C1xOLG3i.js → terminalSessions-Ceajv0BZ.js} +2 -2
  244. package/dist/client/assets/{textarea-DIg__-Gi.js → textarea-DtceyvOF.js} +2 -2
  245. package/dist/client/assets/{themePalette-BMlBfFUx.js → themePalette-tZPF0oN0.js} +3 -3
  246. package/dist/client/assets/threadCheckpoints-BXz5LJLz.js +2 -0
  247. package/dist/client/assets/toast-BYGaCmZu.js +2 -0
  248. package/dist/client/assets/{toggle-DJ8KOwn5.js → toggle-Be7gb_vD.js} +2 -2
  249. package/dist/client/assets/{toggle-group-2e3XGJdx.js → toggle-group-Cz65VaLC.js} +2 -2
  250. package/dist/client/assets/{tooltip-BPiLl1TV.js → tooltip-BYZIg_IY.js} +2 -2
  251. package/dist/client/assets/{uiStateStore-4i21PZUL.js → uiStateStore-yyuUmO2M.js} +2 -2
  252. package/dist/client/assets/usage-B6rUsIoY.js +2 -0
  253. package/dist/client/assets/{usageAccess-CsMv6eC9.js → usageAccess-0MZ9DMCW.js} +2 -2
  254. package/dist/client/assets/{usageFormat-DhefL58S.js → usageFormat-4k8-70X2.js} +2 -2
  255. package/dist/client/assets/{usageShortcuts-CREc0FBr.js → usageShortcuts-C4Dhwzkz.js} +2 -2
  256. package/dist/client/assets/{use-atom-command-CdV5BZYB.js → use-atom-command-DEluSG6k.js} +2 -2
  257. package/dist/client/assets/{useAriaLabelledBy-CYRfRdAq.js → useAriaLabelledBy-Ca8fkLAD.js} +2 -2
  258. package/dist/client/assets/{useHandleNewThread-BsnMrEPr.js → useHandleNewThread-BOej8pJq.js} +2 -2
  259. package/dist/client/assets/{useLocation-DHd-KBb-.js → useLocation-_8If3LN3.js} +2 -2
  260. package/dist/client/assets/{useNavigate-AZUCIeU4.js → useNavigate-5WivMyAa.js} +2 -2
  261. package/dist/client/assets/{useNavigateBack-C7DkQuEE.js → useNavigateBack-DXfbYF86.js} +2 -2
  262. package/dist/client/assets/{useP4ConnectAuthPrompt-u1GHgwlc.js → useP4ConnectAuthPrompt-D0Equ6mY.js} +2 -2
  263. package/dist/client/assets/{useParams-rbhXoEw9.js → useParams-DV-Nw6Lj.js} +2 -2
  264. package/dist/client/assets/{usePermissionStatus-DHzE_VGG.js → usePermissionStatus-CIobAIHF.js} +2 -2
  265. package/dist/client/assets/{usePullRequestActions-Cv12eqOn.js → usePullRequestActions-Cf39XlVv.js} +3 -3
  266. package/dist/client/assets/{useRegisterFieldControl-D4FG4i3_.js → useRegisterFieldControl-Dmsxd6H8.js} +2 -2
  267. package/dist/client/assets/{useScopedModelAvailability-D6cbxQLl.js → useScopedModelAvailability-Cc-bmdqn.js} +2 -2
  268. package/dist/client/assets/useSettings-jZr_DfW0.js +3 -0
  269. package/dist/client/assets/utils-OWUgXvpr.js +37 -0
  270. package/dist/client/assets/vcsRefInvalidation-CRToBQE1.js +2 -0
  271. package/dist/client/assets/{welcome-D2-tjFV3.js → welcome-BcjbPbMq.js} +2 -2
  272. package/dist/client/index.html +1 -1
  273. package/dist/client/third-party-licenses.json +1 -1
  274. package/dist/pele-RvfyfJB5.mjs +29609 -0
  275. package/dist/{renderer-CuqsXHrO.mjs → renderer-D_KFqL06.mjs} +2 -2
  276. package/dist/resource-monitor/darwin-arm64/p4-resource-monitor +0 -0
  277. package/dist/{runtime-CWPUW_8Y.mjs → runtime-Tslhhp69.mjs} +83 -13
  278. package/package.json +1 -1
  279. package/dist/AcpMcpStdioBridge-BFMDWrrj.mjs +0 -3
  280. package/dist/client/assets/AlertDialogRoot-DaczVYX9.js +0 -2
  281. package/dist/client/assets/ChatGptUsageButton-w6RkBCUH.js +0 -2
  282. package/dist/client/assets/ChatMarkdown-CFUfXlYp.js +0 -48
  283. package/dist/client/assets/DevicePanel-CRFuAv_j.js +0 -2
  284. package/dist/client/assets/DeviceSetup-DRzepax4.js +0 -2
  285. package/dist/client/assets/DiffPanel-CM5Rvb_z.js +0 -2
  286. package/dist/client/assets/FilePreviewPanel-z6NirC2y.js +0 -34
  287. package/dist/client/assets/Input-BZ1XdBC0.js +0 -2
  288. package/dist/client/assets/JZOYTAAL-BZEjBuKj.js +0 -1
  289. package/dist/client/assets/PanelLayoutControls-BQZYES2T.js +0 -216
  290. package/dist/client/assets/PreviewPanel-D8V2zDl4.js +0 -2
  291. package/dist/client/assets/ProjectDefaultsSettings-6UkudkKP.js +0 -2
  292. package/dist/client/assets/ProviderModelPicker-CpWE-Lfx.js +0 -2
  293. package/dist/client/assets/PullRequestCodeTab-CjBrGNWY.js +0 -6
  294. package/dist/client/assets/ReadOnlySourcePreview-BasbTHVd.js +0 -2
  295. package/dist/client/assets/ScheduledTasksSettings-DpYigye5.js +0 -4
  296. package/dist/client/assets/SelfImproveSettingsSection-CDIhJO4P.js +0 -2
  297. package/dist/client/assets/SettingsPanels-Co5mks6X.js +0 -46
  298. package/dist/client/assets/ThreadTerminalDrawer-CD3plt2C.js +0 -5
  299. package/dist/client/assets/TooltipViewport-Be_gbUW1.js +0 -2
  300. package/dist/client/assets/_chat-Cnc6rxt6.js +0 -47
  301. package/dist/client/assets/_chat.pull-requests-A3IwVYWs.js +0 -2
  302. package/dist/client/assets/assets-JgE2I_Ix.js +0 -2
  303. package/dist/client/assets/connect-agent-DJHm1Ubj.js +0 -2
  304. package/dist/client/assets/device-Nh7DArH7.js +0 -2
  305. package/dist/client/assets/entities-aKdRyfsJ.js +0 -2
  306. package/dist/client/assets/env-wK1YYxA8.js +0 -2
  307. package/dist/client/assets/index-BXvrSYK3.js +0 -3
  308. package/dist/client/assets/key-round-CoEmBzzZ.js +0 -2
  309. package/dist/client/assets/main-BD4pReCY.css +0 -2
  310. package/dist/client/assets/main-C0z861OK.js +0 -37
  311. package/dist/client/assets/mediaSource-BLpxwEw3.js +0 -2
  312. package/dist/client/assets/number-field-Pve745k3.js +0 -2
  313. package/dist/client/assets/openFileInPreview-Dns9tPaB.js +0 -2
  314. package/dist/client/assets/primary-BlS2rEKe.js +0 -2
  315. package/dist/client/assets/primaryCloudLinkState-CyPf4N0F.js +0 -2
  316. package/dist/client/assets/projectFilesQueryState-BdWJ4WwI.js +0 -2
  317. package/dist/client/assets/pullRequests-B85p5Xnw.js +0 -2
  318. package/dist/client/assets/queries-B0FvRKmk.js +0 -2
  319. package/dist/client/assets/query-B2_Td0ad.js +0 -2
  320. package/dist/client/assets/rightPanelStore-rZSIb-5z.js +0 -2
  321. package/dist/client/assets/runtime-BK2Lh1vB.js +0 -3
  322. package/dist/client/assets/runtime-BVmDVuJ-.js +0 -6
  323. package/dist/client/assets/server-DwkxciXh.js +0 -2
  324. package/dist/client/assets/settings.archived-BxqS4kuW.js +0 -2
  325. package/dist/client/assets/settings.connections-CEr4PdrJ.js +0 -2
  326. package/dist/client/assets/settings.diagnostics-DdsecwWn.js +0 -2
  327. package/dist/client/assets/settings.integrations-CO-aLXSC.js +0 -2
  328. package/dist/client/assets/settings.projects-hxwk8_7r.js +0 -4
  329. package/dist/client/assets/settings.providers-D5-Kj1jY.js +0 -3
  330. package/dist/client/assets/settingsLayout-WhjsCfB6.js +0 -3
  331. package/dist/client/assets/toast-BZ96uuab.js +0 -2
  332. package/dist/client/assets/usage-uuNPbJve.js +0 -2
  333. package/dist/client/assets/useSettings-B09a3zie.js +0 -3
  334. package/dist/client/assets/utils-C5GGWTfe.js +0 -37
  335. package/dist/client/assets/vcsRefInvalidation-B66hRx4g.js +0 -2
@@ -1,2 +1,2 @@
1
- import{a as e,t}from"./react-BUfh6y28.js";import{t as n}from"./jsx-runtime-DJeoFXNw.js";import{Aa as r,Ao as i,Ba as a,Ca as o,Dr as s,Ea as c,Eo as l,Ga as u,Ha as d,Hn as f,Ja as p,Ma as m,Mo as h,No as g,To as _,Wn as v,do as ee,jo as te,ko as ne,oa as re,sa as ie,wo as y,zn as ae}from"./utils-C5GGWTfe.js";import{t as oe}from"./useRegisterFieldControl-D4FG4i3_.js";import{t as se}from"./FormContext-DcnLkh-4.js";import{t as ce}from"./useAriaLabelledBy-CYRfRdAq.js";import{t as le}from"./FieldItemContext-sr3mCd2v.js";var b=e(t()),x=b.createContext(void 0);function ue(e=!0){let t=b.useContext(x);if(t===void 0&&!e)throw Error(g(3));return t}function de(e){if(!e)return null;for(let t of e.elements){let e=t.tagName;if(e===`BUTTON`||e===`INPUT`){let e=t;if(e.type===`submit`)return e}}return null}var S=function(e){return e.checked=`data-checked`,e.unchecked=`data-unchecked`,e.indeterminate=`data-indeterminate`,e.disabled=`data-disabled`,e.readonly=`data-readonly`,e.required=`data-required`,e.valid=`data-valid`,e.invalid=`data-invalid`,e.touched=`data-touched`,e.dirty=`data-dirty`,e.filled=`data-filled`,e.focused=`data-focused`,e}({});function C(e){return b.useMemo(()=>({checked(t){return e.indeterminate?{}:t?{[S.checked]:``}:{[S.unchecked]:``}},...v}),[e.indeterminate])}var w=b.createContext(void 0);function T(){let e=b.useContext(w);if(e===void 0)throw Error(g(14));return e}var E=e(n()),fe=`data-parent`,D=b.forwardRef(function(e,t){let{checked:n,className:o,defaultChecked:c=!1,"aria-labelledby":g,disabled:v=!1,form:y,id:x,indeterminate:S=!1,inputRef:T,name:D,onCheckedChange:O,parent:k=!1,readOnly:A=!1,render:pe,required:j=!1,uncheckedValue:M,value:N,nativeButton:P=!1,style:me,...he}=e,{clearErrors:ge}=se(),{disabled:_e,name:ve,setDirty:ye,setFilled:F,setFocused:be,setTouched:xe,state:Se,validationMode:Ce,validityData:we,shouldValidateOnChange:Te,validation:Ee}=f(),De=le(),{labelId:Oe,controlId:ke,registerControlId:I,getDescriptionProps:Ae}=ae(),L=ue(),R=L?.parent,z=R&&L.allValues,B=_e||De.disabled||L?.disabled||v,V=ve??D,H=N??V,je=m(),Me=m(),U=ke;z?U=k?Me:`${R.id}-${H}`:x&&(U=x);let W={};z&&(k?W=L.parent.getParentProps():H&&(W=L.parent.getChildProps(H)));let{checked:Ne=n,indeterminate:G=S,onCheckedChange:Pe,...Fe}=W,K=L?.value,Ie=L?.setValue,Le=L?.defaultValue,q=b.useRef(null),J=h(()=>Symbol(`checkbox-control`)),Y=b.useRef(!1),{getButtonProps:Re,buttonRef:ze}=a({disabled:B,native:P}),X=L?.validation??Ee,[Z,Be]=p({controlled:H&&K&&!k?K.includes(H):Ne,default:H&&Le&&!k?Le.includes(H):c,name:`Checkbox`,state:`checked`});d(()=>{I!==i&&(Y.current=!0,I(J.current,U))},[U,I,J]),b.useEffect(()=>{let e=J.current;return()=>{Y.current&&I!==i&&(Y.current=!1,I(e,void 0))}},[I,J]),oe(q,je,Z,void 0,!L);let Q=b.useRef(null),Ve=te(T,Q,X.inputRef),He=ce(g,Oe,Q,!P,U??void 0);d(()=>{Q.current&&(Q.current.indeterminate=G,Z&&F(!0))},[Z,G,F]),s(Z,()=>{(!L||k)&&(ge(V),F(Z),ye(Z!==we.initialValue),Te()?X.commit(Z):X.commit(Z,!0))});let Ue=l({checked:Z,disabled:B,form:y,name:k?void 0:V,id:P?void 0:U??void 0,required:j,ref:Ve,style:V?ie:re,tabIndex:-1,type:`checkbox`,"aria-hidden":!0,onChange(e){if(e.nativeEvent.defaultPrevented)return;if(A){e.preventDefault();return}let t=e.currentTarget.checked,n=r(ee,e.nativeEvent);if(Pe?.(t,n),O?.(t,n),!n.isCanceled&&(Be(t),H&&K&&Ie&&!k&&!z)){let e=t?[...K,H]:K.filter(e=>e!==H);Ie(e,n)}},onFocus(){q.current?.focus()}},N===void 0?ne:{value:(L?Z&&N:N)||``},Ae,L?X.getValidationProps:X.getInputValidationProps),We=z?!!Ne:Z,Ge=z&&G||S;b.useEffect(()=>{if(!R||!H)return;let e=R.disabledStatesRef.current;return e.set(H,B),()=>{e.delete(H)}},[R,B,H]);let $=b.useMemo(()=>({...Se,checked:We,disabled:B,readOnly:A,required:j,indeterminate:Ge}),[Se,We,B,A,j,Ge]),Ke=C($),qe=_(`span`,e,{state:$,ref:[ze,q,t,L?.registerControlRef],props:[{id:P?U??void 0:je,role:`checkbox`,"aria-checked":G?`mixed`:Z,"aria-readonly":A||void 0,"aria-required":j||void 0,"aria-labelledby":He,[fe]:k?``:void 0,onFocus(){be(!0)},onBlur(){let e=Q.current;e&&(xe(!0),be(!1),Ce===`onBlur`&&X.commit(L?K:e.checked))},onKeyDown(e){if(e.key!==`Enter`||(e.preventBaseUIHandler(),e.defaultPrevented))return;let t=Q.current?.form??null,n=e.currentTarget,r=e.nativeEvent,i=e.preventDefault,a=r.preventDefault,o=!1;e.preventDefault=()=>{o=!0,i.call(e)},r.preventDefault=()=>{o=!0,a.call(r)},a.call(r),u(n).queueMicrotask(()=>{e.preventDefault=i,r.preventDefault=a,o||de(t)?.click()})},onClick(e){if(A||B)return;e.preventDefault();let t=Q.current;t&&t.dispatchEvent(new(u(t)).PointerEvent(`click`,{bubbles:!0,shiftKey:e.shiftKey,ctrlKey:e.ctrlKey,altKey:e.altKey,metaKey:e.metaKey}))}},Ae,X.getValidationProps,he,Fe,Re],stateAttributesMapping:Ke});return(0,E.jsxs)(w.Provider,{value:$,children:[qe,!Z&&!L&&V&&!k&&M!==void 0&&(0,E.jsx)(`input`,{type:`hidden`,form:y,name:V,value:M}),(0,E.jsx)(`input`,{...Ue,suppressHydrationWarning:!0})]})}),O=b.forwardRef(function(e,t){let{render:n,className:r,style:i,keepMounted:a=!1,...s}=e,l=T(),u=l.checked||l.indeterminate,{mounted:d,transitionStatus:f,setMounted:p}=c(u),m=b.useRef(null),h={...l,transitionStatus:f};o({open:u,ref:m,onComplete(){u||p(!1)}});let g={...C(l),...y,...v},ee=a||d,te=_(`span`,e,{ref:[t,m],state:h,stateAttributesMapping:g,props:s});return ee?te:null});export{D as n,O as t};
2
- //# sourceMappingURL=CheckboxIndicator-lkbFKbE7.js.map
1
+ import{a as e,t}from"./react-BUfh6y28.js";import{t as n}from"./jsx-runtime-DJeoFXNw.js";import{Aa as r,Ao as i,Ba as a,Ca as o,Dr as s,Ea as c,Eo as l,Ga as u,Ha as d,Hn as f,Ja as p,Ma as m,Mo as h,No as g,To as _,Wn as v,do as ee,jo as te,ko as ne,oa as re,sa as ie,wo as y,zn as ae}from"./utils-OWUgXvpr.js";import{t as oe}from"./useRegisterFieldControl-Dmsxd6H8.js";import{t as se}from"./FormContext-BEFZtJu9.js";import{t as ce}from"./useAriaLabelledBy-Ca8fkLAD.js";import{t as le}from"./FieldItemContext-sr3mCd2v.js";var b=e(t()),x=b.createContext(void 0);function ue(e=!0){let t=b.useContext(x);if(t===void 0&&!e)throw Error(g(3));return t}function de(e){if(!e)return null;for(let t of e.elements){let e=t.tagName;if(e===`BUTTON`||e===`INPUT`){let e=t;if(e.type===`submit`)return e}}return null}var S=function(e){return e.checked=`data-checked`,e.unchecked=`data-unchecked`,e.indeterminate=`data-indeterminate`,e.disabled=`data-disabled`,e.readonly=`data-readonly`,e.required=`data-required`,e.valid=`data-valid`,e.invalid=`data-invalid`,e.touched=`data-touched`,e.dirty=`data-dirty`,e.filled=`data-filled`,e.focused=`data-focused`,e}({});function C(e){return b.useMemo(()=>({checked(t){return e.indeterminate?{}:t?{[S.checked]:``}:{[S.unchecked]:``}},...v}),[e.indeterminate])}var w=b.createContext(void 0);function T(){let e=b.useContext(w);if(e===void 0)throw Error(g(14));return e}var E=e(n()),fe=`data-parent`,D=b.forwardRef(function(e,t){let{checked:n,className:o,defaultChecked:c=!1,"aria-labelledby":g,disabled:v=!1,form:y,id:x,indeterminate:S=!1,inputRef:T,name:D,onCheckedChange:O,parent:k=!1,readOnly:A=!1,render:pe,required:j=!1,uncheckedValue:M,value:N,nativeButton:P=!1,style:me,...he}=e,{clearErrors:ge}=se(),{disabled:_e,name:ve,setDirty:ye,setFilled:F,setFocused:be,setTouched:xe,state:Se,validationMode:Ce,validityData:we,shouldValidateOnChange:Te,validation:Ee}=f(),De=le(),{labelId:Oe,controlId:ke,registerControlId:I,getDescriptionProps:Ae}=ae(),L=ue(),R=L?.parent,z=R&&L.allValues,B=_e||De.disabled||L?.disabled||v,V=ve??D,H=N??V,je=m(),Me=m(),U=ke;z?U=k?Me:`${R.id}-${H}`:x&&(U=x);let W={};z&&(k?W=L.parent.getParentProps():H&&(W=L.parent.getChildProps(H)));let{checked:Ne=n,indeterminate:G=S,onCheckedChange:Pe,...Fe}=W,K=L?.value,Ie=L?.setValue,Le=L?.defaultValue,q=b.useRef(null),J=h(()=>Symbol(`checkbox-control`)),Y=b.useRef(!1),{getButtonProps:Re,buttonRef:ze}=a({disabled:B,native:P}),X=L?.validation??Ee,[Z,Be]=p({controlled:H&&K&&!k?K.includes(H):Ne,default:H&&Le&&!k?Le.includes(H):c,name:`Checkbox`,state:`checked`});d(()=>{I!==i&&(Y.current=!0,I(J.current,U))},[U,I,J]),b.useEffect(()=>{let e=J.current;return()=>{Y.current&&I!==i&&(Y.current=!1,I(e,void 0))}},[I,J]),oe(q,je,Z,void 0,!L);let Q=b.useRef(null),Ve=te(T,Q,X.inputRef),He=ce(g,Oe,Q,!P,U??void 0);d(()=>{Q.current&&(Q.current.indeterminate=G,Z&&F(!0))},[Z,G,F]),s(Z,()=>{(!L||k)&&(ge(V),F(Z),ye(Z!==we.initialValue),Te()?X.commit(Z):X.commit(Z,!0))});let Ue=l({checked:Z,disabled:B,form:y,name:k?void 0:V,id:P?void 0:U??void 0,required:j,ref:Ve,style:V?ie:re,tabIndex:-1,type:`checkbox`,"aria-hidden":!0,onChange(e){if(e.nativeEvent.defaultPrevented)return;if(A){e.preventDefault();return}let t=e.currentTarget.checked,n=r(ee,e.nativeEvent);if(Pe?.(t,n),O?.(t,n),!n.isCanceled&&(Be(t),H&&K&&Ie&&!k&&!z)){let e=t?[...K,H]:K.filter(e=>e!==H);Ie(e,n)}},onFocus(){q.current?.focus()}},N===void 0?ne:{value:(L?Z&&N:N)||``},Ae,L?X.getValidationProps:X.getInputValidationProps),We=z?!!Ne:Z,Ge=z&&G||S;b.useEffect(()=>{if(!R||!H)return;let e=R.disabledStatesRef.current;return e.set(H,B),()=>{e.delete(H)}},[R,B,H]);let $=b.useMemo(()=>({...Se,checked:We,disabled:B,readOnly:A,required:j,indeterminate:Ge}),[Se,We,B,A,j,Ge]),Ke=C($),qe=_(`span`,e,{state:$,ref:[ze,q,t,L?.registerControlRef],props:[{id:P?U??void 0:je,role:`checkbox`,"aria-checked":G?`mixed`:Z,"aria-readonly":A||void 0,"aria-required":j||void 0,"aria-labelledby":He,[fe]:k?``:void 0,onFocus(){be(!0)},onBlur(){let e=Q.current;e&&(xe(!0),be(!1),Ce===`onBlur`&&X.commit(L?K:e.checked))},onKeyDown(e){if(e.key!==`Enter`||(e.preventBaseUIHandler(),e.defaultPrevented))return;let t=Q.current?.form??null,n=e.currentTarget,r=e.nativeEvent,i=e.preventDefault,a=r.preventDefault,o=!1;e.preventDefault=()=>{o=!0,i.call(e)},r.preventDefault=()=>{o=!0,a.call(r)},a.call(r),u(n).queueMicrotask(()=>{e.preventDefault=i,r.preventDefault=a,o||de(t)?.click()})},onClick(e){if(A||B)return;e.preventDefault();let t=Q.current;t&&t.dispatchEvent(new(u(t)).PointerEvent(`click`,{bubbles:!0,shiftKey:e.shiftKey,ctrlKey:e.ctrlKey,altKey:e.altKey,metaKey:e.metaKey}))}},Ae,X.getValidationProps,he,Fe,Re],stateAttributesMapping:Ke});return(0,E.jsxs)(w.Provider,{value:$,children:[qe,!Z&&!L&&V&&!k&&M!==void 0&&(0,E.jsx)(`input`,{type:`hidden`,form:y,name:V,value:M}),(0,E.jsx)(`input`,{...Ue,suppressHydrationWarning:!0})]})}),O=b.forwardRef(function(e,t){let{render:n,className:r,style:i,keepMounted:a=!1,...s}=e,l=T(),u=l.checked||l.indeterminate,{mounted:d,transitionStatus:f,setMounted:p}=c(u),m=b.useRef(null),h={...l,transitionStatus:f};o({open:u,ref:m,onComplete(){u||p(!1)}});let g={...C(l),...y,...v},ee=a||d,te=_(`span`,e,{ref:[t,m],state:h,stateAttributesMapping:g,props:s});return ee?te:null});export{D as n,O as t};
2
+ //# sourceMappingURL=CheckboxIndicator-D2jNOqVc.js.map
@@ -1,2 +1,2 @@
1
- import{a as e,t}from"./react-BUfh6y28.js";import{n,t as r}from"./jsx-runtime-DJeoFXNw.js";import{Fc as i,ad as a}from"./utils-C5GGWTfe.js";import{a as o,i as s,o as c,r as l,s as u,t as d}from"./TooltipViewport-Be_gbUW1.js";var f=e(t(),1),p=n();function m(...e){return i(a(e))}var h=e(r(),1),g=u;function _(e){let t=(0,p.c)(2),n;return t[0]===e?n=t[1]:(n=(0,h.jsx)(c,{"data-slot":`tooltip-trigger`,...e}),t[0]=e,t[1]=n),n}function v(e){let t=(0,p.c)(28),n,r,i,a,c,u,f,g,_;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],c=t[5],u=t[6],f=t[7],g=t[8],_=t[9]):({className:i,positionerClassName:a,align:u,sideOffset:f,side:g,variant:_,anchor:n,children:r,...c}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=c,t[6]=u,t[7]=f,t[8]=g,t[9]=_);let v=u===void 0?`center`:u,y=f===void 0?4:f,b=g===void 0?`top`:g,x=_===void 0?`default`:_,S;t[10]===a?S=t[11]:(S=m(`pointer-events-none z-[70] h-(--positioner-height) w-(--positioner-width) max-w-(--available-width) transition-[top,left,right,bottom,transform] data-instant:transition-none`,a),t[10]=a,t[11]=S);let C=x===`glass`?`dropdown-glass shadow-xl shadow-black/25 before:hidden`:`border bg-popover not-dark:bg-clip-padding shadow-md/5`,w;t[12]!==i||t[13]!==C?(w=m(`relative flex h-(--popup-height,auto) w-(--popup-width,auto) origin-(--transform-origin) text-balance rounded-md text-popover-foreground text-xs transition-[width,height,scale,opacity] before:pointer-events-none before:absolute before:inset-0 before:rounded-[calc(var(--radius-md)-1px)] before:shadow-[0_1px_--theme(--color-black/4%)] data-ending-style:scale-98 data-starting-style:scale-98 data-ending-style:opacity-0 data-starting-style:opacity-0 data-instant:duration-0 dark:before:shadow-[0_-1px_--theme(--color-white/6%)]`,C,i),t[12]=i,t[13]=C,t[14]=w):w=t[14];let T;t[15]===r?T=t[16]:(T=(0,h.jsx)(d,{className:`relative size-full overflow-clip px-(--viewport-inline-padding) py-1 [--viewport-inline-padding:--spacing(2)] data-instant:transition-none **:data-current:data-ending-style:opacity-0 **:data-current:data-starting-style:opacity-0 **:data-previous:data-ending-style:opacity-0 **:data-previous:data-starting-style:opacity-0 **:data-current:w-[calc(var(--popup-width)-2*var(--viewport-inline-padding)-2px)] **:data-previous:w-[calc(var(--popup-width)-2*var(--viewport-inline-padding)-2px)] **:data-previous:truncate **:data-current:opacity-100 **:data-previous:opacity-100 **:data-current:transition-opacity **:data-previous:transition-opacity`,"data-slot":`tooltip-viewport`,children:r}),t[15]=r,t[16]=T);let E;t[17]!==c||t[18]!==w||t[19]!==T?(E=(0,h.jsx)(l,{className:w,"data-slot":`tooltip-popup`,...c,children:T}),t[17]=c,t[18]=w,t[19]=T,t[20]=E):E=t[20];let D;return t[21]!==v||t[22]!==n||t[23]!==b||t[24]!==y||t[25]!==S||t[26]!==E?(D=(0,h.jsx)(o,{children:(0,h.jsx)(s,{align:v,anchor:n,className:S,"data-slot":`tooltip-positioner`,side:b,sideOffset:y,children:E})}),t[21]=v,t[22]=n,t[23]=b,t[24]=y,t[25]=S,t[26]=E,t[27]=D):D=t[27],D}var y=e=>!!(e&&e.scrollWidth>e.clientWidth);function b(e,t){let n=(0,p.c)(5),[r,i]=(0,f.useState)(!1),a;n[0]===e?a=n[1]:(a=()=>{let t=e.current;if(!t)return;let n=()=>i(y(t));n();let r=new ResizeObserver(n);return r.observe(t),()=>r.disconnect()},n[0]=e,n[1]=a);let o;return n[2]!==e||n[3]!==t?(o=[e,t],n[2]=e,n[3]=t,n[4]=o):o=n[4],(0,f.useLayoutEffect)(a,o),r}function x(e){let t=(0,p.c)(15),{children:n,full:r,className:i}=e,a=r===void 0?n:r,o=i===void 0?`design-truncate`:i,s=(0,f.useRef)(null),c=b(s,n),[l,u]=(0,f.useState)(!1),d=l&&c,m;t[0]===c?m=t[1]:(m=e=>u(e&&c),t[0]=c,t[1]=m);let y=c?0:void 0,x;t[2]!==o||t[3]!==y?(x=(0,h.jsx)(`span`,{ref:s,className:o,tabIndex:y}),t[2]=o,t[3]=y,t[4]=x):x=t[4];let S;t[5]!==n||t[6]!==x?(S=(0,h.jsx)(_,{render:x,children:n}),t[5]=n,t[6]=x,t[7]=S):S=t[7];let C;t[8]===a?C=t[9]:(C=(0,h.jsx)(v,{children:a}),t[8]=a,t[9]=C);let w;return t[10]!==d||t[11]!==m||t[12]!==S||t[13]!==C?(w=(0,h.jsxs)(g,{open:d,onOpenChange:m,children:[S,C]}),t[10]=d,t[11]=m,t[12]=S,t[13]=C,t[14]=w):w=t[14],w}function S(e){let t=(0,p.c)(12),{full:n,labelRef:r,render:i,children:a}=e,[o,s]=(0,f.useState)(!1),c;t[0]===r?c=t[1]:(c=e=>s(e&&y(r.current)),t[0]=r,t[1]=c);let l;t[2]!==a||t[3]!==i?(l=(0,h.jsx)(_,{render:i,children:a}),t[2]=a,t[3]=i,t[4]=l):l=t[4];let u;t[5]===n?u=t[6]:(u=(0,h.jsx)(v,{children:n}),t[5]=n,t[6]=u);let d;return t[7]!==o||t[8]!==c||t[9]!==l||t[10]!==u?(d=(0,h.jsxs)(g,{open:o,onOpenChange:c,children:[l,u]}),t[7]=o,t[8]=c,t[9]=l,t[10]=u,t[11]=d):d=t[11],d}export{_ as a,v as i,S as n,m as o,g as r,x as t};
2
- //# sourceMappingURL=ClippedText-Bf8FSQkX.js.map
1
+ import{a as e,t}from"./react-BUfh6y28.js";import{n,t as r}from"./jsx-runtime-DJeoFXNw.js";import{Ic as i,od as a}from"./utils-OWUgXvpr.js";import{a as o,i as s,o as c,r as l,s as u,t as d}from"./TooltipViewport-DjveMpIl.js";var f=e(t(),1),p=n();function m(...e){return i(a(e))}var h=e(r(),1),g=u;function _(e){let t=(0,p.c)(2),n;return t[0]===e?n=t[1]:(n=(0,h.jsx)(c,{"data-slot":`tooltip-trigger`,...e}),t[0]=e,t[1]=n),n}function v(e){let t=(0,p.c)(28),n,r,i,a,c,u,f,g,_;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],c=t[5],u=t[6],f=t[7],g=t[8],_=t[9]):({className:i,positionerClassName:a,align:u,sideOffset:f,side:g,variant:_,anchor:n,children:r,...c}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=c,t[6]=u,t[7]=f,t[8]=g,t[9]=_);let v=u===void 0?`center`:u,y=f===void 0?4:f,b=g===void 0?`top`:g,x=_===void 0?`default`:_,S;t[10]===a?S=t[11]:(S=m(`pointer-events-none z-[70] h-(--positioner-height) w-(--positioner-width) max-w-(--available-width) transition-[top,left,right,bottom,transform] data-instant:transition-none`,a),t[10]=a,t[11]=S);let C=x===`glass`?`dropdown-glass shadow-xl shadow-black/25 before:hidden`:`border bg-popover not-dark:bg-clip-padding shadow-md/5`,w;t[12]!==i||t[13]!==C?(w=m(`relative flex h-(--popup-height,auto) w-(--popup-width,auto) origin-(--transform-origin) text-balance rounded-md text-popover-foreground text-xs transition-[width,height,scale,opacity] before:pointer-events-none before:absolute before:inset-0 before:rounded-[calc(var(--radius-md)-1px)] before:shadow-[0_1px_--theme(--color-black/4%)] data-ending-style:scale-98 data-starting-style:scale-98 data-ending-style:opacity-0 data-starting-style:opacity-0 data-instant:duration-0 dark:before:shadow-[0_-1px_--theme(--color-white/6%)]`,C,i),t[12]=i,t[13]=C,t[14]=w):w=t[14];let T;t[15]===r?T=t[16]:(T=(0,h.jsx)(d,{className:`relative size-full overflow-clip px-(--viewport-inline-padding) py-1 [--viewport-inline-padding:--spacing(2)] data-instant:transition-none **:data-current:data-ending-style:opacity-0 **:data-current:data-starting-style:opacity-0 **:data-previous:data-ending-style:opacity-0 **:data-previous:data-starting-style:opacity-0 **:data-current:w-[calc(var(--popup-width)-2*var(--viewport-inline-padding)-2px)] **:data-previous:w-[calc(var(--popup-width)-2*var(--viewport-inline-padding)-2px)] **:data-previous:truncate **:data-current:opacity-100 **:data-previous:opacity-100 **:data-current:transition-opacity **:data-previous:transition-opacity`,"data-slot":`tooltip-viewport`,children:r}),t[15]=r,t[16]=T);let E;t[17]!==c||t[18]!==w||t[19]!==T?(E=(0,h.jsx)(l,{className:w,"data-slot":`tooltip-popup`,...c,children:T}),t[17]=c,t[18]=w,t[19]=T,t[20]=E):E=t[20];let D;return t[21]!==v||t[22]!==n||t[23]!==b||t[24]!==y||t[25]!==S||t[26]!==E?(D=(0,h.jsx)(o,{children:(0,h.jsx)(s,{align:v,anchor:n,className:S,"data-slot":`tooltip-positioner`,side:b,sideOffset:y,children:E})}),t[21]=v,t[22]=n,t[23]=b,t[24]=y,t[25]=S,t[26]=E,t[27]=D):D=t[27],D}var y=e=>!!(e&&e.scrollWidth>e.clientWidth);function b(e,t){let n=(0,p.c)(5),[r,i]=(0,f.useState)(!1),a;n[0]===e?a=n[1]:(a=()=>{let t=e.current;if(!t)return;let n=()=>i(y(t));n();let r=new ResizeObserver(n);return r.observe(t),()=>r.disconnect()},n[0]=e,n[1]=a);let o;return n[2]!==e||n[3]!==t?(o=[e,t],n[2]=e,n[3]=t,n[4]=o):o=n[4],(0,f.useLayoutEffect)(a,o),r}function x(e){let t=(0,p.c)(15),{children:n,full:r,className:i}=e,a=r===void 0?n:r,o=i===void 0?`design-truncate`:i,s=(0,f.useRef)(null),c=b(s,n),[l,u]=(0,f.useState)(!1),d=l&&c,m;t[0]===c?m=t[1]:(m=e=>u(e&&c),t[0]=c,t[1]=m);let y=c?0:void 0,x;t[2]!==o||t[3]!==y?(x=(0,h.jsx)(`span`,{ref:s,className:o,tabIndex:y}),t[2]=o,t[3]=y,t[4]=x):x=t[4];let S;t[5]!==n||t[6]!==x?(S=(0,h.jsx)(_,{render:x,children:n}),t[5]=n,t[6]=x,t[7]=S):S=t[7];let C;t[8]===a?C=t[9]:(C=(0,h.jsx)(v,{children:a}),t[8]=a,t[9]=C);let w;return t[10]!==d||t[11]!==m||t[12]!==S||t[13]!==C?(w=(0,h.jsxs)(g,{open:d,onOpenChange:m,children:[S,C]}),t[10]=d,t[11]=m,t[12]=S,t[13]=C,t[14]=w):w=t[14],w}function S(e){let t=(0,p.c)(12),{full:n,labelRef:r,render:i,children:a}=e,[o,s]=(0,f.useState)(!1),c;t[0]===r?c=t[1]:(c=e=>s(e&&y(r.current)),t[0]=r,t[1]=c);let l;t[2]!==a||t[3]!==i?(l=(0,h.jsx)(_,{render:i,children:a}),t[2]=a,t[3]=i,t[4]=l):l=t[4];let u;t[5]===n?u=t[6]:(u=(0,h.jsx)(v,{children:n}),t[5]=n,t[6]=u);let d;return t[7]!==o||t[8]!==c||t[9]!==l||t[10]!==u?(d=(0,h.jsxs)(g,{open:o,onOpenChange:c,children:[l,u]}),t[7]=o,t[8]=c,t[9]=l,t[10]=u,t[11]=d):d=t[11],d}export{_ as a,v as i,S as n,m as o,g as r,x as t};
2
+ //# sourceMappingURL=ClippedText-CDOkzr7r.js.map
@@ -1,2 +1,2 @@
1
- import{a as e,t}from"./react-BUfh6y28.js";import{n,t as r}from"./jsx-runtime-DJeoFXNw.js";import{Ch as i,Fd as a,H_ as o,Mb as s,Rd as c,Th as l,U_ as u,fr as d,l as f,ns as p,ov as m,pf as h,t as g,yE as _}from"./utils-C5GGWTfe.js";import{R as v,W as y}from"./runtime-BVmDVuJ-.js";import{O as b,S as x,d as ee,q as te,x as S}from"./useSettings-B09a3zie.js";import{f as C}from"./server-DwkxciXh.js";import{i as w,n as ne}from"./session-BIwsf8Q4.js";import{n as re}from"./query-B2_Td0ad.js";import{t as T}from"./use-atom-command-CdV5BZYB.js";import{n as E,t as D}from"./radio-group-IyWHDcIP.js";import{t as ie}from"./input-FUjAUGXY.js";import{a as O,c as k,i as A,r as j,s as M,t as ae}from"./dialog-BpR3dRVS.js";import{x as N}from"./Icons-Be1TL1sN.js";import{t as P}from"./preview-YhZE3kRt.js";import{S as F,t as oe}from"./ChatGptUsageButton-w6RkBCUH.js";import{t as I}from"./RedactedSensitiveText-DACYfm7e.js";import{a as se}from"./settingsLayout-WhjsCfB6.js";import{Ea as ce,Ta as le,co as L,do as ue,lo as de,mo as fe,po as pe,uo as R}from"./main-C0z861OK.js";var z=e(t(),1),B=n(),V=e(r(),1);function me(e){let t=(0,B.c)(7),n,r;t[0]===e?(n=t[1],r=t[2]):({children:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,V.jsx)(N,{className:`size-4 shrink-0`,"aria-hidden":`true`}),t[3]=i):i=t[3];let a=n??`Continue with ChatGPT`,o;return t[4]!==r||t[5]!==a?(o=(0,V.jsxs)(d,{...r,children:[i,a]}),t[4]=r,t[5]=a,t[6]=o):o=t[6],o}function he(e){let t=(0,B.c)(23),{open:n,methods:r,onClose:i,onSelect:a}=e,o=r.filter(_e),[s,c]=(0,z.useState)(null),l=s===`chatgpt-change-account`?s:o.find(e=>e.id===s)?.id??o[0]?.id??`chatgpt-change-account`,u=ae,d;t[0]===i?d=t[1]:(d=e=>{e||i()},t[0]=i,t[1]=d);let f=M,p;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,V.jsxs)(O,{children:[(0,V.jsx)(k,{children:`Reconnect ChatGPT`}),(0,V.jsx)(j,{children:`On OpenAI, sign in with the account you choose here.`})]}),t[2]=p):p=t[2];let m=E,h;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(h=e=>c(e),t[3]=h):h=t[3];let g=o.map(ge),_;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(_=(0,V.jsxs)(`label`,{className:`flex cursor-pointer items-center gap-3 rounded-lg border px-3 py-3 text-sm`,children:[(0,V.jsx)(D,{value:`chatgpt-change-account`}),(0,V.jsx)(`span`,{className:`font-medium`,children:`Use a different account`})]}),t[4]=_):_=t[4];let v;t[5]!==m||t[6]!==l||t[7]!==h||t[8]!==g?(v=(0,V.jsx)(`div`,{className:`px-6 pb-6`,children:(0,V.jsxs)(m,{"aria-label":`ChatGPT account to connect`,value:l,onValueChange:h,children:[g,_]})}),t[5]=m,t[6]=l,t[7]=h,t[8]=g,t[9]=v):v=t[9];let y;t[10]!==a||t[11]!==l?(y=(0,V.jsx)(A,{children:(0,V.jsx)(me,{onClick:()=>a(l)})}),t[10]=a,t[11]=l,t[12]=y):y=t[12];let b;t[13]!==f||t[14]!==p||t[15]!==v||t[16]!==y?(b=(0,V.jsxs)(f,{children:[p,v,y]}),t[13]=f,t[14]=p,t[15]=v,t[16]=y,t[17]=b):b=t[17];let x;return t[18]!==u||t[19]!==n||t[20]!==d||t[21]!==b?(x=(0,V.jsx)(u,{open:n,onOpenChange:d,children:b}),t[18]=u,t[19]=n,t[20]=d,t[21]=b,t[22]=x):x=t[22],x}function ge(e){return(0,V.jsxs)(`label`,{className:`flex cursor-pointer items-center gap-3 rounded-lg border px-3 py-3 text-sm`,children:[(0,V.jsx)(D,{value:e.id}),(0,V.jsx)(`span`,{className:`min-w-0 break-all font-medium`,children:e.name})]},e.id)}function _e(e){return e.id.startsWith(`chatgpt-profile:`)}function ve(e){let t=(0,B.c)(58),{environmentId:n,onClose:r,renderSetup:i,onAccountCreated:a}=e,s=w(n,m),c=ee(n),l;t[0]===n?l=t[1]:(l=C.providersValueAtom(n),t[0]=n,t[1]=l);let h=p(l),g=T(C.updateSettings,`Add ChatGPT account`),[_,v]=(0,z.useState)(`Personal`),y;t[2]===_?y=t[3]:(y=_.trim(),t[2]=_,t[3]=y);let b=`ChatGPT - ${y}`,[x,te]=(0,z.useState)(null),[S,re]=(0,z.useState)(!1),E,D,O,k,A,j,M,N,P;if(t[4]!==b||t[5]!==n||t[6]!==x||t[7]!==_||t[8]!==a||t[9]!==r||t[10]!==S||t[11]!==h||t[12]!==i||t[13]!==c||t[14]!==g){let e=h?.find(e=>e.instanceId===x),s=F(e),l;t[24]!==b||t[25]!==n||t[26]!==_||t[27]!==a||t[28]!==r||t[29]!==S||t[30]!==c||t[31]!==g?(l=async()=>{if(S||!_.trim()||!ne(n,`providers:manage`))return;re(!0);let e=u.make(`codex_${f()}`);(await g({environmentId:n,input:{patch:{providerInstances:{...c.providerInstances,[e]:{driver:o.make(`codex`),displayName:b,enabled:!0,config:{enabled:!0,setupMode:`managed`}}}}}}))._tag===`Success`&&(a?(a(e,b),r()):te(e)),re(!1)},t[24]=b,t[25]=n,t[26]=_,t[27]=a,t[28]=r,t[29]=S,t[30]=c,t[31]=g,t[32]=l):l=t[32];let d=l;O=ae,M=!s,t[33]===r?N=t[34]:(N=e=>{e||r()},t[33]=r,t[34]=N),P=e=>{!e&&s&&r()},D=ue,A=`wide`;let p=x?b:`Add ChatGPT account`;t[35]===p?j=t[36]:(j=(0,V.jsx)(de,{title:p,description:`Each account has its own Codex instance and sign-in. Choose the other account on the sign-in page.`}),t[35]=p,t[36]=j),E=R,k=x?e?.setup?i(x,e):(0,V.jsx)(se,{title:`Codex runtime`,description:`Preparing managed setup.`}):(0,V.jsx)(`form`,{id:`add-codex-account`,onSubmit:e=>{e.preventDefault(),d()},children:(0,V.jsx)(se,{title:`Account name`,description:`Shown in the provider list and model picker.`,control:(0,V.jsx)(ie,{"aria-label":`Account name`,value:_,disabled:S,onChange:e=>v(e.target.value),placeholder:`e.g. Personal or Work`})})}),t[4]=b,t[5]=n,t[6]=x,t[7]=_,t[8]=a,t[9]=r,t[10]=S,t[11]=h,t[12]=i,t[13]=c,t[14]=g,t[15]=E,t[16]=D,t[17]=O,t[18]=k,t[19]=A,t[20]=j,t[21]=M,t[22]=N,t[23]=P}else E=t[15],D=t[16],O=t[17],k=t[18],A=t[19],j=t[20],M=t[21],N=t[22],P=t[23];let oe;t[37]!==E||t[38]!==k?(oe=(0,V.jsx)(E,{children:k}),t[37]=E,t[38]=k,t[39]=oe):oe=t[39];let I;t[40]!==s||t[41]!==x||t[42]!==_||t[43]!==r||t[44]!==S?(I=(0,V.jsx)(L,{children:x?(0,V.jsx)(d,{variant:`outline`,onClick:r,children:`Finish later`}):(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(d,{variant:`outline`,disabled:S,onClick:r,children:`Cancel`}),(0,V.jsx)(d,{type:`submit`,form:`add-codex-account`,disabled:S||!_.trim()||!s,children:S?`Adding account…`:`Continue`})]})}),t[40]=s,t[41]=x,t[42]=_,t[43]=r,t[44]=S,t[45]=I):I=t[45];let ce;t[46]!==D||t[47]!==I||t[48]!==A||t[49]!==j||t[50]!==oe?(ce=(0,V.jsxs)(D,{size:A,children:[j,oe,I]}),t[46]=D,t[47]=I,t[48]=A,t[49]=j,t[50]=oe,t[51]=ce):ce=t[51];let le;return t[52]!==O||t[53]!==ce||t[54]!==M||t[55]!==N||t[56]!==P?(le=(0,V.jsx)(O,{open:M,onOpenChange:N,onOpenChangeComplete:P,children:ce}),t[52]=O,t[53]=ce,t[54]=M,t[55]=N,t[56]=P,t[57]=le):le=t[57],le}var ye=s(i),be=s(l),xe=/^[A-Za-z0-9_./:\\-]+$/;function Se(e,t,n){return xe.test(e)&&(n===`windows`||!e.includes(`\\`))?e:n===`windows`?`& '${e.replaceAll(`'`,`''`)}'`:n===`darwin`||n===`linux`?e.startsWith(`~/`)||e.startsWith(`~\\`)?`~/'${e.slice(2).replaceAll(`'`,`'"'"'`)}'`:`'${e.replaceAll(`'`,`'"'"'`)}'`:t}function Ce(e){return e===void 0?`checking`:!e.enabled||e.status===`disabled`?`disabled`:!e.installed&&e.status===`warning`&&e.auth.status===`unknown`?`checking`:e.installed?e.auth.status===`unauthenticated`?`signIn`:e.status===`ready`?`ready`:`attention`:`install`}var H={checking:0,disabled:1,install:2,attention:3,signIn:4,ready:5};function U(e){let t=new Map;for(let n of e??[]){let e=t.get(n.driver);(e===void 0||H[Ce(n)]>H[Ce(e)])&&t.set(n.driver,n)}return t}var we={claudeAgent:{windows:`irm https://claude.ai/install.ps1 | iex`,posix:`curl -fsSL https://claude.ai/install.sh | bash`},codex:{windows:`irm https://chatgpt.com/codex/install.ps1 | iex`,posix:`curl -fsSL https://chatgpt.com/codex/install.sh | sh`}};function Te(e,t){let n=we[e];return t===`windows`?n.windows:n.posix}function Ee(e,t,n){let r=t.providerInstances[e.instanceId];if(e.driver===`claudeAgent`){let e=ye(r?.config??{});return`${Se(_(e)?e.value.binaryPath:`claude`,`claude`,n)} auth login`}if(e.driver===`codex`){let e=be(r?.config??{});return`${Se(_(e)?e.value.binaryPath:`codex`,`codex`,n)} login`}return e.driver}var De={disabled:{dot:`bg-muted-foreground/50`},error:{dot:`bg-destructive`},ready:{dot:`bg-success`},warning:{dot:`bg-warning`}};function W(e){if(!e)return{headline:`Checking provider status`,detail:`Waiting for the server to report installation and authentication details.`};if(!e.enabled||e.status===`disabled`)return{headline:`Disabled`,detail:e.message??`This provider is installed but disabled for new sessions in P4 Code.`};if(!e.installed)return{headline:`Not found`,detail:e.message??`CLI not detected on PATH.`};if(e.auth.status===`unauthenticated`){let t=e.auth.label??e.auth.type;return{headline:t?`Not authenticated · ${t}`:`Not authenticated`,detail:e.message??null}}if(e.status===`warning`)return{headline:`Needs attention`,detail:e.message??`The provider is installed, but the server could not fully verify it.`};if(e.status===`error`)return{headline:`Unavailable`,detail:e.message??`The provider failed its startup checks.`};if(e.auth.status===`authenticated`){let t=e.auth.label??e.auth.type;return{headline:t?`Authenticated · ${t}`:`Authenticated`,detail:e.message??null}}return{headline:`Available`,detail:e.message??null}}function Oe(e){if(!e)return null;let t=/^agy_acp_server_(\d{4})(\d{2})(\d{2})_\d+(?:_(\w+))?$/.exec(e);if(t){let[,e,n,r,i]=t;return`${e}-${n}-${r}${i?` ${i}`:``}`}return/^\d/.test(e)?`v${e}`:e}var ke={graceful:`Limited support`,unsupported:`Unsupported version`,broken:`Known broken version`};function Ae(e,t,n=!0){let r=t?.latestVersionStatus===`broken`||t?.latestVersionStatus===`unsupported`;if(n&&t&&(t.status===`graceful`||t.status===`unsupported`||t.status===`broken`)){let n=t.recommendedVersion,i=Oe(n)??t.recommendedRange;return{title:ke[t.status],detail:t.message??(i?`Use ${i} for full support.`:`Update for full support.`),updateCommand:n||r?null:e?.updateCommand??null,emphasis:t.status===`graceful`?`normal`:`strong`,targetVersion:n}}if(!e||e.status===`current`||e.status===`unknown`||r)return null;let i=`Update available`,a=e.latestVersion,o=Oe(a);return{title:i,detail:e.message??(o?`${i}: install ${o}.`:`${i}: install the latest provider version.`),updateCommand:e.updateCommand,emphasis:`normal`,targetVersion:null}}var je=()=>void 0;function Me(e){let t=(0,B.c)(11),[n,r]=(0,z.useState)(!1),i;t[0]===e.provider?i=t[1]:(i=Ce(e.provider),t[0]=e.provider,t[1]=i);let o=i,s=e.enabled&&o===`ready`,c=e.provider?.auth.status===`authenticated`,l=o===`checking`,u;t[2]===e.provider?u=t[3]:(u=W(e.provider),t[2]=e.provider,t[3]=u);let f=u,p;return t[4]!==c||t[5]!==l||t[6]!==s||t[7]!==f||t[8]!==e||t[9]!==n?(p=e.mode===`existing`&&e.presentation===`onboarding`?(0,V.jsx)(Ie,{title:e.displayName||e.provider?.displayName||`Codex`,description:s?e.provider?.auth.email?.trim()?(0,V.jsxs)(V.Fragment,{children:[`Signed in as`,` `,(0,V.jsx)(I,{value:e.provider.auth.email.trim(),ariaLabel:`Toggle account email visibility`,revealTooltip:`Click to reveal email`,hideTooltip:`Click to hide email`,className:`break-all`}),`.`]}):`Connected with your Codex CLI.`:l?`Checking your Codex CLI...`:e.provider?.installed?f.headline:`Code with your ChatGPT subscription.`,control:s?(0,V.jsxs)(`span`,{className:`inline-flex items-center gap-1.5 text-xs font-medium text-success-foreground`,children:[(0,V.jsx)(a,{className:`size-3.5`}),`Ready`]}):l?(0,V.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`Checking...`}):c?(0,V.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:f.headline}):(0,V.jsx)(me,{size:`sm`,disabled:e.readOnly,onClick:()=>{r(!0),e.onModeChange(`managed`)},children:`Continue with ChatGPT`}),secondaryControl:!c&&!s&&!l?(0,V.jsx)(d,{size:`sm`,variant:`ghost-muted`,onClick:()=>e.onModeChange(`existing`),children:`Use existing CLI`}):null}):e.mode===`existing`?null:e.provider?.setup===void 0?e.presentation===`onboarding`?(0,V.jsx)(Ie,{title:e.displayName||e.provider?.displayName||`Codex`,description:(0,V.jsx)(Fe,{}),control:(0,V.jsx)(d,{size:`sm`,variant:`outline`,className:`min-w-44`,disabled:!0,children:`Open sign-in page`}),secondaryControl:(0,V.jsx)(d,{size:`sm`,variant:`ghost-muted`,disabled:!0,children:`Cancel`})}):(0,V.jsx)(se,{title:`ChatGPT account`,description:`Preparing sign-in.`}):(0,V.jsx)(Pe,{...e,autoStart:n||e.autoStart===!0,onAutoStartConsumed:()=>{r(!1),e.onAutoStartConsumed?.()}},`${e.environmentId}:${e.instanceId}`),t[4]=c,t[5]=l,t[6]=s,t[7]=f,t[8]=e,t[9]=n,t[10]=p):p=t[10],p}function Ne(e){let t=(0,B.c)(9),{environmentId:n,onClose:r,onAccountCreated:i}=e,a=w(n,m),o;t[0]!==a||t[1]!==n||t[2]!==r?(o=(e,t)=>(0,V.jsx)(Pe,{environmentId:n,instanceId:e,provider:t,mode:`managed`,enabled:!0,readOnly:!a,autoStart:!0,onAutoStartConsumed:je,onModeChange:je,onSignInCancelled:r,allowExistingCli:!1},e),t[0]=a,t[1]=n,t[2]=r,t[3]=o):o=t[3];let s;return t[4]!==n||t[5]!==i||t[6]!==r||t[7]!==o?(s=(0,V.jsx)(ve,{environmentId:n,onClose:r,onAccountCreated:i,renderSetup:o}),t[4]=n,t[5]=i,t[6]=r,t[7]=o,t[8]=s):s=t[8],s}function Pe({environmentId:e,instanceId:t,provider:n,enabled:r,readOnly:i,onModeChange:o,autoStart:s,onAutoStartConsumed:c,allowExistingCli:l=!0,presentation:u,displayName:f,onSignInCancelled:p}){let m={environmentId:e,input:{instanceId:t}},_=re(C.providerAuthState(m)),ee=re(C.providerInstallState(m)),[w,ne]=(0,z.useState)(null),E=re(w?C.chatGptHandoffState(w):null),D=E.data?.phase===`auth`?E.data.state:_.data,[O,k]=(0,z.useState)(!1),[A,j]=(0,z.useState)(`chatgpt`),M=D?.methods?.find(e=>e.id===`chatgpt`)?.accountEmail,ae=D?.methods?.find(e=>e.id===A)?.accountEmail,N=D?.methods?.some(e=>e.id.startsWith(`chatgpt-profile:`)),F=D?.interaction?.type===`browser`?D.interaction.url:D?.authorizationUrl,L=ee.data,ue=x(e),de=ue!==null&&P(new URL(ue).hostname),R={reportFailure:!1,reportDefect:!1},B=T(C.startProviderAuth,R),ge=T(C.refreshProviders,R),_e=T(C.completeProviderAuth,R),ve=T(C.cancelProviderAuth,R),ye=T(C.logoutProviderAuth,R),be=T(C.startProviderInstall,R),xe=T(C.cancelProviderInstall,R),Se=T(C.chatGptReconnectProfile,R),Ce=T(C.chatGptImportProfile,R),H=!w&&(!de||window.desktopBridge?.receiveProviderAuthCallback!==void 0),U=H&&!window.desktopBridge?.receiveProviderAuthCallback,we=b(),Te=S(we),Ee=x(we),De=!de&&we&&Te?.connection.phase===`connected`&&Ee&&P(new URL(Ee).hostname)&&(window.desktopBridge!==void 0||P(window.location.hostname))?we:null,W=new URL(window.location.href);W.pathname===`/welcome`&&(W.hash=`agents:${e}`),W.pathname===`/settings/providers`&&W.searchParams.set(`instanceId`,t);let Oe=U,ke=(0,z.useId)(),[Ae,je]=(0,z.useState)(!1),[Me,Ne]=(0,z.useState)({flowId:``,value:``}),Pe=Me.flowId===D?.flowId?Me.value:``,[G,Le]=(0,z.useState)(!1),[Re,ze]=(0,z.useState)(null),Be=(0,z.useRef)(!1),[Ve,He]=(0,z.useState)(null),K=(0,z.useRef)(null),Ue=(0,z.useRef)(!1),We=(0,z.useRef)(null),[Ge,Ke]=(0,z.useState)(!1),q=L?.installedVersion!=null,J=n?.auth.status===`authenticated`,qe=q&&L?.source!==`local`&&L?.version!=null&&L.version!==L.installedVersion,Je=Re!==null&&!J&&(D?.phase===`succeeded`||Re===`handoff`);(0,z.useEffect)(()=>{(J||D?.phase===`failed`||D?.phase===`cancelled`)&&ze(null)},[J,D?.phase]),(0,z.useEffect)(()=>{Re&&D?.phase===`succeeded`&&ge({environmentId:e,input:{instanceId:t}})},[Re,D?.phase,ge,e,t]);let Ye=s&&!Ge,Xe=Re===`sign-in`&&!J&&(D===null||D.phase===`idle`),Ze=Je||Xe||w!==null||D?.phase===`starting`||D?.phase===`waiting`||D?.phase===`verifying`,Y=L?.phase===`downloading`||L?.phase===`extracting`||L?.phase===`verifying`,X=Ye||Ze||G&&!Y,Z=i||!r||G||_.error!==null||ee.error!==null,Q=G||Ze||Y,$=(0,z.useCallback)(async(e,t)=>{if(Be.current)return!1;Be.current=!0,Le(!0),He(null);let n=!1;try{let r=await e();if(r._tag===`Failure`){if(!v(r)){let e=y(r);He(e instanceof Error?e.message:`Codex setup failed. Try again.`)}}else n=!0,t?.(r.value)}catch{He(`Codex setup failed. Try again.`)}return Be.current=!1,Le(!1),n},[]),Qe=(0,z.useId)(),$e=(0,z.useRef)(0),et=(0,z.useRef)(null),[tt,nt]=(0,z.useState)(!1),rt=(0,z.useCallback)(async n=>{let r=await $(()=>Ce({environmentId:e,input:{instanceId:t,profile:n}}));r&&(ze(`handoff`),ne(null)),nt(!r)},[$,Ce,e,t]);(0,z.useEffect)(()=>{if(!w||E.data?.phase!==`finished`)return;let e=w.input.attemptId;et.current!==e&&(et.current=e,rt(E.data.profile))},[w,E.data,rt]),(0,z.useEffect)(()=>{w&&(E.error||E.data?.phase===`auth`&&[`failed`,`cancelled`].includes(E.data.state.phase))&&(He(E.data?.phase===`auth`?E.data.state.message??`ChatGPT sign-in could not finish. Try again.`:`ChatGPT sign-in on the primary environment was interrupted. Try again.`),ne(null))},[w,E.data,E.error]);let it=(0,z.useCallback)(()=>(ze(null),w?(ne(null),Promise.resolve()):$(()=>ve({environmentId:e,input:{instanceId:t,flowId:D.flowId}}))),[w,$,ve,e,t,D]),at=(0,z.useCallback)(async(n=`chatgpt`)=>{if(Be.current)return;Ue.current=!0,nt(!1),j(n);let r=new URL(window.location.href);if(r.pathname===`/welcome`&&(r.hash=`agents:${e}`),r.pathname===`/settings/providers`&&r.searchParams.set(`instanceId`,t),De){let i=`${Qe}:${++$e.current}`;await $(()=>Se({environmentId:e,input:{instanceId:t,methodId:n}}),n=>ne({environmentId:De,input:{instanceId:t,environmentId:e,attemptId:i,returnUrl:r.toString(),profile:n}}))||(Ue.current=!1)}else await $(()=>B({environmentId:e,input:{instanceId:t,methodId:n,returnUrl:r.toString(),callbackMode:H?`client`:`server`}}),()=>ze(`sign-in`))||(Ue.current=!1)},[e,t,$,B,H,De,Se,Qe]),ot=(0,z.useCallback)(async(n=`chatgpt`)=>{Z||Q||(q&&!qe?await at(n):(K.current=n,await $(()=>be({environmentId:e,input:{instanceId:t}}))||(K.current=null)))},[Z,Q,q,qe,at,$,be,e,t]);(0,z.useEffect)(()=>{!s||Ge||Z||Q||L===null||!n?.setup?.canInstall||(Ke(!0),c(),ot())},[s,Ge,Z,Q,L,n?.setup?.canInstall,c,ot]),(0,z.useEffect)(()=>{if(!(!K.current||G||Y)){if(L?.phase===`failed`||L?.phase===`cancelled`)K.current=null;else if(q){let e=K.current;K.current=null,at(e)}}},[G,Y,L?.phase,q,at]);let st=(0,z.useRef)(null),ct=D?.flowId,lt=(0,z.useCallback)(async n=>{try{let r=window.desktopBridge?.receiveProviderAuthCallback;if(r&&H&&ct){if(st.current===n){await te().shell.openExternal(n);return}st.current=n;let i=await r(n);if(st.current!==n)return;st.current=null,await $(()=>_e({environmentId:e,input:{instanceId:t,flowId:ct,callbackUrl:i}}))}else await te().shell.openExternal(n)}catch{He(`Could not finish sign-in on this computer. Try again or paste the redirect URL below.`)}},[H,ct,$,_e,e,t]);(0,z.useEffect)(()=>{if(H&&F&&window.desktopBridge?.cancelProviderAuthCallback)return()=>{st.current===F&&(st.current=null),window.desktopBridge?.cancelProviderAuthCallback?.(F).catch(()=>void 0)}},[H,F]),(0,z.useEffect)(()=>{Ue.current&&D?.phase===`waiting`&&D.flowId&&F&&We.current!==D.flowId&&(We.current=D.flowId,Ue.current=!1,U||lt(F))},[D?.phase,D?.flowId,F,lt,U]);let ut=L?.phase===`downloading`?`Downloading ${(L.downloadedBytes/1e6).toFixed(1)}${L.totalBytes===null?``:` of ${(L.totalBytes/1e6).toFixed(1)}`} MB.`:L?.phase===`extracting`?`Installing Codex.`:L?.phase===`verifying`?`Checking Codex.`:q?`${L?.source===`local`?`Using your installed Codex`:`Managed by P4 Code`}${L?.installedVersion?` · v${L.installedVersion}`:``}.`:L?.message??`P4 Code downloads and manages Codex for you.`,dt=Je?`Finishing sign-in...`:Y?ut:X||D?.phase===`failed`||D?.phase===`cancelled`?D?.phase===`waiting`&&ae?`Continue as ${ae} on OpenAI.`:D?.message??`Finish signing in in your browser.`:J?n?.auth.email?.trim()?(0,V.jsxs)(V.Fragment,{children:[`Signed in as`,` `,(0,V.jsx)(I,{value:n.auth.email.trim(),ariaLabel:`Toggle account email visibility`,revealTooltip:`Click to reveal email`,hideTooltip:`Click to hide email`}),`.`]}):`Signed in with ChatGPT.`:M??`Use your ChatGPT subscription.`,ft=Oe&&F&&D?.flowId&&ce(W.toString())?le({authorizationUrl:F,returnUrl:W.toString(),environmentId:e,instanceId:t,flowId:D.flowId},!1):null,pt=(0,V.jsx)(d,{size:`sm`,variant:U?`default`:`outline`,className:u===`onboarding`?`min-w-44`:void 0,disabled:E.data?.phase===`finished`?G||!tt:!F||D?.phase!==`waiting`,onClick:()=>{E.data?.phase===`finished`?rt(E.data.profile):F&&lt(F)},children:Je?`Finishing sign-in...`:E.data?.phase===`finished`?tt?`Retry connection`:`Finishing sign-in...`:D?.phase===`waiting`?U?`Open ChatGPT sign-in`:`Open sign-in page`:u===`onboarding`?`Open sign-in page`:`Signing in...`}),mt=!w&&D?.phase===`waiting`&&F?(0,V.jsxs)(`div`,{className:`flex w-full flex-col gap-3 text-xs leading-relaxed text-muted-foreground`,children:[(0,V.jsx)(`p`,{children:`If sign-in doesn't return to P4 Code, paste the URL from the final localhost page.`}),(0,V.jsxs)(`form`,{className:`flex flex-col gap-2 sm:flex-row sm:items-center`,onSubmit:n=>{if(n.preventDefault(),!D.flowId||!Pe.trim())return;let r=Pe.trim(),i=D.flowId;$(()=>_e({environmentId:e,input:{instanceId:t,flowId:i,callbackUrl:r}})).then(e=>{e&&Ne({flowId:i,value:``})})},children:[(0,V.jsx)(`div`,{className:`min-w-0 flex-1`,children:(0,V.jsx)(ie,{"aria-label":`ChatGPT sign-in redirect URL`,type:`password`,autoComplete:`off`,placeholder:`Paste the URL from the sign-in tab`,value:Pe,maxLength:16384,disabled:G||i,onChange:e=>Ne({flowId:D.flowId??``,value:e.target.value})})}),(0,V.jsx)(d,{variant:`outline`,type:`submit`,disabled:G||i||!Pe.trim(),children:`Connect`})]}),U?null:(0,V.jsx)(`div`,{children:(0,V.jsxs)(d,{size:`xs`,variant:`ghost-muted`,onClick:()=>void te().shell.openExternal(F),children:[`Try sign-in in your browser`,(0,V.jsx)(h,{className:`size-3.5`})]})}),ft?(0,V.jsxs)(`details`,{children:[(0,V.jsx)(`summary`,{className:`cursor-pointer`,children:`Other ways to connect`}),(0,V.jsx)(d,{className:`mt-2`,size:`sm`,variant:`outline`,render:(0,V.jsx)(`a`,{href:ft}),children:`Use P4 Code desktop for automatic return`})]}):null]}):null,ht=e=>mt?(0,V.jsx)(pe,{open:Ae,children:(0,V.jsx)(fe,{children:(0,V.jsx)(`div`,{id:ke,className:g(`w-full border-t border-border/50 pt-3`,e),children:mt})})}):null,gt=Oe?mt:mt?(0,V.jsxs)(`div`,{className:`text-xs leading-relaxed text-muted-foreground`,children:[(0,V.jsx)(Fe,{label:`Having trouble signing in?`,expanded:Ae,controls:ke,onToggle:()=>je(e=>!e)}),ht(`mt-3`)]}):null,_t=(0,V.jsx)(he,{open:O,methods:D?.methods??[],onClose:()=>k(!1),onSelect:e=>{k(!1),ot(D?.methods?.some(t=>t.id===e)?e:`chatgpt-change-account`)}}),vt=D?.phase===`idle`&&D.message?.startsWith(`Signed out locally.`)?D.message:null;if(u===`onboarding`){let r=vt??Ve??(_.error||ee.error?`Could not read setup status. Reconnect and try again.`:L?.phase===`failed`?L.message:null);return(0,V.jsxs)(V.Fragment,{children:[_t,(0,V.jsxs)(Ie,{title:f||n?.displayName||`Codex`,description:Y?ut:J?n?.auth.email?.trim()?(0,V.jsxs)(V.Fragment,{children:[`Signed in as`,` `,(0,V.jsx)(I,{value:n.auth.email.trim(),ariaLabel:`Toggle account email visibility`,revealTooltip:`Click to reveal email`,hideTooltip:`Click to hide email`,className:`break-all`}),`.`]}):`Connected to ChatGPT.`:mt&&!Oe?(0,V.jsx)(Fe,{expanded:Ae,controls:ke,onToggle:()=>je(e=>!e)}):Ye||Xe||D?.phase===`starting`||D?.phase===`waiting`||G&&!Y?(0,V.jsx)(Fe,{}):X||D?.phase===`failed`||D?.phase===`cancelled`?dt:`Code with your ChatGPT subscription.`,control:J&&!Q?(0,V.jsxs)(`span`,{className:`inline-flex items-center gap-1.5 text-xs font-medium text-success-foreground`,children:[(0,V.jsx)(a,{className:`size-3.5`}),`Ready`]}):X?pt:(0,V.jsx)(me,{size:`sm`,disabled:Z||Q||(q?!n?.setup?.canAuthenticate:!n?.setup?.canInstall),onClick:()=>{N?k(!0):ot()},children:Y||G?`Setting up...`:N?`Reconnect account`:`Continue with ChatGPT`}),secondaryControl:X&&!Je||Y?(0,V.jsx)(d,{size:`sm`,variant:`ghost-muted`,disabled:G||i,onClick:()=>{Ue.current=!1,K.current=null,w||X&&D?.flowId?it():L?.operationId&&$(()=>xe({environmentId:e,input:{instanceId:t,operationId:L.operationId}}))},children:`Cancel`}):!X&&!J&&N?(0,V.jsx)(d,{size:`sm`,variant:`ghost-muted`,disabled:Z||Q,onClick:()=>void ot(`chatgpt-change-account`),children:`Use a different account`}):!X&&!J&&l?(0,V.jsx)(d,{size:`sm`,variant:`ghost-muted`,disabled:i||Q,onClick:()=>o(`existing`),children:`Use existing CLI`}):null,children:[Oe?gt:ht(),r?(0,V.jsx)(`p`,{role:`alert`,className:`text-xs text-destructive`,children:r}):null]})]})}return(0,V.jsxs)(`section`,{"aria-label":`Codex setup`,className:`divide-y divide-border/50`,children:[_t,(0,V.jsx)(se,{title:`ChatGPT account`,description:dt,control:(0,V.jsx)(`div`,{className:`flex flex-wrap items-center justify-end gap-2`,children:X?(0,V.jsxs)(V.Fragment,{children:[pt,!Je&&(0,V.jsx)(d,{size:`sm`,variant:`ghost`,disabled:G||i,onClick:()=>{(w||D?.flowId)&&(Ue.current=!1,it(),p?.())},children:`Cancel`})]}):Y?(0,V.jsx)(d,{size:`sm`,variant:`ghost`,disabled:G||i,onClick:()=>{L?.operationId&&(K.current=null,$(()=>xe({environmentId:e,input:{instanceId:t,operationId:L.operationId}})))},children:`Cancel`}):J?(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(d,{size:`sm`,variant:`outline`,disabled:Z||Q,onClick:()=>k(!0),children:`Change account`}),(0,V.jsx)(d,{size:`sm`,variant:`ghost`,disabled:Z||Q,onClick:()=>void $(()=>ye(m)),children:`Disconnect`})]}):(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(me,{size:`sm`,disabled:Z||Q||(q?!n?.setup?.canAuthenticate:!n?.setup?.canInstall),onClick:()=>{N?k(!0):ot()},children:G?`Setting up...`:N?`Reconnect account`:`Continue with ChatGPT`}),N?(0,V.jsx)(d,{size:`sm`,variant:`ghost`,disabled:Z||Q,onClick:()=>void ot(`chatgpt-change-account`),children:`Use a different account`}):null]})})}),J?(0,V.jsx)(`div`,{className:`flex justify-end px-3 py-1 sm:px-4`,children:(0,V.jsx)(oe,{})}):null,vt?(0,V.jsx)(`p`,{role:`alert`,className:`px-3 py-2 text-xs text-muted-foreground sm:px-4`,children:vt}):null,gt?(0,V.jsx)(`div`,{className:`px-3 py-3 sm:px-4`,children:gt}):null,Ve||_.error||ee.error||L?.phase===`failed`?(0,V.jsx)(`p`,{role:`alert`,className:`px-3 py-2 text-xs text-destructive sm:px-4`,children:Ve??(L?.phase===`failed`?L.message:`Could not read Codex setup status. Reconnect and try again.`)}):null]})}function G(e){let t=(0,B.c)(20),{environmentId:n,instanceId:r,provider:i}=e,a;t[0]!==n||t[1]!==r?(a=C.providerInstallState({environmentId:n,input:{instanceId:r}}),t[0]=n,t[1]=r,t[2]=a):a=t[2];let o=re(a),s=o.data?.executablePath??``,c=o.error?`Could not read runtime path`:`Not installed`,l;t[3]!==s||t[4]!==c?(l=(0,V.jsx)(se,{title:`Binary path`,description:`Selected by P4 Code.`,control:(0,V.jsx)(`div`,{className:`w-full sm:w-80`,children:(0,V.jsx)(ie,{"aria-label":`Codex binary path`,value:s,title:s,placeholder:c,disabled:!0})})}),t[3]=s,t[4]=c,t[5]=l):l=t[5];let u=i?.runtimePaths?.homePath??``,d=i?.runtimePaths?.homePath,f;t[6]!==u||t[7]!==d?(f=(0,V.jsx)(se,{title:`CODEX_HOME path`,description:`Shared Codex config, sessions, and state.`,control:(0,V.jsx)(`div`,{className:`w-full sm:w-80`,children:(0,V.jsx)(ie,{"aria-label":`Codex home path`,value:u,title:d,placeholder:`Unavailable`,disabled:!0})})}),t[6]=u,t[7]=d,t[8]=f):f=t[8];let p=i?.runtimePaths?.shadowHomePath?`Account-specific home sharing the Codex state above.`:`This instance uses the shared Codex home directly.`,m=i?.runtimePaths?.shadowHomePath??``,h=i?.runtimePaths?.shadowHomePath??void 0,g=i?.runtimePaths?`Not used`:`Unavailable`,_;t[9]!==g||t[10]!==m||t[11]!==h?(_=(0,V.jsx)(`div`,{className:`w-full sm:w-80`,children:(0,V.jsx)(ie,{"aria-label":`Codex shadow home path`,value:m,title:h,placeholder:g,disabled:!0})}),t[9]=g,t[10]=m,t[11]=h,t[12]=_):_=t[12];let v;t[13]!==_||t[14]!==p?(v=(0,V.jsx)(se,{title:`Shadow home path`,description:p,control:_}),t[13]=_,t[14]=p,t[15]=v):v=t[15];let y;return t[16]!==v||t[17]!==l||t[18]!==f?(y=(0,V.jsxs)(V.Fragment,{children:[l,f,v]}),t[16]=v,t[17]=l,t[18]=f,t[19]=y):y=t[19],y}function Fe(e){let t=(0,B.c)(10),{label:n,expanded:r,controls:i,onToggle:a}=e,o=n===void 0?`Complete sign-in in your browser.`:n,s=r!==void 0&&r;if(!a){let e;return t[0]===o?e=t[1]:(e=(0,V.jsx)(`div`,{className:`leading-relaxed`,children:o}),t[0]=o,t[1]=e),e}let l=`size-3 shrink-0 ${s?`rotate-90`:``}`,u;t[2]===l?u=t[3]:(u=(0,V.jsx)(c,{"aria-hidden":!0,className:l}),t[2]=l,t[3]=u);let d;return t[4]!==i||t[5]!==s||t[6]!==o||t[7]!==a||t[8]!==u?(d=(0,V.jsxs)(`button`,{type:`button`,className:`inline-flex items-center gap-1.5 rounded-sm text-left leading-relaxed outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring`,"aria-label":`Having trouble signing in?`,"aria-expanded":s,"aria-controls":i,onClick:a,children:[o,u]}),t[4]=i,t[5]=s,t[6]=o,t[7]=a,t[8]=u,t[9]=d):d=t[9],d}function Ie(e){let t=(0,B.c)(21),{title:n,description:r,control:i,secondaryControl:a,children:o}=e,s;t[0]===o?s=t[1]:(s=z.Children.toArray(o),t[0]=o,t[1]=s);let c=s,l;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,V.jsx)(N,{className:`size-5 shrink-0 fill-foreground`}),t[2]=l):l=t[2];let u;t[3]===n?u=t[4]:(u=(0,V.jsx)(`h3`,{className:`text-sm font-medium`,children:n}),t[3]=n,t[4]=u);let d;t[5]===r?d=t[6]:(d=(0,V.jsx)(`div`,{className:`mt-0.5 text-xs leading-relaxed text-muted-foreground`,children:r}),t[5]=r,t[6]=d);let f;t[7]!==u||t[8]!==d?(f=(0,V.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[u,d]}),t[7]=u,t[8]=d,t[9]=f):f=t[9];let p;t[10]!==i||t[11]!==a?(p=i||a?(0,V.jsxs)(`div`,{className:`flex shrink-0 flex-wrap items-center justify-end gap-2 has-[button]:w-full has-[button]:flex-col-reverse has-[button]:items-end sm:has-[button]:w-auto sm:has-[button]:flex-row sm:has-[button]:items-center`,children:[a,i]}):null,t[10]=i,t[11]=a,t[12]=p):p=t[12];let m;t[13]!==f||t[14]!==p?(m=(0,V.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3`,children:[l,f,p]}),t[13]=f,t[14]=p,t[15]=m):m=t[15];let h;t[16]===c?h=t[17]:(h=c.length>0?(0,V.jsx)(`div`,{className:`ml-8 mt-2 flex flex-wrap items-center gap-2`,children:c}):null,t[16]=c,t[17]=h);let g;return t[18]!==m||t[19]!==h?(g=(0,V.jsxs)(`div`,{className:`rounded-lg border border-border bg-background px-4 py-4`,children:[m,h]}),t[18]=m,t[19]=h,t[20]=g):g=t[20],g}function Le(e){return typeof e==`object`&&e&&`setupMode`in e&&e.setupMode===`managed`?`managed`:`existing`}export{De as a,Oe as c,Ee as d,U as f,Me as i,Ce as l,Ne as n,W as o,me as p,G as r,Ae as s,Le as t,Te as u};
2
- //# sourceMappingURL=CodexSetupSection.logic-SHExnMKR.js.map
1
+ import{a as e,t}from"./react-BUfh6y28.js";import{n,t as r}from"./jsx-runtime-DJeoFXNw.js";import{Bb as i,Dh as a,Id as o,OE as s,Th as c,X_ as l,Y_ as u,fr as d,l as f,mf as p,ns as m,pv as h,t as g,zd as _}from"./utils-OWUgXvpr.js";import{R as v,W as y}from"./runtime-CcgzOADx.js";import{O as b,S as x,d as ee,q as te,x as S}from"./useSettings-jZr_DfW0.js";import{f as C}from"./server-C-cSQN_G.js";import{i as w,n as ne}from"./session-D6BRf77P.js";import{n as re}from"./query-DszcgUku.js";import{t as T}from"./use-atom-command-DEluSG6k.js";import{n as E,t as D}from"./radio-group-Cb2KobOI.js";import{t as ie}from"./input-BGKmQVHf.js";import{a as O,c as k,i as A,r as j,s as M,t as ae}from"./dialog-BEXthTAp.js";import{S as N}from"./Icons-DYaY7Otq.js";import{t as P}from"./preview-D8H2Itzr.js";import{S as F,t as oe}from"./ChatGptUsageButton-DQjnXjt6.js";import{t as I}from"./RedactedSensitiveText-BFwVjGRJ.js";import{a as se}from"./settingsLayout-fG812pJ2.js";import{Ea as ce,Ta as le,co as L,do as ue,lo as de,mo as fe,po as pe,uo as R}from"./main-CRJyb41E.js";var z=e(t(),1),B=n(),V=e(r(),1);function me(e){let t=(0,B.c)(7),n,r;t[0]===e?(n=t[1],r=t[2]):({children:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,V.jsx)(N,{className:`size-4 shrink-0`,"aria-hidden":`true`}),t[3]=i):i=t[3];let a=n??`Continue with ChatGPT`,o;return t[4]!==r||t[5]!==a?(o=(0,V.jsxs)(d,{...r,children:[i,a]}),t[4]=r,t[5]=a,t[6]=o):o=t[6],o}function he(e){let t=(0,B.c)(23),{open:n,methods:r,onClose:i,onSelect:a}=e,o=r.filter(_e),[s,c]=(0,z.useState)(null),l=s===`chatgpt-change-account`?s:o.find(e=>e.id===s)?.id??o[0]?.id??`chatgpt-change-account`,u=ae,d;t[0]===i?d=t[1]:(d=e=>{e||i()},t[0]=i,t[1]=d);let f=M,p;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,V.jsxs)(O,{children:[(0,V.jsx)(k,{children:`Reconnect ChatGPT`}),(0,V.jsx)(j,{children:`On OpenAI, sign in with the account you choose here.`})]}),t[2]=p):p=t[2];let m=E,h;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(h=e=>c(e),t[3]=h):h=t[3];let g=o.map(ge),_;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(_=(0,V.jsxs)(`label`,{className:`flex cursor-pointer items-center gap-3 rounded-lg border px-3 py-3 text-sm`,children:[(0,V.jsx)(D,{value:`chatgpt-change-account`}),(0,V.jsx)(`span`,{className:`font-medium`,children:`Use a different account`})]}),t[4]=_):_=t[4];let v;t[5]!==m||t[6]!==l||t[7]!==h||t[8]!==g?(v=(0,V.jsx)(`div`,{className:`px-6 pb-6`,children:(0,V.jsxs)(m,{"aria-label":`ChatGPT account to connect`,value:l,onValueChange:h,children:[g,_]})}),t[5]=m,t[6]=l,t[7]=h,t[8]=g,t[9]=v):v=t[9];let y;t[10]!==a||t[11]!==l?(y=(0,V.jsx)(A,{children:(0,V.jsx)(me,{onClick:()=>a(l)})}),t[10]=a,t[11]=l,t[12]=y):y=t[12];let b;t[13]!==f||t[14]!==p||t[15]!==v||t[16]!==y?(b=(0,V.jsxs)(f,{children:[p,v,y]}),t[13]=f,t[14]=p,t[15]=v,t[16]=y,t[17]=b):b=t[17];let x;return t[18]!==u||t[19]!==n||t[20]!==d||t[21]!==b?(x=(0,V.jsx)(u,{open:n,onOpenChange:d,children:b}),t[18]=u,t[19]=n,t[20]=d,t[21]=b,t[22]=x):x=t[22],x}function ge(e){return(0,V.jsxs)(`label`,{className:`flex cursor-pointer items-center gap-3 rounded-lg border px-3 py-3 text-sm`,children:[(0,V.jsx)(D,{value:e.id}),(0,V.jsx)(`span`,{className:`min-w-0 break-all font-medium`,children:e.name})]},e.id)}function _e(e){return e.id.startsWith(`chatgpt-profile:`)}function ve(e){let t=(0,B.c)(58),{environmentId:n,onClose:r,renderSetup:i,onAccountCreated:a}=e,o=w(n,h),s=ee(n),c;t[0]===n?c=t[1]:(c=C.providersValueAtom(n),t[0]=n,t[1]=c);let p=m(c),g=T(C.updateSettings,`Add ChatGPT account`),[_,v]=(0,z.useState)(`Personal`),y;t[2]===_?y=t[3]:(y=_.trim(),t[2]=_,t[3]=y);let b=`ChatGPT - ${y}`,[x,te]=(0,z.useState)(null),[S,re]=(0,z.useState)(!1),E,D,O,k,A,j,M,N,P;if(t[4]!==b||t[5]!==n||t[6]!==x||t[7]!==_||t[8]!==a||t[9]!==r||t[10]!==S||t[11]!==p||t[12]!==i||t[13]!==s||t[14]!==g){let e=p?.find(e=>e.instanceId===x),o=F(e),c;t[24]!==b||t[25]!==n||t[26]!==_||t[27]!==a||t[28]!==r||t[29]!==S||t[30]!==s||t[31]!==g?(c=async()=>{if(S||!_.trim()||!ne(n,`providers:manage`))return;re(!0);let e=l.make(`codex_${f()}`);(await g({environmentId:n,input:{patch:{providerInstances:{...s.providerInstances,[e]:{driver:u.make(`codex`),displayName:b,enabled:!0,config:{enabled:!0,setupMode:`managed`}}}}}}))._tag===`Success`&&(a?(a(e,b),r()):te(e)),re(!1)},t[24]=b,t[25]=n,t[26]=_,t[27]=a,t[28]=r,t[29]=S,t[30]=s,t[31]=g,t[32]=c):c=t[32];let d=c;O=ae,M=!o,t[33]===r?N=t[34]:(N=e=>{e||r()},t[33]=r,t[34]=N),P=e=>{!e&&o&&r()},D=ue,A=`wide`;let m=x?b:`Add ChatGPT account`;t[35]===m?j=t[36]:(j=(0,V.jsx)(de,{title:m,description:`Each account has its own Codex instance and sign-in. Choose the other account on the sign-in page.`}),t[35]=m,t[36]=j),E=R,k=x?e?.setup?i(x,e):(0,V.jsx)(se,{title:`Codex runtime`,description:`Preparing managed setup.`}):(0,V.jsx)(`form`,{id:`add-codex-account`,onSubmit:e=>{e.preventDefault(),d()},children:(0,V.jsx)(se,{title:`Account name`,description:`Shown in the provider list and model picker.`,control:(0,V.jsx)(ie,{"aria-label":`Account name`,value:_,disabled:S,onChange:e=>v(e.target.value),placeholder:`e.g. Personal or Work`})})}),t[4]=b,t[5]=n,t[6]=x,t[7]=_,t[8]=a,t[9]=r,t[10]=S,t[11]=p,t[12]=i,t[13]=s,t[14]=g,t[15]=E,t[16]=D,t[17]=O,t[18]=k,t[19]=A,t[20]=j,t[21]=M,t[22]=N,t[23]=P}else E=t[15],D=t[16],O=t[17],k=t[18],A=t[19],j=t[20],M=t[21],N=t[22],P=t[23];let oe;t[37]!==E||t[38]!==k?(oe=(0,V.jsx)(E,{children:k}),t[37]=E,t[38]=k,t[39]=oe):oe=t[39];let I;t[40]!==o||t[41]!==x||t[42]!==_||t[43]!==r||t[44]!==S?(I=(0,V.jsx)(L,{children:x?(0,V.jsx)(d,{variant:`outline`,onClick:r,children:`Finish later`}):(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(d,{variant:`outline`,disabled:S,onClick:r,children:`Cancel`}),(0,V.jsx)(d,{type:`submit`,form:`add-codex-account`,disabled:S||!_.trim()||!o,children:S?`Adding account…`:`Continue`})]})}),t[40]=o,t[41]=x,t[42]=_,t[43]=r,t[44]=S,t[45]=I):I=t[45];let ce;t[46]!==D||t[47]!==I||t[48]!==A||t[49]!==j||t[50]!==oe?(ce=(0,V.jsxs)(D,{size:A,children:[j,oe,I]}),t[46]=D,t[47]=I,t[48]=A,t[49]=j,t[50]=oe,t[51]=ce):ce=t[51];let le;return t[52]!==O||t[53]!==ce||t[54]!==M||t[55]!==N||t[56]!==P?(le=(0,V.jsx)(O,{open:M,onOpenChange:N,onOpenChangeComplete:P,children:ce}),t[52]=O,t[53]=ce,t[54]=M,t[55]=N,t[56]=P,t[57]=le):le=t[57],le}var ye=i(c),be=i(a),xe=/^[A-Za-z0-9_./:\\-]+$/;function Se(e,t,n){return xe.test(e)&&(n===`windows`||!e.includes(`\\`))?e:n===`windows`?`& '${e.replaceAll(`'`,`''`)}'`:n===`darwin`||n===`linux`?e.startsWith(`~/`)||e.startsWith(`~\\`)?`~/'${e.slice(2).replaceAll(`'`,`'"'"'`)}'`:`'${e.replaceAll(`'`,`'"'"'`)}'`:t}function Ce(e){return e===void 0?`checking`:!e.enabled||e.status===`disabled`?`disabled`:!e.installed&&e.status===`warning`&&e.auth.status===`unknown`?`checking`:e.installed?e.auth.status===`unauthenticated`?`signIn`:e.status===`ready`?`ready`:`attention`:`install`}var H={checking:0,disabled:1,install:2,attention:3,signIn:4,ready:5};function U(e){let t=new Map;for(let n of e??[]){let e=t.get(n.driver);(e===void 0||H[Ce(n)]>H[Ce(e)])&&t.set(n.driver,n)}return t}var we={claudeAgent:{windows:`irm https://claude.ai/install.ps1 | iex`,posix:`curl -fsSL https://claude.ai/install.sh | bash`},codex:{windows:`irm https://chatgpt.com/codex/install.ps1 | iex`,posix:`curl -fsSL https://chatgpt.com/codex/install.sh | sh`}};function Te(e,t){let n=we[e];return t===`windows`?n.windows:n.posix}function Ee(e,t,n){let r=t.providerInstances[e.instanceId];if(e.driver===`claudeAgent`){let e=ye(r?.config??{});return`${Se(s(e)?e.value.binaryPath:`claude`,`claude`,n)} auth login`}if(e.driver===`codex`){let e=be(r?.config??{});return`${Se(s(e)?e.value.binaryPath:`codex`,`codex`,n)} login`}return e.driver}var De={disabled:{dot:`bg-muted-foreground/50`},error:{dot:`bg-destructive`},ready:{dot:`bg-success`},warning:{dot:`bg-warning`}};function W(e){if(!e)return{headline:`Checking provider status`,detail:`Waiting for the server to report installation and authentication details.`};if(!e.enabled||e.status===`disabled`)return{headline:`Disabled`,detail:e.message??`This provider is installed but disabled for new sessions in P4 Code.`};if(!e.installed)return{headline:`Not found`,detail:e.message??`CLI not detected on PATH.`};if(e.auth.status===`unauthenticated`){let t=e.auth.label??e.auth.type;return{headline:t?`Not authenticated · ${t}`:`Not authenticated`,detail:e.message??null}}if(e.status===`warning`)return{headline:`Needs attention`,detail:e.message??`The provider is installed, but the server could not fully verify it.`};if(e.status===`error`)return{headline:`Unavailable`,detail:e.message??`The provider failed its startup checks.`};if(e.auth.status===`authenticated`){let t=e.auth.label??e.auth.type;return{headline:t?`Authenticated · ${t}`:`Authenticated`,detail:e.message??null}}return{headline:`Available`,detail:e.message??null}}function Oe(e){if(!e)return null;let t=/^agy_acp_server_(\d{4})(\d{2})(\d{2})_\d+(?:_(\w+))?$/.exec(e);if(t){let[,e,n,r,i]=t;return`${e}-${n}-${r}${i?` ${i}`:``}`}return/^\d/.test(e)?`v${e}`:e}var ke={graceful:`Limited support`,unsupported:`Unsupported version`,broken:`Known broken version`};function Ae(e,t,n=!0){let r=t?.latestVersionStatus===`broken`||t?.latestVersionStatus===`unsupported`;if(n&&t&&(t.status===`graceful`||t.status===`unsupported`||t.status===`broken`)){let n=t.recommendedVersion,i=Oe(n)??t.recommendedRange;return{title:ke[t.status],detail:t.message??(i?`Use ${i} for full support.`:`Update for full support.`),updateCommand:n||r?null:e?.updateCommand??null,emphasis:t.status===`graceful`?`normal`:`strong`,targetVersion:n}}if(!e||e.status===`current`||e.status===`unknown`||r)return null;let i=`Update available`,a=e.latestVersion,o=Oe(a);return{title:i,detail:e.message??(o?`${i}: install ${o}.`:`${i}: install the latest provider version.`),updateCommand:e.updateCommand,emphasis:`normal`,targetVersion:null}}var je=()=>void 0;function Me(e){let t=(0,B.c)(11),[n,r]=(0,z.useState)(!1),i;t[0]===e.provider?i=t[1]:(i=Ce(e.provider),t[0]=e.provider,t[1]=i);let a=i,s=e.enabled&&a===`ready`,c=e.provider?.auth.status===`authenticated`,l=a===`checking`,u;t[2]===e.provider?u=t[3]:(u=W(e.provider),t[2]=e.provider,t[3]=u);let f=u,p;return t[4]!==c||t[5]!==l||t[6]!==s||t[7]!==f||t[8]!==e||t[9]!==n?(p=e.mode===`existing`&&e.presentation===`onboarding`?(0,V.jsx)(Ie,{title:e.displayName||e.provider?.displayName||`Codex`,description:s?e.provider?.auth.email?.trim()?(0,V.jsxs)(V.Fragment,{children:[`Signed in as`,` `,(0,V.jsx)(I,{value:e.provider.auth.email.trim(),ariaLabel:`Toggle account email visibility`,revealTooltip:`Click to reveal email`,hideTooltip:`Click to hide email`,className:`break-all`}),`.`]}):`Connected with your Codex CLI.`:l?`Checking your Codex CLI...`:e.provider?.installed?f.headline:`Code with your ChatGPT subscription.`,control:s?(0,V.jsxs)(`span`,{className:`inline-flex items-center gap-1.5 text-xs font-medium text-success-foreground`,children:[(0,V.jsx)(o,{className:`size-3.5`}),`Ready`]}):l?(0,V.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`Checking...`}):c?(0,V.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:f.headline}):(0,V.jsx)(me,{size:`sm`,disabled:e.readOnly,onClick:()=>{r(!0),e.onModeChange(`managed`)},children:`Continue with ChatGPT`}),secondaryControl:!c&&!s&&!l?(0,V.jsx)(d,{size:`sm`,variant:`ghost-muted`,onClick:()=>e.onModeChange(`existing`),children:`Use existing CLI`}):null}):e.mode===`existing`?null:e.provider?.setup===void 0?e.presentation===`onboarding`?(0,V.jsx)(Ie,{title:e.displayName||e.provider?.displayName||`Codex`,description:(0,V.jsx)(Fe,{}),control:(0,V.jsx)(d,{size:`sm`,variant:`outline`,className:`min-w-44`,disabled:!0,children:`Open sign-in page`}),secondaryControl:(0,V.jsx)(d,{size:`sm`,variant:`ghost-muted`,disabled:!0,children:`Cancel`})}):(0,V.jsx)(se,{title:`ChatGPT account`,description:`Preparing sign-in.`}):(0,V.jsx)(Pe,{...e,autoStart:n||e.autoStart===!0,onAutoStartConsumed:()=>{r(!1),e.onAutoStartConsumed?.()}},`${e.environmentId}:${e.instanceId}`),t[4]=c,t[5]=l,t[6]=s,t[7]=f,t[8]=e,t[9]=n,t[10]=p):p=t[10],p}function Ne(e){let t=(0,B.c)(9),{environmentId:n,onClose:r,onAccountCreated:i}=e,a=w(n,h),o;t[0]!==a||t[1]!==n||t[2]!==r?(o=(e,t)=>(0,V.jsx)(Pe,{environmentId:n,instanceId:e,provider:t,mode:`managed`,enabled:!0,readOnly:!a,autoStart:!0,onAutoStartConsumed:je,onModeChange:je,onSignInCancelled:r,allowExistingCli:!1},e),t[0]=a,t[1]=n,t[2]=r,t[3]=o):o=t[3];let s;return t[4]!==n||t[5]!==i||t[6]!==r||t[7]!==o?(s=(0,V.jsx)(ve,{environmentId:n,onClose:r,onAccountCreated:i,renderSetup:o}),t[4]=n,t[5]=i,t[6]=r,t[7]=o,t[8]=s):s=t[8],s}function Pe({environmentId:e,instanceId:t,provider:n,enabled:r,readOnly:i,onModeChange:a,autoStart:s,onAutoStartConsumed:c,allowExistingCli:l=!0,presentation:u,displayName:f,onSignInCancelled:m}){let h={environmentId:e,input:{instanceId:t}},_=re(C.providerAuthState(h)),ee=re(C.providerInstallState(h)),[w,ne]=(0,z.useState)(null),E=re(w?C.chatGptHandoffState(w):null),D=E.data?.phase===`auth`?E.data.state:_.data,[O,k]=(0,z.useState)(!1),[A,j]=(0,z.useState)(`chatgpt`),M=D?.methods?.find(e=>e.id===`chatgpt`)?.accountEmail,ae=D?.methods?.find(e=>e.id===A)?.accountEmail,N=D?.methods?.some(e=>e.id.startsWith(`chatgpt-profile:`)),F=D?.interaction?.type===`browser`?D.interaction.url:D?.authorizationUrl,L=ee.data,ue=x(e),de=ue!==null&&P(new URL(ue).hostname),R={reportFailure:!1,reportDefect:!1},B=T(C.startProviderAuth,R),ge=T(C.refreshProviders,R),_e=T(C.completeProviderAuth,R),ve=T(C.cancelProviderAuth,R),ye=T(C.logoutProviderAuth,R),be=T(C.startProviderInstall,R),xe=T(C.cancelProviderInstall,R),Se=T(C.chatGptReconnectProfile,R),Ce=T(C.chatGptImportProfile,R),H=!w&&(!de||window.desktopBridge?.receiveProviderAuthCallback!==void 0),U=H&&!window.desktopBridge?.receiveProviderAuthCallback,we=b(),Te=S(we),Ee=x(we),De=!de&&we&&Te?.connection.phase===`connected`&&Ee&&P(new URL(Ee).hostname)&&(window.desktopBridge!==void 0||P(window.location.hostname))?we:null,W=new URL(window.location.href);W.pathname===`/welcome`&&(W.hash=`agents:${e}`),W.pathname===`/settings/providers`&&W.searchParams.set(`instanceId`,t);let Oe=U,ke=(0,z.useId)(),[Ae,je]=(0,z.useState)(!1),[Me,Ne]=(0,z.useState)({flowId:``,value:``}),Pe=Me.flowId===D?.flowId?Me.value:``,[G,Le]=(0,z.useState)(!1),[Re,ze]=(0,z.useState)(null),Be=(0,z.useRef)(!1),[Ve,He]=(0,z.useState)(null),K=(0,z.useRef)(null),Ue=(0,z.useRef)(!1),We=(0,z.useRef)(null),[Ge,Ke]=(0,z.useState)(!1),q=L?.installedVersion!=null,J=n?.auth.status===`authenticated`,qe=q&&L?.source!==`local`&&L?.version!=null&&L.version!==L.installedVersion,Je=Re!==null&&!J&&(D?.phase===`succeeded`||Re===`handoff`);(0,z.useEffect)(()=>{(J||D?.phase===`failed`||D?.phase===`cancelled`)&&ze(null)},[J,D?.phase]),(0,z.useEffect)(()=>{Re&&D?.phase===`succeeded`&&ge({environmentId:e,input:{instanceId:t}})},[Re,D?.phase,ge,e,t]);let Ye=s&&!Ge,Xe=Re===`sign-in`&&!J&&(D===null||D.phase===`idle`),Ze=Je||Xe||w!==null||D?.phase===`starting`||D?.phase===`waiting`||D?.phase===`verifying`,Y=L?.phase===`downloading`||L?.phase===`extracting`||L?.phase===`verifying`,X=Ye||Ze||G&&!Y,Z=i||!r||G||_.error!==null||ee.error!==null,Q=G||Ze||Y,$=(0,z.useCallback)(async(e,t)=>{if(Be.current)return!1;Be.current=!0,Le(!0),He(null);let n=!1;try{let r=await e();if(r._tag===`Failure`){if(!v(r)){let e=y(r);He(e instanceof Error?e.message:`Codex setup failed. Try again.`)}}else n=!0,t?.(r.value)}catch{He(`Codex setup failed. Try again.`)}return Be.current=!1,Le(!1),n},[]),Qe=(0,z.useId)(),$e=(0,z.useRef)(0),et=(0,z.useRef)(null),[tt,nt]=(0,z.useState)(!1),rt=(0,z.useCallback)(async n=>{let r=await $(()=>Ce({environmentId:e,input:{instanceId:t,profile:n}}));r&&(ze(`handoff`),ne(null)),nt(!r)},[$,Ce,e,t]);(0,z.useEffect)(()=>{if(!w||E.data?.phase!==`finished`)return;let e=w.input.attemptId;et.current!==e&&(et.current=e,rt(E.data.profile))},[w,E.data,rt]),(0,z.useEffect)(()=>{w&&(E.error||E.data?.phase===`auth`&&[`failed`,`cancelled`].includes(E.data.state.phase))&&(He(E.data?.phase===`auth`?E.data.state.message??`ChatGPT sign-in could not finish. Try again.`:`ChatGPT sign-in on the primary environment was interrupted. Try again.`),ne(null))},[w,E.data,E.error]);let it=(0,z.useCallback)(()=>(ze(null),w?(ne(null),Promise.resolve()):$(()=>ve({environmentId:e,input:{instanceId:t,flowId:D.flowId}}))),[w,$,ve,e,t,D]),at=(0,z.useCallback)(async(n=`chatgpt`)=>{if(Be.current)return;Ue.current=!0,nt(!1),j(n);let r=new URL(window.location.href);if(r.pathname===`/welcome`&&(r.hash=`agents:${e}`),r.pathname===`/settings/providers`&&r.searchParams.set(`instanceId`,t),De){let i=`${Qe}:${++$e.current}`;await $(()=>Se({environmentId:e,input:{instanceId:t,methodId:n}}),n=>ne({environmentId:De,input:{instanceId:t,environmentId:e,attemptId:i,returnUrl:r.toString(),profile:n}}))||(Ue.current=!1)}else await $(()=>B({environmentId:e,input:{instanceId:t,methodId:n,returnUrl:r.toString(),callbackMode:H?`client`:`server`}}),()=>ze(`sign-in`))||(Ue.current=!1)},[e,t,$,B,H,De,Se,Qe]),ot=(0,z.useCallback)(async(n=`chatgpt`)=>{Z||Q||(q&&!qe?await at(n):(K.current=n,await $(()=>be({environmentId:e,input:{instanceId:t}}))||(K.current=null)))},[Z,Q,q,qe,at,$,be,e,t]);(0,z.useEffect)(()=>{!s||Ge||Z||Q||L===null||!n?.setup?.canInstall||(Ke(!0),c(),ot())},[s,Ge,Z,Q,L,n?.setup?.canInstall,c,ot]),(0,z.useEffect)(()=>{if(!(!K.current||G||Y)){if(L?.phase===`failed`||L?.phase===`cancelled`)K.current=null;else if(q){let e=K.current;K.current=null,at(e)}}},[G,Y,L?.phase,q,at]);let st=(0,z.useRef)(null),ct=D?.flowId,lt=(0,z.useCallback)(async n=>{try{let r=window.desktopBridge?.receiveProviderAuthCallback;if(r&&H&&ct){if(st.current===n){await te().shell.openExternal(n);return}st.current=n;let i=await r(n);if(st.current!==n)return;st.current=null,await $(()=>_e({environmentId:e,input:{instanceId:t,flowId:ct,callbackUrl:i}}))}else await te().shell.openExternal(n)}catch{He(`Could not finish sign-in on this computer. Try again or paste the redirect URL below.`)}},[H,ct,$,_e,e,t]);(0,z.useEffect)(()=>{if(H&&F&&window.desktopBridge?.cancelProviderAuthCallback)return()=>{st.current===F&&(st.current=null),window.desktopBridge?.cancelProviderAuthCallback?.(F).catch(()=>void 0)}},[H,F]),(0,z.useEffect)(()=>{Ue.current&&D?.phase===`waiting`&&D.flowId&&F&&We.current!==D.flowId&&(We.current=D.flowId,Ue.current=!1,U||lt(F))},[D?.phase,D?.flowId,F,lt,U]);let ut=L?.phase===`downloading`?`Downloading ${(L.downloadedBytes/1e6).toFixed(1)}${L.totalBytes===null?``:` of ${(L.totalBytes/1e6).toFixed(1)}`} MB.`:L?.phase===`extracting`?`Installing Codex.`:L?.phase===`verifying`?`Checking Codex.`:q?`${L?.source===`local`?`Using your installed Codex`:`Managed by P4 Code`}${L?.installedVersion?` · v${L.installedVersion}`:``}.`:L?.message??`P4 Code downloads and manages Codex for you.`,dt=Je?`Finishing sign-in...`:Y?ut:X||D?.phase===`failed`||D?.phase===`cancelled`?D?.phase===`waiting`&&ae?`Continue as ${ae} on OpenAI.`:D?.message??`Finish signing in in your browser.`:J?n?.auth.email?.trim()?(0,V.jsxs)(V.Fragment,{children:[`Signed in as`,` `,(0,V.jsx)(I,{value:n.auth.email.trim(),ariaLabel:`Toggle account email visibility`,revealTooltip:`Click to reveal email`,hideTooltip:`Click to hide email`}),`.`]}):`Signed in with ChatGPT.`:M??`Use your ChatGPT subscription.`,ft=Oe&&F&&D?.flowId&&ce(W.toString())?le({authorizationUrl:F,returnUrl:W.toString(),environmentId:e,instanceId:t,flowId:D.flowId},!1):null,pt=(0,V.jsx)(d,{size:`sm`,variant:U?`default`:`outline`,className:u===`onboarding`?`min-w-44`:void 0,disabled:E.data?.phase===`finished`?G||!tt:!F||D?.phase!==`waiting`,onClick:()=>{E.data?.phase===`finished`?rt(E.data.profile):F&&lt(F)},children:Je?`Finishing sign-in...`:E.data?.phase===`finished`?tt?`Retry connection`:`Finishing sign-in...`:D?.phase===`waiting`?U?`Open ChatGPT sign-in`:`Open sign-in page`:u===`onboarding`?`Open sign-in page`:`Signing in...`}),mt=!w&&D?.phase===`waiting`&&F?(0,V.jsxs)(`div`,{className:`flex w-full flex-col gap-3 text-xs leading-relaxed text-muted-foreground`,children:[(0,V.jsx)(`p`,{children:`If sign-in doesn't return to P4 Code, paste the URL from the final localhost page.`}),(0,V.jsxs)(`form`,{className:`flex flex-col gap-2 sm:flex-row sm:items-center`,onSubmit:n=>{if(n.preventDefault(),!D.flowId||!Pe.trim())return;let r=Pe.trim(),i=D.flowId;$(()=>_e({environmentId:e,input:{instanceId:t,flowId:i,callbackUrl:r}})).then(e=>{e&&Ne({flowId:i,value:``})})},children:[(0,V.jsx)(`div`,{className:`min-w-0 flex-1`,children:(0,V.jsx)(ie,{"aria-label":`ChatGPT sign-in redirect URL`,type:`password`,autoComplete:`off`,placeholder:`Paste the URL from the sign-in tab`,value:Pe,maxLength:16384,disabled:G||i,onChange:e=>Ne({flowId:D.flowId??``,value:e.target.value})})}),(0,V.jsx)(d,{variant:`outline`,type:`submit`,disabled:G||i||!Pe.trim(),children:`Connect`})]}),U?null:(0,V.jsx)(`div`,{children:(0,V.jsxs)(d,{size:`xs`,variant:`ghost-muted`,onClick:()=>void te().shell.openExternal(F),children:[`Try sign-in in your browser`,(0,V.jsx)(p,{className:`size-3.5`})]})}),ft?(0,V.jsxs)(`details`,{children:[(0,V.jsx)(`summary`,{className:`cursor-pointer`,children:`Other ways to connect`}),(0,V.jsx)(d,{className:`mt-2`,size:`sm`,variant:`outline`,render:(0,V.jsx)(`a`,{href:ft}),children:`Use P4 Code desktop for automatic return`})]}):null]}):null,ht=e=>mt?(0,V.jsx)(pe,{open:Ae,children:(0,V.jsx)(fe,{children:(0,V.jsx)(`div`,{id:ke,className:g(`w-full border-t border-border/50 pt-3`,e),children:mt})})}):null,gt=Oe?mt:mt?(0,V.jsxs)(`div`,{className:`text-xs leading-relaxed text-muted-foreground`,children:[(0,V.jsx)(Fe,{label:`Having trouble signing in?`,expanded:Ae,controls:ke,onToggle:()=>je(e=>!e)}),ht(`mt-3`)]}):null,_t=(0,V.jsx)(he,{open:O,methods:D?.methods??[],onClose:()=>k(!1),onSelect:e=>{k(!1),ot(D?.methods?.some(t=>t.id===e)?e:`chatgpt-change-account`)}}),vt=D?.phase===`idle`&&D.message?.startsWith(`Signed out locally.`)?D.message:null;if(u===`onboarding`){let r=vt??Ve??(_.error||ee.error?`Could not read setup status. Reconnect and try again.`:L?.phase===`failed`?L.message:null);return(0,V.jsxs)(V.Fragment,{children:[_t,(0,V.jsxs)(Ie,{title:f||n?.displayName||`Codex`,description:Y?ut:J?n?.auth.email?.trim()?(0,V.jsxs)(V.Fragment,{children:[`Signed in as`,` `,(0,V.jsx)(I,{value:n.auth.email.trim(),ariaLabel:`Toggle account email visibility`,revealTooltip:`Click to reveal email`,hideTooltip:`Click to hide email`,className:`break-all`}),`.`]}):`Connected to ChatGPT.`:mt&&!Oe?(0,V.jsx)(Fe,{expanded:Ae,controls:ke,onToggle:()=>je(e=>!e)}):Ye||Xe||D?.phase===`starting`||D?.phase===`waiting`||G&&!Y?(0,V.jsx)(Fe,{}):X||D?.phase===`failed`||D?.phase===`cancelled`?dt:`Code with your ChatGPT subscription.`,control:J&&!Q?(0,V.jsxs)(`span`,{className:`inline-flex items-center gap-1.5 text-xs font-medium text-success-foreground`,children:[(0,V.jsx)(o,{className:`size-3.5`}),`Ready`]}):X?pt:(0,V.jsx)(me,{size:`sm`,disabled:Z||Q||(q?!n?.setup?.canAuthenticate:!n?.setup?.canInstall),onClick:()=>{N?k(!0):ot()},children:Y||G?`Setting up...`:N?`Reconnect account`:`Continue with ChatGPT`}),secondaryControl:X&&!Je||Y?(0,V.jsx)(d,{size:`sm`,variant:`ghost-muted`,disabled:G||i,onClick:()=>{Ue.current=!1,K.current=null,w||X&&D?.flowId?it():L?.operationId&&$(()=>xe({environmentId:e,input:{instanceId:t,operationId:L.operationId}}))},children:`Cancel`}):!X&&!J&&N?(0,V.jsx)(d,{size:`sm`,variant:`ghost-muted`,disabled:Z||Q,onClick:()=>void ot(`chatgpt-change-account`),children:`Use a different account`}):!X&&!J&&l?(0,V.jsx)(d,{size:`sm`,variant:`ghost-muted`,disabled:i||Q,onClick:()=>a(`existing`),children:`Use existing CLI`}):null,children:[Oe?gt:ht(),r?(0,V.jsx)(`p`,{role:`alert`,className:`text-xs text-destructive`,children:r}):null]})]})}return(0,V.jsxs)(`section`,{"aria-label":`Codex setup`,className:`divide-y divide-border/50`,children:[_t,(0,V.jsx)(se,{title:`ChatGPT account`,description:dt,control:(0,V.jsx)(`div`,{className:`flex max-w-88 flex-wrap items-center justify-end gap-2`,children:X?(0,V.jsxs)(V.Fragment,{children:[pt,!Je&&(0,V.jsx)(d,{size:`sm`,variant:`ghost`,disabled:G||i,onClick:()=>{(w||D?.flowId)&&(Ue.current=!1,it(),m?.())},children:`Cancel`})]}):Y?(0,V.jsx)(d,{size:`sm`,variant:`ghost`,disabled:G||i,onClick:()=>{L?.operationId&&(K.current=null,$(()=>xe({environmentId:e,input:{instanceId:t,operationId:L.operationId}})))},children:`Cancel`}):J?(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(d,{size:`sm`,variant:`outline`,disabled:Z||Q,onClick:()=>k(!0),children:`Change account`}),(0,V.jsx)(d,{size:`sm`,variant:`ghost`,disabled:Z||Q,onClick:()=>void $(()=>ye(h)),children:`Disconnect`})]}):(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(me,{size:`sm`,disabled:Z||Q||(q?!n?.setup?.canAuthenticate:!n?.setup?.canInstall),onClick:()=>{N?k(!0):ot()},children:G?`Setting up...`:N?`Reconnect account`:`Continue with ChatGPT`}),N?(0,V.jsx)(d,{size:`sm`,variant:`ghost`,disabled:Z||Q,onClick:()=>void ot(`chatgpt-change-account`),children:`Use a different account`}):null,l?(0,V.jsx)(d,{size:`sm`,variant:`ghost`,disabled:i||Q,onClick:()=>a(`existing`),children:`Use existing CLI`}):null]})})}),J?(0,V.jsx)(`div`,{className:`flex justify-end px-3 py-1 sm:px-4`,children:(0,V.jsx)(oe,{})}):null,vt?(0,V.jsx)(`p`,{role:`alert`,className:`px-3 py-2 text-xs text-muted-foreground sm:px-4`,children:vt}):null,gt?(0,V.jsx)(`div`,{className:`px-3 py-3 sm:px-4`,children:gt}):null,Ve||_.error||ee.error||L?.phase===`failed`?(0,V.jsx)(`p`,{role:`alert`,className:`px-3 py-2 text-xs text-destructive sm:px-4`,children:Ve??(L?.phase===`failed`?L.message:`Could not read Codex setup status. Reconnect and try again.`)}):null]})}function G(e){let t=(0,B.c)(20),{environmentId:n,instanceId:r,provider:i}=e,a;t[0]!==n||t[1]!==r?(a=C.providerInstallState({environmentId:n,input:{instanceId:r}}),t[0]=n,t[1]=r,t[2]=a):a=t[2];let o=re(a),s=o.data?.executablePath??``,c=o.error?`Could not read runtime path`:`Not installed`,l;t[3]!==s||t[4]!==c?(l=(0,V.jsx)(se,{title:`Binary path`,description:`Selected by P4 Code.`,control:(0,V.jsx)(`div`,{className:`w-full sm:w-80`,children:(0,V.jsx)(ie,{"aria-label":`Codex binary path`,value:s,title:s,placeholder:c,disabled:!0})})}),t[3]=s,t[4]=c,t[5]=l):l=t[5];let u=i?.runtimePaths?.homePath??``,d=i?.runtimePaths?.homePath,f;t[6]!==u||t[7]!==d?(f=(0,V.jsx)(se,{title:`CODEX_HOME path`,description:`Shared Codex config, sessions, and state.`,control:(0,V.jsx)(`div`,{className:`w-full sm:w-80`,children:(0,V.jsx)(ie,{"aria-label":`Codex home path`,value:u,title:d,placeholder:`Unavailable`,disabled:!0})})}),t[6]=u,t[7]=d,t[8]=f):f=t[8];let p=i?.runtimePaths?.shadowHomePath?`Account-specific home sharing the Codex state above.`:`This instance uses the shared Codex home directly.`,m=i?.runtimePaths?.shadowHomePath??``,h=i?.runtimePaths?.shadowHomePath??void 0,g=i?.runtimePaths?`Not used`:`Unavailable`,_;t[9]!==g||t[10]!==m||t[11]!==h?(_=(0,V.jsx)(`div`,{className:`w-full sm:w-80`,children:(0,V.jsx)(ie,{"aria-label":`Codex shadow home path`,value:m,title:h,placeholder:g,disabled:!0})}),t[9]=g,t[10]=m,t[11]=h,t[12]=_):_=t[12];let v;t[13]!==_||t[14]!==p?(v=(0,V.jsx)(se,{title:`Shadow home path`,description:p,control:_}),t[13]=_,t[14]=p,t[15]=v):v=t[15];let y;return t[16]!==v||t[17]!==l||t[18]!==f?(y=(0,V.jsxs)(V.Fragment,{children:[l,f,v]}),t[16]=v,t[17]=l,t[18]=f,t[19]=y):y=t[19],y}function Fe(e){let t=(0,B.c)(10),{label:n,expanded:r,controls:i,onToggle:a}=e,o=n===void 0?`Complete sign-in in your browser.`:n,s=r!==void 0&&r;if(!a){let e;return t[0]===o?e=t[1]:(e=(0,V.jsx)(`div`,{className:`leading-relaxed`,children:o}),t[0]=o,t[1]=e),e}let c=`size-3 shrink-0 ${s?`rotate-90`:``}`,l;t[2]===c?l=t[3]:(l=(0,V.jsx)(_,{"aria-hidden":!0,className:c}),t[2]=c,t[3]=l);let u;return t[4]!==i||t[5]!==s||t[6]!==o||t[7]!==a||t[8]!==l?(u=(0,V.jsxs)(`button`,{type:`button`,className:`inline-flex items-center gap-1.5 rounded-sm text-left leading-relaxed outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring`,"aria-label":`Having trouble signing in?`,"aria-expanded":s,"aria-controls":i,onClick:a,children:[o,l]}),t[4]=i,t[5]=s,t[6]=o,t[7]=a,t[8]=l,t[9]=u):u=t[9],u}function Ie(e){let t=(0,B.c)(21),{title:n,description:r,control:i,secondaryControl:a,children:o}=e,s;t[0]===o?s=t[1]:(s=z.Children.toArray(o),t[0]=o,t[1]=s);let c=s,l;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,V.jsx)(N,{className:`size-5 shrink-0 fill-foreground`}),t[2]=l):l=t[2];let u;t[3]===n?u=t[4]:(u=(0,V.jsx)(`h3`,{className:`text-sm font-medium`,children:n}),t[3]=n,t[4]=u);let d;t[5]===r?d=t[6]:(d=(0,V.jsx)(`div`,{className:`mt-0.5 text-xs leading-relaxed text-muted-foreground`,children:r}),t[5]=r,t[6]=d);let f;t[7]!==u||t[8]!==d?(f=(0,V.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[u,d]}),t[7]=u,t[8]=d,t[9]=f):f=t[9];let p;t[10]!==i||t[11]!==a?(p=i||a?(0,V.jsxs)(`div`,{className:`flex shrink-0 flex-wrap items-center justify-end gap-2 has-[button]:w-full has-[button]:flex-col-reverse has-[button]:items-end sm:has-[button]:w-auto sm:has-[button]:flex-row sm:has-[button]:items-center`,children:[a,i]}):null,t[10]=i,t[11]=a,t[12]=p):p=t[12];let m;t[13]!==f||t[14]!==p?(m=(0,V.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3`,children:[l,f,p]}),t[13]=f,t[14]=p,t[15]=m):m=t[15];let h;t[16]===c?h=t[17]:(h=c.length>0?(0,V.jsx)(`div`,{className:`ml-8 mt-2 flex flex-wrap items-center gap-2`,children:c}):null,t[16]=c,t[17]=h);let g;return t[18]!==m||t[19]!==h?(g=(0,V.jsxs)(`div`,{className:`rounded-lg border border-border bg-background px-4 py-4`,children:[m,h]}),t[18]=m,t[19]=h,t[20]=g):g=t[20],g}function Le(e){return typeof e==`object`&&e&&`setupMode`in e&&e.setupMode===`managed`?`managed`:`existing`}export{De as a,Oe as c,Ee as d,U as f,Me as i,Ce as l,Ne as n,W as o,me as p,G as r,Ae as s,Le as t,Te as u};
2
+ //# sourceMappingURL=CodexSetupSection.logic-BIpypa3y.js.map
@@ -1,2 +1,2 @@
1
- import{a as e,t}from"./react-BUfh6y28.js";import{t as n}from"./jsx-runtime-DJeoFXNw.js";import{$a as r,Aa as i,An as a,Ao as o,Ar as s,Ba as c,Bn as l,Ca as ee,Di as u,Dn as d,Dr as f,Ea as te,Ei as p,En as m,Eo as h,Fa as ne,Fi as g,Fn as _,Fr as v,Gi as y,Ha as b,Hn as re,Ia as x,Ii as ie,In as ae,Ja as S,La as C,Ln as w,Lr as oe,Ma as T,Mi as E,Mo as se,Mr as D,Nn as O,No as k,Nr as ce,Oo as A,Or as j,Pa as M,Pi as le,Pn as ue,Pr as N,Ra as P,Rn as de,Rr as fe,So as pe,Ta as me,To as he,Tr as ge,Ua as F,Un as _e,Vi as I,Vn as ve,Vr as ye,Wn as be,Xa as xe,Ya as Se,_i as Ce,ao as we,bo as Te,ca as L,co as Ee,do as De,fi as Oe,ga as ke,ha as Ae,io as je,ja as Me,jn as Ne,jo as Pe,ko as Fe,la as Ie,oa as Le,oi as Re,sa as ze,si as Be,so as Ve,uo as He,wn as Ue,wo as We,xa as Ge,xo as Ke,xr as qe,ya as Je,zn as Ye}from"./utils-C5GGWTfe.js";import{t as Xe}from"./useRegisterFieldControl-D4FG4i3_.js";import{t as Ze}from"./FormContext-DcnLkh-4.js";var R=e(t()),Qe=R.createContext(void 0),$e=R.createContext(void 0),et=R.createContext(void 0),tt=R.createContext(``);function z(){let e=R.useContext(Qe);if(!e)throw Error(k(22));return e}function nt(){let e=R.useContext($e);if(!e)throw Error(k(23));return e}function rt(){let e=R.useContext(et);if(!e)throw Error(k(24));return e}function it(){return R.useContext(tt)}var B={id:E(e=>e.id),labelId:E(e=>e.labelId),items:E(e=>e.items),selectedValue:E(e=>e.selectedValue),hasSelectionChips:E(e=>{let t=e.selectedValue;return Array.isArray(t)&&t.length>0}),hasSelectedValue:E(e=>{let{selectedValue:t,selectionMode:n}=e;return t==null?!1:n===`multiple`&&Array.isArray(t)?t.length>0:!0}),hasNullItemLabel:E((e,t)=>t?m(e.items):!1),open:E(e=>e.open),mounted:E(e=>e.mounted),forceMounted:E(e=>e.forceMounted),inline:E(e=>e.inline),activeIndex:E(e=>e.activeIndex),selectedIndex:E(e=>e.selectedIndex),isActive:E((e,t)=>e.activeIndex===t),isSelected:E((e,t)=>{let n=e.isItemEqualToValue,r=e.selectedValue;return Array.isArray(r)?r.some(e=>O(t,e,n)):O(t,r,n)}),transitionStatus:E(e=>e.transitionStatus),popupProps:E(e=>e.popupProps),inputProps:E(e=>e.inputProps),triggerProps:E(e=>e.triggerProps),itemProps:E(e=>e.itemProps),positionerElement:E(e=>e.positionerElement),listElement:E(e=>e.listElement),triggerElement:E(e=>e.triggerElement),inputElement:E(e=>e.inputElement),inputGroupElement:E(e=>e.inputGroupElement),popupSide:E(e=>e.popupSide),openMethod:E(e=>e.openMethod),inputInsidePopup:E(e=>e.inputInsidePopup),inputOwnsFormValue:E(e=>e.inputOwnsFormValue),selectionMode:E(e=>e.selectionMode),name:E(e=>e.name),form:E(e=>e.form),disabled:E(e=>e.disabled),readOnly:E(e=>e.readOnly),required:E(e=>e.required),grid:E(e=>e.grid),virtualized:E(e=>e.virtualized),itemToStringLabel:E(e=>e.itemToStringLabel),isItemEqualToValue:E(e=>e.isItemEqualToValue),modal:E(e=>e.modal),autoHighlight:E(e=>e.autoHighlight),submitOnItemClick:E(e=>e.submitOnItemClick)};function at(e,t){return(n,r)=>{if(n==null)return!1;let i=a(n,t);return e.contains(i,r)}}function ot(e,t,n){return(r,i)=>{if(r==null)return!1;if(!i)return!0;let o=a(r,t),s=n==null?``:a(n,t);return s&&e.contains(s,i)&&s.length===i.length?!0:e.contains(o,i)}}var V=new Map;function st(e={}){let t={usage:`search`,sensitivity:`base`,ignorePunctuation:!0,...e},n=`${ct(e.locale)}|${JSON.stringify(t)}`,r=V.get(n);if(r)return r;let i=new Intl.Collator(e.locale,t),o={contains(e,t,n){if(!t)return!0;let r=a(e,n);for(let e=0;e<=r.length-t.length;e+=1)if(i.compare(r.slice(e,e+t.length),t)===0)return!0;return!1},startsWith(e,t,n){if(!t)return!0;let r=a(e,n);return i.compare(r.slice(0,t.length),t)===0},endsWith(e,t,n){if(!t)return!0;let r=a(e,n),o=t.length;return r.length>=o&&i.compare(r.slice(r.length-o),t)===0}};return V.set(n,o),o}function ct(e){return Array.isArray(e)?e.map(e=>ct(e)).join(`,`):e==null?``:String(e)}var lt=st;function ut(e={}){let{multiple:t=!1,value:n,...r}=e,i=st(r),a=R.useCallback((e,r,a)=>t?at(i,a)(e,r):ot(i,a,n)(e,r),[i,n,t]);return R.useMemo(()=>({contains:a,startsWith:i.startsWith,endsWith:i.endsWith}),[a,i])}var dt=Symbol(`none`),ft={value:dt,index:-1},H=e(n());function pt(e){let{id:t,onOpenChangeComplete:n,defaultSelectedValue:r=null,selectedValue:s,onSelectedValueChange:c,defaultInputValue:l,inputValue:m,open:ne,defaultOpen:v=!1,selectionMode:y=`none`,onItemHighlighted:x,name:ie,form:C,disabled:T=!1,readOnly:E=!1,required:D=!1,inputRef:k,grid:ce=!1,items:M,filteredItems:N,filter:P,openOnInputClick:fe=!0,autoHighlight:pe=!1,keepHighlight:me=!1,highlightItemOnHover:he=!0,loopFocus:_e=!0,itemToStringLabel:I,itemToStringValue:ve,isItemEqualToValue:ye=ue,virtualized:be=!1,inline:xe=!1,fillInputOnItemPress:Se=!0,modal:Te=!1,limit:L=-1,autoComplete:je=`list`,formAutoComplete:Re,locale:He,submitOnItemClick:Ue=!1}=e,{clearErrors:We}=Ze(),{setDirty:Ge,validityData:Ke,shouldValidateOnChange:qe,setFilled:Je,name:Ye,disabled:z,setTouched:nt,setFocused:rt,validationMode:it,validation:V}=re(),st=oe(),ct=de({id:t}),ut=lt({locale:He}),[pt,mt]=R.useState(!1),[ht,gt]=R.useState(null),_t=R.useRef([]),vt=R.useRef([]),yt=R.useRef(null),U=R.useRef(null),bt=R.useRef(null),xt=R.useRef(null),St=R.useRef(null),Ct=R.useRef(!0),wt=R.useRef(!1),Tt=R.useRef(null),Et=R.useRef(null),Dt=R.useRef(null),W=R.useRef(ft),Ot=R.useRef(null),kt=R.useRef([]),At=R.useRef([]),jt=z||T,Mt=Ye??ie,G=y===`multiple`,K=y===`single`,Nt=m!==void 0||l!==void 0,Pt=M!==void 0,Ft=N!==void 0,q;q=pe===`always`?`always`:pe?`input-change`:!1;let[J,It]=S({controlled:s,default:G?r??A:r,name:`Combobox`,state:`selectedValue`}),Lt=R.useMemo(()=>P===null?()=>!0:P===void 0?K&&!pt?ot(ut,I,J):at(ut,I):P,[P,K,J,pt,ut,I]),Rt=se(()=>Nt?l??``:K?a(J,I):``).current,[Y,zt]=S({controlled:m,default:Rt,name:`Combobox`,state:`inputValue`}),[X,Bt]=S({controlled:ne,default:v,name:`Combobox`,state:`open`}),Vt=d(M),Z=ht??(Y===``?``:String(Y).trim()),Ht=K?a(J,I):``,Ut=K&&!pt&&Z!==``&&Ht!==``&&Ht.length===Z.length&&ut.contains(Ht,Z),Wt=Ut?``:Z,Gt=Pt&&Ft&&Ut,Kt=R.useMemo(()=>M?Vt?M.flatMap(e=>e.items):M:A,[M,Vt]),qt=R.useMemo(()=>{if(N&&!Gt)return N;if(!M)return A;if(Vt){let e=M,t=[],n=0;for(let r of e){if(L>-1&&n>=L)break;let e=Wt===``?r.items:r.items.filter(e=>Lt(e,Wt,I));if(e.length===0)continue;let i=L>-1?L-n:1/0,a=e.slice(0,i);if(a.length>0){let e={...r,items:a};t.push(e),n+=a.length}}return t}if(Wt===``)return L>-1?Kt.slice(0,L):Kt;let e=[];for(let t of Kt){if(L>-1&&e.length>=L)break;Lt(t,Wt,I)&&e.push(t)}return e},[N,Gt,M,Vt,Wt,L,Lt,I,Kt]),Jt=R.useMemo(()=>Vt?qt.flatMap(e=>e.items):qt,[qt,Vt]),Q=se(()=>new p({id:ct,labelId:void 0,selectedValue:J,open:X,filter:Lt,query:Z,items:M,selectionMode:y,listRef:_t,labelsRef:vt,popupRef:yt,emptyRef:St,inputRef:U,startDismissRef:bt,endDismissRef:xt,keyboardActiveRef:Ct,chipsContainerRef:Tt,clearRef:Et,valuesRef:kt,allValuesRef:At,selectionEventRef:Dt,name:Mt,form:C,disabled:jt,readOnly:E,required:D,grid:ce,isGrouped:Vt,virtualized:be,openOnInputClick:fe,itemToStringLabel:I,isItemEqualToValue:ye,modal:Te,autoHighlight:q,submitOnItemClick:Ue,hasInputValue:Nt,mounted:!1,forceMounted:!1,transitionStatus:`idle`,inline:xe,activeIndex:null,selectedIndex:null,popupProps:{},inputProps:{},triggerProps:{},itemProps:Fe,positionerElement:null,listElement:null,triggerElement:null,inputElement:null,inputGroupElement:null,popupSide:null,openMethod:null,inputInsidePopup:!0,inputOwnsFormValue:y===`none`,onOpenChangeComplete:n||o,setOpen:o,setInputValue:o,setSelectedValue:o,setIndices:o,onItemHighlighted:o,handleSelection:o,forceMount:o,requestSubmit:o})).current,Yt=y===`none`?Y:J,Xt=R.useMemo(()=>y===`none`?Yt:Array.isArray(J)?J.map(e=>Ne(e,ve)):Ne(J,ve),[Yt,ve,y,J]),Zt=F(x),Qt=F(n),$t=u(Q,B.activeIndex),en=u(Q,B.selectedIndex),tn=u(Q,B.positionerElement),nn=u(Q,B.listElement),rn=u(Q,B.triggerElement),an=u(Q,B.inputElement),on=u(Q,B.inputGroupElement),$=u(Q,B.inline),sn=u(Q,B.inputInsidePopup),cn=u(Q,B.inputOwnsFormValue),ln=Ie(rn),{mounted:un,setMounted:dn,transitionStatus:fn}=te(X),{openMethod:pn,triggerProps:mn}=ge(X),hn=F(()=>Xt);Xe(sn?ln:U,ct,Yt,hn);let gn=F(()=>{M?vt.current=Jt.map(e=>a(e,I)):Q.set(`forceMounted`,!0)}),_n=R.useRef(J);b(()=>{J!==_n.current&&gn()},[gn,J]);let vn=F(e=>{Q.update(e);let t=e.type||`none`;if(e.activeIndex!==void 0){if(e.activeIndex===null)W.current!==ft&&(W.current=ft,Zt(void 0,Me(t,void 0,{index:-1})));else{let n=kt.current[e.activeIndex];W.current={value:n,index:e.activeIndex},Zt(n,Me(t,void 0,{index:e.activeIndex}))}}}),yn=F((t,n)=>{if(wt.current=n.reason===we,e.onInputValueChange?.(t,n),!n.isCanceled){if(n.reason===`input-change`){let e=n.event,r=e.inputType;if(e.type===`compositionend`||r!=null&&r!==``&&r!==`insertReplacementText`){let e=t.trim()!==``;e&&mt(!0),Ot.current={hasQuery:e},e&&q&&Q.state.activeIndex==null&&Q.set(`activeIndex`,0)}}zt(t)}}),bn=F((t,n)=>{if(X!==t&&(n.reason===`escape-key`&&Pt&&Jt.length===0&&!Q.state.emptyRef.current&&n.allowPropagation(),e.onOpenChange?.(t,n),!n.isCanceled&&(t&&G&&sn&&!$&&ht!==null&&(mt(!1),gt(null),Y!==``&&yn(``,i(we,n.event))),!t&&pt&&(K?($||gt(Z),Z===``&&mt(!1)):G&&($||gt(Z),sn&&vn({activeIndex:null}),(!sn||$)&&yn(``,i(we,n.event)))),Bt(t),!t&&sn&&(n.reason===`focus-out`||n.reason===`outside-press`)&&(nt(!0),rt(!1),it===`onBlur`)))){let e=y===`none`?Y:J;V.commit(e)}}),xn=F((e,t)=>{c?.(e,t),!t.isCanceled&&(It(e),(y===`none`&&yt.current&&Se||K&&!Q.state.inputInsidePopup)&&yn(a(e,I),i(t.reason,t.event)),K&&e!=null&&t.reason!==`input-change`&&pt&&!$&&gt(Z))}),Sn=F((e,t)=>{let n=t;if(n===void 0){if($t===null)return;n=kt.current[$t]}let r=ke(e),a=Dt.current??e;Dt.current=null;let o=i(Ee,a),s=r?.closest(`a`)?.getAttribute(`href`);if(s)s.startsWith(`#`)&&bn(!1,o);else if(G){let e=Array.isArray(J)?J:[],t=w(e,n,Q.state.isItemEqualToValue)?ae(e,n,Q.state.isItemEqualToValue):[...e,n];if(xn(t,o),!(U.current&&U.current.value.trim()!==``))return;Q.state.inputInsidePopup?yn(``,i(we,o.event)):bn(!1,o)}else xn(n,o),bn(!1,o)}),Cn=F(()=>{if(!Q.state.submitOnItemClick)return;let e=V.inputRef.current?.form??Q.state.inputElement?.form;e&&typeof e.requestSubmit==`function`&&e.requestSubmit()}),wn=F(()=>{if(dn(!1),Qt?.(!1),mt(!1),gt(null),vn(y===`none`?{activeIndex:null,selectedIndex:null}:{activeIndex:null}),G&&U.current&&U.current.value!==``&&!wt.current&&yn(``,i(we)),K){if(Q.state.inputInsidePopup)U.current&&U.current.value!==``&&yn(``,i(we));else{let e=a(J,I);U.current&&U.current.value!==e&&yn(e,i(e===``?we:De))}}}),Tn=R.useMemo(()=>$&&tn?{current:tn.closest(`[role="dialog"]`)}:yt,[$,tn]);ee({enabled:!e.actionsRef,open:X,ref:Tn,onComplete(){X||wn()}}),R.useImperativeHandle(e.actionsRef,()=>({unmount:wn}),[wn]),b(function(){if(X||y===`none`)return;let e=M?Kt:At.current;if(G){let t=Array.isArray(J)?J:[],n=t[t.length-1],r=_(e,n,ye);vn({selectedIndex:r===-1?null:r})}else{let t=_(e,J,ye);vn({selectedIndex:t===-1?null:t})}},[X,J,M,y,Kt,G,ye,vn]),b(()=>{M&&(kt.current=Jt,_t.current.length=Jt.length)},[M,Jt]),b(()=>{let e=Ot.current;if(e&&(e.hasQuery?q&&Q.set(`activeIndex`,0):q===`always`&&Q.set(`activeIndex`,0),Ot.current=null),!X&&!$)return;let t=Pt||Ft?Jt:kt.current,n=Q.state.activeIndex;if(n==null){if(q===`always`&&t.length>0){Q.set(`activeIndex`,0);return}W.current!==ft&&(W.current=ft,Q.state.onItemHighlighted(void 0,Me(De,void 0,{index:-1})));return}if(n>=t.length){W.current!==ft&&(W.current=ft,Q.state.onItemHighlighted(void 0,Me(De,void 0,{index:-1}))),Q.set(`activeIndex`,null);return}let r=t[n],i=W.current.value,a=i!==dt&&O(r,i,Q.state.isItemEqualToValue);W.current.index===n&&a||(W.current={value:r,index:n},Q.state.onItemHighlighted(r,Me(De,void 0,{index:n})))},[$t,q,Ft,Pt,Jt,$,X,Q]),b(()=>{Je(y===`none`?String(Y)!==``:G?Array.isArray(J)&&J.length>0:J!=null)},[Je,y,Y,J,G]),R.useEffect(()=>{Pt&&q&&Jt.length===0&&vn({activeIndex:null})},[Pt,q,Jt.length,vn]),f(Z,()=>{X&&Z!==``&&Z!==String(Rt)&&mt(!0)}),f(J,()=>{if(y!==`none`&&(We(Mt),Ge(J!==Ke.initialValue),qe()?V.commit(J):V.commit(J,!0),K&&!Nt&&!sn)){let e=a(J,I);Y!==e&&yn(e,i(De))}}),f(Y,()=>{y===`none`&&(We(Mt),Ge(Y!==Ke.initialValue),qe()?V.commit(Y):V.commit(Y,!0))}),f(M,()=>{if(!K||Nt||sn||pt)return;let e=a(J,I);Y!==e&&yn(e,i(De))});let En=Oe({open:$?!0:X,onOpenChange:bn,elements:{reference:sn?rn:an,floating:tn}}),Dn,On;$||(Dn=ce?`grid`:`listbox`,On=X?`true`:`false`);let kn=R.useMemo(()=>{let e=an?.tagName===`INPUT`,t=an==null||e,n=t||X,r=t?{autoComplete:`off`,spellCheck:`false`,autoCorrect:`off`,autoCapitalize:`none`}:{};return n&&(r.role=`combobox`,r[`aria-expanded`]=On,r[`aria-haspopup`]=Dn,r[`aria-controls`]=X?nn?.id:void 0,r[`aria-autocomplete`]=je),{reference:r,floating:{role:`presentation`}}},[an,X,On,Dn,nn?.id,je]),An=g(En,{enabled:!E&&!jt&&fe,event:`mousedown-only`,toggle:!1,touchOpenDelay:sn?0:100,reason:Ve}),jn=le(En,{enabled:!E&&!jt&&!$,outsidePressEvent:{mouse:`sloppy`,touch:`intentional`},bubbles:$?!0:void 0,outsidePress(e){let t=ke(e);return!Ae(rn,t)&&!Ae(Et.current,t)&&!Ae(Tt.current,t)&&!Ae(on,t)}}),Mn=Be(En,{enabled:!E&&!jt,id:ct,listRef:_t,activeIndex:$t,selectedIndex:en,virtual:!0,loopFocus:_e,allowEscape:_e&&!q,focusItemOnOpen:pt||y===`none`&&!q?!1:`auto`,focusItemOnHover:he,resetOnPointerLeave:!me,cols:ce?2:1,orientation:ce?`horizontal`:void 0,rtl:st===`rtl`,disabledIndices:A,onNavigate(e,t){(t||X)&&fn!==`ending`&&vn(t?{activeIndex:e,type:Ct.current?`keyboard`:`pointer`}:{activeIndex:e})}}),Nn=R.useMemo(()=>h(Mn.reference,jn.reference,An.reference,kn.reference),[Mn.reference,jn.reference,An.reference,kn.reference]),Pn=R.useMemo(()=>h(Ce,Mn.floating,jn.floating,kn.floating),[Mn.floating,jn.floating,kn.floating]),Fn=R.useMemo(()=>{let e=Mn.item;return e?{...e,onFocus:void 0}:Fe},[Mn.item]);j(()=>{Q.update({inline:xe,popupProps:Pn,inputProps:Nn,triggerProps:mn,itemProps:Fn,setOpen:bn,setInputValue:yn,setSelectedValue:xn,setIndices:vn,onItemHighlighted:Zt,handleSelection:Sn,forceMount:gn,requestSubmit:Cn})}),b(()=>{Q.update({id:ct,selectedValue:J,open:X,mounted:un,transitionStatus:fn,items:M,inline:xe,popupProps:Pn,inputProps:Nn,triggerProps:mn,openMethod:pn,itemProps:Fn,selectionMode:y,name:Mt,form:C,disabled:jt,readOnly:E,required:D,grid:ce,isGrouped:Vt,virtualized:be,onOpenChangeComplete:Qt,openOnInputClick:fe,itemToStringLabel:I,modal:Te,autoHighlight:q,isItemEqualToValue:ye,submitOnItemClick:Ue,hasInputValue:Nt,requestSubmit:Cn,inputOwnsFormValue:y===`none`&&(xe||!Q.state.inputInsidePopup)})},[Q,ct,J,X,un,fn,M,Pn,Nn,Fn,pn,mn,y,Mt,jt,E,D,V,ce,Vt,be,Qt,fe,I,Te,ye,Ue,Nt,xe,Cn,q,C]);let In=Pe(k,V.inputRef),Ln=R.useMemo(()=>({query:Z,hasItems:Pt,filteredItems:qt,flatFilteredItems:Jt}),[Z,Pt,qt,Jt]),Rn=R.useMemo(()=>Array.isArray(Yt)?``:Ne(Yt,ve),[Yt,ve]),zn=G&&Array.isArray(J)&&J.length>0,Bn=G||y===`none`&&cn?void 0:Mt,Vn=R.useMemo(()=>!G||!Array.isArray(J)||!Mt?null:J.map(e=>{let t=Ne(e,ve);return(0,H.jsx)(`input`,{type:`hidden`,form:C,name:Mt,value:t},t)}),[G,J,C,Mt,ve]),Hn=(0,H.jsxs)(R.Fragment,{children:[e.children,(0,H.jsx)(`input`,{...V.getInputValidationProps({onFocus(){sn?rn?.focus():(U.current||rn)?.focus()},onChange(e){if(e.nativeEvent.defaultPrevented||jt||E){e.preventBaseUIHandler?.();return}let t=e.currentTarget.value,n=i(De,e.nativeEvent);function r(){if(G)return;if(y===`none`){Ge(t!==Ke.initialValue),yn(t,n),qe()&&V.commit(t);return}let e=kt.current.find(e=>Ne(e,ve).toLowerCase()===t.toLowerCase()||a(e,I).toLowerCase()===t.toLowerCase());e!=null&&(Ge(e!==Ke.initialValue),xn?.(e,n),qe()&&V.commit(e))}M?r():(gn(),queueMicrotask(r))}}),id:ct&&Bn==null?`${ct}-hidden-input`:void 0,form:C,name:Bn,autoComplete:Re,disabled:jt,required:D&&!zn,readOnly:E,value:Rn,ref:In,style:Bn?ze:Le,tabIndex:-1,"aria-hidden":!0,suppressHydrationWarning:!0}),Vn]});return(0,H.jsx)(Qe.Provider,{value:Q,children:(0,H.jsx)($e.Provider,{value:En,children:(0,H.jsx)(et.Provider,{value:Ln,children:(0,H.jsx)(tt.Provider,{value:Y,children:Hn})})})})}var mt={...Ke,...be,popupSide:e=>e?{"data-popup-side":e}:null,listEmpty:e=>e?{"data-list-empty":``}:null},ht=R.createContext(void 0);function gt(){return R.useContext(ht)}var _t=R.createContext(void 0);function vt(e){let t=R.useContext(_t);if(t===void 0&&!e)throw Error(k(21));return t}var yt=R.forwardRef(function(e,t){let n=z(),{buttonRef:r,getButtonProps:a}=c({native:!1}),o=Pe(t,r);function s(e){n.state.setOpen(!1,i(xe,e.nativeEvent,e.currentTarget))}let l=a({onClick:s});return(0,H.jsx)(`span`,{ref:o,...l,"aria-label":`Dismiss`,tabIndex:void 0,style:ze})}),U=R.forwardRef(function(e,t){let{render:n,className:a,disabled:o=!1,id:s,style:c,...ee}=e,{state:d,disabled:f,setTouched:te,setFocused:p,validationMode:m,validation:h}=re(),{labelId:ne}=Ye(),g=gt(),_=!!vt(!0),v=z(),{filteredItems:y}=rt(),b=it(),ie=oe(),ae=u(v,B.required),S=u(v,B.disabled),w=u(v,B.readOnly),E=u(v,B.name),se=u(v,B.form),D=u(v,B.selectionMode),O=u(v,B.autoHighlight),k=u(v,B.inputProps),ce=u(v,B.triggerProps),A=u(v,B.open),j=u(v,B.mounted),M=u(v,B.selectedValue),le=u(v,B.popupSide),ue=u(v,B.positionerElement),N=u(v,B.id),P=u(v,B.inline),de=u(v,B.modal),fe=!!O,pe=j&&ue?le:null,me=f||S||o,ge=y.length===0,I=_||P,ye=!I||de,be=T(s??(I?void 0:N)),xe=Ue(ne,void 0),Se=_?_e:d,[Ce,Te]=R.useState(null),L=R.useRef(!1),Ee=R.useRef(null),Oe=R.useRef(!1),ke=D===`none`&&!_,Ae=F(e=>{let t=_||v.state.inline;t&&!v.state.hasInputValue&&v.state.setInputValue(``,i(De)),v.update({inputElement:e,inputInsidePopup:t,inputOwnsFormValue:ke})}),Me=_||!h?ee:h.getValidationProps(ee),Ne={...Se,open:A,disabled:me,readOnly:w,popupSide:pe,listEmpty:ge};function Pe(e){if(!g)return;let t,{highlightedChipIndex:n}=g,r=g.chipsRef.current.length,i=ie===`rtl`,a=i?`ArrowRight`:`ArrowLeft`,o=i?`ArrowLeft`:`ArrowRight`;if(n!==void 0){if(e.key===a)e.preventDefault(),t=n>0?n-1:void 0;else if(e.key===o)e.preventDefault(),t=n<r-1?n+1:void 0;else if(e.key===`Backspace`||e.key===`Delete`){e.preventDefault();let r=n>=M.length-1?M.length-2:n;t=r>=0?r:void 0,v.state.setIndices({activeIndex:null,selectedIndex:null,type:`keyboard`})}return t}return e.key===a&&(e.currentTarget.selectionStart??0)===0&&M.length>0?(e.preventDefault(),t=r>0?r-1:void 0):e.key===`Backspace`&&e.currentTarget.value===``&&M.length>0&&(v.state.setIndices({activeIndex:null,selectedIndex:null,type:`keyboard`}),e.preventDefault()),t}let Fe=he(`input`,e,{state:Ne,ref:[t,v.state.inputRef,Ae],props:[k,ce,{type:`text`,value:e.value??Ce??b,"aria-readonly":w||void 0,"aria-required":ae||void 0,"aria-labelledby":xe,disabled:me,readOnly:w,required:D===`none`?ae:void 0,form:se,...ke&&E&&{name:E},id:be,onFocus(){if(p(!0),!P||!Oe.current)return;Oe.current=!1;let e=Ee.current;e!=null&&Object.hasOwn(v.state.valuesRef.current,e)&&v.state.setIndices({activeIndex:e})},onBlur(){te(!0),p(!1);let e=v.state.activeIndex;if(P&&e!==null&&O!==`always`&&(Ee.current=e,Oe.current=!0,v.state.setIndices({activeIndex:null})),m===`onBlur`){let e=D===`none`?b:M;h.commit(e)}},onCompositionStart(e){x||(L.current=!0,Te(e.currentTarget.value))},onCompositionEnd(e){L.current=!1;let t=e.currentTarget.value;Te(null),v.state.setInputValue(t,i(je,e.nativeEvent))},onChange(e){let t=e.nativeEvent.inputType,n=!t||t===`insertReplacementText`,r=L.current||!n;if(L.current){let t=e.currentTarget.value;Te(t),t===``&&!v.state.openOnInputClick&&!v.state.inputInsidePopup&&v.state.setOpen(!1,i(we,e.nativeEvent));let n=t.trim(),a=fe&&n!==``;!w&&!me&&n&&r&&(v.state.setOpen(!0,i(je,e.nativeEvent)),fe||v.state.setIndices({activeIndex:null,selectedIndex:null,type:v.state.keyboardActiveRef.current?`keyboard`:`pointer`})),A&&v.state.activeIndex!==null&&!a&&v.state.setIndices({activeIndex:null,selectedIndex:null,type:v.state.keyboardActiveRef.current?`keyboard`:`pointer`});return}v.state.setInputValue(e.currentTarget.value,i(je,e.nativeEvent));let a=e.currentTarget.value===``,o=i(we,e.nativeEvent);a&&!v.state.inputInsidePopup&&(D===`single`&&v.state.setSelectedValue(null,o),v.state.openOnInputClick||v.state.setOpen(!1,o));let s=e.currentTarget.value.trim();!w&&!me&&s&&r&&(v.state.setOpen(!0,i(je,e.nativeEvent)),fe||v.state.setIndices({activeIndex:null,selectedIndex:null,type:v.state.keyboardActiveRef.current?`keyboard`:`pointer`})),A&&v.state.activeIndex!==null&&!fe&&v.state.setIndices({activeIndex:null,selectedIndex:null,type:v.state.keyboardActiveRef.current?`keyboard`:`pointer`})},onKeyDown(e){if(me||w||e.ctrlKey||e.shiftKey||e.altKey||e.metaKey)return;v.state.keyboardActiveRef.current=!0;let t=e.currentTarget,n=t.scrollWidth-t.clientWidth,a=ie===`rtl`;if(e.key===`Home`){Je(e);let n=C&&a?t.value.length:0;t.setSelectionRange(n,n),t.scrollLeft=0;return}if(e.key===`End`){Je(e);let r=C&&a?0:t.value.length;t.setSelectionRange(r,r),t.scrollLeft=a?-n:n;return}if(!j&&e.key===`Escape`){let t=D===`multiple`&&Array.isArray(M)?M.length===0:M===null,n=i(r,e.nativeEvent),a=D===`multiple`?[]:null;v.state.setInputValue(``,n),v.state.setSelectedValue(a,n),t||v.state.inline||n.isPropagationAllowed||e.stopPropagation();return}if(g&&e.key===`Backspace`&&t.value===``&&g.highlightedChipIndex===void 0&&Array.isArray(M)&&M.length>0){let t=g.chipsRef.current.length,n=t>0?t-1:M.length-1,r=M.filter((e,t)=>t!==n);v.state.setIndices({activeIndex:null,selectedIndex:null,type:v.state.keyboardActiveRef.current?`keyboard`:`pointer`}),v.state.setSelectedValue(r,i(De,e.nativeEvent));return}let o=g?.highlightedChipIndex!==void 0,s=Pe(e);if(g?.setHighlightedChipIndex(s),s===void 0?o&&v.state.inputRef.current?.focus():g?.chipsRef.current[s]?.focus(),e.which!==229&&e.key===`Enter`&&A){let t=v.state.activeIndex,n=e.nativeEvent;if(t===null){if(P)return;v.state.setOpen(!1,i(De,n));return}Je(e);let r=v.state.listRef.current[t];r&&(v.state.selectionEventRef.current=n,r.click(),v.state.selectionEventRef.current=null)}},onPointerMove(){v.state.keyboardActiveRef.current=!1},onPointerDown(){v.state.keyboardActiveRef.current=!1}},Me],stateAttributesMapping:mt}),Ie=_?(0,H.jsx)(ve.Provider,{value:l,children:Fe}):Fe;return(0,H.jsxs)(R.Fragment,{children:[A&&ye&&(0,H.jsx)(yt,{ref:v.state.startDismissRef}),Ie]})}),bt=2,xt=R.forwardRef(function(e,t){let{render:n,className:r,nativeButton:a=!0,disabled:o=!1,id:s,style:l,...ee}=e,{state:d,disabled:f,setTouched:te,setFocused:p,validationMode:m,validation:h}=re(),{labelId:ne}=Ye(),_=z(),{filteredItems:v}=rt(),y=u(_,B.selectionMode),b=u(_,B.disabled),x=u(_,B.readOnly),ie=u(_,B.required),ae=u(_,B.mounted),S=u(_,B.popupSide),C=u(_,B.positionerElement),w=u(_,B.listElement),oe=u(_,B.triggerProps),T=u(_,B.triggerElement),E=u(_,B.inputInsidePopup),se=u(_,B.id),D=u(_,B.labelId),O=u(_,B.open),k=u(_,B.selectedValue),ce=u(_,B.activeIndex),A=u(_,B.selectedIndex),j=u(_,B.hasSelectedValue),M=nt(),le=it(),ue=Ge(),N=f||b||o,P=v.length===0,fe=ae&&C?S:null;de({id:E?s:void 0});let pe=E?s??se:s,me=Ue(ne,D),ge=R.useRef(``);function _e(e){ge.current=e.pointerType}let I=M.useState(`domReferenceElement`);R.useEffect(()=>{E&&T&&T!==I&&M.set(`domReferenceElement`,T)},[T,I,M,E]);let{reference:ve}=Re(M,{enabled:!O&&!x&&!b&&y===`single`,listRef:_.state.labelsRef,activeIndex:ce,selectedIndex:A,onMatch(e){let t=_.state.valuesRef.current[e];t!==void 0&&_.state.setSelectedValue(t,i(`none`))}}),{reference:ye}=g(M,{enabled:!x&&!b,event:`mousedown`}),{buttonRef:be,getButtonProps:xe}=c({native:a,disabled:N}),Se={...d,open:O,disabled:N,popupSide:fe,listEmpty:P,placeholder:y!==`none`&&!j},Ce=F(e=>{_.set(`triggerElement`,e)});return he(`button`,e,{ref:[t,be,Ce],state:Se,props:[oe,ye,ve,{id:pe,tabIndex:E?0:-1,role:E?`combobox`:void 0,"aria-expanded":O?`true`:`false`,"aria-haspopup":E?`dialog`:`listbox`,"aria-controls":O?w?.id:void 0,"aria-required":E&&ie||void 0,"aria-labelledby":me,onPointerDown:_e,onPointerEnter:_e,onFocus(){p(!0),!(N||x)&&ue.start(0,_.state.forceMount)},onBlur(e){if(!Ae(C,e.relatedTarget)&&(te(!0),p(!1),m===`onBlur`)){let e=y===`none`?le:k;h.commit(e)}},onMouseDown(e){if(N||x||(E||M.set(`domReferenceElement`,e.currentTarget),_.state.forceMount(),ge.current!==`touch`&&(_.state.inputRef.current?.focus(),E||e.preventDefault()),O))return;let t=L(e.currentTarget);function n(e){if(!T)return;let t=ke(e),n=_.state.positionerElement,r=_.state.listElement;if(Ae(T,t)||Ae(n,t)||Ae(r,t)||t===T)return;let a=qe(T),o=e.clientX>=a.left-bt&&e.clientX<=a.right+bt,s=e.clientY>=a.top-bt&&e.clientY<=a.bottom+bt;o&&s||_.state.setOpen(!1,i(`cancel-open`,e))}E&&t.addEventListener(`mouseup`,n,{once:!0})},onKeyDown(e){N||x||(e.key===`ArrowDown`||e.key===`ArrowUp`)&&(Je(e),_.state.setOpen(!0,i(He,e.nativeEvent)),_.state.inputRef.current?.focus())}},h?h.getValidationProps(ee):ee,xe],stateAttributesMapping:mt})}),St=R.createContext(null);function Ct(){return R.useContext(St)}function wt(e){let{children:t,items:n}=e,r=R.useMemo(()=>({items:n}),[n]);return(0,H.jsx)(St.Provider,{value:r,children:t})}function Tt(e){let{children:t}=e,{filteredItems:n}=rt(),r=Ct(),i=r?r.items:n;return i?(0,H.jsx)(R.Fragment,{children:i.map(t)}):null}var Et=R.forwardRef(function(e,t){var n;let{render:r,className:i,style:a,children:o,...s}=e,c=z(),l=nt(),ee=!!vt(!0),{filteredItems:d,hasItems:f}=rt(),te=u(c,B.selectionMode),p=u(c,B.grid),m=u(c,B.popupProps),h=u(c,B.virtualized),ne=te===`multiple`,g=d.length===0,_=F(e=>{c.set(`positionerElement`,e)}),v=F(e=>{c.set(`listElement`,e)}),y=R.useMemo(()=>typeof o==`function`?n||=(0,H.jsx)(Tt,{children:o}):o,[o]),b={empty:g},re=l.useState(`floatingId`),x=he(`div`,e,{state:b,ref:[t,v,ee?null:_],props:[m,{children:y,tabIndex:-1,id:re,role:p?`grid`:`listbox`,"aria-multiselectable":ne?`true`:void 0,onKeyDown(e){if(!(c.state.disabled||c.state.readOnly)&&e.key===`Enter`){let t=c.state.activeIndex;if(t==null)return;Je(e);let n=e.nativeEvent,r=c.state.listRef.current[t];r&&(c.state.selectionEventRef.current=n,r.click(),c.state.selectionEventRef.current=null)}},onKeyDownCapture(){c.state.keyboardActiveRef.current=!0},onPointerMoveCapture(){c.state.keyboardActiveRef.current=!1}},s]});return h?x:(0,H.jsx)(N,{elementsRef:c.state.listRef,labelsRef:f?void 0:c.state.labelsRef,children:x})}),Dt=e(me()),W=`⁠`;function Ot(e){let t=e.ownerDocument.createTreeWalker(e,NodeFilter.SHOW_TEXT),n=null;for(;t.nextNode();){let e=t.currentNode;e.nodeValue!==``&&(n=e)}return n}function kt(){let e=Ge(),t=R.useRef(null);return R.useEffect(()=>{if(P)return;let n=t.current;if(n==null)return;let r=Ot(n);if(r==null)return;let i=r.nodeValue??``,a=`${i}${W}`;return r.nodeValue=a,e.start(200,()=>{r.nodeValue===a&&(r.nodeValue=i)}),()=>{e.clear(),r.nodeValue===a&&(r.nodeValue=i)}},[t,e]),t}var At=R.createContext(void 0);function jt(){let e=R.useContext(At);if(e===void 0)throw Error(k(20));return e}var Mt=R.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e,i=z(),a=u(i,B.mounted),o=u(i,B.forceMounted);return a||n||o?(0,H.jsx)(At.Provider,{value:n,children:(0,H.jsx)(I,{ref:t,...r})}):null}),G=R.forwardRef(function(e,t){let{render:n,className:r,anchor:i,positionMethod:a=`absolute`,side:o=`bottom`,align:c=`center`,sideOffset:l=0,alignOffset:ee=0,collisionBoundary:d=`clipping-ancestors`,collisionPadding:f=5,arrowPadding:te=5,sticky:p=!1,disableAnchorTracking:m=!1,collisionAvoidance:h=y,style:ne,...g}=e,_=z(),{filteredItems:re}=rt(),x=nt(),ie=jt(),ae=u(_,B.modal),S=u(_,B.open),C=u(_,B.mounted),w=u(_,B.openMethod),oe=u(_,B.positionerElement),T=u(_,B.triggerElement),E=u(_,B.inputElement),se=u(_,B.inputGroupElement),O=u(_,B.inputInsidePopup),k=u(_,B.transitionStatus),A=re.length===0,j=v({anchor:i??(O?T:se??E),floatingRootContext:x,positionMethod:a,mounted:C,side:o,sideOffset:l,align:c,alignOffset:ee,arrowPadding:te,collisionBoundary:d,collisionPadding:f,sticky:p,disableAnchorTracking:m,keepMounted:ie,collisionAvoidance:h,lazyFlip:!0});s(S&&ae,w===`touch`,oe,T);let M={open:S,side:j.side,align:j.align,anchorHidden:j.anchorHidden,empty:A};b(()=>{_.set(`popupSide`,j.side)},[_,j.side]);let le=F(e=>{_.set(`positionerElement`,e)}),ue=D(e,M,{styles:j.positionerStyles,transitionStatus:k,props:g,refs:[t,le],hidden:!C,inert:!S});return(0,H.jsxs)(_t.Provider,{value:j,children:[C&&ae&&(0,H.jsx)(ce,{inert:fe(!S),cutout:se??E??T}),ue]})}),K={...Te,...We},Nt=R.forwardRef(function(e,t){let{render:n,className:r,style:i,initialFocus:a,finalFocus:o,...s}=e,c=z(),l=vt(),d=nt(),{filteredItems:f}=rt(),te=u(c,B.mounted),p=u(c,B.open),m=u(c,B.openMethod),h=u(c,B.transitionStatus),ne=u(c,B.inputInsidePopup),g=u(c,B.inputElement),_=u(c,B.modal),v=f.length===0;ee({open:p,ref:c.state.popupRef,onComplete(){p&&c.state.onOpenChangeComplete(!0)}});let y={open:p,side:l.side,align:l.align,anchorHidden:l.anchorHidden,transitionStatus:h,empty:v},b=he(`div`,e,{state:y,ref:[t,c.state.popupRef],props:[{role:ne?`dialog`:`presentation`,tabIndex:-1,onFocus(e){let t=ke(e.nativeEvent);m!==`touch`&&(Ae(c.state.listElement,t)||t===e.currentTarget)&&c.state.inputRef.current?.focus()}},ye(h),s],stateAttributesMapping:K}),re=a===void 0?ne?e=>e===`touch`?c.state.popupRef.current:g:!1:a,x;x=o??(ne?void 0:!1);let ae=!ne||_;return(0,H.jsx)(ie,{context:d,disabled:!te,modal:ae,openInteractionType:m,initialFocus:re,returnFocus:x,getInsideElements:()=>[c.state.startDismissRef.current,c.state.endDismissRef.current],children:(0,H.jsxs)(R.Fragment,{children:[b,ae&&(0,H.jsx)(yt,{ref:c.state.endDismissRef})]})})}),Pt=R.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e;return he(`span`,e,{ref:t,props:[{"aria-hidden":!0,children:`▼`},a]})}),Ft=R.createContext(void 0),q=R.createContext(!1);function J(){return R.useContext(q)}var It=R.memo(R.forwardRef(function(e,t){let{render:n,className:r,style:i,value:a=null,index:o,disabled:s=!1,nativeButton:l=!1,...ee}=e,d=R.useRef(!1),f=R.useRef(null),te=ne({index:o,textRef:f,indexGuessBehavior:M.GuessFromOrder}),p=z(),m=J(),{flatFilteredItems:h,hasItems:g}=rt(),v=u(p,B.open),y=u(p,B.selectionMode),re=u(p,B.readOnly),x=u(p,B.virtualized),ie=u(p,B.isItemEqualToValue),ae=y!==`none`,S=o??(x?_(h,a,ie):te.index),C=te.index!==-1,w=u(p,B.id),oe=u(p,B.isActive,S),T=u(p,B.isSelected,a),E=u(p,B.itemProps),se=R.useRef(null),D=w!=null&&C?`${w}-${S}`:void 0,k=T&&ae;b(()=>{if(!C||!x&&o==null)return;let e=p.state.listRef.current;return e[S]=se.current,()=>{delete e[S]}},[C,x,S,o,p]),b(()=>{if(!C||g)return;let e=p.state.valuesRef.current;return e[S]=a,y!==`none`&&p.state.allValuesRef.current.push(a),()=>{delete e[S]}},[C,g,S,a,p,y]),b(()=>{if(!v){d.current=!1;return}if(!C||g)return;let e=p.state.selectedValue,t=Array.isArray(e)?e[e.length-1]:e;O(a,t,ie)&&p.set(`selectedIndex`,S)},[C,g,v,p,S,a,ie]);let{getButtonProps:ce,buttonRef:A}=c({disabled:s,focusableWhenDisabled:!0,native:l,composite:!0}),j={disabled:s,selected:k,highlighted:oe};function le(e){function t(){p.state.handleSelection(e,a)}p.state.submitOnItemClick?(Dt.flushSync(t),p.state.requestSubmit()):t()}let ue={id:D,role:m?`gridcell`:`option`,"aria-selected":ae?k:void 0,tabIndex:void 0,onPointerDownCapture(e){d.current=!0,e.preventDefault()},onMouseDown(e){e.preventDefault()},onClick(e){s||re||le(e.nativeEvent)},onMouseUp(e){let t=d.current;d.current=!1,!(s||re||e.button!==0||t||!oe)&&le(e.nativeEvent)}},N=he(`div`,e,{ref:[A,t,te.ref,se],state:j,props:[E,ue,ee,ce]}),P=R.useMemo(()=>({selected:k,textRef:f}),[k,f]);return(0,H.jsx)(Ft.Provider,{value:P,children:N})})),Lt=R.forwardRef(function(e,t){let{render:n,className:r,style:i,children:a,...o}=e,{filteredItems:s}=rt(),c=z(),l=kt(),ee=s.length===0?a:null;return he(`div`,e,{ref:[t,c.state.emptyRef,l],props:[{children:ee,role:`status`,"aria-live":`polite`,"aria-atomic":!0},o]})}),Rt={...We,...pe},Y=R.forwardRef(function(e,t){let{render:n,className:r,disabled:a=!1,nativeButton:o=!0,keepMounted:s=!1,style:l,...d}=e,{disabled:f}=re(),p=z(),m=u(p,B.selectionMode),h=u(p,B.disabled),ne=u(p,B.readOnly),g=u(p,B.open),_=u(p,B.selectedValue),v=u(p,B.hasSelectionChips),y=it(),b=!1;b=m===`none`?y!==``:m===`single`?_!=null:v;let x=f||h||a,{buttonRef:ie,getButtonProps:ae}=c({native:o,disabled:x}),{mounted:S,transitionStatus:C,setMounted:w}=te(b),oe={disabled:x,visible:b,open:g,transitionStatus:C};ee({open:b,ref:p.state.clearRef,onComplete(){b||w(!1)}});let T=he(`button`,e,{state:oe,ref:[t,ie,p.state.clearRef],props:[{tabIndex:-1,children:`x`,onMouseDown(e){e.preventDefault()},onClick(e){if(x||ne)return;let t=p.state.keyboardActiveRef;p.state.setInputValue(``,i(Se,e.nativeEvent)),m===`none`?p.state.setIndices({activeIndex:null,type:t.current?`keyboard`:`pointer`}):(p.state.setSelectedValue(Array.isArray(_)?[]:null,i(Se,e.nativeEvent)),p.state.setIndices({activeIndex:null,selectedIndex:null,type:t.current?`keyboard`:`pointer`})),p.state.inputRef.current?.focus()}},d,ae],stateAttributesMapping:Rt});return s||S?T:null});export{Nt as a,kt as c,wt as d,xt as f,lt as g,ut as h,Pt as i,Et as l,pt as m,Lt as n,G as o,U as p,It as r,Mt as s,Y as t,Tt as u};
2
- //# sourceMappingURL=ComboboxClear-B0HJXjbz.js.map
1
+ import{a as e,t}from"./react-BUfh6y28.js";import{t as n}from"./jsx-runtime-DJeoFXNw.js";import{$a as r,Aa as i,An as a,Ao as o,Ar as s,Ba as c,Bn as l,Ca as ee,Di as u,Dn as d,Dr as f,Ea as te,Ei as p,En as m,Eo as h,Fa as ne,Fi as g,Fn as _,Fr as v,Gi as y,Ha as b,Hn as re,Ia as x,Ii as ie,In as ae,Ja as S,La as C,Ln as w,Lr as oe,Ma as T,Mi as E,Mo as se,Mr as D,Nn as O,No as k,Nr as ce,Oo as A,Or as j,Pa as M,Pi as le,Pn as ue,Pr as N,Ra as P,Rn as de,Rr as fe,So as pe,Ta as me,To as he,Tr as ge,Ua as F,Un as _e,Vi as I,Vn as ve,Vr as ye,Wn as be,Xa as xe,Ya as Se,_i as Ce,ao as we,bo as Te,ca as L,co as Ee,do as De,fi as Oe,ga as ke,ha as Ae,io as je,ja as Me,jn as Ne,jo as Pe,ko as Fe,la as Ie,oa as Le,oi as Re,sa as ze,si as Be,so as Ve,uo as He,wn as Ue,wo as We,xa as Ge,xo as Ke,xr as qe,ya as Je,zn as Ye}from"./utils-OWUgXvpr.js";import{t as Xe}from"./useRegisterFieldControl-Dmsxd6H8.js";import{t as Ze}from"./FormContext-BEFZtJu9.js";var R=e(t()),Qe=R.createContext(void 0),$e=R.createContext(void 0),et=R.createContext(void 0),tt=R.createContext(``);function z(){let e=R.useContext(Qe);if(!e)throw Error(k(22));return e}function nt(){let e=R.useContext($e);if(!e)throw Error(k(23));return e}function rt(){let e=R.useContext(et);if(!e)throw Error(k(24));return e}function it(){return R.useContext(tt)}var B={id:E(e=>e.id),labelId:E(e=>e.labelId),items:E(e=>e.items),selectedValue:E(e=>e.selectedValue),hasSelectionChips:E(e=>{let t=e.selectedValue;return Array.isArray(t)&&t.length>0}),hasSelectedValue:E(e=>{let{selectedValue:t,selectionMode:n}=e;return t==null?!1:n===`multiple`&&Array.isArray(t)?t.length>0:!0}),hasNullItemLabel:E((e,t)=>t?m(e.items):!1),open:E(e=>e.open),mounted:E(e=>e.mounted),forceMounted:E(e=>e.forceMounted),inline:E(e=>e.inline),activeIndex:E(e=>e.activeIndex),selectedIndex:E(e=>e.selectedIndex),isActive:E((e,t)=>e.activeIndex===t),isSelected:E((e,t)=>{let n=e.isItemEqualToValue,r=e.selectedValue;return Array.isArray(r)?r.some(e=>O(t,e,n)):O(t,r,n)}),transitionStatus:E(e=>e.transitionStatus),popupProps:E(e=>e.popupProps),inputProps:E(e=>e.inputProps),triggerProps:E(e=>e.triggerProps),itemProps:E(e=>e.itemProps),positionerElement:E(e=>e.positionerElement),listElement:E(e=>e.listElement),triggerElement:E(e=>e.triggerElement),inputElement:E(e=>e.inputElement),inputGroupElement:E(e=>e.inputGroupElement),popupSide:E(e=>e.popupSide),openMethod:E(e=>e.openMethod),inputInsidePopup:E(e=>e.inputInsidePopup),inputOwnsFormValue:E(e=>e.inputOwnsFormValue),selectionMode:E(e=>e.selectionMode),name:E(e=>e.name),form:E(e=>e.form),disabled:E(e=>e.disabled),readOnly:E(e=>e.readOnly),required:E(e=>e.required),grid:E(e=>e.grid),virtualized:E(e=>e.virtualized),itemToStringLabel:E(e=>e.itemToStringLabel),isItemEqualToValue:E(e=>e.isItemEqualToValue),modal:E(e=>e.modal),autoHighlight:E(e=>e.autoHighlight),submitOnItemClick:E(e=>e.submitOnItemClick)};function at(e,t){return(n,r)=>{if(n==null)return!1;let i=a(n,t);return e.contains(i,r)}}function ot(e,t,n){return(r,i)=>{if(r==null)return!1;if(!i)return!0;let o=a(r,t),s=n==null?``:a(n,t);return s&&e.contains(s,i)&&s.length===i.length?!0:e.contains(o,i)}}var V=new Map;function st(e={}){let t={usage:`search`,sensitivity:`base`,ignorePunctuation:!0,...e},n=`${ct(e.locale)}|${JSON.stringify(t)}`,r=V.get(n);if(r)return r;let i=new Intl.Collator(e.locale,t),o={contains(e,t,n){if(!t)return!0;let r=a(e,n);for(let e=0;e<=r.length-t.length;e+=1)if(i.compare(r.slice(e,e+t.length),t)===0)return!0;return!1},startsWith(e,t,n){if(!t)return!0;let r=a(e,n);return i.compare(r.slice(0,t.length),t)===0},endsWith(e,t,n){if(!t)return!0;let r=a(e,n),o=t.length;return r.length>=o&&i.compare(r.slice(r.length-o),t)===0}};return V.set(n,o),o}function ct(e){return Array.isArray(e)?e.map(e=>ct(e)).join(`,`):e==null?``:String(e)}var lt=st;function ut(e={}){let{multiple:t=!1,value:n,...r}=e,i=st(r),a=R.useCallback((e,r,a)=>t?at(i,a)(e,r):ot(i,a,n)(e,r),[i,n,t]);return R.useMemo(()=>({contains:a,startsWith:i.startsWith,endsWith:i.endsWith}),[a,i])}var dt=Symbol(`none`),ft={value:dt,index:-1},H=e(n());function pt(e){let{id:t,onOpenChangeComplete:n,defaultSelectedValue:r=null,selectedValue:s,onSelectedValueChange:c,defaultInputValue:l,inputValue:m,open:ne,defaultOpen:v=!1,selectionMode:y=`none`,onItemHighlighted:x,name:ie,form:C,disabled:T=!1,readOnly:E=!1,required:D=!1,inputRef:k,grid:ce=!1,items:M,filteredItems:N,filter:P,openOnInputClick:fe=!0,autoHighlight:pe=!1,keepHighlight:me=!1,highlightItemOnHover:he=!0,loopFocus:_e=!0,itemToStringLabel:I,itemToStringValue:ve,isItemEqualToValue:ye=ue,virtualized:be=!1,inline:xe=!1,fillInputOnItemPress:Se=!0,modal:Te=!1,limit:L=-1,autoComplete:je=`list`,formAutoComplete:Re,locale:He,submitOnItemClick:Ue=!1}=e,{clearErrors:We}=Ze(),{setDirty:Ge,validityData:Ke,shouldValidateOnChange:qe,setFilled:Je,name:Ye,disabled:z,setTouched:nt,setFocused:rt,validationMode:it,validation:V}=re(),st=oe(),ct=de({id:t}),ut=lt({locale:He}),[pt,mt]=R.useState(!1),[ht,gt]=R.useState(null),_t=R.useRef([]),vt=R.useRef([]),yt=R.useRef(null),U=R.useRef(null),bt=R.useRef(null),xt=R.useRef(null),St=R.useRef(null),Ct=R.useRef(!0),wt=R.useRef(!1),Tt=R.useRef(null),Et=R.useRef(null),Dt=R.useRef(null),W=R.useRef(ft),Ot=R.useRef(null),kt=R.useRef([]),At=R.useRef([]),jt=z||T,Mt=Ye??ie,G=y===`multiple`,K=y===`single`,Nt=m!==void 0||l!==void 0,Pt=M!==void 0,Ft=N!==void 0,q;q=pe===`always`?`always`:pe?`input-change`:!1;let[J,It]=S({controlled:s,default:G?r??A:r,name:`Combobox`,state:`selectedValue`}),Lt=R.useMemo(()=>P===null?()=>!0:P===void 0?K&&!pt?ot(ut,I,J):at(ut,I):P,[P,K,J,pt,ut,I]),Rt=se(()=>Nt?l??``:K?a(J,I):``).current,[Y,zt]=S({controlled:m,default:Rt,name:`Combobox`,state:`inputValue`}),[X,Bt]=S({controlled:ne,default:v,name:`Combobox`,state:`open`}),Vt=d(M),Z=ht??(Y===``?``:String(Y).trim()),Ht=K?a(J,I):``,Ut=K&&!pt&&Z!==``&&Ht!==``&&Ht.length===Z.length&&ut.contains(Ht,Z),Wt=Ut?``:Z,Gt=Pt&&Ft&&Ut,Kt=R.useMemo(()=>M?Vt?M.flatMap(e=>e.items):M:A,[M,Vt]),qt=R.useMemo(()=>{if(N&&!Gt)return N;if(!M)return A;if(Vt){let e=M,t=[],n=0;for(let r of e){if(L>-1&&n>=L)break;let e=Wt===``?r.items:r.items.filter(e=>Lt(e,Wt,I));if(e.length===0)continue;let i=L>-1?L-n:1/0,a=e.slice(0,i);if(a.length>0){let e={...r,items:a};t.push(e),n+=a.length}}return t}if(Wt===``)return L>-1?Kt.slice(0,L):Kt;let e=[];for(let t of Kt){if(L>-1&&e.length>=L)break;Lt(t,Wt,I)&&e.push(t)}return e},[N,Gt,M,Vt,Wt,L,Lt,I,Kt]),Jt=R.useMemo(()=>Vt?qt.flatMap(e=>e.items):qt,[qt,Vt]),Q=se(()=>new p({id:ct,labelId:void 0,selectedValue:J,open:X,filter:Lt,query:Z,items:M,selectionMode:y,listRef:_t,labelsRef:vt,popupRef:yt,emptyRef:St,inputRef:U,startDismissRef:bt,endDismissRef:xt,keyboardActiveRef:Ct,chipsContainerRef:Tt,clearRef:Et,valuesRef:kt,allValuesRef:At,selectionEventRef:Dt,name:Mt,form:C,disabled:jt,readOnly:E,required:D,grid:ce,isGrouped:Vt,virtualized:be,openOnInputClick:fe,itemToStringLabel:I,isItemEqualToValue:ye,modal:Te,autoHighlight:q,submitOnItemClick:Ue,hasInputValue:Nt,mounted:!1,forceMounted:!1,transitionStatus:`idle`,inline:xe,activeIndex:null,selectedIndex:null,popupProps:{},inputProps:{},triggerProps:{},itemProps:Fe,positionerElement:null,listElement:null,triggerElement:null,inputElement:null,inputGroupElement:null,popupSide:null,openMethod:null,inputInsidePopup:!0,inputOwnsFormValue:y===`none`,onOpenChangeComplete:n||o,setOpen:o,setInputValue:o,setSelectedValue:o,setIndices:o,onItemHighlighted:o,handleSelection:o,forceMount:o,requestSubmit:o})).current,Yt=y===`none`?Y:J,Xt=R.useMemo(()=>y===`none`?Yt:Array.isArray(J)?J.map(e=>Ne(e,ve)):Ne(J,ve),[Yt,ve,y,J]),Zt=F(x),Qt=F(n),$t=u(Q,B.activeIndex),en=u(Q,B.selectedIndex),tn=u(Q,B.positionerElement),nn=u(Q,B.listElement),rn=u(Q,B.triggerElement),an=u(Q,B.inputElement),on=u(Q,B.inputGroupElement),$=u(Q,B.inline),sn=u(Q,B.inputInsidePopup),cn=u(Q,B.inputOwnsFormValue),ln=Ie(rn),{mounted:un,setMounted:dn,transitionStatus:fn}=te(X),{openMethod:pn,triggerProps:mn}=ge(X),hn=F(()=>Xt);Xe(sn?ln:U,ct,Yt,hn);let gn=F(()=>{M?vt.current=Jt.map(e=>a(e,I)):Q.set(`forceMounted`,!0)}),_n=R.useRef(J);b(()=>{J!==_n.current&&gn()},[gn,J]);let vn=F(e=>{Q.update(e);let t=e.type||`none`;if(e.activeIndex!==void 0){if(e.activeIndex===null)W.current!==ft&&(W.current=ft,Zt(void 0,Me(t,void 0,{index:-1})));else{let n=kt.current[e.activeIndex];W.current={value:n,index:e.activeIndex},Zt(n,Me(t,void 0,{index:e.activeIndex}))}}}),yn=F((t,n)=>{if(wt.current=n.reason===we,e.onInputValueChange?.(t,n),!n.isCanceled){if(n.reason===`input-change`){let e=n.event,r=e.inputType;if(e.type===`compositionend`||r!=null&&r!==``&&r!==`insertReplacementText`){let e=t.trim()!==``;e&&mt(!0),Ot.current={hasQuery:e},e&&q&&Q.state.activeIndex==null&&Q.set(`activeIndex`,0)}}zt(t)}}),bn=F((t,n)=>{if(X!==t&&(n.reason===`escape-key`&&Pt&&Jt.length===0&&!Q.state.emptyRef.current&&n.allowPropagation(),e.onOpenChange?.(t,n),!n.isCanceled&&(t&&G&&sn&&!$&&ht!==null&&(mt(!1),gt(null),Y!==``&&yn(``,i(we,n.event))),!t&&pt&&(K?($||gt(Z),Z===``&&mt(!1)):G&&($||gt(Z),sn&&vn({activeIndex:null}),(!sn||$)&&yn(``,i(we,n.event)))),Bt(t),!t&&sn&&(n.reason===`focus-out`||n.reason===`outside-press`)&&(nt(!0),rt(!1),it===`onBlur`)))){let e=y===`none`?Y:J;V.commit(e)}}),xn=F((e,t)=>{c?.(e,t),!t.isCanceled&&(It(e),(y===`none`&&yt.current&&Se||K&&!Q.state.inputInsidePopup)&&yn(a(e,I),i(t.reason,t.event)),K&&e!=null&&t.reason!==`input-change`&&pt&&!$&&gt(Z))}),Sn=F((e,t)=>{let n=t;if(n===void 0){if($t===null)return;n=kt.current[$t]}let r=ke(e),a=Dt.current??e;Dt.current=null;let o=i(Ee,a),s=r?.closest(`a`)?.getAttribute(`href`);if(s)s.startsWith(`#`)&&bn(!1,o);else if(G){let e=Array.isArray(J)?J:[],t=w(e,n,Q.state.isItemEqualToValue)?ae(e,n,Q.state.isItemEqualToValue):[...e,n];if(xn(t,o),!(U.current&&U.current.value.trim()!==``))return;Q.state.inputInsidePopup?yn(``,i(we,o.event)):bn(!1,o)}else xn(n,o),bn(!1,o)}),Cn=F(()=>{if(!Q.state.submitOnItemClick)return;let e=V.inputRef.current?.form??Q.state.inputElement?.form;e&&typeof e.requestSubmit==`function`&&e.requestSubmit()}),wn=F(()=>{if(dn(!1),Qt?.(!1),mt(!1),gt(null),vn(y===`none`?{activeIndex:null,selectedIndex:null}:{activeIndex:null}),G&&U.current&&U.current.value!==``&&!wt.current&&yn(``,i(we)),K){if(Q.state.inputInsidePopup)U.current&&U.current.value!==``&&yn(``,i(we));else{let e=a(J,I);U.current&&U.current.value!==e&&yn(e,i(e===``?we:De))}}}),Tn=R.useMemo(()=>$&&tn?{current:tn.closest(`[role="dialog"]`)}:yt,[$,tn]);ee({enabled:!e.actionsRef,open:X,ref:Tn,onComplete(){X||wn()}}),R.useImperativeHandle(e.actionsRef,()=>({unmount:wn}),[wn]),b(function(){if(X||y===`none`)return;let e=M?Kt:At.current;if(G){let t=Array.isArray(J)?J:[],n=t[t.length-1],r=_(e,n,ye);vn({selectedIndex:r===-1?null:r})}else{let t=_(e,J,ye);vn({selectedIndex:t===-1?null:t})}},[X,J,M,y,Kt,G,ye,vn]),b(()=>{M&&(kt.current=Jt,_t.current.length=Jt.length)},[M,Jt]),b(()=>{let e=Ot.current;if(e&&(e.hasQuery?q&&Q.set(`activeIndex`,0):q===`always`&&Q.set(`activeIndex`,0),Ot.current=null),!X&&!$)return;let t=Pt||Ft?Jt:kt.current,n=Q.state.activeIndex;if(n==null){if(q===`always`&&t.length>0){Q.set(`activeIndex`,0);return}W.current!==ft&&(W.current=ft,Q.state.onItemHighlighted(void 0,Me(De,void 0,{index:-1})));return}if(n>=t.length){W.current!==ft&&(W.current=ft,Q.state.onItemHighlighted(void 0,Me(De,void 0,{index:-1}))),Q.set(`activeIndex`,null);return}let r=t[n],i=W.current.value,a=i!==dt&&O(r,i,Q.state.isItemEqualToValue);W.current.index===n&&a||(W.current={value:r,index:n},Q.state.onItemHighlighted(r,Me(De,void 0,{index:n})))},[$t,q,Ft,Pt,Jt,$,X,Q]),b(()=>{Je(y===`none`?String(Y)!==``:G?Array.isArray(J)&&J.length>0:J!=null)},[Je,y,Y,J,G]),R.useEffect(()=>{Pt&&q&&Jt.length===0&&vn({activeIndex:null})},[Pt,q,Jt.length,vn]),f(Z,()=>{X&&Z!==``&&Z!==String(Rt)&&mt(!0)}),f(J,()=>{if(y!==`none`&&(We(Mt),Ge(J!==Ke.initialValue),qe()?V.commit(J):V.commit(J,!0),K&&!Nt&&!sn)){let e=a(J,I);Y!==e&&yn(e,i(De))}}),f(Y,()=>{y===`none`&&(We(Mt),Ge(Y!==Ke.initialValue),qe()?V.commit(Y):V.commit(Y,!0))}),f(M,()=>{if(!K||Nt||sn||pt)return;let e=a(J,I);Y!==e&&yn(e,i(De))});let En=Oe({open:$?!0:X,onOpenChange:bn,elements:{reference:sn?rn:an,floating:tn}}),Dn,On;$||(Dn=ce?`grid`:`listbox`,On=X?`true`:`false`);let kn=R.useMemo(()=>{let e=an?.tagName===`INPUT`,t=an==null||e,n=t||X,r=t?{autoComplete:`off`,spellCheck:`false`,autoCorrect:`off`,autoCapitalize:`none`}:{};return n&&(r.role=`combobox`,r[`aria-expanded`]=On,r[`aria-haspopup`]=Dn,r[`aria-controls`]=X?nn?.id:void 0,r[`aria-autocomplete`]=je),{reference:r,floating:{role:`presentation`}}},[an,X,On,Dn,nn?.id,je]),An=g(En,{enabled:!E&&!jt&&fe,event:`mousedown-only`,toggle:!1,touchOpenDelay:sn?0:100,reason:Ve}),jn=le(En,{enabled:!E&&!jt&&!$,outsidePressEvent:{mouse:`sloppy`,touch:`intentional`},bubbles:$?!0:void 0,outsidePress(e){let t=ke(e);return!Ae(rn,t)&&!Ae(Et.current,t)&&!Ae(Tt.current,t)&&!Ae(on,t)}}),Mn=Be(En,{enabled:!E&&!jt,id:ct,listRef:_t,activeIndex:$t,selectedIndex:en,virtual:!0,loopFocus:_e,allowEscape:_e&&!q,focusItemOnOpen:pt||y===`none`&&!q?!1:`auto`,focusItemOnHover:he,resetOnPointerLeave:!me,cols:ce?2:1,orientation:ce?`horizontal`:void 0,rtl:st===`rtl`,disabledIndices:A,onNavigate(e,t){(t||X)&&fn!==`ending`&&vn(t?{activeIndex:e,type:Ct.current?`keyboard`:`pointer`}:{activeIndex:e})}}),Nn=R.useMemo(()=>h(Mn.reference,jn.reference,An.reference,kn.reference),[Mn.reference,jn.reference,An.reference,kn.reference]),Pn=R.useMemo(()=>h(Ce,Mn.floating,jn.floating,kn.floating),[Mn.floating,jn.floating,kn.floating]),Fn=R.useMemo(()=>{let e=Mn.item;return e?{...e,onFocus:void 0}:Fe},[Mn.item]);j(()=>{Q.update({inline:xe,popupProps:Pn,inputProps:Nn,triggerProps:mn,itemProps:Fn,setOpen:bn,setInputValue:yn,setSelectedValue:xn,setIndices:vn,onItemHighlighted:Zt,handleSelection:Sn,forceMount:gn,requestSubmit:Cn})}),b(()=>{Q.update({id:ct,selectedValue:J,open:X,mounted:un,transitionStatus:fn,items:M,inline:xe,popupProps:Pn,inputProps:Nn,triggerProps:mn,openMethod:pn,itemProps:Fn,selectionMode:y,name:Mt,form:C,disabled:jt,readOnly:E,required:D,grid:ce,isGrouped:Vt,virtualized:be,onOpenChangeComplete:Qt,openOnInputClick:fe,itemToStringLabel:I,modal:Te,autoHighlight:q,isItemEqualToValue:ye,submitOnItemClick:Ue,hasInputValue:Nt,requestSubmit:Cn,inputOwnsFormValue:y===`none`&&(xe||!Q.state.inputInsidePopup)})},[Q,ct,J,X,un,fn,M,Pn,Nn,Fn,pn,mn,y,Mt,jt,E,D,V,ce,Vt,be,Qt,fe,I,Te,ye,Ue,Nt,xe,Cn,q,C]);let In=Pe(k,V.inputRef),Ln=R.useMemo(()=>({query:Z,hasItems:Pt,filteredItems:qt,flatFilteredItems:Jt}),[Z,Pt,qt,Jt]),Rn=R.useMemo(()=>Array.isArray(Yt)?``:Ne(Yt,ve),[Yt,ve]),zn=G&&Array.isArray(J)&&J.length>0,Bn=G||y===`none`&&cn?void 0:Mt,Vn=R.useMemo(()=>!G||!Array.isArray(J)||!Mt?null:J.map(e=>{let t=Ne(e,ve);return(0,H.jsx)(`input`,{type:`hidden`,form:C,name:Mt,value:t},t)}),[G,J,C,Mt,ve]),Hn=(0,H.jsxs)(R.Fragment,{children:[e.children,(0,H.jsx)(`input`,{...V.getInputValidationProps({onFocus(){sn?rn?.focus():(U.current||rn)?.focus()},onChange(e){if(e.nativeEvent.defaultPrevented||jt||E){e.preventBaseUIHandler?.();return}let t=e.currentTarget.value,n=i(De,e.nativeEvent);function r(){if(G)return;if(y===`none`){Ge(t!==Ke.initialValue),yn(t,n),qe()&&V.commit(t);return}let e=kt.current.find(e=>Ne(e,ve).toLowerCase()===t.toLowerCase()||a(e,I).toLowerCase()===t.toLowerCase());e!=null&&(Ge(e!==Ke.initialValue),xn?.(e,n),qe()&&V.commit(e))}M?r():(gn(),queueMicrotask(r))}}),id:ct&&Bn==null?`${ct}-hidden-input`:void 0,form:C,name:Bn,autoComplete:Re,disabled:jt,required:D&&!zn,readOnly:E,value:Rn,ref:In,style:Bn?ze:Le,tabIndex:-1,"aria-hidden":!0,suppressHydrationWarning:!0}),Vn]});return(0,H.jsx)(Qe.Provider,{value:Q,children:(0,H.jsx)($e.Provider,{value:En,children:(0,H.jsx)(et.Provider,{value:Ln,children:(0,H.jsx)(tt.Provider,{value:Y,children:Hn})})})})}var mt={...Ke,...be,popupSide:e=>e?{"data-popup-side":e}:null,listEmpty:e=>e?{"data-list-empty":``}:null},ht=R.createContext(void 0);function gt(){return R.useContext(ht)}var _t=R.createContext(void 0);function vt(e){let t=R.useContext(_t);if(t===void 0&&!e)throw Error(k(21));return t}var yt=R.forwardRef(function(e,t){let n=z(),{buttonRef:r,getButtonProps:a}=c({native:!1}),o=Pe(t,r);function s(e){n.state.setOpen(!1,i(xe,e.nativeEvent,e.currentTarget))}let l=a({onClick:s});return(0,H.jsx)(`span`,{ref:o,...l,"aria-label":`Dismiss`,tabIndex:void 0,style:ze})}),U=R.forwardRef(function(e,t){let{render:n,className:a,disabled:o=!1,id:s,style:c,...ee}=e,{state:d,disabled:f,setTouched:te,setFocused:p,validationMode:m,validation:h}=re(),{labelId:ne}=Ye(),g=gt(),_=!!vt(!0),v=z(),{filteredItems:y}=rt(),b=it(),ie=oe(),ae=u(v,B.required),S=u(v,B.disabled),w=u(v,B.readOnly),E=u(v,B.name),se=u(v,B.form),D=u(v,B.selectionMode),O=u(v,B.autoHighlight),k=u(v,B.inputProps),ce=u(v,B.triggerProps),A=u(v,B.open),j=u(v,B.mounted),M=u(v,B.selectedValue),le=u(v,B.popupSide),ue=u(v,B.positionerElement),N=u(v,B.id),P=u(v,B.inline),de=u(v,B.modal),fe=!!O,pe=j&&ue?le:null,me=f||S||o,ge=y.length===0,I=_||P,ye=!I||de,be=T(s??(I?void 0:N)),xe=Ue(ne,void 0),Se=_?_e:d,[Ce,Te]=R.useState(null),L=R.useRef(!1),Ee=R.useRef(null),Oe=R.useRef(!1),ke=D===`none`&&!_,Ae=F(e=>{let t=_||v.state.inline;t&&!v.state.hasInputValue&&v.state.setInputValue(``,i(De)),v.update({inputElement:e,inputInsidePopup:t,inputOwnsFormValue:ke})}),Me=_||!h?ee:h.getValidationProps(ee),Ne={...Se,open:A,disabled:me,readOnly:w,popupSide:pe,listEmpty:ge};function Pe(e){if(!g)return;let t,{highlightedChipIndex:n}=g,r=g.chipsRef.current.length,i=ie===`rtl`,a=i?`ArrowRight`:`ArrowLeft`,o=i?`ArrowLeft`:`ArrowRight`;if(n!==void 0){if(e.key===a)e.preventDefault(),t=n>0?n-1:void 0;else if(e.key===o)e.preventDefault(),t=n<r-1?n+1:void 0;else if(e.key===`Backspace`||e.key===`Delete`){e.preventDefault();let r=n>=M.length-1?M.length-2:n;t=r>=0?r:void 0,v.state.setIndices({activeIndex:null,selectedIndex:null,type:`keyboard`})}return t}return e.key===a&&(e.currentTarget.selectionStart??0)===0&&M.length>0?(e.preventDefault(),t=r>0?r-1:void 0):e.key===`Backspace`&&e.currentTarget.value===``&&M.length>0&&(v.state.setIndices({activeIndex:null,selectedIndex:null,type:`keyboard`}),e.preventDefault()),t}let Fe=he(`input`,e,{state:Ne,ref:[t,v.state.inputRef,Ae],props:[k,ce,{type:`text`,value:e.value??Ce??b,"aria-readonly":w||void 0,"aria-required":ae||void 0,"aria-labelledby":xe,disabled:me,readOnly:w,required:D===`none`?ae:void 0,form:se,...ke&&E&&{name:E},id:be,onFocus(){if(p(!0),!P||!Oe.current)return;Oe.current=!1;let e=Ee.current;e!=null&&Object.hasOwn(v.state.valuesRef.current,e)&&v.state.setIndices({activeIndex:e})},onBlur(){te(!0),p(!1);let e=v.state.activeIndex;if(P&&e!==null&&O!==`always`&&(Ee.current=e,Oe.current=!0,v.state.setIndices({activeIndex:null})),m===`onBlur`){let e=D===`none`?b:M;h.commit(e)}},onCompositionStart(e){x||(L.current=!0,Te(e.currentTarget.value))},onCompositionEnd(e){L.current=!1;let t=e.currentTarget.value;Te(null),v.state.setInputValue(t,i(je,e.nativeEvent))},onChange(e){let t=e.nativeEvent.inputType,n=!t||t===`insertReplacementText`,r=L.current||!n;if(L.current){let t=e.currentTarget.value;Te(t),t===``&&!v.state.openOnInputClick&&!v.state.inputInsidePopup&&v.state.setOpen(!1,i(we,e.nativeEvent));let n=t.trim(),a=fe&&n!==``;!w&&!me&&n&&r&&(v.state.setOpen(!0,i(je,e.nativeEvent)),fe||v.state.setIndices({activeIndex:null,selectedIndex:null,type:v.state.keyboardActiveRef.current?`keyboard`:`pointer`})),A&&v.state.activeIndex!==null&&!a&&v.state.setIndices({activeIndex:null,selectedIndex:null,type:v.state.keyboardActiveRef.current?`keyboard`:`pointer`});return}v.state.setInputValue(e.currentTarget.value,i(je,e.nativeEvent));let a=e.currentTarget.value===``,o=i(we,e.nativeEvent);a&&!v.state.inputInsidePopup&&(D===`single`&&v.state.setSelectedValue(null,o),v.state.openOnInputClick||v.state.setOpen(!1,o));let s=e.currentTarget.value.trim();!w&&!me&&s&&r&&(v.state.setOpen(!0,i(je,e.nativeEvent)),fe||v.state.setIndices({activeIndex:null,selectedIndex:null,type:v.state.keyboardActiveRef.current?`keyboard`:`pointer`})),A&&v.state.activeIndex!==null&&!fe&&v.state.setIndices({activeIndex:null,selectedIndex:null,type:v.state.keyboardActiveRef.current?`keyboard`:`pointer`})},onKeyDown(e){if(me||w||e.ctrlKey||e.shiftKey||e.altKey||e.metaKey)return;v.state.keyboardActiveRef.current=!0;let t=e.currentTarget,n=t.scrollWidth-t.clientWidth,a=ie===`rtl`;if(e.key===`Home`){Je(e);let n=C&&a?t.value.length:0;t.setSelectionRange(n,n),t.scrollLeft=0;return}if(e.key===`End`){Je(e);let r=C&&a?0:t.value.length;t.setSelectionRange(r,r),t.scrollLeft=a?-n:n;return}if(!j&&e.key===`Escape`){let t=D===`multiple`&&Array.isArray(M)?M.length===0:M===null,n=i(r,e.nativeEvent),a=D===`multiple`?[]:null;v.state.setInputValue(``,n),v.state.setSelectedValue(a,n),t||v.state.inline||n.isPropagationAllowed||e.stopPropagation();return}if(g&&e.key===`Backspace`&&t.value===``&&g.highlightedChipIndex===void 0&&Array.isArray(M)&&M.length>0){let t=g.chipsRef.current.length,n=t>0?t-1:M.length-1,r=M.filter((e,t)=>t!==n);v.state.setIndices({activeIndex:null,selectedIndex:null,type:v.state.keyboardActiveRef.current?`keyboard`:`pointer`}),v.state.setSelectedValue(r,i(De,e.nativeEvent));return}let o=g?.highlightedChipIndex!==void 0,s=Pe(e);if(g?.setHighlightedChipIndex(s),s===void 0?o&&v.state.inputRef.current?.focus():g?.chipsRef.current[s]?.focus(),e.which!==229&&e.key===`Enter`&&A){let t=v.state.activeIndex,n=e.nativeEvent;if(t===null){if(P)return;v.state.setOpen(!1,i(De,n));return}Je(e);let r=v.state.listRef.current[t];r&&(v.state.selectionEventRef.current=n,r.click(),v.state.selectionEventRef.current=null)}},onPointerMove(){v.state.keyboardActiveRef.current=!1},onPointerDown(){v.state.keyboardActiveRef.current=!1}},Me],stateAttributesMapping:mt}),Ie=_?(0,H.jsx)(ve.Provider,{value:l,children:Fe}):Fe;return(0,H.jsxs)(R.Fragment,{children:[A&&ye&&(0,H.jsx)(yt,{ref:v.state.startDismissRef}),Ie]})}),bt=2,xt=R.forwardRef(function(e,t){let{render:n,className:r,nativeButton:a=!0,disabled:o=!1,id:s,style:l,...ee}=e,{state:d,disabled:f,setTouched:te,setFocused:p,validationMode:m,validation:h}=re(),{labelId:ne}=Ye(),_=z(),{filteredItems:v}=rt(),y=u(_,B.selectionMode),b=u(_,B.disabled),x=u(_,B.readOnly),ie=u(_,B.required),ae=u(_,B.mounted),S=u(_,B.popupSide),C=u(_,B.positionerElement),w=u(_,B.listElement),oe=u(_,B.triggerProps),T=u(_,B.triggerElement),E=u(_,B.inputInsidePopup),se=u(_,B.id),D=u(_,B.labelId),O=u(_,B.open),k=u(_,B.selectedValue),ce=u(_,B.activeIndex),A=u(_,B.selectedIndex),j=u(_,B.hasSelectedValue),M=nt(),le=it(),ue=Ge(),N=f||b||o,P=v.length===0,fe=ae&&C?S:null;de({id:E?s:void 0});let pe=E?s??se:s,me=Ue(ne,D),ge=R.useRef(``);function _e(e){ge.current=e.pointerType}let I=M.useState(`domReferenceElement`);R.useEffect(()=>{E&&T&&T!==I&&M.set(`domReferenceElement`,T)},[T,I,M,E]);let{reference:ve}=Re(M,{enabled:!O&&!x&&!b&&y===`single`,listRef:_.state.labelsRef,activeIndex:ce,selectedIndex:A,onMatch(e){let t=_.state.valuesRef.current[e];t!==void 0&&_.state.setSelectedValue(t,i(`none`))}}),{reference:ye}=g(M,{enabled:!x&&!b,event:`mousedown`}),{buttonRef:be,getButtonProps:xe}=c({native:a,disabled:N}),Se={...d,open:O,disabled:N,popupSide:fe,listEmpty:P,placeholder:y!==`none`&&!j},Ce=F(e=>{_.set(`triggerElement`,e)});return he(`button`,e,{ref:[t,be,Ce],state:Se,props:[oe,ye,ve,{id:pe,tabIndex:E?0:-1,role:E?`combobox`:void 0,"aria-expanded":O?`true`:`false`,"aria-haspopup":E?`dialog`:`listbox`,"aria-controls":O?w?.id:void 0,"aria-required":E&&ie||void 0,"aria-labelledby":me,onPointerDown:_e,onPointerEnter:_e,onFocus(){p(!0),!(N||x)&&ue.start(0,_.state.forceMount)},onBlur(e){if(!Ae(C,e.relatedTarget)&&(te(!0),p(!1),m===`onBlur`)){let e=y===`none`?le:k;h.commit(e)}},onMouseDown(e){if(N||x||(E||M.set(`domReferenceElement`,e.currentTarget),_.state.forceMount(),ge.current!==`touch`&&(_.state.inputRef.current?.focus(),E||e.preventDefault()),O))return;let t=L(e.currentTarget);function n(e){if(!T)return;let t=ke(e),n=_.state.positionerElement,r=_.state.listElement;if(Ae(T,t)||Ae(n,t)||Ae(r,t)||t===T)return;let a=qe(T),o=e.clientX>=a.left-bt&&e.clientX<=a.right+bt,s=e.clientY>=a.top-bt&&e.clientY<=a.bottom+bt;o&&s||_.state.setOpen(!1,i(`cancel-open`,e))}E&&t.addEventListener(`mouseup`,n,{once:!0})},onKeyDown(e){N||x||(e.key===`ArrowDown`||e.key===`ArrowUp`)&&(Je(e),_.state.setOpen(!0,i(He,e.nativeEvent)),_.state.inputRef.current?.focus())}},h?h.getValidationProps(ee):ee,xe],stateAttributesMapping:mt})}),St=R.createContext(null);function Ct(){return R.useContext(St)}function wt(e){let{children:t,items:n}=e,r=R.useMemo(()=>({items:n}),[n]);return(0,H.jsx)(St.Provider,{value:r,children:t})}function Tt(e){let{children:t}=e,{filteredItems:n}=rt(),r=Ct(),i=r?r.items:n;return i?(0,H.jsx)(R.Fragment,{children:i.map(t)}):null}var Et=R.forwardRef(function(e,t){var n;let{render:r,className:i,style:a,children:o,...s}=e,c=z(),l=nt(),ee=!!vt(!0),{filteredItems:d,hasItems:f}=rt(),te=u(c,B.selectionMode),p=u(c,B.grid),m=u(c,B.popupProps),h=u(c,B.virtualized),ne=te===`multiple`,g=d.length===0,_=F(e=>{c.set(`positionerElement`,e)}),v=F(e=>{c.set(`listElement`,e)}),y=R.useMemo(()=>typeof o==`function`?n||=(0,H.jsx)(Tt,{children:o}):o,[o]),b={empty:g},re=l.useState(`floatingId`),x=he(`div`,e,{state:b,ref:[t,v,ee?null:_],props:[m,{children:y,tabIndex:-1,id:re,role:p?`grid`:`listbox`,"aria-multiselectable":ne?`true`:void 0,onKeyDown(e){if(!(c.state.disabled||c.state.readOnly)&&e.key===`Enter`){let t=c.state.activeIndex;if(t==null)return;Je(e);let n=e.nativeEvent,r=c.state.listRef.current[t];r&&(c.state.selectionEventRef.current=n,r.click(),c.state.selectionEventRef.current=null)}},onKeyDownCapture(){c.state.keyboardActiveRef.current=!0},onPointerMoveCapture(){c.state.keyboardActiveRef.current=!1}},s]});return h?x:(0,H.jsx)(N,{elementsRef:c.state.listRef,labelsRef:f?void 0:c.state.labelsRef,children:x})}),Dt=e(me()),W=`⁠`;function Ot(e){let t=e.ownerDocument.createTreeWalker(e,NodeFilter.SHOW_TEXT),n=null;for(;t.nextNode();){let e=t.currentNode;e.nodeValue!==``&&(n=e)}return n}function kt(){let e=Ge(),t=R.useRef(null);return R.useEffect(()=>{if(P)return;let n=t.current;if(n==null)return;let r=Ot(n);if(r==null)return;let i=r.nodeValue??``,a=`${i}${W}`;return r.nodeValue=a,e.start(200,()=>{r.nodeValue===a&&(r.nodeValue=i)}),()=>{e.clear(),r.nodeValue===a&&(r.nodeValue=i)}},[t,e]),t}var At=R.createContext(void 0);function jt(){let e=R.useContext(At);if(e===void 0)throw Error(k(20));return e}var Mt=R.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e,i=z(),a=u(i,B.mounted),o=u(i,B.forceMounted);return a||n||o?(0,H.jsx)(At.Provider,{value:n,children:(0,H.jsx)(I,{ref:t,...r})}):null}),G=R.forwardRef(function(e,t){let{render:n,className:r,anchor:i,positionMethod:a=`absolute`,side:o=`bottom`,align:c=`center`,sideOffset:l=0,alignOffset:ee=0,collisionBoundary:d=`clipping-ancestors`,collisionPadding:f=5,arrowPadding:te=5,sticky:p=!1,disableAnchorTracking:m=!1,collisionAvoidance:h=y,style:ne,...g}=e,_=z(),{filteredItems:re}=rt(),x=nt(),ie=jt(),ae=u(_,B.modal),S=u(_,B.open),C=u(_,B.mounted),w=u(_,B.openMethod),oe=u(_,B.positionerElement),T=u(_,B.triggerElement),E=u(_,B.inputElement),se=u(_,B.inputGroupElement),O=u(_,B.inputInsidePopup),k=u(_,B.transitionStatus),A=re.length===0,j=v({anchor:i??(O?T:se??E),floatingRootContext:x,positionMethod:a,mounted:C,side:o,sideOffset:l,align:c,alignOffset:ee,arrowPadding:te,collisionBoundary:d,collisionPadding:f,sticky:p,disableAnchorTracking:m,keepMounted:ie,collisionAvoidance:h,lazyFlip:!0});s(S&&ae,w===`touch`,oe,T);let M={open:S,side:j.side,align:j.align,anchorHidden:j.anchorHidden,empty:A};b(()=>{_.set(`popupSide`,j.side)},[_,j.side]);let le=F(e=>{_.set(`positionerElement`,e)}),ue=D(e,M,{styles:j.positionerStyles,transitionStatus:k,props:g,refs:[t,le],hidden:!C,inert:!S});return(0,H.jsxs)(_t.Provider,{value:j,children:[C&&ae&&(0,H.jsx)(ce,{inert:fe(!S),cutout:se??E??T}),ue]})}),K={...Te,...We},Nt=R.forwardRef(function(e,t){let{render:n,className:r,style:i,initialFocus:a,finalFocus:o,...s}=e,c=z(),l=vt(),d=nt(),{filteredItems:f}=rt(),te=u(c,B.mounted),p=u(c,B.open),m=u(c,B.openMethod),h=u(c,B.transitionStatus),ne=u(c,B.inputInsidePopup),g=u(c,B.inputElement),_=u(c,B.modal),v=f.length===0;ee({open:p,ref:c.state.popupRef,onComplete(){p&&c.state.onOpenChangeComplete(!0)}});let y={open:p,side:l.side,align:l.align,anchorHidden:l.anchorHidden,transitionStatus:h,empty:v},b=he(`div`,e,{state:y,ref:[t,c.state.popupRef],props:[{role:ne?`dialog`:`presentation`,tabIndex:-1,onFocus(e){let t=ke(e.nativeEvent);m!==`touch`&&(Ae(c.state.listElement,t)||t===e.currentTarget)&&c.state.inputRef.current?.focus()}},ye(h),s],stateAttributesMapping:K}),re=a===void 0?ne?e=>e===`touch`?c.state.popupRef.current:g:!1:a,x;x=o??(ne?void 0:!1);let ae=!ne||_;return(0,H.jsx)(ie,{context:d,disabled:!te,modal:ae,openInteractionType:m,initialFocus:re,returnFocus:x,getInsideElements:()=>[c.state.startDismissRef.current,c.state.endDismissRef.current],children:(0,H.jsxs)(R.Fragment,{children:[b,ae&&(0,H.jsx)(yt,{ref:c.state.endDismissRef})]})})}),Pt=R.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e;return he(`span`,e,{ref:t,props:[{"aria-hidden":!0,children:`▼`},a]})}),Ft=R.createContext(void 0),q=R.createContext(!1);function J(){return R.useContext(q)}var It=R.memo(R.forwardRef(function(e,t){let{render:n,className:r,style:i,value:a=null,index:o,disabled:s=!1,nativeButton:l=!1,...ee}=e,d=R.useRef(!1),f=R.useRef(null),te=ne({index:o,textRef:f,indexGuessBehavior:M.GuessFromOrder}),p=z(),m=J(),{flatFilteredItems:h,hasItems:g}=rt(),v=u(p,B.open),y=u(p,B.selectionMode),re=u(p,B.readOnly),x=u(p,B.virtualized),ie=u(p,B.isItemEqualToValue),ae=y!==`none`,S=o??(x?_(h,a,ie):te.index),C=te.index!==-1,w=u(p,B.id),oe=u(p,B.isActive,S),T=u(p,B.isSelected,a),E=u(p,B.itemProps),se=R.useRef(null),D=w!=null&&C?`${w}-${S}`:void 0,k=T&&ae;b(()=>{if(!C||!x&&o==null)return;let e=p.state.listRef.current;return e[S]=se.current,()=>{delete e[S]}},[C,x,S,o,p]),b(()=>{if(!C||g)return;let e=p.state.valuesRef.current;return e[S]=a,y!==`none`&&p.state.allValuesRef.current.push(a),()=>{delete e[S]}},[C,g,S,a,p,y]),b(()=>{if(!v){d.current=!1;return}if(!C||g)return;let e=p.state.selectedValue,t=Array.isArray(e)?e[e.length-1]:e;O(a,t,ie)&&p.set(`selectedIndex`,S)},[C,g,v,p,S,a,ie]);let{getButtonProps:ce,buttonRef:A}=c({disabled:s,focusableWhenDisabled:!0,native:l,composite:!0}),j={disabled:s,selected:k,highlighted:oe};function le(e){function t(){p.state.handleSelection(e,a)}p.state.submitOnItemClick?(Dt.flushSync(t),p.state.requestSubmit()):t()}let ue={id:D,role:m?`gridcell`:`option`,"aria-selected":ae?k:void 0,tabIndex:void 0,onPointerDownCapture(e){d.current=!0,e.preventDefault()},onMouseDown(e){e.preventDefault()},onClick(e){s||re||le(e.nativeEvent)},onMouseUp(e){let t=d.current;d.current=!1,!(s||re||e.button!==0||t||!oe)&&le(e.nativeEvent)}},N=he(`div`,e,{ref:[A,t,te.ref,se],state:j,props:[E,ue,ee,ce]}),P=R.useMemo(()=>({selected:k,textRef:f}),[k,f]);return(0,H.jsx)(Ft.Provider,{value:P,children:N})})),Lt=R.forwardRef(function(e,t){let{render:n,className:r,style:i,children:a,...o}=e,{filteredItems:s}=rt(),c=z(),l=kt(),ee=s.length===0?a:null;return he(`div`,e,{ref:[t,c.state.emptyRef,l],props:[{children:ee,role:`status`,"aria-live":`polite`,"aria-atomic":!0},o]})}),Rt={...We,...pe},Y=R.forwardRef(function(e,t){let{render:n,className:r,disabled:a=!1,nativeButton:o=!0,keepMounted:s=!1,style:l,...d}=e,{disabled:f}=re(),p=z(),m=u(p,B.selectionMode),h=u(p,B.disabled),ne=u(p,B.readOnly),g=u(p,B.open),_=u(p,B.selectedValue),v=u(p,B.hasSelectionChips),y=it(),b=!1;b=m===`none`?y!==``:m===`single`?_!=null:v;let x=f||h||a,{buttonRef:ie,getButtonProps:ae}=c({native:o,disabled:x}),{mounted:S,transitionStatus:C,setMounted:w}=te(b),oe={disabled:x,visible:b,open:g,transitionStatus:C};ee({open:b,ref:p.state.clearRef,onComplete(){b||w(!1)}});let T=he(`button`,e,{state:oe,ref:[t,ie,p.state.clearRef],props:[{tabIndex:-1,children:`x`,onMouseDown(e){e.preventDefault()},onClick(e){if(x||ne)return;let t=p.state.keyboardActiveRef;p.state.setInputValue(``,i(Se,e.nativeEvent)),m===`none`?p.state.setIndices({activeIndex:null,type:t.current?`keyboard`:`pointer`}):(p.state.setSelectedValue(Array.isArray(_)?[]:null,i(Se,e.nativeEvent)),p.state.setIndices({activeIndex:null,selectedIndex:null,type:t.current?`keyboard`:`pointer`})),p.state.inputRef.current?.focus()}},d,ae],stateAttributesMapping:Rt});return s||S?T:null});export{Nt as a,kt as c,wt as d,xt as f,lt as g,ut as h,Pt as i,Et as l,pt as m,Lt as n,G as o,U as p,It as r,Mt as s,Y as t,Tt as u};
2
+ //# sourceMappingURL=ComboboxClear-CPvB2whi.js.map
@@ -1,2 +1,2 @@
1
- import{a as e,t}from"./react-BUfh6y28.js";import{t as n}from"./jsx-runtime-DJeoFXNw.js";import{Ha as r,Ma as i,No as a,To as o}from"./utils-C5GGWTfe.js";import{d as s}from"./ComboboxClear-B0HJXjbz.js";var c=e(t()),l=c.createContext(void 0);function u(){let e=c.useContext(l);if(e===void 0)throw Error(a(18));return e}var d=e(n()),f=c.forwardRef(function(e,t){let{render:n,className:r,style:i,items:a,...u}=e,[f,p]=c.useState(),m=c.useMemo(()=>({labelId:f,setLabelId:p,items:a}),[f,p,a]),h=o(`div`,e,{ref:t,props:[{role:`group`,"aria-labelledby":f},u]}),g=(0,d.jsx)(l.Provider,{value:m,children:h});return a?(0,d.jsx)(s,{items:a,children:g}):g}),p=c.forwardRef(function(e,t){let{render:n,className:a,style:s,id:c,...l}=e,{setLabelId:d}=u(),f=i(c);return r(()=>(d(f),()=>{d(void 0)}),[f,d]),o(`div`,e,{ref:t,props:[{id:f},l]})});export{f as n,p as t};
2
- //# sourceMappingURL=ComboboxGroupLabel-CMc5xUrd.js.map
1
+ import{a as e,t}from"./react-BUfh6y28.js";import{t as n}from"./jsx-runtime-DJeoFXNw.js";import{Ha as r,Ma as i,No as a,To as o}from"./utils-OWUgXvpr.js";import{d as s}from"./ComboboxClear-CPvB2whi.js";var c=e(t()),l=c.createContext(void 0);function u(){let e=c.useContext(l);if(e===void 0)throw Error(a(18));return e}var d=e(n()),f=c.forwardRef(function(e,t){let{render:n,className:r,style:i,items:a,...u}=e,[f,p]=c.useState(),m=c.useMemo(()=>({labelId:f,setLabelId:p,items:a}),[f,p,a]),h=o(`div`,e,{ref:t,props:[{role:`group`,"aria-labelledby":f},u]}),g=(0,d.jsx)(l.Provider,{value:m,children:h});return a?(0,d.jsx)(s,{items:a,children:g}):g}),p=c.forwardRef(function(e,t){let{render:n,className:a,style:s,id:c,...l}=e,{setLabelId:d}=u(),f=i(c);return r(()=>(d(f),()=>{d(void 0)}),[f,d]),o(`div`,e,{ref:t,props:[{id:f},l]})});export{f as n,p as t};
2
+ //# sourceMappingURL=ComboboxGroupLabel-DN75A_2f.js.map
@@ -1,2 +1,2 @@
1
- import{a as e}from"./react-BUfh6y28.js";import{n as t,t as n}from"./jsx-runtime-DJeoFXNw.js";import{fr as r,t as i}from"./utils-C5GGWTfe.js";import{S as a,d as o,l as s}from"./TooltipViewport-Be_gbUW1.js";import{p as c}from"./toast-BZ96uuab.js";var l=t(),u=e(n(),1);function d(e){let t=(0,l.c)(19),{command:n,className:d,prominent:f}=e,p=f!==void 0&&f,m;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(m={timeout:1500,target:`command`},t[0]=m):m=t[0];let{copyToClipboard:h,isCopied:g}=c(m),_=p?`px-4 py-3.5 text-base`:`px-3 py-2.5 text-sm`,v;t[1]!==d||t[2]!==_?(v=i(`flex items-center justify-between gap-3 rounded-lg border border-border bg-muted/50 font-mono`,_,d),t[1]=d,t[2]=_,t[3]=v):v=t[3];let y;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(y=(0,u.jsx)(`span`,{className:`mr-2 text-muted-foreground`,children:`$`}),t[4]=y):y=t[4];let b;t[5]===n?b=t[6]:(b=(0,u.jsxs)(`span`,{className:`min-w-0 truncate`,children:[y,n]}),t[5]=n,t[6]=b);let x;t[7]!==n||t[8]!==h?(x=()=>h(n,void 0),t[7]=n,t[8]=h,t[9]=x):x=t[9];let S=g?o:a,C;t[10]===S?C=t[11]:(C=(0,u.jsx)(s,{className:`size-3.5`,icon:S}),t[10]=S,t[11]=C);let w;t[12]!==x||t[13]!==C?(w=(0,u.jsx)(r,{size:`icon-xs`,variant:`ghost`,"aria-label":`Copy command`,onClick:x,children:C}),t[12]=x,t[13]=C,t[14]=w):w=t[14];let T;return t[15]!==w||t[16]!==v||t[17]!==b?(T=(0,u.jsxs)(`div`,{className:v,children:[b,w]}),t[15]=w,t[16]=v,t[17]=b,t[18]=T):T=t[18],T}export{d as t};
2
- //# sourceMappingURL=CommandBlock-CluJmhVo.js.map
1
+ import{a as e}from"./react-BUfh6y28.js";import{n as t,t as n}from"./jsx-runtime-DJeoFXNw.js";import{fr as r,t as i}from"./utils-OWUgXvpr.js";import{S as a,d as o,l as s}from"./TooltipViewport-DjveMpIl.js";import{p as c}from"./toast-BYGaCmZu.js";var l=t(),u=e(n(),1);function d(e){let t=(0,l.c)(19),{command:n,className:d,prominent:f}=e,p=f!==void 0&&f,m;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(m={timeout:1500,target:`command`},t[0]=m):m=t[0];let{copyToClipboard:h,isCopied:g}=c(m),_=p?`px-4 py-3.5 text-base`:`px-3 py-2.5 text-sm`,v;t[1]!==d||t[2]!==_?(v=i(`flex items-center justify-between gap-3 rounded-lg border border-border bg-muted/50 font-mono`,_,d),t[1]=d,t[2]=_,t[3]=v):v=t[3];let y;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(y=(0,u.jsx)(`span`,{className:`mr-2 text-muted-foreground`,children:`$`}),t[4]=y):y=t[4];let b;t[5]===n?b=t[6]:(b=(0,u.jsxs)(`span`,{className:`min-w-0 truncate`,children:[y,n]}),t[5]=n,t[6]=b);let x;t[7]!==n||t[8]!==h?(x=()=>h(n,void 0),t[7]=n,t[8]=h,t[9]=x):x=t[9];let S=g?o:a,C;t[10]===S?C=t[11]:(C=(0,u.jsx)(s,{className:`size-3.5`,icon:S}),t[10]=S,t[11]=C);let w;t[12]!==x||t[13]!==C?(w=(0,u.jsx)(r,{size:`icon-xs`,variant:`ghost`,"aria-label":`Copy command`,onClick:x,children:C}),t[12]=x,t[13]=C,t[14]=w):w=t[14];let T;return t[15]!==w||t[16]!==v||t[17]!==b?(T=(0,u.jsxs)(`div`,{className:v,children:[b,w]}),t[15]=w,t[16]=v,t[17]=b,t[18]=T):T=t[18],T}export{d as t};
2
+ //# sourceMappingURL=CommandBlock-DBGDwDRu.js.map
@@ -1,2 +1,2 @@
1
- import{a as e,t}from"./react-BUfh6y28.js";import{t as n}from"./jsx-runtime-DJeoFXNw.js";import{$i as r,$r as i,Gr as a,Hr as o,Ji as s,Kr as c,Lr as l,Oo as u,Pr as d,Qi as ee,To as f,Ua as p,Ur as m,Va as h,Wr as g,Xi as _,Xr as v,Yi as y,Yr as b,Zi as x,Zr as S,ea as C,ei as w,ga as T,jo as E,ko as D,na as O,ni as k,qr as A,ta as j,ti as M}from"./utils-C5GGWTfe.js";var N=e(t());function P(e){return e==null||e.hasAttribute(`disabled`)||e.getAttribute(`aria-disabled`)===`true`}var F=`data-composite-item-active`,I=[];function L(e){let{itemSizes:t,cols:n=1,loopFocus:l=!0,onLoop:u,dense:d=!1,orientation:f=`both`,direction:h,highlightedIndex:S,onHighlightedIndexChange:D,rootRef:F,enableHomeAndEndKeys:L=!1,stopEventPropagation:z=!1,disabledIndices:B,modifierKeys:V=I}=e,[H,U]=N.useState(0),W=n>1,G=N.useRef(null),K=E(G,F),q=N.useRef([]),J=N.useRef(!1),Y=S??H,X=p((e,t=!1)=>{if((D??U)(e),t){let t=q.current[e];k(G.current,t,h,f)}}),Z=p(e=>{if(e.size===0||J.current)return;J.current=!0;let t=Array.from(e.keys()),n=t.find(e=>e?.hasAttribute(`data-composite-item-active`))??null,r=n?t.indexOf(n):-1;r!==-1&&X(r),k(G.current,n,h,f)}),Q=p((e,t,n)=>u?u?.(e,t,n,q):n),$=N.useMemo(()=>({"aria-orientation":f===`both`?void 0:f,ref:K,onFocus(e){let t=G.current,n=T(e.nativeEvent);t&&n!=null&&M(n)&&n.setSelectionRange(0,n.value.length??0)},onKeyDown(e){let p=L?A:m;if(!p.has(e.key)||R(e,V)||!G.current)return;let S=h===`rtl`,E=S?g:a,D={horizontal:E,vertical:o,both:E}[f],k=S?a:g,N={horizontal:k,vertical:c,both:k}[f],F=T(e.nativeEvent);if(F!=null&&M(F)&&!P(F)){let t=F.selectionStart,n=F.selectionEnd,r=F.value??``;if(t==null||e.shiftKey||t!==n||e.key!==N&&t<r.length||e.key!==D&&t>0)return}let I=Y,H=C(q,B),U=r(q,B);if(W){let r=t||Array.from({length:q.current.length},()=>({width:1,height:1})),i=s(r,n,d),a=i.findIndex(e=>e!=null&&!O(q.current,e,B)),o=i.reduce((e,t,n)=>t!=null&&!O(q.current,t,B)?n:e,-1);I=i[ee(i.map(e=>e==null?null:q.current[e]),{event:e,orientation:f,loopFocus:l,onLoop:Q,cols:n,disabledIndices:x([...B||q.current.map((e,t)=>O(q.current,t)?t:void 0),void 0],i),minIndex:a,maxIndex:o,prevIndex:_(Y>U?H:Y,r,i,n,e.key===`ArrowDown`?`bl`:e.key===`ArrowRight`?`tr`:`tl`),rtl:S})]}let K={horizontal:[E],vertical:[o],both:[E,o]}[f],J={horizontal:[k],vertical:[c],both:[k,c]}[f],Z=W?p:{horizontal:L?v:b,vertical:L?w:i,both:p}[f];L&&(e.key===`Home`?I=H:e.key===`End`&&(I=U)),I===Y&&(K.includes(e.key)||J.includes(e.key))&&(l&&I===U&&K.includes(e.key)?(I=H,u&&(I=u(e,Y,I,q))):l&&I===H&&J.includes(e.key)?(I=U,u&&(I=u(e,Y,I,q))):I=y(q.current,{startingIndex:I,decrement:J.includes(e.key),disabledIndices:B})),I!==Y&&!j(q.current,I)&&(z&&e.stopPropagation(),Z.has(e.key)&&e.preventDefault(),X(I,!0),queueMicrotask(()=>{q.current[I]?.focus()}))}}),[n,d,h,B,q,L,Y,W,t,l,u,Q,K,V,X,f,z]);return N.useMemo(()=>({props:$,highlightedIndex:Y,onHighlightedIndexChange:X,elementsRef:q,disabledIndices:B,onMapChange:Z,relayKeyboardEvent:$.onKeyDown}),[$,Y,X,q,B,Z])}function R(e,t){for(let n of S.values())if(!t.includes(n)&&e.getModifierState(n))return!0;return!1}var z=e(n());function B(e){let{render:t,className:n,style:r,refs:i=u,props:a=u,state:o=D,stateAttributesMapping:s,highlightedIndex:c,onHighlightedIndexChange:ee,orientation:p,dense:m,itemSizes:g,loopFocus:_,onLoop:v,cols:y,enableHomeAndEndKeys:b,onMapChange:x,stopEventPropagation:S=!0,rootRef:C,disabledIndices:w,modifierKeys:T,highlightItemOnHover:E=!1,tag:O=`div`,...k}=e,{props:A,highlightedIndex:j,onHighlightedIndexChange:M,elementsRef:P,onMapChange:F,relayKeyboardEvent:I}=L({itemSizes:g,cols:y,loopFocus:_,onLoop:v,dense:m,orientation:p,highlightedIndex:c,onHighlightedIndexChange:ee,rootRef:C,stopEventPropagation:S,enableHomeAndEndKeys:b,direction:l(),disabledIndices:w,modifierKeys:T}),R=f(O,e,{state:o,ref:i,props:[A,...a,k],stateAttributesMapping:s}),B=N.useMemo(()=>({highlightedIndex:j,onHighlightedIndexChange:M,highlightItemOnHover:E,relayKeyboardEvent:I}),[j,M,E,I]);return(0,z.jsx)(h.Provider,{value:B,children:(0,z.jsx)(d,{elementsRef:P,onMapChange:e=>{x?.(e),F(e)},children:R})})}export{F as n,B as t};
2
- //# sourceMappingURL=CompositeRoot-BMHKb-nN.js.map
1
+ import{a as e,t}from"./react-BUfh6y28.js";import{t as n}from"./jsx-runtime-DJeoFXNw.js";import{$i as r,$r as i,Gr as a,Hr as o,Ji as s,Kr as c,Lr as l,Oo as u,Pr as d,Qi as ee,To as f,Ua as p,Ur as m,Va as h,Wr as g,Xi as _,Xr as v,Yi as y,Yr as b,Zi as x,Zr as S,ea as C,ei as w,ga as T,jo as E,ko as D,na as O,ni as k,qr as A,ta as j,ti as M}from"./utils-OWUgXvpr.js";var N=e(t());function P(e){return e==null||e.hasAttribute(`disabled`)||e.getAttribute(`aria-disabled`)===`true`}var F=`data-composite-item-active`,I=[];function L(e){let{itemSizes:t,cols:n=1,loopFocus:l=!0,onLoop:u,dense:d=!1,orientation:f=`both`,direction:h,highlightedIndex:S,onHighlightedIndexChange:D,rootRef:F,enableHomeAndEndKeys:L=!1,stopEventPropagation:z=!1,disabledIndices:B,modifierKeys:V=I}=e,[H,U]=N.useState(0),W=n>1,G=N.useRef(null),K=E(G,F),q=N.useRef([]),J=N.useRef(!1),Y=S??H,X=p((e,t=!1)=>{if((D??U)(e),t){let t=q.current[e];k(G.current,t,h,f)}}),Z=p(e=>{if(e.size===0||J.current)return;J.current=!0;let t=Array.from(e.keys()),n=t.find(e=>e?.hasAttribute(`data-composite-item-active`))??null,r=n?t.indexOf(n):-1;r!==-1&&X(r),k(G.current,n,h,f)}),Q=p((e,t,n)=>u?u?.(e,t,n,q):n),$=N.useMemo(()=>({"aria-orientation":f===`both`?void 0:f,ref:K,onFocus(e){let t=G.current,n=T(e.nativeEvent);t&&n!=null&&M(n)&&n.setSelectionRange(0,n.value.length??0)},onKeyDown(e){let p=L?A:m;if(!p.has(e.key)||R(e,V)||!G.current)return;let S=h===`rtl`,E=S?g:a,D={horizontal:E,vertical:o,both:E}[f],k=S?a:g,N={horizontal:k,vertical:c,both:k}[f],F=T(e.nativeEvent);if(F!=null&&M(F)&&!P(F)){let t=F.selectionStart,n=F.selectionEnd,r=F.value??``;if(t==null||e.shiftKey||t!==n||e.key!==N&&t<r.length||e.key!==D&&t>0)return}let I=Y,H=C(q,B),U=r(q,B);if(W){let r=t||Array.from({length:q.current.length},()=>({width:1,height:1})),i=s(r,n,d),a=i.findIndex(e=>e!=null&&!O(q.current,e,B)),o=i.reduce((e,t,n)=>t!=null&&!O(q.current,t,B)?n:e,-1);I=i[ee(i.map(e=>e==null?null:q.current[e]),{event:e,orientation:f,loopFocus:l,onLoop:Q,cols:n,disabledIndices:x([...B||q.current.map((e,t)=>O(q.current,t)?t:void 0),void 0],i),minIndex:a,maxIndex:o,prevIndex:_(Y>U?H:Y,r,i,n,e.key===`ArrowDown`?`bl`:e.key===`ArrowRight`?`tr`:`tl`),rtl:S})]}let K={horizontal:[E],vertical:[o],both:[E,o]}[f],J={horizontal:[k],vertical:[c],both:[k,c]}[f],Z=W?p:{horizontal:L?v:b,vertical:L?w:i,both:p}[f];L&&(e.key===`Home`?I=H:e.key===`End`&&(I=U)),I===Y&&(K.includes(e.key)||J.includes(e.key))&&(l&&I===U&&K.includes(e.key)?(I=H,u&&(I=u(e,Y,I,q))):l&&I===H&&J.includes(e.key)?(I=U,u&&(I=u(e,Y,I,q))):I=y(q.current,{startingIndex:I,decrement:J.includes(e.key),disabledIndices:B})),I!==Y&&!j(q.current,I)&&(z&&e.stopPropagation(),Z.has(e.key)&&e.preventDefault(),X(I,!0),queueMicrotask(()=>{q.current[I]?.focus()}))}}),[n,d,h,B,q,L,Y,W,t,l,u,Q,K,V,X,f,z]);return N.useMemo(()=>({props:$,highlightedIndex:Y,onHighlightedIndexChange:X,elementsRef:q,disabledIndices:B,onMapChange:Z,relayKeyboardEvent:$.onKeyDown}),[$,Y,X,q,B,Z])}function R(e,t){for(let n of S.values())if(!t.includes(n)&&e.getModifierState(n))return!0;return!1}var z=e(n());function B(e){let{render:t,className:n,style:r,refs:i=u,props:a=u,state:o=D,stateAttributesMapping:s,highlightedIndex:c,onHighlightedIndexChange:ee,orientation:p,dense:m,itemSizes:g,loopFocus:_,onLoop:v,cols:y,enableHomeAndEndKeys:b,onMapChange:x,stopEventPropagation:S=!0,rootRef:C,disabledIndices:w,modifierKeys:T,highlightItemOnHover:E=!1,tag:O=`div`,...k}=e,{props:A,highlightedIndex:j,onHighlightedIndexChange:M,elementsRef:P,onMapChange:F,relayKeyboardEvent:I}=L({itemSizes:g,cols:y,loopFocus:_,onLoop:v,dense:m,orientation:p,highlightedIndex:c,onHighlightedIndexChange:ee,rootRef:C,stopEventPropagation:S,enableHomeAndEndKeys:b,direction:l(),disabledIndices:w,modifierKeys:T}),R=f(O,e,{state:o,ref:i,props:[A,...a,k],stateAttributesMapping:s}),B=N.useMemo(()=>({highlightedIndex:j,onHighlightedIndexChange:M,highlightItemOnHover:E,relayKeyboardEvent:I}),[j,M,E,I]);return(0,z.jsx)(h.Provider,{value:B,children:(0,z.jsx)(d,{elementsRef:P,onMapChange:e=>{x?.(e),F(e)},children:R})})}export{F as n,B as t};
2
+ //# sourceMappingURL=CompositeRoot-Jf3zEGLN.js.map
@@ -1,2 +1,2 @@
1
- import{a as e,t}from"./react-BUfh6y28.js";import{n,t as r}from"./jsx-runtime-DJeoFXNw.js";import{Jx as i,Lb as a,PS as o,bC as s,fr as c,lS as l,mf as u,nv as d,t as f,tv as p}from"./utils-C5GGWTfe.js";import{b as m,n as h}from"./runtime-BVmDVuJ-.js";import{t as g}from"./spinner-BZ5ohCyO.js";import{i as _,n as ee}from"./radio-group-IyWHDcIP.js";import{t as te}from"./input-FUjAUGXY.js";import{t as v}from"./preview-YhZE3kRt.js";import{r as ne,t as re}from"./alert-BOVMKHDy.js";import{t as y}from"./runtimeModeConfig-DFxXOIlV.js";import{t as b}from"./AuthSurfaceShell-CCBOJP5G.js";var x=n(),S=e(t(),1),C=e(r(),1),w={"read-only":{label:`Read only`,description:`Read projects and threads. Cannot start, message or change anything.`,icon:u},...y};function ie(e){return v(new URL(`http://${e}`).hostname)}var T=`Could not reach this environment. Try again.`,E=a(p);function ae(e){return h(m.pipe(l(e),o(e=>typeof e==`object`&&e&&`redirectTo`in e?{kind:`redirect`,url:e.redirectTo}:{kind:`ok`,value:e}),i(e=>s({kind:`error`,message:E(e)?e.message:T})))).catch(()=>({kind:`error`,message:T}))}function oe(){return Object.fromEntries(new URL(window.location.href).searchParams)}function D(e,t){return e.csrfToken!==void 0&&(e.oneClickAccess??[]).includes(t)}function O(){let e=(0,x.c)(71),[t]=(0,S.useState)(oe),n;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(n={status:`loading`},e[0]=n):n=e[0];let[r,i]=(0,S.useState)(n),[a,o]=(0,S.useState)(`read-only`),[s,l]=(0,S.useState)(``),[u,f]=(0,S.useState)(``),[p,m]=(0,S.useState)(null),h,_;e[1]===t?(h=e[2],_=e[3]):(h=()=>{let e=!1;return ae(e=>e.mcpOAuth.approval({payload:t})).then(t=>{e||(t.kind===`redirect`?window.location.replace(t.url):i(t.kind===`error`?{status:`invalid`,message:t.message}:{status:`ready`,details:t.value}))}),()=>{e=!0}},_=[t],e[1]=t,e[2]=h,e[3]=_),(0,S.useEffect)(h,_);let v;e[4]!==a||e[5]!==t||e[6]!==r.details||e[7]!==r.status||e[8]!==s?(v=async e=>{if(r.status!==`ready`)return;m(e),f(``);let{csrfToken:n}=r.details,i=e===`deny`?{_tag:`deny`}:n!==void 0&&D(r.details,a)?{_tag:`browser-session`,access:a,csrfToken:n}:{_tag:`pairing-code`,access:a,code:s.trim()},o=await ae(e=>e.mcpOAuth.decision({payload:{authorization:t,decision:i}}));o.kind===`redirect`?window.location.replace(o.url):(m(null),f(o.kind===`error`?o.message:`The sign-in could not continue.`))},e[4]=a,e[5]=t,e[6]=r.details,e[7]=r.status,e[8]=s,e[9]=v):v=e[9];let y=v;if(r.status===`loading`){let t;return e[10]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,C.jsxs)(b,{children:[(0,C.jsx)(k,{title:`Checking the sign-in request`,description:`One moment while this environment verifies the agent's request.`}),(0,C.jsx)(g,{className:`mt-6`,size:`lg`,tone:`muted`})]}),e[10]=t):t=e[10],t}if(r.status===`invalid`){let t;e[11]===r.message?t=e[12]:(t=(0,C.jsx)(k,{title:`This sign-in cannot continue`,description:r.message}),e[11]=r.message,e[12]=t);let n;e[13]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,C.jsx)(`p`,{className:`mt-4 text-sm text-muted-foreground`,children:`Close this page and start the sign-in again from your agent.`}),e[13]=n):n=e[13];let i;return e[14]===t?i=e[15]:(i=(0,C.jsxs)(b,{children:[t,n]}),e[14]=t,e[15]=i),i}let{details:w}=r,T;e[16]!==a||e[17]!==w?(T=D(w,a),e[16]=a,e[17]=w,e[18]=T):T=e[18];let E=T,O;e[19]!==E||e[20]!==s||e[21]!==p?(O=p===null&&(E||s.trim().length>0),e[19]=E,e[20]=s,e[21]=p,e[22]=O):O=e[22];let A=O,j=`Connect ${w.clientName}`,M;e[23]===w.environmentHost?M=e[24]:(M=(0,C.jsxs)(C.Fragment,{children:[`This agent wants to use the threads in every project on`,` `,(0,C.jsx)(`span`,{className:`font-medium text-foreground`,children:w.environmentHost}),`.`]}),e[23]=w.environmentHost,e[24]=M);let N;e[25]!==j||e[26]!==M?(N=(0,C.jsx)(k,{title:j,description:M}),e[25]=j,e[26]=M,e[27]=N):N=e[27];let P;e[28]===w.redirectHost?P=e[29]:(P=(0,C.jsx)(`p`,{className:`mt-2 text-xs text-muted-foreground`,children:ie(w.redirectHost)?(0,C.jsxs)(C.Fragment,{children:[`The name is chosen by the agent. Approval returns to `,w.redirectHost,` on the computer that opened this page. Only approve a sign-in you just started.`]}):(0,C.jsxs)(C.Fragment,{children:[`The name is chosen by the agent. Approval gives access to whoever runs`,` `,(0,C.jsx)(`span`,{className:`font-medium text-foreground`,children:w.redirectHost}),`. Only approve a sign-in you just started there.`]})}),e[28]=w.redirectHost,e[29]=P);let F;e[30]!==A||e[31]!==y?(F=e=>{e.preventDefault(),A&&y(`approve`)},e[30]=A,e[31]=y,e[32]=F):F=e[32];let I;e[33]===Symbol.for(`react.memo_cache_sentinel`)?(I=(0,C.jsx)(`span`,{id:`connect-agent-access-label`,className:`text-sm font-medium`,children:`What it may do`}),e[33]=I):I=e[33];let L;e[34]===Symbol.for(`react.memo_cache_sentinel`)?(L=e=>o(e),e[34]=L):L=e[34];let R;e[35]===a?R=e[36]:(R=d.literals.map(e=>(0,C.jsx)(se,{access:e,selected:e===a},e)),e[35]=a,e[36]=R);let z;e[37]!==a||e[38]!==R?(z=(0,C.jsx)(ee,{"aria-labelledby":`connect-agent-access-label`,value:a,onValueChange:L,children:R}),e[37]=a,e[38]=R,e[39]=z):z=e[39];let B;e[40]===Symbol.for(`react.memo_cache_sentinel`)?(B=(0,C.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Beyond read only, it can start, message and stop threads, and none of them can run with more than the mode you pick.`}),e[40]=B):B=e[40];let V;e[41]===z?V=e[42]:(V=(0,C.jsxs)(`div`,{className:`space-y-2`,children:[I,z,B]}),e[41]=z,e[42]=V);let H;e[43]!==E||e[44]!==s||e[45]!==p?(H=E?null:(0,C.jsxs)(`div`,{className:`space-y-2`,children:[(0,C.jsx)(`label`,{className:`text-sm font-medium`,htmlFor:`connect-agent-pairing-code`,children:`Pairing code`}),(0,C.jsx)(te,{id:`connect-agent-pairing-code`,autoCapitalize:`none`,autoComplete:`one-time-code`,autoCorrect:`off`,disabled:p!==null,nativeInput:!0,onChange:e=>l(e.currentTarget.value),placeholder:`Paste a one-time pairing code`,spellCheck:!1,value:s}),(0,C.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`Create one in Settings → Connections, or run `,(0,C.jsx)(`code`,{children:`p4c auth pairing create`}),` on this machine.`]})]}),e[43]=E,e[44]=s,e[45]=p,e[46]=H):H=e[46];let U;e[47]===u?U=e[48]:(U=u?(0,C.jsx)(re,{variant:`error`,children:(0,C.jsx)(ne,{children:u})}):null,e[47]=u,e[48]=U);let W=!A,G=p===`approve`?`Approving…`:`Approve`,K;e[49]!==W||e[50]!==G?(K=(0,C.jsx)(c,{disabled:W,type:`submit`,children:G}),e[49]=W,e[50]=G,e[51]=K):K=e[51];let q=p!==null,J;e[52]===y?J=e[53]:(J=()=>void y(`deny`),e[52]=y,e[53]=J);let Y=p===`deny`?`Denying…`:`Deny`,X;e[54]!==q||e[55]!==J||e[56]!==Y?(X=(0,C.jsx)(c,{disabled:q,onClick:J,type:`button`,variant:`outline`,children:Y}),e[54]=q,e[55]=J,e[56]=Y,e[57]=X):X=e[57];let Z;e[58]!==K||e[59]!==X?(Z=(0,C.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[K,X]}),e[58]=K,e[59]=X,e[60]=Z):Z=e[60];let Q;e[61]!==F||e[62]!==V||e[63]!==H||e[64]!==U||e[65]!==Z?(Q=(0,C.jsxs)(`form`,{className:`mt-6 space-y-5`,onSubmit:F,children:[V,H,U,Z]}),e[61]=F,e[62]=V,e[63]=H,e[64]=U,e[65]=Z,e[66]=Q):Q=e[66];let $;return e[67]!==Q||e[68]!==N||e[69]!==P?($=(0,C.jsxs)(b,{children:[N,P,Q]}),e[67]=Q,e[68]=N,e[69]=P,e[70]=$):$=e[70],$}function k(e){let t=(0,x.c)(8),{title:n,description:r}=e,i;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,C.jsx)(`p`,{className:`text-3xs font-semibold tracking-widest text-primary uppercase`,children:`Agent sign-in`}),t[0]=i):i=t[0];let a;t[1]===n?a=t[2]:(a=(0,C.jsx)(`h1`,{className:`mt-2 text-2xl font-semibold tracking-tight sm:text-3xl`,children:n}),t[1]=n,t[2]=a);let o;t[3]===r?o=t[4]:(o=(0,C.jsx)(`p`,{className:`mt-2 text-sm leading-relaxed text-muted-foreground`,children:r}),t[3]=r,t[4]=o);let s;return t[5]!==a||t[6]!==o?(s=(0,C.jsxs)(C.Fragment,{children:[i,a,o]}),t[5]=a,t[6]=o,t[7]=s):s=t[7],s}function se(e){let t=(0,x.c)(19),{access:n,selected:r}=e,{label:i,description:a,icon:o}=w[n],s=r?`border-primary bg-background ring-2 ring-inset ring-primary/25 dark:border-transparent dark:bg-primary/10 dark:ring-1 dark:ring-primary/30`:`border-border bg-background hover:bg-muted/50 dark:border-transparent dark:bg-white/[0.035] dark:hover:bg-accent`,c;t[0]===s?c=t[1]:(c=f(`flex cursor-pointer items-start gap-3 rounded-lg border px-3 py-2.5 text-left outline-none transition-[background-color,border-color,box-shadow]`,`focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-background`,s),t[0]=s,t[1]=c);let l=r?`text-primary`:`text-muted-foreground`,u;t[2]===l?u=t[3]:(u=f(`mt-0.5 size-4 shrink-0`,l),t[2]=l,t[3]=u);let d;t[4]!==o||t[5]!==u?(d=(0,C.jsx)(o,{"aria-hidden":!0,className:u}),t[4]=o,t[5]=u,t[6]=d):d=t[6];let p;t[7]===i?p=t[8]:(p=(0,C.jsx)(`span`,{className:`block text-sm font-medium text-foreground`,children:i}),t[7]=i,t[8]=p);let m;t[9]===a?m=t[10]:(m=(0,C.jsx)(`span`,{className:`block text-xs text-muted-foreground`,children:a}),t[9]=a,t[10]=m);let h;t[11]!==p||t[12]!==m?(h=(0,C.jsxs)(`span`,{className:`min-w-0`,children:[p,m]}),t[11]=p,t[12]=m,t[13]=h):h=t[13];let g;return t[14]!==n||t[15]!==c||t[16]!==d||t[17]!==h?(g=(0,C.jsxs)(_,{value:n,className:c,children:[d,h]}),t[14]=n,t[15]=c,t[16]=d,t[17]=h,t[18]=g):g=t[18],g}export{w as n,O as t};
2
- //# sourceMappingURL=ConnectAgentSurface-CNWdh9ck.js.map
1
+ import{a as e,t}from"./react-BUfh6y28.js";import{n,t as r}from"./jsx-runtime-DJeoFXNw.js";import{Gb as i,HS as a,OC as o,_S as s,cv as c,fr as l,hf as u,lv as d,nS as f,t as p}from"./utils-OWUgXvpr.js";import{b as m,n as h}from"./runtime-CcgzOADx.js";import{t as g}from"./spinner-C64jtA3m.js";import{i as _,n as ee}from"./radio-group-Cb2KobOI.js";import{t as te}from"./input-BGKmQVHf.js";import{t as v}from"./preview-D8H2Itzr.js";import{r as ne,t as re}from"./alert-D0u2-4Zh.js";import{t as y}from"./runtimeModeConfig-DTaQ5JjA.js";import{t as b}from"./AuthSurfaceShell-29ykag3m.js";var x=n(),S=e(t(),1),C=e(r(),1),w={"read-only":{label:`Read only`,description:`Read projects and threads. Cannot start, message or change anything.`,icon:u},...y};function ie(e){return v(new URL(`http://${e}`).hostname)}var T=`Could not reach this environment. Try again.`,E=i(c);function D(e){return h(m.pipe(s(e),a(e=>typeof e==`object`&&e&&`redirectTo`in e?{kind:`redirect`,url:e.redirectTo}:{kind:`ok`,value:e}),f(e=>o({kind:`error`,message:E(e)?e.message:T})))).catch(()=>({kind:`error`,message:T}))}function ae(){return Object.fromEntries(new URL(window.location.href).searchParams)}function oe(e,t){return e.csrfToken!==void 0&&(e.oneClickAccess??[]).includes(t)}function O(){let e=(0,x.c)(71),[t]=(0,S.useState)(ae),n;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(n={status:`loading`},e[0]=n):n=e[0];let[r,i]=(0,S.useState)(n),[a,o]=(0,S.useState)(`read-only`),[s,c]=(0,S.useState)(``),[u,f]=(0,S.useState)(``),[p,m]=(0,S.useState)(null),h,_;e[1]===t?(h=e[2],_=e[3]):(h=()=>{let e=!1;return D(e=>e.mcpOAuth.approval({payload:t})).then(t=>{e||(t.kind===`redirect`?window.location.replace(t.url):i(t.kind===`error`?{status:`invalid`,message:t.message}:{status:`ready`,details:t.value}))}),()=>{e=!0}},_=[t],e[1]=t,e[2]=h,e[3]=_),(0,S.useEffect)(h,_);let v;e[4]!==a||e[5]!==t||e[6]!==r.details||e[7]!==r.status||e[8]!==s?(v=async e=>{if(r.status!==`ready`)return;m(e),f(``);let{csrfToken:n}=r.details,i=e===`deny`?{_tag:`deny`}:n!==void 0&&oe(r.details,a)?{_tag:`browser-session`,access:a,csrfToken:n}:{_tag:`pairing-code`,access:a,code:s.trim()},o=await D(e=>e.mcpOAuth.decision({payload:{authorization:t,decision:i}}));o.kind===`redirect`?window.location.replace(o.url):(m(null),f(o.kind===`error`?o.message:`The sign-in could not continue.`))},e[4]=a,e[5]=t,e[6]=r.details,e[7]=r.status,e[8]=s,e[9]=v):v=e[9];let y=v;if(r.status===`loading`){let t;return e[10]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,C.jsxs)(b,{children:[(0,C.jsx)(k,{title:`Checking the sign-in request`,description:`One moment while this environment verifies the agent's request.`}),(0,C.jsx)(g,{className:`mt-6`,size:`lg`,tone:`muted`})]}),e[10]=t):t=e[10],t}if(r.status===`invalid`){let t;e[11]===r.message?t=e[12]:(t=(0,C.jsx)(k,{title:`This sign-in cannot continue`,description:r.message}),e[11]=r.message,e[12]=t);let n;e[13]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,C.jsx)(`p`,{className:`mt-4 text-sm text-muted-foreground`,children:`Close this page and start the sign-in again from your agent.`}),e[13]=n):n=e[13];let i;return e[14]===t?i=e[15]:(i=(0,C.jsxs)(b,{children:[t,n]}),e[14]=t,e[15]=i),i}let{details:w}=r,T;e[16]!==a||e[17]!==w?(T=oe(w,a),e[16]=a,e[17]=w,e[18]=T):T=e[18];let E=T,O;e[19]!==E||e[20]!==s||e[21]!==p?(O=p===null&&(E||s.trim().length>0),e[19]=E,e[20]=s,e[21]=p,e[22]=O):O=e[22];let A=O,j=`Connect ${w.clientName}`,M;e[23]===w.environmentHost?M=e[24]:(M=(0,C.jsxs)(C.Fragment,{children:[`This agent wants to use the threads in every project on`,` `,(0,C.jsx)(`span`,{className:`font-medium text-foreground`,children:w.environmentHost}),`.`]}),e[23]=w.environmentHost,e[24]=M);let N;e[25]!==j||e[26]!==M?(N=(0,C.jsx)(k,{title:j,description:M}),e[25]=j,e[26]=M,e[27]=N):N=e[27];let P;e[28]===w.redirectHost?P=e[29]:(P=(0,C.jsx)(`p`,{className:`mt-2 text-xs text-muted-foreground`,children:ie(w.redirectHost)?(0,C.jsxs)(C.Fragment,{children:[`The name is chosen by the agent. Approval returns to `,w.redirectHost,` on the computer that opened this page. Only approve a sign-in you just started.`]}):(0,C.jsxs)(C.Fragment,{children:[`The name is chosen by the agent. Approval gives access to whoever runs`,` `,(0,C.jsx)(`span`,{className:`font-medium text-foreground`,children:w.redirectHost}),`. Only approve a sign-in you just started there.`]})}),e[28]=w.redirectHost,e[29]=P);let F;e[30]!==A||e[31]!==y?(F=e=>{e.preventDefault(),A&&y(`approve`)},e[30]=A,e[31]=y,e[32]=F):F=e[32];let I;e[33]===Symbol.for(`react.memo_cache_sentinel`)?(I=(0,C.jsx)(`span`,{id:`connect-agent-access-label`,className:`text-sm font-medium`,children:`What it may do`}),e[33]=I):I=e[33];let L;e[34]===Symbol.for(`react.memo_cache_sentinel`)?(L=e=>o(e),e[34]=L):L=e[34];let R;e[35]===a?R=e[36]:(R=d.literals.map(e=>(0,C.jsx)(se,{access:e,selected:e===a},e)),e[35]=a,e[36]=R);let z;e[37]!==a||e[38]!==R?(z=(0,C.jsx)(ee,{"aria-labelledby":`connect-agent-access-label`,value:a,onValueChange:L,children:R}),e[37]=a,e[38]=R,e[39]=z):z=e[39];let B;e[40]===Symbol.for(`react.memo_cache_sentinel`)?(B=(0,C.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Beyond read only, it can start, message and stop threads, and none of them can run with more than the mode you pick.`}),e[40]=B):B=e[40];let V;e[41]===z?V=e[42]:(V=(0,C.jsxs)(`div`,{className:`space-y-2`,children:[I,z,B]}),e[41]=z,e[42]=V);let H;e[43]!==E||e[44]!==s||e[45]!==p?(H=E?null:(0,C.jsxs)(`div`,{className:`space-y-2`,children:[(0,C.jsx)(`label`,{className:`text-sm font-medium`,htmlFor:`connect-agent-pairing-code`,children:`Pairing code`}),(0,C.jsx)(te,{id:`connect-agent-pairing-code`,autoCapitalize:`none`,autoComplete:`one-time-code`,autoCorrect:`off`,disabled:p!==null,nativeInput:!0,onChange:e=>c(e.currentTarget.value),placeholder:`Paste a one-time pairing code`,spellCheck:!1,value:s}),(0,C.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`Create one in Settings → Connections, or run `,(0,C.jsx)(`code`,{children:`p4c auth pairing create`}),` on this machine.`]})]}),e[43]=E,e[44]=s,e[45]=p,e[46]=H):H=e[46];let U;e[47]===u?U=e[48]:(U=u?(0,C.jsx)(re,{variant:`error`,children:(0,C.jsx)(ne,{children:u})}):null,e[47]=u,e[48]=U);let W=!A,G=p===`approve`?`Approving…`:`Approve`,K;e[49]!==W||e[50]!==G?(K=(0,C.jsx)(l,{disabled:W,type:`submit`,children:G}),e[49]=W,e[50]=G,e[51]=K):K=e[51];let q=p!==null,J;e[52]===y?J=e[53]:(J=()=>void y(`deny`),e[52]=y,e[53]=J);let Y=p===`deny`?`Denying…`:`Deny`,X;e[54]!==q||e[55]!==J||e[56]!==Y?(X=(0,C.jsx)(l,{disabled:q,onClick:J,type:`button`,variant:`outline`,children:Y}),e[54]=q,e[55]=J,e[56]=Y,e[57]=X):X=e[57];let Z;e[58]!==K||e[59]!==X?(Z=(0,C.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[K,X]}),e[58]=K,e[59]=X,e[60]=Z):Z=e[60];let Q;e[61]!==F||e[62]!==V||e[63]!==H||e[64]!==U||e[65]!==Z?(Q=(0,C.jsxs)(`form`,{className:`mt-6 space-y-5`,onSubmit:F,children:[V,H,U,Z]}),e[61]=F,e[62]=V,e[63]=H,e[64]=U,e[65]=Z,e[66]=Q):Q=e[66];let $;return e[67]!==Q||e[68]!==N||e[69]!==P?($=(0,C.jsxs)(b,{children:[N,P,Q]}),e[67]=Q,e[68]=N,e[69]=P,e[70]=$):$=e[70],$}function k(e){let t=(0,x.c)(8),{title:n,description:r}=e,i;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,C.jsx)(`p`,{className:`text-3xs font-semibold tracking-widest text-primary uppercase`,children:`Agent sign-in`}),t[0]=i):i=t[0];let a;t[1]===n?a=t[2]:(a=(0,C.jsx)(`h1`,{className:`mt-2 text-2xl font-semibold tracking-tight sm:text-3xl`,children:n}),t[1]=n,t[2]=a);let o;t[3]===r?o=t[4]:(o=(0,C.jsx)(`p`,{className:`mt-2 text-sm leading-relaxed text-muted-foreground`,children:r}),t[3]=r,t[4]=o);let s;return t[5]!==a||t[6]!==o?(s=(0,C.jsxs)(C.Fragment,{children:[i,a,o]}),t[5]=a,t[6]=o,t[7]=s):s=t[7],s}function se(e){let t=(0,x.c)(19),{access:n,selected:r}=e,{label:i,description:a,icon:o}=w[n],s=r?`border-primary bg-background ring-2 ring-inset ring-primary/25 dark:border-transparent dark:bg-primary/10 dark:ring-1 dark:ring-primary/30`:`border-border bg-background hover:bg-muted/50 dark:border-transparent dark:bg-white/[0.035] dark:hover:bg-accent`,c;t[0]===s?c=t[1]:(c=p(`flex cursor-pointer items-start gap-3 rounded-lg border px-3 py-2.5 text-left outline-none transition-[background-color,border-color,box-shadow]`,`focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-background`,s),t[0]=s,t[1]=c);let l=r?`text-primary`:`text-muted-foreground`,u;t[2]===l?u=t[3]:(u=p(`mt-0.5 size-4 shrink-0`,l),t[2]=l,t[3]=u);let d;t[4]!==o||t[5]!==u?(d=(0,C.jsx)(o,{"aria-hidden":!0,className:u}),t[4]=o,t[5]=u,t[6]=d):d=t[6];let f;t[7]===i?f=t[8]:(f=(0,C.jsx)(`span`,{className:`block text-sm font-medium text-foreground`,children:i}),t[7]=i,t[8]=f);let m;t[9]===a?m=t[10]:(m=(0,C.jsx)(`span`,{className:`block text-xs text-muted-foreground`,children:a}),t[9]=a,t[10]=m);let h;t[11]!==f||t[12]!==m?(h=(0,C.jsxs)(`span`,{className:`min-w-0`,children:[f,m]}),t[11]=f,t[12]=m,t[13]=h):h=t[13];let g;return t[14]!==n||t[15]!==c||t[16]!==d||t[17]!==h?(g=(0,C.jsxs)(_,{value:n,className:c,children:[d,h]}),t[14]=n,t[15]=c,t[16]=d,t[17]=h,t[18]=g):g=t[18],g}export{w as n,O as t};
2
+ //# sourceMappingURL=ConnectAgentSurface-Cv2oB5Cw.js.map
@@ -1,2 +1,2 @@
1
- import{a as e}from"./react-BUfh6y28.js";import{n as t,t as n}from"./jsx-runtime-DJeoFXNw.js";import{t as r}from"./utils-C5GGWTfe.js";import{a as i,n as a,t as o}from"./tooltip-BPiLl1TV.js";var s=t(),c=e(n(),1);function l(e){switch(e){case`connected`:return`bg-success`;case`connecting`:case`reconnecting`:return`bg-warning`;case`error`:return`bg-destructive`;default:return`bg-muted-foreground/40`}}function u(e){return e===`connecting`||e===`reconnecting`?`bg-warning/60 duration-2000`:null}function d(e){let t=(0,s.c)(21),{tooltipText:n,dotClassName:l,pingClassName:u}=e,d;t[0]===u?d=t[1]:(d=u?(0,c.jsx)(`span`,{className:r(`absolute inline-flex h-full w-full animate-status-ping rounded-full`,u)}):null,t[0]=u,t[1]=d);let f;t[2]===l?f=t[3]:(f=r(`relative inline-flex size-2 rounded-full`,l),t[2]=l,t[3]=f);let p;t[4]===f?p=t[5]:(p=(0,c.jsx)(`span`,{className:f}),t[4]=f,t[5]=p);let m;t[6]!==d||t[7]!==p?(m=(0,c.jsxs)(c.Fragment,{children:[d,p]}),t[6]=d,t[7]=p,t[8]=m):m=t[8];let h=m;if(!n){let e;return t[9]===h?e=t[10]:(e=(0,c.jsx)(`span`,{className:`relative flex size-3 shrink-0 items-center justify-center`,children:h}),t[9]=h,t[10]=e),e}let g;t[11]!==h||t[12]!==n?(g=(0,c.jsx)(`button`,{type:`button`,"aria-label":n,className:`relative flex size-3 shrink-0 cursor-help items-center justify-center rounded-full outline-hidden`,children:h}),t[11]=h,t[12]=n,t[13]=g):g=t[13];let _=g,v;t[14]===_?v=t[15]:(v=(0,c.jsx)(i,{render:_}),t[14]=_,t[15]=v);let y;t[16]===n?y=t[17]:(y=(0,c.jsx)(a,{side:`top`,className:`whitespace-pre-wrap`,children:n}),t[16]=n,t[17]=y);let b;return t[18]!==v||t[19]!==y?(b=(0,c.jsxs)(o,{children:[v,y]}),t[18]=v,t[19]=y,t[20]=b):b=t[20],b}export{l as n,u as r,d as t};
2
- //# sourceMappingURL=ConnectionStatusDot-CpmZ8NE5.js.map
1
+ import{a as e}from"./react-BUfh6y28.js";import{n as t,t as n}from"./jsx-runtime-DJeoFXNw.js";import{t as r}from"./utils-OWUgXvpr.js";import{a as i,n as a,t as o}from"./tooltip-BYZIg_IY.js";var s=t(),c=e(n(),1);function l(e){switch(e){case`connected`:return`bg-success`;case`connecting`:case`reconnecting`:return`bg-warning`;case`error`:return`bg-destructive`;default:return`bg-muted-foreground/40`}}function u(e){return e===`connecting`||e===`reconnecting`?`bg-warning/60 duration-2000`:null}function d(e){let t=(0,s.c)(21),{tooltipText:n,dotClassName:l,pingClassName:u}=e,d;t[0]===u?d=t[1]:(d=u?(0,c.jsx)(`span`,{className:r(`absolute inline-flex h-full w-full animate-status-ping rounded-full`,u)}):null,t[0]=u,t[1]=d);let f;t[2]===l?f=t[3]:(f=r(`relative inline-flex size-2 rounded-full`,l),t[2]=l,t[3]=f);let p;t[4]===f?p=t[5]:(p=(0,c.jsx)(`span`,{className:f}),t[4]=f,t[5]=p);let m;t[6]!==d||t[7]!==p?(m=(0,c.jsxs)(c.Fragment,{children:[d,p]}),t[6]=d,t[7]=p,t[8]=m):m=t[8];let h=m;if(!n){let e;return t[9]===h?e=t[10]:(e=(0,c.jsx)(`span`,{className:`relative flex size-3 shrink-0 items-center justify-center`,children:h}),t[9]=h,t[10]=e),e}let g;t[11]!==h||t[12]!==n?(g=(0,c.jsx)(`button`,{type:`button`,"aria-label":n,className:`relative flex size-3 shrink-0 cursor-help items-center justify-center rounded-full outline-hidden`,children:h}),t[11]=h,t[12]=n,t[13]=g):g=t[13];let _=g,v;t[14]===_?v=t[15]:(v=(0,c.jsx)(i,{render:_}),t[14]=_,t[15]=v);let y;t[16]===n?y=t[17]:(y=(0,c.jsx)(a,{side:`top`,className:`whitespace-pre-wrap`,children:n}),t[16]=n,t[17]=y);let b;return t[18]!==v||t[19]!==y?(b=(0,c.jsxs)(o,{children:[v,y]}),t[18]=v,t[19]=y,t[20]=b):b=t[20],b}export{l as n,u as r,d as t};
2
+ //# sourceMappingURL=ConnectionStatusDot-C_9jtSee.js.map
@@ -1,6 +1,6 @@
1
- import{c as e,d as t,g as n,h as r,i,n as a,o,r as s,s as c}from"./6OLKWJ4F-YLfMA9aH.js";import{f as l,g as u,m as d,r as f,s as p,t as m,u as ee,y as h}from"./77XECAW3-CV_JLSeU.js";import{o as te,r as ne}from"./DKTLEL5E-DciMwFJ1.js";import{PeleError as g,_ as re,m as _}from"./lazy-Bs2SFpYS.js";function v(e){return e===32||e>=9&&e<=13||e>127&&/\s/.test(String.fromCharCode(e))}function y(){let e=1/0;return(t,n)=>{if(!t.startsWith(`accDescr`,n))return-1;let r=t.length,i=n+8;for(;i<r&&(t.charCodeAt(i)===32||t.charCodeAt(i)===9);)i++;if(t.charCodeAt(i)===58){for(i++;i<r;i++){let e=t.charCodeAt(i);if(e===10||e===13||e===37&&t.charCodeAt(i+1)===37)break}return i}for(;i<r&&v(t.charCodeAt(i));)i++;if(t.charCodeAt(i)!==123||i>=e)return-1;let a=t.indexOf(`}`,i+1);return a===-1&&(e=i),a+1||-1}}var b=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz`,x={name:`TITLE`,pattern:/title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/y,first:`t`},S={name:`ACC_TITLE`,pattern:/accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/y,first:`a`},C={name:`ACC_DESCR`,pattern:/accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/y,first:`a`,scanner:y};function w(e,t){return{name:e,pattern:e,longer:t}}function T(e,t){return{...i(e),longer:[t]}}function E(e){return{name:e,pattern:/[A-Z_a-z][\w-]*/y,first:b+`_`}}function D(e){return{name:e,pattern:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/y,first:`"'`}}function O(e){return[{name:e+`_WHITESPACE`,pattern:/[\t \r\n]+/y,hidden:!0,first:` \r
1
+ import{c as e,d as t,g as n,h as r,i,n as a,o,r as s,s as c}from"./6OLKWJ4F-CW3F_AM6.js";import{f as l,g as u,m as d,r as f,s as p,t as m,u as ee,y as h}from"./77XECAW3-DxL0AHyZ.js";import{o as te,r as ne}from"./DKTLEL5E-DciMwFJ1.js";import{PeleError as g,_ as re,m as _}from"./lazy-DudfZwDr.js";function v(e){return e===32||e>=9&&e<=13||e>127&&/\s/.test(String.fromCharCode(e))}function y(){let e=1/0;return(t,n)=>{if(!t.startsWith(`accDescr`,n))return-1;let r=t.length,i=n+8;for(;i<r&&(t.charCodeAt(i)===32||t.charCodeAt(i)===9);)i++;if(t.charCodeAt(i)===58){for(i++;i<r;i++){let e=t.charCodeAt(i);if(e===10||e===13||e===37&&t.charCodeAt(i+1)===37)break}return i}for(;i<r&&v(t.charCodeAt(i));)i++;if(t.charCodeAt(i)!==123||i>=e)return-1;let a=t.indexOf(`}`,i+1);return a===-1&&(e=i),a+1||-1}}var b=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz`,x={name:`TITLE`,pattern:/title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/y,first:`t`},S={name:`ACC_TITLE`,pattern:/accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/y,first:`a`},C={name:`ACC_DESCR`,pattern:/accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/y,first:`a`,scanner:y};function w(e,t){return{name:e,pattern:e,longer:t}}function T(e,t){return{...i(e),longer:[t]}}function E(e){return{name:e,pattern:/[A-Z_a-z][\w-]*/y,first:b+`_`}}function D(e){return{name:e,pattern:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/y,first:`"'`}}function O(e){return[{name:e+`_WHITESPACE`,pattern:/[\t \r\n]+/y,hidden:!0,first:` \r
2
2
  `},{...s,name:e+`_YAML`,first:`-`},{...o,name:e+`_DIRECTIVE`,first:` %`},{...c,name:e+`_SINGLE_LINE_COMMENT`,first:` %`}]}function k(e){if(!e.includes(`\\`))return e.slice(1,-1);let t=e.length-1,n=``;for(let r=1;r<t;r++){let i=e[r];i===`\\`&&r+1<t?(i=e[++r],n+=i===`n`?`
3
3
  `:i===`r`?`\r`:i===`t`?` `:i):n+=i}return n}function A(i,o,s,c,l,u){let d=new r(a(i,o,`railroad`),o,`railroad`),f={$type:s,rules:[]};for(d.expect(0);;){let r=d.kind;if(r===c){let e=t(d.take()),n=e[0];f.title=(n===`"`||n===`'`)&&e.endsWith(n)?l(e):e}else if(r===c+1)f.accTitle=n(d.take());else if(r===c+2)f.accDescr=e(d.take());else break}for(;d.kind!==-1;)f.rules.push(u(d));return f}var ie=[];function j(e){let t=e,n=t.element??t.primary??t.suffix,r=t.alternatives??t.elements??(n?[n]:ie);if(t.base){r=[t.base];for(let e of t.postfixes)e.except&&r.push(e.except)}return r}var M=e=>({type:`terminal`,value:e}),N=e=>({type:`nonterminal`,name:e}),P=e=>({type:`special`,text:e}),F=e=>({type:`optional`,element:e}),I=(e,t,n=1/0)=>({type:`repetition`,element:e,min:t,max:n});function L(e){return e.length===1?e[0]:{type:`sequence`,elements:e}}function R(e){return e.length===1?e[0]:{type:`choice`,alternatives:e}}function z(e,t){return e.rules.map(e=>({name:e.name,definition:B(e.definition,j,t)}))}function B(e,t,n){let r=[e],i=[t(e)],a=[[]];for(;;){let e=r.length-1,o=a[e];if(o.length<i[e].length){let n=i[e][o.length];r.push(n),i.push(t(n)),a.push([])}else{let t=n(r[e],o);if(e===0)return t;r.pop(),i.pop(),a.pop(),a[e-1].push(t)}}}var V=`0123456789`,H={name:`ABNF_RULENAME`,pattern:/[A-Za-z][A-Za-z0-9-]*/y,first:b},U={name:`ABNF_COMMENT`,pattern:/;[^\n\r]*/y,hidden:!0,first:`;`},W=[T(`railroad-abnf-beta`,H),w(`=`),w(`;`,[U]),w(`/`),w(`(`),w(`)`),w(`[`),w(`]`),x,S,C,H,{name:`ABNF_STRING`,pattern:/"[^"]*"/y,first:`"`},{name:`ABNF_NUMVAL`,pattern:/%[xXdDbB][0-9A-Fa-f]+(?:-[0-9A-Fa-f]+|\.[0-9A-Fa-f]+)*/y,first:`%`},{name:`ABNF_REPEAT`,pattern:/[0-9]*\*[0-9]*/y,first:V+`*`},{name:`ABNF_EXACT_REPEAT`,pattern:/[0-9]+/y,first:V},...O(`ABNF`),U];function G(e,t,n,r){let i={$type:`AbnfConcatenation`,elements:[]};return t.alternatives.push(i),{alternation:t,concatenation:i,node:e,close:n,repeat:r}}function ae(e){let t=[],n=G(void 0,{$type:`AbnfAlternation`,alternatives:[]},-2,void 0);for(;;){let r=e.kind===14||e.kind===15?e.take():void 0,i,a=e.kind;switch(a){case 12:i={$type:`AbnfStringLiteral`,value:e.take().slice(1,-1)};break;case 13:i={$type:`AbnfNumVal`,value:e.take()};break;case 11:i={$type:`AbnfRuleName`,name:e.take()};break;case 4:case 6:{e.i++;let i={$type:`AbnfAlternation`,alternatives:[]};t.push(n),n=G({$type:a===4?`AbnfGroup`:`AbnfOptionalGroup`,element:i},i,a+1,r);continue}default:e.fail(`a string, a number, a name, or an opening bracket`)}for(;;){n.concatenation.elements.push(r===void 0?{$type:`AbnfElement`,primary:i}:{$type:`AbnfElement`,repeat:r,primary:i});let a=e.kind;if(a===n.close)e.i++,i=n.node,r=n.repeat,n=t.pop();else{if(a===3)e.i++,n.concatenation={$type:`AbnfConcatenation`,elements:[]},n.alternation.alternatives.push(n.concatenation);else if(a!==12&&a!==13&&a!==11&&a!==4&&a!==6&&a!==14&&a!==15){if(t.length===0)return n.alternation;e.fail(`token of type '${W[n.close].name}'`)}break}}}}function oe(e){return A(e,W,`RailroadAbnf`,8,e=>e.slice(1,-1),e=>{let t=e.expect(11);e.expect(1);let n=ae(e);return e.expect(2),{$type:`AbnfRule`,name:t,definition:n}})}function se(e,t){switch(e.$type){case`AbnfAlternation`:return R(t);case`AbnfConcatenation`:return L(t);case`AbnfElement`:{let n=e.repeat;if(!n)return t[0];let r=n.indexOf(`*`),i=r===-1,a=r>0||i?parseInt(n,10):0,o=i?a:r<n.length-1?parseInt(n.slice(r+1),10):1/0;return a===0&&o===1?F(t[0]):I(t[0],a,o)}case`AbnfStringLiteral`:case`AbnfNumVal`:return M(e.value);case`AbnfRuleName`:return N(e.name);case`AbnfGroup`:return t[0];case`AbnfOptionalGroup`:return F(t[0])}}var ce=e=>z(e,se);function le(e,t){if(e.charCodeAt(t)!==63)return-1;let n=!1;for(let r=t+1;r<e.length;r++){let t=e.charCodeAt(r);if(t===63)return n?r+1:-1;if(t===59)return-1;n||=!v(t)}return-1}var ue=E(`EBNF_ID`),de={name:`EBNF_SPECIAL_SEQUENCE`,pattern:/\?(?=[^?;]*[^?\s;][^?;]*\?)[^?;]*\?/y,first:`?`,scanner:()=>le},fe=O(`EBNF`),pe={name:`EBNF_ISO_COMMENT`,pattern:/\(\*[\s\S]*?\*\)/y,hidden:!0,first:`(`,opener:/\(\*/y},me=[T(`railroad-ebnf-beta`,ue),w(`::=`),w(`=`),w(`;`),w(`|`),w(`,`),w(`(`,[pe]),w(`)`),w(`[`),w(`]`),w(`{`),w(`}`),w(`?`,[de]),w(`*`),w(`+`),w(`-`,[fe[1]]),x,S,C,ue,D(`EBNF_STRING`),de,...fe,{name:`EBNF_BLOCK_COMMENT`,pattern:/\/\*[\s\S]*?\*\//y,hidden:!0,first:`/`,opener:/\/\*/y},pe];function he(e,t,n,r){let i={$type:`EbnfSequence`,elements:[]};return t.alternatives.push(i),{choice:t,sequence:i,term:void 0,node:e,close:n,except:r}}var ge=[`EbnfGroup`,`EbnfOptional`,`EbnfRepetition`];function _e(e){let t=[],n=he(void 0,{$type:`EbnfChoice`,alternatives:[]},-2,!1),r=!1;for(;;){let i,a=e.kind;switch(a){case 20:i={$type:`EbnfTerminal`,value:k(e.take())};break;case 19:i={$type:`EbnfNonTerminal`,name:e.take()};break;case 21:i={$type:`EbnfSpecial`,text:e.take().slice(1,-1).trim()};break;case 6:case 8:case 10:{e.i++;let i={$type:`EbnfChoice`,alternatives:[]};t.push(n),n=he({$type:ge[a-6>>1],element:i},i,a+1,r),r=!1;continue}default:e.fail(`a terminal, a name, or an opening bracket`)}for(;;){r?(n.term.postfixes.push({$type:`EbnfExceptionPostfix`,except:i}),r=!1):(n.term={$type:`EbnfTerm`,base:i,postfixes:[]},n.sequence.elements.push(n.term));let a=n.term.postfixes;for(;;){let t=e.kind;if(t===12)a.push({$type:`EbnfOptionalPostfix`,operator:e.take()});else if(t===13)a.push({$type:`EbnfZeroOrMorePostfix`,operator:e.take()});else if(t===14)a.push({$type:`EbnfOneOrMorePostfix`,operator:e.take()});else break}let o=e.kind;if(o===n.close)e.i++,i=n.node,r=n.except,n=t.pop();else{if(o===15)e.i++,r=!0;else if(o===5)e.i++;else if(o===4)e.i++,n.sequence={$type:`EbnfSequence`,elements:[]},n.choice.alternatives.push(n.sequence);else if(o!==20&&o!==19&&o!==21&&o!==6&&o!==8&&o!==10){if(t.length===0)return n.choice;e.fail(`token of type '${me[n.close].name}'`)}break}}}}function ve(e){return A(e,me,`RailroadEbnf`,16,k,e=>{let t=e.expect(19);e.accept(2)||e.expect(1);let n={$type:`EbnfRule`,name:t,definition:_e(e)};return e.expect(3),n})}function ye(e,t){switch(e.$type){case`EbnfChoice`:return R(t);case`EbnfSequence`:return L(t);case`EbnfTerm`:{let n=t[0],r=1;for(let i of e.postfixes)n=i.$type===`EbnfOptionalPostfix`?F(n):i.$type===`EbnfExceptionPostfix`?{type:`sequence`,elements:[n,M(`-`),t[r++]]}:I(n,+(i.$type===`EbnfOneOrMorePostfix`));return n}case`EbnfTerminal`:return M(e.value);case`EbnfNonTerminal`:return N(e.name);case`EbnfSpecial`:return P(e.text);case`EbnfGroup`:return t[0];case`EbnfOptional`:return F(t[0]);case`EbnfRepetition`:return I(t[0],0)}}var be=e=>z(e,ye),K=E(`RR_ID`),q=e=>w(e,[K]),xe=[T(`railroad-beta`,K),q(`nonterminal`),q(`zeroOrMore`),q(`oneOrMore`),q(`sequence`),q(`optional`),q(`terminal`),q(`special`),q(`choice`),w(`=`),w(`;`),w(`(`),w(`,`),w(`)`),x,S,C,K,D(`RR_STRING`),...O(`RR`),{name:`RR_BLOCK_COMMENT`,pattern:/\/\*[\s\S]*?\*\//y,hidden:!0,first:`/`,opener:/\/\*/y}];function J(e){e.i++,e.expect(11);let t=k(e.expect(18));return e.expect(13),t}function Se(e){return{$type:e,element:void 0}}function Ce(e){let t=[];for(;;){let n;switch(e.kind){case 6:n={$type:`RailroadTerminalExpr`,value:J(e)};break;case 1:n={$type:`RailroadNonTerminalExpr`,name:J(e)};break;case 7:n={$type:`RailroadSpecialExpr`,text:J(e)};break;case 4:n={$type:`RailroadSequenceExpr`,elements:[]};break;case 8:n={$type:`RailroadChoiceExpr`,alternatives:[]};break;case 5:n=Se(`RailroadOptionalExpr`);break;case 3:n=Se(`RailroadOneOrMoreExpr`);break;case 2:n=Se(`RailroadZeroOrMoreExpr`);break;default:e.fail(`an expression`)}if(`elements`in n||`alternatives`in n||`element`in n)e.i++,e.expect(11),t.push(n);else for(;;){let r=t[t.length-1];if(r===void 0)return n;if(`element`in r)r.element=n;else if((`elements`in r?r.elements:r.alternatives).push(n),e.accept(12))break;e.expect(13),t.pop(),n=r}}}function we(e){return A(e,xe,`Railroad`,14,k,e=>{let t=e.expect(17);e.expect(9);let n=Ce(e);return e.expect(10),{$type:`RailroadRule`,name:t,definition:n}})}function Te(e,t){switch(e.$type){case`RailroadTerminalExpr`:return M(e.value);case`RailroadNonTerminalExpr`:return N(e.name);case`RailroadSpecialExpr`:return P(e.text);case`RailroadSequenceExpr`:return L(t);case`RailroadChoiceExpr`:return R(t);case`RailroadOptionalExpr`:return F(t[0]);default:return I(t[0],+(e.$type===`RailroadOneOrMoreExpr`))}}var Ee=e=>z(e,Te),De=E(`PEG_ID`),Oe=[T(`railroad-peg-beta`,De),w(`<-`),w(`;`),w(`/`),w(`&`),w(`!`),w(`?`),w(`*`),w(`+`),w(`(`),w(`)`),w(`.`),x,S,C,De,D(`PEG_STRING`),...O(`PEG`),{name:`PEG_LINE_COMMENT`,pattern:/#[^\n\r]*/y,hidden:!0,first:`#`}];function ke(e,t,n){let r={$type:`PegSequence`,elements:[]};return t.alternatives.push(r),{choice:t,sequence:r,node:e,operator:n}}function Ae(e){let t=[],n=ke(void 0,{$type:`PegOrderedChoice`,alternatives:[]},void 0);for(;;){let r=e.kind===4||e.kind===5?e.take():void 0,i;switch(e.kind){case 16:i={$type:`PegLiteral`,value:k(e.take())};break;case 15:i={$type:`PegIdentifier`,name:e.take()};break;case 11:i={$type:`PegAny`,dot:e.take()};break;case 9:{e.i++;let i={$type:`PegOrderedChoice`,alternatives:[]};t.push(n),n=ke({$type:`PegGroup`,element:i},i,r);continue}default:e.fail(`a literal, a name, a dot, or an opening parenthesis`)}for(;;){let a={$type:`PegSuffix`,primary:i};(e.kind===6||e.kind===7||e.kind===8)&&(a.operator=e.take()),n.sequence.elements.push(r===void 0?{$type:`PegPrefix`,suffix:a}:{$type:`PegPrefix`,operator:r,suffix:a});let o=e.kind;if(o===10&&t.length>0)e.i++,i=n.node,r=n.operator,n=t.pop();else{if(o===3)e.i++,n.sequence={$type:`PegSequence`,elements:[]},n.choice.alternatives.push(n.sequence);else if(o!==4&&o!==5&&o!==16&&o!==15&&o!==11&&o!==9){if(t.length===0)return n.choice;e.fail(`token of type ')'`)}break}}}}function je(e){return A(e,Oe,`RailroadPeg`,12,k,e=>{let t=e.expect(15);e.expect(1);let n={$type:`PegRule`,name:t,definition:Ae(e)};return e.expect(2),n})}function Me(e){switch(e.type){case`terminal`:return`"${e.value}"`;case`nonterminal`:return e.name;case`special`:return e.text;default:return`(...)`}}function Ne(e,t){let n=t[0];switch(e.$type){case`PegOrderedChoice`:return R(t);case`PegSequence`:return L(t);case`PegPrefix`:return e.operator?P(e.operator+Me(n)):n;case`PegSuffix`:return e.operator?e.operator===`?`?F(n):I(n,+(e.operator===`+`)):n;case`PegLiteral`:return M(e.value);case`PegIdentifier`:return N(e.name);case`PegAny`:return P(e.dot);case`PegGroup`:return n}}var Pe=e=>z(e,Ne),Fe=class{type=`railroad`;notation=`railroad`;title;accTitle;accDescr;rules=[];byName=new Map;setTitle(e){this.title=e}setAccTitle(e){this.accTitle=e.replace(/^\s+/g,``)}setAccDescription(e){this.accDescr=e.replace(/\n\s+/g,`
4
4
  `)}addRule(e){this.rules.push(e),this.byName.set(e.name,e)}getRule(e){return this.byName.get(e)}},Ie=/^\s*railroad-(ebnf-|abnf-|peg-)?beta/i;function Le(e){let t=Ie.exec(e);if(t===null)return;let n=t[1]?.toLowerCase();return n===`ebnf-`?`ebnf`:n===`abnf-`?`abnf`:n===`peg-`?`peg`:`railroad`}function Re(e,t){switch(t){case`ebnf`:{let t=ve(e);return[t,be(t)]}case`abnf`:{let t=oe(e);return[t,ce(t)]}case`peg`:{let t=je(e);return[t,Pe(t)]}default:{let t=we(e);return[t,Ee(t)]}}}function ze(e,t,n){let[r,i]=Re(t,n);e.notation=n,r.accDescr&&e.setAccDescription(r.accDescr),r.accTitle&&e.setAccTitle(r.accTitle),r.title&&e.setTitle(r.title);for(let t of i)e.addRule(t)}function Be(e,t){let n=Le(e);if(n===void 0)throw new g(`No railroad diagram keyword found.`,`syntax`,{type:`railroad`});let r=new Fe;return t&&(r.title=t),ze(r,e,n),r}var Ve=12,He=6,Ue=18,Y=12,X=7;function Z(e,t,n,r){let i=e.railroad?.[t];return typeof i==`number`&&i>=0?Math.min(i,r):n}var We=/[\n\r\t]/g;function Q(e){return(e.includes(`¶ß`)?_(e.replace(/&/g,`&amp;`)):e).replace(We,e=>e===`
5
5
  `?`\\n`:e===`\r`?`\\r`:`\\t`)}function $(e,t){for(let n=t,r=e.length-1;n<r;n++,r--){let t=e[n];e[n]=e[r],e[r]=t}}function Ge(e){return Math.ceil(e/2)*2}function Ke(e,t,n,r,i){let a=i.height/2;return{kind:e,width:Math.max(Ge(i.measurer.width(t,i.size,r)+2*i.padding),i.height),up:a,down:a,kids:ie,text:t,id:n,reach:0}}function qe(e,t){if(t===1/0&&e<=1)return``;let n=e=>Number.isFinite(e)?String(e):`∞`;return e===t?n(e)+`×`:t===1/0?`≥`+n(e)+`×`:e===0?`≤`+n(t)+`×`:n(e)+`–`+n(t)+`×`}function Je(e,t,n,r){return Math.max(e+t.down+r.sep+n.up,2*r.arc)}function Ye(e,t){let n=Math.max(e.up+t.sep,2*t.arc);return{kind:5,width:e.width+4*t.arc,up:n,down:e.down,kids:[e],text:``,id:``,reach:n}}function Xe(e,t,n=1/0){let r=new Map,i=[[e,n]];for(let e=0;n!==1/0&&e<i.length;e++){let[n,a]=i[e];r.set(n,a);let o=n.type===`choice`||n.type===`optional`?4*t.arc:n.type===`repetition`?(n.min===0?6:2)*t.arc:n.type===`sequence`?6*t.arc:0;for(let e of j(n))i.push([e,Math.max(40,a-o)])}return B(e,j,(e,n)=>{let i=r.get(e)??1/0;switch(e.type){case`terminal`:{let n=Q(e.value);return Ke(0,/^ +$/.test(n)?`␣`.repeat(n.length):n,``,4,t)}case`nonterminal`:return Ke(1,Q(e.name),e.name,0,t);case`special`:return Ke(2,`? `+Q(e.text)+` ?`,``,2,t);case`sequence`:{let e=Math.max(0,n.length-1)*t.gap,r=0,a=0;for(let t of n)e+=t.width,r=Math.max(r,t.up),a=Math.max(a,t.down);let o={kind:3,width:e,up:r,down:a,kids:n,text:``,id:``,reach:0};if(e<=i||n.length<2)return o;let s=[],c=[],l=0,u=()=>{let e=0,t=0;for(let n of c)e=Math.max(e,n.up),t=Math.max(t,n.down);s.push({kind:3,width:l,up:e,down:t,kids:c,text:``,id:``,reach:0}),c=[],l=0};for(let e of n)c.length&&l+t.gap+e.width>Math.max(40,i-6*t.arc)&&u(),l+=(c.length?t.gap:0)+e.width,c.push(e);if(u(),s.length<2)return o;let d=0,f=0;for(let e=0;e<s.length;e++)d=Math.max(d,s[e].width),e&&(f+=s[e-1].down+Math.max(t.sep,2*t.arc)+s[e].up);return{kind:7,width:d+6*t.arc,up:s[0].up,down:f+s[s.length-1].down,kids:s,text:``,id:``,reach:0}}case`choice`:{let e=0,r=0;for(let i=0;i<n.length;i++)e=Math.max(e,n[i].width),i>0&&(r=Je(r,n[i-1],n[i],t));let i=n[n.length-1];return{kind:4,width:e+4*t.arc,up:n.length>0?n[0].up:0,down:i?r+i.down:0,kids:n,text:``,id:``,reach:0}}case`optional`:return Ye(n[0],t);case`repetition`:{let{min:r,max:i}=e,a=n[0];if(r===1&&i===1)return a;let o=qe(r,i),s=Math.max(a.down+t.sep,2*t.arc),c=o===``?0:Ge(t.measurer.width(o,Y,0)),l={kind:6,width:Math.max(a.width,c)+2*t.arc,up:a.up,down:s+(o===``?X/2+1:Y+6),kids:[a],text:o,id:``,reach:s};return r===0?Ye(l,t):l}}})}function Ze(e,t,n){return te(n,r=>Qe(e,t,n,r))}function Qe(e,t,n,r){let i=n.fontSize??16,a=Z(t,`fontSize`,0,200),o=a||Math.round(i*.875),s=a||i,c=Z(t,`padding`,-1,200),te=Math.round(o*1.5),g={measurer:n.measurer??re(n.fontFamily,n.fontFamilyMono),size:o,padding:c<0?12:c,height:Ge(te+(c<0?9:2*c)),gap:Math.min(Z(t,`horizontalSeparation`,16,500),r?12:1/0),sep:Z(t,`verticalSeparation`,10,500),arc:Math.min(Z(t,`arcRadius`,10,200),r?6:1/0)},_=t.railroad?.showMarkers===!1?0:Z(t,`markerRadius`,4,50),v=Z(t,`strokeWidth`,0,20),y=v>0?` stroke-width="${l(v)}"`:``,b=n.padding??8,{arc:x}=g,S=l(x),C=(e,t,n)=>`a${S},${S} 0 0 ${e} ${t}${S},${n}${S}`,w=C(1,``,``),T=C(0,``,``),E=C(0,``,`-`),D=C(1,``,`-`),O=C(0,`-`,``),k=C(0,`-`,`-`),A=p(e.title,!1,g.measurer,i,r?ne(n):4e3,1),ie=A.height>0?A.height+16:0,j=Math.round(s*1.5),M=o*.35,N=g.height/2,P=``,F=``,I=``,L=(e,t,n)=>{n>e&&(P+=`M${l(e)},${l(t)}H${l(n)}`)},R=(e,t,n)=>{let r=[e],i=[t,n];for(;r.length>0;){let e=r.pop(),t=i.pop(),n=i.pop(),a=e.kids,o=n+e.width;switch(e.kind){case 3:{let e=o;for(let n=a.length-1;n>=0;n--)e-=a[n].width,r.push(a[n]),i.push(e,t),n>0&&L(e-g.gap,t,e),e-=g.gap;break}case 7:{let e=n+2*x,s=r.length,c=0;L(n,t,e);for(let s=0;s<a.length;s++){let u=a[s],d=t+c;if(r.push(u),i.push(d,e),s+1<a.length){let r=a[s+1],i=c+u.down+Math.max(g.sep,2*x)+r.up,f=t+c+u.down+Math.max(g.sep,2*x)/2;P+=`M${l(e+u.width)},${l(d)}H${l(o-2*x)}V${l(f)}H${l(n+x)}V${l(t+i)}H${l(e)}`,F+=`M${l(e-X)},${l(t+i-X/2)}l${X},${X/2}l${-X},${X/2}z`,c=i}else P+=`M${l(e+u.width)},${l(d)}H${l(o-x)}V${l(t)}H${l(o)}`}$(r,s),$(i,2*s);break}case 4:{let s=e.width-4*x,c=n+x,u=o-x,d=r.length,f=0;for(let e=0;e<a.length;e++){let d=a[e];e>0&&(f=Je(f,a[e-1],d,g));let p=t+f,m=n+2*x+(s-d.width)/2,ee=e===a.length-1;e===0?(L(n,t,m),L(m+d.width,t,o)):P+=(ee?`M${l(n)},${l(t)}${w}V${l(p-x)}`:`M${l(c)},${l(p-x)}`)+T+(m>c+x?`H${l(m)}`:``)+`M${l(m+d.width)},${l(p)}`+(m>c+x?`H${l(u-x)}`:``)+E+(ee?`V${l(t+x)}${D}`:``),r.push(d),i.push(p,m)}$(r,d),$(i,2*d);break}case 5:{let s=a[0],c=n+2*x;L(n,t,c),L(c+s.width,t,o),P+=`M${l(n)},${l(t)}${E}V${l(t-e.reach+x)}${D}H${l(o-2*x)}${w}V${l(t-x)}${T}`,r.push(s),i.push(c,t);break}case 6:{let s=a[0],c=n+(e.width-s.width)/2,u=t+e.reach,d=n+e.width/2;L(n,t,c),L(c+s.width,t,o),P+=`M${l(n+x)},${l(t)}${O}V${l(u-x)}${T}H${l(o-x)}${E}V${l(t+x)}${k}`,F+=`M${l(d-X/2)},${l(u)}l${X},${-X/2}v${X}z`,e.text!==``&&(I+=`<text class="pele-edge-label pele-count" x="${l(d)}" y="${l(u+Y+3)}" font-size="${Y}" fill="var(--_m)">${h(e.text)}</text>`),r.push(s),i.push(c,t);break}default:{let r=e.text,i=r.startsWith(` `)||r.endsWith(` `)||r.includes(` `)?` xml:space="preserve"`:``,a=`<rect x="${l(n)}" y="${l(t-N)}" width="${l(e.width)}" height="${l(g.height)}"`,o=`<text x="${l(n+e.width/2)}" y="${l(t+M)}"${i}`;e.kind===0?I+=`<g class="pele-node pele-terminal">${a} rx="${l(N)}" fill="var(--_s)" stroke="var(--_b)"${y}/>${o} font-family="${ee}">${h(r)}</text></g>`:e.kind===1?I+=`<g class="pele-node pele-nonterminal" data-id="${f(e.id)}">${a} fill="var(--_bg)" stroke="var(--_b)"${y}${d}/>${o}>${h(r)}</text></g>`:I+=`<g class="pele-node pele-special">${a} fill="var(--_bg)" stroke="var(--_b)" stroke-dasharray="4 3"${y}${d}/>${o} font-style="italic"><tspan fill="var(--_m)">? </tspan>${h(r.slice(2,-2))}<tspan fill="var(--_m)"> ?</tspan></text></g>`}}}},z=``,B=A.width,V=b+ie,H=b+A.height;for(let t of e.rules){let e=Xe(t.definition,g,r?Math.max(80,(n.maxWidth??320)-2*b-4*_-2*Ve-1):1/0),i=Q(t.name),a=V+j+He+e.up,o=b+2*_,c=o+Ve,u=c+e.width+Ve;P=``,F=``,I=``,L(o,a,c),L(c+e.width,a,u),R(e,c,a);let d=_>0?`<circle class="pele-marker pele-start" cx="${l(b+_)}" cy="${l(a)}" r="${l(_)}" fill="var(--_l)"/><circle class="pele-marker pele-end" cx="${l(u+_)}" cy="${l(a)}" r="${l(_)}" fill="var(--_l)"/>`:``;z+=`<g class="pele-rule" data-id="${f(t.name)}"><text class="pele-rule-name" x="${l(b)}" y="${l(V+j/2+s*.35)}" font-size="${l(s)}" font-weight="var(--_hw)" text-anchor="start">${h(i)}</text><path class="pele-edge pele-track" d="${P}" fill="none" stroke="var(--_l)"${y}/>`+(F?`<path class="pele-marker" d="${F}" fill="var(--_l)"/>`:``)+d+I+`</g>`,B=Math.max(B,u+2*_-b,g.measurer.width(i,s,1)),H=a+e.down,V=H+g.sep+Ue}let U=Math.ceil(B+2*b),W=Math.ceil(H+b),G=m(A,U/2,b+A.height/2,` class="pele-title" font-weight="var(--_tw)"`)+(z?`<g class="pele-rules" transform="translate(0.5,0.5)" font-size="${l(o)}" text-anchor="middle">${z}</g>`:``);return{svg:u(`railroad`,U,W,i,n,e,G),width:U,height:W,links:[]}}var $e={type:`railroad`,parse:(e,t,n)=>Be(e,n),render:Ze};export{$e as railroad};
6
- //# sourceMappingURL=DRLTVNUE-Dttc5MrD.js.map
6
+ //# sourceMappingURL=DRLTVNUE-CftE6Aa3.js.map
@@ -1,6 +1,6 @@
1
- import{_ as e,c as t,f as n,g as r,h as i,i as a,m as o,n as s,r as c,s as l,t as u,v as d,y as f}from"./77XECAW3-CV_JLSeU.js";import{r as p}from"./DKTLEL5E-DciMwFJ1.js";import{t as m}from"./TSHNXIZL-BKUmF3Cu.js";import{i as h,o as ee,t as te}from"./5N7A7DKN-CFgZoUw5.js";import{n as ne,r as g,t as _}from"./CXAC5362-0Zr5tv4C.js";import{PeleError as v,_ as re,g as y,n as b}from"./lazy-Bs2SFpYS.js";var x=class{type=`kanban`;title;sections=[];getType=_;last;sectionLevel=0;misplaced;addNode(e,t,n,r,i){let a={id:t,level:e,label:n};if(i!==void 0){let e=i.includes(`
1
+ import{_ as e,c as t,f as n,g as r,h as i,i as a,m as o,n as s,r as c,s as l,t as u,v as d,y as f}from"./77XECAW3-DxL0AHyZ.js";import{r as p}from"./DKTLEL5E-DciMwFJ1.js";import{t as m}from"./TSHNXIZL-Kizqv5oh.js";import{i as h,o as ee,t as te}from"./5N7A7DKN-DnUhiayz.js";import{n as ne,r as g,t as _}from"./CXAC5362-CdQgNtpk.js";import{PeleError as v,_ as re,g as y,n as b}from"./lazy-DudfZwDr.js";var x=class{type=`kanban`;title;sections=[];getType=_;last;sectionLevel=0;misplaced;addNode(e,t,n,r,i){let a={id:t,level:e,label:n};if(i!==void 0){let e=i.includes(`
2
2
  `)?i+`
3
3
  `:`{
4
4
  `+i+`
5
5
  }`,t;try{t=b(e)}catch(e){throw new v(`Metadata of "${a.id}" is not valid YAML. ${e.message}`,`syntax`,{type:`kanban`})}if(typeof t==`object`&&t&&!Array.isArray(t)){let e=t.shape?String(t.shape):``;if(e!==e.toLowerCase()||e.includes(`_`))throw new v(`No such shape: ${e}. Shape names should be lowercase.`,`semantic`,{type:`kanban`});t.label&&(a.label=String(t.label)),t.icon&&(a.icon=String(t.icon)),t.assigned&&(a.assigned=String(t.assigned)),t.ticket&&(a.ticket=String(t.ticket)),t.priority&&(a.priority=String(t.priority))}}if(this.misplaced)throw new v(`Items without section detected, found section ("${this.misplaced.label}")`,`semantic`,{type:`kanban`});let o=this.sections;if(o.length===0&&(this.sectionLevel=e),this.last=a,e===this.sectionLevel){let e=a;e.items=[],o.push(e)}else o[o.length-1].items.push(a),e<this.sectionLevel&&(this.misplaced=a)}decorateNode(e){let t=this.last;!e||!t||(e.icon&&(t.icon=e.icon),e.class&&(t.cssClasses=e.class))}};function S(e,t){g(e,t,!0)}var C=12,w=8,T=10,E=8,ie=4,D=6,ae=new Map([[`very high`,`stroke="${t}"`],[`high`,`stroke="${t}" opacity="0.5"`],[`low`,`stroke="var(--_m)" opacity="0.5"`],[`very low`,`stroke="var(--_m)"`]]);function O(e,t,n,r,i,o=0){let s=l(e,t,n,r,i,o);if(s.width<=i)return s;let c=[],u=[],d=0,f=[],p=0,m=()=>{c.push(f),u.push(p),d=Math.max(d,p),f=[],p=0};for(let e=0;e<s.lines.length;e++)if(s.widths[e]<=i)f=s.lines[e],p=s.widths[e],m();else{for(let t of s.lines[e]){if(t.icon!==void 0||t.math){p>0&&p+t.width>i&&m(),f.push(t),p+=t.width;continue}let e=``,a=p;for(let o of t.text){let s=n.width(o,r,t.style);p>0&&p+s>i&&(e&&f.push({text:e,style:t.style,width:p-a}),m(),e=``,a=0),e+=o,p+=s}e&&f.push({text:e,style:t.style,width:p-a})}m()}let h={...s,lines:c,widths:u,width:d,height:c.length*s.lineHeight};return s.heights?a(h):h}function k(e,t,r,a,o,c=!1){let l=``;for(let p=0;p<e.lines.length;p++){let m=e.lines[p],h=r+i(e,p);if(m.length===1&&m[0].icon===void 0&&m[0].math===void 0)l+=`<text${d(a,m[0].style)} x="${n(t)}" y="${n(h+e.size*.35)}"${c?` text-anchor="end"`:``}>${f(m[0].text)}</text>`;else{let n=e.widths[p];l+=u(s(e,p),t+(c?-n:n)/2,h,a,o)}}return l}var A=e=>!!e&&y(e)!==``;function j(t,i,a){let s=a.fontSize??16,d=Math.round(s*.875),g=Math.round(s*1.5),_=Math.round(d*1.5),v=a.measurer??re(a.fontFamily),y=a.padding??8,b=a.icons,x=i.kanban??{},S=x.sectionWidth,j=d*1.25,M=0,N=(e,t,n)=>{if(e&&e.includes(`$$`))for(let r of l(e,!0,v,t,1/0).lines)for(let e of r)e.math&&(M=Math.max(M,e.math.width+n))};for(let e of t.sections){let t=v.width(String(e.items.length),d,0);N(e.label,s,2*w+8+t+12+(A(e.icon)?j+D:0));for(let t of e.items){let e=2*(w+T);N(t.label,d,e+(A(t.icon)?j+D:0)),N(t.ticket,d,e),N(t.assigned,d,e)}}let P=Math.max(typeof S==`number`&&S>0?Math.min(Math.max(S,80),2e3):200,Math.ceil(M)),F=a.maxWidth!==void 0&&a.maxWidth>0?a.maxWidth-2*y:1/0,I=t.sections.length,L=I*(P+C)-C<=F,R=L?Math.max(I,1):Math.max(1,Math.floor((F+C)/(P+C))),z=L?P:Math.max(Math.min(P,F),Math.min(Math.floor((F+C)/R)-C,P*2),Math.ceil(M)),oe=typeof x.ticketBaseUrl==`string`?x.ticketBaseUrl:``,B=z-2*w,V=B-2*T,H=[],U=t.sections,W=[],G=[],K=[],q=g,J=[];for(let e of U){let t=v.width(String(e.items.length),d,0),n=t+12+(A(e.icon)?j+D:0),r=O(e.label,!0,v,s,B-8-n,1);q=Math.max(q,r.height),G.push(t),W.push(r);let i=[],a=0;for(let t of e.items){let e=O(t.label,!0,v,d,V-(A(t.icon)?j+D:0)),n=O(t.ticket,!1,v,d,V),r=O(t.assigned,!1,v,d,V),o=n.width+r.width+8>V?n.height+r.height:Math.max(n.height,r.height),s=2*T+Math.max(e.height,_)+(o?ie+o:0);i.push({item:t,label:e,ticket:n,assigned:r,meta:o,height:s}),a+=s+E}K.push(i),J.push(a)}q+=2*w;let Y=[],X=[];for(let e=0,t=0;e<U.length;e+=R){let n=E;for(let t=e;t<Math.min(e+R,U.length);t++)n=Math.max(n,J[t]);X.push(t),Y.push(q+n),t+=q+n+C}let se=Y.length>0?X[X.length-1]+Y[Y.length-1]:0,Z=m(t.title,v,s,p(a)),ce=Z.height>0?Z.height+16:0,le=Math.max(Math.min(U.length,R)*(z+C)-C,0),Q=Math.max(le,Z.width),ue=y+(Q-le)/2,de=z-w-4,fe=``;for(let t=0;t<U.length;t++){let r=U[t],i=Math.floor(t/R),s=`<rect width="${z}" height="${n(Y[i])}" fill="var(--_s)"${o}/>`+k(W[t],w+4,w,` class="pele-cluster-label" font-weight="var(--_hw)"`,b)+`<text class="pele-count" x="${de}" y="${n(w+g/2+d*.35)}" text-anchor="end" font-size="${d}" fill="var(--_m)">${r.items.length}</text>`;A(r.icon)&&(s+=ne(r.icon,de-G[t]-D-j,w+(g-j)/2,j,b));let l=q;for(let r of K[t]){let t=r.item,i=(t.priority??``).trim().toLowerCase(),u=ae.get(i),p=`<rect width="${B}" height="${n(r.height)}" fill="var(--_bg)" stroke="var(--_b)"${o}/>`;u!==void 0&&(p+=`<path class="pele-priority" d="M2.5,5V${n(r.height-5)}" fill="none" ${u} stroke-width="3" stroke-linecap="round"/>`),p+=k(r.label,T,T,` class="pele-label"`,b),A(t.icon)&&(p+=ne(t.icon,B-T-j,T+(_-j)/2,j,b));let m=r.height-T;if(t.ticket){let e=m-r.meta,n=oe?h(te(oe.replace(`#TICKET#`,()=>t.ticket)),a):void 0;n===void 0?p+=k(r.ticket,T,e,` class="pele-ticket" fill="var(--_m)"`,b):(p+=`<a href="${f(n)}" target="_blank"${ee(a)}>`+k(r.ticket,T,e,` class="pele-ticket" fill="var(--_c)"`,b)+`</a>`,H.push({id:t.id,href:n,internal:!1}))}t.assigned&&(p+=k(r.assigned,B-T,m-r.assigned.height,` class="pele-assigned" fill="var(--_m)"`,b,!0)),s+=`<g class="pele-node pele-card${u===void 0?``:` pele-priority-`+i.replace(` `,`-`)}${e(t.cssClasses??``)}" data-id="${c(t.id)}" transform="translate(${w},${n(l)})" font-size="${d}">${p}</g>`,l+=r.height+E}fe+=`<g class="pele-cluster pele-column${e(r.cssClasses??``)}" data-id="${c(r.id)}" transform="translate(${n(ue+t%R*(z+C))},${n(y+ce+X[i])})">${s}</g>`}let $=Math.ceil(Q+2*y),pe=Math.ceil(se+ce+2*y),me=u(Z,$/2,y+Z.height/2,` class="pele-title" font-weight="var(--_tw)"`)+fe;return{svg:r(`kanban`,$,pe,s,a,{},me),width:$,height:pe,links:H}}var M={type:`kanban`,math:!0,parse(e,t,n){let r=new x;return r.title=n,S(e,r),r},render:j};export{M as kanban};
6
- //# sourceMappingURL=DYY6UVD2-DTrZAR1D.js.map
6
+ //# sourceMappingURL=DYY6UVD2-DezK9sBO.js.map