@remit/web-client-dist 0.0.348 → 0.0.349
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-BfuwvROx.js +1 -0
- package/assets/{ErrorState-MU74MidS.js → ErrorState-DlHdbl1h.js} +1 -1
- package/assets/FlaggedPane-DXXvbNMD.js +1 -0
- package/assets/MailListHeader-BFBjOnAW.js +52 -0
- package/assets/{MailViewChrome-C5l2P0VC.js → MailViewChrome-XjLFqRLL.js} +1 -1
- package/assets/MailboxPane-BwHG9r2e.js +1 -0
- package/assets/{NavMenuButton-yePNNbL3.js → NavMenuButton-D_W6DXrb.js} +1 -1
- package/assets/{OnboardingWizard-DFTYkX1J.js → OnboardingWizard-D8Zk-VXt.js} +1 -1
- package/assets/OutboxPane-D2d4W5AT.js +1 -0
- package/assets/_mailboxId-DstK-xUR.js +1 -0
- package/assets/_messageId-CLaETLs-.js +1 -0
- package/assets/_messageId-DRTBuwn5.js +1 -0
- package/assets/_messageId-DmZCgc4u.js +1 -0
- package/assets/_outboxMessageId-DSVc6DQy.js +1 -0
- package/assets/_threadId-DiPJwQ2o.js +1 -0
- package/assets/_threadId-Djs3CNia.js +1 -0
- package/assets/_threadId-DtfbogPc.js +1 -0
- package/assets/{account-form-helpers-D3tP0Y93.js → account-form-helpers-CwJTqJha.js} +1 -1
- package/assets/{accounts-Duog1qwG.js → accounts-sOzFT-mC.js} +1 -1
- package/assets/{advanced-DtSoXxD8.js → advanced-MP09rSMr.js} +1 -1
- package/assets/{appearance-B35fYV90.js → appearance-DHJRN3ld.js} +1 -1
- package/assets/{avatar-CA5kvlqX.js → avatar-D3R75Qgk.js} +1 -1
- package/assets/{bottom-sheet-DMZJuLZV.js → bottom-sheet-BKnsFMEf.js} +1 -1
- package/assets/brief-C5lHNp6b.js +1 -0
- package/assets/{brief-DHPQim-F.js → brief-DqILJyQz.js} +1 -1
- package/assets/{browser-ponyfill-3Z7b3Ino.js → browser-ponyfill-CTm-DR6u.js} +1 -1
- package/assets/{bug-CbZDZsKv.js → bug-C2LRkTHS.js} +1 -1
- package/assets/{circle-check-DuYzwtzc.js → circle-check-C1n1yijO.js} +1 -1
- package/assets/{circle-check-big-BwdsF7Cx.js → circle-check-big-BmnT3rLr.js} +1 -1
- package/assets/{circle-help-CgEJ3D8H.js → circle-help-BJLBqOAA.js} +1 -1
- package/assets/{clock-Bn5LKgEF.js → clock-BNqM2h_T.js} +1 -1
- package/assets/{confirm-dialog-B8IGkNYw.js → confirm-dialog-C1Q_9oNl.js} +1 -1
- package/assets/{download-BA-bmpmK.js → download-aqyrBjOU.js} +1 -1
- package/assets/{filters-RlM4Mn2p.js → filters-y-tc_bzr.js} +1 -1
- package/assets/{flagged-Dy62wm9V.js → flagged-D6yLzY2X.js} +1 -1
- package/assets/flagged-DsEl2-dg.js +1 -0
- package/assets/{folders-Be9ohEpV.js → folders-KxXDRobS.js} +1 -1
- package/assets/index-Bmrb3uML.js +1 -0
- package/assets/index-C8bsgH_w.js +1 -0
- package/assets/index-CcuWjbLO.js +1 -0
- package/assets/index-Cf7AKvjm.js +1 -0
- package/assets/{index-B0gGhPUH.js → index-DKG1l4OE.js} +4 -4
- package/assets/index-DRTBuwn5.js +1 -0
- package/assets/index-DhwJT0Xk.js +1 -0
- package/assets/index-DmZCgc4u.js +1 -0
- package/assets/index-WhbhbXhS.js +1 -0
- package/assets/{kbd-KoU2r3gz.js → kbd-CnUDSPH5.js} +1 -1
- package/assets/{labels-Dc0jMg4m.js → labels-BmRFi78i.js} +1 -1
- package/assets/mail-CK2ZaY0m.js +1 -0
- package/assets/{menu-C-hCWna5.js → menu-DdqPoHXZ.js} +1 -1
- package/assets/{move-options-gvL1DcHP.js → move-options-DXhjey10.js} +1 -1
- package/assets/nav-link-BTQmJNls.js +1 -0
- package/assets/{onboarding-CBNEc0qp.js → onboarding-AkJlSpsK.js} +1 -1
- package/assets/outbox-CYHiwpl8.js +1 -0
- package/assets/{pencil-DztOl8w-.js → pencil-DFHNbAYX.js} +1 -1
- package/assets/{rich-text-Cfz3A92U.js → rich-text-CBLH_ljE.js} +2 -2
- package/assets/{rich-text-spellcheck-worker-provider-B5v4WEf7.js → rich-text-spellcheck-worker-provider-8XL6BOiI.js} +1 -1
- package/assets/{rotate-ccw-BJXOaP2d.js → rotate-ccw-CYszpTkF.js} +1 -1
- package/assets/{row-actions-BUz3WE0w.js → row-actions-DjIKrPVk.js} +1 -1
- package/assets/search-token-index-D13ogntK.js +1 -0
- package/assets/{search-view-DrUUdL6n.js → search-view-B5prVpGW.js} +1 -1
- package/assets/{senders-D6BGUfQs.js → senders-BFXe7Id6.js} +1 -1
- package/assets/settings-DSF3NSGu.js +1 -0
- package/assets/{settings-screen-DPoYuXO9.js → settings-screen-BgOpI_Lx.js} +1 -1
- package/assets/{shield-check-CQn1EXxs.js → shield-check-BBp9gzDX.js} +1 -1
- package/assets/{suggested-vips-2xGAQbvF.js → suggested-vips-DFwiEmrP.js} +1 -1
- package/assets/{use-match-media-DJmVUSKZ.js → use-match-media-C1DFe6n_.js} +1 -1
- package/assets/{useDebouncedValue-D-tMioem.js → useDebouncedValue-BazHTAhQ.js} +1 -1
- package/assets/{useFilters-BHdMeB1x.js → useFilters-DBElfc_V.js} +1 -1
- package/assets/{useLabels-BjFSTQJa.js → useLabels-CZdQ7rFS.js} +1 -1
- package/assets/{useRefreshControl-B4ptvSMC.js → useRefreshControl-DN40VgNE.js} +1 -1
- package/assets/useSearchMirror-CiaVi7jg.js +1 -0
- package/assets/{useSearchTokenContext-CJOt3e_5.js → useSearchTokenContext-BNRIlJev.js} +1 -1
- package/assets/useSemanticSearch-BHpjDfP4.js +1 -0
- package/assets/{useSignature-DtisK3b5.js → useSignature-BaYkV0lH.js} +1 -1
- package/index.html +1 -1
- package/package.json +1 -1
- package/assets/BriefPane-DcDdha3g.js +0 -1
- package/assets/FlaggedPane-BQVMrq7v.js +0 -1
- package/assets/MailListHeader-BWI0Nrrj.js +0 -52
- package/assets/MailboxPane-Bp2XOdex.js +0 -1
- package/assets/OutboxPane-CpeTy3zD.js +0 -1
- package/assets/_mailboxId-BY7ELdjG.js +0 -1
- package/assets/_messageId-BRtMnU3V.js +0 -1
- package/assets/_messageId-BsXz1rhh.js +0 -1
- package/assets/_messageId-D-482QC_.js +0 -1
- package/assets/_outboxMessageId-D94eOCxt.js +0 -1
- package/assets/_threadId-B413Tkbw.js +0 -1
- package/assets/_threadId-C-I4Jz4m.js +0 -1
- package/assets/_threadId-CG3XLzP8.js +0 -1
- package/assets/brief-B5iqKPvn.js +0 -1
- package/assets/flagged-Ch97-6Is.js +0 -1
- package/assets/index-B8oIM4Yp.js +0 -1
- package/assets/index-BRtMnU3V.js +0 -1
- package/assets/index-BsXz1rhh.js +0 -1
- package/assets/index-CDT5IGom.js +0 -1
- package/assets/index-DD1arVcR.js +0 -1
- package/assets/index-Rj3XFo0T.js +0 -1
- package/assets/index-aBW7-rjE.js +0 -1
- package/assets/index-rMwnn-IZ.js +0 -1
- package/assets/intelligence-pref-C6lFpj6U.js +0 -1
- package/assets/mail-UoKFyvnR.js +0 -1
- package/assets/nav-link-CVQC1Fxi.js +0 -1
- package/assets/outbox-DE5l_jg5.js +0 -1
- package/assets/search-scope-CXUsoxz5.js +0 -1
- package/assets/search-token-index-g7U1fU4N.js +0 -1
- package/assets/settings-CCkqBw0b.js +0 -1
- package/assets/useSearchMirror-0Mf40Pzd.js +0 -1
- package/assets/useSemanticSearch-DsK7-4Bv.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as r}from"./index-DKG1l4OE.js";import{B as o}from"./BriefPane-BfuwvROx.js";import"./useSearchTokenContext-BNRIlJev.js";import"./kbd-CnUDSPH5.js";import"./enums-CCxx0t2v.js";import"./nav-link-BTQmJNls.js";import"./MailListHeader-BFBjOnAW.js";import"./search-token-index-D13ogntK.js";import"./use-match-media-C1DFe6n_.js";import"./account-form-helpers-CwJTqJha.js";import"./avatar-D3R75Qgk.js";import"./useSignature-BaYkV0lH.js";import"./useDebouncedValue-BazHTAhQ.js";import"./useFilters-DBElfc_V.js";import"./ErrorState-DlHdbl1h.js";import"./format-De9HZKjg.js";import"./download-aqyrBjOU.js";import"./shield-check-BBp9gzDX.js";import"./move-options-DXhjey10.js";import"./confirm-dialog-C1Q_9oNl.js";import"./clock-BNqM2h_T.js";import"./menu-DdqPoHXZ.js";import"./useRefreshControl-DN40VgNE.js";import"./circle-check-big-BmnT3rLr.js";import"./useLabels-CZdQ7rFS.js";import"./useSemanticSearch-BHpjDfP4.js";import"./search-query-Cr_ZXBCp.js";function y(){return r.jsx(o.Reading,{})}export{y as component};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as o}from"./index-DKG1l4OE.js";import{M as i}from"./MailboxPane-BwHG9r2e.js";import"./useSearchTokenContext-BNRIlJev.js";import"./kbd-CnUDSPH5.js";import"./enums-CCxx0t2v.js";import"./nav-link-BTQmJNls.js";import"./useRefreshControl-DN40VgNE.js";import"./circle-check-big-BmnT3rLr.js";import"./search-token-index-D13ogntK.js";import"./use-match-media-C1DFe6n_.js";import"./MailListHeader-BFBjOnAW.js";import"./account-form-helpers-CwJTqJha.js";import"./avatar-D3R75Qgk.js";import"./useSignature-BaYkV0lH.js";import"./useDebouncedValue-BazHTAhQ.js";import"./useFilters-DBElfc_V.js";import"./ErrorState-DlHdbl1h.js";import"./format-De9HZKjg.js";import"./download-aqyrBjOU.js";import"./shield-check-BBp9gzDX.js";import"./move-options-DXhjey10.js";import"./confirm-dialog-C1Q_9oNl.js";import"./clock-BNqM2h_T.js";import"./menu-DdqPoHXZ.js";import"./MailViewChrome-XjLFqRLL.js";import"./NavMenuButton-D_W6DXrb.js";import"./useLabels-CZdQ7rFS.js";import"./useSemanticSearch-BHpjDfP4.js";import"./search-query-Cr_ZXBCp.js";import"./bottom-sheet-BKnsFMEf.js";import"./circle-help-BJLBqOAA.js";import"./circle-check-C1n1yijO.js";function F(){return o.jsx(i.Reading,{})}export{F as component};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as o}from"./index-DKG1l4OE.js";import{F as r}from"./FlaggedPane-DXXvbNMD.js";import"./useSearchTokenContext-BNRIlJev.js";import"./kbd-CnUDSPH5.js";import"./enums-CCxx0t2v.js";import"./nav-link-BTQmJNls.js";import"./MailListHeader-BFBjOnAW.js";import"./search-token-index-D13ogntK.js";import"./use-match-media-C1DFe6n_.js";import"./account-form-helpers-CwJTqJha.js";import"./avatar-D3R75Qgk.js";import"./useSignature-BaYkV0lH.js";import"./useDebouncedValue-BazHTAhQ.js";import"./useFilters-DBElfc_V.js";import"./ErrorState-DlHdbl1h.js";import"./format-De9HZKjg.js";import"./download-aqyrBjOU.js";import"./shield-check-BBp9gzDX.js";import"./move-options-DXhjey10.js";import"./confirm-dialog-C1Q_9oNl.js";import"./clock-BNqM2h_T.js";import"./menu-DdqPoHXZ.js";import"./MailViewChrome-XjLFqRLL.js";function k(){return o.jsx(r.Reading,{})}export{k as component};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as t,a7 as o}from"./index-DKG1l4OE.js";const n=()=>t.jsx(o,{to:"/settings/accounts"});export{n as component};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as s,b as t}from"./index-
|
|
1
|
+
import{j as s,b as t}from"./index-DKG1l4OE.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,al as h,a$ as y,ak as b,ba as g,B as v,T as N,p as C,x as L,Z as I,az as D,aD as S,aA as w}from"./index-
|
|
1
|
+
import{r as x,j as e,al as h,a$ as y,ak as b,ba as g,B as v,T as N,p as C,x as L,Z as I,az as D,aD as S,aA as w}from"./index-DKG1l4OE.js";import{C as E}from"./confirm-dialog-C1Q_9oNl.js";import{S as $}from"./settings-screen-BgOpI_Lx.js";import{E as j}from"./ErrorState-DlHdbl1h.js";import{a as T,b as k,c as R,u as O}from"./useLabels-CZdQ7rFS.js";import"./avatar-D3R75Qgk.js";import"./menu-DdqPoHXZ.js";import"./circle-help-BJLBqOAA.js";function B({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 A({accountId:l}){const{createLabel:i,isPending:n,isError:m}=O(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 H({account:l}){const i=l.accountId,{labels:n,isPending:m,isError:c,error:u,refetch:r}=T(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(B,{labels:n,onRename:(p,f)=>o(p,{name:f}),onRecolor:(p,f)=>o(p,{color:f}),onDelete:s,deletingLabelId:t}),e.jsx(A,{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 Z(){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($,{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(H,{account:t},t.accountId))})})}export{Z as component};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as T,r as l,u as Be,j as e,S as Ke,a as pe,b as M,C as te,d as se,e as Ve,f as ge,F as Qe,g as qe,X as be,T as He,O as $e,M as We,A as Ue,h as Ye,I as Ge,i as ve,B as K,k as Y,l as ye,m as Je,n as Xe,o as je,p as G,q as Se,s as Ne,t as Ze,v as J,w as X,x as Ce,y as et,z as tt,D as st,E as W,G as at,H as nt,J as rt,K as ot,L as it,N as lt,P as ct,Q as ut,R as dt,U as mt,V as xt,W as ht,Y as ft,Z as pt,_ as gt,$ as bt,a0 as vt}from"./index-DKG1l4OE.js";import{B as yt,S as jt,D as St,a as Nt,b as Ct,u as kt,s as wt,K as It,c as Mt,d as Ot,e as Et,f as Rt,g as Pt,h as At,i as Lt}from"./search-token-index-D13ogntK.js";import{N as L,u as zt,a as Tt,i as Ft,b as ae}from"./nav-link-BTQmJNls.js";import{P as Dt}from"./pencil-DFHNbAYX.js";import{M as _t,s as Bt,c as Kt}from"./search-view-B5prVpGW.js";import{u as Vt,a as Qt,R as qt,M as Ht}from"./useRefreshControl-DN40VgNE.js";import{M as $t}from"./menu-DdqPoHXZ.js";import{B as ke}from"./bug-C2LRkTHS.js";import{A as Wt}from"./avatar-D3R75Qgk.js";import{i as Ut}from"./outbox-status-CPfNHfUQ.js";import{E as Yt}from"./ErrorState-DlHdbl1h.js";import{K as ne}from"./kbd-CnUDSPH5.js";import{u as Gt}from"./useDebouncedValue-BazHTAhQ.js";import"./use-match-media-C1DFe6n_.js";import"./circle-check-big-BmnT3rLr.js";const Jt=T("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 Xt=T("CalendarDays",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}],["path",{d:"M8 14h.01",key:"6423bh"}],["path",{d:"M12 14h.01",key:"1etili"}],["path",{d:"M16 14h.01",key:"1gbofw"}],["path",{d:"M8 18h.01",key:"lrp35t"}],["path",{d:"M12 18h.01",key:"mhygvu"}],["path",{d:"M16 18h.01",key:"kzsmim"}]]);const we=T("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=T("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 Zt=T("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"}]]),es="button:not([disabled]), a[href]",P="outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-surface-sunken";function ts({active:t,dimmed:s,indent:a}){return M("flex w-full items-center gap-2 rounded-md px-2 py-1 text-left text-sm transition-colors",P,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 ss({icon:t,label:s,count:a,active:n}){return e.jsxs(e.Fragment,{children:[t&&e.jsx("span",{className:M("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:M("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:i,linkComponent:d,ariaLabel:x,title:p,onClick:g}){const m=ts({active:n,dimmed:r,indent:o}),h=e.jsx(ss,{icon:t,label:s,count:a,active:n});return i&&d?d({navId:i,className:m,ariaLabel:x??s,title:p,onClick:g,children:h}):e.jsx("button",{type:"button",onClick:g,className:m,"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 as(t){switch(t){case"inbox":return e.jsx(Ge,{className:"size-4"});case"flagged":return e.jsx(pe,{className:"size-4"});case"drafts":return e.jsx(Ye,{className:"size-4"});case"sent":return e.jsx(ge,{className:"size-4"});case"archive":return e.jsx(Ue,{className:"size-4"});case"all":return e.jsx(We,{className:"size-4"});case"junk":return e.jsx($e,{className:"size-4"});case"trash":return e.jsx(He,{className:"size-4"})}}const oe=t=>t.role!=null,$=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 ns({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:M("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",P),children:[e.jsx(qe,{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:M("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",P),children:e.jsx(be,{className:"size-3.5"})})]})}function rs({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:M("flex w-full items-center gap-2 rounded-md px-2 py-1 text-left text-sm text-accent transition-colors hover:bg-surface",P),children:[e.jsx(Jt,{className:"size-4 shrink-0"}),e.jsxs("span",{className:"min-w-0 flex-1 truncate",children:["Save “",s,"”"]})]}),t.map(o=>e.jsx(ns,{query:o,onSelect:()=>a?.(o),onRemove:n?()=>n(o):void 0},o))]})}function os({account:t,selectedNavId:s,onSelectNav:a,linkComponent:n}){const[r,o]=l.useState(()=>ce(le,t.id,!0)),[i,d]=l.useState(()=>ce(ie,t.id,!0)),[x,p]=l.useState(!1),g=()=>{o(c=>{const S=!c;return ue(le,t.id,S),S})},m=()=>{d(c=>{const S=!c;return ue(ie,t.id,S),S})},h=t.mailboxes.filter(oe).sort((c,S)=>re[c.role]-re[S.role]),f=t.mailboxes.filter(c=>!oe(c)),b=x||f.length<=$?f:f.slice(0,$),v=f.length-b.length,y=t.status??"ready",E=y==="ready"&&h.length===0&&f.length===0;return e.jsxs("div",{className:"mt-3",children:[e.jsxs("button",{type:"button",onClick:g,"aria-expanded":r,className:M("flex w-full items-center gap-1.5 px-2 pb-1 text-left transition-colors hover:text-fg",P,t.muted&&"opacity-55"),children:[r?e.jsx(te,{className:"size-3 shrink-0 text-fg-subtle"}):e.jsx(se,{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(yt,{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:[y==="loading"&&e.jsx("div",{className:"px-2 py-1 text-sm text-fg-muted",children:"Loading…"}),y==="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(Ve,{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"})]}),E&&e.jsx("div",{className:"px-2 py-1 text-sm text-fg-muted",children:"No mailboxes"}),y==="ready"&&e.jsxs(e.Fragment,{children:[h.map(c=>e.jsx(z,{navId:c.id,linkComponent:n,icon:as(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:m,"aria-expanded":i,className:M("mt-1 flex w-full items-center gap-1 px-2 py-1 text-left text-2xs font-semibold uppercase tracking-wider text-fg-subtle transition-colors hover:text-fg",P),children:[i?e.jsx(te,{className:"size-3 shrink-0"}):e.jsx(se,{className:"size-3 shrink-0"}),e.jsx("span",{className:"flex-1",children:"Folders"}),e.jsx("span",{className:"tabular-nums opacity-70",children:f.length})]}),i&&e.jsxs(e.Fragment,{children:[b.map(c=>e.jsx(z,{navId:c.id,linkComponent:n,icon:e.jsx(Qe,{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)),(v>0||x)&&f.length>$&&e.jsx("button",{type:"button",onClick:()=>p(c=>!c),className:M("ml-7 flex items-center px-2 py-1 text-2xs font-medium text-accent transition-colors hover:underline",P),children:x?"Show less":`Show all (${f.length})`})]})]})]})]})]})}function is({accounts:t,selectedNavId:s,briefUnseen:a,onSelectNav:n,variant:r="desktop",linkComponent:o,calendarNav:i="hidden",savedSearches:d=[],saveableQuery:x,onSelectSavedSearch:p,onRemoveSavedSearch:g,onSaveCurrentSearch:m}){const h=l.useRef(null);Be({containerRef:h,itemSelector:es});const f=r==="drawer",b=e.jsxs("nav",{ref:f?h:void 0,className:f?"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(Ke,{className:"size-4"}),label:"Daily brief",ariaLabel:"Daily brief",count:a,active:s==="brief",onClick:()=>n?.("brief")}),i==="shown"&&e.jsx(z,{navId:"calendar",linkComponent:o,icon:e.jsx(Xt,{className:"size-4"}),label:"Calendar",ariaLabel:"Calendar",active:s==="calendar",onClick:()=>n?.("calendar")}),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(rs,{savedSearches:d,saveableQuery:x,onSelectSavedSearch:p,onRemoveSavedSearch:g,onSaveCurrentSearch:m}),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(os,{account:v,selectedNavId:s,onSelectNav:n,linkComponent:o},v.id))]});return f?b:e.jsx("aside",{ref:h,className:"flex h-full w-full flex-col bg-surface-sunken",children:b})}function ls({leading:t,search:s,actions:a,className:n}){return e.jsxs("header",{className:M("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 cs(){const t=ve();if(!t)return null;const s=t.showNavPane?!t.navCollapsed:!1;return e.jsx(K,{variant:"ghost",size:"sm",icon:e.jsx($t,{className:"size-4"}),onClick:t.toggleNav,"aria-label":s?"Hide folders":"Show folders","aria-expanded":s,title:"Folders",className:"shrink-0"})}const us={global:"Search all mail",pending:"Search mail",scoped:"Search this folder"};function ds({search:t,onCompose:s,onReportBug:a,onOpenSettings:n,composeShortcut:r,refreshControl:o,account:i}){return e.jsx(ls,{leading:e.jsx(cs,{}),search:e.jsx(jt,{value:t.value,onChange:t.onChange,onClear:t.onClear,onClearQuery:t.onClearQuery,chips:t.chips,onRemoveChip:t.onRemoveChip,placeholder:us[t.scope]}),actions:e.jsxs(e.Fragment,{children:[e.jsx(K,{variant:"ghost",size:"sm",icon:e.jsx(Zt,{className:"size-4"}),title:r?`Compose (${r})`:"Compose","aria-label":"Compose",onClick:s}),e.jsx(K,{variant:"ghost",size:"sm",icon:e.jsx(ke,{className:"size-4"}),title:"Report a bug","aria-label":"Report a bug",onClick:a}),e.jsx(K,{variant:"ghost",size:"sm",icon:e.jsx(Ie,{className:"size-4"}),title:"Settings","aria-label":"Settings",onClick:n}),o,i]})})}const ms=()=>{const{state:t,openCompose:s}=Y(),a=ye(),n=l.useCallback(()=>{s({mode:"new"})},[s]),r=Je(a.pathname);return!a.pathname.startsWith("/mail")||t.isOpen||r?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(Dt,{className:"size-6"})})},Me=({children:t})=>{const{Account:s}=Xe();return e.jsx(s,{children:t})},xs=({email:t,onSignOut:s})=>{const a=t??"Account";return e.jsxs(St,{trigger:e.jsx(Wt,{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(Nt,{})]}),e.jsxs(Ct,{onClick:s,children:[e.jsx(we,{className:"size-4"}),"Sign out"]})]})},hs=()=>e.jsx(Me,{children:({email:t,signOut:s})=>e.jsx(xs,{email:t,onSignOut:s})});function fs({accounts:t}){const{searchInput:s,onSearchChange:a,onSearchClear:n,onSearchClearQuery:r}=je(),o=G(),{openCompose:i}=Y(),d=l.useCallback(()=>{i({mode:"new"})},[i]),{scope:x,clearScope:p}=kt(t),g=x.kind==="scoped"?[{id:x.chip.id,label:x.chip.label,tone:"scope"}]:void 0,m=l.useMemo(()=>t.map(y=>y.accountId),[t]),{hasNewMail:h}=Vt(),{state:f,errorMessage:b,refresh:v}=Qt(m);return e.jsx(ds,{search:{value:s,scope:x.kind,chips:g,onChange:a,onClear:n,onClearQuery:r,onRemoveChip:p},onCompose:d,onReportBug:Se,onOpenSettings:()=>o({to:"/settings/accounts"}),composeShortcut:wt("compose"),refreshControl:e.jsx(qt,{state:f,onRefresh:v,label:"Refresh all accounts",errorMessage:b,hasUpdate:h(m)}),account:e.jsx(hs,{})})}const Z="remit.savedSearches",ps=25;function Q(){try{const t=localStorage.getItem(Z);if(!t)return[];const s=JSON.parse(t);return Array.isArray(s)?s.filter(a=>typeof a=="string"):[]}catch{return[]}}function gs(t){const s=t.trim();if(!s)return Q();const a=[s,...Q().filter(n=>n!==s)].slice(0,ps);try{localStorage.setItem(Z,JSON.stringify(a))}catch{return a}return a}function bs(t){const s=Q().filter(a=>a!==t);try{localStorage.setItem(Z,JSON.stringify(s))}catch{return s}return s}const de=t=>/^\d/.test(t),vs=(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 ys(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,i)=>vs(W(o,void 0,a),W(i,void 0,a))),{system:n,labels:r}}function js(t,s,a){const n=at(s)&&t.unseenCount>0;return{id:t.mailboxId,name:W(t,s,a),unseen:n?t.unseenCount:void 0,role:s,fullPath:t.fullPath}}function Ss(){const t=ye(),s=st({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=G(),o=Ss(),{searchInput:i,onSearchChange:d}=je(),[x,p]=l.useState(Q),{t:g}=Ze("mail",{useSuspense:!1}),m=l.useCallback((u,C)=>g(u,{defaultValue:C}),[g]),h=J({queries:t.map(u=>({...X({path:{accountId:u.accountId}}),staleTime:1/0}))}),{data:f}=Ce(et()),b=l.useMemo(()=>(f?.items??[]).filter(u=>Ut(u.status)).length,[f?.items]),v=l.useMemo(()=>t.map((u,C)=>{const N=h[C],O=N?.data?.items??[],w=tt(u.folderAppointments),{system:k,labels:D}=ys(O,w,m),H=N?.isError?"error":N?.isLoading?"loading":"ready";return{id:u.accountId,label:u.email,email:u.email,muted:!!u.muted,outboxPending:b,status:H,onRetry:()=>N?.refetch(),mailboxes:[...k,...D].map(_=>js(_,w.get(_.mailboxId),m))}}),[t,h,b,m]),y=u=>{n.invalidateQueries({queryKey:nt({path:{mailboxId:u},query:{order:"desc"}})})},E=({navId:u,className:C,ariaLabel:N,title:O,children:w,onClick:k})=>u==="brief"?e.jsx(L,{to:"/mail/brief",search:{q:void 0},activeOptions:{includeSearch:!1},onClick:()=>k?.(),className:C,"aria-label":N,title:O,children:w}):u==="outbox"?e.jsx(L,{to:"/mail/outbox",search:{q:void 0},onClick:()=>k?.(),className:C,"aria-label":N,title:O,children:w}):u==="flagged"?e.jsx(L,{to:"/mail/flagged",search:{q:void 0},onClick:()=>k?.(),className:C,"aria-label":N,title:O,children:w}):u==="settings"?e.jsx(L,{to:"/settings/accounts",onClick:()=>k?.(),className:C,"aria-label":N,title:O,children:w}):e.jsx(L,{to:"/mail/$mailboxId",params:{mailboxId:u},search:{q:void 0},onClick:()=>{y(u),k?.()},className:C,"aria-label":N,title:O,children:w}),c=()=>{d(""),s?.()},S=i.trim(),A=S.length>0&&!x.includes(S)?S:void 0,R=l.useCallback(()=>{A&&p(gs(A))},[A]),F=l.useCallback(u=>{p(bs(u))},[]),q=l.useCallback(u=>{d(u),r({to:"/mail/brief",search:{q:u}}),s?.()},[d,r,s]);return e.jsx(is,{accounts:v,selectedNavId:o,onSelectNav:c,linkComponent:E,variant:a,savedSearches:x,saveableQuery:A,onSaveCurrentSearch:R,onSelectSavedSearch:q,onRemoveSavedSearch:F})}function Ns(){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 Cs({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(L,{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(Ns,{}),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 ks=({isOpen:t,onClose:s})=>{const a=l.useCallback(n=>{n.key==="Escape"&&(n.preventDefault(),n.stopPropagation(),n.stopImmediatePropagation(),s())},[s]);return l.useEffect(()=>{if(t)return window.addEventListener("keydown",a,!0),()=>window.removeEventListener("keydown",a,!0)},[t,a]),t?e.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[e.jsx(rt,{label:"Dismiss keyboard shortcuts",onDismiss:s,className:"backdrop-blur-sm"}),e.jsxs("div",{role:"dialog","aria-modal":"true","aria-label":"Keyboard shortcuts",className:ot("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:It.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,i)=>e.jsxs(l.Fragment,{children:[i>0&&r.keys[0]==="g"&&e.jsx("span",{className:"text-2xs text-fg-subtle",children:"then"}),e.jsx(ne,{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(ne,{children:"Esc"})," to close"]})})]})]}):null};function ws(t){const s=J({queries:t.map(a=>({...X({path:{accountId:a.accountId}}),staleTime:1/0}))});return l.useMemo(()=>Mt(s.map(a=>a.data?.items??[])),[s])}const Is=t=>t.map(s=>s.data?.items??[]);function Ms(t){const s=J({queries:t.map(a=>({...X({path:{accountId:a.accountId}}),staleTime:1/0})),combine:Is});return l.useMemo(()=>it(t.map((a,n)=>({folderAppointments:a.folderAppointments,mailboxes:s[n]??[]}))),[t,s])}var B={exports:{}},xe;function Os(){if(xe)return B.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:i}=n;if(!(typeof i=="number"&&i>=1))throw new TypeError(`Expected \`concurrency\` to be a number from 1 and up, got \`${i}\` (${typeof i})`);const d=[],x=s[Symbol.iterator]();let p=!1,g=!1,m=0,h=0;const f=()=>{if(p)return;const b=x.next(),v=h;if(h++,b.done){g=!0,m===0&&r(d);return}m++,Promise.resolve(b.value).then(y=>a(y,v)).then(y=>{d[v]=y,m--,f()},y=>{p=!0,o(y)})};for(let b=0;b<i&&(f(),!g);b++);});return B.exports=t,B.exports.default=t,B.exports}var Es=Os();const Rs=lt(Es),Ps=900*1e3,As=300,Ls=(t,s)=>{if(!t)return s;const a=Number.parseInt(t,10);return Number.isFinite(a)&&a>0?a:s},zs=60*1e3,Ts=t=>Math.max(Ls(t,As)*1e3,zs),V=Ts(xt().mailboxPollIntervalSeconds),Fs=5,U=new Set,Ds=(t,s,a=Ps)=>t.filter(n=>{const r=n.lastSyncAt;return r==null?!0:s-r>a}).map(n=>n.accountId),_s=(t,s,a=V)=>t-s>=a,Bs=(t,s)=>t.filter(a=>!s.has(a)),he=(t,s)=>{if(U.delete(t),dt(s,{softError:!0})){mt(s);return}console.warn("[remit] background mailbox sync failed",{accountId:t,error:s})},fe=(t,s)=>ct({path:{accountId:t},throwOnError:!0}).then(()=>{s.invalidateQueries({queryKey:ut({path:{accountId:t}})})}),Ks=t=>{const s=Ne(),a=l.useRef(t);a.current=t;const n=t.map(r=>r.accountId).join(",");l.useEffect(()=>{const r=Date.now(),i=Ds(a.current,r).filter(d=>!U.has(d));if(i.length!==0)for(const d of i)U.add(d),fe(d,s).catch(x=>{he(d,x)})},[n,s]),l.useEffect(()=>{let r=Date.now(),o;const i=new Set,d=()=>{r=Date.now();const g=Bs(a.current.map(m=>m.accountId),i);for(const m of g)i.add(m);Rs(g,m=>fe(m,s).catch(h=>{he(m,h)}).finally(()=>{i.delete(m)}),{concurrency:Fs})},x=()=>{if(document.visibilityState==="visible"){d(),o=setTimeout(x,V);return}},p=()=>{document.visibilityState==="visible"&&_s(Date.now(),r)&&(o!==void 0&&clearTimeout(o),d(),o=setTimeout(x,V))};return o=setTimeout(x,V),document.addEventListener("visibilitychange",p),()=>{o!==void 0&&clearTimeout(o),document.removeEventListener("visibilitychange",p)}},[n,s])},Oe="remit:intelligence-open";function Vs(){try{return localStorage.getItem(Oe)!=="closed"}catch{return!0}}function Qs(t){try{localStorage.setItem(Oe,t?"open":"closed")}catch{}}function qs({panels:t,prefersOpen:s,isDesktop:a,hasThread:n}){return t.length>0?t.includes("intelligence"):a&&n&&s}function oa(){const{q:t=""}=ht({from:"/mail"}),s=G(),a=Ot(),n=Lt(a),r=zt(),o=Tt(),i=r.find(Ft),d=i==="shortcuts",x=i==="nav",p=Et(),[g,m]=l.useState(Vs),h=qs({panels:r,prefersOpen:g,isDesktop:a==="desktop",hasThread:p!==void 0}),f=l.useCallback((j,ee)=>{o([...j?["intelligence"]:[],...ee?[ee]:[]])},[o]),b=l.useCallback(j=>{Qs(j),m(j),f(j,i)},[i,f]),v=l.useCallback(j=>{f(h,j)},[h,f]),[y,E]=l.useState(t),c=Gt(y,200),S=Kt(y,c),A=ae({select:j=>j.location.pathname}),R=ae({select:j=>ft(j.matches)}),[F,q]=l.useState(R);if(F!==R){const j=Bt(F,R,t);q(R),j!==void 0&&E(j)}const{data:u,isLoading:C,isError:N,error:O,refetch:w}=Ce({...pt(),staleTime:1/0}),k=!!(u&&(u.accounts?.length??0)===0);l.useEffect(()=>{k&&s({to:"/onboarding",replace:!0})},[k,s]),Rt({enabled:!d,bindings:[{key:"?",handler:()=>v("shortcuts"),noModifiers:!1,preventDefault:!0}]});const{openCompose:D}=Y(),H=l.useMemo(()=>({compose:()=>D({mode:"new"})}),[D]);Pt({enabled:!gt(A),handlers:H});const _=l.useCallback(j=>{E(j)},[]),Ee=l.useCallback(()=>{E("")},[]),Re=l.useCallback(()=>{E("")},[]),Pe=l.useCallback(()=>{b(!h)},[b,h]),I=u?.accounts??[],Ae=l.useMemo(()=>I.map(j=>j.accountId),[I]),Le=ws(I),ze=Ms(I),Te=l.useMemo(()=>At(I),[I]);Ks(I);const Fe=l.useCallback(()=>{i==="nav"&&v(void 0)},[i,v]),De={accounts:I,mailboxNameIndex:Le,accountNameIndex:Te,resultFolderIndex:ze,searchQuery:S,searchInput:y,searchViewKey:R,onSearchChange:_,onSearchClear:Ee,onSearchClearQuery:Re,intelligenceOpen:h,onToggleIntelligence:Pe},_e={isSinglePane:n,isLoading:C||k,intelligenceOpen:h,nav:e.jsx(Cs,{accounts:I,onMailboxSelect:Fe}),topBar:n?void 0:e.jsx(fs,{accounts:I}),overlay:n?e.jsx(ms,{}):void 0,navOpen:x,onOpenNav:()=>v("nav"),onCloseNav:()=>v(void 0)};return e.jsx(bt.Provider,{value:De,children:e.jsxs(Ht,{accountIds:Ae,children:[N?e.jsx("div",{className:"flex h-full items-center justify-center bg-canvas p-4",children:e.jsx(Yt,{title:"Couldn't load your account",error:O,onRetry:()=>{w()}})}):e.jsx(_t,{chrome:_e,children:e.jsx(vt,{})}),e.jsx(ks,{isOpen:d,onClose:()=>v(void 0)})]})})}export{oa as component,je as useMailContext};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as e}from"./index-
|
|
1
|
+
import{c as e}from"./index-DKG1l4OE.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{s as g,x as C,w,af as L,Q as _,
|
|
1
|
+
import{s as g,x as C,w,af as L,Q as _,cV as A,r as b,co as x,t as D,z as O,cW as p,E as N}from"./index-DKG1l4OE.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 Q({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({...A(),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=Q({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}=D("mail",{useSuspense:!1});return b.useCallback((t,a)=>e(t,{defaultValue:a}),[e])},ee=100,X=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(X(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 U(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 q=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 q.has(t)},E=p.length,K=(e,t)=>{const a=O(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"):E,s=a.has(r.mailboxId)?p.indexOf(a.get(r.mailboxId)??"inbox"):E;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=O(t);return(o?U(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{c9 as u,cX as l,cY as d,cZ as s,c_ as f,l as p,r as c,p as h,j as b,c$ as m,d0 as x}from"./index-DKG1l4OE.js";function O(e){const t=u({warn:e?.router===void 0}),n=e?.router||t;return l(n.stores.__store,d(e,n))}const r="search-scope";function S(e){const t=e.trim().replace(/\s+/g," ").toLowerCase();return/\s/.test(t)?`in:"${t}"`:`in:${t}`}function k(e){const t=s(e);return t!==void 0&&t.list!=="brief"}function v(e){const t=s(e);return t?.list==="mailbox"?t.mailboxId:void 0}function _(e){const t=v(e.matches);return t||(k(e.matches)?e.callerMailboxId:e.callerMailboxId??e.inTokenMailboxId)}function C(e,t){const n=s(e);return n?.list==="flagged"?{kind:"scoped",chip:{id:r,label:"is:starred"}}:n?.list==="outbox"?{kind:"scoped",chip:{id:r,label:"in:outbox"}}:n?.list==="mailbox"?t?{kind:"scoped",chip:{id:r,label:S(t)}}:{kind:"pending"}:{kind:"global"}}function F(e,t,n){return t.kind==="global"?{kind:"global"}:s(e)?.list==="flagged"?{kind:"collection"}:{kind:"folder",...n?{role:n}:{}}}const o=["intelligence","nav","shortcuts"],g=["nav","shortcuts"],R=e=>g.includes(e),P=f(o);function a(e){const t=new Set(e.split(",").map(n=>P.safeParse(n)).filter(n=>n.success).map(n=>n.data));return o.filter(n=>t.has(n))}function i(e){return o.filter(t=>e.includes(t)).join(",")}function N(){const e=p({select:t=>i(a(t.hash))});return c.useMemo(()=>a(e),[e])}function I(e=""){return i(a(e).filter(t=>!R(t)))}function j(){const e=h();return c.useCallback(t=>{e({search:!0,hash:i(t),replace:!0,hashScrollIntoView:!1})},[e])}const L=m(x);function w({fragment:e,...t}){return b.jsx(L,{...t,hash:e??I})}export{w as N,r as S,j as a,O as b,v as c,F as d,C as e,k as f,R as i,I as r,_ as s,N as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a1 as t,a2 as r,s as a,r as i,j as s}from"./index-
|
|
1
|
+
import{a1 as t,a2 as r,s as a,r as i,j as s}from"./index-DKG1l4OE.js";import{O as c}from"./OnboardingWizard-D8Zk-VXt.js";import"./kbd-CnUDSPH5.js";import"./account-form-helpers-CwJTqJha.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{D as s,j as o,a0 as i}from"./index-DKG1l4OE.js";import{a as m}from"./search-view-B5prVpGW.js";import{O as t}from"./OutboxPane-D2d4W5AT.js";import{u as a}from"./useSearchMirror-CiaVi7jg.js";import"./nav-link-BTQmJNls.js";import"./useSearchTokenContext-BNRIlJev.js";import"./kbd-CnUDSPH5.js";import"./enums-CCxx0t2v.js";import"./circle-check-big-BmnT3rLr.js";import"./clock-BNqM2h_T.js";import"./row-actions-DjIKrPVk.js";import"./rotate-ccw-CYszpTkF.js";import"./NavMenuButton-D_W6DXrb.js";import"./menu-DdqPoHXZ.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 L(){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{L as component};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as a}from"./index-
|
|
1
|
+
import{c as a}from"./index-DKG1l4OE.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};
|