ryco-cli 0.1.10 → 0.1.12

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 (233) hide show
  1. package/dist/bin.cjs +1 -1
  2. package/dist/bin.mjs +1 -1
  3. package/dist/client/assets/AccountSettings-C3v2klAG.js +1 -0
  4. package/dist/client/assets/AiFocusSettings-BquKjnWf.js +1 -0
  5. package/dist/client/assets/AnimatedHeight-BIsV_Z3J.js +1 -0
  6. package/dist/client/assets/AppearanceSettings-CYbSApl4.js +1 -0
  7. package/dist/client/assets/{BranchToolbar.logic-C1Dh4xQW.js → BranchToolbar.logic-CmvD76Cw.js} +1 -1
  8. package/dist/client/assets/ChatRightPanel-DVxRdZWT.js +27 -0
  9. package/dist/client/assets/ChatThreadRouteView-DlgAAOCp.js +1 -0
  10. package/dist/client/assets/CommandPaletteDialog-BnJURcy7.js +1 -0
  11. package/dist/client/assets/{CompositeItem-D-K93PI3.js → CompositeItem-F3NGn6aG.js} +1 -1
  12. package/dist/client/assets/CompositeRoot-CmJGfRtc.js +1 -0
  13. package/dist/client/assets/ConnectionsSettings-Ccn8q4fG.js +7 -0
  14. package/dist/client/assets/DiagnosticsSettings-QXpjXOrH.js +2 -0
  15. package/dist/client/assets/{DialogHandle-pL0RAsXa.js → DialogHandle-C4uSr9wX.js} +1 -1
  16. package/dist/client/assets/DialogPopup-Dck8r8Hn.js +1 -0
  17. package/dist/client/assets/DialogRoot-BpIvUdm7.js +1 -0
  18. package/dist/client/assets/{DialogTitle-BamZsRNz.js → DialogTitle-CCedPAjV.js} +1 -1
  19. package/dist/client/assets/{DialogTrigger-DR3vtVpa.js → DialogTrigger-CYJ7_YcV.js} +1 -1
  20. package/dist/client/assets/DialogViewport-D-CrTM-P.js +1 -0
  21. package/dist/client/assets/DraftChatThreadRouteView-DFMY6O91.js +1 -0
  22. package/dist/client/assets/{GlassSurface-DTmaROoR.js → GlassSurface-C3IIWMu9.js} +1 -1
  23. package/dist/client/assets/HostedConnectionControls-BC4kVWTa.js +1 -0
  24. package/dist/client/assets/HostedHubRoot-pBGVub10.js +1 -0
  25. package/dist/client/assets/HostedNativeAuthorizationRoute-Df0oSrLR.js +1 -0
  26. package/dist/client/assets/HostedRelayTrustNotice-ffS_O2AX.js +1 -0
  27. package/dist/client/assets/Icons-CT3nd2MA.js +1 -0
  28. package/dist/client/assets/IntegrationsSettingsPanel-BHyy-VM0.js +1 -0
  29. package/dist/client/assets/KeybindingsSettings-BfkONqmZ.js +7 -0
  30. package/dist/client/assets/McpServersSettings-UthT1T80.js +6 -0
  31. package/dist/client/assets/MobileSheet-CkeG6_SP.js +1 -0
  32. package/dist/client/assets/NewWorktreeDialog-DTZnArOC.js +4 -0
  33. package/dist/client/assets/NoActiveThreadState-jcEAWu7N.js +1 -0
  34. package/dist/client/assets/NodeSecuritySettings-DPqjRphc.js +1 -0
  35. package/dist/client/assets/OpinionatedPluginsSettings-BSy3F4v6.js +1 -0
  36. package/dist/client/assets/PhoneGetAppInterstitial-B2mrJtgM.js +1 -0
  37. package/dist/client/assets/PhoneGetAppInterstitialBackdrop-B8vfJdZd.js +1 -0
  38. package/dist/client/assets/PhoneHome-C-ttaKuE.js +1 -0
  39. package/dist/client/assets/PhoneSettingsSurface-CJddundi.js +1 -0
  40. package/dist/client/assets/ProjectFavicon-BhQnkxbx.js +1 -0
  41. package/dist/client/assets/ProviderModelPicker-COg6CGM4.js +1 -0
  42. package/dist/client/assets/ProvidersSettingsPanel-C3aPyCrN.js +1 -0
  43. package/dist/client/assets/RedactedSensitiveText-CxtaUiKH.js +1 -0
  44. package/dist/client/assets/RootAppShell-3T2sBtpP.js +6 -0
  45. package/dist/client/assets/RycoLetterMark-Bk0kvGJ_.js +1 -0
  46. package/dist/client/assets/SettingsDialog-krsStFrf.js +1 -0
  47. package/dist/client/assets/SettingsPanels-D8Xy3pPC.js +3 -0
  48. package/dist/client/assets/SettingsPanels.editor-B2x4U4rW.js +1 -0
  49. package/dist/client/assets/SourceControlSettings-KIx9EfEZ.js +1 -0
  50. package/dist/client/assets/StatisticsPage-C38pI2_b.js +1 -0
  51. package/dist/client/assets/StatisticsPanel-6sINT28-.js +1 -0
  52. package/dist/client/assets/StatisticsSettingsLink-Cx43bOeo.js +1 -0
  53. package/dist/client/assets/ThreadStatusIndicators-CL0KGLlj.js +0 -0
  54. package/dist/client/assets/{ThreadTerminalDrawer-BYQ6EMgr.js → ThreadTerminalDrawer-C4NJu8Qs.js} +3 -3
  55. package/dist/client/assets/{ThreadWorkspacePanel-DuaQ9DMj.js → ThreadWorkspacePanel-D9qlHXCA.js} +18 -18
  56. package/dist/client/assets/{ToolbarRootContext-Cp1bgmpz.js → ToolbarRootContext-BgqqXVly.js} +1 -1
  57. package/dist/client/assets/{WorkItemsTab-BDfun24H.js → WorkItemsTab-BDAeQe4D.js} +8 -8
  58. package/dist/client/assets/alert-LqMhbdE9.js +1 -0
  59. package/dist/client/assets/alert-dialog-DxoA6ky8.js +1 -0
  60. package/dist/client/assets/badge-CXw6fWrB.js +1 -0
  61. package/dist/client/assets/{branding-yW_ACj9l.js → branding-DeKsIp6g.js} +1 -1
  62. package/dist/client/assets/button-BAbJxRzt.js +1 -0
  63. package/dist/client/assets/{capabilities-j43xmCXg.js → capabilities-BkVqeGLQ.js} +1 -1
  64. package/dist/client/assets/collapsible-dxy6kc2k.js +1 -0
  65. package/dist/client/assets/command-CGNKG_Oe.js +1 -0
  66. package/dist/client/assets/composerDraftStore-CdJJZe42.js +11 -0
  67. package/dist/client/assets/data-list-CYKBxN62.js +1 -0
  68. package/dist/client/assets/{desktopUpdateAtoms-Cy06xm8M.js → desktopUpdateAtoms-B9iJXSdW.js} +1 -1
  69. package/dist/client/assets/{desktopWorkspace-Cw4Fu0Dd.js → desktopWorkspace-B-cSBe8H.js} +1 -1
  70. package/dist/client/assets/{device-hx7RX9fI.js → device-DfIh5pQV.js} +12 -12
  71. package/dist/client/assets/dialog-DQsYchqu.js +1 -0
  72. package/dist/client/assets/draft-input-CkzOk8BY.js +1 -0
  73. package/dist/client/assets/{editorPreferences-C3i2Nkh2.js → editorPreferences-0DWMgcci.js} +1 -1
  74. package/dist/client/assets/empty-DwzqNgCP.js +1 -0
  75. package/dist/client/assets/{getPseudoElementBounds-NLvUMZyQ.js → getPseudoElementBounds-X62ElHN8.js} +1 -1
  76. package/dist/client/assets/group-D9ER9giz.js +1 -0
  77. package/dist/client/assets/{index-COc-h_V9.js → index-Bntnmu6O.js} +1 -1
  78. package/dist/client/assets/input-CHEwW3oH.js +1 -0
  79. package/dist/client/assets/kbd-DCGQZk18.js +1 -0
  80. package/dist/client/assets/{keybindings-BCns_TPr.js → keybindings-CWJ7E9ZI.js} +1 -1
  81. package/dist/client/assets/label-CVFHsLFO.js +1 -0
  82. package/dist/client/assets/{lib-BBbQoz14.js → lib-qiiNMGgU.js} +1 -1
  83. package/dist/client/assets/{main-9Wu8G64Y.js → main-BjVnVob0.js} +3 -3
  84. package/dist/client/assets/menu-Dvxh8sD5.js +1 -0
  85. package/dist/client/assets/popover-CuH9Yrj3.js +1 -0
  86. package/dist/client/assets/{projectPaths-DSRhOXwD.js → projectPaths-SSsIvt0g.js} +1 -1
  87. package/dist/client/assets/{providerDriverMeta-DcAmgw5o.js → providerDriverMeta-I0TSo-QI.js} +1 -1
  88. package/dist/client/assets/providerIconUtils-CzSa_16f.js +1 -0
  89. package/dist/client/assets/providerInstances-BJcfB_9E.js +1 -0
  90. package/dist/client/assets/providerModels-BJcfB_9E.js +1 -0
  91. package/dist/client/assets/qr-code-Bddq6K7S.js +1 -0
  92. package/dist/client/assets/radio-group-CBZFr4C8.js +2 -0
  93. package/dist/client/assets/resolveAriaLabelledBy-CD_ugzhJ.js +1 -0
  94. package/dist/client/assets/{rightPanelRouteSearch-DE_7uWlN.js → rightPanelRouteSearch-DB5gQGHK.js} +1 -1
  95. package/dist/client/assets/runtime-DfGHeCnR.js +1 -0
  96. package/dist/client/assets/scroll-area-Drsa8bNB.js +1 -0
  97. package/dist/client/assets/scrollEdges-B-cqxY4l.js +1 -0
  98. package/dist/client/assets/select-BYbVr-yg.js +1 -0
  99. package/dist/client/assets/separator-CdS5bi4Z.js +1 -0
  100. package/dist/client/assets/{session-logic-DOQPF0oN.js → session-logic-wxhvMgEN.js} +1 -1
  101. package/dist/client/assets/settingsDialogStore-ygYoScKe.js +1 -0
  102. package/dist/client/assets/settingsLayout-D8glO7f1.js +1 -0
  103. package/dist/client/assets/sheet-BO78gIKZ.js +1 -0
  104. package/dist/client/assets/sidebar-Dm6l2GA6.js +1 -0
  105. package/dist/client/assets/sidebarProjectFolders-CGVDJ0ZT.js +4 -0
  106. package/dist/client/assets/{sidebarStatusText-DaNVnBiR.js → sidebarStatusText-D0HT0fek.js} +1 -1
  107. package/dist/client/assets/skeleton-CvQSeJbw.js +1 -0
  108. package/dist/client/assets/spinner-ClF0jOcX.js +1 -0
  109. package/dist/client/assets/storeSelectors-Bpr2pdhU.js +1 -0
  110. package/dist/client/assets/switch-BTGo9Yip.js +1 -0
  111. package/dist/client/assets/{terminal-links-BaX-ICJT.js → terminal-links-CZ3c9AbA.js} +1 -1
  112. package/dist/client/assets/textarea-RFPODxWW.js +1 -0
  113. package/dist/client/assets/{threadPriorityRefreshRuntime-DqqfcbZE.js → threadPriorityRefreshRuntime-tRDgvBzr.js} +1 -1
  114. package/dist/client/assets/toast-CcSCAm4B.js +1 -0
  115. package/dist/client/assets/toggle-I6h33Cu5.js +1 -0
  116. package/dist/client/assets/toggle-group-mLIkiJtU.js +1 -0
  117. package/dist/client/assets/tooltip-C8sAONBj.js +1 -0
  118. package/dist/client/assets/types-Bpr2pdhU.js +1 -0
  119. package/dist/client/assets/{uiStateStore-VVodpTkG.js → uiStateStore-B6pjzSjj.js} +1 -1
  120. package/dist/client/assets/{useAtlassian-DzQhYzCz.js → useAtlassian-DC0XOw4u.js} +0 -0
  121. package/dist/client/assets/{useButton-CQaIys_r.js → useButton-D__1LqCF.js} +1 -1
  122. package/dist/client/assets/useCompositeListItem-Cmr_nuuG.js +1 -0
  123. package/dist/client/assets/{useDebouncedValue-Dl2JtWSe.js → useDebouncedValue-DHjoudTq.js} +1 -1
  124. package/dist/client/assets/{useFloatingRootContext-DKAeq7FI.js → useFloatingRootContext-D5EZmrCa.js} +1 -1
  125. package/dist/client/assets/{useHandleNewThread-CzfIpG9Y.js → useHandleNewThread-Bvz-DKgn.js} +1 -1
  126. package/dist/client/assets/{useLabelableId-C7EOshps.js → useLabelableId-DnQJ7amm.js} +1 -1
  127. package/dist/client/assets/useLocation-CDeYzWW6.js +1 -0
  128. package/dist/client/assets/{useOpenInteractionType-D9ngong8.js → useOpenInteractionType-CjtpACKR.js} +1 -1
  129. package/dist/client/assets/usePhoneThreadActions-CAgIq9aZ.js +1 -0
  130. package/dist/client/assets/usePopupViewport-BuhsNdVy.js +1 -0
  131. package/dist/client/assets/useScrollLock-D3tMGsRk.js +1 -0
  132. package/dist/client/assets/{useStatistics-CP8uxvx6.js → useStatistics-CiLROMJP.js} +14 -14
  133. package/dist/client/assets/{useSwipeDismiss-DESLmDpT.js → useSwipeDismiss-CbgDJvw1.js} +1 -1
  134. package/dist/client/assets/{useThreadActions-fOb3ApmL.js → useThreadActions-Vew3ScxG.js} +1 -1
  135. package/dist/client/assets/{useTriggerFocusGuards-DkAmJBLw.js → useTriggerFocusGuards-CrugmkhX.js} +1 -1
  136. package/dist/client/assets/{useValueChanged-CSGMZCwN.js → useValueChanged-MQtIzPIU.js} +1 -1
  137. package/dist/client/assets/utils-BofFIn5Y.js +1 -0
  138. package/dist/client/index.html +1 -1
  139. package/package.json +1 -1
  140. package/dist/client/assets/AccountSettings-CxbiGHT-.js +0 -1
  141. package/dist/client/assets/AiFocusSettings-Cx2vpGdu.js +0 -1
  142. package/dist/client/assets/AnimatedHeight-D5lUTPRn.js +0 -1
  143. package/dist/client/assets/AppearanceSettings-eWri4YVm.js +0 -1
  144. package/dist/client/assets/ChatRightPanel-DAVHrLN_.js +0 -27
  145. package/dist/client/assets/ChatThreadRouteView-D11uiGPL.js +0 -1
  146. package/dist/client/assets/CommandPaletteDialog-DDXuLFyX.js +0 -1
  147. package/dist/client/assets/CompositeRoot-Cee5L4T9.js +0 -1
  148. package/dist/client/assets/ConnectionsSettings-Cf1RRkcn.js +0 -7
  149. package/dist/client/assets/DiagnosticsSettings-R00QjM1b.js +0 -2
  150. package/dist/client/assets/DialogPopup-DqvvwMxX.js +0 -1
  151. package/dist/client/assets/DialogRoot-BZCu6XdB.js +0 -1
  152. package/dist/client/assets/DialogViewport-CuRGvCfw.js +0 -1
  153. package/dist/client/assets/DraftChatThreadRouteView-CGMtPPGt.js +0 -1
  154. package/dist/client/assets/HostedConnectionControls-CXiER4OL.js +0 -1
  155. package/dist/client/assets/HostedHubRoot-MbaWk1RQ.js +0 -1
  156. package/dist/client/assets/HostedNativeAuthorizationRoute-DQ71L_yc.js +0 -1
  157. package/dist/client/assets/HostedRelayTrustNotice-Cv7T3mW5.js +0 -1
  158. package/dist/client/assets/Icons-DjUJVKIP.js +0 -1
  159. package/dist/client/assets/IntegrationsSettingsPanel-BUDT_BAr.js +0 -1
  160. package/dist/client/assets/KeybindingsSettings-DpU1kPiV.js +0 -7
  161. package/dist/client/assets/McpServersSettings-DQqM_vIq.js +0 -6
  162. package/dist/client/assets/MobileSheet-PksVmYO6.js +0 -1
  163. package/dist/client/assets/NewWorktreeDialog-CAe3UUk5.js +0 -4
  164. package/dist/client/assets/NoActiveThreadState-B020r2KX.js +0 -1
  165. package/dist/client/assets/NodeSecuritySettings-DlVOOlej.js +0 -1
  166. package/dist/client/assets/OpinionatedPluginsSettings-DMshW6cD.js +0 -1
  167. package/dist/client/assets/PhoneGetAppInterstitial-BCO-RNVk.js +0 -1
  168. package/dist/client/assets/PhoneGetAppInterstitialBackdrop-CkHNzjRm.js +0 -1
  169. package/dist/client/assets/PhoneHome-DY2ItxYl.js +0 -1
  170. package/dist/client/assets/PhoneSettingsSurface-DTP9FXLL.js +0 -1
  171. package/dist/client/assets/ProjectFavicon-Dopa4Rxy.js +0 -1
  172. package/dist/client/assets/ProviderModelPicker-ChoxerzY.js +0 -1
  173. package/dist/client/assets/ProvidersSettingsPanel-Ubea3yAA.js +0 -1
  174. package/dist/client/assets/RedactedSensitiveText-CdVeknPX.js +0 -1
  175. package/dist/client/assets/RootAppShell-BkUPk443.js +0 -6
  176. package/dist/client/assets/RycoLetterMark-GW-n9UxM.js +0 -1
  177. package/dist/client/assets/SettingsDialog-DMPrhOeR.js +0 -1
  178. package/dist/client/assets/SettingsPanels-ChP1z6Bu.js +0 -3
  179. package/dist/client/assets/SettingsPanels.editor-CiyAxlms.js +0 -1
  180. package/dist/client/assets/SourceControlSettings-8w3XlkuZ.js +0 -1
  181. package/dist/client/assets/StatisticsPage-D4lU63rD.js +0 -1
  182. package/dist/client/assets/StatisticsPanel-C2yBieuM.js +0 -1
  183. package/dist/client/assets/StatisticsSettingsLink-DZwvRI-Y.js +0 -1
  184. package/dist/client/assets/ThreadStatusIndicators-B43wkv-s.js +0 -0
  185. package/dist/client/assets/alert-DdU9OGtC.js +0 -1
  186. package/dist/client/assets/alert-dialog-zAmnOpaF.js +0 -1
  187. package/dist/client/assets/badge-CNPL77i3.js +0 -1
  188. package/dist/client/assets/button-CXfaxtRp.js +0 -1
  189. package/dist/client/assets/collapsible-oJfDmFRs.js +0 -1
  190. package/dist/client/assets/command-DK1D8p4-.js +0 -1
  191. package/dist/client/assets/composerDraftStore-BaAeiPHc.js +0 -11
  192. package/dist/client/assets/data-list-BpzwKa1z.js +0 -1
  193. package/dist/client/assets/dialog-JVv-MNDj.js +0 -1
  194. package/dist/client/assets/draft-input-CxoGkZxM.js +0 -1
  195. package/dist/client/assets/empty-DhkXzm1N.js +0 -1
  196. package/dist/client/assets/group-CafmSbGU.js +0 -1
  197. package/dist/client/assets/input-Bz9pd_f3.js +0 -1
  198. package/dist/client/assets/kbd-qh5s29Yp.js +0 -1
  199. package/dist/client/assets/label-Ct6uH6qL.js +0 -1
  200. package/dist/client/assets/menu-DL-18Hfn.js +0 -1
  201. package/dist/client/assets/popover-C9y_0-ZN.js +0 -1
  202. package/dist/client/assets/providerIconUtils-DSXSWHwg.js +0 -1
  203. package/dist/client/assets/providerInstances-D5NRn-MS.js +0 -1
  204. package/dist/client/assets/providerModels-D5NRn-MS.js +0 -1
  205. package/dist/client/assets/qr-code-DsN9sWfN.js +0 -1
  206. package/dist/client/assets/radio-group-DGUZYMAN.js +0 -2
  207. package/dist/client/assets/resolveAriaLabelledBy-l3Wj7Mso.js +0 -1
  208. package/dist/client/assets/runtime-CqhG6EOG.js +0 -1
  209. package/dist/client/assets/scroll-area-gtur6NxN.js +0 -1
  210. package/dist/client/assets/scrollEdges-Ccq9Jqpk.js +0 -1
  211. package/dist/client/assets/select-BB7zCkpA.js +0 -1
  212. package/dist/client/assets/separator-DOGIr29S.js +0 -1
  213. package/dist/client/assets/settingsDialogStore-DM98Sea0.js +0 -1
  214. package/dist/client/assets/settingsLayout-CS7P71tz.js +0 -1
  215. package/dist/client/assets/sheet-DVALF6mw.js +0 -1
  216. package/dist/client/assets/sidebar-Dft4bIEi.js +0 -1
  217. package/dist/client/assets/sidebarProjectFolders-BOfJCYjK.js +0 -4
  218. package/dist/client/assets/skeleton-CBHDWLDX.js +0 -1
  219. package/dist/client/assets/spinner-JhkVC8d7.js +0 -1
  220. package/dist/client/assets/storeSelectors-CP3vrsGY.js +0 -1
  221. package/dist/client/assets/switch-vkC1QGDn.js +0 -1
  222. package/dist/client/assets/textarea-Cz_x76EQ.js +0 -1
  223. package/dist/client/assets/toast-Bnfw8LOb.js +0 -1
  224. package/dist/client/assets/toggle-DNtHlm45.js +0 -1
  225. package/dist/client/assets/toggle-group-BNtjyirT.js +0 -1
  226. package/dist/client/assets/tooltip-lYatfjuN.js +0 -1
  227. package/dist/client/assets/types-CP3vrsGY.js +0 -1
  228. package/dist/client/assets/useCompositeListItem-D_u_nlWz.js +0 -1
  229. package/dist/client/assets/useLocation-CvhfNIUj.js +0 -1
  230. package/dist/client/assets/usePhoneThreadActions-CiFBnOHD.js +0 -1
  231. package/dist/client/assets/usePopupViewport-CQTeg5Y-.js +0 -1
  232. package/dist/client/assets/useScrollLock-TdF-Iq8H.js +0 -1
  233. package/dist/client/assets/utils-BPUctpTG.js +0 -1
@@ -1 +1 @@
1
- import{i as e,t}from"./react-SIfiwpqq.js";import{_ as n}from"./env-B4arEvJg.js";import{Bn as r,Bt as i,Ln as a,Nn as o,Pn as s,Rn as c,Vn as l,Zn as u,jn as d,zt as f}from"./usePopupViewport-CQTeg5Y-.js";import{t as p}from"./useRouter-CcIDS3PN.js";import{t as m}from"./clamp-CgH0Dl6R.js";function h(e){return e[e.length-1]}function g(e,t){return typeof e==`function`?e(t):e}var _=Object.prototype.hasOwnProperty,v=Object.prototype.propertyIsEnumerable;function ee(e){for(let t in e)if(_.call(e,t))return!0;return!1}var y=()=>Object.create(null),b=(e,t)=>x(e,t,y);function x(e,t,n=()=>({}),r=0){if(e===t)return e;if(r>500)return t;let i=t,a=T(e)&&T(i);if(!a&&!(C(e)&&C(i)))return i;let o=a?e:S(e);if(!o)return i;let s=a?i:S(i);if(!s)return i;let c=o.length,l=s.length,u=a?Array(l):n(),d=0;for(let t=0;t<l;t++){let o=a?t:s[t],l=e[o],f=i[o];if(l===f){u[o]=l,(a?t<c:_.call(e,o))&&d++;continue}if(l===null||f===null||typeof l!=`object`||typeof f!=`object`){u[o]=f;continue}let p=x(l,f,n,r+1);u[o]=p,p===l&&d++}return c===l&&d===c?e:u}function S(e){let t=Object.keys(e);if(t.length!==Object.getOwnPropertyNames(e).length)return!1;let n=Object.getOwnPropertySymbols(e);if(n.length===0)return t;for(let r of n){if(!v.call(e,r))return!1;t.push(r)}return t}function C(e){if(!w(e))return!1;let t=e.constructor;if(t===void 0)return!0;let n=t.prototype;return!(!w(n)||!n.hasOwnProperty(`isPrototypeOf`))}function w(e){return Object.prototype.toString.call(e)===`[object Object]`}function T(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function E(e,t,n){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(let r=0,i=e.length;r<i;r++)if(!E(e[r],t[r],n))return!1;return!0}if(C(e)&&C(t)){let r=n?.ignoreUndefined??!0;if(n?.partial){for(let i in t)if((!r||t[i]!==void 0)&&!E(e[i],t[i],n))return!1;return!0}let i=0;if(!r)i=Object.keys(e).length;else for(let t in e)e[t]!==void 0&&i++;let a=0;for(let o in t)if((!r||t[o]!==void 0)&&(a++,a>i||!E(e[o],t[o],n)))return!1;return i===a}return!1}var D=/[\x00-\x1f\x7f"<>`{}]/g;function O(e){return e.replace(D,e=>`%`+e.charCodeAt(0).toString(16).toUpperCase().padStart(2,`0`))}function k(e){let t;try{t=decodeURI(e)}catch{t=e.replaceAll(/%[0-9A-F]{2}/gi,e=>{try{return decodeURI(e)}catch{return e}})}return O(t)}var te=[`http:`,`https:`,`mailto:`,`tel:`];function A(e,t){if(!e)return!1;try{let n=new URL(e);return!t.has(n.protocol)}catch{return!1}}function ne(e){if(!e||!/[%\\\x00-\x1f\x7f]/.test(e)&&!e.startsWith(`//`))return{path:e,handledProtocolRelativeURL:!1};let t=/%25|%5C/gi,n=0,r=``,i;for(;(i=t.exec(e))!==null;)r+=k(e.slice(n,i.index))+i[0],n=t.lastIndex;r+=k(n?e.slice(n):e);let a=!1;return r.startsWith(`//`)&&(a=!0,r=`/`+r.replace(/^\/+/,``)),{path:r,handledProtocolRelativeURL:a}}function j(e){return/\s|[^\u0000-\u007F]/.test(e)?e.replace(/\s|[^\u0000-\u007F]/gu,encodeURIComponent):e}function re(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function ie(){throw Error(`Invariant failed`)}var M=u(),N=e(t(),1),P=N.createContext(void 0),F=N.createContext(void 0);function I(e,t){return e===t}function L(e,t,n=I){let r=(0,N.useCallback)(t=>{if(!e)return()=>{};let{unsubscribe:n}=e.subscribe(t);return n},[e]),i=(0,N.useCallback)(()=>e?.get(),[e]);return(0,M.useSyncExternalStoreWithSelector)(r,i,i,t,n)}var R={};function z(e,t){let n=N.useRef();return r=>{let i=e?.select?e.select(r):r;return e?.structuralSharing??t.options.defaultStructuralSharing?n.current=x(n.current,i):i}}function B(e){let t=p(),n=N.useContext(e.from?F:P),r=e.from??n,i=t.stores.getMatchStore(r),a=z(e,t),o=L(i,e=>e?a(e):R);if(o!==R)return o;(e.shouldThrow??!0)&&ie()}function V(e){return B({from:e.from,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,strict:e.strict,select:t=>{let n=e.strict===!1?t.params:t._strictParams;return e.select?e.select(n):n}})}function H(e){return{environmentId:e.environmentId,threadId:e.threadId}}function ae(e){return{draftId:e}}function oe(e){return!e.environmentId||!e.threadId?null:n(e.environmentId,e.threadId)}function U(e){return e.environmentId&&e.threadId?{kind:`server`,threadRef:n(e.environmentId,e.threadId)}:e.draftId?{kind:`draft`,draftId:e.draftId}:null}function W(e,t=!1){let{overflowY:n}=s(e);return n!==`auto`&&n!==`scroll`?!1:t?e.clientHeight>0:e.scrollHeight>e.clientHeight}function G(e,t=!1){let{overflowX:n}=s(e);return n!==`auto`&&n!==`scroll`?!1:t?e.clientWidth>0:e.scrollWidth>e.clientWidth}function K(e,t,n=!1){return t===`vertical`?W(e,n):G(e,n)}function se(e,t,n){let i=e;for(;r(i)&&i!==t&&!l(i);){for(let e of n)if(K(i,e))return!0;i=a(i)}return!1}function q(e,t,n=`vertical`,i=!1){let o=r(e)?e:null;for(;r(o)&&o!==t&&!l(o);){if(K(o,n,i))return o;o=a(o)}return K(t,n,i)?t:null}function ce(e,t,n){return typeof e?.elementFromPoint==`function`?e.elementFromPoint(t,n):null}var le=40,ue=10,de=1,fe=50,pe=16,me=80,he=`button,a,input,select,textarea,label,[role="button"]`;function J(e,t,n){switch(e){case`up`:return-n;case`down`:return n;case`left`:return-t;case`right`:return t;default:return 0}}function ge(e){let t=c(e).getComputedStyle(e).transform,n=0,r=0,i=1;if(t&&t!==`none`){let e=t.match(/matrix(?:3d)?\(([^)]+)\)/);if(e){let t=e[1].split(`, `).map(parseFloat);t.length===6?(n=t[4],r=t[5],i=Math.sqrt(t[0]*t[0]+t[1]*t[1])):t.length===16&&(n=t[12],r=t[13],i=t[0])}}return{x:n,y:r,scale:i}}function _e(e){return Number.isFinite(e)&&e>0?e:null}function ve(e,t){return`translate3d(${e.x}px,${e.y}px,0) scale(${t})`}function ye(e){return e%2==1}function be(e,t,n){let r=e[n];if(typeof r==`function`)try{r.call(e,t)}catch(e){if(e&&typeof e==`object`&&`name`in e&&e.name===`NotFoundError`)return;throw e}}function Y(e){let{enabled:t,directions:n,elementRef:r,movementCssVars:a,canStart:s,ignoreSelectorWhenTouch:c=!0,ignoreScrollableAncestors:l=!1,swipeThreshold:u,onDismiss:p,onProgress:h,onCancel:g,onSwipeStart:_,onRelease:v,onSwipingChange:ee,trackDrag:y=!0}=e,b=he,x=n.length===1?n[0]:void 0,S=Math.max(0,typeof u==`number`?u:le),C=n.includes(`left`),w=n.includes(`right`),T=n.includes(`up`),E=n.includes(`down`),D=C||w,O=T||E,k=N.useMemo(()=>{let e=[];return O&&e.push(`vertical`),D&&e.push(`horizontal`),e},[D,O]),[te,A]=N.useState(void 0),[ne,j]=N.useState(!1),[re,ie]=N.useState(!1),M=N.useRef({x:0,y:0}),P=N.useRef({x:0,y:0}),F=N.useRef(null),I=N.useRef({x:0,y:0,scale:1}),L=N.useRef(void 0),R=N.useRef(0),z=N.useRef(!1),B=N.useRef({x:0,y:0}),V=N.useRef(null),H=N.useRef(!1),ae=N.useRef(!1),oe=N.useRef(null),U=N.useRef(!1),W=N.useRef(!1),G=N.useRef({width:0,height:0}),K=N.useRef(0),Y=N.useRef(S),xe=N.useRef(null),Se=N.useRef(null),Ce=N.useRef(null),we=N.useRef({x:0,y:0}),Te=N.useRef(null),X=N.useRef(!1),Ee=N.useRef(null),De=o(e=>{X.current!==e&&(X.current=e,j(e),ee?.(e))});function Oe(e){if(!e)return;let t=r.current,n=xe.current;if(!t||!n)return;let i=n({element:t,direction:e});Y.current=Math.max(0,i)}let Z=o((e,t)=>{let n=Number.isFinite(e)?m(e,0,1):0,r=n!==K.current,i=!1;if(t){let e=Te.current;i=!e||e.deltaX!==t.deltaX||e.deltaY!==t.deltaY||e.direction!==t.direction}!r&&!i||(K.current=n,t?Te.current=t:r&&(Te.current=null),h?.(n,t))}),Q=o(e=>{let t=r.current;if(!y||!t){e||(Ee.current=null);return}let n=t.style,i=Ee.current;e?(i||(Ee.current=[n.transition,n.transform]),n.transition=`none`):i&&([n.transition,n.transform]=i,Ee.current=null);let o=P.current,s=I.current,c=o.x-s.x,l=o.y-s.y;e&&(n.transform=ve(o,s.scale)),n.setProperty(a.x,`${c}px`),n.setProperty(a.y,`${l}px`)});function ke(e,t){if(t===null)return;let n=Ce.current;if(n&&t>n.time){let r=Math.max(t-n.time,pe);we.current={x:(e.x-n.x)/r,y:(e.y-n.y)/r}}Ce.current={x:e.x,y:e.y,time:t}}let Ae=N.useCallback(()=>{A(void 0),De(!1),ie(!1),Z(0),Y.current=S,xe.current=null,M.current={x:0,y:0},P.current={x:0,y:0},I.current={x:0,y:0,scale:1},L.current=void 0,R.current=0,z.current=!1,B.current={x:0,y:0},V.current=null,H.current=!1,F.current=null,ae.current=!1,oe.current=null,U.current=!1,W.current=!1,G.current={width:0,height:0},Se.current=null,Ce.current=null,we.current={x:0,y:0},Te.current=null,Q(!1)},[De,S,Q,Z]);function je(e){if(`touches`in e){let t=e.touches[0];return t?{x:t.clientX,y:t.clientY}:null}return{x:e.clientX,y:e.clientY}}function Me(e){return`touches`in e||e.pointerType===`touch`}function Ne(e,t){let n=r.current?.getRootNode();return ce(n,e.x,e.y)??i(t)}function Pe(e,t){return D&&!O?q(e,t,`horizontal`):O&&!D?q(e,t,`vertical`):q(e,t,`vertical`)??q(e,t,`horizontal`)}function Fe(e,t,n){U.current=!1;let i=Me(e),a=Ne(t,e.nativeEvent),o=d(r.current).body,s=i&&o?Pe(a,o):null,f=n?.ignoreScrollableTarget??!1;if(s&&!f||(U.current=!!(s&&f),a&&a.closest(b)&&(!i||c)))return!1;let p=r.current;if(l&&p&&a&&k.length>0&&!(n?.ignoreScrollableAncestors??!1)&&se(a,p,k))return!1;if(z.current=!1,L.current=void 0,R.current=0,M.current=t,Se.current=_e(e.timeStamp),B.current=t,F.current=t,Y.current=S,xe.current=typeof u==`function`?u:null,p){G.current={width:p.offsetWidth,height:p.offsetHeight},Oe(x);let t=ge(p);I.current=t,P.current={x:t.x,y:t.y},ke({x:t.x,y:t.y},Se.current),`touches`in e||be(p,e.pointerId,`setPointerCapture`)}return _?.(e.nativeEvent),De(!0),V.current=null,H.current=!0,Z(0),Q(!0),!0}function Ie(){Le(),U.current=!1,F.current=null}function Le(){ae.current=!1,oe.current=null}function Re(e){if(Ie(),!X.current)return;De(!1),V.current=null;let t=I.current;P.current={x:t.x,y:t.y},A(void 0),W.current=!1,Q(!1);let n=r.current;n&&be(n,e.pointerId,`releasePointerCapture`),Z(0,{deltaX:0,deltaY:0,direction:void 0}),g?.(e.nativeEvent)}function ze(e,t){let n=e=>Math.sign(e)*Math.abs(e)**.5,r=(e,t,r)=>!t&&e<0||!r&&e>0?n(e):e;return{x:D?r(e,C,w):n(e),y:O?r(t,T,E):n(t)}}function Be(e,t,n){let r=(e,t,n,r,i)=>e>0&&t<=0&&r||e<0&&t>=Math.max(0,n)&&i,i=Math.abs(t),a=Math.abs(n);return O&&n!==0&&(!D||a>=i)?r(n,e.scrollTop,e.scrollHeight-e.clientHeight,E,T):D&&t!==0&&(!O||i>a)?r(t,e.scrollLeft,e.scrollWidth-e.clientWidth,w,C):null}let Ve=o(e=>{if(!t||e.defaultPrevented||e.nativeEvent.defaultPrevented||!(`touches`in e)&&e.button!==0)return;let n=je(e);n&&(ae.current=!0,oe.current=n,U.current=!1,W.current=!(`touches`in e),(!s||s(n,{nativeEvent:e.nativeEvent,direction:x}))&&Fe(e,n)&&Le())});function He(e,n,r){if(!t||!X.current)return;let a=i(e.nativeEvent);if(Me(e)&&!U.current){let t=e.currentTarget;if(Pe(a,t))return}if(`touches`in e||e.preventDefault(),H.current&&(H.current=!1,y)){M.current=n;let t=_e(e.timeStamp);t!==null&&(Se.current=t)}let o=n.x,s=n.y,c=r.x,l=r.y;(l<0&&s>B.current.y||l>0&&s<B.current.y)&&(B.current={x:B.current.x,y:s}),(c<0&&o>B.current.x||c>0&&o<B.current.x)&&(B.current={x:o,y:B.current.y});let u=o-M.current.x,d=s-M.current.y,f=s-B.current.y,p=o-B.current.x,m=V.current;m===null&&D&&O&&Math.sqrt(u*u+d*d)>=de&&(m=Math.abs(u)>Math.abs(d)?`horizontal`:`vertical`,V.current=m);let h;if(!L.current)m===`vertical`?d>0?h=`down`:d<0&&(h=`up`):m===`horizontal`?u>0?h=`right`:u<0&&(h=`left`):h=Math.abs(u)>=Math.abs(d)?u>0?`right`:`left`:d>0?`down`:`up`,h&&(h===`left`&&C||h===`right`&&w||h===`up`&&T||h===`down`&&E)&&(L.current=h,R.current=J(h,u,d),A(h),Oe(h));else{let e=L.current,t=J(e,p,f);t>Y.current?(z.current=!1,A(e)):!(C&&w)&&!(T&&E)&&R.current-t>=ue&&(z.current=!0)}let g=ze(u,d),_=I.current.x,v=I.current.y;m===`horizontal`?D&&(_+=g.x):(m===`vertical`||D&&(_+=g.x),O&&(v+=g.y));let ee=P.current,b=_!==ee.x||v!==ee.y;P.current={x:_,y:v},b&&Q(!0),ke({x:_,y:v},_e(e.timeStamp));let S=_-I.current.x,k=v-I.current.y,te={deltaX:S,deltaY:k,direction:L.current},ne=0,j=x??L.current;if(j){let e=j===`left`||j===`right`?G.current.width:G.current.height,t=I.current.scale||1,n=J(j,S,k);e>0&&t>0&&n>0&&(ne=n/(e*t))}Z(ne,te)}let $=o(e=>{if(!t)return;let i=P.current,a=I.current,o=i.x-a.x,s=i.y-a.y,c={deltaX:o,deltaY:s,direction:L.current};if(!X.current){Ie(),Z(0,c);return}De(!1),V.current=null,Ie(),W.current=!1;let l=r.current;l&&(`touches`in e||be(l,e.pointerId,`releasePointerCapture`));let u=o,d=s,f=Se.current,m=_e(e.timeStamp),h=f!==null&&m!==null&&m>f?m-f:0,g=h>0?Math.max(h,fe):0,_=g>0?u/g:0,ee=g>0?d/g:0,y=we.current.x,b=we.current.y,S=Ce.current;if(S&&m!==null&&m>=S.time){let e=m-S.time;if(e<=me){let t=Math.max(e,pe),n=i.x-S.x,r=i.y-S.y,a=n/t,o=r/t;a!==0&&(y=a),o!==0&&(b=o)}else y=0,b=0}let C=v?.({event:e.nativeEvent,direction:L.current,deltaX:u,deltaY:d,velocityX:_,velocityY:ee,releaseVelocityX:y,releaseVelocityY:b}),w=typeof C==`boolean`;if(z.current&&!w){P.current={x:a.x,y:a.y},A(void 0),Q(!1),Z(0,c);return}let T=!1,E;if(w)T=C,E=L.current??x;else for(let e of n)if(J(e,u,d)>Y.current){T=!0,E=e;break}T&&E?(A(E),ie(!0),Q(!1),p?.(e.nativeEvent,{direction:E})):(P.current={x:a.x,y:a.y},A(void 0),Q(!1),Z(0,c))}),Ue=o(e=>{let t=je(e);if(!t)return;let n=!1;if(!(`touches`in e)){let t=ye(e.buttons);if(t&&(W.current=!0),e.buttons!==0&&!t){Re(e);return}if(e.buttons===0&&W.current){if(!X.current){$(e);return}n=!0}}if(!ne&&ae.current){if(!Me(e)&&(e.defaultPrevented||e.nativeEvent.defaultPrevented)){Ie();return}if(!s||s(t,{nativeEvent:e.nativeEvent,direction:x})){let n=oe.current,i=!1;if(Me(e)){let a=r.current;if(n&&a){let r=Ne(t,e.nativeEvent),o=d(a).body,s=o?Pe(r,o):null;if(s&&(f(a,s)||f(s,a))){let e=Be(s,t.x-n.x,t.y-n.y);if(e===!1)return;e===!0&&(i=!0)}}}Fe(e,t,{ignoreScrollableTarget:i,ignoreScrollableAncestors:i})&&(n&&i?(Le(),M.current=n,B.current=n,F.current=n,H.current=!1):(Le(),U.current=!1))}}let i=F.current,a=i===null?{x:0,y:0}:{x:t.x-i.x,y:t.y-i.y};F.current=t,He(e,t,a),n&&!(`touches`in e)&&$(e)}),We=o((e,t)=>{Ue({touches:e.touches,currentTarget:t,nativeEvent:e,defaultPrevented:e.defaultPrevented,timeStamp:e.timeStamp})}),Ge=N.useCallback(()=>{let e=X.current,t=P.current,n=I.current,r=t.x-n.x,i=t.y-n.y;return!e&&r===0&&i===0&&!re?{[a.x]:`0px`,[a.y]:`0px`}:{transition:e?`none`:void 0,transform:e?ve(t,n.scale):void 0,[a.x]:`${r}px`,[a.y]:`${i}px`}},[re,a]);return{swiping:ne,swipeDirection:te,dragDismissed:re,getPointerProps:N.useCallback(()=>t?{onPointerDown:Ve,onPointerMove:Ue,onPointerUp:$,onPointerCancel:$}:{},[t,$,Ue,Ve]),getTouchProps:N.useCallback(()=>t?{onTouchStart:Ve,onTouchMove:Ue,onTouchEnd:$,onTouchCancel:$}:{},[t,$,Ue,Ve]),moveNative:We,getDragStyles:Ge,reset:Ae}}export{ee as C,x as D,b as E,g as S,h as T,te as _,q as a,E as b,H as c,V as d,B as f,ie as g,P as h,ce as i,oe as l,L as m,ge as n,W as o,z as p,Y as r,ae as s,J as t,U as u,re as v,A as w,j as x,ne as y};
1
+ import{i as e,t}from"./react-SIfiwpqq.js";import{_ as n}from"./env-B4arEvJg.js";import{Bn as r,Bt as i,Ln as a,Nn as o,Pn as s,Rn as c,Vn as l,Zn as u,jn as d,zt as f}from"./usePopupViewport-BuhsNdVy.js";import{t as p}from"./useRouter-CcIDS3PN.js";import{t as m}from"./clamp-CgH0Dl6R.js";function h(e){return e[e.length-1]}function g(e,t){return typeof e==`function`?e(t):e}var _=Object.prototype.hasOwnProperty,v=Object.prototype.propertyIsEnumerable;function ee(e){for(let t in e)if(_.call(e,t))return!0;return!1}var y=()=>Object.create(null),b=(e,t)=>x(e,t,y);function x(e,t,n=()=>({}),r=0){if(e===t)return e;if(r>500)return t;let i=t,a=T(e)&&T(i);if(!a&&!(C(e)&&C(i)))return i;let o=a?e:S(e);if(!o)return i;let s=a?i:S(i);if(!s)return i;let c=o.length,l=s.length,u=a?Array(l):n(),d=0;for(let t=0;t<l;t++){let o=a?t:s[t],l=e[o],f=i[o];if(l===f){u[o]=l,(a?t<c:_.call(e,o))&&d++;continue}if(l===null||f===null||typeof l!=`object`||typeof f!=`object`){u[o]=f;continue}let p=x(l,f,n,r+1);u[o]=p,p===l&&d++}return c===l&&d===c?e:u}function S(e){let t=Object.keys(e);if(t.length!==Object.getOwnPropertyNames(e).length)return!1;let n=Object.getOwnPropertySymbols(e);if(n.length===0)return t;for(let r of n){if(!v.call(e,r))return!1;t.push(r)}return t}function C(e){if(!w(e))return!1;let t=e.constructor;if(t===void 0)return!0;let n=t.prototype;return!(!w(n)||!n.hasOwnProperty(`isPrototypeOf`))}function w(e){return Object.prototype.toString.call(e)===`[object Object]`}function T(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function E(e,t,n){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(let r=0,i=e.length;r<i;r++)if(!E(e[r],t[r],n))return!1;return!0}if(C(e)&&C(t)){let r=n?.ignoreUndefined??!0;if(n?.partial){for(let i in t)if((!r||t[i]!==void 0)&&!E(e[i],t[i],n))return!1;return!0}let i=0;if(!r)i=Object.keys(e).length;else for(let t in e)e[t]!==void 0&&i++;let a=0;for(let o in t)if((!r||t[o]!==void 0)&&(a++,a>i||!E(e[o],t[o],n)))return!1;return i===a}return!1}var D=/[\x00-\x1f\x7f"<>`{}]/g;function O(e){return e.replace(D,e=>`%`+e.charCodeAt(0).toString(16).toUpperCase().padStart(2,`0`))}function k(e){let t;try{t=decodeURI(e)}catch{t=e.replaceAll(/%[0-9A-F]{2}/gi,e=>{try{return decodeURI(e)}catch{return e}})}return O(t)}var te=[`http:`,`https:`,`mailto:`,`tel:`];function A(e,t){if(!e)return!1;try{let n=new URL(e);return!t.has(n.protocol)}catch{return!1}}function ne(e){if(!e||!/[%\\\x00-\x1f\x7f]/.test(e)&&!e.startsWith(`//`))return{path:e,handledProtocolRelativeURL:!1};let t=/%25|%5C/gi,n=0,r=``,i;for(;(i=t.exec(e))!==null;)r+=k(e.slice(n,i.index))+i[0],n=t.lastIndex;r+=k(n?e.slice(n):e);let a=!1;return r.startsWith(`//`)&&(a=!0,r=`/`+r.replace(/^\/+/,``)),{path:r,handledProtocolRelativeURL:a}}function j(e){return/\s|[^\u0000-\u007F]/.test(e)?e.replace(/\s|[^\u0000-\u007F]/gu,encodeURIComponent):e}function re(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function ie(){throw Error(`Invariant failed`)}var M=u(),N=e(t(),1),P=N.createContext(void 0),F=N.createContext(void 0);function I(e,t){return e===t}function L(e,t,n=I){let r=(0,N.useCallback)(t=>{if(!e)return()=>{};let{unsubscribe:n}=e.subscribe(t);return n},[e]),i=(0,N.useCallback)(()=>e?.get(),[e]);return(0,M.useSyncExternalStoreWithSelector)(r,i,i,t,n)}var R={};function z(e,t){let n=N.useRef();return r=>{let i=e?.select?e.select(r):r;return e?.structuralSharing??t.options.defaultStructuralSharing?n.current=x(n.current,i):i}}function B(e){let t=p(),n=N.useContext(e.from?F:P),r=e.from??n,i=t.stores.getMatchStore(r),a=z(e,t),o=L(i,e=>e?a(e):R);if(o!==R)return o;(e.shouldThrow??!0)&&ie()}function V(e){return B({from:e.from,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,strict:e.strict,select:t=>{let n=e.strict===!1?t.params:t._strictParams;return e.select?e.select(n):n}})}function H(e){return{environmentId:e.environmentId,threadId:e.threadId}}function ae(e){return{draftId:e}}function oe(e){return!e.environmentId||!e.threadId?null:n(e.environmentId,e.threadId)}function U(e){return e.environmentId&&e.threadId?{kind:`server`,threadRef:n(e.environmentId,e.threadId)}:e.draftId?{kind:`draft`,draftId:e.draftId}:null}function W(e,t=!1){let{overflowY:n}=s(e);return n!==`auto`&&n!==`scroll`?!1:t?e.clientHeight>0:e.scrollHeight>e.clientHeight}function G(e,t=!1){let{overflowX:n}=s(e);return n!==`auto`&&n!==`scroll`?!1:t?e.clientWidth>0:e.scrollWidth>e.clientWidth}function K(e,t,n=!1){return t===`vertical`?W(e,n):G(e,n)}function se(e,t,n){let i=e;for(;r(i)&&i!==t&&!l(i);){for(let e of n)if(K(i,e))return!0;i=a(i)}return!1}function q(e,t,n=`vertical`,i=!1){let o=r(e)?e:null;for(;r(o)&&o!==t&&!l(o);){if(K(o,n,i))return o;o=a(o)}return K(t,n,i)?t:null}function ce(e,t,n){return typeof e?.elementFromPoint==`function`?e.elementFromPoint(t,n):null}var le=40,ue=10,de=1,fe=50,pe=16,me=80,he=`button,a,input,select,textarea,label,[role="button"]`;function J(e,t,n){switch(e){case`up`:return-n;case`down`:return n;case`left`:return-t;case`right`:return t;default:return 0}}function ge(e){let t=c(e).getComputedStyle(e).transform,n=0,r=0,i=1;if(t&&t!==`none`){let e=t.match(/matrix(?:3d)?\(([^)]+)\)/);if(e){let t=e[1].split(`, `).map(parseFloat);t.length===6?(n=t[4],r=t[5],i=Math.sqrt(t[0]*t[0]+t[1]*t[1])):t.length===16&&(n=t[12],r=t[13],i=t[0])}}return{x:n,y:r,scale:i}}function _e(e){return Number.isFinite(e)&&e>0?e:null}function ve(e,t){return`translate3d(${e.x}px,${e.y}px,0) scale(${t})`}function ye(e){return e%2==1}function be(e,t,n){let r=e[n];if(typeof r==`function`)try{r.call(e,t)}catch(e){if(e&&typeof e==`object`&&`name`in e&&e.name===`NotFoundError`)return;throw e}}function Y(e){let{enabled:t,directions:n,elementRef:r,movementCssVars:a,canStart:s,ignoreSelectorWhenTouch:c=!0,ignoreScrollableAncestors:l=!1,swipeThreshold:u,onDismiss:p,onProgress:h,onCancel:g,onSwipeStart:_,onRelease:v,onSwipingChange:ee,trackDrag:y=!0}=e,b=he,x=n.length===1?n[0]:void 0,S=Math.max(0,typeof u==`number`?u:le),C=n.includes(`left`),w=n.includes(`right`),T=n.includes(`up`),E=n.includes(`down`),D=C||w,O=T||E,k=N.useMemo(()=>{let e=[];return O&&e.push(`vertical`),D&&e.push(`horizontal`),e},[D,O]),[te,A]=N.useState(void 0),[ne,j]=N.useState(!1),[re,ie]=N.useState(!1),M=N.useRef({x:0,y:0}),P=N.useRef({x:0,y:0}),F=N.useRef(null),I=N.useRef({x:0,y:0,scale:1}),L=N.useRef(void 0),R=N.useRef(0),z=N.useRef(!1),B=N.useRef({x:0,y:0}),V=N.useRef(null),H=N.useRef(!1),ae=N.useRef(!1),oe=N.useRef(null),U=N.useRef(!1),W=N.useRef(!1),G=N.useRef({width:0,height:0}),K=N.useRef(0),Y=N.useRef(S),xe=N.useRef(null),Se=N.useRef(null),Ce=N.useRef(null),we=N.useRef({x:0,y:0}),Te=N.useRef(null),X=N.useRef(!1),Ee=N.useRef(null),De=o(e=>{X.current!==e&&(X.current=e,j(e),ee?.(e))});function Oe(e){if(!e)return;let t=r.current,n=xe.current;if(!t||!n)return;let i=n({element:t,direction:e});Y.current=Math.max(0,i)}let Z=o((e,t)=>{let n=Number.isFinite(e)?m(e,0,1):0,r=n!==K.current,i=!1;if(t){let e=Te.current;i=!e||e.deltaX!==t.deltaX||e.deltaY!==t.deltaY||e.direction!==t.direction}!r&&!i||(K.current=n,t?Te.current=t:r&&(Te.current=null),h?.(n,t))}),Q=o(e=>{let t=r.current;if(!y||!t){e||(Ee.current=null);return}let n=t.style,i=Ee.current;e?(i||(Ee.current=[n.transition,n.transform]),n.transition=`none`):i&&([n.transition,n.transform]=i,Ee.current=null);let o=P.current,s=I.current,c=o.x-s.x,l=o.y-s.y;e&&(n.transform=ve(o,s.scale)),n.setProperty(a.x,`${c}px`),n.setProperty(a.y,`${l}px`)});function ke(e,t){if(t===null)return;let n=Ce.current;if(n&&t>n.time){let r=Math.max(t-n.time,pe);we.current={x:(e.x-n.x)/r,y:(e.y-n.y)/r}}Ce.current={x:e.x,y:e.y,time:t}}let Ae=N.useCallback(()=>{A(void 0),De(!1),ie(!1),Z(0),Y.current=S,xe.current=null,M.current={x:0,y:0},P.current={x:0,y:0},I.current={x:0,y:0,scale:1},L.current=void 0,R.current=0,z.current=!1,B.current={x:0,y:0},V.current=null,H.current=!1,F.current=null,ae.current=!1,oe.current=null,U.current=!1,W.current=!1,G.current={width:0,height:0},Se.current=null,Ce.current=null,we.current={x:0,y:0},Te.current=null,Q(!1)},[De,S,Q,Z]);function je(e){if(`touches`in e){let t=e.touches[0];return t?{x:t.clientX,y:t.clientY}:null}return{x:e.clientX,y:e.clientY}}function Me(e){return`touches`in e||e.pointerType===`touch`}function Ne(e,t){let n=r.current?.getRootNode();return ce(n,e.x,e.y)??i(t)}function Pe(e,t){return D&&!O?q(e,t,`horizontal`):O&&!D?q(e,t,`vertical`):q(e,t,`vertical`)??q(e,t,`horizontal`)}function Fe(e,t,n){U.current=!1;let i=Me(e),a=Ne(t,e.nativeEvent),o=d(r.current).body,s=i&&o?Pe(a,o):null,f=n?.ignoreScrollableTarget??!1;if(s&&!f||(U.current=!!(s&&f),a&&a.closest(b)&&(!i||c)))return!1;let p=r.current;if(l&&p&&a&&k.length>0&&!(n?.ignoreScrollableAncestors??!1)&&se(a,p,k))return!1;if(z.current=!1,L.current=void 0,R.current=0,M.current=t,Se.current=_e(e.timeStamp),B.current=t,F.current=t,Y.current=S,xe.current=typeof u==`function`?u:null,p){G.current={width:p.offsetWidth,height:p.offsetHeight},Oe(x);let t=ge(p);I.current=t,P.current={x:t.x,y:t.y},ke({x:t.x,y:t.y},Se.current),`touches`in e||be(p,e.pointerId,`setPointerCapture`)}return _?.(e.nativeEvent),De(!0),V.current=null,H.current=!0,Z(0),Q(!0),!0}function Ie(){Le(),U.current=!1,F.current=null}function Le(){ae.current=!1,oe.current=null}function Re(e){if(Ie(),!X.current)return;De(!1),V.current=null;let t=I.current;P.current={x:t.x,y:t.y},A(void 0),W.current=!1,Q(!1);let n=r.current;n&&be(n,e.pointerId,`releasePointerCapture`),Z(0,{deltaX:0,deltaY:0,direction:void 0}),g?.(e.nativeEvent)}function ze(e,t){let n=e=>Math.sign(e)*Math.abs(e)**.5,r=(e,t,r)=>!t&&e<0||!r&&e>0?n(e):e;return{x:D?r(e,C,w):n(e),y:O?r(t,T,E):n(t)}}function Be(e,t,n){let r=(e,t,n,r,i)=>e>0&&t<=0&&r||e<0&&t>=Math.max(0,n)&&i,i=Math.abs(t),a=Math.abs(n);return O&&n!==0&&(!D||a>=i)?r(n,e.scrollTop,e.scrollHeight-e.clientHeight,E,T):D&&t!==0&&(!O||i>a)?r(t,e.scrollLeft,e.scrollWidth-e.clientWidth,w,C):null}let Ve=o(e=>{if(!t||e.defaultPrevented||e.nativeEvent.defaultPrevented||!(`touches`in e)&&e.button!==0)return;let n=je(e);n&&(ae.current=!0,oe.current=n,U.current=!1,W.current=!(`touches`in e),(!s||s(n,{nativeEvent:e.nativeEvent,direction:x}))&&Fe(e,n)&&Le())});function He(e,n,r){if(!t||!X.current)return;let a=i(e.nativeEvent);if(Me(e)&&!U.current){let t=e.currentTarget;if(Pe(a,t))return}if(`touches`in e||e.preventDefault(),H.current&&(H.current=!1,y)){M.current=n;let t=_e(e.timeStamp);t!==null&&(Se.current=t)}let o=n.x,s=n.y,c=r.x,l=r.y;(l<0&&s>B.current.y||l>0&&s<B.current.y)&&(B.current={x:B.current.x,y:s}),(c<0&&o>B.current.x||c>0&&o<B.current.x)&&(B.current={x:o,y:B.current.y});let u=o-M.current.x,d=s-M.current.y,f=s-B.current.y,p=o-B.current.x,m=V.current;m===null&&D&&O&&Math.sqrt(u*u+d*d)>=de&&(m=Math.abs(u)>Math.abs(d)?`horizontal`:`vertical`,V.current=m);let h;if(!L.current)m===`vertical`?d>0?h=`down`:d<0&&(h=`up`):m===`horizontal`?u>0?h=`right`:u<0&&(h=`left`):h=Math.abs(u)>=Math.abs(d)?u>0?`right`:`left`:d>0?`down`:`up`,h&&(h===`left`&&C||h===`right`&&w||h===`up`&&T||h===`down`&&E)&&(L.current=h,R.current=J(h,u,d),A(h),Oe(h));else{let e=L.current,t=J(e,p,f);t>Y.current?(z.current=!1,A(e)):!(C&&w)&&!(T&&E)&&R.current-t>=ue&&(z.current=!0)}let g=ze(u,d),_=I.current.x,v=I.current.y;m===`horizontal`?D&&(_+=g.x):(m===`vertical`||D&&(_+=g.x),O&&(v+=g.y));let ee=P.current,b=_!==ee.x||v!==ee.y;P.current={x:_,y:v},b&&Q(!0),ke({x:_,y:v},_e(e.timeStamp));let S=_-I.current.x,k=v-I.current.y,te={deltaX:S,deltaY:k,direction:L.current},ne=0,j=x??L.current;if(j){let e=j===`left`||j===`right`?G.current.width:G.current.height,t=I.current.scale||1,n=J(j,S,k);e>0&&t>0&&n>0&&(ne=n/(e*t))}Z(ne,te)}let $=o(e=>{if(!t)return;let i=P.current,a=I.current,o=i.x-a.x,s=i.y-a.y,c={deltaX:o,deltaY:s,direction:L.current};if(!X.current){Ie(),Z(0,c);return}De(!1),V.current=null,Ie(),W.current=!1;let l=r.current;l&&(`touches`in e||be(l,e.pointerId,`releasePointerCapture`));let u=o,d=s,f=Se.current,m=_e(e.timeStamp),h=f!==null&&m!==null&&m>f?m-f:0,g=h>0?Math.max(h,fe):0,_=g>0?u/g:0,ee=g>0?d/g:0,y=we.current.x,b=we.current.y,S=Ce.current;if(S&&m!==null&&m>=S.time){let e=m-S.time;if(e<=me){let t=Math.max(e,pe),n=i.x-S.x,r=i.y-S.y,a=n/t,o=r/t;a!==0&&(y=a),o!==0&&(b=o)}else y=0,b=0}let C=v?.({event:e.nativeEvent,direction:L.current,deltaX:u,deltaY:d,velocityX:_,velocityY:ee,releaseVelocityX:y,releaseVelocityY:b}),w=typeof C==`boolean`;if(z.current&&!w){P.current={x:a.x,y:a.y},A(void 0),Q(!1),Z(0,c);return}let T=!1,E;if(w)T=C,E=L.current??x;else for(let e of n)if(J(e,u,d)>Y.current){T=!0,E=e;break}T&&E?(A(E),ie(!0),Q(!1),p?.(e.nativeEvent,{direction:E})):(P.current={x:a.x,y:a.y},A(void 0),Q(!1),Z(0,c))}),Ue=o(e=>{let t=je(e);if(!t)return;let n=!1;if(!(`touches`in e)){let t=ye(e.buttons);if(t&&(W.current=!0),e.buttons!==0&&!t){Re(e);return}if(e.buttons===0&&W.current){if(!X.current){$(e);return}n=!0}}if(!ne&&ae.current){if(!Me(e)&&(e.defaultPrevented||e.nativeEvent.defaultPrevented)){Ie();return}if(!s||s(t,{nativeEvent:e.nativeEvent,direction:x})){let n=oe.current,i=!1;if(Me(e)){let a=r.current;if(n&&a){let r=Ne(t,e.nativeEvent),o=d(a).body,s=o?Pe(r,o):null;if(s&&(f(a,s)||f(s,a))){let e=Be(s,t.x-n.x,t.y-n.y);if(e===!1)return;e===!0&&(i=!0)}}}Fe(e,t,{ignoreScrollableTarget:i,ignoreScrollableAncestors:i})&&(n&&i?(Le(),M.current=n,B.current=n,F.current=n,H.current=!1):(Le(),U.current=!1))}}let i=F.current,a=i===null?{x:0,y:0}:{x:t.x-i.x,y:t.y-i.y};F.current=t,He(e,t,a),n&&!(`touches`in e)&&$(e)}),We=o((e,t)=>{Ue({touches:e.touches,currentTarget:t,nativeEvent:e,defaultPrevented:e.defaultPrevented,timeStamp:e.timeStamp})}),Ge=N.useCallback(()=>{let e=X.current,t=P.current,n=I.current,r=t.x-n.x,i=t.y-n.y;return!e&&r===0&&i===0&&!re?{[a.x]:`0px`,[a.y]:`0px`}:{transition:e?`none`:void 0,transform:e?ve(t,n.scale):void 0,[a.x]:`${r}px`,[a.y]:`${i}px`}},[re,a]);return{swiping:ne,swipeDirection:te,dragDismissed:re,getPointerProps:N.useCallback(()=>t?{onPointerDown:Ve,onPointerMove:Ue,onPointerUp:$,onPointerCancel:$}:{},[t,$,Ue,Ve]),getTouchProps:N.useCallback(()=>t?{onTouchStart:Ve,onTouchMove:Ue,onTouchEnd:$,onTouchCancel:$}:{},[t,$,Ue,Ve]),moveNative:We,getDragStyles:Ge,reset:Ae}}export{ee as C,x as D,b as E,g as S,h as T,te as _,q as a,E as b,H as c,V as d,B as f,ie as g,P as h,ce as i,oe as l,L as m,ge as n,W as o,z as p,Y as r,ae as s,J as t,U as u,re as v,A as w,j as x,ne as y};
@@ -1,2 +1,2 @@
1
- import{i as e,t}from"./react-SIfiwpqq.js";import{_ as n,g as r,h as i}from"./env-B4arEvJg.js";import{Jt as a,Rn as o,Sn as s,St as c,Ut as l,hn as u,qt as d}from"./runtime-CqhG6EOG.js";import{i as f}from"./composerDraftStore-BaAeiPHc.js";import{i as p}from"./utils-BPUctpTG.js";import{c as m,l as h}from"./useSwipeDismiss-DESLmDpT.js";import{n as g,w as _}from"./useHandleNewThread-CzfIpG9Y.js";import{t as v}from"./useRouter-CcIDS3PN.js";import{i as y}from"./toast-Bnfw8LOb.js";import{t as b}from"./toastHelpers-CSQRKo4F.js";var x=e(t(),1);function S(){let e=o(e=>e.sidebarThreadSortOrder),t=o(e=>e.confirmThreadDelete),S=f(e=>e.clearDraftThread),C=f(e=>e.clearProjectDraftThreadById),w=c(e=>e.clearTerminalState),T=v(),{handleNewThread:E}=g(),D=(0,x.useRef)(E);D.current=E;let O=(0,x.useCallback)(e=>{let t=a.getState(),n=l(t,e);return n?{thread:n,threadRef:e}:null},[]),k=(0,x.useCallback)(()=>{let e=T.state.matches[T.state.matches.length-1]?.params??{};return h(e)},[T]),A=(0,x.useCallback)(async e=>{let t=u(e.environmentId);if(!t)return;let n=O(e);if(!n)return;let{thread:i,threadRef:a}=n;if(i.session?.status===`running`&&i.session.activeTurnId!=null)throw Error(`Cannot archive a running thread.`);await t.orchestration.dispatchCommand({type:`thread.archive`,commandId:p(),threadId:a.threadId});let o=k();o?.threadId===a.threadId&&o.environmentId===a.environmentId&&await D.current(r(i.environmentId,i.projectId))},[k,O]),j=(0,x.useCallback)(async e=>{let t=u(e.environmentId);t&&await t.orchestration.dispatchCommand({type:`thread.unarchive`,commandId:p(),threadId:e.threadId})},[]),M=(0,x.useCallback)(async(t,o={})=>{let s=u(t.environmentId);if(!s)return;let c=O(t);if(!c)return;let{thread:f,threadRef:h}=c,g=d(a.getState(),h.environmentId),v=o.deletedThreadKeys&&o.deletedThreadKeys.size>0?new Set([...o.deletedThreadKeys].flatMap(e=>{let t=i(e);return t&&t.environmentId===h.environmentId?[t.threadId]:[]})):void 0,x=k(),E=x?.threadId===h.threadId&&x.environmentId===h.environmentId,D=_({threads:g,deletedThreadId:h.threadId,deletedThreadIds:v??new Set,sortOrder:e}),A=s.orchestration.dispatchCommand({type:`thread.delete`,commandId:p(),threadId:h.threadId});if(o.optimistic){A.catch(e=>{y.add(b({type:`error`,title:`Failed to delete thread`,description:e instanceof Error?e.message:`An error occurred.`}))});let e=null;if(E){if(D){let t=l(a.getState(),n(h.environmentId,D));e=t?{kind:`fallback`,ref:n(t.environmentId,t.id)}:{kind:`home`}}else e={kind:`home`}}let t=()=>{a.getState().removeThread(h),S(h),C(r(h.environmentId,f.projectId),h),w(h)};e?(e.kind===`fallback`?T.navigate({to:`/$environmentId/$threadId`,params:m(e.ref),replace:!0}):T.navigate({to:`/`,replace:!0}),requestAnimationFrame(()=>{setTimeout(t,0)})):t();return}if(await A,S(h),C(r(h.environmentId,f.projectId),h),w(h),E){if(D){let e=l(a.getState(),n(h.environmentId,D));if(e){await T.navigate({to:`/$environmentId/$threadId`,params:m(n(e.environmentId,e.id)),replace:!0});return}}await T.navigate({to:`/`,replace:!0})}},[S,C,w,k,T,O,e]);return{archiveThread:A,unarchiveThread:j,deleteThread:M,confirmAndDeleteThread:(0,x.useCallback)(async e=>{if(!u(e.environmentId))return;let n=s(),r=O(e);if(!r)return;let{thread:i}=r;t&&n&&!await n.dialogs.confirm([`Delete thread "${i.title}"?`,`This permanently clears conversation history for this thread.`].join(`
1
+ import{i as e,t}from"./react-SIfiwpqq.js";import{_ as n,g as r,h as i}from"./env-B4arEvJg.js";import{Jt as a,Rn as o,Sn as s,St as c,Ut as l,hn as u,qt as d}from"./runtime-DfGHeCnR.js";import{i as f}from"./composerDraftStore-CdJJZe42.js";import{c as p,l as m}from"./useSwipeDismiss-CbgDJvw1.js";import{n as h,w as g}from"./useHandleNewThread-Bvz-DKgn.js";import{t as _}from"./useRouter-CcIDS3PN.js";import{i as v}from"./toast-CcSCAm4B.js";import{i as y}from"./utils-BofFIn5Y.js";import{t as b}from"./toastHelpers-CSQRKo4F.js";var x=e(t(),1);function S(){let e=o(e=>e.sidebarThreadSortOrder),t=o(e=>e.confirmThreadDelete),S=f(e=>e.clearDraftThread),C=f(e=>e.clearProjectDraftThreadById),w=c(e=>e.clearTerminalState),T=_(),{handleNewThread:E}=h(),D=(0,x.useRef)(E);D.current=E;let O=(0,x.useCallback)(e=>{let t=a.getState(),n=l(t,e);return n?{thread:n,threadRef:e}:null},[]),k=(0,x.useCallback)(()=>{let e=T.state.matches[T.state.matches.length-1]?.params??{};return m(e)},[T]),A=(0,x.useCallback)(async e=>{let t=u(e.environmentId);if(!t)return;let n=O(e);if(!n)return;let{thread:i,threadRef:a}=n;if(i.session?.status===`running`&&i.session.activeTurnId!=null)throw Error(`Cannot archive a running thread.`);await t.orchestration.dispatchCommand({type:`thread.archive`,commandId:y(),threadId:a.threadId});let o=k();o?.threadId===a.threadId&&o.environmentId===a.environmentId&&await D.current(r(i.environmentId,i.projectId))},[k,O]),j=(0,x.useCallback)(async e=>{let t=u(e.environmentId);t&&await t.orchestration.dispatchCommand({type:`thread.unarchive`,commandId:y(),threadId:e.threadId})},[]),M=(0,x.useCallback)(async(t,o={})=>{let s=u(t.environmentId);if(!s)return;let c=O(t);if(!c)return;let{thread:f,threadRef:m}=c,h=d(a.getState(),m.environmentId),_=o.deletedThreadKeys&&o.deletedThreadKeys.size>0?new Set([...o.deletedThreadKeys].flatMap(e=>{let t=i(e);return t&&t.environmentId===m.environmentId?[t.threadId]:[]})):void 0,x=k(),E=x?.threadId===m.threadId&&x.environmentId===m.environmentId,D=g({threads:h,deletedThreadId:m.threadId,deletedThreadIds:_??new Set,sortOrder:e}),A=s.orchestration.dispatchCommand({type:`thread.delete`,commandId:y(),threadId:m.threadId});if(o.optimistic){A.catch(e=>{v.add(b({type:`error`,title:`Failed to delete thread`,description:e instanceof Error?e.message:`An error occurred.`}))});let e=null;if(E){if(D){let t=l(a.getState(),n(m.environmentId,D));e=t?{kind:`fallback`,ref:n(t.environmentId,t.id)}:{kind:`home`}}else e={kind:`home`}}let t=()=>{a.getState().removeThread(m),S(m),C(r(m.environmentId,f.projectId),m),w(m)};e?(e.kind===`fallback`?T.navigate({to:`/$environmentId/$threadId`,params:p(e.ref),replace:!0}):T.navigate({to:`/`,replace:!0}),requestAnimationFrame(()=>{setTimeout(t,0)})):t();return}if(await A,S(m),C(r(m.environmentId,f.projectId),m),w(m),E){if(D){let e=l(a.getState(),n(m.environmentId,D));if(e){await T.navigate({to:`/$environmentId/$threadId`,params:p(n(e.environmentId,e.id)),replace:!0});return}}await T.navigate({to:`/`,replace:!0})}},[S,C,w,k,T,O,e]);return{archiveThread:A,unarchiveThread:j,deleteThread:M,confirmAndDeleteThread:(0,x.useCallback)(async e=>{if(!u(e.environmentId))return;let n=s(),r=O(e);if(!r)return;let{thread:i}=r;t&&n&&!await n.dialogs.confirm([`Delete thread "${i.title}"?`,`This permanently clears conversation history for this thread.`].join(`
2
2
  `))||await M(e)},[t,M,O])}}export{S as t};
@@ -1 +1 @@
1
- import{i as e,t}from"./react-SIfiwpqq.js";import{dt as n,ft as r,lt as i,mn as a,on as o,pt as s,zt as c}from"./usePopupViewport-CQTeg5Y-.js";import{t as l}from"./react-dom-x9LNwWQc.js";var u=e(t(),1),d=e(l(),1);function f(e,t){let l=u.useRef(null);function f(t){d.flushSync(()=>{e.setOpen(!1,o(a,t.nativeEvent,t.currentTarget))}),r(l.current)?.focus()}function p(r){let l=e.select(`positionerElement`);if(l&&s(r,l))e.context.beforeContentFocusGuardRef.current?.focus();else{d.flushSync(()=>{e.setOpen(!1,o(a,r.nativeEvent,r.currentTarget))});let s=n(e.context.triggerFocusTargetRef.current||t.current);for(;s!==null&&c(l,s);){let e=s;if(s=i(s),s===e)break}s?.focus()}}return{preFocusGuardRef:l,handlePreFocusGuardFocus:f,handleFocusTargetFocus:p}}export{f as t};
1
+ import{i as e,t}from"./react-SIfiwpqq.js";import{dt as n,ft as r,lt as i,mn as a,on as o,pt as s,zt as c}from"./usePopupViewport-BuhsNdVy.js";import{t as l}from"./react-dom-x9LNwWQc.js";var u=e(t(),1),d=e(l(),1);function f(e,t){let l=u.useRef(null);function f(t){d.flushSync(()=>{e.setOpen(!1,o(a,t.nativeEvent,t.currentTarget))}),r(l.current)?.focus()}function p(r){let l=e.select(`positionerElement`);if(l&&s(r,l))e.context.beforeContentFocusGuardRef.current?.focus();else{d.flushSync(()=>{e.setOpen(!1,o(a,r.nativeEvent,r.currentTarget))});let s=n(e.context.triggerFocusTargetRef.current||t.current);for(;s!==null&&c(l,s);){let e=s;if(s=i(s),s===e)break}s?.focus()}}return{preFocusGuardRef:l,handlePreFocusGuardFocus:f,handleFocusTargetFocus:p}}export{f as t};
@@ -1 +1 @@
1
- import{i as e,t}from"./react-SIfiwpqq.js";import{Mn as n,Nn as r}from"./usePopupViewport-CQTeg5Y-.js";var i=e(t(),1);function a(e,t){let a=i.useRef(e),o=r(t);n(()=>{a.current!==e&&o(a.current),a.current=e},[e,o])}export{a as t};
1
+ import{i as e,t}from"./react-SIfiwpqq.js";import{Mn as n,Nn as r}from"./usePopupViewport-BuhsNdVy.js";var i=e(t(),1);function a(e,t){let a=i.useRef(e),o=r(t);n(()=>{a.current!==e&&o(a.current),a.current=e},[e,o])}export{a as t};
@@ -0,0 +1 @@
1
+ import{Fr as e,Ir as t,Mr as n,Pr as r}from"./src-Vf4LVnMX.js";import{P as i}from"./composerDraftStore-CdJJZe42.js";function a(e){var t,n,r=``;if(typeof e==`string`||typeof e==`number`)r+=e;else if(typeof e==`object`){if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=a(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n)}return r}function o(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=a(e))&&(r&&(r+=` `),r+=t);return r}var s=e=>typeof e==`boolean`?`${e}`:e===0?`0`:e,c=o,l=(e,t)=>n=>{if(t?.variants==null)return c(e,n?.class,n?.className);let{variants:r,defaultVariants:i}=t,a=Object.keys(r).map(e=>{let t=n?.[e],a=i?.[e];if(t===null)return null;let o=s(t)||s(a);return r[e][o]}),o=n&&Object.entries(n).reduce((e,t)=>{let[n,r]=t;return r===void 0||(e[n]=r),e},{});return c(e,a,t?.compoundVariants?.reduce((e,t)=>{let{class:n,className:r,...a}=t;return Object.entries(a).every(e=>{let[t,n]=e;return Array.isArray(n)?n.includes({...i,...o}[t]):{...i,...o}[t]===n})?[...e,n,r]:e},[]),n?.class,n?.className)},u=(e,t)=>{let n=Array(e.length+t.length);for(let t=0;t<e.length;t++)n[t]=e[t];for(let r=0;r<t.length;r++)n[e.length+r]=t[r];return n},d=(e,t)=>({classGroupId:e,validator:t}),f=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),p=`-`,m=[],h=`arbitrary..`,g=e=>{let t=v(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:e=>{if(e.startsWith(`[`)&&e.endsWith(`]`))return ee(e);let n=e.split(p);return _(n,+(n[0]===``&&n.length>1),t)},getConflictingClassGroupIds:(e,t)=>{if(t){let t=r[e],i=n[e];return t?i?u(i,t):t:i||m}return n[e]||m}}},_=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;let r=e[t],i=n.nextPart.get(r);if(i){let n=_(e,t+1,i);if(n)return n}let a=n.validators;if(a===null)return;let o=t===0?e.join(p):e.slice(t).join(p),s=a.length;for(let e=0;e<s;e++){let t=a[e];if(t.validator(o))return t.classGroupId}},ee=e=>e.slice(1,-1).indexOf(`:`)===-1?void 0:(()=>{let t=e.slice(1,-1),n=t.indexOf(`:`),r=t.slice(0,n);return r?h+r:void 0})(),v=e=>{let{theme:t,classGroups:n}=e;return y(n,t)},y=(e,t)=>{let n=f();for(let r in e){let i=e[r];b(i,n,r,t)}return n},b=(e,t,n,r)=>{let i=e.length;for(let a=0;a<i;a++){let i=e[a];x(i,t,n,r)}},x=(e,t,n,r)=>{if(typeof e==`string`){S(e,t,n);return}if(typeof e==`function`){C(e,t,n,r);return}w(e,t,n,r)},S=(e,t,n)=>{let r=e===``?t:T(t,e);r.classGroupId=n},C=(e,t,n,r)=>{if(te(e)){b(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(d(n,e))},w=(e,t,n,r)=>{let i=Object.entries(e),a=i.length;for(let e=0;e<a;e++){let[a,o]=i[e];b(o,T(t,a),n,r)}},T=(e,t)=>{let n=e,r=t.split(p),i=r.length;for(let e=0;e<i;e++){let t=r[e],i=n.nextPart.get(t);i||(i=f(),n.nextPart.set(t,i)),n=i}return n},te=e=>`isThemeGetter`in e&&e.isThemeGetter===!0,E=e=>{if(e<1)return{get:()=>void 0,set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null),i=(i,a)=>{n[i]=a,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(e){let t=n[e];if(t!==void 0)return t;if((t=r[e])!==void 0)return i(e,t),t},set(e,t){e in n?n[e]=t:i(e,t)}}},D=`!`,O=`:`,k=[],A=(e,t,n,r,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:i}),j=e=>{let{prefix:t,experimentalParseClassName:n}=e,r=e=>{let t=[],n=0,r=0,i=0,a,o=e.length;for(let s=0;s<o;s++){let o=e[s];if(n===0&&r===0){if(o===O){t.push(e.slice(i,s)),i=s+1;continue}if(o===`/`){a=s;continue}}o===`[`?n++:o===`]`?n--:o===`(`?r++:o===`)`&&r--}let s=t.length===0?e:e.slice(i),c=s,l=!1;s.endsWith(D)?(c=s.slice(0,-1),l=!0):s.startsWith(D)&&(c=s.slice(1),l=!0);let u=a&&a>i?a-i:void 0;return A(t,l,c,u)};if(t){let e=t+O,n=r;r=t=>t.startsWith(e)?n(t.slice(e.length)):A(k,!1,t,void 0,!0)}if(n){let e=r;r=t=>n({className:t,parseClassName:e})}return r},ne=e=>{let t=new Map;return e.orderSensitiveModifiers.forEach((e,n)=>{t.set(e,1e6+n)}),e=>{let n=[],r=[];for(let i=0;i<e.length;i++){let a=e[i],o=a[0]===`[`,s=t.has(a);o||s?(r.length>0&&(r.sort(),n.push(...r),r=[]),n.push(a)):r.push(a)}return r.length>0&&(r.sort(),n.push(...r)),n}},re=e=>({cache:E(e.cacheSize),parseClassName:j(e),sortModifiers:ne(e),postfixLookupClassGroupIds:M(e),...g(e)}),M=e=>{let t=Object.create(null),n=e.postfixLookupClassGroups;if(n)for(let e=0;e<n.length;e++)t[n[e]]=!0;return t},ie=/\s+/,ae=(e,t)=>{let{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:a,postfixLookupClassGroupIds:o}=t,s=[],c=e.trim().split(ie),l=``;for(let e=c.length-1;e>=0;--e){let t=c[e],{isExternal:u,modifiers:d,hasImportantModifier:f,baseClassName:p,maybePostfixModifierPosition:m}=n(t);if(u){l=t+(l.length>0?` `+l:l);continue}let h=!!m,g;if(h){g=r(p.substring(0,m));let e=g&&o[g]?r(p):void 0;e&&e!==g&&(g=e,h=!1)}else g=r(p);if(!g){if(!h){l=t+(l.length>0?` `+l:l);continue}if(g=r(p),!g){l=t+(l.length>0?` `+l:l);continue}h=!1}let _=d.length===0?``:d.length===1?d[0]:a(d).join(`:`),ee=f?_+D:_,v=ee+g;if(s.indexOf(v)>-1)continue;s.push(v);let y=i(g,h);for(let e=0;e<y.length;++e){let t=y[e];s.push(ee+t)}l=t+(l.length>0?` `+l:l)}return l},oe=(...e)=>{let t=0,n,r,i=``;for(;t<e.length;)(n=e[t++])&&(r=N(n))&&(i&&(i+=` `),i+=r);return i},N=e=>{if(typeof e==`string`)return e;let t,n=``;for(let r=0;r<e.length;r++)e[r]&&(t=N(e[r]))&&(n&&(n+=` `),n+=t);return n},P=(e,...t)=>{let n,r,i,a,o=o=>(n=re(t.reduce((e,t)=>t(e),e())),r=n.cache.get,i=n.cache.set,a=s,s(o)),s=e=>{let t=r(e);if(t)return t;let a=ae(e,n);return i(e,a),a};return a=o,(...e)=>a(oe(...e))},F=[],I=e=>{let t=t=>t[e]||F;return t.isThemeGetter=!0,t},L=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,R=/^\((?:(\w[\w-]*):)?(.+)\)$/i,z=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,se=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,B=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,V=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,ce=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,H=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,U=e=>z.test(e),W=e=>!!e&&!Number.isNaN(Number(e)),G=e=>!!e&&Number.isInteger(Number(e)),le=e=>e.endsWith(`%`)&&W(e.slice(0,-1)),K=e=>se.test(e),ue=()=>!0,de=e=>B.test(e)&&!V.test(e),fe=()=>!1,pe=e=>ce.test(e),me=e=>H.test(e),he=e=>!q(e)&&!Y(e),ge=e=>e.startsWith(`@container`)&&(e[10]===`/`&&e[11]!==void 0||e[11]===`s`&&e[16]!==void 0&&e.startsWith(`-size/`,10)||e[11]===`n`&&e[18]!==void 0&&e.startsWith(`-normal/`,10)),_e=e=>Z(e,Me,fe),q=e=>L.test(e),J=e=>Z(e,Ne,de),ve=e=>Z(e,Pe,W),ye=e=>Z(e,Ie,ue),be=e=>Z(e,Fe,fe),xe=e=>Z(e,Ae,fe),Se=e=>Z(e,je,me),Ce=e=>Z(e,Le,pe),Y=e=>R.test(e),X=e=>Q(e,Ne),we=e=>Q(e,Fe),Te=e=>Q(e,Ae),Ee=e=>Q(e,Me),De=e=>Q(e,je),Oe=e=>Q(e,Le,!0),ke=e=>Q(e,Ie,!0),Z=(e,t,n)=>{let r=L.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},Q=(e,t,n=!1)=>{let r=R.exec(e);return r?r[1]?t(r[1]):n:!1},Ae=e=>e===`position`||e===`percentage`,je=e=>e===`image`||e===`url`,Me=e=>e===`length`||e===`size`||e===`bg-size`,Ne=e=>e===`length`,Pe=e=>e===`number`,Fe=e=>e===`family-name`,Ie=e=>e===`number`||e===`weight`,Le=e=>e===`shadow`,Re=P(()=>{let e=I(`color`),t=I(`font`),n=I(`text`),r=I(`font-weight`),i=I(`tracking`),a=I(`leading`),o=I(`breakpoint`),s=I(`container`),c=I(`spacing`),l=I(`radius`),u=I(`shadow`),d=I(`inset-shadow`),f=I(`text-shadow`),p=I(`drop-shadow`),m=I(`blur`),h=I(`perspective`),g=I(`aspect`),_=I(`ease`),ee=I(`animate`),v=()=>[`auto`,`avoid`,`all`,`avoid-page`,`page`,`left`,`right`,`column`],y=()=>[`center`,`top`,`bottom`,`left`,`right`,`top-left`,`left-top`,`top-right`,`right-top`,`bottom-right`,`right-bottom`,`bottom-left`,`left-bottom`],b=()=>[...y(),Y,q],x=()=>[`auto`,`hidden`,`clip`,`visible`,`scroll`],S=()=>[`auto`,`contain`,`none`],C=()=>[Y,q,c],w=()=>[U,`full`,`auto`,...C()],T=()=>[G,`none`,`subgrid`,Y,q],te=()=>[`auto`,{span:[`full`,G,Y,q]},G,Y,q],E=()=>[G,`auto`,Y,q],D=()=>[`auto`,`min`,`max`,`fr`,Y,q],O=()=>[`start`,`end`,`center`,`between`,`around`,`evenly`,`stretch`,`baseline`,`center-safe`,`end-safe`],k=()=>[`start`,`end`,`center`,`stretch`,`center-safe`,`end-safe`],A=()=>[`auto`,...C()],j=()=>[U,`auto`,`full`,`dvw`,`dvh`,`lvw`,`lvh`,`svw`,`svh`,`min`,`max`,`fit`,...C()],ne=()=>[U,`screen`,`full`,`dvw`,`lvw`,`svw`,`min`,`max`,`fit`,...C()],re=()=>[U,`screen`,`full`,`lh`,`dvh`,`lvh`,`svh`,`min`,`max`,`fit`,...C()],M=()=>[e,Y,q],ie=()=>[...y(),Te,xe,{position:[Y,q]}],ae=()=>[`no-repeat`,{repeat:[``,`x`,`y`,`space`,`round`]}],oe=()=>[`auto`,`cover`,`contain`,Ee,_e,{size:[Y,q]}],N=()=>[le,X,J],P=()=>[``,`none`,`full`,l,Y,q],F=()=>[``,W,X,J],L=()=>[`solid`,`dashed`,`dotted`,`double`],R=()=>[`normal`,`multiply`,`screen`,`overlay`,`darken`,`lighten`,`color-dodge`,`color-burn`,`hard-light`,`soft-light`,`difference`,`exclusion`,`hue`,`saturation`,`color`,`luminosity`],z=()=>[W,le,Te,xe],se=()=>[``,`none`,m,Y,q],B=()=>[`none`,W,Y,q],V=()=>[`none`,W,Y,q],ce=()=>[W,Y,q],H=()=>[U,`full`,...C()];return{cacheSize:500,theme:{animate:[`spin`,`ping`,`pulse`,`bounce`],aspect:[`video`],blur:[K],breakpoint:[K],color:[ue],container:[K],"drop-shadow":[K],ease:[`in`,`out`,`in-out`],font:[he],"font-weight":[`thin`,`extralight`,`light`,`normal`,`medium`,`semibold`,`bold`,`extrabold`,`black`],"inset-shadow":[K],leading:[`none`,`tight`,`snug`,`normal`,`relaxed`,`loose`],perspective:[`dramatic`,`near`,`normal`,`midrange`,`distant`,`none`],radius:[K],shadow:[K],spacing:[`px`,W],text:[K],"text-shadow":[K],tracking:[`tighter`,`tight`,`normal`,`wide`,`wider`,`widest`]},classGroups:{aspect:[{aspect:[`auto`,`square`,U,q,Y,g]}],container:[`container`],"container-type":[{"@container":[``,`normal`,`size`,Y,q]}],"container-named":[ge],columns:[{columns:[W,q,Y,s]}],"break-after":[{"break-after":v()}],"break-before":[{"break-before":v()}],"break-inside":[{"break-inside":[`auto`,`avoid`,`avoid-page`,`avoid-column`]}],"box-decoration":[{"box-decoration":[`slice`,`clone`]}],box:[{box:[`border`,`content`]}],display:[`block`,`inline-block`,`inline`,`flex`,`inline-flex`,`table`,`inline-table`,`table-caption`,`table-cell`,`table-column`,`table-column-group`,`table-footer-group`,`table-header-group`,`table-row-group`,`table-row`,`flow-root`,`grid`,`inline-grid`,`contents`,`list-item`,`hidden`],sr:[`sr-only`,`not-sr-only`],float:[{float:[`right`,`left`,`none`,`start`,`end`]}],clear:[{clear:[`left`,`right`,`both`,`none`,`start`,`end`]}],isolation:[`isolate`,`isolation-auto`],"object-fit":[{object:[`contain`,`cover`,`fill`,`none`,`scale-down`]}],"object-position":[{object:b()}],overflow:[{overflow:x()}],"overflow-x":[{"overflow-x":x()}],"overflow-y":[{"overflow-y":x()}],overscroll:[{overscroll:S()}],"overscroll-x":[{"overscroll-x":S()}],"overscroll-y":[{"overscroll-y":S()}],position:[`static`,`fixed`,`absolute`,`relative`,`sticky`],inset:[{inset:w()}],"inset-x":[{"inset-x":w()}],"inset-y":[{"inset-y":w()}],start:[{"inset-s":w(),start:w()}],end:[{"inset-e":w(),end:w()}],"inset-bs":[{"inset-bs":w()}],"inset-be":[{"inset-be":w()}],top:[{top:w()}],right:[{right:w()}],bottom:[{bottom:w()}],left:[{left:w()}],visibility:[`visible`,`invisible`,`collapse`],z:[{z:[G,`auto`,Y,q]}],basis:[{basis:[U,`full`,`auto`,s,...C()]}],"flex-direction":[{flex:[`row`,`row-reverse`,`col`,`col-reverse`]}],"flex-wrap":[{flex:[`nowrap`,`wrap`,`wrap-reverse`]}],flex:[{flex:[W,U,`auto`,`initial`,`none`,q]}],grow:[{grow:[``,W,Y,q]}],shrink:[{shrink:[``,W,Y,q]}],order:[{order:[G,`first`,`last`,`none`,Y,q]}],"grid-cols":[{"grid-cols":T()}],"col-start-end":[{col:te()}],"col-start":[{"col-start":E()}],"col-end":[{"col-end":E()}],"grid-rows":[{"grid-rows":T()}],"row-start-end":[{row:te()}],"row-start":[{"row-start":E()}],"row-end":[{"row-end":E()}],"grid-flow":[{"grid-flow":[`row`,`col`,`dense`,`row-dense`,`col-dense`]}],"auto-cols":[{"auto-cols":D()}],"auto-rows":[{"auto-rows":D()}],gap:[{gap:C()}],"gap-x":[{"gap-x":C()}],"gap-y":[{"gap-y":C()}],"justify-content":[{justify:[...O(),`normal`]}],"justify-items":[{"justify-items":[...k(),`normal`]}],"justify-self":[{"justify-self":[`auto`,...k()]}],"align-content":[{content:[`normal`,...O()]}],"align-items":[{items:[...k(),{baseline:[``,`last`]}]}],"align-self":[{self:[`auto`,...k(),{baseline:[``,`last`]}]}],"place-content":[{"place-content":O()}],"place-items":[{"place-items":[...k(),`baseline`]}],"place-self":[{"place-self":[`auto`,...k()]}],p:[{p:C()}],px:[{px:C()}],py:[{py:C()}],ps:[{ps:C()}],pe:[{pe:C()}],pbs:[{pbs:C()}],pbe:[{pbe:C()}],pt:[{pt:C()}],pr:[{pr:C()}],pb:[{pb:C()}],pl:[{pl:C()}],m:[{m:A()}],mx:[{mx:A()}],my:[{my:A()}],ms:[{ms:A()}],me:[{me:A()}],mbs:[{mbs:A()}],mbe:[{mbe:A()}],mt:[{mt:A()}],mr:[{mr:A()}],mb:[{mb:A()}],ml:[{ml:A()}],"space-x":[{"space-x":C()}],"space-x-reverse":[`space-x-reverse`],"space-y":[{"space-y":C()}],"space-y-reverse":[`space-y-reverse`],size:[{size:j()}],"inline-size":[{inline:[`auto`,...ne()]}],"min-inline-size":[{"min-inline":[`auto`,...ne()]}],"max-inline-size":[{"max-inline":[`none`,...ne()]}],"block-size":[{block:[`auto`,...re()]}],"min-block-size":[{"min-block":[`auto`,...re()]}],"max-block-size":[{"max-block":[`none`,...re()]}],w:[{w:[s,`screen`,...j()]}],"min-w":[{"min-w":[s,`screen`,`none`,...j()]}],"max-w":[{"max-w":[s,`screen`,`none`,`prose`,{screen:[o]},...j()]}],h:[{h:[`screen`,`lh`,...j()]}],"min-h":[{"min-h":[`screen`,`lh`,`none`,...j()]}],"max-h":[{"max-h":[`screen`,`lh`,...j()]}],"font-size":[{text:[`base`,n,X,J]}],"font-smoothing":[`antialiased`,`subpixel-antialiased`],"font-style":[`italic`,`not-italic`],"font-weight":[{font:[r,ke,ye]}],"font-stretch":[{"font-stretch":[`ultra-condensed`,`extra-condensed`,`condensed`,`semi-condensed`,`normal`,`semi-expanded`,`expanded`,`extra-expanded`,`ultra-expanded`,le,q]}],"font-family":[{font:[we,be,t]}],"font-features":[{"font-features":[q]}],"fvn-normal":[`normal-nums`],"fvn-ordinal":[`ordinal`],"fvn-slashed-zero":[`slashed-zero`],"fvn-figure":[`lining-nums`,`oldstyle-nums`],"fvn-spacing":[`proportional-nums`,`tabular-nums`],"fvn-fraction":[`diagonal-fractions`,`stacked-fractions`],tracking:[{tracking:[i,Y,q]}],"line-clamp":[{"line-clamp":[W,`none`,Y,ve]}],leading:[{leading:[a,...C()]}],"list-image":[{"list-image":[`none`,Y,q]}],"list-style-position":[{list:[`inside`,`outside`]}],"list-style-type":[{list:[`disc`,`decimal`,`none`,Y,q]}],"text-alignment":[{text:[`left`,`center`,`right`,`justify`,`start`,`end`]}],"placeholder-color":[{placeholder:M()}],"text-color":[{text:M()}],"text-decoration":[`underline`,`overline`,`line-through`,`no-underline`],"text-decoration-style":[{decoration:[...L(),`wavy`]}],"text-decoration-thickness":[{decoration:[W,`from-font`,`auto`,Y,J]}],"text-decoration-color":[{decoration:M()}],"underline-offset":[{"underline-offset":[W,`auto`,Y,q]}],"text-transform":[`uppercase`,`lowercase`,`capitalize`,`normal-case`],"text-overflow":[`truncate`,`text-ellipsis`,`text-clip`],"text-wrap":[{text:[`wrap`,`nowrap`,`balance`,`pretty`]}],indent:[{indent:C()}],"tab-size":[{tab:[G,Y,q]}],"vertical-align":[{align:[`baseline`,`top`,`middle`,`bottom`,`text-top`,`text-bottom`,`sub`,`super`,Y,q]}],whitespace:[{whitespace:[`normal`,`nowrap`,`pre`,`pre-line`,`pre-wrap`,`break-spaces`]}],break:[{break:[`normal`,`words`,`all`,`keep`]}],wrap:[{wrap:[`break-word`,`anywhere`,`normal`]}],hyphens:[{hyphens:[`none`,`manual`,`auto`]}],content:[{content:[`none`,Y,q]}],"bg-attachment":[{bg:[`fixed`,`local`,`scroll`]}],"bg-clip":[{"bg-clip":[`border`,`padding`,`content`,`text`]}],"bg-origin":[{"bg-origin":[`border`,`padding`,`content`]}],"bg-position":[{bg:ie()}],"bg-repeat":[{bg:ae()}],"bg-size":[{bg:oe()}],"bg-image":[{bg:[`none`,{linear:[{to:[`t`,`tr`,`r`,`br`,`b`,`bl`,`l`,`tl`]},G,Y,q],radial:[``,Y,q],conic:[G,Y,q]},De,Se]}],"bg-color":[{bg:M()}],"gradient-from-pos":[{from:N()}],"gradient-via-pos":[{via:N()}],"gradient-to-pos":[{to:N()}],"gradient-from":[{from:M()}],"gradient-via":[{via:M()}],"gradient-to":[{to:M()}],rounded:[{rounded:P()}],"rounded-s":[{"rounded-s":P()}],"rounded-e":[{"rounded-e":P()}],"rounded-t":[{"rounded-t":P()}],"rounded-r":[{"rounded-r":P()}],"rounded-b":[{"rounded-b":P()}],"rounded-l":[{"rounded-l":P()}],"rounded-ss":[{"rounded-ss":P()}],"rounded-se":[{"rounded-se":P()}],"rounded-ee":[{"rounded-ee":P()}],"rounded-es":[{"rounded-es":P()}],"rounded-tl":[{"rounded-tl":P()}],"rounded-tr":[{"rounded-tr":P()}],"rounded-br":[{"rounded-br":P()}],"rounded-bl":[{"rounded-bl":P()}],"border-w":[{border:F()}],"border-w-x":[{"border-x":F()}],"border-w-y":[{"border-y":F()}],"border-w-s":[{"border-s":F()}],"border-w-e":[{"border-e":F()}],"border-w-bs":[{"border-bs":F()}],"border-w-be":[{"border-be":F()}],"border-w-t":[{"border-t":F()}],"border-w-r":[{"border-r":F()}],"border-w-b":[{"border-b":F()}],"border-w-l":[{"border-l":F()}],"divide-x":[{"divide-x":F()}],"divide-x-reverse":[`divide-x-reverse`],"divide-y":[{"divide-y":F()}],"divide-y-reverse":[`divide-y-reverse`],"border-style":[{border:[...L(),`hidden`,`none`]}],"divide-style":[{divide:[...L(),`hidden`,`none`]}],"border-color":[{border:M()}],"border-color-x":[{"border-x":M()}],"border-color-y":[{"border-y":M()}],"border-color-s":[{"border-s":M()}],"border-color-e":[{"border-e":M()}],"border-color-bs":[{"border-bs":M()}],"border-color-be":[{"border-be":M()}],"border-color-t":[{"border-t":M()}],"border-color-r":[{"border-r":M()}],"border-color-b":[{"border-b":M()}],"border-color-l":[{"border-l":M()}],"divide-color":[{divide:M()}],"outline-style":[{outline:[...L(),`none`,`hidden`]}],"outline-offset":[{"outline-offset":[W,Y,q]}],"outline-w":[{outline:[``,W,X,J]}],"outline-color":[{outline:M()}],shadow:[{shadow:[``,`none`,u,Oe,Ce]}],"shadow-color":[{shadow:M()}],"inset-shadow":[{"inset-shadow":[`none`,d,Oe,Ce]}],"inset-shadow-color":[{"inset-shadow":M()}],"ring-w":[{ring:F()}],"ring-w-inset":[`ring-inset`],"ring-color":[{ring:M()}],"ring-offset-w":[{"ring-offset":[W,J]}],"ring-offset-color":[{"ring-offset":M()}],"inset-ring-w":[{"inset-ring":F()}],"inset-ring-color":[{"inset-ring":M()}],"text-shadow":[{"text-shadow":[`none`,f,Oe,Ce]}],"text-shadow-color":[{"text-shadow":M()}],opacity:[{opacity:[W,Y,q]}],"mix-blend":[{"mix-blend":[...R(),`plus-darker`,`plus-lighter`]}],"bg-blend":[{"bg-blend":R()}],"mask-clip":[{"mask-clip":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]},`mask-no-clip`],"mask-composite":[{mask:[`add`,`subtract`,`intersect`,`exclude`]}],"mask-image-linear-pos":[{"mask-linear":[W]}],"mask-image-linear-from-pos":[{"mask-linear-from":z()}],"mask-image-linear-to-pos":[{"mask-linear-to":z()}],"mask-image-linear-from-color":[{"mask-linear-from":M()}],"mask-image-linear-to-color":[{"mask-linear-to":M()}],"mask-image-t-from-pos":[{"mask-t-from":z()}],"mask-image-t-to-pos":[{"mask-t-to":z()}],"mask-image-t-from-color":[{"mask-t-from":M()}],"mask-image-t-to-color":[{"mask-t-to":M()}],"mask-image-r-from-pos":[{"mask-r-from":z()}],"mask-image-r-to-pos":[{"mask-r-to":z()}],"mask-image-r-from-color":[{"mask-r-from":M()}],"mask-image-r-to-color":[{"mask-r-to":M()}],"mask-image-b-from-pos":[{"mask-b-from":z()}],"mask-image-b-to-pos":[{"mask-b-to":z()}],"mask-image-b-from-color":[{"mask-b-from":M()}],"mask-image-b-to-color":[{"mask-b-to":M()}],"mask-image-l-from-pos":[{"mask-l-from":z()}],"mask-image-l-to-pos":[{"mask-l-to":z()}],"mask-image-l-from-color":[{"mask-l-from":M()}],"mask-image-l-to-color":[{"mask-l-to":M()}],"mask-image-x-from-pos":[{"mask-x-from":z()}],"mask-image-x-to-pos":[{"mask-x-to":z()}],"mask-image-x-from-color":[{"mask-x-from":M()}],"mask-image-x-to-color":[{"mask-x-to":M()}],"mask-image-y-from-pos":[{"mask-y-from":z()}],"mask-image-y-to-pos":[{"mask-y-to":z()}],"mask-image-y-from-color":[{"mask-y-from":M()}],"mask-image-y-to-color":[{"mask-y-to":M()}],"mask-image-radial":[{"mask-radial":[Y,q]}],"mask-image-radial-from-pos":[{"mask-radial-from":z()}],"mask-image-radial-to-pos":[{"mask-radial-to":z()}],"mask-image-radial-from-color":[{"mask-radial-from":M()}],"mask-image-radial-to-color":[{"mask-radial-to":M()}],"mask-image-radial-shape":[{"mask-radial":[`circle`,`ellipse`]}],"mask-image-radial-size":[{"mask-radial":[{closest:[`side`,`corner`],farthest:[`side`,`corner`]}]}],"mask-image-radial-pos":[{"mask-radial-at":y()}],"mask-image-conic-pos":[{"mask-conic":[W]}],"mask-image-conic-from-pos":[{"mask-conic-from":z()}],"mask-image-conic-to-pos":[{"mask-conic-to":z()}],"mask-image-conic-from-color":[{"mask-conic-from":M()}],"mask-image-conic-to-color":[{"mask-conic-to":M()}],"mask-mode":[{mask:[`alpha`,`luminance`,`match`]}],"mask-origin":[{"mask-origin":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]}],"mask-position":[{mask:ie()}],"mask-repeat":[{mask:ae()}],"mask-size":[{mask:oe()}],"mask-type":[{"mask-type":[`alpha`,`luminance`]}],"mask-image":[{mask:[`none`,Y,q]}],filter:[{filter:[``,`none`,Y,q]}],blur:[{blur:se()}],brightness:[{brightness:[W,Y,q]}],contrast:[{contrast:[W,Y,q]}],"drop-shadow":[{"drop-shadow":[``,`none`,p,Oe,Ce]}],"drop-shadow-color":[{"drop-shadow":M()}],grayscale:[{grayscale:[``,W,Y,q]}],"hue-rotate":[{"hue-rotate":[W,Y,q]}],invert:[{invert:[``,W,Y,q]}],saturate:[{saturate:[W,Y,q]}],sepia:[{sepia:[``,W,Y,q]}],"backdrop-filter":[{"backdrop-filter":[``,`none`,Y,q]}],"backdrop-blur":[{"backdrop-blur":se()}],"backdrop-brightness":[{"backdrop-brightness":[W,Y,q]}],"backdrop-contrast":[{"backdrop-contrast":[W,Y,q]}],"backdrop-grayscale":[{"backdrop-grayscale":[``,W,Y,q]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[W,Y,q]}],"backdrop-invert":[{"backdrop-invert":[``,W,Y,q]}],"backdrop-opacity":[{"backdrop-opacity":[W,Y,q]}],"backdrop-saturate":[{"backdrop-saturate":[W,Y,q]}],"backdrop-sepia":[{"backdrop-sepia":[``,W,Y,q]}],"border-collapse":[{border:[`collapse`,`separate`]}],"border-spacing":[{"border-spacing":C()}],"border-spacing-x":[{"border-spacing-x":C()}],"border-spacing-y":[{"border-spacing-y":C()}],"table-layout":[{table:[`auto`,`fixed`]}],caption:[{caption:[`top`,`bottom`]}],transition:[{transition:[``,`all`,`colors`,`opacity`,`shadow`,`transform`,`none`,Y,q]}],"transition-behavior":[{transition:[`normal`,`discrete`]}],duration:[{duration:[W,`initial`,Y,q]}],ease:[{ease:[`linear`,`initial`,_,Y,q]}],delay:[{delay:[W,Y,q]}],animate:[{animate:[`none`,ee,Y,q]}],backface:[{backface:[`hidden`,`visible`]}],perspective:[{perspective:[h,Y,q]}],"perspective-origin":[{"perspective-origin":b()}],rotate:[{rotate:B()}],"rotate-x":[{"rotate-x":B()}],"rotate-y":[{"rotate-y":B()}],"rotate-z":[{"rotate-z":B()}],scale:[{scale:V()}],"scale-x":[{"scale-x":V()}],"scale-y":[{"scale-y":V()}],"scale-z":[{"scale-z":V()}],"scale-3d":[`scale-3d`],skew:[{skew:ce()}],"skew-x":[{"skew-x":ce()}],"skew-y":[{"skew-y":ce()}],transform:[{transform:[Y,q,``,`none`,`gpu`,`cpu`]}],"transform-origin":[{origin:b()}],"transform-style":[{transform:[`3d`,`flat`]}],translate:[{translate:H()}],"translate-x":[{"translate-x":H()}],"translate-y":[{"translate-y":H()}],"translate-z":[{"translate-z":H()}],"translate-none":[`translate-none`],zoom:[{zoom:[G,Y,q]}],accent:[{accent:M()}],appearance:[{appearance:[`none`,`auto`]}],"caret-color":[{caret:M()}],"color-scheme":[{scheme:[`normal`,`dark`,`light`,`light-dark`,`only-dark`,`only-light`]}],cursor:[{cursor:[`auto`,`default`,`pointer`,`wait`,`text`,`move`,`help`,`not-allowed`,`none`,`context-menu`,`progress`,`cell`,`crosshair`,`vertical-text`,`alias`,`copy`,`no-drop`,`grab`,`grabbing`,`all-scroll`,`col-resize`,`row-resize`,`n-resize`,`e-resize`,`s-resize`,`w-resize`,`ne-resize`,`nw-resize`,`se-resize`,`sw-resize`,`ew-resize`,`ns-resize`,`nesw-resize`,`nwse-resize`,`zoom-in`,`zoom-out`,Y,q]}],"field-sizing":[{"field-sizing":[`fixed`,`content`]}],"pointer-events":[{"pointer-events":[`auto`,`none`]}],resize:[{resize:[`none`,``,`y`,`x`]}],"scroll-behavior":[{scroll:[`auto`,`smooth`]}],"scrollbar-thumb-color":[{"scrollbar-thumb":M()}],"scrollbar-track-color":[{"scrollbar-track":M()}],"scrollbar-gutter":[{"scrollbar-gutter":[`auto`,`stable`,`both`]}],"scrollbar-w":[{scrollbar:[`auto`,`thin`,`none`]}],"scroll-m":[{"scroll-m":C()}],"scroll-mx":[{"scroll-mx":C()}],"scroll-my":[{"scroll-my":C()}],"scroll-ms":[{"scroll-ms":C()}],"scroll-me":[{"scroll-me":C()}],"scroll-mbs":[{"scroll-mbs":C()}],"scroll-mbe":[{"scroll-mbe":C()}],"scroll-mt":[{"scroll-mt":C()}],"scroll-mr":[{"scroll-mr":C()}],"scroll-mb":[{"scroll-mb":C()}],"scroll-ml":[{"scroll-ml":C()}],"scroll-p":[{"scroll-p":C()}],"scroll-px":[{"scroll-px":C()}],"scroll-py":[{"scroll-py":C()}],"scroll-ps":[{"scroll-ps":C()}],"scroll-pe":[{"scroll-pe":C()}],"scroll-pbs":[{"scroll-pbs":C()}],"scroll-pbe":[{"scroll-pbe":C()}],"scroll-pt":[{"scroll-pt":C()}],"scroll-pr":[{"scroll-pr":C()}],"scroll-pb":[{"scroll-pb":C()}],"scroll-pl":[{"scroll-pl":C()}],"snap-align":[{snap:[`start`,`end`,`center`,`align-none`]}],"snap-stop":[{snap:[`normal`,`always`]}],"snap-type":[{snap:[`none`,`x`,`y`,`both`]}],"snap-strictness":[{snap:[`mandatory`,`proximity`]}],touch:[{touch:[`auto`,`none`,`manipulation`]}],"touch-x":[{"touch-pan":[`x`,`left`,`right`]}],"touch-y":[{"touch-pan":[`y`,`up`,`down`]}],"touch-pz":[`touch-pinch-zoom`],select:[{select:[`none`,`text`,`all`,`auto`]}],"will-change":[{"will-change":[`auto`,`scroll`,`contents`,`transform`,Y,q]}],fill:[{fill:[`none`,...M()]}],"stroke-w":[{stroke:[W,X,J,ve]}],stroke:[{stroke:[`none`,...M()]}],"forced-color-adjust":[{"forced-color-adjust":[`auto`,`none`]}]},conflictingClassGroups:{"container-named":[`container-type`],overflow:[`overflow-x`,`overflow-y`],overscroll:[`overscroll-x`,`overscroll-y`],inset:[`inset-x`,`inset-y`,`inset-bs`,`inset-be`,`start`,`end`,`top`,`right`,`bottom`,`left`],"inset-x":[`right`,`left`],"inset-y":[`top`,`bottom`],flex:[`basis`,`grow`,`shrink`],gap:[`gap-x`,`gap-y`],p:[`px`,`py`,`ps`,`pe`,`pbs`,`pbe`,`pt`,`pr`,`pb`,`pl`],px:[`pr`,`pl`],py:[`pt`,`pb`],m:[`mx`,`my`,`ms`,`me`,`mbs`,`mbe`,`mt`,`mr`,`mb`,`ml`],mx:[`mr`,`ml`],my:[`mt`,`mb`],size:[`w`,`h`],"font-size":[`leading`],"fvn-normal":[`fvn-ordinal`,`fvn-slashed-zero`,`fvn-figure`,`fvn-spacing`,`fvn-fraction`],"fvn-ordinal":[`fvn-normal`],"fvn-slashed-zero":[`fvn-normal`],"fvn-figure":[`fvn-normal`],"fvn-spacing":[`fvn-normal`],"fvn-fraction":[`fvn-normal`],"line-clamp":[`display`,`overflow`],rounded:[`rounded-s`,`rounded-e`,`rounded-t`,`rounded-r`,`rounded-b`,`rounded-l`,`rounded-ss`,`rounded-se`,`rounded-ee`,`rounded-es`,`rounded-tl`,`rounded-tr`,`rounded-br`,`rounded-bl`],"rounded-s":[`rounded-ss`,`rounded-es`],"rounded-e":[`rounded-se`,`rounded-ee`],"rounded-t":[`rounded-tl`,`rounded-tr`],"rounded-r":[`rounded-tr`,`rounded-br`],"rounded-b":[`rounded-br`,`rounded-bl`],"rounded-l":[`rounded-tl`,`rounded-bl`],"border-spacing":[`border-spacing-x`,`border-spacing-y`],"border-w":[`border-w-x`,`border-w-y`,`border-w-s`,`border-w-e`,`border-w-bs`,`border-w-be`,`border-w-t`,`border-w-r`,`border-w-b`,`border-w-l`],"border-w-x":[`border-w-r`,`border-w-l`],"border-w-y":[`border-w-t`,`border-w-b`],"border-color":[`border-color-x`,`border-color-y`,`border-color-s`,`border-color-e`,`border-color-bs`,`border-color-be`,`border-color-t`,`border-color-r`,`border-color-b`,`border-color-l`],"border-color-x":[`border-color-r`,`border-color-l`],"border-color-y":[`border-color-t`,`border-color-b`],translate:[`translate-x`,`translate-y`,`translate-none`],"translate-none":[`translate`,`translate-x`,`translate-y`,`translate-z`],"scroll-m":[`scroll-mx`,`scroll-my`,`scroll-ms`,`scroll-me`,`scroll-mbs`,`scroll-mbe`,`scroll-mt`,`scroll-mr`,`scroll-mb`,`scroll-ml`],"scroll-mx":[`scroll-mr`,`scroll-ml`],"scroll-my":[`scroll-mt`,`scroll-mb`],"scroll-p":[`scroll-px`,`scroll-py`,`scroll-ps`,`scroll-pe`,`scroll-pbs`,`scroll-pbe`,`scroll-pt`,`scroll-pr`,`scroll-pb`,`scroll-pl`],"scroll-px":[`scroll-pr`,`scroll-pl`],"scroll-py":[`scroll-pt`,`scroll-pb`],touch:[`touch-x`,`touch-y`,`touch-pz`],"touch-x":[`touch`],"touch-y":[`touch`],"touch-pz":[`touch`]},conflictingClassGroupModifiers:{"font-size":[`leading`]},postfixLookupClassGroups:[`container-type`],orderSensitiveModifiers:[`*`,`**`,`after`,`backdrop`,`before`,`details-content`,`file`,`first-letter`,`first-line`,`marker`,`placeholder`,`selection`]}});function ze(...e){return Re(c(e))}function Be(e){return/mac|iphone|ipad|ipod/i.test(e)}function Ve(e){return/^win(dows)?/i.test(e)}function $(){if(typeof crypto.randomUUID==`function`)return crypto.randomUUID();let e=crypto.getRandomValues(new Uint8Array(16));e[6]=e[6]&15|64,e[8]=e[8]&63|128;let t=Array.from(e,e=>e.toString(16).padStart(2,`0`)).join(``);return`${t.slice(0,8)}-${t.slice(8,12)}-${t.slice(12,16)}-${t.slice(16,20)}-${t.slice(20)}`}var He=()=>n.make($()),Ue=()=>e.make($()),We=()=>t.make($()),Ge=()=>i.make($()),Ke=()=>r.make($());export{Ge as a,We as c,o as d,He as i,$ as l,Be as n,Ke as o,Ve as r,Ue as s,ze as t,l as u};
@@ -92,7 +92,7 @@
92
92
  }
93
93
  </style>
94
94
  <title>Ryco (Alpha)</title>
95
- <script type="module" crossorigin src="/assets/index-COc-h_V9.js"></script>
95
+ <script type="module" crossorigin src="/assets/index-Bntnmu6O.js"></script>
96
96
  </head>
97
97
  <body>
98
98
  <div id="root">
package/package.json CHANGED
@@ -10,7 +10,7 @@
10
10
  "ryco-cli": "dist/bin.mjs"
11
11
  },
12
12
  "type": "module",
13
- "version": "0.1.10",
13
+ "version": "0.1.12",
14
14
  "engines": {
15
15
  "node": "^22.16 || ^23.11 || >=24.10"
16
16
  },
@@ -1 +0,0 @@
1
- import{i as e,t}from"./react-SIfiwpqq.js";import{t as n}from"./compiler-runtime-qmuS0Svy.js";import{F as r,M as i,N as a}from"./runtime-CqhG6EOG.js";import{f as o}from"./utils-BPUctpTG.js";import{_ as s,o as c}from"./authorization-mIJKV2yp.js";import{n as l}from"./loader-circle-CrtHFAvM.js";import{t as u}from"./copy-UQjKGt7t.js";import{t as d}from"./key-round-CacMputS.js";import{t as f}from"./refresh-cw-DopCMrtR.js";import{t as p}from"./shield-check-dQ-4cMKk.js";import{t as m}from"./trash-2-CM1zXPGb.js";import{t as h}from"./triangle-alert-RL_T3KLo.js";import{t as g}from"./user-round-Cpzx8pSw.js";import{n as _,t as v}from"./input-Bz9pd_f3.js";import{u as y}from"./Icons-DjUJVKIP.js";import{t as b}from"./button-CXfaxtRp.js";import{t as x}from"./useCopyToClipboard-BTpWxumf.js";import{i as S,n as C,r as w,t as T}from"./alert-DdU9OGtC.js";import{a as E,c as D,i as ee,o as O,r as te,s as ne,t as k}from"./dialog-JVv-MNDj.js";import{t as A}from"./spinner-JhkVC8d7.js";import{a as j,i as M,n as N,o as re,r as ie,s as ae,t as oe}from"./alert-dialog-zAmnOpaF.js";import{t as P}from"./badge-CNPL77i3.js";import{t as se}from"./label-Ct6uH6qL.js";import{C as F,S as I,_ as L,a as R,b as z,c as ce,d as le,f as B,g as V,h as H,i as U,l as W,m as G,n as K,o as q,p as ue,r as de,s as J,t as fe,u as pe,v as Y,x as X,y as me}from"./ExternalIdentityWeb.logic-D64j70NH.js";import{i as he,n as ge,r as _e}from"./settingsLayout-CS7P71tz.js";import{t as ve}from"./qr-code-DsN9sWfN.js";var ye=n(),Z=e(t(),1),Q=o(),be=new Intl.DateTimeFormat(void 0,{dateStyle:`medium`,timeStyle:`short`});function xe(e){return e===null||!Number.isFinite(e)?null:be.format(new Date(e))}function Se(){let e=(0,ye.c)(15),[t,n]=(0,Z.useState)(null),[r,i]=(0,Z.useState)(0),[a,o]=(0,Z.useState)(``),[s,l]=(0,Z.useState)(!1),u=(0,Z.useRef)(0),d;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(d=()=>{n(null),i(0),o(``)},e[0]=d):d=e[0];let f=d,p;e[1]===t?.options?p=e[2]:(p=()=>{u.current+=1,c.cancelAccountAction(),t?.options?.onAbandoned?.(),l(!1),f()},e[1]=t?.options,e[2]=p);let m=p,h;e[3]===Symbol.for(`react.memo_cache_sentinel`)?(h=async(e,t,r)=>{let a=u.current+=1;l(!1);let s=await t({});if(u.current===a){if(B(s)){o(``),i(0),n({action:e,run:t,options:r,inferred:s.inferredErrorCode===!0});return}s.status===`committed`&&r?.onCommitted?.()}},e[3]=h):h=e[3];let g=h,_;e[4]!==t||e[5]!==a||e[6]!==r?(_=async()=>{if(!t)return;let e=H(a);if(e.length===0)return;let n=u.current+=1,s=await t.run({totpCode:e});if(u.current===n){if(B(s)){let e=r+1;if(z(s,e)){i(e),o(``);return}l(!0),t.options?.onAbandoned?.(),f();return}s.status===`committed`&&t.options?.onCommitted?.(),f()}},e[4]=t,e[5]=a,e[6]=r,e[7]=_):_=e[7];let v=_,y;return e[8]!==m||e[9]!==t||e[10]!==a||e[11]!==r||e[12]!==s||e[13]!==v?(y={run:g,cancel:m,stepUp:t,stepUpAttempts:r,stepUpCode:a,stepUpUnresolved:s,setStepUpCode:o,submitStepUp:v},e[8]=m,e[9]=t,e[10]=a,e[11]=r,e[12]=s,e[13]=v,e[14]=y):y=e[14],y}function Ce(){let e=(0,ye.c)(1),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=[],e[0]=t):t=e[0],(0,Z.useEffect)(we,t)}function we(){return c.leaseRecoveryCodeDisplay()}function $(e){let t=(0,ye.c)(3),{busy:n,children:r}=e,i;return t[0]!==n||t[1]!==r?(i=n?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(A,{className:`size-3.5`}),r]}):(0,Q.jsx)(Q.Fragment,{children:r}),t[0]=n,t[1]=r,t[2]=i):i=t[2],i}function Te(){let e=(0,ye.c)(99),t=a(We),n=a(Ue),[o,c]=(0,Z.useState)(!1),l=i(He),u=i(Ve),d=i(Be),f=i(ze),m=i(Re),_=i(Le),v=i(Ie),y=i(Fe),x=a(Pe),E=a(Ne),[D,ee]=(0,Z.useState)(!1),[O,te]=(0,Z.useState)(null),ne=(0,Z.useRef)(!1),k=Se(),A=k.run;Ce();let j=_!==`idle`,M;e[0]===m?M=e[1]:(M=de(m),e[0]=m,e[1]=M);let N=M,re;e[2]===d?.externalIdentities?re=e[3]:(re=d?.externalIdentities.find(Me)??null,e[2]=d?.externalIdentities,e[3]=re);let ie=re,ae;e[4]===D?ae=e[5]:(ae=async()=>{if(!D){ee(!0),te(null);try{await fe({intent:`link`,returnTo:`/account/security`,start:je,navigate:Ae})}catch(e){let t=e;te(t instanceof s?t.message:`GitHub connection is temporarily unavailable.`),ee(!1)}}},e[4]=D,e[5]=ae);let oe=ae,P;e[6]===Symbol.for(`react.memo_cache_sentinel`)?(P=[],e[6]=P):P=e[6],(0,Z.useEffect)(ke,P);let se,F;if(e[7]!==t||e[8]!==A?(se=()=>{if(t!==`authenticated`||ne.current)return;ne.current=!0;let e=new AbortController;return r.getPendingExternalIdentity(e.signal).then(e=>{if(e.status===`link`)return A(`connect-github`,Oe);e.status===`error`&&te(K(e.code))}).catch(De),()=>e.abort()},F=[t,A],e[7]=t,e[8]=A,e[9]=se,e[10]=F):(se=e[9],F=e[10]),(0,Z.useEffect)(se,F),t!==`authenticated`){let t;return e[11]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,Q.jsx)(ge,{children:(0,Q.jsxs)(T,{variant:`warning`,children:[(0,Q.jsx)(h,{"aria-hidden":!0}),(0,Q.jsx)(S,{children:`Not signed in`}),(0,Q.jsx)(w,{children:`Sign in to the Hub to manage passkeys, two-factor authentication, and recovery codes.`})]})}),e[11]=t):t=e[11],t}let I;e[12]!==k.stepUp||e[13]!==k.stepUpUnresolved||e[14]!==y||e[15]!==v?(I=k.stepUpUnresolved?U:W(v,y,k.stepUp!==null),e[12]=k.stepUp,e[13]=k.stepUpUnresolved,e[14]=y,e[15]=v,e[16]=I):I=e[16];let L=I,z;e[17]!==k.stepUpUnresolved||e[18]!==y?(z=!k.stepUpUnresolved&&le(y),e[17]=k.stepUpUnresolved,e[18]=y,e[19]=z):z=e[19];let ce=z,B;e[20]!==l||e[21]!==u?(B=R(l,u),e[20]=l,e[21]=u,e[22]=B):B=e[22];let V=B,H;e[23]!==L||e[24]!==ce?(H=L?(0,Q.jsxs)(T,{variant:ce?`info`:`error`,"aria-live":`polite`,children:[(0,Q.jsx)(h,{"aria-hidden":!0}),(0,Q.jsx)(S,{children:ce?`Passkey needed`:`That did not work`}),(0,Q.jsx)(w,{children:L})]}):null,e[23]=L,e[24]=ce,e[25]=H):H=e[25];let G;e[26]===O?G=e[27]:(G=O?(0,Q.jsxs)(T,{variant:`warning`,"aria-live":`polite`,children:[(0,Q.jsx)(h,{"aria-hidden":!0}),(0,Q.jsx)(S,{children:`GitHub connection did not complete`}),(0,Q.jsx)(w,{children:O})]}):null,e[26]=O,e[27]=G);let q;e[28]!==d||e[29]!==f?(q=d===null&&f!==`stale`?(0,Q.jsxs)(T,{variant:`info`,"aria-live":`polite`,children:[(0,Q.jsx)(p,{"aria-hidden":!0}),(0,Q.jsx)(S,{children:`Checking account security`}),(0,Q.jsx)(w,{children:`Reading which fallback sign-in methods are configured on this Hub.`})]}):null,e[28]=d,e[29]=f,e[30]=q):q=e[30];let ue;e[31]!==j||e[32]!==d||e[33]!==f?(ue=f===`stale`?(0,Q.jsxs)(T,{variant:`warning`,"aria-live":`polite`,children:[(0,Q.jsx)(h,{"aria-hidden":!0}),(0,Q.jsx)(S,{children:d===null?`Account security unavailable`:`Account security may be outdated`}),(0,Q.jsx)(w,{children:d===null?`Ryco could not read the current password, authenticator, and email state.`:`These controls use the last state Ryco successfully read from the Hub.`}),(0,Q.jsx)(C,{children:(0,Q.jsx)(b,{size:`xs`,variant:`outline`,disabled:j,onClick:Ee,children:`Retry`})})]}):null,e[31]=j,e[32]=d,e[33]=f,e[34]=ue):ue=e[34];let J;e[35]!==j||e[36]!==V?(J=V?(0,Q.jsxs)(T,{variant:V.variant,"aria-live":`polite`,children:[(0,Q.jsx)(h,{"aria-hidden":!0}),(0,Q.jsx)(S,{children:V.title}),(0,Q.jsx)(w,{children:V.description}),(0,Q.jsx)(C,{children:(0,Q.jsx)(b,{size:`xs`,variant:`outline`,disabled:j,onClick:()=>c(!0),children:V.actionLabel})})]}):null,e[35]=j,e[36]=V,e[37]=J):J=e[37];let pe;e[38]===Symbol.for(`react.memo_cache_sentinel`)?(pe=(0,Q.jsx)(g,{"aria-hidden":!0,className:`size-3.5`}),e[38]=pe):pe=e[38];let Y=n?.displayName??`Signed in`,X;e[39]===n?X=e[40]:(X=n?`${n.role} · joined ${xe(n.createdAt)??`unknown`}`:null,e[39]=n,e[40]=X);let me;e[41]!==Y||e[42]!==X?(me=(0,Q.jsx)(he,{title:`Account`,icon:pe,children:(0,Q.jsx)(_e,{title:Y,description:`The Hub account these credentials belong to.`,status:X})}),e[41]=Y,e[42]=X,e[43]=me):me=e[43];let ve;e[44]!==_||e[45]!==j||e[46]!==D||e[47]!==ie||e[48]!==N?.link||e[49]!==A||e[50]!==oe?(ve=ie||N?.link?(0,Q.jsx)(Ge,{identity:ie,actionsAvailable:N?.link===!0,busy:j||D,actionStatus:_,onConnect:()=>void oe(),run:A}):null,e[44]=_,e[45]=j,e[46]=D,e[47]=ie,e[48]=N?.link,e[49]=A,e[50]=oe,e[51]=ve):ve=e[51];let be=u===`loading`,we=u===`stale`,$;e[52]!==k.cancel||e[53]!==k.run||e[54]!==_||e[55]!==o||e[56]!==j||e[57]!==l||e[58]!==be||e[59]!==we?($=(0,Q.jsx)(qe,{passkeys:l,loading:be,stale:we,busy:j,actionStatus:_,addOpen:o,setAddOpen:c,run:k.run,cancel:k.cancel}),e[52]=k.cancel,e[53]=k.run,e[54]=_,e[55]=o,e[56]=j,e[57]=l,e[58]=be,e[59]=we,e[60]=$):$=e[60];let Te=d?.totpEnrolled??null,Ke;e[61]!==k.run||e[62]!==_||e[63]!==j||e[64]!==Te||e[65]!==E?(Ke=(0,Q.jsx)(Je,{busy:j,actionStatus:_,enrollment:E,enrolled:Te,run:k.run}),e[61]=k.run,e[62]=_,e[63]=j,e[64]=Te,e[65]=E,e[66]=Ke):Ke=e[66];let Ye;e[67]!==k.run||e[68]!==_||e[69]!==j||e[70]!==x?(Ye=(0,Q.jsx)(et,{busy:j,actionStatus:_,recoveryCodes:x,run:k.run}),e[67]=k.run,e[68]=_,e[69]=j,e[70]=x,e[71]=Ye):Ye=e[71];let Xe;e[72]!==k.cancel||e[73]!==k.run||e[74]!==_||e[75]!==j||e[76]!==d?(Xe=(0,Q.jsx)(Ze,{busy:j,actionStatus:_,security:d,run:k.run,cancel:k.cancel}),e[72]=k.cancel,e[73]=k.run,e[74]=_,e[75]=j,e[76]=d,e[77]=Xe):Xe=e[77];let Qe;e[78]!==k.cancel||e[79]!==k.setStepUpCode||e[80]!==k.stepUp||e[81]!==k.stepUpAttempts||e[82]!==k.stepUpCode||e[83]!==k.submitStepUp||e[84]!==j?(Qe=(0,Q.jsx)(at,{pending:k.stepUp,attempts:k.stepUpAttempts,code:k.stepUpCode,onCodeChange:k.setStepUpCode,onSubmit:k.submitStepUp,onCancel:k.cancel,busy:j}),e[78]=k.cancel,e[79]=k.setStepUpCode,e[80]=k.stepUp,e[81]=k.stepUpAttempts,e[82]=k.stepUpCode,e[83]=k.submitStepUp,e[84]=j,e[85]=Qe):Qe=e[85];let $e;return e[86]!==G||e[87]!==q||e[88]!==ue||e[89]!==J||e[90]!==me||e[91]!==ve||e[92]!==$||e[93]!==Ke||e[94]!==Ye||e[95]!==Xe||e[96]!==Qe||e[97]!==H?($e=(0,Q.jsxs)(ge,{children:[H,G,q,ue,J,me,ve,$,Ke,Ye,Xe,Qe]}),e[86]=G,e[87]=q,e[88]=ue,e[89]=J,e[90]=me,e[91]=ve,e[92]=$,e[93]=Ke,e[94]=Ye,e[95]=Xe,e[96]=Qe,e[97]=H,e[98]=$e):$e=e[98],$e}function Ee(){c.refreshAccountSecurity({force:!0})}function De(){}function Oe(e){return c.finishBrowserExternalIdentityConnection(`github`,e)}function ke(){c.refreshPasskeys(),c.refreshAccountSecurity(),c.refreshExternalIdentityConfiguration()}function Ae(e){return window.location.assign(e)}function je(e){return r.startExternalIdentityAuthorization(e)}function Me(e){return e.provider===`github`}function Ne(e){return e.totpEnrollment??null}function Pe(e){return e.recoveryCodes}function Fe(e){return e.errorCode??null}function Ie(e){return e.errorMessage}function Le(e){return e.actionStatus}function Re(e){return e.externalIdentityConfiguration}function ze(e){return e.securityStatus}function Be(e){return e.security}function Ve(e){return e.passkeysStatus}function He(e){return e.passkeys}function Ue(e){return e.account}function We(e){return e.accountStatus}function Ge(e){let t=(0,ye.c)(33),{identity:n,actionsAvailable:r,busy:i,actionStatus:a,onConnect:o,run:s}=e,[c,l]=(0,Z.useState)(!1),u=a===`connecting-external-identity`,d=a===`disconnecting-external-identity`,f;t[0]===s?f=t[1]:(f=async()=>{await s(`disconnect-github`,Ke,{onCommitted:()=>l(!1)})},t[0]=s,t[1]=f);let p=f,m;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(m=(0,Q.jsx)(y,{"aria-hidden":!0,className:`size-3.5`}),t[2]=m):m=t[2];let h=n?`GitHub · @${n.login}`:`GitHub`,g=n?`Use this GitHub identity to sign in to Ryco. Repository access remains separate.`:`Connect GitHub as another way to sign in. Ryco requests no repository access.`,_;t[3]===n?_=t[4]:(_=n?`Connected ${xe(n.connectedAt)??`at an unknown time`}${n.lastUsedAt===null?``:` · last used ${xe(n.lastUsedAt)??`at an unknown time`}`}`:null,t[3]=n,t[4]=_);let v;t[5]!==r||t[6]!==i||t[7]!==u||t[8]!==d||t[9]!==n||t[10]!==o?(v=r?n?(0,Q.jsx)(b,{size:`sm`,variant:`outline`,disabled:i,onClick:()=>l(!0),children:(0,Q.jsx)($,{busy:d,children:`Disconnect`})}):(0,Q.jsx)(b,{size:`sm`,variant:`outline`,disabled:i,onClick:o,children:(0,Q.jsx)($,{busy:u,children:`Connect GitHub`})}):null,t[5]=r,t[6]=i,t[7]=u,t[8]=d,t[9]=n,t[10]=o,t[11]=v):v=t[11];let x;t[12]!==h||t[13]!==g||t[14]!==_||t[15]!==v?(x=(0,Q.jsx)(_e,{title:h,description:g,status:_,control:v}),t[12]=h,t[13]=g,t[14]=_,t[15]=v,t[16]=x):x=t[16];let S;t[17]===Symbol.for(`react.memo_cache_sentinel`)?(S=(0,Q.jsxs)(j,{children:[(0,Q.jsx)(ae,{children:`Disconnect GitHub?`}),(0,Q.jsx)(ie,{children:`You will no longer be able to sign in with GitHub. Ryco refuses this change if GitHub is your only remaining sign-in method.`})]}),t[17]=S):S=t[17];let C;t[18]===Symbol.for(`react.memo_cache_sentinel`)?(C=(0,Q.jsx)(N,{render:(0,Q.jsx)(b,{variant:`outline`}),children:`Cancel`}),t[18]=C):C=t[18];let w;t[19]===p?w=t[20]:(w=()=>void p(),t[19]=p,t[20]=w);let T;t[21]===d?T=t[22]:(T=(0,Q.jsx)($,{busy:d,children:`Disconnect GitHub`}),t[21]=d,t[22]=T);let E;t[23]!==i||t[24]!==w||t[25]!==T?(E=(0,Q.jsxs)(re,{children:[S,(0,Q.jsxs)(M,{children:[C,(0,Q.jsx)(b,{disabled:i,onClick:w,children:T})]})]}),t[23]=i,t[24]=w,t[25]=T,t[26]=E):E=t[26];let D;t[27]!==c||t[28]!==E?(D=(0,Q.jsx)(oe,{open:c,onOpenChange:l,children:E}),t[27]=c,t[28]=E,t[29]=D):D=t[29];let ee;return t[30]!==D||t[31]!==x?(ee=(0,Q.jsxs)(he,{title:`Connected accounts`,icon:m,children:[x,D]}),t[30]=D,t[31]=x,t[32]=ee):ee=t[32],ee}function Ke(e){return c.disconnectExternalIdentity(`github`,e)}function qe({passkeys:e,loading:t,stale:n,busy:r,actionStatus:i,addOpen:a,setAddOpen:o,run:s,cancel:l}){let[u,f]=(0,Z.useState)(``),[p,h]=(0,Z.useState)(null),[g,y]=(0,Z.useState)(null),x=i===`adding-passkey`,S=i===`revoking-passkey`,C=q(e),w=F(e),T=V(e),A=(0,Z.useCallback)(()=>{f(``),o(!1)},[o]),I=async e=>{e.preventDefault();let t=G(u);await s(`add-passkey`,e=>c.addPasskey({passkeyLabel:t,...e}),{onCommitted:A,onAbandoned:A})},R=async()=>{let e=p;if(e){h(null),y(e.id);try{await c.revokePasskey(e.id)}finally{y(null)}}};return(0,Q.jsxs)(he,{title:`Passkeys`,icon:(0,Q.jsx)(d,{"aria-hidden":!0,className:`size-3.5`}),headerAction:(0,Q.jsx)(b,{size:`xs`,variant:`outline`,disabled:r,onClick:()=>o(!0),children:`Add passkey`}),children:[(0,Q.jsx)(_e,{title:`Passkeys on this account`,description:`A passkey is the strongest way in. Add one for every device you sign in from, and keep at least two so losing a device does not lock you out.`,status:n?`This list could not be refreshed and may be out of date.`:(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`span`,{children:`${String(C.length)} usable ${C.length===1?`passkey`:`passkeys`}`}),w>0?(0,Q.jsx)(`span`,{children:` · ${String(w)} synced to a password manager`}):null]})}),t&&e.length===0?(0,Q.jsx)(_e,{title:`Loading passkeys…`,description:`Reading the credentials on file.`}):null,!t&&e.length===0?(0,Q.jsx)(_e,{title:`No passkeys yet`,description:`Add one now — without a passkey you can only get back in through a fallback credential.`}):null,T.map(e=>{let t=pe(e),n=L(e),i=xe(e.createdAt),a=xe(e.lastUsedAt);return(0,Q.jsx)(_e,{title:(0,Q.jsxs)(`span`,{className:`flex items-center gap-2`,children:[Y(e),t?(0,Q.jsx)(P,{variant:`error`,size:`sm`,children:`Revoked`}):null]}),description:t?`Revoked${e.revocationReasonCode?` — ${e.revocationReasonCode}`:``}. This credential can no longer sign in.`:n??`The Hub did not report whether this credential is backed up.`,status:[i?`Added ${i}`:null,a?`Last used ${a}`:`Never used`].filter(e=>e!==null).join(` · `),control:t?null:(0,Q.jsx)(b,{size:`xs`,variant:`destructive-outline`,"aria-label":`Revoke ${Y(e)}`,disabled:r,onClick:()=>h(e),children:(0,Q.jsxs)($,{busy:S&&g===e.id,children:[(0,Q.jsx)(m,{"aria-hidden":!0}),`Revoke`]})})},e.id)}),(0,Q.jsx)(k,{open:a,onOpenChange:e=>{if(e){o(!0);return}r||A()},children:(0,Q.jsx)(ne,{className:`max-w-md`,children:(0,Q.jsxs)(`form`,{onSubmit:e=>void I(e),children:[(0,Q.jsxs)(E,{children:[(0,Q.jsx)(D,{children:`Add a passkey`}),(0,Q.jsx)(te,{children:`Your browser will ask you to create a passkey for this account. Adding one replaces the current Hub session with a fresh one.`})]}),(0,Q.jsxs)(O,{className:`space-y-3`,children:[(0,Q.jsx)(se,{htmlFor:`account-passkey-label`,children:`Name (optional)`}),(0,Q.jsx)(v,{id:`account-passkey-label`,value:u,autoComplete:`off`,placeholder:`Work laptop`,disabled:x,className:_,onChange:e=>f(e.target.value)})]}),(0,Q.jsxs)(ee,{children:[(0,Q.jsx)(b,{variant:`outline`,onClick:()=>{l(),A()},children:`Cancel`}),(0,Q.jsx)(b,{type:`submit`,disabled:r,children:(0,Q.jsx)($,{busy:x,children:`Create passkey`})})]})]})})}),(0,Q.jsx)(oe,{open:p!==null,onOpenChange:e=>{r||e||h(null)},children:(0,Q.jsxs)(re,{children:[(0,Q.jsxs)(j,{children:[(0,Q.jsx)(ae,{children:`Revoke this passkey?`}),(0,Q.jsxs)(ie,{children:[C.length===1?`This is the only usable passkey on this account. `:``,p?Y(p):``,` will stop working immediately, on every device it is stored on. This cannot be undone — you would have to enrol the device again.`]})]}),(0,Q.jsxs)(M,{children:[(0,Q.jsx)(N,{render:(0,Q.jsx)(b,{variant:`outline`}),children:`Keep it`}),(0,Q.jsx)(b,{variant:`destructive`,disabled:r,onClick:()=>void R(),children:`Revoke passkey`})]})]})})]})}function Je(e){let t=(0,ye.c)(61),{busy:n,actionStatus:r,enrollment:i,enrolled:a,run:o}=e,[s,l]=(0,Z.useState)(``),[u,d]=(0,Z.useState)(!1),f=r===`enrolling-totp`,m=r===`confirming-totp`,h=r===`revoking-totp`,g;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(g=()=>{l(``),c.dismissTotpEnrollment()},t[0]=g):g=t[0];let y=g,x;t[1]===s?x=t[2]:(x=async e=>{e.preventDefault();let t=H(s);t.length!==0&&(await c.confirmTotpEnrollment({code:t}),l(``))},t[1]=s,t[2]=x);let S=x,C;t[3]===o?C=t[4]:(C=async()=>{d(!1),await o(`revoke-totp`,Xe)},t[3]=o,t[4]=C);let w=C,T;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(T=(0,Q.jsx)(p,{"aria-hidden":!0,className:`size-3.5`}),t[5]=T):T=t[5];let A=a===null?`Checking current state…`:a?`On`:`Off`,P;t[6]!==n||t[7]!==a||t[8]!==f||t[9]!==h?(P=a===null?null:a?(0,Q.jsx)(b,{size:`xs`,variant:`destructive-outline`,"aria-label":`Turn off two-factor authentication`,disabled:n,onClick:()=>d(!0),children:(0,Q.jsx)($,{busy:h,children:`Turn off`})}):(0,Q.jsx)(b,{size:`xs`,variant:`outline`,disabled:n,onClick:Ye,children:(0,Q.jsx)($,{busy:f,children:`Set up`})}),t[6]=n,t[7]=a,t[8]=f,t[9]=h,t[10]=P):P=t[10];let F;t[11]!==A||t[12]!==P?(F=(0,Q.jsx)(_e,{title:`Authenticator app`,description:`A six-digit code from an authenticator app, required whenever you change credentials from a session that was not started with a passkey. Signing in with a passkey never asks for one.`,status:A,control:P}),t[11]=A,t[12]=P,t[13]=F):F=t[13];let I=i!==null,L;t[14]===Symbol.for(`react.memo_cache_sentinel`)?(L=e=>{e||y()},t[14]=L):L=t[14];let R;t[15]===S?R=t[16]:(R=e=>void S(e),t[15]=S,t[16]=R);let z;t[17]===Symbol.for(`react.memo_cache_sentinel`)?(z=(0,Q.jsxs)(E,{children:[(0,Q.jsx)(D,{children:`Set up two-factor authentication`}),(0,Q.jsx)(te,{children:`Scan this with your authenticator app, then enter the code it shows. This is the only time the key is displayed.`})]}),t[17]=z):z=t[17];let ce;t[18]===i?ce=t[19]:(ce=i?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`div`,{className:`flex justify-center rounded-xl border border-border bg-white p-4`,children:(0,Q.jsx)(ve,{value:i.provisioningUri,size:168,level:`M`,marginSize:1,title:`Two-factor setup code`})}),(0,Q.jsxs)(`div`,{className:`space-y-1`,children:[(0,Q.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Can't scan? Enter this key manually:`}),(0,Q.jsx)(`p`,{"aria-label":`Two-factor setup key`,className:`rounded-lg border border-border bg-background px-3 py-2 font-mono text-sm break-all`,children:i.secretBase32})]})]}):null,t[18]=i,t[19]=ce);let le;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(le=(0,Q.jsx)(se,{htmlFor:`account-totp-confirm`,children:`Code from your app`}),t[20]=le):le=t[20];let B;t[21]===Symbol.for(`react.memo_cache_sentinel`)?(B=e=>l(H(e.target.value)),t[21]=B):B=t[21];let V;t[22]!==s||t[23]!==m?(V=(0,Q.jsxs)(`div`,{className:`space-y-2`,children:[le,(0,Q.jsx)(v,{id:`account-totp-confirm`,value:s,inputMode:`numeric`,autoComplete:`one-time-code`,maxLength:16,disabled:m,className:_,onChange:B})]}),t[22]=s,t[23]=m,t[24]=V):V=t[24];let U;t[25]!==ce||t[26]!==V?(U=(0,Q.jsxs)(O,{className:`space-y-4`,children:[ce,V]}),t[25]=ce,t[26]=V,t[27]=U):U=t[27];let W;t[28]===Symbol.for(`react.memo_cache_sentinel`)?(W=(0,Q.jsx)(b,{variant:`outline`,onClick:y,children:`Cancel`}),t[28]=W):W=t[28];let G;t[29]!==n||t[30]!==s?(G=n||!ue(s),t[29]=n,t[30]=s,t[31]=G):G=t[31];let K;t[32]===m?K=t[33]:(K=(0,Q.jsx)($,{busy:m,children:`Turn on`}),t[32]=m,t[33]=K);let q;t[34]!==G||t[35]!==K?(q=(0,Q.jsxs)(ee,{children:[W,(0,Q.jsx)(b,{type:`submit`,disabled:G,children:K})]}),t[34]=G,t[35]=K,t[36]=q):q=t[36];let de;t[37]!==R||t[38]!==U||t[39]!==q?(de=(0,Q.jsx)(ne,{className:`max-w-md`,children:(0,Q.jsxs)(`form`,{onSubmit:R,children:[z,U,q]})}),t[37]=R,t[38]=U,t[39]=q,t[40]=de):de=t[40];let J;t[41]!==de||t[42]!==I?(J=(0,Q.jsx)(k,{open:I,onOpenChange:L,children:de}),t[41]=de,t[42]=I,t[43]=J):J=t[43];let fe;t[44]===n?fe=t[45]:(fe=e=>{n||d(e)},t[44]=n,t[45]=fe);let pe;t[46]===Symbol.for(`react.memo_cache_sentinel`)?(pe=(0,Q.jsxs)(j,{children:[(0,Q.jsx)(ae,{children:`Remove two-factor authentication?`}),(0,Q.jsx)(ie,{children:`Password, recovery-code, and emailed-link sign-ins will no longer need a code from your authenticator app. You can set it up again at any time.`})]}),t[46]=pe):pe=t[46];let Y;t[47]===Symbol.for(`react.memo_cache_sentinel`)?(Y=(0,Q.jsx)(N,{render:(0,Q.jsx)(b,{variant:`outline`}),children:`Keep it on`}),t[47]=Y):Y=t[47];let X;t[48]===w?X=t[49]:(X=()=>void w(),t[48]=w,t[49]=X);let me;t[50]!==n||t[51]!==X?(me=(0,Q.jsxs)(re,{children:[pe,(0,Q.jsxs)(M,{children:[Y,(0,Q.jsx)(b,{variant:`destructive`,disabled:n,onClick:X,children:`Remove two-factor`})]})]}),t[50]=n,t[51]=X,t[52]=me):me=t[52];let ge;t[53]!==u||t[54]!==fe||t[55]!==me?(ge=(0,Q.jsx)(oe,{open:u,onOpenChange:fe,children:me}),t[53]=u,t[54]=fe,t[55]=me,t[56]=ge):ge=t[56];let be;return t[57]!==J||t[58]!==ge||t[59]!==F?(be=(0,Q.jsxs)(he,{title:`Two-factor authentication`,icon:T,children:[F,J,ge]}),t[57]=J,t[58]=ge,t[59]=F,t[60]=be):be=t[60],be}function Ye(){c.beginTotpEnrollment()}function Xe(e){return c.revokeTotp(e)}function Ze(e){let t=(0,ye.c)(86),{busy:n,actionStatus:r,security:i,run:a,cancel:o}=e,[s,l]=(0,Z.useState)(!1),[u,f]=(0,Z.useState)(``),[p,m]=(0,Z.useState)(``),[h,g]=(0,Z.useState)(!1),[y,x]=(0,Z.useState)(!1),S=r===`setting-password`,C=r===`removing-password`,w;t[0]!==p||t[1]!==u?(w=me(u,p),t[0]=p,t[1]=u,t[2]=w):w=t[2];let T=w,A;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(A=()=>{f(``),m(``),g(!1)},t[3]=A):A=t[3];let P=A,F;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(F=()=>{P(),l(!1)},t[4]=F):F=t[4];let I=F,L;t[5]===o?L=t[6]:(L=()=>{o(),I()},t[5]=o,t[6]=L);let R=L,z;t[7]!==T||t[8]!==u||t[9]!==a?(z=async e=>{e.preventDefault(),g(!0),!T&&await a(`set-password`,e=>c.setPassword({password:u,...e}),{onCommitted:I,onAbandoned:I})},t[7]=T,t[8]=u,t[9]=a,t[10]=z):z=t[10];let ce=z,le;t[11]===a?le=t[12]:(le=async()=>{x(!1),await a(`remove-password`,Qe)},t[11]=a,t[12]=le);let B=le,V;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(V=(0,Q.jsx)(d,{"aria-hidden":!0,className:`size-3.5`}),t[13]=V):V=t[13];let H=i===null?`Checking current state…`:i.passwordConfigured?`Set`:`Not set`,U;t[14]!==n||t[15]!==C||t[16]!==i||t[17]!==S?(U=i===null?null:(0,Q.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,Q.jsx)(b,{size:`xs`,variant:`outline`,disabled:n,onClick:()=>l(!0),children:(0,Q.jsx)($,{busy:S,children:i.passwordConfigured?`Change`:`Set password`})}),i.passwordConfigured?(0,Q.jsx)(b,{size:`xs`,variant:`destructive-outline`,"aria-label":`Delete the fallback password`,disabled:n,onClick:()=>x(!0),children:(0,Q.jsx)($,{busy:C,children:`Remove`})}):null]}),t[14]=n,t[15]=C,t[16]=i,t[17]=S,t[18]=U):U=t[18];let W;t[19]!==H||t[20]!==U?(W=(0,Q.jsx)(_e,{title:`Fallback password`,description:`A password is a fallback, not an equal of a passkey: it can be phished and reused, and a session started with one has to prove itself again before changing credentials. Keep a passkey as your normal way in.`,status:H,control:U}),t[19]=H,t[20]=U,t[21]=W):W=t[21];let G=i===null?void 0:i.email,K=i?.emailDeliveryConfigured,q;t[22]!==r||t[23]!==n||t[24]!==a||t[25]!==G||t[26]!==K?(q=(0,Q.jsx)($e,{busy:n,actionStatus:r,email:G,deliveryConfigured:K,run:a}),t[22]=r,t[23]=n,t[24]=a,t[25]=G,t[26]=K,t[27]=q):q=t[27];let ue;t[28]===R?ue=t[29]:(ue=e=>{if(e){l(!0);return}R()},t[28]=R,t[29]=ue);let de;t[30]===ce?de=t[31]:(de=e=>void ce(e),t[30]=ce,t[31]=de);let J;t[32]===Symbol.for(`react.memo_cache_sentinel`)?(J=(0,Q.jsxs)(E,{children:[(0,Q.jsx)(D,{children:`Set a fallback password`}),(0,Q.jsx)(te,{children:`This replaces any password already on the account. The Hub rejects passwords that have appeared in a known breach.`})]}),t[32]=J):J=t[32];let fe;t[33]===Symbol.for(`react.memo_cache_sentinel`)?(fe=(0,Q.jsx)(se,{htmlFor:`account-password`,children:`New password`}),t[33]=fe):fe=t[33];let pe;t[34]===Symbol.for(`react.memo_cache_sentinel`)?(pe=e=>f(e.target.value),t[34]=pe):pe=t[34];let Y;t[35]!==u||t[36]!==S?(Y=(0,Q.jsxs)(`div`,{className:`space-y-2`,children:[fe,(0,Q.jsx)(v,{id:`account-password`,type:`password`,value:u,autoComplete:`new-password`,maxLength:256,disabled:S,className:_,onChange:pe})]}),t[35]=u,t[36]=S,t[37]=Y):Y=t[37];let X;t[38]===Symbol.for(`react.memo_cache_sentinel`)?(X=(0,Q.jsx)(se,{htmlFor:`account-password-confirm`,children:`Confirm password`}),t[38]=X):X=t[38];let ge;t[39]===Symbol.for(`react.memo_cache_sentinel`)?(ge=e=>m(e.target.value),t[39]=ge):ge=t[39];let ve;t[40]!==p||t[41]!==S?(ve=(0,Q.jsxs)(`div`,{className:`space-y-2`,children:[X,(0,Q.jsx)(v,{id:`account-password-confirm`,type:`password`,value:p,autoComplete:`new-password`,maxLength:256,disabled:S,className:_,onChange:ge})]}),t[40]=p,t[41]=S,t[42]=ve):ve=t[42];let be;t[43]!==T||t[44]!==h?(be=h&&T?(0,Q.jsx)(`p`,{role:`alert`,className:`text-xs text-destructive-foreground`,children:T}):null,t[43]=T,t[44]=h,t[45]=be):be=t[45];let xe;t[46]!==Y||t[47]!==ve||t[48]!==be?(xe=(0,Q.jsxs)(O,{className:`space-y-3`,children:[Y,ve,be]}),t[46]=Y,t[47]=ve,t[48]=be,t[49]=xe):xe=t[49];let Se;t[50]===R?Se=t[51]:(Se=(0,Q.jsx)(b,{variant:`outline`,onClick:R,children:`Cancel`}),t[50]=R,t[51]=Se);let Ce;t[52]===S?Ce=t[53]:(Ce=(0,Q.jsx)($,{busy:S,children:`Save password`}),t[52]=S,t[53]=Ce);let we;t[54]!==n||t[55]!==Ce?(we=(0,Q.jsx)(b,{type:`submit`,disabled:n,children:Ce}),t[54]=n,t[55]=Ce,t[56]=we):we=t[56];let Te;t[57]!==Se||t[58]!==we?(Te=(0,Q.jsxs)(ee,{children:[Se,we]}),t[57]=Se,t[58]=we,t[59]=Te):Te=t[59];let Ee;t[60]!==de||t[61]!==xe||t[62]!==Te?(Ee=(0,Q.jsx)(ne,{className:`max-w-md`,children:(0,Q.jsxs)(`form`,{onSubmit:de,children:[J,xe,Te]})}),t[60]=de,t[61]=xe,t[62]=Te,t[63]=Ee):Ee=t[63];let De;t[64]!==s||t[65]!==ue||t[66]!==Ee?(De=(0,Q.jsx)(k,{open:s,onOpenChange:ue,children:Ee}),t[64]=s,t[65]=ue,t[66]=Ee,t[67]=De):De=t[67];let Oe;t[68]===n?Oe=t[69]:(Oe=e=>{n||x(e)},t[68]=n,t[69]=Oe);let ke;t[70]===Symbol.for(`react.memo_cache_sentinel`)?(ke=(0,Q.jsxs)(j,{children:[(0,Q.jsx)(ae,{children:`Remove the password?`}),(0,Q.jsx)(ie,{children:`You will no longer be able to sign in with a password. Make sure you still have a passkey, or recovery codes you have saved.`})]}),t[70]=ke):ke=t[70];let Ae;t[71]===Symbol.for(`react.memo_cache_sentinel`)?(Ae=(0,Q.jsx)(N,{render:(0,Q.jsx)(b,{variant:`outline`}),children:`Keep it`}),t[71]=Ae):Ae=t[71];let je;t[72]===B?je=t[73]:(je=()=>void B(),t[72]=B,t[73]=je);let Me;t[74]!==n||t[75]!==je?(Me=(0,Q.jsxs)(re,{children:[ke,(0,Q.jsxs)(M,{children:[Ae,(0,Q.jsx)(b,{variant:`destructive`,disabled:n,onClick:je,children:`Remove password`})]})]}),t[74]=n,t[75]=je,t[76]=Me):Me=t[76];let Ne;t[77]!==y||t[78]!==Oe||t[79]!==Me?(Ne=(0,Q.jsx)(oe,{open:y,onOpenChange:Oe,children:Me}),t[77]=y,t[78]=Oe,t[79]=Me,t[80]=Ne):Ne=t[80];let Pe;return t[81]!==W||t[82]!==q||t[83]!==De||t[84]!==Ne?(Pe=(0,Q.jsxs)(he,{title:`Fallback sign-in`,icon:V,children:[W,q,De,Ne]}),t[81]=W,t[82]=q,t[83]=De,t[84]=Ne,t[85]=Pe):Pe=t[85],Pe}function Qe(e){return c.removePassword(e)}function $e(e){let t=(0,ye.c)(25),{busy:n,actionStatus:r,email:i,deliveryConfigured:a,run:o}=e,[s,l]=(0,Z.useState)(``),[u,d]=(0,Z.useState)(!1),[f,p]=(0,Z.useState)(!1),m=r===`requesting-email-verification`,g;t[0]===s?g=t[1]:(g=J(s),t[0]=s,t[1]=g);let y=g,x;t[2]!==s||t[3]!==y||t[4]!==o?(x=async e=>{e.preventDefault(),d(!0),p(!1),!y&&await o(`request-email-verification`,e=>c.requestEmailVerification({email:s.trim(),...e}),{onCommitted:()=>{p(!0),l(``),d(!1)}})},t[2]=s,t[3]=y,t[4]=o,t[5]=x):x=t[5];let C=x,E;t[6]===a?E=t[7]:(E=a===!1?(0,Q.jsx)(`div`,{className:`border-t border-border/60 px-4 pt-3.5 sm:px-5`,children:(0,Q.jsxs)(T,{variant:`warning`,children:[(0,Q.jsx)(h,{"aria-hidden":!0}),(0,Q.jsx)(S,{children:`No mail will arrive yet`}),(0,Q.jsx)(w,{children:`This Hub has no mail transport configured, so verification messages are generated and discarded. The request below will be accepted and nothing will be delivered until an operator wires one up. Do not rely on email as your way back into the account.`})]})}):null,t[6]=a,t[7]=E);let D=a?`Used for account recovery after verification. The Hub answers the same way whether or not the address is already known, so this never confirms who owns it.`:`Used for account recovery once mail delivery is switched on. The Hub answers the same way whether or not the address is already known, so this never confirms who owns it.`,ee=i===void 0?`Checking current state…`:i===null?`Not set`:`${i.verified?`Verified`:`Verification pending`} · ${i.address}`,O;t[8]!==f||t[9]!==n||t[10]!==i||t[11]!==a||t[12]!==s||t[13]!==y||t[14]!==m||t[15]!==C||t[16]!==u?(O=i===void 0?null:(0,Q.jsxs)(`form`,{className:`pt-3 pb-3.5`,onSubmit:e=>void C(e),children:[(0,Q.jsxs)(`div`,{className:`flex flex-col gap-2 sm:flex-row`,children:[(0,Q.jsx)(v,{"aria-label":`Email address`,type:`email`,value:s,autoComplete:`email`,placeholder:`you@example.com`,maxLength:254,disabled:m,className:_,onChange:e=>{l(e.target.value),p(!1)}}),(0,Q.jsx)(b,{type:`submit`,size:`sm`,variant:`outline`,disabled:n,className:`shrink-0`,children:(0,Q.jsx)($,{busy:m,children:i===null?`Send verification`:i.verified?`Change email`:`Resend or change`})})]}),u&&y?(0,Q.jsx)(`p`,{role:`alert`,className:`pt-2 text-xs text-destructive-foreground`,children:y}):null,f?(0,Q.jsx)(`p`,{role:`status`,className:`pt-2 text-xs text-muted-foreground`,children:a?`Verification email requested. Check your inbox and spam folder; delivery may take a moment.`:`Request accepted by the Hub. No message will be delivered until a mail transport is configured.`}):null]}),t[8]=f,t[9]=n,t[10]=i,t[11]=a,t[12]=s,t[13]=y,t[14]=m,t[15]=C,t[16]=u,t[17]=O):O=t[17];let te;t[18]!==D||t[19]!==ee||t[20]!==O?(te=(0,Q.jsx)(_e,{title:`Recovery email`,description:D,status:ee,children:O}),t[18]=D,t[19]=ee,t[20]=O,t[21]=te):te=t[21];let ne;return t[22]!==E||t[23]!==te?(ne=(0,Q.jsxs)(Q.Fragment,{children:[E,te]}),t[22]=E,t[23]=te,t[24]=ne):ne=t[24],ne}function et(e){let t=(0,ye.c)(52),{busy:n,actionStatus:r,recoveryCodes:i,run:a}=e,[o,s]=(0,Z.useState)(!1),c=r===`regenerating-recovery-codes`,{copyToClipboard:d,isCopied:p}=x(),m;t[0]===a?m=t[1]:(m=async()=>{s(!1),await a(`regenerate-recovery-codes`,it)},t[0]=a,t[1]=m);let h=m,g;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(g=(0,Q.jsx)(f,{"aria-hidden":!0,className:`size-3.5`}),t[2]=g):g=t[2];let _;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(_=()=>s(!0),t[3]=_):_=t[3];let v;t[4]===c?v=t[5]:(v=(0,Q.jsx)($,{busy:c,children:`Generate new codes`}),t[4]=c,t[5]=v);let y;t[6]!==n||t[7]!==v?(y=(0,Q.jsx)(_e,{title:`One-time recovery codes`,description:`Single-use codes that get you back in when you have lost every passkey. They are a last resort, not a substitute for one — anyone holding a code can sign in as you.`,status:`Ryco shows them once and never writes them to browser storage.`,control:(0,Q.jsx)(b,{size:`xs`,variant:`destructive-outline`,disabled:n,onClick:_,children:v})}),t[6]=n,t[7]=v,t[8]=y):y=t[8];let S;t[9]===n?S=t[10]:(S=e=>{n||s(e)},t[9]=n,t[10]=S);let C;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(C=(0,Q.jsxs)(j,{children:[(0,Q.jsx)(ae,{children:`Replace your recovery codes?`}),(0,Q.jsx)(ie,{children:`Every code you have already saved stops working immediately. You will get a new set, shown once — if you lose them you will have to generate another set from a session you can still sign in to.`})]}),t[11]=C):C=t[11];let w;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(w=(0,Q.jsx)(N,{render:(0,Q.jsx)(b,{variant:`outline`}),children:`Cancel`}),t[12]=w):w=t[12];let T;t[13]===h?T=t[14]:(T=()=>void h(),t[13]=h,t[14]=T);let A;t[15]!==n||t[16]!==T?(A=(0,Q.jsxs)(re,{children:[C,(0,Q.jsxs)(M,{children:[w,(0,Q.jsx)(b,{variant:`destructive`,disabled:n,onClick:T,children:`Replace codes`})]})]}),t[15]=n,t[16]=T,t[17]=A):A=t[17];let P;t[18]!==o||t[19]!==A||t[20]!==S?(P=(0,Q.jsx)(oe,{open:o,onOpenChange:S,children:A}),t[18]=o,t[19]=A,t[20]=S,t[21]=P):P=t[21];let se=i.length>0,F;t[22]===Symbol.for(`react.memo_cache_sentinel`)?(F=(0,Q.jsx)(D,{children:`Save your recovery codes`}),t[22]=F):F=t[22];let I=String(i.length),L;t[23]===I?L=t[24]:(L=(0,Q.jsxs)(E,{children:[F,(0,Q.jsxs)(te,{children:[`Save all `,I,` codes — they are shown once and cannot be retrieved later. Store them somewhere only you can reach — a password manager, or paper somewhere safe.`]})]}),t[23]=I,t[24]=L);let R;t[25]===i?R=t[26]:(R=i.map(nt),t[25]=i,t[26]=R);let z;t[27]===R?z=t[28]:(z=(0,Q.jsx)(O,{children:(0,Q.jsx)(`ul`,{"aria-label":`Recovery codes`,className:`grid gap-2 rounded-xl border border-border bg-background p-4 font-mono text-sm break-all sm:grid-cols-2`,children:R})}),t[27]=R,t[28]=z);let le;t[29]!==d||t[30]!==i?(le=()=>d(ce(i),void 0),t[29]=d,t[30]=i,t[31]=le):le=t[31];let B;t[32]===p?B=t[33]:(B=p?(0,Q.jsx)(l,{"aria-hidden":!0}):(0,Q.jsx)(u,{"aria-hidden":!0}),t[32]=p,t[33]=B);let V=p?`Copied`:`Copy codes`,H;t[34]!==le||t[35]!==B||t[36]!==V?(H=(0,Q.jsxs)(b,{variant:`outline`,onClick:le,children:[B,V]}),t[34]=le,t[35]=B,t[36]=V,t[37]=H):H=t[37];let U;t[38]===Symbol.for(`react.memo_cache_sentinel`)?(U=(0,Q.jsx)(b,{onClick:tt,children:`I saved the codes`}),t[38]=U):U=t[38];let W;t[39]===H?W=t[40]:(W=(0,Q.jsxs)(ee,{children:[H,U]}),t[39]=H,t[40]=W);let G;t[41]!==L||t[42]!==z||t[43]!==W?(G=(0,Q.jsxs)(ne,{className:`max-w-md`,showCloseButton:!1,children:[L,z,W]}),t[41]=L,t[42]=z,t[43]=W,t[44]=G):G=t[44];let K;t[45]!==se||t[46]!==G?(K=(0,Q.jsx)(k,{open:se,disablePointerDismissal:!0,onOpenChange:rt,children:G}),t[45]=se,t[46]=G,t[47]=K):K=t[47];let q;return t[48]!==P||t[49]!==K||t[50]!==y?(q=(0,Q.jsxs)(he,{title:`Recovery codes`,icon:g,children:[y,P,K]}),t[48]=P,t[49]=K,t[50]=y,t[51]=q):q=t[51],q}function tt(){return c.dismissRecoveryCodes()}function nt(e){return(0,Q.jsx)(`li`,{children:e},e)}function rt(e,t){e||t.cancel()}function it(e){return c.regenerateRecoveryCodes(e)}function at(e){let t=(0,ye.c)(45),{pending:n,attempts:r,code:i,onCodeChange:a,onSubmit:o,onCancel:s,busy:c}=e,l=n!==null,u;t[0]===s?u=t[1]:(u=e=>{e||s()},t[0]=s,t[1]=u);let d;t[2]===o?d=t[3]:(d=e=>{e.preventDefault(),o()},t[2]=o,t[3]=d);let f;t[4]===n?f=t[5]:(f=n?I(n.action):``,t[4]=n,t[5]=f);let p;t[6]===f?p=t[7]:(p=(0,Q.jsx)(D,{children:f}),t[6]=f,t[7]=p);let m=n?.inferred??!1,h;t[8]!==r||t[9]!==m?(h=X(r,m),t[8]=r,t[9]=m,t[10]=h):h=t[10];let g;t[11]===h?g=t[12]:(g=(0,Q.jsx)(te,{children:h}),t[11]=h,t[12]=g);let y;t[13]!==p||t[14]!==g?(y=(0,Q.jsxs)(E,{children:[p,g]}),t[13]=p,t[14]=g,t[15]=y):y=t[15];let x;t[16]===Symbol.for(`react.memo_cache_sentinel`)?(x=(0,Q.jsx)(se,{htmlFor:`account-step-up-code`,children:`Authenticator code`}),t[16]=x):x=t[16];let S;t[17]===a?S=t[18]:(S=e=>a(H(e.target.value)),t[17]=a,t[18]=S);let C;t[19]!==c||t[20]!==i||t[21]!==S?(C=(0,Q.jsxs)(O,{className:`space-y-2`,children:[x,(0,Q.jsx)(v,{id:`account-step-up-code`,value:i,inputMode:`numeric`,autoComplete:`one-time-code`,maxLength:16,disabled:c,className:_,onChange:S})]}),t[19]=c,t[20]=i,t[21]=S,t[22]=C):C=t[22];let w;t[23]===s?w=t[24]:(w=(0,Q.jsx)(b,{variant:`outline`,onClick:s,children:`Cancel`}),t[23]=s,t[24]=w);let T;t[25]!==c||t[26]!==i?(T=c||!ue(i),t[25]=c,t[26]=i,t[27]=T):T=t[27];let A;t[28]===c?A=t[29]:(A=(0,Q.jsx)($,{busy:c,children:`Confirm code`}),t[28]=c,t[29]=A);let j;t[30]!==T||t[31]!==A?(j=(0,Q.jsx)(b,{type:`submit`,disabled:T,children:A}),t[30]=T,t[31]=A,t[32]=j):j=t[32];let M;t[33]!==w||t[34]!==j?(M=(0,Q.jsxs)(ee,{children:[w,j]}),t[33]=w,t[34]=j,t[35]=M):M=t[35];let N;t[36]!==C||t[37]!==M||t[38]!==d||t[39]!==y?(N=(0,Q.jsx)(ne,{className:`max-w-sm`,children:(0,Q.jsxs)(`form`,{onSubmit:d,children:[y,C,M]})}),t[36]=C,t[37]=M,t[38]=d,t[39]=y,t[40]=N):N=t[40];let re;return t[41]!==l||t[42]!==N||t[43]!==u?(re=(0,Q.jsx)(k,{open:l,onOpenChange:u,children:N}),t[41]=l,t[42]=N,t[43]=u,t[44]=re):re=t[44],re}export{Te as AccountSettingsPanel};
@@ -1 +0,0 @@
1
- import{i as e,t}from"./react-SIfiwpqq.js";import{t as n}from"./compiler-runtime-qmuS0Svy.js";import{C as r,Nr as i}from"./src-Vf4LVnMX.js";import{Rn as a,Vn as o,bn as s,f as c,l,v as u,y as d,zn as f}from"./runtime-CqhG6EOG.js";import{Dt as p,n as ee}from"./primary-OskAInOO.js";import{Ct as m,U as h,V as g,X as _,q as v}from"./composerDraftStore-BaAeiPHc.js";import{f as y}from"./utils-BPUctpTG.js";import{i as te}from"./threadPriorityRefreshRuntime-DqqfcbZE.js";import{a as ne,i as b}from"./toast-Bnfw8LOb.js";import{t as x}from"./refresh-cw-DopCMrtR.js";import{t as S}from"./sparkles-CAf3oJ5S.js";import{t as C}from"./ProviderModelPicker-ChoxerzY.js";import{t as re}from"./switch-vkC1QGDn.js";import{t as w}from"./button-CXfaxtRp.js";import{t as T}from"./toastHelpers-CSQRKo4F.js";import{a as ie,i as E,o as ae,s as oe,t as se}from"./select-BB7zCkpA.js";import"./providerInstances-D5NRn-MS.js";import{i as D,n as ce,r as O}from"./settingsLayout-CS7P71tz.js";var le=[`Thread titles`,`Project or repository names`,`Branch names`,`Bucketed creation and activity age`,`Running, approval, input, queue, failure, and delivery state`,`Pull request or linked issue title and state`,`Up to 600 characters from the latest user request`],k=[{value:0,label:`Manual only`},{value:3e5,label:`Every 5 minutes`},{value:6e5,label:`Every 10 minutes`},{value:18e5,label:`Every 30 minutes`},{value:36e5,label:`Every hour`},{value:216e5,label:`Every 6 hours`},{value:864e5,label:`Every 24 hours`}];function A(e){return{...e.enabled===void 0?{}:{aiFocusEnabled:e.enabled},...e.refreshIntervalMs===void 0?{}:{aiFocusRefreshIntervalMs:e.refreshIntervalMs}}}function j(e){return e.map(e=>{let t=e.serverConfig,n=t?.environment.capabilities.threadPriorityRanking===!0,r=t?.settings.inboxPriorityModelSelection??null,i=t?r??t.settings.textGenerationModelSelection:null,a=i===null?null:t?.providers.find(e=>e.instanceId===i.instanceId)??null;return{...e,supported:n,inherited:r===null,effectiveModelSelection:i,effectiveProvider:a}})}function M(e,t){let n=e.find(e=>e.instanceId===t);return!!(n&&n.enabled&&n.installed&&n.availability!==`unavailable`&&n.status!==`disabled`&&n.status!==`error`)}function N(e){if(e.selection!==null&&!M(e.serverConfig.providers,e.selection.instanceId))throw Error(`That provider instance is not available on this environment.`);return{inboxPriorityModelSelection:e.selection}}var P=n(),F=e(t(),1),I=y();function L(e){return e instanceof Error?e.message:`An unexpected error occurred.`}function ue(){let e=(0,P.c)(2),[t,n]=(0,F.useState)(R),r,i;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=()=>u(()=>{n(l())}),i=[],e[0]=r,e[1]=i):(r=e[0],i=e[1]),(0,F.useEffect)(r,i),t}function R(){return l()}function z({row:e}){let[t,n]=(0,F.useState)(!1),i=e.serverConfig;if(!i||!e.effectiveModelSelection)return null;let a={...i.settings,...r},o=e.effectiveModelSelection,s=_(v(i.providers)),c=g(a,i.providers,o.instanceId,o.model),l=async t=>{n(!0);try{let n=N({serverConfig:i,selection:t});await d(e.environmentId,n)}catch(t){b.add(T({type:`error`,title:`Could not update ${e.label}`,description:L(t)}))}finally{n(!1)}};return(0,I.jsxs)(`div`,{className:`flex flex-wrap items-center justify-end gap-2`,children:[(0,I.jsx)(C,{activeInstanceId:o.instanceId,model:o.model,lockedProvider:null,instanceEntries:s,modelOptionsByInstance:c,compact:!0,disabled:t||!e.connected,...e.connected?{}:{disabledReason:`Connect this environment to change its model.`},onInstanceModelChange:(e,t)=>{l(h({...a,textGenerationModelSelection:m(e,t)},i.providers))}}),e.inherited?null:(0,I.jsx)(w,{size:`xs`,variant:`ghost`,disabled:t||!e.connected,onClick:()=>void l(null),children:`Use text model`})]})}function B(e){let t=(0,P.c)(6),{row:n}=e,r=n.effectiveProvider?.displayName??n.effectiveProvider?.driver??null,i=n.connected?n.supported?n.inherited?`Inherits the text-generation model${r?` (${r})`:``}.`:`Uses a separate model for Inbox ranking.`:`This node version does not support AI Focus ranking. Other supported nodes still work.`:`Offline — ranking waits for an existing connection.`,a;t[0]===n?a=t[1]:(a=n.supported?(0,I.jsx)(z,{row:n}):void 0,t[0]=n,t[1]=a);let o;return t[2]!==n.label||t[3]!==i||t[4]!==a?(o=(0,I.jsx)(O,{title:n.label,description:i,control:a}),t[2]=n.label,t[3]=i,t[4]=a,t[5]=o):o=t[5],o}function V(){let e=(0,P.c)(48),t=a(),{updateSettings:n}=f(),r=o(),c;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(c=ee(),e[0]=c):c=e[0];let l=c,u=s(he),d=ue(),[p,m]=(0,F.useState)(!1);l?.environmentId,l?.label;let h;if(e[1]!==d||e[2]!==r||e[3]!==u){let t=new Map;l?.environmentId&&t.set(l.environmentId,{label:l.label,config:r});for(let e of d){if(t.has(e.environmentId))continue;let n=u[e.environmentId];t.set(e.environmentId,{label:n?.descriptor?.label??e.knownEnvironment.label,config:n?.serverConfig??null})}for(let[e,n]of Object.entries(u)){let r=i.make(e);t.has(r)||t.set(r,{label:n.descriptor?.label??`Saved environment`,config:n.serverConfig})}h=j([...t].map(me)),e[1]=d,e[2]=r,e[3]=u,e[4]=h}else h=e[4];let g=h,_;e[5]===g?_=e[6]:(_=async()=>{m(!0);let e=await te(),t=e.failures;t.length>0?b.add(T({type:`error`,title:`AI Focus refresh failed`,description:t.map(e=>{let{environmentId:t,error:n}=e;return`${g.find(e=>e.environmentId===t)?.label??`Environment`}: ${L(n)}`}).join(` · `)})):b.add(T({type:`success`,title:e.attempted.length>0?`AI Focus refreshed`:`No connected supported nodes`,description:e.attempted.length>0?`Updated ${e.succeeded.length} environment${e.succeeded.length===1?``:`s`}.`:`Connect a supported node to rank its Inbox.`})),m(!1)},e[5]=g,e[6]=_);let v=_,y;e[7]===Symbol.for(`react.memo_cache_sentinel`)?(y=(0,I.jsx)(S,{className:`size-3.5`}),e[7]=y):y=e[7];let C;e[8]===n?C=e[9]:(C=e=>n(A({enabled:e})),e[8]=n,e[9]=C);let E;e[10]!==t.aiFocusEnabled||e[11]!==C?(E=(0,I.jsx)(O,{title:`Prioritize the Inbox`,description:`Create a Focus section from pinned, actionable, and model-ranked threads. Focused threads are removed from Active, never duplicated.`,control:(0,I.jsx)(re,{"aria-label":`Enable AI Focus`,checked:t.aiFocusEnabled,onCheckedChange:C})}),e[10]=t.aiFocusEnabled,e[11]=C,e[12]=E):E=e[12];let M=String(t.aiFocusRefreshIntervalMs),N;e[13]===n?N=e[14]:(N=e=>{let t=Number(e);n(A({refreshIntervalMs:t}))},e[13]=n,e[14]=N);let R;e[15]===t.aiFocusRefreshIntervalMs?R=e[16]:(R=k.find(e=>e.value===t.aiFocusRefreshIntervalMs)?.label??`Every 10 minutes`,e[15]=t.aiFocusRefreshIntervalMs,e[16]=R);let z;e[17]===R?z=e[18]:(z=(0,I.jsx)(ae,{className:`w-48`,"aria-label":`AI Focus refresh interval`,children:(0,I.jsx)(oe,{children:R})}),e[17]=R,e[18]=z);let B;e[19]===Symbol.for(`react.memo_cache_sentinel`)?(B=(0,I.jsx)(ie,{align:`end`,alignItemWithTrigger:!1,children:k.map(pe)}),e[19]=B):B=e[19];let V;e[20]!==M||e[21]!==N||e[22]!==z?(V=(0,I.jsxs)(se,{value:M,onValueChange:N,children:[z,B]}),e[20]=M,e[21]=N,e[22]=z,e[23]=V):V=e[23];let H;e[24]===v?H=e[25]:(H=()=>void v(),e[24]=v,e[25]=H);let U=p?`size-4 animate-spin`:`size-4`,W;e[26]===U?W=e[27]:(W=(0,I.jsx)(x,{className:U}),e[26]=U,e[27]=W);let G;e[28]!==p||e[29]!==H||e[30]!==W?(G=(0,I.jsx)(w,{size:`icon-sm`,variant:`outline`,"aria-label":`Refresh AI Focus now`,disabled:p,onClick:H,children:W}),e[28]=p,e[29]=H,e[30]=W,e[31]=G):G=e[31];let K;e[32]!==V||e[33]!==G?(K=(0,I.jsx)(O,{title:`Refresh rankings`,description:`Automatic checks use only nodes that are already connected. Manual-only never starts a connection.`,control:(0,I.jsxs)(`div`,{className:`flex items-center gap-2`,children:[V,G]})}),e[32]=V,e[33]=G,e[34]=K):K=e[34];let q;e[35]!==K||e[36]!==E?(q=(0,I.jsxs)(D,{title:`AI Focus`,icon:y,children:[E,K]}),e[35]=K,e[36]=E,e[37]=q):q=e[37];let J;e[38]===g?J=e[39]:(J=g.length>0?g.map(fe):(0,I.jsx)(O,{title:`No environments available`,description:`Connect a node to configure its Inbox ranking model.`}),e[38]=g,e[39]=J);let Y;e[40]===J?Y=e[41]:(Y=(0,I.jsx)(D,{title:`Models`,children:J}),e[40]=J,e[41]=Y);let X;e[42]===Symbol.for(`react.memo_cache_sentinel`)?(X=(0,I.jsx)(ne,{className:`size-3.5`}),e[42]=X):X=e[42];let Z;e[43]===Symbol.for(`react.memo_cache_sentinel`)?(Z=(0,I.jsx)(`p`,{className:`mb-3 text-xs text-muted-foreground`,children:`Ranking sends only this bounded metadata from each environment. It does not send full chat history, file contents, or message responses.`}),e[43]=Z):Z=e[43];let Q;e[44]===Symbol.for(`react.memo_cache_sentinel`)?(Q=(0,I.jsx)(D,{title:`Data sent to the selected model`,icon:X,children:(0,I.jsxs)(`div`,{className:`px-5 py-4`,children:[Z,(0,I.jsx)(`ul`,{className:`grid gap-1.5 text-xs text-foreground/80 sm:grid-cols-2`,children:le.map(de)})]})}),e[44]=Q):Q=e[44];let $;return e[45]!==q||e[46]!==Y?($=(0,I.jsxs)(ce,{children:[q,Y,Q]}),e[45]=q,e[46]=Y,e[47]=$):$=e[47],$}function de(e){return(0,I.jsxs)(`li`,{className:`flex gap-2`,children:[(0,I.jsx)(`span`,{"aria-hidden":!0,className:`text-muted-foreground`,children:`•`}),(0,I.jsx)(`span`,{children:e})]},e)}function fe(e){return(0,I.jsx)(B,{row:e},e.environmentId)}function pe(e){return(0,I.jsx)(E,{hideIndicator:!0,value:String(e.value),children:e.label},e.value)}function me(e){let[t,n]=e;return{environmentId:t,label:n.label,connected:c(t)!==null&&p(t).phase===`connected`,serverConfig:n.config}}function he(e){return e.byId}export{V as AiFocusSettings};
@@ -1 +0,0 @@
1
- import{i as e,t}from"./react-SIfiwpqq.js";import{t as n}from"./compiler-runtime-qmuS0Svy.js";import{f as r}from"./utils-BPUctpTG.js";var i=n(),a=e(t(),1),o=r(),s=250;function c(e){let t=(0,i.c)(17),{children:n}=e,r=(0,a.useRef)(null),c;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(c={height:null,isClipping:!1},t[0]=c):c=t[0];let[d,f]=(0,a.useState)(c),p;t[1]===d.isClipping?p=t[2]:(p=()=>{if(!d.isClipping)return;let e=window.setTimeout(()=>{f(u)},s);return()=>window.clearTimeout(e)},t[1]=d.isClipping,t[2]=p);let m;t[3]!==d.height||t[4]!==d.isClipping?(m=[d.height,d.isClipping],t[3]=d.height,t[4]=d.isClipping,t[5]=m):m=t[5],(0,a.useEffect)(p,m);let h,g;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(h=()=>{let e=r.current;if(!e)return;let t=null,n=null,i=()=>{let t=Math.ceil(e.scrollHeight||e.getBoundingClientRect().height);f(e=>e.height===t?e:{height:t,isClipping:e.height!==null})},a=()=>{t!==null&&(window.cancelAnimationFrame(t),t=null),n!==null&&(window.cancelAnimationFrame(n),n=null)},o=()=>{a(),i(),t=window.requestAnimationFrame(()=>{t=null,i(),n=window.requestAnimationFrame(()=>{n=null,i()})})};o();let s=new ResizeObserver(o);return s.observe(e),()=>{s.disconnect(),a()}},g=[],t[6]=h,t[7]=g):(h=t[6],g=t[7]),(0,a.useLayoutEffect)(h,g);let _;t[8]!==d.height||t[9]!==d.isClipping?(_=d.height===null?void 0:{height:d.height,overflow:d.isClipping?`hidden`:`visible`},t[8]=d.height,t[9]=d.isClipping,t[10]=_):_=t[10];let v;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(v=e=>{e.target===e.currentTarget&&e.propertyName===`height`&&f(l)},t[11]=v):v=t[11];let y;t[12]===n?y=t[13]:(y=(0,o.jsx)(`div`,{ref:r,children:n}),t[12]=n,t[13]=y);let b;return t[14]!==_||t[15]!==y?(b=(0,o.jsx)(`div`,{"data-slot":`animated-height`,className:`transition-[height] duration-200 ease-out motion-reduce:transition-none`,style:_,onTransitionEnd:v,children:y}),t[14]=_,t[15]=y,t[16]=b):b=t[16],b}function l(e){return e.isClipping?{...e,isClipping:!1}:e}function u(e){return e.isClipping?{...e,isClipping:!1}:e}export{c as t};
@@ -1 +0,0 @@
1
- import{i as e,t}from"./react-SIfiwpqq.js";import{t as n}from"./compiler-runtime-qmuS0Svy.js";import{f as r,t as i}from"./utils-BPUctpTG.js";import{i as a}from"./uiStateStore-VVodpTkG.js";import{f as o}from"./useRenderElement-DchFnsR8.js";import{i as s}from"./toast-Bnfw8LOb.js";import{t as c}from"./clipboard-copy-C4VV20QR.js";import{t as l}from"./copy-UQjKGt7t.js";import{t as u}from"./download-CQZ-m4zW.js";import{t as d}from"./palette-BSD_aJZg.js";import{t as f}from"./panel-right-BodNpkM9.js";import{t as p}from"./pencil-B69ERoVM.js";import{t as m}from"./plus-B2h-VEqh.js";import{t as h}from"./trash-2-CM1zXPGb.js";import{t as g}from"./x-C1Cemsov.js";import{t as _}from"./switch-vkC1QGDn.js";import{t as v}from"./input-Bz9pd_f3.js";import{t as y}from"./button-CXfaxtRp.js";import{t as b}from"./textarea-Cz_x76EQ.js";import{a as x,i as S,n as C,o as w,r as T,s as E,t as D}from"./alert-dialog-zAmnOpaF.js";import{a as O,i as k,o as A,s as j,t as M}from"./select-BB7zCkpA.js";import{n as ee,r as te,t as N}from"./popover-C9y_0-ZN.js";import{t as P}from"./badge-CNPL77i3.js";import{a as F,b as ne,c as re,d as ie,h as I,i as ae,m as oe,o as se,p as ce,u as L,v as R,x as z}from"./appearancePreferences-COvj0WMT.js";import{_ as le,a as ue,b as de,c as fe,d as pe,f as B,g as V,h as me,i as he,l as ge,m as H,o as _e,p as U,r as W,s as G,t as ve,u as ye,v as be,x as xe,y as Se}from"./useTheme-DiC-5xCb.js";import{n as Ce,t as K}from"./toggle-group-BNtjyirT.js";import{i as q,n as we,r as J,t as Y}from"./settingsLayout-CS7P71tz.js";var Te=o(`baseline`,[[`path`,{d:`M4 20h16`,key:`14thso`}],[`path`,{d:`m6 16 6-12 6 12`,key:`1b4byz`}],[`path`,{d:`M8 12h8`,key:`1wcyev`}]]),Ee=o(`code-xml`,[[`path`,{d:`m18 16 4-4-4-4`,key:`1inbqp`}],[`path`,{d:`m6 8-4 4 4 4`,key:`15zrgr`}],[`path`,{d:`m14.5 4-5 16`,key:`e7oirm`}]]),De=o(`gauge`,[[`path`,{d:`m12 14 4-4`,key:`9kzdfg`}],[`path`,{d:`M3.34 19a10 10 0 1 1 17.32 0`,key:`19p75a`}]]),Oe=o(`radius`,[[`path`,{d:`M20.34 17.52a10 10 0 1 0-2.82 2.82`,key:`fydyku`}],[`circle`,{cx:`19`,cy:`19`,r:`2`,key:`17f5cg`}],[`path`,{d:`m13.41 13.41 4.18 4.18`,key:`1gqbwc`}],[`circle`,{cx:`12`,cy:`12`,r:`2`,key:`1c9p78`}]]),ke=o(`type`,[[`path`,{d:`M12 4v16`,key:`1654pz`}],[`path`,{d:`M4 7V5a1 1 0 0 1 1-1h14a1 1 0 0 1 1 1v2`,key:`e0r10z`}],[`path`,{d:`M9 20h6`,key:`s66wpe`}]]),Ae=o(`upload`,[[`path`,{d:`M12 3v12`,key:`1x0j5s`}],[`path`,{d:`m17 8-5-5-5 5`,key:`7q97r8`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}]]),X=e(t(),1),Z=n(),Q=`.rycotheme.json`,je=/[^a-z0-9-_]+/gi;function Me(e){let t=(e.name||e.id).trim().replace(je,`-`).replace(/^-+|-+$/g,``);return`${t.length>0?t:e.id||`theme`}${Q}`}function Ne(e){let t={id:e.id,name:e.name};return e.description&&(t.description=e.description),e.light&&(t.light={...e.light}),e.dark&&(t.dark={...e.dark}),JSON.stringify(t,null,2)}function Pe(e){let t;try{t=JSON.parse(e)}catch(e){throw Error(`Could not parse theme JSON: ${e instanceof Error?e.message:`invalid JSON`}`,{cause:e})}if(!U(t))throw Error(`Theme JSON does not match the schema (need string id/name and string-only light/dark tokens).`);let n={id:t.id,name:t.name,builtIn:!1};return t.description&&(n.description=t.description),t.light&&(n.light={...t.light}),t.dark&&(n.dark={...t.dark}),n}function Fe(e,t=`rename`){let n=Pe(e);if(!ye().find(e=>e.id===n.id))return he(n),{theme:n,action:`added`};if(pe(n.id)||t===`rename`){let e={...n,id:ge(n.id)};return he(e),{theme:e,action:`renamed`}}return be(n.id,n),{theme:n,action:`replaced`}}typeof TextEncoder>`u`||new TextEncoder,typeof TextDecoder>`u`||new TextDecoder;async function Ie(e){let t=Ne(e);if(typeof navigator>`u`||!navigator.clipboard)throw Error(`Clipboard API not available in this environment.`);await navigator.clipboard.writeText(t)}function Le(e){if(typeof document>`u`||typeof URL>`u`||typeof Blob>`u`)throw Error(`Download not supported in this environment.`);let t=new Blob([Ne(e)],{type:`application/json`}),n=URL.createObjectURL(t),r=document.createElement(`a`);r.href=n,r.download=Me(e),r.rel=`noopener`,document.body.append(r),r.click(),r.remove(),URL.revokeObjectURL(n)}async function Re(e,t={}){let n=Fe(await e.text(),t.collision??`rename`);return t.activate&&(le(n.theme.id),ue(n.theme)),n}var $=r();function ze(e,t,n){return e<t?t:e>n?n:e}function Be(e){let t=e.trim().replace(/^#/,``),n;if(t.length===3)n=t.split(``).map(e=>`${e}${e}`).join(``);else if(t.length===6)n=t;else return null;return/^[0-9a-fA-F]{6}$/.test(n)?{r:Number.parseInt(n.slice(0,2),16),g:Number.parseInt(n.slice(2,4),16),b:Number.parseInt(n.slice(4,6),16)}:null}function Ve({r:e,g:t,b:n}){let r=e=>ze(Math.round(e),0,255).toString(16).padStart(2,`0`);return`#${r(e)}${r(t)}${r(n)}`}function He({r:e,g:t,b:n}){let r=e/255,i=t/255,a=n/255,o=Math.max(r,i,a),s=o-Math.min(r,i,a),c=0;s!==0&&(c=o===r?60*((i-a)/s%6):o===i?60*((a-r)/s+2):60*((r-i)/s+4)),c<0&&(c+=360);let l=o===0?0:s/o;return{h:c,s:l,v:o}}function Ue({h:e,s:t,v:n}){let r=n*t,i=(e%360+360)%360/60,a=r*(1-Math.abs(i%2-1)),o=0,s=0,c=0;i<1?[o,s,c]=[r,a,0]:i<2?[o,s,c]=[a,r,0]:i<3?[o,s,c]=[0,r,a]:i<4?[o,s,c]=[0,a,r]:i<5?[o,s,c]=[a,0,r]:[o,s,c]=[r,0,a];let l=n-r;return{r:(o+l)*255,g:(s+l)*255,b:(c+l)*255}}function We(e){let t=(0,Z.c)(71),{value:n,onChange:r,children:a,side:o,align:s,ariaLabel:c,triggerClassName:l}=e,u=o===void 0?`bottom`:o,d=s===void 0?`start`:s,f;t[0]===n?f=t[1]:(f=()=>{let e=Be(n);return e?He(e):{h:0,s:0,v:0}},t[0]=n,t[1]=f);let[p,m]=(0,X.useState)(f),[h,g]=(0,X.useState)(n),[_,y]=(0,X.useState)(!1),b=(0,X.useRef)(null),x=(0,X.useRef)(null),S=(0,X.useRef)(r),C=(0,X.useRef)(p.h),w;t[2]===r?w=t[3]:(w=()=>{S.current=r},t[2]=r,t[3]=w),(0,X.useEffect)(w);let T,E;t[4]===p.h?(T=t[5],E=t[6]):(T=()=>{C.current=p.h},E=[p.h],t[4]=p.h,t[5]=T,t[6]=E),(0,X.useEffect)(T,E);let D;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(D=()=>{if(b.current=null,x.current===null)return;let e=x.current;x.current=null,S.current(e)},t[7]=D):D=t[7];let O=D,k;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(k=e=>{x.current=e,b.current===null&&(b.current=requestAnimationFrame(O))},t[8]=k):k=t[8];let A=k,j,M;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(M=()=>()=>{if(b.current!==null&&(cancelAnimationFrame(b.current),b.current=null),x.current!==null){let e=x.current;x.current=null,S.current(e)}},j=[],t[9]=j,t[10]=M):(j=t[9],M=t[10]),(0,X.useEffect)(M,j);let P;t[11]===p?P=t[12]:(P=Ve(Ue(p)),t[11]=p,t[12]=P);let F=P,ne,re;t[13]!==F||t[14]!==n?(ne=()=>{if(n.toLowerCase()===F.toLowerCase())return;let e=Be(n);if(!e)return;let t=He(e);m(e=>({h:t.s===0?e.h:t.h,s:t.s,v:t.v})),g(n)},re=[n,F],t[13]=F,t[14]=n,t[15]=ne,t[16]=re):(ne=t[15],re=t[16]),(0,X.useEffect)(ne,re);let ie=(0,X.useRef)(null),I;t[17]===Symbol.for(`react.memo_cache_sentinel`)?(I=e=>{let t=ie.current;if(!t)return;let n=t.getBoundingClientRect(),r=ze(e.clientX-n.left,0,n.width),i=ze(e.clientY-n.top,0,n.height),a=n.width===0?0:r/n.width,o=n.height===0?0:1-i/n.height;m(e=>{let t={h:e.h,s:a,v:o},n=Ve(Ue(t));return g(n),x.current=n,b.current===null&&(b.current=requestAnimationFrame(O)),t})},t[17]=I):I=t[17];let ae=I,oe;t[18]===Symbol.for(`react.memo_cache_sentinel`)?(oe=e=>{e.preventDefault(),e.currentTarget.setPointerCapture(e.pointerId),ae(e)},t[18]=oe):oe=t[18];let se=oe,ce;t[19]===Symbol.for(`react.memo_cache_sentinel`)?(ce=e=>{e.currentTarget.hasPointerCapture(e.pointerId)&&ae(e)},t[19]=ce):ce=t[19];let L=ce,R=(0,X.useRef)(null),z;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(z=e=>{let t=R.current;if(!t)return;let n=t.getBoundingClientRect(),r=ze(e.clientX-n.left,0,n.width),i=n.width===0?0:r/n.width*360;m(e=>{let t={h:i,s:e.s,v:e.v},n=Ve(Ue(t));return g(n),x.current=n,b.current===null&&(b.current=requestAnimationFrame(O)),t})},t[20]=z):z=t[20];let le=z,ue;t[21]===Symbol.for(`react.memo_cache_sentinel`)?(ue=e=>{e.preventDefault(),e.currentTarget.setPointerCapture(e.pointerId),le(e)},t[21]=ue):ue=t[21];let de=ue,fe;t[22]===Symbol.for(`react.memo_cache_sentinel`)?(fe=e=>{e.currentTarget.hasPointerCapture(e.pointerId)&&le(e)},t[22]=fe):fe=t[22];let pe=fe,B;t[23]===Symbol.for(`react.memo_cache_sentinel`)?(B=e=>{g(e);let t=Be(e.startsWith(`#`)?e:`#${e}`);if(!t)return;let n=He(t),r={h:n.s===0?C.current:n.h,s:n.s,v:n.v};m(r),A(Ve(t))},t[23]=B):B=t[23];let V=B,me=`${p.h/360*100}%`,he=`${p.s*100}%`,ge=`${(1-p.v)*100}%`,H=`hsl(${p.h} 100% 50%)`,_e;t[24]===l?_e=t[25]:(_e=i(`relative size-5 shrink-0 cursor-pointer overflow-hidden rounded-sm border border-border/80 outline-none transition-shadow focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-background`,l),t[24]=l,t[25]=_e);let U;t[26]!==c||t[27]!==a||t[28]!==_e?(U=(0,$.jsx)(te,{"aria-label":c,className:_e,children:a}),t[26]=c,t[27]=a,t[28]=_e,t[29]=U):U=t[29];let W;t[30]===p.s?W=t[31]:(W=Math.round(p.s*100),t[30]=p.s,t[31]=W);let G;t[32]===H?G=t[33]:(G={backgroundColor:H},t[32]=H,t[33]=G);let ve;t[34]===Symbol.for(`react.memo_cache_sentinel`)?(ve=(0,$.jsx)(`div`,{"aria-hidden":!0,className:`pointer-events-none absolute inset-0`,style:{background:`linear-gradient(to right, rgba(255,255,255,1), rgba(255,255,255,0))`}}),t[34]=ve):ve=t[34];let ye;t[35]===Symbol.for(`react.memo_cache_sentinel`)?(ye=(0,$.jsx)(`div`,{"aria-hidden":!0,className:`pointer-events-none absolute inset-0`,style:{background:`linear-gradient(to top, rgba(0,0,0,1), rgba(0,0,0,0))`}}),t[35]=ye):ye=t[35];let be;t[36]!==he||t[37]!==ge?(be=(0,$.jsx)(`div`,{"aria-hidden":!0,className:`pointer-events-none absolute size-3 -translate-x-1/2 -translate-y-1/2 rounded-full border-2 border-white shadow-[0_0_0_1px_rgba(0,0,0,0.4)]`,style:{left:he,top:ge}}),t[36]=he,t[37]=ge,t[38]=be):be=t[38];let xe;t[39]!==W||t[40]!==G||t[41]!==be?(xe=(0,$.jsxs)(`div`,{ref:ie,role:`slider`,"aria-label":`Saturation and value`,"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":W,tabIndex:0,className:`relative h-36 w-full cursor-crosshair touch-none select-none overflow-hidden rounded-md outline-none focus-visible:ring-2 focus-visible:ring-ring/40`,style:G,onPointerDown:se,onPointerMove:L,children:[ve,ye,be]}),t[39]=W,t[40]=G,t[41]=be,t[42]=xe):xe=t[42];let Se;t[43]===p.h?Se=t[44]:(Se=Math.round(p.h),t[43]=p.h,t[44]=Se);let Ce;t[45]===Symbol.for(`react.memo_cache_sentinel`)?(Ce={background:`linear-gradient(to right, hsl(0 100% 50%), hsl(60 100% 50%), hsl(120 100% 50%), hsl(180 100% 50%), hsl(240 100% 50%), hsl(300 100% 50%), hsl(360 100% 50%))`},t[45]=Ce):Ce=t[45];let K;t[46]===me?K=t[47]:(K=(0,$.jsx)(`div`,{"aria-hidden":!0,className:`pointer-events-none absolute top-1/2 size-3 -translate-x-1/2 -translate-y-1/2 rounded-full border-2 border-white shadow-[0_0_0_1px_rgba(0,0,0,0.4)]`,style:{left:me}}),t[46]=me,t[47]=K);let q;t[48]!==Se||t[49]!==K?(q=(0,$.jsx)(`div`,{ref:R,role:`slider`,"aria-label":`Hue`,"aria-valuemin":0,"aria-valuemax":360,"aria-valuenow":Se,tabIndex:0,className:`relative h-3 w-full cursor-ew-resize touch-none select-none overflow-hidden rounded-full outline-none focus-visible:ring-2 focus-visible:ring-ring/40`,style:Ce,onPointerDown:de,onPointerMove:pe,children:K}),t[48]=Se,t[49]=K,t[50]=q):q=t[50];let we;t[51]===F?we=t[52]:(we=(0,$.jsx)(`span`,{"aria-hidden":!0,className:`size-7 shrink-0 rounded-md border border-border/60`,style:{backgroundColor:F}}),t[51]=F,t[52]=we);let J;t[53]===Symbol.for(`react.memo_cache_sentinel`)?(J=e=>V(e.currentTarget.value),t[53]=J):J=t[53];let Y;t[54]===h?Y=t[55]:(Y=(0,$.jsx)(v,{value:h,size:`sm`,nativeInput:!0,onChange:J,spellCheck:!1,className:`font-mono text-xs`,"aria-label":`Hex value`}),t[54]=h,t[55]=Y);let Te;t[56]!==we||t[57]!==Y?(Te=(0,$.jsxs)(`div`,{className:`flex items-center gap-2`,children:[we,Y]}),t[56]=we,t[57]=Y,t[58]=Te):Te=t[58];let Ee;t[59]!==xe||t[60]!==q||t[61]!==Te?(Ee=(0,$.jsxs)(`div`,{className:`space-y-3`,children:[xe,q,Te]}),t[59]=xe,t[60]=q,t[61]=Te,t[62]=Ee):Ee=t[62];let De;t[63]!==d||t[64]!==u||t[65]!==Ee?(De=(0,$.jsx)(ee,{side:u,align:d,className:`w-64`,children:Ee}),t[63]=d,t[64]=u,t[65]=Ee,t[66]=De):De=t[66];let Oe;return t[67]!==_||t[68]!==U||t[69]!==De?(Oe=(0,$.jsxs)(N,{open:_,onOpenChange:y,children:[U,De]}),t[67]=_,t[68]=U,t[69]=De,t[70]=Oe):Oe=t[70],Oe}var Ge=[{title:`Surfaces`,tokens:[`background`,`app-chrome-background`,`foreground`,`card`,`card-foreground`,`popover`,`popover-foreground`]},{title:`Brand & focus`,tokens:[`primary`,`primary-foreground`,`ring`]},{title:`Neutrals`,tokens:[`secondary`,`secondary-foreground`,`muted`,`muted-foreground`,`accent`,`accent-foreground`]},{title:`Status`,tokens:[`destructive`,`destructive-foreground`,`info`,`info-foreground`,`success`,`success-foreground`,`warning`,`warning-foreground`]},{title:`Borders & inputs`,tokens:[`border`,`input`]},{title:`Scrollbars`,tokens:[`scrollbar-thumb`,`scrollbar-thumb-hover`,`scrollbar-thumb-thin`,`scrollbar-thumb-thin-hover`]}],Ke=new Set(Se),qe=null,Je=null;function Ye(e){if(typeof document>`u`||document.body===void 0||!e)return`#000000`;qe||(qe=document.createElement(`div`),qe.style.position=`absolute`,qe.style.visibility=`hidden`,qe.style.pointerEvents=`none`,document.body.append(qe)),qe.style.color=``,qe.style.color=e;let t=getComputedStyle(qe).color;Je||=document.createElement(`canvas`),Je.width=1,Je.height=1;let n=Je.getContext(`2d`,{willReadFrequently:!0});if(!n)return`#000000`;n.clearRect(0,0,1,1);try{n.fillStyle=t}catch{return`#000000`}n.fillRect(0,0,1,1);let r=n.getImageData(0,0,1,1).data;return`#${[r[0],r[1],r[2]].map(e=>(e??0).toString(16).padStart(2,`0`)).join(``)}`}function Xe(e,t,n,r){let i={...e[t]};return r.length===0?delete i[n]:i[n]=r,t===`light`?{...e,light:i}:{...e,dark:i}}function Ze(e,t){return{...e,name:t}}function Qe(e,t){let n={...e};return t.length===0?delete n.description:n.description=t,n}function $e(e){return W.includes(e)}function et(e){let t=(0,Z.c)(124),{source:n,draft:r,onDraftChange:i,onSave:a,onCancel:o,resolvedVariant:s}=e,[c,l]=(0,X.useState)(`form`),[u,d]=(0,X.useState)(s),f;t[0]===r?f=t[1]:(f=()=>JSON.stringify(r,null,2),t[0]=r,t[1]=f);let[p,m]=(0,X.useState)(f),[h,g]=(0,X.useState)(null),[_,O]=(0,X.useState)(!1),k;t[2]===n?k=t[3]:(k=JSON.stringify(n),t[2]=n,t[3]=k);let A;t[4]===r?A=t[5]:(A=JSON.stringify(r),t[4]=r,t[5]=A);let j=k!==A,M;t[6]===r?M=t[7]:(M=()=>{ue(r)},t[6]=r,t[7]=M);let ee;t[8]!==r||t[9]!==s?(ee=[r,s],t[8]=r,t[9]=s,t[10]=ee):ee=t[10],(0,X.useEffect)(M,ee);let te,N;t[11]!==r||t[12]!==c?(te=()=>{c===`form`&&m(JSON.stringify(r,null,2))},N=[r,c],t[11]=r,t[12]=c,t[13]=te,t[14]=N):(te=t[13],N=t[14]),(0,X.useEffect)(te,N);let P;t[15]!==r||t[16]!==i?(P=e=>{i(Ze(r,e))},t[15]=r,t[16]=i,t[17]=P):P=t[17];let F=P,ne;t[18]!==r||t[19]!==i?(ne=e=>{i(Qe(r,e))},t[18]=r,t[19]=i,t[20]=ne):ne=t[20];let re=ne,ie;t[21]!==r||t[22]!==i||t[23]!==u?(ie=(e,t)=>{i(Xe(r,u,e,t))},t[21]=r,t[22]=i,t[23]=u,t[24]=ie):ie=t[24];let I=ie,ae;t[25]===i?ae=t[26]:(ae=e=>{m(e);let t;try{t=JSON.parse(e)}catch(e){let t=e;g(t instanceof Error?t.message:`Invalid JSON`);return}if(!U(t)){g(`Invalid theme schema. Need string id/name and string-only light/dark tokens.`);return}g(null),i(t)},t[25]=i,t[26]=ae);let oe=ae,se;t[27]!==j||t[28]!==o?(se=()=>{if(j){O(!0);return}o()},t[27]=j,t[28]=o,t[29]=se):se=t[29];let ce=se,L,R,z;if(t[30]!==r.dark||t[31]!==r.light||t[32]!==u){z=(u===`dark`?r.dark:r.light)??{};let e;t[36]===u?e=t[37]:(e=(u===`dark`?xe.dark:xe.light)??{},t[36]=u,t[37]=e),L=e,R=Object.entries(z).filter(rt),t[30]=r.dark,t[31]=r.light,t[32]=u,t[33]=L,t[34]=R,t[35]=z}else L=t[33],R=t[34],z=t[35];let le=R,fe=tt,pe=fe(r.light)||fe(r.dark),B;t[38]!==r.name||t[39]!==pe||t[40]!==h?(B=h!==null||r.name.trim().length===0||pe,t[38]=r.name,t[39]=pe,t[40]=h,t[41]=B):B=t[41];let V=B,me;t[42]===Symbol.for(`react.memo_cache_sentinel`)?(me=(0,$.jsx)(`span`,{className:`text-[11px] font-semibold uppercase tracking-[0.08em] text-muted-foreground`,children:`Editing`}),t[42]=me):me=t[42];let he=r.name||`Untitled`,ge;t[43]!==r.name||t[44]!==he?(ge=(0,$.jsx)(`span`,{className:`truncate text-sm font-medium text-foreground`,title:r.name,children:he}),t[43]=r.name,t[44]=he,t[45]=ge):ge=t[45];let H;t[46]===j?H=t[47]:(H=j?(0,$.jsx)(`span`,{className:`rounded-sm bg-warning/16 px-1.5 py-0.5 text-[10px] font-medium text-warning-foreground`,children:`Unsaved`}):null,t[46]=j,t[47]=H);let _e;t[48]===ce?_e=t[49]:(_e=(0,$.jsx)(y,{size:`sm`,variant:`outline`,onClick:ce,children:`Cancel`}),t[48]=ce,t[49]=_e);let W;t[50]!==a||t[51]!==V?(W=(0,$.jsx)(y,{size:`sm`,onClick:a,disabled:V,children:`Save`}),t[50]=a,t[51]=V,t[52]=W):W=t[52];let G;t[53]!==_e||t[54]!==W?(G=(0,$.jsxs)(`div`,{className:`ms-auto flex items-center gap-2`,children:[_e,W]}),t[53]=_e,t[54]=W,t[55]=G):G=t[55];let ve;t[56]!==ge||t[57]!==H||t[58]!==G?(ve=(0,$.jsxs)(`div`,{className:`sticky top-0 z-10 flex flex-wrap items-center gap-2 border-b border-border/60 bg-muted/72 px-4 py-2 backdrop-blur-sm sm:px-5`,children:[me,ge,H,G]}),t[56]=ge,t[57]=H,t[58]=G,t[59]=ve):ve=t[59];let ye;t[60]===c?ye=t[61]:(ye=[c],t[60]=c,t[61]=ye);let be,Se,q;t[62]===Symbol.for(`react.memo_cache_sentinel`)?(be=e=>{let t=e[0];(t===`form`||t===`json`)&&l(t)},Se=(0,$.jsx)(K,{value:`form`,"aria-label":`Form editor`,className:`px-3 sm:px-3`,children:`Form`}),q=(0,$.jsx)(K,{value:`json`,"aria-label":`JSON editor`,className:`px-3 sm:px-3`,children:`JSON`}),t[62]=be,t[63]=Se,t[64]=q):(be=t[62],Se=t[63],q=t[64]);let we;t[65]===ye?we=t[66]:(we=(0,$.jsxs)(Ce,{value:ye,variant:`outline`,size:`sm`,onValueChange:be,children:[Se,q]}),t[65]=ye,t[66]=we);let J;t[67]===u?J=t[68]:(J=[u],t[67]=u,t[68]=J);let Y,Te,Ee;t[69]===Symbol.for(`react.memo_cache_sentinel`)?(Y=e=>{let t=e[0];(t===`light`||t===`dark`)&&d(t)},Te=(0,$.jsx)(K,{value:`light`,"aria-label":`Light variant`,className:`px-3 sm:px-3`,children:`Light`}),Ee=(0,$.jsx)(K,{value:`dark`,"aria-label":`Dark variant`,className:`px-3 sm:px-3`,children:`Dark`}),t[69]=Y,t[70]=Te,t[71]=Ee):(Y=t[69],Te=t[70],Ee=t[71]);let De;t[72]===J?De=t[73]:(De=(0,$.jsxs)(Ce,{value:J,variant:`outline`,size:`sm`,onValueChange:Y,children:[Te,Ee]}),t[72]=J,t[73]=De);let Oe;t[74]!==we||t[75]!==De?(Oe=(0,$.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:[we,De]}),t[74]=we,t[75]=De,t[76]=Oe):Oe=t[76];let ke;t[77]===Symbol.for(`react.memo_cache_sentinel`)?(ke=(0,$.jsx)(`span`,{className:`text-xs font-medium text-foreground`,children:`Name`}),t[77]=ke):ke=t[77];let Ae;t[78]===F?Ae=t[79]:(Ae=e=>F(e.currentTarget.value),t[78]=F,t[79]=Ae);let Q;t[80]===r.name?Q=t[81]:(Q=r.name.trim().length===0||void 0,t[80]=r.name,t[81]=Q);let je;t[82]!==r.name||t[83]!==Ae||t[84]!==Q?(je=(0,$.jsxs)(`label`,{className:`space-y-1.5`,children:[ke,(0,$.jsx)(v,{value:r.name,nativeInput:!0,onChange:Ae,"aria-invalid":Q})]}),t[82]=r.name,t[83]=Ae,t[84]=Q,t[85]=je):je=t[85];let Me;t[86]===Symbol.for(`react.memo_cache_sentinel`)?(Me=(0,$.jsx)(`span`,{className:`text-xs font-medium text-foreground`,children:`Description`}),t[86]=Me):Me=t[86];let Ne=r.description??``,Pe;t[87]===re?Pe=t[88]:(Pe=e=>re(e.currentTarget.value),t[87]=re,t[88]=Pe);let Fe;t[89]!==Ne||t[90]!==Pe?(Fe=(0,$.jsxs)(`label`,{className:`space-y-1.5`,children:[Me,(0,$.jsx)(v,{value:Ne,nativeInput:!0,onChange:Pe,placeholder:`Optional, shown under the picker.`})]}),t[89]=Ne,t[90]=Pe,t[91]=Fe):Fe=t[91];let Ie;t[92]!==je||t[93]!==Fe?(Ie=(0,$.jsxs)(`div`,{className:`mt-4 grid gap-3 sm:grid-cols-[minmax(0,1fr)_minmax(0,1fr)]`,children:[je,Fe]}),t[92]=je,t[93]=Fe,t[94]=Ie):Ie=t[94];let Le;t[95]!==oe||t[96]!==I||t[97]!==L||t[98]!==h||t[99]!==p||t[100]!==c||t[101]!==le||t[102]!==z?(Le=c===`form`?(0,$.jsxs)(`div`,{className:`mt-5 space-y-5`,children:[Ge.map(e=>(0,$.jsxs)(`div`,{className:`space-y-2`,children:[(0,$.jsx)(`h4`,{className:`text-[11px] font-semibold uppercase tracking-[0.08em] text-muted-foreground`,children:e.title}),(0,$.jsx)(`div`,{className:`grid gap-2 sm:grid-cols-2`,children:e.tokens.map(e=>{let t=z[e]??``,n=L[e]??``,r=de(e);return r?(0,$.jsx)(it,{token:e,kind:r,value:t,inherited:n,onChange:t=>I(e,t)},e):null})})]},e.title)),le.length>0?(0,$.jsxs)(`p`,{className:`text-xs text-warning-foreground`,children:[le.length,` token`,le.length===1?``:`s`,` not in the allow-list will be ignored on save.`]}):null]}):(0,$.jsxs)(`div`,{className:`mt-5 space-y-2`,children:[(0,$.jsx)(b,{value:p,size:`sm`,className:`font-mono text-xs`,spellCheck:!1,rows:18,onChange:e=>oe(e.currentTarget.value),"aria-invalid":h!==null||void 0}),h?(0,$.jsx)(`p`,{className:`text-xs text-destructive-foreground`,children:h}):(0,$.jsx)(`p`,{className:`text-xs text-muted-foreground/80`,children:`Edit the JSON directly. Save is disabled while the schema is invalid.`})]}),t[95]=oe,t[96]=I,t[97]=L,t[98]=h,t[99]=p,t[100]=c,t[101]=le,t[102]=z,t[103]=Le):Le=t[103];let Re;t[104]!==Oe||t[105]!==Ie||t[106]!==Le?(Re=(0,$.jsxs)(`div`,{className:`px-4 py-4 sm:px-5`,children:[Oe,Ie,Le]}),t[104]=Oe,t[105]=Ie,t[106]=Le,t[107]=Re):Re=t[107];let ze;t[108]===Symbol.for(`react.memo_cache_sentinel`)?(ze=(0,$.jsx)(E,{children:`Discard your changes?`}),t[108]=ze):ze=t[108];let Be;t[109]===n.name?Be=t[110]:(Be=(0,$.jsxs)(x,{children:[ze,(0,$.jsxs)(T,{children:[`You have unsaved edits to `,n.name,`. Discarding will revert any token changes you made.`]})]}),t[109]=n.name,t[110]=Be);let Ve;t[111]===Symbol.for(`react.memo_cache_sentinel`)?(Ve=(0,$.jsx)(C,{render:(0,$.jsx)(y,{variant:`outline`}),children:`Keep editing`}),t[111]=Ve):Ve=t[111];let He;t[112]===o?He=t[113]:(He=(0,$.jsxs)(S,{children:[Ve,(0,$.jsx)(y,{variant:`destructive`,onClick:()=>{O(!1),o()},children:`Discard changes`})]}),t[112]=o,t[113]=He);let Ue;t[114]!==Be||t[115]!==He?(Ue=(0,$.jsxs)(w,{children:[Be,He]}),t[114]=Be,t[115]=He,t[116]=Ue):Ue=t[116];let We;t[117]!==_||t[118]!==Ue?(We=(0,$.jsx)(D,{open:_,onOpenChange:O,children:Ue}),t[117]=_,t[118]=Ue,t[119]=We):We=t[119];let Ke;return t[120]!==ve||t[121]!==Re||t[122]!==We?(Ke=(0,$.jsxs)(`div`,{className:`border-t border-border/60 bg-muted/24`,children:[ve,Re,We]}),t[120]=ve,t[121]=Re,t[122]=We,t[123]=Ke):Ke=t[123],Ke}function tt(e){return Object.entries(e??{}).some(nt)}function nt(e){let[t,n]=e;if(typeof n!=`string`||n.length===0)return!1;let r=de(t);return r?!H(r,n):!1}function rt(e){let[t]=e;return!Ke.has(t)}function it(e){let t=(0,Z.c)(12),{token:n,kind:r,value:a,inherited:o,onChange:s}=e,c=a.length>0,l=r===`font-family`&&`sm:col-span-2`,u;t[0]===l?u=t[1]:(u=i(`rounded-md border border-border/60 bg-background px-2 py-1.5`,l),t[0]=l,t[1]=u);let d;t[2]!==o||t[3]!==r||t[4]!==s||t[5]!==c||t[6]!==n||t[7]!==a?(d=r===`color`?(0,$.jsx)(st,{token:n,value:a,inherited:o,overridden:c,onChange:s}):r===`opacity`?(0,$.jsx)(ct,{token:n,value:a,inherited:o,overridden:c,onChange:s}):r===`length`?(0,$.jsx)(lt,{token:n,value:a,inherited:o,overridden:c,onChange:s}):(0,$.jsx)(dt,{token:n,value:a,inherited:o,overridden:c,onChange:s}),t[2]=o,t[3]=r,t[4]=s,t[5]=c,t[6]=n,t[7]=a,t[8]=d):d=t[8];let f;return t[9]!==u||t[10]!==d?(f=(0,$.jsx)(`div`,{className:u,children:d}),t[9]=u,t[10]=d,t[11]=f):f=t[11],f}function at(e){let t=(0,Z.c)(6),{token:n,onChange:r}=e,i=`Reset --${n}`,a;t[0]===r?a=t[1]:(a=()=>r(``),t[0]=r,t[1]=a);let o;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,$.jsx)(g,{className:`size-3.5`,"aria-hidden":!0}),t[2]=o):o=t[2];let s;return t[3]!==i||t[4]!==a?(s=(0,$.jsx)(y,{size:`icon-xs`,variant:`ghost`,"aria-label":i,onClick:a,className:`text-muted-foreground`,children:o}),t[3]=i,t[4]=a,t[5]=s):s=t[5],s}function ot(e){let t=(0,Z.c)(6),{token:n,overridden:r}=e,a=r?`text-foreground`:`text-muted-foreground/70`,o;t[0]===a?o=t[1]:(o=i(`truncate font-mono text-[11px]`,a),t[0]=a,t[1]=o);let s=`--${n}`,c;return t[2]!==o||t[3]!==s||t[4]!==n?(c=(0,$.jsxs)(`span`,{className:o,title:s,children:[`--`,n]}),t[2]=o,t[3]=s,t[4]=n,t[5]=c):c=t[5],c}function st(e){let t=(0,Z.c)(41),{token:n,value:r,inherited:i,overridden:a,onChange:o}=e,s=r||i,c,l,u,d,f;if(t[0]!==s||t[1]!==r){u=me(s);let e;t[7]===r?e=t[8]:(e=r.length>0&&!B(r),t[7]=r,t[8]=e),l=e,f=`flex items-center gap-2`,c=We,d=Ye(u),t[0]=s,t[1]=r,t[2]=c,t[3]=l,t[4]=u,t[5]=d,t[6]=f}else c=t[2],l=t[3],u=t[4],d=t[5],f=t[6];let p;t[9]===o?p=t[10]:(p=e=>o(e),t[9]=o,t[10]=p);let m=`Pick a color for --${n}`,h=l?`transparent`:u||`transparent`,g;t[11]===h?g=t[12]:(g=(0,$.jsx)(`span`,{className:`pointer-events-none absolute inset-0`,style:{backgroundColor:h},"aria-hidden":!0}),t[11]=h,t[12]=g);let _;t[13]!==c||t[14]!==d||t[15]!==p||t[16]!==m||t[17]!==g?(_=(0,$.jsx)(c,{value:d,onChange:p,ariaLabel:m,children:g}),t[13]=c,t[14]=d,t[15]=p,t[16]=m,t[17]=g,t[18]=_):_=t[18];let y;t[19]!==a||t[20]!==n?(y=(0,$.jsx)(ot,{token:n,overridden:a}),t[19]=a,t[20]=n,t[21]=y):y=t[21];let b=i||`inherit default`,x=l||void 0,S;t[22]===o?S=t[23]:(S=e=>o(e.currentTarget.value),t[22]=o,t[23]=S);let C;t[24]!==x||t[25]!==S||t[26]!==b||t[27]!==r?(C=(0,$.jsx)(v,{value:r,nativeInput:!0,unstyled:!0,size:`sm`,className:`border-0 bg-transparent p-0 shadow-none focus-within:shadow-none`,placeholder:b,"aria-invalid":x,onChange:S}),t[24]=x,t[25]=S,t[26]=b,t[27]=r,t[28]=C):C=t[28];let w;t[29]!==C||t[30]!==y?(w=(0,$.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col`,children:[y,C]}),t[29]=C,t[30]=y,t[31]=w):w=t[31];let T;t[32]!==o||t[33]!==a||t[34]!==n?(T=a?(0,$.jsx)(at,{token:n,onChange:o}):null,t[32]=o,t[33]=a,t[34]=n,t[35]=T):T=t[35];let E;return t[36]!==w||t[37]!==T||t[38]!==f||t[39]!==_?(E=(0,$.jsxs)(`div`,{className:f,children:[_,w,T]}),t[36]=w,t[37]=T,t[38]=f,t[39]=_,t[40]=E):E=t[40],E}function ct(e){let t=(0,Z.c)(31),{token:n,value:r,inherited:i,overridden:a,onChange:o}=e,s=Number(r||i),c;t[0]===s?c=t[1]:(c=Number.isFinite(s)?Math.min(1,Math.max(0,s)):0,t[0]=s,t[1]=c);let l=c,u;t[2]===r?u=t[3]:(u=r.length>0&&!H(`opacity`,r),t[2]=r,t[3]=u);let d=u,f;t[4]!==a||t[5]!==n?(f=(0,$.jsx)(ot,{token:n,overridden:a}),t[4]=a,t[5]=n,t[6]=f):f=t[6];let p;t[7]===o?p=t[8]:(p=e=>o(e.currentTarget.value),t[7]=o,t[8]=p);let m=`--${n} value`,h;t[9]!==l||t[10]!==p||t[11]!==m?(h=(0,$.jsx)(`input`,{type:`range`,min:0,max:1,step:.005,value:l,onChange:p,"aria-label":m,className:`h-7.5 flex-1 accent-primary cursor-pointer`}),t[9]=l,t[10]=p,t[11]=m,t[12]=h):h=t[12];let g=i||`0`,_=d||void 0,y;t[13]===o?y=t[14]:(y=e=>o(e.currentTarget.value),t[13]=o,t[14]=y);let b;t[15]!==g||t[16]!==_||t[17]!==y||t[18]!==r?(b=(0,$.jsx)(`div`,{className:`w-20 shrink-0`,children:(0,$.jsx)(v,{value:r,nativeInput:!0,type:`number`,min:0,max:1,step:.005,size:`sm`,placeholder:g,"aria-invalid":_,onChange:y})}),t[15]=g,t[16]=_,t[17]=y,t[18]=r,t[19]=b):b=t[19];let x;t[20]!==o||t[21]!==a||t[22]!==n?(x=a?(0,$.jsx)(at,{token:n,onChange:o}):null,t[20]=o,t[21]=a,t[22]=n,t[23]=x):x=t[23];let S;t[24]!==b||t[25]!==x||t[26]!==h?(S=(0,$.jsxs)(`div`,{className:`flex items-center gap-2`,children:[h,b,x]}),t[24]=b,t[25]=x,t[26]=h,t[27]=S):S=t[27];let C;return t[28]!==S||t[29]!==f?(C=(0,$.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[f,S]}),t[28]=S,t[29]=f,t[30]=C):C=t[30],C}function lt(e){let t=(0,Z.c)(67),{token:n,value:r,inherited:i,overridden:a,onChange:o}=e,s,c,l,u,d;if(t[0]!==i||t[1]!==o||t[2]!==a||t[3]!==n||t[4]!==r){d=Symbol.for(`react.early_return_sentinel`);bb0:{l=V(r),c=V(i);let e=c?$e(c.unit):!1,f=l?$e(l.unit):!1;if(r.length>0&&!f||r.length===0&&i.length>0&&!e){let e;t[10]===r?e=t[11]:(e=r.length>0&&!H(`length`,r),t[10]=r,t[11]=e);let s=e,c;t[12]!==a||t[13]!==n?(c=(0,$.jsx)(ot,{token:n,overridden:a}),t[12]=a,t[13]=n,t[14]=c):c=t[14];let l=i||`e.g. 1rem`,u=s||void 0,f;t[15]===o?f=t[16]:(f=e=>o(e.currentTarget.value),t[15]=o,t[16]=f);let p;t[17]!==l||t[18]!==u||t[19]!==f||t[20]!==r?(p=(0,$.jsx)(v,{value:r,nativeInput:!0,size:`sm`,placeholder:l,"aria-invalid":u,onChange:f}),t[17]=l,t[18]=u,t[19]=f,t[20]=r,t[21]=p):p=t[21];let m;t[22]!==o||t[23]!==a||t[24]!==n?(m=a?(0,$.jsx)(at,{token:n,onChange:o}):null,t[22]=o,t[23]=a,t[24]=n,t[25]=m):m=t[25];let h;t[26]!==p||t[27]!==m?(h=(0,$.jsxs)(`div`,{className:`flex items-center gap-2`,children:[p,m]}),t[26]=p,t[27]=m,t[28]=h):h=t[28];let g;t[29]!==h||t[30]!==c?(g=(0,$.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[c,h]}),t[29]=h,t[30]=c,t[31]=g):g=t[31],d=g;break bb0}s=l?String(l.number):``,u=l&&$e(l.unit)?l.unit:c&&$e(c.unit)?c.unit:`rem`}t[0]=i,t[1]=o,t[2]=a,t[3]=n,t[4]=r,t[5]=s,t[6]=c,t[7]=l,t[8]=u,t[9]=d}else s=t[5],c=t[6],l=t[7],u=t[8],d=t[9];if(d!==Symbol.for(`react.early_return_sentinel`))return d;let f=u,p=c?String(c.number):``,m;t[32]!==o||t[33]!==f?(m=e=>{let t=e.trim();if(t.length===0){o(``);return}let n=Number(t);Number.isFinite(n)&&o(`${n}${f}`)},t[32]=o,t[33]=f,t[34]=m):m=t[34];let h=m,g;t[35]!==o||t[36]!==c||t[37]!==l?(g=e=>{if(l){o(`${l.number}${e}`);return}c&&o(`${c.number}${e}`)},t[35]=o,t[36]=c,t[37]=l,t[38]=g):g=t[38];let _=g,y;t[39]!==a||t[40]!==n?(y=(0,$.jsx)(ot,{token:n,overridden:a}),t[39]=a,t[40]=n,t[41]=y):y=t[41];let b=n===`font-size-base`?1:.05,x;t[42]===h?x=t[43]:(x=e=>h(e.currentTarget.value),t[42]=h,t[43]=x);let S;t[44]!==p||t[45]!==s||t[46]!==b||t[47]!==x?(S=(0,$.jsx)(`div`,{className:`min-w-0 flex-1`,children:(0,$.jsx)(v,{value:s,nativeInput:!0,type:`number`,step:b,size:`sm`,placeholder:p,onChange:x})}),t[44]=p,t[45]=s,t[46]=b,t[47]=x,t[48]=S):S=t[48];let C;t[49]===_?C=t[50]:(C=e=>_(e.currentTarget.value),t[49]=_,t[50]=C);let w=`--${n} unit`,T;t[51]===Symbol.for(`react.memo_cache_sentinel`)?(T=W.map(ut),t[51]=T):T=t[51];let E;t[52]!==w||t[53]!==C||t[54]!==f?(E=(0,$.jsx)(`select`,{value:f,onChange:C,"aria-label":w,className:`h-7.5 rounded-md border border-input bg-background px-2 text-sm outline-none focus-visible:border-ring focus-visible:ring-2 focus-visible:ring-ring/24 sm:h-6.5 sm:text-xs`,children:T}),t[52]=w,t[53]=C,t[54]=f,t[55]=E):E=t[55];let D;t[56]!==o||t[57]!==a||t[58]!==n?(D=a?(0,$.jsx)(at,{token:n,onChange:o}):null,t[56]=o,t[57]=a,t[58]=n,t[59]=D):D=t[59];let O;t[60]!==E||t[61]!==D||t[62]!==S?(O=(0,$.jsxs)(`div`,{className:`flex items-center gap-2`,children:[S,E,D]}),t[60]=E,t[61]=D,t[62]=S,t[63]=O):O=t[63];let k;return t[64]!==O||t[65]!==y?(k=(0,$.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[y,O]}),t[64]=O,t[65]=y,t[66]=k):k=t[66],k}function ut(e){return(0,$.jsx)(`option`,{value:e,children:e},e)}function dt(e){let t=(0,Z.c)(25),{token:n,value:r,inherited:i,overridden:a,onChange:o}=e,s=r||i,c;t[0]===r?c=t[1]:(c=r.length>0&&!H(`font-family`,r),t[0]=r,t[1]=c);let l=c,u;t[2]!==a||t[3]!==n?(u=(0,$.jsx)(ot,{token:n,overridden:a}),t[2]=a,t[3]=n,t[4]=u):u=t[4];let d=i||`system-ui, sans-serif`,f=s||void 0,p;t[5]===f?p=t[6]:(p={fontFamily:f},t[5]=f,t[6]=p);let m=l||void 0,h;t[7]===o?h=t[8]:(h=e=>o(e.currentTarget.value),t[7]=o,t[8]=h);let g;t[9]!==d||t[10]!==p||t[11]!==m||t[12]!==h||t[13]!==r?(g=(0,$.jsx)(`div`,{className:`min-w-0 flex-1`,children:(0,$.jsx)(v,{value:r,nativeInput:!0,size:`sm`,placeholder:d,style:p,"aria-invalid":m,onChange:h})}),t[9]=d,t[10]=p,t[11]=m,t[12]=h,t[13]=r,t[14]=g):g=t[14];let _;t[15]!==o||t[16]!==a||t[17]!==n?(_=a?(0,$.jsx)(at,{token:n,onChange:o}):null,t[15]=o,t[16]=a,t[17]=n,t[18]=_):_=t[18];let y;t[19]!==g||t[20]!==_?(y=(0,$.jsxs)(`div`,{className:`flex items-center gap-2`,children:[g,_]}),t[19]=g,t[20]=_,t[21]=y):y=t[21];let b;return t[22]!==y||t[23]!==u?(b=(0,$.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[u,y]}),t[22]=y,t[23]=u,t[24]=b):b=t[24],b}var ft=[{value:`system`,label:`System`},{value:`light`,label:`Light`},{value:`dark`,label:`Dark`}],pt={default:1,light:.92,medium:.84,high:.78,glass:.72};function mt({surface:e=`node`}={}){let t=e===`hub`,{theme:n,setTheme:r,resolvedTheme:o,activeThemeId:d,setActiveTheme:g}=ve(),v=a(e=>e.wideComposerControlsAutoCollapse),b=a(e=>e.setWideComposerControlsAutoCollapse),ee=a(e=>e.alwaysUseBuildMode),te=a(e=>e.setAlwaysUseBuildMode),[N,L]=(0,X.useState)(null),[de,B]=(0,X.useState)(null),[V,me]=(0,X.useState)(null),[H,U]=(0,X.useState)(()=>I()),[W,xe]=(0,X.useState)(0),Se=(0,X.useRef)(null),Ce=ye(),K=(0,X.useMemo)(()=>N!==null&&de!==null?{source:fe(N),draft:de}:null,[de,N,W]),Z=V?fe(V):null,Q=(0,X.useCallback)(()=>xe(e=>e+1),[]);(0,X.useEffect)(()=>{if(typeof window>`u`)return;let e=e=>{e.key===`ryco:appearance-preferences`&&U(I())};return window.addEventListener(`storage`,e),()=>window.removeEventListener(`storage`,e)},[]);let je=(0,X.useCallback)((e,t)=>{z(e,t),oe(),U(I())},[]),Me=(0,X.useCallback)(e=>{ne(e),oe(),U(I())},[]),Ne=(0,X.useCallback)(()=>{ne(`primaryColorMode`),ne(`primaryColor`),oe(),U(I())},[]),Pe=(0,X.useCallback)(e=>{z(`primaryColorMode`,e?`custom`:`theme`),oe(),U(I())},[]),Fe=(0,X.useCallback)(e=>{z(`primaryColor`,e),z(`primaryColorMode`,`custom`),oe(),U(I())},[]),ze=(0,X.useCallback)(e=>{if(pe(e.id)){let t=G(e);he(t),le(t.id),g(t.id),L(t.id),B(t),Q();return}g(e.id),L(e.id),B(e)},[Q,g]),Be=(0,X.useCallback)(e=>{let t=G(e);he(t),g(t.id),L(t.id),B(t),Q()},[Q,g]),Ve=(0,X.useCallback)(()=>{let e={id:ge(`new`),name:`New theme`,builtIn:!1};he(e),g(e.id),L(e.id),B(e),Q()},[Q,g]),He=(0,X.useCallback)(()=>{K&&(be(K.source.id,K.draft),K.source.id===K.draft.id?ue(K.draft):g(K.draft.id),L(null),B(null),Q())},[K,Q,g]),Ue=(0,X.useCallback)(()=>{K&&ue(K.source),L(null),B(null)},[K]),We=(0,X.useCallback)(()=>{V&&(N===V&&(L(null),B(null)),_e(V),me(null),Q())},[N,V,Q]),Ge=(0,X.useCallback)(e=>{try{Le(e)}catch(e){s.add({type:`error`,title:`Could not export theme`,description:e instanceof Error?e.message:`Download failed.`})}},[]),Ke=(0,X.useCallback)(async e=>{try{await Ie(e),s.add({type:`success`,title:`Copied theme JSON`,description:`${e.name} is ready to paste.`})}catch(e){s.add({type:`error`,title:`Could not copy theme`,description:e instanceof Error?e.message:`Clipboard write failed.`})}},[]),qe=(0,X.useCallback)(()=>{Se.current?.click()},[]),Je=(0,X.useCallback)(async e=>{let t=e.target.files?.[0];if(e.target.value=``,t)try{let e=await Re(t,{collision:`rename`,activate:!0});g(e.theme.id),Q(),s.add({type:`success`,title:`Imported "${e.theme.name}"`,description:e.action===`renamed`?`An existing theme used the same id, so it was imported as "${e.theme.id}".`:`Theme imported and activated.`})}catch(e){s.add({type:`error`,title:`Could not import theme`,description:e instanceof Error?e.message:`Invalid theme file.`})}},[Q,g]);return(0,$.jsxs)(we,{children:[(0,$.jsxs)(q,{title:`Interface controls`,children:[(0,$.jsx)(J,{title:`Interface font`,description:`Normal app text, navigation, dialogs, and controls.`,resetAction:R(`fontFamilySans`)?(0,$.jsx)(Y,{label:`interface font`,onClick:()=>Me(`fontFamilySans`)}):null,control:(0,$.jsx)(ht,{ariaLabel:`Interface font`,icon:(0,$.jsx)(ke,{className:`size-3.5`}),options:F,value:H.fontFamilySans,sample:`The quick brown fox`,onChange:e=>je(`fontFamilySans`,e)})}),t?null:(0,$.jsx)(J,{title:`Code font`,description:`Code blocks, diffs, file paths, and terminal surfaces.`,resetAction:R(`fontFamilyMono`)?(0,$.jsx)(Y,{label:`code font`,onClick:()=>Me(`fontFamilyMono`)}):null,control:(0,$.jsx)(ht,{ariaLabel:`Code font`,icon:(0,$.jsx)(Ee,{className:`size-3.5`}),options:ae,value:H.fontFamilyMono,sample:`const answer = 42`,onChange:e=>je(`fontFamilyMono`,e)})}),(0,$.jsx)(J,{title:`Text size`,description:`Scale the interface independently from the active theme.`,resetAction:R(`fontSizeBase`)?(0,$.jsx)(Y,{label:`text size`,onClick:()=>Me(`fontSizeBase`)}):null,control:(0,$.jsx)(_t,{ariaLabel:`Text size`,icon:(0,$.jsx)(Te,{className:`size-3.5`}),options:se,value:H.fontSizeBase,onChange:e=>je(`fontSizeBase`,e),preview:(0,$.jsx)(`span`,{className:`flex h-9 min-w-14 items-center justify-center rounded-md border border-border/70 bg-background px-2 font-semibold text-foreground shadow-xs/5`,children:(0,$.jsx)(`span`,{style:{fontSize:H.fontSizeBase},children:`Aa`})})})}),t?null:(0,$.jsx)(J,{title:`Corner radius`,description:`Adjust rounding for panels, buttons, inputs, and menus globally.`,resetAction:R(`radius`)?(0,$.jsx)(Y,{label:`corner radius`,onClick:()=>Me(`radius`)}):null,control:(0,$.jsx)(_t,{ariaLabel:`Corner radius`,icon:(0,$.jsx)(Oe,{className:`size-3.5`}),options:ie,value:H.radius,onChange:e=>je(`radius`,e),preview:(0,$.jsxs)(`span`,{className:`grid h-9 min-w-14 grid-cols-2 gap-1 rounded-md border border-border/70 bg-background p-1.5 shadow-xs/5`,children:[(0,$.jsx)(`span`,{className:`border border-primary/55 bg-primary/15`,style:{borderRadius:H.radius}}),(0,$.jsx)(`span`,{className:`border border-muted-foreground/30 bg-muted`,style:{borderRadius:H.radius}})]})})}),(0,$.jsx)(J,{title:`Primary color`,description:`Theme palettes control buttons by default; enable a custom color to pin one app accent.`,resetAction:R(`primaryColorMode`)||R(`primaryColor`)?(0,$.jsx)(Y,{label:`primary color`,onClick:Ne}):null,control:(0,$.jsx)(gt,{mode:H.primaryColorMode,value:H.primaryColor,onModeChange:Pe,onColorChange:Fe})}),(0,$.jsx)(J,{title:`Transparency`,description:`Adjust glass and floating surfaces like dialogs, menus, popups, and toasts.`,resetAction:R(`surfaceTransparency`)?(0,$.jsx)(Y,{label:`transparency`,onClick:()=>Me(`surfaceTransparency`)}):null,control:(0,$.jsx)(_t,{ariaLabel:`Transparency`,icon:(0,$.jsx)(De,{className:`size-3.5`}),options:ce,value:H.surfaceTransparency,onChange:e=>je(`surfaceTransparency`,e),preview:(0,$.jsx)(`span`,{className:`relative h-9 min-w-14 overflow-hidden rounded-md border border-border/70 bg-[linear-gradient(135deg,var(--color-sky-500)_0_20%,var(--color-emerald-500)_20%_40%,var(--color-amber-500)_40%_60%,var(--color-fuchsia-500)_60%_80%,var(--color-slate-500)_80%_100%)] p-1.5 shadow-xs/5`,children:(0,$.jsx)(`span`,{className:`block h-full rounded border border-border/70 bg-popover`,style:{opacity:pt[H.surfaceTransparency]??pt.default}})})})}),t?null:(0,$.jsx)(J,{title:`Panel layout`,description:`Choose how the overview panel arranges source control, status, plan, subagents, and the pull request.`,resetAction:R(`panelLayout`)?(0,$.jsx)(Y,{label:`panel layout`,onClick:()=>Me(`panelLayout`)}):null,control:(0,$.jsx)(_t,{ariaLabel:`Panel layout`,icon:(0,$.jsx)(f,{className:`size-3.5`}),options:re,value:H.panelLayout,onChange:e=>je(`panelLayout`,e),preview:(0,$.jsxs)(`span`,{className:`flex h-9 min-w-14 flex-col justify-center gap-1 rounded-md border border-border/70 bg-background p-1.5 shadow-xs/5`,children:[(0,$.jsx)(`span`,{className:`h-1 rounded-full bg-primary/45`}),(0,$.jsx)(`span`,{className:`h-1 w-2/3 rounded-full bg-muted-foreground/30`}),(0,$.jsx)(`span`,{className:`h-1 rounded-full bg-muted-foreground/30`})]})})})]}),(0,$.jsx)(q,{title:`Theme palette`,headerAction:(0,$.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,$.jsx)(`input`,{ref:Se,type:`file`,accept:`.json,application/json`,className:`sr-only`,onChange:Je,"aria-hidden":!0,tabIndex:-1}),(0,$.jsxs)(y,{size:`xs`,variant:`ghost`,onClick:Ve,"aria-label":`Create a new theme`,title:`Create a new theme`,className:`text-muted-foreground`,children:[(0,$.jsx)(m,{className:`size-3.5`}),`New`]}),(0,$.jsxs)(y,{size:`xs`,variant:`ghost`,onClick:qe,"aria-label":`Import a theme from file`,title:`Import a theme from disk`,className:`text-muted-foreground`,children:[(0,$.jsx)(Ae,{className:`size-3.5`}),`Import`]})]}),children:(0,$.jsx)(`div`,{role:`radiogroup`,"aria-label":`Theme palette`,children:Ce.map((e,t)=>{let n=e.id===d,r=N===e.id;return(0,$.jsxs)(X.Fragment,{children:[(0,$.jsxs)(`div`,{role:`radio`,"aria-checked":n,tabIndex:n?0:-1,onClick:()=>g(e.id),onKeyDown:t=>{(t.key===` `||t.key===`Enter`)&&(t.preventDefault(),g(e.id))},className:i(`flex cursor-pointer flex-wrap items-center gap-3 px-4 py-3 outline-none transition-colors focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-inset sm:px-5`,t>0?`border-t border-border/60`:``,n?`bg-muted/40`:`hover:bg-muted/24`),children:[(0,$.jsx)(`span`,{"aria-hidden":!0,className:i(`relative flex size-4 shrink-0 items-center justify-center rounded-full border-2 transition-colors`,n?`border-primary`:`border-muted-foreground/40`),children:n?(0,$.jsx)(`span`,{className:`size-2 rounded-full bg-primary`,"aria-hidden":!0}):null}),(0,$.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-0.5`,children:[(0,$.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,$.jsx)(`span`,{className:`truncate text-sm font-medium text-foreground`,title:e.name,children:e.name}),(0,$.jsx)(P,{variant:`outline`,size:`sm`,children:e.builtIn?`Built-in`:`Custom`})]}),e.description?(0,$.jsx)(`span`,{className:`truncate text-xs text-muted-foreground/80`,title:e.description,children:e.description}):null]}),(0,$.jsxs)(`div`,{className:`flex shrink-0 items-center gap-0.5`,onClick:e=>e.stopPropagation(),onKeyDown:e=>e.stopPropagation(),children:[e.builtIn?null:(0,$.jsx)(y,{size:`icon-xs`,variant:`ghost`,"aria-label":`Edit ${e.name}`,title:`Edit`,onClick:()=>ze(e),className:`text-muted-foreground`,children:(0,$.jsx)(p,{className:`size-3.5`})}),(0,$.jsx)(y,{size:`icon-xs`,variant:`ghost`,"aria-label":`Duplicate ${e.name}`,title:`Duplicate`,onClick:()=>Be(e),className:`text-muted-foreground`,children:(0,$.jsx)(l,{className:`size-3.5`})}),(0,$.jsx)(y,{size:`icon-xs`,variant:`ghost`,"aria-label":`Export ${e.name}`,title:`Export`,onClick:()=>Ge(e),className:`text-muted-foreground`,children:(0,$.jsx)(u,{className:`size-3.5`})}),(0,$.jsx)(y,{size:`icon-xs`,variant:`ghost`,"aria-label":`Copy ${e.name} JSON`,title:`Copy JSON`,onClick:()=>void Ke(e),className:`text-muted-foreground`,children:(0,$.jsx)(c,{className:`size-3.5`})}),e.builtIn?null:(0,$.jsx)(y,{size:`icon-xs`,variant:`ghost`,"aria-label":`Delete ${e.name}`,title:`Delete`,onClick:()=>me(e.id),className:`text-destructive-foreground`,children:(0,$.jsx)(h,{className:`size-3.5`})})]})]}),r&&K?(0,$.jsx)(et,{source:K.source,draft:K.draft,onDraftChange:e=>B(e),onSave:He,onCancel:Ue,resolvedVariant:o}):null]},e.id)})})}),t?null:(0,$.jsxs)(q,{title:`Composer controls`,children:[(0,$.jsx)(J,{title:`Auto-collapse wide composer labels`,description:`Show long composer mode labels only on hover or focus.`,resetAction:v?null:(0,$.jsx)(Y,{label:`wide composer labels`,onClick:()=>b(!0)}),control:(0,$.jsx)(_,{checked:v,onCheckedChange:e=>b(!!e),"aria-label":`Auto-collapse wide composer labels`})}),(0,$.jsx)(J,{title:`Always use Build mode`,description:`Hide the mode selector in the composer and send every turn in Build mode.`,resetAction:ee?(0,$.jsx)(Y,{label:`always use Build mode`,onClick:()=>te(!1)}):null,control:(0,$.jsx)(_,{checked:ee,onCheckedChange:e=>te(!!e),"aria-label":`Always use Build mode`})})]}),(0,$.jsx)(q,{title:`Color mode`,children:(0,$.jsx)(J,{title:`Theme variant`,description:`Choose between light, dark, or following the system preference.`,resetAction:n===`system`?null:(0,$.jsx)(Y,{label:`color mode`,onClick:()=>r(`system`)}),control:(0,$.jsxs)(M,{value:n,onValueChange:e=>{(e===`system`||e===`light`||e===`dark`)&&r(e)},children:[(0,$.jsx)(A,{className:`w-full sm:w-40`,"aria-label":`Color mode`,children:(0,$.jsx)(j,{children:ft.find(e=>e.value===n)?.label??`System`})}),(0,$.jsx)(O,{align:`end`,alignItemWithTrigger:!1,children:ft.map(e=>(0,$.jsx)(k,{hideIndicator:!0,value:e.value,children:e.label},e.value))})]})})}),(0,$.jsx)(D,{open:V!==null,onOpenChange:e=>{e||me(null)},children:(0,$.jsxs)(w,{children:[(0,$.jsxs)(x,{children:[(0,$.jsx)(E,{children:`Delete custom theme?`}),(0,$.jsx)(T,{children:Z?`"${Z.name}" will be removed permanently. This action cannot be undone.`:`This action cannot be undone.`})]}),(0,$.jsxs)(S,{children:[(0,$.jsx)(C,{render:(0,$.jsx)(y,{variant:`outline`}),children:`Cancel`}),(0,$.jsx)(y,{variant:`destructive`,onClick:We,children:`Delete theme`})]})]})})]})}function ht(e){let t=(0,Z.c)(43),{ariaLabel:n,icon:r,options:a,value:o,sample:s,onChange:c}=e,l;if(t[0]!==a||t[1]!==o){let e;t[3]===o?e=t[4]:(e=e=>e.value===o,t[3]=o,t[4]=e),l=a.findIndex(e),t[0]=a,t[1]=o,t[2]=l}else l=t[2];let u=Math.max(0,l),d=a[u]??a[0],f;t[5]===r?f=t[6]:(f=(0,$.jsx)(`span`,{className:`inline-flex size-7 shrink-0 items-center justify-center rounded-md border border-border/70 bg-muted/60 text-muted-foreground`,children:r}),t[5]=r,t[6]=f);let p=d?.value??o,m;t[7]===p?m=t[8]:(m={fontFamily:p},t[7]=p,t[8]=m);let h=d?.label??o,g;t[9]!==m||t[10]!==h?(g=(0,$.jsx)(`span`,{className:`block truncate text-sm font-semibold text-foreground`,style:m,children:h}),t[9]=m,t[10]=h,t[11]=g):g=t[11];let _=d?.description??`Custom`,v;t[12]===_?v=t[13]:(v=(0,$.jsx)(`span`,{className:`block truncate text-[11px] text-muted-foreground`,children:_}),t[12]=_,t[13]=v);let y;t[14]!==g||t[15]!==v?(y=(0,$.jsxs)(`span`,{className:`min-w-0`,children:[g,v]}),t[14]=g,t[15]=v,t[16]=y):y=t[16];let b;t[17]!==f||t[18]!==y?(b=(0,$.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[f,y]}),t[17]=f,t[18]=y,t[19]=b):b=t[19];let x=d?.value??o,S;t[20]===x?S=t[21]:(S={fontFamily:x},t[20]=x,t[21]=S);let C;t[22]!==s||t[23]!==S?(C=(0,$.jsx)(`span`,{className:`flex h-9 min-w-30 max-w-44 items-center justify-start truncate rounded-md border border-border/70 bg-background px-2 text-xs text-foreground shadow-xs/5`,style:S,title:s,children:s}),t[22]=s,t[23]=S,t[24]=C):C=t[24];let w;t[25]!==b||t[26]!==C?(w=(0,$.jsxs)(`div`,{className:`mb-2 flex min-h-9 items-center justify-between gap-3`,children:[b,C]}),t[25]=b,t[26]=C,t[27]=w):w=t[27];let T;if(t[28]!==n||t[29]!==c||t[30]!==a||t[31]!==u){let e;t[33]!==n||t[34]!==c||t[35]!==u?(e=(e,t)=>{let r=t===u;return(0,$.jsxs)(`button`,{type:`button`,role:`radio`,"aria-checked":r,"aria-label":`Use ${e.label} for ${n.toLowerCase()}`,title:`${e.label} (${e.description})`,onClick:()=>c(e.value),className:i(`min-h-12 min-w-0 rounded-md border px-2 py-1.5 text-left outline-none transition-colors focus-visible:ring-2 focus-visible:ring-ring`,r?`border-primary bg-primary/8 text-foreground ring-1 ring-primary/35`:`border-border/70 text-muted-foreground hover:border-foreground/25 hover:bg-muted/45`),children:[(0,$.jsx)(`span`,{className:`block truncate text-[12px] font-semibold leading-4`,style:{fontFamily:e.value},children:e.label}),(0,$.jsx)(`span`,{className:`block truncate text-[10px] leading-3 opacity-75`,children:e.description})]},e.value)},t[33]=n,t[34]=c,t[35]=u,t[36]=e):e=t[36],T=a.map(e),t[28]=n,t[29]=c,t[30]=a,t[31]=u,t[32]=T}else T=t[32];let E;t[37]!==n||t[38]!==T?(E=(0,$.jsx)(`div`,{role:`radiogroup`,"aria-label":n,className:`grid grid-cols-2 gap-1.5 sm:grid-cols-3`,children:T}),t[37]=n,t[38]=T,t[39]=E):E=t[39];let D;return t[40]!==w||t[41]!==E?(D=(0,$.jsxs)(`div`,{className:`w-full sm:w-96`,children:[w,E]}),t[40]=w,t[41]=E,t[42]=D):D=t[42],D}function gt(e){let t=(0,Z.c)(48),{mode:n,value:r,onModeChange:a,onColorChange:o}=e,s=n===`custom`,c;t[0]===r?c=t[1]:(c=/^#[0-9a-f]{6}$/i.test(r)?r.toLowerCase():L[0].value,t[0]=r,t[1]=c);let l=c,u;t[2]===l?u=t[3]:(u=L.find(e=>e.value===l),t[2]=l,t[3]=u);let f=u,p=s&&!f?`border-primary bg-primary/8 text-foreground ring-1 ring-primary/35`:`border-border/70 text-muted-foreground hover:border-foreground/25 hover:bg-muted/45`,m=!s&&`cursor-not-allowed opacity-55 hover:border-border/70 hover:bg-transparent`,h;t[4]!==p||t[5]!==m?(h=i(`h-12 w-full rounded-md border px-2 py-1.5 text-left shadow-none`,p,m),t[4]=p,t[5]=m,t[6]=h):h=t[6];let g=h,v;t[7]===l?v=t[8]:(v=(0,$.jsx)(`span`,{"aria-hidden":!0,className:`size-5 shrink-0 rounded-full border border-black/10 shadow-xs dark:border-white/20`,style:{backgroundColor:l}}),t[7]=l,t[8]=v);let y;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(y=(0,$.jsx)(`span`,{className:`block truncate text-[12px] font-semibold leading-4`,children:`Custom`}),t[9]=y):y=t[9];let b;t[10]===l?b=t[11]:(b=(0,$.jsxs)(`span`,{className:`min-w-0`,children:[y,(0,$.jsx)(`span`,{className:`block truncate font-mono text-[10px] leading-3 opacity-75`,children:l})]}),t[10]=l,t[11]=b);let x;t[12]!==v||t[13]!==b?(x=(0,$.jsxs)(`span`,{className:`flex size-full min-w-0 items-center gap-2`,children:[v,b]}),t[12]=v,t[13]=b,t[14]=x):x=t[14];let S=x,C;t[15]===Symbol.for(`react.memo_cache_sentinel`)?(C=(0,$.jsx)(`span`,{className:`inline-flex size-7 shrink-0 items-center justify-center rounded-md border border-border/70 bg-muted/60 text-muted-foreground`,children:(0,$.jsx)(d,{className:`size-3.5`})}),t[15]=C):C=t[15];let w=s?f?.label??`Custom`:`Theme color`,T;t[16]===w?T=t[17]:(T=(0,$.jsx)(`span`,{className:`block truncate text-sm font-semibold text-foreground`,children:w}),t[16]=w,t[17]=T);let E=s?l:`Active palette`,D;t[18]===E?D=t[19]:(D=(0,$.jsx)(`span`,{className:`block truncate text-[11px] text-muted-foreground`,children:E}),t[18]=E,t[19]=D);let O;t[20]!==T||t[21]!==D?(O=(0,$.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[C,(0,$.jsxs)(`span`,{className:`min-w-0`,children:[T,D]})]}),t[20]=T,t[21]=D,t[22]=O):O=t[22];let k;t[23]===Symbol.for(`react.memo_cache_sentinel`)?(k=(0,$.jsx)(`span`,{children:`Use theme`}),t[23]=k):k=t[23];let A=!s,j;t[24]===a?j=t[25]:(j=e=>a(!e),t[24]=a,t[25]=j);let M;t[26]!==A||t[27]!==j?(M=(0,$.jsxs)(`label`,{className:`flex h-9 shrink-0 items-center gap-2 rounded-md border border-border/70 bg-background px-2 text-xs text-muted-foreground shadow-xs/5`,children:[k,(0,$.jsx)(_,{checked:A,onCheckedChange:j,"aria-label":`Use theme primary color`})]}),t[26]=A,t[27]=j,t[28]=M):M=t[28];let ee;t[29]!==O||t[30]!==M?(ee=(0,$.jsxs)(`div`,{className:`mb-2 flex min-h-9 items-center justify-between gap-3`,children:[O,M]}),t[29]=O,t[30]=M,t[31]=ee):ee=t[31];let te;t[32]!==s||t[33]!==l||t[34]!==o?(te=L.map(e=>{let t=l===e.value;return(0,$.jsxs)(`button`,{type:`button`,role:`radio`,"aria-checked":s&&t,"aria-label":`Use ${e.label} as primary color`,title:`${e.label} (${e.value})`,onClick:()=>o(e.value),disabled:!s,className:i(`flex min-h-12 min-w-0 items-center gap-2 rounded-md border px-2 py-1.5 text-left outline-none transition-colors focus-visible:ring-2 focus-visible:ring-ring`,s&&t?`border-primary bg-primary/8 text-foreground ring-1 ring-primary/35`:`border-border/70 text-muted-foreground hover:border-foreground/25 hover:bg-muted/45`,!s&&`cursor-not-allowed opacity-55 hover:border-border/70 hover:bg-transparent`),children:[(0,$.jsx)(`span`,{"aria-hidden":!0,className:`size-5 shrink-0 rounded-full border border-black/10 shadow-xs dark:border-white/20`,style:{backgroundColor:e.value}}),(0,$.jsxs)(`span`,{className:`min-w-0`,children:[(0,$.jsx)(`span`,{className:`block truncate text-[12px] font-semibold leading-4`,children:e.label}),(0,$.jsx)(`span`,{className:`block truncate text-[10px] leading-3 opacity-75`,children:e.description})]})]},e.value)}),t[32]=s,t[33]=l,t[34]=o,t[35]=te):te=t[35];let N;t[36]!==s||t[37]!==g||t[38]!==S||t[39]!==l||t[40]!==o?(N=s?(0,$.jsx)(We,{value:l,onChange:o,ariaLabel:`Pick custom primary color`,triggerClassName:g,children:S}):(0,$.jsx)(`button`,{type:`button`,disabled:!0,"aria-label":`Pick custom primary color`,className:g,children:S}),t[36]=s,t[37]=g,t[38]=S,t[39]=l,t[40]=o,t[41]=N):N=t[41];let P;t[42]!==te||t[43]!==N?(P=(0,$.jsxs)(`div`,{role:`radiogroup`,"aria-label":`Primary color`,className:`grid grid-cols-2 gap-1.5 sm:grid-cols-4`,children:[te,N]}),t[42]=te,t[43]=N,t[44]=P):P=t[44];let F;return t[45]!==ee||t[46]!==P?(F=(0,$.jsxs)(`div`,{className:`w-full sm:w-96`,children:[ee,P]}),t[45]=ee,t[46]=P,t[47]=F):F=t[47],F}function _t(e){let t=(0,Z.c)(50),{ariaLabel:n,icon:r,options:a,value:o,onChange:s,preview:c}=e,l;if(t[0]!==a||t[1]!==o){let e;t[3]===o?e=t[4]:(e=e=>e.value===o,t[3]=o,t[4]=e),l=a.findIndex(e),t[0]=a,t[1]=o,t[2]=l}else l=t[2];let u=Math.max(0,l),d=a[u]??a[0],f=a.length>1?u/(a.length-1)*100:0,p;t[5]===r?p=t[6]:(p=(0,$.jsx)(`span`,{className:`inline-flex size-7 shrink-0 items-center justify-center rounded-md border border-border/70 bg-muted/60 text-muted-foreground`,children:r}),t[5]=r,t[6]=p);let m=d?.label??o,h;t[7]===m?h=t[8]:(h=(0,$.jsx)(`span`,{className:`block truncate text-sm font-semibold text-foreground`,children:m}),t[7]=m,t[8]=h);let g=d?.description??o,_;t[9]===g?_=t[10]:(_=(0,$.jsx)(`span`,{className:`block truncate text-[11px] text-muted-foreground`,children:g}),t[9]=g,t[10]=_);let v;t[11]!==h||t[12]!==_?(v=(0,$.jsxs)(`span`,{className:`min-w-0`,children:[h,_]}),t[11]=h,t[12]=_,t[13]=v):v=t[13];let y;t[14]!==p||t[15]!==v?(y=(0,$.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[p,v]}),t[14]=p,t[15]=v,t[16]=y):y=t[16];let b;t[17]!==c||t[18]!==y?(b=(0,$.jsxs)(`div`,{className:`mb-2 flex min-h-9 items-center justify-between gap-3`,children:[y,c]}),t[17]=c,t[18]=y,t[19]=b):b=t[19];let x;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(x=i(`h-5 w-full cursor-pointer appearance-none bg-transparent outline-none`,`[&::-webkit-slider-runnable-track]:h-1.5 [&::-webkit-slider-runnable-track]:rounded-full`,`[&::-webkit-slider-thumb]:mt-[-5px] [&::-webkit-slider-thumb]:size-4 [&::-webkit-slider-thumb]:appearance-none [&::-webkit-slider-thumb]:rounded-full [&::-webkit-slider-thumb]:border-2 [&::-webkit-slider-thumb]:border-background [&::-webkit-slider-thumb]:bg-primary [&::-webkit-slider-thumb]:shadow-sm`,`[&::-moz-range-track]:h-1.5 [&::-moz-range-track]:rounded-full [&::-moz-range-track]:border-0`,`[&::-moz-range-thumb]:size-4 [&::-moz-range-thumb]:rounded-full [&::-moz-range-thumb]:border-2 [&::-moz-range-thumb]:border-background [&::-moz-range-thumb]:bg-primary [&::-moz-range-thumb]:shadow-sm`,`focus-visible:[&::-webkit-slider-thumb]:ring-2 focus-visible:[&::-webkit-slider-thumb]:ring-ring focus-visible:[&::-moz-range-thumb]:ring-2 focus-visible:[&::-moz-range-thumb]:ring-ring`),t[20]=x):x=t[20];let S=Math.max(0,a.length-1),C=`linear-gradient(to right, var(--color-primary) 0%, var(--color-primary) ${f}%, color-mix(in srgb, var(--color-muted-foreground) 18%, transparent) ${f}%, color-mix(in srgb, var(--color-muted-foreground) 18%, transparent) 100%)`,w;t[21]===C?w=t[22]:(w={background:C,borderRadius:`999px`},t[21]=C,t[22]=w);let T;t[23]!==s||t[24]!==a?(T=e=>{let t=a[Number(e.currentTarget.value)];t&&s(t.value)},t[23]=s,t[24]=a,t[25]=T):T=t[25];let E;t[26]!==n||t[27]!==u||t[28]!==S||t[29]!==w||t[30]!==T?(E=(0,$.jsx)(`input`,{"aria-label":n,className:x,max:S,min:0,step:1,type:`range`,value:u,style:w,onChange:T}),t[26]=n,t[27]=u,t[28]=S,t[29]=w,t[30]=T,t[31]=E):E=t[31];let D=`repeat(${a.length}, minmax(0, 1fr))`,O;t[32]===D?O=t[33]:(O={gridTemplateColumns:D},t[32]=D,t[33]=O);let k;if(t[34]!==n||t[35]!==s||t[36]!==a||t[37]!==u){let e;t[39]!==n||t[40]!==s||t[41]!==u?(e=(e,t)=>{let r=t===u;return(0,$.jsxs)(`button`,{type:`button`,"aria-label":`Set ${n.toLowerCase()} to ${e.label}`,title:`${e.label} (${e.description})`,onClick:()=>s(e.value),className:i(`flex min-h-7 min-w-0 flex-col items-center justify-start gap-1 rounded-md px-1 py-1 text-center outline-none transition-colors focus-visible:ring-2 focus-visible:ring-ring`,r?`text-foreground`:`text-muted-foreground hover:bg-muted/50`),children:[(0,$.jsx)(`span`,{className:i(`size-1.5 rounded-full`,r?`bg-primary`:`bg-muted-foreground/35`),"aria-hidden":!0}),(0,$.jsx)(`span`,{className:`max-w-full truncate text-[10px] leading-none`,children:e.label})]},e.value)},t[39]=n,t[40]=s,t[41]=u,t[42]=e):e=t[42],k=a.map(e),t[34]=n,t[35]=s,t[36]=a,t[37]=u,t[38]=k}else k=t[38];let A;t[43]!==O||t[44]!==k?(A=(0,$.jsx)(`div`,{className:`mt-1.5 grid gap-1`,style:O,children:k}),t[43]=O,t[44]=k,t[45]=A):A=t[45];let j;return t[46]!==E||t[47]!==A||t[48]!==b?(j=(0,$.jsxs)(`div`,{className:`w-full sm:w-96`,children:[b,E,A]}),t[46]=E,t[47]=A,t[48]=b,t[49]=j):j=t[49],j}export{mt as AppearanceSettingsPanel};