@remit/web-client-dist 0.0.130 → 0.0.132
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/{ComposeBody-DTqaYgdZ.js → ComposeBody-DtX23AJb.js} +1 -1
- package/assets/{ErrorState-D6rTDuPX.js → ErrorState-cpxg8GQV.js} +1 -1
- package/assets/{OnboardingWizard-RRRJdWYS.js → OnboardingWizard-YG9ms3tT.js} +1 -1
- package/assets/{account-form-helpers-BPwKIAan.js → account-form-helpers-CTORbQ2Q.js} +1 -1
- package/assets/{accounts-3Lf2kr2s.js → accounts-D6IxmVPQ.js} +1 -1
- package/assets/{advanced-Bm5Azc5P.js → advanced-B6v2wsPn.js} +1 -1
- package/assets/{appearance-DoaCy-fC.js → appearance-C6s5BxKA.js} +1 -1
- package/assets/{avatar-CUA7uJyY.js → avatar-DkFnBYJL.js} +1 -1
- package/assets/{browser-ponyfill-CG3KwnMy.js → browser-ponyfill-DgcW9kqk.js} +2 -2
- package/assets/{circle-check-DvXuGOi1.js → circle-check-Y8xxXBWn.js} +1 -1
- package/assets/{download-Dh1eCo2E.js → download-uY9FPkiB.js} +1 -1
- package/assets/filters-DCet_nwk.js +1 -0
- package/assets/{flagged-QLrkA1Uk.js → flagged-D_nJ8vk_.js} +1 -1
- package/assets/{folder-DK-t9VEC.js → folder-CfIqg83l.js} +1 -1
- package/assets/{folders-Db8l-2D3.js → folders-BO5-vfLj.js} +1 -1
- package/assets/index-DK-yiglH.js +1 -0
- package/assets/{index-H7XSpYoL.js → index-DOCS9Vso.js} +26 -26
- package/assets/{index-lEk4ocu-.js → index-mbjaF-eV.js} +1 -1
- package/assets/{kbd-BKjAyAcB.js → kbd-DC2DgeJB.js} +1 -1
- package/assets/mail-CD0YL8J_.js +118 -0
- package/assets/onboarding-BmiN0nam.js +1 -0
- package/assets/{rotate-ccw-I9VzOzFd.js → rotate-ccw-H0Rih5UH.js} +1 -1
- package/assets/{senders-B560OeMX.js → senders-C6D-TOAC.js} +1 -1
- package/assets/settings-BaK_zRGk.js +1 -0
- package/assets/{settings-screen-BObRfoam.js → settings-screen-BkXxfSnc.js} +1 -1
- package/assets/suggested-vips-B2duvzfB.js +1 -0
- package/assets/{useDebouncedValue-B1CXBL4P.js → useDebouncedValue-DlSAqYdM.js} +1 -1
- package/assets/useRulePreview-CVKFPzUF.js +1 -0
- package/assets/{useSignature-F4bseK_l.js → useSignature-CH9JSm51.js} +1 -1
- package/index.html +1 -1
- package/package.json +1 -1
- package/assets/filters-DXqxvs4m.js +0 -1
- package/assets/index-BHrUY2Yy.js +0 -1
- package/assets/mail-CoctN5z4.js +0 -118
- package/assets/onboarding-ChiMBCMS.js +0 -1
- package/assets/settings-CqL3Tddw.js +0 -1
- package/assets/suggested-vips-C6Nj7Kq6.js +0 -1
- package/assets/useRulePreview-D9_wO5s2.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as N,j as e,D as C,bG as v,B as n,bH as b,r as p,y as x,k as z,i as f,d as R,bI as g,b as T,bJ as S,bK as I,bL as A,bM as M,ad as V,bC as _,bE as B}from"./index-H7XSpYoL.js";import{S as D}from"./settings-screen-BObRfoam.js";import{D as y}from"./download-Dh1eCo2E.js";import{R as j}from"./rotate-ccw-I9VzOzFd.js";import{C as L}from"./circle-check-DvXuGOi1.js";import"./avatar-CUA7uJyY.js";const U=N("CloudOff",[["path",{d:"m2 2 20 20",key:"1ooewy"}],["path",{d:"M5.782 5.782A7 7 0 0 0 9 19h8.5a4.5 4.5 0 0 0 1.307-.193",key:"yfwify"}],["path",{d:"M21.532 16.5A4.5 4.5 0 0 0 17.5 10h-1.79A7.008 7.008 0 0 0 10 5.07",key:"jlfiyv"}]]);const k=N("ExternalLink",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]),E=["Remit restarts. Mail stops loading for about a minute and this page will lose its connection while that happens.","Nothing is sent, deleted or moved. Your mail stays at your provider.","If the new version does not come back up, the version you are running now is restored automatically."];function H({open:s,currentVersion:t,release:a,appliesSchemaMigration:i=!1,onClose:r,onConfirm:l}){return s?e.jsx(C,{open:!0,onClose:r,title:`Install Remit ${a.version}`,children:e.jsxs("div",{className:"flex max-h-[80vh] flex-col",children:[e.jsxs("header",{className:"space-y-1 border-b border-line px-4 py-3",children:[e.jsxs("h3",{className:"text-sm font-semibold text-fg",children:["Install Remit ",a.version,"?"]}),e.jsxs("p",{className:"text-xs text-fg-muted",children:["You are on ",t,". ",a.version," was released"," ",v(a.releasedAt),"."]})]}),e.jsxs("div",{className:"flex-1 space-y-3 overflow-auto px-4 py-3",children:[e.jsx("p",{className:"text-sm text-fg-muted",children:a.summary}),e.jsxs("ul",{className:"space-y-2",children:[E.map(c=>e.jsxs("li",{className:"flex gap-2 text-sm text-fg-muted",children:[e.jsx("span",{className:"mt-1.5 size-1.5 shrink-0 rounded-full bg-fg-subtle"}),e.jsx("span",{children:c})]},c)),i&&e.jsxs("li",{className:"flex gap-2 text-sm text-fg-muted",children:[e.jsx("span",{className:"mt-1.5 size-1.5 shrink-0 rounded-full bg-fg-subtle"}),e.jsx("span",{children:"This version updates the database while Remit is offline. The step forward cannot be undone by hand, but a failed start is still rolled back to the version and data you have now."})]})]}),e.jsx("p",{className:"text-xs text-fg-subtle",children:"Good moment for this: when you are not waiting on a message."})]}),e.jsxs("footer",{className:"flex flex-wrap items-center justify-end gap-2 border-t border-line px-4 py-3",children:[e.jsx(n,{variant:"ghost",size:"sm",onClick:r,children:"Not now"}),e.jsx(b,{variant:"secondary",size:"sm",external:!0,href:a.releaseNotesUrl,icon:e.jsx(k,{className:"size-3.5"}),children:"Release notes"}),e.jsx(n,{size:"sm",icon:e.jsx(y,{className:"size-3.5"}),onClick:l,children:"Install and restart"})]})]})}):null}function d({children:s,tone:t}){return e.jsx("div",{className:T("rounded-sm border bg-surface px-row-inset py-3",t==="danger"?"border-danger/50":"border-line"),children:s})}function Y({state:s,onCheck:t,onInstall:a,onDismissResult:i,now:r=Date.now()}){const[l,c]=p.useState(null),m=s.status==="checking",o=s.status==="available",h=()=>{if(m){c("Already checking. The result appears here in a moment.");return}c(null),t()},u=()=>{if(!o&&s.status!=="rolledBack"&&s.status!=="abandoned"){c("There is no update to install. Check for updates first — if one is found it appears here.");return}c(null),a()},w=(()=>{switch(s.status){case"upToDate":return e.jsx(d,{children:e.jsxs("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[e.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[e.jsx(L,{className:"size-4 shrink-0 text-positive","aria-hidden":!0}),e.jsxs("p",{className:"text-sm text-fg",children:["Remit ",s.version," is the latest version.",e.jsxs("span",{className:"text-fg-subtle",children:[" ","Checked ",g(s.checkedAt,r),"."]})]})]}),e.jsx(n,{variant:"secondary",size:"sm",className:"shrink-0",onClick:h,children:"Check again"})]})});case"checking":return e.jsx(d,{children:e.jsxs("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[e.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[e.jsx(f,{className:"size-4 shrink-0 animate-spin text-fg-subtle","aria-hidden":!0}),e.jsxs("p",{className:"text-sm text-fg-muted",children:["Looking for a newer version. You are on ",s.version,"."]})]}),e.jsx(n,{variant:"secondary",size:"sm",className:"shrink-0",onClick:h,children:"Check again"})]})});case"checkFailed":return e.jsx(d,{children:e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx(U,{className:"mt-0.5 size-4 shrink-0 text-fg-subtle","aria-hidden":!0}),e.jsxs("div",{className:"min-w-0 space-y-1",children:[e.jsx("p",{className:"text-sm text-fg",children:"Could not reach the update source."}),e.jsx("p",{className:"text-xs text-fg-muted",children:s.reason}),e.jsxs("p",{className:"text-xs text-fg-subtle",children:["You are still on ",s.version," and it keeps working.",s.lastCheckedAt!==void 0&&e.jsxs(e.Fragment,{children:[" ","Last successful check"," ",g(s.lastCheckedAt,r),"."]})]})]})]}),e.jsx("div",{className:"flex justify-end",children:e.jsx(n,{variant:"secondary",size:"sm",onClick:h,children:"Try again"})})]})});case"available":return e.jsx(d,{children:e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsxs("span",{className:"text-sm font-semibold text-fg",children:["Remit ",s.release.version]}),e.jsx(R,{tone:"accent",children:"update available"}),e.jsxs("span",{className:"text-2xs text-fg-subtle",children:["released ",v(s.release.releasedAt)," · you are on ",s.version]})]}),e.jsx("p",{className:"text-sm text-fg-muted",children:s.release.summary}),e.jsx("p",{className:"text-xs text-fg-subtle",children:"Installing restarts Remit, so mail stops loading for about a minute. If the new version does not come back up, the one you are running now is restored on its own."}),e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsxs(n,{size:"sm",icon:e.jsx(y,{className:"size-3.5"}),onClick:u,children:["Install ",s.release.version]}),e.jsx(b,{variant:"secondary",size:"sm",external:!0,href:s.release.releaseNotesUrl,icon:e.jsx(k,{className:"size-3.5"}),children:"Release notes"})]})]})});case"applying":return e.jsx(d,{children:e.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[e.jsx(f,{className:"size-4 shrink-0 animate-spin text-accent-2","aria-hidden":!0}),e.jsxs("p",{className:"text-sm text-fg-muted",children:["Installing Remit ",s.target,". The restart screen has the details."]})]})});case"succeeded":return e.jsx(z,{tone:"success",onDismiss:i,children:e.jsxs("div",{className:"space-y-1",children:[e.jsxs("p",{className:"font-semibold",children:["Updated to Remit ",s.version,"."]}),e.jsxs("p",{children:["You were on ",s.previousVersion,"."," ",e.jsx("a",{href:s.releaseNotesUrl,target:"_blank",rel:"noopener noreferrer",className:"underline",children:"See what changed"}),"."]})]})});case"rolledBack":return e.jsx(d,{tone:"danger",children:e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx(x,{className:"mt-0.5 size-4 shrink-0 text-danger","aria-hidden":!0}),e.jsxs("div",{className:"min-w-0 space-y-1",children:[e.jsxs("p",{className:"text-sm font-semibold text-fg",children:["Remit ",s.attemptedVersion," did not start. Remit reports that it put ",s.version," back."]}),e.jsxs("p",{className:"text-sm text-fg-muted",children:["You are running ",s.version," again. A failed update can still have changed things on the way — the log below is the only account of what it got as far as doing."]})]})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"text-xs text-fg-subtle",children:"What Remit reported as the failure"}),e.jsx("code",{className:"block rounded-xs bg-danger-soft px-2 py-1 text-2xs text-danger",children:s.reason})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"text-xs text-fg-subtle",children:"Read the full log before trying again:"}),e.jsx("code",{className:"block rounded-xs bg-surface-sunken px-2 py-1 text-2xs text-fg-muted",children:s.logsCommand})]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsxs(n,{variant:"secondary",size:"sm",icon:e.jsx(j,{className:"size-3.5"}),onClick:u,children:["Try ",s.attemptedVersion," again"]}),e.jsxs(n,{variant:"ghost",size:"sm",onClick:i,children:["Stay on ",s.version]})]})]})});case"unreachable":return e.jsx(d,{tone:"danger",children:e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx(x,{className:"mt-0.5 size-4 shrink-0 text-danger","aria-hidden":!0}),e.jsxs("div",{className:"min-w-0 space-y-1",children:[e.jsxs("p",{className:"text-sm font-semibold text-fg",children:["Installing ",s.attemptedVersion," left the server unreachable."]}),e.jsx("p",{className:"text-sm text-fg-muted",children:"Remit has answered again since, but nothing here can say what happened during the silence."})]})]}),e.jsx("code",{className:"block rounded-xs bg-surface-sunken px-2 py-1 text-2xs text-fg-muted",children:s.logsCommand}),e.jsx("div",{className:"flex justify-end",children:e.jsx(n,{variant:"ghost",size:"sm",onClick:i,children:"Dismiss"})})]})});case"rollbackFailed":return e.jsx(d,{tone:"danger",children:e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx(x,{className:"mt-0.5 size-4 shrink-0 text-danger","aria-hidden":!0}),e.jsxs("div",{className:"min-w-0 space-y-1",children:[e.jsxs("p",{className:"text-sm font-semibold text-fg",children:["Remit ",s.attemptedVersion," did not start, and Remit could not put ",s.previousVersion," back."]}),e.jsx("p",{className:"text-sm text-fg-muted",children:"This is the one outcome Remit cannot resolve on its own. The server is in a half-changed state and needs you at a shell. The log below is the only account of where it stopped."})]})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"text-xs text-fg-subtle",children:"What Remit reported as the failure"}),e.jsx("code",{className:"block rounded-xs bg-danger-soft px-2 py-1 text-2xs text-danger",children:s.reason})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"text-xs text-fg-subtle",children:"Read the full log on the server:"}),e.jsx("code",{className:"block rounded-xs bg-surface-sunken px-2 py-1 text-2xs text-fg-muted",children:s.logsCommand})]}),e.jsx("div",{className:"flex justify-end",children:e.jsx(n,{variant:"ghost",size:"sm",onClick:i,children:"Dismiss"})})]})});case"abandoned":return e.jsx(d,{tone:"danger",children:e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx(x,{className:"mt-0.5 size-4 shrink-0 text-fg-subtle","aria-hidden":!0}),e.jsxs("div",{className:"min-w-0 space-y-1",children:[e.jsxs("p",{className:"text-sm font-semibold text-fg",children:["Remit ",s.attemptedVersion," was not installed. Nothing changed."]}),e.jsxs("p",{className:"text-sm text-fg-muted",children:["The update stopped before it altered anything. You are still running ",s.version,"."]})]})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"text-xs text-fg-subtle",children:"What Remit reported"}),e.jsx("code",{className:"block rounded-xs bg-surface-sunken px-2 py-1 text-2xs text-fg-muted",children:s.reason})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"text-xs text-fg-subtle",children:"Read the full log before trying again:"}),e.jsx("code",{className:"block rounded-xs bg-surface-sunken px-2 py-1 text-2xs text-fg-muted",children:s.logsCommand})]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsxs(n,{variant:"secondary",size:"sm",icon:e.jsx(j,{className:"size-3.5"}),onClick:u,children:["Try ",s.attemptedVersion," again"]}),e.jsxs(n,{variant:"ghost",size:"sm",onClick:i,children:["Stay on ",s.version]})]})]})});default:return s}})();return e.jsxs("section",{className:"space-y-3",children:[e.jsxs("header",{className:"space-y-1",children:[e.jsx("h2",{className:"text-sm font-semibold text-fg",children:"Updates"}),e.jsx("p",{className:"text-xs text-fg-muted",children:"This Remit runs on your own server, so it updates when you say so. Your mail lives at your provider and is never touched by an update."})]}),w,l&&e.jsx("p",{role:"status",className:"text-xs text-fg-muted",children:l})]})}function O(){const{surface:s,release:t,currentVersion:a,appliesSchemaMigration:i,onCheck:r,install:l,onDismissResult:c}=S(),[m,o]=p.useState(!1);return s.status!=="ready"?null:e.jsxs(e.Fragment,{children:[e.jsx(Y,{state:s.section,onCheck:r,onInstall:()=>o(!0),onDismissResult:c}),t&&a&&e.jsx(H,{open:m,currentVersion:a,release:t,appliesSchemaMigration:i,onClose:()=>o(!1),onConfirm:()=>{o(!1),l(t.version)}})]})}function P(s){try{return new Date(s).toLocaleString(void 0,{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}catch{return s}}function G({sha:s=A,commitUrl:t=I,buildTime:a=M}){return e.jsxs("p",{className:"text-xs text-fg-subtle",children:["Version"," ",t?e.jsx("a",{href:t,target:"_blank",rel:"noopener noreferrer",className:"font-mono hover:text-fg-muted hover:underline",children:s}):e.jsx("span",{className:"font-mono",children:s})," · ",e.jsxs("span",{children:["Built ",P(a)]})]})}const q=e.jsx("div",{className:"space-y-3",children:e.jsxs("p",{children:[e.jsx("strong",{className:"text-fg",children:"Notification rules"}),", data export, and per-account diagnostics are coming in a future release."]})});function Z(){const s=V(),[t,a]=p.useState(!0),i=r=>{const l=B[r];l&&s({to:l})};return e.jsxs(D,{items:_,activeId:"advanced",title:"Advanced",description:"Notification rules, export, and diagnostics.",help:q,helpOpen:t,onToggleHelp:()=>a(r=>!r),onSelect:i,onBackToMail:()=>{s({to:"/mail"})},children:[e.jsx(O,{}),e.jsx("p",{className:"text-sm text-fg-muted",children:"Notification rules, data export, and raw sync diagnostics are coming in a future release."}),e.jsxs("div",{className:"border-t border-line pt-4 mt-4",children:[e.jsx("p",{className:"text-sm font-medium text-fg mb-1",children:"About"}),e.jsx(G,{})]})]})}export{Z as component};
|
|
1
|
+
import{a as N,j as e,D as C,bH as v,B as n,bI as b,r as p,z as x,k as z,i as f,d as R,bJ as g,b as T,bK as S,bL as I,bM as A,bN as M,ae as V,bD as _,bF as B}from"./index-DOCS9Vso.js";import{S as D}from"./settings-screen-BkXxfSnc.js";import{D as y}from"./download-uY9FPkiB.js";import{R as j}from"./rotate-ccw-H0Rih5UH.js";import{C as L}from"./circle-check-Y8xxXBWn.js";import"./avatar-DkFnBYJL.js";const U=N("CloudOff",[["path",{d:"m2 2 20 20",key:"1ooewy"}],["path",{d:"M5.782 5.782A7 7 0 0 0 9 19h8.5a4.5 4.5 0 0 0 1.307-.193",key:"yfwify"}],["path",{d:"M21.532 16.5A4.5 4.5 0 0 0 17.5 10h-1.79A7.008 7.008 0 0 0 10 5.07",key:"jlfiyv"}]]);const k=N("ExternalLink",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]),H=["Remit restarts. Mail stops loading for about a minute and this page will lose its connection while that happens.","Nothing is sent, deleted or moved. Your mail stays at your provider.","If the new version does not come back up, the version you are running now is restored automatically."];function E({open:s,currentVersion:t,release:a,appliesSchemaMigration:i=!1,onClose:r,onConfirm:l}){return s?e.jsx(C,{open:!0,onClose:r,title:`Install Remit ${a.version}`,children:e.jsxs("div",{className:"flex max-h-[80vh] flex-col",children:[e.jsxs("header",{className:"space-y-1 border-b border-line px-4 py-3",children:[e.jsxs("h3",{className:"text-sm font-semibold text-fg",children:["Install Remit ",a.version,"?"]}),e.jsxs("p",{className:"text-xs text-fg-muted",children:["You are on ",t,". ",a.version," was released"," ",v(a.releasedAt),"."]})]}),e.jsxs("div",{className:"flex-1 space-y-3 overflow-auto px-4 py-3",children:[e.jsx("p",{className:"text-sm text-fg-muted",children:a.summary}),e.jsxs("ul",{className:"space-y-2",children:[H.map(c=>e.jsxs("li",{className:"flex gap-2 text-sm text-fg-muted",children:[e.jsx("span",{className:"mt-1.5 size-1.5 shrink-0 rounded-full bg-fg-subtle"}),e.jsx("span",{children:c})]},c)),i&&e.jsxs("li",{className:"flex gap-2 text-sm text-fg-muted",children:[e.jsx("span",{className:"mt-1.5 size-1.5 shrink-0 rounded-full bg-fg-subtle"}),e.jsx("span",{children:"This version updates the database while Remit is offline. The step forward cannot be undone by hand, but a failed start is still rolled back to the version and data you have now."})]})]}),e.jsx("p",{className:"text-xs text-fg-subtle",children:"Good moment for this: when you are not waiting on a message."})]}),e.jsxs("footer",{className:"flex flex-wrap items-center justify-end gap-2 border-t border-line px-4 py-3",children:[e.jsx(n,{variant:"ghost",size:"sm",onClick:r,children:"Not now"}),e.jsx(b,{variant:"secondary",size:"sm",external:!0,href:a.releaseNotesUrl,icon:e.jsx(k,{className:"size-3.5"}),children:"Release notes"}),e.jsx(n,{size:"sm",icon:e.jsx(y,{className:"size-3.5"}),onClick:l,children:"Install and restart"})]})]})}):null}function d({children:s,tone:t}){return e.jsx("div",{className:T("rounded-sm border bg-surface px-row-inset py-3",t==="danger"?"border-danger/50":"border-line"),children:s})}function Y({state:s,onCheck:t,onInstall:a,onDismissResult:i,now:r=Date.now()}){const[l,c]=p.useState(null),m=s.status==="checking",o=s.status==="available",h=()=>{if(m){c("Already checking. The result appears here in a moment.");return}c(null),t()},u=()=>{if(!o&&s.status!=="rolledBack"&&s.status!=="abandoned"){c("There is no update to install. Check for updates first — if one is found it appears here.");return}c(null),a()},w=(()=>{switch(s.status){case"upToDate":return e.jsx(d,{children:e.jsxs("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[e.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[e.jsx(L,{className:"size-4 shrink-0 text-positive","aria-hidden":!0}),e.jsxs("p",{className:"text-sm text-fg",children:["Remit ",s.version," is the latest version.",e.jsxs("span",{className:"text-fg-subtle",children:[" ","Checked ",g(s.checkedAt,r),"."]})]})]}),e.jsx(n,{variant:"secondary",size:"sm",className:"shrink-0",onClick:h,children:"Check again"})]})});case"checking":return e.jsx(d,{children:e.jsxs("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[e.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[e.jsx(f,{className:"size-4 shrink-0 animate-spin text-fg-subtle","aria-hidden":!0}),e.jsxs("p",{className:"text-sm text-fg-muted",children:["Looking for a newer version. You are on ",s.version,"."]})]}),e.jsx(n,{variant:"secondary",size:"sm",className:"shrink-0",onClick:h,children:"Check again"})]})});case"checkFailed":return e.jsx(d,{children:e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx(U,{className:"mt-0.5 size-4 shrink-0 text-fg-subtle","aria-hidden":!0}),e.jsxs("div",{className:"min-w-0 space-y-1",children:[e.jsx("p",{className:"text-sm text-fg",children:"Could not reach the update source."}),e.jsx("p",{className:"text-xs text-fg-muted",children:s.reason}),e.jsxs("p",{className:"text-xs text-fg-subtle",children:["You are still on ",s.version," and it keeps working.",s.lastCheckedAt!==void 0&&e.jsxs(e.Fragment,{children:[" ","Last successful check"," ",g(s.lastCheckedAt,r),"."]})]})]})]}),e.jsx("div",{className:"flex justify-end",children:e.jsx(n,{variant:"secondary",size:"sm",onClick:h,children:"Try again"})})]})});case"available":return e.jsx(d,{children:e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsxs("span",{className:"text-sm font-semibold text-fg",children:["Remit ",s.release.version]}),e.jsx(R,{tone:"accent",children:"update available"}),e.jsxs("span",{className:"text-2xs text-fg-subtle",children:["released ",v(s.release.releasedAt)," · you are on ",s.version]})]}),e.jsx("p",{className:"text-sm text-fg-muted",children:s.release.summary}),e.jsx("p",{className:"text-xs text-fg-subtle",children:"Installing restarts Remit, so mail stops loading for about a minute. If the new version does not come back up, the one you are running now is restored on its own."}),e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsxs(n,{size:"sm",icon:e.jsx(y,{className:"size-3.5"}),onClick:u,children:["Install ",s.release.version]}),e.jsx(b,{variant:"secondary",size:"sm",external:!0,href:s.release.releaseNotesUrl,icon:e.jsx(k,{className:"size-3.5"}),children:"Release notes"})]})]})});case"applying":return e.jsx(d,{children:e.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[e.jsx(f,{className:"size-4 shrink-0 animate-spin text-accent-2","aria-hidden":!0}),e.jsxs("p",{className:"text-sm text-fg-muted",children:["Installing Remit ",s.target,". The restart screen has the details."]})]})});case"succeeded":return e.jsx(z,{tone:"success",onDismiss:i,children:e.jsxs("div",{className:"space-y-1",children:[e.jsxs("p",{className:"font-semibold",children:["Updated to Remit ",s.version,"."]}),e.jsxs("p",{children:["You were on ",s.previousVersion,"."," ",e.jsx("a",{href:s.releaseNotesUrl,target:"_blank",rel:"noopener noreferrer",className:"underline",children:"See what changed"}),"."]})]})});case"rolledBack":return e.jsx(d,{tone:"danger",children:e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx(x,{className:"mt-0.5 size-4 shrink-0 text-danger","aria-hidden":!0}),e.jsxs("div",{className:"min-w-0 space-y-1",children:[e.jsxs("p",{className:"text-sm font-semibold text-fg",children:["Remit ",s.attemptedVersion," did not start. Remit reports that it put ",s.version," back."]}),e.jsxs("p",{className:"text-sm text-fg-muted",children:["You are running ",s.version," again. A failed update can still have changed things on the way — the log below is the only account of what it got as far as doing."]})]})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"text-xs text-fg-subtle",children:"What Remit reported as the failure"}),e.jsx("code",{className:"block rounded-xs bg-danger-soft px-2 py-1 text-2xs text-danger",children:s.reason})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"text-xs text-fg-subtle",children:"Read the full log before trying again:"}),e.jsx("code",{className:"block rounded-xs bg-surface-sunken px-2 py-1 text-2xs text-fg-muted",children:s.logsCommand})]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsxs(n,{variant:"secondary",size:"sm",icon:e.jsx(j,{className:"size-3.5"}),onClick:u,children:["Try ",s.attemptedVersion," again"]}),e.jsxs(n,{variant:"ghost",size:"sm",onClick:i,children:["Stay on ",s.version]})]})]})});case"unreachable":return e.jsx(d,{tone:"danger",children:e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx(x,{className:"mt-0.5 size-4 shrink-0 text-danger","aria-hidden":!0}),e.jsxs("div",{className:"min-w-0 space-y-1",children:[e.jsxs("p",{className:"text-sm font-semibold text-fg",children:["Installing ",s.attemptedVersion," left the server unreachable."]}),e.jsx("p",{className:"text-sm text-fg-muted",children:"Remit has answered again since, but nothing here can say what happened during the silence."})]})]}),e.jsx("code",{className:"block rounded-xs bg-surface-sunken px-2 py-1 text-2xs text-fg-muted",children:s.logsCommand}),e.jsx("div",{className:"flex justify-end",children:e.jsx(n,{variant:"ghost",size:"sm",onClick:i,children:"Dismiss"})})]})});case"rollbackFailed":return e.jsx(d,{tone:"danger",children:e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx(x,{className:"mt-0.5 size-4 shrink-0 text-danger","aria-hidden":!0}),e.jsxs("div",{className:"min-w-0 space-y-1",children:[e.jsxs("p",{className:"text-sm font-semibold text-fg",children:["Remit ",s.attemptedVersion," did not start, and Remit could not put ",s.previousVersion," back."]}),e.jsx("p",{className:"text-sm text-fg-muted",children:"This is the one outcome Remit cannot resolve on its own. The server is in a half-changed state and needs you at a shell. The log below is the only account of where it stopped."})]})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"text-xs text-fg-subtle",children:"What Remit reported as the failure"}),e.jsx("code",{className:"block rounded-xs bg-danger-soft px-2 py-1 text-2xs text-danger",children:s.reason})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"text-xs text-fg-subtle",children:"Read the full log on the server:"}),e.jsx("code",{className:"block rounded-xs bg-surface-sunken px-2 py-1 text-2xs text-fg-muted",children:s.logsCommand})]}),e.jsx("div",{className:"flex justify-end",children:e.jsx(n,{variant:"ghost",size:"sm",onClick:i,children:"Dismiss"})})]})});case"abandoned":return e.jsx(d,{tone:"danger",children:e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx(x,{className:"mt-0.5 size-4 shrink-0 text-fg-subtle","aria-hidden":!0}),e.jsxs("div",{className:"min-w-0 space-y-1",children:[e.jsxs("p",{className:"text-sm font-semibold text-fg",children:["Remit ",s.attemptedVersion," was not installed. Nothing changed."]}),e.jsxs("p",{className:"text-sm text-fg-muted",children:["The update stopped before it altered anything. You are still running ",s.version,"."]})]})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"text-xs text-fg-subtle",children:"What Remit reported"}),e.jsx("code",{className:"block rounded-xs bg-surface-sunken px-2 py-1 text-2xs text-fg-muted",children:s.reason})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"text-xs text-fg-subtle",children:"Read the full log before trying again:"}),e.jsx("code",{className:"block rounded-xs bg-surface-sunken px-2 py-1 text-2xs text-fg-muted",children:s.logsCommand})]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsxs(n,{variant:"secondary",size:"sm",icon:e.jsx(j,{className:"size-3.5"}),onClick:u,children:["Try ",s.attemptedVersion," again"]}),e.jsxs(n,{variant:"ghost",size:"sm",onClick:i,children:["Stay on ",s.version]})]})]})});default:return s}})();return e.jsxs("section",{className:"space-y-3",children:[e.jsxs("header",{className:"space-y-1",children:[e.jsx("h2",{className:"text-sm font-semibold text-fg",children:"Updates"}),e.jsx("p",{className:"text-xs text-fg-muted",children:"This Remit runs on your own server, so it updates when you say so. Your mail lives at your provider and is never touched by an update."})]}),w,l&&e.jsx("p",{role:"status",className:"text-xs text-fg-muted",children:l})]})}function O(){const{surface:s,release:t,currentVersion:a,appliesSchemaMigration:i,onCheck:r,install:l,onDismissResult:c}=S(),[m,o]=p.useState(!1);return s.status!=="ready"?null:e.jsxs(e.Fragment,{children:[e.jsx(Y,{state:s.section,onCheck:r,onInstall:()=>o(!0),onDismissResult:c}),t&&a&&e.jsx(E,{open:m,currentVersion:a,release:t,appliesSchemaMigration:i,onClose:()=>o(!1),onConfirm:()=>{o(!1),l(t.version)}})]})}function P(s){try{return new Date(s).toLocaleString(void 0,{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}catch{return s}}function F({sha:s=A,commitUrl:t=I,buildTime:a=M}){return e.jsxs("p",{className:"text-xs text-fg-subtle",children:["Version"," ",t?e.jsx("a",{href:t,target:"_blank",rel:"noopener noreferrer",className:"font-mono hover:text-fg-muted hover:underline",children:s}):e.jsx("span",{className:"font-mono",children:s})," · ",e.jsxs("span",{children:["Built ",P(a)]})]})}const q=e.jsx("div",{className:"space-y-3",children:e.jsxs("p",{children:[e.jsx("strong",{className:"text-fg",children:"Notification rules"}),", data export, and per-account diagnostics are coming in a future release."]})});function Z(){const s=V(),[t,a]=p.useState(!0),i=r=>{const l=B[r];l&&s({to:l})};return e.jsxs(D,{items:_,activeId:"advanced",title:"Advanced",description:"Notification rules, export, and diagnostics.",help:q,helpOpen:t,onToggleHelp:()=>a(r=>!r),onSelect:i,onBackToMail:()=>{s({to:"/mail"})},children:[e.jsx(O,{}),e.jsx("p",{className:"text-sm text-fg-muted",children:"Notification rules, data export, and raw sync diagnostics are coming in a future release."}),e.jsxs("div",{className:"border-t border-line pt-4 mt-4",children:[e.jsx("p",{className:"text-sm font-medium text-fg mb-1",children:"About"}),e.jsx(F,{})]})]})}export{Z as component};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{ae as g,r as s,bO as y,j as e,bD as u,bP as l,bF as S,bQ as b}from"./index-DOCS9Vso.js";import{S as j}from"./settings-screen-BkXxfSnc.js";import"./avatar-DkFnBYJL.js";const o="remit.density";function T(){return typeof localStorage>"u"?"comfortable":localStorage.getItem(o)??"comfortable"}const v=e.jsxs("div",{className:"space-y-3",children:[e.jsxs("p",{children:[e.jsx("strong",{className:"text-fg",children:"Density"})," controls how much information fits on screen. Compact is great on smaller displays; Comfortable gives each item more breathing room."]}),e.jsxs("p",{children:[e.jsx("strong",{className:"text-fg",children:"Theme"})," switches between light, dark, and system-preference modes instantly. The change takes effect across the whole app immediately."]}),e.jsx("p",{className:"text-2xs text-fg-subtle",children:"Preferences are stored locally in this browser. Server-side sync is coming soon."})]});function I(){const a=g(),[i,r]=s.useState(!0),[c,m]=s.useState(T),[p,d]=s.useState(y),h=t=>{m(t),typeof localStorage<"u"&&localStorage.setItem(o,t)},f=t=>{d(t),b(t)},x=t=>{const n=S[t];n&&a({to:n})};return e.jsx(j,{items:u,activeId:"appearance",title:"Appearance",description:"Display density and colour theme — instant-apply.",help:v,helpOpen:i,onToggleHelp:()=>r(t=>!t),onSelect:x,onBackToMail:()=>{a({to:"/mail"})},children:e.jsxs("div",{className:"space-y-5",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx("p",{className:"text-sm font-medium text-fg",children:"Density"}),e.jsx(l,{name:"density","aria-label":"Density",value:c,onChange:h,options:[{value:"comfortable",label:"Comfortable"},{value:"compact",label:"Compact"}]}),e.jsx("p",{className:"text-xs text-fg-subtle",children:"Controls the spacing of message rows in the mail list."})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("p",{className:"text-sm font-medium text-fg",children:"Theme"}),e.jsx(l,{name:"theme","aria-label":"Theme",value:p,onChange:f,options:[{value:"system",label:"System"},{value:"light",label:"Light"},{value:"dark",label:"Dark"}]}),e.jsx("p",{className:"text-xs text-fg-subtle",children:"Applies immediately. System default follows your OS preference."})]})]})})}export{I as component};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as l,r as h,j as p,b as u}from"./index-
|
|
1
|
+
import{a as l,r as h,j as p,b as u}from"./index-DOCS9Vso.js";const f=l("CircleHelp",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);const m=l("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"}]]),y={sm:"size-7 text-2xs",md:"size-9 text-sm",lg:"size-11 text-md"},r=["oklch(0.6 0.08 150)","oklch(0.6 0.08 185)","oklch(0.6 0.08 215)","oklch(0.6 0.07 250)","oklch(0.6 0.07 310)","oklch(0.62 0.07 110)"],k="oklch(0.97 0.012 90)";function x(t){const e=t.trim().split(/\s+/).filter(Boolean);return e.length===0?"?":e.length===1?e[0].slice(0,2).toUpperCase():(e[0][0]+e[e.length-1][0]).toUpperCase()}function g({name:t,email:e,size:c="md",className:i}){const a=h.useMemo(()=>{const o=e??t;let s=0;for(let n=0;n<o.length;n++)s=s*31+o.charCodeAt(n)>>>0;return r[s%r.length]},[t,e]);return p.jsx("span",{className:u("inline-flex shrink-0 items-center justify-center rounded-full font-semibold select-none",y[c],i),style:{backgroundColor:a,color:k},"aria-hidden":!0,children:x(t)})}export{g as A,f as C,m as M};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
2
|
-
`)===0?n.substr(1,n.length):n}).forEach(function(n){var s=n.split(":"),o=s.shift().trim();if(o){var
|
|
1
|
+
import{c9 as A,bg as $}from"./index-DOCS9Vso.js";function X(g,d){for(var b=0;b<d.length;b++){const y=d[b];if(typeof y!="string"&&!Array.isArray(y)){for(const l in y)if(l!=="default"&&!(l in g)){const p=Object.getOwnPropertyDescriptor(y,l);p&&Object.defineProperty(g,l,p.get?p:{enumerable:!0,get:()=>y[l]})}}}return Object.freeze(Object.defineProperty(g,Symbol.toStringTag,{value:"Module"}))}var E={exports:{}},H;function J(){return H||(H=1,(function(g,d){var b=typeof globalThis<"u"&&globalThis||typeof self<"u"&&self||typeof A<"u"&&A,y=(function(){function p(){this.fetch=!1,this.DOMException=b.DOMException}return p.prototype=b,new p})();(function(p){(function(h){var a=typeof p<"u"&&p||typeof self<"u"&&self||typeof A<"u"&&A||{},u={searchParams:"URLSearchParams"in a,iterable:"Symbol"in a&&"iterator"in Symbol,blob:"FileReader"in a&&"Blob"in a&&(function(){try{return new Blob,!0}catch{return!1}})(),formData:"FormData"in a,arrayBuffer:"ArrayBuffer"in a};function F(e){return e&&DataView.prototype.isPrototypeOf(e)}if(u.arrayBuffer)var q=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],C=ArrayBuffer.isView||function(e){return e&&q.indexOf(Object.prototype.toString.call(e))>-1};function v(e){if(typeof e!="string"&&(e=String(e)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(e)||e==="")throw new TypeError('Invalid character in header field name: "'+e+'"');return e.toLowerCase()}function T(e){return typeof e!="string"&&(e=String(e)),e}function B(e){var t={next:function(){var r=e.shift();return{done:r===void 0,value:r}}};return u.iterable&&(t[Symbol.iterator]=function(){return t}),t}function i(e){this.map={},e instanceof i?e.forEach(function(t,r){this.append(r,t)},this):Array.isArray(e)?e.forEach(function(t){if(t.length!=2)throw new TypeError("Headers constructor: expected name/value pair to be length 2, found"+t.length);this.append(t[0],t[1])},this):e&&Object.getOwnPropertyNames(e).forEach(function(t){this.append(t,e[t])},this)}i.prototype.append=function(e,t){e=v(e),t=T(t);var r=this.map[e];this.map[e]=r?r+", "+t:t},i.prototype.delete=function(e){delete this.map[v(e)]},i.prototype.get=function(e){return e=v(e),this.has(e)?this.map[e]:null},i.prototype.has=function(e){return this.map.hasOwnProperty(v(e))},i.prototype.set=function(e,t){this.map[v(e)]=T(t)},i.prototype.forEach=function(e,t){for(var r in this.map)this.map.hasOwnProperty(r)&&e.call(t,this.map[r],r,this)},i.prototype.keys=function(){var e=[];return this.forEach(function(t,r){e.push(r)}),B(e)},i.prototype.values=function(){var e=[];return this.forEach(function(t){e.push(t)}),B(e)},i.prototype.entries=function(){var e=[];return this.forEach(function(t,r){e.push([r,t])}),B(e)},u.iterable&&(i.prototype[Symbol.iterator]=i.prototype.entries);function O(e){if(!e._noBody){if(e.bodyUsed)return Promise.reject(new TypeError("Already read"));e.bodyUsed=!0}}function D(e){return new Promise(function(t,r){e.onload=function(){t(e.result)},e.onerror=function(){r(e.error)}})}function I(e){var t=new FileReader,r=D(t);return t.readAsArrayBuffer(e),r}function M(e){var t=new FileReader,r=D(t),n=/charset=([A-Za-z0-9_-]+)/.exec(e.type),s=n?n[1]:"utf-8";return t.readAsText(e,s),r}function L(e){for(var t=new Uint8Array(e),r=new Array(t.length),n=0;n<t.length;n++)r[n]=String.fromCharCode(t[n]);return r.join("")}function R(e){if(e.slice)return e.slice(0);var t=new Uint8Array(e.byteLength);return t.set(new Uint8Array(e)),t.buffer}function U(){return this.bodyUsed=!1,this._initBody=function(e){this.bodyUsed=this.bodyUsed,this._bodyInit=e,e?typeof e=="string"?this._bodyText=e:u.blob&&Blob.prototype.isPrototypeOf(e)?this._bodyBlob=e:u.formData&&FormData.prototype.isPrototypeOf(e)?this._bodyFormData=e:u.searchParams&&URLSearchParams.prototype.isPrototypeOf(e)?this._bodyText=e.toString():u.arrayBuffer&&u.blob&&F(e)?(this._bodyArrayBuffer=R(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):u.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(e)||C(e))?this._bodyArrayBuffer=R(e):this._bodyText=e=Object.prototype.toString.call(e):(this._noBody=!0,this._bodyText=""),this.headers.get("content-type")||(typeof e=="string"?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):u.searchParams&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},u.blob&&(this.blob=function(){var e=O(this);if(e)return e;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))}),this.arrayBuffer=function(){if(this._bodyArrayBuffer){var e=O(this);return e||(ArrayBuffer.isView(this._bodyArrayBuffer)?Promise.resolve(this._bodyArrayBuffer.buffer.slice(this._bodyArrayBuffer.byteOffset,this._bodyArrayBuffer.byteOffset+this._bodyArrayBuffer.byteLength)):Promise.resolve(this._bodyArrayBuffer))}else{if(u.blob)return this.blob().then(I);throw new Error("could not read as ArrayBuffer")}},this.text=function(){var e=O(this);if(e)return e;if(this._bodyBlob)return M(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(L(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},u.formData&&(this.formData=function(){return this.text().then(z)}),this.json=function(){return this.text().then(JSON.parse)},this}var N=["CONNECT","DELETE","GET","HEAD","OPTIONS","PATCH","POST","PUT","TRACE"];function k(e){var t=e.toUpperCase();return N.indexOf(t)>-1?t:e}function w(e,t){if(!(this instanceof w))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');t=t||{};var r=t.body;if(e instanceof w){if(e.bodyUsed)throw new TypeError("Already read");this.url=e.url,this.credentials=e.credentials,t.headers||(this.headers=new i(e.headers)),this.method=e.method,this.mode=e.mode,this.signal=e.signal,!r&&e._bodyInit!=null&&(r=e._bodyInit,e.bodyUsed=!0)}else this.url=String(e);if(this.credentials=t.credentials||this.credentials||"same-origin",(t.headers||!this.headers)&&(this.headers=new i(t.headers)),this.method=k(t.method||this.method||"GET"),this.mode=t.mode||this.mode||null,this.signal=t.signal||this.signal||(function(){if("AbortController"in a){var o=new AbortController;return o.signal}})(),this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&r)throw new TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(r),(this.method==="GET"||this.method==="HEAD")&&(t.cache==="no-store"||t.cache==="no-cache")){var n=/([?&])_=[^&]*/;if(n.test(this.url))this.url=this.url.replace(n,"$1_="+new Date().getTime());else{var s=/\?/;this.url+=(s.test(this.url)?"&":"?")+"_="+new Date().getTime()}}}w.prototype.clone=function(){return new w(this,{body:this._bodyInit})};function z(e){var t=new FormData;return e.trim().split("&").forEach(function(r){if(r){var n=r.split("="),s=n.shift().replace(/\+/g," "),o=n.join("=").replace(/\+/g," ");t.append(decodeURIComponent(s),decodeURIComponent(o))}}),t}function G(e){var t=new i,r=e.replace(/\r?\n[\t ]+/g," ");return r.split("\r").map(function(n){return n.indexOf(`
|
|
2
|
+
`)===0?n.substr(1,n.length):n}).forEach(function(n){var s=n.split(":"),o=s.shift().trim();if(o){var _=s.join(":").trim();try{t.append(o,_)}catch(x){console.warn("Response "+x.message)}}}),t}U.call(w.prototype);function c(e,t){if(!(this instanceof c))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');if(t||(t={}),this.type="default",this.status=t.status===void 0?200:t.status,this.status<200||this.status>599)throw new RangeError("Failed to construct 'Response': The status provided (0) is outside the range [200, 599].");this.ok=this.status>=200&&this.status<300,this.statusText=t.statusText===void 0?"":""+t.statusText,this.headers=new i(t.headers),this.url=t.url||"",this._initBody(e)}U.call(c.prototype),c.prototype.clone=function(){return new c(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new i(this.headers),url:this.url})},c.error=function(){var e=new c(null,{status:200,statusText:""});return e.ok=!1,e.status=0,e.type="error",e};var V=[301,302,303,307,308];c.redirect=function(e,t){if(V.indexOf(t)===-1)throw new RangeError("Invalid status code");return new c(null,{status:t,headers:{location:e}})},h.DOMException=a.DOMException;try{new h.DOMException}catch{h.DOMException=function(t,r){this.message=t,this.name=r;var n=Error(t);this.stack=n.stack},h.DOMException.prototype=Object.create(Error.prototype),h.DOMException.prototype.constructor=h.DOMException}function P(e,t){return new Promise(function(r,n){var s=new w(e,t);if(s.signal&&s.signal.aborted)return n(new h.DOMException("Aborted","AbortError"));var o=new XMLHttpRequest;function _(){o.abort()}o.onload=function(){var f={statusText:o.statusText,headers:G(o.getAllResponseHeaders()||"")};s.url.indexOf("file://")===0&&(o.status<200||o.status>599)?f.status=200:f.status=o.status,f.url="responseURL"in o?o.responseURL:f.headers.get("X-Request-URL");var m="response"in o?o.response:o.responseText;setTimeout(function(){r(new c(m,f))},0)},o.onerror=function(){setTimeout(function(){n(new TypeError("Network request failed"))},0)},o.ontimeout=function(){setTimeout(function(){n(new TypeError("Network request timed out"))},0)},o.onabort=function(){setTimeout(function(){n(new h.DOMException("Aborted","AbortError"))},0)};function x(f){try{return f===""&&a.location.href?a.location.href:f}catch{return f}}if(o.open(s.method,x(s.url),!0),s.credentials==="include"?o.withCredentials=!0:s.credentials==="omit"&&(o.withCredentials=!1),"responseType"in o&&(u.blob?o.responseType="blob":u.arrayBuffer&&(o.responseType="arraybuffer")),t&&typeof t.headers=="object"&&!(t.headers instanceof i||a.Headers&&t.headers instanceof a.Headers)){var j=[];Object.getOwnPropertyNames(t.headers).forEach(function(f){j.push(v(f)),o.setRequestHeader(f,T(t.headers[f]))}),s.headers.forEach(function(f,m){j.indexOf(m)===-1&&o.setRequestHeader(m,f)})}else s.headers.forEach(function(f,m){o.setRequestHeader(m,f)});s.signal&&(s.signal.addEventListener("abort",_),o.onreadystatechange=function(){o.readyState===4&&s.signal.removeEventListener("abort",_)}),o.send(typeof s._bodyInit>"u"?null:s._bodyInit)})}return P.polyfill=!0,a.fetch||(a.fetch=P,a.Headers=i,a.Request=w,a.Response=c),h.Headers=i,h.Request=w,h.Response=c,h.fetch=P,h})({})})(y),y.fetch.ponyfill=!0,delete y.fetch.polyfill;var l=b.fetch?b:y;d=l.fetch,d.default=l.fetch,d.fetch=l.fetch,d.Headers=l.Headers,d.Request=l.Request,d.Response=l.Response,g.exports=d})(E,E.exports)),E.exports}var S=J();const Z=$(S),Q=X({__proto__:null,default:Z},[S]);export{Q as b};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as c}from"./index-
|
|
1
|
+
import{a as c}from"./index-DOCS9Vso.js";const r=c("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);export{r as C};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as o}from"./index-
|
|
1
|
+
import{a as o}from"./index-DOCS9Vso.js";const a=o("Download",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]]);export{a as D};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{$ as q,at as K,bR as Q,bS as G,r as h,j as e,bT as H,aZ as V,i as M,B as j,D as J,d as W,bU as Y,T as Z,ae as X,aq as I,ay as ee,bD as te,bF as se,af as ae,aO as O}from"./index-DOCS9Vso.js";import{S as ie}from"./settings-screen-BkXxfSnc.js";import{l as ne,N as F,d as re,r as le,e as oe,S as D,g as ce,n as de,u as me,B as ue,m as xe,o as pe,p as fe,q as he,b as ge}from"./useRulePreview-CVKFPzUF.js";import{C as w}from"./circle-check-Y8xxXBWn.js";import{E as T}from"./ErrorState-cpxg8GQV.js";import"./avatar-DkFnBYJL.js";const ve=(t,s)=>{const n=q(),a=K({...G(),onSuccess:()=>{t&&(n.invalidateQueries({queryKey:ne(t)}),s&&n.invalidateQueries({queryKey:Q({path:{accountId:t,filterId:s}})}))}}),{mutate:r}=a;return{updateFilter:h.useCallback(d=>{!t||!s||r({path:{accountId:t,filterId:s},body:d})},[t,s,r]),isPending:a.isPending,isSuccess:a.isSuccess,isError:a.isError,error:a.error,reset:a.reset}},je=(t,s=!1)=>({clauses:t.literalClauses.map((a,r)=>({id:`clause-${r}`,field:a.field,value:a.value})),matchOperator:t.matchOperator==="And"?"all":"any",widen:t.hasAnchor?{anchorCount:1,...s?{inactive:!0}:{}}:void 0,moveMailboxId:t.actionMailboxId!==F?t.actionMailboxId:void 0,scope:t.scope==="Temporary"?"until":"standing",until:t.scope==="Temporary"?ye(t.expiresAt):void 0,name:t.name}),ye=t=>{if(!t)return"";const s=Date.parse(t);if(Number.isNaN(s))return"";const n=new Date(s),a=r=>String(r).padStart(2,"0");return`${n.getFullYear()}-${a(n.getMonth()+1)}-${a(n.getDate())}`},E=t=>JSON.stringify({clauses:t.clauses.map(s=>[s.field,s.value]),operator:t.matchOperator,move:t.moveMailboxId??null,widen:t.widen?t.widen.inactive?"inactive":"active":"none"}),k=(t,s)=>E(t)!==E(s),be=(t,s)=>{const n={},a=(t.name??"").trim();return a!==(s.name??"").trim()&&(n.name=a),k(t,s)&&(n.matchOperator=t.matchOperator==="all"?"And":"Or",n.literalClauses=t.clauses.map(r=>({field:r.field,value:r.value})),n.actionMailboxId=t.moveMailboxId??F),n};function Ne({accountId:t,filter:s,folders:n,semanticUnavailable:a=!1,onClose:r}){const x=h.useMemo(()=>je(s,a),[s,a]),[d,l]=h.useState(x),[m,c]=h.useState(),[p,f]=h.useState(!1),b=h.useRef(0),y=re(t,le(d)),g=ve(t,s.filterId),u=oe(t),N=()=>c({mode:"add",draft:{field:D[0],value:""}}),C=o=>{const i=d.clauses.find(v=>v.id===o);i&&c({mode:"edit",clauseId:o,draft:{field:i.field,value:i.value}})},A=o=>c(i=>i&&{...i,draft:{...i.draft,field:o}}),R=o=>c(i=>i&&{...i,draft:{...i.draft,value:o}}),P=()=>{if(!m)return;const o=m.draft.field,i=de(o,m.draft.value);i!==""&&(l(v=>m.mode==="edit"&&m.clauseId?{...v,clauses:v.clauses.map(S=>S.id===m.clauseId?{id:S.id,field:o,value:i}:S)}:(b.current+=1,{...v,clauses:[...v.clauses,{id:`new-${b.current}`,field:o,value:i}]})),c(void 0))},$=o=>l(i=>({...i,clauses:i.clauses.filter(v=>v.id!==o)})),z=o=>l(i=>({...i,matchOperator:o})),L=o=>l(i=>({...i,moveMailboxId:o||void 0})),_=o=>l(i=>({...i,name:o})),B=()=>{const o=k(d,x),i=be(d,x);if(Object.keys(i).length===0){r();return}f(o),g.updateFilter(i)},U=()=>u.start(ce(d));return u.isStarting||u.isRunning||u.isDone?e.jsx(we,{progress:u.progress,isDone:u.isDone,onClose:r}):g.isPending?e.jsx(Ce,{}):g.isError?e.jsx(Oe,{onRetry:g.reset,onClose:r}):g.isSuccess?p?e.jsx(Fe,{preview:H(y),blocked:y.status!=="ready"||y.stale===!0,onReapply:U,onClose:r}):e.jsx(Se,{onClose:r}):e.jsx(V,{rule:d,folders:n,preview:y,semanticAvailable:!1,clauseFields:D,lifecycleLocked:!0,clauseEdit:m,onStartAddClause:N,onStartEditClause:C,onRemoveClause:$,onChangeDraftField:A,onChangeDraftValue:R,onSubmitClause:P,onCancelClause:()=>c(void 0),onChangeMatchOperator:z,onChangeMove:L,onChangeName:_,onCommit:B,onCancel:r})}function Ce(){return e.jsxs("div",{className:"flex flex-col items-center gap-3 px-5 py-10 text-center",children:[e.jsx(M,{className:"size-8 animate-spin text-accent-2"}),e.jsx("p",{className:"text-sm font-medium text-fg",children:"Saving changes…"})]})}function Se({onClose:t}){return e.jsxs("div",{className:"flex flex-col items-center gap-3 px-5 py-8 text-center",children:[e.jsx(w,{className:"size-8 text-positive"}),e.jsx("p",{className:"text-sm font-medium text-fg",children:"Filter updated"}),e.jsx(j,{variant:"primary",onClick:t,className:"mt-2",children:"Done"})]})}function Fe({preview:t,blocked:s,onReapply:n,onClose:a}){return e.jsxs("div",{className:"flex flex-col items-center gap-3 px-5 py-8 text-center",children:[e.jsx(w,{className:"size-8 text-positive"}),e.jsx("p",{className:"text-sm font-medium text-fg",children:"Rule saved"}),e.jsxs("p",{className:"max-w-xs text-xs text-fg-muted",children:["New mail follows the rule automatically. ",t," — move the mail already in your mailbox too?"]}),e.jsxs("div",{className:"mt-2 flex gap-2",children:[e.jsx(j,{variant:"primary",onClick:n,disabled:s,children:"Move existing mail"}),e.jsx(j,{variant:"ghost",onClick:a,children:"Not now"})]})]})}function we({progress:t,isDone:s,onClose:n}){const a=t.state==="Failed";return e.jsxs("div",{className:"flex flex-col items-center gap-3 px-5 py-8 text-center",children:[s?a?e.jsx("span",{className:"text-sm font-semibold text-danger",children:"Move failed"}):e.jsx(w,{className:"size-8 text-positive"}):e.jsx(M,{className:"size-8 animate-spin text-accent-2"}),!s&&e.jsx("p",{className:"text-sm font-medium text-fg",children:"Moving existing mail…"}),s&&!a&&e.jsxs("div",{className:"text-sm text-fg",children:[e.jsx("p",{className:"font-medium",children:"Done"}),e.jsxs("p",{className:"mt-1 text-xs text-fg-muted",children:[t.appliedCount," of ",t.matchedCount," moved",t.failedCount>0?` · ${t.failedCount} failed`:"","."]})]}),s&&a&&e.jsx("p",{className:"max-w-xs text-xs text-fg-muted",children:t.errorMessage||"Something went wrong. Please try again."}),s&&e.jsx(j,{variant:"primary",onClick:n,className:"mt-2",children:"Done"})]})}function Oe({onRetry:t,onClose:s}){return e.jsxs("div",{className:"flex flex-col items-center gap-3 px-5 py-8 text-center",children:[e.jsx("p",{className:"text-sm font-medium text-danger",children:"Couldn't save changes"}),e.jsx("p",{className:"max-w-xs text-xs text-fg-muted",children:"Please try again."}),e.jsxs("div",{className:"mt-2 flex gap-2",children:[e.jsx(j,{variant:"primary",onClick:t,children:"Try again"}),e.jsx(j,{variant:"ghost",onClick:s,children:"Not now"})]})]})}function De({accountId:t,filter:s,folders:n,semanticUnavailable:a,onClose:r}){const x=me(),d=e.jsx(Ne,{accountId:t,filter:s,folders:n,semanticUnavailable:a,onClose:r});return x?e.jsx(J,{open:!0,onClose:r,title:"Filter rule",children:d}):e.jsx(ue,{open:!0,onClose:r,dismissLabel:"Dismiss filter rule",children:d})}function Ee({filters:t,mailboxName:s,onEdit:n,onDelete:a,deletingFilterId:r,semanticUnavailable:x=!1,now:d=Date.now()}){return t.length===0?e.jsx("p",{className:"py-6 text-sm text-fg-muted",children:"No filters yet. Select a few messages in the inbox and choose Organize to make one."}):e.jsx("ul",{className:"divide-y divide-line rounded-md border border-line",children:t.map(l=>{const m=xe(l,d),c=m==="Expired",p=l.actionMailboxId!==F?s(l.actionMailboxId):void 0,f=pe(l.expiresAt);return e.jsxs("li",{className:"flex items-start gap-3 px-3 py-2.5",children:[e.jsxs("button",{type:"button",onClick:()=>n(l.filterId),"aria-label":`Edit filter ${l.name}`,className:"min-w-0 flex-1 rounded-sm text-left hover:opacity-80",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:`truncate text-sm font-medium ${c?"text-fg-muted":"text-fg"}`,children:l.name}),e.jsx(W,{tone:c?"neutral":"positive",dot:!0,children:m})]}),e.jsxs("p",{className:"mt-0.5 text-xs text-fg-subtle",children:[p?`Moves matches to ${p}`:"No move action",l.scope==="Temporary"&&f?c?` · expired ${f}`:` · until ${f}`:l.scope==="Standing"?" · always":""]}),l.hasAnchor&&e.jsx("div",{className:"mt-1.5 flex flex-wrap gap-1.5",children:e.jsx(Y,{widen:{anchorCount:1,...x?{inactive:!0}:{}}})})]}),e.jsx(j,{variant:"ghost",size:"sm",icon:e.jsx(Z,{className:"size-4 text-danger"}),onClick:()=>a(l.filterId),disabled:r===l.filterId,"aria-label":`Delete filter ${l.name}`})]},l.filterId)})})}const Me=e.jsxs("div",{className:"space-y-3",children:[e.jsxs("p",{children:["Filters are the standing rules Organize creates. A"," ",e.jsx("strong",{children:"Standing"})," filter keeps working on new mail; a"," ",e.jsx("strong",{children:"Temporary"})," one stops on its own at the date you picked."]}),e.jsx("p",{children:"An expired filter isn't deleted the instant it lapses — it stays here, marked Expired, so you can see what it did and when it stopped."})]});function Ie({account:t}){const s=t.accountId,{filters:n,isPending:a,isError:r,error:x,refetch:d}=fe(s),{deleteFilter:l,deletingFilterId:m}=he(s),[c,p]=h.useState(),{data:f}=I({...ae({path:{accountId:s}}),staleTime:1/0}),b=h.useCallback(u=>{const N=f?.items.find(C=>C.mailboxId===u);return N?O(N.fullPath):void 0},[f?.items]),y=h.useMemo(()=>ge(f?.items??[]).map(u=>({id:u.mailboxId,label:O(u.fullPath)})),[f?.items]),g=n.find(u=>u.filterId===c);return e.jsxs("section",{className:"space-y-2",children:[e.jsx("h2",{className:"text-sm font-semibold text-fg",children:t.email}),g&&e.jsx(De,{accountId:s,filter:g,folders:y,onClose:()=>p(void 0)}),a?e.jsx("div",{className:"h-16 animate-pulse rounded-md border border-line bg-surface","aria-busy":"true","aria-label":`Loading filters for ${t.email}`}):r?e.jsx(T,{variant:"inline",title:`Couldn't load filters for ${t.email}`,error:x,onRetry:()=>{d()}}):e.jsx(Ee,{filters:n,mailboxName:b,onEdit:p,onDelete:l,deletingFilterId:m})]})}function ze(){const t=X(),[s,n]=h.useState(!0),{data:a,isPending:r,isError:x,error:d,refetch:l}=I(ee()),m=c=>{const p=se[c];p&&t({to:p})};return e.jsx(ie,{items:te,activeId:"filters",title:"Filters",description:"Standing and temporary rules created by Organize, per account.",help:Me,helpOpen:s,onToggleHelp:()=>n(c=>!c),onSelect:m,onBackToMail:()=>{t({to:"/mail"})},children:r?e.jsx("div",{className:"h-24 animate-pulse rounded-sm border border-line bg-surface","aria-busy":"true","aria-label":"Loading accounts"}):x?e.jsx(T,{title:"Couldn't load accounts",error:d,onRetry:()=>{l()}}):a.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:a.accounts.map(c=>e.jsx(Ie,{account:c},c.accountId))})})}export{ze as component};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as r}from"./index-
|
|
1
|
+
import{j as r}from"./index-DOCS9Vso.js";import{E as o}from"./ErrorState-cpxg8GQV.js";const l=({error:t,reset:e})=>r.jsx("div",{className:"flex h-full items-center justify-center bg-canvas p-4",children:r.jsx(o,{title:"Couldn't load your starred mail",error:t,onRetry:e})});export{l as errorComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"./index-
|
|
1
|
+
import{a}from"./index-DOCS9Vso.js";const o=a("Folder",[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]]);export{o as F};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as e,
|
|
1
|
+
import{j as e,c0 as v,r as y,c1 as C,bt as S,y as A,B as E,h as k,c2 as R,ae as L,aq as j,ay as P,bD as T,bF as _,$ as w,af as F,at as N,bo as M,c3 as D,aJ as $,c4 as Q,c5 as B,k as q,c6 as G}from"./index-DOCS9Vso.js";import{F as H}from"./folder-CfIqg83l.js";import{S as K}from"./settings-screen-BkXxfSnc.js";import{E as O}from"./ErrorState-cpxg8GQV.js";import"./avatar-DkFnBYJL.js";const z=["inbox","drafts","sent","archive","junk","trash"],x="";function V(a){const n=a.messageCount===1?"msg":"msgs";return`${v(a.providerPath)} · ${a.messageCount} ${n}`}function J({role:a,folders:n,appointedId:r,displayName:i,onAppoint:m,onRename:p}){const[c,d]=y.useState(i),s=n.find(l=>l.mailboxId===r)??null,t=R(a),u=s!=null&&c.trim()!==i.trim();return e.jsxs("div",{className:"flex flex-col gap-1 border-b border-line px-row-inset py-2.5 last:border-b-0",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("span",{className:"flex w-28 shrink-0 items-center gap-2 text-sm font-medium text-fg",children:[C(a),t]}),e.jsxs(S,{className:"w-56 shrink-0",value:r??x,"aria-label":`Folder for ${t}`,onChange:l=>m(a,l.target.value===x?null:l.target.value),children:[e.jsx("option",{value:x,children:"None"}),n.map(l=>e.jsx("option",{value:l.mailboxId,children:V(l)},l.mailboxId))]}),s&&e.jsxs(e.Fragment,{children:[e.jsx(A,{className:"flex-1",value:c,placeholder:t,"aria-label":`Display name for ${t}`,onChange:l=>d(l.target.value)}),u&&e.jsx(E,{variant:"ghost",size:"sm",className:"shrink-0",icon:e.jsx(k,{className:"size-4"}),"aria-label":"Save display name",onClick:()=>p(s.mailboxId,c)})]})]}),s&&e.jsxs("span",{className:"truncate pl-[7.5rem] text-2xs text-fg-subtle",title:s.providerPath,children:[s.providerPath," · ",s.messageCount," ",s.messageCount===1?"message":"messages"]})]})}function U({accountEmail:a,folders:n,appointments:r,displayNames:i={},onAppoint:m,onRename:p}){const c=new Set(Object.values(r).filter(s=>s!=null)),d=n.filter(s=>!c.has(s.mailboxId));return e.jsxs("section",{className:"space-y-3",children:[e.jsxs("header",{className:"space-y-1",children:[e.jsxs("h2",{className:"text-sm font-semibold text-fg",children:["Folder roles — ",a]}),e.jsx("p",{className:"text-xs text-fg-muted",children:"Each role points to one folder. Pick the folder that holds the mail — the counts help you tell real folders from empty look-alikes. Appointing a folder here removes it from any other role."})]}),e.jsx("div",{className:"rounded-sm border border-line bg-surface",children:z.map(s=>{const t=r[s]??null;return e.jsx(J,{role:s,folders:n,appointedId:t,displayName:t?i[t]??"":"",onAppoint:m,onRename:p},s)})}),d.length>0&&e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("h3",{className:"text-xs font-medium text-fg-muted",children:"Other folders"}),e.jsx("ul",{className:"rounded-sm border border-line bg-surface",children:d.map(s=>e.jsxs("li",{className:"flex items-center gap-2 border-b border-line px-row-inset py-2 text-sm text-fg last:border-b-0",children:[e.jsx(H,{className:"size-4 shrink-0 text-fg-subtle"}),e.jsx("span",{className:"truncate",children:v(s.providerPath)}),e.jsxs("span",{className:"ml-auto shrink-0 text-2xs text-fg-subtle",children:[s.messageCount," ",s.messageCount===1?"message":"messages"]})]},s.mailboxId))})]})]})}const W=e.jsxs("div",{className:"space-y-3",children:[e.jsx("p",{children:"Each canonical role — Inbox, Drafts, Sent, Archive, Spam, Trash — points at one of your account's real folders. Pick the one that actually holds the mail; the message counts tell real folders from empty look-alikes."}),e.jsx("p",{children:`Appointing a folder to a role here doesn't touch any other role, and doesn't move or rename anything on the server — it just tells Remit which folder to treat as e.g. "Drafts" everywhere (sidebar, unread badges, the compose flow).`}),e.jsxs("p",{children:[e.jsx("strong",{className:"text-fg",children:"Display name"})," renames the appointed folder for the sidebar. Leave it blank to use the role's canonical name."]})]});function X({account:a}){const n=w(),r=a.accountId,{data:i,isPending:m,isError:p,error:c,refetch:d}=j(F({path:{accountId:r}})),s=N({...D(),onSuccess:()=>{n.invalidateQueries({queryKey:M()})}}),t=N({...Q(),onSuccess:()=>{n.invalidateQueries({queryKey:$({path:{accountId:r}})})}}),u=(o,h)=>{s.mutate({path:{accountId:r,role:G[o]},body:{mailboxId:h}})},l=(o,h)=>{const b=h.trim();t.mutate({path:{accountId:r,mailboxId:o},body:{displayNameOverride:b===""?null:b}})};if(m)return e.jsx("div",{className:"h-24 animate-pulse rounded-sm border border-line bg-surface","aria-busy":"true","aria-label":`Loading folders for ${a.email}`});if(p)return e.jsx(O,{variant:"inline",title:`Couldn't load folders for ${a.email}`,error:c,onRetry:()=>{d()}});const I=i.items.map(o=>({mailboxId:o.mailboxId,providerPath:o.fullPath,messageCount:o.messageCount})),f={};for(const o of a.folderAppointments){const h=B[o.role];h&&(f[h]=o.mailboxId??null)}const g={};for(const o of i.items)o.displayNameOverride&&(g[o.mailboxId]=o.displayNameOverride);return e.jsxs("div",{className:"space-y-2",children:[(s.isError||t.isError)&&e.jsx(q,{tone:"danger",variant:"soft",children:"Couldn't save that change. Please try again."}),e.jsx(U,{accountEmail:a.email,folders:I,appointments:f,displayNames:g,onAppoint:u,onRename:l})]})}function te(){const a=L(),[n,r]=y.useState(!0),{data:i,isPending:m,isError:p,error:c,refetch:d}=j(P()),s=t=>{const u=_[t];u&&a({to:u})};return e.jsx(K,{items:T,activeId:"folders",title:"Folder roles",description:"Appoint which real folder fills each canonical role, per account.",help:W,helpOpen:n,onToggleHelp:()=>r(t=>!t),onSelect:s,onBackToMail:()=>{a({to:"/mail"})},children:m?e.jsx("div",{className:"h-24 animate-pulse rounded-sm border border-line bg-surface","aria-busy":"true","aria-label":"Loading accounts"}):p?e.jsx(O,{title:"Couldn't load accounts",error:c,onRetry:()=>{d()}}):i.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:i.accounts.map(t=>e.jsx(X,{account:t},t.accountId))})})}export{te as component};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as t,bp as o}from"./index-DOCS9Vso.js";const n=()=>t.jsx(o,{to:"/settings/accounts"});export{n as component};
|