@remit/web-client-dist 0.0.674 → 0.0.676

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 (221) hide show
  1. package/assets/AppFrame-DSPG81Mk.js +1 -0
  2. package/assets/BriefPane-Cfl-uWfm.js +1 -0
  3. package/assets/CalendarEventEditor-COnJXvRd.js +1 -0
  4. package/assets/CalendarEventPopup-CqHE2vrc.js +1 -0
  5. package/assets/CalendarLoadFailed-CxL15r1A.js +1 -0
  6. package/assets/CalendarQuickCreate-DxgU3bNP.js +1 -0
  7. package/assets/CalendarSession-BKwK9s2o.js +1 -0
  8. package/assets/EmptyState-BUOSmldo.js +1 -0
  9. package/assets/{ErrorState-Bi4vrhhQ.js → ErrorState-KjDYblD5.js} +1 -1
  10. package/assets/FlaggedPane-Dw-wR4tp.js +1 -0
  11. package/assets/{FullCompose-D6Xef8Ur.js → FullCompose-Djp_h4BT.js} +1 -1
  12. package/assets/{LabelApplyTrigger-BnPNejnI.js → LabelApplyTrigger-oS5sxATE.js} +1 -1
  13. package/assets/MailShell-LIuV2C3h.js +1 -0
  14. package/assets/MailViewChrome-yffBJjbO.js +1 -0
  15. package/assets/MailboxPane-DUCZVAx6.js +1 -0
  16. package/assets/{MessageBody-AvWIklnv.js → MessageBody-C89PSL_p.js} +3 -3
  17. package/assets/MessageToolbar-UJadqHyA.js +1 -0
  18. package/assets/NavMenuButton-B-goW-G5.js +1 -0
  19. package/assets/OnboardingWizard-Cvqq2aP_.js +1 -0
  20. package/assets/OutboxPane-ce4uTAzW.js +1 -0
  21. package/assets/_calendarObjectId-lcrg9Fhc.js +1 -0
  22. package/assets/_mailboxId-BzKo-TnK.js +1 -0
  23. package/assets/_messageId-C7U0TsBv.js +1 -0
  24. package/assets/_messageId-CGB3gt7C.js +1 -0
  25. package/assets/_messageId-D2Qjacn6.js +1 -0
  26. package/assets/_outboxMessageId-FUbJ3RF8.js +1 -0
  27. package/assets/_recurrenceId-DpQOCGAd.js +1 -0
  28. package/assets/_threadId-BmZ2vl5z.js +1 -0
  29. package/assets/_threadId-Bs84eLjr.js +1 -0
  30. package/assets/_threadId-DySupNzi.js +1 -0
  31. package/assets/_view._date-DYujYKtx.js +1 -0
  32. package/assets/account-service-status-oYDwuPLn.js +1 -0
  33. package/assets/accounts-DhSbRlEm.js +1 -0
  34. package/assets/advanced-B50NfkTy.js +1 -0
  35. package/assets/appearance-CYNOlHLz.js +1 -0
  36. package/assets/{avatar-qD7fcqFf.js → avatar-uWJajuSb.js} +1 -1
  37. package/assets/{bottom-sheet-B_7iO-ln.js → bottom-sheet-Bc0vwv2J.js} +1 -1
  38. package/assets/brief-DPWE6nMF.js +1 -0
  39. package/assets/{brief-RK0pe25_.js → brief-bdXCpAmW.js} +1 -1
  40. package/assets/calendar-7SdvLY_h.js +1 -0
  41. package/assets/calendar-event-popup-DsPmxVye.js +1 -0
  42. package/assets/calendar-event-sidebar-soFGsDRR.js +1 -0
  43. package/assets/calendar-failure-note-BtZLcaiZ.js +1 -0
  44. package/assets/calendar-format-BwCpz-JZ.js +1 -0
  45. package/assets/calendar-guests-BR4hC59z.js +1 -0
  46. package/assets/calendar-suggestion-8jcpefeR.js +1 -0
  47. package/assets/calendar-tMekVEGW.js +1 -0
  48. package/assets/calendars-bLB0g-E-.js +1 -0
  49. package/assets/{card-C9cgHaft.js → card-CPL-TrL1.js} +1 -1
  50. package/assets/checkbox-CGG1nAhQ.js +1 -0
  51. package/assets/{circle-check-big-ZwVj0mbk.js → circle-check-big-BsCwNdJZ.js} +1 -1
  52. package/assets/{circle-check-CQPt1U9q.js → circle-check-i3jeyeTf.js} +1 -1
  53. package/assets/{circle-help-BtMu5xYr.js → circle-help-CVWHf1ow.js} +1 -1
  54. package/assets/{clock-B-eYdLBT.js → clock-NnulNCOv.js} +1 -1
  55. package/assets/compose._-_outboxMessageId_-Be8c22eR.js +1 -0
  56. package/assets/compose._-_outboxMessageId_-BuomqJqQ.js +1 -0
  57. package/assets/compose._-_outboxMessageId_-Bv9hyiuT.js +1 -0
  58. package/assets/compose._-_outboxMessageId_-CvUr9awX.js +1 -0
  59. package/assets/{config-import-DhLbROIb.js → config-import-DmOMXQ5W.js} +1 -1
  60. package/assets/{confirm-dialog-AppxcVfC.js → confirm-dialog-q8tbS_22.js} +1 -1
  61. package/assets/{copy-BCzZpML3.js → copy-LUCWJAE6.js} +1 -1
  62. package/assets/{credential-steps-DCjuFFo-.js → credential-steps-DVglyUgf.js} +1 -1
  63. package/assets/{download-C6M2pRs1.js → download-SQdHw0Vd.js} +1 -1
  64. package/assets/draft-Y5XWTm_J.js +1 -0
  65. package/assets/edit-DMorYaTV.js +1 -0
  66. package/assets/edit-Dr5FEVcd.js +1 -0
  67. package/assets/{external-link-tmwz3hf0.js → external-link-BDqA_mVy.js} +1 -1
  68. package/assets/{file-json-BgVPDajK.js → file-json-DQGozYSr.js} +1 -1
  69. package/assets/filters-DFLdTFEB.js +1 -0
  70. package/assets/flagged-CCXBAY09.js +1 -0
  71. package/assets/{flagged-IHM3vv4x.js → flagged-CyMautVT.js} +1 -1
  72. package/assets/folders-DtchKvEA.js +1 -0
  73. package/assets/{help-copy-BN4-5aIP.js → help-copy-B2iT8EG_.js} +1 -1
  74. package/assets/{import-BT72aUBc.js → import-DqNA5XIM.js} +1 -1
  75. package/assets/index-BaEsIFAV.js +1 -0
  76. package/assets/index-Biz6TlId.js +1 -0
  77. package/assets/index-BkMAx0hv.js +1 -0
  78. package/assets/index-CL_fwLHN.js +349 -0
  79. package/assets/index-CZYy2P_j.js +1 -0
  80. package/assets/index-CqsCZrgd.js +1 -0
  81. package/assets/{index-C2Hz4y-Q.css → index-Cr6oUxXl.css} +1 -1
  82. package/assets/index-CvDZvwnj.js +1 -0
  83. package/assets/index-D2Qjacn6.js +1 -0
  84. package/assets/{index-Cb2UJhnj.js → index-DZb7rV9A.js} +7 -7
  85. package/assets/index-DoTwMLuw.js +1 -0
  86. package/assets/index-DrtbTKeC.js +1 -0
  87. package/assets/index-DtqBFgK5.js +1 -0
  88. package/assets/index-wVOTkeaF.js +1 -0
  89. package/assets/{kbd-DxdiA2Fl.js → kbd-CDJCJUnp.js} +1 -1
  90. package/assets/labels-rv-5Xb0f.js +1 -0
  91. package/assets/mail-SW3rbFnq.js +1 -0
  92. package/assets/{menu-ouYQ8aI9.js → menu-CcLh9Whg.js} +1 -1
  93. package/assets/new-Zmtsd7wU.js +1 -0
  94. package/assets/onboarding-BbZUe6dp.js +1 -0
  95. package/assets/{onboarding-completion-h9meGJrm.js → onboarding-completion-DoF3_MyG.js} +1 -1
  96. package/assets/outbox-ZJk7VidB.js +1 -0
  97. package/assets/{pencil-D0Kwpd2W.js → pencil-LSmMSKiW.js} +1 -1
  98. package/assets/{popover-menu-CTiORP1p.js → popover-menu-fjlAfNO1.js} +1 -1
  99. package/assets/{refresh-cw-aweb7slK.js → refresh-cw-5OKnYRBy.js} +1 -1
  100. package/assets/reply-DvdgFS16.js +1 -0
  101. package/assets/{rich-text-BlpPNJ69.js → rich-text-BBwYPM6F.js} +14 -14
  102. package/assets/{rich-text-spellcheck-worker-provider-BVC2WqOs.js → rich-text-spellcheck-worker-provider-Bk8cqxyg.js} +1 -1
  103. package/assets/{rotate-ccw-cFCdZR4R.js → rotate-ccw-CENCKp2Z.js} +1 -1
  104. package/assets/{roving-focus-iNw1K_A-.js → roving-focus-FWOr5tBU.js} +1 -1
  105. package/assets/{row-actions-CsY_49bo.js → row-actions-DA6zLLAB.js} +1 -1
  106. package/assets/search-mirror-Dri4pWEq.js +1 -0
  107. package/assets/search-token-index-B1HU1d2-.js +1 -0
  108. package/assets/{sections-By63r1y_.js → sections-Rf3k05-_.js} +1 -1
  109. package/assets/senders-ikMjTlbx.js +1 -0
  110. package/assets/settings-Bk7jziSO.js +1 -0
  111. package/assets/settings-screen-DBP3ABLE.js +1 -0
  112. package/assets/{shield-check-C6K5BNfE.js → shield-check-CdR23I2B.js} +1 -1
  113. package/assets/sparkles-Bcn4ZRhZ.js +1 -0
  114. package/assets/{suggested-vips-DnRYIdD0.js → suggested-vips-D-8cU8GT.js} +1 -1
  115. package/assets/suggestion._suggestionId-D6z0CuYD.js +1 -0
  116. package/assets/task._calendarTaskId-BYRN0yW3.js +1 -0
  117. package/assets/{undo-2-BV0sKXdu.js → undo-2-Bdx8L5xj.js} +1 -1
  118. package/assets/useCalendarData-DXhaM_NM.js +2 -0
  119. package/assets/useCalendarScheduling-BpjmrzdY.js +1 -0
  120. package/assets/useCalendarSuggestions-D3Jza1d7.js +1 -0
  121. package/assets/useCalendarTasks-D_NZ0GM6.js +1 -0
  122. package/assets/{useDebouncedValue--u19KX6h.js → useDebouncedValue-BTZsNKEh.js} +1 -1
  123. package/assets/{useFilters-Cmf0Cndn.js → useFilters-CIuC8WLg.js} +1 -1
  124. package/assets/{useLabels-CN56tbCw.js → useLabels-BZFMPVjT.js} +1 -1
  125. package/assets/useLayoutTier-DrLg7_rq.js +1 -0
  126. package/assets/{useMediaQuery-DB2OdJvp.js → useMediaQuery-DiQ0fGER.js} +1 -1
  127. package/assets/useMessageBodyContent-D-LJBFh4.js +1 -0
  128. package/assets/useQueries-hChzM5ru.js +1 -0
  129. package/assets/useRefreshControl-B6YIG0w2.js +1 -0
  130. package/assets/useResultFolderIndex-6TeGdWgp.js +1 -0
  131. package/assets/{useSignature-37xUEwqG.js → useSignature-BkzkUbjz.js} +1 -1
  132. package/assets/warnings-BdQvV6Kc.js +5 -0
  133. package/index.html +2 -2
  134. package/package.json +1 -1
  135. package/assets/BriefPane-zWXuK_Pj.js +0 -1
  136. package/assets/CalendarComposePane-Bz_-lcWc.js +0 -1
  137. package/assets/CalendarComposeSeed-DrUkfGTc.js +0 -1
  138. package/assets/CalendarShell-BATnya1t.js +0 -1
  139. package/assets/EmptyState-DjcO1Fvj.js +0 -1
  140. package/assets/FlaggedPane-Doc9iLZn.js +0 -1
  141. package/assets/MailNav-C8EZGG4u.js +0 -1
  142. package/assets/MailShell-Dc5V-rLi.js +0 -1
  143. package/assets/MailViewChrome-CJkUbWPO.js +0 -1
  144. package/assets/MailboxPane-Bzn-4kym.js +0 -1
  145. package/assets/MessageToolbar-CvC2dLSg.js +0 -1
  146. package/assets/NavMenuButton-DSpTQKmQ.js +0 -1
  147. package/assets/OnboardingWizard-DzR2uArY.js +0 -1
  148. package/assets/OpenCalendarEvent-DuKGo-jF.js +0 -2
  149. package/assets/OutboxPane-Bf8T7dxW.js +0 -1
  150. package/assets/SignInAgain-CCZnH9Mt.js +0 -1
  151. package/assets/_calendarObjectId-BGZWGcp9.js +0 -1
  152. package/assets/_mailboxId-GGJA-jVS.js +0 -1
  153. package/assets/_messageId-C5LRx072.js +0 -1
  154. package/assets/_messageId-CCba-TdT.js +0 -1
  155. package/assets/_messageId-TW2iI02X.js +0 -1
  156. package/assets/_outboxMessageId-BwVgR2h4.js +0 -1
  157. package/assets/_recurrenceId-pJxBSSXe.js +0 -1
  158. package/assets/_threadId-B_SsLFXa.js +0 -1
  159. package/assets/_threadId-CL2HHRtw.js +0 -1
  160. package/assets/_threadId-DLvgcvlr.js +0 -1
  161. package/assets/_view._date-wBuxk5kG.js +0 -1
  162. package/assets/accounts-Dc5147aO.js +0 -1
  163. package/assets/advanced-C3zdMHK5.js +0 -1
  164. package/assets/appearance-Df1fh0eu.js +0 -1
  165. package/assets/attendee-row-r-oUgLyi.js +0 -1
  166. package/assets/bell-off-DNCJLc9z.js +0 -1
  167. package/assets/brief-ClYJePmh.js +0 -1
  168. package/assets/bug-D6xXLRSh.js +0 -1
  169. package/assets/calendar-Dg7vWWgr.js +0 -1
  170. package/assets/calendar-clash-strip-C9X1djbQ.js +0 -1
  171. package/assets/calendar-report-BRGottVJ.js +0 -1
  172. package/assets/calendar-subscription-B-aAc2Gy.js +0 -1
  173. package/assets/calendar-suggestion-qEC_UasM.js +0 -1
  174. package/assets/calendars-DBDN0ptk.js +0 -1
  175. package/assets/checkbox-CiQllE1Y.js +0 -1
  176. package/assets/chevron-left-Bt4eJ35K.js +0 -1
  177. package/assets/compose._-_outboxMessageId_-BMq7tjfo.js +0 -1
  178. package/assets/compose._-_outboxMessageId_-CbnOP01x.js +0 -1
  179. package/assets/compose._-_outboxMessageId_-CoBJDS24.js +0 -1
  180. package/assets/compose._-_outboxMessageId_-Cr5hBZLH.js +0 -1
  181. package/assets/filters-CwblOGNb.js +0 -1
  182. package/assets/flagged-DvOlELtX.js +0 -1
  183. package/assets/folders-lF0pnG5O.js +0 -1
  184. package/assets/index-BDcVKyir.js +0 -1
  185. package/assets/index-C5LRx072.js +0 -1
  186. package/assets/index-CCba-TdT.js +0 -1
  187. package/assets/index-CVKDJurZ.js +0 -1
  188. package/assets/index-CXrVnh7V.js +0 -1
  189. package/assets/index-CXzCthHG.js +0 -349
  190. package/assets/index-DRT_I4p4.js +0 -1
  191. package/assets/index-DSNc3rHB.js +0 -1
  192. package/assets/index-T04Kj7bC.js +0 -1
  193. package/assets/index-TW2iI02X.js +0 -1
  194. package/assets/index-u72ANhps.js +0 -1
  195. package/assets/labels-CTSVGM1M.js +0 -1
  196. package/assets/mail-BLRLmM-I.js +0 -1
  197. package/assets/mail-CHopLOA-.js +0 -1
  198. package/assets/map-pin-DbNUeHlR.js +0 -1
  199. package/assets/minus-COyPQ5q9.js +0 -1
  200. package/assets/new-DRfIDZVL.js +0 -1
  201. package/assets/onboarding-U6yiJPWH.js +0 -1
  202. package/assets/outbox-DFxDZsE8.js +0 -1
  203. package/assets/reply-B9-kr45N.js +0 -1
  204. package/assets/search-mirror-Bg0i4bJE.js +0 -1
  205. package/assets/search-query-Dq2--dgF.js +0 -1
  206. package/assets/search-token-index-JnwciDu0.js +0 -1
  207. package/assets/senders-BollE7le.js +0 -1
  208. package/assets/settings-aPDqsj-M.js +0 -1
  209. package/assets/settings-screen-DxN6mICP.js +0 -1
  210. package/assets/suggestion._suggestionId-m9OzQCaR.js +0 -1
  211. package/assets/useCalendarData-BQ_jLMR7.js +0 -1
  212. package/assets/useCalendarEvents-lDPF_B6_.js +0 -1
  213. package/assets/useCalendarFreeBusy-BFq23gzr.js +0 -1
  214. package/assets/useCalendarWrites-CIJUCBzo.js +0 -1
  215. package/assets/useCalendars-BgSJfw8G.js +0 -1
  216. package/assets/useLayoutTier-CUyuK30O.js +0 -1
  217. package/assets/useMessageBodyContent-Gq_pdN4f.js +0 -1
  218. package/assets/useQueries-gpmd3w5y.js +0 -1
  219. package/assets/useRefreshControl-DdZILsE1.js +0 -1
  220. package/assets/useResultFolderIndex-EOtkNq1e.js +0 -1
  221. package/assets/warnings-BYDfjgnx.js +0 -5
@@ -0,0 +1 @@
1
+ import{j as t,ad as o}from"./index-CL_fwLHN.js";const n=()=>t.jsx(o,{to:"/settings/accounts"});export{n as component};
@@ -0,0 +1 @@
1
+ import{j as o}from"./index-CL_fwLHN.js";import{F as r}from"./FlaggedPane-Dw-wR4tp.js";import"./MessageBody-C89PSL_p.js";import"./kbd-CDJCJUnp.js";import"./search-scope-UI1H6AzA.js";import"./reply-DvdgFS16.js";import"./useMediaQuery-DiQ0fGER.js";import"./useMessageBodyContent-D-LJBFh4.js";import"./MessageToolbar-UJadqHyA.js";import"./roving-focus-FWOr5tBU.js";import"./search-token-index-B1HU1d2-.js";import"./useQueries-hChzM5ru.js";import"./EmptyState-BUOSmldo.js";import"./ErrorState-KjDYblD5.js";import"./popover-menu-fjlAfNO1.js";import"./avatar-uWJajuSb.js";import"./index-DZb7rV9A.js";import"./useSignature-BkzkUbjz.js";import"./account-form-helpers-DhckT_PN.js";import"./useDebouncedValue-BTZsNKEh.js";import"./sections-Rf3k05-_.js";import"./undo-2-Bdx8L5xj.js";import"./download-SQdHw0Vd.js";import"./calendar-suggestion-8jcpefeR.js";import"./sparkles-Bcn4ZRhZ.js";import"./useCalendarSuggestions-D3Jza1d7.js";import"./calendar-format-BwCpz-JZ.js";import"./calendar-failure-note-BtZLcaiZ.js";import"./checkbox-CGG1nAhQ.js";import"./clock-NnulNCOv.js";import"./shield-check-CdR23I2B.js";import"./calendar-tMekVEGW.js";import"./useLayoutTier-DrLg7_rq.js";import"./menu-CcLh9Whg.js";import"./useFilters-CIuC8WLg.js";import"./confirm-dialog-q8tbS_22.js";import"./MailViewChrome-yffBJjbO.js";import"./refresh-cw-5OKnYRBy.js";import"./wizard-selection-zWa1qc6-.js";function N(){return o.jsx(r.Reading,{})}export{N as component};
@@ -0,0 +1 @@
1
+ const n=()=>null;export{n as component};
@@ -0,0 +1 @@
1
+ import{fP as o,j as r}from"./index-CL_fwLHN.js";import{C as m}from"./CalendarEventPopup-CqHE2vrc.js";import"./confirm-dialog-q8tbS_22.js";import"./calendar-event-popup-DsPmxVye.js";import"./pencil-LSmMSKiW.js";import"./useCalendarSuggestions-D3Jza1d7.js";import"./ErrorState-KjDYblD5.js";import"./useQueries-hChzM5ru.js";import"./calendar-guests-BR4hC59z.js";import"./circle-help-CVWHf1ow.js";import"./useCalendarTasks-D_NZ0GM6.js";import"./useCalendarData-DXhaM_NM.js";import"./calendar-format-BwCpz-JZ.js";import"./reply-DvdgFS16.js";import"./useMediaQuery-DiQ0fGER.js";import"./calendar-tMekVEGW.js";import"./CalendarSession-BKwK9s2o.js";function v(){const{calendarObjectId:t}=o.useParams();return r.jsx(m,{calendarObjectId:t})}export{v as component};
@@ -1 +1 @@
1
- import{j as s,o as t}from"./index-CXzCthHG.js";function o({className:e,...n}){return s.jsx("kbd",{className:t("inline-flex h-4 min-w-4 items-center justify-center rounded-xs border border-line bg-surface-sunken px-1 font-sans text-2xs text-fg-muted",e),...n})}export{o as K};
1
+ import{j as s,o as t}from"./index-CL_fwLHN.js";function o({className:e,...n}){return s.jsx("kbd",{className:t("inline-flex h-4 min-w-4 items-center justify-center rounded-xs border border-line bg-surface-sunken px-1 font-sans text-2xs text-fg-muted",e),...n})}export{o as K};
@@ -0,0 +1 @@
1
+ import{r as f,j as e,au as h,bf as y,at as b,bG as g,d as v,T as N,u as C,a as L,c as I,aK as D,aM as S,B as w}from"./index-CL_fwLHN.js";import{C as E}from"./confirm-dialog-q8tbS_22.js";import{E as j}from"./ErrorState-KjDYblD5.js";import{S as $}from"./settings-screen-DBP3ABLE.js";import{a as T,b as k,c as R,u as O}from"./useLabels-BZFMPVjT.js";import"./avatar-uWJajuSb.js";import"./menu-CcLh9Whg.js";import"./circle-help-CVWHf1ow.js";function B({labels:l,onRename:i,onRecolor:n,onDelete:m,deletingLabelId:c}){const[u,r]=f.useState(),[o,d]=f.useState("");if(l.length===0)return e.jsx("p",{className:"py-6 text-sm text-fg-muted",children:"No labels yet. Create one below, then use it in a filter or apply it to mail directly."});const t=a=>{const s=o.trim();s!==""&&i(a,s),r(void 0)};return e.jsx("ul",{className:"divide-y divide-line rounded-md border border-line",children:l.map(a=>e.jsxs("li",{className:"flex items-center gap-3 px-3 py-2.5",children:[e.jsxs("div",{className:"min-w-0 flex-1",children:[u===a.labelId?e.jsx(h,{autoFocus:!0,value:o,onChange:s=>d(s.target.value),onBlur:()=>t(a.labelId),onKeyDown:s=>{s.key==="Enter"&&(s.preventDefault(),t(a.labelId)),s.key==="Escape"&&(s.preventDefault(),r(void 0))},"aria-label":`Rename label ${a.name}`}):e.jsx("button",{type:"button",onClick:()=>{r(a.labelId),d(a.name)},"aria-label":`Rename label ${a.name}`,className:"flex items-center gap-2 rounded-sm text-left hover:opacity-80",children:e.jsx(y,{label:a})}),e.jsx("p",{className:"mt-0.5 text-xs text-fg-subtle",children:a.filterCount===0?"Not used in any filter":`Used in ${a.filterCount} ${a.filterCount===1?"filter":"filters"}`})]}),e.jsx(b,{"aria-label":`Color for ${a.name}`,value:a.color,onChange:s=>n(a.labelId,s.target.value),className:"w-28 shrink-0",children:g.map(s=>e.jsx("option",{value:s,children:s},s))}),e.jsx(v,{variant:"ghost",size:"sm",icon:e.jsx(N,{className:"size-4 text-danger"}),onClick:()=>m(a),disabled:c===a.labelId,"aria-label":`Delete label ${a.name}`})]},a.labelId))})}const P=(l,i)=>{if(i===0)return{title:`Delete the "${l}" label?`};const n=i===1?"filter":"filters";return{title:`Delete the "${l}" label?`,description:`This also deletes ${i} ${n} that ${i===1?"applies":"apply"} it — they can't be recovered.`}},_=e.jsxs("div",{className:"space-y-3",children:[e.jsx("p",{children:"Labels mark mail without moving it — a message can carry any number of them alongside whichever folder it lives in."}),e.jsx("p",{children:"Use a label in a filter's action to have new (and existing) mail label itself automatically, or apply one to a selection directly from the mailbox."}),e.jsx("p",{children:"Deleting a label removes it from every message, and deletes every filter that applies it — the confirmation names how many."})]});function G({accountId:l}){const{createLabel:i,isPending:n,isError:m}=O(l),[c,u]=f.useState(""),[r,o]=f.useState("Default"),d=()=>{const t=c.trim();t!==""&&i(t,r).then(()=>{u(""),o("Default")})};return e.jsxs("div",{className:"space-y-2 rounded-sm border border-line bg-surface p-3",children:[e.jsx("p",{className:"text-sm font-medium text-fg",children:"New label"}),e.jsxs("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-end",children:[e.jsxs("div",{className:"flex-1 space-y-1",children:[e.jsx("span",{className:"text-xs text-fg-muted",children:"Name"}),e.jsx(h,{value:c,onChange:t=>u(t.target.value),placeholder:"e.g. Receipts","aria-label":"Label name",onKeyDown:t=>{t.key==="Enter"&&(t.preventDefault(),d())}})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("span",{className:"text-xs text-fg-muted",children:"Color"}),e.jsx(b,{value:r,onChange:t=>o(t.target.value),"aria-label":"Label color",className:"w-28",children:g.map(t=>e.jsx("option",{value:t,children:t},t))})]}),e.jsx(v,{variant:"primary",onClick:d,disabled:n||c.trim()==="",children:n?"Creating…":"Create label"})]}),m&&e.jsx(w,{tone:"danger",variant:"soft",children:"Couldn't create that label. Please try again."})]})}function H({account:l}){const i=l.accountId,{labels:n,isPending:m,isError:c,error:u,refetch:r}=T(i),{updateLabel:o}=k(i),{deleteLabel:d,deletingLabelId:t}=R(i),[a,s]=f.useState();return e.jsxs("section",{className:"space-y-2",children:[e.jsx("h2",{className:"text-sm font-semibold text-fg",children:l.email}),m?e.jsx("div",{className:"h-16 animate-pulse rounded-md border border-line bg-surface","aria-busy":"true","aria-label":`Loading labels for ${l.email}`}):c?e.jsx(j,{variant:"inline",title:`Couldn't load labels for ${l.email}`,error:u,onRetry:()=>{r()}}):e.jsx(B,{labels:n,onRename:(p,x)=>o(p,{name:x}),onRecolor:(p,x)=>o(p,{color:x}),onDelete:s,deletingLabelId:t}),e.jsx(G,{accountId:i}),a&&(()=>{const p=P(a.name,a.filterCount);return e.jsx(E,{isOpen:!0,title:p.title,description:p.description,confirmLabel:"Delete label",destructive:!0,isBusy:t===a.labelId,onConfirm:()=>{d(a.labelId),s(void 0)},onCancel:()=>s(void 0)})})()]})}function q(){const l=C(),[i,n]=f.useState(!0),{data:m,isPending:c,isError:u,error:r,refetch:o}=L(I()),d=t=>{const a=S[t];a&&l({to:a})};return e.jsx($,{items:D,activeId:"labels",title:"Labels",description:"Mark mail without moving it, per account.",help:_,helpOpen:i,onToggleHelp:()=>n(t=>!t),onSelect:d,onBackToMail:()=>{l({to:"/mail"})},children:c?e.jsx("div",{className:"h-24 animate-pulse rounded-sm border border-line bg-surface","aria-busy":"true","aria-label":"Loading accounts"}):u?e.jsx(j,{title:"Couldn't load accounts",error:r,onRetry:()=>{o()}}):m.accounts.length===0?e.jsx("p",{className:"py-12 text-sm text-fg-muted",children:"No accounts configured."}):e.jsx("div",{className:"space-y-8",children:m.accounts.map(t=>e.jsx(H,{account:t},t.accountId))})})}export{q as component};
@@ -0,0 +1 @@
1
+ import{b as B,r as f,j as e,o as C,p as Ee,q as Le,D as Ae,X as Fe,C as Te,S as oe,t as q,v as H,w as re,x as ie,F as ze,T as De,y as _e,M as Be,z as Ke,E as Qe,I as qe,G as le,d as P,H as ce,J as He,K as Ve,N as $e,P as ue,f as K,Q as de,R as me,U as Ue,V as We,W as Ge,Y as xe,a as fe,Z as Ye,_ as Je,$ as z,a0 as Xe,a1 as Ze,a2 as es,a3 as ss,a4 as ts,a5 as as,a6 as ns,a7 as os,a8 as rs,u as is,c as ls,a9 as cs,O as us}from"./index-CL_fwLHN.js";import{E as ds}from"./ErrorState-KjDYblD5.js";import{K as ms,B as xs,S as fs,u as ps,s as hs,b as gs,a as bs,c as vs,d as ys}from"./search-token-index-B1HU1d2-.js";import{K as V}from"./kbd-CDJCJUnp.js";import{u as js,l as O,a as D,m as $,b as Ns,c as Ss,N as w,d as Cs,e as ws,i as Is,f as Os}from"./reply-DvdgFS16.js";import{A as ks}from"./AppFrame-DSPG81Mk.js";import{P as Ms}from"./pencil-LSmMSKiW.js";import{u as Q,a as Rs}from"./useMessageBodyContent-D-LJBFh4.js";import{c as Ps,s as Es,M as Ls}from"./MailShell-LIuV2C3h.js";import{u as As,a as Fs,R as Ts,s as zs,i as Ds,H as _s,M as Bs}from"./useRefreshControl-B6YIG0w2.js";import{M as Ks}from"./menu-CcLh9Whg.js";import{B as pe,u as Qs}from"./useResultFolderIndex-6TeGdWgp.js";import{A as qs}from"./avatar-uWJajuSb.js";import{u as Hs,P as Vs,a as $s,b as Us}from"./popover-menu-fjlAfNO1.js";import{u as Ws}from"./sections-Rf3k05-_.js";import{u as Gs}from"./roving-focus-FWOr5tBU.js";import{C as Ys,A as Js}from"./account-service-status-oYDwuPLn.js";import{S as Xs}from"./sparkles-Bcn4ZRhZ.js";import{u as he}from"./useQueries-hChzM5ru.js";import{f as Zs}from"./folder-failure-CqkVSsrb.js";import{i as et}from"./outbox-status-BlKn6P0x.js";import{u as st}from"./index-DZb7rV9A.js";import{u as ge,i as tt}from"./useLayoutTier-DrLg7_rq.js";import{u as at}from"./useDebouncedValue-BTZsNKEh.js";import"./search-scope-UI1H6AzA.js";import"./useMediaQuery-DiQ0fGER.js";import"./FullCompose-Djp_h4BT.js";import"./confirm-dialog-q8tbS_22.js";import"./circle-check-big-BsCwNdJZ.js";import"./refresh-cw-5OKnYRBy.js";import"./useSignature-BkzkUbjz.js";import"./account-form-helpers-DhckT_PN.js";const be=B("LogOut",[["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}],["polyline",{points:"16 17 21 12 16 7",key:"1gabdz"}],["line",{x1:"21",x2:"9",y1:"12",y2:"12",key:"1uyos4"}]]);const ve=B("Settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);const nt=B("SquarePen",[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z",key:"ohrbg2"}]]);function ot({email:s,onSignOut:t}){const a=f.useRef(null),{open:n,setOpen:o,containerRef:r,panelRef:i,getAnchor:u}=Hs("account-menu",()=>a.current?.focus());f.useEffect(()=>{if(!n)return;const d=requestAnimationFrame(()=>i.current?.querySelector('[role="menuitem"]')?.focus());return()=>cancelAnimationFrame(d)},[n,i]);const m=s??"Account";return e.jsxs("div",{ref:r,className:"relative",children:[e.jsx("button",{ref:a,type:"button","aria-label":"Account","aria-haspopup":"menu","aria-expanded":n,onClick:()=>o(d=>!d),className:"inline-flex min-h-11 min-w-11 items-center justify-center rounded-md p-1.5 text-fg-muted transition-colors hover:bg-surface-raised hover:text-fg",children:e.jsx(qs,{name:m,email:s??void 0,size:"sm"})}),e.jsx(Vs,{open:n,align:"end",panelRef:i,getAnchor:u,children:e.jsxs($s,{ref:i,label:m,children:[s&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"truncate px-4 py-2 text-xs text-fg-muted",title:s,"data-testid":"account-menu-email",children:s}),e.jsx("hr",{className:"my-1 h-px border-0 bg-line"})]}),e.jsx(Us,{label:"Sign out",icon:e.jsx(be,{className:"size-4"}),onSelect:()=>{o(!1),a.current?.focus(),t()}})]})})]})}function rt({leading:s,search:t,actions:a,className:n}){return e.jsxs("header",{className:C("flex min-h-pane-header w-full shrink-0 items-center gap-2 border-b border-line bg-canvas px-row-inset py-1",n),children:[s&&e.jsx("div",{className:"flex shrink-0 items-center gap-1",children:s}),e.jsx("div",{className:"flex min-w-0 flex-1 justify-start",children:e.jsx("div",{className:"w-full max-w-xs transition-[max-width] duration-150 ease-out focus-within:max-w-lg",children:t})}),a&&e.jsx("div",{className:"flex shrink-0 items-center gap-1",children:a})]})}function it({onCompose:s}){return e.jsx("button",{type:"button",onClick:s,"aria-label":"Compose new message",className:"lg:hidden fixed right-4 z-30 h-14 w-14 rounded-full bg-accent text-accent-fg shadow-lg flex items-center justify-center hover:opacity-90 active:scale-95 transition-all",style:{bottom:"calc(var(--app-tab-bar, 0px) + env(safe-area-inset-bottom, 0px) + 1rem)"},children:e.jsx(Ms,{className:"size-6"})})}const lt=({isOpen:s,onClose:t})=>{const a=f.useRef(null);return Ee({id:"shortcuts",open:s,answers:{back:t}}),Le(a,s),s?e.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[e.jsx(Ae,{label:"Dismiss keyboard shortcuts",onDismiss:t,className:"backdrop-blur-sm"}),e.jsxs("div",{ref:a,role:"dialog","aria-modal":"true","aria-label":"Keyboard shortcuts",tabIndex:-1,className:C("relative z-10 max-h-[85vh] w-full max-w-2xl overflow-y-auto","rounded-lg border border-line bg-surface shadow-lg","p-6"),children:[e.jsxs("div",{className:"mb-6 flex items-center justify-between",children:[e.jsx("h2",{className:"text-lg font-semibold",children:"Keyboard shortcuts"}),e.jsx("button",{type:"button",onClick:t,className:"p-1 text-fg-muted transition-colors hover:text-fg","aria-label":"Close",children:e.jsx(Fe,{className:"size-5"})})]}),e.jsx("div",{className:"grid gap-x-8 gap-y-6 sm:grid-cols-2",children:ms.map(n=>e.jsxs("div",{children:[e.jsx("h3",{className:"mb-3 text-sm font-medium text-fg-muted",children:n.title}),e.jsx("div",{className:"space-y-2",children:n.hints.map(o=>e.jsxs("div",{className:"flex items-center justify-between gap-4",children:[e.jsx("span",{className:"text-sm",children:o.description}),e.jsx("span",{className:"flex shrink-0 items-center gap-1",children:o.keys.map((r,i)=>e.jsxs(f.Fragment,{children:[i>0&&o.keys[0]==="g"&&e.jsx("span",{className:"text-2xs text-fg-subtle",children:"then"}),e.jsx(V,{children:r})]},r))})]},`${o.action}-${o.keys.join("+")}`))})]},n.title))}),e.jsx("div",{className:"mt-6 border-t border-line pt-4",children:e.jsxs("p",{className:"text-center text-xs text-fg-muted",children:["Press ",e.jsx(V,{children:"Esc"})," to close"]})})]})]}):null},ct="button:not([disabled]), a[href]",E="outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-surface-sunken";function ut({active:s,dimmed:t,indent:a}){return C("flex w-full items-center gap-2 rounded-md px-2 py-1 text-left text-sm transition-colors",E,a&&"pl-7",s?"bg-accent-2-soft font-medium text-accent-2":"text-fg-muted hover:bg-surface hover:text-fg",t&&"opacity-55")}function dt({icon:s,label:t,count:a,active:n,failure:o}){return e.jsxs(e.Fragment,{children:[s&&e.jsx("span",{className:C("shrink-0",n?"text-accent-2":"text-fg-subtle"),children:s}),e.jsx("span",{className:"flex-1 truncate",children:t}),o&&e.jsx(re,{className:"size-3.5 shrink-0 text-danger","aria-hidden":"true"}),a!=null&&a>0&&e.jsx("span",{className:C("text-2xs tabular-nums",n?"text-accent-2":"text-fg-subtle"),children:a})]})}function I({icon:s,label:t,count:a,active:n,dimmed:o,indent:r,navId:i,linkComponent:u,ariaLabel:m,title:d,failure:h,onClick:y}){const g=ut({active:n,dimmed:o,indent:r}),c=e.jsx(dt,{icon:s,label:t,count:a,active:n,failure:h}),v=m??t,x=h?`${v} — ${h}`:v,p=h?`${d??t} — ${h}`:d;return i&&u?u({navId:i,className:g,ariaLabel:x,title:p,onClick:y,children:c}):e.jsx("button",{type:"button",onClick:y,className:g,"aria-label":h?x:m,title:p,children:c})}const U={inbox:0,flagged:1,drafts:2,sent:3,archive:4,all:5,junk:6,trash:7};function mt(s){switch(s){case"inbox":return e.jsx(qe,{className:"size-4"});case"flagged":return e.jsx(oe,{className:"size-4"});case"drafts":return e.jsx(Qe,{className:"size-4"});case"sent":return e.jsx(ie,{className:"size-4"});case"archive":return e.jsx(Ke,{className:"size-4"});case"all":return e.jsx(Be,{className:"size-4"});case"junk":return e.jsx(_e,{className:"size-4"});case"trash":return e.jsx(De,{className:"size-4"})}}const W=s=>s.role!=null,T=8,G="remit.nav.folders.open.",Y="remit.nav.account.open.";function J(s,t,a){if(typeof localStorage>"u")return a;const n=localStorage.getItem(s+t);return n===null?a:n!=="0"}function X(s,t,a){typeof localStorage>"u"||localStorage.setItem(s+t,a?"1":"0")}function xt({account:s,selectedNavId:t,onSelectNav:a,linkComponent:n}){const[o,r]=f.useState(()=>J(Y,s.id,!0)),[i,u]=f.useState(()=>J(G,s.id,!0)),[m,d]=f.useState(!1),h=()=>{r(l=>{const j=!l;return X(Y,s.id,j),j})},y=()=>{u(l=>{const j=!l;return X(G,s.id,j),j})},g=s.mailboxes.filter(W).sort((l,j)=>U[l.role]-U[j.role]),c=s.mailboxes.filter(l=>!W(l)),v=m||c.length<=T?c:c.slice(0,T),x=c.length-v.length,p=s.status??"ready",b=s.syncedServices!==void 0&&!s.syncedServices.includes("Mail"),N=p==="ready"&&g.length===0&&c.length===0;return e.jsxs("div",{className:"mt-3",children:[e.jsxs("button",{type:"button",onClick:h,"aria-expanded":o,className:C("flex w-full items-center gap-1.5 px-2 pb-1 text-left transition-colors hover:text-fg",E,s.muted&&"opacity-55"),children:[o?e.jsx(q,{className:"size-3 shrink-0 text-fg-subtle"}):e.jsx(H,{className:"size-3 shrink-0 text-fg-subtle"}),e.jsx("span",{className:"truncate text-2xs font-semibold uppercase tracking-wider text-fg-subtle",children:s.label}),s.muted&&e.jsxs(e.Fragment,{children:[e.jsx(xs,{className:"size-3 shrink-0 text-fg-subtle"}),e.jsx("span",{className:"text-2xs text-fg-subtle",children:"muted"})]}),b&&e.jsxs(e.Fragment,{children:[e.jsx(Ys,{className:"size-3 shrink-0 text-fg-subtle"}),e.jsx("span",{className:"text-2xs text-fg-subtle",children:Js.Mail})]})]}),o&&e.jsxs(e.Fragment,{children:[p==="loading"&&e.jsx("div",{className:"px-2 py-1 text-sm text-fg-muted",children:"Loading…"}),p==="error"&&e.jsxs("div",{role:"alert",className:"mx-2 my-1 flex items-start gap-2 rounded-md border border-danger/40 bg-danger-soft px-2 py-1.5 text-sm",children:[e.jsx(re,{className:"mt-0.5 size-4 shrink-0 text-danger","aria-hidden":"true"}),e.jsx("div",{className:"min-w-0 flex-1",children:e.jsx("p",{className:"font-medium text-danger",children:"Couldn't load mailboxes"})}),s.onRetry&&e.jsx("button",{type:"button",onClick:s.onRetry,className:"shrink-0 text-sm font-medium text-accent hover:underline",children:"Retry"})]}),N&&e.jsx("div",{className:"px-2 py-1 text-sm text-fg-muted",children:"No mailboxes"}),p==="ready"&&e.jsxs(e.Fragment,{children:[g.map(l=>e.jsx(I,{navId:l.id,linkComponent:n,icon:mt(l.role),label:l.name,ariaLabel:l.name,title:l.fullPath??l.name,failure:l.failure,count:l.unseen,active:t===l.id,dimmed:s.muted,onClick:()=>a?.(l.id)},l.id)),s.outboxPending!==void 0&&e.jsx(I,{navId:"outbox",linkComponent:n,icon:e.jsx(ie,{className:"size-4"}),label:"Outbox",ariaLabel:"Outbox",count:s.outboxPending>0?s.outboxPending:void 0,active:t==="outbox",dimmed:s.muted,onClick:()=>a?.("outbox")}),c.length>0&&e.jsxs(e.Fragment,{children:[e.jsxs("button",{type:"button",onClick:y,"aria-expanded":i,className:C("mt-1 flex w-full items-center gap-1 px-2 py-1 text-left text-2xs font-semibold uppercase tracking-wider text-fg-subtle transition-colors hover:text-fg",E),children:[i?e.jsx(q,{className:"size-3 shrink-0"}):e.jsx(H,{className:"size-3 shrink-0"}),e.jsx("span",{className:"flex-1",children:"Folders"}),e.jsx("span",{className:"tabular-nums opacity-70",children:c.length})]}),i&&e.jsxs(e.Fragment,{children:[v.map(l=>e.jsx(I,{navId:l.id,linkComponent:n,icon:e.jsx(ze,{className:"size-4"}),label:l.name,ariaLabel:l.name,title:l.fullPath??l.name,failure:l.failure,count:l.unseen,active:t===l.id,dimmed:s.muted,onClick:()=>a?.(l.id)},l.id)),(x>0||m)&&c.length>T&&e.jsx("button",{type:"button",onClick:()=>d(l=>!l),className:C("ml-7 flex items-center px-2 py-1 text-2xs font-medium text-accent transition-colors hover:underline",E),children:m?"Show less":`Show all (${c.length})`})]})]})]})]})]})}function ft({accounts:s,selectedNavId:t,briefUnseen:a,onSelectNav:n,variant:o="desktop",linkComponent:r,calendarNav:i="hidden"}){const u=f.useRef(null);Gs({containerRef:u,itemSelector:ct});const m=o==="drawer",d=e.jsxs("nav",{ref:m?u:void 0,className:m?"px-2 py-2":"flex-1 overflow-y-auto px-2 py-2","aria-label":"Mailboxes",children:[e.jsx(I,{navId:"brief",linkComponent:r,icon:e.jsx(Xs,{className:"size-4"}),label:"Daily brief",ariaLabel:"Daily brief",count:a,active:t==="brief",onClick:()=>n?.("brief")}),i==="shown"&&e.jsx(I,{navId:"calendar",linkComponent:r,icon:e.jsx(Te,{className:"size-4"}),label:"Calendar",ariaLabel:"Calendar",active:t==="calendar",onClick:()=>n?.("calendar")}),e.jsx(I,{navId:"flagged",linkComponent:r,icon:e.jsx(oe,{className:"size-4"}),label:"Starred",ariaLabel:"Starred",active:t==="flagged",onClick:()=>n?.("flagged")}),s.length===0?e.jsx("div",{className:"px-2 py-4 text-center text-sm text-fg-muted",children:"No accounts configured"}):s.map(h=>e.jsx(xt,{account:h,selectedNavId:t,onSelectNav:n,linkComponent:r},h.id))]});return m?d:e.jsx("aside",{ref:u,className:"flex h-full w-full flex-col bg-surface-sunken",children:d})}function pt(){const s=le();if(!s)return null;const t=s.showNavPane?!s.navCollapsed:!1;return e.jsx(P,{variant:"ghost",size:"sm",icon:e.jsx(Ks,{className:"size-4"}),onClick:s.toggleNav,"aria-label":t?"Hide folders":"Show folders","aria-expanded":t,title:"Folders",className:"shrink-0"})}const ht={global:"Search all mail",pending:"Search mail",scoped:"Search this folder"};function gt({search:s,onCompose:t,onReportBug:a,onOpenSettings:n,settingsAttention:o,composeShortcut:r,refreshControl:i,account:u}){return e.jsx(rt,{leading:e.jsx(pt,{}),search:e.jsx(fs,{value:s.value,onChange:s.onChange,onClear:s.onClear,onClearQuery:s.onClearQuery,chips:s.chips,onRemoveChip:s.onRemoveChip,placeholder:ht[s.scope]}),actions:e.jsxs(e.Fragment,{children:[e.jsx(P,{variant:"ghost",size:"sm",icon:e.jsx(nt,{className:"size-4"}),title:r?`Compose (${r})`:"Compose","aria-label":"Compose",onClick:t}),e.jsx(P,{variant:"ghost",size:"sm",icon:e.jsx(pe,{className:"size-4"}),title:"Report a bug","aria-label":"Report a bug",onClick:a}),e.jsx(P,{variant:"ghost",size:"sm",icon:e.jsx(ce,{label:o,children:e.jsx(ve,{className:"size-4"})}),title:"Settings","aria-label":o?`Settings — ${o}`:"Settings",onClick:n}),i,u]})})}function bt(){const{pathname:s}=js(),t=He({from:"/mail/$mailboxId",shouldThrow:!1});return O(s,"/settings")?"settings":O(s,"/calendar")?"calendar":O(s,"/mail/outbox")?"outbox":O(s,"/mail/flagged")?"flagged":O(s,"/mail/brief")?"brief":t?.mailboxId??""}function vt(){const s=Ve(),t=D({select:d=>$(d.location.pathname)}),a=D({select:d=>Ns(d.location.search)}),[n,o]=f.useState(a),r=at(n,200),[i,u]=f.useState(t);if(i!==t){const d=Es(i,t,a);u(t),d!==void 0&&o(d)}const m=f.useCallback(d=>{u($(s.state.location.pathname)),o(d)},[s]);return{searchInput:n,committedQuery:Ps(n,r),viewKey:t,setSearchInput:m}}const yt=()=>{const s=Q();return Ss()?null:e.jsx(it,{onCompose:s})},ye=({children:s})=>{const{Account:t}=$e();return e.jsx(t,{children:s})},jt=()=>e.jsx(ye,{children:({email:s,signOut:t})=>e.jsx(ot,{email:s,onSignOut:t})});function Nt({accounts:s}){const{searchInput:t,onSearchChange:a,onSearchClear:n,onSearchClearQuery:o,resultFolderIndex:r}=ue(),i=K(),u=Ws(),m=Q(),{scope:d,clearScope:h}=ps(s),y=de(),g=d.kind==="scoped"?[{id:d.chip.id,label:d.chip.label,tone:"scope"}]:void 0,c=f.useMemo(()=>s.map(N=>N.accountId),[s]),{hasNewMail:v}=As(),{state:x,errorMessage:p,refresh:b}=Fs(c,{onSettled:()=>Ue(i,We(r.keys()))});return e.jsx(gt,{search:{value:t,scope:d.kind,chips:g,onChange:a,onClear:n,onClearQuery:o,onRemoveChip:h},onCompose:m,onReportBug:me,onOpenSettings:()=>u("accounts"),settingsAttention:y,composeShortcut:hs("compose"),refreshControl:e.jsx(Ts,{state:x,onRefresh:b,label:"Refresh all accounts",errorMessage:p,hasUpdate:v(c)}),account:e.jsx(jt,{})})}function St(){return e.jsxs("button",{type:"button",onClick:me,className:"flex w-full items-center gap-2 rounded-md px-2 py-1 text-sm text-fg-muted transition-colors hover:bg-surface hover:text-fg",children:[e.jsx(pe,{className:"size-4 shrink-0"}),e.jsx("span",{className:"flex-1 truncate text-left",children:"Report a bug"})]})}const Z=s=>/^\d/.test(s),Ct=(s,t)=>{const a=Z(s),n=Z(t);return a&&!n?-1:!a&&n?1:s.localeCompare(t,void 0,{sensitivity:"base",numeric:!0})};function wt(s,t,a){const n=[],o=[];for(const r of s)t.has(r.mailboxId)?n.push(r):o.push(r);return o.sort((r,i)=>Ct(z(r,void 0,a),z(i,void 0,a))),{system:n,labels:o}}function It(s,t,a){const n=Xe(t)&&s.unseenCount>0;return{id:s.mailboxId,name:z(s,t,a),unseen:n?s.unseenCount:void 0,role:t,fullPath:s.fullPath,failure:Zs(s)}}function ee({accounts:s,onMailboxSelect:t,variant:a="desktop"}){const n=K(),o=bt(),{onSearchChange:r}=ue(),{t:i}=Ge("mail",{useSuspense:!1}),u=f.useCallback((x,p)=>i(x,{defaultValue:p}),[i]),m=he({queries:s.map(x=>({...xe({path:{accountId:x.accountId}}),staleTime:1/0}))}),{data:d}=fe(Ye()),h=f.useMemo(()=>(d?.items??[]).filter(x=>et(x.status)).length,[d?.items]),y=f.useMemo(()=>s.map((x,p)=>{const b=m[p],N=b?.data?.items??[],l=Je(x.folderAppointments),{system:j,labels:L}=wt(N,l,u),A=b?.isError?"error":b?.isLoading?"loading":"ready";return{id:x.accountId,label:x.email,email:x.email,muted:!!x.muted,outboxPending:h,status:A,onRetry:()=>b?.refetch(),mailboxes:[...j,...L].map(k=>It(k,l.get(k.mailboxId),u))}}),[s,m,h,u]),g=x=>{n.invalidateQueries({queryKey:Ze({path:{mailboxId:x},query:{order:"desc"}})})},c=({navId:x,className:p,ariaLabel:b,title:N,children:l,onClick:j})=>x==="brief"?e.jsx(w,{to:"/mail/brief",search:{q:void 0},activeOptions:{includeSearch:!1},onClick:()=>j?.(),className:p,"aria-label":b,title:N,children:l}):x==="calendar"?e.jsx(w,{to:"/calendar",onClick:()=>j?.(),className:p,"aria-label":b,title:N,children:l}):x==="outbox"?e.jsx(w,{to:"/mail/outbox",search:{q:void 0},onClick:()=>j?.(),className:p,"aria-label":b,title:N,children:l}):x==="flagged"?e.jsx(w,{to:"/mail/flagged",search:{q:void 0},onClick:()=>j?.(),className:p,"aria-label":b,title:N,children:l}):x==="settings"?e.jsx(w,{to:"/settings/accounts",onClick:()=>j?.(),className:p,"aria-label":b,title:N,children:l}):e.jsx(w,{to:"/mail/$mailboxId",params:{mailboxId:x},search:{q:void 0},onClick:()=>{g(x),j?.()},className:p,"aria-label":b,title:N,children:l}),v=()=>{r(""),t?.()};return e.jsx(ft,{accounts:y,selectedNavId:o,onSelectNav:v,linkComponent:c,variant:a})}function Ot({accounts:s,onMailboxSelect:t}){const n=le()?.showNavPane??!0,o=de();return n?e.jsx(ee,{accounts:s}):e.jsxs("div",{className:"flex h-full flex-col",children:[e.jsx("div",{className:"flex-1 overflow-y-auto",children:e.jsx(ee,{accounts:s,onMailboxSelect:t,variant:"drawer"})}),e.jsxs("div",{className:"border-t border-line px-2 py-2",children:[e.jsxs(w,{to:"/settings/accounts",onClick:t,children:[e.jsx(ce,{label:o,children:e.jsx(ve,{className:"size-4 shrink-0"})}),e.jsx("span",{className:"flex-1 truncate text-left",children:"Settings"})]}),e.jsx(St,{}),e.jsx(ye,{children:({signOut:r})=>e.jsxs("button",{type:"button",onClick:()=>{t?.(),r()},className:"flex min-h-11 w-full items-center gap-2 rounded-md px-2 py-1 text-sm text-fg-muted transition-colors hover:bg-surface hover:text-fg","data-testid":"sign-out-button",children:[e.jsx(be,{className:"size-4 shrink-0"}),e.jsx("span",{className:"flex-1 truncate text-left",children:"Sign out"})]})})]})]})}function kt(s){const t=he({queries:s.map(a=>({...xe({path:{accountId:a.accountId}}),staleTime:1/0}))});return f.useMemo(()=>gs(t.map(a=>a.data?.items??[])),[t])}const je="remit:intelligence-open";function Mt(){try{return localStorage.getItem(je)!=="closed"}catch{return!0}}function Rt(s){try{localStorage.setItem(je,s?"open":"closed")}catch{}}function se({panels:s,prefersOpen:t,isDesktop:a,hasThread:n,raisedFor:o,openMessage:r}){if(o!==null&&o===r)return!0;const i=s.filter(u=>u!=="sidebar");return i.length>0?i.includes("intelligence"):a&&n&&t}const Pt=()=>{const s=ge(),t=Cs(),a=ws(),n=t.find(Is),o=bs(),[r,i]=f.useState(Mt),u=o?`${o.threadId}/${o.messageId??""}`:null,[m,d]=f.useState(null),h={panels:t,prefersOpen:r,isDesktop:s==="desktop",hasThread:o!==void 0,openMessage:u},y=se({...h,raisedFor:m}),g=se({...h,raisedFor:null}),c=f.useCallback((b,N)=>{a([...b?["intelligence"]:[],...N?[N]:[]])},[a]),v=f.useCallback(b=>{c(g,b)},[g,c]),x=f.useCallback(()=>{if(y&&!g){d(null);return}const b=!y;Rt(b),i(b),d(null),c(b,n)},[g,y,n,c]),p=f.useCallback(()=>{d(u)},[u]);return{openOverlay:n,intelligenceOpen:y,showOverlay:v,toggleIntelligence:x,raiseIntelligence:p}};var M={exports:{}},te;function Et(){if(te)return M.exports;te=1;const s=(t,a,n)=>new Promise((o,r)=>{if(n=Object.assign({concurrency:1/0},n),typeof a!="function")throw new TypeError("Mapper function is required");const{concurrency:i}=n;if(!(typeof i=="number"&&i>=1))throw new TypeError(`Expected \`concurrency\` to be a number from 1 and up, got \`${i}\` (${typeof i})`);const u=[],m=t[Symbol.iterator]();let d=!1,h=!1,y=0,g=0;const c=()=>{if(d)return;const v=m.next(),x=g;if(g++,v.done){h=!0,y===0&&o(u);return}y++,Promise.resolve(v.value).then(p=>a(p,x)).then(p=>{u[x]=p,y--,c()},p=>{d=!0,r(p)})};for(let v=0;v<i&&(c(),!h);v++);});return M.exports=s,M.exports.default=s,M.exports}var Lt=Et();const At=es(Lt),Ft=900*1e3,Tt=30,zt=(s,t)=>{if(!s)return t;const a=Number.parseInt(s,10);return Number.isFinite(a)&&a>0?a:t},Dt=30*1e3,_t=s=>Math.max(zt(s,Tt)*1e3,Dt),Ne=_t(rs().mailboxPollIntervalSeconds),R=(s=Date.now(),t=Ne)=>Ds(s)?Math.min(_s,t):t,Bt=5,_=new Set,Kt=(s,t,a=Ft)=>s.filter(n=>{const o=n.lastSyncAt;return o==null?!0:t-o>a}).map(n=>n.accountId),Qt=(s,t,a=Ne)=>s-t>=a,qt=(s,t)=>s.filter(a=>!t.has(a)),ae=(s,t)=>{if(_.delete(s),as(t)||ns(t,{softError:!0})){os(t,{softError:!0});return}console.warn("[remit] background mailbox sync failed",{accountId:s,error:t})},ne=(s,t)=>ss({path:{accountId:s},throwOnError:!0}).then(()=>{t.invalidateQueries({queryKey:ts({path:{accountId:s}})})}),Ht=s=>{const t=K(),a=f.useRef(s);a.current=s;const n=s.map(o=>o.accountId).join(",");f.useEffect(()=>{const o=Date.now(),i=Kt(a.current,o).filter(u=>!_.has(u));if(i.length!==0)for(const u of i)_.add(u),ne(u,t).catch(m=>{ae(u,m)})},[n,t]),f.useEffect(()=>{let o=Date.now(),r;const i=new Set,u=()=>{o=Date.now();const g=qt(a.current.map(c=>c.accountId),i);for(const c of g)i.add(c);At(g,c=>ne(c,t).catch(v=>{ae(c,v)}).finally(()=>{i.delete(c)}),{concurrency:Bt})},m=()=>{if(document.visibilityState==="visible"){u(),r=setTimeout(m,R());return}},d=()=>{if(document.visibilityState!=="visible")return;r!==void 0&&clearTimeout(r);const g=Date.now(),c=R(g);if(Qt(g,o,c)){u(),r=setTimeout(m,c);return}r=setTimeout(m,o+c-g)},h=()=>{document.visibilityState==="visible"&&(r!==void 0&&clearTimeout(r),o=Date.now(),r=setTimeout(m,R()))};r=setTimeout(m,R()),document.addEventListener("visibilitychange",d);const y=zs(h);return()=>{r!==void 0&&clearTimeout(r),document.removeEventListener("visibilitychange",d),y()}},[n,t])};function Sa(){const s=is(),t=ge(),a=tt(t),{openOverlay:n,intelligenceOpen:o,showOverlay:r,toggleIntelligence:i,raiseIntelligence:u}=Pt(),m=n==="shortcuts",d=n==="nav",{searchInput:h,committedQuery:y,viewKey:g,setSearchInput:c}=vt(),{data:v,isLoading:x,isError:p,error:b,refetch:N}=fe({...ls(),staleTime:1/0}),l=!!(v&&(v.accounts?.length??0)===0);f.useEffect(()=>{l&&s({to:"/onboarding",replace:!0})},[l,s]),st({enabled:!m,bindings:[{key:"?",action:"help",handler:()=>r("shortcuts"),noModifiers:!1,preventDefault:!0}]});const j=Q(),L=Rs(),A=D({select:F=>Os(F.matches)?.list==="mailbox"}),k=f.useMemo(()=>({compose:j}),[j]);vs({enabled:!A&&!L,handlers:k});const Se=f.useCallback(()=>{c("")},[c]),Ce=f.useCallback(()=>{c("")},[c]),S=v?.accounts??[],we=f.useMemo(()=>S.map(F=>F.accountId),[S]),Ie=kt(S),Oe=Qs(S).index,ke=f.useMemo(()=>ys(S),[S]);Ht(S);const Me=f.useCallback(()=>{n==="nav"&&r(void 0)},[n,r]),Re={accounts:S,mailboxNameIndex:Ie,accountNameIndex:ke,resultFolderIndex:Oe,searchQuery:y,searchInput:h,searchViewKey:g,onSearchChange:c,onSearchClear:Se,onSearchClearQuery:Ce,intelligenceOpen:o,onToggleIntelligence:i,onRaiseIntelligence:u},Pe={isSinglePane:a,isLoading:x||l,intelligenceOpen:o,nav:e.jsx(Ot,{accounts:S,onMailboxSelect:Me}),topBar:a?void 0:e.jsx(Nt,{accounts:S}),overlay:a?e.jsx(yt,{}):void 0,navOpen:d,onOpenNav:()=>r("nav"),onCloseNav:()=>r(void 0)};return e.jsx(cs.Provider,{value:Re,children:e.jsxs(Bs,{accountIds:we,children:[e.jsx(ks,{children:p?e.jsx("div",{className:"flex h-full items-center justify-center bg-canvas p-4",children:e.jsx(ds,{title:"Couldn't load your account",error:b,onRetry:()=>{N()}})}):e.jsx(Ls,{chrome:Pe,children:e.jsx(us,{})})}),e.jsx(lt,{isOpen:m,onClose:()=>r(void 0)})]})})}export{Sa as component,ue as useMailContext};
@@ -1 +1 @@
1
- import{b as e}from"./index-CXzCthHG.js";const n=e("Menu",[["line",{x1:"4",x2:"20",y1:"12",y2:"12",key:"1e0a9i"}],["line",{x1:"4",x2:"20",y1:"6",y2:"6",key:"1owob3"}],["line",{x1:"4",x2:"20",y1:"18",y2:"18",key:"yk5zj1"}]]);export{n as M};
1
+ import{b as e}from"./index-CL_fwLHN.js";const n=e("Menu",[["line",{x1:"4",x2:"20",y1:"12",y2:"12",key:"1e0a9i"}],["line",{x1:"4",x2:"20",y1:"6",y2:"6",key:"1owob3"}],["line",{x1:"4",x2:"20",y1:"18",y2:"18",key:"yk5zj1"}]]);export{n as M};
@@ -0,0 +1 @@
1
+ import{C as o}from"./CalendarEventEditor-COnJXvRd.js";import"./index-CL_fwLHN.js";import"./confirm-dialog-q8tbS_22.js";import"./calendar-event-popup-DsPmxVye.js";import"./pencil-LSmMSKiW.js";import"./useCalendarSuggestions-D3Jza1d7.js";import"./ErrorState-KjDYblD5.js";import"./useQueries-hChzM5ru.js";import"./calendar-event-sidebar-soFGsDRR.js";import"./calendar-guests-BR4hC59z.js";import"./circle-help-CVWHf1ow.js";import"./useCalendarData-DXhaM_NM.js";import"./useCalendarTasks-D_NZ0GM6.js";import"./draft-Y5XWTm_J.js";import"./useCalendarScheduling-BpjmrzdY.js";import"./useDebouncedValue-BTZsNKEh.js";import"./calendar-format-BwCpz-JZ.js";import"./reply-DvdgFS16.js";import"./useMediaQuery-DiQ0fGER.js";import"./calendar-tMekVEGW.js";import"./CalendarQuickCreate-DxgU3bNP.js";import"./CalendarSession-BKwK9s2o.js";const h=o;export{h as component};
@@ -0,0 +1 @@
1
+ import{n,f as i,u as a,r as m,j as s}from"./index-CL_fwLHN.js";import{O as p}from"./OnboardingWizard-Cvqq2aP_.js";import{c}from"./onboarding-completion-DoF3_MyG.js";import"./checkbox-CGG1nAhQ.js";import"./kbd-CDJCJUnp.js";import"./credential-steps-DVglyUgf.js";import"./card-CPL-TrL1.js";import"./account-form-helpers-DhckT_PN.js";import"./file-json-DQGozYSr.js";function O(){const o=n(),e=i(),t=a(),r=m.useCallback(l=>{c({queryClient:e,recordCompleted:()=>o.recordEvent("onboarding.completed"),navigateToInbox:()=>{window.location.assign("/mail")}})},[o,e]);return s.jsx(p,{skipWelcome:!1,onComplete:r,onImportConfig:()=>{t({to:"/import"})}})}export{O as component};
@@ -1 +1 @@
1
- import{l as o}from"./index-CXzCthHG.js";async function n(e){e.recordCompleted(),await e.queryClient.refetchQueries({queryKey:o()}),e.navigateToInbox()}export{n as c};
1
+ import{l as o}from"./index-CL_fwLHN.js";async function n(e){e.recordCompleted(),await e.queryClient.refetchQueries({queryKey:o()}),e.navigateToInbox()}export{n as c};
@@ -0,0 +1 @@
1
+ import{j as o,O as i}from"./index-CL_fwLHN.js";import{a as m}from"./MailShell-LIuV2C3h.js";import{u as p,O as t}from"./OutboxPane-ce4uTAzW.js";import"./reply-DvdgFS16.js";import{u as s}from"./search-mirror-Dri4pWEq.js";import"./useMessageBodyContent-D-LJBFh4.js";import"./FullCompose-Djp_h4BT.js";import"./ErrorState-KjDYblD5.js";import"./index-DZb7rV9A.js";import"./useSignature-BkzkUbjz.js";import"./account-form-helpers-DhckT_PN.js";import"./useDebouncedValue-BTZsNKEh.js";import"./sections-Rf3k05-_.js";import"./useMediaQuery-DiQ0fGER.js";import"./confirm-dialog-q8tbS_22.js";import"./roving-focus-FWOr5tBU.js";import"./MessageBody-C89PSL_p.js";import"./kbd-CDJCJUnp.js";import"./search-scope-UI1H6AzA.js";import"./circle-check-big-BsCwNdJZ.js";import"./clock-NnulNCOv.js";import"./row-actions-DA6zLLAB.js";import"./rotate-ccw-CENCKp2Z.js";import"./NavMenuButton-B-goW-G5.js";import"./menu-CcLh9Whg.js";import"./outbox-status-BlKn6P0x.js";function w(){const r=p();return s({to:"/mail/outbox"}),o.jsx(t,{outboxMessageId:r,children:o.jsx(m,{phone:o.jsx(t.Phone,{}),list:o.jsx(t.List,{}),reading:o.jsx(i,{})})})}export{w as component};
@@ -1 +1 @@
1
- import{b as a}from"./index-CXzCthHG.js";const c=a("Pencil",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]);export{c as P};
1
+ import{b as a}from"./index-CL_fwLHN.js";const c=a("Pencil",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]);export{c as P};
@@ -1 +1 @@
1
- import{b as y,r as f,p as E,bS as P,j as a,o as b,d as R}from"./index-CXzCthHG.js";const j=y("EllipsisVertical",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"12",cy:"5",r:"1",key:"gxeob9"}],["circle",{cx:"12",cy:"19",r:"1",key:"lyex9k"}]]),g=4,v=8;function k(e,t,n){const o=Math.max(v,window.innerWidth-t.width-v),r=n==="end"?e.right-t.width:e.left,s=Math.min(Math.max(r,v),o),c=e.bottom+g,i=e.top-g-t.height,d=c+t.height<=window.innerHeight-v||i<v?c:i;return{left:s,top:d}}function L(e,t,n,o){const[r,s]=f.useState(null),c=f.useRef(o);return c.current=o,f.useLayoutEffect(()=>{if(!t){s(null);return}const i=()=>{const x=e.current,h=c.current();if(!x||!h)return;const p=x.getBoundingClientRect(),w={width:p.right-p.left,height:p.bottom-p.top},m=k(h,w,n);s(l=>l?.left===m.left&&l.top===m.top?l:{position:"fixed",left:m.left,top:m.top})};i(),window.addEventListener("resize",i),window.addEventListener("scroll",i,!0);const u=e.current;let d=null;return u&&typeof ResizeObserver<"u"&&(d=new ResizeObserver(i),d.observe(u)),()=>{d?.disconnect(),window.removeEventListener("resize",i),window.removeEventListener("scroll",i,!0)}},[t,n,e]),r}function z(e,t){const[n,o]=f.useState(!1),r=f.useRef(null),s=f.useRef(null);return E({id:e,open:n,answers:{back:()=>{o(!1),t?.()}}}),f.useEffect(()=>{if(!n)return;const c=i=>{const u=i.target;r.current?.contains(u)||s.current?.contains(u)||o(!1)};return document.addEventListener("mousedown",c),()=>document.removeEventListener("mousedown",c)},[n]),{open:n,setOpen:o,containerRef:r,panelRef:s,getAnchor:()=>r.current?.getBoundingClientRect()??null}}function M({open:e,align:t="start",getAnchor:n,panelRef:o,children:r}){const s=L(o,e,t,n);return e?P.createPortal(a.jsx("div",{className:"z-50",style:s??{position:"fixed",visibility:"hidden"},children:r}),document.body):null}function N({label:e,children:t,className:n,ref:o,onKeyDown:r,"data-testid":s}){return a.jsx("div",{ref:o,role:"menu","aria-label":e,tabIndex:-1,onKeyDown:r,"data-testid":s,className:b("z-50 flex max-h-[60dvh] min-w-44 flex-col overflow-y-auto overscroll-contain rounded-md border border-line bg-surface py-1 shadow-lg outline-none",n),children:t})}function S({label:e,icon:t,onSelect:n,className:o,lang:r,"data-testid":s}){return a.jsxs("button",{type:"button",role:"menuitem",lang:r,onClick:n,"data-testid":s,className:b("flex min-h-11 items-center gap-3 px-4 py-2.5 text-left text-sm text-fg transition-colors hover:bg-surface-sunken",o),children:[t&&a.jsx("span",{className:"shrink-0 text-fg-subtle",children:t}),e]})}function A({triggerLabel:e,triggerIcon:t,triggerText:n,items:o,align:r="end",touch:s=!0,className:c,triggerClassName:i,nested:u=!1,children:d}){const{open:x,setOpen:h,containerRef:p,panelRef:w,getAnchor:m}=z("popover-menu");return o.length===0&&!d?null:a.jsxs("div",{ref:p,className:b("relative",c),...u?{role:"none"}:{},children:[a.jsx(R,{variant:"ghost",size:"sm",icon:t??a.jsx(j,{className:"size-5"}),onClick:()=>h(l=>!l),"aria-label":e,"aria-haspopup":"menu","aria-expanded":x,...u?{role:"menuitem"}:{},className:b(s&&"min-h-11 min-w-11 px-0",i),children:n}),a.jsx(M,{open:x,align:r,panelRef:w,getAnchor:m,children:a.jsxs(N,{ref:w,children:[o.map(l=>a.jsx(S,{label:l.label,icon:l.icon,onSelect:()=>{h(!1),l.onSelect()}},l.key)),d]})})]})}export{j as E,M as P,N as a,S as b,A as c,z as u};
1
+ import{b as y,r as f,p as E,c6 as P,j as a,o as b,d as R}from"./index-CL_fwLHN.js";const j=y("EllipsisVertical",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"12",cy:"5",r:"1",key:"gxeob9"}],["circle",{cx:"12",cy:"19",r:"1",key:"lyex9k"}]]),g=4,v=8;function k(e,t,n){const o=Math.max(v,window.innerWidth-t.width-v),r=n==="end"?e.right-t.width:e.left,s=Math.min(Math.max(r,v),o),c=e.bottom+g,i=e.top-g-t.height,d=c+t.height<=window.innerHeight-v||i<v?c:i;return{left:s,top:d}}function L(e,t,n,o){const[r,s]=f.useState(null),c=f.useRef(o);return c.current=o,f.useLayoutEffect(()=>{if(!t){s(null);return}const i=()=>{const x=e.current,h=c.current();if(!x||!h)return;const p=x.getBoundingClientRect(),w={width:p.right-p.left,height:p.bottom-p.top},m=k(h,w,n);s(l=>l?.left===m.left&&l.top===m.top?l:{position:"fixed",left:m.left,top:m.top})};i(),window.addEventListener("resize",i),window.addEventListener("scroll",i,!0);const u=e.current;let d=null;return u&&typeof ResizeObserver<"u"&&(d=new ResizeObserver(i),d.observe(u)),()=>{d?.disconnect(),window.removeEventListener("resize",i),window.removeEventListener("scroll",i,!0)}},[t,n,e]),r}function z(e,t){const[n,o]=f.useState(!1),r=f.useRef(null),s=f.useRef(null);return E({id:e,open:n,answers:{back:()=>{o(!1),t?.()}}}),f.useEffect(()=>{if(!n)return;const c=i=>{const u=i.target;r.current?.contains(u)||s.current?.contains(u)||o(!1)};return document.addEventListener("mousedown",c),()=>document.removeEventListener("mousedown",c)},[n]),{open:n,setOpen:o,containerRef:r,panelRef:s,getAnchor:()=>r.current?.getBoundingClientRect()??null}}function M({open:e,align:t="start",getAnchor:n,panelRef:o,children:r}){const s=L(o,e,t,n);return e?P.createPortal(a.jsx("div",{className:"z-50",style:s??{position:"fixed",visibility:"hidden"},children:r}),document.body):null}function N({label:e,children:t,className:n,ref:o,onKeyDown:r,"data-testid":s}){return a.jsx("div",{ref:o,role:"menu","aria-label":e,tabIndex:-1,onKeyDown:r,"data-testid":s,className:b("z-50 flex max-h-[60dvh] min-w-44 flex-col overflow-y-auto overscroll-contain rounded-md border border-line bg-surface py-1 shadow-lg outline-none",n),children:t})}function O({label:e,icon:t,onSelect:n,className:o,lang:r,"data-testid":s}){return a.jsxs("button",{type:"button",role:"menuitem",lang:r,onClick:n,"data-testid":s,className:b("flex min-h-11 items-center gap-3 px-4 py-2.5 text-left text-sm text-fg transition-colors hover:bg-surface-sunken",o),children:[t&&a.jsx("span",{className:"shrink-0 text-fg-subtle",children:t}),e]})}function A({triggerLabel:e,triggerIcon:t,triggerText:n,items:o,align:r="end",touch:s=!0,className:c,triggerClassName:i,nested:u=!1,children:d}){const{open:x,setOpen:h,containerRef:p,panelRef:w,getAnchor:m}=z("popover-menu");return o.length===0&&!d?null:a.jsxs("div",{ref:p,className:b("relative",c),...u?{role:"none"}:{},children:[a.jsx(R,{variant:"ghost",size:"sm",icon:t??a.jsx(j,{className:"size-5"}),onClick:()=>h(l=>!l),"aria-label":e,"aria-haspopup":"menu","aria-expanded":x,...u?{role:"menuitem"}:{},className:b(s&&"min-h-11 min-w-11 px-0",i),children:n}),a.jsx(M,{open:x,align:r,panelRef:w,getAnchor:m,children:a.jsxs(N,{ref:w,children:[o.map(l=>a.jsx(O,{label:l.label,icon:l.icon,onSelect:()=>{h(!1),l.onSelect()}},l.key)),d]})})]})}export{j as E,M as P,N as a,O as b,A as c,z as u};
@@ -1 +1 @@
1
- import{b as e}from"./index-CXzCthHG.js";const t=e("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);export{t as R};
1
+ import{b as e}from"./index-CL_fwLHN.js";const t=e("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);export{t as R};
@@ -0,0 +1 @@
1
+ import{K as R,cv as L,cw as O,r as o,u,cx as M,J as l,j as A,cy as B,cz as C,cA as m,cB as $}from"./index-CL_fwLHN.js";import{u as j}from"./useMediaQuery-DiQ0fGER.js";function F(e){const s=R({warn:e?.router===void 0}),t=e?.router||s;return L(t.stores.__store,O(e,t))}function P(e){const s=R();return L(s.stores.location,O(e,s))}const I=["intelligence","sidebar","nav","shortcuts"],N=["nav","shortcuts"],k=e=>N.includes(e);function ee(e,s){return[...e.filter(t=>!k(t)),...s?[s]:[]]}const U=M(I);function h(e){const s=new Set(e.split(",").map(t=>U.safeParse(t)).filter(t=>t.success).map(t=>t.data));return I.filter(t=>s.has(t))}function p(e){return I.filter(s=>e.includes(s)).join(",")}function se(){const e=P({select:s=>p(h(s.hash))});return o.useMemo(()=>h(e),[e])}const G=(e,s)=>!k(e)&&s;function K(e){return(s="")=>p(h(s).filter(t=>G(t,e)))}function c(){const e=j();return o.useMemo(()=>K(e),[e])}function te(){const e=u();return o.useCallback(s=>{e({search:!0,hash:p(s),replace:!0,hashScrollIntoView:!1})},[e])}const w="/mail/brief",_="/mail/$mailboxId",T="/mail/outbox",S="/mail/flagged";function V(e){for(const s of e){if(s.routeId===w)return{list:"brief"};if(s.routeId===S)return{list:"flagged"};if(s.routeId===T)return{list:"outbox"};if(s.routeId===_)return{list:"mailbox",mailboxId:s.params?.mailboxId}}}function ae(e){const s=e.split(/[?#]/)[0].split("/").filter(Boolean);if(s[0]!=="mail")return"";const t=s[1];return t?t==="brief"?w:t==="flagged"?S:t==="outbox"?T:X(t):""}function re(e){if(typeof e!="object"||e===null)return"";const{q:s}=e;return typeof s=="string"?s:""}function X(e){return`${_}:${e}`}function ne(e,s){return e===s?!0:e.startsWith(`${s}/`)}function Y(e){const s=e.split(/[?#]/)[0].split("/").filter(Boolean);return s[0]==="mail"&&s.length>2}function d(){const e=F({select:a=>V(a.matches)?.list}),t=l({from:"/mail/$mailboxId",shouldThrow:!1})?.mailboxId;return o.useMemo(()=>({list:e,mailboxId:t}),[e,t])}function oe(){const{pathname:e}=P();return Y(e)}function ie(){const e=u(),s=c(),{list:t,mailboxId:a}=d();return o.useCallback(()=>{const r=i=>i,n=s;if(t==="flagged"){e({to:"/mail/flagged",search:r,hash:n});return}if(t==="outbox"){e({to:"/mail/outbox",search:r,hash:n});return}if(t==="mailbox"&&a){e({to:"/mail/$mailboxId",params:{mailboxId:a},search:r,hash:n});return}e({to:"/mail/brief",search:r,hash:n})},[e,s,t,a])}const q=B(C);function ue({fragment:e,...s}){const t=c();return A.jsx(q,{...s,hash:e??t})}const W=["reply","reply-all","forward"],z=M(W),g="/mail/brief/$threadId/$messageId/$mode/{-$outboxMessageId}",b="/mail/flagged/$threadId/$messageId/$mode/{-$outboxMessageId}",x="/mail/$mailboxId/$threadId/$messageId/$mode/{-$outboxMessageId}";function E(){const e=l({from:g,shouldThrow:!1}),s=l({from:b,shouldThrow:!1}),t=l({from:x,shouldThrow:!1});return e??s??t}function J(){const e=m({from:g,shouldThrow:!1}),s=m({from:b,shouldThrow:!1}),t=m({from:x,shouldThrow:!1});return(e??s??t)?.body}const y=e=>s=>e===void 0?$(s):{...$(s),body:e.body};function v(){const e=E(),s=J();return o.useMemo(()=>{if(!e)return;const t=z.safeParse(e.mode);return t.success?{kind:"reply",mode:t.data,threadId:e.threadId,sourceMessageId:e.messageId,outboxMessageId:e.outboxMessageId,seed:s===void 0?void 0:{body:s}}:{kind:"unknown",segment:e.mode}},[e,s])}function le(){return v()?.kind==="reply"}function D(e,s,t,a){return e==="flagged"?{to:b,params:{...t,outboxMessageId:a}}:e==="mailbox"&&s?{to:x,params:{...t,mailboxId:s,outboxMessageId:a}}:{to:g,params:{...t,outboxMessageId:a}}}function Q(e,s){if(e?.kind==="reply"&&e.threadId===s.threadId&&e.sourceMessageId===s.messageId)return e.outboxMessageId}function ce(){const e=u(),s=c(),{list:t,mailboxId:a}=d(),r=v();return o.useCallback((n,i)=>{e({...D(t,a,n,i===void 0?Q(r,n):void 0),search:y(i),hash:s})},[e,s,t,a,r])}function de(e,s,t){if(!(!s||!t))return a=>e({threadId:s,messageId:t,mode:a})}function fe(){const e=u(),{list:s,mailboxId:t}=d(),a=v();return o.useCallback(r=>{a?.kind==="reply"&&e({...D(s,t,{threadId:a.threadId,messageId:a.sourceMessageId,mode:a.mode},r),search:y(void 0),hash:!0,replace:!0})},[e,s,t,a])}function me(){const e=u(),s=c(),{list:t,mailboxId:a}=d(),r=E();return o.useCallback(()=>{if(!r)return;const n=y(void 0),i=s,f={threadId:r.threadId,messageId:r.messageId};if(t==="flagged"){e({to:"/mail/flagged/$threadId/$messageId",params:f,search:n,hash:i});return}if(t==="mailbox"&&a){e({to:"/mail/$mailboxId/$threadId/$messageId",params:{...f,mailboxId:a},search:n,hash:i});return}e({to:"/mail/brief/$threadId/$messageId",params:f,search:n,hash:i})},[e,s,t,a,r])}export{ue as N,F as a,re as b,oe as c,se as d,te as e,V as f,c as g,le as h,k as i,d as j,ie as k,ne as l,ae as m,ce as n,fe as o,ee as p,me as q,de as r,v as s,P as u};