@p4code/cli 0.9.14 → 0.9.15

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 (378) hide show
  1. package/dist/{AcpMcpStdioBridge-z_p02VlR.mjs → AcpMcpStdioBridge-BPNHFfTr.mjs} +11 -4
  2. package/dist/AcpMcpStdioBridge-CtXfvrFO.mjs +3 -0
  3. package/dist/{Effect-Bwkv2ifD.mjs → Effect-COOccdaU.mjs} +2 -2
  4. package/dist/{Schema-CFgoTmE6.mjs → Schema-BXiVImR2.mjs} +2 -2
  5. package/dist/{Stream-B4Gds95A.mjs → Stream-D2XZdzH6.mjs} +45 -3
  6. package/dist/bin.mjs +15 -2
  7. package/dist/{binCli-BGRfVnO9.mjs → binCli-06acKUH_.mjs} +4146 -2094
  8. package/dist/claude-history-worker.mjs +1 -1
  9. package/dist/{claudeHistoryWorker-DVpahhef.mjs → claudeHistoryWorker-BJKXFgWC.mjs} +4 -4
  10. package/dist/client/.vite/manifest.json +2064 -2089
  11. package/dist/client/assets/{2NI2N5EU-Bk2qNhha.js → 2NI2N5EU-CzVcbH89.js} +2 -2
  12. package/dist/client/assets/{4UO7MD6I-CPV9277r.js → 4UO7MD6I-DS3UFSUE.js} +2 -2
  13. package/dist/client/assets/{5B3SVYGG-LgRjxbnj.js → 5B3SVYGG-lbor_c4_.js} +2 -2
  14. package/dist/client/assets/{5GK6JWQ2-9ndiKpIs.js → 5GK6JWQ2-DufacBFC.js} +2 -2
  15. package/dist/client/assets/{5N7A7DKN-DnUhiayz.js → 5N7A7DKN-B3iWX-TC.js} +2 -2
  16. package/dist/client/assets/{5OC2THR4-DxmpZihk.js → 5OC2THR4-DoDDWXtD.js} +2 -2
  17. package/dist/client/assets/{5S6HY5KT-C4cUz8RB.js → 5S6HY5KT-7n94quvm.js} +2 -2
  18. package/dist/client/assets/{6IMQ5BUJ-2G8Rrp9t.js → 6IMQ5BUJ-CqcR9lZq.js} +2 -2
  19. package/dist/client/assets/{6OLKWJ4F-CW3F_AM6.js → 6OLKWJ4F-BeCI6be_.js} +2 -2
  20. package/dist/client/assets/{74OO7NKP-z5ujM5KH.js → 74OO7NKP-XWvi4Kgp.js} +2 -2
  21. package/dist/client/assets/{75O6YZUN-CSeaYNtt.js → 75O6YZUN-BbbGiqdI.js} +2 -2
  22. package/dist/client/assets/{77XECAW3-DxL0AHyZ.js → 77XECAW3-BVGMXOi_.js} +2 -2
  23. package/dist/client/assets/{ABYRPUBD-DvBcJj7G.js → ABYRPUBD-D4oehH5y.js} +2 -2
  24. package/dist/client/assets/AlertDialogRoot-BI19p1Pb.js +2 -0
  25. package/dist/client/assets/{AnimatedHeight-DChvigzz.js → AnimatedHeight-DT585xP0.js} +2 -2
  26. package/dist/client/assets/{AuthSurfaceShell-29ykag3m.js → AuthSurfaceShell-C312CXz7.js} +2 -2
  27. package/dist/client/assets/{BB2UYUI2-Cun87LIm.js → BB2UYUI2-BkFcdWkE.js} +2 -2
  28. package/dist/client/assets/{BUM34MOA-D6aIFnwf.js → BUM34MOA-DK6xDbTB.js} +2 -2
  29. package/dist/client/assets/{CEQABKGZ-DYzEk-9p.js → CEQABKGZ-rLn9wSBN.js} +2 -2
  30. package/dist/client/assets/{CXAC5362-CdQgNtpk.js → CXAC5362-C1eQCQMX.js} +2 -2
  31. package/dist/client/assets/ChatGptUsageButton-BldpBXxU.js +2 -0
  32. package/dist/client/assets/ChatMarkdown-BUoR67CT.js +49 -0
  33. package/dist/client/assets/CheckboxIndicator-C4iAbUMh.js +2 -0
  34. package/dist/client/assets/ClippedText-TtLeyAVc.js +2 -0
  35. package/dist/client/assets/CodexSetupSection.logic-BO6ZAijp.js +2 -0
  36. package/dist/client/assets/ComboboxClear-CtNsa8Al.js +2 -0
  37. package/dist/client/assets/ComboboxGroupLabel-vQ7y8c50.js +2 -0
  38. package/dist/client/assets/{CommandBlock-DBGDwDRu.js → CommandBlock-40eSIrOe.js} +2 -2
  39. package/dist/client/assets/CompositeRoot-CL7X20MU.js +2 -0
  40. package/dist/client/assets/ConnectAgentSurface-B_AYPHWs.js +2 -0
  41. package/dist/client/assets/{ConnectionStatusDot-C_9jtSee.js → ConnectionStatusDot-7Tjfknn6.js} +2 -2
  42. package/dist/client/assets/{DRLTVNUE-CftE6Aa3.js → DRLTVNUE-BPoomdQn.js} +2 -2
  43. package/dist/client/assets/{DYY6UVD2-DezK9sBO.js → DYY6UVD2-BVvdA84B.js} +2 -2
  44. package/dist/client/assets/DevicePanel-Cqexcbm2.js +2 -0
  45. package/dist/client/assets/DeviceSetup-Cdyw5Z9a.js +2 -0
  46. package/dist/client/assets/DialogTitle-CFYK6V6-.js +2 -0
  47. package/dist/client/assets/{DiffCommentAnnotation-QtrnUuSs.js → DiffCommentAnnotation-C28NAT6f.js} +3 -3
  48. package/dist/client/assets/{DiffFileTree-B_4bn5J8.js → DiffFileTree-DNP9E3To.js} +2 -2
  49. package/dist/client/assets/DiffPanel-CrswOKS6.js +2 -0
  50. package/dist/client/assets/{DiffWorkerPoolProvider-CtpHksSf.js → DiffWorkerPoolProvider-TgqbZJCv.js} +3 -3
  51. package/dist/client/assets/{EmbeddedDesign-BU5m6_ou.js → EmbeddedDesign-Bdq5oAfI.js} +8 -8
  52. package/dist/client/assets/{EnvironmentMachineIcon-DTUBsEaI.js → EnvironmentMachineIcon-B81Bujkx.js} +2 -2
  53. package/dist/client/assets/{ExpandableText-Wij8nL6W.js → ExpandableText-CViqRFUp.js} +2 -2
  54. package/dist/client/assets/{FNOVOB4O-DHCmE6LN.js → FNOVOB4O-CmMgcKnc.js} +2 -2
  55. package/dist/client/assets/FieldControl-95mCsa0m.js +2 -0
  56. package/dist/client/assets/{FileDiff-CAtJtUC5.js → FileDiff-BnZVGRTP.js} +2 -2
  57. package/dist/client/assets/{FilePreviewPanel-CjKP3Q7G.js → FilePreviewPanel-BUTTBdpa.js} +5 -5
  58. package/dist/client/assets/{FoldedSettingsSection-CAZumPht.js → FoldedSettingsSection-CioXtXIT.js} +2 -2
  59. package/dist/client/assets/FormContext-BcA1kdFD.js +2 -0
  60. package/dist/client/assets/{HDGCDEEZ-DNHIctoG.js → HDGCDEEZ-BsN0BbNt.js} +2 -2
  61. package/dist/client/assets/{HSJLKHB7-BfNhUjhw.js → HSJLKHB7-Bn8VFRt5.js} +2 -2
  62. package/dist/client/assets/{Icons-DYaY7Otq.js → Icons-D_LFMxsj.js} +2 -2
  63. package/dist/client/assets/Input-C9KIhPlP.js +2 -0
  64. package/dist/client/assets/JZOYTAAL-B8H2VC7A.js +1 -0
  65. package/dist/client/assets/{K3MD6TGW-D-q4Z_68.js → K3MD6TGW-BEaTend7.js} +2 -2
  66. package/dist/client/assets/{K7RP3OMA-C5AEGeo9.js → K7RP3OMA-Ca837W6z.js} +2 -2
  67. package/dist/client/assets/KeybindingsSettings.logic-DwMUZYvv.js +2 -0
  68. package/dist/client/assets/{LHDIQX7Q-CY4nmSyZ.js → LHDIQX7Q-kLYZmy22.js} +2 -2
  69. package/dist/client/assets/{LUXOKEGN-BHmzrQMD.js → LUXOKEGN-C6-9ARpy.js} +2 -2
  70. package/dist/client/assets/LinkMachineSelect-BVNnYUBb.js +2 -0
  71. package/dist/client/assets/{MathTypeset-C1sAcsZE.js → MathTypeset-CO0wlzDm.js} +2 -2
  72. package/dist/client/assets/{N3JZAHOW-D1VvHXNc.js → N3JZAHOW-BFAKVTw8.js} +2 -2
  73. package/dist/client/assets/{NUIALGQ3-DKQw5Xvm.js → NUIALGQ3-DJg3tvBl.js} +2 -2
  74. package/dist/client/assets/{NoProjectsHero-DVJOMY01.js → NoProjectsHero-ClDVFY0-.js} +2 -2
  75. package/dist/client/assets/{O65XPQGZ-B7xlpxd0.js → O65XPQGZ-C5dkxqix.js} +2 -2
  76. package/dist/client/assets/{O7XIQ6OM-D_yohKEz.js → O7XIQ6OM-BUT403yQ.js} +2 -2
  77. package/dist/client/assets/{OFQON5FD-Eb1UafMJ.js → OFQON5FD-BPK3FXUG.js} +2 -2
  78. package/dist/client/assets/P4ConnectAccountPages-ChT866qO.js +2 -0
  79. package/dist/client/assets/{P4ConnectSidebarSignIn-BarFXVdD.js → P4ConnectSidebarSignIn-D7BBbl_u.js} +2 -2
  80. package/dist/client/assets/{PJQHF43J-xu8MNrTl.js → PJQHF43J-DrfICuu-.js} +2 -2
  81. package/dist/client/assets/PanelLayoutControls-DMUv135M.js +216 -0
  82. package/dist/client/assets/PierreEntryIcon-DLXDEcqA.js +2 -0
  83. package/dist/client/assets/PopoverHandle-D8JhsX32.js +2 -0
  84. package/dist/client/assets/PreviewPanel-D7YWnWZS.js +2 -0
  85. package/dist/client/assets/ProjectDefaultsSettings-BZSw74tU.js +2 -0
  86. package/dist/client/assets/ProjectFavicon-BbtNdeB8.js +3 -0
  87. package/dist/client/assets/{ProjectIconPickerDialog-Ccwf3eo1.js → ProjectIconPickerDialog-7vur_TCX.js} +2 -2
  88. package/dist/client/assets/{ProjectMonogram-Bui44V7z.js → ProjectMonogram-CjAGnMXr.js} +2 -2
  89. package/dist/client/assets/{ProviderAuthTerminal-DjIpg2-V.js → ProviderAuthTerminal-83vDClUK.js} +2 -2
  90. package/dist/client/assets/ProviderModelPicker-af7MWLPO.js +2 -0
  91. package/dist/client/assets/{ProviderSettingsForm-sjzQFb8p.js → ProviderSettingsForm-B4N4tsxv.js} +2 -2
  92. package/dist/client/assets/PullRequestCodeTab-B07M_QW4.js +6 -0
  93. package/dist/client/assets/{RHNBAITX-DWaFNhmX.js → RHNBAITX-CzAdLNMd.js} +2 -2
  94. package/dist/client/assets/{ReadOnlySourcePreview-DDDARz8g.js → ReadOnlySourcePreview-CRy5hHfx.js} +2 -2
  95. package/dist/client/assets/{RedactedSensitiveText-BFwVjGRJ.js → RedactedSensitiveText-B-u4PB3I.js} +2 -2
  96. package/dist/client/assets/RenderErrorBoundary-BbxLD-66.js +23 -0
  97. package/dist/client/assets/{RightPanelResizeHandle-DstJn39I.js → RightPanelResizeHandle-BODMyZa6.js} +2 -2
  98. package/dist/client/assets/{SLD4V6NK-kuRIO20K.js → SLD4V6NK-DIFaAadw.js} +2 -2
  99. package/dist/client/assets/ScheduledTasksSettings-BTi69FRq.js +6 -0
  100. package/dist/client/assets/{ScopedSwitch-B7HEwool.js → ScopedSwitch-sSIKDf2q.js} +2 -2
  101. package/dist/client/assets/ScrollAreaCorner-CsKGemsf.js +2 -0
  102. package/dist/client/assets/{SecretInput-CxRazSuj.js → SecretInput-DxjaAnSE.js} +2 -2
  103. package/dist/client/assets/SelectScrollUpArrow-BMZtcPXM.js +2 -0
  104. package/dist/client/assets/{SelfImproveSettingsSection-BxPUr-AT.js → SelfImproveSettingsSection-Dx6spJXh.js} +2 -2
  105. package/dist/client/assets/SettingsPanels-DhuEF0_Y.js +46 -0
  106. package/dist/client/assets/{SettingsPanels.logic-B406HX50.js → SettingsPanels.logic-D5Fnq4gS.js} +2 -2
  107. package/dist/client/assets/{SettingsScopeNotice-Dt7vuLO5.js → SettingsScopeNotice-B1JDmqM6.js} +2 -2
  108. package/dist/client/assets/{SidebarStageBackdrop-BzsUCj2G.js → SidebarStageBackdrop-Bbv3JBlJ.js} +2 -2
  109. package/dist/client/assets/{T3PCR2KE-C14xVwSj.js → T3PCR2KE-CACWvOHn.js} +2 -2
  110. package/dist/client/assets/{TKWO2OVW-CC_4uZad.js → TKWO2OVW-DpiGaVko.js} +2 -2
  111. package/dist/client/assets/{TSHNXIZL-Kizqv5oh.js → TSHNXIZL-Cs6g4gXN.js} +2 -2
  112. package/dist/client/assets/ThemeEditorPanel-w-RJEK3t.js +5 -0
  113. package/dist/client/assets/{ThreadDetailsItemsMenu-CSCIFtTP.js → ThreadDetailsItemsMenu-DEwUOoLt.js} +60 -60
  114. package/dist/client/assets/ThreadTerminalDrawer-CY2qHldP.js +5 -0
  115. package/dist/client/assets/TooltipProvider-Czzm7ro-.js +2 -0
  116. package/dist/client/assets/{UQJE5E4I-KUX5qtvS.js → UQJE5E4I-C2gKDRv_.js} +2 -2
  117. package/dist/client/assets/{USNYFO5S-XMF6TRXj.js → USNYFO5S-CQ8LfY6F.js} +2 -2
  118. package/dist/client/assets/{Virtualizer-CqFZ9IgG.js → Virtualizer-DsEq6qUF.js} +2 -2
  119. package/dist/client/assets/{WEVWDWVA-BNUvxLQd.js → WEVWDWVA-DK2GTAKk.js} +2 -2
  120. package/dist/client/assets/{WorkspaceBreadcrumb-DyZsM9TF.js → WorkspaceBreadcrumb-BImJJpuo.js} +2 -2
  121. package/dist/client/assets/{WorkspacePageContainer-DFXSkFyh.js → WorkspacePageContainer-BlYFBUKE.js} +2 -2
  122. package/dist/client/assets/{WorkspacePageHeader-FTc6UfB-.js → WorkspacePageHeader-B7O16593.js} +2 -2
  123. package/dist/client/assets/{X5RFHQXM-BtifjFQb.js → X5RFHQXM-sPxDCIwv.js} +2 -2
  124. package/dist/client/assets/{X62E3GBT-DT_qCIPw.js → X62E3GBT-DVWr270S.js} +2 -2
  125. package/dist/client/assets/{XBNEOJTC-7FdMX9IP.js → XBNEOJTC-C4ZNtSrU.js} +2 -2
  126. package/dist/client/assets/{YHV2MVVZ-D6KCo9Qp.js → YHV2MVVZ-aSYUfq9n.js} +2 -2
  127. package/dist/client/assets/{YURCZMG2-D0_CST6F.js → YURCZMG2-fnxZxUja.js} +2 -2
  128. package/dist/client/assets/{YVG2LODB-CRU4fKD2.js → YVG2LODB-DxaZKaXT.js} +2 -2
  129. package/dist/client/assets/_chat-BeJoXsdK.js +47 -0
  130. package/dist/client/assets/_chat.design-AJz30uXq.js +2 -0
  131. package/dist/client/assets/_chat.index-D1csjyRQ.js +2 -0
  132. package/dist/client/assets/_chat.new-IhhWgwNo.js +4 -0
  133. package/dist/client/assets/_chat.pull-requests-B84LUHIv.js +2 -0
  134. package/dist/client/assets/{alert-D0u2-4Zh.js → alert-D6MFRWZv.js} +2 -2
  135. package/dist/client/assets/{alert-dialog-DK40IDMO.js → alert-dialog-BCq0Qme9.js} +2 -2
  136. package/dist/client/assets/assetUrls-CpRsTTqn.js +2 -0
  137. package/dist/client/assets/assets-Dh1LFwqL.js +2 -0
  138. package/dist/client/assets/browserHistoryStore-BVEWgOnh.js +2 -0
  139. package/dist/client/assets/{browserLinkTarget-BOF3rlV5.js → browserLinkTarget-IOprEiHF.js} +2 -2
  140. package/dist/client/assets/{checkbox-bsJs8Zu-.js → checkbox-CGhJug34.js} +2 -2
  141. package/dist/client/assets/{color-picker-W4KTEgfL.js → color-picker-CRaqqL5F.js} +2 -2
  142. package/dist/client/assets/{combobox-UDn50qHb.js → combobox-5RzytEjd.js} +2 -2
  143. package/dist/client/assets/{command-C7CgDZ25.js → command-06bu9QoQ.js} +2 -2
  144. package/dist/client/assets/{connect-CguaBRtJ.js → connect-7OV1IEwO.js} +2 -2
  145. package/dist/client/assets/connect-agent-B6pgZuy8.js +2 -0
  146. package/dist/client/assets/design-DSoix9e1.js +2 -0
  147. package/dist/client/assets/device-DQmQm4GC.js +2 -0
  148. package/dist/client/assets/{dialog-BEXthTAp.js → dialog-DTVhbEqi.js} +2 -2
  149. package/dist/client/assets/{diffRendering-DosiBwUN.js → diffRendering-DAzPanqh.js} +3 -3
  150. package/dist/client/assets/{dist-p5OtQFc9.js → dist-BuxsAlG0.js} +3 -3
  151. package/dist/client/assets/draft-input-BTetoXSt.js +2 -0
  152. package/dist/client/assets/{duoViewer-BcsodgGy.js → duoViewer-DxmaOmHS.js} +2 -2
  153. package/dist/client/assets/{dynamic-XOmtS0-B.js → dynamic-wBSCLNxy.js} +2 -2
  154. package/dist/client/assets/{embeddedScripts-BQl_ld6u.js → embeddedScripts-ZebptRJ0.js} +2 -2
  155. package/dist/client/assets/{empty-CTv2Unxd.js → empty-B4h5DyMQ.js} +2 -2
  156. package/dist/client/assets/entities-CWtNgawi.js +2 -0
  157. package/dist/client/assets/{fileLinks-T2ko6Qmp.js → fileLinks-BfcK2bJU.js} +2 -2
  158. package/dist/client/assets/{fileTreeExpansion-BOutPxUH.js → fileTreeExpansion-DjiK1m5s.js} +2 -2
  159. package/dist/client/assets/{getDiffFileInput-Do7OSxYn.js → getDiffFileInput-XE3jyXxK.js} +2 -2
  160. package/dist/client/assets/{guideRunStore-DGAK_XSV.js → guideRunStore-CzF0q6A8.js} +2 -2
  161. package/dist/client/assets/{htmlRender-DAhG7IlW.js → htmlRender-DGe3WaPg.js} +2 -2
  162. package/dist/client/assets/{index-4XHdM2Yx.js → index-CurDuwfz.js} +3 -3
  163. package/dist/client/assets/{input-BGKmQVHf.js → input-CQaedaQh.js} +2 -2
  164. package/dist/client/assets/{input-group-BdgWY0OZ.js → input-group-BQ_2ox-w.js} +2 -2
  165. package/dist/client/assets/{kbd-BIypvknl.js → kbd-DQRicdHu.js} +2 -2
  166. package/dist/client/assets/{keybindings-C0ntbKmL.js → keybindings-tgj8XFFz.js} +2 -2
  167. package/dist/client/assets/{lazy-DudfZwDr.js → lazy-DmPH_lNd.js} +4 -4
  168. package/dist/client/assets/{lazyRouteComponent-VtherrNw.js → lazyRouteComponent-CE6uW_5p.js} +2 -2
  169. package/dist/client/assets/{link--eZ8ZXuK.js → link-CKfckeju.js} +2 -2
  170. package/dist/client/assets/{linkedPrompt-DRNVlalr.js → linkedPrompt-68_t5vwh.js} +2 -2
  171. package/dist/client/assets/main-B1sXOjZZ.js +37 -0
  172. package/dist/client/assets/main-CbkvDRKP.css +2 -0
  173. package/dist/client/assets/{mediaReference-CMwg4kE3.js → mediaReference-DQ6GIZY7.js} +2 -2
  174. package/dist/client/assets/mediaSource-DfTsMdqm.js +2 -0
  175. package/dist/client/assets/number-field-xEi5ylvp.js +2 -0
  176. package/dist/client/assets/{observeResize-CV41SgJr.js → observeResize-BbXolq6K.js} +2 -2
  177. package/dist/client/assets/onboarding-CkdZxdNL.js +2 -0
  178. package/dist/client/assets/openFileInPreview-BHhDd-id.js +2 -0
  179. package/dist/client/assets/{p4ProjectFile-DqqWNGdD.js → p4ProjectFile-5VDI-yAx.js} +2 -2
  180. package/dist/client/assets/{pair-Wl7C9P9c.js → pair-BpCo33SH.js} +2 -2
  181. package/dist/client/assets/{pendingSendStore-CFKdq-QP.js → pendingSendStore-Ba--K6cH.js} +2 -2
  182. package/dist/client/assets/{phoneViewer-C1sFfV5x.js → phoneViewer-C1aGY-h1.js} +2 -2
  183. package/dist/client/assets/{pierre-icons-2mAt8csu.js → pierre-icons-BdcegjLq.js} +3 -3
  184. package/dist/client/assets/popover-BB2K1---.js +2 -0
  185. package/dist/client/assets/preview-B4_sjsUX.js +2 -0
  186. package/dist/client/assets/preview-DgXn94k5.js +2 -0
  187. package/dist/client/assets/{previewMiniPlayerStore-DwJUVJAq.js → previewMiniPlayerStore-DguWdL1f.js} +2 -2
  188. package/dist/client/assets/primary-BDoRkJqU.js +2 -0
  189. package/dist/client/assets/primaryCloudLinkState-Cc0Xobh6.js +2 -0
  190. package/dist/client/assets/projectFilesQueryState-BdfD5cZ2.js +2 -0
  191. package/dist/client/assets/projectScriptEditor-faOsFlds.js +2 -0
  192. package/dist/client/assets/{providerSkills-B9Q5OmXk.js → providerSkills-C8PrnHb-.js} +2 -2
  193. package/dist/client/assets/{pullRequestDetail.logic-CVJbFct1.js → pullRequestDetail.logic-kOhR5jr9.js} +4 -4
  194. package/dist/client/assets/{pullRequestIcons-ZE5MB0dW.js → pullRequestIcons-CbDg0o8q.js} +2 -2
  195. package/dist/client/assets/{pullRequestReviewStore-CF0UmQoG.js → pullRequestReviewStore-0WIH92NQ.js} +2 -2
  196. package/dist/client/assets/pullRequests-Cf9E2kW-.js +2 -0
  197. package/dist/client/assets/queries-Cl508kPw.js +2 -0
  198. package/dist/client/assets/query-D3KVoW9G.js +2 -0
  199. package/dist/client/assets/radio-group-BnZVD-CO.js +2 -0
  200. package/dist/client/assets/relay-Do9UB5iT.js +2 -0
  201. package/dist/client/assets/{renderScheduler-BLYWx2Dl.js → renderScheduler-DsjkE3rh.js} +2 -2
  202. package/dist/client/assets/{rightPanelStore-BzpX6F8n.js → rightPanelStore-DB1OP4MT.js} +2 -2
  203. package/dist/client/assets/runtime-BBYIQ0f-.js +7 -0
  204. package/dist/client/assets/runtimeModeConfig-CRXk0H6e.js +2 -0
  205. package/dist/client/assets/scheduledTasksSettings.logic-Dw_swg_M.js +3 -0
  206. package/dist/client/assets/{scroll-area-BN4-XX3T.js → scroll-area-Cm9XZdHp.js} +2 -2
  207. package/dist/client/assets/{select-CHOl11x1.js → select-Cz_1ByI4.js} +2 -2
  208. package/dist/client/assets/{selfImproveFindings-BTdfhZ3z.js → selfImproveFindings-DtoTFNL_.js} +2 -2
  209. package/dist/client/assets/semver-BoU8Be_3.js +2 -0
  210. package/dist/client/assets/server-Dkj4NeYG.js +2 -0
  211. package/dist/client/assets/session-CBEVNHld.js +2 -0
  212. package/dist/client/assets/{session-logic-BwAELIPU.js → session-logic-DB_ei-pn.js} +5 -5
  213. package/dist/client/assets/{settings-fuKhbSed.js → settings-Yvo1RMvg.js} +2 -2
  214. package/dist/client/assets/{settings.appearance-K-0McYk9.js → settings.appearance-ONDNW-gc.js} +2 -2
  215. package/dist/client/assets/settings.archived-CjdyCMyi.js +2 -0
  216. package/dist/client/assets/{settings.computer-use-C8dDJqmo.js → settings.computer-use-97ffp9C_.js} +2 -2
  217. package/dist/client/assets/settings.connections-w3qKRKGa.js +2 -0
  218. package/dist/client/assets/settings.data-controls-C8ozSexu.js +2 -0
  219. package/dist/client/assets/{settings.decisions-C1RgAwXn.js → settings.decisions-BvR3_OTv.js} +2 -2
  220. package/dist/client/assets/{settings.designs-BgEqEGXM.js → settings.designs-CB8PWHwW.js} +2 -2
  221. package/dist/client/assets/settings.diagnostics-DdInPrq0.js +2 -0
  222. package/dist/client/assets/{settings.general-BeLPMggF.js → settings.general-Cf_bIbyH.js} +2 -2
  223. package/dist/client/assets/settings.integrations-pj9KVvtd.js +2 -0
  224. package/dist/client/assets/settings.keybindings-3diGciV1.js +2 -0
  225. package/dist/client/assets/{settings.open-source-licenses-DWVgu9MJ.js → settings.open-source-licenses-DlqO6HBa.js} +2 -2
  226. package/dist/client/assets/{settings.plugins-DsfEfMST.js → settings.plugins-DpaJJH_J.js} +4 -4
  227. package/dist/client/assets/settings.projects-Bfh3CJ1a.js +4 -0
  228. package/dist/client/assets/settings.providers-DNiEeQYT.js +3 -0
  229. package/dist/client/assets/{settings.scheduled-tasks-BJMUub-y.js → settings.scheduled-tasks-BIaHEXVF.js} +2 -2
  230. package/dist/client/assets/settings.secrets-BSNXem5A.js +2 -0
  231. package/dist/client/assets/{settings.snap-shot-6aF3J4Zd.js → settings.snap-shot-Ds0ywKhE.js} +2 -2
  232. package/dist/client/assets/settings.source-control-C41AVNSm.js +2 -0
  233. package/dist/client/assets/settings.storage-B-Hm5vEC.js +2 -0
  234. package/dist/client/assets/settingsLayout-BbEwQ6Fy.js +3 -0
  235. package/dist/client/assets/{sidebar-Dt9UYgk1.js → sidebar-B70J7v16.js} +2 -2
  236. package/dist/client/assets/{sidebarProjectGrouping-lpBYOlht.js → sidebarProjectGrouping-Cy06FqQF.js} +2 -2
  237. package/dist/client/assets/{skeleton-BiqtjWsk.js → skeleton-BavPX8IL.js} +2 -2
  238. package/dist/client/assets/sourceControl-De64nxc-.js +2 -0
  239. package/dist/client/assets/{sourceControlClients-Bcd4sqEi.js → sourceControlClients-BofXnV5S.js} +2 -2
  240. package/dist/client/assets/{spinner-C64jtA3m.js → spinner-BiCpg0TU.js} +2 -2
  241. package/dist/client/assets/terminal-links-DkNuyYrs.js +2 -0
  242. package/dist/client/assets/terminalSessions-BLnAzTpE.js +2 -0
  243. package/dist/client/assets/{textarea-DtceyvOF.js → textarea-DPWqoJRQ.js} +2 -2
  244. package/dist/client/assets/themePalette-1UQmJk98.js +5 -0
  245. package/dist/client/assets/{threadCheckpoints-BXz5LJLz.js → threadCheckpoints-C5aLz9nv.js} +2 -2
  246. package/dist/client/assets/{toggle-Be7gb_vD.js → toggle-DERKSGyC.js} +2 -2
  247. package/dist/client/assets/{toggle-group-Cz65VaLC.js → toggle-group-DYSJFIn3.js} +2 -2
  248. package/dist/client/assets/tooltip-C7NAkYG3.js +2 -0
  249. package/dist/client/assets/{uiStateStore-yyuUmO2M.js → uiStateStore-FYiLqqos.js} +2 -2
  250. package/dist/client/assets/usage-CtcqAwlu.js +2 -0
  251. package/dist/client/assets/{usageAccess-0MZ9DMCW.js → usageAccess-2Wks5kIN.js} +2 -2
  252. package/dist/client/assets/{usageFormat-4k8-70X2.js → usageFormat-BZJ9qCn4.js} +2 -2
  253. package/dist/client/assets/{usageShortcuts-C4Dhwzkz.js → usageShortcuts-BJyp1xT6.js} +2 -2
  254. package/dist/client/assets/use-atom-command-BbFDhw_c.js +2 -0
  255. package/dist/client/assets/useAriaLabelledBy-BJnK5b5h.js +2 -0
  256. package/dist/client/assets/useHandleNewThread-C6MtV3AM.js +2 -0
  257. package/dist/client/assets/{useLocation-_8If3LN3.js → useLocation-NTw9A5XQ.js} +2 -2
  258. package/dist/client/assets/{useNavigate-5WivMyAa.js → useNavigate-DV9bXnWr.js} +2 -2
  259. package/dist/client/assets/{useNavigateBack-DXfbYF86.js → useNavigateBack-D62rsj_4.js} +2 -2
  260. package/dist/client/assets/{useP4ConnectAuthPrompt-D0Equ6mY.js → useP4ConnectAuthPrompt-Bj5GIxgy.js} +2 -2
  261. package/dist/client/assets/{useParams-DV-Nw6Lj.js → useParams-jklHVL7l.js} +2 -2
  262. package/dist/client/assets/{usePermissionStatus-CIobAIHF.js → usePermissionStatus-DaCu90iN.js} +2 -2
  263. package/dist/client/assets/usePopupViewport-D1lXH2SQ.js +2 -0
  264. package/dist/client/assets/usePreviousValue-Dx4Nv0v8.js +2 -0
  265. package/dist/client/assets/usePullRequestActions-WFmep5Tm.js +3 -0
  266. package/dist/client/assets/useRegisterFieldControl-BtJcyaxh.js +2 -0
  267. package/dist/client/assets/{useScopedModelAvailability-Cc-bmdqn.js → useScopedModelAvailability-hsJL85Tg.js} +2 -2
  268. package/dist/client/assets/useSettings-EYJbJzT3.js +3 -0
  269. package/dist/client/assets/utils-DjbLtxuo.js +37 -0
  270. package/dist/client/assets/vcsRefInvalidation-DkXoQApH.js +2 -0
  271. package/dist/client/assets/welcome-uKSqaFeK.js +2 -0
  272. package/dist/client/index.html +1 -1
  273. package/dist/{renderer-D_KFqL06.mjs → renderer-D9dDeERN.mjs} +68 -13
  274. package/dist/{runtime-Tslhhp69.mjs → runtime-C3UJDGLb.mjs} +81 -11
  275. package/package.json +1 -1
  276. package/dist/AcpMcpStdioBridge-BinVfs5k.mjs +0 -3
  277. package/dist/client/assets/AlertDialogRoot-z7O2CaB2.js +0 -2
  278. package/dist/client/assets/ChatGptUsageButton-DQjnXjt6.js +0 -2
  279. package/dist/client/assets/ChatMarkdown-C7ocX514.js +0 -48
  280. package/dist/client/assets/CheckboxIndicator-D2jNOqVc.js +0 -2
  281. package/dist/client/assets/ClippedText-CDOkzr7r.js +0 -2
  282. package/dist/client/assets/CodexSetupSection.logic-BIpypa3y.js +0 -2
  283. package/dist/client/assets/ComboboxClear-CPvB2whi.js +0 -2
  284. package/dist/client/assets/ComboboxGroupLabel-DN75A_2f.js +0 -2
  285. package/dist/client/assets/CompositeRoot-Jf3zEGLN.js +0 -2
  286. package/dist/client/assets/ConnectAgentSurface-Cv2oB5Cw.js +0 -2
  287. package/dist/client/assets/DevicePanel-CKWUjHEE.js +0 -2
  288. package/dist/client/assets/DeviceSetup-BrOsu1Y4.js +0 -2
  289. package/dist/client/assets/DialogTitle-COHuuWBE.js +0 -2
  290. package/dist/client/assets/DiffPanel-CGIIHSDI.js +0 -2
  291. package/dist/client/assets/FieldControl-Yp1Yjlg7.js +0 -2
  292. package/dist/client/assets/FormContext-BEFZtJu9.js +0 -2
  293. package/dist/client/assets/Input-CVeLgfX4.js +0 -2
  294. package/dist/client/assets/JZOYTAAL-Bngs0npp.js +0 -1
  295. package/dist/client/assets/KeybindingsSettings.logic-A_266dBm.js +0 -2
  296. package/dist/client/assets/LinkMachineSelect-tm04n5mK.js +0 -2
  297. package/dist/client/assets/P4ConnectAccountPages-BkOCG7hq.js +0 -2
  298. package/dist/client/assets/PanelLayoutControls-amKHUz1V.js +0 -216
  299. package/dist/client/assets/PierreEntryIcon-CbhCWTjd.js +0 -2
  300. package/dist/client/assets/PopoverHandle-DbGxLy3d.js +0 -2
  301. package/dist/client/assets/PreviewPanel-B1KmgL5R.js +0 -2
  302. package/dist/client/assets/ProjectDefaultsSettings-D_2ixmme.js +0 -2
  303. package/dist/client/assets/ProjectFavicon-BXd2O1Gh.js +0 -3
  304. package/dist/client/assets/ProviderModelPicker-DJl5IM1n.js +0 -2
  305. package/dist/client/assets/PullRequestCodeTab-BcFFbURH.js +0 -6
  306. package/dist/client/assets/RenderErrorBoundary-DianZAsM.js +0 -23
  307. package/dist/client/assets/ScheduledTasksSettings-BHT9WAFD.js +0 -6
  308. package/dist/client/assets/ScrollAreaCorner-DW6lxPPn.js +0 -2
  309. package/dist/client/assets/SelectScrollUpArrow-DZfqWvZD.js +0 -2
  310. package/dist/client/assets/SettingsPanels-CrMsCqvq.js +0 -46
  311. package/dist/client/assets/ThemeEditorPanel-BuMI6s2A.js +0 -5
  312. package/dist/client/assets/ThreadTerminalDrawer-FZ0zyNm1.js +0 -5
  313. package/dist/client/assets/TooltipViewport-DjveMpIl.js +0 -2
  314. package/dist/client/assets/_chat-P2jEGe91.js +0 -47
  315. package/dist/client/assets/_chat.design-k56_YrCY.js +0 -2
  316. package/dist/client/assets/_chat.index-CUR_1FMo.js +0 -2
  317. package/dist/client/assets/_chat.new-7EgBpaGD.js +0 -4
  318. package/dist/client/assets/_chat.pull-requests-C97pdH91.js +0 -2
  319. package/dist/client/assets/assetUrls-ChygJppW.js +0 -2
  320. package/dist/client/assets/assets-Cv1qxio9.js +0 -2
  321. package/dist/client/assets/browserHistoryStore-PB9BBl0N.js +0 -2
  322. package/dist/client/assets/connect-agent-BitywHYq.js +0 -2
  323. package/dist/client/assets/design-NrL4Xyzh.js +0 -2
  324. package/dist/client/assets/device-DsIsK_g9.js +0 -2
  325. package/dist/client/assets/draft-input-Cp7zSsLs.js +0 -2
  326. package/dist/client/assets/entities-Ci9sZwRJ.js +0 -2
  327. package/dist/client/assets/main-CKOKCTSr.css +0 -2
  328. package/dist/client/assets/main-CRJyb41E.js +0 -37
  329. package/dist/client/assets/mediaSource-BQpgJ9hG.js +0 -2
  330. package/dist/client/assets/number-field-pjPmm2hH.js +0 -2
  331. package/dist/client/assets/onboarding-C7BynXti.js +0 -2
  332. package/dist/client/assets/openFileInPreview-Cs7GoIEO.js +0 -2
  333. package/dist/client/assets/popover-oNrAhEOs.js +0 -2
  334. package/dist/client/assets/preview-CAzlFJXG.js +0 -2
  335. package/dist/client/assets/preview-D8H2Itzr.js +0 -2
  336. package/dist/client/assets/primary-BdVzsWIK.js +0 -2
  337. package/dist/client/assets/primaryCloudLinkState-eu2avrjG.js +0 -2
  338. package/dist/client/assets/projectFilesQueryState-f8odJKc-.js +0 -2
  339. package/dist/client/assets/projectScriptEditor-D8Os7g21.js +0 -2
  340. package/dist/client/assets/pullRequests-p7FMtHTx.js +0 -2
  341. package/dist/client/assets/queries-C1_RUJ-8.js +0 -2
  342. package/dist/client/assets/query-DszcgUku.js +0 -2
  343. package/dist/client/assets/radio-group-Cb2KobOI.js +0 -2
  344. package/dist/client/assets/runtime-CcgzOADx.js +0 -6
  345. package/dist/client/assets/runtime-D2NRh41I.js +0 -3
  346. package/dist/client/assets/runtimeModeConfig-DTaQ5JjA.js +0 -2
  347. package/dist/client/assets/scheduledTasksSettings.logic-FST8Bc6V.js +0 -3
  348. package/dist/client/assets/semver-CFbvOQKc.js +0 -2
  349. package/dist/client/assets/server-C-cSQN_G.js +0 -2
  350. package/dist/client/assets/session-D6BRf77P.js +0 -2
  351. package/dist/client/assets/settings.archived-CalSrYkZ.js +0 -2
  352. package/dist/client/assets/settings.connections-D_XSkcFH.js +0 -2
  353. package/dist/client/assets/settings.data-controls-CTlXbRrO.js +0 -2
  354. package/dist/client/assets/settings.diagnostics-BxqI_9bx.js +0 -2
  355. package/dist/client/assets/settings.integrations-4rKfTDFW.js +0 -2
  356. package/dist/client/assets/settings.keybindings-DSavoJxs.js +0 -2
  357. package/dist/client/assets/settings.projects-CJzRAMVM.js +0 -4
  358. package/dist/client/assets/settings.providers-BoTCdGuy.js +0 -3
  359. package/dist/client/assets/settings.secrets-Ch_XS6ak.js +0 -2
  360. package/dist/client/assets/settings.source-control-B7PW3yi5.js +0 -2
  361. package/dist/client/assets/settings.storage-PmxiGFaE.js +0 -2
  362. package/dist/client/assets/settingsLayout-fG812pJ2.js +0 -3
  363. package/dist/client/assets/sourceControl-BUEFlHbW.js +0 -2
  364. package/dist/client/assets/terminal-links-DxE1mEi0.js +0 -2
  365. package/dist/client/assets/terminalSessions-Ceajv0BZ.js +0 -2
  366. package/dist/client/assets/themePalette-tZPF0oN0.js +0 -5
  367. package/dist/client/assets/toast-BYGaCmZu.js +0 -2
  368. package/dist/client/assets/tooltip-BYZIg_IY.js +0 -2
  369. package/dist/client/assets/usage-B6rUsIoY.js +0 -2
  370. package/dist/client/assets/use-atom-command-DEluSG6k.js +0 -2
  371. package/dist/client/assets/useAriaLabelledBy-Ca8fkLAD.js +0 -2
  372. package/dist/client/assets/useHandleNewThread-BOej8pJq.js +0 -2
  373. package/dist/client/assets/usePullRequestActions-Cf39XlVv.js +0 -3
  374. package/dist/client/assets/useRegisterFieldControl-Dmsxd6H8.js +0 -2
  375. package/dist/client/assets/useSettings-jZr_DfW0.js +0 -3
  376. package/dist/client/assets/utils-OWUgXvpr.js +0 -37
  377. package/dist/client/assets/vcsRefInvalidation-CRToBQE1.js +0 -2
  378. package/dist/client/assets/welcome-BcjbPbMq.js +0 -2
@@ -0,0 +1,2 @@
1
+ import{a as e,t}from"./react-BUfh6y28.js";import{t as n}from"./jsx-runtime-DJeoFXNw.js";import{Bn as r,Do as i,Eo as a,Fo as o,Gn as s,Ha as ee,Ma as te,Mo as c,No as l,Oa as u,Oo as d,Pa as f,Po as p,Ta as m,Un as h,Wa as g,Xa as _,ca as v,jo as ne,kr as re,la as ie,po as ae,qa as oe}from"./utils-DjbLtxuo.js";import{t as se}from"./useRegisterFieldControl-BtJcyaxh.js";import{t as ce}from"./FormContext-BcA1kdFD.js";import{t as le}from"./useAriaLabelledBy-BJnK5b5h.js";import{t as ue}from"./FieldItemContext-sr3mCd2v.js";var y=e(t()),b=y.createContext(void 0);function de(e=!0){let t=y.useContext(b);if(t===void 0&&!e)throw Error(o(3));return t}function fe(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 x=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 S(e){return y.useMemo(()=>({checked(t){return e.indeterminate?{}:t?{[x.checked]:``}:{[x.unchecked]:``}},...s}),[e.indeterminate])}var C=y.createContext(void 0);function w(){let e=y.useContext(C);if(e===void 0)throw Error(o(14));return e}var T=e(n()),pe=`data-parent`,me=y.forwardRef(function(e,t){let{checked:n,className:a,defaultChecked:o=!1,"aria-labelledby":s,disabled:u=!1,form:m,id:b,indeterminate:x=!1,inputRef:w,name:me,onCheckedChange:he,parent:E=!1,readOnly:D=!1,render:ge,required:O=!1,uncheckedValue:k,value:A,nativeButton:j=!1,style:_e,...ve}=e,{clearErrors:ye}=ce(),{disabled:be,name:xe,setDirty:Se,setFilled:M,setFocused:N,setTouched:Ce,state:P,validationMode:we,validityData:Te,shouldValidateOnChange:Ee,validation:De}=h(),Oe=ue(),{labelId:ke,controlId:Ae,registerControlId:F,getDescriptionProps:I}=r(),L=de(),R=L?.parent,z=R&&L.allValues,B=be||Oe.disabled||L?.disabled||u,V=xe??me,H=A??V,je=f(),Me=f(),U=Ae;z?U=E?Me:`${R.id}-${H}`:b&&(U=b);let W={};z&&(E?W=L.parent.getParentProps():H&&(W=L.parent.getChildProps(H)));let{checked:Ne=n,indeterminate:G=x,onCheckedChange:Pe,...Fe}=W,K=L?.value,Ie=L?.setValue,Le=L?.defaultValue,q=y.useRef(null),J=p(()=>Symbol(`checkbox-control`)),Y=y.useRef(!1),{getButtonProps:Re,buttonRef:ze}=ee({disabled:B,native:j}),X=L?.validation??De,[Z,Be]=_({controlled:H&&K&&!E?K.includes(H):Ne,default:H&&Le&&!E?Le.includes(H):o,name:`Checkbox`,state:`checked`});g(()=>{F!==c&&(Y.current=!0,F(J.current,U))},[U,F,J]),y.useEffect(()=>{let e=J.current;return()=>{Y.current&&F!==c&&(Y.current=!1,F(e,void 0))}},[F,J]),se(q,je,Z,void 0,!L);let Q=y.useRef(null),Ve=l(w,Q,X.inputRef),He=le(s,ke,Q,!j,U??void 0);g(()=>{Q.current&&(Q.current.indeterminate=G,Z&&M(!0))},[Z,G,M]),re(Z,()=>{(!L||E)&&(ye(V),M(Z),Se(Z!==Te.initialValue),Ee()?X.commit(Z):X.commit(Z,!0))});let Ue=d({checked:Z,disabled:B,form:m,name:E?void 0:V,id:j?void 0:U??void 0,required:O,ref:Ve,style:V?ie:v,tabIndex:-1,type:`checkbox`,"aria-hidden":!0,onChange(e){if(e.nativeEvent.defaultPrevented)return;if(D){e.preventDefault();return}let t=e.currentTarget.checked,n=te(ae,e.nativeEvent);if(Pe?.(t,n),he?.(t,n),!n.isCanceled&&(Be(t),H&&K&&Ie&&!E&&!z)){let e=t?[...K,H]:K.filter(e=>e!==H);Ie(e,n)}},onFocus(){q.current?.focus()}},A===void 0?ne:{value:(L?Z&&A:A)||``},I,L?X.getValidationProps:X.getInputValidationProps),We=z?!!Ne:Z,Ge=z&&G||x;y.useEffect(()=>{if(!R||!H)return;let e=R.disabledStatesRef.current;return e.set(H,B),()=>{e.delete(H)}},[R,B,H]);let $=y.useMemo(()=>({...P,checked:We,disabled:B,readOnly:D,required:O,indeterminate:Ge}),[P,We,B,D,O,Ge]),Ke=S($),qe=i(`span`,e,{state:$,ref:[ze,q,t,L?.registerControlRef],props:[{id:j?U??void 0:je,role:`checkbox`,"aria-checked":G?`mixed`:Z,"aria-readonly":D||void 0,"aria-required":O||void 0,"aria-labelledby":He,[pe]:E?``:void 0,onFocus(){N(!0)},onBlur(){let e=Q.current;e&&(Ce(!0),N(!1),we===`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),oe(n).queueMicrotask(()=>{e.preventDefault=i,r.preventDefault=a,o||fe(t)?.click()})},onClick(e){if(D||B)return;e.preventDefault();let t=Q.current;t&&t.dispatchEvent(new(oe(t)).PointerEvent(`click`,{bubbles:!0,shiftKey:e.shiftKey,ctrlKey:e.ctrlKey,altKey:e.altKey,metaKey:e.metaKey}))}},I,X.getValidationProps,ve,Fe,Re],stateAttributesMapping:Ke});return(0,T.jsxs)(C.Provider,{value:$,children:[qe,!Z&&!L&&V&&!E&&k!==void 0&&(0,T.jsx)(`input`,{type:`hidden`,form:m,name:V,value:k}),(0,T.jsx)(`input`,{...Ue,suppressHydrationWarning:!0})]})}),he=y.forwardRef(function(e,t){let{render:n,className:r,style:o,keepMounted:ee=!1,...te}=e,c=w(),l=c.checked||c.indeterminate,{mounted:d,transitionStatus:f,setMounted:p}=u(l),h=y.useRef(null),g={...c,transitionStatus:f};m({open:l,ref:h,onComplete(){l||p(!1)}});let _={...S(c),...a,...s},v=ee||d,ne=i(`span`,e,{ref:[t,h],state:g,stateAttributesMapping:_,props:te});return v?ne:null});export{me as n,he as t};
2
+ //# sourceMappingURL=CheckboxIndicator-C4iAbUMh.js.map
@@ -0,0 +1,2 @@
1
+ import{a as e,t}from"./react-BUfh6y28.js";import{n,t as r}from"./jsx-runtime-DJeoFXNw.js";import{Bc as i,Do as a,ud as o}from"./utils-DjbLtxuo.js";import{a as s,i as c,l,n as u,o as d,r as f,s as p}from"./TooltipProvider-Czzm7ro-.js";import{t as m}from"./usePopupViewport-D1lXH2SQ.js";var h=e(t()),g=function(e){return e.popupWidth=`--popup-width`,e.popupHeight=`--popup-height`,e}({}),_={activationDirection:e=>e?{"data-activation-direction":e}:null},v=h.forwardRef(function(e,t){let{render:n,className:r,style:i,children:o,...s}=e,u=l(),d=c(),f=u.useState(`instantType`),{children:p,state:h}=m({store:u,side:d.side,cssVars:g,children:o}),v={activationDirection:h.activationDirection,transitioning:h.transitioning,instant:f};return a(`div`,e,{state:v,ref:t,props:[s,{children:p}],stateAttributesMapping:_})}),y=n();function b(...e){return i(o(e))}var x=e(r(),1),S=p;function C(e){let t=(0,y.c)(2),n;return t[0]===e?n=t[1]:(n=(0,x.jsx)(d,{"data-slot":`tooltip-trigger`,...e}),t[0]=e,t[1]=n),n}function w(e){let t=(0,y.c)(28),n,r,i,a,o,c,l,d,p;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],o=t[5],c=t[6],l=t[7],d=t[8],p=t[9]):({className:i,positionerClassName:a,align:c,sideOffset:l,side:d,variant:p,anchor:n,children:r,...o}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o,t[6]=c,t[7]=l,t[8]=d,t[9]=p);let m=c===void 0?`center`:c,h=l===void 0?4:l,g=d===void 0?`top`:d,_=p===void 0?`default`:p,S;t[10]===a?S=t[11]:(S=b(`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=_===`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=b(`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,x.jsx)(v,{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]!==o||t[18]!==w||t[19]!==T?(E=(0,x.jsx)(u,{className:w,"data-slot":`tooltip-popup`,...o,children:T}),t[17]=o,t[18]=w,t[19]=T,t[20]=E):E=t[20];let D;return t[21]!==m||t[22]!==n||t[23]!==g||t[24]!==h||t[25]!==S||t[26]!==E?(D=(0,x.jsx)(s,{children:(0,x.jsx)(f,{align:m,anchor:n,className:S,"data-slot":`tooltip-positioner`,side:g,sideOffset:h,children:E})}),t[21]=m,t[22]=n,t[23]=g,t[24]=h,t[25]=S,t[26]=E,t[27]=D):D=t[27],D}var T=e=>!!(e&&e.scrollWidth>e.clientWidth);function E(e,t){let n=(0,y.c)(5),[r,i]=(0,h.useState)(!1),a;n[0]===e?a=n[1]:(a=()=>{let t=e.current;if(!t)return;let n=()=>i(T(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,h.useLayoutEffect)(a,o),r}function D(e){let t=(0,y.c)(15),{children:n,full:r,className:i}=e,a=r===void 0?n:r,o=i===void 0?`design-truncate`:i,s=(0,h.useRef)(null),c=E(s,n),[l,u]=(0,h.useState)(!1),d=l&&c,f;t[0]===c?f=t[1]:(f=e=>u(e&&c),t[0]=c,t[1]=f);let p=c?0:void 0,m;t[2]!==o||t[3]!==p?(m=(0,x.jsx)(`span`,{ref:s,className:o,tabIndex:p}),t[2]=o,t[3]=p,t[4]=m):m=t[4];let g;t[5]!==n||t[6]!==m?(g=(0,x.jsx)(C,{render:m,children:n}),t[5]=n,t[6]=m,t[7]=g):g=t[7];let _;t[8]===a?_=t[9]:(_=(0,x.jsx)(w,{children:a}),t[8]=a,t[9]=_);let v;return t[10]!==d||t[11]!==f||t[12]!==g||t[13]!==_?(v=(0,x.jsxs)(S,{open:d,onOpenChange:f,children:[g,_]}),t[10]=d,t[11]=f,t[12]=g,t[13]=_,t[14]=v):v=t[14],v}function O(e){let t=(0,y.c)(12),{full:n,labelRef:r,render:i,children:a}=e,[o,s]=(0,h.useState)(!1),c;t[0]===r?c=t[1]:(c=e=>s(e&&T(r.current)),t[0]=r,t[1]=c);let l;t[2]!==a||t[3]!==i?(l=(0,x.jsx)(C,{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,x.jsx)(w,{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,x.jsxs)(S,{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{C as a,w as i,O as n,b as o,S as r,D as t};
2
+ //# sourceMappingURL=ClippedText-TtLeyAVc.js.map
@@ -0,0 +1,2 @@
1
+ import{a as e,t}from"./react-BUfh6y28.js";import{n,t as r}from"./jsx-runtime-DJeoFXNw.js";import{$_ as i,Bd as a,ME as o,Ud as s,Wb as c,_v as l,ev as u,is as d,jh as f,kh as p,l as m,mr as h,t as g,vf as _}from"./utils-DjbLtxuo.js";import{Tr as v,br as y}from"./runtime-BBYIQ0f-.js";import{C as b,S as x,f as ee,k as te,q as S}from"./useSettings-EYJbJzT3.js";import{f as C}from"./server-Dkj4NeYG.js";import{i as w,n as ne}from"./session-CBEVNHld.js";import{n as re}from"./query-D3KVoW9G.js";import{t as T}from"./use-atom-command-BbFDhw_c.js";import{n as E,t as D}from"./radio-group-BnZVD-CO.js";import{t as ie}from"./input-CQaedaQh.js";import{a as O,c as k,i as A,r as j,s as M,t as ae}from"./dialog-DTVhbEqi.js";import{S as N}from"./Icons-D_LFMxsj.js";import{t as P}from"./preview-B4_sjsUX.js";import{S as F,t as oe}from"./ChatGptUsageButton-BldpBXxU.js";import{t as I}from"./RedactedSensitiveText-B-u4PB3I.js";import{a as se}from"./settingsLayout-BbEwQ6Fy.js";import{Da as ce,Oa as le,_o as ue,fo as L,ho as de,mo as fe,po as R,vo as pe}from"./main-B1sXOjZZ.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)(h,{...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:a,onAccountCreated:o}=e,s=w(n,l),c=ee(n),f;t[0]===n?f=t[1]:(f=C.providersValueAtom(n),t[0]=n,t[1]=f);let p=d(f),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]!==o||t[9]!==r||t[10]!==S||t[11]!==p||t[12]!==a||t[13]!==c||t[14]!==g){let e=p?.find(e=>e.instanceId===x),s=F(e),l;t[24]!==b||t[25]!==n||t[26]!==_||t[27]!==o||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_${m()}`);(await g({environmentId:n,input:{patch:{providerInstances:{...c.providerInstances,[e]:{driver:i.make(`codex`),displayName:b,enabled:!0,config:{enabled:!0,setupMode:`managed`}}}}}}))._tag===`Success`&&(o?(o(e,b),r()):te(e)),re(!1)},t[24]=b,t[25]=n,t[26]=_,t[27]=o,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=de,A=`wide`;let f=x?b:`Add ChatGPT account`;t[35]===f?j=t[36]:(j=(0,V.jsx)(R,{title:f,description:`Each account has its own Codex instance and sign-in. Choose the other account on the sign-in page.`}),t[35]=f,t[36]=j),E=fe,k=x?e?.setup?a(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]=o,t[9]=r,t[10]=S,t[11]=p,t[12]=a,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)(h,{variant:`outline`,onClick:r,children:`Finish later`}):(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(h,{variant:`outline`,disabled:S,onClick:r,children:`Cancel`}),(0,V.jsx)(h,{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=c(p),be=c(f),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(o(e)?e.value.binaryPath:`claude`,`claude`,n)} auth login`}if(e.driver===`codex`){let e=be(r?.config??{});return`${Se(o(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 d=u,f;return t[4]!==c||t[5]!==l||t[6]!==s||t[7]!==d||t[8]!==e||t[9]!==n?(f=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?d.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:d.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)(h,{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)(h,{size:`sm`,variant:`outline`,className:`min-w-44`,disabled:!0,children:`Open sign-in page`}),secondaryControl:(0,V.jsx)(h,{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]=d,t[8]=e,t[9]=n,t[10]=f):f=t[10],f}function Ne(e){let t=(0,B.c)(9),{environmentId:n,onClose:r,onAccountCreated:i}=e,a=w(n,l),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:d,onSignInCancelled:f}){let p={environmentId:e,input:{instanceId:t}},m=re(C.providerAuthState(p)),ee=re(C.providerInstallState(p)),[w,ne]=(0,z.useState)(null),E=re(w?C.chatGptHandoffState(w):null),D=E.data?.phase===`auth`?E.data.state:m.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,de=b(e),fe=de!==null&&P(new URL(de).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&&(!fe||window.desktopBridge?.receiveProviderAuthCallback!==void 0),U=H&&!window.desktopBridge?.receiveProviderAuthCallback,we=te(),Te=x(we),Ee=b(we),De=!fe&&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||m.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(!y(r)){let e=v(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 S().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 S().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&&le(W.toString())?ce({authorizationUrl:F,returnUrl:W.toString(),environmentId:e,instanceId:t,flowId:D.flowId},!1):null,pt=(0,V.jsx)(h,{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)(h,{variant:`outline`,type:`submit`,disabled:G||i||!Pe.trim(),children:`Connect`})]}),U?null:(0,V.jsx)(`div`,{children:(0,V.jsxs)(h,{size:`xs`,variant:`ghost-muted`,onClick:()=>void S().shell.openExternal(F),children:[`Try sign-in in your browser`,(0,V.jsx)(_,{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)(h,{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)(ue,{open:Ae,children:(0,V.jsx)(pe,{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??(m.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:d||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)(h,{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)(h,{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)(h,{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 max-w-88 flex-wrap items-center justify-end gap-2`,children:X?(0,V.jsxs)(V.Fragment,{children:[pt,!Je&&(0,V.jsx)(h,{size:`sm`,variant:`ghost`,disabled:G||i,onClick:()=>{(w||D?.flowId)&&(Ue.current=!1,it(),f?.())},children:`Cancel`})]}):Y?(0,V.jsx)(h,{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)(h,{size:`sm`,variant:`outline`,disabled:Z||Q,onClick:()=>k(!0),children:`Change account`}),(0,V.jsx)(h,{size:`sm`,variant:`ghost`,disabled:Z||Q,onClick:()=>void $(()=>ye(p)),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)(h,{size:`sm`,variant:`ghost`,disabled:Z||Q,onClick:()=>void ot(`chatgpt-change-account`),children:`Use a different account`}):null,l?(0,V.jsx)(h,{size:`sm`,variant:`ghost`,disabled:i||Q,onClick:()=>o(`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||m.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,c=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 ${c?`rotate-90`:``}`,u;t[2]===l?u=t[3]:(u=(0,V.jsx)(s,{"aria-hidden":!0,className:l}),t[2]=l,t[3]=u);let d;return t[4]!==i||t[5]!==c||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":c,"aria-controls":i,onClick:a,children:[o,u]}),t[4]=i,t[5]=c,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-BO6ZAijp.js.map
@@ -0,0 +1,2 @@
1
+ import{a as e,t}from"./react-BUfh6y28.js";import{t as n}from"./jsx-runtime-DJeoFXNw.js";import{Ao as r,Ar as i,Ba as a,Bn as o,Br as s,Ca as c,Co as l,Cr as u,Da as d,Dn as f,Do as ee,Dr as p,Eo as m,Fn as te,Fo as h,Fr as g,Ga as _,Gn as v,Ha as y,Hn as b,Ia as x,Ii as S,In as C,Ir as w,La as T,Li as E,Ln as ne,Lr as D,Ma as O,Mn as k,Mo as A,Mr as re,Na as j,No as M,Oa as N,Oi as ie,On as ae,Oo as oe,Pa as se,Pi as P,Pn as ce,Po as F,Pr as le,Qa as ue,Ra as I,Ri as de,Rn as fe,So as pe,Ta as me,Tn as he,Ui as ge,Un as _e,Ur as ve,Vn as ye,Wa as L,Wn as be,Xa as xe,Za as Se,_a as Ce,ca as we,ci as Te,da as Ee,fo as De,jn as R,jo as Oe,ki as z,kr as ke,la as Ae,li as je,lo as Me,mi as Ne,oo as Pe,po as Fe,qi as Ie,so as Le,to as Re,ua as ze,uo as Be,va as Ve,wo as He,xa as Ue,yi as We,za as Ge,zn as Ke,zr as qe}from"./utils-DjbLtxuo.js";import{t as Je}from"./useRegisterFieldControl-BtJcyaxh.js";import{t as Ye}from"./FormContext-BcA1kdFD.js";var B=e(t()),Xe=B.createContext(void 0),Ze=B.createContext(void 0),Qe=B.createContext(void 0),$e=B.createContext(``);function et(){let e=B.useContext(Xe);if(!e)throw Error(h(22));return e}function tt(){let e=B.useContext(Ze);if(!e)throw Error(h(23));return e}function nt(){let e=B.useContext(Qe);if(!e)throw Error(h(24));return e}function rt(){return B.useContext($e)}var V={id:P(e=>e.id),labelId:P(e=>e.labelId),items:P(e=>e.items),selectedValue:P(e=>e.selectedValue),hasSelectionChips:P(e=>{let t=e.selectedValue;return Array.isArray(t)&&t.length>0}),hasSelectedValue:P(e=>{let{selectedValue:t,selectionMode:n}=e;return t==null?!1:n===`multiple`&&Array.isArray(t)?t.length>0:!0}),hasNullItemLabel:P((e,t)=>t?f(e.items):!1),open:P(e=>e.open),mounted:P(e=>e.mounted),forceMounted:P(e=>e.forceMounted),inline:P(e=>e.inline),activeIndex:P(e=>e.activeIndex),selectedIndex:P(e=>e.selectedIndex),isActive:P((e,t)=>e.activeIndex===t),isSelected:P((e,t)=>{let n=e.isItemEqualToValue,r=e.selectedValue;return Array.isArray(r)?r.some(e=>ce(t,e,n)):ce(t,r,n)}),transitionStatus:P(e=>e.transitionStatus),popupProps:P(e=>e.popupProps),inputProps:P(e=>e.inputProps),triggerProps:P(e=>e.triggerProps),itemProps:P(e=>e.itemProps),positionerElement:P(e=>e.positionerElement),listElement:P(e=>e.listElement),triggerElement:P(e=>e.triggerElement),inputElement:P(e=>e.inputElement),inputGroupElement:P(e=>e.inputGroupElement),popupSide:P(e=>e.popupSide),openMethod:P(e=>e.openMethod),inputInsidePopup:P(e=>e.inputInsidePopup),inputOwnsFormValue:P(e=>e.inputOwnsFormValue),selectionMode:P(e=>e.selectionMode),name:P(e=>e.name),form:P(e=>e.form),disabled:P(e=>e.disabled),readOnly:P(e=>e.readOnly),required:P(e=>e.required),grid:P(e=>e.grid),virtualized:P(e=>e.virtualized),itemToStringLabel:P(e=>e.itemToStringLabel),isItemEqualToValue:P(e=>e.isItemEqualToValue),modal:P(e=>e.modal),autoHighlight:P(e=>e.autoHighlight),submitOnItemClick:P(e=>e.submitOnItemClick)};function it(e,t){return(n,r)=>{if(n==null)return!1;let i=R(n,t);return e.contains(i,r)}}function at(e,t,n){return(r,i)=>{if(r==null)return!1;if(!i)return!0;let a=R(r,t),o=n==null?``:R(n,t);return o&&e.contains(o,i)&&o.length===i.length?!0:e.contains(a,i)}}var H=new Map;function ot(e={}){let t={usage:`search`,sensitivity:`base`,ignorePunctuation:!0,...e},n=`${st(e.locale)}|${JSON.stringify(t)}`,r=H.get(n);if(r)return r;let i=new Intl.Collator(e.locale,t),a={contains(e,t,n){if(!t)return!0;let r=R(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=R(e,n);return i.compare(r.slice(0,t.length),t)===0},endsWith(e,t,n){if(!t)return!0;let r=R(e,n),a=t.length;return r.length>=a&&i.compare(r.slice(r.length-a),t)===0}};return H.set(n,a),a}function st(e){return Array.isArray(e)?e.map(e=>st(e)).join(`,`):e==null?``:String(e)}var ct=ot;function lt(e={}){let{multiple:t=!1,value:n,...r}=e,i=ot(r),a=B.useCallback((e,r,a)=>t?it(i,a)(e,r):at(i,a,n)(e,r),[i,n,t]);return B.useMemo(()=>({contains:a,startsWith:i.startsWith,endsWith:i.endsWith}),[a,i])}var ut=Symbol(`none`),dt={value:ut,index:-1},U=e(n());function ft(e){let{id:t,onOpenChangeComplete:n,defaultSelectedValue:a=null,selectedValue:o,onSelectedValueChange:s,defaultInputValue:c,inputValue:l,open:u,defaultOpen:d=!1,selectionMode:f=`none`,onItemHighlighted:ee,name:m,form:h,disabled:g=!1,readOnly:v=!1,required:y=!1,inputRef:b,grid:x=!1,items:w,filteredItems:T,filter:D,openOnInputClick:re=!0,autoHighlight:se=!1,keepHighlight:P=!1,highlightItemOnHover:le=!0,loopFocus:ue=!0,itemToStringLabel:I,itemToStringValue:de,isItemEqualToValue:pe=te,virtualized:he=!1,inline:ge=!1,fillInputOnItemPress:ve=!0,modal:ye=!1,limit:be=-1,autoComplete:Se=`list`,formAutoComplete:Te,locale:De,submitOnItemClick:Pe=!1}=e,{clearErrors:Ie}=Ye(),{setDirty:Re,validityData:ze,shouldValidateOnChange:He,setFilled:Ue,name:Ge,disabled:et,setTouched:tt,setFocused:nt,validationMode:rt,validation:H}=_e(),ot=qe(),st=Ke({id:t}),lt=ct({locale:De}),[ft,pt]=B.useState(!1),[mt,ht]=B.useState(null),gt=B.useRef([]),_t=B.useRef([]),vt=B.useRef(null),W=B.useRef(null),yt=B.useRef(null),bt=B.useRef(null),xt=B.useRef(null),St=B.useRef(!0),Ct=B.useRef(!1),wt=B.useRef(null),Tt=B.useRef(null),Et=B.useRef(null),Dt=B.useRef(dt),Ot=B.useRef(null),kt=B.useRef([]),At=B.useRef([]),jt=et||g,Mt=Ge??m,G=f===`multiple`,K=f===`single`,Nt=l!==void 0||c!==void 0,Pt=w!==void 0,Ft=T!==void 0,q;q=se===`always`?`always`:se?`input-change`:!1;let[J,It]=xe({controlled:o,default:G?a??r:a,name:`Combobox`,state:`selectedValue`}),Lt=B.useMemo(()=>D===null?()=>!0:D===void 0?K&&!ft?at(lt,I,J):it(lt,I):D,[D,K,J,ft,lt,I]),Rt=F(()=>Nt?c??``:K?R(J,I):``).current,[Y,zt]=xe({controlled:l,default:Rt,name:`Combobox`,state:`inputValue`}),[X,Bt]=xe({controlled:u,default:d,name:`Combobox`,state:`open`}),Vt=ae(w),Z=mt??(Y===``?``:String(Y).trim()),Ht=K?R(J,I):``,Ut=K&&!ft&&Z!==``&&Ht!==``&&Ht.length===Z.length&&lt.contains(Ht,Z),Wt=Ut?``:Z,Gt=Pt&&Ft&&Ut,Kt=B.useMemo(()=>w?Vt?w.flatMap(e=>e.items):w:r,[w,Vt]),qt=B.useMemo(()=>{if(T&&!Gt)return T;if(!w)return r;if(Vt){let e=w,t=[],n=0;for(let r of e){if(be>-1&&n>=be)break;let e=Wt===``?r.items:r.items.filter(e=>Lt(e,Wt,I));if(e.length===0)continue;let i=be>-1?be-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 be>-1?Kt.slice(0,be):Kt;let e=[];for(let t of Kt){if(be>-1&&e.length>=be)break;Lt(t,Wt,I)&&e.push(t)}return e},[T,Gt,w,Vt,Wt,be,Lt,I,Kt]),Jt=B.useMemo(()=>Vt?qt.flatMap(e=>e.items):qt,[qt,Vt]),Q=F(()=>new ie({id:st,labelId:void 0,selectedValue:J,open:X,filter:Lt,query:Z,items:w,selectionMode:f,listRef:gt,labelsRef:_t,popupRef:vt,emptyRef:xt,inputRef:W,startDismissRef:yt,endDismissRef:bt,keyboardActiveRef:St,chipsContainerRef:wt,clearRef:Tt,valuesRef:kt,allValuesRef:At,selectionEventRef:Et,name:Mt,form:h,disabled:jt,readOnly:v,required:y,grid:x,isGrouped:Vt,virtualized:he,openOnInputClick:re,itemToStringLabel:I,isItemEqualToValue:pe,modal:ye,autoHighlight:q,submitOnItemClick:Pe,hasInputValue:Nt,mounted:!1,forceMounted:!1,transitionStatus:`idle`,inline:ge,activeIndex:null,selectedIndex:null,popupProps:{},inputProps:{},triggerProps:{},itemProps:Oe,positionerElement:null,listElement:null,triggerElement:null,inputElement:null,inputGroupElement:null,popupSide:null,openMethod:null,inputInsidePopup:!0,inputOwnsFormValue:f===`none`,onOpenChangeComplete:n||A,setOpen:A,setInputValue:A,setSelectedValue:A,setIndices:A,onItemHighlighted:A,handleSelection:A,forceMount:A,requestSubmit:A})).current,Yt=f===`none`?Y:J,Xt=B.useMemo(()=>f===`none`?Yt:Array.isArray(J)?J.map(e=>k(e,de)):k(J,de),[Yt,de,f,J]),Zt=_(ee),Qt=_(n),$t=z(Q,V.activeIndex),en=z(Q,V.selectedIndex),tn=z(Q,V.positionerElement),nn=z(Q,V.listElement),rn=z(Q,V.triggerElement),an=z(Q,V.inputElement),on=z(Q,V.inputGroupElement),$=z(Q,V.inline),sn=z(Q,V.inputInsidePopup),cn=z(Q,V.inputOwnsFormValue),ln=Ee(rn),{mounted:un,setMounted:dn,transitionStatus:fn}=N(X),{openMethod:pn,triggerProps:mn}=p(X),hn=_(()=>Xt);Je(sn?ln:W,st,Yt,hn);let gn=_(()=>{w?_t.current=Jt.map(e=>R(e,I)):Q.set(`forceMounted`,!0)}),_n=B.useRef(J);L(()=>{J!==_n.current&&gn()},[gn,J]);let vn=_(e=>{Q.update(e);let t=e.type||`none`;if(e.activeIndex!==void 0){if(e.activeIndex===null)Dt.current!==dt&&(Dt.current=dt,Zt(void 0,j(t,void 0,{index:-1})));else{let n=kt.current[e.activeIndex];Dt.current={value:n,index:e.activeIndex},Zt(n,j(t,void 0,{index:e.activeIndex}))}}}),yn=_((t,n)=>{if(Ct.current=n.reason===Le,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&&pt(!0),Ot.current={hasQuery:e},e&&q&&Q.state.activeIndex==null&&Q.set(`activeIndex`,0)}}zt(t)}}),bn=_((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&&!$&&mt!==null&&(pt(!1),ht(null),Y!==``&&yn(``,O(Le,n.event))),!t&&ft&&(K?($||ht(Z),Z===``&&pt(!1)):G&&($||ht(Z),sn&&vn({activeIndex:null}),(!sn||$)&&yn(``,O(Le,n.event)))),Bt(t),!t&&sn&&(n.reason===`focus-out`||n.reason===`outside-press`)&&(tt(!0),nt(!1),rt===`onBlur`)))){let e=f===`none`?Y:J;H.commit(e)}}),xn=_((e,t)=>{s?.(e,t),!t.isCanceled&&(It(e),(f===`none`&&vt.current&&ve||K&&!Q.state.inputInsidePopup)&&yn(R(e,I),O(t.reason,t.event)),K&&e!=null&&t.reason!==`input-change`&&ft&&!$&&ht(Z))}),Sn=_((e,t)=>{let n=t;if(n===void 0){if($t===null)return;n=kt.current[$t]}let r=Ve(e),i=Et.current??e;Et.current=null;let a=O(Be,i),o=r?.closest(`a`)?.getAttribute(`href`);if(o)o.startsWith(`#`)&&bn(!1,a);else if(G){let e=Array.isArray(J)?J:[],t=fe(e,n,Q.state.isItemEqualToValue)?ne(e,n,Q.state.isItemEqualToValue):[...e,n];if(xn(t,a),!(W.current&&W.current.value.trim()!==``))return;Q.state.inputInsidePopup?yn(``,O(Le,a.event)):bn(!1,a)}else xn(n,a),bn(!1,a)}),Cn=_(()=>{if(!Q.state.submitOnItemClick)return;let e=H.inputRef.current?.form??Q.state.inputElement?.form;e&&typeof e.requestSubmit==`function`&&e.requestSubmit()}),wn=_(()=>{if(dn(!1),Qt?.(!1),pt(!1),ht(null),vn(f===`none`?{activeIndex:null,selectedIndex:null}:{activeIndex:null}),G&&W.current&&W.current.value!==``&&!Ct.current&&yn(``,O(Le)),K){if(Q.state.inputInsidePopup)W.current&&W.current.value!==``&&yn(``,O(Le));else{let e=R(J,I);W.current&&W.current.value!==e&&yn(e,O(e===``?Le:Fe))}}}),Tn=B.useMemo(()=>$&&tn?{current:tn.closest(`[role="dialog"]`)}:vt,[$,tn]);me({enabled:!e.actionsRef,open:X,ref:Tn,onComplete(){X||wn()}}),B.useImperativeHandle(e.actionsRef,()=>({unmount:wn}),[wn]),L(function(){if(X||f===`none`)return;let e=w?Kt:At.current;if(G){let t=Array.isArray(J)?J:[],n=t[t.length-1],r=C(e,n,pe);vn({selectedIndex:r===-1?null:r})}else{let t=C(e,J,pe);vn({selectedIndex:t===-1?null:t})}},[X,J,w,f,Kt,G,pe,vn]),L(()=>{w&&(kt.current=Jt,gt.current.length=Jt.length)},[w,Jt]),L(()=>{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}Dt.current!==dt&&(Dt.current=dt,Q.state.onItemHighlighted(void 0,j(Fe,void 0,{index:-1})));return}if(n>=t.length){Dt.current!==dt&&(Dt.current=dt,Q.state.onItemHighlighted(void 0,j(Fe,void 0,{index:-1}))),Q.set(`activeIndex`,null);return}let r=t[n],i=Dt.current.value,a=i!==ut&&ce(r,i,Q.state.isItemEqualToValue);Dt.current.index===n&&a||(Dt.current={value:r,index:n},Q.state.onItemHighlighted(r,j(Fe,void 0,{index:n})))},[$t,q,Ft,Pt,Jt,$,X,Q]),L(()=>{Ue(f===`none`?String(Y)!==``:G?Array.isArray(J)&&J.length>0:J!=null)},[Ue,f,Y,J,G]),B.useEffect(()=>{Pt&&q&&Jt.length===0&&vn({activeIndex:null})},[Pt,q,Jt.length,vn]),ke(Z,()=>{X&&Z!==``&&Z!==String(Rt)&&pt(!0)}),ke(J,()=>{if(f!==`none`&&(Ie(Mt),Re(J!==ze.initialValue),He()?H.commit(J):H.commit(J,!0),K&&!Nt&&!sn)){let e=R(J,I);Y!==e&&yn(e,O(Fe))}}),ke(Y,()=>{f===`none`&&(Ie(Mt),Re(Y!==ze.initialValue),He()?H.commit(Y):H.commit(Y,!0))}),ke(w,()=>{if(!K||Nt||sn||ft)return;let e=R(J,I);Y!==e&&yn(e,O(Fe))});let En=Ne({open:$?!0:X,onOpenChange:bn,elements:{reference:sn?rn:an,floating:tn}}),Dn,On;$||(Dn=x?`grid`:`listbox`,On=X?`true`:`false`);let kn=B.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`]=Se),{reference:r,floating:{role:`presentation`}}},[an,X,On,Dn,nn?.id,Se]),An=E(En,{enabled:!v&&!jt&&re,event:`mousedown-only`,toggle:!1,touchOpenDelay:sn?0:100,reason:Me}),jn=S(En,{enabled:!v&&!jt&&!$,outsidePressEvent:{mouse:`sloppy`,touch:`intentional`},bubbles:$?!0:void 0,outsidePress(e){let t=Ve(e);return!Ce(rn,t)&&!Ce(Tt.current,t)&&!Ce(wt.current,t)&&!Ce(on,t)}}),Mn=je(En,{enabled:!v&&!jt,id:st,listRef:gt,activeIndex:$t,selectedIndex:en,virtual:!0,loopFocus:ue,allowEscape:ue&&!q,focusItemOnOpen:ft||f===`none`&&!q?!1:`auto`,focusItemOnHover:le,resetOnPointerLeave:!P,cols:x?2:1,orientation:x?`horizontal`:void 0,rtl:ot===`rtl`,disabledIndices:r,onNavigate(e,t){(t||X)&&fn!==`ending`&&vn(t?{activeIndex:e,type:St.current?`keyboard`:`pointer`}:{activeIndex:e})}}),Nn=B.useMemo(()=>oe(Mn.reference,jn.reference,An.reference,kn.reference),[Mn.reference,jn.reference,An.reference,kn.reference]),Pn=B.useMemo(()=>oe(We,Mn.floating,jn.floating,kn.floating),[Mn.floating,jn.floating,kn.floating]),Fn=B.useMemo(()=>{let e=Mn.item;return e?{...e,onFocus:void 0}:Oe},[Mn.item]);i(()=>{Q.update({inline:ge,popupProps:Pn,inputProps:Nn,triggerProps:mn,itemProps:Fn,setOpen:bn,setInputValue:yn,setSelectedValue:xn,setIndices:vn,onItemHighlighted:Zt,handleSelection:Sn,forceMount:gn,requestSubmit:Cn})}),L(()=>{Q.update({id:st,selectedValue:J,open:X,mounted:un,transitionStatus:fn,items:w,inline:ge,popupProps:Pn,inputProps:Nn,triggerProps:mn,openMethod:pn,itemProps:Fn,selectionMode:f,name:Mt,form:h,disabled:jt,readOnly:v,required:y,grid:x,isGrouped:Vt,virtualized:he,onOpenChangeComplete:Qt,openOnInputClick:re,itemToStringLabel:I,modal:ye,autoHighlight:q,isItemEqualToValue:pe,submitOnItemClick:Pe,hasInputValue:Nt,requestSubmit:Cn,inputOwnsFormValue:f===`none`&&(ge||!Q.state.inputInsidePopup)})},[Q,st,J,X,un,fn,w,Pn,Nn,Fn,pn,mn,f,Mt,jt,v,y,H,x,Vt,he,Qt,re,I,ye,pe,Pe,Nt,ge,Cn,q,h]);let In=M(b,H.inputRef),Ln=B.useMemo(()=>({query:Z,hasItems:Pt,filteredItems:qt,flatFilteredItems:Jt}),[Z,Pt,qt,Jt]),Rn=B.useMemo(()=>Array.isArray(Yt)?``:k(Yt,de),[Yt,de]),zn=G&&Array.isArray(J)&&J.length>0,Bn=G||f===`none`&&cn?void 0:Mt,Vn=B.useMemo(()=>!G||!Array.isArray(J)||!Mt?null:J.map(e=>{let t=k(e,de);return(0,U.jsx)(`input`,{type:`hidden`,form:h,name:Mt,value:t},t)}),[G,J,h,Mt,de]),Hn=(0,U.jsxs)(B.Fragment,{children:[e.children,(0,U.jsx)(`input`,{...H.getInputValidationProps({onFocus(){sn?rn?.focus():(W.current||rn)?.focus()},onChange(e){if(e.nativeEvent.defaultPrevented||jt||v){e.preventBaseUIHandler?.();return}let t=e.currentTarget.value,n=O(Fe,e.nativeEvent);function r(){if(G)return;if(f===`none`){Re(t!==ze.initialValue),yn(t,n),He()&&H.commit(t);return}let e=kt.current.find(e=>k(e,de).toLowerCase()===t.toLowerCase()||R(e,I).toLowerCase()===t.toLowerCase());e!=null&&(Re(e!==ze.initialValue),xn?.(e,n),He()&&H.commit(e))}w?r():(gn(),queueMicrotask(r))}}),id:st&&Bn==null?`${st}-hidden-input`:void 0,form:h,name:Bn,autoComplete:Te,disabled:jt,required:y&&!zn,readOnly:v,value:Rn,ref:In,style:Bn?Ae:we,tabIndex:-1,"aria-hidden":!0,suppressHydrationWarning:!0}),Vn]});return(0,U.jsx)(Xe.Provider,{value:Q,children:(0,U.jsx)(Ze.Provider,{value:En,children:(0,U.jsx)(Qe.Provider,{value:Ln,children:(0,U.jsx)($e.Provider,{value:Y,children:Hn})})})})}var pt={...l,...v,popupSide:e=>e?{"data-popup-side":e}:null,listEmpty:e=>e?{"data-list-empty":``}:null},mt=B.createContext(void 0);function ht(){return B.useContext(mt)}var gt=B.createContext(void 0);function _t(e){let t=B.useContext(gt);if(t===void 0&&!e)throw Error(h(21));return t}var vt=B.forwardRef(function(e,t){let n=et(),{buttonRef:r,getButtonProps:i}=y({native:!1}),a=M(t,r);function o(e){n.state.setOpen(!1,O(ue,e.nativeEvent,e.currentTarget))}let s=i({onClick:o});return(0,U.jsx)(`span`,{ref:a,...s,"aria-label":`Dismiss`,tabIndex:void 0,style:Ae})}),W=B.forwardRef(function(e,t){let{render:n,className:r,disabled:i=!1,id:a,style:s,...c}=e,{state:l,disabled:u,setTouched:d,setFocused:f,validationMode:p,validation:m}=_e(),{labelId:te}=o(),h=ht(),g=!!_t(!0),v=et(),{filteredItems:y}=nt(),x=rt(),S=qe(),C=z(v,V.required),w=z(v,V.disabled),T=z(v,V.readOnly),E=z(v,V.name),ne=z(v,V.form),D=z(v,V.selectionMode),k=z(v,V.autoHighlight),A=z(v,V.inputProps),re=z(v,V.triggerProps),j=z(v,V.open),M=z(v,V.mounted),N=z(v,V.selectedValue),ie=z(v,V.popupSide),ae=z(v,V.positionerElement),oe=z(v,V.id),P=z(v,V.inline),ce=z(v,V.modal),F=!!k,le=M&&ae?ie:null,ue=u||w||i,de=y.length===0,fe=g||P,pe=!fe||ce,me=se(a??(fe?void 0:oe)),ge=he(te,void 0),ve=g?be:l,[L,xe]=B.useState(null),Se=B.useRef(!1),Ce=B.useRef(null),we=B.useRef(!1),Te=D===`none`&&!g,Ee=_(e=>{let t=g||v.state.inline;t&&!v.state.hasInputValue&&v.state.setInputValue(``,O(Fe)),v.update({inputElement:e,inputInsidePopup:t,inputOwnsFormValue:Te})}),De=g||!m?c:m.getValidationProps(c),R={...ve,open:j,disabled:ue,readOnly:T,popupSide:le,listEmpty:de};function Oe(e){if(!h)return;let t,{highlightedChipIndex:n}=h,r=h.chipsRef.current.length,i=S===`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>=N.length-1?N.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&&N.length>0?(e.preventDefault(),t=r>0?r-1:void 0):e.key===`Backspace`&&e.currentTarget.value===``&&N.length>0&&(v.state.setIndices({activeIndex:null,selectedIndex:null,type:`keyboard`}),e.preventDefault()),t}let ke=ee(`input`,e,{state:R,ref:[t,v.state.inputRef,Ee],props:[A,re,{type:`text`,value:e.value??L??x,"aria-readonly":T||void 0,"aria-required":C||void 0,"aria-labelledby":ge,disabled:ue,readOnly:T,required:D===`none`?C:void 0,form:ne,...Te&&E&&{name:E},id:me,onFocus(){if(f(!0),!P||!we.current)return;we.current=!1;let e=Ce.current;e!=null&&Object.hasOwn(v.state.valuesRef.current,e)&&v.state.setIndices({activeIndex:e})},onBlur(){d(!0),f(!1);let e=v.state.activeIndex;if(P&&e!==null&&k!==`always`&&(Ce.current=e,we.current=!0,v.state.setIndices({activeIndex:null})),p===`onBlur`){let e=D===`none`?x:N;m.commit(e)}},onCompositionStart(e){I||(Se.current=!0,xe(e.currentTarget.value))},onCompositionEnd(e){Se.current=!1;let t=e.currentTarget.value;xe(null),v.state.setInputValue(t,O(Pe,e.nativeEvent))},onChange(e){let t=e.nativeEvent.inputType,n=!t||t===`insertReplacementText`,r=Se.current||!n;if(Se.current){let t=e.currentTarget.value;xe(t),t===``&&!v.state.openOnInputClick&&!v.state.inputInsidePopup&&v.state.setOpen(!1,O(Le,e.nativeEvent));let n=t.trim(),i=F&&n!==``;!T&&!ue&&n&&r&&(v.state.setOpen(!0,O(Pe,e.nativeEvent)),F||v.state.setIndices({activeIndex:null,selectedIndex:null,type:v.state.keyboardActiveRef.current?`keyboard`:`pointer`})),j&&v.state.activeIndex!==null&&!i&&v.state.setIndices({activeIndex:null,selectedIndex:null,type:v.state.keyboardActiveRef.current?`keyboard`:`pointer`});return}v.state.setInputValue(e.currentTarget.value,O(Pe,e.nativeEvent));let i=e.currentTarget.value===``,a=O(Le,e.nativeEvent);i&&!v.state.inputInsidePopup&&(D===`single`&&v.state.setSelectedValue(null,a),v.state.openOnInputClick||v.state.setOpen(!1,a));let o=e.currentTarget.value.trim();!T&&!ue&&o&&r&&(v.state.setOpen(!0,O(Pe,e.nativeEvent)),F||v.state.setIndices({activeIndex:null,selectedIndex:null,type:v.state.keyboardActiveRef.current?`keyboard`:`pointer`})),j&&v.state.activeIndex!==null&&!F&&v.state.setIndices({activeIndex:null,selectedIndex:null,type:v.state.keyboardActiveRef.current?`keyboard`:`pointer`})},onKeyDown(e){if(ue||T||e.ctrlKey||e.shiftKey||e.altKey||e.metaKey)return;v.state.keyboardActiveRef.current=!0;let t=e.currentTarget,n=t.scrollWidth-t.clientWidth,r=S===`rtl`;if(e.key===`Home`){Ue(e);let n=Ge&&r?t.value.length:0;t.setSelectionRange(n,n),t.scrollLeft=0;return}if(e.key===`End`){Ue(e);let i=Ge&&r?0:t.value.length;t.setSelectionRange(i,i),t.scrollLeft=r?-n:n;return}if(!M&&e.key===`Escape`){let t=D===`multiple`&&Array.isArray(N)?N.length===0:N===null,n=O(Re,e.nativeEvent),r=D===`multiple`?[]:null;v.state.setInputValue(``,n),v.state.setSelectedValue(r,n),t||v.state.inline||n.isPropagationAllowed||e.stopPropagation();return}if(h&&e.key===`Backspace`&&t.value===``&&h.highlightedChipIndex===void 0&&Array.isArray(N)&&N.length>0){let t=h.chipsRef.current.length,n=t>0?t-1:N.length-1,r=N.filter((e,t)=>t!==n);v.state.setIndices({activeIndex:null,selectedIndex:null,type:v.state.keyboardActiveRef.current?`keyboard`:`pointer`}),v.state.setSelectedValue(r,O(Fe,e.nativeEvent));return}let i=h?.highlightedChipIndex!==void 0,a=Oe(e);if(h?.setHighlightedChipIndex(a),a===void 0?i&&v.state.inputRef.current?.focus():h?.chipsRef.current[a]?.focus(),e.which!==229&&e.key===`Enter`&&j){let t=v.state.activeIndex,n=e.nativeEvent;if(t===null){if(P)return;v.state.setOpen(!1,O(Fe,n));return}Ue(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}},De],stateAttributesMapping:pt}),Ae=g?(0,U.jsx)(b.Provider,{value:ye,children:ke}):ke;return(0,U.jsxs)(B.Fragment,{children:[j&&pe&&(0,U.jsx)(vt,{ref:v.state.startDismissRef}),Ae]})}),yt=2,bt=B.forwardRef(function(e,t){let{render:n,className:r,nativeButton:i=!0,disabled:a=!1,id:s,style:l,...d}=e,{state:f,disabled:p,setTouched:m,setFocused:te,validationMode:h,validation:g}=_e(),{labelId:v}=o(),b=et(),{filteredItems:x}=nt(),S=z(b,V.selectionMode),C=z(b,V.disabled),w=z(b,V.readOnly),T=z(b,V.required),ne=z(b,V.mounted),D=z(b,V.popupSide),k=z(b,V.positionerElement),A=z(b,V.listElement),re=z(b,V.triggerProps),j=z(b,V.triggerElement),M=z(b,V.inputInsidePopup),N=z(b,V.id),ie=z(b,V.labelId),ae=z(b,V.open),oe=z(b,V.selectedValue),se=z(b,V.activeIndex),P=z(b,V.selectedIndex),ce=z(b,V.hasSelectedValue),F=tt(),le=rt(),ue=c(),I=p||C||a,de=x.length===0,fe=ne&&k?D:null;Ke({id:M?s:void 0});let pe=M?s??N:s,me=he(v,ie),ge=B.useRef(``);function ve(e){ge.current=e.pointerType}let ye=F.useState(`domReferenceElement`);B.useEffect(()=>{M&&j&&j!==ye&&F.set(`domReferenceElement`,j)},[j,ye,F,M]);let{reference:L}=Te(F,{enabled:!ae&&!w&&!C&&S===`single`,listRef:b.state.labelsRef,activeIndex:se,selectedIndex:P,onMatch(e){let t=b.state.valuesRef.current[e];t!==void 0&&b.state.setSelectedValue(t,O(`none`))}}),{reference:be}=E(F,{enabled:!w&&!C,event:`mousedown`}),{buttonRef:xe,getButtonProps:Se}=y({native:i,disabled:I}),we={...f,open:ae,disabled:I,popupSide:fe,listEmpty:de,placeholder:S!==`none`&&!ce},Ee=_(e=>{b.set(`triggerElement`,e)});return ee(`button`,e,{ref:[t,xe,Ee],state:we,props:[re,be,L,{id:pe,tabIndex:M?0:-1,role:M?`combobox`:void 0,"aria-expanded":ae?`true`:`false`,"aria-haspopup":M?`dialog`:`listbox`,"aria-controls":ae?A?.id:void 0,"aria-required":M&&T||void 0,"aria-labelledby":me,onPointerDown:ve,onPointerEnter:ve,onFocus(){te(!0),!(I||w)&&ue.start(0,b.state.forceMount)},onBlur(e){if(!Ce(k,e.relatedTarget)&&(m(!0),te(!1),h===`onBlur`)){let e=S===`none`?le:oe;g.commit(e)}},onMouseDown(e){if(I||w||(M||F.set(`domReferenceElement`,e.currentTarget),b.state.forceMount(),ge.current!==`touch`&&(b.state.inputRef.current?.focus(),M||e.preventDefault()),ae))return;let t=ze(e.currentTarget);function n(e){if(!j)return;let t=Ve(e),n=b.state.positionerElement,r=b.state.listElement;if(Ce(j,t)||Ce(n,t)||Ce(r,t)||t===j)return;let i=u(j),a=e.clientX>=i.left-yt&&e.clientX<=i.right+yt,o=e.clientY>=i.top-yt&&e.clientY<=i.bottom+yt;a&&o||b.state.setOpen(!1,O(`cancel-open`,e))}M&&t.addEventListener(`mouseup`,n,{once:!0})},onKeyDown(e){I||w||(e.key===`ArrowDown`||e.key===`ArrowUp`)&&(Ue(e),b.state.setOpen(!0,O(De,e.nativeEvent)),b.state.inputRef.current?.focus())}},g?g.getValidationProps(d):d,Se],stateAttributesMapping:pt})}),xt=B.createContext(null);function St(){return B.useContext(xt)}function Ct(e){let{children:t,items:n}=e,r=B.useMemo(()=>({items:n}),[n]);return(0,U.jsx)(xt.Provider,{value:r,children:t})}function wt(e){let{children:t}=e,{filteredItems:n}=nt(),r=St(),i=r?r.items:n;return i?(0,U.jsx)(B.Fragment,{children:i.map(t)}):null}var Tt=B.forwardRef(function(e,t){var n;let{render:r,className:i,style:a,children:o,...s}=e,c=et(),l=tt(),u=!!_t(!0),{filteredItems:d,hasItems:f}=nt(),p=z(c,V.selectionMode),m=z(c,V.grid),te=z(c,V.popupProps),h=z(c,V.virtualized),g=p===`multiple`,v=d.length===0,y=_(e=>{c.set(`positionerElement`,e)}),b=_(e=>{c.set(`listElement`,e)}),x=B.useMemo(()=>typeof o==`function`?n||=(0,U.jsx)(wt,{children:o}):o,[o]),S={empty:v},C=l.useState(`floatingId`),T=ee(`div`,e,{state:S,ref:[t,b,u?null:y],props:[te,{children:x,tabIndex:-1,id:C,role:m?`grid`:`listbox`,"aria-multiselectable":g?`true`:void 0,onKeyDown(e){if(!(c.state.disabled||c.state.readOnly)&&e.key===`Enter`){let t=c.state.activeIndex;if(t==null)return;Ue(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?T:(0,U.jsx)(w,{elementsRef:c.state.listRef,labelsRef:f?void 0:c.state.labelsRef,children:T})}),Et=e(d()),Dt=`⁠`;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=c(),t=B.useRef(null);return B.useEffect(()=>{if(a)return;let n=t.current;if(n==null)return;let r=Ot(n);if(r==null)return;let i=r.nodeValue??``,o=`${i}${Dt}`;return r.nodeValue=o,e.start(200,()=>{r.nodeValue===o&&(r.nodeValue=i)}),()=>{e.clear(),r.nodeValue===o&&(r.nodeValue=i)}},[t,e]),t}var At=B.createContext(void 0);function jt(){let e=B.useContext(At);if(e===void 0)throw Error(h(20));return e}var Mt=B.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e,i=et(),a=z(i,V.mounted),o=z(i,V.forceMounted);return a||n||o?(0,U.jsx)(At.Provider,{value:n,children:(0,U.jsx)(ge,{ref:t,...r})}):null}),G=B.forwardRef(function(e,t){let{render:n,className:r,anchor:i,positionMethod:a=`absolute`,side:o=`bottom`,align:c=`center`,sideOffset:l=0,alignOffset:u=0,collisionBoundary:d=`clipping-ancestors`,collisionPadding:f=5,arrowPadding:ee=5,sticky:p=!1,disableAnchorTracking:m=!1,collisionAvoidance:te=Ie,style:h,...v}=e,y=et(),{filteredItems:b}=nt(),x=tt(),S=jt(),C=z(y,V.modal),w=z(y,V.open),T=z(y,V.mounted),E=z(y,V.openMethod),ne=z(y,V.positionerElement),O=z(y,V.triggerElement),k=z(y,V.inputElement),A=z(y,V.inputGroupElement),j=z(y,V.inputInsidePopup),M=z(y,V.transitionStatus),N=b.length===0,ie=D({anchor:i??(j?O:A??k),floatingRootContext:x,positionMethod:a,mounted:T,side:o,sideOffset:l,align:c,alignOffset:u,arrowPadding:ee,collisionBoundary:d,collisionPadding:f,sticky:p,disableAnchorTracking:m,keepMounted:S,collisionAvoidance:te,lazyFlip:!0});re(w&&C,E===`touch`,ne,O);let ae={open:w,side:ie.side,align:ie.align,anchorHidden:ie.anchorHidden,empty:N};L(()=>{y.set(`popupSide`,ie.side)},[y,ie.side]);let oe=_(e=>{y.set(`positionerElement`,e)}),se=le(e,ae,{styles:ie.positionerStyles,transitionStatus:M,props:v,refs:[t,oe],hidden:!T,inert:!w});return(0,U.jsxs)(gt.Provider,{value:ie,children:[T&&C&&(0,U.jsx)(g,{inert:s(!w),cutout:A??k??O}),se]})}),K={...pe,...m},Nt=B.forwardRef(function(e,t){let{render:n,className:r,style:i,initialFocus:a,finalFocus:o,...s}=e,c=et(),l=_t(),u=tt(),{filteredItems:d}=nt(),f=z(c,V.mounted),p=z(c,V.open),m=z(c,V.openMethod),te=z(c,V.transitionStatus),h=z(c,V.inputInsidePopup),g=z(c,V.inputElement),_=z(c,V.modal),v=d.length===0;me({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:te,empty:v},b=ee(`div`,e,{state:y,ref:[t,c.state.popupRef],props:[{role:h?`dialog`:`presentation`,tabIndex:-1,onFocus(e){let t=Ve(e.nativeEvent);m!==`touch`&&(Ce(c.state.listElement,t)||t===e.currentTarget)&&c.state.inputRef.current?.focus()}},ve(te),s],stateAttributesMapping:K}),x=a===void 0?h?e=>e===`touch`?c.state.popupRef.current:g:!1:a,S;S=o??(h?void 0:!1);let C=!h||_;return(0,U.jsx)(de,{context:u,disabled:!f,modal:C,openInteractionType:m,initialFocus:x,returnFocus:S,getInsideElements:()=>[c.state.startDismissRef.current,c.state.endDismissRef.current],children:(0,U.jsxs)(B.Fragment,{children:[b,C&&(0,U.jsx)(vt,{ref:c.state.endDismissRef})]})})}),Pt=B.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e;return ee(`span`,e,{ref:t,props:[{"aria-hidden":!0,children:`▼`},a]})}),Ft=B.createContext(void 0),q=B.createContext(!1);function J(){return B.useContext(q)}var It=B.memo(B.forwardRef(function(e,t){let{render:n,className:r,style:i,value:a=null,index:o,disabled:s=!1,nativeButton:c=!1,...l}=e,u=B.useRef(!1),d=B.useRef(null),f=T({index:o,textRef:d,indexGuessBehavior:x.GuessFromOrder}),p=et(),m=J(),{flatFilteredItems:te,hasItems:h}=nt(),g=z(p,V.open),_=z(p,V.selectionMode),v=z(p,V.readOnly),b=z(p,V.virtualized),S=z(p,V.isItemEqualToValue),w=_!==`none`,E=o??(b?C(te,a,S):f.index),ne=f.index!==-1,D=z(p,V.id),O=z(p,V.isActive,E),k=z(p,V.isSelected,a),A=z(p,V.itemProps),re=B.useRef(null),j=D!=null&&ne?`${D}-${E}`:void 0,M=k&&w;L(()=>{if(!ne||!b&&o==null)return;let e=p.state.listRef.current;return e[E]=re.current,()=>{delete e[E]}},[ne,b,E,o,p]),L(()=>{if(!ne||h)return;let e=p.state.valuesRef.current;return e[E]=a,_!==`none`&&p.state.allValuesRef.current.push(a),()=>{delete e[E]}},[ne,h,E,a,p,_]),L(()=>{if(!g){u.current=!1;return}if(!ne||h)return;let e=p.state.selectedValue,t=Array.isArray(e)?e[e.length-1]:e;ce(a,t,S)&&p.set(`selectedIndex`,E)},[ne,h,g,p,E,a,S]);let{getButtonProps:N,buttonRef:ie}=y({disabled:s,focusableWhenDisabled:!0,native:c,composite:!0}),ae={disabled:s,selected:M,highlighted:O};function oe(e){function t(){p.state.handleSelection(e,a)}p.state.submitOnItemClick?(Et.flushSync(t),p.state.requestSubmit()):t()}let se={id:j,role:m?`gridcell`:`option`,"aria-selected":w?M:void 0,tabIndex:void 0,onPointerDownCapture(e){u.current=!0,e.preventDefault()},onMouseDown(e){e.preventDefault()},onClick(e){s||v||oe(e.nativeEvent)},onMouseUp(e){let t=u.current;u.current=!1,!(s||v||e.button!==0||t||!O)&&oe(e.nativeEvent)}},P=ee(`div`,e,{ref:[ie,t,f.ref,re],state:ae,props:[A,se,l,N]}),F=B.useMemo(()=>({selected:M,textRef:d}),[M,d]);return(0,U.jsx)(Ft.Provider,{value:F,children:P})})),Lt=B.forwardRef(function(e,t){let{render:n,className:r,style:i,children:a,...o}=e,{filteredItems:s}=nt(),c=et(),l=kt(),u=s.length===0?a:null;return ee(`div`,e,{ref:[t,c.state.emptyRef,l],props:[{children:u,role:`status`,"aria-live":`polite`,"aria-atomic":!0},o]})}),Rt={...m,...He},Y=B.forwardRef(function(e,t){let{render:n,className:r,disabled:i=!1,nativeButton:a=!0,keepMounted:o=!1,style:s,...c}=e,{disabled:l}=_e(),u=et(),d=z(u,V.selectionMode),f=z(u,V.disabled),p=z(u,V.readOnly),m=z(u,V.open),te=z(u,V.selectedValue),h=z(u,V.hasSelectionChips),g=rt(),_=!1;_=d===`none`?g!==``:d===`single`?te!=null:h;let v=l||f||i,{buttonRef:b,getButtonProps:x}=y({native:a,disabled:v}),{mounted:S,transitionStatus:C,setMounted:w}=N(_),T={disabled:v,visible:_,open:m,transitionStatus:C};me({open:_,ref:u.state.clearRef,onComplete(){_||w(!1)}});let E=ee(`button`,e,{state:T,ref:[t,b,u.state.clearRef],props:[{tabIndex:-1,children:`x`,onMouseDown(e){e.preventDefault()},onClick(e){if(v||p)return;let t=u.state.keyboardActiveRef;u.state.setInputValue(``,O(Se,e.nativeEvent)),d===`none`?u.state.setIndices({activeIndex:null,type:t.current?`keyboard`:`pointer`}):(u.state.setSelectedValue(Array.isArray(te)?[]:null,O(Se,e.nativeEvent)),u.state.setIndices({activeIndex:null,selectedIndex:null,type:t.current?`keyboard`:`pointer`})),u.state.inputRef.current?.focus()}},c,x],stateAttributesMapping:Rt});return o||S?E:null});export{Nt as a,kt as c,Ct as d,bt as f,ct as g,lt as h,Pt as i,Tt as l,ft as m,Lt as n,G as o,W as p,It as r,Mt as s,Y as t,wt as u};
2
+ //# sourceMappingURL=ComboboxClear-CtNsa8Al.js.map
@@ -0,0 +1,2 @@
1
+ import{a as e,t}from"./react-BUfh6y28.js";import{t as n}from"./jsx-runtime-DJeoFXNw.js";import{Do as r,Fo as i,Pa as a,Wa as o}from"./utils-DjbLtxuo.js";import{d as s}from"./ComboboxClear-CtNsa8Al.js";var c=e(t()),l=c.createContext(void 0);function u(){let e=c.useContext(l);if(e===void 0)throw Error(i(18));return e}var d=e(n()),f=c.forwardRef(function(e,t){let{render:n,className:i,style:a,items:o,...u}=e,[f,p]=c.useState(),m=c.useMemo(()=>({labelId:f,setLabelId:p,items:o}),[f,p,o]),h=r(`div`,e,{ref:t,props:[{role:`group`,"aria-labelledby":f},u]}),g=(0,d.jsx)(l.Provider,{value:m,children:h});return o?(0,d.jsx)(s,{items:o,children:g}):g}),p=c.forwardRef(function(e,t){let{render:n,className:i,style:s,id:c,...l}=e,{setLabelId:d}=u(),f=a(c);return o(()=>(d(f),()=>{d(void 0)}),[f,d]),r(`div`,e,{ref:t,props:[{id:f},l]})});export{f as n,p as t};
2
+ //# sourceMappingURL=ComboboxGroupLabel-vQ7y8c50.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-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
+ import{a as e}from"./react-BUfh6y28.js";import{n as t,t as n}from"./jsx-runtime-DJeoFXNw.js";import{mr as r,t as i}from"./utils-DjbLtxuo.js";import{C as a,f as o,u as s}from"./TooltipProvider-Czzm7ro-.js";import{m as c}from"./relay-Do9UB5iT.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-40eSIrOe.js.map
@@ -0,0 +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,Ao as a,Do as o,Ga as s,Gr as c,Ir as l,Jr as u,Kr as d,No as f,Qi as p,Qr as m,Ua as h,Wr as g,Xi as _,Yr as v,Zi as y,Zr as b,ea as x,ia as S,ii as C,jo as w,na as T,ni as E,qr as D,ra as O,ri as k,ta as A,ti as j,va as M,zr as N}from"./utils-DjbLtxuo.js";var P=e(t());function F(e){return e==null||e.hasAttribute(`disabled`)||e.getAttribute(`aria-disabled`)===`true`}var I=`data-composite-item-active`,L=[];function R(e){let{itemSizes:t,cols:n=1,loopFocus:i=!0,onLoop:a,dense:o=!1,orientation:l=`both`,direction:h,highlightedIndex:w,onHighlightedIndexChange:N,rootRef:I,enableHomeAndEndKeys:R=!1,stopEventPropagation:B=!1,disabledIndices:V,modifierKeys:H=L}=e,[U,W]=P.useState(0),G=n>1,K=P.useRef(null),q=f(K,I),J=P.useRef([]),Y=P.useRef(!1),X=w??U,Z=s((e,t=!1)=>{if((N??W)(e),t){let t=J.current[e];C(K.current,t,h,l)}}),Q=s(e=>{if(e.size===0||Y.current)return;Y.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&&Z(r),C(K.current,n,h,l)}),ee=s((e,t,n)=>a?a?.(e,t,n,J):n),$=P.useMemo(()=>({"aria-orientation":l===`both`?void 0:l,ref:q,onFocus(e){let t=K.current,n=M(e.nativeEvent);t&&n!=null&&k(n)&&n.setSelectionRange(0,n.value.length??0)},onKeyDown(e){let s=R?v:c;if(!s.has(e.key)||z(e,H)||!K.current)return;let f=h===`rtl`,C=f?d:D,w={horizontal:C,vertical:g,both:C}[l],N=f?D:d,P={horizontal:N,vertical:u,both:N}[l],I=M(e.nativeEvent);if(I!=null&&k(I)&&!F(I)){let t=I.selectionStart,n=I.selectionEnd,r=I.value??``;if(t==null||e.shiftKey||t!==n||e.key!==P&&t<r.length||e.key!==w&&t>0)return}let L=X,U=T(J,V),W=A(J,V);if(G){let a=t||Array.from({length:J.current.length},()=>({width:1,height:1})),s=_(a,n,o),c=s.findIndex(e=>e!=null&&!S(J.current,e,V)),u=s.reduce((e,t,n)=>t!=null&&!S(J.current,t,V)?n:e,-1);L=s[x(s.map(e=>e==null?null:J.current[e]),{event:e,orientation:l,loopFocus:i,onLoop:ee,cols:n,disabledIndices:r([...V||J.current.map((e,t)=>S(J.current,t)?t:void 0),void 0],s),minIndex:c,maxIndex:u,prevIndex:p(X>W?U:X,a,s,n,e.key===`ArrowDown`?`bl`:e.key===`ArrowRight`?`tr`:`tl`),rtl:f})]}let q={horizontal:[C],vertical:[g],both:[C,g]}[l],Y={horizontal:[N],vertical:[u],both:[N,u]}[l],Q=G?s:{horizontal:R?m:b,vertical:R?E:j,both:s}[l];R&&(e.key===`Home`?L=U:e.key===`End`&&(L=W)),L===X&&(q.includes(e.key)||Y.includes(e.key))&&(i&&L===W&&q.includes(e.key)?(L=U,a&&(L=a(e,X,L,J))):i&&L===U&&Y.includes(e.key)?(L=W,a&&(L=a(e,X,L,J))):L=y(J.current,{startingIndex:L,decrement:Y.includes(e.key),disabledIndices:V})),L!==X&&!O(J.current,L)&&(B&&e.stopPropagation(),Q.has(e.key)&&e.preventDefault(),Z(L,!0),queueMicrotask(()=>{J.current[L]?.focus()}))}}),[n,o,h,V,J,R,X,G,t,i,a,ee,q,H,Z,l,B]);return P.useMemo(()=>({props:$,highlightedIndex:X,onHighlightedIndexChange:Z,elementsRef:J,disabledIndices:V,onMapChange:Q,relayKeyboardEvent:$.onKeyDown}),[$,X,Z,J,V,Q])}function z(e,t){for(let n of i.values())if(!t.includes(n)&&e.getModifierState(n))return!0;return!1}var B=e(n());function V(e){let{render:t,className:n,style:r,refs:i=a,props:s=a,state:c=w,stateAttributesMapping:u,highlightedIndex:d,onHighlightedIndexChange:f,orientation:p,dense:m,itemSizes:g,loopFocus:_,onLoop:v,cols:y,enableHomeAndEndKeys:b,onMapChange:x,stopEventPropagation:S=!0,rootRef:C,disabledIndices:T,modifierKeys:E,highlightItemOnHover:D=!1,tag:O=`div`,...k}=e,{props:A,highlightedIndex:j,onHighlightedIndexChange:M,elementsRef:F,onMapChange:I,relayKeyboardEvent:L}=R({itemSizes:g,cols:y,loopFocus:_,onLoop:v,dense:m,orientation:p,highlightedIndex:d,onHighlightedIndexChange:f,rootRef:C,stopEventPropagation:S,enableHomeAndEndKeys:b,direction:N(),disabledIndices:T,modifierKeys:E}),z=o(O,e,{state:c,ref:i,props:[A,...s,k],stateAttributesMapping:u}),V=P.useMemo(()=>({highlightedIndex:j,onHighlightedIndexChange:M,highlightItemOnHover:D,relayKeyboardEvent:L}),[j,M,D,L]);return(0,B.jsx)(h.Provider,{value:V,children:(0,B.jsx)(l,{elementsRef:F,onMapChange:e=>{x?.(e),I(e)},children:z})})}export{I as n,V as t};
2
+ //# sourceMappingURL=CompositeRoot-CL7X20MU.js.map
@@ -0,0 +1,2 @@
1
+ import{a as e,t}from"./react-BUfh6y28.js";import{n,t as r}from"./jsx-runtime-DJeoFXNw.js";import{KS as i,MC as a,Yb as o,fv as s,mr as c,oS as l,pv as u,t as d,xS as f,yf as p}from"./utils-DjbLtxuo.js";import{B as m,nt as h}from"./runtime-BBYIQ0f-.js";import{t as g}from"./spinner-BiCpg0TU.js";import{i as _,n as ee}from"./radio-group-BnZVD-CO.js";import{t as te}from"./input-CQaedaQh.js";import{t as v}from"./preview-B4_sjsUX.js";import{r as ne,t as re}from"./alert-D6MFRWZv.js";import{t as y}from"./runtimeModeConfig-CRXk0H6e.js";import{t as b}from"./AuthSurfaceShell-C312CXz7.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:p},...y};function ie(e){return v(new URL(`http://${e}`).hostname)}var T=`Could not reach this environment. Try again.`,E=o(s);function ae(e){return m(h.pipe(f(e),i(e=>typeof e==`object`&&e&&`redirectTo`in e?{kind:`redirect`,url:e.redirectTo}:{kind:`ok`,value:e}),l(e=>a({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)(``),[d,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=u.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]===d?U=e[48]:(U=d?(0,C.jsx)(re,{variant:`error`,children:(0,C.jsx)(ne,{children:d})}):null,e[47]=d,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=d(`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=d(`mt-0.5 size-4 shrink-0`,l),t[2]=l,t[3]=u);let f;t[4]!==o||t[5]!==u?(f=(0,C.jsx)(o,{"aria-hidden":!0,className:u}),t[4]=o,t[5]=u,t[6]=f):f=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]!==f||t[17]!==h?(g=(0,C.jsxs)(_,{value:n,className:c,children:[f,h]}),t[14]=n,t[15]=c,t[16]=f,t[17]=h,t[18]=g):g=t[18],g}export{w as n,O as t};
2
+ //# sourceMappingURL=ConnectAgentSurface-B_AYPHWs.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-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
+ 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-DjbLtxuo.js";import{a as i,n as a,t as o}from"./tooltip-C7NAkYG3.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-7Tjfknn6.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-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
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-BeCI6be_.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-BVGMXOi_.js";import{o as te,r as ne}from"./DKTLEL5E-DciMwFJ1.js";import{PeleError as g,_ as re,m as _}from"./lazy-DmPH_lNd.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-CftE6Aa3.js.map
6
+ //# sourceMappingURL=DRLTVNUE-BPoomdQn.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-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(`
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-BVGMXOi_.js";import{r as p}from"./DKTLEL5E-DciMwFJ1.js";import{t as m}from"./TSHNXIZL-Cs6g4gXN.js";import{i as h,o as ee,t as te}from"./5N7A7DKN-B3iWX-TC.js";import{n as ne,r as g,t as _}from"./CXAC5362-C1eQCQMX.js";import{PeleError as v,_ as re,g as y,n as b}from"./lazy-DmPH_lNd.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-DezK9sBO.js.map
6
+ //# sourceMappingURL=DYY6UVD2-BVvdA84B.js.map
@@ -0,0 +1,2 @@
1
+ import{a as e,t}from"./react-BUfh6y28.js";import{n,t as r}from"./jsx-runtime-DJeoFXNw.js";import{Am as i,Fm as a,Hd as o,Jd as s,Md as c,Rd as l,Rp as u,Td as d,Vd as f,Zn as p,_m as m,am as h,ar as g,eh as _,fr as v,gh as y,ir as b,jm as x,lm as S,mr as C,nm as w,np as T,or as E,rr as D,sp as O,sr as k,t as ee,tr as A,wp as j}from"./utils-DjbLtxuo.js";import{R as te,U as ne,u as M}from"./TooltipProvider-Czzm7ro-.js";import{a as N,c as P,o as F,s as re,t as I}from"./select-Cz_1ByI4.js";import{t as ie}from"./spinner-BiCpg0TU.js";import{t as L}from"./query-D3KVoW9G.js";import{t as R}from"./use-atom-command-BbFDhw_c.js";import{u as ae}from"./rightPanelStore-DB1OP4MT.js";import{N as z}from"./PanelLayoutControls-DMUv135M.js";import{a as B,n as V,t as H}from"./tooltip-C7NAkYG3.js";import{n as oe,t as se}from"./toggle-group-DYSJFIn3.js";import{t as U}from"./input-CQaedaQh.js";import{t as ce}from"./dialog-DTVhbEqi.js";import{i as W,n as G,r as le,t as K}from"./device-DQmQm4GC.js";import{a as ue,i as de}from"./previewMiniPlayerStore-DguWdL1f.js";import{c as fe,r as q,s as J,u as Y}from"./DeviceSetup-Cdyw5Z9a.js";import{t as X}from"./discovery-list-VELXPQtS.js";import{_o as pe,bo as me,ho as he,vo as ge,yo as _e}from"./main-B1sXOjZZ.js";import{_ as ve,g as ye,h as be,x as xe}from"./_chat-BeJoXsdK.js";var Z=e(t(),1),Q=n(),Se=class extends Error{status;constructor(e){super(`Screenshot capture failed (${e}). Try again.`),this.status=e}};async function Ce(e,t){let n=e.platform===`ios`?`serve-sim`:`serve-emu`,r=ue(`${e.access.httpBase}/vendor/${n}/api/screenshot?device=${encodeURIComponent(e.deviceId)}`,e.access),i=await fetch(r,{method:`POST`,credentials:e.access.credentials?`include`:`omit`,signal:AbortSignal.any([t,AbortSignal.timeout(2e4)])});if(!i.ok)throw new Se(i.status);let a=await i.blob();if(!a.size)throw Error(`The device returned an empty screenshot. Try again.`);return a}var $=e(r(),1);function we(e){let t=(0,Q.c)(71),{view:n,handle:r,controls:s}=e,d=s.detail?.settings,f=!r?.inputConnected,h=e.hostKind===`local`||e.hostKind===`ssh`,g=d?.appearance===`dark`?`light`:`dark`,E;t[0]===r?E=t[1]:(E=()=>r?.pressButton(`home`),t[0]=r,t[1]=E);let ee;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(ee=(0,$.jsx)(T,{}),t[2]=ee):ee=t[2];let N;t[3]!==f||t[4]!==E?(N=(0,$.jsx)(De,{tooltipSide:`left`,label:`Home`,disabled:f,onClick:E,children:ee}),t[3]=f,t[4]=E,t[5]=N):N=t[5];let P;t[6]!==s||t[7]!==r||t[8]!==f||t[9]!==e.platform||t[10]!==h||t[11]!==n.keyboard?.attached?(P=e.platform===`android`?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(De,{tooltipSide:`left`,label:`Back`,disabled:f,onClick:()=>r?.pressButton(`back`),children:(0,$.jsx)(o,{})}),(0,$.jsx)(De,{tooltipSide:`left`,label:`Recents`,disabled:f,onClick:()=>r?.pressButton(`recents`),children:(0,$.jsx)(a,{})}),h?(0,$.jsxs)(p,{children:[(0,$.jsx)(v,{render:(0,$.jsx)(C,{size:`icon-sm`,variant:`ghost`,"aria-label":`Rotate device`,disabled:s.disabled}),children:(0,$.jsx)(m,{})}),(0,$.jsxs)(D,{side:`left`,children:[(0,$.jsx)(A,{onClick:()=>void s.act({type:`setOrientation`,value:`portrait`}),children:`Portrait`}),(0,$.jsx)(A,{onClick:()=>void s.act({type:`setOrientation`,value:`landscape_left`}),children:`Landscape`})]})]}):null]}):(0,$.jsx)(De,{tooltipSide:`left`,label:`Rotate device`,disabled:f||!!n.keyboard?.attached,onClick:()=>r?.rotate(),children:(0,$.jsx)(m,{})}),t[6]=s,t[7]=r,t[8]=f,t[9]=e.platform,t[10]=h,t[11]=n.keyboard?.attached,t[12]=P):P=t[12];let F;t[13]!==s||t[14]!==g||t[15]!==e.onTools||t[16]!==e.toolsOpen||t[17]!==h||t[18]!==d?.appearance||t[19]!==d?.textSize?(F=h?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(Ee,{}),(0,$.jsx)(De,{tooltipSide:`left`,label:`Switch device to ${g} mode`,disabled:s.disabled||!d?.appearance,onClick:()=>void s.act({type:`setAppearance`,value:g}),children:(0,$.jsx)(M,{icon:d?.appearance===`dark`?ne:te})}),(0,$.jsxs)(p,{children:[(0,$.jsx)(v,{render:(0,$.jsx)(C,{size:`icon-sm`,variant:`ghost`,"aria-label":`Device text size`,title:`Device text size`,disabled:s.disabled||!d?.textSize}),children:(0,$.jsx)(_,{})}),(0,$.jsx)(D,{side:`left`,className:`min-w-40`,children:(0,$.jsx)(b,{value:d?.textSize??``,onValueChange:e=>{(e===`small`||e==="default"||e===`large`||e===`extra-large`)&&s.act({type:`setTextSize`,value:e})},children:[[`small`,`Small`],[`default`,`Default`],[`large`,`Large`],[`extra-large`,`Extra large`]].map(Te)})})]}),(0,$.jsx)(De,{tooltipSide:`left`,label:`Device tools`,pressed:e.toolsOpen,onClick:e.onTools,children:(0,$.jsx)(i,{})})]}):null,t[13]=s,t[14]=g,t[15]=e.onTools,t[16]=e.toolsOpen,t[17]=h,t[18]=d?.appearance,t[19]=d?.textSize,t[20]=F):F=t[20];let re=e.screenshotPending?`Capturing screenshot`:`Save screenshot`,I=!n.streaming||e.screenshotPending,ie;t[21]===Symbol.for(`react.memo_cache_sentinel`)?(ie=(0,$.jsx)(l,{}),t[21]=ie):ie=t[21];let L;t[22]!==e.onScreenshot||t[23]!==re||t[24]!==I?(L=(0,$.jsx)(De,{tooltipSide:`left`,label:re,disabled:I,onClick:e.onScreenshot,children:ie}),t[22]=e.onScreenshot,t[23]=re,t[24]=I,t[25]=L):L=t[25];let R;t[26]===Symbol.for(`react.memo_cache_sentinel`)?(R=(0,$.jsx)(v,{render:(0,$.jsx)(C,{size:`icon-sm`,variant:`ghost`,"aria-label":`More device actions`,title:`More device actions`}),children:(0,$.jsx)(u,{})}),t[26]=R):R=t[26];let ae;t[27]===Symbol.for(`react.memo_cache_sentinel`)?(ae=(0,$.jsx)(w,{}),t[27]=ae):ae=t[27];let z;t[28]===e.onFloat?z=t[29]:(z=(0,$.jsxs)(A,{onClick:e.onFloat,children:[ae,`Float device over chat`]}),t[28]=e.onFloat,t[29]=z);let B;t[30]===Symbol.for(`react.memo_cache_sentinel`)?(B=(0,$.jsx)(y,{}),t[30]=B):B=t[30];let V;t[31]===e.onClose?V=t[32]:(V=(0,$.jsxs)(A,{onClick:e.onClose,children:[B,`Close device panel`]}),t[31]=e.onClose,t[32]=V);let H;t[33]===Symbol.for(`react.memo_cache_sentinel`)?(H=(0,$.jsx)(k,{}),t[33]=H):H=t[33];let oe;t[34]===Symbol.for(`react.memo_cache_sentinel`)?(oe=(0,$.jsx)(S,{}),t[34]=oe):oe=t[34];let se;t[35]===e.onPowerOff?se=t[36]:(se=(0,$.jsxs)(A,{variant:`destructive`,onClick:e.onPowerOff,children:[oe,`Power off device`]}),t[35]=e.onPowerOff,t[36]=se);let U;t[37]!==z||t[38]!==V||t[39]!==se?(U=(0,$.jsxs)(p,{children:[R,(0,$.jsxs)(D,{side:`left`,align:`end`,children:[z,V,H,se]})]}),t[37]=z,t[38]=V,t[39]=se,t[40]=U):U=t[40];let ce;t[41]===Symbol.for(`react.memo_cache_sentinel`)?(ce=(0,$.jsx)(Ee,{}),t[41]=ce):ce=t[41];let W=!n.streaming||!!n.phoneUnavailableReason,G=n.phoneUnavailableReason??void 0,le;t[42]===Symbol.for(`react.memo_cache_sentinel`)?(le=(0,$.jsx)(c,{}),t[42]=le):le=t[42];let K;t[43]!==W||t[44]!==G||t[45]!==n.phone||t[46]!==n.showPhone?(K=(0,$.jsx)(De,{tooltipSide:`left`,label:`3D view`,pressed:n.phone,disabled:W,description:G,onClick:n.showPhone,children:le}),t[43]=W,t[44]=G,t[45]=n.phone,t[46]=n.showPhone,t[47]=K):K=t[47];let ue=!n.phone,de=!n.streaming,fe;t[48]===Symbol.for(`react.memo_cache_sentinel`)?(fe=(0,$.jsx)(x,{}),t[48]=fe):fe=t[48];let q;t[49]!==ue||t[50]!==de||t[51]!==n.showFlat?(q=(0,$.jsx)(De,{tooltipSide:`left`,label:`Flat view`,pressed:ue,disabled:de,onClick:n.showFlat,children:fe}),t[49]=ue,t[50]=de,t[51]=n.showFlat,t[52]=q):q=t[52];let J;t[53]===n.keyboard?J=t[54]:(J=n.keyboard?(0,$.jsx)(De,{tooltipSide:`left`,label:n.keyboard.attached?`Detach Magic Keyboard`:`Attach Magic Keyboard`,pressed:n.keyboard.attached,onClick:n.keyboard.toggle,children:(0,$.jsx)(O,{})}):null,t[53]=n.keyboard,t[54]=J);let Y;t[55]!==n.phone||t[56]!==n.resetView?(Y=n.phone?(0,$.jsx)(De,{tooltipSide:`left`,label:`Restore 3D view`,onClick:n.resetView,children:(0,$.jsx)(j,{})}):null,t[55]=n.phone,t[56]=n.resetView,t[57]=Y):Y=t[57];let X;t[58]!==U||t[59]!==N||t[60]!==K||t[61]!==q||t[62]!==J||t[63]!==Y||t[64]!==P||t[65]!==F||t[66]!==L?(X=(0,$.jsxs)(`div`,{className:`pointer-events-auto flex shrink-0 flex-col items-center gap-1 overflow-y-auto rounded-full border border-border/50 bg-background/80 p-2 shadow-sm [scrollbar-width:none]`,children:[N,P,F,L,U,ce,K,q,J,Y]}),t[58]=U,t[59]=N,t[60]=K,t[61]=q,t[62]=J,t[63]=Y,t[64]=P,t[65]=F,t[66]=L,t[67]=X):X=t[67];let pe;return t[68]!==X||t[69]!==n.foldingControls?(pe=(0,$.jsxs)(`aside`,{"aria-label":`Device controls`,"data-layout":`rail`,className:`pointer-events-none absolute inset-y-0 right-0 z-10 flex w-14 flex-col items-center gap-2 overflow-y-auto [justify-content:safe_center] py-3 pr-2 [scrollbar-width:none]`,children:[X,n.foldingControls]}),t[68]=X,t[69]=n.foldingControls,t[70]=pe):pe=t[70],pe}function Te(e){let[t,n]=e;return(0,$.jsx)(g,{value:t,children:(0,$.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,$.jsx)(`span`,{className:`flex-1`,children:n}),(0,$.jsx)(E,{})]})},t)}function Ee(){let e=(0,Q.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,$.jsx)(`div`,{"aria-hidden":!0,className:`my-1 h-px w-5 shrink-0 bg-border/70`}),e[0]=t):t=e[0],t}function De(e){let t=(0,Q.c)(18),n=e.pressed?`secondary`:`ghost`,r;t[0]!==e.children||t[1]!==e.disabled||t[2]!==e.label||t[3]!==e.onClick||t[4]!==e.pressed||t[5]!==n?(r=(0,$.jsx)(C,{size:`icon-sm`,variant:n,"aria-label":e.label,"aria-pressed":e.pressed,disabled:e.disabled,onClick:e.onClick,children:e.children}),t[0]=e.children,t[1]=e.disabled,t[2]=e.label,t[3]=e.onClick,t[4]=e.pressed,t[5]=n,t[6]=r):r=t[6];let i=r,a;t[7]!==i||t[8]!==e.description||t[9]!==e.disabled||t[10]!==e.label?(a=e.disabled&&e.description?(0,$.jsx)(B,{render:(0,$.jsx)(`span`,{className:`inline-flex`,tabIndex:0,role:`group`,"aria-label":e.label}),children:i}):(0,$.jsx)(B,{render:i}),t[7]=i,t[8]=e.description,t[9]=e.disabled,t[10]=e.label,t[11]=a):a=t[11];let o=e.description??e.label,s;t[12]!==e.tooltipSide||t[13]!==o?(s=(0,$.jsx)(V,{side:e.tooltipSide,children:o}),t[12]=e.tooltipSide,t[13]=o,t[14]=s):s=t[14];let c;return t[15]!==a||t[16]!==s?(c=(0,$.jsxs)(H,{children:[a,s]}),t[15]=a,t[16]=s,t[17]=c):c=t[17],c}var Oe=[{value:`small`,label:`Small`},{value:`default`,label:`Default`},{value:`large`,label:`Large`},{value:`extra-large`,label:`Extra large`}],ke=[{value:`none`,label:`None`},{value:`grayscale`,label:`Grayscale`},{value:`red-green`,label:`Red / green (protanopia)`},{value:`green-red`,label:`Green / red (deuteranopia)`},{value:`blue-yellow`,label:`Blue / yellow (tritanopia)`}],Ae=[{value:`portrait`,label:`Portrait`},{value:`landscape_left`,label:`Landscape left`},{value:`portrait_upside_down`,label:`Upside down`},{value:`landscape_right`,label:`Landscape right`}],je=[{value:`camera`,label:`Camera`},{value:`microphone`,label:`Microphone`},{value:`photos`,label:`Photos`},{value:`contacts`,label:`Contacts`},{value:`calendar`,label:`Calendar`},{value:`reminders`,label:`Reminders`},{value:`location`,label:`Location`},{value:`notifications`,label:`Notifications`},{value:`motion`,label:`Motion`},{value:`media-library`,label:`Media library`},{value:`faceid`,label:`Face ID`}],Me=[{value:`camera`,label:`Camera`},{value:`microphone`,label:`Microphone`},{value:`photos`,label:`Photos`},{value:`contacts`,label:`Contacts`},{value:`calendar`,label:`Calendar`},{value:`location`,label:`Location`},{value:`notifications`,label:`Notifications`},{value:`motion`,label:`Physical activity`}],Ne=[{label:`San Francisco`,latitude:37.7749,longitude:-122.4194},{label:`New York`,latitude:40.7128,longitude:-74.006},{label:`London`,latitude:51.5074,longitude:-.1278},{label:`Stockholm`,latitude:59.3293,longitude:18.0686},{label:`Tokyo`,latitude:35.6762,longitude:139.6503}];function Pe(e){let t=(0,Q.c)(129),{device:n,controls:r}=e,{detail:i,pending:a,error:o,foregroundApp:s,disabled:c,act:l}=r,u=i?.settings,d=n.platform===`ios`,f;t[0]===e.className?f=t[1]:(f=ee(`flex min-h-0 flex-col border-border bg-background text-sm`,e.className),t[0]=e.className,t[1]=f);let p;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,$.jsx)(`span`,{className:`font-medium`,children:`Tools`}),t[2]=p):p=t[2];let m;t[3]===a?m=t[4]:(m=a?(0,$.jsx)(ie,{size:`sm`}):null,t[3]=a,t[4]=m);let h;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(h=(0,$.jsx)(y,{}),t[5]=h):h=t[5];let g;t[6]===e.onClose?g=t[7]:(g=(0,$.jsx)(C,{size:`icon-xs`,variant:`ghost-muted`,"aria-label":`Close tools`,className:`ml-auto`,onClick:e.onClose,children:h}),t[6]=e.onClose,t[7]=g);let _;t[8]!==m||t[9]!==g?(_=(0,$.jsxs)(`div`,{className:`flex h-9 shrink-0 items-center gap-2 border-b px-3`,children:[p,m,g]}),t[8]=m,t[9]=g,t[10]=_):_=t[10];let v;t[11]===o?v=t[12]:(v=o?(0,$.jsx)(`p`,{className:`border-b bg-destructive/10 px-3 py-2 text-xs text-destructive`,children:o}):null,t[11]=o,t[12]=v);let b;t[13]!==i||t[14]!==o?(b=i===null&&!o?(0,$.jsxs)(`div`,{className:`flex items-center gap-2 px-3 py-3 text-xs text-muted-foreground`,children:[(0,$.jsx)(ie,{size:`sm`}),` Reading device settings…`]}):null,t[13]=i,t[14]=o,t[15]=b):b=t[15];let x;t[16]===e.hostDiagnostics?x=t[17]:(x=e.hostDiagnostics?(0,$.jsx)(Fe,{title:`Host diagnostics`,children:(0,$.jsx)(`p`,{className:`whitespace-pre-line text-xs text-muted-foreground`,children:e.hostDiagnostics})}):null,t[16]=e.hostDiagnostics,t[17]=x);let S=s?.id??`—`,w;t[18]===S?w=t[19]:(w=(0,$.jsx)(Ie,{label:`Foreground`,children:(0,$.jsx)(`span`,{className:`truncate font-mono text-xs`,children:S})}),t[18]=S,t[19]=w);let T;t[20]!==l||t[21]!==c||t[22]!==s?(T=s?(0,$.jsxs)(`div`,{className:`flex gap-1.5`,children:[(0,$.jsx)(C,{size:`xs`,variant:`outline`,disabled:c,onClick:()=>void l({type:`terminateApp`,appId:s.id}),children:`Terminate`}),(0,$.jsx)(C,{size:`xs`,variant:`outline`,disabled:c,onClick:()=>void l({type:`launchApp`,appId:s.id}),children:`Relaunch`})]}):null,t[20]=l,t[21]=c,t[22]=s,t[23]=T):T=t[23];let E;t[24]===l?E=t[25]:(E=e=>l({type:`openUrl`,url:e}),t[24]=l,t[25]=E);let D;t[26]!==c||t[27]!==E?(D=(0,$.jsx)(Be,{placeholder:`https://… or myapp://`,action:`Open`,disabled:c,onSubmit:E}),t[26]=c,t[27]=E,t[28]=D):D=t[28];let O=d?`Bundle ID to launch`:`Package name to launch`,k;t[29]===l?k=t[30]:(k=e=>l({type:`launchApp`,appId:e}),t[29]=l,t[30]=k);let A;t[31]!==c||t[32]!==O||t[33]!==k?(A=(0,$.jsx)(Be,{placeholder:O,action:`Launch`,disabled:c,onSubmit:k}),t[31]=c,t[32]=O,t[33]=k,t[34]=A):A=t[34];let j;t[35]!==w||t[36]!==T||t[37]!==D||t[38]!==A?(j=(0,$.jsxs)(Fe,{title:`App`,children:[w,T,D,A]}),t[35]=w,t[36]=T,t[37]=D,t[38]=A,t[39]=j):j=t[39];let te=d?`Simulator`:`Emulator`,ne;t[40]===u?ne=t[41]:(ne=u?.appearance?[u.appearance]:[],t[40]=u,t[41]=ne);let M;t[42]===l?M=t[43]:(M=e=>{let t=e[0];(t===`light`||t===`dark`)&&l({type:`setAppearance`,value:t})},t[42]=l,t[43]=M);let N,P;t[44]===Symbol.for(`react.memo_cache_sentinel`)?(N=(0,$.jsx)(se,{value:`light`,children:`Light`}),P=(0,$.jsx)(se,{value:`dark`,children:`Dark`}),t[44]=N,t[45]=P):(N=t[44],P=t[45]);let F;t[46]!==c||t[47]!==ne||t[48]!==M?(F=(0,$.jsx)(Ie,{label:`Appearance`,children:(0,$.jsxs)(oe,{"aria-label":`Appearance`,value:ne,disabled:c,onValueChange:M,children:[N,P]})}),t[46]=c,t[47]=ne,t[48]=M,t[49]=F):F=t[49];let re=u?.textSize??null,I;t[50]===l?I=t[51]:(I=e=>l({type:`setTextSize`,value:e}),t[50]=l,t[51]=I);let L;t[52]!==c||t[53]!==re||t[54]!==I?(L=(0,$.jsx)(Ie,{label:`Text size`,children:(0,$.jsx)(Re,{ariaLabel:`Text size`,value:re,options:Oe,disabled:c,onChange:I})}),t[52]=c,t[53]=re,t[54]=I,t[55]=L):L=t[55];let R;t[56]!==l||t[57]!==c||t[58]!==d||t[59]!==u?(R=d?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(Ie,{label:`Liquid Glass`,children:(0,$.jsxs)(oe,{"aria-label":`Liquid Glass`,value:u?.liquidGlass?[u.liquidGlass]:[],disabled:c||u?.liquidGlass===void 0,onValueChange:e=>{let t=e[0];(t===`clear`||t===`tinted`)&&l({type:`setLiquidGlass`,value:t})},children:[(0,$.jsx)(se,{value:`clear`,children:`Clear`}),(0,$.jsx)(se,{value:`tinted`,children:`Tinted`})]})}),(0,$.jsx)(Ie,{label:`Color filter`,children:(0,$.jsx)(Re,{ariaLabel:`Color filter`,value:u?.colorFilter??null,options:ke,disabled:c,onChange:e=>l({type:`setColorFilter`,value:e})})})]}):(0,$.jsx)(Ie,{label:`Orientation`,children:(0,$.jsx)(Re,{ariaLabel:`Orientation`,value:null,placeholder:`Rotate to…`,options:Ae,disabled:c,onChange:e=>l({type:`setOrientation`,value:e})})}),t[56]=l,t[57]=c,t[58]=d,t[59]=u,t[60]=R):R=t[60];let ae=u?.reduceMotion,z;t[61]===l?z=t[62]:(z=e=>l({type:`setToggle`,setting:`reduceMotion`,value:e}),t[61]=l,t[62]=z);let B;t[63]!==c||t[64]!==ae||t[65]!==z?(B=(0,$.jsx)(Le,{label:`Reduce Motion`,checked:ae,disabled:c,onChange:z}),t[63]=c,t[64]=ae,t[65]=z,t[66]=B):B=t[66];let V;t[67]!==l||t[68]!==c||t[69]!==d||t[70]!==u?.increaseContrast||t[71]!==u?.networkEnabled||t[72]!==u?.reduceTransparency||t[73]!==u?.showBorders||t[74]!==u?.voiceOver?(V=d?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(Le,{label:`Increase Contrast`,checked:u?.increaseContrast,disabled:c,onChange:e=>l({type:`setToggle`,setting:`increaseContrast`,value:e})}),(0,$.jsx)(Le,{label:`Reduce Transparency`,checked:u?.reduceTransparency,disabled:c,onChange:e=>l({type:`setToggle`,setting:`reduceTransparency`,value:e})}),(0,$.jsx)(Le,{label:`Show Borders`,checked:u?.showBorders,disabled:c,onChange:e=>l({type:`setToggle`,setting:`showBorders`,value:e})}),(0,$.jsx)(Le,{label:`VoiceOver`,checked:u?.voiceOver,disabled:c,onChange:e=>l({type:`setToggle`,setting:`voiceOver`,value:e})})]}):(0,$.jsx)(Le,{label:`Network`,checked:u?.networkEnabled,disabled:c,onChange:e=>l({type:`setToggle`,setting:`networkEnabled`,value:e})}),t[67]=l,t[68]=c,t[69]=d,t[70]=u?.increaseContrast,t[71]=u?.networkEnabled,t[72]=u?.reduceTransparency,t[73]=u?.showBorders,t[74]=u?.voiceOver,t[75]=V):V=t[75];let H;t[76]!==te||t[77]!==F||t[78]!==L||t[79]!==R||t[80]!==B||t[81]!==V?(H=(0,$.jsxs)(Fe,{title:te,children:[F,L,R,B,V]}),t[76]=te,t[77]=F,t[78]=L,t[79]=R,t[80]=B,t[81]=V,t[82]=H):H=t[82];let U=e.access===null,ce;t[83]===e?ce=t[84]:(ce=t=>(e.onAxOverlayChange(t),Promise.resolve()),t[83]=e,t[84]=ce);let W;t[85]!==e.axOverlay||t[86]!==U||t[87]!==ce?(W=(0,$.jsx)(Fe,{title:`Accessibility`,children:(0,$.jsx)(Le,{label:`Overlay element frames`,checked:e.axOverlay,disabled:U,onChange:ce})}),t[85]=e.axOverlay,t[86]=U,t[87]=ce,t[88]=W):W=t[88];let G,le;t[89]===l?(G=t[90],le=t[91]):(G=(e,t)=>l({type:`setLocation`,latitude:e,longitude:t}),le=()=>l({type:`clearLocation`}),t[89]=l,t[90]=G,t[91]=le);let K;t[92]!==c||t[93]!==d||t[94]!==G||t[95]!==le?(K=(0,$.jsx)(Ve,{disabled:c,canClear:d,onSet:G,onClear:le}),t[92]=c,t[93]=d,t[94]=G,t[95]=le,t[96]=K):K=t[96];let ue=d?je:Me,de=s?.id??``,fe;t[97]===l?fe=t[98]:(fe=(e,t,n)=>l({type:`setPermission`,appId:e,permission:t,decision:n}),t[97]=l,t[98]=fe);let q;t[99]!==c||t[100]!==d||t[101]!==ue||t[102]!==de||t[103]!==fe?(q=(0,$.jsx)(Ue,{permissions:ue,canReset:d,defaultAppId:de,disabled:c,onDecide:fe}),t[99]=c,t[100]=d,t[101]=ue,t[102]=de,t[103]=fe,t[104]=q):q=t[104];let J;t[105]!==l||t[106]!==c||t[107]!==s||t[108]!==d?(J=d?(0,$.jsxs)(Fe,{title:`Push notification`,children:[(0,$.jsx)(Be,{placeholder:`Alert text`,action:`Send`,disabled:c||!s,onSubmit:e=>s?l({type:`sendPush`,appId:s.id,payload:e}):Promise.resolve()}),s?null:(0,$.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Open an app first.`})]}):null,t[105]=l,t[106]=c,t[107]=s,t[108]=d,t[109]=J):J=t[109];let Y;t[110]!==n||t[111]!==d||t[112]!==e.access?(Y=d&&e.access?(0,$.jsx)(Ge,{access:e.access,device:n}):null,t[110]=n,t[111]=d,t[112]=e.access,t[113]=Y):Y=t[113];let X;t[114]!==j||t[115]!==H||t[116]!==W||t[117]!==K||t[118]!==q||t[119]!==J||t[120]!==Y||t[121]!==v||t[122]!==b||t[123]!==x?(X=(0,$.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-y-auto`,children:[v,b,x,j,H,W,K,q,J,Y]}),t[114]=j,t[115]=H,t[116]=W,t[117]=K,t[118]=q,t[119]=J,t[120]=Y,t[121]=v,t[122]=b,t[123]=x,t[124]=X):X=t[124];let pe;return t[125]!==f||t[126]!==X||t[127]!==_?(pe=(0,$.jsxs)(`div`,{className:f,children:[_,X]}),t[125]=f,t[126]=X,t[127]=_,t[128]=pe):pe=t[128],pe}function Fe(e){let t=(0,Q.c)(5),n;t[0]===e.title?n=t[1]:(n=(0,$.jsx)(`h3`,{className:`text-xs font-medium text-muted-foreground`,children:e.title}),t[0]=e.title,t[1]=n);let r;return t[2]!==e.children||t[3]!==n?(r=(0,$.jsxs)(`section`,{className:`flex flex-col gap-2 border-b px-3 py-2.5 last:border-b-0`,children:[n,e.children]}),t[2]=e.children,t[3]=n,t[4]=r):r=t[4],r}function Ie(e){let t=(0,Q.c)(7),n;t[0]===e.label?n=t[1]:(n=(0,$.jsx)(`span`,{className:`shrink-0 text-xs text-muted-foreground`,children:e.label}),t[0]=e.label,t[1]=n);let r;t[2]===e.children?r=t[3]:(r=(0,$.jsx)(`div`,{className:`flex min-w-0 items-center justify-end`,children:e.children}),t[2]=e.children,t[3]=r);let i;return t[4]!==n||t[5]!==r?(i=(0,$.jsxs)(`div`,{className:`flex min-h-7 items-center justify-between gap-3`,children:[n,r]}),t[4]=n,t[5]=r,t[6]=i):i=t[6],i}function Le(e){let t=(0,Q.c)(10),n=e.checked??!1,r=e.disabled||e.checked===void 0,i;t[0]===e?i=t[1]:(i=t=>void e.onChange(t),t[0]=e,t[1]=i);let a;t[2]!==e.label||t[3]!==n||t[4]!==r||t[5]!==i?(a=(0,$.jsx)(me,{size:`sm`,"aria-label":e.label,checked:n,disabled:r,onCheckedChange:i}),t[2]=e.label,t[3]=n,t[4]=r,t[5]=i,t[6]=a):a=t[6];let o;return t[7]!==e.label||t[8]!==a?(o=(0,$.jsx)(Ie,{label:e.label,children:a}),t[7]=e.label,t[8]=a,t[9]=o):o=t[9],o}function Re(e){let t=(0,Q.c)(25),n;if(t[0]!==e.options||t[1]!==e.value){let r;t[3]===e.value?r=t[4]:(r=t=>t.value===e.value,t[3]=e.value,t[4]=r),n=e.options.find(r),t[0]=e.options,t[1]=e.value,t[2]=n}else n=t[2];let r=n,i=e.value,a=e.disabled,o;t[5]===e?o=t[6]:(o=t=>{t!==null&&t!==e.value&&e.onChange(t)},t[5]=e,t[6]=o);let s;t[7]!==r||t[8]!==e.placeholder?(s=r?r.label:(0,$.jsx)(`span`,{className:`text-muted-foreground`,children:e.placeholder??`Unknown`}),t[7]=r,t[8]=e.placeholder,t[9]=s):s=t[9];let c;t[10]===s?c=t[11]:(c=(0,$.jsx)(P,{children:s}),t[10]=s,t[11]=c);let l;t[12]!==e.ariaLabel||t[13]!==c?(l=(0,$.jsx)(re,{size:`xs`,className:`w-40`,"aria-label":e.ariaLabel,children:c}),t[12]=e.ariaLabel,t[13]=c,t[14]=l):l=t[14];let u;t[15]===e.options?u=t[16]:(u=e.options.map(ze),t[15]=e.options,t[16]=u);let d;t[17]===u?d=t[18]:(d=(0,$.jsx)(F,{align:`end`,alignItemWithTrigger:!1,children:u}),t[17]=u,t[18]=d);let f;return t[19]!==e.disabled||t[20]!==e.value||t[21]!==o||t[22]!==l||t[23]!==d?(f=(0,$.jsxs)(I,{value:i,disabled:a,onValueChange:o,children:[l,d]}),t[19]=e.disabled,t[20]=e.value,t[21]=o,t[22]=l,t[23]=d,t[24]=f):f=t[24],f}function ze(e){return(0,$.jsx)(N,{value:e.value,children:e.label},e.value)}function Be(e){let t=(0,Q.c)(20),[n,r]=(0,Z.useState)(``),i;t[0]!==e||t[1]!==n?(i=()=>{let t=n.trim();t&&e.onSubmit(t).then(()=>r(``))},t[0]=e,t[1]=n,t[2]=i):i=t[2];let a=i,o;t[3]===a?o=t[4]:(o=e=>{e.preventDefault(),a()},t[3]=a,t[4]=o);let s;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(s=e=>r(e.target.value),t[5]=s):s=t[5];let c;t[6]!==e.disabled||t[7]!==e.placeholder||t[8]!==n?(c=(0,$.jsx)(U,{size:`compact`,font:`mono`,className:`min-w-0 flex-1`,placeholder:e.placeholder,value:n,disabled:e.disabled,onChange:s}),t[6]=e.disabled,t[7]=e.placeholder,t[8]=n,t[9]=c):c=t[9];let l;t[10]!==e.disabled||t[11]!==n?(l=e.disabled||n.trim().length===0,t[10]=e.disabled,t[11]=n,t[12]=l):l=t[12];let u;t[13]!==e.action||t[14]!==l?(u=(0,$.jsx)(C,{type:`submit`,size:`xs`,variant:`outline`,disabled:l,children:e.action}),t[13]=e.action,t[14]=l,t[15]=u):u=t[15];let d;return t[16]!==o||t[17]!==c||t[18]!==u?(d=(0,$.jsxs)(`form`,{className:`flex gap-1.5`,onSubmit:o,children:[c,u]}),t[16]=o,t[17]=c,t[18]=u,t[19]=d):d=t[19],d}function Ve(e){let t=(0,Q.c)(40),[n,r]=(0,Z.useState)(``),[i,a]=(0,Z.useState)(``),o=Number(n),s=Number(i),c,l;t[0]!==n||t[1]!==i||t[2]!==o||t[3]!==s?(c={latitude:o,longitude:s},l=n.trim()!==``&&i.trim()!==``&&Math.abs(c.latitude)<=90&&Math.abs(c.longitude)<=180,t[0]=n,t[1]=i,t[2]=o,t[3]=s,t[4]=c,t[5]=l):(c=t[4],l=t[5]);let u=l,d;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(d=e=>r(e.target.value),t[6]=d):d=t[6];let f;t[7]!==n||t[8]!==e.disabled?(f=(0,$.jsx)(U,{size:`compact`,font:`mono`,className:`min-w-0 flex-1`,placeholder:`Latitude`,inputMode:`decimal`,value:n,disabled:e.disabled,onChange:d}),t[7]=n,t[8]=e.disabled,t[9]=f):f=t[9];let p;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(p=e=>a(e.target.value),t[10]=p):p=t[10];let m;t[11]!==i||t[12]!==e.disabled?(m=(0,$.jsx)(U,{size:`compact`,font:`mono`,className:`min-w-0 flex-1`,placeholder:`Longitude`,inputMode:`decimal`,value:i,disabled:e.disabled,onChange:p}),t[11]=i,t[12]=e.disabled,t[13]=m):m=t[13];let h;t[14]!==f||t[15]!==m?(h=(0,$.jsxs)(`div`,{className:`flex gap-1.5`,children:[f,m]}),t[14]=f,t[15]=m,t[16]=h):h=t[16];let g;t[17]===e?g=t[18]:(g=t=>{let n=Ne.find(e=>e.label===t);n&&(r(String(n.latitude)),a(String(n.longitude)),e.onSet(n.latitude,n.longitude))},t[17]=e,t[18]=g);let _;t[19]===Symbol.for(`react.memo_cache_sentinel`)?(_=(0,$.jsx)(re,{size:`xs`,className:`w-32`,"aria-label":`Location preset`,children:(0,$.jsx)(P,{children:(0,$.jsx)(`span`,{className:`text-muted-foreground`,children:`Preset…`})})}),t[19]=_):_=t[19];let v;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(v=(0,$.jsx)(F,{align:`start`,alignItemWithTrigger:!1,children:Ne.map(He)}),t[20]=v):v=t[20];let y;t[21]!==e.disabled||t[22]!==g?(y=(0,$.jsxs)(I,{value:null,disabled:e.disabled,onValueChange:g,children:[_,v]}),t[21]=e.disabled,t[22]=g,t[23]=y):y=t[23];let b=e.disabled||!u,x;t[24]!==c.latitude||t[25]!==c.longitude||t[26]!==e?(x=()=>void e.onSet(c.latitude,c.longitude),t[24]=c.latitude,t[25]=c.longitude,t[26]=e,t[27]=x):x=t[27];let S;t[28]!==b||t[29]!==x?(S=(0,$.jsx)(C,{size:`xs`,variant:`outline`,disabled:b,onClick:x,children:`Set`}),t[28]=b,t[29]=x,t[30]=S):S=t[30];let w;t[31]===e?w=t[32]:(w=e.canClear?(0,$.jsx)(C,{size:`xs`,variant:`ghost`,disabled:e.disabled,onClick:()=>{r(``),a(``),e.onClear()},children:`Clear`}):null,t[31]=e,t[32]=w);let T;t[33]!==y||t[34]!==S||t[35]!==w?(T=(0,$.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1.5`,children:[y,S,w]}),t[33]=y,t[34]=S,t[35]=w,t[36]=T):T=t[36];let E;return t[37]!==T||t[38]!==h?(E=(0,$.jsxs)(Fe,{title:`Location`,children:[h,T]}),t[37]=T,t[38]=h,t[39]=E):E=t[39],E}function He(e){return(0,$.jsx)(N,{value:e.label,children:e.label},e.label)}function Ue(e){let t=(0,Q.c)(40),[n,r]=(0,Z.useState)(``),[i,a]=(0,Z.useState)(`camera`),o;t[0]!==n||t[1]!==e.defaultAppId?(o=n.trim()||e.defaultAppId,t[0]=n,t[1]=e.defaultAppId,t[2]=o):o=t[2];let s=o,c;t[3]!==i||t[4]!==e||t[5]!==s?(c=t=>void e.onDecide(s,i,t),t[3]=i,t[4]=e,t[5]=s,t[6]=c):c=t[6];let l=c,u=e.defaultAppId||`App ID`,d;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(d=e=>r(e.target.value),t[7]=d):d=t[7];let f;t[8]!==n||t[9]!==e.disabled||t[10]!==u?(f=(0,$.jsx)(U,{size:`compact`,font:`mono`,placeholder:u,value:n,disabled:e.disabled,onChange:d}),t[8]=n,t[9]=e.disabled,t[10]=u,t[11]=f):f=t[11];let p;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(p=e=>(a(e),Promise.resolve()),t[12]=p):p=t[12];let m;t[13]!==i||t[14]!==e.disabled||t[15]!==e.permissions?(m=(0,$.jsx)(Re,{ariaLabel:`Permission`,value:i,options:e.permissions,disabled:e.disabled,onChange:p}),t[13]=i,t[14]=e.disabled,t[15]=e.permissions,t[16]=m):m=t[16];let h=e.disabled||!s,g;t[17]===l?g=t[18]:(g=()=>l(`grant`),t[17]=l,t[18]=g);let _;t[19]!==h||t[20]!==g?(_=(0,$.jsx)(C,{size:`xs`,variant:`outline`,disabled:h,onClick:g,children:`Grant`}),t[19]=h,t[20]=g,t[21]=_):_=t[21];let v=e.disabled||!s,y;t[22]===l?y=t[23]:(y=()=>l(`revoke`),t[22]=l,t[23]=y);let b;t[24]!==v||t[25]!==y?(b=(0,$.jsx)(C,{size:`xs`,variant:`outline`,disabled:v,onClick:y,children:`Revoke`}),t[24]=v,t[25]=y,t[26]=b):b=t[26];let x;t[27]!==l||t[28]!==e.canReset||t[29]!==e.disabled||t[30]!==s?(x=e.canReset?(0,$.jsx)(C,{size:`xs`,variant:`ghost`,disabled:e.disabled||!s,onClick:()=>l(`reset`),children:`Reset`}):null,t[27]=l,t[28]=e.canReset,t[29]=e.disabled,t[30]=s,t[31]=x):x=t[31];let S;t[32]!==b||t[33]!==x||t[34]!==m||t[35]!==_?(S=(0,$.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1.5`,children:[m,_,b,x]}),t[32]=b,t[33]=x,t[34]=m,t[35]=_,t[36]=S):S=t[36];let w;return t[37]!==S||t[38]!==f?(w=(0,$.jsxs)(Fe,{title:`Permissions`,children:[f,S]}),t[37]=S,t[38]=f,t[39]=w):w=t[39],w}var We=100;function Ge(e){let t=(0,Q.c)(19),[n,r]=(0,Z.useState)(!1),i;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=[],t[0]=i):i=t[0];let[a,o]=(0,Z.useState)(i),s,c;t[1]!==n||t[2]!==e.access||t[3]!==e.device.id||t[4]!==e.device.platform?(s=()=>{if(!n)return;let t=ye({access:e.access,platform:e.device.platform,deviceId:e.device.id},(e,t)=>{o(n=>{let r=t?[...e]:[...n,...e];return r.length>We?r.slice(-100):r})});return()=>{t(),o([])}},c=[n,e.access,e.device.id,e.device.platform],t[1]=n,t[2]=e.access,t[3]=e.device.id,t[4]=e.device.platform,t[5]=s,t[6]=c):(s=t[5],c=t[6]),(0,Z.useEffect)(s,c);let l=n&&`rotate-180`,u;t[7]===l?u=t[8]:(u=ee(`ml-auto size-3.5 transition-transform`,l),t[7]=l,t[8]=u);let d;t[9]===u?d=t[10]:(d=(0,$.jsxs)(_e,{className:`flex w-full items-center gap-1.5 border-b px-3 py-2.5 text-left text-xs font-medium text-muted-foreground`,children:[`Event log`,(0,$.jsx)(f,{className:u})]}),t[9]=u,t[10]=d);let p;t[11]===a?p=t[12]:(p=a.length===0?(0,$.jsx)(`li`,{className:`text-muted-foreground`,children:`No events yet.`}):a.map(Ke),t[11]=a,t[12]=p);let m;t[13]===p?m=t[14]:(m=(0,$.jsx)(ge,{children:(0,$.jsx)(`ol`,{className:`max-h-64 overflow-y-auto px-3 py-2 font-mono text-2xs leading-relaxed`,children:p})}),t[13]=p,t[14]=m);let h;return t[15]!==n||t[16]!==d||t[17]!==m?(h=(0,$.jsxs)(pe,{open:n,onOpenChange:r,children:[d,m]}),t[15]=n,t[16]=d,t[17]=m,t[18]=h):h=t[18],h}function Ke(e){return(0,$.jsxs)(`li`,{className:`flex gap-2`,children:[(0,$.jsx)(`span`,{className:`shrink-0 text-muted-foreground`,children:e.timestamp.slice(11,19)}),(0,$.jsx)(`span`,{className:`truncate`,children:e.summary})]},e.id)}function qe(e){let t=(0,Q.c)(30),{environmentId:n,device:r,access:i,visible:a}=e,o;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(o={reportFailure:!1},t[0]=o):o=t[0];let s=R(K.detail,o),c;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(c={reportFailure:!1},t[1]=c):c=t[1];let l=R(K.action,c),[u,d]=(0,Z.useState)(null),[f,p]=(0,Z.useState)(!1),[m,h]=(0,Z.useState)(null),[g,_]=(0,Z.useState)(),v=(0,Z.useRef)(!1),y=(0,Z.useRef)(0),b=(0,Z.useRef)(null),x;t[2]!==r.hostId||t[3]!==r.id?(x={hostId:r.hostId,deviceId:r.id},t[2]=r.hostId,t[3]=r.id,t[4]=x):x=t[4];let S=x,C,w;t[5]!==n||t[6]!==s||t[7]!==S||t[8]!==a?(C=()=>{let e=y.current+=1;if(!a)return;let t={environmentId:n,input:S};return b.current=t,s(t).then(t=>{y.current===e&&(t._tag===`Success`?(d(t.value),h(null)):(d(null),h(L(t.cause))))}),()=>{b.current=null,y.current+=1}},w=[n,s,S,a],t[5]=n,t[6]=s,t[7]=S,t[8]=a,t[9]=C,t[10]=w):(C=t[9],w=t[10]),(0,Z.useEffect)(C,w);let T,E;t[11]!==i||t[12]!==r.id||t[13]!==r.platform||t[14]!==a?(T=()=>{if(!i||!a)return;let e=!0,t=ve({access:i,platform:r.platform,deviceId:r.id},t=>{e&&_(t)});return()=>{e=!1,t(),_(void 0)}},E=[i,r.id,r.platform,a],t[11]=i,t[12]=r.id,t[13]=r.platform,t[14]=a,t[15]=T,t[16]=E):(T=t[15],E=t[16]),(0,Z.useEffect)(T,E);let D=u!==null&&a,O;t[17]!==D||t[18]!==n||t[19]!==s||t[20]!==l||t[21]!==S?(O=async e=>{if(v.current||!D)return;v.current=!0;let t=y.current+=1;return p(!0),h(null),l({environmentId:n,input:{...S,...e}}).then(e=>{if(y.current!==t){let e=b.current;if(!e)return;let t=y.current+=1;return s(e).then(e=>{y.current===t&&(e._tag===`Success`?(d(e.value),h(null)):(d(null),h(L(e.cause))))})}e._tag===`Success`?d(e.value):h(L(e.cause))}).finally(()=>{v.current=!1,p(!1)})},t[17]=D,t[18]=n,t[19]=s,t[20]=l,t[21]=S,t[22]=O):O=t[22];let k=O,ee=f||!u||!a,A=g===void 0?u?.foregroundApp??null:g,j;return t[23]!==k||t[24]!==u||t[25]!==m||t[26]!==f||t[27]!==ee||t[28]!==A?(j={detail:u,pending:f,error:m,act:k,disabled:ee,foregroundApp:A},t[23]=k,t[24]=u,t[25]=m,t[26]=f,t[27]=ee,t[28]=A,t[29]=j):j=t[29],j}function Je(e){let t=(0,Q.c)(53),[n,r]=(0,Z.useState)(null),[i,a]=(0,Z.useState)(!1),[o,s]=(0,Z.useState)(!1),[c,l]=(0,Z.useState)(!1),[u,d]=(0,Z.useState)(null),f=(0,Z.useRef)(null),p=(0,Z.useRef)(null),m=le(e.environmentId,e.device.hostId),h=e.hostKind===`local`||e.hostKind===`ssh`,g=e.visible&&h,_;t[0]!==m||t[1]!==e||t[2]!==g?(_={...e,access:m,visible:g},t[0]=m,t[1]=e,t[2]=g,t[3]=_):_=t[3];let v=qe(_),y,b;t[4]!==m||t[5]!==e.visible?(y=()=>(m&&e.visible||f.current?.abort(),()=>{f.current?.abort(),p.current&&URL.revokeObjectURL(p.current),p.current=null}),b=[m,e.visible],t[4]=m,t[5]=e.visible,t[6]=y,t[7]=b):(y=t[6],b=t[7]),(0,Z.useEffect)(y,b);let x;t[8]!==m||t[9]!==e.device.id||t[10]!==e.device.name||t[11]!==e.device.platform||t[12]!==e.environmentId||t[13]!==e.visible?(x=()=>{if(!m||f.current||!e.visible)return;let t=new AbortController;return f.current=t,l(!0),d(null),Ce({access:m,platform:e.device.platform,deviceId:e.device.id},t.signal).then(n=>{if(t.signal.aborted)return;p.current&&URL.revokeObjectURL(p.current);let r=URL.createObjectURL(n);p.current=r;let i=document.createElement(`a`);i.href=r,i.download=`${e.device.name.replace(/[^a-z0-9-]/gi,`-`)}-${Date.now()}.png`,document.body.append(i),i.click(),i.remove()}).catch(n=>{t.signal.aborted||(n instanceof Se&&n.status===401&&G(e.environmentId),d(n instanceof Error?n.message:`Screenshot capture failed. Try again.`))}).finally(()=>{f.current===t&&(f.current=null,l(!1))})},t[8]=m,t[9]=e.device.id,t[10]=e.device.name,t[11]=e.device.platform,t[12]=e.environmentId,t[13]=e.visible,t[14]=x):x=t[14];let S=x,C;t[15]!==v||t[16]!==u||t[17]!==i?(C=u||v.error&&!i?(0,$.jsx)(`p`,{role:`alert`,className:`px-3 py-2 text-xs text-destructive`,children:u??v.error}):null,t[15]=v,t[16]=u,t[17]=i,t[18]=C):C=t[18];let w=`${e.hostLabel} · ${e.device.version}`,T;t[19]!==v||t[20]!==n||t[21]!==e.device.platform||t[22]!==e.hostKind||t[23]!==e.onClose||t[24]!==e.onFloat||t[25]!==e.onPowerOff||t[26]!==S||t[27]!==c||t[28]!==i?(T=t=>(0,$.jsx)(we,{platform:e.device.platform,hostKind:e.hostKind,handle:n,view:t,controls:v,screenshotPending:c,onScreenshot:()=>void S(),toolsOpen:i,onTools:()=>a(!i),onFloat:e.onFloat,onClose:e.onClose,onPowerOff:e.onPowerOff}),t[19]=v,t[20]=n,t[21]=e.device.platform,t[22]=e.hostKind,t[23]=e.onClose,t[24]=e.onFloat,t[25]=e.onPowerOff,t[26]=S,t[27]=c,t[28]=i,t[29]=T):T=t[29];let E;t[30]!==o||t[31]!==e.device.hostId||t[32]!==e.device.id||t[33]!==e.device.name||t[34]!==e.device.platform||t[35]!==e.environmentId||t[36]!==e.visible||t[37]!==w||t[38]!==T?(E=(0,$.jsx)(`div`,{className:`min-h-0 flex-1`,children:(0,$.jsx)(be,{environmentId:e.environmentId,platform:e.device.platform,deviceName:e.device.name,deviceDescription:w,deviceId:e.device.id,hostId:e.device.hostId,visible:e.visible,axOverlay:o,allowPhoneView:!0,onHandle:r,renderControls:T})}),t[30]=o,t[31]=e.device.hostId,t[32]=e.device.id,t[33]=e.device.name,t[34]=e.device.platform,t[35]=e.environmentId,t[36]=e.visible,t[37]=w,t[38]=T,t[39]=E):E=t[39];let D;t[40]!==C||t[41]!==E?(D=(0,$.jsxs)(`div`,{className:`relative flex min-h-0 min-w-0 flex-1 flex-col`,children:[C,E]}),t[40]=C,t[41]=E,t[42]=D):D=t[42];let O;t[43]!==m||t[44]!==o||t[45]!==v||t[46]!==e.device||t[47]!==e.hostDiagnostics||t[48]!==i?(O=i?(0,$.jsx)(Pe,{device:e.device,controls:v,hostDiagnostics:e.hostDiagnostics,access:m,axOverlay:o,onAxOverlayChange:s,onClose:()=>a(!1),className:`absolute inset-y-0 right-0 z-10 w-full max-w-72 border-l shadow-lg @[700px]:static @[700px]:w-72 @[700px]:shrink-0 @[700px]:shadow-none`}):null,t[43]=m,t[44]=o,t[45]=v,t[46]=e.device,t[47]=e.hostDiagnostics,t[48]=i,t[49]=O):O=t[49];let k;return t[50]!==O||t[51]!==D?(k=(0,$.jsxs)($.Fragment,{children:[D,O]}),t[50]=O,t[51]=D,t[52]=k):k=t[52],k}var Ye=e=>e===`ios`?`iOS Simulators`:`Android Emulators`,Xe=e=>`${e.hostId}\u0000${e.id}`;function Ze(e){let t=(0,Q.c)(87),{environmentId:n,threadId:r}=e.threadRef,{state:i,loaded:a,error:o,refresh:s}=W(n),c;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(c={reportFailure:!1},t[0]=c):c=t[0];let l=R(K.list,c),u=R(K.open),f=R(K.close),p=`${n}\u0000${r}`,[m,g]=(0,Z.useState)(null),_=m?.scope===p?m.pending:null,v=m?.scope===p?m.error:null,y;t[1]===_?y=t[2]:(y=_?Xe(_):null,t[1]=_,t[2]=y);let b=y,S=i.hostStatus===`disabled`,w,T;t[3]!==n||t[4]!==S||t[5]!==l||t[6]!==a||t[7]!==e.visible?(w=()=>{e.visible&&a&&!S&&l({environmentId:n,input:{}})},T=[n,l,a,e.visible,S],t[3]=n,t[4]=S,t[5]=l,t[6]=a,t[7]=e.visible,t[8]=w,t[9]=T):(w=t[8],T=t[9]),(0,Z.useEffect)(w,T);let E;if(t[10]!==e.surface.target||t[11]!==i.sessions||t[12]!==r){let n;t[14]===r?n=t[15]:(n=e=>e.threadId===r,t[14]=r,t[15]=n);let a=i.sessions.filter(n);E=e.surface.target?a.find(t=>t.deviceId===e.surface.target?.deviceId&&t.hostId===e.surface.target.hostId):void 0,t[10]=e.surface.target,t[11]=i.sessions,t[12]=r,t[13]=E}else E=t[13];let D=E,O,k,A,j,te,ne,M;if(t[16]!==D||t[17]!==f||t[18]!==n||t[19]!==S||t[20]!==l||t[21]!==a||t[22]!==u||t[23]!==v||t[24]!==_||t[25]!==b||t[26]!==e||t[27]!==s||t[28]!==p||t[29]!==i||t[30]!==o||t[31]!==r){k=Symbol.for(`react.early_return_sentinel`);bb0:{let c=D?i.devices.find(e=>e.hostId===D.hostId&&e.id===D.deviceId):void 0,m=at(i),y;t[39]===p?y=t[40]:(y=e=>{let t={scope:p,pending:e,error:null};return g(t),e=>g(n=>n===t?{...t,pending:null,error:e}:n)},t[39]=p,t[40]=y);let w=y,T;t[41]!==n||t[42]!==u||t[43]!==e.threadRef||t[44]!==w||t[45]!==i.devices||t[46]!==r?(T=async t=>{let a=i.devices.find(e=>Xe(e)===t);if(!a)return;let o=w(a),s=await u({environmentId:n,input:{threadId:r,hostId:a.hostId,deviceId:a.id,platform:a.platform}});s._tag===`Failure`?o(L(s.cause)):(ae.getState().openDevice(e.threadRef,{hostId:s.value.hostId,deviceId:s.value.deviceId,platform:a.platform,name:a.name}),o(null))},t[41]=n,t[42]=u,t[43]=e.threadRef,t[44]=w,t[45]=i.devices,t[46]=r,t[47]=T):T=t[47];let E=T,N=()=>{c&&(de.getState().open(e.threadRef,{kind:`device`,hostId:c.hostId,deviceId:c.id,platform:c.platform,name:c.name}),ae.getState().close(e.threadRef))},P;t[48]!==D||t[49]!==f||t[50]!==n||t[51]!==e.surface.id||t[52]!==e.threadRef||t[53]!==w||t[54]!==r?(P=t=>{if(!t){ae.getState().closeSurface(e.threadRef,e.surface.id);return}if(!D)return;let i=w(null);f({environmentId:n,input:{threadId:r,hostId:D.hostId,deviceId:D.deviceId,shutdown:t}}).then(t=>{t._tag===`Failure`?i(L(t.cause)):ae.getState().closeSurface(e.threadRef,e.surface.id)})},t[48]=D,t[49]=f,t[50]=n,t[51]=e.surface.id,t[52]=e.threadRef,t[53]=w,t[54]=r,t[55]=P):P=t[55];let F=P,re=i.bootingDevices?.filter(e=>e.threadId===r)??[],{ready:I,busy:R}=J(i),B=!c&&(_!==null||R||!a),V=a?null:o,H;t[56]!==i.hostStatus||t[57]!==i.hostStatusDetail||t[58]!==i.hostStatuses?(H=e=>{let t=i.hostStatuses[e.id],n=t?.detail??(e.kind===`local`?i.hostStatusDetail:void 0);return n&&(t?.status??i.hostStatus)===`ready`?[{hostId:e.id,label:e.label,detail:n}]:[]},t[56]=i.hostStatus,t[57]=i.hostStatusDetail,t[58]=i.hostStatuses,t[59]=H):H=t[59];let oe=i.hosts.flatMap(H),se=i.hosts.flatMap(tt);if(a&&(!i.onboardingCompleted||S)){let r;t[60]===e?r=t[61]:(r=t=>{t||e.onDismissSetup()},t[60]=e,t[61]=r);let a;t[62]!==n||t[63]!==i?(a=(0,$.jsx)(he,{children:(0,$.jsx)(q,{environmentId:n,state:i})}),t[62]=n,t[63]=i,t[64]=a):a=t[64];let o;t[65]!==e.visible||t[66]!==r||t[67]!==a?(o=(0,$.jsx)(ce,{open:e.visible,onOpenChange:r,children:a}),t[65]=e.visible,t[66]=r,t[67]=a,t[68]=o):o=t[68],k=o;break bb0}O=z,M=e.mode,te=`relative flex min-h-0 flex-1 flex-col`;let U;t[69]===n?U=t[70]:(U=e=>(0,$.jsx)(it,{label:e.label,detail:e.detail},`${n}\u0000${e.hostId}\u0000${e.detail}`),t[69]=n,t[70]=U);let W;t[71]!==n||t[72]!==i?(W=(0,$.jsx)(Y,{state:i,environmentId:n}),t[71]=n,t[72]=i,t[73]=W):W=t[73];let G;t[74]===v?G=t[75]:(G=v?(0,$.jsx)(rt,{tone:`error`,onDismiss:()=>g(null),children:v}):null,t[74]=v,t[75]=G),ne=(0,$.jsxs)(`div`,{className:ee(`shrink-0 bg-background`,B&&`absolute inset-x-0 top-0 z-10 max-h-[40%] overflow-y-auto`),children:[(0,$.jsx)(`div`,{hidden:!!c,children:oe.map(U)}),W,re.length>0?(0,$.jsxs)(`div`,{role:`status`,className:`border-b px-3 py-2 text-xs text-muted-foreground`,children:[`Starting `,re.map(et).join(`, `),`… This can take a minute.`]}):null,G]}),A=`@container relative flex min-h-0 flex-1`,j=c&&D?(0,$.jsx)(Je,{environmentId:n,device:c,hostLabel:i.hosts.find(e=>e.id===c.hostId)?.label??`Device host`,hostKind:i.hosts.find(e=>e.id===c.hostId)?.kind,hostDiagnostics:oe.find(e=>{let{hostId:t}=e;return t===c.hostId})?.detail,visible:e.visible,onFloat:N,onClose:()=>F(!1),onPowerOff:()=>F(!0)},`${n}\u0000${Xe(c)}`):B?(0,$.jsx)(xe,{name:_?.name??`Devices`,description:_?`${i.hosts.find(e=>e.id===_.hostId)?.label??`Device host`} · ${_.version}`:``,stage:`opening`,message:V??(_?_.booted?`Opening device…`:`Starting device…`:i.hostStatus===`installing`?i.hostStatusDetail??`Installing device support…`:`Finding devices…`),error:V!==null,children:V===null?null:(0,$.jsx)(C,{size:`sm`,variant:`outline`,onClick:s,children:`Retry`})}):(0,$.jsx)(`div`,{className:`scrollbar-gutter-both flex size-full flex-col overflow-y-auto px-5 py-8 text-sm text-muted-foreground`,children:(0,$.jsxs)(`div`,{className:ee(`mx-auto flex w-full max-w-xl flex-col gap-6`,m.length===0&&`my-auto items-center text-center`),children:[m.length===0?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(x,{className:`size-6 opacity-60`}),(0,$.jsx)(`p`,{className:`max-h-32 w-full max-w-sm overflow-y-auto whitespace-pre-line break-words`,tabIndex:i.hostStatus===`failed`?0:void 0,children:i.hostStatus===`failed`?i.hostStatusDetail??`The device hub failed to start.`:`No simulators or emulators were found on this environment.`})]}):null,I&&m.length>0?(0,$.jsx)(`div`,{className:`w-full space-y-6 text-left`,children:m.map(e=>(0,$.jsxs)(`section`,{className:`space-y-3`,children:[(0,$.jsxs)(`div`,{className:`flex items-center gap-2 text-sm text-muted-foreground`,children:[(0,$.jsx)(x,{className:`size-4 shrink-0`}),(0,$.jsx)(`h3`,{className:`font-medium`,children:Ye(e.platform)})]}),(0,$.jsx)(X,{children:e.devices.map(e=>(0,$.jsxs)(`div`,{className:`flex items-center gap-3 px-3 py-3`,children:[(0,$.jsx)(`span`,{className:`grid size-8 shrink-0 place-items-center rounded-md border border-border/60`,children:(0,$.jsx)(x,{className:`size-4`})}),(0,$.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col`,children:[(0,$.jsx)(`span`,{className:`truncate text-sm font-medium text-foreground`,children:e.name}),(0,$.jsx)(`span`,{className:`truncate text-xs text-muted-foreground`,children:`${i.hosts.find(t=>t.id===e.hostId)?.label} · ${e.version} · ${e.booted?`Running`:`Stopped`}`})]}),(0,$.jsxs)(C,{variant:`outline`,size:`sm`,disabled:b!==null,"aria-label":`${e.booted?`Open`:`Start`} ${e.name}`,onClick:()=>void E(Xe(e)),children:[b===Xe(e)?(0,$.jsx)(ie,{size:`xs`}):e.booted?(0,$.jsx)(d,{}):(0,$.jsx)(h,{}),e.booted?`Open`:`Start`]})]},Xe(e)))})]},e.platform))}):null,I&&!fe(i)&&!i.devices.some($e)&&!se.some(Qe)?(0,$.jsx)(`p`,{className:`max-w-sm text-xs`,children:`No Android virtual devices found. Create one in Android Studio's Device Manager, then refresh.`}):null,a&&!R?(0,$.jsx)(C,{className:m.length>0?`self-start`:`self-center`,variant:`outline`,size:`sm`,onClick:()=>void l({environmentId:n,input:{}}),children:`Refresh devices`}):null]})})}t[16]=D,t[17]=f,t[18]=n,t[19]=S,t[20]=l,t[21]=a,t[22]=u,t[23]=v,t[24]=_,t[25]=b,t[26]=e,t[27]=s,t[28]=p,t[29]=i,t[30]=o,t[31]=r,t[32]=O,t[33]=k,t[34]=A,t[35]=j,t[36]=te,t[37]=ne,t[38]=M}else O=t[32],k=t[33],A=t[34],j=t[35],te=t[36],ne=t[37],M=t[38];if(k!==Symbol.for(`react.early_return_sentinel`))return k;let N;t[76]!==A||t[77]!==j?(N=(0,$.jsx)(`div`,{className:A,children:j}),t[76]=A,t[77]=j,t[78]=N):N=t[78];let P;t[79]!==N||t[80]!==te||t[81]!==ne?(P=(0,$.jsxs)(`div`,{className:te,children:[ne,N]}),t[79]=N,t[80]=te,t[81]=ne,t[82]=P):P=t[82];let F;return t[83]!==O||t[84]!==P||t[85]!==M?(F=(0,$.jsx)(O,{mode:M,children:P}),t[83]=O,t[84]=P,t[85]=M,t[86]=F):F=t[86],F}function Qe(e){return e.platform===`android`}function $e(e){return e.platform===`android`}function et(e){return e.name}function tt(e){return e.platforms.filter(nt).map(t=>({...t,hostId:e.id,hostLabel:e.label}))}function nt(e){return!e.available}function rt(e){let t=(0,Q.c)(13),n=e.tone===`warning`?`bg-warning-surface text-warning-foreground`:`bg-destructive/5 text-destructive`,r;t[0]===n?r=t[1]:(r=ee(`flex items-start gap-2 border-b px-3 py-2 text-xs`,n),t[0]=n,t[1]=r);let i;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,$.jsx)(s,{className:`mt-1 size-3.5 shrink-0`}),t[2]=i):i=t[2];let a;t[3]===e.children?a=t[4]:(a=(0,$.jsx)(`div`,{className:`max-h-32 min-w-0 flex-1 overflow-y-auto whitespace-pre-wrap break-words`,tabIndex:0,children:e.children}),t[3]=e.children,t[4]=a);let o=e.tone===`warning`?`Dismiss device warning`:`Dismiss device error`,c;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,$.jsx)(y,{}),t[5]=c):c=t[5];let l;t[6]!==e.onDismiss||t[7]!==o?(l=(0,$.jsx)(C,{size:`icon-xs`,variant:`ghost`,"aria-label":o,onClick:e.onDismiss,children:c}),t[6]=e.onDismiss,t[7]=o,t[8]=l):l=t[8];let u;return t[9]!==r||t[10]!==a||t[11]!==l?(u=(0,$.jsxs)(`div`,{role:`alert`,className:r,children:[i,a,l]}),t[9]=r,t[10]=a,t[11]=l,t[12]=u):u=t[12],u}function it(e){let t=(0,Q.c)(6),[n,r]=(0,Z.useState)(!1);if(n)return null;let i;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=()=>r(!0),t[0]=i):i=t[0];let a;t[1]===e.label?a=t[2]:(a=(0,$.jsxs)(`p`,{className:`font-medium`,children:[`Device discovery warning · `,e.label]}),t[1]=e.label,t[2]=a);let o;return t[3]!==e.detail||t[4]!==a?(o=(0,$.jsxs)(rt,{tone:`warning`,onDismiss:i,children:[a,e.detail]}),t[3]=e.detail,t[4]=a,t[5]=o):o=t[5],o}function at(e){let t=[];for(let n of[`ios`,`android`]){let r=e.devices.filter(e=>e.platform===n).toSorted((e,t)=>Number(t.booted)-Number(e.booted)||e.name.localeCompare(t.name));r.length>0&&t.push({platform:n,devices:r})}return t}export{Ze as DevicePanel};
2
+ //# sourceMappingURL=DevicePanel-Cqexcbm2.js.map
@@ -0,0 +1,2 @@
1
+ import{a as e,t}from"./react-BUfh6y28.js";import{n,t as r}from"./jsx-runtime-DJeoFXNw.js";import{Bd as i,bv as a,mr as o,t as s}from"./utils-DjbLtxuo.js";import{f as c,u as l,y as u}from"./TooltipProvider-Czzm7ro-.js";import{t as d}from"./spinner-BiCpg0TU.js";import{i as f,n as p}from"./session-CBEVNHld.js";import{t as m}from"./use-atom-command-BbFDhw_c.js";import{n as h}from"./dialog-DTVhbEqi.js";import{t as g}from"./device-DQmQm4GC.js";import{bo as _,fo as v,go as ee,mo as te,po as y}from"./main-B1sXOjZZ.js";var b=n(),x=e(t(),1),S=e(r(),1);function C(e){let t=(0,b.c)(15),{state:n,environmentId:r}=e,i=m(g.list),[a,s]=(0,x.useState)(null);if(n.hostStatus===`disabled`)return null;let c;if(t[0]!==r||t[1]!==a||t[2]!==i||t[3]!==n.hostStatuses||t[4]!==n.hosts||t[5]!==n.supportsHostRetry){let e;t[7]!==r||t[8]!==a||t[9]!==i||t[10]!==n.hostStatuses||t[11]!==n.supportsHostRetry?(e=e=>{let t=n.hostStatuses[e.id];if(!t||![`installing`,`starting`,`failed`].includes(t.status))return null;let c=t.status===`failed`;return(0,S.jsxs)(`div`,{role:c?`alert`:`status`,className:`flex items-start gap-3 rounded-md border border-border/60 px-3 py-2 text-xs`,children:[(0,S.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,S.jsx)(`p`,{className:`font-medium`,children:e.label}),(0,S.jsx)(`p`,{className:`whitespace-pre-wrap break-words text-muted-foreground`,children:t.detail??(c?`Device support could not start.`:t.status===`installing`?`Installing device tools…`:`Starting device tools…`)}),c?(0,S.jsx)(`p`,{className:`mt-1 text-muted-foreground`,children:`Check the host connection and network access, then retry. Your device settings are saved.`}):null]}),c&&n.supportsHostRetry?(0,S.jsx)(o,{size:`compact`,variant:`outline`,disabled:a!==null,onClick:()=>{s(e.id),i({environmentId:r,input:{retryHostId:e.id}}).finally(()=>s(null))},children:a===e.id?`Retrying…`:`Retry`}):null]},e.id)},t[7]=r,t[8]=a,t[9]=i,t[10]=n.hostStatuses,t[11]=n.supportsHostRetry,t[12]=e):e=t[12],c=n.hosts.map(e),t[0]=r,t[1]=a,t[2]=i,t[3]=n.hostStatuses,t[4]=n.hosts,t[5]=n.supportsHostRetry,t[6]=c}else c=t[6];let l;return t[13]===c?l=t[14]:(l=(0,S.jsx)(`div`,{className:`space-y-2`,children:c}),t[13]=c,t[14]=l),l}var w=e=>e===`ios`?`iOS`:`Android`,T=`Enable this environment to open simulators and emulators, whether they run here or on a remote device host.`,E=`Allow new agent sessions in this environment to start and control local and remote devices, with required tools set up automatically.`,D=e=>Object.values(e.hostStatuses).some(e=>e.status===`ready`&&e.androidDiscoveryIncomplete);function O(e){let t=Object.values(e.hostStatuses).map(e=>e.status),n=e.hostStatus===`ready`||t.includes(`ready`);return{ready:n,busy:!n&&[e.hostStatus,...t].some(e=>e===`installing`||e===`starting`)}}function k(e,t){let n=e.devices.some(e=>e.platform===t);if(t===`android`&&!n&&D(e))return{ready:!1,message:`The Android device list may be incomplete. Check the device host and try again.`};let r=e.hosts.flatMap(e=>e.platforms.filter(e=>e.platform===t).map(t=>({...t,host:e}))),i=r.filter(e=>e.available).map(e=>e.host);if(i.length===0)return{ready:!1,message:r[0]?.reason??`${w(t)} support was not detected.`};if(i.filter(t=>e.hostStatuses[t.id]?.status===`ready`||t.kind===`local`&&e.hostStatus===`ready`).length>0&&!n)return{ready:!1,message:t===`ios`?`Xcode is installed, but no iOS Simulator is available. Install a runtime in Xcode Settings → Components.`:`The Android SDK is installed, but no virtual device exists. Create one in Android Studio → Device Manager.`};let a=i.every(e=>e.kind!==`local`)?i[0]:void 0,o=a?` on ${a.label}`:``;return{ready:!0,message:a?.kind===`eas`?`${a.label} starts ${t===`ios`?`iOS Simulators`:`Android emulators`} in the cloud with EAS Simulator.`:t===`ios`?`Xcode and iOS Simulator are available${o}.`:`The Android SDK and Emulator are available${o}.`}}function A(e){let t=(0,b.c)(75),n=f(e.environmentId,a),r=m(g.configure),i;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(i={reportFailure:!1},t[0]=i):i=t[0];let c=m(g.list,i),[l,u]=(0,x.useState)(null),[d,w]=(0,x.useState)(0),D=e.state.hostStatus!==`disabled`,k;t[1]===e.state?k=t[2]:(k=O(e.state),t[1]=e.state,t[2]=k);let{ready:A,busy:j}=k,F;t[3]===e.state.hosts?F=t[4]:(F=e.state.hosts.some(ne),t[3]=e.state.hosts,t[4]=F);let I=F,L,R;t[5]!==D||t[6]!==c||t[7]!==e.environmentId?(L=()=>{D&&c({environmentId:e.environmentId,input:{}})},R=[D,c,e.environmentId],t[5]=D,t[6]=c,t[7]=e.environmentId,t[8]=L,t[9]=R):(L=t[8],R=t[9]),(0,x.useEffect)(L,R);let z;t[10]!==r||t[11]!==e?(z=async(t,n)=>{if(!p(e.environmentId,`settings:write`))return;u(t);let i=await r({environmentId:e.environmentId,input:n});u(null),t===`complete`&&i._tag===`Success`&&e.onComplete?.()},t[10]=r,t[11]=e,t[12]=z):z=t[12];let B=z,V;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(V=[`Device hub`,`Simulators`,`Agent access`],t[13]=V):V=t[13];let H;t[14]!==j||t[15]!==l||t[16]!==d?(H=e=>j||l!==null||e>d,t[14]=j,t[15]=l,t[16]=d,t[17]=H):H=t[17];let U;t[18]!==d||t[19]!==H?(U=(0,S.jsx)(y,{title:`Set up devices`,description:`Review what runs on this environment before using simulators and emulators.`,children:(0,S.jsx)(ee,{steps:V,currentStep:d,onStepChange:w,isStepDisabled:H})}),t[18]=d,t[19]=H,t[20]=U):U=t[20];let W;t[21]!==e.environmentId||t[22]!==e.state?(W=(0,S.jsx)(C,{state:e.state,environmentId:e.environmentId}),t[21]=e.environmentId,t[22]=e.state,t[23]=W):W=t[23];let G;t[24]!==j||t[25]!==n||t[26]!==D||t[27]!==l||t[28]!==e.state||t[29]!==d||t[30]!==B?(G=d===0?(0,S.jsxs)(`section`,{className:`space-y-3 text-sm`,children:[(0,S.jsx)(`h3`,{className:`font-medium`,children:`Enable the device hub`}),(0,S.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,S.jsx)(`p`,{className:`text-muted-foreground`,children:T}),(0,S.jsx)(_,{checked:D,disabled:!n||j||l!==null,"aria-label":`Enable device hub`,onCheckedChange:e=>void B(`hub`,{enabled:!!e,...e?{}:{agentAccessEnabled:!1}})})]}),(0,S.jsx)(M,{state:e.state,pending:l===`hub`||j&&l!==`agent`})]}):null,t[24]=j,t[25]=n,t[26]=D,t[27]=l,t[28]=e.state,t[29]=d,t[30]=B,t[31]=G):G=t[31];let K;t[32]!==j||t[33]!==D||t[34]!==c||t[35]!==I||t[36]!==l||t[37]!==e.environmentId||t[38]!==e.state||t[39]!==d?(K=d===1||d===0&&D&&I?(0,S.jsxs)(`section`,{className:s(`space-y-3 text-sm`,d===0&&`mt-4`),children:[(0,S.jsx)(`h3`,{className:`font-medium`,children:`Check simulator support`}),(0,S.jsx)(N,{state:e.state,checking:l===`check`,disabled:!D||j||l!==null,onCheck:()=>{u(`check`),c({environmentId:e.environmentId,input:{}}).finally(()=>u(null))}})]}):null,t[32]=j,t[33]=D,t[34]=c,t[35]=I,t[36]=l,t[37]=e.environmentId,t[38]=e.state,t[39]=d,t[40]=K):K=t[40];let q;t[41]!==j||t[42]!==n||t[43]!==D||t[44]!==l||t[45]!==e.state||t[46]!==d||t[47]!==B?(q=d===2?(0,S.jsxs)(`section`,{className:`space-y-3 text-sm`,children:[(0,S.jsx)(`h3`,{className:`font-medium`,children:`Allow agent control`}),(0,S.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,S.jsx)(`p`,{className:`text-muted-foreground`,children:E}),(0,S.jsx)(_,{checked:e.state.agentAccessEnabled,disabled:!n||!D||j||l!==null,"aria-label":`Allow agents to control devices`,onCheckedChange:e=>void B(`agent`,{agentAccessEnabled:!!e})})]}),(0,S.jsx)(P,{state:e.state,pending:l===`agent`}),(0,S.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Leave this off to keep manual device controls without giving agents access.`})]}):null,t[41]=j,t[42]=n,t[43]=D,t[44]=l,t[45]=e.state,t[46]=d,t[47]=B,t[48]=q):q=t[48];let J;t[49]!==e.state.hostStatus||t[50]!==e.state.hostStatusDetail?(J=e.state.hostStatus===`failed`&&e.state.hostStatusDetail?(0,S.jsx)(`p`,{role:`alert`,className:`mt-3 text-xs text-destructive`,children:e.state.hostStatusDetail}):null,t[49]=e.state.hostStatus,t[50]=e.state.hostStatusDetail,t[51]=J):J=t[51];let Y;t[52]!==G||t[53]!==K||t[54]!==q||t[55]!==J||t[56]!==W?(Y=(0,S.jsxs)(te,{children:[W,G,K,q,J]}),t[52]=G,t[53]=K,t[54]=q,t[55]=J,t[56]=W,t[57]=Y):Y=t[57];let X;t[58]!==j||t[59]!==l||t[60]!==d?(X=d===0?(0,S.jsx)(h,{render:(0,S.jsx)(o,{variant:`outline`}),children:`Cancel`}):(0,S.jsx)(o,{variant:`outline`,disabled:j||l!==null,onClick:()=>w(d-1),children:`Back`}),t[58]=j,t[59]=l,t[60]=d,t[61]=X):X=t[61];let Z;t[62]!==n||t[63]!==l||t[64]!==A||t[65]!==d||t[66]!==B?(Z=d<2?(0,S.jsx)(o,{disabled:!A||l!==null,onClick:()=>w(d+1),children:`Continue`}):(0,S.jsx)(o,{disabled:!n||!A||l!==null,onClick:()=>void B(`complete`,{onboardingCompleted:!0}),children:l===`complete`?`Saving…`:`Done`}),t[62]=n,t[63]=l,t[64]=A,t[65]=d,t[66]=B,t[67]=Z):Z=t[67];let Q;t[68]!==X||t[69]!==Z?(Q=(0,S.jsxs)(v,{children:[X,Z]}),t[68]=X,t[69]=Z,t[70]=Q):Q=t[70];let $;return t[71]!==Y||t[72]!==Q||t[73]!==U?($=(0,S.jsxs)(S.Fragment,{children:[U,Y,Q]}),t[71]=Y,t[72]=Q,t[73]=U,t[74]=$):$=t[74],$}function ne(e){return e.kind===`local`&&!e.platforms.some(j)}function j(e){return e.available}function M(e){let t=(0,b.c)(5),{state:n,pending:r,compact:a}=e,o=a!==void 0&&a;if(!r&&!O(n).ready)return null;let s;t[0]===r?s=t[1]:(s=r?(0,S.jsx)(d,{size:`xs`}):(0,S.jsx)(i,{className:`size-3 text-success`}),t[0]=r,t[1]=s);let c=r?n.hostStatus===`installing`?o?`Installing…`:`Installing device hub…`:n.hostStatus===`starting`?o?`Starting…`:`Starting device hub…`:o?`Updating…`:`Updating device hub…`:`Device hub is ready.`,l;return t[2]!==s||t[3]!==c?(l=(0,S.jsxs)(`p`,{role:`status`,className:`flex items-center gap-2 text-xs text-muted-foreground`,children:[s,c]}),t[2]=s,t[3]=c,t[4]=l):l=t[4],l}function N(e){let t=(0,b.c)(20),n;t[0]===e.state?n=t[1]:(n=k(e.state,`ios`),t[0]=e.state,t[1]=n);let r;t[2]===n?r=t[3]:(r=(0,S.jsx)(I,{platform:`iOS`,status:n}),t[2]=n,t[3]=r);let i;t[4]===e.state?i=t[5]:(i=k(e.state,`android`),t[4]=e.state,t[5]=i);let a;t[6]===i?a=t[7]:(a=(0,S.jsx)(I,{platform:`Android`,status:i}),t[6]=i,t[7]=a);let s;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,S.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`You can use either platform. Fixing a missing platform does not block the other one.`}),t[8]=s):s=t[8];let c;t[9]===e.checking?c=t[10]:(c=e.checking?(0,S.jsx)(d,{size:`xs`}):null,t[9]=e.checking,t[10]=c);let l=e.checking?`Checking…`:`Check again`,u;t[11]!==e.disabled||t[12]!==e.onCheck||t[13]!==c||t[14]!==l?(u=(0,S.jsxs)(o,{size:`compact`,variant:`outline`,disabled:e.disabled,onClick:e.onCheck,children:[c,l]}),t[11]=e.disabled,t[12]=e.onCheck,t[13]=c,t[14]=l,t[15]=u):u=t[15];let f;return t[16]!==r||t[17]!==a||t[18]!==u?(f=(0,S.jsxs)(`div`,{className:`space-y-3`,children:[r,a,s,u]}),t[16]=r,t[17]=a,t[18]=u,t[19]=f):f=t[19],f}function P(e){let t=(0,b.c)(4);if(e.pending){let n=e.state.hostStatus===`installing`?e.compact?`Installing…`:`Installing agent tools…`:e.state.hostStatus===`starting`?e.compact?`Starting…`:`Starting agent tools…`:e.compact?`Updating…`:`Updating agent access…`,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,S.jsx)(d,{size:`xs`}),t[0]=r):r=t[0];let i;return t[1]===n?i=t[2]:(i=(0,S.jsxs)(`p`,{role:`status`,className:`flex items-center gap-2 text-xs text-muted-foreground`,children:[r,n]}),t[1]=n,t[2]=i),i}if(e.state.agentAccessEnabled&&O(e.state).ready&&e.state.hosts.some(F)){let e;return t[3]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,S.jsxs)(`p`,{role:`status`,className:`flex items-center gap-2 text-xs text-muted-foreground`,children:[(0,S.jsx)(i,{className:`size-3 text-success`}),`Agent tools are ready.`]}),t[3]=e):e=t[3],e}return null}function F(e){return e.agentDeviceInstalled}function I(e){let t=(0,b.c)(21),n=!e.compact&&`rounded-md border border-border/60 px-3 py-2`,r;t[0]===n?r=t[1]:(r=s(`flex gap-2`,n),t[0]=n,t[1]=r);let i=e.status.ready?`text-success`:`text-muted-foreground`,a;t[2]===i?a=t[3]:(a=s(`mt-0.5 size-4 shrink-0`,i),t[2]=i,t[3]=a);let o=e.status.ready?c:u,d;t[4]!==a||t[5]!==o?(d=(0,S.jsx)(l,{className:a,icon:o}),t[4]=a,t[5]=o,t[6]=d):d=t[6];let f=e.compact&&e.status.ready&&`flex items-center gap-2`,p;t[7]===f?p=t[8]:(p=s(f),t[7]=f,t[8]=p);let m;t[9]===e.platform?m=t[10]:(m=(0,S.jsx)(`p`,{className:`font-medium`,children:e.platform}),t[9]=e.platform,t[10]=m);let h=e.compact&&e.status.ready?`Ready`:e.status.message,g;t[11]===h?g=t[12]:(g=(0,S.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:h}),t[11]=h,t[12]=g);let _;t[13]!==g||t[14]!==p||t[15]!==m?(_=(0,S.jsxs)(`div`,{className:p,children:[m,g]}),t[13]=g,t[14]=p,t[15]=m,t[16]=_):_=t[16];let v;return t[17]!==r||t[18]!==_||t[19]!==d?(v=(0,S.jsxs)(`div`,{className:r,children:[d,_]}),t[17]=r,t[18]=_,t[19]=d,t[20]=v):v=t[20],v}export{E as a,D as c,I as i,k as l,M as n,T as o,A as r,O as s,P as t,C as u};
2
+ //# sourceMappingURL=DeviceSetup-Cdyw5Z9a.js.map
@@ -0,0 +1,2 @@
1
+ import{a as e,t}from"./react-BUfh6y28.js";import{t as n}from"./jsx-runtime-DJeoFXNw.js";import{Ar as r,Br as i,Ci as a,Di as o,Do as s,Eo as c,Fo as l,Fr as u,Ha as d,Ii as f,Ma as p,Nr as m,Oo as h,Pa as g,Pi as _,Qa as v,Ri as y,Si as b,So as x,Ta as S,Ti as C,Ui as w,Yr as T,_a as E,_i as D,bi as O,bo as k,gi as A,hi as j,jo as M,ro as N,va as P,vi as F,wi as ee,xi as te,yi as I}from"./utils-DjbLtxuo.js";var L=e(t()),R=L.createContext(!1),z=L.createContext(void 0);function B(e){let t=L.useContext(z);if(e===!1&&t===void 0)throw Error(l(27));return t}var ne={...x,...c},re=L.forwardRef(function(e,t){let{render:n,className:r,style:i,forceRender:a=!1,...o}=e,{store:c}=B(),l=c.useState(`open`),u=c.useState(`nested`),d=c.useState(`mounted`),f={open:l,transitionStatus:c.useState(`transitionStatus`)};return s(`div`,e,{state:f,ref:[c.context.backdropRef,t],stateAttributesMapping:ne,props:[{role:`presentation`,hidden:!d,style:{userSelect:`none`,WebkitUserSelect:`none`}},o],enabled:a||!u})}),V=L.forwardRef(function(e,t){let{render:n,className:r,style:i,disabled:a=!1,nativeButton:o=!0,...c}=e,{store:l}=B(),u=l.useState(`open`),{getButtonProps:f,buttonRef:m}=d({disabled:a,native:o}),h={disabled:a};function g(e){u&&l.setOpen(!1,p(v,e.nativeEvent))}return s(`button`,e,{state:h,ref:[t,m],props:[{onClick:g},c,f]})}),H=L.forwardRef(function(e,t){let{render:n,className:r,style:i,id:a,...o}=e,{store:c}=B(),l=g(a);return c.useSyncedValueWithCleanup(`descriptionElementId`,l),s(`p`,e,{ref:t,props:[{id:l},o]})}),U=function(e){return e.nestedDialogs=`--nested-dialogs`,e}({}),W=function(e){return e[e.open=k.open]=`open`,e[e.closed=k.closed]=`closed`,e[e.startingStyle=k.startingStyle]=`startingStyle`,e[e.endingStyle=k.endingStyle]=`endingStyle`,e.nested=`data-nested`,e.nestedDialogOpen=`data-nested-dialog-open`,e}({}),G=L.createContext(void 0);function K(){let e=L.useContext(G);if(e===void 0)throw Error(l(26));return e}var q=e(n()),J={...x,...c,nestedDialogOpen(e){return e?{[W.nestedDialogOpen]:``}:null}},Y=L.forwardRef(function(e,t){let{render:n,className:r,style:i,finalFocus:a,initialFocus:o,...c}=e,{store:l}=B(),u=l.useState(`descriptionElementId`),d=l.useState(`disablePointerDismissal`),f=l.useState(`floatingRootContext`),p=l.useState(`popupProps`),m=l.useState(`modal`),h=l.useState(`mounted`),g=l.useState(`nested`),_=l.useState(`nestedOpenDialogCount`),v=l.useState(`open`),b=l.useState(`openMethod`),x=l.useState(`titleElementId`),C=l.useState(`transitionStatus`),w=l.useState(`role`),E=f.useState(`floatingId`),D=c.id??E;K(),S({open:v,ref:l.context.popupRef,onComplete(){v&&l.context.onOpenChangeComplete?.(!0)}});function O(e){return e!==`touch`||l.context.popupRef.current}let k=o===void 0?O:o,A=_>0,j=l.useStateSetter(`popupElement`),M=s(`div`,e,{state:{open:v,nested:g,transitionStatus:C,nestedDialogOpen:A},props:[p,{id:D,"aria-labelledby":x??void 0,"aria-describedby":u??void 0,role:w,...I,hidden:!h,onKeyDown(e){T.has(e.key)&&e.stopPropagation()},style:{[U.nestedDialogs]:_}},c],ref:[t,l.context.popupRef,j],stateAttributesMapping:J});return(0,q.jsx)(y,{context:f,openInteractionType:b,disabled:!h,closeOnFocusOut:!d,initialFocus:k,returnFocus:a,modal:m!==!1,restoreFocus:`popup`,children:M})}),ie=L.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e,{store:a}=B(),o=a.useState(`mounted`),s=a.useState(`modal`),c=a.useState(`open`);return o||n?(0,q.jsx)(G.Provider,{value:n,children:(0,q.jsxs)(w,{ref:t,...r,children:[o&&s===!0&&(0,q.jsx)(u,{ref:a.context.internalBackdropRef,inert:i(!c)}),e.children]})}):null});function X(e){let{store:t,parentContext:n,actionsRef:r,isDrawer:i}=e,a=t.useState(`open`);ee(t,a),te(t);let{forceUnmount:o}=b(a,t),s=L.useCallback(()=>{t.setOpen(!1,p(N))},[t]);return L.useImperativeHandle(r,()=>({unmount:o,close:s}),[o,s]),{parentContext:n,isDrawer:i}}function ae({store:e,dialogRoot:t}){let{parentContext:n,isDrawer:r}=t,i=e.useState(`open`),o=e.useState(`disablePointerDismissal`),s=e.useState(`modal`),c=e.useState(`popupElement`),l=e.useState(`floatingRootContext`),[u,d]=L.useState(0),[p,g]=L.useState(0),_=u===0,v=f(l,{outsidePressEvent(){return e.context.internalBackdropRef.current||e.context.backdropRef.current?`intentional`:{mouse:s===`trap-focus`?`sloppy`:`intentional`,touch:`sloppy`}},outsidePress(t){if(!e.context.outsidePressEnabledRef.current||`button`in t&&t.button!==0||`touches`in t&&t.touches.length!==1)return!1;let n=P(t);if(_&&!o){let t=n;return s&&(e.context.internalBackdropRef.current||e.context.backdropRef.current)?e.context.internalBackdropRef.current===t||e.context.backdropRef.current===t||E(t,c)&&!t?.hasAttribute(`data-base-ui-portal`):!0}return!1},escapeKey:_});m(i&&s===!0,c),e.useContextCallback(`onNestedDialogOpen`,(e,t)=>{d(e),g(t)}),e.useContextCallback(`onNestedDialogClose`,()=>{d(0),g(0)}),L.useEffect(()=>(n?.onNestedDialogOpen&&i&&n.onNestedDialogOpen(u+1,p+ +!!r),n?.onNestedDialogClose&&!i&&n.onNestedDialogClose(),()=>{n?.onNestedDialogClose&&i&&n.onNestedDialogClose()}),[r,i,u,p,n]);let y=v.reference??M,b=v.trigger??M,x=L.useMemo(()=>h(I,v.floating),[v.floating]);return a(e,{activeTriggerProps:y,inactiveTriggerProps:b,popupProps:x,nestedOpenDialogCount:u,nestedOpenDrawerCount:p}),null}var oe={...D,modal:_(e=>e.modal),nested:_(e=>e.nested),nestedOpenDialogCount:_(e=>e.nestedOpenDialogCount),nestedOpenDrawerCount:_(e=>e.nestedOpenDrawerCount),disablePointerDismissal:_(e=>e.disablePointerDismissal),openMethod:_(e=>e.openMethod),descriptionElementId:_(e=>e.descriptionElementId),titleElementId:_(e=>e.titleElementId),viewportElement:_(e=>e.viewportElement),role:_(e=>e.role)},Z=class e extends o{constructor(e,t,n=!1){let r=new F,i=se(e);i.floatingRootContext=A(r,t,n),super(i,{popupRef:L.createRef(),backdropRef:L.createRef(),internalBackdropRef:L.createRef(),outsidePressEnabledRef:{current:!0},triggerElements:r,onOpenChange:void 0,onOpenChangeComplete:void 0},oe)}setOpen=(e,t)=>{if(t.preventUnmountOnClose=()=>{this.set(`preventUnmountingOnClose`,!0)},!e&&t.trigger==null&&this.state.activeTriggerId!=null&&(t.trigger=this.state.activeTriggerElement??void 0),this.context.onOpenChange?.(e,t),t.isCanceled)return;this.state.floatingRootContext.dispatchOpenChange(e,t);let n={open:e};O(n,e,t.trigger),this.update(n)};static useStore(t,n){return C(t,(t,r)=>new e(n,t,r),!0).store}};function se(e={}){return{...j(),modal:!0,disablePointerDismissal:!1,popupElement:null,viewportElement:null,descriptionElementId:void 0,titleElementId:void 0,openMethod:null,nested:!1,nestedOpenDialogCount:0,nestedOpenDrawerCount:0,role:`dialog`,...e}}function Q(e,t=`dialog`){let{children:n,open:i,defaultOpen:a=!1,onOpenChange:o,onOpenChangeComplete:s,disablePointerDismissal:c=!1,modal:l=!0,actionsRef:u,handle:d,triggerId:f,defaultTriggerId:p=null}=e,m=t===`drawer`,h=t===`alert-dialog`,g=h?!0:l,_=h||c,v=h?`alertdialog`:`dialog`,y=B(!0),b={modal:g,disablePointerDismissal:_,nested:!!y,role:v},x=Z.useStore(d?.store,{open:a,openProp:i,activeTriggerId:p,triggerIdProp:f,...b});r(()=>{let e=i===void 0&&x.state.open===!1&&a===!0?{open:!0,activeTriggerId:p}:null;h?x.update(e?{...b,...e}:b):e&&x.update(e)}),x.useControlledProp(`openProp`,i),x.useControlledProp(`triggerIdProp`,f),x.useSyncedValues(b),x.useContextCallback(`onOpenChange`,o),x.useContextCallback(`onOpenChangeComplete`,s);let S=x.useState(`open`),C=x.useState(`mounted`),w=x.useState(`payload`),T=X({store:x,actionsRef:u,parentContext:y?.store.context,isDrawer:m}),E=S||C,D=L.useMemo(()=>({store:x}),[x]);return(0,q.jsx)(R.Provider,{value:!1,children:(0,q.jsxs)(z.Provider,{value:D,children:[E&&(0,q.jsx)(ae,{store:x,dialogRoot:T}),typeof n==`function`?n({payload:w}):n]})})}function ce(e){return Q(e,L.useContext(R)?`drawer`:`dialog`)}var $=function(e){return e[e.open=k.open]=`open`,e[e.closed=k.closed]=`closed`,e[e.startingStyle=k.startingStyle]=`startingStyle`,e[e.endingStyle=k.endingStyle]=`endingStyle`,e.nested=`data-nested`,e.nestedDialogOpen=`data-nested-dialog-open`,e}({}),le={...x,...c,nested(e){return e?{[$.nested]:``}:null},nestedDialogOpen(e){return e?{[$.nestedDialogOpen]:``}:null}},ue=L.forwardRef(function(e,t){let{render:n,className:r,style:i,children:a,...o}=e,c=K(),{store:l}=B(),u=l.useState(`open`),d=l.useState(`nested`),f=l.useState(`transitionStatus`),p=l.useState(`nestedOpenDialogCount`),m=l.useState(`mounted`),h=l.useStateSetter(`viewportElement`);return s(`div`,e,{enabled:c||m,state:{open:u,nested:d,transitionStatus:f,nestedDialogOpen:p>0},ref:[t,h],stateAttributesMapping:le,props:[{role:`presentation`,hidden:!m,style:{pointerEvents:u?void 0:`none`},children:a},o]})}),de=L.forwardRef(function(e,t){let{render:n,className:r,style:i,id:a,...o}=e,{store:c}=B(),l=g(a);return c.useSyncedValueWithCleanup(`titleElementId`,l),s(`h2`,e,{ref:t,props:[{id:l},o]})});export{Z as a,H as c,B as d,Q as i,V as l,ue as n,ie as o,ce as r,Y as s,de as t,re as u};
2
+ //# sourceMappingURL=DialogTitle-CFYK6V6-.js.map