@remit/web-client-dist 0.0.676 → 0.0.678
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-Cfl-uWfm.js → BriefPane-DZbE8ZNv.js} +1 -1
- package/assets/{CalendarEventEditor-COnJXvRd.js → CalendarEventEditor-LUplTbrz.js} +1 -1
- package/assets/{CalendarEventPopup-CqHE2vrc.js → CalendarEventPopup-CQaPJg2s.js} +1 -1
- package/assets/{CalendarLoadFailed-CxL15r1A.js → CalendarLoadFailed-DGqiWK7A.js} +1 -1
- package/assets/CalendarQuickCreate-DqIwACsh.js +1 -0
- package/assets/{CalendarSession-BKwK9s2o.js → CalendarSession-DGGQfwLi.js} +1 -1
- package/assets/DesktopChrome-Dl4YzJrV.js +1 -0
- package/assets/DropdownMenu-CowSyQUa.js +1 -0
- package/assets/{EmptyState-BUOSmldo.js → EmptyState-DcHnaG2R.js} +1 -1
- package/assets/{ErrorState-KjDYblD5.js → ErrorState-DcP5ZTMN.js} +1 -1
- package/assets/{FlaggedPane-Dw-wR4tp.js → FlaggedPane-CuevlxSV.js} +1 -1
- package/assets/{FullCompose-Djp_h4BT.js → FullCompose-BdpPcB8J.js} +1 -1
- package/assets/LabelApplyTrigger-c7ugtEyT.js +1 -0
- package/assets/MailShell-C7RoeX76.js +1 -0
- package/assets/{MailViewChrome-yffBJjbO.js → MailViewChrome-CQnNS9Dt.js} +1 -1
- package/assets/{MailboxPane-DUCZVAx6.js → MailboxPane-GqjbzfQ9.js} +1 -1
- package/assets/{MessageBody-C89PSL_p.js → MessageBody-B3Z3zu18.js} +4 -4
- package/assets/MessageToolbar-DpBF7XWc.js +1 -0
- package/assets/NavMenuButton-d1WErbNE.js +1 -0
- package/assets/{OnboardingWizard-Cvqq2aP_.js → OnboardingWizard-CPxEO5Gn.js} +1 -1
- package/assets/{OutboxPane-ce4uTAzW.js → OutboxPane-CnWjm3Kz.js} +1 -1
- package/assets/_calendarObjectId-BNxfdsFq.js +1 -0
- package/assets/_mailboxId-5uzJGGTA.js +1 -0
- package/assets/_messageId-CtUY7QaK.js +1 -0
- package/assets/_messageId-CyMtXqvK.js +1 -0
- package/assets/_messageId-jb0nvtAH.js +1 -0
- package/assets/_outboxMessageId-CRuHx4Az.js +1 -0
- package/assets/_recurrenceId-Dcdvy3HK.js +1 -0
- package/assets/_threadId-B17WzUu-.js +1 -0
- package/assets/_threadId-Djcejxjj.js +1 -0
- package/assets/_threadId-TLGn2UeF.js +1 -0
- package/assets/_view._date-DLGnjbKh.js +1 -0
- package/assets/{account-service-status-oYDwuPLn.js → account-service-status-BrL78Bwl.js} +1 -1
- package/assets/accounts-DKPcRgRU.js +1 -0
- package/assets/advanced-BjXiUDtl.js +1 -0
- package/assets/appearance-MzTWiLTR.js +1 -0
- package/assets/{avatar-uWJajuSb.js → avatar-B4KRzyzS.js} +1 -1
- package/assets/{bottom-sheet-Bc0vwv2J.js → bottom-sheet-B5OEKAh2.js} +1 -1
- package/assets/brief-C-5GXXj6.js +1 -0
- package/assets/{brief-bdXCpAmW.js → brief-ChnlqLdX.js} +1 -1
- package/assets/{calendar-event-popup-DsPmxVye.js → calendar-event-popup-Dbcz3Zb_.js} +1 -1
- package/assets/{calendar-event-sidebar-soFGsDRR.js → calendar-event-sidebar-D_7uvmvT.js} +1 -1
- package/assets/{calendar-failure-note-BtZLcaiZ.js → calendar-failure-note-BJCyTf1U.js} +1 -1
- package/assets/{calendar-guests-BR4hC59z.js → calendar-guests-BCC1uGzd.js} +1 -1
- package/assets/{calendar-tMekVEGW.js → calendar-miAZmlW9.js} +1 -1
- package/assets/calendar-mwWH-7s8.js +1 -0
- package/assets/{calendar-suggestion-8jcpefeR.js → calendar-suggestion-BppH-3oL.js} +1 -1
- package/assets/{calendars-bLB0g-E-.js → calendars-D9ZEiowB.js} +1 -1
- package/assets/{card-CPL-TrL1.js → card-WB75jB_w.js} +1 -1
- package/assets/{checkbox-CGG1nAhQ.js → checkbox-BXzuviQP.js} +1 -1
- package/assets/{circle-check-i3jeyeTf.js → circle-check-Bifl6wEJ.js} +1 -1
- package/assets/{circle-check-big-BsCwNdJZ.js → circle-check-big-BrmrabN6.js} +1 -1
- package/assets/{circle-help-CVWHf1ow.js → circle-help-Cyj92MDS.js} +1 -1
- package/assets/{clock-NnulNCOv.js → clock-A6ewTncv.js} +1 -1
- package/assets/cloud-off-CsGOr1Gn.js +1 -0
- package/assets/compose._-_outboxMessageId_-C6-fUwE2.js +1 -0
- package/assets/compose._-_outboxMessageId_-CSKV8YnZ.js +1 -0
- package/assets/compose._-_outboxMessageId_-Djp_aqSn.js +1 -0
- package/assets/compose._-_outboxMessageId_-DspXe17c.js +1 -0
- package/assets/{config-import-DmOMXQ5W.js → config-import-DTjV5c_Y.js} +1 -1
- package/assets/{confirm-dialog-q8tbS_22.js → confirm-dialog-9Q6aXOb5.js} +1 -1
- package/assets/{copy-LUCWJAE6.js → copy-DjyWdtW5.js} +1 -1
- package/assets/{credential-steps-DVglyUgf.js → credential-steps-BoiX5zy2.js} +1 -1
- package/assets/{download-SQdHw0Vd.js → download-CtoLQ9Ox.js} +1 -1
- package/assets/{draft-Y5XWTm_J.js → draft-CdiiJR8n.js} +1 -1
- package/assets/edit-D9g3EW1R.js +1 -0
- package/assets/edit-DkOWaaHs.js +1 -0
- package/assets/{external-link-BDqA_mVy.js → external-link-Dn2gWGrg.js} +1 -1
- package/assets/{file-json-DQGozYSr.js → file-json-B4YU26EQ.js} +1 -1
- package/assets/filters--HZZoQYr.js +1 -0
- package/assets/flagged-CVmpEd-z.js +1 -0
- package/assets/{flagged-CyMautVT.js → flagged-CjfnRBYq.js} +1 -1
- package/assets/{folders-DtchKvEA.js → folders-BEv1OKE6.js} +1 -1
- package/assets/{help-copy-B2iT8EG_.js → help-copy-CQIBCXJf.js} +1 -1
- package/assets/{import-DqNA5XIM.js → import-DhvqQyGM.js} +1 -1
- package/assets/index-4XPoPWhu.js +349 -0
- package/assets/index-B4YQCeZ5.js +1 -0
- package/assets/index-B8TxM1Ri.js +1 -0
- package/assets/{index-DZb7rV9A.js → index-BNUBjW43.js} +4 -4
- package/assets/index-BqN9osrB.js +1 -0
- package/assets/index-CA4e3svh.js +1 -0
- package/assets/{index-Cr6oUxXl.css → index-CNLnhDIy.css} +1 -1
- package/assets/index-ChXNLMBw.js +1 -0
- package/assets/index-Cm4__-V6.js +1 -0
- package/assets/index-CtUY7QaK.js +1 -0
- package/assets/index-CyMtXqvK.js +1 -0
- package/assets/index-DDMaQQcI.js +1 -0
- package/assets/index-aTwfTj57.js +1 -0
- package/assets/{kbd-CDJCJUnp.js → kbd-D0eWE7Kp.js} +1 -1
- package/assets/labels-DlSg6Q8z.js +1 -0
- package/assets/mail-CmiK10Kq.js +1 -0
- package/assets/{menu-CcLh9Whg.js → menu-D06KWsdQ.js} +1 -1
- package/assets/new-B_n0KCot.js +1 -0
- package/assets/onboarding-DVJYsyGv.js +1 -0
- package/assets/{onboarding-completion-DoF3_MyG.js → onboarding-completion-DnXMA7VE.js} +1 -1
- package/assets/outbox-_8AzSWX1.js +1 -0
- package/assets/{pencil-LSmMSKiW.js → pencil-CA6DIP59.js} +1 -1
- package/assets/people-BAjwQQiz.js +1 -0
- package/assets/{popover-menu-fjlAfNO1.js → popover-menu-BT-fkOr5.js} +1 -1
- package/assets/{refresh-cw-5OKnYRBy.js → refresh-cw-BERt5E10.js} +1 -1
- package/assets/{reply-DvdgFS16.js → reply-FoVQqDdv.js} +1 -1
- package/assets/{rich-text-BBwYPM6F.js → rich-text-C9TR28N2.js} +1 -1
- package/assets/{rich-text-spellcheck-worker-provider-Bk8cqxyg.js → rich-text-spellcheck-worker-provider-DjdTU9LK.js} +1 -1
- package/assets/{rotate-ccw-CENCKp2Z.js → rotate-ccw-C-agNTCI.js} +1 -1
- package/assets/{roving-focus-FWOr5tBU.js → roving-focus-Cj3j6dFs.js} +1 -1
- package/assets/{row-actions-DA6zLLAB.js → row-actions-C7JJUiqN.js} +1 -1
- package/assets/{search-mirror-Dri4pWEq.js → search-mirror-B5Imt12Z.js} +1 -1
- package/assets/{search-token-index-B1HU1d2-.js → search-token-index-C7o7PQIx.js} +1 -1
- package/assets/{sections-Rf3k05-_.js → sections-DiFHIPo4.js} +1 -1
- package/assets/senders-BpChah6o.js +1 -0
- package/assets/settings-kL8Y1zKC.js +1 -0
- package/assets/{settings-screen-DBP3ABLE.js → settings-screen-ZYutaKzZ.js} +1 -1
- package/assets/shield-check-DDrlOAO3.js +1 -0
- package/assets/{sparkles-Bcn4ZRhZ.js → sparkles-MrqvyWps.js} +1 -1
- package/assets/{suggested-vips-D-8cU8GT.js → suggested-vips-ODDnv-D2.js} +1 -1
- package/assets/{suggestion._suggestionId-D6z0CuYD.js → suggestion._suggestionId-DZhG3YlZ.js} +1 -1
- package/assets/{task._calendarTaskId-BYRN0yW3.js → task._calendarTaskId-BfaZmOEn.js} +1 -1
- package/assets/{undo-2-Bdx8L5xj.js → undo-2-C6aYHE3s.js} +1 -1
- package/assets/{useCalendarData-DXhaM_NM.js → useCalendarData-C3WbLJaC.js} +2 -2
- package/assets/{useCalendarScheduling-BpjmrzdY.js → useCalendarScheduling-CjI7T1o-.js} +1 -1
- package/assets/{useCalendarSuggestions-D3Jza1d7.js → useCalendarSuggestions-D6k1REyo.js} +1 -1
- package/assets/{useCalendarTasks-D_NZ0GM6.js → useCalendarTasks-DNBYBsvN.js} +1 -1
- package/assets/{useDebouncedValue-BTZsNKEh.js → useDebouncedValue-B0BMCu3v.js} +1 -1
- package/assets/{useFilters-CIuC8WLg.js → useFilters-C_nA08Aa.js} +1 -1
- package/assets/{useLabels-BZFMPVjT.js → useLabels-Dn9qgr5w.js} +1 -1
- package/assets/useLayoutTier-DtUqYCCh.js +1 -0
- package/assets/{useMediaQuery-DiQ0fGER.js → useMediaQuery-a7SamL-l.js} +1 -1
- package/assets/useMessageBodyContent-ClVl7CBj.js +1 -0
- package/assets/useQueries-XPiXhlQX.js +1 -0
- package/assets/{useRefreshControl-B6YIG0w2.js → useRefreshControl-C9tPndY1.js} +1 -1
- package/assets/{useResultFolderIndex-6TeGdWgp.js → useResultFolderIndex-koSvRw-H.js} +1 -1
- package/assets/{useSignature-BkzkUbjz.js → useSignature-rM5axmpY.js} +1 -1
- package/assets/{warnings-BdQvV6Kc.js → warnings-De2eUHBy.js} +4 -4
- package/index.html +2 -2
- package/package.json +1 -1
- package/assets/AppFrame-DSPG81Mk.js +0 -1
- package/assets/CalendarQuickCreate-DxgU3bNP.js +0 -1
- package/assets/LabelApplyTrigger-oS5sxATE.js +0 -1
- package/assets/MailShell-LIuV2C3h.js +0 -1
- package/assets/MessageToolbar-UJadqHyA.js +0 -1
- package/assets/NavMenuButton-B-goW-G5.js +0 -1
- package/assets/_calendarObjectId-lcrg9Fhc.js +0 -1
- package/assets/_mailboxId-BzKo-TnK.js +0 -1
- package/assets/_messageId-C7U0TsBv.js +0 -1
- package/assets/_messageId-CGB3gt7C.js +0 -1
- package/assets/_messageId-D2Qjacn6.js +0 -1
- package/assets/_outboxMessageId-FUbJ3RF8.js +0 -1
- package/assets/_recurrenceId-DpQOCGAd.js +0 -1
- package/assets/_threadId-BmZ2vl5z.js +0 -1
- package/assets/_threadId-Bs84eLjr.js +0 -1
- package/assets/_threadId-DySupNzi.js +0 -1
- package/assets/_view._date-DYujYKtx.js +0 -1
- package/assets/accounts-DhSbRlEm.js +0 -1
- package/assets/advanced-B50NfkTy.js +0 -1
- package/assets/appearance-CYNOlHLz.js +0 -1
- package/assets/brief-DPWE6nMF.js +0 -1
- package/assets/calendar-7SdvLY_h.js +0 -1
- package/assets/compose._-_outboxMessageId_-Be8c22eR.js +0 -1
- package/assets/compose._-_outboxMessageId_-BuomqJqQ.js +0 -1
- package/assets/compose._-_outboxMessageId_-Bv9hyiuT.js +0 -1
- package/assets/compose._-_outboxMessageId_-CvUr9awX.js +0 -1
- package/assets/edit-DMorYaTV.js +0 -1
- package/assets/edit-Dr5FEVcd.js +0 -1
- package/assets/filters-DFLdTFEB.js +0 -1
- package/assets/flagged-CCXBAY09.js +0 -1
- package/assets/index-BaEsIFAV.js +0 -1
- package/assets/index-Biz6TlId.js +0 -1
- package/assets/index-BkMAx0hv.js +0 -1
- package/assets/index-CL_fwLHN.js +0 -349
- package/assets/index-CZYy2P_j.js +0 -1
- package/assets/index-CqsCZrgd.js +0 -1
- package/assets/index-CvDZvwnj.js +0 -1
- package/assets/index-D2Qjacn6.js +0 -1
- package/assets/index-DoTwMLuw.js +0 -1
- package/assets/index-DrtbTKeC.js +0 -1
- package/assets/index-wVOTkeaF.js +0 -1
- package/assets/labels-rv-5Xb0f.js +0 -1
- package/assets/mail-SW3rbFnq.js +0 -1
- package/assets/new-Zmtsd7wU.js +0 -1
- package/assets/onboarding-BbZUe6dp.js +0 -1
- package/assets/outbox-ZJk7VidB.js +0 -1
- package/assets/senders-ikMjTlbx.js +0 -1
- package/assets/settings-Bk7jziSO.js +0 -1
- package/assets/shield-check-CdR23I2B.js +0 -1
- package/assets/useLayoutTier-DrLg7_rq.js +0 -1
- package/assets/useMessageBodyContent-D-LJBFh4.js +0 -1
- package/assets/useQueries-hChzM5ru.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{b as e}from"./index-4XPoPWhu.js";const c=e("ShieldCheck",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);export{c as S};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as a}from"./index-
|
|
1
|
+
import{b as a}from"./index-4XPoPWhu.js";const p=a("Sparkles",[["path",{d:"M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z",key:"4pj2yx"}],["path",{d:"M20 3v4",key:"1olli1"}],["path",{d:"M22 5h-4",key:"1gvqau"}],["path",{d:"M4 17v2",key:"vumght"}],["path",{d:"M5 18H3",key:"zchphs"}]]);export{p as S};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as t,
|
|
1
|
+
import{j as t,ae as e}from"./index-4XPoPWhu.js";const o=()=>t.jsx(e,{to:"/settings/senders",replace:!0});export{o as component};
|
package/assets/{suggestion._suggestionId-D6z0CuYD.js → suggestion._suggestionId-DZhG3YlZ.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as i,X as Z,
|
|
1
|
+
import{j as i,X as Z,q as O,fl as R,fq as $,fo as v,r as u,cy as E,g4 as F}from"./index-4XPoPWhu.js";import{E as L,C as W}from"./EmptyState-DcHnaG2R.js";import{C as z}from"./calendar-event-sidebar-D_7uvmvT.js";import{C as B}from"./calendar-failure-note-BJCyTf1U.js";import{b as j,m as H,e as h,n as U,t as _,U as S,x as P,k,j as q,o as M}from"./useCalendarSuggestions-D6k1REyo.js";import{e as w,p as V,a as G}from"./draft-CdiiJR8n.js";import{f as X}from"./calendar-format-BwCpz-JZ.js";import{a as Y}from"./CalendarSession-DGGQfwLi.js";import"./reply-FoVQqDdv.js";import{k as J,b as K}from"./calendar-miAZmlW9.js";import"./calendar-guests-BCC1uGzd.js";import"./calendar-event-popup-Dbcz3Zb_.js";import"./pencil-CA6DIP59.js";import"./circle-help-Cyj92MDS.js";import"./ErrorState-DcP5ZTMN.js";import"./useQueries-XPiXhlQX.js";import"./useMediaQuery-a7SamL-l.js";function I({title:e,subtitle:a,onClose:r,children:s,className:o}){return i.jsxs("section",{className:O("flex h-full w-full flex-col bg-surface",o),children:[i.jsxs("header",{className:"flex h-pane-header shrink-0 items-center gap-2 border-b border-line px-row-inset",children:[i.jsx("h2",{className:"shrink-0 text-xs font-medium text-fg",children:e}),a!==void 0&&a!==""&&i.jsx("span",{className:"min-w-0 flex-1 truncate text-xs text-fg-muted",children:a}),i.jsx("button",{type:"button","aria-label":"Close editor",onClick:r,className:"ml-auto flex size-7 shrink-0 items-center justify-center rounded-md text-fg-subtle outline-none hover:bg-surface-sunken hover:text-fg focus-visible:ring-2 focus-visible:ring-ring",children:i.jsx(Z,{className:"size-4"})})]}),i.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto px-row-inset py-5",children:i.jsx("div",{className:"mx-auto w-full max-w-2xl",children:s})})]})}function Q(e,a,r){const s={title:e.summary,location:e.location};if(e.allDay){const t=e.dtStart.slice(0,10),c=e.dtEnd.slice(0,10);return{...w(t,a),...s,allDay:!0,startTime:"",endDate:c>t?R(c,-1):t,endTime:""}}const o=t=>e.zoneCertainty==="Ambiguous"?t:$(t,r),l=o(e.dtStart),d=o(e.dtEnd);return{...w(l.slice(0,10),a),...s,startTime:l.slice(11,16),endDate:d.slice(0,10),endTime:d.slice(11,16)}}function ee(e,a,r,s){const o=V(a,r,s);if(!o.ok)return o;const d=e.zoneCertainty==="Ambiguous"||o.patch.start!==void 0?{...o.patch,...G(r,s.clock),allDay:r.allDay,timeZone:s.anchor}:o.patch;return{ok:!0,input:{calendarId:r.calendarId,event:d}}}const te=[],ae={from:"",to:""};function ne(e,a=""){const{timeZoneByCalendarId:r}=j(),s=e.date!==""&&!e.allDay&&e.endDate!==""&&e.startTime!==""&&e.endTime!==""&&`${e.endDate}T${e.endTime}`>`${e.date}T${e.startTime}`,{instances:o,isLoading:l,error:d}=H({...s?{from:v("week",e.date).from,to:v("week",e.endDate).to}:ae,calendarIds:te,enabled:s}),t=h();return u.useMemo(()=>{if(!s||l||d)return;const c=E(e.date,e.startTime,t),p=E(e.endDate,e.endTime,t),f=o.filter(m=>U(m)&&m.calendarObjectId!==a).map(m=>_(m,r[m.calendarId]??S,t));return F({start:c,end:p},f).map(m=>({id:m.id,label:`${m.title}, ${X(m)}`}))},[s,l,d,e.date,e.endDate,e.startTime,e.endTime,t,o,a,r])}const y="Add from mail",se="The invitation named a time zone nothing could resolve. The time below is as the mail wrote it — check it before adding.";function oe({suggestionId:e,onClose:a}){const{suggestion:r,isLoading:s,error:o}=P(e),l=r??void 0,[d,t]=u.useState(void 0);l!==void 0&&d===void 0&&t(l);const c=d??l;if(c!==void 0)return i.jsx(ie,{suggestion:c,onClose:a},c.suggestionId);if(o!==null){const p="Couldn't read what your mail is waiting on.";return i.jsx(I,{title:y,onClose:a,children:i.jsx(B,{text:`${p} Close this and try again.`,reportHref:k(p),className:"m-row-inset"})})}return i.jsx(I,{title:y,onClose:a,children:i.jsx(L,{message:s?"Reading the suggestion…":"This suggestion is no longer waiting on you. It was answered, or a later message replaced it."})})}function ie({suggestion:e,onClose:a}){const{calendars:r,defaultCalendarId:s,timeZoneByCalendarId:o}=j(),l=r.filter(n=>!n.readOnly),d=q(),[t]=u.useState(()=>Q(e,"",h())),[c,p]=u.useState(t),f=Y()?.dispatch;u.useEffect(()=>{f?.({type:"sidebar-range",range:{date:t.date,endDate:t.endDate,startTime:t.allDay?"":t.startTime,endTime:t.allDay?"":t.endTime,allDay:t.allDay}})},[t,f]);const[m,x]=u.useState(""),[N,A]=u.useState(),D=ne(c),g=l.some(n=>n.id===s)?s:l[0]?.id??"";u.useEffect(()=>{g!==""&&p(n=>n.calendarId===""?{...n,calendarId:g}:n)},[g]);const C=()=>{const n=ee(e,t,c,{clock:h(),anchor:M(o[c.calendarId]??S)});if(!n.ok){x(n.problem);return}x(""),d.acceptEdited(e.suggestionId,n.input).then(b=>{if(b.kind==="answered"){a();return}const T=`Couldn't add this to your calendar: ${b.message}`;A({text:T,reportHref:k(T),onRetry:C})})};return i.jsx(z,{heading:y,draft:c,onChange:n=>{p(n),f?.({type:"sidebar-range",range:{date:n.date,endDate:n.endDate,startTime:n.allDay?"":n.startTime,endTime:n.allDay?"":n.endTime,allDay:n.allDay}})},calendars:l,calendarEditable:!0,repeatEditable:!1,timeZone:h(),timeZones:[h()],onTimeZone:()=>{},busy:!0,onBusy:()=>{},onSave:C,onCancel:a,saving:d.isAnswering,saveLabel:"Add",failure:N,problem:m!==""?m:e.zoneCertainty==="Ambiguous"?se:"",children:D&&i.jsx(W,{clashes:D})})}function Ee(){const e=J(),{closeToView:a}=K();return e===void 0?null:i.jsx(oe,{suggestionId:e,onClose:a})}export{Ee as component};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as w,r as d,j as e,T as R,X as E,
|
|
1
|
+
import{b as w,r as d,j as e,T as R,X as E,q as z,C as $,fq as q,cy as B,g5 as L}from"./index-4XPoPWhu.js";import{b as F,C as j,u as P}from"./useCalendarTasks-DNBYBsvN.js";import{C as V}from"./calendar-event-popup-Dbcz3Zb_.js";import{b as Z,e as H,c as K}from"./useCalendarSuggestions-D6k1REyo.js";import"./reply-FoVQqDdv.js";import{b as S}from"./calendar-miAZmlW9.js";import{C as M}from"./CalendarLoadFailed-DGqiWK7A.js";import"./ErrorState-DcP5ZTMN.js";import"./pencil-CA6DIP59.js";import"./useQueries-XPiXhlQX.js";import"./useMediaQuery-a7SamL-l.js";const A=w("SquareCheckBig",[["path",{d:"M21 10.5V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h12.5",key:"1uzm8b"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);const O=w("Square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]),D="flex size-9 items-center justify-center rounded-full text-fg-muted outline-none hover:bg-surface-sunken hover:text-fg focus-visible:ring-2 focus-visible:ring-ring disabled:opacity-40",v="h-9 w-full rounded-md border border-line bg-surface-sunken px-2 text-sm text-fg outline-none focus-visible:ring-2 focus-visible:ring-ring/30";function W({headingId:t,headingRef:i,fields:l,dueText:r,listName:u,completed:c,onToggle:f,onSave:x,onDelete:g,onClose:p,busy:m=!1,failure:h}){const[s,o]=d.useState(null);return e.jsxs("div",{className:"flex flex-col gap-3 p-3",children:[e.jsxs("div",{className:"flex justify-end gap-1",children:[s===null&&e.jsx("button",{type:"button",onClick:()=>o(l),className:"rounded-md px-3 text-sm font-medium text-accent hover:bg-accent-soft focus-visible:ring-2 focus-visible:ring-ring",children:"Edit"}),e.jsx("button",{type:"button","aria-label":"Delete",onClick:g,disabled:m,className:D,children:e.jsx(R,{className:"size-4"})}),e.jsx("button",{type:"button","aria-label":"Close",onClick:p,className:D,children:e.jsx(E,{className:"size-4"})})]}),s===null?e.jsxs("div",{className:"flex flex-col gap-2 px-2",children:[e.jsx("h2",{id:t,ref:i,tabIndex:-1,className:z("text-xl font-normal break-words text-fg outline-none",c&&"text-fg-muted line-through"),children:l.title===""?"(No title)":l.title}),e.jsx("p",{className:"text-sm text-fg-muted",children:r}),e.jsxs("p",{className:"flex items-center gap-2 text-sm",children:[e.jsx($,{className:"size-4 text-fg-subtle","aria-label":"List"}),u]}),l.description!==""&&e.jsx("p",{className:"text-sm whitespace-pre-wrap break-words",children:l.description})]}):e.jsxs("form",{className:"flex flex-col gap-2 px-2",onSubmit:n=>{n.preventDefault(),x(s),o(null)},children:[e.jsx("h2",{id:t,className:"sr-only",children:"Edit task"}),e.jsx("input",{"aria-label":"Title",value:s.title,onChange:n=>o({...s,title:n.target.value}),className:v}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx("input",{type:"date","aria-label":"Due date",value:s.dueDate,onChange:n=>n.target.value!==""&&o({...s,dueDate:n.target.value}),className:v}),e.jsx("input",{type:"time","aria-label":"Due time",value:s.dueTime,onChange:n=>o({...s,dueTime:n.target.value}),className:v})]}),e.jsx("textarea",{"aria-label":"Description",rows:3,value:s.description,onChange:n=>o({...s,description:n.target.value}),className:"w-full rounded-md border border-line bg-surface-sunken px-2 py-1 text-sm"}),e.jsxs("div",{className:"flex justify-end gap-2",children:[e.jsx("button",{type:"button",onClick:()=>o(null),className:"h-9 rounded-md border border-line px-3 text-sm font-medium",children:"Cancel"}),e.jsx("button",{type:"submit",disabled:m,className:"h-9 rounded-md bg-accent px-4 text-sm font-medium text-accent-fg disabled:opacity-50",children:"Save"})]})]}),h&&e.jsx(V,{failure:h}),s===null&&e.jsx("div",{className:"flex justify-end px-2",children:e.jsxs("button",{type:"button",onClick:f,disabled:m,className:"inline-flex h-9 items-center gap-2 rounded-md border border-line px-3 text-sm font-medium hover:bg-surface-sunken focus-visible:ring-2 focus-visible:ring-ring disabled:opacity-50",children:[c?e.jsx(O,{className:"size-4","aria-hidden":"true"}):e.jsx(A,{className:"size-4","aria-hidden":"true"}),c?"Mark not done":"Mark done"]})})]})}const U=(t,i)=>{const l=new Date(`${t.slice(0,10)}T00:00:00Z`),r=new Intl.DateTimeFormat(void 0,{weekday:"long",day:"numeric",month:"long",timeZone:"UTC"}).format(l);return i?`Due ${r}`:`Due ${r} · ${t.slice(11,16)}`};function X({calendarTaskId:t}){const i=F(t),{closeToView:l}=S(),r=d.useId(),u=d.useRef(null),c=i.kind==="gone";return d.useEffect(()=>{c&&u.current?.focus()},[c]),i.kind==="loading"?null:i.kind==="found"?e.jsx(G,{task:i.task}):i.kind==="failed"?e.jsx(j,{anchor:null,anchorKey:"failed",labelledBy:r,children:e.jsx("div",{id:r,className:"p-4",children:e.jsx(M,{title:"Couldn't open this task",error:i.error,onRetry:i.retry,compact:!0})})}):e.jsx(j,{anchor:null,anchorKey:"gone",labelledBy:r,children:e.jsxs("div",{className:"flex flex-col gap-3 p-4",children:[e.jsx("h2",{id:r,className:"text-base font-medium text-fg",children:"This task was deleted or moved"}),e.jsx("button",{ref:u,type:"button",onClick:l,className:"self-end rounded-md border border-line px-3 py-1.5 text-sm font-medium hover:bg-surface-sunken focus-visible:ring-2 focus-visible:ring-ring",children:"Close"})]})})}function G({task:t}){const{taskLists:i}=Z(),{closeToView:l}=S(),{updateTask:r,deleteTask:u,isWriting:c}=P(),f=d.useId(),x=d.useRef(null),[g,p]=d.useState(),[m,h]=d.useState(null),{calendarTaskId:s}=t;d.useLayoutEffect(()=>{h(document.querySelector(`[data-task-id="${CSS.escape(s)}"]`))},[s]),d.useEffect(()=>{x.current?.focus()},[]);const o=H(),n=t.allDay?t.due:q(t.due,o),I={title:t.summary,dueDate:n.slice(0,10),dueTime:t.allDay?"":n.slice(11,16),description:t.description},b=a=>N=>{if(N.kind==="written"){p(void 0);return}const T=`Couldn't save the task: ${N.message}`;p({text:T,reportHref:K(T),onRetry:a})},y=()=>{r(t,{completed:!t.completed}).then(b(y))},C=a=>{r(t,{summary:a.title,description:a.description,allDay:a.dueTime==="",due:a.dueTime===""?a.dueDate:B(a.dueDate,a.dueTime,o)}).then(b(()=>C(a)))},k=()=>{u(t).then(a=>{if(a.kind==="written"){l();return}b(k)(a)})};return e.jsx(j,{anchor:m,anchorKey:`${s}:${m?"chip":"none"}`,labelledBy:f,children:e.jsx(W,{headingId:f,headingRef:x,fields:I,dueText:U(n,t.allDay),listName:i.find(a=>a.id===t.calendarId)?.name??"Tasks",completed:t.completed,onToggle:y,onSave:C,onDelete:k,onClose:l,busy:c,failure:g})})}function re(){const{calendarTaskId:t}=L.useParams();return e.jsx(X,{calendarTaskId:t})}export{re as component};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as a}from"./index-
|
|
1
|
+
import{b as a}from"./index-4XPoPWhu.js";const d=a("Undo2",[["path",{d:"M9 14 4 9l5-5",key:"102s5s"}],["path",{d:"M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11",key:"f3b9sd"}]]);export{d as U};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{j as c,
|
|
2
|
-
`).replace(/\\,/g,",").replace(/\\;/g,";").replace(/\\\\/g,"\\");function g(e,s){let n=!1;for(let t=s.length;t<e.length;t+=1){const r=e[t];if(t===s.length&&r!==";"&&r!==":")return;if(r==='"'){n=!n;continue}if(!n&&r===":")return e.slice(t+1).trim()}}function v(e,s){for(const n of C(e).split(/\r?\n/)){if(!n.startsWith(s))continue;const t=g(n,s);if(t!==void 0)return t}return""}const X=e=>v(e,"RRULE"),$=e=>({location:I(v(e,"LOCATION")),description:I(v(e,"DESCRIPTION"))});function ee(e,s){const n=C(e).split(/\r?\n/).find(r=>r.startsWith("DTSTART")&&g(r,"DTSTART")!==void 0);if(n===void 0)return A(s);const t=/;TZID="?([^;:"]+)"?/i.exec(n)?.[1];return t!==void 0?Intl.supportedValuesOf("timeZone").includes(t)?t:s:g(n,"DTSTART")?.toUpperCase().endsWith("Z")?"":s}function V(e,s){const n=e.map(a=>a.id);if(s.length===0)return n;const t=new Set(s),r=n.filter(a=>t.has(a));return r.length===0?n:r}function Y(e){const{calendars:s,colorByCalendarId:n,timeZoneByCalendarId:t,isLoading:r}=L(),a=V(s,e),o=a.length===s.length?[]:a,d=e.length===0||s.length>0;return{calendars:s,colorByCalendarId:n,timeZoneByCalendarId:t,shown:a,narrowed:o,resolved:d,isLoading:r}}function _(e,s,n){const t=n.join(",");return f.useMemo(()=>{const r=O(),a=new Set(t===""?[]:t.split(","));return e.filter(o=>W(o)&&a.has(o.calendarId)).map(o=>Z(o,s[o.calendarId]??B,r))},[e,s,t])}function se({view:e,date:s,calendarIds:n,enabled:t=!0}){const{calendars:r,colorByCalendarId:a,timeZoneByCalendarId:o,shown:d,narrowed:l,resolved:j,isLoading:N}=Y(n),w=S(e,s),h=t&&j,i=P({...w,calendarIds:l,enabled:h});U(e,s,l,h);const k=_(i.instances,o,d),p=
|
|
1
|
+
import{j as c,q as x,B as E,r as f,fo as S}from"./index-4XPoPWhu.js";import{o as A,b as L,e as O,n as W,t as Z,U as B,m as P,p as U,h as F,r as M}from"./useCalendarSuggestions-D6k1REyo.js";import{a as q,t as z}from"./useCalendarTasks-DNBYBsvN.js";const K=[{scope:"this",label:"This event",note:"Leaves the rest of the series alone"},{scope:"following",label:"This and everything after",note:"Splits the series here"},{scope:"all",label:"The whole series",note:"Rewrites the rule itself"}];function Q({title:e,ruleText:s,instanceText:n,onChoose:t,onCancel:r,scopes:a,touch:o,className:d}){return c.jsxs("div",{className:x("flex flex-col gap-3",d),children:[c.jsxs("div",{children:[c.jsxs("h2",{className:"text-md font-semibold text-fg",children:[e," repeats"]}),c.jsx("p",{className:"text-xs text-fg-muted",children:s}),c.jsxs("p",{className:"text-xs text-fg-subtle",children:["You clicked ",n,"."]})]}),c.jsx("p",{className:"text-sm text-fg",children:"What should the change apply to?"}),c.jsx("div",{className:"flex flex-col gap-1.5",children:K.filter(l=>a===void 0||a.includes(l.scope)).map(l=>c.jsxs("button",{type:"button",onClick:()=>t(l.scope),className:x("flex flex-col rounded-md border border-line bg-surface px-3 py-2 text-left outline-none transition-colors hover:border-line-strong hover:bg-surface-sunken focus-visible:ring-2 focus-visible:ring-ring",o&&"min-h-11 justify-center"),children:[c.jsx("span",{className:"text-sm font-medium text-fg",children:l.label}),c.jsx("span",{className:"text-2xs text-fg-subtle",children:l.note})]},l.scope))}),c.jsx(E,{variant:"ghost",size:o?"md":"sm",onClick:r,className:x("self-start",o&&"min-h-11"),children:"Cancel"})]})}const C=e=>e.replace(/\r?\n[ \t]/g,""),I=e=>e.replace(/\\n/gi,`
|
|
2
|
+
`).replace(/\\,/g,",").replace(/\\;/g,";").replace(/\\\\/g,"\\");function g(e,s){let n=!1;for(let t=s.length;t<e.length;t+=1){const r=e[t];if(t===s.length&&r!==";"&&r!==":")return;if(r==='"'){n=!n;continue}if(!n&&r===":")return e.slice(t+1).trim()}}function v(e,s){for(const n of C(e).split(/\r?\n/)){if(!n.startsWith(s))continue;const t=g(n,s);if(t!==void 0)return t}return""}const X=e=>v(e,"RRULE"),$=e=>({location:I(v(e,"LOCATION")),description:I(v(e,"DESCRIPTION"))});function ee(e,s){const n=C(e).split(/\r?\n/).find(r=>r.startsWith("DTSTART")&&g(r,"DTSTART")!==void 0);if(n===void 0)return A(s);const t=/;TZID="?([^;:"]+)"?/i.exec(n)?.[1];return t!==void 0?Intl.supportedValuesOf("timeZone").includes(t)?t:s:g(n,"DTSTART")?.toUpperCase().endsWith("Z")?"":s}function V(e,s){const n=e.map(a=>a.id);if(s.length===0)return n;const t=new Set(s),r=n.filter(a=>t.has(a));return r.length===0?n:r}function Y(e){const{calendars:s,colorByCalendarId:n,timeZoneByCalendarId:t,isLoading:r}=L(),a=V(s,e),o=a.length===s.length?[]:a,d=e.length===0||s.length>0;return{calendars:s,colorByCalendarId:n,timeZoneByCalendarId:t,shown:a,narrowed:o,resolved:d,isLoading:r}}function _(e,s,n){const t=n.join(",");return f.useMemo(()=>{const r=O(),a=new Set(t===""?[]:t.split(","));return e.filter(o=>W(o)&&a.has(o.calendarId)).map(o=>Z(o,s[o.calendarId]??B,r))},[e,s,t])}function se({view:e,date:s,calendarIds:n,enabled:t=!0}){const{calendars:r,colorByCalendarId:a,timeZoneByCalendarId:o,shown:d,narrowed:l,resolved:j,isLoading:N}=Y(n),w=S(e,s),h=t&&j,i=P({...w,calendarIds:l,enabled:h});U(e,s,l,h);const k=_(i.instances,o,d),p=q(w,h),m=p.tasks,D=f.useMemo(()=>m.map(z),[m]),T=i.refetch,b=p.refetch,y=f.useCallback(()=>{T(),b()},[T,b]),R=f.useMemo(()=>new Set(i.instances.filter(u=>u.transparency==="Transparent").map(u=>F(u.calendarObjectId,u.recurrenceId))),[i.instances]);return{calendars:r,events:k,colorByCalendarId:a,timeZoneByCalendarId:o,isLoading:N||i.isLoading,error:i.error??p.error,retry:y,storedTasks:m,tasks:D,instanceOf:M,freeIds:R}}export{Q as R,_ as a,V as b,se as c,X as r,ee as s,$ as t,Y as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{f as y,a as f,c as g,
|
|
1
|
+
import{f as y,a as f,c as g,fT as m,g as b,fU as S,r as d,dh as M,df as p,aZ as I,bW as h}from"./index-4XPoPWhu.js";import{u as x}from"./useQueries-XPiXhlQX.js";import{u as O}from"./useDebouncedValue-B0BMCu3v.js";function Q(){const s=y(),{data:a}=f({...g(),staleTime:6e4}),{data:o}=f(m()),r=b(S()),i=d.useMemo(()=>(a?.accounts??[]).filter(n=>n.syncedServices.includes("Mail")).map(n=>({accountId:n.accountId,email:n.email})),[a?.accounts]),l=o?.defaultInvitationSenderAccountId,c=d.useCallback(async n=>{await r.mutateAsync({body:{defaultInvitationSenderAccountId:n}}),await s.invalidateQueries({queryKey:m().queryKey})},[r,s]);return{senders:i,defaultSenderId:l,setDefaultSender:c}}const E=2;function U(s){const a=O(s.trim(),200),{data:o}=f({...h({query:{q:a,limit:8}}),enabled:a.length>=E});return d.useMemo(()=>(o?.items??[]).map(r=>({email:r.normalizedEmail,name:r.displayName??""})),[o?.items])}const q=["sent","unfiled","failed","blocked"],v=["failed","blocked"];function w(s){const a=y(),o=b(M()),r=x({queries:s.map(e=>({...p({path:{outboxMessageId:e.outboxMessageId}}),meta:{softErrorStatuses:[404]},retry:!1,refetchInterval:u=>{if(u.state.error)return!1;const t=u.state.data?.status;return t&&q.includes(t)?!1:1500}}))}),i=s.flatMap((e,u)=>{const t=r[u];return!t?.error||I(t.error)===404?[]:[{send:e,error:t.error,refetch:t.refetch}]}),l=()=>{for(const e of i)e.refetch()},c=s.filter((e,u)=>{const t=r[u]?.data?.status;return t!==void 0&&v.includes(t)}),n=d.useCallback(async()=>{for(const e of c)await o.mutateAsync({path:{outboxMessageId:e.outboxMessageId}}),await a.invalidateQueries({queryKey:p({path:{outboxMessageId:e.outboxMessageId}}).queryKey})},[c,o,a]);return{missed:c.map(e=>e.email),retry:n,checkError:i[0]?.error??null,unchecked:i.map(e=>e.send.email),recheck:l}}export{w as a,U as b,Q as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as X,aC as Q,aD as B,fb as _,a as C,fc as ee,r as d,f as b,s as y,g as m,fd as te,fe as ne,ff as ae,aY as A,b9 as se,b7 as re,b8 as oe,fg as ie,cc as w,fh as S,f9 as ce,cs as de,fi as le,fj as ue,fk as fe,fl as pe,fm as ge,fn as me,fo as Ce,fp as ye}from"./index-CL_fwLHN.js";import{f as I}from"./ErrorState-KjDYblD5.js";import{u as G}from"./useQueries-hChzM5ru.js";const Fe=X("MapPin",[["path",{d:"M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0",key:"1r0f0z"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}]]);function je(e){return Q(B({title:`Calendar invitation: ${e}`,errorMessage:e}))}function We(e){return Q(B({title:`Calendar event: ${e}`,errorMessage:e}))}const K=()=>Intl.DateTimeFormat().resolvedOptions().timeZone,q="";function Ue(e){if(e!==q)return e;const t=K();return Intl.supportedValuesOf("timeZone").includes(t)?t:q}const Ee={Cal1:"cal-1",Cal2:"cal-2",Cal3:"cal-3",Cal4:"cal-4",Cal5:"cal-5",Cal6:"cal-6"},Z={Unscheduled:"accepted",Organizer:"accepted",Accepted:"accepted",Tentative:"tentative",Declined:"declined",NeedsAction:"noReply"},$e=e=>Z[e],Oe={Local:"local",Explicit:"explicit",Ambiguous:"ambiguous"},z="#";function he(e,t){return t===""?e:`${e}${z}${t}`}function R(e){const t=e.indexOf(z);return t===-1?{calendarObjectId:e,recurrenceId:""}:{calendarObjectId:e.slice(0,t),recurrenceId:e.slice(t+1)}}const H=(e,t)=>{const n=[...e].sort((a,r)=>Date.parse(a.start)-Date.parse(r.start));return n.find(a=>Date.parse(a.end)>Date.parse(t))??n[0]};function xe(e,t,n){const a=H(e.filter(r=>{const o=R(r.id);return o.calendarObjectId===t&&o.recurrenceId!==""}),n);return a?R(a.id):void 0}function F(e,t,n,a){const r=H(e.filter(o=>o.calendarObjectId===t&&ve(o)).map(o=>Se(o,"",a)),n);if(r)return{...R(r.id),calendarId:r.calendarId,date:r.start.slice(0,10)}}function j(e){return{id:e.calendarId,accountId:e.accountConfigId,accountLabel:"",name:e.displayName,color:Ee[e.color]??"cal-1",...e.source==="Subscribed"?{readOnly:!0,sync:e.subscriptionEnabled?"live":"paused",syncError:e.subscriptionError}:{}}}function Se(e,t,n){return{id:he(e.calendarObjectId,e.recurrenceId),calendarId:e.calendarId,title:e.summary,start:e.allDay?e.start.slice(0,10):_(e.start,n),end:e.allDay?e.end.slice(0,10):_(e.end,n),allDay:e.allDay,location:"",notes:"",attendees:[],myRsvp:Z[e.participation],threadId:"",threadSubject:"",timeZone:t,zoneCertainty:Oe[e.zoneCertainty]??"explicit",recurrenceRule:e.hasRecurrence?"Repeats":"",seriesId:e.hasRecurrence?e.icalUid:"",seriesException:!1,status:e.status==="Tentative"?"tentative":"confirmed"}}const ve=e=>e.status!=="Cancelled";function Qe(){const{data:e,isLoading:t,error:n,refetch:a}=C(ee());return d.useMemo(()=>{const r=e?.items??[],o=r.filter(i=>i.componentSet!=="VtodoOnly"),l=o.map(j),s=r.filter(i=>i.componentSet==="VtodoOnly").map(j);return{calendars:l,taskLists:s,collections:r,colorByCalendarId:Object.fromEntries(l.map(i=>[i.id,i.color])),timeZoneByCalendarId:Object.fromEntries(r.map(i=>[i.calendarId,i.timezone])),defaultCalendarId:(o.find(i=>i.source==="Default")??o[0])?.calendarId??"",isLoading:t,error:n??null,retry:()=>{a()}}},[e,t,n,a])}const D=y(400,404,412),be=new Set(["calendarEventOperationsListCalendarEvents","calendarEventDetailOperationsGetCalendarEvent","calendarFreeBusyOperationsListCalendarFreeBusy","calendarTaskOperationsListCalendarTasks","calendarTaskDetailOperationsGetCalendarTask"]),W=e=>A(e)===412?{kind:"conflict"}:{kind:"refused",message:I(e)},Ae={this:"This",following:"Following",all:"All"};function V(){const e=b();return d.useCallback(()=>{e.invalidateQueries({predicate:t=>{const n=t.queryKey[0];if(typeof n!="object"||n===null)return!1;const a=n._id;return typeof a=="string"&&be.has(a)}})},[e])}const U=({scope:e,recurrenceId:t})=>e===void 0?{}:{scope:Ae[e],recurrenceId:t};function Be(){const e=V(),t=m({...te(),meta:D,onSuccess:e}),n=m({...ne(),meta:D,onSuccess:e}),a=m({...ae(),meta:D,onSuccess:e}),r=d.useCallback(s=>t.mutateAsync({body:s}).then(i=>({kind:"created",calendarObjectId:i.calendarObjectId,sends:i.sends})).catch(i=>A(i)===412?{kind:"conflict"}:{kind:"refused",message:I(i)}),[t]),o=d.useCallback((s,i)=>n.mutateAsync({path:{calendarObjectId:s.calendarObjectId},query:{calendarId:s.calendarId,...U(s)},headers:{"If-Match":s.etag},body:i}).then(f=>({kind:"written",sends:f.sends})).catch(W),[n]),l=d.useCallback(s=>a.mutateAsync({path:{calendarObjectId:s.calendarObjectId},query:{calendarId:s.calendarId,...U(s)},headers:{"If-Match":s.etag}}).then(i=>({kind:"written",sends:i.sends})).catch(W),[a]);return d.useMemo(()=>({createEvent:r,updateEvent:o,deleteEvent:l,isWriting:t.isPending||n.isPending||a.isPending}),[r,o,l,t.isPending,n.isPending,a.isPending])}const M=y(400,404),L={kind:"written"},P=e=>({kind:"refused",message:I(e)});function we(){const e=b(),t=V(),n=d.useCallback(()=>e.invalidateQueries({queryKey:se()}),[e]),a=d.useCallback(()=>(t(),n()),[t,n]),r=m({...re(),meta:M,onSuccess:n}),o=m({...oe(),meta:M,onSuccess:a}),l=m({...ie(),meta:M,onSuccess:a}),s=d.useCallback(c=>r.mutateAsync({body:c}).then(()=>L).catch(P),[r]),i=d.useCallback((c,p)=>o.mutateAsync({path:{calendarId:c},body:p}).then(()=>L).catch(P),[o]),f=d.useCallback(c=>l.mutateAsync({path:{calendarId:c}}).then(()=>L).catch(P),[l]);return d.useMemo(()=>({createCalendar:s,updateCalendar:i,deleteCalendar:f,isWriting:r.isPending||o.isPending||l.isPending}),[s,i,f,r.isPending,o.isPending,l.isPending])}const Ie=y(404);function Ge(e,t){const{data:n,isLoading:a,error:r,refetch:o}=C({...w({path:{calendarObjectId:e},query:{calendarId:t}}),meta:Ie,enabled:e!==""&&t!==""});return{resource:n,isLoading:a,error:r,refetch:()=>{o()}}}const Y=y(400,404),k=5*6e4,T=({from:e,to:t,calendarIds:n})=>({query:n.length===0?{from:e,to:t}:{from:e,to:t,calendarId:[...n]}});function Ke(e){const{data:t,isLoading:n,error:a,refetch:r}=C({...S(T(e)),meta:Y,staleTime:k,enabled:e.enabled??!0});return{instances:t?.items??[],isLoading:n,error:a,refetch:()=>{r()}}}function Ze(e,t,n){const a=G({queries:e.map(c=>({...S(T({...c,calendarIds:t})),meta:Y,staleTime:k,enabled:n}))}),r=e.map(c=>c.from).join("|"),o=a.map(c=>c.data),l=a.map(c=>c.isPending).join("|"),s=a.find(c=>c.error)?.error??null,i=d.useMemo(()=>o.flatMap(c=>c?.items??[]),[r,l]),f=d.useMemo(()=>{const c=new Set;return e.forEach((p,u)=>{a[u]?.isPending&&c.add(p.from)}),c},[r,l]);return{instances:i,pendingWindows:f,error:s,refetch:()=>{for(const c of a)c.error&&c.refetch()}}}function ze(e,t,n,a){const r=b(),o=[...n].join(",");d.useEffect(()=>{if(!a)return;const l=o===""?[]:o.split(",");for(const s of[-1,1]){const i=ce(e,de(t,e,s));r.prefetchQuery({...S(T({...i,calendarIds:l})),staleTime:k})}},[r,e,t,o,a])}const ke=y(400,404);function He(e){const t=G({queries:e.map(s=>({...le({query:{from:s.from,to:s.to}}),meta:ke,staleTime:k}))}),n=e.map(s=>s.from).join("|"),a=t.map(s=>s.data),r=t.map(s=>s.isPending).join("|"),o=d.useMemo(()=>a.flatMap(s=>s?.items??[]),[n,r]),l=d.useMemo(()=>{const s=new Set;return e.forEach((i,f)=>{t[f]?.isPending&&s.add(i.from)}),s},[n,r]);return{spans:o,pendingWindows:l,error:t.find(s=>s.error)?.error??null,refetch:()=>{for(const s of t)s.error&&s.refetch()}}}const $=365*24*60*6e4,De=1440*6e4,x=y(),Me=y(404),v=e=>new Date(e).toISOString().replace(/\.\d{3}Z$/,"+00:00"),Le=e=>{const t=e instanceof Error&&e.message!==""?e.message:"no reason given",n=A(e);return n===void 0?t:`${t} (HTTP ${n})`};function Ve(e,t){const[n]=d.useState(()=>Date.now()),a=K(),r=new Date(n).toISOString(),o=C({...S({query:{from:v(n),to:v(n+$),calendarObjectId:e}}),meta:x,retry:!1,enabled:t}),l=o.data?F(o.data.items,e,r,a):void 0,s=C({...w({path:{calendarObjectId:e}}),meta:Me,retry:!1,enabled:t&&o.data!==void 0&&l===void 0}),i=Date.parse(s.data?.dtStart??""),f=s.data!==void 0&&Number.isNaN(i),c=Number.isNaN(i)?0:i-De,p=C({...S({query:{from:v(c),to:v(c+$),calendarObjectId:e}}),meta:x,retry:!1,enabled:t&&s.data!==void 0&&!f}),u=p.data?F(p.data.items,e,r,a):void 0;if(!t)return{kind:"Idle"};if(l)return{kind:"Found",jump:l};if(u)return{kind:"Found",jump:u};const g=A(s.error)===404,N=[o.error,g?null:s.error,p.error].find(J=>J!==null);return N!==void 0?{kind:"Failed",reason:Le(N)}:g?{kind:"Deleted"}:f?{kind:"Failed",reason:`the stored event names no readable start (${s.data?.dtStart??""})`}:p.data!==void 0?{kind:"NoOccurrenceFound"}:{kind:"Searching"}}const E=y(400,404),Pe=new Set(["calendarSuggestionOperationsListCalendarSuggestions","messageCalendarSuggestionOperationsListMessageCalendarSuggestions","calendarEventOperationsListCalendarEvents","calendarEventDetailOperationsGetCalendarEvent","calendarFreeBusyOperationsListCalendarFreeBusy","filterOperationsListFilters"]),Re=e=>e.invalidateQueries({predicate:t=>{const n=t.queryKey[0];if(typeof n!="object"||n===null)return!1;const a=n._id;return typeof a=="string"&&Pe.has(a)}});function Ye(e){const{data:t,isLoading:n,error:a}=C({...ue({path:{messageId:e}}),meta:E});return{suggestions:t?.items??[],isLoading:n,error:a??null}}function Je(){const{data:e,isLoading:t,error:n}=C({...Ce({query:{state:"Pending"}}),meta:E});return{suggestions:e?.items??[],isLoading:t,error:n??null}}const Te=async(e,t)=>{let n;do{const{data:a}=await ye({query:{state:"Pending",continuationToken:n},signal:t,throwOnError:!0}),r=a.items.find(o=>o.suggestionId===e);if(r)return r;n=a.continuationToken}while(n);return null};function Xe(e){const{data:t,isLoading:n,error:a}=C({queryKey:[{_id:"calendarSuggestionOperationsListCalendarSuggestions",suggestionId:e}],queryFn:({signal:r})=>Te(e,r),meta:E});return{suggestion:t,isLoading:n,error:a??null}}const O={kind:"answered"},h=e=>({kind:"refused",message:I(e)});function et(){const e=b(),t=d.useCallback(()=>Re(e),[e]),n=m({...fe(),meta:E,onSuccess:t}),a=m({...pe(),meta:E,onSuccess:t}),r=m({...ge(),meta:E,onSuccess:t}),o=m({...me(),meta:E,onSuccess:t}),l=d.useCallback((u,g)=>n.mutateAsync({path:{suggestionId:u},body:{calendarId:g}}).then(()=>O).catch(h),[n]),s=d.useCallback((u,g)=>n.mutateAsync({path:{suggestionId:u},body:{calendarId:g,answer:"Tentative"}}).then(()=>O).catch(h),[n]),i=d.useCallback((u,g)=>n.mutateAsync({path:{suggestionId:u},body:g}).then(()=>O).catch(h),[n]),f=d.useCallback(u=>a.mutateAsync({path:{suggestionId:u}}).then(()=>O).catch(h),[a]),c=d.useCallback((u,g)=>r.mutateAsync({path:{suggestionId:u},body:{muteSender:g}}).then(()=>O).catch(h),[r]),p=d.useCallback(u=>o.mutateAsync({path:{suggestionId:u}}).then(()=>O).catch(h),[o]);return d.useMemo(()=>({accept:l,tentative:s,acceptEdited:i,decline:f,dismiss:c,reopen:p,isAnswering:n.isPending||a.isPending||r.isPending||o.isPending}),[l,s,i,f,c,p,n.isPending,a.isPending,r.isPending,o.isPending])}export{D as C,Fe as M,q as U,V as a,Qe as b,We as c,Be as d,K as e,Ze as f,He as g,he as h,Je as i,et as j,je as k,Ye as l,Ke as m,ve as n,Ue as o,ze as p,Ge as q,R as r,xe as s,Se as t,we as u,Ve as v,$e as w,Xe as x};
|
|
1
|
+
import{b as X,aD as B,aE as Q,fq as _,a as C,fr as ee,r as d,f as b,s as y,g as m,fs as te,ft as ne,fu as ae,aZ as A,ba as se,b8 as re,b9 as oe,fv as ie,cr as w,fw as S,fo as ce,cH as de,fx as le,fy as ue,fz as fe,fA as pe,fB as ge,fC as me,fD as Ce,fE as ye}from"./index-4XPoPWhu.js";import{f as I}from"./ErrorState-DcP5ZTMN.js";import{u as G}from"./useQueries-XPiXhlQX.js";const Fe=X("MapPin",[["path",{d:"M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0",key:"1r0f0z"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}]]);function We(e){return B(Q({title:`Calendar invitation: ${e}`,errorMessage:e}))}function je(e){return B(Q({title:`Calendar event: ${e}`,errorMessage:e}))}const K=()=>Intl.DateTimeFormat().resolvedOptions().timeZone,q="";function Ue(e){if(e!==q)return e;const t=K();return Intl.supportedValuesOf("timeZone").includes(t)?t:q}const Ee={Cal1:"cal-1",Cal2:"cal-2",Cal3:"cal-3",Cal4:"cal-4",Cal5:"cal-5",Cal6:"cal-6"},Z={Unscheduled:"accepted",Organizer:"accepted",Accepted:"accepted",Tentative:"tentative",Declined:"declined",NeedsAction:"noReply"},xe=e=>Z[e],Oe={Local:"local",Explicit:"explicit",Ambiguous:"ambiguous"},z="#";function he(e,t){return t===""?e:`${e}${z}${t}`}function R(e){const t=e.indexOf(z);return t===-1?{calendarObjectId:e,recurrenceId:""}:{calendarObjectId:e.slice(0,t),recurrenceId:e.slice(t+1)}}const H=(e,t)=>{const n=[...e].sort((a,r)=>Date.parse(a.start)-Date.parse(r.start));return n.find(a=>Date.parse(a.end)>Date.parse(t))??n[0]};function $e(e,t,n){const a=H(e.filter(r=>{const o=R(r.id);return o.calendarObjectId===t&&o.recurrenceId!==""}),n);return a?R(a.id):void 0}function F(e,t,n,a){const r=H(e.filter(o=>o.calendarObjectId===t&&ve(o)).map(o=>Se(o,"",a)),n);if(r)return{...R(r.id),calendarId:r.calendarId,date:r.start.slice(0,10)}}function W(e){return{id:e.calendarId,accountId:e.accountConfigId,accountLabel:"",name:e.displayName,color:Ee[e.color]??"cal-1",...e.source==="Subscribed"?{readOnly:!0,sync:e.subscriptionEnabled?"live":"paused",syncError:e.subscriptionError}:{}}}function Se(e,t,n){return{id:he(e.calendarObjectId,e.recurrenceId),calendarId:e.calendarId,title:e.summary,start:e.allDay?e.start.slice(0,10):_(e.start,n),end:e.allDay?e.end.slice(0,10):_(e.end,n),allDay:e.allDay,location:"",notes:"",attendees:[],myRsvp:Z[e.participation],threadId:"",threadSubject:"",timeZone:t,zoneCertainty:Oe[e.zoneCertainty]??"explicit",recurrenceRule:e.hasRecurrence?"Repeats":"",seriesId:e.hasRecurrence?e.icalUid:"",seriesException:!1,status:e.status==="Tentative"?"tentative":"confirmed"}}const ve=e=>e.status!=="Cancelled";function Be(){const{data:e,isLoading:t,error:n,refetch:a}=C(ee());return d.useMemo(()=>{const r=e?.items??[],o=r.filter(i=>i.componentSet!=="VtodoOnly"),l=o.map(W),s=r.filter(i=>i.componentSet==="VtodoOnly").map(W);return{calendars:l,taskLists:s,collections:r,colorByCalendarId:Object.fromEntries(l.map(i=>[i.id,i.color])),timeZoneByCalendarId:Object.fromEntries(r.map(i=>[i.calendarId,i.timezone])),defaultCalendarId:(o.find(i=>i.source==="Default")??o[0])?.calendarId??"",isLoading:t,error:n??null,retry:()=>{a()}}},[e,t,n,a])}const D=y(400,404,412),be=new Set(["calendarEventOperationsListCalendarEvents","calendarEventDetailOperationsGetCalendarEvent","calendarFreeBusyOperationsListCalendarFreeBusy","calendarTaskOperationsListCalendarTasks","calendarTaskDetailOperationsGetCalendarTask"]),j=e=>A(e)===412?{kind:"conflict"}:{kind:"refused",message:I(e)},Ae={this:"This",following:"Following",all:"All"};function V(){const e=b();return d.useCallback(()=>{e.invalidateQueries({predicate:t=>{const n=t.queryKey[0];if(typeof n!="object"||n===null)return!1;const a=n._id;return typeof a=="string"&&be.has(a)}})},[e])}const U=({scope:e,recurrenceId:t})=>e===void 0?{}:{scope:Ae[e],recurrenceId:t};function Qe(){const e=V(),t=m({...te(),meta:D,onSuccess:e}),n=m({...ne(),meta:D,onSuccess:e}),a=m({...ae(),meta:D,onSuccess:e}),r=d.useCallback(s=>t.mutateAsync({body:s}).then(i=>({kind:"created",calendarObjectId:i.calendarObjectId,sends:i.sends})).catch(i=>A(i)===412?{kind:"conflict"}:{kind:"refused",message:I(i)}),[t]),o=d.useCallback((s,i)=>n.mutateAsync({path:{calendarObjectId:s.calendarObjectId},query:{calendarId:s.calendarId,...U(s)},headers:{"If-Match":s.etag},body:i}).then(f=>({kind:"written",sends:f.sends})).catch(j),[n]),l=d.useCallback(s=>a.mutateAsync({path:{calendarObjectId:s.calendarObjectId},query:{calendarId:s.calendarId,...U(s)},headers:{"If-Match":s.etag}}).then(i=>({kind:"written",sends:i.sends})).catch(j),[a]);return d.useMemo(()=>({createEvent:r,updateEvent:o,deleteEvent:l,isWriting:t.isPending||n.isPending||a.isPending}),[r,o,l,t.isPending,n.isPending,a.isPending])}const M=y(400,404),L={kind:"written"},P=e=>({kind:"refused",message:I(e)});function we(){const e=b(),t=V(),n=d.useCallback(()=>e.invalidateQueries({queryKey:se()}),[e]),a=d.useCallback(()=>(t(),n()),[t,n]),r=m({...re(),meta:M,onSuccess:n}),o=m({...oe(),meta:M,onSuccess:a}),l=m({...ie(),meta:M,onSuccess:a}),s=d.useCallback(c=>r.mutateAsync({body:c}).then(()=>L).catch(P),[r]),i=d.useCallback((c,p)=>o.mutateAsync({path:{calendarId:c},body:p}).then(()=>L).catch(P),[o]),f=d.useCallback(c=>l.mutateAsync({path:{calendarId:c}}).then(()=>L).catch(P),[l]);return d.useMemo(()=>({createCalendar:s,updateCalendar:i,deleteCalendar:f,isWriting:r.isPending||o.isPending||l.isPending}),[s,i,f,r.isPending,o.isPending,l.isPending])}const Ie=y(404);function Ge(e,t){const{data:n,isLoading:a,error:r,refetch:o}=C({...w({path:{calendarObjectId:e},query:{calendarId:t}}),meta:Ie,enabled:e!==""&&t!==""});return{resource:n,isLoading:a,error:r,refetch:()=>{o()}}}const Y=y(400,404),k=5*6e4,T=({from:e,to:t,calendarIds:n})=>({query:n.length===0?{from:e,to:t}:{from:e,to:t,calendarId:[...n]}});function Ke(e){const{data:t,isLoading:n,error:a,refetch:r}=C({...S(T(e)),meta:Y,staleTime:k,enabled:e.enabled??!0});return{instances:t?.items??[],isLoading:n,error:a,refetch:()=>{r()}}}function Ze(e,t,n){const a=G({queries:e.map(c=>({...S(T({...c,calendarIds:t})),meta:Y,staleTime:k,enabled:n}))}),r=e.map(c=>c.from).join("|"),o=a.map(c=>c.data),l=a.map(c=>c.isPending).join("|"),s=a.find(c=>c.error)?.error??null,i=d.useMemo(()=>o.flatMap(c=>c?.items??[]),[r,l]),f=d.useMemo(()=>{const c=new Set;return e.forEach((p,u)=>{a[u]?.isPending&&c.add(p.from)}),c},[r,l]);return{instances:i,pendingWindows:f,error:s,refetch:()=>{for(const c of a)c.error&&c.refetch()}}}function ze(e,t,n,a){const r=b(),o=[...n].join(",");d.useEffect(()=>{if(!a)return;const l=o===""?[]:o.split(",");for(const s of[-1,1]){const i=ce(e,de(t,e,s));r.prefetchQuery({...S(T({...i,calendarIds:l})),staleTime:k})}},[r,e,t,o,a])}const ke=y(400,404);function He(e){const t=G({queries:e.map(s=>({...le({query:{from:s.from,to:s.to}}),meta:ke,staleTime:k}))}),n=e.map(s=>s.from).join("|"),a=t.map(s=>s.data),r=t.map(s=>s.isPending).join("|"),o=d.useMemo(()=>a.flatMap(s=>s?.items??[]),[n,r]),l=d.useMemo(()=>{const s=new Set;return e.forEach((i,f)=>{t[f]?.isPending&&s.add(i.from)}),s},[n,r]);return{spans:o,pendingWindows:l,error:t.find(s=>s.error)?.error??null,refetch:()=>{for(const s of t)s.error&&s.refetch()}}}const x=365*24*60*6e4,De=1440*6e4,$=y(),Me=y(404),v=e=>new Date(e).toISOString().replace(/\.\d{3}Z$/,"+00:00"),Le=e=>{const t=e instanceof Error&&e.message!==""?e.message:"no reason given",n=A(e);return n===void 0?t:`${t} (HTTP ${n})`};function Ve(e,t){const[n]=d.useState(()=>Date.now()),a=K(),r=new Date(n).toISOString(),o=C({...S({query:{from:v(n),to:v(n+x),calendarObjectId:e}}),meta:$,retry:!1,enabled:t}),l=o.data?F(o.data.items,e,r,a):void 0,s=C({...w({path:{calendarObjectId:e}}),meta:Me,retry:!1,enabled:t&&o.data!==void 0&&l===void 0}),i=Date.parse(s.data?.dtStart??""),f=s.data!==void 0&&Number.isNaN(i),c=Number.isNaN(i)?0:i-De,p=C({...S({query:{from:v(c),to:v(c+x),calendarObjectId:e}}),meta:$,retry:!1,enabled:t&&s.data!==void 0&&!f}),u=p.data?F(p.data.items,e,r,a):void 0;if(!t)return{kind:"Idle"};if(l)return{kind:"Found",jump:l};if(u)return{kind:"Found",jump:u};const g=A(s.error)===404,N=[o.error,g?null:s.error,p.error].find(J=>J!==null);return N!==void 0?{kind:"Failed",reason:Le(N)}:g?{kind:"Deleted"}:f?{kind:"Failed",reason:`the stored event names no readable start (${s.data?.dtStart??""})`}:p.data!==void 0?{kind:"NoOccurrenceFound"}:{kind:"Searching"}}const E=y(400,404),Pe=new Set(["calendarSuggestionOperationsListCalendarSuggestions","messageCalendarSuggestionOperationsListMessageCalendarSuggestions","calendarEventOperationsListCalendarEvents","calendarEventDetailOperationsGetCalendarEvent","calendarFreeBusyOperationsListCalendarFreeBusy","filterOperationsListFilters"]),Re=e=>e.invalidateQueries({predicate:t=>{const n=t.queryKey[0];if(typeof n!="object"||n===null)return!1;const a=n._id;return typeof a=="string"&&Pe.has(a)}});function Ye(e){const{data:t,isLoading:n,error:a}=C({...ue({path:{messageId:e}}),meta:E});return{suggestions:t?.items??[],isLoading:n,error:a??null}}function Je(){const{data:e,isLoading:t,error:n}=C({...Ce({query:{state:"Pending"}}),meta:E});return{suggestions:e?.items??[],isLoading:t,error:n??null}}const Te=async(e,t)=>{let n;do{const{data:a}=await ye({query:{state:"Pending",continuationToken:n},signal:t,throwOnError:!0}),r=a.items.find(o=>o.suggestionId===e);if(r)return r;n=a.continuationToken}while(n);return null};function Xe(e){const{data:t,isLoading:n,error:a}=C({queryKey:[{_id:"calendarSuggestionOperationsListCalendarSuggestions",suggestionId:e}],queryFn:({signal:r})=>Te(e,r),meta:E});return{suggestion:t,isLoading:n,error:a??null}}const O={kind:"answered"},h=e=>({kind:"refused",message:I(e)});function et(){const e=b(),t=d.useCallback(()=>Re(e),[e]),n=m({...fe(),meta:E,onSuccess:t}),a=m({...pe(),meta:E,onSuccess:t}),r=m({...ge(),meta:E,onSuccess:t}),o=m({...me(),meta:E,onSuccess:t}),l=d.useCallback((u,g)=>n.mutateAsync({path:{suggestionId:u},body:{calendarId:g}}).then(()=>O).catch(h),[n]),s=d.useCallback((u,g)=>n.mutateAsync({path:{suggestionId:u},body:{calendarId:g,answer:"Tentative"}}).then(()=>O).catch(h),[n]),i=d.useCallback((u,g)=>n.mutateAsync({path:{suggestionId:u},body:g}).then(()=>O).catch(h),[n]),f=d.useCallback(u=>a.mutateAsync({path:{suggestionId:u}}).then(()=>O).catch(h),[a]),c=d.useCallback((u,g)=>r.mutateAsync({path:{suggestionId:u},body:{muteSender:g}}).then(()=>O).catch(h),[r]),p=d.useCallback(u=>o.mutateAsync({path:{suggestionId:u}}).then(()=>O).catch(h),[o]);return d.useMemo(()=>({accept:l,tentative:s,acceptEdited:i,decline:f,dismiss:c,reopen:p,isAnswering:n.isPending||a.isPending||r.isPending||o.isPending}),[l,s,i,f,c,p,n.isPending,a.isPending,r.isPending,o.isPending])}export{D as C,Fe as M,q as U,V as a,Be as b,je as c,Qe as d,K as e,Ze as f,He as g,he as h,Je as i,et as j,We as k,Ye as l,Ke as m,ve as n,Ue as o,ze as p,Ge as q,R as r,$e as s,Se as t,we as u,Ve as v,xe as w,Xe as x};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as u,j as O,
|
|
1
|
+
import{r as u,j as O,q as v,g as y,fV as P,fW as q,fX as W,a as E,fY as R,aZ as I,fZ as j,s as D}from"./index-4XPoPWhu.js";import{f as z}from"./ErrorState-DcP5ZTMN.js";import{a as X,C as k}from"./useCalendarSuggestions-D6k1REyo.js";const i=8,x=(e,t,a)=>Math.min(Math.max(e,t),Math.max(t,a)),Y=(e,t)=>e.width>0&&e.height>0&&e.left<t.width&&e.left+e.width>0&&e.top<t.height&&e.top+e.height>0;function C(e,t){return{left:Math.max(i,(t.width-e.width)/2),top:Math.max(i,(t.height-e.height)/2),side:"center"}}function B(e,t,a){if(!e||!Y(e,a))return C(t,a);const r=x(e.top,i,a.height-t.height-i),c=e.left+e.width+i;if(c+t.width<=a.width-i)return{left:c,top:r,side:"right"};const f=e.left-i-t.width;if(f>=i)return{left:f,top:r,side:"left"};const l=x(e.left,i,a.width-t.width-i),s=e.top+e.height+i;if(s+t.height<=a.height-i)return{left:l,top:s,side:"below"};const h=e.top-i-t.height;return h>=i?{left:l,top:h,side:"above"}:C(t,a)}const G='a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])';function V({anchor:e,anchorKey:t,labelledBy:a,children:r,header:c,wrapTab:f=!1,panelRef:l,className:s}){const h=u.useRef(null),[w,M]=u.useState(null),[b,A]=u.useState({key:t,x:0,y:0}),g=b.key===t?b:{x:0,y:0};u.useLayoutEffect(()=>{const n=h.current;if(!n||t==="")return;const d=()=>{const o=(typeof e=="string"?document.querySelector(e):e)?.getBoundingClientRect();M(B(o?{left:o.left,top:o.top,width:o.width,height:o.height}:null,{width:n.offsetWidth,height:n.offsetHeight},{width:window.innerWidth,height:window.innerHeight}))};return d(),window.addEventListener("resize",d),()=>window.removeEventListener("resize",d)},[e,t]);const L=n=>{if(n.button!==0||n.target instanceof Element&&n.target.closest("button, input, select, a"))return;n.preventDefault();const d={x:n.clientX-g.x,y:n.clientY-g.y},m=p=>A({key:t,x:p.clientX-d.x,y:p.clientY-d.y}),o=()=>{window.removeEventListener("pointermove",m),window.removeEventListener("pointerup",o)};window.addEventListener("pointermove",m),window.addEventListener("pointerup",o)},S=n=>{if(!f||n.key!=="Tab")return;const d=Array.from(n.currentTarget.querySelectorAll(G));if(d.length===0)return;const m=d[0],o=d[d.length-1];n.shiftKey&&document.activeElement===m?(n.preventDefault(),o.focus()):!n.shiftKey&&document.activeElement===o&&(n.preventDefault(),m.focus())};return O.jsxs("div",{ref:n=>{h.current=n,typeof l=="function"?l(n):l&&(l.current=n)},role:"dialog","aria-modal":"false","aria-labelledby":a,"data-calendar-popover":"",onKeyDown:S,className:v("fixed z-40 w-[26rem] max-w-[calc(100vw-1rem)] rounded-xl border border-line bg-surface-raised text-fg shadow-xl shadow-black/20",w===null&&"opacity-0",s),style:{left:(w?.left??0)+g.x,top:(w?.top??0)+g.y},children:[c?.({onPointerDown:L}),r]})}const Z=e=>({calendarTaskId:e.calendarTaskId,calendarId:e.calendarId,title:e.summary,due:e.allDay?e.due.slice(0,10):e.dueAt,allDay:e.allDay,completed:e.completed});function _(e,t=!0){const{data:a,error:r,refetch:c}=E({...R({query:{from:e.from,to:e.to}}),meta:D(400,404),enabled:t});return{tasks:u.useMemo(()=>a?.items??[],[a?.items]),error:r,refetch:c}}function F(e){const{data:t,error:a,refetch:r}=E({...j({path:{calendarTaskId:e}}),meta:D(404),retry:!1});return t?{kind:"found",task:t}:a===null?{kind:"loading"}:I(a)===404?{kind:"gone"}:{kind:"failed",error:a,retry:()=>{r()}}}const T=e=>({kind:"refused",message:I(e)===412?"This task changed while you were looking at it. Close it and open it again.":z(e)});function Q(){const e=X(),t=y({...P(),meta:k,onSuccess:e}),a=y({...q(),meta:k,onSuccess:e}),r=y({...W(),meta:k,onSuccess:e}),c=u.useCallback(s=>t.mutateAsync({body:s}).then(()=>({kind:"written"})).catch(T),[t]),f=u.useCallback((s,h)=>a.mutateAsync({path:{calendarTaskId:s.calendarTaskId},query:{calendarId:s.calendarId},headers:{"If-Match":s.etag},body:h}).then(()=>({kind:"written"})).catch(T),[a]),l=u.useCallback(s=>r.mutateAsync({path:{calendarTaskId:s.calendarTaskId},query:{calendarId:s.calendarId},headers:{"If-Match":s.etag}}).then(()=>({kind:"written"})).catch(T),[r]);return{createTask:c,updateTask:f,deleteTask:l,isWriting:t.isPending||a.isPending||r.isPending}}export{V as C,_ as a,F as b,Z as t,Q as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as o}from"./index-
|
|
1
|
+
import{r as o}from"./index-4XPoPWhu.js";const n=(e,t)=>{const[r,u]=o.useState(e);return o.useEffect(()=>{const s=setTimeout(()=>u(e),t);return()=>clearTimeout(s)},[e,t]),r};export{n as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as d,g as h,
|
|
1
|
+
import{r as d,g as h,fF as x,a as M,fG as P,fH as N,fI as L,f as v,fJ as I,fK as T,fL as z,fM as R,bc as w}from"./index-4XPoPWhu.js";const Y=(e,t)=>{if(e.state==="Expired")return"Expired";const r=e.state==="Disabled"?"Disabled":"Active";if(e.scope!=="Temporary"||!e.expiresAt)return r;const s=Date.parse(e.expiresAt);return Number.isNaN(s)?r:s<=t?"Expired":r},O={UserDisabled:"Turned off. Turn it on to run it on new mail again.",AwaitingFolder:"Off until its folder exists on the mail server. It turns on by itself once the folder is created.",FolderCreateFailed:"Off: the mail server refused to create its folder. Pick another folder in the rule, then turn it on.",FolderMissing:"Off: the folder it moves mail into no longer exists. Pick another folder in the rule, then turn it on."},X=e=>e.disabledReason==="None"?void 0:(e.disabledReason==="AwaitingFolder"||e.disabledReason==="FolderCreateFailed")&&e.actionMailboxId!=="None"?O.UserDisabled:O[e.disabledReason],Z=e=>{if(!e)return;const t=Date.parse(e);if(!Number.isNaN(t))return new Date(t).toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"})},A=(e,t=new Date)=>{if(!e)return;const r=/^(\d{4})-(\d{2})-(\d{2})$/.exec(e);if(!r)return;const[,s,i,a]=r,n=new Date(Number(s),Number(i)-1,Number(a),23,59,59,0);if(Number.isNaN(n.getTime()))return;const o=-t.getTimezoneOffset(),l=o>=0?"+":"-",c=Math.abs(o),f=String(Math.floor(c/60)).padStart(2,"0"),p=String(c%60).padStart(2,"0"),u=m=>String(m).padStart(2,"0");return`${n.getFullYear()}-${u(n.getMonth()+1)}-${u(n.getDate())}T${u(n.getHours())}:${u(n.getMinutes())}:${u(n.getSeconds())}${l}${f}:${p}`},g="None",k=e=>({filterId:e,matchOperator:"And",literalClauses:[],actionLabelId:g,actionMailboxId:g}),D=e=>({matchOperator:e.matchOperator,literalClauses:e.literalClauses,actionLabelId:e.labelId??g,actionMailboxId:e.moveMailboxId??g}),ee=({mode:e,ruleScope:t})=>t==="standing"?"standing":t==="until"?"temporary":e==="selected"?"just-these":"all-like-these",te=({ruleScope:e,clauses:t,matchOperator:r,moveMailboxId:s,until:i})=>({matchOperator:r==="all"?"And":"Or",literalClauses:t.map(a=>({field:a.field,value:a.value})),moveMailboxId:s,expiresAt:e==="until"?A(i??""):void 0}),y=(e,t,r)=>({name:r,scope:t==="standing"?"Standing":"Temporary",...t==="temporary"&&e.expiresAt?{expiresAt:e.expiresAt}:{},matchOperator:e.matchOperator,literalClauses:e.literalClauses,actionLabelId:e.labelId??g,actionMailboxId:e.moveMailboxId??g}),_=new Set(["Complete","Failed"]),F=e=>e!==void 0&&_.has(e),J=1e3,$=15e3,U=e=>{const t=Math.max(0,e),r=J*2**t;return Math.min(r,$)},q=(e,t,r)=>{if(e)return{kind:r?"restartFailed":"startFailed",error:e};if(t)return{kind:"statusUnreadable",error:t}},re=e=>{const[t,r]=d.useState(),s=h({...x(),onSuccess:b=>r(b.organizeJobId)}),{mutate:i}=s,a=M({...P({path:{accountId:e??"",organizeJobId:t??""}}),enabled:!!e&&!!t,refetchInterval:b=>{const E=b.state.data?.state;return F(E)?!1:U(b.state.dataUpdateCount)}}),n=d.useCallback(b=>{e&&i({path:{accountId:e},body:D(b)})},[e,i]),o=d.useCallback(b=>{e&&i({path:{accountId:e},body:k(b)})},[e,i]),{refetch:l}=a,c=d.useCallback(()=>{l()},[l]),f=a.data,p=s.isPending?void 0:f,u=p?.state??s.data?.state,m=F(p?.state),S={state:u,matchedCount:p?.matchedCount??0,appliedCount:p?.appliedCount??0,failedCount:p?.failedCount??0,errorMessage:p?.errorMessage??""};return{start:n,startForFilter:o,watch:r,refreshStatus:c,progress:S,isStarting:s.isPending,isRunning:!!t&&!m,isDone:m,failure:q(s.error,a.error,!!f)}},se=["From","Subject","HasWords","ListId","FromDomain"],Q=e=>{const t=e.trim(),r=t.match(/<([^>]+)>/);return(r?r[1]:t).trim().toLowerCase()},ae=(e,t)=>e==="ListId"?Q(t):t.trim(),K=e=>e==="all"?"And":"Or",j=e=>({matchOperator:K(e.matchOperator),literalClauses:e.clauses.map(t=>({field:t.field,value:t.value}))}),H=e=>!e.literalClauses.some(t=>t.field==="HasWords"),B=e=>JSON.stringify({operator:e.matchOperator,clauses:e.literalClauses.map(t=>`${t.field} ${t.value}`)}),ie=e=>{const t=j(e);return{matchOperator:t.matchOperator,literalClauses:t.literalClauses,moveMailboxId:e.moveMailboxId,labelId:e.labelId,expiresAt:e.scope==="until"?A(e.until??""):void 0}},W=(e,t)=>e.error!==void 0&&e.errorSignature===t?{status:"error",reason:e.error}:e.count===void 0?{status:"loading"}:e.previewedSignature===t?{status:"ready",count:e.count}:{status:"ready",count:e.count,stale:!0},G=350,ne=(e,t,r)=>{const s=h(N()),{mutateAsync:i}=s,a=B(t),[n,o]=d.useState(()=>({})),l=d.useRef(t);l.current=t;const c=d.useRef(a),f=H(t);return d.useEffect(()=>{if(!e||!f||a===n.previewedSignature||a===n.errorSignature)return;const p=setTimeout(()=>{const u=a;c.current=u,i({path:{accountId:e},body:D({...l.current})}).then(m=>{c.current===u&&o({count:m.matchedCount,matchedIds:m.messageIds,previewedSignature:u})}).catch(m=>{c.current===u&&o(S=>({...S,error:m instanceof Error?m.message:"Couldn't count matches.",errorSignature:u}))})},G);return()=>clearTimeout(p)},[e,f,a,n.previewedSignature,n.errorSignature,i]),f?{count:W(n,a),matchedIds:n.previewedSignature===a?n.matchedIds??[]:[]}:{count:{status:"error",reason:L},matchedIds:[]}},C=e=>T({path:{accountId:e}}),oe=e=>{const t=M({...z({path:{accountId:e??""}}),enabled:!!e});return{filters:t.data?.items??[],isPending:t.isPending,isError:t.isError,error:t.error,refetch:t.refetch}},le=e=>{const t=v(),r=h({...I(),onSuccess:()=>{e&&t.invalidateQueries({queryKey:C(e)})}}),{mutate:s,mutateAsync:i}=r,a=d.useCallback((o,l,c)=>{e&&s({path:{accountId:e},body:y(o,l,c)})},[e,s]),n=d.useCallback(async(o,l,c)=>{if(e)return i({path:{accountId:e},body:y(o,l,c)}).then(f=>f,()=>{})},[e,i]);return{createFilter:a,createFilterAsync:n,data:r.data,isPending:r.isPending,isSuccess:r.isSuccess,isError:r.isError,error:r.error,reset:r.reset}},ue=e=>{const t=v(),r=h({...R(),onSuccess:()=>{e&&t.invalidateQueries({queryKey:C(e)})}}),{mutate:s}=r;return{deleteFilter:d.useCallback(a=>{e&&s({path:{accountId:e,filterId:a}})},[e,s]),isPending:r.isPending,deletingFilterId:r.isPending?r.variables?.path.filterId:void 0}},de=e=>{const t=v(),r=h({...w(),onSuccess:()=>{e&&t.invalidateQueries({queryKey:C(e)})}}),{mutate:s,variables:i}=r,a=d.useCallback((o,l)=>{e&&s({path:{accountId:e,filterId:o},body:{state:l?"Active":"Disabled"}})},[e,s]),n=d.useCallback(()=>{i&&s(i)},[s,i]);return{toggleFilter:a,retry:n,togglingFilterId:r.isPending?i?.path.filterId:void 0,isError:r.isError,error:r.error,enabling:i?.body?.state==="Active"}};export{g as N,se as S,re as a,C as b,ie as c,X as d,Z as e,Y as f,oe as g,ue as h,de as i,le as j,te as k,ae as n,ee as o,A as p,j as r,ne as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as L,
|
|
1
|
+
import{a as L,ff as p,f as n,g as l,fg as d,r as o,fh as y,fi as f,fj as g}from"./index-4XPoPWhu.js";const u=e=>y({path:{accountId:e}}),P=e=>{const r=L({...p({path:{accountId:e??""}}),enabled:!!e});return{labels:r.data?.items??[],isPending:r.isPending,isError:r.isError,error:r.error,refetch:r.refetch}},h=e=>{const r=n(),t=l({...d(),onSuccess:()=>{e&&r.invalidateQueries({queryKey:u(e)})}}),{mutateAsync:s}=t;return{createLabel:o.useCallback((a,i="Default")=>e?s({path:{accountId:e},body:{name:a,color:i}}):Promise.reject(new Error("No account")),[e,s]),isPending:t.isPending,isError:t.isError,error:t.error,reset:t.reset}},m=e=>{const r=n(),t=l({...f(),onSuccess:()=>{e&&r.invalidateQueries({queryKey:u(e)})}}),{mutate:s}=t;return{updateLabel:o.useCallback((a,i)=>{e&&s({path:{accountId:e,labelId:a},body:i})},[e,s]),isPending:t.isPending,updatingLabelId:t.isPending?t.variables?.path.labelId:void 0}},C=e=>{const r=n(),t=l({...g(),onSuccess:()=>{e&&r.invalidateQueries({queryKey:u(e)})}}),{mutate:s}=t;return{deleteLabel:o.useCallback(a=>{e&&s({path:{accountId:e,labelId:a}})},[e,s]),isPending:t.isPending,deletingLabelId:t.isPending?t.variables?.path.labelId:void 0}};export{P as a,m as b,C as c,h as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./index-4XPoPWhu.js";import{a as s,D as e}from"./useMediaQuery-a7SamL-l.js";const i=768,a=t=>t!=="desktop",p=()=>{const t=s(`(min-width: ${i}px)`);return s(e)?"desktop":t?"tablet":"phone"};export{a as i,p as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as s}from"./index-
|
|
1
|
+
import{r as s}from"./index-4XPoPWhu.js";const r=1024,c=`(min-width: ${r}px) and (not ((orientation: portrait) and (pointer: coarse)))`,d=e=>{const[o,n]=s.useState(()=>typeof window>"u"||!window.matchMedia?!1:window.matchMedia(e).matches);return s.useEffect(()=>{if(typeof window>"u"||!window.matchMedia)return;const t=window.matchMedia(e);n(t.matches);const a=i=>n(i.matches);return t.addEventListener("change",a),()=>t.removeEventListener("change",a)},[e]),o},m=()=>d(c);export{c as D,d as a,m as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as a,u as P,cQ as O,J as p,n as U,aa as B,f as N,a as $,dk as D,d9 as L}from"./index-4XPoPWhu.js";import{g as F,j as _,k as v}from"./reply-FoVQqDdv.js";const E="/mail/brief/compose/{-$outboxMessageId}",w="/mail/flagged/compose/{-$outboxMessageId}",S="/mail/outbox/compose/{-$outboxMessageId}",R="/mail/$mailboxId/compose/{-$outboxMessageId}";function k(){const e=p({from:E,shouldThrow:!1}),t=p({from:w,shouldThrow:!1}),s=p({from:S,shouldThrow:!1}),r=p({from:R,shouldThrow:!1});return e??t??s??r}function te(){return k()!==void 0}function se(){return k()?.outboxMessageId}function Q(e,t,s){return e==="flagged"?{to:w,params:{outboxMessageId:s}}:e==="outbox"?{to:S,params:{outboxMessageId:s}}:e==="mailbox"&&t?{to:R,params:{mailboxId:t,outboxMessageId:s}}:{to:E,params:{outboxMessageId:s}}}function b(){const e=P(),t=F(),{list:s,mailboxId:r}=_();return a.useCallback((o,n)=>{e({...Q(s,r,o),search:O,hash:n?.keepPanels?!0:t,replace:n?.replace??!1})},[e,t,s,r])}function re(){const e=b();return a.useCallback(()=>e(void 0),[e])}function oe(){const e=b();return a.useCallback(t=>e(t),[e])}function ne(){const e=b();return a.useCallback(t=>e(t,{replace:!0,keepPanels:!0}),[e])}function ae(){return v()}const K=new Set(["rfc822","global"]),q=e=>e.mediaType.toUpperCase()==="MESSAGE"&&K.has(e.mediaSubtype.toLowerCase()),T=(e,t)=>e.partPath.startsWith(`${t}.`),I=e=>{const t=e.filter(q);return e.filter(s=>!t.some(r=>T(s,r.partPath)))},ce=(e,t)=>e.filter(s=>T(s,t)),G=e=>{const t=I(e).filter(o=>!o.isMultipart&&o.disposition!=="attachment"&&o.mediaType==="TEXT"&&o.contentUrl.length>0),s=t.find(o=>o.mediaSubtype.toUpperCase()==="HTML");if(s)return{kind:"html",contentUrl:s.contentUrl};const r=t.find(o=>o.mediaSubtype.toUpperCase()==="PLAIN");return r?{kind:"text",contentUrl:r.contentUrl}:null},g={all:["messages"],detail:e=>[...g.all,"detail",e],body:e=>[...g.detail(e),"body"]};class f extends Error{reason;status;retryAfterSeconds;constructor(t,s,r,o){super(s),this.name="BodyFetchError",this.reason=t,this.status=r,this.retryAfterSeconds=o}}const W=e=>{const t=Number.parseInt(e??"",10);return!Number.isFinite(t)||t<=0?1:Math.min(t,30)},X=8,H="x-remit-403-reason",Y=(e,t)=>{const s=t?.trim()??"";return e===401?"auth":e===403?s.length>0?"auth":"body-missing":e===404?"body-missing":"generic"},j=(e,t)=>(t??"").toLowerCase().startsWith("text/html")?/<div\s+id=["']root["']/i.test(e):!1,z=(e,t)=>{const s=(t??"").toLowerCase();return!!(e==="text"&&s.startsWith("text/html"))},J=async(e,t,s=async()=>null)=>{const r={},o=await s();o&&(r.Authorization=`Bearer ${o}`);const n=await L(e,{headers:r});if(n.status===202)throw new f("not-ready","Message body is still syncing",202,W(n.headers.get("Retry-After")));if(!n.ok){const l=n.headers.get(H),h=Y(n.status,l);throw new f(h,`Failed to load message body (${n.status} ${n.statusText})`,n.status)}const c=n.headers.get("content-type");if(z(t,c))throw new f("content-type-mismatch",`Refusing to render message body — expected ${t}, got Content-Type ${c}`);const m=await n.text();if(j(m,c))throw new f("spa-shell-leak","Refusing to render message body — response looks like the SPA shell (CloudFront 403/404 fallback leaked through to /content/*)");return m},V=async(e,t)=>(t.isRetryAfterNotReady&&await e.refetchDescribeMessage(),e.fetchContent(t.contentUrl,t.kind)),ie=({messageId:e,bodyParts:t,enabled:s=!0})=>{const r=t?G(t):null,o=U(),{getToken:n}=B(),c=a.useRef(null),m=N(),l=a.useRef(!1),h=a.useRef(null),C=e&&r?`${e}:${r.contentUrl}`:null;h.current!==C&&(h.current=C,l.current=!1);const i=$({queryKey:e?[...g.body(e),r?.contentUrl??null]:["messages","body","noop"],queryFn:()=>{if(!r)throw new Error("No renderable body part");if(!e)throw new Error("No messageId");const d=l.current;return l.current=!1,V({fetchContent:(u,x)=>J(u,x,n),refetchDescribeMessage:()=>m.refetchQueries({queryKey:D({path:{messageId:e}})})},{contentUrl:r.contentUrl,kind:r.kind,isRetryAfterNotReady:d})},enabled:s&&!!e&&!!r,staleTime:300*1e3,gcTime:1800*1e3,retry:(d,u)=>u instanceof f&&u.reason==="not-ready"?d<X:d<1,retryDelay:(d,u)=>u instanceof f&&u.reason==="not-ready"?(l.current=!0,(u.retryAfterSeconds??1)*1e3):1e3,meta:{softError:!0}}),y=i.isLoading&&!!r,A=t!==void 0&&r===null;a.useEffect(()=>{y&&(c.current=performance.now())},[y]),a.useEffect(()=>{i.isSuccess&&c.current!==null&&(o.recordTiming("message.body.load",Math.round(performance.now()-c.current)),c.current=null)},[i.isSuccess,o]);const M=i.data&&r?{kind:r.kind,body:i.data}:void 0;return{picked:r,data:M,isLoading:y,hasNoRenderablePart:A,isError:i.isError,error:i.error,refetch:i.refetch}};export{f as B,te as a,ie as b,Y as c,se as d,ne as e,ae as f,oe as g,ce as h,q as i,I as o,re as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{dl as Q,dm as y,dn as w,dp as S,dq as C,f as k,dr as q,ds as x,r as p,dt as M,du as H,dv as L,dw as P,dx as O,dy as B,dz as z}from"./index-4XPoPWhu.js";function R(r,s){const e=new Set(s);return r.filter(t=>!e.has(t))}function A(r,s,e){const t=r.slice(0);return t[s]=e,t}var T=class extends Q{#i;#s;#n;#r;#e;#t;#o;#u;#h;#a=[];constructor(r,s,e){super(),this.#i=r,this.#r=e,this.#n=[],this.#e=[],this.#s=[],this.setQueries(s)}onSubscribe(){this.listeners.size===1&&this.#e.forEach(r=>{r.subscribe(s=>{this.#f(r,s)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,this.#e.forEach(r=>{r.destroy()})}setQueries(r,s){this.#n=r,this.#r=s,y.batch(()=>{const e=this.#e,t=this.#d(this.#n);t.forEach(o=>o.observer.setOptions(o.defaultedQueryOptions));const i=t.map(o=>o.observer),n=i.map(o=>o.getCurrentResult()),u=e.length!==i.length,c=i.some((o,f)=>o!==e[f]),d=u||c,b=d?!0:n.some((o,f)=>{const g=this.#s[f];return!g||!w(o,g)});!d&&!b||(d&&(this.#a=t,this.#e=i),this.#s=n,this.hasListeners()&&(d&&(R(e,i).forEach(o=>{o.destroy()}),R(i,e).forEach(o=>{o.subscribe(f=>{this.#f(o,f)})})),this.#p()))})}getCurrentResult(){return this.#s}getQueries(){return this.#e.map(r=>r.getCurrentQuery())}getObservers(){return this.#e}getOptimisticResult(r,s){const e=this.#d(r),t=e.map(n=>n.observer.getOptimisticResult(n.defaultedQueryOptions)),i=e.map(n=>n.defaultedQueryOptions.queryHash);return[t,n=>this.#l(n??t,s,i),()=>this.#c(t,e)]}#c(r,s){return s.map((e,t)=>{const i=r[t];return e.defaultedQueryOptions.notifyOnChangeProps?i:e.observer.trackResult(i,n=>{s.forEach(u=>{u.observer.trackProp(n)})})})}#l(r,s,e){if(s){const t=this.#h,i=e!==void 0&&t!==void 0&&(t.length!==e.length||e.some((n,u)=>n!==t[u]));return(!this.#t||this.#s!==this.#u||i||s!==this.#o)&&(this.#o=s,this.#u=this.#s,e!==void 0&&(this.#h=e),this.#t=S(this.#t,s(r))),this.#t}return r}#b(){return this.#r?.combine!==void 0&&this.#e.some((r,s)=>r.options.suspense&&this.#s[s]?.data===void 0)}#d(r){const s=new Map;this.#e.forEach(t=>{const i=t.options.queryHash;if(!i)return;const n=s.get(i);n?n.push(t):s.set(i,[t])});const e=[];return r.forEach(t=>{const i=this.#i.defaultQueryOptions(t),u=s.get(i.queryHash)?.shift()??new C(this.#i,i);e.push({defaultedQueryOptions:i,observer:u})}),e}#f(r,s){const e=this.#e.indexOf(r);e!==-1&&(this.#s=A(this.#s,e,s),this.#p())}#p(){if(this.hasListeners()){const r=this.#c(this.#s,this.#a),s=this.#b(),e=this.#t,t=s?e:this.#l(r,this.#r?.combine);(s||e!==t)&&y.batch(()=>{this.listeners.forEach(i=>{i(this.#s)})})}}};function U({queries:r,...s},e){const t=k(),i=q(),n=x(),u=p.useMemo(()=>r.map(h=>{const a=t.defaultQueryOptions(h);return a._optimisticResults=i?"isRestoring":"optimistic",a}),[r,t,i]);u.forEach(h=>{M(h);const a=t.getQueryCache().get(h.queryHash);H(h,n,a)}),L(n);const[c]=p.useState(()=>new T(t,u,s)),[d,b,o]=c.getOptimisticResult(u,s.combine),f=!i&&s.subscribed!==!1;p.useSyncExternalStore(p.useCallback(h=>f?c.subscribe(y.batchCalls(h)):P,[c,f]),()=>c.getCurrentResult(),()=>c.getCurrentResult()),p.useEffect(()=>{c.setQueries(u,s)},[u,s,c]);const m=d.some((h,a)=>O(u[a],h))?d.flatMap((h,a)=>{const l=u[a];if(l&&O(l,h)){const E=new C(t,l);return B(l,E,n)}return[]}):[];if(m.length>0)throw Promise.all(m);const v=d.find((h,a)=>{const l=u[a];return l&&z({result:h,errorResetBoundary:n,throwOnError:l.throwOnError,query:t.getQueryCache().get(l.queryHash),suspense:l.suspense})});if(v?.error)throw v.error;return b(o())}export{U as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as E,w as K,
|
|
1
|
+
import{j as E,w as K,q as Q,B as U,f as T,N as B,r as o,aP as R,R as $,U as z,n as G,a2 as I,a3 as X,a6 as V}from"./index-4XPoPWhu.js";import{C as J}from"./circle-check-big-BrmrabN6.js";import{R as Y}from"./refresh-cw-BERt5E10.js";import{u as P}from"./useQueries-XPiXhlQX.js";function ye({state:e,onRefresh:s,label:t,errorMessage:r,hasUpdate:a,size:u="sm",className:c}){const i=e==="refreshing",n=e==="error",h=e==="success",y=n?E.jsx(K,{className:"size-4 text-danger"}):h?E.jsx(J,{className:"size-4 text-positive"}):E.jsx(Y,{className:Q("size-4",i&&"animate-spin")}),w=n?`${t} — failed: ${r??"try again"}`:i?`${t} — refreshing`:h?`${t} — up to date`:a?`${t} — new mail`:t;return E.jsxs("div",{className:"relative inline-flex",children:[E.jsx(U,{variant:"ghost",size:u,icon:y,onClick:s,disabled:i,"aria-label":w,"aria-busy":i||void 0,title:n?r:t,className:c}),e==="idle"&&a&&E.jsx("span",{"aria-hidden":"true",className:"absolute right-1 top-1 size-1.5 rounded-full bg-accent-2"})]})}const Z=180*1e3,Se=30*1e3;let L=0;const M=new Set,ee=(e=Date.now())=>{L=e+Z;for(const s of M)s()},we=(e=Date.now())=>e<L,xe=e=>(M.add(e),()=>{M.delete(e)}),_=6e4,te=new Set(["sent","drafts","trash","archive"]),C=(e,s)=>{const t=new Map;for(const r of e){const a=s.get(r.mailboxId)?.role;a&&te.has(a)||t.set(r.mailboxId,r.highWaterMarkUid)}return t},q=(e,s)=>{const t=[];for(const[r,a]of s)a>(e.get(r)??0)&&t.push(r);return t},se=(e,s)=>q(e,s).length>0,F=o.createContext(null),ne=()=>{const e=o.useContext(F);if(!e)throw new Error("useMailFreshness must be used inside <MailFreshnessProvider>");return e};function pe({accountIds:e,children:s}){const t=T(),{resultFolderIndex:r}=B(),a=o.useRef(new Map),u=o.useRef(new Set),c=o.useRef(new Map),[i,n]=o.useState(new Set),h=P({queries:e.map(l=>({...R({path:{accountId:l}}),refetchInterval:_,staleTime:_,meta:{softError:!0}}))}),y=h.map(l=>l.dataUpdatedAt).join(","),w=e.join(",");o.useEffect(()=>{let l=!1;const f=new Set(i);e.forEach((d,p)=>{const b=h[p]?.data;if(!b)return;const g=C(b.mailboxes??[],r),v=c.current.get(d);if(c.current.set(d,g),v){const A=q(v,g);A.length>0&&$(t,z(A))}if(!u.current.has(d)){u.current.add(d),a.current.set(d,g);return}if(f.has(d))return;const W=a.current.get(d)??new Map;se(W,g)&&(f.add(d),l=!0)}),l&&n(f)},[w,y]);const S=o.useCallback(l=>l.some(f=>i.has(f)),[i]),x=o.useCallback(l=>{n(f=>{if(l.every(p=>!f.has(p)))return f;const d=new Set(f);for(const p of l)d.delete(p);return d});for(const f of l){const d=t.getQueryData(R({path:{accountId:f}}).queryKey);a.current.set(f,C(d?.mailboxes??[],r)),u.current.add(f)}},[t,r]),m=o.useMemo(()=>({hasNewMail:S,acknowledge:x}),[S,x]);return E.jsx(F.Provider,{value:m,children:s})}const re=new Set(["discovering_mailboxes","syncing_inbox","syncing_others"]);function j(e){return!!e&&re.has(e)}const D=3e3,oe=D*2,N={syncing:!1,resolved:!1,synced:0,total:0};function Ee(e,s){const t=e.join(","),[r,a]=o.useState(!1),[u,c]=o.useState(!1);o.useEffect(()=>{a(!1),c(!1)},[t,s]),o.useEffect(()=>{if(!s)return;const m=setTimeout(()=>c(!0),oe);return()=>clearTimeout(m)},[t,s]);const i=P({queries:e.map(m=>({...R({path:{accountId:m}}),enabled:s&&!r,refetchInterval:D,meta:{softError:!0}}))}),n=i.every(m=>m.isSuccess||m.isError),h=i.length===0||n||u;let y=!1,w=0,S=0;for(const m of i)if(j(m.data?.syncPhase)){y=!0;for(const l of m.data?.mailboxes??[])w+=l.messagesSynced,S+=l.messagesTotal}const x=s&&h&&!y;return o.useEffect(()=>{x&&a(!0)},[x]),!s||!h?N:{syncing:y,resolved:!0,synced:w,total:S}}const ae=2e3,ie=45e3,ce=e=>new Promise(s=>setTimeout(s,e)),k=e=>e instanceof Error&&e.message?e.message:"Something went wrong",ue=e=>{V(e,{softError:!0})},O=(e,s)=>e.fetchQuery({...R({path:{accountId:s}}),staleTime:0}),H=e=>e.mailboxes?.find(s=>s.fullPath?.toUpperCase()==="INBOX")?.lastSyncedAt??0,le=async({accountId:e,readStatus:s,baselineLastSyncAt:t,baselineInboxSyncedAt:r=0,onInboxSynced:a,deadline:u,pollMs:c=ae})=>{let i=!1;for(;;){const n=await s().then(S=>({ok:!0,data:S})).catch(S=>({ok:!1,error:S}));if(!n.ok)return{accountId:e,message:k(n.error)};const{syncPhase:h,lastSyncAt:y}=n.data;if((y??0)>t&&!j(h))return h==="error"?{accountId:e,message:"Sync failed for this account"}:void 0;if(!i&&H(n.data)>r&&(i=!0,a?.()),Date.now()>=u)return{accountId:e,message:"Refresh is taking longer than usual"};await ce(c)}},fe=async(e,s,t,r,a)=>{const u=await O(e,t).then(n=>({ok:!0,lastSyncAt:n.lastSyncAt??0,inboxSyncedAt:H(n)})).catch(n=>({ok:!1,error:n}));if(!u.ok)return{accountId:t,enqueued:!1,ok:!1,message:k(u.error)};const c=await I({path:{accountId:t},throwOnError:!0}).then(()=>({ok:!0})).catch(n=>({ok:!1,error:n}));if(!c.ok)return ue(c.error),{accountId:t,enqueued:!1,ok:!1,message:k(c.error)};s.recordEvent("sync.triggered");const i=await le({accountId:t,readStatus:()=>O(e,t),baselineLastSyncAt:u.lastSyncAt,baselineInboxSyncedAt:u.inboxSyncedAt,onInboxSynced:()=>a(t),deadline:r});return i?{accountId:t,enqueued:!0,ok:!1,message:i.message}:{accountId:t,enqueued:!0,ok:!0}},be=(e,s={})=>{const t=T(),r=G(),{acknowledge:a}=ne(),[u,c]=o.useState("idle"),[i,n]=o.useState(),h=o.useRef(0),y=o.useRef(e);y.current=e;const w=o.useRef(s);w.current=s,o.useEffect(()=>{if(u!=="success")return;const x=setTimeout(()=>c("idle"),2e3);return()=>clearTimeout(x)},[u]);const S=o.useCallback(()=>{const x=y.current;if(x.length===0){c("error"),n("Nothing to refresh yet");return}const m=++h.current;c("refreshing"),n(void 0),ee();const l=f=>{h.current===m&&(t.invalidateQueries({queryKey:X({path:{accountId:f}})}),w.current.onSettled?.())};(async()=>{const f=Date.now()+ie,d=await Promise.all(x.map(g=>fe(t,r,g,f,l)));if(h.current!==m)return;const p=d.filter(g=>g.enqueued).map(g=>g.accountId);for(const g of p)l(g);p.length>0&&a(p);const b=d.filter(g=>!g.ok);b.length===0?c("success"):(c("error"),n(b[0]?.message))})()},[a,t,r]);return{state:u,errorMessage:i,refresh:S}};export{Se as H,pe as M,ye as R,be as a,j as b,Ee as c,we as i,xe as s,ne as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as s,
|
|
1
|
+
import{b as s,W as o,r as n,c3 as r}from"./index-4XPoPWhu.js";import{u as d}from"./useQueries-XPiXhlQX.js";const h=s("Bug",[["path",{d:"m8 2 1.88 1.88",key:"fmnt4t"}],["path",{d:"M14.12 3.88 16 2",key:"qol33r"}],["path",{d:"M9 7.13v-1a3.003 3.003 0 1 1 6 0v1",key:"d7y7pr"}],["path",{d:"M12 20c-3.3 0-6-2.7-6-6v-3a4 4 0 0 1 4-4h4a4 4 0 0 1 4 4v3c0 3.3-2.7 6-6 6",key:"xs1cw7"}],["path",{d:"M12 20v-9",key:"1qisl0"}],["path",{d:"M6.53 9C4.6 8.8 3 7.1 3 5",key:"32zzws"}],["path",{d:"M6 13H2",key:"82j7cp"}],["path",{d:"M3 21c0-2.1 1.7-3.9 3.8-4",key:"4p0ekp"}],["path",{d:"M20.97 5c0 2.1-1.6 3.8-3.5 4",key:"18gb23"}],["path",{d:"M22 13h-4",key:"1jl80f"}],["path",{d:"M17.2 17c2.1.1 3.8 1.9 3.8 4",key:"k3fwyw"}]]),p=t=>({items:t.map(e=>e.data?.items??[]),isPending:t.some(e=>e.isPending),error:t.find(e=>e.error)?.error??null});function u(t){const e=d({queries:t.map(i=>({...o({path:{accountId:i.accountId}}),staleTime:1/0})),combine:p});return{index:n.useMemo(()=>r(t.map((i,a)=>({folderAppointments:i.folderAppointments,mailboxes:e.items[a]??[]}))),[t,e]),isPending:e.isPending,error:e.error}}export{h as B,u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{f as g,
|
|
1
|
+
import{f as g,ap as p,a as f,c as m,r,g as y,ar as T,l as E,i as x}from"./index-4XPoPWhu.js";const i={html:"",plainText:""},d=e=>{const u=g(),{pushError:o}=p(),{data:n}=f({...m(),staleTime:1/0}),l=r.useMemo(()=>{if(!e||!n)return i;const t=n.accounts.find(a=>a.accountId===e);return t?{html:t.signatureHtml??"",plainText:t.signaturePlainText??""}:i},[e,n]),s=y({...x(),onSuccess:()=>{u.invalidateQueries({queryKey:E()})},onError:t=>{o(T("Couldn't save signature","The signature wasn't saved.",t))}}),c=r.useCallback((t,a)=>{e&&s.mutate({path:{accountId:e},body:{signatureHtml:t,signaturePlainText:a}})},[e,s]);return{signature:l,setSignature:c,isSaving:s.isPending}};export{d as u};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import{j as s,
|
|
1
|
+
import{j as s,aI as w,B as u,aS as C,e as j,bn as N,bl as y,d as E,ai as _,aa as $,bE as A,c0 as f,c1 as k,c2 as M,a as P,c as W,r as c,a4 as z,aD as x,aE as p,u as O,aK as L,aN as q}from"./index-4XPoPWhu.js";import{S as B}from"./settings-screen-ZYutaKzZ.js";import{f as D}from"./ErrorState-DcP5ZTMN.js";import{C as U}from"./copy-DjyWdtW5.js";import{E as F}from"./external-link-Dn2gWGrg.js";import{B as h,u as G}from"./useResultFolderIndex-koSvRw-H.js";import{C as S}from"./circle-check-Bifl6wEJ.js";import{w as H}from"./help-copy-CQIBCXJf.js";import"./avatar-B4KRzyzS.js";import"./menu-D06KWsdQ.js";import"./circle-help-Cyj92MDS.js";import"./useQueries-XPiXhlQX.js";import"./kbd-D0eWE7Kp.js";function Q({report:e,onClose:t,issueUrl:n,onCopy:a}){return e===null?null:s.jsx(w,{open:!0,onClose:t,title:"Report this message",children:s.jsxs("div",{className:"flex max-h-[80vh] flex-col",children:[s.jsxs("header",{className:"space-y-1 border-b border-line px-4 py-3",children:[s.jsx("h3",{className:"text-sm font-semibold text-fg",children:"Report this message"}),s.jsx("p",{className:"text-xs text-fg-muted",children:"This is everything the report contains. It describes what went wrong with the message — never its contents, addresses, subject, attachment names, folder name, or the parser's own error text."})]}),s.jsx("pre",{className:"flex-1 overflow-auto bg-surface-sunken px-4 py-3 text-2xs leading-relaxed whitespace-pre-wrap text-fg-muted",children:e}),s.jsxs("footer",{className:"flex flex-wrap items-center justify-end gap-2 border-t border-line px-4 py-3",children:[s.jsx(u,{variant:"ghost",size:"sm",onClick:t,children:"Cancel"}),s.jsx(u,{variant:"secondary",size:"sm",icon:s.jsx(U,{className:"size-3.5"}),onClick:()=>a(e),children:"Copy report"}),s.jsx(C,{external:!0,size:"sm",href:n,icon:s.jsx(F,{className:"size-3.5"}),children:"Open on GitHub"})]})]})})}const V={BodyParse:"The message is built in a way Remit could not read."};function Y(e){return V[e]}function R(e){return e.split(";")[0].trim()}const b=/^[A-Za-z0-9!#$%&'*+._-]+$/,v=/^[A-Za-z0-9!#$%&'*+._-]+\/[A-Za-z0-9!#$%&'*+._-]+$/;function m(e,t){return t.test(e)?`\`${e}\``:`\`${JSON.stringify(e).replace(/`/g,"\\u0060")}\` (malformed)`}function Z(e){const t=R(e);return v.test(t)?t:JSON.stringify(t)}const g="_not read_";function J(e){return e.length===0?["(no MIME structure was read)"]:e.map(t=>`${" ".repeat(t.depth)}- ${Z(t.contentType)}`)}const K="_No message content, addresses, subject, attachment names or parser output are included._";function I(e){return{head:[`### Message quarantined at \`${e.failureStage}\``,"",`- **Failure**: \`${e.failureCode}\``,`- **Folder role**: ${e.mailboxRole??"_none appointed_"}`,`- **Failing part**: ${e.failurePartPath==null?"_whole message_":`\`${e.failurePartPath}\``}`,`- **Attempts before quarantine**: ${e.attempts}`,`- **Worker build**: ${e.workerVersion}`,`- **Message-ID hash**: ${e.messageIdHash==null?"_none declared_":`\`${e.messageIdHash}\``}`,"","#### Message shape","",`- **Content-Type**: ${e.contentType==null?g:m(R(e.contentType),v)}`,`- **Content-Transfer-Encoding**: ${e.transferEncoding==null?g:m(e.transferEncoding,b)}`,`- **Charset**: ${e.charset==null?"_not declared_":m(e.charset,b)}`,`- **Size**: ${e.sizeBytes==null?g:`${e.sizeBytes} bytes`}`,"","MIME structure:"].join(`
|
|
2
2
|
`),structure:J(e.structure).join(`
|
|
3
|
-
`),disclaimer:K}}function X(e){const{head:t,structure:n,disclaimer:a}=
|
|
4
|
-
`)}function ee(e){return`Message quarantined: ${e.failureCode} at ${e.failureStage}`}function se(e){return new Date(e).toLocaleString(void 0,{dateStyle:"medium",timeStyle:"short"})}function te({entry:e,onCutBug:t}){return s.jsxs("li",{className:"flex flex-col gap-2 border-b border-line px-row-inset py-3 last:border-b-0 sm:flex-row sm:items-start sm:justify-between",children:[s.jsxs("div",{className:"min-w-0 space-y-1",children:[s.jsx("p",{className:"text-sm text-fg",children:Y(e.failureStage)}),s.jsx("p",{className:"truncate text-xs text-fg-muted",title:e.failureMessage,children:e.failureMessage}),s.jsxs("p",{className:"flex flex-wrap items-center gap-x-2 gap-y-1 text-2xs text-fg-subtle",children:[e.mailboxRole&&s.jsx(j,{tone:"warning",children:N(e.mailboxRole)}),s.jsx("span",{className:"truncate",title:e.mailboxPath,children:y(e.mailboxPath,e.mailboxDelimiter)}),s.jsx("span",{"aria-hidden":!0,children:"·"}),s.jsx("span",{children:`uid ${e.uid}`}),s.jsx("span",{"aria-hidden":!0,children:"·"}),s.jsx("span",{children:se(e.quarantinedAt)}),e.attempts>1&&s.jsxs(s.Fragment,{children:[s.jsx("span",{"aria-hidden":!0,children:"·"}),s.jsx("span",{children:`${e.attempts} attempts`})]})]})]}),s.jsx(
|
|
5
|
-
`)}function le(e){return`Message failed to sync: ${e.state} at ${e.stage}`}function ce(e){return new Date(e).toLocaleString(void 0,{dateStyle:"medium",timeStyle:"short"})}function de({entry:e,onReport:t}){const n=e.state==="GaveUp";return s.jsxs("li",{className:"flex flex-col gap-2 border-b border-line px-row-inset py-3 last:border-b-0 sm:flex-row sm:items-start sm:justify-between",children:[s.jsxs("div",{className:"min-w-0 space-y-1",children:[s.jsx("p",{className:"text-sm text-fg",children:
|
|
3
|
+
`),disclaimer:K}}function X(e){const{head:t,structure:n,disclaimer:a}=I(e);return[t,"","```",n,"```","",a].join(`
|
|
4
|
+
`)}function ee(e){return`Message quarantined: ${e.failureCode} at ${e.failureStage}`}function se(e){return new Date(e).toLocaleString(void 0,{dateStyle:"medium",timeStyle:"short"})}function te({entry:e,onCutBug:t}){return s.jsxs("li",{className:"flex flex-col gap-2 border-b border-line px-row-inset py-3 last:border-b-0 sm:flex-row sm:items-start sm:justify-between",children:[s.jsxs("div",{className:"min-w-0 space-y-1",children:[s.jsx("p",{className:"text-sm text-fg",children:Y(e.failureStage)}),s.jsx("p",{className:"truncate text-xs text-fg-muted",title:e.failureMessage,children:e.failureMessage}),s.jsxs("p",{className:"flex flex-wrap items-center gap-x-2 gap-y-1 text-2xs text-fg-subtle",children:[e.mailboxRole&&s.jsx(j,{tone:"warning",children:N(e.mailboxRole)}),s.jsx("span",{className:"truncate",title:e.mailboxPath,children:y(e.mailboxPath,e.mailboxDelimiter)}),s.jsx("span",{"aria-hidden":!0,children:"·"}),s.jsx("span",{children:`uid ${e.uid}`}),s.jsx("span",{"aria-hidden":!0,children:"·"}),s.jsx("span",{children:se(e.quarantinedAt)}),e.attempts>1&&s.jsxs(s.Fragment,{children:[s.jsx("span",{"aria-hidden":!0,children:"·"}),s.jsx("span",{children:`${e.attempts} attempts`})]})]})]}),s.jsx(u,{variant:"secondary",size:"sm",className:"shrink-0",icon:s.jsx(h,{className:"size-3.5"}),onClick:()=>t(e),children:"Cut a bug"})]})}function ne({entries:e,onCutBug:t}){return s.jsxs("section",{className:"space-y-3",children:[s.jsxs("header",{className:"space-y-1",children:[s.jsx("h2",{className:"text-sm font-semibold text-fg",children:"Messages set aside"}),s.jsx("p",{className:"text-xs text-fg-muted",children:"Mail Remit could not read is set aside here instead of being skipped, so nothing goes missing quietly. The rest of the folder keeps syncing. Recovering a set-aside message is a re-sync, not a per-row action."})]}),e.length===0&&s.jsxs("div",{className:"flex items-center gap-2 rounded-sm border border-line bg-surface px-row-inset py-3",children:[s.jsx(S,{className:"size-4 shrink-0 text-positive","aria-hidden":!0}),s.jsx("p",{className:"text-sm text-fg-muted",children:"Every message has been read successfully. Nothing is set aside."})]}),e.length>1&&s.jsx(E,{tone:"warning",children:s.jsxs("p",{className:"flex items-start gap-2",children:[s.jsx(_,{className:"mt-0.5 size-4 shrink-0","aria-hidden":!0}),s.jsxs("span",{children:[s.jsx("span",{className:"font-semibold",children:`${e.length} messages could not be read.`})," ","More than one means something is wrong with how Remit reads mail, not with the mail. Reporting one of these gets it fixed."]})]})}),e.length>0&&s.jsx("ul",{className:"rounded-sm border border-line bg-surface",children:e.map(n=>s.jsx(te,{entry:n,onCutBug:t},n.quarantineId))})]})}const ae={Retrying:"The message could not be synced. Remit tries again every sync.",GaveUp:"The message body could not be downloaded. Remit has stopped trying."};function ie(e){return ae[e.state]}const re="_No message content, addresses, subject, folder name or error text are included._";function oe(e){return[`### Message failed to sync at \`${e.stage}\``,"",`- **State**: \`${e.state}\``,`- **Attempts**: ${e.attempts}`,"",re].join(`
|
|
5
|
+
`)}function le(e){return`Message failed to sync: ${e.state} at ${e.stage}`}function ce(e){return new Date(e).toLocaleString(void 0,{dateStyle:"medium",timeStyle:"short"})}function de({entry:e,onReport:t}){const n=e.state==="GaveUp";return s.jsxs("li",{className:"flex flex-col gap-2 border-b border-line px-row-inset py-3 last:border-b-0 sm:flex-row sm:items-start sm:justify-between",children:[s.jsxs("div",{className:"min-w-0 space-y-1",children:[s.jsx("p",{className:"text-sm text-fg",children:ie(e)}),s.jsxs("p",{className:"flex flex-wrap items-center gap-x-2 gap-y-1 text-2xs text-fg-subtle",children:[s.jsx(j,{tone:n?"danger":"warning",children:n?"Gave up":"Retrying"}),s.jsx("span",{className:"truncate",children:e.folderLabel}),s.jsx("span",{"aria-hidden":!0,children:"·"}),s.jsx("span",{children:`uid ${e.uid}`}),s.jsx("span",{"aria-hidden":!0,children:"·"}),s.jsx("span",{children:`since ${ce(e.createdAt)}`}),s.jsx("span",{"aria-hidden":!0,children:"·"}),s.jsx("span",{children:`${e.attempts} attempts`})]})]}),s.jsx(u,{variant:"secondary",size:"sm",className:"shrink-0",icon:s.jsx(h,{className:"size-3.5"}),onClick:()=>t(e),children:"Cut a bug"})]})}function ue({entries:e,total:t,onReport:n}){return s.jsxs("section",{className:"space-y-3",children:[s.jsxs("header",{className:"space-y-1",children:[s.jsx("h2",{className:"text-sm font-semibold text-fg",children:"Messages that failed to sync"}),s.jsx("p",{className:"text-xs text-fg-muted",children:"A message shows here after three failed rounds and leaves on its own once it syncs. The rest of the folder keeps syncing."})]}),e.length===0&&s.jsxs("div",{className:"flex items-center gap-2 rounded-sm border border-line bg-surface px-row-inset py-3",children:[s.jsx(S,{className:"size-4 shrink-0 text-positive","aria-hidden":!0}),s.jsx("p",{className:"text-sm text-fg-muted",children:"Every message is syncing. Nothing has failed."})]}),t>e.length&&s.jsx("p",{className:"text-xs text-fg-muted",children:`Showing the ${e.length} newest of ${t} messages that failed to sync.`}),e.length>0&&s.jsx("ul",{className:"rounded-sm border border-line bg-surface",children:e.map(a=>s.jsx(de,{entry:a,onReport:n},a.syncWarningId))})]})}function me(){const{Account:e}=$();return s.jsx(e,{children:({signOut:t})=>s.jsx("button",{type:"button",onClick:()=>t(),className:"rounded-md border border-line px-2.5 py-1 text-sm font-medium text-fg outline-none hover:bg-surface-sunken focus-visible:ring-2 focus-visible:ring-ring",children:"Sign in again"})})}function ge(e,t){return{quarantineId:e.quarantineId,accountId:e.accountId,mailboxId:e.mailboxId,uidValidity:e.uidValidity,uid:e.uid,mailboxRole:e.mailboxRole?A[e.mailboxRole]:void 0,mailboxPath:e.mailboxPath,mailboxDelimiter:t,failureStage:e.failureStage,failureCode:e.failureCode,failureMessage:e.failureMessage,failurePartPath:e.failurePartPath,quarantinedAt:e.quarantinedAt,attempts:e.attempts,sizeBytes:e.sizeBytes,contentType:e.contentType,transferEncoding:e.transferEncoding,charset:e.charset,structure:e.structure,messageIdHash:e.messageIdHash,workerVersion:e.workerVersion}}const xe=3,pe=(e,t)=>e===k.Body&&t>=xe?f.GaveUp:f.Retrying,he="A folder no longer listed";function fe(e){return e?.role?N(e.role):e?.providerPath?y(e.providerPath,e.hierarchyDelimiter):he}function be(e,t){return{syncWarningId:e.syncWarningId,uid:e.uid,stage:e.stage,state:pe(e.stage,e.attempts),attempts:e.attempts,createdAt:e.createdAt,folderLabel:fe(t)}}const je=[],Ne=[];function ye(e){window.open(e,"_blank","noopener,noreferrer")}function Se(e){return{report:X(e),issueUrl:x(p({quarantine:I(e),title:ee(e)}))}}function Re(e){const t=oe(e);return{report:t,issueUrl:x(p({syncWarning:t,title:le(e)}))}}function ve({signIn:e}){return s.jsx("section",{role:"alert",className:"space-y-3",children:s.jsxs("div",{className:"space-y-2 rounded-sm border border-danger/40 bg-danger-soft px-row-inset py-3",children:[s.jsx("p",{className:"text-sm font-medium text-danger",children:"Your session has ended."}),s.jsx("p",{className:"text-sm text-fg-muted",children:"Sign in again to see the messages that failed to sync or were set aside."}),e]})})}function Ie({error:e}){return s.jsx("section",{role:"alert",className:"space-y-3",children:s.jsxs("div",{className:"space-y-2 rounded-sm border border-danger/40 bg-danger-soft px-row-inset py-3",children:[s.jsx("p",{className:"text-sm font-medium text-danger",children:"The warnings could not be read."}),s.jsx("p",{className:"break-words text-sm text-fg-muted",children:D(e)}),s.jsx("p",{className:"text-xs text-fg-muted",children:"Mail may still be failing to sync or have been set aside — this page cannot say either way until it can read the list. Reporting this gets it fixed."}),s.jsx(u,{variant:"secondary",size:"sm",icon:s.jsx(h,{className:"size-3.5"}),onClick:()=>ye(x(p())),children:"Report this"})]})})}function Te({read:e,signIn:t}){const[n,a]=c.useState(null),[o,i]=c.useState(!1);if(e.kind==="Pending")return s.jsx("p",{className:"animate-pulse text-sm text-fg-subtle",children:"Checking for warnings…"});if(e.kind==="SignedOut")return s.jsx(ve,{signIn:t});if(e.kind==="Failed")return s.jsx(Ie,{error:e.error});const l=r=>{navigator.clipboard.writeText(r).then(()=>{i(!1),a(null)},()=>{i(!0),a(null)})};return s.jsxs("div",{className:"space-y-6",children:[o&&s.jsx("p",{role:"alert",className:"text-sm text-danger",children:"The report was not copied — this browser refused clipboard access. Cut the bug again and use Open on GitHub, which needs no clipboard."}),s.jsx(ue,{entries:e.warnings,total:e.warningsTotal,onReport:r=>a(Re(r))}),s.jsx(ne,{entries:e.quarantine,onCutBug:r=>a(Se(r))}),s.jsx(Q,{report:n?.report??null,issueUrl:n?.issueUrl??"",onClose:()=>a(null),onCopy:l})]})}function we(e,t){return e.get(t)?.hierarchyDelimiter??""}function Ce(){const e=M(),t=P(W()),n=c.useMemo(()=>t.data?.accounts??[],[t.data]),a=G(n),o=e.data?.entries??je,i=e.data?.warnings??Ne,l=c.useMemo(()=>o.map(d=>ge(d,we(a.index,d.mailboxId))),[o,a.index]),r=c.useMemo(()=>i.map(d=>be(d,a.index.get(d.mailboxId))),[i,a.index]),T=Ee(e.error??t.error??a.error,e.isPending||t.isPending||a.isPending,{kind:"Ready",quarantine:l,warnings:r,warningsTotal:e.data?.warningsTotal??0});return s.jsx(Te,{read:T,signIn:s.jsx(me,{})})}function Ee(e,t,n){return z(e)?{kind:"SignedOut"}:e?{kind:"Failed",error:e}:t?{kind:"Pending"}:n}function Ue(){const e=O(),t=L(),[n,a]=c.useState(!0),o=i=>{const l=q[i];l&&e({to:l})};return s.jsx(B,{items:t,activeId:"warnings",title:"Warnings",description:"Messages that failed to sync, and messages set aside.",help:H,helpOpen:n,onToggleHelp:()=>a(i=>!i),onSelect:o,onBackToMail:()=>{e({to:"/mail"})},children:s.jsx(Ce,{})})}export{Ue as component};
|
package/index.html
CHANGED
|
@@ -35,8 +35,8 @@
|
|
|
35
35
|
} catch (_) {}
|
|
36
36
|
})();
|
|
37
37
|
</script>
|
|
38
|
-
<script type="module" crossorigin src="/assets/index-
|
|
39
|
-
<link rel="stylesheet" crossorigin href="/assets/index-
|
|
38
|
+
<script type="module" crossorigin src="/assets/index-4XPoPWhu.js"></script>
|
|
39
|
+
<link rel="stylesheet" crossorigin href="/assets/index-CNLnhDIy.css">
|
|
40
40
|
</head>
|
|
41
41
|
<body>
|
|
42
42
|
<div id="root"></div>
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as t,o as u,r as c,C as m,aa as p,u as d,K as h}from"./index-CL_fwLHN.js";import{u as x}from"./roving-focus-FWOr5tBU.js";import{u as b}from"./useLayoutTier-DrLg7_rq.js";import{g as v,u as g}from"./reply-DvdgFS16.js";const j={mail:p,calendar:m},N="[data-app-item]",y=e=>e.button===0&&!e.metaKey&&!e.ctrlKey&&!e.shiftKey&&!e.altKey;function f({item:e,active:a,onNavigate:s,className:r,iconClassName:n}){const i=j[e.id];return t.jsxs("a",{href:e.href,"data-app-item":"","aria-current":a?"page":void 0,onClick:l=>{y(l)&&(l.preventDefault(),s(e.id))},className:u("flex flex-col items-center justify-center gap-0.5 rounded-lg outline-none transition-colors","focus-visible:ring-2 focus-visible:ring-ring",a?"bg-accent-soft text-accent":"text-fg-muted hover:bg-surface-sunken hover:text-fg",r),children:[t.jsx(i,{className:n,"aria-hidden":"true"}),t.jsx("span",{className:"text-2xs font-medium",children:e.label})]})}function C({items:e,active:a,onNavigate:s,className:r}){const n=c.useRef(null);return x({containerRef:n,itemSelector:N}),t.jsx("nav",{ref:n,"aria-label":"Apps",className:u("flex w-16 shrink-0 flex-col items-center gap-1 border-r border-line bg-surface py-2",r),children:e.map(i=>t.jsx(f,{item:i,active:i.id===a,onNavigate:s,className:"size-14",iconClassName:"size-5"},i.id))})}function A({items:e,active:a,onNavigate:s,className:r}){return t.jsx("nav",{"aria-label":"Apps",className:u("flex shrink-0 items-stretch justify-around border-t border-line bg-surface px-2 pt-1 pb-[max(0.25rem,env(safe-area-inset-bottom))]",r),children:e.map(n=>t.jsx(f,{item:n,active:n.id===a,onNavigate:s,className:"min-h-12 min-w-16 flex-1",iconClassName:"size-5"},n.id))})}const w=e=>e.startsWith("/calendar")?"calendar":"mail";function R(){const e=d(),a=h(),s=v(),r=g({select:o=>o.pathname}),n=w(r),i=c.useMemo(()=>[{id:"mail",label:"Mail",href:a.buildLocation({to:"/mail",hash:s}).href},{id:"calendar",label:"Calendar",href:a.buildLocation({to:"/calendar",hash:s}).href}],[a,s]),l=c.useCallback(o=>{e({to:o==="calendar"?"/calendar":"/mail",hash:s})},[e,s]);return{items:i,active:n,switchTo:l}}function T({children:e,hideTabBar:a=!1}){const s=b()==="phone",{items:r,active:n,switchTo:i}=R();return s?t.jsxs("div",{className:"flex h-full w-full flex-col",style:a?void 0:{"--app-tab-bar":"3.5rem"},children:[t.jsx("div",{className:"min-h-0 flex-1",children:e}),!a&&t.jsx(A,{items:r,active:n,onNavigate:i})]}):t.jsxs("div",{className:"flex h-full w-full",children:[t.jsx(C,{items:r,active:n,onNavigate:i}),t.jsx("div",{className:"min-w-0 flex-1",children:e})]})}export{T as A};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{b as _,o as j,j as e,X as q,r as c,cj as X}from"./index-CL_fwLHN.js";import{u as J,C as V}from"./useCalendarTasks-D_NZ0GM6.js";import{i as F,c as ee}from"./calendar-guests-BR4hC59z.js";import{C as te}from"./calendar-event-popup-DsPmxVye.js";import{c as ae}from"./draft-Y5XWTm_J.js";import{b as ne,d as re,c as se,o as K,U,e as W}from"./useCalendarSuggestions-D3Jza1d7.js";import{u as le,b as ie}from"./useCalendarScheduling-BpjmrzdY.js";import"./reply-DvdgFS16.js";import{i as oe}from"./calendar-tMekVEGW.js";import{u as ce}from"./CalendarSession-BKwK9s2o.js";const ue=_("GripHorizontal",[["circle",{cx:"12",cy:"9",r:"1",key:"124mty"}],["circle",{cx:"19",cy:"9",r:"1",key:"1ruzo2"}],["circle",{cx:"5",cy:"9",r:"1",key:"1a8b28"}],["circle",{cx:"12",cy:"15",r:"1",key:"1e56xg"}],["circle",{cx:"19",cy:"15",r:"1",key:"1a92ep"}],["circle",{cx:"5",cy:"15",r:"1",key:"5r1jwy"}]]),de="h-9 rounded-md border border-line bg-surface-sunken px-2 text-sm text-fg outline-none focus-visible:border-line-strong focus-visible:ring-2 focus-visible:ring-ring/30",$=(s,r)=>{const m={...s.range,...r};return r.date!==void 0&&!m.allDay&&(m.endDate=r.date),r.date!==void 0&&m.allDay&&m.endDate<r.date&&(m.endDate=r.date),{...s,range:m}};function me({headingId:s,mode:r,onMode:m,fields:i,taskFields:o,onTaskChange:u,calendars:g,taskLists:N,guestSuggestions:T,onGuestQuery:v,onChange:f,onSave:x,onMoreOptions:R,onClose:A,saving:y=!1,problem:w="",failure:S,failureRef:M,titleRef:P,settingsHref:z,dragHandle:E,touch:h=!1}){const n=r==="task",C=n?N:g,D=C.length===0,d=!n&&F(i.guests)!==void 0,p=j(de,h&&"h-11"),G=n?o.title:i.title,I=t=>n?u({...o,title:t}):f({...i,title:t});return e.jsxs("form",{className:"relative flex flex-col",onSubmit:t=>{t.preventDefault(),!D&&!y&&!d&&x()},children:[e.jsxs("div",{onPointerDown:E?.onPointerDown,className:j("flex items-center justify-between rounded-t-xl bg-surface-sunken px-2 py-1",E&&"cursor-grab"),children:[e.jsx(ue,{className:"size-4 text-fg-subtle","aria-hidden":"true"}),e.jsx("h2",{id:s,className:"sr-only",children:n?"New task":"New event"})]}),e.jsxs("div",{className:"flex flex-col gap-3 p-4",children:[e.jsx("input",{ref:P,"aria-label":"Title",placeholder:"Add title",value:G,onChange:t=>I(t.target.value),className:j("border-b-2 border-line bg-transparent pb-1 text-xl text-fg outline-none placeholder:text-fg-subtle focus:border-accent")}),e.jsxs("fieldset",{className:"flex gap-1 self-start rounded-md bg-surface-sunken p-0.5 text-sm",children:[e.jsx("legend",{className:"sr-only",children:"Kind"}),["event","task"].map(t=>e.jsxs("label",{className:j("cursor-pointer rounded px-3 py-1 font-medium has-[:focus-visible]:ring-2 has-[:focus-visible]:ring-ring",r===t?"bg-surface text-fg shadow-sm":"text-fg-muted",h&&"min-h-11"),children:[e.jsx("input",{type:"radio",name:`${s}-kind`,value:t,checked:r===t,onChange:()=>m(t),className:"sr-only"}),t==="event"?"Event":"Task"]},t))]}),n?e.jsxs("div",{className:"flex flex-wrap items-center gap-2 text-sm",children:[e.jsx("span",{className:"text-fg-muted",children:"Due"}),e.jsx("input",{type:"date","aria-label":"Due date",value:o.dueDate,onChange:t=>t.target.value!==""&&u({...o,dueDate:t.target.value}),className:p}),o.dueTime===""?e.jsx("button",{type:"button",onClick:()=>u({...o,dueTime:"09:00"}),className:"rounded-md px-2 font-medium text-accent hover:bg-accent-soft",children:"Add time"}):e.jsx("input",{type:"time","aria-label":"Due time",step:900,value:o.dueTime,onChange:t=>u({...o,dueTime:t.target.value}),className:p})]}):e.jsxs("div",{className:"flex flex-wrap items-center gap-2 text-sm",children:[e.jsx("input",{type:"date","aria-label":"Date",value:i.range.date,onChange:t=>t.target.value!==""&&f($(i,{date:t.target.value})),className:p}),i.range.allDay?e.jsx("span",{className:"text-fg-muted",children:"All day"}):e.jsxs(e.Fragment,{children:[e.jsx("input",{type:"time","aria-label":"Start time",step:900,value:i.range.startTime,onChange:t=>t.target.value!==""&&f($(i,{startTime:t.target.value})),className:p}),e.jsx("span",{"aria-hidden":"true",children:"–"}),e.jsx("input",{type:"time","aria-label":"End time",step:900,value:i.range.endTime,onChange:t=>t.target.value!==""&&f($(i,{endTime:t.target.value})),className:p})]})]}),!n&&e.jsx(ee,{value:i.guests,onChange:t=>f({...i,guests:t}),suggestions:T,onQuery:v,touch:h}),n?e.jsx("textarea",{"aria-label":"Description",placeholder:"Add description",rows:2,value:o.description,onChange:t=>u({...o,description:t.target.value}),className:"w-full rounded-md border border-line bg-surface-sunken px-2 py-1 text-sm text-fg outline-none focus-visible:ring-2 focus-visible:ring-ring/30"}):e.jsx("input",{"aria-label":"Location",placeholder:"Add location",value:i.location,onChange:t=>f({...i,location:t.target.value}),className:p}),D?e.jsxs("p",{role:"status",tabIndex:-1,className:"text-sm text-fg-muted",children:["None of your calendars accepts new events."," ",e.jsx("a",{href:z,className:"font-medium text-accent hover:underline",children:"Calendar settings"})]}):e.jsx("select",{"aria-label":n?"Task list":"Calendar",value:n?o.calendarId:i.calendarId,onChange:t=>n?u({...o,calendarId:t.target.value}):f({...i,calendarId:t.target.value}),className:p,children:C.map(t=>e.jsx("option",{value:t.id,children:t.name},t.id))}),w!==""&&e.jsx("p",{className:"text-sm text-danger",role:"status",children:w}),S&&e.jsx(te,{failure:S,focusRef:M})]}),e.jsxs("div",{className:"flex items-center justify-between px-4 pb-4",children:[n?e.jsx("span",{}):e.jsx("button",{type:"button",onClick:R,className:j("rounded-md px-3 text-sm font-medium text-accent outline-none hover:bg-accent-soft focus-visible:ring-2 focus-visible:ring-ring",h?"min-h-11":"h-9"),children:"More options"}),e.jsx("button",{type:"submit",disabled:D||y||d,className:j("rounded-md bg-accent px-5 text-sm font-medium text-accent-fg outline-none hover:bg-accent-hover focus-visible:ring-2 focus-visible:ring-ring disabled:opacity-50",h?"min-h-11":"h-9"),children:y?"Saving…":"Save"})]}),e.jsx("button",{type:"button","aria-label":"Close",onClick:A,className:j("absolute top-0 right-1 flex items-center justify-center rounded-full text-fg-muted outline-none hover:bg-surface hover:text-fg focus-visible:ring-2 focus-visible:ring-ring",h?"size-11":"size-8"),children:e.jsx(q,{className:"size-4"})})]})}const fe=80;function ge({labelledBy:s,onDismiss:r,children:m,sheetRef:i,className:o}){const u=c.useRef(null),[g,N]=c.useState(0),T=x=>{u.current=x.clientY,x.currentTarget.setPointerCapture(x.pointerId)},v=x=>{u.current!==null&&N(Math.max(0,x.clientY-u.current))},f=()=>{u.current!==null&&(u.current=null,g>fe&&r(),N(0))};return e.jsxs("div",{ref:i,role:"dialog","aria-modal":"false","aria-labelledby":s,"data-calendar-popover":"",className:j("fixed inset-x-0 bottom-0 z-50 max-h-[70dvh] overflow-y-auto rounded-t-2xl border-t border-line bg-surface-raised pb-[env(safe-area-inset-bottom,0px)] shadow-2xl shadow-black/30",o),style:{transform:`translateY(${g}px)`,transition:g===0?"transform 200ms ease-out":"none"},children:[e.jsx("div",{"aria-hidden":"true","data-sheet-grabber":"",onPointerDown:T,onPointerMove:v,onPointerUp:f,onPointerCancel:f,className:"flex h-6 cursor-grab touch-none items-center justify-center",children:e.jsx("span",{className:"h-1 w-10 rounded-full bg-line-strong"})}),m]})}const xe="/settings/calendars";function pe(s){return{title:s.title,date:s.range.date,startTime:s.range.startTime,endDate:s.range.endDate,endTime:s.range.endTime,allDay:s.range.allDay,calendarId:s.calendarId,location:s.location,guests:s.guests,notes:"",repeat:""}}function ke({session:s,dispatch:r,onMoreOptions:m,onSaved:i,touch:o=!1}){const u=c.useId(),g=c.useRef(null),N=c.useRef(null),[T,v]=c.useState(""),{calendars:f,taskLists:x,defaultCalendarId:R,timeZoneByCalendarId:A}=ne(),y=f.filter(a=>!a.readOnly),{createEvent:w}=re(),{createTask:S}=J(),{defaultSenderId:M}=le(),[P,z]=c.useState(""),E=ie(P),h=ce(),{draft:n}=s,[C,D]=c.useState("event"),[d,p]=c.useState({title:"",dueDate:"",dueTime:"",description:"",calendarId:""}),G=a=>{if(a!==C){if(D(a),a==="event"){r({type:"change",draft:{...n,title:d.title}});return}p(l=>({...l,title:n.title,dueDate:n.range.date,dueTime:n.range.allDay?"":n.range.startTime,calendarId:l.calendarId===""?x[0]?.id??"":l.calendarId}))}},I=y.find(a=>a.id===R)?.id??y[0]?.id??"",t=M??y.find(a=>a.id===n.calendarId)?.accountId??"";c.useEffect(()=>{g.current?.focus()},[]),c.useEffect(()=>{n.calendarId!==""||I===""||r({type:"change",draft:{...n,calendarId:I}})},[n,I,r]),c.useEffect(()=>{s.status==="failed"&&N.current?.focus()},[s.status]);const L=c.useRef(null),B=c.useRef(null);oe(o,()=>(r({type:"outside"}),!0));const k=`${n.range.date}T${n.range.startTime}/${n.range.endDate}T${n.range.endTime}`;c.useEffect(()=>{const a=B.current;if(k==="")return;const l=document.querySelector("[data-draft-block]"),b=document.querySelector("[role='grid'][aria-label='Time grid']");if(!a||!l||!b)return;const Z=l.getBoundingClientRect().bottom-a.getBoundingClientRect().top+16;Z>0&&(b.scrollTop+=Z)},[k]);const H=c.useRef(null);c.useEffect(()=>{const a=H.current;if(!a)return;const l=b=>{(b.target instanceof HTMLInputElement||b.target instanceof HTMLSelectElement)&&(L.current=b.target)};return a.addEventListener("focusin",l),()=>a.removeEventListener("focusin",l)},[]),c.useEffect(()=>{const a=L.current;k===""||!a||document.activeElement===a||a.focus()},[k]);const Y=()=>{if(d.title.trim()===""){v("Give the task a title before saving it."),g.current?.focus();return}v(""),r({type:"save"});const a=W(),l=d.dueTime==="";S({calendarId:d.calendarId,summary:d.title.trim(),description:d.description,allDay:l,due:l?d.dueDate:X(d.dueDate,d.dueTime,a),...l?{}:{timeZone:K(U)}}).then(b=>{if(b.kind==="written"){r({type:"saved"});return}r({type:"save-failed",problem:`Couldn't save the task: ${b.message}`})})},O=()=>{if(C==="task"){Y();return}const a=ae(pe(n),{clock:W(),anchor:K(A[n.calendarId]??U)},t);if(!a.ok){v(a.problem),g.current?.focus();return}v(""),r({type:"save"}),w(a.input).then(l=>{if(l.kind==="created"){r({type:"saved"}),h.trackSends(l.sends),i(l.calendarObjectId);return}r({type:"save-failed",problem:l.kind==="conflict"?"This calendar changed while you were writing. Close the form and try again.":`Couldn't save this event: ${l.message}`})})},Q=a=>e.jsx("div",{ref:H,children:e.jsx(me,{headingId:u,mode:C,onMode:G,fields:n,taskFields:d,onTaskChange:p,calendars:y,taskLists:x,guestSuggestions:E,onGuestQuery:z,onChange:l=>r({type:"change",draft:l}),onSave:O,onMoreOptions:()=>m(L.current?.getAttribute("aria-label")??""),onClose:()=>r({type:"outside"}),saving:s.status==="saving",problem:T,failure:s.status==="failed"?{text:s.problem,reportHref:se(s.problem),onRetry:O}:void 0,failureRef:N,titleRef:g,settingsHref:xe,dragHandle:a,touch:o})});return o?e.jsx(ge,{labelledBy:u,onDismiss:()=>r({type:"outside"}),sheetRef:B,children:Q()}):e.jsx(V,{anchor:"[data-draft-block]",anchorKey:k,labelledBy:u,wrapTab:!0,header:a=>Q(a),children:null})}export{ke as C,pe as e};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{f as g,ao as f,g as b,U as y,V as v,cS as x,eY as L,r as p,e6 as h,j as c,eZ as d,e_ as C,e$ as k}from"./index-CL_fwLHN.js";import{c as M}from"./popover-menu-fjlAfNO1.js";import{ak as E}from"./MessageToolbar-UJadqHyA.js";import{a as A}from"./useLabels-BZFMPVjT.js";const I=3,_=({hasSearchQuery:e,freeText:t,residualTokenCount:s})=>{if(!e||s>0)return!1;const a=t.trim();return a.length===0||a.length>=I},w=e=>e===void 0?{kind:"unknown"}:{kind:"exact",value:e},z=e=>{const t=new Set;for(const s of e)s&&t.add(s);return t.size>1?{accountId:void 0,restriction:"spansAccounts",moveDisabledHint:"Move only works within one account — clear selection or pick messages from a single account"}:{accountId:t.size===1?[...t][0]:void 0,restriction:void 0,moveDisabledHint:void 0}},j=e=>{const{mailboxId:t,messages:s}=e,a=g(),{pushError:l}=f(),{mutateAsync:r,isPending:o}=b({...L(),onError:(n,i)=>{l({title:i.body.action==="Remove"?"Couldn't remove label":"Couldn't apply label",detail:x(n),error:n})},onSettled:(n,i,u)=>{y(a,v(E(u.body.messageIds??[],s??[],t)))}});return{applyLabel:p.useCallback((n,i,u)=>{n.length!==0&&h(n,m=>r({body:{messageIds:m,labelId:i,action:u}}))},[r]),isPending:o}};function U({accountId:e,mailboxId:t,messageIds:s}){const{labels:a}=A(e),{applyLabel:l}=j({mailboxId:t}),r=p.useMemo(()=>a.map(o=>({key:o.labelId,label:o.name,icon:c.jsx("span",{className:`size-2.5 rounded-full ${C(o.color)?d[o.color]:d.Default}`}),onSelect:()=>l(s,o.labelId,"Apply")})),[a,s,l]);return r.length===0?null:c.jsx(M,{triggerLabel:"Apply label to selected messages",triggerIcon:c.jsx(k,{className:"size-4 text-fg-subtle"}),triggerText:"Apply label",items:r,align:"start",nested:!0,touch:!1,triggerClassName:"min-h-11 w-full justify-start gap-3 px-4 py-2.5 text-sm font-normal text-fg"})}export{U as L,z as r,_ as s,w as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{l as v}from"./reply-DvdgFS16.js";import{j as r,r as u,A as l,ac as p}from"./index-CL_fwLHN.js";import{a as m}from"./useMessageBodyContent-D-LJBFh4.js";import{F as x}from"./FullCompose-Djp_h4BT.js";function d(o,n,s){if(o!==n)return s}function j(o,n){return o===""?"":n}function C({searchInput:o,committedQuery:n,urlQuery:s,pathname:t,listPath:a}){return!v(t,a)||n!==o?!1:n!==s}const c=u.createContext(null),M=({chrome:o,children:n})=>r.jsx(c.Provider,{value:o,children:n});function N({phone:o,list:n,reading:s,intelligence:t,hasThread:a=!1}){const e=u.useContext(c),f=m();if(!e)return r.jsx(l,{});const i={nav:e.nav,overlay:e.overlay,skeleton:r.jsx(l,{}),isLoading:e.isLoading,navOpen:e.navOpen,onOpenNav:e.onOpenNav,onCloseNav:e.onCloseNav};return e.isSinglePane?r.jsx(p,{...i,list:f?r.jsx(x,{}):o,intelligenceOpen:e.intelligenceOpen}):r.jsx(p,{...i,topBar:e.topBar,list:n,reading:s,intelligence:t,intelligenceOpen:e.intelligenceOpen,hasThread:a})}export{M,N as a,C as b,j as c,d as s};
|