@p4code/cli 0.8.37 → 0.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (287) hide show
  1. package/dist/bin.mjs +1 -1
  2. package/dist/{binCli-mInzhqSL.mjs → binCli-k72_SR2Z.mjs} +2556 -2301
  3. package/dist/client/.vite/manifest.json +2008 -2048
  4. package/dist/client/assets/{2NI2N5EU-DVsZziQ3.js → 2NI2N5EU-DPAxyySd.js} +2 -2
  5. package/dist/client/assets/{4UO7MD6I-Cs3yBe-m.js → 4UO7MD6I-C0aflwpw.js} +2 -2
  6. package/dist/client/assets/{5B3SVYGG-CxW0L1iX.js → 5B3SVYGG-hhn6T1ru.js} +2 -2
  7. package/dist/client/assets/{5GK6JWQ2-Cb25PEnx.js → 5GK6JWQ2-BQ0OdoZ6.js} +2 -2
  8. package/dist/client/assets/{5N7A7DKN-udLyT643.js → 5N7A7DKN-BR8rdHwZ.js} +2 -2
  9. package/dist/client/assets/{5OC2THR4-DqD-reis.js → 5OC2THR4-DVDBlcjJ.js} +2 -2
  10. package/dist/client/assets/{5S6HY5KT-Cy7mIKKq.js → 5S6HY5KT-CjtOXys8.js} +2 -2
  11. package/dist/client/assets/{6IMQ5BUJ-Qu9PVsT7.js → 6IMQ5BUJ-Bpy1Geo9.js} +2 -2
  12. package/dist/client/assets/{6OLKWJ4F-BYzZS9mf.js → 6OLKWJ4F-D2naWV4i.js} +2 -2
  13. package/dist/client/assets/{74OO7NKP-h3ga2-vb.js → 74OO7NKP-CceNos-7.js} +2 -2
  14. package/dist/client/assets/{75O6YZUN-ByAK3P56.js → 75O6YZUN-CnXm_L8w.js} +2 -2
  15. package/dist/client/assets/{77XECAW3-D_lZqaZv.js → 77XECAW3-ECBcD47O.js} +2 -2
  16. package/dist/client/assets/{ABYRPUBD-BPWfXZyu.js → ABYRPUBD-B4F4wZam.js} +2 -2
  17. package/dist/client/assets/AlertDialogRoot-D5eL1YFA.js +2 -0
  18. package/dist/client/assets/{AnimatedHeight-D0-6CAPr.js → AnimatedHeight-BZhIfVtA.js} +2 -2
  19. package/dist/client/assets/AuthSurfaceShell-DR9yRrzS.js +2 -0
  20. package/dist/client/assets/{BB2UYUI2-CGgafKC2.js → BB2UYUI2-Cae7rC8c.js} +2 -2
  21. package/dist/client/assets/{BUM34MOA-Cn4iaSBT.js → BUM34MOA-DBDboDOb.js} +2 -2
  22. package/dist/client/assets/{CEQABKGZ-CmBEfzh3.js → CEQABKGZ-C6UutqUy.js} +2 -2
  23. package/dist/client/assets/{CXAC5362-xibpmz3Y.js → CXAC5362-BnZlf1Fg.js} +2 -2
  24. package/dist/client/assets/{ChatGptUsageButton-DU3PVHJW.js → ChatGptUsageButton-3K5PpaVk.js} +2 -2
  25. package/dist/client/assets/{ChatMarkdown-D-cNSjFn.js → ChatMarkdown-EK5C8Dje.js} +7 -7
  26. package/dist/client/assets/{CheckboxIndicator-CZCy38xt.js → CheckboxIndicator-DZ8vBLEv.js} +2 -2
  27. package/dist/client/assets/{ClippedText-D_rM_XDj.js → ClippedText-Dswe5Mb4.js} +2 -2
  28. package/dist/client/assets/CodexSetupSection.logic-BepCZ25p.js +2 -0
  29. package/dist/client/assets/{ComboboxClear-tOmMpuVi.js → ComboboxClear-By718biy.js} +2 -2
  30. package/dist/client/assets/{ComboboxGroupLabel-CgZZIHwV.js → ComboboxGroupLabel-DjWIIS5_.js} +2 -2
  31. package/dist/client/assets/{CommandBlock-6rjypfVF.js → CommandBlock-C967hvdK.js} +2 -2
  32. package/dist/client/assets/{ComposerPromptEditor-Dxfhec2W.js → ComposerPromptEditor-kPs79YCA.js} +10 -10
  33. package/dist/client/assets/{CompositeRoot-Bsb8efI6.js → CompositeRoot-BFPe8O0M.js} +2 -2
  34. package/dist/client/assets/{ConnectionDiagnosisDetails-Q0M5gCCf.js → ConnectionDiagnosisDetails-B5VXf5lv.js} +2 -2
  35. package/dist/client/assets/{ConnectionStatusDot-DAuD0jkU.js → ConnectionStatusDot-wmgCjAfF.js} +2 -2
  36. package/dist/client/assets/{DRLTVNUE-BVseXOzv.js → DRLTVNUE-Du8kYl_L.js} +2 -2
  37. package/dist/client/assets/{DYY6UVD2-Bz33D3dq.js → DYY6UVD2-DxjEuWNy.js} +2 -2
  38. package/dist/client/assets/{DevicePanel-CsSQr7vQ.js → DevicePanel-YEBH-Vqd.js} +2 -2
  39. package/dist/client/assets/DeviceSetup-CAlj40rJ.js +2 -0
  40. package/dist/client/assets/{DialogTitle-bcvBtKP-.js → DialogTitle-DNp9zThp.js} +2 -2
  41. package/dist/client/assets/{DiffCommentAnnotation-bhzNqujM.js → DiffCommentAnnotation-BOk2MTlv.js} +2 -2
  42. package/dist/client/assets/{DiffFileTree-BySeJqhq.js → DiffFileTree-Dg3cvfi5.js} +2 -2
  43. package/dist/client/assets/{DiffPanel-CCFas4eA.js → DiffPanel-fTHMPAQJ.js} +2 -2
  44. package/dist/client/assets/{DiffWorkerPoolProvider-CkkqWbz-.js → DiffWorkerPoolProvider-CqmToECA.js} +3 -3
  45. package/dist/client/assets/{EmbeddedDesign-iuThcPT3.js → EmbeddedDesign-BXKBSCcw.js} +2 -2
  46. package/dist/client/assets/{EnvironmentMachineIcon-iUmoTUYt.js → EnvironmentMachineIcon-DBWK6C8T.js} +2 -2
  47. package/dist/client/assets/{ExpandableText-ByCx68yv.js → ExpandableText-B9cfY7p2.js} +2 -2
  48. package/dist/client/assets/{FNOVOB4O-DK3iet1g.js → FNOVOB4O-BeMBYVRF.js} +2 -2
  49. package/dist/client/assets/{FieldControl-DtsEariK.js → FieldControl-BOrs67_f.js} +2 -2
  50. package/dist/client/assets/{FileDiff-Bu2BSqBV.js → FileDiff-DW1zPAn5.js} +2 -2
  51. package/dist/client/assets/{FilePreviewPanel-8cI8gciT.js → FilePreviewPanel-CTTCKfik.js} +10 -10
  52. package/dist/client/assets/{FoldedSettingsSection-RYq8GTvV.js → FoldedSettingsSection-ClboCRR4.js} +2 -2
  53. package/dist/client/assets/{FormContext-CIK8MKa2.js → FormContext-DcLeIpxJ.js} +2 -2
  54. package/dist/client/assets/{HDGCDEEZ-B_J1N6RY.js → HDGCDEEZ-DtsLNbcM.js} +2 -2
  55. package/dist/client/assets/{HSJLKHB7-B2SbZQUf.js → HSJLKHB7-Cj1_K-Mg.js} +2 -2
  56. package/dist/client/assets/{Icons-xsXA_L6w.js → Icons-B1qw9fnR.js} +2 -2
  57. package/dist/client/assets/Input-DQflEYBs.js +2 -0
  58. package/dist/client/assets/JZOYTAAL-BrzaFmLe.js +1 -0
  59. package/dist/client/assets/{K3MD6TGW-VU68yYxr.js → K3MD6TGW-SNOidZ8r.js} +2 -2
  60. package/dist/client/assets/{K7RP3OMA-zaD_NBVC.js → K7RP3OMA-CpajkG5B.js} +2 -2
  61. package/dist/client/assets/{KeybindingsSettings.logic-BJe27xmi.js → KeybindingsSettings.logic-BA5WG7V2.js} +2 -2
  62. package/dist/client/assets/{LHDIQX7Q-DCLqoRGy.js → LHDIQX7Q-CAyO0Nv9.js} +2 -2
  63. package/dist/client/assets/{LUXOKEGN-CmxZpSzC.js → LUXOKEGN-Dp60gO-M.js} +2 -2
  64. package/dist/client/assets/{MathTypeset-Hhqwg4PF.js → MathTypeset-DG9QDH3a.js} +2 -2
  65. package/dist/client/assets/{N3JZAHOW-Cev8Cn9M.js → N3JZAHOW-CPZZhC9o.js} +2 -2
  66. package/dist/client/assets/{NUIALGQ3-CV92Kt25.js → NUIALGQ3-Bapg3pv1.js} +2 -2
  67. package/dist/client/assets/{NoProjectsHero-CMqIlSNl.js → NoProjectsHero-DunzHVd0.js} +2 -2
  68. package/dist/client/assets/{O65XPQGZ-bGyTGMsB.js → O65XPQGZ-BmLVfB2-.js} +2 -2
  69. package/dist/client/assets/{O7XIQ6OM-DVdEfB1N.js → O7XIQ6OM-BzZlSmaP.js} +2 -2
  70. package/dist/client/assets/{OFQON5FD-Ca_CNS26.js → OFQON5FD-Ciy1Dfj8.js} +2 -2
  71. package/dist/client/assets/{P4ConnectAccountPages-Buss2oTL.js → P4ConnectAccountPages-DO-fCpTN.js} +2 -2
  72. package/dist/client/assets/{P4ConnectSidebarSignIn-D1n4y6Gq.js → P4ConnectSidebarSignIn-7hkM7xr7.js} +2 -2
  73. package/dist/client/assets/{PJQHF43J-B__IdKwP.js → PJQHF43J-CTTmTIhc.js} +2 -2
  74. package/dist/client/assets/{PanelLayoutControls-EIunk_2Q.js → PanelLayoutControls-clP6N7xc.js} +7 -7
  75. package/dist/client/assets/{PierreEntryIcon-GQImyog1.js → PierreEntryIcon-wm-IkF2y.js} +2 -2
  76. package/dist/client/assets/{PopoverHandle-Cj5egwXv.js → PopoverHandle-CqjlXffy.js} +2 -2
  77. package/dist/client/assets/PreviewPanel-fTwWXayK.js +2 -0
  78. package/dist/client/assets/{ProjectDefaultsSettings-DX2Kf-tx.js → ProjectDefaultsSettings-DABlQCRQ.js} +2 -2
  79. package/dist/client/assets/{ProjectFavicon-OMOnEzVu.js → ProjectFavicon-zExdjKgc.js} +3 -3
  80. package/dist/client/assets/{ProjectIconPickerDialog-Q4GkqwDs.js → ProjectIconPickerDialog-D4Br81iW.js} +2 -2
  81. package/dist/client/assets/{ProjectMonogram-Br5sgd24.js → ProjectMonogram-Ba70a8_s.js} +2 -2
  82. package/dist/client/assets/{ProviderAuthTerminal-Q584HoOn.js → ProviderAuthTerminal-Gf_5AaPE.js} +2 -2
  83. package/dist/client/assets/{ProviderModelPicker-JNM9nJs_.js → ProviderModelPicker-DrfK42fH.js} +2 -2
  84. package/dist/client/assets/{ProviderSettingsForm-CdiKhrJE.js → ProviderSettingsForm-CXVYrIzw.js} +2 -2
  85. package/dist/client/assets/{PullRequestCodeTab-Co76Qf6Z.js → PullRequestCodeTab-DaXxo4Bs.js} +3 -3
  86. package/dist/client/assets/{RHNBAITX-Oryl0UiR.js → RHNBAITX-DKMeuR6R.js} +2 -2
  87. package/dist/client/assets/{ReadOnlySourcePreview-aUjexBVb.js → ReadOnlySourcePreview-DPJWK3HJ.js} +2 -2
  88. package/dist/client/assets/{RenderErrorBoundary-Oe5BzG3n.js → RenderErrorBoundary-BI5KBtsb.js} +2 -2
  89. package/dist/client/assets/{SLD4V6NK-DbsINoTD.js → SLD4V6NK-CR4aIcpx.js} +2 -2
  90. package/dist/client/assets/ScheduledTasksSettings-CTHyd4UX.js +4 -0
  91. package/dist/client/assets/{ScopedSwitch-D8-FelRH.js → ScopedSwitch-De6GoQiO.js} +2 -2
  92. package/dist/client/assets/{ScrollAreaCorner-nnFi-Ecx.js → ScrollAreaCorner-DF4GCx0d.js} +2 -2
  93. package/dist/client/assets/{SecretInput-CqAhFuNO.js → SecretInput-Dg6ZsU9p.js} +2 -2
  94. package/dist/client/assets/{SelectScrollUpArrow-BQJrvk31.js → SelectScrollUpArrow-DeRXucOo.js} +2 -2
  95. package/dist/client/assets/{SettingsPanels-CNgY_ZPe.js → SettingsPanels-D6e2byZQ.js} +8 -8
  96. package/dist/client/assets/{SettingsPanels.logic-Dr_NyHjE.js → SettingsPanels.logic-BSXSdFru.js} +2 -2
  97. package/dist/client/assets/{SettingsScopeNotice-BFxCBOnl.js → SettingsScopeNotice-MbxDDMZ9.js} +2 -2
  98. package/dist/client/assets/SidebarStageBackdrop-B0F--sat.js +2 -0
  99. package/dist/client/assets/{T3PCR2KE-2R1FY5zG.js → T3PCR2KE-C0_7R2Oa.js} +2 -2
  100. package/dist/client/assets/{TKWO2OVW-BjhIZzCe.js → TKWO2OVW-DqJmzuhq.js} +2 -2
  101. package/dist/client/assets/{TSHNXIZL-B_cvoUct.js → TSHNXIZL-CmCl4WMk.js} +2 -2
  102. package/dist/client/assets/ThemeEditorPanel-IhSXPcO9.js +5 -0
  103. package/dist/client/assets/{ThreadTerminalDrawer-DHoyxd6-.js → ThreadTerminalDrawer-DnOstFPr.js} +4 -4
  104. package/dist/client/assets/TooltipViewport-DJXNIjFt.js +2 -0
  105. package/dist/client/assets/{UQJE5E4I-2r98lr05.js → UQJE5E4I-U1f_Qxq0.js} +2 -2
  106. package/dist/client/assets/{USNYFO5S-CvTI5t_o.js → USNYFO5S-BFU1s0-x.js} +2 -2
  107. package/dist/client/assets/{Virtualizer-BgcEI5KE.js → Virtualizer-CI2uidEs.js} +2 -2
  108. package/dist/client/assets/{WEVWDWVA-U7ygIdf3.js → WEVWDWVA-DVuH1I8D.js} +2 -2
  109. package/dist/client/assets/{WorkspaceBreadcrumb-_zND61qF.js → WorkspaceBreadcrumb-Dr-p0Dtn.js} +2 -2
  110. package/dist/client/assets/{WorkspacePageContainer-LYv_7Qc0.js → WorkspacePageContainer-MDWEFwmu.js} +2 -2
  111. package/dist/client/assets/{WorkspacePageHeader-B_0ute56.js → WorkspacePageHeader-CNcKDaqG.js} +2 -2
  112. package/dist/client/assets/{X5RFHQXM-D4S0_b0W.js → X5RFHQXM-DhiPjZ2I.js} +2 -2
  113. package/dist/client/assets/{X62E3GBT-CrIC4h9P.js → X62E3GBT-BoEmDIYA.js} +2 -2
  114. package/dist/client/assets/{XBNEOJTC-D2_RQZjM.js → XBNEOJTC-ACchb7zJ.js} +2 -2
  115. package/dist/client/assets/{YHV2MVVZ-BmAcJLBt.js → YHV2MVVZ-WIW1NclZ.js} +2 -2
  116. package/dist/client/assets/{YURCZMG2-RCCTu3bv.js → YURCZMG2-D8PyipKA.js} +2 -2
  117. package/dist/client/assets/{YVG2LODB-Cvp0Ei-1.js → YVG2LODB-BQvBC9bF.js} +2 -2
  118. package/dist/client/assets/_chat-DDGjgFMR.js +45 -0
  119. package/dist/client/assets/{_chat.design-DX1VqYkX.js → _chat.design-DjIqnlVZ.js} +2 -2
  120. package/dist/client/assets/{_chat.index-Dzh3d42S.js → _chat.index-Dku1iZH1.js} +2 -2
  121. package/dist/client/assets/{_chat.new-BHRvXFPr.js → _chat.new-8-cjg5K7.js} +3 -3
  122. package/dist/client/assets/_chat.pull-requests-DVfSewSZ.js +2 -0
  123. package/dist/client/assets/{alert-BN-r9V4f.js → alert-DpVw79VA.js} +2 -2
  124. package/dist/client/assets/{assetUrls-B6vsSVWR.js → assetUrls-BOJMUK_1.js} +2 -2
  125. package/dist/client/assets/{assets-CID0y4Uv.js → assets-6zZLBDZw.js} +2 -2
  126. package/dist/client/assets/{browserHistoryStore-CK4YsfkQ.js → browserHistoryStore-TJXTYA-V.js} +2 -2
  127. package/dist/client/assets/{browserLinkTarget-BJ30b4-s.js → browserLinkTarget-DRbX4L_9.js} +2 -2
  128. package/dist/client/assets/{checkbox-BJhN1L_L.js → checkbox-4yBjrqWQ.js} +2 -2
  129. package/dist/client/assets/{color-picker-D2LwMwlZ.js → color-picker-B6JEgpDa.js} +2 -2
  130. package/dist/client/assets/{combobox-Cw2-7qyI.js → combobox-CKWbcPIR.js} +2 -2
  131. package/dist/client/assets/{command-BIELTYJu.js → command-D8XZec1r.js} +2 -2
  132. package/dist/client/assets/{connect-D4llmZsa.js → connect-Dp9BB7ev.js} +2 -2
  133. package/dist/client/assets/{connect-agent-BlR0FAbF.js → connect-agent-DkbIqI-8.js} +2 -2
  134. package/dist/client/assets/{design-Cdl1XCBU.js → design-Dn5DzqF2.js} +2 -2
  135. package/dist/client/assets/{device-Bc5H3PTz.js → device-dylO5xoO.js} +2 -2
  136. package/dist/client/assets/{dialog-BRtKKGzk.js → dialog-_vbB7RKH.js} +2 -2
  137. package/dist/client/assets/{diffRendering-DtBTalAD.js → diffRendering-MXukhqw1.js} +2 -2
  138. package/dist/client/assets/{dist-oE_MNxpZ.js → dist-ceTe_mn7.js} +3 -3
  139. package/dist/client/assets/{draft-input-vviXwx5Q.js → draft-input-C-u_3cDw.js} +2 -2
  140. package/dist/client/assets/{duoViewer-kcp00m8a.js → duoViewer-C0aL6Kyr.js} +2 -2
  141. package/dist/client/assets/{dynamic-C8_ODyue.js → dynamic-DTzzXo3L.js} +2 -2
  142. package/dist/client/assets/{embeddedScripts-skldQmE1.js → embeddedScripts-DcWCyBxX.js} +2 -2
  143. package/dist/client/assets/{empty-rC3eYvxq.js → empty-BlKDGTzb.js} +2 -2
  144. package/dist/client/assets/{entities-B8Vupv5g.js → entities-eRiwvW2F.js} +2 -2
  145. package/dist/client/assets/{fileLinks-BoyzENAX.js → fileLinks-CYejoXPq.js} +2 -2
  146. package/dist/client/assets/{fileTreeExpansion-DndrZZAD.js → fileTreeExpansion-wG1G7D6R.js} +2 -2
  147. package/dist/client/assets/{getDiffFileInput-C1QBFdFu.js → getDiffFileInput-CzeweGHs.js} +2 -2
  148. package/dist/client/assets/{guideRunStore-BgFFILxA.js → guideRunStore-DAYN2Zd7.js} +2 -2
  149. package/dist/client/assets/{htmlRender-ddkOIEbT.js → htmlRender-C3rZ0xgC.js} +2 -2
  150. package/dist/client/assets/{index-BwdieRvq.js → index-DA9og9YW.js} +3 -3
  151. package/dist/client/assets/{input-BYd74ook.js → input-DXGWoa4O.js} +2 -2
  152. package/dist/client/assets/{input-group-DMFlSk_7.js → input-group-De0xZXfc.js} +2 -2
  153. package/dist/client/assets/{kbd-rp5mX21h.js → kbd-WWNLIkTn.js} +2 -2
  154. package/dist/client/assets/{keybindings-B_kRk5Fi.js → keybindings-DAHl8jIl.js} +2 -2
  155. package/dist/client/assets/{lazy-CeaQ3-Fj.js → lazy-Ccs3klKO.js} +4 -4
  156. package/dist/client/assets/{lazyRouteComponent-COYyJY2H.js → lazyRouteComponent-BU0ER5FO.js} +2 -2
  157. package/dist/client/assets/{link-CsXnX9WM.js → link-C3TbL1do.js} +2 -2
  158. package/dist/client/assets/{linkedPrompt-B5iI7U8H.js → linkedPrompt-BJh0Yqud.js} +2 -2
  159. package/dist/client/assets/main-DjrB0l0D.css +2 -0
  160. package/dist/client/assets/main-DleJeMZO.js +37 -0
  161. package/dist/client/assets/{mediaReference-ZW7gfO5X.js → mediaReference-BbSbhpkR.js} +2 -2
  162. package/dist/client/assets/{mediaSource-DsT6G6Wm.js → mediaSource-B_75uvyp.js} +2 -2
  163. package/dist/client/assets/{number-field-CEA6qXbs.js → number-field-qEfih146.js} +2 -2
  164. package/dist/client/assets/{observeResize-DSyLC8QK.js → observeResize-DzSkewug.js} +2 -2
  165. package/dist/client/assets/{onboarding-BPkAEHBV.js → onboarding-1Zg3fM0A.js} +2 -2
  166. package/dist/client/assets/{openFileInPreview-CGM83ICx.js → openFileInPreview-CiPuDrfB.js} +2 -2
  167. package/dist/client/assets/{p4ProjectFile-CwpteA7b.js → p4ProjectFile-BVKW5TIA.js} +2 -2
  168. package/dist/client/assets/{pair-D9v8gc0o.js → pair-DUv1mY4i.js} +2 -2
  169. package/dist/client/assets/{pendingSendStore-BuEVrrEM.js → pendingSendStore-BFVsboDn.js} +2 -2
  170. package/dist/client/assets/{phoneViewer-CNE0SVmy.js → phoneViewer-CStYy_tX.js} +2 -2
  171. package/dist/client/assets/{pierre-icons-ChDlOt-h.js → pierre-icons-D3vWvKqU.js} +2 -2
  172. package/dist/client/assets/{popover-BjUpdrKu.js → popover-CogH2zM4.js} +2 -2
  173. package/dist/client/assets/{preview-DHLYKEKb.js → preview-O1ZL8Awg.js} +2 -2
  174. package/dist/client/assets/{preview-3EscFepc.js → preview-ipLyyv_l.js} +2 -2
  175. package/dist/client/assets/{previewMiniPlayerStore-DHjQeV1U.js → previewMiniPlayerStore-C5z1mN8S.js} +2 -2
  176. package/dist/client/assets/{primary-NcsmRI6j.js → primary-CMBPxKMH.js} +2 -2
  177. package/dist/client/assets/{primaryCloudLinkState-DkXIVBHW.js → primaryCloudLinkState-CER468V5.js} +2 -2
  178. package/dist/client/assets/{projectFilesQueryState-0jxJ50Qq.js → projectFilesQueryState-D4FdR3Xm.js} +2 -2
  179. package/dist/client/assets/{projectScriptEditor-CMGXoIEJ.js → projectScriptEditor-4wQTbXvz.js} +2 -2
  180. package/dist/client/assets/{providerSkills-4hnESoi_.js → providerSkills-D3rxPB_g.js} +2 -2
  181. package/dist/client/assets/{pullRequestDetail.logic-sbOM8yDW.js → pullRequestDetail.logic-Bkh57WzV.js} +2 -2
  182. package/dist/client/assets/{pullRequestIcons-B7Om_B_D.js → pullRequestIcons-DPbMXqGp.js} +2 -2
  183. package/dist/client/assets/{pullRequestReviewStore-CIL8WfOG.js → pullRequestReviewStore-BAxwf6rl.js} +2 -2
  184. package/dist/client/assets/{pullRequests-CMTRCOu7.js → pullRequests-DggtcbhA.js} +2 -2
  185. package/dist/client/assets/{queries-hhl_J8u9.js → queries-DJfKGsHe.js} +2 -2
  186. package/dist/client/assets/{query-CfGzD8v6.js → query-B3Zo1YOE.js} +2 -2
  187. package/dist/client/assets/{radio-group-up2QNXjf.js → radio-group-l1Zl-3hQ.js} +2 -2
  188. package/dist/client/assets/{renderScheduler-Dgqqs-EX.js → renderScheduler-BgGYA97h.js} +2 -2
  189. package/dist/client/assets/{rightPanelStore-CGF0-d-1.js → rightPanelStore-Cv1U3yrU.js} +2 -2
  190. package/dist/client/assets/{runtime-Ca_Z-vg5.js → runtime-BOlBBevr.js} +3 -3
  191. package/dist/client/assets/{runtime-OeWFs5Hf.js → runtime-CeFhsGnm.js} +3 -3
  192. package/dist/client/assets/{runtimeModeConfig-BTG9FTYe.js → runtimeModeConfig-BQ0QCQhj.js} +2 -2
  193. package/dist/client/assets/{scheduledTasksSettings.logic-BeuOnCov.js → scheduledTasksSettings.logic-BpOBCcOk.js} +2 -2
  194. package/dist/client/assets/{scroll-area-BNQKEZbp.js → scroll-area-CQNIjQ8U.js} +2 -2
  195. package/dist/client/assets/{select-D_zHR42Y.js → select-Cbpdz6n3.js} +2 -2
  196. package/dist/client/assets/{selfImproveFindings-CAZ0j1GD.js → selfImproveFindings-CT79AgdK.js} +2 -2
  197. package/dist/client/assets/{server-6nKYyc8r.js → server-DvWrfyUO.js} +2 -2
  198. package/dist/client/assets/{session-BxUdP61p.js → session-D3gY-tOR.js} +2 -2
  199. package/dist/client/assets/{session-logic-Dr1plzXe.js → session-logic-OeNFZd_V.js} +3 -3
  200. package/dist/client/assets/{settings-DE_hSu0q.js → settings-C6gUwixG.js} +2 -2
  201. package/dist/client/assets/{settings.appearance-C--uy4It.js → settings.appearance-BdGq8dkT.js} +2 -2
  202. package/dist/client/assets/settings.archived-DobN7ZtC.js +2 -0
  203. package/dist/client/assets/{settings.computer-use-DhnqPqMm.js → settings.computer-use-DTAvnNqQ.js} +2 -2
  204. package/dist/client/assets/settings.connections-CZD-0BNX.js +2 -0
  205. package/dist/client/assets/settings.data-controls-CTVHY8Rd.js +2 -0
  206. package/dist/client/assets/{settings.decisions-CU-6rIpn.js → settings.decisions-D3zMITNw.js} +2 -2
  207. package/dist/client/assets/{settings.designs-DHYhhG4k.js → settings.designs-DWeI1d2s.js} +2 -2
  208. package/dist/client/assets/{settings.diagnostics-csgW1_E8.js → settings.diagnostics-CqC6fhz6.js} +2 -2
  209. package/dist/client/assets/{settings.general-CeBkrL9-.js → settings.general-BDEcQVI4.js} +2 -2
  210. package/dist/client/assets/{settings.integrations-DqSYBosl.js → settings.integrations-BmqNoylk.js} +2 -2
  211. package/dist/client/assets/{settings.keybindings-C7D1i238.js → settings.keybindings-Mt7J5TKC.js} +2 -2
  212. package/dist/client/assets/{settings.open-source-licenses-6oFDgAt7.js → settings.open-source-licenses-Dvex7Jce.js} +2 -2
  213. package/dist/client/assets/{settings.plugins-DfM65Xio.js → settings.plugins-BAFed2wY.js} +4 -4
  214. package/dist/client/assets/settings.projects-DhuXD_vx.js +4 -0
  215. package/dist/client/assets/settings.providers-D_-kNRqH.js +3 -0
  216. package/dist/client/assets/{settings.scheduled-tasks-Csi8wfij.js → settings.scheduled-tasks-Z4aprmEO.js} +2 -2
  217. package/dist/client/assets/settings.snap-shot-o0bdbS5t.js +2 -0
  218. package/dist/client/assets/settings.source-control-CwJzBnSu.js +2 -0
  219. package/dist/client/assets/{settings.storage-DTcg-0aj.js → settings.storage-B4ahmlhx.js} +2 -2
  220. package/dist/client/assets/{settingsLayout-4ySvFdXb.js → settingsLayout-DrhqvTJ8.js} +3 -3
  221. package/dist/client/assets/{sidebar-CHDwV4Ca.js → sidebar-BhJqncti.js} +2 -2
  222. package/dist/client/assets/{sidebarProjectGrouping-BcOVY8p-.js → sidebarProjectGrouping-DDt6qTcu.js} +2 -2
  223. package/dist/client/assets/{skeleton-BcLPbojY.js → skeleton-CFtayHTe.js} +2 -2
  224. package/dist/client/assets/{sourceControl-CPrl7cyO.js → sourceControl-Dqo9EYNC.js} +2 -2
  225. package/dist/client/assets/{sourceControlClients-oNOd36Cq.js → sourceControlClients-DGnHi6Rd.js} +2 -2
  226. package/dist/client/assets/{spinner-_ourbdVb.js → spinner-BZh9P0sD.js} +2 -2
  227. package/dist/client/assets/{terminal-links-DuZi4b83.js → terminal-links-CFKe0iu0.js} +2 -2
  228. package/dist/client/assets/{terminalSessions-D0vbdqqx.js → terminalSessions-BykgTNwT.js} +2 -2
  229. package/dist/client/assets/{textarea-DlXXDHPJ.js → textarea-hXQFbdrS.js} +2 -2
  230. package/dist/client/assets/themePalette-MbAn2gqj.js +5 -0
  231. package/dist/client/assets/{toast-DXWclCrr.js → toast-C61oyZY1.js} +2 -2
  232. package/dist/client/assets/{toggle-Dofc34s2.js → toggle-B03MQDgB.js} +2 -2
  233. package/dist/client/assets/{toggle-group-CYKsfBbD.js → toggle-group-yF5GZ53o.js} +2 -2
  234. package/dist/client/assets/{tooltip-CY3W5y-f.js → tooltip-ChmjT8Ns.js} +2 -2
  235. package/dist/client/assets/uiStateStore-DL8OsPjd.js +2 -0
  236. package/dist/client/assets/{usage-DQcgd75_.js → usage-DATBL2Du.js} +2 -2
  237. package/dist/client/assets/{usageAccess-CCSxXl9X.js → usageAccess-kgUHYKOw.js} +2 -2
  238. package/dist/client/assets/{usageFormat-ByjmRjTe.js → usageFormat-D5Mz5ugL.js} +2 -2
  239. package/dist/client/assets/{usageShortcuts-DOWm0Vo9.js → usageShortcuts-mAekk3eG.js} +2 -2
  240. package/dist/client/assets/{use-atom-command-vqjL7n-x.js → use-atom-command-Bt7x9oO0.js} +2 -2
  241. package/dist/client/assets/{useAriaLabelledBy-B7FNFpmO.js → useAriaLabelledBy-DjNn9irU.js} +2 -2
  242. package/dist/client/assets/useHandleNewThread-BOKOo2wA.js +2 -0
  243. package/dist/client/assets/{useLocation-B_XV0lDx.js → useLocation-Cwv1HZ3K.js} +2 -2
  244. package/dist/client/assets/{useNavigate-BWqAWfiZ.js → useNavigate-Cdrlv-yJ.js} +2 -2
  245. package/dist/client/assets/{useNavigateBack-C52nbvbb.js → useNavigateBack-CwjQ4iuL.js} +2 -2
  246. package/dist/client/assets/{useP4ConnectAuthPrompt-DKhdNYj8.js → useP4ConnectAuthPrompt-D63n-MFC.js} +2 -2
  247. package/dist/client/assets/{useParams-ekGanxxb.js → useParams-C5D_t-0u.js} +2 -2
  248. package/dist/client/assets/{usePermissionStatus-CWV_yoZe.js → usePermissionStatus-CKmeNk61.js} +2 -2
  249. package/dist/client/assets/{usePullRequestActions-DxtkLQ5D.js → usePullRequestActions-D53oZord.js} +2 -2
  250. package/dist/client/assets/{useRegisterFieldControl-BAJIcFiO.js → useRegisterFieldControl-DUs9w2Me.js} +2 -2
  251. package/dist/client/assets/{useScopedModelAvailability-815e0x20.js → useScopedModelAvailability-CeAUx0qZ.js} +2 -2
  252. package/dist/client/assets/useSettings-VTow9ZEM.js +3 -0
  253. package/dist/client/assets/utils-CBe1bHL7.js +37 -0
  254. package/dist/client/assets/{vcsRefInvalidation-CW_MIqdt.js → vcsRefInvalidation-B2f3qDSR.js} +2 -2
  255. package/dist/client/assets/{welcome-k7S47hyM.js → welcome-CQgOocvj.js} +2 -2
  256. package/dist/client/index.html +1 -1
  257. package/dist/{renderer-Ay-1ojn7.mjs → renderer-BBWgEvuE.mjs} +2 -2
  258. package/dist/{runtime-bP6MSuMS.mjs → runtime-DNjlpJkJ.mjs} +286 -242
  259. package/package.json +1 -1
  260. package/dist/client/assets/AlertDialogRoot-BSP6M0Mu.js +0 -2
  261. package/dist/client/assets/AuthSurfaceShell-30QvY1bI.js +0 -2
  262. package/dist/client/assets/CodexSetupSection.logic-g6_GE4bw.js +0 -2
  263. package/dist/client/assets/DeviceSetup-Cl7L9wsi.js +0 -2
  264. package/dist/client/assets/Input-D3Qi4jCN.js +0 -2
  265. package/dist/client/assets/JZOYTAAL-BlxFvoz4.js +0 -1
  266. package/dist/client/assets/PreviewPanel-BkFeksTl.js +0 -2
  267. package/dist/client/assets/ScheduledTasksSettings-1uXNtcPA.js +0 -4
  268. package/dist/client/assets/ThemeEditorPanel-B7MiqZ90.js +0 -5
  269. package/dist/client/assets/TooltipViewport-ThbbZQDo.js +0 -2
  270. package/dist/client/assets/_chat-CwO3_WVM.js +0 -45
  271. package/dist/client/assets/_chat.pull-requests-BZilN1TK.js +0 -2
  272. package/dist/client/assets/composer-logic-P-jVPXi4.js +0 -6
  273. package/dist/client/assets/composerDraftUploads-S66xDlS0.js +0 -2
  274. package/dist/client/assets/main-DdVSHl80.css +0 -2
  275. package/dist/client/assets/main-VfCRP294.js +0 -29
  276. package/dist/client/assets/settings.archived-D-55XnxQ.js +0 -2
  277. package/dist/client/assets/settings.connections-BPVLazeK.js +0 -2
  278. package/dist/client/assets/settings.data-controls-CIzGvqCI.js +0 -2
  279. package/dist/client/assets/settings.projects-CeoZzdMW.js +0 -4
  280. package/dist/client/assets/settings.providers-BBgppyE3.js +0 -3
  281. package/dist/client/assets/settings.snap-shot-BdVdSIJy.js +0 -2
  282. package/dist/client/assets/settings.source-control-Bme3qg7j.js +0 -2
  283. package/dist/client/assets/themePalette-VIM7Gehx.js +0 -5
  284. package/dist/client/assets/uiStateStore-CdkBStdp.js +0 -6
  285. package/dist/client/assets/useHandleNewThread-BYNZXzR_.js +0 -2
  286. package/dist/client/assets/useSettings-gPlpTIWi.js +0 -3
  287. package/dist/client/assets/utils-DhUt689t.js +0 -37
@@ -1,2 +1,2 @@
1
- import{En as e,Fn as t,On as n,Pn as r}from"./runtime-Ca_Z-vg5.js";import{a as i,i as a,o,r as s}from"./fileLinks-BoyzENAX.js";var c=/^(~\/|\.{1,2}\/)/,l=/^(?:[A-Za-z0-9._-]+(?: +[A-Za-z0-9._-]+)*\/)+(?:[A-Za-z0-9._-]+(?: +[A-Za-z0-9._-]+)*(?::\d+){0,2})?$/,u=/^[A-Za-z0-9._-]+(?: +[A-Za-z0-9._-]+)*\.[A-Za-z0-9_-]+(?::\d+){0,2}$/,d=/^([A-Za-z][A-Za-z0-9+.-]*):(.*)$/,f=/:\d+(?::\d+)?$/,p=/^\d+(?::\d+)?$/,m=/[\s`]/,h=/[\\/]/,g=/\.[A-Za-z0-9_-]+$/,_=/\d\.\d[^.]*$/,v=/^\d+(?:\.\d+)+$/,y=[`/Users/`,`/home/`,`/tmp/`,`/var/`,`/etc/`,`/opt/`,`/mnt/`,`/Volumes/`,`/private/`,`/root/`,`/usr/`,`/bin/`,`/sbin/`,`/lib/`,`/lib64/`,`/srv/`,`/dev/`,`/proc/`,`/sys/`,`/run/`,`/boot/`,`/media/`,`/workspace/`,`/workspaces/`],b=new Set(`Makefile.makefile.GNUmakefile.Dockerfile.Containerfile.Justfile.justfile.Rakefile.Gemfile.Procfile.Brewfile.Caddyfile.Vagrantfile.Jenkinsfile.Podfile.Fastfile.BUILD.WORKSPACE.LICENSE.LICENCE.COPYING.NOTICE.AUTHORS.CONTRIBUTORS.CHANGELOG.README.CODEOWNERS`.split(`.`)),x=new Set([`localhost`]),S=new Set([`com`,`net`,`org`,`io`,`dev`,`app`,`ai`,`co`,`edu`,`gov`,`mil`,`info`,`biz`,`xyz`,`me`,`tv`,`cc`,`gg`,`chat`,`cloud`,`site`,`online`,`tech`,`store`,`link`]),C=new Set(`uk.de.fr.nl.se.no.fi.dk.pl.ch.at.be.es.it.pt.eu.us.ca.au.nz.jp.kr.cn.br.ru.mx.ie.cz.tr.sg.hk`.split(`.`));function w(e,t){if(e.startsWith(`.`))return!1;let n=e.toLowerCase();if(x.has(n)||v.test(e))return!0;let r=n.split(`.`),i=r.at(-1);return r.length<2||i===void 0?!1:S.has(i)?!0:!t&&C.has(i)}function T(e){let t=e.trim();if(t.length===0||m.test(t))return null;let r=n(t)?t:t.replaceAll(`\\`,`/`),i=f.test(r);if(!i&&!h.test(r))return null;if(!(c.test(r)||r.startsWith(`/`)||n(r))){let e=r.replace(f,``);if(e.endsWith(`/`)||w(e.split(`/`)[0]??e,i))return null;let t=e.replace(/[/\\]+$/,``).split(/[\\/]/).at(-1)??``;if(_.test(t)||!i&&!g.test(t))return null}return r}function E(e){try{return decodeURIComponent(e)}catch{return e}}function D(e){let t=e.trim();return t.startsWith(`<`)&&t.endsWith(`>`)?t.slice(1,-1):t}function O(e){let t=e.indexOf(`#`),n=t>=0?e.slice(0,t):e,r=t>=0?e.slice(t):``,i=n.indexOf(`?`);return{path:i>=0?n.slice(0,i):n,hash:r}}function k(e,t){let r=P(t);if(!r)return!1;let i=e=>e.replaceAll(`\\`,`/`).replace(/^\.\//,``).replace(/\/+$/,``),a=o(e.trim());if(a.line!==void 0&&a.line!==r.line||a.column!==void 0&&a.column!==r.column)return!1;let s=i(a.path),c=i(r.path);return s.length===0||(n(r.path)&&(s=s.toLowerCase(),c=c.toLowerCase()),c===s||c.endsWith(`/${s}`))}function A(e){return c.test(e)||!e.startsWith(`/`)&&!n(e)}function j(e){if(!e.startsWith(`/`))return!1;if(y.some(t=>e.startsWith(t))||f.test(e))return!0;let t=e.slice(e.lastIndexOf(`/`)+1);return b.has(t)||g.test(t)}function M(e,t){return n(e)||c.test(e)?!0:e.startsWith(`/`)?j(t):b.has(e)?!0:l.test(t)||u.test(e)}function N(e){if(n(e))return!1;let t=e.match(d);if(!t)return!1;let r=t[2]??``;return r.startsWith(`//`)?!0:!p.test(r)}function P(e){let t=D(e);if(t.length===0||t.startsWith(`#`)||t.startsWith(`//`))return null;let n=(t.toLowerCase().startsWith(`file:`)?a(t):null)??O(t),i=r(E(n.path.trim())),s=E(n.hash.trim());if(i.length===0||N(i))return null;let c=o(i,s);return M(c.path,i)?c:null}var F=/(```[\s\S]*?(?:```|$))/,I=/`([^`\n]+)`/g;function L(e){let t=[],n=e.split(F);for(let e=0;e<n.length;e+=2)for(let r of(n[e]??``).matchAll(I)){let e=r[1]?.trim();e&&t.push(e)}return t}function R(e,t){let n=-1,r=-1;return i=>i>=n&&i<=r?r:(t.lastIndex=i,n=i,r=t.exec(e)?.index??e.length,r)}function z(e){let t=R(e,/\S/g),n=R(e,/["']/g),r=R(e,/\S/g);return i=>{let a=t(i);if(e[a]===`)`)return a+1;if(a===i||e[a]!==`"`&&e[a]!==`'`)return null;let o=n(a+1);if(o===e.length)return null;let s=r(o+1);return e[s]===`)`?s+1:null}}function B(e){let t=R(e,/\S/g),n=R(e,/[>\n]/g),r=R(e,/[\s)]/g),i=z(e),a=z(e);return o=>{if(e[o]!==`(`)return null;let s=t(o+1);if(e[s]===`<`){let t=n(s+1);if(t>s+1&&e[t]===`>`){let e=i(t+1);if(e!==null)return{hrefStart:s+1,hrefEnd:t,end:e}}}let c=r(s);if(c===s)return null;let l=a(c);return l===null?null:{hrefStart:s,hrefEnd:c,end:l}}}function V(e){let t=[],n=B(e),r=0;for(;r<e.length;){let i=e.indexOf(`[`,r);if(i===-1)break;let a=e.indexOf(`]`,i+1);if(a===-1)break;r=a+1;let o=n(r);if(!o)continue;r=o.end;let s=e.slice(o.hrefStart,o.hrefEnd).trim();s&&t.push(s)}return t}function H(n,r,a=r){if(!n)return null;let o=P(n);if(!o)return null;let c=s(o);return A(c)?a?i(c,a):null:e(o.path)&&t(o.path,r)===null?null:c}function U(e){return/^[A-Za-z]:[\\/]/.test(E(e))}function W(e){let t=n(e)||e.startsWith(`//`),r=t?e.replaceAll(`\\`,`/`):e,i=t?/^(?:[a-z]:\/|\/\/[^/]+\/[^/]+(?:\/|$))/i.exec(r)?.[0]:r.startsWith(`/`)?`/`:void 0;if(!i)return;let a=[];for(let e of r.slice(i.length).split(`/`))e&&e!==`.`&&(e===`..`?a.pop():a.push(e));let o=i.replace(/\/$/,``);return{root:t?o.toLowerCase():o,segments:a,windows:t}}function G(e,t){let n=W(e),r=t?W(t):void 0;return!n||!r||n.windows!==r.windows||n.root!==r.root||n.segments.length<=r.segments.length||!r.segments.every((e,t)=>r.windows?e.toLowerCase()===n.segments[t]?.toLowerCase():e===n.segments[t])?{kind:`file`,path:e}:{kind:`file`,path:e,relativePath:n.segments.slice(r.segments.length).join(`/`)}}function K(e){if(/^(?:https?:\/\/|\/\/)/i.test(e))try{let t=new URL(e.startsWith(`//`)?`https:${e}`:e);return t.protocol===`http:`||t.protocol===`https:`?{kind:`url`,url:e}:void 0}catch{return}}function q(e){if(e.kind===`file`){let t=n(e.path)||e.path.startsWith(`//`);return e.path.split(t?/[\\/]/:`/`).at(-1)||void 0}let t;try{let n=e.url;t=new URL(n.startsWith(`//`)?`https:${n}`:n).pathname.split(`/`).at(-1)}catch{return}return t?E(t):void 0}export{V as a,A as c,H as d,E as f,L as i,U as l,q as n,T as o,O as p,K as r,k as s,G as t,D as u};
2
- //# sourceMappingURL=mediaReference-ZW7gfO5X.js.map
1
+ import{En as e,Fn as t,On as n,Pn as r}from"./runtime-BOlBBevr.js";import{a as i,i as a,o,r as s}from"./fileLinks-CYejoXPq.js";var c=/^(~\/|\.{1,2}\/)/,l=/^(?:[A-Za-z0-9._-]+(?: +[A-Za-z0-9._-]+)*\/)+(?:[A-Za-z0-9._-]+(?: +[A-Za-z0-9._-]+)*(?::\d+){0,2})?$/,u=/^[A-Za-z0-9._-]+(?: +[A-Za-z0-9._-]+)*\.[A-Za-z0-9_-]+(?::\d+){0,2}$/,d=/^([A-Za-z][A-Za-z0-9+.-]*):(.*)$/,f=/:\d+(?::\d+)?$/,p=/^\d+(?::\d+)?$/,m=/[\s`]/,h=/[\\/]/,g=/\.[A-Za-z0-9_-]+$/,_=/\d\.\d[^.]*$/,v=/^\d+(?:\.\d+)+$/,y=[`/Users/`,`/home/`,`/tmp/`,`/var/`,`/etc/`,`/opt/`,`/mnt/`,`/Volumes/`,`/private/`,`/root/`,`/usr/`,`/bin/`,`/sbin/`,`/lib/`,`/lib64/`,`/srv/`,`/dev/`,`/proc/`,`/sys/`,`/run/`,`/boot/`,`/media/`,`/workspace/`,`/workspaces/`],b=new Set(`Makefile.makefile.GNUmakefile.Dockerfile.Containerfile.Justfile.justfile.Rakefile.Gemfile.Procfile.Brewfile.Caddyfile.Vagrantfile.Jenkinsfile.Podfile.Fastfile.BUILD.WORKSPACE.LICENSE.LICENCE.COPYING.NOTICE.AUTHORS.CONTRIBUTORS.CHANGELOG.README.CODEOWNERS`.split(`.`)),x=new Set([`localhost`]),S=new Set([`com`,`net`,`org`,`io`,`dev`,`app`,`ai`,`co`,`edu`,`gov`,`mil`,`info`,`biz`,`xyz`,`me`,`tv`,`cc`,`gg`,`chat`,`cloud`,`site`,`online`,`tech`,`store`,`link`]),C=new Set(`uk.de.fr.nl.se.no.fi.dk.pl.ch.at.be.es.it.pt.eu.us.ca.au.nz.jp.kr.cn.br.ru.mx.ie.cz.tr.sg.hk`.split(`.`));function w(e,t){if(e.startsWith(`.`))return!1;let n=e.toLowerCase();if(x.has(n)||v.test(e))return!0;let r=n.split(`.`),i=r.at(-1);return r.length<2||i===void 0?!1:S.has(i)?!0:!t&&C.has(i)}function T(e){let t=e.trim();if(t.length===0||m.test(t))return null;let r=n(t)?t:t.replaceAll(`\\`,`/`),i=f.test(r);if(!i&&!h.test(r))return null;if(!(c.test(r)||r.startsWith(`/`)||n(r))){let e=r.replace(f,``);if(e.endsWith(`/`)||w(e.split(`/`)[0]??e,i))return null;let t=e.replace(/[/\\]+$/,``).split(/[\\/]/).at(-1)??``;if(_.test(t)||!i&&!g.test(t))return null}return r}function E(e){try{return decodeURIComponent(e)}catch{return e}}function D(e){let t=e.trim();return t.startsWith(`<`)&&t.endsWith(`>`)?t.slice(1,-1):t}function O(e){let t=e.indexOf(`#`),n=t>=0?e.slice(0,t):e,r=t>=0?e.slice(t):``,i=n.indexOf(`?`);return{path:i>=0?n.slice(0,i):n,hash:r}}function k(e,t){let r=P(t);if(!r)return!1;let i=e=>e.replaceAll(`\\`,`/`).replace(/^\.\//,``).replace(/\/+$/,``),a=o(e.trim());if(a.line!==void 0&&a.line!==r.line||a.column!==void 0&&a.column!==r.column)return!1;let s=i(a.path),c=i(r.path);return s.length===0||(n(r.path)&&(s=s.toLowerCase(),c=c.toLowerCase()),c===s||c.endsWith(`/${s}`))}function A(e){return c.test(e)||!e.startsWith(`/`)&&!n(e)}function j(e){if(!e.startsWith(`/`))return!1;if(y.some(t=>e.startsWith(t))||f.test(e))return!0;let t=e.slice(e.lastIndexOf(`/`)+1);return b.has(t)||g.test(t)}function M(e,t){return n(e)||c.test(e)?!0:e.startsWith(`/`)?j(t):b.has(e)?!0:l.test(t)||u.test(e)}function N(e){if(n(e))return!1;let t=e.match(d);if(!t)return!1;let r=t[2]??``;return r.startsWith(`//`)?!0:!p.test(r)}function P(e){let t=D(e);if(t.length===0||t.startsWith(`#`)||t.startsWith(`//`))return null;let n=(t.toLowerCase().startsWith(`file:`)?a(t):null)??O(t),i=r(E(n.path.trim())),s=E(n.hash.trim());if(i.length===0||N(i))return null;let c=o(i,s);return M(c.path,i)?c:null}var F=/(```[\s\S]*?(?:```|$))/,I=/`([^`\n]+)`/g;function L(e){let t=[],n=e.split(F);for(let e=0;e<n.length;e+=2)for(let r of(n[e]??``).matchAll(I)){let e=r[1]?.trim();e&&t.push(e)}return t}function R(e,t){let n=-1,r=-1;return i=>i>=n&&i<=r?r:(t.lastIndex=i,n=i,r=t.exec(e)?.index??e.length,r)}function z(e){let t=R(e,/\S/g),n=R(e,/["']/g),r=R(e,/\S/g);return i=>{let a=t(i);if(e[a]===`)`)return a+1;if(a===i||e[a]!==`"`&&e[a]!==`'`)return null;let o=n(a+1);if(o===e.length)return null;let s=r(o+1);return e[s]===`)`?s+1:null}}function B(e){let t=R(e,/\S/g),n=R(e,/[>\n]/g),r=R(e,/[\s)]/g),i=z(e),a=z(e);return o=>{if(e[o]!==`(`)return null;let s=t(o+1);if(e[s]===`<`){let t=n(s+1);if(t>s+1&&e[t]===`>`){let e=i(t+1);if(e!==null)return{hrefStart:s+1,hrefEnd:t,end:e}}}let c=r(s);if(c===s)return null;let l=a(c);return l===null?null:{hrefStart:s,hrefEnd:c,end:l}}}function V(e){let t=[],n=B(e),r=0;for(;r<e.length;){let i=e.indexOf(`[`,r);if(i===-1)break;let a=e.indexOf(`]`,i+1);if(a===-1)break;r=a+1;let o=n(r);if(!o)continue;r=o.end;let s=e.slice(o.hrefStart,o.hrefEnd).trim();s&&t.push(s)}return t}function H(n,r,a=r){if(!n)return null;let o=P(n);if(!o)return null;let c=s(o);return A(c)?a?i(c,a):null:e(o.path)&&t(o.path,r)===null?null:c}function U(e){return/^[A-Za-z]:[\\/]/.test(E(e))}function W(e){let t=n(e)||e.startsWith(`//`),r=t?e.replaceAll(`\\`,`/`):e,i=t?/^(?:[a-z]:\/|\/\/[^/]+\/[^/]+(?:\/|$))/i.exec(r)?.[0]:r.startsWith(`/`)?`/`:void 0;if(!i)return;let a=[];for(let e of r.slice(i.length).split(`/`))e&&e!==`.`&&(e===`..`?a.pop():a.push(e));let o=i.replace(/\/$/,``);return{root:t?o.toLowerCase():o,segments:a,windows:t}}function G(e,t){let n=W(e),r=t?W(t):void 0;return!n||!r||n.windows!==r.windows||n.root!==r.root||n.segments.length<=r.segments.length||!r.segments.every((e,t)=>r.windows?e.toLowerCase()===n.segments[t]?.toLowerCase():e===n.segments[t])?{kind:`file`,path:e}:{kind:`file`,path:e,relativePath:n.segments.slice(r.segments.length).join(`/`)}}function K(e){if(/^(?:https?:\/\/|\/\/)/i.test(e))try{let t=new URL(e.startsWith(`//`)?`https:${e}`:e);return t.protocol===`http:`||t.protocol===`https:`?{kind:`url`,url:e}:void 0}catch{return}}function q(e){if(e.kind===`file`){let t=n(e.path)||e.path.startsWith(`//`);return e.path.split(t?/[\\/]/:`/`).at(-1)||void 0}let t;try{let n=e.url;t=new URL(n.startsWith(`//`)?`https:${n}`:n).pathname.split(`/`).at(-1)}catch{return}return t?E(t):void 0}export{V as a,A as c,H as d,E as f,L as i,U as l,q as n,T as o,O as p,K as r,k as s,G as t,D as u};
2
+ //# sourceMappingURL=mediaReference-BbSbhpkR.js.map
@@ -1,2 +1,2 @@
1
- import{Cn as e,En as t,Fn as n,On as r,Pn as i,h as a,m as o}from"./runtime-Ca_Z-vg5.js";import{i as s,o as c}from"./fileLinks-BoyzENAX.js";import{f as l,n as u,p as d,r as f,t as p,u as m}from"./mediaReference-ZW7gfO5X.js";var h=/^(?:https?:|data:|blob:|\/\/)/i,g=/^[A-Za-z][A-Za-z0-9+.-]*:/;function _(e){return d(m(e)).hash}function v(e,t){let n=r(e)?`\\`:`/`;return`${e.replace(/[\\/]+$/,``)}${n}${t.replace(/[\\/]/g,n).replace(/^[\\/]+/,``)}`}function y(e,r){return t(e)&&n(e,r)===null?{_tag:`Blocked`}:{_tag:`WorkspaceFile`,path:e}}function b(e,t){if(e==null)return{_tag:`Blocked`};let n=m(e);if(n.length===0||n.startsWith(`#`)||n.startsWith(`?`))return{_tag:`Blocked`};if(h.test(n))return{_tag:`Direct`,uri:n};if(/^file:/i.test(n)){let e=s(n);return e===null?{_tag:`Blocked`}:y(i(l(e.path)),t)}let a=i(l(d(n).path));return a.length===0?{_tag:`Blocked`}:a.startsWith(`/`)||r(a)?y(a,t):g.test(a)||a.startsWith(`~/`)||a.startsWith(`~\\`)||!t?{_tag:`Blocked`}:{_tag:`WorkspaceFile`,path:v(t,a)}}function x(e,t){return t.resolvedFilePath===void 0?b(e,t.workspaceRoot):{_tag:`WorkspaceFile`,path:t.resolvedFilePath}}function S(t,n){let r=x(t,n);if(r._tag===`Blocked`)return null;let i=r._tag===`Direct`?d(r.uri).path:c(r.path).path,s=e(i),l=s.lastIndexOf(`.`),m=(r._tag===`Direct`?o(r.uri):l<0?null:a(s.slice(l)))??(n.imageEmbed?`image/*`:null);if(m===null)return null;let h=m.startsWith(`video/`)?`video`:`image`,g=r._tag===`Direct`?f(r.uri):p(i,n.workspaceRoot),v={kind:h,mimeType:m,name:g&&u(g)||s||h,...g?{reference:g}:{},srcFragment:_(t)};return r._tag===`Direct`?{...v,access:`direct`,uri:r.uri}:n.threadId===void 0?{...v,access:`unavailable`}:{...v,access:`environment`,resource:{_tag:`media-file`,threadId:n.threadId,path:i}}}export{b as n,_ as r,S as t};
2
- //# sourceMappingURL=mediaSource-DsT6G6Wm.js.map
1
+ import{Cn as e,En as t,Fn as n,On as r,Pn as i,h as a,m as o}from"./runtime-BOlBBevr.js";import{i as s,o as c}from"./fileLinks-CYejoXPq.js";import{f as l,n as u,p as d,r as f,t as p,u as m}from"./mediaReference-BbSbhpkR.js";var h=/^(?:https?:|data:|blob:|\/\/)/i,g=/^[A-Za-z][A-Za-z0-9+.-]*:/;function _(e){return d(m(e)).hash}function v(e,t){let n=r(e)?`\\`:`/`;return`${e.replace(/[\\/]+$/,``)}${n}${t.replace(/[\\/]/g,n).replace(/^[\\/]+/,``)}`}function y(e,r){return t(e)&&n(e,r)===null?{_tag:`Blocked`}:{_tag:`WorkspaceFile`,path:e}}function b(e,t){if(e==null)return{_tag:`Blocked`};let n=m(e);if(n.length===0||n.startsWith(`#`)||n.startsWith(`?`))return{_tag:`Blocked`};if(h.test(n))return{_tag:`Direct`,uri:n};if(/^file:/i.test(n)){let e=s(n);return e===null?{_tag:`Blocked`}:y(i(l(e.path)),t)}let a=i(l(d(n).path));return a.length===0?{_tag:`Blocked`}:a.startsWith(`/`)||r(a)?y(a,t):g.test(a)||a.startsWith(`~/`)||a.startsWith(`~\\`)||!t?{_tag:`Blocked`}:{_tag:`WorkspaceFile`,path:v(t,a)}}function x(e,t){return t.resolvedFilePath===void 0?b(e,t.workspaceRoot):{_tag:`WorkspaceFile`,path:t.resolvedFilePath}}function S(t,n){let r=x(t,n);if(r._tag===`Blocked`)return null;let i=r._tag===`Direct`?d(r.uri).path:c(r.path).path,s=e(i),l=s.lastIndexOf(`.`),m=(r._tag===`Direct`?o(r.uri):l<0?null:a(s.slice(l)))??(n.imageEmbed?`image/*`:null);if(m===null)return null;let h=m.startsWith(`video/`)?`video`:`image`,g=r._tag===`Direct`?f(r.uri):p(i,n.workspaceRoot),v={kind:h,mimeType:m,name:g&&u(g)||s||h,...g?{reference:g}:{},srcFragment:_(t)};return r._tag===`Direct`?{...v,access:`direct`,uri:r.uri}:n.threadId===void 0?{...v,access:`unavailable`}:{...v,access:`environment`,resource:{_tag:`media-file`,threadId:n.threadId,path:i}}}export{b as n,_ as r,S as t};
2
+ //# sourceMappingURL=mediaSource-B_75uvyp.js.map
@@ -1,2 +1,2 @@
1
- import{a as e,t}from"./react-DH3P2YXY.js";import{n,t as r}from"./jsx-runtime-BnjsACtP.js";import{Aa as i,Ao as a,Er as o,Ha as s,La as c,Ln as l,Mo as u,Oa as d,Rn as f,Sp as p,Un as m,Va as h,Vn as g,Wa as _,Xa as v,Yp as y,aa as b,ao as x,ba as S,ca as C,co as w,io as T,jo as E,ka as D,no as O,oa as k,pa as ee,qa as A,ro as j,sa as M,t as N,to as P,ua as F,uo as te,va as ne,wo as re,ya as ie,za as I}from"./utils-DhUt689t.js";import{t as ae}from"./useRegisterFieldControl-BAJIcFiO.js";import{t as oe}from"./FormContext-CIK8MKa2.js";import{a as se}from"./CSPContext-DGVCKkcb.js";var L=e(t());function ce(){let[,e]=L.useState({});return L.useCallback(()=>{e({})},[])}var le=L.createContext(void 0);function ue(){let e=L.useContext(le);if(e===void 0)throw Error(u(43));return e}var R={inputValue:()=>null,value:()=>null,...m},de=new Map;function z(e,t){let n=JSON.stringify({locale:e,options:t}),r=de.get(n);if(r)return r;let i=new Intl.NumberFormat(e,t);return de.set(n,i),i}function B(e,t,n){return e==null?``:z(t,n).format(e)}function fe(e,t,n){return B(e,t,{...n,maximumFractionDigits:20})}var V=[`零`,`〇`,`一`,`二`,`三`,`四`,`五`,`六`,`七`,`八`,`九`],pe={零:`0`,〇:`0`,一:`1`,二:`2`,三:`3`,四:`4`,五:`5`,六:`6`,七:`7`,八:`8`,九:`9`},me=[`٠`,`١`,`٢`,`٣`,`٤`,`٥`,`٦`,`٧`,`٨`,`٩`],H=[`۰`,`۱`,`۲`,`۳`,`۴`,`۵`,`۶`,`۷`,`۸`,`۹`],U=[`0`,`1`,`2`,`3`,`4`,`5`,`6`,`7`,`8`,`9`],he=[`%`,`٪`,`%`,`﹪`],ge=[`‰`,`؉`],_e=[`−`,`-`,`‒`,`–`,`—`,`﹣`],ve=[`+`,`﹢`],ye=RegExp(`[${me.join(``)}]`,`g`),W=RegExp(`[${H.join(``)}]`,`g`),be=RegExp(`[${U.join(``)}]`,`g`),xe=RegExp(`[${V.join(``)}]`,`g`),G=RegExp(`[${he.join(``)}]`),K=RegExp(`[${ge.join(``)}]`),Se=/[٠١٢٣٤٥٦٧٨٩]/,Ce=/[۰۱۲۳۴۵۶۷۸۹]/,we=/[零〇一二三四五六七八九]/,Te=RegExp(`[${U.join(``)}]`),Ee=[`.`,`,`,`.`,`,`,`٫`,`٬`],De=/\p{Zs}/u,Oe=[`+`,...ve],ke=[`-`,..._e],q=e=>e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`),Ae=e=>e.replace(/[-\\\]^]/g,e=>`\\${e}`),je=e=>`[${e.map(Ae).join(``)}]`,Me=je([`-`].concat(_e)),Ne=je([`+`].concat(ve)),Pe=new RegExp(Me,`gu`),J=new RegExp(Ne,`gu`),Y=new RegExp(Me),X=new RegExp(Ne);function Fe(e,t){let n=z(e,t).formatToParts(11111.1),r={};return n.forEach(e=>{r[e.type]=e.value}),z(e).formatToParts(.1).forEach(e=>{e.type===`decimal`&&(r[e.type]=e.value)}),r}function Z(e,t,n){if(e==null)return null;let r=String(e).replace(/\p{Cf}/gu,``).trim();r=r.replace(Pe,`-`).replace(J,`+`);let i=!1,a=r.match(/([+-])\s*$/);a&&(a[1]===`-`&&(i=!0),r=r.replace(/([+-])\s*$/,``));let o=r.match(/^\s*([+-])/);o&&(o[1]===`-`&&(i=!0),r=r.replace(/^\s*[+-]/,``));let s=t;s===void 0&&(Se.test(r)||Ce.test(r)?s=`ar`:we.test(r)&&(s=`zh`));let{group:c,decimal:l,currency:u}=Fe(s,n),d=z(s,n).formatToParts(1).filter(e=>e.type===`unit`).map(e=>q(e.value)),f=d.length?new RegExp(d.join(`|`),`g`):null,p=null;c&&(p=/\p{Zs}/u.test(c)?/\p{Zs}/gu:c===`'`||c===`’`?/['’]/g:new RegExp(q(c),`g`));let m=[{regex:c?p:null,replacement:``},{regex:l?new RegExp(q(l),`g`):null,replacement:`.`},{regex:/./g,replacement:`.`},{regex:/,/g,replacement:``},{regex:/٫/g,replacement:`.`},{regex:/٬/g,replacement:``},{regex:u?new RegExp(q(u),`g`):null,replacement:``},{regex:f,replacement:``},{regex:ye,replacement:e=>String(me.indexOf(e))},{regex:W,replacement:e=>String(H.indexOf(e))},{regex:be,replacement:e=>String(U.indexOf(e))},{regex:xe,replacement:e=>pe[e]}].reduce((e,{regex:t,replacement:n})=>t?e.replace(t,n):e,r),h=m.lastIndexOf(`.`);if(h!==-1&&(m=`${m.slice(0,h).replace(/\./g,``)}.${m.slice(h+1).replace(/\./g,``)}`),/^[-+]?Infinity$/i.test(r)||/[∞]/.test(r))return null;let g=(i?`-`:``)+m,_=parseFloat(g),v=n?.style,y=v===`unit`&&n?.unit===`percent`,b=G.test(e)||v===`percent`;return K.test(e)?_/=1e3:!y&&b&&(_/=100),Number.isNaN(_)?null:_}var Ie=1e-10;function Le(e){let t=z(`en-US`).resolvedOptions(),n=e?.minimumFractionDigits??t.minimumFractionDigits??0;return{maximumFractionDigits:Math.max(e?.maximumFractionDigits??t.maximumFractionDigits??20,n),minimumFractionDigits:n}}function Re(e,t){if(!Number.isFinite(e))return e;let n=Math.min(Math.max(t,0),20);return Number(e.toFixed(n))}function Q(e,t){let{maximumFractionDigits:n}=Le(t);return Re(e,n)}function ze(e,t,n,r=`directional`){if(n===0)return e;let i=Math.abs(n),a=Math.sign(n),o=i*Ie*a,s=r===`nearest`?n:i,c=(e-t+o)/s,l;return l=r===`nearest`?Math.round(c):a>0?Math.floor(c):Math.ceil(c),t+l*(r===`nearest`?n:i)}function Be(e,{step:t,minWithDefault:n,maxWithDefault:r,minWithZeroDefault:i,format:a,snapOnStep:o,small:s,clamp:c}){if(e===null)return e;let l=c?se(e,n,r):e;if(t!=null&&o){if(t===0)return Q(l,a);let e=i;return!s&&n!==-(2**53-1)&&(e=n),Q(ze(l,e,t,s?`nearest`:`directional`),a)}return Q(l,a)}var $=e(r()),Ve=L.forwardRef(function(e,t){let{id:n,min:r,max:i,smallStep:o=.1,step:u=1,largeStep:d=10,required:f=!1,disabled:p=!1,readOnly:m=!1,form:_,name:v,defaultValue:y,value:x,onValueChange:S,onValueCommitted:w,allowWheelScrub:T=!1,snapOnStep:E=!1,allowOutOfRange:O=!1,format:j,locale:N,render:P,className:ne,inputRef:ie,style:I,...ae}=e,{setDirty:oe,validityData:se,disabled:ue,setFilled:de,invalid:z,name:fe,state:V,validation:pe,shouldValidateOnChange:me}=g(),H=ue||p,U=fe??v,_e=u===`any`?1:u,[ve,ye]=L.useState(!1),W=r??-(2**53-1),be=i??2**53-1,xe=r??0,G=j?.style,K=L.useRef(null),Se=a(ie,pe.inputRef),Ce=l({id:n}),[we,Te]=A({controlled:x,default:y,name:`NumberField`,state:`value`}),q=we??null,Ae=C(q);h(()=>{de(q!==null)},[de,q]);let je=ce(),Me=C(j),Ne=L.useRef(!1),Pe=s((e,t)=>{Ne.current=!1,w?.(e,t)}),J=L.useRef(!0),Y=L.useRef(null),[X,Z]=L.useState(()=>x===void 0?B(q,N,j):He(q,N,j)),[Ie,Le]=L.useState(`numeric`),Re=s(()=>{let{decimal:e,group:t,currency:n,literal:r}=Fe(N,j),i=new Set;Ee.forEach(e=>i.add(e)),e&&i.add(e),t&&(i.add(t),De.test(t)&&i.add(` `));let a=G===`percent`||G===`unit`&&j?.unit===`percent`,o=G===`percent`||G===`unit`&&j?.unit===`permille`;return a&&he.forEach(e=>i.add(e)),o&&ge.forEach(e=>i.add(e)),G===`currency`&&n&&i.add(n),r&&(Array.from(r).forEach(e=>i.add(e)),De.test(r)&&i.add(` `)),Oe.forEach(e=>i.add(e)),W<0&&ke.forEach(e=>i.add(e)),i}),Q=s(e=>e?.altKey?o:e?.shiftKey?d:_e),ze=s((e,t)=>{let n=t.event,r=t.direction,i=t.reason,a=!O||i!==`input-change`&&i!==`input-blur`&&i!==`input-paste`&&i!==`input-clear`&&i!==`none`,o=Be(e,{step:r?Q(n)*r:void 0,format:Me.current,minWithDefault:W,maxWithDefault:be,minWithZeroDefault:xe,snapOnStep:E,small:n?.altKey??!1,clamp:a}),s=t.reason===`input-change`||t.reason===`input-clear`||t.reason===`input-blur`||t.reason===`input-paste`||t.reason===`none`,c=o!==q||s&&(e!==q||J.current===!1);if(c){if(Y.current=o,S?.(o,t),t.isCanceled)return c;Te(o),oe(o!==se.initialValue),Ne.current=!0}return J.current&&Z(B(o,N,j)),je(),c}),Ve=s((e,{direction:t,currentValue:n,event:i,reason:a})=>{let o=n??Ae.current,s=typeof o==`number`?o+e*t:Math.max(0,r??0);return ze(s,D(a,i,void 0,{direction:t}))});h(function(){if(!J.current)return;let e=x===void 0?B(q,N,j):He(q,N,j);e!==X&&Z(e)}),h(function(){if(!c)return;let e=`text`;W>=0&&(e=`decimal`),Le(e)},[W,G]),L.useEffect(function(){let e=K.current;if(H||m||!T||!e)return;function t(e){if(e.ctrlKey||ee(M(K.current))!==K.current)return;e.preventDefault(),J.current=!0;let t=Q(e)??1;Ve(t,{direction:e.deltaY>0?-1:1,event:e,reason:`wheel`})}return F(e,`wheel`,t)},[T,Ve,H,m,Q]);let Ue=L.useMemo(()=>({...V,disabled:H,readOnly:m,required:f,value:q,inputValue:X,scrubbing:ve}),[V,H,m,f,q,X,ve]),We=L.useMemo(()=>({inputRef:K,inputValue:X,value:q,minWithDefault:W,maxWithDefault:be,disabled:H,readOnly:m,id:Ce,setValue:ze,incrementValue:Ve,getStepAmount:Q,allowInputSyncRef:J,formatOptionsRef:Me,valueRef:Ae,lastChangedValueRef:Y,hasPendingCommitRef:Ne,name:U,required:f,invalid:z,inputMode:Ie,getAllowedNonNumericKeys:Re,min:r,max:i,setInputValue:Z,locale:N,isScrubbing:ve,setIsScrubbing:ye,state:Ue,onValueCommitted:Pe}),[K,X,q,W,be,H,m,Ce,ze,Ve,Q,Me,Ae,U,f,z,Ie,Re,r,i,Z,N,ve,Ue,Pe]),Ge=re(`div`,e,{ref:t,state:Ue,props:ae,stateAttributesMapping:R});return(0,$.jsxs)(le.Provider,{value:We,children:[Ge,(0,$.jsx)(`input`,{...pe.getInputValidationProps({onFocus(){K.current?.focus()},onChange(e){if(e.nativeEvent.defaultPrevented||H||m){e.preventBaseUIHandler?.();return}let t=e.currentTarget.valueAsNumber,n=Number.isNaN(t)?null:t,r=D(te,e.nativeEvent);oe(n!==se.initialValue),ze(n,r),me()&&pe.commit(n)}}),ref:Se,type:`number`,form:_,name:U,value:q??``,min:r,max:i,step:u,disabled:H,required:f,"aria-hidden":!0,tabIndex:-1,style:U?k:b,suppressHydrationWarning:!0})]})});function He(e,t,n){return n?.maximumFractionDigits!=null||n?.minimumFractionDigits!=null?B(e,t,n):fe(e,t,n)}var Ue=L.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,{state:o}=ue();return re(`div`,e,{ref:t,state:o,props:[{role:`group`},a],stateAttributesMapping:R})}),We=0,Ge=class e extends ie{static create(){return new e}start(e,t){this.clear(),this.currentId=setInterval(()=>{t()},e)}clear=()=>{this.currentId!==We&&(clearInterval(this.currentId),this.currentId=We)}};function Ke(){let e=E(Ge.create).current;return d(e.disposeEffect),e}var qe=60,Je=400,Ye=8,Xe=50,Ze=3;function Qe(e){return e===`touch`||e===`pen`}function $e(e){let{disabled:t,readOnly:n=!1,tick:r,onStop:i,tickDelay:a=qe,startDelay:o=Je,scrollDistance:c=Ye,elementRef:l}=e,u=S(),d=Ke(),f=S(),p=L.useRef(!1),m=L.useRef(0),h=L.useRef({x:0,y:0}),g=L.useRef(!1),v=L.useRef(!1),y=L.useRef(``),b=L.useRef(()=>{}),x=s(()=>{f.clear(),u.clear(),d.clear(),b.current(),m.current=0});function C(e){x();let t=l.current;if(!t)return;let n=_(t);function s(e){e.preventDefault()}if(b.current=F(n,`contextmenu`,s),F(n,`pointerup`,e=>{p.current=!1,x(),i?.(e)},{once:!0}),!r(e)){x();return}u.start(o,()=>{d.start(a,()=>{r(e)||x()})})}return L.useEffect(()=>()=>x(),[x]),{pointerHandlers:{onTouchStart(){g.current=!0},onTouchEnd(){g.current=!1},onPointerDown(e){let r=!e.button||e.button===0;e.defaultPrevented||!r||t||n||(y.current=e.pointerType,v.current=!1,p.current=!0,h.current={x:e.clientX,y:e.clientY},Qe(e.pointerType)?f.start(Xe,()=>{let t=m.current;m.current=0,p.current&&t<Ze?(C(e.nativeEvent),v.current=!0):(v.current=!1,x())}):(e.preventDefault(),C(e.nativeEvent)))},onPointerUp(e){Qe(e.pointerType)&&(p.current=!1)},onPointerMove(e){if(t||n||!Qe(e.pointerType)||!p.current)return;m.current!=null&&(m.current+=1);let{x:r,y:i}=h.current,a=r-e.clientX,o=i-e.clientY;a**2+o**2>c**2&&x()},onMouseEnter(e){e.defaultPrevented||t||n||!p.current||g.current||Qe(y.current)||C(e.nativeEvent)},onMouseLeave(){g.current||x()},onMouseUp(){g.current||x()}},shouldSkipClick:s(e=>e.defaultPrevented?!0:Qe(y.current)?v.current:e.detail!==0)}}function et(e){return e===`touch`||e===`pen`}function tt(e){let{allowInputSyncRef:t,disabled:n,formatOptionsRef:r,getStepAmount:a,id:o,incrementValue:s,inputRef:c,inputValue:l,isIncrement:u,locale:d,readOnly:f,setValue:p,valueRef:m,lastChangedValueRef:h,onValueCommitted:g}=e,_=u?P:v;function y(e){t.current=!0;let n=Z(l,d,r.current);n!==null&&(m.current=n,p(n,D(_,e,void 0,{direction:u?1:-1})))}let{pointerHandlers:b,shouldSkipClick:x}=$e({disabled:n||f,elementRef:c,tickDelay:60,startDelay:400,scrollDistance:8,tick(e){let t=a(e)??1;return s(t,{direction:u?1:-1,event:e,reason:_})},onStop(e){let t=h.current??m.current;g(t,i(_,e))}});return{disabled:n,"aria-readonly":f||void 0,"aria-label":u?`Increase`:`Decrease`,"aria-controls":o,tabIndex:-1,style:{WebkitUserSelect:`none`,userSelect:`none`},...b,onClick(e){let t=n||f;if(e.defaultPrevented||t||x(e))return;y(e.nativeEvent);let r=a(e)??1,o=m.current;s(r,{direction:u?1:-1,event:e.nativeEvent,reason:_});let c=h.current??m.current;c!==o&&g(c,i(_,e.nativeEvent))},onPointerDown(e){let t=!e.button||e.button===0;e.defaultPrevented||f||!t||n||(y(e.nativeEvent),et(e.pointerType)||c.current?.focus(),b.onPointerDown(e))}}}var nt=L.forwardRef(function(e,t){let{render:n,className:r,disabled:i=!1,nativeButton:a=!0,style:o,...s}=e,{allowInputSyncRef:c,disabled:l,formatOptionsRef:u,getStepAmount:d,id:f,incrementValue:p,inputRef:m,inputValue:h,locale:g,maxWithDefault:_,readOnly:v,setValue:y,state:b,value:x,valueRef:S,lastChangedValueRef:C,onValueCommitted:w}=ue(),T=i||l||x!=null&&x>=_,E=tt({isIncrement:!0,inputRef:m,inputValue:h,disabled:T,readOnly:v,id:f,setValue:y,getStepAmount:d,incrementValue:p,allowInputSyncRef:c,formatOptionsRef:u,valueRef:S,locale:g,lastChangedValueRef:C,onValueCommitted:w}),{getButtonProps:D,buttonRef:O}=I({disabled:T,native:a,focusableWhenDisabled:!0}),k=L.useMemo(()=>({...b,disabled:T}),[b,T]);return re(`button`,e,{ref:[t,O],state:k,props:[E,s,D],stateAttributesMapping:R})}),rt=L.forwardRef(function(e,t){let{render:n,className:r,disabled:i=!1,nativeButton:a=!0,style:o,...s}=e,{allowInputSyncRef:c,disabled:l,formatOptionsRef:u,getStepAmount:d,id:f,incrementValue:p,inputRef:m,inputValue:h,minWithDefault:g,readOnly:_,setValue:v,state:y,value:b,valueRef:x,locale:S,lastChangedValueRef:C,onValueCommitted:w}=ue(),T=i||l||b!=null&&b<=g,E=tt({isIncrement:!1,inputRef:m,inputValue:h,disabled:T,readOnly:_,id:f,setValue:v,getStepAmount:d,incrementValue:p,allowInputSyncRef:c,formatOptionsRef:u,valueRef:x,locale:S,lastChangedValueRef:C,onValueCommitted:w}),{getButtonProps:D,buttonRef:O}=I({disabled:T,native:a,focusableWhenDisabled:!0}),k=L.useMemo(()=>({...y,disabled:T}),[y,T]);return re(`button`,e,{ref:[t,O],state:k,props:[E,s,D],stateAttributesMapping:R})}),it={...m,...R},at=new Set([`Backspace`,`Delete`,`ArrowLeft`,`ArrowRight`,`Tab`,`Enter`,`Escape`]),ot=L.forwardRef(function(e,t){let{render:n,className:r,style:a,...s}=e,{allowInputSyncRef:c,disabled:l,formatOptionsRef:u,getAllowedNonNumericKeys:d,getStepAmount:p,id:m,incrementValue:h,inputMode:_,inputValue:v,max:y,min:b,name:S,readOnly:C,required:E,setValue:k,state:ee,setInputValue:A,locale:M,inputRef:N,value:P,onValueCommitted:F,lastChangedValueRef:te,hasPendingCommitRef:ie,valueRef:I}=ue(),{clearErrors:se}=oe(),{validationMode:ce,setTouched:le,setFocused:R,invalid:de,shouldValidateOnChange:z,validation:V}=g(),{labelId:pe}=f(),me=L.useRef(!1),H=L.useRef(!1);return ae(N,m,P),o(P,e=>{let t=z();if(se(S),t&&V.commit(P),!(e===P||t)){if(H.current){H.current=!1;return}V.commit(P,!0)}}),re(`input`,e,{ref:[t,N],state:ee,props:[{id:m,required:E,disabled:l,readOnly:C,inputMode:_,value:v,type:`text`,autoComplete:`off`,autoCorrect:`off`,spellCheck:`false`,"aria-roledescription":`Number field`,"aria-invalid":de||void 0,"aria-labelledby":pe,suppressHydrationWarning:!0,onFocus(e){if(e.defaultPrevented||C||l||(R(!0),me.current))return;me.current=!0;let t=e.currentTarget,n=t.value.length;t.setSelectionRange(n,n)},onBlur(e){if(e.defaultPrevented||C||l)return;le(!0),R(!1);let t=!c.current,n=ie.current;if(c.current=!0,v.trim()===``){k(null,D(T,e.nativeEvent)),ce===`onBlur`&&V.commit(null),F(null,i(T,e.nativeEvent));return}let r=u.current,a=Z(v,M,r);if(a===null)return;let o=r?.maximumFractionDigits!=null||r?.minimumFractionDigits!=null,s=r?.maximumFractionDigits,d=o&&typeof s==`number`?Number(a.toFixed(s)):a,f=i(O,e.nativeEvent),p=P!==d,m=t||p||n;ce===`onBlur`&&V.commit(d),p&&(H.current=!0,k(d,D(O,e.nativeEvent))),m&&F(d,f);let h=B(d,M,r);(o||a!==P||v!==fe(a,M,r))&&v!==h&&A(h)},onChange(e){if(e.nativeEvent.defaultPrevented)return;c.current=!1;let t=e.currentTarget.value;if(t.trim()===``){A(t),k(null,D(T,e.nativeEvent));return}let n=d();if(!Array.from(t).every(e=>{let t=e>=`0`&&e<=`9`,r=Se.test(e),i=we.test(e),a=Ce.test(e),o=Te.test(e),s=Y.test(e);return t||r||i||a||o||s||n.has(e)}))return;let r=Z(t,M,u.current);A(t),r!==null&&k(r,D(j,e.nativeEvent))},onKeyDown(e){if(e.defaultPrevented||C||l)return;let t=e.nativeEvent;c.current=!0;let n=d(),r=n.has(e.key),{decimal:a,currency:o,percentSign:s}=Fe(M,u.current),f=e.currentTarget.selectionStart,m=e.currentTarget.selectionEnd,g=f===0&&m===v.length,_=e=>f!=null&&m!=null&&e>=f&&e<m;if(Y.test(e.key)&&Array.from(n).some(e=>Y.test(e||``))){let e=v.search(Pe),t=e!=null&&e!==-1&&_(e);r=!(Y.test(v)||X.test(v))||g||t}if(X.test(e.key)&&Array.from(n).some(e=>X.test(e||``))){let e=v.search(J),t=e!=null&&e!==-1&&_(e);r=!(Y.test(v)||X.test(v))||g||t}[a,o,s].forEach(t=>{if(e.key===t){let e=v.indexOf(t),n=_(e);r=!v.includes(t)||g||n}});let x=e.key>=`0`&&e.key<=`9`,S=Se.test(e.key),T=we.test(e.key),E=Ce.test(e.key),O=Te.test(e.key),ee=at.has(e.key);if(e.which===229||e.altKey||e.ctrlKey||e.metaKey||r||x||S||O||T||E||ee)return;let A=Z(v,M,u.current),j=p(e)??1;ne(e);let N=i(w,t);e.key===`ArrowUp`?(h(j,{direction:1,currentValue:A,event:t,reason:w}),F(te.current??I.current,N)):e.key===`ArrowDown`?(h(j,{direction:-1,currentValue:A,event:t,reason:w}),F(te.current??I.current,N)):e.key===`Home`&&b!=null?(k(b,D(w,t)),F(te.current??I.current,N)):e.key===`End`&&y!=null&&(k(y,D(w,t)),F(te.current??I.current,N))},onPaste(e){if(e.defaultPrevented||C||l)return;e.preventDefault();let t=(e.clipboardData||window.Clipboard).getData(`text/plain`),n=Z(t,M,u.current);n!==null&&(c.current=!1,k(n,D(x,e.nativeEvent)),A(t))}},V.getValidationProps(),s],stateAttributesMapping:it})}),st=n();function ct(e){let t=(0,st.c)(12),n,r,i,a;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4]):({id:r,className:n,size:a,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a);let o=a===void 0?`default`:a,s=L.useId(),c=r??s,l;t[5]===n?l=t[6]:(l=N(`flex w-full flex-col items-start gap-2`,n),t[5]=n,t[6]=l);let u;return t[7]!==c||t[8]!==i||t[9]!==o||t[10]!==l?(u=(0,$.jsx)(Ve,{className:l,"data-size":o,"data-slot":`number-field`,id:c,...i}),t[7]=c,t[8]=i,t[9]=o,t[10]=l,t[11]=u):u=t[11],u}function lt(e){let t=(0,st.c)(11),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({className:n,shape:i,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a=i===void 0?`default`:i,o=a===`pill`&&`overflow-hidden rounded-xl before:rounded-xl`,s=a===`soft`&&`rounded-lg border-transparent bg-accent shadow-none before:hidden dark:bg-accent`,c;t[4]!==n||t[5]!==o||t[6]!==s?(c=N(`relative flex w-full justify-between rounded-lg border border-input bg-background not-dark:bg-clip-padding text-base text-foreground shadow-xs/5 ring-ring/24 transition-shadow before:pointer-events-none before:absolute before:inset-0 before:rounded-[calc(var(--radius-lg)-1px)] not-data-disabled:not-focus-within:not-aria-invalid:before:shadow-[0_1px_--theme(--color-black/4%)] focus-within:border-ring focus-within:ring-[3px] focus-within:ring-inset has-aria-invalid:border-destructive/36 has-autofill:bg-foreground/4 focus-within:has-aria-invalid:border-destructive/64 focus-within:has-aria-invalid:ring-destructive/48 data-disabled:pointer-events-none data-disabled:opacity-64 sm:text-sm dark:bg-input/32 dark:has-autofill:bg-foreground/8 dark:has-aria-invalid:ring-destructive/24 dark:not-data-disabled:not-focus-within:not-aria-invalid:before:shadow-[0_-1px_--theme(--color-white/6%)] [&_svg:not([class*='size-'])]:size-4.5 sm:[&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0 [[data-disabled],:focus-within,[aria-invalid]]:shadow-none`,o,s,n),t[4]=n,t[5]=o,t[6]=s,t[7]=c):c=t[7];let l;return t[8]!==r||t[9]!==c?(l=(0,$.jsx)(Ue,{className:c,"data-slot":`number-field-group`,...r}),t[8]=r,t[9]=c,t[10]=l):l=t[10],l}function ut(e){let t=(0,st.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=N(`relative flex shrink-0 cursor-pointer items-center justify-center rounded-s-[calc(var(--radius-lg)-1px)] in-data-[size=sm]:px-[calc(--spacing(2.5)-1px)] in-data-[size=compact]:w-8 in-data-[size=compact]:px-0 px-[calc(--spacing(3)-1px)] transition-colors pointer-coarse:after:absolute pointer-coarse:after:size-full pointer-coarse:after:min-h-11 pointer-coarse:after:min-w-11 hover:bg-accent`,n),t[3]=n,t[4]=i);let a;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,$.jsx)(p,{}),t[5]=a):a=t[5];let o;return t[6]!==r||t[7]!==i?(o=(0,$.jsx)(rt,{className:i,"data-slot":`number-field-decrement`,...r,children:a}),t[6]=r,t[7]=i,t[8]=o):o=t[8],o}function dt(e){let t=(0,st.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=N(`relative flex shrink-0 cursor-pointer items-center justify-center rounded-e-[calc(var(--radius-lg)-1px)] in-data-[size=sm]:px-[calc(--spacing(2.5)-1px)] in-data-[size=compact]:w-8 in-data-[size=compact]:px-0 px-[calc(--spacing(3)-1px)] transition-colors pointer-coarse:after:absolute pointer-coarse:after:size-full pointer-coarse:after:min-h-11 pointer-coarse:after:min-w-11 hover:bg-accent`,n),t[3]=n,t[4]=i);let a;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,$.jsx)(y,{}),t[5]=a):a=t[5];let o;return t[6]!==r||t[7]!==i?(o=(0,$.jsx)(nt,{className:i,"data-slot":`number-field-increment`,...r,children:a}),t[6]=r,t[7]=i,t[8]=o):o=t[8],o}function ft(e){let t=(0,st.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=N(`h-8.5 in-data-[size=compact]:h-8 in-data-[size=compact]:px-0 in-data-[size=compact]:leading-8 sm:in-data-[size=compact]:h-8 sm:in-data-[size=compact]:leading-8 in-data-[size=lg]:h-9.5 in-data-[size=sm]:h-7.5 w-full min-w-0 grow bg-transparent in-data-[size=sm]:px-[calc(--spacing(2.5)-1px)] px-[calc(--spacing(3)-1px)] text-center tabular-nums in-data-[size=lg]:leading-9.5 in-data-[size=sm]:leading-7.5 leading-8.5 outline-none [transition:background-color_5000000s_ease-in-out_0s] sm:h-7.5 sm:in-data-[size=lg]:h-8.5 sm:in-data-[size=sm]:h-6.5 sm:in-data-[size=lg]:leading-8.5 sm:in-data-[size=sm]:leading-8.5 sm:leading-7.5`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,$.jsx)(ot,{className:i,"data-slot":`number-field-input`,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}export{ft as a,dt as i,ut as n,lt as r,ct as t};
2
- //# sourceMappingURL=number-field-CEA6qXbs.js.map
1
+ import{a as e,t}from"./react-DH3P2YXY.js";import{n,t as r}from"./jsx-runtime-BnjsACtP.js";import{Aa as i,Ao as a,Er as o,Ha as s,La as c,Ln as l,Mo as u,Oa as d,Rn as f,Sp as p,Un as m,Va as h,Vn as g,Wa as _,Xa as v,Yp as y,aa as b,ao as x,ba as S,ca as C,co as w,io as T,jo as E,ka as D,no as O,oa as k,pa as ee,qa as A,ro as j,sa as M,t as N,to as P,ua as F,uo as te,va as ne,wo as re,ya as ie,za as I}from"./utils-CBe1bHL7.js";import{t as ae}from"./useRegisterFieldControl-DUs9w2Me.js";import{t as oe}from"./FormContext-DcLeIpxJ.js";import{a as se}from"./CSPContext-DGVCKkcb.js";var L=e(t());function ce(){let[,e]=L.useState({});return L.useCallback(()=>{e({})},[])}var le=L.createContext(void 0);function ue(){let e=L.useContext(le);if(e===void 0)throw Error(u(43));return e}var R={inputValue:()=>null,value:()=>null,...m},de=new Map;function z(e,t){let n=JSON.stringify({locale:e,options:t}),r=de.get(n);if(r)return r;let i=new Intl.NumberFormat(e,t);return de.set(n,i),i}function B(e,t,n){return e==null?``:z(t,n).format(e)}function fe(e,t,n){return B(e,t,{...n,maximumFractionDigits:20})}var V=[`零`,`〇`,`一`,`二`,`三`,`四`,`五`,`六`,`七`,`八`,`九`],pe={零:`0`,〇:`0`,一:`1`,二:`2`,三:`3`,四:`4`,五:`5`,六:`6`,七:`7`,八:`8`,九:`9`},me=[`٠`,`١`,`٢`,`٣`,`٤`,`٥`,`٦`,`٧`,`٨`,`٩`],H=[`۰`,`۱`,`۲`,`۳`,`۴`,`۵`,`۶`,`۷`,`۸`,`۹`],U=[`0`,`1`,`2`,`3`,`4`,`5`,`6`,`7`,`8`,`9`],he=[`%`,`٪`,`%`,`﹪`],ge=[`‰`,`؉`],_e=[`−`,`-`,`‒`,`–`,`—`,`﹣`],ve=[`+`,`﹢`],ye=RegExp(`[${me.join(``)}]`,`g`),W=RegExp(`[${H.join(``)}]`,`g`),be=RegExp(`[${U.join(``)}]`,`g`),xe=RegExp(`[${V.join(``)}]`,`g`),G=RegExp(`[${he.join(``)}]`),K=RegExp(`[${ge.join(``)}]`),Se=/[٠١٢٣٤٥٦٧٨٩]/,Ce=/[۰۱۲۳۴۵۶۷۸۹]/,we=/[零〇一二三四五六七八九]/,Te=RegExp(`[${U.join(``)}]`),Ee=[`.`,`,`,`.`,`,`,`٫`,`٬`],De=/\p{Zs}/u,Oe=[`+`,...ve],ke=[`-`,..._e],q=e=>e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`),Ae=e=>e.replace(/[-\\\]^]/g,e=>`\\${e}`),je=e=>`[${e.map(Ae).join(``)}]`,Me=je([`-`].concat(_e)),Ne=je([`+`].concat(ve)),Pe=new RegExp(Me,`gu`),J=new RegExp(Ne,`gu`),Y=new RegExp(Me),X=new RegExp(Ne);function Fe(e,t){let n=z(e,t).formatToParts(11111.1),r={};return n.forEach(e=>{r[e.type]=e.value}),z(e).formatToParts(.1).forEach(e=>{e.type===`decimal`&&(r[e.type]=e.value)}),r}function Z(e,t,n){if(e==null)return null;let r=String(e).replace(/\p{Cf}/gu,``).trim();r=r.replace(Pe,`-`).replace(J,`+`);let i=!1,a=r.match(/([+-])\s*$/);a&&(a[1]===`-`&&(i=!0),r=r.replace(/([+-])\s*$/,``));let o=r.match(/^\s*([+-])/);o&&(o[1]===`-`&&(i=!0),r=r.replace(/^\s*[+-]/,``));let s=t;s===void 0&&(Se.test(r)||Ce.test(r)?s=`ar`:we.test(r)&&(s=`zh`));let{group:c,decimal:l,currency:u}=Fe(s,n),d=z(s,n).formatToParts(1).filter(e=>e.type===`unit`).map(e=>q(e.value)),f=d.length?new RegExp(d.join(`|`),`g`):null,p=null;c&&(p=/\p{Zs}/u.test(c)?/\p{Zs}/gu:c===`'`||c===`’`?/['’]/g:new RegExp(q(c),`g`));let m=[{regex:c?p:null,replacement:``},{regex:l?new RegExp(q(l),`g`):null,replacement:`.`},{regex:/./g,replacement:`.`},{regex:/,/g,replacement:``},{regex:/٫/g,replacement:`.`},{regex:/٬/g,replacement:``},{regex:u?new RegExp(q(u),`g`):null,replacement:``},{regex:f,replacement:``},{regex:ye,replacement:e=>String(me.indexOf(e))},{regex:W,replacement:e=>String(H.indexOf(e))},{regex:be,replacement:e=>String(U.indexOf(e))},{regex:xe,replacement:e=>pe[e]}].reduce((e,{regex:t,replacement:n})=>t?e.replace(t,n):e,r),h=m.lastIndexOf(`.`);if(h!==-1&&(m=`${m.slice(0,h).replace(/\./g,``)}.${m.slice(h+1).replace(/\./g,``)}`),/^[-+]?Infinity$/i.test(r)||/[∞]/.test(r))return null;let g=(i?`-`:``)+m,_=parseFloat(g),v=n?.style,y=v===`unit`&&n?.unit===`percent`,b=G.test(e)||v===`percent`;return K.test(e)?_/=1e3:!y&&b&&(_/=100),Number.isNaN(_)?null:_}var Ie=1e-10;function Le(e){let t=z(`en-US`).resolvedOptions(),n=e?.minimumFractionDigits??t.minimumFractionDigits??0;return{maximumFractionDigits:Math.max(e?.maximumFractionDigits??t.maximumFractionDigits??20,n),minimumFractionDigits:n}}function Re(e,t){if(!Number.isFinite(e))return e;let n=Math.min(Math.max(t,0),20);return Number(e.toFixed(n))}function Q(e,t){let{maximumFractionDigits:n}=Le(t);return Re(e,n)}function ze(e,t,n,r=`directional`){if(n===0)return e;let i=Math.abs(n),a=Math.sign(n),o=i*Ie*a,s=r===`nearest`?n:i,c=(e-t+o)/s,l;return l=r===`nearest`?Math.round(c):a>0?Math.floor(c):Math.ceil(c),t+l*(r===`nearest`?n:i)}function Be(e,{step:t,minWithDefault:n,maxWithDefault:r,minWithZeroDefault:i,format:a,snapOnStep:o,small:s,clamp:c}){if(e===null)return e;let l=c?se(e,n,r):e;if(t!=null&&o){if(t===0)return Q(l,a);let e=i;return!s&&n!==-(2**53-1)&&(e=n),Q(ze(l,e,t,s?`nearest`:`directional`),a)}return Q(l,a)}var $=e(r()),Ve=L.forwardRef(function(e,t){let{id:n,min:r,max:i,smallStep:o=.1,step:u=1,largeStep:d=10,required:f=!1,disabled:p=!1,readOnly:m=!1,form:_,name:v,defaultValue:y,value:x,onValueChange:S,onValueCommitted:w,allowWheelScrub:T=!1,snapOnStep:E=!1,allowOutOfRange:O=!1,format:j,locale:N,render:P,className:ne,inputRef:ie,style:I,...ae}=e,{setDirty:oe,validityData:se,disabled:ue,setFilled:de,invalid:z,name:fe,state:V,validation:pe,shouldValidateOnChange:me}=g(),H=ue||p,U=fe??v,_e=u===`any`?1:u,[ve,ye]=L.useState(!1),W=r??-(2**53-1),be=i??2**53-1,xe=r??0,G=j?.style,K=L.useRef(null),Se=a(ie,pe.inputRef),Ce=l({id:n}),[we,Te]=A({controlled:x,default:y,name:`NumberField`,state:`value`}),q=we??null,Ae=C(q);h(()=>{de(q!==null)},[de,q]);let je=ce(),Me=C(j),Ne=L.useRef(!1),Pe=s((e,t)=>{Ne.current=!1,w?.(e,t)}),J=L.useRef(!0),Y=L.useRef(null),[X,Z]=L.useState(()=>x===void 0?B(q,N,j):He(q,N,j)),[Ie,Le]=L.useState(`numeric`),Re=s(()=>{let{decimal:e,group:t,currency:n,literal:r}=Fe(N,j),i=new Set;Ee.forEach(e=>i.add(e)),e&&i.add(e),t&&(i.add(t),De.test(t)&&i.add(` `));let a=G===`percent`||G===`unit`&&j?.unit===`percent`,o=G===`percent`||G===`unit`&&j?.unit===`permille`;return a&&he.forEach(e=>i.add(e)),o&&ge.forEach(e=>i.add(e)),G===`currency`&&n&&i.add(n),r&&(Array.from(r).forEach(e=>i.add(e)),De.test(r)&&i.add(` `)),Oe.forEach(e=>i.add(e)),W<0&&ke.forEach(e=>i.add(e)),i}),Q=s(e=>e?.altKey?o:e?.shiftKey?d:_e),ze=s((e,t)=>{let n=t.event,r=t.direction,i=t.reason,a=!O||i!==`input-change`&&i!==`input-blur`&&i!==`input-paste`&&i!==`input-clear`&&i!==`none`,o=Be(e,{step:r?Q(n)*r:void 0,format:Me.current,minWithDefault:W,maxWithDefault:be,minWithZeroDefault:xe,snapOnStep:E,small:n?.altKey??!1,clamp:a}),s=t.reason===`input-change`||t.reason===`input-clear`||t.reason===`input-blur`||t.reason===`input-paste`||t.reason===`none`,c=o!==q||s&&(e!==q||J.current===!1);if(c){if(Y.current=o,S?.(o,t),t.isCanceled)return c;Te(o),oe(o!==se.initialValue),Ne.current=!0}return J.current&&Z(B(o,N,j)),je(),c}),Ve=s((e,{direction:t,currentValue:n,event:i,reason:a})=>{let o=n??Ae.current,s=typeof o==`number`?o+e*t:Math.max(0,r??0);return ze(s,D(a,i,void 0,{direction:t}))});h(function(){if(!J.current)return;let e=x===void 0?B(q,N,j):He(q,N,j);e!==X&&Z(e)}),h(function(){if(!c)return;let e=`text`;W>=0&&(e=`decimal`),Le(e)},[W,G]),L.useEffect(function(){let e=K.current;if(H||m||!T||!e)return;function t(e){if(e.ctrlKey||ee(M(K.current))!==K.current)return;e.preventDefault(),J.current=!0;let t=Q(e)??1;Ve(t,{direction:e.deltaY>0?-1:1,event:e,reason:`wheel`})}return F(e,`wheel`,t)},[T,Ve,H,m,Q]);let Ue=L.useMemo(()=>({...V,disabled:H,readOnly:m,required:f,value:q,inputValue:X,scrubbing:ve}),[V,H,m,f,q,X,ve]),We=L.useMemo(()=>({inputRef:K,inputValue:X,value:q,minWithDefault:W,maxWithDefault:be,disabled:H,readOnly:m,id:Ce,setValue:ze,incrementValue:Ve,getStepAmount:Q,allowInputSyncRef:J,formatOptionsRef:Me,valueRef:Ae,lastChangedValueRef:Y,hasPendingCommitRef:Ne,name:U,required:f,invalid:z,inputMode:Ie,getAllowedNonNumericKeys:Re,min:r,max:i,setInputValue:Z,locale:N,isScrubbing:ve,setIsScrubbing:ye,state:Ue,onValueCommitted:Pe}),[K,X,q,W,be,H,m,Ce,ze,Ve,Q,Me,Ae,U,f,z,Ie,Re,r,i,Z,N,ve,Ue,Pe]),Ge=re(`div`,e,{ref:t,state:Ue,props:ae,stateAttributesMapping:R});return(0,$.jsxs)(le.Provider,{value:We,children:[Ge,(0,$.jsx)(`input`,{...pe.getInputValidationProps({onFocus(){K.current?.focus()},onChange(e){if(e.nativeEvent.defaultPrevented||H||m){e.preventBaseUIHandler?.();return}let t=e.currentTarget.valueAsNumber,n=Number.isNaN(t)?null:t,r=D(te,e.nativeEvent);oe(n!==se.initialValue),ze(n,r),me()&&pe.commit(n)}}),ref:Se,type:`number`,form:_,name:U,value:q??``,min:r,max:i,step:u,disabled:H,required:f,"aria-hidden":!0,tabIndex:-1,style:U?k:b,suppressHydrationWarning:!0})]})});function He(e,t,n){return n?.maximumFractionDigits!=null||n?.minimumFractionDigits!=null?B(e,t,n):fe(e,t,n)}var Ue=L.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,{state:o}=ue();return re(`div`,e,{ref:t,state:o,props:[{role:`group`},a],stateAttributesMapping:R})}),We=0,Ge=class e extends ie{static create(){return new e}start(e,t){this.clear(),this.currentId=setInterval(()=>{t()},e)}clear=()=>{this.currentId!==We&&(clearInterval(this.currentId),this.currentId=We)}};function Ke(){let e=E(Ge.create).current;return d(e.disposeEffect),e}var qe=60,Je=400,Ye=8,Xe=50,Ze=3;function Qe(e){return e===`touch`||e===`pen`}function $e(e){let{disabled:t,readOnly:n=!1,tick:r,onStop:i,tickDelay:a=qe,startDelay:o=Je,scrollDistance:c=Ye,elementRef:l}=e,u=S(),d=Ke(),f=S(),p=L.useRef(!1),m=L.useRef(0),h=L.useRef({x:0,y:0}),g=L.useRef(!1),v=L.useRef(!1),y=L.useRef(``),b=L.useRef(()=>{}),x=s(()=>{f.clear(),u.clear(),d.clear(),b.current(),m.current=0});function C(e){x();let t=l.current;if(!t)return;let n=_(t);function s(e){e.preventDefault()}if(b.current=F(n,`contextmenu`,s),F(n,`pointerup`,e=>{p.current=!1,x(),i?.(e)},{once:!0}),!r(e)){x();return}u.start(o,()=>{d.start(a,()=>{r(e)||x()})})}return L.useEffect(()=>()=>x(),[x]),{pointerHandlers:{onTouchStart(){g.current=!0},onTouchEnd(){g.current=!1},onPointerDown(e){let r=!e.button||e.button===0;e.defaultPrevented||!r||t||n||(y.current=e.pointerType,v.current=!1,p.current=!0,h.current={x:e.clientX,y:e.clientY},Qe(e.pointerType)?f.start(Xe,()=>{let t=m.current;m.current=0,p.current&&t<Ze?(C(e.nativeEvent),v.current=!0):(v.current=!1,x())}):(e.preventDefault(),C(e.nativeEvent)))},onPointerUp(e){Qe(e.pointerType)&&(p.current=!1)},onPointerMove(e){if(t||n||!Qe(e.pointerType)||!p.current)return;m.current!=null&&(m.current+=1);let{x:r,y:i}=h.current,a=r-e.clientX,o=i-e.clientY;a**2+o**2>c**2&&x()},onMouseEnter(e){e.defaultPrevented||t||n||!p.current||g.current||Qe(y.current)||C(e.nativeEvent)},onMouseLeave(){g.current||x()},onMouseUp(){g.current||x()}},shouldSkipClick:s(e=>e.defaultPrevented?!0:Qe(y.current)?v.current:e.detail!==0)}}function et(e){return e===`touch`||e===`pen`}function tt(e){let{allowInputSyncRef:t,disabled:n,formatOptionsRef:r,getStepAmount:a,id:o,incrementValue:s,inputRef:c,inputValue:l,isIncrement:u,locale:d,readOnly:f,setValue:p,valueRef:m,lastChangedValueRef:h,onValueCommitted:g}=e,_=u?P:v;function y(e){t.current=!0;let n=Z(l,d,r.current);n!==null&&(m.current=n,p(n,D(_,e,void 0,{direction:u?1:-1})))}let{pointerHandlers:b,shouldSkipClick:x}=$e({disabled:n||f,elementRef:c,tickDelay:60,startDelay:400,scrollDistance:8,tick(e){let t=a(e)??1;return s(t,{direction:u?1:-1,event:e,reason:_})},onStop(e){let t=h.current??m.current;g(t,i(_,e))}});return{disabled:n,"aria-readonly":f||void 0,"aria-label":u?`Increase`:`Decrease`,"aria-controls":o,tabIndex:-1,style:{WebkitUserSelect:`none`,userSelect:`none`},...b,onClick(e){let t=n||f;if(e.defaultPrevented||t||x(e))return;y(e.nativeEvent);let r=a(e)??1,o=m.current;s(r,{direction:u?1:-1,event:e.nativeEvent,reason:_});let c=h.current??m.current;c!==o&&g(c,i(_,e.nativeEvent))},onPointerDown(e){let t=!e.button||e.button===0;e.defaultPrevented||f||!t||n||(y(e.nativeEvent),et(e.pointerType)||c.current?.focus(),b.onPointerDown(e))}}}var nt=L.forwardRef(function(e,t){let{render:n,className:r,disabled:i=!1,nativeButton:a=!0,style:o,...s}=e,{allowInputSyncRef:c,disabled:l,formatOptionsRef:u,getStepAmount:d,id:f,incrementValue:p,inputRef:m,inputValue:h,locale:g,maxWithDefault:_,readOnly:v,setValue:y,state:b,value:x,valueRef:S,lastChangedValueRef:C,onValueCommitted:w}=ue(),T=i||l||x!=null&&x>=_,E=tt({isIncrement:!0,inputRef:m,inputValue:h,disabled:T,readOnly:v,id:f,setValue:y,getStepAmount:d,incrementValue:p,allowInputSyncRef:c,formatOptionsRef:u,valueRef:S,locale:g,lastChangedValueRef:C,onValueCommitted:w}),{getButtonProps:D,buttonRef:O}=I({disabled:T,native:a,focusableWhenDisabled:!0}),k=L.useMemo(()=>({...b,disabled:T}),[b,T]);return re(`button`,e,{ref:[t,O],state:k,props:[E,s,D],stateAttributesMapping:R})}),rt=L.forwardRef(function(e,t){let{render:n,className:r,disabled:i=!1,nativeButton:a=!0,style:o,...s}=e,{allowInputSyncRef:c,disabled:l,formatOptionsRef:u,getStepAmount:d,id:f,incrementValue:p,inputRef:m,inputValue:h,minWithDefault:g,readOnly:_,setValue:v,state:y,value:b,valueRef:x,locale:S,lastChangedValueRef:C,onValueCommitted:w}=ue(),T=i||l||b!=null&&b<=g,E=tt({isIncrement:!1,inputRef:m,inputValue:h,disabled:T,readOnly:_,id:f,setValue:v,getStepAmount:d,incrementValue:p,allowInputSyncRef:c,formatOptionsRef:u,valueRef:x,locale:S,lastChangedValueRef:C,onValueCommitted:w}),{getButtonProps:D,buttonRef:O}=I({disabled:T,native:a,focusableWhenDisabled:!0}),k=L.useMemo(()=>({...y,disabled:T}),[y,T]);return re(`button`,e,{ref:[t,O],state:k,props:[E,s,D],stateAttributesMapping:R})}),it={...m,...R},at=new Set([`Backspace`,`Delete`,`ArrowLeft`,`ArrowRight`,`Tab`,`Enter`,`Escape`]),ot=L.forwardRef(function(e,t){let{render:n,className:r,style:a,...s}=e,{allowInputSyncRef:c,disabled:l,formatOptionsRef:u,getAllowedNonNumericKeys:d,getStepAmount:p,id:m,incrementValue:h,inputMode:_,inputValue:v,max:y,min:b,name:S,readOnly:C,required:E,setValue:k,state:ee,setInputValue:A,locale:M,inputRef:N,value:P,onValueCommitted:F,lastChangedValueRef:te,hasPendingCommitRef:ie,valueRef:I}=ue(),{clearErrors:se}=oe(),{validationMode:ce,setTouched:le,setFocused:R,invalid:de,shouldValidateOnChange:z,validation:V}=g(),{labelId:pe}=f(),me=L.useRef(!1),H=L.useRef(!1);return ae(N,m,P),o(P,e=>{let t=z();if(se(S),t&&V.commit(P),!(e===P||t)){if(H.current){H.current=!1;return}V.commit(P,!0)}}),re(`input`,e,{ref:[t,N],state:ee,props:[{id:m,required:E,disabled:l,readOnly:C,inputMode:_,value:v,type:`text`,autoComplete:`off`,autoCorrect:`off`,spellCheck:`false`,"aria-roledescription":`Number field`,"aria-invalid":de||void 0,"aria-labelledby":pe,suppressHydrationWarning:!0,onFocus(e){if(e.defaultPrevented||C||l||(R(!0),me.current))return;me.current=!0;let t=e.currentTarget,n=t.value.length;t.setSelectionRange(n,n)},onBlur(e){if(e.defaultPrevented||C||l)return;le(!0),R(!1);let t=!c.current,n=ie.current;if(c.current=!0,v.trim()===``){k(null,D(T,e.nativeEvent)),ce===`onBlur`&&V.commit(null),F(null,i(T,e.nativeEvent));return}let r=u.current,a=Z(v,M,r);if(a===null)return;let o=r?.maximumFractionDigits!=null||r?.minimumFractionDigits!=null,s=r?.maximumFractionDigits,d=o&&typeof s==`number`?Number(a.toFixed(s)):a,f=i(O,e.nativeEvent),p=P!==d,m=t||p||n;ce===`onBlur`&&V.commit(d),p&&(H.current=!0,k(d,D(O,e.nativeEvent))),m&&F(d,f);let h=B(d,M,r);(o||a!==P||v!==fe(a,M,r))&&v!==h&&A(h)},onChange(e){if(e.nativeEvent.defaultPrevented)return;c.current=!1;let t=e.currentTarget.value;if(t.trim()===``){A(t),k(null,D(T,e.nativeEvent));return}let n=d();if(!Array.from(t).every(e=>{let t=e>=`0`&&e<=`9`,r=Se.test(e),i=we.test(e),a=Ce.test(e),o=Te.test(e),s=Y.test(e);return t||r||i||a||o||s||n.has(e)}))return;let r=Z(t,M,u.current);A(t),r!==null&&k(r,D(j,e.nativeEvent))},onKeyDown(e){if(e.defaultPrevented||C||l)return;let t=e.nativeEvent;c.current=!0;let n=d(),r=n.has(e.key),{decimal:a,currency:o,percentSign:s}=Fe(M,u.current),f=e.currentTarget.selectionStart,m=e.currentTarget.selectionEnd,g=f===0&&m===v.length,_=e=>f!=null&&m!=null&&e>=f&&e<m;if(Y.test(e.key)&&Array.from(n).some(e=>Y.test(e||``))){let e=v.search(Pe),t=e!=null&&e!==-1&&_(e);r=!(Y.test(v)||X.test(v))||g||t}if(X.test(e.key)&&Array.from(n).some(e=>X.test(e||``))){let e=v.search(J),t=e!=null&&e!==-1&&_(e);r=!(Y.test(v)||X.test(v))||g||t}[a,o,s].forEach(t=>{if(e.key===t){let e=v.indexOf(t),n=_(e);r=!v.includes(t)||g||n}});let x=e.key>=`0`&&e.key<=`9`,S=Se.test(e.key),T=we.test(e.key),E=Ce.test(e.key),O=Te.test(e.key),ee=at.has(e.key);if(e.which===229||e.altKey||e.ctrlKey||e.metaKey||r||x||S||O||T||E||ee)return;let A=Z(v,M,u.current),j=p(e)??1;ne(e);let N=i(w,t);e.key===`ArrowUp`?(h(j,{direction:1,currentValue:A,event:t,reason:w}),F(te.current??I.current,N)):e.key===`ArrowDown`?(h(j,{direction:-1,currentValue:A,event:t,reason:w}),F(te.current??I.current,N)):e.key===`Home`&&b!=null?(k(b,D(w,t)),F(te.current??I.current,N)):e.key===`End`&&y!=null&&(k(y,D(w,t)),F(te.current??I.current,N))},onPaste(e){if(e.defaultPrevented||C||l)return;e.preventDefault();let t=(e.clipboardData||window.Clipboard).getData(`text/plain`),n=Z(t,M,u.current);n!==null&&(c.current=!1,k(n,D(x,e.nativeEvent)),A(t))}},V.getValidationProps(),s],stateAttributesMapping:it})}),st=n();function ct(e){let t=(0,st.c)(12),n,r,i,a;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4]):({id:r,className:n,size:a,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a);let o=a===void 0?`default`:a,s=L.useId(),c=r??s,l;t[5]===n?l=t[6]:(l=N(`flex w-full flex-col items-start gap-2`,n),t[5]=n,t[6]=l);let u;return t[7]!==c||t[8]!==i||t[9]!==o||t[10]!==l?(u=(0,$.jsx)(Ve,{className:l,"data-size":o,"data-slot":`number-field`,id:c,...i}),t[7]=c,t[8]=i,t[9]=o,t[10]=l,t[11]=u):u=t[11],u}function lt(e){let t=(0,st.c)(11),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({className:n,shape:i,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a=i===void 0?`default`:i,o=a===`pill`&&`overflow-hidden rounded-xl before:rounded-xl`,s=a===`soft`&&`rounded-lg border-transparent bg-accent shadow-none before:hidden dark:bg-accent`,c;t[4]!==n||t[5]!==o||t[6]!==s?(c=N(`relative flex w-full justify-between rounded-lg border border-input bg-background not-dark:bg-clip-padding text-base text-foreground shadow-xs/5 ring-ring/24 transition-shadow before:pointer-events-none before:absolute before:inset-0 before:rounded-[calc(var(--radius-lg)-1px)] not-data-disabled:not-focus-within:not-aria-invalid:before:shadow-[0_1px_--theme(--color-black/4%)] focus-within:border-ring focus-within:ring-[3px] focus-within:ring-inset has-aria-invalid:border-destructive/36 has-autofill:bg-foreground/4 focus-within:has-aria-invalid:border-destructive/64 focus-within:has-aria-invalid:ring-destructive/48 data-disabled:pointer-events-none data-disabled:opacity-64 sm:text-sm dark:bg-input/32 dark:has-autofill:bg-foreground/8 dark:has-aria-invalid:ring-destructive/24 dark:not-data-disabled:not-focus-within:not-aria-invalid:before:shadow-[0_-1px_--theme(--color-white/6%)] [&_svg:not([class*='size-'])]:size-4.5 sm:[&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0 [[data-disabled],:focus-within,[aria-invalid]]:shadow-none`,o,s,n),t[4]=n,t[5]=o,t[6]=s,t[7]=c):c=t[7];let l;return t[8]!==r||t[9]!==c?(l=(0,$.jsx)(Ue,{className:c,"data-slot":`number-field-group`,...r}),t[8]=r,t[9]=c,t[10]=l):l=t[10],l}function ut(e){let t=(0,st.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=N(`relative flex shrink-0 cursor-pointer items-center justify-center rounded-s-[calc(var(--radius-lg)-1px)] in-data-[size=sm]:px-[calc(--spacing(2.5)-1px)] in-data-[size=compact]:w-8 in-data-[size=compact]:px-0 px-[calc(--spacing(3)-1px)] transition-colors pointer-coarse:after:absolute pointer-coarse:after:size-full pointer-coarse:after:min-h-11 pointer-coarse:after:min-w-11 hover:bg-accent`,n),t[3]=n,t[4]=i);let a;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,$.jsx)(p,{}),t[5]=a):a=t[5];let o;return t[6]!==r||t[7]!==i?(o=(0,$.jsx)(rt,{className:i,"data-slot":`number-field-decrement`,...r,children:a}),t[6]=r,t[7]=i,t[8]=o):o=t[8],o}function dt(e){let t=(0,st.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=N(`relative flex shrink-0 cursor-pointer items-center justify-center rounded-e-[calc(var(--radius-lg)-1px)] in-data-[size=sm]:px-[calc(--spacing(2.5)-1px)] in-data-[size=compact]:w-8 in-data-[size=compact]:px-0 px-[calc(--spacing(3)-1px)] transition-colors pointer-coarse:after:absolute pointer-coarse:after:size-full pointer-coarse:after:min-h-11 pointer-coarse:after:min-w-11 hover:bg-accent`,n),t[3]=n,t[4]=i);let a;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,$.jsx)(y,{}),t[5]=a):a=t[5];let o;return t[6]!==r||t[7]!==i?(o=(0,$.jsx)(nt,{className:i,"data-slot":`number-field-increment`,...r,children:a}),t[6]=r,t[7]=i,t[8]=o):o=t[8],o}function ft(e){let t=(0,st.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=N(`h-8.5 in-data-[size=compact]:h-8 in-data-[size=compact]:px-0 in-data-[size=compact]:leading-8 sm:in-data-[size=compact]:h-8 sm:in-data-[size=compact]:leading-8 in-data-[size=lg]:h-9.5 in-data-[size=sm]:h-7.5 w-full min-w-0 grow bg-transparent in-data-[size=sm]:px-[calc(--spacing(2.5)-1px)] px-[calc(--spacing(3)-1px)] text-center tabular-nums in-data-[size=lg]:leading-9.5 in-data-[size=sm]:leading-7.5 leading-8.5 outline-none [transition:background-color_5000000s_ease-in-out_0s] sm:h-7.5 sm:in-data-[size=lg]:h-8.5 sm:in-data-[size=sm]:h-6.5 sm:in-data-[size=lg]:leading-8.5 sm:in-data-[size=sm]:leading-8.5 sm:leading-7.5`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,$.jsx)(ot,{className:i,"data-slot":`number-field-input`,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}export{ft as a,dt as i,ut as n,lt as r,ct as t};
2
+ //# sourceMappingURL=number-field-qEfih146.js.map
@@ -1,2 +1,2 @@
1
- import{a as e}from"./react-DH3P2YXY.js";import{wa as t}from"./utils-DhUt689t.js";var n=e(t(),1),r=null,i=new Map;function a(e){let t=new Map;for(let n of e){let e=i.get(n.target);if(!e)continue;let r=e.subscriptions;if(e.waiting){let t=e.last?.contentRect;t?.width===n.contentRect.width&&t.height===n.contentRect.height&&(r=e.waiting),e.waiting=null}e.last=n;for(let e of r){let r=t.get(e);r?r.push(n):t.set(e,[n])}}t.size!==0&&(0,n.flushSync)(()=>{for(let[e,n]of t)if(e.active)try{e.callback(n)}catch(e){queueMicrotask(()=>{throw e})}})}function o(e,t){if(typeof ResizeObserver>`u`)return()=>{};let n=r??=new ResizeObserver(a),o={callback:t,active:!0},s=Array.isArray(e)?e:[e];for(let e of s){let t=i.get(e);if(!t){i.set(e,{subscriptions:new Set([o]),waiting:null,last:null}),n.observe(e);continue}t.subscriptions.add(o),t.last&&((t.waiting??=new Set).add(o),n.unobserve(e),n.observe(e))}return()=>{if(!o.active)return;o.active=!1;let e=s.filter(e=>{let t=i.get(e);return t?.subscriptions.delete(o)?(t.waiting?.delete(o),t.subscriptions.size===0&&i.delete(e)):!1});if(i.size>0)for(let t of e)n.unobserve(t);else r?.disconnect(),r=null}}export{o as t};
2
- //# sourceMappingURL=observeResize-DSyLC8QK.js.map
1
+ import{a as e}from"./react-DH3P2YXY.js";import{wa as t}from"./utils-CBe1bHL7.js";var n=e(t(),1),r=null,i=new Map;function a(e){let t=new Map;for(let n of e){let e=i.get(n.target);if(!e)continue;let r=e.subscriptions;if(e.waiting){let t=e.last?.contentRect;t?.width===n.contentRect.width&&t.height===n.contentRect.height&&(r=e.waiting),e.waiting=null}e.last=n;for(let e of r){let r=t.get(e);r?r.push(n):t.set(e,[n])}}t.size!==0&&(0,n.flushSync)(()=>{for(let[e,n]of t)if(e.active)try{e.callback(n)}catch(e){queueMicrotask(()=>{throw e})}})}function o(e,t){if(typeof ResizeObserver>`u`)return()=>{};let n=r??=new ResizeObserver(a),o={callback:t,active:!0},s=Array.isArray(e)?e:[e];for(let e of s){let t=i.get(e);if(!t){i.set(e,{subscriptions:new Set([o]),waiting:null,last:null}),n.observe(e);continue}t.subscriptions.add(o),t.last&&((t.waiting??=new Set).add(o),n.unobserve(e),n.observe(e))}return()=>{if(!o.active)return;o.active=!1;let e=s.filter(e=>{let t=i.get(e);return t?.subscriptions.delete(o)?(t.waiting?.delete(o),t.subscriptions.size===0&&i.delete(e)):!1});if(i.size>0)for(let t of e)n.unobserve(t);else r?.disconnect(),r=null}}export{o as t};
2
+ //# sourceMappingURL=observeResize-DzSkewug.js.map
@@ -1,2 +1,2 @@
1
- import{Xx as e}from"./utils-DhUt689t.js";import{I as t,k as n}from"./runtime-OeWFs5Hf.js";import{At as r,t as i}from"./runtime-Ca_Z-vg5.js";var a=n(),o=t(i,{label:`web:connection:connect-pairing`,scheduler:a,concurrency:{mode:`singleFlight`,key:e=>JSON.stringify(e)},execute:t=>r.pipe(e(e=>e.registerPairing(t)))}),s=t(i,{label:`web:connection:connect-ssh`,scheduler:a,concurrency:{mode:`serial`,key:e=>JSON.stringify(e.target)},execute:t=>r.pipe(e(e=>e.registerSsh(t)))});export{s as n,o as t};
2
- //# sourceMappingURL=onboarding-BPkAEHBV.js.map
1
+ import{Xx as e}from"./utils-CBe1bHL7.js";import{I as t,k as n}from"./runtime-CeFhsGnm.js";import{At as r,t as i}from"./runtime-BOlBBevr.js";var a=n(),o=t(i,{label:`web:connection:connect-pairing`,scheduler:a,concurrency:{mode:`singleFlight`,key:e=>JSON.stringify(e)},execute:t=>r.pipe(e(e=>e.registerPairing(t)))}),s=t(i,{label:`web:connection:connect-ssh`,scheduler:a,concurrency:{mode:`serial`,key:e=>JSON.stringify(e.target)},execute:t=>r.pipe(e(e=>e.registerSsh(t)))});export{s as n,o as t};
2
+ //# sourceMappingURL=onboarding-1Zg3fM0A.js.map
@@ -1,2 +1,2 @@
1
- import{Go as e,Ho as t,Ko as n,Lo as r,Nw as i,Pw as a,Wo as o,bs as s,lT as c}from"./utils-DhUt689t.js";import{z as l}from"./runtime-OeWFs5Hf.js";import{s as u,u as d}from"./rightPanelStore-CGF0-d-1.js";import{t as f}from"./mediaReference-ZW7gfO5X.js";import{u as p}from"./assets-CID0y4Uv.js";import"./assetUrls-B6vsSVWR.js";import{S as m,c as h,d as g,s as _,x as v}from"./browserHistoryStore-CK4YsfkQ.js";var y=e=>/\.(?:html?|pdf)$/i.test(e.split(/[?#]/,1)[0]??``),b=class extends c(`BrowserPreviewUnavailableError`){},x=class extends c(`BrowserSettingsReadError`){get message(){return`Saved browser settings could not be loaded.`}};async function S(i){let c=await g().catch(e=>new x({cause:e}));if(c instanceof x)return s(a(c));let f=m(i.threadRef.environmentId),p=t(i.threadRef).activeTabId,v=()=>u(d.getState().byThreadKey,i.threadRef)?.id??null,y=v(),b=await i.openPreview({environmentId:i.threadRef.environmentId,input:{threadId:i.threadRef.threadId,url:i.url,viewport:h(c),profileId:i.profileId??_(c),...f===void 0?{}:{runtime:f}}});return l(b,a=>{if(o(i.threadRef,i.url),i.background){n(i.threadRef,a),p&&t(i.threadRef).activeTabId===a.tabId&&v()===y&&e(i.threadRef,p);return}r(i.threadRef,a),d.getState().openBrowser(i.threadRef,a.tabId)})}async function C(e){if(!v(e.threadRef.environmentId))return s(a(new b({message:`The integrated browser is unavailable in this runtime.`})));let t=f(e.filePath,e.workspaceRoot).relativePath!==void 0,n=await e.createAssetUrl({environmentId:e.threadRef.environmentId,input:{resource:{_tag:t?`workspace-file`:`media-file`,threadId:e.threadRef.threadId,path:e.filePath}}});if(n._tag===`Failure`)return s(n.cause);let r=p(e.httpBaseUrl,n.value.relativeUrl);return r===null?s(i(Error(`The environment returned an invalid asset URL.`))):S({threadRef:e.threadRef,url:r,openPreview:e.openPreview})}export{S as a,C as i,x as n,y as r,b as t};
2
- //# sourceMappingURL=openFileInPreview-CGM83ICx.js.map
1
+ import{Go as e,Ho as t,Ko as n,Lo as r,Nw as i,Pw as a,Wo as o,bs as s,lT as c}from"./utils-CBe1bHL7.js";import{z as l}from"./runtime-CeFhsGnm.js";import{s as u,u as d}from"./rightPanelStore-Cv1U3yrU.js";import{t as f}from"./mediaReference-BbSbhpkR.js";import{u as p}from"./assets-6zZLBDZw.js";import"./assetUrls-BOJMUK_1.js";import{S as m,c as h,d as g,s as _,x as v}from"./browserHistoryStore-TJXTYA-V.js";var y=e=>/\.(?:html?|pdf)$/i.test(e.split(/[?#]/,1)[0]??``),b=class extends c(`BrowserPreviewUnavailableError`){},x=class extends c(`BrowserSettingsReadError`){get message(){return`Saved browser settings could not be loaded.`}};async function S(i){let c=await g().catch(e=>new x({cause:e}));if(c instanceof x)return s(a(c));let f=m(i.threadRef.environmentId),p=t(i.threadRef).activeTabId,v=()=>u(d.getState().byThreadKey,i.threadRef)?.id??null,y=v(),b=await i.openPreview({environmentId:i.threadRef.environmentId,input:{threadId:i.threadRef.threadId,url:i.url,viewport:h(c),profileId:i.profileId??_(c),...f===void 0?{}:{runtime:f}}});return l(b,a=>{if(o(i.threadRef,i.url),i.background){n(i.threadRef,a),p&&t(i.threadRef).activeTabId===a.tabId&&v()===y&&e(i.threadRef,p);return}r(i.threadRef,a),d.getState().openBrowser(i.threadRef,a.tabId)})}async function C(e){if(!v(e.threadRef.environmentId))return s(a(new b({message:`The integrated browser is unavailable in this runtime.`})));let t=f(e.filePath,e.workspaceRoot).relativePath!==void 0,n=await e.createAssetUrl({environmentId:e.threadRef.environmentId,input:{resource:{_tag:t?`workspace-file`:`media-file`,threadId:e.threadRef.threadId,path:e.filePath}}});if(n._tag===`Failure`)return s(n.cause);let r=p(e.httpBaseUrl,n.value.relativeUrl);return r===null?s(i(Error(`The environment returned an invalid asset URL.`))):S({threadRef:e.threadRef,url:r,openPreview:e.openPreview})}export{S as a,C as i,x as n,y as r,b as t};
2
+ //# sourceMappingURL=openFileInPreview-CiPuDrfB.js.map
@@ -1,2 +1,2 @@
1
- import{$s as e,Aw as t,C_ as n,Mh as r,Uh as i,Zs as a,gb as o,ll as s,sl as c,w_ as l}from"./utils-DhUt689t.js";import"./entities-B8Vupv5g.js";import{jn as u}from"./runtime-Ca_Z-vg5.js";import{B as d,M as f}from"./useSettings-gPlpTIWi.js";var p=`\0no-project`;function m(e){return{sidebarProjectGroupingMode:e.sidebarProjectGroupingMode,sidebarProjectGroupingOverrides:e.sidebarProjectGroupingOverrides}}function h(e){let t=new Set,n=[];for(let r of e){let e=r?.trim();e&&!t.has(e)&&(t.add(e),n.push(e))}return n}function g(e){let t=e.repositoryIdentity?.rootPath?.trim();if(!t)return null;let n=u(e.workspaceRoot),r=u(t);if(n.length===0||r.length===0)return null;if(n===r)return``;let i=`${r}${r.includes(`\\`)?`\\`:`/`}`;return n.startsWith(i)?n.slice(i.length).replaceAll(`\\`,`/`):null}function _(e,t){return`${e}:${u(t)}`}function v(e){return _(e.environmentId,e.workspaceRoot)}function y(e){return v(e)}function b(e){return v(e)}function x(e,t){return t.sidebarProjectGroupingOverrides?.[y(e)]??t.sidebarProjectGroupingMode}function S(e,t){let n=e.repositoryIdentity?l(e.repositoryIdentity):null;if(!n||n.includes(`\0`))return null;if(t===`repository`)return n;let r=g(e);return r===null||r.length===0?n:`${n}::${r}`}function C(t,n){if(n?.groupScratchProjects&&t.isScratch)return p;let r=n?.groupingMode??`repository`;return r===`separate`?v(t):S(t,r)??v(t)??e(a(t.environmentId,t.id))}function w(e,t,n){return C(e,{groupingMode:x(e,t),groupScratchProjects:n?.groupScratchProjects??!1})}function T(e){let t=h(e.members.map(e=>e.title)),r=h(e.members.map(e=>e.repositoryIdentity?n(e.repositoryIdentity):null)),i=h(e.members.map(e=>e.repositoryIdentity?.name)),a=t[0];return t.length===1&&a!==void 0&&!r.includes(a)&&!i.includes(a)?a:r.length===1?r[0]:i.length===1?i[0]:e.representative.title}function E(e){let t=Date.parse(e.updatedAt);if(Number.isFinite(t))return t;let n=Date.parse(e.createdAt);return Number.isFinite(n)?n:0}function D(e,t){let n=E(t)-E(e);return n>0||n===0&&t.id>e.id}function O(e,t){if(t.repositoryIdentity!==null)return t;let n=null;for(let t of e)t.repositoryIdentity!==null&&(n===null||D(n,t))&&(n=t);return n??t}function k(t){let n=new Map;for(let e of t.projects){let t=v(e),r=n.get(t);r?r.push(e):n.set(t,[e])}let r=new Map,i=new Map;for(let[e,a]of n){let n=a.reduce((e,t)=>D(e,t)?t:e),o=C(O(a,n),{groupingMode:x(n,t.settings),groupScratchProjects:t.groupScratchProjects??!1});r.set(e,o);let s={physicalProjectKey:e,project:n},c=i.get(o);c?c.push(s):i.set(o,[s])}let o=new Map,s=new Set;for(let n of t.projects){let i=v(n),c=r.get(i)??w(n,t.settings,{groupScratchProjects:t.groupScratchProjects??!1}),l=e(a(n.environmentId,n.id));if(s.has(l))continue;s.add(l);let u=a(n.environmentId,n.id),d=o.get(c);d?d.push(u):o.set(c,[u])}let c=t.preferredEnvironmentId??null;return Array.from(i,([e,n])=>{let r=(c?n.find(e=>e.project.environmentId===c)?.project:null)??n[0].project;return{key:e,label:t.groupScratchProjects&&r.isScratch?`No project`:n.length>1?T({representative:r,members:n.map(e=>e.project)}):r.title,representative:r,members:n,memberProjectRefs:o.get(e)??[]}})}function A(e,t){let n=new Map;t.forEach((e,t)=>{for(let r of e.memberProjectRefs){let e=`${r.environmentId}\0${r.projectId}`;n.has(e)||n.set(e,t)}});let r=e=>n.get(`${e.environmentId}\0${e.id}`)??t.length;return[...e].sort((e,t)=>r(e)-r(t))}var j={},M=Object.fromEntries(r.map(e=>[e,`environment`]));function N(e,t,n,r){let i=I(e,t,n);return r===void 0?i:P(i,r)}function P(e,t){let n=null,r=null;for(let i of Object.keys(s)){if(e.settings[i]!==null)continue;let{value:a,source:o}=F(i,null,t);n??={...e.settings},r??={...e.sources},n[i]=a,r[i]=o}return n===null||r===null?e:{...e,settings:n,sources:r}}function F(e,t,n){if(t!==null)return{value:t,source:`environment`};let{field:r,builtIn:i}=s[e],a=n?.[r];return a===void 0?{value:i,source:`environment`}:{value:a,source:`p4.json`}}function I(e,t,n){let a=t===null?void 0:e.projectSettingsOverrides[t],o=n==null||e.projectSettingsFolded?a??j:{...n.defaultModelSelection==null?{}:{defaultModelSelection:n.defaultModelSelection},...n.defaultThreadEnvMode==null?{}:{defaultThreadEnvMode:n.defaultThreadEnvMode},...a};if(Object.keys(o).length===0)return{settings:e,sources:M,overrides:j};let s={...M},c={...e};for(let n of r){if(!Object.hasOwn(o,n))continue;let r=o[n];r!==void 0&&(n!==`textGenerationModelSelection`&&n!==`defaultModelSelection`||r==null||i(e,t,r.instanceId))&&(c[n]=r,s[n]=`project`)}let l=c.textGenerationModelSelection;if(!i(e,t,l.instanceId)){let n=f(e.providerInstances,n=>i(e,t,n),{includeConfiguredInstances:!0,defaultModelSelection:c.defaultModelSelection});n!==null&&(c.textGenerationModelSelection=n)}return{settings:c,sources:s,overrides:o}}function L(e){let t=e.projectSettings.settings.defaultThreadEnvMode;if(t===`local`||e.projectHasThreads||e.projectSettings.sources.defaultThreadEnvMode!==`environment`||e.workspaceRoot===null||e.newProjectsRoot==null)return t;let n=u(e.newProjectsRoot),r=u(e.workspaceRoot),i=n.includes(`\\`)?`\\`:`/`,a=n.endsWith(i)?n:`${n}${i}`;return r.startsWith(a)&&r.length>a.length&&!r.slice(a.length).includes(i)?`local`:t}function R(e,t,n){let r=e.projectSettingsOverrides[t];if(r===void 0)return null;let i={...r};for(let e of n)delete i[e];return Object.keys(i).length===0?null:i}function z(e,t){let n=N(e,t).settings.worktreeCleanup;if(n?.mode===`custom`)return n.rules;if(n?.mode===`off`)return{worktreeKeepWhen:e.storageCleanup.worktreeKeepWhen,worktreeAfterDays:null,worktreeSettledAfterDays:null,worktreeOnMerge:!1,worktreeOnDelete:!1,worktreeUnchanged:!1};let{worktreeKeepWhen:r,worktreeAfterDays:i,worktreeSettledAfterDays:a,worktreeOnMerge:o,worktreeOnDelete:s,worktreeUnchanged:c}=e.storageCleanup;return{worktreeKeepWhen:r,worktreeAfterDays:i,worktreeSettledAfterDays:a,worktreeOnMerge:o,worktreeOnDelete:s,worktreeUnchanged:c}}var B=d(c),V=o(B);function H(e){let n=V(e);return t(n)?n.value:null}export{z as a,v as c,b as d,m as f,N as i,_ as l,R as n,k as o,A as p,L as r,w as s,H as t,y as u};
2
- //# sourceMappingURL=p4ProjectFile-CwpteA7b.js.map
1
+ import{$s as e,Aw as t,C_ as n,Mh as r,Uh as i,Zs as a,gb as o,ll as s,sl as c,w_ as l}from"./utils-CBe1bHL7.js";import"./entities-eRiwvW2F.js";import{jn as u}from"./runtime-BOlBBevr.js";import{j as d,z as f}from"./useSettings-VTow9ZEM.js";var p=`\0no-project`;function m(e){return{sidebarProjectGroupingMode:e.sidebarProjectGroupingMode,sidebarProjectGroupingOverrides:e.sidebarProjectGroupingOverrides}}function h(e){let t=new Set,n=[];for(let r of e){let e=r?.trim();e&&!t.has(e)&&(t.add(e),n.push(e))}return n}function g(e){let t=e.repositoryIdentity?.rootPath?.trim();if(!t)return null;let n=u(e.workspaceRoot),r=u(t);if(n.length===0||r.length===0)return null;if(n===r)return``;let i=`${r}${r.includes(`\\`)?`\\`:`/`}`;return n.startsWith(i)?n.slice(i.length).replaceAll(`\\`,`/`):null}function _(e,t){return`${e}:${u(t)}`}function v(e){return _(e.environmentId,e.workspaceRoot)}function y(e){return v(e)}function b(e){return v(e)}function x(e,t){return t.sidebarProjectGroupingOverrides?.[y(e)]??t.sidebarProjectGroupingMode}function S(e,t){let n=e.repositoryIdentity?l(e.repositoryIdentity):null;if(!n||n.includes(`\0`))return null;if(t===`repository`)return n;let r=g(e);return r===null||r.length===0?n:`${n}::${r}`}function C(t,n){if(n?.groupScratchProjects&&t.isScratch)return p;let r=n?.groupingMode??`repository`;return r===`separate`?v(t):S(t,r)??v(t)??e(a(t.environmentId,t.id))}function w(e,t,n){return C(e,{groupingMode:x(e,t),groupScratchProjects:n?.groupScratchProjects??!1})}function T(e){let t=h(e.members.map(e=>e.title)),r=h(e.members.map(e=>e.repositoryIdentity?n(e.repositoryIdentity):null)),i=h(e.members.map(e=>e.repositoryIdentity?.name)),a=t[0];return t.length===1&&a!==void 0&&!r.includes(a)&&!i.includes(a)?a:r.length===1?r[0]:i.length===1?i[0]:e.representative.title}function E(e){let t=Date.parse(e.updatedAt);if(Number.isFinite(t))return t;let n=Date.parse(e.createdAt);return Number.isFinite(n)?n:0}function D(e,t){let n=E(t)-E(e);return n>0||n===0&&t.id>e.id}function O(e,t){if(t.repositoryIdentity!==null)return t;let n=null;for(let t of e)t.repositoryIdentity!==null&&(n===null||D(n,t))&&(n=t);return n??t}function k(t){let n=new Map;for(let e of t.projects){let t=v(e),r=n.get(t);r?r.push(e):n.set(t,[e])}let r=new Map,i=new Map;for(let[e,a]of n){let n=a.reduce((e,t)=>D(e,t)?t:e),o=C(O(a,n),{groupingMode:x(n,t.settings),groupScratchProjects:t.groupScratchProjects??!1});r.set(e,o);let s={physicalProjectKey:e,project:n},c=i.get(o);c?c.push(s):i.set(o,[s])}let o=new Map,s=new Set;for(let n of t.projects){let i=v(n),c=r.get(i)??w(n,t.settings,{groupScratchProjects:t.groupScratchProjects??!1}),l=e(a(n.environmentId,n.id));if(s.has(l))continue;s.add(l);let u=a(n.environmentId,n.id),d=o.get(c);d?d.push(u):o.set(c,[u])}let c=t.preferredEnvironmentId??null;return Array.from(i,([e,n])=>{let r=(c?n.find(e=>e.project.environmentId===c)?.project:null)??n[0].project;return{key:e,label:t.groupScratchProjects&&r.isScratch?`No project`:n.length>1?T({representative:r,members:n.map(e=>e.project)}):r.title,representative:r,members:n,memberProjectRefs:o.get(e)??[]}})}function A(e,t){let n=new Map;t.forEach((e,t)=>{for(let r of e.memberProjectRefs){let e=`${r.environmentId}\0${r.projectId}`;n.has(e)||n.set(e,t)}});let r=e=>n.get(`${e.environmentId}\0${e.id}`)??t.length;return[...e].sort((e,t)=>r(e)-r(t))}var j={},M=Object.fromEntries(r.map(e=>[e,`environment`]));function N(e,t,n,r){let i=I(e,t,n);return r===void 0?i:P(i,r)}function P(e,t){let n=null,r=null;for(let i of Object.keys(s)){if(e.settings[i]!==null)continue;let{value:a,source:o}=F(i,null,t);n??={...e.settings},r??={...e.sources},n[i]=a,r[i]=o}return n===null||r===null?e:{...e,settings:n,sources:r}}function F(e,t,n){if(t!==null)return{value:t,source:`environment`};let{field:r,builtIn:i}=s[e],a=n?.[r];return a===void 0?{value:i,source:`environment`}:{value:a,source:`p4.json`}}function I(e,t,n){let a=t===null?void 0:e.projectSettingsOverrides[t],o=n==null||e.projectSettingsFolded?a??j:{...n.defaultModelSelection==null?{}:{defaultModelSelection:n.defaultModelSelection},...n.defaultThreadEnvMode==null?{}:{defaultThreadEnvMode:n.defaultThreadEnvMode},...a};if(Object.keys(o).length===0)return{settings:e,sources:M,overrides:j};let s={...M},c={...e};for(let n of r){if(!Object.hasOwn(o,n))continue;let r=o[n];r!==void 0&&(n!==`textGenerationModelSelection`&&n!==`defaultModelSelection`||r==null||i(e,t,r.instanceId))&&(c[n]=r,s[n]=`project`)}let l=c.textGenerationModelSelection;if(!i(e,t,l.instanceId)){let n=d(e.providerInstances,n=>i(e,t,n),{includeConfiguredInstances:!0,defaultModelSelection:c.defaultModelSelection});n!==null&&(c.textGenerationModelSelection=n)}return{settings:c,sources:s,overrides:o}}function L(e){let t=e.projectSettings.settings.defaultThreadEnvMode;if(t===`local`||e.projectHasThreads||e.projectSettings.sources.defaultThreadEnvMode!==`environment`||e.workspaceRoot===null||e.newProjectsRoot==null)return t;let n=u(e.newProjectsRoot),r=u(e.workspaceRoot),i=n.includes(`\\`)?`\\`:`/`,a=n.endsWith(i)?n:`${n}${i}`;return r.startsWith(a)&&r.length>a.length&&!r.slice(a.length).includes(i)?`local`:t}function R(e,t,n){let r=e.projectSettingsOverrides[t];if(r===void 0)return null;let i={...r};for(let e of n)delete i[e];return Object.keys(i).length===0?null:i}function z(e,t){let n=N(e,t).settings.worktreeCleanup;if(n?.mode===`custom`)return n.rules;if(n?.mode===`off`)return{worktreeKeepWhen:e.storageCleanup.worktreeKeepWhen,worktreeAfterDays:null,worktreeSettledAfterDays:null,worktreeOnMerge:!1,worktreeOnDelete:!1,worktreeUnchanged:!1};let{worktreeKeepWhen:r,worktreeAfterDays:i,worktreeSettledAfterDays:a,worktreeOnMerge:o,worktreeOnDelete:s,worktreeUnchanged:c}=e.storageCleanup;return{worktreeKeepWhen:r,worktreeAfterDays:i,worktreeSettledAfterDays:a,worktreeOnMerge:o,worktreeOnDelete:s,worktreeUnchanged:c}}var B=f(c),V=o(B);function H(e){let n=V(e);return t(n)?n.value:null}export{z as a,v as c,b as d,m as f,N as i,_ as l,R as n,k as o,A as p,L as r,w as s,H as t,y as u};
2
+ //# sourceMappingURL=p4ProjectFile-BVKW5TIA.js.map
@@ -1,2 +1,2 @@
1
- import{a as e}from"./react-DH3P2YXY.js";import{n as t,t as n}from"./jsx-runtime-BnjsACtP.js";import{a as r}from"./useParams-ekGanxxb.js";import{c as i,l as a,u as o}from"./main-VfCRP294.js";var s=t(),c=e(n());function l(){let e=(0,s.c)(9),t=r(),{authGateState:n}=i.useRouteContext();if(!n)return null;if(n.status===`hosted-pairing`){let t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,c.jsx)(a,{}),e[0]=t):t=e[0],t}let l;e[1]===t.history?l=e[2]:(l=()=>{t.history.replace(`/`),t.history.flush(),window.location.reload()},e[1]=t.history,e[2]=l);let u;e[3]===n.errorMessage?u=e[4]:(u=n.errorMessage?{initialErrorMessage:n.errorMessage}:{},e[3]=n.errorMessage,e[4]=u);let d;return e[5]!==n.auth||e[6]!==l||e[7]!==u?(d=(0,c.jsx)(o,{auth:n.auth,onAuthenticated:l,...u}),e[5]=n.auth,e[6]=l,e[7]=u,e[8]=d):d=e[8],d}export{l as component};
2
- //# sourceMappingURL=pair-D9v8gc0o.js.map
1
+ import{a as e}from"./react-DH3P2YXY.js";import{n as t,t as n}from"./jsx-runtime-BnjsACtP.js";import{a as r}from"./useParams-C5D_t-0u.js";import{c as i,l as a,u as o}from"./main-DleJeMZO.js";var s=t(),c=e(n());function l(){let e=(0,s.c)(9),t=r(),{authGateState:n}=i.useRouteContext();if(!n)return null;if(n.status===`hosted-pairing`){let t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,c.jsx)(a,{}),e[0]=t):t=e[0],t}let l;e[1]===t.history?l=e[2]:(l=()=>{t.history.replace(`/`),t.history.flush(),window.location.reload()},e[1]=t.history,e[2]=l);let u;e[3]===n.errorMessage?u=e[4]:(u=n.errorMessage?{initialErrorMessage:n.errorMessage}:{},e[3]=n.errorMessage,e[4]=u);let d;return e[5]!==n.auth||e[6]!==l||e[7]!==u?(d=(0,c.jsx)(o,{auth:n.auth,onAuthenticated:l,...u}),e[5]=n.auth,e[6]=l,e[7]=u,e[8]=d):d=e[8],d}export{l as component};
2
+ //# sourceMappingURL=pair-DUv1mY4i.js.map
@@ -1,2 +1,2 @@
1
- import{W as e}from"./utils-DhUt689t.js";var t=e()((e,t)=>({pending:new Set,request:t=>e(e=>e.pending.has(t)?e:{pending:new Set([...e.pending,t])}),consume:n=>t().pending.has(n)?(e(e=>{let t=new Set(e.pending);return t.delete(n),{pending:t}}),!0):!1}));export{t};
2
- //# sourceMappingURL=pendingSendStore-BuEVrrEM.js.map
1
+ import{W as e}from"./utils-CBe1bHL7.js";var t=e()((e,t)=>({pending:new Set,request:t=>e(e=>e.pending.has(t)?e:{pending:new Set([...e.pending,t])}),consume:n=>t().pending.has(n)?(e(e=>{let t=new Set(e.pending);return t.delete(n),{pending:t}}),!0):!1}));export{t};
2
+ //# sourceMappingURL=pendingSendStore-BFVsboDn.js.map
@@ -1,2 +1,2 @@
1
- import{b as e,x as t}from"./_chat-CwO3_WVM.js";import{B as n,C as r,E as i,F as a,H as o,I as s,L as c,N as l,O as u,R as d,T as f,U as p,_ as m,a as ee,b as te,c as h,d as g,f as _,g as ne,h as v,i as re,j as ie,k as ae,n as oe,o as y,p as se,r as ce,s as b,t as le,u as ue,v as x,w as de,x as S,z as C}from"./renderScheduler-Dgqqs-EX.js";var w=2.2,T=.075,E=.026,D=.004,O=.008,k=.042499999999999996,A=.07799999999999999,fe=2076/2152,j=e=>Number.isFinite(e)&&e>.75&&e<1.5;function M(e,t,n,r,i=0){let a=t===`left`?-e+n:D/2+i,o=t===`left`?-.004/2-i:e-n,s=-2.2/2+n,c=w/2-n,l=new C;return t===`left`?(l.moveTo(a+r,s),l.lineTo(o,s),l.lineTo(o,c),l.lineTo(a+r,c),l.quadraticCurveTo(a,c,a,c-r),l.lineTo(a,s+r),l.quadraticCurveTo(a,s,a+r,s)):(l.moveTo(a,s),l.lineTo(o-r,s),l.quadraticCurveTo(o,s,o,s+r),l.lineTo(o,c-r),l.quadraticCurveTo(o,c,o-r,c),l.lineTo(a,c)),l.closePath(),l}function N(e,t,n){let r=new C;return r.moveTo(-e/2+n,-t/2),r.lineTo(e/2-n,-t/2),r.quadraticCurveTo(e/2,-t/2,e/2,-t/2+n),r.lineTo(e/2,t/2-n),r.quadraticCurveTo(e/2,t/2,e/2-n,t/2),r.lineTo(-e/2+n,t/2),r.quadraticCurveTo(-e/2,t/2,-e/2,t/2-n),r.lineTo(-e/2,-t/2+n),r.quadraticCurveTo(-e/2,-t/2,-e/2+n,-t/2),r.closePath(),r}function P(e){return N(e-E*2-.02,w-E*2-.04,.07)}function pe(e,t,r,a=fe){let c=w-2*E,d=a*c/2+E,ee=new S,h=new S;ee.add(h);let g=new S,_=new S;h.add(g,_);let v=new ae({color:10726322,metalness:.9,roughness:.28}),re=new ae({color:12896976,metalness:.95,roughness:.16}),ie=new u({color:724240,metalness:.1,roughness:.2,clearcoat:1}),oe=new u({color:2896439,metalness:.35,roughness:.52,clearcoat:.4,clearcoatRoughness:.6}),y=new u({color:1711650,metalness:.55,roughness:.3,clearcoat:1}),ce=new u({color:397346,metalness:.6,roughness:.1,clearcoat:1}),b=new i({color:15919830}),le=new i({map:e,toneMapped:!1}),ue=new i({colorWrite:!1,depthWrite:!1}),x=new i({map:e,toneMapped:!1}),de=[v,re,ie,oe,y,ce,b,le,ue,x];g.position.z=k;let C=new S;C.position.z=-.042499999999999996,g.add(C);function D(e,t,r){let i=new f(new te(M(d,t,O,.1,O),{depth:T-O*2,bevelEnabled:!0,bevelSize:O,bevelThickness:O,bevelSegments:3,curveSegments:12}),v);i.position.z=-.0295,e.add(i);let a=new f(new n(M(d,t,.01,.095,.002),12),ie);a.position.z=.0385,e.add(a);let o=new f(new n(M(d,t===`left`?`right`:`left`,.01,.095,.002),12),r);o.name=`${t}-back`,o.rotation.y=Math.PI,o.position.set(0,0,-.075/2-.001),e.add(o);let s=new n(M(d,t,E,.076));s.computeBoundingBox();let c=new f(s,ue);return c.name=`${t}-inner-screen`,c.position.z=.0405,e.add(c),c}let j=D(C,`left`,ie),pe=D(_,`right`,oe),F=2*(d-E),I=new l(F,c,40,48),L=I.getAttribute(`position`),R=I.getAttribute(`uv`),z=new Float32Array(L.count);for(let e=0;e<L.count;e++){let t=L.getY(e),n=F/2,r=.076,i=Math.max(0,Math.abs(t)-.9980000000000001),a=n-r+Math.sqrt(Math.max(0,r*r-i*i)),o=Math.max(-a,Math.min(a,L.getX(e)));z[e]=o,R.setXY(e,o/F+.5,t/c+.5)}R.needsUpdate=!0;let B=new f(I,le);B.name=`continuous-inner-screen`,h.add(B);let V=.15,H=new f(new m(A,A,2.188,32,1,!1,Math.PI/2+V,Math.PI-V*2),re);H.name=`hinge-spine`,H.position.z=k,h.add(H);let U=new f(new n(P(d)),x);U.name=`cover-screen`,U.position.set(-d/2,0,-.075/2-.003),U.rotation.y=Math.PI,C.add(U);let W=new S;W.name=`rear-camera`;let G=.46,K=.2;W.position.set(d-.07-G/2,w/2-.08-K/2,-.075/2-.002),W.rotation.y=Math.PI,_.add(W);let q=new f(new te(N(G,K,.07),{depth:.02,bevelEnabled:!0,bevelSize:.008,bevelThickness:.006,bevelSegments:3,curveSegments:12}),y);q.name=`camera-plate`,W.add(q);for(let[e,t]of[[-.14,.05],[-.01,.05],[.105,.036]]){let n=new f(new m(t+.012,t+.012,.012,32),v);n.rotation.x=Math.PI/2,n.position.set(e,0,.030000000000000002),W.add(n);let r=new f(new ne(t,32),ce);r.name=`camera-lens`,r.position.set(e,0,.036500000000000005),W.add(r)}let J=new f(new ne(.018,20),b);J.position.set(.185,.045,.026500000000000003),W.add(J);for(let[e,t]of[[.52,.16],[.2,.3]]){let n=new f(new se(.02,t,T*.45),v);n.position.set(d+.008,e,0),_.add(n)}let Y=new s,me=new o,X=new p,Z=null,he=t,Q=r,$=()=>{let e=Q>=90;B.visible=e,j.visible=e,pe.visible=e,U.visible=!e},ge=e=>{Q=Math.max(0,Math.min(180,e)),g.rotation.y=Math.PI*(1-Q/180),H.rotation.y=g.rotation.y/2;let t=g.rotation.y,n=Math.cos(t),r=Math.sin(t),i=-.0010000000000000009;for(let e=0;e<L.count;e++){let t=z[e];t<0?L.setXYZ(e,t*n+i*r,L.getY(e),-t*r+i*n+k):L.setXYZ(e,t,L.getY(e),.041499999999999995)}L.needsUpdate=!0,I.computeBoundingBox(),I.computeBoundingSphere(),$()},_e=(e,t)=>{he=t,le.map=e,x.map=e,U.geometry.computeBoundingBox();let n=U.geometry.boundingBox,r=U.geometry.getAttribute(`uv`),i=U.geometry.getAttribute(`position`);for(let e=0;e<r.count;e++){let t=(i.getX(e)-n.min.x)/(n.max.x-n.min.x),a=(i.getY(e)-n.min.y)/(n.max.y-n.min.y);r.setXY(e,t,a)}r.needsUpdate=!0,$()};return ge(r),_e(e,t),{root:ee,orientation:h,width:d*2,height:w,innerAspect:a,setAngle:ge,setDisplay:_e,screenPoint(e,t,n,r=!1){h.updateWorldMatrix(!0,!0),n.updateMatrixWorld(!0),me.set(e*2-1,1-t*2),Y.setFromCamera(me,n);let i=U.visible?[U]:[j,pe],a=Y.intersectObjects(i,!1)[0];if(!a&&!r)return Z=null,null;let o=a?.object??(Z?.visible?Z:i[0]);if(!o)return null;if(a&&(Z=o),a)X.copy(a.point);else{let e=new p(0,0,1).transformDirection(o.matrixWorld),t=new p().setFromMatrixPosition(o.matrixWorld),n=e.dot(t.clone().sub(Y.ray.origin))/e.dot(Y.ray.direction);if(!Number.isFinite(n))return null;X.copy(Y.ray.direction).multiplyScalar(n).add(Y.ray.origin)}o.worldToLocal(X);let s=o.geometry.boundingBox,c=Math.max(0,Math.min(1,(X.x-s.min.x)/(s.max.x-s.min.x))),l=Math.max(0,Math.min(1,(s.max.y-X.y)/(s.max.y-s.min.y))),u=o===U?c:(o===j?c:1+c)/2;return he.rotation===Math.PI?{x:1-u,y:1-l}:{x:u,y:l}},dispose(){ee.traverse(e=>{e instanceof f&&e.geometry.dispose()});for(let e of de)e.dispose()}}}var F=450,I=850;function L(n){let i=new ue({canvas:n.canvas,alpha:!0,antialias:!0,powerPreference:`low-power`});i.outputColorSpace=c;let o=()=>{let e=new v(n.source);return e.colorSpace=c,e.minFilter=r,e.magFilter=r,e.generateMipmaps=!1,e},s=o(),l=n.source.width,u=n.source.height,f=new d,m=new ie(32,1,.1,30);m.position.z=5.5;let te=new g(16777215,2.4),ne=new x(15003135,5);ne.position.set(-3,4,5);let ae=new x(16777215,4);ae.position.set(3,1,-3);let se=new x(10464468,2);se.position.set(-2,-2,-4),f.add(te,ne,ae,se);let S=null,C=h(S,n.source.width,n.source.height),w=n.profile??t,T=n.foldAngle??null,E=T!==null&&w.id.startsWith(`android`)?0:C.rotation,D=null,O=null,k=n.model??null,A=null,M=null,N=null,P=()=>n.source.width/n.source.height,L=j(P())?P():fe,R=(e,t=C)=>pe(s,t,e,L),z=e=>{if(!N)return e;let t=Math.min(1,(performance.now()-N.startedAt)/I),n=t*t*(3-2*t);return N.from+(N.to-N.from)*n},B=T!==null&&w.id.startsWith(`android`)?R(T):b(s,C,w);f.add(B.root);let V=!1,H=new a,U=ce({choose:e=>oe(e,[{rotation:new a,yawLimit:Math.PI/3}]).rotation});U.setPose(H,performance.now(),!0);let W=re(),G=()=>globalThis.matchMedia?.(`(prefers-reduced-motion: reduce)`).matches??!1,K={width:0,height:0,pixelRatio:1},q={width:0,height:0,pixelRatio:0},J=null,Y=(e=!1)=>{if(!K.width||!K.height)return;m.aspect=K.width/K.height;let t=new _(new p(-B.width/2,-B.height/2,0),new p(B.width/2,B.height/2,0));O&&M&&t.union(M),t.applyMatrix4(new de().makeRotationZ(E));let r=t.getSize(new p),i=r.x/r.y;i!==J&&(J=i,n.onFramingAspect?.(i)),B.root.updateMatrixWorld(!0),W.setBounds(new _().setFromObject(B.root),m.fov*Math.PI/360,m.aspect,performance.now(),e),me()},me=()=>{m.position.set(W.center.x,W.center.y,W.distance()),m.lookAt(W.center.x,W.center.y,0),m.updateProjectionMatrix()},X=()=>{B.root.quaternion.copy(U.rotation),B.orientation.rotation.z=E},Z=le(()=>{if(!V&&K.width&&K.height)try{(q.width!==K.width||q.height!==K.height||q.pixelRatio!==K.pixelRatio)&&(i.setDrawingBufferSize(K.width,K.height,K.pixelRatio),q=K);let e=performance.now();if(U.advance(e,G())&&(X(),Y(G())),D){let t=Math.min(1,(e-D.startedAt)/F),n=t*t*(3-2*t);E=D.from+(D.to-D.from)*n,t===1&&(D=null),X(),Y(G())}if(N&&`setAngle`in B){let t=Math.min(1,(e-N.startedAt)/I),n=t*t*(3-2*t);B.setAngle(N.from+(N.to-N.from)*n),t===1&&(N=null),Y(G())}W.advance(e,G()),me(),i.render(f,m),(U.needsFrame()||W.needsFrame()||D||N)&&Z.invalidate()}catch{n.onUnavailable()}}),he=(e=w)=>{let t=h(S,n.source.width,n.source.height),r=l!==n.source.width||u!==n.source.height;if(r||e!==w||t.aspect!==C.aspect||t.rawLandscape!==C.rawLandscape||t.rotation!==C.rotation){if(r){let e=s;s=o(),l=n.source.width,u=n.source.height,B.setDisplay(s,t),e.dispose()}let i=P(),a=j(i)&&i!==L;if(a&&(L=i),!O&&`setAngle`in B&&a){let e=z(T??180);f.remove(B.root),B.dispose(),B=R(e,t),f.add(B.root)}else!O&&!(`setAngle`in B)&&(e!==w||t.aspect!==C.aspect)?(f.remove(B.root),B.dispose(),B=b(s,t,e),f.add(B.root)):B.setDisplay(s,t);if(t.rotation!==C.rotation){if(e.id.startsWith(`android`)&&!(`setAngle`in B)&&!G()){let e=Math.atan2(Math.sin(t.rotation-E),Math.cos(t.rotation-E));D={from:E,to:E+e,startedAt:performance.now()}}else D=null,E=`setAngle`in B?0:t.rotation}C=t,w=e,X(),Y(!D)}X()},Q=e({load:y,onError:n.onModelError,install(e){let t=V?null:e?ee(e.asset,s,C):T!==null&&w.id.startsWith(`android`)?R(T):b(s,C,w);N=null,f.remove(B.root),B.dispose(),O=e,t&&(B=t,f.add(B.root),A&&(O?B.orientation.add(A.asset):A.asset.removeFromParent()),X(),Y(!0),Z.invalidate())}}),$=e({load:y,onError:n.onModelError,install(e){let t=e?new _().setFromObject(e.asset):null;if(t&&(t.isEmpty()||![...t.min.toArray(),...t.max.toArray()].every(Number.isFinite)))throw Error(`Device accessory has invalid bounds`);A?.asset.removeFromParent(),A=e,M=t,!V&&(O&&A&&B.orientation.add(A.asset),Y(!0),Z.invalidate())}}),ge=e=>{$.set(e?.modelId===k?.id?e:null)},_e=e=>{e.preventDefault(),n.onUnavailable()};return n.canvas.addEventListener(`webglcontextlost`,_e),X(),Q.set(n.model??null),ge(n.accessory??null),{setModel(e){(e?.id!==k?.id||e?.url!==k?.url)&&$.set(null),k=e,Q.set(e)},setAccessory:ge,setFoldAngle(e){if(V||e===T)return;let t=T;if(T=e,!O){if(e===null||!(`setAngle`in B))f.remove(B.root),B.dispose(),B=e===null?b(s,C,w):R(e),f.add(B.root),D=null,E=e===null?C.rotation:0,N=null,X(),Y(!0);else{let n=z(t??e);G()?(N=null,B.setAngle(e),Y(!0)):N={from:n,to:e,startedAt:performance.now()}}Z.invalidate()}},frameUpdated(){V||(he(),s.needsUpdate=!0,Z.invalidate())},setScreen(e,t=w){V||(S=e,he(t),Z.invalidate())},resize(e,t,n){if(V||![e,t,n].every(Number.isFinite)||e<=0||t<=0)return;let r=Math.min(2,Math.max(1,n));(K.width!==e||K.height!==t||K.pixelRatio!==r)&&(K={width:e,height:t,pixelRatio:r},Y(!0),Z.invalidate())},screenPoint(e,t,n=!1){return V?null:(X(),B.screenPoint(e,t,m,n))},orbit(e,t){V||(U.orbit(e*K.width,t*K.height,performance.now()),Z.invalidate())},setInteractionActive(e,t){if(V)return;let n=performance.now();t===`orbit`?U.dragActive(e,n):(U.hold(e,n),W.hold(e,n)),Z.invalidate()},resetPose(){V||(U.reset(H,performance.now()),Z.invalidate())},dispose(){if(V)return;V=!0,Z.dispose();let e=O!==null;$.dispose(),Q.dispose(),n.canvas.removeEventListener(`webglcontextlost`,_e),f.remove(B.root),e||B.dispose(),s.dispose(),i.dispose(),i.forceContextLoss()}}}export{L as createPhoneViewer};
2
- //# sourceMappingURL=phoneViewer-CNE0SVmy.js.map
1
+ import{b as e,x as t}from"./_chat-DDGjgFMR.js";import{B as n,C as r,E as i,F as a,H as o,I as s,L as c,N as l,O as u,R as d,T as f,U as p,_ as m,a as ee,b as te,c as h,d as g,f as _,g as ne,h as v,i as re,j as ie,k as ae,n as oe,o as y,p as se,r as ce,s as b,t as le,u as ue,v as x,w as de,x as S,z as C}from"./renderScheduler-BgGYA97h.js";var w=2.2,T=.075,E=.026,D=.004,O=.008,k=.042499999999999996,A=.07799999999999999,fe=2076/2152,j=e=>Number.isFinite(e)&&e>.75&&e<1.5;function M(e,t,n,r,i=0){let a=t===`left`?-e+n:D/2+i,o=t===`left`?-.004/2-i:e-n,s=-2.2/2+n,c=w/2-n,l=new C;return t===`left`?(l.moveTo(a+r,s),l.lineTo(o,s),l.lineTo(o,c),l.lineTo(a+r,c),l.quadraticCurveTo(a,c,a,c-r),l.lineTo(a,s+r),l.quadraticCurveTo(a,s,a+r,s)):(l.moveTo(a,s),l.lineTo(o-r,s),l.quadraticCurveTo(o,s,o,s+r),l.lineTo(o,c-r),l.quadraticCurveTo(o,c,o-r,c),l.lineTo(a,c)),l.closePath(),l}function N(e,t,n){let r=new C;return r.moveTo(-e/2+n,-t/2),r.lineTo(e/2-n,-t/2),r.quadraticCurveTo(e/2,-t/2,e/2,-t/2+n),r.lineTo(e/2,t/2-n),r.quadraticCurveTo(e/2,t/2,e/2-n,t/2),r.lineTo(-e/2+n,t/2),r.quadraticCurveTo(-e/2,t/2,-e/2,t/2-n),r.lineTo(-e/2,-t/2+n),r.quadraticCurveTo(-e/2,-t/2,-e/2+n,-t/2),r.closePath(),r}function P(e){return N(e-E*2-.02,w-E*2-.04,.07)}function pe(e,t,r,a=fe){let c=w-2*E,d=a*c/2+E,ee=new S,h=new S;ee.add(h);let g=new S,_=new S;h.add(g,_);let v=new ae({color:10726322,metalness:.9,roughness:.28}),re=new ae({color:12896976,metalness:.95,roughness:.16}),ie=new u({color:724240,metalness:.1,roughness:.2,clearcoat:1}),oe=new u({color:2896439,metalness:.35,roughness:.52,clearcoat:.4,clearcoatRoughness:.6}),y=new u({color:1711650,metalness:.55,roughness:.3,clearcoat:1}),ce=new u({color:397346,metalness:.6,roughness:.1,clearcoat:1}),b=new i({color:15919830}),le=new i({map:e,toneMapped:!1}),ue=new i({colorWrite:!1,depthWrite:!1}),x=new i({map:e,toneMapped:!1}),de=[v,re,ie,oe,y,ce,b,le,ue,x];g.position.z=k;let C=new S;C.position.z=-.042499999999999996,g.add(C);function D(e,t,r){let i=new f(new te(M(d,t,O,.1,O),{depth:T-O*2,bevelEnabled:!0,bevelSize:O,bevelThickness:O,bevelSegments:3,curveSegments:12}),v);i.position.z=-.0295,e.add(i);let a=new f(new n(M(d,t,.01,.095,.002),12),ie);a.position.z=.0385,e.add(a);let o=new f(new n(M(d,t===`left`?`right`:`left`,.01,.095,.002),12),r);o.name=`${t}-back`,o.rotation.y=Math.PI,o.position.set(0,0,-.075/2-.001),e.add(o);let s=new n(M(d,t,E,.076));s.computeBoundingBox();let c=new f(s,ue);return c.name=`${t}-inner-screen`,c.position.z=.0405,e.add(c),c}let j=D(C,`left`,ie),pe=D(_,`right`,oe),F=2*(d-E),I=new l(F,c,40,48),L=I.getAttribute(`position`),R=I.getAttribute(`uv`),z=new Float32Array(L.count);for(let e=0;e<L.count;e++){let t=L.getY(e),n=F/2,r=.076,i=Math.max(0,Math.abs(t)-.9980000000000001),a=n-r+Math.sqrt(Math.max(0,r*r-i*i)),o=Math.max(-a,Math.min(a,L.getX(e)));z[e]=o,R.setXY(e,o/F+.5,t/c+.5)}R.needsUpdate=!0;let B=new f(I,le);B.name=`continuous-inner-screen`,h.add(B);let V=.15,H=new f(new m(A,A,2.188,32,1,!1,Math.PI/2+V,Math.PI-V*2),re);H.name=`hinge-spine`,H.position.z=k,h.add(H);let U=new f(new n(P(d)),x);U.name=`cover-screen`,U.position.set(-d/2,0,-.075/2-.003),U.rotation.y=Math.PI,C.add(U);let W=new S;W.name=`rear-camera`;let G=.46,K=.2;W.position.set(d-.07-G/2,w/2-.08-K/2,-.075/2-.002),W.rotation.y=Math.PI,_.add(W);let q=new f(new te(N(G,K,.07),{depth:.02,bevelEnabled:!0,bevelSize:.008,bevelThickness:.006,bevelSegments:3,curveSegments:12}),y);q.name=`camera-plate`,W.add(q);for(let[e,t]of[[-.14,.05],[-.01,.05],[.105,.036]]){let n=new f(new m(t+.012,t+.012,.012,32),v);n.rotation.x=Math.PI/2,n.position.set(e,0,.030000000000000002),W.add(n);let r=new f(new ne(t,32),ce);r.name=`camera-lens`,r.position.set(e,0,.036500000000000005),W.add(r)}let J=new f(new ne(.018,20),b);J.position.set(.185,.045,.026500000000000003),W.add(J);for(let[e,t]of[[.52,.16],[.2,.3]]){let n=new f(new se(.02,t,T*.45),v);n.position.set(d+.008,e,0),_.add(n)}let Y=new s,me=new o,X=new p,Z=null,he=t,Q=r,$=()=>{let e=Q>=90;B.visible=e,j.visible=e,pe.visible=e,U.visible=!e},ge=e=>{Q=Math.max(0,Math.min(180,e)),g.rotation.y=Math.PI*(1-Q/180),H.rotation.y=g.rotation.y/2;let t=g.rotation.y,n=Math.cos(t),r=Math.sin(t),i=-.0010000000000000009;for(let e=0;e<L.count;e++){let t=z[e];t<0?L.setXYZ(e,t*n+i*r,L.getY(e),-t*r+i*n+k):L.setXYZ(e,t,L.getY(e),.041499999999999995)}L.needsUpdate=!0,I.computeBoundingBox(),I.computeBoundingSphere(),$()},_e=(e,t)=>{he=t,le.map=e,x.map=e,U.geometry.computeBoundingBox();let n=U.geometry.boundingBox,r=U.geometry.getAttribute(`uv`),i=U.geometry.getAttribute(`position`);for(let e=0;e<r.count;e++){let t=(i.getX(e)-n.min.x)/(n.max.x-n.min.x),a=(i.getY(e)-n.min.y)/(n.max.y-n.min.y);r.setXY(e,t,a)}r.needsUpdate=!0,$()};return ge(r),_e(e,t),{root:ee,orientation:h,width:d*2,height:w,innerAspect:a,setAngle:ge,setDisplay:_e,screenPoint(e,t,n,r=!1){h.updateWorldMatrix(!0,!0),n.updateMatrixWorld(!0),me.set(e*2-1,1-t*2),Y.setFromCamera(me,n);let i=U.visible?[U]:[j,pe],a=Y.intersectObjects(i,!1)[0];if(!a&&!r)return Z=null,null;let o=a?.object??(Z?.visible?Z:i[0]);if(!o)return null;if(a&&(Z=o),a)X.copy(a.point);else{let e=new p(0,0,1).transformDirection(o.matrixWorld),t=new p().setFromMatrixPosition(o.matrixWorld),n=e.dot(t.clone().sub(Y.ray.origin))/e.dot(Y.ray.direction);if(!Number.isFinite(n))return null;X.copy(Y.ray.direction).multiplyScalar(n).add(Y.ray.origin)}o.worldToLocal(X);let s=o.geometry.boundingBox,c=Math.max(0,Math.min(1,(X.x-s.min.x)/(s.max.x-s.min.x))),l=Math.max(0,Math.min(1,(s.max.y-X.y)/(s.max.y-s.min.y))),u=o===U?c:(o===j?c:1+c)/2;return he.rotation===Math.PI?{x:1-u,y:1-l}:{x:u,y:l}},dispose(){ee.traverse(e=>{e instanceof f&&e.geometry.dispose()});for(let e of de)e.dispose()}}}var F=450,I=850;function L(n){let i=new ue({canvas:n.canvas,alpha:!0,antialias:!0,powerPreference:`low-power`});i.outputColorSpace=c;let o=()=>{let e=new v(n.source);return e.colorSpace=c,e.minFilter=r,e.magFilter=r,e.generateMipmaps=!1,e},s=o(),l=n.source.width,u=n.source.height,f=new d,m=new ie(32,1,.1,30);m.position.z=5.5;let te=new g(16777215,2.4),ne=new x(15003135,5);ne.position.set(-3,4,5);let ae=new x(16777215,4);ae.position.set(3,1,-3);let se=new x(10464468,2);se.position.set(-2,-2,-4),f.add(te,ne,ae,se);let S=null,C=h(S,n.source.width,n.source.height),w=n.profile??t,T=n.foldAngle??null,E=T!==null&&w.id.startsWith(`android`)?0:C.rotation,D=null,O=null,k=n.model??null,A=null,M=null,N=null,P=()=>n.source.width/n.source.height,L=j(P())?P():fe,R=(e,t=C)=>pe(s,t,e,L),z=e=>{if(!N)return e;let t=Math.min(1,(performance.now()-N.startedAt)/I),n=t*t*(3-2*t);return N.from+(N.to-N.from)*n},B=T!==null&&w.id.startsWith(`android`)?R(T):b(s,C,w);f.add(B.root);let V=!1,H=new a,U=ce({choose:e=>oe(e,[{rotation:new a,yawLimit:Math.PI/3}]).rotation});U.setPose(H,performance.now(),!0);let W=re(),G=()=>globalThis.matchMedia?.(`(prefers-reduced-motion: reduce)`).matches??!1,K={width:0,height:0,pixelRatio:1},q={width:0,height:0,pixelRatio:0},J=null,Y=(e=!1)=>{if(!K.width||!K.height)return;m.aspect=K.width/K.height;let t=new _(new p(-B.width/2,-B.height/2,0),new p(B.width/2,B.height/2,0));O&&M&&t.union(M),t.applyMatrix4(new de().makeRotationZ(E));let r=t.getSize(new p),i=r.x/r.y;i!==J&&(J=i,n.onFramingAspect?.(i)),B.root.updateMatrixWorld(!0),W.setBounds(new _().setFromObject(B.root),m.fov*Math.PI/360,m.aspect,performance.now(),e),me()},me=()=>{m.position.set(W.center.x,W.center.y,W.distance()),m.lookAt(W.center.x,W.center.y,0),m.updateProjectionMatrix()},X=()=>{B.root.quaternion.copy(U.rotation),B.orientation.rotation.z=E},Z=le(()=>{if(!V&&K.width&&K.height)try{(q.width!==K.width||q.height!==K.height||q.pixelRatio!==K.pixelRatio)&&(i.setDrawingBufferSize(K.width,K.height,K.pixelRatio),q=K);let e=performance.now();if(U.advance(e,G())&&(X(),Y(G())),D){let t=Math.min(1,(e-D.startedAt)/F),n=t*t*(3-2*t);E=D.from+(D.to-D.from)*n,t===1&&(D=null),X(),Y(G())}if(N&&`setAngle`in B){let t=Math.min(1,(e-N.startedAt)/I),n=t*t*(3-2*t);B.setAngle(N.from+(N.to-N.from)*n),t===1&&(N=null),Y(G())}W.advance(e,G()),me(),i.render(f,m),(U.needsFrame()||W.needsFrame()||D||N)&&Z.invalidate()}catch{n.onUnavailable()}}),he=(e=w)=>{let t=h(S,n.source.width,n.source.height),r=l!==n.source.width||u!==n.source.height;if(r||e!==w||t.aspect!==C.aspect||t.rawLandscape!==C.rawLandscape||t.rotation!==C.rotation){if(r){let e=s;s=o(),l=n.source.width,u=n.source.height,B.setDisplay(s,t),e.dispose()}let i=P(),a=j(i)&&i!==L;if(a&&(L=i),!O&&`setAngle`in B&&a){let e=z(T??180);f.remove(B.root),B.dispose(),B=R(e,t),f.add(B.root)}else!O&&!(`setAngle`in B)&&(e!==w||t.aspect!==C.aspect)?(f.remove(B.root),B.dispose(),B=b(s,t,e),f.add(B.root)):B.setDisplay(s,t);if(t.rotation!==C.rotation){if(e.id.startsWith(`android`)&&!(`setAngle`in B)&&!G()){let e=Math.atan2(Math.sin(t.rotation-E),Math.cos(t.rotation-E));D={from:E,to:E+e,startedAt:performance.now()}}else D=null,E=`setAngle`in B?0:t.rotation}C=t,w=e,X(),Y(!D)}X()},Q=e({load:y,onError:n.onModelError,install(e){let t=V?null:e?ee(e.asset,s,C):T!==null&&w.id.startsWith(`android`)?R(T):b(s,C,w);N=null,f.remove(B.root),B.dispose(),O=e,t&&(B=t,f.add(B.root),A&&(O?B.orientation.add(A.asset):A.asset.removeFromParent()),X(),Y(!0),Z.invalidate())}}),$=e({load:y,onError:n.onModelError,install(e){let t=e?new _().setFromObject(e.asset):null;if(t&&(t.isEmpty()||![...t.min.toArray(),...t.max.toArray()].every(Number.isFinite)))throw Error(`Device accessory has invalid bounds`);A?.asset.removeFromParent(),A=e,M=t,!V&&(O&&A&&B.orientation.add(A.asset),Y(!0),Z.invalidate())}}),ge=e=>{$.set(e?.modelId===k?.id?e:null)},_e=e=>{e.preventDefault(),n.onUnavailable()};return n.canvas.addEventListener(`webglcontextlost`,_e),X(),Q.set(n.model??null),ge(n.accessory??null),{setModel(e){(e?.id!==k?.id||e?.url!==k?.url)&&$.set(null),k=e,Q.set(e)},setAccessory:ge,setFoldAngle(e){if(V||e===T)return;let t=T;if(T=e,!O){if(e===null||!(`setAngle`in B))f.remove(B.root),B.dispose(),B=e===null?b(s,C,w):R(e),f.add(B.root),D=null,E=e===null?C.rotation:0,N=null,X(),Y(!0);else{let n=z(t??e);G()?(N=null,B.setAngle(e),Y(!0)):N={from:n,to:e,startedAt:performance.now()}}Z.invalidate()}},frameUpdated(){V||(he(),s.needsUpdate=!0,Z.invalidate())},setScreen(e,t=w){V||(S=e,he(t),Z.invalidate())},resize(e,t,n){if(V||![e,t,n].every(Number.isFinite)||e<=0||t<=0)return;let r=Math.min(2,Math.max(1,n));(K.width!==e||K.height!==t||K.pixelRatio!==r)&&(K={width:e,height:t,pixelRatio:r},Y(!0),Z.invalidate())},screenPoint(e,t,n=!1){return V?null:(X(),B.screenPoint(e,t,m,n))},orbit(e,t){V||(U.orbit(e*K.width,t*K.height,performance.now()),Z.invalidate())},setInteractionActive(e,t){if(V)return;let n=performance.now();t===`orbit`?U.dragActive(e,n):(U.hold(e,n),W.hold(e,n)),Z.invalidate()},resetPose(){V||(U.reset(H,performance.now()),Z.invalidate())},dispose(){if(V)return;V=!0,Z.dispose();let e=O!==null;$.dispose(),Q.dispose(),n.canvas.removeEventListener(`webglcontextlost`,_e),f.remove(B.root),e||B.dispose(),s.dispose(),i.dispose(),i.forceContextLoss()}}}export{L as createPhoneViewer};
2
+ //# sourceMappingURL=phoneViewer-CStYy_tX.js.map
@@ -1,4 +1,4 @@
1
- import{At as e}from"./utils-DhUt689t.js";import{c as t}from"./runtime-Ca_Z-vg5.js";var n=`<svg data-icon-sprite aria-hidden="true" width="0" height="0">
1
+ import{At as e}from"./utils-CBe1bHL7.js";import{c as t}from"./runtime-BOlBBevr.js";var n=`<svg data-icon-sprite aria-hidden="true" width="0" height="0">
2
2
  <symbol id="file-tree-icon-chevron" viewBox="0 0 16 16">
3
3
  <path d="M12.4697 5.46973C12.7626 5.17684 13.2374 5.17684 13.5303 5.46973C13.8232 5.76262 13.8232 6.23738 13.5303 6.53028L8.53028 11.5303C8.23738 11.8232 7.76262 11.8232 7.46973 11.5303L2.46973 6.53028C2.17684 6.23738 2.17684 5.76262 2.46973 5.46973C2.76262 5.17684 3.23738 5.17684 3.53028 5.46973L8 9.93946L12.4697 5.46973Z" fill="currentcolor"/>
4
4
  </symbol>
@@ -231,4 +231,4 @@ import{At as e}from"./utils-DhUt689t.js";import{c as t}from"./runtime-Ca_Z-vg5.j
231
231
  <path style="fill: light-dark(#84848a, #adadb1)" d="M.014 0h5.34v2.652H2.888v18.681h2.468V24H.015V0Zm17.622 5.049v2.78h-4.274v12.935h-3.008V7.83H6.059V5.05h11.577ZM23.986 24h-5.34v-2.652h2.467V2.667h-2.468V0h5.34v24Z" />
232
232
  </symbol>
233
233
  </svg>`,Z={set:`complete`,colored:!0,spriteSheet:X,byFileName:{"package.json":`file-tree-builtin-npm`,"tsconfig.json":`file-tree-builtin-typescript`,"agents.md":`p4-file-icon-agents`,"pnpm-lock.yaml":`p4-file-icon-pnpm`,"pnpm-workspace.yaml":`p4-file-icon-pnpm`},byFileExtension:{...Object.fromEntries(e.map(e=>[e,`p4-file-icon-video`])),cs:`p4-file-icon-csharp`,csx:`p4-file-icon-csharp`,dart:`p4-file-icon-dart`,diff:`p4-file-icon-diff`,patch:`p4-file-icon-diff`,ex:`p4-file-icon-elixir`,exs:`p4-file-icon-elixir`,hs:`p4-file-icon-haskell`,lhs:`p4-file-icon-haskell`,java:`p4-file-icon-java`,kt:`p4-file-icon-kotlin`,kts:`p4-file-icon-kotlin`,lua:`p4-file-icon-lua`,php:`p4-file-icon-php`,ps1:`p4-file-icon-powershell`,psm1:`p4-file-icon-powershell`,psd1:`p4-file-icon-powershell`,r:`p4-file-icon-r`,scala:`p4-file-icon-scala`,toml:`p4-file-icon-toml`,xml:`p4-file-icon-xml`}},Q=J(Z),De={bash:`sh`,csharp:`cs`,elixir:`ex`,haskell:`hs`,javascript:`js`,jsx:`jsx`,kotlin:`kt`,markdown:`md`,mdx:`mdx`,plaintext:`txt`,powershell:`ps1`,python:`py`,ruby:`rb`,rust:`rs`,shell:`sh`,shellscript:`sh`,swift:`swift`,typescript:`ts`,tsx:`tsx`,yaml:`yml`};function Oe(e){let t=e.lastIndexOf(`/`);return t===-1?e:e.slice(t+1)}var ke={dockerfile:`Dockerfile`};function Ae(e){let t=e.toLowerCase();return ke[t]??`file.${De[t]??t}`}function $(e,n,r){if(n===`directory`)return null;let i=Q.resolveIcon(`file-tree-icon-file`,e);return i?.token==="default"&&r?Q.resolveIcon(`file-tree-icon-file`,t(e,r)):i}function je(e){return $(e,`file`)?.token!=="default"}function Me(){if(typeof document>`u`||document.getElementById(Y))return;let e=document.createElement(`div`);e.id=Y,e.setAttribute(`aria-hidden`,`true`),e.style.position=`absolute`,e.style.width=`0`,e.style.height=`0`,e.style.overflow=`hidden`,e.style.pointerEvents=`none`,e.innerHTML=`${G(`complete`)}${X}`,document.body.prepend(e)}export{$ as a,K as c,je as i,G as l,Oe as n,Ae as o,Me as r,J as s,Z as t,xe as u};
234
- //# sourceMappingURL=pierre-icons-ChDlOt-h.js.map
234
+ //# sourceMappingURL=pierre-icons-D3vWvKqU.js.map
@@ -1,2 +1,2 @@
1
- import{a as e,t}from"./react-DH3P2YXY.js";import{n,t as r}from"./jsx-runtime-BnjsACtP.js";import{Ya as i,ja as a,ka as o,t as s,wo as c,za as l}from"./utils-DhUt689t.js";import{a as u,c as d,i as f,l as p,n as m,o as h,r as g,s as _,t as v}from"./PopoverHandle-Cj5egwXv.js";var y=e(t()),b=y.forwardRef(function(e,t){let{render:n,className:r,style:i,...o}=e,{store:s}=p(),l=a(o.id);return s.useSyncedValueWithCleanup(`titleElementId`,l),c(`h2`,e,{ref:t,props:[{id:l},o]})}),x=y.forwardRef(function(e,t){let{render:n,className:r,style:a,disabled:s=!1,nativeButton:u=!0,...d}=e,{buttonRef:m,getButtonProps:h}=l({disabled:s,focusableWhenDisabled:!1,native:u}),{store:g}=p();return f(),c(`button`,e,{ref:[t,m],props:[{onClick(e){g.setOpen(!1,o(i,e.nativeEvent))}},d,h]})}),S=n(),C=e(r(),1),w=v,T=d;function E(e){let t=(0,S.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,C.jsx)(_,{className:r,"data-slot":`popover-trigger`,...i,children:n}),t[4]=n,t[5]=r,t[6]=i,t[7]=a):a=t[7],a}var D={auto:``,sm:`w-64`,md:`w-80`,lg:`w-96`},O={default:`py-4 [--viewport-inline-padding:--spacing(4)]`,compact:`py-2 [--viewport-inline-padding:--spacing(3)]`,none:`rounded-[calc(var(--radius-2xl)-1px)] py-0 [--viewport-inline-padding:0px]`};function k(e){let t=(0,S.c)(51),n,r,i,a,o,c,l,d,f,p,_,v,y,b,x;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],o=t[5],c=t[6],l=t[7],d=t[8],f=t[9],p=t[10],_=t[11],v=t[12],y=t[13],b=t[14],x=t[15]):({children:r,className:i,padding:c,scrollbar:d,variant:f,width:p,side:_,align:v,sideOffset:y,alignOffset:b,collisionAvoidance:a,tooltipStyle:x,keepMounted:l,anchor:n,...o}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o,t[6]=c,t[7]=l,t[8]=d,t[9]=f,t[10]=p,t[11]=_,t[12]=v,t[13]=y,t[14]=b,t[15]=x);let w=c===void 0?`default`:c,T=d===void 0?`auto`:d,E=f===void 0?`default`:f,k=p===void 0?`auto`:p,A=_===void 0?`bottom`:_,j=v===void 0?`center`:v,M=y===void 0?4:y,N=b===void 0?0:b,P=x!==void 0&&x,F=l!==void 0&&l,I=F?`div`:m,L=E===`panel`?0:void 0,R=E===`panel`?`z-(--z-sheet) w-[min(calc(var(--thread-details-panel-width)+--spacing(4)),calc(var(--anchor-width)---spacing(2)))] transition-[top] duration-150 ease-out data-instant:transition-[top] motion-reduce:transition-none motion-reduce:data-instant:transition-none`:`z-[130]`,z;t[16]===R?z=t[17]:(z=s(`h-(--positioner-height) w-(--positioner-width) max-w-(--available-width) transition-transform data-instant:transition-none`,R),t[16]=R,t[17]=z);let B=E!==`panel`&&`dropdown-glass`,V=P&&`w-fit text-balance rounded-md text-xs shadow-md/5 before:rounded-[calc(var(--radius-md)-1px)]`,H=!P&&E!==`panel`&&`shadow-[0_16px_40px_-18px_rgb(0_0_0/55%)] dark:shadow-[0_18px_44px_-18px_rgb(0_0_0/80%)]`,U;t[18]!==i||t[19]!==B||t[20]!==V||t[21]!==H||t[22]!==E||t[23]!==k?(U=s(`relative flex h-(--popup-height,auto) w-(--popup-width,auto) origin-(--transform-origin) rounded-2xl text-popover-foreground outline-none transition-[width,height,scale,opacity] motion-reduce:transition-none before:pointer-events-none before:absolute before:inset-0 before:rounded-[calc(var(--radius-2xl)-1px)] before:shadow-[0_1px_--theme(--color-black/4%)] has-data-[slot=calendar]:rounded-xl has-data-[slot=calendar]:before:rounded-[calc(var(--radius-xl)-1px)] data-ending-style:scale-98 data-starting-style:scale-98 data-ending-style:opacity-0 data-starting-style:opacity-0 dark:before:shadow-[0_-1px_--theme(--color-white/6%)]`,B,V,H,k!==`auto`&&[`max-w-[calc(100vw-2rem)]`,D[k]],E===`panel`&&`w-full overflow-visible rounded-none border-0 bg-transparent shadow-none before:hidden [backdrop-filter:none] [-webkit-backdrop-filter:none]`,i),t[18]=i,t[19]=B,t[20]=V,t[21]=H,t[22]=E,t[23]=k,t[24]=U):U=t[24];let W=P&&w==="default"?`py-1 [--viewport-inline-padding:--spacing(2)]`:O[w],G=!P&&`not-data-transitioning:overflow-y-auto`,K=T===`hidden`&&`[scrollbar-width:none] [&::-webkit-scrollbar]:hidden`,q=E===`panel`&&`overflow-visible py-2 [--viewport-inline-padding:--spacing(2)]`,J;t[25]!==W||t[26]!==G||t[27]!==K||t[28]!==q?(J=s(`relative size-full max-h-(--available-height) overflow-clip px-(--viewport-inline-padding) has-data-[slot=calendar]:p-2 data-instant:transition-none **:data-current:data-ending-style:opacity-0 **:data-current:data-starting-style:opacity-0 **:data-previous:data-ending-style:opacity-0 **:data-previous:data-starting-style:opacity-0 **:data-current:w-[calc(var(--popup-width)-2*var(--viewport-inline-padding)-2px)] **:data-previous:w-[calc(var(--popup-width)-2*var(--viewport-inline-padding)-2px)] **:data-current:opacity-100 **:data-previous:opacity-100 **:data-current:transition-opacity **:data-previous:transition-opacity`,W,G,K,q),t[25]=W,t[26]=G,t[27]=K,t[28]=q,t[29]=J):J=t[29];let Y;t[30]!==I||t[31]!==r||t[32]!==J?(Y=(0,C.jsx)(I,{className:J,"data-slot":`popover-viewport`,children:r}),t[30]=I,t[31]=r,t[32]=J,t[33]=Y):Y=t[33];let X;t[34]!==o||t[35]!==U||t[36]!==Y?(X=(0,C.jsx)(g,{className:U,"data-slot":`popover-popup`,...o,children:Y}),t[34]=o,t[35]=U,t[36]=Y,t[37]=X):X=t[37];let Z;t[38]!==j||t[39]!==N||t[40]!==n||t[41]!==a||t[42]!==A||t[43]!==M||t[44]!==L||t[45]!==z||t[46]!==X?(Z=(0,C.jsx)(u,{align:j,alignOffset:N,anchor:n,collisionAvoidance:a,collisionPadding:L,className:z,"data-slot":`popover-positioner`,side:A,sideOffset:M,children:X}),t[38]=j,t[39]=N,t[40]=n,t[41]=a,t[42]=A,t[43]=M,t[44]=L,t[45]=z,t[46]=X,t[47]=Z):Z=t[47];let Q;return t[48]!==F||t[49]!==Z?(Q=(0,C.jsx)(h,{keepMounted:F,children:Z}),t[48]=F,t[49]=Z,t[50]=Q):Q=t[50],Q}function A(e){let t=(0,S.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,C.jsx)(x,{"data-slot":`popover-close`,...n}),t[2]=n,t[3]=r),r}function j(e){let t=(0,S.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(`font-semibold text-sm leading-none`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,C.jsx)(b,{className:i,"data-slot":`popover-title`,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}export{j as a,k as i,A as n,E as o,w as r,T as t};
2
- //# sourceMappingURL=popover-BjUpdrKu.js.map
1
+ import{a as e,t}from"./react-DH3P2YXY.js";import{n,t as r}from"./jsx-runtime-BnjsACtP.js";import{Ya as i,ja as a,ka as o,t as s,wo as c,za as l}from"./utils-CBe1bHL7.js";import{a as u,c as d,i as f,l as p,n as m,o as h,r as g,s as _,t as v}from"./PopoverHandle-CqjlXffy.js";var y=e(t()),b=y.forwardRef(function(e,t){let{render:n,className:r,style:i,...o}=e,{store:s}=p(),l=a(o.id);return s.useSyncedValueWithCleanup(`titleElementId`,l),c(`h2`,e,{ref:t,props:[{id:l},o]})}),x=y.forwardRef(function(e,t){let{render:n,className:r,style:a,disabled:s=!1,nativeButton:u=!0,...d}=e,{buttonRef:m,getButtonProps:h}=l({disabled:s,focusableWhenDisabled:!1,native:u}),{store:g}=p();return f(),c(`button`,e,{ref:[t,m],props:[{onClick(e){g.setOpen(!1,o(i,e.nativeEvent))}},d,h]})}),S=n(),C=e(r(),1),w=v,T=d;function E(e){let t=(0,S.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,C.jsx)(_,{className:r,"data-slot":`popover-trigger`,...i,children:n}),t[4]=n,t[5]=r,t[6]=i,t[7]=a):a=t[7],a}var D={auto:``,sm:`w-64`,md:`w-80`,lg:`w-96`},O={default:`py-4 [--viewport-inline-padding:--spacing(4)]`,compact:`py-2 [--viewport-inline-padding:--spacing(3)]`,none:`rounded-[calc(var(--radius-2xl)-1px)] py-0 [--viewport-inline-padding:0px]`};function k(e){let t=(0,S.c)(51),n,r,i,a,o,c,l,d,f,p,_,v,y,b,x;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],o=t[5],c=t[6],l=t[7],d=t[8],f=t[9],p=t[10],_=t[11],v=t[12],y=t[13],b=t[14],x=t[15]):({children:r,className:i,padding:c,scrollbar:d,variant:f,width:p,side:_,align:v,sideOffset:y,alignOffset:b,collisionAvoidance:a,tooltipStyle:x,keepMounted:l,anchor:n,...o}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o,t[6]=c,t[7]=l,t[8]=d,t[9]=f,t[10]=p,t[11]=_,t[12]=v,t[13]=y,t[14]=b,t[15]=x);let w=c===void 0?`default`:c,T=d===void 0?`auto`:d,E=f===void 0?`default`:f,k=p===void 0?`auto`:p,A=_===void 0?`bottom`:_,j=v===void 0?`center`:v,M=y===void 0?4:y,N=b===void 0?0:b,P=x!==void 0&&x,F=l!==void 0&&l,I=F?`div`:m,L=E===`panel`?0:void 0,R=E===`panel`?`z-(--z-sheet) w-[min(calc(var(--thread-details-panel-width)+--spacing(4)),calc(var(--anchor-width)---spacing(2)))] transition-[top] duration-150 ease-out data-instant:transition-[top] motion-reduce:transition-none motion-reduce:data-instant:transition-none`:`z-[130]`,z;t[16]===R?z=t[17]:(z=s(`h-(--positioner-height) w-(--positioner-width) max-w-(--available-width) transition-transform data-instant:transition-none`,R),t[16]=R,t[17]=z);let B=E!==`panel`&&`dropdown-glass`,V=P&&`w-fit text-balance rounded-md text-xs shadow-md/5 before:rounded-[calc(var(--radius-md)-1px)]`,H=!P&&E!==`panel`&&`shadow-[0_16px_40px_-18px_rgb(0_0_0/55%)] dark:shadow-[0_18px_44px_-18px_rgb(0_0_0/80%)]`,U;t[18]!==i||t[19]!==B||t[20]!==V||t[21]!==H||t[22]!==E||t[23]!==k?(U=s(`relative flex h-(--popup-height,auto) w-(--popup-width,auto) origin-(--transform-origin) rounded-2xl text-popover-foreground outline-none transition-[width,height,scale,opacity] motion-reduce:transition-none before:pointer-events-none before:absolute before:inset-0 before:rounded-[calc(var(--radius-2xl)-1px)] before:shadow-[0_1px_--theme(--color-black/4%)] has-data-[slot=calendar]:rounded-xl has-data-[slot=calendar]:before:rounded-[calc(var(--radius-xl)-1px)] data-ending-style:scale-98 data-starting-style:scale-98 data-ending-style:opacity-0 data-starting-style:opacity-0 dark:before:shadow-[0_-1px_--theme(--color-white/6%)]`,B,V,H,k!==`auto`&&[`max-w-[calc(100vw-2rem)]`,D[k]],E===`panel`&&`w-full overflow-visible rounded-none border-0 bg-transparent shadow-none before:hidden [backdrop-filter:none] [-webkit-backdrop-filter:none]`,i),t[18]=i,t[19]=B,t[20]=V,t[21]=H,t[22]=E,t[23]=k,t[24]=U):U=t[24];let W=P&&w==="default"?`py-1 [--viewport-inline-padding:--spacing(2)]`:O[w],G=!P&&`not-data-transitioning:overflow-y-auto`,K=T===`hidden`&&`[scrollbar-width:none] [&::-webkit-scrollbar]:hidden`,q=E===`panel`&&`overflow-visible py-2 [--viewport-inline-padding:--spacing(2)]`,J;t[25]!==W||t[26]!==G||t[27]!==K||t[28]!==q?(J=s(`relative size-full max-h-(--available-height) overflow-clip px-(--viewport-inline-padding) has-data-[slot=calendar]:p-2 data-instant:transition-none **:data-current:data-ending-style:opacity-0 **:data-current:data-starting-style:opacity-0 **:data-previous:data-ending-style:opacity-0 **:data-previous:data-starting-style:opacity-0 **:data-current:w-[calc(var(--popup-width)-2*var(--viewport-inline-padding)-2px)] **:data-previous:w-[calc(var(--popup-width)-2*var(--viewport-inline-padding)-2px)] **:data-current:opacity-100 **:data-previous:opacity-100 **:data-current:transition-opacity **:data-previous:transition-opacity`,W,G,K,q),t[25]=W,t[26]=G,t[27]=K,t[28]=q,t[29]=J):J=t[29];let Y;t[30]!==I||t[31]!==r||t[32]!==J?(Y=(0,C.jsx)(I,{className:J,"data-slot":`popover-viewport`,children:r}),t[30]=I,t[31]=r,t[32]=J,t[33]=Y):Y=t[33];let X;t[34]!==o||t[35]!==U||t[36]!==Y?(X=(0,C.jsx)(g,{className:U,"data-slot":`popover-popup`,...o,children:Y}),t[34]=o,t[35]=U,t[36]=Y,t[37]=X):X=t[37];let Z;t[38]!==j||t[39]!==N||t[40]!==n||t[41]!==a||t[42]!==A||t[43]!==M||t[44]!==L||t[45]!==z||t[46]!==X?(Z=(0,C.jsx)(u,{align:j,alignOffset:N,anchor:n,collisionAvoidance:a,collisionPadding:L,className:z,"data-slot":`popover-positioner`,side:A,sideOffset:M,children:X}),t[38]=j,t[39]=N,t[40]=n,t[41]=a,t[42]=A,t[43]=M,t[44]=L,t[45]=z,t[46]=X,t[47]=Z):Z=t[47];let Q;return t[48]!==F||t[49]!==Z?(Q=(0,C.jsx)(h,{keepMounted:F,children:Z}),t[48]=F,t[49]=Z,t[50]=Q):Q=t[50],Q}function A(e){let t=(0,S.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,C.jsx)(x,{"data-slot":`popover-close`,...n}),t[2]=n,t[3]=r),r}function j(e){let t=(0,S.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(`font-semibold text-sm leading-none`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,C.jsx)(b,{className:i,"data-slot":`popover-title`,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}export{j as a,k as i,A as n,E as o,w as r,T as t};
2
+ //# sourceMappingURL=popover-CogH2zM4.js.map
@@ -1,2 +1,2 @@
1
- import{Eb as e,Gy as t,Nb as n,Xy as r,cb as i,ib as a,tb as o}from"./utils-DhUt689t.js";var s=new Set([`localhost`,`127.0.0.1`,`0.0.0.0`,`::1`]);[...s];var c=/^(?:localhost|127\.0\.0\.1|0\.0\.0\.0|\[::1?\])(?::|\/|$)/i;function l(e){return!!(s.has(e)||e===`[::1]`)}var u=class extends i()(`PreviewUrlNormalizationError`,{inputLength:o,reason:r([`empty`,`parse`,`unsupported-protocol`]),protocol:n(a),cause:n(t())}){get message(){let e=this.protocol===void 0?``:`: ${this.protocol}`;return`Invalid preview URL (${this.reason}${e}; input length ${this.inputLength}).`}};e(u);function d(e){return/^([A-Za-z][A-Za-z\d+.-]*):/.exec(e)?.[1]?.toLowerCase().concat(`:`)}var f=/^(?:localhost|\d{1,3}(?:\.\d{1,3}){3}|\[[\da-f:.]+\])$/i,p=/^[^/?#:@]+:\d+(?:[/?#]|$)/,m=new Set([`about:`,`blob:`,`chrome:`,`data:`,`file:`,`ftp:`,`javascript:`,`mailto:`,`sms:`,`ssh:`,`tel:`,`view-source:`,`ws:`,`wss:`]),h={duckduckgo:`https://duckduckgo.com/?q=%s`,google:`https://www.google.com/search?q=%s`,bing:`https://www.bing.com/search?q=%s`,brave:`https://search.brave.com/search?q=%s`,kagi:`https://kagi.com/search?q=%s`,ecosia:`https://www.ecosia.org/search?q=%s`};function g(e,t){return e.replaceAll(`%s`,encodeURIComponent(t))}function _(e){if(!e.includes(`%s`))return!1;try{let t=e=>`${e.username}:${e.password}@${e.host}`,n=new URL(g(e,`a`)),r=new URL(g(e,`b`));return(n.protocol===`http:`||n.protocol===`https:`)&&t(n)===t(r)}catch{return!1}}function v(e){if(e.browserSearchEngine!==`custom`)return h[e.browserSearchEngine];let t=e.browserCustomSearchUrl.trim();return _(t)?t:h.duckduckgo}function y(e,t=h.duckduckgo){let n=e.trim();if(/^[a-z][a-z\d+.-]*:\/\//i.test(n)||n.length===0)return b(n);if(!/\s/.test(n)){let t=d(n);if(t!==void 0&&(m.has(t)||!p.test(n))){if(t!==`http:`&&t!==`https:`)throw new u({inputLength:e.length,reason:`unsupported-protocol`,protocol:t});return b(n)}let r=n.split(/[/?#]/,1)[0]??``,i=r.replace(/^[^@]*@/,``).replace(/:\d+$/,``);if(i.length<r.replace(/^[^@]*@/,``).length||f.test(i)||/^[^.]+(?:\.[^.]+)+\.?$/.test(i))try{return b(n)}catch{}}return g(t,n)}function b(e){let t=e.trim();if(t.length===0)throw new u({inputLength:e.length,reason:`empty`});let n=c.test(t),r=t.includes(`://`)?t:`${n?`http`:`https`}://${t}`,i;try{i=new URL(r)}catch(t){throw new u({inputLength:e.length,reason:`parse`,protocol:d(r),cause:t})}if(i.protocol!==`http:`&&i.protocol!==`https:`)throw new u({inputLength:e.length,reason:`unsupported-protocol`,protocol:i.protocol});return i.href}export{v as a,y as i,_ as n,b as r,l as t};
2
- //# sourceMappingURL=preview-DHLYKEKb.js.map
1
+ import{Eb as e,Gy as t,Nb as n,Xy as r,cb as i,ib as a,tb as o}from"./utils-CBe1bHL7.js";var s=new Set([`localhost`,`127.0.0.1`,`0.0.0.0`,`::1`]);[...s];var c=/^(?:localhost|127\.0\.0\.1|0\.0\.0\.0|\[::1?\])(?::|\/|$)/i;function l(e){return!!(s.has(e)||e===`[::1]`)}var u=class extends i()(`PreviewUrlNormalizationError`,{inputLength:o,reason:r([`empty`,`parse`,`unsupported-protocol`]),protocol:n(a),cause:n(t())}){get message(){let e=this.protocol===void 0?``:`: ${this.protocol}`;return`Invalid preview URL (${this.reason}${e}; input length ${this.inputLength}).`}};e(u);function d(e){return/^([A-Za-z][A-Za-z\d+.-]*):/.exec(e)?.[1]?.toLowerCase().concat(`:`)}var f=/^(?:localhost|\d{1,3}(?:\.\d{1,3}){3}|\[[\da-f:.]+\])$/i,p=/^[^/?#:@]+:\d+(?:[/?#]|$)/,m=new Set([`about:`,`blob:`,`chrome:`,`data:`,`file:`,`ftp:`,`javascript:`,`mailto:`,`sms:`,`ssh:`,`tel:`,`view-source:`,`ws:`,`wss:`]),h={duckduckgo:`https://duckduckgo.com/?q=%s`,google:`https://www.google.com/search?q=%s`,bing:`https://www.bing.com/search?q=%s`,brave:`https://search.brave.com/search?q=%s`,kagi:`https://kagi.com/search?q=%s`,ecosia:`https://www.ecosia.org/search?q=%s`};function g(e,t){return e.replaceAll(`%s`,encodeURIComponent(t))}function _(e){if(!e.includes(`%s`))return!1;try{let t=e=>`${e.username}:${e.password}@${e.host}`,n=new URL(g(e,`a`)),r=new URL(g(e,`b`));return(n.protocol===`http:`||n.protocol===`https:`)&&t(n)===t(r)}catch{return!1}}function v(e){if(e.browserSearchEngine!==`custom`)return h[e.browserSearchEngine];let t=e.browserCustomSearchUrl.trim();return _(t)?t:h.duckduckgo}function y(e,t=h.duckduckgo){let n=e.trim();if(/^[a-z][a-z\d+.-]*:\/\//i.test(n)||n.length===0)return b(n);if(!/\s/.test(n)){let t=d(n);if(t!==void 0&&(m.has(t)||!p.test(n))){if(t!==`http:`&&t!==`https:`)throw new u({inputLength:e.length,reason:`unsupported-protocol`,protocol:t});return b(n)}let r=n.split(/[/?#]/,1)[0]??``,i=r.replace(/^[^@]*@/,``).replace(/:\d+$/,``);if(i.length<r.replace(/^[^@]*@/,``).length||f.test(i)||/^[^.]+(?:\.[^.]+)+\.?$/.test(i))try{return b(n)}catch{}}return g(t,n)}function b(e){let t=e.trim();if(t.length===0)throw new u({inputLength:e.length,reason:`empty`});let n=c.test(t),r=t.includes(`://`)?t:`${n?`http`:`https`}://${t}`,i;try{i=new URL(r)}catch(t){throw new u({inputLength:e.length,reason:`parse`,protocol:d(r),cause:t})}if(i.protocol!==`http:`&&i.protocol!==`https:`)throw new u({inputLength:e.length,reason:`unsupported-protocol`,protocol:i.protocol});return i.href}export{v as a,y as i,_ as n,b as r,l as t};
2
+ //# sourceMappingURL=preview-O1ZL8Awg.js.map
@@ -1,2 +1,2 @@
1
- import{Uc as e}from"./utils-DhUt689t.js";import{M as t,N as n,P as r,k as i}from"./runtime-OeWFs5Hf.js";import{t as a}from"./runtime-Ca_Z-vg5.js";function o(a){let o=i(),s=i(),c={mode:`serial`,key:({environmentId:e,input:t})=>JSON.stringify([e,t.threadId])};return{list:n(a,{label:`environment-data:preview:list`,tag:e.previewList,staleTimeMs:5e3}),events:r(a,{label:`environment-data:preview:events`,tag:e.subscribePreviewEvents}),discoveredServers:r(a,{label:`environment-data:preview:discovered-servers`,tag:e.subscribeDiscoveredLocalServers,idleTtlMs:0}),open:t(a,{label:`environment-data:preview:open`,tag:e.previewOpen,scheduler:o,concurrency:c}),navigate:t(a,{label:`environment-data:preview:navigate`,tag:e.previewNavigate,scheduler:o,concurrency:c}),resize:t(a,{label:`environment-data:preview:resize`,tag:e.previewResize,scheduler:o,concurrency:c}),adjust:t(a,{label:`environment-data:preview:adjust`,tag:e.previewAdjust,scheduler:o,concurrency:c}),refresh:t(a,{label:`environment-data:preview:refresh`,tag:e.previewRefresh,scheduler:o,concurrency:c}),close:t(a,{label:`environment-data:preview:close`,tag:e.previewClose,scheduler:o,concurrency:c}),clearProfile:t(a,{label:`environment-data:preview:clear-profile`,tag:e.previewClearProfile}),reportProfiles:t(a,{label:`environment-data:preview:report-profiles`,tag:e.previewReportProfiles,concurrency:{mode:`latest`,key:({environmentId:e})=>e}}),reportStatus:t(a,{label:`environment-data:preview:report-status`,tag:e.previewReportStatus,scheduler:s,concurrency:{mode:`latest`,key:({environmentId:e,input:t})=>JSON.stringify([e,t.threadId,t.tabId])}})}}var s=o(a);export{s as t};
2
- //# sourceMappingURL=preview-3EscFepc.js.map
1
+ import{Uc as e}from"./utils-CBe1bHL7.js";import{M as t,N as n,P as r,k as i}from"./runtime-CeFhsGnm.js";import{t as a}from"./runtime-BOlBBevr.js";function o(a){let o=i(),s=i(),c={mode:`serial`,key:({environmentId:e,input:t})=>JSON.stringify([e,t.threadId])};return{list:n(a,{label:`environment-data:preview:list`,tag:e.previewList,staleTimeMs:5e3}),events:r(a,{label:`environment-data:preview:events`,tag:e.subscribePreviewEvents}),discoveredServers:r(a,{label:`environment-data:preview:discovered-servers`,tag:e.subscribeDiscoveredLocalServers,idleTtlMs:0}),open:t(a,{label:`environment-data:preview:open`,tag:e.previewOpen,scheduler:o,concurrency:c}),navigate:t(a,{label:`environment-data:preview:navigate`,tag:e.previewNavigate,scheduler:o,concurrency:c}),resize:t(a,{label:`environment-data:preview:resize`,tag:e.previewResize,scheduler:o,concurrency:c}),adjust:t(a,{label:`environment-data:preview:adjust`,tag:e.previewAdjust,scheduler:o,concurrency:c}),refresh:t(a,{label:`environment-data:preview:refresh`,tag:e.previewRefresh,scheduler:o,concurrency:c}),close:t(a,{label:`environment-data:preview:close`,tag:e.previewClose,scheduler:o,concurrency:c}),clearProfile:t(a,{label:`environment-data:preview:clear-profile`,tag:e.previewClearProfile}),reportProfiles:t(a,{label:`environment-data:preview:report-profiles`,tag:e.previewReportProfiles,concurrency:{mode:`latest`,key:({environmentId:e})=>e}}),reportStatus:t(a,{label:`environment-data:preview:report-status`,tag:e.previewReportStatus,scheduler:s,concurrency:{mode:`latest`,key:({environmentId:e,input:t})=>JSON.stringify([e,t.threadId,t.tabId])}})}}var s=o(a);export{s as t};
2
+ //# sourceMappingURL=preview-ipLyyv_l.js.map
@@ -1,2 +1,2 @@
1
- import{W as e,ec as t}from"./utils-DhUt689t.js";var n=(e,t)=>{let n=Object.entries(t.query);return n.length===0?e:`${e}${e.includes(`?`)?`&`:`?`}${new URLSearchParams(n).toString()}`};function r(e){return e.kind===`browser`?`browser:${e.tabId}`:`device:${encodeURIComponent(e.hostId)}:${encodeURIComponent(e.deviceId)}`}var i=e=>({kind:`browser`,tabId:e}),a=e()(e=>({byThreadKey:{},open:(n,i)=>e(e=>{let a=t(n),o=e.byThreadKey[a];return o&&r(o.source)===r(i)?e:{byThreadKey:{...e.byThreadKey,[a]:{source:i,position:o?.position??null,width:o?.width??null,lastInteraction:o?.lastInteraction??`drag`}}}}),close:n=>e(e=>{let r=t(n);if(!(r in e.byThreadKey))return e;let{[r]:i,...a}=e.byThreadKey;return{byThreadKey:a}}),move:(n,i,a)=>e(e=>{let o=t(n),s=e.byThreadKey[o];return!s||r(s.source)!==i||s.position?.x===a.x&&s.position.y===a.y&&s.lastInteraction===`drag`?e:{byThreadKey:{...e.byThreadKey,[o]:{...s,position:a,lastInteraction:`drag`}}}}),resize:(n,i,a,o)=>e(e=>{let s=t(n),c=e.byThreadKey[s];return!c||r(c.source)!==i||c.width===a&&c.lastInteraction===`resize`&&(!o||c.position?.x===o.x&&c.position.y===o.y)?e:{byThreadKey:{...e.byThreadKey,[s]:{...c,width:a,position:o??c.position,lastInteraction:`resize`}}}}),removeThread:n=>e(e=>{let r=t(n);if(!(r in e.byThreadKey))return e;let{[r]:i,...a}=e.byThreadKey;return{byThreadKey:a}})}));function o(e,n){return n?e[t(n)]??null:null}export{n as a,a as i,r as n,o as r,i as t};
2
- //# sourceMappingURL=previewMiniPlayerStore-DHjQeV1U.js.map
1
+ import{W as e,ec as t}from"./utils-CBe1bHL7.js";var n=(e,t)=>{let n=Object.entries(t.query);return n.length===0?e:`${e}${e.includes(`?`)?`&`:`?`}${new URLSearchParams(n).toString()}`};function r(e){return e.kind===`browser`?`browser:${e.tabId}`:`device:${encodeURIComponent(e.hostId)}:${encodeURIComponent(e.deviceId)}`}var i=e=>({kind:`browser`,tabId:e}),a=e()(e=>({byThreadKey:{},open:(n,i)=>e(e=>{let a=t(n),o=e.byThreadKey[a];return o&&r(o.source)===r(i)?e:{byThreadKey:{...e.byThreadKey,[a]:{source:i,position:o?.position??null,width:o?.width??null,lastInteraction:o?.lastInteraction??`drag`}}}}),close:n=>e(e=>{let r=t(n);if(!(r in e.byThreadKey))return e;let{[r]:i,...a}=e.byThreadKey;return{byThreadKey:a}}),move:(n,i,a)=>e(e=>{let o=t(n),s=e.byThreadKey[o];return!s||r(s.source)!==i||s.position?.x===a.x&&s.position.y===a.y&&s.lastInteraction===`drag`?e:{byThreadKey:{...e.byThreadKey,[o]:{...s,position:a,lastInteraction:`drag`}}}}),resize:(n,i,a,o)=>e(e=>{let s=t(n),c=e.byThreadKey[s];return!c||r(c.source)!==i||c.width===a&&c.lastInteraction===`resize`&&(!o||c.position?.x===o.x&&c.position.y===o.y)?e:{byThreadKey:{...e.byThreadKey,[s]:{...c,width:a,position:o??c.position,lastInteraction:`resize`}}}}),removeThread:n=>e(e=>{let r=t(n);if(!(r in e.byThreadKey))return e;let{[r]:i,...a}=e.byThreadKey;return{byThreadKey:a}})}));function o(e,n){return n?e[t(n)]??null:null}export{n as a,a as i,r as n,o as r,i as t};
2
+ //# sourceMappingURL=previewMiniPlayerStore-C5z1mN8S.js.map
@@ -1,2 +1,2 @@
1
- import{n as e}from"./jsx-runtime-BnjsACtP.js";import{Eb as t,Eg as n,Gy as r,Il as i,Nb as a,Os as o,PS as s,Qw as c,Vl as l,Xx as u,Xy as d,Zo as f,as as p,cb as m,ib as h,lC as g,ls as _,ps as ee,sC as v,tE as y,tb as b,ts as x,us as S}from"./utils-DhUt689t.js";import{b as C,n as w,w as T}from"./runtime-OeWFs5Hf.js";import{Nt as E,jt as te}from"./runtime-Ca_Z-vg5.js";var ne=d([`fetch-session-state`,`exchange-bootstrap-credential`,`fetch-environment-descriptor`,`create-pairing-credential`,`list-pairing-links`,`revoke-pairing-link`,`list-client-sessions`,`revoke-client-session`,`revoke-other-client-sessions`]),D=class e extends m()(`PrimaryEnvironmentRequestError`,{operation:ne,status:b,pairingLinkId:a(h),sessionId:a(h),cause:r()}){static fromCause(t){let n=U(t.cause)??500;return new e({operation:t.operation,status:n,...t.pairingLinkId===void 0?{}:{pairingLinkId:t.pairingLinkId},...t.sessionId===void 0?{}:{sessionId:t.sessionId},cause:t.cause})}get message(){return`Primary environment request failed during ${this.operation} (HTTP ${this.status}).`}},O=t(D),k=class extends m()(`PrimaryEnvironmentPairingCredentialRejectedError`,{providedLength:b,cause:r()}){get message(){return`Invalid pairing token. Check the token and try again.`}};t(k);var A=class extends m()(`PrimaryEnvironmentAuthSessionTimeoutError`,{timeoutMs:b,elapsedMs:b}){get message(){return`Timed out waiting for authenticated session after bootstrap.`}},j=class extends m()(`PrimaryEnvironmentPairingCredentialRequiredError`,{providedLength:b}){get message(){return`Enter a pairing token to continue.`}},M=t(l),N=null,P=null,F=!1,I=2e3,L=100;function R(){return te(new URL(window.location.href))}function z(){let e=new URL(window.location.href),t=E(e);t.toString()!==e.toString()&&window.history.replaceState({},document.title,t.toString())}function B(){let e=R();return e?(z(),e):null}function V(){let e=(window.desktopBridge?.getLocalEnvironmentBootstraps()??[]).find(e=>e.id===i);return typeof e?.bootstrapToken==`string`&&e.bootstrapToken.length>0?e.bootstrapToken:null}async function H(){return X(async()=>{try{return await w(C.pipe(u(e=>e.auth.session({headers:{}}))))}catch(e){throw D.fromCause({operation:`fetch-session-state`,cause:e})}})}function U(e){return M(e)?W(e):n(e)&&e.response!==void 0?e.response.status:null}function W(e){switch(e._tag){case`EnvironmentRequestInvalidError`:return 400;case`EnvironmentAuthInvalidError`:return 401;case`EnvironmentScopeRequiredError`:case`EnvironmentOperationForbiddenError`:return 403;case`EnvironmentResourceNotFoundError`:return 404;case`EnvironmentInternalError`:return 500}}async function G(e){return X(async()=>{try{return await w(C.pipe(u(t=>t.auth.browserSession({payload:{credential:e}}))))}catch(t){throw M(t)&&t._tag===`EnvironmentAuthInvalidError`&&t.reason===`invalid_credential`?new k({providedLength:e.length,cause:t}):D.fromCause({operation:`exchange-bootstrap-credential`,cause:t})}})}async function K(){let e=Date.now();for(;;){let t=await H();if(t.authenticated)return t;let n=Date.now()-e;if(n>=I)throw new A({timeoutMs:I,elapsedMs:n});await Z(L)}}var q=new Set([502,503,504]),J=15e3,Y=500;async function X(e){let t=Date.now();for(;;)try{return await e()}catch(e){if(!re(e)||Date.now()-t>=J)throw e;await Z(Y)}}function Z(e){return new Promise(t=>{setTimeout(t,e)})}function re(e){return O(e)?q.has(e.status):e instanceof TypeError||e instanceof DOMException&&e.name===`AbortError`}async function Q(e){let t=await H();if(t.authenticated&&!e)return{status:`authenticated`};let n=e??V();if(!n)return{status:`requires-auth`,auth:t.auth};try{return await G(n),await K(),{status:`authenticated`}}catch(e){return{status:`requires-auth`,auth:t.auth,errorMessage:e instanceof Error?e.message:`Authentication failed.`}}}async function ie(e){let t=e.trim();if(!t)throw new j({providedLength:e.length});P=null,await G(t),await K(),P={status:`authenticated`},N=null,F=!1,z()}async function ae(e){let t=e?.label?.trim();try{return await w(C.pipe(u(n=>n.auth.pairingCredential({headers:{},payload:{...t?{label:t}:{},...e?.scopes?{scopes:e.scopes}:{}}}))))}catch(e){throw D.fromCause({operation:`create-pairing-credential`,cause:e})}}async function oe(e){try{await w(C.pipe(u(t=>t.auth.revokePairingLink({headers:{},payload:{id:e}}))))}catch(t){throw D.fromCause({operation:`revoke-pairing-link`,pairingLinkId:e,cause:t})}}async function se(e){try{await w(C.pipe(u(t=>t.auth.revokeClient({headers:{},payload:{sessionId:e}}))))}catch(t){throw D.fromCause({operation:`revoke-client-session`,sessionId:e,cause:t})}}async function ce(){try{return(await w(C.pipe(u(e=>e.auth.revokeOtherClients({headers:{}}))))).revokedCount}catch(e){throw D.fromCause({operation:`revoke-other-client-sessions`,cause:e})}}async function le(){if(window.location.pathname.replace(/\/+$/,``)===`/pair`?R()&&(F=!0):F=!1,F)return{status:`requires-auth`,auth:(await H()).auth};let e=B(),t=N;if(e)P=null;else{if(t)return t;if(P?.status===`authenticated`)return P}let n=t?t.catch(()=>void 0).then(()=>(P=null,Q(e))):Q(e);return N=n,n.then(e=>(N===n&&e.status===`authenticated`&&(P=e),e)).finally(()=>{N===n&&(N=null)})}var ue=e(),$=p(g(()=>T()?v(null):s(H))).pipe(S({staleTime:5e3,revalidateOnMount:!0}),_(3e5),ee(`primary-environment:session`));function de(){f.refresh($)}function fe(){let e=(0,ue.c)(8),t=x($),n=pe,r=null;if(t._tag===`Failure`){let n;e[0]===t.cause?n=e[1]:(n=c(t.cause),e[0]=t.cause,e[1]=n);let i=n;r=i instanceof Error?i.message:`Could not read environment session.`}let i;e[2]===t?i=e[3]:(i=y(o(t)),e[2]=t,e[3]=i);let a;return e[4]!==r||e[5]!==t.waiting||e[6]!==i?(a={data:i,error:r,isPending:t.waiting,refresh:n},e[4]=r,e[5]=t.waiting,e[6]=i,e[7]=a):a=e[7],a}function pe(){de()}export{ce as a,z as c,le as i,ie as l,ae as n,se as o,R as r,oe as s,fe as t};
2
- //# sourceMappingURL=primary-NcsmRI6j.js.map
1
+ import{n as e}from"./jsx-runtime-BnjsACtP.js";import{Eb as t,Eg as n,Gy as r,Il as i,Nb as a,Os as o,PS as s,Qw as c,Vl as l,Xx as u,Xy as d,Zo as f,as as p,cb as m,ib as h,lC as g,ls as _,ps as ee,sC as v,tE as y,tb as b,ts as x,us as S}from"./utils-CBe1bHL7.js";import{b as C,n as w,w as T}from"./runtime-CeFhsGnm.js";import{Nt as E,jt as te}from"./runtime-BOlBBevr.js";var ne=d([`fetch-session-state`,`exchange-bootstrap-credential`,`fetch-environment-descriptor`,`create-pairing-credential`,`list-pairing-links`,`revoke-pairing-link`,`list-client-sessions`,`revoke-client-session`,`revoke-other-client-sessions`]),D=class e extends m()(`PrimaryEnvironmentRequestError`,{operation:ne,status:b,pairingLinkId:a(h),sessionId:a(h),cause:r()}){static fromCause(t){let n=U(t.cause)??500;return new e({operation:t.operation,status:n,...t.pairingLinkId===void 0?{}:{pairingLinkId:t.pairingLinkId},...t.sessionId===void 0?{}:{sessionId:t.sessionId},cause:t.cause})}get message(){return`Primary environment request failed during ${this.operation} (HTTP ${this.status}).`}},O=t(D),k=class extends m()(`PrimaryEnvironmentPairingCredentialRejectedError`,{providedLength:b,cause:r()}){get message(){return`Invalid pairing token. Check the token and try again.`}};t(k);var A=class extends m()(`PrimaryEnvironmentAuthSessionTimeoutError`,{timeoutMs:b,elapsedMs:b}){get message(){return`Timed out waiting for authenticated session after bootstrap.`}},j=class extends m()(`PrimaryEnvironmentPairingCredentialRequiredError`,{providedLength:b}){get message(){return`Enter a pairing token to continue.`}},M=t(l),N=null,P=null,F=!1,I=2e3,L=100;function R(){return te(new URL(window.location.href))}function z(){let e=new URL(window.location.href),t=E(e);t.toString()!==e.toString()&&window.history.replaceState({},document.title,t.toString())}function B(){let e=R();return e?(z(),e):null}function V(){let e=(window.desktopBridge?.getLocalEnvironmentBootstraps()??[]).find(e=>e.id===i);return typeof e?.bootstrapToken==`string`&&e.bootstrapToken.length>0?e.bootstrapToken:null}async function H(){return X(async()=>{try{return await w(C.pipe(u(e=>e.auth.session({headers:{}}))))}catch(e){throw D.fromCause({operation:`fetch-session-state`,cause:e})}})}function U(e){return M(e)?W(e):n(e)&&e.response!==void 0?e.response.status:null}function W(e){switch(e._tag){case`EnvironmentRequestInvalidError`:return 400;case`EnvironmentAuthInvalidError`:return 401;case`EnvironmentScopeRequiredError`:case`EnvironmentOperationForbiddenError`:return 403;case`EnvironmentResourceNotFoundError`:return 404;case`EnvironmentInternalError`:return 500}}async function G(e){return X(async()=>{try{return await w(C.pipe(u(t=>t.auth.browserSession({payload:{credential:e}}))))}catch(t){throw M(t)&&t._tag===`EnvironmentAuthInvalidError`&&t.reason===`invalid_credential`?new k({providedLength:e.length,cause:t}):D.fromCause({operation:`exchange-bootstrap-credential`,cause:t})}})}async function K(){let e=Date.now();for(;;){let t=await H();if(t.authenticated)return t;let n=Date.now()-e;if(n>=I)throw new A({timeoutMs:I,elapsedMs:n});await Z(L)}}var q=new Set([502,503,504]),J=15e3,Y=500;async function X(e){let t=Date.now();for(;;)try{return await e()}catch(e){if(!re(e)||Date.now()-t>=J)throw e;await Z(Y)}}function Z(e){return new Promise(t=>{setTimeout(t,e)})}function re(e){return O(e)?q.has(e.status):e instanceof TypeError||e instanceof DOMException&&e.name===`AbortError`}async function Q(e){let t=await H();if(t.authenticated&&!e)return{status:`authenticated`};let n=e??V();if(!n)return{status:`requires-auth`,auth:t.auth};try{return await G(n),await K(),{status:`authenticated`}}catch(e){return{status:`requires-auth`,auth:t.auth,errorMessage:e instanceof Error?e.message:`Authentication failed.`}}}async function ie(e){let t=e.trim();if(!t)throw new j({providedLength:e.length});P=null,await G(t),await K(),P={status:`authenticated`},N=null,F=!1,z()}async function ae(e){let t=e?.label?.trim();try{return await w(C.pipe(u(n=>n.auth.pairingCredential({headers:{},payload:{...t?{label:t}:{},...e?.scopes?{scopes:e.scopes}:{}}}))))}catch(e){throw D.fromCause({operation:`create-pairing-credential`,cause:e})}}async function oe(e){try{await w(C.pipe(u(t=>t.auth.revokePairingLink({headers:{},payload:{id:e}}))))}catch(t){throw D.fromCause({operation:`revoke-pairing-link`,pairingLinkId:e,cause:t})}}async function se(e){try{await w(C.pipe(u(t=>t.auth.revokeClient({headers:{},payload:{sessionId:e}}))))}catch(t){throw D.fromCause({operation:`revoke-client-session`,sessionId:e,cause:t})}}async function ce(){try{return(await w(C.pipe(u(e=>e.auth.revokeOtherClients({headers:{}}))))).revokedCount}catch(e){throw D.fromCause({operation:`revoke-other-client-sessions`,cause:e})}}async function le(){if(window.location.pathname.replace(/\/+$/,``)===`/pair`?R()&&(F=!0):F=!1,F)return{status:`requires-auth`,auth:(await H()).auth};let e=B(),t=N;if(e)P=null;else{if(t)return t;if(P?.status===`authenticated`)return P}let n=t?t.catch(()=>void 0).then(()=>(P=null,Q(e))):Q(e);return N=n,n.then(e=>(N===n&&e.status===`authenticated`&&(P=e),e)).finally(()=>{N===n&&(N=null)})}var ue=e(),$=p(g(()=>T()?v(null):s(H))).pipe(S({staleTime:5e3,revalidateOnMount:!0}),_(3e5),ee(`primary-environment:session`));function de(){f.refresh($)}function fe(){let e=(0,ue.c)(8),t=x($),n=pe,r=null;if(t._tag===`Failure`){let n;e[0]===t.cause?n=e[1]:(n=c(t.cause),e[0]=t.cause,e[1]=n);let i=n;r=i instanceof Error?i.message:`Could not read environment session.`}let i;e[2]===t?i=e[3]:(i=y(o(t)),e[2]=t,e[3]=i);let a;return e[4]!==r||e[5]!==t.waiting||e[6]!==i?(a={data:i,error:r,isPending:t.waiting,refresh:n},e[4]=r,e[5]=t.waiting,e[6]=i,e[7]=a):a=e[7],a}function pe(){de()}export{ce as a,z as c,le as i,ie as l,ae as n,se as o,R as r,oe as s,fe as t};
2
+ //# sourceMappingURL=primary-CMBPxKMH.js.map
@@ -1,2 +1,2 @@
1
- import{n as e}from"./jsx-runtime-BnjsACtP.js";import{Bl as t,Bv as n,CC as r,CS as i,Ds as a,Eb as o,FS as s,Fx as c,Gl as l,Hl as u,Kv as d,Ll as ee,My as f,Nb as te,OT as ne,Os as re,Qw as ie,Uc as p,Ul as m,Ux as h,Wl as g,Xy as ae,YC as oe,Z_ as se,Zo as _,_C as ce,as as le,cb as ue,cs as de,fb as fe,iE as pe,ib as v,is as me,ju as y,lS as b,lT as he,ls as ge,oc as x,ps as S,rs as C,tE as w,ts as T,uC as E,us as D,xS as O,yS as k,zl as A}from"./utils-DhUt689t.js";import{$ as j,Nn as M,Z as N,dt as P,mn as F,o as I,r as L,s as _e,v as R}from"./runtime-OeWFs5Hf.js";import"./runtime-Ca_Z-vg5.js";import{D as ve}from"./useSettings-gPlpTIWi.js";import{i as ye,n as z}from"./session-BxUdP61p.js";var be=e(),xe=class extends ue()(`RelayClientInstallConfirmationConflictError`,{requestedVersion:v,activeVersion:v,activeDialogStatus:ae([`confirming`,`installing`,`closing`]),activeInstallStage:te(ee)}){get message(){return`Cannot confirm relay client installation ${this.requestedVersion}; installation ${this.activeVersion} has dialog status ${this.activeDialogStatus}.`}},B={status:`idle`},V=B,H=null,U=new Set;function W(e){V=e;for(let e of U)e()}function Se(){return V}function Ce(e){return U.add(e),()=>{U.delete(e)}}function we(e){if(V.status!==`idle`){let t=V.status===`closing`?V.view:V;return Promise.reject(new xe({requestedVersion:e,activeVersion:t.version,activeDialogStatus:V.status,...t.status===`installing`?{activeInstallStage:t.stage}:{}}))}return W({status:`confirming`,version:e}),new Promise(e=>{H=e})}function Te(e){if(V.status!==`confirming`||!H)return;let t=H;H=null,W(e?{status:`installing`,version:V.version,stage:`checking`}:{status:`closing`,view:V}),t(e)}function Ee(e){V.status===`installing`&&e.type===`progress`&&W({...V,stage:e.stage})}function De(){H?.(!1),H=null,(V.status===`confirming`||V.status===`installing`)&&W({status:`closing`,view:V})}function Oe(){V.status===`closing`&&W(B)}function G(){return _e().relayUrl}var K=class extends he(`CloudEnvironmentLinkError`){},q=e=>t=>new K({message:e,cause:t});function ke(e){return b(function*(){let t=yield*P,r=yield*t.run(e,N(p.cloudGetRelayClientStatus,{})).pipe(i(q(`Could not check relay client availability.`)));if(r.status===`available`)return;if(r.status===`unsupported`)return yield*new K({message:`P4 Code cannot install the relay client automatically on ${r.platform}-${r.arch}.`});if(!(yield*ce({try:()=>we(r.version),catch:q(`Could not confirm relay client installation.`)})))return yield*new K({message:`Relay client installation was cancelled.`});let a=yield*t.runStream(e,j(p.cloudInstallRelayClient,{}).pipe(d(e=>E(()=>Ee(e))))).pipe(n,i(q(`Could not install the relay client.`)),h(E(De)));if(pe(a)||a.value.type!==`complete`)return yield*new K({message:`The relay client install completed without a final status.`});let o=a.value.status;if(o.status!==`available`)return yield*new K({message:o.status===`unsupported`?`P4 Code cannot install the relay client automatically on ${o.platform}-${o.arch}.`:`The relay client is still unavailable after installation.`})})}var Ae=o(fe([t,l,m,u,g,A]));function J(e){return t=>{let n=t._tag===`ManagedRelayRequestFailedError`?t:void 0,r=n?.traceId,i=n?M(n):null;return new K({message:i?`${e}: ${i}`:e,cause:t,...r?{traceId:r}:{}})}}function Y(e){return Ae(e)?e:typeof e!=`object`||!e?null:`cause`in e?Y(e.cause):null}var X=e=>t=>{let n=Y(t);return new K({message:n?`${e.replace(/[.:]$/,``)}: ${n.message}`:e,cause:t})};function je(e){let t=new URL(e);return{localHttpHost:`127.0.0.1`,localHttpPort:Number(t.port||(t.protocol===`https:`?443:80))}}var Me=`cloudflare_tunnel`;function Ne(e){return e.link.environmentId===e.expectedEnvironmentId?e.link.endpoint.providerKind===e.expectedProviderKind?r:new K({message:`Relay returned credentials for a different endpoint provider.`}):new K({message:`Relay returned credentials for a different environment.`})}function Pe(e){return b(function*(){return yield*(yield*x(e.target.httpBaseUrl)).connect.linkState({headers:{}}).pipe(i(X(`Could not read environment cloud link state.`)))}).pipe(s(R))}function Fe(e){return b(function*(){let t=yield*x(e.target.httpBaseUrl),{target:n,...r}=e;return yield*t.connect.preferences({headers:{},payload:r}).pipe(i(X(`Could not update environment cloud preferences.`)))}).pipe(s(R))}function Ie(e){return b(function*(){yield*(yield*x(e.target.httpBaseUrl)).connect.unlink({headers:{}}).pipe(i(X(`Could not unlink the environment from cloud.`))),G()&&e.clerkToken&&(yield*(yield*F).unlinkEnvironment({clerkToken:e.clerkToken,environmentId:f.make(e.target.environmentId)}).pipe(c(e=>k(`Could not revoke cloud environment link after local unlink.`,{cause:e}))))}).pipe(s(R))}var Z=`manual`;function Le(e){return b(function*(){let t=G();if(!t)return yield*new K({message:`P4CODE_RELAY_URL is not configured.`});let n=(e.mode??`managed`)===`managed`,r=n?Me:Z,a=yield*F,o=yield*x(e.target.httpBaseUrl);n&&(yield*ke(f.make(e.target.environmentId)));let s=yield*a.createEnvironmentLinkChallenge({clerkToken:e.clerkToken,payload:{notificationsEnabled:!0,liveActivitiesEnabled:!0,managedTunnelsEnabled:n}}).pipe(i(J(`${t}/v1/client/environment-link-challenges failed`))),c=yield*o.connect.linkProof({headers:{},payload:{challenge:s.challenge,relayIssuer:t,endpoint:{httpBaseUrl:e.target.httpBaseUrl,wsBaseUrl:e.target.wsBaseUrl,providerKind:r},origin:je(e.target.httpBaseUrl)}}).pipe(i(X(`Could not obtain environment link proof.`))),l=yield*a.linkEnvironment({clerkToken:e.clerkToken,payload:{proof:c,notificationsEnabled:!0,liveActivitiesEnabled:!0,managedTunnelsEnabled:n}}).pipe(i(J(`${t}/v1/client/environment-links failed`)));yield*Ne({expectedEnvironmentId:e.target.environmentId,expectedProviderKind:r,link:l}),yield*o.connect.relayConfig({headers:{},payload:{relayUrl:t,relayIssuer:l.relayIssuer,cloudUserId:l.cloudUserId,environmentCredential:l.environmentCredential,cloudMintPublicKey:l.cloudMintPublicKey,endpointRuntime:l.endpointRuntime}}).pipe(i(X(`Could not configure environment relay access.`)))}).pipe(s(R))}var Re=de(oe(y,L.contextEffect.pipe(O(e=>ne(e,y))))),Q=C(e=>{let t=JSON.parse(e);return Re.atom(Pe({target:t})).pipe(D({staleTime:5e3,revalidateOnMount:!0}),ge(3e5),S(`primary-cloud-link:${t.environmentId}`))}),ze=le(a(null)).pipe(me,S(`primary-cloud-link:null`));function $(e){return JSON.stringify(e)}function Be(e){e&&z(f.make(e.environmentId),`relay:read`)&&_.refresh(Q($(e)))}function Ve(e){if(!z(f.make(e.environmentId),`relay:read`))return null;let t=_.get(Q($(e)));return t._tag===`Success`?t.value:null}function He(){let e=(0,be.c)(17),t=ve(),n=ye(t?.environmentId??null,se),r;e[0]===t?r=e[1]:(r=t?.entry.target._tag===`PrimaryConnectionTarget`?{environmentId:t.environmentId,label:t.label,httpBaseUrl:t.entry.target.httpBaseUrl,wsBaseUrl:t.entry.target.wsBaseUrl}:null,e[0]=t,e[1]=r);let i=r,a;e[2]!==n||e[3]!==i?(a=i&&I()&&n?Q($(i)):ze,e[2]=n,e[3]=i,e[4]=a):a=e[4];let o=T(a),s;e[5]===i?s=e[6]:(s=()=>{Be(i)},e[5]=i,e[6]=s);let c=s,l=null;if(o._tag===`Failure`){let t;e[7]===o.cause?t=e[8]:(t=ie(o.cause),e[7]=o.cause,e[8]=t);let n=t;l=n instanceof Error?n.message:`Could not read P4 Connect link state.`}let u;e[9]===o?u=e[10]:(u=o._tag===`Failure`?null:w(re(o)),e[9]=o,e[10]=u);let d;return e[11]!==l||e[12]!==c||e[13]!==o.waiting||e[14]!==u||e[15]!==i?(d={data:u,error:l,isPending:o.waiting,refresh:c,target:i},e[11]=l,e[12]=c,e[13]=o.waiting,e[14]=u,e[15]=i,e[16]=d):d=e[16],d}export{Fe as a,Te as c,Ie as i,Ce as l,He as n,Oe as o,Le as r,Se as s,Ve as t};
2
- //# sourceMappingURL=primaryCloudLinkState-DkXIVBHW.js.map
1
+ import{n as e}from"./jsx-runtime-BnjsACtP.js";import{Bl as t,Bv as n,CC as r,CS as i,Ds as a,Eb as o,FS as s,Fx as c,Gl as l,Hl as u,Kv as d,Ll as ee,My as f,Nb as te,OT as ne,Os as re,Qw as ie,Uc as p,Ul as m,Ux as h,Wl as g,Xy as ae,YC as oe,Z_ as se,Zo as _,_C as ce,as as le,cb as ue,cs as de,fb as fe,iE as pe,ib as v,is as me,ju as y,lS as b,lT as he,ls as ge,oc as x,ps as S,rs as C,tE as w,ts as T,uC as E,us as D,xS as O,yS as k,zl as A}from"./utils-CBe1bHL7.js";import{$ as j,Nn as M,Z as N,dt as P,mn as F,o as I,r as L,s as _e,v as R}from"./runtime-CeFhsGnm.js";import"./runtime-BOlBBevr.js";import{E as ve}from"./useSettings-VTow9ZEM.js";import{i as ye,n as z}from"./session-D3gY-tOR.js";var be=e(),xe=class extends ue()(`RelayClientInstallConfirmationConflictError`,{requestedVersion:v,activeVersion:v,activeDialogStatus:ae([`confirming`,`installing`,`closing`]),activeInstallStage:te(ee)}){get message(){return`Cannot confirm relay client installation ${this.requestedVersion}; installation ${this.activeVersion} has dialog status ${this.activeDialogStatus}.`}},B={status:`idle`},V=B,H=null,U=new Set;function W(e){V=e;for(let e of U)e()}function Se(){return V}function Ce(e){return U.add(e),()=>{U.delete(e)}}function we(e){if(V.status!==`idle`){let t=V.status===`closing`?V.view:V;return Promise.reject(new xe({requestedVersion:e,activeVersion:t.version,activeDialogStatus:V.status,...t.status===`installing`?{activeInstallStage:t.stage}:{}}))}return W({status:`confirming`,version:e}),new Promise(e=>{H=e})}function Te(e){if(V.status!==`confirming`||!H)return;let t=H;H=null,W(e?{status:`installing`,version:V.version,stage:`checking`}:{status:`closing`,view:V}),t(e)}function Ee(e){V.status===`installing`&&e.type===`progress`&&W({...V,stage:e.stage})}function De(){H?.(!1),H=null,(V.status===`confirming`||V.status===`installing`)&&W({status:`closing`,view:V})}function Oe(){V.status===`closing`&&W(B)}function G(){return _e().relayUrl}var K=class extends he(`CloudEnvironmentLinkError`){},q=e=>t=>new K({message:e,cause:t});function ke(e){return b(function*(){let t=yield*P,r=yield*t.run(e,N(p.cloudGetRelayClientStatus,{})).pipe(i(q(`Could not check relay client availability.`)));if(r.status===`available`)return;if(r.status===`unsupported`)return yield*new K({message:`P4 Code cannot install the relay client automatically on ${r.platform}-${r.arch}.`});if(!(yield*ce({try:()=>we(r.version),catch:q(`Could not confirm relay client installation.`)})))return yield*new K({message:`Relay client installation was cancelled.`});let a=yield*t.runStream(e,j(p.cloudInstallRelayClient,{}).pipe(d(e=>E(()=>Ee(e))))).pipe(n,i(q(`Could not install the relay client.`)),h(E(De)));if(pe(a)||a.value.type!==`complete`)return yield*new K({message:`The relay client install completed without a final status.`});let o=a.value.status;if(o.status!==`available`)return yield*new K({message:o.status===`unsupported`?`P4 Code cannot install the relay client automatically on ${o.platform}-${o.arch}.`:`The relay client is still unavailable after installation.`})})}var Ae=o(fe([t,l,m,u,g,A]));function J(e){return t=>{let n=t._tag===`ManagedRelayRequestFailedError`?t:void 0,r=n?.traceId,i=n?M(n):null;return new K({message:i?`${e}: ${i}`:e,cause:t,...r?{traceId:r}:{}})}}function Y(e){return Ae(e)?e:typeof e!=`object`||!e?null:`cause`in e?Y(e.cause):null}var X=e=>t=>{let n=Y(t);return new K({message:n?`${e.replace(/[.:]$/,``)}: ${n.message}`:e,cause:t})};function je(e){let t=new URL(e);return{localHttpHost:`127.0.0.1`,localHttpPort:Number(t.port||(t.protocol===`https:`?443:80))}}var Me=`cloudflare_tunnel`;function Ne(e){return e.link.environmentId===e.expectedEnvironmentId?e.link.endpoint.providerKind===e.expectedProviderKind?r:new K({message:`Relay returned credentials for a different endpoint provider.`}):new K({message:`Relay returned credentials for a different environment.`})}function Pe(e){return b(function*(){return yield*(yield*x(e.target.httpBaseUrl)).connect.linkState({headers:{}}).pipe(i(X(`Could not read environment cloud link state.`)))}).pipe(s(R))}function Fe(e){return b(function*(){let t=yield*x(e.target.httpBaseUrl),{target:n,...r}=e;return yield*t.connect.preferences({headers:{},payload:r}).pipe(i(X(`Could not update environment cloud preferences.`)))}).pipe(s(R))}function Ie(e){return b(function*(){yield*(yield*x(e.target.httpBaseUrl)).connect.unlink({headers:{}}).pipe(i(X(`Could not unlink the environment from cloud.`))),G()&&e.clerkToken&&(yield*(yield*F).unlinkEnvironment({clerkToken:e.clerkToken,environmentId:f.make(e.target.environmentId)}).pipe(c(e=>k(`Could not revoke cloud environment link after local unlink.`,{cause:e}))))}).pipe(s(R))}var Z=`manual`;function Le(e){return b(function*(){let t=G();if(!t)return yield*new K({message:`P4CODE_RELAY_URL is not configured.`});let n=(e.mode??`managed`)===`managed`,r=n?Me:Z,a=yield*F,o=yield*x(e.target.httpBaseUrl);n&&(yield*ke(f.make(e.target.environmentId)));let s=yield*a.createEnvironmentLinkChallenge({clerkToken:e.clerkToken,payload:{notificationsEnabled:!0,liveActivitiesEnabled:!0,managedTunnelsEnabled:n}}).pipe(i(J(`${t}/v1/client/environment-link-challenges failed`))),c=yield*o.connect.linkProof({headers:{},payload:{challenge:s.challenge,relayIssuer:t,endpoint:{httpBaseUrl:e.target.httpBaseUrl,wsBaseUrl:e.target.wsBaseUrl,providerKind:r},origin:je(e.target.httpBaseUrl)}}).pipe(i(X(`Could not obtain environment link proof.`))),l=yield*a.linkEnvironment({clerkToken:e.clerkToken,payload:{proof:c,notificationsEnabled:!0,liveActivitiesEnabled:!0,managedTunnelsEnabled:n}}).pipe(i(J(`${t}/v1/client/environment-links failed`)));yield*Ne({expectedEnvironmentId:e.target.environmentId,expectedProviderKind:r,link:l}),yield*o.connect.relayConfig({headers:{},payload:{relayUrl:t,relayIssuer:l.relayIssuer,cloudUserId:l.cloudUserId,environmentCredential:l.environmentCredential,cloudMintPublicKey:l.cloudMintPublicKey,endpointRuntime:l.endpointRuntime}}).pipe(i(X(`Could not configure environment relay access.`)))}).pipe(s(R))}var Re=de(oe(y,L.contextEffect.pipe(O(e=>ne(e,y))))),Q=C(e=>{let t=JSON.parse(e);return Re.atom(Pe({target:t})).pipe(D({staleTime:5e3,revalidateOnMount:!0}),ge(3e5),S(`primary-cloud-link:${t.environmentId}`))}),ze=le(a(null)).pipe(me,S(`primary-cloud-link:null`));function $(e){return JSON.stringify(e)}function Be(e){e&&z(f.make(e.environmentId),`relay:read`)&&_.refresh(Q($(e)))}function Ve(e){if(!z(f.make(e.environmentId),`relay:read`))return null;let t=_.get(Q($(e)));return t._tag===`Success`?t.value:null}function He(){let e=(0,be.c)(17),t=ve(),n=ye(t?.environmentId??null,se),r;e[0]===t?r=e[1]:(r=t?.entry.target._tag===`PrimaryConnectionTarget`?{environmentId:t.environmentId,label:t.label,httpBaseUrl:t.entry.target.httpBaseUrl,wsBaseUrl:t.entry.target.wsBaseUrl}:null,e[0]=t,e[1]=r);let i=r,a;e[2]!==n||e[3]!==i?(a=i&&I()&&n?Q($(i)):ze,e[2]=n,e[3]=i,e[4]=a):a=e[4];let o=T(a),s;e[5]===i?s=e[6]:(s=()=>{Be(i)},e[5]=i,e[6]=s);let c=s,l=null;if(o._tag===`Failure`){let t;e[7]===o.cause?t=e[8]:(t=ie(o.cause),e[7]=o.cause,e[8]=t);let n=t;l=n instanceof Error?n.message:`Could not read P4 Connect link state.`}let u;e[9]===o?u=e[10]:(u=o._tag===`Failure`?null:w(re(o)),e[9]=o,e[10]=u);let d;return e[11]!==l||e[12]!==c||e[13]!==o.waiting||e[14]!==u||e[15]!==i?(d={data:u,error:l,isPending:o.waiting,refresh:c,target:i},e[11]=l,e[12]=c,e[13]=o.waiting,e[14]=u,e[15]=i,e[16]=d):d=e[16],d}export{Fe as a,Te as c,Ie as i,Ce as l,He as n,Oe as o,Le as r,Se as s,Ve as t};
2
+ //# sourceMappingURL=primaryCloudLinkState-CER468V5.js.map
@@ -1,2 +1,2 @@
1
- import{n as e}from"./jsx-runtime-BnjsACtP.js";import{Eb as t,Os as n,Qw as r,Zo as i,a_ as a,as as o,cl as s,es as c,ps as l,rE as u,tE as d,ts as f,ws as p}from"./utils-DhUt689t.js";import{L as m}from"./runtime-OeWFs5Hf.js";import{s as h}from"./vcsRefInvalidation-CW_MIqdt.js";import{G as g}from"./entities-B8Vupv5g.js";import{o as _}from"./queries-hhl_J8u9.js";var v=e(),y=``,b=o(p(!1)),x=o(p(!1)).pipe(l(`project-file-query:empty`));function S(e,t,n){return g.optimisticFile({environmentId:e,cwd:t,relativePath:n})}var C=new Map;function w(e){let t=C.get(e);C.delete(e),t?.()}function T(e,t,n){return g.listEntries({environmentId:e,input:{cwd:t,...n===void 0?{}:{directoryPath:n}}})}function E(e,t,n){return g.readFile({environmentId:e,input:{cwd:t,relativePath:n??y}})}function D(e,t,n){return g.readConfiguration({environmentId:e,input:{cwd:t,relativePath:n}})}function O(e,t,n,r){let a=S(e,t,n);C.has(a)||C.set(a,i.mount(a)),i.set(a,{confirmedAgainst:void 0,data:{relativePath:n,contents:r,byteLength:new TextEncoder().encode(r).byteLength,truncated:!1}})}function k(e,t,n){return i.get(S(e,t,n))?.data??null}function A(e,t,r){let a=k(e,t,r);if(a)return a.contents;let o=i.get(E(e,t,r));return u(n(o))?.contents}function j(e,t,n){let r=i.get(S(e,t,n));return r?.confirmedAgainst===void 0?r?.data??null:null}function M(e,t,n,r){let a=S(e,t,n),o=i.get(a);if(o?.data.contents!==r)return!1;let c=E(e,t,n),l={...o,confirmedAgainst:i.get(c)};return i.set(a,l),w(a),i.refresh(c),m(i,c,{reportDefect:!1,reportFailure:!1}).then(async r=>{if(n===`p4.json`){let n=D(e,t,s);i.refresh(n),await m(i,n,{reportDefect:!1,reportFailure:!1})}r._tag===`Success`&&i.get(a)===l&&i.set(a,null)}),!0}function N(e,t,n,r){return n===null?r:i.get(S(e,t,n))?.data??r}function P(e){return e._tag===`Failure`?r(e.cause):null}function F(e){return e===null?null:e instanceof Error?e.message:`Workspace query failed.`}var I=t(a);function L(e,t,r){let i=(0,v.c)(19),a=h(e),{canReadFiles:o}=a,s;i[0]!==o||i[1]!==t||i[2]!==r||i[3]!==e?(s=o?T(e,t,r):b,i[0]=o,i[1]=t,i[2]=r,i[3]=e,i[4]=s):s=i[4];let l=s,u=f(l),p=c(l),m;i[5]===p?m=i[6]:(m=()=>p(),i[5]=p,i[6]=m);let g=m,_;i[7]===u?_=i[8]:(_=d(n(u)),i[7]=u,i[8]=_);let y;i[9]!==o||i[10]!==a.error||i[11]!==a.isPending||i[12]!==u?(y=a.isPending?null:o?F(P(u)):a.error??`This connection cannot read host files.`,i[9]=o,i[10]=a.error,i[11]=a.isPending,i[12]=u,i[13]=y):y=i[13];let x=a.isPending||u.waiting,S;return i[14]!==g||i[15]!==_||i[16]!==y||i[17]!==x?(S={data:_,error:y,isPending:x,refresh:g},i[14]=g,i[15]=_,i[16]=y,i[17]=x,i[18]=S):S=i[18],S}function R(e,t,n,r,i){let a=(0,v.c)(16),o;a[0]===i?.imageOnly?o=a[1]:(o=i?.imageOnly?{imageOnly:!0}:{},a[0]=i?.imageOnly,a[1]=o);let s;a[2]!==t||a[3]!==e||a[4]!==n||a[5]!==o?(s={environmentId:e,cwd:t,query:n,kind:`file`,...o},a[2]=t,a[3]=e,a[4]=n,a[5]=o,a[6]=s):s=a[6];let c;a[7]===Symbol.for(`react.memo_cache_sentinel`)?(c={allowEmptyQuery:!0},a[7]=c):c=a[7];let l=_(s,r,c),u;a[8]!==l.entries||a[9]!==l.isPending?(u=l.isPending?[]:l.entries,a[8]=l.entries,a[9]=l.isPending,a[10]=u):u=a[10];let d;return a[11]!==l.error||a[12]!==l.isPending||a[13]!==l.searchedQuery||a[14]!==u?(d={entries:u,error:l.error,isPending:l.isPending,matchedQuery:l.searchedQuery},a[11]=l.error,a[12]=l.isPending,a[13]=l.searchedQuery,a[14]=u,a[15]=d):d=a[15],d}function z(e,t,r,i,a){let o=(0,v.c)(36),l=i===void 0||i,u=a!==void 0&&a,p=h(e),{canReadFiles:m}=p,g=l,_;o[0]!==m||o[1]!==u||o[2]!==t||o[3]!==l||o[4]!==e||o[5]!==r?(_=l&&m?u&&r!==null?D(e,t,r):E(e,t,r):x,o[0]=m,o[1]=u,o[2]=t,o[3]=l,o[4]=e,o[5]=r,o[6]=_):_=o[6];let b=_,C=f(b),w=c(b),T;o[7]===w?T=o[8]:(T=()=>w(),o[7]=w,o[8]=T);let O=T,k;o[9]===C?k=o[10]:(k=d(n(C)),o[9]=C,o[10]=k);let A=k,j=A?.relativePath??r??y,M;o[11]!==t||o[12]!==e||o[13]!==j?(M=S(e,t,j),o[11]=t,o[12]=e,o[13]=j,o[14]=M):M=o[14];let N=f(M),L=u?s:y,R;o[15]!==t||o[16]!==e||o[17]!==L?(R=S(e,t,L),o[15]=t,o[16]=e,o[17]=L,o[18]=R):R=o[18];let z=f(R),B=r===null?null:u?z??N:N,V,H,U;if(o[19]!==m||o[20]!==A||o[21]!==p.error||o[22]!==p.isPending||o[23]!==g||o[24]!==B?.data||o[25]!==C){let e=P(C);V=I(e)?e:null,U=m?B?.data??A:null,H=!g||p.isPending?null:m?F(e):p.error??`This connection cannot read host files.`,o[19]=m,o[20]=A,o[21]=p.error,o[22]=p.isPending,o[23]=g,o[24]=B?.data,o[25]=C,o[26]=V,o[27]=H,o[28]=U}else V=o[26],H=o[27],U=o[28];let W=g&&(p.isPending||C.waiting),G=V?.failure===`path_not_file`,K;return o[29]!==V||o[30]!==O||o[31]!==H||o[32]!==W||o[33]!==G||o[34]!==U?(K={data:U,error:H,isPending:W,readError:V,isNotFile:G,refresh:O},o[29]=V,o[30]=O,o[31]=H,o[32]=W,o[33]=G,o[34]=U,o[35]=K):K=o[35],K}export{E as a,N as c,R as d,z as f,A as i,O as l,k as n,j as o,D as r,S as s,M as t,L as u};
2
- //# sourceMappingURL=projectFilesQueryState-0jxJ50Qq.js.map
1
+ import{n as e}from"./jsx-runtime-BnjsACtP.js";import{Eb as t,Os as n,Qw as r,Zo as i,a_ as a,as as o,cl as s,es as c,ps as l,rE as u,tE as d,ts as f,ws as p}from"./utils-CBe1bHL7.js";import{L as m}from"./runtime-CeFhsGnm.js";import{s as h}from"./vcsRefInvalidation-B2f3qDSR.js";import{G as g}from"./entities-eRiwvW2F.js";import{o as _}from"./queries-DJfKGsHe.js";var v=e(),y=``,b=o(p(!1)),x=o(p(!1)).pipe(l(`project-file-query:empty`));function S(e,t,n){return g.optimisticFile({environmentId:e,cwd:t,relativePath:n})}var C=new Map;function w(e){let t=C.get(e);C.delete(e),t?.()}function T(e,t,n){return g.listEntries({environmentId:e,input:{cwd:t,...n===void 0?{}:{directoryPath:n}}})}function E(e,t,n){return g.readFile({environmentId:e,input:{cwd:t,relativePath:n??y}})}function D(e,t,n){return g.readConfiguration({environmentId:e,input:{cwd:t,relativePath:n}})}function O(e,t,n,r){let a=S(e,t,n);C.has(a)||C.set(a,i.mount(a)),i.set(a,{confirmedAgainst:void 0,data:{relativePath:n,contents:r,byteLength:new TextEncoder().encode(r).byteLength,truncated:!1}})}function k(e,t,n){return i.get(S(e,t,n))?.data??null}function A(e,t,r){let a=k(e,t,r);if(a)return a.contents;let o=i.get(E(e,t,r));return u(n(o))?.contents}function j(e,t,n){let r=i.get(S(e,t,n));return r?.confirmedAgainst===void 0?r?.data??null:null}function M(e,t,n,r){let a=S(e,t,n),o=i.get(a);if(o?.data.contents!==r)return!1;let c=E(e,t,n),l={...o,confirmedAgainst:i.get(c)};return i.set(a,l),w(a),i.refresh(c),m(i,c,{reportDefect:!1,reportFailure:!1}).then(async r=>{if(n===`p4.json`){let n=D(e,t,s);i.refresh(n),await m(i,n,{reportDefect:!1,reportFailure:!1})}r._tag===`Success`&&i.get(a)===l&&i.set(a,null)}),!0}function N(e,t,n,r){return n===null?r:i.get(S(e,t,n))?.data??r}function P(e){return e._tag===`Failure`?r(e.cause):null}function F(e){return e===null?null:e instanceof Error?e.message:`Workspace query failed.`}var I=t(a);function L(e,t,r){let i=(0,v.c)(19),a=h(e),{canReadFiles:o}=a,s;i[0]!==o||i[1]!==t||i[2]!==r||i[3]!==e?(s=o?T(e,t,r):b,i[0]=o,i[1]=t,i[2]=r,i[3]=e,i[4]=s):s=i[4];let l=s,u=f(l),p=c(l),m;i[5]===p?m=i[6]:(m=()=>p(),i[5]=p,i[6]=m);let g=m,_;i[7]===u?_=i[8]:(_=d(n(u)),i[7]=u,i[8]=_);let y;i[9]!==o||i[10]!==a.error||i[11]!==a.isPending||i[12]!==u?(y=a.isPending?null:o?F(P(u)):a.error??`This connection cannot read host files.`,i[9]=o,i[10]=a.error,i[11]=a.isPending,i[12]=u,i[13]=y):y=i[13];let x=a.isPending||u.waiting,S;return i[14]!==g||i[15]!==_||i[16]!==y||i[17]!==x?(S={data:_,error:y,isPending:x,refresh:g},i[14]=g,i[15]=_,i[16]=y,i[17]=x,i[18]=S):S=i[18],S}function R(e,t,n,r,i){let a=(0,v.c)(16),o;a[0]===i?.imageOnly?o=a[1]:(o=i?.imageOnly?{imageOnly:!0}:{},a[0]=i?.imageOnly,a[1]=o);let s;a[2]!==t||a[3]!==e||a[4]!==n||a[5]!==o?(s={environmentId:e,cwd:t,query:n,kind:`file`,...o},a[2]=t,a[3]=e,a[4]=n,a[5]=o,a[6]=s):s=a[6];let c;a[7]===Symbol.for(`react.memo_cache_sentinel`)?(c={allowEmptyQuery:!0},a[7]=c):c=a[7];let l=_(s,r,c),u;a[8]!==l.entries||a[9]!==l.isPending?(u=l.isPending?[]:l.entries,a[8]=l.entries,a[9]=l.isPending,a[10]=u):u=a[10];let d;return a[11]!==l.error||a[12]!==l.isPending||a[13]!==l.searchedQuery||a[14]!==u?(d={entries:u,error:l.error,isPending:l.isPending,matchedQuery:l.searchedQuery},a[11]=l.error,a[12]=l.isPending,a[13]=l.searchedQuery,a[14]=u,a[15]=d):d=a[15],d}function z(e,t,r,i,a){let o=(0,v.c)(36),l=i===void 0||i,u=a!==void 0&&a,p=h(e),{canReadFiles:m}=p,g=l,_;o[0]!==m||o[1]!==u||o[2]!==t||o[3]!==l||o[4]!==e||o[5]!==r?(_=l&&m?u&&r!==null?D(e,t,r):E(e,t,r):x,o[0]=m,o[1]=u,o[2]=t,o[3]=l,o[4]=e,o[5]=r,o[6]=_):_=o[6];let b=_,C=f(b),w=c(b),T;o[7]===w?T=o[8]:(T=()=>w(),o[7]=w,o[8]=T);let O=T,k;o[9]===C?k=o[10]:(k=d(n(C)),o[9]=C,o[10]=k);let A=k,j=A?.relativePath??r??y,M;o[11]!==t||o[12]!==e||o[13]!==j?(M=S(e,t,j),o[11]=t,o[12]=e,o[13]=j,o[14]=M):M=o[14];let N=f(M),L=u?s:y,R;o[15]!==t||o[16]!==e||o[17]!==L?(R=S(e,t,L),o[15]=t,o[16]=e,o[17]=L,o[18]=R):R=o[18];let z=f(R),B=r===null?null:u?z??N:N,V,H,U;if(o[19]!==m||o[20]!==A||o[21]!==p.error||o[22]!==p.isPending||o[23]!==g||o[24]!==B?.data||o[25]!==C){let e=P(C);V=I(e)?e:null,U=m?B?.data??A:null,H=!g||p.isPending?null:m?F(e):p.error??`This connection cannot read host files.`,o[19]=m,o[20]=A,o[21]=p.error,o[22]=p.isPending,o[23]=g,o[24]=B?.data,o[25]=C,o[26]=V,o[27]=H,o[28]=U}else V=o[26],H=o[27],U=o[28];let W=g&&(p.isPending||C.waiting),G=V?.failure===`path_not_file`,K;return o[29]!==V||o[30]!==O||o[31]!==H||o[32]!==W||o[33]!==G||o[34]!==U?(K={data:U,error:H,isPending:W,readError:V,isNotFile:G,refresh:O},o[29]=V,o[30]=O,o[31]=H,o[32]=W,o[33]=G,o[34]=U,o[35]=K):K=o[35],K}export{E as a,N as c,R as d,z as f,A as i,O as l,k as n,j as o,D as r,S as s,M as t,L as u};
2
+ //# sourceMappingURL=projectFilesQueryState-D4FdR3Xm.js.map
@@ -1,2 +1,2 @@
1
- import{a as e,t}from"./react-DH3P2YXY.js";import{n,t as r}from"./jsx-runtime-BnjsACtP.js";import{$_ as i,Bf as a,Kp as o,cl as s,dr as c,ep as l,on as u,p_ as d,q_ as f,th as p,vf as m,xb as h,xd as g}from"./utils-DhUt689t.js";import{R as ee,W as te}from"./runtime-OeWFs5Hf.js";import{i as _,n as v}from"./session-BxUdP61p.js";import{t as ne}from"./textarea-DlXXDHPJ.js";import{t as y}from"./input-BYd74ook.js";import{a as re,c as ie,i as ae,o as oe,r as se,s as ce,t as le}from"./dialog-BRtKKGzk.js";import{D as b,O as ue}from"./keybindings-B_kRk5Fi.js";import{i as de,o as fe,t as pe}from"./popover-BjUpdrKu.js";import{f as x}from"./projectFilesQueryState-0jxJ50Qq.js";import{t as S}from"./p4ProjectFile-CwpteA7b.js";import{l as me}from"./KeybindingsSettings.logic-BJe27xmi.js";import{Ar as he,Fr as ge,Ir as _e,Mr as ve,Nr as C,Pr as ye,jr as be,va as w,vi as T}from"./main-VfCRP294.js";function E(e,t){let n=e.projectSettingsOverrides[t.id]?.defaultProjectScripts;if(n!==void 0)return n;if(e.projectSettingsFolded)return e.defaultProjectScripts;let r=e.projectScriptOverrides[t.id];return r===null?e.defaultProjectScripts:r??(t.scripts.length>0?t.scripts:e.defaultProjectScripts)}function D(e){return e.worktreePath??e.project.cwd}function O(e){let t={P4CODE_PROJECT_ROOT:e.project.cwd};return e.worktreePath&&(t.P4CODE_WORKTREE_PATH=e.worktreePath),e.extraEnv?{...t,...e.extraEnv}:t}function k(e){let t=[...e.runOnWorktreeCreate?[`setup`]:[],...e.runOnSettle?[`on settle`]:[]];return t.length===0?e.name:`${e.name} (${t.join(`, `)})`}var A=e(t(),1),j=n(),M=`Invalid keybinding.`,N=h(d);function P(e){let t=e?.trim()??``;return t.length>0?t:null}function F(e){let t=P(e.keybinding);if(!t)return null;if(e.command===null)throw Error(M);let n=N({key:t,command:e.command});if(n._tag===`None`)throw Error(M);return n.value}function I(e,t){if(t===null)return null;for(let n=e.length-1;n>=0;--n){let r=e[n];if(!r||r.command!==t)continue;let i=[];r.shortcut.modKey&&i.push(`mod`),r.shortcut.ctrlKey&&i.push(`ctrl`),r.shortcut.metaKey&&i.push(`meta`),r.shortcut.altKey&&i.push(`alt`),r.shortcut.shiftKey&&i.push(`shift`);let a=r.shortcut.key===` `?`space`:r.shortcut.key===`escape`?`esc`:r.shortcut.key;return i.push(a),i.join(`+`)}return null}var L=[];function R(e,t){let n=(0,j.c)(8),r=x(e,t??``,s,t!==null,!0),i=r.data&&!r.data.truncated?r.data.contents:null,a=r.isPending,o;bb0:{if(i===null){let e=a?`loading`:`missing`,t;n[0]===e?t=n[1]:(t={status:e,file:null,scripts:L},n[0]=e,n[1]=t),o=t;break bb0}let e;n[2]===i?e=n[3]:(e=S(i),n[2]=i,n[3]=e);let t=e;if(t===null){let e;n[4]===Symbol.for(`react.memo_cache_sentinel`)?(e={status:`invalid`,file:null,scripts:L},n[4]=e):e=n[4],o=e;break bb0}let r=t.scripts??L,s;n[5]!==t||n[6]!==r?(s={status:`valid`,file:t,scripts:r},n[5]=t,n[6]=r,n[7]=s):s=n[7],o=s}return o}function z(e,t){return R(e,t).scripts}var B=e(r(),1),xe=[{id:`play`,label:`Play`},{id:`test`,label:`Test`},{id:`lint`,label:`Lint`},{id:`configure`,label:`Configure`},{id:`build`,label:`Build`},{id:`debug`,label:`Debug`}];function V(e){let t=(0,j.c)(12),{icon:n,className:r}=e,i=r===void 0?`size-3.5`:r;if(n===`test`){let e;return t[0]===i?e=t[1]:(e=(0,B.jsx)(m,{className:i}),t[0]=i,t[1]=e),e}if(n===`lint`){let e;return t[2]===i?e=t[3]:(e=(0,B.jsx)(l,{className:i}),t[2]=i,t[3]=e),e}if(n===`configure`){let e;return t[4]===i?e=t[5]:(e=(0,B.jsx)(p,{className:i}),t[4]=i,t[5]=e),e}if(n===`build`){let e;return t[6]===i?e=t[7]:(e=(0,B.jsx)(a,{className:i}),t[6]=i,t[7]=e),e}if(n===`debug`){let e;return t[8]===i?e=t[9]:(e=(0,B.jsx)(g,{className:i}),t[8]=i,t[9]=e),e}let s;return t[10]===i?s=t[11]:(s=(0,B.jsx)(o,{className:i}),t[10]=i,t[11]=s),s}var H={name:``,command:``,icon:`play`,runOnWorktreeCreate:!1,waitForSetup:!1,runOnSettle:!1,keybinding:null,previewUrl:null,autoOpenPreview:!1};function U(e,t){return{scriptId:e.id,initial:{name:e.name,command:e.command,icon:e.icon,runOnWorktreeCreate:e.runOnWorktreeCreate,waitForSetup:e.runOnWorktreeCreate&&e.async===!1,runOnSettle:e.runOnSettle??!1,keybinding:I(t,b(e.id)),previewUrl:e.previewUrl??null,autoOpenPreview:e.autoOpenPreview??!1}}}function W({environmentId:e,editScope:t=f,request:n,scripts:r,onSubmit:a,onDelete:o,onClose:s}){let l=_(e,t),d=_(e,i),p=A.useId(),[m,h]=(0,A.useState)(``),[g,x]=(0,A.useState)(``),[S,E]=(0,A.useState)(`play`),[D,O]=u(!l),[k,j]=(0,A.useState)(!1),[M,N]=(0,A.useState)(!1),[P,I]=(0,A.useState)(!1),[L,R]=(0,A.useState)(``),[z,H]=(0,A.useState)(``),[U,W]=(0,A.useState)(!1),[G,K]=(0,A.useState)(null),[q,J]=u(!l),[Se,Y]=(0,A.useState)(null),X=(0,A.useRef)(null),Ce=n!==null,Z=n?.scriptId!=null,Q=n!==null&&Se===n;(0,A.useLayoutEffect)(()=>()=>{X.current?.request===n&&(X.current=null)},[n]),(0,A.useEffect)(()=>{n&&(h(n.initial.name),x(n.initial.command),E(n.initial.icon),O(!1),j(n.initial.runOnWorktreeCreate),N(n.initial.waitForSetup),I(n.initial.runOnSettle),R(n.initial.keybinding??``),H(n.initial.previewUrl??``),W(n.initial.autoOpenPreview),K(n.error??null),Y(null))},[n,O]);let $=()=>{X.current=null,Y(null),O(!1),s()};return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(le,{open:Ce,onOpenChange:e=>{e||$()},children:(0,B.jsxs)(ce,{children:[(0,B.jsxs)(re,{children:[(0,B.jsx)(ie,{children:Z?`Edit Action`:`Add Action`}),(0,B.jsx)(se,{children:`Actions are project-scoped commands you can run from the top bar or keybindings.`})]}),(0,B.jsx)(oe,{children:(0,B.jsx)(`form`,{id:p,onSubmit:async o=>{if(o.preventDefault(),!n||X.current!==null)return;if(!v(e,t)){K(`This connection cannot change project actions.`);return}let s=(L.trim()||null)!==(n.initial.keybinding?.trim()||null),c=v(e,i);if(s&&!c){K(`This connection cannot change keyboard shortcuts.`);return}let l=m.trim(),u=g.trim();if(l.length===0){K(`Name is required.`);return}if(u.length===0){K(`Command is required.`);return}K(null);let d;try{let e=n.scriptId??ue(l,r.map(e=>e.id)),t=F({keybinding:L,command:b(e)}),i=z.trim();d={name:l,command:u,icon:S,runOnWorktreeCreate:k,waitForSetup:k&&M,runOnSettle:P,...n.scriptId===null&&c||s?{keybinding:t?.key??null}:{},previewUrl:i.length>0?i:null,autoOpenPreview:i.length>0&&U}}catch(e){K(e instanceof Error?e.message:`Failed to save action.`);return}let f={request:n};X.current=f,Y(n),O(!1);try{let e=await a(n.scriptId,d);if(X.current===f){if(e._tag===`Failure`){if(!ee(e)){let t=te(e);K(t instanceof Error?t.message:`Failed to save action.`)}}else $()}}catch(e){X.current===f&&K(e instanceof Error?e.message:`Failed to save action.`)}X.current===f&&(X.current=null,Y(null))},children:(0,B.jsxs)(`fieldset`,{className:`space-y-4`,disabled:Q||!l,children:[(0,B.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,B.jsx)(T,{htmlFor:`script-name`,children:`Name`}),(0,B.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,B.jsxs)(pe,{onOpenChange:O,open:D,children:[(0,B.jsx)(fe,{render:(0,B.jsx)(c,{type:`button`,variant:`outline`,className:`size-9 shrink-0`,"aria-label":`Choose icon`}),children:(0,B.jsx)(V,{icon:S,className:`size-4.5`})}),(0,B.jsx)(de,{align:`start`,children:(0,B.jsx)(`div`,{className:`grid grid-cols-3 gap-2`,children:xe.map(e=>{let t=e.id===S;return(0,B.jsxs)(`button`,{type:`button`,className:`relative flex flex-col items-center gap-2 rounded-md border px-2 py-2 text-xs dark:border-transparent ${t?`border-primary/70 bg-primary/10 ring-inset dark:ring-1 dark:ring-primary/30`:`border-border/70 hover:bg-accent/60 dark:bg-white/[0.035]`}`,onClick:()=>{E(e.id),O(!1)},children:[(0,B.jsx)(V,{icon:e.id,className:`size-4`}),(0,B.jsx)(`span`,{children:e.label})]},e.id)})})})]}),(0,B.jsx)(y,{id:`script-name`,autoFocus:!0,placeholder:`Test`,value:m,onChange:e=>h(e.target.value)})]})]}),(0,B.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,B.jsx)(T,{htmlFor:`script-keybinding`,children:`Keybinding`}),(0,B.jsx)(y,{disabled:!d,id:`script-keybinding`,placeholder:`Press shortcut`,value:L,readOnly:!0,onKeyDown:n=>{if(!v(e,t)||!v(e,`settings:write`)||n.key===`Tab`)return;if(n.preventDefault(),n.key===`Backspace`||n.key===`Delete`){R(``);return}let r=me(n,navigator.platform);r&&R(r)}}),(0,B.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`Press a shortcut. Use `,(0,B.jsx)(`code`,{children:`Backspace`}),` to clear. Shortcuts are environment-wide. Projects using the same action share its shortcut.`]})]}),(0,B.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,B.jsx)(T,{htmlFor:`script-command`,children:`Command`}),(0,B.jsx)(ne,{id:`script-command`,placeholder:`bun test`,value:g,onChange:e=>x(e.target.value)})]}),(0,B.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,B.jsx)(T,{htmlFor:`script-preview-url`,children:`Preview URL (optional)`}),(0,B.jsx)(y,{id:`script-preview-url`,placeholder:`http://localhost:5173`,value:z,onChange:e=>H(e.target.value)}),(0,B.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Open this URL in the in-app preview when this action runs.`})]}),(0,B.jsxs)(`label`,{className:`flex items-center justify-between gap-3 rounded-md border border-border/70 px-3 py-2 text-sm dark:border-transparent dark:bg-white/[0.035]`,children:[(0,B.jsx)(`span`,{children:`Run automatically on worktree creation`}),(0,B.jsx)(w,{checked:k,onCheckedChange:e=>j(!!e)})]}),(0,B.jsxs)(`label`,{className:`flex items-center justify-between gap-3 rounded-md border border-border/70 px-3 py-2 text-sm dark:border-transparent dark:bg-white/[0.035] ${k?``:`opacity-60`}`,children:[(0,B.jsx)(`span`,{children:`Wait for it to finish before the agent starts`}),(0,B.jsx)(w,{checked:M,disabled:!k,onCheckedChange:e=>N(!!e)})]}),(0,B.jsxs)(`label`,{className:`flex items-center justify-between gap-3 rounded-md border border-border/70 px-3 py-2 text-sm dark:border-transparent dark:bg-white/[0.035]`,children:[(0,B.jsx)(`span`,{children:`Run in the thread's worktree when the thread settles`}),(0,B.jsx)(w,{checked:P,onCheckedChange:e=>I(!!e)})]}),(0,B.jsxs)(`label`,{className:`flex items-center justify-between gap-3 rounded-md border border-border/70 px-3 py-2 text-sm dark:border-transparent dark:bg-white/[0.035] ${z.trim().length===0?`opacity-60`:``}`,children:[(0,B.jsx)(`span`,{children:`Open preview automatically when this action runs`}),(0,B.jsx)(w,{checked:U,disabled:z.trim().length===0,onCheckedChange:e=>W(!!e)})]}),G&&(0,B.jsx)(`p`,{className:`text-sm text-destructive`,children:G})]})})}),(0,B.jsxs)(ae,{variant:`bare`,children:[Z&&(0,B.jsx)(c,{type:`button`,variant:`destructive-outline`,className:`mr-auto`,disabled:Q||!l,onClick:()=>J(!0),children:`Delete`}),(0,B.jsx)(c,{type:`button`,variant:`outline`,onClick:$,children:`Cancel`}),(0,B.jsx)(c,{form:p,type:`submit`,disabled:Q||!l,children:Q?`Saving…`:Z?`Save changes`:`Save action`})]})]})}),(0,B.jsx)(he,{open:q&&l,onOpenChange:J,children:(0,B.jsxs)(ge,{children:[(0,B.jsxs)(ye,{children:[(0,B.jsxs)(_e,{children:[`Delete action "`,m,`"?`]}),(0,B.jsx)(ve,{children:`This action cannot be undone.`})]}),(0,B.jsxs)(C,{children:[(0,B.jsx)(be,{render:(0,B.jsx)(c,{variant:`outline`}),children:`Cancel`}),(0,B.jsx)(c,{variant:`destructive`,disabled:Q||!l,onClick:()=>{if(n?.scriptId){if(!v(e,t)){K(`This connection cannot change project actions.`);return}J(!1),$(),o(n.scriptId)}},children:`Delete action`})]})]})})]})}export{z as a,I as c,O as d,E as f,U as i,D as l,W as n,R as o,V as r,F as s,H as t,k as u};
2
- //# sourceMappingURL=projectScriptEditor-CMGXoIEJ.js.map
1
+ import{a as e,t}from"./react-DH3P2YXY.js";import{n,t as r}from"./jsx-runtime-BnjsACtP.js";import{$_ as i,Bf as a,Kp as o,cl as s,dr as c,ep as l,on as u,p_ as d,q_ as f,th as p,vf as m,xb as h,xd as g}from"./utils-CBe1bHL7.js";import{R as ee,W as te}from"./runtime-CeFhsGnm.js";import{i as _,n as v}from"./session-D3gY-tOR.js";import{t as ne}from"./textarea-hXQFbdrS.js";import{t as y}from"./input-DXGWoa4O.js";import{a as re,c as ie,i as ae,o as oe,r as se,s as ce,t as le}from"./dialog-_vbB7RKH.js";import{D as b,O as ue}from"./keybindings-DAHl8jIl.js";import{i as de,o as fe,t as pe}from"./popover-CogH2zM4.js";import{f as x}from"./projectFilesQueryState-D4FdR3Xm.js";import{t as S}from"./p4ProjectFile-BVKW5TIA.js";import{l as me}from"./KeybindingsSettings.logic-BA5WG7V2.js";import{Gr as he,Jr as ge,Kr as _e,Xr as ve,Yr as C,Zr as ye,do as w,qr as be,sa as T}from"./main-DleJeMZO.js";function E(e,t){let n=e.projectSettingsOverrides[t.id]?.defaultProjectScripts;if(n!==void 0)return n;if(e.projectSettingsFolded)return e.defaultProjectScripts;let r=e.projectScriptOverrides[t.id];return r===null?e.defaultProjectScripts:r??(t.scripts.length>0?t.scripts:e.defaultProjectScripts)}function D(e){return e.worktreePath??e.project.cwd}function O(e){let t={P4CODE_PROJECT_ROOT:e.project.cwd};return e.worktreePath&&(t.P4CODE_WORKTREE_PATH=e.worktreePath),e.extraEnv?{...t,...e.extraEnv}:t}function k(e){let t=[...e.runOnWorktreeCreate?[`setup`]:[],...e.runOnSettle?[`on settle`]:[]];return t.length===0?e.name:`${e.name} (${t.join(`, `)})`}var A=e(t(),1),j=n(),M=`Invalid keybinding.`,N=h(d);function P(e){let t=e?.trim()??``;return t.length>0?t:null}function F(e){let t=P(e.keybinding);if(!t)return null;if(e.command===null)throw Error(M);let n=N({key:t,command:e.command});if(n._tag===`None`)throw Error(M);return n.value}function I(e,t){if(t===null)return null;for(let n=e.length-1;n>=0;--n){let r=e[n];if(!r||r.command!==t)continue;let i=[];r.shortcut.modKey&&i.push(`mod`),r.shortcut.ctrlKey&&i.push(`ctrl`),r.shortcut.metaKey&&i.push(`meta`),r.shortcut.altKey&&i.push(`alt`),r.shortcut.shiftKey&&i.push(`shift`);let a=r.shortcut.key===` `?`space`:r.shortcut.key===`escape`?`esc`:r.shortcut.key;return i.push(a),i.join(`+`)}return null}var L=[];function R(e,t){let n=(0,j.c)(8),r=x(e,t??``,s,t!==null,!0),i=r.data&&!r.data.truncated?r.data.contents:null,a=r.isPending,o;bb0:{if(i===null){let e=a?`loading`:`missing`,t;n[0]===e?t=n[1]:(t={status:e,file:null,scripts:L},n[0]=e,n[1]=t),o=t;break bb0}let e;n[2]===i?e=n[3]:(e=S(i),n[2]=i,n[3]=e);let t=e;if(t===null){let e;n[4]===Symbol.for(`react.memo_cache_sentinel`)?(e={status:`invalid`,file:null,scripts:L},n[4]=e):e=n[4],o=e;break bb0}let r=t.scripts??L,s;n[5]!==t||n[6]!==r?(s={status:`valid`,file:t,scripts:r},n[5]=t,n[6]=r,n[7]=s):s=n[7],o=s}return o}function z(e,t){return R(e,t).scripts}var B=e(r(),1),xe=[{id:`play`,label:`Play`},{id:`test`,label:`Test`},{id:`lint`,label:`Lint`},{id:`configure`,label:`Configure`},{id:`build`,label:`Build`},{id:`debug`,label:`Debug`}];function V(e){let t=(0,j.c)(12),{icon:n,className:r}=e,i=r===void 0?`size-3.5`:r;if(n===`test`){let e;return t[0]===i?e=t[1]:(e=(0,B.jsx)(m,{className:i}),t[0]=i,t[1]=e),e}if(n===`lint`){let e;return t[2]===i?e=t[3]:(e=(0,B.jsx)(l,{className:i}),t[2]=i,t[3]=e),e}if(n===`configure`){let e;return t[4]===i?e=t[5]:(e=(0,B.jsx)(p,{className:i}),t[4]=i,t[5]=e),e}if(n===`build`){let e;return t[6]===i?e=t[7]:(e=(0,B.jsx)(a,{className:i}),t[6]=i,t[7]=e),e}if(n===`debug`){let e;return t[8]===i?e=t[9]:(e=(0,B.jsx)(g,{className:i}),t[8]=i,t[9]=e),e}let s;return t[10]===i?s=t[11]:(s=(0,B.jsx)(o,{className:i}),t[10]=i,t[11]=s),s}var H={name:``,command:``,icon:`play`,runOnWorktreeCreate:!1,waitForSetup:!1,runOnSettle:!1,keybinding:null,previewUrl:null,autoOpenPreview:!1};function U(e,t){return{scriptId:e.id,initial:{name:e.name,command:e.command,icon:e.icon,runOnWorktreeCreate:e.runOnWorktreeCreate,waitForSetup:e.runOnWorktreeCreate&&e.async===!1,runOnSettle:e.runOnSettle??!1,keybinding:I(t,b(e.id)),previewUrl:e.previewUrl??null,autoOpenPreview:e.autoOpenPreview??!1}}}function W({environmentId:e,editScope:t=f,request:n,scripts:r,onSubmit:a,onDelete:o,onClose:s}){let l=_(e,t),d=_(e,i),p=A.useId(),[m,h]=(0,A.useState)(``),[g,x]=(0,A.useState)(``),[S,E]=(0,A.useState)(`play`),[D,O]=u(!l),[k,j]=(0,A.useState)(!1),[M,N]=(0,A.useState)(!1),[P,I]=(0,A.useState)(!1),[L,R]=(0,A.useState)(``),[z,H]=(0,A.useState)(``),[U,W]=(0,A.useState)(!1),[G,K]=(0,A.useState)(null),[q,J]=u(!l),[Se,Y]=(0,A.useState)(null),X=(0,A.useRef)(null),Ce=n!==null,Z=n?.scriptId!=null,Q=n!==null&&Se===n;(0,A.useLayoutEffect)(()=>()=>{X.current?.request===n&&(X.current=null)},[n]),(0,A.useEffect)(()=>{n&&(h(n.initial.name),x(n.initial.command),E(n.initial.icon),O(!1),j(n.initial.runOnWorktreeCreate),N(n.initial.waitForSetup),I(n.initial.runOnSettle),R(n.initial.keybinding??``),H(n.initial.previewUrl??``),W(n.initial.autoOpenPreview),K(n.error??null),Y(null))},[n,O]);let $=()=>{X.current=null,Y(null),O(!1),s()};return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(le,{open:Ce,onOpenChange:e=>{e||$()},children:(0,B.jsxs)(ce,{children:[(0,B.jsxs)(re,{children:[(0,B.jsx)(ie,{children:Z?`Edit Action`:`Add Action`}),(0,B.jsx)(se,{children:`Actions are project-scoped commands you can run from the top bar or keybindings.`})]}),(0,B.jsx)(oe,{children:(0,B.jsx)(`form`,{id:p,onSubmit:async o=>{if(o.preventDefault(),!n||X.current!==null)return;if(!v(e,t)){K(`This connection cannot change project actions.`);return}let s=(L.trim()||null)!==(n.initial.keybinding?.trim()||null),c=v(e,i);if(s&&!c){K(`This connection cannot change keyboard shortcuts.`);return}let l=m.trim(),u=g.trim();if(l.length===0){K(`Name is required.`);return}if(u.length===0){K(`Command is required.`);return}K(null);let d;try{let e=n.scriptId??ue(l,r.map(e=>e.id)),t=F({keybinding:L,command:b(e)}),i=z.trim();d={name:l,command:u,icon:S,runOnWorktreeCreate:k,waitForSetup:k&&M,runOnSettle:P,...n.scriptId===null&&c||s?{keybinding:t?.key??null}:{},previewUrl:i.length>0?i:null,autoOpenPreview:i.length>0&&U}}catch(e){K(e instanceof Error?e.message:`Failed to save action.`);return}let f={request:n};X.current=f,Y(n),O(!1);try{let e=await a(n.scriptId,d);if(X.current===f){if(e._tag===`Failure`){if(!ee(e)){let t=te(e);K(t instanceof Error?t.message:`Failed to save action.`)}}else $()}}catch(e){X.current===f&&K(e instanceof Error?e.message:`Failed to save action.`)}X.current===f&&(X.current=null,Y(null))},children:(0,B.jsxs)(`fieldset`,{className:`space-y-4`,disabled:Q||!l,children:[(0,B.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,B.jsx)(T,{htmlFor:`script-name`,children:`Name`}),(0,B.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,B.jsxs)(pe,{onOpenChange:O,open:D,children:[(0,B.jsx)(fe,{render:(0,B.jsx)(c,{type:`button`,variant:`outline`,className:`size-9 shrink-0`,"aria-label":`Choose icon`}),children:(0,B.jsx)(V,{icon:S,className:`size-4.5`})}),(0,B.jsx)(de,{align:`start`,children:(0,B.jsx)(`div`,{className:`grid grid-cols-3 gap-2`,children:xe.map(e=>{let t=e.id===S;return(0,B.jsxs)(`button`,{type:`button`,className:`relative flex flex-col items-center gap-2 rounded-md border px-2 py-2 text-xs dark:border-transparent ${t?`border-primary/70 bg-primary/10 ring-inset dark:ring-1 dark:ring-primary/30`:`border-border/70 hover:bg-accent/60 dark:bg-white/[0.035]`}`,onClick:()=>{E(e.id),O(!1)},children:[(0,B.jsx)(V,{icon:e.id,className:`size-4`}),(0,B.jsx)(`span`,{children:e.label})]},e.id)})})})]}),(0,B.jsx)(y,{id:`script-name`,autoFocus:!0,placeholder:`Test`,value:m,onChange:e=>h(e.target.value)})]})]}),(0,B.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,B.jsx)(T,{htmlFor:`script-keybinding`,children:`Keybinding`}),(0,B.jsx)(y,{disabled:!d,id:`script-keybinding`,placeholder:`Press shortcut`,value:L,readOnly:!0,onKeyDown:n=>{if(!v(e,t)||!v(e,`settings:write`)||n.key===`Tab`)return;if(n.preventDefault(),n.key===`Backspace`||n.key===`Delete`){R(``);return}let r=me(n,navigator.platform);r&&R(r)}}),(0,B.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`Press a shortcut. Use `,(0,B.jsx)(`code`,{children:`Backspace`}),` to clear. Shortcuts are environment-wide. Projects using the same action share its shortcut.`]})]}),(0,B.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,B.jsx)(T,{htmlFor:`script-command`,children:`Command`}),(0,B.jsx)(ne,{id:`script-command`,placeholder:`bun test`,value:g,onChange:e=>x(e.target.value)})]}),(0,B.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,B.jsx)(T,{htmlFor:`script-preview-url`,children:`Preview URL (optional)`}),(0,B.jsx)(y,{id:`script-preview-url`,placeholder:`http://localhost:5173`,value:z,onChange:e=>H(e.target.value)}),(0,B.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Open this URL in the in-app preview when this action runs.`})]}),(0,B.jsxs)(`label`,{className:`flex items-center justify-between gap-3 rounded-md border border-border/70 px-3 py-2 text-sm dark:border-transparent dark:bg-white/[0.035]`,children:[(0,B.jsx)(`span`,{children:`Run automatically on worktree creation`}),(0,B.jsx)(w,{checked:k,onCheckedChange:e=>j(!!e)})]}),(0,B.jsxs)(`label`,{className:`flex items-center justify-between gap-3 rounded-md border border-border/70 px-3 py-2 text-sm dark:border-transparent dark:bg-white/[0.035] ${k?``:`opacity-60`}`,children:[(0,B.jsx)(`span`,{children:`Wait for it to finish before the agent starts`}),(0,B.jsx)(w,{checked:M,disabled:!k,onCheckedChange:e=>N(!!e)})]}),(0,B.jsxs)(`label`,{className:`flex items-center justify-between gap-3 rounded-md border border-border/70 px-3 py-2 text-sm dark:border-transparent dark:bg-white/[0.035]`,children:[(0,B.jsx)(`span`,{children:`Run in the thread's worktree when the thread settles`}),(0,B.jsx)(w,{checked:P,onCheckedChange:e=>I(!!e)})]}),(0,B.jsxs)(`label`,{className:`flex items-center justify-between gap-3 rounded-md border border-border/70 px-3 py-2 text-sm dark:border-transparent dark:bg-white/[0.035] ${z.trim().length===0?`opacity-60`:``}`,children:[(0,B.jsx)(`span`,{children:`Open preview automatically when this action runs`}),(0,B.jsx)(w,{checked:U,disabled:z.trim().length===0,onCheckedChange:e=>W(!!e)})]}),G&&(0,B.jsx)(`p`,{className:`text-sm text-destructive`,children:G})]})})}),(0,B.jsxs)(ae,{variant:`bare`,children:[Z&&(0,B.jsx)(c,{type:`button`,variant:`destructive-outline`,className:`mr-auto`,disabled:Q||!l,onClick:()=>J(!0),children:`Delete`}),(0,B.jsx)(c,{type:`button`,variant:`outline`,onClick:$,children:`Cancel`}),(0,B.jsx)(c,{form:p,type:`submit`,disabled:Q||!l,children:Q?`Saving…`:Z?`Save changes`:`Save action`})]})]})}),(0,B.jsx)(he,{open:q&&l,onOpenChange:J,children:(0,B.jsxs)(ve,{children:[(0,B.jsxs)(C,{children:[(0,B.jsxs)(ye,{children:[`Delete action "`,m,`"?`]}),(0,B.jsx)(be,{children:`This action cannot be undone.`})]}),(0,B.jsxs)(ge,{children:[(0,B.jsx)(_e,{render:(0,B.jsx)(c,{variant:`outline`}),children:`Cancel`}),(0,B.jsx)(c,{variant:`destructive`,disabled:Q||!l,onClick:()=>{if(n?.scriptId){if(!v(e,t)){K(`This connection cannot change project actions.`);return}J(!1),$(),o(n.scriptId)}},children:`Delete action`})]})]})})]})}export{z as a,I as c,O as d,E as f,U as i,D as l,W as n,R as o,V as r,F as s,H as t,k as u};
2
+ //# sourceMappingURL=projectScriptEditor-4wQTbXvz.js.map