@remit/web-client-dist 0.0.322 → 0.0.324
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-DezRv9-w.js → BriefPane-DL_dX2hD.js} +1 -1
- package/assets/{ErrorState-jd3sUtw2.js → ErrorState-D475ZmnW.js} +1 -1
- package/assets/{FlaggedPane-BgXdB7fI.js → FlaggedPane-BVLRbiSx.js} +1 -1
- package/assets/{MailListHeader-BOYr_Fx1.js → MailListHeader-C9wj024y.js} +6 -6
- package/assets/{MailViewChrome-BXIDTmDB.js → MailViewChrome-BbPVsgkA.js} +1 -1
- package/assets/{MailboxPane-CSGgyJPw.js → MailboxPane-BxcFua3V.js} +1 -1
- package/assets/{NavMenuButton-D1uGMYR-.js → NavMenuButton-jHcm8vfZ.js} +1 -1
- package/assets/{OnboardingWizard-3dJlW04p.js → OnboardingWizard-5e-Jbm_d.js} +1 -1
- package/assets/OutboxPane-BYMmHEVx.js +1 -0
- package/assets/_mailboxId-QM6wK6lu.js +1 -0
- package/assets/_messageId-qDl7dOGW.js +1 -0
- package/assets/_outboxMessageId-iQ5-XecM.js +1 -0
- package/assets/_threadId-DxeTBXZj.js +1 -0
- package/assets/{account-form-helpers-Cku237WR.js → account-form-helpers-CcGKmwNo.js} +1 -1
- package/assets/{accounts-CU5kUkm3.js → accounts-B63o2ILX.js} +1 -1
- package/assets/{advanced-hXmT8qLX.js → advanced-C7Ukhd8Y.js} +1 -1
- package/assets/{appearance-DJTClN8w.js → appearance-DqT05V6b.js} +1 -1
- package/assets/{avatar-4b13Sges.js → avatar-DdJbookK.js} +1 -1
- package/assets/{bottom-sheet-C3JBOSmc.js → bottom-sheet-cDZH6e9F.js} +1 -1
- package/assets/brief-BrK0nniY.js +1 -0
- package/assets/{brief-DQPJM7OE.js → brief-zjptLhSQ.js} +1 -1
- package/assets/{browser-ponyfill-DmploGtW.js → browser-ponyfill-B_dFgQ2w.js} +1 -1
- package/assets/{circle-check-C-7XlClB.js → circle-check-UNJJb11g.js} +1 -1
- package/assets/{circle-check-big-BobfkM_J.js → circle-check-big-DH3iP9sG.js} +1 -1
- package/assets/{circle-help-B6RKeBQK.js → circle-help-BTvpgH50.js} +1 -1
- package/assets/{clock-BUUHl7WR.js → clock-BmHk7UCJ.js} +1 -1
- package/assets/{confirm-dialog-Cv7dfJpV.js → confirm-dialog-CuFS4VZc.js} +1 -1
- package/assets/{download-D3GqdQOq.js → download-BaUix46z.js} +1 -1
- package/assets/{filters-BC4W3kpG.js → filters-CK8qlYLT.js} +1 -1
- package/assets/{flagged-BzD4EfLb.js → flagged-BQZ7wYZM.js} +1 -1
- package/assets/flagged-B_Vv3pKi.js +1 -0
- package/assets/{folders-CENuTc1Y.js → folders-DXl5KdxR.js} +1 -1
- package/assets/index-AqW6UMG_.js +1 -0
- package/assets/index-B3S02Qux.js +1 -0
- package/assets/{index-BvAPtXhR.js → index-CJnB8f3k.js} +58 -58
- package/assets/index-DaxvMafC.js +1 -0
- package/assets/index-DzjwtnHo.js +1 -0
- package/assets/index-NL2-w7re.js +1 -0
- package/assets/index-qDl7dOGW.js +1 -0
- package/assets/{kbd-B_dXE-g6.js → kbd-CaPCJ6kw.js} +1 -1
- package/assets/{labels-DwtAhy6A.js → labels-B-Y5h1qN.js} +1 -1
- package/assets/mail-CkOH6e4d.js +1 -0
- package/assets/{menu-CtxXDmfA.js → menu-fPT37kSH.js} +1 -1
- package/assets/{move-options-DoOvwIBJ.js → move-options-CoyjCaBu.js} +1 -1
- package/assets/nav-link-DNUfNst6.js +1 -0
- package/assets/{onboarding-DjrlkbvU.js → onboarding-BRxQhT4c.js} +1 -1
- package/assets/outbox-CXGpzDAb.js +1 -0
- package/assets/{pencil-BWiEkJDV.js → pencil-B7n34zlT.js} +1 -1
- package/assets/{rich-text-BjPEBAWr.js → rich-text-D0kC56sS.js} +2 -2
- package/assets/{rotate-ccw-Dh4JFwXs.js → rotate-ccw-Dxvks-Fa.js} +1 -1
- package/assets/{row-actions-Cvyykro8.js → row-actions-CCoOsKI0.js} +1 -1
- package/assets/{search-scope-Ckwa5VkC.js → search-scope-YZoKowSP.js} +1 -1
- package/assets/search-token-index-DecN3tuj.js +1 -0
- package/assets/{search-view-DXuisrUv.js → search-view-BT2iNrko.js} +1 -1
- package/assets/{senders-EtXn1WFX.js → senders-DGft74el.js} +1 -1
- package/assets/settings-CaxtfSrL.js +1 -0
- package/assets/{settings-screen-CSEcljVe.js → settings-screen-C1bOf6b4.js} +1 -1
- package/assets/{shield-check-Cn8BIwb9.js → shield-check-Dtx-C_MX.js} +1 -1
- package/assets/{suggested-vips-CGuDO6eu.js → suggested-vips-DZp292iM.js} +1 -1
- package/assets/{useDebouncedValue-BHLEjbFG.js → useDebouncedValue-BSOGglNm.js} +1 -1
- package/assets/{useFilters-BoZ6Fc_g.js → useFilters-D45aWbCk.js} +1 -1
- package/assets/{useLabels-BMQ04w-1.js → useLabels-HGxt9ahb.js} +1 -1
- package/assets/{useMediaQuery-WUMWXwuZ.js → useMediaQuery-CyTmCzY8.js} +1 -1
- package/assets/{useRefreshControl-6DemzxWn.js → useRefreshControl-Da3yPTgP.js} +1 -1
- package/assets/{useSearchMirror-Bxz_MBiG.js → useSearchMirror-2jg6tvic.js} +1 -1
- package/assets/{useSearchTokenContext-Ca1mZv-e.js → useSearchTokenContext-CwRxhOKm.js} +2 -2
- package/assets/{useSemanticSearch-D1X6-Yo0.js → useSemanticSearch-DrT4OjKH.js} +1 -1
- package/assets/{useSignature-CVAEV1or.js → useSignature-DY1xfitb.js} +1 -1
- package/index.html +1 -1
- package/package.json +1 -1
- package/assets/OutboxPane-B6gtUtio.js +0 -1
- package/assets/_mailboxId-CdAgtOlI.js +0 -1
- package/assets/_messageId-6lPAdp0m.js +0 -1
- package/assets/_threadId-BrqBXqAP.js +0 -1
- package/assets/brief-CpgXwwJY.js +0 -1
- package/assets/flagged-BWq-bDju.js +0 -1
- package/assets/index-5mN-PDkZ.js +0 -1
- package/assets/index-6lPAdp0m.js +0 -1
- package/assets/index-7FGoKqZt.js +0 -1
- package/assets/index-BWxakx7D.js +0 -1
- package/assets/index-BdbY0XUZ.js +0 -1
- package/assets/index-U8NZZ6qQ.js +0 -1
- package/assets/mail-c3oo-7Wz.js +0 -1
- package/assets/outbox-BCTQBKu0.js +0 -1
- package/assets/search-token-index-BRBf_vfX.js +0 -1
- package/assets/settings-D2gTt9bY.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as o}from"./index-CJnB8f3k.js";import{F as r}from"./FlaggedPane-BVLRbiSx.js";import"./useSearchTokenContext-CwRxhOKm.js";import"./kbd-CaPCJ6kw.js";import"./enums-CCxx0t2v.js";import"./search-scope-YZoKowSP.js";import"./MailListHeader-C9wj024y.js";import"./search-token-index-DecN3tuj.js";import"./useMediaQuery-CyTmCzY8.js";import"./account-form-helpers-CcGKmwNo.js";import"./avatar-DdJbookK.js";import"./useSignature-DY1xfitb.js";import"./useDebouncedValue-BSOGglNm.js";import"./ErrorState-D475ZmnW.js";import"./format-De9HZKjg.js";import"./download-BaUix46z.js";import"./shield-check-Dtx-C_MX.js";import"./nav-link-DNUfNst6.js";import"./move-options-CoyjCaBu.js";import"./useFilters-D45aWbCk.js";import"./confirm-dialog-CuFS4VZc.js";import"./clock-BmHk7UCJ.js";import"./menu-fPT37kSH.js";import"./MailViewChrome-BbPVsgkA.js";function v(){return o.jsx(r.Reading,{})}export{v as component};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as o}from"./index-CJnB8f3k.js";import{M as i}from"./MailboxPane-BxcFua3V.js";import"./useSearchTokenContext-CwRxhOKm.js";import"./kbd-CaPCJ6kw.js";import"./enums-CCxx0t2v.js";import"./search-scope-YZoKowSP.js";import"./useRefreshControl-Da3yPTgP.js";import"./circle-check-big-DH3iP9sG.js";import"./search-token-index-DecN3tuj.js";import"./useMediaQuery-CyTmCzY8.js";import"./MailListHeader-C9wj024y.js";import"./account-form-helpers-CcGKmwNo.js";import"./avatar-DdJbookK.js";import"./useSignature-DY1xfitb.js";import"./useDebouncedValue-BSOGglNm.js";import"./ErrorState-D475ZmnW.js";import"./format-De9HZKjg.js";import"./download-BaUix46z.js";import"./shield-check-Dtx-C_MX.js";import"./nav-link-DNUfNst6.js";import"./move-options-CoyjCaBu.js";import"./useFilters-D45aWbCk.js";import"./confirm-dialog-CuFS4VZc.js";import"./clock-BmHk7UCJ.js";import"./menu-fPT37kSH.js";import"./MailViewChrome-BbPVsgkA.js";import"./NavMenuButton-jHcm8vfZ.js";import"./useLabels-HGxt9ahb.js";import"./useSemanticSearch-DrT4OjKH.js";import"./search-query-Cr_ZXBCp.js";import"./bottom-sheet-cDZH6e9F.js";import"./circle-help-BTvpgH50.js";import"./circle-check-UNJJb11g.js";import"./intelligence-pref-C6lFpj6U.js";function H(){return o.jsx(i.Reading,{})}export{H as component};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as o}from"./index-CJnB8f3k.js";import{O as t}from"./OutboxPane-BYMmHEVx.js";import"./useSearchTokenContext-CwRxhOKm.js";import"./kbd-CaPCJ6kw.js";import"./enums-CCxx0t2v.js";import"./search-scope-YZoKowSP.js";import"./circle-check-big-DH3iP9sG.js";import"./clock-BmHk7UCJ.js";import"./row-actions-CCoOsKI0.js";import"./rotate-ccw-Dxvks-Fa.js";import"./NavMenuButton-jHcm8vfZ.js";import"./menu-fPT37kSH.js";import"./format-De9HZKjg.js";import"./outbox-status-CPfNHfUQ.js";import"./search-query-Cr_ZXBCp.js";function c(){return o.jsx(t.Reading,{})}export{c as component};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as r}from"./index-CJnB8f3k.js";import{B as o}from"./BriefPane-DL_dX2hD.js";import"./useSearchTokenContext-CwRxhOKm.js";import"./kbd-CaPCJ6kw.js";import"./enums-CCxx0t2v.js";import"./search-scope-YZoKowSP.js";import"./MailListHeader-C9wj024y.js";import"./search-token-index-DecN3tuj.js";import"./useMediaQuery-CyTmCzY8.js";import"./account-form-helpers-CcGKmwNo.js";import"./avatar-DdJbookK.js";import"./useSignature-DY1xfitb.js";import"./useDebouncedValue-BSOGglNm.js";import"./ErrorState-D475ZmnW.js";import"./format-De9HZKjg.js";import"./download-BaUix46z.js";import"./shield-check-Dtx-C_MX.js";import"./nav-link-DNUfNst6.js";import"./move-options-CoyjCaBu.js";import"./useFilters-D45aWbCk.js";import"./confirm-dialog-CuFS4VZc.js";import"./clock-BmHk7UCJ.js";import"./menu-fPT37kSH.js";import"./useRefreshControl-Da3yPTgP.js";import"./circle-check-big-DH3iP9sG.js";import"./useLabels-HGxt9ahb.js";import"./useSemanticSearch-DrT4OjKH.js";import"./search-query-Cr_ZXBCp.js";function z(){return r.jsx(o.Reading,{})}export{z as component};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as s,b as t}from"./index-
|
|
1
|
+
import{j as s,b as t}from"./index-CJnB8f3k.js";function x({className:e,...n}){return s.jsx("kbd",{className:t("inline-flex h-4 min-w-4 items-center justify-center rounded-xs border border-line bg-surface-sunken px-1 font-sans text-2xs text-fg-muted",e),...n})}export{x as K};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as x,j as e,aj as h,aT as y,ai as b,b5 as g,B as v,T as N,o as C,w as L,W as I,ax as D,aB as S,ay as w}from"./index-
|
|
1
|
+
import{r as x,j as e,aj as h,aT as y,ai as b,b5 as g,B as v,T as N,o as C,w as L,W as I,ax as D,aB as S,ay as w}from"./index-CJnB8f3k.js";import{C as E}from"./confirm-dialog-CuFS4VZc.js";import{S as T}from"./settings-screen-C1bOf6b4.js";import{E as j}from"./ErrorState-D475ZmnW.js";import{a as $,b as k,c as R,u as B}from"./useLabels-HGxt9ahb.js";import"./avatar-DdJbookK.js";import"./menu-fPT37kSH.js";import"./circle-help-BTvpgH50.js";function O({labels:l,onRename:i,onRecolor:n,onDelete:m,deletingLabelId:c}){const[u,r]=x.useState(),[o,d]=x.useState("");if(l.length===0)return e.jsx("p",{className:"py-6 text-sm text-fg-muted",children:"No labels yet. Create one below, then use it in a filter or apply it to mail directly."});const t=a=>{const s=o.trim();s!==""&&i(a,s),r(void 0)};return e.jsx("ul",{className:"divide-y divide-line rounded-md border border-line",children:l.map(a=>e.jsxs("li",{className:"flex items-center gap-3 px-3 py-2.5",children:[e.jsxs("div",{className:"min-w-0 flex-1",children:[u===a.labelId?e.jsx(h,{autoFocus:!0,value:o,onChange:s=>d(s.target.value),onBlur:()=>t(a.labelId),onKeyDown:s=>{s.key==="Enter"&&(s.preventDefault(),t(a.labelId)),s.key==="Escape"&&(s.preventDefault(),r(void 0))},"aria-label":`Rename label ${a.name}`}):e.jsx("button",{type:"button",onClick:()=>{r(a.labelId),d(a.name)},"aria-label":`Rename label ${a.name}`,className:"flex items-center gap-2 rounded-sm text-left hover:opacity-80",children:e.jsx(y,{label:a})}),e.jsx("p",{className:"mt-0.5 text-xs text-fg-subtle",children:a.filterCount===0?"Not used in any filter":`Used in ${a.filterCount} ${a.filterCount===1?"filter":"filters"}`})]}),e.jsx(b,{"aria-label":`Color for ${a.name}`,value:a.color,onChange:s=>n(a.labelId,s.target.value),className:"w-28 shrink-0",children:g.map(s=>e.jsx("option",{value:s,children:s},s))}),e.jsx(v,{variant:"ghost",size:"sm",icon:e.jsx(N,{className:"size-4 text-danger"}),onClick:()=>m(a),disabled:c===a.labelId,"aria-label":`Delete label ${a.name}`})]},a.labelId))})}const P=(l,i)=>{if(i===0)return{title:`Delete the "${l}" label?`};const n=i===1?"filter":"filters";return{title:`Delete the "${l}" label?`,description:`This also deletes ${i} ${n} that ${i===1?"applies":"apply"} it — they can't be recovered.`}},_=e.jsxs("div",{className:"space-y-3",children:[e.jsx("p",{children:"Labels mark mail without moving it — a message can carry any number of them alongside whichever folder it lives in."}),e.jsx("p",{children:"Use a label in a filter's action to have new (and existing) mail label itself automatically, or apply one to a selection directly from the mailbox."}),e.jsx("p",{children:"Deleting a label removes it from every message, and deletes every filter that applies it — the confirmation names how many."})]});function H({accountId:l}){const{createLabel:i,isPending:n,isError:m}=B(l),[c,u]=x.useState(""),[r,o]=x.useState("Default"),d=()=>{const t=c.trim();t!==""&&i(t,r).then(()=>{u(""),o("Default")})};return e.jsxs("div",{className:"space-y-2 rounded-sm border border-line bg-surface p-3",children:[e.jsx("p",{className:"text-sm font-medium text-fg",children:"New label"}),e.jsxs("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-end",children:[e.jsxs("div",{className:"flex-1 space-y-1",children:[e.jsx("span",{className:"text-xs text-fg-muted",children:"Name"}),e.jsx(h,{value:c,onChange:t=>u(t.target.value),placeholder:"e.g. Receipts","aria-label":"Label name",onKeyDown:t=>{t.key==="Enter"&&(t.preventDefault(),d())}})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("span",{className:"text-xs text-fg-muted",children:"Color"}),e.jsx(b,{value:r,onChange:t=>o(t.target.value),"aria-label":"Label color",className:"w-28",children:g.map(t=>e.jsx("option",{value:t,children:t},t))})]}),e.jsx(v,{variant:"primary",onClick:d,disabled:n||c.trim()==="",children:n?"Creating…":"Create label"})]}),m&&e.jsx(w,{tone:"danger",variant:"soft",children:"Couldn't create that label. Please try again."})]})}function A({account:l}){const i=l.accountId,{labels:n,isPending:m,isError:c,error:u,refetch:r}=$(i),{updateLabel:o}=k(i),{deleteLabel:d,deletingLabelId:t}=R(i),[a,s]=x.useState();return e.jsxs("section",{className:"space-y-2",children:[e.jsx("h2",{className:"text-sm font-semibold text-fg",children:l.email}),m?e.jsx("div",{className:"h-16 animate-pulse rounded-md border border-line bg-surface","aria-busy":"true","aria-label":`Loading labels for ${l.email}`}):c?e.jsx(j,{variant:"inline",title:`Couldn't load labels for ${l.email}`,error:u,onRetry:()=>{r()}}):e.jsx(O,{labels:n,onRename:(p,f)=>o(p,{name:f}),onRecolor:(p,f)=>o(p,{color:f}),onDelete:s,deletingLabelId:t}),e.jsx(H,{accountId:i}),a&&(()=>{const p=P(a.name,a.filterCount);return e.jsx(E,{isOpen:!0,title:p.title,description:p.description,confirmLabel:"Delete label",destructive:!0,isBusy:t===a.labelId,onConfirm:()=>{d(a.labelId),s(void 0)},onCancel:()=>s(void 0)})})()]})}function W(){const l=C(),[i,n]=x.useState(!0),{data:m,isPending:c,isError:u,error:r,refetch:o}=L(I()),d=t=>{const a=S[t];a&&l({to:a})};return e.jsx(T,{items:D,activeId:"labels",title:"Labels",description:"Mark mail without moving it, per account.",help:_,helpOpen:i,onToggleHelp:()=>n(t=>!t),onSelect:d,onBackToMail:()=>{l({to:"/mail"})},children:c?e.jsx("div",{className:"h-24 animate-pulse rounded-sm border border-line bg-surface","aria-busy":"true","aria-label":"Loading accounts"}):u?e.jsx(j,{title:"Couldn't load accounts",error:r,onRetry:()=>{o()}}):m.accounts.length===0?e.jsx("p",{className:"py-12 text-sm text-fg-muted",children:"No accounts configured."}):e.jsx("div",{className:"space-y-8",children:m.accounts.map(t=>e.jsx(A,{account:t},t.accountId))})})}export{W as component};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as L,r as i,u as Le,j as e,S as Fe,a as pe,b as I,C as ee,d as te,e as Te,f as ge,F as De,g as Be,X as be,T as _e,O as Ke,M as Ve,A as qe,h as Qe,I as He,i as ve,B as D,k as U,l as ye,m as $e,n as je,o as Y,p as Se,q as Ne,s as We,t as G,v as J,w as Ce,x as Ue,y as Ye,z as Ge,D as $,E as Je,G as Xe,H as Ze,J as et,K as tt,L as st,N as at,P as nt,Q as rt,R as ot,U as it,V as lt,W as ct,Y as ut,Z as dt,_ as mt}from"./index-CJnB8f3k.js";import{B as xt,S as ht,D as ft,a as pt,b as gt,u as bt,s as vt,K as yt,c as jt,d as St,e as Nt,f as Ct,g as kt,i as wt}from"./search-token-index-DecN3tuj.js";import{l as It,u as se,m as Mt}from"./search-scope-YZoKowSP.js";import{P as Et}from"./pencil-B7n34zlT.js";import{M as Ot,s as Rt,c as At}from"./search-view-BT2iNrko.js";import{u as Pt,a as zt,R as Lt,M as Ft}from"./useRefreshControl-Da3yPTgP.js";import{M as Tt}from"./menu-fPT37kSH.js";import{A as Dt}from"./avatar-DdJbookK.js";import{i as Bt}from"./outbox-status-CPfNHfUQ.js";import{N as P}from"./nav-link-DNUfNst6.js";import{E as _t}from"./ErrorState-D475ZmnW.js";import{K as ae}from"./kbd-CaPCJ6kw.js";import{u as Kt}from"./useDebouncedValue-BSOGglNm.js";import{w as ne}from"./intelligence-pref-C6lFpj6U.js";import"./useMediaQuery-CyTmCzY8.js";import"./circle-check-big-DH3iP9sG.js";const Vt=L("BookmarkPlus",[["path",{d:"m19 21-7-4-7 4V5a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2v16z",key:"1fy3hk"}],["line",{x1:"12",x2:"12",y1:"7",y2:"13",key:"1cppfj"}],["line",{x1:"15",x2:"9",y1:"10",y2:"10",key:"1gty7f"}]]);const ke=L("Bug",[["path",{d:"m8 2 1.88 1.88",key:"fmnt4t"}],["path",{d:"M14.12 3.88 16 2",key:"qol33r"}],["path",{d:"M9 7.13v-1a3.003 3.003 0 1 1 6 0v1",key:"d7y7pr"}],["path",{d:"M12 20c-3.3 0-6-2.7-6-6v-3a4 4 0 0 1 4-4h4a4 4 0 0 1 4 4v3c0 3.3-2.7 6-6 6",key:"xs1cw7"}],["path",{d:"M12 20v-9",key:"1qisl0"}],["path",{d:"M6.53 9C4.6 8.8 3 7.1 3 5",key:"32zzws"}],["path",{d:"M6 13H2",key:"82j7cp"}],["path",{d:"M3 21c0-2.1 1.7-3.9 3.8-4",key:"4p0ekp"}],["path",{d:"M20.97 5c0 2.1-1.6 3.8-3.5 4",key:"18gb23"}],["path",{d:"M22 13h-4",key:"1jl80f"}],["path",{d:"M17.2 17c2.1.1 3.8 1.9 3.8 4",key:"k3fwyw"}]]);const we=L("LogOut",[["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}],["polyline",{points:"16 17 21 12 16 7",key:"1gabdz"}],["line",{x1:"21",x2:"9",y1:"12",y2:"12",key:"1uyos4"}]]);const Ie=L("Settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);const qt=L("SquarePen",[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z",key:"ohrbg2"}]]),Qt="button:not([disabled]), a[href]",O="outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-surface-sunken";function Ht({active:t,dimmed:s,indent:a}){return I("flex w-full items-center gap-2 rounded-md px-2 py-1 text-left text-sm transition-colors",O,a&&"pl-7",t?"bg-accent-2-soft font-medium text-accent-2":"text-fg-muted hover:bg-surface hover:text-fg",s&&"opacity-55")}function $t({icon:t,label:s,count:a,active:n}){return e.jsxs(e.Fragment,{children:[t&&e.jsx("span",{className:I("shrink-0",n?"text-accent-2":"text-fg-subtle"),children:t}),e.jsx("span",{className:"flex-1 truncate",children:s}),a!=null&&a>0&&e.jsx("span",{className:I("text-2xs tabular-nums",n?"text-accent-2":"text-fg-subtle"),children:a})]})}function z({icon:t,label:s,count:a,active:n,dimmed:r,indent:o,navId:l,linkComponent:m,ariaLabel:x,title:p,onClick:b}){const u=Ht({active:n,dimmed:r,indent:o}),h=e.jsx($t,{icon:t,label:s,count:a,active:n});return l&&m?m({navId:l,className:u,ariaLabel:x??s,title:p,onClick:b,children:h}):e.jsx("button",{type:"button",onClick:b,className:u,"aria-label":x,title:p,children:h})}const re={inbox:0,flagged:1,drafts:2,sent:3,archive:4,all:5,junk:6,trash:7};function Wt(t){switch(t){case"inbox":return e.jsx(He,{className:"size-4"});case"flagged":return e.jsx(pe,{className:"size-4"});case"drafts":return e.jsx(Qe,{className:"size-4"});case"sent":return e.jsx(ge,{className:"size-4"});case"archive":return e.jsx(qe,{className:"size-4"});case"all":return e.jsx(Ve,{className:"size-4"});case"junk":return e.jsx(Ke,{className:"size-4"});case"trash":return e.jsx(_e,{className:"size-4"})}}const oe=t=>t.role!=null,H=8,ie="remit.nav.folders.open.",le="remit.nav.account.open.";function ce(t,s,a){if(typeof localStorage>"u")return a;const n=localStorage.getItem(t+s);return n===null?a:n!=="0"}function ue(t,s,a){typeof localStorage>"u"||localStorage.setItem(t+s,a?"1":"0")}function Ut({query:t,onSelect:s,onRemove:a}){return e.jsxs("div",{className:"group flex w-full items-center gap-1 rounded-md pr-1 hover:bg-surface",children:[e.jsxs("button",{type:"button",onClick:s,className:I("flex min-w-0 flex-1 items-center gap-2 px-2 py-1 text-left text-sm text-fg-muted transition-colors hover:text-fg",O),children:[e.jsx(Be,{className:"size-4 shrink-0 text-fg-subtle"}),e.jsx("span",{className:"min-w-0 flex-1 truncate",children:t})]}),a&&e.jsx("button",{type:"button",onClick:a,"aria-label":`Remove saved search: ${t}`,className:I("shrink-0 rounded-full p-1 text-fg-subtle opacity-0 transition-opacity hover:bg-surface-sunken hover:text-fg group-hover:opacity-100 focus-visible:opacity-100",O),children:e.jsx(be,{className:"size-3.5"})})]})}function Yt({savedSearches:t,saveableQuery:s,onSelectSavedSearch:a,onRemoveSavedSearch:n,onSaveCurrentSearch:r}){return t.length===0&&!s?null:e.jsxs("div",{className:"mt-3",children:[e.jsx("div",{className:"px-2 pb-1 text-2xs font-semibold uppercase tracking-wider text-fg-subtle",children:"Saved searches"}),s&&e.jsxs("button",{type:"button",onClick:r,className:I("flex w-full items-center gap-2 rounded-md px-2 py-1 text-left text-sm text-accent transition-colors hover:bg-surface",O),children:[e.jsx(Vt,{className:"size-4 shrink-0"}),e.jsxs("span",{className:"min-w-0 flex-1 truncate",children:["Save “",s,"”"]})]}),t.map(o=>e.jsx(Ut,{query:o,onSelect:()=>a?.(o),onRemove:n?()=>n(o):void 0},o))]})}function Gt({account:t,selectedNavId:s,onSelectNav:a,linkComponent:n}){const[r,o]=i.useState(()=>ce(le,t.id,!0)),[l,m]=i.useState(()=>ce(ie,t.id,!0)),[x,p]=i.useState(!1),b=()=>{o(c=>{const y=!c;return ue(le,t.id,y),y})},u=()=>{m(c=>{const y=!c;return ue(ie,t.id,y),y})},h=t.mailboxes.filter(oe).sort((c,y)=>re[c.role]-re[y.role]),f=t.mailboxes.filter(c=>!oe(c)),v=x||f.length<=H?f:f.slice(0,H),k=f.length-v.length,g=t.status??"ready",R=g==="ready"&&h.length===0&&f.length===0;return e.jsxs("div",{className:"mt-3",children:[e.jsxs("button",{type:"button",onClick:b,"aria-expanded":r,className:I("flex w-full items-center gap-1.5 px-2 pb-1 text-left transition-colors hover:text-fg",O,t.muted&&"opacity-55"),children:[r?e.jsx(ee,{className:"size-3 shrink-0 text-fg-subtle"}):e.jsx(te,{className:"size-3 shrink-0 text-fg-subtle"}),e.jsx("span",{className:"truncate text-2xs font-semibold uppercase tracking-wider text-fg-subtle",children:t.label}),t.muted&&e.jsxs(e.Fragment,{children:[e.jsx(xt,{className:"size-3 shrink-0 text-fg-subtle"}),e.jsx("span",{className:"text-2xs text-fg-subtle",children:"muted"})]})]}),r&&e.jsxs(e.Fragment,{children:[g==="loading"&&e.jsx("div",{className:"px-2 py-1 text-sm text-fg-muted",children:"Loading…"}),g==="error"&&e.jsxs("div",{role:"alert",className:"mx-2 my-1 flex items-start gap-2 rounded-md border border-danger/40 bg-danger-soft px-2 py-1.5 text-sm",children:[e.jsx(Te,{className:"mt-0.5 size-4 shrink-0 text-danger","aria-hidden":"true"}),e.jsx("div",{className:"min-w-0 flex-1",children:e.jsx("p",{className:"font-medium text-danger",children:"Couldn't load mailboxes"})}),t.onRetry&&e.jsx("button",{type:"button",onClick:t.onRetry,className:"shrink-0 text-sm font-medium text-accent hover:underline",children:"Retry"})]}),R&&e.jsx("div",{className:"px-2 py-1 text-sm text-fg-muted",children:"No mailboxes"}),g==="ready"&&e.jsxs(e.Fragment,{children:[h.map(c=>e.jsx(z,{navId:c.id,linkComponent:n,icon:Wt(c.role),label:c.name,ariaLabel:c.name,title:c.fullPath??c.name,count:c.unseen,active:s===c.id,dimmed:t.muted,onClick:()=>a?.(c.id)},c.id)),t.outboxPending!==void 0&&e.jsx(z,{navId:"outbox",linkComponent:n,icon:e.jsx(ge,{className:"size-4"}),label:"Outbox",ariaLabel:"Outbox",count:t.outboxPending>0?t.outboxPending:void 0,active:s==="outbox",dimmed:t.muted,onClick:()=>a?.("outbox")}),f.length>0&&e.jsxs(e.Fragment,{children:[e.jsxs("button",{type:"button",onClick:u,"aria-expanded":l,className:I("mt-1 flex w-full items-center gap-1 px-2 py-1 text-left text-2xs font-semibold uppercase tracking-wider text-fg-subtle transition-colors hover:text-fg",O),children:[l?e.jsx(ee,{className:"size-3 shrink-0"}):e.jsx(te,{className:"size-3 shrink-0"}),e.jsx("span",{className:"flex-1",children:"Folders"}),e.jsx("span",{className:"tabular-nums opacity-70",children:f.length})]}),l&&e.jsxs(e.Fragment,{children:[v.map(c=>e.jsx(z,{navId:c.id,linkComponent:n,icon:e.jsx(De,{className:"size-4"}),label:c.name,ariaLabel:c.name,title:c.fullPath??c.name,count:c.unseen,active:s===c.id,dimmed:t.muted,onClick:()=>a?.(c.id)},c.id)),(k>0||x)&&f.length>H&&e.jsx("button",{type:"button",onClick:()=>p(c=>!c),className:I("ml-7 flex items-center px-2 py-1 text-2xs font-medium text-accent transition-colors hover:underline",O),children:x?"Show less":`Show all (${f.length})`})]})]})]})]})]})}function Jt({accounts:t,selectedNavId:s,briefUnseen:a,onSelectNav:n,variant:r="desktop",linkComponent:o,savedSearches:l=[],saveableQuery:m,onSelectSavedSearch:x,onRemoveSavedSearch:p,onSaveCurrentSearch:b}){const u=i.useRef(null);Le({containerRef:u,itemSelector:Qt});const h=r==="drawer",f=e.jsxs("nav",{ref:h?u:void 0,className:h?"px-2 py-2":"flex-1 overflow-y-auto px-2 py-2","aria-label":"Mailboxes",children:[e.jsx(z,{navId:"brief",linkComponent:o,icon:e.jsx(Fe,{className:"size-4"}),label:"Daily brief",ariaLabel:"Daily brief",count:a,active:s==="brief",onClick:()=>n?.("brief")}),e.jsx(z,{navId:"flagged",linkComponent:o,icon:e.jsx(pe,{className:"size-4"}),label:"Starred",ariaLabel:"Starred",active:s==="flagged",onClick:()=>n?.("flagged")}),e.jsx(Yt,{savedSearches:l,saveableQuery:m,onSelectSavedSearch:x,onRemoveSavedSearch:p,onSaveCurrentSearch:b}),t.length===0?e.jsx("div",{className:"px-2 py-4 text-center text-sm text-fg-muted",children:"No accounts configured"}):t.map(v=>e.jsx(Gt,{account:v,selectedNavId:s,onSelectNav:n,linkComponent:o},v.id))]});return h?f:e.jsx("aside",{ref:u,className:"flex h-full w-full flex-col bg-surface-sunken",children:f})}function Xt({leading:t,search:s,actions:a,className:n}){return e.jsxs("header",{className:I("flex min-h-pane-header w-full shrink-0 items-center gap-2 border-b border-line bg-canvas px-row-inset py-1",n),children:[t&&e.jsx("div",{className:"flex shrink-0 items-center gap-1",children:t}),e.jsx("div",{className:"flex min-w-0 flex-1 justify-start",children:e.jsx("div",{className:"w-full max-w-xs transition-[max-width] duration-150 ease-out focus-within:max-w-lg",children:s})}),a&&e.jsx("div",{className:"flex shrink-0 items-center gap-1",children:a})]})}function Zt(){const t=ve();if(!t)return null;const s=t.showNavPane?!t.navCollapsed:!1;return e.jsx(D,{variant:"ghost",size:"sm",icon:e.jsx(Tt,{className:"size-4"}),onClick:t.toggleNav,"aria-label":s?"Hide folders":"Show folders","aria-expanded":s,title:"Folders",className:"shrink-0"})}const es={global:"Search all mail",pending:"Search mail",scoped:"Search this folder"};function ts({search:t,onCompose:s,onReportBug:a,onOpenSettings:n,composeShortcut:r,refreshControl:o,account:l}){return e.jsx(Xt,{leading:e.jsx(Zt,{}),search:e.jsx(ht,{value:t.value,onChange:t.onChange,onClear:t.onClear,onClearQuery:t.onClearQuery,chips:t.chips,onRemoveChip:t.onRemoveChip,placeholder:es[t.scope]}),actions:e.jsxs(e.Fragment,{children:[e.jsx(D,{variant:"ghost",size:"sm",icon:e.jsx(qt,{className:"size-4"}),title:r?`Compose (${r})`:"Compose","aria-label":"Compose",onClick:s}),e.jsx(D,{variant:"ghost",size:"sm",icon:e.jsx(ke,{className:"size-4"}),title:"Report a bug","aria-label":"Report a bug",onClick:a}),e.jsx(D,{variant:"ghost",size:"sm",icon:e.jsx(Ie,{className:"size-4"}),title:"Settings","aria-label":"Settings",onClick:n}),o,l]})})}const ss=()=>{const{state:t,openCompose:s}=U(),a=ye(),n=i.useCallback(()=>{s({mode:"new"})},[s]),o=!!a.search?.selectedMessageId||It(a.pathname);return!a.pathname.startsWith("/mail")||t.isOpen||o?null:e.jsx("button",{type:"button",onClick:n,"aria-label":"Compose new message",className:"lg:hidden fixed right-4 z-30 h-14 w-14 rounded-full bg-accent text-accent-fg shadow-lg flex items-center justify-center hover:opacity-90 active:scale-95 transition-all",style:{bottom:"calc(env(safe-area-inset-bottom, 0) + 1rem)"},children:e.jsx(Et,{className:"size-6"})})},Me=({children:t})=>{const{Account:s}=$e();return e.jsx(s,{children:t})},as=({email:t,onSignOut:s})=>{const a=t??"Account";return e.jsxs(ft,{trigger:e.jsx(Dt,{name:a,email:t??void 0,size:"sm"}),align:"right",children:[t&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"px-3 py-2 text-xs text-fg-muted truncate",title:t,"data-testid":"account-menu-email",children:t}),e.jsx(pt,{})]}),e.jsxs(gt,{onClick:s,children:[e.jsx(we,{className:"size-4"}),"Sign out"]})]})},ns=()=>e.jsx(Me,{children:({email:t,signOut:s})=>e.jsx(as,{email:t,onSignOut:s})});function rs({accounts:t}){const{searchInput:s,onSearchChange:a,onSearchClear:n,onSearchClearQuery:r}=je(),o=Y(),{openCompose:l}=U(),m=i.useCallback(()=>{l({mode:"new"})},[l]),{scope:x,clearScope:p}=bt(t),b=x.kind==="scoped"?[{id:x.chip.id,label:x.chip.label,tone:"scope"}]:void 0,u=i.useMemo(()=>t.map(g=>g.accountId),[t]),{hasNewMail:h}=Pt(),{state:f,errorMessage:v,refresh:k}=zt(u);return e.jsx(ts,{search:{value:s,scope:x.kind,chips:b,onChange:a,onClear:n,onClearQuery:r,onRemoveChip:p},onCompose:m,onReportBug:Se,onOpenSettings:()=>o({to:"/settings/accounts"}),composeShortcut:vt("compose"),refreshControl:e.jsx(Lt,{state:f,onRefresh:k,label:"Refresh all accounts",errorMessage:v,hasUpdate:h(u)}),account:e.jsx(ns,{})})}const X="remit.savedSearches",os=25;function _(){try{const t=localStorage.getItem(X);if(!t)return[];const s=JSON.parse(t);return Array.isArray(s)?s.filter(a=>typeof a=="string"):[]}catch{return[]}}function is(t){const s=t.trim();if(!s)return _();const a=[s,..._().filter(n=>n!==s)].slice(0,os);try{localStorage.setItem(X,JSON.stringify(a))}catch{return a}return a}function ls(t){const s=_().filter(a=>a!==t);try{localStorage.setItem(X,JSON.stringify(s))}catch{return s}return s}const de=t=>/^\d/.test(t),cs=(t,s)=>{const a=de(t),n=de(s);return a&&!n?-1:!a&&n?1:t.localeCompare(s,void 0,{sensitivity:"base",numeric:!0})};function us(t,s,a){const n=[],r=[];for(const o of t)s.has(o.mailboxId)?n.push(o):r.push(o);return r.sort((o,l)=>cs($(o,void 0,a),$(l,void 0,a))),{system:n,labels:r}}function ds(t,s,a){const n=Je(s)&&t.unseenCount>0;return{id:t.mailboxId,name:$(t,s,a),unseen:n?t.unseenCount:void 0,role:s,fullPath:t.fullPath}}function ms(){const t=ye(),s=Ge({strict:!1});return t.pathname.startsWith("/settings")?"settings":t.pathname.startsWith("/mail/outbox")?"outbox":t.pathname.startsWith("/mail/flagged")?"flagged":t.pathname.startsWith("/mail/brief")?"brief":s.mailboxId?s.mailboxId:""}function me({accounts:t,onMailboxSelect:s,variant:a="desktop"}){const n=Ne(),r=Y(),o=ms(),{searchInput:l,onSearchChange:m}=je(),[x,p]=i.useState(_),{t:b}=We("mail",{useSuspense:!1}),u=i.useCallback((d,S)=>b(d,{defaultValue:S}),[b]),h=G({queries:t.map(d=>({...J({path:{accountId:d.accountId}}),staleTime:1/0}))}),{data:f}=Ce(Ue()),v=i.useMemo(()=>(f?.items??[]).filter(d=>Bt(d.status)).length,[f?.items]),k=i.useMemo(()=>t.map((d,S)=>{const N=h[S],M=N?.data?.items??[],w=Ye(d.folderAppointments),{system:E,labels:Q}=us(M,w,u),C=N?.isError?"error":N?.isLoading?"loading":"ready";return{id:d.accountId,label:d.email,email:d.email,muted:!!d.muted,outboxPending:v,status:C,onRetry:()=>N?.refetch(),mailboxes:[...E,...Q].map(F=>ds(F,w.get(F.mailboxId),u))}}),[t,h,v,u]),g=d=>{n.invalidateQueries({queryKey:Xe({path:{mailboxId:d},query:{order:"desc"}})})},R=({navId:d,className:S,ariaLabel:N,title:M,children:w,onClick:E})=>d==="brief"?e.jsx(P,{to:"/mail/brief",search:{q:void 0},activeOptions:{includeSearch:!1},onClick:()=>E?.(),className:S,"aria-label":N,title:M,children:w}):d==="outbox"?e.jsx(P,{to:"/mail/outbox",search:{q:void 0},onClick:()=>E?.(),className:S,"aria-label":N,title:M,children:w}):d==="flagged"?e.jsx(P,{to:"/mail/flagged",search:{q:void 0,selectedMessageId:void 0},onClick:()=>E?.(),className:S,"aria-label":N,title:M,children:w}):d==="settings"?e.jsx(P,{to:"/settings/accounts",onClick:()=>E?.(),className:S,"aria-label":N,title:M,children:w}):e.jsx(P,{to:"/mail/$mailboxId",params:{mailboxId:d},search:{q:void 0,selectedMessageId:void 0},onClick:()=>{g(d),E?.()},className:S,"aria-label":N,title:M,children:w}),c=()=>{m(""),s?.()},y=l.trim(),A=y.length>0&&!x.includes(y)?y:void 0,K=i.useCallback(()=>{A&&p(is(A))},[A]),V=i.useCallback(d=>{p(ls(d))},[]),q=i.useCallback(d=>{m(d),r({to:"/mail/brief",search:{q:d}}),s?.()},[m,r,s]);return e.jsx(Jt,{accounts:k,selectedNavId:o,onSelectNav:c,linkComponent:R,variant:a,savedSearches:x,saveableQuery:A,onSaveCurrentSearch:K,onSelectSavedSearch:q,onRemoveSavedSearch:V})}function xs(){return e.jsxs("button",{type:"button",onClick:Se,className:"flex w-full items-center gap-2 rounded-md px-2 py-1 text-sm text-fg-muted transition-colors hover:bg-surface hover:text-fg",children:[e.jsx(ke,{className:"size-4 shrink-0"}),e.jsx("span",{className:"flex-1 truncate text-left",children:"Report a bug"})]})}function hs({accounts:t,onMailboxSelect:s}){return ve()?.showNavPane??!0?e.jsx(me,{accounts:t}):e.jsxs("div",{className:"flex h-full flex-col",children:[e.jsx("div",{className:"flex-1 overflow-y-auto",children:e.jsx(me,{accounts:t,onMailboxSelect:s,variant:"drawer"})}),e.jsxs("div",{className:"border-t border-line px-2 py-2",children:[e.jsxs(P,{to:"/settings/accounts",onClick:s,children:[e.jsx(Ie,{className:"size-4 shrink-0"}),e.jsx("span",{className:"flex-1 truncate text-left",children:"Settings"})]}),e.jsx(xs,{}),e.jsx(Me,{children:({signOut:r})=>e.jsxs("button",{type:"button",onClick:()=>{s?.(),r()},className:"flex min-h-11 w-full items-center gap-2 rounded-md px-2 py-1 text-sm text-fg-muted transition-colors hover:bg-surface hover:text-fg","data-testid":"sign-out-button",children:[e.jsx(we,{className:"size-4 shrink-0"}),e.jsx("span",{className:"flex-1 truncate text-left",children:"Sign out"})]})})]})]})}const fs=({isOpen:t,onClose:s})=>{const a=i.useCallback(n=>{n.key==="Escape"&&(n.preventDefault(),s())},[s]);return i.useEffect(()=>{if(t)return window.addEventListener("keydown",a),()=>window.removeEventListener("keydown",a)},[t,a]),t?e.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[e.jsx(Ze,{label:"Dismiss keyboard shortcuts",onDismiss:s,className:"backdrop-blur-sm"}),e.jsxs("div",{role:"dialog","aria-modal":"true","aria-label":"Keyboard shortcuts",className:et("relative z-10 max-h-[85vh] w-full max-w-2xl overflow-y-auto","rounded-lg border border-line bg-surface shadow-lg","p-6"),children:[e.jsxs("div",{className:"mb-6 flex items-center justify-between",children:[e.jsx("h2",{className:"text-lg font-semibold",children:"Keyboard shortcuts"}),e.jsx("button",{type:"button",onClick:s,className:"p-1 text-fg-muted transition-colors hover:text-fg","aria-label":"Close",children:e.jsx(be,{className:"size-5"})})]}),e.jsx("div",{className:"grid gap-x-8 gap-y-6 sm:grid-cols-2",children:yt.map(n=>e.jsxs("div",{children:[e.jsx("h3",{className:"mb-3 text-sm font-medium text-fg-muted",children:n.title}),e.jsx("div",{className:"space-y-2",children:n.hints.map(r=>e.jsxs("div",{className:"flex items-center justify-between gap-4",children:[e.jsx("span",{className:"text-sm",children:r.description}),e.jsx("span",{className:"flex shrink-0 items-center gap-1",children:r.keys.map((o,l)=>e.jsxs(i.Fragment,{children:[l>0&&r.keys[0]==="g"&&e.jsx("span",{className:"text-2xs text-fg-subtle",children:"then"}),e.jsx(ae,{children:o})]},o))})]},`${r.action}-${r.keys.join("+")}`))})]},n.title))}),e.jsx("div",{className:"mt-6 border-t border-line pt-4",children:e.jsxs("p",{className:"text-center text-xs text-fg-muted",children:["Press ",e.jsx(ae,{children:"Esc"})," to close"]})})]})]}):null};function ps(t){const s=G({queries:t.map(a=>({...J({path:{accountId:a.accountId}}),staleTime:1/0}))});return i.useMemo(()=>jt(s.map(a=>a.data?.items??[])),[s])}const gs=t=>t.map(s=>s.data?.items??[]);function bs(t){const s=G({queries:t.map(a=>({...J({path:{accountId:a.accountId}}),staleTime:1/0})),combine:gs});return i.useMemo(()=>tt(t.map((a,n)=>({folderAppointments:a.folderAppointments,mailboxes:s[n]??[]}))),[t,s])}var T={exports:{}},xe;function vs(){if(xe)return T.exports;xe=1;const t=(s,a,n)=>new Promise((r,o)=>{if(n=Object.assign({concurrency:1/0},n),typeof a!="function")throw new TypeError("Mapper function is required");const{concurrency:l}=n;if(!(typeof l=="number"&&l>=1))throw new TypeError(`Expected \`concurrency\` to be a number from 1 and up, got \`${l}\` (${typeof l})`);const m=[],x=s[Symbol.iterator]();let p=!1,b=!1,u=0,h=0;const f=()=>{if(p)return;const v=x.next(),k=h;if(h++,v.done){b=!0,u===0&&r(m);return}u++,Promise.resolve(v.value).then(g=>a(g,k)).then(g=>{m[k]=g,u--,f()},g=>{p=!0,o(g)})};for(let v=0;v<l&&(f(),!b);v++);});return T.exports=t,T.exports.default=t,T.exports}var ys=vs();const js=st(ys),Ss=900*1e3,Ns=300,Cs=(t,s)=>{if(!t)return s;const a=Number.parseInt(t,10);return Number.isFinite(a)&&a>0?a:s},ks=60*1e3,ws=t=>Math.max(Cs(t,Ns)*1e3,ks),B=ws(it().mailboxPollIntervalSeconds),Is=5,W=new Set,Ms=(t,s,a=Ss)=>t.filter(n=>{const r=n.lastSyncAt;return r==null?!0:s-r>a}).map(n=>n.accountId),Es=(t,s,a=B)=>t-s>=a,Os=(t,s)=>t.filter(a=>!s.has(a)),he=(t,s)=>{if(W.delete(t),rt(s,{softError:!0})){ot(s);return}console.warn("[remit] background mailbox sync failed",{accountId:t,error:s})},fe=(t,s)=>at({path:{accountId:t},throwOnError:!0}).then(()=>{s.invalidateQueries({queryKey:nt({path:{accountId:t}})})}),Rs=t=>{const s=Ne(),a=i.useRef(t);a.current=t;const n=t.map(r=>r.accountId).join(",");i.useEffect(()=>{const r=Date.now(),l=Ms(a.current,r).filter(m=>!W.has(m));if(l.length!==0)for(const m of l)W.add(m),fe(m,s).catch(x=>{he(m,x)})},[n,s]),i.useEffect(()=>{let r=Date.now(),o;const l=new Set,m=()=>{r=Date.now();const b=Os(a.current.map(u=>u.accountId),l);for(const u of b)l.add(u);js(b,u=>fe(u,s).catch(h=>{he(u,h)}).finally(()=>{l.delete(u)}),{concurrency:Is})},x=()=>{if(document.visibilityState==="visible"){m(),o=setTimeout(x,B);return}},p=()=>{document.visibilityState==="visible"&&Es(Date.now(),r)&&(o!==void 0&&clearTimeout(o),m(),o=setTimeout(x,B))};return o=setTimeout(x,B),document.addEventListener("visibilitychange",p),()=>{o!==void 0&&clearTimeout(o),document.removeEventListener("visibilitychange",p)}},[n,s])};function Us(){const{q:t=""}=lt({from:"/mail"}),s=Y(),a=St(),n=wt(a),[r,o]=i.useState(!1),[l,m]=i.useState(!1),[x,p]=i.useState(!1),b=i.useCallback(j=>{p(j),ne(j)},[]),[u,h]=i.useState(t),f=Kt(u,200),v=At(u,f),k=se({select:j=>j.location.pathname}),g=se({select:j=>Mt(j.matches)}),[R,c]=i.useState(g);if(R!==g){const j=Rt(R,g,t);c(g),j!==void 0&&h(j)}const{data:y,isLoading:A,isError:K,error:V,refetch:q}=Ce({...ct(),staleTime:1/0}),d=!!(y&&(y.accounts?.length??0)===0);i.useEffect(()=>{d&&s({to:"/onboarding",replace:!0})},[d,s]),Nt({enabled:!r,bindings:[{key:"?",handler:()=>o(!0),noModifiers:!1,preventDefault:!0}]});const{openCompose:S}=U(),N=i.useMemo(()=>({compose:()=>S({mode:"new"})}),[S]);Ct({enabled:!ut(k),handlers:N});const M=i.useCallback(j=>{h(j)},[]),w=i.useCallback(()=>{h("")},[]),E=i.useCallback(()=>{h("")},[]),Q=i.useCallback(()=>{p(j=>{const Z=!j;return ne(Z),Z})},[]),C=y?.accounts??[],F=i.useMemo(()=>C.map(j=>j.accountId),[C]),Ee=ps(C),Oe=bs(C),Re=i.useMemo(()=>kt(C),[C]);Rs(C);const Ae=i.useCallback(()=>{m(!1)},[]),Pe={accounts:C,mailboxNameIndex:Ee,accountNameIndex:Re,resultFolderIndex:Oe,searchQuery:v,searchInput:u,searchViewKey:g,onSearchChange:M,onSearchClear:w,onSearchClearQuery:E,intelligenceOpen:x,onToggleIntelligence:Q,onSetIntelligenceOpen:b},ze={isSinglePane:n,isLoading:A||d,intelligenceOpen:x,nav:e.jsx(hs,{accounts:C,onMailboxSelect:Ae}),topBar:n?void 0:e.jsx(rs,{accounts:C}),overlay:n?e.jsx(ss,{}):void 0,navOpen:l,onOpenNav:()=>m(!0),onCloseNav:()=>m(!1)};return e.jsx(dt.Provider,{value:Pe,children:e.jsxs(Ft,{accountIds:F,children:[K?e.jsx("div",{className:"flex h-full items-center justify-center bg-canvas p-4",children:e.jsx(_t,{title:"Couldn't load your account",error:V,onRetry:()=>{q()}})}):e.jsx(Ot,{chrome:ze,children:e.jsx(mt,{})}),e.jsx(fs,{isOpen:r,onClose:()=>o(!1)})]})})}export{Us as component,je as useMailContext};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as e}from"./index-
|
|
1
|
+
import{c as e}from"./index-CJnB8f3k.js";const n=e("Menu",[["line",{x1:"4",x2:"20",y1:"12",y2:"12",key:"1e0a9i"}],["line",{x1:"4",x2:"20",y1:"6",y2:"6",key:"1owob3"}],["line",{x1:"4",x2:"20",y1:"18",y2:"18",key:"yk5zj1"}]]);export{n as M};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{q as g,w as C,v as w,ad as L,P as _,cV as D,r as b,cm as x,s as A,y as E,cW as p,D as N}from"./index-
|
|
1
|
+
import{q as g,w as C,v as w,ad as L,P as _,cV as D,r as b,cm as x,s as A,y as E,cW as p,D as N}from"./index-CJnB8f3k.js";import{a as I}from"./enums-CCxx0t2v.js";const F=3e4,R=1e3,$="The folder couldn't be created on the mail server. Please try again.",B="The folder was created but the mail server hasn't confirmed it yet, so nothing was attached to it. It's in your folder list — try again in a moment.",k=(e,t)=>new Promise((a,o)=>{if(t?.aborted){o(t.reason);return}const n=setTimeout(()=>{t?.removeEventListener("abort",r),a()},e),r=()=>{clearTimeout(n),o(t?.reason)};t?.addEventListener("abort",r,{once:!0})});async function Y({fetchMailboxes:e,mailboxId:t,signal:a,timeoutMs:o=F,pollIntervalMs:n=R,delay:r=k,now:l=Date.now}){const s=l()+o;for(;;){a?.throwIfAborted();const c=(await e()).find(u=>u.mailboxId===t);if(c?.syncStatus===I.synced)return c;if(c?.syncStatus===I.failed)throw new Error($);if(l()>=s)throw new Error(B);await r(n,a)}}function S(e,t){const a=e.trim();return t?`${t.fullPath}${t.hierarchyDelimiter}${a}`:a}const P=(e,t)=>{const a=e.split(t);return a[0]?.toLowerCase()==="inbox"&&(a[0]="INBOX"),a.join(t)};function X({name:e,delimiter:t,parent:a,existingPaths:o}){const n=e.trim();if(n==="")return"Enter a folder name.";if(n.includes(t))return`A folder name can't contain "${t}".`;const r=P(S(n,a),t);if(o.some(s=>P(s,t)===r))return"A folder with that name already exists."}function j(e){const t=g(),{data:a}=C({...w({path:{accountId:e??""}}),enabled:!!e}),o=L({...D(),onSuccess:()=>{e&&t.invalidateQueries({queryKey:_({path:{accountId:e}})})}}),n=b.useRef(new Map),r=b.useCallback(async(s,i,c)=>{if(!e)throw new Error("No account to create the folder in. Pick messages from a single account first.");const u=a?.items??[],d=i?u.find(h=>h.fullPath===i):void 0;if(i&&!d)throw new Error(`Couldn't find the folder "${i}" to create this one inside.`);const y=d?{fullPath:d.fullPath,hierarchyDelimiter:d.hierarchyDelimiter}:void 0,f=S(s,y);let m=n.current.get(f);if(!m){const h=y?.hierarchyDelimiter??u[0]?.hierarchyDelimiter??"/",v=X({name:s,delimiter:h,parent:y,existingPaths:u.map(T=>T.fullPath)});if(v)throw new Error(v);m=(await o.mutateAsync({path:{accountId:e},body:{fullPath:f,namespaceType:"personal"}})).mailboxId,n.current.set(f,m)}const M=await Y({mailboxId:m,signal:c,fetchMailboxes:async()=>(await t.fetchQuery({...w({path:{accountId:e}}),staleTime:0})).items??[]});return n.current.delete(f),{id:M.mailboxId,label:x(M.fullPath),path:M.fullPath}},[o,e,a,t]);return{createFolder:b.useCallback((s,i)=>r(s,"",i),[r]),createFolderIn:r,mutation:o}}const J=()=>{const{t:e}=A("mail",{useSuspense:!1});return b.useCallback((t,a)=>e(t,{defaultValue:a}),[e])},ee=100,Q=e=>e.trim().toLowerCase()==="inbox",z=(e,t)=>{const a=`${e.fullPath}${e.hierarchyDelimiter}`;return t.some(o=>o.mailboxId!==e.mailboxId&&o.fullPath.startsWith(a))},V=(e,t)=>t.find(a=>a.mailboxId!=null&&a.mailboxId===e)?.role;function te(e,t,a){if(Q(e.fullPath))return{deletable:!1,reason:"inbox",message:"The inbox can't be deleted."};const o=V(e.mailboxId,a);return o?{deletable:!1,reason:"role",message:`This folder is your ${o} folder. Reassign that role before deleting it.`}:z(e,t)?{deletable:!1,reason:"children",message:"This folder has subfolders. Delete them first."}:{deletable:!0}}function q(e,t){return e.filter(a=>a.mailboxId!==t)}function ae(e){return{total:e,moved:0,phase:e===0?"moved":"moving"}}function oe(e,t){if(e.phase!=="moving")return e;const a=Math.min(e.total,e.moved+Math.max(0,t));return{...e,moved:a,phase:a>=e.total?"moved":"moving"}}function ne(e,t){return{...e,phase:"failed",error:t}}function re(e){return`Moved ${e.moved} of ${e.total}`}function ie(e){return e>0?"choose-fate":"confirm-empty"}const U=new Set(["outbox","postvak uit","boîte d'envoi","postausgang","buzón de salida","posta in uscita","送信トレイ","送件匣","发件箱","skrzynka nadawcza"]),G=e=>{const t=x(e.fullPath).trim().toLowerCase();return U.has(t)},O=p.length,K=(e,t)=>{const a=E(t);return[...e.filter(n=>{const r=a.get(n.mailboxId);return r==="drafts"||r==="sent"?!1:!G(n)})].sort((n,r)=>{const l=a.has(n.mailboxId)?p.indexOf(a.get(n.mailboxId)??"inbox"):O,s=a.has(r.mailboxId)?p.indexOf(a.get(r.mailboxId)??"inbox"):O;return l!==s?l-s:x(n.fullPath).localeCompare(x(r.fullPath),void 0,{sensitivity:"base",numeric:!0})})},se=e=>e[0]?.hierarchyDelimiter??"/",le=({mailboxes:e,folderAppointments:t,currentMailboxId:a,excludeMailboxId:o,translator:n})=>{const r=K(e,t),l=E(t);return(o?q(r,o):r).map(i=>({id:i.mailboxId,label:N(i,l.get(i.mailboxId),n),path:i.fullPath,isCurrent:i.mailboxId===a}))};export{ee as M,J as a,le as b,ae as c,ne as d,oe as e,se as f,te as g,ie as i,re as m,j as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{cL as s,j as t,cM as a,cN as r}from"./index-CJnB8f3k.js";const c=["intelligence","nav","shortcuts","filters"];s(c);const i=a(r);function u({fragment:n,...e}){return t.jsx(i,{...e,hash:n})}export{u as N};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{$ as t,a0 as r,q as a,r as i,j as s}from"./index-
|
|
1
|
+
import{$ as t,a0 as r,q as a,r as i,j as s}from"./index-CJnB8f3k.js";import{O as c}from"./OnboardingWizard-5e-Jbm_d.js";import"./kbd-CaPCJ6kw.js";import"./account-form-helpers-CcGKmwNo.js";async function l(e){e.recordCompleted(),await e.queryClient.refetchQueries({queryKey:t()}),e.navigateToInbox()}function y(){const e=r(),o=a(),n=i.useCallback(m=>{l({queryClient:o,recordCompleted:()=>e.recordEvent("onboarding.completed"),navigateToInbox:()=>{window.location.assign("/mail")}})},[e,o]);return s.jsx(c,{skipWelcome:!1,onComplete:n})}export{y as component};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{z as s,j as o,_ as i}from"./index-CJnB8f3k.js";import{a as m}from"./search-view-BT2iNrko.js";import{O as t}from"./OutboxPane-BYMmHEVx.js";import{u as a}from"./useSearchMirror-2jg6tvic.js";import"./nav-link-DNUfNst6.js";import"./search-scope-YZoKowSP.js";import"./useSearchTokenContext-CwRxhOKm.js";import"./kbd-CaPCJ6kw.js";import"./enums-CCxx0t2v.js";import"./circle-check-big-DH3iP9sG.js";import"./clock-BmHk7UCJ.js";import"./row-actions-CCoOsKI0.js";import"./rotate-ccw-Dxvks-Fa.js";import"./NavMenuButton-jHcm8vfZ.js";import"./menu-fPT37kSH.js";import"./format-De9HZKjg.js";import"./outbox-status-CPfNHfUQ.js";import"./search-query-Cr_ZXBCp.js";function e(){return s({from:"/mail/outbox/draft/$outboxMessageId",shouldThrow:!1})?.outboxMessageId}function w(){const r=e();return a({to:"/mail/outbox"}),o.jsx(t,{outboxMessageId:r,children:o.jsx(m,{phone:o.jsx(t.Phone,{}),list:o.jsx(t.List,{}),reading:o.jsx(i,{})})})}export{w as component};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as a}from"./index-
|
|
1
|
+
import{c as a}from"./index-CJnB8f3k.js";const c=a("Pencil",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]);export{c as P};
|