@remit/web-client-dist 0.0.697 → 0.0.699

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 (217) hide show
  1. package/assets/{BriefPane-BQx5RRpb.js → BriefPane-CVojVy4N.js} +1 -1
  2. package/assets/{CalendarEventEditor-B3bVY-Oc.js → CalendarEventEditor-BcGWIsNu.js} +1 -1
  3. package/assets/{CalendarEventPopup-D6PNfUfu.js → CalendarEventPopup-MzsWR5GB.js} +1 -1
  4. package/assets/{CalendarLoadFailed-Cm6trTQZ.js → CalendarLoadFailed-Bq0_jt4H.js} +1 -1
  5. package/assets/{CalendarQuickCreate-B_n983kv.js → CalendarQuickCreate-m3dyD7gG.js} +1 -1
  6. package/assets/{CalendarSession-BosFoHg2.js → CalendarSession-D2sxMFYX.js} +1 -1
  7. package/assets/{CollectionPane-BzktgIp0.js → CollectionPane-BykvWdR8.js} +1 -1
  8. package/assets/{DesktopChrome-GxTHTvqD.js → DesktopChrome-D8EtAdwf.js} +1 -1
  9. package/assets/{DropdownMenu-C2J8u8zN.js → DropdownMenu-BuKAMdhw.js} +1 -1
  10. package/assets/{EmptyState-BJU14tbt.js → EmptyState-DEGumQTC.js} +1 -1
  11. package/assets/{ErrorState-BTHOmsYP.js → ErrorState-g7-Y1uhe.js} +1 -1
  12. package/assets/{FullCompose-DiZNltCL.js → FullCompose-CN22d_2q.js} +1 -1
  13. package/assets/{LabelApplyTrigger-P8IoLKME.js → LabelApplyTrigger-Ds7qPw1w.js} +1 -1
  14. package/assets/{MailShell-tKLYT5hn.js → MailShell-DemzOx8u.js} +1 -1
  15. package/assets/{MailViewChrome-CLgaFbe-.js → MailViewChrome-pi6cPv-J.js} +1 -1
  16. package/assets/MailboxPane-DGJQyeZU.js +135 -0
  17. package/assets/{MessageBody-jG4Dhul6.js → MessageBody-Lnqqwldl.js} +1 -1
  18. package/assets/MessageToolbar-HTPVoP6C.js +1 -0
  19. package/assets/{NavMenuButton-CLp6InRG.js → NavMenuButton-BWwWmGhg.js} +1 -1
  20. package/assets/{OnboardingWizard-BSlPpmI5.js → OnboardingWizard-C9TeAtWU.js} +1 -1
  21. package/assets/{OutboxPane-B6UfixBP.js → OutboxPane-dfNu0jGv.js} +1 -1
  22. package/assets/{ReportLink-BELrQR40.js → ReportLink-qkDHdkiE.js} +1 -1
  23. package/assets/_calendarObjectId-DbDEB7MM.js +1 -0
  24. package/assets/_labelId-DeoXHX88.js +1 -0
  25. package/assets/_mailboxId-BGYGT6QY.js +1 -0
  26. package/assets/_messageId-Bqhz_qdo.js +1 -0
  27. package/assets/_messageId-DNugF3h5.js +1 -0
  28. package/assets/_messageId-DXnZth67.js +1 -0
  29. package/assets/_messageId-DtLyjaix.js +1 -0
  30. package/assets/_outboxMessageId-CphlQb-y.js +1 -0
  31. package/assets/_recurrenceId-De3orc9t.js +1 -0
  32. package/assets/{_slotId-DQqfctAf.js → _slotId-Cl3N41sT.js} +1 -1
  33. package/assets/_threadId-BJhKtdZn.js +1 -0
  34. package/assets/_threadId-Bjt3wKzI.js +1 -0
  35. package/assets/_threadId-Cp8WdX2x.js +1 -0
  36. package/assets/_threadId-LaejKsjM.js +1 -0
  37. package/assets/_view._date-CjV2fY7h.js +1 -0
  38. package/assets/{account-service-status-DsLvRU-X.js → account-service-status-CHNkQEDe.js} +1 -1
  39. package/assets/{accounts-D0rPQMGH.js → accounts-BLUtQMSv.js} +1 -1
  40. package/assets/{advanced-q_hG98BB.js → advanced-Cbpc8AqG.js} +1 -1
  41. package/assets/{agenda-time-D0yU-H44.js → agenda-time-BwFncCBt.js} +1 -1
  42. package/assets/{app-chrome-BfyGOiSA.js → app-chrome-CGYf2rTW.js} +1 -1
  43. package/assets/{appearance-DM1k2Ta7.js → appearance-Pwj-DY3o.js} +1 -1
  44. package/assets/{avatar-Bq7beWCy.js → avatar-CVmRGlvx.js} +1 -1
  45. package/assets/{badge-BB80tGxy.js → badge-CDOouHHB.js} +1 -1
  46. package/assets/{bottom-sheet-DKF_Dkid.js → bottom-sheet-Bl-_mC2x.js} +1 -1
  47. package/assets/{brief-8diVJSZ9.js → brief-0MZHMWP6.js} +1 -1
  48. package/assets/brief-Cm-kx12Z.js +1 -0
  49. package/assets/{calendar-BqFIadRy.js → calendar-BDEdchBU.js} +1 -1
  50. package/assets/{calendar-Ds9kgvU8.js → calendar-BHWGBart.js} +1 -1
  51. package/assets/{calendar-event-popup-Cr_LW8IP.js → calendar-event-popup-O-JrsyRu.js} +1 -1
  52. package/assets/{calendar-event-sidebar-B_eR1h5J.js → calendar-event-sidebar-BUwhXGT2.js} +1 -1
  53. package/assets/{calendar-failure-note-C4gNXDQV.js → calendar-failure-note-_XD99AnH.js} +1 -1
  54. package/assets/{calendar-guests-Cay9Ub8h.js → calendar-guests-BVwUAczN.js} +1 -1
  55. package/assets/{calendar-suggestion-EosZrXZC.js → calendar-suggestion-DnD4hQ5U.js} +1 -1
  56. package/assets/calendars-DmhTUU22.js +1 -0
  57. package/assets/{card-CLJYKox8.js → card-D8MhhaRw.js} +1 -1
  58. package/assets/{checkbox-CYOm-zGr.js → checkbox-DQCA_mSq.js} +1 -1
  59. package/assets/{chevron-down-De4wQzka.js → chevron-down-DeNyJr8d.js} +1 -1
  60. package/assets/{chevron-left-CUHU8UT9.js → chevron-left-Co8HGTow.js} +1 -1
  61. package/assets/{circle-check-DlR8I4Hf.js → circle-check-BoVmBAEX.js} +1 -1
  62. package/assets/{circle-check-big-CMsxQSjY.js → circle-check-big-DSc97Qaj.js} +1 -1
  63. package/assets/{circle-question-mark-DhNa_A16.js → circle-question-mark-DuTpeMvV.js} +1 -1
  64. package/assets/{classification-BgDJ1gwK.js → classification-9tqOMgRd.js} +1 -1
  65. package/assets/{clock-Dds4zv6u.js → clock--ouhjt6L.js} +1 -1
  66. package/assets/{cloud-off-BYulqayx.js → cloud-off-DEwqlx6S.js} +1 -1
  67. package/assets/compose._-_outboxMessageId_-BAzIb9up.js +1 -0
  68. package/assets/compose._-_outboxMessageId_-C8ETLKa8.js +1 -0
  69. package/assets/compose._-_outboxMessageId_-CAFZwe5_.js +1 -0
  70. package/assets/compose._-_outboxMessageId_-CS88venz.js +1 -0
  71. package/assets/compose._-_outboxMessageId_-CVS1GWS6.js +1 -0
  72. package/assets/{config-import-VTZQj3gU.js → config-import-B-pJhKeZ.js} +1 -1
  73. package/assets/{confirm-dialog-XvccFJdE.js → confirm-dialog-BdT5xj08.js} +1 -1
  74. package/assets/{copy-BokIobZ4.js → copy-CCCumQLf.js} +1 -1
  75. package/assets/{credential-steps-O1OzlOow.js → credential-steps-BIgbwjRe.js} +1 -1
  76. package/assets/{download-DEuAIIIQ.js → download-BrsKwaQk.js} +1 -1
  77. package/assets/{draft-BEiHkDpm.js → draft-B-aWKHzd.js} +1 -1
  78. package/assets/edit-Cn1GEm6M.js +1 -0
  79. package/assets/edit-sXk685Tf.js +1 -0
  80. package/assets/{external-link-L7NXOTeQ.js → external-link-D__EDlgs.js} +1 -1
  81. package/assets/{file-braces-BN8-S---.js → file-braces-BtzbF80p.js} +1 -1
  82. package/assets/filters-B0cQUlmN.js +1 -0
  83. package/assets/flagged-BH8DBC_m.js +1 -0
  84. package/assets/{flagged-B-j-3yRr.js → flagged-DHdIwzxj.js} +1 -1
  85. package/assets/folder-failure-BphZCUyZ.js +1 -0
  86. package/assets/{folder-input-B0q8wLhf.js → folder-input-C_5R00h6.js} +1 -1
  87. package/assets/folders-DlGCVINx.js +1 -0
  88. package/assets/{help-copy-DUjzIPXf.js → help-copy-Cy9gka_E.js} +1 -1
  89. package/assets/{import-DLM5VFnJ.js → import-D8rex9A_.js} +1 -1
  90. package/assets/index-1RsOqxw1.js +1 -0
  91. package/assets/index-BON2Uz34.js +1 -0
  92. package/assets/index-Bc1xPJmS.js +1 -0
  93. package/assets/index-Bqhz_qdo.js +1 -0
  94. package/assets/index-C2US5ZnK.js +222 -0
  95. package/assets/index-CPXeIqob.js +1 -0
  96. package/assets/index-D4tg2bgX.js +1 -0
  97. package/assets/index-DEDbYXlC.js +1 -0
  98. package/assets/index-DNugF3h5.js +1 -0
  99. package/assets/index-Da8RbG-l.js +1 -0
  100. package/assets/index-Dq3u3q5n.js +1 -0
  101. package/assets/index-G-mQoWoq.js +1 -0
  102. package/assets/index-SJfI-AF0.js +1 -0
  103. package/assets/{index-Caon2n2j.js → index-v9nM8Dsp.js} +4 -4
  104. package/assets/{kbd-jzPSd-a2.js → kbd-C052hWKm.js} +1 -1
  105. package/assets/{label-chip-DtBVyALF.js → label-chip-D_oZixyY.js} +1 -1
  106. package/assets/labels--8vbvW8D.js +1 -0
  107. package/assets/list-pages-BCUbyyea.js +1 -0
  108. package/assets/{mail-BzFJWQZy.js → mail-Cqr91KmH.js} +1 -1
  109. package/assets/mail-DTcPvSJ6.js +1 -0
  110. package/assets/{menu-Bh94jr77.js → menu-CEGeda9s.js} +1 -1
  111. package/assets/{nav-link-ed0mFCCx.js → nav-link-Df_MDzvJ.js} +1 -1
  112. package/assets/new-B_AuEYbG.js +1 -0
  113. package/assets/onboarding-B2cpYesO.js +1 -0
  114. package/assets/{onboarding-completion-qKzJSmsI.js → onboarding-completion-2pWLyByk.js} +1 -1
  115. package/assets/outbox-BOxaEnp0.js +1 -0
  116. package/assets/{pencil-BDbmS56C.js → pencil-C1yBZXUb.js} +1 -1
  117. package/assets/{people-eWwwIt4_.js → people-BTPHUD8U.js} +1 -1
  118. package/assets/{plus-D5-2sA5v.js → plus-DY_LOTJC.js} +1 -1
  119. package/assets/{popover-menu-DhcuKv1N.js → popover-menu-D4kT-xqh.js} +1 -1
  120. package/assets/{refresh-cw-Cu9_I3cT.js → refresh-cw-CY0SJjI-.js} +1 -1
  121. package/assets/{reply-CXuSMyqp.js → reply-CijQsg4o.js} +1 -1
  122. package/assets/{rich-text-Ds4rQc2o.js → rich-text-CY6eh-tS.js} +1 -1
  123. package/assets/{rich-text-spellcheck-worker-provider-ChKzrvjg.js → rich-text-spellcheck-worker-provider-BoNiweeq.js} +1 -1
  124. package/assets/{rotate-ccw-hQhPZwrx.js → rotate-ccw-CfAs8Xij.js} +1 -1
  125. package/assets/{roving-focus-DZX7IpN4.js → roving-focus-C0jnB7ie.js} +1 -1
  126. package/assets/{row-actions-BDfQKXdD.js → row-actions-gLlnd0fC.js} +1 -1
  127. package/assets/{search-mirror-B2xnwy77.js → search-mirror-B_HO5zGq.js} +1 -1
  128. package/assets/{search-scope-B-3MTDpD.js → search-scope-7jHRUZbg.js} +1 -1
  129. package/assets/{search-token-index-BYKMNlJD.js → search-token-index-BymL-AGz.js} +1 -1
  130. package/assets/{sections-DpRVKuXF.js → sections-FtpeSpRq.js} +1 -1
  131. package/assets/{segmented-control-BwvsufVp.js → segmented-control-CMV1-H2S.js} +1 -1
  132. package/assets/{select-TYdrgtW5.js → select-DhVwx5IO.js} +1 -1
  133. package/assets/{senders-vh4OQfD0.js → senders-ZFBTlEw_.js} +1 -1
  134. package/assets/settings-aaApx7r_.js +1 -0
  135. package/assets/{settings-screen-DTYVWAkg.js → settings-screen-zihVEeS9.js} +1 -1
  136. package/assets/{shield-check-C-tOrPEx.js → shield-check-CvFo5QUy.js} +1 -1
  137. package/assets/spam-CN0HeRYz.js +1 -0
  138. package/assets/{suggest-list-BCqr1j26.js → suggest-list-DJUWGfG3.js} +1 -1
  139. package/assets/{suggested-vips--pG2iuOT.js → suggested-vips-DNc6wPf9.js} +1 -1
  140. package/assets/suggestion._suggestionId-DCu4Y3bg.js +1 -0
  141. package/assets/{switch-CyAtRlCz.js → switch-Bza9700F.js} +1 -1
  142. package/assets/task._calendarTaskId-B9lXR7O6.js +1 -0
  143. package/assets/{undo-2-D1IMLq7c.js → undo-2-BHa76eIs.js} +1 -1
  144. package/assets/{useCalendarData-DFG3pzeG.js → useCalendarData-AQi5DlI1.js} +1 -1
  145. package/assets/{useCalendarScheduling-B_INtO-h.js → useCalendarScheduling-BzXa0l-K.js} +1 -1
  146. package/assets/useCalendarSuggestions-CJGnqdiK.js +1 -0
  147. package/assets/{useCalendarTasks-b_UNFPQH.js → useCalendarTasks-BBv_7Q0J.js} +1 -1
  148. package/assets/{useClassificationSettings-DBRecrmp.js → useClassificationSettings-Dh7qfWbF.js} +1 -1
  149. package/assets/{useCollectionThreads-DgofDKen.js → useCollectionThreads-B1vimpsO.js} +1 -1
  150. package/assets/{useDebouncedValue-CFZ4EPXW.js → useDebouncedValue-C3FljUyl.js} +1 -1
  151. package/assets/{useFilters-DHWZEIQe.js → useFilters-BoddpA09.js} +1 -1
  152. package/assets/{useInfiniteQuery-B-vOuANs.js → useInfiniteQuery-Dd0GYAxg.js} +1 -1
  153. package/assets/{useJunkMailboxIds-CW7aI25D.js → useJunkMailboxIds-D3M8TbeX.js} +1 -1
  154. package/assets/useLabels-DnF0cYWq.js +1 -0
  155. package/assets/{useLayoutTier-BNUKvwJD.js → useLayoutTier-lXeQo_2w.js} +1 -1
  156. package/assets/{useMediaQuery-Hy81MQ2M.js → useMediaQuery-BaUDTtu8.js} +1 -1
  157. package/assets/{useMessageBodyContent-CpTD2HGg.js → useMessageBodyContent-DwHmQdO9.js} +1 -1
  158. package/assets/{useQueries-DPH-PeHV.js → useQueries-B-1XtDe8.js} +1 -1
  159. package/assets/{useRefreshControl-DdbTrGxq.js → useRefreshControl-CJGMdQve.js} +1 -1
  160. package/assets/{useResultFolderIndex-BVyfzXH5.js → useResultFolderIndex-D_NiyNtK.js} +1 -1
  161. package/assets/{useSignature-W9HBbZ_n.js → useSignature-cMh39FpD.js} +1 -1
  162. package/assets/{warnings-B2sNE31D.js → warnings-DzSQHNtz.js} +1 -1
  163. package/index.html +2 -2
  164. package/package.json +1 -1
  165. package/assets/MailboxPane-BxNCkl6s.js +0 -135
  166. package/assets/MessageToolbar-DeDUhCvg.js +0 -1
  167. package/assets/_calendarObjectId-BiaBDCEt.js +0 -1
  168. package/assets/_labelId-DLeWLaow.js +0 -1
  169. package/assets/_mailboxId-DWvQ-9gi.js +0 -1
  170. package/assets/_messageId-BB9xOwfs.js +0 -1
  171. package/assets/_messageId-C2YSZxRF.js +0 -1
  172. package/assets/_messageId-CPvSvBZB.js +0 -1
  173. package/assets/_messageId-DbVH08AL.js +0 -1
  174. package/assets/_outboxMessageId-BFgW_k_u.js +0 -1
  175. package/assets/_recurrenceId-96pqeQMh.js +0 -1
  176. package/assets/_threadId-Bm7b75jN.js +0 -1
  177. package/assets/_threadId-CCwEReI2.js +0 -1
  178. package/assets/_threadId-Db39B53v.js +0 -1
  179. package/assets/_threadId-Dht02PUZ.js +0 -1
  180. package/assets/_view._date-BQeaBjoE.js +0 -1
  181. package/assets/brief-CFBkxoDK.js +0 -1
  182. package/assets/calendars-52NaEZbX.js +0 -1
  183. package/assets/compose._-_outboxMessageId_-BY1Sf-7o.js +0 -1
  184. package/assets/compose._-_outboxMessageId_-ByGI1c-o.js +0 -1
  185. package/assets/compose._-_outboxMessageId_-CvOAO1iL.js +0 -1
  186. package/assets/compose._-_outboxMessageId_-EZpX9L3H.js +0 -1
  187. package/assets/compose._-_outboxMessageId_-urlj3DLH.js +0 -1
  188. package/assets/edit-B9dhadKH.js +0 -1
  189. package/assets/edit-vn6fIBd6.js +0 -1
  190. package/assets/filters-VSaDpnX3.js +0 -1
  191. package/assets/flagged-BZJepVc-.js +0 -1
  192. package/assets/folder-failure-CqkVSsrb.js +0 -1
  193. package/assets/folders-CTNX9Hcm.js +0 -1
  194. package/assets/index-B--m5QrT.js +0 -1
  195. package/assets/index-BuawSiTp.js +0 -1
  196. package/assets/index-C2YSZxRF.js +0 -1
  197. package/assets/index-CO1X8-aP.js +0 -1
  198. package/assets/index-CPvSvBZB.js +0 -1
  199. package/assets/index-ChWo5_90.js +0 -1
  200. package/assets/index-DGb7Ls8y.js +0 -1
  201. package/assets/index-DLRo9M2D.js +0 -1
  202. package/assets/index-DemsYVll.js +0 -1
  203. package/assets/index-Dylwxpr-.js +0 -1
  204. package/assets/index-YwusJB4d.js +0 -1
  205. package/assets/index-Zfii_-4V.js +0 -1
  206. package/assets/index-fsuIswbe.js +0 -213
  207. package/assets/labels-CUXsONgB.js +0 -1
  208. package/assets/mail-BodKXw3C.js +0 -1
  209. package/assets/new-DlRrHbU8.js +0 -1
  210. package/assets/onboarding-8O2rW7qq.js +0 -1
  211. package/assets/outbox-nrXvnMTk.js +0 -1
  212. package/assets/settings-MlHARJWl.js +0 -1
  213. package/assets/spam-CecFwFHS.js +0 -1
  214. package/assets/suggestion._suggestionId-DiMWWP0r.js +0 -1
  215. package/assets/task._calendarTaskId-D-wpEifQ.js +0 -1
  216. package/assets/useCalendarSuggestions-DXbA0boT.js +0 -1
  217. package/assets/useLabels-k1VKuQrr.js +0 -1
@@ -0,0 +1 @@
1
+ import{j as o}from"./index-C2US5ZnK.js";import{C as r}from"./CollectionPane-BykvWdR8.js";import"./useCollectionThreads-B1vimpsO.js";import"./useQueries-B-1XtDe8.js";import"./useInfiniteQuery-Dd0GYAxg.js";import"./MessageToolbar-HTPVoP6C.js";import"./MessageBody-Lnqqwldl.js";import"./kbd-C052hWKm.js";import"./search-scope-7jHRUZbg.js";import"./app-chrome-CGYf2rTW.js";import"./nav-link-Df_MDzvJ.js";import"./useMediaQuery-BaUDTtu8.js";import"./reply-CijQsg4o.js";import"./useMessageBodyContent-DwHmQdO9.js";import"./roving-focus-C0jnB7ie.js";import"./chevron-down-DeNyJr8d.js";import"./search-token-index-BymL-AGz.js";import"./useLabels-DnF0cYWq.js";import"./list-pages-BCUbyyea.js";import"./index-v9nM8Dsp.js";import"./useSignature-cMh39FpD.js";import"./account-form-helpers-DhckT_PN.js";import"./useDebouncedValue-C3FljUyl.js";import"./suggest-list-DJUWGfG3.js";import"./sections-FtpeSpRq.js";import"./useJunkMailboxIds-D3M8TbeX.js";import"./badge-CDOouHHB.js";import"./undo-2-BHa76eIs.js";import"./DropdownMenu-BuKAMdhw.js";import"./refresh-cw-CY0SJjI-.js";import"./popover-menu-D4kT-xqh.js";import"./ErrorState-g7-Y1uhe.js";import"./mail-Cqr91KmH.js";import"./download-BrsKwaQk.js";import"./avatar-CVmRGlvx.js";import"./EmptyState-DEGumQTC.js";import"./circle-question-mark-DuTpeMvV.js";import"./useFilters-BoddpA09.js";import"./select-DhVwx5IO.js";import"./plus-DY_LOTJC.js";import"./calendar-suggestion-DnD4hQ5U.js";import"./useCalendarSuggestions-CJGnqdiK.js";import"./agenda-time-BwFncCBt.js";import"./calendar-format-BwCpz-JZ.js";import"./calendar-BHWGBart.js";import"./calendar-failure-note-_XD99AnH.js";import"./checkbox-DQCA_mSq.js";import"./clock--ouhjt6L.js";import"./segmented-control-CMV1-H2S.js";import"./useLayoutTier-lXeQo_2w.js";import"./menu-CEGeda9s.js";import"./folder-input-C_5R00h6.js";import"./confirm-dialog-BdT5xj08.js";import"./label-chip-D_oZixyY.js";import"./cloud-off-DEwqlx6S.js";import"./MailViewChrome-pi6cPv-J.js";import"./wizard-selection-zWa1qc6-.js";function po(){return o.jsx(r.Reading,{})}export{po as component};
@@ -0,0 +1 @@
1
+ import{j as o}from"./index-C2US5ZnK.js";import{C as t}from"./CollectionPane-BykvWdR8.js";import"./useCollectionThreads-B1vimpsO.js";import"./useQueries-B-1XtDe8.js";import"./useInfiniteQuery-Dd0GYAxg.js";import"./MessageToolbar-HTPVoP6C.js";import"./MessageBody-Lnqqwldl.js";import"./kbd-C052hWKm.js";import"./search-scope-7jHRUZbg.js";import"./app-chrome-CGYf2rTW.js";import"./nav-link-Df_MDzvJ.js";import"./useMediaQuery-BaUDTtu8.js";import"./reply-CijQsg4o.js";import"./useMessageBodyContent-DwHmQdO9.js";import"./roving-focus-C0jnB7ie.js";import"./chevron-down-DeNyJr8d.js";import"./search-token-index-BymL-AGz.js";import"./useLabels-DnF0cYWq.js";import"./list-pages-BCUbyyea.js";import"./index-v9nM8Dsp.js";import"./useSignature-cMh39FpD.js";import"./account-form-helpers-DhckT_PN.js";import"./useDebouncedValue-C3FljUyl.js";import"./suggest-list-DJUWGfG3.js";import"./sections-FtpeSpRq.js";import"./useJunkMailboxIds-D3M8TbeX.js";import"./badge-CDOouHHB.js";import"./undo-2-BHa76eIs.js";import"./DropdownMenu-BuKAMdhw.js";import"./refresh-cw-CY0SJjI-.js";import"./popover-menu-D4kT-xqh.js";import"./ErrorState-g7-Y1uhe.js";import"./mail-Cqr91KmH.js";import"./download-BrsKwaQk.js";import"./avatar-CVmRGlvx.js";import"./EmptyState-DEGumQTC.js";import"./circle-question-mark-DuTpeMvV.js";import"./useFilters-BoddpA09.js";import"./select-DhVwx5IO.js";import"./plus-DY_LOTJC.js";import"./calendar-suggestion-DnD4hQ5U.js";import"./useCalendarSuggestions-CJGnqdiK.js";import"./agenda-time-BwFncCBt.js";import"./calendar-format-BwCpz-JZ.js";import"./calendar-BHWGBart.js";import"./calendar-failure-note-_XD99AnH.js";import"./checkbox-DQCA_mSq.js";import"./clock--ouhjt6L.js";import"./segmented-control-CMV1-H2S.js";import"./useLayoutTier-lXeQo_2w.js";import"./menu-CEGeda9s.js";import"./folder-input-C_5R00h6.js";import"./confirm-dialog-BdT5xj08.js";import"./label-chip-D_oZixyY.js";import"./cloud-off-DEwqlx6S.js";import"./MailViewChrome-pi6cPv-J.js";import"./wizard-selection-zWa1qc6-.js";function po(){return o.jsx(t.Reading,{})}export{po as component};
@@ -0,0 +1 @@
1
+ import{j as o}from"./index-C2US5ZnK.js";import{C as t}from"./CollectionPane-BykvWdR8.js";import"./useCollectionThreads-B1vimpsO.js";import"./useQueries-B-1XtDe8.js";import"./useInfiniteQuery-Dd0GYAxg.js";import"./MessageToolbar-HTPVoP6C.js";import"./MessageBody-Lnqqwldl.js";import"./kbd-C052hWKm.js";import"./search-scope-7jHRUZbg.js";import"./app-chrome-CGYf2rTW.js";import"./nav-link-Df_MDzvJ.js";import"./useMediaQuery-BaUDTtu8.js";import"./reply-CijQsg4o.js";import"./useMessageBodyContent-DwHmQdO9.js";import"./roving-focus-C0jnB7ie.js";import"./chevron-down-DeNyJr8d.js";import"./search-token-index-BymL-AGz.js";import"./useLabels-DnF0cYWq.js";import"./list-pages-BCUbyyea.js";import"./index-v9nM8Dsp.js";import"./useSignature-cMh39FpD.js";import"./account-form-helpers-DhckT_PN.js";import"./useDebouncedValue-C3FljUyl.js";import"./suggest-list-DJUWGfG3.js";import"./sections-FtpeSpRq.js";import"./useJunkMailboxIds-D3M8TbeX.js";import"./badge-CDOouHHB.js";import"./undo-2-BHa76eIs.js";import"./DropdownMenu-BuKAMdhw.js";import"./refresh-cw-CY0SJjI-.js";import"./popover-menu-D4kT-xqh.js";import"./ErrorState-g7-Y1uhe.js";import"./mail-Cqr91KmH.js";import"./download-BrsKwaQk.js";import"./avatar-CVmRGlvx.js";import"./EmptyState-DEGumQTC.js";import"./circle-question-mark-DuTpeMvV.js";import"./useFilters-BoddpA09.js";import"./select-DhVwx5IO.js";import"./plus-DY_LOTJC.js";import"./calendar-suggestion-DnD4hQ5U.js";import"./useCalendarSuggestions-CJGnqdiK.js";import"./agenda-time-BwFncCBt.js";import"./calendar-format-BwCpz-JZ.js";import"./calendar-BHWGBart.js";import"./calendar-failure-note-_XD99AnH.js";import"./checkbox-DQCA_mSq.js";import"./clock--ouhjt6L.js";import"./segmented-control-CMV1-H2S.js";import"./useLayoutTier-lXeQo_2w.js";import"./menu-CEGeda9s.js";import"./folder-input-C_5R00h6.js";import"./confirm-dialog-BdT5xj08.js";import"./label-chip-D_oZixyY.js";import"./cloud-off-DEwqlx6S.js";import"./MailViewChrome-pi6cPv-J.js";import"./wizard-selection-zWa1qc6-.js";function po(){return o.jsx(t.Reading,{})}export{po as component};
@@ -0,0 +1 @@
1
+ import{j as o}from"./index-C2US5ZnK.js";import{M as r}from"./MailboxPane-DGJQyeZU.js";import"./useInfiniteQuery-Dd0GYAxg.js";import"./MessageToolbar-HTPVoP6C.js";import"./MessageBody-Lnqqwldl.js";import"./kbd-C052hWKm.js";import"./search-scope-7jHRUZbg.js";import"./app-chrome-CGYf2rTW.js";import"./nav-link-Df_MDzvJ.js";import"./useMediaQuery-BaUDTtu8.js";import"./reply-CijQsg4o.js";import"./useMessageBodyContent-DwHmQdO9.js";import"./roving-focus-C0jnB7ie.js";import"./chevron-down-DeNyJr8d.js";import"./search-token-index-BymL-AGz.js";import"./useQueries-B-1XtDe8.js";import"./useLabels-DnF0cYWq.js";import"./list-pages-BCUbyyea.js";import"./index-v9nM8Dsp.js";import"./useSignature-cMh39FpD.js";import"./account-form-helpers-DhckT_PN.js";import"./useDebouncedValue-C3FljUyl.js";import"./suggest-list-DJUWGfG3.js";import"./sections-FtpeSpRq.js";import"./useJunkMailboxIds-D3M8TbeX.js";import"./badge-CDOouHHB.js";import"./undo-2-BHa76eIs.js";import"./DropdownMenu-BuKAMdhw.js";import"./refresh-cw-CY0SJjI-.js";import"./popover-menu-D4kT-xqh.js";import"./ErrorState-g7-Y1uhe.js";import"./mail-Cqr91KmH.js";import"./download-BrsKwaQk.js";import"./avatar-CVmRGlvx.js";import"./EmptyState-DEGumQTC.js";import"./circle-question-mark-DuTpeMvV.js";import"./useFilters-BoddpA09.js";import"./select-DhVwx5IO.js";import"./plus-DY_LOTJC.js";import"./calendar-suggestion-DnD4hQ5U.js";import"./useCalendarSuggestions-CJGnqdiK.js";import"./agenda-time-BwFncCBt.js";import"./calendar-format-BwCpz-JZ.js";import"./calendar-BHWGBart.js";import"./calendar-failure-note-_XD99AnH.js";import"./checkbox-DQCA_mSq.js";import"./clock--ouhjt6L.js";import"./segmented-control-CMV1-H2S.js";import"./useLayoutTier-lXeQo_2w.js";import"./menu-CEGeda9s.js";import"./folder-input-C_5R00h6.js";import"./confirm-dialog-BdT5xj08.js";import"./label-chip-D_oZixyY.js";import"./cloud-off-DEwqlx6S.js";import"./useRefreshControl-CJGMdQve.js";import"./circle-check-big-DSc97Qaj.js";import"./LabelApplyTrigger-Ds7qPw1w.js";import"./MailViewChrome-pi6cPv-J.js";import"./NavMenuButton-BWwWmGhg.js";import"./shield-check-CvFo5QUy.js";import"./bottom-sheet-Bl-_mC2x.js";import"./circle-check-BoVmBAEX.js";function xo(){return o.jsx(r.Reading,{})}export{xo as component};
@@ -0,0 +1 @@
1
+ import{j as r}from"./index-C2US5ZnK.js";import{B as o}from"./BriefPane-CVojVy4N.js";import"./MessageToolbar-HTPVoP6C.js";import"./MessageBody-Lnqqwldl.js";import"./kbd-C052hWKm.js";import"./search-scope-7jHRUZbg.js";import"./app-chrome-CGYf2rTW.js";import"./nav-link-Df_MDzvJ.js";import"./useMediaQuery-BaUDTtu8.js";import"./reply-CijQsg4o.js";import"./useMessageBodyContent-DwHmQdO9.js";import"./roving-focus-C0jnB7ie.js";import"./chevron-down-DeNyJr8d.js";import"./search-token-index-BymL-AGz.js";import"./useQueries-B-1XtDe8.js";import"./useLabels-DnF0cYWq.js";import"./list-pages-BCUbyyea.js";import"./index-v9nM8Dsp.js";import"./useSignature-cMh39FpD.js";import"./account-form-helpers-DhckT_PN.js";import"./useDebouncedValue-C3FljUyl.js";import"./suggest-list-DJUWGfG3.js";import"./sections-FtpeSpRq.js";import"./useJunkMailboxIds-D3M8TbeX.js";import"./badge-CDOouHHB.js";import"./undo-2-BHa76eIs.js";import"./DropdownMenu-BuKAMdhw.js";import"./refresh-cw-CY0SJjI-.js";import"./popover-menu-D4kT-xqh.js";import"./ErrorState-g7-Y1uhe.js";import"./mail-Cqr91KmH.js";import"./download-BrsKwaQk.js";import"./avatar-CVmRGlvx.js";import"./EmptyState-DEGumQTC.js";import"./circle-question-mark-DuTpeMvV.js";import"./useFilters-BoddpA09.js";import"./select-DhVwx5IO.js";import"./plus-DY_LOTJC.js";import"./calendar-suggestion-DnD4hQ5U.js";import"./useCalendarSuggestions-CJGnqdiK.js";import"./agenda-time-BwFncCBt.js";import"./calendar-format-BwCpz-JZ.js";import"./calendar-BHWGBart.js";import"./calendar-failure-note-_XD99AnH.js";import"./checkbox-DQCA_mSq.js";import"./clock--ouhjt6L.js";import"./segmented-control-CMV1-H2S.js";import"./useLayoutTier-lXeQo_2w.js";import"./menu-CEGeda9s.js";import"./folder-input-C_5R00h6.js";import"./confirm-dialog-BdT5xj08.js";import"./label-chip-D_oZixyY.js";import"./cloud-off-DEwqlx6S.js";import"./LabelApplyTrigger-Ds7qPw1w.js";import"./useRefreshControl-CJGMdQve.js";import"./circle-check-big-DSc97Qaj.js";import"./wizard-selection-zWa1qc6-.js";function pr(){return r.jsx(o.Reading,{})}export{pr as component};
@@ -0,0 +1 @@
1
+ import{j as o}from"./index-C2US5ZnK.js";import{M as i}from"./MailboxPane-DGJQyeZU.js";import"./useInfiniteQuery-Dd0GYAxg.js";import"./MessageToolbar-HTPVoP6C.js";import"./MessageBody-Lnqqwldl.js";import"./kbd-C052hWKm.js";import"./search-scope-7jHRUZbg.js";import"./app-chrome-CGYf2rTW.js";import"./nav-link-Df_MDzvJ.js";import"./useMediaQuery-BaUDTtu8.js";import"./reply-CijQsg4o.js";import"./useMessageBodyContent-DwHmQdO9.js";import"./roving-focus-C0jnB7ie.js";import"./chevron-down-DeNyJr8d.js";import"./search-token-index-BymL-AGz.js";import"./useQueries-B-1XtDe8.js";import"./useLabels-DnF0cYWq.js";import"./list-pages-BCUbyyea.js";import"./index-v9nM8Dsp.js";import"./useSignature-cMh39FpD.js";import"./account-form-helpers-DhckT_PN.js";import"./useDebouncedValue-C3FljUyl.js";import"./suggest-list-DJUWGfG3.js";import"./sections-FtpeSpRq.js";import"./useJunkMailboxIds-D3M8TbeX.js";import"./badge-CDOouHHB.js";import"./undo-2-BHa76eIs.js";import"./DropdownMenu-BuKAMdhw.js";import"./refresh-cw-CY0SJjI-.js";import"./popover-menu-D4kT-xqh.js";import"./ErrorState-g7-Y1uhe.js";import"./mail-Cqr91KmH.js";import"./download-BrsKwaQk.js";import"./avatar-CVmRGlvx.js";import"./EmptyState-DEGumQTC.js";import"./circle-question-mark-DuTpeMvV.js";import"./useFilters-BoddpA09.js";import"./select-DhVwx5IO.js";import"./plus-DY_LOTJC.js";import"./calendar-suggestion-DnD4hQ5U.js";import"./useCalendarSuggestions-CJGnqdiK.js";import"./agenda-time-BwFncCBt.js";import"./calendar-format-BwCpz-JZ.js";import"./calendar-BHWGBart.js";import"./calendar-failure-note-_XD99AnH.js";import"./checkbox-DQCA_mSq.js";import"./clock--ouhjt6L.js";import"./segmented-control-CMV1-H2S.js";import"./useLayoutTier-lXeQo_2w.js";import"./menu-CEGeda9s.js";import"./folder-input-C_5R00h6.js";import"./confirm-dialog-BdT5xj08.js";import"./label-chip-D_oZixyY.js";import"./cloud-off-DEwqlx6S.js";import"./useRefreshControl-CJGMdQve.js";import"./circle-check-big-DSc97Qaj.js";import"./LabelApplyTrigger-Ds7qPw1w.js";import"./MailViewChrome-pi6cPv-J.js";import"./NavMenuButton-BWwWmGhg.js";import"./shield-check-CvFo5QUy.js";import"./bottom-sheet-Bl-_mC2x.js";import"./circle-check-BoVmBAEX.js";function xo(){return o.jsx(i.Reading,{})}export{xo as component};
@@ -0,0 +1 @@
1
+ import{j as o}from"./index-C2US5ZnK.js";import{O as t}from"./OutboxPane-dfNu0jGv.js";import"./MessageBody-Lnqqwldl.js";import"./kbd-C052hWKm.js";import"./search-scope-7jHRUZbg.js";import"./app-chrome-CGYf2rTW.js";import"./nav-link-Df_MDzvJ.js";import"./useMediaQuery-BaUDTtu8.js";import"./reply-CijQsg4o.js";import"./useMessageBodyContent-DwHmQdO9.js";import"./outbox-status-BlKn6P0x.js";import"./NavMenuButton-BWwWmGhg.js";import"./menu-CEGeda9s.js";import"./roving-focus-C0jnB7ie.js";import"./circle-check-big-DSc97Qaj.js";import"./clock--ouhjt6L.js";import"./row-actions-gLlnd0fC.js";import"./rotate-ccw-CfAs8Xij.js";function P(){return o.jsx(t.Reading,{})}export{P as component};
@@ -0,0 +1 @@
1
+ import{fz as t,j as m}from"./index-C2US5ZnK.js";import{C as p}from"./CalendarEventPopup-MzsWR5GB.js";import"./useCalendarSuggestions-CJGnqdiK.js";import"./ErrorState-g7-Y1uhe.js";import"./useQueries-B-1XtDe8.js";import"./list-pages-BCUbyyea.js";import"./useCalendarData-AQi5DlI1.js";import"./useCalendarTasks-BBv_7Q0J.js";import"./calendar-format-BwCpz-JZ.js";import"./nav-link-Df_MDzvJ.js";import"./useMediaQuery-BaUDTtu8.js";import"./calendar-BHWGBart.js";import"./reply-CijQsg4o.js";import"./CalendarSession-D2sxMFYX.js";import"./calendar-event-popup-O-JrsyRu.js";import"./pencil-C1yBZXUb.js";import"./calendar-guests-BVwUAczN.js";import"./circle-question-mark-DuTpeMvV.js";import"./confirm-dialog-BdT5xj08.js";function v(){const{calendarObjectId:r,recurrenceId:o}=t.useParams();return m.jsx(p,{calendarObjectId:r,recurrenceId:o})}export{v as component};
@@ -1,5 +1,5 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/rich-text-spellcheck-worker-provider-ChKzrvjg.js","assets/useSignature-W9HBbZ_n.js","assets/index-fsuIswbe.js","assets/index-DS2W4dIw.css","assets/rich-text-spellcheck-provider-J8m9wz6A.js","assets/rich-text-Ds4rQc2o.js","assets/roving-focus-DZX7IpN4.js","assets/confirm-dialog-XvccFJdE.js","assets/useMediaQuery-Hy81MQ2M.js","assets/bottom-sheet-DKF_Dkid.js","assets/popover-menu-DhcuKv1N.js","assets/undo-2-D1IMLq7c.js","assets/useMessageBodyContent-CpTD2HGg.js","assets/reply-CXuSMyqp.js","assets/nav-link-ed0mFCCx.js","assets/account-form-helpers-DhckT_PN.js","assets/useDebouncedValue-CFZ4EPXW.js","assets/suggest-list-BCqr1j26.js","assets/sections-DpRVKuXF.js","assets/chevron-down-De4wQzka.js"])))=>i.map(i=>d[i]);
2
- import{b as vr,j as d,X as gr,p as ln,B as un,L as yr,z as Bo,T as Uo,r as s,y as Ho,d as wr,ag as zo,x as Wo,cx as wn,ci as br,cy as xe,cz as Er,cA as Vo,cB as qo,cC as Se,f as _e,aB as Me,cD as Ko,cE as Yo,cF as xr,cG as Go,az as Sr,aA as Rr,aa as Xo,e as Cr,cH as Qo,Z as Zo,a as At,bS as Jo,cI as Tr,c9 as ea,bU as ta,c as Ar,cJ as na,an as ra,cK as _n,a_ as Mn,cL as oa,ao as aa,cM as sa,cN as ia,aj as R}from"./index-fsuIswbe.js";import{p as ca,c as la,b as ua}from"./useMessageBodyContent-CpTD2HGg.js";import{w as da,u as fa,a as ma,d as ha}from"./useSignature-W9HBbZ_n.js";import{b as pa}from"./account-form-helpers-DhckT_PN.js";import{u as va}from"./useDebouncedValue-CFZ4EPXW.js";import{u as ga,S as ya}from"./suggest-list-BCqr1j26.js";import"./nav-link-ed0mFCCx.js";import"./reply-CXuSMyqp.js";import{b as wa}from"./sections-DpRVKuXF.js";import{u as ba}from"./useMediaQuery-Hy81MQ2M.js";import{C as Dr}from"./chevron-down-De4wQzka.js";const Nr={name:"arrow-right",size:24,node:[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]};Nr.node;const Ea=vr(Nr);const Or={name:"paperclip",size:24,node:[["path",{d:"m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551",key:"1miecu"}]]};Or.node;const Ir=vr(Or),xa=({email:e,displayName:t,onRemove:n,className:r})=>d.jsxs("span",{className:ln("inline-flex items-center gap-1 px-2 py-0.5 rounded-full bg-accent-2-soft text-sm max-w-[200px]",r),children:[d.jsx("span",{className:"truncate",children:t||e}),d.jsx("button",{type:"button",onClick:n,className:"shrink-0 p-0.5 rounded-full hover:bg-fg-muted/20 transition-colors","aria-label":`Remove ${e}`,children:d.jsx(gr,{className:"size-3"})})]}),Sa=/[\u0000-\u001f\u007f-\u009f\u061c\u200b-\u200f\u2028\u2029\u202a-\u202e\u2066-\u2069\ufeff]/g,Ra=/[<>:"|?*]/g,Ca=/^(con|prn|aux|nul|com[1-9]|lpt[1-9])(\.|$)/i,jn=120,Ta=12,Aa="attachment",Fn=e=>{const t=[...e];if(t.length<=jn)return e;const n=e.lastIndexOf("."),r=n>0&&[...e.slice(n)].length<=Ta?e.slice(n):"",o=jn-[...r].length;return t.slice(0,o).join("")+r},Cl=(e,t=Aa)=>{const r=e.replace(Sa,"").split(/[/\\]/),a=(r[r.length-1]??"").replace(Ra,"_").replace(/^[.\s]+/,"").replace(/[.\s]+$/,"");if(a.length===0)return Fn(t);const i=Ca.test(a)?`_${a}`:a;return Fn(i)},$n=["KB","MB","GB","TB"],Da=e=>{if(!Number.isFinite(e)||e<0)return"unknown size";const t=Math.round(e);if(t<1024)return t===1?"1 byte":`${t} bytes`;const n=1023.95;let r=t/1024,o=0;for(;r>=n&&o<$n.length-1;)r/=1024,o+=1;return`${r.toFixed(1).replace(/\.0$/,"")} ${$n[o]}`},Na=({disabled:e,onAttach:t})=>{const n=s.useRef(null);return d.jsxs(d.Fragment,{children:[d.jsx(un,{variant:"ghost",size:"md","aria-label":"Attach files",title:"Attach files","aria-busy":e,className:"min-h-11 min-w-11 px-2","data-testid":"compose-attach",icon:d.jsx(Ir,{className:"size-4"}),onClick:()=>{e||n.current?.click()}}),d.jsx("input",{ref:n,type:"file",multiple:!0,hidden:!0,"data-testid":"compose-attach-input",onChange:r=>{const o=Array.from(r.currentTarget.files??[]);r.currentTarget.value="",o.length>0&&t(o)}})]})},Oa=({save:e})=>e.status==="saving"?d.jsx("output",{className:"animate-pulse text-xs text-fg-muted",children:"Saving..."}):e.status==="saved"?d.jsx("output",{className:"text-xs text-fg-muted",children:"Draft saved"}):e.status==="error"?d.jsx("output",{className:"text-xs text-danger",children:"Save failed"}):e.status==="unsaved"?d.jsx("output",{className:"truncate text-xs text-warning",children:e.reason}):null;function Ia({send:e,onSend:t,onBlocked:n,onDiscard:r,save:o={status:"idle"},onAttach:a}){const i=e.status==="sending",c=e.status==="blocked"?e.reason:void 0;return d.jsxs("div",{className:"flex items-center justify-between border-t border-line px-3 py-2",children:[d.jsxs("div",{className:"flex min-w-0 items-center gap-3",children:[d.jsx(un,{variant:"primary",size:"md","aria-busy":i,title:c,className:"min-h-11 shrink-0 rounded-full px-4","data-testid":"compose-send",icon:i?d.jsx(yr,{className:"size-4 animate-spin"}):d.jsx(Bo,{className:"size-4"}),onClick:()=>{if(!i){if(c!==void 0){n(c);return}t()}},children:"Send"}),a&&d.jsx(Na,{disabled:i,onAttach:a}),d.jsx(Oa,{save:o})]}),d.jsx(un,{variant:"ghost",size:"md","aria-busy":i,"aria-label":"Discard",className:"min-h-11 min-w-11 px-2 hover:text-danger",icon:d.jsx(Uo,{className:"size-4"}),onClick:()=>{i||r()}})]})}const Bn=e=>/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e.trim()),ka=e=>{const t=e.trim();if(!t)return;const n=t.match(/^(.+?)\s*<([^>]+)>$/);if(n){const r=n[1].trim().replace(/^"(.*)"$/,"$1"),o=n[2].trim();if(Bn(o))return{email:o,displayName:r}}if(Bn(t))return{email:t}},La=e=>{const t=[];let n="",r=!1,o=!1;for(const a of e){if(a==='"'&&(r=!r),a==="<"&&(o=!0),a===">"&&(o=!1),(a===","||a===";")&&!r&&!o){t.push(n),n="";continue}n+=a}return t.push(n),t},Pa=e=>{const t=[],n=[];for(const r of La(e)){const o=ka(r);if(o){t.push(o);continue}r.trim()&&n.push(r.trim())}return{entries:t,unparsed:n.join(", ")}},_a=["Tab",","],Ma=150,ja=({label:e,addresses:t,onChange:n,placeholder:r,suggestions:o=[],onQueryChange:a,onPendingChange:i,ref:c})=>{const[u,m]=s.useState(""),f=s.useRef(null),l=s.useMemo(()=>Pa(u),[u]);s.useEffect(()=>{i?.(l)},[l,i]);const h=s.useRef(void 0),g=s.useCallback(()=>{h.current!==void 0&&(clearTimeout(h.current),h.current=void 0)},[]);s.useEffect(()=>g,[g]);const x=new Set(t.map(b=>b.email.toLowerCase())),p=u.length>=2?o.filter(b=>!x.has(b.email.toLowerCase())):[],E=s.useCallback(b=>{m(b),a?.(b)},[a]),w=s.useCallback(b=>{g(),!x.has(b.email.toLowerCase())&&(n([...t,b]),E(""))},[t,x,n,E,g]),A=s.useCallback(b=>{n(t.filter((P,C)=>C!==b))},[t,n]),y=s.useCallback(b=>{w(b),f.current?.focus()},[w]),v=s.useCallback(()=>{if(g(),l.entries.length===0)return{addresses:t,unparsed:l.unparsed};const b=new Set(x),P=[...t];for(const C of l.entries){const q=C.email.toLowerCase();b.has(q)||(b.add(q),P.push(C))}return n(P),E(l.unparsed),{addresses:P,unparsed:l.unparsed}},[l,t,x,n,E,g]),D=s.useCallback(()=>{g(),E("")},[E,g]);s.useImperativeHandle(c,()=>({commitPending:v,clearPending:D}),[v,D]);const _=s.useRef(v);s.useEffect(()=>{_.current=v},[v]);const S=ga({count:p.length,acceptKeys:_a,onAccept:b=>y(p[b])}),I=s.useMemo(()=>p.map(b=>({value:b.email,label:b.displayName??b.email,...b.displayName?{hint:b.email}:{}})),[p]),N=s.useCallback(b=>{if(b.key==="Backspace"&&u===""&&t.length>0){A(t.length-1);return}S.handleKeyDown(b)||(b.key==="Enter"||b.key==="Tab"||b.key===",")&&u.trim()&&(b.preventDefault(),v())},[u,t.length,A,S.handleKeyDown,v]),F=s.useCallback(()=>{g(),h.current=setTimeout(()=>{h.current=void 0,_.current(),S.dismiss()},Ma)},[g,S.dismiss]);return d.jsxs("div",{className:"relative","data-address-field":e,children:[d.jsxs("div",{className:"flex items-start gap-2",children:[d.jsxs("label",{htmlFor:`address-field-${e}`,className:"text-sm text-fg-muted shrink-0 w-12 pt-1.5",children:[e,":"]}),d.jsxs("div",{className:"flex-1 flex flex-wrap items-center gap-1 min-h-[36px] px-2 py-1 border rounded-md bg-canvas cursor-text",onClick:()=>f.current?.focus(),onKeyDown:b=>{(b.key==="Enter"||b.key===" ")&&f.current?.focus()},children:[t.map((b,P)=>d.jsx(xa,{email:b.email,displayName:b.displayName,onRemove:()=>A(P)},b.email)),d.jsx("input",{ref:f,id:`address-field-${e}`,type:"text",value:u,onChange:b=>{S.reopen(),E(b.target.value)},onKeyDown:N,onBlur:F,placeholder:t.length===0?r:"",className:"flex-1 min-w-[120px] bg-transparent outline-none text-sm py-0.5",autoComplete:"off",...S.comboboxProps})]})]}),S.open&&d.jsx(ya,{id:S.listId,suggestions:I,activeIndex:S.activeIndex,optionId:S.optionId,onPick:b=>{const P=p.find(C=>C.email===b.value);P&&y(P)},onHighlight:S.setActiveIndex,label:`${e} suggestions`,className:"absolute left-12 right-0 z-50 mt-1 max-h-[200px] shadow-lg"})]})},Fa=({state:e})=>e.status==="uploading"?d.jsx(yr,{className:"size-4 shrink-0 animate-spin text-fg-subtle","aria-hidden":!0}):e.status==="failed"?d.jsx(Ho,{className:"size-4 shrink-0 text-danger","aria-hidden":!0}):d.jsx(Ir,{className:"size-4 shrink-0 text-fg-subtle","aria-hidden":!0});function $a({items:e,onRemove:t,onRetry:n,className:r}){return e.length===0?null:d.jsx("ul",{"aria-label":"Attached files","data-testid":"compose-attachments",className:ln("flex flex-col gap-1 px-3 py-2",r),children:e.map(o=>d.jsxs("li",{"data-testid":"compose-attachment","data-state":o.state.status,className:ln("rounded-sm border bg-surface",o.state.status==="failed"?"border-danger/40":"border-line"),children:[d.jsxs("div",{className:"flex items-center gap-2 px-2 py-1.5",children:[d.jsx(Fa,{state:o.state}),d.jsxs("span",{className:"min-w-0 flex-1",children:[d.jsx("bdi",{className:"block truncate text-sm text-fg",title:o.filename,children:o.filename}),d.jsxs("span",{className:"block text-2xs text-fg-subtle",children:[Da(o.sizeBytes),o.state.status==="uploading"?" · Uploading…":""]})]}),o.state.status==="failed"&&o.state.retryable&&d.jsx("button",{type:"button",onClick:()=>n(o.key),className:"text-xs font-medium text-accent hover:underline",children:"Try again"}),d.jsx("button",{type:"button","aria-label":`Remove ${o.filename}`,onClick:()=>t(o.key),className:"inline-flex size-8 shrink-0 items-center justify-center rounded-md text-fg-muted hover:bg-surface-sunken hover:text-fg",children:d.jsx(gr,{className:"size-4","aria-hidden":!0})})]}),o.state.status==="failed"&&d.jsx("p",{role:"alert","data-testid":"compose-attachment-error",className:"border-t border-danger/30 bg-danger-soft px-2 py-1.5 text-xs text-danger",children:o.state.reason})]},o.key))})}const Ba=()=>d.jsxs("div",{"aria-hidden":"true","data-testid":"compose-body-skeleton",className:"min-h-[120px] px-3 py-2",children:[d.jsx("div",{className:"mb-2 h-8 animate-pulse rounded bg-surface-sunken"}),d.jsx("div",{className:"min-h-[80px] animate-pulse rounded bg-surface-sunken/50"})]}),Ua=e=>Array.from(e.dataTransfer?.types??[]).includes("Files");function Ha({banner:e,header:t,children:n,quoted:r,attachments:o,actionBar:a,layout:i="fill",onDropFiles:c}){const u=i==="fill",[m,f]=s.useState(!1),l=c?{onDragOver:h=>{Ua(h)&&(h.preventDefault(),f(!0))},onDragLeave:h=>{h.relatedTarget instanceof Node&&h.currentTarget.contains(h.relatedTarget)||f(!1)},onDrop:h=>{f(!1);const g=Array.from(h.dataTransfer?.files??[]);g.length!==0&&(h.preventDefault(),c(g))}}:{};return d.jsxs("div",{className:[u?"flex h-full min-h-0 flex-col":"flex flex-col",m&&"outline-2 -outline-offset-2 outline-dashed outline-accent"].filter(Boolean).join(" "),"data-testid":"compose-drop-target","data-dropping":m||void 0,...l,children:[e,t,d.jsxs("div",{className:u?"flex min-h-0 flex-1 flex-col overflow-auto":"flex flex-col","data-testid":"compose-body-area",children:[n,r&&d.jsx("div",{className:"shrink-0 px-3 pb-2",children:r})]}),o&&d.jsx("div",{className:"shrink-0",children:o}),u?a:d.jsx("div",{className:"sticky bottom-0 z-10 bg-canvas",children:a})]})}const Kt=({label:e,onClick:t})=>d.jsx("button",{type:"button",onClick:t,className:"text-xs text-fg-muted hover:text-fg transition-colors",children:e}),za=({to:e,cc:t,bcc:n,subject:r})=>{const o=[];return e.length>0&&o.push(`To: ${e.map(a=>a.displayName??a.email).join(", ")}`),t.length>0&&o.push(`Cc: ${t.length}`),n.length>0&&o.push(`Bcc: ${n.length}`),r&&o.push(r),o.join(" · ")},Wa=({collapsed:e=!1,summary:t="",onExpand:n,from:r,to:o,cc:a,bcc:i,subject:c,onShowCc:u,onShowBcc:m})=>e?d.jsxs("button",{type:"button",onClick:n,"aria-label":"Show recipients and subject",className:"flex min-h-11 w-full items-center gap-2 overflow-hidden border-b border-line px-3 py-1.5 text-left transition-colors hover:bg-surface-sunken","data-testid":"compose-header-collapsed",children:[d.jsx("span",{className:"truncate text-xs text-fg-muted",children:t||"…"}),d.jsx(Dr,{className:"ml-auto size-4 shrink-0 text-fg-muted","aria-hidden":"true"})]}):d.jsxs("div",{className:"space-y-1 px-3 py-2 border-b border-line",children:[r,o,a??d.jsxs("div",{className:"flex gap-2 pl-14",children:[d.jsx(Kt,{label:"Cc",onClick:u}),d.jsx(Kt,{label:"Bcc",onClick:m})]}),a&&!i&&d.jsx("div",{className:"pl-14",children:d.jsx(Kt,{label:"Bcc",onClick:m})}),i,c]}),kr="This message is attachments only, and attachments aren't forwarded — a forward would arrive with nothing of the original in it.",Va="This message is attachments only, so there's nothing to quote and your reply goes out without the original.",qa=e=>e==="forward"?kr:Va,Ka=({mode:e})=>d.jsx(wr,{tone:"warning","data-testid":"compose-quote-missing",children:d.jsx("span",{children:qa(e)})}),dn="This account can't send mail until SMTP is configured.",Ya=({onConfigure:e,configureRef:t})=>d.jsxs("div",{role:"alert","data-testid":"compose-smtp-missing-banner",className:"flex items-start gap-3 border-b border-warning/50 bg-warning/10 px-3 py-2",children:[d.jsx(zo,{className:"size-5 shrink-0 mt-0.5 text-warning","aria-hidden":"true"}),d.jsxs("div",{className:"flex-1 min-w-0",children:[d.jsx("p",{className:"text-sm font-medium text-warning",children:dn}),d.jsxs("button",{ref:t,type:"button",onClick:e,"data-testid":"compose-smtp-configure",className:"mt-1 inline-flex items-center gap-1 text-xs font-medium text-warning hover:underline",children:["Configure SMTP",d.jsx(Ea,{className:"size-3","aria-hidden":"true"})]})]})]}),Ga=({value:e,onChange:t})=>d.jsxs("div",{className:"flex items-start gap-2",children:[d.jsx("label",{className:"text-sm text-fg-muted shrink-0 w-12 pt-1.5",children:"Subj:"}),d.jsx("input",{type:"text",value:e,onChange:n=>t(n.target.value),className:"flex-1 px-2 py-1.5 border rounded-md bg-canvas text-sm",placeholder:"Subject","data-subject-field":!0})]}),Xa=({text:e,html:t,senderName:n,date:r})=>{const[o,a]=s.useState(!1);if(!e&&!t)return null;const i=[n,r].filter(Boolean).join(" on ");return d.jsxs("div",{className:"mt-2 px-3 pb-2",children:[d.jsxs("button",{type:"button",onClick:()=>a(!o),"aria-expanded":o,className:"flex items-center gap-1 text-xs text-fg-muted hover:text-fg transition-colors",children:[o?d.jsx(Dr,{className:"size-3"}):d.jsx(Wo,{className:"size-3"}),i?`${i} wrote:`:"Show quoted text"]}),o&&d.jsx("blockquote",{className:"mt-2 pl-3 border-l-2 border-fg-subtle/30 text-sm text-fg-muted [&_a]:text-accent [&_a]:underline [&_blockquote]:pl-3 [&_blockquote]:border-l-2 [&_blockquote]:border-fg-subtle/30",children:t?d.jsx("div",{dangerouslySetInnerHTML:{__html:t}}):e.split(`
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/rich-text-spellcheck-worker-provider-BoNiweeq.js","assets/useSignature-cMh39FpD.js","assets/index-C2US5ZnK.js","assets/index-DS2W4dIw.css","assets/rich-text-spellcheck-provider-J8m9wz6A.js","assets/rich-text-CY6eh-tS.js","assets/roving-focus-C0jnB7ie.js","assets/confirm-dialog-BdT5xj08.js","assets/useMediaQuery-BaUDTtu8.js","assets/bottom-sheet-Bl-_mC2x.js","assets/popover-menu-D4kT-xqh.js","assets/undo-2-BHa76eIs.js","assets/useMessageBodyContent-DwHmQdO9.js","assets/reply-CijQsg4o.js","assets/nav-link-Df_MDzvJ.js","assets/account-form-helpers-DhckT_PN.js","assets/useDebouncedValue-C3FljUyl.js","assets/suggest-list-DJUWGfG3.js","assets/sections-FtpeSpRq.js","assets/chevron-down-DeNyJr8d.js"])))=>i.map(i=>d[i]);
2
+ import{b as vr,j as d,X as gr,p as ln,B as un,L as yr,z as Bo,T as Uo,r as s,y as Ho,d as wr,ag as zo,x as Wo,cx as wn,ci as br,cy as xe,cz as Er,cA as Vo,cB as qo,cC as Se,f as _e,aB as Me,cD as Ko,cE as Yo,cF as xr,cG as Go,az as Sr,aA as Rr,aa as Xo,e as Cr,cH as Qo,Z as Zo,a as At,bS as Jo,cI as Tr,c9 as ea,bU as ta,c as Ar,cJ as na,an as ra,cK as _n,a_ as Mn,cL as oa,ao as aa,cM as sa,cN as ia,aj as R}from"./index-C2US5ZnK.js";import{p as ca,c as la,b as ua}from"./useMessageBodyContent-DwHmQdO9.js";import{w as da,u as fa,a as ma,d as ha}from"./useSignature-cMh39FpD.js";import{b as pa}from"./account-form-helpers-DhckT_PN.js";import{u as va}from"./useDebouncedValue-C3FljUyl.js";import{u as ga,S as ya}from"./suggest-list-DJUWGfG3.js";import"./nav-link-Df_MDzvJ.js";import"./reply-CijQsg4o.js";import{b as wa}from"./sections-FtpeSpRq.js";import{u as ba}from"./useMediaQuery-BaUDTtu8.js";import{C as Dr}from"./chevron-down-DeNyJr8d.js";const Nr={name:"arrow-right",size:24,node:[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]};Nr.node;const Ea=vr(Nr);const Or={name:"paperclip",size:24,node:[["path",{d:"m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551",key:"1miecu"}]]};Or.node;const Ir=vr(Or),xa=({email:e,displayName:t,onRemove:n,className:r})=>d.jsxs("span",{className:ln("inline-flex items-center gap-1 px-2 py-0.5 rounded-full bg-accent-2-soft text-sm max-w-[200px]",r),children:[d.jsx("span",{className:"truncate",children:t||e}),d.jsx("button",{type:"button",onClick:n,className:"shrink-0 p-0.5 rounded-full hover:bg-fg-muted/20 transition-colors","aria-label":`Remove ${e}`,children:d.jsx(gr,{className:"size-3"})})]}),Sa=/[\u0000-\u001f\u007f-\u009f\u061c\u200b-\u200f\u2028\u2029\u202a-\u202e\u2066-\u2069\ufeff]/g,Ra=/[<>:"|?*]/g,Ca=/^(con|prn|aux|nul|com[1-9]|lpt[1-9])(\.|$)/i,jn=120,Ta=12,Aa="attachment",Fn=e=>{const t=[...e];if(t.length<=jn)return e;const n=e.lastIndexOf("."),r=n>0&&[...e.slice(n)].length<=Ta?e.slice(n):"",o=jn-[...r].length;return t.slice(0,o).join("")+r},Cl=(e,t=Aa)=>{const r=e.replace(Sa,"").split(/[/\\]/),a=(r[r.length-1]??"").replace(Ra,"_").replace(/^[.\s]+/,"").replace(/[.\s]+$/,"");if(a.length===0)return Fn(t);const i=Ca.test(a)?`_${a}`:a;return Fn(i)},$n=["KB","MB","GB","TB"],Da=e=>{if(!Number.isFinite(e)||e<0)return"unknown size";const t=Math.round(e);if(t<1024)return t===1?"1 byte":`${t} bytes`;const n=1023.95;let r=t/1024,o=0;for(;r>=n&&o<$n.length-1;)r/=1024,o+=1;return`${r.toFixed(1).replace(/\.0$/,"")} ${$n[o]}`},Na=({disabled:e,onAttach:t})=>{const n=s.useRef(null);return d.jsxs(d.Fragment,{children:[d.jsx(un,{variant:"ghost",size:"md","aria-label":"Attach files",title:"Attach files","aria-busy":e,className:"min-h-11 min-w-11 px-2","data-testid":"compose-attach",icon:d.jsx(Ir,{className:"size-4"}),onClick:()=>{e||n.current?.click()}}),d.jsx("input",{ref:n,type:"file",multiple:!0,hidden:!0,"data-testid":"compose-attach-input",onChange:r=>{const o=Array.from(r.currentTarget.files??[]);r.currentTarget.value="",o.length>0&&t(o)}})]})},Oa=({save:e})=>e.status==="saving"?d.jsx("output",{className:"animate-pulse text-xs text-fg-muted",children:"Saving..."}):e.status==="saved"?d.jsx("output",{className:"text-xs text-fg-muted",children:"Draft saved"}):e.status==="error"?d.jsx("output",{className:"text-xs text-danger",children:"Save failed"}):e.status==="unsaved"?d.jsx("output",{className:"truncate text-xs text-warning",children:e.reason}):null;function Ia({send:e,onSend:t,onBlocked:n,onDiscard:r,save:o={status:"idle"},onAttach:a}){const i=e.status==="sending",c=e.status==="blocked"?e.reason:void 0;return d.jsxs("div",{className:"flex items-center justify-between border-t border-line px-3 py-2",children:[d.jsxs("div",{className:"flex min-w-0 items-center gap-3",children:[d.jsx(un,{variant:"primary",size:"md","aria-busy":i,title:c,className:"min-h-11 shrink-0 rounded-full px-4","data-testid":"compose-send",icon:i?d.jsx(yr,{className:"size-4 animate-spin"}):d.jsx(Bo,{className:"size-4"}),onClick:()=>{if(!i){if(c!==void 0){n(c);return}t()}},children:"Send"}),a&&d.jsx(Na,{disabled:i,onAttach:a}),d.jsx(Oa,{save:o})]}),d.jsx(un,{variant:"ghost",size:"md","aria-busy":i,"aria-label":"Discard",className:"min-h-11 min-w-11 px-2 hover:text-danger",icon:d.jsx(Uo,{className:"size-4"}),onClick:()=>{i||r()}})]})}const Bn=e=>/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e.trim()),ka=e=>{const t=e.trim();if(!t)return;const n=t.match(/^(.+?)\s*<([^>]+)>$/);if(n){const r=n[1].trim().replace(/^"(.*)"$/,"$1"),o=n[2].trim();if(Bn(o))return{email:o,displayName:r}}if(Bn(t))return{email:t}},La=e=>{const t=[];let n="",r=!1,o=!1;for(const a of e){if(a==='"'&&(r=!r),a==="<"&&(o=!0),a===">"&&(o=!1),(a===","||a===";")&&!r&&!o){t.push(n),n="";continue}n+=a}return t.push(n),t},Pa=e=>{const t=[],n=[];for(const r of La(e)){const o=ka(r);if(o){t.push(o);continue}r.trim()&&n.push(r.trim())}return{entries:t,unparsed:n.join(", ")}},_a=["Tab",","],Ma=150,ja=({label:e,addresses:t,onChange:n,placeholder:r,suggestions:o=[],onQueryChange:a,onPendingChange:i,ref:c})=>{const[u,m]=s.useState(""),f=s.useRef(null),l=s.useMemo(()=>Pa(u),[u]);s.useEffect(()=>{i?.(l)},[l,i]);const h=s.useRef(void 0),g=s.useCallback(()=>{h.current!==void 0&&(clearTimeout(h.current),h.current=void 0)},[]);s.useEffect(()=>g,[g]);const x=new Set(t.map(b=>b.email.toLowerCase())),p=u.length>=2?o.filter(b=>!x.has(b.email.toLowerCase())):[],E=s.useCallback(b=>{m(b),a?.(b)},[a]),w=s.useCallback(b=>{g(),!x.has(b.email.toLowerCase())&&(n([...t,b]),E(""))},[t,x,n,E,g]),A=s.useCallback(b=>{n(t.filter((P,C)=>C!==b))},[t,n]),y=s.useCallback(b=>{w(b),f.current?.focus()},[w]),v=s.useCallback(()=>{if(g(),l.entries.length===0)return{addresses:t,unparsed:l.unparsed};const b=new Set(x),P=[...t];for(const C of l.entries){const q=C.email.toLowerCase();b.has(q)||(b.add(q),P.push(C))}return n(P),E(l.unparsed),{addresses:P,unparsed:l.unparsed}},[l,t,x,n,E,g]),D=s.useCallback(()=>{g(),E("")},[E,g]);s.useImperativeHandle(c,()=>({commitPending:v,clearPending:D}),[v,D]);const _=s.useRef(v);s.useEffect(()=>{_.current=v},[v]);const S=ga({count:p.length,acceptKeys:_a,onAccept:b=>y(p[b])}),I=s.useMemo(()=>p.map(b=>({value:b.email,label:b.displayName??b.email,...b.displayName?{hint:b.email}:{}})),[p]),N=s.useCallback(b=>{if(b.key==="Backspace"&&u===""&&t.length>0){A(t.length-1);return}S.handleKeyDown(b)||(b.key==="Enter"||b.key==="Tab"||b.key===",")&&u.trim()&&(b.preventDefault(),v())},[u,t.length,A,S.handleKeyDown,v]),F=s.useCallback(()=>{g(),h.current=setTimeout(()=>{h.current=void 0,_.current(),S.dismiss()},Ma)},[g,S.dismiss]);return d.jsxs("div",{className:"relative","data-address-field":e,children:[d.jsxs("div",{className:"flex items-start gap-2",children:[d.jsxs("label",{htmlFor:`address-field-${e}`,className:"text-sm text-fg-muted shrink-0 w-12 pt-1.5",children:[e,":"]}),d.jsxs("div",{className:"flex-1 flex flex-wrap items-center gap-1 min-h-[36px] px-2 py-1 border rounded-md bg-canvas cursor-text",onClick:()=>f.current?.focus(),onKeyDown:b=>{(b.key==="Enter"||b.key===" ")&&f.current?.focus()},children:[t.map((b,P)=>d.jsx(xa,{email:b.email,displayName:b.displayName,onRemove:()=>A(P)},b.email)),d.jsx("input",{ref:f,id:`address-field-${e}`,type:"text",value:u,onChange:b=>{S.reopen(),E(b.target.value)},onKeyDown:N,onBlur:F,placeholder:t.length===0?r:"",className:"flex-1 min-w-[120px] bg-transparent outline-none text-sm py-0.5",autoComplete:"off",...S.comboboxProps})]})]}),S.open&&d.jsx(ya,{id:S.listId,suggestions:I,activeIndex:S.activeIndex,optionId:S.optionId,onPick:b=>{const P=p.find(C=>C.email===b.value);P&&y(P)},onHighlight:S.setActiveIndex,label:`${e} suggestions`,className:"absolute left-12 right-0 z-50 mt-1 max-h-[200px] shadow-lg"})]})},Fa=({state:e})=>e.status==="uploading"?d.jsx(yr,{className:"size-4 shrink-0 animate-spin text-fg-subtle","aria-hidden":!0}):e.status==="failed"?d.jsx(Ho,{className:"size-4 shrink-0 text-danger","aria-hidden":!0}):d.jsx(Ir,{className:"size-4 shrink-0 text-fg-subtle","aria-hidden":!0});function $a({items:e,onRemove:t,onRetry:n,className:r}){return e.length===0?null:d.jsx("ul",{"aria-label":"Attached files","data-testid":"compose-attachments",className:ln("flex flex-col gap-1 px-3 py-2",r),children:e.map(o=>d.jsxs("li",{"data-testid":"compose-attachment","data-state":o.state.status,className:ln("rounded-sm border bg-surface",o.state.status==="failed"?"border-danger/40":"border-line"),children:[d.jsxs("div",{className:"flex items-center gap-2 px-2 py-1.5",children:[d.jsx(Fa,{state:o.state}),d.jsxs("span",{className:"min-w-0 flex-1",children:[d.jsx("bdi",{className:"block truncate text-sm text-fg",title:o.filename,children:o.filename}),d.jsxs("span",{className:"block text-2xs text-fg-subtle",children:[Da(o.sizeBytes),o.state.status==="uploading"?" · Uploading…":""]})]}),o.state.status==="failed"&&o.state.retryable&&d.jsx("button",{type:"button",onClick:()=>n(o.key),className:"text-xs font-medium text-accent hover:underline",children:"Try again"}),d.jsx("button",{type:"button","aria-label":`Remove ${o.filename}`,onClick:()=>t(o.key),className:"inline-flex size-8 shrink-0 items-center justify-center rounded-md text-fg-muted hover:bg-surface-sunken hover:text-fg",children:d.jsx(gr,{className:"size-4","aria-hidden":!0})})]}),o.state.status==="failed"&&d.jsx("p",{role:"alert","data-testid":"compose-attachment-error",className:"border-t border-danger/30 bg-danger-soft px-2 py-1.5 text-xs text-danger",children:o.state.reason})]},o.key))})}const Ba=()=>d.jsxs("div",{"aria-hidden":"true","data-testid":"compose-body-skeleton",className:"min-h-[120px] px-3 py-2",children:[d.jsx("div",{className:"mb-2 h-8 animate-pulse rounded bg-surface-sunken"}),d.jsx("div",{className:"min-h-[80px] animate-pulse rounded bg-surface-sunken/50"})]}),Ua=e=>Array.from(e.dataTransfer?.types??[]).includes("Files");function Ha({banner:e,header:t,children:n,quoted:r,attachments:o,actionBar:a,layout:i="fill",onDropFiles:c}){const u=i==="fill",[m,f]=s.useState(!1),l=c?{onDragOver:h=>{Ua(h)&&(h.preventDefault(),f(!0))},onDragLeave:h=>{h.relatedTarget instanceof Node&&h.currentTarget.contains(h.relatedTarget)||f(!1)},onDrop:h=>{f(!1);const g=Array.from(h.dataTransfer?.files??[]);g.length!==0&&(h.preventDefault(),c(g))}}:{};return d.jsxs("div",{className:[u?"flex h-full min-h-0 flex-col":"flex flex-col",m&&"outline-2 -outline-offset-2 outline-dashed outline-accent"].filter(Boolean).join(" "),"data-testid":"compose-drop-target","data-dropping":m||void 0,...l,children:[e,t,d.jsxs("div",{className:u?"flex min-h-0 flex-1 flex-col overflow-auto":"flex flex-col","data-testid":"compose-body-area",children:[n,r&&d.jsx("div",{className:"shrink-0 px-3 pb-2",children:r})]}),o&&d.jsx("div",{className:"shrink-0",children:o}),u?a:d.jsx("div",{className:"sticky bottom-0 z-10 bg-canvas",children:a})]})}const Kt=({label:e,onClick:t})=>d.jsx("button",{type:"button",onClick:t,className:"text-xs text-fg-muted hover:text-fg transition-colors",children:e}),za=({to:e,cc:t,bcc:n,subject:r})=>{const o=[];return e.length>0&&o.push(`To: ${e.map(a=>a.displayName??a.email).join(", ")}`),t.length>0&&o.push(`Cc: ${t.length}`),n.length>0&&o.push(`Bcc: ${n.length}`),r&&o.push(r),o.join(" · ")},Wa=({collapsed:e=!1,summary:t="",onExpand:n,from:r,to:o,cc:a,bcc:i,subject:c,onShowCc:u,onShowBcc:m})=>e?d.jsxs("button",{type:"button",onClick:n,"aria-label":"Show recipients and subject",className:"flex min-h-11 w-full items-center gap-2 overflow-hidden border-b border-line px-3 py-1.5 text-left transition-colors hover:bg-surface-sunken","data-testid":"compose-header-collapsed",children:[d.jsx("span",{className:"truncate text-xs text-fg-muted",children:t||"…"}),d.jsx(Dr,{className:"ml-auto size-4 shrink-0 text-fg-muted","aria-hidden":"true"})]}):d.jsxs("div",{className:"space-y-1 px-3 py-2 border-b border-line",children:[r,o,a??d.jsxs("div",{className:"flex gap-2 pl-14",children:[d.jsx(Kt,{label:"Cc",onClick:u}),d.jsx(Kt,{label:"Bcc",onClick:m})]}),a&&!i&&d.jsx("div",{className:"pl-14",children:d.jsx(Kt,{label:"Bcc",onClick:m})}),i,c]}),kr="This message is attachments only, and attachments aren't forwarded — a forward would arrive with nothing of the original in it.",Va="This message is attachments only, so there's nothing to quote and your reply goes out without the original.",qa=e=>e==="forward"?kr:Va,Ka=({mode:e})=>d.jsx(wr,{tone:"warning","data-testid":"compose-quote-missing",children:d.jsx("span",{children:qa(e)})}),dn="This account can't send mail until SMTP is configured.",Ya=({onConfigure:e,configureRef:t})=>d.jsxs("div",{role:"alert","data-testid":"compose-smtp-missing-banner",className:"flex items-start gap-3 border-b border-warning/50 bg-warning/10 px-3 py-2",children:[d.jsx(zo,{className:"size-5 shrink-0 mt-0.5 text-warning","aria-hidden":"true"}),d.jsxs("div",{className:"flex-1 min-w-0",children:[d.jsx("p",{className:"text-sm font-medium text-warning",children:dn}),d.jsxs("button",{ref:t,type:"button",onClick:e,"data-testid":"compose-smtp-configure",className:"mt-1 inline-flex items-center gap-1 text-xs font-medium text-warning hover:underline",children:["Configure SMTP",d.jsx(Ea,{className:"size-3","aria-hidden":"true"})]})]})]}),Ga=({value:e,onChange:t})=>d.jsxs("div",{className:"flex items-start gap-2",children:[d.jsx("label",{className:"text-sm text-fg-muted shrink-0 w-12 pt-1.5",children:"Subj:"}),d.jsx("input",{type:"text",value:e,onChange:n=>t(n.target.value),className:"flex-1 px-2 py-1.5 border rounded-md bg-canvas text-sm",placeholder:"Subject","data-subject-field":!0})]}),Xa=({text:e,html:t,senderName:n,date:r})=>{const[o,a]=s.useState(!1);if(!e&&!t)return null;const i=[n,r].filter(Boolean).join(" on ");return d.jsxs("div",{className:"mt-2 px-3 pb-2",children:[d.jsxs("button",{type:"button",onClick:()=>a(!o),"aria-expanded":o,className:"flex items-center gap-1 text-xs text-fg-muted hover:text-fg transition-colors",children:[o?d.jsx(Dr,{className:"size-3"}):d.jsx(Wo,{className:"size-3"}),i?`${i} wrote:`:"Show quoted text"]}),o&&d.jsx("blockquote",{className:"mt-2 pl-3 border-l-2 border-fg-subtle/30 text-sm text-fg-muted [&_a]:text-accent [&_a]:underline [&_blockquote]:pl-3 [&_blockquote]:border-l-2 [&_blockquote]:border-fg-subtle/30",children:t?d.jsx("div",{dangerouslySetInnerHTML:{__html:t}}):e.split(`
3
3
  `).map((c,u)=>d.jsx("p",{className:"min-h-[1.2em]",children:c},u))})]})},Qa=["p","br","div","h1","h2","h3","h4","h5","h6","strong","b","em","i","u","s","ul","ol","li","blockquote","pre","code","hr","table","thead","tbody","tr","th","td","a","img"],Za=["href","src","alt","colspan","rowspan","lang","dir"],Ja=/^(?:https?:|mailto:)/i,es=/^(?:https:|data:image\/)/i,ts=/^cid:(.+)$/i,fn=()=>!1;let mn=fn;const ns=e=>{const t=ts.exec(e);return t?mn(t[1]):es.test(e)},rs="max-width:100%;height:auto",os=e=>{const t=ca();if(!t.isSupported)throw new Error("adopted HTML cannot be sanitized: no DOM is available");return t.addHook("afterSanitizeAttributes",n=>{if(n.tagName==="A"){Ja.test(n.getAttribute("href")??"")||n.removeAttribute("href"),e==="quoted"&&(n.setAttribute("target","_blank"),n.setAttribute("rel","noopener noreferrer nofollow"));return}if(n.tagName==="IMG"){if(e==="quoted"){n.remove();return}if(!ns(n.getAttribute("src")??"")){n.remove();return}n.setAttribute("style",rs)}}),t},Un=new Map,as=e=>{const t=Un.get(e);if(t)return t;const n=os(e);return Un.set(e,n),n},Lr=(e,t)=>as(t).sanitize(e,{ALLOWED_TAGS:Qa,ALLOWED_ATTR:Za,ALLOW_DATA_ATTR:!1,ALLOW_ARIA_ATTR:!1}),Tl=(e,t=fn)=>{mn=t;try{return Lr(e,"outgoing")}finally{mn=fn}},ss=e=>Lr(e,"quoted"),is=e=>typeof e=="string"&&e.length>0?"rich":"plain",Al=(e,t)=>t.length>0,cs={plain:"Couldn't switch to plain text",rich:"Couldn't switch to rich text"},Dl=(e,t,n)=>t.trim()===""||n.trim()!==""?{outcome:"switch"}:{outcome:"blocked",title:cs[e],detail:"The conversion came back empty, so your message is unchanged."};function Re(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e?.(o),n===!1||!o||!o.defaultPrevented)return t?.(o)}}function Hn(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function ls(...e){return t=>{let n=!1;const r=e.map(o=>{const a=Hn(o,t);return!n&&typeof a=="function"&&(n=!0),a});if(n)return()=>{for(let o=0;o<r.length;o++){const a=r[o];typeof a=="function"?a():Hn(e[o],null)}}}}function je(...e){return s.useCallback(ls(...e),e)}function us(e,t=[]){let n=[];function r(a,i){const c=s.createContext(i);c.displayName=a+"Context";const u=n.length;n=[...n,i];const m=l=>{const{scope:h,children:g,...x}=l,p=h?.[e]?.[u]||c,E=s.useMemo(()=>x,Object.values(x));return d.jsx(p.Provider,{value:E,children:g})};m.displayName=a+"Provider";function f(l,h,g={}){const{optional:x=!1}=g,p=h?.[e]?.[u]||c,E=s.useContext(p);if(E)return E;if(i!==void 0)return i;if(!x)throw new Error(`\`${l}\` must be used within \`${a}\``)}return[m,f]}const o=()=>{const a=n.map(i=>s.createContext(i));return function(c){const u=c?.[e]||a;return s.useMemo(()=>({[`__scope${e}`]:{...c,[e]:u}}),[c,u])}};return o.scopeName=e,[r,ds(o,...t)]}function ds(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(a){const i=r.reduce((c,{useScope:u,scopeName:m})=>{const l=u(a)[`__scope${m}`];return{...c,...l}},{});return s.useMemo(()=>({[`__scope${t.scopeName}`]:i}),[i])}};return n.scopeName=t.scopeName,n}var nt=globalThis?.document?s.useLayoutEffect:()=>{},fs=wn[" useInsertionEffect ".trim().toString()]||nt;function ms({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[o,a,i]=hs({defaultProp:t,onChange:n}),c=e!==void 0,u=c?e:o;{const f=s.useRef(e!==void 0);s.useEffect(()=>{const l=f.current;l!==c&&console.warn(`${r} is changing from ${l?"controlled":"uncontrolled"} to ${c?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),f.current=c},[c,r])}const m=s.useCallback(f=>{if(c){const l=ps(f)?f(e):f;l!==e&&i.current?.(l)}else a(f)},[c,e,a,i]);return[u,m]}function hs({defaultProp:e,onChange:t}){const[n,r]=s.useState(e),o=s.useRef(n),a=s.useRef(t);return fs(()=>{a.current=t},[t]),s.useEffect(()=>{o.current!==n&&(a.current?.(n),o.current=n)},[n,o]),[n,r,a]}function ps(e){return typeof e=="function"}function Pr(e){const t=s.forwardRef((n,r)=>{let{children:o,...a}=n,i=null,c=!1;const u=[];zn(o)&&typeof pt=="function"&&(o=pt(o._payload)),s.Children.forEach(o,h=>{if(bs(h)){c=!0;const g=h;let x="child"in g.props?g.props.child:g.props.children;zn(x)&&typeof pt=="function"&&(x=pt(x._payload)),i=gs(g,x),u.push(i?.props?.children)}else u.push(h)}),i?i=s.cloneElement(i,void 0,u):!c&&s.Children.count(o)===1&&s.isValidElement(o)&&(i=o);const m=i?ws(i):void 0,f=je(r,m);if(!i){if(o||o===0)throw new Error(c?Rs(e):Ss(e));return o}const l=ys(a,i.props??{});return i.type!==s.Fragment&&(l.ref=r?f:m),s.cloneElement(i,l)});return t.displayName=`${e}.Slot`,t}var vs=Symbol.for("radix.slottable"),gs=(e,t)=>{if("child"in e.props){const n=e.props.child;return s.isValidElement(n)?s.cloneElement(n,void 0,e.props.children(n.props.children)):null}return s.isValidElement(t)?t:null};function ys(e,t){const n={...t};for(const r in t){const o=e[r],a=t[r];/^on[A-Z]/.test(r)?o&&a?n[r]=(...c)=>{const u=a(...c);return o(...c),u}:o&&(n[r]=o):r==="style"?n[r]={...o,...a}:r==="className"&&(n[r]=[o,a].filter(Boolean).join(" "))}return{...e,...n}}function ws(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function bs(e){return s.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===vs}var Es=Symbol.for("react.lazy");function zn(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===Es&&"_payload"in e&&xs(e._payload)}function xs(e){return typeof e=="object"&&e!==null&&"then"in e}var Ss=e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,Rs=e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,pt=wn[" use ".trim().toString()],Cs=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],ge=Cs.reduce((e,t)=>{const n=Pr(`Primitive.${t}`),r=s.forwardRef((o,a)=>{const{asChild:i,...c}=o,u=i?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),d.jsx(u,{...c,ref:a})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function Ts(e,t){e&&br.flushSync(()=>e.dispatchEvent(t))}function rt(e){const t=s.useRef(e);return s.useEffect(()=>{t.current=e}),s.useMemo(()=>((...n)=>t.current?.(...n)),[])}var As="DismissableLayer",hn="dismissableLayer.update",Ds="dismissableLayer.pointerDownOutside",Ns="dismissableLayer.focusOutside",Wn,bn=s.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),_r=s.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,deferPointerDownOutside:r=!1,onEscapeKeyDown:o,onPointerDownOutside:a,onFocusOutside:i,onInteractOutside:c,onDismiss:u,...m}=e,f=s.useContext(bn),[l,h]=s.useState(null),g=l?.ownerDocument??globalThis?.document,[,x]=s.useState({}),p=je(t,h),E=Array.from(f.layers),[w]=[...f.layersWithOutsidePointerEventsDisabled].slice(-1),A=w?E.indexOf(w):-1,y=l?E.indexOf(l):-1,v=f.layersWithOutsidePointerEventsDisabled.size>0,D=y>=A,_=s.useRef(!1),S=Ps(b=>{a?.(b),c?.(b),b.defaultPrevented||u?.()},{ownerDocument:g,deferPointerDownOutside:r,isDeferredPointerDownOutsideRef:_,dismissableSurfaces:f.dismissableSurfaces,shouldHandlePointerDownOutside:s.useCallback(b=>{if(!(b instanceof Node))return!1;const P=[...f.branches].some(C=>C.contains(b));return D&&!P},[f.branches,D])}),I=_s(b=>{if(r&&_.current)return;const P=b.target;[...f.branches].some(q=>q.contains(P))||(i?.(b),c?.(b),b.defaultPrevented||u?.())},g),N=l?y===E.length-1:!1,F=rt(b=>{b.key==="Escape"&&(o?.(b),!b.defaultPrevented&&u&&(b.preventDefault(),u()))});return s.useEffect(()=>{if(N)return g.addEventListener("keydown",F,{capture:!0}),()=>g.removeEventListener("keydown",F,{capture:!0})},[g,N,F]),s.useEffect(()=>{if(l)return n&&(f.layersWithOutsidePointerEventsDisabled.size===0&&(Wn=g.body.style.pointerEvents,g.body.style.pointerEvents="none"),f.layersWithOutsidePointerEventsDisabled.add(l)),f.layers.add(l),Vn(),()=>{n&&(f.layersWithOutsidePointerEventsDisabled.delete(l),f.layersWithOutsidePointerEventsDisabled.size===0&&(g.body.style.pointerEvents=Wn))}},[l,g,n,f]),s.useEffect(()=>()=>{l&&(f.layers.delete(l),f.layersWithOutsidePointerEventsDisabled.delete(l),Vn())},[l,f]),s.useEffect(()=>{const b=()=>x({});return document.addEventListener(hn,b),()=>document.removeEventListener(hn,b)},[]),d.jsx(ge.div,{...m,ref:p,style:{pointerEvents:v?D?"auto":"none":void 0,...e.style},onFocusCapture:Re(e.onFocusCapture,I.onFocusCapture),onBlurCapture:Re(e.onBlurCapture,I.onBlurCapture),onPointerDownCapture:Re(e.onPointerDownCapture,S.onPointerDownCapture)})});_r.displayName=As;var Os="DismissableLayerBranch",Is=s.forwardRef((e,t)=>{const n=s.useContext(bn),r=s.useRef(null),o=je(t,r);return s.useEffect(()=>{const a=r.current;if(a)return n.branches.add(a),()=>{n.branches.delete(a)}},[n.branches]),d.jsx(ge.div,{...e,ref:o})});Is.displayName=Os;function ks(){const e=s.useContext(bn),[t,n]=s.useState(null);return s.useEffect(()=>{if(t)return e.dismissableSurfaces.add(t),()=>{e.dismissableSurfaces.delete(t)}},[t,e.dismissableSurfaces]),n}var Ls=()=>!0;function Ps(e,t){const{ownerDocument:n=globalThis?.document,deferPointerDownOutside:r=!1,isDeferredPointerDownOutsideRef:o,dismissableSurfaces:a,shouldHandlePointerDownOutside:i=Ls}=t,c=rt(e),u=s.useRef(!1),m=s.useRef(!1),f=s.useRef(new Map),l=s.useRef(()=>{});return s.useEffect(()=>{function h(){m.current=!1,o.current=!1,f.current.clear()}function g(){return Array.from(f.current.values()).some(Boolean)}function x(y){if(!m.current)return;const v=y.target;v instanceof Node&&[...a].some(_=>_.contains(v))||f.current.set(y.type,!0),y.type==="click"&&window.setTimeout(()=>{m.current&&l.current()},0)}function p(y){m.current&&f.current.set(y.type,!1)}const E=y=>{if(y.target&&!u.current){let v=function(){n.removeEventListener("click",l.current);const _=g();h(),_||Mr(Ds,c,D,{discrete:!0})};if(!i(y.target)){n.removeEventListener("click",l.current),h(),u.current=!1;return}const D={originalEvent:y};m.current=!0,o.current=r&&y.button===0,f.current.clear(),!r||y.button!==0?v():(n.removeEventListener("click",l.current),l.current=v,n.addEventListener("click",l.current,{once:!0}))}else n.removeEventListener("click",l.current),h();u.current=!1},w=["pointerup","mousedown","mouseup","touchstart","touchend","click"];for(const y of w)n.addEventListener(y,x,!0),n.addEventListener(y,p);const A=window.setTimeout(()=>{n.addEventListener("pointerdown",E)},0);return()=>{window.clearTimeout(A),n.removeEventListener("pointerdown",E),n.removeEventListener("click",l.current);for(const y of w)n.removeEventListener(y,x,!0),n.removeEventListener(y,p)}},[n,c,r,o,a,i]),{onPointerDownCapture:()=>u.current=!0}}function _s(e,t=globalThis?.document){const n=rt(e),r=s.useRef(!1);return s.useEffect(()=>{const o=a=>{a.target&&!r.current&&Mr(Ns,n,{originalEvent:a},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function Vn(){const e=new CustomEvent(hn);document.dispatchEvent(e)}function Mr(e,t,n,{discrete:r}){const o=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?Ts(o,a):o.dispatchEvent(a)}var vt=0,Be=null;function Ms(){s.useEffect(()=>{Be||(Be={start:qn(),end:qn()});const{start:e,end:t}=Be;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement("afterbegin",e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement("beforeend",t),vt++,()=>{vt===1&&(Be?.start.remove(),Be?.end.remove(),Be=null),vt=Math.max(0,vt-1)}},[])}function qn(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var Yt="focusScope.autoFocusOnMount",Gt="focusScope.autoFocusOnUnmount",Kn={bubbles:!1,cancelable:!0},js="FocusScope",jr=s.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:a,...i}=e,[c,u]=s.useState(null),m=rt(o),f=rt(a),l=s.useRef(null),h=je(t,u),g=s.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;s.useEffect(()=>{if(r){let p=function(y){if(g.paused||!c)return;const v=y.target;c.contains(v)?l.current=v:Ee(l.current,{select:!0})},E=function(y){if(g.paused||!c)return;const v=y.relatedTarget;v!==null&&(c.contains(v)||Ee(l.current,{select:!0}))},w=function(y){if(document.activeElement===document.body)for(const D of y)D.removedNodes.length>0&&Ee(c)};document.addEventListener("focusin",p),document.addEventListener("focusout",E);const A=new MutationObserver(w);return c&&A.observe(c,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",p),document.removeEventListener("focusout",E),A.disconnect()}}},[r,c,g.paused]),s.useEffect(()=>{if(c){Gn.add(g);const p=document.activeElement;if(!c.contains(p)){const w=new CustomEvent(Yt,Kn);c.addEventListener(Yt,m),c.dispatchEvent(w),w.defaultPrevented||(Fs(zs(Fr(c)),{select:!0}),document.activeElement===p&&Ee(c))}return()=>{c.removeEventListener(Yt,m),setTimeout(()=>{const w=new CustomEvent(Gt,Kn);c.addEventListener(Gt,f),c.dispatchEvent(w),w.defaultPrevented||Ee(p??document.body,{select:!0}),c.removeEventListener(Gt,f),Gn.remove(g)},0)}}},[c,m,f,g]);const x=s.useCallback(p=>{if(!n&&!r||g.paused)return;const E=p.key==="Tab"&&!p.altKey&&!p.ctrlKey&&!p.metaKey,w=document.activeElement;if(E&&w){const A=p.currentTarget,[y,v]=$s(A);y&&v?!p.shiftKey&&w===v?(p.preventDefault(),n&&Ee(y,{select:!0})):p.shiftKey&&w===y&&(p.preventDefault(),n&&Ee(v,{select:!0})):w===A&&p.preventDefault()}},[n,r,g.paused]);return d.jsx(ge.div,{tabIndex:-1,...i,ref:h,onKeyDown:x})});jr.displayName=js;function Fs(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(Ee(r,{select:t}),document.activeElement!==n)return}function $s(e){const t=Fr(e),n=Yn(t,e),r=Yn(t.reverse(),e);return[n,r]}function Fr(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const o=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||o?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function Yn(e,t){const n=typeof t.checkVisibility=="function"&&t.checkVisibility({checkVisibilityCSS:!0});for(const r of e)if(!(n?!r.checkVisibility({checkVisibilityCSS:!0}):Bs(r,{upTo:t})))return r}function Bs(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function Us(e){return e instanceof HTMLInputElement&&"select"in e}function Ee(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&Us(e)&&t&&e.select()}}var Gn=Hs();function Hs(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=Xn(e,t),e.unshift(t)},remove(t){e=Xn(e,t),e[0]?.resume()}}}function Xn(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function zs(e){return e.filter(t=>t.tagName!=="A")}var Ws=wn[" useId ".trim().toString()]||(()=>{}),Vs=0;function Xt(e){const[t,n]=s.useState(Ws());return nt(()=>{n(r=>r??String(Vs++))},[e]),e||(t?`radix-${t}`:"")}var qs="Portal",$r=s.forwardRef((e,t)=>{const{container:n,...r}=e,[o,a]=s.useState(!1);nt(()=>a(!0),[]);const i=n||o&&globalThis?.document?.body;return i?br.createPortal(d.jsx(ge.div,{...r,ref:t}),i):null});$r.displayName=qs;function Ks(e,t){return s.useReducer((n,r)=>t[n][r]??n,e)}var Ot=e=>{const{present:t,children:n}=e,r=Ys(t),o=typeof n=="function"?n({present:r.isPresent}):s.Children.only(n),a=Gs(r.ref,Xs(o));return typeof n=="function"||r.isPresent?s.cloneElement(o,{ref:a}):null};Ot.displayName="Presence";function Ys(e){const[t,n]=s.useState(),r=s.useRef(null),o=s.useRef(e),a=s.useRef("none"),i=s.useRef(void 0),c=e?"mounted":"unmounted",[u,m]=Ks(c,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return s.useEffect(()=>{u==="mounted"?(a.current=i.current??Je(r.current),i.current=void 0):a.current="none"},[u]),nt(()=>{const f=r.current,l=o.current;if(l!==e){const g=a.current,x=Je(f);e?(i.current=x,m("MOUNT")):x==="none"||f?.display==="none"?m("UNMOUNT"):m(l&&g!==x?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,m]),nt(()=>{if(t){let f;const l=t.ownerDocument.defaultView??window,h=x=>{const E=Je(r.current).includes(CSS.escape(x.animationName));if(x.target===t&&E&&(m("ANIMATION_END"),!o.current)){const w=t.style.animationFillMode;t.style.animationFillMode="forwards",f=l.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=w)})}},g=x=>{x.target===t&&(a.current=Je(r.current))};return t.addEventListener("animationstart",g),t.addEventListener("animationcancel",h),t.addEventListener("animationend",h),()=>{l.clearTimeout(f),t.removeEventListener("animationstart",g),t.removeEventListener("animationcancel",h),t.removeEventListener("animationend",h)}}else m("ANIMATION_END")},[t,m]),{isPresent:["mounted","unmountSuspended"].includes(u),ref:s.useCallback(f=>{if(f){const l=getComputedStyle(f);r.current=l,i.current=Je(l)}else r.current=null;n(f)},[])}}function Qn(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Gs(...e){const t=s.useRef(e);return t.current=e,s.useCallback(n=>{const r=t.current;let o=!1;const a=r.map(i=>{const c=Qn(i,n);return!o&&typeof c=="function"&&(o=!0),c});if(o)return()=>{for(let i=0;i<a.length;i++){const c=a[i];typeof c=="function"?c():Qn(r[i],null)}}},[])}function Je(e){return e?.animationName||"none"}function Xs(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Qs=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Ue=new WeakMap,gt=new WeakMap,yt={},Qt=0,Br=function(e){return e&&(e.host||Br(e.parentNode))},Zs=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=Br(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},Js=function(e,t,n,r){var o=Zs(t,Array.isArray(e)?e:[e]);yt[n]||(yt[n]=new WeakMap);var a=yt[n],i=[],c=new Set,u=new Set(o),m=function(l){!l||c.has(l)||(c.add(l),m(l.parentNode))};o.forEach(m);var f=function(l){!l||u.has(l)||Array.prototype.forEach.call(l.children,function(h){if(c.has(h))f(h);else try{var g=h.getAttribute(r),x=g!==null&&g!=="false",p=(Ue.get(h)||0)+1,E=(a.get(h)||0)+1;Ue.set(h,p),a.set(h,E),i.push(h),p===1&&x&&gt.set(h,!0),E===1&&h.setAttribute(n,"true"),x||h.setAttribute(r,"true")}catch(w){console.error("aria-hidden: cannot operate on ",h,w)}})};return f(t),c.clear(),Qt++,function(){i.forEach(function(l){var h=Ue.get(l)-1,g=a.get(l)-1;Ue.set(l,h),a.set(l,g),h||(gt.has(l)||l.removeAttribute(r),gt.delete(l)),g||l.removeAttribute(n)}),Qt--,Qt||(Ue=new WeakMap,Ue=new WeakMap,gt=new WeakMap,yt={})}},ei=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),o=Qs(e);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live], script"))),Js(r,o,n,"aria-hidden")):function(){return null}},Rt="right-scroll-bar-position",Ct="width-before-scroll-bar",ti="with-scroll-bars-hidden",ni="--removed-body-scroll-bar-size";function Zt(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function ri(e,t){var n=s.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var o=n.value;o!==r&&(n.value=r,n.callback(r,o))}}}})[0];return n.callback=t,n.facade}var oi=typeof window<"u"?s.useLayoutEffect:s.useEffect,Zn=new WeakMap;function ai(e,t){var n=ri(null,function(r){return e.forEach(function(o){return Zt(o,r)})});return oi(function(){var r=Zn.get(n);if(r){var o=new Set(r),a=new Set(e),i=n.current;o.forEach(function(c){a.has(c)||Zt(c,null)}),a.forEach(function(c){o.has(c)||Zt(c,i)})}Zn.set(n,e)},[e]),n}function si(e){return e}function ii(e,t){t===void 0&&(t=si);var n=[],r=!1,o={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(a){var i=t(a,r);return n.push(i),function(){n=n.filter(function(c){return c!==i})}},assignSyncMedium:function(a){for(r=!0;n.length;){var i=n;n=[],i.forEach(a)}n={push:function(c){return a(c)},filter:function(){return n}}},assignMedium:function(a){r=!0;var i=[];if(n.length){var c=n;n=[],c.forEach(a),i=n}var u=function(){var f=i;i=[],f.forEach(a)},m=function(){return Promise.resolve().then(u)};m(),n={push:function(f){i.push(f),m()},filter:function(f){return i=i.filter(f),n}}}};return o}function ci(e){e===void 0&&(e={});var t=ii(null);return t.options=xe({async:!0,ssr:!1},e),t}var Ur=function(e){var t=e.sideCar,n=Er(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return s.createElement(r,xe({},n))};Ur.isSideCarExport=!0;function li(e,t){return e.useMedium(t),Ur}var Hr=ci(),Jt=function(){},It=s.forwardRef(function(e,t){var n=s.useRef(null),r=s.useState({onScrollCapture:Jt,onWheelCapture:Jt,onTouchMoveCapture:Jt}),o=r[0],a=r[1],i=e.forwardProps,c=e.children,u=e.className,m=e.removeScrollBar,f=e.enabled,l=e.shards,h=e.sideCar,g=e.noRelative,x=e.noIsolation,p=e.inert,E=e.allowPinchZoom,w=e.as,A=w===void 0?"div":w,y=e.gapMode,v=Er(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),D=h,_=ai([n,t]),S=xe(xe({},v),o);return s.createElement(s.Fragment,null,f&&s.createElement(D,{sideCar:Hr,removeScrollBar:m,shards:l,noRelative:g,noIsolation:x,inert:p,setCallbacks:a,allowPinchZoom:!!E,lockRef:n,gapMode:y}),i?s.cloneElement(s.Children.only(c),xe(xe({},S),{ref:_})):s.createElement(A,xe({},S,{className:u,ref:_}),c))});It.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};It.classNames={fullWidth:Ct,zeroRight:Rt};var ui=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function di(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=ui();return t&&e.setAttribute("nonce",t),e}function fi(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function mi(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var hi=function(){var e=0,t=null;return{add:function(n){e==0&&(t=di())&&(fi(t,n),mi(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},pi=function(){var e=hi();return function(t,n){s.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},zr=function(){var e=pi(),t=function(n){var r=n.styles,o=n.dynamic;return e(r,o),null};return t},vi={left:0,top:0,right:0,gap:0},en=function(e){return parseInt(e||"",10)||0},gi=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],o=t[e==="padding"?"paddingRight":"marginRight"];return[en(n),en(r),en(o)]},yi=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return vi;var t=gi(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},wi=zr(),We="data-scroll-locked",bi=function(e,t,n,r){var o=e.left,a=e.top,i=e.right,c=e.gap;return n===void 0&&(n="margin"),`
4
4
  .`.concat(ti,` {
5
5
  overflow: hidden `).concat(r,`;
@@ -40,7 +40,7 @@ import{b as vr,j as d,X as gr,p as ln,B as un,L as yr,z as Bo,T as Uo,r as s,y a
40
40
  `)},Jn=function(){var e=parseInt(document.body.getAttribute(We)||"0",10);return isFinite(e)?e:0},Ei=function(){s.useEffect(function(){return document.body.setAttribute(We,(Jn()+1).toString()),function(){var e=Jn()-1;e<=0?document.body.removeAttribute(We):document.body.setAttribute(We,e.toString())}},[])},xi=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,o=r===void 0?"margin":r;Ei();var a=s.useMemo(function(){return yi(o)},[o]);return s.createElement(wi,{styles:bi(a,!t,o,n?"":"!important")})},pn=!1;if(typeof window<"u")try{var wt=Object.defineProperty({},"passive",{get:function(){return pn=!0,!0}});window.addEventListener("test",wt,wt),window.removeEventListener("test",wt,wt)}catch{pn=!1}var He=pn?{passive:!1}:!1,Si=function(e){return e.tagName==="TEXTAREA"},Wr=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!Si(e)&&n[t]==="visible")},Ri=function(e){return Wr(e,"overflowY")},Ci=function(e){return Wr(e,"overflowX")},er=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var o=Vr(e,r);if(o){var a=qr(e,r),i=a[1],c=a[2];if(i>c)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},Ti=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},Ai=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},Vr=function(e,t){return e==="v"?Ri(t):Ci(t)},qr=function(e,t){return e==="v"?Ti(t):Ai(t)},Di=function(e,t){return e==="h"&&t==="rtl"?-1:1},Ni=function(e,t,n,r,o){var a=Di(e,window.getComputedStyle(t).direction),i=a*r,c=n.target,u=t.contains(c),m=!1,f=i>0,l=0,h=0;do{if(!c)break;var g=qr(e,c),x=g[0],p=g[1],E=g[2],w=p-E-a*x;(x||w)&&Vr(e,c)&&(l+=w,h+=x);var A=c.parentNode;c=A&&A.nodeType===Node.DOCUMENT_FRAGMENT_NODE?A.host:A}while(!u&&c!==document.body||u&&(t.contains(c)||t===c));return(f&&Math.abs(l)<1||!f&&Math.abs(h)<1)&&(m=!0),m},bt=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},tr=function(e){return[e.deltaX,e.deltaY]},nr=function(e){return e&&"current"in e?e.current:e},Oi=function(e,t){return e[0]===t[0]&&e[1]===t[1]},Ii=function(e){return`
41
41
  .block-interactivity-`.concat(e,` {pointer-events: none;}
42
42
  .allow-interactivity-`).concat(e,` {pointer-events: all;}
43
- `)},ki=0,ze=[];function Li(e){var t=s.useRef([]),n=s.useRef([0,0]),r=s.useRef(),o=s.useState(ki++)[0],a=s.useState(zr)[0],i=s.useRef(e);s.useEffect(function(){i.current=e},[e]),s.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var p=Vo([e.lockRef.current],(e.shards||[]).map(nr),!0).filter(Boolean);return p.forEach(function(E){return E.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),p.forEach(function(E){return E.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var c=s.useCallback(function(p,E){if("touches"in p&&p.touches.length===2||p.type==="wheel"&&p.ctrlKey)return!i.current.allowPinchZoom;var w=bt(p),A=n.current,y="deltaX"in p?p.deltaX:A[0]-w[0],v="deltaY"in p?p.deltaY:A[1]-w[1],D,_=p.target,S=Math.abs(y)>Math.abs(v)?"h":"v";if("touches"in p&&S==="h"&&_.type==="range")return!1;var I=window.getSelection(),N=I&&I.anchorNode,F=N?N===_||N.contains(_):!1;if(F)return!1;var b=er(S,_);if(!b)return!0;if(b?D=S:(D=S==="v"?"h":"v",b=er(S,_)),!b)return!1;if(!r.current&&"changedTouches"in p&&(y||v)&&(r.current=D),!D)return!0;var P=r.current||D;return Ni(P,E,p,P==="h"?y:v)},[]),u=s.useCallback(function(p){var E=p;if(!(!ze.length||ze[ze.length-1]!==a)){var w="deltaY"in E?tr(E):bt(E),A=t.current.filter(function(D){return D.name===E.type&&(D.target===E.target||E.target===D.shadowParent)&&Oi(D.delta,w)})[0];if(A&&A.should){E.cancelable&&E.preventDefault();return}if(!A){var y=(i.current.shards||[]).map(nr).filter(Boolean).filter(function(D){return D.contains(E.target)}),v=y.length>0?c(E,y[0]):!i.current.noIsolation;v&&E.cancelable&&E.preventDefault()}}},[]),m=s.useCallback(function(p,E,w,A){var y={name:p,delta:E,target:w,should:A,shadowParent:Pi(w)};t.current.push(y),setTimeout(function(){t.current=t.current.filter(function(v){return v!==y})},1)},[]),f=s.useCallback(function(p){n.current=bt(p),r.current=void 0},[]),l=s.useCallback(function(p){m(p.type,tr(p),p.target,c(p,e.lockRef.current))},[]),h=s.useCallback(function(p){m(p.type,bt(p),p.target,c(p,e.lockRef.current))},[]);s.useEffect(function(){return ze.push(a),e.setCallbacks({onScrollCapture:l,onWheelCapture:l,onTouchMoveCapture:h}),document.addEventListener("wheel",u,He),document.addEventListener("touchmove",u,He),document.addEventListener("touchstart",f,He),function(){ze=ze.filter(function(p){return p!==a}),document.removeEventListener("wheel",u,He),document.removeEventListener("touchmove",u,He),document.removeEventListener("touchstart",f,He)}},[]);var g=e.removeScrollBar,x=e.inert;return s.createElement(s.Fragment,null,x?s.createElement(a,{styles:Ii(o)}):null,g?s.createElement(xi,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function Pi(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const _i=li(Hr,Li);var Kr=s.forwardRef(function(e,t){return s.createElement(It,xe({},e,{ref:t,sideCar:_i}))});Kr.classNames=It.classNames;const Nl=({enabled:e=!0,bindings:t,capture:n=!1})=>{const r=s.useCallback(o=>{const a=o.target;if(!(a.tagName==="INPUT"||a.tagName==="TEXTAREA"||a.isContentEditable))for(const i of t){if(!(o.key.toLowerCase()===i.key.toLowerCase())||i.action&&qo(i.action)||i.requireShift!==void 0&&i.requireShift!==o.shiftKey)continue;const u=o.ctrlKey||o.metaKey;if(i.requireMeta!==void 0){if(i.requireMeta!==u)continue}else{const m=i.noModifiers??!0,f=u||o.altKey||i.requireShift===void 0&&o.shiftKey;if(m&&f)continue}i.preventDefault&&o.preventDefault(),i.stopPropagation&&(o.stopPropagation(),o.stopImmediatePropagation()),i.handler(o);return}},[t]);s.useEffect(()=>{if(e)return window.addEventListener("keydown",r,n),()=>window.removeEventListener("keydown",r,n)},[e,r,n])},Mi=e=>typeof e=="object"&&e!==null&&"code"in e&&e.code==="attachment_rejected"&&"message"in e&&typeof e.message=="string",ji=new Set(["EmptyFile","UnusableFilename","FileTooLarge","TooManyAttachments"]),rr={status:"uploading"},Yr={status:"attached"},Pe=(e,t)=>({status:"failed",reason:e,retryable:t}),tn=(e,t)=>Mi(t)?Pe(t.message,!ji.has(t.reason)):Pe(`"${e}" could not be attached: ${Se(t)??"the request failed"}. Try again.`,!0),Fi=e=>({key:e.outboxAttachmentId,serverId:e.outboxAttachmentId,file:null,placement:null,contentId:e.contentId,contentType:e.contentType,contentUrl:e.contentUrl,filename:e.filename,sizeBytes:e.sizeBytes,state:e.state==="Stored"?Yr:Pe(`"${e.filename}" did not finish uploading. Remove it and attach it again.`,!1)});class $i{constructor(t){this.deps=t}deps;entries=[];snapshot=[];listeners=new Set;generation=0;draftId;nextKey=0;reservationsInFlight=new Set;inFlight=new Map;mintedAfterRemoval=new Map;removing=new Map;removedListeners=new Set;loaded=!1;subscribe=t=>(this.listeners.add(t),()=>this.listeners.delete(t));getSnapshot=()=>this.snapshot;owns=t=>this.entries.some(n=>n.contentId===t);storedContent=t=>{const n=this.entries.find(r=>r.contentId===t&&r.contentUrl!==null);return n?.contentUrl?{filename:n.filename,contentType:n.contentType,contentUrl:n.contentUrl}:null};isLoaded=()=>this.loaded;refreshLinks=t=>{const n=new Map(t.map(r=>[r.outboxAttachmentId,r.contentUrl]));this.set(this.entries.map(r=>{const o=r.serverId===null?void 0:n.get(r.serverId);return o===void 0?r:{...r,contentUrl:o}}))};onRemoved=t=>(this.removedListeners.add(t),()=>this.removedListeners.delete(t));blockingReason=()=>{const[t]=this.removing.values();if(t!==void 0)return`Removing "${t}"…`;const n=this.entries.find(o=>o.state.status==="uploading");if(n)return`"${n.filename}" is still uploading.`;const r=this.entries.find(o=>o.state.status==="failed");if(r)return`"${r.filename}" is not attached. Try it again or remove it before sending.`};set(t){this.entries=t,this.snapshot=t.map(({key:n,filename:r,sizeBytes:o,state:a})=>({key:n,filename:r,sizeBytes:o,state:a}));for(const n of this.listeners)n()}patch(t,n,r){t===this.generation&&this.entries.some(o=>o.key===n)&&this.set(this.entries.map(o=>o.key===n?{...o,...r}:o))}reserve(t,n){let r=()=>{};const o=new Promise(a=>{r=()=>{this.reservationsInFlight.delete(o),a()}});return this.reservationsInFlight.add(o),{minted:this.deps.transport().mint(t,n),settle:r}}upload=async(t,n,r,o,a)=>{if(a.aborted)return;const i=this.deps.transport(),{minted:c,settle:u}=this.reserve(o,r),m=await c.catch(h=>(this.patch(t,n,{state:tn(r.name,h)}),null));if(m!==null&&a.aborted&&this.mintedAfterRemoval.set(n,m.outboxAttachmentId),m!==null&&!a.aborted&&this.patch(t,n,{serverId:m.outboxAttachmentId,filename:m.filename,contentId:m.contentId,contentType:m.contentType}),u(),m===null||a.aborted)return;const f=await i.put(m.uploadUrl,r,a).then(()=>null,h=>Se(h)??"the connection dropped");if(a.aborted)return;if(f!==null){this.patch(t,n,{state:Pe(`"${m.filename}" did not finish uploading: ${f}. Try again.`,!0)});return}const l=await i.complete(o,m.outboxAttachmentId).catch(h=>(this.patch(t,n,{state:tn(m.filename,h)}),null));l===null||a.aborted||(this.patch(t,n,{state:Yr,contentUrl:l.contentUrl}),t===this.generation&&this.entries.find(h=>h.key===n)?.placement?.stored(r,m.contentId))};settleFailure(t,n,r){if(t!==this.generation)return;const o=this.entries.find(a=>a.key===n);o?.state.status==="failed"&&o.placement?.failed(r)}run=async(t,n,r,o,a)=>{await this.upload(t,n,r,o,a),this.inFlight.get(n)?.signal===a&&this.inFlight.delete(n),this.settleFailure(t,n,r)};syncKept=async t=>{for(;this.reservationsInFlight.size>0;)await Promise.all([...this.reservationsInFlight]);const n=this.draftId;return t!==this.generation||n===void 0?null:this.deps.transport().keep(n,this.entries.flatMap(r=>r.serverId===null?[]:[r.serverId])).then(()=>null,r=>r??new Error("the request failed"))};attach=async(t,n)=>{const r=this.generation,o=t.map(i=>{this.nextKey+=1;const c={key:`local-${this.nextKey}`,serverId:null,file:i,placement:n??null,contentId:null,contentType:i.type||"application/octet-stream",contentUrl:null,filename:i.name,sizeBytes:i.size,state:rr},u=new AbortController;return this.inFlight.set(c.key,u),{entry:c,file:i,signal:u.signal}});this.set([...this.entries,...o.map(({entry:i})=>i)]);const a=await this.deps.ensureDraft();if(a.outcome==="refused"){for(const{entry:i,file:c}of o)this.inFlight.delete(i.key),this.patch(r,i.key,{state:Pe(a.reason,!0)}),this.settleFailure(r,i.key,c);return}r===this.generation&&(this.draftId=a.outboxMessageId,await Promise.all(o.map(({entry:i,file:c,signal:u})=>this.run(r,i.key,c,a.outboxMessageId,u))))};retry=async t=>{const n=this.entries.find(c=>c.key===t);if(!n||n.file===null||this.inFlight.has(t))return;const r=n.file,o=this.generation,a=new AbortController;this.inFlight.set(t,a),this.patch(o,t,{state:rr,serverId:null});const i=await this.deps.ensureDraft();if(i.outcome==="refused"){this.inFlight.delete(t),this.patch(o,t,{state:Pe(i.reason,!0)});return}if(this.draftId=i.outboxMessageId,n.serverId!==null){const c=await this.syncKept(o);if(c!==null){this.inFlight.delete(t),this.patch(o,t,{serverId:n.serverId,state:tn(r.name,c)});return}}await this.run(o,t,r,i.outboxMessageId,a.signal)};remove=async t=>{const n=this.entries.find(c=>c.key===t);if(!n)return;const r=this.generation,o=this.inFlight.get(t);if(this.set(this.entries.filter(c=>c.key!==t)),o&&(this.inFlight.delete(t),o.abort()),n.serverId===null&&!o)return;this.removing.set(t,n.filename),this.set(this.entries);const a=await this.syncKept(r);this.removing.delete(t),this.set(this.entries);const i=n.serverId??this.mintedAfterRemoval.get(t)??null;if(this.mintedAfterRemoval.delete(t),r===this.generation){if(a===null){if(n.contentId===null)return;for(const c of this.removedListeners)c(n.contentId);return}i!==null&&this.set([...this.entries,{...n,serverId:i,file:null,state:Pe(`"${n.filename}" could not be removed: ${Se(a)??"the request failed"}. It is still on the draft — remove it again.`,!1)}])}};load=(t,n)=>{this.draftId=t,this.loaded=!0;const r=new Set(n.map(a=>a.outboxAttachmentId)),o=this.entries.filter(a=>a.file!==null&&(a.serverId===null||!r.has(a.serverId)));this.set([...n.map(Fi),...o])};reset=t=>{this.generation+=1;for(const n of this.inFlight.values())n.abort();this.inFlight.clear(),this.mintedAfterRemoval.clear(),this.removing.clear(),this.draftId=t,this.loaded=!1,this.set([])}}const Bi=(e,t,n)=>fetch(e,{method:"PUT",body:t,signal:n}).then(r=>{if(!r.ok)throw new Error(`the server answered ${r.status}`)}),Ui=({ensureDraft:e})=>{const t=_e({...Ko(),meta:Me}),n=_e({...Yo(),meta:Me}),r=_e({...xr(),meta:Me}),o=s.useRef(null);o.current={mint:(u,m)=>t.mutateAsync({path:{outboxMessageId:u},body:{filename:m.name,contentType:m.type||"application/octet-stream",sizeBytes:m.size}}),put:Bi,complete:(u,m)=>n.mutateAsync({path:{outboxMessageId:u,outboxAttachmentId:m}}).then(f=>({contentUrl:f.contentUrl})),keep:(u,m)=>r.mutateAsync({path:{outboxMessageId:u},body:{attachmentIds:m}}).then(()=>{})};const a=s.useRef(e);a.current=e;const[i]=s.useState(()=>new $i({transport:()=>{const u=o.current;if(!u)throw new Error("attachment transport not ready");return u},ensureDraft:()=>a.current()}));return{items:s.useSyncExternalStore(i.subscribe,i.getSnapshot,i.getSnapshot),attach:i.attach,retry:i.retry,remove:i.remove,load:i.load,reset:i.reset,owns:i.owns,isLoaded:i.isLoaded,refreshLinks:i.refreshLinks,storedContent:i.storedContent,onRemoved:i.onRemoved,blockingReason:i.blockingReason()}},Ol=e=>e==="link-expired"||e==="not-ready";class vn extends Error{reason;status;constructor(t,n,r){super(n),this.name="AttachmentFetchError",this.reason=t,this.status=r}}const Hi="x-remit-403-reason",zi="expired",Wi=(e,t)=>{if(t?.trim()===zi)return"link-expired";const n=la(e,t);return n==="auth"?"auth":n==="body-missing"?"missing":"generic"},Vi=300*1e3,qi=async(e,t)=>{const n={},r=await t();r&&(n.Authorization=`Bearer ${r}`);const o=await Go(e,{headers:n,signal:AbortSignal.timeout(Vi)});if(o.status===202)throw new vn("not-ready","Attachment is still being fetched from the mail server",202);if(!o.ok)throw new vn(Wi(o.status,o.headers.get(Hi)),`Failed to download attachment (${o.status} ${o.statusText})`,o.status);return o.blob()},Ki=(e,t,n)=>{switch(e){case"auth":return{title:"Your session expired",detail:`Sign in again, then download ${t} once more. Other parts of the app may also stop responding until you do.`};case"link-expired":return{title:"This download link expired and could not be renewed",detail:`Reload the page, then download ${t} again. If that keeps failing, this is worth reporting.`};case"missing":return{title:"This attachment is missing from storage",detail:"Remit has the message but not the file. Re-sync the account from Settings, then try again."};case"not-ready":return{title:"Still fetching this attachment",detail:"Remit is downloading it from the mail server now. Try again in a few seconds."};default:return{title:"Couldn't download this attachment",detail:n}}},or=e=>e instanceof vn?e.reason:"generic",Yi=e=>e instanceof Error?e.message:typeof e=="string"?e:"An unexpected error occurred while downloading this attachment.",Il=(e,t,n)=>{if(e!=="auth")return Sr(Rr({title:`Bug: attachment download failed (${e})`,errorMessage:`Downloading "${t}" failed: ${n}`}))},kl=(e,t)=>{const n=URL.createObjectURL(e),r=document.createElement("a");r.href=n,r.download=t,r.rel="noopener",document.body.append(r),r.click(),r.remove(),setTimeout(()=>URL.revokeObjectURL(n),0)},Gi=e=>{const{getToken:t}=Xo(),n=s.useRef({...e,getToken:t});return n.current={...e,getToken:t},s.useMemo(()=>{const r=c=>{const u=n.current;return u.isLoaded()?null:u.draftAttachments.find(m=>m.contentId===c)??null},o=c=>n.current.storedContent(c)??r(c),a=c=>qi(c.contentUrl,n.current.getToken).then(u=>URL.createObjectURL(new Blob([u],{type:c.contentType}))),i=c=>n.current.refreshLinks().then(()=>{const u=o(c);if(!u)throw new Error("the file is no longer on this draft");return a(u)});return{attach:(c,u)=>{n.current.attach(c,u)},owns:c=>n.current.owns(c)||r(c)!==null,onRemoved:c=>n.current.onRemoved(c),resolve:c=>{const u=o(c);return u?a(u).catch(m=>{if(or(m)!=="link-expired")throw m;return i(c)}).catch(m=>{const f=or(m);return n.current.pushError({...Ki(f,u.filename,Yi(m)),error:f==="generic"?m:void 0}),null}):Promise.resolve(null)}}},[])},Xi=(e,t)=>e===void 0&&t.toAddresses.length===0,Qi={status:"unsaved",reason:"Not saved — add a To address to keep this draft."},ar={status:"idle"},Zi={status:"saving"},sr={status:"saved"},ir={status:"error"},Ji=e=>e.then(()=>{},()=>{}),ec=({outboxMessageId:e,onDraftCreated:t})=>{const[n,r]=s.useState(ar),[o,a]=s.useState(null),i=s.useRef(void 0),c=s.useRef(new Set),u=Cr(),m=s.useRef(e),f=s.useRef(e);if(m.current!==e){const y=m.current!==void 0;m.current=e,f.current=e,y&&i.current&&clearTimeout(i.current)}const l=_e({...Qo(),meta:Me}),h=_e({...xr(),meta:Me}),g=s.useCallback(async y=>{r(Zi),a(null);const v=f.current;if(v){const _=await h.mutateAsync({path:{outboxMessageId:v},body:{toAddresses:y.toAddresses,ccAddresses:y.ccAddresses,bccAddresses:y.bccAddresses,subject:y.subject,textBody:y.textBody,htmlBody:y.htmlBody,inReplyTo:y.inReplyTo,references:y.references}});return r(sr),_}const D=await l.mutateAsync({body:{...y,sendImmediately:!1}});return f.current=D.outboxMessageId,t(D.outboxMessageId),r(sr),u.invalidateQueries({queryKey:Zo().queryKey}),D},[l.mutateAsync,h.mutateAsync,t,u]),x=s.useRef(Promise.resolve()),p=s.useCallback(y=>{const v=x.current.then(()=>g(y));return x.current=Ji(v),v},[g]),E=s.useCallback(y=>{if(i.current&&clearTimeout(i.current),Xi(f.current,y)){r(Qi);return}r(v=>v.status==="unsaved"?ar:v),i.current=setTimeout(()=>{const v=f.current;v&&c.current.has(v)||p(y).catch(D=>{a(D),r(ir)})},2e3)},[p]),w=s.useCallback(y=>(i.current&&clearTimeout(i.current),p(y).then(v=>({outcome:"saved",outboxMessageId:v.outboxMessageId})).catch(v=>(r(ir),{outcome:"failed",error:v}))),[p]),A=s.useCallback(y=>{i.current&&clearTimeout(i.current),y&&c.current.add(y)},[]);return{saveState:n,saveError:o,saveDraft:E,saveImmediately:w,stopAutoSave:A}},tc=e=>e.outboundCount>0||e.replyCount>0||e.flags?.vip?.value===!0||e.flags?.trusted?.value===!0,nc=e=>e.flags?.blocked?.value===!0?!1:e.flags?.junkOnly?.value!==!0?!0:tc(e),nn=({label:e,addresses:t,onChange:n,placeholder:r,onPendingChange:o,ref:a})=>{const[i,c]=s.useState(""),u=va(i,200),{data:m}=At({...Jo({query:{q:u,limit:8}}),enabled:u.length>=2}),f=s.useMemo(()=>(m?.items??[]).filter(nc).map(l=>({email:l.normalizedEmail,displayName:l.displayName})),[m]);return d.jsx(ja,{label:e,addresses:t,onChange:n,placeholder:r,suggestions:f,onQueryChange:c,onPendingChange:o,ref:a})},rc=({accountId:e,configureRef:t})=>{const n=wa();return d.jsx(Ya,{configureRef:t,onConfigure:()=>{n(e)}})},oc={download:"its dictionary could not be downloaded",engine:"the checker could not start",worker:"the checker stopped running"},ac=e=>{const t=`Spellcheck for ${e.language} is off: ${oc[e.reason]}.`;return{severity:"warning",title:"Spellcheck stopped",detail:`${t} Your browser is checking this message instead. ${e.detail}`,action:{label:"Report this",href:Sr(Rr({title:`Spellcheck stopped: ${e.reason} (${e.language})`,errorMessage:`${t} ${e.detail}`}))}}},sc=e=>({provider:async t=>{const{openSpellcheckWorker:n}=await Tr(async()=>{const{openSpellcheckWorker:r}=await import("./rich-text-spellcheck-worker-provider-ChKzrvjg.js");return{openSpellcheckWorker:r}},__vite__mapDeps([0,1,2,3,4]));return n(t)},onStatus:t=>{t.state==="failed"&&e(ac(t))}}),ic=e=>{if(ea(e)?.code==="mail_sync_off")return Se(e)},Gr=e=>e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;"),Dt=e=>e.split(`
43
+ `)},ki=0,ze=[];function Li(e){var t=s.useRef([]),n=s.useRef([0,0]),r=s.useRef(),o=s.useState(ki++)[0],a=s.useState(zr)[0],i=s.useRef(e);s.useEffect(function(){i.current=e},[e]),s.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var p=Vo([e.lockRef.current],(e.shards||[]).map(nr),!0).filter(Boolean);return p.forEach(function(E){return E.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),p.forEach(function(E){return E.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var c=s.useCallback(function(p,E){if("touches"in p&&p.touches.length===2||p.type==="wheel"&&p.ctrlKey)return!i.current.allowPinchZoom;var w=bt(p),A=n.current,y="deltaX"in p?p.deltaX:A[0]-w[0],v="deltaY"in p?p.deltaY:A[1]-w[1],D,_=p.target,S=Math.abs(y)>Math.abs(v)?"h":"v";if("touches"in p&&S==="h"&&_.type==="range")return!1;var I=window.getSelection(),N=I&&I.anchorNode,F=N?N===_||N.contains(_):!1;if(F)return!1;var b=er(S,_);if(!b)return!0;if(b?D=S:(D=S==="v"?"h":"v",b=er(S,_)),!b)return!1;if(!r.current&&"changedTouches"in p&&(y||v)&&(r.current=D),!D)return!0;var P=r.current||D;return Ni(P,E,p,P==="h"?y:v)},[]),u=s.useCallback(function(p){var E=p;if(!(!ze.length||ze[ze.length-1]!==a)){var w="deltaY"in E?tr(E):bt(E),A=t.current.filter(function(D){return D.name===E.type&&(D.target===E.target||E.target===D.shadowParent)&&Oi(D.delta,w)})[0];if(A&&A.should){E.cancelable&&E.preventDefault();return}if(!A){var y=(i.current.shards||[]).map(nr).filter(Boolean).filter(function(D){return D.contains(E.target)}),v=y.length>0?c(E,y[0]):!i.current.noIsolation;v&&E.cancelable&&E.preventDefault()}}},[]),m=s.useCallback(function(p,E,w,A){var y={name:p,delta:E,target:w,should:A,shadowParent:Pi(w)};t.current.push(y),setTimeout(function(){t.current=t.current.filter(function(v){return v!==y})},1)},[]),f=s.useCallback(function(p){n.current=bt(p),r.current=void 0},[]),l=s.useCallback(function(p){m(p.type,tr(p),p.target,c(p,e.lockRef.current))},[]),h=s.useCallback(function(p){m(p.type,bt(p),p.target,c(p,e.lockRef.current))},[]);s.useEffect(function(){return ze.push(a),e.setCallbacks({onScrollCapture:l,onWheelCapture:l,onTouchMoveCapture:h}),document.addEventListener("wheel",u,He),document.addEventListener("touchmove",u,He),document.addEventListener("touchstart",f,He),function(){ze=ze.filter(function(p){return p!==a}),document.removeEventListener("wheel",u,He),document.removeEventListener("touchmove",u,He),document.removeEventListener("touchstart",f,He)}},[]);var g=e.removeScrollBar,x=e.inert;return s.createElement(s.Fragment,null,x?s.createElement(a,{styles:Ii(o)}):null,g?s.createElement(xi,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function Pi(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const _i=li(Hr,Li);var Kr=s.forwardRef(function(e,t){return s.createElement(It,xe({},e,{ref:t,sideCar:_i}))});Kr.classNames=It.classNames;const Nl=({enabled:e=!0,bindings:t,capture:n=!1})=>{const r=s.useCallback(o=>{const a=o.target;if(!(a.tagName==="INPUT"||a.tagName==="TEXTAREA"||a.isContentEditable))for(const i of t){if(!(o.key.toLowerCase()===i.key.toLowerCase())||i.action&&qo(i.action)||i.requireShift!==void 0&&i.requireShift!==o.shiftKey)continue;const u=o.ctrlKey||o.metaKey;if(i.requireMeta!==void 0){if(i.requireMeta!==u)continue}else{const m=i.noModifiers??!0,f=u||o.altKey||i.requireShift===void 0&&o.shiftKey;if(m&&f)continue}i.preventDefault&&o.preventDefault(),i.stopPropagation&&(o.stopPropagation(),o.stopImmediatePropagation()),i.handler(o);return}},[t]);s.useEffect(()=>{if(e)return window.addEventListener("keydown",r,n),()=>window.removeEventListener("keydown",r,n)},[e,r,n])},Mi=e=>typeof e=="object"&&e!==null&&"code"in e&&e.code==="attachment_rejected"&&"message"in e&&typeof e.message=="string",ji=new Set(["EmptyFile","UnusableFilename","FileTooLarge","TooManyAttachments"]),rr={status:"uploading"},Yr={status:"attached"},Pe=(e,t)=>({status:"failed",reason:e,retryable:t}),tn=(e,t)=>Mi(t)?Pe(t.message,!ji.has(t.reason)):Pe(`"${e}" could not be attached: ${Se(t)??"the request failed"}. Try again.`,!0),Fi=e=>({key:e.outboxAttachmentId,serverId:e.outboxAttachmentId,file:null,placement:null,contentId:e.contentId,contentType:e.contentType,contentUrl:e.contentUrl,filename:e.filename,sizeBytes:e.sizeBytes,state:e.state==="Stored"?Yr:Pe(`"${e.filename}" did not finish uploading. Remove it and attach it again.`,!1)});class $i{constructor(t){this.deps=t}deps;entries=[];snapshot=[];listeners=new Set;generation=0;draftId;nextKey=0;reservationsInFlight=new Set;inFlight=new Map;mintedAfterRemoval=new Map;removing=new Map;removedListeners=new Set;loaded=!1;subscribe=t=>(this.listeners.add(t),()=>this.listeners.delete(t));getSnapshot=()=>this.snapshot;owns=t=>this.entries.some(n=>n.contentId===t);storedContent=t=>{const n=this.entries.find(r=>r.contentId===t&&r.contentUrl!==null);return n?.contentUrl?{filename:n.filename,contentType:n.contentType,contentUrl:n.contentUrl}:null};isLoaded=()=>this.loaded;refreshLinks=t=>{const n=new Map(t.map(r=>[r.outboxAttachmentId,r.contentUrl]));this.set(this.entries.map(r=>{const o=r.serverId===null?void 0:n.get(r.serverId);return o===void 0?r:{...r,contentUrl:o}}))};onRemoved=t=>(this.removedListeners.add(t),()=>this.removedListeners.delete(t));blockingReason=()=>{const[t]=this.removing.values();if(t!==void 0)return`Removing "${t}"…`;const n=this.entries.find(o=>o.state.status==="uploading");if(n)return`"${n.filename}" is still uploading.`;const r=this.entries.find(o=>o.state.status==="failed");if(r)return`"${r.filename}" is not attached. Try it again or remove it before sending.`};set(t){this.entries=t,this.snapshot=t.map(({key:n,filename:r,sizeBytes:o,state:a})=>({key:n,filename:r,sizeBytes:o,state:a}));for(const n of this.listeners)n()}patch(t,n,r){t===this.generation&&this.entries.some(o=>o.key===n)&&this.set(this.entries.map(o=>o.key===n?{...o,...r}:o))}reserve(t,n){let r=()=>{};const o=new Promise(a=>{r=()=>{this.reservationsInFlight.delete(o),a()}});return this.reservationsInFlight.add(o),{minted:this.deps.transport().mint(t,n),settle:r}}upload=async(t,n,r,o,a)=>{if(a.aborted)return;const i=this.deps.transport(),{minted:c,settle:u}=this.reserve(o,r),m=await c.catch(h=>(this.patch(t,n,{state:tn(r.name,h)}),null));if(m!==null&&a.aborted&&this.mintedAfterRemoval.set(n,m.outboxAttachmentId),m!==null&&!a.aborted&&this.patch(t,n,{serverId:m.outboxAttachmentId,filename:m.filename,contentId:m.contentId,contentType:m.contentType}),u(),m===null||a.aborted)return;const f=await i.put(m.uploadUrl,r,a).then(()=>null,h=>Se(h)??"the connection dropped");if(a.aborted)return;if(f!==null){this.patch(t,n,{state:Pe(`"${m.filename}" did not finish uploading: ${f}. Try again.`,!0)});return}const l=await i.complete(o,m.outboxAttachmentId).catch(h=>(this.patch(t,n,{state:tn(m.filename,h)}),null));l===null||a.aborted||(this.patch(t,n,{state:Yr,contentUrl:l.contentUrl}),t===this.generation&&this.entries.find(h=>h.key===n)?.placement?.stored(r,m.contentId))};settleFailure(t,n,r){if(t!==this.generation)return;const o=this.entries.find(a=>a.key===n);o?.state.status==="failed"&&o.placement?.failed(r)}run=async(t,n,r,o,a)=>{await this.upload(t,n,r,o,a),this.inFlight.get(n)?.signal===a&&this.inFlight.delete(n),this.settleFailure(t,n,r)};syncKept=async t=>{for(;this.reservationsInFlight.size>0;)await Promise.all([...this.reservationsInFlight]);const n=this.draftId;return t!==this.generation||n===void 0?null:this.deps.transport().keep(n,this.entries.flatMap(r=>r.serverId===null?[]:[r.serverId])).then(()=>null,r=>r??new Error("the request failed"))};attach=async(t,n)=>{const r=this.generation,o=t.map(i=>{this.nextKey+=1;const c={key:`local-${this.nextKey}`,serverId:null,file:i,placement:n??null,contentId:null,contentType:i.type||"application/octet-stream",contentUrl:null,filename:i.name,sizeBytes:i.size,state:rr},u=new AbortController;return this.inFlight.set(c.key,u),{entry:c,file:i,signal:u.signal}});this.set([...this.entries,...o.map(({entry:i})=>i)]);const a=await this.deps.ensureDraft();if(a.outcome==="refused"){for(const{entry:i,file:c}of o)this.inFlight.delete(i.key),this.patch(r,i.key,{state:Pe(a.reason,!0)}),this.settleFailure(r,i.key,c);return}r===this.generation&&(this.draftId=a.outboxMessageId,await Promise.all(o.map(({entry:i,file:c,signal:u})=>this.run(r,i.key,c,a.outboxMessageId,u))))};retry=async t=>{const n=this.entries.find(c=>c.key===t);if(!n||n.file===null||this.inFlight.has(t))return;const r=n.file,o=this.generation,a=new AbortController;this.inFlight.set(t,a),this.patch(o,t,{state:rr,serverId:null});const i=await this.deps.ensureDraft();if(i.outcome==="refused"){this.inFlight.delete(t),this.patch(o,t,{state:Pe(i.reason,!0)});return}if(this.draftId=i.outboxMessageId,n.serverId!==null){const c=await this.syncKept(o);if(c!==null){this.inFlight.delete(t),this.patch(o,t,{serverId:n.serverId,state:tn(r.name,c)});return}}await this.run(o,t,r,i.outboxMessageId,a.signal)};remove=async t=>{const n=this.entries.find(c=>c.key===t);if(!n)return;const r=this.generation,o=this.inFlight.get(t);if(this.set(this.entries.filter(c=>c.key!==t)),o&&(this.inFlight.delete(t),o.abort()),n.serverId===null&&!o)return;this.removing.set(t,n.filename),this.set(this.entries);const a=await this.syncKept(r);this.removing.delete(t),this.set(this.entries);const i=n.serverId??this.mintedAfterRemoval.get(t)??null;if(this.mintedAfterRemoval.delete(t),r===this.generation){if(a===null){if(n.contentId===null)return;for(const c of this.removedListeners)c(n.contentId);return}i!==null&&this.set([...this.entries,{...n,serverId:i,file:null,state:Pe(`"${n.filename}" could not be removed: ${Se(a)??"the request failed"}. It is still on the draft — remove it again.`,!1)}])}};load=(t,n)=>{this.draftId=t,this.loaded=!0;const r=new Set(n.map(a=>a.outboxAttachmentId)),o=this.entries.filter(a=>a.file!==null&&(a.serverId===null||!r.has(a.serverId)));this.set([...n.map(Fi),...o])};reset=t=>{this.generation+=1;for(const n of this.inFlight.values())n.abort();this.inFlight.clear(),this.mintedAfterRemoval.clear(),this.removing.clear(),this.draftId=t,this.loaded=!1,this.set([])}}const Bi=(e,t,n)=>fetch(e,{method:"PUT",body:t,signal:n}).then(r=>{if(!r.ok)throw new Error(`the server answered ${r.status}`)}),Ui=({ensureDraft:e})=>{const t=_e({...Ko(),meta:Me}),n=_e({...Yo(),meta:Me}),r=_e({...xr(),meta:Me}),o=s.useRef(null);o.current={mint:(u,m)=>t.mutateAsync({path:{outboxMessageId:u},body:{filename:m.name,contentType:m.type||"application/octet-stream",sizeBytes:m.size}}),put:Bi,complete:(u,m)=>n.mutateAsync({path:{outboxMessageId:u,outboxAttachmentId:m}}).then(f=>({contentUrl:f.contentUrl})),keep:(u,m)=>r.mutateAsync({path:{outboxMessageId:u},body:{attachmentIds:m}}).then(()=>{})};const a=s.useRef(e);a.current=e;const[i]=s.useState(()=>new $i({transport:()=>{const u=o.current;if(!u)throw new Error("attachment transport not ready");return u},ensureDraft:()=>a.current()}));return{items:s.useSyncExternalStore(i.subscribe,i.getSnapshot,i.getSnapshot),attach:i.attach,retry:i.retry,remove:i.remove,load:i.load,reset:i.reset,owns:i.owns,isLoaded:i.isLoaded,refreshLinks:i.refreshLinks,storedContent:i.storedContent,onRemoved:i.onRemoved,blockingReason:i.blockingReason()}},Ol=e=>e==="link-expired"||e==="not-ready";class vn extends Error{reason;status;constructor(t,n,r){super(n),this.name="AttachmentFetchError",this.reason=t,this.status=r}}const Hi="x-remit-403-reason",zi="expired",Wi=(e,t)=>{if(t?.trim()===zi)return"link-expired";const n=la(e,t);return n==="auth"?"auth":n==="body-missing"?"missing":"generic"},Vi=300*1e3,qi=async(e,t)=>{const n={},r=await t();r&&(n.Authorization=`Bearer ${r}`);const o=await Go(e,{headers:n,signal:AbortSignal.timeout(Vi)});if(o.status===202)throw new vn("not-ready","Attachment is still being fetched from the mail server",202);if(!o.ok)throw new vn(Wi(o.status,o.headers.get(Hi)),`Failed to download attachment (${o.status} ${o.statusText})`,o.status);return o.blob()},Ki=(e,t,n)=>{switch(e){case"auth":return{title:"Your session expired",detail:`Sign in again, then download ${t} once more. Other parts of the app may also stop responding until you do.`};case"link-expired":return{title:"This download link expired and could not be renewed",detail:`Reload the page, then download ${t} again. If that keeps failing, this is worth reporting.`};case"missing":return{title:"This attachment is missing from storage",detail:"Remit has the message but not the file. Re-sync the account from Settings, then try again."};case"not-ready":return{title:"Still fetching this attachment",detail:"Remit is downloading it from the mail server now. Try again in a few seconds."};default:return{title:"Couldn't download this attachment",detail:n}}},or=e=>e instanceof vn?e.reason:"generic",Yi=e=>e instanceof Error?e.message:typeof e=="string"?e:"An unexpected error occurred while downloading this attachment.",Il=(e,t,n)=>{if(e!=="auth")return Sr(Rr({title:`Bug: attachment download failed (${e})`,errorMessage:`Downloading "${t}" failed: ${n}`}))},kl=(e,t)=>{const n=URL.createObjectURL(e),r=document.createElement("a");r.href=n,r.download=t,r.rel="noopener",document.body.append(r),r.click(),r.remove(),setTimeout(()=>URL.revokeObjectURL(n),0)},Gi=e=>{const{getToken:t}=Xo(),n=s.useRef({...e,getToken:t});return n.current={...e,getToken:t},s.useMemo(()=>{const r=c=>{const u=n.current;return u.isLoaded()?null:u.draftAttachments.find(m=>m.contentId===c)??null},o=c=>n.current.storedContent(c)??r(c),a=c=>qi(c.contentUrl,n.current.getToken).then(u=>URL.createObjectURL(new Blob([u],{type:c.contentType}))),i=c=>n.current.refreshLinks().then(()=>{const u=o(c);if(!u)throw new Error("the file is no longer on this draft");return a(u)});return{attach:(c,u)=>{n.current.attach(c,u)},owns:c=>n.current.owns(c)||r(c)!==null,onRemoved:c=>n.current.onRemoved(c),resolve:c=>{const u=o(c);return u?a(u).catch(m=>{if(or(m)!=="link-expired")throw m;return i(c)}).catch(m=>{const f=or(m);return n.current.pushError({...Ki(f,u.filename,Yi(m)),error:f==="generic"?m:void 0}),null}):Promise.resolve(null)}}},[])},Xi=(e,t)=>e===void 0&&t.toAddresses.length===0,Qi={status:"unsaved",reason:"Not saved — add a To address to keep this draft."},ar={status:"idle"},Zi={status:"saving"},sr={status:"saved"},ir={status:"error"},Ji=e=>e.then(()=>{},()=>{}),ec=({outboxMessageId:e,onDraftCreated:t})=>{const[n,r]=s.useState(ar),[o,a]=s.useState(null),i=s.useRef(void 0),c=s.useRef(new Set),u=Cr(),m=s.useRef(e),f=s.useRef(e);if(m.current!==e){const y=m.current!==void 0;m.current=e,f.current=e,y&&i.current&&clearTimeout(i.current)}const l=_e({...Qo(),meta:Me}),h=_e({...xr(),meta:Me}),g=s.useCallback(async y=>{r(Zi),a(null);const v=f.current;if(v){const _=await h.mutateAsync({path:{outboxMessageId:v},body:{toAddresses:y.toAddresses,ccAddresses:y.ccAddresses,bccAddresses:y.bccAddresses,subject:y.subject,textBody:y.textBody,htmlBody:y.htmlBody,inReplyTo:y.inReplyTo,references:y.references}});return r(sr),_}const D=await l.mutateAsync({body:{...y,sendImmediately:!1}});return f.current=D.outboxMessageId,t(D.outboxMessageId),r(sr),u.invalidateQueries({queryKey:Zo().queryKey}),D},[l.mutateAsync,h.mutateAsync,t,u]),x=s.useRef(Promise.resolve()),p=s.useCallback(y=>{const v=x.current.then(()=>g(y));return x.current=Ji(v),v},[g]),E=s.useCallback(y=>{if(i.current&&clearTimeout(i.current),Xi(f.current,y)){r(Qi);return}r(v=>v.status==="unsaved"?ar:v),i.current=setTimeout(()=>{const v=f.current;v&&c.current.has(v)||p(y).catch(D=>{a(D),r(ir)})},2e3)},[p]),w=s.useCallback(y=>(i.current&&clearTimeout(i.current),p(y).then(v=>({outcome:"saved",outboxMessageId:v.outboxMessageId})).catch(v=>(r(ir),{outcome:"failed",error:v}))),[p]),A=s.useCallback(y=>{i.current&&clearTimeout(i.current),y&&c.current.add(y)},[]);return{saveState:n,saveError:o,saveDraft:E,saveImmediately:w,stopAutoSave:A}},tc=e=>e.outboundCount>0||e.replyCount>0||e.flags?.vip?.value===!0||e.flags?.trusted?.value===!0,nc=e=>e.flags?.blocked?.value===!0?!1:e.flags?.junkOnly?.value!==!0?!0:tc(e),nn=({label:e,addresses:t,onChange:n,placeholder:r,onPendingChange:o,ref:a})=>{const[i,c]=s.useState(""),u=va(i,200),{data:m}=At({...Jo({query:{q:u,limit:8}}),enabled:u.length>=2}),f=s.useMemo(()=>(m?.items??[]).filter(nc).map(l=>({email:l.normalizedEmail,displayName:l.displayName})),[m]);return d.jsx(ja,{label:e,addresses:t,onChange:n,placeholder:r,suggestions:f,onQueryChange:c,onPendingChange:o,ref:a})},rc=({accountId:e,configureRef:t})=>{const n=wa();return d.jsx(Ya,{configureRef:t,onConfigure:()=>{n(e)}})},oc={download:"its dictionary could not be downloaded",engine:"the checker could not start",worker:"the checker stopped running"},ac=e=>{const t=`Spellcheck for ${e.language} is off: ${oc[e.reason]}.`;return{severity:"warning",title:"Spellcheck stopped",detail:`${t} Your browser is checking this message instead. ${e.detail}`,action:{label:"Report this",href:Sr(Rr({title:`Spellcheck stopped: ${e.reason} (${e.language})`,errorMessage:`${t} ${e.detail}`}))}}},sc=e=>({provider:async t=>{const{openSpellcheckWorker:n}=await Tr(async()=>{const{openSpellcheckWorker:r}=await import("./rich-text-spellcheck-worker-provider-BoNiweeq.js");return{openSpellcheckWorker:r}},__vite__mapDeps([0,1,2,3,4]));return n(t)},onStatus:t=>{t.state==="failed"&&e(ac(t))}}),ic=e=>{if(ea(e)?.code==="mail_sync_off")return Se(e)},Gr=e=>e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;"),Dt=e=>e.split(`
44
44
  `).map(t=>`<p>${Gr(t)}</p>`).join(""),cc=new Set(["ADDRESS","ARTICLE","BLOCKQUOTE","BR","DIV","H1","H2","H3","H4","H5","H6","HR","LI","OL","P","PRE","SECTION","TABLE","TR","UL"]),lc=e=>{const t=new DOMParser().parseFromString(e,"text/html"),n=[];let r="";const o=()=>{n.push(r.trim()),r=""},a=i=>{if(i.nodeType===i.TEXT_NODE){r+=(i.textContent??"").replace(/\s+/g," ");return}if(i.nodeType!==i.ELEMENT_NODE)return;const c=cc.has(i.tagName);c&&r!==""&&o();for(const u of i.childNodes)a(u);c&&o()};return a(t.body),r!==""&&o(),n.join(`
45
45
  `).replace(/\n{3,}/g,`
46
46
 
@@ -50,7 +50,7 @@ import{b as vr,j as d,X as gr,p as ln,B as un,L as yr,z as Bo,T as Uo,r as s,y a
50
50
  `))}${o}`}}const a=dc(t);return{text:[a,...hc(r)].join(`
51
51
  `),html:`<p>${Gr(a)}</p><blockquote type="cite">${o}</blockquote>`}},vc=(e,t)=>e===""?t:`${e}
52
52
 
53
- ${t}`,rn=(e,t,n,r)=>{const o=r?vc(t.text,r.text):t.text;if(e==="plain")return{textBody:o||void 0,htmlBody:""};const a=r?`${t.html}${r.html}`:t.html;return{textBody:o||void 0,htmlBody:a?da(a,n):void 0}},cr=150,gc=()=>{const[e,t]=s.useState(()=>{if(typeof window>"u"||!window.visualViewport)return{viewportHeight:0,isKeyboardOpen:!1};const n=window.visualViewport.height;return{viewportHeight:n,isKeyboardOpen:window.innerHeight-n>cr}});return s.useEffect(()=>{if(typeof window>"u"||!window.visualViewport)return;const n=window.visualViewport,r=()=>{const o=n.height;t({viewportHeight:o,isKeyboardOpen:window.innerHeight-o>cr})};return r(),n.addEventListener("resize",r),()=>n.removeEventListener("resize",r)},[]),e},yc=({selectedAccountId:e,onSelect:t})=>{const{data:n}=At({...Ar(),staleTime:1/0}),r=n?.accounts??[];if(s.useEffect(()=>{!e&&r.length===1&&r[0]&&t(r[0])},[e,r,t]),r.length<=1){const a=r[0];return a?d.jsxs("div",{className:"flex items-start gap-2",children:[d.jsx("label",{className:"text-sm text-fg-muted shrink-0 w-12 pt-1.5",children:"From:"}),d.jsx("div",{className:"text-sm py-1.5",children:a.email})]}):null}const o=r.some(a=>a.accountId===e);return d.jsxs("div",{className:"flex items-start gap-2",children:[d.jsx("label",{htmlFor:"from-account-selector",className:"text-sm text-fg-muted shrink-0 w-12 pt-1.5",children:"From:"}),d.jsxs("select",{id:"from-account-selector",value:o?e:"",onChange:a=>{const i=r.find(c=>c.accountId===a.target.value);i&&t(i)},className:"flex-1 px-2 py-1.5 border rounded-md bg-canvas text-sm",children:[!o&&d.jsx("option",{value:"",disabled:!0,children:"Choose an account"}),r.map(a=>d.jsx("option",{value:a.accountId,children:a.email},a.accountId))]})]})},wc=s.lazy(()=>Tr(()=>import("./rich-text-Ds4rQc2o.js"),__vite__mapDeps([5,2,3,1,6,7,8,9,10,11,4,12,13,14,15,16,17,18,19])).then(e=>({default:e.ComposeBody}))),lr=e=>e?`<p></p><p>-- </p>${Dt(e)}`:"",Et=(e,t)=>t?{html:`${Dt(t.body)}${lr(e)}`,text:[t.body,e].filter(Boolean).join(`
53
+ ${t}`,rn=(e,t,n,r)=>{const o=r?vc(t.text,r.text):t.text;if(e==="plain")return{textBody:o||void 0,htmlBody:""};const a=r?`${t.html}${r.html}`:t.html;return{textBody:o||void 0,htmlBody:a?da(a,n):void 0}},cr=150,gc=()=>{const[e,t]=s.useState(()=>{if(typeof window>"u"||!window.visualViewport)return{viewportHeight:0,isKeyboardOpen:!1};const n=window.visualViewport.height;return{viewportHeight:n,isKeyboardOpen:window.innerHeight-n>cr}});return s.useEffect(()=>{if(typeof window>"u"||!window.visualViewport)return;const n=window.visualViewport,r=()=>{const o=n.height;t({viewportHeight:o,isKeyboardOpen:window.innerHeight-o>cr})};return r(),n.addEventListener("resize",r),()=>n.removeEventListener("resize",r)},[]),e},yc=({selectedAccountId:e,onSelect:t})=>{const{data:n}=At({...Ar(),staleTime:1/0}),r=n?.accounts??[];if(s.useEffect(()=>{!e&&r.length===1&&r[0]&&t(r[0])},[e,r,t]),r.length<=1){const a=r[0];return a?d.jsxs("div",{className:"flex items-start gap-2",children:[d.jsx("label",{className:"text-sm text-fg-muted shrink-0 w-12 pt-1.5",children:"From:"}),d.jsx("div",{className:"text-sm py-1.5",children:a.email})]}):null}const o=r.some(a=>a.accountId===e);return d.jsxs("div",{className:"flex items-start gap-2",children:[d.jsx("label",{htmlFor:"from-account-selector",className:"text-sm text-fg-muted shrink-0 w-12 pt-1.5",children:"From:"}),d.jsxs("select",{id:"from-account-selector",value:o?e:"",onChange:a=>{const i=r.find(c=>c.accountId===a.target.value);i&&t(i)},className:"flex-1 px-2 py-1.5 border rounded-md bg-canvas text-sm",children:[!o&&d.jsx("option",{value:"",disabled:!0,children:"Choose an account"}),r.map(a=>d.jsx("option",{value:a.accountId,children:a.email},a.accountId))]})]})},wc=s.lazy(()=>Tr(()=>import("./rich-text-CY6eh-tS.js"),__vite__mapDeps([5,2,3,1,6,7,8,9,10,11,4,12,13,14,15,16,17,18,19])).then(e=>({default:e.ComposeBody}))),lr=e=>e?`<p></p><p>-- </p>${Dt(e)}`:"",Et=(e,t)=>t?{html:`${Dt(t.body)}${lr(e)}`,text:[t.body,e].filter(Boolean).join(`
54
54
 
55
55
  `)}:{html:lr(e),text:e},bc=e=>e?/^re:\s/i.test(e)?e:`Re: ${e}`:"Re: ",Ec=e=>e?/^fwd?:\s/i.test(e)?e:`Fwd: ${e}`:"Fwd: ",xc=(e,t,n)=>{const{envelope:r}=e,a=(r.replyTo.length>0?r.replyTo:r.from).map(m=>({email:m.normalizedEmail,displayName:m.displayName}));if(t!=="reply-all")return{to:a,cc:[]};const i=n?.toLowerCase(),c=new Set(a.map(m=>m.email.toLowerCase())),u=[...r.to,...r.cc].filter(m=>m.normalizedEmail.toLowerCase()!==i&&!c.has(m.normalizedEmail.toLowerCase())).map(m=>({email:m.normalizedEmail,displayName:m.displayName}));return{to:a,cc:u}},ur=e=>{const t=e.envelope.messageIdValue,n=a=>e.references.filter(i=>i.referenceType===a).sort((i,c)=>i.referenceOrder-c.referenceOrder).map(i=>i.messageIdValue),r=n("references"),o=r.length>0?[...r]:n("in_reply_to");return t&&!o.includes(t)&&o.push(t),{inReplyTo:t,references:o}},Sc="Add a To address before sending.",Rc="Loading the message you're quoting.",Cc="The message you're quoting couldn't be loaded, so it won't be included.",Tc="Add a To address before attaching a file — the draft the file is kept with is saved against it.",Ac=({label:e,text:t})=>`${e} holds "${t}", which is not an address.`,dr=e=>e.find(t=>t.text.trim()!==""),Dc={entries:[],unparsed:""},Nc=(e,t,n,r,o)=>e.length===0&&t.length===0&&n.length===0&&r.trim()===""&&o.text.trim()==="",Oc=({documentGeneration:e,selectedAccountId:t,onAccountChange:n,toAddresses:r,setToAddresses:o,ccAddresses:a,setCcAddresses:i,bccAddresses:c,setBccAddresses:u,showCc:m,setShowCc:f,showBcc:l,setShowBcc:h,subject:g,setSubject:x,fieldHandles:p,onToPendingChange:E})=>{const w=ba(),{isKeyboardOpen:A}=gc(),[y,v]=s.useState(void 0),D=y===e,[_,S]=s.useState(!1);return d.jsx("div",{className:"contents",onFocusCapture:()=>S(!0),onBlurCapture:I=>{I.currentTarget.contains(I.relatedTarget)||S(!1)},children:d.jsx(Wa,{collapsed:!w&&A&&!D&&!_,onExpand:()=>v(e),summary:za({to:r,cc:a,bcc:c,subject:g}),from:d.jsx(yc,{selectedAccountId:t,onSelect:n}),to:d.jsx(nn,{label:"To",addresses:r,onChange:o,placeholder:"Recipients",onPendingChange:E,ref:p.to}),cc:m?d.jsx(nn,{label:"Cc",addresses:a,onChange:i,ref:p.cc}):void 0,bcc:l?d.jsx(nn,{label:"Bcc",addresses:c,onChange:u,ref:p.bcc}):void 0,subject:d.jsx(Ga,{value:g,onChange:x}),onShowCc:()=>f(!0),onShowBcc:()=>h(!0)})})},Ll=({mode:e,account:t,sourceMessage:n,outboxMessageId:r,seed:o,insertion:a,onDraftCreated:i,onClose:c,onAccountChange:u,layout:m="fill"})=>{const{startSendPolling:f}=na(),{pushError:l}=ra(),[h,g]=s.useState([]),[x,p]=s.useState([]),[E,w]=s.useState([]),[A,y]=s.useState(Dc),v=s.useRef(null),D=s.useRef(null),_=s.useRef(null),S=s.useMemo(()=>({to:v,cc:D,bcc:_}),[]),I=s.useCallback(()=>{v.current?.clearPending(),D.current?.clearPending(),_.current?.clearPending()},[]),[N,F]=s.useState(""),[b,P]=s.useState(!1),[C,q]=s.useState(!1),[$,Q]=s.useState(t?.accountId),[W,ee]=s.useState(!1),[ne,ye]=s.useState(r),Fe=s.useRef(void 0),Ce=s.useRef(!1),de=s.useRef(null),Te=s.useRef(r),Ae=s.useRef(r!==void 0),[De,Ne]=s.useState(r!==void 0),fe=s.useRef(r!==void 0?e:void 0),Oe=s.useRef(void 0),$e=s.useRef(e);$e.current=e;const me=s.useRef(t?.accountId);s.useEffect(()=>{const T=t?.accountId;!T||me.current===T||(me.current=T,!Ae.current&&Q(T))},[t?.accountId]),s.useEffect(()=>{const T=Te.current;if(T===r||(Te.current=r,T===void 0))return;Ae.current=r!==void 0,Ne(r!==void 0),fe.current=r!==void 0?$e.current:void 0,Oe.current=void 0;const U=r?{html:"",text:""}:Et(qe.current,k.current);g([]),p([]),w([]),I(),F(""),P(!1),q(!1),at(U.html),he(U.text),Xe("rich"),it(void 0),be({...U,formatting:[]}),Ye(Z=>Z+1),ee(!1),Fe.current=void 0,Ce.current=!1,ye(r)},[r,I]);const{signature:we}=fa($),qe=s.useRef(we.plainText);qe.current=we.plainText;const k=s.useRef(o);k.current=o;const[Ke,Ye]=s.useState(0),[Ge,at]=s.useState(()=>Et(we.plainText,o).html),[Lt,he]=s.useState(()=>Et(we.plainText,o).text),[ce,Xe]=s.useState("rich"),[re,Pt]=s.useState("en"),[st,it]=s.useState(),[pe,be]=s.useState(()=>({...Et(we.plainText,o),formatting:[]})),[_t,ct]=s.useState(()=>a?.version??0),Mt=a&&a.version>_t&&(r===void 0||W)?a:void 0,{data:j,error:Qe}=At({..._n({path:{outboxMessageId:r??""}}),enabled:!!r&&!W,meta:ia,retry:(T,U)=>!Mn(U)&&T<1});s.useEffect(()=>{Mn(Qe)&&c()},[Qe,c]),s.useEffect(()=>{if(!j||W)return;g(j.toAddresses.map(K=>({email:K,displayName:void 0}))),j.ccAddresses&&j.ccAddresses.length>0&&(p(j.ccAddresses.map(K=>({email:K,displayName:void 0}))),P(!0)),j.bccAddresses&&j.bccAddresses.length>0&&(w(j.bccAddresses.map(K=>({email:K,displayName:void 0}))),q(!0)),j.subject&&F(j.subject);const T=ma(j.htmlBody??""),U=T.html,Z=j.textBody??"";Xe(is(j.htmlBody)),it(T.language??void 0),at(U),he(Z),be({html:U,text:Z,formatting:[]}),Ye(K=>K+1),Q(j.accountId),ee(!0),Ce.current=!0},[j,W]),s.useEffect(()=>{if(n){if(Ae.current&&fe.current===e){const T=Oe.current;if(!T||T.myEmail===t?.email)return}if(fe.current=e,Oe.current={myEmail:t?.email},I(),e==="reply"||e==="reply-all"){const{to:T,cc:U}=xc(n,e,t?.email);g(T),p(U),U.length>0&&P(!0),F(bc(n.envelope.subject))}e==="forward"&&(g([]),p([]),w([]),F(Ec(n.envelope.subject)))}},[e,n,t?.email,I]);const Ie=e==="reply"||e==="reply-all"||e==="forward",{data:ke,isLoading:lt,isError:jt,hasNoRenderablePart:Ft,refetch:O}=ua({messageId:n?.message.messageId,bodyParts:n?.bodyParts,enabled:Ie&&!!n}),M=e==="forward"?"forward":"reply",B=Ie&&!n,L=Ie&&!De&&Ft,H=L&&M==="forward",z=s.useMemo(()=>{if(!Ie||!n||De||!ke)return;const T=ke.kind==="html"?{kind:"html",content:ss(ke.body)}:{kind:"text",content:ke.body};return pc(e==="forward"?"forward":"reply",n.envelope,T)},[Ie,n,De,ke,e]),X=n?.envelope.from[0]?.displayName??n?.envelope.from[0]?.normalizedEmail,le=s.useCallback(T=>{ee(!0),ye(T),i(T)},[i]),{saveState:te,saveError:oe,saveDraft:se,saveImmediately:J,stopAutoSave:ue}=ec({outboxMessageId:r,onDraftCreated:le}),ut=s.useCallback(async()=>{if(r)return{outcome:"ready",outboxMessageId:r};if(!$)return{outcome:"refused",reason:"Choose an account to send from before attaching a file."};if(h.length===0)return{outcome:"refused",reason:Tc};const{htmlBody:T,textBody:U}=rn(ce,pe,re,z),Z=await J({accountId:$,toAddresses:h.map(K=>K.email),ccAddresses:x.length>0?x.map(K=>K.email):void 0,bccAddresses:E.length>0?E.map(K=>K.email):void 0,subject:N||void 0,textBody:U,htmlBody:T,...n&&(e==="reply"||e==="reply-all")?ur(n):{}});return Z.outcome==="failed"?{outcome:"refused",reason:`The draft could not be saved, so the file was not attached: ${Se(Z.error)??"the request failed"}.`}:{outcome:"ready",outboxMessageId:Z.outboxMessageId}},[r,$,h,x,E,N,pe,ce,re,z,n,e,J]),{items:xo,attach:$t,retry:So,remove:Ro,load:Rn,reset:Cn,owns:Co,isLoaded:To,refreshLinks:Ao,storedContent:Do,onRemoved:No,blockingReason:Bt}=Ui({ensureDraft:ut}),Oo=Cr(),Io=Gi({attach:$t,owns:Co,isLoaded:To,storedContent:Do,refreshLinks:()=>r?Oo.fetchQuery({..._n({path:{outboxMessageId:r}}),staleTime:0}).then(T=>Ao(T.attachments)):Promise.resolve(),onRemoved:No,draftAttachments:j&&j.outboxMessageId===r?j.attachments:[],pushError:l}),Tn=s.useRef(r);s.useEffect(()=>{const T=Tn.current;T!==r&&(Tn.current=r,T!==void 0&&Cn(r))},[r,Cn]);const An=s.useRef(void 0);s.useEffect(()=>{!j||j.outboxMessageId!==r||An.current!==j.outboxMessageId&&(An.current=j.outboxMessageId,Rn(j.outboxMessageId,j.attachments))},[j,r,Rn]),s.useEffect(()=>{oe&&l({title:"Couldn't save draft",detail:Se(oe)??"Saving the draft failed.",error:oe})},[oe,l]);const Dn=_e({...oa(),meta:Me}),Nn=_e({...sa(),meta:Me,onError:T=>{l(aa("Couldn't discard draft","The draft wasn't discarded.",T))}}),{data:ko}=At({...Ar(),staleTime:1/0}),Ze=ko?.accounts.find(T=>T.accountId===$),Ut=Ze?pa(Ze):!1,[Ht,Lo]=s.useState(),zt=Ht&&Ht.accountId===$?Ht.reason:void 0,dt=Ze?.composeLanguages,Po=s.useMemo(()=>dt&&dt.length>0?dt:ha(navigator.languages),[dt]),_o=s.useMemo(()=>sc(l),[l]),ft=s.useRef(!1),[On,In]=s.useState(!1),mt=s.useCallback((T,U)=>On?{status:"sending"}:$?zt?{status:"blocked",reason:zt}:Ut?{status:"blocked",reason:dn}:lt||B?{status:"blocked",reason:Rc}:Bt?{status:"blocked",reason:Bt}:U?{status:"blocked",reason:Ac(U)}:T===0?{status:"blocked",reason:Sc}:H?{status:"blocked",reason:kr}:{status:"ready",accountId:$}:{status:"blocked",reason:"Choose an account to send from."},[On,$,zt,Ut,lt,B,Bt,H]),Wt=s.useMemo(()=>mt(h.length+A.entries.length,dr([{label:"To",text:A.unparsed}])),[mt,h.length,A]),Mo=Wt;s.useEffect(()=>{if(!$||ft.current||ne!==void 0&&ne!==r||r&&!W||Nc(h,x,E,N,pe))return;const{htmlBody:T,textBody:U}=rn(ce,pe,re,z),Z={accountId:$,toAddresses:h.map(ae=>ae.email),ccAddresses:x.length>0?x.map(ae=>ae.email):void 0,bccAddresses:E.length>0?E.map(ae=>ae.email):void 0,subject:N||void 0,textBody:U,htmlBody:T},K=JSON.stringify(Z);if(Ce.current){Ce.current=!1,Fe.current=K;return}Fe.current!==K&&(Fe.current=void 0,se(Z))},[$,r,ne,W,h,x,E,N,pe,ce,re,z,se]);const kn=s.useCallback(async(T,U)=>{if(!ft.current){ft.current=!0,In(!0);try{ue();const Z=n&&(e==="reply"||e==="reply-all")?ur(n):{},{htmlBody:K,textBody:ae}=rn(ce,pe,re,z),$o=!r,ht=await J({accountId:T,toAddresses:U.to.map(ve=>ve.email),ccAddresses:U.cc.length>0?U.cc.map(ve=>ve.email):void 0,bccAddresses:U.bcc.length>0?U.bcc.map(ve=>ve.email):void 0,subject:N||void 0,textBody:ae,htmlBody:K,...Z});if(ht.outcome==="failed"){l({title:"Couldn't send message",detail:Se(ht.error)??"Saving the message failed, so nothing was sent. Try again.",error:ht.error});return}const qt=ht.outboxMessageId;if(await Dn.mutateAsync({path:{outboxMessageId:qt}}).catch(ve=>{const Pn=ic(ve);return Pn&&Lo({accountId:T,reason:Pn}),l({title:"Couldn't send message",detail:Se(ve)??($o?"The draft was saved but the send request failed. Try again from the Outbox.":"The send request failed. Try again."),error:ve}),null})===null)return;ue(qt),f(qt),c()}finally{ft.current=!1,In(!1)}}},[N,pe,ce,re,z,e,n,r,J,Dn,ue,f,l,c]),jo=s.useCallback(()=>{ue(r),r&&Nn.mutate({path:{outboxMessageId:r}}),c()},[ue,r,Nn,c]),Vt=s.useCallback(T=>{l({title:"Can't send yet",detail:T}),T===dn&&de.current?.focus()},[l]),Ln=s.useCallback(()=>{if(Wt.status==="sending")return;const T=S.to.current?.commitPending(),U=S.cc.current?.commitPending(),Z=S.bcc.current?.commitPending(),K={to:T?.addresses??h,cc:U?.addresses??x,bcc:Z?.addresses??E},ae=mt(K.to.length,dr([{label:"To",text:T?.unparsed??""},{label:"Cc",text:U?.unparsed??""},{label:"Bcc",text:Z?.unparsed??""}]));if(ae.status!=="sending"){if(ae.status==="blocked"){Vt(ae.reason);return}kn(ae.accountId,K)}},[Wt.status,S,h,x,E,mt,Vt,kn]),Fo=s.useCallback(T=>{Q(T.accountId),u?.(T)},[u]);return d.jsx(Ha,{layout:m,onDropFiles:T=>{$t(T)},banner:d.jsxs(d.Fragment,{children:[Ze&&Ut?d.jsx(rc,{accountId:Ze.accountId,configureRef:de}):null,L?d.jsx(Ka,{mode:M}):null,jt?d.jsxs(wr,{tone:"warning","data-testid":"compose-quote-failed",children:[d.jsx("span",{children:Cc})," ",d.jsx("button",{type:"button",className:"underline",onClick:()=>{O()},children:"Try again"})]}):null]}),header:d.jsx(Oc,{documentGeneration:Ke,selectedAccountId:$,onAccountChange:Fo,toAddresses:h,setToAddresses:g,ccAddresses:x,setCcAddresses:p,bccAddresses:E,setBccAddresses:w,showCc:b,setShowCc:P,showBcc:C,setShowBcc:q,subject:N,setSubject:F,fieldHandles:S,onToPendingChange:y}),quoted:z?d.jsx(Xa,{text:z.text,html:z.html,senderName:X}):void 0,attachments:d.jsx($a,{items:xo,onRemove:T=>{Ro(T)},onRetry:T=>{So(T)}}),actionBar:d.jsx(Ia,{send:Mo,onSend:Ln,onBlocked:Vt,onDiscard:jo,save:te,onAttach:T=>{$t(T)}}),children:d.jsx(s.Suspense,{fallback:d.jsx(Ba,{}),children:d.jsx(wc,{mode:ce,onModeChange:Xe,initialHtml:Ge,initialText:Lt,onChange:be,onSubmit:Ln,initialCaret:e==="new"?"start":void 0,onConversionError:l,languages:Po,initialLanguage:st,onLanguageChange:Pt,spellcheck:_o,insertion:Mt,onInserted:ct,inlineImages:Io},Ke)})})};var kt="Dialog",[Qr]=us(kt),[Ic,ie]=Qr(kt),Zr=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:o,onOpenChange:a,modal:i=!0}=e,c=s.useRef(null),u=s.useRef(null),[m,f]=ms({prop:r,defaultProp:o??!1,onChange:a,caller:kt});return d.jsx(Ic,{scope:t,triggerRef:c,contentRef:u,contentId:Xt(),titleId:Xt(),descriptionId:Xt(),open:m,onOpenChange:f,onOpenToggle:s.useCallback(()=>f(l=>!l),[f]),modal:i,children:n})};Zr.displayName=kt;var Jr="DialogTrigger",kc=s.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=ie(Jr,n),a=je(t,o.triggerRef);return d.jsx(ge.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.open?o.contentId:void 0,"data-state":xn(o.open),...r,ref:a,onClick:Re(e.onClick,o.onOpenToggle)})});kc.displayName=Jr;var En="DialogPortal",[Lc,eo]=Qr(En,{forceMount:void 0}),to=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:o}=e,a=ie(En,t);return d.jsx(Lc,{scope:t,forceMount:n,children:s.Children.map(r,i=>d.jsx(Ot,{present:n||a.open,children:d.jsx($r,{asChild:!0,container:o,children:i})}))})};to.displayName=En;var Nt="DialogOverlay",no=s.forwardRef((e,t)=>{const n=eo(Nt,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,a=ie(Nt,e.__scopeDialog);return a.modal?d.jsx(Ot,{present:r||a.open,children:d.jsx(_c,{...o,ref:t})}):null});no.displayName=Nt;var Pc=Pr("DialogOverlay.RemoveScroll"),_c=s.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=ie(Nt,n),a=ks(),i=je(t,a);return d.jsx(Kr,{as:Pc,allowPinchZoom:!0,shards:[o.contentRef],children:d.jsx(ge.div,{"data-state":xn(o.open),...r,ref:i,style:{pointerEvents:"auto",...r.style}})})}),Ve="DialogContent",ro=s.forwardRef((e,t)=>{const n=eo(Ve,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,a=ie(Ve,e.__scopeDialog);return d.jsx(Ot,{present:r||a.open,children:a.modal?d.jsx(Mc,{...o,ref:t}):d.jsx(jc,{...o,ref:t})})});ro.displayName=Ve;var Mc=s.forwardRef((e,t)=>{const n=ie(Ve,e.__scopeDialog),r=s.useRef(null),o=je(t,n.contentRef,r);return s.useEffect(()=>{const a=r.current;if(a)return ei(a)},[]),d.jsx(oo,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:n.open,onCloseAutoFocus:Re(e.onCloseAutoFocus,a=>{a.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:Re(e.onPointerDownOutside,a=>{const i=a.detail.originalEvent,c=i.button===0&&i.ctrlKey===!0;(i.button===2||c)&&a.preventDefault()}),onFocusOutside:Re(e.onFocusOutside,a=>a.preventDefault())})}),jc=s.forwardRef((e,t)=>{const n=ie(Ve,e.__scopeDialog),r=s.useRef(!1),o=s.useRef(!1);return d.jsx(oo,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:a=>{e.onCloseAutoFocus?.(a),a.defaultPrevented||(r.current||n.triggerRef.current?.focus(),a.preventDefault()),r.current=!1,o.current=!1},onInteractOutside:a=>{e.onInteractOutside?.(a),a.defaultPrevented||(r.current=!0,a.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const i=a.target;n.triggerRef.current?.contains(i)&&a.preventDefault(),a.detail.originalEvent.type==="focusin"&&o.current&&a.preventDefault()}})}),oo=s.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:a,...i}=e,c=ie(Ve,n);return Ms(),d.jsx(d.Fragment,{children:d.jsx(jr,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:a,children:d.jsx(_r,{role:"dialog",id:c.contentId,"aria-describedby":c.descriptionId,"aria-labelledby":c.titleId,"data-state":xn(c.open),...i,ref:t,deferPointerDownOutside:!0,onDismiss:()=>c.onOpenChange(!1)})})})}),ao="DialogTitle",so=s.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=ie(ao,n);return d.jsx(ge.h2,{id:o.titleId,...r,ref:t})});so.displayName=ao;var io="DialogDescription",Fc=s.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=ie(io,n);return d.jsx(ge.p,{id:o.descriptionId,...r,ref:t})});Fc.displayName=io;var co="DialogClose",$c=s.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=ie(co,n);return d.jsx(ge.button,{type:"button",...r,ref:t,onClick:Re(e.onClick,()=>o.onOpenChange(!1))})});$c.displayName=co;function xn(e){return e?"open":"closed"}function Bc(e){if(typeof document>"u")return;let t=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",t.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}const lo=R.createContext({drawerRef:{current:null},overlayRef:{current:null},onPress:()=>{},onRelease:()=>{},onDrag:()=>{},onNestedDrag:()=>{},onNestedOpenChange:()=>{},onNestedRelease:()=>{},openProp:void 0,dismissible:!1,isOpen:!1,isDragging:!1,keyboardIsOpen:{current:!1},snapPointsOffset:null,snapPoints:null,handleOnly:!1,modal:!1,shouldFade:!1,activeSnapPoint:null,onOpenChange:()=>{},setActiveSnapPoint:()=>{},closeDrawer:()=>{},direction:"bottom",shouldAnimate:{current:!0},shouldScaleBackground:!1,setBackgroundColorOnScale:!0,noBodyStyles:!1,container:null,autoFocus:!1}),ot=()=>{const e=R.useContext(lo);if(!e)throw new Error("useDrawerContext must be used within a Drawer.Root");return e};Bc(`[data-vaul-drawer]{touch-action:none;will-change:transform;transition:transform .5s cubic-bezier(.32, .72, 0, 1);animation-duration:.5s;animation-timing-function:cubic-bezier(0.32,0.72,0,1)}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=bottom][data-state=open]{animation-name:slideFromBottom}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=bottom][data-state=closed]{animation-name:slideToBottom}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=top][data-state=open]{animation-name:slideFromTop}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=top][data-state=closed]{animation-name:slideToTop}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=left][data-state=open]{animation-name:slideFromLeft}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=left][data-state=closed]{animation-name:slideToLeft}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=right][data-state=open]{animation-name:slideFromRight}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=right][data-state=closed]{animation-name:slideToRight}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=bottom]{transform:translate3d(0,var(--initial-transform,100%),0)}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=top]{transform:translate3d(0,calc(var(--initial-transform,100%) * -1),0)}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=left]{transform:translate3d(calc(var(--initial-transform,100%) * -1),0,0)}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=right]{transform:translate3d(var(--initial-transform,100%),0,0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=top]{transform:translate3d(0,var(--snap-point-height,0),0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=bottom]{transform:translate3d(0,var(--snap-point-height,0),0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=left]{transform:translate3d(var(--snap-point-height,0),0,0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=right]{transform:translate3d(var(--snap-point-height,0),0,0)}[data-vaul-overlay][data-vaul-snap-points=false]{animation-duration:.5s;animation-timing-function:cubic-bezier(0.32,0.72,0,1)}[data-vaul-overlay][data-vaul-snap-points=false][data-state=open]{animation-name:fadeIn}[data-vaul-overlay][data-state=closed]{animation-name:fadeOut}[data-vaul-animate=false]{animation:none!important}[data-vaul-overlay][data-vaul-snap-points=true]{opacity:0;transition:opacity .5s cubic-bezier(.32, .72, 0, 1)}[data-vaul-overlay][data-vaul-snap-points=true]{opacity:1}[data-vaul-drawer]:not([data-vaul-custom-container=true])::after{content:'';position:absolute;background:inherit;background-color:inherit}[data-vaul-drawer][data-vaul-drawer-direction=top]::after{top:initial;bottom:100%;left:0;right:0;height:200%}[data-vaul-drawer][data-vaul-drawer-direction=bottom]::after{top:100%;bottom:initial;left:0;right:0;height:200%}[data-vaul-drawer][data-vaul-drawer-direction=left]::after{left:initial;right:100%;top:0;bottom:0;width:200%}[data-vaul-drawer][data-vaul-drawer-direction=right]::after{left:100%;right:initial;top:0;bottom:0;width:200%}[data-vaul-overlay][data-vaul-snap-points=true]:not([data-vaul-snap-points-overlay=true]):not(
56
56
  [data-state=closed]
@@ -1 +1 @@
1
- import{j as s,p as t}from"./index-fsuIswbe.js";function x({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{x as K};
1
+ import{j as s,p as t}from"./index-C2US5ZnK.js";function x({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{x as K};
@@ -1 +1 @@
1
- import{j as s,p as a}from"./index-fsuIswbe.js";import{i as o,l}from"./useLabels-k1VKuQrr.js";function c({label:e,onRemove:t,className:n}){const r=o(e.color)?l[e.color]:l.Default;return s.jsxs("span",{className:a("inline-flex items-center gap-1 rounded-full bg-surface-sunken px-2 py-0.5 text-2xs font-medium text-fg-muted shrink-0",n),children:[s.jsx("span",{className:a("size-1.5 shrink-0 rounded-full",r)}),s.jsx("span",{className:"truncate",children:e.name}),t&&s.jsx("button",{type:"button",onClick:()=>t(e.labelId),"aria-label":`Remove label ${e.name}`,className:"ml-0.5 rounded-full text-fg-subtle hover:text-fg",children:"×"})]})}export{c as L};
1
+ import{j as s,p as a}from"./index-C2US5ZnK.js";import{i as o,l}from"./useLabels-DnF0cYWq.js";function c({label:e,onRemove:t,className:n}){const r=o(e.color)?l[e.color]:l.Default;return s.jsxs("span",{className:a("inline-flex items-center gap-1 rounded-full bg-surface-sunken px-2 py-0.5 text-2xs font-medium text-fg-muted shrink-0",n),children:[s.jsx("span",{className:a("size-1.5 shrink-0 rounded-full",r)}),s.jsx("span",{className:"truncate",children:e.name}),t&&s.jsx("button",{type:"button",onClick:()=>t(e.labelId),"aria-label":`Remove label ${e.name}`,className:"ml-0.5 rounded-full text-fg-subtle hover:text-fg",children:"×"})]})}export{c as L};
@@ -0,0 +1 @@
1
+ import{r as f,j as e,ar as h,B as b,T as y,u as N,af as C,a as L,c as I,d as S}from"./index-C2US5ZnK.js";import{L as D}from"./label-chip-D_oZixyY.js";import{S as g}from"./select-DhVwx5IO.js";import{b as v,u as w,c as $,d as E,a as k}from"./useLabels-DnF0cYWq.js";import{a as R}from"./sections-FtpeSpRq.js";import{S as O}from"./settings-screen-zihVEeS9.js";import{E as j}from"./ErrorState-g7-Y1uhe.js";import{C as B}from"./confirm-dialog-BdT5xj08.js";import"./chevron-down-DeNyJr8d.js";import"./list-pages-BCUbyyea.js";import"./avatar-CVmRGlvx.js";import"./badge-CDOouHHB.js";import"./chevron-left-Co8HGTow.js";import"./menu-CEGeda9s.js";import"./circle-question-mark-DuTpeMvV.js";function P({labels:n,onRename:i,onRecolor:l,onDelete:u,deletingLabelId:c}){const[d,r]=f.useState(),[o,m]=f.useState("");if(n.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 a=t=>{const s=o.trim();s!==""&&i(t,s),r(void 0)};return e.jsx("ul",{className:"divide-y divide-line rounded-md border border-line",children:n.map(t=>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:[d===t.labelId?e.jsx(h,{autoFocus:!0,value:o,onChange:s=>m(s.target.value),onBlur:()=>a(t.labelId),onKeyDown:s=>{s.key==="Enter"&&(s.preventDefault(),a(t.labelId)),s.key==="Escape"&&(s.preventDefault(),r(void 0))},"aria-label":`Rename label ${t.name}`}):e.jsx("button",{type:"button",onClick:()=>{r(t.labelId),m(t.name)},"aria-label":`Rename label ${t.name}`,className:"flex items-center gap-2 rounded-sm text-left hover:opacity-80",children:e.jsx(D,{label:t})}),e.jsx("p",{className:"mt-0.5 text-xs text-fg-subtle",children:t.filterCount===0?"Not used in any filter":`Used in ${t.filterCount} ${t.filterCount===1?"filter":"filters"}`})]}),e.jsx(g,{"aria-label":`Color for ${t.name}`,value:t.color,onChange:s=>l(t.labelId,s.target.value),className:"w-28 shrink-0",children:v.map(s=>e.jsx("option",{value:s,children:s},s))}),e.jsx(b,{variant:"ghost",size:"sm",icon:e.jsx(y,{className:"size-4 text-danger"}),onClick:()=>u(t),disabled:c===t.labelId,"aria-label":`Delete label ${t.name}`})]},t.labelId))})}const T=(n,i)=>{if(i===0)return{title:`Delete the "${n}" label?`};const l=i===1?"filter":"filters";return{title:`Delete the "${n}" label?`,description:`This also deletes ${i} ${l} that ${i===1?"applies":"apply"} it — they can't be recovered.`}},H=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 U({accountId:n}){const{createLabel:i,isPending:l,isError:u}=k(n),[c,d]=f.useState(""),[r,o]=f.useState("Default"),m=()=>{const a=c.trim();a!==""&&i(a,r).then(()=>{d(""),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:a=>d(a.target.value),placeholder:"e.g. Receipts","aria-label":"Label name",onKeyDown:a=>{a.key==="Enter"&&(a.preventDefault(),m())}})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("span",{className:"text-xs text-fg-muted",children:"Color"}),e.jsx(g,{value:r,onChange:a=>o(a.target.value),"aria-label":"Label color",className:"w-28",children:v.map(a=>e.jsx("option",{value:a,children:a},a))})]}),e.jsx(b,{variant:"primary",onClick:m,disabled:l||c.trim()==="",children:l?"Creating…":"Create label"})]}),u&&e.jsx(S,{tone:"danger",variant:"soft",children:"Couldn't create that label. Please try again."})]})}function z({account:n}){const i=n.accountId,{labels:l,isPending:u,isError:c,error:d,refetch:r}=w(i),{updateLabel:o}=$(i),{deleteLabel:m,deletingLabelId:a}=E(i),[t,s]=f.useState();return e.jsxs("section",{className:"space-y-2",children:[e.jsx("h2",{className:"text-sm font-semibold text-fg",children:n.email}),u?e.jsx("div",{className:"h-16 animate-pulse rounded-md border border-line bg-surface","aria-busy":"true","aria-label":`Loading labels for ${n.email}`}):c?e.jsx(j,{variant:"inline",title:`Couldn't load labels for ${n.email}`,error:d,onRetry:()=>{r()}}):e.jsx(P,{labels:l,onRename:(p,x)=>o(p,{name:x}),onRecolor:(p,x)=>o(p,{color:x}),onDelete:s,deletingLabelId:a}),e.jsx(U,{accountId:i}),t&&(()=>{const p=T(t.name,t.filterCount);return e.jsx(B,{isOpen:!0,title:p.title,description:p.description,confirmLabel:"Delete label",destructive:!0,isBusy:a===t.labelId,onConfirm:()=>{m(t.labelId),s(void 0)},onCancel:()=>s(void 0)})})()]})}function te(){const n=N(),i=C(),l=R(),[u,c]=f.useState(!0),{data:d,isPending:r,isError:o,error:m,refetch:a}=L(I());return e.jsx(O,{items:i,activeId:"labels",title:"Labels",description:"Mark mail without moving it, per account.",help:H,helpOpen:u,onToggleHelp:()=>c(t=>!t),onSelect:l,onBackToMail:()=>{n({to:"/mail"})},children:r?e.jsx("div",{className:"h-24 animate-pulse rounded-sm border border-line bg-surface","aria-busy":"true","aria-label":"Loading accounts"}):o?e.jsx(j,{title:"Couldn't load accounts",error:m,onRetry:()=>{a()}}):d.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:d.accounts.map(t=>e.jsx(z,{account:t},t.accountId))})})}export{te as component};
@@ -0,0 +1 @@
1
+ async function*r(o,{maxPages:i=Number.POSITIVE_INFINITY,signal:a}={}){let t;for(let e=0;e<i;e+=1){if(a?.aborted)return;const n=await o(t);if(yield n.items,!n.continuationToken)return;t=n.continuationToken}}export{r as l};
@@ -1 +1 @@
1
- import{b as a}from"./index-fsuIswbe.js";const e={name:"mail",size:24,node:[["path",{d:"m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7",key:"132q7q"}],["rect",{x:"2",y:"4",width:"20",height:"16",rx:"2",key:"izxlao"}]]};e.node;const t=a(e);export{t as M};
1
+ import{b as a}from"./index-C2US5ZnK.js";const e={name:"mail",size:24,node:[["path",{d:"m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7",key:"132q7q"}],["rect",{x:"2",y:"4",width:"20",height:"16",rx:"2",key:"izxlao"}]]};e.node;const t=a(e);export{t as M};
@@ -0,0 +1 @@
1
+ import{b as je,j as e,r as x,n as Be,o as $e,D as Ke,X as Qe,p as E,S as qe,C as Ve,q as ye,t as ae,v as He,w as Ue,x as H,y as Ne,z as Se,F as We,T as Ye,E as Ge,M as Xe,G as Je,H as Ze,I as es,B as q,J as Ce,K as ne,N as ss,P as Ie,e as se,Q as we,R as ke,U as ts,V as as,W as ns,Y as Oe,a as Me,Z as os,_ as rs,$ as X,a0 as is,a1 as ls,a2 as cs,a3 as us,a4 as ds,a5 as ms,a6 as xs,a7 as fs,a8 as ps,u as hs,c as gs,a9 as bs,O as vs}from"./index-C2US5ZnK.js";import{l as B,u as J,m as oe,a as js,b as ys,c as Ns}from"./reply-CijQsg4o.js";import{A as Ss,S as Ee,a as Cs,c as Is,L as ws,b as ks,D as Os,d as Ms}from"./DesktopChrome-D8EtAdwf.js";import{u as Es,N as P,a as Rs,b as Ls,i as Ps}from"./nav-link-Df_MDzvJ.js";import{u as te,a as Fs}from"./useMessageBodyContent-DwHmQdO9.js";import{P as Ts}from"./pencil-C1yBZXUb.js";import{c as zs,s as As,M as Ds}from"./MailShell-DemzOx8u.js";import{u as _s,a as Bs,R as $s,s as Ks,i as Qs,H as qs,M as Vs}from"./useRefreshControl-CJGMdQve.js";import{K as Hs,B as Us,S as Ws,u as Ys,s as Gs,b as Xs,a as Js,c as Zs,d as et}from"./search-token-index-BymL-AGz.js";import{u as st}from"./sections-FtpeSpRq.js";import{u as Re}from"./search-scope-7jHRUZbg.js";import{M as tt}from"./menu-CEGeda9s.js";import{B as Le,u as at}from"./useResultFolderIndex-D_NiyNtK.js";import{u as Pe}from"./useQueries-B-1XtDe8.js";import{u as nt}from"./useCollectionThreads-B1vimpsO.js";import{l as re,i as ot,u as rt}from"./useLabels-DnF0cYWq.js";import{f as it,a as lt}from"./folder-failure-BphZCUyZ.js";import{i as ct}from"./outbox-status-BlKn6P0x.js";import{u as ut}from"./roving-focus-C0jnB7ie.js";import{C as dt,A as mt}from"./account-service-status-CHNkQEDe.js";import{C as U}from"./chevron-down-DeNyJr8d.js";import{u as xt}from"./index-v9nM8Dsp.js";import{u as Fe,i as ft}from"./useLayoutTier-lXeQo_2w.js";import{u as pt}from"./useDebouncedValue-C3FljUyl.js";import{E as ht}from"./ErrorState-g7-Y1uhe.js";import{K as ie}from"./kbd-C052hWKm.js";import"./avatar-CVmRGlvx.js";import"./popover-menu-D4kT-xqh.js";import"./mail-Cqr91KmH.js";import"./app-chrome-CGYf2rTW.js";import"./useMediaQuery-BaUDTtu8.js";import"./FullCompose-CN22d_2q.js";import"./confirm-dialog-BdT5xj08.js";import"./circle-check-big-DSc97Qaj.js";import"./refresh-cw-CY0SJjI-.js";import"./useInfiniteQuery-Dd0GYAxg.js";import"./list-pages-BCUbyyea.js";import"./useSignature-cMh39FpD.js";import"./account-form-helpers-DhckT_PN.js";import"./suggest-list-DJUWGfG3.js";const Te={name:"lock",size:24,node:[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]]};Te.node;const gt=je(Te);const ze={name:"square-pen",size:24,node:[["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"}]],aliases:["pen-box","edit","pen-square"]};ze.node;const bt=je(ze);function vt({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(Ts,{className:"size-6"})})}const jt=({isOpen:s,onClose:t})=>{const a=x.useRef(null);return Be({id:"shortcuts",open:s,answers:{back:t}}),$e(a,s),s?e.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[e.jsx(Ke,{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:E("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(Qe,{className:"size-5"})})]}),e.jsx("div",{className:"grid gap-x-8 gap-y-6 sm:grid-cols-2",children:Hs.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((i,l)=>e.jsxs(x.Fragment,{children:[l>0&&o.keys[0]==="g"&&e.jsx("span",{className:"text-2xs text-fg-subtle",children:"then"}),e.jsx(ie,{children:i})]},i))})]},`${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(ie,{children:"Esc"})," to close"]})})]})]}):null},yt="button:not([disabled]), a[href]",$="outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-surface-sunken";function Nt({active:s,dimmed:t,indent:a}){return E("flex w-full items-center gap-2 rounded-md px-2 py-1 text-left text-sm transition-colors",$,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 St({icon:s,label:t,count:a,active:n,failed:o}){return e.jsxs(e.Fragment,{children:[s&&e.jsx("span",{className:E("shrink-0",n?"text-accent-2":"text-fg-subtle"),children:s}),e.jsx("span",{className:"flex-1 truncate",children:t}),o&&e.jsx(Ne,{className:"size-3.5 shrink-0 text-danger","aria-hidden":"true"}),a!=null&&a>0&&e.jsx("span",{className:E("text-2xs tabular-nums",n?"text-accent-2":"text-fg-subtle"),children:a})]})}function Ct({label:s,text:t,dimmed:a}){return e.jsxs("div",{role:"note","aria-label":`${s} — ${t}`,className:E("flex w-full cursor-not-allowed items-start gap-2 rounded-md px-2 py-1 text-sm text-fg-subtle",a&&"opacity-55"),children:[e.jsx(gt,{className:"mt-0.5 size-4 shrink-0","aria-hidden":"true"}),e.jsxs("span",{className:"min-w-0 flex-1",children:[e.jsx("span",{className:"block truncate italic",children:s}),e.jsx("span",{className:"block text-2xs",children:t})]})]})}function z({icon:s,label:t,count:a,active:n,dimmed:o,indent:i,navId:l,linkComponent:u,ariaLabel:f,title:c,note:g,onClick:m}){if(g?.kind==="unavailable")return e.jsx(Ct,{label:t,text:g.text,dimmed:o});const b=Nt({active:n,dimmed:o,indent:i}),d=e.jsx(St,{icon:s,label:t,count:a,active:n,failed:g!==void 0}),v=f??t,I=g?`${v} — ${g.text}`:v,j=g?`${c??t} — ${g.text}`:c;return l&&u?u({navId:l,className:b,ariaLabel:I,title:j,onClick:m,children:d}):e.jsx("button",{type:"button",onClick:m,className:b,"aria-label":g?I:f,title:j,children:d})}const le={inbox:0,flagged:1,drafts:2,sent:3,archive:4,all:5,junk:6,trash:7};function It(s){switch(s){case"inbox":return e.jsx(es,{className:"size-4"});case"flagged":return e.jsx(ye,{className:"size-4"});case"drafts":return e.jsx(Ze,{className:"size-4"});case"sent":return e.jsx(Se,{className:"size-4"});case"archive":return e.jsx(Je,{className:"size-4"});case"all":return e.jsx(Xe,{className:"size-4"});case"junk":return e.jsx(Ge,{className:"size-4"});case"trash":return e.jsx(Ye,{className:"size-4"})}}function wt(s){const t=ot(s)?re[s]:re.Default;return e.jsx("span",{className:"flex size-4 items-center justify-center",children:e.jsx("span",{className:E("size-2.5 rounded-full",t)})})}const ce=s=>s.role!=null,W=8,ue="remit.nav.folders.open.",de="remit.nav.account.open.",me="remit.nav.folder.open.";function Y(s,t,a){try{const n=localStorage.getItem(s+t);return n===null?a:n!=="0"}catch{return a}}function G(s,t,a){try{localStorage.setItem(s+t,a?"1":"0")}catch{}}function kt({account:s,selectedNavId:t,onSelectNav:a,linkComponent:n}){const[o,i]=x.useState(()=>Y(de,s.id,!0)),[l,u]=x.useState(()=>Y(ue,s.id,!0)),[f,c]=x.useState(!1),[g,m]=x.useState({}),b=r=>g[r]??Y(me,r,!0),d=r=>{const N=!b(r);G(me,r,N),m(T=>({...T,[r]:N}))},v=()=>{i(r=>{const N=!r;return G(de,s.id,N),N})},I=()=>{u(r=>{const N=!r;return G(ue,s.id,N),N})},j=s.mailboxes.filter(ce).sort((r,N)=>le[r.role]-le[N.role]),y=s.mailboxes.filter(r=>!ce(r)),O=s.hierarchyDelimiter,F=new Map(y.map(r=>[r.id,r])),M=y.map(r=>({id:r.id,label:r.name,path:r.fullPath??r.name})),D=new Set(M.map(r=>r.path)),p=new Set(M.flatMap(r=>ae(r.path,O).filter(N=>D.has(N)))),S=M.find(r=>r.id===t),C=new Set(S?ae(S.path,O):[]),k=new Set(M.filter(r=>C.has(r.path)||b(r.id)).map(r=>r.path)),h=He(Ue(M,O),k,O).flatMap(r=>{const N=F.get(r.folder.id);return N?[{...r,mailbox:N}]:[]}),w=f||h.length<=W?h:h.slice(0,W),R=h.length-w.length,L=s.status??"ready",_=s.syncedServices!==void 0&&!s.syncedServices.includes("Mail"),A=L==="ready"&&j.length===0&&y.length===0;return e.jsxs("div",{className:"mt-3",children:[e.jsxs("button",{type:"button",onClick:v,"aria-expanded":o,className:E("flex w-full items-center gap-1.5 px-2 pb-1 text-left transition-colors hover:text-fg",$,s.muted&&"opacity-55"),children:[o?e.jsx(U,{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(Us,{className:"size-3 shrink-0 text-fg-subtle"}),e.jsx("span",{className:"text-2xs text-fg-subtle",children:"muted"})]}),_&&e.jsxs(e.Fragment,{children:[e.jsx(dt,{className:"size-3 shrink-0 text-fg-subtle"}),e.jsx("span",{className:"text-2xs text-fg-subtle",children:mt.Mail})]})]}),o&&e.jsxs(e.Fragment,{children:[L==="loading"&&e.jsx("div",{className:"px-2 py-1 text-sm text-fg-muted",children:"Loading…"}),L==="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(Ne,{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"})]}),A&&e.jsx("div",{className:"px-2 py-1 text-sm text-fg-muted",children:"No mailboxes"}),L==="ready"&&e.jsxs(e.Fragment,{children:[j.map(r=>e.jsx(z,{navId:r.id,linkComponent:n,icon:It(r.role),label:r.name,ariaLabel:r.name,title:r.fullPath??r.name,note:r.note,count:r.unseen,active:t===r.id,dimmed:s.muted,onClick:()=>a?.(r.id)},r.id)),s.outboxPending!==void 0&&e.jsx(z,{navId:"outbox",linkComponent:n,icon:e.jsx(Se,{className:"size-4"}),label:"Outbox",ariaLabel:"Outbox",count:s.outboxPending>0?s.outboxPending:void 0,active:t==="outbox",dimmed:s.muted,onClick:()=>a?.("outbox")}),y.length>0&&e.jsxs(e.Fragment,{children:[e.jsxs("button",{type:"button",onClick:I,"aria-expanded":l,className:E("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",$),children:[l?e.jsx(U,{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:y.length})]}),l&&e.jsxs(e.Fragment,{children:[w.map(({mailbox:r,folder:N,depth:T,expanded:V})=>e.jsxs("div",{className:"flex items-center",style:{paddingLeft:`${T*.75}rem`},children:[p.has(N.path)?e.jsx("button",{type:"button",onClick:()=>d(r.id),"aria-expanded":V,"aria-label":`${V?"Collapse":"Expand"} ${r.name}`,className:E("flex size-5 shrink-0 items-center justify-center rounded text-fg-subtle transition-colors hover:text-fg",$),children:V?e.jsx(U,{className:"size-3"}):e.jsx(H,{className:"size-3"})}):e.jsx("span",{className:"size-5 shrink-0"}),e.jsx("div",{className:"min-w-0 flex-1",children:e.jsx(z,{navId:r.id,linkComponent:n,icon:e.jsx(We,{className:"size-4"}),label:r.name,ariaLabel:r.name,title:r.fullPath??r.name,note:r.note,count:r.unseen,active:t===r.id,dimmed:s.muted,onClick:()=>a?.(r.id)})})]},r.id)),(R>0||f)&&h.length>W&&e.jsx("button",{type:"button",onClick:()=>c(r=>!r),className:E("ml-7 flex items-center px-2 py-1 text-2xs font-medium text-accent transition-colors hover:underline",$),children:f?"Show less":`Show all (${h.length})`})]})]})]})]})]})}function Ot({accounts:s,selectedNavId:t,briefUnseen:a,onSelectNav:n,variant:o="desktop",linkComponent:i,labels:l=[],calendarNav:u="hidden"}){const f=x.useRef(null);ut({containerRef:f,itemSelector:yt});const c=o==="drawer",g=e.jsxs("nav",{ref:c?f:void 0,className:c?"px-2 py-2":"flex-1 overflow-y-auto px-2 py-2","aria-label":"Mailboxes",children:[e.jsx(z,{navId:"brief",linkComponent:i,icon:e.jsx(qe,{className:"size-4"}),label:"Daily brief",ariaLabel:"Daily brief",count:a,active:t==="brief",onClick:()=>n?.("brief")}),l.map(m=>e.jsx(z,{navId:m.id,linkComponent:i,icon:wt(m.color),label:m.name,ariaLabel:m.name,count:m.unseen,active:t===m.id,onClick:()=>n?.(m.id)},m.id)),u==="shown"&&e.jsx(z,{navId:"calendar",linkComponent:i,icon:e.jsx(Ve,{className:"size-4"}),label:"Calendar",ariaLabel:"Calendar",active:t==="calendar",onClick:()=>n?.("calendar")}),e.jsx(z,{navId:"flagged",linkComponent:i,icon:e.jsx(ye,{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(m=>e.jsx(kt,{account:m,selectedNavId:t,onSelectNav:n,linkComponent:i},m.id))]});return c?g:e.jsx("aside",{ref:f,className:"flex h-full w-full flex-col bg-surface-sunken",children:g})}function Mt(){const s=Re();if(!s)return null;const t=s.showNavPane?!s.navCollapsed:!1;return e.jsx(q,{variant:"ghost",size:"sm",icon:e.jsx(tt,{className:"size-4"}),onClick:s.toggleNav,"aria-label":t?"Hide folders":"Show folders","aria-expanded":t,title:"Folders",className:"shrink-0"})}const Et={global:"Search all mail",pending:"Search mail",scoped:"Search this folder"};function Rt({search:s,onCompose:t,onReportBug:a,onOpenSettings:n,settingsAttention:o,composeShortcut:i,refreshControl:l,account:u}){return e.jsx(Ss,{leading:e.jsx(Mt,{}),search:e.jsx(Ws,{value:s.value,onChange:s.onChange,onClear:s.onClear,onClearQuery:s.onClearQuery,chips:s.chips,onRemoveChip:s.onRemoveChip,placeholder:Et[s.scope]}),actions:e.jsxs(e.Fragment,{children:[e.jsx(q,{variant:"ghost",size:"sm",icon:e.jsx(bt,{className:"size-4"}),title:i?`Compose (${i})`:"Compose","aria-label":"Compose",onClick:t}),e.jsx(q,{variant:"ghost",size:"sm",icon:e.jsx(Le,{className:"size-4"}),title:"Report a bug","aria-label":"Report a bug",onClick:a}),e.jsx(q,{variant:"ghost",size:"sm",icon:e.jsx(Ce,{label:o,children:e.jsx(Ee,{className:"size-4"})}),title:"Settings","aria-label":o?`Settings — ${o}`:"Settings",onClick:n}),l,u]})})}const Z="label:";function Ae(s){return`${Z}${s}`}function Lt(s){return s.startsWith(Z)?s.slice(Z.length):void 0}function Pt(){const{pathname:s}=Es(),t=ne({from:"/mail/$mailboxId",shouldThrow:!1}),a=ne({from:"/mail/label/$labelId",shouldThrow:!1});return B(s,"/settings")?"settings":B(s,"/calendar")?"calendar":B(s,"/mail/outbox")?"outbox":B(s,"/mail/flagged")?"flagged":B(s,"/mail/brief")?"brief":a?.labelId?Ae(a.labelId):t?.mailboxId??""}function Ft(){const s=ss(),t=J({select:c=>oe(c.location.pathname)}),a=J({select:c=>js(c.location.search)}),[n,o]=x.useState(a),i=pt(n,200),[l,u]=x.useState(t);if(l!==t){const c=As(l,t,a);u(t),c!==void 0&&o(c)}const f=x.useCallback(c=>{u(oe(s.state.location.pathname)),o(c)},[s]);return{searchInput:n,committedQuery:zs(n,i),viewKey:t,setSearchInput:f}}const Tt=()=>{const s=te();return ys()?null:e.jsx(vt,{onCompose:s})};function xe({accounts:s}){const{searchInput:t,onSearchChange:a,onSearchClear:n,onSearchClearQuery:o,resultFolderIndex:i}=Ie(),l=se(),u=st(),f=te(),{scope:c,clearScope:g}=Ys(s),m=we(),b=c.kind==="scoped"?[{id:c.chip.id,label:c.chip.label,tone:"scope"}]:void 0,d=x.useMemo(()=>s.map(O=>O.accountId),[s]),{hasNewMail:v}=_s(),{state:I,errorMessage:j,refresh:y}=Bs(d,{onSettled:()=>ts(l,as(i.keys()))});return e.jsx(Rt,{search:{value:t,scope:c.kind,chips:b,onChange:a,onClear:n,onClearQuery:o,onRemoveChip:g},onCompose:f,onReportBug:ke,onOpenSettings:()=>u("accounts"),settingsAttention:m,composeShortcut:Gs("compose"),refreshControl:e.jsx($s,{state:I,onRefresh:y,label:"Refresh all accounts",errorMessage:j,hasUpdate:v(d)}),account:e.jsx(Cs,{})})}function zt(){return e.jsxs("button",{type:"button",onClick:ke,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(Le,{className:"size-4 shrink-0"}),e.jsx("span",{className:"flex-1 truncate text-left",children:"Report a bug"})]})}const At=({fullPath:s,hierarchyDelimiter:t})=>s.split(t).slice(0,-1).join(t);function Dt(s,t){const a=new Set(t.flatMap(o=>o.folders.flatMap(i=>i.state==="Missing"?[]:[i.mailboxId]))),n=new Set(s.filter(o=>a.has(o.mailboxId)).map(At));return s.filter(o=>!a.has(o.mailboxId)&&!n.has(o.fullPath))}const fe=s=>/^\d/.test(s),_t=(s,t)=>{const a=fe(s),n=fe(t);return a&&!n?-1:!a&&n?1:s.localeCompare(t,void 0,{sensitivity:"base",numeric:!0})};function Bt(s,t,a){const n=[],o=[];for(const i of s)t.has(i.mailboxId)?n.push(i):o.push(i);return o.sort((i,l)=>_t(X(i,void 0,a),X(l,void 0,a))),{system:n,labels:o}}const $t=s=>{const t=it(s);if(t)return{kind:"unavailable",text:t};const a=lt(s);if(a)return{kind:"failure",text:a}};function Kt(s,t,a){const n=is(t)&&s.unseenCount>0;return{id:s.mailboxId,name:X(s,t,a),unseen:n?s.unseenCount:void 0,role:t,fullPath:s.fullPath,note:$t(s)}}function Qt(s,t){return s.map(a=>{const n=t.get(a.labelId)??0;return{id:Ae(a.labelId),name:a.name,color:a.color,unseen:n>0?n:void 0}})}function pe({accounts:s,onMailboxSelect:t,variant:a="desktop"}){const n=se(),o=Pt(),{onSearchChange:i}=Ie(),{t:l}=ns("mail",{useSuspense:!1}),u=x.useCallback((p,S)=>l(p,{defaultValue:S}),[l]),f=Pe({queries:s.map(p=>({...Oe({path:{accountId:p.accountId}}),staleTime:1/0}))}),{labels:c,isPending:g,isError:m}=rt(s[0]?.accountId),b=!g||m,d=x.useMemo(()=>c.map(p=>p.labelId),[c]),v=nt(d),I=x.useMemo(()=>Qt(c,v),[c,v]),{data:j}=Me(os()),y=x.useMemo(()=>(j?.items??[]).filter(p=>ct(p.status)).length,[j?.items]),O=x.useMemo(()=>s.map((p,S)=>{const C=f[S],k=C?.data?.items??[],h=Dt(k,c),w=rs(p.folderAppointments),{system:R,labels:L}=Bt(h,w,u),_=C?.isError?"error":C?.isLoading||!b?"loading":"ready";return{id:p.accountId,label:p.email,email:p.email,hierarchyDelimiter:k[0]?.hierarchyDelimiter??"",muted:!!p.muted,outboxPending:y,status:_,onRetry:()=>C?.refetch(),mailboxes:[...R,...L].map(A=>Kt(A,w.get(A.mailboxId),u))}}),[s,f,y,u,c,b]),F=p=>{n.invalidateQueries({queryKey:ls({path:{mailboxId:p},query:{order:"desc"}})})},M=({navId:p,className:S,ariaLabel:C,title:k,children:h,onClick:w})=>{if(p==="brief")return e.jsx(P,{to:"/mail/brief",search:{q:void 0},activeOptions:{includeSearch:!1},onClick:()=>w?.(),className:S,"aria-label":C,title:k,children:h});if(p==="calendar")return e.jsx(P,{to:"/calendar",onClick:()=>w?.(),className:S,"aria-label":C,title:k,children:h});if(p==="outbox")return e.jsx(P,{to:"/mail/outbox",search:{q:void 0},onClick:()=>w?.(),className:S,"aria-label":C,title:k,children:h});if(p==="flagged")return e.jsx(P,{to:"/mail/flagged",search:{q:void 0},onClick:()=>w?.(),className:S,"aria-label":C,title:k,children:h});const R=Lt(p);return R?e.jsx(P,{to:"/mail/label/$labelId",params:{labelId:R},search:{q:void 0},onClick:()=>w?.(),className:S,"aria-label":C,title:k,children:h}):p==="settings"?e.jsx(P,{to:"/settings/accounts",onClick:()=>w?.(),className:S,"aria-label":C,title:k,children:h}):e.jsx(P,{to:"/mail/$mailboxId",params:{mailboxId:p},search:{q:void 0},onClick:()=>{F(p),w?.()},className:S,"aria-label":C,title:k,children:h})},D=()=>{i(""),t?.()};return e.jsx(Ot,{accounts:O,labels:I,selectedNavId:o,onSelectNav:D,linkComponent:M,variant:a})}function qt({accounts:s,onMailboxSelect:t}){const n=Re()?.showNavPane??!0,o=we();return n?e.jsx(pe,{accounts:s}):e.jsxs("div",{className:"flex h-full flex-col",children:[e.jsx("div",{className:"flex-1 overflow-y-auto",children:e.jsx(pe,{accounts:s,onMailboxSelect:t,variant:"drawer"})}),e.jsxs("div",{className:"border-t border-line px-2 py-2",children:[e.jsxs(P,{to:"/settings/accounts",onClick:t,children:[e.jsx(Ce,{label:o,children:e.jsx(Ee,{className:"size-4 shrink-0"})}),e.jsx("span",{className:"flex-1 truncate text-left",children:"Settings"})]}),e.jsx(zt,{}),e.jsx(Is,{children:({signOut:i})=>e.jsxs("button",{type:"button",onClick:()=>{t?.(),i()},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(ws,{className:"size-4 shrink-0"}),e.jsx("span",{className:"flex-1 truncate text-left",children:"Sign out"})]})})]})]})}function Vt(s){const t=Pe({queries:s.map(a=>({...Oe({path:{accountId:a.accountId}}),staleTime:1/0}))});return x.useMemo(()=>Xs(t.map(a=>a.data?.items??[])),[t])}const De="remit:intelligence-open";function Ht(){try{return localStorage.getItem(De)!=="closed"}catch{return!0}}function Ut(s){try{localStorage.setItem(De,s?"open":"closed")}catch{}}function he({panels:s,prefersOpen:t,isDesktop:a,hasThread:n,raisedFor:o,openMessage:i}){if(o!==null&&o===i)return!0;const l=s.filter(u=>u!=="sidebar");return l.length>0?l.includes("intelligence"):a&&n&&t}const Wt=()=>{const s=Fe(),t=Rs(),a=Ls(),n=t.find(Ps),o=Js(),[i,l]=x.useState(Ht),u=o?`${o.threadId}/${o.messageId??""}`:null,[f,c]=x.useState(null),g={panels:t,prefersOpen:i,isDesktop:s==="desktop",hasThread:o!==void 0,openMessage:u},m=he({...g,raisedFor:f}),b=he({...g,raisedFor:null}),d=x.useCallback((y,O)=>{a([...y?["intelligence"]:[],...O?[O]:[]])},[a]),v=x.useCallback(y=>{d(b,y)},[b,d]),I=x.useCallback(()=>{if(m&&!b){c(null);return}const y=!m;Ut(y),l(y),c(null),d(y,n)},[b,m,n,d]),j=x.useCallback(()=>{c(u)},[u]);return{openOverlay:n,intelligenceOpen:m,showOverlay:v,toggleIntelligence:I,raiseIntelligence:j}};var K={exports:{}},ge;function Yt(){if(ge)return K.exports;ge=1;const s=(t,a,n)=>new Promise((o,i)=>{if(n=Object.assign({concurrency:1/0},n),typeof a!="function")throw new TypeError("Mapper function is required");const{concurrency:l}=n;if(!(typeof l=="number"&&l>=1))throw new TypeError(`Expected \`concurrency\` to be a number from 1 and up, got \`${l}\` (${typeof l})`);const u=[],f=t[Symbol.iterator]();let c=!1,g=!1,m=0,b=0;const d=()=>{if(c)return;const v=f.next(),I=b;if(b++,v.done){g=!0,m===0&&o(u);return}m++,Promise.resolve(v.value).then(j=>a(j,I)).then(j=>{u[I]=j,m--,d()},j=>{c=!0,i(j)})};for(let v=0;v<l&&(d(),!g);v++);});return K.exports=s,K.exports.default=s,K.exports}var Gt=Yt();const Xt=cs(Gt),Jt=900*1e3,Zt=30,ea=(s,t)=>{if(!s)return t;const a=Number.parseInt(s,10);return Number.isFinite(a)&&a>0?a:t},sa=30*1e3,ta=s=>Math.max(ea(s,Zt)*1e3,sa),_e=ta(ps().mailboxPollIntervalSeconds),Q=(s=Date.now(),t=_e)=>Qs(s)?Math.min(qs,t):t,aa=5,ee=new Set,na=(s,t,a=Jt)=>s.filter(n=>{const o=n.lastSyncAt;return o==null?!0:t-o>a}).map(n=>n.accountId),oa=(s,t,a=_e)=>s-t>=a,ra=(s,t)=>s.filter(a=>!t.has(a)),be=(s,t)=>{if(ee.delete(s),ms(t)||xs(t,{softError:!0})){fs(t,{softError:!0});return}console.warn("[remit] background mailbox sync failed",{accountId:s,error:t})},ve=(s,t)=>us({path:{accountId:s},throwOnError:!0}).then(()=>{t.invalidateQueries({queryKey:ds({path:{accountId:s}})})}),ia=s=>{const t=se(),a=x.useRef(s);a.current=s;const n=s.map(o=>o.accountId).join(",");x.useEffect(()=>{const o=Date.now(),l=na(a.current,o).filter(u=>!ee.has(u));if(l.length!==0)for(const u of l)ee.add(u),ve(u,t).catch(f=>{be(u,f)})},[n,t]),x.useEffect(()=>{let o=Date.now(),i;const l=new Set,u=()=>{o=Date.now();const b=ra(a.current.map(d=>d.accountId),l);for(const d of b)l.add(d);Xt(b,d=>ve(d,t).catch(v=>{be(d,v)}).finally(()=>{l.delete(d)}),{concurrency:aa})},f=()=>{if(document.visibilityState==="visible"){u(),i=setTimeout(f,Q());return}},c=()=>{if(document.visibilityState!=="visible")return;i!==void 0&&clearTimeout(i);const b=Date.now(),d=Q(b);if(oa(b,o,d)){u(),i=setTimeout(f,d);return}i=setTimeout(f,o+d-b)},g=()=>{document.visibilityState==="visible"&&(i!==void 0&&clearTimeout(i),o=Date.now(),i=setTimeout(f,Q()))};i=setTimeout(f,Q()),document.addEventListener("visibilitychange",c);const m=Ks(g);return()=>{i!==void 0&&clearTimeout(i),document.removeEventListener("visibilitychange",c),m()}},[n,t])};function Wa(){const s=hs(),t=Fe(),a=ft(t),{openOverlay:n,intelligenceOpen:o,showOverlay:i,toggleIntelligence:l,raiseIntelligence:u}=Wt(),f=n==="shortcuts",c=n==="nav",{searchInput:g,committedQuery:m,viewKey:b,setSearchInput:d}=Ft(),{data:v,isLoading:I,isError:j,error:y,refetch:O}=Me({...gs(),staleTime:1/0}),F=!!(v&&(v.accounts?.length??0)===0);x.useEffect(()=>{F&&s({to:"/onboarding",replace:!0})},[F,s]),xt({enabled:!f,bindings:[{key:"?",action:"help",handler:()=>i("shortcuts"),noModifiers:!1,preventDefault:!0}]});const M=te(),D=Fs(),p=J({select:T=>Ns(T.matches)?.list==="mailbox"}),S=x.useMemo(()=>({compose:M}),[M]);Zs({enabled:!p&&!D,handlers:S});const C=x.useCallback(()=>{d("")},[d]),k=x.useCallback(()=>{d("")},[d]),h=v?.accounts??[],w=x.useMemo(()=>h.map(T=>T.accountId),[h]),R=Vt(h),L=at(h).index,_=x.useMemo(()=>et(h),[h]);ia(h);const A=x.useCallback(()=>{n==="nav"&&i(void 0)},[n,i]),r={accounts:h,mailboxNameIndex:R,accountNameIndex:_,resultFolderIndex:L,searchQuery:m,searchInput:g,searchViewKey:b,onSearchChange:d,onSearchClear:C,onSearchClearQuery:k,intelligenceOpen:o,onToggleIntelligence:l,onRaiseIntelligence:u},N={isSinglePane:a,isLoading:I||F,intelligenceOpen:o,nav:e.jsx(qt,{accounts:h,onMailboxSelect:A}),topBar:a?void 0:e.jsx(xe,{accounts:h}),appBar:t==="phone"?void 0:e.jsx(Ms,{}),overlay:a?e.jsx(Tt,{}):void 0,navOpen:c,onOpenNav:()=>i("nav"),onCloseNav:()=>i(void 0)};return e.jsx(bs.Provider,{value:r,children:e.jsxs(Vs,{accountIds:w,children:[e.jsx(ks,{children:j?e.jsx(Os,{topBar:e.jsx(xe,{accounts:h}),children:e.jsx("div",{className:"flex h-full items-center justify-center bg-canvas p-4",children:e.jsx(ht,{title:"Couldn't load your account",error:y,onRetry:()=>{O()}})})}):e.jsx(Ds,{chrome:N,children:e.jsx(vs,{})})}),e.jsx(jt,{isOpen:f,onClose:()=>i(void 0)})]})})}export{Wa as component,Ie as useMailContext};
@@ -1 +1 @@
1
- import{b as a}from"./index-fsuIswbe.js";const e={name:"menu",size:24,node:[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]]};e.node;const n=a(e);export{n as M};
1
+ import{b as a}from"./index-C2US5ZnK.js";const e={name:"menu",size:24,node:[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]]};e.node;const n=a(e);export{n as M};
@@ -1 +1 @@
1
- import{j as f,p as s,N as b,cq as d,cr as x,r as i,u as P,cs as N,ct as S}from"./index-fsuIswbe.js";import{u as O}from"./useMediaQuery-Hy81MQ2M.js";const l="outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-surface",k="outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-inset",R={nav:{base:s("flex w-full items-center gap-2 rounded-md px-2 py-1 text-sm transition-colors",l),rest:"text-fg-muted hover:bg-surface hover:text-fg",current:"bg-accent-2-soft font-medium text-accent-2"},row:{base:s("relative flex w-full items-start text-left transition-colors",k),rest:"hover:bg-surface-sunken",current:"bg-accent-2-soft"},inline:{base:s("rounded-sm underline-offset-2 transition-colors hover:underline",l),rest:"text-accent hover:text-accent-hover",current:"font-medium text-accent"}};function j(e){return e!==void 0&&e!==!1&&e!=="false"}function w({variant:e="nav",current:n,"aria-current":t,className:p,children:v,ref:h,...g}){const u=n??t,r=R[e];return f.jsx("a",{ref:h,"aria-current":u,className:s(r.base,j(u)?r.current:r.rest,p),...g,children:v})}function I(e){const n=b();return d(n.stores.location,x(e,n))}const o=["intelligence","sidebar","nav","shortcuts"],L=["nav","shortcuts"],m=e=>L.includes(e);function G(e,n){return[...e.filter(t=>!m(t)),...n?[n]:[]]}const y=N(o);function a(e){const n=new Set(e.split(",").map(t=>y.safeParse(t)).filter(t=>t.success).map(t=>t.data));return o.filter(t=>n.has(t))}function c(e){return o.filter(n=>e.includes(n)).join(",")}function M(){const e=I({select:n=>c(a(n.hash))});return i.useMemo(()=>a(e),[e])}const E=(e,n)=>!m(e)&&n;function F(e){return(n="")=>c(a(n).filter(t=>E(t,e)))}function T(){const e=O();return i.useMemo(()=>F(e),[e])}function q(){const e=P();return i.useCallback(n=>{e({search:!0,hash:c(n),replace:!0,hashScrollIntoView:!1})},[e])}const _=S(w);function A({fragment:e,...n}){const t=T();return f.jsx(_,{...n,hash:e??t})}export{A as N,M as a,q as b,T as c,m as i,G as p,I as u};
1
+ import{j as f,p as s,N as b,cq as d,cr as x,r as i,u as P,cs as N,ct as S}from"./index-C2US5ZnK.js";import{u as O}from"./useMediaQuery-BaUDTtu8.js";const l="outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-surface",k="outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-inset",R={nav:{base:s("flex w-full items-center gap-2 rounded-md px-2 py-1 text-sm transition-colors",l),rest:"text-fg-muted hover:bg-surface hover:text-fg",current:"bg-accent-2-soft font-medium text-accent-2"},row:{base:s("relative flex w-full items-start text-left transition-colors",k),rest:"hover:bg-surface-sunken",current:"bg-accent-2-soft"},inline:{base:s("rounded-sm underline-offset-2 transition-colors hover:underline",l),rest:"text-accent hover:text-accent-hover",current:"font-medium text-accent"}};function j(e){return e!==void 0&&e!==!1&&e!=="false"}function w({variant:e="nav",current:n,"aria-current":t,className:p,children:v,ref:h,...g}){const u=n??t,r=R[e];return f.jsx("a",{ref:h,"aria-current":u,className:s(r.base,j(u)?r.current:r.rest,p),...g,children:v})}function I(e){const n=b();return d(n.stores.location,x(e,n))}const o=["intelligence","sidebar","nav","shortcuts"],L=["nav","shortcuts"],m=e=>L.includes(e);function G(e,n){return[...e.filter(t=>!m(t)),...n?[n]:[]]}const y=N(o);function a(e){const n=new Set(e.split(",").map(t=>y.safeParse(t)).filter(t=>t.success).map(t=>t.data));return o.filter(t=>n.has(t))}function c(e){return o.filter(n=>e.includes(n)).join(",")}function M(){const e=I({select:n=>c(a(n.hash))});return i.useMemo(()=>a(e),[e])}const E=(e,n)=>!m(e)&&n;function F(e){return(n="")=>c(a(n).filter(t=>E(t,e)))}function T(){const e=O();return i.useMemo(()=>F(e),[e])}function q(){const e=P();return i.useCallback(n=>{e({search:!0,hash:c(n),replace:!0,hashScrollIntoView:!1})},[e])}const _=S(w);function A({fragment:e,...n}){const t=T();return f.jsx(_,{...n,hash:e??t})}export{A as N,M as a,q as b,T as c,m as i,G as p,I as u};
@@ -0,0 +1 @@
1
+ import{C as o}from"./CalendarEventEditor-BcGWIsNu.js";import"./index-C2US5ZnK.js";import"./draft-B-aWKHzd.js";import"./agenda-time-BwFncCBt.js";import"./calendar-guests-BVwUAczN.js";import"./calendar-event-popup-O-JrsyRu.js";import"./useCalendarSuggestions-CJGnqdiK.js";import"./ErrorState-g7-Y1uhe.js";import"./useQueries-B-1XtDe8.js";import"./list-pages-BCUbyyea.js";import"./pencil-C1yBZXUb.js";import"./circle-question-mark-DuTpeMvV.js";import"./useCalendarData-AQi5DlI1.js";import"./useCalendarTasks-BBv_7Q0J.js";import"./useCalendarScheduling-BzXa0l-K.js";import"./useDebouncedValue-C3FljUyl.js";import"./calendar-format-BwCpz-JZ.js";import"./nav-link-Df_MDzvJ.js";import"./useMediaQuery-BaUDTtu8.js";import"./calendar-BHWGBart.js";import"./reply-CijQsg4o.js";import"./CalendarQuickCreate-m3dyD7gG.js";import"./CalendarSession-D2sxMFYX.js";import"./calendar-event-sidebar-BUwhXGT2.js";import"./select-DhVwx5IO.js";import"./chevron-down-DeNyJr8d.js";import"./confirm-dialog-BdT5xj08.js";const y=o;export{y as component};
@@ -0,0 +1 @@
1
+ import{l as i,e as n,u as a,r as m,j as p}from"./index-C2US5ZnK.js";import{O as s}from"./OnboardingWizard-C9TeAtWU.js";import{c}from"./onboarding-completion-2pWLyByk.js";import"./credential-steps-BIgbwjRe.js";import"./select-DhVwx5IO.js";import"./chevron-down-DeNyJr8d.js";import"./badge-CDOouHHB.js";import"./card-D8MhhaRw.js";import"./account-form-helpers-DhckT_PN.js";import"./mail-Cqr91KmH.js";import"./file-braces-BtzbF80p.js";import"./kbd-C052hWKm.js";import"./checkbox-DQCA_mSq.js";function k(){const o=i(),t=n(),e=a(),r=m.useCallback(l=>{c({queryClient:t,recordCompleted:()=>o.recordEvent("onboarding.completed"),navigateToInbox:()=>{window.location.assign("/mail")}})},[o,t]);return p.jsx(s,{skipWelcome:!1,onComplete:r,onImportConfig:()=>{e({to:"/import"})}})}export{k as component};
@@ -1 +1 @@
1
- import{k as o}from"./index-fsuIswbe.js";async function n(e){e.recordCompleted(),await e.queryClient.refetchQueries({queryKey:o()}),e.navigateToInbox()}export{n as c};
1
+ import{k as o}from"./index-C2US5ZnK.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-C2US5ZnK.js";import{a as m}from"./MailShell-DemzOx8u.js";import{u as p,O as t}from"./OutboxPane-dfNu0jGv.js";import"./nav-link-Df_MDzvJ.js";import"./reply-CijQsg4o.js";import{u as s}from"./search-mirror-B_HO5zGq.js";import"./useMessageBodyContent-DwHmQdO9.js";import"./FullCompose-CN22d_2q.js";import"./index-v9nM8Dsp.js";import"./useSignature-cMh39FpD.js";import"./account-form-helpers-DhckT_PN.js";import"./useDebouncedValue-C3FljUyl.js";import"./suggest-list-DJUWGfG3.js";import"./sections-FtpeSpRq.js";import"./useMediaQuery-BaUDTtu8.js";import"./chevron-down-DeNyJr8d.js";import"./ErrorState-g7-Y1uhe.js";import"./confirm-dialog-BdT5xj08.js";import"./search-scope-7jHRUZbg.js";import"./app-chrome-CGYf2rTW.js";import"./MessageBody-Lnqqwldl.js";import"./kbd-C052hWKm.js";import"./outbox-status-BlKn6P0x.js";import"./NavMenuButton-BWwWmGhg.js";import"./menu-CEGeda9s.js";import"./roving-focus-C0jnB7ie.js";import"./circle-check-big-DSc97Qaj.js";import"./clock--ouhjt6L.js";import"./row-actions-gLlnd0fC.js";import"./rotate-ccw-CfAs8Xij.js";function C(){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{C as component};
@@ -1 +1 @@
1
- import{b as e}from"./index-fsuIswbe.js";const a={name:"pencil",size:24,node:[["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"}]]};a.node;const n=e(a);export{n as P};
1
+ import{b as e}from"./index-C2US5ZnK.js";const a={name:"pencil",size:24,node:[["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"}]]};a.node;const n=e(a);export{n as P};