@p4code/cli 0.9.6 → 0.9.8

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 (317) hide show
  1. package/dist/bin.mjs +1 -1
  2. package/dist/{binCli-0A0KffG3.mjs → binCli-CLYknQ8Q.mjs} +4219 -3478
  3. package/dist/client/.vite/manifest.json +1998 -1999
  4. package/dist/client/assets/{2NI2N5EU-BEr-Tfqs.js → 2NI2N5EU-D0DC_qzC.js} +2 -2
  5. package/dist/client/assets/{4UO7MD6I-z55jzCJI.js → 4UO7MD6I-CUZSFvTG.js} +2 -2
  6. package/dist/client/assets/{5B3SVYGG-BFexm37i.js → 5B3SVYGG-5ibYwkgG.js} +2 -2
  7. package/dist/client/assets/{5GK6JWQ2-Bn_JiXgJ.js → 5GK6JWQ2-DEtRbsDS.js} +2 -2
  8. package/dist/client/assets/{5N7A7DKN-Duo22cWA.js → 5N7A7DKN-CwQP1dKj.js} +2 -2
  9. package/dist/client/assets/{5OC2THR4-DidiZL1J.js → 5OC2THR4-BriFYPQx.js} +2 -2
  10. package/dist/client/assets/{5S6HY5KT-DQ4fJlKq.js → 5S6HY5KT-BBNxENgt.js} +2 -2
  11. package/dist/client/assets/{6IMQ5BUJ-JMPhBK1B.js → 6IMQ5BUJ-xl7U-rLA.js} +2 -2
  12. package/dist/client/assets/{6OLKWJ4F-CpaocvvP.js → 6OLKWJ4F-BGGDxoUW.js} +2 -2
  13. package/dist/client/assets/{74OO7NKP-Btg8U3A7.js → 74OO7NKP-9vkDTl8T.js} +2 -2
  14. package/dist/client/assets/{75O6YZUN-BVcu_3G6.js → 75O6YZUN-B9ocscUs.js} +2 -2
  15. package/dist/client/assets/{77XECAW3-B2dqs2a0.js → 77XECAW3-DQ3S_7U7.js} +2 -2
  16. package/dist/client/assets/{ABYRPUBD-csm8mwzG.js → ABYRPUBD-DFu3UszL.js} +2 -2
  17. package/dist/client/assets/AlertDialogRoot-Dxu9crTa.js +2 -0
  18. package/dist/client/assets/{AnimatedHeight-CU3C1NcV.js → AnimatedHeight-DEH7bEtg.js} +2 -2
  19. package/dist/client/assets/{AuthSurfaceShell-DT2jFrxd.js → AuthSurfaceShell-DDlvsg4m.js} +2 -2
  20. package/dist/client/assets/{BB2UYUI2-CrLDpD9c.js → BB2UYUI2-DzdR7ZyB.js} +2 -2
  21. package/dist/client/assets/{BUM34MOA-DGaisF3P.js → BUM34MOA-LkeHTV8a.js} +2 -2
  22. package/dist/client/assets/{CEQABKGZ-BHUFEz8L.js → CEQABKGZ-BX1CWous.js} +2 -2
  23. package/dist/client/assets/{CXAC5362-CF0Q8UlN.js → CXAC5362-DMlUWuvv.js} +2 -2
  24. package/dist/client/assets/ChatGptUsageButton-CXEX1qrn.js +2 -0
  25. package/dist/client/assets/ChatMarkdown-yTbjRmgo.js +48 -0
  26. package/dist/client/assets/{CheckboxIndicator-CT--c3fO.js → CheckboxIndicator-DSA5Ujdj.js} +2 -2
  27. package/dist/client/assets/{ClippedText-BWXvwYxu.js → ClippedText-DlUFaCzw.js} +2 -2
  28. package/dist/client/assets/CodexSetupSection.logic-D3odRubx.js +2 -0
  29. package/dist/client/assets/{ComboboxClear-CRWQGFjR.js → ComboboxClear-DkaA60b7.js} +2 -2
  30. package/dist/client/assets/{ComboboxGroupLabel-BMo03qXe.js → ComboboxGroupLabel-AEuoHUH8.js} +2 -2
  31. package/dist/client/assets/{CommandBlock-D57LdSoM.js → CommandBlock-BUHVWYBr.js} +2 -2
  32. package/dist/client/assets/{ComposerPromptEditor-DJ9XwB1O.js → ComposerPromptEditor-zRTz5xec.js} +11 -11
  33. package/dist/client/assets/{CompositeRoot-DSNl3c3G.js → CompositeRoot-38NDvFsA.js} +2 -2
  34. package/dist/client/assets/{ConnectionDiagnosisDetails-CMRX7VzH.js → ConnectionDiagnosisDetails-WKkRENJB.js} +2 -2
  35. package/dist/client/assets/{ConnectionStatusDot-CiISG6eT.js → ConnectionStatusDot-B-U5Wv6b.js} +2 -2
  36. package/dist/client/assets/{DRLTVNUE-BjIXDJQN.js → DRLTVNUE-CNkbJcIE.js} +2 -2
  37. package/dist/client/assets/{DYY6UVD2-Dpro9qr4.js → DYY6UVD2-Csqmb0Yg.js} +2 -2
  38. package/dist/client/assets/{DevicePanel-DtM34nRC.js → DevicePanel-B3G_KDJN.js} +2 -2
  39. package/dist/client/assets/DeviceSetup-DqTJRSli.js +2 -0
  40. package/dist/client/assets/{DialogTitle-CACErOl5.js → DialogTitle-Bz-7IYD8.js} +2 -2
  41. package/dist/client/assets/{DiffCommentAnnotation-Bcjn-Btj.js → DiffCommentAnnotation-C3_yEiAB.js} +2 -2
  42. package/dist/client/assets/{DiffFileTree-1s_6Y4bE.js → DiffFileTree-BJxoYt-I.js} +2 -2
  43. package/dist/client/assets/DiffPanel-Bfxdj8td.js +2 -0
  44. package/dist/client/assets/{DiffWorkerPoolProvider-DDVuzh7w.js → DiffWorkerPoolProvider-DPfZNt42.js} +3 -3
  45. package/dist/client/assets/{EmbeddedDesign-3XobSUFO.js → EmbeddedDesign-CsCt-RW1.js} +5 -5
  46. package/dist/client/assets/{EnvironmentMachineIcon-B6RgXF8A.js → EnvironmentMachineIcon-CKfntUmE.js} +2 -2
  47. package/dist/client/assets/{ExpandableText-B3WqZ3eC.js → ExpandableText-DGu2RH_j.js} +2 -2
  48. package/dist/client/assets/{FNOVOB4O-BxVVUi2o.js → FNOVOB4O-CH8BTfJM.js} +2 -2
  49. package/dist/client/assets/{FieldControl-BDrBhdoh.js → FieldControl-DAh0lUDV.js} +2 -2
  50. package/dist/client/assets/{FileDiff-DM8e9Pyt.js → FileDiff-C1enHrMi.js} +2 -2
  51. package/dist/client/assets/{FilePreviewPanel-CRdP4-01.js → FilePreviewPanel-67DQ3_gp.js} +6 -6
  52. package/dist/client/assets/{FoldedSettingsSection-CsaWcgI5.js → FoldedSettingsSection-CILGGC6I.js} +2 -2
  53. package/dist/client/assets/{FormContext-BZ8Nuwwa.js → FormContext-BdrDIRv0.js} +2 -2
  54. package/dist/client/assets/{HDGCDEEZ-9x1WhMZA.js → HDGCDEEZ-Ox1-cFjL.js} +2 -2
  55. package/dist/client/assets/{HSJLKHB7-BI4g8Uha.js → HSJLKHB7-BEBG51eo.js} +2 -2
  56. package/dist/client/assets/{Icons-CPaJO8_C.js → Icons-C-FXpOud.js} +2 -2
  57. package/dist/client/assets/Input-DWhR3WLZ.js +2 -0
  58. package/dist/client/assets/JZOYTAAL-K5yyV5fj.js +1 -0
  59. package/dist/client/assets/{K3MD6TGW-QvtIomBt.js → K3MD6TGW-DhfhwRRq.js} +2 -2
  60. package/dist/client/assets/{K7RP3OMA-CenKL848.js → K7RP3OMA-DdE8zx2_.js} +2 -2
  61. package/dist/client/assets/{KeybindingsSettings.logic-Dk-UU5gV.js → KeybindingsSettings.logic-Ddu7cDVA.js} +2 -2
  62. package/dist/client/assets/{LHDIQX7Q-Du31c03t.js → LHDIQX7Q-_CTEfstz.js} +2 -2
  63. package/dist/client/assets/{LUXOKEGN-DwVZaHZy.js → LUXOKEGN-BZTFKFlr.js} +2 -2
  64. package/dist/client/assets/{MathTypeset-DUJJZ0qR.js → MathTypeset-hiZgZUOa.js} +2 -2
  65. package/dist/client/assets/{N3JZAHOW-f6rXQzfb.js → N3JZAHOW-CC607oJ3.js} +2 -2
  66. package/dist/client/assets/{NUIALGQ3-B7-2dGpz.js → NUIALGQ3-YZiFnb1D.js} +2 -2
  67. package/dist/client/assets/{NoProjectsHero-BJZpoal_.js → NoProjectsHero-BaAbresy.js} +2 -2
  68. package/dist/client/assets/{O65XPQGZ-pxAza1nz.js → O65XPQGZ-CJWG3hrr.js} +2 -2
  69. package/dist/client/assets/{O7XIQ6OM-nX2_hGto.js → O7XIQ6OM-CO58SxOd.js} +2 -2
  70. package/dist/client/assets/{OFQON5FD-y110aBJF.js → OFQON5FD-ZVCn5Afz.js} +2 -2
  71. package/dist/client/assets/{P4ConnectAccountPages-C1rFKA40.js → P4ConnectAccountPages-nuGk_jH6.js} +2 -2
  72. package/dist/client/assets/{P4ConnectSidebarSignIn-40UlSrjv.js → P4ConnectSidebarSignIn-DMU_ZGur.js} +2 -2
  73. package/dist/client/assets/{PJQHF43J-CbQqRUq6.js → PJQHF43J-Dyo99try.js} +2 -2
  74. package/dist/client/assets/PanelLayoutControls-CwJW9Vo-.js +216 -0
  75. package/dist/client/assets/{PierreEntryIcon-C488PFw3.js → PierreEntryIcon-BGnGqbZS.js} +2 -2
  76. package/dist/client/assets/{PopoverHandle-ByI17B8T.js → PopoverHandle-BGTDdU32.js} +2 -2
  77. package/dist/client/assets/PreviewPanel-C914U2vc.js +2 -0
  78. package/dist/client/assets/{ProjectDefaultsSettings-b9JKMHCZ.js → ProjectDefaultsSettings-B8-DHhbT.js} +2 -2
  79. package/dist/client/assets/ProjectFavicon-Bnd4lTxL.js +3 -0
  80. package/dist/client/assets/{ProjectIconPickerDialog-Cug9qYje.js → ProjectIconPickerDialog-D_7XapzM.js} +2 -2
  81. package/dist/client/assets/{ProjectMonogram-DdSkqGzz.js → ProjectMonogram-BRycZjMZ.js} +2 -2
  82. package/dist/client/assets/{ProviderAuthTerminal-BiaVsusp.js → ProviderAuthTerminal-ejODeZci.js} +2 -2
  83. package/dist/client/assets/ProviderModelPicker-BigVoJfZ.js +2 -0
  84. package/dist/client/assets/{ProviderSettingsForm-DTCgpI31.js → ProviderSettingsForm-TxiFYWfI.js} +2 -2
  85. package/dist/client/assets/PullRequestCodeTab-D99_acmK.js +6 -0
  86. package/dist/client/assets/{RHNBAITX-NhKz5kz6.js → RHNBAITX-B2MpzGNB.js} +2 -2
  87. package/dist/client/assets/{ReadOnlySourcePreview-BVjNlm_O.js → ReadOnlySourcePreview-Clh1I7db.js} +2 -2
  88. package/dist/client/assets/{RenderErrorBoundary-C2PF8Cmu.js → RenderErrorBoundary-UQ8iqwRx.js} +3 -3
  89. package/dist/client/assets/{SLD4V6NK-Ca5SsXR4.js → SLD4V6NK-DDlJ2xA8.js} +2 -2
  90. package/dist/client/assets/{ScheduledTasksSettings-QWakG9R_.js → ScheduledTasksSettings-VxM8-W1a.js} +4 -4
  91. package/dist/client/assets/{ScopedSwitch-Dpqx-0tY.js → ScopedSwitch-B9HsEBfG.js} +2 -2
  92. package/dist/client/assets/{ScrollAreaCorner-CGc2ioKQ.js → ScrollAreaCorner-DaAMqe_x.js} +2 -2
  93. package/dist/client/assets/{SecretInput-D6soOcQS.js → SecretInput-Dfsqp38C.js} +2 -2
  94. package/dist/client/assets/{SelectScrollUpArrow-CjMNXdhr.js → SelectScrollUpArrow-CBbON2Cr.js} +2 -2
  95. package/dist/client/assets/SettingsPanels-D16J4fBs.js +46 -0
  96. package/dist/client/assets/{SettingsPanels.logic-DYKv08oD.js → SettingsPanels.logic-DLPcHVw0.js} +2 -2
  97. package/dist/client/assets/{SettingsScopeNotice-Bq20tBUp.js → SettingsScopeNotice-CLuK5ZOQ.js} +2 -2
  98. package/dist/client/assets/{SidebarStageBackdrop-CEjjEyUl.js → SidebarStageBackdrop-Bgae69g1.js} +2 -2
  99. package/dist/client/assets/{T3PCR2KE-D-xJTbp-.js → T3PCR2KE-DQ6cSkUG.js} +2 -2
  100. package/dist/client/assets/{TKWO2OVW-JaByeldU.js → TKWO2OVW-DlInq0TH.js} +2 -2
  101. package/dist/client/assets/{TSHNXIZL-7SUhC5Vk.js → TSHNXIZL-DL8cfasx.js} +2 -2
  102. package/dist/client/assets/{ThemeEditorPanel-TxkY9El4.js → ThemeEditorPanel-Dhd_0CzC.js} +2 -2
  103. package/dist/client/assets/ThreadTerminalDrawer-Bga-TMJR.js +5 -0
  104. package/dist/client/assets/{TooltipViewport-beytMJmq.js → TooltipViewport-UaR0JZsl.js} +2 -2
  105. package/dist/client/assets/{UQJE5E4I-CHN9jRa_.js → UQJE5E4I-WMwM-nEH.js} +2 -2
  106. package/dist/client/assets/{USNYFO5S-Bvrc0sLJ.js → USNYFO5S-D-mgcpxb.js} +2 -2
  107. package/dist/client/assets/{Virtualizer-vgqc_DSl.js → Virtualizer-CUj2Cqvm.js} +2 -2
  108. package/dist/client/assets/{WEVWDWVA-BaKbLsuO.js → WEVWDWVA-CiAqWYrx.js} +2 -2
  109. package/dist/client/assets/{WorkspaceBreadcrumb-1f5BN5n1.js → WorkspaceBreadcrumb-D8GTBuA5.js} +2 -2
  110. package/dist/client/assets/{WorkspacePageContainer-CDQRGmcV.js → WorkspacePageContainer-BKXvWv-9.js} +2 -2
  111. package/dist/client/assets/{WorkspacePageHeader-Q5YQyOFt.js → WorkspacePageHeader-zMZD9Zz8.js} +2 -2
  112. package/dist/client/assets/{X5RFHQXM-BfoStT6R.js → X5RFHQXM-YS48_sFp.js} +2 -2
  113. package/dist/client/assets/{X62E3GBT-DPqQZAUV.js → X62E3GBT-C444MNd3.js} +2 -2
  114. package/dist/client/assets/{XBNEOJTC-a4pknpW1.js → XBNEOJTC-0O1bjE8y.js} +2 -2
  115. package/dist/client/assets/{YHV2MVVZ-CLYitNzo.js → YHV2MVVZ-Coy_OiWg.js} +2 -2
  116. package/dist/client/assets/{YURCZMG2-D5G4Gqxk.js → YURCZMG2-Lc2Tv_HR.js} +2 -2
  117. package/dist/client/assets/{YVG2LODB-BaOOPjOj.js → YVG2LODB-CWUTdxUc.js} +2 -2
  118. package/dist/client/assets/_chat-BWNTWBCr.js +45 -0
  119. package/dist/client/assets/_chat.design-CajRPBez.js +2 -0
  120. package/dist/client/assets/_chat.index-OsM078CN.js +2 -0
  121. package/dist/client/assets/_chat.new-BI8wuTGQ.js +4 -0
  122. package/dist/client/assets/_chat.pull-requests-Alx1g9Xh.js +2 -0
  123. package/dist/client/assets/{alert-Cq0DAg5J.js → alert-RktpFBv6.js} +2 -2
  124. package/dist/client/assets/{assetUrls-DpLOinYe.js → assetUrls-COCOS1bm.js} +2 -2
  125. package/dist/client/assets/assets-B36wSN1M.js +2 -0
  126. package/dist/client/assets/{browserHistoryStore-CUc0_P_z.js → browserHistoryStore-CBcm7bje.js} +2 -2
  127. package/dist/client/assets/{browserLinkTarget-BmW74g3V.js → browserLinkTarget-D-M5yQc0.js} +2 -2
  128. package/dist/client/assets/{checkbox-CoJ-ki0Z.js → checkbox-vIS3kn6A.js} +2 -2
  129. package/dist/client/assets/{color-picker-ABTfqBnJ.js → color-picker-vozMHo5G.js} +2 -2
  130. package/dist/client/assets/{combobox-C6NpXSFx.js → combobox-CzEFd5LA.js} +2 -2
  131. package/dist/client/assets/{command-BOsIZcjU.js → command-CLf9yckl.js} +2 -2
  132. package/dist/client/assets/{connect-B3OIDtgH.js → connect-BoLhf5rG.js} +2 -2
  133. package/dist/client/assets/{connect-agent-BcH8kUjm.js → connect-agent-BUjhhqbv.js} +2 -2
  134. package/dist/client/assets/{design-D0u5lYcP.js → design-LeaOcSZl.js} +2 -2
  135. package/dist/client/assets/device-D9IuUJmU.js +2 -0
  136. package/dist/client/assets/{dialog-r1KpDpid.js → dialog-B69qrNtB.js} +2 -2
  137. package/dist/client/assets/{diffRendering-cPnt2kIt.js → diffRendering-DU37Uneg.js} +2 -2
  138. package/dist/client/assets/{dist-D4Fzk6mX.js → dist-CtnQm06p.js} +3 -3
  139. package/dist/client/assets/{draft-input-eAeawUnI.js → draft-input-BUsvwNIU.js} +2 -2
  140. package/dist/client/assets/{duoViewer-6tHPOGH8.js → duoViewer-CPd6U9x5.js} +2 -2
  141. package/dist/client/assets/{dynamic-bKXiwQos.js → dynamic-DDiw9bBP.js} +2 -2
  142. package/dist/client/assets/{embeddedScripts-CALp_TgN.js → embeddedScripts-DjnGPWZd.js} +2 -2
  143. package/dist/client/assets/{empty-B5VIjZQf.js → empty-B1FuCXoG.js} +2 -2
  144. package/dist/client/assets/entities-Cd_YDhEa.js +2 -0
  145. package/dist/client/assets/{fileLinks-B4-TDufo.js → fileLinks-DzCsEQpS.js} +2 -2
  146. package/dist/client/assets/{fileTreeExpansion-WgU7oBBt.js → fileTreeExpansion-eHhwnC6l.js} +2 -2
  147. package/dist/client/assets/{getDiffFileInput-CIsReQa3.js → getDiffFileInput-eC26FmPf.js} +2 -2
  148. package/dist/client/assets/{guideRunStore-D6SjxVHH.js → guideRunStore-CugTzRRn.js} +2 -2
  149. package/dist/client/assets/{htmlRender-eKT33KVk.js → htmlRender-CcVnPpcS.js} +2 -2
  150. package/dist/client/assets/{index-Gp6V8OPo.js → index-CZlF3wQ9.js} +3 -3
  151. package/dist/client/assets/{input-CySdZpuF.js → input-D8R-9BO3.js} +2 -2
  152. package/dist/client/assets/{input-group-BRBXX90v.js → input-group-CevCumL6.js} +2 -2
  153. package/dist/client/assets/{kbd-BEi8qVF9.js → kbd-Fy-v90ND.js} +2 -2
  154. package/dist/client/assets/keybindings-DMghyE3A.js +2 -0
  155. package/dist/client/assets/{lazy-BKgu9oVK.js → lazy-BA6aXmZc.js} +4 -4
  156. package/dist/client/assets/{lazyRouteComponent-BUMdW5GA.js → lazyRouteComponent-DVNAnyiv.js} +2 -2
  157. package/dist/client/assets/{link-BLuLRp-C.js → link-ci_EPfAz.js} +2 -2
  158. package/dist/client/assets/{linkedPrompt-BCdDQK81.js → linkedPrompt-CPHt2jcO.js} +2 -2
  159. package/dist/client/assets/main-B-tAk2zT.css +2 -0
  160. package/dist/client/assets/main-om7hc1qE.js +37 -0
  161. package/dist/client/assets/{mediaReference-DAak-Bfh.js → mediaReference-CZmbKByR.js} +2 -2
  162. package/dist/client/assets/mediaSource-DX6oP8x9.js +2 -0
  163. package/dist/client/assets/{number-field-DqB5oGdp.js → number-field-CmK8oJMM.js} +2 -2
  164. package/dist/client/assets/{observeResize-CAGp2C1D.js → observeResize-YxzDUnDW.js} +2 -2
  165. package/dist/client/assets/{onboarding-JbZFsvi9.js → onboarding-eClefFKp.js} +2 -2
  166. package/dist/client/assets/openFileInPreview-H9M5FxLy.js +2 -0
  167. package/dist/client/assets/{p4ProjectFile-DuMklfjR.js → p4ProjectFile-BC2tSEs4.js} +2 -2
  168. package/dist/client/assets/{pair-3U4lhizd.js → pair-BUZJqgA1.js} +2 -2
  169. package/dist/client/assets/{pendingSendStore-BaAUC-mU.js → pendingSendStore-C5UcT8R0.js} +2 -2
  170. package/dist/client/assets/{phoneViewer-BhDgaxtz.js → phoneViewer-fmWF20qy.js} +2 -2
  171. package/dist/client/assets/{pierre-icons-BnU3xLFM.js → pierre-icons-DlYshDSm.js} +2 -2
  172. package/dist/client/assets/{popover-Cmd3nOX1.js → popover-CtJuJW_f.js} +2 -2
  173. package/dist/client/assets/{preview-DzgdX_e_.js → preview-D-Cm6hTR.js} +2 -2
  174. package/dist/client/assets/{preview-BhM7y-5f.js → preview-DtLn0r5X.js} +2 -2
  175. package/dist/client/assets/{previewMiniPlayerStore-JEelmjkF.js → previewMiniPlayerStore-BQgCK2RM.js} +2 -2
  176. package/dist/client/assets/primary-CuSE-Dwp.js +2 -0
  177. package/dist/client/assets/primaryCloudLinkState-BsKyx6nh.js +2 -0
  178. package/dist/client/assets/projectFilesQueryState-FiXJc2AO.js +2 -0
  179. package/dist/client/assets/projectScriptEditor-CwMYFrgO.js +2 -0
  180. package/dist/client/assets/{providerSkills-DY_Eya4r.js → providerSkills-DRtgduYo.js} +2 -2
  181. package/dist/client/assets/{pullRequestDetail.logic-CLAnM03l.js → pullRequestDetail.logic-CqcRjGbR.js} +4 -4
  182. package/dist/client/assets/{pullRequestIcons-1vN39RsA.js → pullRequestIcons-Bk_-BZhA.js} +2 -2
  183. package/dist/client/assets/{pullRequestReviewStore-z8tuJFXD.js → pullRequestReviewStore-Br0qNCn2.js} +2 -2
  184. package/dist/client/assets/pullRequests-C9YbqDXl.js +2 -0
  185. package/dist/client/assets/queries-DMkaYL1H.js +2 -0
  186. package/dist/client/assets/query-B1dBedyO.js +2 -0
  187. package/dist/client/assets/{radio-group-Dcl3ANRp.js → radio-group-CQTaM9n2.js} +2 -2
  188. package/dist/client/assets/{renderScheduler-CfBAnW7l.js → renderScheduler-fJB2sQwM.js} +2 -2
  189. package/dist/client/assets/{rightPanelStore-DKH3Bw74.js → rightPanelStore-C5nnGDev.js} +2 -2
  190. package/dist/client/assets/runtime-B6yGAVz4.js +6 -0
  191. package/dist/client/assets/runtime-BhGr1QCf.js +3 -0
  192. package/dist/client/assets/{runtimeModeConfig-cuNxQIV-.js → runtimeModeConfig-Htoh7tJb.js} +2 -2
  193. package/dist/client/assets/{scheduledTasksSettings.logic-9aUS0PH9.js → scheduledTasksSettings.logic-DRYrMw8R.js} +3 -3
  194. package/dist/client/assets/{scroll-area-DMQd4YlU.js → scroll-area-DJaTwtcr.js} +2 -2
  195. package/dist/client/assets/{select-kRO2vVzo.js → select-BFALokxW.js} +2 -2
  196. package/dist/client/assets/{selfImproveFindings-uaqHvfDg.js → selfImproveFindings-H2XgphDi.js} +2 -2
  197. package/dist/client/assets/server-Dc9414wM.js +2 -0
  198. package/dist/client/assets/session-B6T_Arzf.js +2 -0
  199. package/dist/client/assets/session-logic-BaSoFnqy.js +26 -0
  200. package/dist/client/assets/settings-BkLvGwfm.js +2 -0
  201. package/dist/client/assets/{settings.appearance-Cfti608t.js → settings.appearance-OuApP6hX.js} +2 -2
  202. package/dist/client/assets/settings.archived-DLycLGH2.js +2 -0
  203. package/dist/client/assets/{settings.computer-use-BlDOxUzy.js → settings.computer-use-DbtSE70m.js} +2 -2
  204. package/dist/client/assets/settings.connections-D8EmrGJK.js +2 -0
  205. package/dist/client/assets/{settings.data-controls-DUdW2NVF.js → settings.data-controls-DqM0dqdr.js} +2 -2
  206. package/dist/client/assets/settings.decisions-BNBjCRqL.js +2 -0
  207. package/dist/client/assets/{settings.designs-BtuTLR8n.js → settings.designs-BIB7y5ry.js} +2 -2
  208. package/dist/client/assets/settings.diagnostics-CZPZhIn-.js +2 -0
  209. package/dist/client/assets/{settings.general-BmfZwZYV.js → settings.general-D73jxwiz.js} +2 -2
  210. package/dist/client/assets/settings.integrations-Vq3IT0_R.js +2 -0
  211. package/dist/client/assets/{settings.keybindings-BTpVSO__.js → settings.keybindings-DMI2SOqT.js} +2 -2
  212. package/dist/client/assets/{settings.open-source-licenses-XO8zNkrl.js → settings.open-source-licenses-QRv0v3-V.js} +2 -2
  213. package/dist/client/assets/{settings.plugins-VlmvBnPN.js → settings.plugins-Ddb8m4nE.js} +4 -4
  214. package/dist/client/assets/settings.projects-r-irj-Zr.js +4 -0
  215. package/dist/client/assets/settings.providers-Ce4kHZsP.js +3 -0
  216. package/dist/client/assets/{settings.scheduled-tasks-Dm3QDHlc.js → settings.scheduled-tasks-RWniN8Lw.js} +2 -2
  217. package/dist/client/assets/settings.snap-shot-D6hiK4XK.js +2 -0
  218. package/dist/client/assets/settings.source-control-GPOjx565.js +2 -0
  219. package/dist/client/assets/settings.storage-CZsmFyZ8.js +2 -0
  220. package/dist/client/assets/settingsLayout-CthOqZyP.js +3 -0
  221. package/dist/client/assets/{sidebar-C_Z-zEdU.js → sidebar-BDFu5cf2.js} +2 -2
  222. package/dist/client/assets/{sidebarProjectGrouping-upKKecFM.js → sidebarProjectGrouping-CURnoavN.js} +2 -2
  223. package/dist/client/assets/{skeleton-CAZWrHi2.js → skeleton-CIpn5ufH.js} +2 -2
  224. package/dist/client/assets/{sourceControl-Bb4nr0Wx.js → sourceControl-DjMIOzv1.js} +2 -2
  225. package/dist/client/assets/{sourceControlClients-DExT5Wem.js → sourceControlClients-C2uvUFSM.js} +2 -2
  226. package/dist/client/assets/{spinner-DN7lJfwl.js → spinner-t32AzjJr.js} +2 -2
  227. package/dist/client/assets/{terminal-links-Dj73wz5S.js → terminal-links-D6dqW3h9.js} +2 -2
  228. package/dist/client/assets/{terminalSessions-CyoMi8Lk.js → terminalSessions-DoRkjVz9.js} +2 -2
  229. package/dist/client/assets/{textarea-U0rH71iw.js → textarea-EVmRNBWL.js} +2 -2
  230. package/dist/client/assets/{themePalette-B5YWcpxp.js → themePalette-01TQqdkx.js} +3 -3
  231. package/dist/client/assets/toast-UFTwkJWj.js +2 -0
  232. package/dist/client/assets/{toggle-CrlljXsx.js → toggle-Dqrwe7LT.js} +2 -2
  233. package/dist/client/assets/{toggle-group-BIVeiRdg.js → toggle-group-DS75Gx6B.js} +2 -2
  234. package/dist/client/assets/{tooltip-CMPhQaPE.js → tooltip-B1rLXiVx.js} +2 -2
  235. package/dist/client/assets/{uiStateStore-C6-jXt5N.js → uiStateStore-_K2mvZYL.js} +2 -2
  236. package/dist/client/assets/{usage-TbP8vhYG.js → usage-DwGF-B0Q.js} +2 -2
  237. package/dist/client/assets/{usageAccess-B68ifs1q.js → usageAccess-YanE4PaX.js} +2 -2
  238. package/dist/client/assets/{usageFormat-5HVN-IRu.js → usageFormat-Bgm6YXnR.js} +2 -2
  239. package/dist/client/assets/{usageShortcuts-cMgT39NO.js → usageShortcuts-D6H92HUx.js} +2 -2
  240. package/dist/client/assets/{use-atom-command-sg76DXcz.js → use-atom-command-BT7sz8Lx.js} +2 -2
  241. package/dist/client/assets/{useAriaLabelledBy-D_ENSt33.js → useAriaLabelledBy-CCDZPAYX.js} +2 -2
  242. package/dist/client/assets/useHandleNewThread-nNF3Xnbt.js +2 -0
  243. package/dist/client/assets/{useLocation-t7z8sUje.js → useLocation-CDlqpnf6.js} +2 -2
  244. package/dist/client/assets/{useNavigate-kfVoxx_T.js → useNavigate-mNhNGdvJ.js} +2 -2
  245. package/dist/client/assets/{useNavigateBack-B79USD1h.js → useNavigateBack-zj9tpAPV.js} +2 -2
  246. package/dist/client/assets/{useP4ConnectAuthPrompt-Caj-XRNA.js → useP4ConnectAuthPrompt-CkJyw_jV.js} +2 -2
  247. package/dist/client/assets/{useParams-DuqJgNNY.js → useParams-CZ_VOC6E.js} +2 -2
  248. package/dist/client/assets/{usePermissionStatus-hWpY6-jP.js → usePermissionStatus-DFE8UnJC.js} +2 -2
  249. package/dist/client/assets/{usePullRequestActions-B6Nj3E46.js → usePullRequestActions-CVcuaade.js} +2 -2
  250. package/dist/client/assets/{useRegisterFieldControl-y1AHmvVZ.js → useRegisterFieldControl-gW7DDA6v.js} +2 -2
  251. package/dist/client/assets/{useScopedModelAvailability-Cb_UE0gJ.js → useScopedModelAvailability-BCNsRHrC.js} +2 -2
  252. package/dist/client/assets/useSettings-BAP_yCCK.js +3 -0
  253. package/dist/client/assets/utils-Dv1DrWoz.js +37 -0
  254. package/dist/client/assets/vcsRefInvalidation-BI3mMuIW.js +2 -0
  255. package/dist/client/assets/welcome-CfpSLEhO.js +2 -0
  256. package/dist/client/index.html +1 -1
  257. package/dist/{renderer-BaYdZX9b.mjs → renderer-B3Ia4LBS.mjs} +2 -2
  258. package/dist/{runtime-xvtWpueC.mjs → runtime-DvE0t3kv.mjs} +137 -84
  259. package/package.json +1 -1
  260. package/dist/client/assets/AlertDialogRoot-zitC_5YS.js +0 -2
  261. package/dist/client/assets/ChatGptUsageButton-LTPdlo27.js +0 -2
  262. package/dist/client/assets/ChatMarkdown-WBYeOz6B.js +0 -48
  263. package/dist/client/assets/CodexSetupSection.logic-7Ae1lVg1.js +0 -2
  264. package/dist/client/assets/DeviceSetup-BgzTguQP.js +0 -2
  265. package/dist/client/assets/DiffPanel-BTNwksR-.js +0 -2
  266. package/dist/client/assets/Input-CTKz2gGc.js +0 -2
  267. package/dist/client/assets/JZOYTAAL-BSyl5qdX.js +0 -1
  268. package/dist/client/assets/PanelLayoutControls-CrSkXhVM.js +0 -216
  269. package/dist/client/assets/PreviewPanel-CsAlP3Pf.js +0 -2
  270. package/dist/client/assets/ProjectFavicon-BhuB_Su5.js +0 -3
  271. package/dist/client/assets/ProviderModelPicker-CHf8PGFh.js +0 -2
  272. package/dist/client/assets/PullRequestCodeTab-CruWTaey.js +0 -6
  273. package/dist/client/assets/SettingsPanels-5CR3ByhH.js +0 -46
  274. package/dist/client/assets/ThreadTerminalDrawer-CW0oM3tO.js +0 -5
  275. package/dist/client/assets/_chat-DLjkfz3i.js +0 -45
  276. package/dist/client/assets/_chat.design-C8CbENny.js +0 -2
  277. package/dist/client/assets/_chat.index-CWE510ct.js +0 -2
  278. package/dist/client/assets/_chat.new-wb1utvr4.js +0 -4
  279. package/dist/client/assets/_chat.pull-requests-D0bA9kLT.js +0 -2
  280. package/dist/client/assets/assets-Dls9s4TR.js +0 -2
  281. package/dist/client/assets/device-UePDkr_L.js +0 -2
  282. package/dist/client/assets/entities-DhRbI2L4.js +0 -2
  283. package/dist/client/assets/keybindings-COfPuZJ9.js +0 -2
  284. package/dist/client/assets/main-1tW7jidE.js +0 -37
  285. package/dist/client/assets/main-BE5xGjw3.css +0 -2
  286. package/dist/client/assets/mediaSource-CI8DI4FI.js +0 -2
  287. package/dist/client/assets/openFileInPreview-CDCQ6rKJ.js +0 -2
  288. package/dist/client/assets/primary-C5Pkih-v.js +0 -2
  289. package/dist/client/assets/primaryCloudLinkState-1Xmc8JzR.js +0 -2
  290. package/dist/client/assets/projectFilesQueryState-D9gKctiS.js +0 -2
  291. package/dist/client/assets/projectScriptEditor-D20MTQIS.js +0 -2
  292. package/dist/client/assets/pullRequests-Dqd6r9gw.js +0 -2
  293. package/dist/client/assets/queries-B6XxcqnT.js +0 -2
  294. package/dist/client/assets/query-yuF2-QRx.js +0 -2
  295. package/dist/client/assets/runtime-Csw1ghUb.js +0 -3
  296. package/dist/client/assets/runtime-DYpzE3gq.js +0 -6
  297. package/dist/client/assets/server-DXSwZxzT.js +0 -2
  298. package/dist/client/assets/session-logic-C42l2TRa.js +0 -26
  299. package/dist/client/assets/session-meZM9Xpf.js +0 -2
  300. package/dist/client/assets/settings-DFDwiVWH.js +0 -2
  301. package/dist/client/assets/settings.archived-Bh4SpQp7.js +0 -2
  302. package/dist/client/assets/settings.connections-BTrzLXQG.js +0 -2
  303. package/dist/client/assets/settings.decisions-DrG6xwiq.js +0 -2
  304. package/dist/client/assets/settings.diagnostics-BK6KmZ6a.js +0 -2
  305. package/dist/client/assets/settings.integrations-D1gZz8sk.js +0 -2
  306. package/dist/client/assets/settings.projects-M8mb50zO.js +0 -4
  307. package/dist/client/assets/settings.providers-CQ0OTnQ1.js +0 -3
  308. package/dist/client/assets/settings.snap-shot-BxcK0LEY.js +0 -2
  309. package/dist/client/assets/settings.source-control-DbAJM2fi.js +0 -2
  310. package/dist/client/assets/settings.storage-BWTGbbAs.js +0 -2
  311. package/dist/client/assets/settingsLayout-D3zsCQTE.js +0 -3
  312. package/dist/client/assets/toast-C1lIuL0v.js +0 -2
  313. package/dist/client/assets/useHandleNewThread-DglymQWA.js +0 -2
  314. package/dist/client/assets/useSettings-CyF6ezIl.js +0 -3
  315. package/dist/client/assets/utils-BlwLA0C4.js +0 -37
  316. package/dist/client/assets/vcsRefInvalidation-Bkr613aV.js +0 -2
  317. package/dist/client/assets/welcome-Dj-C1U_A.js +0 -2
@@ -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{Cf as i,D as a,Df as o,Gf as s,Os as c,Qs as l,Rp as u,Tf as d,Zp as f,Zs as p,as as m,b as h,bm as g,dr as _,fd as v,iE as y,rd as b,ts as x,vm as S}from"./utils-Dv1DrWoz.js";import{O as C,S as w}from"./entities-Cd_YDhEa.js";import{a as T,c as E,o as D,s as O,t as k}from"./select-BFALokxW.js";import{t as A}from"./useNavigate-mNhNGdvJ.js";import{o as j}from"./toast-UFTwkJWj.js";import{n as M}from"./query-B1dBedyO.js";import{u as N}from"./rightPanelStore-C5nnGDev.js";import{t as P}from"./ClippedText-DlUFaCzw.js";import{t as F}from"./env-wK1YYxA8.js";import{t as I}from"./textarea-EVmRNBWL.js";import{t as ee}from"./toggle-Dqrwe7LT.js";import{o as L}from"./sidebar-BDFu5cf2.js";import{a as R,c as z,n as B,o as V}from"./design-LeaOcSZl.js";import{D as H,n as U}from"./useHandleNewThread-nNF3Xnbt.js";import{ii as W}from"./main-om7hc1qE.js";import{t as G}from"./pendingSendStore-C5UcT8R0.js";import{t as K}from"./WorkspacePageHeader-zMZD9Zz8.js";var q=n(),J=e(t(),1),Y=e(r(),1),X=[{label:`Landing page`,icon:u,ask:`a landing page`},{label:`Mobile app`,icon:S,ask:`a mobile app screen`},{label:`Web app`,icon:b,ask:`a web app screen`},{label:`Slides`,icon:f,ask:`a slide deck`},{label:`Dashboard`,icon:o,ask:`a dashboard`},{label:`Something else`,icon:g,ask:``}],Z=12;function Q(e,t){return[e?`Design ${e}.`:null,t.trim(),`Create it as a P4 Design document: read design_guide, then design_apply, validate, and render it for review.`].filter(Boolean).join(` `)}function te(e){let t=(0,q.c)(2),n;return t[0]===e?n=t[1]:(n=m(t=>e.map(e=>{let n=t(B({environmentId:e.environmentId,projectId:e.id})),r=y(c(n));return{project:e,entries:(r?.entries??[]).filter(ne),loading:n.waiting&&!r}})),t[0]=e,t[1]=n),x(n)}function ne(e){return!e.secondary}function re(){let e=(0,q.c)(4),t=A(),n=U(),r=C(),i;return e[0]!==n||e[1]!==t||e[2]!==r?(i=async(e,i)=>{let a=i===null?void 0:r.filter(t=>t.environmentId===e.environmentId&&t.projectId===e.id&&t.archivedAt===null&&t.deletedAt===null&&!t.worktreePath&&t.designs.some(e=>e.path===i)).toSorted(ie)[0],o=e=>{let t=N.getState();i===null?t.open(e,`design`):t.openFile(e,i),t.setMaximized(e,!0)};if(a){let e=l(a.environmentId,a.id);o(e),await t({to:`/$environmentId/$threadId`,params:j(e)});return}let s=await n(p(e.environmentId,e.id),{envMode:`local`,worktreePath:null});s&&o(l(e.environmentId,s.threadId))},e[0]=n,e[1]=t,e[2]=r,e[3]=i):i=e[3],i}function ie(e,t){return t.updatedAt.localeCompare(e.updatedAt)}function ae({projects:e}){let t=U(),[n,r]=(0,J.useState)(null),[o,s]=(0,J.useState)(``),[c,u]=(0,J.useState)(null),[d,f]=(0,J.useState)(!1),m=e=>`${e.environmentId}:${e.id}`,g=e.find(e=>m(e)===c)??e[0]??null,y=X.find(e=>e.label===n)?.ask??``,b=g!==null&&o.trim().length>0&&!d,x=async()=>{if(b&&g!==null){f(!0);try{let e=await t(p(g.environmentId,g.id),{envMode:`local`,worktreePath:null});if(!e)return;a.getState().setPrompt(e.draftId,Q(y,o));let n=l(g.environmentId,e.threadId);N.getState().open(n,`design`),N.getState().setMaximized(n,!0),G.getState().request(h(e.draftId))}finally{f(!1)}}};return(0,Y.jsxs)(`section`,{"aria-label":`Start a design`,className:`flex flex-col items-center gap-4`,children:[(0,Y.jsx)(`div`,{role:`group`,"aria-label":`What are you designing?`,className:`flex flex-wrap justify-center gap-2`,children:X.map(e=>(0,Y.jsxs)(ee,{variant:`outline`,pressed:n===e.label,onPressedChange:t=>r(t?e.label:null),children:[(0,Y.jsx)(e.icon,{"aria-hidden":!0}),e.label]},e.label))}),(0,Y.jsxs)(`form`,{className:`w-full max-w-3xl rounded-2xl border border-border bg-card p-3 shadow-sm focus-within:border-ring`,onSubmit:e=>{e.preventDefault(),x()},children:[(0,Y.jsx)(I,{unstyled:!0,"aria-label":`Describe a design`,placeholder:`Design anything…`,value:o,onChange:e=>s(e.currentTarget.value),onKeyDown:e=>{e.key===`Enter`&&!e.shiftKey&&!e.nativeEvent.isComposing&&(e.preventDefault(),x())},className:`w-full`}),(0,Y.jsxs)(`div`,{className:`mt-2 flex items-center gap-2`,children:[e.length?(0,Y.jsxs)(k,{value:g?m(g):null,onValueChange:e=>e&&u(e),children:[(0,Y.jsxs)(O,{"aria-label":`Save in`,size:`sm`,className:`w-auto max-w-56`,children:[(0,Y.jsx)(i,{"aria-hidden":!0}),(0,Y.jsx)(E,{children:()=>(0,Y.jsx)(`span`,{className:`truncate`,children:g?.title??`Choose project`})})]}),(0,Y.jsx)(D,{children:e.map(e=>(0,Y.jsx)(T,{value:m(e),children:e.title},m(e)))})]}):null,(0,Y.jsx)(`span`,{className:`flex-1`}),(0,Y.jsx)(_,{type:`submit`,size:`icon-sm`,"aria-label":`Start design`,disabled:!b,children:(0,Y.jsx)(v,{"aria-hidden":!0})})]})]}),e.length===0?(0,Y.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Add a project to start designing.`}):null]})}function oe(e){let t=(0,q.c)(23),{recent:n,now:r,onOpen:i}=e,a;t[0]!==n.modifiedAt||t[1]!==n.path||t[2]!==n.project.environmentId||t[3]!==n.project.id?(a=R({environmentId:n.project.environmentId,projectId:n.project.id},n.path,n.modifiedAt),t[0]=n.modifiedAt,t[1]=n.path,t[2]=n.project.environmentId,t[3]=n.project.id,t[4]=a):a=t[4];let o=M(a),c=o.error?null:o.data?.dataUrl??null,l;t[5]!==r||t[6]!==n.modifiedAt?(l=V(n.modifiedAt,r),t[5]=r,t[6]=n.modifiedAt,t[7]=l):l=t[7];let u=l,d;t[8]===c?d=t[9]:(d=(0,Y.jsx)(`span`,{className:`flex aspect-[16/10] w-full items-center justify-center overflow-hidden bg-muted`,children:c?(0,Y.jsx)(`img`,{src:c,alt:``,loading:`lazy`,decoding:`async`,className:`size-full object-contain`}):(0,Y.jsx)(s,{"aria-hidden":!0,className:`size-6 text-muted-foreground`})}),t[8]=c,t[9]=d);let f;t[10]===n.path?f=t[11]:(f=z(n.path),t[10]=n.path,t[11]=f);let p;t[12]===f?p=t[13]:(p=(0,Y.jsx)(`span`,{className:`truncate text-sm font-medium`,children:(0,Y.jsx)(P,{children:f})}),t[12]=f,t[13]=p);let m=u?`${n.project.title} · edited ${u}`:n.project.title,h;t[14]===m?h=t[15]:(h=(0,Y.jsx)(`span`,{className:`truncate text-xs text-muted-foreground`,children:(0,Y.jsx)(P,{children:m})}),t[14]=m,t[15]=h);let g;t[16]!==p||t[17]!==h?(g=(0,Y.jsxs)(`span`,{className:`flex min-w-0 flex-col gap-0.5 border-t border-border px-3 py-2`,children:[p,h]}),t[16]=p,t[17]=h,t[18]=g):g=t[18];let _;return t[19]!==i||t[20]!==d||t[21]!==g?(_=(0,Y.jsx)(`li`,{children:(0,Y.jsxs)(`button`,{type:`button`,onClick:i,className:`group flex w-full cursor-pointer flex-col overflow-hidden rounded-xl border border-border bg-card text-left transition-colors hover:border-ring focus-visible:outline-2 focus-visible:outline-ring`,children:[d,g]})}),t[19]=i,t[20]=d,t[21]=g,t[22]=_):_=t[22],_}function $(){let e=(0,q.c)(44),t=w(),n=C(),r;e[0]!==t||e[1]!==n?(r=H(t,n,`updated_at`),e[0]=t,e[1]=n,e[2]=r):r=e[2];let a=r,o=te(a),s=re(),c;e[3]===Symbol.for(`react.memo_cache_sentinel`)?(c=Date.now(),e[3]=c):c=e[3];let l=c,u,f,p,m,h,g,v,y,b;if(e[4]!==o||e[5]!==s||e[6]!==a){let t=o.flatMap(ue).toSorted(le).slice(0,Z),n;e[16]===o?n=e[17]:(n=new Map(o.map(ce)),e[16]=o,e[17]=n),f=n,u=L,b=`h-dvh min-h-0 overflow-hidden overscroll-y-none`,v=`flex min-h-0 min-w-0 flex-1 flex-col bg-background`,e[18]===Symbol.for(`react.memo_cache_sentinel`)?(y=(0,Y.jsx)(K,{electron:F,className:`border-b border-border`,children:(0,Y.jsx)(`span`,{className:`text-sm font-medium`,children:`P4 Design`})}),e[18]=y):y=e[18],g=`scrollbar-gutter-both min-h-0 flex-1 overflow-y-auto`,p=`mx-auto flex w-full max-w-5xl flex-col gap-12 px-6 py-12`,e[19]===a?m=e[20]:(m=(0,Y.jsx)(ae,{projects:a}),e[19]=a,e[20]=m),h=t.length?(0,Y.jsxs)(`section`,{"aria-labelledby":`design-recents`,className:`flex flex-col gap-3`,children:[(0,Y.jsx)(`h2`,{id:`design-recents`,className:`text-xs font-medium tracking-wide text-muted-foreground uppercase`,children:`Recents`}),(0,Y.jsx)(`ul`,{className:`grid grid-cols-[repeat(auto-fill,minmax(13rem,1fr))] gap-4`,children:t.map(e=>(0,Y.jsx)(oe,{recent:e,now:l,onOpen:()=>void s(e.project,e.path)},`${e.project.environmentId}:${e.project.id}:${e.path}`))})]}):null,e[4]=o,e[5]=s,e[6]=a,e[7]=u,e[8]=f,e[9]=p,e[10]=m,e[11]=h,e[12]=g,e[13]=v,e[14]=y,e[15]=b}else u=e[7],f=e[8],p=e[9],m=e[10],h=e[11],g=e[12],v=e[13],y=e[14],b=e[15];let x,S;e[21]===Symbol.for(`react.memo_cache_sentinel`)?(S=(0,Y.jsx)(`h2`,{id:`design-projects`,className:`text-xs font-medium tracking-wide text-muted-foreground uppercase`,children:`Projects`}),x=(0,Y.jsx)(`span`,{className:`flex-1`}),e[21]=x,e[22]=S):(x=e[21],S=e[22]);let T;e[23]===Symbol.for(`react.memo_cache_sentinel`)?(T=(0,Y.jsxs)(`div`,{className:`flex items-center gap-2`,children:[S,x,(0,Y.jsxs)(_,{size:`sm`,variant:`outline`,onClick:se,children:[(0,Y.jsx)(d,{"aria-hidden":!0}),`Add project`]})]}),e[23]=T):T=e[23];let E;e[24]!==f||e[25]!==s||e[26]!==a?(E=(0,Y.jsxs)(`section`,{"aria-labelledby":`design-projects`,className:`flex flex-col gap-3`,children:[T,a.length?(0,Y.jsx)(`ul`,{className:`overflow-hidden rounded-xl border border-border bg-card`,children:a.map(e=>{let t=f.get(`${e.environmentId}:${e.id}`)??0;return(0,Y.jsx)(`li`,{className:`border-t border-border first:border-t-0`,children:(0,Y.jsxs)(`button`,{type:`button`,onClick:()=>void s(e,null),className:`flex w-full cursor-pointer items-center gap-3 px-4 py-3 text-left transition-colors hover:bg-accent/50 focus-visible:outline-2 focus-visible:outline-ring`,children:[(0,Y.jsx)(i,{"aria-hidden":!0,className:`size-4 shrink-0 text-muted-foreground`}),(0,Y.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col`,children:[(0,Y.jsx)(`span`,{className:`truncate text-sm font-medium`,children:e.title}),(0,Y.jsx)(`span`,{className:`truncate text-xs text-muted-foreground`,children:e.workspaceRoot})]}),(0,Y.jsxs)(`span`,{className:`shrink-0 text-xs text-muted-foreground`,children:[t,` `,t===1?`design`:`designs`]})]})},`${e.environmentId}:${e.id}`)})}):(0,Y.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Add a project, usually a repo, so agents can design with its code.`})]}),e[24]=f,e[25]=s,e[26]=a,e[27]=E):E=e[27];let D;e[28]!==E||e[29]!==p||e[30]!==m||e[31]!==h?(D=(0,Y.jsxs)(`div`,{className:p,children:[m,h,E]}),e[28]=E,e[29]=p,e[30]=m,e[31]=h,e[32]=D):D=e[32];let O;e[33]!==D||e[34]!==g?(O=(0,Y.jsx)(`main`,{className:g,children:D}),e[33]=D,e[34]=g,e[35]=O):O=e[35];let k;e[36]!==O||e[37]!==v||e[38]!==y?(k=(0,Y.jsxs)(`div`,{className:v,children:[y,O]}),e[36]=O,e[37]=v,e[38]=y,e[39]=k):k=e[39];let A;return e[40]!==u||e[41]!==k||e[42]!==b?(A=(0,Y.jsx)(u,{className:b,children:k}),e[40]=u,e[41]=k,e[42]=b,e[43]=A):A=e[43],A}function se(){return W({open:`add-project`})}function ce(e){let{project:t,entries:n}=e;return[`${t.environmentId}:${t.id}`,n.length]}function le(e,t){return t.modifiedAt.localeCompare(e.modifiedAt)}function ue(e){let{project:t,entries:n}=e;return n.flatMap(e=>e.modifiedAt?[{project:t,path:e.path,modifiedAt:e.modifiedAt,pageCount:e.pageCount??null}]:[])}var de=$;export{de as component};
2
+ //# sourceMappingURL=_chat.design-CajRPBez.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{$f as i,Yp as a,Zs as o,dr as s}from"./utils-Dv1DrWoz.js";import{o as c,w as l}from"./runtime-B6yGAVz4.js";import{O as u,S as d,g as f,l as p}from"./entities-Cd_YDhEa.js";import{N as m}from"./runtime-BhGr1QCf.js";import{t as h}from"./link-ci_EPfAz.js";import{a as g}from"./useParams-CZ_VOC6E.js";import{T as _}from"./useSettings-BAP_yCCK.js";import{t as v}from"./env-wK1YYxA8.js";import{o as y}from"./sidebar-BDFu5cf2.js";import{i as b,o as x,r as S,t as C}from"./empty-B1FuCXoG.js";import{D as w,n as T}from"./useHandleNewThread-nNF3Xnbt.js";import{a as E,bo as D}from"./main-om7hc1qE.js";import{t as O}from"./WorkspacePageHeader-zMZD9Zz8.js";import{t as k}from"./NoProjectsHero-BaAbresy.js";var A=n(),j=e(t()),M=e(r());function N(){let e=(0,A.c)(2),{authGateState:t}=E.useRouteContext(),{environments:n,isReady:r}=_();if(t.status===`hosted-static`){if(!r)return null;if(n.length===0){let t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,M.jsx)(z,{}),e[0]=t):t=e[0],t}}let i;return e[1]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,M.jsx)(P,{}),e[1]=i):i=e[1],i}function P(){let e=(0,A.c)(18),t=d(),n=u(),r=f(),i=T(),a=g(),s;e[0]===a.state.location.pathname?s=e[1]:(s=()=>a.state.location.pathname===`/`,e[0]=a.state.location.pathname,e[1]=s);let c=(0,j.useEffectEvent)(s),l=(0,j.useRef)(!1),m;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(m={failed:!1,retryRequest:0},e[2]=m):m=e[2];let[h,_]=(0,j.useState)(m),v;e[3]!==r||e[4]!==t||e[5]!==n?(v=r?w(t,n,`updated_at`)[0]??null:null,e[3]=r,e[4]=t,e[5]=n,e[6]=v):v=e[6];let y=v,b;e[7]!==i||e[8]!==c||e[9]!==y?(b=()=>{if(y===null||l.current||!c())return;let e=o(y.environmentId,y.id);p(e)!==null&&(l.current=!0,i(e,{replace:!0}).then(e=>{e===null&&(l.current=!1,_(L))}).catch(()=>{l.current=!1,_(I)}))},e[7]=i,e[8]=c,e[9]=y,e[10]=b):b=e[10];let x;if(e[11]!==i||e[12]!==y||e[13]!==h.retryRequest?(x=[i,y,h.retryRequest],e[11]=i,e[12]=y,e[13]=h.retryRequest,e[14]=x):x=e[14],(0,j.useEffect)(b,x),!r)return null;if(y!==null){let t;return e[15]===h.failed?t=e[16]:(t=h.failed?(0,M.jsx)(R,{onRetry:()=>{_(F)}}):null,e[15]=h.failed,e[16]=t),t}let S;return e[17]===Symbol.for(`react.memo_cache_sentinel`)?(S=(0,M.jsx)(k,{}),e[17]=S):S=e[17],S}function F(e){return{failed:!1,retryRequest:e.retryRequest+1}}function I(e){return{...e,failed:!0}}function L(e){return{...e,retryRequest:e.retryRequest+1}}function R(e){let t=(0,A.c)(6),{onRetry:n}=e,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=v?(0,M.jsx)(O,{electron:!0}):null,t[0]=r):r=t[0];let i,a;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,M.jsx)(x,{children:`Couldn’t start a new thread`}),a=(0,M.jsx)(S,{children:`The project is still available. Try opening the draft again.`}),t[1]=i,t[2]=a):(i=t[1],a=t[2]);let o;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,M.jsx)(D,{size:`md`}),t[3]=o):o=t[3];let c;return t[4]===n?c=t[5]:(c=(0,M.jsxs)(y,{className:`h-dvh min-h-0 overflow-hidden overscroll-y-none`,children:[r,(0,M.jsx)(C,{className:`flex-1`,children:(0,M.jsxs)(b,{className:`max-w-md`,children:[i,a,(0,M.jsx)(`div`,{className:`mt-5 flex justify-center`,children:(0,M.jsxs)(s,{size:`sm`,onClick:n,children:[o,`Try again`]})})]})})]}),t[4]=n,t[5]=c),c}function z(){let e=(0,A.c)(7),t=c(),n=l()?`The local environment is turned off. Connect a remote environment, or turn the local environment back on in Connections.`:t?`Enable P4 Connect on that machine, then open Connections here to sign in with the same account. You can also add the machine using a pairing link.`:`Open Connections and add that machine using its pairing link. This app must be able to reach it.`,r;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,M.jsx)(O,{electron:v,className:`border-b border-border`,children:(0,M.jsx)(`div`,{className:`flex items-center gap-2`,children:(0,M.jsx)(`span`,{className:`text-sm font-medium text-foreground md:text-muted-foreground/60`,children:m})})}),e[0]=r):r=e[0];let o,u,d,f;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,M.jsx)(`div`,{className:`mx-auto mb-5 flex size-11 items-center justify-center rounded-xl border border-border/70 bg-background/70 text-muted-foreground`,children:(0,M.jsx)(i,{className:`size-5`})}),u=(0,M.jsx)(x,{children:`Connect to a computer running P4 Code`}),d=(0,M.jsx)(S,{children:`This app connects to P4 Code running on your computer or a server. Start the P4 Code desktop app or command-line server on that machine and keep it running.`}),f=(0,M.jsx)(S,{children:n}),e[1]=o,e[2]=u,e[3]=d,e[4]=f):(o=e[1],u=e[2],d=e[3],f=e[4]);let p;e[5]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,M.jsx)(h,{to:`/settings/connections`}),e[5]=p):p=e[5];let g;return e[6]===Symbol.for(`react.memo_cache_sentinel`)?(g=(0,M.jsx)(y,{className:`h-dvh min-h-0 overflow-hidden overscroll-y-none`,children:(0,M.jsxs)(`div`,{className:`flex min-h-0 min-w-0 flex-1 flex-col overflow-x-hidden bg-background`,children:[r,(0,M.jsx)(C,{className:`flex-1`,children:(0,M.jsx)(`div`,{className:`w-full max-w-xl rounded-3xl border border-border/55 bg-card/20 px-8 py-12 shadow-sm/5`,children:(0,M.jsxs)(b,{className:`max-w-none`,children:[o,u,d,f,(0,M.jsx)(`div`,{className:`mt-6 flex justify-center`,children:(0,M.jsxs)(s,{render:p,size:`sm`,children:[(0,M.jsx)(a,{className:`size-4`}),`Open Connections`]})})]})})})]})}),e[6]=g):g=e[6],g}export{N as component};
2
+ //# sourceMappingURL=_chat.index-OsM078CN.js.map
@@ -0,0 +1,4 @@
1
+ import{a as e,t}from"./react-BUfh6y28.js";import{n,t as r}from"./jsx-runtime-DJeoFXNw.js";import{D as i,D_ as a,Qs as o,Zs as s,dr as c,o as l,qs as u,ts as d}from"./utils-Dv1DrWoz.js";import{R as f,W as p}from"./runtime-B6yGAVz4.js";import{M as m,O as h,S as ee,W as te}from"./entities-Cd_YDhEa.js";import{_n as g,gn as _,pn as v}from"./runtime-BhGr1QCf.js";import{t as y}from"./useNavigate-mNhNGdvJ.js";import{t as b}from"./useLocation-CDlqpnf6.js";import{i as x}from"./toast-UFTwkJWj.js";import{D as S,T as ne}from"./useSettings-BAP_yCCK.js";import{t as re}from"./use-atom-command-BT7sz8Lx.js";import{t as ie}from"./toastHelpers-DxXYm50b.js";import{t as C}from"./env-wK1YYxA8.js";import{o as w}from"./sidebar-BDFu5cf2.js";import{i as T,o as E,r as D,t as O}from"./empty-B1FuCXoG.js";import{t as ae}from"./sourceControl-DjMIOzv1.js";import{D as oe,n as se}from"./useHandleNewThread-nNF3Xnbt.js";import{$n as ce,Rn as le,Yn as k,qn as A}from"./main-om7hc1qE.js";import{t as j}from"./WorkspacePageHeader-zMZD9Zz8.js";import{i as M}from"./usePullRequestActions-CVcuaade.js";import{n as N,t as ue}from"./linkedPrompt-CPHt2jcO.js";var P=n(),F=e=>`github.com/${e.owner}/${e.name}`.toLowerCase();function de(e,t){let n=F(t);return e.find(e=>e.repositoryIdentity!=null&&a(e.repositoryIdentity).toLowerCase()===n)}function fe(e,t){let n=v({host:`github.com`,repository:`${t.owner}/${t.name}`,number:t.number}),r;for(let t of e)r!==void 0&&t.updatedAt<=r.updatedAt||g(_(t)).some(e=>v(e)===n)&&(r=t);return r}var I={claude:`claudeagent`};function pe(e,t){let n=I[t.provider]??t.provider,r=e.filter(e=>e.driver.toLowerCase()===n&&e.enabled&&e.availability!==`unavailable`),i=r.find(e=>e.status===`ready`)??r.find(e=>e.status===`warning`);if(i===void 0)return null;let a=t.model===null?null:u(i.driver,t.model,i.models),o=a??(i.models.find(e=>e.isDefault)??i.models[0])?.slug;return o===void 0?null:{selection:{instanceId:i.instanceId,model:o},exact:t.model===null||a!==null}}var L=e(t(),1),R=e(r(),1),z=new Set;function B(e){let t=(0,P.c)(62),{link:n}=e,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r={select:_e},t[0]=r):r=t[0];let a=b(r),u=y(),g=d(te),_=ee(),v=h(),{environments:C}=ne(),w=S(),T=se(),{scratchEnvironmentId:E,openScratchProject:D}=le(),O;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(O={reportFailure:!1},t[1]=O):O=t[1];let A=re(ae.startProjectClone,O),j;t[2]===a?j=t[3]:(j=()=>z.has(a)?{status:`opened`}:{status:`opening`},t[2]=a,t[3]=j);let[M,N]=(0,L.useState)(j),F=(0,L.useRef)(!1),I;t[4]!==_||t[5]!==v?(I=()=>oe(_.filter(ge),v,`updated_at`),t[4]=_,t[5]=v,t[6]=I):I=t[6];let B=I,H;t[7]!==w||t[8]!==v?(H=()=>{let e;for(let t of v)(e===void 0||t.updatedAt>e.updatedAt)&&(e=t);return e?.environmentId??w},t[7]=w,t[8]=v,t[9]=H):H=t[9];let U=H,W;t[10]!==C||t[11]!==T||t[12]!==n?(W=async(e,t)=>{let r=await T(s(e.environmentId,e.id),{replace:!0}).catch(he);if(r===null){N({status:`failed`,message:`P4 Code could not open a new thread.`});return}N({status:`opened`});let a=[];if(n.kind===`new`&&n.provider!==null){let t=pe(C.find(t=>t.environmentId===e.environmentId)?.serverConfig?.providers??[],{provider:n.provider,model:n.model});t!==null&&i.getState().setModelSelection(r.draftId,t.selection,{explicit:!0,replaceOptions:!0}),t!==null&&t.exact||a.push(t===null?`The link asked for ${n.provider}, which is not set up here, so your default model is used.`:`The link asked for ${n.model}, which ${n.provider} does not offer here, so its default model is used.`)}let o=[n.prompt?.text,t].filter(Boolean).join(`
2
+
3
+ `);o.length!==0&&ue(r.draftId,{text:o,hiddenCharacters:n.prompt?.hiddenCharacters??0},a)},t[10]=C,t[11]=T,t[12]=n,t[13]=W):W=t[13];let G=W,K;t[14]!==U||t[15]!==n||t[16]!==G||t[17]!==D||t[18]!==E?(K=async()=>{N({status:`opening`});let e=E(U())??E(null),t=e===null?null:await D(e);t===null?N({status:`failed`,message:`None of your machines can start a thread without a project right now.`}):await G(t,n.kind===`pull-request`?k(n.pullRequest):void 0)},t[14]=U,t[15]=n,t[16]=G,t[17]=D,t[18]=E,t[19]=K):K=t[19];let q=K,J;t[20]!==C||t[21]!==U||t[22]!==n||t[23]!==G||t[24]!==A?(J=async e=>{let t=U(),r=C.find(e=>e.environmentId===t),i=r?.serverConfig?.newProjectsRoot??null;if(t===null||i===null||r?.serverConfig?.environment.capabilities.projectCloneTracking!==!0){N({status:`failed`,message:`This machine cannot clone from a link. Update P4 Code on it, or clone the repository from the command palette.`});return}N({status:`opening`});let a=l(),o=await A({environmentId:t,input:{projectId:a,title:e.name,createdAt:new Date().toISOString(),remoteUrl:`https://github.com/${e.owner}/${e.name}.git`,destinationPath:ce(i,e.name)}});if(o._tag===`Failure`){if(!f(o)){let e=p(o);x.add(ie({type:`error`,title:`Clone failed`,description:e instanceof Error?e.message:`An error occurred.`}))}N({status:`missing-repository`,repository:e});return}let c=await m(s(t,a),5e3).catch(me);c===null?N({status:`failed`,message:`The clone started, but its project did not appear.`}):n.kind===`pull-request`?N({status:`failed`,title:`Cloning ${e.owner}/${e.name}`,message:`Open this link again when the clone finishes.`}):await G(c)},t[20]=C,t[21]=U,t[22]=n,t[23]=G,t[24]=A,t[25]=J):J=t[25];let Y=J,X;t[26]!==n||t[27]!==a||t[28]!==u||t[29]!==G||t[30]!==q||t[31]!==B||t[32]!==v?(X=()=>{if(F.current)return;if(F.current=!0,z.add(a),n.kind===`pull-request`){let e=fe(v,n.pullRequest);if(e!==void 0){N({status:`opened`});let t=o(e.environmentId,e.id);n.prompt!==null&&ue(t,n.prompt),u({to:`/$environmentId/$threadId`,params:{environmentId:e.environmentId,threadId:e.id},replace:!0});return}}let e=n.kind===`new`?n.repository:n.pullRequest;if(e===null){q();return}let t=de(B(),e);t===void 0?N({status:`missing-repository`,repository:e}):n.kind===`pull-request`?N({status:`pull-request-checkout`,project:t}):G(t)},t[26]=n,t[27]=a,t[28]=u,t[29]=G,t[30]=q,t[31]=B,t[32]=v,t[33]=X):X=t[33];let Z=(0,L.useEffectEvent)(X),Q;t[34]!==g||t[35]!==Z||t[36]!==M.status?(Q=()=>{g&&M.status===`opening`&&Z()},t[34]=g,t[35]=Z,t[36]=M.status,t[37]=Q):Q=t[37];let $;switch(t[38]!==g||t[39]!==M.status?($=[g,M.status],t[38]=g,t[39]=M.status,t[40]=$):$=t[40],(0,L.useEffect)(Q,$),M.status){case`opening`:{let e;return t[41]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,R.jsx)(V,{title:`Opening the link...`}),t[41]=e):e=t[41],e}case`opened`:{let e;return t[42]===a?e=t[43]:(e=(0,R.jsx)(V,{title:`This link is open`,children:(0,R.jsx)(c,{size:`sm`,variant:`outline`,onClick:()=>{z.delete(a),F.current=!1,N({status:`opening`})},children:`Open it again`})}),t[42]=a,t[43]=e),e}case`failed`:{let e=M.title??`Could not open the link`,n;return t[44]!==M.message||t[45]!==e?(n=(0,R.jsx)(V,{title:e,description:M.message}),t[44]=M.message,t[45]=e,t[46]=n):n=t[46],n}case`missing-repository`:{let e=`${M.repository.owner}/${M.repository.name}`,n=`You don't have ${e}`,r;t[47]!==Y||t[48]!==M.repository?(r=()=>void Y(M.repository),t[47]=Y,t[48]=M.repository,t[49]=r):r=t[49];let i;t[50]!==e||t[51]!==r?(i=(0,R.jsxs)(c,{size:`sm`,onClick:r,children:[`Clone `,e]}),t[50]=e,t[51]=r,t[52]=i):i=t[52];let a;t[53]===q?a=t[54]:(a=(0,R.jsx)(c,{size:`sm`,variant:`outline`,onClick:()=>void q(),children:`Use without project`}),t[53]=q,t[54]=a);let o;return t[55]!==n||t[56]!==i||t[57]!==a?(o=(0,R.jsxs)(V,{title:n,description:`Clone it to work on it here, or start without a project.`,children:[i,a]}),t[55]=n,t[56]=i,t[57]=a,t[58]=o):o=t[58],o}case`pull-request-checkout`:{let e;return t[59]!==n||t[60]!==M.project?(e=n.kind===`pull-request`?(0,R.jsx)(ve,{link:n,project:M.project}):null,t[59]=n,t[60]=M.project,t[61]=e):e=t[61],e}}}function me(){return null}function he(){return null}function ge(e){return e.isScratch!==!0}function _e(e){return e.state.__TSR_key??``}function ve(e){let t=(0,P.c)(22),{link:n,project:r}=e,i=r.environmentId,a=r.id,o=r.workspaceRoot,s;t[0]===n.pullRequest?s=t[1]:(s=k(n.pullRequest),t[0]=n.pullRequest,t[1]=s);let l;t[2]!==r.id||t[3]!==r.workspaceRoot||t[4]!==s?(l={projectId:a,workspaceRoot:o,url:s},t[2]=r.id,t[3]=r.workspaceRoot,t[4]=s,t[5]=l):l=t[5];let u;t[6]!==r.environmentId||t[7]!==l?(u={environmentId:i,detail:l},t[6]=r.environmentId,t[7]=l,t[8]=u):u=t[8];let{handoff:d,startHandoff:f}=M(u),p=(0,L.useRef)(!1),m,h;t[9]===n.prompt?(m=t[10],h=t[11]):(m=()=>{p.current||n.prompt===null||(p.current=!0,N(n.prompt))},h=[n.prompt],t[9]=n.prompt,t[10]=m,t[11]=h),(0,L.useEffect)(m,h);let{owner:ee,name:te,number:g}=n.pullRequest,_=`Check out ${ee}/${te}#${g}?`,v=d!==null,y;t[12]!==n.prompt||t[13]!==f?(y=()=>void f(`prompt-link`,n.prompt===null?null:{prompt:n.prompt.text}),t[12]=n.prompt,t[13]=f,t[14]=y):y=t[14];let b=d===null?`Check out`:`Checking out...`,x;t[15]!==v||t[16]!==y||t[17]!==b?(x=(0,R.jsx)(c,{size:`sm`,disabled:v,onClick:y,children:b}),t[15]=v,t[16]=y,t[17]=b,t[18]=x):x=t[18];let S;return t[19]!==x||t[20]!==_?(S=(0,R.jsx)(V,{title:_,description:`This puts the pull request's code in a new worktree and runs your project's setup script on it.`,children:x}),t[19]=x,t[20]=_,t[21]=S):S=t[21],S}function V(e){let t=(0,P.c)(11),{title:n,description:r,children:i}=e,a;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=C?(0,R.jsx)(j,{electron:!0}):null,t[0]=a):a=t[0];let o;t[1]===n?o=t[2]:(o=(0,R.jsx)(E,{children:n}),t[1]=n,t[2]=o);let s;t[3]===r?s=t[4]:(s=r?(0,R.jsx)(D,{children:r}):null,t[3]=r,t[4]=s);let c;t[5]===i?c=t[6]:(c=i?(0,R.jsx)(`div`,{className:`mt-5 flex justify-center gap-2`,children:i}):null,t[5]=i,t[6]=c);let l;return t[7]!==o||t[8]!==s||t[9]!==c?(l=(0,R.jsxs)(w,{className:`h-dvh min-h-0 overflow-hidden overscroll-y-none`,children:[a,(0,R.jsx)(O,{className:`flex-1`,children:(0,R.jsxs)(T,{className:`max-w-md`,children:[o,s,c]})})]}),t[7]=o,t[8]=s,t[9]=c,t[10]=l):l=t[10],l}function H(){let e=(0,P.c)(9),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t={select:U},e[0]=t):t=e[0];let n=b(t),r;e[1]===n?r=e[2]:(r=A(n),e[1]=n,e[2]=r);let i=r;if(!i.ok){let t;e[3]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,R.jsx)(E,{children:`Could not open the link`}),e[3]=t):t=e[3];let n;return e[4]===i.error?n=e[5]:(n=(0,R.jsx)(w,{className:`h-dvh min-h-0 overflow-hidden overscroll-y-none`,children:(0,R.jsx)(O,{className:`flex-1`,children:(0,R.jsxs)(T,{className:`max-w-md`,children:[t,(0,R.jsx)(D,{children:i.error})]})})}),e[4]=i.error,e[5]=n),n}let a;return e[6]!==i.value||e[7]!==n?(a=(0,R.jsx)(B,{link:i.value},n),e[6]=i.value,e[7]=n,e[8]=a):a=e[8],a}function U(e){return e.searchStr}export{H as component};
4
+ //# sourceMappingURL=_chat.new-BI8wuTGQ.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{$n as i,Ad as a,Bd as o,Bp as s,Ol as c,Qn as l,Ud as u,Wd as d,Xf as f,Xn as p,Ym as m,Yn as h,Yp as g,Zm as _,Zn as v,ar as y,bn as b,cf as x,cr as S,dr as C,ir as w,km as T,lm as E,lr as D,nr as O,od as k,qp as ee,rr as A,sf as j,sr as M,t as te,tp as N,tr as ne,ts as re,ur as P,vg as F,xf as I,zd as L}from"./utils-Dv1DrWoz.js";import{O as R,S as z,g as ie}from"./entities-Cd_YDhEa.js";import{t as B}from"./spinner-t32AzjJr.js";import{t as V}from"./useNavigate-mNhNGdvJ.js";import{t as ae}from"./useNavigateBack-zj9tpAPV.js";import{i as H,m as oe}from"./toast-UFTwkJWj.js";import{C as se,D as ce,T as le,s as U}from"./useSettings-BAP_yCCK.js";import{s as ue}from"./server-Dc9414wM.js";import{t as de}from"./use-atom-command-BT7sz8Lx.js";import{l as fe,o as pe,r as me,s as he,t as ge,u as W}from"./rightPanelStore-C5nnGDev.js";import{r as _e}from"./queries-DMkaYL1H.js";import{C as G,S as ve,_ as ye,a as be,b as xe,c as Se,d as Ce,f as we,h as Te,i as K,l as q,m as Ee,n as De,o as Oe,p as ke,r as Ae,t as je,u as Me,w as Ne,x as Pe,y as Fe}from"./PanelLayoutControls-CwJW9Vo-.js";import{t as Ie}from"./env-wK1YYxA8.js";import{a as Le,n as Re,t as ze}from"./tooltip-B1rLXiVx.js";import{o as Be}from"./sidebar-BDFu5cf2.js";import{i as Ve,n as He,o as Ue,r as We,t as Ge}from"./empty-B1FuCXoG.js";import{_ as Ke,y as qe}from"./keybindings-DMghyE3A.js";import{a as Je,f as Ye,u as J}from"./RenderErrorBoundary-UQ8iqwRx.js";import{n as Xe}from"./sourceControlClients-C2uvUFSM.js";import{n as Ze}from"./pullRequestIcons-Bk_-BZhA.js";import{A as Qe,B as $e,C as et,D as tt,E as nt,F as rt,H as it,I as at,L as ot,M as st,N as ct,O as lt,P as ut,R as dt,S as ft,T as pt,U as mt,V as ht,_ as gt,b as _t,d as vt,f as yt,g as bt,h as xt,j as St,l as Ct,m as wt,o as Tt,p as Et,r as Dt,s as Ot,v as kt,w as At,x as jt,y as Mt,z as Nt}from"./pullRequests-C9YbqDXl.js";import{t as Pt}from"./ProjectFavicon-Bnd4lTxL.js";import{n as Ft,r as It,t as Lt}from"./input-group-CevCumL6.js";import{O as Y,b as Rt,h as zt}from"./useHandleNewThread-nNF3Xnbt.js";import{d as X,f as Bt,p as Vt}from"./p4ProjectFile-BC2tSEs4.js";import{r as Ht,t as Ut}from"./uiStateStore-_K2mvZYL.js";import{a as Wt,d as Gt,l as Kt,o as qt,p as Jt}from"./guideRunStore-CugTzRRn.js";import{r as Yt}from"./sidebarProjectGrouping-CURnoavN.js";import{r as Xt}from"./EnvironmentMachineIcon-CKfntUmE.js";import{t as Zt}from"./WorkspacePageContainer-BKXvWv-9.js";import{Fi as Qt,Pi as $t,bo as en,ei as tn,ii as nn,n as rn,ri as an,t as on,ti as sn,wn as cn}from"./main-om7hc1qE.js";import{t as ln}from"./WorkspacePageHeader-zMZD9Zz8.js";import{n as un}from"./usePullRequestActions-CVcuaade.js";import{n as dn,r as fn,t as pn}from"./WorkspaceBreadcrumb-D8GTBuA5.js";var Z=n(),mn=class{props;static activators=[{eventName:`onPointerDown`,handler:({nativeEvent:e})=>e.isPrimary&&e.button===0}];autoScrollEnabled=!0;phase=`pending`;pointer;document;window;constructor(e){this.props=e,this.pointer=e.event,this.document=$t(this.pointer.target),this.window=Qt(this.pointer.target),this.document.addEventListener(`pointermove`,this.move,{passive:!1,capture:!0}),this.document.addEventListener(`pointerup`,this.end,{capture:!0}),this.document.addEventListener(`pointercancel`,this.pointerCancel,{capture:!0}),this.document.addEventListener(`keydown`,this.keydown,{capture:!0}),this.document.addEventListener(`visibilitychange`,this.visibilityChange),this.window.addEventListener(`blur`,this.cancel),this.window.addEventListener(`pagehide`,this.cancel),this.window.addEventListener(`resize`,this.cancel),this.document.addEventListener(`dragstart`,this.preventDefault),this.document.addEventListener(`contextmenu`,this.preventDefault),e.options.onAttach(this),e.onPending(e.active,{distance:e.options.distance},this.coordinates())}coordinates=()=>({x:this.pointer.clientX,y:this.pointer.clientY});preventDefault=e=>e.preventDefault();clearClickSuppression=()=>{this.document.removeEventListener(`click`,this.suppressClick,{capture:!0}),this.document.removeEventListener(`pointerdown`,this.clearClickSuppression,{capture:!0})};suppressClick=e=>{e.stopPropagation(),this.clearClickSuppression()};clearSelection=()=>this.document.getSelection()?.removeAllRanges();move=e=>{if(this.phase===`finished`||e.pointerId!==this.pointer.pointerId)return;let t={x:e.clientX,y:e.clientY};if(!(e.buttons&1))return this.phase===`dragging`&&this.props.options.onDrop?.(t),this.cancel();if(this.phase===`pending`){let t={x:e.clientX-this.pointer.clientX,y:e.clientY-this.pointer.clientY};if(Math.hypot(t.x,t.y)<=this.props.options.distance){this.props.onPending(this.props.active,{distance:this.props.options.distance},this.coordinates(),t);return}this.phase=`dragging`,this.document.addEventListener(`click`,this.suppressClick,{capture:!0}),this.document.addEventListener(`selectionchange`,this.clearSelection),this.clearSelection(),this.props.onStart(this.coordinates())}if(this.phase===`dragging`){if(e.cancelable&&e.preventDefault(),this.props.options.onMove?.(t)===!0)return;this.props.onMove(t)}};end=e=>{if(e.pointerId!==this.pointer.pointerId)return;let t=this.phase===`dragging`&&this.props.options.onDrop?.({x:e.clientX,y:e.clientY})===!0;this.finish(t)};pointerCancel=e=>{e.pointerId===this.pointer.pointerId&&this.cancel()};keydown=e=>{e.code===`Escape`&&this.cancel()};visibilityChange=()=>{this.document.hidden&&this.cancel()};cancel=()=>this.finish(!0);finish(e){if(this.phase===`finished`)return;let t=this.phase===`pending`;this.phase=`finished`,this.document.removeEventListener(`pointermove`,this.move,{capture:!0}),this.document.removeEventListener(`pointerup`,this.end,{capture:!0}),this.document.removeEventListener(`pointercancel`,this.pointerCancel,{capture:!0}),this.document.removeEventListener(`keydown`,this.keydown,{capture:!0}),this.document.removeEventListener(`visibilitychange`,this.visibilityChange),this.window.removeEventListener(`blur`,this.cancel),this.window.removeEventListener(`pagehide`,this.cancel),this.window.removeEventListener(`resize`,this.cancel),this.document.removeEventListener(`dragstart`,this.preventDefault),this.document.removeEventListener(`contextmenu`,this.preventDefault),this.document.removeEventListener(`selectionchange`,this.clearSelection),(!t||e)&&(this.document.addEventListener(`click`,this.suppressClick,{capture:!0}),this.document.addEventListener(`pointerdown`,this.clearClickSuppression,{capture:!0}));try{this.props.options.onFinish(!t)}finally{t&&this.props.onAbort(this.props.active),e?this.props.onCancel():this.props.onEnd()}}},Q=e(t(),1);function hn(e,t){let n=new Map;for(let t of e)n.set(t.title,(n.get(t.title)??0)+1);return e.map(e=>(n.get(e.title)??0)>1?{...e,title:`${e.title} · ${t(e)}`}:e)}function gn(e,t,n){let r=new Map;for(let t of e){let e=t.repositoryIdentity?.canonicalKey?.toLowerCase(),i=JSON.stringify([t.environmentId,e?[`repository`,e]:[`project`,t.id]]),a=t.id===n?.id&&t.environmentId===n.environmentId;(!r.has(i)||a)&&r.set(i,t)}return hn(hn(hn(hn([...r.values()],e=>t.get(e.environmentId)??e.environmentId),e=>e.workspaceRoot),e=>e.environmentId),e=>e.id).toSorted((e,t)=>e.title.localeCompare(t.title))}var $=e(r(),1);function _n(e){let t=(0,Z.c)(3),{option:n}=e,r;return t[0]!==n.Icon||t[1]!==n.project?(r=n.project?(0,$.jsx)(Pt,{project:n.project,className:`size-3.5`}):(0,$.jsx)(n.Icon,{"aria-hidden":!0,className:`size-3.5`}),t[0]=n.Icon,t[1]=n.project,t[2]=r):r=t[2],r}function vn(e,t){return e.filter(e=>e.kind===t.kind).length>1?t.host:cn(t.kind).providerName}function yn(e){let t=(0,Z.c)(14),{value:n,busy:r,onChange:i}=e,[a,o]=(0,Q.useState)(null),s;t[0]===r?s=t[1]:(s=(0,$.jsx)(Ft,{children:r?(0,$.jsx)(B,{"aria-hidden":!0}):(0,$.jsx)(E,{"aria-hidden":!0})}),t[0]=r,t[1]=s);let c=a??n,l;t[2]===n?l=t[3]:(l=()=>o(n),t[2]=n,t[3]=l);let u;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(u=()=>o(null),t[4]=u):u=t[4];let d;t[5]===i?d=t[6]:(d=e=>{o(e.currentTarget.value),i(e.currentTarget.value)},t[5]=i,t[6]=d);let f;t[7]!==c||t[8]!==l||t[9]!==d?(f=(0,$.jsx)(It,{type:`search`,value:c,onFocus:l,onBlur:u,onChange:d,placeholder:`Search pull requests, or label:bug`,"aria-label":`Search pull requests`}),t[7]=c,t[8]=l,t[9]=d,t[10]=f):f=t[10];let p;return t[11]!==s||t[12]!==f?(p=(0,$.jsxs)(Lt,{className:`min-w-0 flex-1 **:[input]:h-9 sm:**:[input]:h-8`,children:[s,f]}),t[11]=s,t[12]=f,t[13]=p):p=t[13],p}var bn=`all`,xn=``,Sn=``,Cn=`all`,wn=e=>JSON.stringify([e.environmentId,e.id]),Tn=[{value:Cn,label:`All`,Icon:f},{value:`only`,label:`Drafts only`,Icon:Ze.draft},{value:`hide`,label:`Hide drafts`,Icon:x}],En=[{value:Cn,label:`All`,Icon:f},{value:`approved`,label:`Approved`,Icon:L},{value:`changes-requested`,label:`Changes requested`,Icon:d},{value:`review-required`,label:`Review required`,Icon:o},{value:`none`,label:`No reviews`,Icon:u}],Dn=[{value:Cn,label:`All`,Icon:f},{value:`passing`,label:`Passing`,Icon:L},{value:`failing`,label:`Failing`,Icon:d}];function On(e){let t=(0,Z.c)(12),{label:n,value:r,options:i,onChange:a}=e,o;t[0]!==a||t[1]!==r?(o=e=>{e!==r&&a(e)},t[0]=a,t[1]=r,t[2]=o):o=t[2];let s;t[3]===n?s=t[4]:(s=(0,$.jsx)(l,{children:n}),t[3]=n,t[4]=s);let c;t[5]===i?c=t[6]:(c=i.map(kn),t[5]=i,t[6]=c);let u;return t[7]!==o||t[8]!==s||t[9]!==c||t[10]!==r?(u=(0,$.jsxs)(O,{value:r,onValueChange:o,children:[s,c]}),t[7]=o,t[8]=s,t[9]=c,t[10]=r,t[11]=u):u=t[11],u}function kn(e){let t=(0,$.jsx)(A,{value:e.value,className:e.unavailable?`data-disabled:pointer-events-auto`:void 0,disabled:e.unavailable!==void 0,children:(0,$.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[(0,$.jsx)(_n,{option:e}),(0,$.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:e.label}),e.unavailable?(0,$.jsx)(`span`,{className:`shrink-0`,children:`· Unavailable`}):null,(0,$.jsx)(w,{})]})},e.value);return e.unavailable?(0,$.jsxs)(ze,{children:[(0,$.jsx)(Le,{render:t}),(0,$.jsx)(Re,{side:`top`,children:e.unavailable})]},e.value):t}function An(e){let t=(0,Z.c)(21),{label:n,value:r,options:i,onChange:a}=e,o;t[0]!==i||t[1]!==r?(o=i.find(e=>e.value===r)??i[0],t[0]=i,t[1]=r,t[2]=o):o=t[2];let s=o;if(!s)return null;let c;t[3]===s?c=t[4]:(c=(0,$.jsx)(_n,{option:s}),t[3]=s,t[4]=c);let l;t[5]===n?l=t[6]:(l=(0,$.jsx)(`span`,{className:`flex-1`,children:n}),t[5]=n,t[6]=l);let u;t[7]===s.label?u=t[8]:(u=(0,$.jsx)(`span`,{className:`min-w-0 max-w-32 truncate text-xs text-muted-foreground`,children:s.label}),t[7]=s.label,t[8]=u);let d;t[9]!==c||t[10]!==l||t[11]!==u?(d=(0,$.jsxs)(D,{children:[c,l,u]}),t[9]=c,t[10]=l,t[11]=u,t[12]=d):d=t[12];let f;t[13]!==n||t[14]!==a||t[15]!==i||t[16]!==r?(f=(0,$.jsx)(S,{children:(0,$.jsx)(On,{label:n,value:r,options:i,onChange:a})}),t[13]=n,t[14]=a,t[15]=i,t[16]=r,t[17]=f):f=t[17];let p;return t[18]!==d||t[19]!==f?(p=(0,$.jsxs)(M,{children:[d,f]}),t[18]=d,t[19]=f,t[20]=p):p=t[20],p}function jn(e){let t=(0,Z.c)(47),{value:n,options:r,onChange:a}=e,[o,s]=(0,Q.useState)(``),c,l,u,d,p,h,g,_,v,y;if(t[0]!==a||t[1]!==r||t[2]!==o||t[3]!==n){let e=o.trim().toLowerCase(),i;t[14]===n?i=t[15]:(i=n?.toLowerCase()??``,t[14]=n,t[15]=i);let b=i,x;t[16]===b?x=t[17]:(x=e=>e.actor.login.toLowerCase()===b,t[16]=b,t[17]=x);let C=r.find(x);y=[...C?[C]:[],...r.filter(t=>t!==C&&(e.length===0||t.actor.login.toLowerCase().includes(e)||t.actor.name?.toLowerCase().includes(e)))].slice(0,10);let w;t[18]!==b||t[19]!==a?(w=e=>e.toLowerCase()!==b&&a(e||void 0),t[18]=b,t[19]=a,t[20]=w):w=t[20];let T=w;u=M;let k,ee;t[21]===Symbol.for(`react.memo_cache_sentinel`)?(k=(0,$.jsx)(m,{"aria-hidden":!0,className:`size-3.5`}),ee=(0,$.jsx)(`span`,{className:`flex-1`,children:`Author`}),t[21]=k,t[22]=ee):(k=t[21],ee=t[22]);let j=n??`Anyone`;t[23]===j?v=t[24]:(v=(0,$.jsxs)(D,{children:[k,ee,(0,$.jsx)(`span`,{className:`min-w-0 max-w-32 truncate text-xs text-muted-foreground`,children:j})]}),t[23]=j,t[24]=v),l=S;let te;t[25]===Symbol.for(`react.memo_cache_sentinel`)?(te=(0,$.jsx)(Ft,{children:(0,$.jsx)(E,{"aria-hidden":!0})}),t[25]=te):te=t[25];let N;t[26]===Symbol.for(`react.memo_cache_sentinel`)?(N=e=>s(e.currentTarget.value),t[26]=N):N=t[26],t[27]===o?_=t[28]:(_=(0,$.jsx)(`div`,{className:`p-1 pb-2`,children:(0,$.jsxs)(Lt,{children:[te,(0,$.jsx)(It,{autoFocus:!0,size:`compact`,value:o,onChange:N,onKeyDown:Nn,placeholder:`Search authors`,"aria-label":`Search authors`})]})}),t[27]=o,t[28]=_),c=O,d=C?.actor.login??n??``,p=T,t[29]===Symbol.for(`react.memo_cache_sentinel`)?(h=(0,$.jsx)(A,{value:``,children:(0,$.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[(0,$.jsx)(f,{"aria-hidden":!0,className:`size-3.5`}),`Anyone`]})}),t[29]=h):h=t[29],g=y.map(Mn),t[0]=a,t[1]=r,t[2]=o,t[3]=n,t[4]=c,t[5]=l,t[6]=u,t[7]=d,t[8]=p,t[9]=h,t[10]=g,t[11]=_,t[12]=v,t[13]=y}else c=t[4],l=t[5],u=t[6],d=t[7],p=t[8],h=t[9],g=t[10],_=t[11],v=t[12],y=t[13];let b;t[30]===y.length?b=t[31]:(b=y.length===0?(0,$.jsx)(i,{disabled:!0,children:`No authors found`}):null,t[30]=y.length,t[31]=b);let x;t[32]!==c||t[33]!==d||t[34]!==p||t[35]!==h||t[36]!==g||t[37]!==b?(x=(0,$.jsxs)(c,{value:d,onValueChange:p,children:[h,g,b]}),t[32]=c,t[33]=d,t[34]=p,t[35]=h,t[36]=g,t[37]=b,t[38]=x):x=t[38];let C;t[39]!==l||t[40]!==_||t[41]!==x?(C=(0,$.jsxs)(l,{children:[_,x]}),t[39]=l,t[40]=_,t[41]=x,t[42]=C):C=t[42];let w;return t[43]!==u||t[44]!==v||t[45]!==C?(w=(0,$.jsxs)(u,{children:[v,C]}),t[43]=u,t[44]=v,t[45]=C,t[46]=w):w=t[46],w}function Mn(e){return(0,$.jsx)(A,{value:e.actor.login,children:(0,$.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[(0,$.jsx)(Je,{actor:e.actor}),(0,$.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:e.actor.login}),(0,$.jsxs)(`span`,{className:`shrink-0 text-xs text-muted-foreground tabular-nums`,children:[e.mergedCount,` merges loaded`]})]})},e.actor.login.toLowerCase())}function Nn(e){e.key!==`ArrowDown`&&e.key!==`Escape`&&e.stopPropagation()}function Pn(e){let t=(0,Z.c)(21),{value:n,options:r,onChange:a}=e,o;t[0]===n?o=t[1]:(o=new Set(n.map(In)),t[0]=n,t[1]=o);let s=o,c,l,u,d;if(t[2]!==a||t[3]!==r||t[4]!==s||t[5]!==n){let e=[...n.filter(e=>!r.some(t=>t.name.toLowerCase()===e.toLowerCase())).map(Fn),...r];l=M;let o,f;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,$.jsx)(T,{"aria-hidden":!0,className:`size-3.5`}),f=(0,$.jsx)(`span`,{className:`flex-1`,children:`Labels`}),t[10]=o,t[11]=f):(o=t[10],f=t[11]);let m=n.length===0?`Any`:`${n.length} selected`;t[12]===m?d=t[13]:(d=(0,$.jsxs)(D,{children:[o,f,(0,$.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:m})]}),t[12]=m,t[13]=d),c=S,u=e.length===0?(0,$.jsx)(i,{disabled:!0,children:`No labels in this view`}):e.map(e=>{let t=e.name.toLowerCase(),r=s.has(t),i=tt(e.color);return(0,$.jsx)(p,{checked:r,onCheckedChange:t=>a(t?[...n,e.name]:n.filter(t=>t.toLowerCase()!==e.name.toLowerCase())),children:(0,$.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[(0,$.jsx)(`span`,{"aria-hidden":!0,className:`size-2.5 shrink-0 rounded-full bg-muted-foreground`,...i?{style:{backgroundColor:i}}:{}}),(0,$.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:e.name}),(0,$.jsx)(`span`,{className:`shrink-0 text-xs text-muted-foreground tabular-nums`,children:e.count})]})},t)}),t[2]=a,t[3]=r,t[4]=s,t[5]=n,t[6]=c,t[7]=l,t[8]=u,t[9]=d}else c=t[6],l=t[7],u=t[8],d=t[9];let f;t[14]!==c||t[15]!==u?(f=(0,$.jsx)(c,{children:u}),t[14]=c,t[15]=u,t[16]=f):f=t[16];let m;return t[17]!==l||t[18]!==d||t[19]!==f?(m=(0,$.jsxs)(l,{children:[d,f]}),t[17]=l,t[18]=d,t[19]=f,t[20]=m):m=t[20],m}function Fn(e){return{name:e,color:null,count:0}}function In(e){return e.toLowerCase()}function Ln(e){let t=(0,Z.c)(107),{onOpenChange:n,state:r,stateOptions:i,onState:a,involvement:o,involvementOptions:s,onInvolvement:c,filters:l,onFilters:u,authorOptions:d,labelOptions:p,host:m,hostOptions:g,onHost:_,server:v,serverOptions:b,onServer:x,projects:S,projectId:w,projectEnvironmentId:T,unavailable:E,onProject:D}=e,O;t[0]===d?O=t[1]:(O=d===void 0?[]:d,t[0]=d,t[1]=O);let k=O,ee;t[2]===p?ee=t[3]:(ee=p===void 0?[]:p,t[2]=p,t[3]=ee);let A=ee,j,M;t[4]!==l.author||t[5]!==l.checks||t[6]!==l.draft||t[7]!==l.labels||t[8]!==l.review||t[9]!==m||t[10]!==o||t[11]!==w||t[12]!==v||t[13]!==r?(j=(l.labels??[]).flatMap(Bn),M=[r!==`open`,o!==`all`,m,v,w,l.draft,l.review,l.checks,l.author,...j].filter(Boolean),t[4]=l.author,t[5]=l.checks,t[6]=l.draft,t[7]=l.labels,t[8]=l.review,t[9]=m,t[10]=o,t[11]=w,t[12]=v,t[13]=r,t[14]=j,t[15]=M):(j=t[14],M=t[15]);let te=M.length,re;t[16]!==l||t[17]!==u?(re=e=>u(Object.fromEntries(Object.entries({...l,...e}).filter(zn))),t[16]=l,t[17]=u,t[18]=re):re=t[18];let F=re,L;t[19]===F?L=t[20]:(L=(e,t)=>F({[e]:t===Cn?void 0:t}),t[19]=F,t[20]=L);let R=L,z;t[21]!==T||t[22]!==w?(z=w===void 0||T===void 0?bn:wn({id:w,environmentId:T}),t[21]=T,t[22]=w,t[23]=z):z=t[23];let ie=z,B;t[24]===Symbol.for(`react.memo_cache_sentinel`)?(B={value:bn,label:`All projects`,Icon:f},t[24]=B):B=t[24];let V;if(t[25]!==S||t[26]!==E){let e;t[28]===E?e=t[29]:(e=(e,t)=>Number(E.has(wn(e)))-Number(E.has(wn(t))),t[28]=E,t[29]=e);let n;t[30]===E?n=t[31]:(n=e=>({value:wn(e),label:e.title,Icon:I,project:e,...E.has(wn(e))?{unavailable:E.get(wn(e))}:{}}),t[30]=E,t[31]=n),V=[B,...S.toSorted(e).map(n)],t[25]=S,t[26]=E,t[27]=V}else V=t[27];let ae=V,H,oe,se;t[32]===Symbol.for(`react.memo_cache_sentinel`)?(H=(0,$.jsx)(C,{variant:`outline`}),oe=(0,$.jsx)(N,{className:`size-4`}),se=(0,$.jsx)(`span`,{children:`Filters`}),t[32]=H,t[33]=oe,t[34]=se):(H=t[32],oe=t[33],se=t[34]);let ce;t[35]===te?ce=t[36]:(ce=te>0?(0,$.jsx)(`span`,{className:`rounded-full bg-muted px-1.5 text-xs text-muted-foreground tabular-nums`,children:te}):null,t[35]=te,t[36]=ce);let le;t[37]===ce?le=t[38]:(le=(0,$.jsxs)(P,{render:H,children:[oe,se,ce]}),t[37]=ce,t[38]=le);let U;t[39]!==a||t[40]!==r||t[41]!==i?(U=(0,$.jsx)(An,{label:`State`,value:r,options:i,onChange:a}),t[39]=a,t[40]=r,t[41]=i,t[42]=U):U=t[42];let ue;t[43]!==o||t[44]!==s||t[45]!==c?(ue=(0,$.jsx)(An,{label:`Involvement`,value:o,options:s,onChange:c}),t[43]=o,t[44]=s,t[45]=c,t[46]=ue):ue=t[46];let de;t[47]===Symbol.for(`react.memo_cache_sentinel`)?(de=(0,$.jsx)(y,{}),t[47]=de):de=t[47];let fe;t[48]===F?fe=t[49]:(fe=e=>F({author:e}),t[48]=F,t[49]=fe);let pe;t[50]!==k||t[51]!==l.author||t[52]!==fe?(pe=(0,$.jsx)(jn,{value:l.author,options:k,onChange:fe}),t[50]=k,t[51]=l.author,t[52]=fe,t[53]=pe):pe=t[53];let me;t[54]===F?me=t[55]:(me=e=>F({labels:e.length===0?void 0:e.slice(0,10).map(Rn)}),t[54]=F,t[55]=me);let he;t[56]!==A||t[57]!==j||t[58]!==me?(he=(0,$.jsx)(Pn,{value:j,options:A,onChange:me}),t[56]=A,t[57]=j,t[58]=me,t[59]=he):he=t[59];let ge=l.draft??Cn,W;t[60]===R?W=t[61]:(W=e=>R(`draft`,e),t[60]=R,t[61]=W);let _e;t[62]!==ge||t[63]!==W?(_e=(0,$.jsx)(An,{label:`Draft`,value:ge,options:Tn,onChange:W}),t[62]=ge,t[63]=W,t[64]=_e):_e=t[64];let G=l.review??Cn,ve;t[65]===R?ve=t[66]:(ve=e=>R(`review`,e),t[65]=R,t[66]=ve);let ye;t[67]!==G||t[68]!==ve?(ye=(0,$.jsx)(An,{label:`Review`,value:G,options:En,onChange:ve}),t[67]=G,t[68]=ve,t[69]=ye):ye=t[69];let be=l.checks??Cn,xe;t[70]===R?xe=t[71]:(xe=e=>R(`checks`,e),t[70]=R,t[71]=xe);let Se;t[72]!==be||t[73]!==xe?(Se=(0,$.jsx)(An,{label:`Checks`,value:be,options:Dn,onChange:xe}),t[72]=be,t[73]=xe,t[74]=Se):Se=t[74];let Ce;t[75]!==m||t[76]!==g||t[77]!==_?(Ce=g.length>2?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(y,{}),(0,$.jsx)(An,{label:`Host`,value:m??xn,options:g,onChange:e=>_(e===xn?void 0:e)})]}):null,t[75]=m,t[76]=g,t[77]=_,t[78]=Ce):Ce=t[78];let we;t[79]!==x||t[80]!==v||t[81]!==b?(we=b.length>2?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(y,{}),(0,$.jsx)(An,{label:`Server`,value:v??Sn,options:b,onChange:e=>x(e===Sn?void 0:e)})]}):null,t[79]=x,t[80]=v,t[81]=b,t[82]=we):we=t[82];let Te;t[83]===Symbol.for(`react.memo_cache_sentinel`)?(Te=(0,$.jsx)(y,{}),t[83]=Te):Te=t[83];let K;t[84]!==D||t[85]!==w||t[86]!==S?(K=e=>{let t=S.find(t=>wn(t)===e);t?D(t.id,t.environmentId):w!==void 0&&D(void 0,void 0)},t[84]=D,t[85]=w,t[86]=S,t[87]=K):K=t[87];let q;t[88]!==ae||t[89]!==ie||t[90]!==K?(q=(0,$.jsx)(An,{label:`Project`,value:ie,options:ae,onChange:K}),t[88]=ae,t[89]=ie,t[90]=K,t[91]=q):q=t[91];let Ee;t[92]!==U||t[93]!==ue||t[94]!==pe||t[95]!==he||t[96]!==_e||t[97]!==ye||t[98]!==Se||t[99]!==Ce||t[100]!==we||t[101]!==q?(Ee=(0,$.jsxs)(ne,{align:`end`,side:`bottom`,children:[U,ue,de,pe,he,_e,ye,Se,Ce,we,Te,q]}),t[92]=U,t[93]=ue,t[94]=pe,t[95]=he,t[96]=_e,t[97]=ye,t[98]=Se,t[99]=Ce,t[100]=we,t[101]=q,t[102]=Ee):Ee=t[102];let De;return t[103]!==n||t[104]!==le||t[105]!==Ee?(De=(0,$.jsxs)(h,{onOpenChange:n,children:[le,Ee]}),t[103]=n,t[104]=le,t[105]=Ee,t[106]=De):De=t[106],De}function Rn(e){return[e]}function zn(e){let[,t]=e;return t!==void 0}function Bn(e){return e}function Vn(e){let t=(0,Z.c)(12),{joined:n}=e,r,i,a;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,$.jsx)(`path`,{d:`M10 58h100`,className:`text-muted-foreground/30`,stroke:`currentColor`}),i=(0,$.jsx)(`circle`,{cx:`10`,cy:`58`,r:`5`,fill:`currentColor`,fillOpacity:.25}),a=(0,$.jsx)(`circle`,{cx:`110`,cy:`58`,r:`5`,fill:`currentColor`,fillOpacity:.25}),t[0]=r,t[1]=i,t[2]=a):(r=t[0],i=t[1],a=t[2]);let o;t[3]===n?o=t[4]:(o=n?(0,$.jsx)(`path`,{d:`M30 58c0-18 8-26 24-26h12c16 0 24 8 24 26`}):(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`path`,{d:`M30 58c0-18 8-26 24-26h4`}),(0,$.jsx)(`path`,{d:`M90 58c0-18-8-26-24-26h-4`,strokeDasharray:`2 7`,className:`text-muted-foreground/50`})]}),t[3]=n,t[4]=o);let s=n?5:4,c=n?`currentColor`:`none`,l=n?void 0:`text-muted-foreground/45`,u;t[5]!==s||t[6]!==c||t[7]!==l?(u=(0,$.jsx)(`circle`,{cx:`60`,cy:`32`,r:s,fill:c,fillOpacity:.25,className:l}),t[5]=s,t[6]=c,t[7]=l,t[8]=u):u=t[8];let d;return t[9]!==o||t[10]!==u?(d=(0,$.jsxs)(`svg`,{"aria-hidden":!0,viewBox:`0 0 120 72`,className:`h-20 w-32 text-muted-foreground/60`,fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`,children:[r,i,a,o,u]}),t[9]=o,t[10]=u,t[11]=d):d=t[11],d}function Hn(e){let t=(0,Z.c)(56),{query:n,filtered:r,searching:i,hasProjects:a,canLoadMore:o,loadingMore:s,refreshing:c,onClearQuery:l,onLoadMore:u,onRefresh:d}=e;if(!a){let e;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(Vn,{joined:!1}),t[0]=e):e=t[0];let n;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,$.jsxs)(Ve,{children:[(0,$.jsx)(Ue,{children:`No projects in this workspace`}),(0,$.jsx)(We,{children:`Add a project, and the pull requests from its repository appear here.`})]}),t[1]=n):n=t[1];let r;return t[2]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,$.jsxs)(Ge,{children:[e,n,(0,$.jsx)(He,{children:(0,$.jsxs)(C,{size:`sm`,onClick:Un,children:[(0,$.jsx)(g,{className:`size-3.5`}),`Add project`]})})]}),t[2]=r):r=t[2],r}if(i){let e;t[3]===n?e=t[4]:(e=n.length>48?`${n.slice(0,48)}…`:n,t[3]=n,t[4]=e);let r=`Searching every host for “${e}”`,i;return t[5]===r?i=t[6]:(i=(0,$.jsx)(ye,{rows:5,caption:r}),t[5]=r,t[6]=i),i}if(n.length>0){let e;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(Vn,{joined:!1}),t[7]=e):e=t[7];let r;t[8]===n?r=t[9]:(r=n.length>48?`${n.slice(0,48)}…`:n,t[8]=n,t[9]=r);let i;t[10]===r?i=t[11]:(i=(0,$.jsxs)(Ue,{children:[`Nothing matches “`,r,`”`]}),t[10]=r,t[11]=i);let a;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,$.jsx)(We,{children:`The hosts were searched for it. Try fewer words, or search by number, author or branch.`}),t[12]=a):a=t[12];let o;t[13]===i?o=t[14]:(o=(0,$.jsxs)(Ve,{children:[i,a]}),t[13]=i,t[14]=o);let s;t[15]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,$.jsx)(E,{className:`size-3.5`}),t[15]=s):s=t[15];let u;t[16]===l?u=t[17]:(u=(0,$.jsxs)(C,{size:`sm`,variant:`outline`,onClick:l,children:[s,`Clear search`]}),t[16]=l,t[17]=u);let f;t[18]===c?f=t[19]:(f=(0,$.jsx)(en,{size:`sm`,refreshing:c}),t[18]=c,t[19]=f);let p=c?`Checking...`:`Check again`,m;t[20]!==d||t[21]!==c||t[22]!==f||t[23]!==p?(m=(0,$.jsxs)(C,{size:`sm`,variant:`outline`,disabled:c,onClick:d,children:[f,p]}),t[20]=d,t[21]=c,t[22]=f,t[23]=p,t[24]=m):m=t[24];let h;t[25]!==m||t[26]!==u?(h=(0,$.jsxs)(`div`,{className:`flex flex-wrap justify-center gap-2`,children:[u,m]}),t[25]=m,t[26]=u,t[27]=h):h=t[27];let g;return t[28]!==h||t[29]!==o?(g=(0,$.jsxs)(Ge,{children:[e,o,h]}),t[28]=h,t[29]=o,t[30]=g):g=t[30],g}let f;t[31]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,$.jsx)(Vn,{joined:!1}),t[31]=f):f=t[31];let p=r?`Nothing under these filters`:`No pull requests`,m;t[32]===p?m=t[33]:(m=(0,$.jsx)(Ue,{children:p}),t[32]=p,t[33]=m);let h=r?`Widen the state, involvement or project filter to see more.`:`Pull requests from every project in this workspace appear here.`,_;t[34]===h?_=t[35]:(_=(0,$.jsx)(We,{children:h}),t[34]=h,t[35]=_);let v;t[36]!==m||t[37]!==_?(v=(0,$.jsxs)(Ve,{children:[m,_]}),t[36]=m,t[37]=_,t[38]=v):v=t[38];let y;t[39]!==o||t[40]!==s||t[41]!==u?(y=o?(0,$.jsx)(C,{size:`sm`,variant:`outline`,disabled:s,onClick:u,children:s?`Loading...`:`Load more pull requests`}):null,t[39]=o,t[40]=s,t[41]=u,t[42]=y):y=t[42];let b;t[43]===c?b=t[44]:(b=(0,$.jsx)(en,{size:`sm`,refreshing:c}),t[43]=c,t[44]=b);let x=c?`Checking...`:`Check again`,S;t[45]!==d||t[46]!==c||t[47]!==b||t[48]!==x?(S=(0,$.jsxs)(C,{size:`sm`,variant:`outline`,disabled:c,onClick:d,children:[b,x]}),t[45]=d,t[46]=c,t[47]=b,t[48]=x,t[49]=S):S=t[49];let w;t[50]!==S||t[51]!==y?(w=(0,$.jsxs)(`div`,{className:`flex flex-wrap justify-center gap-2`,children:[y,S]}),t[50]=S,t[51]=y,t[52]=w):w=t[52];let T;return t[53]!==w||t[54]!==v?(T=(0,$.jsxs)(Ge,{children:[f,v,w]}),t[53]=w,t[54]=v,t[55]=T):T=t[55],T}function Un(){return nn({open:`add-project`})}function Wn(e){let t=(0,Z.c)(22),{environmentId:n,reference:r,onSelect:a,stackNumber:o}=e,s=G(n,r);if(s.data!==null){let e=!!s.error,n;t[0]!==s.data.number||t[1]!==s.notice||t[2]!==e?(n=(0,$.jsx)(xe,{number:s.data.number,notice:s.notice,stale:e}),t[0]=s.data.number,t[1]=s.notice,t[2]=e,t[3]=n):n=t[3];let o;t[4]!==s.error||t[5]!==s.refresh?(o=s.error?(0,$.jsx)(i,{onClick:s.refresh,children:`Retry stack refresh`}):null,t[4]=s.error,t[5]=s.refresh,t[6]=o):o=t[6];let c;t[7]!==a||t[8]!==s.data||t[9]!==r?(c=(0,$.jsx)(Pe,{stack:s.data,reference:r,onSelect:a}),t[7]=a,t[8]=s.data,t[9]=r,t[10]=c):c=t[10];let l;return t[11]!==n||t[12]!==o||t[13]!==c?(l=(0,$.jsxs)($.Fragment,{children:[n,o,c]}),t[11]=n,t[12]=o,t[13]=c,t[14]=l):l=t[14],l}let c;t[15]===o?c=t[16]:(c=(0,$.jsx)(xe,{number:o}),t[15]=o,t[16]=c);let u=s.error??(s.isPending?`Loading stack…`:`This pull request is no longer in a stack.`),d;t[17]===u?d=t[18]:(d=(0,$.jsx)(l,{children:u}),t[17]=u,t[18]=d);let f;return t[19]!==c||t[20]!==d?(f=(0,$.jsxs)($.Fragment,{children:[c,d]}),t[19]=c,t[20]=d,t[21]=f):f=t[21],f}function Gn(e){let t=(0,Z.c)(25),{environmentId:n,reference:r,membership:i,onSelect:a}=e,[o,s]=(0,Q.useState)(!1),c;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,$.jsx)(`span`,{role:`button`,tabIndex:0,className:`inline-flex shrink-0 cursor-pointer items-center gap-1 text-xs font-normal text-muted-foreground`}),t[0]=c):c=t[0];let l=`Stack ${i.number}, layer ${i.position} of ${i.size}`,u;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,$.jsx)(Ze.stack,{"aria-hidden":!0,className:`size-3`}),t[1]=u):u=t[1];let d;t[2]!==i.position||t[3]!==i.size||t[4]!==l?(d=(0,$.jsx)(Le,{render:(0,$.jsxs)(P,{nativeButton:!1,render:c,"aria-label":l,onClick:Yn,onKeyDown:Jn,children:[u,i.position,`/`,i.size]})}),t[2]=i.position,t[3]=i.size,t[4]=l,t[5]=d):d=t[5];let f;t[6]!==i.number||t[7]!==i.position||t[8]!==i.size?(f=(0,$.jsxs)(Re,{children:[`View stack #`,i.number,`, layer `,i.position,` of `,i.size]}),t[6]=i.number,t[7]=i.position,t[8]=i.size,t[9]=f):f=t[9];let p;t[10]!==d||t[11]!==f?(p=(0,$.jsxs)(ze,{children:[d,f]}),t[10]=d,t[11]=f,t[12]=p):p=t[12];let m;t[13]!==n||t[14]!==i.number||t[15]!==a||t[16]!==o||t[17]!==r?(m=o?(0,$.jsx)(Wn,{environmentId:n,reference:r,stackNumber:i.number,onSelect:e=>{s(!1),a(e)}}):null,t[13]=n,t[14]=i.number,t[15]=a,t[16]=o,t[17]=r,t[18]=m):m=t[18];let g;t[19]===m?g=t[20]:(g=(0,$.jsx)(ne,{align:`start`,onClick:qn,onKeyDown:Kn,children:(0,$.jsx)(v,{children:m})}),t[19]=m,t[20]=g);let _;return t[21]!==o||t[22]!==p||t[23]!==g?(_=(0,$.jsxs)(h,{open:o,onOpenChange:s,children:[p,g]}),t[21]=o,t[22]=p,t[23]=g,t[24]=_):_=t[24],_}function Kn(e){return e.stopPropagation()}function qn(e){return e.stopPropagation()}function Jn(e){return e.stopPropagation()}function Yn(e){return e.stopPropagation()}var Xn=[{overflow:`@xl/pr-row-meta:hidden`},{overflow:`@3xl/pr-row-meta:hidden`},{overflow:``}];function Zn(e){let t=(0,Z.c)(4),{labels:n}=e;if(n.length===0)return null;let r;t[0]===n?r=t[1]:(r=Xn.map((e,t)=>{let r=n[t];if(!r)return null;let i=n.length-t-1;return(0,$.jsx)(J,{label:r,className:t===0?``:t===1?`hidden @xl/pr-row-meta:inline-flex`:`hidden @3xl/pr-row-meta:inline-flex`,children:i>0?(0,$.jsxs)(`span`,{className:te(`shrink-0`,e.overflow),children:[`+`,i]}):null},r.name)}),t[0]=n,t[1]=r);let i;return t[2]===r?i=t[3]:(i=(0,$.jsx)(`span`,{className:`flex min-w-0 items-center gap-1`,children:r}),t[2]=r,t[3]=i),i}var Qn=`px-3 py-2.5`;function $n(e){let t=(0,Z.c)(99),{entry:n,selected:r,showProjectTitle:i,showProvider:a,environmentLabel:o,matchedElsewhere:s,statsKey:c,statsRef:l,onSelect:u,speedMode:d,hostActions:f,onActed:p,closing:m,sweeping:h,onCloseSweepStart:g}=e,_=m!==void 0&&m,v=h!==void 0&&h,y;t[0]===n.provider?y=t[1]:(y=cn(n.provider),t[0]=n.provider,t[1]=y);let{Icon:b,providerName:x}=y,S=r?`bg-accent`:`hover:bg-accent/60`,C;t[2]===S?C=t[3]:(C=te(`flex items-center rounded-md [content-visibility:auto] [contain-intrinsic-block-size:56.5px]`,S),t[2]=S,t[3]=C);let w=r?`true`:void 0,T;t[4]!==n||t[5]!==u?(T=()=>u(n),t[4]=n,t[5]=u,t[6]=T):T=t[6];let D;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(D=te(K,Qn,`min-w-0 flex-1 cursor-pointer transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-inset focus-visible:ring-ring`),t[7]=D):D=t[7];let O;t[8]!==n.baseBranch||t[9]!==n.isDraft||t[10]!==n.mergeability||t[11]!==n.state?(O=(0,$.jsx)(Se,{state:n.state,isDraft:n.isDraft,mergeability:n.mergeability,baseBranch:n.baseBranch,className:`mt-0.75 self-start`}),t[8]=n.baseBranch,t[9]=n.isDraft,t[10]=n.mergeability,t[11]=n.state,t[12]=O):O=t[12];let k;t[13]!==n.provider||t[14]!==n.url?(k=e=>{e.preventDefault(),e.stopPropagation(),Ee({url:n.url,openLabel:ke(Xe.get(n.provider)),position:{x:e.clientX,y:e.clientY}})},t[13]=n.provider,t[14]=n.url,t[15]=k):k=t[15];let ee;t[16]!==n.number||t[17]!==k?(ee=(0,$.jsxs)(`span`,{className:be,onContextMenu:k,children:[`#`,n.number]}),t[16]=n.number,t[17]=k,t[18]=ee):ee=t[18];let A;t[19]!==n.checksState||t[20]!==n.environmentId||t[21]!==n.number||t[22]!==n.projectId||t[23]!==n.repository?(A=n.checksState===void 0?null:(0,$.jsx)(we,{checksState:n.checksState,environmentId:n.environmentId,reference:{projectId:n.projectId,repository:n.repository,number:n.number}}),t[19]=n.checksState,t[20]=n.environmentId,t[21]=n.number,t[22]=n.projectId,t[23]=n.repository,t[24]=A):A=t[24];let j;t[25]===n.reviewDecision?j=t[26]:(j=n.reviewDecision===void 0?null:(0,$.jsx)(Ye,{decision:n.reviewDecision}),t[25]=n.reviewDecision,t[26]=j);let M;t[27]!==A||t[28]!==j?(M=(0,$.jsxs)($.Fragment,{children:[A,j]}),t[27]=A,t[28]=j,t[29]=M):M=t[29];let N;t[30]!==n.environmentId||t[31]!==n.host||t[32]!==n.number||t[33]!==n.projectId||t[34]!==n.repository||t[35]!==n.stack||t[36]!==u?(N=n.stack?(0,$.jsx)(Gn,{environmentId:n.environmentId,reference:{projectId:n.projectId,host:n.host,repository:n.repository,number:n.number},membership:n.stack,onSelect:e=>u({...e,host:n.host,environmentId:n.environmentId})}):null,t[30]=n.environmentId,t[31]=n.host,t[32]=n.number,t[33]=n.projectId,t[34]=n.repository,t[35]=n.stack,t[36]=u,t[37]=N):N=t[37];let ne;t[38]!==n.host||t[39]!==n.number||t[40]!==n.projectId||t[41]!==n.repository?(ne={projectId:n.projectId,host:n.host,repository:n.repository,number:n.number},t[38]=n.host,t[39]=n.number,t[40]=n.projectId,t[41]=n.repository,t[42]=ne):ne=t[42];let re;t[43]!==n.additions||t[44]!==n.deletions||t[45]!==n.environmentId||t[46]!==ne?(re=(0,$.jsx)(Fe,{environmentId:n.environmentId,reference:ne,additions:n.additions,deletions:n.deletions,className:`font-mono`}),t[43]=n.additions,t[44]=n.deletions,t[45]=n.environmentId,t[46]=ne,t[47]=re):re=t[47];let P;t[48]!==N||t[49]!==re?(P=(0,$.jsxs)($.Fragment,{children:[N,re]}),t[48]=N,t[49]=re,t[50]=P):P=t[50];let F;t[51]===s?F=t[52]:(F=s?(0,$.jsxs)(ze,{children:[(0,$.jsxs)(Le,{render:(0,$.jsx)(`span`,{className:`flex min-w-6 items-center gap-1 overflow-hidden rounded-full border border-border/60 px-1 text-3xs`}),children:[(0,$.jsx)(`span`,{className:`sr-only`,children:`matched in the description`}),(0,$.jsx)(E,{"aria-hidden":!0,className:`size-3 shrink-0`}),(0,$.jsx)(`span`,{"aria-hidden":!0,className:`hidden truncate @xs/pr-row-meta:block`,children:`matched in the description`})]}),(0,$.jsx)(Re,{side:`top`,children:`Matched in the description`})]}):null,t[51]=s,t[52]=F);let I;t[53]!==b||t[54]!==x||t[55]!==a?(I=a?(0,$.jsxs)(ze,{children:[(0,$.jsx)(Le,{render:(0,$.jsx)(`span`,{className:`inline-flex shrink-0`}),children:(0,$.jsx)(b,{"aria-label":x,className:`size-3`})}),(0,$.jsx)(Re,{children:x})]}):null,t[53]=b,t[54]=x,t[55]=a,t[56]=I):I=t[56];let L;t[57]===n.author?L=t[58]:(L=(0,$.jsx)(Oe,{actor:n.author,className:`min-w-3.5 max-w-40`,labelClassName:`sr-only @xs/pr-row-meta:not-sr-only @xs/pr-row-meta:truncate`}),t[57]=n.author,t[58]=L);let R;t[59]!==n.repository||t[60]!==i?(R=i?(0,$.jsx)(`span`,{className:`truncate`,children:n.repository}):null,t[59]=n.repository,t[60]=i,t[61]=R):R=t[61];let z;t[62]===o?z=t[63]:(z=o?(0,$.jsx)(`span`,{className:`min-w-0 max-w-32 truncate`,children:o}):null,t[62]=o,t[63]=z);let ie;t[64]===n.labels?ie=t[65]:(ie=n.labels.length>0?(0,$.jsx)(Zn,{labels:n.labels}):null,t[64]=n.labels,t[65]=ie);let B;t[66]!==F||t[67]!==I||t[68]!==L||t[69]!==R||t[70]!==z||t[71]!==ie?(B=(0,$.jsxs)($.Fragment,{children:[F,I,L,R,z,ie]}),t[66]=F,t[67]=I,t[68]=L,t[69]=R,t[70]=z,t[71]=ie,t[72]=B):B=t[72];let V;t[73]!==n.title||t[74]!==n.updatedAt||t[75]!==ee||t[76]!==M||t[77]!==P||t[78]!==B?(V=(0,$.jsx)(q,{number:ee,title:n.title,signals:M,status:P,metaClassName:`@container/pr-row-meta`,meta:B,updatedAt:n.updatedAt}),t[73]=n.title,t[74]=n.updatedAt,t[75]=ee,t[76]=M,t[77]=P,t[78]=B,t[79]=V):V=t[79];let ae;t[80]!==V||t[81]!==w||t[82]!==T||t[83]!==O?(ae=(0,$.jsxs)(`button`,{type:`button`,"aria-current":w,onClick:T,className:D,children:[O,V]}),t[80]=V,t[81]=w,t[82]=T,t[83]=O,t[84]=ae):ae=t[84];let H;t[85]!==_||t[86]!==n||t[87]!==f||t[88]!==p||t[89]!==g||t[90]!==d||t[91]!==v?(H=f.size>0?(0,$.jsx)(Me,{entry:n,hostActions:f,visible:d,onActed:p,closing:_,sweeping:v,...g?{onCloseSweepStart:g}:{}}):null,t[85]=_,t[86]=n,t[87]=f,t[88]=p,t[89]=g,t[90]=d,t[91]=v,t[92]=H):H=t[92];let oe;return t[93]!==c||t[94]!==l||t[95]!==ae||t[96]!==H||t[97]!==C?(oe=(0,$.jsxs)(`div`,{ref:l,"data-pull-request-stats-key":c,"data-pull-request-key":c,className:C,children:[ae,H]}),t[93]=c,t[94]=l,t[95]=ae,t[96]=H,t[97]=C,t[98]=oe):oe=t[98],oe}var er=(0,Q.memo)($n);function tr(){let e=(0,Z.c)(14),t=z(),n=R(),r=Ht(ar),i=U(ir),a=U(Bt),o=se(),s=ce(),c;e[0]!==r||e[1]!==t?(c=zt({items:t,preferredIds:r,getId:X,getPreferenceIds:rr}),e[0]=r,e[1]=t,e[2]=c):c=e[2];let l=c,u;if(e[3]!==o||e[4]!==a||e[5]!==l||e[6]!==s||e[7]!==t||e[8]!==i){let n=new Map(o.map(nr));u=Yt({projects:i===`manual`?l:t,groupScratchProjects:!0,settings:a,primaryEnvironmentId:s,resolveEnvironmentLabel:e=>n.get(e)??null}),e[3]=o,e[4]=a,e[5]=l,e[6]=s,e[7]=t,e[8]=i,e[9]=u}else u=e[9];let d=u,f;return e[10]!==i||e[11]!==n||e[12]!==d?(f=Y(d,n,i),e[10]=i,e[11]=n,e[12]=d,e[13]=f):f=e[13],f}function nr(e){return[e.environmentId,e.label]}function rr(e){return[X(e),Ut(e.workspaceRoot)]}function ir(e){return e.sidebarProjectSortOrder}function ar(e){return e.projectOrder}function or(){return{terminalFocus:Jt(),terminalOpen:!1,previewFocus:!1,previewOpen:!1,modelPickerOpen:!1,isWeb:!Ie,isDesktop:Ie}}var sr={authored:s,reviewRequested:j,others:_};function cr(e){let t=(0,Z.c)(11),{group:n}=e,r=sr[n.key]??f,i;t[0]===r?i=t[1]:(i=(0,$.jsx)(r,{"aria-hidden":!0,className:`size-3.5 shrink-0`}),t[0]=r,t[1]=i);let a;t[2]===n.label?a=t[3]:(a=(0,$.jsx)(`h2`,{className:`shrink-0`,children:n.label}),t[2]=n.label,t[3]=a);let o;t[4]===n.entries.length?o=t[5]:(o=(0,$.jsx)(`span`,{className:`shrink-0 tabular-nums text-muted-foreground/50`,children:n.entries.length}),t[4]=n.entries.length,t[5]=o);let s;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,$.jsx)(b,{className:`min-w-2 flex-1`}),t[6]=s):s=t[6];let c;return t[7]!==i||t[8]!==a||t[9]!==o?(c=(0,$.jsxs)(`div`,{className:`flex items-center gap-2 px-3 pb-1 text-xs font-medium text-muted-foreground/70`,children:[i,a,o,s]}),t[7]=i,t[8]=a,t[9]=o,t[10]=c):c=t[10],c}var lr=[{value:`all`,label:`All`,Icon:f},{value:`reviewing`,label:`Reviewing`,Icon:j},{value:`authored`,label:`Authored`,Icon:s}],ur=[{value:`all`,label:`All`,Icon:f},{value:`open`,label:`Open`,Icon:Ze.pullRequest},{value:`closed`,label:`Closed`,Icon:Ze.closed},{value:`merged`,label:`Merged`,Icon:Ze.merged}],dr=250,fr=10,pr=99,mr=500,hr={},gr=[],_r={},vr={},yr=new Map,br=new Set,xr=e=>me({...e,repository:e.repository.toLowerCase()});function Sr(){ae();let e=qt(!0),t=e.shiftKey&&!e.metaKey&&!e.ctrlKey&&!e.altKey,n=on.useSearch(),r=n.sort??`ready`,i=r===`ready`||r===`largest`||r===`smallest`?`eager`:`visible`,a=V({from:on.fullPath}),o=re(ue),{environments:s}=le(),l=(0,Q.useMemo)(()=>s.filter(e=>e.serverConfig?.environment.capabilities.pullRequests===!0).toSorted((e,t)=>e.environmentId.localeCompare(t.environmentId)),[s]),u=l.find(e=>e.environmentId===n.environmentId)?.environmentId??null,d=(0,Q.useMemo)(()=>new Set(s.map(e=>e.environmentId)),[s]),p=(0,Q.useMemo)(()=>l.filter(e=>u===null||e.environmentId===u).map(e=>e.environmentId),[l,u]),m=(0,Q.useMemo)(()=>pt(p),[p]),h=s.some(e=>e.serverConfig!==null),g=p.length>0,_=z(),v=ie(),y=(0,Q.useMemo)(()=>_.filter(e=>!e.isScratch&&p.includes(e.environmentId)),[_,p]),b=(0,Q.useMemo)(()=>new Map(s.map(e=>[e.environmentId,e.label])),[s]),x=(0,Q.useMemo)(()=>ut(n.projectId,y,v),[y,v,n.projectId]),S=(0,Q.useMemo)(()=>wt(y,u,x),[y,u,x]),w=(0,Q.useMemo)(()=>gn(y,b,S),[b,y,S]),T=n.selectedHost??n.host,E=(0,Q.useMemo)(()=>{let e=n.repository?.toLowerCase();if(e!==void 0)return y.find(t=>t.repositoryIdentity?.owner&&t.repositoryIdentity.name&&`${t.repositoryIdentity.owner}/${t.repositoryIdentity.name}`.toLowerCase()===e&&(T===void 0||F(t.repositoryIdentity,t.repositoryIdentity.provider)===T.toLowerCase()))?.id},[y,T,n.repository]),D=(0,Q.useMemo)(()=>ut(n.selectedProjectId,y,v),[y,v,n.selectedProjectId])??E??x,O=at(n.selectedEnvironmentId,d,u),A=(0,Q.useMemo)(()=>wt(y,O,D),[y,O,D]),j=l.length===0?null:ge,M=Wt(j),N=W(e=>fe(e.byThreadKey,j)),ne=W(e=>he(e.byThreadKey,j)),P=ne?.kind===`pull-request`?ne:null,I=N.isOpen?P:null,{active:L,durationMs:R}=Kt(),se=(0,Q.useMemo)(()=>({activeSurface:P,surfaces:N.surfaces}),[N.surfaces,P]),ce=Gt(N.isOpen&&P!==null,se,L,j?.threadId??null,R),U=ce.present,G=ce.value?.activeSurface??null,be=ce.value?.surfaces??[],xe=G?.environmentId??A?.environmentId??null,Se=(0,Q.useCallback)(e=>void a({search:t=>{let n={...t,...e};return{involvement:n.involvement??t.involvement,state:n.state??t.state,...n.sort&&n.sort!==`ready`?{sort:n.sort}:{},...n.repository?{repository:n.repository}:{},...n.number?{number:n.number}:{},...n.projectId?{projectId:n.projectId}:{},...n.environmentId?{environmentId:n.environmentId}:{},...n.host?{host:n.host}:{},...n.selectedHost?{selectedHost:n.selectedHost}:{},...n.selectedProjectId?{selectedProjectId:n.selectedProjectId}:{},...n.selectedEnvironmentId?{selectedEnvironmentId:n.selectedEnvironmentId}:{},...n.q?{q:n.q}:{},...n.draft?{draft:n.draft}:{},...n.review?{review:n.review}:{},...n.checks?{checks:n.checks}:{},...n.author?{author:n.author}:{},...n.labels&&n.labels.length>0?{labels:n.labels}:{}}},replace:!0}),[a]),we={repository:void 0,number:void 0,selectedProjectId:void 0,selectedEnvironmentId:void 0,selectedHost:void 0},K=e=>{let t=tn({...n,...e,involvement:e.involvement??n.involvement,state:e.state??n.state});sn(t),Se(e)},q=(n.q??``).trim(),[Ee,Oe]=(0,Q.useState)(!1),ke=_e(q,dr),Me=q===ke,Pe=(0,Q.useMemo)(()=>_t(q),[q]),Fe=(0,Q.useMemo)(()=>_t(ke),[ke]),Ie=(0,Q.useMemo)(()=>({...n.draft?{draft:n.draft}:{},...n.review?{review:n.review}:{},...n.checks?{checks:n.checks}:{},...n.author?{author:n.author}:{},...n.labels?{labels:n.labels.map(e=>[e])}:{}}),[n.author,n.checks,n.draft,n.labels,n.review]),Le=Object.keys(Ie).length>0,Re=(0,Q.useMemo)(()=>({...Ie,...Fe.filters}),[Ie,Fe.filters]),ze=Object.keys(Re).length>0,Ve=(0,Q.useMemo)(()=>({...Ie,...Pe.filters}),[Ie,Pe.filters]),He=Object.keys(Ve).length>0,Ue=(0,Q.useMemo)(()=>rt(p,y,S,x,v),[p,y,v,S,x]),We=(0,Q.useMemo)(()=>{let e=Ue.map(e=>({environmentId:e}));if(!v||x!==void 0)return e;let t=Ne(y,Ue,Ue[0]),n=new Map;for(let e of y)n.set(e.environmentId,(n.get(e.environmentId)??0)+1);return Ue.flatMap(e=>{let r=t.get(e);return r===void 0?[]:r.length===(n.get(e)??0)?[{environmentId:e}]:[{environmentId:e,projectIds:r}]})},[y,v,Ue,x]),Ge=(0,Q.useMemo)(()=>We.map(({environmentId:e,projectIds:t})=>`${e}#${t?.join(`+`)??`*`}`).join(`|`),[We]),Je=Ct(We.map(({environmentId:e})=>e)).map(([e,t])=>`${e}:${t}`).join(`|`),Ye=`${m}:${Ge}:${n.state}:${n.involvement}:${x??``}:${n.host??``}:${n.draft??``}:${n.review??``}:${n.checks??``}:${n.author??``}:${n.labels?.join(`\0`)??``}`,J=`${Ye}:${ke}`,Xe=(0,Q.useRef)({key:J,policy:i});Xe.current={key:J,policy:i};let[Ze,tt]=(0,Q.useState)({key:J,size:pr,cursors:null,regrown:[]}),Pt=Ze.key===J?Ze.size:pr,Ft=Ze.key===J?Ze.cursors:null,It=Ze.key===J?Ze.regrown:[];(0,Q.useEffect)(()=>{tt({key:J,size:pr,cursors:null,regrown:[]})},[J]);let Lt=(0,Q.useMemo)(()=>We.flatMap(({environmentId:e,projectIds:t})=>{let r=Ft?.[e];return Ft!==null&&r===void 0&&!It.includes(e)?[]:[{environmentId:e,input:{state:n.state,involvement:n.involvement,limit:Pt,...x?{projectId:x}:{},...t?{projectIds:t}:{},...n.host?{host:n.host}:{},...ze?{filters:Re}:{},...Fe.text?{query:Fe.text}:{},...r===void 0?{}:{cursors:r}}}]}),[Re,ze,Pt,We,x,n.host,n.involvement,n.state,Ft,It,Fe.text]),Y=Tt(Lt),zt=(0,Q.useMemo)(()=>We.map(({environmentId:e,projectIds:t})=>({environmentId:e,input:{state:n.state,involvement:n.involvement,limit:pr,...x?{projectId:x}:{},...t?{projectIds:t}:{},...n.host?{host:n.host}:{},...Le?{filters:Ie}:{}}})),[Le,Ie,We,x,n.host,n.involvement,n.state]),X=Tt(zt),Bt=X.data?.entries.length===0&&X.data.errors.length===0&&!X.isPending&&X.error===null,Vt=(0,Q.useMemo)(()=>Ee?We.map(({environmentId:e,projectIds:t})=>({environmentId:e,input:{state:`all`,involvement:n.involvement,limit:pr,...x?{projectId:x}:{},...t?{projectIds:t}:{},...n.host?{host:n.host}:{}}})):gr,[We,Ee,x,n.host,n.involvement]),Ht=Tt(Vt),Ut=n.involvement===`all`&&q.length===0,Jt=(0,Q.useMemo)(()=>{if(!Ut||X.data===null||X.data.entries.length===0)return{authored:gr,reviewing:gr};let e=e=>We.map(({environmentId:t,projectIds:r})=>({environmentId:t,input:{state:n.state,involvement:e,limit:pr,...x?{projectId:x}:{},...r?{projectIds:r}:{},...n.host?{host:n.host}:{},...Le?{filters:Ie}:{}}}));return{authored:e(`authored`),reviewing:e(`reviewing`)}},[Le,Ie,Ut,X.data,We,x,n.host,n.state]),Yt=Tt(Jt.authored),Zt=Tt(Jt.reviewing),Qt=de(Dt.invalidate,{reportFailure:!1}),[$t,en]=(0,Q.useState)(0),[nn,ln]=(0,Q.useState)(!1),dn=(e=Xe.current,t)=>{Gn(!0,t);let n=ir.current,r=Qe({requestedScope:e,currentScope:Xe.current,entriesByKey:rr.current,candidateKeys:n.key===e.key?n.values:new Set,statsByRow:Sr.current});r!==null&&(Er({key:e.key,batches:r}),Fr.refresh(r.filter(({environmentId:e})=>t===void 0||e===t).map(({environmentId:e,input:t})=>({environmentId:e,input:t}))))},fn=async()=>{let e=Xe.current;ln(!0);try{await Promise.all(Ue.map(e=>Qt({environmentId:e,input:{}})))}finally{ln(!1)}dn(e),en(e=>e+1)},pn=nn||Y.isPending,[Z,hn]=(0,Q.useState)(null),[_n,bn]=(0,Q.useState)(null),[xn,Sn]=(0,Q.useState)(()=>new Map),Cn=(0,Q.useRef)(0),Tn=(e,t)=>{let n=++Cn.current,r=lt(e,t,new Date,n);return r===null?null:(Sn(t=>new Map(t).set(et(e),r)),n)},En=(e,t)=>{t!==null&&Sn(n=>{if(n.get(e)?.token!==t)return n;let r=new Map(n);return r.delete(e),r})},Dn=(0,Q.useRef)(new Map),On=(0,Q.useRef)(()=>{});On.current=({entry:e,action:t})=>{t!==`merge`&&Tn(e,t)};let kn=(0,Q.useCallback)(e=>{On.current(e)},[]),An=(0,Q.useCallback)(e=>{On.current({entry:e,action:`close`})},[]),{close:jn,closingKeys:Mn}=un(An);(0,Q.useEffect)(()=>{m.length!==0&&hn(e=>{if(e!==null&&e.environmentKey===m)return e;let t=ct(typeof window>`u`?void 0:window.localStorage,m);return t===null?null:{environmentKey:m,scope:t.scope,query:``,data:t.data,...t.partitions===void 0?{}:{partitions:t.partitions}}})},[m]),(0,Q.useEffect)(()=>{if(!Y.data||Y.isPending)return;let e=Y.data;hn(t=>{let n=Ut&&Bt?{authored:[],reviewing:[]}:Ut&&Yt.data!==null&&Zt.data!==null?{authored:Yt.data.entries,reviewing:Zt.data.entries}:t!==null&&t.environmentKey===m&&t.scope===Ye?t.partitions:void 0;if(m.length>0&&ke.length===0){let t=_n?.key===J?_n.entries:e.entries;mt(typeof window>`u`?void 0:window.localStorage,m,{scope:Ye,data:{...e,entries:t,viewers:X.data?.viewers??e.viewers,providers:X.data?.providers??e.providers},...n===void 0?{}:{partitions:n}})}return{environmentKey:m,scope:Ye,query:ke,data:{...e,entries:_n?.key===J?_n.entries:e.entries},...n===void 0?{}:{partitions:n}}})},[m,Ye,ke,Y.data,Y.isPending,Bt,Ut,Yt.data,Zt.data,_n,J,X.data]);let Nn=(0,Q.useMemo)(()=>{if(Z===null||Z.environmentKey!==m||Z.scope===Ye)return null;let e=Mt(Z.data.entries,{state:n.state,projectId:x,host:n.host});return e.length===0?null:{...Z.data,entries:e}},[m,Z,Ye,x,n.host,n.state]),Pn=(ke.length===0&&Ft===null&&Pt===pr?X.data:Y.data)??(Z?.scope===Ye&&Z.query===ke?Z.data:null),Fn=(ke.length===0?X.data:void 0)??(Z?.scope===Ye?Z.data:null)??Nn,In=Pn??Fn,Ln=Pn===null&&Fn!==null,Rn=Y.isPending&&In!==null,zn=Y.isPending&&In===null;(0,Q.useEffect)(()=>{!Pn||Y.isPending||Y.error&&Y.data===null||(bn(e=>{if(e===null||e.key!==J)return{key:J,entries:st(Pn.entries,Fe.text)};if(Ft!==null){let t=new Set(e.entries.map(et)),n=Pn.entries.filter(e=>!t.has(et(e))),r=st(n.toSorted((e,t)=>t.updatedAt.localeCompare(e.updatedAt)),Fe.text);return{key:J,entries:[...e.entries,...r]}}return{key:J,entries:dt(e.entries,st(Pn.entries,Fe.text),et)}}),Sn(e=>$e(e,Pn.entries,et,Date.now())))},[Pn,J,Ft,Fe.text,Y.isPending,Y.error,Y.data]);let Bn=Pn?.nextCursors??{},Vn=(Pn?.truncatedEnvironments??[]).filter(e=>Bn[e]===void 0),Un=!Ln&&Object.keys(Bn).length>0,Wn=()=>{tt(Un?{key:J,size:Vn.length===0?Pt:Math.min(Pt+pr,mr),cursors:Bn,regrown:Vn}:{key:J,size:Math.min(Pt+pr,mr),cursors:null,regrown:[]})},Gn=(e=!1,t)=>{let n=(e?[...zt,...Vt,...Jt.authored,...Jt.reviewing]:[]).filter(({environmentId:e})=>t===void 0||e===t);if(Ft===null){Y.refresh([...Lt.filter(({environmentId:e})=>t===void 0||e===t),...n]);return}n.length>0&&Y.refresh(n);let r=_n?.key===J?_n.entries.length:Pt;tt({key:J,regrown:[],size:Math.min(Math.max(Pt,Math.ceil(r/pr)*pr),mr),cursors:null})},Kn=(0,Q.useRef)(``),qn=(0,Q.useEffectEvent)(()=>{Ft!==null&&Gn()});(0,Q.useEffect)(()=>{Je.length!==0&&Kn.current!==Je&&(Kn.current=Je,qn())},[Je]),ve(()=>{Gn(!0)},{enabled:g});let Jn=X.data?.viewers??In?.viewers??hr,Yn=X.data?.errors??In?.errors??[],Xn=(0,Q.useMemo)(()=>yt([...Ht.data?.entries??[],...X.data?.entries??In?.entries??[]],n.state),[X.data?.entries,Ht.data?.entries,In?.entries,n.state]),Zn=(0,Q.useMemo)(()=>new Set((X.data?.providers??In?.providers??[]).flatMap(e=>e.searchesOnHost?[e.host]:[])),[X.data?.providers,In?.providers]),Qn=(0,Q.useMemo)(()=>{let e=_n?.key===J?_n.entries:In?.entries??[],t=Et(e,Jn,n.involvement),r=He?t.filter(e=>bt(e,Ve,At(e,Jn))):t;if(Pe.text.length===0)return r.toSorted((e,t)=>t.updatedAt.localeCompare(e.updatedAt));let i=Me&&!Ln;return r.filter(e=>i&&Zn.has(e.host)||gt(e,Pe.text))},[J,He,Ve,In,_n,Me,n.involvement,Zn,Ln,Pe.text,Jn]),$n=(0,Q.useMemo)(()=>Object.fromEntries(Qn.map(e=>[me(e),{state:e.state,isDraft:e.isDraft}])),[Qn]),tr=(0,Q.useRef)(null),nr=(0,Q.useMemo)(()=>{if(n.involvement!==`all`)return[{key:`others`,label:``,entries:Qn}];if(Bt)return xt(Qn,Jn);let e=Z!==null&&Z.environmentKey===m&&Z.scope===Ye?Z.partitions:void 0,t=e=>e===void 0||!He?e:e.filter(e=>bt(e,Ve,At(e,Jn))),r=t(Ut?Yt.data?.entries??e?.authored:void 0),i=t(Ut?Zt.data?.entries??e?.reviewing:void 0);return r===void 0||i===void 0?xt(Qn,Jn):jt(Qn,r,i)},[He,Bt,Ve,Yt.data?.entries,Qn,m,Z,Ut,Zt.data?.entries,Ye,n.involvement,Jn]),rr=(0,Q.useRef)(new Map);rr.current=new Map(nr.flatMap(e=>e.entries.map(e=>[et(e),e])));let ir=(0,Q.useRef)({key:J,values:new Set}),[ar,sr]=(0,Q.useState)(()=>new Map),Sr=(0,Q.useRef)(ar);Sr.current=ar;let[Tr,Er]=(0,Q.useState)({key:J,batches:[]}),Or=Tr.key===J?Tr.batches:[],kr=(0,Q.useMemo)(()=>Or.map(({environmentId:e,input:t})=>({environmentId:e,input:t})),[Or]),Ar=(0,Q.useRef)(null),jr=(0,Q.useRef)(new Set),Mr=(0,Q.useRef)(!0),Nr=(0,Q.useRef)(i);Nr.current=i;let Pr=(0,Q.useCallback)(e=>{if(e!==null&&typeof IntersectionObserver<`u`)return jr.current.add(e),Ar.current?.observe(e),()=>{jr.current.delete(e),Ar.current?.unobserve(e);let t=e.dataset.pullRequestStatsKey,n=ir.current;Nr.current===`visible`&&t!==void 0&&n.values.delete(t)&&!Mr.current&&Er(e=>{if(e.key!==n.key)return e;let t=ot(e.batches,n.values);return t.length===e.batches.length?e:{key:e.key,batches:t}})}},[]);(0,Q.useEffect)(()=>{i===`eager`&&Er(e=>{let t=e.key===J?e.batches:[],n=St({entriesByKey:rr.current,candidateKeys:ir.current.values,policy:i,activeBatches:t,statsByRow:Sr.current});return n.length===0&&e.key===J?e:{key:J,batches:[...t,...n]}})},[J,nr,i]),(0,Q.useEffect)(()=>{if(i!==`visible`||typeof IntersectionObserver>`u`)return;ir.current={key:J,values:new Set};let e=new IntersectionObserver(e=>{let t=ir.current;if(t.key!==J)return;let n=!1,r=new Set;for(let i of e){let e=i.target.dataset.pullRequestStatsKey;if(e===void 0)continue;let a=t.values.has(e);i.isIntersecting&&rr.current.has(e)?(t.values.add(e),a||r.add(e)):t.values.delete(e),n||=a!==t.values.has(e)}n&&Er(e=>{let n=e.key===J?e.batches:[],a=Mr.current?n:ot(n,t.values),o=St({entriesByKey:rr.current,candidateKeys:r,policy:i,activeBatches:n,statsByRow:Sr.current});return o.length===0&&a.length===n.length?e:{key:J,batches:[...a,...o]}})},{root:tr.current,rootMargin:`480px`});Ar.current=e;for(let t of jr.current)e.observe(t);return()=>{e.disconnect(),Ar.current===e&&(Ar.current=null)}},[J,i]);let Fr=Ot(kr);Mr.current=Fr.isPending,(0,Q.useEffect)(()=>{if(i!==`visible`||Fr.isPending)return;let e=ir.current;Er(t=>{if(t.key!==J||e.key!==J)return t;let n=ot(t.batches,e.values);return n.length===t.batches.length?t:{key:t.key,batches:n}})},[J,i,Fr.isPending]),(0,Q.useEffect)(()=>{let e=Fr.stats;e!==null&&sr(t=>kt(t,e))},[Fr.stats]);let Ir=(0,Q.useMemo)(()=>{let e=nr.map(e=>{let t=vt(e.entries.map(e=>it(e,ar)),xn,et,n.state);return{...e,entries:He&&xn.size>0?t.filter(e=>!xn.has(et(e))||bt(e,Ve,At(e,Jn))):t}});return ht(e,r,Pe.text,e=>e.additions+e.deletions>0||ar.has(ft(e)),n.involvement)},[nr,He,Ve,xn,n.involvement,n.state,r,ar,Pe.text,Jn]),Lr=Ir.reduce((e,t)=>e+t.entries.length,0),[Rr,zr]=(0,Q.useState)([]);(0,Q.useEffect)(()=>{Pn!==null&&zr(e=>n.host===void 0||e.length===0?Pn.providers:e)},[Pn,n.host]);let Br=Rr.length>1,Vr=(0,Q.useMemo)(()=>nt(Rr),[Rr]),[Hr,Ur]=(0,Q.useState)(()=>new Set),Wr=(0,Q.useRef)(null),Gr=(0,Q.useMemo)(()=>new Map(Ir.flatMap(e=>e.entries.map(t=>[et(t),{entry:t,groupKey:e.key}]))),[Ir]),Kr=(0,Q.useRef)({displayGroups:Ir,closeSweepRows:Gr,closingKeys:Mn,closeBatch:jn,hostActionsOf:Vr});Kr.current={displayGroups:Ir,closeSweepRows:Gr,closingKeys:Mn,closeBatch:jn,hostActionsOf:Vr},(0,Q.useEffect)(()=>()=>Wr.current?.cancel(),[J,n.q,r]),(0,Q.useEffect)(()=>{let e=e=>{e.key===`Escape`&&Wr.current!==null&&(e.preventDefault(),Wr.current.cancel())};return document.addEventListener(`keydown`,e,!0),()=>document.removeEventListener(`keydown`,e,!0)},[]);let qr=(0,Q.useCallback)((e,t)=>{Wr.current?.cancel();let n=et(e),r=Kr.current.displayGroups.find(e=>e.entries.some(e=>et(e)===n));if(!r||Kr.current.closingKeys.has(n))return;let i=Kr.current.displayGroups.flatMap(e=>e.entries.map(et)),a=e=>{let t=Kr.current.closeSweepRows.get(e);return t?.groupKey===r.key&&t.entry.state===`open`&&Kr.current.hostActionsOf(t.entry).has(`close`)&&!Kr.current.closingKeys.has(e)&&!tr.current?.querySelector(`[data-pull-request-key="${CSS.escape(e)}"] [data-pull-request-action-pending="true"]`)},o=[],s=null,c=e=>{e!==s&&(s=e,o=Rt(i,n,e,a),Ur(new Set(o)))};Wr.current=new mn({active:n,event:t,options:{distance:6,onAttach:()=>{},onFinish:()=>{Wr.current=null,Ur(new Set)}},onPending:()=>{},onStart:()=>c(n),onMove:({y:e})=>{let t=tr.current;if(!t)return;let n=t.getBoundingClientRect(),r=Math.min(Math.max(e,n.top),n.bottom-1),i=null;for(let e of t.querySelectorAll(`[data-pull-request-key]`)){if(i!==null&&e.getBoundingClientRect().top>r)break;i=e.dataset.pullRequestKey??null}i!==null&&c(i)},onEnd:()=>{let e=o.filter(a).flatMap(e=>{let t=Kr.current.closeSweepRows.get(e);return t?[t.entry]:[]});Kr.current.closeBatch(e)},onCancel:()=>{},onAbort:()=>{}})},[]),Jr=(0,Q.useMemo)(()=>new Map(nr.flatMap(e=>e.entries.map(e=>[xr(e),e]))),[nr]),Yr=(0,Q.useMemo)(()=>new Map(Ir.flatMap(e=>e.entries.map(e=>[xr(e),e]))),[Ir]),Xr=(0,Q.useMemo)(()=>n.repository&&n.number&&A?{environmentId:A.environmentId,repository:n.repository,number:n.number,projectId:A.id,...T?{host:T}:{}}:null,[n.number,n.repository,A,T]),Zr=P!==null,[Qr,$r]=(0,Q.useState)(!1),ei=N.isOpen&&Qr;!N.isOpen&&Qr&&$r(!1);let ti=()=>{N.isOpen&&$r(e=>!e)},ni=(0,Q.useCallback)(()=>$r(!0),[]);(0,Q.useEffect)(()=>{g&&j!==null&&Xr!==null&&W.getState().openPullRequest(j,Xr)},[Xr,g,j]);let ri=N.isOpen&&I!==null?{environmentId:I.environmentId,repository:I.repository,number:I.number,projectId:I.projectId,host:I.host??(A?.repositoryIdentity?F(A.repositoryIdentity,A.repositoryIdentity.provider):void 0)}:null,ii=e=>Se(e===null?we:{repository:e.repository,number:e.number,selectedProjectId:e.projectId,selectedHost:e.host,...e.environmentId===void 0?{}:{selectedEnvironmentId:e.environmentId}}),ai=()=>{j!==null&&(N.isOpen?(W.getState().close(j),Se(we)):P!==null&&(W.getState().show(j),ii(P)))},oi=(0,Q.useMemo)(()=>{let e=new Map;for(let t of y){let n=t.repositoryIdentity?.provider;if(n===void 0)continue;let r=F(t.repositoryIdentity,n);e.has(r)||e.set(r,{host:r,kind:n})}return[...e.values()]},[y]),si=(0,Q.useMemo)(()=>new Map(Yn.map(e=>[wn({id:e.projectId,environmentId:e.environmentId}),e.message])),[Yn]),ci=(0,Q.useCallback)(e=>{j!==null&&(W.getState().openPullRequest(j,e),Se({repository:e.repository,number:e.number,selectedProjectId:e.projectId,selectedEnvironmentId:e.environmentId,selectedHost:e.host}))},[j,Se]),li=(0,$.jsx)(yn,{value:n.q??``,busy:q.length>0&&(!Me||Ln),onChange:e=>K({q:e||void 0})}),ui=(0,$.jsx)(je,{showTerminalControl:!1,showThreadPanelControl:!1,terminalAvailable:!1,terminalOpen:!1,terminalShortcutLabel:null,threadPanelOpen:!1,threadPanelPresentation:`inline`,threadPanelShortcutLabel:null,onToggleThreadPanel:()=>void 0,rightPanelAvailable:Zr,rightPanelOpen:N.isOpen,rightPanelShortcutLabel:qe(o,`rightPanel.toggle`),rightPanelUnavailableLabel:`Select a pull request first`,rightPanelTabCount:N.surfaces.length,onToggleTerminal:()=>void 0,onToggleRightPanel:ai}),di=(0,$.jsxs)(`div`,{className:`absolute top-[var(--workspace-controls-top)] right-[var(--workspace-controls-right)] z-50 mr-px flex h-[var(--workspace-topbar-height)] items-center gap-1 [-webkit-app-region:no-drag]`,"data-workspace-titlebar-controls":!0,children:[N.isOpen?(0,$.jsx)(De,{maximized:ei,onToggle:ti}):null,ui]}),fi=Ln&&Y.isPending&&Lr===0&&q.length===0,pi=(0,$.jsxs)($.Fragment,{children:[h?g?zn?(0,$.jsx)(ye,{rows:7}):Y.error&&Lr===0?(0,$.jsx)(Te,{error:Y.error,refreshing:Y.isPending,onRetry:()=>Y.refresh()}):fi?(0,$.jsx)(ye,{rows:7}):Lr===0?(0,$.jsx)(Hn,{hasProjects:!v||y.length>0,refreshing:pn,onRefresh:()=>void fn(),query:q,filtered:Le||n.state!==`open`||n.involvement!==`all`||x!==void 0||n.host!==void 0,searching:q.length>0&&(!Me||Ln),canLoadMore:In?.truncated===!0&&(Un||Pt<mr),loadingMore:Rn,onClearQuery:()=>K({q:void 0}),onLoadMore:Wn}):(0,$.jsx)(`div`,{className:te(`space-y-3`,Hr.size>0&&`**:pointer-events-none`),children:Ir.map(e=>(0,$.jsxs)(`div`,{className:`space-y-0.5`,children:[e.label?(0,$.jsx)(cr,{group:e}):null,e.entries.map(e=>{let n=et(e);return(0,$.jsx)(er,{statsKey:n,statsRef:Pr,entry:e,showProjectTitle:!0,showProvider:Br,...l.length>1&&b.get(e.environmentId)!==void 0?{environmentLabel:b.get(e.environmentId)}:{},matchedElsewhere:Pe.text.length>0&&Nt(e,Pe.text)<=fr,selected:ri?.environmentId===e.environmentId&&ri.repository===e.repository&&ri.host?.toLowerCase()===e.host.toLowerCase()&&ri.number===e.number,onSelect:ci,speedMode:t,hostActions:Vr(e),onActed:kn,closing:Mn.has(n),sweeping:Hr.has(n),onCloseSweepStart:qr},n)})]},e.key))}):(0,$.jsx)(Te,{title:`Pull requests unavailable`,error:`Update your P4 Code servers to browse pull requests.`}):(0,$.jsx)(ye,{rows:7}),Y.error&&Lr>0?(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-3 rounded-lg border border-warning/30 bg-warning-surface px-3 py-2 text-xs`,children:[(0,$.jsxs)(`span`,{children:[Y.error,` Showing the last pull requests loaded.`]}),(0,$.jsx)(C,{size:`xs`,variant:`outline`,onClick:()=>Y.refresh(),children:`Retry`})]}):null,In?.truncated&&Qn.length>0?(0,$.jsx)(`div`,{className:`flex justify-center py-3 text-xs text-muted-foreground`,children:Rn?(0,$.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,$.jsx)(B,{"aria-hidden":!0,size:`sm`}),Ft===null?`Updating pull requests`:`Loading more`]}):Un||Pt<mr?(0,$.jsx)(C,{size:`sm`,variant:`outline`,onClick:Wn,disabled:Y.isPending||Ln,children:`Load more pull requests`}):(0,$.jsx)(`span`,{children:`Narrow your search to find more pull requests.`})}):null]}),mi=Rr.length>0?Rr:oi,hi=[{value:``,label:`All`,Icon:ee},...mi.map(e=>{let t=Rr.find(t=>t.host===e.host);return{value:e.host,label:vn(mi,e),Icon:cn(e.kind).Icon,...t===void 0||t.configured?{}:{unavailable:t.detail??`This host could not be read.`}}})],gi=[{value:``,label:`All servers`,Icon:f},...l.map(e=>({value:e.environmentId,label:e.label,Icon:Xt(c(e.serverConfig))}))],_i=(0,$.jsx)(wr,{label:`Sort pull requests`,triggerIcon:(0,$.jsx)(k,{"aria-hidden":!0,className:`size-4`}),triggerLabel:`Sort`,outlined:!0,value:r,options:rn,onChange:e=>K({sort:e})}),vi=(0,$.jsx)(Cr,{onOpenChange:Oe,state:n.state,stateOptions:ur,onState:e=>K({state:e}),involvement:n.involvement,involvementOptions:lr,onInvolvement:e=>K({involvement:e}),filters:Ie,onFilters:e=>K({draft:e.draft,review:e.review,checks:e.checks,author:e.author,labels:e.labels?.flatMap(e=>e)}),authorOptions:Xn.authors,labelOptions:Xn.labels,host:n.host,hostOptions:hi,onHost:e=>K({host:e}),server:u??void 0,serverOptions:gi,onServer:e=>K({environmentId:e,projectId:void 0}),projects:w,projectId:x,projectEnvironmentId:S?.environmentId,unavailable:si,onProject:(e,t)=>K(t===void 0?{projectId:e}:{projectId:e,environmentId:t})}),yi={refreshing:pn,onRefresh:()=>void fn(),searchValue:n.q??``,involvement:n.involvement,state:n.state,host:n.host,hostMenuOptions:hi,onInvolvement:e=>K({involvement:e}),onState:e=>K({state:e}),onHost:e=>K({host:e}),searchInput:li,sortMenu:_i,filtersMenu:vi,rightPanelControl:g?(0,$.jsx)(`span`,{"aria-hidden":!0,className:te(`shrink-0`,N.isOpen?`-ml-3 w-0`:`w-7 sm:w-5`,L&&`transition-[width,margin] ease-out`),style:L?{transitionDuration:`${R}ms`}:void 0}):null,titlebarControls:g?U?(0,$.jsx)(`span`,{"aria-hidden":!0,className:`pointer-events-none absolute inset-y-0 left-full w-7 [-webkit-app-region:no-drag]`}):di:null,rightPanelOpen:N.isOpen,maximizedAway:ei,listBody:pi,scrollRef:tr},bi=e=>{j!==null&&(W.getState().activateSurface(j,e.id),ii(e))},xi=e=>{if(j===null)return;W.getState().closeSurface(j,e.id);let t=pe(W.getState().byThreadKey,j);ii(t?.kind===`pull-request`?t:null)},Si=e=>{j!==null&&(W.getState().closeOtherSurfaces(j,e.id),ii(e))},Ci=e=>{if(j===null)return;W.getState().closeSurfacesToRight(j,e.id);let t=pe(W.getState().byThreadKey,j);ii(t?.kind===`pull-request`?t:null)},wi=()=>{j!==null&&(W.getState().closeAllSurfaces(j),ii(null))},Ti=(0,Q.useEffectEvent)(e=>{if(!M||(e.preventDefault(),e.stopPropagation(),e.repeat))return;let t=M;oe(t,`pull request link`).then(e=>{e&&H.add({type:`success`,title:`PR link copied`,description:t})},e=>{H.add({type:`error`,title:`Failed to copy PR link`,description:e instanceof Error?e.message:`An error occurred.`})})}),Ei=(0,Q.useEffectEvent)(e=>{I!==null&&(e.preventDefault(),e.stopPropagation(),e.repeat||xi(I))}),Di=(0,Q.useEffectEvent)(e=>{Zr&&(e.preventDefault(),e.stopPropagation(),e.repeat||ai())}),Oi=(0,Q.useEffectEvent)(e=>{N.isOpen&&(e.preventDefault(),e.stopPropagation(),e.repeat||ti())});return(0,Q.useEffect)(()=>{let e=e=>{if(e.defaultPrevented||an())return;let t=Ke(e,o,{context:or()});t===`rightPanel.close`&&Ei(e),t===`rightPanel.toggle`&&Di(e),t===`rightPanel.toggleMaximized`&&Oi(e),t===`thread.copyReference`&&Ti(e)};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[o]),(0,$.jsx)(Be,{className:`h-dvh min-h-0 overflow-hidden overscroll-y-none`,children:(0,$.jsxs)(`div`,{className:`relative flex min-h-0 flex-1`,children:[g&&U?di:null,(0,$.jsx)(Dr,{...yi}),U&&G&&xe!==null?(0,$.jsx)(Ae,{mode:`inline`,open:N.isOpen,maximized:ei,keybindings:o,getShortcutContext:or,widthStorageKey:`p4code:pull-request-panel-width`,defaultWidth:typeof window>`u`?640:Math.floor(window.innerWidth/2),surfaces:be,environmentId:xe,activeSurfaceId:G.id,pendingSurfaceIds:br,previewSessions:_r,desktopByTabId:vr,terminalLabelsById:yr,onActivate:e=>{e.kind===`pull-request`&&bi(e)},onCloseSurface:e=>{e.kind===`pull-request`&&xi(e)},onCloseOtherSurfaces:e=>{e.kind===`pull-request`&&Si(e)},onCloseSurfacesToRight:e=>{e.kind===`pull-request`&&Ci(e)},onCloseAllSurfaces:wi,onMoveSurface:(e,t)=>{j!==null&&W.getState().moveSurface(j,e,t)},onCopyFilePath:()=>void 0,onAddBrowser:()=>void 0,onAddBrowserInProfile:()=>void 0,onAddTerminal:()=>void 0,onAddDiff:()=>void 0,onAddFiles:()=>void 0,onAddPullRequest:()=>void 0,onAddPullRequests:()=>void 0,onAddDevice:()=>void 0,browserAvailable:!1,terminalAvailable:!1,diffAvailable:!1,filesAvailable:!1,pullRequestAvailable:!1,pullRequestsAvailable:!1,deviceAvailable:!1,pullRequestStatusSeeds:$n,children:(0,$.jsx)(Ce,{getShortcutContext:or,shortcutsEnabled:I?.id===G.id,environmentId:xe,onGuideShown:ni,onSelectPullRequest:e=>{j!==null&&(W.getState().openPullRequest(j,{projectId:e.projectId,repository:e.repository,number:e.number,...e.host?{host:e.host}:{},environmentId:xe}),Se({repository:e.repository,number:e.number,selectedHost:e.host,selectedProjectId:e.projectId,selectedEnvironmentId:xe}))},reference:{projectId:G.projectId,repository:G.repository,number:G.number,...G.host?{host:G.host}:{}},listEntry:Yr.get(xr(G))??null,refreshToken:$t,onActed:(e,t=`done`)=>{let n=Jr.get(xr(G));if(e!==void 0&&n!==void 0&&lt(n,e,new Date,0)!==null){let r=et(n);t===`sent`&&e!==`merge`&&Dn.current.set(r,Tn(n,e)),t===`failed`&&e!==`merge`&&En(r,Dn.current.get(r)??null),t!==`sent`&&Dn.current.delete(r),t===`done`&&e===`merge`&&(Tn(n,e),dn(void 0,xe))}else t===`done`&&dn(void 0,xe)}},G.id)}):null]})})}function Cr(e){let t=(0,Z.c)(6),n=tr(),r;t[0]!==e.projects||t[1]!==n?(r=Vt(e.projects,n),t[0]=e.projects,t[1]=n,t[2]=r):r=t[2];let i=r,a;return t[3]!==i||t[4]!==e?(a=(0,$.jsx)(Ln,{...e,projects:i}),t[3]=i,t[4]=e,t[5]=a):a=t[5],a}function wr(e){let t=(0,Z.c)(30),{label:n,triggerIcon:r,triggerLabel:i,outlined:o,iconOnly:s,value:c,options:l,onChange:u,className:d}=e,f=o!==void 0&&o,p=s!==void 0&&s,m;t[0]!==l||t[1]!==c?(m=l.find(e=>e.value===c)??l[0],t[0]=l,t[1]=c,t[2]=m):m=t[2];let g=m;if(!g)return null;let _=i||p?`${n}: ${g.label}`:n,v=p?`${n}: ${g.label}`:void 0,y;t[3]!==p||t[4]!==f?(y=f?(0,$.jsx)(C,{variant:`outline`,size:p?`icon`:`default`}):(0,$.jsx)(C,{variant:`ghost-muted`,size:`sm`}),t[3]=p,t[4]=f,t[5]=y):y=t[5];let b;t[6]===d?b=t[7]:(b=te(`min-w-0`,d),t[6]=d,t[7]=b);let x;t[8]!==g||t[9]!==p||t[10]!==r||t[11]!==i?(x=p?(0,$.jsx)(g.Icon,{"aria-hidden":!0,className:`size-4`}):i?(0,$.jsxs)($.Fragment,{children:[r,(0,$.jsx)(`span`,{children:i})]}):(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`span`,{className:`truncate`,children:g.label}),(0,$.jsx)(a,{"aria-hidden":!0,className:`size-3 shrink-0 text-muted-foreground/70`})]}),t[8]=g,t[9]=p,t[10]=r,t[11]=i,t[12]=x):x=t[12];let S;t[13]!==_||t[14]!==v||t[15]!==y||t[16]!==b||t[17]!==x?(S=(0,$.jsx)(P,{"aria-label":_,title:v,render:y,className:b,children:x}),t[13]=_,t[14]=v,t[15]=y,t[16]=b,t[17]=x,t[18]=S):S=t[18];let w;t[19]===u?w=t[20]:(w=e=>u(e),t[19]=u,t[20]=w);let T;t[21]===l?T=t[22]:(T=l.map(Tr),t[21]=l,t[22]=T);let E;t[23]!==w||t[24]!==T||t[25]!==c?(E=(0,$.jsx)(ne,{align:`start`,side:`bottom`,children:(0,$.jsx)(O,{value:c,onValueChange:w,children:T})}),t[23]=w,t[24]=T,t[25]=c,t[26]=E):E=t[26];let D;return t[27]!==E||t[28]!==S?(D=(0,$.jsxs)(h,{children:[S,E]}),t[27]=E,t[28]=S,t[29]=D):D=t[29],D}function Tr(e){let t=(0,$.jsx)(A,{value:e.value,disabled:e.unavailable!==void 0,className:`data-disabled:pointer-events-auto`,children:(0,$.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[(0,$.jsx)(_n,{option:e}),e.label]})},e.value);return e.unavailable===void 0?t:(0,$.jsxs)(ze,{children:[(0,$.jsx)(Le,{render:t}),(0,$.jsx)(Re,{side:`right`,children:e.unavailable})]},e.value)}function Er(e){let t=(0,Z.c)(21),{searchInput:n,searchValue:r,open:i,onOpenChange:a,focusToken:o,onFocusWithin:s}=e,c=(0,Q.useRef)(null),l,u;t[0]===i?(l=t[1],u=t[2]):(l=()=>{i&&c.current?.querySelector(`input`)?.focus()},u=[i],t[0]=i,t[1]=l,t[2]=u),(0,Q.useEffect)(l,u);let d=(0,Q.useRef)(o),f,p;if(t[3]===o?(f=t[4],p=t[5]):(f=()=>{if(d.current===o)return;d.current=o;let e=c.current?.querySelector(`input`);e?.focus(),e?.select()},p=[o],t[3]=o,t[4]=f,t[5]=p),(0,Q.useEffect)(f,p),i||r.length>0){let e;t[6]===s?e=t[7]:(e=()=>s?.(!0),t[6]=s,t[7]=e);let i;t[8]!==s||t[9]!==a||t[10]!==r.length?(i=()=>{s?.(!1),r.length===0&&a(!1)},t[8]=s,t[9]=a,t[10]=r.length,t[11]=i):i=t[11];let o;return t[12]!==n||t[13]!==e||t[14]!==i?(o=(0,$.jsx)(`div`,{ref:c,className:`w-56 min-w-24 shrink`,onFocus:e,onBlur:i,children:n}),t[12]=n,t[13]=e,t[14]=i,t[15]=o):o=t[15],o}let m;t[16]===a?m=t[17]:(m=()=>a(!0),t[16]=a,t[17]=m);let h;t[18]===Symbol.for(`react.memo_cache_sentinel`)?(h=(0,$.jsx)(E,{className:`size-4`}),t[18]=h):h=t[18];let g;return t[19]===m?g=t[20]:(g=(0,$.jsx)(C,{size:`icon-sm`,variant:`ghost`,"aria-label":`Search pull requests`,onClick:m,children:h}),t[19]=m,t[20]=g),g}function Dr(e){let t=(0,Z.c)(69),{refreshing:n,onRefresh:r,searchValue:i,involvement:a,state:o,host:s,hostMenuOptions:c,onInvolvement:l,onState:u,onHost:d,searchInput:f,sortMenu:p,filtersMenu:m,rightPanelControl:h,titlebarControls:g,rightPanelOpen:_,maximizedAway:v,listBody:y,scrollRef:b}=e,x=(0,Q.useRef)(null),[S,C]=(0,Q.useState)(!1),w;t[0]===b?w=t[1]:(w=()=>{let e=x.current;if(!e)return;let t=new IntersectionObserver(e=>{let[t]=e;return C(t?!t.isIntersecting:!1)},{root:b.current});return t.observe(e),()=>t.disconnect()},t[0]=b,t[1]=w);let T;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(T=[],t[2]=T):T=t[2],(0,Q.useEffect)(w,T);let E=(0,Q.useRef)(!1),D=(0,Q.useRef)(null),[O,k]=(0,Q.useState)(!1),[A,j]=(0,Q.useState)(0),M=O||i.length>0,N,ne;t[3]===S?(N=t[4],ne=t[5]):(N=()=>{let e=e=>{if(e.defaultPrevented||e.key.toLowerCase()!==`f`||!(e.metaKey||e.ctrlKey)||e.altKey||e.shiftKey)return;if(e.preventDefault(),S){k(!0),j(Or);return}let t=D.current?.querySelector(`input`);t?.focus(),t?.select()};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},ne=[S],t[3]=S,t[4]=N,t[5]=ne),(0,Q.useEffect)(N,ne);let re,P;t[6]===S?(re=t[7],P=t[8]):(re=()=>{if(S||(k(!1),!E.current))return;E.current=!1;let e=D.current?.querySelector(`input`);e&&(e.focus(),e.setSelectionRange(e.value.length,e.value.length))},P=[S],t[6]=S,t[7]=re,t[8]=P),(0,Q.useEffect)(re,P);let F=v?`w-0 flex-none`:`flex-1`,I;t[9]===F?I=t[10]:(I=te(`@container/pr-list flex min-h-0 min-w-0 flex-col overflow-x-hidden bg-background`,F),t[9]=F,t[10]=I);let L=!_,R;t[11]!==S||t[12]!==s||t[13]!==c||t[14]!==a||t[15]!==d||t[16]!==l||t[17]!==u||t[18]!==M||t[19]!==o?(R=S?(0,$.jsxs)(pn,{ariaLabel:`Pull request scope`,className:`overflow-hidden`,children:[(0,$.jsx)(dn,{current:!0,className:te(M&&`sr-only`),children:(0,$.jsx)(`h1`,{className:`truncate`,children:`Pull Requests`})}),M?null:(0,$.jsx)(fn,{}),(0,$.jsxs)(dn,{className:`shrink gap-1.5`,children:[(0,$.jsx)(wr,{label:`Filter by state`,value:o,options:ur,onChange:u,className:`shrink-0`}),(0,$.jsx)(wr,{label:`Filter by involvement`,value:a,options:lr,onChange:l}),c.length>2?(0,$.jsx)(wr,{label:`Filter by host`,value:s??``,options:c,onChange:e=>d(e===``?void 0:e)}):null]})]}):(0,$.jsx)(pn,{ariaLabel:`Pull requests breadcrumb`,children:(0,$.jsx)(dn,{current:!0,children:(0,$.jsx)(`h1`,{className:`truncate`,children:`Pull Requests`})})}),t[11]=S,t[12]=s,t[13]=c,t[14]=a,t[15]=d,t[16]=l,t[17]=u,t[18]=M,t[19]=o,t[20]=R):R=t[20];let z;t[21]===Symbol.for(`react.memo_cache_sentinel`)?(z=(0,$.jsx)(`div`,{className:`min-w-0 flex-1`}),t[21]=z):z=t[21];let ie;t[22]!==S||t[23]!==r||t[24]!==n||t[25]!==A||t[26]!==f||t[27]!==O||t[28]!==i?(ie=S?(0,$.jsxs)(`div`,{className:`flex shrink items-center gap-1.5`,children:[(0,$.jsx)(Er,{searchInput:f,searchValue:i,open:O,onOpenChange:k,focusToken:A,onFocusWithin:e=>{E.current=e}}),(0,$.jsx)(kr,{compact:!0,refreshing:n,onRefresh:r})]}):null,t[22]=S,t[23]=r,t[24]=n,t[25]=A,t[26]=f,t[27]=O,t[28]=i,t[29]=ie):ie=t[29];let B;t[30]!==h||t[31]!==R||t[32]!==ie||t[33]!==L||t[34]!==g?(B=(0,$.jsxs)(ln,{electron:Ie,reserveNativeControls:L,className:`relative bg-background`,children:[g,R,z,ie,h]}),t[30]=h,t[31]=R,t[32]=ie,t[33]=L,t[34]=g,t[35]=B):B=t[35];let V;t[36]===f?V=t[37]:(V=(0,$.jsx)(`div`,{className:`min-w-0 basis-full @lg/pr-list:basis-0 @lg/pr-list:flex-1`,children:f}),t[36]=f,t[37]=V);let ae=s!==void 0,H;t[38]===Symbol.for(`react.memo_cache_sentinel`)?(H=(0,$.jsx)(ee,{"aria-hidden":!0,className:`size-4`}),t[38]=H):H=t[38];let oe=s??``,se;t[39]===d?se=t[40]:(se=e=>d(e===``?void 0:e),t[39]=d,t[40]=se);let ce;t[41]!==c||t[42]!==ae||t[43]!==oe||t[44]!==se?(ce=(0,$.jsx)(wr,{label:`Filter by provider`,outlined:!0,iconOnly:ae,triggerIcon:H,triggerLabel:`All`,value:oe,options:c,onChange:se}),t[41]=c,t[42]=ae,t[43]=oe,t[44]=se,t[45]=ce):ce=t[45];let le;t[46]!==S||t[47]!==r||t[48]!==n?(le=S?null:(0,$.jsx)(kr,{refreshing:n,onRefresh:r}),t[46]=S,t[47]=r,t[48]=n,t[49]=le):le=t[49];let U;t[50]!==m||t[51]!==p||t[52]!==V||t[53]!==ce||t[54]!==le?(U=(0,$.jsxs)(`div`,{ref:D,className:`flex flex-wrap items-center gap-2`,children:[V,p,m,ce,le]}),t[50]=m,t[51]=p,t[52]=V,t[53]=ce,t[54]=le,t[55]=U):U=t[55];let ue;t[56]===Symbol.for(`react.memo_cache_sentinel`)?(ue=(0,$.jsx)(`div`,{ref:x,"aria-hidden":!0,className:`-mt-3 h-px w-full`}),t[56]=ue):ue=t[56];let de;t[57]===U?de=t[58]:(de=(0,$.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[U,ue]}),t[57]=U,t[58]=de);let fe;t[59]!==y||t[60]!==de?(fe=(0,$.jsxs)(Zt,{width:`expanded`,className:`min-h-full gap-4`,children:[de,y]}),t[59]=y,t[60]=de,t[61]=fe):fe=t[61];let pe;t[62]!==b||t[63]!==fe?(pe=(0,$.jsx)(`div`,{ref:b,className:`topbar-scroll-fade scrollbar-gutter-both min-h-0 flex-1 overflow-y-auto`,children:fe}),t[62]=b,t[63]=fe,t[64]=pe):pe=t[64];let me;return t[65]!==B||t[66]!==pe||t[67]!==I?(me=(0,$.jsxs)(`div`,{className:I,children:[B,pe]}),t[65]=B,t[66]=pe,t[67]=I,t[68]=me):me=t[68],me}function Or(e){return e+1}function kr(e){let t=(0,Z.c)(8),{compact:n,refreshing:r,onRefresh:i}=e,a=n!==void 0&&n,o=a?`icon-sm`:`icon`,s=a?`ghost`:`outline`,c;t[0]===r?c=t[1]:(c=(0,$.jsx)(en,{size:`md`,refreshing:r}),t[0]=r,t[1]=c);let l;return t[2]!==i||t[3]!==r||t[4]!==o||t[5]!==s||t[6]!==c?(l=(0,$.jsx)(C,{size:o,variant:s,"aria-label":`Refresh pull requests`,onClick:i,disabled:r,children:c}),t[2]=i,t[3]=r,t[4]=o,t[5]=s,t[6]=c,t[7]=l):l=t[7],l}export{Sr as component};
2
+ //# sourceMappingURL=_chat.pull-requests-Alx1g9Xh.js.map
@@ -1,2 +1,2 @@
1
- import{a as e,t}from"./react-BUfh6y28.js";import{n,t as r}from"./jsx-runtime-DJeoFXNw.js";import{Qu as i,t as a}from"./utils-BlwLA0C4.js";var o=n(),s=e(t(),1),c=e(r(),1),l=i(`relative rounded-xl border px-3.5 py-3 text-card-foreground text-sm`,{defaultVariants:{surface:`default`,variant:`default`},variants:{surface:{default:``,glass:`alert-glass`},variant:{default:`bg-transparent dark:bg-input/32 [&_svg]:text-muted-foreground`,sidebar:`rounded-lg border-sidebar-border bg-sidebar-control-surface px-2 py-1.5 text-[11px] leading-4 [&_[data-slot=alert-description]]:block [&_[data-slot=alert-description]]:text-sidebar-muted-foreground`,error:`border-error/32 bg-error-surface text-error-foreground [&_[data-slot=alert-description]]:text-error-foreground/80 [&_svg]:text-error`,info:`border-info/32 bg-info/4 [&_svg]:text-info`,success:`border-success/32 bg-success/4 [&_svg]:text-success`,warning:`border-warning/32 bg-warning-surface text-warning-foreground [&_[data-slot=alert-description]]:text-warning-foreground/80 [&_svg]:text-warning`}}});function u(e){let t=e.props[`data-slot`];if(t)return t;let n=e.type;switch(n.displayName??n.name){case`AlertAction`:return`alert-action`;case`AlertTitle`:return`alert-title`;case`AlertDescription`:return`alert-description`;default:return}}function d(e){let t=(0,o.c)(36),n,r,i,d,f,p;t[0]===e?(n=t[1],r=t[2],i=t[3],d=t[4],f=t[5],p=t[6]):({className:r,variant:p,surface:d,controlAlignment:f,children:n,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=d,t[5]=f,t[6]=p);let m=f===void 0?`center`:f,h,g,_;t[7]===n?(h=t[8],g=t[9],_=t[10]):(_=[],g=[],h=[],s.Children.forEach(n,e=>{if(!(0,s.isValidElement)(e)){g.push(e);return}let t=u(e);t===`alert-action`?h.push(e):t===`alert-title`||t===`alert-description`?g.push(e):_.push(e)}),t[7]=n,t[8]=h,t[9]=g,t[10]=_);let v;t[11]!==r||t[12]!==d||t[13]!==p?(v=a(l({surface:d,variant:p}),r),t[11]=r,t[12]=d,t[13]=p,t[14]=v):v=t[14];let y=p??`default`,b=m===`first-line`?`items-start`:`items-center`,x=m===`first-line`&&h.length>0&&`min-h-7 pt-1 sm:min-h-6 sm:pt-0.5`,S;t[15]!==b||t[16]!==x?(S=a(`flex gap-2`,b,x),t[15]=b,t[16]=x,t[17]=S):S=t[17];let C;t[18]!==m||t[19]!==_?(C=_.length>0&&(0,c.jsx)(`div`,{className:a(`flex shrink-0 items-center justify-center`,m===`first-line`?`h-lh w-4 [&>svg]:size-4`:`size-4 [&>svg]:size-full`),children:_}),t[18]=m,t[19]=_,t[20]=C):C=t[20];let w;t[21]===g?w=t[22]:(w=g.length>0&&(0,c.jsx)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-0.5`,children:g}),t[21]=g,t[22]=w);let T;t[23]!==h||t[24]!==m?(T=h.length>0&&(0,c.jsx)(`div`,{className:a(`flex shrink-0 items-center`,m===`first-line`?`h-lh self-start`:`self-center`),children:h}),t[23]=h,t[24]=m,t[25]=T):T=t[25];let E;t[26]!==S||t[27]!==C||t[28]!==w||t[29]!==T?(E=(0,c.jsxs)(`div`,{className:S,children:[C,w,T]}),t[26]=S,t[27]=C,t[28]=w,t[29]=T,t[30]=E):E=t[30];let D;return t[31]!==i||t[32]!==E||t[33]!==v||t[34]!==y?(D=(0,c.jsx)(`div`,{className:v,"data-slot":`alert`,"data-variant":y,role:`alert`,...i,children:E}),t[31]=i,t[32]=E,t[33]=v,t[34]=y,t[35]=D):D=t[35],D}function f(e){let t=(0,o.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=a(`font-medium`,n),t[3]=n,t[4]=i);let s;return t[5]!==r||t[6]!==i?(s=(0,c.jsx)(`div`,{className:i,"data-slot":`alert-title`,...r}),t[5]=r,t[6]=i,t[7]=s):s=t[7],s}function p(e){let t=(0,o.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=a(`flex flex-col gap-2.5 text-muted-foreground`,n),t[3]=n,t[4]=i);let s;return t[5]!==r||t[6]!==i?(s=(0,c.jsx)(`div`,{className:i,"data-slot":`alert-description`,...r}),t[5]=r,t[6]=i,t[7]=s):s=t[7],s}function m(e){let t=(0,o.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=a(`flex gap-1`,n),t[3]=n,t[4]=i);let s;return t[5]!==r||t[6]!==i?(s=(0,c.jsx)(`div`,{className:i,"data-slot":`alert-action`,...r}),t[5]=r,t[6]=i,t[7]=s):s=t[7],s}f.displayName=`AlertTitle`,p.displayName=`AlertDescription`,m.displayName=`AlertAction`;export{f as i,m as n,p as r,d as t};
2
- //# sourceMappingURL=alert-Cq0DAg5J.js.map
1
+ import{a as e,t}from"./react-BUfh6y28.js";import{n,t as r}from"./jsx-runtime-DJeoFXNw.js";import{Qu as i,t as a}from"./utils-Dv1DrWoz.js";var o=n(),s=e(t(),1),c=e(r(),1),l=i(`relative rounded-xl border px-3.5 py-3 text-card-foreground text-sm`,{defaultVariants:{surface:`default`,variant:`default`},variants:{surface:{default:``,glass:`alert-glass`},variant:{default:`bg-transparent dark:bg-input/32 [&_svg]:text-muted-foreground`,sidebar:`rounded-lg border-sidebar-border bg-sidebar-control-surface px-2 py-1.5 text-[11px] leading-4 [&_[data-slot=alert-description]]:block [&_[data-slot=alert-description]]:text-sidebar-muted-foreground`,error:`border-error/32 bg-error-surface text-error-foreground [&_[data-slot=alert-description]]:text-error-foreground/80 [&_svg]:text-error`,info:`border-info/32 bg-info/4 [&_svg]:text-info`,success:`border-success/32 bg-success/4 [&_svg]:text-success`,warning:`border-warning/32 bg-warning-surface text-warning-foreground [&_[data-slot=alert-description]]:text-warning-foreground/80 [&_svg]:text-warning`}}});function u(e){let t=e.props[`data-slot`];if(t)return t;let n=e.type;switch(n.displayName??n.name){case`AlertAction`:return`alert-action`;case`AlertTitle`:return`alert-title`;case`AlertDescription`:return`alert-description`;default:return}}function d(e){let t=(0,o.c)(36),n,r,i,d,f,p;t[0]===e?(n=t[1],r=t[2],i=t[3],d=t[4],f=t[5],p=t[6]):({className:r,variant:p,surface:d,controlAlignment:f,children:n,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=d,t[5]=f,t[6]=p);let m=f===void 0?`center`:f,h,g,_;t[7]===n?(h=t[8],g=t[9],_=t[10]):(_=[],g=[],h=[],s.Children.forEach(n,e=>{if(!(0,s.isValidElement)(e)){g.push(e);return}let t=u(e);t===`alert-action`?h.push(e):t===`alert-title`||t===`alert-description`?g.push(e):_.push(e)}),t[7]=n,t[8]=h,t[9]=g,t[10]=_);let v;t[11]!==r||t[12]!==d||t[13]!==p?(v=a(l({surface:d,variant:p}),r),t[11]=r,t[12]=d,t[13]=p,t[14]=v):v=t[14];let y=p??`default`,b=m===`first-line`?`items-start`:`items-center`,x=m===`first-line`&&h.length>0&&`min-h-7 pt-1 sm:min-h-6 sm:pt-0.5`,S;t[15]!==b||t[16]!==x?(S=a(`flex gap-2`,b,x),t[15]=b,t[16]=x,t[17]=S):S=t[17];let C;t[18]!==m||t[19]!==_?(C=_.length>0&&(0,c.jsx)(`div`,{className:a(`flex shrink-0 items-center justify-center`,m===`first-line`?`h-lh w-4 [&>svg]:size-4`:`size-4 [&>svg]:size-full`),children:_}),t[18]=m,t[19]=_,t[20]=C):C=t[20];let w;t[21]===g?w=t[22]:(w=g.length>0&&(0,c.jsx)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-0.5`,children:g}),t[21]=g,t[22]=w);let T;t[23]!==h||t[24]!==m?(T=h.length>0&&(0,c.jsx)(`div`,{className:a(`flex shrink-0 items-center`,m===`first-line`?`h-lh self-start`:`self-center`),children:h}),t[23]=h,t[24]=m,t[25]=T):T=t[25];let E;t[26]!==S||t[27]!==C||t[28]!==w||t[29]!==T?(E=(0,c.jsxs)(`div`,{className:S,children:[C,w,T]}),t[26]=S,t[27]=C,t[28]=w,t[29]=T,t[30]=E):E=t[30];let D;return t[31]!==i||t[32]!==E||t[33]!==v||t[34]!==y?(D=(0,c.jsx)(`div`,{className:v,"data-slot":`alert`,"data-variant":y,role:`alert`,...i,children:E}),t[31]=i,t[32]=E,t[33]=v,t[34]=y,t[35]=D):D=t[35],D}function f(e){let t=(0,o.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=a(`font-medium`,n),t[3]=n,t[4]=i);let s;return t[5]!==r||t[6]!==i?(s=(0,c.jsx)(`div`,{className:i,"data-slot":`alert-title`,...r}),t[5]=r,t[6]=i,t[7]=s):s=t[7],s}function p(e){let t=(0,o.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=a(`flex flex-col gap-2.5 text-muted-foreground`,n),t[3]=n,t[4]=i);let s;return t[5]!==r||t[6]!==i?(s=(0,c.jsx)(`div`,{className:i,"data-slot":`alert-description`,...r}),t[5]=r,t[6]=i,t[7]=s):s=t[7],s}function m(e){let t=(0,o.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=a(`flex gap-1`,n),t[3]=n,t[4]=i);let s;return t[5]!==r||t[6]!==i?(s=(0,c.jsx)(`div`,{className:i,"data-slot":`alert-action`,...r}),t[5]=r,t[6]=i,t[7]=s):s=t[7],s}f.displayName=`AlertTitle`,p.displayName=`AlertDescription`,m.displayName=`AlertAction`;export{f as i,m as n,p as r,d as t};
2
+ //# sourceMappingURL=alert-RktpFBv6.js.map
@@ -1,2 +1,2 @@
1
- import{a as e,t}from"./react-BUfh6y28.js";import{n}from"./jsx-runtime-DJeoFXNw.js";import{Ts as r,ns as i,ts as a}from"./utils-BlwLA0C4.js";import{L as o,W as s}from"./runtime-DYpzE3gq.js";import{s as c}from"./vcsRefInvalidation-Bkr613aV.js";import{s as l}from"./session-meZM9Xpf.js";import{c as u,l as d,o as f,t as p,u as m}from"./assets-Dls9s4TR.js";var h=n(),g=e(t(),1);function _(e,t){let n=(0,h.c)(7),r=(0,g.useContext)(i),a=typeof t==`string`?t:t?.label,s=typeof t==`string`?!0:t?.reportFailure??!0,c=typeof t==`string`?!0:t?.reportDefect??!0,l=typeof t==`string`?!1:t?.refresh??!1,u;return n[0]!==a||n[1]!==e||n[2]!==l||n[3]!==r||n[4]!==c||n[5]!==s?(u=t=>{let n=e(t);return o(r,n,{label:a??n.label?.[0]??`atom query`,reportFailure:s,reportDefect:c,refresh:l})},n[0]=a,n[1]=e,n[2]=l,n[3]=r,n[4]=c,n[5]=s,n[6]=u):u=n[6],u}function v(e,t){let n=(0,h.c)(10),r=c(e),i;n[0]!==t||n[1]!==r?(i=d(t,r),n[0]=t,n[1]=r,n[2]=i):i=n[2];let o=i,s=l(e),m;n[3]!==o||n[4]!==e||n[5]!==t?(m=o!==null||e===null||t===null?f:p.createUrl({environmentId:e,input:{resource:t}}),n[3]=o,n[4]=e,n[5]=t,n[6]=m):m=n[6];let g=a(m);if(o!==null)return o;let _=s._tag===`Some`?s.value.httpBaseUrl:null,v;return n[7]!==g||n[8]!==_?(v=u(g,_),n[7]=g,n[8]=_,n[9]=v):v=n[9],v}function y(e,t){let n=(0,h.c)(6),r=l(e),i=r._tag===`Some`?r.value.httpBaseUrl:null,a;n[0]===Symbol.for(`react.memo_cache_sentinel`)?(a={reportFailure:!1,refresh:!0},n[0]=a):a=n[0];let o=_(p.createUrl,a),c;return n[1]!==e||n[2]!==i||n[3]!==o||n[4]!==t?(c=async()=>{if(e===null||t===null||i===null)return null;let n=await o({environmentId:e,input:{resource:t}});if(n._tag===`Failure`)throw s(n);return m(i,n.value.relativeUrl)},n[1]=e,n[2]=i,n[3]=o,n[4]=t,n[5]=c):c=n[5],c}function b(e,t){let n=l(e),{canReadFiles:i}=c(e),o=(0,g.useMemo)(()=>i?t:t.filter(e=>e._tag!==`workspace-file`&&e._tag!==`media-file`&&e._tag!==`draft-workspace-file`),[i,t]),s=a(p.createUrls({environmentId:e,resources:o}));return(0,g.useMemo)(()=>{if(n._tag===`None`)return t.map(()=>null);let e=0;return t.map(t=>{if(!i&&(t._tag===`workspace-file`||t._tag===`media-file`||t._tag===`draft-workspace-file`))return null;let a=s[e++];return a&&r(a)?m(n.value.httpBaseUrl,a.value.relativeUrl):null})},[i,n,t,s])}export{_ as i,v as n,b as r,y as t};
2
- //# sourceMappingURL=assetUrls-DpLOinYe.js.map
1
+ import{a as e,t}from"./react-BUfh6y28.js";import{n}from"./jsx-runtime-DJeoFXNw.js";import{Ts as r,ns as i,ts as a}from"./utils-Dv1DrWoz.js";import{L as o,W as s}from"./runtime-B6yGAVz4.js";import{s as c}from"./vcsRefInvalidation-BI3mMuIW.js";import{s as l}from"./session-B6T_Arzf.js";import{c as u,l as d,o as f,t as p,u as m}from"./assets-B36wSN1M.js";var h=n(),g=e(t(),1);function _(e,t){let n=(0,h.c)(7),r=(0,g.useContext)(i),a=typeof t==`string`?t:t?.label,s=typeof t==`string`?!0:t?.reportFailure??!0,c=typeof t==`string`?!0:t?.reportDefect??!0,l=typeof t==`string`?!1:t?.refresh??!1,u;return n[0]!==a||n[1]!==e||n[2]!==l||n[3]!==r||n[4]!==c||n[5]!==s?(u=t=>{let n=e(t);return o(r,n,{label:a??n.label?.[0]??`atom query`,reportFailure:s,reportDefect:c,refresh:l})},n[0]=a,n[1]=e,n[2]=l,n[3]=r,n[4]=c,n[5]=s,n[6]=u):u=n[6],u}function v(e,t){let n=(0,h.c)(10),r=c(e),i;n[0]!==t||n[1]!==r?(i=d(t,r),n[0]=t,n[1]=r,n[2]=i):i=n[2];let o=i,s=l(e),m;n[3]!==o||n[4]!==e||n[5]!==t?(m=o!==null||e===null||t===null?f:p.createUrl({environmentId:e,input:{resource:t}}),n[3]=o,n[4]=e,n[5]=t,n[6]=m):m=n[6];let g=a(m);if(o!==null)return o;let _=s._tag===`Some`?s.value.httpBaseUrl:null,v;return n[7]!==g||n[8]!==_?(v=u(g,_),n[7]=g,n[8]=_,n[9]=v):v=n[9],v}function y(e,t){let n=(0,h.c)(6),r=l(e),i=r._tag===`Some`?r.value.httpBaseUrl:null,a;n[0]===Symbol.for(`react.memo_cache_sentinel`)?(a={reportFailure:!1,refresh:!0},n[0]=a):a=n[0];let o=_(p.createUrl,a),c;return n[1]!==e||n[2]!==i||n[3]!==o||n[4]!==t?(c=async()=>{if(e===null||t===null||i===null)return null;let n=await o({environmentId:e,input:{resource:t}});if(n._tag===`Failure`)throw s(n);return m(i,n.value.relativeUrl)},n[1]=e,n[2]=i,n[3]=o,n[4]=t,n[5]=c):c=n[5],c}function b(e,t){let n=l(e),{canReadFiles:i}=c(e),o=(0,g.useMemo)(()=>i?t:t.filter(e=>e._tag!==`workspace-file`&&e._tag!==`media-file`&&e._tag!==`draft-workspace-file`),[i,t]),s=a(p.createUrls({environmentId:e,resources:o}));return(0,g.useMemo)(()=>{if(n._tag===`None`)return t.map(()=>null);let e=0;return t.map(t=>{if(!i&&(t._tag===`workspace-file`||t._tag===`media-file`||t._tag===`draft-workspace-file`))return null;let a=s[e++];return a&&r(a)?m(n.value.httpBaseUrl,a.value.relativeUrl):null})},[i,n,t,s])}export{_ as i,v as n,b as r,y as t};
2
+ //# sourceMappingURL=assetUrls-COCOS1bm.js.map
@@ -0,0 +1,2 @@
1
+ import{n as e}from"./jsx-runtime-DJeoFXNw.js";import{$s as t,Fy as n,GS as r,Gy as i,JT as a,Jy as o,LS as s,Os as c,Tb as l,Wc as u,Ys as d,as as f,cE as p,db as m,fb as h,gs as g,iE as _,ls as v,nS as y,os as b,ps as x,rE as S,rb as ee,rs as C,sb as w,sl as T,ts as E,ws as te}from"./utils-Dv1DrWoz.js";import{Z as D,dt as ne,j as re,pt as ie}from"./runtime-B6yGAVz4.js";import{An as O,a as k,h as A,i as j,n as M,t as N}from"./runtime-BhGr1QCf.js";import{m as P,n as F}from"./server-Dc9414wM.js";import{t as I}from"./session-B6T_Arzf.js";import{t as L}from"./env-wK1YYxA8.js";import{t as R}from"./sourceControl-DjMIOzv1.js";var z=18e5,B=3e5,V=36e5,H=class extends m()(`InvalidAssetCollectionKeyError`,{key:w,cause:o()}){get message(){return`Invalid asset collection atom key: ${JSON.stringify(this.key)}.`}},U=l(h([n,i(T)]));function ae(e){try{return U(JSON.parse(e))}catch(t){throw new H({key:e,cause:t})}}function W(e,t){try{return new URL(t,e).toString()}catch{return null}}var G=f(te(!1)).pipe(x(`asset-url:empty`)),K=`This connection cannot read host files. Pair again with a new link to view it.`;function q(e,t){return e===null||t.canReadFiles||e._tag!==`workspace-file`&&e._tag!==`media-file`&&e._tag!==`draft-workspace-file`?null:t.isPending?{_tag:`Loading`}:t.error===null?{_tag:`Failure`,reason:`missing-file-access`}:{_tag:`Failure`}}function J(e,t){if(e._tag===`Failure`)return{_tag:`Failure`};if(t===null||e._tag!==`Success`)return{_tag:`Loading`};let n=W(t,e.value.relativeUrl);return n===null?{_tag:`Failure`}:{_tag:`Success`,url:n,expiresAt:e.value.expiresAt,...e.value.sourcePath===void 0?{}:{sourcePath:e.value.sourcePath},...e.value.imageDimensions===void 0?{}:{imageDimensions:e.value.imageDimensions}}}function oe(e,t){let n=y(`assets.createUrl`)(function*(e){let n=yield*D(u.assetsCreateUrl,e).pipe(r);if(a(n))return n.success;let i=n.failure,o=e.resource,s=t?(yield*g).get(t):null,c=yield*ie;if(!s||s.environmentId===c.target.environmentId||i._tag!==`AssetWorkspaceAssetNotFoundError`&&i._tag!==`AssetWorkspaceAssetInspectionError`&&i._tag!==`AssetWorkspaceContextNotFoundError`||o._tag!==`media-file`||!(o.path.startsWith(`/`)||O(o.path))||A(o.path.slice(o.path.lastIndexOf(`.`)))===null)return yield*i;let l=yield*(yield*ne).run(s.environmentId,D(u.assetsCreateUrl,e));return{...l,relativeUrl:new URL(l.relativeUrl,s.httpBaseUrl).href}}),i=re(e,{label:`environment-data:assets:create-url`,execute:n,staleTimeMs:B,idleTtlMs:V,refreshIntervalMs:z,refreshTrigger:({input:e})=>e.resource._tag===`media-file`?t:void 0}),o=C(e=>{let[t,n]=ae(e);return f(e=>n.map(n=>e(i({environmentId:t,input:{resource:n}})))).pipe(v(V),x(`environment-data:assets:create-urls:${e}`))});return{createUrl:i,createUrls:e=>o(JSON.stringify([e.environmentId,e.resources]))}}function se(e){let t=l(h([n,w,ee(w)])),r=e.projectClones,i=C(n=>{let[i,a,o]=t(JSON.parse(n)),l={_tag:`project-favicon`,cwd:a,...o?{path:o}:{}},u=e.createUrl({environmentId:i,input:{resource:l}}),d=r?u.pipe(b(f(e=>e(r(i)).find(e=>e.destinationPath===a)?.phase??null))):u,m=f(t=>{let n=t(d),r=t(e.preparedConnection(i)),a=J(n,p(r)?r.value.httpBaseUrl:null);return a._tag===`Success`?a.url:_(t.self())}).pipe(v(V)),h=e.imageCache;if(!h)return m;let g={environmentId:i,cwd:a,faviconPath:o},y=f(e=>{e(d);let t=e(m);return s(e=>h.resolve(g,t,e))}).pipe(v(V));return f(e=>{let t=e(y);return k(e(m))?null:S(c(t),()=>h.peek(g))}).pipe(v(V))});return e=>i(j(e.environmentId,e.cwd,e.faviconPath))}var Y=e(),X=[],ce=f(null).pipe(x(`web-project-clone:empty`)),Z=C(e=>f(t=>{if(t(F).get(e)?.environment.capabilities.projectCloneTracking!==!0)return X;let n=t(R.projectClones({environmentId:e,input:{}}));return S(c(n),()=>X)}).pipe(x(`web-project-clones:${e}`))),le=C(e=>{let t=d(e);return f(e=>t===null?null:e(Z(t.environmentId)).find(e=>e.projectId===t.projectId)??null).pipe(x(`web-project-clone:${e}`))});function ue(e){let n=(0,Y.c)(2),r;return n[0]===e?r=n[1]:(r=e===null?ce:le(t(e)),n[0]=e,n[1]=r),E(r)}function Q(e){let t=(0,Y.c)(2),n;return t[0]===e?n=t[1]:(n=Z(e),t[0]=e,t[1]=n),E(n)}var de=f(e=>{if(!L)return null;let t=e(P);if(t===null)return null;let n=e(I.preparedConnectionValueAtom(t)),r=e(I.initialConfigValueAtom(t));return n._tag===`None`||r===null?null:{environmentId:t,httpBaseUrl:n.value.httpBaseUrl}}),$=oe(N,de),fe=se({imageCache:M,createUrl:$.createUrl,preparedConnection:I.preparedConnectionValueAtom,projectClones:Z});export{ue as a,J as c,Q as i,q as l,fe as n,G as o,Z as r,K as s,$ as t,W as u};
2
+ //# sourceMappingURL=assets-B36wSN1M.js.map
@@ -1,2 +1,2 @@
1
- import{n as e}from"./jsx-runtime-DJeoFXNw.js";import{B as t,H as n,Ig as r,Lg as i,R as a,U as o,Vo as s,W as c,Zo as l,e_ as u,ec as d,ts as f}from"./utils-BlwLA0C4.js";import{Ft as p,It as ee,Rt as m}from"./runtime-DYpzE3gq.js";import{a as h,b as te}from"./entities-DhRbI2L4.js";import{_ as ne}from"./runtime-Csw1ghUb.js";import{n as g,r as _,s as re}from"./useSettings-CyF6ezIl.js";import{m as v}from"./server-DXSwZxzT.js";import{r as y}from"./session-meZM9Xpf.js";import{t as b}from"./env-wK1YYxA8.js";import{r as x,t as ie}from"./preview-BhM7y-5f.js";var S=e();function C(e){if(h(e)&&!(s()&&e!==l.get(v)))return`server`}function ae(e,t,n,r){return!r||!n||!s()||e===t?null:r.runtime===`server`?`desktop`:`server`}function oe(e){return s()||h(e)}function w(e){let t=(0,S.c)(2),n=te(e),r;return t[0]===n?r=t[1]:(r=s()||n,t[0]=n,t[1]=r),r}function T(e,t,n){return b&&n?.runtime===`server`&&t!==null&&e===t}function E(e,t){let n=(0,S.c)(4),r=f(v),i;return n[0]!==e||n[1]!==t||n[2]!==r?(i=T(e,r,t),n[0]=e,n[1]=t,n[2]=r,n[3]=i):i=n[3],i}var se=e=>e._tag===`fill`?`fill`:`${e._tag}:${e.width}:${e.height}:${e._tag===`preset`?e.presetId:``}`,D=e=>Number.isFinite(e)&&e>0?e:1;function ce(e,t,n=1){if(e._tag!==`fill`)return e;let r=D(n);return t?{_tag:`freeform`,width:Math.max(1,Math.round(t.width/t.scale/r)),height:Math.max(1,Math.round(t.height/t.scale/r))}:{_tag:`freeform`,width:1280,height:800}}function O(e){return{width:Math.max(1,e.width-20),height:Math.max(1,e.height-38-10)}}function k(e,t,n=1){let r=Math.max(1,Math.round(e.width)),i=Math.max(1,Math.round(e.height));if(t._tag===`fill`)return{canvasWidth:r,canvasHeight:i,viewportX:0,viewportY:0,viewportWidth:r,viewportHeight:i,viewportScale:1,fillsPanel:!0};let a=D(n),o=t.width*a,s=t.height*a,c=Math.min(1,r/o,i/s),l=o*c,u=s*c;return{canvasWidth:r,canvasHeight:i,viewportX:Math.max(0,Math.round((r-l)/2)),viewportY:Math.max(0,Math.round((i-u)/2)),viewportWidth:l,viewportHeight:u,viewportScale:c,fillsPanel:!1}}function le(e,t,n=1){let r=k(O(e),t,n);return{...r,canvasWidth:Math.max(1,Math.round(e.width)),canvasHeight:Math.max(1,Math.round(e.height)),viewportX:r.viewportX+10,viewportY:r.viewportY+38}}var A=e=>Math.min(i,Math.max(240,e)),ue=e=>e!==void 0&&Number.isFinite(e)&&e>0;function j(e,t,n){if(n===`width`){let n=Math.ceil(Math.max(240,240*t)),a=Math.floor(Math.min(i,i*t,Math.sqrt(r*t))),o=Math.min(a,Math.max(n,Math.round(e))),s=Math.round(o/t);for(;o*s>8294400&&o>n;)--o,s=Math.round(o/t);return{width:o,height:s}}let a=Math.ceil(Math.max(240,240/t)),o=Math.floor(Math.min(i,i/t,Math.sqrt(r/t))),s=Math.min(o,Math.max(a,Math.round(e))),c=Math.round(s*t);for(;c*s>8294400&&s>a;)--s,c=Math.round(s*t);return{width:c,height:s}}function M(e,t,n=1,i=`southeast`,a){let o=D(n),s=i.includes(`east`)?t.x:i.includes(`west`)?-t.x:0,c=i.includes(`south`)?t.y:i.includes(`north`)?-t.y:0,l=e.width+s/o,u=e.height+c/o;if(ue(a)){let t=s!==0||i===`east`||i===`west`,n=c!==0||i===`north`||i===`south`,r=t&&!n?`width`:n&&!t?`height`:Math.abs(l-e.width)/e.width>=Math.abs(u-e.height)/e.height?`width`:`height`;return j(r===`width`?l:u,a,r)}let d=A(Math.round(l)),f=A(Math.round(u));return d*f<=8294400||(Math.abs(s)>=Math.abs(c)?d=Math.max(240,Math.floor(r/f)):f=Math.max(240,Math.floor(r/d))),{width:d,height:f}}var N=(e,t,n)=>{let r=(e<n?(n+e)/2:e)+t;return r<=n?r*2-n:r},P=(e,t,n)=>{if(e>n){let r=e-n;return t<=r?e-t:n-(t-r)*2}let r=(n-e)/2+t;return r>=0?n-r*2:n-r};function F(e,t,n,r=1,i=`southeast`,a){let o=D(r),s=e.width*o,c=e.height*o,l=i.includes(`east`)?N(s,t.x,n.width):i.includes(`west`)?P(s,t.x,n.width):s,u=i.includes(`south`)?N(c,t.y,n.height):i.includes(`north`)?P(c,t.y,n.height):c,d=l-s,f=u-c;return M(e,{x:i.includes(`west`)?-d:d,y:i.includes(`north`)?-f:f},o,i,a)}function I(e,t=1){let n=O(e),r=D(t);return M({width:n.width/r,height:n.height/r},{x:0,y:0})}var L=e=>{let t=u(e.browserProfiles);return{viewport:e.browserDefaultViewport,zoomFactor:e.browserDefaultZoomFactor,appearance:e.browserDefaultAppearance,autoShowFloatingPreview:e.browserAutoShowFloatingPreview,profiles:t,profileId:t.find(t=>t.id===e.browserDefaultProfileId&&t.kind!==`incognito`)?.id??`default`}};function R(){return L(_())}async function z(){return await g(),R()}function B(){return re(L)}function V(e=R()){return{zoomFactor:e.zoomFactor,colorScheme:e.appearance}}function H(e=R()){return e.viewport}function U(e=R()){return e.profileId}var de={width:1024,height:768};function fe(e){let t=e.defaults??R();return t.viewport._tag===`fill`?{_tag:`freeform`,...e.panelRect?I(e.panelRect,e.zoomFactor):de}:t.viewport}var pe=e=>{let t=y(e);if(!t)throw Error(`Environment ${e} is not connected.`);return new URL(t.httpBaseUrl)},me=(e,t,n,r,i)=>{if(!ee(n.hostname))throw Error(`This environment port needs the planned authenticated preview gateway; its server address is not directly private-network reachable.`);let a=t.protocol??`http`,o=t.path?.startsWith(`/`)?t.path:`/${t.path??``}`,s=n.hostname.replace(/^\[|\]$/g,``),c=p(s)?`localhost`:s.includes(`:`)?`[${s}]`:s,l=i?new URL(i):new URL(o,`${a}://${c}:${t.port}`);return i&&(l.hostname=c,l.port=String(t.port)),{requestedUrl:r??`${a}://localhost:${t.port}${o}`,resolvedUrl:l.toString(),resolutionKind:p(s)?`direct`:`direct-private-network`,environmentId:e}},he=e=>b&&(e._tag===`PrimaryConnectionTarget`||ne(e));function W(e,t){try{let n=x(t),r=new URL(n);if(!ie(r.hostname))return n;let i=y(e)?.target;return i&&he(i)?n:me(e,{kind:`environment-port`,port:Number(r.port||(r.protocol===`https:`?443:80)),protocol:r.protocol===`https:`?`https`:`http`,path:`${r.pathname}${r.search}${r.hash}`},pe(e),t,r).resolvedUrl}catch{return t}}var ge=2048,_e=864e13;function G(e){return typeof e==`number`&&Number.isFinite(e)&&Math.abs(e)<=_e}function K(e){let t;try{t=new URL(x(e))}catch{return null}return t.username=t.password=``,t.href.length>ge?null:t.href}function q(e,t){let n=new URL(J(e,t));return n.pathname!==`/`&&n.pathname.endsWith(`/`)&&(n.pathname=n.pathname.slice(0,-1)),n.href}function J(e,t){let n=new URL(e),r=m(n.hostname),i=t&&m(t);return(p(r)||r===`0.0.0.0`||r===i)&&(n.hostname=`local`),n.href}function Y(e){let t=m(new URL(e).hostname);return p(t)||t===`0.0.0.0`}function ve(e,t,n,r){let i=J(t,r?.environmentHostname),a=e.find(e=>J(e.url,r?.environmentHostname)===i),o=e.filter(e=>J(e.url,r?.environmentHostname)!==i),s=r?.insertOrdered&&a&&a.lastVisitedAt>n?a.lastVisitedAt:n,c=a&&(Y(a.url)||!Y(t))?a.url:t,l=a?{...a,url:c,lastVisitedAt:s}:{url:t,lastVisitedAt:s};if(!r?.insertOrdered)return[l,...o].slice(0,50);let u=o.findIndex(e=>e.lastVisitedAt<l.lastVisitedAt);return(u===-1?[...o,l]:o.toSpliced(u,0,l)).slice(0,50)}function X(e){let t=Object.keys(e);if(t.length<=20)return e;let n=t.toSorted((t,n)=>(e[n]?.[0]?.lastVisitedAt??0)-(e[t]?.[0]?.lastVisitedAt??0)).slice(0,20);return Object.fromEntries(n.map(t=>[t,e[t]??[]]))}function Z(e){if(!e||typeof e!=`object`)return{byProjectKey:{}};let t=e.byProjectKey;if(!t||typeof t!=`object`||Array.isArray(t))return{byProjectKey:{}};let n={};for(let[e,r]of Object.entries(t)){if(!Array.isArray(r))continue;let t=new Set,i=r.flatMap(e=>{if(!e||typeof e!=`object`)return[];let{url:t,lastVisitedAt:n,title:r}=e;if(typeof t!=`string`)return[];let i=K(t);return!i||!G(n)?[]:[{url:i,lastVisitedAt:n,...typeof r==`string`&&r.length>0?{title:r.slice(0,512)}:{}}]}).toSorted((e,t)=>t.lastVisitedAt-e.lastVisitedAt).filter(e=>{let n=J(e.url);return!t.has(n)&&(t.add(n),!0)}).slice(0,50);i.length>0&&(n[e]=i)}return{byProjectKey:X(n)}}var ye=`p4code:browser-history:v1`,be=20;function Q(e,t,n){let r=e[t]??[],i={...e};i[t]=[...r,n].slice(-10);let a=Object.keys(i);if(a.length>be){let e=a[0];e!==void 0&&e!==t&&delete i[e]}return i}var $=c()(o((e,t)=>({byProjectKey:{},projectKeyByThreadKey:{},pendingVisitsByThreadKey:{},pendingTitlesByThreadKey:{},recordVisit:(t,n,r,i)=>{let a=K(n);a&&e(e=>({byProjectKey:X({...e.byProjectKey,[t]:ve(e.byProjectKey[t]??[],a,r,i)})}))},setTitleForUrl:(n,r,i,a)=>{let o=K(r),s=t(),c=s.byProjectKey[n],l=i.trim().slice(0,512);if(!o||!c||l.length===0)return;let u=q(o,a),d=c.findIndex(e=>q(e.url,a)===u);d!==-1&&c[d]?.title!==l&&e({byProjectKey:{...s.byProjectKey,[n]:c.map((e,t)=>t===d?{...e,title:l}:e)}})},removeUrl:(n,r)=>{let i=K(r),a=t(),o=a.byProjectKey[n];if(!i||!o)return;let s=o.filter(e=>e.url!==i);if(s.length!==o.length){if(s.length===0){let{[n]:t,...r}=a.byProjectKey;e({byProjectKey:r})}else e({byProjectKey:{...a.byProjectKey,[n]:s}})}},registerThreadProject:(n,r)=>{let i=d(n),a=t(),o=a.pendingVisitsByThreadKey[i],s=a.pendingTitlesByThreadKey[i];if(a.projectKeyByThreadKey[i]===r&&!o&&!s)return;let c={...a.pendingVisitsByThreadKey},l={...a.pendingTitlesByThreadKey};delete c[i],delete l[i],e({projectKeyByThreadKey:{...a.projectKeyByThreadKey,[i]:r},pendingVisitsByThreadKey:c,pendingTitlesByThreadKey:l});for(let e of o??[])t().recordVisit(r,e.url,e.at,{insertOrdered:!0,environmentHostname:e.environmentHostname});for(let e of s??[])t().setTitleForUrl(r,e.url,e.title,e.environmentHostname)}}),{name:ye,version:1,storage:n(()=>a(typeof window<`u`?window.localStorage:void 0)),partialize:e=>({byProjectKey:e.byProjectKey,projectKeyByThreadKey:e.projectKeyByThreadKey}),migrate:Z,merge:xe}));function xe(e,t){let n=Z(e);return{...t,...n,projectKeyByThreadKey:Se(e,n.byProjectKey),pendingVisitsByThreadKey:{},pendingTitlesByThreadKey:{}}}function Se(e,t){if(!e||typeof e!=`object`)return{};let n=e.projectKeyByThreadKey;return!n||typeof n!=`object`||Array.isArray(n)?{}:Object.fromEntries(Object.entries(n).filter(e=>typeof e[1]==`string`&&e[1]in t).slice(-100))}function Ce(e,t,n){let r=d(e),i=$.getState(),a=i.projectKeyByThreadKey[r],o=n??Date.now(),s=y(e.environmentId),c=s?new URL(s.httpBaseUrl).hostname:null;a?i.recordVisit(a,t,o,{environmentHostname:c}):$.setState({pendingVisitsByThreadKey:Q(i.pendingVisitsByThreadKey,r,{url:t,at:o,environmentHostname:c})})}function we(e,t,n,r){let i=d(e),a=$.getState(),o=a.projectKeyByThreadKey[i];o?a.setTitleForUrl(o,t,n,r):$.setState({pendingTitlesByThreadKey:Q(a.pendingTitlesByThreadKey,i,{url:t,title:n,environmentHostname:r})})}function Te(e,t){let n=$.getState(),r=n.projectKeyByThreadKey[d(e)];r&&n.removeUrl(r,t)}var Ee=[];function De(e,n){let r=(0,S.c)(3),i;return r[0]!==n||r[1]!==e?(i=t=>{let r=t.projectKeyByThreadKey[d(e)],i=r?t.byProjectKey[r]:void 0;return i&&i.length>0?i.slice(0,n):Ee},r[0]=n,r[1]=e,r[2]=i):i=r[2],$(t(i))}export{T as C,C as S,E as T,le as _,De as a,ae as b,H as c,z as d,B as f,O as g,M as h,we as i,V as l,F as m,Ce as n,W as o,se as p,Te as r,U as s,G as t,fe as u,k as v,w,oe as x,ce as y};
2
- //# sourceMappingURL=browserHistoryStore-CUc0_P_z.js.map
1
+ import{n as e}from"./jsx-runtime-DJeoFXNw.js";import{$g as t,B as n,Fg as r,H as i,Ig as a,R as o,U as s,Vo as c,W as l,Zo as u,ec as d,ts as f}from"./utils-Dv1DrWoz.js";import{Ft as p,It as ee,Rt as m}from"./runtime-B6yGAVz4.js";import{i as h,v as te}from"./entities-Cd_YDhEa.js";import{_ as ne}from"./runtime-BhGr1QCf.js";import{n as g,r as _,s as re}from"./useSettings-BAP_yCCK.js";import{m as v}from"./server-Dc9414wM.js";import{r as y}from"./session-B6T_Arzf.js";import{t as b}from"./env-wK1YYxA8.js";import{r as x,t as ie}from"./preview-DtLn0r5X.js";var S=e();function C(e){if(h(e)&&!(c()&&e!==u.get(v)))return`server`}function ae(e,t,n,r){return!r||!n||!c()||e===t?null:r.runtime===`server`?`desktop`:`server`}function oe(e){return c()||h(e)}function w(e){let t=(0,S.c)(2),n=te(e),r;return t[0]===n?r=t[1]:(r=c()||n,t[0]=n,t[1]=r),r}function T(e,t,n){return b&&n?.runtime===`server`&&t!==null&&e===t}function E(e,t){let n=(0,S.c)(4),r=f(v),i;return n[0]!==e||n[1]!==t||n[2]!==r?(i=T(e,r,t),n[0]=e,n[1]=t,n[2]=r,n[3]=i):i=n[3],i}var se=e=>e._tag===`fill`?`fill`:`${e._tag}:${e.width}:${e.height}:${e._tag===`preset`?e.presetId:``}`,D=e=>Number.isFinite(e)&&e>0?e:1;function ce(e,t,n=1){if(e._tag!==`fill`)return e;let r=D(n);return t?{_tag:`freeform`,width:Math.max(1,Math.round(t.width/t.scale/r)),height:Math.max(1,Math.round(t.height/t.scale/r))}:{_tag:`freeform`,width:1280,height:800}}function O(e){return{width:Math.max(1,e.width-20),height:Math.max(1,e.height-38-10)}}function k(e,t,n=1){let r=Math.max(1,Math.round(e.width)),i=Math.max(1,Math.round(e.height));if(t._tag===`fill`)return{canvasWidth:r,canvasHeight:i,viewportX:0,viewportY:0,viewportWidth:r,viewportHeight:i,viewportScale:1,fillsPanel:!0};let a=D(n),o=t.width*a,s=t.height*a,c=Math.min(1,r/o,i/s),l=o*c,u=s*c;return{canvasWidth:r,canvasHeight:i,viewportX:Math.max(0,Math.round((r-l)/2)),viewportY:Math.max(0,Math.round((i-u)/2)),viewportWidth:l,viewportHeight:u,viewportScale:c,fillsPanel:!1}}function le(e,t,n=1){let r=k(O(e),t,n);return{...r,canvasWidth:Math.max(1,Math.round(e.width)),canvasHeight:Math.max(1,Math.round(e.height)),viewportX:r.viewportX+10,viewportY:r.viewportY+38}}var A=e=>Math.min(a,Math.max(240,e)),ue=e=>e!==void 0&&Number.isFinite(e)&&e>0;function j(e,t,n){if(n===`width`){let n=Math.ceil(Math.max(240,240*t)),i=Math.floor(Math.min(a,a*t,Math.sqrt(r*t))),o=Math.min(i,Math.max(n,Math.round(e))),s=Math.round(o/t);for(;o*s>8294400&&o>n;)--o,s=Math.round(o/t);return{width:o,height:s}}let i=Math.ceil(Math.max(240,240/t)),o=Math.floor(Math.min(a,a/t,Math.sqrt(r/t))),s=Math.min(o,Math.max(i,Math.round(e))),c=Math.round(s*t);for(;c*s>8294400&&s>i;)--s,c=Math.round(s*t);return{width:c,height:s}}function M(e,t,n=1,i=`southeast`,a){let o=D(n),s=i.includes(`east`)?t.x:i.includes(`west`)?-t.x:0,c=i.includes(`south`)?t.y:i.includes(`north`)?-t.y:0,l=e.width+s/o,u=e.height+c/o;if(ue(a)){let t=s!==0||i===`east`||i===`west`,n=c!==0||i===`north`||i===`south`,r=t&&!n?`width`:n&&!t?`height`:Math.abs(l-e.width)/e.width>=Math.abs(u-e.height)/e.height?`width`:`height`;return j(r===`width`?l:u,a,r)}let d=A(Math.round(l)),f=A(Math.round(u));return d*f<=8294400||(Math.abs(s)>=Math.abs(c)?d=Math.max(240,Math.floor(r/f)):f=Math.max(240,Math.floor(r/d))),{width:d,height:f}}var N=(e,t,n)=>{let r=(e<n?(n+e)/2:e)+t;return r<=n?r*2-n:r},P=(e,t,n)=>{if(e>n){let r=e-n;return t<=r?e-t:n-(t-r)*2}let r=(n-e)/2+t;return r>=0?n-r*2:n-r};function F(e,t,n,r=1,i=`southeast`,a){let o=D(r),s=e.width*o,c=e.height*o,l=i.includes(`east`)?N(s,t.x,n.width):i.includes(`west`)?P(s,t.x,n.width):s,u=i.includes(`south`)?N(c,t.y,n.height):i.includes(`north`)?P(c,t.y,n.height):c,d=l-s,f=u-c;return M(e,{x:i.includes(`west`)?-d:d,y:i.includes(`north`)?-f:f},o,i,a)}function I(e,t=1){let n=O(e),r=D(t);return M({width:n.width/r,height:n.height/r},{x:0,y:0})}var L=e=>{let n=t(e.browserProfiles);return{viewport:e.browserDefaultViewport,zoomFactor:e.browserDefaultZoomFactor,appearance:e.browserDefaultAppearance,autoShowFloatingPreview:e.browserAutoShowFloatingPreview,profiles:n,profileId:n.find(t=>t.id===e.browserDefaultProfileId&&t.kind!==`incognito`)?.id??`default`}};function R(){return L(_())}async function z(){return await g(),R()}function B(){return re(L)}function V(e=R()){return{zoomFactor:e.zoomFactor,colorScheme:e.appearance}}function H(e=R()){return e.viewport}function U(e=R()){return e.profileId}var de={width:1024,height:768};function fe(e){let t=e.defaults??R();return t.viewport._tag===`fill`?{_tag:`freeform`,...e.panelRect?I(e.panelRect,e.zoomFactor):de}:t.viewport}var pe=e=>{let t=y(e);if(!t)throw Error(`Environment ${e} is not connected.`);return new URL(t.httpBaseUrl)},me=(e,t,n,r,i)=>{if(!ee(n.hostname))throw Error(`This environment port needs the planned authenticated preview gateway; its server address is not directly private-network reachable.`);let a=t.protocol??`http`,o=t.path?.startsWith(`/`)?t.path:`/${t.path??``}`,s=n.hostname.replace(/^\[|\]$/g,``),c=p(s)?`localhost`:s.includes(`:`)?`[${s}]`:s,l=i?new URL(i):new URL(o,`${a}://${c}:${t.port}`);return i&&(l.hostname=c,l.port=String(t.port)),{requestedUrl:r??`${a}://localhost:${t.port}${o}`,resolvedUrl:l.toString(),resolutionKind:p(s)?`direct`:`direct-private-network`,environmentId:e}},he=e=>b&&(e._tag===`PrimaryConnectionTarget`||ne(e));function W(e,t){try{let n=x(t),r=new URL(n);if(!ie(r.hostname))return n;let i=y(e)?.target;return i&&he(i)?n:me(e,{kind:`environment-port`,port:Number(r.port||(r.protocol===`https:`?443:80)),protocol:r.protocol===`https:`?`https`:`http`,path:`${r.pathname}${r.search}${r.hash}`},pe(e),t,r).resolvedUrl}catch{return t}}var ge=2048,_e=864e13;function G(e){return typeof e==`number`&&Number.isFinite(e)&&Math.abs(e)<=_e}function K(e){let t;try{t=new URL(x(e))}catch{return null}return t.username=t.password=``,t.href.length>ge?null:t.href}function q(e,t){let n=new URL(J(e,t));return n.pathname!==`/`&&n.pathname.endsWith(`/`)&&(n.pathname=n.pathname.slice(0,-1)),n.href}function J(e,t){let n=new URL(e),r=m(n.hostname),i=t&&m(t);return(p(r)||r===`0.0.0.0`||r===i)&&(n.hostname=`local`),n.href}function Y(e){let t=m(new URL(e).hostname);return p(t)||t===`0.0.0.0`}function ve(e,t,n,r){let i=J(t,r?.environmentHostname),a=e.find(e=>J(e.url,r?.environmentHostname)===i),o=e.filter(e=>J(e.url,r?.environmentHostname)!==i),s=r?.insertOrdered&&a&&a.lastVisitedAt>n?a.lastVisitedAt:n,c=a&&(Y(a.url)||!Y(t))?a.url:t,l=a?{...a,url:c,lastVisitedAt:s}:{url:t,lastVisitedAt:s};if(!r?.insertOrdered)return[l,...o].slice(0,50);let u=o.findIndex(e=>e.lastVisitedAt<l.lastVisitedAt);return(u===-1?[...o,l]:o.toSpliced(u,0,l)).slice(0,50)}function X(e){let t=Object.keys(e);if(t.length<=20)return e;let n=t.toSorted((t,n)=>(e[n]?.[0]?.lastVisitedAt??0)-(e[t]?.[0]?.lastVisitedAt??0)).slice(0,20);return Object.fromEntries(n.map(t=>[t,e[t]??[]]))}function Z(e){if(!e||typeof e!=`object`)return{byProjectKey:{}};let t=e.byProjectKey;if(!t||typeof t!=`object`||Array.isArray(t))return{byProjectKey:{}};let n={};for(let[e,r]of Object.entries(t)){if(!Array.isArray(r))continue;let t=new Set,i=r.flatMap(e=>{if(!e||typeof e!=`object`)return[];let{url:t,lastVisitedAt:n,title:r}=e;if(typeof t!=`string`)return[];let i=K(t);return!i||!G(n)?[]:[{url:i,lastVisitedAt:n,...typeof r==`string`&&r.length>0?{title:r.slice(0,512)}:{}}]}).toSorted((e,t)=>t.lastVisitedAt-e.lastVisitedAt).filter(e=>{let n=J(e.url);return!t.has(n)&&(t.add(n),!0)}).slice(0,50);i.length>0&&(n[e]=i)}return{byProjectKey:X(n)}}var ye=`p4code:browser-history:v1`,be=20;function Q(e,t,n){let r=e[t]??[],i={...e};i[t]=[...r,n].slice(-10);let a=Object.keys(i);if(a.length>be){let e=a[0];e!==void 0&&e!==t&&delete i[e]}return i}var $=l()(s((e,t)=>({byProjectKey:{},projectKeyByThreadKey:{},pendingVisitsByThreadKey:{},pendingTitlesByThreadKey:{},recordVisit:(t,n,r,i)=>{let a=K(n);a&&e(e=>({byProjectKey:X({...e.byProjectKey,[t]:ve(e.byProjectKey[t]??[],a,r,i)})}))},setTitleForUrl:(n,r,i,a)=>{let o=K(r),s=t(),c=s.byProjectKey[n],l=i.trim().slice(0,512);if(!o||!c||l.length===0)return;let u=q(o,a),d=c.findIndex(e=>q(e.url,a)===u);d!==-1&&c[d]?.title!==l&&e({byProjectKey:{...s.byProjectKey,[n]:c.map((e,t)=>t===d?{...e,title:l}:e)}})},removeUrl:(n,r)=>{let i=K(r),a=t(),o=a.byProjectKey[n];if(!i||!o)return;let s=o.filter(e=>e.url!==i);if(s.length!==o.length){if(s.length===0){let{[n]:t,...r}=a.byProjectKey;e({byProjectKey:r})}else e({byProjectKey:{...a.byProjectKey,[n]:s}})}},registerThreadProject:(n,r)=>{let i=d(n),a=t(),o=a.pendingVisitsByThreadKey[i],s=a.pendingTitlesByThreadKey[i];if(a.projectKeyByThreadKey[i]===r&&!o&&!s)return;let c={...a.pendingVisitsByThreadKey},l={...a.pendingTitlesByThreadKey};delete c[i],delete l[i],e({projectKeyByThreadKey:{...a.projectKeyByThreadKey,[i]:r},pendingVisitsByThreadKey:c,pendingTitlesByThreadKey:l});for(let e of o??[])t().recordVisit(r,e.url,e.at,{insertOrdered:!0,environmentHostname:e.environmentHostname});for(let e of s??[])t().setTitleForUrl(r,e.url,e.title,e.environmentHostname)}}),{name:ye,version:1,storage:i(()=>o(typeof window<`u`?window.localStorage:void 0)),partialize:e=>({byProjectKey:e.byProjectKey,projectKeyByThreadKey:e.projectKeyByThreadKey}),migrate:Z,merge:xe}));function xe(e,t){let n=Z(e);return{...t,...n,projectKeyByThreadKey:Se(e,n.byProjectKey),pendingVisitsByThreadKey:{},pendingTitlesByThreadKey:{}}}function Se(e,t){if(!e||typeof e!=`object`)return{};let n=e.projectKeyByThreadKey;return!n||typeof n!=`object`||Array.isArray(n)?{}:Object.fromEntries(Object.entries(n).filter(e=>typeof e[1]==`string`&&e[1]in t).slice(-100))}function Ce(e,t,n){let r=d(e),i=$.getState(),a=i.projectKeyByThreadKey[r],o=n??Date.now(),s=y(e.environmentId),c=s?new URL(s.httpBaseUrl).hostname:null;a?i.recordVisit(a,t,o,{environmentHostname:c}):$.setState({pendingVisitsByThreadKey:Q(i.pendingVisitsByThreadKey,r,{url:t,at:o,environmentHostname:c})})}function we(e,t,n,r){let i=d(e),a=$.getState(),o=a.projectKeyByThreadKey[i];o?a.setTitleForUrl(o,t,n,r):$.setState({pendingTitlesByThreadKey:Q(a.pendingTitlesByThreadKey,i,{url:t,title:n,environmentHostname:r})})}function Te(e,t){let n=$.getState(),r=n.projectKeyByThreadKey[d(e)];r&&n.removeUrl(r,t)}var Ee=[];function De(e,t){let r=(0,S.c)(3),i;return r[0]!==t||r[1]!==e?(i=n=>{let r=n.projectKeyByThreadKey[d(e)],i=r?n.byProjectKey[r]:void 0;return i&&i.length>0?i.slice(0,t):Ee},r[0]=t,r[1]=e,r[2]=i):i=r[2],$(n(i))}export{T as C,C as S,E as T,le as _,De as a,ae as b,H as c,z as d,B as f,O as g,M as h,we as i,V as l,F as m,Ce as n,W as o,se as p,Te as r,U as s,G as t,fe as u,k as v,w,oe as x,ce as y};
2
+ //# sourceMappingURL=browserHistoryStore-CBcm7bje.js.map
@@ -1,2 +1,2 @@
1
- import{n as e,r as t}from"./useSettings-CyF6ezIl.js";import{x as n}from"./browserHistoryStore-CUc0_P_z.js";function r(e){return e.event.metaKey||e.event.ctrlKey||e.preference!==`app`||!e.canOpenInApp||!i(e.url)?`system`:`app`}function i(e){try{let{protocol:t}=new URL(e);return t===`http:`||t===`https:`}catch{return!1}}async function a(){return await e(),t().browserLinkTarget}function o(e){return e!=null&&n(e.environmentId)}export{r as i,i as n,a as r,o as t};
2
- //# sourceMappingURL=browserLinkTarget-BmW74g3V.js.map
1
+ import{n as e,r as t}from"./useSettings-BAP_yCCK.js";import{x as n}from"./browserHistoryStore-CBcm7bje.js";function r(e){return e.event.metaKey||e.event.ctrlKey||e.preference!==`app`||!e.canOpenInApp||!i(e.url)?`system`:`app`}function i(e){try{let{protocol:t}=new URL(e);return t===`http:`||t===`https:`}catch{return!1}}async function a(){return await e(),t().browserLinkTarget}function o(e){return e!=null&&n(e.environmentId)}export{r as i,i as n,a as r,o as t};
2
+ //# sourceMappingURL=browserLinkTarget-D-M5yQc0.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-BlwLA0C4.js";import{n as i,t as a}from"./CheckboxIndicator-CT--c3fO.js";var o=t(),s=e(n(),1);function c(e){let t=(0,o.c)(9),n,c;t[0]===e?(n=t[1],c=t[2]):({className:n,...c}=e,t[0]=e,t[1]=n,t[2]=c);let u;t[3]===n?u=t[4]:(u=r(`relative inline-flex size-4.5 shrink-0 items-center justify-center rounded-[.25rem] border border-input bg-background not-dark:bg-clip-padding shadow-xs/5 outline-none transition-shadow before:pointer-events-none before:absolute before:inset-0 before:rounded-[3px] not-data-disabled:not-data-checked:not-aria-invalid:before:shadow-[0_1px_--theme(--color-black/4%)] focus-visible:outline-2 focus-visible:outline-solid focus-visible:-outline-offset-2 focus-visible:outline-ring aria-invalid:border-destructive/36 focus-visible:aria-invalid:border-destructive/64 focus-visible:aria-invalid:outline-destructive/48 data-disabled:opacity-64 sm:size-4 dark:not-data-checked:bg-input/32 dark:focus-visible:aria-invalid:outline-destructive/24 dark:not-data-disabled:not-data-checked:not-aria-invalid:before:shadow-[0_-1px_--theme(--color-white/6%)] [[data-disabled],[data-checked],[aria-invalid]]:shadow-none`,n),t[3]=n,t[4]=u);let d;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,s.jsx)(a,{className:`-inset-px absolute flex items-center justify-center rounded-[.25rem] text-primary-foreground data-unchecked:hidden data-checked:bg-primary data-indeterminate:text-foreground in-[[data-slot=checkbox]:focus-visible]:inset-shadow-[0_0_0_3px_var(--background)] in-[[data-slot=checkbox]:focus-visible]:outline-2 in-[[data-slot=checkbox]:focus-visible]:outline-solid in-[[data-slot=checkbox]:focus-visible]:-outline-offset-2 in-[[data-slot=checkbox]:focus-visible]:outline-inherit`,"data-slot":`checkbox-indicator`,render:l}),t[5]=d):d=t[5];let f;return t[6]!==c||t[7]!==u?(f=(0,s.jsx)(i,{className:u,"data-slot":`checkbox`,...c,children:d}),t[6]=c,t[7]=u,t[8]=f):f=t[8],f}function l(e,t){return(0,s.jsx)(`span`,{...e,children:t.indeterminate?(0,s.jsx)(`svg`,{className:`size-3.5 text-current sm:size-3`,fill:`none`,height:`24`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`3`,viewBox:`0 0 24 24`,width:`24`,xmlns:`http://www.w3.org/2000/svg`,children:(0,s.jsx)(`path`,{d:`M5.252 12h13.496`})}):(0,s.jsx)(`svg`,{className:`size-3.5 text-current sm:size-3`,fill:`none`,height:`24`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`3`,viewBox:`0 0 24 24`,width:`24`,xmlns:`http://www.w3.org/2000/svg`,children:(0,s.jsx)(`path`,{d:`M5.252 12.7 10.2 18.63 18.748 5.37`})})})}export{c as t};
2
- //# sourceMappingURL=checkbox-CoJ-ki0Z.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-Dv1DrWoz.js";import{n as i,t as a}from"./CheckboxIndicator-DSA5Ujdj.js";var o=t(),s=e(n(),1);function c(e){let t=(0,o.c)(9),n,c;t[0]===e?(n=t[1],c=t[2]):({className:n,...c}=e,t[0]=e,t[1]=n,t[2]=c);let u;t[3]===n?u=t[4]:(u=r(`relative inline-flex size-4.5 shrink-0 items-center justify-center rounded-[.25rem] border border-input bg-background not-dark:bg-clip-padding shadow-xs/5 outline-none transition-shadow before:pointer-events-none before:absolute before:inset-0 before:rounded-[3px] not-data-disabled:not-data-checked:not-aria-invalid:before:shadow-[0_1px_--theme(--color-black/4%)] focus-visible:outline-2 focus-visible:outline-solid focus-visible:-outline-offset-2 focus-visible:outline-ring aria-invalid:border-destructive/36 focus-visible:aria-invalid:border-destructive/64 focus-visible:aria-invalid:outline-destructive/48 data-disabled:opacity-64 sm:size-4 dark:not-data-checked:bg-input/32 dark:focus-visible:aria-invalid:outline-destructive/24 dark:not-data-disabled:not-data-checked:not-aria-invalid:before:shadow-[0_-1px_--theme(--color-white/6%)] [[data-disabled],[data-checked],[aria-invalid]]:shadow-none`,n),t[3]=n,t[4]=u);let d;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,s.jsx)(a,{className:`-inset-px absolute flex items-center justify-center rounded-[.25rem] text-primary-foreground data-unchecked:hidden data-checked:bg-primary data-indeterminate:text-foreground in-[[data-slot=checkbox]:focus-visible]:inset-shadow-[0_0_0_3px_var(--background)] in-[[data-slot=checkbox]:focus-visible]:outline-2 in-[[data-slot=checkbox]:focus-visible]:outline-solid in-[[data-slot=checkbox]:focus-visible]:-outline-offset-2 in-[[data-slot=checkbox]:focus-visible]:outline-inherit`,"data-slot":`checkbox-indicator`,render:l}),t[5]=d):d=t[5];let f;return t[6]!==c||t[7]!==u?(f=(0,s.jsx)(i,{className:u,"data-slot":`checkbox`,...c,children:d}),t[6]=c,t[7]=u,t[8]=f):f=t[8],f}function l(e,t){return(0,s.jsx)(`span`,{...e,children:t.indeterminate?(0,s.jsx)(`svg`,{className:`size-3.5 text-current sm:size-3`,fill:`none`,height:`24`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`3`,viewBox:`0 0 24 24`,width:`24`,xmlns:`http://www.w3.org/2000/svg`,children:(0,s.jsx)(`path`,{d:`M5.252 12h13.496`})}):(0,s.jsx)(`svg`,{className:`size-3.5 text-current sm:size-3`,fill:`none`,height:`24`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`3`,viewBox:`0 0 24 24`,width:`24`,xmlns:`http://www.w3.org/2000/svg`,children:(0,s.jsx)(`path`,{d:`M5.252 12.7 10.2 18.63 18.748 5.37`})})})}export{c as t};
2
+ //# sourceMappingURL=checkbox-vIS3kn6A.js.map
@@ -1,2 +1,2 @@
1
- import{a as e,t}from"./react-BUfh6y28.js";import{n,t as r}from"./jsx-runtime-DJeoFXNw.js";import{t as i}from"./utils-BlwLA0C4.js";function a(e){let t=Number.parseInt(e.slice(1),16),n=(t>>16&255)/255,r=(t>>8&255)/255,i=(t&255)/255,a=Math.max(n,r,i),o=a-Math.min(n,r,i),s=0;return o!==0&&(s=a===n?(r-i)/o%6:a===r?(i-n)/o+2:(n-r)/o+4,s*=60,s<0&&(s+=360)),{h:s,s:a===0?0:o/a,v:a}}function o(e,t,n){let r=(e%360+360)%360,i=n*t,a=i*(1-Math.abs(r/60%2-1)),o=n-i,[s,c,l]=r<60?[i,a,0]:r<120?[a,i,0]:r<180?[0,i,a]:r<240?[0,a,i]:r<300?[a,0,i]:[i,0,a];return`#${[s,c,l].map(e=>Math.round((e+o)*255).toString(16).padStart(2,`0`)).join(``)}`}var s=n(),c=e(t(),1),l=e(r(),1);function u(e){return Math.min(1,Math.max(0,e))}function d(e,t,n){let r=(0,s.c)(9),[i,a]=(0,c.useState)(!1),o=(0,c.useRef)(null),l;r[0]===t?l=r[1]:(l=e=>{o.current===e.pointerId&&(o.current=null,a(!1),t?.())},r[0]=t,r[1]=l);let u=l,d=i?void 0:`left 80ms linear, top 80ms linear, background-color 80ms linear`,f;r[2]!==n?.current||r[3]!==u||r[4]!==e?(f={onPointerDown(t){o.current===null&&t.button===0&&(o.current=t.pointerId,(n?.current??t.currentTarget).focus({preventScroll:!0}),t.currentTarget.setPointerCapture(t.pointerId),a(!0),e(t))},onPointerMove(t){o.current===t.pointerId&&e(t)},onPointerUp:u,onPointerCancel:u,onLostPointerCapture:u},r[2]=n?.current,r[3]=u,r[4]=e,r[5]=f):f=r[5];let p;return r[6]!==d||r[7]!==f?(p={thumbTransition:d,handlers:f},r[6]=d,r[7]=f,r[8]=p):p=r[8],p}function f(e){let t=(0,s.c)(31),{label:n,value:r,onChange:a,onInteractionEnd:o,className:f,variant:p}=e,m=p===void 0?`inset`:p,h=(0,c.useId)(),g=(0,c.useRef)(null),_;t[0]!==a||t[1]!==r?(_=e=>{let t=e.currentTarget.getBoundingClientRect();t.width&&t.height&&a({...r,s:u((e.clientX-t.left)/t.width),v:1-u((e.clientY-t.top)/t.height)})},t[0]=a,t[1]=r,t[2]=_):_=t[2];let{handlers:v,thumbTransition:y}=d(_,o,g),b;t[3]!==a||t[4]!==r?(b=(e,t)=>{let n=e.shiftKey?.1:.02,i;bb18:switch(e.key){case`ArrowRight`:case`ArrowUp`:i=u(r[t]+n);break bb18;case`ArrowLeft`:case`ArrowDown`:i=u(r[t]-n);break bb18;case`Home`:i=0;break bb18;case`End`:i=1;break bb18;default:return}e.preventDefault(),a({...r,[t]:i})},t[3]=a,t[4]=r,t[5]=b):b=t[5];let x=b,S=`${n} saturation and brightness`,C=m===`edge`?`h-36 rounded-none`:`h-32 rounded-lg`,w;t[6]!==f||t[7]!==C?(w=i(`relative cursor-crosshair touch-none overflow-hidden bg-[linear-gradient(to_top,#000,transparent),linear-gradient(to_right,#fff,transparent)] has-[:focus-visible]:ring-2 has-[:focus-visible]:ring-inset has-[:focus-visible]:ring-ring has-[:focus-visible]:ring-offset-2 has-[:focus-visible]:ring-offset-popover`,C,f),t[6]=f,t[7]=C,t[8]=w):w=t[8];let T=`hsl(${r.h} 100% 50%)`,E;t[9]===T?E=t[10]:(E={backgroundColor:T},t[9]=T,t[10]=E);let D;t[11]===h?D=t[12]:(D=(0,l.jsx)(`span`,{id:h,className:`sr-only`,children:`Use arrow keys to adjust the focused value. Hold Shift for larger steps. Use Home and End for the minimum and maximum. Press Tab to move between saturation and brightness.`}),t[11]=h,t[12]=D);let O;t[13]!==x||t[14]!==h||t[15]!==n||t[16]!==a||t[17]!==r?(O=[[`s`,`Saturation`],[`v`,`Brightness`]].map(e=>{let[t,i]=e;return(0,l.jsxs)(`label`,{className:`contents`,children:[(0,l.jsx)(`input`,{ref:t===`s`?g:void 0,type:`range`,min:0,max:100,step:`any`,value:r[t]*100,"aria-label":`${n} ${i.toLowerCase()}`,"aria-describedby":h,"aria-valuetext":`${Math.round(r[t]*100)}%`,className:`peer sr-only`,onKeyDown:e=>x(e,t),onChange:e=>a({...r,[t]:e.currentTarget.valueAsNumber/100})}),(0,l.jsxs)(`span`,{"aria-hidden":!0,className:`pointer-events-none invisible absolute bottom-2 left-2 z-10 rounded bg-popover px-1.5 py-0.5 text-xs text-popover-foreground peer-focus-visible:visible`,children:[i,` `,Math.round(r[t]*100),`%`]})]},t)}),t[13]=x,t[14]=h,t[15]=n,t[16]=a,t[17]=r,t[18]=O):O=t[18];let k=`calc(${r.s} * (100% - 0.75rem) + 0.375rem)`,A=`calc(${1-r.v} * (100% - 0.75rem) + 0.375rem)`,j;t[19]!==k||t[20]!==A||t[21]!==y?(j=(0,l.jsx)(`span`,{className:`pointer-events-none absolute size-3 -translate-x-1/2 -translate-y-1/2 rounded-full border-2 border-white shadow-[0_0_0_1px_rgb(0_0_0/0.4)]`,style:{left:k,top:A,transition:y}}),t[19]=k,t[20]=A,t[21]=y,t[22]=j):j=t[22];let M;return t[23]!==v||t[24]!==O||t[25]!==j||t[26]!==S||t[27]!==w||t[28]!==E||t[29]!==D?(M=(0,l.jsxs)(`div`,{"aria-label":S,role:`group`,className:w,style:E,...v,children:[D,O,j]}),t[23]=v,t[24]=O,t[25]=j,t[26]=S,t[27]=w,t[28]=E,t[29]=D,t[30]=M):M=t[30],M}function p(e){let t=(0,s.c)(21),{label:n,value:r,onChange:a,onInteractionEnd:o,className:c}=e,f;t[0]===a?f=t[1]:(f=e=>{let t=e.currentTarget.getBoundingClientRect();t.width&&a(u((e.clientX-t.left)/t.width)*360)},t[0]=a,t[1]=f);let{handlers:p,thumbTransition:m}=d(f,o),h;t[2]!==a||t[3]!==r?(h=e=>{if(![`ArrowDown`,`ArrowLeft`,`ArrowRight`,`ArrowUp`].includes(e.key))return;e.preventDefault();let t=e.shiftKey?10:1,n=e.key===`ArrowRight`||e.key===`ArrowUp`?1:-1;a((r+n*t+360)%360)},t[2]=a,t[3]=r,t[4]=h):h=t[4];let g=h,_;t[5]===r?_=t[6]:(_=Math.round(r),t[5]=r,t[6]=_);let v;t[7]===c?v=t[8]:(v=i(`relative flex h-6 cursor-pointer touch-none items-center rounded-full outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-popover`,c),t[7]=c,t[8]=v);let y;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(y=(0,l.jsx)(`span`,{"aria-hidden":!0,className:`h-2.5 w-full rounded-full bg-[linear-gradient(to_right,#f00,#ff0,#0f0,#0ff,#00f,#f0f,#f00)] shadow-[inset_0_0_0_1px_rgb(0_0_0_/_12%)]`}),t[9]=y):y=t[9];let b=`calc(${r/360} * (100% - 1rem) + 0.5rem)`,x=`hsl(${r} 100% 50%)`,S;t[10]!==b||t[11]!==x||t[12]!==m?(S=(0,l.jsx)(`span`,{className:`pointer-events-none absolute top-1/2 size-4 -translate-x-1/2 -translate-y-1/2 rounded-full border-2 border-white shadow-[0_0_0_1px_rgb(0_0_0/0.4)]`,style:{left:b,backgroundColor:x,transition:m}}),t[10]=b,t[11]=x,t[12]=m,t[13]=S):S=t[13];let C;return t[14]!==g||t[15]!==p||t[16]!==n||t[17]!==_||t[18]!==v||t[19]!==S?(C=(0,l.jsxs)(`div`,{"aria-label":n,"aria-valuemax":360,"aria-valuemin":0,"aria-valuenow":_,className:v,role:`slider`,tabIndex:0,onKeyDown:g,...p,children:[y,S]}),t[14]=g,t[15]=p,t[16]=n,t[17]=_,t[18]=v,t[19]=S,t[20]=C):C=t[20],C}export{o as i,f as n,a as r,p as t};
2
- //# sourceMappingURL=color-picker-ABTfqBnJ.js.map
1
+ import{a as e,t}from"./react-BUfh6y28.js";import{n,t as r}from"./jsx-runtime-DJeoFXNw.js";import{t as i}from"./utils-Dv1DrWoz.js";function a(e){let t=Number.parseInt(e.slice(1),16),n=(t>>16&255)/255,r=(t>>8&255)/255,i=(t&255)/255,a=Math.max(n,r,i),o=a-Math.min(n,r,i),s=0;return o!==0&&(s=a===n?(r-i)/o%6:a===r?(i-n)/o+2:(n-r)/o+4,s*=60,s<0&&(s+=360)),{h:s,s:a===0?0:o/a,v:a}}function o(e,t,n){let r=(e%360+360)%360,i=n*t,a=i*(1-Math.abs(r/60%2-1)),o=n-i,[s,c,l]=r<60?[i,a,0]:r<120?[a,i,0]:r<180?[0,i,a]:r<240?[0,a,i]:r<300?[a,0,i]:[i,0,a];return`#${[s,c,l].map(e=>Math.round((e+o)*255).toString(16).padStart(2,`0`)).join(``)}`}var s=n(),c=e(t(),1),l=e(r(),1);function u(e){return Math.min(1,Math.max(0,e))}function d(e,t,n){let r=(0,s.c)(9),[i,a]=(0,c.useState)(!1),o=(0,c.useRef)(null),l;r[0]===t?l=r[1]:(l=e=>{o.current===e.pointerId&&(o.current=null,a(!1),t?.())},r[0]=t,r[1]=l);let u=l,d=i?void 0:`left 80ms linear, top 80ms linear, background-color 80ms linear`,f;r[2]!==n?.current||r[3]!==u||r[4]!==e?(f={onPointerDown(t){o.current===null&&t.button===0&&(o.current=t.pointerId,(n?.current??t.currentTarget).focus({preventScroll:!0}),t.currentTarget.setPointerCapture(t.pointerId),a(!0),e(t))},onPointerMove(t){o.current===t.pointerId&&e(t)},onPointerUp:u,onPointerCancel:u,onLostPointerCapture:u},r[2]=n?.current,r[3]=u,r[4]=e,r[5]=f):f=r[5];let p;return r[6]!==d||r[7]!==f?(p={thumbTransition:d,handlers:f},r[6]=d,r[7]=f,r[8]=p):p=r[8],p}function f(e){let t=(0,s.c)(31),{label:n,value:r,onChange:a,onInteractionEnd:o,className:f,variant:p}=e,m=p===void 0?`inset`:p,h=(0,c.useId)(),g=(0,c.useRef)(null),_;t[0]!==a||t[1]!==r?(_=e=>{let t=e.currentTarget.getBoundingClientRect();t.width&&t.height&&a({...r,s:u((e.clientX-t.left)/t.width),v:1-u((e.clientY-t.top)/t.height)})},t[0]=a,t[1]=r,t[2]=_):_=t[2];let{handlers:v,thumbTransition:y}=d(_,o,g),b;t[3]!==a||t[4]!==r?(b=(e,t)=>{let n=e.shiftKey?.1:.02,i;bb18:switch(e.key){case`ArrowRight`:case`ArrowUp`:i=u(r[t]+n);break bb18;case`ArrowLeft`:case`ArrowDown`:i=u(r[t]-n);break bb18;case`Home`:i=0;break bb18;case`End`:i=1;break bb18;default:return}e.preventDefault(),a({...r,[t]:i})},t[3]=a,t[4]=r,t[5]=b):b=t[5];let x=b,S=`${n} saturation and brightness`,C=m===`edge`?`h-36 rounded-none`:`h-32 rounded-lg`,w;t[6]!==f||t[7]!==C?(w=i(`relative cursor-crosshair touch-none overflow-hidden bg-[linear-gradient(to_top,#000,transparent),linear-gradient(to_right,#fff,transparent)] has-[:focus-visible]:ring-2 has-[:focus-visible]:ring-inset has-[:focus-visible]:ring-ring has-[:focus-visible]:ring-offset-2 has-[:focus-visible]:ring-offset-popover`,C,f),t[6]=f,t[7]=C,t[8]=w):w=t[8];let T=`hsl(${r.h} 100% 50%)`,E;t[9]===T?E=t[10]:(E={backgroundColor:T},t[9]=T,t[10]=E);let D;t[11]===h?D=t[12]:(D=(0,l.jsx)(`span`,{id:h,className:`sr-only`,children:`Use arrow keys to adjust the focused value. Hold Shift for larger steps. Use Home and End for the minimum and maximum. Press Tab to move between saturation and brightness.`}),t[11]=h,t[12]=D);let O;t[13]!==x||t[14]!==h||t[15]!==n||t[16]!==a||t[17]!==r?(O=[[`s`,`Saturation`],[`v`,`Brightness`]].map(e=>{let[t,i]=e;return(0,l.jsxs)(`label`,{className:`contents`,children:[(0,l.jsx)(`input`,{ref:t===`s`?g:void 0,type:`range`,min:0,max:100,step:`any`,value:r[t]*100,"aria-label":`${n} ${i.toLowerCase()}`,"aria-describedby":h,"aria-valuetext":`${Math.round(r[t]*100)}%`,className:`peer sr-only`,onKeyDown:e=>x(e,t),onChange:e=>a({...r,[t]:e.currentTarget.valueAsNumber/100})}),(0,l.jsxs)(`span`,{"aria-hidden":!0,className:`pointer-events-none invisible absolute bottom-2 left-2 z-10 rounded bg-popover px-1.5 py-0.5 text-xs text-popover-foreground peer-focus-visible:visible`,children:[i,` `,Math.round(r[t]*100),`%`]})]},t)}),t[13]=x,t[14]=h,t[15]=n,t[16]=a,t[17]=r,t[18]=O):O=t[18];let k=`calc(${r.s} * (100% - 0.75rem) + 0.375rem)`,A=`calc(${1-r.v} * (100% - 0.75rem) + 0.375rem)`,j;t[19]!==k||t[20]!==A||t[21]!==y?(j=(0,l.jsx)(`span`,{className:`pointer-events-none absolute size-3 -translate-x-1/2 -translate-y-1/2 rounded-full border-2 border-white shadow-[0_0_0_1px_rgb(0_0_0/0.4)]`,style:{left:k,top:A,transition:y}}),t[19]=k,t[20]=A,t[21]=y,t[22]=j):j=t[22];let M;return t[23]!==v||t[24]!==O||t[25]!==j||t[26]!==S||t[27]!==w||t[28]!==E||t[29]!==D?(M=(0,l.jsxs)(`div`,{"aria-label":S,role:`group`,className:w,style:E,...v,children:[D,O,j]}),t[23]=v,t[24]=O,t[25]=j,t[26]=S,t[27]=w,t[28]=E,t[29]=D,t[30]=M):M=t[30],M}function p(e){let t=(0,s.c)(21),{label:n,value:r,onChange:a,onInteractionEnd:o,className:c}=e,f;t[0]===a?f=t[1]:(f=e=>{let t=e.currentTarget.getBoundingClientRect();t.width&&a(u((e.clientX-t.left)/t.width)*360)},t[0]=a,t[1]=f);let{handlers:p,thumbTransition:m}=d(f,o),h;t[2]!==a||t[3]!==r?(h=e=>{if(![`ArrowDown`,`ArrowLeft`,`ArrowRight`,`ArrowUp`].includes(e.key))return;e.preventDefault();let t=e.shiftKey?10:1,n=e.key===`ArrowRight`||e.key===`ArrowUp`?1:-1;a((r+n*t+360)%360)},t[2]=a,t[3]=r,t[4]=h):h=t[4];let g=h,_;t[5]===r?_=t[6]:(_=Math.round(r),t[5]=r,t[6]=_);let v;t[7]===c?v=t[8]:(v=i(`relative flex h-6 cursor-pointer touch-none items-center rounded-full outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-popover`,c),t[7]=c,t[8]=v);let y;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(y=(0,l.jsx)(`span`,{"aria-hidden":!0,className:`h-2.5 w-full rounded-full bg-[linear-gradient(to_right,#f00,#ff0,#0f0,#0ff,#00f,#f0f,#f00)] shadow-[inset_0_0_0_1px_rgb(0_0_0_/_12%)]`}),t[9]=y):y=t[9];let b=`calc(${r/360} * (100% - 1rem) + 0.5rem)`,x=`hsl(${r} 100% 50%)`,S;t[10]!==b||t[11]!==x||t[12]!==m?(S=(0,l.jsx)(`span`,{className:`pointer-events-none absolute top-1/2 size-4 -translate-x-1/2 -translate-y-1/2 rounded-full border-2 border-white shadow-[0_0_0_1px_rgb(0_0_0/0.4)]`,style:{left:b,backgroundColor:x,transition:m}}),t[10]=b,t[11]=x,t[12]=m,t[13]=S):S=t[13];let C;return t[14]!==g||t[15]!==p||t[16]!==n||t[17]!==_||t[18]!==v||t[19]!==S?(C=(0,l.jsxs)(`div`,{"aria-label":n,"aria-valuemax":360,"aria-valuemin":0,"aria-valuenow":_,className:v,role:`slider`,tabIndex:0,onKeyDown:g,...p,children:[y,S]}),t[14]=g,t[15]=p,t[16]=n,t[17]=_,t[18]=v,t[19]=S,t[20]=C):C=t[20],C}export{o as i,f as n,a as r,p as t};
2
+ //# sourceMappingURL=color-picker-vozMHo5G.js.map
@@ -1,2 +1,2 @@
1
- import{a as e,t}from"./react-BUfh6y28.js";import{n,t as r}from"./jsx-runtime-DJeoFXNw.js";import{Id as i,ih as a,t as o,um as s,wo as c}from"./utils-BlwLA0C4.js";import{a as l,c as u,f as d,h as f,i as p,l as m,m as h,n as g,o as _,p as v,r as y,s as b,t as x}from"./ComboboxClear-CRWQGFjR.js";import{t as S}from"./input-CySdZpuF.js";import{t as C}from"./scroll-area-DMQd4YlU.js";var w=e(t()),T=e(r());function E(e){let{multiple:t=!1,defaultValue:n,value:r,onValueChange:i,autoComplete:a,...o}=e;return(0,T.jsx)(h,{...o,selectionMode:t?`multiple`:`single`,selectedValue:r,defaultSelectedValue:n,onSelectedValueChange:i,formAutoComplete:a})}var D=w.forwardRef(function(e,t){let{render:n,className:r,style:i,children:a,...o}=e,s=u();return c(`div`,e,{ref:[t,s],props:[{children:a,role:`status`,"aria-live":`polite`,"aria-atomic":!0},o]})}),O=n(),k=w.createContext({chipsRef:null,multiple:!1});function A(e){let t=(0,O.c)(7),n=w.useRef(null),r=!!e.multiple,i;t[0]===r?i=t[1]:(i={chipsRef:n,multiple:r},t[0]=r,t[1]=i);let a=i,o;t[2]===e?o=t[3]:(o=(0,T.jsx)(E,{...e}),t[2]=e,t[3]=o);let s;return t[4]!==o||t[5]!==a?(s=(0,T.jsx)(k,{value:a,children:o}),t[4]=o,t[5]=a,t[6]=s):s=t[6],s}function j(e){let t=(0,O.c)(35),n,r,s,c,l,u,d;t[0]===e?(n=t[1],r=t[2],s=t[3],c=t[4],l=t[5],u=t[6],d=t[7]):({className:n,showTrigger:l,showClear:u,startAddon:c,size:s,unstyled:d,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=s,t[4]=c,t[5]=l,t[6]=u,t[7]=d);let f=l===void 0||l,m=u!==void 0&&u,h=d!==void 0&&d,g=s??`default`,_;t[8]===c?_=t[9]:(_=c&&(0,T.jsx)(`div`,{"aria-hidden":`true`,className:`[&_svg]:-mx-0.5 pointer-events-none absolute inset-y-0 start-px z-10 flex items-center ps-[calc(--spacing(3)-1px)] opacity-80 has-[+[data-size=sm]]:ps-[calc(--spacing(2.5)-1px)] [&_svg:not([class*='size-'])]:size-4.5 sm:[&_svg:not([class*='size-'])]:size-4`,"data-slot":`combobox-start-addon`,children:c}),t[8]=c,t[9]=_);let y=c&&`data-[size=sm]:*:data-[slot=combobox-input]:ps-[calc(--spacing(7.5)-1px)] *:data-[slot=combobox-input]:ps-[calc(--spacing(8.5)-1px)] sm:data-[size=sm]:*:data-[slot=combobox-input]:ps-[calc(--spacing(7)-1px)] sm:*:data-[slot=combobox-input]:ps-[calc(--spacing(8)-1px)]`,b=g===`sm`?`has-[+[data-slot=combobox-trigger],+[data-slot=combobox-clear]]:*:data-[slot=combobox-input]:pe-6.5`:`has-[+[data-slot=combobox-trigger],+[data-slot=combobox-clear]]:*:data-[slot=combobox-input]:pe-7`,x;t[10]!==n||t[11]!==y||t[12]!==b?(x=o(y,b,n),t[10]=n,t[11]=y,t[12]=b,t[13]=x):x=t[13];let C=h&&`rounded-none bg-transparent text-sm`,w;t[14]===C?w=t[15]:(w=o(`has-disabled:opacity-100`,C),t[14]=C,t[15]=w);let E;t[16]!==g||t[17]!==w||t[18]!==h?(E=(0,T.jsx)(S,{className:w,nativeInput:!0,size:g,unstyled:h}),t[16]=g,t[17]=w,t[18]=h,t[19]=E):E=t[19];let D;t[20]!==r||t[21]!==E||t[22]!==x?(D=(0,T.jsx)(v,{className:x,"data-slot":`combobox-input`,render:E,...r}),t[20]=r,t[21]=E,t[22]=x,t[23]=D):D=t[23];let k;t[24]!==f||t[25]!==g?(k=f&&(0,T.jsx)(N,{className:o(`-translate-y-1/2 absolute top-1/2 inline-flex size-8 shrink-0 cursor-pointer items-center justify-center rounded-md border border-transparent opacity-80 outline-none transition-opacity pointer-coarse:after:absolute pointer-coarse:after:min-h-11 pointer-coarse:after:min-w-11 hover:opacity-100 has-[+[data-slot=combobox-clear]]:hidden sm:size-7 [&_svg:not([class*='size-'])]:size-4.5 sm:[&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0`,g===`sm`?`end-0`:`end-0.5`),children:(0,T.jsx)(p,{"data-slot":`combobox-icon`,children:(0,T.jsx)(i,{})})}),t[24]=f,t[25]=g,t[26]=k):k=t[26];let A;t[27]!==m||t[28]!==g?(A=m&&(0,T.jsx)(z,{className:o(`-translate-y-1/2 absolute top-1/2 inline-flex size-8 shrink-0 cursor-pointer items-center justify-center rounded-md border border-transparent opacity-80 outline-none transition-opacity pointer-coarse:after:absolute pointer-coarse:after:min-h-11 pointer-coarse:after:min-w-11 hover:opacity-100 has-[+[data-slot=combobox-clear]]:hidden sm:size-7 [&_svg:not([class*='size-'])]:size-4.5 sm:[&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0`,g===`sm`?`end-0`:`end-0.5`),children:(0,T.jsx)(a,{})}),t[27]=m,t[28]=g,t[29]=A):A=t[29];let j;return t[30]!==D||t[31]!==k||t[32]!==A||t[33]!==_?(j=(0,T.jsxs)(`div`,{className:`relative not-has-[>*.w-full]:w-fit w-full text-foreground has-disabled:opacity-64`,children:[_,D,k,A]}),t[30]=D,t[31]=k,t[32]=A,t[33]=_,t[34]=j):j=t[34],j}function M(e){let t=(0,O.c)(3),n;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,T.jsx)(s,{"aria-hidden":`true`,className:`pointer-events-none absolute top-1.5 left-0 size-4 shrink-0 text-muted-foreground/55`}),t[0]=n):n=t[0];let r;return t[1]===e?r=t[2]:(r=(0,T.jsx)(`div`,{className:`min-w-0 shrink-0 px-3 pt-2.5`,children:(0,T.jsxs)(`div`,{className:`relative -translate-y-px border-b border-border/70 pb-1.5 transition-colors focus-within:border-ring`,children:[n,(0,T.jsx)(j,{...e,className:`[&_input]:h-6.5 [&_input]:ps-5 [&_input]:font-sans [&_input]:leading-6.5`,showTrigger:!1,size:`sm`,unstyled:!0})]})}),t[1]=e,t[2]=r),r}function N(e){let t=(0,O.c)(8),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({className:r,children:n,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a;return t[4]!==n||t[5]!==r||t[6]!==i?(a=(0,T.jsx)(d,{className:r,"data-slot":`combobox-trigger`,...i,children:n}),t[4]=n,t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function P(e){let t=(0,O.c)(24),n,r,i,a,s,c,u,d;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],s=t[5],c=t[6],u=t[7],d=t[8]):({className:a,children:i,side:c,sideOffset:u,alignOffset:n,align:d,anchor:r,...s}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=s,t[6]=c,t[7]=u,t[8]=d);let f=c===void 0?`bottom`:c,p=u===void 0?4:u,m=d===void 0?`start`:d,{chipsRef:h,multiple:g}=w.use(k),v=r??(g?h:void 0),y;t[9]===a?y=t[10]:(y=o(`dropdown-glass relative flex max-h-full min-w-(--anchor-width) max-w-(--available-width) origin-(--transform-origin) rounded-2xl shadow-[0_16px_40px_-18px_rgb(0_0_0/55%)] transition-[scale,opacity] dark:shadow-[0_18px_44px_-18px_rgb(0_0_0/80%)]`,a),t[9]=a,t[10]=y);let x;t[11]!==i||t[12]!==s?(x=(0,T.jsx)(l,{className:`flex min-w-0 max-h-[min(var(--available-height),23rem)] flex-1 flex-col overflow-hidden text-foreground`,"data-slot":`combobox-popup`,...s,children:i}),t[11]=i,t[12]=s,t[13]=x):x=t[13];let S;t[14]!==y||t[15]!==x?(S=(0,T.jsx)(`span`,{className:y,children:x}),t[14]=y,t[15]=x,t[16]=S):S=t[16];let C;return t[17]!==m||t[18]!==n||t[19]!==v||t[20]!==f||t[21]!==p||t[22]!==S?(C=(0,T.jsx)(b,{children:(0,T.jsx)(_,{align:m,alignOffset:n,anchor:v,className:`z-[130] select-none`,"data-slot":`combobox-positioner`,side:f,sideOffset:p,children:S})}),t[17]=m,t[18]=n,t[19]=v,t[20]=f,t[21]=p,t[22]=S,t[23]=C):C=t[23],C}function F(e){let t=(0,O.c)(13),n,r,i,a;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4]):({className:r,children:n,hideIndicator:a,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a);let s;t[5]===r?s=t[6]:(s=o(`flex min-h-8 in-data-[side=none]:min-w-[calc(var(--anchor-width)+1.25rem)] cursor-pointer items-center rounded-xl px-2 py-1 text-base outline-none not-data-disabled:hover:bg-accent data-disabled:pointer-events-none data-disabled:cursor-not-allowed data-selected:bg-accent data-selected:text-foreground data-highlighted:bg-accent data-highlighted:text-accent-foreground [&[data-highlighted][data-selected]]:bg-accent [&[data-highlighted][data-selected]]:text-accent-foreground data-disabled:opacity-64 sm:min-h-7 sm:text-sm [&_svg:not([class*='size-'])]:size-4.5 sm:[&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0`,r),t[5]=r,t[6]=s);let c;t[7]===n?c=t[8]:(c=(0,T.jsx)(`div`,{className:`flex min-w-0 flex-1 items-center gap-2 [&_svg:not([class*='text-'])]:text-muted-foreground`,"data-slot":`combobox-item-content`,children:n}),t[7]=n,t[8]=c);let l;return t[9]!==i||t[10]!==s||t[11]!==c?(l=(0,T.jsx)(y,{className:s,"data-slot":`combobox-item`,...i,children:c}),t[9]=i,t[10]=s,t[11]=c,t[12]=l):l=t[12],l}function I(e){let t=(0,O.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=o(`not-empty:p-2 text-center text-base text-muted-foreground sm:text-sm`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,T.jsx)(g,{className:i,"data-slot":`combobox-empty`,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function L(e){let t=(0,O.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=o(`not-empty:scroll-py-1 not-empty:px-1 not-empty:py-1`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,T.jsx)(C,{scrollbarGutter:!0,scrollFade:!0,children:(0,T.jsx)(m,{className:i,"data-slot":`combobox-list`,...r})}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function R(e){let t=(0,O.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=o(`size-full min-w-0 not-empty:px-1 not-empty:py-1`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,T.jsx)(m,{className:i,"data-slot":`combobox-list`,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function z(e){let t=(0,O.c)(6),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;return t[3]!==n||t[4]!==r?(i=(0,T.jsx)(x,{className:n,"data-slot":`combobox-clear`,...r}),t[3]=n,t[4]=r,t[5]=i):i=t[5],i}function B(e){let t=(0,O.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=o(`px-3 py-2 font-medium text-muted-foreground text-xs empty:m-0 empty:p-0`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,T.jsx)(D,{className:i,"data-slot":`combobox-status`,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}var V=f;export{R as a,B as c,E as d,L as i,N as l,I as n,P as o,F as r,M as s,A as t,V as u};
2
- //# sourceMappingURL=combobox-C6NpXSFx.js.map
1
+ import{a as e,t}from"./react-BUfh6y28.js";import{n,t as r}from"./jsx-runtime-DJeoFXNw.js";import{Fd as i,lm as a,rh as o,t as s,wo as c}from"./utils-Dv1DrWoz.js";import{a as l,c as u,f as d,h as f,i as p,l as m,m as h,n as g,o as _,p as v,r as y,s as b,t as x}from"./ComboboxClear-DkaA60b7.js";import{t as S}from"./input-D8R-9BO3.js";import{t as C}from"./scroll-area-DJaTwtcr.js";var w=e(t()),T=e(r());function E(e){let{multiple:t=!1,defaultValue:n,value:r,onValueChange:i,autoComplete:a,...o}=e;return(0,T.jsx)(h,{...o,selectionMode:t?`multiple`:`single`,selectedValue:r,defaultSelectedValue:n,onSelectedValueChange:i,formAutoComplete:a})}var D=w.forwardRef(function(e,t){let{render:n,className:r,style:i,children:a,...o}=e,s=u();return c(`div`,e,{ref:[t,s],props:[{children:a,role:`status`,"aria-live":`polite`,"aria-atomic":!0},o]})}),O=n(),k=w.createContext({chipsRef:null,multiple:!1});function A(e){let t=(0,O.c)(7),n=w.useRef(null),r=!!e.multiple,i;t[0]===r?i=t[1]:(i={chipsRef:n,multiple:r},t[0]=r,t[1]=i);let a=i,o;t[2]===e?o=t[3]:(o=(0,T.jsx)(E,{...e}),t[2]=e,t[3]=o);let s;return t[4]!==o||t[5]!==a?(s=(0,T.jsx)(k,{value:a,children:o}),t[4]=o,t[5]=a,t[6]=s):s=t[6],s}function j(e){let t=(0,O.c)(35),n,r,a,c,l,u,d;t[0]===e?(n=t[1],r=t[2],a=t[3],c=t[4],l=t[5],u=t[6],d=t[7]):({className:n,showTrigger:l,showClear:u,startAddon:c,size:a,unstyled:d,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=a,t[4]=c,t[5]=l,t[6]=u,t[7]=d);let f=l===void 0||l,m=u!==void 0&&u,h=d!==void 0&&d,g=a??`default`,_;t[8]===c?_=t[9]:(_=c&&(0,T.jsx)(`div`,{"aria-hidden":`true`,className:`[&_svg]:-mx-0.5 pointer-events-none absolute inset-y-0 start-px z-10 flex items-center ps-[calc(--spacing(3)-1px)] opacity-80 has-[+[data-size=sm]]:ps-[calc(--spacing(2.5)-1px)] [&_svg:not([class*='size-'])]:size-4.5 sm:[&_svg:not([class*='size-'])]:size-4`,"data-slot":`combobox-start-addon`,children:c}),t[8]=c,t[9]=_);let y=c&&`data-[size=sm]:*:data-[slot=combobox-input]:ps-[calc(--spacing(7.5)-1px)] *:data-[slot=combobox-input]:ps-[calc(--spacing(8.5)-1px)] sm:data-[size=sm]:*:data-[slot=combobox-input]:ps-[calc(--spacing(7)-1px)] sm:*:data-[slot=combobox-input]:ps-[calc(--spacing(8)-1px)]`,b=g===`sm`?`has-[+[data-slot=combobox-trigger],+[data-slot=combobox-clear]]:*:data-[slot=combobox-input]:pe-6.5`:`has-[+[data-slot=combobox-trigger],+[data-slot=combobox-clear]]:*:data-[slot=combobox-input]:pe-7`,x;t[10]!==n||t[11]!==y||t[12]!==b?(x=s(y,b,n),t[10]=n,t[11]=y,t[12]=b,t[13]=x):x=t[13];let C=h&&`rounded-none bg-transparent text-sm`,w;t[14]===C?w=t[15]:(w=s(`has-disabled:opacity-100`,C),t[14]=C,t[15]=w);let E;t[16]!==g||t[17]!==w||t[18]!==h?(E=(0,T.jsx)(S,{className:w,nativeInput:!0,size:g,unstyled:h}),t[16]=g,t[17]=w,t[18]=h,t[19]=E):E=t[19];let D;t[20]!==r||t[21]!==E||t[22]!==x?(D=(0,T.jsx)(v,{className:x,"data-slot":`combobox-input`,render:E,...r}),t[20]=r,t[21]=E,t[22]=x,t[23]=D):D=t[23];let k;t[24]!==f||t[25]!==g?(k=f&&(0,T.jsx)(N,{className:s(`-translate-y-1/2 absolute top-1/2 inline-flex size-8 shrink-0 cursor-pointer items-center justify-center rounded-md border border-transparent opacity-80 outline-none transition-opacity pointer-coarse:after:absolute pointer-coarse:after:min-h-11 pointer-coarse:after:min-w-11 hover:opacity-100 has-[+[data-slot=combobox-clear]]:hidden sm:size-7 [&_svg:not([class*='size-'])]:size-4.5 sm:[&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0`,g===`sm`?`end-0`:`end-0.5`),children:(0,T.jsx)(p,{"data-slot":`combobox-icon`,children:(0,T.jsx)(i,{})})}),t[24]=f,t[25]=g,t[26]=k):k=t[26];let A;t[27]!==m||t[28]!==g?(A=m&&(0,T.jsx)(z,{className:s(`-translate-y-1/2 absolute top-1/2 inline-flex size-8 shrink-0 cursor-pointer items-center justify-center rounded-md border border-transparent opacity-80 outline-none transition-opacity pointer-coarse:after:absolute pointer-coarse:after:min-h-11 pointer-coarse:after:min-w-11 hover:opacity-100 has-[+[data-slot=combobox-clear]]:hidden sm:size-7 [&_svg:not([class*='size-'])]:size-4.5 sm:[&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0`,g===`sm`?`end-0`:`end-0.5`),children:(0,T.jsx)(o,{})}),t[27]=m,t[28]=g,t[29]=A):A=t[29];let j;return t[30]!==D||t[31]!==k||t[32]!==A||t[33]!==_?(j=(0,T.jsxs)(`div`,{className:`relative not-has-[>*.w-full]:w-fit w-full text-foreground has-disabled:opacity-64`,children:[_,D,k,A]}),t[30]=D,t[31]=k,t[32]=A,t[33]=_,t[34]=j):j=t[34],j}function M(e){let t=(0,O.c)(3),n;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,T.jsx)(a,{"aria-hidden":`true`,className:`pointer-events-none absolute top-1.5 left-0 size-4 shrink-0 text-muted-foreground/55`}),t[0]=n):n=t[0];let r;return t[1]===e?r=t[2]:(r=(0,T.jsx)(`div`,{className:`min-w-0 shrink-0 px-3 pt-2.5`,children:(0,T.jsxs)(`div`,{className:`relative -translate-y-px border-b border-border/70 pb-1.5 transition-colors focus-within:border-ring`,children:[n,(0,T.jsx)(j,{...e,className:`[&_input]:h-6.5 [&_input]:ps-5 [&_input]:font-sans [&_input]:leading-6.5`,showTrigger:!1,size:`sm`,unstyled:!0})]})}),t[1]=e,t[2]=r),r}function N(e){let t=(0,O.c)(8),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({className:r,children:n,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a;return t[4]!==n||t[5]!==r||t[6]!==i?(a=(0,T.jsx)(d,{className:r,"data-slot":`combobox-trigger`,...i,children:n}),t[4]=n,t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function P(e){let t=(0,O.c)(24),n,r,i,a,o,c,u,d;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],o=t[5],c=t[6],u=t[7],d=t[8]):({className:a,children:i,side:c,sideOffset:u,alignOffset:n,align:d,anchor: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]=u,t[8]=d);let f=c===void 0?`bottom`:c,p=u===void 0?4:u,m=d===void 0?`start`:d,{chipsRef:h,multiple:g}=w.use(k),v=r??(g?h:void 0),y;t[9]===a?y=t[10]:(y=s(`dropdown-glass relative flex max-h-full min-w-(--anchor-width) max-w-(--available-width) origin-(--transform-origin) rounded-2xl shadow-[0_16px_40px_-18px_rgb(0_0_0/55%)] transition-[scale,opacity] dark:shadow-[0_18px_44px_-18px_rgb(0_0_0/80%)]`,a),t[9]=a,t[10]=y);let x;t[11]!==i||t[12]!==o?(x=(0,T.jsx)(l,{className:`flex min-w-0 max-h-[min(var(--available-height),23rem)] flex-1 flex-col overflow-hidden text-foreground`,"data-slot":`combobox-popup`,...o,children:i}),t[11]=i,t[12]=o,t[13]=x):x=t[13];let S;t[14]!==y||t[15]!==x?(S=(0,T.jsx)(`span`,{className:y,children:x}),t[14]=y,t[15]=x,t[16]=S):S=t[16];let C;return t[17]!==m||t[18]!==n||t[19]!==v||t[20]!==f||t[21]!==p||t[22]!==S?(C=(0,T.jsx)(b,{children:(0,T.jsx)(_,{align:m,alignOffset:n,anchor:v,className:`z-[130] select-none`,"data-slot":`combobox-positioner`,side:f,sideOffset:p,children:S})}),t[17]=m,t[18]=n,t[19]=v,t[20]=f,t[21]=p,t[22]=S,t[23]=C):C=t[23],C}function F(e){let t=(0,O.c)(13),n,r,i,a;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4]):({className:r,children:n,hideIndicator:a,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a);let o;t[5]===r?o=t[6]:(o=s(`flex min-h-8 in-data-[side=none]:min-w-[calc(var(--anchor-width)+1.25rem)] cursor-pointer items-center rounded-xl px-2 py-1 text-base outline-none not-data-disabled:hover:bg-accent data-disabled:pointer-events-none data-disabled:cursor-not-allowed data-selected:bg-accent data-selected:text-foreground data-highlighted:bg-accent data-highlighted:text-accent-foreground [&[data-highlighted][data-selected]]:bg-accent [&[data-highlighted][data-selected]]:text-accent-foreground data-disabled:opacity-64 sm:min-h-7 sm:text-sm [&_svg:not([class*='size-'])]:size-4.5 sm:[&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0`,r),t[5]=r,t[6]=o);let c;t[7]===n?c=t[8]:(c=(0,T.jsx)(`div`,{className:`flex min-w-0 flex-1 items-center gap-2 [&_svg:not([class*='text-'])]:text-muted-foreground`,"data-slot":`combobox-item-content`,children:n}),t[7]=n,t[8]=c);let l;return t[9]!==i||t[10]!==o||t[11]!==c?(l=(0,T.jsx)(y,{className:o,"data-slot":`combobox-item`,...i,children:c}),t[9]=i,t[10]=o,t[11]=c,t[12]=l):l=t[12],l}function I(e){let t=(0,O.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=s(`not-empty:p-2 text-center text-base text-muted-foreground sm:text-sm`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,T.jsx)(g,{className:i,"data-slot":`combobox-empty`,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function L(e){let t=(0,O.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=s(`not-empty:scroll-py-1 not-empty:px-1 not-empty:py-1`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,T.jsx)(C,{scrollbarGutter:!0,scrollFade:!0,children:(0,T.jsx)(m,{className:i,"data-slot":`combobox-list`,...r})}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function R(e){let t=(0,O.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=s(`size-full min-w-0 not-empty:px-1 not-empty:py-1`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,T.jsx)(m,{className:i,"data-slot":`combobox-list`,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function z(e){let t=(0,O.c)(6),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;return t[3]!==n||t[4]!==r?(i=(0,T.jsx)(x,{className:n,"data-slot":`combobox-clear`,...r}),t[3]=n,t[4]=r,t[5]=i):i=t[5],i}function B(e){let t=(0,O.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=s(`px-3 py-2 font-medium text-muted-foreground text-xs empty:m-0 empty:p-0`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,T.jsx)(D,{className:i,"data-slot":`combobox-status`,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}var V=f;export{R as a,B as c,E as d,L as i,N as l,I as n,P as o,F as r,M as s,A as t,V as u};
2
+ //# sourceMappingURL=combobox-CzEFd5LA.js.map
@@ -1,2 +1,2 @@
1
- import{a as e,t}from"./react-BUfh6y28.js";import{n,t as r}from"./jsx-runtime-DJeoFXNw.js";import{Id as i,dr as a,ih as o,kn as s,t as c,um as l}from"./utils-BlwLA0C4.js";import{a as u,f as d,g as f,i as p,l as m,m as h,n as g,o as _,p as v,r as y,s as b,t as x,u as S}from"./ComboboxClear-CRWQGFjR.js";import{n as C,t as w}from"./ComboboxGroupLabel-BMo03qXe.js";import{t as ee}from"./input-CySdZpuF.js";import{t as T}from"./scroll-area-DMQd4YlU.js";import{n as E,o as D,r as O,s as k,u as A}from"./DialogTitle-CACErOl5.js";import{f as j,u as M}from"./dialog-r1KpDpid.js";var N=e(t()),P=e(r());function F(e){let{openOnInputClick:t=!1,value:n,defaultValue:r,onValueChange:i,mode:a=`list`,itemToStringValue:o,...c}=e,l=a===`inline`||a===`both`,u=a===`inline`||a===`none`,d=n!==void 0,[p,m]=N.useState(r??``),[g,_]=N.useState(``);N.useEffect(()=>{d&&_(``)},[n,d]);let v;v=l&&g!==``?g:d?n??``:p;let y=f(),b=N.useMemo(()=>c.filter===void 0?y.contains:c.filter,[c.filter,y]),x=String(d?n:p).trim(),S=N.useMemo(()=>a===`both`?b===null?null:(e,t,n)=>b(e,x,n):u?null:b,[b,a,x,u]);function C(e,t){_(``),d||m(e),i?.(e,t)}function w(t,n){e.onItemHighlighted?.(t,n),n.reason!==`pointer`&&_(l?t==null?``:s(t,o):``)}return(0,P.jsx)(h,{...c,itemToStringLabel:o,openOnInputClick:t,selectionMode:`none`,fillInputOnItemPress:!0,filter:S,autoComplete:a,inputValue:v,defaultInputValue:r,onInputValueChange:C,onItemHighlighted:w})}var I=d,L=y,R=n(),z=F;function B(e){let t=(0,R.c)(30),n,r,a,s,l,u;t[0]===e?(n=t[1],r=t[2],a=t[3],s=t[4],l=t[5],u=t[6]):({className:n,showTrigger:l,showClear:u,startAddon:s,size:a,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=a,t[4]=s,t[5]=l,t[6]=u);let d=l!==void 0&&l,f=u!==void 0&&u,m=a??`default`,h;t[7]===s?h=t[8]:(h=s&&(0,P.jsx)(`div`,{"aria-hidden":`true`,className:`[&_svg]:-mx-0.5 pointer-events-none has-[button]:pointer-events-auto absolute inset-y-0 start-px z-10 flex items-center ps-[calc(--spacing(3)-1px)] opacity-80 has-[+[data-size=sm]]:ps-[calc(--spacing(2.5)-1px)] [&_svg:not([class*='size-'])]:size-4.5 sm:[&_svg:not([class*='size-'])]:size-4`,"data-slot":`autocomplete-start-addon`,children:s}),t[7]=s,t[8]=h);let g=s&&`data-[size=sm]:*:data-[slot=autocomplete-input]:ps-[calc(--spacing(7.5)-1px)] *:data-[slot=autocomplete-input]:ps-[calc(--spacing(8.5)-1px)] sm:data-[size=sm]:*:data-[slot=autocomplete-input]:ps-[calc(--spacing(7)-1px)] sm:*:data-[slot=autocomplete-input]:ps-[calc(--spacing(8)-1px)]`,_=m===`sm`?`has-[+[data-slot=autocomplete-trigger],+[data-slot=autocomplete-clear]]:*:data-[slot=autocomplete-input]:pe-6.5`:`has-[+[data-slot=autocomplete-trigger],+[data-slot=autocomplete-clear]]:*:data-[slot=autocomplete-input]:pe-7`,y;t[9]!==n||t[10]!==g||t[11]!==_?(y=c(g,_,n),t[9]=n,t[10]=g,t[11]=_,t[12]=y):y=t[12];let b;t[13]===m?b=t[14]:(b=(0,P.jsx)(ee,{nativeInput:!0,size:m}),t[13]=m,t[14]=b);let x;t[15]!==r||t[16]!==y||t[17]!==b?(x=(0,P.jsx)(v,{className:y,"data-slot":`autocomplete-input`,render:b,...r}),t[15]=r,t[16]=y,t[17]=b,t[18]=x):x=t[18];let S;t[19]!==d||t[20]!==m?(S=d&&(0,P.jsx)(Q,{className:c(`-translate-y-1/2 absolute top-1/2 inline-flex size-8 shrink-0 cursor-pointer items-center justify-center rounded-md border border-transparent opacity-80 outline-none transition-colors pointer-coarse:after:absolute pointer-coarse:after:min-h-11 pointer-coarse:after:min-w-11 hover:opacity-100 has-[+[data-slot=autocomplete-clear]]:hidden sm:size-7 [&_svg:not([class*='size-'])]:size-4.5 sm:[&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0`,m===`sm`?`end-0`:`end-0.5`),children:(0,P.jsx)(p,{"data-slot":`autocomplete-icon`,children:(0,P.jsx)(i,{})})}),t[19]=d,t[20]=m,t[21]=S):S=t[21];let C;t[22]!==f||t[23]!==m?(C=f&&(0,P.jsx)(X,{className:c(`-translate-y-1/2 absolute top-1/2 inline-flex size-8 shrink-0 cursor-pointer items-center justify-center rounded-md border border-transparent opacity-80 outline-none transition-colors pointer-coarse:after:absolute pointer-coarse:after:min-h-11 pointer-coarse:after:min-w-11 hover:opacity-100 has-[+[data-slot=autocomplete-clear]]:hidden sm:size-7 [&_svg:not([class*='size-'])]:size-4.5 sm:[&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0`,m===`sm`?`end-0`:`end-0.5`),children:(0,P.jsx)(o,{})}),t[22]=f,t[23]=m,t[24]=C):C=t[24];let w;return t[25]!==C||t[26]!==h||t[27]!==x||t[28]!==S?(w=(0,P.jsxs)(`div`,{className:`relative not-has-[>*.w-full]:w-fit w-full text-foreground has-disabled:opacity-64`,children:[h,x,S,C]}),t[25]=C,t[26]=h,t[27]=x,t[28]=S,t[29]=w):w=t[29],w}function V(e){let t=(0,R.c)(24),n,r,i,a,o,s,l,d;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],o=t[5],s=t[6],l=t[7],d=t[8]):({className:a,children:i,side:s,sideOffset:l,alignOffset:n,align:d,anchor:r,...o}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o,t[6]=s,t[7]=l,t[8]=d);let f=s===void 0?`bottom`:s,p=l===void 0?4:l,m=d===void 0?`start`:d,h;t[9]===a?h=t[10]:(h=c(`relative flex max-h-full min-w-(--anchor-width) max-w-(--available-width) origin-(--transform-origin) rounded-lg border bg-popover not-dark:bg-clip-padding shadow-lg/5 transition-[scale,opacity] before:pointer-events-none before:absolute before:inset-0 before:rounded-[calc(var(--radius-lg)-1px)] before:shadow-[0_1px_--theme(--color-black/4%)] dark:before:shadow-[0_-1px_--theme(--color-white/6%)]`,a),t[9]=a,t[10]=h);let g;t[11]!==i||t[12]!==o?(g=(0,P.jsx)(u,{className:`flex max-h-[min(var(--available-height),23rem)] flex-1 flex-col text-foreground`,"data-slot":`autocomplete-popup`,...o,children:i}),t[11]=i,t[12]=o,t[13]=g):g=t[13];let v;t[14]!==h||t[15]!==g?(v=(0,P.jsx)(`span`,{className:h,children:g}),t[14]=h,t[15]=g,t[16]=v):v=t[16];let y;return t[17]!==m||t[18]!==n||t[19]!==r||t[20]!==f||t[21]!==p||t[22]!==v?(y=(0,P.jsx)(b,{children:(0,P.jsx)(_,{align:m,alignOffset:n,anchor:r,className:`z-[130] select-none`,"data-slot":`autocomplete-positioner`,side:f,sideOffset:p,children:v})}),t[17]=m,t[18]=n,t[19]=r,t[20]=f,t[21]=p,t[22]=v,t[23]=y):y=t[23],y}function H(e){let t=(0,R.c)(10),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({className:r,children:n,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a;t[4]===r?a=t[5]:(a=c(`flex min-h-8 cursor-default select-none items-center gap-2 rounded-sm px-2 py-1 text-base outline-none hover:bg-accent data-disabled:pointer-events-none data-selected:bg-accent/50 data-selected:text-foreground data-highlighted:bg-accent data-highlighted:text-accent-foreground [&[data-highlighted][data-selected]]:bg-accent [&[data-highlighted][data-selected]]:text-accent-foreground data-disabled:opacity-64 sm:min-h-7 sm:text-sm [&_svg:not([class*='text-'])]:text-muted-foreground`,r),t[4]=r,t[5]=a);let o;return t[6]!==n||t[7]!==i||t[8]!==a?(o=(0,P.jsx)(L,{className:a,"data-slot":`autocomplete-item`,...i,children:n}),t[6]=n,t[7]=i,t[8]=a,t[9]=o):o=t[9],o}function U(e){let t=(0,R.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=c(`[[role=group]+&]:mt-1.5`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,P.jsx)(C,{className:i,"data-slot":`autocomplete-group`,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}var W=`px-2 py-1.5 font-medium text-muted-foreground text-xs`;function G(e){let t=(0,R.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=c(W,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,P.jsx)(w,{className:i,"data-slot":`autocomplete-group-label`,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function K(e){let t=(0,R.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=c(W,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,P.jsx)(`div`,{className:i,"data-slot":`autocomplete-group-label`,role:`presentation`,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function q(e){let t=(0,R.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=c(`size-full min-w-0`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,P.jsx)(m,{className:i,"data-slot":`autocomplete-list`,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function J(e){let t=(0,R.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=c(`not-empty:p-2 text-center text-base text-muted-foreground sm:text-sm`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,P.jsx)(g,{className:i,"data-slot":`autocomplete-empty`,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function Y(e){let t=(0,R.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=c(`not-empty:scroll-py-1 not-empty:p-1`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,P.jsx)(T,{scrollbarGutter:!0,scrollFade:!0,children:(0,P.jsx)(m,{className:i,"data-slot":`autocomplete-list`,...r})}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function X(e){let t=(0,R.c)(9),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=c(`-translate-y-1/2 absolute end-0.5 top-1/2 inline-flex size-8 shrink-0 cursor-pointer items-center justify-center rounded-md border border-transparent opacity-80 outline-none transition-[color,background-color,box-shadow,opacity] pointer-coarse:after:absolute pointer-coarse:after:min-h-11 pointer-coarse:after:min-w-11 hover:opacity-100 sm:size-7 [&_svg:not([class*='size-'])]:size-4.5 sm:[&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0`,n),t[3]=n,t[4]=i);let a;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,P.jsx)(o,{}),t[5]=a):a=t[5];let s;return t[6]!==r||t[7]!==i?(s=(0,P.jsx)(x,{className:i,"data-slot":`autocomplete-clear`,...r,children:a}),t[6]=r,t[7]=i,t[8]=s):s=t[8],s}function Z(e){let t=(0,R.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,P.jsx)(S,{"data-slot":`autocomplete-collection`,...n}),t[2]=n,t[3]=r),r}function Q(e){let t=(0,R.c)(8),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({className:r,children:n,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a;return t[4]!==n||t[5]!==r||t[6]!==i?(a=(0,P.jsx)(I,{className:r,"data-slot":`autocomplete-trigger`,...i,children:n}),t[4]=n,t[5]=r,t[6]=i,t[7]=a):a=t[7],a}var $=O,te=D;function ne(e){let t=(0,R.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=c(M,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,P.jsx)(A,{className:i,"data-slot":`command-dialog-backdrop`,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function re(e){let t=(0,R.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=c(`pointer-events-none fixed inset-0 z-50 flex flex-col items-center px-4 py-[max(--spacing(4),4vh)] sm:py-[10vh]`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,P.jsx)(E,{className:i,"data-slot":`command-dialog-viewport`,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function ie(e){let t=(0,R.c)(16),n,r,i,a;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4]):({className:r,children:n,onBackdropPointerDown:i,...a}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a);let o;t[5]===i?o=t[6]:(o=(0,P.jsx)(ne,{onPointerDown:i}),t[5]=i,t[6]=o);let s;t[7]===r?s=t[8]:(s=c(j,`pointer-events-auto max-h-105 max-w-xl text-foreground`,r),t[7]=r,t[8]=s);let l;t[9]!==n||t[10]!==a||t[11]!==s?(l=(0,P.jsx)(re,{children:(0,P.jsx)(k,{className:s,"data-slot":`command-dialog-popup`,...a,children:n})}),t[9]=n,t[10]=a,t[11]=s,t[12]=l):l=t[12];let u;return t[13]!==o||t[14]!==l?(u=(0,P.jsxs)(te,{children:[o,l]}),t[13]=o,t[14]=l,t[15]=u):u=t[15],u}function ae(e){let t=(0,R.c)(8),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({autoHighlight:r,keepHighlight:i,...n}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a=r===void 0?`always`:r,o=i===void 0||i,s;return t[4]!==a||t[5]!==o||t[6]!==n?(s=(0,P.jsx)(z,{autoHighlight:a,inline:!0,keepHighlight:o,open:!0,...n}),t[4]=a,t[5]=o,t[6]=n,t[7]=s):s=t[7],s}function oe(e){let t=(0,R.c)(11),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({className:n,placeholder:r,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a;t[4]===n?a=t[5]:(a=c(`border-transparent! bg-transparent! shadow-none before:hidden has-focus-visible:ring-0 placeholder:text-placeholder *:data-[slot=autocomplete-input]:ps-9! sm:*:data-[slot=autocomplete-input]:ps-[calc(var(--command-shell-inset)+1.5rem)]!`,n),t[4]=n,t[5]=a);let o;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,P.jsx)(l,{className:`translate-x-0.5 text-icon-muted`}),t[6]=o):o=t[6];let s;return t[7]!==r||t[8]!==i||t[9]!==a?(s=(0,P.jsx)(`div`,{className:`px-[var(--command-shell-inset)] py-1.5 [&_[data-slot=autocomplete-start-addon]]:ps-[calc(var(--command-shell-inset)+0.0625rem)]`,children:(0,P.jsx)(B,{autoFocus:!0,className:a,placeholder:r,size:`lg`,startAddon:o,...i})}),t[7]=r,t[8]=i,t[9]=a,t[10]=s):s=t[10],s}function se(e){let t=(0,R.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=c(`not-empty:scroll-py-2 not-empty:p-2`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,P.jsx)(Y,{className:i,"data-slot":`command-list`,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function ce(e){let t=(0,R.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=c(`flex max-h-[inherit] flex-col`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,P.jsx)(q,{className:i,"data-slot":`command-list`,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function le(e){let t=(0,R.c)(6),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;return t[3]!==n||t[4]!==r?(i=(0,P.jsx)(K,{className:n,"data-slot":`command-group-label`,...r}),t[3]=n,t[4]=r,t[5]=i):i=t[5],i}function ue(e){let t=(0,R.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=c(`relative min-h-0 overflow-hidden rounded-t-xl not-has-[+[data-slot=command-footer]]:rounded-b-2xl bg-transparent **:data-[slot=scroll-area-scrollbar]:mt-2 [touch-action:pan-y]`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,P.jsx)(`div`,{className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function de(e){let t=(0,R.c)(6),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;return t[3]!==n||t[4]!==r?(i=(0,P.jsx)(U,{className:n,"data-slot":`command-group`,...r}),t[3]=n,t[4]=r,t[5]=i):i=t[5],i}function fe(e){let t=(0,R.c)(6),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;return t[3]!==n||t[4]!==r?(i=(0,P.jsx)(G,{className:n,"data-slot":`command-group-label`,...r}),t[3]=n,t[4]=r,t[5]=i):i=t[5],i}function pe(e){let t=(0,R.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,P.jsx)(Z,{"data-slot":`command-collection`,...n}),t[2]=n,t[3]=r),r}function me(e){let t=(0,R.c)(12),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({className:r,active:n,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a=n!==void 0&&`cursor-pointer hover:bg-transparent hover:text-inherit data-highlighted:bg-transparent data-highlighted:text-inherit data-selected:bg-transparent data-selected:text-inherit [&[data-highlighted][data-selected]]:bg-transparent [&[data-highlighted][data-selected]]:text-inherit`,o=n&&`bg-accent! text-accent-foreground!`,s;t[4]!==r||t[5]!==a||t[6]!==o?(s=c(`py-1.5 data-selected:bg-foreground/[0.06] data-highlighted:bg-foreground/[0.09] data-highlighted:text-foreground [&[data-highlighted][data-selected]]:bg-foreground/[0.09] [&[data-highlighted][data-selected]]:text-foreground`,a,o,r),t[4]=r,t[5]=a,t[6]=o,t[7]=s):s=t[7];let l=n||void 0,u;return t[8]!==i||t[9]!==s||t[10]!==l?(u=(0,P.jsx)(H,{className:s,"data-active":l,"data-slot":`command-item`,...i}),t[8]=i,t[9]=s,t[10]=l,t[11]=u):u=t[11],u}function he(e){let t=(0,R.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=c(`ms-auto font-medium font-sans text-secondary-label text-xs tracking-widest`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,P.jsx)(`kbd`,{className:i,"data-slot":`command-shortcut`,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function ge(e){let t=(0,R.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=c(`relative flex items-center justify-between gap-2 rounded-b-[calc(var(--radius-2xl)-1px)] bg-foreground/[0.025] px-[var(--command-content-inset)] py-2.5 font-medium text-sm text-muted-foreground [&_[data-slot=kbd-group]]:font-sans [&_[data-slot=kbd]]:bg-foreground/[0.08] [&_[data-slot=kbd]]:text-foreground [&_[data-slot=kbd]]:ring-0`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,P.jsx)(`div`,{className:i,"data-slot":`command-footer`,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function _e(e){let t=(0,R.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=c(`h-auto px-2 text-xs hover:bg-transparent`,n),t[3]=n,t[4]=i);let o;return t[5]!==r||t[6]!==i?(o=(0,P.jsx)(a,{...r,variant:`ghost-muted`,size:`xs`,className:i}),t[5]=r,t[6]=i,t[7]=o):o=t[7],o}export{J as _,ge as a,Y as b,fe as c,se as d,le as f,z as g,he as h,ie as i,oe as l,ue as m,pe as n,_e as o,ce as p,$ as r,de as s,ae as t,me as u,B as v,V as x,H as y};
2
- //# sourceMappingURL=command-BOsIZcjU.js.map
1
+ import{a as e,t}from"./react-BUfh6y28.js";import{n,t as r}from"./jsx-runtime-DJeoFXNw.js";import{Fd as i,dr as a,kn as o,lm as s,rh as c,t as l}from"./utils-Dv1DrWoz.js";import{a as u,f as d,g as f,i as p,l as m,m as h,n as g,o as _,p as v,r as y,s as b,t as x,u as S}from"./ComboboxClear-DkaA60b7.js";import{n as C,t as w}from"./ComboboxGroupLabel-AEuoHUH8.js";import{t as ee}from"./input-D8R-9BO3.js";import{t as T}from"./scroll-area-DJaTwtcr.js";import{n as E,o as D,r as O,s as k,u as A}from"./DialogTitle-Bz-7IYD8.js";import{f as j,u as M}from"./dialog-B69qrNtB.js";var N=e(t()),P=e(r());function F(e){let{openOnInputClick:t=!1,value:n,defaultValue:r,onValueChange:i,mode:a=`list`,itemToStringValue:s,...c}=e,l=a===`inline`||a===`both`,u=a===`inline`||a===`none`,d=n!==void 0,[p,m]=N.useState(r??``),[g,_]=N.useState(``);N.useEffect(()=>{d&&_(``)},[n,d]);let v;v=l&&g!==``?g:d?n??``:p;let y=f(),b=N.useMemo(()=>c.filter===void 0?y.contains:c.filter,[c.filter,y]),x=String(d?n:p).trim(),S=N.useMemo(()=>a===`both`?b===null?null:(e,t,n)=>b(e,x,n):u?null:b,[b,a,x,u]);function C(e,t){_(``),d||m(e),i?.(e,t)}function w(t,n){e.onItemHighlighted?.(t,n),n.reason!==`pointer`&&_(l?t==null?``:o(t,s):``)}return(0,P.jsx)(h,{...c,itemToStringLabel:s,openOnInputClick:t,selectionMode:`none`,fillInputOnItemPress:!0,filter:S,autoComplete:a,inputValue:v,defaultInputValue:r,onInputValueChange:C,onItemHighlighted:w})}var I=d,L=y,R=n(),z=F;function B(e){let t=(0,R.c)(30),n,r,a,o,s,u;t[0]===e?(n=t[1],r=t[2],a=t[3],o=t[4],s=t[5],u=t[6]):({className:n,showTrigger:s,showClear:u,startAddon:o,size:a,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=a,t[4]=o,t[5]=s,t[6]=u);let d=s!==void 0&&s,f=u!==void 0&&u,m=a??`default`,h;t[7]===o?h=t[8]:(h=o&&(0,P.jsx)(`div`,{"aria-hidden":`true`,className:`[&_svg]:-mx-0.5 pointer-events-none has-[button]:pointer-events-auto absolute inset-y-0 start-px z-10 flex items-center ps-[calc(--spacing(3)-1px)] opacity-80 has-[+[data-size=sm]]:ps-[calc(--spacing(2.5)-1px)] [&_svg:not([class*='size-'])]:size-4.5 sm:[&_svg:not([class*='size-'])]:size-4`,"data-slot":`autocomplete-start-addon`,children:o}),t[7]=o,t[8]=h);let g=o&&`data-[size=sm]:*:data-[slot=autocomplete-input]:ps-[calc(--spacing(7.5)-1px)] *:data-[slot=autocomplete-input]:ps-[calc(--spacing(8.5)-1px)] sm:data-[size=sm]:*:data-[slot=autocomplete-input]:ps-[calc(--spacing(7)-1px)] sm:*:data-[slot=autocomplete-input]:ps-[calc(--spacing(8)-1px)]`,_=m===`sm`?`has-[+[data-slot=autocomplete-trigger],+[data-slot=autocomplete-clear]]:*:data-[slot=autocomplete-input]:pe-6.5`:`has-[+[data-slot=autocomplete-trigger],+[data-slot=autocomplete-clear]]:*:data-[slot=autocomplete-input]:pe-7`,y;t[9]!==n||t[10]!==g||t[11]!==_?(y=l(g,_,n),t[9]=n,t[10]=g,t[11]=_,t[12]=y):y=t[12];let b;t[13]===m?b=t[14]:(b=(0,P.jsx)(ee,{nativeInput:!0,size:m}),t[13]=m,t[14]=b);let x;t[15]!==r||t[16]!==y||t[17]!==b?(x=(0,P.jsx)(v,{className:y,"data-slot":`autocomplete-input`,render:b,...r}),t[15]=r,t[16]=y,t[17]=b,t[18]=x):x=t[18];let S;t[19]!==d||t[20]!==m?(S=d&&(0,P.jsx)(Q,{className:l(`-translate-y-1/2 absolute top-1/2 inline-flex size-8 shrink-0 cursor-pointer items-center justify-center rounded-md border border-transparent opacity-80 outline-none transition-colors pointer-coarse:after:absolute pointer-coarse:after:min-h-11 pointer-coarse:after:min-w-11 hover:opacity-100 has-[+[data-slot=autocomplete-clear]]:hidden sm:size-7 [&_svg:not([class*='size-'])]:size-4.5 sm:[&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0`,m===`sm`?`end-0`:`end-0.5`),children:(0,P.jsx)(p,{"data-slot":`autocomplete-icon`,children:(0,P.jsx)(i,{})})}),t[19]=d,t[20]=m,t[21]=S):S=t[21];let C;t[22]!==f||t[23]!==m?(C=f&&(0,P.jsx)(X,{className:l(`-translate-y-1/2 absolute top-1/2 inline-flex size-8 shrink-0 cursor-pointer items-center justify-center rounded-md border border-transparent opacity-80 outline-none transition-colors pointer-coarse:after:absolute pointer-coarse:after:min-h-11 pointer-coarse:after:min-w-11 hover:opacity-100 has-[+[data-slot=autocomplete-clear]]:hidden sm:size-7 [&_svg:not([class*='size-'])]:size-4.5 sm:[&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0`,m===`sm`?`end-0`:`end-0.5`),children:(0,P.jsx)(c,{})}),t[22]=f,t[23]=m,t[24]=C):C=t[24];let w;return t[25]!==C||t[26]!==h||t[27]!==x||t[28]!==S?(w=(0,P.jsxs)(`div`,{className:`relative not-has-[>*.w-full]:w-fit w-full text-foreground has-disabled:opacity-64`,children:[h,x,S,C]}),t[25]=C,t[26]=h,t[27]=x,t[28]=S,t[29]=w):w=t[29],w}function V(e){let t=(0,R.c)(24),n,r,i,a,o,s,c,d;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],o=t[5],s=t[6],c=t[7],d=t[8]):({className:a,children:i,side:s,sideOffset:c,alignOffset:n,align:d,anchor:r,...o}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o,t[6]=s,t[7]=c,t[8]=d);let f=s===void 0?`bottom`:s,p=c===void 0?4:c,m=d===void 0?`start`:d,h;t[9]===a?h=t[10]:(h=l(`relative flex max-h-full min-w-(--anchor-width) max-w-(--available-width) origin-(--transform-origin) rounded-lg border bg-popover not-dark:bg-clip-padding shadow-lg/5 transition-[scale,opacity] before:pointer-events-none before:absolute before:inset-0 before:rounded-[calc(var(--radius-lg)-1px)] before:shadow-[0_1px_--theme(--color-black/4%)] dark:before:shadow-[0_-1px_--theme(--color-white/6%)]`,a),t[9]=a,t[10]=h);let g;t[11]!==i||t[12]!==o?(g=(0,P.jsx)(u,{className:`flex max-h-[min(var(--available-height),23rem)] flex-1 flex-col text-foreground`,"data-slot":`autocomplete-popup`,...o,children:i}),t[11]=i,t[12]=o,t[13]=g):g=t[13];let v;t[14]!==h||t[15]!==g?(v=(0,P.jsx)(`span`,{className:h,children:g}),t[14]=h,t[15]=g,t[16]=v):v=t[16];let y;return t[17]!==m||t[18]!==n||t[19]!==r||t[20]!==f||t[21]!==p||t[22]!==v?(y=(0,P.jsx)(b,{children:(0,P.jsx)(_,{align:m,alignOffset:n,anchor:r,className:`z-[130] select-none`,"data-slot":`autocomplete-positioner`,side:f,sideOffset:p,children:v})}),t[17]=m,t[18]=n,t[19]=r,t[20]=f,t[21]=p,t[22]=v,t[23]=y):y=t[23],y}function H(e){let t=(0,R.c)(10),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({className:r,children:n,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a;t[4]===r?a=t[5]:(a=l(`flex min-h-8 cursor-default select-none items-center gap-2 rounded-sm px-2 py-1 text-base outline-none hover:bg-accent data-disabled:pointer-events-none data-selected:bg-accent/50 data-selected:text-foreground data-highlighted:bg-accent data-highlighted:text-accent-foreground [&[data-highlighted][data-selected]]:bg-accent [&[data-highlighted][data-selected]]:text-accent-foreground data-disabled:opacity-64 sm:min-h-7 sm:text-sm [&_svg:not([class*='text-'])]:text-muted-foreground`,r),t[4]=r,t[5]=a);let o;return t[6]!==n||t[7]!==i||t[8]!==a?(o=(0,P.jsx)(L,{className:a,"data-slot":`autocomplete-item`,...i,children:n}),t[6]=n,t[7]=i,t[8]=a,t[9]=o):o=t[9],o}function U(e){let t=(0,R.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=l(`[[role=group]+&]:mt-1.5`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,P.jsx)(C,{className:i,"data-slot":`autocomplete-group`,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}var W=`px-2 py-1.5 font-medium text-muted-foreground text-xs`;function G(e){let t=(0,R.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=l(W,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,P.jsx)(w,{className:i,"data-slot":`autocomplete-group-label`,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function K(e){let t=(0,R.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=l(W,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,P.jsx)(`div`,{className:i,"data-slot":`autocomplete-group-label`,role:`presentation`,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function q(e){let t=(0,R.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=l(`size-full min-w-0`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,P.jsx)(m,{className:i,"data-slot":`autocomplete-list`,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function J(e){let t=(0,R.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=l(`not-empty:p-2 text-center text-base text-muted-foreground sm:text-sm`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,P.jsx)(g,{className:i,"data-slot":`autocomplete-empty`,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function Y(e){let t=(0,R.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=l(`not-empty:scroll-py-1 not-empty:p-1`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,P.jsx)(T,{scrollbarGutter:!0,scrollFade:!0,children:(0,P.jsx)(m,{className:i,"data-slot":`autocomplete-list`,...r})}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function X(e){let t=(0,R.c)(9),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=l(`-translate-y-1/2 absolute end-0.5 top-1/2 inline-flex size-8 shrink-0 cursor-pointer items-center justify-center rounded-md border border-transparent opacity-80 outline-none transition-[color,background-color,box-shadow,opacity] pointer-coarse:after:absolute pointer-coarse:after:min-h-11 pointer-coarse:after:min-w-11 hover:opacity-100 sm:size-7 [&_svg:not([class*='size-'])]:size-4.5 sm:[&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0`,n),t[3]=n,t[4]=i);let a;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,P.jsx)(c,{}),t[5]=a):a=t[5];let o;return t[6]!==r||t[7]!==i?(o=(0,P.jsx)(x,{className:i,"data-slot":`autocomplete-clear`,...r,children:a}),t[6]=r,t[7]=i,t[8]=o):o=t[8],o}function Z(e){let t=(0,R.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,P.jsx)(S,{"data-slot":`autocomplete-collection`,...n}),t[2]=n,t[3]=r),r}function Q(e){let t=(0,R.c)(8),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({className:r,children:n,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a;return t[4]!==n||t[5]!==r||t[6]!==i?(a=(0,P.jsx)(I,{className:r,"data-slot":`autocomplete-trigger`,...i,children:n}),t[4]=n,t[5]=r,t[6]=i,t[7]=a):a=t[7],a}var $=O,te=D;function ne(e){let t=(0,R.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=l(M,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,P.jsx)(A,{className:i,"data-slot":`command-dialog-backdrop`,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function re(e){let t=(0,R.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=l(`pointer-events-none fixed inset-0 z-50 flex flex-col items-center px-4 py-[max(--spacing(4),4vh)] sm:py-[10vh]`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,P.jsx)(E,{className:i,"data-slot":`command-dialog-viewport`,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function ie(e){let t=(0,R.c)(16),n,r,i,a;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4]):({className:r,children:n,onBackdropPointerDown:i,...a}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a);let o;t[5]===i?o=t[6]:(o=(0,P.jsx)(ne,{onPointerDown:i}),t[5]=i,t[6]=o);let s;t[7]===r?s=t[8]:(s=l(j,`pointer-events-auto max-h-105 max-w-xl text-foreground`,r),t[7]=r,t[8]=s);let c;t[9]!==n||t[10]!==a||t[11]!==s?(c=(0,P.jsx)(re,{children:(0,P.jsx)(k,{className:s,"data-slot":`command-dialog-popup`,...a,children:n})}),t[9]=n,t[10]=a,t[11]=s,t[12]=c):c=t[12];let u;return t[13]!==o||t[14]!==c?(u=(0,P.jsxs)(te,{children:[o,c]}),t[13]=o,t[14]=c,t[15]=u):u=t[15],u}function ae(e){let t=(0,R.c)(8),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({autoHighlight:r,keepHighlight:i,...n}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a=r===void 0?`always`:r,o=i===void 0||i,s;return t[4]!==a||t[5]!==o||t[6]!==n?(s=(0,P.jsx)(z,{autoHighlight:a,inline:!0,keepHighlight:o,open:!0,...n}),t[4]=a,t[5]=o,t[6]=n,t[7]=s):s=t[7],s}function oe(e){let t=(0,R.c)(11),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({className:n,placeholder:r,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a;t[4]===n?a=t[5]:(a=l(`border-transparent! bg-transparent! shadow-none before:hidden has-focus-visible:ring-0 placeholder:text-placeholder *:data-[slot=autocomplete-input]:ps-9! sm:*:data-[slot=autocomplete-input]:ps-[calc(var(--command-shell-inset)+1.5rem)]!`,n),t[4]=n,t[5]=a);let o;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,P.jsx)(s,{className:`translate-x-0.5 text-icon-muted`}),t[6]=o):o=t[6];let c;return t[7]!==r||t[8]!==i||t[9]!==a?(c=(0,P.jsx)(`div`,{className:`px-[var(--command-shell-inset)] py-1.5 [&_[data-slot=autocomplete-start-addon]]:ps-[calc(var(--command-shell-inset)+0.0625rem)]`,children:(0,P.jsx)(B,{autoFocus:!0,className:a,placeholder:r,size:`lg`,startAddon:o,...i})}),t[7]=r,t[8]=i,t[9]=a,t[10]=c):c=t[10],c}function se(e){let t=(0,R.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=l(`not-empty:scroll-py-2 not-empty:p-2`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,P.jsx)(Y,{className:i,"data-slot":`command-list`,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function ce(e){let t=(0,R.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=l(`flex max-h-[inherit] flex-col`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,P.jsx)(q,{className:i,"data-slot":`command-list`,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function le(e){let t=(0,R.c)(6),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;return t[3]!==n||t[4]!==r?(i=(0,P.jsx)(K,{className:n,"data-slot":`command-group-label`,...r}),t[3]=n,t[4]=r,t[5]=i):i=t[5],i}function ue(e){let t=(0,R.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=l(`relative min-h-0 overflow-hidden rounded-t-xl not-has-[+[data-slot=command-footer]]:rounded-b-2xl bg-transparent **:data-[slot=scroll-area-scrollbar]:mt-2 [touch-action:pan-y]`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,P.jsx)(`div`,{className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function de(e){let t=(0,R.c)(6),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;return t[3]!==n||t[4]!==r?(i=(0,P.jsx)(U,{className:n,"data-slot":`command-group`,...r}),t[3]=n,t[4]=r,t[5]=i):i=t[5],i}function fe(e){let t=(0,R.c)(6),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;return t[3]!==n||t[4]!==r?(i=(0,P.jsx)(G,{className:n,"data-slot":`command-group-label`,...r}),t[3]=n,t[4]=r,t[5]=i):i=t[5],i}function pe(e){let t=(0,R.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,P.jsx)(Z,{"data-slot":`command-collection`,...n}),t[2]=n,t[3]=r),r}function me(e){let t=(0,R.c)(12),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({className:r,active:n,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a=n!==void 0&&`cursor-pointer hover:bg-transparent hover:text-inherit data-highlighted:bg-transparent data-highlighted:text-inherit data-selected:bg-transparent data-selected:text-inherit [&[data-highlighted][data-selected]]:bg-transparent [&[data-highlighted][data-selected]]:text-inherit`,o=n&&`bg-accent! text-accent-foreground!`,s;t[4]!==r||t[5]!==a||t[6]!==o?(s=l(`py-1.5 data-selected:bg-foreground/[0.06] data-highlighted:bg-foreground/[0.09] data-highlighted:text-foreground [&[data-highlighted][data-selected]]:bg-foreground/[0.09] [&[data-highlighted][data-selected]]:text-foreground`,a,o,r),t[4]=r,t[5]=a,t[6]=o,t[7]=s):s=t[7];let c=n||void 0,u;return t[8]!==i||t[9]!==s||t[10]!==c?(u=(0,P.jsx)(H,{className:s,"data-active":c,"data-slot":`command-item`,...i}),t[8]=i,t[9]=s,t[10]=c,t[11]=u):u=t[11],u}function he(e){let t=(0,R.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=l(`ms-auto font-medium font-sans text-secondary-label text-xs tracking-widest`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,P.jsx)(`kbd`,{className:i,"data-slot":`command-shortcut`,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function ge(e){let t=(0,R.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=l(`relative flex items-center justify-between gap-2 rounded-b-[calc(var(--radius-2xl)-1px)] bg-foreground/[0.025] px-[var(--command-content-inset)] py-2.5 font-medium text-sm text-muted-foreground [&_[data-slot=kbd-group]]:font-sans [&_[data-slot=kbd]]:bg-foreground/[0.08] [&_[data-slot=kbd]]:text-foreground [&_[data-slot=kbd]]:ring-0`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,P.jsx)(`div`,{className:i,"data-slot":`command-footer`,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function _e(e){let t=(0,R.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=l(`h-auto px-2 text-xs hover:bg-transparent`,n),t[3]=n,t[4]=i);let o;return t[5]!==r||t[6]!==i?(o=(0,P.jsx)(a,{...r,variant:`ghost-muted`,size:`xs`,className:i}),t[5]=r,t[6]=i,t[7]=o):o=t[7],o}export{J as _,ge as a,Y as b,fe as c,se as d,le as f,z as g,he as h,ie as i,oe as l,ue as m,pe as n,_e as o,ce as p,$ as r,de as s,ae as t,me as u,B as v,V as x,H as y};
2
+ //# sourceMappingURL=command-CLf9yckl.js.map
@@ -1,2 +1,2 @@
1
- import{a as e,t}from"./react-BUfh6y28.js";import{n,t as r}from"./jsx-runtime-DJeoFXNw.js";import{dr as i}from"./utils-BlwLA0C4.js";import{j as a}from"./runtime-Csw1ghUb.js";import{t as o}from"./env-wK1YYxA8.js";import{i as s,r as c}from"./dist-D4Fzk6mX.js";import{t as l}from"./authRedirect-DWE5a_T9.js";import{o as u,s as d}from"./main-1tW7jidE.js";import{t as f}from"./AuthSurfaceShell-DT2jFrxd.js";var p=n(),m=e(t(),1),h=e(r(),1);function g(e){let t=(0,p.c)(10),{eyebrow:n,title:r,description:i}=e,a;t[0]===n?a=t[1]:(a=n?(0,h.jsx)(`p`,{className:`text-3xs font-semibold tracking-widest text-primary uppercase`,children:n}):null,t[0]=n,t[1]=a);let o;t[2]===r?o=t[3]:(o=(0,h.jsx)(`h1`,{className:`mt-2 text-2xl font-semibold tracking-tight sm:text-3xl`,children:r}),t[2]=r,t[3]=o);let s;t[4]===i?s=t[5]:(s=(0,h.jsx)(`p`,{className:`mt-2 text-sm leading-relaxed text-muted-foreground`,children:i}),t[4]=i,t[5]=s);let c;return t[6]!==a||t[7]!==o||t[8]!==s?(c=(0,h.jsxs)(h.Fragment,{children:[a,o,s]}),t[6]=a,t[7]=o,t[8]=s,t[9]=c):c=t[9],c}var _={eyebrow:`Authorization request`,title:`This connect link is incomplete`,description:"The link is missing its authorization request. Re-run `p4c connect` in your terminal and open the freshly printed URL."};function v(){let e=(0,p.c)(19),[t]=(0,m.useState)(y),n=s(),{isLoaded:r,isSignedIn:a}=c(),v=(0,m.useRef)(!1),b=(0,m.useRef)(!1),x;e[0]!==n||e[1]!==t?(x=()=>{t&&n.openSignIn(l(d(t,window.location.href),o))},e[0]=n,e[1]=t,e[2]=x):x=e[2];let S=x,C,w;if(e[3]!==r||e[4]!==a||e[5]!==S||e[6]!==t?(C=()=>{if(!t||!r||b.current)return;if(!a){v.current||(v.current=!0,S());return}let e=u(t);e&&(b.current=!0,window.location.assign(e))},w=[r,a,S,t],e[3]=r,e[4]=a,e[5]=S,e[6]=t,e[7]=C,e[8]=w):(C=e[7],w=e[8]),(0,m.useEffect)(C,w),!t){let t;return e[9]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,h.jsx)(f,{children:(0,h.jsx)(g,{..._})}),e[9]=t):t=e[9],t}let T=a?`Redirecting to authorize P4 Connect for your CLI…`:`Sign in to continue authorizing P4 Connect for your CLI.`,E;e[10]===T?E=e[11]:(E=(0,h.jsx)(g,{eyebrow:`Browser authorization`,title:`Connecting your terminal`,description:T}),e[10]=T,e[11]=E);let D;e[12]!==r||e[13]!==a||e[14]!==S?(D=r&&!a?(0,h.jsx)(`div`,{className:`mt-6`,children:(0,h.jsx)(i,{type:`button`,onClick:S,children:`Sign in`})}):null,e[12]=r,e[13]=a,e[14]=S,e[15]=D):D=e[15];let O;return e[16]!==E||e[17]!==D?(O=(0,h.jsxs)(f,{children:[E,D]}),e[16]=E,e[17]=D,e[18]=O):O=e[18],O}function y(){return a(new URL(window.location.href))}var b=v;export{b as component};
2
- //# sourceMappingURL=connect-B3OIDtgH.js.map
1
+ import{a as e,t}from"./react-BUfh6y28.js";import{n,t as r}from"./jsx-runtime-DJeoFXNw.js";import{dr as i}from"./utils-Dv1DrWoz.js";import{j as a}from"./runtime-BhGr1QCf.js";import{t as o}from"./env-wK1YYxA8.js";import{i as s,r as c}from"./dist-CtnQm06p.js";import{t as l}from"./authRedirect-DWE5a_T9.js";import{o as u,s as d}from"./main-om7hc1qE.js";import{t as f}from"./AuthSurfaceShell-DDlvsg4m.js";var p=n(),m=e(t(),1),h=e(r(),1);function g(e){let t=(0,p.c)(10),{eyebrow:n,title:r,description:i}=e,a;t[0]===n?a=t[1]:(a=n?(0,h.jsx)(`p`,{className:`text-3xs font-semibold tracking-widest text-primary uppercase`,children:n}):null,t[0]=n,t[1]=a);let o;t[2]===r?o=t[3]:(o=(0,h.jsx)(`h1`,{className:`mt-2 text-2xl font-semibold tracking-tight sm:text-3xl`,children:r}),t[2]=r,t[3]=o);let s;t[4]===i?s=t[5]:(s=(0,h.jsx)(`p`,{className:`mt-2 text-sm leading-relaxed text-muted-foreground`,children:i}),t[4]=i,t[5]=s);let c;return t[6]!==a||t[7]!==o||t[8]!==s?(c=(0,h.jsxs)(h.Fragment,{children:[a,o,s]}),t[6]=a,t[7]=o,t[8]=s,t[9]=c):c=t[9],c}var _={eyebrow:`Authorization request`,title:`This connect link is incomplete`,description:"The link is missing its authorization request. Re-run `p4c connect` in your terminal and open the freshly printed URL."};function v(){let e=(0,p.c)(19),[t]=(0,m.useState)(y),n=s(),{isLoaded:r,isSignedIn:a}=c(),v=(0,m.useRef)(!1),b=(0,m.useRef)(!1),x;e[0]!==n||e[1]!==t?(x=()=>{t&&n.openSignIn(l(d(t,window.location.href),o))},e[0]=n,e[1]=t,e[2]=x):x=e[2];let S=x,C,w;if(e[3]!==r||e[4]!==a||e[5]!==S||e[6]!==t?(C=()=>{if(!t||!r||b.current)return;if(!a){v.current||(v.current=!0,S());return}let e=u(t);e&&(b.current=!0,window.location.assign(e))},w=[r,a,S,t],e[3]=r,e[4]=a,e[5]=S,e[6]=t,e[7]=C,e[8]=w):(C=e[7],w=e[8]),(0,m.useEffect)(C,w),!t){let t;return e[9]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,h.jsx)(f,{children:(0,h.jsx)(g,{..._})}),e[9]=t):t=e[9],t}let T=a?`Redirecting to authorize P4 Connect for your CLI…`:`Sign in to continue authorizing P4 Connect for your CLI.`,E;e[10]===T?E=e[11]:(E=(0,h.jsx)(g,{eyebrow:`Browser authorization`,title:`Connecting your terminal`,description:T}),e[10]=T,e[11]=E);let D;e[12]!==r||e[13]!==a||e[14]!==S?(D=r&&!a?(0,h.jsx)(`div`,{className:`mt-6`,children:(0,h.jsx)(i,{type:`button`,onClick:S,children:`Sign in`})}):null,e[12]=r,e[13]=a,e[14]=S,e[15]=D):D=e[15];let O;return e[16]!==E||e[17]!==D?(O=(0,h.jsxs)(f,{children:[E,D]}),e[16]=E,e[17]=D,e[18]=O):O=e[18],O}function y(){return a(new URL(window.location.href))}var b=v;export{b as component};
2
+ //# sourceMappingURL=connect-BoLhf5rG.js.map