@remit/web-client-dist 0.0.686 → 0.0.688

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 (187) hide show
  1. package/assets/{BriefPane-DbPnsOco.js → BriefPane-D9xGqyxR.js} +1 -1
  2. package/assets/{CalendarEventEditor-CGrl9NkK.js → CalendarEventEditor-Cuivix6B.js} +1 -1
  3. package/assets/{CalendarEventPopup-DSoQ-1wk.js → CalendarEventPopup-RUgpY-Yn.js} +1 -1
  4. package/assets/{CalendarLoadFailed-ClpqypbH.js → CalendarLoadFailed-DsTPS9bF.js} +1 -1
  5. package/assets/{CalendarQuickCreate-CaYUiVR8.js → CalendarQuickCreate-FK6jRrvs.js} +1 -1
  6. package/assets/{CalendarSession-Ql7K56YK.js → CalendarSession-CJCauncC.js} +1 -1
  7. package/assets/{DesktopChrome-e0x9SkC0.js → DesktopChrome-CpxOryJF.js} +1 -1
  8. package/assets/{DropdownMenu-DusMkzz6.js → DropdownMenu-CAD4JZmN.js} +1 -1
  9. package/assets/{EmptyState-BjhPv2hS.js → EmptyState-DirhyLKZ.js} +1 -1
  10. package/assets/{ErrorState-nIG-x-Zh.js → ErrorState-BDj_H2Rc.js} +1 -1
  11. package/assets/{FlaggedPane-CcaZOeS-.js → FlaggedPane-CXYlNbB4.js} +1 -1
  12. package/assets/{FullCompose-D5JLo7Rb.js → FullCompose-CLLZZTDi.js} +1 -1
  13. package/assets/{LabelApplyTrigger-CUfdoyOX.js → LabelApplyTrigger-BPiCPvOQ.js} +1 -1
  14. package/assets/{MailShell-DIZSKkXP.js → MailShell-CaZXZkkc.js} +1 -1
  15. package/assets/{MailViewChrome-B22GO2ZU.js → MailViewChrome-BZA2CsvY.js} +1 -1
  16. package/assets/{MailboxPane-ikbl6KSS.js → MailboxPane-DoBLIguh.js} +1 -1
  17. package/assets/{MessageBody-DbkrLz4x.js → MessageBody-D6YVQ7Ek.js} +4 -4
  18. package/assets/MessageToolbar-DPpw-H8f.js +1 -0
  19. package/assets/{NavMenuButton-C78wt6tT.js → NavMenuButton-CSk-ecU-.js} +1 -1
  20. package/assets/{OnboardingWizard-B7BpPMJF.js → OnboardingWizard-DbvpJ09j.js} +1 -1
  21. package/assets/{OutboxPane-Ch6JqV2D.js → OutboxPane-B-r7Diu5.js} +1 -1
  22. package/assets/{ReportLink-BTuMtEGU.js → ReportLink-BTOR-1yq.js} +1 -1
  23. package/assets/_calendarObjectId-CwaNizXc.js +1 -0
  24. package/assets/_mailboxId-BtYF9Z-z.js +1 -0
  25. package/assets/_messageId-BOaAe-Cg.js +1 -0
  26. package/assets/_messageId-Dpp0v6qX.js +1 -0
  27. package/assets/_messageId-DrVz3SWm.js +1 -0
  28. package/assets/_outboxMessageId-m8S0EG0y.js +1 -0
  29. package/assets/_recurrenceId-i_lpAOY5.js +1 -0
  30. package/assets/{_slotId-CukLHO14.js → _slotId-5d6oD_Ma.js} +1 -1
  31. package/assets/_threadId-Bc_oUcgf.js +1 -0
  32. package/assets/_threadId-DR3-Udrv.js +1 -0
  33. package/assets/_threadId-abYB8VNM.js +1 -0
  34. package/assets/{_view._date-BhRGXGQG.js → _view._date-DPulTRnp.js} +1 -1
  35. package/assets/{account-service-status-2nmShluv.js → account-service-status-BcIwnoSK.js} +1 -1
  36. package/assets/{accounts-B_pt4l15.js → accounts-tKoz9mXg.js} +1 -1
  37. package/assets/{advanced-DzS_Bhbq.js → advanced-UPYFCj1L.js} +1 -1
  38. package/assets/{agenda-time-Bt4BEp3g.js → agenda-time-DSxqMI31.js} +1 -1
  39. package/assets/{app-chrome-CbZgCDW_.js → app-chrome-DsNAGBzs.js} +1 -1
  40. package/assets/{appearance-D6Q4ETnm.js → appearance-nv_KQzWd.js} +1 -1
  41. package/assets/{avatar-CQq2GZz9.js → avatar-CAJhX3gE.js} +1 -1
  42. package/assets/{badge-BVw5vgFN.js → badge-DL_zWZca.js} +1 -1
  43. package/assets/{bottom-sheet-C81CIc2R.js → bottom-sheet-CXqO5e8V.js} +1 -1
  44. package/assets/brief-B8h4s7Ej.js +1 -0
  45. package/assets/{brief-CGFThfPb.js → brief-DVz-TCIS.js} +1 -1
  46. package/assets/{calendar-Ddji3ram.js → calendar-Ckmsdwam.js} +1 -1
  47. package/assets/{calendar-SMIdRsx9.js → calendar-D-6SDX7I.js} +1 -1
  48. package/assets/{calendar-event-popup-DqvJLPWt.js → calendar-event-popup-BPDsVk8G.js} +1 -1
  49. package/assets/{calendar-event-sidebar-CGPuc517.js → calendar-event-sidebar-DE7aDbdU.js} +1 -1
  50. package/assets/{calendar-failure-note-4qETx8lD.js → calendar-failure-note-D04B487B.js} +1 -1
  51. package/assets/{calendar-guests-Dt2cjTqc.js → calendar-guests-_9JIL5bL.js} +1 -1
  52. package/assets/{calendar-suggestion-BZ4IIHBe.js → calendar-suggestion-wuE0EAnn.js} +1 -1
  53. package/assets/{calendars-U4lDveGO.js → calendars-BGSrzGp6.js} +1 -1
  54. package/assets/{card-kzE1rw9u.js → card-Bt0rEzaX.js} +1 -1
  55. package/assets/{checkbox-BILwOn1g.js → checkbox-Ox4avOrC.js} +1 -1
  56. package/assets/chevron-down-Dcb1svev.js +1 -0
  57. package/assets/chevron-left-BPKjlJZD.js +1 -0
  58. package/assets/{circle-check-CBDdVMl8.js → circle-check-DQZO12v1.js} +1 -1
  59. package/assets/{circle-check-big-DlhpMe5P.js → circle-check-big-BUyvgO1_.js} +1 -1
  60. package/assets/{circle-help-CP1s-Yi3.js → circle-help-BHDb6fr4.js} +1 -1
  61. package/assets/classification-BicjMjYL.js +1 -0
  62. package/assets/{clock-CLvsvjcH.js → clock-V9PRsNAj.js} +1 -1
  63. package/assets/compose._-_outboxMessageId_-BPGN3v1J.js +1 -0
  64. package/assets/compose._-_outboxMessageId_-BipLjF3-.js +1 -0
  65. package/assets/compose._-_outboxMessageId_-DjrjrdOu.js +1 -0
  66. package/assets/compose._-_outboxMessageId_-rVez9Jix.js +1 -0
  67. package/assets/{config-import-BRacJ1y6.js → config-import-CI_-oqoX.js} +1 -1
  68. package/assets/{confirm-dialog-B0MVMPmn.js → confirm-dialog-B9uXBCde.js} +1 -1
  69. package/assets/{copy-DMRh3Rb2.js → copy-DGIy9NV0.js} +1 -1
  70. package/assets/{credential-steps-4YQ5eJjl.js → credential-steps-CEwGV_Jz.js} +1 -1
  71. package/assets/{download-WnSzcn6T.js → download-CQ1TZW-j.js} +1 -1
  72. package/assets/{draft-0DDwY2Pw.js → draft-BpctUOpv.js} +1 -1
  73. package/assets/edit-BxTub7jS.js +1 -0
  74. package/assets/edit-DkErEsCT.js +1 -0
  75. package/assets/{external-link-B_11YPnQ.js → external-link-C_rqxanx.js} +1 -1
  76. package/assets/{file-json-D4Uv97RH.js → file-json-B9WSoC-B.js} +1 -1
  77. package/assets/filters-C0gUXTR2.js +1 -0
  78. package/assets/{flagged-C_307aIb.js → flagged-BsnAiP7z.js} +1 -1
  79. package/assets/flagged-DRrc_j4t.js +1 -0
  80. package/assets/{folder-input-DjY4GpKG.js → folder-input-8Q2m_scb.js} +1 -1
  81. package/assets/{folders-D7JFBgPP.js → folders-z8VOcTpR.js} +1 -1
  82. package/assets/{help-copy-bU0rZqtx.js → help-copy-9yhT3UQO.js} +1 -1
  83. package/assets/{import-CyBIMXQK.js → import-B1gI2hQx.js} +1 -1
  84. package/assets/index-BOaAe-Cg.js +1 -0
  85. package/assets/index-Ba5vyePJ.js +1 -0
  86. package/assets/{index-CrUfJlwk.js → index-BdVwGX5L.js} +4 -4
  87. package/assets/index-CYvHKrFm.js +1 -0
  88. package/assets/index-CovWtYXy.js +1 -0
  89. package/assets/index-DBeMMF1M.js +1 -0
  90. package/assets/index-DQEipxIu.js +1 -0
  91. package/assets/index-DQwQYH37.js +1 -0
  92. package/assets/index-Dpp0v6qX.js +1 -0
  93. package/assets/index-DrVz3SWm.js +1 -0
  94. package/assets/{index-BZ4sAts4.js → index-NTsfKnzH.js} +5 -5
  95. package/assets/index-uWoobwwo.js +1 -0
  96. package/assets/{kbd-5V1_yqOW.js → kbd-CsEUx1iS.js} +1 -1
  97. package/assets/{label-chip-BBPaslky.js → label-chip-CCEWnnFq.js} +1 -1
  98. package/assets/{labels-xO9yj2bw.js → labels-nI-ApWXD.js} +1 -1
  99. package/assets/{mail-DcTEJ5uO.js → mail-HviNQK7z.js} +1 -1
  100. package/assets/{mail-CRvRtCed.js → mail-YPl0v6Rg.js} +1 -1
  101. package/assets/{menu-DXmZUEBa.js → menu-Bjei5qcd.js} +1 -1
  102. package/assets/{nav-link-BvBkmH1H.js → nav-link-Bsus6xvs.js} +1 -1
  103. package/assets/new-OETnXUFu.js +1 -0
  104. package/assets/onboarding-DfnR1O2K.js +1 -0
  105. package/assets/{onboarding-completion-CK2mHfmP.js → onboarding-completion-DnD7ZKm2.js} +1 -1
  106. package/assets/outbox-DCcPw0F-.js +1 -0
  107. package/assets/{pencil-Py3MXttE.js → pencil-SmE0J4lF.js} +1 -1
  108. package/assets/{people-CxpFEQpi.js → people-CeFoz9je.js} +1 -1
  109. package/assets/{plus-5sFyaPZh.js → plus-CBEQXEYM.js} +1 -1
  110. package/assets/{popover-menu-uIVgxYG_.js → popover-menu-BKr-RjB3.js} +1 -1
  111. package/assets/{refresh-cw-Dar0XAdp.js → refresh-cw-COTmGpG_.js} +1 -1
  112. package/assets/{reply-D8bLYzum.js → reply-CkAu_qmt.js} +1 -1
  113. package/assets/{rich-text-B2jeK_lt.js → rich-text-CUFDUo-_.js} +1 -1
  114. package/assets/{rich-text-spellcheck-worker-provider-D1J3yZU8.js → rich-text-spellcheck-worker-provider-Bi73VIdS.js} +1 -1
  115. package/assets/{rotate-ccw-CSByuoeY.js → rotate-ccw-DcPTHd9U.js} +1 -1
  116. package/assets/{roving-focus-1m_wY9_4.js → roving-focus-DGskqkqC.js} +1 -1
  117. package/assets/{row-actions-CB2wYT6g.js → row-actions-CO60uRRB.js} +1 -1
  118. package/assets/{search-mirror-CFL35Bis.js → search-mirror-DkPI5xYg.js} +1 -1
  119. package/assets/{search-scope-BR87UqJt.js → search-scope-DeUeCslw.js} +1 -1
  120. package/assets/{search-token-index-CoqsoQJZ.js → search-token-index-i96KeAvp.js} +1 -1
  121. package/assets/{sections-B9pteMHc.js → sections-DbaGT3GX.js} +1 -1
  122. package/assets/{segmented-control-CVMDr-Je.js → segmented-control-Duuz4QJh.js} +1 -1
  123. package/assets/{select-DXHN14lo.js → select-D3KrqhMa.js} +1 -1
  124. package/assets/{senders-CXpJyu9L.js → senders-eAH7WB_9.js} +1 -1
  125. package/assets/settings-CTGDnSFz.js +1 -0
  126. package/assets/{settings-screen-C8kBB2kR.js → settings-screen-Dc-Ptb7G.js} +1 -1
  127. package/assets/{shield-check-Fest6_gL.js → shield-check-DuLyMeRb.js} +1 -1
  128. package/assets/{suggest-list-CUEgGZt_.js → suggest-list-Bwwkhu1A.js} +1 -1
  129. package/assets/{suggested-vips-CiTGLmJd.js → suggested-vips-BNtuB8--.js} +1 -1
  130. package/assets/{suggestion._suggestionId-BMRKFgLt.js → suggestion._suggestionId-CLm21cP9.js} +1 -1
  131. package/assets/{switch-xqSp-gFV.js → switch-DOM72IV6.js} +1 -1
  132. package/assets/{task._calendarTaskId-AbdgpKo5.js → task._calendarTaskId-C3uxFcb7.js} +1 -1
  133. package/assets/{undo-2-IdsgUvVv.js → undo-2-BHUHtOC6.js} +1 -1
  134. package/assets/{useCalendarData-BKkQY_vQ.js → useCalendarData-CXuwQioO.js} +2 -2
  135. package/assets/{useCalendarScheduling-D_qd-mRK.js → useCalendarScheduling-DFvOUPbg.js} +1 -1
  136. package/assets/{useCalendarSuggestions-D58tKJtx.js → useCalendarSuggestions-epkXEJdf.js} +1 -1
  137. package/assets/{useCalendarTasks-DLNYnUeu.js → useCalendarTasks-BygC_sdR.js} +1 -1
  138. package/assets/{useDebouncedValue-CMBraotV.js → useDebouncedValue-C_EHxcaO.js} +1 -1
  139. package/assets/{useFilters-28pRmQGT.js → useFilters-B59gFNK-.js} +1 -1
  140. package/assets/{useLabels-CGCEGKuz.js → useLabels-BrzW0a91.js} +1 -1
  141. package/assets/{useLayoutTier-CnmLTkLg.js → useLayoutTier-Bd5ZeqbW.js} +1 -1
  142. package/assets/{useMediaQuery-D3m_n689.js → useMediaQuery-Dti_5Bdw.js} +1 -1
  143. package/assets/{useMessageBodyContent-dd-lowbx.js → useMessageBodyContent-zzHQirBA.js} +1 -1
  144. package/assets/{useQueries-B-X1sW9_.js → useQueries-BWuMMxTL.js} +1 -1
  145. package/assets/{useRefreshControl-DbHCcSXX.js → useRefreshControl-B9CDgsXO.js} +1 -1
  146. package/assets/{useResultFolderIndex-BvBtm4F3.js → useResultFolderIndex-CAzxcbUl.js} +1 -1
  147. package/assets/{useSignature-CQZ_Ke3T.js → useSignature-2RGHbdGD.js} +1 -1
  148. package/assets/{warnings-bjC-sL2O.js → warnings-BLb1FQ-u.js} +3 -3
  149. package/index.html +1 -1
  150. package/package.json +1 -1
  151. package/assets/MessageToolbar-D-FLeer4.js +0 -1
  152. package/assets/_calendarObjectId-CNeye1nX.js +0 -1
  153. package/assets/_mailboxId-CINQfps_.js +0 -1
  154. package/assets/_messageId-D0UOksYx.js +0 -1
  155. package/assets/_messageId-OM56_7mN.js +0 -1
  156. package/assets/_messageId-VtS9XL2y.js +0 -1
  157. package/assets/_outboxMessageId-B0eJRNrJ.js +0 -1
  158. package/assets/_recurrenceId-CwEJEhKM.js +0 -1
  159. package/assets/_threadId-BvpkdG2H.js +0 -1
  160. package/assets/_threadId-CEIXKQzn.js +0 -1
  161. package/assets/_threadId-H3F-Cx53.js +0 -1
  162. package/assets/brief-CGmiPbD7.js +0 -1
  163. package/assets/chevron-down-TeH9o9Q-.js +0 -1
  164. package/assets/chevron-left-DUh7xA0y.js +0 -1
  165. package/assets/classification-DF13x4GV.js +0 -1
  166. package/assets/compose._-_outboxMessageId_-3OLQ2cbN.js +0 -1
  167. package/assets/compose._-_outboxMessageId_-BYGqO75X.js +0 -1
  168. package/assets/compose._-_outboxMessageId_-Cc0PpaH6.js +0 -1
  169. package/assets/compose._-_outboxMessageId_-SAeViPeG.js +0 -1
  170. package/assets/edit-B4dfxZaW.js +0 -1
  171. package/assets/edit-BU8CFYW0.js +0 -1
  172. package/assets/filters-BWFo6zj7.js +0 -1
  173. package/assets/flagged-BQl5KVuF.js +0 -1
  174. package/assets/index-6cMF4pO8.js +0 -1
  175. package/assets/index-B0m7QGSS.js +0 -1
  176. package/assets/index-CH48-R4X.js +0 -1
  177. package/assets/index-CjLHI6va.js +0 -1
  178. package/assets/index-D-NR3LoA.js +0 -1
  179. package/assets/index-D0UOksYx.js +0 -1
  180. package/assets/index-D1_eaXw-.js +0 -1
  181. package/assets/index-OM56_7mN.js +0 -1
  182. package/assets/index-VtS9XL2y.js +0 -1
  183. package/assets/index-ksP05uVF.js +0 -1
  184. package/assets/new-kYNP_cv-.js +0 -1
  185. package/assets/onboarding-CFIwco02.js +0 -1
  186. package/assets/outbox-DgFmUFU6.js +0 -1
  187. package/assets/settings-B2MbfPot.js +0 -1
@@ -0,0 +1 @@
1
+ import{j as o}from"./index-NTsfKnzH.js";import{M as i}from"./MailboxPane-DoBLIguh.js";import"./MailViewChrome-BZA2CsvY.js";import"./search-token-index-i96KeAvp.js";import"./reply-CkAu_qmt.js";import"./nav-link-Bsus6xvs.js";import"./useMediaQuery-Dti_5Bdw.js";import"./search-scope-DeUeCslw.js";import"./app-chrome-DsNAGBzs.js";import"./useQueries-BWuMMxTL.js";import"./roving-focus-DGskqkqC.js";import"./MessageToolbar-DPpw-H8f.js";import"./MessageBody-D6YVQ7Ek.js";import"./kbd-CsEUx1iS.js";import"./useMessageBodyContent-zzHQirBA.js";import"./chevron-down-Dcb1svev.js";import"./index-BdVwGX5L.js";import"./useSignature-2RGHbdGD.js";import"./account-form-helpers-DhckT_PN.js";import"./useDebouncedValue-C_EHxcaO.js";import"./suggest-list-Bwwkhu1A.js";import"./sections-DbaGT3GX.js";import"./badge-DL_zWZca.js";import"./undo-2-BHUHtOC6.js";import"./DropdownMenu-CAD4JZmN.js";import"./popover-menu-BKr-RjB3.js";import"./ErrorState-BDj_H2Rc.js";import"./mail-YPl0v6Rg.js";import"./download-CQ1TZW-j.js";import"./avatar-CAJhX3gE.js";import"./EmptyState-DirhyLKZ.js";import"./calendar-suggestion-wuE0EAnn.js";import"./useCalendarSuggestions-epkXEJdf.js";import"./agenda-time-DSxqMI31.js";import"./plus-CBEQXEYM.js";import"./calendar-format-BwCpz-JZ.js";import"./calendar-D-6SDX7I.js";import"./calendar-failure-note-D04B487B.js";import"./checkbox-Ox4avOrC.js";import"./clock-V9PRsNAj.js";import"./segmented-control-Duuz4QJh.js";import"./shield-check-DuLyMeRb.js";import"./useLayoutTier-Bd5ZeqbW.js";import"./menu-Bjei5qcd.js";import"./useFilters-B59gFNK-.js";import"./select-D3KrqhMa.js";import"./folder-input-8Q2m_scb.js";import"./confirm-dialog-B9uXBCde.js";import"./label-chip-CCEWnnFq.js";import"./refresh-cw-COTmGpG_.js";import"./useRefreshControl-B9CDgsXO.js";import"./circle-check-big-BUyvgO1_.js";import"./LabelApplyTrigger-BPiCPvOQ.js";import"./useLabels-BrzW0a91.js";import"./NavMenuButton-CSk-ecU-.js";import"./bottom-sheet-CXqO5e8V.js";import"./circle-help-BHDb6fr4.js";import"./circle-check-DQZO12v1.js";function no(){return o.jsx(i.Reading,{})}export{no as component};
@@ -1 +1 @@
1
- import{j as s,p as t}from"./index-BZ4sAts4.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-NTsfKnzH.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 l,p as n}from"./index-BZ4sAts4.js";const a={Default:"bg-fg-subtle",Red:"bg-red-500",Orange:"bg-orange-500",Yellow:"bg-yellow-500",Green:"bg-green-500",Teal:"bg-teal-500",Blue:"bg-blue-500",Purple:"bg-purple-500",Gray:"bg-gray-500"},c=["Default","Red","Orange","Yellow","Green","Teal","Blue","Purple","Gray"],o=e=>Object.hasOwn(a,e);function g({label:e,onRemove:s,className:t}){const r=o(e.color)?a[e.color]:a.Default;return l.jsxs("span",{className:n("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",t),children:[l.jsx("span",{className:n("size-1.5 shrink-0 rounded-full",r)}),l.jsx("span",{className:"truncate",children:e.name}),s&&l.jsx("button",{type:"button",onClick:()=>s(e.labelId),"aria-label":`Remove label ${e.name}`,className:"ml-0.5 rounded-full text-fg-subtle hover:text-fg",children:"×"})]})}export{g as L,a,o as i,c as l};
1
+ import{j as l,p as n}from"./index-NTsfKnzH.js";const a={Default:"bg-fg-subtle",Red:"bg-red-500",Orange:"bg-orange-500",Yellow:"bg-yellow-500",Green:"bg-green-500",Teal:"bg-teal-500",Blue:"bg-blue-500",Purple:"bg-purple-500",Gray:"bg-gray-500"},c=["Default","Red","Orange","Yellow","Green","Teal","Blue","Purple","Gray"],o=e=>Object.hasOwn(a,e);function g({label:e,onRemove:s,className:t}){const r=o(e.color)?a[e.color]:a.Default;return l.jsxs("span",{className:n("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",t),children:[l.jsx("span",{className:n("size-1.5 shrink-0 rounded-full",r)}),l.jsx("span",{className:"truncate",children:e.name}),s&&l.jsx("button",{type:"button",onClick:()=>s(e.labelId),"aria-label":`Remove label ${e.name}`,className:"ml-0.5 rounded-full text-fg-subtle hover:text-fg",children:"×"})]})}export{g as L,a,o as i,c as l};
@@ -1 +1 @@
1
- import{r as f,j as e,ao as h,B as b,T as y,u as N,ac as C,a as L,c as I,d as S}from"./index-BZ4sAts4.js";import{L as D,l as g}from"./label-chip-BBPaslky.js";import{S as v}from"./select-DXHN14lo.js";import{a as w,b as $,c as E,u as k}from"./useLabels-CGCEGKuz.js";import{a as R}from"./sections-B9pteMHc.js";import{S as O}from"./settings-screen-C8kBB2kR.js";import{E as j}from"./ErrorState-nIG-x-Zh.js";import{C as B}from"./confirm-dialog-B0MVMPmn.js";import"./chevron-down-TeH9o9Q-.js";import"./avatar-CQq2GZz9.js";import"./badge-BVw5vgFN.js";import"./chevron-left-DUh7xA0y.js";import"./menu-DXmZUEBa.js";import"./circle-help-CP1s-Yi3.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(v,{"aria-label":`Color for ${t.name}`,value:t.color,onChange:s=>l(t.labelId,s.target.value),className:"w-28 shrink-0",children:g.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(v,{value:r,onChange:a=>o(a.target.value),"aria-label":"Label color",className:"w-28",children:g.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 ee(){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{ee as component};
1
+ import{r as f,j as e,ao as h,B as b,T as y,u as N,ac as C,a as L,c as I,d as S}from"./index-NTsfKnzH.js";import{L as D,l as g}from"./label-chip-CCEWnnFq.js";import{S as v}from"./select-D3KrqhMa.js";import{a as w,b as $,c as E,u as k}from"./useLabels-BrzW0a91.js";import{a as R}from"./sections-DbaGT3GX.js";import{S as O}from"./settings-screen-Dc-Ptb7G.js";import{E as j}from"./ErrorState-BDj_H2Rc.js";import{C as B}from"./confirm-dialog-B9uXBCde.js";import"./chevron-down-Dcb1svev.js";import"./avatar-CAJhX3gE.js";import"./badge-DL_zWZca.js";import"./chevron-left-BPKjlJZD.js";import"./menu-Bjei5qcd.js";import"./circle-help-BHDb6fr4.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(v,{"aria-label":`Color for ${t.name}`,value:t.color,onChange:s=>l(t.labelId,s.target.value),className:"w-28 shrink-0",children:g.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(v,{value:r,onChange:a=>o(a.target.value),"aria-label":"Label color",className:"w-28",children:g.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 ee(){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{ee as component};
@@ -1 +1 @@
1
- import{b as Me,j as e,r as p,n as Ee,o as Pe,D as Le,X as Te,p as I,S as Fe,C as Ae,q as oe,t as Q,v as re,w as ie,F as ze,T as De,x as _e,M as Be,y as Ke,z as Qe,I as qe,B as E,E as le,G as He,H as $e,J as ce,e as B,K as ue,N as de,P as Ve,Q as Ue,R as We,U as me,a as xe,V as Ge,W as Ye,Y as z,Z as Je,_ as Xe,$ as Ze,a0 as es,a1 as ss,a2 as ts,a3 as as,a4 as ns,a5 as os,u as rs,c as is,a6 as ls,O as cs}from"./index-BZ4sAts4.js";import{l as O,u as D,m as q,a as us,b as ds,c as ms}from"./reply-D8bLYzum.js";import{A as xs,S as fe,a as fs,c as ps,L as hs,b as gs,D as bs,d as vs}from"./DesktopChrome-e0x9SkC0.js";import{u as ys,N as C,a as js,b as Ns,i as Ss}from"./nav-link-BvBkmH1H.js";import{u as K,a as Cs}from"./useMessageBodyContent-dd-lowbx.js";import{P as Is}from"./pencil-Py3MXttE.js";import{c as ws,s as Os,M as ks}from"./MailShell-DIZSKkXP.js";import{u as Rs,a as Ms,R as Es,s as Ps,i as Ls,H as Ts,M as Fs}from"./useRefreshControl-DbHCcSXX.js";import{K as As,B as zs,S as Ds,u as _s,s as Bs,b as Ks,a as Qs,c as qs,d as Hs}from"./search-token-index-CoqsoQJZ.js";import{u as $s}from"./sections-B9pteMHc.js";import{u as pe}from"./search-scope-BR87UqJt.js";import{M as Vs}from"./menu-DXmZUEBa.js";import{B as he,u as Us}from"./useResultFolderIndex-BvBtm4F3.js";import{u as ge}from"./useQueries-B-X1sW9_.js";import{f as Ws}from"./folder-failure-CqkVSsrb.js";import{i as Gs}from"./outbox-status-BlKn6P0x.js";import{u as Ys}from"./roving-focus-1m_wY9_4.js";import{C as Js,A as Xs}from"./account-service-status-2nmShluv.js";import{C as H}from"./chevron-down-TeH9o9Q-.js";import{u as Zs}from"./index-CrUfJlwk.js";import{u as be,i as et}from"./useLayoutTier-CnmLTkLg.js";import{u as st}from"./useDebouncedValue-CMBraotV.js";import{E as tt}from"./ErrorState-nIG-x-Zh.js";import{K as $}from"./kbd-5V1_yqOW.js";import"./avatar-CQq2GZz9.js";import"./popover-menu-uIVgxYG_.js";import"./mail-CRvRtCed.js";import"./app-chrome-CbZgCDW_.js";import"./useMediaQuery-D3m_n689.js";import"./FullCompose-D5JLo7Rb.js";import"./confirm-dialog-B0MVMPmn.js";import"./circle-check-big-DlhpMe5P.js";import"./refresh-cw-Dar0XAdp.js";import"./useSignature-CQZ_Ke3T.js";import"./account-form-helpers-DhckT_PN.js";import"./suggest-list-CUEgGZt_.js";const at=Me("SquarePen",[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z",key:"ohrbg2"}]]);function nt({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(Is,{className:"size-6"})})}const ot=({isOpen:s,onClose:t})=>{const a=p.useRef(null);return Ee({id:"shortcuts",open:s,answers:{back:t}}),Pe(a,s),s?e.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[e.jsx(Le,{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:I("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(Te,{className:"size-5"})})]}),e.jsx("div",{className:"grid gap-x-8 gap-y-6 sm:grid-cols-2",children:As.map(n=>e.jsxs("div",{children:[e.jsx("h3",{className:"mb-3 text-sm font-medium text-fg-muted",children:n.title}),e.jsx("div",{className:"space-y-2",children:n.hints.map(o=>e.jsxs("div",{className:"flex items-center justify-between gap-4",children:[e.jsx("span",{className:"text-sm",children:o.description}),e.jsx("span",{className:"flex shrink-0 items-center gap-1",children:o.keys.map((r,c)=>e.jsxs(p.Fragment,{children:[c>0&&o.keys[0]==="g"&&e.jsx("span",{className:"text-2xs text-fg-subtle",children:"then"}),e.jsx($,{children:r})]},r))})]},`${o.action}-${o.keys.join("+")}`))})]},n.title))}),e.jsx("div",{className:"mt-6 border-t border-line pt-4",children:e.jsxs("p",{className:"text-center text-xs text-fg-muted",children:["Press ",e.jsx($,{children:"Esc"})," to close"]})})]})]}):null},rt="button:not([disabled]), a[href]",P="outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-surface-sunken";function it({active:s,dimmed:t,indent:a}){return I("flex w-full items-center gap-2 rounded-md px-2 py-1 text-left text-sm transition-colors",P,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 lt({icon:s,label:t,count:a,active:n,failure:o}){return e.jsxs(e.Fragment,{children:[s&&e.jsx("span",{className:I("shrink-0",n?"text-accent-2":"text-fg-subtle"),children:s}),e.jsx("span",{className:"flex-1 truncate",children:t}),o&&e.jsx(re,{className:"size-3.5 shrink-0 text-danger","aria-hidden":"true"}),a!=null&&a>0&&e.jsx("span",{className:I("text-2xs tabular-nums",n?"text-accent-2":"text-fg-subtle"),children:a})]})}function w({icon:s,label:t,count:a,active:n,dimmed:o,indent:r,navId:c,linkComponent:u,ariaLabel:x,title:d,failure:h,onClick:y}){const g=it({active:n,dimmed:o,indent:r}),l=e.jsx(lt,{icon:s,label:t,count:a,active:n,failure:h}),v=x??t,m=h?`${v} — ${h}`:v,f=h?`${d??t} — ${h}`:d;return c&&u?u({navId:c,className:g,ariaLabel:m,title:f,onClick:y,children:l}):e.jsx("button",{type:"button",onClick:y,className:g,"aria-label":h?m:x,title:f,children:l})}const V={inbox:0,flagged:1,drafts:2,sent:3,archive:4,all:5,junk:6,trash:7};function ct(s){switch(s){case"inbox":return e.jsx(qe,{className:"size-4"});case"flagged":return e.jsx(oe,{className:"size-4"});case"drafts":return e.jsx(Qe,{className:"size-4"});case"sent":return e.jsx(ie,{className:"size-4"});case"archive":return e.jsx(Ke,{className:"size-4"});case"all":return e.jsx(Be,{className:"size-4"});case"junk":return e.jsx(_e,{className:"size-4"});case"trash":return e.jsx(De,{className:"size-4"})}}const U=s=>s.role!=null,A=8,W="remit.nav.folders.open.",G="remit.nav.account.open.";function Y(s,t,a){if(typeof localStorage>"u")return a;const n=localStorage.getItem(s+t);return n===null?a:n!=="0"}function J(s,t,a){typeof localStorage>"u"||localStorage.setItem(s+t,a?"1":"0")}function ut({account:s,selectedNavId:t,onSelectNav:a,linkComponent:n}){const[o,r]=p.useState(()=>Y(G,s.id,!0)),[c,u]=p.useState(()=>Y(W,s.id,!0)),[x,d]=p.useState(!1),h=()=>{r(i=>{const j=!i;return J(G,s.id,j),j})},y=()=>{u(i=>{const j=!i;return J(W,s.id,j),j})},g=s.mailboxes.filter(U).sort((i,j)=>V[i.role]-V[j.role]),l=s.mailboxes.filter(i=>!U(i)),v=x||l.length<=A?l:l.slice(0,A),m=l.length-v.length,f=s.status??"ready",b=s.syncedServices!==void 0&&!s.syncedServices.includes("Mail"),N=f==="ready"&&g.length===0&&l.length===0;return e.jsxs("div",{className:"mt-3",children:[e.jsxs("button",{type:"button",onClick:h,"aria-expanded":o,className:I("flex w-full items-center gap-1.5 px-2 pb-1 text-left transition-colors hover:text-fg",P,s.muted&&"opacity-55"),children:[o?e.jsx(H,{className:"size-3 shrink-0 text-fg-subtle"}):e.jsx(Q,{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(zs,{className:"size-3 shrink-0 text-fg-subtle"}),e.jsx("span",{className:"text-2xs text-fg-subtle",children:"muted"})]}),b&&e.jsxs(e.Fragment,{children:[e.jsx(Js,{className:"size-3 shrink-0 text-fg-subtle"}),e.jsx("span",{className:"text-2xs text-fg-subtle",children:Xs.Mail})]})]}),o&&e.jsxs(e.Fragment,{children:[f==="loading"&&e.jsx("div",{className:"px-2 py-1 text-sm text-fg-muted",children:"Loading…"}),f==="error"&&e.jsxs("div",{role:"alert",className:"mx-2 my-1 flex items-start gap-2 rounded-md border border-danger/40 bg-danger-soft px-2 py-1.5 text-sm",children:[e.jsx(re,{className:"mt-0.5 size-4 shrink-0 text-danger","aria-hidden":"true"}),e.jsx("div",{className:"min-w-0 flex-1",children:e.jsx("p",{className:"font-medium text-danger",children:"Couldn't load mailboxes"})}),s.onRetry&&e.jsx("button",{type:"button",onClick:s.onRetry,className:"shrink-0 text-sm font-medium text-accent hover:underline",children:"Retry"})]}),N&&e.jsx("div",{className:"px-2 py-1 text-sm text-fg-muted",children:"No mailboxes"}),f==="ready"&&e.jsxs(e.Fragment,{children:[g.map(i=>e.jsx(w,{navId:i.id,linkComponent:n,icon:ct(i.role),label:i.name,ariaLabel:i.name,title:i.fullPath??i.name,failure:i.failure,count:i.unseen,active:t===i.id,dimmed:s.muted,onClick:()=>a?.(i.id)},i.id)),s.outboxPending!==void 0&&e.jsx(w,{navId:"outbox",linkComponent:n,icon:e.jsx(ie,{className:"size-4"}),label:"Outbox",ariaLabel:"Outbox",count:s.outboxPending>0?s.outboxPending:void 0,active:t==="outbox",dimmed:s.muted,onClick:()=>a?.("outbox")}),l.length>0&&e.jsxs(e.Fragment,{children:[e.jsxs("button",{type:"button",onClick:y,"aria-expanded":c,className:I("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",P),children:[c?e.jsx(H,{className:"size-3 shrink-0"}):e.jsx(Q,{className:"size-3 shrink-0"}),e.jsx("span",{className:"flex-1",children:"Folders"}),e.jsx("span",{className:"tabular-nums opacity-70",children:l.length})]}),c&&e.jsxs(e.Fragment,{children:[v.map(i=>e.jsx(w,{navId:i.id,linkComponent:n,icon:e.jsx(ze,{className:"size-4"}),label:i.name,ariaLabel:i.name,title:i.fullPath??i.name,failure:i.failure,count:i.unseen,active:t===i.id,dimmed:s.muted,onClick:()=>a?.(i.id)},i.id)),(m>0||x)&&l.length>A&&e.jsx("button",{type:"button",onClick:()=>d(i=>!i),className:I("ml-7 flex items-center px-2 py-1 text-2xs font-medium text-accent transition-colors hover:underline",P),children:x?"Show less":`Show all (${l.length})`})]})]})]})]})]})}function dt({accounts:s,selectedNavId:t,briefUnseen:a,onSelectNav:n,variant:o="desktop",linkComponent:r,calendarNav:c="hidden"}){const u=p.useRef(null);Ys({containerRef:u,itemSelector:rt});const x=o==="drawer",d=e.jsxs("nav",{ref:x?u:void 0,className:x?"px-2 py-2":"flex-1 overflow-y-auto px-2 py-2","aria-label":"Mailboxes",children:[e.jsx(w,{navId:"brief",linkComponent:r,icon:e.jsx(Fe,{className:"size-4"}),label:"Daily brief",ariaLabel:"Daily brief",count:a,active:t==="brief",onClick:()=>n?.("brief")}),c==="shown"&&e.jsx(w,{navId:"calendar",linkComponent:r,icon:e.jsx(Ae,{className:"size-4"}),label:"Calendar",ariaLabel:"Calendar",active:t==="calendar",onClick:()=>n?.("calendar")}),e.jsx(w,{navId:"flagged",linkComponent:r,icon:e.jsx(oe,{className:"size-4"}),label:"Starred",ariaLabel:"Starred",active:t==="flagged",onClick:()=>n?.("flagged")}),s.length===0?e.jsx("div",{className:"px-2 py-4 text-center text-sm text-fg-muted",children:"No accounts configured"}):s.map(h=>e.jsx(ut,{account:h,selectedNavId:t,onSelectNav:n,linkComponent:r},h.id))]});return x?d:e.jsx("aside",{ref:u,className:"flex h-full w-full flex-col bg-surface-sunken",children:d})}function mt(){const s=pe();if(!s)return null;const t=s.showNavPane?!s.navCollapsed:!1;return e.jsx(E,{variant:"ghost",size:"sm",icon:e.jsx(Vs,{className:"size-4"}),onClick:s.toggleNav,"aria-label":t?"Hide folders":"Show folders","aria-expanded":t,title:"Folders",className:"shrink-0"})}const xt={global:"Search all mail",pending:"Search mail",scoped:"Search this folder"};function ft({search:s,onCompose:t,onReportBug:a,onOpenSettings:n,settingsAttention:o,composeShortcut:r,refreshControl:c,account:u}){return e.jsx(xs,{leading:e.jsx(mt,{}),search:e.jsx(Ds,{value:s.value,onChange:s.onChange,onClear:s.onClear,onClearQuery:s.onClearQuery,chips:s.chips,onRemoveChip:s.onRemoveChip,placeholder:xt[s.scope]}),actions:e.jsxs(e.Fragment,{children:[e.jsx(E,{variant:"ghost",size:"sm",icon:e.jsx(at,{className:"size-4"}),title:r?`Compose (${r})`:"Compose","aria-label":"Compose",onClick:t}),e.jsx(E,{variant:"ghost",size:"sm",icon:e.jsx(he,{className:"size-4"}),title:"Report a bug","aria-label":"Report a bug",onClick:a}),e.jsx(E,{variant:"ghost",size:"sm",icon:e.jsx(le,{label:o,children:e.jsx(fe,{className:"size-4"})}),title:"Settings","aria-label":o?`Settings — ${o}`:"Settings",onClick:n}),c,u]})})}function pt(){const{pathname:s}=ys(),t=He({from:"/mail/$mailboxId",shouldThrow:!1});return O(s,"/settings")?"settings":O(s,"/calendar")?"calendar":O(s,"/mail/outbox")?"outbox":O(s,"/mail/flagged")?"flagged":O(s,"/mail/brief")?"brief":t?.mailboxId??""}function ht(){const s=$e(),t=D({select:d=>q(d.location.pathname)}),a=D({select:d=>us(d.location.search)}),[n,o]=p.useState(a),r=st(n,200),[c,u]=p.useState(t);if(c!==t){const d=Os(c,t,a);u(t),d!==void 0&&o(d)}const x=p.useCallback(d=>{u(q(s.state.location.pathname)),o(d)},[s]);return{searchInput:n,committedQuery:ws(n,r),viewKey:t,setSearchInput:x}}const gt=()=>{const s=K();return ds()?null:e.jsx(nt,{onCompose:s})};function X({accounts:s}){const{searchInput:t,onSearchChange:a,onSearchClear:n,onSearchClearQuery:o,resultFolderIndex:r}=ce(),c=B(),u=$s(),x=K(),{scope:d,clearScope:h}=_s(s),y=ue(),g=d.kind==="scoped"?[{id:d.chip.id,label:d.chip.label,tone:"scope"}]:void 0,l=p.useMemo(()=>s.map(N=>N.accountId),[s]),{hasNewMail:v}=Rs(),{state:m,errorMessage:f,refresh:b}=Ms(l,{onSettled:()=>Ve(c,Ue(r.keys()))});return e.jsx(ft,{search:{value:t,scope:d.kind,chips:g,onChange:a,onClear:n,onClearQuery:o,onRemoveChip:h},onCompose:x,onReportBug:de,onOpenSettings:()=>u("accounts"),settingsAttention:y,composeShortcut:Bs("compose"),refreshControl:e.jsx(Es,{state:m,onRefresh:b,label:"Refresh all accounts",errorMessage:f,hasUpdate:v(l)}),account:e.jsx(fs,{})})}function bt(){return e.jsxs("button",{type:"button",onClick:de,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(he,{className:"size-4 shrink-0"}),e.jsx("span",{className:"flex-1 truncate text-left",children:"Report a bug"})]})}const Z=s=>/^\d/.test(s),vt=(s,t)=>{const a=Z(s),n=Z(t);return a&&!n?-1:!a&&n?1:s.localeCompare(t,void 0,{sensitivity:"base",numeric:!0})};function yt(s,t,a){const n=[],o=[];for(const r of s)t.has(r.mailboxId)?n.push(r):o.push(r);return o.sort((r,c)=>vt(z(r,void 0,a),z(c,void 0,a))),{system:n,labels:o}}function jt(s,t,a){const n=Je(t)&&s.unseenCount>0;return{id:s.mailboxId,name:z(s,t,a),unseen:n?s.unseenCount:void 0,role:t,fullPath:s.fullPath,failure:Ws(s)}}function ee({accounts:s,onMailboxSelect:t,variant:a="desktop"}){const n=B(),o=pt(),{onSearchChange:r}=ce(),{t:c}=We("mail",{useSuspense:!1}),u=p.useCallback((m,f)=>c(m,{defaultValue:f}),[c]),x=ge({queries:s.map(m=>({...me({path:{accountId:m.accountId}}),staleTime:1/0}))}),{data:d}=xe(Ge()),h=p.useMemo(()=>(d?.items??[]).filter(m=>Gs(m.status)).length,[d?.items]),y=p.useMemo(()=>s.map((m,f)=>{const b=x[f],N=b?.data?.items??[],i=Ye(m.folderAppointments),{system:j,labels:L}=yt(N,i,u),T=b?.isError?"error":b?.isLoading?"loading":"ready";return{id:m.accountId,label:m.email,email:m.email,muted:!!m.muted,outboxPending:h,status:T,onRetry:()=>b?.refetch(),mailboxes:[...j,...L].map(k=>jt(k,i.get(k.mailboxId),u))}}),[s,x,h,u]),g=m=>{n.invalidateQueries({queryKey:Xe({path:{mailboxId:m},query:{order:"desc"}})})},l=({navId:m,className:f,ariaLabel:b,title:N,children:i,onClick:j})=>m==="brief"?e.jsx(C,{to:"/mail/brief",search:{q:void 0},activeOptions:{includeSearch:!1},onClick:()=>j?.(),className:f,"aria-label":b,title:N,children:i}):m==="calendar"?e.jsx(C,{to:"/calendar",onClick:()=>j?.(),className:f,"aria-label":b,title:N,children:i}):m==="outbox"?e.jsx(C,{to:"/mail/outbox",search:{q:void 0},onClick:()=>j?.(),className:f,"aria-label":b,title:N,children:i}):m==="flagged"?e.jsx(C,{to:"/mail/flagged",search:{q:void 0},onClick:()=>j?.(),className:f,"aria-label":b,title:N,children:i}):m==="settings"?e.jsx(C,{to:"/settings/accounts",onClick:()=>j?.(),className:f,"aria-label":b,title:N,children:i}):e.jsx(C,{to:"/mail/$mailboxId",params:{mailboxId:m},search:{q:void 0},onClick:()=>{g(m),j?.()},className:f,"aria-label":b,title:N,children:i}),v=()=>{r(""),t?.()};return e.jsx(dt,{accounts:y,selectedNavId:o,onSelectNav:v,linkComponent:l,variant:a})}function Nt({accounts:s,onMailboxSelect:t}){const n=pe()?.showNavPane??!0,o=ue();return n?e.jsx(ee,{accounts:s}):e.jsxs("div",{className:"flex h-full flex-col",children:[e.jsx("div",{className:"flex-1 overflow-y-auto",children:e.jsx(ee,{accounts:s,onMailboxSelect:t,variant:"drawer"})}),e.jsxs("div",{className:"border-t border-line px-2 py-2",children:[e.jsxs(C,{to:"/settings/accounts",onClick:t,children:[e.jsx(le,{label:o,children:e.jsx(fe,{className:"size-4 shrink-0"})}),e.jsx("span",{className:"flex-1 truncate text-left",children:"Settings"})]}),e.jsx(bt,{}),e.jsx(ps,{children:({signOut:r})=>e.jsxs("button",{type:"button",onClick:()=>{t?.(),r()},className:"flex min-h-11 w-full items-center gap-2 rounded-md px-2 py-1 text-sm text-fg-muted transition-colors hover:bg-surface hover:text-fg","data-testid":"sign-out-button",children:[e.jsx(hs,{className:"size-4 shrink-0"}),e.jsx("span",{className:"flex-1 truncate text-left",children:"Sign out"})]})})]})]})}function St(s){const t=ge({queries:s.map(a=>({...me({path:{accountId:a.accountId}}),staleTime:1/0}))});return p.useMemo(()=>Ks(t.map(a=>a.data?.items??[])),[t])}const ve="remit:intelligence-open";function Ct(){try{return localStorage.getItem(ve)!=="closed"}catch{return!0}}function It(s){try{localStorage.setItem(ve,s?"open":"closed")}catch{}}function se({panels:s,prefersOpen:t,isDesktop:a,hasThread:n,raisedFor:o,openMessage:r}){if(o!==null&&o===r)return!0;const c=s.filter(u=>u!=="sidebar");return c.length>0?c.includes("intelligence"):a&&n&&t}const wt=()=>{const s=be(),t=js(),a=Ns(),n=t.find(Ss),o=Qs(),[r,c]=p.useState(Ct),u=o?`${o.threadId}/${o.messageId??""}`:null,[x,d]=p.useState(null),h={panels:t,prefersOpen:r,isDesktop:s==="desktop",hasThread:o!==void 0,openMessage:u},y=se({...h,raisedFor:x}),g=se({...h,raisedFor:null}),l=p.useCallback((b,N)=>{a([...b?["intelligence"]:[],...N?[N]:[]])},[a]),v=p.useCallback(b=>{l(g,b)},[g,l]),m=p.useCallback(()=>{if(y&&!g){d(null);return}const b=!y;It(b),c(b),d(null),l(b,n)},[g,y,n,l]),f=p.useCallback(()=>{d(u)},[u]);return{openOverlay:n,intelligenceOpen:y,showOverlay:v,toggleIntelligence:m,raiseIntelligence:f}};var R={exports:{}},te;function Ot(){if(te)return R.exports;te=1;const s=(t,a,n)=>new Promise((o,r)=>{if(n=Object.assign({concurrency:1/0},n),typeof a!="function")throw new TypeError("Mapper function is required");const{concurrency:c}=n;if(!(typeof c=="number"&&c>=1))throw new TypeError(`Expected \`concurrency\` to be a number from 1 and up, got \`${c}\` (${typeof c})`);const u=[],x=t[Symbol.iterator]();let d=!1,h=!1,y=0,g=0;const l=()=>{if(d)return;const v=x.next(),m=g;if(g++,v.done){h=!0,y===0&&o(u);return}y++,Promise.resolve(v.value).then(f=>a(f,m)).then(f=>{u[m]=f,y--,l()},f=>{d=!0,r(f)})};for(let v=0;v<c&&(l(),!h);v++);});return R.exports=s,R.exports.default=s,R.exports}var kt=Ot();const Rt=Ze(kt),Mt=900*1e3,Et=30,Pt=(s,t)=>{if(!s)return t;const a=Number.parseInt(s,10);return Number.isFinite(a)&&a>0?a:t},Lt=30*1e3,Tt=s=>Math.max(Pt(s,Et)*1e3,Lt),ye=Tt(os().mailboxPollIntervalSeconds),M=(s=Date.now(),t=ye)=>Ls(s)?Math.min(Ts,t):t,Ft=5,_=new Set,At=(s,t,a=Mt)=>s.filter(n=>{const o=n.lastSyncAt;return o==null?!0:t-o>a}).map(n=>n.accountId),zt=(s,t,a=ye)=>s-t>=a,Dt=(s,t)=>s.filter(a=>!t.has(a)),ae=(s,t)=>{if(_.delete(s),ts(t)||as(t,{softError:!0})){ns(t,{softError:!0});return}console.warn("[remit] background mailbox sync failed",{accountId:s,error:t})},ne=(s,t)=>es({path:{accountId:s},throwOnError:!0}).then(()=>{t.invalidateQueries({queryKey:ss({path:{accountId:s}})})}),_t=s=>{const t=B(),a=p.useRef(s);a.current=s;const n=s.map(o=>o.accountId).join(",");p.useEffect(()=>{const o=Date.now(),c=At(a.current,o).filter(u=>!_.has(u));if(c.length!==0)for(const u of c)_.add(u),ne(u,t).catch(x=>{ae(u,x)})},[n,t]),p.useEffect(()=>{let o=Date.now(),r;const c=new Set,u=()=>{o=Date.now();const g=Dt(a.current.map(l=>l.accountId),c);for(const l of g)c.add(l);Rt(g,l=>ne(l,t).catch(v=>{ae(l,v)}).finally(()=>{c.delete(l)}),{concurrency:Ft})},x=()=>{if(document.visibilityState==="visible"){u(),r=setTimeout(x,M());return}},d=()=>{if(document.visibilityState!=="visible")return;r!==void 0&&clearTimeout(r);const g=Date.now(),l=M(g);if(zt(g,o,l)){u(),r=setTimeout(x,l);return}r=setTimeout(x,o+l-g)},h=()=>{document.visibilityState==="visible"&&(r!==void 0&&clearTimeout(r),o=Date.now(),r=setTimeout(x,M()))};r=setTimeout(x,M()),document.addEventListener("visibilitychange",d);const y=Ps(h);return()=>{r!==void 0&&clearTimeout(r),document.removeEventListener("visibilitychange",d),y()}},[n,t])};function Na(){const s=rs(),t=be(),a=et(t),{openOverlay:n,intelligenceOpen:o,showOverlay:r,toggleIntelligence:c,raiseIntelligence:u}=wt(),x=n==="shortcuts",d=n==="nav",{searchInput:h,committedQuery:y,viewKey:g,setSearchInput:l}=ht(),{data:v,isLoading:m,isError:f,error:b,refetch:N}=xe({...is(),staleTime:1/0}),i=!!(v&&(v.accounts?.length??0)===0);p.useEffect(()=>{i&&s({to:"/onboarding",replace:!0})},[i,s]),Zs({enabled:!x,bindings:[{key:"?",action:"help",handler:()=>r("shortcuts"),noModifiers:!1,preventDefault:!0}]});const j=K(),L=Cs(),T=D({select:F=>ms(F.matches)?.list==="mailbox"}),k=p.useMemo(()=>({compose:j}),[j]);qs({enabled:!T&&!L,handlers:k});const je=p.useCallback(()=>{l("")},[l]),Ne=p.useCallback(()=>{l("")},[l]),S=v?.accounts??[],Se=p.useMemo(()=>S.map(F=>F.accountId),[S]),Ce=St(S),Ie=Us(S).index,we=p.useMemo(()=>Hs(S),[S]);_t(S);const Oe=p.useCallback(()=>{n==="nav"&&r(void 0)},[n,r]),ke={accounts:S,mailboxNameIndex:Ce,accountNameIndex:we,resultFolderIndex:Ie,searchQuery:y,searchInput:h,searchViewKey:g,onSearchChange:l,onSearchClear:je,onSearchClearQuery:Ne,intelligenceOpen:o,onToggleIntelligence:c,onRaiseIntelligence:u},Re={isSinglePane:a,isLoading:m||i,intelligenceOpen:o,nav:e.jsx(Nt,{accounts:S,onMailboxSelect:Oe}),topBar:a?void 0:e.jsx(X,{accounts:S}),appBar:t==="phone"?void 0:e.jsx(vs,{}),overlay:a?e.jsx(gt,{}):void 0,navOpen:d,onOpenNav:()=>r("nav"),onCloseNav:()=>r(void 0)};return e.jsx(ls.Provider,{value:ke,children:e.jsxs(Fs,{accountIds:Se,children:[e.jsx(gs,{children:f?e.jsx(bs,{topBar:e.jsx(X,{accounts:S}),children:e.jsx("div",{className:"flex h-full items-center justify-center bg-canvas p-4",children:e.jsx(tt,{title:"Couldn't load your account",error:b,onRetry:()=>{N()}})})}):e.jsx(ks,{chrome:Re,children:e.jsx(cs,{})})}),e.jsx(ot,{isOpen:x,onClose:()=>r(void 0)})]})})}export{Na as component,ce as useMailContext};
1
+ import{b as Me,j as e,r as p,n as Ee,o as Pe,D as Le,X as Te,p as I,S as Fe,C as Ae,q as oe,t as Q,v as re,w as ie,F as ze,T as De,x as _e,M as Be,y as Ke,z as Qe,I as qe,B as E,E as le,G as He,H as $e,J as ce,e as B,K as ue,N as de,P as Ve,Q as Ue,R as We,U as me,a as xe,V as Ge,W as Ye,Y as z,Z as Je,_ as Xe,$ as Ze,a0 as es,a1 as ss,a2 as ts,a3 as as,a4 as ns,a5 as os,u as rs,c as is,a6 as ls,O as cs}from"./index-NTsfKnzH.js";import{l as O,u as D,m as q,a as us,b as ds,c as ms}from"./reply-CkAu_qmt.js";import{A as xs,S as fe,a as fs,c as ps,L as hs,b as gs,D as bs,d as vs}from"./DesktopChrome-CpxOryJF.js";import{u as ys,N as C,a as js,b as Ns,i as Ss}from"./nav-link-Bsus6xvs.js";import{u as K,a as Cs}from"./useMessageBodyContent-zzHQirBA.js";import{P as Is}from"./pencil-SmE0J4lF.js";import{c as ws,s as Os,M as ks}from"./MailShell-CaZXZkkc.js";import{u as Rs,a as Ms,R as Es,s as Ps,i as Ls,H as Ts,M as Fs}from"./useRefreshControl-B9CDgsXO.js";import{K as As,B as zs,S as Ds,u as _s,s as Bs,b as Ks,a as Qs,c as qs,d as Hs}from"./search-token-index-i96KeAvp.js";import{u as $s}from"./sections-DbaGT3GX.js";import{u as pe}from"./search-scope-DeUeCslw.js";import{M as Vs}from"./menu-Bjei5qcd.js";import{B as he,u as Us}from"./useResultFolderIndex-CAzxcbUl.js";import{u as ge}from"./useQueries-BWuMMxTL.js";import{f as Ws}from"./folder-failure-CqkVSsrb.js";import{i as Gs}from"./outbox-status-BlKn6P0x.js";import{u as Ys}from"./roving-focus-DGskqkqC.js";import{C as Js,A as Xs}from"./account-service-status-BcIwnoSK.js";import{C as H}from"./chevron-down-Dcb1svev.js";import{u as Zs}from"./index-BdVwGX5L.js";import{u as be,i as et}from"./useLayoutTier-Bd5ZeqbW.js";import{u as st}from"./useDebouncedValue-C_EHxcaO.js";import{E as tt}from"./ErrorState-BDj_H2Rc.js";import{K as $}from"./kbd-CsEUx1iS.js";import"./avatar-CAJhX3gE.js";import"./popover-menu-BKr-RjB3.js";import"./mail-YPl0v6Rg.js";import"./app-chrome-DsNAGBzs.js";import"./useMediaQuery-Dti_5Bdw.js";import"./FullCompose-CLLZZTDi.js";import"./confirm-dialog-B9uXBCde.js";import"./circle-check-big-BUyvgO1_.js";import"./refresh-cw-COTmGpG_.js";import"./useSignature-2RGHbdGD.js";import"./account-form-helpers-DhckT_PN.js";import"./suggest-list-Bwwkhu1A.js";const at=Me("SquarePen",[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z",key:"ohrbg2"}]]);function nt({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(Is,{className:"size-6"})})}const ot=({isOpen:s,onClose:t})=>{const a=p.useRef(null);return Ee({id:"shortcuts",open:s,answers:{back:t}}),Pe(a,s),s?e.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[e.jsx(Le,{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:I("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(Te,{className:"size-5"})})]}),e.jsx("div",{className:"grid gap-x-8 gap-y-6 sm:grid-cols-2",children:As.map(n=>e.jsxs("div",{children:[e.jsx("h3",{className:"mb-3 text-sm font-medium text-fg-muted",children:n.title}),e.jsx("div",{className:"space-y-2",children:n.hints.map(o=>e.jsxs("div",{className:"flex items-center justify-between gap-4",children:[e.jsx("span",{className:"text-sm",children:o.description}),e.jsx("span",{className:"flex shrink-0 items-center gap-1",children:o.keys.map((r,c)=>e.jsxs(p.Fragment,{children:[c>0&&o.keys[0]==="g"&&e.jsx("span",{className:"text-2xs text-fg-subtle",children:"then"}),e.jsx($,{children:r})]},r))})]},`${o.action}-${o.keys.join("+")}`))})]},n.title))}),e.jsx("div",{className:"mt-6 border-t border-line pt-4",children:e.jsxs("p",{className:"text-center text-xs text-fg-muted",children:["Press ",e.jsx($,{children:"Esc"})," to close"]})})]})]}):null},rt="button:not([disabled]), a[href]",P="outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-surface-sunken";function it({active:s,dimmed:t,indent:a}){return I("flex w-full items-center gap-2 rounded-md px-2 py-1 text-left text-sm transition-colors",P,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 lt({icon:s,label:t,count:a,active:n,failure:o}){return e.jsxs(e.Fragment,{children:[s&&e.jsx("span",{className:I("shrink-0",n?"text-accent-2":"text-fg-subtle"),children:s}),e.jsx("span",{className:"flex-1 truncate",children:t}),o&&e.jsx(re,{className:"size-3.5 shrink-0 text-danger","aria-hidden":"true"}),a!=null&&a>0&&e.jsx("span",{className:I("text-2xs tabular-nums",n?"text-accent-2":"text-fg-subtle"),children:a})]})}function w({icon:s,label:t,count:a,active:n,dimmed:o,indent:r,navId:c,linkComponent:u,ariaLabel:x,title:d,failure:h,onClick:y}){const g=it({active:n,dimmed:o,indent:r}),l=e.jsx(lt,{icon:s,label:t,count:a,active:n,failure:h}),v=x??t,m=h?`${v} — ${h}`:v,f=h?`${d??t} — ${h}`:d;return c&&u?u({navId:c,className:g,ariaLabel:m,title:f,onClick:y,children:l}):e.jsx("button",{type:"button",onClick:y,className:g,"aria-label":h?m:x,title:f,children:l})}const V={inbox:0,flagged:1,drafts:2,sent:3,archive:4,all:5,junk:6,trash:7};function ct(s){switch(s){case"inbox":return e.jsx(qe,{className:"size-4"});case"flagged":return e.jsx(oe,{className:"size-4"});case"drafts":return e.jsx(Qe,{className:"size-4"});case"sent":return e.jsx(ie,{className:"size-4"});case"archive":return e.jsx(Ke,{className:"size-4"});case"all":return e.jsx(Be,{className:"size-4"});case"junk":return e.jsx(_e,{className:"size-4"});case"trash":return e.jsx(De,{className:"size-4"})}}const U=s=>s.role!=null,A=8,W="remit.nav.folders.open.",G="remit.nav.account.open.";function Y(s,t,a){if(typeof localStorage>"u")return a;const n=localStorage.getItem(s+t);return n===null?a:n!=="0"}function J(s,t,a){typeof localStorage>"u"||localStorage.setItem(s+t,a?"1":"0")}function ut({account:s,selectedNavId:t,onSelectNav:a,linkComponent:n}){const[o,r]=p.useState(()=>Y(G,s.id,!0)),[c,u]=p.useState(()=>Y(W,s.id,!0)),[x,d]=p.useState(!1),h=()=>{r(i=>{const j=!i;return J(G,s.id,j),j})},y=()=>{u(i=>{const j=!i;return J(W,s.id,j),j})},g=s.mailboxes.filter(U).sort((i,j)=>V[i.role]-V[j.role]),l=s.mailboxes.filter(i=>!U(i)),v=x||l.length<=A?l:l.slice(0,A),m=l.length-v.length,f=s.status??"ready",b=s.syncedServices!==void 0&&!s.syncedServices.includes("Mail"),N=f==="ready"&&g.length===0&&l.length===0;return e.jsxs("div",{className:"mt-3",children:[e.jsxs("button",{type:"button",onClick:h,"aria-expanded":o,className:I("flex w-full items-center gap-1.5 px-2 pb-1 text-left transition-colors hover:text-fg",P,s.muted&&"opacity-55"),children:[o?e.jsx(H,{className:"size-3 shrink-0 text-fg-subtle"}):e.jsx(Q,{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(zs,{className:"size-3 shrink-0 text-fg-subtle"}),e.jsx("span",{className:"text-2xs text-fg-subtle",children:"muted"})]}),b&&e.jsxs(e.Fragment,{children:[e.jsx(Js,{className:"size-3 shrink-0 text-fg-subtle"}),e.jsx("span",{className:"text-2xs text-fg-subtle",children:Xs.Mail})]})]}),o&&e.jsxs(e.Fragment,{children:[f==="loading"&&e.jsx("div",{className:"px-2 py-1 text-sm text-fg-muted",children:"Loading…"}),f==="error"&&e.jsxs("div",{role:"alert",className:"mx-2 my-1 flex items-start gap-2 rounded-md border border-danger/40 bg-danger-soft px-2 py-1.5 text-sm",children:[e.jsx(re,{className:"mt-0.5 size-4 shrink-0 text-danger","aria-hidden":"true"}),e.jsx("div",{className:"min-w-0 flex-1",children:e.jsx("p",{className:"font-medium text-danger",children:"Couldn't load mailboxes"})}),s.onRetry&&e.jsx("button",{type:"button",onClick:s.onRetry,className:"shrink-0 text-sm font-medium text-accent hover:underline",children:"Retry"})]}),N&&e.jsx("div",{className:"px-2 py-1 text-sm text-fg-muted",children:"No mailboxes"}),f==="ready"&&e.jsxs(e.Fragment,{children:[g.map(i=>e.jsx(w,{navId:i.id,linkComponent:n,icon:ct(i.role),label:i.name,ariaLabel:i.name,title:i.fullPath??i.name,failure:i.failure,count:i.unseen,active:t===i.id,dimmed:s.muted,onClick:()=>a?.(i.id)},i.id)),s.outboxPending!==void 0&&e.jsx(w,{navId:"outbox",linkComponent:n,icon:e.jsx(ie,{className:"size-4"}),label:"Outbox",ariaLabel:"Outbox",count:s.outboxPending>0?s.outboxPending:void 0,active:t==="outbox",dimmed:s.muted,onClick:()=>a?.("outbox")}),l.length>0&&e.jsxs(e.Fragment,{children:[e.jsxs("button",{type:"button",onClick:y,"aria-expanded":c,className:I("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",P),children:[c?e.jsx(H,{className:"size-3 shrink-0"}):e.jsx(Q,{className:"size-3 shrink-0"}),e.jsx("span",{className:"flex-1",children:"Folders"}),e.jsx("span",{className:"tabular-nums opacity-70",children:l.length})]}),c&&e.jsxs(e.Fragment,{children:[v.map(i=>e.jsx(w,{navId:i.id,linkComponent:n,icon:e.jsx(ze,{className:"size-4"}),label:i.name,ariaLabel:i.name,title:i.fullPath??i.name,failure:i.failure,count:i.unseen,active:t===i.id,dimmed:s.muted,onClick:()=>a?.(i.id)},i.id)),(m>0||x)&&l.length>A&&e.jsx("button",{type:"button",onClick:()=>d(i=>!i),className:I("ml-7 flex items-center px-2 py-1 text-2xs font-medium text-accent transition-colors hover:underline",P),children:x?"Show less":`Show all (${l.length})`})]})]})]})]})]})}function dt({accounts:s,selectedNavId:t,briefUnseen:a,onSelectNav:n,variant:o="desktop",linkComponent:r,calendarNav:c="hidden"}){const u=p.useRef(null);Ys({containerRef:u,itemSelector:rt});const x=o==="drawer",d=e.jsxs("nav",{ref:x?u:void 0,className:x?"px-2 py-2":"flex-1 overflow-y-auto px-2 py-2","aria-label":"Mailboxes",children:[e.jsx(w,{navId:"brief",linkComponent:r,icon:e.jsx(Fe,{className:"size-4"}),label:"Daily brief",ariaLabel:"Daily brief",count:a,active:t==="brief",onClick:()=>n?.("brief")}),c==="shown"&&e.jsx(w,{navId:"calendar",linkComponent:r,icon:e.jsx(Ae,{className:"size-4"}),label:"Calendar",ariaLabel:"Calendar",active:t==="calendar",onClick:()=>n?.("calendar")}),e.jsx(w,{navId:"flagged",linkComponent:r,icon:e.jsx(oe,{className:"size-4"}),label:"Starred",ariaLabel:"Starred",active:t==="flagged",onClick:()=>n?.("flagged")}),s.length===0?e.jsx("div",{className:"px-2 py-4 text-center text-sm text-fg-muted",children:"No accounts configured"}):s.map(h=>e.jsx(ut,{account:h,selectedNavId:t,onSelectNav:n,linkComponent:r},h.id))]});return x?d:e.jsx("aside",{ref:u,className:"flex h-full w-full flex-col bg-surface-sunken",children:d})}function mt(){const s=pe();if(!s)return null;const t=s.showNavPane?!s.navCollapsed:!1;return e.jsx(E,{variant:"ghost",size:"sm",icon:e.jsx(Vs,{className:"size-4"}),onClick:s.toggleNav,"aria-label":t?"Hide folders":"Show folders","aria-expanded":t,title:"Folders",className:"shrink-0"})}const xt={global:"Search all mail",pending:"Search mail",scoped:"Search this folder"};function ft({search:s,onCompose:t,onReportBug:a,onOpenSettings:n,settingsAttention:o,composeShortcut:r,refreshControl:c,account:u}){return e.jsx(xs,{leading:e.jsx(mt,{}),search:e.jsx(Ds,{value:s.value,onChange:s.onChange,onClear:s.onClear,onClearQuery:s.onClearQuery,chips:s.chips,onRemoveChip:s.onRemoveChip,placeholder:xt[s.scope]}),actions:e.jsxs(e.Fragment,{children:[e.jsx(E,{variant:"ghost",size:"sm",icon:e.jsx(at,{className:"size-4"}),title:r?`Compose (${r})`:"Compose","aria-label":"Compose",onClick:t}),e.jsx(E,{variant:"ghost",size:"sm",icon:e.jsx(he,{className:"size-4"}),title:"Report a bug","aria-label":"Report a bug",onClick:a}),e.jsx(E,{variant:"ghost",size:"sm",icon:e.jsx(le,{label:o,children:e.jsx(fe,{className:"size-4"})}),title:"Settings","aria-label":o?`Settings — ${o}`:"Settings",onClick:n}),c,u]})})}function pt(){const{pathname:s}=ys(),t=He({from:"/mail/$mailboxId",shouldThrow:!1});return O(s,"/settings")?"settings":O(s,"/calendar")?"calendar":O(s,"/mail/outbox")?"outbox":O(s,"/mail/flagged")?"flagged":O(s,"/mail/brief")?"brief":t?.mailboxId??""}function ht(){const s=$e(),t=D({select:d=>q(d.location.pathname)}),a=D({select:d=>us(d.location.search)}),[n,o]=p.useState(a),r=st(n,200),[c,u]=p.useState(t);if(c!==t){const d=Os(c,t,a);u(t),d!==void 0&&o(d)}const x=p.useCallback(d=>{u(q(s.state.location.pathname)),o(d)},[s]);return{searchInput:n,committedQuery:ws(n,r),viewKey:t,setSearchInput:x}}const gt=()=>{const s=K();return ds()?null:e.jsx(nt,{onCompose:s})};function X({accounts:s}){const{searchInput:t,onSearchChange:a,onSearchClear:n,onSearchClearQuery:o,resultFolderIndex:r}=ce(),c=B(),u=$s(),x=K(),{scope:d,clearScope:h}=_s(s),y=ue(),g=d.kind==="scoped"?[{id:d.chip.id,label:d.chip.label,tone:"scope"}]:void 0,l=p.useMemo(()=>s.map(N=>N.accountId),[s]),{hasNewMail:v}=Rs(),{state:m,errorMessage:f,refresh:b}=Ms(l,{onSettled:()=>Ve(c,Ue(r.keys()))});return e.jsx(ft,{search:{value:t,scope:d.kind,chips:g,onChange:a,onClear:n,onClearQuery:o,onRemoveChip:h},onCompose:x,onReportBug:de,onOpenSettings:()=>u("accounts"),settingsAttention:y,composeShortcut:Bs("compose"),refreshControl:e.jsx(Es,{state:m,onRefresh:b,label:"Refresh all accounts",errorMessage:f,hasUpdate:v(l)}),account:e.jsx(fs,{})})}function bt(){return e.jsxs("button",{type:"button",onClick:de,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(he,{className:"size-4 shrink-0"}),e.jsx("span",{className:"flex-1 truncate text-left",children:"Report a bug"})]})}const Z=s=>/^\d/.test(s),vt=(s,t)=>{const a=Z(s),n=Z(t);return a&&!n?-1:!a&&n?1:s.localeCompare(t,void 0,{sensitivity:"base",numeric:!0})};function yt(s,t,a){const n=[],o=[];for(const r of s)t.has(r.mailboxId)?n.push(r):o.push(r);return o.sort((r,c)=>vt(z(r,void 0,a),z(c,void 0,a))),{system:n,labels:o}}function jt(s,t,a){const n=Je(t)&&s.unseenCount>0;return{id:s.mailboxId,name:z(s,t,a),unseen:n?s.unseenCount:void 0,role:t,fullPath:s.fullPath,failure:Ws(s)}}function ee({accounts:s,onMailboxSelect:t,variant:a="desktop"}){const n=B(),o=pt(),{onSearchChange:r}=ce(),{t:c}=We("mail",{useSuspense:!1}),u=p.useCallback((m,f)=>c(m,{defaultValue:f}),[c]),x=ge({queries:s.map(m=>({...me({path:{accountId:m.accountId}}),staleTime:1/0}))}),{data:d}=xe(Ge()),h=p.useMemo(()=>(d?.items??[]).filter(m=>Gs(m.status)).length,[d?.items]),y=p.useMemo(()=>s.map((m,f)=>{const b=x[f],N=b?.data?.items??[],i=Ye(m.folderAppointments),{system:j,labels:L}=yt(N,i,u),T=b?.isError?"error":b?.isLoading?"loading":"ready";return{id:m.accountId,label:m.email,email:m.email,muted:!!m.muted,outboxPending:h,status:T,onRetry:()=>b?.refetch(),mailboxes:[...j,...L].map(k=>jt(k,i.get(k.mailboxId),u))}}),[s,x,h,u]),g=m=>{n.invalidateQueries({queryKey:Xe({path:{mailboxId:m},query:{order:"desc"}})})},l=({navId:m,className:f,ariaLabel:b,title:N,children:i,onClick:j})=>m==="brief"?e.jsx(C,{to:"/mail/brief",search:{q:void 0},activeOptions:{includeSearch:!1},onClick:()=>j?.(),className:f,"aria-label":b,title:N,children:i}):m==="calendar"?e.jsx(C,{to:"/calendar",onClick:()=>j?.(),className:f,"aria-label":b,title:N,children:i}):m==="outbox"?e.jsx(C,{to:"/mail/outbox",search:{q:void 0},onClick:()=>j?.(),className:f,"aria-label":b,title:N,children:i}):m==="flagged"?e.jsx(C,{to:"/mail/flagged",search:{q:void 0},onClick:()=>j?.(),className:f,"aria-label":b,title:N,children:i}):m==="settings"?e.jsx(C,{to:"/settings/accounts",onClick:()=>j?.(),className:f,"aria-label":b,title:N,children:i}):e.jsx(C,{to:"/mail/$mailboxId",params:{mailboxId:m},search:{q:void 0},onClick:()=>{g(m),j?.()},className:f,"aria-label":b,title:N,children:i}),v=()=>{r(""),t?.()};return e.jsx(dt,{accounts:y,selectedNavId:o,onSelectNav:v,linkComponent:l,variant:a})}function Nt({accounts:s,onMailboxSelect:t}){const n=pe()?.showNavPane??!0,o=ue();return n?e.jsx(ee,{accounts:s}):e.jsxs("div",{className:"flex h-full flex-col",children:[e.jsx("div",{className:"flex-1 overflow-y-auto",children:e.jsx(ee,{accounts:s,onMailboxSelect:t,variant:"drawer"})}),e.jsxs("div",{className:"border-t border-line px-2 py-2",children:[e.jsxs(C,{to:"/settings/accounts",onClick:t,children:[e.jsx(le,{label:o,children:e.jsx(fe,{className:"size-4 shrink-0"})}),e.jsx("span",{className:"flex-1 truncate text-left",children:"Settings"})]}),e.jsx(bt,{}),e.jsx(ps,{children:({signOut:r})=>e.jsxs("button",{type:"button",onClick:()=>{t?.(),r()},className:"flex min-h-11 w-full items-center gap-2 rounded-md px-2 py-1 text-sm text-fg-muted transition-colors hover:bg-surface hover:text-fg","data-testid":"sign-out-button",children:[e.jsx(hs,{className:"size-4 shrink-0"}),e.jsx("span",{className:"flex-1 truncate text-left",children:"Sign out"})]})})]})]})}function St(s){const t=ge({queries:s.map(a=>({...me({path:{accountId:a.accountId}}),staleTime:1/0}))});return p.useMemo(()=>Ks(t.map(a=>a.data?.items??[])),[t])}const ve="remit:intelligence-open";function Ct(){try{return localStorage.getItem(ve)!=="closed"}catch{return!0}}function It(s){try{localStorage.setItem(ve,s?"open":"closed")}catch{}}function se({panels:s,prefersOpen:t,isDesktop:a,hasThread:n,raisedFor:o,openMessage:r}){if(o!==null&&o===r)return!0;const c=s.filter(u=>u!=="sidebar");return c.length>0?c.includes("intelligence"):a&&n&&t}const wt=()=>{const s=be(),t=js(),a=Ns(),n=t.find(Ss),o=Qs(),[r,c]=p.useState(Ct),u=o?`${o.threadId}/${o.messageId??""}`:null,[x,d]=p.useState(null),h={panels:t,prefersOpen:r,isDesktop:s==="desktop",hasThread:o!==void 0,openMessage:u},y=se({...h,raisedFor:x}),g=se({...h,raisedFor:null}),l=p.useCallback((b,N)=>{a([...b?["intelligence"]:[],...N?[N]:[]])},[a]),v=p.useCallback(b=>{l(g,b)},[g,l]),m=p.useCallback(()=>{if(y&&!g){d(null);return}const b=!y;It(b),c(b),d(null),l(b,n)},[g,y,n,l]),f=p.useCallback(()=>{d(u)},[u]);return{openOverlay:n,intelligenceOpen:y,showOverlay:v,toggleIntelligence:m,raiseIntelligence:f}};var R={exports:{}},te;function Ot(){if(te)return R.exports;te=1;const s=(t,a,n)=>new Promise((o,r)=>{if(n=Object.assign({concurrency:1/0},n),typeof a!="function")throw new TypeError("Mapper function is required");const{concurrency:c}=n;if(!(typeof c=="number"&&c>=1))throw new TypeError(`Expected \`concurrency\` to be a number from 1 and up, got \`${c}\` (${typeof c})`);const u=[],x=t[Symbol.iterator]();let d=!1,h=!1,y=0,g=0;const l=()=>{if(d)return;const v=x.next(),m=g;if(g++,v.done){h=!0,y===0&&o(u);return}y++,Promise.resolve(v.value).then(f=>a(f,m)).then(f=>{u[m]=f,y--,l()},f=>{d=!0,r(f)})};for(let v=0;v<c&&(l(),!h);v++);});return R.exports=s,R.exports.default=s,R.exports}var kt=Ot();const Rt=Ze(kt),Mt=900*1e3,Et=30,Pt=(s,t)=>{if(!s)return t;const a=Number.parseInt(s,10);return Number.isFinite(a)&&a>0?a:t},Lt=30*1e3,Tt=s=>Math.max(Pt(s,Et)*1e3,Lt),ye=Tt(os().mailboxPollIntervalSeconds),M=(s=Date.now(),t=ye)=>Ls(s)?Math.min(Ts,t):t,Ft=5,_=new Set,At=(s,t,a=Mt)=>s.filter(n=>{const o=n.lastSyncAt;return o==null?!0:t-o>a}).map(n=>n.accountId),zt=(s,t,a=ye)=>s-t>=a,Dt=(s,t)=>s.filter(a=>!t.has(a)),ae=(s,t)=>{if(_.delete(s),ts(t)||as(t,{softError:!0})){ns(t,{softError:!0});return}console.warn("[remit] background mailbox sync failed",{accountId:s,error:t})},ne=(s,t)=>es({path:{accountId:s},throwOnError:!0}).then(()=>{t.invalidateQueries({queryKey:ss({path:{accountId:s}})})}),_t=s=>{const t=B(),a=p.useRef(s);a.current=s;const n=s.map(o=>o.accountId).join(",");p.useEffect(()=>{const o=Date.now(),c=At(a.current,o).filter(u=>!_.has(u));if(c.length!==0)for(const u of c)_.add(u),ne(u,t).catch(x=>{ae(u,x)})},[n,t]),p.useEffect(()=>{let o=Date.now(),r;const c=new Set,u=()=>{o=Date.now();const g=Dt(a.current.map(l=>l.accountId),c);for(const l of g)c.add(l);Rt(g,l=>ne(l,t).catch(v=>{ae(l,v)}).finally(()=>{c.delete(l)}),{concurrency:Ft})},x=()=>{if(document.visibilityState==="visible"){u(),r=setTimeout(x,M());return}},d=()=>{if(document.visibilityState!=="visible")return;r!==void 0&&clearTimeout(r);const g=Date.now(),l=M(g);if(zt(g,o,l)){u(),r=setTimeout(x,l);return}r=setTimeout(x,o+l-g)},h=()=>{document.visibilityState==="visible"&&(r!==void 0&&clearTimeout(r),o=Date.now(),r=setTimeout(x,M()))};r=setTimeout(x,M()),document.addEventListener("visibilitychange",d);const y=Ps(h);return()=>{r!==void 0&&clearTimeout(r),document.removeEventListener("visibilitychange",d),y()}},[n,t])};function Na(){const s=rs(),t=be(),a=et(t),{openOverlay:n,intelligenceOpen:o,showOverlay:r,toggleIntelligence:c,raiseIntelligence:u}=wt(),x=n==="shortcuts",d=n==="nav",{searchInput:h,committedQuery:y,viewKey:g,setSearchInput:l}=ht(),{data:v,isLoading:m,isError:f,error:b,refetch:N}=xe({...is(),staleTime:1/0}),i=!!(v&&(v.accounts?.length??0)===0);p.useEffect(()=>{i&&s({to:"/onboarding",replace:!0})},[i,s]),Zs({enabled:!x,bindings:[{key:"?",action:"help",handler:()=>r("shortcuts"),noModifiers:!1,preventDefault:!0}]});const j=K(),L=Cs(),T=D({select:F=>ms(F.matches)?.list==="mailbox"}),k=p.useMemo(()=>({compose:j}),[j]);qs({enabled:!T&&!L,handlers:k});const je=p.useCallback(()=>{l("")},[l]),Ne=p.useCallback(()=>{l("")},[l]),S=v?.accounts??[],Se=p.useMemo(()=>S.map(F=>F.accountId),[S]),Ce=St(S),Ie=Us(S).index,we=p.useMemo(()=>Hs(S),[S]);_t(S);const Oe=p.useCallback(()=>{n==="nav"&&r(void 0)},[n,r]),ke={accounts:S,mailboxNameIndex:Ce,accountNameIndex:we,resultFolderIndex:Ie,searchQuery:y,searchInput:h,searchViewKey:g,onSearchChange:l,onSearchClear:je,onSearchClearQuery:Ne,intelligenceOpen:o,onToggleIntelligence:c,onRaiseIntelligence:u},Re={isSinglePane:a,isLoading:m||i,intelligenceOpen:o,nav:e.jsx(Nt,{accounts:S,onMailboxSelect:Oe}),topBar:a?void 0:e.jsx(X,{accounts:S}),appBar:t==="phone"?void 0:e.jsx(vs,{}),overlay:a?e.jsx(gt,{}):void 0,navOpen:d,onOpenNav:()=>r("nav"),onCloseNav:()=>r(void 0)};return e.jsx(ls.Provider,{value:ke,children:e.jsxs(Fs,{accountIds:Se,children:[e.jsx(gs,{children:f?e.jsx(bs,{topBar:e.jsx(X,{accounts:S}),children:e.jsx("div",{className:"flex h-full items-center justify-center bg-canvas p-4",children:e.jsx(tt,{title:"Couldn't load your account",error:b,onRetry:()=>{N()}})})}):e.jsx(ks,{chrome:Re,children:e.jsx(cs,{})})}),e.jsx(ot,{isOpen:x,onClose:()=>r(void 0)})]})})}export{Na as component,ce as useMailContext};
@@ -1 +1 @@
1
- import{b as e}from"./index-BZ4sAts4.js";const a=e("Mail",[["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2",key:"18n3k1"}],["path",{d:"m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7",key:"1ocrg3"}]]);export{a as M};
1
+ import{b as e}from"./index-NTsfKnzH.js";const a=e("Mail",[["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2",key:"18n3k1"}],["path",{d:"m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7",key:"1ocrg3"}]]);export{a as M};
@@ -1 +1 @@
1
- import{b as e}from"./index-BZ4sAts4.js";const n=e("Menu",[["line",{x1:"4",x2:"20",y1:"12",y2:"12",key:"1e0a9i"}],["line",{x1:"4",x2:"20",y1:"6",y2:"6",key:"1owob3"}],["line",{x1:"4",x2:"20",y1:"18",y2:"18",key:"yk5zj1"}]]);export{n as M};
1
+ import{b as e}from"./index-NTsfKnzH.js";const n=e("Menu",[["line",{x1:"4",x2:"20",y1:"12",y2:"12",key:"1e0a9i"}],["line",{x1:"4",x2:"20",y1:"6",y2:"6",key:"1owob3"}],["line",{x1:"4",x2:"20",y1:"18",y2:"18",key:"yk5zj1"}]]);export{n as M};
@@ -1 +1 @@
1
- import{j as f,p as s,H as b,c8 as d,c9 as x,r as i,u as P,ca as S,cb as N}from"./index-BZ4sAts4.js";import{u as O}from"./useMediaQuery-D3m_n689.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=S(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 A(){const e=P();return i.useCallback(n=>{e({search:!0,hash:c(n),replace:!0,hashScrollIntoView:!1})},[e])}const _=N(w);function H({fragment:e,...n}){const t=T();return f.jsx(_,{...n,hash:e??t})}export{H as N,M as a,A as b,T as c,m as i,G as p,I as u};
1
+ import{j as f,p as s,H as b,cb as d,cc as x,r as i,u as P,cd as S,ce as N}from"./index-NTsfKnzH.js";import{u as O}from"./useMediaQuery-Dti_5Bdw.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=S(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 A(){const e=P();return i.useCallback(n=>{e({search:!0,hash:c(n),replace:!0,hashScrollIntoView:!1})},[e])}const _=N(w);function H({fragment:e,...n}){const t=T();return f.jsx(_,{...n,hash:e??t})}export{H as N,M as a,A as b,T as c,m as i,G as p,I as u};
@@ -0,0 +1 @@
1
+ import{C as o}from"./CalendarEventEditor-Cuivix6B.js";import"./index-NTsfKnzH.js";import"./draft-BpctUOpv.js";import"./agenda-time-DSxqMI31.js";import"./calendar-guests-_9JIL5bL.js";import"./calendar-event-popup-BPDsVk8G.js";import"./useCalendarSuggestions-epkXEJdf.js";import"./ErrorState-BDj_H2Rc.js";import"./useQueries-BWuMMxTL.js";import"./pencil-SmE0J4lF.js";import"./circle-help-BHDb6fr4.js";import"./useCalendarData-CXuwQioO.js";import"./useCalendarTasks-BygC_sdR.js";import"./useCalendarScheduling-DFvOUPbg.js";import"./useDebouncedValue-C_EHxcaO.js";import"./calendar-format-BwCpz-JZ.js";import"./nav-link-Bsus6xvs.js";import"./useMediaQuery-Dti_5Bdw.js";import"./calendar-D-6SDX7I.js";import"./reply-CkAu_qmt.js";import"./CalendarQuickCreate-FK6jRrvs.js";import"./CalendarSession-CJCauncC.js";import"./calendar-event-sidebar-DE7aDbdU.js";import"./select-D3KrqhMa.js";import"./chevron-down-Dcb1svev.js";import"./confirm-dialog-B9uXBCde.js";const u=o;export{u as component};
@@ -0,0 +1 @@
1
+ import{l as i,e as n,u as a,r as m,j as p}from"./index-NTsfKnzH.js";import{O as s}from"./OnboardingWizard-DbvpJ09j.js";import{c}from"./onboarding-completion-DnD7ZKm2.js";import"./credential-steps-CEwGV_Jz.js";import"./select-D3KrqhMa.js";import"./chevron-down-Dcb1svev.js";import"./badge-DL_zWZca.js";import"./card-Bt0rEzaX.js";import"./account-form-helpers-DhckT_PN.js";import"./mail-YPl0v6Rg.js";import"./file-json-B9WSoC-B.js";import"./kbd-CsEUx1iS.js";import"./checkbox-Ox4avOrC.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-BZ4sAts4.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-NTsfKnzH.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-NTsfKnzH.js";import{a as m}from"./MailShell-CaZXZkkc.js";import{u as p,O as t}from"./OutboxPane-B-r7Diu5.js";import"./nav-link-Bsus6xvs.js";import"./reply-CkAu_qmt.js";import{u as s}from"./search-mirror-DkPI5xYg.js";import"./useMessageBodyContent-zzHQirBA.js";import"./FullCompose-CLLZZTDi.js";import"./index-BdVwGX5L.js";import"./useSignature-2RGHbdGD.js";import"./account-form-helpers-DhckT_PN.js";import"./useDebouncedValue-C_EHxcaO.js";import"./suggest-list-Bwwkhu1A.js";import"./sections-DbaGT3GX.js";import"./useMediaQuery-Dti_5Bdw.js";import"./chevron-down-Dcb1svev.js";import"./ErrorState-BDj_H2Rc.js";import"./confirm-dialog-B9uXBCde.js";import"./search-scope-DeUeCslw.js";import"./app-chrome-DsNAGBzs.js";import"./MessageBody-D6YVQ7Ek.js";import"./kbd-CsEUx1iS.js";import"./outbox-status-BlKn6P0x.js";import"./NavMenuButton-CSk-ecU-.js";import"./menu-Bjei5qcd.js";import"./roving-focus-DGskqkqC.js";import"./circle-check-big-BUyvgO1_.js";import"./clock-V9PRsNAj.js";import"./row-actions-CO60uRRB.js";import"./rotate-ccw-DcPTHd9U.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 a}from"./index-BZ4sAts4.js";const c=a("Pencil",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]);export{c as P};
1
+ import{b as a}from"./index-NTsfKnzH.js";const c=a("Pencil",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]);export{c as P};
@@ -1 +1 @@
1
- import{b as D,e as O,f as I,bF as E,bG as R,bH as T,bI as A,bJ as F,bK as L,bL as z,bM as v,r as c,j as e,aB as k,B as m,X as M,ap as U,bN as g,b3 as B,aq as H,bO as Q,d as b,bP as q,bQ as C,bR as w,u as G,ac as K}from"./index-BZ4sAts4.js";import{R as S}from"./ReportLink-BTuMtEGU.js";import{C as W}from"./copy-DMRh3Rb2.js";import{D as Y,a as h,b as _}from"./DropdownMenu-DusMkzz6.js";import{a as $}from"./sections-B9pteMHc.js";import{S as J}from"./settings-screen-C8kBB2kR.js";import"./avatar-CQq2GZz9.js";import"./badge-BVw5vgFN.js";import"./chevron-left-DUh7xA0y.js";import"./menu-DXmZUEBa.js";import"./circle-help-CP1s-Yi3.js";const X=D("Ellipsis",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]]),V=async({action:s,person:t},r)=>{const n={userId:t.userId};if(s==="SignOut"){const{data:a}=await F({path:n,body:{stepUpToken:r},throwOnError:!0});return{person:a,resetUrl:void 0}}if(s==="ResetPassword"){const{data:a}=await L({path:n,body:{stepUpToken:r},throwOnError:!0});return{person:a.person,resetUrl:a.resetUrl}}const{data:o}=await z({path:n,body:{status:s==="Disable"?"Disabled":"Active",stepUpToken:r},throwOnError:!0});return{person:o,resetUrl:void 0}},Z=s=>{const t=O();return I({meta:E,gcTime:0,mutationFn:async r=>{const{data:n}=await A({body:{password:s,action:r.action,userId:r.person.userId},throwOnError:!0});return V(r,n.stepUpToken)},onSuccess:({person:r})=>{t.setQueryData(R(),n=>n&&{people:T(n.people,r)})}})},ee="That is not your password. Try again.",se="Five wrong passwords in 15 minutes. Wait 15 minutes, then try again.";function te({action:s,person:t,onCancel:r,onDone:n,onFailed:o}){const a=v(s,t.email),[l,p]=c.useState(""),[u,x]=c.useState(null),i=Z(l),d=()=>{i.isPending||r()},P=f=>{f.preventDefault(),!(i.isPending||l==="")&&(x(null),i.mutate({action:s,person:t},{onSuccess:n,onError:y=>{const j=g(y);if(j.kind==="wrongPassword"){p(""),x(ee);return}if(j.kind==="locked"){p(""),x(se);return}if(j.kind==="signedOut"){r(),B();return}o(y)}}))};return e.jsx(k,{open:!0,onClose:d,title:a.title,children:e.jsxs("form",{onSubmit:P,children:[e.jsxs("header",{className:"flex items-center gap-2 border-b border-line px-5 py-3",children:[e.jsx("span",{className:"flex-1 text-sm font-semibold text-fg",children:a.title}),e.jsx(m,{variant:"ghost",size:"sm",icon:e.jsx(M,{className:"size-3.5"}),onClick:d,"aria-label":"Close"})]}),e.jsxs("div",{className:"space-y-4 px-5 py-4 text-sm text-fg-muted",children:[e.jsx("p",{children:a.body}),e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsx("label",{htmlFor:"people-step-up-password",className:"text-xs font-medium text-fg",children:"Your password"}),e.jsx(U,{id:"people-step-up-password",autoComplete:"current-password",value:l,onChange:f=>{p(f.target.value),x(null)},"aria-invalid":u!==null,"aria-describedby":"people-step-up-hint",required:!0}),e.jsx("p",{id:"people-step-up-hint",className:"text-xs",children:u?e.jsx("span",{className:"text-danger",role:"alert",children:u}):"Confirm with your own password. It counts for this one action."})]})]}),e.jsxs("footer",{className:"flex items-center justify-end gap-2 border-t border-line px-5 py-3",children:[e.jsx(m,{variant:"secondary",size:"sm",onClick:d,children:"Cancel"}),e.jsx(m,{type:"submit",variant:a.destructive?"danger":"primary",size:"sm",disabled:l==="","aria-busy":i.isPending,children:a.confirmLabel})]})]})})}const ne=()=>{};function re({email:s,resetUrl:t,onDone:r}){const[n,o]=c.useState(!1),[a,l]=c.useState(!1),p=()=>{navigator.clipboard.writeText(t).then(()=>{l(!1),o(!0)}).catch(()=>l(!0))};return e.jsxs(k,{open:!0,onClose:ne,title:`Reset link for ${s}`,children:[e.jsxs("header",{className:"border-b border-line px-5 py-3 text-sm font-semibold text-fg",children:["Reset link for ",s]}),e.jsxs("div",{className:"space-y-4 px-5 py-4 text-sm text-fg-muted",children:[e.jsx("p",{children:"They are signed out everywhere. Give them this link, by message or in person. It works once, for 24 hours."}),e.jsxs("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center",children:[e.jsx(m,{variant:"primary",size:"sm",icon:n?e.jsx(H,{className:"size-3.5"}):e.jsx(W,{className:"size-3.5"}),onClick:p,children:n?"Copied":"Copy"}),e.jsx("input",{readOnly:!0,tabIndex:-1,value:t,"aria-label":`Reset link for ${s}`,onFocus:u=>u.currentTarget.select(),className:"min-w-0 flex-1 rounded-sm border border-line bg-surface px-2 py-1.5 font-mono text-xs text-fg sm:order-first"})]}),a&&e.jsx("p",{className:"text-xs text-danger",role:"alert",children:"Copying did not work in this browser. Select the link and copy it by hand."}),e.jsx("p",{children:"You see this link only now. Close this window and it is gone. Make a new one if it gets lost."})]}),e.jsx("footer",{className:"flex justify-end border-t border-line px-5 py-3",children:e.jsx(m,{variant:"secondary",size:"sm",onClick:r,children:"Done"})})]})}const N="The list of people did not load";function ae({failure:s}){const t=c.useRef(null);return c.useEffect(()=>{t.current?.focus()},[]),e.jsx("div",{ref:t,tabIndex:-1,className:"outline-none",children:e.jsxs(b,{tone:"danger",children:[e.jsx("p",{className:"font-medium",children:s.title}),e.jsx("p",{className:"mt-1 text-fg-muted",children:s.reason}),e.jsx("p",{className:"mt-1",children:e.jsx(S,{href:C(s.title,s.error)})})]})})}function oe({person:s,onPick:t}){const r=s.status==="Disabled";return e.jsxs(Y,{trigger:e.jsxs(e.Fragment,{children:[e.jsx(X,{className:"size-4","aria-hidden":"true"}),e.jsxs("span",{className:"sr-only",children:["Actions for ",s.email]})]}),children:[e.jsx(h,{onClick:()=>t("SignOut"),children:"Sign out everywhere"}),e.jsx(h,{onClick:()=>t("ResetPassword"),children:"Reset password"}),e.jsx(_,{}),r?e.jsx(h,{onClick:()=>t("Enable"),children:"Enable"}):e.jsx(h,{onClick:()=>t("Disable"),disabled:s.isCaller,destructive:!s.isCaller,children:e.jsxs("span",{className:"flex flex-col",children:[e.jsx("span",{children:"Disable"}),s.isCaller&&e.jsx("span",{className:"text-xs text-fg-subtle",children:"Not your own account"})]})})]})}function ie({people:s,onPick:t}){const r=new Date;return e.jsx("div",{className:"overflow-x-auto rounded-sm border border-line bg-surface",children:e.jsxs("table",{className:"w-full text-left text-sm",children:[e.jsx("thead",{className:"border-b border-line text-xs text-fg-muted",children:e.jsxs("tr",{children:[e.jsx("th",{scope:"col",className:"px-3 py-2 font-medium",children:"Email"}),e.jsx("th",{scope:"col",className:"px-3 py-2 font-medium",children:"Created"}),e.jsx("th",{scope:"col",className:"px-3 py-2 font-medium",children:"Last sign-in"}),e.jsx("th",{scope:"col",className:"px-3 py-2 font-medium",children:"Sessions"}),e.jsx("th",{scope:"col",className:"px-3 py-2 font-medium",children:"Status"}),e.jsx("th",{scope:"col",className:"w-12 px-1 py-2",children:e.jsx("span",{className:"sr-only",children:"Actions"})})]})}),e.jsx("tbody",{children:s.map(n=>e.jsxs("tr",{className:"border-b border-line last:border-b-0",children:[e.jsxs("td",{className:"px-3 py-1 text-fg",children:[n.email,n.isCaller&&e.jsx("span",{className:"text-fg-muted",children:" (you)"})]}),e.jsx("td",{className:"px-3 py-1 text-fg-muted",children:w(n.createdAt,r)}),e.jsx("td",{className:"px-3 py-1 text-fg-muted",children:w(n.lastSignInAt,r)}),e.jsx("td",{className:"px-3 py-1 tabular-nums text-fg-muted",children:n.sessionCount}),e.jsx("td",{className:n.status==="Disabled"?"px-3 py-1 text-danger":"px-3 py-1 text-fg-muted",children:n.status}),e.jsx("td",{className:"px-1 py-1",children:e.jsx(oe,{person:n,onPick:o=>t(o,n)})})]},n.userId))})]})})}function le(){const s=Q(),[t,r]=c.useState(null),[n,o]=c.useState(null),[a,l]=c.useState(null);if(s.isPending)return e.jsx("div",{className:"h-24 animate-pulse rounded-sm border border-line bg-surface","aria-busy":"true","aria-label":"Loading people"});if(s.unavailable)return e.jsx(b,{tone:"info",children:"This server has no People page. It shows on a self-hosted server once self sign-up is turned off."});if(s.isError)return g(s.error).kind==="signedOut"?null:e.jsxs(b,{tone:"danger",children:[e.jsxs("p",{className:"font-medium",children:[N,"."]}),e.jsx("p",{className:"mt-1 text-fg-muted",children:q(s.error)}),e.jsxs("p",{className:"mt-2 flex items-center gap-3",children:[e.jsx(m,{variant:"secondary",size:"sm",onClick:()=>{s.refetch()},children:"Try again"}),e.jsx(S,{href:C(N,s.error)})]})]});const p=(i,d)=>{o(null),r({action:i,person:d})},u=i=>{i.resetUrl&&t&&l({email:t.person.email,resetUrl:i.resetUrl}),r(null)},x=i=>{if(!t)return;const d=g(i);o({title:v(t.action,t.person.email).failedTitle,reason:d.kind==="failed"?d.reason:"Something went wrong. Nothing changed. Try again.",error:i}),r(null)};return e.jsxs("div",{className:"space-y-4",children:[n&&e.jsx(ae,{failure:n}),e.jsx(ie,{people:s.data.people,onPick:p}),t&&e.jsx(te,{action:t.action,person:t.person,onCancel:()=>r(null),onDone:u,onFailed:x}),a&&e.jsx(re,{email:a.email,resetUrl:a.resetUrl,onDone:()=>l(null)})]})}const ce=e.jsxs("div",{className:"space-y-3",children:[e.jsx("p",{children:"Anyone signed in here can manage every account. Each action asks for your own password first, and is recorded with who took it and from where."}),e.jsx("p",{children:"Disabling an account signs that person out within 15 minutes and stops their calendar feed links. Their mail stays. You cannot disable your own account, so one account always stays on."}),e.jsx("p",{children:"A reset link works once, for 24 hours, and is shown only once. Making one stops the old password at once."}),e.jsxs("p",{children:["The person who runs this server can turn all sign-in off with"," ",e.jsx("code",{children:"remit sign-in off"}),", and recover an account from the host with"," ",e.jsx("code",{children:"remit people enable"})," or ",e.jsx("code",{children:"remit people reset"}),"."]})]});function we(){const s=G(),t=K(),r=$(),[n,o]=c.useState(!0);return e.jsx(J,{items:t,activeId:"people",title:"People",description:"Everyone with an account on this server.",help:ce,helpOpen:n,onToggleHelp:()=>o(a=>!a),onSelect:r,onBackToMail:()=>{s({to:"/mail"})},children:e.jsx(le,{})})}export{we as component};
1
+ import{b as D,e as O,f as I,bI as E,bJ as R,bK as T,bL as A,bM as L,bN as F,bO as z,bP as v,r as c,j as e,aB as k,B as m,X as M,ap as U,bQ as g,b5 as B,aq as H,bR as Q,d as b,bS as q,bT as C,bU as w,u as K,ac as W}from"./index-NTsfKnzH.js";import{R as S}from"./ReportLink-BTOR-1yq.js";import{C as Y}from"./copy-DGIy9NV0.js";import{D as G,a as h,b as _}from"./DropdownMenu-CAD4JZmN.js";import{a as $}from"./sections-DbaGT3GX.js";import{S as J}from"./settings-screen-Dc-Ptb7G.js";import"./avatar-CAJhX3gE.js";import"./badge-DL_zWZca.js";import"./chevron-left-BPKjlJZD.js";import"./menu-Bjei5qcd.js";import"./circle-help-BHDb6fr4.js";const X=D("Ellipsis",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]]),V=async({action:s,person:t},r)=>{const n={userId:t.userId};if(s==="SignOut"){const{data:a}=await L({path:n,body:{stepUpToken:r},throwOnError:!0});return{person:a,resetUrl:void 0}}if(s==="ResetPassword"){const{data:a}=await F({path:n,body:{stepUpToken:r},throwOnError:!0});return{person:a.person,resetUrl:a.resetUrl}}const{data:o}=await z({path:n,body:{status:s==="Disable"?"Disabled":"Active",stepUpToken:r},throwOnError:!0});return{person:o,resetUrl:void 0}},Z=s=>{const t=O();return I({meta:E,gcTime:0,mutationFn:async r=>{const{data:n}=await A({body:{password:s,action:r.action,userId:r.person.userId},throwOnError:!0});return V(r,n.stepUpToken)},onSuccess:({person:r})=>{t.setQueryData(R(),n=>n&&{people:T(n.people,r)})}})},ee="That is not your password. Try again.",se="Five wrong passwords in 15 minutes. Wait 15 minutes, then try again.";function te({action:s,person:t,onCancel:r,onDone:n,onFailed:o}){const a=v(s,t.email),[l,p]=c.useState(""),[u,x]=c.useState(null),i=Z(l),d=()=>{i.isPending||r()},P=f=>{f.preventDefault(),!(i.isPending||l==="")&&(x(null),i.mutate({action:s,person:t},{onSuccess:n,onError:y=>{const j=g(y);if(j.kind==="wrongPassword"){p(""),x(ee);return}if(j.kind==="locked"){p(""),x(se);return}if(j.kind==="signedOut"){r(),B();return}o(y)}}))};return e.jsx(k,{open:!0,onClose:d,title:a.title,children:e.jsxs("form",{onSubmit:P,children:[e.jsxs("header",{className:"flex items-center gap-2 border-b border-line px-5 py-3",children:[e.jsx("span",{className:"flex-1 text-sm font-semibold text-fg",children:a.title}),e.jsx(m,{variant:"ghost",size:"sm",icon:e.jsx(M,{className:"size-3.5"}),onClick:d,"aria-label":"Close"})]}),e.jsxs("div",{className:"space-y-4 px-5 py-4 text-sm text-fg-muted",children:[e.jsx("p",{children:a.body}),e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsx("label",{htmlFor:"people-step-up-password",className:"text-xs font-medium text-fg",children:"Your password"}),e.jsx(U,{id:"people-step-up-password",autoComplete:"current-password",value:l,onChange:f=>{p(f.target.value),x(null)},"aria-invalid":u!==null,"aria-describedby":"people-step-up-hint",required:!0}),e.jsx("p",{id:"people-step-up-hint",className:"text-xs",children:u?e.jsx("span",{className:"text-danger",role:"alert",children:u}):"Confirm with your own password. It counts for this one action."})]})]}),e.jsxs("footer",{className:"flex items-center justify-end gap-2 border-t border-line px-5 py-3",children:[e.jsx(m,{variant:"secondary",size:"sm",onClick:d,children:"Cancel"}),e.jsx(m,{type:"submit",variant:a.destructive?"danger":"primary",size:"sm",disabled:l==="","aria-busy":i.isPending,children:a.confirmLabel})]})]})})}const ne=()=>{};function re({email:s,resetUrl:t,onDone:r}){const[n,o]=c.useState(!1),[a,l]=c.useState(!1),p=()=>{navigator.clipboard.writeText(t).then(()=>{l(!1),o(!0)}).catch(()=>l(!0))};return e.jsxs(k,{open:!0,onClose:ne,title:`Reset link for ${s}`,children:[e.jsxs("header",{className:"border-b border-line px-5 py-3 text-sm font-semibold text-fg",children:["Reset link for ",s]}),e.jsxs("div",{className:"space-y-4 px-5 py-4 text-sm text-fg-muted",children:[e.jsx("p",{children:"They are signed out everywhere. Give them this link, by message or in person. It works once, for 24 hours."}),e.jsxs("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center",children:[e.jsx(m,{variant:"primary",size:"sm",icon:n?e.jsx(H,{className:"size-3.5"}):e.jsx(Y,{className:"size-3.5"}),onClick:p,children:n?"Copied":"Copy"}),e.jsx("input",{readOnly:!0,tabIndex:-1,value:t,"aria-label":`Reset link for ${s}`,onFocus:u=>u.currentTarget.select(),className:"min-w-0 flex-1 rounded-sm border border-line bg-surface px-2 py-1.5 font-mono text-xs text-fg sm:order-first"})]}),a&&e.jsx("p",{className:"text-xs text-danger",role:"alert",children:"Copying did not work in this browser. Select the link and copy it by hand."}),e.jsx("p",{children:"You see this link only now. Close this window and it is gone. Make a new one if it gets lost."})]}),e.jsx("footer",{className:"flex justify-end border-t border-line px-5 py-3",children:e.jsx(m,{variant:"secondary",size:"sm",onClick:r,children:"Done"})})]})}const N="The list of people did not load";function ae({failure:s}){const t=c.useRef(null);return c.useEffect(()=>{t.current?.focus()},[]),e.jsx("div",{ref:t,tabIndex:-1,className:"outline-none",children:e.jsxs(b,{tone:"danger",children:[e.jsx("p",{className:"font-medium",children:s.title}),e.jsx("p",{className:"mt-1 text-fg-muted",children:s.reason}),e.jsx("p",{className:"mt-1",children:e.jsx(S,{href:C(s.title,s.error)})})]})})}function oe({person:s,onPick:t}){const r=s.status==="Disabled";return e.jsxs(G,{trigger:e.jsxs(e.Fragment,{children:[e.jsx(X,{className:"size-4","aria-hidden":"true"}),e.jsxs("span",{className:"sr-only",children:["Actions for ",s.email]})]}),children:[e.jsx(h,{onClick:()=>t("SignOut"),children:"Sign out everywhere"}),e.jsx(h,{onClick:()=>t("ResetPassword"),children:"Reset password"}),e.jsx(_,{}),r?e.jsx(h,{onClick:()=>t("Enable"),children:"Enable"}):e.jsx(h,{onClick:()=>t("Disable"),disabled:s.isCaller,destructive:!s.isCaller,children:e.jsxs("span",{className:"flex flex-col",children:[e.jsx("span",{children:"Disable"}),s.isCaller&&e.jsx("span",{className:"text-xs text-fg-subtle",children:"Not your own account"})]})})]})}function ie({people:s,onPick:t}){const r=new Date;return e.jsx("div",{className:"overflow-x-auto rounded-sm border border-line bg-surface",children:e.jsxs("table",{className:"w-full text-left text-sm",children:[e.jsx("thead",{className:"border-b border-line text-xs text-fg-muted",children:e.jsxs("tr",{children:[e.jsx("th",{scope:"col",className:"px-3 py-2 font-medium",children:"Email"}),e.jsx("th",{scope:"col",className:"px-3 py-2 font-medium",children:"Created"}),e.jsx("th",{scope:"col",className:"px-3 py-2 font-medium",children:"Last sign-in"}),e.jsx("th",{scope:"col",className:"px-3 py-2 font-medium",children:"Sessions"}),e.jsx("th",{scope:"col",className:"px-3 py-2 font-medium",children:"Status"}),e.jsx("th",{scope:"col",className:"w-12 px-1 py-2",children:e.jsx("span",{className:"sr-only",children:"Actions"})})]})}),e.jsx("tbody",{children:s.map(n=>e.jsxs("tr",{className:"border-b border-line last:border-b-0",children:[e.jsxs("td",{className:"px-3 py-1 text-fg",children:[n.email,n.isCaller&&e.jsx("span",{className:"text-fg-muted",children:" (you)"})]}),e.jsx("td",{className:"px-3 py-1 text-fg-muted",children:w(n.createdAt,r)}),e.jsx("td",{className:"px-3 py-1 text-fg-muted",children:w(n.lastSignInAt,r)}),e.jsx("td",{className:"px-3 py-1 tabular-nums text-fg-muted",children:n.sessionCount}),e.jsx("td",{className:n.status==="Disabled"?"px-3 py-1 text-danger":"px-3 py-1 text-fg-muted",children:n.status}),e.jsx("td",{className:"px-1 py-1",children:e.jsx(oe,{person:n,onPick:o=>t(o,n)})})]},n.userId))})]})})}function le(){const s=Q(),[t,r]=c.useState(null),[n,o]=c.useState(null),[a,l]=c.useState(null);if(s.isPending)return e.jsx("div",{className:"h-24 animate-pulse rounded-sm border border-line bg-surface","aria-busy":"true","aria-label":"Loading people"});if(s.unavailable)return e.jsx(b,{tone:"info",children:"This server has no People page. It shows on a self-hosted server once self sign-up is turned off."});if(s.isError)return g(s.error).kind==="signedOut"?null:e.jsxs(b,{tone:"danger",children:[e.jsxs("p",{className:"font-medium",children:[N,"."]}),e.jsx("p",{className:"mt-1 text-fg-muted",children:q(s.error)}),e.jsxs("p",{className:"mt-2 flex items-center gap-3",children:[e.jsx(m,{variant:"secondary",size:"sm",onClick:()=>{s.refetch()},children:"Try again"}),e.jsx(S,{href:C(N,s.error)})]})]});const p=(i,d)=>{o(null),r({action:i,person:d})},u=i=>{i.resetUrl&&t&&l({email:t.person.email,resetUrl:i.resetUrl}),r(null)},x=i=>{if(!t)return;const d=g(i);o({title:v(t.action,t.person.email).failedTitle,reason:d.kind==="failed"?d.reason:"Something went wrong. Nothing changed. Try again.",error:i}),r(null)};return e.jsxs("div",{className:"space-y-4",children:[n&&e.jsx(ae,{failure:n}),e.jsx(ie,{people:s.data.people,onPick:p}),t&&e.jsx(te,{action:t.action,person:t.person,onCancel:()=>r(null),onDone:u,onFailed:x}),a&&e.jsx(re,{email:a.email,resetUrl:a.resetUrl,onDone:()=>l(null)})]})}const ce=e.jsxs("div",{className:"space-y-3",children:[e.jsx("p",{children:"Anyone signed in here can manage every account. Each action asks for your own password first, and is recorded with who took it and from where."}),e.jsx("p",{children:"Disabling an account signs that person out within 15 minutes and stops their calendar feed links. Their mail stays. You cannot disable your own account, so one account always stays on."}),e.jsx("p",{children:"A reset link works once, for 24 hours, and is shown only once. Making one stops the old password at once."}),e.jsxs("p",{children:["The person who runs this server can turn all sign-in off with"," ",e.jsx("code",{children:"remit sign-in off"}),", and recover an account from the host with"," ",e.jsx("code",{children:"remit people enable"})," or ",e.jsx("code",{children:"remit people reset"}),"."]})]});function we(){const s=K(),t=W(),r=$(),[n,o]=c.useState(!0);return e.jsx(J,{items:t,activeId:"people",title:"People",description:"Everyone with an account on this server.",help:ce,helpOpen:n,onToggleHelp:()=>o(a=>!a),onSelect:r,onBackToMail:()=>{s({to:"/mail"})},children:e.jsx(le,{})})}export{we as component};
@@ -1 +1 @@
1
- import{b as e}from"./index-BZ4sAts4.js";const a=e("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);export{a as P};
1
+ import{b as e}from"./index-NTsfKnzH.js";const a=e("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);export{a as P};
@@ -1 +1 @@
1
- import{b as y,r as f,n as E,c0 as P,j as a,p as b,B as R}from"./index-BZ4sAts4.js";const j=y("EllipsisVertical",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"12",cy:"5",r:"1",key:"gxeob9"}],["circle",{cx:"12",cy:"19",r:"1",key:"lyex9k"}]]),g=4,v=8;function k(e,t,n){const o=Math.max(v,window.innerWidth-t.width-v),r=n==="end"?e.right-t.width:e.left,s=Math.min(Math.max(r,v),o),c=e.bottom+g,i=e.top-g-t.height,d=c+t.height<=window.innerHeight-v||i<v?c:i;return{left:s,top:d}}function L(e,t,n,o){const[r,s]=f.useState(null),c=f.useRef(o);return c.current=o,f.useLayoutEffect(()=>{if(!t){s(null);return}const i=()=>{const x=e.current,h=c.current();if(!x||!h)return;const p=x.getBoundingClientRect(),w={width:p.right-p.left,height:p.bottom-p.top},m=k(h,w,n);s(l=>l?.left===m.left&&l.top===m.top?l:{position:"fixed",left:m.left,top:m.top})};i(),window.addEventListener("resize",i),window.addEventListener("scroll",i,!0);const u=e.current;let d=null;return u&&typeof ResizeObserver<"u"&&(d=new ResizeObserver(i),d.observe(u)),()=>{d?.disconnect(),window.removeEventListener("resize",i),window.removeEventListener("scroll",i,!0)}},[t,n,e]),r}function z(e,t){const[n,o]=f.useState(!1),r=f.useRef(null),s=f.useRef(null);return E({id:e,open:n,answers:{back:()=>{o(!1),t?.()}}}),f.useEffect(()=>{if(!n)return;const c=i=>{const u=i.target;r.current?.contains(u)||s.current?.contains(u)||o(!1)};return document.addEventListener("mousedown",c),()=>document.removeEventListener("mousedown",c)},[n]),{open:n,setOpen:o,containerRef:r,panelRef:s,getAnchor:()=>r.current?.getBoundingClientRect()??null}}function M({open:e,align:t="start",getAnchor:n,panelRef:o,children:r}){const s=L(o,e,t,n);return e?P.createPortal(a.jsx("div",{className:"z-50",style:s??{position:"fixed",visibility:"hidden"},children:r}),document.body):null}function N({label:e,children:t,className:n,ref:o,onKeyDown:r,"data-testid":s}){return a.jsx("div",{ref:o,role:"menu","aria-label":e,tabIndex:-1,onKeyDown:r,"data-testid":s,className:b("z-50 flex max-h-[60dvh] min-w-44 flex-col overflow-y-auto overscroll-contain rounded-md border border-line bg-surface py-1 shadow-lg outline-none",n),children:t})}function O({label:e,icon:t,onSelect:n,className:o,lang:r,"data-testid":s}){return a.jsxs("button",{type:"button",role:"menuitem",lang:r,onClick:n,"data-testid":s,className:b("flex min-h-11 items-center gap-3 px-4 py-2.5 text-left text-sm text-fg transition-colors hover:bg-surface-sunken",o),children:[t&&a.jsx("span",{className:"shrink-0 text-fg-subtle",children:t}),e]})}function A({triggerLabel:e,triggerIcon:t,triggerText:n,items:o,align:r="end",touch:s=!0,className:c,triggerClassName:i,nested:u=!1,children:d}){const{open:x,setOpen:h,containerRef:p,panelRef:w,getAnchor:m}=z("popover-menu");return o.length===0&&!d?null:a.jsxs("div",{ref:p,className:b("relative",c),...u?{role:"none"}:{},children:[a.jsx(R,{variant:"ghost",size:"sm",icon:t??a.jsx(j,{className:"size-5"}),onClick:()=>h(l=>!l),"aria-label":e,"aria-haspopup":"menu","aria-expanded":x,...u?{role:"menuitem"}:{},className:b(s&&"min-h-11 min-w-11 px-0",i),children:n}),a.jsx(M,{open:x,align:r,panelRef:w,getAnchor:m,children:a.jsxs(N,{ref:w,children:[o.map(l=>a.jsx(O,{label:l.label,icon:l.icon,onSelect:()=>{h(!1),l.onSelect()}},l.key)),d]})})]})}export{j as E,M as P,N as a,O as b,A as c,z as u};
1
+ import{b as y,r as f,n as E,c3 as P,j as a,p as b,B as R}from"./index-NTsfKnzH.js";const j=y("EllipsisVertical",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"12",cy:"5",r:"1",key:"gxeob9"}],["circle",{cx:"12",cy:"19",r:"1",key:"lyex9k"}]]),g=4,v=8;function k(e,t,n){const o=Math.max(v,window.innerWidth-t.width-v),r=n==="end"?e.right-t.width:e.left,s=Math.min(Math.max(r,v),o),c=e.bottom+g,i=e.top-g-t.height,d=c+t.height<=window.innerHeight-v||i<v?c:i;return{left:s,top:d}}function L(e,t,n,o){const[r,s]=f.useState(null),c=f.useRef(o);return c.current=o,f.useLayoutEffect(()=>{if(!t){s(null);return}const i=()=>{const x=e.current,h=c.current();if(!x||!h)return;const p=x.getBoundingClientRect(),w={width:p.right-p.left,height:p.bottom-p.top},m=k(h,w,n);s(l=>l?.left===m.left&&l.top===m.top?l:{position:"fixed",left:m.left,top:m.top})};i(),window.addEventListener("resize",i),window.addEventListener("scroll",i,!0);const u=e.current;let d=null;return u&&typeof ResizeObserver<"u"&&(d=new ResizeObserver(i),d.observe(u)),()=>{d?.disconnect(),window.removeEventListener("resize",i),window.removeEventListener("scroll",i,!0)}},[t,n,e]),r}function z(e,t){const[n,o]=f.useState(!1),r=f.useRef(null),s=f.useRef(null);return E({id:e,open:n,answers:{back:()=>{o(!1),t?.()}}}),f.useEffect(()=>{if(!n)return;const c=i=>{const u=i.target;r.current?.contains(u)||s.current?.contains(u)||o(!1)};return document.addEventListener("mousedown",c),()=>document.removeEventListener("mousedown",c)},[n]),{open:n,setOpen:o,containerRef:r,panelRef:s,getAnchor:()=>r.current?.getBoundingClientRect()??null}}function M({open:e,align:t="start",getAnchor:n,panelRef:o,children:r}){const s=L(o,e,t,n);return e?P.createPortal(a.jsx("div",{className:"z-50",style:s??{position:"fixed",visibility:"hidden"},children:r}),document.body):null}function N({label:e,children:t,className:n,ref:o,onKeyDown:r,"data-testid":s}){return a.jsx("div",{ref:o,role:"menu","aria-label":e,tabIndex:-1,onKeyDown:r,"data-testid":s,className:b("z-50 flex max-h-[60dvh] min-w-44 flex-col overflow-y-auto overscroll-contain rounded-md border border-line bg-surface py-1 shadow-lg outline-none",n),children:t})}function O({label:e,icon:t,onSelect:n,className:o,lang:r,"data-testid":s}){return a.jsxs("button",{type:"button",role:"menuitem",lang:r,onClick:n,"data-testid":s,className:b("flex min-h-11 items-center gap-3 px-4 py-2.5 text-left text-sm text-fg transition-colors hover:bg-surface-sunken",o),children:[t&&a.jsx("span",{className:"shrink-0 text-fg-subtle",children:t}),e]})}function A({triggerLabel:e,triggerIcon:t,triggerText:n,items:o,align:r="end",touch:s=!0,className:c,triggerClassName:i,nested:u=!1,children:d}){const{open:x,setOpen:h,containerRef:p,panelRef:w,getAnchor:m}=z("popover-menu");return o.length===0&&!d?null:a.jsxs("div",{ref:p,className:b("relative",c),...u?{role:"none"}:{},children:[a.jsx(R,{variant:"ghost",size:"sm",icon:t??a.jsx(j,{className:"size-5"}),onClick:()=>h(l=>!l),"aria-label":e,"aria-haspopup":"menu","aria-expanded":x,...u?{role:"menuitem"}:{},className:b(s&&"min-h-11 min-w-11 px-0",i),children:n}),a.jsx(M,{open:x,align:r,panelRef:w,getAnchor:m,children:a.jsxs(N,{ref:w,children:[o.map(l=>a.jsx(O,{label:l.label,icon:l.icon,onSelect:()=>{h(!1),l.onSelect()}},l.key)),d]})})]})}export{j as E,M as P,N as a,O as b,A as c,z as u};
@@ -1 +1 @@
1
- import{b as e}from"./index-BZ4sAts4.js";const t=e("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);export{t as R};
1
+ import{b as e}from"./index-NTsfKnzH.js";const t=e("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);export{t as R};
@@ -1 +1 @@
1
- import{H as L,c8 as T,c9 as w,G as u,r as i,u as d,cc as f,ca as O,ce as x}from"./index-BZ4sAts4.js";import{u as E,c as m}from"./nav-link-BvBkmH1H.js";function k(e){const s=L({warn:e?.router===void 0}),t=e?.router||s;return T(t.stores.__store,w(e,t))}const y="/mail/brief",$="/mail/$mailboxId",R="/mail/outbox",v="/mail/flagged";function B(e){for(const s of e){if(s.routeId===y)return{list:"brief"};if(s.routeId===v)return{list:"flagged"};if(s.routeId===R)return{list:"outbox"};if(s.routeId===$)return{list:"mailbox",mailboxId:s.params?.mailboxId}}}function X(e){const s=e.split(/[?#]/)[0].split("/").filter(Boolean);if(s[0]!=="mail")return"";const t=s[1];return t?t==="brief"?y:t==="flagged"?v:t==="outbox"?R:D(t):""}function Y(e){if(typeof e!="object"||e===null)return"";const{q:s}=e;return typeof s=="string"?s:""}function D(e){return`${$}:${e}`}function j(e,s){return e===s?!0:e.startsWith(`${s}/`)}function S(e){const s=e.split(/[?#]/)[0].split("/").filter(Boolean);return s[0]==="mail"&&s.length>2}function l(){const e=k({select:o=>B(o.matches)?.list}),t=u({from:"/mail/$mailboxId",shouldThrow:!1})?.mailboxId;return i.useMemo(()=>({list:e,mailboxId:t}),[e,t])}function K(){const{pathname:e}=E();return S(e)}function N(){const e=d(),s=m(),{list:t,mailboxId:o}=l();return i.useCallback(()=>{const r=n=>n,a=s;if(t==="flagged"){e({to:"/mail/flagged",search:r,hash:a});return}if(t==="outbox"){e({to:"/mail/outbox",search:r,hash:a});return}if(t==="mailbox"&&o){e({to:"/mail/$mailboxId",params:{mailboxId:o},search:r,hash:a});return}e({to:"/mail/brief",search:r,hash:a})},[e,s,t,o])}const A=["reply","reply-all","forward"],P=O(A),I="/mail/brief/$threadId/$messageId/$mode/{-$outboxMessageId}",g="/mail/flagged/$threadId/$messageId/$mode/{-$outboxMessageId}",b="/mail/$mailboxId/$threadId/$messageId/$mode/{-$outboxMessageId}";function _(){const e=u({from:I,shouldThrow:!1}),s=u({from:g,shouldThrow:!1}),t=u({from:b,shouldThrow:!1});return e??s??t}function C(){const e=f({from:I,shouldThrow:!1}),s=f({from:g,shouldThrow:!1}),t=f({from:b,shouldThrow:!1});return(e??s??t)?.body}const h=e=>s=>e===void 0?x(s):{...x(s),body:e.body};function p(){const e=_(),s=C();return i.useMemo(()=>{if(!e)return;const t=P.safeParse(e.mode);return t.success?{kind:"reply",mode:t.data,threadId:e.threadId,sourceMessageId:e.messageId,outboxMessageId:e.outboxMessageId,seed:s===void 0?void 0:{body:s}}:{kind:"unknown",segment:e.mode}},[e,s])}function V(){return p()?.kind==="reply"}function M(e,s,t,o){return e==="flagged"?{to:g,params:{...t,outboxMessageId:o}}:e==="mailbox"&&s?{to:b,params:{...t,mailboxId:s,outboxMessageId:o}}:{to:I,params:{...t,outboxMessageId:o}}}function G(e,s){if(e?.kind==="reply"&&e.threadId===s.threadId&&e.sourceMessageId===s.messageId)return e.outboxMessageId}function q(){const e=d(),s=m(),{list:t,mailboxId:o}=l(),r=p();return i.useCallback((a,n)=>{e({...M(t,o,a,n===void 0?G(r,a):void 0),search:h(n),hash:s})},[e,s,t,o,r])}function H(e,s,t){if(!(!s||!t))return o=>e({threadId:s,messageId:t,mode:o})}function Q(){const e=d(),{list:s,mailboxId:t}=l(),o=p();return i.useCallback(r=>{o?.kind==="reply"&&e({...M(s,t,{threadId:o.threadId,messageId:o.sourceMessageId,mode:o.mode},r),search:h(void 0),hash:!0,replace:!0})},[e,s,t,o])}function W(){const e=d(),s=m(),{list:t,mailboxId:o}=l(),r=_();return i.useCallback(()=>{if(!r)return;const a=h(void 0),n=s,c={threadId:r.threadId,messageId:r.messageId};if(t==="flagged"){e({to:"/mail/flagged/$threadId/$messageId",params:c,search:a,hash:n});return}if(t==="mailbox"&&o){e({to:"/mail/$mailboxId/$threadId/$messageId",params:{...c,mailboxId:o},search:a,hash:n});return}e({to:"/mail/brief/$threadId/$messageId",params:c,search:a,hash:n})},[e,s,t,o,r])}export{Y as a,K as b,B as c,V as d,l as e,N as f,q as g,Q as h,W as i,p as j,j as l,X as m,H as r,k as u};
1
+ import{H as L,cb as T,cc as w,G as u,r as i,u as d,cf as f,cd as O,ch as x}from"./index-NTsfKnzH.js";import{u as E,c as m}from"./nav-link-Bsus6xvs.js";function k(e){const s=L({warn:e?.router===void 0}),t=e?.router||s;return T(t.stores.__store,w(e,t))}const y="/mail/brief",$="/mail/$mailboxId",R="/mail/outbox",v="/mail/flagged";function B(e){for(const s of e){if(s.routeId===y)return{list:"brief"};if(s.routeId===v)return{list:"flagged"};if(s.routeId===R)return{list:"outbox"};if(s.routeId===$)return{list:"mailbox",mailboxId:s.params?.mailboxId}}}function X(e){const s=e.split(/[?#]/)[0].split("/").filter(Boolean);if(s[0]!=="mail")return"";const t=s[1];return t?t==="brief"?y:t==="flagged"?v:t==="outbox"?R:D(t):""}function Y(e){if(typeof e!="object"||e===null)return"";const{q:s}=e;return typeof s=="string"?s:""}function D(e){return`${$}:${e}`}function j(e,s){return e===s?!0:e.startsWith(`${s}/`)}function S(e){const s=e.split(/[?#]/)[0].split("/").filter(Boolean);return s[0]==="mail"&&s.length>2}function l(){const e=k({select:o=>B(o.matches)?.list}),t=u({from:"/mail/$mailboxId",shouldThrow:!1})?.mailboxId;return i.useMemo(()=>({list:e,mailboxId:t}),[e,t])}function K(){const{pathname:e}=E();return S(e)}function N(){const e=d(),s=m(),{list:t,mailboxId:o}=l();return i.useCallback(()=>{const r=n=>n,a=s;if(t==="flagged"){e({to:"/mail/flagged",search:r,hash:a});return}if(t==="outbox"){e({to:"/mail/outbox",search:r,hash:a});return}if(t==="mailbox"&&o){e({to:"/mail/$mailboxId",params:{mailboxId:o},search:r,hash:a});return}e({to:"/mail/brief",search:r,hash:a})},[e,s,t,o])}const A=["reply","reply-all","forward"],P=O(A),I="/mail/brief/$threadId/$messageId/$mode/{-$outboxMessageId}",g="/mail/flagged/$threadId/$messageId/$mode/{-$outboxMessageId}",b="/mail/$mailboxId/$threadId/$messageId/$mode/{-$outboxMessageId}";function _(){const e=u({from:I,shouldThrow:!1}),s=u({from:g,shouldThrow:!1}),t=u({from:b,shouldThrow:!1});return e??s??t}function C(){const e=f({from:I,shouldThrow:!1}),s=f({from:g,shouldThrow:!1}),t=f({from:b,shouldThrow:!1});return(e??s??t)?.body}const h=e=>s=>e===void 0?x(s):{...x(s),body:e.body};function p(){const e=_(),s=C();return i.useMemo(()=>{if(!e)return;const t=P.safeParse(e.mode);return t.success?{kind:"reply",mode:t.data,threadId:e.threadId,sourceMessageId:e.messageId,outboxMessageId:e.outboxMessageId,seed:s===void 0?void 0:{body:s}}:{kind:"unknown",segment:e.mode}},[e,s])}function V(){return p()?.kind==="reply"}function M(e,s,t,o){return e==="flagged"?{to:g,params:{...t,outboxMessageId:o}}:e==="mailbox"&&s?{to:b,params:{...t,mailboxId:s,outboxMessageId:o}}:{to:I,params:{...t,outboxMessageId:o}}}function G(e,s){if(e?.kind==="reply"&&e.threadId===s.threadId&&e.sourceMessageId===s.messageId)return e.outboxMessageId}function q(){const e=d(),s=m(),{list:t,mailboxId:o}=l(),r=p();return i.useCallback((a,n)=>{e({...M(t,o,a,n===void 0?G(r,a):void 0),search:h(n),hash:s})},[e,s,t,o,r])}function H(e,s,t){if(!(!s||!t))return o=>e({threadId:s,messageId:t,mode:o})}function Q(){const e=d(),{list:s,mailboxId:t}=l(),o=p();return i.useCallback(r=>{o?.kind==="reply"&&e({...M(s,t,{threadId:o.threadId,messageId:o.sourceMessageId,mode:o.mode},r),search:h(void 0),hash:!0,replace:!0})},[e,s,t,o])}function W(){const e=d(),s=m(),{list:t,mailboxId:o}=l(),r=_();return i.useCallback(()=>{if(!r)return;const a=h(void 0),n=s,c={threadId:r.threadId,messageId:r.messageId};if(t==="flagged"){e({to:"/mail/flagged/$threadId/$messageId",params:c,search:a,hash:n});return}if(t==="mailbox"&&o){e({to:"/mail/$mailboxId/$threadId/$messageId",params:{...c,mailboxId:o},search:a,hash:n});return}e({to:"/mail/brief/$threadId/$messageId",params:c,search:a,hash:n})},[e,s,t,o,r])}export{Y as a,K as b,B as c,V as d,l as e,N as f,q as g,Q as h,W as i,p as j,j as l,X as m,H as r,k as u};
@@ -1,4 +1,4 @@
1
- import{b as Vr,r as z,j as F,B as uf,p as ha,d as jp,c0 as vu,n as Rp,e$ as Pp,v as Lp,L as Ip}from"./index-BZ4sAts4.js";import{h as _l,f as Su,j as wu,k as Bp}from"./index-CrUfJlwk.js";import{b as Eu,l as go,c as Kp,e as Wp}from"./useSignature-CQZ_Ke3T.js";import{r as qp,u as Up}from"./roving-focus-1m_wY9_4.js";import{C as Hp}from"./confirm-dialog-B0MVMPmn.js";import{a as Jp,D as Vp}from"./useMediaQuery-D3m_n689.js";import{B as Yp}from"./bottom-sheet-C81CIc2R.js";import{P as Xp,a as Gp,b as Ps}from"./popover-menu-uIVgxYG_.js";import{U as Qp}from"./undo-2-IdsgUvVv.js";import{o as lv}from"./rich-text-spellcheck-provider-J8m9wz6A.js";import"./useMessageBodyContent-dd-lowbx.js";import"./reply-D8bLYzum.js";import"./nav-link-BvBkmH1H.js";import"./account-form-helpers-DhckT_PN.js";import"./useDebouncedValue-CMBraotV.js";import"./suggest-list-CUEgGZt_.js";import"./sections-B9pteMHc.js";import"./chevron-down-TeH9o9Q-.js";const Zp=Vr("Bold",[["path",{d:"M6 12h9a4 4 0 0 1 0 8H7a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1h7a4 4 0 0 1 0 8",key:"mg9rjx"}]]);const em=Vr("BookPlus",[["path",{d:"M12 7v6",key:"lw1j43"}],["path",{d:"M4 19.5v-15A2.5 2.5 0 0 1 6.5 2H19a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1H6.5a1 1 0 0 1 0-5H20",key:"k3hazp"}],["path",{d:"M9 10h6",key:"9gxzsh"}]]);const tm=Vr("Italic",[["line",{x1:"19",x2:"10",y1:"4",y2:"4",key:"15jd3p"}],["line",{x1:"14",x2:"5",y1:"20",y2:"20",key:"bu0au3"}],["line",{x1:"15",x2:"9",y1:"4",y2:"20",key:"uljnxc"}]]);const nm=Vr("Link",[["path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71",key:"1cjeqo"}],["path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71",key:"19qd67"}]]);const rm=Vr("Quote",[["path",{d:"M16 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z",key:"rib7q0"}],["path",{d:"M5 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z",key:"1ymkrd"}]]);const om=Vr("Redo2",[["path",{d:"m15 14 5-5-5-5",key:"12vg1m"}],["path",{d:"M20 9H9.5A5.5 5.5 0 0 0 4 14.5A5.5 5.5 0 0 0 9.5 20H13",key:"6uklza"}]]),UC={html:"",text:"",formatting:[]},im={account:"the account default",detected:"detected from what you wrote",manual:"chosen for this message"},sm=({language:n,languages:e,source:t,onSelect:r,helpText:o})=>{const[i,s]=z.useState(!1),a=z.useRef(null),l=z.useRef(null),u=z.useRef(null),c=z.useId(),d=z.useCallback(g=>{s(!1),g&&l.current?.focus()},[]);z.useEffect(()=>{if(!i)return;const g=m=>{a.current?.contains(m.target)||s(!1)};return document.addEventListener("mousedown",g),()=>document.removeEventListener("mousedown",g)},[i]),z.useEffect(()=>{if(!i)return;const g=u.current?.querySelector('[aria-checked="true"]'),m=u.current?.querySelector('[role="menuitemradio"]');(g??m)?.focus()},[i]);const f=g=>{if(g.key==="Escape"){g.preventDefault(),d(!0);return}const m=[...u.current?.querySelectorAll('[role="menuitemradio"]')??[]],p=m.indexOf(document.activeElement),y=qp(g.key,p,m.length);y!==null&&(g.preventDefault(),m[y]?.focus())},h=g=>{r(g),d(!0)};return F.jsxs("div",{ref:a,className:"relative",children:[F.jsx(uf,{ref:l,variant:"ghost",size:"md","aria-label":`Message language: ${go(n)}, ${im[t]}`,"aria-haspopup":"menu","aria-expanded":i,"aria-controls":i?c:void 0,onClick:()=>s(g=>!g),"data-testid":"compose-language-chip","data-language":n,"data-language-source":t,className:ha("min-h-11 min-w-11 shrink-0 px-2 font-medium",n!==e[0]&&"bg-accent-2-soft text-accent-2"),children:Eu(n)}),i&&F.jsxs("div",{ref:u,id:c,role:"menu","aria-label":"Message language",onKeyDown:f,"data-testid":"compose-language-menu",className:"absolute right-0 top-full z-50 mt-1 flex max-h-[60dvh] min-w-56 flex-col overflow-y-auto overscroll-contain rounded-md border border-line bg-surface py-1 shadow-lg",children:[e.map(g=>F.jsxs("button",{type:"button",role:"menuitemradio","aria-checked":g===n,lang:g,onClick:()=>h(g),className:ha("flex min-h-11 items-center justify-between gap-3 px-4 py-2.5 text-left text-sm text-fg transition-colors hover:bg-surface-sunken",g===n&&"bg-accent-2-soft"),children:[go(g),F.jsx("span",{className:"shrink-0 text-xs text-fg-subtle",children:Eu(g)})]},g)),F.jsx("p",{"data-testid":"compose-language-help",className:"border-t border-line px-4 pb-1 pt-2 text-xs text-fg-muted",children:o??Kp(navigator.userAgent)})]})]})},am=({mode:n,onToggle:e})=>F.jsx(uf,{variant:"ghost",size:"md","aria-pressed":n==="plain",title:"Plain text",onClick:e,"data-testid":"compose-mode-toggle",className:ha("min-h-11 shrink-0",n==="plain"&&"bg-accent-2-soft text-accent-2"),children:"Plain text"}),lm=new Set(["button","checkbox","color","file","hidden","image","radio","range","reset","submit"]),cf=n=>{const e=n.activeElement;return e?.shadowRoot?cf(e.shadowRoot)??e:e},um=n=>{const e=n.tagName.toUpperCase();if(e==="IFRAME"||e==="FRAME"||e==="TEXTAREA"||e==="SELECT")return!0;if(e==="INPUT"){const r=(n.getAttribute("type")??"text").toLowerCase();return!lm.has(r)}const t=n.getAttribute("contenteditable");return t!==null&&t.toLowerCase()!=="false"?!0:n.isContentEditable===!0},df=n=>{const e=n?.ownerDocument??globalThis.document;if(!e)return!1;const t=cf(e);return!t||t===n||n?.contains(t)?!1:um(t)};function $(n,...e){const t=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",n);for(const o of e)r.append("v",o);throw t.search=r.toString(),Error(`Minified Lexical error #${n}; visit ${t.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function ff(n,...e){const t=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",n);for(const o of e)r.append("v",o);t.search=r.toString(),console.warn(`Minified Lexical warning #${n}; visit ${t.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}const nt=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,cm=nt&&"documentMode"in document?document.documentMode:null,Ft=nt&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),Pt=nt&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent),zr=!(!nt||!("InputEvent"in window)||cm)&&"getTargetRanges"in new window.InputEvent("input"),Tn=nt&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,hf=nt&&/Android/.test(navigator.userAgent),Po=nt&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent)&&!hf,gf=nt&&/^(?=.*Chrome).*/i.test(navigator.userAgent),Di=nt&&hf&&gf,Lo=nt&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&Ft&&!gf,dm=0,fm=1,hm=2,ga=1,pa=2,ma=4,ya=8,gm=16,Ls=32,Is=64,bl=128,pm=1,mm=2,ym=3,_m=4,bm=5,km=6,Co=Po||Tn||Lo?" ":"​",Bn=`
1
+ import{b as Vr,r as z,j as F,B as uf,p as ha,d as jp,c3 as vu,n as Rp,f2 as Pp,v as Lp,L as Ip}from"./index-NTsfKnzH.js";import{h as _l,f as Su,j as wu,k as Bp}from"./index-BdVwGX5L.js";import{b as Eu,l as go,c as Kp,e as Wp}from"./useSignature-2RGHbdGD.js";import{r as qp,u as Up}from"./roving-focus-DGskqkqC.js";import{C as Hp}from"./confirm-dialog-B9uXBCde.js";import{a as Jp,D as Vp}from"./useMediaQuery-Dti_5Bdw.js";import{B as Yp}from"./bottom-sheet-CXqO5e8V.js";import{P as Xp,a as Gp,b as Ps}from"./popover-menu-BKr-RjB3.js";import{U as Qp}from"./undo-2-BHUHtOC6.js";import{o as lv}from"./rich-text-spellcheck-provider-J8m9wz6A.js";import"./useMessageBodyContent-zzHQirBA.js";import"./reply-CkAu_qmt.js";import"./nav-link-Bsus6xvs.js";import"./account-form-helpers-DhckT_PN.js";import"./useDebouncedValue-C_EHxcaO.js";import"./suggest-list-Bwwkhu1A.js";import"./sections-DbaGT3GX.js";import"./chevron-down-Dcb1svev.js";const Zp=Vr("Bold",[["path",{d:"M6 12h9a4 4 0 0 1 0 8H7a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1h7a4 4 0 0 1 0 8",key:"mg9rjx"}]]);const em=Vr("BookPlus",[["path",{d:"M12 7v6",key:"lw1j43"}],["path",{d:"M4 19.5v-15A2.5 2.5 0 0 1 6.5 2H19a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1H6.5a1 1 0 0 1 0-5H20",key:"k3hazp"}],["path",{d:"M9 10h6",key:"9gxzsh"}]]);const tm=Vr("Italic",[["line",{x1:"19",x2:"10",y1:"4",y2:"4",key:"15jd3p"}],["line",{x1:"14",x2:"5",y1:"20",y2:"20",key:"bu0au3"}],["line",{x1:"15",x2:"9",y1:"4",y2:"20",key:"uljnxc"}]]);const nm=Vr("Link",[["path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71",key:"1cjeqo"}],["path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71",key:"19qd67"}]]);const rm=Vr("Quote",[["path",{d:"M16 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z",key:"rib7q0"}],["path",{d:"M5 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z",key:"1ymkrd"}]]);const om=Vr("Redo2",[["path",{d:"m15 14 5-5-5-5",key:"12vg1m"}],["path",{d:"M20 9H9.5A5.5 5.5 0 0 0 4 14.5A5.5 5.5 0 0 0 9.5 20H13",key:"6uklza"}]]),UC={html:"",text:"",formatting:[]},im={account:"the account default",detected:"detected from what you wrote",manual:"chosen for this message"},sm=({language:n,languages:e,source:t,onSelect:r,helpText:o})=>{const[i,s]=z.useState(!1),a=z.useRef(null),l=z.useRef(null),u=z.useRef(null),c=z.useId(),d=z.useCallback(g=>{s(!1),g&&l.current?.focus()},[]);z.useEffect(()=>{if(!i)return;const g=m=>{a.current?.contains(m.target)||s(!1)};return document.addEventListener("mousedown",g),()=>document.removeEventListener("mousedown",g)},[i]),z.useEffect(()=>{if(!i)return;const g=u.current?.querySelector('[aria-checked="true"]'),m=u.current?.querySelector('[role="menuitemradio"]');(g??m)?.focus()},[i]);const f=g=>{if(g.key==="Escape"){g.preventDefault(),d(!0);return}const m=[...u.current?.querySelectorAll('[role="menuitemradio"]')??[]],p=m.indexOf(document.activeElement),y=qp(g.key,p,m.length);y!==null&&(g.preventDefault(),m[y]?.focus())},h=g=>{r(g),d(!0)};return F.jsxs("div",{ref:a,className:"relative",children:[F.jsx(uf,{ref:l,variant:"ghost",size:"md","aria-label":`Message language: ${go(n)}, ${im[t]}`,"aria-haspopup":"menu","aria-expanded":i,"aria-controls":i?c:void 0,onClick:()=>s(g=>!g),"data-testid":"compose-language-chip","data-language":n,"data-language-source":t,className:ha("min-h-11 min-w-11 shrink-0 px-2 font-medium",n!==e[0]&&"bg-accent-2-soft text-accent-2"),children:Eu(n)}),i&&F.jsxs("div",{ref:u,id:c,role:"menu","aria-label":"Message language",onKeyDown:f,"data-testid":"compose-language-menu",className:"absolute right-0 top-full z-50 mt-1 flex max-h-[60dvh] min-w-56 flex-col overflow-y-auto overscroll-contain rounded-md border border-line bg-surface py-1 shadow-lg",children:[e.map(g=>F.jsxs("button",{type:"button",role:"menuitemradio","aria-checked":g===n,lang:g,onClick:()=>h(g),className:ha("flex min-h-11 items-center justify-between gap-3 px-4 py-2.5 text-left text-sm text-fg transition-colors hover:bg-surface-sunken",g===n&&"bg-accent-2-soft"),children:[go(g),F.jsx("span",{className:"shrink-0 text-xs text-fg-subtle",children:Eu(g)})]},g)),F.jsx("p",{"data-testid":"compose-language-help",className:"border-t border-line px-4 pb-1 pt-2 text-xs text-fg-muted",children:o??Kp(navigator.userAgent)})]})]})},am=({mode:n,onToggle:e})=>F.jsx(uf,{variant:"ghost",size:"md","aria-pressed":n==="plain",title:"Plain text",onClick:e,"data-testid":"compose-mode-toggle",className:ha("min-h-11 shrink-0",n==="plain"&&"bg-accent-2-soft text-accent-2"),children:"Plain text"}),lm=new Set(["button","checkbox","color","file","hidden","image","radio","range","reset","submit"]),cf=n=>{const e=n.activeElement;return e?.shadowRoot?cf(e.shadowRoot)??e:e},um=n=>{const e=n.tagName.toUpperCase();if(e==="IFRAME"||e==="FRAME"||e==="TEXTAREA"||e==="SELECT")return!0;if(e==="INPUT"){const r=(n.getAttribute("type")??"text").toLowerCase();return!lm.has(r)}const t=n.getAttribute("contenteditable");return t!==null&&t.toLowerCase()!=="false"?!0:n.isContentEditable===!0},df=n=>{const e=n?.ownerDocument??globalThis.document;if(!e)return!1;const t=cf(e);return!t||t===n||n?.contains(t)?!1:um(t)};function $(n,...e){const t=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",n);for(const o of e)r.append("v",o);throw t.search=r.toString(),Error(`Minified Lexical error #${n}; visit ${t.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function ff(n,...e){const t=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",n);for(const o of e)r.append("v",o);t.search=r.toString(),console.warn(`Minified Lexical warning #${n}; visit ${t.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}const nt=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,cm=nt&&"documentMode"in document?document.documentMode:null,Ft=nt&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),Pt=nt&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent),zr=!(!nt||!("InputEvent"in window)||cm)&&"getTargetRanges"in new window.InputEvent("input"),Tn=nt&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,hf=nt&&/Android/.test(navigator.userAgent),Po=nt&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent)&&!hf,gf=nt&&/^(?=.*Chrome).*/i.test(navigator.userAgent),Di=nt&&hf&&gf,Lo=nt&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&Ft&&!gf,dm=0,fm=1,hm=2,ga=1,pa=2,ma=4,ya=8,gm=16,Ls=32,Is=64,bl=128,pm=1,mm=2,ym=3,_m=4,bm=5,km=6,Co=Po||Tn||Lo?" ":"​",Bn=`
2
2
 
3
3
  `,kl=Pt?" ":Co,hn={bold:1,capitalize:1024,code:16,highlight:bl,italic:2,lowercase:256,strikethrough:4,subscript:32,superscript:64,underline:8,uppercase:512},xm={directionless:1,unmergeable:2},$i={center:2,end:6,justify:4,left:1,right:3,start:5},Cm={[mm]:"center",[km]:"end",[_m]:"justify",[pm]:"left",[ym]:"right",[bm]:"start"},vm={normal:0,segmented:2,token:1},Sm={[dm]:"normal",[hm]:"segmented",[fm]:"token"},Tu="$config";function Nu(){return we()._blockCursorElement}function wm(n){return n!==null&&n.nodeType===1&&n.hasAttribute("data-lexical-slot")}let pf=class yi{element;before;after;constructor(e,t,r){this.element=e,this.before=t||null,this.after=r||null}withBefore(e){return new yi(this.element,e,this.after)}withAfter(e){return new yi(this.element,this.before,e)}withElement(e){return this.element===e?this:new yi(e,this.before,this.after)}insertChild(e){const t=this.getInsertionAnchor();return t!==null&&t.parentElement!==this.element&&$(357),this.element.insertBefore(e,t),this}removeChild(e){return e.parentElement!==this.element&&$(358),this.element.removeChild(e),this}replaceChild(e,t){return t.parentElement!==this.element&&$(359),this.element.replaceChild(e,t),this}getFirstChild(){const e=this.getFirstChildAnchor(),t=e?e.nextSibling:this.element.firstChild;return t===this.getInsertionAnchor()?null:t}getFirstChildAnchor(){return this.after}resolveLeafPosition(e,t,r){if(this.element===e)return t===e&&r===0?"before":"after";const o=Du(e,this.element);if(o===null)return"after";const i=Array.prototype.indexOf.call(e.childNodes,o);if(i<0)return"after";if(t===e)return r<=i?"before":"after";const s=Du(e,t);if(s===null)return"after";const a=Array.prototype.indexOf.call(e.childNodes,s);return a>=0&&a<=i?"before":"after"}getInsertionAnchor(){return this.before}};function Du(n,e){let t=e;for(;t!==null&&t.parentNode!==n;)t=t.parentNode;return t}let mf=class _i extends pf{withBefore(e){return new _i(this.element,e,this.after)}withAfter(e){return new _i(this.element,this.before,e)}withElement(e){return this.element===e?this:new _i(e,this.before,this.after)}getInsertionAnchor(){return super.getInsertionAnchor()||this.getManagedLineBreak()}getFirstChildAnchor(){let e=super.getFirstChildAnchor(),t=e?e.nextSibling:this.element.firstChild;for(;wm(t);)e=t,t=t.nextSibling;const r=e?e.nextSibling:this.element.firstChild;return r!==null&&r===Nu()?r:e}getManagedLineBreak(){return this.element.__lexicalLineBreak||null}setManagedLineBreak(e){if(this.element.__lexicalLastChildKind=e,e===null)this.removeManagedLineBreak();else{const t=e==="decorator"&&(Lo||Tn||Po);this.insertManagedLineBreak(t)}}removeManagedLineBreak(){const e=this.getManagedLineBreak();if(e){const t=this.element,r=e.nodeName==="IMG"?e.nextSibling:null;r&&t.removeChild(r),t.removeChild(e),t.__lexicalLineBreak=void 0}}insertManagedLineBreak(e){const t=this.getManagedLineBreak();if(t){if(e===(t.nodeName==="IMG"))return;this.removeManagedLineBreak()}const r=this.element,o=this.before,i=ae().createElement("br");if(i.setAttribute("data-lexical-managed-linebreak","true"),r.insertBefore(i,o),e){const s=ae().createElement("img");s.setAttribute("data-lexical-managed-linebreak","true"),s.style.setProperty("display","inline","important"),s.style.setProperty("border","0px","important"),s.style.setProperty("margin","0px","important"),s.alt="",r.insertBefore(s,i),r.__lexicalLineBreak=s}else r.__lexicalLineBreak=i}getFirstChildOffset(){const e=this.getFirstChild(),t=this.getInsertionAnchor();let r=0;for(let o=this.element.firstChild;o!==null&&o!==e&&o!==t;o=o.nextSibling)r++;return r}resolveChildIndex(e,t,r,o){if(r===this.element){const l=this.getFirstChildOffset(),u=Nu(),c=this.element.childNodes,d=Math.min(o,c.length);let f=0;for(let h=l;h<d;h++)c[h]!==u&&f++;return[e,Math.min(f,e.getChildrenSize())]}const i=$u(t,r);i.push(o);const s=$u(t,this.element);let a=e.getIndexWithinParent();for(let l=0;l<s.length;l++){const u=i[l],c=s[l];if(u===void 0||u<c)break;if(u>c){a+=1;break}}return[e.getParentOrThrow(),a]}};function $u(n,e){const t=[];let r=e;for(;r!==n&&r!==null;r=r.parentNode){let o=0;for(let i=r.previousSibling;i!==null;i=i.previousSibling)o++;t.push(o)}return r!==n&&$(225),t.reverse()}let yf;try{yf="0.49.0+prod.esm"}catch{}const _f=yf??'"<unknown>+source"';let to=class{_front=new Set;_back=new Set;_cache;get size(){return this._front.size+this._back.size}addBack(e){return delete this._cache,this._front.has(e)||this._back.add(e),this}addFront(e){return delete this._cache,this._back.has(e)||this._front.add(e),this}delete(e){return delete this._cache,this._front.delete(e)||this._back.delete(e)}toArray(){const e=Array.from(this._front).reverse();for(const t of this._back)e.push(t);return e}toReadonlyArray(){return this._cache=this._cache||this.toArray(),this._cache}[Symbol.iterator](){return this.toReadonlyArray()[Symbol.iterator]()}};const jn=null;function bf(n,e=1e3){return n instanceof _a?n.clone():n.size<e?new Map(n):new _a().init(new Map(n),void 0,n.size)}let _a=class kf{_mutable=!1;_old=void 0;_nursery=void 0;_size=0;clone(){return this._mutable=!1,new kf().init(this._old,this._nursery,this._size)}init(e,t,r){return this._old=e,this._nursery=t,this._size=r,this}get size(){return this._size}has(e){return this.get(e)!==void 0}getWithTombstone(e){const t=this._nursery&&this._nursery.get(e);return t!==void 0?t:this._old&&this._old.get(e)}get(e){const t=this.getWithTombstone(e);return t===jn?void 0:t}shouldCompact(){return this._nursery!==void 0&&2*this._nursery.size>this._size}getNursery(){return this._mutable&&this._nursery||(this.compact(),this._nursery=new Map(this._nursery),this._mutable=!0),this._nursery}compact(e=!1){if(this._nursery&&this._nursery.size>0&&(e||this.shouldCompact())){const t=new Map(this._old);for(const[r,o]of this._nursery)o!==jn?t.set(r,o):t.delete(r);this._old=t,this._nursery=void 0}return this._mutable=!1,this}set(e,t){const r=this.getWithTombstone(e);if(r===t)return this;const o=this.getNursery();return r!==jn&&r!==void 0||(this._size++,r===jn&&o.delete(e)),o.set(e,t),this}delete(e){const t=this.has(e);return t&&(this.getNursery().set(e,jn),this._size--),t}getOrInsert(e,t){const r=this.get(e);return r!==void 0?r:(this.set(e,t),t)}getOrInsertComputed(e,t){const r=this.get(e);if(r!==void 0)return r;const o=t(e);return this.set(e,o),o}clear(){this._mutable=!1,this._old=void 0,this._nursery=void 0,this._size=0}*keys(){for(const e of this.entries())yield e[0]}*values(){for(const e of this.entries())yield e[1]}*entries(){const e=this._nursery,t=this._old;if(t)for(const r of t){const o=r[0],i=e?e.get(o):void 0;i!==jn&&(i!==void 0&&(r[1]=i),yield r)}if(e)for(const r of e)r[1]===jn||t&&t.has(r[0])||(yield r)}forEach(e,t){t!==void 0&&(e=e.bind(t));for(const[r,o]of this.entries())e(o,r,this)}get[Symbol.toStringTag](){return"GenMap"}[Symbol.iterator](){return this.entries()}};function Ai(n,e,t,r,o,i){if(x(n)){let s=n.getFirstChild();for(;s!==null;){const a=s.__key;s.__parent===e&&((x(s)||dn(s)&&s.__slots!==null)&&Ai(s,a,t,r,o,i),t.has(a)||i.delete(a),o.push(a)),s=s.getNextSibling()}}for(const s of dn(n)&&n.__slots!==null?n.__slots.values():[]){const a=r.get(s);a!==void 0&&Gn(a)&&a.__slotHost===e&&((x(a)||dn(a)&&a.__slots!==null)&&Ai(a,s,t,r,o,i),t.has(s)||i.delete(s),o.push(s))}}let ba=!1,xl=0;function Em(n){xl=n.timeStamp}function Bs(n,e,t){const r=n.nodeName==="BR",o=e.__lexicalLineBreak;return o&&(n===o||r&&n.previousSibling===o)||r&&Gr(n,t)!==void 0}function Tm(n,e,t){const r=Pe(gt(t)),o=r&&ft(r,t._rootElement);let i=null,s=null;o!==null&&o.anchorNode===n&&(i=o.anchorOffset,s=o.focusOffset);const a=n.nodeValue;a!==null&&Kl(e,a,i,s,!1)}function Nm(n,e,t){if(N(n)){const r=n.anchor.getNode();if(r.is(t)&&n.format!==r.getFormat())return!1}return ht(e)&&t.isAttached()}function Dm(n,e,t){for(let r=n;r&&!Hh(r);r=sr(r)){const o=Gr(r,e);if(o!==void 0){const i=Z(o,t);if(i)return re(i)||!q(r)?void 0:[r,i]}}}function xf(n,e,t){ba=!0;const r=performance.now()-xl>100;try{wt(n,()=>{const o=O()||(function(d){return d.read("latest",()=>{const f=O();return f!==null?f.clone():null})})(n),i=new Map,s=n._editorState,a=n._blockCursorElement;let l=!1,u="";for(let d=0;d<e.length;d++){const f=e[d],h=f.type,g=f.target,m=Dm(g,n,s);if(!m)continue;const[p,y]=m;if(h==="characterData")r&&D(y)&&ht(g)&&Nm(o,g,y)&&Tm(g,y,n);else if(h==="childList"){l=!0;const _=f.addedNodes;for(let S=0;S<_.length;S++){const C=_[S],w=Ah(C),v=C.parentNode;if(!(v==null||C===a||w!==null||Bs(C,v,n)||n._slotsUsed&&q(C)&&C.hasAttribute("data-lexical-slot")||Hh(C))){if(Pt){const E=(q(C)?C.innerText:null)||C.nodeValue;E&&(u+=E)}v.removeChild(C)}}const b=f.removedNodes,k=b.length;if(k>0){let S=0;for(let C=0;C<k;C++){const w=b[C];(Bs(w,g,n)||a===w)&&(g.appendChild(w),S++)}k!==S&&i.set(p,y)}}}if(i.size>0)for(const[d,f]of i)f.reconcileObservedMutation(d,n);const c=t.takeRecords();if(c.length>0){for(let d=0;d<c.length;d++){const f=c[d],h=f.addedNodes,g=f.target;for(let m=0;m<h.length;m++){const p=h[m],y=p.parentNode;y==null||p.nodeName!=="BR"||Bs(p,g,n)||y.removeChild(p)}}t.takeRecords()}o!==null&&(l&&be(o),Pt&&Rh(n)&&o.insertRawText(u))})}finally{ba=!1}}function Cf(n){const e=n._observer;e!==null&&xf(n,e.takeRecords(),e)}function vf(n){(function(e){xl===0&&gt(e).addEventListener("textInput",Em,!0)})(n),n._observer=new MutationObserver((e,t)=>{xf(n,e,t)})}const Au="latest";let $m=class{key;parse;unparse;isEqual;defaultValue;resetOnCopyNode;constructor(e,t){this.key=e,this.parse=t.parse.bind(t),this.unparse=(t.unparse||zm).bind(t),this.isEqual=(t.isEqual||Object.is).bind(t),this.defaultValue=this.parse(void 0),this.resetOnCopyNode=t.resetOnCopyNode||!1}};function Io(n,e){return new $m(n,e)}function Bo(n,e,t=Au){const r=(t===Au?n.getLatest():n).__state;return r?r.getValue(e):e.defaultValue}function Sr(n,e,t){let r;if(Ie(),typeof t=="function"){const i=n.getLatest(),s=Bo(i,e);if(r=t(s),e.isEqual(s,r))return i}else r=t;const o=n.getWritable();return wf(o).updateFromKnown(e,r),o}function Am(n){const e=new Map,t=new Set;for(const{ownNodeConfig:r}of Vl(typeof n=="function"?n:n.replace))if(r&&r.stateConfigs)for(const o of r.stateConfigs){let i;"stateConfig"in o?(i=o.stateConfig,o.flat&&t.add(i.key)):i=o,e.set(i.key,i)}return{flatKeys:t,sharedConfigMap:e}}const Fu=new Set(["__proto__","constructor","prototype"]);let Fm=class Sf{node;knownState;unknownState;sharedNodeState;size;constructor(e,t,r=void 0,o=new Map,i=void 0){this.node=e,this.sharedNodeState=t,this.unknownState=r,this.knownState=o;const{sharedConfigMap:s}=this.sharedNodeState,a=i!==void 0?i:(function(l,u,c){let d=c.size;if(u)for(const f in u){const h=l.get(f);h&&c.has(h)||d++}return d})(s,r,o);this.size=a}getValue(e){const t=this.knownState.get(e);if(t!==void 0)return t;this.sharedNodeState.sharedConfigMap.set(e.key,e);let r=e.defaultValue;if(this.unknownState&&e.key in this.unknownState){const o=this.unknownState[e.key];o!==void 0&&(r=e.parse(o)),this.updateFromKnown(e,r)}return r}getInternalState(){return[this.unknownState,this.knownState]}toJSON(){const e={...this.unknownState},t={};for(const[r,o]of this.knownState)r.isEqual(o,r.defaultValue)?delete e[r.key]:e[r.key]=r.unparse(o);for(const r of this.sharedNodeState.flatKeys)r in e&&(t[r]=e[r],delete e[r]);return zu(e)&&(t.$=e),t}getWritable(e){if(this.node===e)return this;const{sharedNodeState:t,unknownState:r}=this,o=new Map(this.knownState);return new Sf(e,t,(function(i,s,a){let l;if(a)for(const[u,c]of Object.entries(a)){if(Fu.has(u))continue;const d=i.get(u);d?s.has(d)||s.set(d,d.parse(c)):(l=l||{},l[u]=c)}return l})(t.sharedConfigMap,o,r),o,this.size)}resetOnCopyNode(){for(const e of this.knownState.keys())e.resetOnCopyNode&&this.knownState.set(e,e.defaultValue);return this}updateFromKnown(e,t){const r=e.key;this.sharedNodeState.sharedConfigMap.set(r,e);const{knownState:o,unknownState:i}=this;o.has(e)||i&&r in i||(i&&(delete i[r],this.unknownState=zu(i)),this.size++),o.set(e,t)}updateFromUnknown(e,t){if(Fu.has(e))return;const r=this.sharedNodeState.sharedConfigMap.get(e);r?this.updateFromKnown(r,r.parse(t)):(this.unknownState=this.unknownState||{},e in this.unknownState||this.size++,this.unknownState[e]=t)}updateFromJSON(e){const{knownState:t}=this;for(const r of t.keys())t.set(r,r.defaultValue);if(this.size=t.size,this.unknownState=void 0,e)for(const[r,o]of Object.entries(e))this.updateFromUnknown(r,o)}};function wf(n){const e=n.getWritable(),t=e.__state?e.__state.getWritable(e):new Fm(e,Ef(e));return e.__state=t,t}function Ef(n){return n.__state?n.__state.sharedNodeState:Nh(we(),n.getType()).sharedNodeState}function zu(n){if(n)for(const e in n)return n}function zm(n){return n}function Ou(n,e,t){for(const[r,o]of e.knownState){if(n.has(r.key))continue;n.add(r.key);const i=t?t.getValue(r):r.defaultValue;if(i!==o&&!r.isEqual(i,o))return!0}return!1}function Mu(n,e,t){const{unknownState:r}=e,o=t?t.unknownState:void 0;if(r){for(const[i,s]of Object.entries(r))if(!n.has(i)&&(n.add(i),s!==(o?o[i]:void 0)))return!0}return!1}function ju(n,e){const t=n.__state;return t&&t.node===n?t.getWritable(e):t}function Ru(n,e){const t=n.__mode,r=n.__format,o=n.__style,i=e.__mode,s=e.__format,a=e.__style,l=n.__state,u=e.__state;return(t===null||t===i)&&(r===null||r===s)&&(o===null||o===a)&&(n.__state===null||l===u||(function(c,d){if(c===d)return!0;const f=new Set;return!(c&&Ou(f,c,d)||d&&Ou(f,d,c)||c&&Mu(f,c,d)||d&&Mu(f,d,c))})(l,u))}function Pu(n,e){const t=n.mergeWithSibling(e),r=pe()._normalizedNodes;return r.add(n.__key),r.add(e.__key),t}function Lu(n){let e,t,r=n;if(r.__text!==""||!r.isSimpleText()||r.isUnmergeable()){for(;(e=r.getPreviousSibling())!==null&&D(e)&&e.isSimpleText()&&!e.isUnmergeable();){if(e.__text!==""){if(Ru(e,r)){r=Pu(e,r);break}break}e.remove()}for(;(t=r.getNextSibling())!==null&&D(t)&&t.isSimpleText()&&!t.isUnmergeable();){if(t.__text!==""){if(Ru(r,t)){r=Pu(r,t);break}break}t.remove()}}else r.remove()}function Kt(n){return Iu(n.anchor),Iu(n.focus),n}function Iu(n){for(;n.type==="element";){const e=n.getNode(),t=n.offset;let r,o;if(t===e.getChildrenSize()?(r=e.getChildAtIndex(t-1),o=!0):(r=e.getChildAtIndex(t),o=!1),D(r)){n.set(r.__key,o?r.getTextContentSize():0,"text",!0);break}if(!x(r))break;n.set(r.__key,o?r.getChildrenSize():0,"element",!0)}}const vo=Symbol.for("@lexical/CachedTextSize");function Bu(n,e){return xa.read(()=>{let t=0,r=n;for(let o=0;o<e&&r!==null;o++){const i=zt.get(r);if(i===void 0&&$(345,r),x(i)){const s=De.get(r);if(s!==void 0&&x(s)&&s.__parent!==i.__parent)t+=i.getTextContentSize();else{const a=Hn.get(r),l=a&&a.__lexicalTextContent;typeof l!="string"&&$(346,i.getType()),t+=l.length}o<e-1&&!i.isInline()&&(t+=2)}else{const s=i[vo];s===void 0&&$(347,i.getType(),r),t+=s}r=i.__next}return t},{editor:de})}function Tf(n){x(n)||n[vo]===void 0&&(n[vo]=D(n)?n.__text.length:n.getTextContentSize())}const Om=4;let So,de,wo,ie="",ze=null,Qe=null,qe=null;function Wt(){return{firstTextKey:qe,format:ze,style:Qe}}function Ct(n){n.firstTextKey!==null&&(ze=n.format,Qe=n.style,qe=n.firstTextKey)}function ka(n){if(qe!==null)return;const e=n.__lexicalFirstTextKey;if(e===void 0&&$(348),e===null)return;const t=De.get(e);D(t)&&(ze=t.getFormat(),Qe=t.getStyle(),qe=e)}let ds,po,mo,zt,xa,De,Hn,Ca,Eo,Jn,ln=!1,Fi=!1;function Cn(n,e){const t=zt.get(n),r=De.has(n);if(e!==null){const o=Ta(n);o.parentNode===e&&e.removeChild(o)}if(!r){if(de._keyToDOMMap.delete(n),x(t)){const o=Gi(t,zt);va(o,0,o.length-1,null)}if(t!==void 0){for(const o of pt(t).values()){const i=wa(o);Cn(o,null),i!==null&&i.remove()}Wl(Eo,wo,ds,t,"destroyed")}}}function va(n,e,t,r){for(let o=e;o<=t;++o){const i=n[o];i!==void 0&&Cn(i,r)}}function Rn(n,e){n.setProperty("text-align",e)}const Mm="40px";function Nf(n,e){const t=So.theme.indent;if(typeof t=="string"){const r=n.classList.contains(t);e>0&&!r?n.classList.add(t):e<1&&r&&n.classList.remove(t)}n.style.setProperty("padding-inline-start",e===0?"":`calc(${e} * var(--lexical-indent-base-value, ${Mm}))`)}function Df(n,e){const t=n.style;e===0?Rn(t,""):e===1?Rn(t,"left"):e===2?Rn(t,"center"):e===3?Rn(t,"right"):e===4?Rn(t,"justify"):e===5?Rn(t,"start"):e===6&&Rn(t,"end")}function Sa(n,e){const t=(function(r){const o=r.__dir;if(o!==null)return o;if(Oe(r))return null;const i=r.getParent();return i===null||Se(i)&&i.__dir===null?"auto":null})(e);t!==null?n.dir=t:n.removeAttribute("dir")}function $f(n){const e=ae().createElement("div");return e.setAttribute("data-lexical-slot",n),e.style.display="none",e}function Af(n,e,t){e||n.contentEditable==="false"?qy(t,de):t.removeAttribute("contenteditable")}function Ku(n,e,t){const r=ie,o=Wt();ie="";let i="";const s=re(n);for(const[a,l]of t){const u=$f(a);Af(e,s,u),e.appendChild(u),ie="";const c=Wt();vn(l,Dt(n,u,de)),Ct(c),Ff(n,a,e,u),i+=ie}return Ct(o),ie=r,i}function pt(n){return dn(n)&&n.__slots!==null?n.__slots:Yh}function Ff(n,e,t,r){const o=Jn.$getSlotTargetElement(n,e,t,de);o!==null&&(r.parentElement!==o&&o.appendChild(r),r.style.display="")}function wa(n){const e=Hn.get(n);return e!==void 0?e.parentElement:null}function Wu(n,e,t){const r=pt(n),o=pt(e);for(const[c,d]of r)if(!o.has(c)){const f=wa(d);Cn(d,null),f!==null&&f.remove()}const i=ie,s=Wt();let a="",l=null;const u=re(e);for(const[c,d]of o){const f=r.get(c);let h=f!==void 0?wa(f):null;ie="";const g=Wt();if(h===null){h=$f(c);let m=null;for(const p of t.children)if(!p.hasAttribute("data-lexical-slot")){m=p;break}t.insertBefore(h,m),vn(d,Dt(e,h,de))}else f===d?an(d,h):(f!==void 0&&Cn(f,h),vn(d,Dt(e,h,de)));if(Ct(g),Af(t,u,h),Ff(e,c,t,h),a+=ie,h.parentElement===t){const m=l===null?t.firstChild:l.nextSibling;m!==h&&t.insertBefore(h,m),l=h}}return Ct(s),ie=i,a}function vn(n,e){const t=De.get(n);if(t===void 0&&$(60),e!==null){const o=zt.get(n);if(o!==void 0){const i=Hn.get(n);if(i!==void 0){const s=Gn(o)?o.__slotHost:null,a=Gn(t)?t.__slotHost:null,l=o.__parent!==t.__parent||s!==a,u=a!==null&&i.parentElement!==e.element;if(l||u)return e.insertChild(i),an(n,e.element)}}}const r=Jn.$createDOM(t,de);if((function(o,i,s){const a=s._keyToDOMMap;Fh(i,s,o),a.set(o,i)})(n,r,de),D(t)?r.setAttribute("data-lexical-text","true"):re(t)&&(r.setAttribute("data-lexical-decorator","true"),Yi(r,{captureSelection:!0})),x(t)){const o=t.__indent,i=t.__size;Sa(r,t),o!==0&&Nf(r,o);const s=pt(t),a=s.size>0?Ku(t,r,s):"";if(i===0)r.__lexicalTextContent=a,r.__lexicalFirstTextKey=null,ie+=a,s.size>0&&(r.__lexicalSlotTextLength=a.length);else{const u=ie,c=i-1;if(Ea(Gi(t,De),t,0,c,Dt(t,r,de)),a!==""){const d=r.__lexicalTextContent||"";r.__lexicalTextContent=a+d,ie=u+a+d}s.size>0&&(r.__lexicalSlotTextLength=a.length)}const l=t.__format;l!==0&&Df(r,l),t.isInline()||zf(null,t,r)}else{const o=t.getTextContent();if(re(t)){const i=t.decorate(de,So);i!==null&&Of(n,i),r.contentEditable="false";const s=pt(t);s.size>0&&Ku(t,r,s)}ie+=o}return e!==null&&e.insertChild(r),Jn.$decorateDOM(t,null,r,de),Tf(t),Wl(Eo,wo,ds,t,"created"),r}function Ea(n,e,t,r,o){const i=ie,s=Wt();ie="",ze=null,Qe=null,qe=null;let a=t;for(;a<=r;++a){const u=Wt();vn(n[a],o);const c=De.get(n[a]);c!==null&&D(c)?ze===null&&(ze=c.getFormat(),Qe=c.getStyle(),qe=c.__key):x(c)&&a<r&&!c.isInline()&&(ie+=Bn),Ct(u)}const l=de._keyToDOMMap.get(e.__key);l===void 0&&$(349,e.__key),l.__lexicalTextContent=ie,l.__lexicalFirstTextKey=qe,ie=i+ie,Ct(s)}function zf(n,e,t){const r=Dt(e,t,de),o=r.element.__lexicalLastChildKind??null,i=(function(s,a){if(s){const l=s.__last;if(l){const u=a.get(l);if(u)return We(u)?"line-break":re(u)&&u.isInline()?"decorator":null}return pt(s).size>0?null:"empty"}return null})(e,De);o!==i&&r.setManagedLineBreak(i)}function jm(n,e,t){var r;ze=null,Qe=null,qe=null,(function(o,i,s){const a=ie,l=o.__size,u=i.__size;ie="";const c=s.element,d=de._keyToDOMMap.get(i.__key);d===void 0&&$(351,i.__key);const f=u-l;if(!ln&&Math.abs(f)<=1&&l>=Om&&o.__first===i.__first&&(f!==0||!de._cloneNotNeeded.has(o.__key))){const h=d.__lexicalTextContent,g=Ca.get(o.__key);if(!ln&&typeof h=="string"&&g!==void 0){const m=(function(p,y){const _=y.size;if(_===0||_>=p.__size)return null;let b=p.__last,k=null,S=0;for(;b!==null&&S<_;){if(!y.has(b))return null;k=b;const C=De.get(b);if(C===void 0)return null;b=C.__prev,S++}return S!==_||b!==null&&y.has(b)?null:k})(i,g);if(m!==null){const p=g.size;if(f===0){const y=Bu(m,p);let _=m,b=0;for(;_!==null&&b<p;){const v=De.get(_);if(v===void 0)break;const E=Wt();an(_,c),D(v)&&ze===null&&(ze=v.getFormat(),Qe=v.getStyle(),qe=v.__key),Ct(E),_=v.__next,b++}let k="";for(_=m,b=0;_!==null&&b<p;){const v=De.get(_);if(v===void 0)break;let E;if(x(v)){const A=de._keyToDOMMap.get(_),T=A&&A.__lexicalTextContent;typeof T!="string"&&$(352,v.getType()),E=T}else E=v.getTextContent();k+=E,b<p-1&&x(v)&&!v.isInline()&&(k+=Bn),_=v.__next,b++}const S=d.__lexicalSlotTextLength||0,C=S>0?h.slice(S):h,w=C.slice(0,C.length-y)+k;return d.__lexicalTextContent=w,ie=a+w,void qu(i,d,g)}if((function(y,_,b,k,S,C,w,v){if(v!==1&&v!==-1||w!==(v===1?2:1))return!1;const A=w-v;let T=y.__last;for(let oe=0;oe<A-1;oe++){if(T===null)return!1;const $e=zt.get(T);if($e===void 0)return!1;T=$e.__prev}if(T===null)return!1;const j=De.get(C),M=zt.get(T);if(j===void 0||M===void 0||j.__prev!==M.__prev)return!1;const R=[];let I=C;for(let oe=0;oe<w;oe++){if(I===null)return!1;R.push(I);const $e=De.get(I);I=$e?$e.__next:null}const te=[];I=T;for(let oe=0;oe<A;oe++){if(I===null)return!1;te.push(I);const $e=zt.get(I);I=$e?$e.__next:null}const se=new Set(te),ne=new Set(R),B=[];let L=0,K=0;for(;L<A&&K<w;)if(R[K]===te[L])B.push({key:R[K],kind:"reconcile"}),L++,K++;else if(ne.has(te[L])){if(se.has(R[K]))return!1;B.push({key:R[K],kind:"create",nextIndex:K}),K++}else B.push({key:te[L],kind:"destroy"}),L++;for(;L<A;)B.push({key:te[L++],kind:"destroy"});for(;K<w;)B.push({key:R[K],kind:"create",nextIndex:K}),K++;const H=Bu(T,A);for(const oe of B){const $e=Wt();if(oe.kind==="reconcile")an(oe.key,b.element);else if(oe.kind==="destroy")Cn(oe.key,b.element);else{let it=null;for(let nn=oe.nextIndex+1;nn<w;nn++){const _n=de._keyToDOMMap.get(R[nn]);if(_n!==void 0){it=_n;break}}vn(oe.key,b.withBefore(it??b.before))}if(oe.kind!=="destroy"){const it=De.get(oe.key);it&&D(it)&&ze===null&&(ze=it.getFormat(),Qe=it.getStyle(),qe=it.__key)}Ct($e)}let Y="";for(let oe=0;oe<w;oe++){const $e=De.get(R[oe]);if($e===void 0)return!1;let it;if(x($e)){const nn=de._keyToDOMMap.get(R[oe]),_n=nn&&nn.__lexicalTextContent;typeof _n!="string"&&$(350,$e.getType()),it=_n}else it=$e.getTextContent();Y+=it,oe<w-1&&x($e)&&!$e.isInline()&&(Y+=Bn)}const he=k.__lexicalSlotTextLength||0,ot=he>0?S.slice(he):S;return k.__lexicalTextContent=ot.slice(0,ot.length-H)+Y,!0})(o,0,s,d,h,m,p,f)){const y=d.__lexicalTextContent;return typeof y!="string"&&$(353),ie=a+y,void qu(i,d,g)}}}if(f===0){let m=o.__first,p=0;for(;m!==null;){const y=De.get(m);if(y===void 0)break;const _=ln||mo.has(m)||po.has(m),b=Wt();if(_)an(m,c);else{let k,S;if(x(y)){S=Hn.get(m);const C=S&&S.__lexicalTextContent;typeof C!="string"&&$(354,y.getType()),k=C}else k=y.getTextContent();ie+=k,S!==void 0&&ka(S)}D(y)?ze===null&&(ze=y.getFormat(),Qe=y.getStyle(),qe=y.__key):x(y)&&p<u-1&&!y.isInline()&&(ie+=Bn),Ct(b),m=y.__next,p++}return d.__lexicalTextContent=ie,d.__lexicalFirstTextKey=qe,void(ie=a+ie)}}if(l===1&&u===1){const h=o.__first,g=i.__first;if(h===g)an(h,c);else{const p=Ta(h),y=vn(g,null);try{p.parentNode===c?c.replaceChild(y,p):s.insertChild(y)}catch(_){if(typeof _=="object"&&_!=null){const b=`${_.toString()} Parent: ${c.tagName}, new child: {tag: ${y.tagName} key: ${g}}, old child: {tag: ${p.tagName}, key: ${h}}.`;throw new Error(b)}throw _}Cn(h,null)}const m=De.get(g);D(m)&&ze===null&&(ze=m.getFormat(),Qe=m.getStyle(),qe=m.__key)}else{const h=Gi(o,zt),g=Gi(i,De);if(h.length!==l&&$(227),g.length!==u&&$(228),l===0)u!==0&&Ea(g,i,0,u-1,s);else if(u===0){if(l!==0){const m=s.after==null&&s.before==null&&pt(i).size===0&&s.element.__lexicalLineBreak==null;va(h,0,l-1,m?null:c),m&&(c.textContent="")}}else(function(m,p,y,_,b,k){const S=_-1,C=b-1;let w,v,E=k.getFirstChild(),A=0,T=0;for(;A<=S&&T<=C;){const R=p[A],I=y[T],te=Wt();if(R===I)E=Ks(an(I,k.element)),A++,T++;else{if(v===void 0&&(v=Uu(y,T)),w===void 0)w=Uu(p,A);else if(!w.has(R)){A++,Ct(te);continue}if(!v.has(R)){E=Ks(Ta(R)),Cn(R,k.element),A++,w.delete(R),Ct(te);continue}if(w.has(I)){const ne=Lr(de,I);ne!==E&&k.withBefore(E??k.before).insertChild(ne),E=Ks(an(I,k.element)),A++,T++}else vn(I,k.withBefore(E??k.before)),T++}const se=De.get(I);se!==null&&D(se)?ze===null&&(ze=se.getFormat(),Qe=se.getStyle(),qe=se.__key):x(se)&&T<=C&&!se.isInline()&&(ie+=Bn),Ct(te)}const j=A>S,M=T>C;if(j&&!M){const R=y[C+1],I=R===void 0?null:de.getElementByKey(R);Ea(y,m,T,C,k.withBefore(I??k.before))}else M&&!j&&va(p,A,S,k.element)})(i,h,g,l,u,s)}d.__lexicalTextContent=ie,d.__lexicalFirstTextKey=qe,ie=a+ie})(n,e,Dt(e,t,de)),Se(e)||(r=e,ze==null||ze===r.__textFormat||Fi||r.setTextFormat(ze),(function(o){Qe==null||Qe===o.__textStyle||Fi||o.setTextStyle(Qe)})(e))}function qu(n,e,t){const r=e.__lexicalFirstTextKey;if(r!=null){const o=n.__key;let i=r;for(;i!==null;){const s=De.get(i);if(s===void 0){i=null;break}if(s.__parent===o)break;i=s.__parent}if(i!==null&&!t.has(i)){const s=De.get(r);if(D(s))return ze=s.getFormat(),void(Qe=s.getStyle())}}e.__lexicalFirstTextKey=qe}function an(n,e){const t=zt.get(n);let r=De.get(n);t!==void 0&&r!==void 0||$(61);const o=ln||mo.has(n)||po.has(n),i=Lr(de,n);if(t===r&&!o){let s;if(x(t)){const a=i.__lexicalTextContent;typeof a!="string"&&$(355,t.getType()),s=a,ka(i)}else s=t.getTextContent();return ie+=s,i}if(t!==r&&o&&Wl(Eo,wo,ds,r,"updated"),Jn.$updateDOM(r,t,i,de)){const s=vn(n,null);return e===null&&$(62),e.replaceChild(s,i),Cn(n,null),s}if(x(t)){x(r)||$(334,n);const s=r.__indent;(ln||s!==t.__indent)&&Nf(i,s);const a=r.__format;(ln||a!==t.__format)&&Df(i,a);const l=o&&(pt(r).size>0||pt(t).size>0)?Wu(t,r,i):"";if(o){const u=ie;if(jm(t,r,i),Oe(r)||r.isInline()||zf(0,r,i),l!==""){const c=i.__lexicalTextContent||"";i.__lexicalTextContent=l+c,ie=u+l+c,i.__lexicalSlotTextLength=l.length}else(pt(r).size>0||pt(t).size>0)&&(i.__lexicalSlotTextLength=0)}else{const u=i.__lexicalTextContent;typeof u!="string"&&$(356,t.getType()),ie+=u,ka(i)}if((ln||r.__dir!==t.__dir||r.__parent!==t.__parent)&&(Sa(i,r),Oe(r)&&!ln))for(const u of r.getChildren())x(u)&&Sa(Lr(de,u.getKey()),u)}else{const s=r.getTextContent();if(re(r)){const a=r.decorate(de,So);a!==null&&Of(n,a),o&&(pt(r).size>0||pt(t).size>0)&&Wu(t,r,i)}ie+=s}if(!Fi&&Oe(r)){const s=r.getLatest();if(s.__cachedText!==ie){const a=s.getWritable();a.__cachedText=ie,r=a}}return Jn.$decorateDOM(r,t,i,de),Tf(r),i}function Of(n,e){let t=de._pendingDecorators;const r=de._decorators;if(t===null){if(r[n]===e)return;t=zh(de)}t[n]=e}function Ks(n){let e=n.nextSibling;return e!==null&&e===de._blockCursorElement&&(e=e.nextSibling),e}function Uu(n,e){const t=new Set;for(let r=e;r<n.length;r++)t.add(n[r]);return t}function Rm(n,e,t,r,o,i){ie="",ze=null,Qe=null,qe=null,ln=r===2,de=t,So=t._config,Jn=t._config.dom||qi,wo=t._nodes,ds=de._listeners.mutation,po=o,mo=i,zt=n._nodeMap,xa=n,De=e._nodeMap,Fi=e._readOnly,Hn=bf(t._keyToDOMMap),Ca=(function(){const a=new Map,l=u=>{for(const c of u){const d=De.get(c);if(d===void 0)continue;const f=d.__parent;if(f===null)continue;let h=a.get(f);h===void 0&&(h=new Set,a.set(f,h)),h.add(c)}};return l(po.keys()),l(mo),a})();const s=new Map;return Eo=s,an("root",null),de=void 0,wo=void 0,po=void 0,mo=void 0,zt=void 0,xa=void 0,De=void 0,So=void 0,Hn=void 0,Ca=void 0,Eo=void 0,Jn=qi,s}function Ta(n){const e=Hn.get(n);return e===void 0&&$(75,n),e}function W(n){return{type:n}}const qt=W("SELECTION_CHANGE_COMMAND"),Mf=W("SELECTION_INSERT_CLIPBOARD_NODES_COMMAND"),fs=W("CLICK_COMMAND"),jf=W("BEFORE_INPUT_COMMAND"),Rf=W("INPUT_COMMAND"),Pf=W("COMPOSITION_START_COMMAND"),Lf=W("COMPOSITION_END_COMMAND"),Sn=W("DELETE_CHARACTER_COMMAND"),wr=W("INSERT_LINE_BREAK_COMMAND"),Vn=W("INSERT_PARAGRAPH_COMMAND"),Wn=W("CONTROLLED_TEXT_INSERTION_COMMAND"),Yr=W("PASTE_COMMAND"),bi=W("REMOVE_TEXT_COMMAND"),Or=W("DELETE_WORD_COMMAND"),Mr=W("DELETE_LINE_COMMAND"),Ot=W("FORMAT_TEXT_COMMAND"),Pm=W("SET_TEXT_FORMAT_COMMAND"),hs=W("UNDO_COMMAND"),gs=W("REDO_COMMAND"),ps=W("KEYDOWN_COMMAND"),Cl=W("KEY_ARROW_RIGHT_COMMAND"),If=W("MOVE_TO_END"),vl=W("KEY_ARROW_LEFT_COMMAND"),Bf=W("MOVE_TO_START"),Sl=W("KEY_ARROW_UP_COMMAND"),wl=W("KEY_ARROW_DOWN_COMMAND"),zi=W("KEY_ENTER_COMMAND"),Kf=W("KEY_SPACE_COMMAND"),ms=W("KEY_BACKSPACE_COMMAND"),El=W("KEY_ESCAPE_COMMAND"),Tl=W("KEY_DELETE_COMMAND"),Nl=W("KEY_TAB_COMMAND"),Lm=W("INSERT_TAB_COMMAND"),Im=W("INDENT_CONTENT_COMMAND"),Hu=W("OUTDENT_CONTENT_COMMAND"),Wf=W("DROP_COMMAND"),qf=W("FORMAT_ELEMENT_COMMAND"),Uf=W("DRAGSTART_COMMAND"),Hf=W("DRAGOVER_COMMAND"),Bm=W("DRAGEND_COMMAND"),Ko=W("COPY_COMMAND"),ys=W("CUT_COMMAND"),Dl=W("SELECT_ALL_COMMAND"),Km=W("CLEAR_EDITOR_COMMAND"),Wm=W("CLEAR_HISTORY_COMMAND"),lo=W("CAN_REDO_COMMAND"),uo=W("CAN_UNDO_COMMAND"),Jf=W("FOCUS_COMMAND"),qm=W("BLUR_COMMAND"),Um=W("KEY_MODIFIER_COMMAND");function Hm(n){const e=new Map;return{dispose(){for(const t of e.values())t.dispose();e.clear()},register(t,r){let o=e.get(t);o===void 0&&(o={dispose:n(t,r),holders:new Set},e.set(t,o));const i=()=>{const s=e.get(t);s&&s.holders.delete(i)&&s.holders.size===0&&(e.delete(t),s.dispose())};return o.holders.add(i),i}}}function yo(n,e,t,r){return n.addEventListener(e,t,r),n.removeEventListener.bind(n,e,t,r)}const rn=Object.freeze({}),Na=[["keydown",function(n,e){const t=e._inputState;t.lastKeyDownTimeStamp=n.timeStamp,t.lastKeyCode=n.key,n.key!=="Backspace"&&To(t),!e.isComposing()&&P(e,ps,n)}],["pointerdown",function(n,e){const t=Xn(n),r=n.pointerType;Lt(t)&&r!=="touch"&&r!=="pen"&&n.button===0&&wt(e,()=>{Xi(t,e)||(e._inputState.isSelectionChangeFromMouseDown=!0)})}],["compositionstart",function(n,e){P(e,Pf,n)}],["compositionend",function(n,e){const t=e._inputState;Pt?t.compositionPhase="ending-firefox":Tn||!Po&&!Lo?P(e,Lf,n):(t.compositionPhase="ending-safari",t.compositionEndData=n.data)}],["input",function(n,e){n.stopPropagation();const t=e._inputState;To(t),wt(e,()=>{Gf(n,e)||e.dispatchCommand(Rf,n)},{event:n}),t.unprocessedBeforeInputData=null}],["click",function(n,e){wt(e,()=>{const t=O(),r=Pe(gt(e)),o=yt();if(r){if(N(t)){const i=t.anchor,s=i.getNode();i.type==="element"&&i.offset===0&&t.isCollapsed()&&!Oe(s)&&fe().getChildrenSize()===1&&s.getTopLevelElementOrThrow().isEmpty()&&o!==null&&t.is(o)&&(r.removeAllRanges(),t.dirty=!0)}else if(n.pointerType==="touch"||n.pointerType==="pen"){const i=ft(r,e._rootElement).anchorNode;(q(i)||ht(i))&&be(Do(o,r,e,n))}}if(Pt&&r!==null&&r.rangeCount===0){const i=e._rootElement;if(i!==null&&n.target===i){const s=n.clientY;let a=i.childNodes.length;for(let u=0;u<i.childNodes.length;u++){const c=i.childNodes[u];if(q(c)){const d=c.getBoundingClientRect();if(s<=(d.top+d.bottom)/2){a=u;break}}}r.setBaseAndExtent(i,a,i,a);const l=Do(o,r,e,n);l!==null?be(l):r.removeAllRanges()}}P(e,fs,n)})}],["cut",rn],["copy",rn],["dragstart",rn],["dragover",rn],["dragend",rn],["paste",rn],["focus",rn],["blur",rn],["drop",rn]];zr&&Na.push(["beforeinput",(n,e)=>(function(t,r){const o=t.inputType;o==="deleteCompositionText"||Pt&&Rh(r)||o!=="insertCompositionText"&&wt(r,()=>{Gf(t,r)||P(r,jf,t)},{event:t})})(n,e)]);const Da=new WeakMap,Oi=new WeakMap,Jm=Hm(n=>(n.addEventListener("selectionchange",Gu),()=>n.removeEventListener("selectionchange",Gu)));function Vf(n,e,t,r,o,i){const s=n.anchor,a=n.focus,l=s.getNode(),u=pe();let c;if(i!==void 0)c=i;else{const m=Pe(gt(u));c=m!==null?ft(m,u._rootElement):null}const d=c!==null?c.anchorNode:null,f=s.key,h=u.getElementByKey(f),g=t.length;return f!==a.key||!D(l)||(!o&&(!zr||u._inputState.lastBeforeInputInsertTextTimeStamp<r+50)||l.isDirty()&&g<2||Oh(t))&&s.offset!==a.offset&&!l.isComposing()||Et(l)||l.isDirty()&&g>1||(o||!zr)&&h!==null&&!l.isComposing()&&d!==En(l,h,u)||c!==null&&e!==null&&(!e.collapsed||e.startContainer!==c.anchorNode||e.startOffset!==c.anchorOffset)||!l.isComposing()&&(l.getFormat()!==n.format||l.getStyle()!==n.style)||(function(m,p){if(p.isSegmented())return!0;if(!m.isCollapsed())return!1;const y=m.anchor.offset,_=p.getParentOrThrow(),b=Ui(p);return y===0?!p.canInsertTextBefore()||!_.canInsertTextBefore()&&!p.isComposing()||b||(function(k){const S=k.getPreviousSibling();return(D(S)||x(S)&&S.isInline())&&!S.canInsertTextAfter()})(p):y===p.getTextContentSize()&&(!p.canInsertTextAfter()||!_.canInsertTextAfter()&&!p.isComposing()||b)})(n,l)}function Ju(n,e){return ht(n)&&n.nodeValue!==null&&e!==0&&e!==n.nodeValue.length}function Vu(n,e,t){const{anchorNode:r,anchorOffset:o,focusNode:i,focusOffset:s}=ft(n,e._rootElement),a=e._inputState;a.isSelectionChangeFromDOMUpdate&&(a.isSelectionChangeFromDOMUpdate=!1,Ju(r,o)&&Ju(i,s)&&!a.postDeleteSelectionToRestore)||wt(e,()=>{if(!t)return void be(null);if(!Ho(e,r,i))return;let l=O();if(a.postDeleteSelectionToRestore&&N(l)&&l.isCollapsed()){const u=l.anchor,c=a.postDeleteSelectionToRestore.anchor;(u.key===c.key&&u.offset===c.offset+1||u.offset===1&&c.getNode().is(u.getNode().getPreviousSibling()))&&(l=a.postDeleteSelectionToRestore.clone(),be(l))}if(a.postDeleteSelectionToRestore=null,N(l)){const u=l.anchor,c=u.getNode();if(l.isCollapsed()){n.type==="Range"&&r===i&&(l.dirty=!0);const d=gt(e).event,f=d?d.timeStamp:performance.now(),{format:h,style:g,offset:m,key:p,timeStamp:y}=a.collapsedSelectionFormat,_=fe(),b=e.isComposing()===!1&&_.getTextContent()==="";if(f<y+200&&u.offset===m&&u.key===p)ki(l,h,g);else if(u.type==="text")D(c)||$(141),Yf(l,c);else if(u.type==="element"&&!b){x(c)||$(259);const k=u.getNode();k.isEmpty()?(function(S,C){const w=C.getTextFormat(),v=C.getTextStyle();ki(S,w,v)})(l,k):ki(l,l.format,"")}}else{const d=u.key,f=l.focus.key,h=l.getNodes(),g=h.length,m=l.isBackward(),p=m?s:o,y=m?o:s,_=m?f:d,b=m?d:f;let k=2047,S=!1;for(let C=0;C<g;C++){const w=h[C],v=w.getTextContentSize();if(D(w)&&v!==0&&!(C===0&&w.__key===_&&p===v||C===g-1&&w.__key===b&&y===0)&&(S=!0,k&=w.getFormat(),k===0))break}l.format=S?k:0}}P(e,qt)})}function ki(n,e,t){n.format===e&&n.style===t||(n.format=e,n.style=t,n.dirty=!0)}function Yf(n,e){ki(n,e.getFormat(),e.getStyle())}function Xf(n){if(!n.getTargetRanges)return null;const e=n.getTargetRanges();return e.length===0?null:e[0]}function Yu(n){const{lastKeyCode:e}=pe()._inputState;if(n==null||n.length<=1||e==null)return;const t=e.length===1?e:e==="Enter"?`
4
4
  `:e==="Tab"?" ":null;if(!t)return;const r=O();if(!N(r)||!r.isCollapsed())return;const o=r.anchor.getNode();if(!D(o))return;const{offset:i}=r.anchor;if(o.getTextContentSize()===i){const s=o.getNextSibling();if(t===`
@@ -1 +1 @@
1
- import{f as r,s as o,g as a}from"./useSignature-CQZ_Ke3T.js";import{o as n}from"./rich-text-spellcheck-provider-J8m9wz6A.js";import"./index-BZ4sAts4.js";const l=t=>({post:e=>t.postMessage(e),listen:e=>t.addEventListener("message",s=>e(s.data)),fail:e=>t.addEventListener("error",s=>e(s.message)),terminate:()=>t.terminate()}),m=async t=>{const e=r(t);if(!e)return null;const s=new Worker(new URL("/assets/rich-text-spellcheck-worker-pWkhC-WR.js",import.meta.url),{type:"module"});return n(e,o(),l(s),a(e))};export{m as openSpellcheckWorker};
1
+ import{f as r,s as o,g as a}from"./useSignature-2RGHbdGD.js";import{o as n}from"./rich-text-spellcheck-provider-J8m9wz6A.js";import"./index-NTsfKnzH.js";const l=t=>({post:e=>t.postMessage(e),listen:e=>t.addEventListener("message",s=>e(s.data)),fail:e=>t.addEventListener("error",s=>e(s.message)),terminate:()=>t.terminate()}),m=async t=>{const e=r(t);if(!e)return null;const s=new Worker(new URL("/assets/rich-text-spellcheck-worker-pWkhC-WR.js",import.meta.url),{type:"module"});return n(e,o(),l(s),a(e))};export{m as openSpellcheckWorker};
@@ -1 +1 @@
1
- import{b as t}from"./index-BZ4sAts4.js";const e=t("RotateCcw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]);export{e as R};
1
+ import{b as t}from"./index-NTsfKnzH.js";const e=t("RotateCcw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]);export{e as R};
@@ -1 +1 @@
1
- import{r as d}from"./index-BZ4sAts4.js";const E={"data-list-row":""},v="[data-list-row]";function m(e,r,s,i="vertical"){if(s===0)return null;const n=i==="vertical"?"ArrowDown":"ArrowRight",c=i==="vertical"?"ArrowUp":"ArrowLeft";return e===n?r<0?0:Math.min(r+1,s-1):e===c?r<=0?0:r-1:e==="Home"?0:e==="End"?s-1:null}function l(e,r){return Array.from(e.querySelectorAll(r))}function y({containerRef:e,itemSelector:r,orientation:s="vertical",enabled:i=!0}){d.useEffect(()=>{if(!i)return;const n=e.current;if(!n)return;const c=()=>{const t=l(n,r);if(t.length===0)return;const f=t.find(o=>o===document.activeElement)??t[0];for(const o of t)o.tabIndex=o===f?0:-1},u=t=>{if(t.shiftKey||t.metaKey||t.ctrlKey||t.altKey)return;const a=l(n,r),f=a.indexOf(document.activeElement),o=m(t.key,f,a.length,s);o===null||o===f||(t.preventDefault(),t.stopPropagation(),a[o]?.focus())};return c(),n.addEventListener("focusin",c),n.addEventListener("keydown",u),()=>{n.removeEventListener("focusin",c),n.removeEventListener("keydown",u)}})}export{v as L,E as a,m as r,y as u};
1
+ import{r as d}from"./index-NTsfKnzH.js";const E={"data-list-row":""},v="[data-list-row]";function m(e,r,s,i="vertical"){if(s===0)return null;const n=i==="vertical"?"ArrowDown":"ArrowRight",c=i==="vertical"?"ArrowUp":"ArrowLeft";return e===n?r<0?0:Math.min(r+1,s-1):e===c?r<=0?0:r-1:e==="Home"?0:e==="End"?s-1:null}function l(e,r){return Array.from(e.querySelectorAll(r))}function y({containerRef:e,itemSelector:r,orientation:s="vertical",enabled:i=!0}){d.useEffect(()=>{if(!i)return;const n=e.current;if(!n)return;const c=()=>{const t=l(n,r);if(t.length===0)return;const f=t.find(o=>o===document.activeElement)??t[0];for(const o of t)o.tabIndex=o===f?0:-1},u=t=>{if(t.shiftKey||t.metaKey||t.ctrlKey||t.altKey)return;const a=l(n,r),f=a.indexOf(document.activeElement),o=m(t.key,f,a.length,s);o===null||o===f||(t.preventDefault(),t.stopPropagation(),a[o]?.focus())};return c(),n.addEventListener("focusin",c),n.addEventListener("keydown",u),()=>{n.removeEventListener("focusin",c),n.removeEventListener("keydown",u)}})}export{v as L,E as a,m as r,y as u};
@@ -1 +1 @@
1
- import{r as e,j as l,B as b,p as y,L as x}from"./index-BZ4sAts4.js";const i=()=>l.jsx(x,{className:"size-3.5 animate-spin"}),m=(s,n)=>n?l.jsx("span",{className:"sr-only",children:s}):s;function c({actions:s=[],destructive:n,className:o}){const[f,r]=e.useState(!1);return f&&n?.confirm?l.jsxs("div",{className:y("flex items-center gap-2",o),children:[l.jsx("span",{className:"text-xs text-fg-muted",children:n.confirm.prompt}),l.jsx(b,{variant:"secondary",size:"sm",onClick:()=>r(!1),children:n.confirm.cancelLabel??"Cancel"}),l.jsx(b,{variant:"danger",size:"sm","aria-busy":n.busy,icon:n.busy?i():void 0,onClick:()=>{n.busy||n.onClick()},children:n.busy?n.busyLabel??"Working…":n.confirm.confirmLabel??n.label})]}):l.jsxs("div",{className:y("flex items-center gap-2",o),children:[s.map(a=>l.jsx(b,{variant:a.variant??"ghost",size:"sm","aria-busy":a.busy,"aria-label":a.iconOnly?a.label:void 0,icon:a.busy?i():a.icon,onClick:()=>{a.busy||a.onClick()},children:a.busy&&a.busyLabel?a.busyLabel:m(a.label,a.iconOnly)},a.label)),n&&l.jsx(b,{variant:"ghost",size:"sm","aria-busy":n.busy,"aria-label":n.iconOnly?n.label:void 0,icon:n.busy?i():n.icon,onClick:()=>{if(!n.busy){if(n.confirm){r(!0);return}n.onClick()}},children:n.busy&&n.busyLabel?n.busyLabel:m(n.label,n.iconOnly)})]})}export{c as R};
1
+ import{r as e,j as l,B as b,p as y,L as x}from"./index-NTsfKnzH.js";const i=()=>l.jsx(x,{className:"size-3.5 animate-spin"}),m=(s,n)=>n?l.jsx("span",{className:"sr-only",children:s}):s;function c({actions:s=[],destructive:n,className:o}){const[f,r]=e.useState(!1);return f&&n?.confirm?l.jsxs("div",{className:y("flex items-center gap-2",o),children:[l.jsx("span",{className:"text-xs text-fg-muted",children:n.confirm.prompt}),l.jsx(b,{variant:"secondary",size:"sm",onClick:()=>r(!1),children:n.confirm.cancelLabel??"Cancel"}),l.jsx(b,{variant:"danger",size:"sm","aria-busy":n.busy,icon:n.busy?i():void 0,onClick:()=>{n.busy||n.onClick()},children:n.busy?n.busyLabel??"Working…":n.confirm.confirmLabel??n.label})]}):l.jsxs("div",{className:y("flex items-center gap-2",o),children:[s.map(a=>l.jsx(b,{variant:a.variant??"ghost",size:"sm","aria-busy":a.busy,"aria-label":a.iconOnly?a.label:void 0,icon:a.busy?i():a.icon,onClick:()=>{a.busy||a.onClick()},children:a.busy&&a.busyLabel?a.busyLabel:m(a.label,a.iconOnly)},a.label)),n&&l.jsx(b,{variant:"ghost",size:"sm","aria-busy":n.busy,"aria-label":n.iconOnly?n.label:void 0,icon:n.busy?i():n.icon,onClick:()=>{if(!n.busy){if(n.confirm){r(!0);return}n.onClick()}},children:n.busy&&n.busyLabel?n.busyLabel:m(n.label,n.iconOnly)})]})}export{c as R};
@@ -1 +1 @@
1
- import{u as v,J as x,r as I}from"./index-BZ4sAts4.js";import{u as p,a as g,d as Q}from"./reply-D8bLYzum.js";import{b}from"./MailShell-DIZSKkXP.js";import{a as q}from"./useMessageBodyContent-dd-lowbx.js";function A(a){const t=v(),{searchInput:c,searchQuery:e}=x(),i=p({select:o=>g(o.location.search)}),u=p({select:o=>o.location.pathname}),h=q(),f=Q(),m=h||f,{to:s}=a,r="params"in a?a.params.mailboxId:void 0,l=r?`/mail/${r}`:s;I.useEffect(()=>{if(!b({searchInput:c,committedQuery:e,urlQuery:i,pathname:u,listPath:l}))return;const y=!!e&&i!==e&&!m,n=d=>({...d,q:e||void 0});if(!y){t({to:".",search:n,hash:!0,replace:!0});return}if(s==="/mail/$mailboxId"){if(!r)return;t({to:s,params:{mailboxId:r},search:n,hash:!0,replace:!0});return}t({to:s,search:n,hash:!0,replace:!0})},[c,e,i,t,s,r,l,u,m])}export{A as u};
1
+ import{u as v,J as x,r as I}from"./index-NTsfKnzH.js";import{u as p,a as g,d as Q}from"./reply-CkAu_qmt.js";import{b}from"./MailShell-CaZXZkkc.js";import{a as q}from"./useMessageBodyContent-zzHQirBA.js";function A(a){const t=v(),{searchInput:c,searchQuery:e}=x(),i=p({select:o=>g(o.location.search)}),u=p({select:o=>o.location.pathname}),h=q(),f=Q(),m=h||f,{to:s}=a,r="params"in a?a.params.mailboxId:void 0,l=r?`/mail/${r}`:s;I.useEffect(()=>{if(!b({searchInput:c,committedQuery:e,urlQuery:i,pathname:u,listPath:l}))return;const y=!!e&&i!==e&&!m,n=d=>({...d,q:e||void 0});if(!y){t({to:".",search:n,hash:!0,replace:!0});return}if(s==="/mail/$mailboxId"){if(!r)return;t({to:s,params:{mailboxId:r},search:n,hash:!0,replace:!0});return}t({to:s,search:n,hash:!0,replace:!0})},[c,e,i,t,s,r,l,u,m])}export{A as u};