@remit/web-client-dist 0.0.656 → 0.0.658

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 (189) hide show
  1. package/assets/BriefPane-DTnPypWR.js +1 -0
  2. package/assets/CalendarComposePane-B5vgWbn2.js +1 -0
  3. package/assets/{CalendarComposeSeed-B6HxfV-P.js → CalendarComposeSeed-CvfYDo6K.js} +1 -1
  4. package/assets/{CalendarShell-D-5dI0jc.js → CalendarShell-CNCnuYI7.js} +1 -1
  5. package/assets/{EmptyState-Dw5-fMm4.js → EmptyState-DCvsovpV.js} +1 -1
  6. package/assets/{ErrorState-PNI7QSLU.js → ErrorState-BVvZa9Hj.js} +1 -1
  7. package/assets/{FlaggedPane-D0pQWXT9.js → FlaggedPane-CmOkn_je.js} +1 -1
  8. package/assets/{FullCompose-BACzjpTB.js → FullCompose-C-kYe1x_.js} +1 -1
  9. package/assets/MailListHeader-qqqmfyRg.js +1 -0
  10. package/assets/MailNav-UWoxDID1.js +1 -0
  11. package/assets/MailShell-D1RYjXBs.js +1 -0
  12. package/assets/{MailViewChrome-CP2oa-r7.js → MailViewChrome-CyrIkwO-.js} +1 -1
  13. package/assets/MailboxPane-sVCHNXDC.js +1 -0
  14. package/assets/{NavMenuButton-D17iXFBM.js → NavMenuButton-tjQzgXI6.js} +1 -1
  15. package/assets/{OnboardingWizard-BOAnucJW.js → OnboardingWizard-DC3VOl45.js} +1 -1
  16. package/assets/OpenCalendarEvent-DIV9Zaoz.js +2 -0
  17. package/assets/OutboxPane-DYMpq8YL.js +1 -0
  18. package/assets/SignInAgain-BroDYbz-.js +1 -0
  19. package/assets/_calendarObjectId-vj5yYITL.js +1 -0
  20. package/assets/_mailboxId-Cd2gcjfj.js +1 -0
  21. package/assets/_messageId-CKLpxaGL.js +1 -0
  22. package/assets/_messageId-otRrahEY.js +1 -0
  23. package/assets/_messageId-r661xgv7.js +1 -0
  24. package/assets/_outboxMessageId-DDWh3QXk.js +1 -0
  25. package/assets/_recurrenceId-Dmg0Y1yT.js +1 -0
  26. package/assets/_threadId-CatNqDrS.js +1 -0
  27. package/assets/_threadId-CtFGotoc.js +1 -0
  28. package/assets/_threadId-bIsty-QI.js +1 -0
  29. package/assets/_view._date-DWJzo3Lb.js +1 -0
  30. package/assets/accounts-BnWAstqJ.js +1 -0
  31. package/assets/advanced-CO3uos8-.js +1 -0
  32. package/assets/{appearance-CIBowvkx.js → appearance-l54q8jn2.js} +1 -1
  33. package/assets/{attendee-row-BRiEaasS.js → attendee-row-D2LMbq_7.js} +1 -1
  34. package/assets/{avatar-CCaAcetc.js → avatar-BEy9bmfT.js} +1 -1
  35. package/assets/{bell-off-CpcOtCIq.js → bell-off-o-5HqpFD.js} +1 -1
  36. package/assets/{bottom-sheet-BPiS9aBo.js → bottom-sheet-BQrIuUAp.js} +1 -1
  37. package/assets/{brief-C2k_YLnA.js → brief-BRyi3cpm.js} +1 -1
  38. package/assets/brief-CubStJH7.js +1 -0
  39. package/assets/{bug-C6xR86kp.js → bug-CiMAHRp3.js} +1 -1
  40. package/assets/calendar-CUTV9vSe.js +1 -0
  41. package/assets/{calendar-clash-strip-7S3XyUIT.js → calendar-clash-strip-BbznG7yo.js} +1 -1
  42. package/assets/{calendar-format-CDiJYM60.js → calendar-format-BZ1D5Ywu.js} +1 -1
  43. package/assets/{calendar-report-C-w9d_X_.js → calendar-report-1ttmpioo.js} +1 -1
  44. package/assets/{calendar-suggestion-BQoWPMtl.js → calendar-suggestion-DJ5uMZX8.js} +1 -1
  45. package/assets/{calendars-DHYpHK8C.js → calendars-Db5I-yCU.js} +1 -1
  46. package/assets/{card-Bqz6khhJ.js → card-BKgdv2bH.js} +1 -1
  47. package/assets/{checkbox-BwzvnbNT.js → checkbox-p9mLPjVs.js} +1 -1
  48. package/assets/chevron-left-iD9K0p2O.js +1 -0
  49. package/assets/{circle-check-DE9CwgTP.js → circle-check-6Bb3NNZS.js} +1 -1
  50. package/assets/{circle-check-big-kuolCFUC.js → circle-check-big-Cc1ertAI.js} +1 -1
  51. package/assets/{circle-help--jGrrMan.js → circle-help-C0X0r4BQ.js} +1 -1
  52. package/assets/{clock-CwmO_JCY.js → clock-BDHe3TX8.js} +1 -1
  53. package/assets/compose._-_outboxMessageId_-BAjHEoO7.js +1 -0
  54. package/assets/compose._-_outboxMessageId_-BjU_oGCR.js +1 -0
  55. package/assets/compose._-_outboxMessageId_-C-wPU4AM.js +1 -0
  56. package/assets/compose._-_outboxMessageId_-OEkiz68p.js +1 -0
  57. package/assets/{config-import-jGvPqLLa.js → config-import-DH8GC5mw.js} +1 -1
  58. package/assets/{confirm-dialog-WrJoQuYb.js → confirm-dialog-BmiOsB9N.js} +1 -1
  59. package/assets/{copy-BVqTKL-m.js → copy-B89b-33D.js} +1 -1
  60. package/assets/{credential-steps-BPNJm3Px.js → credential-steps-CKcZdVNd.js} +1 -1
  61. package/assets/{download-BoHBLdA7.js → download-53lT8mTP.js} +1 -1
  62. package/assets/external-link-NCezTZkT.js +1 -0
  63. package/assets/{file-json-CTXp7rcG.js → file-json-ofsJkIbX.js} +1 -1
  64. package/assets/filters-aur8iSET.js +1 -0
  65. package/assets/flagged-Cr5tlDf5.js +1 -0
  66. package/assets/{flagged-Cg2xxD0P.js → flagged-gRZxDkLX.js} +1 -1
  67. package/assets/folders-17G_KhLm.js +1 -0
  68. package/assets/{help-copy-BReMOm6I.js → help-copy-CADUhLzQ.js} +1 -1
  69. package/assets/{import-x6uYtBKs.js → import-CdvuJtNy.js} +1 -1
  70. package/assets/index-69yokqv5.js +1 -0
  71. package/assets/index-BDIVfNXM.js +293 -0
  72. package/assets/index-BFBfS7ek.js +1 -0
  73. package/assets/index-BRntGNJA.js +1 -0
  74. package/assets/{index-Cw3Kql7t.js → index-BngpvrPX.js} +1 -1
  75. package/assets/{index-BtYEmjxr.css → index-C2Hz4y-Q.css} +1 -1
  76. package/assets/index-Cg4p98vB.js +1 -0
  77. package/assets/{index-CyocVpgw.js → index-DDSpdJ8F.js} +8 -8
  78. package/assets/index-RmCPyEb8.js +1 -0
  79. package/assets/index-bYkeiMeC.js +1 -0
  80. package/assets/index-otRrahEY.js +1 -0
  81. package/assets/index-r661xgv7.js +1 -0
  82. package/assets/index-tN5HaTuq.js +1 -0
  83. package/assets/{kbd-Ccl_4UMN.js → kbd-BTTdW6-z.js} +1 -1
  84. package/assets/{labels-BbpPALNZ.js → labels-DoKExISZ.js} +1 -1
  85. package/assets/mail--BAAD5Tl.js +1 -0
  86. package/assets/{mail-BD9CFExB.js → mail-bV9GGVUQ.js} +1 -1
  87. package/assets/{map-pin-DM-UwFHl.js → map-pin-Bme-miZ2.js} +1 -1
  88. package/assets/{menu-Bk7fxS2w.js → menu-DQ-pJ4eT.js} +1 -1
  89. package/assets/minus-kSr1dVnA.js +1 -0
  90. package/assets/{new-mpTt3w7l.js → new-B4HXKzav.js} +1 -1
  91. package/assets/onboarding-Bsm3JVIj.js +1 -0
  92. package/assets/{onboarding-completion-Ckx99cv9.js → onboarding-completion-5Y5D9Jbr.js} +1 -1
  93. package/assets/outbox-BfHInRjp.js +1 -0
  94. package/assets/{pencil-C8Yuq6zp.js → pencil-D3GOCGCB.js} +1 -1
  95. package/assets/{popover-menu-CG5nGI0G.js → popover-menu-BRPef6re.js} +1 -1
  96. package/assets/{refresh-cw-DV6lCoUu.js → refresh-cw-BQa9I63p.js} +1 -1
  97. package/assets/result-count-C11MdZzg.js +1 -0
  98. package/assets/{rich-text-BFDSPN3k.js → rich-text-BxJPXURQ.js} +1 -1
  99. package/assets/{rich-text-spellcheck-worker-provider-eksJruIx.js → rich-text-spellcheck-worker-provider-BL2Dc5f1.js} +1 -1
  100. package/assets/{rotate-ccw-BWReSl7L.js → rotate-ccw-BzM31Pwc.js} +1 -1
  101. package/assets/{roving-focus-BgNxAjAj.js → roving-focus-DyhhSwbQ.js} +1 -1
  102. package/assets/{row-actions-BwuDucsx.js → row-actions-BtiK9OA9.js} +1 -1
  103. package/assets/{search-mirror-DSVQGDLi.js → search-mirror-CJ0qbKsO.js} +1 -1
  104. package/assets/search-query-hRPzdZsl.js +1 -0
  105. package/assets/search-scope-UI1H6AzA.js +1 -0
  106. package/assets/{search-token-index-BXtgewDi.js → search-token-index-C1Z6zA5N.js} +1 -1
  107. package/assets/{sections-45KeddjZ.js → sections-FEvJ4c2c.js} +1 -1
  108. package/assets/senders-DtHgpQ3C.js +1 -0
  109. package/assets/settings-DO0FWB3_.js +1 -0
  110. package/assets/{settings-screen-Bm-R0ESO.js → settings-screen-B51b9lvj.js} +1 -1
  111. package/assets/{shield-check-B_rWkRQY.js → shield-check-CgX3iFVl.js} +1 -1
  112. package/assets/suggested-vips-CZ7lFymc.js +1 -0
  113. package/assets/{suggestion._suggestionId-DHVADd-e.js → suggestion._suggestionId-YuPshPzz.js} +1 -1
  114. package/assets/{undo-2-UQEFkwhb.js → undo-2-DkaYLmdO.js} +1 -1
  115. package/assets/{useCalendarData-D27Ge-qS.js → useCalendarData-BQoK5111.js} +1 -1
  116. package/assets/useCalendarFreeBusy-d-s_-0eR.js +1 -0
  117. package/assets/{useCalendarWrites-OAZeHI6o.js → useCalendarWrites-xN5WbPCM.js} +1 -1
  118. package/assets/{useCalendars-O5ZvqPWu.js → useCalendars-CqOpDn21.js} +1 -1
  119. package/assets/{useDebouncedValue-BSAyBygv.js → useDebouncedValue-CTq8lKtR.js} +1 -1
  120. package/assets/useFilters-Oiv4LZCZ.js +1 -0
  121. package/assets/{useLabels-qT2MGxVA.js → useLabels-DLtLZsv9.js} +1 -1
  122. package/assets/useLayoutTier-94OSKAiu.js +1 -0
  123. package/assets/useMessageBodyContent-BTmHg9m0.js +1 -0
  124. package/assets/{useQueries-DH9StZ-W.js → useQueries-DFq_6laq.js} +1 -1
  125. package/assets/useRefreshControl-DzEBgWRZ.js +1 -0
  126. package/assets/{useResultFolderIndex-DYd3UAzD.js → useResultFolderIndex-DqH89sZ0.js} +1 -1
  127. package/assets/{useSearchTokenContext-CnVweHh1.js → useSearchTokenContext-BYEkwdSc.js} +3 -3
  128. package/assets/{useSignature-B8GSTQOi.js → useSignature-V-VSVmYl.js} +1 -1
  129. package/assets/warnings-rdkIsd04.js +5 -0
  130. package/index.html +2 -2
  131. package/package.json +1 -1
  132. package/assets/BriefPane-l0C6HwIU.js +0 -1
  133. package/assets/CalendarComposePane-C61ZEczL.js +0 -1
  134. package/assets/MailListHeader-Dp-YNlPj.js +0 -1
  135. package/assets/MailNav-C7sJoax-.js +0 -1
  136. package/assets/MailShell-DzKQC7Uj.js +0 -1
  137. package/assets/MailboxPane-DkOrdudP.js +0 -1
  138. package/assets/OpenCalendarEvent-CYS0fC96.js +0 -2
  139. package/assets/OutboxPane-DNsIelwN.js +0 -1
  140. package/assets/_calendarObjectId-BkE4AxkO.js +0 -1
  141. package/assets/_mailboxId-BrtMTF-6.js +0 -1
  142. package/assets/_messageId-96unnwX9.js +0 -1
  143. package/assets/_messageId-BsV3aJW4.js +0 -1
  144. package/assets/_messageId-Rm-pv9Lj.js +0 -1
  145. package/assets/_outboxMessageId-DZ9oEoGq.js +0 -1
  146. package/assets/_recurrenceId-lKshLGFv.js +0 -1
  147. package/assets/_threadId-Cn4_VbTC.js +0 -1
  148. package/assets/_threadId-CtlfYdJq.js +0 -1
  149. package/assets/_threadId-DQSQ3t5D.js +0 -1
  150. package/assets/_view._date-CxLoYpLy.js +0 -1
  151. package/assets/accounts-BOzP33IK.js +0 -1
  152. package/assets/advanced-DH74AtyY.js +0 -4
  153. package/assets/brief-CCQtHA98.js +0 -1
  154. package/assets/browser-ponyfill-DJ9g5dlz.js +0 -2
  155. package/assets/calendar-CGSjs-MW.js +0 -1
  156. package/assets/chevron-left-DV5pp97l.js +0 -1
  157. package/assets/compose._-_outboxMessageId_-80p_LIdF.js +0 -1
  158. package/assets/compose._-_outboxMessageId_-CGCC4WR7.js +0 -1
  159. package/assets/compose._-_outboxMessageId_-DAF6UnCQ.js +0 -1
  160. package/assets/compose._-_outboxMessageId_-PPnxrxD_.js +0 -1
  161. package/assets/filters-C2ETBIda.js +0 -1
  162. package/assets/flagged-CXk9IuTv.js +0 -1
  163. package/assets/folders-CZZ0A6LY.js +0 -1
  164. package/assets/index-8Jk9sv8H.js +0 -1
  165. package/assets/index-96unnwX9.js +0 -1
  166. package/assets/index-BsV3aJW4.js +0 -1
  167. package/assets/index-C3Ii4qBr.js +0 -1
  168. package/assets/index-CPfQZ4De.js +0 -1
  169. package/assets/index-CnGqfQe0.js +0 -1
  170. package/assets/index-Dtovse-L.js +0 -294
  171. package/assets/index-Fjp1XhHg.js +0 -1
  172. package/assets/index-VbZ_wTmr.js +0 -1
  173. package/assets/index-vGdOUxLx.js +0 -1
  174. package/assets/mail-kBNM6qac.js +0 -1
  175. package/assets/minus-BUHU6kmL.js +0 -1
  176. package/assets/onboarding-DanUIq9r.js +0 -1
  177. package/assets/outbox-DuDPZsm-.js +0 -1
  178. package/assets/pane-header-BTNHnxOW.js +0 -1
  179. package/assets/search-query-Cr_ZXBCp.js +0 -1
  180. package/assets/search-scope-B5-OK3Cq.js +0 -1
  181. package/assets/senders-C2MCK2u2.js +0 -1
  182. package/assets/settings-_XfaP7nx.js +0 -1
  183. package/assets/suggested-vips-DZJBdJAU.js +0 -1
  184. package/assets/useCalendarFreeBusy-BgHa55K-.js +0 -1
  185. package/assets/useFilters-R3V1TB7X.js +0 -1
  186. package/assets/useLayoutTier-BT9E1-ej.js +0 -1
  187. package/assets/useMessageBodyContent-DIF3dieb.js +0 -1
  188. package/assets/useRefreshControl-DfkVEG2l.js +0 -1
  189. package/assets/useSemanticSearch-BQ_df8hM.js +0 -1
@@ -1 +0,0 @@
1
- import{j as r,r as D,t as De,ao as Ve,f as se,Z as zs,X as Fe,ap as $s,aq as Bs,ar as gt,G as qs,H as Ws,as as te,h as Ze,at as Gs,c as os,d as ls,au as Ks,i as ye,av as Qs,o as we,l as yt,aw as Ys,ax as Zs,ay as Js,az as be,aA as Pt,L as nt,aB as Ct,aC as Xs,aD as Le,aE as je,aF as Vt,aG as ot,B as lt,aH as er,aI as tr,aJ as Dt,n as cs,ab as sr,aK as rr,aL as ir,aM as ds,aN as Ft,u as ar,aO as nr,aP as or,g as lr,aQ as Ot,aR as cr,a3 as dr,aS as ur}from"./index-Dtovse-L.js";import{A as ct,g as Rt,P as fr,O as mr}from"./OnboardingWizard-BOAnucJW.js";import{R as pr}from"./row-actions-BwuDucsx.js";import{S as hr,A as gr}from"./settings-screen-Bm-R0ESO.js";import{s as qe,b as us,R as fs,u as yr}from"./credential-steps-BPNJm3Px.js";import{u as xr}from"./useSignature-B8GSTQOi.js";import{c as vr,a as It,d as br}from"./account-form-helpers-DhckT_PN.js";import{C as Sr}from"./confirm-dialog-WrJoQuYb.js";import{f as Mt,E as jr}from"./ErrorState-PNI7QSLU.js";import{D as wr}from"./download-BoHBLdA7.js";import{a as Nr}from"./help-copy-BReMOm6I.js";import"./checkbox-BwzvnbNT.js";import"./minus-BUHU6kmL.js";import"./kbd-Ccl_4UMN.js";import"./mail-BD9CFExB.js";import"./file-json-CTXp7rcG.js";import"./avatar-CCaAcetc.js";import"./chevron-left-DV5pp97l.js";import"./menu-Bk7fxS2w.js";import"./circle-help--jGrrMan.js";import"./card-Bqz6khhJ.js";const Ar={Mail:"Mail already in Remit stays, and you can keep reading it.",Calendar:"Events already in Remit stay on your calendar."},Tr={Mail:"New mail stops arriving until you turn it back on.",Calendar:"Changes stop arriving until you turn it back on."},Er={Mail:"mail",Calendar:"calendar"};function kr(e,s){const t=Er[e.service];return e.kind==="enable"?{title:`Sign in with ${s} to add ${t}?`,description:`This account was never asked for ${t} access. Remit sends you to ${s} to ask for it, and brings you back here when you are done. Nothing changes until you get back.`,confirmLabel:`Continue to ${s}`,cancelLabel:"Cancel",destructive:!1}:e.kind==="last"?{title:`${e.service} is the only thing this account syncs`,description:`An account has to sync something. To stop this one entirely, remove the account — that deletes what Remit stored for it, which switching ${t} off never does.`,confirmLabel:"Remove account",cancelLabel:`Keep syncing ${t}`,destructive:!0}:{title:`Stop syncing ${t} for this account?`,description:`${Ar[e.service]} ${Tr[e.service]} Nothing is deleted.`,confirmLabel:`Stop syncing ${t}`,cancelLabel:"Cancel",destructive:!1}}function _r({change:e,providerName:s,onConfirm:t,onCancel:a,isBusy:n}){if(e===null)return null;const l=kr(e,s);return r.jsx(Sr,{isOpen:!0,title:l.title,description:l.description,confirmLabel:l.confirmLabel,cancelLabel:l.cancelLabel,destructive:l.destructive,isBusy:n??!1,onConfirm:t,onCancel:a})}function Pr({checked:e,label:s,describedBy:t,disabled:a,onToggle:n}){return r.jsx("button",{type:"button",role:"switch","aria-checked":e,"aria-label":s,"aria-describedby":t,disabled:a,onClick:n,className:De("relative inline-flex h-6 w-11 shrink-0 items-center rounded-full border transition-colors","outline-none disabled:cursor-not-allowed disabled:opacity-60 focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-surface",e?"border-positive bg-positive":"border-line-strong bg-surface-sunken"),children:r.jsx("span",{"aria-hidden":!0,className:De("size-4 rounded-full bg-canvas transition-transform",e?"translate-x-6":"translate-x-1")})})}function Cr({providerName:e,offered:s,enabled:t,consented:a,disabled:n=!1,onRequestChange:l}){const o=D.useId(),u=ct.filter(g=>s.includes(g.id));return u.length<2?null:r.jsxs("fieldset",{children:[r.jsx("legend",{className:"text-sm font-semibold text-fg",children:"What this account syncs"}),r.jsx("div",{className:"mt-1 divide-y divide-line",children:u.map(g=>{const j=t.includes(g.id),A=`${o}-${g.id}`,R=!j&&!a.includes(g.id);return r.jsxs("div",{className:"flex min-h-11 items-center gap-3 py-2 text-left",children:[r.jsxs("span",{className:"flex min-w-0 flex-1 flex-col",children:[r.jsx("span",{className:"text-sm text-fg",children:g.label}),r.jsx("span",{id:A,className:"text-xs text-fg-subtle",children:R?`${g.description} Turning this on means signing in with ${e} again.`:g.description})]}),r.jsx(Pr,{checked:j,label:`Sync ${g.label.toLowerCase()}`,describedBy:A,disabled:n,onToggle:()=>l(g.id,j?"off":"on")})]},g.id)})})]})}const Vr=e=>{const s=new Set(e.map($s));return Bs.map(t=>t.tag).filter(t=>!s.has(t)).sort((t,a)=>Ve(t).localeCompare(Ve(a)))},Dr=({value:e,onChange:s,busy:t=!1})=>{const a=Vr(e);return r.jsxs("div",{className:"space-y-2","data-testid":"compose-language-setting",children:[r.jsx("ul",{className:"space-y-1",children:e.map((n,l)=>r.jsxs("li",{"data-testid":`compose-language-row-${n}`,className:"flex items-center gap-2 rounded-md border border-line bg-surface-sunken px-3 py-1.5",children:[r.jsx("span",{className:"min-w-0 flex-1 truncate text-sm text-fg",lang:n,children:Ve(n)}),l===0?r.jsx("span",{className:"shrink-0 text-2xs uppercase tracking-wider text-fg-subtle",children:"Default"}):r.jsx(se,{variant:"ghost",size:"sm",icon:r.jsx(zs,{className:"size-3.5"}),disabled:t,"aria-label":`Write new messages in ${Ve(n)} by default`,onClick:()=>s([n,...e.filter(o=>o!==n)]),children:"Default"}),r.jsx(se,{variant:"ghost",size:"sm",icon:r.jsx(Fe,{className:"size-3.5"}),disabled:t||e.length===1,"aria-label":`Remove ${Ve(n)}`,onClick:()=>s(e.filter(o=>o!==n))})]},n))}),r.jsxs("select",{"aria-label":"Add a language",value:"",disabled:t||a.length===0,onChange:n=>{n.target.value!==""&&s([...e,n.target.value])},className:"w-full rounded-md border border-line bg-surface-sunken px-3 py-2 text-sm text-fg outline-none transition-colors focus-within:border-line-strong focus-within:ring-2 focus-within:ring-ring/30",children:[r.jsx("option",{value:"",children:"Add a language…"}),a.map(n=>r.jsx("option",{value:n,children:Ve(n)},n))]}),r.jsx("p",{className:"text-xs text-fg-muted",children:"A message is tagged with the language you write it in, picked from this list. Your browser, not this app, decides which dictionaries it spellchecks against — add the language there too to get its underlines."})]})};function Fr({title:e,description:s,action:t}){return r.jsxs("div",{className:"rounded-sm border border-danger/50",children:[r.jsxs("div",{className:"flex items-center gap-2 border-b border-danger/30 bg-danger-soft px-row-inset py-2",children:[r.jsx(gt,{className:"size-4 text-danger"}),r.jsx("h2",{className:"text-sm font-semibold text-danger",children:"Danger zone"})]}),r.jsxs("div",{className:"flex flex-col gap-3 px-row-inset py-3 sm:flex-row sm:items-center sm:justify-between sm:gap-4",children:[r.jsxs("div",{className:"min-w-0",children:[r.jsx("div",{className:"text-sm font-medium text-fg",children:e}),r.jsx("p",{className:"text-xs text-fg-muted",children:s})]}),r.jsx("div",{className:"shrink-0",children:t})]})]})}function Lt({isOpen:e,onClose:s,title:t,children:a,footer:n}){qs({id:"slide-panel",open:e,answers:{back:s}});const l=D.useRef(null);return Ws(l,e),r.jsxs(r.Fragment,{children:[r.jsx("div",{className:De("fixed inset-0 z-40 bg-black/30 transition-opacity",e?"opacity-100":"pointer-events-none opacity-0"),onClick:s,"aria-hidden":"true"}),r.jsxs("div",{ref:l,className:De("safe-area-frame fixed top-0 right-0 z-50 flex h-full w-full flex-col border-l border-line bg-canvas shadow-xl sm:w-[400px] sm:max-w-[90vw]","transform transition-transform duration-200 ease-out",e?"translate-x-0":"pointer-events-none translate-x-full"),role:"dialog","aria-modal":"true","aria-hidden":!e,inert:!e,"aria-labelledby":"slide-panel-title",tabIndex:-1,children:[r.jsxs("div",{className:"flex h-14 shrink-0 items-center justify-between border-b border-line px-4",children:[r.jsx("h2",{id:"slide-panel-title",className:"font-semibold",children:t}),r.jsx("button",{type:"button",onClick:s,className:"rounded-md p-1.5 transition-colors hover:bg-surface-raised","aria-label":"Close",children:r.jsx(Fe,{className:"size-5"})})]}),r.jsxs("div",{className:"flex min-h-0 flex-1 flex-col",children:[r.jsx("div",{className:"flex-1 overflow-auto p-4",children:a}),n&&r.jsx("div",{className:"flex justify-end gap-3 border-t border-line bg-canvas p-4",children:n})]})]})]})}var ze=e=>e.type==="checkbox",Ne=e=>e instanceof Date,Q=e=>e==null;const xt=e=>typeof e=="object";var $=e=>!Q(e)&&!Array.isArray(e)&&xt(e)&&!Ne(e),Or=e=>$(e)&&e.target?ze(e.target)?e.target.checked:e.target.value:e,Rr=(e,s)=>s.split(".").some((t,a,n)=>!isNaN(Number(t))&&e.has(n.slice(0,a).join("."))),ms=e=>{const s=e.constructor&&e.constructor.prototype;return $(s)&&s.hasOwnProperty("isPrototypeOf")},Je=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function B(e){if(e instanceof Date)return new Date(e);const s=typeof FileList<"u"&&e instanceof FileList;if(Je&&(e instanceof Blob||s))return e;const t=Array.isArray(e);if(!t&&!($(e)&&ms(e)))return e;const a=t?[]:Object.create(Object.getPrototypeOf(e));for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(a[n]=B(e[n]));return a}const Pe={BLUR:"blur",FOCUS_OUT:"focusout",SUBMIT:"submit",TRIGGER:"trigger",VALID:"valid"},ue={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},de={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},ps="root",vt=["__proto__","constructor","prototype"],Ir=/^\w*$/;var $e=e=>Ir.test(e),U=e=>e===void 0;const Mr=/[.[\]'"]/;var Xe=e=>e.split(Mr).filter(Boolean),v=(e,s,t)=>{if(!s||!$(e))return t;const a=$e(s)?[s]:Xe(s);if(a.some(l=>vt.includes(l)))return t;const n=a.reduce((l,o)=>Q(l)?void 0:l[o],e);return U(n)||n===e?U(e[s])?t:e[s]:n},he=e=>typeof e=="boolean",oe=e=>typeof e=="function",M=(e,s,t)=>{let a=-1;const n=$e(s)?[s]:Xe(s),l=n.length,o=l-1;for(;++a<l;){const u=n[a];let g=t;if(a!==o){const j=e[u];g=$(j)||Array.isArray(j)?j:isNaN(+n[a+1])?{}:[]}if(vt.includes(u))return;e[u]=g,e=e[u]}};const Lr=te.createContext(null);Lr.displayName="HookFormControlContext";var Ur=(e,s,t,a=!0)=>{const n={};for(const l in e)Object.defineProperty(n,l,{get:()=>{const o=l;return s._proxyFormState[o]!==ue.all&&(s._proxyFormState[o]=!a||ue.all),e[o]}});return n};const Hr=Je?te.useLayoutEffect:te.useEffect;var Y=e=>typeof e=="string",zr=(e,s,t,a,n)=>Y(e)?(a&&s.watch.add(e),v(t,e,n)):Array.isArray(e)?e.map(l=>(a&&s.watch.add(l),v(t,l))):(a&&(s.watchAll=!0),t),dt=e=>Q(e)||!xt(e);const Ut=(e,s)=>s.length===0&&!Array.isArray(e)&&!ms(e);function ge(e,s,t=new WeakMap){if(e===s)return!0;if(dt(e)||dt(s))return Object.is(e,s);if(Ne(e)&&Ne(s))return Object.is(e.getTime(),s.getTime());const a=Object.keys(e),n=Object.keys(s);if(a.length!==n.length)return!1;if(Ut(e,a)||Ut(s,n))return Object.is(e,s);if(!a.length&&Array.isArray(e)!==Array.isArray(s))return!1;const l=t.get(e);if(l&&l.has(s))return!0;if(l)l.add(s);else{const o=new WeakSet;o.add(s),t.set(e,o)}for(const o of a){const u=e[o];if(!(o in s))return!1;if(o!=="ref"){const g=s[o];if(Ne(u)&&Ne(g)||($(u)||Array.isArray(u))&&($(g)||Array.isArray(g))?!ge(u,g,t):!Object.is(u,g))return!1}}return!0}var We=e=>({isOnSubmit:!e||e===ue.onSubmit,isOnBlur:e===ue.onBlur,isOnChange:e===ue.onChange,isOnAll:e===ue.all,isOnTouch:e===ue.onTouched}),rt=(e,s,t)=>{if(t)return!1;if(s.watchAll||s.watch.has(e))return!0;for(const a of s.watch)if(e.startsWith(a)&&e.charAt(a.length)===".")return!0;return!1};const He=(e,s,t,a)=>{for(const n of t||Object.keys(e)){const l=v(e,n);if(l){const{_f:o,...u}=l;if(o){if(o.refs&&o.refs[0]&&s(o.refs[0],n)&&!a)return!0;if(o.ref&&s(o.ref,o.name)&&!a)return!0;if(He(u,s))break}else if($(u)&&He(u,s))break}}};var Ht=(e,s,t)=>{const a=v(e,t),n=Array.isArray(a)?a:[];return M(n,ps,s[t]),M(e,t,n),e},K=e=>$(e)&&!Object.keys(e).length,bt=e=>e.type==="file",Qe=e=>{if(!Je)return!1;const s=e?e.ownerDocument:0;return e instanceof(s&&s.defaultView?s.defaultView.HTMLElement:HTMLElement)},St=e=>e.type==="radio",Ye=e=>e instanceof RegExp,jt=(e,s,t,a,n)=>s?{...t[e],types:{...t[e]&&t[e].types?t[e].types:{},[a]:n||!0}}:{};const zt={value:!1,isValid:!1},$t={value:!0,isValid:!0};var hs=e=>{if(Array.isArray(e)){if(e.length>1){const s=e.filter(t=>t&&t.checked&&!t.disabled).map(t=>t.value);return{value:s,isValid:!!s.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!U(e[0].attributes.value)?U(e[0].value)||e[0].value===""?$t:{value:e[0].value,isValid:!0}:$t:zt}return zt};const Bt={isValid:!1,value:null};var gs=e=>Array.isArray(e)?e.reduce((s,t)=>t&&t.checked&&!t.disabled?{isValid:!0,value:t.value}:s,Bt):Bt;function qt(e,s,t="validate"){if(Y(e)||Array.isArray(e)&&e.every(Y)||he(e)&&!e)return{type:t,message:Y(e)?e:"",ref:s}}var Ce=e=>$(e)&&!Ye(e)?e:{value:e,message:""},Wt=async(e,s,t,a,n,l)=>{const{ref:o,refs:u,required:g,maxLength:j,minLength:A,min:R,max:I,pattern:L,validate:T,name:f,valueAsNumber:S,mount:ne}=e._f,E=v(t,f);if(!ne||s.has(f))return{};const _=u?u[0]:o,k=C=>{if(n&&_.reportValidity){const V=he(C)?"":C||"";u?u.forEach(F=>F.setCustomValidity(V)):_.setCustomValidity(V),_.reportValidity()}},P={},Z=St(o),z=ze(o),fe=Z||z,ae=(S||bt(o))&&U(o.value)&&U(E)||Qe(o)&&o.value===""||E===""||Array.isArray(E)&&!E.length,J=jt.bind(null,f,a,P),le=(C,V,F,W=de.maxLength,X=de.minLength)=>{const G=C?V:F;P[f]={type:C?W:X,message:G,ref:o,...J(C?W:X,G)}};if(l?!Array.isArray(E)||!E.length:g&&(!fe&&(ae||Q(E))||he(E)&&!E||z&&!hs(u).isValid||Z&&!gs(u).isValid)){const{value:C,message:V}=Y(g)?{value:!!g,message:g}:Ce(g);if(C&&(P[f]={type:de.required,message:V,ref:_,...J(de.required,V)},!a))return k(V),P}if(!ae&&(!Q(R)||!Q(I))){let C,V;const F=Ce(I),W=Ce(R);if(!Q(E)&&!isNaN(E)){const X=o.valueAsNumber||E&&+E;Q(F.value)||(C=X>F.value),Q(W.value)||(V=X<W.value)}else{const X=o.valueAsDate||new Date(E),G=re=>new Date(new Date().toDateString()+" "+re),me=o.type=="time",w=o.type=="week";Y(F.value)&&E&&(C=me?G(E)>G(F.value):w?E>F.value:X>new Date(F.value)),Y(W.value)&&E&&(V=me?G(E)<G(W.value):w?E<W.value:X<new Date(W.value))}if((C||V)&&(le(!!C,F.message,W.message,de.max,de.min),!a))return k(P[f].message),P}if((j||A)&&!ae&&(Y(E)||l&&Array.isArray(E))){const C=Ce(j),V=Ce(A),F=!Q(C.value)&&E.length>+C.value,W=!Q(V.value)&&E.length<+V.value;if((F||W)&&(le(F,C.message,V.message),!a))return k(P[f].message),P}if(L&&!ae&&Y(E)){const{value:C,message:V}=Ce(L);if(Ye(C)&&!E.match(C)&&(P[f]={type:de.pattern,message:V,ref:o,...J(de.pattern,V)},!a))return k(V),P}if(T){if(oe(T)){const C=await T(E,t),V=qt(C,_);if(V&&(P[f]={...V,...J(de.validate,V.message)},!a))return k(V.message),P}else if($(T)){let C={};for(const V in T){if(!K(C)&&!a)break;const F=qt(await T[V](E,t),_,V);F&&(C={...F,...J(V,F.message)},k(F.message),a&&(P[f]=C))}if(!K(C)&&(P[f]={ref:_,...C},!a))return P}}return k(!0),P},Ke=e=>Array.isArray(e)?e:[e],ys=e=>Array.isArray(e)?e.filter(Boolean):[];function $r(e,s){const t=s.slice(0,-1).length;let a=0;for(;a<t;){if(Q(e)){e=void 0;break}e=e[s[a]],a++}return e}function Br(e){for(const s in e)if(e.hasOwnProperty(s)&&!U(e[s]))return!1;return!0}function q(e,s){if(Y(s)&&Object.prototype.hasOwnProperty.call(e,s))return delete e[s],e;const t=Array.isArray(s)?s:$e(s)?[s]:Xe(s);if(t.some(o=>vt.includes(String(o))))return e;const a=t.length===1?e:$r(e,t),n=t.length-1,l=t[n];return a&&delete a[l],n!==0&&($(a)&&K(a)||Array.isArray(a)&&Br(a))&&q(e,t.slice(0,-1)),e}const xs=e=>{const s={};for(const t of Object.keys(e))if(xt(e[t])&&e[t]!==null&&!Ne(e[t])){const a=xs(e[t]);for(const n of Object.keys(a))s[`${t}.${n}`]=a[n]}else s[t]=e[t];return s},qr=te.createContext(null);qr.displayName="HookFormContext";var Gt=()=>{let e=[];return{get observers(){return e},next:n=>{for(const l of e)l.next&&l.next(n)},subscribe:n=>(e.push(n),{unsubscribe:()=>{e=e.filter(l=>l!==n)}}),unsubscribe:()=>{e=[]}}};function vs(e,s){const t={};for(const a in e)if(e.hasOwnProperty(a)){const n=e[a],l=s[a];if(n&&$(n)&&l){const o=vs(n,l);$(o)&&(t[a]=o)}else e[a]&&(t[a]=l)}return t}var bs=e=>e.type==="select-multiple",Wr=e=>St(e)||ze(e),it=e=>Qe(e)&&e.isConnected,Gr=e=>{for(const s in e)if(oe(e[s]))return!0;return!1};function Ss(e){return Array.isArray(e)||$(e)&&!Gr(e)}function js(e){return!!(e&&"_f"in e)}function ws(e){return Array.isArray(e)?!e.some(s=>!U(s)):!Object.keys(e).length}function ut(e,s){Array.isArray(e)?e[s]=void 0:delete e[s]}function ft(e,s={},t){for(const a in e){const n=e[a],l=t&&t[a];Ss(n)&&(!Array.isArray(n)||!js(l))?(s[a]=Array.isArray(n)?[]:{},ft(n,s[a],l),ws(s[a])&&ut(s,a)):U(n)||(s[a]=!0)}return s}function Ee(e,s,t,a){t||(t=ft(s,{},a));for(const n in e){const l=e[n],o=a&&a[n];Ss(l)&&(!Array.isArray(l)||!js(o))?(U(s)||dt(t[n])?t[n]=ft(l,Array.isArray(l)?[]:{},o):Ee(l,Q(s)?{}:s[n],t[n],o),ws(t[n])&&ut(t,n)):ge(l,s[n])?ut(t,n):t[n]=!0}return t}var Ns=(e,{valueAsNumber:s,valueAsDate:t,setValueAs:a})=>U(e)?e:s?e===""?NaN:e&&+e:t&&Y(e)?new Date(e):a?a(e):e;function Kt(e){const s=e.ref;return bt(s)?s.files:St(s)?gs(e.refs).value:bs(s)?[...s.selectedOptions].map(({value:t})=>t):ze(s)?hs(e.refs).value:Ns(U(s.value)?e.ref.value:s.value,e)}var Kr=(e,s,t,a)=>{const n={};for(const l of e){const o=v(s,l);o&&M(n,l,o._f)}return{criteriaMode:t,names:[...e],fields:n,shouldUseNativeValidation:a}},Ue=e=>U(e)?e:Ye(e)?e.source:$(e)?Ye(e.value)?e.value.source:e.value:e;const Qt="AsyncFunction";var Qr=e=>{if(!e||!e.validate)return!1;if(oe(e.validate))return e.validate.constructor.name===Qt;if($(e.validate)){for(const s in e.validate)if(e.validate[s].constructor.name===Qt)return!0}return!1},Yr=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate);function Yt(e,s,t){const a=v(e,t);if(a||$e(t))return{error:a,name:t};const n=t.split(".");for(;n.length;){const l=n.join("."),o=v(s,l),u=v(e,l);if(o&&!Array.isArray(o)&&t!==l)return{name:t};if(u&&u.type)return{name:l,error:u};if(u&&u.root&&u.root.type)return{name:`${l}.root`,error:u.root};n.pop()}return{name:t}}var Zr=(e,s,t,a)=>{t(e);const{name:n,...l}=e,o=Object.keys(l);return!o.length||a&&o.length>=Object.keys(s).length||o.find(u=>s[u]===(!a||ue.all))},Jr=(e,s,t)=>!e||!s||e===s||Ke(e).some(a=>a&&(t?a===s||a.startsWith(s+"."):a.startsWith(s)||s.startsWith(a))),Xr=(e,s,t,a,n)=>n.isOnAll?!1:!t&&n.isOnTouch?!(s||e):(t?a.isOnBlur:n.isOnBlur)?!e:(t?a.isOnChange:n.isOnChange)?e:!0,ei=(e,s)=>!ys(v(e,s)).length&&q(e,s);const ti={mode:ue.onSubmit,reValidateMode:ue.onChange,shouldFocusError:!0},at="form",As={submitCount:0,isDirty:!1,isReady:!1,isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{}};function si(e={}){let s={...ti,...e},t={...B(As),isLoading:oe(s.defaultValues),errors:s.errors||{},disabled:s.disabled||!1},a={},n=$(s.defaultValues)||$(s.values)?B(s.defaultValues||s.values)||{}:{},l=s.shouldUnregister?{}:B(n),o={action:!1,mount:!1,watch:!1,keepIsValid:!1},u={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set,registerName:new Set};const g={},j={};let A=0,R=We(s.mode),I=We(s.reValidateMode);const L={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},T={...L};let f={...T};const S={array:Gt(),state:Gt()};let ne=0;const E=s.criteriaMode===ue.all,_=(i,c)=>d=>{clearTimeout(j[i]),j[i]=setTimeout(c,d)},k=async i=>{if(!o.keepIsValid&&!s.disabled&&(T.isValid||f.isValid||i)){const c=++ne;let d;s.resolver?(d=K((await F()).errors),c===ne&&P()):d=await G({fields:a,onlyCheckValid:!0,eventType:Pe.VALID}),c===ne&&d!==t.isValid&&S.state.next({isValid:d})}},P=(i,c)=>{!s.disabled&&(T.isValidating||T.validatingFields||f.isValidating||f.validatingFields)&&((i||Array.from(u.mount)).forEach(d=>{d&&(c?M(t.validatingFields,d,c):q(t.validatingFields,d))}),S.state.next({validatingFields:t.validatingFields,isValidating:!K(t.validatingFields)}))},Z=()=>{t.dirtyFields=Ee(n,l,void 0,a)},z=(i,c=[],d,m,p=!0,x=!0)=>{if(m&&d&&!s.disabled){if(o.action=!0,x&&Array.isArray(v(a,i))){const y=d(v(a,i),m.argA,m.argB);p&&M(a,i,y)}if(x&&Array.isArray(v(t.errors,i))){const y=d(v(t.errors,i),m.argA,m.argB);p&&M(t.errors,i,y),ei(t.errors,i)}if((T.touchedFields||f.touchedFields)&&x&&Array.isArray(v(t.touchedFields,i))){const y=d(v(t.touchedFields,i),m.argA,m.argB);p&&M(t.touchedFields,i,y)}(T.dirtyFields||f.dirtyFields)&&Z(),S.state.next({name:i,isDirty:w(i,c),dirtyFields:t.dirtyFields,errors:t.errors,isValid:t.isValid})}else M(l,i,c)},fe=(i,c)=>{M(t.errors,i,c),t.errors={...t.errors},S.state.next({errors:t.errors})},ae=i=>{t.errors=i,S.state.next({errors:t.errors,isValid:!1})},J=i=>{const c=$e(i)?[i]:Xe(i);let d=l,m=n;for(let p=0;p<c.length-1;p++){const x=c[p];if(d=Q(d)?d:d[x],m=Q(m)?m:m[x],d===null&&m!==null)return!0}return!1},le=(i,c,d,m)=>{const p=v(a,i);if(p){if(J(i))return;const x=U(v(l,i)),y=v(l,i,U(d)?v(n,i):d);U(y)||m&&m.defaultChecked||c?M(l,i,c?y:Kt(p._f)):Se(i,y),o.mount&&!o.action&&(k(),x&&t.isDirty&&(T.isDirty||f.isDirty)&&(w()||(t.isDirty=!1,S.state.next({...t}))),e.shouldUnregister&&x&&!U(v(l,i))&&rt(i,u)&&(o.watch=!0))}},C=(i,c,d,m,p)=>{let x=!1,y=!1;const b={name:i};if(!s.disabled||m===!0){if(!d||m){const N=ge(v(n,i),c);(T.isDirty||f.isDirty)&&(y=t.isDirty,t.isDirty=b.isDirty=!N||w(),x=y!==b.isDirty),y=!!v(t.dirtyFields,i),N!==t.isDirty?t.dirtyFields=Ee(n,l,void 0,a):N?q(t.dirtyFields,i):M(t.dirtyFields,i,!0),b.dirtyFields=t.dirtyFields,x=x||(T.dirtyFields||f.dirtyFields)&&y!==!N}if(d){const N=v(t.touchedFields,i);N||(M(t.touchedFields,i,d),b.touchedFields=t.touchedFields,x=x||(T.touchedFields||f.touchedFields)&&N!==d)}x&&p&&S.state.next(b)}return x?b:{}},V=(i,c,d,m)=>{const p=v(t.errors,i),x=(T.isValid||f.isValid)&&he(c)&&t.isValid!==c;if(s.delayError&&d?(g[i]=_(i,()=>fe(i,d)),g[i](s.delayError)):(clearTimeout(j[i]),delete g[i],d?M(t.errors,i,d):q(t.errors,i),t.errors={...t.errors}),(d?!ge(p,d):p)||!K(m)||x){const y={...m,...x&&he(c)?{isValid:c}:{},errors:t.errors,name:i};t={...t,...y},S.state.next(y)}},F=async i=>(P(i,!0),await s.resolver(l,s.context,Kr(i||u.mount,a,s.criteriaMode,s.shouldUseNativeValidation))),W=async i=>{const{errors:c}=await F(i);if(P(i),i){for(const d of i){const m=v(c,d);m?u.array.has(d)&&$(m)&&!Object.keys(m).some(p=>!Number.isNaN(Number(p)))?Ht(t.errors,{[d]:m},d):M(t.errors,d,m):q(t.errors,d)}t.errors={...t.errors}}else t.errors=c;return c},X=async({name:i,eventType:c})=>{if(e.validate){const d=await e.validate({formValues:l,formState:t,name:i,eventType:c});if($(d))for(const m in d){const p=d[m];p&&Be(`${at}.${m}`,{message:Y(p.message)?p.message:"",type:p.type||de.validate})}else Y(d)||!d?Be(at,{message:d||"",type:de.validate}):_e(at);return d}return!0},G=async({fields:i,onlyCheckValid:c,name:d,eventType:m,context:p={valid:!0,runRootValidation:!1}})=>{if(e.validate&&(p.runRootValidation=!0,!await X({name:d,eventType:m})&&(p.valid=!1,c)))return p.valid;for(const x in i){const y=i[x];if(y){const{_f:b,...N}=y;if(b){const H=u.array.has(b.name),ee=y._f&&Qr(y._f),xe=T.validatingFields||T.isValidating||f.validatingFields||f.isValidating;ee&&xe&&P([b.name],!0);const ve=await Wt(y,u.disabled,l,E,s.shouldUseNativeValidation&&!c,H);if(ee&&xe&&P([b.name]),ve[b.name]&&(p.valid=!1,c)||(!c&&(v(ve,b.name)?H?Ht(t.errors,ve,b.name):M(t.errors,b.name,ve[b.name]):q(t.errors,b.name)),e.shouldUseNativeValidation&&ve[b.name]))break}!K(N)&&await G({context:p,onlyCheckValid:c,fields:N,name:x,eventType:m})}}return p.valid},me=()=>{for(const i of u.unMount){const c=v(a,i);c&&(c._f.refs?c._f.refs.every(d=>!it(d)):!it(c._f.ref))&&et(i)}u.unMount=new Set},w=(i,c)=>(i&&c&&M(l,i,c),!ge(o.mount?l:n,n)),re=(i,c,d)=>zr(i,u,{...o.mount?l:U(c)?n:Y(i)?{[i]:c}:c},d,c),Ae=i=>ys(v(o.mount?l:n,i,s.shouldUnregister?v(n,i,[]):[])),Se=(i,c,d={},m=!1,p=!1)=>{const x=v(a,i);let y=c;if(x){const b=x._f;b&&(!b.disabled&&M(l,i,Ns(c,b)),y=Qe(b.ref)&&Q(c)?"":c,bs(b.ref)?[...b.ref.options].forEach(N=>N.selected=y.includes(N.value)):b.refs?ze(b.ref)?b.refs.forEach(N=>{(!N.defaultChecked||!N.disabled)&&(Array.isArray(y)?N.checked=!!y.find(H=>H===N.value):N.checked=y===N.value||!!y)}):b.refs.forEach(N=>N.checked=N.value===y):bt(b.ref)?b.ref.value="":(b.ref.value=y,!b.ref.type&&!p&&S.state.next({name:i,values:m?l:B(l)})))}(d.shouldDirty||d.shouldTouch)&&C(i,y,d.shouldTouch,d.shouldDirty,!p),d.shouldValidate&&pe(i,{delayError:d.delayError})},ke=(i,c,d,m=!1,p=!1)=>{for(const x in c){if(!c.hasOwnProperty(x))return;const y=c[x],b=i+"."+x,N=v(a,b);(u.array.has(i)||$(y)||N&&!N._f)&&!Ne(y)?ke(b,y,d,m,p):Se(b,y,d,m,p)}},Oe=(i,c,d,m,p=!1)=>{const x=v(a,i),y=u.array.has(i),b=m?c:B(c),N=v(l,i),H=ge(N,b);if(H||M(l,i,b),y)S.array.next({name:i,values:m?l:B(l)}),(T.isDirty||T.dirtyFields||f.isDirty||f.dirtyFields)&&d.shouldDirty&&(Z(),p||S.state.next({name:i,dirtyFields:t.dirtyFields,isDirty:w(i,b)}));else{const ee=Array.isArray(b)&&!b.length||K(b);!x||x._f||Q(b)||ee?Se(i,b,d,m,p):ke(i,b,d,m,p)}if(!H&&!p){const ee=rt(i,u),xe=m?l:B(l);S.state.next({...ee&&t,name:o.mount||ee?i:void 0,values:xe})}},h=(i,c,d={})=>Oe(i,c,d,!1),O=(i,c={})=>{const d=oe(i)?i(l):i;if(!ge(l,d)){l={...l,...d};const m=xs(d);for(const p of u.mount)p in m&&Oe(p,m[p],c,!0,!0);S.state.next({...t,name:void 0,type:void 0,...A?{values:l}:{}}),c.shouldValidate&&k()}},ce=async i=>{o.mount=!0;const c=i.target;let d=c.name,m=!0;const p=v(a,d),x=y=>{m=Number.isNaN(y)||Ne(y)&&isNaN(y.getTime())||ge(y,v(l,d,y))};if(p){let y,b;const N=c.type?Kt(p._f):Or(i),H=i.type===Pe.BLUR||i.type===Pe.FOCUS_OUT,ee=!Yr(p._f)&&!e.validate&&!s.resolver&&!v(t.errors,d)&&!p._f.deps,xe=ee||Xr(H,v(t.touchedFields,d),t.isSubmitted,I,R),ve=rt(d,u,H);if(M(l,d,N),H){if(!c||!c.readOnly){p._f.onBlur&&p._f.onBlur(i);const Me=g[d];Me&&Me(0)}}else p._f.onChange&&p._f.onChange(i);const Ie=C(d,N,H),Us=!K(Ie)||ve;if(!H&&S.state.next({name:d,type:i.type,...A?{values:B(l)}:{}}),xe)return(!ee||!t.isValid)&&(T.isValid||f.isValid)&&(s.mode==="onBlur"?H&&k():H||k()),Us&&S.state.next({name:d,...ve?{}:Ie});if(!s.resolver&&e.validate&&await X({name:d,eventType:i.type}),!H&&ve&&S.state.next({...t}),s.resolver){const{errors:Me}=await F([d]);if(P([d]),x(N),!m){!K(Ie)&&S.state.next(Ie);return}const Hs=Yt(t.errors,a,d),_t=Yt(Me,a,Hs.name||d);y=_t.error,d=_t.name,b=K(Me)}else P([d],!0),y=(await Wt(p,u.disabled,l,E,s.shouldUseNativeValidation))[d],P([d]),x(N),m&&(y?b=!1:(T.isValid||f.isValid)&&(b=await G({fields:a,onlyCheckValid:!0,name:d,eventType:i.type})));m&&(p._f.deps&&(!Array.isArray(p._f.deps)||p._f.deps.length>0)&&pe(p._f.deps),V(d,b,y,Ie))}},ie=(i,c)=>{if(v(t.errors,c)&&i.focus)return i.focus(),1},pe=async(i,c={})=>{let d,m;const p=Ke(i);if(s.resolver){const x=await W(U(i)?i:p);d=K(x),m=i?!p.some(y=>v(x,y)):d}else i?(m=(await Promise.all(p.map(async x=>{const y=v(a,x);return await G({fields:y&&y._f?{[x]:y}:y,eventType:Pe.TRIGGER})}))).every(Boolean),!(!m&&!t.isValid)&&k()):m=d=await G({fields:a,name:i,eventType:Pe.TRIGGER});if(c.delayError&&s.delayError&&Y(i)){const x=v(t.errors,i);x?(q(t.errors,i),g[i]=_(i,()=>fe(i,x)),g[i](s.delayError)):(clearTimeout(j[i]),delete g[i])}return S.state.next({...!Y(i)||(T.isValid||f.isValid)&&d!==t.isValid?{}:{name:i},...s.resolver||!i?{isValid:d}:{},errors:t.errors}),c.shouldFocus&&!m&&He(a,ie,i?p:u.mount),m},Te=(i,c)=>{let d={...o.mount?l:n};return c&&(d=vs(c.dirtyFields?t.dirtyFields:t.touchedFields,d)),U(i)?d:Y(i)?v(d,i):i.map(m=>v(d,m))},Re=(i,c)=>({invalid:!!v((c||t).errors,i),isDirty:!!v((c||t).dirtyFields,i),error:v((c||t).errors,i),isValidating:!!v(t.validatingFields,i),isTouched:!!v((c||t).touchedFields,i)}),_e=i=>{const c=i?Ke(i):void 0;c?.forEach(d=>q(t.errors,d)),c?c.forEach(d=>{S.state.next({name:d,errors:t.errors})}):S.state.next({errors:{}})},Be=(i,c,d)=>{const m=(v(a,i,{_f:{}})._f||{}).ref,p=v(t.errors,i)||{},{ref:x,message:y,type:b,...N}=p;M(t.errors,i,{...N,...c,ref:m}),S.state.next({name:i,errors:t.errors,isValid:!1}),d&&d.shouldFocus&&m&&m.focus&&m.focus()},Fs=(i,c)=>{if(oe(i)){A++;const{unsubscribe:d}=S.state.subscribe({next:p=>"values"in p&&i(p.values||re(void 0,c),p)});let m=!1;return{unsubscribe:()=>{m||(m=!0,A--,d())}}}return re(i,c,!0)},wt=i=>{var c;const d=!!(!((c=i.formState)===null||c===void 0)&&c.values);d&&A++;const{unsubscribe:m}=S.state.subscribe({next:x=>{if(Jr(i.name,x.name,i.exact)&&Zr(x,i.formState||T,Ls,i.reRenderRoot)){const y={...l};i.callback({values:y,...t,...x,defaultValues:n})}}});if(!d)return m;let p=!1;return()=>{p||(p=!0,A--,m())}},Os=i=>(o.mount=!0,f={...f,...i.formState},wt({...i,formState:{...L,...i.formState}})),et=(i,c={})=>{for(const d of i?Ke(i):u.mount)u.mount.delete(d),u.array.delete(d),c.keepValue||(q(a,d),q(l,d)),!c.keepError&&q(t.errors,d),!c.keepDirty&&q(t.dirtyFields,d),!c.keepTouched&&q(t.touchedFields,d),!c.keepIsValidating&&q(t.validatingFields,d),!s.shouldUnregister&&!c.keepDefaultValue&&q(n,d);S.state.next({values:B(l)}),S.state.next({...t,...c.keepDirty?{isDirty:w()}:{}}),!c.keepIsValid&&k()},Nt=({disabled:i,name:c})=>{if(he(i)&&o.mount||i||u.disabled.has(c)){const p=u.disabled.has(c)!==!!i;i?u.disabled.add(c):u.disabled.delete(c),p&&o.mount&&!o.action&&k()}},tt=(i,c={})=>{let d=v(a,i);const m=he(c.disabled)||he(s.disabled),p=!u.registerName.has(i)&&d&&d._f&&!d._f.mount;return M(a,i,{...d||{},_f:{...d&&d._f?d._f:{ref:{name:i}},name:i,mount:!0,...c}}),u.mount.add(i),d&&!p?Nt({disabled:he(c.disabled)?c.disabled:s.disabled,name:i}):le(i,!0,c.value),{...m?{disabled:c.disabled||s.disabled}:{},...s.progressive?{required:!!c.required,min:Ue(c.min),max:Ue(c.max),minLength:Ue(c.minLength),maxLength:Ue(c.maxLength),pattern:Ue(c.pattern)}:{},name:i,onChange:ce,onBlur:ce,ref:x=>{if(x){u.registerName.add(i),tt(i,c),u.registerName.delete(i),d=v(a,i);const y=U(x.value)&&x.querySelectorAll&&x.querySelectorAll("input,select,textarea")[0]||x,b=Wr(y),N=d._f.refs||[];if(b?N.find(H=>H===y):y===d._f.ref)return;M(a,i,{_f:{...d._f,...b?{refs:[...N.filter(it),y,...Array.isArray(v(n,i))?[{}]:[]],ref:{type:y.type,name:i}}:{ref:y}}}),le(i,!1,void 0,y)}else d=v(a,i,{}),d._f&&(d._f.mount=!1),(s.shouldUnregister||c.shouldUnregister)&&!(Rr(u.array,i)&&o.action)&&u.unMount.add(i)}}},st=()=>s.shouldFocusError&&!s.shouldUseNativeValidation&&He(a,ie,u.mount),Rs=i=>{he(i)&&(S.state.next({disabled:i}),He(a,(c,d)=>{const m=v(a,d);m&&(c.disabled=m._f.disabled||i,Array.isArray(m._f.refs)&&m._f.refs.forEach(p=>{p.disabled=m._f.disabled||i}))},0,!1))},At=(i,c)=>async d=>{let m;d&&(d.preventDefault&&d.preventDefault(),d.persist&&d.persist());let p=B(l);if(S.state.next({isSubmitting:!0}),s.resolver){const{errors:x,values:y}=await F();P(),t.errors=x,p=B(y)}else await G({fields:a,eventType:Pe.SUBMIT});if(u.disabled.size)for(const x of u.disabled)q(p,x);if(q(t.errors,ps),K(t.errors)){S.state.next({errors:{}});try{await i(p,d)}catch(x){m=x}}else c&&await c({...t.errors},d),st(),setTimeout(st);if(S.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:K(t.errors)&&!m,submitCount:t.submitCount+1,errors:t.errors}),m)throw m},Is=(i,c={})=>{v(a,i)&&(U(c.defaultValue)?h(i,B(v(n,i))):(h(i,c.defaultValue),M(n,i,B(c.defaultValue))),c.keepTouched||q(t.touchedFields,i),c.keepDirty||(q(t.dirtyFields,i),t.isDirty=c.defaultValue?w(i,B(v(n,i))):w()),c.keepError||(q(t.errors,i),T.isValid&&k()),S.state.next({...t}))},Tt=(i,c={})=>{const d=i?B(i):n,m=B(d),p=K(i),x=m,y=a;if(c.keepDefaultValues||(n=d),!c.keepValues){if(c.keepDirtyValues){const b=new Set([...u.mount,...Object.keys(Ee(n,l,void 0,y))]);for(const N of Array.from(b)){const H=v(t.dirtyFields,N),ee=v(l,N),xe=v(x,N);H&&!U(ee)?M(x,N,ee):!H&&!U(xe)&&h(N,xe)}}else{if(Je&&U(i))for(const b of u.mount){const N=v(a,b);if(N&&N._f){const H=Array.isArray(N._f.refs)?N._f.refs[0]:N._f.ref;if(Qe(H)){const ee=H.closest("form");if(ee){ee.reset();break}}}}if(c.keepFieldsRef)for(const b of u.mount)h(b,v(x,b));else a={}}if(s.shouldUnregister){if(l=c.keepDefaultValues?B(n):{},c.keepFieldsRef)for(const b of u.mount)M(l,b,v(x,b))}else l=B(x);S.array.next({values:{...x}}),S.state.next({name:void 0,type:void 0,values:{...x}})}u={mount:c.keepDirtyValues?u.mount:new Set,unMount:new Set,array:new Set,registerName:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},o.mount=!T.isValid||!!c.keepIsValid||!!c.keepDirtyValues||!s.shouldUnregister&&!K(x),o.watch=!!s.shouldUnregister,o.keepIsValid=!!c.keepIsValid,o.action=!1,c.keepErrors||(t.errors={}),S.state.next({submitCount:c.keepSubmitCount?t.submitCount:0,isDirty:p?!1:c.keepDirty?t.isDirty:c.keepValues?w():!!(c.keepDefaultValues&&!ge(i,n)),isSubmitted:c.keepIsSubmitted?t.isSubmitted:!1,dirtyFields:p?{}:c.keepDirtyValues?c.keepDefaultValues&&l?Ee(n,l,void 0,y):t.dirtyFields:c.keepDefaultValues&&i?Ee(n,i,void 0,y):c.keepDirty?t.dirtyFields:{},touchedFields:c.keepTouched?t.touchedFields:{},errors:c.keepErrors?t.errors:{},isSubmitSuccessful:c.keepIsSubmitSuccessful?t.isSubmitSuccessful:!1,isSubmitting:!1,defaultValues:n})},Et=(i,c)=>Tt(oe(i)?i(l):i,{...s.resetOptions,...c}),Ms=(i,c={})=>{const d=v(a,i),m=d&&d._f;if(m){const p=m.refs?m.refs[0]:m.ref;p.focus&&setTimeout(()=>{p.focus(),c.shouldSelect&&oe(p.select)&&p.select()})}},Ls=i=>{const{name:c,type:d,values:m,...p}=i;t={...t,...p}},kt={control:{register:tt,unregister:et,getFieldState:Re,handleSubmit:At,setError:Be,_subscribe:wt,_runSchema:F,_updateIsValidating:P,_focusError:st,_getWatch:re,_getDirty:w,_setValid:k,_setFieldArray:z,_setDisabledField:Nt,_setErrors:ae,_getFieldArray:Ae,_reset:Tt,_resetDefaultValues:()=>oe(s.defaultValues)&&s.defaultValues().then(i=>{Et(i,s.resetOptions),S.state.next({isLoading:!1})}),_removeUnmounted:me,_disableForm:Rs,_subjects:S,_proxyFormState:T,get _fields(){return a},get _formValues(){return l},get _state(){return o},set _state(i){o=i},get _defaultValues(){return n},get _names(){return u},set _names(i){u=i},get _formState(){return t},get _options(){return s},set _options(i){s={...s,...i},R=We(s.mode),I=We(s.reValidateMode)}},subscribe:Os,trigger:pe,register:tt,handleSubmit:At,watch:Fs,setValue:h,setValues:O,getValues:Te,reset:Et,resetField:Is,resetDefaultValues:(i,c={})=>{if(n=B(i),!c.keepDirty){const d=Ee(n,l,void 0,a);t.dirtyFields=d,t.isDirty=!K(d)}c.keepIsValid||k(),S.state.next({...t,defaultValues:n})},clearErrors:_e,unregister:et,setError:Be,setFocus:Ms,getFieldState:Re};return{...kt,formControl:kt}}function ri(e={}){const s=te.useRef(void 0),t=te.useRef(void 0),a=te.useRef(e.formControl),[n,l]=te.useState(()=>({...B(As),isLoading:oe(e.defaultValues),errors:e.errors||{},disabled:e.disabled||!1,defaultValues:oe(e.defaultValues)?void 0:e.defaultValues}));if(!s.current||e.formControl&&a.current!==e.formControl)if(a.current=e.formControl,e.formControl)s.current={...e.formControl,formState:n},e.defaultValues&&!oe(e.defaultValues)&&e.formControl.reset(e.defaultValues,e.resetOptions);else{const{formControl:u,...g}=si(e);s.current={...g,formState:n}}const o=s.current.control;return o._options=e,Hr(()=>{const u=o._subscribe({formState:o._proxyFormState,callback:()=>l({...o._formState,defaultValues:o._defaultValues}),reRenderRoot:!0});return l(g=>({...g,isReady:!0})),o._formState.isReady=!0,u},[o]),te.useEffect(()=>o._disableForm(e.disabled),[o,e.disabled]),te.useEffect(()=>{e.mode&&(o._options.mode=e.mode),e.reValidateMode&&(o._options.reValidateMode=e.reValidateMode)},[o,e.mode,e.reValidateMode]),te.useEffect(()=>{e.errors&&(o._setErrors(e.errors),o._focusError())},[o,e.errors]),te.useEffect(()=>{e.shouldUnregister&&o._subjects.state.next({values:o._getWatch()})},[o,e.shouldUnregister]),te.useEffect(()=>{if(o._proxyFormState.isDirty){const u=o._getDirty();u!==n.isDirty&&o._subjects.state.next({isDirty:u})}},[o,n.isDirty]),te.useEffect(()=>{var u;e.values&&!ge(e.values,t.current)?(o._reset(e.values,{keepFieldsRef:!0,...o._options.resetOptions}),!((u=o._options.resetOptions)===null||u===void 0)&&u.keepIsValid||o._setValid(),t.current=e.values,l(g=>({...g}))):o._resetDefaultValues()},[o,e.values]),te.useEffect(()=>{o._state.mount||(o._setValid(),o._state.mount=!0),o._state.watch&&(o._state.watch=!1,o._subjects.state.next({...o._formState})),o._removeUnmounted()}),s.current.formState=te.useMemo(()=>Ur(n,o),[o,n]),s.current}const Zt=(e,s,t)=>{if(e&&"reportValidity"in e){const a=v(t,s);e.setCustomValidity(a&&a.message||""),e.reportValidity()}},mt=(e,s)=>{for(const t in s.fields){const a=s.fields[t];a&&a.ref&&"reportValidity"in a.ref?Zt(a.ref,t,e):a&&a.refs&&a.refs.forEach(n=>Zt(n,t,e))}},Jt=(e,s)=>{s.shouldUseNativeValidation&&mt(e,s);const t={};for(const a in e){const n=v(s.fields,a),l=Object.assign(e[a]||{},{ref:n&&n.ref});if(ii(s.names||Object.keys(e),a)){const o=Object.assign({},v(t,a));M(o,"root",l),M(t,a,o)}else M(t,a,l)}return t},ii=(e,s)=>{const t=Xt(s).replace(/[.*+?^${}()|\\]/g,"\\$&");return e.some(a=>Xt(a).match(`^${t}\\.\\d+`))};function Xt(e){return e.replace(/[\[\]]/g,"")}function Ts(e,s,t){function a(u,g){var j;Object.defineProperty(u,"_zod",{value:u._zod??{},enumerable:!1}),(j=u._zod).traits??(j.traits=new Set),u._zod.traits.add(e),s(u,g);for(const A in o.prototype)A in u||Object.defineProperty(u,A,{value:o.prototype[A].bind(u)});u._zod.constr=o,u._zod.def=g}const n=t?.Parent??Object;class l extends n{}Object.defineProperty(l,"name",{value:e});function o(u){var g;const j=t?.Parent?new l:this;a(j,u),(g=j._zod).deferred??(g.deferred=[]);for(const A of j._zod.deferred)A();return j}return Object.defineProperty(o,"init",{value:a}),Object.defineProperty(o,Symbol.hasInstance,{value:u=>t?.Parent&&u instanceof t.Parent?!0:u?._zod?.traits?.has(e)}),Object.defineProperty(o,"name",{value:e}),o}class ai extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}const ni={};function Es(e){return ni}function oi(e,s){return typeof s=="bigint"?s.toString():s}const ks=Error.captureStackTrace?Error.captureStackTrace:(...e)=>{};function Ge(e){return typeof e=="string"?e:e?.message}function _s(e,s,t){const a={...e,path:e.path??[]};if(!e.message){const n=Ge(e.inst?._zod.def?.error?.(e))??Ge(s?.error?.(e))??Ge(t.customError?.(e))??Ge(t.localeError?.(e))??"Invalid input";a.message=n}return delete a.inst,delete a.continue,s?.reportInput||delete a.input,a}const Ps=(e,s)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:s,enumerable:!1}),Object.defineProperty(e,"message",{get(){return JSON.stringify(s,oi,2)},enumerable:!0}),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},li=Ts("$ZodError",Ps),Cs=Ts("$ZodError",Ps,{Parent:Error}),ci=e=>(s,t,a,n)=>{const l=a?Object.assign(a,{async:!1}):{async:!1},o=s._zod.run({value:t,issues:[]},l);if(o instanceof Promise)throw new ai;if(o.issues.length){const u=new(n?.Err??e)(o.issues.map(g=>_s(g,l,Es())));throw ks(u,n?.callee),u}return o.value},di=ci(Cs),ui=e=>async(s,t,a,n)=>{const l=a?Object.assign(a,{async:!0}):{async:!0};let o=s._zod.run({value:t,issues:[]},l);if(o instanceof Promise&&(o=await o),o.issues.length){const u=new(n?.Err??e)(o.issues.map(g=>_s(g,l,Es())));throw ks(u,n?.callee),u}return o.value},fi=ui(Cs);function pt(){return pt=Object.assign?Object.assign.bind():function(e){for(var s=1;s<arguments.length;s++){var t=arguments[s];for(var a in t)({}).hasOwnProperty.call(t,a)&&(e[a]=t[a])}return e},pt.apply(null,arguments)}function es(e,s){try{var t=e()}catch(a){return s(a)}return t&&t.then?t.then(void 0,s):t}function mi(e,s){for(var t={};e.length;){var a=e[0],n=a.code,l=a.message,o=a.path.join(".");if(!t[o])if("unionErrors"in a){var u=a.unionErrors[0].errors[0];t[o]={message:u.message,type:u.code}}else t[o]={message:l,type:n};if("unionErrors"in a&&a.unionErrors.forEach(function(A){return A.errors.forEach(function(R){return e.push(R)})}),s){var g=t[o].types,j=g&&g[a.code];t[o]=jt(o,s,t,n,j?[].concat(j,a.message):a.message)}e.shift()}return t}function pi(e,s){for(var t={},a=function(){var n=e[0],l=n.code,o=n.message,u=n.path.join(".");if(!t[u])if(n.code==="invalid_union"&&n.errors.length>0){var g=n.errors[0][0];t[u]={message:g.message,type:g.code}}else t[u]={message:o,type:l};if(n.code==="invalid_union"&&n.errors.forEach(function(R){return R.forEach(function(I){return e.push(pt({},I,{path:[].concat(n.path,I.path)}))})}),s){var j=t[u].types,A=j&&j[n.code];t[u]=jt(u,s,t,l,A?[].concat(A,n.message):n.message)}e.shift()};e.length;)a();return t}function hi(e,s,t){if(t===void 0&&(t={}),(function(a){return"_def"in a&&typeof a._def=="object"&&"typeName"in a._def})(e))return function(a,n,l){try{return Promise.resolve(es(function(){return Promise.resolve(e[t.mode==="sync"?"parse":"parseAsync"](a,s)).then(function(o){return l.shouldUseNativeValidation&&mt({},l),{errors:{},values:t.raw?Object.assign({},a):o}})},function(o){if((function(u){return Array.isArray(u?.issues)})(o))return{values:{},errors:Jt(mi(o.errors,!l.shouldUseNativeValidation&&l.criteriaMode==="all"),l)};throw o}))}catch(o){return Promise.reject(o)}};if((function(a){return"_zod"in a&&typeof a._zod=="object"})(e))return function(a,n,l){try{return Promise.resolve(es(function(){return Promise.resolve((t.mode==="sync"?di:fi)(e,a,s)).then(function(o){return l.shouldUseNativeValidation&&mt({},l),{errors:{},values:t.raw?Object.assign({},a):o}})},function(o){if((function(u){return u instanceof li})(o))return{values:{},errors:Jt(pi(o.issues,!l.shouldUseNativeValidation&&l.criteriaMode==="all"),l)};throw o}))}catch(o){return Promise.reject(o)}};throw new Error("Invalid input: not a Zod schema")}const gi=e=>{const s=Ze(),{pushError:t}=Gs(),{data:a}=os({...ls(),staleTime:1/0}),n=a?.accounts.find(g=>g.accountId===e)?.composeLanguages,l=D.useMemo(()=>n&&n.length>0?[...n]:Ks(navigator.languages),[n]),o=ye({...yt(),onSuccess:()=>{s.invalidateQueries({queryKey:we()})},onError:g=>{t(Qs("Couldn't save languages","The writing languages weren't saved.",g))}}),u=D.useCallback(g=>{e&&o.mutate({path:{accountId:e},body:{composeLanguages:g}})},[e,o]);return{languages:l,setLanguages:u,isSaving:o.isPending}},yi=e=>e.authType==="oauthMicrosoft",xi="••••••••••",vi=e=>{const s=e.smtpUsername?.trim();return s?s!==e.username:!1},bi=Xs({email:je().email().min(1,"Email is required"),displayName:je().optional(),username:je().optional(),password:je().optional(),imapHost:je().min(1,"IMAP host is required"),imapPort:Vt.number().int().min(1).max(65535),imapTls:Le(),imapStartTls:Le(),smtpHost:je().optional(),smtpPort:Vt.number().int().min(1).max(65535).optional(),smtpTls:Le().optional(),smtpStartTls:Le().optional(),smtpUsername:je().optional(),smtpPassword:je().optional(),useDifferentSmtpCreds:Le().optional()}),Si=({isOpen:e,onClose:s,account:t,focusSmtp:a})=>{const n=Ze(),l=!!t,[o,u]=D.useState(!1),[g,j]=D.useState(""),[A,R]=D.useState(!1),I=Rt(g),L=!!I&&!A,T=D.useRef(null),f=ri({resolver:hi(bi),defaultValues:{email:"",displayName:"",username:"",password:"",imapHost:"",imapPort:993,imapTls:!0,imapStartTls:!1,smtpHost:"",smtpPort:587,smtpTls:!1,smtpStartTls:!0,useDifferentSmtpCreds:!1}});D.useEffect(()=>{if(t){const h=vi(t);f.reset({email:t.email,displayName:t.displayName||"",username:t.username||"",password:xi,imapHost:t.imapHost,imapPort:t.imapPort,imapTls:t.imapTls,imapStartTls:t.imapStartTls,smtpHost:t.smtpHost||"",smtpPort:t.smtpPort||587,smtpTls:t.smtpTls||!1,smtpStartTls:t.smtpStartTls||!0,smtpUsername:h&&t.smtpUsername||"",smtpPassword:"",useDifferentSmtpCreds:h}),u(!1)}else f.reset({email:"",displayName:"",username:"",password:"",imapHost:"",imapPort:993,imapTls:!0,imapStartTls:!1,smtpHost:"",smtpPort:587,smtpTls:!1,smtpStartTls:!0,useDifferentSmtpCreds:!1}),u(!1)},[t,f]);const S=ye({...Ys()}),ne=ye({...Zs(),onSuccess:()=>{n.invalidateQueries({queryKey:we()}),s()}}),E=ye({...yt(),onSuccess:()=>{n.invalidateQueries({queryKey:we()}),s()}}),_=()=>{const h=f.getValues(),O=l&&!o;S.mutate({body:{accountId:O?t?.accountId:void 0,username:h.username||h.email,password:O?void 0:h.password||void 0,imapHost:h.imapHost,imapPort:Number(h.imapPort),imapTls:h.imapTls,imapStartTls:h.imapStartTls}})},k=()=>{const h=f.getValues(),O=l&&!o;S.mutate({body:{accountId:O?t?.accountId:void 0,username:h.username||h.email,password:O?void 0:h.password||void 0,imapHost:h.imapHost,imapPort:Number(h.imapPort),imapTls:h.imapTls,imapStartTls:h.imapStartTls,smtpHost:h.smtpHost||void 0,smtpPort:h.smtpPort?Number(h.smtpPort):void 0,smtpTls:h.smtpTls,smtpStartTls:h.smtpStartTls,smtpUsername:h.useDifferentSmtpCreds?h.smtpUsername:void 0,smtpPassword:h.useDifferentSmtpCreds?h.smtpPassword:void 0}})},P=f.handleSubmit(h=>{if(!l&&!h.password){f.setError("password",{message:"Password is required"});return}const O=vr({imapHost:h.imapHost,smtpHost:h.smtpHost,smtpPort:h.smtpPort,smtpTls:h.smtpTls,smtpStartTls:h.smtpStartTls});O&&(f.setValue("smtpHost",O.smtpHost),f.setValue("smtpPort",O.smtpPort),f.setValue("smtpTls",O.smtpTls),f.setValue("smtpStartTls",O.smtpStartTls));const ce=O?.smtpHost??h.smtpHost,ie=O?.smtpPort??h.smtpPort,pe=O?.smtpTls??h.smtpTls,Te=O?.smtpStartTls??h.smtpStartTls,Re={email:h.email,displayName:h.displayName?.trim()||void 0,username:h.username||void 0,imapHost:h.imapHost,imapPort:Number(h.imapPort),imapTls:h.imapTls,imapStartTls:h.imapStartTls,smtpHost:ce||void 0,smtpPort:ie?Number(ie):void 0,smtpTls:pe,smtpStartTls:Te,smtpUsername:h.useDifferentSmtpCreds&&h.smtpUsername||void 0,smtpPassword:h.useDifferentSmtpCreds&&h.smtpPassword||void 0};if(l&&t){const _e={...Re,password:o?h.password:void 0};E.mutate({path:{accountId:t.accountId},body:_e})}else{const _e={...Re,password:h.password};ne.mutate({body:_e})}}),Z=ne.isPending||E.isPending,{signature:z,setSignature:fe,isSaving:ae}=xr(t?.accountId),[J,le]=D.useState(z.plainText),{languages:C,setLanguages:V,isSaving:F}=gi(t?.accountId),W=r.jsxs("section",{children:[r.jsx("h3",{className:"text-2xs font-semibold text-fg-subtle uppercase tracking-wider mb-3",children:"Writing languages"}),r.jsx(Dr,{value:C,onChange:V,busy:F})]});D.useEffect(()=>{le(z.plainText)},[z.plainText]),D.useEffect(()=>{if(!e||!a)return;const h=T.current;if(!h)return;const O=window.setTimeout(()=>{h.scrollIntoView({behavior:"smooth",block:"start"})},250);return()=>window.clearTimeout(O)},[e,a]);const X=D.useCallback(()=>{J!==z.plainText&&fe(J,J)},[J,z.plainText,fe]),G=h=>{const{tls:O,startTls:ce}=qe(h);f.setValue("imapTls",O),f.setValue("imapStartTls",ce);const ie=f.getValues("imapPort");(ie===993||ie===143)&&f.setValue("imapPort",h==="tls"?993:143)},me=h=>{const{tls:O,startTls:ce}=qe(h);f.setValue("smtpTls",O),f.setValue("smtpStartTls",ce);const ie=f.getValues("smtpPort");if(ie===465||ie===587||ie===25){const Te=h==="tls"?465:h==="starttls"?587:25;f.setValue("smtpPort",Te)}},w=()=>{const h=f.getValues("imapHost");f.setValue("smtpHost",br(h)),f.setValue("smtpTls",!1),f.setValue("smtpStartTls",!0),f.setValue("smtpPort",587)},re=h=>{j(h),R(!1);const O=Rt(h);if(!O)return;const ce=qe(O.imap.security);f.setValue("imapHost",O.imap.host),f.setValue("imapPort",O.imap.port),f.setValue("imapTls",ce.tls),f.setValue("imapStartTls",ce.startTls);const ie=qe(O.smtp.security);f.setValue("smtpHost",O.smtp.host),f.setValue("smtpPort",O.smtp.port),f.setValue("smtpTls",ie.tls),f.setValue("smtpStartTls",ie.startTls);const pe=f.getValues("email").trim(),Te=f.getValues("username")?.trim();pe&&!Te&&f.setValue("username",pe)},Ae=I?.passwordHelp.text,Se=It(S.data?.imapError,Ae),ke=It(S.data?.smtpError,Ae);return(t?yi(t):!1)&&l?r.jsx(Lt,{isOpen:e,onClose:s,title:"Edit Account",footer:r.jsx(se,{type:"button",variant:"secondary",onClick:s,children:"Close"}),children:r.jsxs("div",{className:"space-y-6",children:[r.jsxs("section",{children:[r.jsx("h3",{className:"text-2xs font-semibold text-fg-subtle uppercase tracking-wider mb-3",children:"Microsoft 365 Account"}),r.jsxs("div",{className:"space-y-3",children:[r.jsxs("div",{className:"rounded-md border border-line bg-surface-sunken px-3 py-2.5 text-sm text-fg-muted",children:[r.jsx("span",{className:"block text-2xs font-medium uppercase tracking-wider text-fg-subtle mb-1",children:"Email"}),r.jsx("span",{className:"text-fg",children:t?.email})]}),r.jsxs("div",{className:"rounded-md border border-line bg-surface-sunken px-3 py-2.5 text-sm text-fg-muted",children:[r.jsx("span",{className:"block text-2xs font-medium uppercase tracking-wider text-fg-subtle mb-1",children:"Authentication"}),r.jsx("span",{className:"text-fg",children:"Microsoft OAuth (XOAUTH2)"})]}),r.jsx("p",{className:"text-xs text-fg-muted",children:"Server settings are managed automatically for Microsoft 365 accounts. To update credentials, use the Reconnect button."})]})]}),l&&r.jsxs("section",{children:[r.jsx("h3",{className:"text-2xs font-semibold text-fg-subtle uppercase tracking-wider mb-3",children:"Signature"}),r.jsx("div",{className:"space-y-3",children:r.jsxs("div",{children:[r.jsx("label",{htmlFor:"email-sig-view",className:"text-sm font-medium mb-1.5 block",children:"Email Signature"}),r.jsx("textarea",{id:"email-sig-view",value:J,onChange:h=>le(h.target.value),onBlur:X,rows:5,className:"w-full px-3 py-2 border border-line rounded-md bg-surface-sunken text-sm text-fg placeholder:text-fg-subtle focus-within:border-line-strong focus-within:ring-2 focus-within:ring-ring/30 transition-colors resize-y outline-none",placeholder:"Enter your email signature..."}),r.jsx("p",{className:"text-xs text-fg-muted mt-1",children:ae?"Saving signature...":"This signature will be appended to new emails."})]})})]}),l&&W]})}):r.jsx(Lt,{isOpen:e,onClose:s,title:l?"Edit Account":"Add Account",footer:r.jsxs(r.Fragment,{children:[r.jsx(se,{type:"button",variant:"secondary",onClick:s,children:"Cancel"}),r.jsx(se,{type:"submit",form:"account-form",variant:"primary",disabled:Z,children:Z?"Saving...":"Save Account"})]}),children:r.jsxs("form",{id:"account-form",onSubmit:P,className:"space-y-6",children:[r.jsxs("section",{children:[r.jsx("h3",{className:"text-2xs font-semibold text-fg-subtle uppercase tracking-wider mb-3",children:"Account Information"}),r.jsxs("div",{className:"space-y-3",children:[r.jsxs("div",{children:[r.jsx("label",{htmlFor:"account-provider",className:"text-sm font-medium mb-1.5 block",children:"Provider"}),r.jsxs(Js,{id:"account-provider",value:g,onChange:h=>re(h.target.value),children:[r.jsx("option",{value:"",children:"Custom / other"}),fr.map(h=>r.jsx("option",{value:h.id,children:h.label},h.id))]}),r.jsx("p",{className:"text-xs text-fg-muted mt-1",children:"Pick your email provider to fill in server settings automatically, or choose Custom to enter them by hand."})]}),r.jsxs("div",{children:[r.jsx("label",{htmlFor:"account-email",className:"text-sm font-medium mb-1.5 block",children:"Email Address"}),r.jsx(be,{id:"account-email",...f.register("email"),placeholder:"alice@example.com"}),f.formState.errors.email&&r.jsx("p",{className:"text-sm text-danger mt-1",children:f.formState.errors.email.message})]}),r.jsxs("div",{children:[r.jsx("label",{htmlFor:"account-displayName",className:"text-sm font-medium mb-1.5 block",children:"Display name (optional)"}),r.jsx(be,{id:"account-displayName",...f.register("displayName"),placeholder:"Alice"}),r.jsx("p",{className:"text-xs text-fg-muted mt-1",children:"What to call this account in Remit. Leave blank to use a name derived from the address."})]}),r.jsxs("div",{children:[r.jsx("label",{htmlFor:"account-username",className:"text-sm font-medium mb-1.5 block",children:"Username"}),r.jsx(be,{id:"account-username",...f.register("username"),placeholder:"Same as email if empty"})]}),r.jsxs("div",{children:[r.jsx("label",{htmlFor:"account-password",className:"text-sm font-medium mb-1.5 block",children:"Password"}),r.jsx(Pt,{id:"account-password",...f.register("password",{onChange:()=>u(!0)}),onFocus:()=>{l&&!o&&(f.setValue("password",""),u(!0))},placeholder:l?"Leave empty to keep current":""}),f.formState.errors.password&&r.jsx("p",{className:"text-sm text-danger mt-1",children:f.formState.errors.password.message}),I&&r.jsxs("p",{className:"text-xs text-fg-muted mt-1",children:[I.passwordHelp.text," ",r.jsx("a",{href:I.passwordHelp.url,target:"_blank",rel:"noopener noreferrer",className:"text-accent hover:underline",children:"Get an app password"})]})]})]})]}),r.jsxs("section",{children:[r.jsxs("div",{className:"flex items-center justify-between mb-3",children:[r.jsx("h3",{className:"text-2xs font-semibold text-fg-subtle uppercase tracking-wider",children:"Incoming Mail (IMAP)"}),I&&r.jsx("button",{type:"button",onClick:()=>R(h=>!h),className:"text-xs text-fg-muted hover:text-fg transition-colors",children:A?"Use preset settings":"Advanced"})]}),L&&r.jsxs("p",{className:"text-xs text-fg-muted mb-3",children:["Server settings are pre-filled for ",I?.label," and locked. Choose Advanced to edit them by hand."]}),r.jsxs("div",{className:"space-y-3",children:[r.jsxs("div",{children:[r.jsx("label",{htmlFor:"imap-host",className:"text-sm font-medium mb-1.5 block",children:"Server"}),r.jsx(be,{id:"imap-host",...f.register("imapHost"),readOnly:L,placeholder:"imap.example.com"}),f.formState.errors.imapHost&&r.jsx("p",{className:"text-sm text-danger mt-1",children:f.formState.errors.imapHost.message})]}),r.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[r.jsxs("div",{children:[r.jsx("label",{htmlFor:"imap-port",className:"text-sm font-medium mb-1.5 block",children:"Port"}),r.jsx(be,{id:"imap-port",...f.register("imapPort"),readOnly:L,type:"number"})]}),r.jsxs("div",{children:[r.jsx("span",{className:"text-sm font-medium mb-1.5 block",children:"Security"}),r.jsxs("div",{className:"space-y-1.5 mt-2",children:[r.jsxs("label",{className:"flex items-center gap-2 text-sm",children:[r.jsx("input",{type:"radio",disabled:L,checked:f.watch("imapTls"),onChange:()=>G("tls")}),"TLS (Port 993)"]}),r.jsxs("label",{className:"flex items-center gap-2 text-sm",children:[r.jsx("input",{type:"radio",disabled:L,checked:!f.watch("imapTls")&&f.watch("imapStartTls"),onChange:()=>G("starttls")}),"STARTTLS (Port 143)"]}),r.jsxs("label",{className:"flex items-center gap-2 text-sm",children:[r.jsx("input",{type:"radio",disabled:L,checked:!f.watch("imapTls")&&!f.watch("imapStartTls"),onChange:()=>G("none")}),"None (Unencrypted)"]})]})]})]}),r.jsx(se,{type:"button",variant:"secondary",onClick:_,disabled:S.isPending,className:"w-full",icon:S.isPending?r.jsx(nt,{className:"size-4 animate-spin"}):void 0,children:S.isPending?"Testing...":"Test IMAP Connection"}),S.data&&r.jsxs("div",{className:De("p-2 rounded-md text-sm",S.data.imapSuccess?"bg-positive/10 text-positive":"bg-danger-soft text-danger"),children:[S.data.imapSuccess?r.jsx(Ct,{className:"inline size-4 mr-1"}):r.jsx(Fe,{className:"inline size-4 mr-1"}),S.data.imapSuccess?"IMAP Connected":Se]})]})]}),r.jsxs("section",{ref:T,"data-testid":"smtp-section",children:[r.jsxs("div",{className:"flex items-center justify-between mb-3",children:[r.jsx("h3",{className:"text-2xs font-semibold text-fg-subtle uppercase tracking-wider",children:"Outgoing Mail (SMTP)"}),!L&&r.jsx("button",{type:"button",onClick:w,disabled:!f.watch("imapHost"),className:"text-xs text-fg-muted hover:text-fg transition-colors disabled:opacity-50",children:"Pre-fill from IMAP"})]}),r.jsxs("div",{className:"space-y-3",children:[r.jsxs("div",{children:[r.jsx("label",{htmlFor:"smtp-host",className:"text-sm font-medium mb-1.5 block",children:"Server"}),r.jsx(be,{id:"smtp-host",...f.register("smtpHost"),readOnly:L,placeholder:"smtp.example.com"})]}),r.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[r.jsxs("div",{children:[r.jsx("label",{htmlFor:"smtp-port",className:"text-sm font-medium mb-1.5 block",children:"Port"}),r.jsx(be,{id:"smtp-port",...f.register("smtpPort"),readOnly:L,type:"number"})]}),r.jsxs("div",{children:[r.jsx("span",{className:"text-sm font-medium mb-1.5 block",children:"Security"}),r.jsxs("div",{className:"space-y-1.5 mt-2",children:[r.jsxs("label",{className:"flex items-center gap-2 text-sm",children:[r.jsx("input",{type:"radio",disabled:L,checked:f.watch("smtpTls")===!0,onChange:()=>me("tls")}),"TLS (Port 465)"]}),r.jsxs("label",{className:"flex items-center gap-2 text-sm",children:[r.jsx("input",{type:"radio",disabled:L,checked:!f.watch("smtpTls")&&f.watch("smtpStartTls")===!0,onChange:()=>me("starttls")}),"STARTTLS (Port 587)"]}),r.jsxs("label",{className:"flex items-center gap-2 text-sm",children:[r.jsx("input",{type:"radio",disabled:L,checked:!f.watch("smtpTls")&&!f.watch("smtpStartTls"),onChange:()=>me("none")}),"None (Unencrypted)"]})]})]})]}),r.jsxs("label",{className:"flex items-center gap-2 text-sm",children:[r.jsx("input",{type:"checkbox",...f.register("useDifferentSmtpCreds")}),"Use different credentials for SMTP"]}),f.watch("useDifferentSmtpCreds")&&r.jsxs(r.Fragment,{children:[r.jsxs("div",{children:[r.jsx("label",{htmlFor:"smtp-username",className:"text-sm font-medium mb-1.5 block",children:"SMTP Username"}),r.jsx(be,{id:"smtp-username",...f.register("smtpUsername")})]}),r.jsxs("div",{children:[r.jsx("label",{htmlFor:"smtp-password",className:"text-sm font-medium mb-1.5 block",children:"SMTP Password"}),r.jsx(Pt,{id:"smtp-password",...f.register("smtpPassword")})]})]}),r.jsx(se,{type:"button",variant:"secondary",onClick:k,disabled:S.isPending||!f.watch("smtpHost"),className:"w-full",icon:S.isPending?r.jsx(nt,{className:"size-4 animate-spin"}):void 0,children:S.isPending?"Testing...":"Test SMTP Connection"}),S.data?.smtpSuccess!==void 0&&r.jsxs("div",{className:De("p-2 rounded-md text-sm",S.data.smtpSuccess?"bg-positive/10 text-positive":"bg-danger-soft text-danger"),children:[S.data.smtpSuccess?r.jsx(Ct,{className:"inline size-4 mr-1"}):r.jsx(Fe,{className:"inline size-4 mr-1"}),S.data.smtpSuccess?"SMTP Connected":ke]})]})]}),l&&r.jsxs("section",{children:[r.jsx("h3",{className:"text-2xs font-semibold text-fg-subtle uppercase tracking-wider mb-3",children:"Signature"}),r.jsx("div",{className:"space-y-3",children:r.jsxs("div",{children:[r.jsx("label",{htmlFor:"email-sig-edit",className:"text-sm font-medium mb-1.5 block",children:"Email Signature"}),r.jsx("textarea",{id:"email-sig-edit",value:J,onChange:h=>le(h.target.value),onBlur:X,rows:5,className:"w-full px-3 py-2 border border-line rounded-md bg-surface-sunken text-sm text-fg placeholder:text-fg-subtle focus-within:border-line-strong focus-within:ring-2 focus-within:ring-ring/30 transition-colors resize-y outline-none",placeholder:"Enter your email signature..."}),r.jsx("p",{className:"text-xs text-fg-muted mt-1",children:ae?"Saving signature...":"This signature will be appended to new emails."})]})})]}),l&&W]})})},ji="https://graph.microsoft.com/",wi={[ot.Mail]:["https://outlook.office.com/IMAP.AccessAsUser.All","https://outlook.office.com/SMTP.Send"],[ot.Calendar]:[`${ji}Calendars.Read`]},Ni=e=>{const s=new Set(e.map(t=>t.toLowerCase()));return Object.values(ot).filter(t=>wi[t].every(a=>s.has(a.toLowerCase())))},ht=e=>`Couldn't turn ${e.service.toLowerCase()} ${e.intent}`,Ai=e=>er(tr({title:`Bug: ${ht(e)}`,errorMessage:`${ht(e)} — ${e.message}`}));function Ti({providerName:e,offered:s,enabled:t,consented:a,disabled:n,refusal:l,onRequestChange:o}){return s.length<2?null:r.jsxs("section",{className:"space-y-2 rounded-sm border border-line bg-surface px-row-inset py-3",children:[r.jsx(Cr,{providerName:e,offered:s,enabled:t,consented:a,disabled:n,onRequestChange:o}),l&&r.jsxs(lt,{tone:"danger",variant:"soft",children:[r.jsx("p",{className:"font-medium",children:ht(l)}),r.jsx("p",{className:"mt-0.5 break-words text-fg-muted",children:l.message}),r.jsx("a",{href:Ai(l),target:"_blank",rel:"noopener noreferrer",className:"mt-1 inline-block font-medium text-accent hover:underline",children:"Report an issue"})]})]})}const Vs=["Mail","Calendar"],ts="Microsoft",ss=e=>e.authType==="oauthMicrosoft",rs=(e,s)=>Vs.filter(t=>t===s||e.includes(t));function Ei({account:e,onRemoveAccount:s}){const t=Ze(),[a,n]=D.useState(null),[l,o]=D.useState(null),[u,g]=D.useState(null),j=ye({...yt(),meta:Dt,onSuccess:()=>t.invalidateQueries({queryKey:we()})}),A=ye({...cs(),meta:Dt}),R=us(_=>{const k=u;g(null),!(_!=="stalled"||k===null)&&o({service:k,intent:"on",message:fs})}),I=j.isPending&&j.variables?.body.syncedServices?j.variables.body.syncedServices:e.syncedServices,L=ss(e)?Vs:["Mail"],T=ss(e)?Ni(e.grantedScopes):L,f=(_,k,P)=>{o(null),j.mutate({path:{accountId:e.accountId},body:{syncedServices:_}},{onError:Z=>o({service:k,intent:P,message:Mt(Z)})})},S=_=>{o(null),A.mutate({body:{email:e.email,services:rs(I,_)}},{onSuccess:k=>{g(_),R(),window.location.assign(k.authorizationUrl)},onError:k=>o({service:_,intent:"on",message:Mt(k)})})},ne=(_,k)=>{if(k==="off"){n({kind:I.length===1?"last":"disable",service:_});return}if(!T.includes(_)){n({kind:"enable",service:_});return}f(rs(I,_),_,"on")},E=()=>{const _=a;if(n(null),_!==null){if(_.kind==="last"){s();return}if(_.kind==="enable"){S(_.service);return}f(I.filter(k=>k!==_.service),_.service,"off")}};return r.jsxs(r.Fragment,{children:[r.jsx(Ti,{providerName:ts,offered:L,enabled:I,consented:T,disabled:j.isPending||A.isPending||u!==null,refusal:l,onRequestChange:ne}),r.jsx(_r,{change:a,providerName:ts,onConfirm:E,onCancel:()=>n(null)})]})}function is({open:e,onClose:s,accountEmail:t,signOut:a}){const[n,l]=D.useState(""),[o,u]=D.useState(!1),[g,j]=D.useState(!1),A=ye({...rr(),onSuccess:()=>{j(!0),setTimeout(()=>a(),2e3)}}),R=ye(ir()),I=()=>{A.isPending||(l(""),u(!1),j(!1),A.reset(),R.reset(),s())},L=()=>{if(n.trim().toLowerCase()!==t.toLowerCase()){u(!0);return}u(!1),A.mutate({body:{confirmEmail:n.trim()}})};return r.jsxs(ds,{open:e,onClose:I,title:"Delete your Remit account",children:[r.jsxs("header",{className:"flex items-center gap-2 border-b border-line px-5 py-3",children:[r.jsx(gt,{className:"size-4 shrink-0 text-danger"}),r.jsx("span",{className:"flex-1 text-sm font-semibold text-fg",children:"Delete your Remit account"}),r.jsx(se,{variant:"ghost",size:"sm",icon:r.jsx(Fe,{className:"size-3.5"}),onClick:I,"aria-label":"Cancel"})]}),g?r.jsxs("div",{className:"px-5 py-6 text-sm text-fg-muted",children:[r.jsx("p",{className:"font-medium text-fg",children:"Account deletion scheduled."}),r.jsx("p",{className:"mt-1",children:"Your data will be erased shortly. Signing you out…"})]}):r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:"space-y-4 px-5 py-4 text-sm text-fg-muted",children:[r.jsx("p",{children:"This permanently erases everything Remit holds for you:"}),r.jsxs("ul",{className:"space-y-1.5 text-xs",children:[r.jsxs("li",{className:"flex gap-2",children:[r.jsx("span",{className:"text-danger",children:"•"}),"All connected accounts disconnected and access tokens revoked."]}),r.jsxs("li",{className:"flex gap-2",children:[r.jsx("span",{className:"text-danger",children:"•"}),"Synced mail cache and search index."]}),r.jsxs("li",{className:"flex gap-2",children:[r.jsx("span",{className:"text-danger",children:"•"}),"AI history and insights."]}),r.jsxs("li",{className:"flex gap-2",children:[r.jsx("span",{className:"text-danger",children:"•"}),"Preferences and rules."]})]}),r.jsxs("div",{className:"rounded-sm border border-line bg-surface-sunken px-3 py-2 text-xs",children:[r.jsx("strong",{className:"text-fg",children:"Your mail at Gmail / IMAP is not deleted."})," ","This only removes Remit's copy and its access — the mail stays in your provider mailboxes."]}),r.jsxs("div",{className:"text-xs",children:[r.jsxs("button",{type:"button",onClick:()=>R.mutate({}),"aria-busy":R.isPending,className:"inline-flex items-center gap-1.5 font-medium text-accent hover:underline",children:[r.jsx(wr,{className:"size-3.5"}),R.isPending?"Requesting export…":"Export my data first"]}),R.isSuccess&&r.jsx("p",{className:"mt-1.5 text-fg-muted",role:"status",children:"Export requested. We'll prepare a ZIP of your mail — find it under your data exports when it's ready."}),R.isError&&r.jsx("p",{className:"mt-1.5 text-danger",role:"alert",children:"Couldn't start the export. Please try again."})]}),r.jsxs("div",{children:[r.jsxs("label",{htmlFor:"confirm-remit-email",className:"mb-1 block text-xs font-medium text-fg",children:["Type"," ",r.jsx("span",{className:"font-mono text-fg-muted",children:t})," ","to confirm"]}),r.jsx(be,{id:"confirm-remit-email",type:"email",placeholder:t,value:n,onChange:T=>{l(T.target.value),o&&u(!1),A.isError&&A.reset()},autoComplete:"off"}),o&&r.jsx("p",{className:"mt-1.5 text-xs text-danger",role:"alert",children:"That doesn't match your account email. Type it exactly to confirm."}),A.isError&&r.jsx("p",{className:"mt-1.5 text-xs text-danger",role:"alert",children:A.error instanceof Error?A.error.message:"Something went wrong. Please try again."})]})]}),r.jsxs("footer",{className:"flex items-center justify-end gap-2 border-t border-line px-5 py-3",children:[r.jsx(se,{variant:"secondary",size:"sm",onClick:I,children:"Cancel"}),r.jsx(se,{variant:"danger",size:"sm",onClick:L,"aria-busy":A.isPending,children:A.isPending?"Deleting…":"Delete everything"})]})]})]})}function ki(e){const{Account:s}=sr();return r.jsx(s,{fallback:r.jsx(is,{...e,accountEmail:"",signOut:()=>{}}),children:({email:t,signOut:a})=>r.jsx(is,{...e,accountEmail:t??"",signOut:a})})}function _i(){const[e,s]=D.useState(!1);return r.jsxs("section",{className:"mt-8 border-t border-line pt-6",children:[r.jsx(Fr,{title:"Delete your Remit account",description:"Disconnects every account and erases Remit's copy of your mail, insights and preferences. Your mail at the providers is untouched.",action:r.jsx(se,{variant:"danger",size:"sm",onClick:()=>s(!0),children:"Delete your Remit account"})}),r.jsx(ki,{open:e,onClose:()=>s(!1)})]})}function Ds(e){const s=e.toLowerCase();return s==="access_denied"?"You cancelled the sign-in.":s==="scope_not_granted"?"Microsoft did not grant access to every service you picked. Sign in again and accept each permission Microsoft asks for.":s==="consent_required"||s.includes("admin_consent")||s.includes("interaction_required")?"Your organisation's admin needs to approve Remit. Ask your IT admin to grant the required permissions.":s.includes("imap_disabled")||s.includes("imap disabled")?"IMAP is disabled for this account. Ask your admin to enable IMAP access in the Microsoft 365 admin centre.":`Sign-in failed: ${e}. Please try again.`}const Pi=e=>e.length>1?`${e.slice(0,-1).join(", ")} and ${e[e.length-1]}`:e[0]??"";function Ci(e,s){const t=(e.missingServices??"").split(","),a=ct.filter(j=>t.includes(j.id)),n=e.oauthEmail,l=n?s.find(j=>j.authType==="oauthMicrosoft"&&j.email.toLowerCase()===n.toLowerCase()):void 0,o=Pi(a.map(j=>j.label)),u=a.length===0?Ds("scope_not_granted"):`Microsoft did not grant access to ${o}. Sign in again and accept the ${o} ${a.length>1?"permissions":"permission"} when Microsoft asks.`,g=l?ct.filter(j=>l.syncedServices.includes(j.id)||a.some(A=>A.id===j.id)).map(j=>j.id):void 0;return{kind:"refused",message:u,email:n,services:g,reconnect:!!l}}function Vi(e){const s=e.split("@")[0]??"";return s?s.split(/[._-]+/).filter(Boolean).map(t=>t.charAt(0).toUpperCase()+t.slice(1)).join(" "):e}function Di(e){const s=e.displayName?.trim();return s||Vi(e.email)}function Fi(e){if(!e.lastSyncAt)return"never synced";const s=ur(e.lastSyncAt);return s?`synced ${s}`:"never synced"}function as(e){return e.muted?.value?"muted":e.lastError?"error":e.connectionState==="authenticated"?"healthy":"error"}function ns(e){return e.connectionState==="reauth_required"}function Oi(e){return e.connectionState==="credentials_missing"}const Ri=()=>r.jsx("div",{className:"space-y-3",role:"status","aria-busy":"true","aria-label":"Loading accounts",children:["skeleton-0","skeleton-1"].map(e=>r.jsx("div",{className:"rounded-sm border border-line bg-surface animate-pulse p-4",children:r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsx("div",{className:"size-10 rounded-full bg-surface-sunken"}),r.jsxs("div",{className:"flex-1 space-y-2",children:[r.jsx("div",{className:"h-4 bg-surface-sunken rounded w-1/3"}),r.jsx("div",{className:"h-3 bg-surface-sunken rounded w-2/3"})]})]})},e))});function na(){const e=Ft.useSearch(),s=ar({from:Ft.fullPath}),[t,a]=D.useState(!0),[n,l]=D.useState(!1),[o,u]=D.useState(!1),[g,j]=D.useState(void 0),[A,R]=D.useState(null),[I,L]=D.useState(!1),[T,f]=D.useState(null),[S,ne]=D.useState(null),[E,_]=D.useState(null),[k,P]=D.useState(null),Z=Ze(),{data:z,isPending:fe,isError:ae,error:J,refetch:le}=os(ls());D.useEffect(()=>{e.editAccountId&&(R(e.editAccountId),L(!!e.focusSmtp),s({search:{editAccountId:void 0,focusSmtp:void 0,connected:e.connected,oauthError:e.oauthError,oauthEmail:e.oauthEmail,missingServices:e.missingServices},replace:!0}))},[e.editAccountId,e.focusSmtp,s,e.connected,e.oauthError,e.oauthEmail,e.missingServices]),D.useEffect(()=>{e.connected&&(j({kind:"connected",accountId:e.connected}),u(!0),Z.invalidateQueries({queryKey:we()}),s({search:{connected:void 0,oauthError:void 0,editAccountId:void 0,focusSmtp:void 0},replace:!0}))},[e.connected,s,Z]),D.useEffect(()=>{if(!e.oauthError)return;const w=e.oauthError==="scope_not_granted";w&&!z&&!ae||(P(null),w?(j(Ci({oauthEmail:e.oauthEmail,missingServices:e.missingServices},z?.accounts??[])),u(!0)):_(Ds(e.oauthError)),s({search:{oauthError:void 0,connected:void 0,editAccountId:void 0,focusSmtp:void 0},replace:!0}))},[e.oauthError,e.oauthEmail,e.missingServices,z,ae,s]),yr(k!==null,()=>{Z.invalidateQueries({queryKey:we()})}),D.useEffect(()=>{if(!k||!z)return;const w=z.accounts.find(re=>re.accountId===k);(!w||!ns(w))&&P(null)},[z,k]);const C=us(w=>{P(null),w==="stalled"&&_(fs)}),V=ye({...cs(),onSuccess:w=>{C(),window.location.assign(w.authorizationUrl)},onError:w=>{_(w instanceof Error?w.message:"Failed to start reconnect"),P(null)}}),F=ye({...nr(),onSuccess:()=>{Z.invalidateQueries({queryKey:we()}),f(null)}}),W=z?.accounts.find(w=>w.accountId===T),X=z?.accounts.find(w=>w.accountId===A),G=()=>{l(!1),u(!1),R(null),L(!1)},me=w=>{const re=cr[w];re&&s({to:re})};return r.jsxs(hr,{items:or,activeId:"accounts",title:"Accounts",description:"Every account keeps syncing — muted ones just stay out of unified views.",help:Nr,helpOpen:t,onToggleHelp:()=>a(w=>!w),onSelect:me,onBackToMail:()=>{s({to:"/mail"})},children:[S&&r.jsx(lt,{tone:"success",variant:"soft","data-testid":"oauth-success-banner",onDismiss:()=>ne(null),children:S}),E&&r.jsx(lt,{tone:"danger",variant:"soft","data-testid":"oauth-error-banner",onDismiss:()=>_(null),children:E}),r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsx(lr,{tone:"neutral",children:fe||ae?"accounts":`${z.accounts.length} ${z.accounts.length===1?"account":"accounts"}`}),r.jsx(se,{variant:"primary",size:"sm",icon:r.jsx(Ot,{className:"size-3.5"}),onClick:()=>u(!0),children:"Add account"})]}),fe?r.jsx(Ri,{}):ae?r.jsx(jr,{title:"Couldn't load accounts",error:J,onRetry:()=>{le()}}):z.accounts.length===0?r.jsxs("div",{className:"py-12 text-sm text-fg-muted","data-testid":"accounts-empty",children:[r.jsx("p",{className:"mb-3",children:"No accounts configured."}),r.jsx(se,{variant:"primary",size:"sm",icon:r.jsx(Ot,{className:"size-3.5"}),onClick:()=>u(!0),children:"Add your first account"})]}):r.jsx("div",{className:"space-y-3",children:z.accounts.map(w=>{const re=ns(w),Ae=Oi(w),Se=w.authType==="oauthMicrosoft",ke=k===w.accountId,Oe=re&&Se?{label:"Reconnect",variant:"secondary",busy:ke,busyLabel:"Redirecting…",onClick:()=>{P(w.accountId),V.mutate({body:{email:w.email,services:w.syncedServices}})}}:Ae?{label:"Enter password",variant:"secondary",onClick:()=>R(w.accountId)}:as(w)==="error"?{label:"Reconnect",variant:"secondary",onClick:()=>R(w.accountId)}:{label:"Manage",variant:"ghost",onClick:()=>R(w.accountId)},h=r.jsx(pr,{actions:[Oe],destructive:{label:"Delete account",iconOnly:!0,icon:r.jsx(dr,{className:"size-3.5"}),onClick:()=>f(w.accountId)}});return r.jsxs("div",{className:"space-y-2",children:[r.jsx(gr,{label:Di(w),email:w.email,connector:Se?"Microsoft 365":"IMAP",syncLabel:Fi(w),state:as(w),errorDetail:re?w.lastError??"Re-authentication required":Ae?"Imported from a config file, which carries no password. Enter one to start syncing.":w.lastError,trailing:h}),r.jsx(Ei,{account:w,onRemoveAccount:()=>f(w.accountId)})]},w.accountId)})}),o&&r.jsx("div",{className:"fixed inset-0 z-40 overflow-auto bg-canvas",children:r.jsx(mr,{skipWelcome:!0,microsoftReturn:g,onComplete:()=>{g?.kind==="connected"&&ne("Account connected successfully."),u(!1),j(void 0),Z.invalidateQueries({queryKey:we()})},onCancel:()=>{u(!1),j(void 0)}})}),r.jsx(Si,{isOpen:n||!!A,account:X,focusSmtp:I,onClose:G}),r.jsxs(ds,{open:!!T,onClose:()=>f(null),title:"Delete account",children:[r.jsxs("header",{className:"flex items-center gap-2 border-b border-line px-5 py-3",children:[r.jsx(gt,{className:"size-4 shrink-0 text-danger"}),r.jsx("span",{className:"flex-1 text-sm font-semibold text-fg",children:"Delete account"}),r.jsx(se,{variant:"ghost",size:"sm",icon:r.jsx(Fe,{className:"size-3.5"}),onClick:()=>f(null),"aria-label":"Cancel"})]}),r.jsxs("div",{className:"space-y-3 px-5 py-4 text-sm text-fg-muted",children:[r.jsx("p",{className:"text-center text-lg font-medium text-fg",children:"Are you sure?"}),W&&r.jsx("p",{className:"text-center",children:W.email}),r.jsxs("ul",{className:"list-inside list-disc space-y-1",children:[r.jsx("li",{children:"Remove the account from your settings"}),r.jsx("li",{children:"Stop syncing mail for this account"}),r.jsx("li",{children:"Delete all associated data (within 24 hours)"})]})]}),r.jsxs("footer",{className:"flex items-center justify-end gap-2 border-t border-line px-5 py-3",children:[r.jsx(se,{variant:"secondary",size:"sm",onClick:()=>f(null),children:"Cancel"}),r.jsx(se,{variant:"danger",size:"sm","aria-busy":F.isPending,icon:F.isPending?r.jsx(nt,{className:"size-3.5 animate-spin"}):void 0,onClick:()=>{F.isPending||T&&F.mutate({path:{accountId:T}})},children:F.isPending?"Deleting…":"Delete account"})]})]}),r.jsx(_i,{})]})}export{na as component,Ds as mapOauthError,Ci as scopeRefusalReturn};
@@ -1,4 +0,0 @@
1
- import{e as L,j as e,aM as z,f as l,aV as p,g as y,aW as D,aX as V,B as S,ar as u,aY as I,r as m,L as b,aZ as g,t as q,h as F,a_ as U,a$ as H,c as C,b0 as Q,d as Y,aH as _,aI as E,b1 as G,T as J,b2 as W,b3 as Z,b4 as K,u as X,aP as ee,aR as se}from"./index-Dtovse-L.js";import{S as te}from"./settings-screen-Bm-R0ESO.js";import{e as ae}from"./config-import-jGvPqLLa.js";import{u as ne}from"./sections-45KeddjZ.js";import{C as re,a as ie,b as le,c as oe}from"./card-Bqz6khhJ.js";import{D as k}from"./download-BoHBLdA7.js";import{F as ce}from"./file-json-CTXp7rcG.js";import{C as de}from"./copy-BVqTKL-m.js";import{B as A}from"./bug-C6xR86kp.js";import{C as v}from"./circle-check-DE9CwgTP.js";import{f as me}from"./ErrorState-PNI7QSLU.js";import{u as xe}from"./useResultFolderIndex-DYd3UAzD.js";import{R}from"./rotate-ccw-BWReSl7L.js";import{C as he,S as ue}from"./shield-check-B_rWkRQY.js";import{C as pe}from"./clock-CwmO_JCY.js";import{b as fe}from"./help-copy-BReMOm6I.js";import"./avatar-CCaAcetc.js";import"./chevron-left-DV5pp97l.js";import"./menu-Bk7fxS2w.js";import"./circle-help--jGrrMan.js";import"./useQueries-DH9StZ-W.js";import"./kbd-Ccl_4UMN.js";const w=L("ExternalLink",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]),ge={BodyParse:"The message is built in a way Remit could not read."};function je(s){return ge[s]}function M(s){return s.split(";")[0].trim()}const T=/^[A-Za-z0-9!#$%&'*+._-]+$/,P=/^[A-Za-z0-9!#$%&'*+._-]+\/[A-Za-z0-9!#$%&'*+._-]+$/;function j(s,t){return t.test(s)?`\`${s}\``:`\`${JSON.stringify(s).replace(/`/g,"\\u0060")}\` (malformed)`}function Ne(s){const t=M(s);return P.test(t)?t:JSON.stringify(t)}const N="_not read_";function be(s){return s.length===0?["(no MIME structure was read)"]:s.map(t=>`${" ".repeat(t.depth)}- ${Ne(t.contentType)}`)}const ve="_No message content, addresses, subject, attachment names or parser output are included._";function $(s){return{head:[`### Message quarantined at \`${s.failureStage}\``,"",`- **Failure**: \`${s.failureCode}\``,`- **Folder role**: ${s.mailboxRole??"_none appointed_"}`,`- **Failing part**: ${s.failurePartPath==null?"_whole message_":`\`${s.failurePartPath}\``}`,`- **Attempts before quarantine**: ${s.attempts}`,`- **Worker build**: ${s.workerVersion}`,`- **Message-ID hash**: ${s.messageIdHash==null?"_none declared_":`\`${s.messageIdHash}\``}`,"","#### Message shape","",`- **Content-Type**: ${s.contentType==null?N:j(M(s.contentType),P)}`,`- **Content-Transfer-Encoding**: ${s.transferEncoding==null?N:j(s.transferEncoding,T)}`,`- **Charset**: ${s.charset==null?"_not declared_":j(s.charset,T)}`,`- **Size**: ${s.sizeBytes==null?N:`${s.sizeBytes} bytes`}`,"","MIME structure:"].join(`
2
- `),structure:be(s.structure).join(`
3
- `),disclaimer:ve}}function ye(s){const{head:t,structure:a,disclaimer:n}=$(s);return[t,"","```",a,"```","",n].join(`
4
- `)}function ke(s){return`Message quarantined: ${s.failureCode} at ${s.failureStage}`}function we({entry:s,onClose:t,issueUrl:a,onCopy:n}){if(!s)return null;const r=ye(s);return e.jsx(z,{open:!0,onClose:t,title:"Report this message",children:e.jsxs("div",{className:"flex max-h-[80vh] flex-col",children:[e.jsxs("header",{className:"space-y-1 border-b border-line px-4 py-3",children:[e.jsx("h3",{className:"text-sm font-semibold text-fg",children:"Report this message"}),e.jsx("p",{className:"text-xs text-fg-muted",children:"This is everything the report contains. It describes the shape of the message — never its contents, addresses, subject, attachment names, or the parser's own error text."})]}),e.jsx("pre",{className:"flex-1 overflow-auto bg-surface-sunken px-4 py-3 text-2xs leading-relaxed whitespace-pre-wrap text-fg-muted",children:r}),e.jsxs("footer",{className:"flex flex-wrap items-center justify-end gap-2 border-t border-line px-4 py-3",children:[e.jsx(l,{variant:"ghost",size:"sm",onClick:t,children:"Cancel"}),e.jsx(l,{variant:"secondary",size:"sm",icon:e.jsx(de,{className:"size-3.5"}),onClick:()=>n(r),children:"Copy report"}),e.jsx(p,{external:!0,size:"sm",href:a,icon:e.jsx(w,{className:"size-3.5"}),children:"Open on GitHub"})]})]})})}function Ce(s){return new Date(s).toLocaleString(void 0,{dateStyle:"medium",timeStyle:"short"})}function Re({entry:s,onCutBug:t}){return e.jsxs("li",{className:"flex flex-col gap-2 border-b border-line px-row-inset py-3 last:border-b-0 sm:flex-row sm:items-start sm:justify-between",children:[e.jsxs("div",{className:"min-w-0 space-y-1",children:[e.jsx("p",{className:"text-sm text-fg",children:je(s.failureStage)}),e.jsx("p",{className:"truncate text-xs text-fg-muted",title:s.failureMessage,children:s.failureMessage}),e.jsxs("p",{className:"flex flex-wrap items-center gap-x-2 gap-y-1 text-2xs text-fg-subtle",children:[s.mailboxRole&&e.jsx(y,{tone:"warning",children:D(s.mailboxRole)}),e.jsx("span",{className:"truncate",title:s.mailboxPath,children:V(s.mailboxPath,s.mailboxDelimiter)}),e.jsx("span",{"aria-hidden":!0,children:"·"}),e.jsx("span",{children:`uid ${s.uid}`}),e.jsx("span",{"aria-hidden":!0,children:"·"}),e.jsx("span",{children:Ce(s.quarantinedAt)}),s.attempts>1&&e.jsxs(e.Fragment,{children:[e.jsx("span",{"aria-hidden":!0,children:"·"}),e.jsx("span",{children:`${s.attempts} attempts`})]})]})]}),e.jsx(l,{variant:"secondary",size:"sm",className:"shrink-0",icon:e.jsx(A,{className:"size-3.5"}),onClick:()=>t(s),children:"Cut a bug"})]})}function Te({entries:s,onCutBug:t}){return e.jsxs("section",{className:"space-y-3",children:[e.jsxs("header",{className:"space-y-1",children:[e.jsx("h2",{className:"text-sm font-semibold text-fg",children:"Messages set aside"}),e.jsx("p",{className:"text-xs text-fg-muted",children:"Mail Remit could not read is set aside here instead of being skipped, so nothing goes missing quietly. The rest of the folder keeps syncing. Recovering a set-aside message is a re-sync, not a per-row action."})]}),s.length===0&&e.jsxs("div",{className:"flex items-center gap-2 rounded-sm border border-line bg-surface px-row-inset py-3",children:[e.jsx(v,{className:"size-4 shrink-0 text-positive","aria-hidden":!0}),e.jsx("p",{className:"text-sm text-fg-muted",children:"Every message has been read successfully. Nothing is set aside."})]}),s.length>1&&e.jsx(S,{tone:"warning",children:e.jsxs("p",{className:"flex items-start gap-2",children:[e.jsx(u,{className:"mt-0.5 size-4 shrink-0","aria-hidden":!0}),e.jsxs("span",{children:[e.jsx("span",{className:"font-semibold",children:`${s.length} messages could not be read.`})," ","More than one means something is wrong with how Remit reads mail, not with the mail. Reporting one of these gets it fixed."]})]})}),s.length>0&&e.jsx("ul",{className:"rounded-sm border border-line bg-surface",children:s.map(a=>e.jsx(Re,{entry:a,onCutBug:t},a.quarantineId))})]})}const ze=["Remit restarts. Mail stops loading for about a minute and this page will lose its connection while that happens.","Nothing is sent, deleted or moved. Your mail stays at your provider.","If the new version does not come back up, the version you are running now is restored automatically."];function Se({open:s,currentVersion:t,release:a,appliesSchemaMigration:n=!1,onClose:r,onConfirm:i}){return s?e.jsx(z,{open:!0,onClose:r,title:`Install Remit ${a.version}`,children:e.jsxs("div",{className:"flex max-h-[80vh] flex-col",children:[e.jsxs("header",{className:"space-y-1 border-b border-line px-4 py-3",children:[e.jsxs("h3",{className:"text-sm font-semibold text-fg",children:["Install Remit ",a.version,"?"]}),e.jsxs("p",{className:"text-xs text-fg-muted",children:["You are on ",t,". ",a.version," was released"," ",I(a.releasedAt),"."]})]}),e.jsxs("div",{className:"flex-1 space-y-3 overflow-auto px-4 py-3",children:[e.jsx("p",{className:"text-sm text-fg-muted",children:a.summary}),e.jsxs("ul",{className:"space-y-2",children:[ze.map(o=>e.jsxs("li",{className:"flex gap-2 text-sm text-fg-muted",children:[e.jsx("span",{className:"mt-1.5 size-1.5 shrink-0 rounded-full bg-fg-subtle"}),e.jsx("span",{children:o})]},o)),n&&e.jsxs("li",{className:"flex gap-2 text-sm text-fg-muted",children:[e.jsx("span",{className:"mt-1.5 size-1.5 shrink-0 rounded-full bg-fg-subtle"}),e.jsx("span",{children:"This version updates the database while Remit is offline. The step forward cannot be undone by hand, but a failed start is still rolled back to the version and data you have now."})]})]}),e.jsx("p",{className:"text-xs text-fg-subtle",children:"Good moment for this: when you are not waiting on a message."})]}),e.jsxs("footer",{className:"flex flex-wrap items-center justify-end gap-2 border-t border-line px-4 py-3",children:[e.jsx(l,{variant:"ghost",size:"sm",onClick:r,children:"Not now"}),e.jsx(p,{variant:"secondary",size:"sm",external:!0,href:a.releaseNotesUrl,icon:e.jsx(w,{className:"size-3.5"}),children:"Release notes"}),e.jsx(l,{size:"sm",icon:e.jsx(k,{className:"size-3.5"}),onClick:i,children:"Install and restart"})]})]})}):null}function d({children:s,tone:t}){return e.jsx("div",{className:q("rounded-sm border bg-surface px-row-inset py-3",t==="danger"?"border-danger/50":"border-line"),children:s})}function Ie({state:s,onCheck:t,onInstall:a,onDismissResult:n,now:r=Date.now()}){const[i,o]=m.useState(null),x=s.status==="checking",c=s.status==="available",h=()=>{if(x){o("Already checking. The result appears here in a moment.");return}o(null),t()},O=()=>{n(),h()},f=()=>{if(!c&&s.status!=="rolledBack"&&s.status!=="abandoned"){o("There is no update to install. Check for updates first — if one is found it appears here.");return}o(null),a()},B=(()=>{switch(s.status){case"upToDate":return e.jsx(d,{children:e.jsxs("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[e.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[e.jsx(v,{className:"size-4 shrink-0 text-positive","aria-hidden":!0}),e.jsxs("p",{className:"text-sm text-fg",children:["Remit ",s.version," is the latest version.",e.jsxs("span",{className:"text-fg-subtle",children:[" ","Checked ",g(s.checkedAt,r),"."]})]})]}),e.jsx(l,{variant:"secondary",size:"sm",className:"shrink-0",onClick:h,children:"Check again"})]})});case"checking":return e.jsx(d,{children:e.jsxs("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[e.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[e.jsx(b,{className:"size-4 shrink-0 animate-spin text-fg-subtle","aria-hidden":!0}),e.jsxs("p",{className:"text-sm text-fg-muted",children:["Looking for a newer version. You are on ",s.version,"."]})]}),e.jsx(l,{variant:"secondary",size:"sm",className:"shrink-0",onClick:h,children:"Check again"})]})});case"neverChecked":return e.jsx(d,{children:e.jsxs("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[e.jsxs("div",{className:"flex min-w-0 items-start gap-2",children:[e.jsx(pe,{className:"mt-0.5 size-4 shrink-0 text-fg-subtle","aria-hidden":!0}),e.jsxs("p",{className:"text-sm text-fg-muted",children:["No update check has run yet. Remit checks for updates on its own in the background.",s.lastCheckedAt!==void 0&&e.jsxs("span",{className:"text-fg-subtle",children:[" ","Last checked"," ",g(s.lastCheckedAt,r),"."]})]})]}),e.jsx(l,{variant:"secondary",size:"sm",className:"shrink-0",onClick:h,children:"Check now"})]})});case"checkFailed":return e.jsx(d,{children:e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx(he,{className:"mt-0.5 size-4 shrink-0 text-fg-subtle","aria-hidden":!0}),e.jsxs("div",{className:"min-w-0 space-y-1",children:[e.jsx("p",{className:"text-sm text-fg",children:"Could not reach the update source."}),e.jsx("p",{className:"text-xs text-fg-muted",children:s.reason}),e.jsxs("p",{className:"text-xs text-fg-subtle",children:["You are still on ",s.version," and it keeps working.",s.lastCheckedAt!==void 0&&e.jsxs(e.Fragment,{children:[" ","Last successful check"," ",g(s.lastCheckedAt,r),"."]})]})]})]}),e.jsx("div",{className:"flex justify-end",children:e.jsx(l,{variant:"secondary",size:"sm",onClick:h,children:"Try again"})})]})});case"available":return e.jsx(d,{children:e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsxs("span",{className:"text-sm font-semibold text-fg",children:["Remit ",s.release.version]}),e.jsx(y,{tone:"accent",children:"update available"}),e.jsxs("span",{className:"text-2xs text-fg-subtle",children:["released ",I(s.release.releasedAt)," · you are on ",s.version]})]}),e.jsx("p",{className:"text-sm text-fg-muted",children:s.release.summary}),e.jsx("p",{className:"text-xs text-fg-subtle",children:"Installing restarts Remit, so mail stops loading for about a minute. If the new version does not come back up, the one you are running now is restored on its own."}),e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsxs(l,{size:"sm",icon:e.jsx(k,{className:"size-3.5"}),onClick:f,children:["Install ",s.release.version]}),e.jsx(p,{variant:"secondary",size:"sm",external:!0,href:s.release.releaseNotesUrl,icon:e.jsx(w,{className:"size-3.5"}),children:"Release notes"})]})]})});case"applying":return e.jsx(d,{children:e.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[e.jsx(b,{className:"size-4 shrink-0 animate-spin text-accent-2","aria-hidden":!0}),e.jsxs("p",{className:"text-sm text-fg-muted",children:["Installing Remit ",s.target,". The restart screen has the details."]})]})});case"succeeded":return e.jsxs(e.Fragment,{children:[e.jsx(S,{tone:"success",onDismiss:n,children:e.jsxs("div",{className:"space-y-1",children:[e.jsxs("p",{className:"font-semibold",children:["Updated to Remit ",s.version,"."]}),e.jsxs("p",{children:["You were on ",s.previousVersion,"."," ",e.jsx("a",{href:s.releaseNotesUrl,target:"_blank",rel:"noopener noreferrer",className:"underline",children:"See what changed"}),"."]})]})}),e.jsx(d,{children:e.jsxs("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[e.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[e.jsx(v,{className:"size-4 shrink-0 text-positive","aria-hidden":!0}),e.jsxs("p",{className:"text-sm text-fg",children:["Remit ",s.version," is running."]})]}),e.jsx(l,{variant:"secondary",size:"sm",className:"shrink-0",onClick:O,children:"Check for updates"})]})})]});case"rolledBack":return e.jsx(d,{tone:"danger",children:e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx(u,{className:"mt-0.5 size-4 shrink-0 text-danger","aria-hidden":!0}),e.jsxs("div",{className:"min-w-0 space-y-1",children:[e.jsxs("p",{className:"text-sm font-semibold text-fg",children:["Remit ",s.attemptedVersion," did not start. Remit reports that it put ",s.version," back."]}),e.jsxs("p",{className:"text-sm text-fg-muted",children:["You are running ",s.version," again. A failed update can still have changed things on the way — the log below is the only account of what it got as far as doing."]})]})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"text-xs text-fg-subtle",children:"What Remit reported as the failure"}),e.jsx("code",{className:"block rounded-xs bg-danger-soft px-2 py-1 text-2xs text-danger",children:s.reason})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"text-xs text-fg-subtle",children:"Read the full log before trying again:"}),e.jsx("code",{className:"block rounded-xs bg-surface-sunken px-2 py-1 text-2xs text-fg-muted",children:s.logsCommand})]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsxs(l,{variant:"secondary",size:"sm",icon:e.jsx(R,{className:"size-3.5"}),onClick:f,children:["Try ",s.attemptedVersion," again"]}),e.jsxs(l,{variant:"ghost",size:"sm",onClick:n,children:["Stay on ",s.version]})]})]})});case"unreachable":return e.jsx(d,{tone:"danger",children:e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx(u,{className:"mt-0.5 size-4 shrink-0 text-danger","aria-hidden":!0}),e.jsxs("div",{className:"min-w-0 space-y-1",children:[e.jsxs("p",{className:"text-sm font-semibold text-fg",children:["Installing ",s.attemptedVersion," left the server unreachable."]}),e.jsx("p",{className:"text-sm text-fg-muted",children:"Remit has answered again since, but nothing here can say what happened during the silence."})]})]}),e.jsx("code",{className:"block rounded-xs bg-surface-sunken px-2 py-1 text-2xs text-fg-muted",children:s.logsCommand}),e.jsx("div",{className:"flex justify-end",children:e.jsx(l,{variant:"ghost",size:"sm",onClick:n,children:"Dismiss"})})]})});case"rollbackFailed":return e.jsx(d,{tone:"danger",children:e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx(u,{className:"mt-0.5 size-4 shrink-0 text-danger","aria-hidden":!0}),e.jsxs("div",{className:"min-w-0 space-y-1",children:[e.jsxs("p",{className:"text-sm font-semibold text-fg",children:["Remit ",s.attemptedVersion," did not start, and Remit could not put ",s.previousVersion," back."]}),e.jsx("p",{className:"text-sm text-fg-muted",children:"This is the one outcome Remit cannot resolve on its own. The server is in a half-changed state and needs you at a shell. The log below is the only account of where it stopped."})]})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"text-xs text-fg-subtle",children:"What Remit reported as the failure"}),e.jsx("code",{className:"block rounded-xs bg-danger-soft px-2 py-1 text-2xs text-danger",children:s.reason})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"text-xs text-fg-subtle",children:"Read the full log on the server:"}),e.jsx("code",{className:"block rounded-xs bg-surface-sunken px-2 py-1 text-2xs text-fg-muted",children:s.logsCommand})]}),e.jsx("div",{className:"flex justify-end",children:e.jsx(l,{variant:"ghost",size:"sm",onClick:n,children:"Dismiss"})})]})});case"abandoned":return e.jsx(d,{tone:"danger",children:e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx(u,{className:"mt-0.5 size-4 shrink-0 text-fg-subtle","aria-hidden":!0}),e.jsxs("div",{className:"min-w-0 space-y-1",children:[e.jsxs("p",{className:"text-sm font-semibold text-fg",children:["Remit ",s.attemptedVersion," was not installed. Nothing changed."]}),e.jsxs("p",{className:"text-sm text-fg-muted",children:["The update stopped before it altered anything. You are still running ",s.version,"."]})]})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"text-xs text-fg-subtle",children:"What Remit reported"}),e.jsx("code",{className:"block rounded-xs bg-surface-sunken px-2 py-1 text-2xs text-fg-muted",children:s.reason})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"text-xs text-fg-subtle",children:"Read the full log before trying again:"}),e.jsx("code",{className:"block rounded-xs bg-surface-sunken px-2 py-1 text-2xs text-fg-muted",children:s.logsCommand})]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsxs(l,{variant:"secondary",size:"sm",icon:e.jsx(R,{className:"size-3.5"}),onClick:f,children:["Try ",s.attemptedVersion," again"]}),e.jsxs(l,{variant:"ghost",size:"sm",onClick:n,children:["Stay on ",s.version]})]})]})});default:return s}})();return e.jsxs("section",{className:"space-y-3",children:[e.jsxs("header",{className:"space-y-1",children:[e.jsx("h2",{className:"text-sm font-semibold text-fg",children:"Updates"}),e.jsx("p",{className:"text-xs text-fg-muted",children:"This Remit runs on your own server, so it updates when you say so. Your mail lives at your provider and is never touched by an update."})]}),B,i&&e.jsx("p",{role:"status",className:"text-xs text-fg-muted",children:i})]})}function _e({fileName:s,state:t="ready",error:a,onDownload:n,onImport:r}){const i=t==="downloading";return e.jsxs(re,{className:"max-w-xl",children:[e.jsx(ie,{children:e.jsx(le,{children:"Configuration file"})}),e.jsxs(oe,{children:[e.jsx("p",{className:"text-sm text-fg-muted",children:"One versioned JSON document carrying every setting this instance holds: accounts and their servers, folder roles, rules, labels, flagged senders and appearance. No passwords and no OAuth tokens — you sign in again wherever you import it."}),t==="failed"&&e.jsxs("div",{className:"mt-3 space-y-2 rounded-sm border border-danger/40 bg-danger-soft px-3 py-2.5",children:[e.jsx("p",{className:"text-sm font-medium text-danger",children:"The config file could not be written."}),e.jsxs("p",{className:"text-xs text-fg-muted",children:["Nothing was downloaded. Try again — if it keeps failing, use"," ",e.jsx("code",{className:"rounded bg-surface-sunken px-1 py-0.5",children:"remit config save"})," ","on the host in the meantime."]}),a&&e.jsx("code",{className:"block rounded bg-surface-sunken px-2.5 py-2 text-2xs text-fg-muted",children:a})]}),e.jsxs("div",{className:"mt-3 flex flex-wrap items-center gap-2",children:[e.jsx(l,{variant:"secondary",size:"sm",disabled:i,icon:i?e.jsx(b,{className:"size-3.5 animate-spin"}):e.jsx(k,{className:"size-3.5"}),onClick:n,children:i?"Preparing…":`Download ${s}`}),e.jsx(y,{tone:"neutral",children:"no passwords"})]}),e.jsxs("p",{className:"mt-3 text-2xs text-fg-subtle",children:["On the host, the same file comes from"," ",e.jsxs("code",{className:"rounded bg-surface-sunken px-1 py-0.5",children:["remit config save ~/",s]}),"."]}),e.jsxs("div",{className:"mt-5 border-t border-line pt-4",children:[e.jsx("p",{className:"text-sm font-medium text-fg",children:"Import a config file"}),e.jsx("p",{className:"mt-1 text-sm text-fg-muted",children:"Read a file from another Reader into this one. It shows what will change before anything is written, and asks for each account's credentials afterwards."}),e.jsx(l,{className:"mt-3",variant:"secondary",size:"sm",icon:e.jsx(ce,{className:"size-3.5"}),onClick:r,children:"Import a config file"})]})]})]})}const Ee=(s,t)=>{const a=URL.createObjectURL(new Blob([JSON.stringify(t,null,2)],{type:"application/json"})),n=document.createElement("a");n.href=a,n.download=s,n.click(),URL.revokeObjectURL(a)};function Ae(){const s=F(),t=ne(),[a,n]=m.useState("ready"),[r,i]=m.useState(void 0),o=ae(new Date),x=()=>{a!=="downloading"&&(n("downloading"),i(void 0),s.fetchQuery(U()).then(c=>{Ee(o,c.document),n("ready")}).catch(c=>{n("failed"),i(c instanceof Error?c.message:"GET /config/export did not answer with a configuration.")}))};return e.jsx(_e,{fileName:o,state:a,error:r,onDownload:x,onImport:()=>t("importConfig")})}function Me(s,t){return{quarantineId:s.quarantineId,accountId:s.accountId,mailboxId:s.mailboxId,uidValidity:s.uidValidity,uid:s.uid,mailboxRole:s.mailboxRole?H[s.mailboxRole]:void 0,mailboxPath:s.mailboxPath,mailboxDelimiter:t,failureStage:s.failureStage,failureCode:s.failureCode,failureMessage:s.failureMessage,failurePartPath:s.failurePartPath,quarantinedAt:s.quarantinedAt,attempts:s.attempts,sizeBytes:s.sizeBytes,contentType:s.contentType,transferEncoding:s.transferEncoding,charset:s.charset,structure:s.structure,messageIdHash:s.messageIdHash,workerVersion:s.workerVersion}}const Pe=[];function $e(s){window.open(s,"_blank","noopener,noreferrer")}function Oe(s){return _(E({quarantine:$(s),title:ke(s)}))}function Be({error:s}){return e.jsxs("section",{role:"alert",className:"space-y-3",children:[e.jsx("h2",{className:"text-sm font-semibold text-fg",children:"Messages set aside"}),e.jsxs("div",{className:"space-y-2 rounded-sm border border-danger/40 bg-danger-soft px-row-inset py-3",children:[e.jsx("p",{className:"text-sm font-medium text-danger",children:"The list of set-aside messages could not be read."}),e.jsx("p",{className:"break-words text-sm text-fg-muted",children:me(s)}),e.jsx("p",{className:"text-xs text-fg-muted",children:"Mail may still have been set aside — this page cannot say either way until it can read the list. Reporting this gets it fixed."}),e.jsx(l,{variant:"secondary",size:"sm",icon:e.jsx(A,{className:"size-3.5"}),onClick:()=>$e(_(E())),children:"Report this"})]})]})}function Le({entries:s,isPending:t,error:a}){const[n,r]=m.useState(null),[i,o]=m.useState(!1);if(t)return e.jsx("p",{className:"animate-pulse text-sm text-fg-subtle",children:"Checking for messages set aside…"});if(a)return e.jsx(Be,{error:a});const x=c=>{navigator.clipboard.writeText(c).then(()=>{o(!1),r(null)},()=>{o(!0),r(null)})};return e.jsxs(e.Fragment,{children:[i&&e.jsx("p",{role:"alert",className:"mb-3 text-sm text-danger",children:"The report was not copied — this browser refused clipboard access. Cut the bug again and use Open on GitHub, which needs no clipboard."}),e.jsx(Te,{entries:s,onCutBug:r}),e.jsx(we,{entry:n,issueUrl:n?Oe(n):"",onClose:()=>r(null),onCopy:x})]})}function De(s,t){return s.get(t)?.hierarchyDelimiter??""}function Ve(){const s=C(Q()),t=C(Y()),a=m.useMemo(()=>t.data?.accounts??[],[t.data]),n=xe(a),r=s.data?.entries??Pe,i=m.useMemo(()=>r.map(o=>Me(o,De(n.index,o.mailboxId))),[r,n.index]);return e.jsx(Le,{entries:i,isPending:s.isPending||t.isPending||n.isPending,error:s.error??t.error??n.error})}function qe(){const{surface:s,release:t,currentVersion:a,appliesSchemaMigration:n,onCheck:r,install:i,onDismissResult:o}=G(),[x,c]=m.useState(!1);return s.status!=="ready"?null:e.jsxs(e.Fragment,{children:[e.jsx(Ie,{state:s.section,onCheck:r,onInstall:()=>c(!0),onDismissResult:o}),t&&a&&e.jsx(Se,{open:x,currentVersion:a,release:t,appliesSchemaMigration:n,onClose:()=>c(!1),onConfirm:()=>{c(!1),i(t.version)}})]})}function Fe(){return J().tlsMode!=="internal"?null:e.jsxs("div",{className:"border-t border-line pt-4 mt-4",children:[e.jsx("p",{className:"text-sm font-medium text-fg mb-1",children:"TLS root certificate"}),e.jsx("p",{className:"text-sm text-fg-muted mb-2",children:"This deployment signs its own certificate. Import it into the trust store of each device you browse from, and the browser warning stops for good."}),e.jsx(p,{href:"/tls-root-ca.crt",download:!0,variant:"secondary",size:"sm",icon:e.jsx(ue,{className:"size-3.5"}),children:"Download root certificate"})]})}function Ue(s){try{return new Date(s).toLocaleString(void 0,{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}catch{return s}}function He({sha:s=Z,commitUrl:t=W,buildTime:a=K}){return e.jsxs("p",{className:"text-xs text-fg-subtle",children:["Version"," ",t?e.jsx("a",{href:t,target:"_blank",rel:"noopener noreferrer",className:"font-mono hover:text-fg-muted hover:underline",children:s}):e.jsx("span",{className:"font-mono",children:s})," · ",e.jsxs("span",{children:["Built ",Ue(a)]})]})}function ps(){const s=X(),[t,a]=m.useState(!0),n=r=>{const i=se[r];i&&s({to:i})};return e.jsxs(te,{items:ee,activeId:"advanced",title:"Advanced",description:"Notification rules, export, and diagnostics.",help:fe,helpOpen:t,onToggleHelp:()=>a(r=>!r),onSelect:n,onBackToMail:()=>{s({to:"/mail"})},children:[e.jsx(qe,{}),e.jsx(Ve,{}),e.jsx("div",{className:"mt-6 border-t border-line pt-4",children:e.jsx(Ae,{})}),e.jsx("div",{className:"mt-6 border-t border-line pt-4",children:e.jsx("p",{className:"text-sm text-fg-muted",children:"Notification rules are coming in a future release."})}),e.jsx(Fe,{}),e.jsxs("div",{className:"border-t border-line pt-4 mt-4",children:[e.jsx("p",{className:"text-sm font-medium text-fg mb-1",children:"About"}),e.jsx(He,{})]})]})}export{ps as component};
@@ -1 +0,0 @@
1
- import{j as r,O as i}from"./index-Dtovse-L.js";import{a as m}from"./MailShell-DzKQC7Uj.js";import{B as o}from"./BriefPane-l0C6HwIU.js";import{a as p}from"./search-token-index-BXtgewDi.js";import{u as e}from"./search-mirror-DSVQGDLi.js";import"./FullCompose-BACzjpTB.js";import"./ErrorState-PNI7QSLU.js";import"./index-CyocVpgw.js";import"./useMessageBodyContent-DIF3dieb.js";import"./useSignature-B8GSTQOi.js";import"./account-form-helpers-DhckT_PN.js";import"./useDebouncedValue-BSAyBygv.js";import"./sections-45KeddjZ.js";import"./confirm-dialog-WrJoQuYb.js";import"./useSearchTokenContext-CnVweHh1.js";import"./kbd-Ccl_4UMN.js";import"./search-scope-B5-OK3Cq.js";import"./MailListHeader-Dp-YNlPj.js";import"./roving-focus-BgNxAjAj.js";import"./popover-menu-CG5nGI0G.js";import"./mail-BD9CFExB.js";import"./avatar-CCaAcetc.js";import"./EmptyState-Dw5-fMm4.js";import"./undo-2-UQEFkwhb.js";import"./download-BoHBLdA7.js";import"./useCalendarFreeBusy-BgHa55K-.js";import"./calendar-format-CDiJYM60.js";import"./useQueries-DH9StZ-W.js";import"./useCalendars-O5ZvqPWu.js";import"./map-pin-DM-UwFHl.js";import"./calendar-suggestion-BQoWPMtl.js";import"./attendee-row-BRiEaasS.js";import"./minus-BUHU6kmL.js";import"./clock-CwmO_JCY.js";import"./calendar-clash-strip-7S3XyUIT.js";import"./bell-off-CpcOtCIq.js";import"./shield-check-B_rWkRQY.js";import"./calendar-report-C-w9d_X_.js";import"./useFilters-R3V1TB7X.js";import"./checkbox-BwzvnbNT.js";import"./useLayoutTier-BT9E1-ej.js";import"./menu-Bk7fxS2w.js";import"./useRefreshControl-DfkVEG2l.js";import"./circle-check-big-kuolCFUC.js";import"./refresh-cw-DV6lCoUu.js";import"./useSemanticSearch-BQ_df8hM.js";import"./useLabels-qT2MGxVA.js";import"./search-query-Cr_ZXBCp.js";import"./wizard-selection-zWa1qc6-.js";function tr(){const t=p();return e({to:"/mail/brief"}),r.jsx(o,{thread:t,children:r.jsx(m,{phone:r.jsx(o.Phone,{}),list:r.jsx(o.List,{}),reading:r.jsx(i,{}),intelligence:r.jsx(o.Intelligence,{}),hasThread:!!t})})}export{tr as component};
@@ -1,2 +0,0 @@
1
- import{fb as A,N as $}from"./index-Dtovse-L.js";function X(_,d){for(var b=0;b<d.length;b++){const y=d[b];if(typeof y!="string"&&!Array.isArray(y)){for(const l in y)if(l!=="default"&&!(l in _)){const p=Object.getOwnPropertyDescriptor(y,l);p&&Object.defineProperty(_,l,p.get?p:{enumerable:!0,get:()=>y[l]})}}}return Object.freeze(Object.defineProperty(_,Symbol.toStringTag,{value:"Module"}))}var E={exports:{}},H;function J(){return H||(H=1,(function(_,d){var b=typeof globalThis<"u"&&globalThis||typeof self<"u"&&self||typeof A<"u"&&A,y=(function(){function p(){this.fetch=!1,this.DOMException=b.DOMException}return p.prototype=b,new p})();(function(p){(function(h){var a=typeof p<"u"&&p||typeof self<"u"&&self||typeof A<"u"&&A||{},u={searchParams:"URLSearchParams"in a,iterable:"Symbol"in a&&"iterator"in Symbol,blob:"FileReader"in a&&"Blob"in a&&(function(){try{return new Blob,!0}catch{return!1}})(),formData:"FormData"in a,arrayBuffer:"ArrayBuffer"in a};function F(e){return e&&DataView.prototype.isPrototypeOf(e)}if(u.arrayBuffer)var q=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],C=ArrayBuffer.isView||function(e){return e&&q.indexOf(Object.prototype.toString.call(e))>-1};function v(e){if(typeof e!="string"&&(e=String(e)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(e)||e==="")throw new TypeError('Invalid character in header field name: "'+e+'"');return e.toLowerCase()}function T(e){return typeof e!="string"&&(e=String(e)),e}function B(e){var t={next:function(){var r=e.shift();return{done:r===void 0,value:r}}};return u.iterable&&(t[Symbol.iterator]=function(){return t}),t}function i(e){this.map={},e instanceof i?e.forEach(function(t,r){this.append(r,t)},this):Array.isArray(e)?e.forEach(function(t){if(t.length!=2)throw new TypeError("Headers constructor: expected name/value pair to be length 2, found"+t.length);this.append(t[0],t[1])},this):e&&Object.getOwnPropertyNames(e).forEach(function(t){this.append(t,e[t])},this)}i.prototype.append=function(e,t){e=v(e),t=T(t);var r=this.map[e];this.map[e]=r?r+", "+t:t},i.prototype.delete=function(e){delete this.map[v(e)]},i.prototype.get=function(e){return e=v(e),this.has(e)?this.map[e]:null},i.prototype.has=function(e){return this.map.hasOwnProperty(v(e))},i.prototype.set=function(e,t){this.map[v(e)]=T(t)},i.prototype.forEach=function(e,t){for(var r in this.map)this.map.hasOwnProperty(r)&&e.call(t,this.map[r],r,this)},i.prototype.keys=function(){var e=[];return this.forEach(function(t,r){e.push(r)}),B(e)},i.prototype.values=function(){var e=[];return this.forEach(function(t){e.push(t)}),B(e)},i.prototype.entries=function(){var e=[];return this.forEach(function(t,r){e.push([r,t])}),B(e)},u.iterable&&(i.prototype[Symbol.iterator]=i.prototype.entries);function O(e){if(!e._noBody){if(e.bodyUsed)return Promise.reject(new TypeError("Already read"));e.bodyUsed=!0}}function D(e){return new Promise(function(t,r){e.onload=function(){t(e.result)},e.onerror=function(){r(e.error)}})}function I(e){var t=new FileReader,r=D(t);return t.readAsArrayBuffer(e),r}function M(e){var t=new FileReader,r=D(t),n=/charset=([A-Za-z0-9_-]+)/.exec(e.type),s=n?n[1]:"utf-8";return t.readAsText(e,s),r}function L(e){for(var t=new Uint8Array(e),r=new Array(t.length),n=0;n<t.length;n++)r[n]=String.fromCharCode(t[n]);return r.join("")}function R(e){if(e.slice)return e.slice(0);var t=new Uint8Array(e.byteLength);return t.set(new Uint8Array(e)),t.buffer}function U(){return this.bodyUsed=!1,this._initBody=function(e){this.bodyUsed=this.bodyUsed,this._bodyInit=e,e?typeof e=="string"?this._bodyText=e:u.blob&&Blob.prototype.isPrototypeOf(e)?this._bodyBlob=e:u.formData&&FormData.prototype.isPrototypeOf(e)?this._bodyFormData=e:u.searchParams&&URLSearchParams.prototype.isPrototypeOf(e)?this._bodyText=e.toString():u.arrayBuffer&&u.blob&&F(e)?(this._bodyArrayBuffer=R(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):u.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(e)||C(e))?this._bodyArrayBuffer=R(e):this._bodyText=e=Object.prototype.toString.call(e):(this._noBody=!0,this._bodyText=""),this.headers.get("content-type")||(typeof e=="string"?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):u.searchParams&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},u.blob&&(this.blob=function(){var e=O(this);if(e)return e;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))}),this.arrayBuffer=function(){if(this._bodyArrayBuffer){var e=O(this);return e||(ArrayBuffer.isView(this._bodyArrayBuffer)?Promise.resolve(this._bodyArrayBuffer.buffer.slice(this._bodyArrayBuffer.byteOffset,this._bodyArrayBuffer.byteOffset+this._bodyArrayBuffer.byteLength)):Promise.resolve(this._bodyArrayBuffer))}else{if(u.blob)return this.blob().then(I);throw new Error("could not read as ArrayBuffer")}},this.text=function(){var e=O(this);if(e)return e;if(this._bodyBlob)return M(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(L(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},u.formData&&(this.formData=function(){return this.text().then(z)}),this.json=function(){return this.text().then(JSON.parse)},this}var N=["CONNECT","DELETE","GET","HEAD","OPTIONS","PATCH","POST","PUT","TRACE"];function k(e){var t=e.toUpperCase();return N.indexOf(t)>-1?t:e}function w(e,t){if(!(this instanceof w))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');t=t||{};var r=t.body;if(e instanceof w){if(e.bodyUsed)throw new TypeError("Already read");this.url=e.url,this.credentials=e.credentials,t.headers||(this.headers=new i(e.headers)),this.method=e.method,this.mode=e.mode,this.signal=e.signal,!r&&e._bodyInit!=null&&(r=e._bodyInit,e.bodyUsed=!0)}else this.url=String(e);if(this.credentials=t.credentials||this.credentials||"same-origin",(t.headers||!this.headers)&&(this.headers=new i(t.headers)),this.method=k(t.method||this.method||"GET"),this.mode=t.mode||this.mode||null,this.signal=t.signal||this.signal||(function(){if("AbortController"in a){var o=new AbortController;return o.signal}})(),this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&r)throw new TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(r),(this.method==="GET"||this.method==="HEAD")&&(t.cache==="no-store"||t.cache==="no-cache")){var n=/([?&])_=[^&]*/;if(n.test(this.url))this.url=this.url.replace(n,"$1_="+new Date().getTime());else{var s=/\?/;this.url+=(s.test(this.url)?"&":"?")+"_="+new Date().getTime()}}}w.prototype.clone=function(){return new w(this,{body:this._bodyInit})};function z(e){var t=new FormData;return e.trim().split("&").forEach(function(r){if(r){var n=r.split("="),s=n.shift().replace(/\+/g," "),o=n.join("=").replace(/\+/g," ");t.append(decodeURIComponent(s),decodeURIComponent(o))}}),t}function G(e){var t=new i,r=e.replace(/\r?\n[\t ]+/g," ");return r.split("\r").map(function(n){return n.indexOf(`
2
- `)===0?n.substr(1,n.length):n}).forEach(function(n){var s=n.split(":"),o=s.shift().trim();if(o){var g=s.join(":").trim();try{t.append(o,g)}catch(x){console.warn("Response "+x.message)}}}),t}U.call(w.prototype);function c(e,t){if(!(this instanceof c))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');if(t||(t={}),this.type="default",this.status=t.status===void 0?200:t.status,this.status<200||this.status>599)throw new RangeError("Failed to construct 'Response': The status provided (0) is outside the range [200, 599].");this.ok=this.status>=200&&this.status<300,this.statusText=t.statusText===void 0?"":""+t.statusText,this.headers=new i(t.headers),this.url=t.url||"",this._initBody(e)}U.call(c.prototype),c.prototype.clone=function(){return new c(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new i(this.headers),url:this.url})},c.error=function(){var e=new c(null,{status:200,statusText:""});return e.ok=!1,e.status=0,e.type="error",e};var V=[301,302,303,307,308];c.redirect=function(e,t){if(V.indexOf(t)===-1)throw new RangeError("Invalid status code");return new c(null,{status:t,headers:{location:e}})},h.DOMException=a.DOMException;try{new h.DOMException}catch{h.DOMException=function(t,r){this.message=t,this.name=r;var n=Error(t);this.stack=n.stack},h.DOMException.prototype=Object.create(Error.prototype),h.DOMException.prototype.constructor=h.DOMException}function P(e,t){return new Promise(function(r,n){var s=new w(e,t);if(s.signal&&s.signal.aborted)return n(new h.DOMException("Aborted","AbortError"));var o=new XMLHttpRequest;function g(){o.abort()}o.onload=function(){var f={statusText:o.statusText,headers:G(o.getAllResponseHeaders()||"")};s.url.indexOf("file://")===0&&(o.status<200||o.status>599)?f.status=200:f.status=o.status,f.url="responseURL"in o?o.responseURL:f.headers.get("X-Request-URL");var m="response"in o?o.response:o.responseText;setTimeout(function(){r(new c(m,f))},0)},o.onerror=function(){setTimeout(function(){n(new TypeError("Network request failed"))},0)},o.ontimeout=function(){setTimeout(function(){n(new TypeError("Network request timed out"))},0)},o.onabort=function(){setTimeout(function(){n(new h.DOMException("Aborted","AbortError"))},0)};function x(f){try{return f===""&&a.location.href?a.location.href:f}catch{return f}}if(o.open(s.method,x(s.url),!0),s.credentials==="include"?o.withCredentials=!0:s.credentials==="omit"&&(o.withCredentials=!1),"responseType"in o&&(u.blob?o.responseType="blob":u.arrayBuffer&&(o.responseType="arraybuffer")),t&&typeof t.headers=="object"&&!(t.headers instanceof i||a.Headers&&t.headers instanceof a.Headers)){var j=[];Object.getOwnPropertyNames(t.headers).forEach(function(f){j.push(v(f)),o.setRequestHeader(f,T(t.headers[f]))}),s.headers.forEach(function(f,m){j.indexOf(m)===-1&&o.setRequestHeader(m,f)})}else s.headers.forEach(function(f,m){o.setRequestHeader(m,f)});s.signal&&(s.signal.addEventListener("abort",g),o.onreadystatechange=function(){o.readyState===4&&s.signal.removeEventListener("abort",g)}),o.send(typeof s._bodyInit>"u"?null:s._bodyInit)})}return P.polyfill=!0,a.fetch||(a.fetch=P,a.Headers=i,a.Request=w,a.Response=c),h.Headers=i,h.Request=w,h.Response=c,h.fetch=P,h})({})})(y),y.fetch.ponyfill=!0,delete y.fetch.polyfill;var l=b.fetch?b:y;d=l.fetch,d.default=l.fetch,d.fetch=l.fetch,d.Headers=l.Headers,d.Request=l.Request,d.Response=l.Response,_.exports=d})(E,E.exports)),E.exports}var S=J();const Z=$(S),Q=X({__proto__:null,default:Z},[S]);export{Q as b};
@@ -1 +0,0 @@
1
- import{u as g,a as x,b as h,r as i,p as O,c as j,d as y,j as e,O as C}from"./index-Dtovse-L.js";import{C as N}from"./CalendarShell-D-5dI0jc.js";import{M as P}from"./MailNav-C7sJoax-.js";import{E}from"./ErrorState-PNI7QSLU.js";import{i as S,u as b}from"./useLayoutTier-BT9E1-ej.js";import"./roving-focus-BgNxAjAj.js";import"./bell-off-CpcOtCIq.js";import"./useQueries-DH9StZ-W.js";import"./folder-failure-CqkVSsrb.js";import"./outbox-status-BlKn6P0x.js";import"./bug-C6xR86kp.js";function W(){const t=g(),c=S(b()),a=x(),r=h(),l=a.includes("nav"),n=i.useCallback(v=>{r(O(a,v?"nav":void 0))},[a,r]),{data:o,isLoading:u,isError:p,error:m,refetch:f}=j({...y(),staleTime:1/0}),s=!!(o&&(o.accounts?.length??0)===0);i.useEffect(()=>{s&&t({to:"/onboarding",replace:!0})},[s,t]);const d=o?.accounts??[];return p?e.jsx("div",{className:"flex h-full items-center justify-center bg-canvas p-4",children:e.jsx(E,{title:"Couldn't load your account",error:m,onRetry:()=>{f()}})}):e.jsx(N,{chrome:{isSinglePane:c,isLoading:u||s,nav:e.jsx(P,{accounts:d,onMailboxSelect:()=>n(!1)}),navOpen:l,onOpenNav:()=>n(!0),onCloseNav:()=>n(!1)},children:e.jsx(C,{})})}export{W as component};
@@ -1 +0,0 @@
1
- import{e}from"./index-Dtovse-L.js";const t=e("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);export{t as C};
@@ -1 +0,0 @@
1
- import{F as o}from"./FullCompose-BACzjpTB.js";import"./index-Dtovse-L.js";import"./ErrorState-PNI7QSLU.js";import"./index-CyocVpgw.js";import"./useMessageBodyContent-DIF3dieb.js";import"./useSignature-B8GSTQOi.js";import"./account-form-helpers-DhckT_PN.js";import"./useDebouncedValue-BSAyBygv.js";import"./sections-45KeddjZ.js";import"./confirm-dialog-WrJoQuYb.js";const c=o;export{c as component};
@@ -1 +0,0 @@
1
- import{F as o}from"./FullCompose-BACzjpTB.js";import"./index-Dtovse-L.js";import"./ErrorState-PNI7QSLU.js";import"./index-CyocVpgw.js";import"./useMessageBodyContent-DIF3dieb.js";import"./useSignature-B8GSTQOi.js";import"./account-form-helpers-DhckT_PN.js";import"./useDebouncedValue-BSAyBygv.js";import"./sections-45KeddjZ.js";import"./confirm-dialog-WrJoQuYb.js";const c=o;export{c as component};
@@ -1 +0,0 @@
1
- import{F as o}from"./FullCompose-BACzjpTB.js";import"./index-Dtovse-L.js";import"./ErrorState-PNI7QSLU.js";import"./index-CyocVpgw.js";import"./useMessageBodyContent-DIF3dieb.js";import"./useSignature-B8GSTQOi.js";import"./account-form-helpers-DhckT_PN.js";import"./useDebouncedValue-BSAyBygv.js";import"./sections-45KeddjZ.js";import"./confirm-dialog-WrJoQuYb.js";const c=o;export{c as component};
@@ -1 +0,0 @@
1
- import{F as o}from"./FullCompose-BACzjpTB.js";import"./index-Dtovse-L.js";import"./ErrorState-PNI7QSLU.js";import"./index-CyocVpgw.js";import"./useMessageBodyContent-DIF3dieb.js";import"./useSignature-B8GSTQOi.js";import"./account-form-helpers-DhckT_PN.js";import"./useDebouncedValue-BSAyBygv.js";import"./sections-45KeddjZ.js";import"./confirm-dialog-WrJoQuYb.js";const c=o;export{c as component};
@@ -1 +0,0 @@
1
- import{j as t,b5 as se,h as ae,i as ne,bl as ie,bm as re,r as x,bn as oe,bo as le,bp as ce,L as G,f as S,bq as de,aM as ue,g as me,br as pe,bs as xe,a3 as fe,aH as Q,aI as J,c as V,K as he,bt as ge,ae as be,af as ve,bu as je,bv as ye,u as Ne,d as Ce,aP as Se,aR as Fe}from"./index-Dtovse-L.js";import{S as Ie}from"./settings-screen-Bm-R0ESO.js";import{E as H,f as we}from"./ErrorState-PNI7QSLU.js";import{B as Me}from"./bottom-sheet-BPiS9aBo.js";import{u as ke,a as Re}from"./useLabels-qT2MGxVA.js";import{b as Ee,N as k,p as Te,u as De,r as Oe,a as W,S as _,c as Ae,n as Le,f as $e,d as Pe,e as ze,g as He,h as Ue,i as _e}from"./useFilters-R3V1TB7X.js";import{C as U}from"./circle-check-DE9CwgTP.js";import"./avatar-CCaAcetc.js";import"./chevron-left-DV5pp97l.js";import"./menu-Bk7fxS2w.js";import"./circle-help--jGrrMan.js";const qe=e=>{const s=se(e);return s!==void 0&&s>=400&&s<500};function q({title:e,error:s,onRetry:n,reportHref:i}){return t.jsxs("div",{className:"space-y-1",children:[t.jsx(H,{variant:"inline",title:e,error:s,onRetry:qe(s)?void 0:n}),t.jsx("a",{href:i(we(s)),target:"_blank",rel:"noreferrer",className:"text-xs text-accent hover:underline",children:"Report an issue"})]})}const Be=(e,s)=>{const n=ae(),i=ne({...re(),onSuccess:()=>{e&&(n.invalidateQueries({queryKey:Ee(e)}),s&&n.invalidateQueries({queryKey:ie({path:{accountId:e,filterId:s}})}))}}),{mutate:c}=i;return{updateFilter:x.useCallback(d=>{!e||!s||c({path:{accountId:e,filterId:s},body:d})},[e,s,c]),isPending:i.isPending,isSuccess:i.isSuccess,isError:i.isError,error:i.error,reset:i.reset}},Ke=(e,s=!1)=>({clauses:e.literalClauses.map((i,c)=>({id:`clause-${c}`,field:i.field,value:i.value})),matchOperator:e.matchOperator==="And"?"all":"any",widen:e.hasAnchor?{anchorCount:1,...s?{inactive:!0}:{}}:void 0,moveMailboxId:e.actionMailboxId!==k?e.actionMailboxId:void 0,labelId:e.actionLabelId!==k?e.actionLabelId:void 0,scope:e.scope==="Temporary"?"until":"standing",until:e.scope==="Temporary"?Ge(e.expiresAt):void 0,name:e.name}),Ge=e=>{if(!e)return"";const s=Date.parse(e);if(Number.isNaN(s))return"";const n=new Date(s),i=c=>String(c).padStart(2,"0");return`${n.getFullYear()}-${i(n.getMonth()+1)}-${i(n.getDate())}`},B=e=>JSON.stringify({clauses:e.clauses.map(s=>[s.field,s.value]),operator:e.matchOperator,move:e.moveMailboxId??null,label:e.labelId??null,widen:e.widen?e.widen.inactive?"inactive":"active":"none"}),Y=(e,s)=>B(e)!==B(s),K=e=>JSON.stringify({scope:e.scope==="until"?"until":"standing",until:e.scope==="until"?e.until??"":""}),X=(e,s)=>K(e)!==K(s),Qe=(e,s)=>{const n={},i=(e.name??"").trim();return i!==(s.name??"").trim()&&(n.name=i),Y(e,s)&&(n.matchOperator=e.matchOperator==="all"?"And":"Or",n.literalClauses=e.clauses.map(c=>({field:c.field,value:c.value})),n.actionMailboxId=e.moveMailboxId??k,n.actionLabelId=e.labelId??k),X(e,s)&&(n.scope=e.scope==="until"?"Temporary":"Standing",e.scope==="until"&&(n.expiresAt=Te(e.until??""))),n};function Je({accountId:e,filter:s,folders:n,delimiter:i,labels:c,semanticUnavailable:j=!1,onClose:d}){const g=x.useMemo(()=>Ke(s,j),[s,j]),[p,l]=x.useState(g),[m,y]=x.useState(),[F,r]=x.useState(!1),N=x.useRef(0),{count:h}=De(e,Oe(p)),f=Be(e,s.filterId),b=W(e),{createFolderIn:C}=oe(e),{createLabel:v}=ke(e),I=async o=>{const a=await v(o);return{id:a.labelId,name:a.name,color:a.color}},w=()=>y({mode:"add",draft:{field:_[0],value:""}}),R=o=>{const a=p.clauses.find(M=>M.id===o);a&&y({mode:"edit",clauseId:o,draft:{field:a.field,value:a.value}})},E=o=>y(a=>a&&{...a,draft:{...a.draft,field:o}}),T=o=>y(a=>a&&{...a,draft:{...a.draft,value:o}}),D=()=>{if(!m)return;const o=m.draft.field,a=Le(o,m.draft.value);a!==""&&(l(M=>m.mode==="edit"&&m.clauseId?{...M,clauses:M.clauses.map(z=>z.id===m.clauseId?{id:z.id,field:o,value:a}:z)}:(N.current+=1,{...M,clauses:[...M.clauses,{id:`new-${N.current}`,field:o,value:a}]})),y(void 0))},L=o=>l(a=>({...a,clauses:a.clauses.filter(M=>M.id!==o)})),O=o=>l(a=>({...a,matchOperator:o})),$=o=>l(a=>({...a,moveMailboxId:o||void 0})),u=o=>l(a=>({...a,labelId:o||void 0})),A=o=>l(a=>({...a,name:o})),P=o=>l(a=>({...a,scope:o,until:o==="until"?a.until:void 0})),Z=o=>l(a=>({...a,until:o})),ee=()=>{const o=Y(p,g)||X(p,g),a=Qe(p,g);if(Object.keys(a).length===0){d();return}r(o),f.updateFilter(a)},te=()=>b.start(Ae(p));return b.isStarting||b.isRunning||b.isDone?t.jsx(Xe,{progress:b.progress,isDone:b.isDone,onClose:d}):f.isPending?t.jsx(Ve,{}):f.isError?t.jsx(Ze,{onRetry:f.reset,onClose:d}):f.isSuccess?F?t.jsx(Ye,{preview:le(h),blocked:h.status!=="ready"||h.stale===!0,onReapply:te,onClose:d}):t.jsx(We,{onClose:d}):t.jsx(ce,{rule:p,folders:n,delimiter:i,labels:c,preview:h,semanticAvailable:!1,clauseFields:_,anchorLocked:!0,clauseEdit:m,onStartAddClause:w,onStartEditClause:R,onRemoveClause:L,onChangeDraftField:E,onChangeDraftValue:T,onSubmitClause:D,onCancelClause:()=>y(void 0),onChangeMatchOperator:O,onChangeMove:$,onCreateFolder:C,onChangeLabel:u,onCreateLabel:I,onChangeName:A,onChangeScope:P,onChangeUntil:Z,onCommit:ee,onCancel:d})}function Ve(){return t.jsxs("div",{className:"flex flex-col items-center gap-3 px-5 py-10 text-center",children:[t.jsx(G,{className:"size-8 animate-spin text-accent-2"}),t.jsx("p",{className:"text-sm font-medium text-fg",children:"Saving changes…"})]})}function We({onClose:e}){return t.jsxs("div",{className:"flex flex-col items-center gap-3 px-5 py-8 text-center",children:[t.jsx(U,{className:"size-8 text-positive"}),t.jsx("p",{className:"text-sm font-medium text-fg",children:"Filter updated"}),t.jsx(S,{variant:"primary",onClick:e,className:"mt-2",children:"Done"})]})}function Ye({preview:e,blocked:s,onReapply:n,onClose:i}){return t.jsxs("div",{className:"flex flex-col items-center gap-3 px-5 py-8 text-center",children:[t.jsx(U,{className:"size-8 text-positive"}),t.jsx("p",{className:"text-sm font-medium text-fg",children:"Rule saved"}),t.jsxs("p",{className:"max-w-xs text-xs text-fg-muted",children:["New mail follows the rule automatically. ",e," — move the mail already in your mailbox too?"]}),t.jsxs("div",{className:"mt-2 flex gap-2",children:[t.jsx(S,{variant:"primary",onClick:n,disabled:s,children:"Move existing mail"}),t.jsx(S,{variant:"ghost",onClick:i,children:"Not now"})]})]})}function Xe({progress:e,isDone:s,onClose:n}){const i=e.state==="Failed";return t.jsxs("div",{className:"flex flex-col items-center gap-3 px-5 py-8 text-center",children:[s?i?t.jsx("span",{className:"text-sm font-semibold text-danger",children:"Move failed"}):t.jsx(U,{className:"size-8 text-positive"}):t.jsx(G,{className:"size-8 animate-spin text-accent-2"}),!s&&t.jsx("p",{className:"text-sm font-medium text-fg",children:"Moving existing mail…"}),s&&!i&&t.jsxs("div",{className:"text-sm text-fg",children:[t.jsx("p",{className:"font-medium",children:"Done"}),t.jsxs("p",{className:"mt-1 text-xs text-fg-muted",children:[e.appliedCount," of ",e.matchedCount," moved",e.failedCount>0?` · ${e.failedCount} failed`:"","."]})]}),s&&i&&t.jsx("p",{className:"max-w-xs text-xs text-fg-muted",children:e.errorMessage||"Something went wrong. Please try again."}),s&&t.jsx(S,{variant:"primary",onClick:n,className:"mt-2",children:"Done"})]})}function Ze({onRetry:e,onClose:s}){return t.jsxs("div",{className:"flex flex-col items-center gap-3 px-5 py-8 text-center",children:[t.jsx("p",{className:"text-sm font-medium text-danger",children:"Couldn't save changes"}),t.jsx("p",{className:"max-w-xs text-xs text-fg-muted",children:"Please try again."}),t.jsxs("div",{className:"mt-2 flex gap-2",children:[t.jsx(S,{variant:"primary",onClick:e,children:"Try again"}),t.jsx(S,{variant:"ghost",onClick:s,children:"Not now"})]})]})}function et({accountId:e,filter:s,folders:n,delimiter:i,labels:c,semanticUnavailable:j,onClose:d}){const g=de(),p=t.jsx(Je,{accountId:e,filter:s,folders:n,delimiter:i,labels:c,semanticUnavailable:j,onClose:d});return g?t.jsx(ue,{open:!0,onClose:d,title:"Filter rule",children:p}):t.jsx(Me,{open:!0,onClose:d,label:"Filter rule",dismissLabel:"Dismiss filter rule",children:p})}const tt=e=>{switch(e.kind){case"queuing":case"running":return"Running over the inbox…";case"done":return e.matched===0?"Done. Nothing in the inbox matched.":`Done. Filed ${e.applied} of ${e.matched} matching messages in the inbox.`;case"failed":return}};function st({filters:e,mailboxName:s,labelById:n,onEdit:i,onDelete:c,deletingFilterId:j,onToggle:d,togglingFilterId:g,onRunNow:p,runFilterId:l,runStatus:m,semanticUnavailable:y=!1,now:F=Date.now()}){return e.length===0?t.jsx("p",{className:"py-6 text-sm text-fg-muted",children:"No filters yet. Select a few messages in the inbox and choose Organize to make one."}):t.jsx("ul",{className:"divide-y divide-line rounded-md border border-line",children:e.map(r=>{const N=$e(r,F),h=N==="Expired",f=N==="Disabled",b=f?Pe(r):void 0,C=r.actionMailboxId!==k?s(r.actionMailboxId):void 0,v=r.actionLabelId!==k?n.get(r.actionLabelId):void 0,I=ze(r.expiresAt),w=l===r.filterId?m:void 0,R=w?.kind==="queuing"||w?.kind==="running",E=w?tt(w):void 0,T=N==="Active"&&(r.actionMailboxId!==k||r.actionLabelId!==k);return t.jsxs("li",{className:"flex items-start gap-3 px-3 py-2.5",children:[t.jsxs("button",{type:"button",onClick:()=>i(r.filterId),"aria-label":`Edit filter ${r.name}`,className:"min-w-0 flex-1 rounded-sm text-left hover:opacity-80",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("span",{className:`truncate text-sm font-medium ${h||f?"text-fg-muted":"text-fg"}`,children:r.name}),t.jsx(me,{tone:h?"neutral":f?"warning":"positive",dot:!0,children:N})]}),t.jsxs("p",{className:"mt-0.5 text-xs text-fg-subtle",children:[C?`Moves matches to ${C}`:"No move action",r.scope==="Temporary"&&I?h?` · expired ${I}`:` · until ${I}`:r.scope==="Standing"?" · always":""]}),b&&t.jsx("p",{className:"mt-0.5 text-xs text-warning",children:b}),E&&t.jsx("p",{role:"status",className:"mt-0.5 text-xs text-fg-muted",children:E}),(r.hasAnchor||v)&&t.jsxs("div",{className:"mt-1.5 flex flex-wrap gap-1.5",children:[r.hasAnchor&&t.jsx(pe,{widen:{anchorCount:1,...y?{inactive:!0}:{}}}),v&&t.jsx(xe,{label:{labelId:v.id,name:v.name,color:v.color}})]})]}),T&&t.jsx(S,{variant:"ghost",size:"sm",onClick:()=>p(r.filterId),disabled:R,"aria-label":`Run now: filter ${r.name}`,children:R?"Running…":"Run now"}),!h&&t.jsx(S,{variant:"ghost",size:"sm",onClick:()=>d(r.filterId,f),disabled:g===r.filterId,"aria-label":`${f?"Turn on":"Turn off"} filter ${r.name}`,children:f?"Turn on":"Turn off"}),t.jsx(S,{variant:"ghost",size:"sm",icon:t.jsx(fe,{className:"size-4 text-danger"}),onClick:()=>c(r.filterId),disabled:j===r.filterId,"aria-label":`Delete filter ${r.name}`})]},r.filterId)})})}function at(e){return Q(J({title:`Filter toggle: ${e}`,errorMessage:e}))}function nt(e){return Q(J({title:`Filter run now: ${e}`,errorMessage:e}))}const it=e=>{if(e.failure)return{kind:"failed",error:e.failure.error};if(e.isStarting)return{kind:"queuing"};if(e.isDone)return e.progress.state==="Failed"?{kind:"failed",error:new Error(e.progress.errorMessage||"The run over the inbox failed.")}:{kind:"done",matched:e.progress.matchedCount,applied:e.progress.appliedCount};if(e.isRunning)return{kind:"running"}},rt=t.jsxs("div",{className:"space-y-3",children:[t.jsxs("p",{children:["Filters are the standing rules Organize creates. A"," ",t.jsx("strong",{children:"Standing"})," filter keeps working on new mail; a"," ",t.jsx("strong",{children:"Temporary"})," one stops on its own at the date you picked."]}),t.jsx("p",{children:"An expired filter isn't deleted the instant it lapses — it stays here, marked Expired, so you can see what it did and when it stopped."}),t.jsx("p",{children:"A filter that can't do its job turns itself off and says why, for example when its folder no longer exists. Turn it back on once that is fixed."})]});function ot({account:e}){const s=e.accountId,{filters:n,isPending:i,isError:c,error:j,refetch:d}=He(s),{deleteFilter:g,deletingFilterId:p}=Ue(s),l=_e(s),m=W(s),{startForFilter:y}=m,[F,r]=x.useState(),N=x.useCallback(u=>{r(u),y(u)},[y]),h=it(m),[f,b]=x.useState(),{data:C}=V({...he({path:{accountId:s}}),staleTime:1/0}),v=ge(),I=x.useMemo(()=>be(e.folderAppointments),[e.folderAppointments]),w=x.useCallback(u=>{const A=C?.items.find(P=>P.mailboxId===u);if(A)return ve(A,I.get(u),v)},[C?.items,I,v]),R=x.useMemo(()=>je({mailboxes:C?.items??[],folderAppointments:e.folderAppointments,translator:v}),[C?.items,e.folderAppointments,v]),E=ye(C?.items??[]),{labels:T}=Re(s),D=x.useMemo(()=>T.map(u=>({id:u.labelId,name:u.name,color:u.color})),[T]),L=x.useMemo(()=>new Map(D.map(u=>[u.id,u])),[D]),O=n.find(u=>u.filterId===f),$=n.find(u=>u.filterId===F)?.name;return t.jsxs("section",{className:"space-y-2",children:[t.jsx("h2",{className:"text-sm font-semibold text-fg",children:e.email}),O&&t.jsx(et,{accountId:s,filter:O,folders:R,delimiter:E,labels:D,onClose:()=>b(void 0)}),i?t.jsx("div",{className:"h-16 animate-pulse rounded-md border border-line bg-surface","aria-busy":"true","aria-label":`Loading filters for ${e.email}`}):c?t.jsx(H,{variant:"inline",title:`Couldn't load filters for ${e.email}`,error:j,onRetry:()=>{d()}}):t.jsxs(t.Fragment,{children:[l.isError&&t.jsx(q,{title:l.enabling?"Couldn't turn the filter on":"Couldn't turn the filter off",error:l.error,onRetry:l.retry,reportHref:at}),F&&h?.kind==="failed"&&t.jsx(q,{title:`Couldn't run ${$??"the filter"} over the inbox`,error:h.error,onRetry:m.failure?.kind==="statusUnreadable"?m.refreshStatus:()=>N(F),reportHref:nt}),t.jsx(st,{filters:n,mailboxName:w,labelById:L,onEdit:b,onDelete:g,deletingFilterId:p,onToggle:l.toggleFilter,togglingFilterId:l.togglingFilterId,onRunNow:N,runFilterId:F,runStatus:h})]})]})}function vt(){const e=Ne(),[s,n]=x.useState(!0),{data:i,isPending:c,isError:j,error:d,refetch:g}=V(Ce()),p=l=>{const m=Fe[l];m&&e({to:m})};return t.jsx(Ie,{items:Se,activeId:"filters",title:"Filters",description:"Standing and temporary rules created by Organize, per account.",help:rt,helpOpen:s,onToggleHelp:()=>n(l=>!l),onSelect:p,onBackToMail:()=>{e({to:"/mail"})},children:c?t.jsx("div",{className:"h-24 animate-pulse rounded-sm border border-line bg-surface","aria-busy":"true","aria-label":"Loading accounts"}):j?t.jsx(H,{title:"Couldn't load accounts",error:d,onRetry:()=>{g()}}):i.accounts.length===0?t.jsx("p",{className:"py-12 text-sm text-fg-muted",children:"No accounts configured."}):t.jsx("div",{className:"space-y-8",children:i.accounts.map(l=>t.jsx(ot,{account:l},l.accountId))})})}export{ot as AccountFilters,vt as component};
@@ -1 +0,0 @@
1
- import{j as o,O as i}from"./index-Dtovse-L.js";import{a as m}from"./MailShell-DzKQC7Uj.js";import{F as r}from"./FlaggedPane-D0pQWXT9.js";import{a as p}from"./search-token-index-BXtgewDi.js";import{u as e}from"./search-mirror-DSVQGDLi.js";import"./FullCompose-BACzjpTB.js";import"./ErrorState-PNI7QSLU.js";import"./index-CyocVpgw.js";import"./useMessageBodyContent-DIF3dieb.js";import"./useSignature-B8GSTQOi.js";import"./account-form-helpers-DhckT_PN.js";import"./useDebouncedValue-BSAyBygv.js";import"./sections-45KeddjZ.js";import"./confirm-dialog-WrJoQuYb.js";import"./useSearchTokenContext-CnVweHh1.js";import"./kbd-Ccl_4UMN.js";import"./search-scope-B5-OK3Cq.js";import"./MailListHeader-Dp-YNlPj.js";import"./roving-focus-BgNxAjAj.js";import"./popover-menu-CG5nGI0G.js";import"./mail-BD9CFExB.js";import"./avatar-CCaAcetc.js";import"./EmptyState-Dw5-fMm4.js";import"./undo-2-UQEFkwhb.js";import"./download-BoHBLdA7.js";import"./useCalendarFreeBusy-BgHa55K-.js";import"./calendar-format-CDiJYM60.js";import"./useQueries-DH9StZ-W.js";import"./useCalendars-O5ZvqPWu.js";import"./map-pin-DM-UwFHl.js";import"./calendar-suggestion-BQoWPMtl.js";import"./attendee-row-BRiEaasS.js";import"./minus-BUHU6kmL.js";import"./clock-CwmO_JCY.js";import"./calendar-clash-strip-7S3XyUIT.js";import"./bell-off-CpcOtCIq.js";import"./shield-check-B_rWkRQY.js";import"./calendar-report-C-w9d_X_.js";import"./useFilters-R3V1TB7X.js";import"./checkbox-BwzvnbNT.js";import"./useLayoutTier-BT9E1-ej.js";import"./menu-Bk7fxS2w.js";import"./MailViewChrome-CP2oa-r7.js";import"./refresh-cw-DV6lCoUu.js";import"./wizard-selection-zWa1qc6-.js";function _(){const t=p();return e({to:"/mail/flagged"}),o.jsx(r,{thread:t,children:o.jsx(m,{phone:o.jsx(r.Phone,{}),list:o.jsx(r.List,{}),reading:o.jsx(i,{}),intelligence:o.jsx(r.Intelligence,{}),hasThread:!!t})})}export{_ as component};
@@ -1 +0,0 @@
1
- import{j as e,f as j,a3 as B,bw as W,r as c,aM as X,X as Y,aU as he,az as J,a2 as xe,aX as H,bx as fe,ay as pe,aB as ge,B as z,aW as be,by as ve,h as Z,Q as ee,o as se,bz as ye,bA as je,aT as Ne,P as ke,bB as Ce,bC as _,bD as we,bE as Se,bF as te,bG as Me,bH as Q,bn as ae,bt as re,bu as Ie,af as K,ae as ne,L as G,bI as q,bJ as Ee,ar as De,bK as Ae,u as Oe,c as ie,d as Te,aP as Re,aR as Fe,K as Pe,i as V,s as $e,bL as Le,bM as ze,bN as _e,a$ as Be,bO as Ke,bP as Ge}from"./index-Dtovse-L.js";import{P as He}from"./pencil-C8Yuq6zp.js";import{S as Qe}from"./settings-screen-Bm-R0ESO.js";import{E as oe}from"./ErrorState-PNI7QSLU.js";import{f as qe}from"./folder-failure-CqkVSsrb.js";import"./avatar-CCaAcetc.js";import"./chevron-left-DV5pp97l.js";import"./menu-Bk7fxS2w.js";import"./circle-help--jGrrMan.js";const Ve=({label:s,onRename:t,onDelete:a,deleteBlockedReason:l,renameLabel:u=m=>`Rename ${m}`,deleteLabel:r=m=>`Delete ${m}`})=>{const m=l?`${r(s)} — ${l}`:r(s);return e.jsxs("span",{className:"flex shrink-0 items-center gap-0.5 pr-2",children:[e.jsx(j,{variant:"ghost",size:"sm",icon:e.jsx(He,{className:"size-3.5"}),"aria-label":u(s),onClick:t}),e.jsx("span",{title:l,children:e.jsx(j,{variant:"ghost",size:"sm",icon:e.jsx(B,{className:"size-3.5"}),"aria-label":m,disabled:l!==void 0,onClick:a})})]})},Ue=({folders:s,onRename:t,onDelete:a,onCreateFolder:l,delimiter:u,labels:r})=>{const m=new Map(s.map(o=>[o.id,o]));return e.jsx(W,{folders:s,onCreateFolder:l,delimiter:u,labels:{treeAriaLabel:"Your folders",optionLabel:o=>o.label,...r},rowFailure:o=>m.get(o.id)?.failure,rowActions:o=>{const i=m.get(o.id);return i?e.jsx(Ve,{label:i.label,deleteBlockedReason:i.deleteBlockedReason,renameLabel:r?.rename,deleteLabel:r?.remove,onRename:()=>t(i),onDelete:()=>a(i)}):null}})},We=({open:s,folderLabel:t,defaultLabel:a,name:l,onNameChange:u,onSubmit:r,onClose:m,pending:o=!1,error:i})=>{const d=c.useId(),p=`Rename ${t}`;return s?e.jsxs(X,{open:s,onClose:m,title: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:p}),e.jsx(j,{variant:"ghost",size:"sm",icon:e.jsx(Y,{className:"size-3.5"}),onClick:m,"aria-label":"Cancel"})]}),e.jsxs("div",{className:"space-y-3 px-5 py-4",children:[e.jsxs("div",{children:[e.jsx(he,{htmlFor:d,children:"Folder name"}),e.jsx(J,{id:d,value:l,placeholder:a,onChange:g=>u(g.target.value),onKeyDown:g=>{g.key==="Enter"&&(g.preventDefault(),r())}})]}),e.jsxs("p",{className:"text-xs text-fg-muted",children:["Shown everywhere in Remit. Leave it blank to use"," ",e.jsx("span",{className:"font-medium text-fg",children:a}),"."]}),i&&e.jsx("p",{className:"text-xs text-danger",role:"alert",children:i})]}),e.jsxs("footer",{className:"flex items-center justify-end gap-2 border-t border-line px-5 py-3",children:[e.jsx(j,{variant:"secondary",size:"sm",onClick:m,children:"Cancel"}),e.jsx(j,{variant:"primary",size:"sm",onClick:r,disabled:o,children:o?"Saving…":"Save name"})]})]}):null},Xe=["inbox","drafts","sent","archive","junk","trash"],U="",Ye={mailboxId:null,source:"None"};function Je(s){const t=s.messageCount===1?"msg":"msgs";return`${H(s.providerPath,s.hierarchyDelimiter)} · ${s.messageCount} ${t}`}const le=s=>`${s} ${s===1?"message":"messages"}`,Ze=(s,t)=>s==="Appointed"?"Chosen by you":s==="Flagged"?`The mail server marks it as ${t}`:s==="Reserved"?"The account's own INBOX":"Matched by name, not confirmed";function es({role:s,folders:t,appointment:a,displayName:l,onAppoint:u,onRename:r}){const[m,o]=c.useState(l),i=c.useRef(null),d=c.useRef(!1),p=c.useId(),{mailboxId:g,source:v,staleFolderPath:y}=a,h=t.find(N=>N.mailboxId===g)??null,f=be(s),O=h!=null&&m.trim()!==l.trim();c.useEffect(()=>{!d.current||v==="Proposed"||(d.current=!1,i.current?.focus())},[v]);const I=(()=>{if(v==="None"){const N=s==="trash"?" Deleting mail needs one.":"";return e.jsx("span",{id:p,className:"pl-[7.5rem] text-xs text-fg-muted",children:`Not set — pick the folder this account uses for ${f}.${N}`})}return v==="Stale"||!h?null:e.jsx("span",{id:p,className:"truncate pl-[7.5rem] text-2xs text-fg-subtle",title:h.providerPath,children:`${Ze(v,f)} · ${h.providerPath} · ${le(h.messageCount)}`})})(),w=s==="trash"?" Deleting mail is stopped until you pick another one.":h?` reader is using ${H(h.providerPath,h.hierarchyDelimiter)} instead.`:"",A=`The folder you chose for ${f}${y?` — ${y} —`:""} is gone from the mail server.${w}`;return e.jsxs("div",{className:"flex flex-col gap-1 border-b border-line px-row-inset py-2.5 last:border-b-0",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("span",{className:"flex w-28 shrink-0 items-center gap-2 text-sm font-medium text-fg",children:[fe(s),f]}),e.jsxs(pe,{ref:i,className:"w-56 shrink-0",value:h?.mailboxId??U,"aria-label":`Folder for ${f}`,"aria-describedby":I||v==="Stale"?p:void 0,onChange:N=>u(s,N.target.value),children:[!h&&e.jsx("option",{value:U,disabled:!0,children:"Choose a folder"}),t.map(N=>e.jsx("option",{value:N.mailboxId,children:Je(N)},N.mailboxId))]}),v==="Proposed"&&h&&e.jsx(j,{variant:"secondary",size:"sm",className:"shrink-0",onClick:()=>{d.current=!0,u(s,h.mailboxId)},children:`Set as ${f}`}),h&&e.jsxs(e.Fragment,{children:[e.jsx(J,{className:"flex-1",value:m,placeholder:f,"aria-label":`Display name for ${f}`,onChange:N=>o(N.target.value)}),O&&e.jsx(j,{variant:"ghost",size:"sm",className:"shrink-0",icon:e.jsx(ge,{className:"size-4"}),"aria-label":"Save display name",onClick:()=>r(h.mailboxId,m)})]})]}),I,v==="Stale"&&e.jsx(z,{tone:"warning",variant:"soft",className:"ml-[7.5rem]",children:e.jsxs("span",{className:"flex flex-wrap items-center gap-2",children:[e.jsx("span",{id:p,className:"flex-1",children:A}),e.jsx(j,{variant:"secondary",size:"sm",className:"shrink-0",onClick:()=>i.current?.focus(),children:"Pick a folder"})]})})]})}function ss(){return e.jsxs("div",{className:"space-y-3",children:[e.jsx("p",{children:"Each canonical role — Inbox, Drafts, Sent, Archive, Spam, Trash — points at one of your account's real folders. Pick the one that actually holds the mail; the message counts tell real folders from empty look-alikes."}),e.jsx("p",{children:`Appointing a folder to a role here doesn't touch any other role, and doesn't move or rename anything on the server — it just tells Remit which folder to treat as e.g. "Drafts" everywhere (sidebar, unread badges, the compose flow).`}),e.jsxs("p",{children:[e.jsx("strong",{className:"text-fg",children:"Your folders"})," is the account's real hierarchy. Open a folder to see what's inside it, make a new one where you're looking, and rename or delete any of them from its row."]})]})}function ts({accountEmail:s,folders:t,appointments:a,displayNames:l={},onAppoint:u,onRename:r}){const m=new Set(Object.values(a).map(i=>i.mailboxId).filter(i=>i!=null)),o=t.filter(i=>!m.has(i.mailboxId));return e.jsxs("section",{className:"space-y-3",children:[e.jsxs("header",{className:"space-y-1",children:[e.jsxs("h2",{className:"text-sm font-semibold text-fg",children:["Folder roles — ",s]}),e.jsx("p",{className:"text-xs text-fg-muted",children:"Each row says where its answer came from — your choice, the mail server's own flag, or a name reader matched."})]}),e.jsx("div",{className:"rounded-sm border border-line bg-surface",children:Xe.map(i=>{const d=a[i]??Ye;return e.jsx(es,{role:i,folders:t,appointment:d,displayName:d.mailboxId?l[d.mailboxId]??"":"",onAppoint:u,onRename:r},i)})}),o.length>0&&e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("h3",{className:"text-xs font-medium text-fg-muted",children:"Other folders"}),e.jsx("ul",{className:"rounded-sm border border-line bg-surface",children:o.map(i=>e.jsxs("li",{className:"flex items-center gap-2 border-b border-line px-row-inset py-2 text-sm text-fg last:border-b-0",children:[e.jsx(xe,{className:"size-4 shrink-0 text-fg-subtle"}),e.jsx("span",{className:"truncate",children:H(i.providerPath,i.hierarchyDelimiter)}),e.jsx("span",{className:"ml-auto shrink-0 text-2xs text-fg-subtle",children:le(i.messageCount)})]},i.mailboxId))})]})]})}const as=12e4,rs=2e3,ns="This folder is no longer in the account's folder list, so nothing was deleted.",ce=(s,t)=>{const a=s.find(l=>l.mailboxId===t);if(!a)throw new Error(ns);return a},is=(s,t)=>ce(s,t).lastSyncedAt??0;async function os({readMailboxes:s,mailboxId:t,since:a,signal:l,segmentMs:u=as,pollIntervalMs:r=rs,delay:m=ve,now:o=Date.now}){const i=o()+u;for(;;){l?.throwIfAborted();const d=ce(await s(),t);if((d.lastSyncedAt??0)>a)return{status:"fresh",messageCount:d.messagesTotal};if(o()>=i)return{status:"pending"};await m(r,l)}}const de=50,ls=s=>s instanceof Error?s.message:"Something went wrong.",$=s=>s.then(t=>({ok:!0,value:t}),t=>({ok:!1,error:ls(t)})),cs=async(s,t,a,l)=>{const u=[];let r;for(let m=0;m<de;m+=1){if(l.aborted)return u;const{data:o}=await te({path:{mailboxId:s},query:{order:"desc",continuationToken:r},throwOnError:!0});for(const i of o.items)if(!i.isDeleted&&!t.has(i.messageId)&&!u.includes(i.messageId)&&(u.push(i.messageId),u.length>=a))return u;if(!o.continuationToken)break;r=o.continuationToken}return u},ds=async(s,t)=>{let a=0,l;for(let u=0;u<de;u+=1){if(t.aborted)return a;const{data:r}=await te({path:{mailboxId:s},query:{order:"desc",continuationToken:l},throwOnError:!0});for(const m of r.items)m.isDeleted||(a+=1);if(!r.continuationToken)break;l=r.continuationToken}return a};function ms({accountId:s,mailboxId:t,onDeleted:a}){const l=Z(),[u,r]=c.useState("idle"),[m,o]=c.useState(null),[i,d]=c.useState(),[p,g]=c.useState(),v=c.useRef(null),y=c.useRef(void 0),h=c.useCallback(()=>{l.invalidateQueries({queryKey:ee({path:{accountId:s}})}),l.invalidateQueries({queryKey:se()})},[l,s]),f=c.useCallback(async()=>{r("deleting");const k=await $(ye({path:{accountId:s,mailboxId:t},throwOnError:!0}));if(!k.ok){d(k.error),r("error");return}h(),r("done"),a()},[s,t,h,a]),O=c.useCallback(()=>je({path:{accountId:s},throwOnError:!0}).then(({data:k})=>k.items.find(S=>S.mailboxId===t)?.messageCount??0),[s,t]),I=c.useCallback(()=>l.fetchQuery({...Ne({path:{accountId:s}}),staleTime:0}).then(k=>k.mailboxes??[]),[l,s]),w=c.useCallback(async()=>{const k=new AbortController;v.current=k;const{signal:S}=k;r("checking"),d(void 0);const M=y.current!==void 0,C=await $((async()=>(M||(S.throwIfAborted(),y.current=is(await I(),t),S.throwIfAborted(),g(Date.now()),await ke({path:{accountId:s},throwOnError:!0})),os({readMailboxes:I,mailboxId:t,since:y.current??0,signal:S})))());return S.aborted?(r("idle"),y.current=void 0,{status:"failed"}):C.ok?C.value.status==="pending"?(r("check-stalled"),{status:"pending"}):(y.current=void 0,C.value.messageCount>0?(r("idle"),h(),{status:"blocked",messageCount:C.value.messageCount}):(await f(),{status:"deleted"})):(y.current=void 0,d(C.error),r("error"),{status:"failed"})},[s,t,I,f,h]),A=c.useCallback(()=>{v.current?.abort()},[]),N=c.useCallback(async k=>{const S=new AbortController;v.current=S;const{signal:M}=S;r("moving"),d(void 0);const C=await $(O());if(M.aborted)return;if(!C.ok){d(C.error),r("error");return}let x=Ce(C.value);o(x);const E=new Set;for(;;){if(M.aborted)return;const n=await $(cs(t,E,Me,M));if(M.aborted)return;if(!n.ok){x=_(x,n.error),o(x),d(n.error),r("error");return}const b=n.value;if(b.length===0)break;const T=await $(we({body:{messageIds:b,destinationMailboxId:k},throwOnError:!0}));if(M.aborted)return;if(!T.ok){x=_(x,T.error),o(x),d(T.error),r("error");return}for(const P of b)E.add(P);x=Se(x,b.length),o(x)}const D=await $(ds(t,M));if(!M.aborted){if(!D.ok){x=_(x,D.error),o(x),d(D.error),r("error");return}if(D.value>0){const n=`${D.value} ${D.value===1?"email is":"emails are"} still syncing. Re-open delete to finish removing this folder.`;x=_(x,n),o(x),d(n),r("error"),h();return}await f()}},[t,O,f,h]),R=c.useCallback(()=>{v.current?.abort(),v.current=null,y.current=void 0,r("idle"),o(null),d(void 0),g(void 0)},[]);return{phase:u,progress:m,errorMessage:i,checkStartedAt:p,deleteMailbox:f,deleteIfEmpty:w,moveThenDelete:N,cancel:A,reset:R}}const L=s=>`${s} ${s===1?"email":"emails"}`;function us({open:s,accountId:t,folder:a,mailboxes:l,appointments:u,onClose:r}){const[m,o]=c.useState(()=>Q(a.messageCount)),[i,d]=c.useState(),[p,g]=c.useState(),{createFolderIn:v}=ae(t),y=re(),{phase:h,progress:f,errorMessage:O,checkStartedAt:I,deleteMailbox:w,deleteIfEmpty:A,moveThenDelete:N,cancel:R,reset:k}=ms({accountId:t,mailboxId:a.mailboxId,onDeleted:r}),[S,M]=c.useState("0:00"),C=h==="checking"||h==="check-stalled";c.useEffect(()=>{if(!C||I===void 0)return;const F=()=>M(Ae(Date.now()-I));F();const ue=setInterval(F,1e3);return()=>clearInterval(ue)},[C,I]),c.useEffect(()=>{s&&(o(Q(a.messageCount)),d(void 0),k())},[s,k]),c.useEffect(()=>{s&&g(void 0)},[s]),c.useEffect(()=>R,[R]);const x=c.useCallback(()=>{R(),r()},[R,r]),E=c.useCallback(async()=>{const F=await A();F.status==="blocked"&&(d(F.messageCount),o("choose-fate"))},[A]),D=c.useMemo(()=>Ie({mailboxes:l,folderAppointments:u,excludeMailboxId:a.mailboxId,translator:y}),[l,u,a.mailboxId,y]),n=D.find(F=>F.id===p),b=c.useMemo(()=>K(a,ne(u).get(a.mailboxId),y),[a,u,y]);if(!s)return null;const T=`Delete ${b}`,P=i??a.messageCount,me=h==="moving"?e.jsxs("div",{className:"flex flex-col items-center gap-3 px-5 py-10 text-center",children:[e.jsx(G,{className:"size-8 animate-spin text-accent-2"}),e.jsx("p",{className:"text-sm font-medium text-fg",children:"Moving emails…"}),e.jsx("p",{className:"text-xs text-fg-muted",role:"status","aria-live":"polite",children:f?q(f):"Moved 0 of 0"})]}):h==="checking"?e.jsxs("div",{className:"flex flex-col items-center gap-3 px-5 py-10 text-center",children:[e.jsx(G,{className:"size-8 animate-spin text-accent-2"}),e.jsx("p",{className:"text-sm font-medium text-fg",children:"Checking the folder on the mail server…"}),e.jsx("p",{className:"text-xs text-fg-muted",role:"status","aria-live":"polite",children:`Waiting ${S}. Nothing is deleted until the server answers.`})]}):h==="check-stalled"?e.jsxs("div",{className:"space-y-4 px-5 py-4",children:[e.jsx(z,{tone:"warning",variant:"soft",children:`The mail server hasn't reported back on this folder yet — ${S} so far. Nothing has been deleted.`}),e.jsx("p",{className:"text-xs text-fg-muted",children:"A sync covers the whole account, so a busy mailbox can take a while to come round to this folder."}),e.jsxs("div",{className:"flex justify-end gap-2",children:[e.jsx(j,{variant:"secondary",size:"sm",onClick:x,children:"Cancel"}),e.jsx(j,{size:"sm",onClick:()=>E(),children:"Keep waiting"})]})]}):h==="deleting"||h==="done"?e.jsxs("div",{className:"flex flex-col items-center gap-3 px-5 py-10 text-center",children:[e.jsx(G,{className:"size-8 animate-spin text-accent-2"}),e.jsx("p",{className:"text-sm font-medium text-fg",children:"Deleting folder…"})]}):h==="error"?e.jsxs("div",{className:"space-y-4 px-5 py-4",children:[e.jsx(z,{tone:"danger",variant:"soft",children:O??"Something went wrong. Please try again."}),f&&e.jsxs("p",{className:"text-xs text-fg-muted",children:[q(f),". Already-moved emails stay moved — re-open delete to continue with the rest."]}),e.jsx("div",{className:"flex justify-end",children:e.jsx(j,{variant:"secondary",size:"sm",onClick:x,children:"Close"})})]}):m==="confirm-empty"?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"space-y-3 px-5 py-4 text-sm text-fg-muted",children:e.jsxs("p",{children:["Delete ",e.jsx("strong",{className:"text-fg",children:b}),"? This folder is empty and will be removed from the server."]})}),e.jsxs("footer",{className:"flex items-center justify-end gap-2 border-t border-line px-5 py-3",children:[e.jsx(j,{variant:"secondary",size:"sm",onClick:x,children:"Cancel"}),e.jsx(j,{variant:"danger",size:"sm",icon:e.jsx(B,{className:"size-3.5"}),onClick:()=>E(),children:"Delete folder"})]})]}):m==="choose-fate"?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"space-y-3 px-5 py-4 text-sm text-fg-muted",children:[i!==void 0&&e.jsx(z,{tone:"warning",variant:"soft",children:`This folder is not empty: the mail server reports ${L(i)} in it. Nothing was deleted.`}),e.jsxs("p",{children:[e.jsx("strong",{className:"text-fg",children:b})," holds"," ",L(P),". What should happen to them?"]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs("button",{type:"button",onClick:()=>o("confirm-delete-all"),className:"flex w-full items-center gap-3 rounded-sm border border-line px-3 py-2.5 text-left hover:bg-surface-raised",children:[e.jsx(B,{className:"size-4 shrink-0 text-danger"}),e.jsxs("span",{className:"flex-1",children:[e.jsx("span",{className:"block text-sm font-medium text-fg",children:"Delete them with the folder"}),e.jsx("span",{className:"block text-xs text-fg-muted",children:"The emails are removed from the server and can't be recovered."})]})]}),e.jsxs("button",{type:"button",onClick:()=>o("pick-destination"),className:"flex w-full items-center gap-3 rounded-sm border border-line px-3 py-2.5 text-left hover:bg-surface-raised",children:[e.jsx(Ee,{className:"size-4 shrink-0 text-accent-2"}),e.jsxs("span",{className:"flex-1",children:[e.jsx("span",{className:"block text-sm font-medium text-fg",children:"Move them to another folder"}),e.jsx("span",{className:"block text-xs text-fg-muted",children:"Keep the emails, then delete the emptied folder."})]})]})]})]}),e.jsx("footer",{className:"flex items-center justify-end gap-2 border-t border-line px-5 py-3",children:e.jsx(j,{variant:"secondary",size:"sm",onClick:x,children:"Cancel"})})]}):m==="confirm-delete-all"?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"space-y-3 px-5 py-4 text-sm text-fg-muted",children:e.jsxs("p",{children:["Delete ",e.jsx("strong",{className:"text-fg",children:b})," and its"," ",L(P),"? The messages are removed from the server with the folder and can't be recovered."]})}),e.jsxs("footer",{className:"flex items-center justify-end gap-2 border-t border-line px-5 py-3",children:[e.jsx(j,{variant:"secondary",size:"sm",onClick:()=>o("choose-fate"),children:"Back"}),e.jsx(j,{variant:"danger",size:"sm",icon:e.jsx(B,{className:"size-3.5"}),onClick:()=>w(),children:"Delete folder and emails"})]})]}):e.jsxs("div",{className:"flex h-[26rem] flex-col",children:[e.jsxs("p",{className:"px-5 pt-4 text-sm text-fg-muted",children:["Move the ",L(P)," in"," ",e.jsx("strong",{className:"text-fg",children:b})," to:"]}),e.jsx("div",{className:"flex min-h-0 flex-1 overflow-hidden",children:e.jsx(W,{folders:D,selectedId:p,delimiter:l[0]?.hierarchyDelimiter??"/",onSelect:g,onCreateFolder:v,onCancel:()=>{g(void 0),o("choose-fate")},labels:{filterPlaceholder:"Move emails to…"}})}),n&&e.jsx("footer",{className:"shrink-0 border-t border-line p-2",children:e.jsx(j,{variant:"danger",onClick:()=>N(n.id),className:"h-11 w-full font-semibold",children:e.jsx("span",{className:"truncate",children:`Move ${L(P)} to ${n.label}`})})})]});return e.jsxs(X,{open:s,onClose:x,title:T,children:[e.jsxs("header",{className:"flex items-center gap-2 border-b border-line px-5 py-3",children:[e.jsx(De,{className:"size-4 shrink-0 text-danger"}),e.jsx("span",{className:"flex-1 text-sm font-semibold text-fg",children:T}),e.jsx(j,{variant:"ghost",size:"sm",icon:e.jsx(Y,{className:"size-3.5"}),onClick:x,"aria-label":"Cancel"})]}),me]})}function hs({account:s}){const t=Z(),a=s.accountId,l=re(),{data:u,isPending:r,isError:m,error:o,refetch:i}=ie(Pe({path:{accountId:a}})),{createFolderIn:d}=ae(a),p=V({...Le(),meta:$e(409),onSuccess:()=>{t.invalidateQueries({queryKey:se()})}}),g=V({...ze(),onSuccess:()=>{t.invalidateQueries({queryKey:ee({path:{accountId:a}})})}}),[v,y]=c.useState(),[h,f]=c.useState(),[O,I]=c.useState(""),w=c.useMemo(()=>u?.items??[],[u]),A=c.useMemo(()=>ne(s.folderAppointments),[s.folderAppointments]),N=c.useMemo(()=>w.map(n=>({id:n.mailboxId,label:K(n,A.get(n.mailboxId),l),path:n.fullPath,deleteBlockedReason:_e(n,w,s.folderAppointments).message,failure:qe(n)})),[w,A,l,s.folderAppointments]),R=(n,b)=>{p.mutate({path:{accountId:a,role:Ge[n]},body:{mailboxId:b}})},k=(n,b)=>{const T=b.trim();g.mutate({path:{accountId:a,mailboxId:n},body:{displayNameOverride:T===""?null:T}})};if(r)return e.jsx("div",{className:"h-24 animate-pulse rounded-sm border border-line bg-surface","aria-busy":"true","aria-label":`Loading folders for ${s.email}`});if(m)return e.jsx(oe,{variant:"inline",title:`Couldn't load folders for ${s.email}`,error:o,onRetry:()=>{i()}});const S=w.map(n=>({mailboxId:n.mailboxId,providerPath:n.fullPath,hierarchyDelimiter:n.hierarchyDelimiter,messageCount:n.messageCount})),M={};for(const n of s.folderAppointments){const b=Be[n.role];b&&(M[b]={mailboxId:n.mailboxId??null,source:n.source,staleFolderPath:n.staleAppointmentPath})}const C={};for(const n of w)n.displayNameOverride&&(C[n.mailboxId]=n.displayNameOverride);const x=n=>w.find(b=>b.mailboxId===n),E=x(h),D=x(v);return e.jsxs("div",{className:"space-y-4",children:[(p.isError||g.isError)&&e.jsx(z,{tone:"danger",variant:"soft",children:Ke(p.error)?"That folder is still being created on the mail server — wait for it to finish, then try again.":"Couldn't save that change. Please try again."}),e.jsx(ts,{accountEmail:s.email,folders:S,appointments:M,displayNames:C,onAppoint:R,onRename:k}),e.jsxs("section",{className:"space-y-1.5",children:[e.jsxs("h3",{className:"text-sm font-semibold text-fg",children:["Your folders — ",s.email]}),e.jsx("div",{className:"flex h-[28rem] flex-col overflow-hidden rounded-sm border border-line bg-surface",children:e.jsx(Ue,{folders:N,delimiter:w[0]?.hierarchyDelimiter??"/",onCreateFolder:d,onRename:n=>{f(n.id),I(x(n.id)?.displayNameOverride?.trim()??"")},onDelete:n=>y(n.id),labels:{treeAriaLabel:`All folders for ${s.email}`}})})]}),E&&e.jsx(We,{open:!0,folderLabel:K(E,A.get(E.mailboxId),l),defaultLabel:K({fullPath:E.fullPath,hierarchyDelimiter:E.hierarchyDelimiter},A.get(E.mailboxId),l),name:O,onNameChange:I,pending:g.isPending,error:g.isError?"Couldn't save that name. Please try again.":void 0,onSubmit:()=>{const n=O.trim();g.mutate({path:{accountId:a,mailboxId:E.mailboxId},body:{displayNameOverride:n===""?null:n}},{onSuccess:()=>f(void 0)})},onClose:()=>f(void 0)}),D&&e.jsx(us,{open:!0,accountId:a,folder:D,mailboxes:w,appointments:s.folderAppointments,onClose:()=>y(void 0)})]})}function ks(){const s=Oe(),[t,a]=c.useState(!0),{data:l,isPending:u,isError:r,error:m,refetch:o}=ie(Te()),i=d=>{const p=Fe[d];p&&s({to:p})};return e.jsx(Qe,{items:Re,activeId:"folders",title:"Folder roles",description:"Appoint which real folder fills each canonical role, per account.",help:e.jsx(ss,{}),helpOpen:t,onToggleHelp:()=>a(d=>!d),onSelect:i,onBackToMail:()=>{s({to:"/mail"})},children:u?e.jsx("div",{className:"h-24 animate-pulse rounded-sm border border-line bg-surface","aria-busy":"true","aria-label":"Loading accounts"}):r?e.jsx(oe,{title:"Couldn't load accounts",error:m,onRetry:()=>{o()}}):l.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:l.accounts.map(d=>e.jsx(hs,{account:d},d.accountId))})})}export{ks as component};
@@ -1 +0,0 @@
1
- import{j as t,an as o}from"./index-Dtovse-L.js";const n=()=>t.jsx(o,{to:"/settings/accounts"});export{n as component};
@@ -1 +0,0 @@
1
- import{j as r}from"./index-Dtovse-L.js";import{B as o}from"./BriefPane-l0C6HwIU.js";import"./useSearchTokenContext-CnVweHh1.js";import"./kbd-Ccl_4UMN.js";import"./useMessageBodyContent-DIF3dieb.js";import"./search-scope-B5-OK3Cq.js";import"./MailListHeader-Dp-YNlPj.js";import"./roving-focus-BgNxAjAj.js";import"./search-token-index-BXtgewDi.js";import"./useQueries-DH9StZ-W.js";import"./popover-menu-CG5nGI0G.js";import"./mail-BD9CFExB.js";import"./avatar-CCaAcetc.js";import"./index-CyocVpgw.js";import"./useSignature-B8GSTQOi.js";import"./account-form-helpers-DhckT_PN.js";import"./useDebouncedValue-BSAyBygv.js";import"./sections-45KeddjZ.js";import"./EmptyState-Dw5-fMm4.js";import"./ErrorState-PNI7QSLU.js";import"./undo-2-UQEFkwhb.js";import"./download-BoHBLdA7.js";import"./useCalendarFreeBusy-BgHa55K-.js";import"./calendar-format-CDiJYM60.js";import"./useCalendars-O5ZvqPWu.js";import"./map-pin-DM-UwFHl.js";import"./calendar-suggestion-BQoWPMtl.js";import"./attendee-row-BRiEaasS.js";import"./minus-BUHU6kmL.js";import"./clock-CwmO_JCY.js";import"./calendar-clash-strip-7S3XyUIT.js";import"./bell-off-CpcOtCIq.js";import"./shield-check-B_rWkRQY.js";import"./calendar-report-C-w9d_X_.js";import"./useFilters-R3V1TB7X.js";import"./checkbox-BwzvnbNT.js";import"./confirm-dialog-WrJoQuYb.js";import"./useLayoutTier-BT9E1-ej.js";import"./menu-Bk7fxS2w.js";import"./useRefreshControl-DfkVEG2l.js";import"./circle-check-big-kuolCFUC.js";import"./refresh-cw-DV6lCoUu.js";import"./useSemanticSearch-BQ_df8hM.js";import"./useLabels-qT2MGxVA.js";import"./search-query-Cr_ZXBCp.js";import"./wizard-selection-zWa1qc6-.js";function W(){return r.jsx(o.Reading,{})}export{W as component};
@@ -1 +0,0 @@
1
- import{j as o}from"./index-Dtovse-L.js";import{M as r}from"./MailboxPane-DkOrdudP.js";import"./useSearchTokenContext-CnVweHh1.js";import"./kbd-Ccl_4UMN.js";import"./useMessageBodyContent-DIF3dieb.js";import"./search-scope-B5-OK3Cq.js";import"./useRefreshControl-DfkVEG2l.js";import"./circle-check-big-kuolCFUC.js";import"./refresh-cw-DV6lCoUu.js";import"./useQueries-DH9StZ-W.js";import"./MailListHeader-Dp-YNlPj.js";import"./roving-focus-BgNxAjAj.js";import"./search-token-index-BXtgewDi.js";import"./popover-menu-CG5nGI0G.js";import"./mail-BD9CFExB.js";import"./avatar-CCaAcetc.js";import"./index-CyocVpgw.js";import"./useSignature-B8GSTQOi.js";import"./account-form-helpers-DhckT_PN.js";import"./useDebouncedValue-BSAyBygv.js";import"./sections-45KeddjZ.js";import"./EmptyState-Dw5-fMm4.js";import"./ErrorState-PNI7QSLU.js";import"./undo-2-UQEFkwhb.js";import"./download-BoHBLdA7.js";import"./useCalendarFreeBusy-BgHa55K-.js";import"./calendar-format-CDiJYM60.js";import"./useCalendars-O5ZvqPWu.js";import"./map-pin-DM-UwFHl.js";import"./calendar-suggestion-BQoWPMtl.js";import"./attendee-row-BRiEaasS.js";import"./minus-BUHU6kmL.js";import"./clock-CwmO_JCY.js";import"./calendar-clash-strip-7S3XyUIT.js";import"./bell-off-CpcOtCIq.js";import"./shield-check-B_rWkRQY.js";import"./calendar-report-C-w9d_X_.js";import"./useFilters-R3V1TB7X.js";import"./checkbox-BwzvnbNT.js";import"./confirm-dialog-WrJoQuYb.js";import"./useLayoutTier-BT9E1-ej.js";import"./menu-Bk7fxS2w.js";import"./MailViewChrome-CP2oa-r7.js";import"./pane-header-BTNHnxOW.js";import"./NavMenuButton-D17iXFBM.js";import"./useLabels-qT2MGxVA.js";import"./useSemanticSearch-BQ_df8hM.js";import"./search-query-Cr_ZXBCp.js";import"./bottom-sheet-BPiS9aBo.js";import"./circle-help--jGrrMan.js";import"./circle-check-DE9CwgTP.js";function $(){return o.jsx(r.Reading,{})}export{$ as component};
@@ -1 +0,0 @@
1
- import{j as o}from"./index-Dtovse-L.js";import{M as i}from"./MailboxPane-DkOrdudP.js";import"./useSearchTokenContext-CnVweHh1.js";import"./kbd-Ccl_4UMN.js";import"./useMessageBodyContent-DIF3dieb.js";import"./search-scope-B5-OK3Cq.js";import"./useRefreshControl-DfkVEG2l.js";import"./circle-check-big-kuolCFUC.js";import"./refresh-cw-DV6lCoUu.js";import"./useQueries-DH9StZ-W.js";import"./MailListHeader-Dp-YNlPj.js";import"./roving-focus-BgNxAjAj.js";import"./search-token-index-BXtgewDi.js";import"./popover-menu-CG5nGI0G.js";import"./mail-BD9CFExB.js";import"./avatar-CCaAcetc.js";import"./index-CyocVpgw.js";import"./useSignature-B8GSTQOi.js";import"./account-form-helpers-DhckT_PN.js";import"./useDebouncedValue-BSAyBygv.js";import"./sections-45KeddjZ.js";import"./EmptyState-Dw5-fMm4.js";import"./ErrorState-PNI7QSLU.js";import"./undo-2-UQEFkwhb.js";import"./download-BoHBLdA7.js";import"./useCalendarFreeBusy-BgHa55K-.js";import"./calendar-format-CDiJYM60.js";import"./useCalendars-O5ZvqPWu.js";import"./map-pin-DM-UwFHl.js";import"./calendar-suggestion-BQoWPMtl.js";import"./attendee-row-BRiEaasS.js";import"./minus-BUHU6kmL.js";import"./clock-CwmO_JCY.js";import"./calendar-clash-strip-7S3XyUIT.js";import"./bell-off-CpcOtCIq.js";import"./shield-check-B_rWkRQY.js";import"./calendar-report-C-w9d_X_.js";import"./useFilters-R3V1TB7X.js";import"./checkbox-BwzvnbNT.js";import"./confirm-dialog-WrJoQuYb.js";import"./useLayoutTier-BT9E1-ej.js";import"./menu-Bk7fxS2w.js";import"./MailViewChrome-CP2oa-r7.js";import"./pane-header-BTNHnxOW.js";import"./NavMenuButton-D17iXFBM.js";import"./useLabels-qT2MGxVA.js";import"./useSemanticSearch-BQ_df8hM.js";import"./search-query-Cr_ZXBCp.js";import"./bottom-sheet-BPiS9aBo.js";import"./circle-help--jGrrMan.js";import"./circle-check-DE9CwgTP.js";function $(){return o.jsx(i.Reading,{})}export{$ as component};
@@ -1 +0,0 @@
1
- import{j as o}from"./index-Dtovse-L.js";import{F as r}from"./FlaggedPane-D0pQWXT9.js";import"./useSearchTokenContext-CnVweHh1.js";import"./kbd-Ccl_4UMN.js";import"./useMessageBodyContent-DIF3dieb.js";import"./search-scope-B5-OK3Cq.js";import"./MailListHeader-Dp-YNlPj.js";import"./roving-focus-BgNxAjAj.js";import"./search-token-index-BXtgewDi.js";import"./useQueries-DH9StZ-W.js";import"./popover-menu-CG5nGI0G.js";import"./mail-BD9CFExB.js";import"./avatar-CCaAcetc.js";import"./index-CyocVpgw.js";import"./useSignature-B8GSTQOi.js";import"./account-form-helpers-DhckT_PN.js";import"./useDebouncedValue-BSAyBygv.js";import"./sections-45KeddjZ.js";import"./EmptyState-Dw5-fMm4.js";import"./ErrorState-PNI7QSLU.js";import"./undo-2-UQEFkwhb.js";import"./download-BoHBLdA7.js";import"./useCalendarFreeBusy-BgHa55K-.js";import"./calendar-format-CDiJYM60.js";import"./useCalendars-O5ZvqPWu.js";import"./map-pin-DM-UwFHl.js";import"./calendar-suggestion-BQoWPMtl.js";import"./attendee-row-BRiEaasS.js";import"./minus-BUHU6kmL.js";import"./clock-CwmO_JCY.js";import"./calendar-clash-strip-7S3XyUIT.js";import"./bell-off-CpcOtCIq.js";import"./shield-check-B_rWkRQY.js";import"./calendar-report-C-w9d_X_.js";import"./useFilters-R3V1TB7X.js";import"./checkbox-BwzvnbNT.js";import"./confirm-dialog-WrJoQuYb.js";import"./useLayoutTier-BT9E1-ej.js";import"./menu-Bk7fxS2w.js";import"./MailViewChrome-CP2oa-r7.js";import"./refresh-cw-DV6lCoUu.js";import"./wizard-selection-zWa1qc6-.js";function S(){return o.jsx(r.Reading,{})}export{S as component};
@@ -1 +0,0 @@
1
- import{j as o}from"./index-Dtovse-L.js";import{O as t}from"./OutboxPane-DNsIelwN.js";import"./roving-focus-BgNxAjAj.js";import"./useSearchTokenContext-CnVweHh1.js";import"./kbd-Ccl_4UMN.js";import"./useMessageBodyContent-DIF3dieb.js";import"./search-scope-B5-OK3Cq.js";import"./circle-check-big-kuolCFUC.js";import"./clock-CwmO_JCY.js";import"./row-actions-BwuDucsx.js";import"./rotate-ccw-BWReSl7L.js";import"./pane-header-BTNHnxOW.js";import"./NavMenuButton-D17iXFBM.js";import"./menu-Bk7fxS2w.js";import"./outbox-status-BlKn6P0x.js";import"./search-query-Cr_ZXBCp.js";function d(){return o.jsx(t.Reading,{})}export{d as component};