@remit/web-client-dist 0.0.695 → 0.0.697
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-BJLNB-w7.js → BriefPane-BQx5RRpb.js} +1 -1
- package/assets/{CalendarEventEditor-MMNLFvjJ.js → CalendarEventEditor-B3bVY-Oc.js} +1 -1
- package/assets/{CalendarEventPopup-DVJ9DC_Y.js → CalendarEventPopup-D6PNfUfu.js} +1 -1
- package/assets/{CalendarLoadFailed-uHGxFBGx.js → CalendarLoadFailed-Cm6trTQZ.js} +1 -1
- package/assets/{CalendarQuickCreate-CzJ4lehP.js → CalendarQuickCreate-B_n983kv.js} +1 -1
- package/assets/{CalendarSession-BVuy8A2H.js → CalendarSession-BosFoHg2.js} +1 -1
- package/assets/CollectionPane-BzktgIp0.js +1 -0
- package/assets/{DesktopChrome-Ct-IB4ks.js → DesktopChrome-GxTHTvqD.js} +1 -1
- package/assets/{DropdownMenu-CTCHgh4X.js → DropdownMenu-C2J8u8zN.js} +1 -1
- package/assets/{EmptyState-CN-AyHj-.js → EmptyState-BJU14tbt.js} +1 -1
- package/assets/{ErrorState-Bk3DwNvd.js → ErrorState-BTHOmsYP.js} +1 -1
- package/assets/{FullCompose-BWiLy3Vm.js → FullCompose-DiZNltCL.js} +1 -1
- package/assets/{LabelApplyTrigger-52QGuTLD.js → LabelApplyTrigger-P8IoLKME.js} +1 -1
- package/assets/{MailShell-DAqGpnce.js → MailShell-tKLYT5hn.js} +1 -1
- package/assets/MailViewChrome-CLgaFbe-.js +1 -0
- package/assets/{MailboxPane-DUI-sxQF.js → MailboxPane-BxNCkl6s.js} +2 -2
- package/assets/{MessageBody-BeciCqb_.js → MessageBody-jG4Dhul6.js} +2 -2
- package/assets/{MessageToolbar-BYhqv9RG.js → MessageToolbar-DeDUhCvg.js} +1 -1
- package/assets/{NavMenuButton-A6v6v8tE.js → NavMenuButton-CLp6InRG.js} +1 -1
- package/assets/{OnboardingWizard-CIneAccs.js → OnboardingWizard-BSlPpmI5.js} +1 -1
- package/assets/{OutboxPane-InUnHiNC.js → OutboxPane-B6UfixBP.js} +1 -1
- package/assets/{ReportLink-q8WFRQli.js → ReportLink-BELrQR40.js} +1 -1
- package/assets/_calendarObjectId-BiaBDCEt.js +1 -0
- package/assets/_labelId-DLeWLaow.js +1 -0
- package/assets/_mailboxId-DWvQ-9gi.js +1 -0
- package/assets/_messageId-BB9xOwfs.js +1 -0
- package/assets/_messageId-C2YSZxRF.js +1 -0
- package/assets/_messageId-CPvSvBZB.js +1 -0
- package/assets/_messageId-DbVH08AL.js +1 -0
- package/assets/_outboxMessageId-BFgW_k_u.js +1 -0
- package/assets/_recurrenceId-96pqeQMh.js +1 -0
- package/assets/{_slotId-Cf-NASLE.js → _slotId-DQqfctAf.js} +1 -1
- package/assets/_threadId-Bm7b75jN.js +1 -0
- package/assets/_threadId-CCwEReI2.js +1 -0
- package/assets/_threadId-Db39B53v.js +1 -0
- package/assets/_threadId-Dht02PUZ.js +1 -0
- package/assets/{_view._date-dARprXsM.js → _view._date-BQeaBjoE.js} +1 -1
- package/assets/{account-service-status-DexPoUiT.js → account-service-status-DsLvRU-X.js} +1 -1
- package/assets/{accounts-DPvTdrTr.js → accounts-D0rPQMGH.js} +1 -1
- package/assets/{advanced-CDr_JOXg.js → advanced-q_hG98BB.js} +1 -1
- package/assets/{agenda-time-BcOiQ5_R.js → agenda-time-D0yU-H44.js} +1 -1
- package/assets/{app-chrome-6ZXmy5H4.js → app-chrome-BfyGOiSA.js} +1 -1
- package/assets/{appearance-BQZnBlkc.js → appearance-DM1k2Ta7.js} +1 -1
- package/assets/{avatar-B_QEsxCw.js → avatar-Bq7beWCy.js} +1 -1
- package/assets/{badge-CeCxCmzS.js → badge-BB80tGxy.js} +1 -1
- package/assets/{bottom-sheet-DWqGf7I3.js → bottom-sheet-DKF_Dkid.js} +1 -1
- package/assets/{brief-B7EfkUB4.js → brief-8diVJSZ9.js} +1 -1
- package/assets/brief-CFBkxoDK.js +1 -0
- package/assets/{calendar-DxjT7IrR.js → calendar-BqFIadRy.js} +1 -1
- package/assets/{calendar-CJGXdypt.js → calendar-Ds9kgvU8.js} +1 -1
- package/assets/{calendar-event-popup-y4Z860B0.js → calendar-event-popup-Cr_LW8IP.js} +1 -1
- package/assets/{calendar-event-sidebar-BaAGgT2x.js → calendar-event-sidebar-B_eR1h5J.js} +1 -1
- package/assets/{calendar-failure-note-CJvPzX2o.js → calendar-failure-note-C4gNXDQV.js} +1 -1
- package/assets/{calendar-guests-DeRthr7k.js → calendar-guests-Cay9Ub8h.js} +1 -1
- package/assets/{calendar-suggestion-BulekNHV.js → calendar-suggestion-EosZrXZC.js} +1 -1
- package/assets/{calendars-D-Use38B.js → calendars-52NaEZbX.js} +1 -1
- package/assets/{card-0Dzt3Scs.js → card-CLJYKox8.js} +1 -1
- package/assets/{checkbox-DIKh2-eX.js → checkbox-CYOm-zGr.js} +1 -1
- package/assets/{chevron-down-BnC2m4J6.js → chevron-down-De4wQzka.js} +1 -1
- package/assets/{chevron-left-CNQ3caMn.js → chevron-left-CUHU8UT9.js} +1 -1
- package/assets/{circle-check-CTlM3FQo.js → circle-check-DlR8I4Hf.js} +1 -1
- package/assets/{circle-check-big-DCVJA_H0.js → circle-check-big-CMsxQSjY.js} +1 -1
- package/assets/{circle-question-mark-CpApZe3H.js → circle-question-mark-DhNa_A16.js} +1 -1
- package/assets/{classification-C7_2tIfb.js → classification-BgDJ1gwK.js} +1 -1
- package/assets/{clock-CTlZVcLb.js → clock-Dds4zv6u.js} +1 -1
- package/assets/{cloud-off-CtJJ9OTh.js → cloud-off-BYulqayx.js} +1 -1
- package/assets/compose._-_outboxMessageId_-BY1Sf-7o.js +1 -0
- package/assets/compose._-_outboxMessageId_-ByGI1c-o.js +1 -0
- package/assets/compose._-_outboxMessageId_-CvOAO1iL.js +1 -0
- package/assets/compose._-_outboxMessageId_-EZpX9L3H.js +1 -0
- package/assets/compose._-_outboxMessageId_-urlj3DLH.js +1 -0
- package/assets/{config-import-CHZ9oJuF.js → config-import-VTZQj3gU.js} +1 -1
- package/assets/{confirm-dialog-Cc446-7C.js → confirm-dialog-XvccFJdE.js} +1 -1
- package/assets/{copy-jXKvwaUz.js → copy-BokIobZ4.js} +1 -1
- package/assets/{credential-steps-yT5IXLY8.js → credential-steps-O1OzlOow.js} +1 -1
- package/assets/{download-CyhaY4zL.js → download-DEuAIIIQ.js} +1 -1
- package/assets/{draft-C1ufEqDz.js → draft-BEiHkDpm.js} +1 -1
- package/assets/edit-B9dhadKH.js +1 -0
- package/assets/edit-vn6fIBd6.js +1 -0
- package/assets/{external-link-1TiTglgB.js → external-link-L7NXOTeQ.js} +1 -1
- package/assets/{file-braces-CXZUVCry.js → file-braces-BN8-S---.js} +1 -1
- package/assets/{filters-CR0iG1ow.js → filters-VSaDpnX3.js} +1 -1
- package/assets/{flagged-DuEE_WUV.js → flagged-B-j-3yRr.js} +1 -1
- package/assets/flagged-BZJepVc-.js +1 -0
- package/assets/{folder-input-kcvJkrLj.js → folder-input-B0q8wLhf.js} +1 -1
- package/assets/{folders-6mmHeM8E.js → folders-CTNX9Hcm.js} +1 -1
- package/assets/{help-copy-CIhcXCo3.js → help-copy-DUjzIPXf.js} +1 -1
- package/assets/{import-76KXkdMq.js → import-DLM5VFnJ.js} +1 -1
- package/assets/index-B--m5QrT.js +1 -0
- package/assets/index-BuawSiTp.js +1 -0
- package/assets/index-C2YSZxRF.js +1 -0
- package/assets/index-CO1X8-aP.js +1 -0
- package/assets/index-CPvSvBZB.js +1 -0
- package/assets/{index-iXcp-mGT.js → index-Caon2n2j.js} +4 -4
- package/assets/index-ChWo5_90.js +1 -0
- package/assets/index-DGb7Ls8y.js +1 -0
- package/assets/index-DLRo9M2D.js +1 -0
- package/assets/index-DemsYVll.js +1 -0
- package/assets/index-Dylwxpr-.js +1 -0
- package/assets/index-YwusJB4d.js +1 -0
- package/assets/index-Zfii_-4V.js +1 -0
- package/assets/{index-yeSesYv-.js → index-fsuIswbe.js} +72 -72
- package/assets/{kbd-BVK8yKhS.js → kbd-jzPSd-a2.js} +1 -1
- package/assets/{label-chip-CrQMhpJe.js → label-chip-DtBVyALF.js} +1 -1
- package/assets/{labels-CaXUAL8B.js → labels-CUXsONgB.js} +1 -1
- package/assets/mail-BodKXw3C.js +1 -0
- package/assets/{mail-CLkdzm71.js → mail-BzFJWQZy.js} +1 -1
- package/assets/{menu-Cn2tY52U.js → menu-Bh94jr77.js} +1 -1
- package/assets/{nav-link-BvlYCbp-.js → nav-link-ed0mFCCx.js} +1 -1
- package/assets/new-DlRrHbU8.js +1 -0
- package/assets/onboarding-8O2rW7qq.js +1 -0
- package/assets/{onboarding-completion-CJl9zKMA.js → onboarding-completion-qKzJSmsI.js} +1 -1
- package/assets/outbox-nrXvnMTk.js +1 -0
- package/assets/{pencil-A679n1yJ.js → pencil-BDbmS56C.js} +1 -1
- package/assets/{people-C5ni4bV_.js → people-eWwwIt4_.js} +1 -1
- package/assets/{plus-D9A6i0pi.js → plus-D5-2sA5v.js} +1 -1
- package/assets/{popover-menu-wrc2e8Vk.js → popover-menu-DhcuKv1N.js} +1 -1
- package/assets/{refresh-cw-BRmmCn_2.js → refresh-cw-Cu9_I3cT.js} +1 -1
- package/assets/{reply-DL5kkaJs.js → reply-CXuSMyqp.js} +1 -1
- package/assets/{rich-text-EZFEOU8t.js → rich-text-Ds4rQc2o.js} +1 -1
- package/assets/{rich-text-spellcheck-worker-provider-NOmoFs4G.js → rich-text-spellcheck-worker-provider-ChKzrvjg.js} +1 -1
- package/assets/{rotate-ccw-C2NtRHS-.js → rotate-ccw-hQhPZwrx.js} +1 -1
- package/assets/{roving-focus-CSq3MPWi.js → roving-focus-DZX7IpN4.js} +1 -1
- package/assets/{row-actions-Cthc4RCY.js → row-actions-BDfQKXdD.js} +1 -1
- package/assets/{search-mirror-CCAs_ZWe.js → search-mirror-B2xnwy77.js} +1 -1
- package/assets/{search-scope-DaiXqXNv.js → search-scope-B-3MTDpD.js} +1 -1
- package/assets/{search-token-index-VBBiMTaA.js → search-token-index-BYKMNlJD.js} +1 -1
- package/assets/{sections-uFHlOXiA.js → sections-DpRVKuXF.js} +1 -1
- package/assets/{segmented-control-DNxc5Ghi.js → segmented-control-BwvsufVp.js} +1 -1
- package/assets/{select-B9t8348S.js → select-TYdrgtW5.js} +1 -1
- package/assets/senders-vh4OQfD0.js +1 -0
- package/assets/settings-MlHARJWl.js +1 -0
- package/assets/{settings-screen-CafoSGzb.js → settings-screen-DTYVWAkg.js} +1 -1
- package/assets/{shield-check-BdZGtm0z.js → shield-check-C-tOrPEx.js} +1 -1
- package/assets/{spam-DKjh33Xi.js → spam-CecFwFHS.js} +1 -1
- package/assets/{suggest-list-Do7i1-gb.js → suggest-list-BCqr1j26.js} +1 -1
- package/assets/{suggested-vips-C-je5foZ.js → suggested-vips--pG2iuOT.js} +1 -1
- package/assets/{suggestion._suggestionId-DF2BM_zX.js → suggestion._suggestionId-DiMWWP0r.js} +1 -1
- package/assets/{switch-1RDXcNo-.js → switch-CyAtRlCz.js} +1 -1
- package/assets/{task._calendarTaskId-B7k5whQt.js → task._calendarTaskId-D-wpEifQ.js} +1 -1
- package/assets/{undo-2-B-b8_FeJ.js → undo-2-D1IMLq7c.js} +1 -1
- package/assets/{useCalendarData-BcNSn1yP.js → useCalendarData-DFG3pzeG.js} +1 -1
- package/assets/{useCalendarScheduling-Dfk1b293.js → useCalendarScheduling-B_INtO-h.js} +1 -1
- package/assets/{useCalendarSuggestions-D_tk6nh4.js → useCalendarSuggestions-DXbA0boT.js} +1 -1
- package/assets/{useCalendarTasks-CX2Wh1Fn.js → useCalendarTasks-b_UNFPQH.js} +1 -1
- package/assets/{useClassificationSettings-Bi0m63-O.js → useClassificationSettings-DBRecrmp.js} +1 -1
- package/assets/useCollectionThreads-DgofDKen.js +1 -0
- package/assets/{useDebouncedValue-AWe2Zncy.js → useDebouncedValue-CFZ4EPXW.js} +1 -1
- package/assets/{useFilters-Bp1QgyWU.js → useFilters-DHWZEIQe.js} +1 -1
- package/assets/useInfiniteQuery-B-vOuANs.js +1 -0
- package/assets/{useJunkMailboxIds-CWScvBHw.js → useJunkMailboxIds-CW7aI25D.js} +1 -1
- package/assets/{useLabels-CGE9kc74.js → useLabels-k1VKuQrr.js} +1 -1
- package/assets/{useLayoutTier-D5MoTNho.js → useLayoutTier-BNUKvwJD.js} +1 -1
- package/assets/{useMediaQuery-Bf7zukl9.js → useMediaQuery-Hy81MQ2M.js} +1 -1
- package/assets/{useMessageBodyContent-BxjoKGiE.js → useMessageBodyContent-CpTD2HGg.js} +1 -1
- package/assets/{useQueries-Dj93detX.js → useQueries-DPH-PeHV.js} +1 -1
- package/assets/{useRefreshControl-DCFTdDZz.js → useRefreshControl-DdbTrGxq.js} +1 -1
- package/assets/{useResultFolderIndex-DAcbTt0T.js → useResultFolderIndex-BVyfzXH5.js} +1 -1
- package/assets/{useSignature-CA8ypw7f.js → useSignature-W9HBbZ_n.js} +1 -1
- package/assets/{warnings-C-blkf-m.js → warnings-B2sNE31D.js} +1 -1
- package/index.html +1 -1
- package/package.json +1 -1
- package/assets/CollectionPane-RUuB6sFo.js +0 -1
- package/assets/MailViewChrome-BDymWKX9.js +0 -1
- package/assets/_calendarObjectId-B3IHxxnZ.js +0 -1
- package/assets/_labelId-BX1_9FW3.js +0 -1
- package/assets/_mailboxId-BKCf6hRR.js +0 -1
- package/assets/_messageId-DGc5xyqH.js +0 -1
- package/assets/_messageId-ODP9L5rG.js +0 -1
- package/assets/_messageId-_9l1GYCG.js +0 -1
- package/assets/_messageId-t0gwqxwG.js +0 -1
- package/assets/_outboxMessageId-DGFiVWCU.js +0 -1
- package/assets/_recurrenceId-yqFEhvsn.js +0 -1
- package/assets/_threadId-Bvd5G-pJ.js +0 -1
- package/assets/_threadId-BwJQjORR.js +0 -1
- package/assets/_threadId-CFLbzDUi.js +0 -1
- package/assets/_threadId-Dj29QtLs.js +0 -1
- package/assets/brief-NsiukvBp.js +0 -1
- package/assets/compose._-_outboxMessageId_-BT2RKEAF.js +0 -1
- package/assets/compose._-_outboxMessageId_-B_NGqkpg.js +0 -1
- package/assets/compose._-_outboxMessageId_-CCPr3GjM.js +0 -1
- package/assets/compose._-_outboxMessageId_-CFBNHbeY.js +0 -1
- package/assets/compose._-_outboxMessageId_-Cw-Zq1kx.js +0 -1
- package/assets/edit-BGhTeEac.js +0 -1
- package/assets/edit-CeXJ3wiI.js +0 -1
- package/assets/flagged-B4N5fCui.js +0 -1
- package/assets/index-5PtybTMj.js +0 -1
- package/assets/index-B-gNDz7v.js +0 -1
- package/assets/index-B1AltYi_.js +0 -1
- package/assets/index-BX5kv92z.js +0 -1
- package/assets/index-CzMYehsR.js +0 -1
- package/assets/index-DT4iQTvg.js +0 -1
- package/assets/index-DZ4zN_a2.js +0 -1
- package/assets/index-Xq-TD3Lr.js +0 -1
- package/assets/index-eKzwYumy.js +0 -1
- package/assets/index-ehMMhnu5.js +0 -1
- package/assets/index-rui9BQ_f.js +0 -1
- package/assets/index-t0gwqxwG.js +0 -1
- package/assets/mail-CiuTTyMm.js +0 -1
- package/assets/new-ZEuIlDnl.js +0 -1
- package/assets/onboarding-bCsMaIPY.js +0 -1
- package/assets/outbox-BthyAXQ5.js +0 -1
- package/assets/senders-uBzIqu95.js +0 -1
- package/assets/settings-BLs90wKU.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as H,j as e,d as x,B as f,L as W,X as Oe,r,I as Pe,e as pe,a as De,c as _e,f as L,s as de,g as Le,h as qe,i as He,m as We,k as X,l as Qe}from"./index-yeSesYv-.js";import{W as k,C as fe,a as le,u as Ve,b as Ge,c as Ke,d as Ue,S as Xe,R as Ye}from"./credential-steps-yT5IXLY8.js";import{c as ge,f as Je,v as xe,r as Ze,a as et,b as ue,w as me,p as tt,W as st,s as nt,g as it}from"./config-import-CHZ9oJuF.js";import{F as at}from"./file-braces-CXZUVCry.js";import{B as z}from"./badge-CeCxCmzS.js";import{c as rt}from"./onboarding-completion-CJl9zKMA.js";import"./select-B9t8348S.js";import"./chevron-down-BnC2m4J6.js";import"./card-0Dzt3Scs.js";const je={name:"folder-clock",size:24,node:[["path",{d:"M16 14v2.2l1.6 1",key:"fo4ql5"}],["path",{d:"M7 20H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2",key:"1urifu"}],["circle",{cx:"16",cy:"16",r:"6",key:"qoo3c4"}]]};je.node;const ot=H(je);const ve={name:"key-round",size:24,node:[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z",key:"1s6t7t"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]]};ve.node;const ct=H(ve);const ye={name:"merge",size:24,node:[["path",{d:"m8 6 4-4 4 4",key:"ybng9g"}],["path",{d:"M12 2v10.3a4 4 0 0 1-1.172 2.872L4 22",key:"1hyw0i"}],["path",{d:"m20 22-5-5",key:"1m27yz"}]]};ye.node;const dt=H(ye);const we={name:"upload",size:24,node:[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]]};we.node;const lt=H(we),y=["File","Review","Credentials","Folders"];function J({children:t}){return e.jsx("code",{className:"block rounded bg-surface-sunken px-2.5 py-2 text-2xs text-fg-muted",children:t})}function ut({state:t="idle",file:n,ready:i=!1,failure:s,onChoose:d,onDragStateChange:l,onNext:h}){const w=r.useId(),u=r.useRef(null),p=t==="dragging",j=t==="reading",N=t==="checking",R=j||N,S=m=>{m.preventDefault(),l?.(!1);const b=m.dataTransfer.files.item(0);b&&d?.(b)};return e.jsx(k,{steps:y,activeStep:0,title:"Import a config file",subtitle:"Accounts, folder roles, rules, senders and appearance — everything except passwords.",footer:e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"text-2xs text-fg-subtle",children:"Nothing is written until you have seen what will change."}),e.jsx(f,{variant:"primary",disabled:R||!i,icon:R?e.jsx(W,{className:"size-3.5 animate-spin"}):void 0,onClick:h,children:j?"Reading…":N?"Checking…":"Check the file"})]}),children:e.jsxs("div",{className:"space-y-4",children:[s&&e.jsxs("div",{className:"space-y-2",children:[e.jsx(x,{tone:"danger",children:s.title}),e.jsx("p",{className:"text-sm text-fg",children:s.explanation}),e.jsx("p",{className:"text-sm text-fg-muted",children:s.fix}),e.jsx(J,{children:s.raw})]}),e.jsxs("div",{onDragOver:m=>{m.preventDefault(),l?.(!0)},onDragLeave:()=>l?.(!1),onDrop:S,className:p?"flex flex-col items-center gap-3 rounded-sm border-2 border-dashed border-accent bg-accent-soft px-4 py-9 text-center":"flex flex-col items-center gap-3 rounded-sm border-2 border-dashed border-line px-4 py-9 text-center",children:[e.jsx("span",{className:"flex size-11 items-center justify-center rounded-md bg-surface-sunken",children:e.jsx(lt,{className:"size-5 text-fg-muted"})}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium text-fg",children:p?"Drop it here":"Drop a config file here, or choose one"}),e.jsx("p",{className:"mt-1 text-xs text-fg-subtle",children:"A .json file written by Reader — up to 2 MB."})]}),e.jsx("input",{ref:u,id:w,type:"file",accept:"application/json,.json",className:"sr-only",onChange:m=>{const b=m.target.files?.item(0);b&&d?.(b)}}),e.jsx(f,{variant:"secondary",size:"sm",onClick:()=>u.current?.click(),children:"Choose file"})]}),n&&e.jsxs("div",{className:"flex items-start gap-3 rounded-sm border border-line px-3 py-2.5",children:[e.jsx(at,{className:"mt-0.5 size-4 shrink-0 text-fg-muted"}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("p",{className:"truncate text-sm text-fg",children:n.name}),e.jsxs("p",{className:"mt-0.5 text-xs text-fg-subtle",children:[Je(n.size)," ·"," ",j?"reading it from disk":N?"checking it against this instance":i?"ready to check — nothing has been sent yet":"not a configuration this instance can read"]})]})]}),e.jsxs("p",{className:"text-2xs text-fg-subtle",children:["Export one from Settings → Advanced on the instance you are moving from, or run"," ",e.jsx("code",{className:"rounded bg-surface-sunken px-1 py-0.5",children:"remit config save"})," ","on its host."]})]})})}function mt({sections:t}){const n=ge(t.flatMap(i=>i.entries.map(s=>({section:i.id,key:s.label,verdict:s.verdict}))));return e.jsx("div",{className:"flex flex-wrap gap-1.5",children:["created","updated","unchanged","skipped","rejected"].filter(i=>n[i]>0).map(i=>e.jsxs(z,{tone:xe[i],dot:!0,children:[n[i]," ",i]},i))})}function ht({section:t}){return e.jsxs("section",{children:[e.jsx("h2",{className:"text-sm font-semibold text-fg",children:t.title}),e.jsx("ul",{className:"mt-1.5 divide-y divide-line",children:t.entries.map(n=>e.jsxs("li",{className:"flex items-start gap-3 py-2",children:[e.jsx(z,{tone:xe[n.verdict],className:"mt-0.5 shrink-0",children:n.verdict}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("p",{className:"text-sm text-fg",children:n.label}),n.reason&&e.jsx("p",{className:n.verdict==="rejected"?"mt-1 text-xs text-danger":"mt-1 text-xs text-warning",children:n.reason})]})]},n.id))})]})}function pt({sections:t,fileName:n,warnings:i=[],applying:s=!1,onBack:d,onNext:l}){const h=ge(t.flatMap(p=>p.entries.map(j=>({section:p.id,key:j.label,verdict:j.verdict})))),w=h.created+h.updated,u=h.skipped+h.rejected;return e.jsx(k,{steps:y,activeStep:1,title:"What this file will change",subtitle:`${n} · nothing has been written yet.`,footer:e.jsxs(e.Fragment,{children:[e.jsx(f,{variant:"ghost",onClick:d,children:"Choose another file"}),e.jsx(f,{variant:"primary",disabled:s,icon:s?e.jsx(W,{className:"size-3.5 animate-spin"}):void 0,onClick:l,children:s?"Importing…":`Import ${w} changes`})]}),children:e.jsxs("div",{className:"space-y-5",children:[e.jsx(mt,{sections:t}),u>0&&e.jsxs(x,{tone:"warning",children:[u," entries will not be imported. Each says why below — read them before you continue, because nothing here retries on its own."]}),i.length>0&&e.jsx("ul",{className:"space-y-1 text-xs text-warning",children:i.map(p=>e.jsx("li",{children:p},p))}),t.map(p=>e.jsx(ht,{section:p},p.id))]})})}function ft({choice:t,held:n,onChoose:i,onBack:s,onNext:d}){return e.jsx(k,{steps:y,activeStep:1,title:"This instance already has configuration",subtitle:n,footer:e.jsxs(e.Fragment,{children:[e.jsx(f,{variant:"ghost",onClick:s,children:"Choose another file"}),e.jsx(f,{variant:"primary",disabled:!t,onClick:d,children:t==="merge"?"Continue with merge":"Continue"})]}),children:e.jsxs("div",{className:"space-y-4",children:[e.jsx(x,{tone:"warning",children:"An import into a configured instance can only add and update — it never deletes what is here. Pick how the two should meet."}),e.jsxs("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2",children:[e.jsx(le,{name:"Stop, keep this instance",description:"Nothing is written. Use this if you meant to import into a fresh instance.",icon:e.jsx(Oe,{className:"size-5"}),selected:t==="abort",onSelect:()=>i?.("abort")}),e.jsx(le,{name:"Merge the file in",description:"Adds what is missing and updates what differs. Existing accounts keep their server settings.",icon:e.jsx(dt,{className:"size-5"}),selected:t==="merge",onSelect:()=>i?.("merge")})]}),t==="merge"&&e.jsx("p",{className:"text-xs text-fg-muted",children:"The next screen lists every add and update before anything is written."})]})})}function gt(t){return t==="entered"?e.jsx(z,{tone:"positive",children:"ready"}):t==="failed"?e.jsx(z,{tone:"danger",children:"sign-in failed"}):e.jsx(z,{tone:"danger",children:"credentials needed"})}function xt({accounts:t,busyAccountId:n,onOpen:i}){return e.jsx("ul",{className:"divide-y divide-line",children:t.map(s=>e.jsxs("li",{className:s.state==="entered"?"flex flex-wrap items-start justify-between gap-3 py-3":"flex flex-wrap items-start justify-between gap-3 border-l-2 border-danger bg-danger-soft py-3 pl-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx("span",{className:"text-sm font-medium text-fg",children:s.address}),gt(s.state)]}),e.jsxs("p",{className:"mt-0.5 text-xs text-fg-subtle",children:[s.displayName," ·"," ",s.connector==="microsoft"?"Microsoft 365":"IMAP / SMTP"," ","· ",s.server]}),s.state!=="entered"&&e.jsx("p",{className:"mt-1 text-xs text-danger",children:s.failure??(s.connector==="microsoft"?"Config files never carry OAuth tokens. Reconnect with Microsoft to start syncing this account.":"Config files never carry passwords. Enter this mailbox's password to start syncing.")})]}),s.state!=="entered"&&e.jsx(f,{variant:"primary",size:"sm",disabled:n===s.accountId,icon:n===s.accountId?e.jsx(W,{className:"size-3.5 animate-spin"}):s.connector==="microsoft"?e.jsx(Pe,{className:"size-3.5"}):e.jsx(ct,{className:"size-3.5"}),onClick:()=>i?.(s),children:n===s.accountId?"Redirecting…":s.connector==="microsoft"?"Reconnect":s.state==="failed"?"Try again":"Enter password"})]},s.accountId))})}function jt({accounts:t,busyAccountId:n,error:i,onOpen:s,onNext:d}){const l=t.filter(h=>h.state!=="entered").length;return e.jsx(k,{steps:y,activeStep:2,title:"These accounts need credentials",subtitle:"The config file carries servers and settings. Passwords and Microsoft sign-ins it deliberately leaves out.",footer:e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"text-2xs text-fg-subtle",children:l>0?"Settings › Accounts keeps asking until every account is signed in.":"Every account can sync."}),e.jsx(f,{variant:"primary",onClick:d,children:l>0?"Finish later":"All accounts connected"})]}),children:e.jsxs("div",{className:"space-y-4",children:[i&&e.jsx(x,{tone:"danger",children:i}),l>0&&e.jsxs(x,{tone:"danger",children:[l," of ",t.length," accounts cannot sync yet. They stay listed in Settings, marked like this, until you sign in — no mail arrives for them in the meantime."]}),e.jsx(xt,{accounts:t,busyAccountId:n,onOpen:s})]})})}function vt({account:t,position:n,total:i,error:s,busy:d=!1,onBack:l,onNext:h}){return e.jsx(k,{steps:y,activeStep:2,title:`Reconnect ${t.address}`,subtitle:`Account ${n} of ${i} · Microsoft 365`,footer:e.jsxs(e.Fragment,{children:[e.jsx(f,{variant:"ghost",onClick:l,children:"Back"}),e.jsx(f,{variant:"primary",disabled:d,icon:d?e.jsx(W,{className:"size-3.5 animate-spin"}):void 0,onClick:h,children:d?"Redirecting…":"Sign in with Microsoft"})]}),children:e.jsxs("div",{className:"space-y-4",children:[s&&e.jsx(x,{tone:"danger",children:s}),e.jsx(x,{tone:"info",children:"A config file never carries an OAuth token — one only works for the instance it was granted to. Signing in here mints a fresh one for this instance."}),e.jsxs("div",{className:"rounded-sm border border-line px-3 py-2.5",children:[e.jsx("p",{className:"text-sm text-fg",children:t.displayName}),e.jsxs("p",{className:"mt-0.5 text-xs text-fg-subtle",children:[t.address," · ",t.server]})]}),e.jsx("p",{className:"text-2xs text-fg-subtle",children:"You will be sent to Microsoft and returned here. If your organisation requires admin approval, the sign-in stops there and this account keeps waiting."})]})})}function yt({folders:t,onNext:n}){return e.jsx(k,{steps:y,activeStep:3,title:t.length>0?"Creating folders":"Import finished",subtitle:t.length>0?"The config names folders this account does not have yet. Reader creates them on the mail server.":"Everything in the file landed, and every folder it named resolved.",footer:e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"text-2xs text-fg-subtle",children:"Folder discovery runs with every sync."}),e.jsx(f,{variant:"primary",onClick:n,children:"Go to inbox"})]}),children:e.jsx("div",{className:"space-y-4",children:t.length>0?e.jsxs(e.Fragment,{children:[e.jsxs(x,{tone:"warning",children:[t.length," settings are imported but switched off. Reader creates each missing folder on the mail server the next time the account syncs, and turns the setting on once the server confirms it. A rule whose folder cannot be created stays off, and Settings → Filters says why."]}),e.jsxs("div",{className:"flex items-center gap-2 text-xs text-fg-muted",children:[e.jsx(ot,{className:"size-4"}),"Folder discovery runs with every sync of the account."]}),e.jsx("div",{className:"divide-y divide-line",children:t.map(i=>e.jsx(fe,{label:i.path,detail:i.waitingFor,state:"pending"},`${i.accountId??""}-${i.path}-${i.waitingFor}`))})]}):e.jsx(x,{tone:"success",children:"Every account, rule, label and sender in the file is live on this instance."})})})}function wt({failure:t,onBack:n}){return e.jsx(k,{steps:y,activeStep:0,title:t.title,subtitle:"Nothing was imported.",footer:e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"text-2xs text-fg-subtle",children:"This instance is unchanged."}),e.jsx(f,{variant:"primary",onClick:n,children:"Choose another file"})]}),children:e.jsxs("div",{className:"space-y-3",children:[e.jsx(x,{tone:"danger",children:t.explanation}),e.jsx("p",{className:"text-sm text-fg",children:t.fix}),e.jsx(J,{children:t.raw})]})})}function bt(t){return t==="landed"?"ok":t==="failed"||t==="unknown"?"failed":"pending"}function kt({results:t,message:n,raw:i,nothingLanded:s,onBack:d,onNext:l}){const h=t.filter(u=>u.state==="landed").length,w=t.some(u=>u.state==="unknown");return e.jsx(k,{steps:y,activeStep:1,title:s?"The import stopped, and nothing landed":"The import stopped part-way",subtitle:s?"No section of the file was written.":w?"It did not say how far it got, so check Settings before importing again.":`${h} of ${t.length} sections landed.`,footer:e.jsxs(e.Fragment,{children:[e.jsx(f,{variant:"ghost",onClick:d,children:"Choose another file"}),e.jsx(f,{variant:"primary",onClick:l,children:s?"Try the import again":"Retry the rest"})]}),children:e.jsxs("div",{className:"space-y-4",children:[e.jsx(x,{tone:"danger",children:n}),e.jsx("p",{className:"text-sm text-fg-muted",children:"Retrying is safe: an import folds into what is already here rather than replacing it, so what landed is recognised and left alone."}),e.jsx("div",{className:"divide-y divide-line",children:t.map(u=>e.jsx(fe,{label:u.title,detail:u.detail,state:bt(u.state)},u.section))}),e.jsx(J,{children:i})]})})}const be=(t,n)=>t?"tls":n?"starttls":"none",Nt=t=>({host:t.imapHost,port:t.imapPort,security:be(t.imapTls,t.imapStartTls)}),St=t=>({host:t.smtpEnabled?t.smtpHost:"",port:t.smtpPort,security:be(t.smtpTls,t.smtpStartTls)}),he=(t,n,i)=>{const s=t.authType==="oauthMicrosoft"?"microsoft":"imap",d=!i&&(s==="microsoft"?t.connectionState==="reauth_required":t.connectionState==="credentials_missing");return{accountId:t.accountId,address:t.email,displayName:t.displayName?.trim()||t.email,connector:s,server:`${t.imapHost}:${t.imapPort}`,state:n?"failed":d?"needed":"entered",failure:n}},Ct=t=>{if(!t)return"This instance already holds configuration of its own.";const n=[["accounts","account"],["labels","label"],["filters","rule"],["addressFlags","flagged sender"]].map(([i,s])=>({count:Number(t[i]??0),noun:s})).filter(i=>i.count>0).map(i=>`${i.count} ${i.noun}${i.count===1?"":"s"}`);return n.length===0?"This instance already holds configuration of its own.":`${n.join(", ")} are set up here already.`},q=(t,n)=>{if(t instanceof Error)return t.message;if(typeof t=="object"&&t!==null){const i=t.message;if(typeof i=="string")return i}return n};function It({onDone:t}){const n=pe(),[i,s]=r.useState("file"),[d,l]=r.useState(!1),[h,w]=r.useState(!1),[u,p]=r.useState(void 0),[j,N]=r.useState(void 0),[R,S]=r.useState(void 0),[m,b]=r.useState(void 0),[Z,ee]=r.useState("abort"),[te,se]=r.useState(void 0),[Ne,Q]=r.useState(void 0),[C,Se]=r.useState([]),[V,Ce]=r.useState([]),[g,I]=r.useState(null),[T,G]=r.useState({username:"",password:""}),[F,K]=r.useState({}),[Ie,ne]=r.useState(void 0),[U,$]=r.useState(null),[B,Te]=r.useState([]),{data:O}=De({..._e(),enabled:C.length>0||i==="folders"}),A=r.useMemo(()=>{const a=new Map;for(const o of O?.accounts??[])a.set(o.accountId,o);return a},[O]),Re=r.useMemo(()=>C.map(a=>A.get(a)).filter(a=>!!a).map(a=>he(a,F[a.accountId],V.includes(a.accountId))),[C,A,F,V]),c=g?A.get(g):void 0,ie=g?C.indexOf(g)+1:0,P=L({...Le(),meta:de(409)}),ae=L({...qe(),meta:de(403,404)}),re=L(He()),oe=L(We());Ve(U!==null,()=>{n.invalidateQueries({queryKey:X()}),$(null)});const ce=Ge(a=>{$(null),a==="stalled"&&ne(Ye)}),Fe=r.useCallback(a=>{l(!1),w(!0),p({name:a.name,size:a.size}),S(void 0),N(void 0),a.text().then(o=>Ze(a.name,a.size,o)).then(o=>{if(w(!1),!o.ok){S(o.failure);return}N(o.document)}).catch(o=>{w(!1),S({title:"That file could not be read",explanation:`The browser could not read ${a.name} from disk, so nothing was sent.`,fix:"Check the file is still there and try again.",raw:q(o,"the file read was refused")})})},[]),D=r.useCallback((a,o)=>{j&&(Q(void 0),P.mutate({body:{mode:a,onExisting:o,document:j}},{onSuccess:v=>{if(b(v),ue(v)){s("rejected");return}if(me(v)){s("partial");return}if(a==="validate"){s("review");return}if(Te(tt(v)),n.invalidateQueries({queryKey:X()}),v.accountsNeedingCredentials.length>0){Se([...v.accountsNeedingCredentials]),s("credentials");return}s("folders")},onError:v=>{const _=et(v);if(_){Q(_),se(void 0),s("conflict");return}S({title:"The import could not be sent",explanation:"The request to this instance failed before it produced a report, so nothing was written.",fix:"Check your connection and try again.",raw:q(v,"POST /config/import failed")}),s("file")}}))},[j,P,n]),Ae=r.useCallback(a=>{if(I(a.accountId),ne(void 0),a.connector==="microsoft"){s("account-oauth");return}const o=A.get(a.accountId);G({username:o?.username||a.address,password:""}),s("account-password")},[A]),Me=r.useCallback(()=>{g&&ae.mutate({path:{accountId:g},body:{password:T.password,isActive:!0}},{onSuccess:()=>{re.mutate({path:{accountId:g}}),Ce(a=>a.includes(g)?a:[...a,g]),K(a=>{const o={...a};return delete o[g],o}),n.invalidateQueries({queryKey:X()}),G({username:"",password:""}),I(null),s("credentials")},onError:a=>{K(o=>({...o,[g]:q(a,"The password was verified but could not be stored. Try again.")})),I(null),s("credentials")}})},[g,T.password,n,re,ae]),Ee=r.useCallback(()=>{c&&($(c.accountId),oe.mutate({body:{email:c.email}},{onSuccess:a=>{ce(),window.location.assign(a.authorizationUrl)},onError:a=>{$(null),K(o=>({...o,[c.accountId]:q(a,"Microsoft sign-in could not be started.")})),I(null),s("credentials")}}))},[c,ce,oe]),ze=r.useCallback((a,o)=>G({username:a,password:o}),[]),$e=r.useMemo(()=>{const a=O?.pendingImport?.folderPaths;if(!a)return B;const o=new Set(a),v=B.filter(E=>o.has(E.path)),_=a.filter(E=>!B.some(Be=>Be.path===E)).map(E=>({path:E,waitingFor:"An imported setting"}));return[...v,..._]},[O,B]),M=r.useCallback(()=>{b(void 0),Q(void 0),S(void 0),p(void 0),N(void 0),ee("abort"),s("file")},[]);switch(i){case"file":return e.jsx(ut,{state:h?"reading":P.isPending?"checking":d?"dragging":"idle",file:u,ready:j!==void 0,failure:R,onChoose:Fe,onDragStateChange:l,onNext:()=>D("validate",Z)});case"rejected":return e.jsx(wt,{failure:(m&&ue(m))??R??{title:"The file could not be imported",explanation:"The import was refused and nothing was written.",fix:"Re-export the configuration and try again.",raw:"no error was reported"},onBack:M});case"conflict":return e.jsx(ft,{choice:te,held:Ct(Ne?.details),onChoose:se,onBack:M,onNext:()=>{if(te==="abort"){t("abandoned");return}ee("merge"),D("validate","merge")}});case"review":return e.jsx(pt,{sections:it(m?.items??[]),fileName:u?.name??"the config file",warnings:(m?.warnings??[]).map(a=>a.message),applying:P.isPending,onBack:M,onNext:()=>D("apply",Z)});case"partial":{if(!m)return e.jsx(Tt,{onBack:M});const a=me(m);return e.jsx(kt,{results:nt(m),message:a?.message??"The import stopped before it finished.",raw:`${a?.code??st}: ${a?.message??"no message"}`,nothingLanded:!m.applied,onBack:M,onNext:()=>D("apply","merge")})}case"credentials":return e.jsx(jt,{accounts:Re,busyAccountId:U??void 0,error:Ie,onOpen:Ae,onNext:()=>s("folders")});case"account-password":return c?e.jsx(Ue,{steps:y,activeStep:2,title:`Sign in to ${c.email}`,subtitle:`Account ${ie} of ${C.length} · ${c.imapHost}:${c.imapPort}`,email:c.email,username:T.username,password:T.password,error:F[c.accountId],continueLabel:"Test and continue",notice:e.jsxs("div",{className:"flex items-center gap-2 text-xs text-fg-muted",children:[e.jsx(Xe,{className:"size-3.5"}),"Server settings came from the config file — edit them in Settings if they are wrong."]}),onContinue:()=>s("account-test"),onBack:()=>{I(null),s("credentials")},onChange:ze}):e.jsx(Y,{onBack:()=>t("abandoned")});case"account-test":return c?e.jsx(Ke,{steps:y,activeStep:2,email:c.email,imapConfig:Nt(c),smtpConfig:St(c),username:T.username,password:T.password,credentialsBackLabel:"Back to the password",serversBackLabel:"Back to the password",successLabel:"Save and continue",onSuccess:Me,onBackToCredentials:()=>s("account-password"),onBackToServers:()=>s("account-password")}):e.jsx(Y,{onBack:()=>t("abandoned")});case"account-oauth":return c?e.jsx(vt,{account:he(c,F[c.accountId],V.includes(c.accountId)),position:ie,total:C.length,error:F[c.accountId],busy:U===c.accountId,onBack:()=>{I(null),s("credentials")},onNext:Ee}):e.jsx(Y,{onBack:()=>t("abandoned")});case"folders":return e.jsx(yt,{folders:$e,onNext:()=>t("imported")})}}function ke({children:t,label:n,onBack:i}){return e.jsxs("div",{className:"mx-auto max-w-lg p-6",children:[e.jsx(x,{tone:"danger",children:t}),e.jsx("button",{type:"button",className:"mt-3 text-sm text-accent underline",onClick:i,children:n})]})}function Y({onBack:t}){return e.jsx(ke,{label:"Go to inbox",onBack:t,children:"That account is no longer in this instance's configuration, so there is nothing left to sign in to. Open Settings › Accounts to see what is here."})}function Tt({onBack:t}){return e.jsx(ke,{label:"Choose another file",onBack:t,children:"The import stopped but produced no report, so nothing here can say what it wrote. Open Settings to see what this instance holds before importing again."})}function Pt(){const t=Qe(),n=pe(),i=r.useCallback(s=>{rt({queryClient:n,recordCompleted:()=>{s==="imported"&&t.recordEvent("config.imported")},navigateToInbox:()=>{window.location.assign("/mail")}})},[t,n]);return e.jsx(It,{onDone:i})}export{Pt as component};
|
|
1
|
+
import{b as H,j as e,d as x,B as f,L as W,X as Oe,r,I as Pe,e as pe,a as De,c as _e,f as L,s as de,g as Le,h as qe,i as He,m as We,k as X,l as Qe}from"./index-fsuIswbe.js";import{W as k,C as fe,a as le,u as Ve,b as Ge,c as Ke,d as Ue,S as Xe,R as Ye}from"./credential-steps-O1OzlOow.js";import{c as ge,f as Je,v as xe,r as Ze,a as et,b as ue,w as me,p as tt,W as st,s as nt,g as it}from"./config-import-VTZQj3gU.js";import{F as at}from"./file-braces-BN8-S---.js";import{B as z}from"./badge-BB80tGxy.js";import{c as rt}from"./onboarding-completion-qKzJSmsI.js";import"./select-TYdrgtW5.js";import"./chevron-down-De4wQzka.js";import"./card-CLJYKox8.js";const je={name:"folder-clock",size:24,node:[["path",{d:"M16 14v2.2l1.6 1",key:"fo4ql5"}],["path",{d:"M7 20H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2",key:"1urifu"}],["circle",{cx:"16",cy:"16",r:"6",key:"qoo3c4"}]]};je.node;const ot=H(je);const ve={name:"key-round",size:24,node:[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z",key:"1s6t7t"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]]};ve.node;const ct=H(ve);const ye={name:"merge",size:24,node:[["path",{d:"m8 6 4-4 4 4",key:"ybng9g"}],["path",{d:"M12 2v10.3a4 4 0 0 1-1.172 2.872L4 22",key:"1hyw0i"}],["path",{d:"m20 22-5-5",key:"1m27yz"}]]};ye.node;const dt=H(ye);const we={name:"upload",size:24,node:[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]]};we.node;const lt=H(we),y=["File","Review","Credentials","Folders"];function J({children:t}){return e.jsx("code",{className:"block rounded bg-surface-sunken px-2.5 py-2 text-2xs text-fg-muted",children:t})}function ut({state:t="idle",file:n,ready:i=!1,failure:s,onChoose:d,onDragStateChange:l,onNext:h}){const w=r.useId(),u=r.useRef(null),p=t==="dragging",j=t==="reading",N=t==="checking",R=j||N,S=m=>{m.preventDefault(),l?.(!1);const b=m.dataTransfer.files.item(0);b&&d?.(b)};return e.jsx(k,{steps:y,activeStep:0,title:"Import a config file",subtitle:"Accounts, folder roles, rules, senders and appearance — everything except passwords.",footer:e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"text-2xs text-fg-subtle",children:"Nothing is written until you have seen what will change."}),e.jsx(f,{variant:"primary",disabled:R||!i,icon:R?e.jsx(W,{className:"size-3.5 animate-spin"}):void 0,onClick:h,children:j?"Reading…":N?"Checking…":"Check the file"})]}),children:e.jsxs("div",{className:"space-y-4",children:[s&&e.jsxs("div",{className:"space-y-2",children:[e.jsx(x,{tone:"danger",children:s.title}),e.jsx("p",{className:"text-sm text-fg",children:s.explanation}),e.jsx("p",{className:"text-sm text-fg-muted",children:s.fix}),e.jsx(J,{children:s.raw})]}),e.jsxs("div",{onDragOver:m=>{m.preventDefault(),l?.(!0)},onDragLeave:()=>l?.(!1),onDrop:S,className:p?"flex flex-col items-center gap-3 rounded-sm border-2 border-dashed border-accent bg-accent-soft px-4 py-9 text-center":"flex flex-col items-center gap-3 rounded-sm border-2 border-dashed border-line px-4 py-9 text-center",children:[e.jsx("span",{className:"flex size-11 items-center justify-center rounded-md bg-surface-sunken",children:e.jsx(lt,{className:"size-5 text-fg-muted"})}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium text-fg",children:p?"Drop it here":"Drop a config file here, or choose one"}),e.jsx("p",{className:"mt-1 text-xs text-fg-subtle",children:"A .json file written by Reader — up to 2 MB."})]}),e.jsx("input",{ref:u,id:w,type:"file",accept:"application/json,.json",className:"sr-only",onChange:m=>{const b=m.target.files?.item(0);b&&d?.(b)}}),e.jsx(f,{variant:"secondary",size:"sm",onClick:()=>u.current?.click(),children:"Choose file"})]}),n&&e.jsxs("div",{className:"flex items-start gap-3 rounded-sm border border-line px-3 py-2.5",children:[e.jsx(at,{className:"mt-0.5 size-4 shrink-0 text-fg-muted"}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("p",{className:"truncate text-sm text-fg",children:n.name}),e.jsxs("p",{className:"mt-0.5 text-xs text-fg-subtle",children:[Je(n.size)," ·"," ",j?"reading it from disk":N?"checking it against this instance":i?"ready to check — nothing has been sent yet":"not a configuration this instance can read"]})]})]}),e.jsxs("p",{className:"text-2xs text-fg-subtle",children:["Export one from Settings → Advanced on the instance you are moving from, or run"," ",e.jsx("code",{className:"rounded bg-surface-sunken px-1 py-0.5",children:"remit config save"})," ","on its host."]})]})})}function mt({sections:t}){const n=ge(t.flatMap(i=>i.entries.map(s=>({section:i.id,key:s.label,verdict:s.verdict}))));return e.jsx("div",{className:"flex flex-wrap gap-1.5",children:["created","updated","unchanged","skipped","rejected"].filter(i=>n[i]>0).map(i=>e.jsxs(z,{tone:xe[i],dot:!0,children:[n[i]," ",i]},i))})}function ht({section:t}){return e.jsxs("section",{children:[e.jsx("h2",{className:"text-sm font-semibold text-fg",children:t.title}),e.jsx("ul",{className:"mt-1.5 divide-y divide-line",children:t.entries.map(n=>e.jsxs("li",{className:"flex items-start gap-3 py-2",children:[e.jsx(z,{tone:xe[n.verdict],className:"mt-0.5 shrink-0",children:n.verdict}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("p",{className:"text-sm text-fg",children:n.label}),n.reason&&e.jsx("p",{className:n.verdict==="rejected"?"mt-1 text-xs text-danger":"mt-1 text-xs text-warning",children:n.reason})]})]},n.id))})]})}function pt({sections:t,fileName:n,warnings:i=[],applying:s=!1,onBack:d,onNext:l}){const h=ge(t.flatMap(p=>p.entries.map(j=>({section:p.id,key:j.label,verdict:j.verdict})))),w=h.created+h.updated,u=h.skipped+h.rejected;return e.jsx(k,{steps:y,activeStep:1,title:"What this file will change",subtitle:`${n} · nothing has been written yet.`,footer:e.jsxs(e.Fragment,{children:[e.jsx(f,{variant:"ghost",onClick:d,children:"Choose another file"}),e.jsx(f,{variant:"primary",disabled:s,icon:s?e.jsx(W,{className:"size-3.5 animate-spin"}):void 0,onClick:l,children:s?"Importing…":`Import ${w} changes`})]}),children:e.jsxs("div",{className:"space-y-5",children:[e.jsx(mt,{sections:t}),u>0&&e.jsxs(x,{tone:"warning",children:[u," entries will not be imported. Each says why below — read them before you continue, because nothing here retries on its own."]}),i.length>0&&e.jsx("ul",{className:"space-y-1 text-xs text-warning",children:i.map(p=>e.jsx("li",{children:p},p))}),t.map(p=>e.jsx(ht,{section:p},p.id))]})})}function ft({choice:t,held:n,onChoose:i,onBack:s,onNext:d}){return e.jsx(k,{steps:y,activeStep:1,title:"This instance already has configuration",subtitle:n,footer:e.jsxs(e.Fragment,{children:[e.jsx(f,{variant:"ghost",onClick:s,children:"Choose another file"}),e.jsx(f,{variant:"primary",disabled:!t,onClick:d,children:t==="merge"?"Continue with merge":"Continue"})]}),children:e.jsxs("div",{className:"space-y-4",children:[e.jsx(x,{tone:"warning",children:"An import into a configured instance can only add and update — it never deletes what is here. Pick how the two should meet."}),e.jsxs("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2",children:[e.jsx(le,{name:"Stop, keep this instance",description:"Nothing is written. Use this if you meant to import into a fresh instance.",icon:e.jsx(Oe,{className:"size-5"}),selected:t==="abort",onSelect:()=>i?.("abort")}),e.jsx(le,{name:"Merge the file in",description:"Adds what is missing and updates what differs. Existing accounts keep their server settings.",icon:e.jsx(dt,{className:"size-5"}),selected:t==="merge",onSelect:()=>i?.("merge")})]}),t==="merge"&&e.jsx("p",{className:"text-xs text-fg-muted",children:"The next screen lists every add and update before anything is written."})]})})}function gt(t){return t==="entered"?e.jsx(z,{tone:"positive",children:"ready"}):t==="failed"?e.jsx(z,{tone:"danger",children:"sign-in failed"}):e.jsx(z,{tone:"danger",children:"credentials needed"})}function xt({accounts:t,busyAccountId:n,onOpen:i}){return e.jsx("ul",{className:"divide-y divide-line",children:t.map(s=>e.jsxs("li",{className:s.state==="entered"?"flex flex-wrap items-start justify-between gap-3 py-3":"flex flex-wrap items-start justify-between gap-3 border-l-2 border-danger bg-danger-soft py-3 pl-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx("span",{className:"text-sm font-medium text-fg",children:s.address}),gt(s.state)]}),e.jsxs("p",{className:"mt-0.5 text-xs text-fg-subtle",children:[s.displayName," ·"," ",s.connector==="microsoft"?"Microsoft 365":"IMAP / SMTP"," ","· ",s.server]}),s.state!=="entered"&&e.jsx("p",{className:"mt-1 text-xs text-danger",children:s.failure??(s.connector==="microsoft"?"Config files never carry OAuth tokens. Reconnect with Microsoft to start syncing this account.":"Config files never carry passwords. Enter this mailbox's password to start syncing.")})]}),s.state!=="entered"&&e.jsx(f,{variant:"primary",size:"sm",disabled:n===s.accountId,icon:n===s.accountId?e.jsx(W,{className:"size-3.5 animate-spin"}):s.connector==="microsoft"?e.jsx(Pe,{className:"size-3.5"}):e.jsx(ct,{className:"size-3.5"}),onClick:()=>i?.(s),children:n===s.accountId?"Redirecting…":s.connector==="microsoft"?"Reconnect":s.state==="failed"?"Try again":"Enter password"})]},s.accountId))})}function jt({accounts:t,busyAccountId:n,error:i,onOpen:s,onNext:d}){const l=t.filter(h=>h.state!=="entered").length;return e.jsx(k,{steps:y,activeStep:2,title:"These accounts need credentials",subtitle:"The config file carries servers and settings. Passwords and Microsoft sign-ins it deliberately leaves out.",footer:e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"text-2xs text-fg-subtle",children:l>0?"Settings › Accounts keeps asking until every account is signed in.":"Every account can sync."}),e.jsx(f,{variant:"primary",onClick:d,children:l>0?"Finish later":"All accounts connected"})]}),children:e.jsxs("div",{className:"space-y-4",children:[i&&e.jsx(x,{tone:"danger",children:i}),l>0&&e.jsxs(x,{tone:"danger",children:[l," of ",t.length," accounts cannot sync yet. They stay listed in Settings, marked like this, until you sign in — no mail arrives for them in the meantime."]}),e.jsx(xt,{accounts:t,busyAccountId:n,onOpen:s})]})})}function vt({account:t,position:n,total:i,error:s,busy:d=!1,onBack:l,onNext:h}){return e.jsx(k,{steps:y,activeStep:2,title:`Reconnect ${t.address}`,subtitle:`Account ${n} of ${i} · Microsoft 365`,footer:e.jsxs(e.Fragment,{children:[e.jsx(f,{variant:"ghost",onClick:l,children:"Back"}),e.jsx(f,{variant:"primary",disabled:d,icon:d?e.jsx(W,{className:"size-3.5 animate-spin"}):void 0,onClick:h,children:d?"Redirecting…":"Sign in with Microsoft"})]}),children:e.jsxs("div",{className:"space-y-4",children:[s&&e.jsx(x,{tone:"danger",children:s}),e.jsx(x,{tone:"info",children:"A config file never carries an OAuth token — one only works for the instance it was granted to. Signing in here mints a fresh one for this instance."}),e.jsxs("div",{className:"rounded-sm border border-line px-3 py-2.5",children:[e.jsx("p",{className:"text-sm text-fg",children:t.displayName}),e.jsxs("p",{className:"mt-0.5 text-xs text-fg-subtle",children:[t.address," · ",t.server]})]}),e.jsx("p",{className:"text-2xs text-fg-subtle",children:"You will be sent to Microsoft and returned here. If your organisation requires admin approval, the sign-in stops there and this account keeps waiting."})]})})}function yt({folders:t,onNext:n}){return e.jsx(k,{steps:y,activeStep:3,title:t.length>0?"Creating folders":"Import finished",subtitle:t.length>0?"The config names folders this account does not have yet. Reader creates them on the mail server.":"Everything in the file landed, and every folder it named resolved.",footer:e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"text-2xs text-fg-subtle",children:"Folder discovery runs with every sync."}),e.jsx(f,{variant:"primary",onClick:n,children:"Go to inbox"})]}),children:e.jsx("div",{className:"space-y-4",children:t.length>0?e.jsxs(e.Fragment,{children:[e.jsxs(x,{tone:"warning",children:[t.length," settings are imported but switched off. Reader creates each missing folder on the mail server the next time the account syncs, and turns the setting on once the server confirms it. A rule whose folder cannot be created stays off, and Settings → Filters says why."]}),e.jsxs("div",{className:"flex items-center gap-2 text-xs text-fg-muted",children:[e.jsx(ot,{className:"size-4"}),"Folder discovery runs with every sync of the account."]}),e.jsx("div",{className:"divide-y divide-line",children:t.map(i=>e.jsx(fe,{label:i.path,detail:i.waitingFor,state:"pending"},`${i.accountId??""}-${i.path}-${i.waitingFor}`))})]}):e.jsx(x,{tone:"success",children:"Every account, rule, label and sender in the file is live on this instance."})})})}function wt({failure:t,onBack:n}){return e.jsx(k,{steps:y,activeStep:0,title:t.title,subtitle:"Nothing was imported.",footer:e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"text-2xs text-fg-subtle",children:"This instance is unchanged."}),e.jsx(f,{variant:"primary",onClick:n,children:"Choose another file"})]}),children:e.jsxs("div",{className:"space-y-3",children:[e.jsx(x,{tone:"danger",children:t.explanation}),e.jsx("p",{className:"text-sm text-fg",children:t.fix}),e.jsx(J,{children:t.raw})]})})}function bt(t){return t==="landed"?"ok":t==="failed"||t==="unknown"?"failed":"pending"}function kt({results:t,message:n,raw:i,nothingLanded:s,onBack:d,onNext:l}){const h=t.filter(u=>u.state==="landed").length,w=t.some(u=>u.state==="unknown");return e.jsx(k,{steps:y,activeStep:1,title:s?"The import stopped, and nothing landed":"The import stopped part-way",subtitle:s?"No section of the file was written.":w?"It did not say how far it got, so check Settings before importing again.":`${h} of ${t.length} sections landed.`,footer:e.jsxs(e.Fragment,{children:[e.jsx(f,{variant:"ghost",onClick:d,children:"Choose another file"}),e.jsx(f,{variant:"primary",onClick:l,children:s?"Try the import again":"Retry the rest"})]}),children:e.jsxs("div",{className:"space-y-4",children:[e.jsx(x,{tone:"danger",children:n}),e.jsx("p",{className:"text-sm text-fg-muted",children:"Retrying is safe: an import folds into what is already here rather than replacing it, so what landed is recognised and left alone."}),e.jsx("div",{className:"divide-y divide-line",children:t.map(u=>e.jsx(fe,{label:u.title,detail:u.detail,state:bt(u.state)},u.section))}),e.jsx(J,{children:i})]})})}const be=(t,n)=>t?"tls":n?"starttls":"none",Nt=t=>({host:t.imapHost,port:t.imapPort,security:be(t.imapTls,t.imapStartTls)}),St=t=>({host:t.smtpEnabled?t.smtpHost:"",port:t.smtpPort,security:be(t.smtpTls,t.smtpStartTls)}),he=(t,n,i)=>{const s=t.authType==="oauthMicrosoft"?"microsoft":"imap",d=!i&&(s==="microsoft"?t.connectionState==="reauth_required":t.connectionState==="credentials_missing");return{accountId:t.accountId,address:t.email,displayName:t.displayName?.trim()||t.email,connector:s,server:`${t.imapHost}:${t.imapPort}`,state:n?"failed":d?"needed":"entered",failure:n}},Ct=t=>{if(!t)return"This instance already holds configuration of its own.";const n=[["accounts","account"],["labels","label"],["filters","rule"],["addressFlags","flagged sender"]].map(([i,s])=>({count:Number(t[i]??0),noun:s})).filter(i=>i.count>0).map(i=>`${i.count} ${i.noun}${i.count===1?"":"s"}`);return n.length===0?"This instance already holds configuration of its own.":`${n.join(", ")} are set up here already.`},q=(t,n)=>{if(t instanceof Error)return t.message;if(typeof t=="object"&&t!==null){const i=t.message;if(typeof i=="string")return i}return n};function It({onDone:t}){const n=pe(),[i,s]=r.useState("file"),[d,l]=r.useState(!1),[h,w]=r.useState(!1),[u,p]=r.useState(void 0),[j,N]=r.useState(void 0),[R,S]=r.useState(void 0),[m,b]=r.useState(void 0),[Z,ee]=r.useState("abort"),[te,se]=r.useState(void 0),[Ne,Q]=r.useState(void 0),[C,Se]=r.useState([]),[V,Ce]=r.useState([]),[g,I]=r.useState(null),[T,G]=r.useState({username:"",password:""}),[F,K]=r.useState({}),[Ie,ne]=r.useState(void 0),[U,$]=r.useState(null),[B,Te]=r.useState([]),{data:O}=De({..._e(),enabled:C.length>0||i==="folders"}),A=r.useMemo(()=>{const a=new Map;for(const o of O?.accounts??[])a.set(o.accountId,o);return a},[O]),Re=r.useMemo(()=>C.map(a=>A.get(a)).filter(a=>!!a).map(a=>he(a,F[a.accountId],V.includes(a.accountId))),[C,A,F,V]),c=g?A.get(g):void 0,ie=g?C.indexOf(g)+1:0,P=L({...Le(),meta:de(409)}),ae=L({...qe(),meta:de(403,404)}),re=L(He()),oe=L(We());Ve(U!==null,()=>{n.invalidateQueries({queryKey:X()}),$(null)});const ce=Ge(a=>{$(null),a==="stalled"&&ne(Ye)}),Fe=r.useCallback(a=>{l(!1),w(!0),p({name:a.name,size:a.size}),S(void 0),N(void 0),a.text().then(o=>Ze(a.name,a.size,o)).then(o=>{if(w(!1),!o.ok){S(o.failure);return}N(o.document)}).catch(o=>{w(!1),S({title:"That file could not be read",explanation:`The browser could not read ${a.name} from disk, so nothing was sent.`,fix:"Check the file is still there and try again.",raw:q(o,"the file read was refused")})})},[]),D=r.useCallback((a,o)=>{j&&(Q(void 0),P.mutate({body:{mode:a,onExisting:o,document:j}},{onSuccess:v=>{if(b(v),ue(v)){s("rejected");return}if(me(v)){s("partial");return}if(a==="validate"){s("review");return}if(Te(tt(v)),n.invalidateQueries({queryKey:X()}),v.accountsNeedingCredentials.length>0){Se([...v.accountsNeedingCredentials]),s("credentials");return}s("folders")},onError:v=>{const _=et(v);if(_){Q(_),se(void 0),s("conflict");return}S({title:"The import could not be sent",explanation:"The request to this instance failed before it produced a report, so nothing was written.",fix:"Check your connection and try again.",raw:q(v,"POST /config/import failed")}),s("file")}}))},[j,P,n]),Ae=r.useCallback(a=>{if(I(a.accountId),ne(void 0),a.connector==="microsoft"){s("account-oauth");return}const o=A.get(a.accountId);G({username:o?.username||a.address,password:""}),s("account-password")},[A]),Me=r.useCallback(()=>{g&&ae.mutate({path:{accountId:g},body:{password:T.password,isActive:!0}},{onSuccess:()=>{re.mutate({path:{accountId:g}}),Ce(a=>a.includes(g)?a:[...a,g]),K(a=>{const o={...a};return delete o[g],o}),n.invalidateQueries({queryKey:X()}),G({username:"",password:""}),I(null),s("credentials")},onError:a=>{K(o=>({...o,[g]:q(a,"The password was verified but could not be stored. Try again.")})),I(null),s("credentials")}})},[g,T.password,n,re,ae]),Ee=r.useCallback(()=>{c&&($(c.accountId),oe.mutate({body:{email:c.email}},{onSuccess:a=>{ce(),window.location.assign(a.authorizationUrl)},onError:a=>{$(null),K(o=>({...o,[c.accountId]:q(a,"Microsoft sign-in could not be started.")})),I(null),s("credentials")}}))},[c,ce,oe]),ze=r.useCallback((a,o)=>G({username:a,password:o}),[]),$e=r.useMemo(()=>{const a=O?.pendingImport?.folderPaths;if(!a)return B;const o=new Set(a),v=B.filter(E=>o.has(E.path)),_=a.filter(E=>!B.some(Be=>Be.path===E)).map(E=>({path:E,waitingFor:"An imported setting"}));return[...v,..._]},[O,B]),M=r.useCallback(()=>{b(void 0),Q(void 0),S(void 0),p(void 0),N(void 0),ee("abort"),s("file")},[]);switch(i){case"file":return e.jsx(ut,{state:h?"reading":P.isPending?"checking":d?"dragging":"idle",file:u,ready:j!==void 0,failure:R,onChoose:Fe,onDragStateChange:l,onNext:()=>D("validate",Z)});case"rejected":return e.jsx(wt,{failure:(m&&ue(m))??R??{title:"The file could not be imported",explanation:"The import was refused and nothing was written.",fix:"Re-export the configuration and try again.",raw:"no error was reported"},onBack:M});case"conflict":return e.jsx(ft,{choice:te,held:Ct(Ne?.details),onChoose:se,onBack:M,onNext:()=>{if(te==="abort"){t("abandoned");return}ee("merge"),D("validate","merge")}});case"review":return e.jsx(pt,{sections:it(m?.items??[]),fileName:u?.name??"the config file",warnings:(m?.warnings??[]).map(a=>a.message),applying:P.isPending,onBack:M,onNext:()=>D("apply",Z)});case"partial":{if(!m)return e.jsx(Tt,{onBack:M});const a=me(m);return e.jsx(kt,{results:nt(m),message:a?.message??"The import stopped before it finished.",raw:`${a?.code??st}: ${a?.message??"no message"}`,nothingLanded:!m.applied,onBack:M,onNext:()=>D("apply","merge")})}case"credentials":return e.jsx(jt,{accounts:Re,busyAccountId:U??void 0,error:Ie,onOpen:Ae,onNext:()=>s("folders")});case"account-password":return c?e.jsx(Ue,{steps:y,activeStep:2,title:`Sign in to ${c.email}`,subtitle:`Account ${ie} of ${C.length} · ${c.imapHost}:${c.imapPort}`,email:c.email,username:T.username,password:T.password,error:F[c.accountId],continueLabel:"Test and continue",notice:e.jsxs("div",{className:"flex items-center gap-2 text-xs text-fg-muted",children:[e.jsx(Xe,{className:"size-3.5"}),"Server settings came from the config file — edit them in Settings if they are wrong."]}),onContinue:()=>s("account-test"),onBack:()=>{I(null),s("credentials")},onChange:ze}):e.jsx(Y,{onBack:()=>t("abandoned")});case"account-test":return c?e.jsx(Ke,{steps:y,activeStep:2,email:c.email,imapConfig:Nt(c),smtpConfig:St(c),username:T.username,password:T.password,credentialsBackLabel:"Back to the password",serversBackLabel:"Back to the password",successLabel:"Save and continue",onSuccess:Me,onBackToCredentials:()=>s("account-password"),onBackToServers:()=>s("account-password")}):e.jsx(Y,{onBack:()=>t("abandoned")});case"account-oauth":return c?e.jsx(vt,{account:he(c,F[c.accountId],V.includes(c.accountId)),position:ie,total:C.length,error:F[c.accountId],busy:U===c.accountId,onBack:()=>{I(null),s("credentials")},onNext:Ee}):e.jsx(Y,{onBack:()=>t("abandoned")});case"folders":return e.jsx(yt,{folders:$e,onNext:()=>t("imported")})}}function ke({children:t,label:n,onBack:i}){return e.jsxs("div",{className:"mx-auto max-w-lg p-6",children:[e.jsx(x,{tone:"danger",children:t}),e.jsx("button",{type:"button",className:"mt-3 text-sm text-accent underline",onClick:i,children:n})]})}function Y({onBack:t}){return e.jsx(ke,{label:"Go to inbox",onBack:t,children:"That account is no longer in this instance's configuration, so there is nothing left to sign in to. Open Settings › Accounts to see what is here."})}function Tt({onBack:t}){return e.jsx(ke,{label:"Choose another file",onBack:t,children:"The import stopped but produced no report, so nothing here can say what it wrote. Open Settings to see what this instance holds before importing again."})}function Pt(){const t=Qe(),n=pe(),i=r.useCallback(s=>{rt({queryClient:n,recordCompleted:()=>{s==="imported"&&t.recordEvent("config.imported")},navigateToInbox:()=>{window.location.assign("/mail")}})},[t,n]);return e.jsx(It,{onDone:i})}export{Pt as component};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as o}from"./index-fsuIswbe.js";import{O as t}from"./OutboxPane-B6UfixBP.js";import"./MessageBody-jG4Dhul6.js";import"./kbd-jzPSd-a2.js";import"./search-scope-B-3MTDpD.js";import"./app-chrome-BfyGOiSA.js";import"./nav-link-ed0mFCCx.js";import"./useMediaQuery-Hy81MQ2M.js";import"./reply-CXuSMyqp.js";import"./useMessageBodyContent-CpTD2HGg.js";import"./outbox-status-BlKn6P0x.js";import"./NavMenuButton-CLp6InRG.js";import"./menu-Bh94jr77.js";import"./roving-focus-DZX7IpN4.js";import"./circle-check-big-CMsxQSjY.js";import"./clock-Dds4zv6u.js";import"./row-actions-BDfQKXdD.js";import"./rotate-ccw-hQhPZwrx.js";function P(){return o.jsx(t.Reading,{})}export{P as component};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as o}from"./index-fsuIswbe.js";import{C as t}from"./CollectionPane-BzktgIp0.js";import"./useCollectionThreads-DgofDKen.js";import"./useQueries-DPH-PeHV.js";import"./useInfiniteQuery-B-vOuANs.js";import"./MessageToolbar-DeDUhCvg.js";import"./MessageBody-jG4Dhul6.js";import"./kbd-jzPSd-a2.js";import"./search-scope-B-3MTDpD.js";import"./app-chrome-BfyGOiSA.js";import"./nav-link-ed0mFCCx.js";import"./useMediaQuery-Hy81MQ2M.js";import"./reply-CXuSMyqp.js";import"./useMessageBodyContent-CpTD2HGg.js";import"./roving-focus-DZX7IpN4.js";import"./chevron-down-De4wQzka.js";import"./search-token-index-BYKMNlJD.js";import"./useLabels-k1VKuQrr.js";import"./index-Caon2n2j.js";import"./useSignature-W9HBbZ_n.js";import"./account-form-helpers-DhckT_PN.js";import"./useDebouncedValue-CFZ4EPXW.js";import"./suggest-list-BCqr1j26.js";import"./sections-DpRVKuXF.js";import"./useJunkMailboxIds-CW7aI25D.js";import"./badge-BB80tGxy.js";import"./undo-2-D1IMLq7c.js";import"./DropdownMenu-C2J8u8zN.js";import"./refresh-cw-Cu9_I3cT.js";import"./popover-menu-DhcuKv1N.js";import"./ErrorState-BTHOmsYP.js";import"./mail-BzFJWQZy.js";import"./download-DEuAIIIQ.js";import"./avatar-Bq7beWCy.js";import"./EmptyState-BJU14tbt.js";import"./circle-question-mark-DhNa_A16.js";import"./useFilters-DHWZEIQe.js";import"./select-TYdrgtW5.js";import"./plus-D5-2sA5v.js";import"./calendar-suggestion-EosZrXZC.js";import"./useCalendarSuggestions-DXbA0boT.js";import"./agenda-time-D0yU-H44.js";import"./calendar-format-BwCpz-JZ.js";import"./calendar-Ds9kgvU8.js";import"./calendar-failure-note-C4gNXDQV.js";import"./checkbox-CYOm-zGr.js";import"./clock-Dds4zv6u.js";import"./segmented-control-BwvsufVp.js";import"./useLayoutTier-BNUKvwJD.js";import"./menu-Bh94jr77.js";import"./folder-input-B0q8wLhf.js";import"./confirm-dialog-XvccFJdE.js";import"./label-chip-DtBVyALF.js";import"./cloud-off-BYulqayx.js";import"./MailViewChrome-CLgaFbe-.js";import"./wizard-selection-zWa1qc6-.js";function mo(){return o.jsx(t.Reading,{})}export{mo as component};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as o}from"./index-fsuIswbe.js";import{M as r}from"./MailboxPane-BxNCkl6s.js";import"./useInfiniteQuery-B-vOuANs.js";import"./MessageToolbar-DeDUhCvg.js";import"./MessageBody-jG4Dhul6.js";import"./kbd-jzPSd-a2.js";import"./search-scope-B-3MTDpD.js";import"./app-chrome-BfyGOiSA.js";import"./nav-link-ed0mFCCx.js";import"./useMediaQuery-Hy81MQ2M.js";import"./reply-CXuSMyqp.js";import"./useMessageBodyContent-CpTD2HGg.js";import"./roving-focus-DZX7IpN4.js";import"./chevron-down-De4wQzka.js";import"./search-token-index-BYKMNlJD.js";import"./useQueries-DPH-PeHV.js";import"./useLabels-k1VKuQrr.js";import"./index-Caon2n2j.js";import"./useSignature-W9HBbZ_n.js";import"./account-form-helpers-DhckT_PN.js";import"./useDebouncedValue-CFZ4EPXW.js";import"./suggest-list-BCqr1j26.js";import"./sections-DpRVKuXF.js";import"./useJunkMailboxIds-CW7aI25D.js";import"./badge-BB80tGxy.js";import"./undo-2-D1IMLq7c.js";import"./DropdownMenu-C2J8u8zN.js";import"./refresh-cw-Cu9_I3cT.js";import"./popover-menu-DhcuKv1N.js";import"./ErrorState-BTHOmsYP.js";import"./mail-BzFJWQZy.js";import"./download-DEuAIIIQ.js";import"./avatar-Bq7beWCy.js";import"./EmptyState-BJU14tbt.js";import"./circle-question-mark-DhNa_A16.js";import"./useFilters-DHWZEIQe.js";import"./select-TYdrgtW5.js";import"./plus-D5-2sA5v.js";import"./calendar-suggestion-EosZrXZC.js";import"./useCalendarSuggestions-DXbA0boT.js";import"./agenda-time-D0yU-H44.js";import"./calendar-format-BwCpz-JZ.js";import"./calendar-Ds9kgvU8.js";import"./calendar-failure-note-C4gNXDQV.js";import"./checkbox-CYOm-zGr.js";import"./clock-Dds4zv6u.js";import"./segmented-control-BwvsufVp.js";import"./useLayoutTier-BNUKvwJD.js";import"./menu-Bh94jr77.js";import"./folder-input-B0q8wLhf.js";import"./confirm-dialog-XvccFJdE.js";import"./label-chip-DtBVyALF.js";import"./cloud-off-BYulqayx.js";import"./useRefreshControl-DdbTrGxq.js";import"./circle-check-big-CMsxQSjY.js";import"./LabelApplyTrigger-P8IoLKME.js";import"./MailViewChrome-CLgaFbe-.js";import"./NavMenuButton-CLp6InRG.js";import"./shield-check-C-tOrPEx.js";import"./bottom-sheet-DKF_Dkid.js";import"./circle-check-DlR8I4Hf.js";function so(){return o.jsx(r.Reading,{})}export{so as component};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as o}from"./index-fsuIswbe.js";import{C as t}from"./CollectionPane-BzktgIp0.js";import"./useCollectionThreads-DgofDKen.js";import"./useQueries-DPH-PeHV.js";import"./useInfiniteQuery-B-vOuANs.js";import"./MessageToolbar-DeDUhCvg.js";import"./MessageBody-jG4Dhul6.js";import"./kbd-jzPSd-a2.js";import"./search-scope-B-3MTDpD.js";import"./app-chrome-BfyGOiSA.js";import"./nav-link-ed0mFCCx.js";import"./useMediaQuery-Hy81MQ2M.js";import"./reply-CXuSMyqp.js";import"./useMessageBodyContent-CpTD2HGg.js";import"./roving-focus-DZX7IpN4.js";import"./chevron-down-De4wQzka.js";import"./search-token-index-BYKMNlJD.js";import"./useLabels-k1VKuQrr.js";import"./index-Caon2n2j.js";import"./useSignature-W9HBbZ_n.js";import"./account-form-helpers-DhckT_PN.js";import"./useDebouncedValue-CFZ4EPXW.js";import"./suggest-list-BCqr1j26.js";import"./sections-DpRVKuXF.js";import"./useJunkMailboxIds-CW7aI25D.js";import"./badge-BB80tGxy.js";import"./undo-2-D1IMLq7c.js";import"./DropdownMenu-C2J8u8zN.js";import"./refresh-cw-Cu9_I3cT.js";import"./popover-menu-DhcuKv1N.js";import"./ErrorState-BTHOmsYP.js";import"./mail-BzFJWQZy.js";import"./download-DEuAIIIQ.js";import"./avatar-Bq7beWCy.js";import"./EmptyState-BJU14tbt.js";import"./circle-question-mark-DhNa_A16.js";import"./useFilters-DHWZEIQe.js";import"./select-TYdrgtW5.js";import"./plus-D5-2sA5v.js";import"./calendar-suggestion-EosZrXZC.js";import"./useCalendarSuggestions-DXbA0boT.js";import"./agenda-time-D0yU-H44.js";import"./calendar-format-BwCpz-JZ.js";import"./calendar-Ds9kgvU8.js";import"./calendar-failure-note-C4gNXDQV.js";import"./checkbox-CYOm-zGr.js";import"./clock-Dds4zv6u.js";import"./segmented-control-BwvsufVp.js";import"./useLayoutTier-BNUKvwJD.js";import"./menu-Bh94jr77.js";import"./folder-input-B0q8wLhf.js";import"./confirm-dialog-XvccFJdE.js";import"./label-chip-DtBVyALF.js";import"./cloud-off-BYulqayx.js";import"./MailViewChrome-CLgaFbe-.js";import"./wizard-selection-zWa1qc6-.js";function mo(){return o.jsx(t.Reading,{})}export{mo as component};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as r}from"./index-fsuIswbe.js";import{B as o}from"./BriefPane-BQx5RRpb.js";import"./MessageToolbar-DeDUhCvg.js";import"./MessageBody-jG4Dhul6.js";import"./kbd-jzPSd-a2.js";import"./search-scope-B-3MTDpD.js";import"./app-chrome-BfyGOiSA.js";import"./nav-link-ed0mFCCx.js";import"./useMediaQuery-Hy81MQ2M.js";import"./reply-CXuSMyqp.js";import"./useMessageBodyContent-CpTD2HGg.js";import"./roving-focus-DZX7IpN4.js";import"./chevron-down-De4wQzka.js";import"./search-token-index-BYKMNlJD.js";import"./useQueries-DPH-PeHV.js";import"./useLabels-k1VKuQrr.js";import"./index-Caon2n2j.js";import"./useSignature-W9HBbZ_n.js";import"./account-form-helpers-DhckT_PN.js";import"./useDebouncedValue-CFZ4EPXW.js";import"./suggest-list-BCqr1j26.js";import"./sections-DpRVKuXF.js";import"./useJunkMailboxIds-CW7aI25D.js";import"./badge-BB80tGxy.js";import"./undo-2-D1IMLq7c.js";import"./DropdownMenu-C2J8u8zN.js";import"./refresh-cw-Cu9_I3cT.js";import"./popover-menu-DhcuKv1N.js";import"./ErrorState-BTHOmsYP.js";import"./mail-BzFJWQZy.js";import"./download-DEuAIIIQ.js";import"./avatar-Bq7beWCy.js";import"./EmptyState-BJU14tbt.js";import"./circle-question-mark-DhNa_A16.js";import"./useFilters-DHWZEIQe.js";import"./select-TYdrgtW5.js";import"./plus-D5-2sA5v.js";import"./calendar-suggestion-EosZrXZC.js";import"./useCalendarSuggestions-DXbA0boT.js";import"./agenda-time-D0yU-H44.js";import"./calendar-format-BwCpz-JZ.js";import"./calendar-Ds9kgvU8.js";import"./calendar-failure-note-C4gNXDQV.js";import"./checkbox-CYOm-zGr.js";import"./clock-Dds4zv6u.js";import"./segmented-control-BwvsufVp.js";import"./useLayoutTier-BNUKvwJD.js";import"./menu-Bh94jr77.js";import"./folder-input-B0q8wLhf.js";import"./confirm-dialog-XvccFJdE.js";import"./label-chip-DtBVyALF.js";import"./cloud-off-BYulqayx.js";import"./LabelApplyTrigger-P8IoLKME.js";import"./useRefreshControl-DdbTrGxq.js";import"./circle-check-big-CMsxQSjY.js";import"./wizard-selection-zWa1qc6-.js";function mr(){return r.jsx(o.Reading,{})}export{mr as component};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/rich-text-spellcheck-worker-provider-
|
|
2
|
-
import{b as vr,j as d,X as gr,p as ln,B as un,L as yr,z as Bo,T as Uo,r as s,y as Ho,d as wr,ag as zo,x as Wo,cx as wn,ci as br,cy as xe,cz as Er,cA as Vo,cB as qo,cC as Se,f as _e,aB as Me,cD as Ko,cE as Yo,cF as xr,cG as Go,az as Sr,aA as Rr,aa as Xo,e as Cr,cH as Qo,Z as Zo,a as At,bS as Jo,cI as Tr,c9 as ea,bU as ta,c as Ar,cJ as na,an as ra,cK as _n,a_ as Mn,cL as oa,ao as aa,cM as sa,cN as ia,aj as R}from"./index-yeSesYv-.js";import{p as ca,c as la,b as ua}from"./useMessageBodyContent-BxjoKGiE.js";import{w as da,u as fa,a as ma,d as ha}from"./useSignature-CA8ypw7f.js";import{b as pa}from"./account-form-helpers-DhckT_PN.js";import{u as va}from"./useDebouncedValue-AWe2Zncy.js";import{u as ga,S as ya}from"./suggest-list-Do7i1-gb.js";import"./nav-link-BvlYCbp-.js";import"./reply-DL5kkaJs.js";import{b as wa}from"./sections-uFHlOXiA.js";import{u as ba}from"./useMediaQuery-Bf7zukl9.js";import{C as Dr}from"./chevron-down-BnC2m4J6.js";const Nr={name:"arrow-right",size:24,node:[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]};Nr.node;const Ea=vr(Nr);const Or={name:"paperclip",size:24,node:[["path",{d:"m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551",key:"1miecu"}]]};Or.node;const Ir=vr(Or),xa=({email:e,displayName:t,onRemove:n,className:r})=>d.jsxs("span",{className:ln("inline-flex items-center gap-1 px-2 py-0.5 rounded-full bg-accent-2-soft text-sm max-w-[200px]",r),children:[d.jsx("span",{className:"truncate",children:t||e}),d.jsx("button",{type:"button",onClick:n,className:"shrink-0 p-0.5 rounded-full hover:bg-fg-muted/20 transition-colors","aria-label":`Remove ${e}`,children:d.jsx(gr,{className:"size-3"})})]}),Sa=/[\u0000-\u001f\u007f-\u009f\u061c\u200b-\u200f\u2028\u2029\u202a-\u202e\u2066-\u2069\ufeff]/g,Ra=/[<>:"|?*]/g,Ca=/^(con|prn|aux|nul|com[1-9]|lpt[1-9])(\.|$)/i,jn=120,Ta=12,Aa="attachment",Fn=e=>{const t=[...e];if(t.length<=jn)return e;const n=e.lastIndexOf("."),r=n>0&&[...e.slice(n)].length<=Ta?e.slice(n):"",o=jn-[...r].length;return t.slice(0,o).join("")+r},Cl=(e,t=Aa)=>{const r=e.replace(Sa,"").split(/[/\\]/),a=(r[r.length-1]??"").replace(Ra,"_").replace(/^[.\s]+/,"").replace(/[.\s]+$/,"");if(a.length===0)return Fn(t);const i=Ca.test(a)?`_${a}`:a;return Fn(i)},$n=["KB","MB","GB","TB"],Da=e=>{if(!Number.isFinite(e)||e<0)return"unknown size";const t=Math.round(e);if(t<1024)return t===1?"1 byte":`${t} bytes`;const n=1023.95;let r=t/1024,o=0;for(;r>=n&&o<$n.length-1;)r/=1024,o+=1;return`${r.toFixed(1).replace(/\.0$/,"")} ${$n[o]}`},Na=({disabled:e,onAttach:t})=>{const n=s.useRef(null);return d.jsxs(d.Fragment,{children:[d.jsx(un,{variant:"ghost",size:"md","aria-label":"Attach files",title:"Attach files","aria-busy":e,className:"min-h-11 min-w-11 px-2","data-testid":"compose-attach",icon:d.jsx(Ir,{className:"size-4"}),onClick:()=>{e||n.current?.click()}}),d.jsx("input",{ref:n,type:"file",multiple:!0,hidden:!0,"data-testid":"compose-attach-input",onChange:r=>{const o=Array.from(r.currentTarget.files??[]);r.currentTarget.value="",o.length>0&&t(o)}})]})},Oa=({save:e})=>e.status==="saving"?d.jsx("output",{className:"animate-pulse text-xs text-fg-muted",children:"Saving..."}):e.status==="saved"?d.jsx("output",{className:"text-xs text-fg-muted",children:"Draft saved"}):e.status==="error"?d.jsx("output",{className:"text-xs text-danger",children:"Save failed"}):e.status==="unsaved"?d.jsx("output",{className:"truncate text-xs text-warning",children:e.reason}):null;function Ia({send:e,onSend:t,onBlocked:n,onDiscard:r,save:o={status:"idle"},onAttach:a}){const i=e.status==="sending",c=e.status==="blocked"?e.reason:void 0;return d.jsxs("div",{className:"flex items-center justify-between border-t border-line px-3 py-2",children:[d.jsxs("div",{className:"flex min-w-0 items-center gap-3",children:[d.jsx(un,{variant:"primary",size:"md","aria-busy":i,title:c,className:"min-h-11 shrink-0 rounded-full px-4","data-testid":"compose-send",icon:i?d.jsx(yr,{className:"size-4 animate-spin"}):d.jsx(Bo,{className:"size-4"}),onClick:()=>{if(!i){if(c!==void 0){n(c);return}t()}},children:"Send"}),a&&d.jsx(Na,{disabled:i,onAttach:a}),d.jsx(Oa,{save:o})]}),d.jsx(un,{variant:"ghost",size:"md","aria-busy":i,"aria-label":"Discard",className:"min-h-11 min-w-11 px-2 hover:text-danger",icon:d.jsx(Uo,{className:"size-4"}),onClick:()=>{i||r()}})]})}const Bn=e=>/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e.trim()),ka=e=>{const t=e.trim();if(!t)return;const n=t.match(/^(.+?)\s*<([^>]+)>$/);if(n){const r=n[1].trim().replace(/^"(.*)"$/,"$1"),o=n[2].trim();if(Bn(o))return{email:o,displayName:r}}if(Bn(t))return{email:t}},La=e=>{const t=[];let n="",r=!1,o=!1;for(const a of e){if(a==='"'&&(r=!r),a==="<"&&(o=!0),a===">"&&(o=!1),(a===","||a===";")&&!r&&!o){t.push(n),n="";continue}n+=a}return t.push(n),t},Pa=e=>{const t=[],n=[];for(const r of La(e)){const o=ka(r);if(o){t.push(o);continue}r.trim()&&n.push(r.trim())}return{entries:t,unparsed:n.join(", ")}},_a=["Tab",","],Ma=150,ja=({label:e,addresses:t,onChange:n,placeholder:r,suggestions:o=[],onQueryChange:a,onPendingChange:i,ref:c})=>{const[u,m]=s.useState(""),f=s.useRef(null),l=s.useMemo(()=>Pa(u),[u]);s.useEffect(()=>{i?.(l)},[l,i]);const h=s.useRef(void 0),g=s.useCallback(()=>{h.current!==void 0&&(clearTimeout(h.current),h.current=void 0)},[]);s.useEffect(()=>g,[g]);const x=new Set(t.map(b=>b.email.toLowerCase())),p=u.length>=2?o.filter(b=>!x.has(b.email.toLowerCase())):[],E=s.useCallback(b=>{m(b),a?.(b)},[a]),w=s.useCallback(b=>{g(),!x.has(b.email.toLowerCase())&&(n([...t,b]),E(""))},[t,x,n,E,g]),A=s.useCallback(b=>{n(t.filter((P,C)=>C!==b))},[t,n]),y=s.useCallback(b=>{w(b),f.current?.focus()},[w]),v=s.useCallback(()=>{if(g(),l.entries.length===0)return{addresses:t,unparsed:l.unparsed};const b=new Set(x),P=[...t];for(const C of l.entries){const q=C.email.toLowerCase();b.has(q)||(b.add(q),P.push(C))}return n(P),E(l.unparsed),{addresses:P,unparsed:l.unparsed}},[l,t,x,n,E,g]),D=s.useCallback(()=>{g(),E("")},[E,g]);s.useImperativeHandle(c,()=>({commitPending:v,clearPending:D}),[v,D]);const _=s.useRef(v);s.useEffect(()=>{_.current=v},[v]);const S=ga({count:p.length,acceptKeys:_a,onAccept:b=>y(p[b])}),I=s.useMemo(()=>p.map(b=>({value:b.email,label:b.displayName??b.email,...b.displayName?{hint:b.email}:{}})),[p]),N=s.useCallback(b=>{if(b.key==="Backspace"&&u===""&&t.length>0){A(t.length-1);return}S.handleKeyDown(b)||(b.key==="Enter"||b.key==="Tab"||b.key===",")&&u.trim()&&(b.preventDefault(),v())},[u,t.length,A,S.handleKeyDown,v]),F=s.useCallback(()=>{g(),h.current=setTimeout(()=>{h.current=void 0,_.current(),S.dismiss()},Ma)},[g,S.dismiss]);return d.jsxs("div",{className:"relative","data-address-field":e,children:[d.jsxs("div",{className:"flex items-start gap-2",children:[d.jsxs("label",{htmlFor:`address-field-${e}`,className:"text-sm text-fg-muted shrink-0 w-12 pt-1.5",children:[e,":"]}),d.jsxs("div",{className:"flex-1 flex flex-wrap items-center gap-1 min-h-[36px] px-2 py-1 border rounded-md bg-canvas cursor-text",onClick:()=>f.current?.focus(),onKeyDown:b=>{(b.key==="Enter"||b.key===" ")&&f.current?.focus()},children:[t.map((b,P)=>d.jsx(xa,{email:b.email,displayName:b.displayName,onRemove:()=>A(P)},b.email)),d.jsx("input",{ref:f,id:`address-field-${e}`,type:"text",value:u,onChange:b=>{S.reopen(),E(b.target.value)},onKeyDown:N,onBlur:F,placeholder:t.length===0?r:"",className:"flex-1 min-w-[120px] bg-transparent outline-none text-sm py-0.5",autoComplete:"off",...S.comboboxProps})]})]}),S.open&&d.jsx(ya,{id:S.listId,suggestions:I,activeIndex:S.activeIndex,optionId:S.optionId,onPick:b=>{const P=p.find(C=>C.email===b.value);P&&y(P)},onHighlight:S.setActiveIndex,label:`${e} suggestions`,className:"absolute left-12 right-0 z-50 mt-1 max-h-[200px] shadow-lg"})]})},Fa=({state:e})=>e.status==="uploading"?d.jsx(yr,{className:"size-4 shrink-0 animate-spin text-fg-subtle","aria-hidden":!0}):e.status==="failed"?d.jsx(Ho,{className:"size-4 shrink-0 text-danger","aria-hidden":!0}):d.jsx(Ir,{className:"size-4 shrink-0 text-fg-subtle","aria-hidden":!0});function $a({items:e,onRemove:t,onRetry:n,className:r}){return e.length===0?null:d.jsx("ul",{"aria-label":"Attached files","data-testid":"compose-attachments",className:ln("flex flex-col gap-1 px-3 py-2",r),children:e.map(o=>d.jsxs("li",{"data-testid":"compose-attachment","data-state":o.state.status,className:ln("rounded-sm border bg-surface",o.state.status==="failed"?"border-danger/40":"border-line"),children:[d.jsxs("div",{className:"flex items-center gap-2 px-2 py-1.5",children:[d.jsx(Fa,{state:o.state}),d.jsxs("span",{className:"min-w-0 flex-1",children:[d.jsx("bdi",{className:"block truncate text-sm text-fg",title:o.filename,children:o.filename}),d.jsxs("span",{className:"block text-2xs text-fg-subtle",children:[Da(o.sizeBytes),o.state.status==="uploading"?" · Uploading…":""]})]}),o.state.status==="failed"&&o.state.retryable&&d.jsx("button",{type:"button",onClick:()=>n(o.key),className:"text-xs font-medium text-accent hover:underline",children:"Try again"}),d.jsx("button",{type:"button","aria-label":`Remove ${o.filename}`,onClick:()=>t(o.key),className:"inline-flex size-8 shrink-0 items-center justify-center rounded-md text-fg-muted hover:bg-surface-sunken hover:text-fg",children:d.jsx(gr,{className:"size-4","aria-hidden":!0})})]}),o.state.status==="failed"&&d.jsx("p",{role:"alert","data-testid":"compose-attachment-error",className:"border-t border-danger/30 bg-danger-soft px-2 py-1.5 text-xs text-danger",children:o.state.reason})]},o.key))})}const Ba=()=>d.jsxs("div",{"aria-hidden":"true","data-testid":"compose-body-skeleton",className:"min-h-[120px] px-3 py-2",children:[d.jsx("div",{className:"mb-2 h-8 animate-pulse rounded bg-surface-sunken"}),d.jsx("div",{className:"min-h-[80px] animate-pulse rounded bg-surface-sunken/50"})]}),Ua=e=>Array.from(e.dataTransfer?.types??[]).includes("Files");function Ha({banner:e,header:t,children:n,quoted:r,attachments:o,actionBar:a,layout:i="fill",onDropFiles:c}){const u=i==="fill",[m,f]=s.useState(!1),l=c?{onDragOver:h=>{Ua(h)&&(h.preventDefault(),f(!0))},onDragLeave:h=>{h.relatedTarget instanceof Node&&h.currentTarget.contains(h.relatedTarget)||f(!1)},onDrop:h=>{f(!1);const g=Array.from(h.dataTransfer?.files??[]);g.length!==0&&(h.preventDefault(),c(g))}}:{};return d.jsxs("div",{className:[u?"flex h-full min-h-0 flex-col":"flex flex-col",m&&"outline-2 -outline-offset-2 outline-dashed outline-accent"].filter(Boolean).join(" "),"data-testid":"compose-drop-target","data-dropping":m||void 0,...l,children:[e,t,d.jsxs("div",{className:u?"flex min-h-0 flex-1 flex-col overflow-auto":"flex flex-col","data-testid":"compose-body-area",children:[n,r&&d.jsx("div",{className:"shrink-0 px-3 pb-2",children:r})]}),o&&d.jsx("div",{className:"shrink-0",children:o}),u?a:d.jsx("div",{className:"sticky bottom-0 z-10 bg-canvas",children:a})]})}const Kt=({label:e,onClick:t})=>d.jsx("button",{type:"button",onClick:t,className:"text-xs text-fg-muted hover:text-fg transition-colors",children:e}),za=({to:e,cc:t,bcc:n,subject:r})=>{const o=[];return e.length>0&&o.push(`To: ${e.map(a=>a.displayName??a.email).join(", ")}`),t.length>0&&o.push(`Cc: ${t.length}`),n.length>0&&o.push(`Bcc: ${n.length}`),r&&o.push(r),o.join(" · ")},Wa=({collapsed:e=!1,summary:t="",onExpand:n,from:r,to:o,cc:a,bcc:i,subject:c,onShowCc:u,onShowBcc:m})=>e?d.jsxs("button",{type:"button",onClick:n,"aria-label":"Show recipients and subject",className:"flex min-h-11 w-full items-center gap-2 overflow-hidden border-b border-line px-3 py-1.5 text-left transition-colors hover:bg-surface-sunken","data-testid":"compose-header-collapsed",children:[d.jsx("span",{className:"truncate text-xs text-fg-muted",children:t||"…"}),d.jsx(Dr,{className:"ml-auto size-4 shrink-0 text-fg-muted","aria-hidden":"true"})]}):d.jsxs("div",{className:"space-y-1 px-3 py-2 border-b border-line",children:[r,o,a??d.jsxs("div",{className:"flex gap-2 pl-14",children:[d.jsx(Kt,{label:"Cc",onClick:u}),d.jsx(Kt,{label:"Bcc",onClick:m})]}),a&&!i&&d.jsx("div",{className:"pl-14",children:d.jsx(Kt,{label:"Bcc",onClick:m})}),i,c]}),kr="This message is attachments only, and attachments aren't forwarded — a forward would arrive with nothing of the original in it.",Va="This message is attachments only, so there's nothing to quote and your reply goes out without the original.",qa=e=>e==="forward"?kr:Va,Ka=({mode:e})=>d.jsx(wr,{tone:"warning","data-testid":"compose-quote-missing",children:d.jsx("span",{children:qa(e)})}),dn="This account can't send mail until SMTP is configured.",Ya=({onConfigure:e,configureRef:t})=>d.jsxs("div",{role:"alert","data-testid":"compose-smtp-missing-banner",className:"flex items-start gap-3 border-b border-warning/50 bg-warning/10 px-3 py-2",children:[d.jsx(zo,{className:"size-5 shrink-0 mt-0.5 text-warning","aria-hidden":"true"}),d.jsxs("div",{className:"flex-1 min-w-0",children:[d.jsx("p",{className:"text-sm font-medium text-warning",children:dn}),d.jsxs("button",{ref:t,type:"button",onClick:e,"data-testid":"compose-smtp-configure",className:"mt-1 inline-flex items-center gap-1 text-xs font-medium text-warning hover:underline",children:["Configure SMTP",d.jsx(Ea,{className:"size-3","aria-hidden":"true"})]})]})]}),Ga=({value:e,onChange:t})=>d.jsxs("div",{className:"flex items-start gap-2",children:[d.jsx("label",{className:"text-sm text-fg-muted shrink-0 w-12 pt-1.5",children:"Subj:"}),d.jsx("input",{type:"text",value:e,onChange:n=>t(n.target.value),className:"flex-1 px-2 py-1.5 border rounded-md bg-canvas text-sm",placeholder:"Subject","data-subject-field":!0})]}),Xa=({text:e,html:t,senderName:n,date:r})=>{const[o,a]=s.useState(!1);if(!e&&!t)return null;const i=[n,r].filter(Boolean).join(" on ");return d.jsxs("div",{className:"mt-2 px-3 pb-2",children:[d.jsxs("button",{type:"button",onClick:()=>a(!o),"aria-expanded":o,className:"flex items-center gap-1 text-xs text-fg-muted hover:text-fg transition-colors",children:[o?d.jsx(Dr,{className:"size-3"}):d.jsx(Wo,{className:"size-3"}),i?`${i} wrote:`:"Show quoted text"]}),o&&d.jsx("blockquote",{className:"mt-2 pl-3 border-l-2 border-fg-subtle/30 text-sm text-fg-muted [&_a]:text-accent [&_a]:underline [&_blockquote]:pl-3 [&_blockquote]:border-l-2 [&_blockquote]:border-fg-subtle/30",children:t?d.jsx("div",{dangerouslySetInnerHTML:{__html:t}}):e.split(`
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/rich-text-spellcheck-worker-provider-ChKzrvjg.js","assets/useSignature-W9HBbZ_n.js","assets/index-fsuIswbe.js","assets/index-DS2W4dIw.css","assets/rich-text-spellcheck-provider-J8m9wz6A.js","assets/rich-text-Ds4rQc2o.js","assets/roving-focus-DZX7IpN4.js","assets/confirm-dialog-XvccFJdE.js","assets/useMediaQuery-Hy81MQ2M.js","assets/bottom-sheet-DKF_Dkid.js","assets/popover-menu-DhcuKv1N.js","assets/undo-2-D1IMLq7c.js","assets/useMessageBodyContent-CpTD2HGg.js","assets/reply-CXuSMyqp.js","assets/nav-link-ed0mFCCx.js","assets/account-form-helpers-DhckT_PN.js","assets/useDebouncedValue-CFZ4EPXW.js","assets/suggest-list-BCqr1j26.js","assets/sections-DpRVKuXF.js","assets/chevron-down-De4wQzka.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{b as vr,j as d,X as gr,p as ln,B as un,L as yr,z as Bo,T as Uo,r as s,y as Ho,d as wr,ag as zo,x as Wo,cx as wn,ci as br,cy as xe,cz as Er,cA as Vo,cB as qo,cC as Se,f as _e,aB as Me,cD as Ko,cE as Yo,cF as xr,cG as Go,az as Sr,aA as Rr,aa as Xo,e as Cr,cH as Qo,Z as Zo,a as At,bS as Jo,cI as Tr,c9 as ea,bU as ta,c as Ar,cJ as na,an as ra,cK as _n,a_ as Mn,cL as oa,ao as aa,cM as sa,cN as ia,aj as R}from"./index-fsuIswbe.js";import{p as ca,c as la,b as ua}from"./useMessageBodyContent-CpTD2HGg.js";import{w as da,u as fa,a as ma,d as ha}from"./useSignature-W9HBbZ_n.js";import{b as pa}from"./account-form-helpers-DhckT_PN.js";import{u as va}from"./useDebouncedValue-CFZ4EPXW.js";import{u as ga,S as ya}from"./suggest-list-BCqr1j26.js";import"./nav-link-ed0mFCCx.js";import"./reply-CXuSMyqp.js";import{b as wa}from"./sections-DpRVKuXF.js";import{u as ba}from"./useMediaQuery-Hy81MQ2M.js";import{C as Dr}from"./chevron-down-De4wQzka.js";const Nr={name:"arrow-right",size:24,node:[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]};Nr.node;const Ea=vr(Nr);const Or={name:"paperclip",size:24,node:[["path",{d:"m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551",key:"1miecu"}]]};Or.node;const Ir=vr(Or),xa=({email:e,displayName:t,onRemove:n,className:r})=>d.jsxs("span",{className:ln("inline-flex items-center gap-1 px-2 py-0.5 rounded-full bg-accent-2-soft text-sm max-w-[200px]",r),children:[d.jsx("span",{className:"truncate",children:t||e}),d.jsx("button",{type:"button",onClick:n,className:"shrink-0 p-0.5 rounded-full hover:bg-fg-muted/20 transition-colors","aria-label":`Remove ${e}`,children:d.jsx(gr,{className:"size-3"})})]}),Sa=/[\u0000-\u001f\u007f-\u009f\u061c\u200b-\u200f\u2028\u2029\u202a-\u202e\u2066-\u2069\ufeff]/g,Ra=/[<>:"|?*]/g,Ca=/^(con|prn|aux|nul|com[1-9]|lpt[1-9])(\.|$)/i,jn=120,Ta=12,Aa="attachment",Fn=e=>{const t=[...e];if(t.length<=jn)return e;const n=e.lastIndexOf("."),r=n>0&&[...e.slice(n)].length<=Ta?e.slice(n):"",o=jn-[...r].length;return t.slice(0,o).join("")+r},Cl=(e,t=Aa)=>{const r=e.replace(Sa,"").split(/[/\\]/),a=(r[r.length-1]??"").replace(Ra,"_").replace(/^[.\s]+/,"").replace(/[.\s]+$/,"");if(a.length===0)return Fn(t);const i=Ca.test(a)?`_${a}`:a;return Fn(i)},$n=["KB","MB","GB","TB"],Da=e=>{if(!Number.isFinite(e)||e<0)return"unknown size";const t=Math.round(e);if(t<1024)return t===1?"1 byte":`${t} bytes`;const n=1023.95;let r=t/1024,o=0;for(;r>=n&&o<$n.length-1;)r/=1024,o+=1;return`${r.toFixed(1).replace(/\.0$/,"")} ${$n[o]}`},Na=({disabled:e,onAttach:t})=>{const n=s.useRef(null);return d.jsxs(d.Fragment,{children:[d.jsx(un,{variant:"ghost",size:"md","aria-label":"Attach files",title:"Attach files","aria-busy":e,className:"min-h-11 min-w-11 px-2","data-testid":"compose-attach",icon:d.jsx(Ir,{className:"size-4"}),onClick:()=>{e||n.current?.click()}}),d.jsx("input",{ref:n,type:"file",multiple:!0,hidden:!0,"data-testid":"compose-attach-input",onChange:r=>{const o=Array.from(r.currentTarget.files??[]);r.currentTarget.value="",o.length>0&&t(o)}})]})},Oa=({save:e})=>e.status==="saving"?d.jsx("output",{className:"animate-pulse text-xs text-fg-muted",children:"Saving..."}):e.status==="saved"?d.jsx("output",{className:"text-xs text-fg-muted",children:"Draft saved"}):e.status==="error"?d.jsx("output",{className:"text-xs text-danger",children:"Save failed"}):e.status==="unsaved"?d.jsx("output",{className:"truncate text-xs text-warning",children:e.reason}):null;function Ia({send:e,onSend:t,onBlocked:n,onDiscard:r,save:o={status:"idle"},onAttach:a}){const i=e.status==="sending",c=e.status==="blocked"?e.reason:void 0;return d.jsxs("div",{className:"flex items-center justify-between border-t border-line px-3 py-2",children:[d.jsxs("div",{className:"flex min-w-0 items-center gap-3",children:[d.jsx(un,{variant:"primary",size:"md","aria-busy":i,title:c,className:"min-h-11 shrink-0 rounded-full px-4","data-testid":"compose-send",icon:i?d.jsx(yr,{className:"size-4 animate-spin"}):d.jsx(Bo,{className:"size-4"}),onClick:()=>{if(!i){if(c!==void 0){n(c);return}t()}},children:"Send"}),a&&d.jsx(Na,{disabled:i,onAttach:a}),d.jsx(Oa,{save:o})]}),d.jsx(un,{variant:"ghost",size:"md","aria-busy":i,"aria-label":"Discard",className:"min-h-11 min-w-11 px-2 hover:text-danger",icon:d.jsx(Uo,{className:"size-4"}),onClick:()=>{i||r()}})]})}const Bn=e=>/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e.trim()),ka=e=>{const t=e.trim();if(!t)return;const n=t.match(/^(.+?)\s*<([^>]+)>$/);if(n){const r=n[1].trim().replace(/^"(.*)"$/,"$1"),o=n[2].trim();if(Bn(o))return{email:o,displayName:r}}if(Bn(t))return{email:t}},La=e=>{const t=[];let n="",r=!1,o=!1;for(const a of e){if(a==='"'&&(r=!r),a==="<"&&(o=!0),a===">"&&(o=!1),(a===","||a===";")&&!r&&!o){t.push(n),n="";continue}n+=a}return t.push(n),t},Pa=e=>{const t=[],n=[];for(const r of La(e)){const o=ka(r);if(o){t.push(o);continue}r.trim()&&n.push(r.trim())}return{entries:t,unparsed:n.join(", ")}},_a=["Tab",","],Ma=150,ja=({label:e,addresses:t,onChange:n,placeholder:r,suggestions:o=[],onQueryChange:a,onPendingChange:i,ref:c})=>{const[u,m]=s.useState(""),f=s.useRef(null),l=s.useMemo(()=>Pa(u),[u]);s.useEffect(()=>{i?.(l)},[l,i]);const h=s.useRef(void 0),g=s.useCallback(()=>{h.current!==void 0&&(clearTimeout(h.current),h.current=void 0)},[]);s.useEffect(()=>g,[g]);const x=new Set(t.map(b=>b.email.toLowerCase())),p=u.length>=2?o.filter(b=>!x.has(b.email.toLowerCase())):[],E=s.useCallback(b=>{m(b),a?.(b)},[a]),w=s.useCallback(b=>{g(),!x.has(b.email.toLowerCase())&&(n([...t,b]),E(""))},[t,x,n,E,g]),A=s.useCallback(b=>{n(t.filter((P,C)=>C!==b))},[t,n]),y=s.useCallback(b=>{w(b),f.current?.focus()},[w]),v=s.useCallback(()=>{if(g(),l.entries.length===0)return{addresses:t,unparsed:l.unparsed};const b=new Set(x),P=[...t];for(const C of l.entries){const q=C.email.toLowerCase();b.has(q)||(b.add(q),P.push(C))}return n(P),E(l.unparsed),{addresses:P,unparsed:l.unparsed}},[l,t,x,n,E,g]),D=s.useCallback(()=>{g(),E("")},[E,g]);s.useImperativeHandle(c,()=>({commitPending:v,clearPending:D}),[v,D]);const _=s.useRef(v);s.useEffect(()=>{_.current=v},[v]);const S=ga({count:p.length,acceptKeys:_a,onAccept:b=>y(p[b])}),I=s.useMemo(()=>p.map(b=>({value:b.email,label:b.displayName??b.email,...b.displayName?{hint:b.email}:{}})),[p]),N=s.useCallback(b=>{if(b.key==="Backspace"&&u===""&&t.length>0){A(t.length-1);return}S.handleKeyDown(b)||(b.key==="Enter"||b.key==="Tab"||b.key===",")&&u.trim()&&(b.preventDefault(),v())},[u,t.length,A,S.handleKeyDown,v]),F=s.useCallback(()=>{g(),h.current=setTimeout(()=>{h.current=void 0,_.current(),S.dismiss()},Ma)},[g,S.dismiss]);return d.jsxs("div",{className:"relative","data-address-field":e,children:[d.jsxs("div",{className:"flex items-start gap-2",children:[d.jsxs("label",{htmlFor:`address-field-${e}`,className:"text-sm text-fg-muted shrink-0 w-12 pt-1.5",children:[e,":"]}),d.jsxs("div",{className:"flex-1 flex flex-wrap items-center gap-1 min-h-[36px] px-2 py-1 border rounded-md bg-canvas cursor-text",onClick:()=>f.current?.focus(),onKeyDown:b=>{(b.key==="Enter"||b.key===" ")&&f.current?.focus()},children:[t.map((b,P)=>d.jsx(xa,{email:b.email,displayName:b.displayName,onRemove:()=>A(P)},b.email)),d.jsx("input",{ref:f,id:`address-field-${e}`,type:"text",value:u,onChange:b=>{S.reopen(),E(b.target.value)},onKeyDown:N,onBlur:F,placeholder:t.length===0?r:"",className:"flex-1 min-w-[120px] bg-transparent outline-none text-sm py-0.5",autoComplete:"off",...S.comboboxProps})]})]}),S.open&&d.jsx(ya,{id:S.listId,suggestions:I,activeIndex:S.activeIndex,optionId:S.optionId,onPick:b=>{const P=p.find(C=>C.email===b.value);P&&y(P)},onHighlight:S.setActiveIndex,label:`${e} suggestions`,className:"absolute left-12 right-0 z-50 mt-1 max-h-[200px] shadow-lg"})]})},Fa=({state:e})=>e.status==="uploading"?d.jsx(yr,{className:"size-4 shrink-0 animate-spin text-fg-subtle","aria-hidden":!0}):e.status==="failed"?d.jsx(Ho,{className:"size-4 shrink-0 text-danger","aria-hidden":!0}):d.jsx(Ir,{className:"size-4 shrink-0 text-fg-subtle","aria-hidden":!0});function $a({items:e,onRemove:t,onRetry:n,className:r}){return e.length===0?null:d.jsx("ul",{"aria-label":"Attached files","data-testid":"compose-attachments",className:ln("flex flex-col gap-1 px-3 py-2",r),children:e.map(o=>d.jsxs("li",{"data-testid":"compose-attachment","data-state":o.state.status,className:ln("rounded-sm border bg-surface",o.state.status==="failed"?"border-danger/40":"border-line"),children:[d.jsxs("div",{className:"flex items-center gap-2 px-2 py-1.5",children:[d.jsx(Fa,{state:o.state}),d.jsxs("span",{className:"min-w-0 flex-1",children:[d.jsx("bdi",{className:"block truncate text-sm text-fg",title:o.filename,children:o.filename}),d.jsxs("span",{className:"block text-2xs text-fg-subtle",children:[Da(o.sizeBytes),o.state.status==="uploading"?" · Uploading…":""]})]}),o.state.status==="failed"&&o.state.retryable&&d.jsx("button",{type:"button",onClick:()=>n(o.key),className:"text-xs font-medium text-accent hover:underline",children:"Try again"}),d.jsx("button",{type:"button","aria-label":`Remove ${o.filename}`,onClick:()=>t(o.key),className:"inline-flex size-8 shrink-0 items-center justify-center rounded-md text-fg-muted hover:bg-surface-sunken hover:text-fg",children:d.jsx(gr,{className:"size-4","aria-hidden":!0})})]}),o.state.status==="failed"&&d.jsx("p",{role:"alert","data-testid":"compose-attachment-error",className:"border-t border-danger/30 bg-danger-soft px-2 py-1.5 text-xs text-danger",children:o.state.reason})]},o.key))})}const Ba=()=>d.jsxs("div",{"aria-hidden":"true","data-testid":"compose-body-skeleton",className:"min-h-[120px] px-3 py-2",children:[d.jsx("div",{className:"mb-2 h-8 animate-pulse rounded bg-surface-sunken"}),d.jsx("div",{className:"min-h-[80px] animate-pulse rounded bg-surface-sunken/50"})]}),Ua=e=>Array.from(e.dataTransfer?.types??[]).includes("Files");function Ha({banner:e,header:t,children:n,quoted:r,attachments:o,actionBar:a,layout:i="fill",onDropFiles:c}){const u=i==="fill",[m,f]=s.useState(!1),l=c?{onDragOver:h=>{Ua(h)&&(h.preventDefault(),f(!0))},onDragLeave:h=>{h.relatedTarget instanceof Node&&h.currentTarget.contains(h.relatedTarget)||f(!1)},onDrop:h=>{f(!1);const g=Array.from(h.dataTransfer?.files??[]);g.length!==0&&(h.preventDefault(),c(g))}}:{};return d.jsxs("div",{className:[u?"flex h-full min-h-0 flex-col":"flex flex-col",m&&"outline-2 -outline-offset-2 outline-dashed outline-accent"].filter(Boolean).join(" "),"data-testid":"compose-drop-target","data-dropping":m||void 0,...l,children:[e,t,d.jsxs("div",{className:u?"flex min-h-0 flex-1 flex-col overflow-auto":"flex flex-col","data-testid":"compose-body-area",children:[n,r&&d.jsx("div",{className:"shrink-0 px-3 pb-2",children:r})]}),o&&d.jsx("div",{className:"shrink-0",children:o}),u?a:d.jsx("div",{className:"sticky bottom-0 z-10 bg-canvas",children:a})]})}const Kt=({label:e,onClick:t})=>d.jsx("button",{type:"button",onClick:t,className:"text-xs text-fg-muted hover:text-fg transition-colors",children:e}),za=({to:e,cc:t,bcc:n,subject:r})=>{const o=[];return e.length>0&&o.push(`To: ${e.map(a=>a.displayName??a.email).join(", ")}`),t.length>0&&o.push(`Cc: ${t.length}`),n.length>0&&o.push(`Bcc: ${n.length}`),r&&o.push(r),o.join(" · ")},Wa=({collapsed:e=!1,summary:t="",onExpand:n,from:r,to:o,cc:a,bcc:i,subject:c,onShowCc:u,onShowBcc:m})=>e?d.jsxs("button",{type:"button",onClick:n,"aria-label":"Show recipients and subject",className:"flex min-h-11 w-full items-center gap-2 overflow-hidden border-b border-line px-3 py-1.5 text-left transition-colors hover:bg-surface-sunken","data-testid":"compose-header-collapsed",children:[d.jsx("span",{className:"truncate text-xs text-fg-muted",children:t||"…"}),d.jsx(Dr,{className:"ml-auto size-4 shrink-0 text-fg-muted","aria-hidden":"true"})]}):d.jsxs("div",{className:"space-y-1 px-3 py-2 border-b border-line",children:[r,o,a??d.jsxs("div",{className:"flex gap-2 pl-14",children:[d.jsx(Kt,{label:"Cc",onClick:u}),d.jsx(Kt,{label:"Bcc",onClick:m})]}),a&&!i&&d.jsx("div",{className:"pl-14",children:d.jsx(Kt,{label:"Bcc",onClick:m})}),i,c]}),kr="This message is attachments only, and attachments aren't forwarded — a forward would arrive with nothing of the original in it.",Va="This message is attachments only, so there's nothing to quote and your reply goes out without the original.",qa=e=>e==="forward"?kr:Va,Ka=({mode:e})=>d.jsx(wr,{tone:"warning","data-testid":"compose-quote-missing",children:d.jsx("span",{children:qa(e)})}),dn="This account can't send mail until SMTP is configured.",Ya=({onConfigure:e,configureRef:t})=>d.jsxs("div",{role:"alert","data-testid":"compose-smtp-missing-banner",className:"flex items-start gap-3 border-b border-warning/50 bg-warning/10 px-3 py-2",children:[d.jsx(zo,{className:"size-5 shrink-0 mt-0.5 text-warning","aria-hidden":"true"}),d.jsxs("div",{className:"flex-1 min-w-0",children:[d.jsx("p",{className:"text-sm font-medium text-warning",children:dn}),d.jsxs("button",{ref:t,type:"button",onClick:e,"data-testid":"compose-smtp-configure",className:"mt-1 inline-flex items-center gap-1 text-xs font-medium text-warning hover:underline",children:["Configure SMTP",d.jsx(Ea,{className:"size-3","aria-hidden":"true"})]})]})]}),Ga=({value:e,onChange:t})=>d.jsxs("div",{className:"flex items-start gap-2",children:[d.jsx("label",{className:"text-sm text-fg-muted shrink-0 w-12 pt-1.5",children:"Subj:"}),d.jsx("input",{type:"text",value:e,onChange:n=>t(n.target.value),className:"flex-1 px-2 py-1.5 border rounded-md bg-canvas text-sm",placeholder:"Subject","data-subject-field":!0})]}),Xa=({text:e,html:t,senderName:n,date:r})=>{const[o,a]=s.useState(!1);if(!e&&!t)return null;const i=[n,r].filter(Boolean).join(" on ");return d.jsxs("div",{className:"mt-2 px-3 pb-2",children:[d.jsxs("button",{type:"button",onClick:()=>a(!o),"aria-expanded":o,className:"flex items-center gap-1 text-xs text-fg-muted hover:text-fg transition-colors",children:[o?d.jsx(Dr,{className:"size-3"}):d.jsx(Wo,{className:"size-3"}),i?`${i} wrote:`:"Show quoted text"]}),o&&d.jsx("blockquote",{className:"mt-2 pl-3 border-l-2 border-fg-subtle/30 text-sm text-fg-muted [&_a]:text-accent [&_a]:underline [&_blockquote]:pl-3 [&_blockquote]:border-l-2 [&_blockquote]:border-fg-subtle/30",children:t?d.jsx("div",{dangerouslySetInnerHTML:{__html:t}}):e.split(`
|
|
3
3
|
`).map((c,u)=>d.jsx("p",{className:"min-h-[1.2em]",children:c},u))})]})},Qa=["p","br","div","h1","h2","h3","h4","h5","h6","strong","b","em","i","u","s","ul","ol","li","blockquote","pre","code","hr","table","thead","tbody","tr","th","td","a","img"],Za=["href","src","alt","colspan","rowspan","lang","dir"],Ja=/^(?:https?:|mailto:)/i,es=/^(?:https:|data:image\/)/i,ts=/^cid:(.+)$/i,fn=()=>!1;let mn=fn;const ns=e=>{const t=ts.exec(e);return t?mn(t[1]):es.test(e)},rs="max-width:100%;height:auto",os=e=>{const t=ca();if(!t.isSupported)throw new Error("adopted HTML cannot be sanitized: no DOM is available");return t.addHook("afterSanitizeAttributes",n=>{if(n.tagName==="A"){Ja.test(n.getAttribute("href")??"")||n.removeAttribute("href"),e==="quoted"&&(n.setAttribute("target","_blank"),n.setAttribute("rel","noopener noreferrer nofollow"));return}if(n.tagName==="IMG"){if(e==="quoted"){n.remove();return}if(!ns(n.getAttribute("src")??"")){n.remove();return}n.setAttribute("style",rs)}}),t},Un=new Map,as=e=>{const t=Un.get(e);if(t)return t;const n=os(e);return Un.set(e,n),n},Lr=(e,t)=>as(t).sanitize(e,{ALLOWED_TAGS:Qa,ALLOWED_ATTR:Za,ALLOW_DATA_ATTR:!1,ALLOW_ARIA_ATTR:!1}),Tl=(e,t=fn)=>{mn=t;try{return Lr(e,"outgoing")}finally{mn=fn}},ss=e=>Lr(e,"quoted"),is=e=>typeof e=="string"&&e.length>0?"rich":"plain",Al=(e,t)=>t.length>0,cs={plain:"Couldn't switch to plain text",rich:"Couldn't switch to rich text"},Dl=(e,t,n)=>t.trim()===""||n.trim()!==""?{outcome:"switch"}:{outcome:"blocked",title:cs[e],detail:"The conversion came back empty, so your message is unchanged."};function Re(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e?.(o),n===!1||!o||!o.defaultPrevented)return t?.(o)}}function Hn(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function ls(...e){return t=>{let n=!1;const r=e.map(o=>{const a=Hn(o,t);return!n&&typeof a=="function"&&(n=!0),a});if(n)return()=>{for(let o=0;o<r.length;o++){const a=r[o];typeof a=="function"?a():Hn(e[o],null)}}}}function je(...e){return s.useCallback(ls(...e),e)}function us(e,t=[]){let n=[];function r(a,i){const c=s.createContext(i);c.displayName=a+"Context";const u=n.length;n=[...n,i];const m=l=>{const{scope:h,children:g,...x}=l,p=h?.[e]?.[u]||c,E=s.useMemo(()=>x,Object.values(x));return d.jsx(p.Provider,{value:E,children:g})};m.displayName=a+"Provider";function f(l,h,g={}){const{optional:x=!1}=g,p=h?.[e]?.[u]||c,E=s.useContext(p);if(E)return E;if(i!==void 0)return i;if(!x)throw new Error(`\`${l}\` must be used within \`${a}\``)}return[m,f]}const o=()=>{const a=n.map(i=>s.createContext(i));return function(c){const u=c?.[e]||a;return s.useMemo(()=>({[`__scope${e}`]:{...c,[e]:u}}),[c,u])}};return o.scopeName=e,[r,ds(o,...t)]}function ds(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(a){const i=r.reduce((c,{useScope:u,scopeName:m})=>{const l=u(a)[`__scope${m}`];return{...c,...l}},{});return s.useMemo(()=>({[`__scope${t.scopeName}`]:i}),[i])}};return n.scopeName=t.scopeName,n}var nt=globalThis?.document?s.useLayoutEffect:()=>{},fs=wn[" useInsertionEffect ".trim().toString()]||nt;function ms({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[o,a,i]=hs({defaultProp:t,onChange:n}),c=e!==void 0,u=c?e:o;{const f=s.useRef(e!==void 0);s.useEffect(()=>{const l=f.current;l!==c&&console.warn(`${r} is changing from ${l?"controlled":"uncontrolled"} to ${c?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),f.current=c},[c,r])}const m=s.useCallback(f=>{if(c){const l=ps(f)?f(e):f;l!==e&&i.current?.(l)}else a(f)},[c,e,a,i]);return[u,m]}function hs({defaultProp:e,onChange:t}){const[n,r]=s.useState(e),o=s.useRef(n),a=s.useRef(t);return fs(()=>{a.current=t},[t]),s.useEffect(()=>{o.current!==n&&(a.current?.(n),o.current=n)},[n,o]),[n,r,a]}function ps(e){return typeof e=="function"}function Pr(e){const t=s.forwardRef((n,r)=>{let{children:o,...a}=n,i=null,c=!1;const u=[];zn(o)&&typeof pt=="function"&&(o=pt(o._payload)),s.Children.forEach(o,h=>{if(bs(h)){c=!0;const g=h;let x="child"in g.props?g.props.child:g.props.children;zn(x)&&typeof pt=="function"&&(x=pt(x._payload)),i=gs(g,x),u.push(i?.props?.children)}else u.push(h)}),i?i=s.cloneElement(i,void 0,u):!c&&s.Children.count(o)===1&&s.isValidElement(o)&&(i=o);const m=i?ws(i):void 0,f=je(r,m);if(!i){if(o||o===0)throw new Error(c?Rs(e):Ss(e));return o}const l=ys(a,i.props??{});return i.type!==s.Fragment&&(l.ref=r?f:m),s.cloneElement(i,l)});return t.displayName=`${e}.Slot`,t}var vs=Symbol.for("radix.slottable"),gs=(e,t)=>{if("child"in e.props){const n=e.props.child;return s.isValidElement(n)?s.cloneElement(n,void 0,e.props.children(n.props.children)):null}return s.isValidElement(t)?t:null};function ys(e,t){const n={...t};for(const r in t){const o=e[r],a=t[r];/^on[A-Z]/.test(r)?o&&a?n[r]=(...c)=>{const u=a(...c);return o(...c),u}:o&&(n[r]=o):r==="style"?n[r]={...o,...a}:r==="className"&&(n[r]=[o,a].filter(Boolean).join(" "))}return{...e,...n}}function ws(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function bs(e){return s.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===vs}var Es=Symbol.for("react.lazy");function zn(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===Es&&"_payload"in e&&xs(e._payload)}function xs(e){return typeof e=="object"&&e!==null&&"then"in e}var Ss=e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,Rs=e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,pt=wn[" use ".trim().toString()],Cs=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],ge=Cs.reduce((e,t)=>{const n=Pr(`Primitive.${t}`),r=s.forwardRef((o,a)=>{const{asChild:i,...c}=o,u=i?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),d.jsx(u,{...c,ref:a})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function Ts(e,t){e&&br.flushSync(()=>e.dispatchEvent(t))}function rt(e){const t=s.useRef(e);return s.useEffect(()=>{t.current=e}),s.useMemo(()=>((...n)=>t.current?.(...n)),[])}var As="DismissableLayer",hn="dismissableLayer.update",Ds="dismissableLayer.pointerDownOutside",Ns="dismissableLayer.focusOutside",Wn,bn=s.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),_r=s.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,deferPointerDownOutside:r=!1,onEscapeKeyDown:o,onPointerDownOutside:a,onFocusOutside:i,onInteractOutside:c,onDismiss:u,...m}=e,f=s.useContext(bn),[l,h]=s.useState(null),g=l?.ownerDocument??globalThis?.document,[,x]=s.useState({}),p=je(t,h),E=Array.from(f.layers),[w]=[...f.layersWithOutsidePointerEventsDisabled].slice(-1),A=w?E.indexOf(w):-1,y=l?E.indexOf(l):-1,v=f.layersWithOutsidePointerEventsDisabled.size>0,D=y>=A,_=s.useRef(!1),S=Ps(b=>{a?.(b),c?.(b),b.defaultPrevented||u?.()},{ownerDocument:g,deferPointerDownOutside:r,isDeferredPointerDownOutsideRef:_,dismissableSurfaces:f.dismissableSurfaces,shouldHandlePointerDownOutside:s.useCallback(b=>{if(!(b instanceof Node))return!1;const P=[...f.branches].some(C=>C.contains(b));return D&&!P},[f.branches,D])}),I=_s(b=>{if(r&&_.current)return;const P=b.target;[...f.branches].some(q=>q.contains(P))||(i?.(b),c?.(b),b.defaultPrevented||u?.())},g),N=l?y===E.length-1:!1,F=rt(b=>{b.key==="Escape"&&(o?.(b),!b.defaultPrevented&&u&&(b.preventDefault(),u()))});return s.useEffect(()=>{if(N)return g.addEventListener("keydown",F,{capture:!0}),()=>g.removeEventListener("keydown",F,{capture:!0})},[g,N,F]),s.useEffect(()=>{if(l)return n&&(f.layersWithOutsidePointerEventsDisabled.size===0&&(Wn=g.body.style.pointerEvents,g.body.style.pointerEvents="none"),f.layersWithOutsidePointerEventsDisabled.add(l)),f.layers.add(l),Vn(),()=>{n&&(f.layersWithOutsidePointerEventsDisabled.delete(l),f.layersWithOutsidePointerEventsDisabled.size===0&&(g.body.style.pointerEvents=Wn))}},[l,g,n,f]),s.useEffect(()=>()=>{l&&(f.layers.delete(l),f.layersWithOutsidePointerEventsDisabled.delete(l),Vn())},[l,f]),s.useEffect(()=>{const b=()=>x({});return document.addEventListener(hn,b),()=>document.removeEventListener(hn,b)},[]),d.jsx(ge.div,{...m,ref:p,style:{pointerEvents:v?D?"auto":"none":void 0,...e.style},onFocusCapture:Re(e.onFocusCapture,I.onFocusCapture),onBlurCapture:Re(e.onBlurCapture,I.onBlurCapture),onPointerDownCapture:Re(e.onPointerDownCapture,S.onPointerDownCapture)})});_r.displayName=As;var Os="DismissableLayerBranch",Is=s.forwardRef((e,t)=>{const n=s.useContext(bn),r=s.useRef(null),o=je(t,r);return s.useEffect(()=>{const a=r.current;if(a)return n.branches.add(a),()=>{n.branches.delete(a)}},[n.branches]),d.jsx(ge.div,{...e,ref:o})});Is.displayName=Os;function ks(){const e=s.useContext(bn),[t,n]=s.useState(null);return s.useEffect(()=>{if(t)return e.dismissableSurfaces.add(t),()=>{e.dismissableSurfaces.delete(t)}},[t,e.dismissableSurfaces]),n}var Ls=()=>!0;function Ps(e,t){const{ownerDocument:n=globalThis?.document,deferPointerDownOutside:r=!1,isDeferredPointerDownOutsideRef:o,dismissableSurfaces:a,shouldHandlePointerDownOutside:i=Ls}=t,c=rt(e),u=s.useRef(!1),m=s.useRef(!1),f=s.useRef(new Map),l=s.useRef(()=>{});return s.useEffect(()=>{function h(){m.current=!1,o.current=!1,f.current.clear()}function g(){return Array.from(f.current.values()).some(Boolean)}function x(y){if(!m.current)return;const v=y.target;v instanceof Node&&[...a].some(_=>_.contains(v))||f.current.set(y.type,!0),y.type==="click"&&window.setTimeout(()=>{m.current&&l.current()},0)}function p(y){m.current&&f.current.set(y.type,!1)}const E=y=>{if(y.target&&!u.current){let v=function(){n.removeEventListener("click",l.current);const _=g();h(),_||Mr(Ds,c,D,{discrete:!0})};if(!i(y.target)){n.removeEventListener("click",l.current),h(),u.current=!1;return}const D={originalEvent:y};m.current=!0,o.current=r&&y.button===0,f.current.clear(),!r||y.button!==0?v():(n.removeEventListener("click",l.current),l.current=v,n.addEventListener("click",l.current,{once:!0}))}else n.removeEventListener("click",l.current),h();u.current=!1},w=["pointerup","mousedown","mouseup","touchstart","touchend","click"];for(const y of w)n.addEventListener(y,x,!0),n.addEventListener(y,p);const A=window.setTimeout(()=>{n.addEventListener("pointerdown",E)},0);return()=>{window.clearTimeout(A),n.removeEventListener("pointerdown",E),n.removeEventListener("click",l.current);for(const y of w)n.removeEventListener(y,x,!0),n.removeEventListener(y,p)}},[n,c,r,o,a,i]),{onPointerDownCapture:()=>u.current=!0}}function _s(e,t=globalThis?.document){const n=rt(e),r=s.useRef(!1);return s.useEffect(()=>{const o=a=>{a.target&&!r.current&&Mr(Ns,n,{originalEvent:a},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function Vn(){const e=new CustomEvent(hn);document.dispatchEvent(e)}function Mr(e,t,n,{discrete:r}){const o=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?Ts(o,a):o.dispatchEvent(a)}var vt=0,Be=null;function Ms(){s.useEffect(()=>{Be||(Be={start:qn(),end:qn()});const{start:e,end:t}=Be;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement("afterbegin",e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement("beforeend",t),vt++,()=>{vt===1&&(Be?.start.remove(),Be?.end.remove(),Be=null),vt=Math.max(0,vt-1)}},[])}function qn(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var Yt="focusScope.autoFocusOnMount",Gt="focusScope.autoFocusOnUnmount",Kn={bubbles:!1,cancelable:!0},js="FocusScope",jr=s.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:a,...i}=e,[c,u]=s.useState(null),m=rt(o),f=rt(a),l=s.useRef(null),h=je(t,u),g=s.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;s.useEffect(()=>{if(r){let p=function(y){if(g.paused||!c)return;const v=y.target;c.contains(v)?l.current=v:Ee(l.current,{select:!0})},E=function(y){if(g.paused||!c)return;const v=y.relatedTarget;v!==null&&(c.contains(v)||Ee(l.current,{select:!0}))},w=function(y){if(document.activeElement===document.body)for(const D of y)D.removedNodes.length>0&&Ee(c)};document.addEventListener("focusin",p),document.addEventListener("focusout",E);const A=new MutationObserver(w);return c&&A.observe(c,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",p),document.removeEventListener("focusout",E),A.disconnect()}}},[r,c,g.paused]),s.useEffect(()=>{if(c){Gn.add(g);const p=document.activeElement;if(!c.contains(p)){const w=new CustomEvent(Yt,Kn);c.addEventListener(Yt,m),c.dispatchEvent(w),w.defaultPrevented||(Fs(zs(Fr(c)),{select:!0}),document.activeElement===p&&Ee(c))}return()=>{c.removeEventListener(Yt,m),setTimeout(()=>{const w=new CustomEvent(Gt,Kn);c.addEventListener(Gt,f),c.dispatchEvent(w),w.defaultPrevented||Ee(p??document.body,{select:!0}),c.removeEventListener(Gt,f),Gn.remove(g)},0)}}},[c,m,f,g]);const x=s.useCallback(p=>{if(!n&&!r||g.paused)return;const E=p.key==="Tab"&&!p.altKey&&!p.ctrlKey&&!p.metaKey,w=document.activeElement;if(E&&w){const A=p.currentTarget,[y,v]=$s(A);y&&v?!p.shiftKey&&w===v?(p.preventDefault(),n&&Ee(y,{select:!0})):p.shiftKey&&w===y&&(p.preventDefault(),n&&Ee(v,{select:!0})):w===A&&p.preventDefault()}},[n,r,g.paused]);return d.jsx(ge.div,{tabIndex:-1,...i,ref:h,onKeyDown:x})});jr.displayName=js;function Fs(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(Ee(r,{select:t}),document.activeElement!==n)return}function $s(e){const t=Fr(e),n=Yn(t,e),r=Yn(t.reverse(),e);return[n,r]}function Fr(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const o=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||o?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function Yn(e,t){const n=typeof t.checkVisibility=="function"&&t.checkVisibility({checkVisibilityCSS:!0});for(const r of e)if(!(n?!r.checkVisibility({checkVisibilityCSS:!0}):Bs(r,{upTo:t})))return r}function Bs(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function Us(e){return e instanceof HTMLInputElement&&"select"in e}function Ee(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&Us(e)&&t&&e.select()}}var Gn=Hs();function Hs(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=Xn(e,t),e.unshift(t)},remove(t){e=Xn(e,t),e[0]?.resume()}}}function Xn(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function zs(e){return e.filter(t=>t.tagName!=="A")}var Ws=wn[" useId ".trim().toString()]||(()=>{}),Vs=0;function Xt(e){const[t,n]=s.useState(Ws());return nt(()=>{n(r=>r??String(Vs++))},[e]),e||(t?`radix-${t}`:"")}var qs="Portal",$r=s.forwardRef((e,t)=>{const{container:n,...r}=e,[o,a]=s.useState(!1);nt(()=>a(!0),[]);const i=n||o&&globalThis?.document?.body;return i?br.createPortal(d.jsx(ge.div,{...r,ref:t}),i):null});$r.displayName=qs;function Ks(e,t){return s.useReducer((n,r)=>t[n][r]??n,e)}var Ot=e=>{const{present:t,children:n}=e,r=Ys(t),o=typeof n=="function"?n({present:r.isPresent}):s.Children.only(n),a=Gs(r.ref,Xs(o));return typeof n=="function"||r.isPresent?s.cloneElement(o,{ref:a}):null};Ot.displayName="Presence";function Ys(e){const[t,n]=s.useState(),r=s.useRef(null),o=s.useRef(e),a=s.useRef("none"),i=s.useRef(void 0),c=e?"mounted":"unmounted",[u,m]=Ks(c,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return s.useEffect(()=>{u==="mounted"?(a.current=i.current??Je(r.current),i.current=void 0):a.current="none"},[u]),nt(()=>{const f=r.current,l=o.current;if(l!==e){const g=a.current,x=Je(f);e?(i.current=x,m("MOUNT")):x==="none"||f?.display==="none"?m("UNMOUNT"):m(l&&g!==x?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,m]),nt(()=>{if(t){let f;const l=t.ownerDocument.defaultView??window,h=x=>{const E=Je(r.current).includes(CSS.escape(x.animationName));if(x.target===t&&E&&(m("ANIMATION_END"),!o.current)){const w=t.style.animationFillMode;t.style.animationFillMode="forwards",f=l.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=w)})}},g=x=>{x.target===t&&(a.current=Je(r.current))};return t.addEventListener("animationstart",g),t.addEventListener("animationcancel",h),t.addEventListener("animationend",h),()=>{l.clearTimeout(f),t.removeEventListener("animationstart",g),t.removeEventListener("animationcancel",h),t.removeEventListener("animationend",h)}}else m("ANIMATION_END")},[t,m]),{isPresent:["mounted","unmountSuspended"].includes(u),ref:s.useCallback(f=>{if(f){const l=getComputedStyle(f);r.current=l,i.current=Je(l)}else r.current=null;n(f)},[])}}function Qn(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Gs(...e){const t=s.useRef(e);return t.current=e,s.useCallback(n=>{const r=t.current;let o=!1;const a=r.map(i=>{const c=Qn(i,n);return!o&&typeof c=="function"&&(o=!0),c});if(o)return()=>{for(let i=0;i<a.length;i++){const c=a[i];typeof c=="function"?c():Qn(r[i],null)}}},[])}function Je(e){return e?.animationName||"none"}function Xs(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Qs=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Ue=new WeakMap,gt=new WeakMap,yt={},Qt=0,Br=function(e){return e&&(e.host||Br(e.parentNode))},Zs=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=Br(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},Js=function(e,t,n,r){var o=Zs(t,Array.isArray(e)?e:[e]);yt[n]||(yt[n]=new WeakMap);var a=yt[n],i=[],c=new Set,u=new Set(o),m=function(l){!l||c.has(l)||(c.add(l),m(l.parentNode))};o.forEach(m);var f=function(l){!l||u.has(l)||Array.prototype.forEach.call(l.children,function(h){if(c.has(h))f(h);else try{var g=h.getAttribute(r),x=g!==null&&g!=="false",p=(Ue.get(h)||0)+1,E=(a.get(h)||0)+1;Ue.set(h,p),a.set(h,E),i.push(h),p===1&&x&>.set(h,!0),E===1&&h.setAttribute(n,"true"),x||h.setAttribute(r,"true")}catch(w){console.error("aria-hidden: cannot operate on ",h,w)}})};return f(t),c.clear(),Qt++,function(){i.forEach(function(l){var h=Ue.get(l)-1,g=a.get(l)-1;Ue.set(l,h),a.set(l,g),h||(gt.has(l)||l.removeAttribute(r),gt.delete(l)),g||l.removeAttribute(n)}),Qt--,Qt||(Ue=new WeakMap,Ue=new WeakMap,gt=new WeakMap,yt={})}},ei=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),o=Qs(e);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live], script"))),Js(r,o,n,"aria-hidden")):function(){return null}},Rt="right-scroll-bar-position",Ct="width-before-scroll-bar",ti="with-scroll-bars-hidden",ni="--removed-body-scroll-bar-size";function Zt(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function ri(e,t){var n=s.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var o=n.value;o!==r&&(n.value=r,n.callback(r,o))}}}})[0];return n.callback=t,n.facade}var oi=typeof window<"u"?s.useLayoutEffect:s.useEffect,Zn=new WeakMap;function ai(e,t){var n=ri(null,function(r){return e.forEach(function(o){return Zt(o,r)})});return oi(function(){var r=Zn.get(n);if(r){var o=new Set(r),a=new Set(e),i=n.current;o.forEach(function(c){a.has(c)||Zt(c,null)}),a.forEach(function(c){o.has(c)||Zt(c,i)})}Zn.set(n,e)},[e]),n}function si(e){return e}function ii(e,t){t===void 0&&(t=si);var n=[],r=!1,o={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(a){var i=t(a,r);return n.push(i),function(){n=n.filter(function(c){return c!==i})}},assignSyncMedium:function(a){for(r=!0;n.length;){var i=n;n=[],i.forEach(a)}n={push:function(c){return a(c)},filter:function(){return n}}},assignMedium:function(a){r=!0;var i=[];if(n.length){var c=n;n=[],c.forEach(a),i=n}var u=function(){var f=i;i=[],f.forEach(a)},m=function(){return Promise.resolve().then(u)};m(),n={push:function(f){i.push(f),m()},filter:function(f){return i=i.filter(f),n}}}};return o}function ci(e){e===void 0&&(e={});var t=ii(null);return t.options=xe({async:!0,ssr:!1},e),t}var Ur=function(e){var t=e.sideCar,n=Er(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return s.createElement(r,xe({},n))};Ur.isSideCarExport=!0;function li(e,t){return e.useMedium(t),Ur}var Hr=ci(),Jt=function(){},It=s.forwardRef(function(e,t){var n=s.useRef(null),r=s.useState({onScrollCapture:Jt,onWheelCapture:Jt,onTouchMoveCapture:Jt}),o=r[0],a=r[1],i=e.forwardProps,c=e.children,u=e.className,m=e.removeScrollBar,f=e.enabled,l=e.shards,h=e.sideCar,g=e.noRelative,x=e.noIsolation,p=e.inert,E=e.allowPinchZoom,w=e.as,A=w===void 0?"div":w,y=e.gapMode,v=Er(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),D=h,_=ai([n,t]),S=xe(xe({},v),o);return s.createElement(s.Fragment,null,f&&s.createElement(D,{sideCar:Hr,removeScrollBar:m,shards:l,noRelative:g,noIsolation:x,inert:p,setCallbacks:a,allowPinchZoom:!!E,lockRef:n,gapMode:y}),i?s.cloneElement(s.Children.only(c),xe(xe({},S),{ref:_})):s.createElement(A,xe({},S,{className:u,ref:_}),c))});It.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};It.classNames={fullWidth:Ct,zeroRight:Rt};var ui=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function di(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=ui();return t&&e.setAttribute("nonce",t),e}function fi(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function mi(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var hi=function(){var e=0,t=null;return{add:function(n){e==0&&(t=di())&&(fi(t,n),mi(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},pi=function(){var e=hi();return function(t,n){s.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},zr=function(){var e=pi(),t=function(n){var r=n.styles,o=n.dynamic;return e(r,o),null};return t},vi={left:0,top:0,right:0,gap:0},en=function(e){return parseInt(e||"",10)||0},gi=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],o=t[e==="padding"?"paddingRight":"marginRight"];return[en(n),en(r),en(o)]},yi=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return vi;var t=gi(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},wi=zr(),We="data-scroll-locked",bi=function(e,t,n,r){var o=e.left,a=e.top,i=e.right,c=e.gap;return n===void 0&&(n="margin"),`
|
|
4
4
|
.`.concat(ti,` {
|
|
5
5
|
overflow: hidden `).concat(r,`;
|
|
@@ -40,7 +40,7 @@ import{b as vr,j as d,X as gr,p as ln,B as un,L as yr,z as Bo,T as Uo,r as s,y a
|
|
|
40
40
|
`)},Jn=function(){var e=parseInt(document.body.getAttribute(We)||"0",10);return isFinite(e)?e:0},Ei=function(){s.useEffect(function(){return document.body.setAttribute(We,(Jn()+1).toString()),function(){var e=Jn()-1;e<=0?document.body.removeAttribute(We):document.body.setAttribute(We,e.toString())}},[])},xi=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,o=r===void 0?"margin":r;Ei();var a=s.useMemo(function(){return yi(o)},[o]);return s.createElement(wi,{styles:bi(a,!t,o,n?"":"!important")})},pn=!1;if(typeof window<"u")try{var wt=Object.defineProperty({},"passive",{get:function(){return pn=!0,!0}});window.addEventListener("test",wt,wt),window.removeEventListener("test",wt,wt)}catch{pn=!1}var He=pn?{passive:!1}:!1,Si=function(e){return e.tagName==="TEXTAREA"},Wr=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!Si(e)&&n[t]==="visible")},Ri=function(e){return Wr(e,"overflowY")},Ci=function(e){return Wr(e,"overflowX")},er=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var o=Vr(e,r);if(o){var a=qr(e,r),i=a[1],c=a[2];if(i>c)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},Ti=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},Ai=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},Vr=function(e,t){return e==="v"?Ri(t):Ci(t)},qr=function(e,t){return e==="v"?Ti(t):Ai(t)},Di=function(e,t){return e==="h"&&t==="rtl"?-1:1},Ni=function(e,t,n,r,o){var a=Di(e,window.getComputedStyle(t).direction),i=a*r,c=n.target,u=t.contains(c),m=!1,f=i>0,l=0,h=0;do{if(!c)break;var g=qr(e,c),x=g[0],p=g[1],E=g[2],w=p-E-a*x;(x||w)&&Vr(e,c)&&(l+=w,h+=x);var A=c.parentNode;c=A&&A.nodeType===Node.DOCUMENT_FRAGMENT_NODE?A.host:A}while(!u&&c!==document.body||u&&(t.contains(c)||t===c));return(f&&Math.abs(l)<1||!f&&Math.abs(h)<1)&&(m=!0),m},bt=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},tr=function(e){return[e.deltaX,e.deltaY]},nr=function(e){return e&&"current"in e?e.current:e},Oi=function(e,t){return e[0]===t[0]&&e[1]===t[1]},Ii=function(e){return`
|
|
41
41
|
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
42
42
|
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
43
|
-
`)},ki=0,ze=[];function Li(e){var t=s.useRef([]),n=s.useRef([0,0]),r=s.useRef(),o=s.useState(ki++)[0],a=s.useState(zr)[0],i=s.useRef(e);s.useEffect(function(){i.current=e},[e]),s.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var p=Vo([e.lockRef.current],(e.shards||[]).map(nr),!0).filter(Boolean);return p.forEach(function(E){return E.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),p.forEach(function(E){return E.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var c=s.useCallback(function(p,E){if("touches"in p&&p.touches.length===2||p.type==="wheel"&&p.ctrlKey)return!i.current.allowPinchZoom;var w=bt(p),A=n.current,y="deltaX"in p?p.deltaX:A[0]-w[0],v="deltaY"in p?p.deltaY:A[1]-w[1],D,_=p.target,S=Math.abs(y)>Math.abs(v)?"h":"v";if("touches"in p&&S==="h"&&_.type==="range")return!1;var I=window.getSelection(),N=I&&I.anchorNode,F=N?N===_||N.contains(_):!1;if(F)return!1;var b=er(S,_);if(!b)return!0;if(b?D=S:(D=S==="v"?"h":"v",b=er(S,_)),!b)return!1;if(!r.current&&"changedTouches"in p&&(y||v)&&(r.current=D),!D)return!0;var P=r.current||D;return Ni(P,E,p,P==="h"?y:v)},[]),u=s.useCallback(function(p){var E=p;if(!(!ze.length||ze[ze.length-1]!==a)){var w="deltaY"in E?tr(E):bt(E),A=t.current.filter(function(D){return D.name===E.type&&(D.target===E.target||E.target===D.shadowParent)&&Oi(D.delta,w)})[0];if(A&&A.should){E.cancelable&&E.preventDefault();return}if(!A){var y=(i.current.shards||[]).map(nr).filter(Boolean).filter(function(D){return D.contains(E.target)}),v=y.length>0?c(E,y[0]):!i.current.noIsolation;v&&E.cancelable&&E.preventDefault()}}},[]),m=s.useCallback(function(p,E,w,A){var y={name:p,delta:E,target:w,should:A,shadowParent:Pi(w)};t.current.push(y),setTimeout(function(){t.current=t.current.filter(function(v){return v!==y})},1)},[]),f=s.useCallback(function(p){n.current=bt(p),r.current=void 0},[]),l=s.useCallback(function(p){m(p.type,tr(p),p.target,c(p,e.lockRef.current))},[]),h=s.useCallback(function(p){m(p.type,bt(p),p.target,c(p,e.lockRef.current))},[]);s.useEffect(function(){return ze.push(a),e.setCallbacks({onScrollCapture:l,onWheelCapture:l,onTouchMoveCapture:h}),document.addEventListener("wheel",u,He),document.addEventListener("touchmove",u,He),document.addEventListener("touchstart",f,He),function(){ze=ze.filter(function(p){return p!==a}),document.removeEventListener("wheel",u,He),document.removeEventListener("touchmove",u,He),document.removeEventListener("touchstart",f,He)}},[]);var g=e.removeScrollBar,x=e.inert;return s.createElement(s.Fragment,null,x?s.createElement(a,{styles:Ii(o)}):null,g?s.createElement(xi,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function Pi(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const _i=li(Hr,Li);var Kr=s.forwardRef(function(e,t){return s.createElement(It,xe({},e,{ref:t,sideCar:_i}))});Kr.classNames=It.classNames;const Nl=({enabled:e=!0,bindings:t,capture:n=!1})=>{const r=s.useCallback(o=>{const a=o.target;if(!(a.tagName==="INPUT"||a.tagName==="TEXTAREA"||a.isContentEditable))for(const i of t){if(!(o.key.toLowerCase()===i.key.toLowerCase())||i.action&&qo(i.action)||i.requireShift!==void 0&&i.requireShift!==o.shiftKey)continue;const u=o.ctrlKey||o.metaKey;if(i.requireMeta!==void 0){if(i.requireMeta!==u)continue}else{const m=i.noModifiers??!0,f=u||o.altKey||i.requireShift===void 0&&o.shiftKey;if(m&&f)continue}i.preventDefault&&o.preventDefault(),i.stopPropagation&&(o.stopPropagation(),o.stopImmediatePropagation()),i.handler(o);return}},[t]);s.useEffect(()=>{if(e)return window.addEventListener("keydown",r,n),()=>window.removeEventListener("keydown",r,n)},[e,r,n])},Mi=e=>typeof e=="object"&&e!==null&&"code"in e&&e.code==="attachment_rejected"&&"message"in e&&typeof e.message=="string",ji=new Set(["EmptyFile","UnusableFilename","FileTooLarge","TooManyAttachments"]),rr={status:"uploading"},Yr={status:"attached"},Pe=(e,t)=>({status:"failed",reason:e,retryable:t}),tn=(e,t)=>Mi(t)?Pe(t.message,!ji.has(t.reason)):Pe(`"${e}" could not be attached: ${Se(t)??"the request failed"}. Try again.`,!0),Fi=e=>({key:e.outboxAttachmentId,serverId:e.outboxAttachmentId,file:null,placement:null,contentId:e.contentId,contentType:e.contentType,contentUrl:e.contentUrl,filename:e.filename,sizeBytes:e.sizeBytes,state:e.state==="Stored"?Yr:Pe(`"${e.filename}" did not finish uploading. Remove it and attach it again.`,!1)});class $i{constructor(t){this.deps=t}deps;entries=[];snapshot=[];listeners=new Set;generation=0;draftId;nextKey=0;reservationsInFlight=new Set;inFlight=new Map;mintedAfterRemoval=new Map;removing=new Map;removedListeners=new Set;loaded=!1;subscribe=t=>(this.listeners.add(t),()=>this.listeners.delete(t));getSnapshot=()=>this.snapshot;owns=t=>this.entries.some(n=>n.contentId===t);storedContent=t=>{const n=this.entries.find(r=>r.contentId===t&&r.contentUrl!==null);return n?.contentUrl?{filename:n.filename,contentType:n.contentType,contentUrl:n.contentUrl}:null};isLoaded=()=>this.loaded;refreshLinks=t=>{const n=new Map(t.map(r=>[r.outboxAttachmentId,r.contentUrl]));this.set(this.entries.map(r=>{const o=r.serverId===null?void 0:n.get(r.serverId);return o===void 0?r:{...r,contentUrl:o}}))};onRemoved=t=>(this.removedListeners.add(t),()=>this.removedListeners.delete(t));blockingReason=()=>{const[t]=this.removing.values();if(t!==void 0)return`Removing "${t}"…`;const n=this.entries.find(o=>o.state.status==="uploading");if(n)return`"${n.filename}" is still uploading.`;const r=this.entries.find(o=>o.state.status==="failed");if(r)return`"${r.filename}" is not attached. Try it again or remove it before sending.`};set(t){this.entries=t,this.snapshot=t.map(({key:n,filename:r,sizeBytes:o,state:a})=>({key:n,filename:r,sizeBytes:o,state:a}));for(const n of this.listeners)n()}patch(t,n,r){t===this.generation&&this.entries.some(o=>o.key===n)&&this.set(this.entries.map(o=>o.key===n?{...o,...r}:o))}reserve(t,n){let r=()=>{};const o=new Promise(a=>{r=()=>{this.reservationsInFlight.delete(o),a()}});return this.reservationsInFlight.add(o),{minted:this.deps.transport().mint(t,n),settle:r}}upload=async(t,n,r,o,a)=>{if(a.aborted)return;const i=this.deps.transport(),{minted:c,settle:u}=this.reserve(o,r),m=await c.catch(h=>(this.patch(t,n,{state:tn(r.name,h)}),null));if(m!==null&&a.aborted&&this.mintedAfterRemoval.set(n,m.outboxAttachmentId),m!==null&&!a.aborted&&this.patch(t,n,{serverId:m.outboxAttachmentId,filename:m.filename,contentId:m.contentId,contentType:m.contentType}),u(),m===null||a.aborted)return;const f=await i.put(m.uploadUrl,r,a).then(()=>null,h=>Se(h)??"the connection dropped");if(a.aborted)return;if(f!==null){this.patch(t,n,{state:Pe(`"${m.filename}" did not finish uploading: ${f}. Try again.`,!0)});return}const l=await i.complete(o,m.outboxAttachmentId).catch(h=>(this.patch(t,n,{state:tn(m.filename,h)}),null));l===null||a.aborted||(this.patch(t,n,{state:Yr,contentUrl:l.contentUrl}),t===this.generation&&this.entries.find(h=>h.key===n)?.placement?.stored(r,m.contentId))};settleFailure(t,n,r){if(t!==this.generation)return;const o=this.entries.find(a=>a.key===n);o?.state.status==="failed"&&o.placement?.failed(r)}run=async(t,n,r,o,a)=>{await this.upload(t,n,r,o,a),this.inFlight.get(n)?.signal===a&&this.inFlight.delete(n),this.settleFailure(t,n,r)};syncKept=async t=>{for(;this.reservationsInFlight.size>0;)await Promise.all([...this.reservationsInFlight]);const n=this.draftId;return t!==this.generation||n===void 0?null:this.deps.transport().keep(n,this.entries.flatMap(r=>r.serverId===null?[]:[r.serverId])).then(()=>null,r=>r??new Error("the request failed"))};attach=async(t,n)=>{const r=this.generation,o=t.map(i=>{this.nextKey+=1;const c={key:`local-${this.nextKey}`,serverId:null,file:i,placement:n??null,contentId:null,contentType:i.type||"application/octet-stream",contentUrl:null,filename:i.name,sizeBytes:i.size,state:rr},u=new AbortController;return this.inFlight.set(c.key,u),{entry:c,file:i,signal:u.signal}});this.set([...this.entries,...o.map(({entry:i})=>i)]);const a=await this.deps.ensureDraft();if(a.outcome==="refused"){for(const{entry:i,file:c}of o)this.inFlight.delete(i.key),this.patch(r,i.key,{state:Pe(a.reason,!0)}),this.settleFailure(r,i.key,c);return}r===this.generation&&(this.draftId=a.outboxMessageId,await Promise.all(o.map(({entry:i,file:c,signal:u})=>this.run(r,i.key,c,a.outboxMessageId,u))))};retry=async t=>{const n=this.entries.find(c=>c.key===t);if(!n||n.file===null||this.inFlight.has(t))return;const r=n.file,o=this.generation,a=new AbortController;this.inFlight.set(t,a),this.patch(o,t,{state:rr,serverId:null});const i=await this.deps.ensureDraft();if(i.outcome==="refused"){this.inFlight.delete(t),this.patch(o,t,{state:Pe(i.reason,!0)});return}if(this.draftId=i.outboxMessageId,n.serverId!==null){const c=await this.syncKept(o);if(c!==null){this.inFlight.delete(t),this.patch(o,t,{serverId:n.serverId,state:tn(r.name,c)});return}}await this.run(o,t,r,i.outboxMessageId,a.signal)};remove=async t=>{const n=this.entries.find(c=>c.key===t);if(!n)return;const r=this.generation,o=this.inFlight.get(t);if(this.set(this.entries.filter(c=>c.key!==t)),o&&(this.inFlight.delete(t),o.abort()),n.serverId===null&&!o)return;this.removing.set(t,n.filename),this.set(this.entries);const a=await this.syncKept(r);this.removing.delete(t),this.set(this.entries);const i=n.serverId??this.mintedAfterRemoval.get(t)??null;if(this.mintedAfterRemoval.delete(t),r===this.generation){if(a===null){if(n.contentId===null)return;for(const c of this.removedListeners)c(n.contentId);return}i!==null&&this.set([...this.entries,{...n,serverId:i,file:null,state:Pe(`"${n.filename}" could not be removed: ${Se(a)??"the request failed"}. It is still on the draft — remove it again.`,!1)}])}};load=(t,n)=>{this.draftId=t,this.loaded=!0;const r=new Set(n.map(a=>a.outboxAttachmentId)),o=this.entries.filter(a=>a.file!==null&&(a.serverId===null||!r.has(a.serverId)));this.set([...n.map(Fi),...o])};reset=t=>{this.generation+=1;for(const n of this.inFlight.values())n.abort();this.inFlight.clear(),this.mintedAfterRemoval.clear(),this.removing.clear(),this.draftId=t,this.loaded=!1,this.set([])}}const Bi=(e,t,n)=>fetch(e,{method:"PUT",body:t,signal:n}).then(r=>{if(!r.ok)throw new Error(`the server answered ${r.status}`)}),Ui=({ensureDraft:e})=>{const t=_e({...Ko(),meta:Me}),n=_e({...Yo(),meta:Me}),r=_e({...xr(),meta:Me}),o=s.useRef(null);o.current={mint:(u,m)=>t.mutateAsync({path:{outboxMessageId:u},body:{filename:m.name,contentType:m.type||"application/octet-stream",sizeBytes:m.size}}),put:Bi,complete:(u,m)=>n.mutateAsync({path:{outboxMessageId:u,outboxAttachmentId:m}}).then(f=>({contentUrl:f.contentUrl})),keep:(u,m)=>r.mutateAsync({path:{outboxMessageId:u},body:{attachmentIds:m}}).then(()=>{})};const a=s.useRef(e);a.current=e;const[i]=s.useState(()=>new $i({transport:()=>{const u=o.current;if(!u)throw new Error("attachment transport not ready");return u},ensureDraft:()=>a.current()}));return{items:s.useSyncExternalStore(i.subscribe,i.getSnapshot,i.getSnapshot),attach:i.attach,retry:i.retry,remove:i.remove,load:i.load,reset:i.reset,owns:i.owns,isLoaded:i.isLoaded,refreshLinks:i.refreshLinks,storedContent:i.storedContent,onRemoved:i.onRemoved,blockingReason:i.blockingReason()}},Ol=e=>e==="link-expired"||e==="not-ready";class vn extends Error{reason;status;constructor(t,n,r){super(n),this.name="AttachmentFetchError",this.reason=t,this.status=r}}const Hi="x-remit-403-reason",zi="expired",Wi=(e,t)=>{if(t?.trim()===zi)return"link-expired";const n=la(e,t);return n==="auth"?"auth":n==="body-missing"?"missing":"generic"},Vi=300*1e3,qi=async(e,t)=>{const n={},r=await t();r&&(n.Authorization=`Bearer ${r}`);const o=await Go(e,{headers:n,signal:AbortSignal.timeout(Vi)});if(o.status===202)throw new vn("not-ready","Attachment is still being fetched from the mail server",202);if(!o.ok)throw new vn(Wi(o.status,o.headers.get(Hi)),`Failed to download attachment (${o.status} ${o.statusText})`,o.status);return o.blob()},Ki=(e,t,n)=>{switch(e){case"auth":return{title:"Your session expired",detail:`Sign in again, then download ${t} once more. Other parts of the app may also stop responding until you do.`};case"link-expired":return{title:"This download link expired and could not be renewed",detail:`Reload the page, then download ${t} again. If that keeps failing, this is worth reporting.`};case"missing":return{title:"This attachment is missing from storage",detail:"Remit has the message but not the file. Re-sync the account from Settings, then try again."};case"not-ready":return{title:"Still fetching this attachment",detail:"Remit is downloading it from the mail server now. Try again in a few seconds."};default:return{title:"Couldn't download this attachment",detail:n}}},or=e=>e instanceof vn?e.reason:"generic",Yi=e=>e instanceof Error?e.message:typeof e=="string"?e:"An unexpected error occurred while downloading this attachment.",Il=(e,t,n)=>{if(e!=="auth")return Sr(Rr({title:`Bug: attachment download failed (${e})`,errorMessage:`Downloading "${t}" failed: ${n}`}))},kl=(e,t)=>{const n=URL.createObjectURL(e),r=document.createElement("a");r.href=n,r.download=t,r.rel="noopener",document.body.append(r),r.click(),r.remove(),setTimeout(()=>URL.revokeObjectURL(n),0)},Gi=e=>{const{getToken:t}=Xo(),n=s.useRef({...e,getToken:t});return n.current={...e,getToken:t},s.useMemo(()=>{const r=c=>{const u=n.current;return u.isLoaded()?null:u.draftAttachments.find(m=>m.contentId===c)??null},o=c=>n.current.storedContent(c)??r(c),a=c=>qi(c.contentUrl,n.current.getToken).then(u=>URL.createObjectURL(new Blob([u],{type:c.contentType}))),i=c=>n.current.refreshLinks().then(()=>{const u=o(c);if(!u)throw new Error("the file is no longer on this draft");return a(u)});return{attach:(c,u)=>{n.current.attach(c,u)},owns:c=>n.current.owns(c)||r(c)!==null,onRemoved:c=>n.current.onRemoved(c),resolve:c=>{const u=o(c);return u?a(u).catch(m=>{if(or(m)!=="link-expired")throw m;return i(c)}).catch(m=>{const f=or(m);return n.current.pushError({...Ki(f,u.filename,Yi(m)),error:f==="generic"?m:void 0}),null}):Promise.resolve(null)}}},[])},Xi=(e,t)=>e===void 0&&t.toAddresses.length===0,Qi={status:"unsaved",reason:"Not saved — add a To address to keep this draft."},ar={status:"idle"},Zi={status:"saving"},sr={status:"saved"},ir={status:"error"},Ji=e=>e.then(()=>{},()=>{}),ec=({outboxMessageId:e,onDraftCreated:t})=>{const[n,r]=s.useState(ar),[o,a]=s.useState(null),i=s.useRef(void 0),c=s.useRef(new Set),u=Cr(),m=s.useRef(e),f=s.useRef(e);if(m.current!==e){const y=m.current!==void 0;m.current=e,f.current=e,y&&i.current&&clearTimeout(i.current)}const l=_e({...Qo(),meta:Me}),h=_e({...xr(),meta:Me}),g=s.useCallback(async y=>{r(Zi),a(null);const v=f.current;if(v){const _=await h.mutateAsync({path:{outboxMessageId:v},body:{toAddresses:y.toAddresses,ccAddresses:y.ccAddresses,bccAddresses:y.bccAddresses,subject:y.subject,textBody:y.textBody,htmlBody:y.htmlBody,inReplyTo:y.inReplyTo,references:y.references}});return r(sr),_}const D=await l.mutateAsync({body:{...y,sendImmediately:!1}});return f.current=D.outboxMessageId,t(D.outboxMessageId),r(sr),u.invalidateQueries({queryKey:Zo().queryKey}),D},[l.mutateAsync,h.mutateAsync,t,u]),x=s.useRef(Promise.resolve()),p=s.useCallback(y=>{const v=x.current.then(()=>g(y));return x.current=Ji(v),v},[g]),E=s.useCallback(y=>{if(i.current&&clearTimeout(i.current),Xi(f.current,y)){r(Qi);return}r(v=>v.status==="unsaved"?ar:v),i.current=setTimeout(()=>{const v=f.current;v&&c.current.has(v)||p(y).catch(D=>{a(D),r(ir)})},2e3)},[p]),w=s.useCallback(y=>(i.current&&clearTimeout(i.current),p(y).then(v=>({outcome:"saved",outboxMessageId:v.outboxMessageId})).catch(v=>(r(ir),{outcome:"failed",error:v}))),[p]),A=s.useCallback(y=>{i.current&&clearTimeout(i.current),y&&c.current.add(y)},[]);return{saveState:n,saveError:o,saveDraft:E,saveImmediately:w,stopAutoSave:A}},tc=e=>e.outboundCount>0||e.replyCount>0||e.flags?.vip?.value===!0||e.flags?.trusted?.value===!0,nc=e=>e.flags?.blocked?.value===!0?!1:e.flags?.junkOnly?.value!==!0?!0:tc(e),nn=({label:e,addresses:t,onChange:n,placeholder:r,onPendingChange:o,ref:a})=>{const[i,c]=s.useState(""),u=va(i,200),{data:m}=At({...Jo({query:{q:u,limit:8}}),enabled:u.length>=2}),f=s.useMemo(()=>(m?.items??[]).filter(nc).map(l=>({email:l.normalizedEmail,displayName:l.displayName})),[m]);return d.jsx(ja,{label:e,addresses:t,onChange:n,placeholder:r,suggestions:f,onQueryChange:c,onPendingChange:o,ref:a})},rc=({accountId:e,configureRef:t})=>{const n=wa();return d.jsx(Ya,{configureRef:t,onConfigure:()=>{n(e)}})},oc={download:"its dictionary could not be downloaded",engine:"the checker could not start",worker:"the checker stopped running"},ac=e=>{const t=`Spellcheck for ${e.language} is off: ${oc[e.reason]}.`;return{severity:"warning",title:"Spellcheck stopped",detail:`${t} Your browser is checking this message instead. ${e.detail}`,action:{label:"Report this",href:Sr(Rr({title:`Spellcheck stopped: ${e.reason} (${e.language})`,errorMessage:`${t} ${e.detail}`}))}}},sc=e=>({provider:async t=>{const{openSpellcheckWorker:n}=await Tr(async()=>{const{openSpellcheckWorker:r}=await import("./rich-text-spellcheck-worker-provider-NOmoFs4G.js");return{openSpellcheckWorker:r}},__vite__mapDeps([0,1,2,3,4]));return n(t)},onStatus:t=>{t.state==="failed"&&e(ac(t))}}),ic=e=>{if(ea(e)?.code==="mail_sync_off")return Se(e)},Gr=e=>e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,"""),Dt=e=>e.split(`
|
|
43
|
+
`)},ki=0,ze=[];function Li(e){var t=s.useRef([]),n=s.useRef([0,0]),r=s.useRef(),o=s.useState(ki++)[0],a=s.useState(zr)[0],i=s.useRef(e);s.useEffect(function(){i.current=e},[e]),s.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var p=Vo([e.lockRef.current],(e.shards||[]).map(nr),!0).filter(Boolean);return p.forEach(function(E){return E.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),p.forEach(function(E){return E.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var c=s.useCallback(function(p,E){if("touches"in p&&p.touches.length===2||p.type==="wheel"&&p.ctrlKey)return!i.current.allowPinchZoom;var w=bt(p),A=n.current,y="deltaX"in p?p.deltaX:A[0]-w[0],v="deltaY"in p?p.deltaY:A[1]-w[1],D,_=p.target,S=Math.abs(y)>Math.abs(v)?"h":"v";if("touches"in p&&S==="h"&&_.type==="range")return!1;var I=window.getSelection(),N=I&&I.anchorNode,F=N?N===_||N.contains(_):!1;if(F)return!1;var b=er(S,_);if(!b)return!0;if(b?D=S:(D=S==="v"?"h":"v",b=er(S,_)),!b)return!1;if(!r.current&&"changedTouches"in p&&(y||v)&&(r.current=D),!D)return!0;var P=r.current||D;return Ni(P,E,p,P==="h"?y:v)},[]),u=s.useCallback(function(p){var E=p;if(!(!ze.length||ze[ze.length-1]!==a)){var w="deltaY"in E?tr(E):bt(E),A=t.current.filter(function(D){return D.name===E.type&&(D.target===E.target||E.target===D.shadowParent)&&Oi(D.delta,w)})[0];if(A&&A.should){E.cancelable&&E.preventDefault();return}if(!A){var y=(i.current.shards||[]).map(nr).filter(Boolean).filter(function(D){return D.contains(E.target)}),v=y.length>0?c(E,y[0]):!i.current.noIsolation;v&&E.cancelable&&E.preventDefault()}}},[]),m=s.useCallback(function(p,E,w,A){var y={name:p,delta:E,target:w,should:A,shadowParent:Pi(w)};t.current.push(y),setTimeout(function(){t.current=t.current.filter(function(v){return v!==y})},1)},[]),f=s.useCallback(function(p){n.current=bt(p),r.current=void 0},[]),l=s.useCallback(function(p){m(p.type,tr(p),p.target,c(p,e.lockRef.current))},[]),h=s.useCallback(function(p){m(p.type,bt(p),p.target,c(p,e.lockRef.current))},[]);s.useEffect(function(){return ze.push(a),e.setCallbacks({onScrollCapture:l,onWheelCapture:l,onTouchMoveCapture:h}),document.addEventListener("wheel",u,He),document.addEventListener("touchmove",u,He),document.addEventListener("touchstart",f,He),function(){ze=ze.filter(function(p){return p!==a}),document.removeEventListener("wheel",u,He),document.removeEventListener("touchmove",u,He),document.removeEventListener("touchstart",f,He)}},[]);var g=e.removeScrollBar,x=e.inert;return s.createElement(s.Fragment,null,x?s.createElement(a,{styles:Ii(o)}):null,g?s.createElement(xi,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function Pi(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const _i=li(Hr,Li);var Kr=s.forwardRef(function(e,t){return s.createElement(It,xe({},e,{ref:t,sideCar:_i}))});Kr.classNames=It.classNames;const Nl=({enabled:e=!0,bindings:t,capture:n=!1})=>{const r=s.useCallback(o=>{const a=o.target;if(!(a.tagName==="INPUT"||a.tagName==="TEXTAREA"||a.isContentEditable))for(const i of t){if(!(o.key.toLowerCase()===i.key.toLowerCase())||i.action&&qo(i.action)||i.requireShift!==void 0&&i.requireShift!==o.shiftKey)continue;const u=o.ctrlKey||o.metaKey;if(i.requireMeta!==void 0){if(i.requireMeta!==u)continue}else{const m=i.noModifiers??!0,f=u||o.altKey||i.requireShift===void 0&&o.shiftKey;if(m&&f)continue}i.preventDefault&&o.preventDefault(),i.stopPropagation&&(o.stopPropagation(),o.stopImmediatePropagation()),i.handler(o);return}},[t]);s.useEffect(()=>{if(e)return window.addEventListener("keydown",r,n),()=>window.removeEventListener("keydown",r,n)},[e,r,n])},Mi=e=>typeof e=="object"&&e!==null&&"code"in e&&e.code==="attachment_rejected"&&"message"in e&&typeof e.message=="string",ji=new Set(["EmptyFile","UnusableFilename","FileTooLarge","TooManyAttachments"]),rr={status:"uploading"},Yr={status:"attached"},Pe=(e,t)=>({status:"failed",reason:e,retryable:t}),tn=(e,t)=>Mi(t)?Pe(t.message,!ji.has(t.reason)):Pe(`"${e}" could not be attached: ${Se(t)??"the request failed"}. Try again.`,!0),Fi=e=>({key:e.outboxAttachmentId,serverId:e.outboxAttachmentId,file:null,placement:null,contentId:e.contentId,contentType:e.contentType,contentUrl:e.contentUrl,filename:e.filename,sizeBytes:e.sizeBytes,state:e.state==="Stored"?Yr:Pe(`"${e.filename}" did not finish uploading. Remove it and attach it again.`,!1)});class $i{constructor(t){this.deps=t}deps;entries=[];snapshot=[];listeners=new Set;generation=0;draftId;nextKey=0;reservationsInFlight=new Set;inFlight=new Map;mintedAfterRemoval=new Map;removing=new Map;removedListeners=new Set;loaded=!1;subscribe=t=>(this.listeners.add(t),()=>this.listeners.delete(t));getSnapshot=()=>this.snapshot;owns=t=>this.entries.some(n=>n.contentId===t);storedContent=t=>{const n=this.entries.find(r=>r.contentId===t&&r.contentUrl!==null);return n?.contentUrl?{filename:n.filename,contentType:n.contentType,contentUrl:n.contentUrl}:null};isLoaded=()=>this.loaded;refreshLinks=t=>{const n=new Map(t.map(r=>[r.outboxAttachmentId,r.contentUrl]));this.set(this.entries.map(r=>{const o=r.serverId===null?void 0:n.get(r.serverId);return o===void 0?r:{...r,contentUrl:o}}))};onRemoved=t=>(this.removedListeners.add(t),()=>this.removedListeners.delete(t));blockingReason=()=>{const[t]=this.removing.values();if(t!==void 0)return`Removing "${t}"…`;const n=this.entries.find(o=>o.state.status==="uploading");if(n)return`"${n.filename}" is still uploading.`;const r=this.entries.find(o=>o.state.status==="failed");if(r)return`"${r.filename}" is not attached. Try it again or remove it before sending.`};set(t){this.entries=t,this.snapshot=t.map(({key:n,filename:r,sizeBytes:o,state:a})=>({key:n,filename:r,sizeBytes:o,state:a}));for(const n of this.listeners)n()}patch(t,n,r){t===this.generation&&this.entries.some(o=>o.key===n)&&this.set(this.entries.map(o=>o.key===n?{...o,...r}:o))}reserve(t,n){let r=()=>{};const o=new Promise(a=>{r=()=>{this.reservationsInFlight.delete(o),a()}});return this.reservationsInFlight.add(o),{minted:this.deps.transport().mint(t,n),settle:r}}upload=async(t,n,r,o,a)=>{if(a.aborted)return;const i=this.deps.transport(),{minted:c,settle:u}=this.reserve(o,r),m=await c.catch(h=>(this.patch(t,n,{state:tn(r.name,h)}),null));if(m!==null&&a.aborted&&this.mintedAfterRemoval.set(n,m.outboxAttachmentId),m!==null&&!a.aborted&&this.patch(t,n,{serverId:m.outboxAttachmentId,filename:m.filename,contentId:m.contentId,contentType:m.contentType}),u(),m===null||a.aborted)return;const f=await i.put(m.uploadUrl,r,a).then(()=>null,h=>Se(h)??"the connection dropped");if(a.aborted)return;if(f!==null){this.patch(t,n,{state:Pe(`"${m.filename}" did not finish uploading: ${f}. Try again.`,!0)});return}const l=await i.complete(o,m.outboxAttachmentId).catch(h=>(this.patch(t,n,{state:tn(m.filename,h)}),null));l===null||a.aborted||(this.patch(t,n,{state:Yr,contentUrl:l.contentUrl}),t===this.generation&&this.entries.find(h=>h.key===n)?.placement?.stored(r,m.contentId))};settleFailure(t,n,r){if(t!==this.generation)return;const o=this.entries.find(a=>a.key===n);o?.state.status==="failed"&&o.placement?.failed(r)}run=async(t,n,r,o,a)=>{await this.upload(t,n,r,o,a),this.inFlight.get(n)?.signal===a&&this.inFlight.delete(n),this.settleFailure(t,n,r)};syncKept=async t=>{for(;this.reservationsInFlight.size>0;)await Promise.all([...this.reservationsInFlight]);const n=this.draftId;return t!==this.generation||n===void 0?null:this.deps.transport().keep(n,this.entries.flatMap(r=>r.serverId===null?[]:[r.serverId])).then(()=>null,r=>r??new Error("the request failed"))};attach=async(t,n)=>{const r=this.generation,o=t.map(i=>{this.nextKey+=1;const c={key:`local-${this.nextKey}`,serverId:null,file:i,placement:n??null,contentId:null,contentType:i.type||"application/octet-stream",contentUrl:null,filename:i.name,sizeBytes:i.size,state:rr},u=new AbortController;return this.inFlight.set(c.key,u),{entry:c,file:i,signal:u.signal}});this.set([...this.entries,...o.map(({entry:i})=>i)]);const a=await this.deps.ensureDraft();if(a.outcome==="refused"){for(const{entry:i,file:c}of o)this.inFlight.delete(i.key),this.patch(r,i.key,{state:Pe(a.reason,!0)}),this.settleFailure(r,i.key,c);return}r===this.generation&&(this.draftId=a.outboxMessageId,await Promise.all(o.map(({entry:i,file:c,signal:u})=>this.run(r,i.key,c,a.outboxMessageId,u))))};retry=async t=>{const n=this.entries.find(c=>c.key===t);if(!n||n.file===null||this.inFlight.has(t))return;const r=n.file,o=this.generation,a=new AbortController;this.inFlight.set(t,a),this.patch(o,t,{state:rr,serverId:null});const i=await this.deps.ensureDraft();if(i.outcome==="refused"){this.inFlight.delete(t),this.patch(o,t,{state:Pe(i.reason,!0)});return}if(this.draftId=i.outboxMessageId,n.serverId!==null){const c=await this.syncKept(o);if(c!==null){this.inFlight.delete(t),this.patch(o,t,{serverId:n.serverId,state:tn(r.name,c)});return}}await this.run(o,t,r,i.outboxMessageId,a.signal)};remove=async t=>{const n=this.entries.find(c=>c.key===t);if(!n)return;const r=this.generation,o=this.inFlight.get(t);if(this.set(this.entries.filter(c=>c.key!==t)),o&&(this.inFlight.delete(t),o.abort()),n.serverId===null&&!o)return;this.removing.set(t,n.filename),this.set(this.entries);const a=await this.syncKept(r);this.removing.delete(t),this.set(this.entries);const i=n.serverId??this.mintedAfterRemoval.get(t)??null;if(this.mintedAfterRemoval.delete(t),r===this.generation){if(a===null){if(n.contentId===null)return;for(const c of this.removedListeners)c(n.contentId);return}i!==null&&this.set([...this.entries,{...n,serverId:i,file:null,state:Pe(`"${n.filename}" could not be removed: ${Se(a)??"the request failed"}. It is still on the draft — remove it again.`,!1)}])}};load=(t,n)=>{this.draftId=t,this.loaded=!0;const r=new Set(n.map(a=>a.outboxAttachmentId)),o=this.entries.filter(a=>a.file!==null&&(a.serverId===null||!r.has(a.serverId)));this.set([...n.map(Fi),...o])};reset=t=>{this.generation+=1;for(const n of this.inFlight.values())n.abort();this.inFlight.clear(),this.mintedAfterRemoval.clear(),this.removing.clear(),this.draftId=t,this.loaded=!1,this.set([])}}const Bi=(e,t,n)=>fetch(e,{method:"PUT",body:t,signal:n}).then(r=>{if(!r.ok)throw new Error(`the server answered ${r.status}`)}),Ui=({ensureDraft:e})=>{const t=_e({...Ko(),meta:Me}),n=_e({...Yo(),meta:Me}),r=_e({...xr(),meta:Me}),o=s.useRef(null);o.current={mint:(u,m)=>t.mutateAsync({path:{outboxMessageId:u},body:{filename:m.name,contentType:m.type||"application/octet-stream",sizeBytes:m.size}}),put:Bi,complete:(u,m)=>n.mutateAsync({path:{outboxMessageId:u,outboxAttachmentId:m}}).then(f=>({contentUrl:f.contentUrl})),keep:(u,m)=>r.mutateAsync({path:{outboxMessageId:u},body:{attachmentIds:m}}).then(()=>{})};const a=s.useRef(e);a.current=e;const[i]=s.useState(()=>new $i({transport:()=>{const u=o.current;if(!u)throw new Error("attachment transport not ready");return u},ensureDraft:()=>a.current()}));return{items:s.useSyncExternalStore(i.subscribe,i.getSnapshot,i.getSnapshot),attach:i.attach,retry:i.retry,remove:i.remove,load:i.load,reset:i.reset,owns:i.owns,isLoaded:i.isLoaded,refreshLinks:i.refreshLinks,storedContent:i.storedContent,onRemoved:i.onRemoved,blockingReason:i.blockingReason()}},Ol=e=>e==="link-expired"||e==="not-ready";class vn extends Error{reason;status;constructor(t,n,r){super(n),this.name="AttachmentFetchError",this.reason=t,this.status=r}}const Hi="x-remit-403-reason",zi="expired",Wi=(e,t)=>{if(t?.trim()===zi)return"link-expired";const n=la(e,t);return n==="auth"?"auth":n==="body-missing"?"missing":"generic"},Vi=300*1e3,qi=async(e,t)=>{const n={},r=await t();r&&(n.Authorization=`Bearer ${r}`);const o=await Go(e,{headers:n,signal:AbortSignal.timeout(Vi)});if(o.status===202)throw new vn("not-ready","Attachment is still being fetched from the mail server",202);if(!o.ok)throw new vn(Wi(o.status,o.headers.get(Hi)),`Failed to download attachment (${o.status} ${o.statusText})`,o.status);return o.blob()},Ki=(e,t,n)=>{switch(e){case"auth":return{title:"Your session expired",detail:`Sign in again, then download ${t} once more. Other parts of the app may also stop responding until you do.`};case"link-expired":return{title:"This download link expired and could not be renewed",detail:`Reload the page, then download ${t} again. If that keeps failing, this is worth reporting.`};case"missing":return{title:"This attachment is missing from storage",detail:"Remit has the message but not the file. Re-sync the account from Settings, then try again."};case"not-ready":return{title:"Still fetching this attachment",detail:"Remit is downloading it from the mail server now. Try again in a few seconds."};default:return{title:"Couldn't download this attachment",detail:n}}},or=e=>e instanceof vn?e.reason:"generic",Yi=e=>e instanceof Error?e.message:typeof e=="string"?e:"An unexpected error occurred while downloading this attachment.",Il=(e,t,n)=>{if(e!=="auth")return Sr(Rr({title:`Bug: attachment download failed (${e})`,errorMessage:`Downloading "${t}" failed: ${n}`}))},kl=(e,t)=>{const n=URL.createObjectURL(e),r=document.createElement("a");r.href=n,r.download=t,r.rel="noopener",document.body.append(r),r.click(),r.remove(),setTimeout(()=>URL.revokeObjectURL(n),0)},Gi=e=>{const{getToken:t}=Xo(),n=s.useRef({...e,getToken:t});return n.current={...e,getToken:t},s.useMemo(()=>{const r=c=>{const u=n.current;return u.isLoaded()?null:u.draftAttachments.find(m=>m.contentId===c)??null},o=c=>n.current.storedContent(c)??r(c),a=c=>qi(c.contentUrl,n.current.getToken).then(u=>URL.createObjectURL(new Blob([u],{type:c.contentType}))),i=c=>n.current.refreshLinks().then(()=>{const u=o(c);if(!u)throw new Error("the file is no longer on this draft");return a(u)});return{attach:(c,u)=>{n.current.attach(c,u)},owns:c=>n.current.owns(c)||r(c)!==null,onRemoved:c=>n.current.onRemoved(c),resolve:c=>{const u=o(c);return u?a(u).catch(m=>{if(or(m)!=="link-expired")throw m;return i(c)}).catch(m=>{const f=or(m);return n.current.pushError({...Ki(f,u.filename,Yi(m)),error:f==="generic"?m:void 0}),null}):Promise.resolve(null)}}},[])},Xi=(e,t)=>e===void 0&&t.toAddresses.length===0,Qi={status:"unsaved",reason:"Not saved — add a To address to keep this draft."},ar={status:"idle"},Zi={status:"saving"},sr={status:"saved"},ir={status:"error"},Ji=e=>e.then(()=>{},()=>{}),ec=({outboxMessageId:e,onDraftCreated:t})=>{const[n,r]=s.useState(ar),[o,a]=s.useState(null),i=s.useRef(void 0),c=s.useRef(new Set),u=Cr(),m=s.useRef(e),f=s.useRef(e);if(m.current!==e){const y=m.current!==void 0;m.current=e,f.current=e,y&&i.current&&clearTimeout(i.current)}const l=_e({...Qo(),meta:Me}),h=_e({...xr(),meta:Me}),g=s.useCallback(async y=>{r(Zi),a(null);const v=f.current;if(v){const _=await h.mutateAsync({path:{outboxMessageId:v},body:{toAddresses:y.toAddresses,ccAddresses:y.ccAddresses,bccAddresses:y.bccAddresses,subject:y.subject,textBody:y.textBody,htmlBody:y.htmlBody,inReplyTo:y.inReplyTo,references:y.references}});return r(sr),_}const D=await l.mutateAsync({body:{...y,sendImmediately:!1}});return f.current=D.outboxMessageId,t(D.outboxMessageId),r(sr),u.invalidateQueries({queryKey:Zo().queryKey}),D},[l.mutateAsync,h.mutateAsync,t,u]),x=s.useRef(Promise.resolve()),p=s.useCallback(y=>{const v=x.current.then(()=>g(y));return x.current=Ji(v),v},[g]),E=s.useCallback(y=>{if(i.current&&clearTimeout(i.current),Xi(f.current,y)){r(Qi);return}r(v=>v.status==="unsaved"?ar:v),i.current=setTimeout(()=>{const v=f.current;v&&c.current.has(v)||p(y).catch(D=>{a(D),r(ir)})},2e3)},[p]),w=s.useCallback(y=>(i.current&&clearTimeout(i.current),p(y).then(v=>({outcome:"saved",outboxMessageId:v.outboxMessageId})).catch(v=>(r(ir),{outcome:"failed",error:v}))),[p]),A=s.useCallback(y=>{i.current&&clearTimeout(i.current),y&&c.current.add(y)},[]);return{saveState:n,saveError:o,saveDraft:E,saveImmediately:w,stopAutoSave:A}},tc=e=>e.outboundCount>0||e.replyCount>0||e.flags?.vip?.value===!0||e.flags?.trusted?.value===!0,nc=e=>e.flags?.blocked?.value===!0?!1:e.flags?.junkOnly?.value!==!0?!0:tc(e),nn=({label:e,addresses:t,onChange:n,placeholder:r,onPendingChange:o,ref:a})=>{const[i,c]=s.useState(""),u=va(i,200),{data:m}=At({...Jo({query:{q:u,limit:8}}),enabled:u.length>=2}),f=s.useMemo(()=>(m?.items??[]).filter(nc).map(l=>({email:l.normalizedEmail,displayName:l.displayName})),[m]);return d.jsx(ja,{label:e,addresses:t,onChange:n,placeholder:r,suggestions:f,onQueryChange:c,onPendingChange:o,ref:a})},rc=({accountId:e,configureRef:t})=>{const n=wa();return d.jsx(Ya,{configureRef:t,onConfigure:()=>{n(e)}})},oc={download:"its dictionary could not be downloaded",engine:"the checker could not start",worker:"the checker stopped running"},ac=e=>{const t=`Spellcheck for ${e.language} is off: ${oc[e.reason]}.`;return{severity:"warning",title:"Spellcheck stopped",detail:`${t} Your browser is checking this message instead. ${e.detail}`,action:{label:"Report this",href:Sr(Rr({title:`Spellcheck stopped: ${e.reason} (${e.language})`,errorMessage:`${t} ${e.detail}`}))}}},sc=e=>({provider:async t=>{const{openSpellcheckWorker:n}=await Tr(async()=>{const{openSpellcheckWorker:r}=await import("./rich-text-spellcheck-worker-provider-ChKzrvjg.js");return{openSpellcheckWorker:r}},__vite__mapDeps([0,1,2,3,4]));return n(t)},onStatus:t=>{t.state==="failed"&&e(ac(t))}}),ic=e=>{if(ea(e)?.code==="mail_sync_off")return Se(e)},Gr=e=>e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,"""),Dt=e=>e.split(`
|
|
44
44
|
`).map(t=>`<p>${Gr(t)}</p>`).join(""),cc=new Set(["ADDRESS","ARTICLE","BLOCKQUOTE","BR","DIV","H1","H2","H3","H4","H5","H6","HR","LI","OL","P","PRE","SECTION","TABLE","TR","UL"]),lc=e=>{const t=new DOMParser().parseFromString(e,"text/html"),n=[];let r="";const o=()=>{n.push(r.trim()),r=""},a=i=>{if(i.nodeType===i.TEXT_NODE){r+=(i.textContent??"").replace(/\s+/g," ");return}if(i.nodeType!==i.ELEMENT_NODE)return;const c=cc.has(i.tagName);c&&r!==""&&o();for(const u of i.childNodes)a(u);c&&o()};return a(t.body),r!==""&&o(),n.join(`
|
|
45
45
|
`).replace(/\n{3,}/g,`
|
|
46
46
|
|
|
@@ -50,7 +50,7 @@ import{b as vr,j as d,X as gr,p as ln,B as un,L as yr,z as Bo,T as Uo,r as s,y a
|
|
|
50
50
|
`))}${o}`}}const a=dc(t);return{text:[a,...hc(r)].join(`
|
|
51
51
|
`),html:`<p>${Gr(a)}</p><blockquote type="cite">${o}</blockquote>`}},vc=(e,t)=>e===""?t:`${e}
|
|
52
52
|
|
|
53
|
-
${t}`,rn=(e,t,n,r)=>{const o=r?vc(t.text,r.text):t.text;if(e==="plain")return{textBody:o||void 0,htmlBody:""};const a=r?`${t.html}${r.html}`:t.html;return{textBody:o||void 0,htmlBody:a?da(a,n):void 0}},cr=150,gc=()=>{const[e,t]=s.useState(()=>{if(typeof window>"u"||!window.visualViewport)return{viewportHeight:0,isKeyboardOpen:!1};const n=window.visualViewport.height;return{viewportHeight:n,isKeyboardOpen:window.innerHeight-n>cr}});return s.useEffect(()=>{if(typeof window>"u"||!window.visualViewport)return;const n=window.visualViewport,r=()=>{const o=n.height;t({viewportHeight:o,isKeyboardOpen:window.innerHeight-o>cr})};return r(),n.addEventListener("resize",r),()=>n.removeEventListener("resize",r)},[]),e},yc=({selectedAccountId:e,onSelect:t})=>{const{data:n}=At({...Ar(),staleTime:1/0}),r=n?.accounts??[];if(s.useEffect(()=>{!e&&r.length===1&&r[0]&&t(r[0])},[e,r,t]),r.length<=1){const a=r[0];return a?d.jsxs("div",{className:"flex items-start gap-2",children:[d.jsx("label",{className:"text-sm text-fg-muted shrink-0 w-12 pt-1.5",children:"From:"}),d.jsx("div",{className:"text-sm py-1.5",children:a.email})]}):null}const o=r.some(a=>a.accountId===e);return d.jsxs("div",{className:"flex items-start gap-2",children:[d.jsx("label",{htmlFor:"from-account-selector",className:"text-sm text-fg-muted shrink-0 w-12 pt-1.5",children:"From:"}),d.jsxs("select",{id:"from-account-selector",value:o?e:"",onChange:a=>{const i=r.find(c=>c.accountId===a.target.value);i&&t(i)},className:"flex-1 px-2 py-1.5 border rounded-md bg-canvas text-sm",children:[!o&&d.jsx("option",{value:"",disabled:!0,children:"Choose an account"}),r.map(a=>d.jsx("option",{value:a.accountId,children:a.email},a.accountId))]})]})},wc=s.lazy(()=>Tr(()=>import("./rich-text-
|
|
53
|
+
${t}`,rn=(e,t,n,r)=>{const o=r?vc(t.text,r.text):t.text;if(e==="plain")return{textBody:o||void 0,htmlBody:""};const a=r?`${t.html}${r.html}`:t.html;return{textBody:o||void 0,htmlBody:a?da(a,n):void 0}},cr=150,gc=()=>{const[e,t]=s.useState(()=>{if(typeof window>"u"||!window.visualViewport)return{viewportHeight:0,isKeyboardOpen:!1};const n=window.visualViewport.height;return{viewportHeight:n,isKeyboardOpen:window.innerHeight-n>cr}});return s.useEffect(()=>{if(typeof window>"u"||!window.visualViewport)return;const n=window.visualViewport,r=()=>{const o=n.height;t({viewportHeight:o,isKeyboardOpen:window.innerHeight-o>cr})};return r(),n.addEventListener("resize",r),()=>n.removeEventListener("resize",r)},[]),e},yc=({selectedAccountId:e,onSelect:t})=>{const{data:n}=At({...Ar(),staleTime:1/0}),r=n?.accounts??[];if(s.useEffect(()=>{!e&&r.length===1&&r[0]&&t(r[0])},[e,r,t]),r.length<=1){const a=r[0];return a?d.jsxs("div",{className:"flex items-start gap-2",children:[d.jsx("label",{className:"text-sm text-fg-muted shrink-0 w-12 pt-1.5",children:"From:"}),d.jsx("div",{className:"text-sm py-1.5",children:a.email})]}):null}const o=r.some(a=>a.accountId===e);return d.jsxs("div",{className:"flex items-start gap-2",children:[d.jsx("label",{htmlFor:"from-account-selector",className:"text-sm text-fg-muted shrink-0 w-12 pt-1.5",children:"From:"}),d.jsxs("select",{id:"from-account-selector",value:o?e:"",onChange:a=>{const i=r.find(c=>c.accountId===a.target.value);i&&t(i)},className:"flex-1 px-2 py-1.5 border rounded-md bg-canvas text-sm",children:[!o&&d.jsx("option",{value:"",disabled:!0,children:"Choose an account"}),r.map(a=>d.jsx("option",{value:a.accountId,children:a.email},a.accountId))]})]})},wc=s.lazy(()=>Tr(()=>import("./rich-text-Ds4rQc2o.js"),__vite__mapDeps([5,2,3,1,6,7,8,9,10,11,4,12,13,14,15,16,17,18,19])).then(e=>({default:e.ComposeBody}))),lr=e=>e?`<p></p><p>-- </p>${Dt(e)}`:"",Et=(e,t)=>t?{html:`${Dt(t.body)}${lr(e)}`,text:[t.body,e].filter(Boolean).join(`
|
|
54
54
|
|
|
55
55
|
`)}:{html:lr(e),text:e},bc=e=>e?/^re:\s/i.test(e)?e:`Re: ${e}`:"Re: ",Ec=e=>e?/^fwd?:\s/i.test(e)?e:`Fwd: ${e}`:"Fwd: ",xc=(e,t,n)=>{const{envelope:r}=e,a=(r.replyTo.length>0?r.replyTo:r.from).map(m=>({email:m.normalizedEmail,displayName:m.displayName}));if(t!=="reply-all")return{to:a,cc:[]};const i=n?.toLowerCase(),c=new Set(a.map(m=>m.email.toLowerCase())),u=[...r.to,...r.cc].filter(m=>m.normalizedEmail.toLowerCase()!==i&&!c.has(m.normalizedEmail.toLowerCase())).map(m=>({email:m.normalizedEmail,displayName:m.displayName}));return{to:a,cc:u}},ur=e=>{const t=e.envelope.messageIdValue,n=a=>e.references.filter(i=>i.referenceType===a).sort((i,c)=>i.referenceOrder-c.referenceOrder).map(i=>i.messageIdValue),r=n("references"),o=r.length>0?[...r]:n("in_reply_to");return t&&!o.includes(t)&&o.push(t),{inReplyTo:t,references:o}},Sc="Add a To address before sending.",Rc="Loading the message you're quoting.",Cc="The message you're quoting couldn't be loaded, so it won't be included.",Tc="Add a To address before attaching a file — the draft the file is kept with is saved against it.",Ac=({label:e,text:t})=>`${e} holds "${t}", which is not an address.`,dr=e=>e.find(t=>t.text.trim()!==""),Dc={entries:[],unparsed:""},Nc=(e,t,n,r,o)=>e.length===0&&t.length===0&&n.length===0&&r.trim()===""&&o.text.trim()==="",Oc=({documentGeneration:e,selectedAccountId:t,onAccountChange:n,toAddresses:r,setToAddresses:o,ccAddresses:a,setCcAddresses:i,bccAddresses:c,setBccAddresses:u,showCc:m,setShowCc:f,showBcc:l,setShowBcc:h,subject:g,setSubject:x,fieldHandles:p,onToPendingChange:E})=>{const w=ba(),{isKeyboardOpen:A}=gc(),[y,v]=s.useState(void 0),D=y===e,[_,S]=s.useState(!1);return d.jsx("div",{className:"contents",onFocusCapture:()=>S(!0),onBlurCapture:I=>{I.currentTarget.contains(I.relatedTarget)||S(!1)},children:d.jsx(Wa,{collapsed:!w&&A&&!D&&!_,onExpand:()=>v(e),summary:za({to:r,cc:a,bcc:c,subject:g}),from:d.jsx(yc,{selectedAccountId:t,onSelect:n}),to:d.jsx(nn,{label:"To",addresses:r,onChange:o,placeholder:"Recipients",onPendingChange:E,ref:p.to}),cc:m?d.jsx(nn,{label:"Cc",addresses:a,onChange:i,ref:p.cc}):void 0,bcc:l?d.jsx(nn,{label:"Bcc",addresses:c,onChange:u,ref:p.bcc}):void 0,subject:d.jsx(Ga,{value:g,onChange:x}),onShowCc:()=>f(!0),onShowBcc:()=>h(!0)})})},Ll=({mode:e,account:t,sourceMessage:n,outboxMessageId:r,seed:o,insertion:a,onDraftCreated:i,onClose:c,onAccountChange:u,layout:m="fill"})=>{const{startSendPolling:f}=na(),{pushError:l}=ra(),[h,g]=s.useState([]),[x,p]=s.useState([]),[E,w]=s.useState([]),[A,y]=s.useState(Dc),v=s.useRef(null),D=s.useRef(null),_=s.useRef(null),S=s.useMemo(()=>({to:v,cc:D,bcc:_}),[]),I=s.useCallback(()=>{v.current?.clearPending(),D.current?.clearPending(),_.current?.clearPending()},[]),[N,F]=s.useState(""),[b,P]=s.useState(!1),[C,q]=s.useState(!1),[$,Q]=s.useState(t?.accountId),[W,ee]=s.useState(!1),[ne,ye]=s.useState(r),Fe=s.useRef(void 0),Ce=s.useRef(!1),de=s.useRef(null),Te=s.useRef(r),Ae=s.useRef(r!==void 0),[De,Ne]=s.useState(r!==void 0),fe=s.useRef(r!==void 0?e:void 0),Oe=s.useRef(void 0),$e=s.useRef(e);$e.current=e;const me=s.useRef(t?.accountId);s.useEffect(()=>{const T=t?.accountId;!T||me.current===T||(me.current=T,!Ae.current&&Q(T))},[t?.accountId]),s.useEffect(()=>{const T=Te.current;if(T===r||(Te.current=r,T===void 0))return;Ae.current=r!==void 0,Ne(r!==void 0),fe.current=r!==void 0?$e.current:void 0,Oe.current=void 0;const U=r?{html:"",text:""}:Et(qe.current,k.current);g([]),p([]),w([]),I(),F(""),P(!1),q(!1),at(U.html),he(U.text),Xe("rich"),it(void 0),be({...U,formatting:[]}),Ye(Z=>Z+1),ee(!1),Fe.current=void 0,Ce.current=!1,ye(r)},[r,I]);const{signature:we}=fa($),qe=s.useRef(we.plainText);qe.current=we.plainText;const k=s.useRef(o);k.current=o;const[Ke,Ye]=s.useState(0),[Ge,at]=s.useState(()=>Et(we.plainText,o).html),[Lt,he]=s.useState(()=>Et(we.plainText,o).text),[ce,Xe]=s.useState("rich"),[re,Pt]=s.useState("en"),[st,it]=s.useState(),[pe,be]=s.useState(()=>({...Et(we.plainText,o),formatting:[]})),[_t,ct]=s.useState(()=>a?.version??0),Mt=a&&a.version>_t&&(r===void 0||W)?a:void 0,{data:j,error:Qe}=At({..._n({path:{outboxMessageId:r??""}}),enabled:!!r&&!W,meta:ia,retry:(T,U)=>!Mn(U)&&T<1});s.useEffect(()=>{Mn(Qe)&&c()},[Qe,c]),s.useEffect(()=>{if(!j||W)return;g(j.toAddresses.map(K=>({email:K,displayName:void 0}))),j.ccAddresses&&j.ccAddresses.length>0&&(p(j.ccAddresses.map(K=>({email:K,displayName:void 0}))),P(!0)),j.bccAddresses&&j.bccAddresses.length>0&&(w(j.bccAddresses.map(K=>({email:K,displayName:void 0}))),q(!0)),j.subject&&F(j.subject);const T=ma(j.htmlBody??""),U=T.html,Z=j.textBody??"";Xe(is(j.htmlBody)),it(T.language??void 0),at(U),he(Z),be({html:U,text:Z,formatting:[]}),Ye(K=>K+1),Q(j.accountId),ee(!0),Ce.current=!0},[j,W]),s.useEffect(()=>{if(n){if(Ae.current&&fe.current===e){const T=Oe.current;if(!T||T.myEmail===t?.email)return}if(fe.current=e,Oe.current={myEmail:t?.email},I(),e==="reply"||e==="reply-all"){const{to:T,cc:U}=xc(n,e,t?.email);g(T),p(U),U.length>0&&P(!0),F(bc(n.envelope.subject))}e==="forward"&&(g([]),p([]),w([]),F(Ec(n.envelope.subject)))}},[e,n,t?.email,I]);const Ie=e==="reply"||e==="reply-all"||e==="forward",{data:ke,isLoading:lt,isError:jt,hasNoRenderablePart:Ft,refetch:O}=ua({messageId:n?.message.messageId,bodyParts:n?.bodyParts,enabled:Ie&&!!n}),M=e==="forward"?"forward":"reply",B=Ie&&!n,L=Ie&&!De&&Ft,H=L&&M==="forward",z=s.useMemo(()=>{if(!Ie||!n||De||!ke)return;const T=ke.kind==="html"?{kind:"html",content:ss(ke.body)}:{kind:"text",content:ke.body};return pc(e==="forward"?"forward":"reply",n.envelope,T)},[Ie,n,De,ke,e]),X=n?.envelope.from[0]?.displayName??n?.envelope.from[0]?.normalizedEmail,le=s.useCallback(T=>{ee(!0),ye(T),i(T)},[i]),{saveState:te,saveError:oe,saveDraft:se,saveImmediately:J,stopAutoSave:ue}=ec({outboxMessageId:r,onDraftCreated:le}),ut=s.useCallback(async()=>{if(r)return{outcome:"ready",outboxMessageId:r};if(!$)return{outcome:"refused",reason:"Choose an account to send from before attaching a file."};if(h.length===0)return{outcome:"refused",reason:Tc};const{htmlBody:T,textBody:U}=rn(ce,pe,re,z),Z=await J({accountId:$,toAddresses:h.map(K=>K.email),ccAddresses:x.length>0?x.map(K=>K.email):void 0,bccAddresses:E.length>0?E.map(K=>K.email):void 0,subject:N||void 0,textBody:U,htmlBody:T,...n&&(e==="reply"||e==="reply-all")?ur(n):{}});return Z.outcome==="failed"?{outcome:"refused",reason:`The draft could not be saved, so the file was not attached: ${Se(Z.error)??"the request failed"}.`}:{outcome:"ready",outboxMessageId:Z.outboxMessageId}},[r,$,h,x,E,N,pe,ce,re,z,n,e,J]),{items:xo,attach:$t,retry:So,remove:Ro,load:Rn,reset:Cn,owns:Co,isLoaded:To,refreshLinks:Ao,storedContent:Do,onRemoved:No,blockingReason:Bt}=Ui({ensureDraft:ut}),Oo=Cr(),Io=Gi({attach:$t,owns:Co,isLoaded:To,storedContent:Do,refreshLinks:()=>r?Oo.fetchQuery({..._n({path:{outboxMessageId:r}}),staleTime:0}).then(T=>Ao(T.attachments)):Promise.resolve(),onRemoved:No,draftAttachments:j&&j.outboxMessageId===r?j.attachments:[],pushError:l}),Tn=s.useRef(r);s.useEffect(()=>{const T=Tn.current;T!==r&&(Tn.current=r,T!==void 0&&Cn(r))},[r,Cn]);const An=s.useRef(void 0);s.useEffect(()=>{!j||j.outboxMessageId!==r||An.current!==j.outboxMessageId&&(An.current=j.outboxMessageId,Rn(j.outboxMessageId,j.attachments))},[j,r,Rn]),s.useEffect(()=>{oe&&l({title:"Couldn't save draft",detail:Se(oe)??"Saving the draft failed.",error:oe})},[oe,l]);const Dn=_e({...oa(),meta:Me}),Nn=_e({...sa(),meta:Me,onError:T=>{l(aa("Couldn't discard draft","The draft wasn't discarded.",T))}}),{data:ko}=At({...Ar(),staleTime:1/0}),Ze=ko?.accounts.find(T=>T.accountId===$),Ut=Ze?pa(Ze):!1,[Ht,Lo]=s.useState(),zt=Ht&&Ht.accountId===$?Ht.reason:void 0,dt=Ze?.composeLanguages,Po=s.useMemo(()=>dt&&dt.length>0?dt:ha(navigator.languages),[dt]),_o=s.useMemo(()=>sc(l),[l]),ft=s.useRef(!1),[On,In]=s.useState(!1),mt=s.useCallback((T,U)=>On?{status:"sending"}:$?zt?{status:"blocked",reason:zt}:Ut?{status:"blocked",reason:dn}:lt||B?{status:"blocked",reason:Rc}:Bt?{status:"blocked",reason:Bt}:U?{status:"blocked",reason:Ac(U)}:T===0?{status:"blocked",reason:Sc}:H?{status:"blocked",reason:kr}:{status:"ready",accountId:$}:{status:"blocked",reason:"Choose an account to send from."},[On,$,zt,Ut,lt,B,Bt,H]),Wt=s.useMemo(()=>mt(h.length+A.entries.length,dr([{label:"To",text:A.unparsed}])),[mt,h.length,A]),Mo=Wt;s.useEffect(()=>{if(!$||ft.current||ne!==void 0&&ne!==r||r&&!W||Nc(h,x,E,N,pe))return;const{htmlBody:T,textBody:U}=rn(ce,pe,re,z),Z={accountId:$,toAddresses:h.map(ae=>ae.email),ccAddresses:x.length>0?x.map(ae=>ae.email):void 0,bccAddresses:E.length>0?E.map(ae=>ae.email):void 0,subject:N||void 0,textBody:U,htmlBody:T},K=JSON.stringify(Z);if(Ce.current){Ce.current=!1,Fe.current=K;return}Fe.current!==K&&(Fe.current=void 0,se(Z))},[$,r,ne,W,h,x,E,N,pe,ce,re,z,se]);const kn=s.useCallback(async(T,U)=>{if(!ft.current){ft.current=!0,In(!0);try{ue();const Z=n&&(e==="reply"||e==="reply-all")?ur(n):{},{htmlBody:K,textBody:ae}=rn(ce,pe,re,z),$o=!r,ht=await J({accountId:T,toAddresses:U.to.map(ve=>ve.email),ccAddresses:U.cc.length>0?U.cc.map(ve=>ve.email):void 0,bccAddresses:U.bcc.length>0?U.bcc.map(ve=>ve.email):void 0,subject:N||void 0,textBody:ae,htmlBody:K,...Z});if(ht.outcome==="failed"){l({title:"Couldn't send message",detail:Se(ht.error)??"Saving the message failed, so nothing was sent. Try again.",error:ht.error});return}const qt=ht.outboxMessageId;if(await Dn.mutateAsync({path:{outboxMessageId:qt}}).catch(ve=>{const Pn=ic(ve);return Pn&&Lo({accountId:T,reason:Pn}),l({title:"Couldn't send message",detail:Se(ve)??($o?"The draft was saved but the send request failed. Try again from the Outbox.":"The send request failed. Try again."),error:ve}),null})===null)return;ue(qt),f(qt),c()}finally{ft.current=!1,In(!1)}}},[N,pe,ce,re,z,e,n,r,J,Dn,ue,f,l,c]),jo=s.useCallback(()=>{ue(r),r&&Nn.mutate({path:{outboxMessageId:r}}),c()},[ue,r,Nn,c]),Vt=s.useCallback(T=>{l({title:"Can't send yet",detail:T}),T===dn&&de.current?.focus()},[l]),Ln=s.useCallback(()=>{if(Wt.status==="sending")return;const T=S.to.current?.commitPending(),U=S.cc.current?.commitPending(),Z=S.bcc.current?.commitPending(),K={to:T?.addresses??h,cc:U?.addresses??x,bcc:Z?.addresses??E},ae=mt(K.to.length,dr([{label:"To",text:T?.unparsed??""},{label:"Cc",text:U?.unparsed??""},{label:"Bcc",text:Z?.unparsed??""}]));if(ae.status!=="sending"){if(ae.status==="blocked"){Vt(ae.reason);return}kn(ae.accountId,K)}},[Wt.status,S,h,x,E,mt,Vt,kn]),Fo=s.useCallback(T=>{Q(T.accountId),u?.(T)},[u]);return d.jsx(Ha,{layout:m,onDropFiles:T=>{$t(T)},banner:d.jsxs(d.Fragment,{children:[Ze&&Ut?d.jsx(rc,{accountId:Ze.accountId,configureRef:de}):null,L?d.jsx(Ka,{mode:M}):null,jt?d.jsxs(wr,{tone:"warning","data-testid":"compose-quote-failed",children:[d.jsx("span",{children:Cc})," ",d.jsx("button",{type:"button",className:"underline",onClick:()=>{O()},children:"Try again"})]}):null]}),header:d.jsx(Oc,{documentGeneration:Ke,selectedAccountId:$,onAccountChange:Fo,toAddresses:h,setToAddresses:g,ccAddresses:x,setCcAddresses:p,bccAddresses:E,setBccAddresses:w,showCc:b,setShowCc:P,showBcc:C,setShowBcc:q,subject:N,setSubject:F,fieldHandles:S,onToPendingChange:y}),quoted:z?d.jsx(Xa,{text:z.text,html:z.html,senderName:X}):void 0,attachments:d.jsx($a,{items:xo,onRemove:T=>{Ro(T)},onRetry:T=>{So(T)}}),actionBar:d.jsx(Ia,{send:Mo,onSend:Ln,onBlocked:Vt,onDiscard:jo,save:te,onAttach:T=>{$t(T)}}),children:d.jsx(s.Suspense,{fallback:d.jsx(Ba,{}),children:d.jsx(wc,{mode:ce,onModeChange:Xe,initialHtml:Ge,initialText:Lt,onChange:be,onSubmit:Ln,initialCaret:e==="new"?"start":void 0,onConversionError:l,languages:Po,initialLanguage:st,onLanguageChange:Pt,spellcheck:_o,insertion:Mt,onInserted:ct,inlineImages:Io},Ke)})})};var kt="Dialog",[Qr]=us(kt),[Ic,ie]=Qr(kt),Zr=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:o,onOpenChange:a,modal:i=!0}=e,c=s.useRef(null),u=s.useRef(null),[m,f]=ms({prop:r,defaultProp:o??!1,onChange:a,caller:kt});return d.jsx(Ic,{scope:t,triggerRef:c,contentRef:u,contentId:Xt(),titleId:Xt(),descriptionId:Xt(),open:m,onOpenChange:f,onOpenToggle:s.useCallback(()=>f(l=>!l),[f]),modal:i,children:n})};Zr.displayName=kt;var Jr="DialogTrigger",kc=s.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=ie(Jr,n),a=je(t,o.triggerRef);return d.jsx(ge.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.open?o.contentId:void 0,"data-state":xn(o.open),...r,ref:a,onClick:Re(e.onClick,o.onOpenToggle)})});kc.displayName=Jr;var En="DialogPortal",[Lc,eo]=Qr(En,{forceMount:void 0}),to=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:o}=e,a=ie(En,t);return d.jsx(Lc,{scope:t,forceMount:n,children:s.Children.map(r,i=>d.jsx(Ot,{present:n||a.open,children:d.jsx($r,{asChild:!0,container:o,children:i})}))})};to.displayName=En;var Nt="DialogOverlay",no=s.forwardRef((e,t)=>{const n=eo(Nt,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,a=ie(Nt,e.__scopeDialog);return a.modal?d.jsx(Ot,{present:r||a.open,children:d.jsx(_c,{...o,ref:t})}):null});no.displayName=Nt;var Pc=Pr("DialogOverlay.RemoveScroll"),_c=s.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=ie(Nt,n),a=ks(),i=je(t,a);return d.jsx(Kr,{as:Pc,allowPinchZoom:!0,shards:[o.contentRef],children:d.jsx(ge.div,{"data-state":xn(o.open),...r,ref:i,style:{pointerEvents:"auto",...r.style}})})}),Ve="DialogContent",ro=s.forwardRef((e,t)=>{const n=eo(Ve,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,a=ie(Ve,e.__scopeDialog);return d.jsx(Ot,{present:r||a.open,children:a.modal?d.jsx(Mc,{...o,ref:t}):d.jsx(jc,{...o,ref:t})})});ro.displayName=Ve;var Mc=s.forwardRef((e,t)=>{const n=ie(Ve,e.__scopeDialog),r=s.useRef(null),o=je(t,n.contentRef,r);return s.useEffect(()=>{const a=r.current;if(a)return ei(a)},[]),d.jsx(oo,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:n.open,onCloseAutoFocus:Re(e.onCloseAutoFocus,a=>{a.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:Re(e.onPointerDownOutside,a=>{const i=a.detail.originalEvent,c=i.button===0&&i.ctrlKey===!0;(i.button===2||c)&&a.preventDefault()}),onFocusOutside:Re(e.onFocusOutside,a=>a.preventDefault())})}),jc=s.forwardRef((e,t)=>{const n=ie(Ve,e.__scopeDialog),r=s.useRef(!1),o=s.useRef(!1);return d.jsx(oo,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:a=>{e.onCloseAutoFocus?.(a),a.defaultPrevented||(r.current||n.triggerRef.current?.focus(),a.preventDefault()),r.current=!1,o.current=!1},onInteractOutside:a=>{e.onInteractOutside?.(a),a.defaultPrevented||(r.current=!0,a.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const i=a.target;n.triggerRef.current?.contains(i)&&a.preventDefault(),a.detail.originalEvent.type==="focusin"&&o.current&&a.preventDefault()}})}),oo=s.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:a,...i}=e,c=ie(Ve,n);return Ms(),d.jsx(d.Fragment,{children:d.jsx(jr,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:a,children:d.jsx(_r,{role:"dialog",id:c.contentId,"aria-describedby":c.descriptionId,"aria-labelledby":c.titleId,"data-state":xn(c.open),...i,ref:t,deferPointerDownOutside:!0,onDismiss:()=>c.onOpenChange(!1)})})})}),ao="DialogTitle",so=s.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=ie(ao,n);return d.jsx(ge.h2,{id:o.titleId,...r,ref:t})});so.displayName=ao;var io="DialogDescription",Fc=s.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=ie(io,n);return d.jsx(ge.p,{id:o.descriptionId,...r,ref:t})});Fc.displayName=io;var co="DialogClose",$c=s.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=ie(co,n);return d.jsx(ge.button,{type:"button",...r,ref:t,onClick:Re(e.onClick,()=>o.onOpenChange(!1))})});$c.displayName=co;function xn(e){return e?"open":"closed"}function Bc(e){if(typeof document>"u")return;let t=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",t.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}const lo=R.createContext({drawerRef:{current:null},overlayRef:{current:null},onPress:()=>{},onRelease:()=>{},onDrag:()=>{},onNestedDrag:()=>{},onNestedOpenChange:()=>{},onNestedRelease:()=>{},openProp:void 0,dismissible:!1,isOpen:!1,isDragging:!1,keyboardIsOpen:{current:!1},snapPointsOffset:null,snapPoints:null,handleOnly:!1,modal:!1,shouldFade:!1,activeSnapPoint:null,onOpenChange:()=>{},setActiveSnapPoint:()=>{},closeDrawer:()=>{},direction:"bottom",shouldAnimate:{current:!0},shouldScaleBackground:!1,setBackgroundColorOnScale:!0,noBodyStyles:!1,container:null,autoFocus:!1}),ot=()=>{const e=R.useContext(lo);if(!e)throw new Error("useDrawerContext must be used within a Drawer.Root");return e};Bc(`[data-vaul-drawer]{touch-action:none;will-change:transform;transition:transform .5s cubic-bezier(.32, .72, 0, 1);animation-duration:.5s;animation-timing-function:cubic-bezier(0.32,0.72,0,1)}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=bottom][data-state=open]{animation-name:slideFromBottom}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=bottom][data-state=closed]{animation-name:slideToBottom}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=top][data-state=open]{animation-name:slideFromTop}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=top][data-state=closed]{animation-name:slideToTop}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=left][data-state=open]{animation-name:slideFromLeft}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=left][data-state=closed]{animation-name:slideToLeft}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=right][data-state=open]{animation-name:slideFromRight}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=right][data-state=closed]{animation-name:slideToRight}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=bottom]{transform:translate3d(0,var(--initial-transform,100%),0)}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=top]{transform:translate3d(0,calc(var(--initial-transform,100%) * -1),0)}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=left]{transform:translate3d(calc(var(--initial-transform,100%) * -1),0,0)}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=right]{transform:translate3d(var(--initial-transform,100%),0,0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=top]{transform:translate3d(0,var(--snap-point-height,0),0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=bottom]{transform:translate3d(0,var(--snap-point-height,0),0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=left]{transform:translate3d(var(--snap-point-height,0),0,0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=right]{transform:translate3d(var(--snap-point-height,0),0,0)}[data-vaul-overlay][data-vaul-snap-points=false]{animation-duration:.5s;animation-timing-function:cubic-bezier(0.32,0.72,0,1)}[data-vaul-overlay][data-vaul-snap-points=false][data-state=open]{animation-name:fadeIn}[data-vaul-overlay][data-state=closed]{animation-name:fadeOut}[data-vaul-animate=false]{animation:none!important}[data-vaul-overlay][data-vaul-snap-points=true]{opacity:0;transition:opacity .5s cubic-bezier(.32, .72, 0, 1)}[data-vaul-overlay][data-vaul-snap-points=true]{opacity:1}[data-vaul-drawer]:not([data-vaul-custom-container=true])::after{content:'';position:absolute;background:inherit;background-color:inherit}[data-vaul-drawer][data-vaul-drawer-direction=top]::after{top:initial;bottom:100%;left:0;right:0;height:200%}[data-vaul-drawer][data-vaul-drawer-direction=bottom]::after{top:100%;bottom:initial;left:0;right:0;height:200%}[data-vaul-drawer][data-vaul-drawer-direction=left]::after{left:initial;right:100%;top:0;bottom:0;width:200%}[data-vaul-drawer][data-vaul-drawer-direction=right]::after{left:100%;right:initial;top:0;bottom:0;width:200%}[data-vaul-overlay][data-vaul-snap-points=true]:not([data-vaul-snap-points-overlay=true]):not(
|
|
56
56
|
[data-state=closed]
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as o}from"./index-fsuIswbe.js";import{C as r}from"./CollectionPane-BzktgIp0.js";import"./useCollectionThreads-DgofDKen.js";import"./useQueries-DPH-PeHV.js";import"./useInfiniteQuery-B-vOuANs.js";import"./MessageToolbar-DeDUhCvg.js";import"./MessageBody-jG4Dhul6.js";import"./kbd-jzPSd-a2.js";import"./search-scope-B-3MTDpD.js";import"./app-chrome-BfyGOiSA.js";import"./nav-link-ed0mFCCx.js";import"./useMediaQuery-Hy81MQ2M.js";import"./reply-CXuSMyqp.js";import"./useMessageBodyContent-CpTD2HGg.js";import"./roving-focus-DZX7IpN4.js";import"./chevron-down-De4wQzka.js";import"./search-token-index-BYKMNlJD.js";import"./useLabels-k1VKuQrr.js";import"./index-Caon2n2j.js";import"./useSignature-W9HBbZ_n.js";import"./account-form-helpers-DhckT_PN.js";import"./useDebouncedValue-CFZ4EPXW.js";import"./suggest-list-BCqr1j26.js";import"./sections-DpRVKuXF.js";import"./useJunkMailboxIds-CW7aI25D.js";import"./badge-BB80tGxy.js";import"./undo-2-D1IMLq7c.js";import"./DropdownMenu-C2J8u8zN.js";import"./refresh-cw-Cu9_I3cT.js";import"./popover-menu-DhcuKv1N.js";import"./ErrorState-BTHOmsYP.js";import"./mail-BzFJWQZy.js";import"./download-DEuAIIIQ.js";import"./avatar-Bq7beWCy.js";import"./EmptyState-BJU14tbt.js";import"./circle-question-mark-DhNa_A16.js";import"./useFilters-DHWZEIQe.js";import"./select-TYdrgtW5.js";import"./plus-D5-2sA5v.js";import"./calendar-suggestion-EosZrXZC.js";import"./useCalendarSuggestions-DXbA0boT.js";import"./agenda-time-D0yU-H44.js";import"./calendar-format-BwCpz-JZ.js";import"./calendar-Ds9kgvU8.js";import"./calendar-failure-note-C4gNXDQV.js";import"./checkbox-CYOm-zGr.js";import"./clock-Dds4zv6u.js";import"./segmented-control-BwvsufVp.js";import"./useLayoutTier-BNUKvwJD.js";import"./menu-Bh94jr77.js";import"./folder-input-B0q8wLhf.js";import"./confirm-dialog-XvccFJdE.js";import"./label-chip-DtBVyALF.js";import"./cloud-off-BYulqayx.js";import"./MailViewChrome-CLgaFbe-.js";import"./wizard-selection-zWa1qc6-.js";function mo(){return o.jsx(r.Reading,{})}export{mo as component};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{fu as o,j as r}from"./index-fsuIswbe.js";import{C as m}from"./CalendarEventPopup-D6PNfUfu.js";import"./useCalendarSuggestions-DXbA0boT.js";import"./ErrorState-BTHOmsYP.js";import"./useQueries-DPH-PeHV.js";import"./useCalendarData-DFG3pzeG.js";import"./useCalendarTasks-b_UNFPQH.js";import"./calendar-format-BwCpz-JZ.js";import"./nav-link-ed0mFCCx.js";import"./useMediaQuery-Hy81MQ2M.js";import"./calendar-Ds9kgvU8.js";import"./reply-CXuSMyqp.js";import"./CalendarSession-BosFoHg2.js";import"./calendar-event-popup-Cr_LW8IP.js";import"./pencil-BDbmS56C.js";import"./calendar-guests-Cay9Ub8h.js";import"./circle-question-mark-DhNa_A16.js";import"./confirm-dialog-XvccFJdE.js";function b(){const{calendarObjectId:t}=o.useParams();return r.jsx(m,{calendarObjectId:t})}export{b as component};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as o}from"./index-fsuIswbe.js";import{M as i}from"./MailboxPane-BxNCkl6s.js";import"./useInfiniteQuery-B-vOuANs.js";import"./MessageToolbar-DeDUhCvg.js";import"./MessageBody-jG4Dhul6.js";import"./kbd-jzPSd-a2.js";import"./search-scope-B-3MTDpD.js";import"./app-chrome-BfyGOiSA.js";import"./nav-link-ed0mFCCx.js";import"./useMediaQuery-Hy81MQ2M.js";import"./reply-CXuSMyqp.js";import"./useMessageBodyContent-CpTD2HGg.js";import"./roving-focus-DZX7IpN4.js";import"./chevron-down-De4wQzka.js";import"./search-token-index-BYKMNlJD.js";import"./useQueries-DPH-PeHV.js";import"./useLabels-k1VKuQrr.js";import"./index-Caon2n2j.js";import"./useSignature-W9HBbZ_n.js";import"./account-form-helpers-DhckT_PN.js";import"./useDebouncedValue-CFZ4EPXW.js";import"./suggest-list-BCqr1j26.js";import"./sections-DpRVKuXF.js";import"./useJunkMailboxIds-CW7aI25D.js";import"./badge-BB80tGxy.js";import"./undo-2-D1IMLq7c.js";import"./DropdownMenu-C2J8u8zN.js";import"./refresh-cw-Cu9_I3cT.js";import"./popover-menu-DhcuKv1N.js";import"./ErrorState-BTHOmsYP.js";import"./mail-BzFJWQZy.js";import"./download-DEuAIIIQ.js";import"./avatar-Bq7beWCy.js";import"./EmptyState-BJU14tbt.js";import"./circle-question-mark-DhNa_A16.js";import"./useFilters-DHWZEIQe.js";import"./select-TYdrgtW5.js";import"./plus-D5-2sA5v.js";import"./calendar-suggestion-EosZrXZC.js";import"./useCalendarSuggestions-DXbA0boT.js";import"./agenda-time-D0yU-H44.js";import"./calendar-format-BwCpz-JZ.js";import"./calendar-Ds9kgvU8.js";import"./calendar-failure-note-C4gNXDQV.js";import"./checkbox-CYOm-zGr.js";import"./clock-Dds4zv6u.js";import"./segmented-control-BwvsufVp.js";import"./useLayoutTier-BNUKvwJD.js";import"./menu-Bh94jr77.js";import"./folder-input-B0q8wLhf.js";import"./confirm-dialog-XvccFJdE.js";import"./label-chip-DtBVyALF.js";import"./cloud-off-BYulqayx.js";import"./useRefreshControl-DdbTrGxq.js";import"./circle-check-big-CMsxQSjY.js";import"./LabelApplyTrigger-P8IoLKME.js";import"./MailViewChrome-CLgaFbe-.js";import"./NavMenuButton-CLp6InRG.js";import"./shield-check-C-tOrPEx.js";import"./bottom-sheet-DKF_Dkid.js";import"./circle-check-DlR8I4Hf.js";function so(){return o.jsx(i.Reading,{})}export{so as component};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{fx as t,j as m}from"./index-fsuIswbe.js";import{C as p}from"./CalendarEventPopup-D6PNfUfu.js";import"./useCalendarSuggestions-DXbA0boT.js";import"./ErrorState-BTHOmsYP.js";import"./useQueries-DPH-PeHV.js";import"./useCalendarData-DFG3pzeG.js";import"./useCalendarTasks-b_UNFPQH.js";import"./calendar-format-BwCpz-JZ.js";import"./nav-link-ed0mFCCx.js";import"./useMediaQuery-Hy81MQ2M.js";import"./calendar-Ds9kgvU8.js";import"./reply-CXuSMyqp.js";import"./CalendarSession-BosFoHg2.js";import"./calendar-event-popup-Cr_LW8IP.js";import"./pencil-BDbmS56C.js";import"./calendar-guests-Cay9Ub8h.js";import"./circle-question-mark-DhNa_A16.js";import"./confirm-dialog-XvccFJdE.js";function b(){const{calendarObjectId:r,recurrenceId:o}=t.useParams();return m.jsx(p,{calendarObjectId:r,recurrenceId:o})}export{b as component};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as r}from"./index-fsuIswbe.js";import{B as o}from"./BriefPane-BQx5RRpb.js";import"./MessageToolbar-DeDUhCvg.js";import"./MessageBody-jG4Dhul6.js";import"./kbd-jzPSd-a2.js";import"./search-scope-B-3MTDpD.js";import"./app-chrome-BfyGOiSA.js";import"./nav-link-ed0mFCCx.js";import"./useMediaQuery-Hy81MQ2M.js";import"./reply-CXuSMyqp.js";import"./useMessageBodyContent-CpTD2HGg.js";import"./roving-focus-DZX7IpN4.js";import"./chevron-down-De4wQzka.js";import"./search-token-index-BYKMNlJD.js";import"./useQueries-DPH-PeHV.js";import"./useLabels-k1VKuQrr.js";import"./index-Caon2n2j.js";import"./useSignature-W9HBbZ_n.js";import"./account-form-helpers-DhckT_PN.js";import"./useDebouncedValue-CFZ4EPXW.js";import"./suggest-list-BCqr1j26.js";import"./sections-DpRVKuXF.js";import"./useJunkMailboxIds-CW7aI25D.js";import"./badge-BB80tGxy.js";import"./undo-2-D1IMLq7c.js";import"./DropdownMenu-C2J8u8zN.js";import"./refresh-cw-Cu9_I3cT.js";import"./popover-menu-DhcuKv1N.js";import"./ErrorState-BTHOmsYP.js";import"./mail-BzFJWQZy.js";import"./download-DEuAIIIQ.js";import"./avatar-Bq7beWCy.js";import"./EmptyState-BJU14tbt.js";import"./circle-question-mark-DhNa_A16.js";import"./useFilters-DHWZEIQe.js";import"./select-TYdrgtW5.js";import"./plus-D5-2sA5v.js";import"./calendar-suggestion-EosZrXZC.js";import"./useCalendarSuggestions-DXbA0boT.js";import"./agenda-time-D0yU-H44.js";import"./calendar-format-BwCpz-JZ.js";import"./calendar-Ds9kgvU8.js";import"./calendar-failure-note-C4gNXDQV.js";import"./checkbox-CYOm-zGr.js";import"./clock-Dds4zv6u.js";import"./segmented-control-BwvsufVp.js";import"./useLayoutTier-BNUKvwJD.js";import"./menu-Bh94jr77.js";import"./folder-input-B0q8wLhf.js";import"./confirm-dialog-XvccFJdE.js";import"./label-chip-DtBVyALF.js";import"./cloud-off-BYulqayx.js";import"./LabelApplyTrigger-P8IoLKME.js";import"./useRefreshControl-DdbTrGxq.js";import"./circle-check-big-CMsxQSjY.js";import"./wizard-selection-zWa1qc6-.js";function mr(){return r.jsx(o.Reading,{})}export{mr as component};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as o}from"./index-fsuIswbe.js";import{C as r}from"./CollectionPane-BzktgIp0.js";import"./useCollectionThreads-DgofDKen.js";import"./useQueries-DPH-PeHV.js";import"./useInfiniteQuery-B-vOuANs.js";import"./MessageToolbar-DeDUhCvg.js";import"./MessageBody-jG4Dhul6.js";import"./kbd-jzPSd-a2.js";import"./search-scope-B-3MTDpD.js";import"./app-chrome-BfyGOiSA.js";import"./nav-link-ed0mFCCx.js";import"./useMediaQuery-Hy81MQ2M.js";import"./reply-CXuSMyqp.js";import"./useMessageBodyContent-CpTD2HGg.js";import"./roving-focus-DZX7IpN4.js";import"./chevron-down-De4wQzka.js";import"./search-token-index-BYKMNlJD.js";import"./useLabels-k1VKuQrr.js";import"./index-Caon2n2j.js";import"./useSignature-W9HBbZ_n.js";import"./account-form-helpers-DhckT_PN.js";import"./useDebouncedValue-CFZ4EPXW.js";import"./suggest-list-BCqr1j26.js";import"./sections-DpRVKuXF.js";import"./useJunkMailboxIds-CW7aI25D.js";import"./badge-BB80tGxy.js";import"./undo-2-D1IMLq7c.js";import"./DropdownMenu-C2J8u8zN.js";import"./refresh-cw-Cu9_I3cT.js";import"./popover-menu-DhcuKv1N.js";import"./ErrorState-BTHOmsYP.js";import"./mail-BzFJWQZy.js";import"./download-DEuAIIIQ.js";import"./avatar-Bq7beWCy.js";import"./EmptyState-BJU14tbt.js";import"./circle-question-mark-DhNa_A16.js";import"./useFilters-DHWZEIQe.js";import"./select-TYdrgtW5.js";import"./plus-D5-2sA5v.js";import"./calendar-suggestion-EosZrXZC.js";import"./useCalendarSuggestions-DXbA0boT.js";import"./agenda-time-D0yU-H44.js";import"./calendar-format-BwCpz-JZ.js";import"./calendar-Ds9kgvU8.js";import"./calendar-failure-note-C4gNXDQV.js";import"./checkbox-CYOm-zGr.js";import"./clock-Dds4zv6u.js";import"./segmented-control-BwvsufVp.js";import"./useLayoutTier-BNUKvwJD.js";import"./menu-Bh94jr77.js";import"./folder-input-B0q8wLhf.js";import"./confirm-dialog-XvccFJdE.js";import"./label-chip-DtBVyALF.js";import"./cloud-off-BYulqayx.js";import"./MailViewChrome-CLgaFbe-.js";import"./wizard-selection-zWa1qc6-.js";function mo(){return o.jsx(r.Reading,{})}export{mo as component};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as t,ad as o}from"./index-fsuIswbe.js";const n=()=>t.jsx(o,{to:"/settings/accounts"});export{n as component};
|