@remit/web-client-dist 0.0.631 → 0.0.633
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.
- package/assets/{BriefPane-8DVHJA2P.js → BriefPane-mgiwuRg9.js} +1 -1
- package/assets/{CalendarComposePane-D9qd7bGZ.js → CalendarComposePane-C8OCyygH.js} +1 -1
- package/assets/{CalendarComposeSeed-B2PT6DIT.js → CalendarComposeSeed-BJLZoW6n.js} +1 -1
- package/assets/{CalendarShell-BQ1WtyNw.js → CalendarShell-HpApyXbh.js} +1 -1
- package/assets/{EmptyState-B3OfXxGc.js → EmptyState-ByT1Gu5Q.js} +1 -1
- package/assets/{ErrorState-BMamrpRe.js → ErrorState-lOy9oWsG.js} +1 -1
- package/assets/{FlaggedPane-CRbYRcWP.js → FlaggedPane-ABu3En8n.js} +1 -1
- package/assets/{FullCompose-DerQv8yu.js → FullCompose-CJfpPY9W.js} +1 -1
- package/assets/{MailListHeader-p1q7jsyl.js → MailListHeader-BWxCXjLF.js} +1 -1
- package/assets/{MailNav-BFwTrlMb.js → MailNav-DWhkyT8m.js} +1 -1
- package/assets/{MailShell-CdlKuAJL.js → MailShell-BV9UNC34.js} +1 -1
- package/assets/{MailViewChrome-B80rNMML.js → MailViewChrome-CwBNpH4r.js} +1 -1
- package/assets/MailboxPane-CF_r6Qn_.js +1 -0
- package/assets/{NavMenuButton-D50RaMZU.js → NavMenuButton-G9j_DlDH.js} +1 -1
- package/assets/{OnboardingWizard-CEl2lJ7U.js → OnboardingWizard-AgffmEPL.js} +1 -1
- package/assets/{OpenCalendarEvent-D5hdoozI.js → OpenCalendarEvent-C0fD7GK1.js} +1 -1
- package/assets/OutboxPane-hqh9NzYa.js +1 -0
- package/assets/_calendarObjectId-s2QGsHkK.js +1 -0
- package/assets/_mailboxId-aqYfy-nL.js +1 -0
- package/assets/_messageId-BmUq12TV.js +1 -0
- package/assets/_messageId-Bwwgt809.js +1 -0
- package/assets/_messageId-DxKD9YHn.js +1 -0
- package/assets/_outboxMessageId-lGsDFXKf.js +1 -0
- package/assets/_recurrenceId-BDttLIbh.js +1 -0
- package/assets/_threadId-2dLcjrUO.js +1 -0
- package/assets/_threadId-BxpLhDIN.js +1 -0
- package/assets/_threadId-zlX1k6qc.js +1 -0
- package/assets/{_view._date-BwqM0JvI.js → _view._date-DmyvZaE4.js} +1 -1
- package/assets/{accounts-DmUwj43_.js → accounts-DTdyCDrD.js} +1 -1
- package/assets/{advanced-r7Vg3s8i.js → advanced-C59X86iF.js} +1 -1
- package/assets/{appearance-D2yGFSyi.js → appearance-hZfF_gnE.js} +1 -1
- package/assets/{attendee-row-DUsYrdln.js → attendee-row-aOKxNWMD.js} +1 -1
- package/assets/{avatar-BZB5Hlpq.js → avatar-pYJD4LCB.js} +1 -1
- package/assets/{bell-off-DwXjf1FL.js → bell-off-D9rYrUVT.js} +1 -1
- package/assets/{bottom-sheet-nV19J7QD.js → bottom-sheet-DD_X_Lv6.js} +1 -1
- package/assets/brief-C0hM3LlK.js +1 -0
- package/assets/{brief-B2ypgeON.js → brief-NnJWKuDi.js} +1 -1
- package/assets/{browser-ponyfill-Bnv3NEhX.js → browser-ponyfill-Cf6rRFf8.js} +1 -1
- package/assets/{bug-umU_Hhi4.js → bug-MPpCckiP.js} +1 -1
- package/assets/{calendar-BXASaoDs.js → calendar-DAkM9bOK.js} +1 -1
- package/assets/{calendar-clash-strip-6sedBGkk.js → calendar-clash-strip-BqcFrBRc.js} +1 -1
- package/assets/{calendar-format-DsR-4j-9.js → calendar-format-x-1AymaW.js} +1 -1
- package/assets/{calendar-report-Becs8mIN.js → calendar-report-Cf2ve-41.js} +1 -1
- package/assets/{calendar-suggestion-BXJh4QEG.js → calendar-suggestion-BfpRtMnb.js} +1 -1
- package/assets/{calendars-C7S_I6-m.js → calendars-C-Q4wy4V.js} +1 -1
- package/assets/{card-C0IHDAlx.js → card-DIdrYGds.js} +1 -1
- package/assets/{checkbox-BeWcYpqA.js → checkbox-DUtcTeBq.js} +1 -1
- package/assets/chevron-left-BhcXrgJJ.js +1 -0
- package/assets/{circle-check-D-kPomlF.js → circle-check-7STILCER.js} +1 -1
- package/assets/{circle-check-big-B39GqMyR.js → circle-check-big-CfQbbZSe.js} +1 -1
- package/assets/{circle-help-DRIXmYoN.js → circle-help-DCDtKNKZ.js} +1 -1
- package/assets/{clock-gr-cmcGz.js → clock-8NSnUnYb.js} +1 -1
- package/assets/compose._-_outboxMessageId_-B5fdNLIB.js +1 -0
- package/assets/compose._-_outboxMessageId_-BM4tI3Gt.js +1 -0
- package/assets/compose._-_outboxMessageId_-Ct9qBLMK.js +1 -0
- package/assets/compose._-_outboxMessageId_-Dp8xuo_5.js +1 -0
- package/assets/{config-import-Co83DTb5.js → config-import-CjdBZe0f.js} +1 -1
- package/assets/{confirm-dialog-GyEqvQcg.js → confirm-dialog-Bmgy9_rb.js} +1 -1
- package/assets/{copy-8ycixQYh.js → copy-CpGnsr3_.js} +1 -1
- package/assets/{credential-steps-DaDeTeqr.js → credential-steps-Brnf4ED3.js} +1 -1
- package/assets/{download-Cfm8O5nH.js → download-B5vMU4mu.js} +1 -1
- package/assets/{file-json-C9ug2H7s.js → file-json-CKTJc-DA.js} +1 -1
- package/assets/{filters-fViDxfvJ.js → filters-CkmIwXL0.js} +1 -1
- package/assets/{flagged-DT1PrPKY.js → flagged-CzDGg02J.js} +1 -1
- package/assets/flagged-PXdGk5Jo.js +1 -0
- package/assets/{folders-CY8l7ouS.js → folders-BlfZq-xA.js} +1 -1
- package/assets/{help-copy-f-EXil2C.js → help-copy-DYz-SVwI.js} +1 -1
- package/assets/{import-Da5lsAbO.js → import-B7zgS3x5.js} +1 -1
- package/assets/{index-CSyKycBp.js → index-B35L-Beh.js} +4 -4
- package/assets/index-BM48DNLo.js +1 -0
- package/assets/{index-DDna6BIu.js → index-BmR_2vd-.js} +1 -1
- package/assets/index-Bwwgt809.js +1 -0
- package/assets/index-C7e4dDMm.js +1 -0
- package/assets/index-CZc1f6iR.js +1 -0
- package/assets/index-Dlo6Af1O.js +1 -0
- package/assets/index-DsQGJCt0.js +1 -0
- package/assets/index-DxKD9YHn.js +1 -0
- package/assets/index-G_CJZn4M.js +1 -0
- package/assets/{index-BNAV6NNi.js → index-JvL7NOOT.js} +4 -4
- package/assets/index-XE_Yht9W.js +1 -0
- package/assets/{kbd-tyVb1kmX.js → kbd-DEjfq9k-.js} +1 -1
- package/assets/{labels-J6NzYHnv.js → labels-Bek9fcco.js} +1 -1
- package/assets/{mail-Be_WuC_w.js → mail-B04n2cXx.js} +1 -1
- package/assets/{mail-BR9qGPwI.js → mail-CIA62edO.js} +1 -1
- package/assets/{menu-DHbVKrar.js → menu-BoIu1FfU.js} +1 -1
- package/assets/minus-nUrea2mK.js +1 -0
- package/assets/{new-BwzwU9dD.js → new-DlWlLikN.js} +1 -1
- package/assets/onboarding-BCYsbV5G.js +1 -0
- package/assets/{onboarding-completion-CNa7a55J.js → onboarding-completion-Vf4AlB2g.js} +1 -1
- package/assets/outbox-BJOCTOIE.js +1 -0
- package/assets/pane-header-BW-iAwQv.js +1 -0
- package/assets/{pencil-CfMqBuNm.js → pencil-D4L00dK0.js} +1 -1
- package/assets/{popover-menu-RTTJnmds.js → popover-menu-ndRLkI9F.js} +1 -1
- package/assets/{refresh-cw-DEjJXAwL.js → refresh-cw-DNKXC09U.js} +1 -1
- package/assets/{rich-text-BkfVEWrH.js → rich-text-Djblrh2N.js} +1 -1
- package/assets/{rich-text-spellcheck-worker-provider-MmHdR5b9.js → rich-text-spellcheck-worker-provider-UCzOxQ6c.js} +1 -1
- package/assets/{rotate-ccw-BePj1nOz.js → rotate-ccw-Dbjk6oUv.js} +1 -1
- package/assets/{roving-focus-DxibL2s7.js → roving-focus-DkDN4BU_.js} +1 -1
- package/assets/{row-actions-vG1W9M0b.js → row-actions-VNJRTDlw.js} +1 -1
- package/assets/{search-mirror-B3Rb2QFP.js → search-mirror-0dWFcBnP.js} +1 -1
- package/assets/{search-token-index-CbMoDJvO.js → search-token-index-BtlfcrE4.js} +1 -1
- package/assets/{sections-D-5U_zIy.js → sections-CmtFaATd.js} +1 -1
- package/assets/{senders-BYxpXipO.js → senders-CRrzN6rH.js} +1 -1
- package/assets/settings-Bkpqnd9B.js +1 -0
- package/assets/{settings-screen-DYrNnBXL.js → settings-screen-DtaOQKyP.js} +1 -1
- package/assets/{shield-check-BR1Itb39.js → shield-check-D_54Wl8K.js} +1 -1
- package/assets/{suggested-vips-DeCvC6kO.js → suggested-vips-BXHIzIUY.js} +1 -1
- package/assets/{undo-2-C9sVZCD4.js → undo-2-TZSl58QT.js} +1 -1
- package/assets/{useCalendarData-xtRjqQ4v.js → useCalendarData-BkgGbKw4.js} +1 -1
- package/assets/{useCalendarWrites-D8fkN8Zj.js → useCalendarWrites-BkFeh-BY.js} +1 -1
- package/assets/{useCalendars-6Gx83pIc.js → useCalendars-CHGwm2tA.js} +1 -1
- package/assets/{useDebouncedValue-DBZDUjAb.js → useDebouncedValue-Dasyblh3.js} +1 -1
- package/assets/{useFilters-B1O1c8J0.js → useFilters-Bvbtlnnx.js} +1 -1
- package/assets/{useLabels-CqJaWt3E.js → useLabels-BPGhj-Hw.js} +1 -1
- package/assets/{useLayoutTier-B0CJkqKe.js → useLayoutTier-DGCxVtYf.js} +1 -1
- package/assets/{useMessageBodyContent-CAy2uoxy.js → useMessageBodyContent-CDZhnuFx.js} +1 -1
- package/assets/{useQueries-0wkiftqA.js → useQueries-CG7A63o2.js} +1 -1
- package/assets/{useRefreshControl-VAzesut8.js → useRefreshControl-Dy0MbIBR.js} +1 -1
- package/assets/{useResultFolderIndex-BkUvHwSd.js → useResultFolderIndex-C4MzvJSk.js} +1 -1
- package/assets/{useSearchTokenContext-AypRRqG2.js → useSearchTokenContext-DCNyVMih.js} +1 -1
- package/assets/{useSemanticSearch-DLp4ptAj.js → useSemanticSearch-Br4oTbAk.js} +1 -1
- package/assets/{useSignature-CWPSLmMO.js → useSignature-BiJchsQV.js} +1 -1
- package/index.html +1 -1
- package/package.json +1 -1
- package/assets/MailboxPane-M52fsGFN.js +0 -1
- package/assets/OutboxPane-CB96afOq.js +0 -1
- package/assets/_calendarObjectId-BN3X9UxR.js +0 -1
- package/assets/_mailboxId-B-9_qjCT.js +0 -1
- package/assets/_messageId-BjFEbYZ3.js +0 -1
- package/assets/_messageId-BxwJ1oiy.js +0 -1
- package/assets/_messageId-DKYMc_-8.js +0 -1
- package/assets/_outboxMessageId-psa_yGuH.js +0 -1
- package/assets/_recurrenceId-BzKomMk0.js +0 -1
- package/assets/_threadId-B8EcS7Wd.js +0 -1
- package/assets/_threadId-Dmv-wr_F.js +0 -1
- package/assets/_threadId-JlzfAJ6D.js +0 -1
- package/assets/brief-DzsHhQWL.js +0 -1
- package/assets/chevron-left-DOe-RBwH.js +0 -1
- package/assets/compose._-_outboxMessageId_-B2eswXYM.js +0 -1
- package/assets/compose._-_outboxMessageId_-DqqMcAlY.js +0 -1
- package/assets/compose._-_outboxMessageId_-K5592Vip.js +0 -1
- package/assets/compose._-_outboxMessageId_-kO-1u07G.js +0 -1
- package/assets/flagged-gArKmb7J.js +0 -1
- package/assets/index-B-LTaGCL.js +0 -1
- package/assets/index-BP4TLloi.js +0 -1
- package/assets/index-BjFEbYZ3.js +0 -1
- package/assets/index-BxwJ1oiy.js +0 -1
- package/assets/index-C7CTxfSm.js +0 -1
- package/assets/index-Cnhlqy9N.js +0 -1
- package/assets/index-CyHF54Mo.js +0 -1
- package/assets/index-DKOrTYxk.js +0 -1
- package/assets/index-DOjVIZFA.js +0 -1
- package/assets/minus-DbGv0Sob.js +0 -1
- package/assets/onboarding-BvFSEHqA.js +0 -1
- package/assets/outbox-eG1sJHnN.js +0 -1
- package/assets/settings-CnmG0G_i.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{h as C,r,i as c,eS as h,eT as f,eU as y,s as g,b5 as m}from"./index-
|
|
1
|
+
import{h as C,r,i as c,eS as h,eT as f,eU as y,s as g,b5 as m}from"./index-JvL7NOOT.js";import{f as I}from"./ErrorState-lOy9oWsG.js";const o=g(400,404,412),b=new Set(["calendarEventOperationsListCalendarEvents","calendarEventDetailOperationsGetCalendarEvent","calendarFreeBusyOperationsListCalendarFreeBusy"]),d={kind:"written"},i=e=>m(e)===412?{kind:"conflict"}:{kind:"refused",message:I(e)},O={this:"This",following:"Following",all:"All"};function S(){const e=C();return r.useCallback(()=>{e.invalidateQueries({predicate:t=>{const n=t.queryKey[0];if(typeof n!="object"||n===null)return!1;const s=n._id;return typeof s=="string"&&b.has(s)}})},[e])}const p=({scope:e,recurrenceId:t})=>e===void 0?{}:{scope:O[e],recurrenceId:t};function k(){const e=S(),t=c({...h(),meta:o,onSuccess:e}),n=c({...f(),meta:o,onSuccess:e}),s=c({...y(),meta:o,onSuccess:e}),l=r.useCallback(a=>t.mutateAsync({body:a}).then(()=>d).catch(i),[t]),u=r.useCallback((a,v)=>n.mutateAsync({path:{calendarObjectId:a.calendarObjectId},query:{calendarId:a.calendarId,...p(a)},headers:{"If-Match":a.etag},body:v}).then(()=>d).catch(i),[n]),E=r.useCallback(a=>s.mutateAsync({path:{calendarObjectId:a.calendarObjectId},query:{calendarId:a.calendarId,...p(a)},headers:{"If-Match":a.etag}}).then(()=>d).catch(i),[s]);return r.useMemo(()=>({createEvent:l,updateEvent:u,deleteEvent:E,isWriting:t.isPending||n.isPending||s.isPending}),[l,u,E,t.isPending,n.isPending,s.isPending])}export{k as a,S as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as g,eA as T,r as h}from"./index-
|
|
1
|
+
import{c as g,eA as T,r as h}from"./index-JvL7NOOT.js";const o=e=>String(e).padStart(2,"0"),y=e=>`${e.getUTCFullYear()}-${o(e.getUTCMonth()+1)}-${o(e.getUTCDate())}`,f=e=>{const t=e<0?"-":"+",r=Math.abs(e);return`${t}${o(Math.floor(r/60))}:${o(r%60)}`};function $(e,t){const r=new Date(`${e}T${t}:00`);return`${e}T${t}:00${f(-r.getTimezoneOffset())}`}const i=new Map;function N(e){if(i.has(e))return i.get(e);let t;try{t=new Intl.DateTimeFormat("en-US",{timeZone:e,hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"})}catch{t=void 0}return i.set(e,t),t}function d(e,t){const r=N(e);if(!r)return Number.NaN;const n=r.formatToParts(new Date(t)),a=O=>Number(n.find(b=>b.type===O)?.value),s=a("hour")%24;return(Date.UTC(a("year"),a("month")-1,a("day"),s,a("minute"),a("second"))-t)/6e4}function L(e,t,r){if(r==="")return`${e}T${t}:00+00:00`;const n=Date.parse(`${e}T${t}:00Z`),a=d(r,n);if(Number.isNaN(a))return $(e,t);const s=d(r,n-a*6e4);return`${e}T${t}:00${f(Number.isNaN(s)?a:s)}`}function p(e,t){const r=Date.parse(e),n=d(t,r),a=Number.isNaN(n)?-new Date(r).getTimezoneOffset():n,s=new Date(r+a*6e4);return`${y(s)}T${o(s.getUTCHours())}:${o(s.getUTCMinutes())}:${o(s.getUTCSeconds())}${f(a)}`}const c=e=>$(e,"00:00");function u(e,t){const[r,n,a]=e.split("-").map(Number);return y(new Date(Date.UTC(r,n-1,a+t)))}function U(e){const[t,r,n]=e.split("-").map(Number),a=new Date(Date.UTC(t,r-1,n));return u(e,-((a.getUTCDay()+6)%7))}function E(e,t){const[r,n]=t.split("-").map(Number);if(e==="year")return[`${r}-01-01`,`${r+1}-01-01`];if(e==="month"){const s=`${r}-${o(n)}-01`,m=n===12?`${r+1}-01-01`:`${r}-${o(n+1)}-01`;return[s,m]}if(e==="day")return[t,u(t,1)];const a=U(t);return[a,u(a,7)]}function M(e,t){const[r,n]=E(e,t);return{from:c(r),to:c(n)}}function F(e,t){return{from:c(e),to:c(u(e,t))}}const R=()=>Intl.DateTimeFormat().resolvedOptions().timeZone,C="";function k(e){if(e!==C)return e;const t=R();return Intl.supportedValuesOf("timeZone").includes(t)?t:C}const v={Cal1:"cal-1",Cal2:"cal-2",Cal3:"cal-3",Cal4:"cal-4",Cal5:"cal-5",Cal6:"cal-6"},w={Local:"local",Explicit:"explicit",Ambiguous:"ambiguous"},D="#";function z(e,t){return t===""?e:`${e}${D}${t}`}function l(e){const t=e.indexOf(D);return t===-1?{calendarObjectId:e,recurrenceId:""}:{calendarObjectId:e.slice(0,t),recurrenceId:e.slice(t+1)}}const I=(e,t)=>{const r=[...e].sort((n,a)=>Date.parse(n.start)-Date.parse(a.start));return r.find(n=>Date.parse(n.end)>Date.parse(t))??r[0]};function B(e,t,r){const n=I(e.filter(a=>{const s=l(a.id);return s.calendarObjectId===t&&s.recurrenceId!==""}),r);return n?l(n.id):void 0}function P(e,t,r,n){const a=I(e.filter(s=>s.calendarObjectId===t&&A(s)).map(s=>x(s,"",n)),r);if(a)return{...l(a.id),calendarId:a.calendarId,date:a.start.slice(0,10)}}function S(e){return{id:e.calendarId,accountId:e.accountConfigId,accountLabel:"",name:e.displayName,color:v[e.color]??"cal-1",...e.source==="Subscribed"?{readOnly:!0,sync:e.subscriptionEnabled?"live":"paused",syncError:e.subscriptionError}:{}}}function x(e,t,r){return{id:z(e.calendarObjectId,e.recurrenceId),calendarId:e.calendarId,title:e.summary,start:e.allDay?e.start.slice(0,10):p(e.start,r),end:e.allDay?e.end.slice(0,10):p(e.end,r),allDay:e.allDay,location:"",notes:"",attendees:[],myRsvp:"accepted",threadId:"",threadSubject:"",timeZone:t,zoneCertainty:w[e.zoneCertainty]??"explicit",recurrenceRule:e.hasRecurrence?"Repeats":"",seriesId:e.hasRecurrence?e.icalUid:"",seriesException:!1,status:e.status==="Tentative"?"tentative":"confirmed"}}const A=e=>e.status!=="Cancelled";function W(){const{data:e,isLoading:t,error:r}=g(T());return h.useMemo(()=>{const n=e?.items??[],a=n.map(S);return{calendars:a,collections:n,colorByCalendarId:Object.fromEntries(a.map(s=>[s.id,s.color])),timeZoneByCalendarId:Object.fromEntries(n.map(s=>[s.calendarId,s.timezone])),defaultCalendarId:(n.find(s=>s.source==="Default")??n[0])?.calendarId??"",isLoading:t,error:r??null}},[e,t,r])}export{C as U,F as a,u as b,z as c,R as d,M as e,k as f,L as g,p as h,A as i,P as j,l as r,B as s,x as t,W as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as o}from"./index-
|
|
1
|
+
import{r as o}from"./index-JvL7NOOT.js";const n=(e,t)=>{const[r,u]=o.useState(e);return o.useEffect(()=>{const s=setTimeout(()=>u(e),t);return()=>clearTimeout(s)},[e,t]),r};export{n as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as p,i as b,eF as I,c as C,eG as x,e0 as F,eH as D,h as y,eI as N,eJ as P,eK as L,eL as z}from"./index-
|
|
1
|
+
import{r as p,i as b,eF as I,c as C,eG as x,e0 as F,eH as D,h as y,eI as N,eJ as P,eK as L,eL as z}from"./index-JvL7NOOT.js";const W=(e,t)=>{if(e.state==="Expired")return"Expired";if(e.scope!=="Temporary"||!e.expiresAt)return"Active";const r=Date.parse(e.expiresAt);return Number.isNaN(r)?"Active":r<=t?"Expired":"Active"},B=e=>{if(!e)return;const t=Date.parse(e);if(!Number.isNaN(t))return new Date(t).toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"})},M=(e,t=new Date)=>{if(!e)return;const r=/^(\d{4})-(\d{2})-(\d{2})$/.exec(e);if(!r)return;const[,a,i,n]=r,s=new Date(Number(a),Number(i)-1,Number(n),23,59,59,0);if(Number.isNaN(s.getTime()))return;const o=-t.getTimezoneOffset(),d=o>=0?"+":"-",l=Math.abs(o),c=String(Math.floor(l/60)).padStart(2,"0"),f=String(l%60).padStart(2,"0"),u=m=>String(m).padStart(2,"0");return`${s.getFullYear()}-${u(s.getMonth()+1)}-${u(s.getDate())}T${u(s.getHours())}:${u(s.getMinutes())}:${u(s.getSeconds())}${d}${c}:${f}`},h="None",G=e=>!e.literalClauses.some(t=>t.field==="HasWords"),O=e=>({...e.anchorMessageId?{anchorMessageId:e.anchorMessageId}:{},matchOperator:e.matchOperator,literalClauses:e.literalClauses,actionLabelId:e.labelId??h,actionMailboxId:e.moveMailboxId??h}),V=({mode:e,ruleScope:t})=>t==="standing"?"standing":t==="until"?"temporary":e==="selected"?"just-these":"all-like-these",X=({mode:e,ruleScope:t,anchorMessageId:r,clauses:a,matchOperator:i,moveMailboxId:n,until:s})=>({...e==="similar"&&r?{anchorMessageId:r}:{},matchOperator:i==="all"?"And":"Or",literalClauses:a.map(o=>({field:o.field,value:o.value})),moveMailboxId:n,expiresAt:t==="until"?M(s??""):void 0}),S=(e,t,r)=>({name:r,scope:t==="standing"?"Standing":"Temporary",...t==="temporary"&&e.expiresAt?{expiresAt:e.expiresAt}:{},matchOperator:e.matchOperator,literalClauses:e.literalClauses,actionLabelId:e.labelId??h,actionMailboxId:e.moveMailboxId??h,...e.anchorMessageId?{anchorMessageId:e.anchorMessageId}:{}}),T=new Set(["Complete","Failed"]),v=e=>e!==void 0&&T.has(e),w=1e3,J=15e3,_=e=>{const t=Math.max(0,e),r=w*2**t;return Math.min(r,J)},$=(e,t,r)=>{if(e)return{kind:r?"restartFailed":"startFailed",error:e};if(t)return{kind:"statusUnreadable",error:t}},Y=e=>{const[t,r]=p.useState(),a=b({...I(),onSuccess:g=>r(g.organizeJobId)}),{mutate:i}=a,n=C({...x({path:{accountId:e??"",organizeJobId:t??""}}),enabled:!!e&&!!t,refetchInterval:g=>{const E=g.state.data?.state;return v(E)?!1:_(g.state.dataUpdateCount)}}),s=p.useCallback(g=>{e&&i({path:{accountId:e},body:O(g)})},[e,i]),{refetch:o}=n,d=p.useCallback(()=>{o()},[o]),l=n.data,c=a.isPending?void 0:l,f=c?.state??a.data?.state,u=v(c?.state),m={state:f,matchedCount:c?.matchedCount??0,appliedCount:c?.appliedCount??0,failedCount:c?.failedCount??0,errorMessage:c?.errorMessage??""};return{start:s,refreshStatus:d,progress:m,isStarting:a.isPending,isRunning:!!t&&!u,isDone:u,failure:$(a.error,n.error,!!l)}},Z=["From","Subject","HasWords","ListId","FromDomain"],k=e=>{const t=e.trim(),r=t.match(/<([^>]+)>/);return(r?r[1]:t).trim().toLowerCase()},ee=(e,t)=>e==="ListId"?k(t):t.trim(),R=e=>e==="all"?"And":"Or",U=(e,t)=>{const r=e.widen!==void 0&&!e.widen.inactive,a=e.clauses.map(i=>({field:i.field,value:i.value}));return{...r&&t?{anchorMessageId:t}:{},matchOperator:R(e.matchOperator),literalClauses:a}},H=e=>e.anchorMessageId!==void 0||!e.literalClauses.some(t=>t.field==="HasWords"),Q=e=>JSON.stringify({anchor:e.anchorMessageId??null,operator:e.matchOperator,clauses:e.literalClauses.map(t=>`${t.field} ${t.value}`)}),te=(e,t)=>{const r=U(e,t);return{...r.anchorMessageId?{anchorMessageId:r.anchorMessageId}:{},matchOperator:r.matchOperator,literalClauses:r.literalClauses,moveMailboxId:e.moveMailboxId,labelId:e.labelId,expiresAt:e.scope==="until"?M(e.until??""):void 0}},j=(e,t)=>{if(e.error!==void 0&&e.errorSignature===t)return{status:"error",reason:e.error};if(e.count===void 0)return{status:"loading"};const r=e.indexEmpty===!0?{indexEmpty:!0}:{};return e.previewedSignature===t?{status:"ready",count:e.count,...r}:{status:"ready",count:e.count,stale:!0,...r}},q=350,re=(e,t,r)=>{const a=b(F()),{mutateAsync:i}=a,n=Q(t),[s,o]=p.useState(()=>({})),d=p.useRef(t);d.current=t;const l=p.useRef(n),c=H(t);return p.useEffect(()=>{if(!e||!c||n===s.previewedSignature||n===s.errorSignature)return;const f=setTimeout(()=>{const u=n;l.current=u,i({path:{accountId:e},body:O({...d.current})}).then(m=>{l.current===u&&o({count:m.matchedCount,matchedIds:m.messageIds,indexEmpty:m.semanticIndexEmpty===!0,previewedSignature:u})}).catch(m=>{l.current===u&&o(g=>({...g,error:m instanceof Error?m.message:"Couldn't count matches.",errorSignature:u}))})},q);return()=>clearTimeout(f)},[e,c,n,s.previewedSignature,s.errorSignature,i]),c?{count:j(s,n),matchedIds:s.previewedSignature===n?s.matchedIds??[]:[]}:{count:{status:"error",reason:D},matchedIds:[]}},A=e=>P({path:{accountId:e}}),se=e=>{const t=C({...L({path:{accountId:e??""}}),enabled:!!e});return{filters:t.data?.items??[],isPending:t.isPending,isError:t.isError,error:t.error,refetch:t.refetch}},ae=e=>{const t=y(),r=b({...N(),onSuccess:()=>{e&&t.invalidateQueries({queryKey:A(e)})}}),{mutate:a,mutateAsync:i}=r,n=p.useCallback((o,d,l)=>{e&&a({path:{accountId:e},body:S(o,d,l)})},[e,a]),s=p.useCallback(async(o,d,l)=>e?i({path:{accountId:e},body:S(o,d,l)}).then(()=>!0,()=>!1):!1,[e,i]);return{createFilter:n,createFilterAsync:s,isPending:r.isPending,isSuccess:r.isSuccess,isError:r.isError,error:r.error,reset:r.reset}},ne=e=>{const t=y(),r=b({...z(),onSuccess:()=>{e&&t.invalidateQueries({queryKey:A(e)})}}),{mutate:a}=r;return{deleteFilter:p.useCallback(n=>{e&&a({path:{accountId:e,filterId:n}})},[e,a]),isPending:r.isPending,deletingFilterId:r.isPending?r.variables?.path.filterId:void 0}};export{h as N,Z as S,Y as a,A as b,te as c,B as d,se as e,W as f,ne as g,O as h,ae as i,X as j,G as k,ee as n,V as o,M as p,U as r,re as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as p,ep as L,h as n,i as l,eq as d,r as o,er as y,es as c,et as g}from"./index-
|
|
1
|
+
import{c as p,ep as L,h as n,i as l,eq as d,r as o,er as y,es as c,et as g}from"./index-JvL7NOOT.js";const u=e=>y({path:{accountId:e}}),f=e=>{const r=p({...L({path:{accountId:e??""}}),enabled:!!e});return{labels:r.data?.items??[],isPending:r.isPending,isError:r.isError,error:r.error,refetch:r.refetch}},h=e=>{const r=n(),t=l({...d(),onSuccess:()=>{e&&r.invalidateQueries({queryKey:u(e)})}}),{mutateAsync:s}=t;return{createLabel:o.useCallback((a,i="Default")=>e?s({path:{accountId:e},body:{name:a,color:i}}):Promise.reject(new Error("No account")),[e,s]),isPending:t.isPending,isError:t.isError,error:t.error,reset:t.reset}},m=e=>{const r=n(),t=l({...c(),onSuccess:()=>{e&&r.invalidateQueries({queryKey:u(e)})}}),{mutate:s}=t;return{updateLabel:o.useCallback((a,i)=>{e&&s({path:{accountId:e,labelId:a},body:i})},[e,s]),isPending:t.isPending,updatingLabelId:t.isPending?t.variables?.path.labelId:void 0}},C=e=>{const r=n(),t=l({...g(),onSuccess:()=>{e&&r.invalidateQueries({queryKey:u(e)})}}),{mutate:s}=t;return{deleteLabel:o.useCallback(a=>{e&&s({path:{accountId:e,labelId:a}})},[e,s]),isPending:t.isPending,deletingLabelId:t.isPending?t.variables?.path.labelId:void 0}};export{f as a,m as b,C as c,h as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c1 as s,c2 as e}from"./index-
|
|
1
|
+
import{c1 as s,c2 as e}from"./index-JvL7NOOT.js";const i=768,r=t=>t!=="desktop",a=()=>{const t=s(`(min-width: ${i}px)`);return s(e)?"desktop":t?"tablet":"phone"};export{r as i,a as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as c,u as S,cn as O,co as N,a9 as h,cp as B,q as P,ab as U,h as $,c as D,cN as F,cO as v}from"./index-
|
|
1
|
+
import{r as c,u as S,cn as O,co as N,a9 as h,cp as B,q as P,ab as U,h as $,c as D,cN as F,cO as v}from"./index-JvL7NOOT.js";const R="/mail/brief/compose/{-$outboxMessageId}",w="/mail/flagged/compose/{-$outboxMessageId}",E="/mail/outbox/compose/{-$outboxMessageId}",k="/mail/$mailboxId/compose/{-$outboxMessageId}";function T(){const e=h({from:R,shouldThrow:!1}),t=h({from:w,shouldThrow:!1}),r=h({from:E,shouldThrow:!1}),s=h({from:k,shouldThrow:!1});return e??t??r??s}function Y(){return T()!==void 0}function j(){return T()?.outboxMessageId}function L(e,t,r){return e==="flagged"?{to:w,params:{outboxMessageId:r}}:e==="outbox"?{to:E,params:{outboxMessageId:r}}:e==="mailbox"&&t?{to:k,params:{mailboxId:t,outboxMessageId:r}}:{to:R,params:{outboxMessageId:r}}}function g(){const e=S(),t=O(),{list:r,mailboxId:s}=N();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=g();return c.useCallback(()=>e(void 0),[e])}function V(){const e=g();return c.useCallback(t=>e(t),[e])}function Z(){const e=g();return c.useCallback(t=>e(t,{replace:!0,keepPanels:!0}),[e])}function ee(){return B()}const _=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},b={all:["messages"],detail:e=>[...b.all,"detail",e],body:e=>[...b.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 q=e=>{const t=Number.parseInt(e??"",10);return!Number.isFinite(t)||t<=0?1:Math.min(t,30)},K=8,Q="x-remit-403-reason",I=(e,t)=>{const r=t?.trim()??"";return e===401?"auth":e===403?r.length>0?"auth":"body-missing":e===404?"body-missing":"generic"},X=(e,t)=>(t??"").toLowerCase().startsWith("text/html")?/<div\s+id=["']root["']/i.test(e):!1,G=(e,t)=>{const r=(t??"").toLowerCase();return!!(e==="text"&&r.startsWith("text/html"))},H=async(e,t,r=async()=>null)=>{const s={},n=await r();n&&(s.Authorization=`Bearer ${n}`);const o=await v(e,{headers:s});if(o.status===202)throw new f("not-ready","Message body is still syncing",202,q(o.headers.get("Retry-After")));if(!o.ok){const l=o.headers.get(Q),y=I(o.status,l);throw new f(y,`Failed to load message body (${o.status} ${o.statusText})`,o.status)}const a=o.headers.get("content-type");if(G(t,a))throw new f("content-type-mismatch",`Refusing to render message body — expected ${t}, got Content-Type ${a}`);const m=await o.text();if(X(m,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 m},W=async(e,t)=>(t.isRetryAfterNotReady&&await e.refetchDescribeMessage(),e.fetchContent(t.contentUrl,t.kind)),te=({messageId:e,bodyParts:t,enabled:r=!0})=>{const s=t?_(t):null,n=P(),{getToken:o}=U(),a=c.useRef(null),m=$(),l=c.useRef(!1),y=c.useRef(null),C=e&&s?`${e}:${s.contentUrl}`:null;y.current!==C&&(y.current=C,l.current=!1);const i=D({queryKey:e?[...b.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,W({fetchContent:(u,M)=>H(u,M,o),refetchDescribeMessage:()=>m.refetchQueries({queryKey:F({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<K: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,x=t!==void 0&&s===null;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 A=i.data&&s?{kind:s.kind,body:i.data}:void 0;return{picked:s,data:A,isLoading:p,hasNoRenderablePart:x,isError:i.isError,error:i.error,refetch:i.refetch}};export{f as B,Y as a,te as b,j as c,Z as d,ee as e,V as f,I as g,J as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c3 as Q,c4 as y,c5 as S,c6 as w,c7 as C,h as k,c8 as q,c9 as x,r as p,ca as M,cb as H,cc as L,cd as P,ce as O,cf as B,cg as A}from"./index-
|
|
1
|
+
import{c3 as Q,c4 as y,c5 as S,c6 as w,c7 as C,h as k,c8 as q,c9 as x,r as p,ca as M,cb as H,cc as L,cd as P,ce as O,cf as B,cg as A}from"./index-JvL7NOOT.js";function R(r,e){const s=new Set(e);return r.filter(t=>!s.has(t))}function T(r,e,s){const t=r.slice(0);return t[e]=s,t}var z=class extends Q{#i;#e;#n;#r;#s;#t;#o;#u;#h;#c=[];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.#d(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.#f(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,a=i.some((o,d)=>o!==s[d]),f=u||a,b=f?!0:n.some((o,d)=>{const g=this.#e[d];return!g||!S(o,g)});!f&&!b||(f&&(this.#c=t,this.#s=i),this.#e=n,this.hasListeners()&&(f&&(R(s,i).forEach(o=>{o.destroy()}),R(i,s).forEach(o=>{o.subscribe(d=>{this.#d(o,d)})})),this.#p()))})}getCurrentResult(){return this.#e}getQueries(){return this.#s.map(r=>r.getCurrentQuery())}getObservers(){return this.#s}getOptimisticResult(r,e){const s=this.#f(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.#a(t,s)]}#a(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}#b(){return this.#r?.combine!==void 0&&this.#s.some((r,e)=>r.options.suspense&&this.#e[e]?.data===void 0)}#f(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}#d(r,e){const s=this.#s.indexOf(r);s!==-1&&(this.#e=T(this.#e,s,e),this.#p())}#p(){if(this.hasListeners()){const r=this.#a(this.#e,this.#c),e=this.#b(),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 U({queries:r,...e},s){const t=k(),i=q(),n=x(),u=p.useMemo(()=>r.map(h=>{const c=t.defaultQueryOptions(h);return c._optimisticResults=i?"isRestoring":"optimistic",c}),[r,t,i]);u.forEach(h=>{M(h);const c=t.getQueryCache().get(h.queryHash);H(h,n,c)}),L(n);const[a]=p.useState(()=>new z(t,u,e)),[f,b,o]=a.getOptimisticResult(u,e.combine),d=!i&&e.subscribed!==!1;p.useSyncExternalStore(p.useCallback(h=>d?a.subscribe(y.batchCalls(h)):P,[a,d]),()=>a.getCurrentResult(),()=>a.getCurrentResult()),p.useEffect(()=>{a.setQueries(u,e)},[u,e,a]);const m=f.some((h,c)=>O(u[c],h))?f.flatMap((h,c)=>{const l=u[c];if(l&&O(l,h)){const E=new C(t,l);return B(l,E,n)}return[]}):[];if(m.length>0)throw Promise.all(m);const v=f.find((h,c)=>{const l=u[c];return l&&A({result:h,errorResetBoundary:n,throwOnError:l.throwOnError,query:t.getQueryCache().get(l.queryHash),suspense:l.suspense})});if(v?.error)throw v.error;return b(o())}export{U as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as E,a0 as K,t as Q,f as U,r as o,aT as R,h as N,C as $,E as z,F as B,q as G,P as I,Q as X,R as V,S as J}from"./index-
|
|
1
|
+
import{j as E,a0 as K,t as Q,f as U,r as o,aT as R,h as N,C as $,E as z,F as B,q as G,P as I,Q as X,R as V,S as J}from"./index-JvL7NOOT.js";import{C as Y}from"./circle-check-big-CfQbbZSe.js";import{R as Z}from"./refresh-cw-DNKXC09U.js";import{u as P}from"./useQueries-CG7A63o2.js";function ye({state:e,onRefresh:s,label:t,errorMessage:n,hasUpdate:a,size:u="sm",className:c}){const i=e==="refreshing",r=e==="error",h=e==="success",S=r?E.jsx(K,{className:"size-4 text-danger"}):h?E.jsx(Y,{className:"size-4 text-positive"}):E.jsx(Z,{className:Q("size-4",i&&"animate-spin")}),w=r?`${t} — failed: ${n??"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:S,onClick:s,disabled:i,"aria-label":w,"aria-busy":i||void 0,title:r?n: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 F=3e3,te=F*2,C={syncing:!1,resolved:!1,synced:0,total:0};function we(e,s){const t=e.join(","),[n,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&&!n,refetchInterval:F,meta:{softError:!0}}))}),r=i.every(m=>m.isSuccess||m.isError),h=i.length===0||r||u;let S=!1,w=0,y=0;for(const m of i)if(L(m.data?.syncPhase)){S=!0;for(const l of m.data?.mailboxes??[])w+=l.messagesSynced,y+=l.messagesTotal}const x=s&&h&&!S;return o.useEffect(()=>{x&&a(!0)},[x]),!s||!h?C:{syncing:S,resolved:!0,synced:w,total:y}}const se=180*1e3,xe=30*1e3;let q=0;const M=new Set,re=(e=Date.now())=>{q=e+se;for(const s of M)s()},pe=(e=Date.now())=>e<q,Ee=e=>(M.add(e),()=>{M.delete(e)}),T=6e4,ne=new Set(["sent","drafts","trash","archive"]),_=(e,s)=>{const t=new Map;for(const n of e){const a=s.get(n.mailboxId)?.role;a&&ne.has(a)||t.set(n.mailboxId,n.highWaterMarkUid)}return t},j=(e,s)=>{const t=[];for(const[n,a]of s)a>(e.get(n)??0)&&t.push(n);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=N(),{resultFolderIndex:n}=$(),a=o.useRef(new Map),u=o.useRef(new Set),c=o.useRef(new Map),[i,r]=o.useState(new Set),h=P({queries:e.map(l=>({...R({path:{accountId:l}}),refetchInterval:T,staleTime:T,meta:{softError:!0}}))}),S=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=_(b.mailboxes??[],n),v=c.current.get(d);if(c.current.set(d,g),v){const A=j(v,g);A.length>0&&z(t,B(A))}if(!u.current.has(d)){u.current.add(d),a.current.set(d,g);return}if(f.has(d))return;const W=a.current.get(d)??new Map;oe(W,g)&&(f.add(d),l=!0)}),l&&r(f)},[w,S]);const y=o.useCallback(l=>l.some(f=>i.has(f)),[i]),x=o.useCallback(l=>{r(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,_(d?.mailboxes??[],n)),u.current.add(f)}},[t,n]),m=o.useMemo(()=>({hasNewMail:y,acknowledge:x}),[y,x]);return E.jsx(D.Provider,{value:m,children:s})}const ie=2e3,ce=45e3,ue=e=>new Promise(s=>setTimeout(s,e)),k=e=>e instanceof Error&&e.message?e.message:"Something went wrong",le=e=>{V(e,{softError:!0},"user")&&J(e)},O=(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:n=0,onInboxSynced:a,deadline:u,pollMs:c=ie})=>{let i=!1;for(;;){const r=await s().then(y=>({ok:!0,data:y})).catch(y=>({ok:!1,error:y}));if(!r.ok)return{accountId:e,message:k(r.error)};const{syncPhase:h,lastSyncAt:S}=r.data;if((S??0)>t&&!L(h))return h==="error"?{accountId:e,message:"Sync failed for this account"}:void 0;if(!i&&H(r.data)>n&&(i=!0,a?.()),Date.now()>=u)return{accountId:e,message:"Refresh is taking longer than usual"};await ue(c)}},de=async(e,s,t,n,a)=>{const u=await O(e,t).then(r=>({ok:!0,lastSyncAt:r.lastSyncAt??0,inboxSyncedAt:H(r)})).catch(r=>({ok:!1,error:r}));if(!u.ok)return{accountId:t,enqueued:!1,ok:!1,message:k(u.error)};const c=await I({path:{accountId:t},throwOnError:!0}).then(()=>({ok:!0})).catch(r=>({ok:!1,error:r}));if(!c.ok)return le(c.error),{accountId:t,enqueued:!1,ok:!1,message:k(c.error)};s.recordEvent("sync.triggered");const i=await fe({accountId:t,readStatus:()=>O(e,t),baselineLastSyncAt:u.lastSyncAt,baselineInboxSyncedAt:u.inboxSyncedAt,onInboxSynced:()=>a(t),deadline:n});return i?{accountId:t,enqueued:!0,ok:!1,message:i.message}:{accountId:t,enqueued:!0,ok:!0}},Re=(e,s={})=>{const t=N(),n=G(),{acknowledge:a}=ae(),[u,c]=o.useState("idle"),[i,r]=o.useState(),h=o.useRef(0),S=o.useRef(e);S.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 y=o.useCallback(()=>{const x=S.current;if(x.length===0){c("error"),r("Nothing to refresh yet");return}const m=++h.current;c("refreshing"),r(void 0),re();const l=f=>{h.current===m&&(t.invalidateQueries({queryKey:X({path:{accountId:f}})}),w.current.onSettled?.())};(async()=>{const f=Date.now()+ce,d=await Promise.all(x.map(g=>de(t,n,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"),r(b[0]?.message))})()},[a,t,n]);return{state:u,errorMessage:i,refresh:y}};export{xe as H,be as M,ye as R,Re as a,L as b,we as c,pe as i,Ee as s,ae as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{K as r,r as s,b7 as t}from"./index-
|
|
1
|
+
import{K as r,r as s,b7 as t}from"./index-JvL7NOOT.js";import{u as m}from"./useQueries-CG7A63o2.js";const a=i=>({items:i.map(e=>e.data?.items??[]),isPending:i.some(e=>e.isPending),error:i.find(e=>e.error)?.error??null});function u(i){const e=m({queries:i.map(o=>({...r({path:{accountId:o.accountId}}),staleTime:1/0})),combine:a});return{index:s.useMemo(()=>t(i.map((o,n)=>({folderAppointments:o.folderAppointments,mailboxes:e.items[n]??[]}))),[i,e]),isPending:e.isPending,error:e.error}}export{u};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as h,j as a,cu as Y,t as b,I as X,h as Z,at as J,i as ee,av as te,cN as se,bS as re,ab as ne,a0 as ae,X as oe,d6 as _,d7 as I,C as ie,co as ce}from"./index-
|
|
1
|
+
import{r as h,j as a,cu as Y,t as b,I as X,h as Z,at as J,i as ee,av as te,cN as se,bS as re,ab as ne,a0 as ae,X as oe,d6 as _,d7 as I,C as ie,co as ce}from"./index-JvL7NOOT.js";import{K as A}from"./kbd-DEjfq9k-.js";import{B as le,b as de}from"./useMessageBodyContent-CDZhnuFx.js";import{i as ue}from"./search-scope-B5-OK3Cq.js";const me='"Geist Variable", "Geist", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif',k={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)"}},fe={background:!1,spacing:!1},he="16px",ge=()=>`html{padding:0}body{padding:${he};box-sizing:border-box}`,pe=()=>"html{overflow:hidden}body{overflow-x:auto}",be=/prefers-color-scheme\s*:\s*dark|color-scheme\s*:\s*[^;}"']*\bdark\b/i,ye='<meta name="viewport" content="width=device-width, initial-scale=1">',xe=e=>{const t=e?k.dark:k.light;return`
|
|
2
2
|
/* Plain-email base: UI font-stack + theme-aware colors (#424) */
|
|
3
3
|
html, body {
|
|
4
4
|
font-family: ${me};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{h as L,at as M,i as k,E as I,F as E,cz as A,el as R,r as v,dy as w,j as p,em as h,en as D,eo as _,C as j,co as z,c as N,dS as Q,d6 as O}from"./index-
|
|
1
|
+
import{h as L,at as M,i as k,E as I,F as E,cz as A,el as R,r as v,dy as w,j as p,em as h,en as D,eo as _,C as j,co as z,c as N,dS as Q,d6 as O}from"./index-JvL7NOOT.js";import{c as U}from"./popover-menu-ndRLkI9F.js";import{ai as q}from"./MailListHeader-BWxCXjLF.js";import{a as P}from"./useLabels-BPGhj-Hw.js";import{n as B}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-DCNyVMih.js";const ne=e=>{const t=new Set;for(const s of e)s&&t.add(s);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:s}=e,n=L(),{pushError:l}=M(),{mutateAsync:c,isPending:a}=k({...R(),onError:(r,u)=>{l({title:u.body.action==="Remove"?"Couldn't remove label":"Couldn't apply label",detail:A(r),error:r})},onSettled:(r,u,d)=>{I(n,E(q(d.body.messageIds??[],s??[],t)))}});return{applyLabel:v.useCallback((r,u,d)=>{r.length!==0&&w(r,m=>c({body:{messageIds:m,labelId:u,action:d}}))},[c]),isPending:a}};function re({accountId:e,mailboxId:t,messageIds:s}){const{labels:n}=P(e),{applyLabel:l}=K({mailboxId:t}),c=v.useMemo(()=>n.map(a=>({key:a.labelId,label:a.name,icon:p.jsx("span",{className:`size-2.5 rounded-full ${D(a.color)?h[a.color]:h.Default}`}),onSelect:()=>l(s,a.labelId,"Apply")})),[n,s,l]);return c.length===0?null:p.jsx(U,{triggerLabel:"Apply label to selected messages",triggerIcon:p.jsx(_,{className:"size-4 text-fg-subtle"}),triggerText:"Apply label",items:c,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=3,ie=({hasSearchQuery:e,freeText:t,residualTokenCount:s})=>{if(!e||s>0)return!1;const n=t.trim();return n.length===0||n.length>=V},ce=e=>e===void 0?{kind:"unknown"}:{kind:"exact",value:e},Y=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 le({mailboxId:e,filterCategory:t}={}){const{searchQuery:s}=j(),n=G(),l=z(),c=B(s),{freeText:a,tokens:i}=H(c,n),r=a.length>0,u=i.find(o=>o.type==="category"),d=J(t)??u?.category,m=i.some(o=>o.type==="hasAttachment")?!0:void 0,f=i.some(o=>o.type==="isStarred")?!0:void 0,y=W(i),b=i.find(o=>o.type==="after"),g=i.find(o=>o.type==="before"),S=i.find(o=>o.type==="in"),x=F({browsed:l,callerMailboxId:e,inTokenMailboxId:S?.mailboxId}),{data:T,isLoading:C}=N({...Q({query:{query:a,mailboxId:x,limit:Y,...d!==void 0?{category:d}:{},...m!==void 0?{hasAttachment:m}:{},...f!==void 0?{hasStars:f}:{},...y!==void 0?{isRead:y}:{},...b?{sentDateFrom:b.epochSeconds}:{},...g?{sentDateTo:g.epochSeconds}:{}}}),enabled:r,staleTime:6e4});return{hits:T?.items??[],isLoading:r&&C}}export{re as L,ne as r,ie as s,ce as t,le as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{h as g,at as p,c as f,d as m,r,i as y,av as T,o as E,l as d}from"./index-
|
|
1
|
+
import{h as g,at as p,c as f,d as m,r,i as y,av as T,o as E,l as d}from"./index-JvL7NOOT.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-
|
|
41
|
+
<script type="module" crossorigin src="/assets/index-JvL7NOOT.js"></script>
|
|
42
42
|
<link rel="stylesheet" crossorigin href="/assets/index-BZsbyrwY.css">
|
|
43
43
|
</head>
|
|
44
44
|
<body>
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as r,bU as ws,c1 as js,c2 as Ms,cP as Rs,B as ft,f as X,W as Es,t as Re,g as Wt,r as c,_ as Os,$ as As,bw as Ns,cQ as Ge,h as jt,c as mt,ad as zs,i as Mt,cR as Fs,cL as Ds,I as _s,a7 as Ls,a3 as Kt,cS as Ps,cT as Vt,bY as $s,bq as Bs,cU as Ws,cV as Ks,at as qt,cW as Vs,cX as qs,aH as Hs,aI as Qs,cY as Us,cZ as Js,q as Rt,m as Gs,Q as Ht,bt as Ys,K as Xs,bu as Zs,bv as en,c_ as tn,o as sn,E as nn,F as on,c$ as rn,cz as an,s as ln,d0 as cn,d1 as un,d2 as Qt,d3 as Ut,C as Jt,ai as dn,d4 as hn,d5 as fn,ak as mn,bF as gn}from"./index-BNAV6NNi.js";import{u as pn,p as Dt,R as xn}from"./useSearchTokenContext-AypRRqG2.js";import{u as bn,a as vn,R as Sn}from"./useRefreshControl-VAzesut8.js";import{r as Et,C as Gt,c as Yt,j as yn,M as Cn,t as Xt,u as In,a as kn,b as Zt,d as es,e as Tn,f as wn,g as jn,n as Mn,h as Rn,i as En,S as On,k as An,D as Nn,l as zn,m as Fn,o as ts,p as Dn,q as _n,s as Ln,v as Pn,w as $n,x as ss,y as Bn,z as Wn,A as Kn,B as Vn,E as qn,F as Hn,G as Qn,H as Un,I as Jn,J as _t,K as Lt,L as Gn,N as Yn,O as Xn,P as Zn,Q as eo,R as to,T as so,U as no,V as oo,W as io,X as ro,Y as ao,Z as ns,_ as os,$ as is,a0 as lo,a1 as co,a2 as uo,a3 as ho,a4 as fo,a5 as mo,a6 as go,a7 as po}from"./MailListHeader-p1q7jsyl.js";import{S as xo,M as bo,a as vo,u as So,l as yo,b as Co}from"./MailViewChrome-B80rNMML.js";import{A as Ot}from"./avatar-BZB5Hlpq.js";import{c as Io,f as ko,a as To,u as wo}from"./useMessageBodyContent-CAy2uoxy.js";import{e as Ye,f as jo,g as Mo,h as Ro,i as Eo}from"./search-token-index-CbMoDJvO.js";import{N as Oo}from"./NavMenuButton-D50RaMZU.js";import{C as Ao}from"./confirm-dialog-GyEqvQcg.js";import{f as No}from"./ErrorState-BMamrpRe.js";import{a as zo}from"./useLabels-CqJaWt3E.js";import{L as Fo,r as Do,t as _o,s as Lo,u as Po}from"./useSemanticSearch-DLp4ptAj.js";import{S as gt}from"./shield-check-BR1Itb39.js";import{B as $o}from"./bottom-sheet-nV19J7QD.js";import{C as rs}from"./checkbox-BeWcYpqA.js";import{C as Bo}from"./circle-help-DRIXmYoN.js";import{C as Wo}from"./circle-check-D-kPomlF.js";import{u as Ko}from"./useLayoutTier-B0CJkqKe.js";import{n as Vo}from"./search-query-Cr_ZXBCp.js";import{u as qo}from"./sections-D-5U_zIy.js";const Ho=e=>e.toLocaleString(),Qo=(e,o)=>{if(e.kind==="unknown")return`Results for “${o}”`;const t=e.value===1?"result":"results";return`${Ho(e.value)} ${t} for “${o}”`};function Uo({query:e,count:o}){return r.jsxs("div",{className:"flex items-center gap-2 border-b border-line bg-surface-sunken/30 px-3 py-2",children:[r.jsx(ws,{className:"size-4 text-fg-muted","aria-hidden":"true"}),r.jsx("span",{className:"text-sm text-fg-muted",children:Qo(o,e)})]})}const Jo=({children:e,onRefresh:o,isRefreshing:t})=>js(Ms)?e:r.jsx(Rs,{onRefresh:o,isPullable:!t,children:e}),Go=e=>e===1?"message":"messages";function Yo({count:e,onReview:o,onDismiss:t,actionLabel:s="Review & rescue"}){return r.jsx(ft,{tone:"info",variant:"soft",onDismiss:t,children:r.jsxs("div",{className:"flex flex-col gap-2",children:[r.jsxs("p",{className:"flex items-start gap-2 text-sm text-fg",children:[r.jsx(gt,{className:"mt-0.5 size-4 shrink-0 text-positive","aria-hidden":!0}),r.jsxs("span",{children:[r.jsx("span",{className:"font-semibold text-fg",children:`${e} ${Go(e)} here`})," ","may not be spam — they're from senders we can verify."]})]}),r.jsx(X,{variant:"primary",size:"sm",onClick:o,className:"self-start",children:s})]})})}const Xo=(e,o)=>e==="vip"?"vip":e==="unknown"&&o==="md"?"unknown-pill":"hidden",as=({senderTrust:e,size:o="sm",className:t})=>{const s=Xo(e,o);return s==="vip"?r.jsx(Es,{className:Re("text-warning shrink-0",o==="sm"&&"size-3.5",o==="md"&&"size-4",t),"aria-label":"VIP sender","data-testid":"sender-trust-vip"}):s==="unknown-pill"?r.jsx("span",{className:Re("inline-flex items-center rounded border border-dashed border-fg-subtle/40 font-medium uppercase tracking-wide text-fg-muted/80 shrink-0","px-2 py-0.5 text-xs",t),title:"First message from this sender","aria-label":"First message from this sender","data-testid":"sender-trust-unknown",children:"new"}):null};function Zo({candidate:e,selected:o,onToggle:t,hideSender:s=!1}){const{senderName:n,senderAddress:i,subject:l,snippet:a,trustReason:u,trustSubReason:d,senderTrust:h}=e;return r.jsxs("label",{className:Re("flex w-full cursor-pointer items-start gap-3 px-3 py-2.5 text-left transition-colors",s&&"pl-11",o?"bg-positive/10":"bg-surface hover:bg-surface-sunken"),children:[r.jsx(rs,{className:"mt-0.5",checked:o,onChange:t,"aria-label":`${o?"Deselect":"Select"} ${s?l:`message from ${n}`}`}),!s&&r.jsx(Ot,{name:n,email:i,size:"sm"}),r.jsxs("span",{className:"min-w-0 flex-1",children:[!s&&r.jsxs("span",{className:"flex items-center gap-1.5",children:[r.jsx("span",{className:"truncate text-sm font-medium text-fg",children:n}),h&&r.jsx(as,{senderTrust:h,size:"sm"}),r.jsx("span",{className:"truncate text-2xs text-fg-subtle",children:i})]}),r.jsx("span",{className:"block truncate text-sm text-fg-muted",children:l}),r.jsx("span",{className:"block line-clamp-1 text-xs text-fg-subtle",children:a}),!s&&r.jsxs("span",{className:"mt-1.5 flex flex-wrap items-center gap-1.5",children:[r.jsxs(Wt,{tone:"positive",children:[r.jsx(gt,{className:"size-3","aria-hidden":!0}),u]}),r.jsx("span",{className:"text-2xs text-fg-subtle",children:d})]})]})]})}const ei=e=>{const o=new Map,t=[];for(const s of e){const n=(s.senderAddress||s.senderName).toLowerCase(),i=o.get(n);if(i){i.messages.push(s);continue}o.set(n,{key:n,senderName:s.senderName,senderAddress:s.senderAddress,trustReason:s.trustReason,trustSubReason:s.trustSubReason,senderTrust:s.senderTrust,messages:[s]}),t.push(n)}return t.map(s=>o.get(s)).sort((s,n)=>n.messages.length-s.messages.length)},ti=(e,o)=>{const t=e.messages.filter(s=>o.has(s.id)).length;return t===0?"none":t===e.messages.length?"all":"some"},Pt=e=>e===1?"message":"messages";function si({group:e,selected:o,onToggleGroup:t,onToggleMessage:s}){const[n,i]=c.useState(!1),l=ti(e,o),a=e.messages.length,u=n?Os:As;return r.jsxs("div",{className:Re(l!=="none"?"bg-positive/10":"bg-surface"),children:[r.jsxs("div",{className:"flex w-full items-start gap-3 px-3 py-2.5",children:[r.jsx(rs,{className:"mt-0.5",checked:l==="all",indeterminate:l==="some",onChange:()=>t(e,l!=="all"),"aria-label":`${l==="all"?"Deselect":"Select"} all ${a} ${Pt(a)} from ${e.senderName}`}),r.jsx(Ot,{name:e.senderName,email:e.senderAddress,size:"sm"}),r.jsxs("div",{className:"min-w-0 flex-1",children:[r.jsxs("div",{className:"flex items-center gap-1.5",children:[r.jsx("span",{className:"truncate text-sm font-medium text-fg",children:e.senderName}),e.senderTrust&&r.jsx(as,{senderTrust:e.senderTrust,size:"sm"}),r.jsx("span",{className:"truncate text-2xs text-fg-subtle",children:e.senderAddress})]}),r.jsxs("div",{className:"mt-1.5 flex flex-wrap items-center gap-1.5",children:[r.jsxs(Wt,{tone:"positive",children:[r.jsx(gt,{className:"size-3","aria-hidden":!0}),e.trustReason]}),r.jsx("span",{className:"text-2xs text-fg-subtle",children:e.trustSubReason})]})]}),r.jsxs("button",{type:"button",onClick:()=>i(d=>!d),"aria-expanded":n,className:"flex shrink-0 items-center gap-1 rounded-md px-1.5 py-1 text-2xs text-fg-muted transition-colors hover:bg-surface-sunken hover:text-fg",children:[`${a} ${Pt(a)}`,r.jsx(u,{className:"size-3.5","aria-hidden":!0})]})]}),n&&r.jsx("div",{className:"divide-y divide-line border-t border-line",children:e.messages.map(d=>r.jsx(Zo,{candidate:d,selected:o.has(d.id),onToggle:()=>s(d.id),hideSender:!0},d.id))})]})}const At=e=>e===1?"message":"messages",ni=(e,o)=>`Moves ${e===1?"this message":`these ${e} ${At(e)}`} out of Spam to ${o} now. Nothing later.`,wt=(e,o)=>e.find(t=>t.id===o)?.label??"Inbox";function oi(){return r.jsx(ft,{tone:"info",variant:"soft",children:r.jsx("p",{className:"text-2xs text-fg-muted",children:"We list a message here only when we can confirm the sender is who they say — usually someone you've emailed before, write to often, or a service that consistently checks out. We never guess from words in the subject. Anything we can't confirm stays in Spam."})})}function ii({candidates:e,selected:o,onToggle:t,onToggleGroup:s,onSelectAll:n,onSelectNone:i,onContinue:l,onCancel:a}){const[u,d]=c.useState(!1),h=o.size,g=c.useMemo(()=>ei(e),[e]);return r.jsxs("div",{className:"flex min-h-0 flex-col",children:[r.jsxs("div",{className:"px-row-inset pb-2 pt-1",children:[r.jsxs("div",{className:"flex items-start justify-between gap-2",children:[r.jsxs("h2",{className:"flex items-center gap-2 text-sm font-semibold text-fg",children:[r.jsx(gt,{className:"size-4 text-positive","aria-hidden":!0}),"Rescue from Spam"]}),r.jsx(X,{variant:"ghost",size:"sm",icon:r.jsx(Bo,{className:"size-3.5"}),onClick:()=>d(m=>!m),className:"-mr-1.5 -mt-0.5",children:"Why these?"})]}),r.jsx("p",{className:"mt-1 text-2xs text-fg-subtle",children:"These look safe — from senders we can verify. Uncheck any sender that belongs in Spam, or open a sender to pick individual messages."}),u&&r.jsx("div",{className:"mt-2",children:r.jsx(oi,{})})]}),r.jsxs("div",{className:"flex items-center justify-between px-row-inset pb-1.5",children:[r.jsx("span",{className:"text-2xs font-medium text-fg-muted",children:`${h} of ${e.length} selected · ${g.length} ${g.length===1?"sender":"senders"}`}),r.jsxs("span",{className:"flex gap-1",children:[r.jsx(X,{variant:"ghost",size:"sm",onClick:n,children:"Select all"}),r.jsx(X,{variant:"ghost",size:"sm",onClick:i,children:"Select none"})]})]}),r.jsx("div",{className:"min-h-0 flex-1 divide-y divide-line overflow-y-auto border-y border-line",children:g.map(m=>r.jsx(si,{group:m,selected:o,onToggleGroup:s,onToggleMessage:t},m.key))}),r.jsxs("div",{className:"space-y-2 border-t border-line bg-surface px-row-inset py-3",children:[r.jsx(X,{variant:"primary",onClick:l,className:"h-11 w-full font-semibold",children:`Continue with ${h} ${At(h)}`}),r.jsx(X,{variant:"ghost",onClick:a,className:"h-11 w-full",children:"Cancel"})]})]})}function ri({count:e,folders:o,delimiter:t,destination:s,onPick:n,onMove:i,onBack:l}){const[a,u]=c.useState(!1);return r.jsxs("div",{className:"flex min-h-0 flex-col",children:[r.jsxs("div",{className:"px-row-inset pb-2 pt-1",children:[r.jsx("h2",{className:"text-sm font-semibold text-fg",children:"Where should they go?"}),r.jsx("p",{className:"mt-1 text-2xs text-fg-subtle",children:"Pick a folder, then we move them out of Spam."})]}),r.jsx("div",{className:"flex min-h-0 flex-1 flex-col overflow-y-auto px-row-inset py-2",children:a?r.jsx("div",{className:"flex min-h-0 flex-1 overflow-hidden rounded-xl border border-line bg-surface",children:r.jsx(Ns,{folders:o,selectedId:s,delimiter:t,onSelect:n,onCancel:()=>u(!1)})}):r.jsxs("div",{className:"rounded-xl border border-line bg-surface-sunken p-3",children:[r.jsx("p",{className:"text-2xs text-fg-subtle",children:"Destination"}),r.jsx("p",{className:"mt-0.5 text-sm font-medium text-fg",children:wt(o,s)}),r.jsx(X,{variant:"ghost",size:"sm",onClick:()=>u(!0),className:"mt-2 px-0",children:"Move to a different folder"})]})}),r.jsxs("div",{className:"space-y-2 border-t border-line bg-surface px-row-inset py-3",children:[r.jsx("p",{className:"text-2xs text-fg-subtle",children:ni(e,wt(o,s))}),r.jsx(X,{variant:"primary",onClick:i,className:"h-11 w-full font-semibold",children:`Move ${e} out of Spam`}),r.jsx(X,{variant:"ghost",onClick:l,className:"h-11 w-full",children:"Back"})]})]})}function ai({count:e,destinationLabel:o,onClose:t}){return r.jsxs("div",{className:"flex min-h-0 flex-col",children:[r.jsxs("div",{className:"flex flex-1 flex-col items-center justify-center gap-3 px-row-inset py-10 text-center",children:[r.jsx(Wo,{className:"size-10 text-positive","aria-hidden":!0}),r.jsx("p",{className:"text-base font-semibold text-fg",children:`Moved ${e} ${At(e)} out of Spam.`}),r.jsx("p",{className:"text-2xs text-fg-subtle",children:`You'll find them in ${o}.`})]}),r.jsx("div",{className:"border-t border-line bg-surface px-row-inset py-3",children:r.jsx(X,{variant:"primary",onClick:t,className:"h-11 w-full font-semibold",children:"Done"})})]})}function li({open:e,candidates:o,defaultDestinationId:t,availableFolders:s,delimiter:n,onConfirmMove:i,onCancel:l}){const[a,u]=c.useState("review"),[d,h]=c.useState(()=>e?new Set(o.map(k=>k.id)):new Set),[g,m]=c.useState(t),[p,S]=c.useState(0),y=c.useRef(!1);c.useEffect(()=>{e&&!y.current&&(u("review"),h(new Set(o.map(k=>k.id))),m(t),S(0)),y.current=e},[e,o,t]);const I=d.size,b=k=>{h(w=>{const O=new Set(w);return O.has(k)?O.delete(k):O.add(k),O})},x=(k,w)=>{h(O=>{const A=new Set(O);for(const B of k.messages)w?A.add(B.id):A.delete(B.id);return A})},j=()=>{const k=Array.from(d);S(k.length),i(k,g),u("done")};return r.jsxs($o,{open:e,onClose:l,label:"Rescue from spam",dismissLabel:"Close rescue",children:[a==="review"&&r.jsx(ii,{candidates:o,selected:d,onToggle:b,onToggleGroup:x,onSelectAll:()=>h(new Set(o.map(k=>k.id))),onSelectNone:()=>h(new Set),onContinue:()=>u("destination"),onCancel:l}),a==="destination"&&r.jsx(ri,{count:I,folders:s,delimiter:n,destination:g,onPick:m,onMove:j,onBack:()=>u("review")}),a==="done"&&r.jsx(ai,{count:p,destinationLabel:wt(s,g),onClose:l})]})}function ci(e){const o=e.toAddresses.join(", ");return{id:e.outboxMessageId,accountId:e.accountId,fromName:e.fromName??e.fromAddress??"Me",fromEmail:e.fromAddress??"",subject:e.subject??"(No subject)",snippet:o?`To: ${o}`:"(No recipients)",timeLabel:Ge(e.updatedAt),isRead:!0}}function ui(e){return{id:e.messageId,accountId:e.accountId,fromName:e.fromName??e.fromEmail??"Unknown",fromEmail:e.fromEmail??"",subject:e.subject??"(No subject)",snippet:e.snippet??"",timeLabel:Ge(e.sentDate),isRead:e.isRead,hasAttachment:e.hasAttachment,starred:e.hasStars===!0,...Et(e)}}function di({outboxMessages:e,accountId:o,imapThreads:t}){const s=e.filter(l=>l.status==="draft"&&l.accountId===o).map(ci),n=t.map(ui),i=[];return s.length>0&&i.push({id:"remit-drafts",label:"Not yet sent (Remit)",threads:s}),n.length>0&&i.push({id:"imap-drafts",label:"On the server",threads:n}),i}const hi=({label:e,count:o})=>r.jsxs("div",{className:"sticky top-0 z-10 flex items-baseline justify-between border-b border-line bg-surface-sunken px-row-inset py-1",children:[r.jsx("span",{className:"text-2xs font-semibold uppercase tracking-wider text-fg-subtle",children:e}),r.jsx("span",{className:"text-2xs text-fg-subtle tabular-nums",children:o})]}),fi=({row:e,isSelected:o,onOpen:t,onDelete:s,isDeleting:n})=>r.jsxs("button",{type:"button",onClick:()=>t(e.id),className:Re("group",Yt({active:o})),children:[r.jsx(Ls,{className:"size-7 shrink-0 text-fg-muted mt-0.5"}),r.jsx(Gt,{thread:e}),r.jsx("div",{className:"flex items-center gap-1 shrink-0",children:r.jsx("button",{type:"button",onClick:i=>{i.stopPropagation(),s(e.id)},disabled:n,className:"p-1.5 rounded-md text-fg-muted hover:text-danger hover:bg-surface-raised transition-colors opacity-0 group-hover:opacity-100 focus:opacity-100",title:"Delete draft",children:r.jsx(Kt,{className:"size-3.5"})})})]}),mi=({row:e,isSelected:o,onOpen:t})=>{const s=!e.isRead;return r.jsxs("button",{type:"button",onClick:()=>t(e.id),className:Re("group",Yt({active:o})),children:[s&&r.jsx("span",{className:"absolute left-1.5 top-1/2 size-1.5 -translate-y-1/2 rounded-full bg-accent"}),r.jsx(Ot,{name:e.fromName,email:e.fromEmail,size:"sm"}),r.jsx(Gt,{thread:e})]})};function gi({accountId:e,selectedMessageId:o,imapThreads:t,title:s,unreadCount:n}){const i=Io(),l=ko(),a=Ye(),u=jt(),{data:d}=mt(zs()),h=c.useMemo(()=>di({outboxMessages:d?.items??[],accountId:e,imapThreads:t}),[d?.items,e,t]),g=Mt({...Ds(),onSuccess:()=>{u.invalidateQueries({queryKey:Fs()})}}),m=y=>{g.mutate({path:{outboxMessageId:y}})},p=y=>{const I=t.find(b=>b.messageId===y)?.threadId;I&&a({threadId:I,messageId:y})},S=h.length===0;return r.jsxs("section",{className:"flex h-full w-full flex-col bg-surface",children:[r.jsxs("header",{className:"flex h-pane-header shrink-0 items-center gap-2 border-b border-line px-row-inset",children:[r.jsx(Oo,{}),r.jsx("h1",{className:"min-w-0 flex-1 truncate text-sm font-semibold text-fg",children:s}),(n??0)>0&&r.jsxs("span",{className:"shrink-0 text-2xs text-fg-subtle tabular-nums",children:[n," unread"]})]}),r.jsx("div",{className:"flex-1 overflow-y-auto",children:S?r.jsxs("div",{className:"flex flex-col items-center justify-center h-full gap-2 text-center px-4",children:[r.jsx(_s,{className:"size-8 text-fg-subtle"}),r.jsx("p",{className:"text-sm font-medium text-fg",children:"No drafts"}),r.jsx("p",{className:"text-xs text-fg-subtle",children:"Messages you start composing will appear here."})]}):h.map(y=>r.jsxs("div",{children:[y.label&&r.jsx(hi,{label:y.label,count:y.threads.length}),r.jsx("div",{className:"divide-y divide-line",children:y.threads.map(I=>y.id==="remit-drafts"?r.jsx(fi,{row:I,isSelected:I.id===i,onOpen:l,onDelete:m,isDeleting:g.isPending},I.id):r.jsx(mi,{row:I,isSelected:I.id===o,onOpen:p},I.id))})]},y.id))})]})}const ls=e=>e===1?"1 message":`${Vt(e)} messages`,pi=e=>({title:"Empty Trash?",description:`${ls(e)} ${e===1?"is":"are"} erased from the mail server and cannot be restored.`,confirmLabel:"Empty Trash"}),xi=(e,o={})=>{const{trashFolderLabel:t,staleFolderLabel:s}=o;if(e==="unconfirmed"){const n=Ps(0,"unconfirmed",{trashFolderLabel:t});return{headline:n.title,body:n.description,actionLabel:n.confirmLabel}}return e==="stale"?{headline:"Nothing was emptied.",body:s?`The folder you chose for Trash — ${s} — is gone from the mail server.`:"The folder you chose for Trash is gone from the mail server.",actionLabel:"Pick another folder"}:{headline:"Nothing was emptied.",body:"No folder on this account is set as Trash.",actionLabel:"Pick a folder"}};function bi({messageCount:e,isEmptying:o,deletedCount:t,refusalReason:s,trashFolderLabel:n,staleFolderLabel:i,onEmpty:l,onRepair:a,children:u}){const[d,h]=c.useState(!1);if(e<1&&s===void 0&&t===void 0)return r.jsx(r.Fragment,{children:u});const g=s?xi(s,{trashFolderLabel:n,staleFolderLabel:i}):void 0,m=pi(e);return r.jsxs("div",{className:"relative flex h-full min-h-0 flex-col",children:[r.jsx("div",{className:"shrink-0 px-row-inset pt-2",children:r.jsxs("div",{className:"flex flex-col gap-2 rounded-md border border-line px-3 py-2",children:[r.jsxs("div",{className:"flex items-center justify-end gap-2",children:[t!==void 0&&r.jsx("p",{className:"mr-auto text-2xs text-fg-subtle",role:"status",children:`${ls(t)} erased from the mail server.`}),r.jsx(X,{variant:"ghost",size:"sm",icon:r.jsx(Kt,{className:"size-3.5","aria-hidden":!0}),disabled:o||e<1,"aria-busy":o,onClick:()=>h(!0),children:o?"Emptying…":"Empty Trash"})]}),g&&r.jsx(ft,{tone:"warning",variant:"soft",children:r.jsxs("div",{className:"flex flex-col gap-2",children:[r.jsx("p",{className:"font-semibold text-fg",children:g.headline}),r.jsx("p",{className:"text-sm",children:g.body}),r.jsx(X,{variant:"primary",size:"sm",className:"self-start",onClick:a,children:g.actionLabel})]})})]})}),r.jsx("div",{className:"min-h-0 flex-1",children:u}),r.jsx(Ao,{isOpen:d,title:m.title,description:m.description,confirmLabel:m.confirmLabel,destructive:!0,onConfirm:()=>{h(!1),l()},onCancel:()=>h(!1)})]})}function vi(e,o,t){const s=new Array(e);return new Proxy(s,{get(n,i,l){if(typeof i=="string"){const a=i.charCodeAt(0);if(a>=48&&a<=57){const u=+i;if(Number.isInteger(u)&&u>=0&&u<e){let d=n[u];if(!d){const h=o[u*2];d=n[u]={index:u,key:t(u),start:h,size:o[u*2+1],end:h+o[u*2+1],lane:0}}return d}}if(i==="length")return e}return Reflect.get(n,i,l)}})}function Le(e,o,t){let s=t.initialDeps??[],n,i=!0;function l(){const a=e();return(a.length!==s.length||a.some((d,h)=>s[h]!==d))&&(s=a,n=o(...a),t?.onChange&&!(i&&t.skipInitialOnChange)&&t.onChange(n),i=!1),n}return l.updateDeps=a=>{s=a},l}function $t(e,o){if(e===void 0)throw new Error("Unexpected undefined");return e}const Si=(e,o)=>Math.abs(e-o)<1.01,yi=(e,o,t)=>{let s;return function(...n){e.clearTimeout(s),s=e.setTimeout(()=>o.apply(this,n),t)}};let Je;const kt=()=>{if(Je!==void 0)return Je;if(typeof navigator>"u")return Je=!1;if(/iP(hone|od|ad)/.test(navigator.userAgent))return Je=!0;const e=navigator.maxTouchPoints;return Je=navigator.platform==="MacIntel"&&e!==void 0&&e>0},Bt=e=>{const{offsetWidth:o,offsetHeight:t}=e;return{width:o,height:t}},Ci=e=>e,Ii=e=>{const o=Math.max(e.startIndex-e.overscan,0),s=Math.min(e.endIndex+e.overscan,e.count-1)-o+1,n=new Array(s);for(let i=0;i<s;i++)n[i]=o+i;return n},ki=(e,o)=>{const t=e.scrollElement;if(!t)return;const s=e.targetWindow;if(!s)return;const n=l=>{const{width:a,height:u}=l;o({width:Math.round(a),height:Math.round(u)})};if(n(Bt(t)),!s.ResizeObserver)return()=>{};const i=new s.ResizeObserver(l=>{const a=()=>{const u=l[0];if(u?.borderBoxSize){const d=u.borderBoxSize[0];if(d){n({width:d.inlineSize,height:d.blockSize});return}}n(Bt(t))};e.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(a):a()});return i.observe(t,{box:"border-box"}),()=>{i.unobserve(t)}},ht={passive:!0},Ti=typeof window>"u"?!0:"onscrollend"in window,wi=(e,o,t)=>{const s=e.scrollElement;if(!s)return;const n=e.targetWindow;if(!n)return;const i=e.options.useScrollendEvent&&Ti;let l=0;const a=i?null:yi(n,()=>o(l,!1),e.options.isScrollingResetDelay),u=g=>()=>{l=t(s),a?.(),o(l,g)},d=u(!0),h=u(!1);return s.addEventListener("scroll",d,ht),i&&s.addEventListener("scrollend",h,ht),()=>{s.removeEventListener("scroll",d),i&&s.removeEventListener("scrollend",h)}},ji=(e,o)=>wi(e,o,t=>{const{horizontal:s,isRtl:n}=e.options;return s?t.scrollLeft*(n&&-1||1):t.scrollTop}),Mi=(e,o,t)=>{if(t.options.useCachedMeasurements){const s=t.indexFromElement(e),n=t.options.getItemKey(s);return t.itemSizeCache.get(n)??t.options.estimateSize(s)}if(o?.borderBoxSize){const s=o.borderBoxSize[0];if(s)return Math.round(s[t.options.horizontal?"inlineSize":"blockSize"])}if(!o){const s=t.indexFromElement(e),n=t.options.getItemKey(s),i=t.itemSizeCache.get(n);if(i!==void 0)return i}return e[t.options.horizontal?"offsetWidth":"offsetHeight"]},Ri=(e,{adjustments:o=0,behavior:t},s)=>{var n,i;(i=(n=s.scrollElement)==null?void 0:n.scrollTo)==null||i.call(n,{[s.options.horizontal?"left":"top"]:e+o,behavior:t})},Ei=Ri;class Oi{constructor(o){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollState=null,this.measurementsCache=[],this._flatMeasurements=null,this.itemSizeCache=new Map,this.itemSizeCacheVersion=0,this.laneAssignments=new Map,this.pendingMin=null,this.prevLanes=void 0,this.lanesChangedFlag=!1,this.lanesSettling=!1,this.pendingScrollAnchor=null,this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this._iosDeferredAdjustment=0,this._iosTouching=!1,this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._intendedScrollOffset=null,this.elementsCache=new Map,this.now=()=>{var t,s,n;return((n=(s=(t=this.targetWindow)==null?void 0:t.performance)==null?void 0:s.now)==null?void 0:n.call(s))??Date.now()},this.observer=(()=>{let t=null;const s=()=>t||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:t=new this.targetWindow.ResizeObserver(n=>{n.forEach(i=>{const l=()=>{const a=i.target,u=this.indexFromElement(a);if(!a.isConnected){this.observer.unobserve(a);for(const[d,h]of this.elementsCache)if(h===a){this.elementsCache.delete(d);break}return}this.shouldMeasureDuringScroll(u)&&this.resizeItem(u,this.options.measureElement(a,i,this))};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(l):l()})}));return{disconnect:()=>{var n;(n=s())==null||n.disconnect(),t=null},observe:n=>{var i;return(i=s())==null?void 0:i.observe(n,{box:"border-box"})},unobserve:n=>{var i;return(i=s())==null?void 0:i.unobserve(n)}}})(),this.range=null,this.setOptions=t=>{var s,n;const i={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:Ci,rangeExtractor:Ii,onChange:()=>{},measureElement:Mi,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,anchorTo:"start",followOnAppend:!1,scrollEndThreshold:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,laneAssignmentMode:"estimate",useCachedMeasurements:!1};for(const m in t){const p=t[m];p!==void 0&&(i[m]=p)}const l=this.options;let a=null,u=null,d=!1;if(l!==void 0&&l.enabled&&i.enabled&&i.anchorTo==="end"&&this.scrollElement!==null){const m=l.count,p=i.count,S=this.getMeasurements(),y=m>0?((s=S[0])==null?void 0:s.key)??l.getItemKey(0):null,I=m>0?((n=S[m-1])==null?void 0:n.key)??l.getItemKey(m-1):null;if(p!==m||m>0&&p>0&&(i.getItemKey(0)!==y||i.getItemKey(p-1)!==I)){d=!0;const j=m>0?this.getVirtualItemForOffset(this.getScrollOffset())??S[0]:null;j&&(a=[j.key,this.getScrollOffset()-j.start]);const k=i.followOnAppend===!0?"auto":i.followOnAppend||null;k&&p>m&&this.isAtEnd(l.scrollEndThreshold)&&(m===0||i.getItemKey(p-1)!==I)&&(u=k)}}this.options=i,d&&(this.pendingMin=0,this.itemSizeCacheVersion++);let h=!1,g=0;if(a&&this.scrollOffset!==null){const[m,p]=a,S=this.getMeasurements(),{count:y,getItemKey:I}=this.options;let b=0;for(;b<y&&I(b)!==m;)b++;if(b<y){const x=S[b];if(x){const j=x.start+p;j!==this.scrollOffset&&(g=j-this.scrollOffset,this.scrollOffset=j,h=!0)}}}(h||u)&&(this.pendingScrollAnchor=[h?a[0]:null,h?a[1]:0,u,g])},this.notify=t=>{var s,n;(n=(s=this.options).onChange)==null||n.call(s,this,t)},this.maybeNotify=Le(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),t=>{this.notify(t)},{key:!1,debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(t=>t()),this.unsubs=[],this.observer.disconnect(),this.rafId!=null&&this.targetWindow&&(this.targetWindow.cancelAnimationFrame(this.rafId),this.rafId=null),this.scrollState=null,this._iosDeferredAdjustment=0,this._iosTouching=!1,this._iosJustTouchEnded=!1,this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var t;const s=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==s){if(this.cleanup(),!s){this.maybeNotify();return}if(this.scrollElement=s,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=((t=this.scrollElement)==null?void 0:t.window)??null,this.elementsCache.forEach(i=>{this.observer.observe(i)}),this.unsubs.push(this.options.observeElementRect(this,i=>{this.scrollRect=i,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(i,l)=>{if(l&&this._intendedScrollOffset===null&&i===this.scrollOffset)return;this._intendedScrollOffset!==null&&Math.abs(i-this._intendedScrollOffset)<1.5&&(i=this._intendedScrollOffset),this._intendedScrollOffset=null,this.scrollAdjustments=0;const a=this.getScrollOffset();this.scrollDirection=l?a===i?this.scrollDirection:a<i?"forward":"backward":null,this.scrollOffset=i,this.isScrolling=l,this._flushIosDeferredIfReady(),this.scrollState&&this.scheduleScrollReconcile(),this.maybeNotify()})),"addEventListener"in this.scrollElement){const i=this.scrollElement,l=()=>{this._iosTouching=!0,this._iosJustTouchEnded=!1,this._iosTouchEndTimerId!==null&&this.targetWindow!=null&&(this.targetWindow.clearTimeout(this._iosTouchEndTimerId),this._iosTouchEndTimerId=null)},a=()=>{this._iosTouching=!1,!(!kt()||this.targetWindow==null)&&(this._iosJustTouchEnded=!0,this._iosTouchEndTimerId=this.targetWindow.setTimeout(()=>{this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._flushIosDeferredIfReady()},150))};i.addEventListener("touchstart",l,ht),i.addEventListener("touchend",a,ht),this.unsubs.push(()=>{i.removeEventListener("touchstart",l),i.removeEventListener("touchend",a),this._iosTouchEndTimerId!==null&&this.targetWindow!=null&&(this.targetWindow.clearTimeout(this._iosTouchEndTimerId),this._iosTouchEndTimerId=null)})}this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})}const n=this.pendingScrollAnchor;if(this.pendingScrollAnchor=null,n&&this.scrollElement&&this.options.enabled){const[i,l,a,u]=n;i!==null&&!a&&(kt()&&(this.isScrolling||this._iosTouching||this._iosJustTouchEnded)?u!==0&&(this._iosDeferredAdjustment+=u):this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})),a&&this.scrollToEnd({behavior:a})}},this._flushIosDeferredIfReady=()=>{if(this._iosDeferredAdjustment===0||this.isScrolling||this._iosTouching||this._iosJustTouchEnded)return;const t=this.getScrollOffset(),s=this.getMaxScrollOffset();if(t<0||t>s)return;const n=this._iosDeferredAdjustment;this._iosDeferredAdjustment=0,this._scrollToOffset(t,{adjustments:this.scrollAdjustments+=n,behavior:void 0})},this.rafId=null,this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset=="function"?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getMeasurementOptions=Le(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled,this.options.lanes,this.options.laneAssignmentMode,this.options.gap],(t,s,n,i,l,a,u,d)=>(this.prevLanes!==void 0&&this.prevLanes!==a&&(this.lanesChangedFlag=!0),this.prevLanes=a,this.pendingMin=null,{count:t,paddingStart:s,scrollMargin:n,getItemKey:i,enabled:l,lanes:a,laneAssignmentMode:u,gap:d}),{key:!1}),this.getMeasurements=Le(()=>[this.getMeasurementOptions(),this.itemSizeCacheVersion],({count:t,paddingStart:s,scrollMargin:n,getItemKey:i,enabled:l,lanes:a,laneAssignmentMode:u,gap:d},h)=>{const g=this.itemSizeCache;if(!l)return this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),[];if(this.laneAssignments.size>t)for(const b of this.laneAssignments.keys())b>=t&&this.laneAssignments.delete(b);this.lanesChangedFlag&&(this.lanesChangedFlag=!1,this.lanesSettling=!0,this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),this.pendingMin=null),this.measurementsCache.length===0&&!this.lanesSettling&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(b=>{this.itemSizeCache.set(b.key,b.size)}));const m=this.lanesSettling?0:this.pendingMin??0;if(this.pendingMin=null,this.lanesSettling&&this.measurementsCache.length===t&&(this.lanesSettling=!1),a===1){const b=t*2;let x=this._flatMeasurements;if(!x||x.length<b){const w=new Float64Array(b);x&&m>0&&w.set(x.subarray(0,m*2)),x=w,this._flatMeasurements=x}let j;if(m===0)j=s+n;else{const w=m-1;j=x[w*2]+x[w*2+1]+d}for(let w=m;w<t;w++){const O=i(w),A=g.get(O),B=typeof A=="number"?A:this.options.estimateSize(w);x[w*2]=j,x[w*2+1]=B,j+=B+d}const k=vi(t,x,i);return this.measurementsCache=k,k}const p=this.measurementsCache.slice(0,m),S=new Array(a).fill(void 0),y=new Float64Array(a);let I=0;for(let b=0;b<m;b++){const x=p[b];x&&(S[x.lane]===void 0&&I++,S[x.lane]=b,y[x.lane]=x.end)}for(let b=m;b<t;b++){const x=i(b),j=this.laneAssignments.get(b);let k,w;const O=u==="estimate"||g.has(x);if(j!==void 0&&this.options.lanes>1){k=j;const G=S[k],R=G!==void 0?p[G]:void 0;w=R?R.end+d:s+n}else if(I===a){let G=0,R=y[0],oe=S[0];for(let F=1;F<a;F++){const P=y[F];(P<R||P===R&&S[F]<oe)&&(G=F,R=P,oe=S[F])}k=G,w=R+d,O&&this.laneAssignments.set(b,k)}else k=b%this.options.lanes,w=s+n,O&&this.laneAssignments.set(b,k);const A=g.get(x),B=typeof A=="number"?A:this.options.estimateSize(b),J=w+B;p[b]={index:b,start:w,size:B,end:J,key:x,lane:k},S[k]===void 0&&I++,S[k]=b,y[k]=J}return this.measurementsCache=p,p},{key:!1,debug:()=>this.options.debug}),this.calculateRange=Le(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(t,s,n,i)=>t.length===0||s===0?(this.range=null,null):(this.range=Ni(t,s,n,i,i===1&&this._flatMeasurements!=null?this._flatMeasurements:null),this.range),{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=Le(()=>{let t=null,s=null;const n=this.calculateRange();return n&&(t=n.startIndex,s=n.endIndex),this.maybeNotify.updateDeps([this.isScrolling,t,s]),[this.options.rangeExtractor,this.options.overscan,this.options.count,t,s]},(t,s,n,i,l)=>i===null||l===null?[]:t({startIndex:i,endIndex:l,overscan:s,count:n}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=t=>{const s=this.options.indexAttribute,n=t.getAttribute(s);return n?parseInt(n,10):(console.warn(`Missing attribute name '${s}={index}' on measured element.`),-1)},this.shouldMeasureDuringScroll=t=>{var s;if(!this.scrollState||this.scrollState.behavior!=="smooth")return!0;const n=this.scrollState.index??((s=this.getVirtualItemForOffset(this.scrollState.lastTargetOffset))==null?void 0:s.index);if(n!==void 0&&this.range){const i=Math.max(this.options.overscan,Math.ceil((this.range.endIndex-this.range.startIndex)/2)),l=Math.max(0,n-i),a=Math.min(this.options.count-1,n+i);return t>=l&&t<=a}return!0},this.measureElement=t=>{if(!t){this.elementsCache.forEach((l,a)=>{l.isConnected||(this.observer.unobserve(l),this.elementsCache.delete(a))});return}const s=this.indexFromElement(t),n=this.options.getItemKey(s),i=this.elementsCache.get(n);i!==t&&(i&&this.observer.unobserve(i),this.observer.observe(t),this.elementsCache.set(n,t)),(!this.isScrolling||this.scrollState)&&this.shouldMeasureDuringScroll(s)&&this.resizeItem(s,this.options.measureElement(t,void 0,this))},this.resizeItem=(t,s)=>{var n,i;if(t<0||t>=this.options.count)return;let l,a,u;const d=this._flatMeasurements;if(this.options.lanes===1&&d!==null)u=this.options.getItemKey(t),a=d[t*2],l=d[t*2+1];else{const m=this.measurementsCache[t];if(!m)return;u=m.key,a=m.start,l=m.size}const h=this.itemSizeCache.get(u)??l,g=s-h;if(g!==0){const m=this.options.anchorTo==="end"&&((n=this.scrollState)==null?void 0:n.behavior)!=="smooth"&&this.getVirtualDistanceFromEnd()<=this.options.scrollEndThreshold,p=m?this.getTotalSize():0,S=((i=this.scrollState)==null?void 0:i.behavior)!=="smooth"&&(this.shouldAdjustScrollPositionOnItemSizeChange!==void 0?this.shouldAdjustScrollPositionOnItemSizeChange(this.measurementsCache[t]??{index:t,key:u,start:a,size:l,end:a+l,lane:0},g,this):a<this.getScrollOffset()+this.scrollAdjustments&&(!this.itemSizeCache.has(u)||this.scrollDirection!=="backward"));(this.pendingMin===null||t<this.pendingMin)&&(this.pendingMin=t),this.itemSizeCache.set(u,s),this.itemSizeCacheVersion++,m?this.applyScrollAdjustment(this.getTotalSize()-p):S&&this.applyScrollAdjustment(g),this.notify(!1)}},this.getVirtualItems=Le(()=>[this.getVirtualIndexes(),this.getMeasurements()],(t,s)=>{const n=[];for(let i=0,l=t.length;i<l;i++){const a=t[i],u=s[a];n.push(u)}return n},{key:!1,debug:()=>this.options.debug}),this.getVirtualItemForOffset=t=>{const s=this.getMeasurements();if(s.length===0)return;const n=this._flatMeasurements,i=this.options.lanes===1&&n!=null,l=cs(0,s.length-1,i?a=>n[a*2]:a=>$t(s[a]).start,t);return $t(s[l])},this.getMaxScrollOffset=()=>{if(!this.scrollElement)return 0;if("scrollHeight"in this.scrollElement)return this.options.horizontal?this.scrollElement.scrollWidth-this.scrollElement.clientWidth:this.scrollElement.scrollHeight-this.scrollElement.clientHeight;{const t=this.scrollElement.document.documentElement;return this.options.horizontal?t.scrollWidth-this.scrollElement.innerWidth:t.scrollHeight-this.scrollElement.innerHeight}},this.getVirtualDistanceFromEnd=()=>Math.max(this.getTotalSize()-this.getSize()-this.getScrollOffset(),0),this.getDistanceFromEnd=()=>Math.max(this.getMaxScrollOffset()-this.getScrollOffset(),0),this.isAtEnd=(t=this.options.scrollEndThreshold)=>this.getDistanceFromEnd()<=t,this.getOffsetForAlignment=(t,s,n=0)=>{if(!this.scrollElement)return 0;const i=this.getSize(),l=this.getScrollOffset();s==="auto"&&(s=t>=l+i?"end":"start"),s==="center"?t+=(n-i)/2:s==="end"&&(t-=i);const a=this.getMaxScrollOffset();return Math.max(Math.min(a,t),0)},this.getOffsetForIndex=(t,s="auto")=>{t=Math.max(0,Math.min(t,this.options.count-1));const n=this.getSize(),i=this.getScrollOffset(),l=this.measurementsCache[t];if(!l)return;if(s==="auto")if(l.end>=i+n-this.options.scrollPaddingEnd)s="end";else if(l.start<=i+this.options.scrollPaddingStart)s="start";else return[i,s];if(s==="end"&&t===this.options.count-1)return[this.getMaxScrollOffset(),s];const a=s==="end"?l.end+this.options.scrollPaddingEnd:l.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(a,s,l.size),s]},this.scrollToOffset=(t,{align:s="start",behavior:n="auto"}={})=>{const i=this.getOffsetForAlignment(t,s),l=this.now();this.scrollState={index:null,align:s,behavior:n,startedAt:l,lastTargetOffset:i,stableFrames:0},this._scrollToOffset(i,{adjustments:void 0,behavior:n}),this.scheduleScrollReconcile()},this.scrollToIndex=(t,{align:s="auto",behavior:n="auto"}={})=>{t=Math.max(0,Math.min(t,this.options.count-1));const i=this.getOffsetForIndex(t,s);if(!i)return;const[l,a]=i,u=this.now();this.scrollState={index:t,align:a,behavior:n,startedAt:u,lastTargetOffset:l,stableFrames:0},this._scrollToOffset(l,{adjustments:void 0,behavior:n}),this.scheduleScrollReconcile()},this.scrollBy=(t,{behavior:s="auto"}={})=>{const n=this.getScrollOffset()+t,i=this.now();this.scrollState={index:null,align:"start",behavior:s,startedAt:i,lastTargetOffset:n,stableFrames:0},this._scrollToOffset(n,{adjustments:void 0,behavior:s}),this.scheduleScrollReconcile()},this.scrollToEnd=({behavior:t="auto"}={})=>{if(this.options.count>0){this.scrollToIndex(this.options.count-1,{align:"end",behavior:t});return}this.scrollToOffset(Math.max(this.getTotalSize()-this.getSize(),0),{behavior:t})},this.getTotalSize=()=>{var t;const s=this.getMeasurements();let n;if(s.length===0)n=this.options.paddingStart;else if(this.options.lanes===1){const i=s.length-1,l=this._flatMeasurements;l!=null?n=l[i*2]+l[i*2+1]:n=((t=s[i])==null?void 0:t.end)??0}else{const i=Array(this.options.lanes).fill(null);let l=s.length-1;for(;l>=0&&i.some(a=>a===null);){const a=s[l];i[a.lane]===null&&(i[a.lane]=a.end),l--}n=Math.max(...i.filter(a=>a!==null))}return Math.max(n-this.options.scrollMargin+this.options.paddingEnd,0)},this.takeSnapshot=()=>{const t=[];if(this.itemSizeCache.size===0)return t;const s=this.getMeasurements();for(const n of s)n&&this.itemSizeCache.has(n.key)&&t.push({index:n.index,key:n.key,start:n.start,size:n.size,end:n.end,lane:n.lane});return t},this._scrollToOffset=(t,{adjustments:s,behavior:n})=>{this._intendedScrollOffset=t+(s??0),this.options.scrollToFn(t,{behavior:n,adjustments:s},this)},this.measure=()=>{this.pendingMin=null,this.itemSizeCache.clear(),this.laneAssignments.clear(),this.itemSizeCacheVersion++,this.notify(!1)},this.setOptions(o)}applyScrollAdjustment(o,t){o!==0&&(kt()&&(this.isScrolling||this._iosTouching||this._iosJustTouchEnded)?this._iosDeferredAdjustment+=o:(this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=o,behavior:t}),this.scrollOffset!==null&&(this.scrollOffset+=this.scrollAdjustments,this.scrollAdjustments=0)))}scheduleScrollReconcile(){if(!this.targetWindow){this.scrollState=null;return}this.rafId==null&&(this.rafId=this.targetWindow.requestAnimationFrame(()=>{this.rafId=null,this.reconcileScroll()}))}reconcileScroll(){if(!this.scrollState||!this.scrollElement)return;if(this.now()-this.scrollState.startedAt>5e3){this.scrollState=null;return}const s=this.scrollState.index!=null?this.getOffsetForIndex(this.scrollState.index,this.scrollState.align):void 0,n=s?s[0]:this.scrollState.lastTargetOffset,i=1,l=n!==this.scrollState.lastTargetOffset;if(!l&&Si(n,this.getScrollOffset())){if(this.scrollState.stableFrames++,this.scrollState.stableFrames>=i){this.getScrollOffset()!==n&&this._scrollToOffset(n,{adjustments:void 0,behavior:"auto"}),this.scrollState=null;return}}else if(this.scrollState.stableFrames=0,l){const a=this.getSize()||600,u=Math.abs(n-this.getScrollOffset()),d=this.scrollState.behavior==="smooth"&&u>a;this.scrollState.lastTargetOffset=n,d||(this.scrollState.behavior="auto"),this._scrollToOffset(n,{adjustments:void 0,behavior:d?"smooth":"auto"})}this.scheduleScrollReconcile()}}const cs=(e,o,t,s)=>{for(;e<=o;){const n=(e+o)/2|0,i=t(n);if(i<s)e=n+1;else if(i>s)o=n-1;else return n}return e>0?e-1:0};function Ai(e,o,t){let s=0;for(;s<=o;){const n=(s+o)/2|0,i=e[n*2];if(i<t)s=n+1;else if(i>t)o=n-1;else return n}return s>0?s-1:0}function Ni(e,o,t,s,n){const i=e.length-1;if(e.length<=s)return{startIndex:0,endIndex:i};if(s===1&&n!==null){const d=Ai(n,i,t);let h=d;const g=t+o;for(;h<i&&n[h*2]+n[h*2+1]<g;)h++;return{startIndex:d,endIndex:h}}let a=cs(0,i,d=>e[d].start,t),u=a;if(s===1)for(;u<i&&e[u].end<t+o;)u++;else if(s>1){const d=Array(s).fill(0);for(;u<i&&d.some(g=>g<t+o);){const g=e[u];d[g.lane]=g.end,u++}const h=Array(s).fill(t+o);for(;a>=0&&h.some(g=>g>=t);){const g=e[a];h[g.lane]=g.start,a--}a=Math.max(0,a-a%s),u=Math.min(i,u+(s-1-u%s))}return{startIndex:a,endIndex:u}}const Tt=typeof document<"u"?c.useLayoutEffect:c.useEffect;function zi({useFlushSync:e=!0,directDomUpdates:o=!1,directDomUpdatesMode:t="transform",...s}){const n=c.useReducer(d=>d+1,0)[1],i=c.useRef({enabled:o,mode:t,container:null,lastSize:null,lastPositions:new WeakMap,prevRange:null});i.current.enabled=o,i.current.mode=t;const l=d=>{const h=i.current;if(!h.enabled||!h.container)return;const g=d.getTotalSize();if(g!==h.lastSize){h.lastSize=g;const b=d.options.horizontal?"width":"height";h.container.style[b]=`${g}px`}const m=!!d.options.horizontal,p=h.mode==="transform",S=m?"left":"top",y=d.options.scrollMargin,I=d.getVirtualItems();for(const b of I){const x=b.start-y,j=d.elementsCache.get(b.key);j&&h.lastPositions.get(j)!==x&&(h.lastPositions.set(j,x),p?j.style.transform=m?`translate3d(${x}px, 0, 0)`:`translate3d(0, ${x}px, 0)`:j.style[S]=`${x}px`)}},a={...s,onChange:(d,h)=>{var g;const m=i.current;let p=!0;if(m.enabled){l(d);const S=d.range,y=m.prevRange;p=!y||y.isScrolling!==d.isScrolling||y.startIndex!==S?.startIndex||y.endIndex!==S?.endIndex,p&&(m.prevRange=S?{startIndex:S.startIndex,endIndex:S.endIndex,isScrolling:d.isScrolling}:null)}p&&(e&&h?$s.flushSync(n):n()),(g=s.onChange)==null||g.call(s,d,h)}},[u]=c.useState(()=>{const d=new Oi(a);return Object.assign(d,{containerRef:h=>{const g=i.current;if(g.container=h,g.lastSize=null,h&&g.enabled){const m=d.getTotalSize();g.lastSize=m;const p=d.options.horizontal?"width":"height";h.style[p]=`${m}px`}}})});return u.setOptions(a),Tt(()=>u._didMount(),[]),Tt(()=>u._willUpdate()),Tt(()=>{l(u)}),u}function Fi(e){return zi({observeElementRect:ki,observeElementOffset:ji,scrollToFn:Ei,...e})}const Nt=e=>e.query?`matching "${e.query}"`:e.from?`from "${e.from}"`:"matching your search",Di=e=>`Select all ${Nt(e)}`,_i=(e,o)=>`All ${Vt(o)} ${Nt(e)} selected`,Li=({verb:e,confirmingDelete:o,hasSelection:t,junkMailboxId:s,currentMailboxId:n,deletableMessageId:i})=>{if(o)return{kind:"withheld"};if(e==="junk"){const l=yn(s,n);if(l!==void 0)return{kind:"unavailable",reason:l}}return t?{kind:"openWizard"}:e!=="delete"||i===void 0?{kind:"declined"}:{kind:"confirmDelete",messageId:i}},Pi=(e,o,t)=>e==="BACK"&&o&&t===void 0,$i=(e,o)=>({id:e.messageId,accountId:e.accountId,mailboxId:e.mailboxId,threadId:e.threadId,fromName:e.fromName??e.fromEmail??"Unknown",fromEmail:e.fromEmail??"",subject:e.subject??"(No subject)",snippet:e.snippet??"",timeLabel:Ge(e.sentDate),isRead:e.isRead,hasAttachment:e.hasAttachment,starred:e.hasStars===!0,trust:e.senderTrust,category:Xt(e.category),messageCount:o,suspicious:e.authenticity?.dkimMismatch===!0,labels:e.labels,...Et(e)}),Bi=({thread:e,mailboxId:o,isSelected:t,isFocused:s,isTabStop:n,onFocusRow:i,isChecked:l,onToggleCheck:a,onRowSelect:u,messageCount:d,isMultiSelectMode:h,onLongPress:g,isDesktop:m,density:p})=>r.jsx(Cn,{thread:$i(e,d),link:{mailboxId:o,threadId:e.threadId},inListbox:!0,active:t,focused:s,isTabStop:n,density:p,isDesktop:m,onFocusRow:i,selection:{isChecked:l,onToggleCheck:a,onRowSelect:u,isMultiSelectMode:h,onLongPress:g}}),Wi=c.memo(Bi),Ki=e=>{const o=e.authenticity?.dkimMismatch===!0;return{id:e.messageId,accountId:e.accountId,fromName:e.fromName??e.fromEmail??"Unknown",fromEmail:e.fromEmail??"",subject:e.subject??"(No subject)",snippet:e.snippet??"",timeLabel:Ge(e.sentDate),isRead:e.isRead,hasAttachment:e.hasAttachment,starred:e.hasStars===!0,trust:e.senderTrust,category:Xt(e.category),suspicious:o,...Et(e)}},Vi=({thread:e,mailboxId:o,isSelected:t,isFocused:s,isTabStop:n,onFocusRow:i,isChecked:l,onToggleCheck:a,onRowSelect:u,isMultiSelectMode:d,onLongPress:h,isDesktop:g,onDelete:m,onToggleRead:p,density:S})=>{const[y,I]=c.useState("none"),b=Ye(),x=c.useCallback(A=>{navigator.vibrate?.(10),A==="trailing"?m(e.messageId):p(e.messageId,e.isRead),I("none")},[m,p,e.messageId,e.isRead]),j=c.useCallback(()=>{h(e.messageId)},[h,e.messageId]),k=c.useCallback(()=>{a(e.messageId)},[a,e.messageId]),w=c.useCallback(()=>{b({threadId:e.threadId,messageId:e.messageId})},[b,e.threadId,e.messageId]),O=In(e.messageId,u);return g||d?r.jsx(Wi,{thread:e,mailboxId:o,isSelected:t,isFocused:s,isTabStop:n,onFocusRow:i,isChecked:l,onToggleCheck:a,onRowSelect:u,isMultiSelectMode:d,onLongPress:h,isDesktop:g,density:S}):r.jsx("div",{role:"presentation",onPointerDownCapture:O.onMouseDown,onClickCapture:O.claimClick,onContextMenu:O.onContextMenu,children:r.jsx(xo,{thread:Ki(e),selectionMode:!1,checked:!1,active:t,peek:y,onPeek:I,onToggleCheck:k,onLongPress:j,onOpen:w,onAct:x})})},qi=72,Hi=32,Qi=5,us="remit:list-density",Ui=()=>{try{const e=localStorage.getItem(us);if(e==="compact"||e==="comfortable")return e}catch{}return"comfortable"},Ji=(e,o,t)=>Do(e.filter(s=>o.has(s.messageId)).map(s=>s.accountId??t)).moveDisabledHint,Gi=({mailboxId:e,threads:o,selectedMessageId:t,isLoading:s,isError:n=!1,error:i,onRetry:l,searchQuery:a,searchPredicate:u,resultCount:d={kind:"unknown"},onDeleteMessages:h,isDeleting:g=!1,isMoving:m=!1,onLoadMore:p,hasMore:S=!1,isLoadingMore:y=!1,accountId:I,listTitle:b,listMeta:x,listFilter:j,listSearchText:k,listScopeLabel:w,onTriageContextChange:O,commandsRef:A,hideHeader:B=!1})=>{const J=c.useRef(null),G=Ye(),R=Bs(),oe=Ws(),{verb:F,start:P,startFromSearch:Ee}=oe,Se=Ks(),ye=!!a?.trim(),W=kn(),{labels:Pe}=zo(I),{pushError:ie}=qt(),[M,Ce]=c.useState(t),[Oe,Ie]=c.useState(),N=c.useCallback(f=>{Ie(v=>v===f?v:void 0),Ce(f)},[]),[Z,$e]=c.useState(Ui),K=c.useCallback(()=>{$e(f=>{const v=f==="comfortable"?"compact":"comfortable";try{localStorage.setItem(us,v)}catch{}return v})},[]),{toggleReadFor:ke}=Zt({mailboxId:e}),{junkMailboxId:fe}=es(I),me=ts(fe,e),Ae=c.useMemo(()=>[{accountId:I,mailboxId:e}],[I,e]),{outcome:re,staleFolderLabel:Be,guessedMailboxId:Ne}=Tn(Ae),{selectedIds:z,selectedCount:_,hasSelection:ne,isSelected:ee,toggle:Y,select:Te,clearSelection:we,selectRange:ge,setAnchor:V,selectAll:pe,toggleAll:te,intersectWith:Xe}=wn(),We=Fn(_,R),[xe,E]=c.useState(null),Ze=c.useCallback((f,v,he)=>{const Q=Vs(f,v,he,re);Q&&ie(Q)},[ie,re]),je=ye&&!!u,et=`${e}|${JSON.stringify(u??{})}`,T=jn({mailboxId:e,mailboxLabel:b,accountId:I,enabled:je,predicateKey:et,searchQuery:u??{},reportEnding:Ze}),tt=T.phase.kind,Ke=T.clear,L=c.useCallback(()=>{tt==="escalated"&&Ke(),we()},[we,Ke,tt]),[st,ae]=c.useState(null),be=c.useRef(null),le=c.useRef(!1),ze=c.useRef(null),Me=!s&&o.length>0,ce=Fi({count:o.length,getScrollElement:()=>J.current,estimateSize:()=>Z==="compact"?Hi:qi,overscan:Qi}),Ve=t?o.findIndex(f=>f.messageId===t):-1,q=M?o.findIndex(f=>f.messageId===M):-1,se=c.useCallback(f=>{if(f<0||f>=o.length)return;const v=o[f];if(We){Y(v.messageId);return}be.current=v.messageId,le.current=!1,Ie(v.messageId),Ce(v.messageId)},[o,We,Y]),Fe=c.useCallback(()=>{if(o.length===0)return;const f=q<0?0:Math.min(q+1,o.length-1);se(f)},[o.length,q,se]),nt=c.useCallback(()=>{if(o.length===0)return;const f=q<=0?0:q-1;se(f)},[o.length,q,se]),qe=c.useCallback(()=>se(0),[se]),He=c.useCallback(()=>se(o.length-1),[se,o.length]),ve=c.useCallback(()=>{M&&Y(M)},[M,Y]),D=c.useMemo(()=>o.map(f=>f.messageId),[o]),De=c.useMemo(()=>{const f=[];for(const v of o)z.has(v.messageId)&&f.push({id:v.messageId,sender:v.fromName??v.fromEmail??"Unknown",email:v.fromEmail??"",subject:v.subject??"(No subject)",date:Ge(v.sentDate),accountId:I});return f},[o,z,I]),xt=c.useCallback((f,v)=>v.shiftKey?(ge(D,f,M),!0):v.metaKey||v.ctrlKey?(Y(f),!0):(L(),V(f),!1),[D,M,ge,Y,L,V]),ot=c.useCallback(f=>{!h||f.length===0||(ze.current=M??null,E(f))},[h,M]),_e=c.useCallback(f=>{const v=Mn(D,M,f);v!==void 0&&(ge(D,v),be.current=v,le.current=!1,Ie(void 0),Ce(v))},[D,M,ge]),ue=c.useCallback(()=>_e(-1),[_e]),it=c.useCallback(()=>_e(1),[_e]),rt=c.useCallback(()=>{D.length>0&&pe(D)},[D,pe]),at=c.useCallback(f=>{const v=Li({verb:f,confirmingDelete:xe!==null,hasSelection:ne,junkMailboxId:fe,currentMailboxId:e,deletableMessageId:h?M:void 0});return v.kind==="openWizard"?(P(f),!0):v.kind==="confirmDelete"?(ot([v.messageId]),!0):v.kind==="unavailable"?(ie({severity:"warning",title:v.reason}),!0):v.kind==="withheld"},[xe,h,ne,fe,e,P,M,ot,ie]),de=c.useCallback((f,v)=>{const he=o.find(Q=>Q.messageId===f)?.threadId;he&&G({threadId:he,messageId:f},{replace:v?.replace})},[G,o]),lt=c.useCallback(()=>{M&&de(M)},[M,de]),bt=c.useCallback(f=>de(f,{replace:!0}),[de]);Rn({keyboardFocusedMessageId:Oe,openMessageId:t,enabled:R&&_===0,open:bt});const Qe=T.phase.kind==="escalated"?{scope:Nt(u??{}),total:T.phase.total,searchQuery:u??{},run:(f,v)=>T.runAction(f,void 0,v),stop:T.stop}:void 0,ct=c.useCallback(f=>{if(f.length===0){E(null);return}const v=new Set(f),he=o.findIndex(U=>v.has(U.messageId));let Q;for(let U=he+1;U<o.length;U++)if(!v.has(o[U].messageId)){Q=o[U].messageId;break}if(Q===void 0){for(let U=he-1;U>=0;U--)if(!v.has(o[U].messageId)){Q=o[U].messageId;break}}h?.(f),L(),ze.current=null,E(null),Q!==void 0&&(be.current=Q,le.current=!1,N(Q),R&&de(Q,{replace:!0})),R||ae(qs("delete",f.length,re))},[o,h,L,de,R,N,re]),ut=c.useCallback(()=>{const f=ze.current;ze.current=null,E(null),f!==null&&(be.current=f,le.current=!1,N(f))},[N]),Ue=c.useMemo(()=>Ji(o,z,I),[I,z,o]),vt=c.useCallback(()=>{if(Qe){Ee();return}P("organize")},[Qe,Ee,P]),St=c.useCallback(f=>{h?.([f])},[h]),dt=c.useCallback((f,v)=>{ke([f],!v)},[ke]),yt=c.useCallback(f=>{R||Te(f)},[R,Te]),C=c.useCallback(()=>{if(T.isRunning||T.phase.kind==="counting"){T.stop();return}L()},[T,L]),H=c.useCallback(()=>{T.clear()},[T]);c.useEffect(()=>{if(le.current||!R&&t)return;const f=q>=0?q:Ve;f>=0&&ce.scrollToIndex(f,{align:"auto"})},[q,Ve,ce,R,t]),c.useEffect(()=>{t&&(le.current=!1,N(t))},[t,N]),c.useEffect(()=>{M&&(o.some(f=>f.messageId===M)||N(o[0]?.messageId))},[o,M,N]),c.useEffect(()=>{O?.({focusedMessageId:M,selectedIds:Array.from(z),hasList:Me})},[M,z,Me,O]);const $=c.useRef(O);$.current=O,c.useEffect(()=>()=>$.current?.({focusedMessageId:void 0,selectedIds:[],hasList:!1}),[]),c.useEffect(()=>{T.phase.kind!=="idle"||T.isRunning||Xe(o.map(f=>f.messageId))},[o,Xe,T.phase,T.isRunning]);const zt=c.useRef(e);c.useEffect(()=>{zt.current!==e&&(zt.current=e,L())},[e,L]),En({shouldBlockFn:({action:f})=>Pi(f,ne,Se)?(L(),!0):!1,enableBeforeUnload:!1,disabled:!ne||Se!==void 0}),c.useEffect(()=>{const f=J.current;if(!f||!S||!p)return;const v=()=>{if(y)return;const{scrollTop:he,scrollHeight:Q,clientHeight:U}=f;he+U>=Q-200&&p()};return f.addEventListener("scroll",v,{passive:!0}),v(),()=>f.removeEventListener("scroll",v)},[S,y,p]),c.useEffect(()=>{const f=be.current;if(!f)return;const v=J.current?.querySelector(`[data-message-id="${f}"]`);v&&(be.current=null,v.focus({preventScroll:!0}))}),c.useEffect(()=>{if(A){if(!Me){A.current=null;return}return A.current={focusNext:Fe,focusPrevious:nt,focusFirst:qe,focusLast:He,openFocused:lt,toggleSelect:ve,extendSelectDown:it,extendSelectUp:ue,selectAll:rt,clearSelection:()=>ne?(L(),!0):!1,requestVerb:at,toggleDensity:K},()=>{A.current=null}}},[A,Me,Fe,nt,qe,He,lt,ve,it,ue,rt,ne,L,at,K]);const Ft=s?"loading":n?"error":o.length===0?"empty":"ready",fs=n?No(i):void 0,ms=c.useCallback(()=>{const f=Hs(Qs());window.open(f,"_blank","noopener,noreferrer")},[]),gs=[{id:"inbox",threads:[]}],Ct=D.length>0&&D.every(f=>z.has(f)),ps=je&&S&&Ct&&!g&&!m&&T.phase.kind==="idle"&&!T.isRunning,xs=g||m||T.isRunning,It=T.phase.kind==="escalated"?T.phase.total:T.progress?T.progress.total:_,bs=T.runningAction?Us(T.runningAction.kind,T.progress?.done??0,T.progress?.total??It):T.phase.kind==="counting"?"Counting matches…":T.phase.kind==="escalated"?_i(u??{},T.phase.total):void 0,vs=T.phase.kind!=="escalated"&&D.length>0?{checked:Ct,indeterminate:_>0&&!Ct,onChange:()=>te(D)}:void 0,Ss=T.runningAction?{value:T.progress?.done??0,max:T.progress?.total??It,tone:Js(T.runningAction.kind)}:void 0,ys=(T.isRunning||T.phase.kind==="counting"?{tone:"info",text:"",action:{label:"Stop",onClick:T.stop}}:T.phase.kind==="escalated"?{tone:"info",text:"",action:{label:"Clear selection",onClick:H}}:ps?{tone:"info",text:"",action:{label:Di(u??{}),onClick:T.escalate}}:void 0)??(Ue?{tone:"warning",text:Ue}:void 0),Cs=r.jsx(On,{title:W.title||b,navSlot:W.navSlot,titleMeta:W.titleMeta,searchSlot:W.searchSlot,searchField:W.searchField,idleSlot:W.makeFilterSlot,count:It,onCancel:C,onDelete:()=>P("delete"),onMove:()=>P("move"),onOrganize:vt,onJunk:me?()=>P("junk"):void 0,onMarkRead:()=>P("markRead"),overflowSlot:I&&e&&_>0&&Pe.length>0?r.jsx(Fo,{accountId:I,mailboxId:e,messageIds:Array.from(z)}):void 0,isBusy:xs,isCounting:T.phase.kind==="counting",selectAll:vs,statusLabel:bs,progress:Ss,notice:ys}),Is=An(D,M),ks=c.useCallback(f=>{le.current=!0,N(f)},[N]),Ts=r.jsxs(r.Fragment,{children:[ye&&a&&r.jsx(Uo,{query:a,count:d}),r.jsxs("div",{ref:J,role:"listbox","aria-multiselectable":!0,"aria-label":b,className:"flex-1 overflow-y-auto",children:[r.jsx("div",{role:"presentation",className:"relative w-full",style:{height:`${ce.getTotalSize()}px`},children:ce.getVirtualItems().map(f=>{const v=o[f.index];return r.jsx("div",{role:"presentation","data-index":f.index,ref:ce.measureElement,className:Re("absolute left-0 top-0 w-full border-b border-line",T.isRunning&&"pointer-events-none opacity-50"),style:{transform:`translateY(${f.start}px)`},children:r.jsx(Vi,{thread:v,mailboxId:e,isSelected:t===v.messageId,isFocused:M===v.messageId,isTabStop:Is===v.messageId,onFocusRow:ks,isChecked:ee(v.messageId),onToggleCheck:Y,onRowSelect:xt,isMultiSelectMode:We,onLongPress:yt,isDesktop:R,onDelete:St,onToggleRead:dt,density:Z})},f.key)})}),y&&r.jsx(bo,{})]})]});return r.jsxs(r.Fragment,{children:[st&&!R&&r.jsx(ft,{tone:"success",variant:"soft",className:"m-2 rounded-md",onDismiss:()=>ae(null),children:st}),r.jsx(vo,{listTitle:b,listMeta:x,sections:gs,flatList:!0,listState:W.searchResults?"ready":Ft,searchQuery:k,listFilter:j,listScopeLabel:w,errorMessage:fs,onRetry:l,onReportError:ms,density:Z,selectedThreadId:t,onSelectThread:f=>de(f),isDesktop:R,hideHeader:B,selectionBar:Cs,listBody:W.searchResults??(Ft==="ready"?Ts:void 0)}),r.jsx(Nn,{isOpen:xe!==null,messageIds:xe??[],outcome:re,accountId:I,trashFolderLabel:b,staleFolderLabel:Be,guessedMailboxId:Ne,isDeleting:g,onConfirm:ct,onCancel:ut}),r.jsx(zn,{verb:F,accountId:I,mailboxId:e,mailboxLabel:b,selection:De,selectionRestriction:Ue?"spansAccounts":void 0,escalated:Qe,escalatedProgress:T.progress,onFinished:L,onRunEnded:Ze})]})},Yi=e=>Ht({path:{accountId:e}}),Xi=e=>{const o=jt(),t=Rt(),s=Mt({...Gs(),onSuccess:()=>{t.recordEvent("sync.triggered"),o.invalidateQueries({queryKey:Yi(e)})}});return{trigger:()=>{s.mutate({path:{accountId:e}})},triggerAsync:()=>s.mutateAsync({path:{accountId:e}}),isPending:s.isPending,error:s.error,reset:s.reset}},Zi=({accountId:e,children:o})=>{const{triggerAsync:t,isPending:s}=Xi(e);return r.jsx(Jo,{onRefresh:t,isRefreshing:s,children:o})};function er({accountId:e,currentMailboxId:o,candidates:t,onMove:s,children:n}){const[i,l]=c.useState(!1),a=Rt(),u=Ys(),{inboxMailboxId:d}=Dn(e),h=_n(e),{data:g}=mt({...Xs({path:{accountId:e}}),staleTime:1/0}),m=c.useMemo(()=>Zs({mailboxes:g?.items??[],folderAppointments:h,currentMailboxId:o,translator:u}),[g?.items,h,o,u]),p=c.useMemo(()=>d||(m.find(x=>x.label.toLowerCase()==="inbox")?.id??m.find(x=>!x.isCurrent)?.id??""),[d,m]),S=c.useRef(!1);c.useEffect(()=>{S.current||(S.current=!0,Ln(a,t.length))},[a,t.length]);const y=c.useCallback(()=>{Pn(a,t.length),l(!0)},[a,t.length]),I=c.useCallback((b,x)=>{$n(a,{selected:b.length,total:t.length,toInbox:x===d}),s(b,x)},[a,t.length,d,s]);return r.jsxs("div",{className:"relative flex h-full min-h-0 flex-col",children:[r.jsx("div",{className:"shrink-0 px-row-inset pt-2",children:r.jsx(Yo,{count:t.length,onReview:y})}),r.jsx("div",{className:"min-h-0 flex-1",children:n}),r.jsx(li,{open:i,candidates:t,defaultDestinationId:p,availableFolders:m,delimiter:en(g?.items??[]),onConfirmMove:I,onCancel:()=>l(!1)})]})}const tr=(e,o,t,s)=>`${e??""}|${o}|${t??""}|${s??""}`,sr=({accountId:e,mailboxId:o})=>{const t=jt(),{pushError:s}=qt(),{requestAppointment:n}=tn(),{trashByAccount:i}=ss(),l=e?i.get(e):void 0,a=tr(e,o,l?.mailboxId,l?.source),[u,d]=c.useState({scope:a});u.scope!==a&&d({scope:a});const h=u.scope===a?u:void 0,g=c.useCallback(()=>t.getQueryData(sn())?.accounts.find(w=>w.accountId===e)?.folderAppointments.find(w=>w.role==="Trash")?.mailboxId??o,[t,e,o]),m=c.useRef(void 0),{mutateAsync:p,isPending:S}=Mt({...cn(),meta:ln(409),onMutate:()=>(m.current=a,{scope:a,listMailboxId:g()}),onSuccess:(x,j,k)=>{k.scope===a&&d({scope:a,deletedCount:x.deletedCount})},onError:(x,j,k)=>{const w=rn(x);if(!w){s({title:"Couldn't empty Trash",detail:an(x),error:x});return}k?.scope===a&&d({scope:a,refusal:w})},onSettled:(x,j,k,w)=>{m.current===w?.scope&&(m.current=void 0),nn(t,on([w?.listMailboxId??o])),e&&t.invalidateQueries({queryKey:Ht({path:{accountId:e}})})}}),y=c.useCallback(()=>e?(d({scope:a}),p({path:{accountId:e}}).then(()=>{},()=>{})):Promise.resolve(),[e,a,p]),I=c.useCallback(()=>{y()},[y]),b=c.useCallback(()=>{const x=h?.refusal;x&&n({accountId:x.accountId,role:x.role,reason:x.reason,action:{kind:"emptyTrash"},onAppointed:y})},[h,n,y]);return{emptyTrash:I,isEmptying:S&&m.current===a,deletedCount:h?.deletedCount,refusal:h?.refusal,repair:b}},nr="We can verify this sender";function or(e){const{data:o}=mt({...un({path:{mailboxId:e??""},query:{senderTrust:["vip","wellknown"],dkimMismatch:!1,results:!0,limit:500}}),enabled:!!e,staleTime:6e4});return{candidates:(o?.items??[]).map(s=>({id:s.messageId,senderName:s.fromName||s.fromEmail||"Unknown sender",senderAddress:s.fromEmail??"",subject:s.subject||"(no subject)",snippet:s.snippet??"",trustReason:nr,trustSubReason:Bn(s.senderTrust),senderTrust:s.senderTrust}))}}const ir=6e4,rr=({mailboxId:e,criteria:o,enabled:t})=>{const s={...o,count:!0,results:!1},{data:n}=mt({queryKey:Qt({path:{mailboxId:e},query:s}),queryFn:async()=>{const{data:i}=await Ut({path:{mailboxId:e},query:s,throwOnError:!0});return i},enabled:t,staleTime:ir});return t?_o(n?.count):{kind:"unknown"}},ar=e=>{const o=new Set,t=[];for(const s of e)o.has(s.threadMessageId)||(o.add(s.threadMessageId),t.push(s));return t},lr=50,ds=c.createContext(null);function pt(){const e=c.useContext(ds);if(!e)throw new Error("MailboxPane.* must be used inside <MailboxPane>");return e}function cr({mailboxId:e,thread:o,children:t}){const s=Ye(),n=jo(),i=qo(),l=o?.threadId,a=o?.messageId,u=Rt(),{accounts:d,searchQuery:h,onToggleIntelligence:g,onSearchClearQuery:m}=Jt(),p=pn(),S=Vo(h),y=S.length>0,{freeText:I,tokens:b}=Dt(S,p),x=Dt(h.trim(),p).freeText,[j,k]=c.useState("all"),[w,O]=c.useState(new Set),A=c.useMemo(()=>({category:j,attributes:w}),[j,w]),B=c.useMemo(()=>Wn(A),[A]),J=y||Kn(A),{params:G,residual:R}=Vn(b,B),oe={order:"desc",...I?{query:I}:{},...G,...B},F={...oe,limit:lr},P={category:F.category,unread:F.unread,starred:F.starred,attachments:F.attachments},Ee=J?Qt({path:{mailboxId:e},query:F}):dn({path:{mailboxId:e},query:{order:"desc"}}),{data:Se,isLoading:ye,isError:W,error:Pe,refetch:ie,fetchNextPage:M,hasNextPage:Ce,isFetchingNextPage:Oe}=So({queryKey:Ee,queryFn:async({pageParam:C})=>{if(J){const{data:$}=await Ut({path:{mailboxId:e},query:{...F,continuationToken:C},throwOnError:!0});return $}const{data:H}=await gn({path:{mailboxId:e},query:{order:"desc",continuationToken:C},throwOnError:!0});return H},initialPageParam:void 0,getNextPageParam:C=>C.continuationToken,placeholderData:(C,H)=>po(H?.queryKey,P)?C:void 0}),Ie=rr({mailboxId:e,criteria:oe,enabled:Lo({hasSearchQuery:y,freeText:I,residualTokenCount:R.length})}),{accountId:N,isLoading:Z}=qn(e),$e=Mo({accounts:d}),K=Hn(Qn(ar(Se?.pages.flatMap(C=>C.items??[])??[])),R,N),ke=c.useCallback(C=>{k(C)},[]),fe=c.useCallback(C=>{O(H=>{const $=new Set(H);return $.has(C)?$.delete(C):$.add(C),$})},[]),me=c.useCallback(()=>{k("all"),O(new Set)},[]),Ae=c.useCallback(()=>{me(),m()},[me,m]),re=yo({chips:A,tokens:b,reach:R.length>0?"loaded-pages":Un(F),onClear:Ae}),Be=l?K.find(C=>C.messageId===a)??K.find(C=>C.threadId===l):void 0,Ne=Jn(l,a),z=Be??Ne,_=a??z?.messageId,ne=c.useMemo(()=>{if(l)return{threadId:l,mailboxId:z?.mailboxId??e,subject:z?.subject,messageId:_,authenticity:z?.authenticity}},[l,z,_,e]),ee=c.useCallback(C=>{_&&C.includes(_)&&n()},[_,n]),{deleteMessages:Y,isPending:Te}=_t({mailboxId:e,onAfterOptimisticRemove:ee}),{moveMessages:we,isPending:ge}=Lt({mailboxId:e,accountId:N,onAfterOptimisticRemove:ee}),V=c.useRef(null),pe=Gn(),{listCommandsRef:te,onTriageContextChange:Xe,focusedMessageId:We,selectedIds:xe}=pe,E=K.find(C=>C.messageId===We)??z,Ze=Ro({accounts:d})??null,je=Yn({thread:z,isOpen:!0,mailboxId:e,accountId:N,onAfterOptimisticRemove:ee}),{draftsMailboxId:et}=Xn(N),T=et!==void 0&&et===e,{archiveMailboxId:tt}=Zn(N),Ke=eo(),L=hn(),st=c.useMemo(()=>fn(L,l,_),[L,l,_]),ae=c.useMemo(()=>{if(E)return C=>L({threadId:E.threadId,messageId:E.messageId,mode:C})},[L,E]),be=To(),le=mn(),ze=wo(),Me=c.useCallback(C=>C?Ke(C):[],[Ke]),{toggleStar:ce}=to({threadId:E?.threadId??"",mailboxId:e}),{toggleReadFor:Ve}=Zt({mailboxId:e,accountId:N}),{junkMailboxId:q}=es(N),se=q!=null&&q===e,Fe=ts(q,e),{candidates:nt}=or(se?q:void 0),{moveMessages:qe}=Lt({mailboxId:e,threadId:E?.threadId,accountId:N,onAfterOptimisticRemove:ee}),{deleteMessages:He}=_t({mailboxId:e,threadId:E?.threadId,onAfterOptimisticRemove:ee}),{addressId:ve,address:D}=so(E),{updateFlags:De}=no({addressId:ve,senderEmail:E?.fromEmail??void 0}),xt=c.useCallback(()=>ae?.("reply"),[ae]),ot=c.useCallback(()=>ae?.("reply-all"),[ae]),_e=c.useCallback(()=>ae?.("forward"),[ae]),ue=c.useCallback(()=>Me(E),[Me,E]),it=c.useCallback(()=>{if(te.current?.requestVerb("delete"))return;const C=ue();C.length>0&&He(C)},[te,ue,He]),rt=c.useCallback(()=>{if(te.current?.requestVerb("junk")||!Fe)return;const C=ue();C.length!==0&&(oo(u,{count:C.length,senderTrust:E?.senderTrust??"unknown",wasRescuable:E?io(E):!1}),qe(C,Fe))},[te,Fe,ue,qe,u,E]),at=c.useCallback(()=>{if(xe.length>0){const C=!(E?.hasStars??!1),H=new Set(xe);for(const $ of K)H.has($.messageId)&&$.hasStars!==C&&ce($.messageId,$.hasStars);return}E&&ce(E.messageId,E.hasStars)},[xe,K,E,ce]),de=c.useCallback(()=>{if(te.current?.requestVerb("markRead"))return;const C=ue();if(C.length===0)return;const H=!(E?.isRead??!1);Ve(C,H)},[te,ue,E,Ve]),lt=c.useCallback(()=>{if(!ve)return;const C=D?.flags?.muted?.value!==!0;De({muted:{value:C}})},[ve,D,De]),bt=c.useCallback(()=>{if(!ve)return;const C=D?.flags?.vip?.value!==!0;De({vip:{value:C}})},[ve,D,De]),Qe=c.useCallback(()=>{V.current?.open()},[]),ct=T?"drafts":tt===e?"archive":q===e?"junk":"inbox",ut=c.useRef("");c.useEffect(()=>{const C=ut.current;ut.current=S,S.length>0&&C.length===0&&u.recordEvent("search.submitted",{mailboxType:ct})},[S,ct,u]);const{goBack:Ue,nextMessageId:vt,previousMessageId:St}=ro({context:pe,orderedIds:K.map(C=>C.messageId),selectedMessageId:_,enabled:!be&&!le,hasOpenThread:l!==void 0,onClose:n,handlers:{reply:xt,replyAll:ot,forward:_e,delete:it,toggleStar:at,toggleRead:de,muteSender:lt,blockSender:z?Qe:void 0,vipSender:bt,markJunk:rt,toggleIntelligence:z?()=>V.current?.toggle():void 0,compose:ze,goBrief:()=>i("brief"),goInbox:()=>i("brief"),goSent:()=>i("brief"),goFlagged:()=>i("flagged"),goSettings:()=>i("settings")}}),dt=C=>{if(!C)return;const H=K.find($=>$.messageId===C);return H?{threadId:H.threadId,messageId:C}:void 0},yt={mailboxId:e,selectedMessageId:_,selectedThread:z,conversation:ne,onOpenThread:s,threads:K,isLoading:ye,isError:W,error:Pe,mailboxAccountId:N,mailboxAccountLoading:Z,mailboxName:$e,unreadCount:Ze,isDraftsMailbox:T,isSpamFolder:se,rescueCandidates:nt,filterCategory:j,filterAttributes:w,onSelectFilterCategory:ke,onToggleFilterAttribute:fe,onClearFilters:me,listFilter:re,listSearchText:x||void 0,onToggleIntelligence:g,intelligenceRef:V,handleDeselectIfRemoved:ee,searchPredicate:y&&R.length===0?F:void 0,resultCount:Ie,onDeleteMessages:Y,onMoveMessages:we,isDeleting:Te,isMoving:ge,onLoadMore:M,hasMore:Ce,isLoadingMore:Oe,onTriageContextChange:Xe,listCommandsRef:te,onRetry:()=>ie(),onReply:st,onToolbarDelete:je.deleteThread,onToolbarStar:je.toggleStar,isStarred:je.isStarred,onToolbarMove:je.moveThread,onBack:Ue,nextThread:dt(vt),previousThread:dt(St)};return r.jsx(ds.Provider,{value:yt,children:t})}function hs(){const{mailboxId:e,selectedMessageId:o,threads:t,isLoading:s,isError:n,error:i,onDeleteMessages:l,onMoveMessages:a,isDeleting:u,isMoving:d,onLoadMore:h,hasMore:g,isLoadingMore:m,mailboxAccountId:p,mailboxName:S,unreadCount:y,isDraftsMailbox:I,isSpamFolder:b,rescueCandidates:x,onTriageContextChange:j,listCommandsRef:k,onRetry:w,filterCategory:O,filterAttributes:A,onSelectFilterCategory:B,onToggleFilterAttribute:J,onClearFilters:G,listFilter:R,listSearchText:oe,searchPredicate:F,resultCount:P}=pt(),{searchQuery:Ee,searchInput:Se,accounts:ye,resultFolderIndex:W}=Jt(),Pe=Ko(),ie=Ye(),M=S??"Inbox",Ce=c.useMemo(()=>ho(),[]),{trashMailboxId:Oe}=fo(p),Ie=Eo({accounts:ye}),{trashByAccount:N}=ss(),Z=sr({accountId:p,mailboxId:e}),$e=Oe!=null&&Oe===e,K=c.useMemo(()=>p?[p]:[],[p]),{hasNewMail:ke}=bn(),{state:fe,errorMessage:me,refresh:Ae}=vn(K,{onSettled:w}),re=c.useMemo(()=>r.jsx(Sn,{state:fe,onRefresh:Ae,label:`Refresh ${M}`,errorMessage:me,hasUpdate:ke(K)}),[fe,Ae,M,me,ke,K]),Be=c.useMemo(()=>t.map(V=>mo(V,W)),[t,W]),{hits:Ne,isLoading:z}=Po({mailboxId:e,filterCategory:O}),_=c.useMemo(()=>go(Ne,t.map(V=>V.threadId),W),[Ne,t,W]),ne=c.useCallback(V=>{const pe=V.threadId??t.find(te=>te.messageId===V.id)?.threadId;pe&&ie({threadId:pe,messageId:V.id},{mailboxId:V.mailboxId??e,query:Se})},[e,ie,Se,t]);if(I&&p)return r.jsx(gi,{accountId:p,selectedMessageId:o,imapThreads:t,title:S??"Drafts",unreadCount:y??void 0});const ee=r.jsx(Gi,{mailboxId:e,threads:t,selectedMessageId:o,isLoading:s,isError:n,error:i,onRetry:w,searchQuery:Ee,searchPredicate:F,resultCount:P,onDeleteMessages:l,isDeleting:u,isMoving:d,onLoadMore:h,hasMore:g,isLoadingMore:m,accountId:p,listTitle:M,listFilter:R,listSearchText:oe,listScopeLabel:M,hideHeader:!0,onTriageContextChange:j,commandsRef:k}),Y=ye[0]?.accountId,Te=Pe==="phone"&&Y?r.jsx(Zi,{accountId:Y,children:ee}):ee,we=b&&x.length>0&&p?r.jsx(er,{accountId:p,currentMailboxId:e,candidates:x,onMove:a,children:Te}):Te,ge=$e?r.jsx(bi,{messageCount:Ie,isEmptying:Z.isEmptying,deletedCount:Z.deletedCount,refusalReason:Z.refusal?.reason,trashFolderLabel:S??void 0,staleFolderLabel:p?N.get(p)?.staleFolderPath:void 0,onEmpty:Z.emptyTrash,onRepair:Z.repair,children:we}):we;return r.jsx(Co,{title:M,unreadCount:y,preset:Ce,selectedCategory:O,activeFilters:A,onSelectCategory:B,onToggleFilter:J,onClearFilters:G,searchResults:Be,searchLoading:s,relatedResults:_,relatedLoading:z,onSelectSearchResult:ne,searchResultsInBody:!0,refreshControl:re,children:ge})}function ur(){const{mailboxId:e,mailboxAccountId:o,mailboxAccountLoading:t,selectedThread:s,conversation:n,onReply:i,onToolbarDelete:l,onToolbarStar:a,isStarred:u,onToolbarMove:d,handleDeselectIfRemoved:h,intelligenceRef:g}=pt(),m=!!n,p=co(n?.threadId);ns(g,p);const S=c.useRef(null),{railFits:y,openRail:I}=p;c.useEffect(()=>{if(!y)return;const x=s?.messageId??null;x&&S.current!==x&&s?.authenticity?.dkimMismatch&&(S.current=x,I())},[y,I,s?.messageId,s?.authenticity?.dkimMismatch]);const b=n?r.jsx(os,{threadId:n.threadId,mailboxId:n.mailboxId,subject:n.subject,selectedMessageId:n.messageId,authenticity:n.authenticity,onOpenIntelligence:p.open,listOnScreen:!0}):r.jsx(xn,{});return r.jsxs(r.Fragment,{children:[r.jsxs("section",{className:"flex h-full w-full min-w-0 flex-col bg-canvas",children:[r.jsx(uo,{hasThread:m,messageId:n?.messageId,intelligenceOpen:p.isShowing,canToggleIntelligence:p.canToggle,onToggleIntelligence:p.toggle,onReply:i?()=>i("reply"):void 0,onReplyAll:i?()=>i("reply-all"):void 0,onForward:i?()=>i("forward"):void 0,onDelete:m?l:void 0,onToggleStar:m?a:void 0,isStarred:u,moveContext:m&&o?{accountId:o,currentMailboxId:e,onMove:d}:void 0,moveContextLoading:t}),r.jsx("div",{className:"min-h-0 flex-1 overflow-hidden",children:b})]}),r.jsx(is,{isOpen:p.drawerOpen,onClose:p.closeDrawer,thread:s,mailboxId:e,accountId:o,onAfterOptimisticRemove:h})]})}function dr(){const{mailboxId:e,mailboxAccountId:o,selectedThread:t,onToggleIntelligence:s,handleDeselectIfRemoved:n}=pt();return r.jsx(lo,{onClose:s,thread:t,mailboxId:e,accountId:o,onAfterOptimisticRemove:n})}function hr(){const{mailboxId:e,mailboxAccountId:o,selectedThread:t,conversation:s,onOpenThread:n,onBack:i,nextThread:l,previousThread:a,handleDeselectIfRemoved:u,intelligenceRef:d}=pt(),h=ao(s?.threadId??null);return ns(d,h),s?r.jsxs(r.Fragment,{children:[r.jsx(os,{threadId:s.threadId,mailboxId:s.mailboxId,subject:s.subject,selectedMessageId:s.messageId,authenticity:s.authenticity,onBack:i,onOpenIntelligence:h.toggle,onSwipeNext:l?()=>n(l):void 0,onSwipePrevious:a?()=>n(a):void 0,mobileIntelligenceOpen:h.isOpen}),r.jsx(is,{isOpen:h.isOpen,onClose:h.close,thread:t,mailboxId:e,accountId:o,onAfterOptimisticRemove:u})]}):r.jsx(hs,{})}const Dr=Object.assign(cr,{List:hs,Reading:ur,Intelligence:dr,Phone:hr});export{Dr as M};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{ar as g,a0 as w,L as C,j as s,t as b,a3 as $,a1 as S,a9 as _,u as q,cn as H,r as x,cp as K,c as U,ad as W,C as G,dl as J,h as V,at as X,cR as Y,i as v,av as y,cK as Z,cL as ee,bT as p,eR as se}from"./index-BNAV6NNi.js";import{a as te,u as k,L as R}from"./roving-focus-DxibL2s7.js";import{u as ne,p as ae,R as j,c as oe}from"./useSearchTokenContext-AypRRqG2.js";import{C as I}from"./circle-check-big-B39GqMyR.js";import{C as L}from"./clock-gr-cmcGz.js";import{R as re}from"./row-actions-vG1W9M0b.js";import{R as ie}from"./rotate-ccw-BePj1nOz.js";import{N as T}from"./NavMenuButton-D50RaMZU.js";import{i as le,s as D}from"./outbox-status-BlKn6P0x.js";import{n as ce}from"./search-query-Cr_ZXBCp.js";import{f as de}from"./useMessageBodyContent-CAy2uoxy.js";const ue={queued:{icon:L,label:"Queued",className:"text-warning"},sending:{icon:C,label:"Sending…",className:"text-accent-2",spin:!0},sent:{icon:I,label:"Sent",className:"text-positive"},unfiled:{icon:g,label:"Sent, not filed",className:"text-warning"},failed:{icon:w,label:"Failed",className:"text-danger"},blocked:{icon:g,label:"Blocked",className:"text-warning"}};function O({status:e,iconOnly:n,className:a}){const t=ue[e],o=t.icon;return s.jsxs("span",{className:b("inline-flex items-center gap-1.5 text-xs font-medium",t.className,a),children:[s.jsx(o,{className:b("size-4",t.spin&&"animate-spin")}),!n&&t.label]})}const xe=(e,n)=>n?"bg-accent-2-soft":e==="failed"?"bg-danger-soft":e==="blocked"||e==="unfiled"?"bg-warning/10":"";function fe({recipients:e,subject:n,time:a,status:t,error:o,selected:l,onSelect:c,onRetry:r,retrying:d,onEdit:i,onDelete:f,deleting:u}){const m=t==="failed"||t==="blocked"||t==="unfiled";return s.jsxs("div",{className:b("flex items-start gap-3 border-b border-line px-4 py-3 transition-colors hover:bg-surface-raised",xe(t,l)),children:[s.jsxs("button",{type:"button",...te,onClick:c,className:"flex flex-1 min-w-0 items-start gap-3 text-left",children:[s.jsx("div",{className:"mt-0.5 shrink-0",children:s.jsx(O,{status:t,iconOnly:!0})}),s.jsxs("div",{className:"min-w-0 flex-1",children:[s.jsxs("div",{className:"flex items-center justify-between gap-2",children:[s.jsx("span",{className:"truncate text-sm font-medium",children:e}),s.jsx("span",{className:"shrink-0 text-xs text-fg-muted",children:a})]}),s.jsx("div",{className:"truncate text-sm",children:n||"No subject"}),s.jsxs("div",{className:"mt-1 flex items-center gap-2",children:[s.jsx(O,{status:t}),o&&s.jsxs("span",{className:"truncate text-xs text-fg-muted",children:["— ",o]})]})]})]}),m&&s.jsx("div",{className:"shrink-0",children:s.jsx(re,{actions:[...t==="failed"&&r?[{label:"Retry sending",iconOnly:!0,icon:s.jsx(ie,{className:"size-3.5"}),busy:d,onClick:r}]:[],...t==="unfiled"?[]:[{label:"Edit as draft",iconOnly:!0,icon:s.jsx(S,{className:"size-3.5"}),onClick:i}]],destructive:{label:"Delete message",iconOnly:!0,icon:s.jsx($,{className:"size-3.5"}),busy:u,confirm:{prompt:"Delete this message?",confirmLabel:"Delete"},onClick:f}})})]})}function Ee(){return _({from:"/mail/outbox/draft/$outboxMessageId",shouldThrow:!1})?.outboxMessageId}function me(){const e=q(),n=H();return x.useCallback(a=>{e({to:"/mail/outbox/draft/$outboxMessageId",params:{outboxMessageId:a},search:t=>t,hash:n})},[e,n])}function he(){return K()}function be(e,n){const a=n.trim().toLowerCase();if(a.length===0)return!0;const t=[e.subject,e.fromAddress,e.fromName,...e.toAddresses??[],...e.ccAddresses??[]].filter(o=>typeof o=="string").join(" ").toLowerCase();return a.split(/\s+/).every(o=>o.length===0||t.includes(o))}function ge(e){return e.tokens.length>0&&e.freeText.trim().length===0}const A={queued:{icon:L,label:"Queued",className:"text-warning"},sending:{icon:C,label:"Sending…",className:"text-accent-2"},sent:{icon:I,label:"Sent",className:"text-positive"},unfiled:{icon:g,label:"Sent, not filed",className:"text-warning"},failed:{icon:w,label:"Failed",className:"text-danger"},blocked:{icon:g,label:"Blocked",className:"text-warning"}},pe=e=>se(e).toDateString()===new Date().toDateString()?p(e,{hour:"numeric",minute:"2-digit"}):p(e,{month:"short",day:"numeric"}),M=e=>p(e,{dateStyle:"medium",timeStyle:"short"}),je=e=>{const n=e.toAddresses??[];return n.length===0?"No recipients":n.length===1?n[0]:`${n[0]} +${n.length-1}`},E=(e,n)=>n?"The outbox cannot filter on those terms":e?"No matching outbox messages":"No outbox messages",Q=x.createContext(null);function N(){const e=x.useContext(Q);if(!e)throw new Error("OutboxPane.* must be used inside <OutboxPane>");return e}function Ne({outboxMessageId:e,children:n}){const a=me(),t=he(),{data:o,isLoading:l}=U(W()),{searchQuery:c}=G(),r=ne(),d=ce(c),i=ae(d,r),f=d.length>0,u=ge(i),m=x.useMemo(()=>u?[]:(o?.items??[]).filter(h=>le(h.status)).filter(h=>be(h,i.freeText)),[o,i.freeText,u]),z=x.useMemo(()=>m.find(h=>h.outboxMessageId===e),[m,e]),F={messages:m,hasQuery:f,unsupportedQuery:u,isLoading:l,selectedMessageId:e,selectedMessage:z,onOpenMessage:a,onCloseMessage:t};return s.jsx(Q.Provider,{value:F,children:n})}function P({message:e,isSelected:n,onSelect:a}){const t=V(),o=de(),{pushError:l}=X(),c=x.useCallback(()=>{t.invalidateQueries({queryKey:Y()})},[t]),r=v({...Z(),onSuccess:c,onError:u=>{l(y("Couldn't resend message","The message wasn't sent.",u))}}),d=v({...ee(),onSuccess:c,onError:u=>{l(y("Couldn't delete message","The message wasn't deleted.",u))}}),i=e.status;if(!A[i])return null;const f=D(e.status);return s.jsx(fe,{recipients:je(e),subject:e.subject||"",time:pe(e.sentAt??e.updatedAt),status:i,error:f?e.lastError??void 0:void 0,selected:n,onSelect:a,onRetry:i==="failed"?()=>r.mutate({path:{outboxMessageId:e.outboxMessageId}}):void 0,retrying:r.isPending,onEdit:()=>o(e.outboxMessageId),onDelete:()=>d.mutate({path:{outboxMessageId:e.outboxMessageId}}),deleting:d.isPending})}function B({message:e,onBack:n}){const a=e.status,t=A[a],o=t?.icon??S,l=e.sentAt?M(e.sentAt):M(e.updatedAt);return s.jsxs("div",{className:"h-full overflow-y-auto bg-canvas",children:[s.jsxs("div",{className:"border-b border-line p-4",children:[n&&s.jsxs("button",{type:"button",onClick:n,className:"mb-3 inline-flex items-center gap-1 text-sm text-fg-muted hover:text-fg",children:[s.jsx(J,{className:"size-4"}),s.jsx("span",{children:"Back"})]}),s.jsx("h1",{className:"text-xl font-semibold mb-3",children:e.subject||"(No subject)"}),s.jsxs("div",{className:"space-y-1 text-sm",children:[s.jsxs("div",{className:"flex gap-2",children:[s.jsx("span",{className:"text-fg-muted shrink-0 w-12",children:"From:"}),s.jsx("span",{className:"text-fg",children:e.fromName?`${e.fromName} <${e.fromAddress}>`:e.fromAddress})]}),s.jsxs("div",{className:"flex gap-2",children:[s.jsx("span",{className:"text-fg-muted shrink-0 w-12",children:"To:"}),s.jsx("span",{className:"text-fg",children:(e.toAddresses??[]).join(", ")})]}),e.ccAddresses&&e.ccAddresses.length>0&&s.jsxs("div",{className:"flex gap-2",children:[s.jsx("span",{className:"text-fg-muted shrink-0 w-12",children:"Cc:"}),s.jsx("span",{className:"text-fg",children:e.ccAddresses.join(", ")})]}),s.jsxs("div",{className:"flex gap-2",children:[s.jsx("span",{className:"text-fg-muted shrink-0 w-12",children:"Date:"}),s.jsx("span",{className:"text-fg",children:l})]}),t&&s.jsxs("div",{className:"flex items-center gap-2 pt-2",children:[s.jsx(o,{className:b("size-4",t.className,a==="sending"&&"animate-spin")}),s.jsx("span",{className:b("text-xs font-medium",t.className),children:t.label}),D(e.status)&&e.lastError&&s.jsxs("span",{className:"text-xs text-fg-muted",children:["— ",e.lastError]})]})]})]}),s.jsx("div",{className:"p-4",children:s.jsx(oe,{html:e.htmlBody,text:e.textBody})})]})}function ve(){const{messages:e,hasQuery:n,unsupportedQuery:a,isLoading:t,selectedMessageId:o,onOpenMessage:l}=N(),c=x.useRef(null);return k({containerRef:c,itemSelector:R}),t?s.jsx("div",{className:"flex h-full items-center justify-center bg-canvas",children:s.jsx("span",{className:"text-fg-muted",children:"Loading..."})}):e.length===0?s.jsx("div",{className:"flex h-full bg-surface",children:s.jsx(j,{message:E(n,a),showHints:!1})}):s.jsxs("div",{className:"h-full flex flex-col bg-canvas",children:[s.jsxs("header",{className:"flex h-pane-header shrink-0 items-center gap-2 border-b border-line px-row-inset",children:[s.jsx(T,{}),s.jsx("h1",{className:"min-w-0 flex-1 truncate text-sm font-semibold text-fg",children:"Outbox"}),s.jsxs("span",{className:"shrink-0 text-2xs text-fg-subtle",children:[e.length," ",e.length===1?"message":"messages"]})]}),s.jsx("div",{ref:c,className:"flex-1 overflow-y-auto",children:e.map(r=>s.jsx(P,{message:r,isSelected:o===r.outboxMessageId,onSelect:()=>l(r.outboxMessageId)},r.outboxMessageId))})]})}function ye(){const{selectedMessage:e}=N();return s.jsxs("section",{className:"flex h-full w-full min-w-0 flex-col bg-canvas",children:[s.jsx("header",{className:"flex h-pane-header shrink-0 items-center border-b border-line px-3"}),s.jsx("div",{className:"min-h-0 flex-1 overflow-hidden",children:e?s.jsx(B,{message:e}):s.jsx(j,{message:"Select a message to read",showHints:!1})})]})}function Oe(){const{messages:e,hasQuery:n,unsupportedQuery:a,isLoading:t,selectedMessageId:o,selectedMessage:l,onOpenMessage:c,onCloseMessage:r}=N(),d=x.useRef(null);return k({containerRef:d,itemSelector:R}),t?s.jsx("div",{className:"flex h-full items-center justify-center bg-canvas",children:s.jsx("span",{className:"text-fg-muted",children:"Loading..."})}):l?s.jsx(B,{message:l,onBack:r}):e.length===0?s.jsx("div",{className:"flex h-full bg-surface",children:s.jsx(j,{message:E(n,a),showHints:!1})}):s.jsxs("div",{className:"h-full flex flex-col bg-canvas",children:[s.jsxs("header",{className:"flex h-pane-header shrink-0 items-center gap-2 border-b border-line px-row-inset",children:[s.jsx(T,{}),s.jsx("h1",{className:"min-w-0 flex-1 truncate text-sm font-semibold text-fg",children:"Outbox"}),s.jsxs("span",{className:"shrink-0 text-2xs text-fg-subtle",children:[e.length," ",e.length===1?"message":"messages"]})]}),s.jsx("div",{ref:d,className:"flex-1 overflow-y-auto",children:e.map(i=>s.jsx(P,{message:i,isSelected:o===i.outboxMessageId,onSelect:()=>c(i.outboxMessageId)},i.outboxMessageId))})]})}const Qe=Object.assign(Ne,{List:ve,Reading:ye,Phone:Oe});export{Qe as O,Ee as u};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{O as o}from"./index-BNAV6NNi.js";const n=o;export{n as component};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{aj as m,j as o,O as p}from"./index-BNAV6NNi.js";import{a}from"./MailShell-CdlKuAJL.js";import{M as r}from"./MailboxPane-M52fsGFN.js";import{a as e}from"./search-token-index-CbMoDJvO.js";import{u as s}from"./search-mirror-B3Rb2QFP.js";import"./FullCompose-DerQv8yu.js";import"./ErrorState-BMamrpRe.js";import"./index-CSyKycBp.js";import"./useMessageBodyContent-CAy2uoxy.js";import"./useSignature-CWPSLmMO.js";import"./account-form-helpers-DhckT_PN.js";import"./useDebouncedValue-DBZDUjAb.js";import"./sections-D-5U_zIy.js";import"./confirm-dialog-GyEqvQcg.js";import"./useSearchTokenContext-AypRRqG2.js";import"./kbd-tyVb1kmX.js";import"./search-scope-B5-OK3Cq.js";import"./useRefreshControl-VAzesut8.js";import"./circle-check-big-B39GqMyR.js";import"./refresh-cw-DEjJXAwL.js";import"./useQueries-0wkiftqA.js";import"./MailListHeader-p1q7jsyl.js";import"./roving-focus-DxibL2s7.js";import"./popover-menu-RTTJnmds.js";import"./mail-Be_WuC_w.js";import"./avatar-BZB5Hlpq.js";import"./EmptyState-B3OfXxGc.js";import"./undo-2-C9sVZCD4.js";import"./download-Cfm8O5nH.js";import"./calendar-suggestion-BXJh4QEG.js";import"./calendar-format-DsR-4j-9.js";import"./useCalendars-6Gx83pIc.js";import"./calendar-report-Becs8mIN.js";import"./attendee-row-DUsYrdln.js";import"./minus-DbGv0Sob.js";import"./clock-gr-cmcGz.js";import"./calendar-clash-strip-6sedBGkk.js";import"./bell-off-DwXjf1FL.js";import"./copy-8ycixQYh.js";import"./shield-check-BR1Itb39.js";import"./useFilters-B1O1c8J0.js";import"./checkbox-BeWcYpqA.js";import"./useLayoutTier-B0CJkqKe.js";import"./menu-DHbVKrar.js";import"./MailViewChrome-B80rNMML.js";import"./NavMenuButton-D50RaMZU.js";import"./useLabels-CqJaWt3E.js";import"./useSemanticSearch-DLp4ptAj.js";import"./search-query-Cr_ZXBCp.js";import"./bottom-sheet-nV19J7QD.js";import"./circle-help-DRIXmYoN.js";import"./circle-check-D-kPomlF.js";function eo(){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{eo as component};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as o}from"./index-BNAV6NNi.js";import{M as r}from"./MailboxPane-M52fsGFN.js";import"./useSearchTokenContext-AypRRqG2.js";import"./kbd-tyVb1kmX.js";import"./useMessageBodyContent-CAy2uoxy.js";import"./search-scope-B5-OK3Cq.js";import"./useRefreshControl-VAzesut8.js";import"./circle-check-big-B39GqMyR.js";import"./refresh-cw-DEjJXAwL.js";import"./useQueries-0wkiftqA.js";import"./MailListHeader-p1q7jsyl.js";import"./roving-focus-DxibL2s7.js";import"./search-token-index-CbMoDJvO.js";import"./popover-menu-RTTJnmds.js";import"./mail-Be_WuC_w.js";import"./avatar-BZB5Hlpq.js";import"./index-CSyKycBp.js";import"./useSignature-CWPSLmMO.js";import"./account-form-helpers-DhckT_PN.js";import"./useDebouncedValue-DBZDUjAb.js";import"./sections-D-5U_zIy.js";import"./EmptyState-B3OfXxGc.js";import"./ErrorState-BMamrpRe.js";import"./undo-2-C9sVZCD4.js";import"./download-Cfm8O5nH.js";import"./calendar-suggestion-BXJh4QEG.js";import"./calendar-format-DsR-4j-9.js";import"./useCalendars-6Gx83pIc.js";import"./calendar-report-Becs8mIN.js";import"./attendee-row-DUsYrdln.js";import"./minus-DbGv0Sob.js";import"./clock-gr-cmcGz.js";import"./calendar-clash-strip-6sedBGkk.js";import"./bell-off-DwXjf1FL.js";import"./copy-8ycixQYh.js";import"./shield-check-BR1Itb39.js";import"./useFilters-B1O1c8J0.js";import"./checkbox-BeWcYpqA.js";import"./confirm-dialog-GyEqvQcg.js";import"./useLayoutTier-B0CJkqKe.js";import"./menu-DHbVKrar.js";import"./MailViewChrome-B80rNMML.js";import"./NavMenuButton-D50RaMZU.js";import"./useLabels-CqJaWt3E.js";import"./useSemanticSearch-DLp4ptAj.js";import"./search-query-Cr_ZXBCp.js";import"./bottom-sheet-nV19J7QD.js";import"./circle-help-DRIXmYoN.js";import"./circle-check-D-kPomlF.js";function Z(){return o.jsx(r.Reading,{})}export{Z as component};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as r}from"./index-BNAV6NNi.js";import{B as o}from"./BriefPane-8DVHJA2P.js";import"./useSearchTokenContext-AypRRqG2.js";import"./kbd-tyVb1kmX.js";import"./useMessageBodyContent-CAy2uoxy.js";import"./search-scope-B5-OK3Cq.js";import"./MailListHeader-p1q7jsyl.js";import"./roving-focus-DxibL2s7.js";import"./search-token-index-CbMoDJvO.js";import"./useQueries-0wkiftqA.js";import"./popover-menu-RTTJnmds.js";import"./mail-Be_WuC_w.js";import"./avatar-BZB5Hlpq.js";import"./index-CSyKycBp.js";import"./useSignature-CWPSLmMO.js";import"./account-form-helpers-DhckT_PN.js";import"./useDebouncedValue-DBZDUjAb.js";import"./sections-D-5U_zIy.js";import"./EmptyState-B3OfXxGc.js";import"./ErrorState-BMamrpRe.js";import"./undo-2-C9sVZCD4.js";import"./download-Cfm8O5nH.js";import"./calendar-suggestion-BXJh4QEG.js";import"./calendar-format-DsR-4j-9.js";import"./useCalendars-6Gx83pIc.js";import"./calendar-report-Becs8mIN.js";import"./attendee-row-DUsYrdln.js";import"./minus-DbGv0Sob.js";import"./clock-gr-cmcGz.js";import"./calendar-clash-strip-6sedBGkk.js";import"./bell-off-DwXjf1FL.js";import"./copy-8ycixQYh.js";import"./shield-check-BR1Itb39.js";import"./useFilters-B1O1c8J0.js";import"./checkbox-BeWcYpqA.js";import"./confirm-dialog-GyEqvQcg.js";import"./useLayoutTier-B0CJkqKe.js";import"./menu-DHbVKrar.js";import"./useRefreshControl-VAzesut8.js";import"./circle-check-big-B39GqMyR.js";import"./refresh-cw-DEjJXAwL.js";import"./useSemanticSearch-DLp4ptAj.js";import"./useLabels-CqJaWt3E.js";import"./search-query-Cr_ZXBCp.js";import"./wizard-selection-DxUM65kM.js";function V(){return r.jsx(o.Reading,{})}export{V as component};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as o}from"./index-BNAV6NNi.js";import{F as r}from"./FlaggedPane-CRbYRcWP.js";import"./useSearchTokenContext-AypRRqG2.js";import"./kbd-tyVb1kmX.js";import"./useMessageBodyContent-CAy2uoxy.js";import"./search-scope-B5-OK3Cq.js";import"./MailListHeader-p1q7jsyl.js";import"./roving-focus-DxibL2s7.js";import"./search-token-index-CbMoDJvO.js";import"./useQueries-0wkiftqA.js";import"./popover-menu-RTTJnmds.js";import"./mail-Be_WuC_w.js";import"./avatar-BZB5Hlpq.js";import"./index-CSyKycBp.js";import"./useSignature-CWPSLmMO.js";import"./account-form-helpers-DhckT_PN.js";import"./useDebouncedValue-DBZDUjAb.js";import"./sections-D-5U_zIy.js";import"./EmptyState-B3OfXxGc.js";import"./ErrorState-BMamrpRe.js";import"./undo-2-C9sVZCD4.js";import"./download-Cfm8O5nH.js";import"./calendar-suggestion-BXJh4QEG.js";import"./calendar-format-DsR-4j-9.js";import"./useCalendars-6Gx83pIc.js";import"./calendar-report-Becs8mIN.js";import"./attendee-row-DUsYrdln.js";import"./minus-DbGv0Sob.js";import"./clock-gr-cmcGz.js";import"./calendar-clash-strip-6sedBGkk.js";import"./bell-off-DwXjf1FL.js";import"./copy-8ycixQYh.js";import"./shield-check-BR1Itb39.js";import"./useFilters-B1O1c8J0.js";import"./checkbox-BeWcYpqA.js";import"./confirm-dialog-GyEqvQcg.js";import"./useLayoutTier-B0CJkqKe.js";import"./menu-DHbVKrar.js";import"./MailViewChrome-B80rNMML.js";import"./refresh-cw-DEjJXAwL.js";import"./wizard-selection-DxUM65kM.js";function Q(){return o.jsx(r.Reading,{})}export{Q as component};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as o}from"./index-BNAV6NNi.js";import{O as t}from"./OutboxPane-CB96afOq.js";import"./roving-focus-DxibL2s7.js";import"./useSearchTokenContext-AypRRqG2.js";import"./kbd-tyVb1kmX.js";import"./useMessageBodyContent-CAy2uoxy.js";import"./search-scope-B5-OK3Cq.js";import"./circle-check-big-B39GqMyR.js";import"./clock-gr-cmcGz.js";import"./row-actions-vG1W9M0b.js";import"./rotate-ccw-BePj1nOz.js";import"./NavMenuButton-D50RaMZU.js";import"./menu-DHbVKrar.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{eX as o,j as m}from"./index-BNAV6NNi.js";import{O as p}from"./OpenCalendarEvent-D5hdoozI.js";import"./CalendarComposePane-D9qd7bGZ.js";import"./calendar-format-DsR-4j-9.js";import"./useQueries-0wkiftqA.js";import"./useCalendars-6Gx83pIc.js";import"./calendar-clash-strip-6sedBGkk.js";import"./attendee-row-DUsYrdln.js";import"./avatar-BZB5Hlpq.js";import"./minus-DbGv0Sob.js";import"./clock-gr-cmcGz.js";import"./calendar-report-Becs8mIN.js";import"./mail-Be_WuC_w.js";import"./pencil-CfMqBuNm.js";import"./useCalendarWrites-D8fkN8Zj.js";import"./ErrorState-BMamrpRe.js";import"./useCalendarData-xtRjqQ4v.js";import"./calendar-subscription-B-aAc2Gy.js";function v(){const{calendarObjectId:r,recurrenceId:t}=o.useParams();return m.jsx(p,{calendarObjectId:r,recurrenceId:t})}export{v as component};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{O as o}from"./index-BNAV6NNi.js";const n=o;export{n as component};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{O as o}from"./index-BNAV6NNi.js";const n=o;export{n as component};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{O as o}from"./index-BNAV6NNi.js";const n=o;export{n as component};
|
package/assets/brief-DzsHhQWL.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as r,O as i}from"./index-BNAV6NNi.js";import{a as m}from"./MailShell-CdlKuAJL.js";import{B as o}from"./BriefPane-8DVHJA2P.js";import{a as p}from"./search-token-index-CbMoDJvO.js";import{u as e}from"./search-mirror-B3Rb2QFP.js";import"./FullCompose-DerQv8yu.js";import"./ErrorState-BMamrpRe.js";import"./index-CSyKycBp.js";import"./useMessageBodyContent-CAy2uoxy.js";import"./useSignature-CWPSLmMO.js";import"./account-form-helpers-DhckT_PN.js";import"./useDebouncedValue-DBZDUjAb.js";import"./sections-D-5U_zIy.js";import"./confirm-dialog-GyEqvQcg.js";import"./useSearchTokenContext-AypRRqG2.js";import"./kbd-tyVb1kmX.js";import"./search-scope-B5-OK3Cq.js";import"./MailListHeader-p1q7jsyl.js";import"./roving-focus-DxibL2s7.js";import"./popover-menu-RTTJnmds.js";import"./mail-Be_WuC_w.js";import"./avatar-BZB5Hlpq.js";import"./EmptyState-B3OfXxGc.js";import"./undo-2-C9sVZCD4.js";import"./download-Cfm8O5nH.js";import"./calendar-suggestion-BXJh4QEG.js";import"./calendar-format-DsR-4j-9.js";import"./useQueries-0wkiftqA.js";import"./useCalendars-6Gx83pIc.js";import"./calendar-report-Becs8mIN.js";import"./attendee-row-DUsYrdln.js";import"./minus-DbGv0Sob.js";import"./clock-gr-cmcGz.js";import"./calendar-clash-strip-6sedBGkk.js";import"./bell-off-DwXjf1FL.js";import"./copy-8ycixQYh.js";import"./shield-check-BR1Itb39.js";import"./useFilters-B1O1c8J0.js";import"./checkbox-BeWcYpqA.js";import"./useLayoutTier-B0CJkqKe.js";import"./menu-DHbVKrar.js";import"./useRefreshControl-VAzesut8.js";import"./circle-check-big-B39GqMyR.js";import"./refresh-cw-DEjJXAwL.js";import"./useSemanticSearch-DLp4ptAj.js";import"./useLabels-CqJaWt3E.js";import"./search-query-Cr_ZXBCp.js";import"./wizard-selection-DxUM65kM.js";function or(){const t=p();return e({to:"/mail/brief"}),r.jsx(o,{thread:t,children:r.jsx(m,{phone:r.jsx(o.Phone,{}),list:r.jsx(o.List,{}),reading:r.jsx(i,{}),intelligence:r.jsx(o.Intelligence,{}),hasThread:!!t})})}export{or as component};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{e}from"./index-BNAV6NNi.js";const t=e("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);export{t as C};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{F as o}from"./FullCompose-DerQv8yu.js";import"./index-BNAV6NNi.js";import"./ErrorState-BMamrpRe.js";import"./index-CSyKycBp.js";import"./useMessageBodyContent-CAy2uoxy.js";import"./useSignature-CWPSLmMO.js";import"./account-form-helpers-DhckT_PN.js";import"./useDebouncedValue-DBZDUjAb.js";import"./sections-D-5U_zIy.js";import"./confirm-dialog-GyEqvQcg.js";const c=o;export{c as component};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{F as o}from"./FullCompose-DerQv8yu.js";import"./index-BNAV6NNi.js";import"./ErrorState-BMamrpRe.js";import"./index-CSyKycBp.js";import"./useMessageBodyContent-CAy2uoxy.js";import"./useSignature-CWPSLmMO.js";import"./account-form-helpers-DhckT_PN.js";import"./useDebouncedValue-DBZDUjAb.js";import"./sections-D-5U_zIy.js";import"./confirm-dialog-GyEqvQcg.js";const c=o;export{c as component};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{F as o}from"./FullCompose-DerQv8yu.js";import"./index-BNAV6NNi.js";import"./ErrorState-BMamrpRe.js";import"./index-CSyKycBp.js";import"./useMessageBodyContent-CAy2uoxy.js";import"./useSignature-CWPSLmMO.js";import"./account-form-helpers-DhckT_PN.js";import"./useDebouncedValue-DBZDUjAb.js";import"./sections-D-5U_zIy.js";import"./confirm-dialog-GyEqvQcg.js";const c=o;export{c as component};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{F as o}from"./FullCompose-DerQv8yu.js";import"./index-BNAV6NNi.js";import"./ErrorState-BMamrpRe.js";import"./index-CSyKycBp.js";import"./useMessageBodyContent-CAy2uoxy.js";import"./useSignature-CWPSLmMO.js";import"./account-form-helpers-DhckT_PN.js";import"./useDebouncedValue-DBZDUjAb.js";import"./sections-D-5U_zIy.js";import"./confirm-dialog-GyEqvQcg.js";const c=o;export{c as component};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as o,O as i}from"./index-BNAV6NNi.js";import{a as m}from"./MailShell-CdlKuAJL.js";import{F as r}from"./FlaggedPane-CRbYRcWP.js";import{a as p}from"./search-token-index-CbMoDJvO.js";import{u as e}from"./search-mirror-B3Rb2QFP.js";import"./FullCompose-DerQv8yu.js";import"./ErrorState-BMamrpRe.js";import"./index-CSyKycBp.js";import"./useMessageBodyContent-CAy2uoxy.js";import"./useSignature-CWPSLmMO.js";import"./account-form-helpers-DhckT_PN.js";import"./useDebouncedValue-DBZDUjAb.js";import"./sections-D-5U_zIy.js";import"./confirm-dialog-GyEqvQcg.js";import"./useSearchTokenContext-AypRRqG2.js";import"./kbd-tyVb1kmX.js";import"./search-scope-B5-OK3Cq.js";import"./MailListHeader-p1q7jsyl.js";import"./roving-focus-DxibL2s7.js";import"./popover-menu-RTTJnmds.js";import"./mail-Be_WuC_w.js";import"./avatar-BZB5Hlpq.js";import"./EmptyState-B3OfXxGc.js";import"./undo-2-C9sVZCD4.js";import"./download-Cfm8O5nH.js";import"./calendar-suggestion-BXJh4QEG.js";import"./calendar-format-DsR-4j-9.js";import"./useQueries-0wkiftqA.js";import"./useCalendars-6Gx83pIc.js";import"./calendar-report-Becs8mIN.js";import"./attendee-row-DUsYrdln.js";import"./minus-DbGv0Sob.js";import"./clock-gr-cmcGz.js";import"./calendar-clash-strip-6sedBGkk.js";import"./bell-off-DwXjf1FL.js";import"./copy-8ycixQYh.js";import"./shield-check-BR1Itb39.js";import"./useFilters-B1O1c8J0.js";import"./checkbox-BeWcYpqA.js";import"./useLayoutTier-B0CJkqKe.js";import"./menu-DHbVKrar.js";import"./MailViewChrome-B80rNMML.js";import"./refresh-cw-DEjJXAwL.js";import"./wizard-selection-DxUM65kM.js";function Z(){const t=p();return e({to:"/mail/flagged"}),o.jsx(r,{thread:t,children:o.jsx(m,{phone:o.jsx(r.Phone,{}),list:o.jsx(r.List,{}),reading:o.jsx(i,{}),intelligence:o.jsx(r.Intelligence,{}),hasThread:!!t})})}export{Z as component};
|
package/assets/index-B-LTaGCL.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as o}from"./index-BNAV6NNi.js";import{O as t}from"./OutboxPane-CB96afOq.js";import"./roving-focus-DxibL2s7.js";import"./useSearchTokenContext-AypRRqG2.js";import"./kbd-tyVb1kmX.js";import"./useMessageBodyContent-CAy2uoxy.js";import"./search-scope-B5-OK3Cq.js";import"./circle-check-big-B39GqMyR.js";import"./clock-gr-cmcGz.js";import"./row-actions-vG1W9M0b.js";import"./rotate-ccw-BePj1nOz.js";import"./NavMenuButton-D50RaMZU.js";import"./menu-DHbVKrar.js";import"./outbox-status-BlKn6P0x.js";import"./search-query-Cr_ZXBCp.js";function c(){return o.jsx(t.Reading,{})}export{c as component};
|
package/assets/index-BP4TLloi.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as o}from"./index-BNAV6NNi.js";import{F as r}from"./FlaggedPane-CRbYRcWP.js";import"./useSearchTokenContext-AypRRqG2.js";import"./kbd-tyVb1kmX.js";import"./useMessageBodyContent-CAy2uoxy.js";import"./search-scope-B5-OK3Cq.js";import"./MailListHeader-p1q7jsyl.js";import"./roving-focus-DxibL2s7.js";import"./search-token-index-CbMoDJvO.js";import"./useQueries-0wkiftqA.js";import"./popover-menu-RTTJnmds.js";import"./mail-Be_WuC_w.js";import"./avatar-BZB5Hlpq.js";import"./index-CSyKycBp.js";import"./useSignature-CWPSLmMO.js";import"./account-form-helpers-DhckT_PN.js";import"./useDebouncedValue-DBZDUjAb.js";import"./sections-D-5U_zIy.js";import"./EmptyState-B3OfXxGc.js";import"./ErrorState-BMamrpRe.js";import"./undo-2-C9sVZCD4.js";import"./download-Cfm8O5nH.js";import"./calendar-suggestion-BXJh4QEG.js";import"./calendar-format-DsR-4j-9.js";import"./useCalendars-6Gx83pIc.js";import"./calendar-report-Becs8mIN.js";import"./attendee-row-DUsYrdln.js";import"./minus-DbGv0Sob.js";import"./clock-gr-cmcGz.js";import"./calendar-clash-strip-6sedBGkk.js";import"./bell-off-DwXjf1FL.js";import"./copy-8ycixQYh.js";import"./shield-check-BR1Itb39.js";import"./useFilters-B1O1c8J0.js";import"./checkbox-BeWcYpqA.js";import"./confirm-dialog-GyEqvQcg.js";import"./useLayoutTier-B0CJkqKe.js";import"./menu-DHbVKrar.js";import"./MailViewChrome-B80rNMML.js";import"./refresh-cw-DEjJXAwL.js";import"./wizard-selection-DxUM65kM.js";function Q(){return o.jsx(r.Reading,{})}export{Q as component};
|
package/assets/index-BjFEbYZ3.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as o}from"./index-BNAV6NNi.js";import{M as r}from"./MailboxPane-M52fsGFN.js";import"./useSearchTokenContext-AypRRqG2.js";import"./kbd-tyVb1kmX.js";import"./useMessageBodyContent-CAy2uoxy.js";import"./search-scope-B5-OK3Cq.js";import"./useRefreshControl-VAzesut8.js";import"./circle-check-big-B39GqMyR.js";import"./refresh-cw-DEjJXAwL.js";import"./useQueries-0wkiftqA.js";import"./MailListHeader-p1q7jsyl.js";import"./roving-focus-DxibL2s7.js";import"./search-token-index-CbMoDJvO.js";import"./popover-menu-RTTJnmds.js";import"./mail-Be_WuC_w.js";import"./avatar-BZB5Hlpq.js";import"./index-CSyKycBp.js";import"./useSignature-CWPSLmMO.js";import"./account-form-helpers-DhckT_PN.js";import"./useDebouncedValue-DBZDUjAb.js";import"./sections-D-5U_zIy.js";import"./EmptyState-B3OfXxGc.js";import"./ErrorState-BMamrpRe.js";import"./undo-2-C9sVZCD4.js";import"./download-Cfm8O5nH.js";import"./calendar-suggestion-BXJh4QEG.js";import"./calendar-format-DsR-4j-9.js";import"./useCalendars-6Gx83pIc.js";import"./calendar-report-Becs8mIN.js";import"./attendee-row-DUsYrdln.js";import"./minus-DbGv0Sob.js";import"./clock-gr-cmcGz.js";import"./calendar-clash-strip-6sedBGkk.js";import"./bell-off-DwXjf1FL.js";import"./copy-8ycixQYh.js";import"./shield-check-BR1Itb39.js";import"./useFilters-B1O1c8J0.js";import"./checkbox-BeWcYpqA.js";import"./confirm-dialog-GyEqvQcg.js";import"./useLayoutTier-B0CJkqKe.js";import"./menu-DHbVKrar.js";import"./MailViewChrome-B80rNMML.js";import"./NavMenuButton-D50RaMZU.js";import"./useLabels-CqJaWt3E.js";import"./useSemanticSearch-DLp4ptAj.js";import"./search-query-Cr_ZXBCp.js";import"./bottom-sheet-nV19J7QD.js";import"./circle-help-DRIXmYoN.js";import"./circle-check-D-kPomlF.js";function Z(){return o.jsx(r.Reading,{})}export{Z as component};
|
package/assets/index-BxwJ1oiy.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as r}from"./index-BNAV6NNi.js";import{B as o}from"./BriefPane-8DVHJA2P.js";import"./useSearchTokenContext-AypRRqG2.js";import"./kbd-tyVb1kmX.js";import"./useMessageBodyContent-CAy2uoxy.js";import"./search-scope-B5-OK3Cq.js";import"./MailListHeader-p1q7jsyl.js";import"./roving-focus-DxibL2s7.js";import"./search-token-index-CbMoDJvO.js";import"./useQueries-0wkiftqA.js";import"./popover-menu-RTTJnmds.js";import"./mail-Be_WuC_w.js";import"./avatar-BZB5Hlpq.js";import"./index-CSyKycBp.js";import"./useSignature-CWPSLmMO.js";import"./account-form-helpers-DhckT_PN.js";import"./useDebouncedValue-DBZDUjAb.js";import"./sections-D-5U_zIy.js";import"./EmptyState-B3OfXxGc.js";import"./ErrorState-BMamrpRe.js";import"./undo-2-C9sVZCD4.js";import"./download-Cfm8O5nH.js";import"./calendar-suggestion-BXJh4QEG.js";import"./calendar-format-DsR-4j-9.js";import"./useCalendars-6Gx83pIc.js";import"./calendar-report-Becs8mIN.js";import"./attendee-row-DUsYrdln.js";import"./minus-DbGv0Sob.js";import"./clock-gr-cmcGz.js";import"./calendar-clash-strip-6sedBGkk.js";import"./bell-off-DwXjf1FL.js";import"./copy-8ycixQYh.js";import"./shield-check-BR1Itb39.js";import"./useFilters-B1O1c8J0.js";import"./checkbox-BeWcYpqA.js";import"./confirm-dialog-GyEqvQcg.js";import"./useLayoutTier-B0CJkqKe.js";import"./menu-DHbVKrar.js";import"./useRefreshControl-VAzesut8.js";import"./circle-check-big-B39GqMyR.js";import"./refresh-cw-DEjJXAwL.js";import"./useSemanticSearch-DLp4ptAj.js";import"./useLabels-CqJaWt3E.js";import"./search-query-Cr_ZXBCp.js";import"./wizard-selection-DxUM65kM.js";function V(){return r.jsx(o.Reading,{})}export{V as component};
|