@remit/web-client-dist 0.0.489 → 0.0.490

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 (145) hide show
  1. package/assets/{BriefPane-GKsxsmIt.js → BriefPane-Chh89Ls8.js} +1 -1
  2. package/assets/{CalendarComposePane-agoL1ns0.js → CalendarComposePane-B0ESup6A.js} +1 -1
  3. package/assets/{CalendarComposeSeed-Ru12tqux.js → CalendarComposeSeed-BuYpzJin.js} +1 -1
  4. package/assets/{CalendarShell-DMvRHN83.js → CalendarShell-B4Ev9evX.js} +1 -1
  5. package/assets/{EmptyState-DbhUEdf0.js → EmptyState-BxLeI5a7.js} +1 -1
  6. package/assets/{ErrorState-CcskHvYA.js → ErrorState-B16NlU7u.js} +1 -1
  7. package/assets/{FlaggedPane-DdBU5qXP.js → FlaggedPane-Dz6az4Ch.js} +1 -1
  8. package/assets/{FullCompose-BOzKHIWH.js → FullCompose-CKDKSEUF.js} +1 -1
  9. package/assets/{MailListHeader-B2Ptcy5T.js → MailListHeader-CxqJgX-k.js} +1 -1
  10. package/assets/{MailNav-zQ-2drnE.js → MailNav-54pF4-Wf.js} +1 -1
  11. package/assets/{MailShell-BjMK7Xnl.js → MailShell-DA_4KXyC.js} +1 -1
  12. package/assets/{MailViewChrome-Ct8l-wD4.js → MailViewChrome-BDmv5d9y.js} +1 -1
  13. package/assets/{MailboxPane-UuE1GnYv.js → MailboxPane-Cot-E3G4.js} +1 -1
  14. package/assets/{NavMenuButton-O5EMAZfL.js → NavMenuButton-FBbQvMN0.js} +1 -1
  15. package/assets/{OnboardingWizard-BJ00yeFD.js → OnboardingWizard-BuifJm-8.js} +1 -1
  16. package/assets/OpenCalendarEvent-BcgQLU8V.js +2 -0
  17. package/assets/{OutboxPane-DnmR4ilE.js → OutboxPane-BUzXwXuC.js} +1 -1
  18. package/assets/_calendarObjectId-mny-4EXP.js +1 -0
  19. package/assets/_mailboxId-DSVCDMo4.js +1 -0
  20. package/assets/_messageId-BGcgfODq.js +1 -0
  21. package/assets/_messageId-DYefqN3E.js +1 -0
  22. package/assets/_messageId-DhbKo3B6.js +1 -0
  23. package/assets/_outboxMessageId-CtUxM86V.js +1 -0
  24. package/assets/_recurrenceId-CG1uEnuq.js +1 -0
  25. package/assets/_threadId-BuNYV3q0.js +1 -0
  26. package/assets/_threadId-D4jC1uwj.js +1 -0
  27. package/assets/_threadId-owspbibg.js +1 -0
  28. package/assets/_view._date-W-1Y9W21.js +1 -0
  29. package/assets/{accounts-CWc1-aEx.js → accounts--qzTAuMz.js} +1 -1
  30. package/assets/{advanced-xjzZgyye.js → advanced-BCOHYqWC.js} +1 -1
  31. package/assets/{appearance-QAJxDwiO.js → appearance-B_BCHiNs.js} +1 -1
  32. package/assets/{attachment-file-DeNsnSqQ.js → attachment-file-vWrTKKNW.js} +1 -1
  33. package/assets/{avatar-Du_muwOj.js → avatar-BxToBov5.js} +1 -1
  34. package/assets/{bottom-sheet-BS756-KS.js → bottom-sheet-BVBJeXZ0.js} +1 -1
  35. package/assets/{brief-hpmfWjHw.js → brief-1IhifgBt.js} +1 -1
  36. package/assets/brief-D6axyIWt.js +1 -0
  37. package/assets/{browser-ponyfill-CPjvsOlN.js → browser-ponyfill-C_e5y55O.js} +1 -1
  38. package/assets/{bug-Btp8x95y.js → bug-B_S4InDq.js} +1 -1
  39. package/assets/{calendar-Cm5OlCq0.js → calendar-Cxa7ah-g.js} +1 -1
  40. package/assets/{calendar-days-M0oLf7Pt.js → calendar-days-CPA8pt11.js} +1 -1
  41. package/assets/{card-BHsMslso.js → card-CQW-PX25.js} +1 -1
  42. package/assets/chevron-left-ywps-Gyo.js +1 -0
  43. package/assets/{circle-check-Ci5U4ND7.js → circle-check-BkneSfe9.js} +1 -1
  44. package/assets/{circle-check-big-BvKLZUBR.js → circle-check-big-Dge9pLwP.js} +1 -1
  45. package/assets/{circle-help-5cJ6ehph.js → circle-help-BIrTTaE1.js} +1 -1
  46. package/assets/{clock-DR_uD23l.js → clock-jA6Z_hAe.js} +1 -1
  47. package/assets/compose._-_outboxMessageId_-BsmyGcLW.js +1 -0
  48. package/assets/compose._-_outboxMessageId_-CWb5oqtG.js +1 -0
  49. package/assets/compose._-_outboxMessageId_-Cz4sST6-.js +1 -0
  50. package/assets/compose._-_outboxMessageId_-ON1pjxCP.js +1 -0
  51. package/assets/{config-import-de63ZhzL.js → config-import-BW-n-4Yl.js} +1 -1
  52. package/assets/{confirm-dialog-4odXEYPg.js → confirm-dialog-BAOm_tmO.js} +1 -1
  53. package/assets/{credential-steps-C487bVsp.js → credential-steps-DxrEA0OS.js} +1 -1
  54. package/assets/{download-BW67NG6L.js → download-CsyaiJfT.js} +1 -1
  55. package/assets/{filters-BYdyVF3l.js → filters-ENJaCJ6i.js} +1 -1
  56. package/assets/{flagged-D2fcwnwU.js → flagged-CHS7Sv5L.js} +1 -1
  57. package/assets/flagged-ClM4D6w4.js +1 -0
  58. package/assets/{folders-EcP0rfiB.js → folders-RAY3kNRb.js} +1 -1
  59. package/assets/{format-BHDg2rrC.js → format-CTO21bLP.js} +1 -1
  60. package/assets/{help-copy-CyOAabh4.js → help-copy-CHa0UGds.js} +1 -1
  61. package/assets/{import-yZ1lZmOe.js → import-vggCfFY7.js} +1 -1
  62. package/assets/index-3e125Hab.js +1 -0
  63. package/assets/index-BGcgfODq.js +1 -0
  64. package/assets/index-BM0UvHaM.js +1 -0
  65. package/assets/index-BcqF5DIR.js +1 -0
  66. package/assets/index-CSZc00Y0.js +1 -0
  67. package/assets/index-Cn0HxZE8.js +1 -0
  68. package/assets/{index-g8bgQtJZ.js → index-CvHgBKzk.js} +61 -61
  69. package/assets/{index-C6BJBAqS.js → index-D-XMtAaX.js} +8 -8
  70. package/assets/{index-DtgfksfH.js → index-D23sIPjL.js} +1 -1
  71. package/assets/index-DYefqN3E.js +1 -0
  72. package/assets/index-Da7gFljw.js +1 -0
  73. package/assets/index-JhCVbgdu.js +1 -0
  74. package/assets/{kbd-DqC2ZgVF.js → kbd-CFfFFeOa.js} +1 -1
  75. package/assets/{labels-_ZUBf8If.js → labels-JtbKl6kA.js} +1 -1
  76. package/assets/{mail-CfYHpR3-.js → mail-BtsVUuTG.js} +1 -1
  77. package/assets/{mail-B9HYS5_j.js → mail-DxviAVO4.js} +1 -1
  78. package/assets/{menu-B8k6KgGJ.js → menu-z3yGPHVO.js} +1 -1
  79. package/assets/minus-DgJyoX-1.js +1 -0
  80. package/assets/{new-CKL5ztN7.js → new-Bn847M0C.js} +1 -1
  81. package/assets/onboarding-DxcXNbpR.js +1 -0
  82. package/assets/{onboarding-completion-C6oaKJr6.js → onboarding-completion-BibtVMVq.js} +1 -1
  83. package/assets/outbox-B0Er3Qme.js +1 -0
  84. package/assets/{pencil-DcdYZQHm.js → pencil-D4BuHCoD.js} +1 -1
  85. package/assets/{rich-text-xWONJedQ.js → rich-text-1RhkdX-3.js} +1 -1
  86. package/assets/{rich-text-spellcheck-worker-provider-CNwU2omR.js → rich-text-spellcheck-worker-provider-CyU5XlL_.js} +1 -1
  87. package/assets/{rotate-ccw-D_188uJN.js → rotate-ccw-BAMGL0nD.js} +1 -1
  88. package/assets/{row-actions-DfZb5JeP.js → row-actions-NntamOda.js} +1 -1
  89. package/assets/{search-mirror-7JkoCkyi.js → search-mirror-iyqYtIOH.js} +1 -1
  90. package/assets/{search-token-index-BOTTrCLk.js → search-token-index-CMEbenCb.js} +1 -1
  91. package/assets/{sections-BEguVFV2.js → sections-kEi5uTHL.js} +1 -1
  92. package/assets/{senders-BcpBIVSg.js → senders-BCbJ8qc6.js} +1 -1
  93. package/assets/settings-DS8owM2f.js +1 -0
  94. package/assets/{settings-screen-6UMcBZNz.js → settings-screen-Bas4TeYt.js} +1 -1
  95. package/assets/{shield-check-SmSS2Jxi.js → shield-check-BncfAN35.js} +1 -1
  96. package/assets/{suggested-vips-D2v6FYHK.js → suggested-vips-BXyjY5hr.js} +1 -1
  97. package/assets/useCalendarData-DDXYjxV5.js +1 -0
  98. package/assets/useCalendars-C17p7Nzh.js +1 -0
  99. package/assets/{useDebouncedValue-CBTfEGjG.js → useDebouncedValue-DT0N2ZZ8.js} +1 -1
  100. package/assets/{useFilters-UCepys59.js → useFilters-CFGQOfNb.js} +1 -1
  101. package/assets/{useLabels-D1TbYkW1.js → useLabels-4QZ-fg0L.js} +1 -1
  102. package/assets/{useLayoutTier-BWGxIu6c.js → useLayoutTier-CRRZIH_b.js} +1 -1
  103. package/assets/{useMessageBodyContent-CuLDcpM3.js → useMessageBodyContent-DAz3qVkt.js} +1 -1
  104. package/assets/{useQueries-CCN-XYPe.js → useQueries-BxE36uj9.js} +1 -1
  105. package/assets/{useRefreshControl-DuT7Vf8Z.js → useRefreshControl-D87kZX8a.js} +1 -1
  106. package/assets/{useSearchTokenContext-GTO16rww.js → useSearchTokenContext-Dvm-Yobe.js} +4 -4
  107. package/assets/useSemanticSearch-Fk64TQcq.js +1 -0
  108. package/assets/{useSignature-BvM9Jfop.js → useSignature-uiUpBdh0.js} +1 -1
  109. package/index.html +1 -1
  110. package/package.json +1 -1
  111. package/assets/OpenCalendarEvent-DFAHEVHt.js +0 -2
  112. package/assets/_calendarObjectId-6cOKQcgB.js +0 -1
  113. package/assets/_mailboxId-CFhgCYCF.js +0 -1
  114. package/assets/_messageId-C-LTrk0-.js +0 -1
  115. package/assets/_messageId-DZDvjiNN.js +0 -1
  116. package/assets/_messageId-LbrpD-BP.js +0 -1
  117. package/assets/_outboxMessageId-meXaRwTs.js +0 -1
  118. package/assets/_recurrenceId-DV189r6S.js +0 -1
  119. package/assets/_threadId-CPgw728G.js +0 -1
  120. package/assets/_threadId-C_-8qHTx.js +0 -1
  121. package/assets/_threadId-_PwgZfT0.js +0 -1
  122. package/assets/_view._date-Cn85wNA-.js +0 -1
  123. package/assets/brief-CErs70FI.js +0 -1
  124. package/assets/chevron-left-BPhVNe7C.js +0 -1
  125. package/assets/compose._-_outboxMessageId_-0lG1RQ-U.js +0 -1
  126. package/assets/compose._-_outboxMessageId_-BWV4mYDU.js +0 -1
  127. package/assets/compose._-_outboxMessageId_-Cvy5e97A.js +0 -1
  128. package/assets/compose._-_outboxMessageId_-D_hmUjGR.js +0 -1
  129. package/assets/flagged-CYneeAX9.js +0 -1
  130. package/assets/index-BKva5t-L.js +0 -1
  131. package/assets/index-BMNptzNH.js +0 -1
  132. package/assets/index-BoUGz-xy.js +0 -1
  133. package/assets/index-C3P_qUWn.js +0 -1
  134. package/assets/index-DMtQT3Gv.js +0 -1
  135. package/assets/index-DZDvjiNN.js +0 -1
  136. package/assets/index-DZYAx9Zv.js +0 -1
  137. package/assets/index-DaxLOC3T.js +0 -1
  138. package/assets/index-LbrpD-BP.js +0 -1
  139. package/assets/minus-CMPi7NES.js +0 -1
  140. package/assets/onboarding-BhJpStXu.js +0 -1
  141. package/assets/outbox-JUyi2qJo.js +0 -1
  142. package/assets/settings-Vu3bXMtt.js +0 -1
  143. package/assets/useCalendarData-C5aoyZVb.js +0 -1
  144. package/assets/useCalendars-DpFuwdMF.js +0 -1
  145. package/assets/useSemanticSearch-Du2bzbgF.js +0 -1
@@ -1 +1 @@
1
- import{r as c,u as M,c3 as S,c4 as O,a8 as h,c5 as B,q as P,aa as U,h as N,c as $,cu as D,cv as F}from"./index-g8bgQtJZ.js";const w="/mail/brief/compose/{-$outboxMessageId}",R="/mail/flagged/compose/{-$outboxMessageId}",E="/mail/outbox/compose/{-$outboxMessageId}",k="/mail/$mailboxId/compose/{-$outboxMessageId}";function T(){const e=h({from:w,shouldThrow:!1}),t=h({from:R,shouldThrow:!1}),r=h({from:E,shouldThrow:!1}),s=h({from:k,shouldThrow:!1});return e??t??r??s}function z(){return T()!==void 0}function Y(){return T()?.outboxMessageId}function v(e,t,r){return e==="flagged"?{to:R,params:{outboxMessageId:r}}:e==="outbox"?{to:E,params:{outboxMessageId:r}}:e==="mailbox"&&t?{to:k,params:{mailboxId:t,outboxMessageId:r}}:{to:w,params:{outboxMessageId:r}}}function b(){const e=M(),t=S(),{list:r,mailboxId:s}=O();return c.useCallback((n,o)=>{e({...v(r,s,n),search:a=>a,hash:o?.keepPanels?!0:t,replace:o?.replace??!1})},[e,t,r,s])}function j(){const e=b();return c.useCallback(()=>e(void 0),[e])}function J(){const e=b();return c.useCallback(t=>e(t),[e])}function V(){const e=b();return c.useCallback(t=>e(t,{replace:!0,keepPanels:!0}),[e])}function Z(){return B()}const L=e=>{const t=e.filter(n=>!n.isMultipart&&n.disposition!=="attachment"&&n.mediaType==="TEXT"&&n.contentUrl.length>0),r=t.find(n=>n.mediaSubtype.toUpperCase()==="HTML");if(r)return{kind:"html",contentUrl:r.contentUrl};const s=t.find(n=>n.mediaSubtype.toUpperCase()==="PLAIN");return s?{kind:"text",contentUrl:s.contentUrl}:null},g={all:["messages"],detail:e=>[...g.all,"detail",e],body:e=>[...g.detail(e),"body"]};class f extends Error{reason;status;retryAfterSeconds;constructor(t,r,s,n){super(r),this.name="BodyFetchError",this.reason=t,this.status=s,this.retryAfterSeconds=n}}const _=e=>{const t=Number.parseInt(e??"",10);return!Number.isFinite(t)||t<=0?1:Math.min(t,30)},q=8,K="x-remit-403-reason",Q=(e,t)=>{const r=t?.trim()??"";return e===401?"auth":e===403?r.length>0?"auth":"body-missing":e===404?"body-missing":"generic"},I=(e,t)=>(t??"").toLowerCase().startsWith("text/html")?/<div\s+id=["']root["']/i.test(e):!1,X=(e,t)=>{const r=(t??"").toLowerCase();return!!(e==="text"&&r.startsWith("text/html"))},G=async(e,t,r=async()=>null)=>{const s={},n=await r();n&&(s.Authorization=`Bearer ${n}`);const o=await F(e,{headers:s});if(o.status===202)throw new f("not-ready","Message body is still syncing",202,_(o.headers.get("Retry-After")));if(!o.ok){const l=o.headers.get(K),m=Q(o.status,l);throw new f(m,`Failed to load message body (${o.status} ${o.statusText})`,o.status)}const a=o.headers.get("content-type");if(X(t,a))throw new f("content-type-mismatch",`Refusing to render message body — expected ${t}, got Content-Type ${a}`);const y=await o.text();if(I(y,a))throw new f("spa-shell-leak","Refusing to render message body — response looks like the SPA shell (CloudFront 403/404 fallback leaked through to /content/*)");return y},H=async(e,t)=>(t.isRetryAfterNotReady&&await e.refetchDescribeMessage(),e.fetchContent(t.contentUrl,t.kind)),ee=({messageId:e,bodyParts:t,enabled:r=!0})=>{const s=t?L(t):null,n=P(),{getToken:o}=U(),a=c.useRef(null),y=N(),l=c.useRef(!1),m=c.useRef(null),C=e&&s?`${e}:${s.contentUrl}`:null;m.current!==C&&(m.current=C,l.current=!1);const i=$({queryKey:e?[...g.body(e),s?.contentUrl??null]:["messages","body","noop"],queryFn:()=>{if(!s)throw new Error("No renderable body part");if(!e)throw new Error("No messageId");const d=l.current;return l.current=!1,H({fetchContent:(u,A)=>G(u,A,o),refetchDescribeMessage:()=>y.refetchQueries({queryKey:D({path:{messageId:e}})})},{contentUrl:s.contentUrl,kind:s.kind,isRetryAfterNotReady:d})},enabled:r&&!!e&&!!s,staleTime:300*1e3,gcTime:1800*1e3,retry:(d,u)=>u instanceof f&&u.reason==="not-ready"?d<q:d<1,retryDelay:(d,u)=>u instanceof f&&u.reason==="not-ready"?(l.current=!0,(u.retryAfterSeconds??1)*1e3):1e3,meta:{softError:!0}}),p=i.isLoading&&!!s;c.useEffect(()=>{p&&(a.current=performance.now())},[p]),c.useEffect(()=>{i.isSuccess&&a.current!==null&&(n.recordTiming("message.body.load",Math.round(performance.now()-a.current)),a.current=null)},[i.isSuccess,n]);const x=i.data&&s?{kind:s.kind,body:i.data}:void 0;return{picked:s,data:x,isLoading:p,isError:i.isError,error:i.error,refetch:i.refetch}};export{f as B,z as a,ee as b,Y as c,V as d,Z as e,J as f,Q as g,j as u};
1
+ import{r as c,u as M,c7 as S,c8 as O,a8 as h,c9 as B,q as P,aa as U,h as N,c as $,cy as D,cz as F}from"./index-CvHgBKzk.js";const w="/mail/brief/compose/{-$outboxMessageId}",R="/mail/flagged/compose/{-$outboxMessageId}",E="/mail/outbox/compose/{-$outboxMessageId}",k="/mail/$mailboxId/compose/{-$outboxMessageId}";function T(){const e=h({from:w,shouldThrow:!1}),t=h({from:R,shouldThrow:!1}),r=h({from:E,shouldThrow:!1}),s=h({from:k,shouldThrow:!1});return e??t??r??s}function W(){return T()!==void 0}function Y(){return T()?.outboxMessageId}function L(e,t,r){return e==="flagged"?{to:R,params:{outboxMessageId:r}}:e==="outbox"?{to:E,params:{outboxMessageId:r}}:e==="mailbox"&&t?{to:k,params:{mailboxId:t,outboxMessageId:r}}:{to:w,params:{outboxMessageId:r}}}function b(){const e=M(),t=S(),{list:r,mailboxId:s}=O();return c.useCallback((n,o)=>{e({...L(r,s,n),search:a=>a,hash:o?.keepPanels?!0:t,replace:o?.replace??!1})},[e,t,r,s])}function j(){const e=b();return c.useCallback(()=>e(void 0),[e])}function J(){const e=b();return c.useCallback(t=>e(t),[e])}function V(){const e=b();return c.useCallback(t=>e(t,{replace:!0,keepPanels:!0}),[e])}function Z(){return B()}const v=e=>{const t=e.filter(n=>!n.isMultipart&&n.disposition!=="attachment"&&n.mediaType==="TEXT"&&n.contentUrl.length>0),r=t.find(n=>n.mediaSubtype.toUpperCase()==="HTML");if(r)return{kind:"html",contentUrl:r.contentUrl};const s=t.find(n=>n.mediaSubtype.toUpperCase()==="PLAIN");return s?{kind:"text",contentUrl:s.contentUrl}:null},g={all:["messages"],detail:e=>[...g.all,"detail",e],body:e=>[...g.detail(e),"body"]};class f extends Error{reason;status;retryAfterSeconds;constructor(t,r,s,n){super(r),this.name="BodyFetchError",this.reason=t,this.status=s,this.retryAfterSeconds=n}}const _=e=>{const t=Number.parseInt(e??"",10);return!Number.isFinite(t)||t<=0?1:Math.min(t,30)},q=8,K="x-remit-403-reason",Q=(e,t)=>{const r=t?.trim()??"";return e===401?"auth":e===403?r.length>0?"auth":"body-missing":e===404?"body-missing":"generic"},I=(e,t)=>(t??"").toLowerCase().startsWith("text/html")?/<div\s+id=["']root["']/i.test(e):!1,X=(e,t)=>{const r=(t??"").toLowerCase();return!!(e==="text"&&r.startsWith("text/html"))},z=async(e,t,r=async()=>null)=>{const s={},n=await r();n&&(s.Authorization=`Bearer ${n}`);const o=await F(e,{headers:s});if(o.status===202)throw new f("not-ready","Message body is still syncing",202,_(o.headers.get("Retry-After")));if(!o.ok){const l=o.headers.get(K),m=Q(o.status,l);throw new f(m,`Failed to load message body (${o.status} ${o.statusText})`,o.status)}const a=o.headers.get("content-type");if(X(t,a))throw new f("content-type-mismatch",`Refusing to render message body — expected ${t}, got Content-Type ${a}`);const y=await o.text();if(I(y,a))throw new f("spa-shell-leak","Refusing to render message body — response looks like the SPA shell (CloudFront 403/404 fallback leaked through to /content/*)");return y},G=async(e,t)=>(t.isRetryAfterNotReady&&await e.refetchDescribeMessage(),e.fetchContent(t.contentUrl,t.kind)),ee=({messageId:e,bodyParts:t,enabled:r=!0})=>{const s=t?v(t):null,n=P(),{getToken:o}=U(),a=c.useRef(null),y=N(),l=c.useRef(!1),m=c.useRef(null),C=e&&s?`${e}:${s.contentUrl}`:null;m.current!==C&&(m.current=C,l.current=!1);const i=$({queryKey:e?[...g.body(e),s?.contentUrl??null]:["messages","body","noop"],queryFn:()=>{if(!s)throw new Error("No renderable body part");if(!e)throw new Error("No messageId");const d=l.current;return l.current=!1,G({fetchContent:(u,A)=>z(u,A,o),refetchDescribeMessage:()=>y.refetchQueries({queryKey:D({path:{messageId:e}})})},{contentUrl:s.contentUrl,kind:s.kind,isRetryAfterNotReady:d})},enabled:r&&!!e&&!!s,staleTime:300*1e3,gcTime:1800*1e3,retry:(d,u)=>u instanceof f&&u.reason==="not-ready"?d<q:d<1,retryDelay:(d,u)=>u instanceof f&&u.reason==="not-ready"?(l.current=!0,(u.retryAfterSeconds??1)*1e3):1e3,meta:{softError:!0}}),p=i.isLoading&&!!s;c.useEffect(()=>{p&&(a.current=performance.now())},[p]),c.useEffect(()=>{i.isSuccess&&a.current!==null&&(n.recordTiming("message.body.load",Math.round(performance.now()-a.current)),a.current=null)},[i.isSuccess,n]);const x=i.data&&s?{kind:s.kind,body:i.data}:void 0;return{picked:s,data:x,isLoading:p,isError:i.isError,error:i.error,refetch:i.refetch}};export{f as B,W as a,ee as b,Y as c,V as d,Z as e,J as f,Q as g,j as u};
@@ -1 +1 @@
1
- import{bL as E,bM as y,bN as S,bO as w,bP as C,h as k,bQ as M,bR as q,r as d,bS as x,bT as H,bU as L,bV as P,bW as R,bX as B,bY as T}from"./index-g8bgQtJZ.js";function v(r,e){const s=new Set(e);return r.filter(t=>!s.has(t))}function A(r,e,s){const t=r.slice(0);return t[e]=s,t}var U=class extends E{#i;#e;#n;#r;#s;#t;#o;#u;#h;#a=[];constructor(r,e,s){super(),this.#i=r,this.#r=s,this.#n=[],this.#s=[],this.#e=[],this.setQueries(e)}onSubscribe(){this.listeners.size===1&&this.#s.forEach(r=>{r.subscribe(e=>{this.#f(r,e)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,this.#s.forEach(r=>{r.destroy()})}setQueries(r,e){this.#n=r,this.#r=e,y.batch(()=>{const s=this.#s,t=this.#b(this.#n);t.forEach(o=>o.observer.setOptions(o.defaultedQueryOptions));const i=t.map(o=>o.observer),n=i.map(o=>o.getCurrentResult()),u=s.length!==i.length,c=i.some((o,f)=>o!==s[f]),b=u||c,p=b?!0:n.some((o,f)=>{const g=this.#e[f];return!g||!S(o,g)});!b&&!p||(b&&(this.#a=t,this.#s=i),this.#e=n,this.hasListeners()&&(b&&(v(s,i).forEach(o=>{o.destroy()}),v(i,s).forEach(o=>{o.subscribe(f=>{this.#f(o,f)})})),this.#d()))})}getCurrentResult(){return this.#e}getQueries(){return this.#s.map(r=>r.getCurrentQuery())}getObservers(){return this.#s}getOptimisticResult(r,e){const s=this.#b(r),t=s.map(n=>n.observer.getOptimisticResult(n.defaultedQueryOptions)),i=s.map(n=>n.defaultedQueryOptions.queryHash);return[t,n=>this.#l(n??t,e,i),()=>this.#c(t,s)]}#c(r,e){return e.map((s,t)=>{const i=r[t];return s.defaultedQueryOptions.notifyOnChangeProps?i:s.observer.trackResult(i,n=>{e.forEach(u=>{u.observer.trackProp(n)})})})}#l(r,e,s){if(e){const t=this.#h,i=s!==void 0&&t!==void 0&&(t.length!==s.length||s.some((n,u)=>n!==t[u]));return(!this.#t||this.#e!==this.#u||i||e!==this.#o)&&(this.#o=e,this.#u=this.#e,s!==void 0&&(this.#h=s),this.#t=w(this.#t,e(r))),this.#t}return r}#p(){return this.#r?.combine!==void 0&&this.#s.some((r,e)=>r.options.suspense&&this.#e[e]?.data===void 0)}#b(r){const e=new Map;this.#s.forEach(t=>{const i=t.options.queryHash;if(!i)return;const n=e.get(i);n?n.push(t):e.set(i,[t])});const s=[];return r.forEach(t=>{const i=this.#i.defaultQueryOptions(t),u=e.get(i.queryHash)?.shift()??new C(this.#i,i);s.push({defaultedQueryOptions:i,observer:u})}),s}#f(r,e){const s=this.#s.indexOf(r);s!==-1&&(this.#e=A(this.#e,s,e),this.#d())}#d(){if(this.hasListeners()){const r=this.#c(this.#e,this.#a),e=this.#p(),s=this.#t,t=e?s:this.#l(r,this.#r?.combine);(e||s!==t)&&y.batch(()=>{this.listeners.forEach(i=>{i(this.#e)})})}}};function I({queries:r,...e},s){const t=k(),i=M(),n=q(),u=d.useMemo(()=>r.map(h=>{const a=t.defaultQueryOptions(h);return a._optimisticResults=i?"isRestoring":"optimistic",a}),[r,t,i]);u.forEach(h=>{x(h);const a=t.getQueryCache().get(h.queryHash);H(h,n,a)}),L(n);const[c]=d.useState(()=>new U(t,u,e)),[b,p,o]=c.getOptimisticResult(u,e.combine),f=!i&&e.subscribed!==!1;d.useSyncExternalStore(d.useCallback(h=>f?c.subscribe(y.batchCalls(h)):P,[c,f]),()=>c.getCurrentResult(),()=>c.getCurrentResult()),d.useEffect(()=>{c.setQueries(u,e)},[u,e,c]);const m=b.some((h,a)=>R(u[a],h))?b.flatMap((h,a)=>{const l=u[a];if(l&&R(l,h)){const Q=new C(t,l);return B(l,Q,n)}return[]}):[];if(m.length>0)throw Promise.all(m);const O=b.find((h,a)=>{const l=u[a];return l&&T({result:h,errorResetBoundary:n,throwOnError:l.throwOnError,query:t.getQueryCache().get(l.queryHash),suspense:l.suspense})});if(O?.error)throw O.error;return p(o())}export{I as u};
1
+ import{bP as E,bQ as y,bR as S,bS as w,bT as C,h as k,bU as q,bV as x,r as d,bW as M,bX as H,bY as P,bZ as L,b_ as v,b$ as B,c0 as T}from"./index-CvHgBKzk.js";function O(r,e){const s=new Set(e);return r.filter(t=>!s.has(t))}function A(r,e,s){const t=r.slice(0);return t[e]=s,t}var U=class extends E{#i;#e;#n;#r;#s;#t;#o;#u;#h;#a=[];constructor(r,e,s){super(),this.#i=r,this.#r=s,this.#n=[],this.#s=[],this.#e=[],this.setQueries(e)}onSubscribe(){this.listeners.size===1&&this.#s.forEach(r=>{r.subscribe(e=>{this.#f(r,e)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,this.#s.forEach(r=>{r.destroy()})}setQueries(r,e){this.#n=r,this.#r=e,y.batch(()=>{const s=this.#s,t=this.#b(this.#n);t.forEach(o=>o.observer.setOptions(o.defaultedQueryOptions));const i=t.map(o=>o.observer),n=i.map(o=>o.getCurrentResult()),u=s.length!==i.length,c=i.some((o,f)=>o!==s[f]),b=u||c,p=b?!0:n.some((o,f)=>{const g=this.#e[f];return!g||!S(o,g)});!b&&!p||(b&&(this.#a=t,this.#s=i),this.#e=n,this.hasListeners()&&(b&&(O(s,i).forEach(o=>{o.destroy()}),O(i,s).forEach(o=>{o.subscribe(f=>{this.#f(o,f)})})),this.#d()))})}getCurrentResult(){return this.#e}getQueries(){return this.#s.map(r=>r.getCurrentQuery())}getObservers(){return this.#s}getOptimisticResult(r,e){const s=this.#b(r),t=s.map(n=>n.observer.getOptimisticResult(n.defaultedQueryOptions)),i=s.map(n=>n.defaultedQueryOptions.queryHash);return[t,n=>this.#l(n??t,e,i),()=>this.#c(t,s)]}#c(r,e){return e.map((s,t)=>{const i=r[t];return s.defaultedQueryOptions.notifyOnChangeProps?i:s.observer.trackResult(i,n=>{e.forEach(u=>{u.observer.trackProp(n)})})})}#l(r,e,s){if(e){const t=this.#h,i=s!==void 0&&t!==void 0&&(t.length!==s.length||s.some((n,u)=>n!==t[u]));return(!this.#t||this.#e!==this.#u||i||e!==this.#o)&&(this.#o=e,this.#u=this.#e,s!==void 0&&(this.#h=s),this.#t=w(this.#t,e(r))),this.#t}return r}#p(){return this.#r?.combine!==void 0&&this.#s.some((r,e)=>r.options.suspense&&this.#e[e]?.data===void 0)}#b(r){const e=new Map;this.#s.forEach(t=>{const i=t.options.queryHash;if(!i)return;const n=e.get(i);n?n.push(t):e.set(i,[t])});const s=[];return r.forEach(t=>{const i=this.#i.defaultQueryOptions(t),u=e.get(i.queryHash)?.shift()??new C(this.#i,i);s.push({defaultedQueryOptions:i,observer:u})}),s}#f(r,e){const s=this.#s.indexOf(r);s!==-1&&(this.#e=A(this.#e,s,e),this.#d())}#d(){if(this.hasListeners()){const r=this.#c(this.#e,this.#a),e=this.#p(),s=this.#t,t=e?s:this.#l(r,this.#r?.combine);(e||s!==t)&&y.batch(()=>{this.listeners.forEach(i=>{i(this.#e)})})}}};function I({queries:r,...e},s){const t=k(),i=q(),n=x(),u=d.useMemo(()=>r.map(h=>{const a=t.defaultQueryOptions(h);return a._optimisticResults=i?"isRestoring":"optimistic",a}),[r,t,i]);u.forEach(h=>{M(h);const a=t.getQueryCache().get(h.queryHash);H(h,n,a)}),P(n);const[c]=d.useState(()=>new U(t,u,e)),[b,p,o]=c.getOptimisticResult(u,e.combine),f=!i&&e.subscribed!==!1;d.useSyncExternalStore(d.useCallback(h=>f?c.subscribe(y.batchCalls(h)):L,[c,f]),()=>c.getCurrentResult(),()=>c.getCurrentResult()),d.useEffect(()=>{c.setQueries(u,e)},[u,e,c]);const m=b.some((h,a)=>v(u[a],h))?b.flatMap((h,a)=>{const l=u[a];if(l&&v(l,h)){const Q=new C(t,l);return B(l,Q,n)}return[]}):[];if(m.length>0)throw Promise.all(m);const R=b.find((h,a)=>{const l=u[a];return l&&T({result:h,errorResetBoundary:n,throwOnError:l.throwOnError,query:t.getQueryCache().get(l.queryHash),suspense:l.suspense})});if(R?.error)throw R.error;return p(o())}export{I as u};
@@ -1 +1 @@
1
- import{j as E,_ as Q,t as W,f as U,r as o,aN as R,h as O,C as $,q as z,M as B,N as G,P as I,Q as X}from"./index-g8bgQtJZ.js";import{C as V}from"./circle-check-big-BvKLZUBR.js";import{R as J,i as Y,t as Z}from"./search-token-index-BOTTrCLk.js";import{u as P}from"./useQueries-CCN-XYPe.js";function Se({state:e,onRefresh:s,label:t,errorMessage:r,hasUpdate:a,size:u="sm",className:c}){const i=e==="refreshing",n=e==="error",h=e==="success",y=n?E.jsx(Q,{className:"size-4 text-danger"}):h?E.jsx(V,{className:"size-4 text-positive"}):E.jsx(J,{className:W("size-4",i&&"animate-spin")}),w=n?`${t} — failed: ${r??"try again"}`:i?`${t} — refreshing`:h?`${t} — up to date`:a?`${t} — new mail`:t;return E.jsxs("div",{className:"relative inline-flex",children:[E.jsx(U,{variant:"ghost",size:u,icon:y,onClick:s,disabled:i,"aria-label":w,"aria-busy":i||void 0,title:n?r:t,className:c}),e==="idle"&&a&&E.jsx("span",{"aria-hidden":"true",className:"absolute right-1 top-1 size-1.5 rounded-full bg-accent-2"})]})}const ee=new Set(["discovering_mailboxes","syncing_inbox","syncing_others"]);function L(e){return!!e&&ee.has(e)}const q=3e3,te=q*2,T={syncing:!1,resolved:!1,synced:0,total:0};function we(e,s){const t=e.join(","),[r,a]=o.useState(!1),[u,c]=o.useState(!1);o.useEffect(()=>{a(!1),c(!1)},[t,s]),o.useEffect(()=>{if(!s)return;const m=setTimeout(()=>c(!0),te);return()=>clearTimeout(m)},[t,s]);const i=P({queries:e.map(m=>({...R({path:{accountId:m}}),enabled:s&&!r,refetchInterval:q,meta:{softError:!0}}))}),n=i.every(m=>m.isSuccess||m.isError),h=i.length===0||n||u;let y=!1,w=0,S=0;for(const m of i)if(L(m.data?.syncPhase)){y=!0;for(const l of m.data?.mailboxes??[])w+=l.messagesSynced,S+=l.messagesTotal}const x=s&&h&&!y;return o.useEffect(()=>{x&&a(!0)},[x]),!s||!h?T:{syncing:y,resolved:!0,synced:w,total:S}}const se=180*1e3,xe=30*1e3;let F=0;const M=new Set,ne=(e=Date.now())=>{F=e+se;for(const s of M)s()},pe=(e=Date.now())=>e<F,Ee=e=>(M.add(e),()=>{M.delete(e)}),_=6e4,re=new Set(["sent","drafts","trash","archive"]),C=(e,s)=>{const t=new Map;for(const r of e){const a=s.get(r.mailboxId)?.role;a&&re.has(a)||t.set(r.mailboxId,r.messagesTotal)}return t},j=(e,s)=>{const t=[];for(const[r,a]of s)a>(e.get(r)??0)&&t.push(r);return t},oe=(e,s)=>j(e,s).length>0,D=o.createContext(null),ae=()=>{const e=o.useContext(D);if(!e)throw new Error("useMailFreshness must be used inside <MailFreshnessProvider>");return e};function be({accountIds:e,children:s}){const t=O(),{resultFolderIndex:r}=$(),a=o.useRef(new Map),u=o.useRef(new Set),c=o.useRef(new Map),[i,n]=o.useState(new Set),h=P({queries:e.map(l=>({...R({path:{accountId:l}}),refetchInterval:_,staleTime:_,meta:{softError:!0}}))}),y=h.map(l=>l.dataUpdatedAt).join(","),w=e.join(",");o.useEffect(()=>{let l=!1;const f=new Set(i);e.forEach((d,p)=>{const b=h[p]?.data;if(!b)return;const g=C(b.mailboxes??[],r),k=c.current.get(d);if(c.current.set(d,g),k){const A=j(k,g);A.length>0&&Y(t,Z(A))}if(!u.current.has(d)){u.current.add(d),a.current.set(d,g);return}if(f.has(d))return;const K=a.current.get(d)??new Map;oe(K,g)&&(f.add(d),l=!0)}),l&&n(f)},[w,y]);const S=o.useCallback(l=>l.some(f=>i.has(f)),[i]),x=o.useCallback(l=>{n(f=>{if(l.every(p=>!f.has(p)))return f;const d=new Set(f);for(const p of l)d.delete(p);return d});for(const f of l){const d=t.getQueryData(R({path:{accountId:f}}).queryKey);a.current.set(f,C(d?.mailboxes??[],r)),u.current.add(f)}},[t,r]),m=o.useMemo(()=>({hasNewMail:S,acknowledge:x}),[S,x]);return E.jsx(D.Provider,{value:m,children:s})}const ie=2e3,ce=45e3,ue=e=>new Promise(s=>setTimeout(s,e)),v=e=>e instanceof Error&&e.message?e.message:"Something went wrong",le=e=>{I(e,{softError:!0},"user")&&X(e)},N=(e,s)=>e.fetchQuery({...R({path:{accountId:s}}),staleTime:0}),H=e=>e.mailboxes?.find(s=>s.fullPath?.toUpperCase()==="INBOX")?.lastSyncedAt??0,fe=async({accountId:e,readStatus:s,baselineLastSyncAt:t,baselineInboxSyncedAt:r=0,onInboxSynced:a,deadline:u,pollMs:c=ie})=>{let i=!1;for(;;){const n=await s().then(S=>({ok:!0,data:S})).catch(S=>({ok:!1,error:S}));if(!n.ok)return{accountId:e,message:v(n.error)};const{syncPhase:h,lastSyncAt:y}=n.data;if((y??0)>t&&!L(h))return h==="error"?{accountId:e,message:"Sync failed for this account"}:void 0;if(!i&&H(n.data)>r&&(i=!0,a?.()),Date.now()>=u)return{accountId:e,message:"Refresh is taking longer than usual"};await ue(c)}},de=async(e,s,t,r,a)=>{const u=await N(e,t).then(n=>({ok:!0,lastSyncAt:n.lastSyncAt??0,inboxSyncedAt:H(n)})).catch(n=>({ok:!1,error:n}));if(!u.ok)return{accountId:t,enqueued:!1,ok:!1,message:v(u.error)};const c=await B({path:{accountId:t},throwOnError:!0}).then(()=>({ok:!0})).catch(n=>({ok:!1,error:n}));if(!c.ok)return le(c.error),{accountId:t,enqueued:!1,ok:!1,message:v(c.error)};s.recordEvent("sync.triggered");const i=await fe({accountId:t,readStatus:()=>N(e,t),baselineLastSyncAt:u.lastSyncAt,baselineInboxSyncedAt:u.inboxSyncedAt,onInboxSynced:()=>a(t),deadline:r});return i?{accountId:t,enqueued:!0,ok:!1,message:i.message}:{accountId:t,enqueued:!0,ok:!0}},Re=(e,s={})=>{const t=O(),r=z(),{acknowledge:a}=ae(),[u,c]=o.useState("idle"),[i,n]=o.useState(),h=o.useRef(0),y=o.useRef(e);y.current=e;const w=o.useRef(s);w.current=s,o.useEffect(()=>{if(u!=="success")return;const x=setTimeout(()=>c("idle"),2e3);return()=>clearTimeout(x)},[u]);const S=o.useCallback(()=>{const x=y.current;if(x.length===0){c("error"),n("Nothing to refresh yet");return}const m=++h.current;c("refreshing"),n(void 0),ne();const l=f=>{h.current===m&&(t.invalidateQueries({queryKey:G({path:{accountId:f}})}),w.current.onSettled?.())};(async()=>{const f=Date.now()+ce,d=await Promise.all(x.map(g=>de(t,r,g,f,l)));if(h.current!==m)return;const p=d.filter(g=>g.enqueued).map(g=>g.accountId);for(const g of p)l(g);p.length>0&&a(p);const b=d.filter(g=>!g.ok);b.length===0?c("success"):(c("error"),n(b[0]?.message))})()},[a,t,r]);return{state:u,errorMessage:i,refresh:S}};export{xe as H,be as M,Se as R,Re as a,L as b,we as c,pe as i,Ee as s,ae as u};
1
+ import{j as E,_ as Q,t as W,f as U,r as o,aN as R,h as O,C as $,q as z,M as B,N as G,P as I,Q as X}from"./index-CvHgBKzk.js";import{C as V}from"./circle-check-big-Dge9pLwP.js";import{R as J,i as Y,t as Z}from"./search-token-index-CMEbenCb.js";import{u as P}from"./useQueries-BxE36uj9.js";function Se({state:e,onRefresh:s,label:t,errorMessage:r,hasUpdate:a,size:u="sm",className:c}){const i=e==="refreshing",n=e==="error",h=e==="success",y=n?E.jsx(Q,{className:"size-4 text-danger"}):h?E.jsx(V,{className:"size-4 text-positive"}):E.jsx(J,{className:W("size-4",i&&"animate-spin")}),w=n?`${t} — failed: ${r??"try again"}`:i?`${t} — refreshing`:h?`${t} — up to date`:a?`${t} — new mail`:t;return E.jsxs("div",{className:"relative inline-flex",children:[E.jsx(U,{variant:"ghost",size:u,icon:y,onClick:s,disabled:i,"aria-label":w,"aria-busy":i||void 0,title:n?r:t,className:c}),e==="idle"&&a&&E.jsx("span",{"aria-hidden":"true",className:"absolute right-1 top-1 size-1.5 rounded-full bg-accent-2"})]})}const ee=new Set(["discovering_mailboxes","syncing_inbox","syncing_others"]);function L(e){return!!e&&ee.has(e)}const q=3e3,te=q*2,T={syncing:!1,resolved:!1,synced:0,total:0};function we(e,s){const t=e.join(","),[r,a]=o.useState(!1),[u,c]=o.useState(!1);o.useEffect(()=>{a(!1),c(!1)},[t,s]),o.useEffect(()=>{if(!s)return;const m=setTimeout(()=>c(!0),te);return()=>clearTimeout(m)},[t,s]);const i=P({queries:e.map(m=>({...R({path:{accountId:m}}),enabled:s&&!r,refetchInterval:q,meta:{softError:!0}}))}),n=i.every(m=>m.isSuccess||m.isError),h=i.length===0||n||u;let y=!1,w=0,S=0;for(const m of i)if(L(m.data?.syncPhase)){y=!0;for(const l of m.data?.mailboxes??[])w+=l.messagesSynced,S+=l.messagesTotal}const x=s&&h&&!y;return o.useEffect(()=>{x&&a(!0)},[x]),!s||!h?T:{syncing:y,resolved:!0,synced:w,total:S}}const se=180*1e3,xe=30*1e3;let F=0;const M=new Set,ne=(e=Date.now())=>{F=e+se;for(const s of M)s()},pe=(e=Date.now())=>e<F,Ee=e=>(M.add(e),()=>{M.delete(e)}),_=6e4,re=new Set(["sent","drafts","trash","archive"]),C=(e,s)=>{const t=new Map;for(const r of e){const a=s.get(r.mailboxId)?.role;a&&re.has(a)||t.set(r.mailboxId,r.messagesTotal)}return t},j=(e,s)=>{const t=[];for(const[r,a]of s)a>(e.get(r)??0)&&t.push(r);return t},oe=(e,s)=>j(e,s).length>0,D=o.createContext(null),ae=()=>{const e=o.useContext(D);if(!e)throw new Error("useMailFreshness must be used inside <MailFreshnessProvider>");return e};function be({accountIds:e,children:s}){const t=O(),{resultFolderIndex:r}=$(),a=o.useRef(new Map),u=o.useRef(new Set),c=o.useRef(new Map),[i,n]=o.useState(new Set),h=P({queries:e.map(l=>({...R({path:{accountId:l}}),refetchInterval:_,staleTime:_,meta:{softError:!0}}))}),y=h.map(l=>l.dataUpdatedAt).join(","),w=e.join(",");o.useEffect(()=>{let l=!1;const f=new Set(i);e.forEach((d,p)=>{const b=h[p]?.data;if(!b)return;const g=C(b.mailboxes??[],r),k=c.current.get(d);if(c.current.set(d,g),k){const A=j(k,g);A.length>0&&Y(t,Z(A))}if(!u.current.has(d)){u.current.add(d),a.current.set(d,g);return}if(f.has(d))return;const K=a.current.get(d)??new Map;oe(K,g)&&(f.add(d),l=!0)}),l&&n(f)},[w,y]);const S=o.useCallback(l=>l.some(f=>i.has(f)),[i]),x=o.useCallback(l=>{n(f=>{if(l.every(p=>!f.has(p)))return f;const d=new Set(f);for(const p of l)d.delete(p);return d});for(const f of l){const d=t.getQueryData(R({path:{accountId:f}}).queryKey);a.current.set(f,C(d?.mailboxes??[],r)),u.current.add(f)}},[t,r]),m=o.useMemo(()=>({hasNewMail:S,acknowledge:x}),[S,x]);return E.jsx(D.Provider,{value:m,children:s})}const ie=2e3,ce=45e3,ue=e=>new Promise(s=>setTimeout(s,e)),v=e=>e instanceof Error&&e.message?e.message:"Something went wrong",le=e=>{I(e,{softError:!0},"user")&&X(e)},N=(e,s)=>e.fetchQuery({...R({path:{accountId:s}}),staleTime:0}),H=e=>e.mailboxes?.find(s=>s.fullPath?.toUpperCase()==="INBOX")?.lastSyncedAt??0,fe=async({accountId:e,readStatus:s,baselineLastSyncAt:t,baselineInboxSyncedAt:r=0,onInboxSynced:a,deadline:u,pollMs:c=ie})=>{let i=!1;for(;;){const n=await s().then(S=>({ok:!0,data:S})).catch(S=>({ok:!1,error:S}));if(!n.ok)return{accountId:e,message:v(n.error)};const{syncPhase:h,lastSyncAt:y}=n.data;if((y??0)>t&&!L(h))return h==="error"?{accountId:e,message:"Sync failed for this account"}:void 0;if(!i&&H(n.data)>r&&(i=!0,a?.()),Date.now()>=u)return{accountId:e,message:"Refresh is taking longer than usual"};await ue(c)}},de=async(e,s,t,r,a)=>{const u=await N(e,t).then(n=>({ok:!0,lastSyncAt:n.lastSyncAt??0,inboxSyncedAt:H(n)})).catch(n=>({ok:!1,error:n}));if(!u.ok)return{accountId:t,enqueued:!1,ok:!1,message:v(u.error)};const c=await B({path:{accountId:t},throwOnError:!0}).then(()=>({ok:!0})).catch(n=>({ok:!1,error:n}));if(!c.ok)return le(c.error),{accountId:t,enqueued:!1,ok:!1,message:v(c.error)};s.recordEvent("sync.triggered");const i=await fe({accountId:t,readStatus:()=>N(e,t),baselineLastSyncAt:u.lastSyncAt,baselineInboxSyncedAt:u.inboxSyncedAt,onInboxSynced:()=>a(t),deadline:r});return i?{accountId:t,enqueued:!0,ok:!1,message:i.message}:{accountId:t,enqueued:!0,ok:!0}},Re=(e,s={})=>{const t=O(),r=z(),{acknowledge:a}=ae(),[u,c]=o.useState("idle"),[i,n]=o.useState(),h=o.useRef(0),y=o.useRef(e);y.current=e;const w=o.useRef(s);w.current=s,o.useEffect(()=>{if(u!=="success")return;const x=setTimeout(()=>c("idle"),2e3);return()=>clearTimeout(x)},[u]);const S=o.useCallback(()=>{const x=y.current;if(x.length===0){c("error"),n("Nothing to refresh yet");return}const m=++h.current;c("refreshing"),n(void 0),ne();const l=f=>{h.current===m&&(t.invalidateQueries({queryKey:G({path:{accountId:f}})}),w.current.onSettled?.())};(async()=>{const f=Date.now()+ce,d=await Promise.all(x.map(g=>de(t,r,g,f,l)));if(h.current!==m)return;const p=d.filter(g=>g.enqueued).map(g=>g.accountId);for(const g of p)l(g);p.length>0&&a(p);const b=d.filter(g=>!g.ok);b.length===0?c("success"):(c("error"),n(b[0]?.message))})()},[a,t,r]);return{state:u,errorMessage:i,refresh:S}};export{xe as H,be as M,Se as R,Re as a,L as b,we as c,pe as i,Ee as s,ae as u};
@@ -1,4 +1,4 @@
1
- import{cc as V,r as g,j as a,t as b,I as Q,h as Y,as as q,i as X,au as Z,cu as J,bE as ee,aa as te,_ as se,X as re,cJ as R,C as ne,c4 as ae}from"./index-g8bgQtJZ.js";import{K as k}from"./kbd-DqC2ZgVF.js";import{B as oe,b as ie}from"./useMessageBodyContent-CuLDcpM3.js";import{i as ce}from"./search-scope-B5-OK3Cq.js";const le=(e,t)=>{const r=e==="newsletter"||e==="marketing"||t;return{framed:r,isPlain:!r}},de=()=>`
1
+ import{cg as V,r as g,j as a,t as b,I as Q,h as Y,as as q,i as X,au as Z,cy as J,bE as ee,aa as te,_ as se,X as re,cN as R,C as ne,c8 as ae}from"./index-CvHgBKzk.js";import{K as k}from"./kbd-CFfFFeOa.js";import{B as oe,b as ie}from"./useMessageBodyContent-DAz3qVkt.js";import{i as ce}from"./search-scope-B5-OK3Cq.js";const le=(e,t)=>{const r=e==="newsletter"||e==="marketing"||t;return{framed:r,isPlain:!r}},de=()=>`
2
2
  /* Zero the UA default body margin and clamp the document to the iframe width so
3
3
  wide author markup can't push the body (and the page) past the viewport. */
4
4
  html, body {
@@ -53,14 +53,14 @@ pre, code {
53
53
  :is(pre, code, pre *, code *):is([nowrap], [style*="nowrap" i]) {
54
54
  white-space: pre-wrap !important;
55
55
  }
56
- `,ue=e=>{const t=new Map;for(const s of e){if(!s.contentId||s.contentUrl.length===0)continue;const r=s.contentId.replace(/^<|>$/g,"");t.set(r,s.contentUrl)}return s=>t.get(s.replace(/^<|>$/g,""))},me=/^(none|transparent|inherit|initial|unset)\s*$/i,_=e=>{const t=[],s=/<style[^>]*>([\s\S]*?)<\/style>/gi;let r;for(r=s.exec(e);r!==null;)t.push(r[1]),r=s.exec(e);return t},fe=e=>{const t=/background(?:-color)?\s*:\s*([^;}\n]+)/gi;let s;for(s=t.exec(e);s!==null;){const r=s[1].trim();if(!me.test(r))return!0;s=t.exec(e)}return!1},he=e=>{if(/\bstyle\s*=\s*["'][^"']*background/i.test(e)||/\bbgcolor\s*=/i.test(e))return!0;for(const t of _(e))if(fe(t))return!0;return!1},ge=new Set(["auto","none","initial","inherit","unset","revert","revert-layer"]),pe=new RegExp(`(?<![-\\w])(?:padding|margin)(?:-(top|right|bottom|left|block|inline)(?:-(?:start|end))?)?\\s*:\\s*([^;}"']+)`,"gi"),be=new Set(["top","bottom","block"]),B=e=>e.replace(/\/\*[\s\S]*?\*\//g,""),E=e=>{const t=e.toLowerCase();if(!t||ge.has(t)||t.startsWith("-"))return!1;const s=/^\+?(\d*\.?\d+)[a-z%]*$/.exec(t);return s?Number.parseFloat(s[1])!==0:!0},ye=e=>{const t=e.split(/\s+/).filter(Boolean);return t.length<2?t:t.length<4?[t[1]]:[t[1],t[3]]},xe=(e,t)=>{if(e&&be.has(e))return!1;const s=t.replace(/!\s*important/gi,"").trim();return s?e?s.split(/\s+/).some(E):ye(s).some(E):!1},T=e=>{for(const t of B(e).matchAll(pe))if(xe(t[1],t[2]))return!0;return!1},I=new Set(["blockquote"]),we=e=>e.replace(/<!--[\s\S]*?-->/g,""),ve=e=>{const t=[],s=/<([a-zA-Z][\w:-]*)((?:"[^"]*"|'[^']*'|[^>"'])*)>/g,r=/\bstyle\s*=\s*(?:"([^"]*)"|'([^']*)')/gi;for(const[,n,o]of e.matchAll(s))for(const l of o.matchAll(r))t.push({tag:n.toLowerCase(),style:l[1]??l[2]??""});return t},ke=e=>[...B(e).matchAll(/([^{}]*)\{([^{}]*)\}/g)].map(t=>({selector:t[1].trim(),body:t[2]})),Ae=e=>{const t=e.trim().split(/[\s>+~]+/).pop()??"";return(/^[a-zA-Z][\w-]*/.exec(t)?.[0]??"").toLowerCase()},Se=e=>e.split(",").every(t=>I.has(Ae(t))),Ee=e=>{const t=_(e),s=we(e);if(/\bcellpadding\s*=\s*["']?(?!0["'\s>])\d/i.test(s))return!0;for(const{tag:r,style:n}of ve(s))if(!I.has(r)&&T(n))return!0;for(const r of t)for(const n of ke(r))if(!Se(n.selector)&&T(n.body))return!0;return!1},Te=["script","iframe","object","embed","form","input","button","textarea","select","meta","link","base"],Ce=["onerror","onload","onclick","onmouseover","onmouseout","onfocus","onblur","onsubmit","onkeydown","onkeyup","formaction","xlink:href","data-bind"],Ne="data:image/svg+xml,"+encodeURIComponent(`
56
+ `,ue=e=>{const t=new Map;for(const s of e){if(!s.contentId||s.contentUrl.length===0)continue;const r=s.contentId.replace(/^<|>$/g,"");t.set(r,s.contentUrl)}return s=>t.get(s.replace(/^<|>$/g,""))},me=/^(none|transparent|inherit|initial|unset)\s*$/i,_=e=>{const t=[],s=/<style[^>]*>([\s\S]*?)<\/style>/gi;let r;for(r=s.exec(e);r!==null;)t.push(r[1]),r=s.exec(e);return t},fe=e=>{const t=/background(?:-color)?\s*:\s*([^;}\n]+)/gi;let s;for(s=t.exec(e);s!==null;){const r=s[1].trim();if(!me.test(r))return!0;s=t.exec(e)}return!1},he=e=>{if(/\bstyle\s*=\s*["'][^"']*background/i.test(e)||/\bbgcolor\s*=/i.test(e))return!0;for(const t of _(e))if(fe(t))return!0;return!1},ge=new Set(["auto","none","initial","inherit","unset","revert","revert-layer"]),pe=new RegExp(`(?<![-\\w])(?:padding|margin)(?:-(top|right|bottom|left|block|inline)(?:-(?:start|end))?)?\\s*:\\s*([^;}"']+)`,"gi"),be=new Set(["top","bottom","block"]),B=e=>e.replace(/\/\*[\s\S]*?\*\//g,""),E=e=>{const t=e.toLowerCase();if(!t||ge.has(t)||t.startsWith("-"))return!1;const s=/^\+?(\d*\.?\d+)[a-z%]*$/.exec(t);return s?Number.parseFloat(s[1])!==0:!0},ye=e=>{const t=e.split(/\s+/).filter(Boolean);return t.length<2?t:t.length<4?[t[1]]:[t[1],t[3]]},xe=(e,t)=>{if(e&&be.has(e))return!1;const s=t.replace(/!\s*important/gi,"").trim();return s?e?s.split(/\s+/).some(E):ye(s).some(E):!1},T=e=>{for(const t of B(e).matchAll(pe))if(xe(t[1],t[2]))return!0;return!1},I=new Set(["blockquote"]),we=e=>e.replace(/<!--[\s\S]*?-->/g,""),ve=e=>{const t=[],s=/<([a-zA-Z][\w:-]*)((?:"[^"]*"|'[^']*'|[^>"'])*)>/g,r=/\bstyle\s*=\s*(?:"([^"]*)"|'([^']*)')/gi;for(const[,n,o]of e.matchAll(s))for(const l of o.matchAll(r))t.push({tag:n.toLowerCase(),style:l[1]??l[2]??""});return t},ke=e=>[...B(e).matchAll(/([^{}]*)\{([^{}]*)\}/g)].map(t=>({selector:t[1].trim(),body:t[2]})),Ae=e=>{const t=e.trim().split(/[\s>+~]+/).pop()??"";return(/^[a-zA-Z][\w-]*/.exec(t)?.[0]??"").toLowerCase()},Se=e=>e.split(",").every(t=>I.has(Ae(t))),Ee=e=>{const t=_(e),s=we(e);if(/\bcellpadding\s*=\s*["']?(?!0["'\s>])\d/i.test(s))return!0;for(const{tag:r,style:n}of ve(s))if(!I.has(r)&&T(n))return!0;for(const r of t)for(const n of ke(r))if(!Se(n.selector)&&T(n.body))return!0;return!1},Te=["script","iframe","object","embed","form","input","button","textarea","select","meta","link","base"],Ne=["onerror","onload","onclick","onmouseover","onmouseout","onfocus","onblur","onsubmit","onkeydown","onkeyup","formaction","xlink:href","data-bind"],Ce="data:image/svg+xml,"+encodeURIComponent(`
57
57
  <svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 100 100">
58
58
  <rect fill="#f0f0f0" width="100" height="100"/>
59
59
  <text x="50" y="50" text-anchor="middle" dy=".3em" fill="#999" font-size="12">
60
60
  Image blocked
61
61
  </text>
62
62
  </svg>
63
- `),je=e=>e.replace(/url\s*\([^)]*\)/gi,"none").replace(/expression\s*\([^)]*\)/gi,"").replace(/-moz-binding\s*:[^;]*/gi,""),Le=e=>e.replace(/@import[^;]*;/gi,"/* @import blocked */").replace(/url\s*\([^)]*\)/gi,"none").replace(/expression\s*\([^)]*\)/gi,"").replace(/-moz-binding\s*:[^;]*/gi,""),Re=(e={})=>{const t=V(),s={FORBID_TAGS:Te,FORBID_ATTR:Ce,ALLOW_DATA_ATTR:!1,ALLOW_UNKNOWN_PROTOCOLS:!1};return t.addHook("afterSanitizeAttributes",r=>{if(r.tagName==="IMG"){const n=r.getAttribute("src")||"";if(n.startsWith("data:"))return;if(n.startsWith("cid:")){const l=n.slice(4).replace(/^<|>$/g,""),m=e.resolveCid?.(l);m&&(r.setAttribute("src",m),r.classList.add("inline-content"));return}e.allowExternalImages||(r.setAttribute("data-blocked-src",n),r.setAttribute("src",Ne),r.setAttribute("alt","[Blocked image]"),r.classList.add("blocked-image"))}if(r.tagName==="A"){const n=r.getAttribute("href")||"";if(/^(javascript|data):/i.test(n)){r.removeAttribute("href");return}r.setAttribute("target","_blank"),r.setAttribute("rel","noopener noreferrer nofollow"),r.classList.add("external-link")}if(r.hasAttribute("style")){const n=r.getAttribute("style")||"";r.setAttribute("style",je(n))}}),t.addHook("uponSanitizeElement",(r,n)=>{if(n.tagName==="style"){const o=r.textContent||"";r.textContent=Le(o)}}),r=>{const n=he(r),o=Ee(r),l=t.sanitize(r,s);return{html:`<style>${de()}</style>${l}`,hasAuthorBackground:n,hasAuthorSpacing:o}}},_e='"Geist Variable", "Geist", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif',v={light:{fg:"oklch(0.3 0.025 235)",canvas:"oklch(0.96 0.015 90)",accent:"oklch(0.55 0.14 150)"},dark:{fg:"oklch(0.88 0.02 90)",canvas:"oklch(0.22 0.025 220)",accent:"oklch(0.78 0.16 150)"}},Be={background:!1,spacing:!1},Ie="16px",Me=()=>`html{padding:0}body{padding:${Ie};box-sizing:border-box}`,Oe=()=>"html{overflow:hidden}body{overflow-x:auto}",$e=/prefers-color-scheme\s*:\s*dark|color-scheme\s*:\s*[^;}"']*\bdark\b/i,De='<meta name="viewport" content="width=device-width, initial-scale=1">',ze=e=>{const t=e?v.dark:v.light;return`
63
+ `),je=e=>e.replace(/url\s*\([^)]*\)/gi,"none").replace(/expression\s*\([^)]*\)/gi,"").replace(/-moz-binding\s*:[^;]*/gi,""),Le=e=>e.replace(/@import[^;]*;/gi,"/* @import blocked */").replace(/url\s*\([^)]*\)/gi,"none").replace(/expression\s*\([^)]*\)/gi,"").replace(/-moz-binding\s*:[^;]*/gi,""),Re=(e={})=>{const t=V(),s={FORBID_TAGS:Te,FORBID_ATTR:Ne,ALLOW_DATA_ATTR:!1,ALLOW_UNKNOWN_PROTOCOLS:!1};return t.addHook("afterSanitizeAttributes",r=>{if(r.tagName==="IMG"){const n=r.getAttribute("src")||"";if(n.startsWith("data:"))return;if(n.startsWith("cid:")){const l=n.slice(4).replace(/^<|>$/g,""),m=e.resolveCid?.(l);m&&(r.setAttribute("src",m),r.classList.add("inline-content"));return}e.allowExternalImages||(r.setAttribute("data-blocked-src",n),r.setAttribute("src",Ce),r.setAttribute("alt","[Blocked image]"),r.classList.add("blocked-image"))}if(r.tagName==="A"){const n=r.getAttribute("href")||"";if(/^(javascript|data):/i.test(n)){r.removeAttribute("href");return}r.setAttribute("target","_blank"),r.setAttribute("rel","noopener noreferrer nofollow"),r.classList.add("external-link")}if(r.hasAttribute("style")){const n=r.getAttribute("style")||"";r.setAttribute("style",je(n))}}),t.addHook("uponSanitizeElement",(r,n)=>{if(n.tagName==="style"){const o=r.textContent||"";r.textContent=Le(o)}}),r=>{const n=he(r),o=Ee(r),l=t.sanitize(r,s);return{html:`<style>${de()}</style>${l}`,hasAuthorBackground:n,hasAuthorSpacing:o}}},_e='"Geist Variable", "Geist", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif',v={light:{fg:"oklch(0.3 0.025 235)",canvas:"oklch(0.96 0.015 90)",accent:"oklch(0.55 0.14 150)"},dark:{fg:"oklch(0.88 0.02 90)",canvas:"oklch(0.22 0.025 220)",accent:"oklch(0.78 0.16 150)"}},Be={background:!1,spacing:!1},Ie="16px",Me=()=>`html{padding:0}body{padding:${Ie};box-sizing:border-box}`,Oe=()=>"html{overflow:hidden}body{overflow-x:auto}",$e=/prefers-color-scheme\s*:\s*dark|color-scheme\s*:\s*[^;}"']*\bdark\b/i,De='<meta name="viewport" content="width=device-width, initial-scale=1">',ze=e=>{const t=e?v.dark:v.light;return`
64
64
  /* Plain-email base: UI font-stack + theme-aware colors (#424) */
65
65
  html, body {
66
66
  font-family: ${_e};
@@ -81,4 +81,4 @@ a, a:visited {
81
81
  color: ${t.accent} !important;
82
82
  text-decoration: underline;
83
83
  }
84
- `},S="invert(0.92) hue-rotate(180deg)",C=`img,picture,video,svg,canvas,[style*='background-image'],[background]{filter:${S}}`,Pe=(e,t,s)=>{const r=e?v.dark.canvas:v.light.canvas;return s?e?t?`html,body{margin:0;background-color:${r};color-scheme:dark light}`:`html{margin:0;background-color:#ffffff;filter:${S}}body{margin:0}${C}`:"html,body{margin:0;background-color:#ffffff;color-scheme:light}":e?t?`html,body{margin:0;background-color:${r};color-scheme:dark light}`:`html{margin:0;background-color:${r}}body{margin:0;filter:${S}}${C}`:`html,body{margin:0;background-color:${r};color-scheme:light}`},Ke=(e,t,s,r=Be)=>{const n=t==="plain"?ze(s):Pe(s,$e.test(e),r.background),o=r.spacing?"":Me();return`${De}<style>${n}</style>${e}<style>${Oe()}${o}</style>`},Fe=5e4,He="allow-same-origin allow-popups allow-popups-to-escape-sandbox",Ue=(e,t,s)=>Math.min(Math.ceil(Math.max(e,t)),s),Ge=new Set(["Enter","Escape","ArrowUp","ArrowDown","ArrowLeft","ArrowRight","Home","End"]),We=e=>e===" "?!1:e.length===1?!0:Ge.has(e),A=e=>{if(e.metaKey||e.ctrlKey||e.altKey||!We(e.key))return;const t=e.currentTarget??e.target,s=t?.defaultView?.parent;!s||s===t?.defaultView||s.dispatchEvent(new KeyboardEvent("keydown",{key:e.key,code:e.code,shiftKey:e.shiftKey,bubbles:!0,cancelable:!0}))},N=({html:e,variant:t="framed",isDark:s=!1,declares:r,className:n})=>{const o=g.useRef(null),[l,m]=g.useState(0),d=g.useMemo(()=>Ke(e,t,s,r),[e,t,s,r]);return g.useEffect(()=>{const c=o.current;if(!c)return;const f=()=>{const i=c.contentDocument;if(!i?.body)return;const x=i.documentElement,y=Ue(i.body.scrollHeight,x?.scrollHeight??0,Fe);m(w=>w===y?w:y)};let u,h;const p=()=>{f(),u?.disconnect(),u=void 0,h?.removeEventListener("keydown",A),h?.removeEventListener("load",f,!0),h=void 0;const i=c.contentDocument;i?.body&&(u=new ResizeObserver(f),u.observe(i.body),i.documentElement&&u.observe(i.documentElement),i.addEventListener("load",f,!0),i.fonts?.ready.then(f),i.addEventListener("keydown",A),h=i)};return c.addEventListener("load",p),()=>{c.removeEventListener("load",p),h?.removeEventListener("keydown",A),h?.removeEventListener("load",f,!0),u?.disconnect()}},[]),a.jsx("iframe",{ref:o,title:"Email content",sandbox:He,srcDoc:d,className:n,style:{width:"100%",border:"none",display:"block",height:l===0?"1px":`${l}px`,colorScheme:"normal"}})},j=()=>a.jsx("p",{className:"text-fg-muted text-sm italic",children:"This message has no body content."}),vt=({className:e,children:t})=>a.jsx("div",{className:b("[&_.message-body-frame]:-mx-2 lg:[&_.message-body-frame]:-mx-4",e),children:t}),Ve=({html:e,text:t,isDark:s=!1,category:r,allowImages:n=!1,resolveCid:o,className:l,renderBlockedNotice:m})=>{const d=g.useMemo(()=>!e||typeof document>"u"?null:Re({allowExternalImages:n,resolveCid:o})(e),[e,n,o]),c=d?.html??null,{framed:f,isPlain:u}=le(r,d?.hasAuthorBackground??!1),h=g.useMemo(()=>({background:d?.hasAuthorBackground??!1,spacing:d?.hasAuthorSpacing??!1}),[d?.hasAuthorBackground,d?.hasAuthorSpacing]),p=g.useMemo(()=>!c||n?0:(c.match(/data-blocked-src/g)||[]).length,[c,n]);return!c&&!t?a.jsx("div",{className:b("message-body",l),children:a.jsx(j,{})}):a.jsxs("div",{className:b("message-body",l),children:[p>0&&a.jsx("div",{children:m?.(p)}),c?a.jsx("div",{className:"message-body-frame",children:f?a.jsx("div",{className:"w-full max-w-full",children:a.jsx(N,{html:c,variant:"framed",isDark:s,declares:h})}):a.jsx("div",{className:"max-w-full lg:max-w-2xl",children:a.jsx(N,{html:c,variant:u?"plain":"framed",isDark:s,declares:h})})}):t?a.jsx("pre",{className:"email-text whitespace-pre-wrap text-sm leading-relaxed",children:t}):a.jsx(j,{})]})};function kt({message:e="Select a thread to read",icon:t,showHints:s=!0,className:r}){return a.jsxs("div",{className:b("flex flex-1 flex-col items-center justify-center text-center",r),children:[t??a.jsx(Q,{className:"size-10 text-fg-subtle"}),a.jsx("p",{className:"mt-3 text-sm text-fg-muted",children:e}),s&&a.jsxs("p",{className:"text-2xs text-fg-subtle",children:[a.jsx(k,{children:"j"})," / ",a.jsx(k,{children:"k"})," to move, ",a.jsx(k,{children:"Enter"})," to open"]})]})}function M(e){const t=[];let s=-1,r=!1;for(let n=0;n<e.length;n++){const o=e[n];if(o==='"'){r=!r,s<0&&(s=n);continue}if(!r&&/\s/.test(o)){s>=0&&t.push({raw:e.slice(s,n),start:s,end:n}),s=-1;continue}s<0&&(s=n)}return s>=0&&t.push({raw:e.slice(s),start:s,end:e.length}),t}const Qe=e=>{if(!e.startsWith('"'))return e;const t=e.slice(1);return t.endsWith('"')?t.slice(0,-1):t};function Ye(e){const t=e.indexOf(":");if(t<=0)return;const s=e.slice(t+1);return{name:e.slice(0,t).toLowerCase(),value:Qe(s),rawValue:s}}const qe=e=>/[\s"]/.test(e),Xe=e=>qe(e)?`"${e.replace(/"/g,"")}"`:e,At=(e,t)=>`${e}:${Xe(t)}`,O=(e,t=Date.now())=>({value:e,setAt:t}),Ze=(e,t,s,r)=>{if(e.addressId!==t)return e;const n={...e.flags??{}};return s?n.trusted=O(!0,r):delete n.trusted,{...e,flags:n}},Je=(e,t,s,r)=>{const n=o=>o.map(l=>Ze(l,t,s,r));return{...e,envelope:{...e.envelope,from:n(e.envelope.from),to:n(e.envelope.to),cc:n(e.envelope.cc),bcc:n(e.envelope.bcc),replyTo:n(e.envelope.replyTo)}}},et=({messageId:e})=>{const t=Y(),{pushError:s}=q(),{mutate:r,isPending:n,error:o,reset:l}=X({...ee(),onMutate:async d=>{const c=d.path.addressId,u=d.body.flags?.trusted?.value===!0,h=J({path:{messageId:e}});await t.cancelQueries({queryKey:h});const p=t.getQueriesData({queryKey:h}).filter(i=>i[1]!==void 0).map(([i,x])=>({queryKey:i,data:x}));return t.setQueriesData({queryKey:h},i=>i&&Je(i,c,u)),{describePrefix:h,previous:p}},onError:(d,c,f)=>{if(f)for(const u of f.previous)t.setQueryData(u.queryKey,u.data);s(Z("Couldn't trust sender","The change wasn't saved.",d))},onSettled:(d,c,f,u)=>{u&&t.invalidateQueries({queryKey:u.describePrefix})}});return{toggleTrusted:(d,c)=>{r({path:{addressId:d},body:{flags:{trusted:O(!c)}}})},isPending:n,error:o,reset:l}},tt=()=>{const[e,t]=g.useState(()=>typeof document<"u"&&document.documentElement.classList.contains("dark"));return g.useEffect(()=>{const s=document.documentElement,r=new MutationObserver(()=>{t(s.classList.contains("dark"))});return r.observe(s,{attributes:!0,attributeFilter:["class"]}),()=>r.disconnect()},[]),e},st=({blockedImageCount:e,canAlwaysTrust:t,isTrustPending:s,onLoadOnce:r,onAlwaysTrust:n})=>a.jsxs("div",{className:"mb-3 flex items-center justify-between rounded-md bg-surface-sunken/50 px-3 py-2 text-sm",children:[a.jsxs("span",{className:"text-fg-muted",children:[e," image",e>1?"s":""," blocked for privacy"]}),a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("button",{type:"button",onClick:r,className:"text-accent hover:underline",children:"Load once"}),t&&a.jsx("button",{type:"button",onClick:n,"aria-busy":s,className:"text-accent hover:underline aria-busy:opacity-50",children:s?"Trusting…":"Always trust"})]})]}),rt=(e,t)=>{switch(e){case"auth":return{title:"Your session expired",detail:"Sign in again to reload the message body. Other parts of the app may also stop responding until you do."};case"body-missing":return{title:"Message body is missing in storage",detail:"A sync failure may have left this message without its body bytes. Contact support, or run the reconcile script to refetch from the upstream IMAP server."};case"content-type-mismatch":return{title:"Couldn't load message body",detail:"The server returned an unexpected content type for this part. The message body has not been rendered to keep you safe."};case"spa-shell-leak":return{title:"Couldn't load message body",detail:"The server returned the app shell instead of the message body. This is an infrastructure bug — please report it."};case"not-ready":return{title:"Message body is still syncing",detail:"This message's body hasn't finished downloading from the mail server yet. It should appear shortly — reopen the message to try again."};default:return{title:"Couldn't load message body",detail:t}}},nt=e=>e instanceof oe?e.reason:"generic",at=e=>e instanceof Error?e.message:typeof e=="string"?e:"An unexpected error occurred while loading the message body.",ot=({error:e,onRetry:t})=>{const s=nt(e),r=at(e),{title:n,detail:o}=rt(s,r),[l,m]=g.useState(!1),{Account:d}=te();return l?null:a.jsxs("div",{role:"alert","data-testid":"message-body-error-banner","data-reason":s,className:"flex items-start gap-2 rounded-md border border-danger/40 bg-danger-soft px-3 py-2 text-sm",children:[a.jsx(se,{className:"size-4 shrink-0 text-danger mt-0.5","aria-hidden":"true"}),a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsx("p",{className:"font-medium text-danger",children:n}),a.jsx("p",{className:"text-fg-muted mt-1 break-words",children:o})]}),a.jsxs("div",{className:"flex shrink-0 items-center gap-3",children:[s==="auth"&&a.jsx(d,{children:({signOut:c})=>a.jsx("button",{type:"button",onClick:()=>c(),className:"text-sm font-medium text-accent hover:underline",children:"Sign in again"})}),t&&a.jsx("button",{type:"button",onClick:t,className:"text-sm font-medium text-accent hover:underline",children:"Retry"}),a.jsx("button",{type:"button",onClick:()=>m(!0),"aria-label":"Dismiss message body error",className:"rounded-md p-1 text-fg-muted hover:bg-surface-raised hover:text-fg transition-colors",children:a.jsx(re,{className:"size-4","aria-hidden":"true"})})]})]})},it=()=>a.jsxs("div",{className:"animate-pulse space-y-2",role:"status","aria-label":"Loading message body",children:[a.jsx("div",{className:"h-4 bg-surface-sunken rounded w-full"}),a.jsx("div",{className:"h-4 bg-surface-sunken rounded w-11/12"}),a.jsx("div",{className:"h-4 bg-surface-sunken rounded w-3/4"}),a.jsx("div",{className:"h-4 bg-surface-sunken rounded w-5/6"})]}),L=()=>a.jsx("p",{className:"text-fg-muted text-sm italic",children:"This message has no body content."}),St=({bodyParts:e,html:t,text:s,isTrusted:r=!1,messageId:n,fromAddressId:o,category:l,className:m})=>{const[d,c]=g.useState(!1),f=r||d,u=tt(),{toggleTrusted:h,isPending:p}=et({messageId:n??""}),i=!!e&&e.length>0,{picked:x,data:y,isLoading:w,isError:D,error:z,refetch:P}=ie({messageId:n,bodyParts:e,enabled:i}),K=g.useMemo(()=>ue(e??[]),[e]),F=i&&y?.kind==="html"?y.body:t,H=i&&y?.kind==="text"?y.body:s;if(i){if(w)return a.jsx("div",{className:b("message-body",m),children:a.jsx(it,{})});if(D)return a.jsx("div",{className:b("message-body",m),children:a.jsx(ot,{error:z,onRetry:()=>P()})});if(!x)return a.jsx("div",{className:b("message-body",m),children:a.jsx(L,{})})}else if(!t&&!s)return a.jsx("div",{className:b("message-body",m),children:a.jsx(L,{})});const U=!!(o&&n),G=()=>{!o||p||(c(!0),h(o,!1))};return a.jsx(Ve,{className:m,html:F,text:H,isDark:u,category:l,allowImages:f,resolveCid:K,renderBlockedNotice:W=>a.jsx(st,{blockedImageCount:W,canAlwaysTrust:U,isTrustPending:p,onLoadOnce:()=>c(!0),onAlwaysTrust:G})})},$={personal:"Personal",uncategorized:"Unclassified",transactional:"Transactional",newsletter:"Newsletter",marketing:"Marketing",social:"Social",automated:"Automated"},ct=Object.values(R).map(e=>({value:e,label:$[e]})),lt={unclassified:"uncategorized"},dt=[{name:"from",label:"Sender",values:"contact"},{name:"subject",label:"Subject",values:"text"},{name:"category",label:"Category",values:"fixed",options:ct},{name:"is",label:"State",values:"fixed",options:[{value:"unread",label:"Unread"},{value:"read",label:"Read"},{value:"starred",label:"Starred"}]},{name:"has",label:"Contents",values:"fixed",options:[{value:"attachment",label:"Has attachment"}]},{name:"in",label:"Folder",values:"mailbox"},{name:"account",label:"Account",values:"account"},{name:"after",label:"Sent on or after",values:"date"},{name:"before",label:"Sent before",values:"date"}],ut=new Map(dt.map(e=>[e.name,e])),Et=e=>ut.get(e.toLowerCase()),mt=/^\d{4}-\d{2}-\d{2}$/;function ft(e,t,s){if(!mt.test(s))return;const r=Date.parse(`${s}T00:00:00Z`);if(!Number.isNaN(r))return{type:e,raw:t,value:s,epochSeconds:Math.floor(r/1e3)}}function ht(e){const t=e.toLowerCase(),s=lt[t];return s||Object.values(R).find(n=>n===t)}function gt(e,t){switch(t.toLowerCase()){case"unread":return{type:"isUnread",raw:e};case"read":return{type:"isRead",raw:e};case"starred":case"flagged":return{type:"isStarred",raw:e};default:return}}function pt(e,t){const s=Ye(e);if(!s||s.value.length===0)return;const{name:r,value:n}=s;switch(r){case"from":return{type:"from",raw:e,value:n};case"subject":return{type:"subject",raw:e,value:n};case"category":{const o=ht(n);return o?{type:"category",raw:e,value:n,category:o}:void 0}case"is":return gt(e,n);case"has":return n.toLowerCase()==="attachment"?{type:"hasAttachment",raw:e}:void 0;case"before":case"after":return ft(r,e,n);case"in":{const o=t.mailboxesByName?.get(n.toLowerCase());return o?{type:"in",raw:e,value:n,mailboxId:o}:void 0}case"account":{const o=t.accountsByName?.get(n.toLowerCase());return o?{type:"account",raw:e,value:n,accountId:o}:void 0}default:return}}function Tt(e,t={}){const s=[],r=[];for(const n of M(e)){const o=pt(n.raw,t);o?s.push(o):r.push(n.raw)}return{freeText:r.join(" "),tokens:s}}function Ct(e,t){return M(e).filter(s=>s.raw!==t.raw).map(s=>s.raw).join(" ")}function Nt(e){switch(e.type){case"from":return`From: ${e.value}`;case"subject":return`Subject: ${e.value}`;case"category":return`Category: ${$[e.category]}`;case"hasAttachment":return"Has attachment";case"isUnread":return"Unread";case"isRead":return"Read";case"isStarred":return"Starred";case"before":return`Before ${e.value}`;case"after":return`After ${e.value}`;case"in":return`In: ${e.value}`;case"account":return`Account: ${e.value}`}}function jt(){const{mailboxNameIndex:e,accountNameIndex:t}=ne(),s=ae();return{...ce(s)?{}:{mailboxesByName:e},accountsByName:t}}export{vt as M,kt as R,dt as S,Ve as a,et as b,St as c,Et as d,M as e,Ye as f,At as g,Tt as p,Ct as r,Nt as s,jt as u};
84
+ `},S="invert(0.92) hue-rotate(180deg)",N=`img,picture,video,svg,canvas,[style*='background-image'],[background]{filter:${S}}`,Pe=(e,t,s)=>{const r=e?v.dark.canvas:v.light.canvas;return s?e?t?`html,body{margin:0;background-color:${r};color-scheme:dark light}`:`html{margin:0;background-color:#ffffff;filter:${S}}body{margin:0}${N}`:"html,body{margin:0;background-color:#ffffff;color-scheme:light}":e?t?`html,body{margin:0;background-color:${r};color-scheme:dark light}`:`html{margin:0;background-color:${r}}body{margin:0;filter:${S}}${N}`:`html,body{margin:0;background-color:${r};color-scheme:light}`},Ke=(e,t,s,r=Be)=>{const n=t==="plain"?ze(s):Pe(s,$e.test(e),r.background),o=r.spacing?"":Me();return`${De}<style>${n}</style>${e}<style>${Oe()}${o}</style>`},Fe=5e4,He="allow-same-origin allow-popups allow-popups-to-escape-sandbox",Ue=(e,t,s)=>Math.min(Math.ceil(Math.max(e,t)),s),Ge=new Set(["Enter","Escape","ArrowUp","ArrowDown","ArrowLeft","ArrowRight","Home","End"]),We=e=>e===" "?!1:e.length===1?!0:Ge.has(e),A=e=>{if(e.metaKey||e.ctrlKey||e.altKey||!We(e.key))return;const t=e.currentTarget??e.target,s=t?.defaultView?.parent;!s||s===t?.defaultView||s.dispatchEvent(new KeyboardEvent("keydown",{key:e.key,code:e.code,shiftKey:e.shiftKey,bubbles:!0,cancelable:!0}))},C=({html:e,variant:t="framed",isDark:s=!1,declares:r,className:n})=>{const o=g.useRef(null),[l,m]=g.useState(0),d=g.useMemo(()=>Ke(e,t,s,r),[e,t,s,r]);return g.useEffect(()=>{const c=o.current;if(!c)return;const f=()=>{const i=c.contentDocument;if(!i?.body)return;const x=i.documentElement,y=Ue(i.body.scrollHeight,x?.scrollHeight??0,Fe);m(w=>w===y?w:y)};let u,h;const p=()=>{f(),u?.disconnect(),u=void 0,h?.removeEventListener("keydown",A),h?.removeEventListener("load",f,!0),h=void 0;const i=c.contentDocument;i?.body&&(u=new ResizeObserver(f),u.observe(i.body),i.documentElement&&u.observe(i.documentElement),i.addEventListener("load",f,!0),i.fonts?.ready.then(f),i.addEventListener("keydown",A),h=i)};return c.addEventListener("load",p),()=>{c.removeEventListener("load",p),h?.removeEventListener("keydown",A),h?.removeEventListener("load",f,!0),u?.disconnect()}},[]),a.jsx("iframe",{ref:o,title:"Email content",sandbox:He,srcDoc:d,className:n,style:{width:"100%",border:"none",display:"block",height:l===0?"1px":`${l}px`,colorScheme:"normal"}})},j=()=>a.jsx("p",{className:"text-fg-muted text-sm italic",children:"This message has no body content."}),vt=({className:e,children:t})=>a.jsx("div",{className:b("[&_.message-body-frame]:-mx-2 lg:[&_.message-body-frame]:-mx-4",e),children:t}),Ve=({html:e,text:t,isDark:s=!1,category:r,allowImages:n=!1,resolveCid:o,className:l,renderBlockedNotice:m})=>{const d=g.useMemo(()=>!e||typeof document>"u"?null:Re({allowExternalImages:n,resolveCid:o})(e),[e,n,o]),c=d?.html??null,{framed:f,isPlain:u}=le(r,d?.hasAuthorBackground??!1),h=g.useMemo(()=>({background:d?.hasAuthorBackground??!1,spacing:d?.hasAuthorSpacing??!1}),[d?.hasAuthorBackground,d?.hasAuthorSpacing]),p=g.useMemo(()=>!c||n?0:(c.match(/data-blocked-src/g)||[]).length,[c,n]);return!c&&!t?a.jsx("div",{className:b("message-body",l),children:a.jsx(j,{})}):a.jsxs("div",{className:b("message-body",l),children:[p>0&&a.jsx("div",{children:m?.(p)}),c?a.jsx("div",{className:"message-body-frame",children:f?a.jsx("div",{className:"w-full max-w-full",children:a.jsx(C,{html:c,variant:"framed",isDark:s,declares:h})}):a.jsx("div",{className:"max-w-full lg:max-w-2xl",children:a.jsx(C,{html:c,variant:u?"plain":"framed",isDark:s,declares:h})})}):t?a.jsx("pre",{className:"email-text whitespace-pre-wrap text-sm leading-relaxed",children:t}):a.jsx(j,{})]})};function kt({message:e="Select a thread to read",icon:t,showHints:s=!0,className:r}){return a.jsxs("div",{className:b("flex flex-1 flex-col items-center justify-center text-center",r),children:[t??a.jsx(Q,{className:"size-10 text-fg-subtle"}),a.jsx("p",{className:"mt-3 text-sm text-fg-muted",children:e}),s&&a.jsxs("p",{className:"text-2xs text-fg-subtle",children:[a.jsx(k,{children:"j"})," / ",a.jsx(k,{children:"k"})," to move, ",a.jsx(k,{children:"Enter"})," to open"]})]})}function M(e){const t=[];let s=-1,r=!1;for(let n=0;n<e.length;n++){const o=e[n];if(o==='"'){r=!r,s<0&&(s=n);continue}if(!r&&/\s/.test(o)){s>=0&&t.push({raw:e.slice(s,n),start:s,end:n}),s=-1;continue}s<0&&(s=n)}return s>=0&&t.push({raw:e.slice(s),start:s,end:e.length}),t}const Qe=e=>{if(!e.startsWith('"'))return e;const t=e.slice(1);return t.endsWith('"')?t.slice(0,-1):t};function Ye(e){const t=e.indexOf(":");if(t<=0)return;const s=e.slice(t+1);return{name:e.slice(0,t).toLowerCase(),value:Qe(s),rawValue:s}}const qe=e=>/[\s"]/.test(e),Xe=e=>qe(e)?`"${e.replace(/"/g,"")}"`:e,At=(e,t)=>`${e}:${Xe(t)}`,O=(e,t=Date.now())=>({value:e,setAt:t}),Ze=(e,t,s,r)=>{if(e.addressId!==t)return e;const n={...e.flags??{}};return s?n.trusted=O(!0,r):delete n.trusted,{...e,flags:n}},Je=(e,t,s,r)=>{const n=o=>o.map(l=>Ze(l,t,s,r));return{...e,envelope:{...e.envelope,from:n(e.envelope.from),to:n(e.envelope.to),cc:n(e.envelope.cc),bcc:n(e.envelope.bcc),replyTo:n(e.envelope.replyTo)}}},et=({messageId:e})=>{const t=Y(),{pushError:s}=q(),{mutate:r,isPending:n,error:o,reset:l}=X({...ee(),onMutate:async d=>{const c=d.path.addressId,u=d.body.flags?.trusted?.value===!0,h=J({path:{messageId:e}});await t.cancelQueries({queryKey:h});const p=t.getQueriesData({queryKey:h}).filter(i=>i[1]!==void 0).map(([i,x])=>({queryKey:i,data:x}));return t.setQueriesData({queryKey:h},i=>i&&Je(i,c,u)),{describePrefix:h,previous:p}},onError:(d,c,f)=>{if(f)for(const u of f.previous)t.setQueryData(u.queryKey,u.data);s(Z("Couldn't trust sender","The change wasn't saved.",d))},onSettled:(d,c,f,u)=>{u&&t.invalidateQueries({queryKey:u.describePrefix})}});return{toggleTrusted:(d,c)=>{r({path:{addressId:d},body:{flags:{trusted:O(!c)}}})},isPending:n,error:o,reset:l}},tt=()=>{const[e,t]=g.useState(()=>typeof document<"u"&&document.documentElement.classList.contains("dark"));return g.useEffect(()=>{const s=document.documentElement,r=new MutationObserver(()=>{t(s.classList.contains("dark"))});return r.observe(s,{attributes:!0,attributeFilter:["class"]}),()=>r.disconnect()},[]),e},st=({blockedImageCount:e,canAlwaysTrust:t,isTrustPending:s,onLoadOnce:r,onAlwaysTrust:n})=>a.jsxs("div",{className:"mb-3 flex items-center justify-between rounded-md bg-surface-sunken/50 px-3 py-2 text-sm",children:[a.jsxs("span",{className:"text-fg-muted",children:[e," image",e>1?"s":""," blocked for privacy"]}),a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("button",{type:"button",onClick:r,className:"text-accent hover:underline",children:"Load once"}),t&&a.jsx("button",{type:"button",onClick:n,"aria-busy":s,className:"text-accent hover:underline aria-busy:opacity-50",children:s?"Trusting…":"Always trust"})]})]}),rt=(e,t)=>{switch(e){case"auth":return{title:"Your session expired",detail:"Sign in again to reload the message body. Other parts of the app may also stop responding until you do."};case"body-missing":return{title:"Message body is missing in storage",detail:"A sync failure may have left this message without its body bytes. Contact support, or run the reconcile script to refetch from the upstream IMAP server."};case"content-type-mismatch":return{title:"Couldn't load message body",detail:"The server returned an unexpected content type for this part. The message body has not been rendered to keep you safe."};case"spa-shell-leak":return{title:"Couldn't load message body",detail:"The server returned the app shell instead of the message body. This is an infrastructure bug — please report it."};case"not-ready":return{title:"Message body is still syncing",detail:"This message's body hasn't finished downloading from the mail server yet. It should appear shortly — reopen the message to try again."};default:return{title:"Couldn't load message body",detail:t}}},nt=e=>e instanceof oe?e.reason:"generic",at=e=>e instanceof Error?e.message:typeof e=="string"?e:"An unexpected error occurred while loading the message body.",ot=({error:e,onRetry:t})=>{const s=nt(e),r=at(e),{title:n,detail:o}=rt(s,r),[l,m]=g.useState(!1),{Account:d}=te();return l?null:a.jsxs("div",{role:"alert","data-testid":"message-body-error-banner","data-reason":s,className:"flex items-start gap-2 rounded-md border border-danger/40 bg-danger-soft px-3 py-2 text-sm",children:[a.jsx(se,{className:"size-4 shrink-0 text-danger mt-0.5","aria-hidden":"true"}),a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsx("p",{className:"font-medium text-danger",children:n}),a.jsx("p",{className:"text-fg-muted mt-1 break-words",children:o})]}),a.jsxs("div",{className:"flex shrink-0 items-center gap-3",children:[s==="auth"&&a.jsx(d,{children:({signOut:c})=>a.jsx("button",{type:"button",onClick:()=>c(),className:"text-sm font-medium text-accent hover:underline",children:"Sign in again"})}),t&&a.jsx("button",{type:"button",onClick:t,className:"text-sm font-medium text-accent hover:underline",children:"Retry"}),a.jsx("button",{type:"button",onClick:()=>m(!0),"aria-label":"Dismiss message body error",className:"rounded-md p-1 text-fg-muted hover:bg-surface-raised hover:text-fg transition-colors",children:a.jsx(re,{className:"size-4","aria-hidden":"true"})})]})]})},it=()=>a.jsxs("div",{className:"animate-pulse space-y-2",role:"status","aria-label":"Loading message body",children:[a.jsx("div",{className:"h-4 bg-surface-sunken rounded w-full"}),a.jsx("div",{className:"h-4 bg-surface-sunken rounded w-11/12"}),a.jsx("div",{className:"h-4 bg-surface-sunken rounded w-3/4"}),a.jsx("div",{className:"h-4 bg-surface-sunken rounded w-5/6"})]}),L=()=>a.jsx("p",{className:"text-fg-muted text-sm italic",children:"This message has no body content."}),St=({bodyParts:e,html:t,text:s,isTrusted:r=!1,messageId:n,fromAddressId:o,category:l,className:m})=>{const[d,c]=g.useState(!1),f=r||d,u=tt(),{toggleTrusted:h,isPending:p}=et({messageId:n??""}),i=!!e&&e.length>0,{picked:x,data:y,isLoading:w,isError:D,error:z,refetch:P}=ie({messageId:n,bodyParts:e,enabled:i}),K=g.useMemo(()=>ue(e??[]),[e]),F=i&&y?.kind==="html"?y.body:t,H=i&&y?.kind==="text"?y.body:s;if(i){if(w)return a.jsx("div",{className:b("message-body",m),children:a.jsx(it,{})});if(D)return a.jsx("div",{className:b("message-body",m),children:a.jsx(ot,{error:z,onRetry:()=>P()})});if(!x)return a.jsx("div",{className:b("message-body",m),children:a.jsx(L,{})})}else if(!t&&!s)return a.jsx("div",{className:b("message-body",m),children:a.jsx(L,{})});const U=!!(o&&n),G=()=>{!o||p||(c(!0),h(o,!1))};return a.jsx(Ve,{className:m,html:F,text:H,isDark:u,category:l,allowImages:f,resolveCid:K,renderBlockedNotice:W=>a.jsx(st,{blockedImageCount:W,canAlwaysTrust:U,isTrustPending:p,onLoadOnce:()=>c(!0),onAlwaysTrust:G})})},$={personal:"Personal",uncategorized:"Unclassified",transactional:"Transactional",newsletter:"Newsletter",marketing:"Marketing",social:"Social",automated:"Automated"},ct=Object.values(R).map(e=>({value:e,label:$[e]})),lt={unclassified:"uncategorized"},dt=[{name:"from",label:"Sender",values:"contact"},{name:"subject",label:"Subject",values:"text"},{name:"category",label:"Category",values:"fixed",options:ct},{name:"is",label:"State",values:"fixed",options:[{value:"unread",label:"Unread"},{value:"read",label:"Read"},{value:"starred",label:"Starred"}]},{name:"has",label:"Contents",values:"fixed",options:[{value:"attachment",label:"Has attachment"}]},{name:"in",label:"Folder",values:"mailbox"},{name:"account",label:"Account",values:"account"},{name:"after",label:"Sent on or after",values:"date"},{name:"before",label:"Sent before",values:"date"}],ut=new Map(dt.map(e=>[e.name,e])),Et=e=>ut.get(e.toLowerCase()),mt=/^\d{4}-\d{2}-\d{2}$/;function ft(e,t,s){if(!mt.test(s))return;const r=Date.parse(`${s}T00:00:00Z`);if(!Number.isNaN(r))return{type:e,raw:t,value:s,epochSeconds:Math.floor(r/1e3)}}function ht(e){const t=e.toLowerCase(),s=lt[t];return s||Object.values(R).find(n=>n===t)}function gt(e,t){switch(t.toLowerCase()){case"unread":return{type:"isUnread",raw:e};case"read":return{type:"isRead",raw:e};case"starred":case"flagged":return{type:"isStarred",raw:e};default:return}}function pt(e,t){const s=Ye(e);if(!s||s.value.length===0)return;const{name:r,value:n}=s;switch(r){case"from":return{type:"from",raw:e,value:n};case"subject":return{type:"subject",raw:e,value:n};case"category":{const o=ht(n);return o?{type:"category",raw:e,value:n,category:o}:void 0}case"is":return gt(e,n);case"has":return n.toLowerCase()==="attachment"?{type:"hasAttachment",raw:e}:void 0;case"before":case"after":return ft(r,e,n);case"in":{const o=t.mailboxesByName?.get(n.toLowerCase());return o?{type:"in",raw:e,value:n,mailboxId:o}:void 0}case"account":{const o=t.accountsByName?.get(n.toLowerCase());return o?{type:"account",raw:e,value:n,accountId:o}:void 0}default:return}}function Tt(e,t={}){const s=[],r=[];for(const n of M(e)){const o=pt(n.raw,t);o?s.push(o):r.push(n.raw)}return{freeText:r.join(" "),tokens:s}}function Nt(e,t){return M(e).filter(s=>s.raw!==t.raw).map(s=>s.raw).join(" ")}function Ct(e){switch(e.type){case"from":return`From: ${e.value}`;case"subject":return`Subject: ${e.value}`;case"category":return`Category: ${$[e.category]}`;case"hasAttachment":return"Has attachment";case"isUnread":return"Unread";case"isRead":return"Read";case"isStarred":return"Starred";case"before":return`Before ${e.value}`;case"after":return`After ${e.value}`;case"in":return`In: ${e.value}`;case"account":return`Account: ${e.value}`}}function jt(){const{mailboxNameIndex:e,accountNameIndex:t}=ne(),s=ae();return{...ce(s)?{}:{mailboxesByName:e},accountsByName:t}}export{vt as M,kt as R,dt as S,Ve as a,et as b,St as c,Et as d,M as e,Ye as f,At as g,Tt as p,Nt as r,Ct as s,jt as u};
@@ -0,0 +1 @@
1
+ import{h as T,as as C,i as I,cu as k,dM as A,r as v,j as p,dN as h,dO as E,dP as j,C as w,c8 as D,c as z,dl as N,cN as O}from"./index-CvHgBKzk.js";import{P}from"./attachment-file-vWrTKKNW.js";import{ag as Q,ah as R}from"./MailListHeader-CxqJgX-k.js";import{i as _,t as q}from"./search-token-index-CMEbenCb.js";import{a as B}from"./useLabels-4QZ-fg0L.js";import{n as U}from"./search-query-Cr_ZXBCp.js";import{b as F}from"./search-scope-B5-OK3Cq.js";import{u as G,p as H}from"./useSearchTokenContext-Dvm-Yobe.js";const ne=e=>{const t=new Set;for(const a of e)a&&t.add(a);return t.size>1?{accountId:void 0,restriction:"spansAccounts",moveDisabledHint:"Move only works within one account — clear selection or pick messages from a single account"}:{accountId:t.size===1?[...t][0]:void 0,restriction:void 0,moveDisabledHint:void 0}},K=e=>{const{mailboxId:t,messages:a}=e,c=T(),{pushError:l}=C(),{mutateAsync:i,isPending:o}=I({...A(),onError:(n,d)=>{l({title:d.body.action==="Remove"?"Couldn't remove label":"Couldn't apply label",detail:k(n),error:n})},onSettled:(n,d,u)=>{_(c,q(Q(u.body.messageIds??[],a??[],t)))}});return{applyLabel:v.useCallback((n,d,u)=>{n.length!==0&&R(n,m=>i({body:{messageIds:m,labelId:d,action:u}}))},[i]),isPending:o}};function re({accountId:e,mailboxId:t,messageIds:a}){const{labels:c}=B(e),{applyLabel:l}=K({mailboxId:t}),i=v.useMemo(()=>c.map(o=>({key:o.labelId,label:o.name,icon:p.jsx("span",{className:`size-2.5 rounded-full ${E(o.color)?h[o.color]:h.Default}`}),onSelect:()=>l(a,o.labelId,"Apply")})),[c,a,l]);return i.length===0?null:p.jsx(P,{triggerLabel:"Apply label to selected messages",triggerIcon:p.jsx(j,{className:"size-4 text-fg-subtle"}),triggerText:"Apply label",items:i,align:"start",nested:!0,touch:!1,triggerClassName:"min-h-11 w-full justify-start gap-3 px-4 py-2.5 text-sm font-normal text-fg"})}const V=20,$=new Set(Object.values(O)),J=e=>e!==void 0&&$.has(e)?e:void 0,W=e=>{if(e.some(t=>t.type==="isUnread"))return!1;if(e.some(t=>t.type==="isRead"))return!0};function ie({mailboxId:e,filterCategory:t}={}){const{searchQuery:a}=w(),c=G(),l=D(),i=U(a),{freeText:o,tokens:r}=H(i,c),n=o.length>0,d=r.find(s=>s.type==="category"),u=J(t)??d?.category,m=r.some(s=>s.type==="hasAttachment")?!0:void 0,f=r.some(s=>s.type==="isStarred")?!0:void 0,y=W(r),b=r.find(s=>s.type==="after"),g=r.find(s=>s.type==="before"),S=r.find(s=>s.type==="in"),x=F({browsed:l,callerMailboxId:e,inTokenMailboxId:S?.mailboxId}),{data:M,isLoading:L}=z({...N({query:{query:o,mailboxId:x,limit:V,...u!==void 0?{category:u}:{},...m!==void 0?{hasAttachment:m}:{},...f!==void 0?{hasStars:f}:{},...y!==void 0?{isRead:y}:{},...b?{sentDateFrom:b.epochSeconds}:{},...g?{sentDateTo:g.epochSeconds}:{}}}),enabled:n,staleTime:6e4});return{hits:M?.items??[],isLoading:n&&L}}export{re as L,ne as r,ie as u};
@@ -1 +1 @@
1
- import{h as g,as as p,c as f,d as m,r,i as y,au as T,o as E,l as d}from"./index-g8bgQtJZ.js";const i={html:"",plainText:""},x=e=>{const u=g(),{pushError:o}=p(),{data:n}=f({...m(),staleTime:1/0}),l=r.useMemo(()=>{if(!e||!n)return i;const t=n.accounts.find(a=>a.accountId===e);return t?{html:t.signatureHtml??"",plainText:t.signaturePlainText??""}:i},[e,n]),s=y({...d(),onSuccess:()=>{u.invalidateQueries({queryKey:E()})},onError:t=>{o(T("Couldn't save signature","The signature wasn't saved.",t))}}),c=r.useCallback((t,a)=>{e&&s.mutate({path:{accountId:e},body:{signatureHtml:t,signaturePlainText:a}})},[e,s]);return{signature:l,setSignature:c,isSaving:s.isPending}};export{x as u};
1
+ import{h as g,as as p,c as f,d as m,r,i as y,au as T,o as E,l as d}from"./index-CvHgBKzk.js";const i={html:"",plainText:""},x=e=>{const u=g(),{pushError:o}=p(),{data:n}=f({...m(),staleTime:1/0}),l=r.useMemo(()=>{if(!e||!n)return i;const t=n.accounts.find(a=>a.accountId===e);return t?{html:t.signatureHtml??"",plainText:t.signaturePlainText??""}:i},[e,n]),s=y({...d(),onSuccess:()=>{u.invalidateQueries({queryKey:E()})},onError:t=>{o(T("Couldn't save signature","The signature wasn't saved.",t))}}),c=r.useCallback((t,a)=>{e&&s.mutate({path:{accountId:e},body:{signatureHtml:t,signaturePlainText:a}})},[e,s]);return{signature:l,setSignature:c,isSaving:s.isPending}};export{x as u};
package/index.html CHANGED
@@ -38,7 +38,7 @@
38
38
  } catch (_) {}
39
39
  })();
40
40
  </script>
41
- <script type="module" crossorigin src="/assets/index-g8bgQtJZ.js"></script>
41
+ <script type="module" crossorigin src="/assets/index-CvHgBKzk.js"></script>
42
42
  <link rel="stylesheet" crossorigin href="/assets/index-DYO-sbPN.css">
43
43
  </head>
44
44
  <body>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@remit/web-client-dist",
3
- "version": "0.0.489",
3
+ "version": "0.0.490",
4
4
  "description": "Built Remit web client — static assets and the default runtime config.",
5
5
  "files": [
6
6
  "**/*"
@@ -1,2 +0,0 @@
1
- import{e as X,j as e,X as q,aA as H,t as m,r as j,f as I,a2 as J,c as ee,ea as se,s as te,_ as ne}from"./index-g8bgQtJZ.js";import{u as ae,t as re,C as ie,d as le,p as oe}from"./CalendarComposePane-agoL1ns0.js";import{c as ce,R as de,u as xe,g as me,a as fe,f as ue,U as he}from"./useCalendars-DpFuwdMF.js";import{A as pe}from"./avatar-Du_muwOj.js";import{M as ge}from"./minus-CMPi7NES.js";import{C as G}from"./clock-DR_uD23l.js";import{G as U,u as ve}from"./useCalendarData-C5aoyZVb.js";import{M as be}from"./mail-CfYHpR3-.js";import{P as je}from"./pencil-DcdYZQHm.js";import{C as Ne}from"./calendar-days-M0oLf7Pt.js";const we=X("MapPin",[["path",{d:"M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0",key:"1r0f0z"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}]]),_={accepted:"Coming",tentative:"Maybe",declined:"Not coming",noReply:"No reply"},ye={accepted:"text-positive",tentative:"text-warning",declined:"text-danger",noReply:"text-fg-subtle"},Ce={accepted:H,tentative:G,declined:q,noReply:ge};function K({rsvp:s,className:t}){const a=Ce[s];return e.jsxs("span",{className:m("inline-flex items-center gap-1 text-2xs font-medium",ye[s],t),children:[e.jsx(a,{className:"size-3"}),_[s]]})}function ke({attendee:s,active:t=!1,onActivate:a,contextId:n,touch:i=!1,className:o}){const x=e.jsxs(e.Fragment,{children:[e.jsx(pe,{name:s.name,email:s.email,size:"sm"}),e.jsxs("span",{className:"min-w-0 flex-1",children:[e.jsx("span",{className:"block truncate text-sm text-fg",children:s.name}),s.role==="organizer"&&e.jsx("span",{className:"block text-2xs text-fg-subtle",children:"Organiser"})]}),e.jsx(K,{rsvp:s.rsvp})]});return a?e.jsx("button",{type:"button","aria-expanded":t,"aria-controls":t&&n!==void 0?n:void 0,onClick:()=>a(t?"":s.email),onKeyDown:d=>{d.key==="Escape"&&a("")},onBlur:d=>{t&&d.relatedTarget!==null&&(d.currentTarget.parentElement?.contains(d.relatedTarget)||a(""))},className:m("flex w-full items-center gap-2.5 rounded-md px-1.5 text-left outline-none focus-visible:ring-2 focus-visible:ring-ring",i?"min-h-11":"min-h-9",t?"bg-accent-2-soft":"hover:bg-surface-sunken",o),children:x}):e.jsx("div",{className:m("flex min-h-9 items-center gap-2.5",o),children:x})}function Ee({attendees:s,activeEmail:t="",onActivate:a,renderContext:n,touch:i=!1,className:o}){const x=j.useId();if(s.length===0)return null;const d=["accepted","tentative","declined","noReply"].map(l=>({state:l,count:s.filter(h=>h.rsvp===l).length})).filter(l=>l.count>0).map(l=>`${l.count} ${_[l.state].toLowerCase()}`).join(" · ");return e.jsxs("div",{className:m("flex flex-col",o),children:[e.jsx("p",{className:"pb-1 text-2xs uppercase tracking-wider text-fg-subtle",children:`${s.length} guests · ${d}`}),s.map((l,h)=>{const g=l.email===t,v=`${x}-guest-${h}`,r=e.jsx(ke,{attendee:l,active:g,onActivate:a,contextId:n?v:void 0,touch:i});return a?e.jsxs("div",{children:[r,g&&n&&e.jsx("div",{id:v,className:"py-1",children:n(l)})]},l.email):e.jsx(j.Fragment,{children:r},l.email)})]})}function y({icon:s,children:t}){return e.jsxs("div",{className:"flex items-start gap-2.5 py-1",children:[e.jsx("span",{className:"mt-0.5 shrink-0 text-fg-subtle",children:s}),e.jsx("div",{className:"min-w-0 flex-1 text-sm text-fg",children:t})]})}function De({event:s,calendar:t,whenText:a,onEdit:n,onDelete:i,onOpenThread:o,onClose:x,activeAttendee:d="",onActivateAttendee:l,renderAttendeeContext:h,touch:g=!1,chrome:v="header",className:r}){const R=ce(t.color),f=e.jsxs(e.Fragment,{children:[e.jsx("h1",{className:"text-xl font-semibold text-fg",children:s.title}),e.jsxs("div",{className:"mt-3 flex flex-col border-b border-line pb-3",children:[e.jsx(y,{icon:e.jsx(G,{className:"size-4"}),children:e.jsxs("span",{className:"flex flex-wrap items-center gap-2",children:[a,s.attendees.length>0&&e.jsx(K,{rsvp:s.myRsvp})]})}),s.zoneCertainty==="ambiguous"?e.jsx(y,{icon:e.jsx(U,{className:"size-4 text-warning"}),children:e.jsx("span",{className:"text-warning",children:"The mail said a time but never a zone. Shown in your own; confirm before you travel for it."})}):s.timeZone!==""&&e.jsx(y,{icon:e.jsx(U,{className:"size-4"}),children:s.timeZone}),s.recurrenceRule!==""&&e.jsx(y,{icon:e.jsx(de,{className:"size-4"}),children:e.jsxs("span",{className:"flex flex-wrap items-center gap-2",children:[s.recurrenceRule,s.seriesException&&e.jsx("span",{className:"rounded-xs bg-warning-soft px-1.5 py-0.5 text-2xs text-warning",children:"Moved out of the series"})]})}),s.location!==""&&e.jsx(y,{icon:e.jsx(we,{className:"size-4"}),children:s.location})]}),s.threadId!==""&&o&&e.jsxs("button",{type:"button",onClick:o,className:"mt-3 flex w-full items-center gap-2.5 rounded-md border border-line bg-surface-sunken px-3 py-2 text-left outline-none hover:border-line-strong focus-visible:ring-2 focus-visible:ring-ring",children:[e.jsx(be,{className:"size-4 shrink-0 text-accent-2"}),e.jsxs("span",{className:"min-w-0 flex-1",children:[e.jsx("span",{className:"block text-2xs uppercase tracking-wider text-fg-subtle",children:"From this thread"}),e.jsx("span",{className:"block truncate text-sm text-fg",children:s.threadSubject})]})]}),s.attendees.length>0&&e.jsx(Ee,{attendees:s.attendees,activeEmail:d,onActivate:l,renderContext:h,touch:g,className:"mt-3"}),s.notes!==""&&e.jsx("p",{className:"mt-3 whitespace-pre-wrap text-sm text-fg-muted",children:s.notes})]});return v==="bare"?e.jsx("div",{className:m("flex flex-col",r),children:f}):e.jsxs("article",{className:m("flex h-full w-full flex-col bg-surface",r),children:[e.jsxs("header",{className:"flex h-pane-header shrink-0 items-center gap-2 border-b border-line px-row-inset",children:[e.jsx("span",{className:m("size-2.5 shrink-0 rounded-full",R.solid)}),e.jsxs("span",{className:"min-w-0 flex-1 truncate text-xs text-fg-muted",children:[t.name," · ",t.accountLabel]}),n&&e.jsx(I,{variant:"ghost",size:"sm",icon:e.jsx(je,{className:"size-3.5"}),onClick:n,children:"Edit"}),i&&e.jsx(I,{variant:"ghost",size:"sm",icon:e.jsx(J,{className:"size-3.5"}),onClick:i,className:"text-danger",children:"Delete"}),x&&e.jsx("button",{type:"button","aria-label":"Close event",onClick:x,className:"flex size-7 items-center justify-center rounded-md text-fg-subtle outline-none hover:bg-surface-sunken hover:text-fg focus-visible:ring-2 focus-visible:ring-ring",children:e.jsx(q,{className:"size-4"})})]}),e.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto px-row-inset py-3",children:f})]})}const Re=[{scope:"this",label:"This event",note:"Leaves the rest of the series alone"},{scope:"following",label:"This and everything after",note:"Splits the series here"},{scope:"all",label:"The whole series",note:"Rewrites the rule itself"}];function Te({title:s,ruleText:t,instanceText:a,onChoose:n,onCancel:i,touch:o,className:x}){return e.jsxs("div",{className:m("flex flex-col gap-3",x),children:[e.jsxs("div",{children:[e.jsxs("h2",{className:"text-md font-semibold text-fg",children:[s," repeats"]}),e.jsx("p",{className:"text-xs text-fg-muted",children:t}),e.jsxs("p",{className:"text-xs text-fg-subtle",children:["You clicked ",a,"."]})]}),e.jsx("p",{className:"text-sm text-fg",children:"What should the change apply to?"}),e.jsx("div",{className:"flex flex-col gap-1.5",children:Re.map(d=>e.jsxs("button",{type:"button",onClick:()=>n(d.scope),className:m("flex flex-col rounded-md border border-line bg-surface px-3 py-2 text-left outline-none transition-colors hover:border-line-strong hover:bg-surface-sunken focus-visible:ring-2 focus-visible:ring-ring",o&&"min-h-11 justify-center"),children:[e.jsx("span",{className:"text-sm font-medium text-fg",children:d.label}),e.jsx("span",{className:"text-2xs text-fg-subtle",children:d.note})]},d.scope))}),e.jsx(I,{variant:"ghost",size:o?"md":"sm",onClick:i,className:m("self-start",o&&"min-h-11"),children:"Cancel"})]})}const ze=s=>s.replace(/\r?\n[ \t]/g,""),Z=s=>s.replace(/\\n/gi,`
2
- `).replace(/\\,/g,",").replace(/\\;/g,";").replace(/\\\\/g,"\\");function Ie(s,t){let a=!1;for(let n=t.length;n<s.length;n+=1){const i=s[n];if(n===t.length&&i!==";"&&i!==":")return;if(i==='"'){a=!a;continue}if(!a&&i===":")return s.slice(n+1).trim()}}function S(s,t){for(const a of ze(s).split(/\r?\n/)){if(!a.startsWith(t))continue;const n=Ie(a,t);if(n!==void 0)return n}return""}const Se=s=>S(s,"RRULE"),Le=s=>({location:Z(S(s,"LOCATION")),description:Z(S(s,"DESCRIPTION"))}),$e=te(404);function Ae(s,t){const{data:a,isLoading:n,error:i,refetch:o}=ee({...se({path:{calendarObjectId:s},query:{calendarId:t}}),meta:$e,enabled:s!==""&&t!==""});return{resource:a,isLoading:n,error:i,refetch:()=>{o()}}}const z=new Intl.DateTimeFormat(void 0,{weekday:"short",day:"numeric",month:"long"}),D=new Intl.DateTimeFormat(void 0,{hour:"2-digit",minute:"2-digit",hour12:!1});function Y(s){const t=new Date(s.start),a=new Date(s.end),n=z.format(t);return s.allDay?`${n}, all day`:z.format(a)===n?`${n}, ${D.format(t)} – ${D.format(a)}`:`${n}, ${D.format(t)} – ${z.format(a)}, ${D.format(a)}`}function Fe({event:s,calendar:t,isOccurrence:a,problem:n="",onEdit:i,onDelete:o,onClose:x}){return!s||!t?e.jsxs("div",{className:"flex h-full flex-col items-center justify-center gap-2 bg-surface p-8 text-center",children:[e.jsx(Ne,{className:"size-8 text-fg-subtle","aria-hidden":"true"}),e.jsx("p",{className:"text-sm font-medium text-fg",children:"That event isn't on this week"}),e.jsx("p",{className:"max-w-xs text-sm text-fg-muted",children:"The address names an event the calendar doesn't have here."}),e.jsx("button",{type:"button",onClick:x,className:"rounded-md border border-line px-2.5 py-1 text-sm font-medium text-fg outline-none hover:bg-surface-sunken focus-visible:ring-2 focus-visible:ring-ring",children:"Back to the calendar"})]}):e.jsxs("div",{className:"flex h-full min-h-0 flex-col bg-surface",children:[a&&e.jsx("p",{className:"shrink-0 border-b border-line bg-surface-sunken px-row-inset py-1.5 text-2xs uppercase tracking-wider text-fg-subtle",children:"One occurrence of a repeating event"}),n!==""&&e.jsxs("div",{role:"alert",className:"flex shrink-0 items-start gap-2 border-b border-danger/40 bg-danger-soft px-row-inset py-2 text-sm",children:[e.jsx(ne,{className:"mt-0.5 size-4 shrink-0 text-danger","aria-hidden":"true"}),e.jsx("p",{className:"min-w-0 flex-1 break-words text-fg",children:n})]}),e.jsx(De,{event:s,calendar:t,whenText:Y(s),onEdit:i,onDelete:o,onClose:x,className:"min-h-0 flex-1"})]})}const Me="This event changed somewhere else — over CalDAV, or in another tab. Nothing was saved. Close it and open it again to see the version that's stored now.";function Ye({calendarObjectId:s,recurrenceId:t}){const{view:a,date:n,calendarIds:i}=xe(),{events:o}=ve({view:a,date:n,calendarIds:i}),{calendars:x,timeZoneByCalendarId:d}=me(),{closeEvent:l}=fe(),{updateEvent:h,deleteEvent:g,isWriting:v}=ae(),r=o.find(c=>c.id===ue(s,t??"")),R=x.find(c=>c.id===r?.calendarId),{resource:f}=Ae(s,r?.calendarId??""),[L,N]=j.useState(void 0),[p,T]=j.useState(void 0),[b,C]=j.useState(void 0),[$,w]=j.useState(""),k=f?Le(f.icalData):void 0,A=f?Se(f.icalData):"",Q=r&&!r.allDay?r.start.slice(11,16):"",E=A===""?"":re(A,Q)??"Repeats",F=r!==void 0&&r.seriesId!==""&&t!==void 0&&t!=="",M=r!==void 0&&f!==void 0,O=(c,u)=>{if(c.kind==="written"){w(""),u();return}w(c.kind==="conflict"?Me:c.message)},P=c=>({calendarObjectId:s,calendarId:r?.calendarId??"",recurrenceId:t??"",scope:c,etag:f?.etag??""}),B=c=>{if(!r)return;const u=le(r,{repeat:E,location:k?.location??"",notes:k?.description??""});N(void 0),T({before:u,scope:c}),C(u),w("")},W=c=>{N(void 0),g(P(c)).then(u=>O(u,l))},V=()=>{if(!p||!b)return;const c=oe(p.before,b,d[b.calendarId]??he);if(!c.ok){w(c.problem);return}h(P(p.scope),c.patch).then(u=>O(u,()=>{T(void 0),C(void 0)}))};return L!==void 0&&r?e.jsx("div",{className:"flex h-full flex-col justify-center bg-surface px-row-inset",children:e.jsx(Te,{className:"mx-auto w-full max-w-md",title:r.title,ruleText:E===""?"It repeats":E,instanceText:Y(r),onChoose:L==="edit"?B:W,onCancel:()=>N(void 0)})}):p&&b?e.jsx(ie,{title:"Edit event",subtitle:p.scope==="this"?"This occurrence only":b.date,calendars:x,draft:b,onChange:C,problem:$,saveLabel:"Save",isSaving:v,repeatEditable:p.scope===void 0||p.scope==="all",calendarEditable:!1,onSave:V,onCancel:()=>{T(void 0),C(void 0),w("")}}):e.jsx(Fe,{event:r&&{...r,location:k?.location??"",notes:k?.description??"",recurrenceRule:E},calendar:R,isOccurrence:t!==void 0,problem:$,onEdit:M?()=>F?N("edit"):B(void 0):void 0,onDelete:M?()=>F?N("delete"):W(void 0):void 0,onClose:l})}export{Ye as O};
@@ -1 +0,0 @@
1
- import{O as o}from"./index-g8bgQtJZ.js";const n=o;export{n as component};
@@ -1 +0,0 @@
1
- import{ai as m,j as o,O as p}from"./index-g8bgQtJZ.js";import{a}from"./MailShell-BjMK7Xnl.js";import{M as r}from"./MailboxPane-UuE1GnYv.js";import{d as e}from"./search-token-index-BOTTrCLk.js";import{u as s}from"./search-mirror-7JkoCkyi.js";import"./FullCompose-BOzKHIWH.js";import"./ErrorState-CcskHvYA.js";import"./index-C6BJBAqS.js";import"./useMessageBodyContent-CuLDcpM3.js";import"./useSignature-BvM9Jfop.js";import"./account-form-helpers-DhckT_PN.js";import"./useDebouncedValue-CBTfEGjG.js";import"./sections-BEguVFV2.js";import"./format-BHDg2rrC.js";import"./confirm-dialog-4odXEYPg.js";import"./useSearchTokenContext-GTO16rww.js";import"./kbd-DqC2ZgVF.js";import"./search-scope-B5-OK3Cq.js";import"./useRefreshControl-DuT7Vf8Z.js";import"./circle-check-big-BvKLZUBR.js";import"./useQueries-CCN-XYPe.js";import"./MailListHeader-B2Ptcy5T.js";import"./attachment-file-DeNsnSqQ.js";import"./mail-CfYHpR3-.js";import"./avatar-Du_muwOj.js";import"./EmptyState-DbhUEdf0.js";import"./download-BW67NG6L.js";import"./useLayoutTier-BWGxIu6c.js";import"./shield-check-SmSS2Jxi.js";import"./useFilters-UCepys59.js";import"./minus-CMPi7NES.js";import"./clock-DR_uD23l.js";import"./menu-B8k6KgGJ.js";import"./MailViewChrome-Ct8l-wD4.js";import"./NavMenuButton-O5EMAZfL.js";import"./useLabels-D1TbYkW1.js";import"./useSemanticSearch-Du2bzbgF.js";import"./search-query-Cr_ZXBCp.js";import"./bottom-sheet-BS756-KS.js";import"./circle-help-5cJ6ehph.js";import"./circle-check-Ci5U4ND7.js";function X(){const{mailboxId:t}=m.useParams(),i=e();return s({to:"/mail/$mailboxId",params:{mailboxId:t}}),o.jsx(r,{mailboxId:t,thread:i,children:o.jsx(a,{phone:o.jsx(r.Phone,{}),list:o.jsx(r.List,{}),reading:o.jsx(p,{}),intelligence:o.jsx(r.Intelligence,{}),hasThread:!!i})})}export{X as component};
@@ -1 +0,0 @@
1
- import{j as o}from"./index-g8bgQtJZ.js";import{M as r}from"./MailboxPane-UuE1GnYv.js";import"./useSearchTokenContext-GTO16rww.js";import"./kbd-DqC2ZgVF.js";import"./useMessageBodyContent-CuLDcpM3.js";import"./search-scope-B5-OK3Cq.js";import"./useRefreshControl-DuT7Vf8Z.js";import"./circle-check-big-BvKLZUBR.js";import"./search-token-index-BOTTrCLk.js";import"./useLayoutTier-BWGxIu6c.js";import"./useQueries-CCN-XYPe.js";import"./MailListHeader-B2Ptcy5T.js";import"./attachment-file-DeNsnSqQ.js";import"./mail-CfYHpR3-.js";import"./avatar-Du_muwOj.js";import"./index-C6BJBAqS.js";import"./useSignature-BvM9Jfop.js";import"./account-form-helpers-DhckT_PN.js";import"./useDebouncedValue-CBTfEGjG.js";import"./sections-BEguVFV2.js";import"./format-BHDg2rrC.js";import"./EmptyState-DbhUEdf0.js";import"./ErrorState-CcskHvYA.js";import"./download-BW67NG6L.js";import"./shield-check-SmSS2Jxi.js";import"./useFilters-UCepys59.js";import"./minus-CMPi7NES.js";import"./confirm-dialog-4odXEYPg.js";import"./clock-DR_uD23l.js";import"./menu-B8k6KgGJ.js";import"./MailViewChrome-Ct8l-wD4.js";import"./NavMenuButton-O5EMAZfL.js";import"./useLabels-D1TbYkW1.js";import"./useSemanticSearch-Du2bzbgF.js";import"./search-query-Cr_ZXBCp.js";import"./bottom-sheet-BS756-KS.js";import"./circle-help-5cJ6ehph.js";import"./circle-check-Ci5U4ND7.js";function L(){return o.jsx(r.Reading,{})}export{L as component};
@@ -1 +0,0 @@
1
- import{j as r}from"./index-g8bgQtJZ.js";import{B as o}from"./BriefPane-GKsxsmIt.js";import"./useSearchTokenContext-GTO16rww.js";import"./kbd-DqC2ZgVF.js";import"./useMessageBodyContent-CuLDcpM3.js";import"./search-scope-B5-OK3Cq.js";import"./MailListHeader-B2Ptcy5T.js";import"./search-token-index-BOTTrCLk.js";import"./useLayoutTier-BWGxIu6c.js";import"./useQueries-CCN-XYPe.js";import"./attachment-file-DeNsnSqQ.js";import"./mail-CfYHpR3-.js";import"./avatar-Du_muwOj.js";import"./index-C6BJBAqS.js";import"./useSignature-BvM9Jfop.js";import"./account-form-helpers-DhckT_PN.js";import"./useDebouncedValue-CBTfEGjG.js";import"./sections-BEguVFV2.js";import"./format-BHDg2rrC.js";import"./EmptyState-DbhUEdf0.js";import"./ErrorState-CcskHvYA.js";import"./download-BW67NG6L.js";import"./shield-check-SmSS2Jxi.js";import"./useFilters-UCepys59.js";import"./minus-CMPi7NES.js";import"./confirm-dialog-4odXEYPg.js";import"./clock-DR_uD23l.js";import"./menu-B8k6KgGJ.js";import"./useRefreshControl-DuT7Vf8Z.js";import"./circle-check-big-BvKLZUBR.js";import"./useLabels-D1TbYkW1.js";import"./useSemanticSearch-Du2bzbgF.js";import"./search-query-Cr_ZXBCp.js";import"./wizard-selection-B1bng5Jq.js";function H(){return r.jsx(o.Reading,{})}export{H as component};
@@ -1 +0,0 @@
1
- import{j as o}from"./index-g8bgQtJZ.js";import{F as r}from"./FlaggedPane-DdBU5qXP.js";import"./useSearchTokenContext-GTO16rww.js";import"./kbd-DqC2ZgVF.js";import"./useMessageBodyContent-CuLDcpM3.js";import"./search-scope-B5-OK3Cq.js";import"./MailListHeader-B2Ptcy5T.js";import"./search-token-index-BOTTrCLk.js";import"./useLayoutTier-BWGxIu6c.js";import"./useQueries-CCN-XYPe.js";import"./attachment-file-DeNsnSqQ.js";import"./mail-CfYHpR3-.js";import"./avatar-Du_muwOj.js";import"./index-C6BJBAqS.js";import"./useSignature-BvM9Jfop.js";import"./account-form-helpers-DhckT_PN.js";import"./useDebouncedValue-CBTfEGjG.js";import"./sections-BEguVFV2.js";import"./format-BHDg2rrC.js";import"./EmptyState-DbhUEdf0.js";import"./ErrorState-CcskHvYA.js";import"./download-BW67NG6L.js";import"./shield-check-SmSS2Jxi.js";import"./useFilters-UCepys59.js";import"./minus-CMPi7NES.js";import"./confirm-dialog-4odXEYPg.js";import"./clock-DR_uD23l.js";import"./menu-B8k6KgGJ.js";import"./MailViewChrome-Ct8l-wD4.js";import"./wizard-selection-B1bng5Jq.js";function B(){return o.jsx(r.Reading,{})}export{B as component};
@@ -1 +0,0 @@
1
- import{j as o}from"./index-g8bgQtJZ.js";import{O as t}from"./OutboxPane-DnmR4ilE.js";import"./useSearchTokenContext-GTO16rww.js";import"./kbd-DqC2ZgVF.js";import"./useMessageBodyContent-CuLDcpM3.js";import"./search-scope-B5-OK3Cq.js";import"./circle-check-big-BvKLZUBR.js";import"./clock-DR_uD23l.js";import"./row-actions-DfZb5JeP.js";import"./rotate-ccw-D_188uJN.js";import"./NavMenuButton-O5EMAZfL.js";import"./menu-B8k6KgGJ.js";import"./format-BHDg2rrC.js";import"./outbox-status-BlKn6P0x.js";import"./search-query-Cr_ZXBCp.js";function P(){return o.jsx(t.Reading,{})}export{P as component};
@@ -1 +0,0 @@
1
- import{eb as o,j as e}from"./index-g8bgQtJZ.js";import{O as m}from"./OpenCalendarEvent-DFAHEVHt.js";import"./CalendarComposePane-agoL1ns0.js";import"./useCalendars-DpFuwdMF.js";import"./ErrorState-CcskHvYA.js";import"./avatar-Du_muwOj.js";import"./minus-CMPi7NES.js";import"./clock-DR_uD23l.js";import"./useCalendarData-C5aoyZVb.js";import"./mail-CfYHpR3-.js";import"./pencil-DcdYZQHm.js";import"./calendar-days-M0oLf7Pt.js";function l(){const{calendarObjectId:r,recurrenceId:t}=o.useParams();return e.jsx(m,{calendarObjectId:r,recurrenceId:t})}export{l as component};
@@ -1 +0,0 @@
1
- import{O as o}from"./index-g8bgQtJZ.js";const n=o;export{n as component};
@@ -1 +0,0 @@
1
- import{O as o}from"./index-g8bgQtJZ.js";const n=o;export{n as component};
@@ -1 +0,0 @@
1
- import{O as o}from"./index-g8bgQtJZ.js";const n=o;export{n as component};