@remit/web-client-dist 0.0.691 → 0.0.692

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.
Files changed (182) hide show
  1. package/assets/{BriefPane-uBrSdO9E.js → BriefPane-B8ecM3zB.js} +1 -1
  2. package/assets/{CalendarEventEditor-CW-VkuRj.js → CalendarEventEditor-9IlkB0YL.js} +1 -1
  3. package/assets/{CalendarEventPopup-Dr1Zl88E.js → CalendarEventPopup-Dgio1io7.js} +1 -1
  4. package/assets/{CalendarLoadFailed-CqaZI6s0.js → CalendarLoadFailed-BrNZqBKA.js} +1 -1
  5. package/assets/{CalendarQuickCreate-BSauej6s.js → CalendarQuickCreate-By7rnSuh.js} +1 -1
  6. package/assets/{CalendarSession-UbavgUO4.js → CalendarSession-CjfkNnKN.js} +1 -1
  7. package/assets/{DesktopChrome-DSs02PMr.js → DesktopChrome-CjDc9EdH.js} +1 -1
  8. package/assets/{DropdownMenu-DlTVA419.js → DropdownMenu-D4QQzyrH.js} +1 -1
  9. package/assets/{EmptyState-3mzd9Rr2.js → EmptyState-DiS0VQW5.js} +1 -1
  10. package/assets/{ErrorState-Czrn8Njd.js → ErrorState-BmGgdm41.js} +1 -1
  11. package/assets/{FlaggedPane-Duxks4wd.js → FlaggedPane-kBIob-rC.js} +1 -1
  12. package/assets/{FullCompose-C6ydcOqj.js → FullCompose-ZjHfjPwG.js} +1 -1
  13. package/assets/{LabelApplyTrigger-BeYgQjx0.js → LabelApplyTrigger-OJ81BaYH.js} +1 -1
  14. package/assets/{MailShell-qe4eiESL.js → MailShell-BO8c-sH6.js} +1 -1
  15. package/assets/{MailViewChrome-DmD7yKe9.js → MailViewChrome-DfgW3Ikc.js} +1 -1
  16. package/assets/{MailboxPane-Cd7n8_0e.js → MailboxPane-BRUYtKC7.js} +1 -1
  17. package/assets/{MessageBody-Dx9mvb7l.js → MessageBody-BIp2OZY6.js} +1 -1
  18. package/assets/{MessageToolbar-D_XE8m4l.js → MessageToolbar-BzxIP4DM.js} +1 -1
  19. package/assets/{NavMenuButton-B9iy2p3f.js → NavMenuButton-CkmJu7iR.js} +1 -1
  20. package/assets/{OnboardingWizard-Cb8hwkpv.js → OnboardingWizard-reo_AB5t.js} +1 -1
  21. package/assets/{OutboxPane-CByBDVdV.js → OutboxPane-qaAt9-sk.js} +1 -1
  22. package/assets/{ReportLink-CVPckN6-.js → ReportLink-DVR5iYy8.js} +1 -1
  23. package/assets/_calendarObjectId-DNhcPvtT.js +1 -0
  24. package/assets/_mailboxId-ThNYujv3.js +1 -0
  25. package/assets/_messageId-CKJI1yyc.js +1 -0
  26. package/assets/_messageId-ChPDqFRo.js +1 -0
  27. package/assets/_messageId-zm_VBLaY.js +1 -0
  28. package/assets/_outboxMessageId-DcDyjoYW.js +1 -0
  29. package/assets/_recurrenceId-C0Y19B2U.js +1 -0
  30. package/assets/{_slotId-BLO1Rmfd.js → _slotId-BwEkuNG8.js} +1 -1
  31. package/assets/_threadId-CmA2aUrS.js +1 -0
  32. package/assets/_threadId-Cqj7hjyS.js +1 -0
  33. package/assets/_threadId-DI4EN6E1.js +1 -0
  34. package/assets/{_view._date-CZiRXVFR.js → _view._date-XDQ3AudE.js} +1 -1
  35. package/assets/{account-service-status-DLPjTYw9.js → account-service-status-DJyM-qfq.js} +1 -1
  36. package/assets/{accounts-Dl4YCzpm.js → accounts-Dei0QQHb.js} +1 -1
  37. package/assets/{advanced-CgXbUOtb.js → advanced-CmaLt1-e.js} +1 -1
  38. package/assets/{agenda-time-KJVZW5dD.js → agenda-time-9aN7iZnW.js} +1 -1
  39. package/assets/{app-chrome-1USNGfE3.js → app-chrome-DEclDxYQ.js} +1 -1
  40. package/assets/{appearance-C6nkCe1H.js → appearance-UFpWVtEM.js} +1 -1
  41. package/assets/{avatar-Bo0EUTkm.js → avatar-DZNFp-l_.js} +1 -1
  42. package/assets/{badge-C7MFP1pN.js → badge-DXTfgcBt.js} +1 -1
  43. package/assets/{bottom-sheet-C9u72VJg.js → bottom-sheet-CBxZPIwF.js} +1 -1
  44. package/assets/brief-MY0I_pcw.js +1 -0
  45. package/assets/{brief-CMzu4LMD.js → brief-fIZB7Fkj.js} +1 -1
  46. package/assets/{calendar-iY8BLzO2.js → calendar-BIfjhUb1.js} +1 -1
  47. package/assets/{calendar-B8lLrLAb.js → calendar-CmjULz3U.js} +1 -1
  48. package/assets/{calendar-event-popup-C92tAdsE.js → calendar-event-popup-By-Wnzww.js} +1 -1
  49. package/assets/{calendar-event-sidebar-CahohNiL.js → calendar-event-sidebar-DqoVNv2n.js} +1 -1
  50. package/assets/{calendar-failure-note-D746wu0r.js → calendar-failure-note-CmQObVh4.js} +1 -1
  51. package/assets/{calendar-guests-DnrOkTr7.js → calendar-guests-DivZiKa8.js} +1 -1
  52. package/assets/{calendar-suggestion-yCUw5guW.js → calendar-suggestion-CO8Q4tfB.js} +1 -1
  53. package/assets/{calendars-ZADJ8TZ1.js → calendars-Dpds3q2Z.js} +1 -1
  54. package/assets/{card-5b65wlka.js → card-BkVHxya_.js} +1 -1
  55. package/assets/{checkbox-CvgfSohd.js → checkbox-Cxv99wmn.js} +1 -1
  56. package/assets/{chevron-down-CR89KUgK.js → chevron-down-CuQovlNy.js} +1 -1
  57. package/assets/{chevron-left-DSaOqH7y.js → chevron-left-CO-V7AVZ.js} +1 -1
  58. package/assets/{circle-check-9HYVTIrG.js → circle-check-H4iBGaFc.js} +1 -1
  59. package/assets/{circle-check-big-p6il4Jr3.js → circle-check-big-Q5xMZBl1.js} +1 -1
  60. package/assets/{circle-question-mark-BVVFmkJG.js → circle-question-mark-Dt4vUSbc.js} +1 -1
  61. package/assets/{classification-BoqrRObl.js → classification-0ZO1lOyG.js} +1 -1
  62. package/assets/{clock-D6gctGNH.js → clock-Ctw4TG15.js} +1 -1
  63. package/assets/compose._-_outboxMessageId_-B1VRxkLN.js +1 -0
  64. package/assets/compose._-_outboxMessageId_-C46VmFN6.js +1 -0
  65. package/assets/compose._-_outboxMessageId_-CNjOOJSh.js +1 -0
  66. package/assets/compose._-_outboxMessageId_-P_jyR3kH.js +1 -0
  67. package/assets/{config-import-BtJdN8VN.js → config-import-_7OioB2-.js} +1 -1
  68. package/assets/{confirm-dialog-DYNhLVrG.js → confirm-dialog-C8W1RcOV.js} +1 -1
  69. package/assets/{copy-BwtY4IWi.js → copy-Eu3Pxnsn.js} +1 -1
  70. package/assets/{credential-steps-Czm9bF6Y.js → credential-steps-D8_QxBU3.js} +1 -1
  71. package/assets/{download-V38kBiT1.js → download-B9mjNNRB.js} +1 -1
  72. package/assets/{draft-C849UdJB.js → draft-OCADnKfj.js} +1 -1
  73. package/assets/edit-AzkegsLe.js +1 -0
  74. package/assets/edit-qD-xofN1.js +1 -0
  75. package/assets/{external-link-BVJU7bpX.js → external-link-Byo-O3sb.js} +1 -1
  76. package/assets/{file-braces-CEQVt7jm.js → file-braces-CskVbU-i.js} +1 -1
  77. package/assets/{filters-D9G5dAF4.js → filters-DEBkAOGr.js} +1 -1
  78. package/assets/{flagged-CwOw5Xxs.js → flagged-A9fk8Fz2.js} +1 -1
  79. package/assets/flagged-D6O3EhIo.js +1 -0
  80. package/assets/{folder-input-Bgx-bBiO.js → folder-input-hWCgPqfm.js} +1 -1
  81. package/assets/{folders-Bn_4Y9H0.js → folders-Dfg9m7Cm.js} +1 -1
  82. package/assets/{help-copy-Bo651f-_.js → help-copy-CnlNZ8sK.js} +1 -1
  83. package/assets/{import-BfiMMK8M.js → import-BIxL3HZr.js} +1 -1
  84. package/assets/index-BA_isERD.js +1 -0
  85. package/assets/index-BI3VHL-i.js +1 -0
  86. package/assets/index-C-PJeYPQ.js +1 -0
  87. package/assets/index-CKJI1yyc.js +1 -0
  88. package/assets/index-COXNp0IG.js +1 -0
  89. package/assets/index-CfV5o-lD.js +1 -0
  90. package/assets/index-ChPDqFRo.js +1 -0
  91. package/assets/index-CkmUVU7Z.js +1 -0
  92. package/assets/{index-BnBpXn45.js → index-CmOAOx38.js} +3 -3
  93. package/assets/{index-B7CBca9v.js → index-CpNGDsVT.js} +4 -4
  94. package/assets/index-CrZmkeYk.js +1 -0
  95. package/assets/index-zm_VBLaY.js +1 -0
  96. package/assets/{kbd-CE7JGsTx.js → kbd-BMGsOR5H.js} +1 -1
  97. package/assets/{label-chip-CbKg_yMt.js → label-chip-OfJL52HU.js} +1 -1
  98. package/assets/{labels-DWadctIQ.js → labels-jKncGvQ3.js} +1 -1
  99. package/assets/{mail-DtD-4wOO.js → mail-Bf1kTy2y.js} +1 -1
  100. package/assets/{mail-BG3D2i2e.js → mail-qvbIZwSA.js} +1 -1
  101. package/assets/{menu-B8nM2lya.js → menu-g1nN4c6m.js} +1 -1
  102. package/assets/{nav-link-CjSE3MDU.js → nav-link-Bdv8kjEd.js} +1 -1
  103. package/assets/new-Dcxxskrf.js +1 -0
  104. package/assets/onboarding-cRvBetgB.js +1 -0
  105. package/assets/{onboarding-completion-EUidFdVK.js → onboarding-completion-CjqVIsEV.js} +1 -1
  106. package/assets/outbox-CTC-6RuN.js +1 -0
  107. package/assets/{pencil-rhg9PvnD.js → pencil-C3mJE9QO.js} +1 -1
  108. package/assets/{people-DWWALdDd.js → people-ClLsRDo6.js} +1 -1
  109. package/assets/{plus-B2EF0VhA.js → plus-B9Kjb5MA.js} +1 -1
  110. package/assets/{popover-menu-nz-n7B2h.js → popover-menu-kMqLztgE.js} +1 -1
  111. package/assets/{refresh-cw-COcXRex1.js → refresh-cw-DdZ8vtf2.js} +1 -1
  112. package/assets/{reply-CzX8Q1T1.js → reply-BBXEHuds.js} +1 -1
  113. package/assets/{rich-text-BIDloC3-.js → rich-text-DTsRvBWK.js} +1 -1
  114. package/assets/{rich-text-spellcheck-worker-provider-BahuahVp.js → rich-text-spellcheck-worker-provider-Bf2g3xpp.js} +1 -1
  115. package/assets/{rotate-ccw-D5rIVkpa.js → rotate-ccw-DU-xqseJ.js} +1 -1
  116. package/assets/{roving-focus-DWCPniMZ.js → roving-focus-h-W142Au.js} +1 -1
  117. package/assets/{row-actions-CLp_pk6R.js → row-actions-CJJYnXCz.js} +1 -1
  118. package/assets/{search-mirror-CM2HNuGA.js → search-mirror-CqXcmXWg.js} +1 -1
  119. package/assets/{search-scope-fyP_uHeh.js → search-scope-BCz9qlCH.js} +1 -1
  120. package/assets/{search-token-index-YOjFNFJN.js → search-token-index-e0cXuR4s.js} +1 -1
  121. package/assets/{sections-DsqY4M13.js → sections-40tp2E7G.js} +1 -1
  122. package/assets/{segmented-control-IDK8fpO7.js → segmented-control-CMCgmRqX.js} +1 -1
  123. package/assets/{select-DWBegMNA.js → select-CpLCf4_c.js} +1 -1
  124. package/assets/{senders-ap9QQK-k.js → senders-DjPDuDhf.js} +1 -1
  125. package/assets/settings-CWQQ_e-3.js +1 -0
  126. package/assets/{settings-screen-BN-3qNrj.js → settings-screen-Bx-jomcC.js} +1 -1
  127. package/assets/{shield-check-CW6Yah30.js → shield-check-BbVUhw_R.js} +1 -1
  128. package/assets/{suggest-list-DMRnmTaR.js → suggest-list-gj7TdgNf.js} +1 -1
  129. package/assets/{suggested-vips-Gtwi6sFb.js → suggested-vips-D9pkriav.js} +1 -1
  130. package/assets/{suggestion._suggestionId-BHxPFUy0.js → suggestion._suggestionId-BsoCLJDm.js} +1 -1
  131. package/assets/{switch-B87JY9ce.js → switch-D9ilXr2Z.js} +1 -1
  132. package/assets/{task._calendarTaskId-r7Jl9ABh.js → task._calendarTaskId-c5dsQ5Rn.js} +1 -1
  133. package/assets/{undo-2-D-cmVG46.js → undo-2-B0kA9_bY.js} +1 -1
  134. package/assets/{useCalendarData-Djtg1pj2.js → useCalendarData-QcaY0Cgc.js} +1 -1
  135. package/assets/{useCalendarScheduling-D222yR_U.js → useCalendarScheduling-BXMaoFja.js} +1 -1
  136. package/assets/{useCalendarSuggestions-COzKAJgT.js → useCalendarSuggestions-iprVdeF2.js} +1 -1
  137. package/assets/{useCalendarTasks-D5yN61q_.js → useCalendarTasks-D9R56VL3.js} +1 -1
  138. package/assets/{useDebouncedValue-CahHw3v4.js → useDebouncedValue-M5m0kaQD.js} +1 -1
  139. package/assets/{useFilters-CmYwNOKM.js → useFilters-BybioZf1.js} +1 -1
  140. package/assets/{useLabels-BxK35B_o.js → useLabels-iMMBj-Ba.js} +1 -1
  141. package/assets/{useLayoutTier-xkhKNk1V.js → useLayoutTier-BpSsrmgl.js} +1 -1
  142. package/assets/{useMediaQuery-DOpCuIgp.js → useMediaQuery-uf6mjwPE.js} +1 -1
  143. package/assets/{useMessageBodyContent-DzlZ514L.js → useMessageBodyContent-CsZ9VCHu.js} +1 -1
  144. package/assets/{useQueries-BomGTQs-.js → useQueries-DeYJYa06.js} +1 -1
  145. package/assets/{useRefreshControl-BAZSbaBz.js → useRefreshControl-ByEWNZY9.js} +1 -1
  146. package/assets/{useResultFolderIndex-D9sJhyey.js → useResultFolderIndex-BksYikib.js} +1 -1
  147. package/assets/{useSignature-Boz2_w0h.js → useSignature-klArqmQ3.js} +1 -1
  148. package/assets/{warnings-BEW4lkgR.js → warnings-B1lLZh5p.js} +1 -1
  149. package/index.html +1 -1
  150. package/package.json +1 -1
  151. package/assets/_calendarObjectId-Dus6Z_aO.js +0 -1
  152. package/assets/_mailboxId-DA2rNZ6D.js +0 -1
  153. package/assets/_messageId-CBEFnj_-.js +0 -1
  154. package/assets/_messageId-CoU9lExJ.js +0 -1
  155. package/assets/_messageId-UN1wPrb5.js +0 -1
  156. package/assets/_outboxMessageId-Crw8NNd4.js +0 -1
  157. package/assets/_recurrenceId-DN3W2Byk.js +0 -1
  158. package/assets/_threadId-CGEJtUok.js +0 -1
  159. package/assets/_threadId-CrzKmCrt.js +0 -1
  160. package/assets/_threadId-D5at7_2j.js +0 -1
  161. package/assets/brief-DYSQ_oRb.js +0 -1
  162. package/assets/compose._-_outboxMessageId_-Cv8p7Ifc.js +0 -1
  163. package/assets/compose._-_outboxMessageId_-Dj0vXnYT.js +0 -1
  164. package/assets/compose._-_outboxMessageId_-Dsv-7Ma0.js +0 -1
  165. package/assets/compose._-_outboxMessageId_-_t-bMwDD.js +0 -1
  166. package/assets/edit-D9CdMYNH.js +0 -1
  167. package/assets/edit-Dhgn_BMZ.js +0 -1
  168. package/assets/flagged-aucGpj-Z.js +0 -1
  169. package/assets/index--IxFGldl.js +0 -1
  170. package/assets/index-BWpSJ9nc.js +0 -1
  171. package/assets/index-BkkdzHr6.js +0 -1
  172. package/assets/index-CBEFnj_-.js +0 -1
  173. package/assets/index-CoU9lExJ.js +0 -1
  174. package/assets/index-CqG3g67K.js +0 -1
  175. package/assets/index-DL3ZaCDr.js +0 -1
  176. package/assets/index-DlNRygfs.js +0 -1
  177. package/assets/index-Dw2xSkAT.js +0 -1
  178. package/assets/index-UN1wPrb5.js +0 -1
  179. package/assets/new-C7PkD0CK.js +0 -1
  180. package/assets/onboarding-BSC6mmKf.js +0 -1
  181. package/assets/outbox-DQD-mHZK.js +0 -1
  182. package/assets/settings-D2KYecr5.js +0 -1
@@ -1 +1 @@
1
- import{b as O,e as I,f as R,bI as E,bJ as T,bK as A,bL as L,bM as z,bN as F,bO as M,bP as v,r as c,j as e,aB as k,B as x,X as U,ap as B,bQ as g,b5 as H,aq as Q,bR as _,d as b,bS as q,bT as C,bU as w,u as K,ac as W}from"./index-BnBpXn45.js";import{R as S}from"./ReportLink-CVPckN6-.js";import{C as Y}from"./copy-BwtY4IWi.js";import{D as G,a as h,b as $}from"./DropdownMenu-DlTVA419.js";import{a as J}from"./sections-DsqY4M13.js";import{S as X}from"./settings-screen-BN-3qNrj.js";import"./avatar-Bo0EUTkm.js";import"./badge-C7MFP1pN.js";import"./chevron-left-DSaOqH7y.js";import"./menu-B8nM2lya.js";import"./circle-question-mark-BVVFmkJG.js";const P={name:"ellipsis",size:24,node:[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]],aliases:["more-horizontal"]};P.node;const V=O(P),Z=async({action:s,person:t},r)=>{const n={userId:t.userId};if(s==="SignOut"){const{data:a}=await z({path:n,body:{stepUpToken:r},throwOnError:!0});return{person:a,resetUrl:void 0}}if(s==="ResetPassword"){const{data:a}=await F({path:n,body:{stepUpToken:r},throwOnError:!0});return{person:a.person,resetUrl:a.resetUrl}}const{data:o}=await M({path:n,body:{status:s==="Disable"?"Disabled":"Active",stepUpToken:r},throwOnError:!0});return{person:o,resetUrl:void 0}},ee=s=>{const t=I();return R({meta:E,gcTime:0,mutationFn:async r=>{const{data:n}=await L({body:{password:s,action:r.action,userId:r.person.userId},throwOnError:!0});return Z(r,n.stepUpToken)},onSuccess:({person:r})=>{t.setQueryData(T(),n=>n&&{people:A(n.people,r)})}})},se="That is not your password. Try again.",te="Five wrong passwords in 15 minutes. Wait 15 minutes, then try again.";function ne({action:s,person:t,onCancel:r,onDone:n,onFailed:o}){const a=v(s,t.email),[l,p]=c.useState(""),[u,m]=c.useState(null),i=ee(l),d=()=>{i.isPending||r()},D=f=>{f.preventDefault(),!(i.isPending||l==="")&&(m(null),i.mutate({action:s,person:t},{onSuccess:n,onError:y=>{const j=g(y);if(j.kind==="wrongPassword"){p(""),m(se);return}if(j.kind==="locked"){p(""),m(te);return}if(j.kind==="signedOut"){r(),H();return}o(y)}}))};return e.jsx(k,{open:!0,onClose:d,title:a.title,children:e.jsxs("form",{onSubmit:D,children:[e.jsxs("header",{className:"flex items-center gap-2 border-b border-line px-5 py-3",children:[e.jsx("span",{className:"flex-1 text-sm font-semibold text-fg",children:a.title}),e.jsx(x,{variant:"ghost",size:"sm",icon:e.jsx(U,{className:"size-3.5"}),onClick:d,"aria-label":"Close"})]}),e.jsxs("div",{className:"space-y-4 px-5 py-4 text-sm text-fg-muted",children:[e.jsx("p",{children:a.body}),e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsx("label",{htmlFor:"people-step-up-password",className:"text-xs font-medium text-fg",children:"Your password"}),e.jsx(B,{id:"people-step-up-password",autoComplete:"current-password",value:l,onChange:f=>{p(f.target.value),m(null)},"aria-invalid":u!==null,"aria-describedby":"people-step-up-hint",required:!0}),e.jsx("p",{id:"people-step-up-hint",className:"text-xs",children:u?e.jsx("span",{className:"text-danger",role:"alert",children:u}):"Confirm with your own password. It counts for this one action."})]})]}),e.jsxs("footer",{className:"flex items-center justify-end gap-2 border-t border-line px-5 py-3",children:[e.jsx(x,{variant:"secondary",size:"sm",onClick:d,children:"Cancel"}),e.jsx(x,{type:"submit",variant:a.destructive?"danger":"primary",size:"sm",disabled:l==="","aria-busy":i.isPending,children:a.confirmLabel})]})]})})}const re=()=>{};function ae({email:s,resetUrl:t,onDone:r}){const[n,o]=c.useState(!1),[a,l]=c.useState(!1),p=()=>{navigator.clipboard.writeText(t).then(()=>{l(!1),o(!0)}).catch(()=>l(!0))};return e.jsxs(k,{open:!0,onClose:re,title:`Reset link for ${s}`,children:[e.jsxs("header",{className:"border-b border-line px-5 py-3 text-sm font-semibold text-fg",children:["Reset link for ",s]}),e.jsxs("div",{className:"space-y-4 px-5 py-4 text-sm text-fg-muted",children:[e.jsx("p",{children:"They are signed out everywhere. Give them this link, by message or in person. It works once, for 24 hours."}),e.jsxs("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center",children:[e.jsx(x,{variant:"primary",size:"sm",icon:n?e.jsx(Q,{className:"size-3.5"}):e.jsx(Y,{className:"size-3.5"}),onClick:p,children:n?"Copied":"Copy"}),e.jsx("input",{readOnly:!0,tabIndex:-1,value:t,"aria-label":`Reset link for ${s}`,onFocus:u=>u.currentTarget.select(),className:"min-w-0 flex-1 rounded-sm border border-line bg-surface px-2 py-1.5 font-mono text-xs text-fg sm:order-first"})]}),a&&e.jsx("p",{className:"text-xs text-danger",role:"alert",children:"Copying did not work in this browser. Select the link and copy it by hand."}),e.jsx("p",{children:"You see this link only now. Close this window and it is gone. Make a new one if it gets lost."})]}),e.jsx("footer",{className:"flex justify-end border-t border-line px-5 py-3",children:e.jsx(x,{variant:"secondary",size:"sm",onClick:r,children:"Done"})})]})}const N="The list of people did not load";function oe({failure:s}){const t=c.useRef(null);return c.useEffect(()=>{t.current?.focus()},[]),e.jsx("div",{ref:t,tabIndex:-1,className:"outline-none",children:e.jsxs(b,{tone:"danger",children:[e.jsx("p",{className:"font-medium",children:s.title}),e.jsx("p",{className:"mt-1 text-fg-muted",children:s.reason}),e.jsx("p",{className:"mt-1",children:e.jsx(S,{href:C(s.title,s.error)})})]})})}function ie({person:s,onPick:t}){const r=s.status==="Disabled";return e.jsxs(G,{trigger:e.jsxs(e.Fragment,{children:[e.jsx(V,{className:"size-4","aria-hidden":"true"}),e.jsxs("span",{className:"sr-only",children:["Actions for ",s.email]})]}),children:[e.jsx(h,{onClick:()=>t("SignOut"),children:"Sign out everywhere"}),e.jsx(h,{onClick:()=>t("ResetPassword"),children:"Reset password"}),e.jsx($,{}),r?e.jsx(h,{onClick:()=>t("Enable"),children:"Enable"}):e.jsx(h,{onClick:()=>t("Disable"),disabled:s.isCaller,destructive:!s.isCaller,children:e.jsxs("span",{className:"flex flex-col",children:[e.jsx("span",{children:"Disable"}),s.isCaller&&e.jsx("span",{className:"text-xs text-fg-subtle",children:"Not your own account"})]})})]})}function le({people:s,onPick:t}){const r=new Date;return e.jsx("div",{className:"overflow-x-auto rounded-sm border border-line bg-surface",children:e.jsxs("table",{className:"w-full text-left text-sm",children:[e.jsx("thead",{className:"border-b border-line text-xs text-fg-muted",children:e.jsxs("tr",{children:[e.jsx("th",{scope:"col",className:"px-3 py-2 font-medium",children:"Email"}),e.jsx("th",{scope:"col",className:"px-3 py-2 font-medium",children:"Created"}),e.jsx("th",{scope:"col",className:"px-3 py-2 font-medium",children:"Last sign-in"}),e.jsx("th",{scope:"col",className:"px-3 py-2 font-medium",children:"Sessions"}),e.jsx("th",{scope:"col",className:"px-3 py-2 font-medium",children:"Status"}),e.jsx("th",{scope:"col",className:"w-12 px-1 py-2",children:e.jsx("span",{className:"sr-only",children:"Actions"})})]})}),e.jsx("tbody",{children:s.map(n=>e.jsxs("tr",{className:"border-b border-line last:border-b-0",children:[e.jsxs("td",{className:"px-3 py-1 text-fg",children:[n.email,n.isCaller&&e.jsx("span",{className:"text-fg-muted",children:" (you)"})]}),e.jsx("td",{className:"px-3 py-1 text-fg-muted",children:w(n.createdAt,r)}),e.jsx("td",{className:"px-3 py-1 text-fg-muted",children:w(n.lastSignInAt,r)}),e.jsx("td",{className:"px-3 py-1 tabular-nums text-fg-muted",children:n.sessionCount}),e.jsx("td",{className:n.status==="Disabled"?"px-3 py-1 text-danger":"px-3 py-1 text-fg-muted",children:n.status}),e.jsx("td",{className:"px-1 py-1",children:e.jsx(ie,{person:n,onPick:o=>t(o,n)})})]},n.userId))})]})})}function ce(){const s=_(),[t,r]=c.useState(null),[n,o]=c.useState(null),[a,l]=c.useState(null);if(s.isPending)return e.jsx("div",{className:"h-24 animate-pulse rounded-sm border border-line bg-surface","aria-busy":"true","aria-label":"Loading people"});if(s.unavailable)return e.jsx(b,{tone:"info",children:"This server has no People page. It shows on a self-hosted server once self sign-up is turned off."});if(s.isError)return g(s.error).kind==="signedOut"?null:e.jsxs(b,{tone:"danger",children:[e.jsxs("p",{className:"font-medium",children:[N,"."]}),e.jsx("p",{className:"mt-1 text-fg-muted",children:q(s.error)}),e.jsxs("p",{className:"mt-2 flex items-center gap-3",children:[e.jsx(x,{variant:"secondary",size:"sm",onClick:()=>{s.refetch()},children:"Try again"}),e.jsx(S,{href:C(N,s.error)})]})]});const p=(i,d)=>{o(null),r({action:i,person:d})},u=i=>{i.resetUrl&&t&&l({email:t.person.email,resetUrl:i.resetUrl}),r(null)},m=i=>{if(!t)return;const d=g(i);o({title:v(t.action,t.person.email).failedTitle,reason:d.kind==="failed"?d.reason:"Something went wrong. Nothing changed. Try again.",error:i}),r(null)};return e.jsxs("div",{className:"space-y-4",children:[n&&e.jsx(oe,{failure:n}),e.jsx(le,{people:s.data.people,onPick:p}),t&&e.jsx(ne,{action:t.action,person:t.person,onCancel:()=>r(null),onDone:u,onFailed:m}),a&&e.jsx(ae,{email:a.email,resetUrl:a.resetUrl,onDone:()=>l(null)})]})}const de=e.jsxs("div",{className:"space-y-3",children:[e.jsx("p",{children:"Anyone signed in here can manage every account. Each action asks for your own password first, and is recorded with who took it and from where."}),e.jsx("p",{children:"Disabling an account signs that person out within 15 minutes and stops their calendar feed links. Their mail stays. You cannot disable your own account, so one account always stays on."}),e.jsx("p",{children:"A reset link works once, for 24 hours, and is shown only once. Making one stops the old password at once."}),e.jsxs("p",{children:["The person who runs this server can turn all sign-in off with"," ",e.jsx("code",{children:"remit sign-in off"}),", and recover an account from the host with"," ",e.jsx("code",{children:"remit people enable"})," or ",e.jsx("code",{children:"remit people reset"}),"."]})]});function Ne(){const s=K(),t=W(),r=J(),[n,o]=c.useState(!0);return e.jsx(X,{items:t,activeId:"people",title:"People",description:"Everyone with an account on this server.",help:de,helpOpen:n,onToggleHelp:()=>o(a=>!a),onSelect:r,onBackToMail:()=>{s({to:"/mail"})},children:e.jsx(ce,{})})}export{Ne as component};
1
+ import{b as O,e as I,f as R,bI as E,bJ as T,bK as A,bL as L,bM as z,bN as F,bO as M,bP as v,r as c,j as e,aB as k,B as x,X as U,ap as B,bQ as g,b5 as H,aq as Q,bR as _,d as b,bS as q,bT as C,bU as w,u as K,ac as W}from"./index-CmOAOx38.js";import{R as S}from"./ReportLink-DVR5iYy8.js";import{C as Y}from"./copy-Eu3Pxnsn.js";import{D as G,a as h,b as $}from"./DropdownMenu-D4QQzyrH.js";import{a as J}from"./sections-40tp2E7G.js";import{S as X}from"./settings-screen-Bx-jomcC.js";import"./avatar-DZNFp-l_.js";import"./badge-DXTfgcBt.js";import"./chevron-left-CO-V7AVZ.js";import"./menu-g1nN4c6m.js";import"./circle-question-mark-Dt4vUSbc.js";const P={name:"ellipsis",size:24,node:[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]],aliases:["more-horizontal"]};P.node;const V=O(P),Z=async({action:s,person:t},r)=>{const n={userId:t.userId};if(s==="SignOut"){const{data:a}=await z({path:n,body:{stepUpToken:r},throwOnError:!0});return{person:a,resetUrl:void 0}}if(s==="ResetPassword"){const{data:a}=await F({path:n,body:{stepUpToken:r},throwOnError:!0});return{person:a.person,resetUrl:a.resetUrl}}const{data:o}=await M({path:n,body:{status:s==="Disable"?"Disabled":"Active",stepUpToken:r},throwOnError:!0});return{person:o,resetUrl:void 0}},ee=s=>{const t=I();return R({meta:E,gcTime:0,mutationFn:async r=>{const{data:n}=await L({body:{password:s,action:r.action,userId:r.person.userId},throwOnError:!0});return Z(r,n.stepUpToken)},onSuccess:({person:r})=>{t.setQueryData(T(),n=>n&&{people:A(n.people,r)})}})},se="That is not your password. Try again.",te="Five wrong passwords in 15 minutes. Wait 15 minutes, then try again.";function ne({action:s,person:t,onCancel:r,onDone:n,onFailed:o}){const a=v(s,t.email),[l,p]=c.useState(""),[u,m]=c.useState(null),i=ee(l),d=()=>{i.isPending||r()},D=f=>{f.preventDefault(),!(i.isPending||l==="")&&(m(null),i.mutate({action:s,person:t},{onSuccess:n,onError:y=>{const j=g(y);if(j.kind==="wrongPassword"){p(""),m(se);return}if(j.kind==="locked"){p(""),m(te);return}if(j.kind==="signedOut"){r(),H();return}o(y)}}))};return e.jsx(k,{open:!0,onClose:d,title:a.title,children:e.jsxs("form",{onSubmit:D,children:[e.jsxs("header",{className:"flex items-center gap-2 border-b border-line px-5 py-3",children:[e.jsx("span",{className:"flex-1 text-sm font-semibold text-fg",children:a.title}),e.jsx(x,{variant:"ghost",size:"sm",icon:e.jsx(U,{className:"size-3.5"}),onClick:d,"aria-label":"Close"})]}),e.jsxs("div",{className:"space-y-4 px-5 py-4 text-sm text-fg-muted",children:[e.jsx("p",{children:a.body}),e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsx("label",{htmlFor:"people-step-up-password",className:"text-xs font-medium text-fg",children:"Your password"}),e.jsx(B,{id:"people-step-up-password",autoComplete:"current-password",value:l,onChange:f=>{p(f.target.value),m(null)},"aria-invalid":u!==null,"aria-describedby":"people-step-up-hint",required:!0}),e.jsx("p",{id:"people-step-up-hint",className:"text-xs",children:u?e.jsx("span",{className:"text-danger",role:"alert",children:u}):"Confirm with your own password. It counts for this one action."})]})]}),e.jsxs("footer",{className:"flex items-center justify-end gap-2 border-t border-line px-5 py-3",children:[e.jsx(x,{variant:"secondary",size:"sm",onClick:d,children:"Cancel"}),e.jsx(x,{type:"submit",variant:a.destructive?"danger":"primary",size:"sm",disabled:l==="","aria-busy":i.isPending,children:a.confirmLabel})]})]})})}const re=()=>{};function ae({email:s,resetUrl:t,onDone:r}){const[n,o]=c.useState(!1),[a,l]=c.useState(!1),p=()=>{navigator.clipboard.writeText(t).then(()=>{l(!1),o(!0)}).catch(()=>l(!0))};return e.jsxs(k,{open:!0,onClose:re,title:`Reset link for ${s}`,children:[e.jsxs("header",{className:"border-b border-line px-5 py-3 text-sm font-semibold text-fg",children:["Reset link for ",s]}),e.jsxs("div",{className:"space-y-4 px-5 py-4 text-sm text-fg-muted",children:[e.jsx("p",{children:"They are signed out everywhere. Give them this link, by message or in person. It works once, for 24 hours."}),e.jsxs("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center",children:[e.jsx(x,{variant:"primary",size:"sm",icon:n?e.jsx(Q,{className:"size-3.5"}):e.jsx(Y,{className:"size-3.5"}),onClick:p,children:n?"Copied":"Copy"}),e.jsx("input",{readOnly:!0,tabIndex:-1,value:t,"aria-label":`Reset link for ${s}`,onFocus:u=>u.currentTarget.select(),className:"min-w-0 flex-1 rounded-sm border border-line bg-surface px-2 py-1.5 font-mono text-xs text-fg sm:order-first"})]}),a&&e.jsx("p",{className:"text-xs text-danger",role:"alert",children:"Copying did not work in this browser. Select the link and copy it by hand."}),e.jsx("p",{children:"You see this link only now. Close this window and it is gone. Make a new one if it gets lost."})]}),e.jsx("footer",{className:"flex justify-end border-t border-line px-5 py-3",children:e.jsx(x,{variant:"secondary",size:"sm",onClick:r,children:"Done"})})]})}const N="The list of people did not load";function oe({failure:s}){const t=c.useRef(null);return c.useEffect(()=>{t.current?.focus()},[]),e.jsx("div",{ref:t,tabIndex:-1,className:"outline-none",children:e.jsxs(b,{tone:"danger",children:[e.jsx("p",{className:"font-medium",children:s.title}),e.jsx("p",{className:"mt-1 text-fg-muted",children:s.reason}),e.jsx("p",{className:"mt-1",children:e.jsx(S,{href:C(s.title,s.error)})})]})})}function ie({person:s,onPick:t}){const r=s.status==="Disabled";return e.jsxs(G,{trigger:e.jsxs(e.Fragment,{children:[e.jsx(V,{className:"size-4","aria-hidden":"true"}),e.jsxs("span",{className:"sr-only",children:["Actions for ",s.email]})]}),children:[e.jsx(h,{onClick:()=>t("SignOut"),children:"Sign out everywhere"}),e.jsx(h,{onClick:()=>t("ResetPassword"),children:"Reset password"}),e.jsx($,{}),r?e.jsx(h,{onClick:()=>t("Enable"),children:"Enable"}):e.jsx(h,{onClick:()=>t("Disable"),disabled:s.isCaller,destructive:!s.isCaller,children:e.jsxs("span",{className:"flex flex-col",children:[e.jsx("span",{children:"Disable"}),s.isCaller&&e.jsx("span",{className:"text-xs text-fg-subtle",children:"Not your own account"})]})})]})}function le({people:s,onPick:t}){const r=new Date;return e.jsx("div",{className:"overflow-x-auto rounded-sm border border-line bg-surface",children:e.jsxs("table",{className:"w-full text-left text-sm",children:[e.jsx("thead",{className:"border-b border-line text-xs text-fg-muted",children:e.jsxs("tr",{children:[e.jsx("th",{scope:"col",className:"px-3 py-2 font-medium",children:"Email"}),e.jsx("th",{scope:"col",className:"px-3 py-2 font-medium",children:"Created"}),e.jsx("th",{scope:"col",className:"px-3 py-2 font-medium",children:"Last sign-in"}),e.jsx("th",{scope:"col",className:"px-3 py-2 font-medium",children:"Sessions"}),e.jsx("th",{scope:"col",className:"px-3 py-2 font-medium",children:"Status"}),e.jsx("th",{scope:"col",className:"w-12 px-1 py-2",children:e.jsx("span",{className:"sr-only",children:"Actions"})})]})}),e.jsx("tbody",{children:s.map(n=>e.jsxs("tr",{className:"border-b border-line last:border-b-0",children:[e.jsxs("td",{className:"px-3 py-1 text-fg",children:[n.email,n.isCaller&&e.jsx("span",{className:"text-fg-muted",children:" (you)"})]}),e.jsx("td",{className:"px-3 py-1 text-fg-muted",children:w(n.createdAt,r)}),e.jsx("td",{className:"px-3 py-1 text-fg-muted",children:w(n.lastSignInAt,r)}),e.jsx("td",{className:"px-3 py-1 tabular-nums text-fg-muted",children:n.sessionCount}),e.jsx("td",{className:n.status==="Disabled"?"px-3 py-1 text-danger":"px-3 py-1 text-fg-muted",children:n.status}),e.jsx("td",{className:"px-1 py-1",children:e.jsx(ie,{person:n,onPick:o=>t(o,n)})})]},n.userId))})]})})}function ce(){const s=_(),[t,r]=c.useState(null),[n,o]=c.useState(null),[a,l]=c.useState(null);if(s.isPending)return e.jsx("div",{className:"h-24 animate-pulse rounded-sm border border-line bg-surface","aria-busy":"true","aria-label":"Loading people"});if(s.unavailable)return e.jsx(b,{tone:"info",children:"This server has no People page. It shows on a self-hosted server once self sign-up is turned off."});if(s.isError)return g(s.error).kind==="signedOut"?null:e.jsxs(b,{tone:"danger",children:[e.jsxs("p",{className:"font-medium",children:[N,"."]}),e.jsx("p",{className:"mt-1 text-fg-muted",children:q(s.error)}),e.jsxs("p",{className:"mt-2 flex items-center gap-3",children:[e.jsx(x,{variant:"secondary",size:"sm",onClick:()=>{s.refetch()},children:"Try again"}),e.jsx(S,{href:C(N,s.error)})]})]});const p=(i,d)=>{o(null),r({action:i,person:d})},u=i=>{i.resetUrl&&t&&l({email:t.person.email,resetUrl:i.resetUrl}),r(null)},m=i=>{if(!t)return;const d=g(i);o({title:v(t.action,t.person.email).failedTitle,reason:d.kind==="failed"?d.reason:"Something went wrong. Nothing changed. Try again.",error:i}),r(null)};return e.jsxs("div",{className:"space-y-4",children:[n&&e.jsx(oe,{failure:n}),e.jsx(le,{people:s.data.people,onPick:p}),t&&e.jsx(ne,{action:t.action,person:t.person,onCancel:()=>r(null),onDone:u,onFailed:m}),a&&e.jsx(ae,{email:a.email,resetUrl:a.resetUrl,onDone:()=>l(null)})]})}const de=e.jsxs("div",{className:"space-y-3",children:[e.jsx("p",{children:"Anyone signed in here can manage every account. Each action asks for your own password first, and is recorded with who took it and from where."}),e.jsx("p",{children:"Disabling an account signs that person out within 15 minutes and stops their calendar feed links. Their mail stays. You cannot disable your own account, so one account always stays on."}),e.jsx("p",{children:"A reset link works once, for 24 hours, and is shown only once. Making one stops the old password at once."}),e.jsxs("p",{children:["The person who runs this server can turn all sign-in off with"," ",e.jsx("code",{children:"remit sign-in off"}),", and recover an account from the host with"," ",e.jsx("code",{children:"remit people enable"})," or ",e.jsx("code",{children:"remit people reset"}),"."]})]});function Ne(){const s=K(),t=W(),r=J(),[n,o]=c.useState(!0);return e.jsx(X,{items:t,activeId:"people",title:"People",description:"Everyone with an account on this server.",help:de,helpOpen:n,onToggleHelp:()=>o(a=>!a),onSelect:r,onBackToMail:()=>{s({to:"/mail"})},children:e.jsx(ce,{})})}export{Ne as component};
@@ -1 +1 @@
1
- import{b as a}from"./index-BnBpXn45.js";const e={name:"plus",size:24,node:[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]};e.node;const s=a(e);export{s as P};
1
+ import{b as a}from"./index-CmOAOx38.js";const e={name:"plus",size:24,node:[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]};e.node;const s=a(e);export{s as P};
@@ -1 +1 @@
1
- import{b as P,r as f,n as R,c3 as E,j as l,p as b,B as j}from"./index-BnBpXn45.js";const y={name:"ellipsis-vertical",size:24,node:[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"12",cy:"5",r:"1",key:"gxeob9"}],["circle",{cx:"12",cy:"19",r:"1",key:"lyex9k"}]],aliases:["more-vertical"]};y.node;const k=P(y),g=4,v=8;function z(e,t,n){const o=Math.max(v,window.innerWidth-t.width-v),s=n==="end"?e.right-t.width:e.left,r=Math.min(Math.max(s,v),o),c=e.bottom+g,i=e.top-g-t.height,d=c+t.height<=window.innerHeight-v||i<v?c:i;return{left:r,top:d}}function L(e,t,n,o){const[s,r]=f.useState(null),c=f.useRef(o);return c.current=o,f.useLayoutEffect(()=>{if(!t){r(null);return}const i=()=>{const x=e.current,h=c.current();if(!x||!h)return;const m=x.getBoundingClientRect(),w={width:m.right-m.left,height:m.bottom-m.top},p=z(h,w,n);r(a=>a?.left===p.left&&a.top===p.top?a:{position:"fixed",left:p.left,top:p.top})};i(),window.addEventListener("resize",i),window.addEventListener("scroll",i,!0);const u=e.current;let d=null;return u&&typeof ResizeObserver<"u"&&(d=new ResizeObserver(i),d.observe(u)),()=>{d?.disconnect(),window.removeEventListener("resize",i),window.removeEventListener("scroll",i,!0)}},[t,n,e]),s}function M(e,t){const[n,o]=f.useState(!1),s=f.useRef(null),r=f.useRef(null);return R({id:e,open:n,answers:{back:()=>{o(!1),t?.()}}}),f.useEffect(()=>{if(!n)return;const c=i=>{const u=i.target;s.current?.contains(u)||r.current?.contains(u)||o(!1)};return document.addEventListener("mousedown",c),()=>document.removeEventListener("mousedown",c)},[n]),{open:n,setOpen:o,containerRef:s,panelRef:r,getAnchor:()=>s.current?.getBoundingClientRect()??null}}function N({open:e,align:t="start",getAnchor:n,panelRef:o,children:s}){const r=L(o,e,t,n);return e?E.createPortal(l.jsx("div",{className:"z-50",style:r??{position:"fixed",visibility:"hidden"},children:s}),document.body):null}function O({label:e,children:t,className:n,ref:o,onKeyDown:s,"data-testid":r}){return l.jsx("div",{ref:o,role:"menu","aria-label":e,tabIndex:-1,onKeyDown:s,"data-testid":r,className:b("z-50 flex max-h-[60dvh] min-w-44 flex-col overflow-y-auto overscroll-contain rounded-md border border-line bg-surface py-1 shadow-lg outline-none",n),children:t})}function S({label:e,icon:t,onSelect:n,className:o,lang:s,"data-testid":r}){return l.jsxs("button",{type:"button",role:"menuitem",lang:s,onClick:n,"data-testid":r,className:b("flex min-h-11 items-center gap-3 px-4 py-2.5 text-left text-sm text-fg transition-colors hover:bg-surface-sunken",o),children:[t&&l.jsx("span",{className:"shrink-0 text-fg-subtle",children:t}),e]})}function B({triggerLabel:e,triggerIcon:t,triggerText:n,items:o,align:s="end",touch:r=!0,className:c,triggerClassName:i,nested:u=!1,children:d}){const{open:x,setOpen:h,containerRef:m,panelRef:w,getAnchor:p}=M("popover-menu");return o.length===0&&!d?null:l.jsxs("div",{ref:m,className:b("relative",c),...u?{role:"none"}:{},children:[l.jsx(j,{variant:"ghost",size:"sm",icon:t??l.jsx(k,{className:"size-5"}),onClick:()=>h(a=>!a),"aria-label":e,"aria-haspopup":"menu","aria-expanded":x,...u?{role:"menuitem"}:{},className:b(r&&"min-h-11 min-w-11 px-0",i),children:n}),l.jsx(N,{open:x,align:s,panelRef:w,getAnchor:p,children:l.jsxs(O,{ref:w,children:[o.map(a=>l.jsx(S,{label:a.label,icon:a.icon,onSelect:()=>{h(!1),a.onSelect()}},a.key)),d]})})]})}export{k as E,N as P,O as a,S as b,B as c,M as u};
1
+ import{b as P,r as f,n as R,c3 as E,j as l,p as b,B as j}from"./index-CmOAOx38.js";const y={name:"ellipsis-vertical",size:24,node:[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"12",cy:"5",r:"1",key:"gxeob9"}],["circle",{cx:"12",cy:"19",r:"1",key:"lyex9k"}]],aliases:["more-vertical"]};y.node;const k=P(y),g=4,v=8;function z(e,t,n){const o=Math.max(v,window.innerWidth-t.width-v),s=n==="end"?e.right-t.width:e.left,r=Math.min(Math.max(s,v),o),c=e.bottom+g,i=e.top-g-t.height,d=c+t.height<=window.innerHeight-v||i<v?c:i;return{left:r,top:d}}function L(e,t,n,o){const[s,r]=f.useState(null),c=f.useRef(o);return c.current=o,f.useLayoutEffect(()=>{if(!t){r(null);return}const i=()=>{const x=e.current,h=c.current();if(!x||!h)return;const m=x.getBoundingClientRect(),w={width:m.right-m.left,height:m.bottom-m.top},p=z(h,w,n);r(a=>a?.left===p.left&&a.top===p.top?a:{position:"fixed",left:p.left,top:p.top})};i(),window.addEventListener("resize",i),window.addEventListener("scroll",i,!0);const u=e.current;let d=null;return u&&typeof ResizeObserver<"u"&&(d=new ResizeObserver(i),d.observe(u)),()=>{d?.disconnect(),window.removeEventListener("resize",i),window.removeEventListener("scroll",i,!0)}},[t,n,e]),s}function M(e,t){const[n,o]=f.useState(!1),s=f.useRef(null),r=f.useRef(null);return R({id:e,open:n,answers:{back:()=>{o(!1),t?.()}}}),f.useEffect(()=>{if(!n)return;const c=i=>{const u=i.target;s.current?.contains(u)||r.current?.contains(u)||o(!1)};return document.addEventListener("mousedown",c),()=>document.removeEventListener("mousedown",c)},[n]),{open:n,setOpen:o,containerRef:s,panelRef:r,getAnchor:()=>s.current?.getBoundingClientRect()??null}}function N({open:e,align:t="start",getAnchor:n,panelRef:o,children:s}){const r=L(o,e,t,n);return e?E.createPortal(l.jsx("div",{className:"z-50",style:r??{position:"fixed",visibility:"hidden"},children:s}),document.body):null}function O({label:e,children:t,className:n,ref:o,onKeyDown:s,"data-testid":r}){return l.jsx("div",{ref:o,role:"menu","aria-label":e,tabIndex:-1,onKeyDown:s,"data-testid":r,className:b("z-50 flex max-h-[60dvh] min-w-44 flex-col overflow-y-auto overscroll-contain rounded-md border border-line bg-surface py-1 shadow-lg outline-none",n),children:t})}function S({label:e,icon:t,onSelect:n,className:o,lang:s,"data-testid":r}){return l.jsxs("button",{type:"button",role:"menuitem",lang:s,onClick:n,"data-testid":r,className:b("flex min-h-11 items-center gap-3 px-4 py-2.5 text-left text-sm text-fg transition-colors hover:bg-surface-sunken",o),children:[t&&l.jsx("span",{className:"shrink-0 text-fg-subtle",children:t}),e]})}function B({triggerLabel:e,triggerIcon:t,triggerText:n,items:o,align:s="end",touch:r=!0,className:c,triggerClassName:i,nested:u=!1,children:d}){const{open:x,setOpen:h,containerRef:m,panelRef:w,getAnchor:p}=M("popover-menu");return o.length===0&&!d?null:l.jsxs("div",{ref:m,className:b("relative",c),...u?{role:"none"}:{},children:[l.jsx(j,{variant:"ghost",size:"sm",icon:t??l.jsx(k,{className:"size-5"}),onClick:()=>h(a=>!a),"aria-label":e,"aria-haspopup":"menu","aria-expanded":x,...u?{role:"menuitem"}:{},className:b(r&&"min-h-11 min-w-11 px-0",i),children:n}),l.jsx(N,{open:x,align:s,panelRef:w,getAnchor:p,children:l.jsxs(O,{ref:w,children:[o.map(a=>l.jsx(S,{label:a.label,icon:a.icon,onSelect:()=>{h(!1),a.onSelect()}},a.key)),d]})})]})}export{k as E,N as P,O as a,S as b,B as c,M as u};
@@ -1 +1 @@
1
- import{b as a}from"./index-BnBpXn45.js";const e={name:"refresh-cw",size:24,node:[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]};e.node;const o=a(e);export{o as R};
1
+ import{b as a}from"./index-CmOAOx38.js";const e={name:"refresh-cw",size:24,node:[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]};e.node;const o=a(e);export{o as R};
@@ -1 +1 @@
1
- import{H as L,cb as T,cc as w,G as u,r as i,u as d,cf as f,cd as O,ch as x}from"./index-BnBpXn45.js";import{u as E,c as m}from"./nav-link-CjSE3MDU.js";function k(e){const s=L({warn:e?.router===void 0}),t=e?.router||s;return T(t.stores.__store,w(e,t))}const y="/mail/brief",$="/mail/$mailboxId",R="/mail/outbox",v="/mail/flagged";function B(e){for(const s of e){if(s.routeId===y)return{list:"brief"};if(s.routeId===v)return{list:"flagged"};if(s.routeId===R)return{list:"outbox"};if(s.routeId===$)return{list:"mailbox",mailboxId:s.params?.mailboxId}}}function X(e){const s=e.split(/[?#]/)[0].split("/").filter(Boolean);if(s[0]!=="mail")return"";const t=s[1];return t?t==="brief"?y:t==="flagged"?v:t==="outbox"?R:D(t):""}function Y(e){if(typeof e!="object"||e===null)return"";const{q:s}=e;return typeof s=="string"?s:""}function D(e){return`${$}:${e}`}function j(e,s){return e===s?!0:e.startsWith(`${s}/`)}function S(e){const s=e.split(/[?#]/)[0].split("/").filter(Boolean);return s[0]==="mail"&&s.length>2}function l(){const e=k({select:o=>B(o.matches)?.list}),t=u({from:"/mail/$mailboxId",shouldThrow:!1})?.mailboxId;return i.useMemo(()=>({list:e,mailboxId:t}),[e,t])}function K(){const{pathname:e}=E();return S(e)}function N(){const e=d(),s=m(),{list:t,mailboxId:o}=l();return i.useCallback(()=>{const r=n=>n,a=s;if(t==="flagged"){e({to:"/mail/flagged",search:r,hash:a});return}if(t==="outbox"){e({to:"/mail/outbox",search:r,hash:a});return}if(t==="mailbox"&&o){e({to:"/mail/$mailboxId",params:{mailboxId:o},search:r,hash:a});return}e({to:"/mail/brief",search:r,hash:a})},[e,s,t,o])}const A=["reply","reply-all","forward"],P=O(A),I="/mail/brief/$threadId/$messageId/$mode/{-$outboxMessageId}",g="/mail/flagged/$threadId/$messageId/$mode/{-$outboxMessageId}",b="/mail/$mailboxId/$threadId/$messageId/$mode/{-$outboxMessageId}";function _(){const e=u({from:I,shouldThrow:!1}),s=u({from:g,shouldThrow:!1}),t=u({from:b,shouldThrow:!1});return e??s??t}function C(){const e=f({from:I,shouldThrow:!1}),s=f({from:g,shouldThrow:!1}),t=f({from:b,shouldThrow:!1});return(e??s??t)?.body}const h=e=>s=>e===void 0?x(s):{...x(s),body:e.body};function p(){const e=_(),s=C();return i.useMemo(()=>{if(!e)return;const t=P.safeParse(e.mode);return t.success?{kind:"reply",mode:t.data,threadId:e.threadId,sourceMessageId:e.messageId,outboxMessageId:e.outboxMessageId,seed:s===void 0?void 0:{body:s}}:{kind:"unknown",segment:e.mode}},[e,s])}function V(){return p()?.kind==="reply"}function M(e,s,t,o){return e==="flagged"?{to:g,params:{...t,outboxMessageId:o}}:e==="mailbox"&&s?{to:b,params:{...t,mailboxId:s,outboxMessageId:o}}:{to:I,params:{...t,outboxMessageId:o}}}function G(e,s){if(e?.kind==="reply"&&e.threadId===s.threadId&&e.sourceMessageId===s.messageId)return e.outboxMessageId}function q(){const e=d(),s=m(),{list:t,mailboxId:o}=l(),r=p();return i.useCallback((a,n)=>{e({...M(t,o,a,n===void 0?G(r,a):void 0),search:h(n),hash:s})},[e,s,t,o,r])}function H(e,s,t){if(!(!s||!t))return o=>e({threadId:s,messageId:t,mode:o})}function Q(){const e=d(),{list:s,mailboxId:t}=l(),o=p();return i.useCallback(r=>{o?.kind==="reply"&&e({...M(s,t,{threadId:o.threadId,messageId:o.sourceMessageId,mode:o.mode},r),search:h(void 0),hash:!0,replace:!0})},[e,s,t,o])}function W(){const e=d(),s=m(),{list:t,mailboxId:o}=l(),r=_();return i.useCallback(()=>{if(!r)return;const a=h(void 0),n=s,c={threadId:r.threadId,messageId:r.messageId};if(t==="flagged"){e({to:"/mail/flagged/$threadId/$messageId",params:c,search:a,hash:n});return}if(t==="mailbox"&&o){e({to:"/mail/$mailboxId/$threadId/$messageId",params:{...c,mailboxId:o},search:a,hash:n});return}e({to:"/mail/brief/$threadId/$messageId",params:c,search:a,hash:n})},[e,s,t,o,r])}export{Y as a,K as b,B as c,V as d,l as e,N as f,q as g,Q as h,W as i,p as j,j as l,X as m,H as r,k as u};
1
+ import{H as L,cb as T,cc as w,G as u,r as i,u as d,cf as f,cd as O,ch as x}from"./index-CmOAOx38.js";import{u as E,c as m}from"./nav-link-Bdv8kjEd.js";function k(e){const s=L({warn:e?.router===void 0}),t=e?.router||s;return T(t.stores.__store,w(e,t))}const y="/mail/brief",$="/mail/$mailboxId",R="/mail/outbox",v="/mail/flagged";function B(e){for(const s of e){if(s.routeId===y)return{list:"brief"};if(s.routeId===v)return{list:"flagged"};if(s.routeId===R)return{list:"outbox"};if(s.routeId===$)return{list:"mailbox",mailboxId:s.params?.mailboxId}}}function X(e){const s=e.split(/[?#]/)[0].split("/").filter(Boolean);if(s[0]!=="mail")return"";const t=s[1];return t?t==="brief"?y:t==="flagged"?v:t==="outbox"?R:D(t):""}function Y(e){if(typeof e!="object"||e===null)return"";const{q:s}=e;return typeof s=="string"?s:""}function D(e){return`${$}:${e}`}function j(e,s){return e===s?!0:e.startsWith(`${s}/`)}function S(e){const s=e.split(/[?#]/)[0].split("/").filter(Boolean);return s[0]==="mail"&&s.length>2}function l(){const e=k({select:o=>B(o.matches)?.list}),t=u({from:"/mail/$mailboxId",shouldThrow:!1})?.mailboxId;return i.useMemo(()=>({list:e,mailboxId:t}),[e,t])}function K(){const{pathname:e}=E();return S(e)}function N(){const e=d(),s=m(),{list:t,mailboxId:o}=l();return i.useCallback(()=>{const r=n=>n,a=s;if(t==="flagged"){e({to:"/mail/flagged",search:r,hash:a});return}if(t==="outbox"){e({to:"/mail/outbox",search:r,hash:a});return}if(t==="mailbox"&&o){e({to:"/mail/$mailboxId",params:{mailboxId:o},search:r,hash:a});return}e({to:"/mail/brief",search:r,hash:a})},[e,s,t,o])}const A=["reply","reply-all","forward"],P=O(A),I="/mail/brief/$threadId/$messageId/$mode/{-$outboxMessageId}",g="/mail/flagged/$threadId/$messageId/$mode/{-$outboxMessageId}",b="/mail/$mailboxId/$threadId/$messageId/$mode/{-$outboxMessageId}";function _(){const e=u({from:I,shouldThrow:!1}),s=u({from:g,shouldThrow:!1}),t=u({from:b,shouldThrow:!1});return e??s??t}function C(){const e=f({from:I,shouldThrow:!1}),s=f({from:g,shouldThrow:!1}),t=f({from:b,shouldThrow:!1});return(e??s??t)?.body}const h=e=>s=>e===void 0?x(s):{...x(s),body:e.body};function p(){const e=_(),s=C();return i.useMemo(()=>{if(!e)return;const t=P.safeParse(e.mode);return t.success?{kind:"reply",mode:t.data,threadId:e.threadId,sourceMessageId:e.messageId,outboxMessageId:e.outboxMessageId,seed:s===void 0?void 0:{body:s}}:{kind:"unknown",segment:e.mode}},[e,s])}function V(){return p()?.kind==="reply"}function M(e,s,t,o){return e==="flagged"?{to:g,params:{...t,outboxMessageId:o}}:e==="mailbox"&&s?{to:b,params:{...t,mailboxId:s,outboxMessageId:o}}:{to:I,params:{...t,outboxMessageId:o}}}function G(e,s){if(e?.kind==="reply"&&e.threadId===s.threadId&&e.sourceMessageId===s.messageId)return e.outboxMessageId}function q(){const e=d(),s=m(),{list:t,mailboxId:o}=l(),r=p();return i.useCallback((a,n)=>{e({...M(t,o,a,n===void 0?G(r,a):void 0),search:h(n),hash:s})},[e,s,t,o,r])}function H(e,s,t){if(!(!s||!t))return o=>e({threadId:s,messageId:t,mode:o})}function Q(){const e=d(),{list:s,mailboxId:t}=l(),o=p();return i.useCallback(r=>{o?.kind==="reply"&&e({...M(s,t,{threadId:o.threadId,messageId:o.sourceMessageId,mode:o.mode},r),search:h(void 0),hash:!0,replace:!0})},[e,s,t,o])}function W(){const e=d(),s=m(),{list:t,mailboxId:o}=l(),r=_();return i.useCallback(()=>{if(!r)return;const a=h(void 0),n=s,c={threadId:r.threadId,messageId:r.messageId};if(t==="flagged"){e({to:"/mail/flagged/$threadId/$messageId",params:c,search:a,hash:n});return}if(t==="mailbox"&&o){e({to:"/mail/$mailboxId/$threadId/$messageId",params:{...c,mailboxId:o},search:a,hash:n});return}e({to:"/mail/brief/$threadId/$messageId",params:c,search:a,hash:n})},[e,s,t,o,r])}export{Y as a,K as b,B as c,V as d,l as e,N as f,q as g,Q as h,W as i,p as j,j as l,X as m,H as r,k as u};
@@ -1,4 +1,4 @@
1
- import{b as Vr,r as z,j as F,B as uf,p as ha,d as Kp,c3 as vu,n as Wp,f2 as qp,v as Up,L as Hp}from"./index-BnBpXn45.js";import{h as _l,f as Su,j as wu,k as Jp}from"./index-B7CBca9v.js";import{b as Eu,l as go,c as Vp,e as Yp}from"./useSignature-Boz2_w0h.js";import{r as Xp,u as Gp}from"./roving-focus-DWCPniMZ.js";import{C as Zp}from"./confirm-dialog-DYNhLVrG.js";import{a as Qp,D as em}from"./useMediaQuery-DOpCuIgp.js";import{B as tm}from"./bottom-sheet-C9u72VJg.js";import{P as nm,a as rm,b as Ps}from"./popover-menu-nz-n7B2h.js";import{U as om}from"./undo-2-D-cmVG46.js";import{o as gv}from"./rich-text-spellcheck-provider-J8m9wz6A.js";import"./useMessageBodyContent-DzlZ514L.js";import"./reply-CzX8Q1T1.js";import"./nav-link-CjSE3MDU.js";import"./account-form-helpers-DhckT_PN.js";import"./useDebouncedValue-CahHw3v4.js";import"./suggest-list-DMRnmTaR.js";import"./sections-DsqY4M13.js";import"./chevron-down-CR89KUgK.js";const cf={name:"bold",size:24,node:[["path",{d:"M6 12h9a4 4 0 0 1 0 8H7a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1h7a4 4 0 0 1 0 8",key:"mg9rjx"}]]};cf.node;const im=Vr(cf);const df={name:"book-plus",size:24,node:[["path",{d:"M12 7v6",key:"lw1j43"}],["path",{d:"M4 19.5v-15A2.5 2.5 0 0 1 6.5 2H19a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1H6.5a1 1 0 0 1 0-5H20",key:"k3hazp"}],["path",{d:"M9 10h6",key:"9gxzsh"}]]};df.node;const sm=Vr(df);const ff={name:"italic",size:24,node:[["line",{x1:"19",x2:"10",y1:"4",y2:"4",key:"15jd3p"}],["line",{x1:"14",x2:"5",y1:"20",y2:"20",key:"bu0au3"}],["line",{x1:"15",x2:"9",y1:"4",y2:"20",key:"uljnxc"}]]};ff.node;const am=Vr(ff);const hf={name:"link",size:24,node:[["path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71",key:"1cjeqo"}],["path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71",key:"19qd67"}]]};hf.node;const lm=Vr(hf);const gf={name:"quote",size:24,node:[["path",{d:"M16 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z",key:"rib7q0"}],["path",{d:"M5 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z",key:"1ymkrd"}]]};gf.node;const um=Vr(gf);const pf={name:"redo-2",size:24,node:[["path",{d:"m15 14 5-5-5-5",key:"12vg1m"}],["path",{d:"M20 9H9.5A5.5 5.5 0 0 0 4 14.5A5.5 5.5 0 0 0 9.5 20H13",key:"6uklza"}]]};pf.node;const cm=Vr(pf),GC={html:"",text:"",formatting:[]},dm={account:"the account default",detected:"detected from what you wrote",manual:"chosen for this message"},fm=({language:n,languages:e,source:t,onSelect:r,helpText:o})=>{const[i,s]=z.useState(!1),a=z.useRef(null),l=z.useRef(null),u=z.useRef(null),c=z.useId(),d=z.useCallback(g=>{s(!1),g&&l.current?.focus()},[]);z.useEffect(()=>{if(!i)return;const g=m=>{a.current?.contains(m.target)||s(!1)};return document.addEventListener("mousedown",g),()=>document.removeEventListener("mousedown",g)},[i]),z.useEffect(()=>{if(!i)return;const g=u.current?.querySelector('[aria-checked="true"]'),m=u.current?.querySelector('[role="menuitemradio"]');(g??m)?.focus()},[i]);const f=g=>{if(g.key==="Escape"){g.preventDefault(),d(!0);return}const m=[...u.current?.querySelectorAll('[role="menuitemradio"]')??[]],p=m.indexOf(document.activeElement),y=Xp(g.key,p,m.length);y!==null&&(g.preventDefault(),m[y]?.focus())},h=g=>{r(g),d(!0)};return F.jsxs("div",{ref:a,className:"relative",children:[F.jsx(uf,{ref:l,variant:"ghost",size:"md","aria-label":`Message language: ${go(n)}, ${dm[t]}`,"aria-haspopup":"menu","aria-expanded":i,"aria-controls":i?c:void 0,onClick:()=>s(g=>!g),"data-testid":"compose-language-chip","data-language":n,"data-language-source":t,className:ha("min-h-11 min-w-11 shrink-0 px-2 font-medium",n!==e[0]&&"bg-accent-2-soft text-accent-2"),children:Eu(n)}),i&&F.jsxs("div",{ref:u,id:c,role:"menu","aria-label":"Message language",onKeyDown:f,"data-testid":"compose-language-menu",className:"absolute right-0 top-full z-50 mt-1 flex max-h-[60dvh] min-w-56 flex-col overflow-y-auto overscroll-contain rounded-md border border-line bg-surface py-1 shadow-lg",children:[e.map(g=>F.jsxs("button",{type:"button",role:"menuitemradio","aria-checked":g===n,lang:g,onClick:()=>h(g),className:ha("flex min-h-11 items-center justify-between gap-3 px-4 py-2.5 text-left text-sm text-fg transition-colors hover:bg-surface-sunken",g===n&&"bg-accent-2-soft"),children:[go(g),F.jsx("span",{className:"shrink-0 text-xs text-fg-subtle",children:Eu(g)})]},g)),F.jsx("p",{"data-testid":"compose-language-help",className:"border-t border-line px-4 pb-1 pt-2 text-xs text-fg-muted",children:o??Vp(navigator.userAgent)})]})]})},hm=({mode:n,onToggle:e})=>F.jsx(uf,{variant:"ghost",size:"md","aria-pressed":n==="plain",title:"Plain text",onClick:e,"data-testid":"compose-mode-toggle",className:ha("min-h-11 shrink-0",n==="plain"&&"bg-accent-2-soft text-accent-2"),children:"Plain text"}),gm=new Set(["button","checkbox","color","file","hidden","image","radio","range","reset","submit"]),mf=n=>{const e=n.activeElement;return e?.shadowRoot?mf(e.shadowRoot)??e:e},pm=n=>{const e=n.tagName.toUpperCase();if(e==="IFRAME"||e==="FRAME"||e==="TEXTAREA"||e==="SELECT")return!0;if(e==="INPUT"){const r=(n.getAttribute("type")??"text").toLowerCase();return!gm.has(r)}const t=n.getAttribute("contenteditable");return t!==null&&t.toLowerCase()!=="false"?!0:n.isContentEditable===!0},yf=n=>{const e=n?.ownerDocument??globalThis.document;if(!e)return!1;const t=mf(e);return!t||t===n||n?.contains(t)?!1:pm(t)};function $(n,...e){const t=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",n);for(const o of e)r.append("v",o);throw t.search=r.toString(),Error(`Minified Lexical error #${n}; visit ${t.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function _f(n,...e){const t=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",n);for(const o of e)r.append("v",o);t.search=r.toString(),console.warn(`Minified Lexical warning #${n}; visit ${t.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}const nt=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,mm=nt&&"documentMode"in document?document.documentMode:null,Ft=nt&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),Pt=nt&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent),zr=!(!nt||!("InputEvent"in window)||mm)&&"getTargetRanges"in new window.InputEvent("input"),Tn=nt&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,bf=nt&&/Android/.test(navigator.userAgent),Po=nt&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent)&&!bf,kf=nt&&/^(?=.*Chrome).*/i.test(navigator.userAgent),Di=nt&&bf&&kf,Lo=nt&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&Ft&&!kf,ym=0,_m=1,bm=2,ga=1,pa=2,ma=4,ya=8,km=16,Ls=32,Is=64,bl=128,xm=1,Cm=2,vm=3,Sm=4,wm=5,Em=6,Co=Po||Tn||Lo?" ":"​",Bn=`
1
+ import{b as Vr,r as z,j as F,B as uf,p as ha,d as Kp,c3 as vu,n as Wp,f2 as qp,v as Up,L as Hp}from"./index-CmOAOx38.js";import{h as _l,f as Su,j as wu,k as Jp}from"./index-CpNGDsVT.js";import{b as Eu,l as go,c as Vp,e as Yp}from"./useSignature-klArqmQ3.js";import{r as Xp,u as Gp}from"./roving-focus-h-W142Au.js";import{C as Zp}from"./confirm-dialog-C8W1RcOV.js";import{a as Qp,D as em}from"./useMediaQuery-uf6mjwPE.js";import{B as tm}from"./bottom-sheet-CBxZPIwF.js";import{P as nm,a as rm,b as Ps}from"./popover-menu-kMqLztgE.js";import{U as om}from"./undo-2-B0kA9_bY.js";import{o as gv}from"./rich-text-spellcheck-provider-J8m9wz6A.js";import"./useMessageBodyContent-CsZ9VCHu.js";import"./reply-BBXEHuds.js";import"./nav-link-Bdv8kjEd.js";import"./account-form-helpers-DhckT_PN.js";import"./useDebouncedValue-M5m0kaQD.js";import"./suggest-list-gj7TdgNf.js";import"./sections-40tp2E7G.js";import"./chevron-down-CuQovlNy.js";const cf={name:"bold",size:24,node:[["path",{d:"M6 12h9a4 4 0 0 1 0 8H7a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1h7a4 4 0 0 1 0 8",key:"mg9rjx"}]]};cf.node;const im=Vr(cf);const df={name:"book-plus",size:24,node:[["path",{d:"M12 7v6",key:"lw1j43"}],["path",{d:"M4 19.5v-15A2.5 2.5 0 0 1 6.5 2H19a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1H6.5a1 1 0 0 1 0-5H20",key:"k3hazp"}],["path",{d:"M9 10h6",key:"9gxzsh"}]]};df.node;const sm=Vr(df);const ff={name:"italic",size:24,node:[["line",{x1:"19",x2:"10",y1:"4",y2:"4",key:"15jd3p"}],["line",{x1:"14",x2:"5",y1:"20",y2:"20",key:"bu0au3"}],["line",{x1:"15",x2:"9",y1:"4",y2:"20",key:"uljnxc"}]]};ff.node;const am=Vr(ff);const hf={name:"link",size:24,node:[["path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71",key:"1cjeqo"}],["path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71",key:"19qd67"}]]};hf.node;const lm=Vr(hf);const gf={name:"quote",size:24,node:[["path",{d:"M16 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z",key:"rib7q0"}],["path",{d:"M5 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z",key:"1ymkrd"}]]};gf.node;const um=Vr(gf);const pf={name:"redo-2",size:24,node:[["path",{d:"m15 14 5-5-5-5",key:"12vg1m"}],["path",{d:"M20 9H9.5A5.5 5.5 0 0 0 4 14.5A5.5 5.5 0 0 0 9.5 20H13",key:"6uklza"}]]};pf.node;const cm=Vr(pf),GC={html:"",text:"",formatting:[]},dm={account:"the account default",detected:"detected from what you wrote",manual:"chosen for this message"},fm=({language:n,languages:e,source:t,onSelect:r,helpText:o})=>{const[i,s]=z.useState(!1),a=z.useRef(null),l=z.useRef(null),u=z.useRef(null),c=z.useId(),d=z.useCallback(g=>{s(!1),g&&l.current?.focus()},[]);z.useEffect(()=>{if(!i)return;const g=m=>{a.current?.contains(m.target)||s(!1)};return document.addEventListener("mousedown",g),()=>document.removeEventListener("mousedown",g)},[i]),z.useEffect(()=>{if(!i)return;const g=u.current?.querySelector('[aria-checked="true"]'),m=u.current?.querySelector('[role="menuitemradio"]');(g??m)?.focus()},[i]);const f=g=>{if(g.key==="Escape"){g.preventDefault(),d(!0);return}const m=[...u.current?.querySelectorAll('[role="menuitemradio"]')??[]],p=m.indexOf(document.activeElement),y=Xp(g.key,p,m.length);y!==null&&(g.preventDefault(),m[y]?.focus())},h=g=>{r(g),d(!0)};return F.jsxs("div",{ref:a,className:"relative",children:[F.jsx(uf,{ref:l,variant:"ghost",size:"md","aria-label":`Message language: ${go(n)}, ${dm[t]}`,"aria-haspopup":"menu","aria-expanded":i,"aria-controls":i?c:void 0,onClick:()=>s(g=>!g),"data-testid":"compose-language-chip","data-language":n,"data-language-source":t,className:ha("min-h-11 min-w-11 shrink-0 px-2 font-medium",n!==e[0]&&"bg-accent-2-soft text-accent-2"),children:Eu(n)}),i&&F.jsxs("div",{ref:u,id:c,role:"menu","aria-label":"Message language",onKeyDown:f,"data-testid":"compose-language-menu",className:"absolute right-0 top-full z-50 mt-1 flex max-h-[60dvh] min-w-56 flex-col overflow-y-auto overscroll-contain rounded-md border border-line bg-surface py-1 shadow-lg",children:[e.map(g=>F.jsxs("button",{type:"button",role:"menuitemradio","aria-checked":g===n,lang:g,onClick:()=>h(g),className:ha("flex min-h-11 items-center justify-between gap-3 px-4 py-2.5 text-left text-sm text-fg transition-colors hover:bg-surface-sunken",g===n&&"bg-accent-2-soft"),children:[go(g),F.jsx("span",{className:"shrink-0 text-xs text-fg-subtle",children:Eu(g)})]},g)),F.jsx("p",{"data-testid":"compose-language-help",className:"border-t border-line px-4 pb-1 pt-2 text-xs text-fg-muted",children:o??Vp(navigator.userAgent)})]})]})},hm=({mode:n,onToggle:e})=>F.jsx(uf,{variant:"ghost",size:"md","aria-pressed":n==="plain",title:"Plain text",onClick:e,"data-testid":"compose-mode-toggle",className:ha("min-h-11 shrink-0",n==="plain"&&"bg-accent-2-soft text-accent-2"),children:"Plain text"}),gm=new Set(["button","checkbox","color","file","hidden","image","radio","range","reset","submit"]),mf=n=>{const e=n.activeElement;return e?.shadowRoot?mf(e.shadowRoot)??e:e},pm=n=>{const e=n.tagName.toUpperCase();if(e==="IFRAME"||e==="FRAME"||e==="TEXTAREA"||e==="SELECT")return!0;if(e==="INPUT"){const r=(n.getAttribute("type")??"text").toLowerCase();return!gm.has(r)}const t=n.getAttribute("contenteditable");return t!==null&&t.toLowerCase()!=="false"?!0:n.isContentEditable===!0},yf=n=>{const e=n?.ownerDocument??globalThis.document;if(!e)return!1;const t=mf(e);return!t||t===n||n?.contains(t)?!1:pm(t)};function $(n,...e){const t=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",n);for(const o of e)r.append("v",o);throw t.search=r.toString(),Error(`Minified Lexical error #${n}; visit ${t.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function _f(n,...e){const t=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",n);for(const o of e)r.append("v",o);t.search=r.toString(),console.warn(`Minified Lexical warning #${n}; visit ${t.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}const nt=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,mm=nt&&"documentMode"in document?document.documentMode:null,Ft=nt&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),Pt=nt&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent),zr=!(!nt||!("InputEvent"in window)||mm)&&"getTargetRanges"in new window.InputEvent("input"),Tn=nt&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,bf=nt&&/Android/.test(navigator.userAgent),Po=nt&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent)&&!bf,kf=nt&&/^(?=.*Chrome).*/i.test(navigator.userAgent),Di=nt&&bf&&kf,Lo=nt&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&Ft&&!kf,ym=0,_m=1,bm=2,ga=1,pa=2,ma=4,ya=8,km=16,Ls=32,Is=64,bl=128,xm=1,Cm=2,vm=3,Sm=4,wm=5,Em=6,Co=Po||Tn||Lo?" ":"​",Bn=`
2
2
 
3
3
  `,kl=Pt?" ":Co,hn={bold:1,capitalize:1024,code:16,highlight:bl,italic:2,lowercase:256,strikethrough:4,subscript:32,superscript:64,underline:8,uppercase:512},Tm={directionless:1,unmergeable:2},$i={center:2,end:6,justify:4,left:1,right:3,start:5},Nm={[Cm]:"center",[Em]:"end",[Sm]:"justify",[xm]:"left",[vm]:"right",[wm]:"start"},Dm={normal:0,segmented:2,token:1},$m={[ym]:"normal",[bm]:"segmented",[_m]:"token"},Tu="$config";function Nu(){return we()._blockCursorElement}function Am(n){return n!==null&&n.nodeType===1&&n.hasAttribute("data-lexical-slot")}let xf=class yi{element;before;after;constructor(e,t,r){this.element=e,this.before=t||null,this.after=r||null}withBefore(e){return new yi(this.element,e,this.after)}withAfter(e){return new yi(this.element,this.before,e)}withElement(e){return this.element===e?this:new yi(e,this.before,this.after)}insertChild(e){const t=this.getInsertionAnchor();return t!==null&&t.parentElement!==this.element&&$(357),this.element.insertBefore(e,t),this}removeChild(e){return e.parentElement!==this.element&&$(358),this.element.removeChild(e),this}replaceChild(e,t){return t.parentElement!==this.element&&$(359),this.element.replaceChild(e,t),this}getFirstChild(){const e=this.getFirstChildAnchor(),t=e?e.nextSibling:this.element.firstChild;return t===this.getInsertionAnchor()?null:t}getFirstChildAnchor(){return this.after}resolveLeafPosition(e,t,r){if(this.element===e)return t===e&&r===0?"before":"after";const o=Du(e,this.element);if(o===null)return"after";const i=Array.prototype.indexOf.call(e.childNodes,o);if(i<0)return"after";if(t===e)return r<=i?"before":"after";const s=Du(e,t);if(s===null)return"after";const a=Array.prototype.indexOf.call(e.childNodes,s);return a>=0&&a<=i?"before":"after"}getInsertionAnchor(){return this.before}};function Du(n,e){let t=e;for(;t!==null&&t.parentNode!==n;)t=t.parentNode;return t}let Cf=class _i extends xf{withBefore(e){return new _i(this.element,e,this.after)}withAfter(e){return new _i(this.element,this.before,e)}withElement(e){return this.element===e?this:new _i(e,this.before,this.after)}getInsertionAnchor(){return super.getInsertionAnchor()||this.getManagedLineBreak()}getFirstChildAnchor(){let e=super.getFirstChildAnchor(),t=e?e.nextSibling:this.element.firstChild;for(;Am(t);)e=t,t=t.nextSibling;const r=e?e.nextSibling:this.element.firstChild;return r!==null&&r===Nu()?r:e}getManagedLineBreak(){return this.element.__lexicalLineBreak||null}setManagedLineBreak(e){if(this.element.__lexicalLastChildKind=e,e===null)this.removeManagedLineBreak();else{const t=e==="decorator"&&(Lo||Tn||Po);this.insertManagedLineBreak(t)}}removeManagedLineBreak(){const e=this.getManagedLineBreak();if(e){const t=this.element,r=e.nodeName==="IMG"?e.nextSibling:null;r&&t.removeChild(r),t.removeChild(e),t.__lexicalLineBreak=void 0}}insertManagedLineBreak(e){const t=this.getManagedLineBreak();if(t){if(e===(t.nodeName==="IMG"))return;this.removeManagedLineBreak()}const r=this.element,o=this.before,i=ae().createElement("br");if(i.setAttribute("data-lexical-managed-linebreak","true"),r.insertBefore(i,o),e){const s=ae().createElement("img");s.setAttribute("data-lexical-managed-linebreak","true"),s.style.setProperty("display","inline","important"),s.style.setProperty("border","0px","important"),s.style.setProperty("margin","0px","important"),s.alt="",r.insertBefore(s,i),r.__lexicalLineBreak=s}else r.__lexicalLineBreak=i}getFirstChildOffset(){const e=this.getFirstChild(),t=this.getInsertionAnchor();let r=0;for(let o=this.element.firstChild;o!==null&&o!==e&&o!==t;o=o.nextSibling)r++;return r}resolveChildIndex(e,t,r,o){if(r===this.element){const l=this.getFirstChildOffset(),u=Nu(),c=this.element.childNodes,d=Math.min(o,c.length);let f=0;for(let h=l;h<d;h++)c[h]!==u&&f++;return[e,Math.min(f,e.getChildrenSize())]}const i=$u(t,r);i.push(o);const s=$u(t,this.element);let a=e.getIndexWithinParent();for(let l=0;l<s.length;l++){const u=i[l],c=s[l];if(u===void 0||u<c)break;if(u>c){a+=1;break}}return[e.getParentOrThrow(),a]}};function $u(n,e){const t=[];let r=e;for(;r!==n&&r!==null;r=r.parentNode){let o=0;for(let i=r.previousSibling;i!==null;i=i.previousSibling)o++;t.push(o)}return r!==n&&$(225),t.reverse()}let vf;try{vf="0.49.0+prod.esm"}catch{}const Sf=vf??'"<unknown>+source"';let to=class{_front=new Set;_back=new Set;_cache;get size(){return this._front.size+this._back.size}addBack(e){return delete this._cache,this._front.has(e)||this._back.add(e),this}addFront(e){return delete this._cache,this._back.has(e)||this._front.add(e),this}delete(e){return delete this._cache,this._front.delete(e)||this._back.delete(e)}toArray(){const e=Array.from(this._front).reverse();for(const t of this._back)e.push(t);return e}toReadonlyArray(){return this._cache=this._cache||this.toArray(),this._cache}[Symbol.iterator](){return this.toReadonlyArray()[Symbol.iterator]()}};const jn=null;function wf(n,e=1e3){return n instanceof _a?n.clone():n.size<e?new Map(n):new _a().init(new Map(n),void 0,n.size)}let _a=class Ef{_mutable=!1;_old=void 0;_nursery=void 0;_size=0;clone(){return this._mutable=!1,new Ef().init(this._old,this._nursery,this._size)}init(e,t,r){return this._old=e,this._nursery=t,this._size=r,this}get size(){return this._size}has(e){return this.get(e)!==void 0}getWithTombstone(e){const t=this._nursery&&this._nursery.get(e);return t!==void 0?t:this._old&&this._old.get(e)}get(e){const t=this.getWithTombstone(e);return t===jn?void 0:t}shouldCompact(){return this._nursery!==void 0&&2*this._nursery.size>this._size}getNursery(){return this._mutable&&this._nursery||(this.compact(),this._nursery=new Map(this._nursery),this._mutable=!0),this._nursery}compact(e=!1){if(this._nursery&&this._nursery.size>0&&(e||this.shouldCompact())){const t=new Map(this._old);for(const[r,o]of this._nursery)o!==jn?t.set(r,o):t.delete(r);this._old=t,this._nursery=void 0}return this._mutable=!1,this}set(e,t){const r=this.getWithTombstone(e);if(r===t)return this;const o=this.getNursery();return r!==jn&&r!==void 0||(this._size++,r===jn&&o.delete(e)),o.set(e,t),this}delete(e){const t=this.has(e);return t&&(this.getNursery().set(e,jn),this._size--),t}getOrInsert(e,t){const r=this.get(e);return r!==void 0?r:(this.set(e,t),t)}getOrInsertComputed(e,t){const r=this.get(e);if(r!==void 0)return r;const o=t(e);return this.set(e,o),o}clear(){this._mutable=!1,this._old=void 0,this._nursery=void 0,this._size=0}*keys(){for(const e of this.entries())yield e[0]}*values(){for(const e of this.entries())yield e[1]}*entries(){const e=this._nursery,t=this._old;if(t)for(const r of t){const o=r[0],i=e?e.get(o):void 0;i!==jn&&(i!==void 0&&(r[1]=i),yield r)}if(e)for(const r of e)r[1]===jn||t&&t.has(r[0])||(yield r)}forEach(e,t){t!==void 0&&(e=e.bind(t));for(const[r,o]of this.entries())e(o,r,this)}get[Symbol.toStringTag](){return"GenMap"}[Symbol.iterator](){return this.entries()}};function Ai(n,e,t,r,o,i){if(x(n)){let s=n.getFirstChild();for(;s!==null;){const a=s.__key;s.__parent===e&&((x(s)||dn(s)&&s.__slots!==null)&&Ai(s,a,t,r,o,i),t.has(a)||i.delete(a),o.push(a)),s=s.getNextSibling()}}for(const s of dn(n)&&n.__slots!==null?n.__slots.values():[]){const a=r.get(s);a!==void 0&&Gn(a)&&a.__slotHost===e&&((x(a)||dn(a)&&a.__slots!==null)&&Ai(a,s,t,r,o,i),t.has(s)||i.delete(s),o.push(s))}}let ba=!1,xl=0;function Fm(n){xl=n.timeStamp}function Bs(n,e,t){const r=n.nodeName==="BR",o=e.__lexicalLineBreak;return o&&(n===o||r&&n.previousSibling===o)||r&&Gr(n,t)!==void 0}function zm(n,e,t){const r=Pe(gt(t)),o=r&&ft(r,t._rootElement);let i=null,s=null;o!==null&&o.anchorNode===n&&(i=o.anchorOffset,s=o.focusOffset);const a=n.nodeValue;a!==null&&Kl(e,a,i,s,!1)}function Om(n,e,t){if(N(n)){const r=n.anchor.getNode();if(r.is(t)&&n.format!==r.getFormat())return!1}return ht(e)&&t.isAttached()}function Mm(n,e,t){for(let r=n;r&&!Zh(r);r=sr(r)){const o=Gr(r,e);if(o!==void 0){const i=Q(o,t);if(i)return re(i)||!q(r)?void 0:[r,i]}}}function Tf(n,e,t){ba=!0;const r=performance.now()-xl>100;try{wt(n,()=>{const o=O()||(function(d){return d.read("latest",()=>{const f=O();return f!==null?f.clone():null})})(n),i=new Map,s=n._editorState,a=n._blockCursorElement;let l=!1,u="";for(let d=0;d<e.length;d++){const f=e[d],h=f.type,g=f.target,m=Mm(g,n,s);if(!m)continue;const[p,y]=m;if(h==="characterData")r&&D(y)&&ht(g)&&Om(o,g,y)&&zm(g,y,n);else if(h==="childList"){l=!0;const _=f.addedNodes;for(let S=0;S<_.length;S++){const C=_[S],w=Rh(C),v=C.parentNode;if(!(v==null||C===a||w!==null||Bs(C,v,n)||n._slotsUsed&&q(C)&&C.hasAttribute("data-lexical-slot")||Zh(C))){if(Pt){const E=(q(C)?C.innerText:null)||C.nodeValue;E&&(u+=E)}v.removeChild(C)}}const b=f.removedNodes,k=b.length;if(k>0){let S=0;for(let C=0;C<k;C++){const w=b[C];(Bs(w,g,n)||a===w)&&(g.appendChild(w),S++)}k!==S&&i.set(p,y)}}}if(i.size>0)for(const[d,f]of i)f.reconcileObservedMutation(d,n);const c=t.takeRecords();if(c.length>0){for(let d=0;d<c.length;d++){const f=c[d],h=f.addedNodes,g=f.target;for(let m=0;m<h.length;m++){const p=h[m],y=p.parentNode;y==null||p.nodeName!=="BR"||Bs(p,g,n)||y.removeChild(p)}}t.takeRecords()}o!==null&&(l&&be(o),Pt&&Wh(n)&&o.insertRawText(u))})}finally{ba=!1}}function Nf(n){const e=n._observer;e!==null&&Tf(n,e.takeRecords(),e)}function Df(n){(function(e){xl===0&&gt(e).addEventListener("textInput",Fm,!0)})(n),n._observer=new MutationObserver((e,t)=>{Tf(n,e,t)})}const Au="latest";let jm=class{key;parse;unparse;isEqual;defaultValue;resetOnCopyNode;constructor(e,t){this.key=e,this.parse=t.parse.bind(t),this.unparse=(t.unparse||Lm).bind(t),this.isEqual=(t.isEqual||Object.is).bind(t),this.defaultValue=this.parse(void 0),this.resetOnCopyNode=t.resetOnCopyNode||!1}};function Io(n,e){return new jm(n,e)}function Bo(n,e,t=Au){const r=(t===Au?n.getLatest():n).__state;return r?r.getValue(e):e.defaultValue}function Sr(n,e,t){let r;if(Ie(),typeof t=="function"){const i=n.getLatest(),s=Bo(i,e);if(r=t(s),e.isEqual(s,r))return i}else r=t;const o=n.getWritable();return Af(o).updateFromKnown(e,r),o}function Rm(n){const e=new Map,t=new Set;for(const{ownNodeConfig:r}of Vl(typeof n=="function"?n:n.replace))if(r&&r.stateConfigs)for(const o of r.stateConfigs){let i;"stateConfig"in o?(i=o.stateConfig,o.flat&&t.add(i.key)):i=o,e.set(i.key,i)}return{flatKeys:t,sharedConfigMap:e}}const Fu=new Set(["__proto__","constructor","prototype"]);let Pm=class $f{node;knownState;unknownState;sharedNodeState;size;constructor(e,t,r=void 0,o=new Map,i=void 0){this.node=e,this.sharedNodeState=t,this.unknownState=r,this.knownState=o;const{sharedConfigMap:s}=this.sharedNodeState,a=i!==void 0?i:(function(l,u,c){let d=c.size;if(u)for(const f in u){const h=l.get(f);h&&c.has(h)||d++}return d})(s,r,o);this.size=a}getValue(e){const t=this.knownState.get(e);if(t!==void 0)return t;this.sharedNodeState.sharedConfigMap.set(e.key,e);let r=e.defaultValue;if(this.unknownState&&e.key in this.unknownState){const o=this.unknownState[e.key];o!==void 0&&(r=e.parse(o)),this.updateFromKnown(e,r)}return r}getInternalState(){return[this.unknownState,this.knownState]}toJSON(){const e={...this.unknownState},t={};for(const[r,o]of this.knownState)r.isEqual(o,r.defaultValue)?delete e[r.key]:e[r.key]=r.unparse(o);for(const r of this.sharedNodeState.flatKeys)r in e&&(t[r]=e[r],delete e[r]);return zu(e)&&(t.$=e),t}getWritable(e){if(this.node===e)return this;const{sharedNodeState:t,unknownState:r}=this,o=new Map(this.knownState);return new $f(e,t,(function(i,s,a){let l;if(a)for(const[u,c]of Object.entries(a)){if(Fu.has(u))continue;const d=i.get(u);d?s.has(d)||s.set(d,d.parse(c)):(l=l||{},l[u]=c)}return l})(t.sharedConfigMap,o,r),o,this.size)}resetOnCopyNode(){for(const e of this.knownState.keys())e.resetOnCopyNode&&this.knownState.set(e,e.defaultValue);return this}updateFromKnown(e,t){const r=e.key;this.sharedNodeState.sharedConfigMap.set(r,e);const{knownState:o,unknownState:i}=this;o.has(e)||i&&r in i||(i&&(delete i[r],this.unknownState=zu(i)),this.size++),o.set(e,t)}updateFromUnknown(e,t){if(Fu.has(e))return;const r=this.sharedNodeState.sharedConfigMap.get(e);r?this.updateFromKnown(r,r.parse(t)):(this.unknownState=this.unknownState||{},e in this.unknownState||this.size++,this.unknownState[e]=t)}updateFromJSON(e){const{knownState:t}=this;for(const r of t.keys())t.set(r,r.defaultValue);if(this.size=t.size,this.unknownState=void 0,e)for(const[r,o]of Object.entries(e))this.updateFromUnknown(r,o)}};function Af(n){const e=n.getWritable(),t=e.__state?e.__state.getWritable(e):new Pm(e,Ff(e));return e.__state=t,t}function Ff(n){return n.__state?n.__state.sharedNodeState:Oh(we(),n.getType()).sharedNodeState}function zu(n){if(n)for(const e in n)return n}function Lm(n){return n}function Ou(n,e,t){for(const[r,o]of e.knownState){if(n.has(r.key))continue;n.add(r.key);const i=t?t.getValue(r):r.defaultValue;if(i!==o&&!r.isEqual(i,o))return!0}return!1}function Mu(n,e,t){const{unknownState:r}=e,o=t?t.unknownState:void 0;if(r){for(const[i,s]of Object.entries(r))if(!n.has(i)&&(n.add(i),s!==(o?o[i]:void 0)))return!0}return!1}function ju(n,e){const t=n.__state;return t&&t.node===n?t.getWritable(e):t}function Ru(n,e){const t=n.__mode,r=n.__format,o=n.__style,i=e.__mode,s=e.__format,a=e.__style,l=n.__state,u=e.__state;return(t===null||t===i)&&(r===null||r===s)&&(o===null||o===a)&&(n.__state===null||l===u||(function(c,d){if(c===d)return!0;const f=new Set;return!(c&&Ou(f,c,d)||d&&Ou(f,d,c)||c&&Mu(f,c,d)||d&&Mu(f,d,c))})(l,u))}function Pu(n,e){const t=n.mergeWithSibling(e),r=pe()._normalizedNodes;return r.add(n.__key),r.add(e.__key),t}function Lu(n){let e,t,r=n;if(r.__text!==""||!r.isSimpleText()||r.isUnmergeable()){for(;(e=r.getPreviousSibling())!==null&&D(e)&&e.isSimpleText()&&!e.isUnmergeable();){if(e.__text!==""){if(Ru(e,r)){r=Pu(e,r);break}break}e.remove()}for(;(t=r.getNextSibling())!==null&&D(t)&&t.isSimpleText()&&!t.isUnmergeable();){if(t.__text!==""){if(Ru(r,t)){r=Pu(r,t);break}break}t.remove()}}else r.remove()}function Kt(n){return Iu(n.anchor),Iu(n.focus),n}function Iu(n){for(;n.type==="element";){const e=n.getNode(),t=n.offset;let r,o;if(t===e.getChildrenSize()?(r=e.getChildAtIndex(t-1),o=!0):(r=e.getChildAtIndex(t),o=!1),D(r)){n.set(r.__key,o?r.getTextContentSize():0,"text",!0);break}if(!x(r))break;n.set(r.__key,o?r.getChildrenSize():0,"element",!0)}}const vo=Symbol.for("@lexical/CachedTextSize");function Bu(n,e){return xa.read(()=>{let t=0,r=n;for(let o=0;o<e&&r!==null;o++){const i=zt.get(r);if(i===void 0&&$(345,r),x(i)){const s=De.get(r);if(s!==void 0&&x(s)&&s.__parent!==i.__parent)t+=i.getTextContentSize();else{const a=Hn.get(r),l=a&&a.__lexicalTextContent;typeof l!="string"&&$(346,i.getType()),t+=l.length}o<e-1&&!i.isInline()&&(t+=2)}else{const s=i[vo];s===void 0&&$(347,i.getType(),r),t+=s}r=i.__next}return t},{editor:de})}function zf(n){x(n)||n[vo]===void 0&&(n[vo]=D(n)?n.__text.length:n.getTextContentSize())}const Im=4;let So,de,wo,ie="",ze=null,Ze=null,qe=null;function Wt(){return{firstTextKey:qe,format:ze,style:Ze}}function Ct(n){n.firstTextKey!==null&&(ze=n.format,Ze=n.style,qe=n.firstTextKey)}function ka(n){if(qe!==null)return;const e=n.__lexicalFirstTextKey;if(e===void 0&&$(348),e===null)return;const t=De.get(e);D(t)&&(ze=t.getFormat(),Ze=t.getStyle(),qe=e)}let ds,po,mo,zt,xa,De,Hn,Ca,Eo,Jn,ln=!1,Fi=!1;function Cn(n,e){const t=zt.get(n),r=De.has(n);if(e!==null){const o=Ta(n);o.parentNode===e&&e.removeChild(o)}if(!r){if(de._keyToDOMMap.delete(n),x(t)){const o=Gi(t,zt);va(o,0,o.length-1,null)}if(t!==void 0){for(const o of pt(t).values()){const i=wa(o);Cn(o,null),i!==null&&i.remove()}Wl(Eo,wo,ds,t,"destroyed")}}}function va(n,e,t,r){for(let o=e;o<=t;++o){const i=n[o];i!==void 0&&Cn(i,r)}}function Rn(n,e){n.setProperty("text-align",e)}const Bm="40px";function Of(n,e){const t=So.theme.indent;if(typeof t=="string"){const r=n.classList.contains(t);e>0&&!r?n.classList.add(t):e<1&&r&&n.classList.remove(t)}n.style.setProperty("padding-inline-start",e===0?"":`calc(${e} * var(--lexical-indent-base-value, ${Bm}))`)}function Mf(n,e){const t=n.style;e===0?Rn(t,""):e===1?Rn(t,"left"):e===2?Rn(t,"center"):e===3?Rn(t,"right"):e===4?Rn(t,"justify"):e===5?Rn(t,"start"):e===6&&Rn(t,"end")}function Sa(n,e){const t=(function(r){const o=r.__dir;if(o!==null)return o;if(Oe(r))return null;const i=r.getParent();return i===null||Se(i)&&i.__dir===null?"auto":null})(e);t!==null?n.dir=t:n.removeAttribute("dir")}function jf(n){const e=ae().createElement("div");return e.setAttribute("data-lexical-slot",n),e.style.display="none",e}function Rf(n,e,t){e||n.contentEditable==="false"?Xy(t,de):t.removeAttribute("contenteditable")}function Ku(n,e,t){const r=ie,o=Wt();ie="";let i="";const s=re(n);for(const[a,l]of t){const u=jf(a);Rf(e,s,u),e.appendChild(u),ie="";const c=Wt();vn(l,Dt(n,u,de)),Ct(c),Pf(n,a,e,u),i+=ie}return Ct(o),ie=r,i}function pt(n){return dn(n)&&n.__slots!==null?n.__slots:tg}function Pf(n,e,t,r){const o=Jn.$getSlotTargetElement(n,e,t,de);o!==null&&(r.parentElement!==o&&o.appendChild(r),r.style.display="")}function wa(n){const e=Hn.get(n);return e!==void 0?e.parentElement:null}function Wu(n,e,t){const r=pt(n),o=pt(e);for(const[c,d]of r)if(!o.has(c)){const f=wa(d);Cn(d,null),f!==null&&f.remove()}const i=ie,s=Wt();let a="",l=null;const u=re(e);for(const[c,d]of o){const f=r.get(c);let h=f!==void 0?wa(f):null;ie="";const g=Wt();if(h===null){h=jf(c);let m=null;for(const p of t.children)if(!p.hasAttribute("data-lexical-slot")){m=p;break}t.insertBefore(h,m),vn(d,Dt(e,h,de))}else f===d?an(d,h):(f!==void 0&&Cn(f,h),vn(d,Dt(e,h,de)));if(Ct(g),Rf(t,u,h),Pf(e,c,t,h),a+=ie,h.parentElement===t){const m=l===null?t.firstChild:l.nextSibling;m!==h&&t.insertBefore(h,m),l=h}}return Ct(s),ie=i,a}function vn(n,e){const t=De.get(n);if(t===void 0&&$(60),e!==null){const o=zt.get(n);if(o!==void 0){const i=Hn.get(n);if(i!==void 0){const s=Gn(o)?o.__slotHost:null,a=Gn(t)?t.__slotHost:null,l=o.__parent!==t.__parent||s!==a,u=a!==null&&i.parentElement!==e.element;if(l||u)return e.insertChild(i),an(n,e.element)}}}const r=Jn.$createDOM(t,de);if((function(o,i,s){const a=s._keyToDOMMap;Ph(i,s,o),a.set(o,i)})(n,r,de),D(t)?r.setAttribute("data-lexical-text","true"):re(t)&&(r.setAttribute("data-lexical-decorator","true"),Yi(r,{captureSelection:!0})),x(t)){const o=t.__indent,i=t.__size;Sa(r,t),o!==0&&Of(r,o);const s=pt(t),a=s.size>0?Ku(t,r,s):"";if(i===0)r.__lexicalTextContent=a,r.__lexicalFirstTextKey=null,ie+=a,s.size>0&&(r.__lexicalSlotTextLength=a.length);else{const u=ie,c=i-1;if(Ea(Gi(t,De),t,0,c,Dt(t,r,de)),a!==""){const d=r.__lexicalTextContent||"";r.__lexicalTextContent=a+d,ie=u+a+d}s.size>0&&(r.__lexicalSlotTextLength=a.length)}const l=t.__format;l!==0&&Mf(r,l),t.isInline()||Lf(null,t,r)}else{const o=t.getTextContent();if(re(t)){const i=t.decorate(de,So);i!==null&&If(n,i),r.contentEditable="false";const s=pt(t);s.size>0&&Ku(t,r,s)}ie+=o}return e!==null&&e.insertChild(r),Jn.$decorateDOM(t,null,r,de),zf(t),Wl(Eo,wo,ds,t,"created"),r}function Ea(n,e,t,r,o){const i=ie,s=Wt();ie="",ze=null,Ze=null,qe=null;let a=t;for(;a<=r;++a){const u=Wt();vn(n[a],o);const c=De.get(n[a]);c!==null&&D(c)?ze===null&&(ze=c.getFormat(),Ze=c.getStyle(),qe=c.__key):x(c)&&a<r&&!c.isInline()&&(ie+=Bn),Ct(u)}const l=de._keyToDOMMap.get(e.__key);l===void 0&&$(349,e.__key),l.__lexicalTextContent=ie,l.__lexicalFirstTextKey=qe,ie=i+ie,Ct(s)}function Lf(n,e,t){const r=Dt(e,t,de),o=r.element.__lexicalLastChildKind??null,i=(function(s,a){if(s){const l=s.__last;if(l){const u=a.get(l);if(u)return We(u)?"line-break":re(u)&&u.isInline()?"decorator":null}return pt(s).size>0?null:"empty"}return null})(e,De);o!==i&&r.setManagedLineBreak(i)}function Km(n,e,t){var r;ze=null,Ze=null,qe=null,(function(o,i,s){const a=ie,l=o.__size,u=i.__size;ie="";const c=s.element,d=de._keyToDOMMap.get(i.__key);d===void 0&&$(351,i.__key);const f=u-l;if(!ln&&Math.abs(f)<=1&&l>=Im&&o.__first===i.__first&&(f!==0||!de._cloneNotNeeded.has(o.__key))){const h=d.__lexicalTextContent,g=Ca.get(o.__key);if(!ln&&typeof h=="string"&&g!==void 0){const m=(function(p,y){const _=y.size;if(_===0||_>=p.__size)return null;let b=p.__last,k=null,S=0;for(;b!==null&&S<_;){if(!y.has(b))return null;k=b;const C=De.get(b);if(C===void 0)return null;b=C.__prev,S++}return S!==_||b!==null&&y.has(b)?null:k})(i,g);if(m!==null){const p=g.size;if(f===0){const y=Bu(m,p);let _=m,b=0;for(;_!==null&&b<p;){const v=De.get(_);if(v===void 0)break;const E=Wt();an(_,c),D(v)&&ze===null&&(ze=v.getFormat(),Ze=v.getStyle(),qe=v.__key),Ct(E),_=v.__next,b++}let k="";for(_=m,b=0;_!==null&&b<p;){const v=De.get(_);if(v===void 0)break;let E;if(x(v)){const A=de._keyToDOMMap.get(_),T=A&&A.__lexicalTextContent;typeof T!="string"&&$(352,v.getType()),E=T}else E=v.getTextContent();k+=E,b<p-1&&x(v)&&!v.isInline()&&(k+=Bn),_=v.__next,b++}const S=d.__lexicalSlotTextLength||0,C=S>0?h.slice(S):h,w=C.slice(0,C.length-y)+k;return d.__lexicalTextContent=w,ie=a+w,void qu(i,d,g)}if((function(y,_,b,k,S,C,w,v){if(v!==1&&v!==-1||w!==(v===1?2:1))return!1;const A=w-v;let T=y.__last;for(let oe=0;oe<A-1;oe++){if(T===null)return!1;const $e=zt.get(T);if($e===void 0)return!1;T=$e.__prev}if(T===null)return!1;const j=De.get(C),M=zt.get(T);if(j===void 0||M===void 0||j.__prev!==M.__prev)return!1;const R=[];let I=C;for(let oe=0;oe<w;oe++){if(I===null)return!1;R.push(I);const $e=De.get(I);I=$e?$e.__next:null}const te=[];I=T;for(let oe=0;oe<A;oe++){if(I===null)return!1;te.push(I);const $e=zt.get(I);I=$e?$e.__next:null}const se=new Set(te),ne=new Set(R),B=[];let L=0,K=0;for(;L<A&&K<w;)if(R[K]===te[L])B.push({key:R[K],kind:"reconcile"}),L++,K++;else if(ne.has(te[L])){if(se.has(R[K]))return!1;B.push({key:R[K],kind:"create",nextIndex:K}),K++}else B.push({key:te[L],kind:"destroy"}),L++;for(;L<A;)B.push({key:te[L++],kind:"destroy"});for(;K<w;)B.push({key:R[K],kind:"create",nextIndex:K}),K++;const H=Bu(T,A);for(const oe of B){const $e=Wt();if(oe.kind==="reconcile")an(oe.key,b.element);else if(oe.kind==="destroy")Cn(oe.key,b.element);else{let it=null;for(let nn=oe.nextIndex+1;nn<w;nn++){const _n=de._keyToDOMMap.get(R[nn]);if(_n!==void 0){it=_n;break}}vn(oe.key,b.withBefore(it??b.before))}if(oe.kind!=="destroy"){const it=De.get(oe.key);it&&D(it)&&ze===null&&(ze=it.getFormat(),Ze=it.getStyle(),qe=it.__key)}Ct($e)}let Y="";for(let oe=0;oe<w;oe++){const $e=De.get(R[oe]);if($e===void 0)return!1;let it;if(x($e)){const nn=de._keyToDOMMap.get(R[oe]),_n=nn&&nn.__lexicalTextContent;typeof _n!="string"&&$(350,$e.getType()),it=_n}else it=$e.getTextContent();Y+=it,oe<w-1&&x($e)&&!$e.isInline()&&(Y+=Bn)}const he=k.__lexicalSlotTextLength||0,ot=he>0?S.slice(he):S;return k.__lexicalTextContent=ot.slice(0,ot.length-H)+Y,!0})(o,0,s,d,h,m,p,f)){const y=d.__lexicalTextContent;return typeof y!="string"&&$(353),ie=a+y,void qu(i,d,g)}}}if(f===0){let m=o.__first,p=0;for(;m!==null;){const y=De.get(m);if(y===void 0)break;const _=ln||mo.has(m)||po.has(m),b=Wt();if(_)an(m,c);else{let k,S;if(x(y)){S=Hn.get(m);const C=S&&S.__lexicalTextContent;typeof C!="string"&&$(354,y.getType()),k=C}else k=y.getTextContent();ie+=k,S!==void 0&&ka(S)}D(y)?ze===null&&(ze=y.getFormat(),Ze=y.getStyle(),qe=y.__key):x(y)&&p<u-1&&!y.isInline()&&(ie+=Bn),Ct(b),m=y.__next,p++}return d.__lexicalTextContent=ie,d.__lexicalFirstTextKey=qe,void(ie=a+ie)}}if(l===1&&u===1){const h=o.__first,g=i.__first;if(h===g)an(h,c);else{const p=Ta(h),y=vn(g,null);try{p.parentNode===c?c.replaceChild(y,p):s.insertChild(y)}catch(_){if(typeof _=="object"&&_!=null){const b=`${_.toString()} Parent: ${c.tagName}, new child: {tag: ${y.tagName} key: ${g}}, old child: {tag: ${p.tagName}, key: ${h}}.`;throw new Error(b)}throw _}Cn(h,null)}const m=De.get(g);D(m)&&ze===null&&(ze=m.getFormat(),Ze=m.getStyle(),qe=m.__key)}else{const h=Gi(o,zt),g=Gi(i,De);if(h.length!==l&&$(227),g.length!==u&&$(228),l===0)u!==0&&Ea(g,i,0,u-1,s);else if(u===0){if(l!==0){const m=s.after==null&&s.before==null&&pt(i).size===0&&s.element.__lexicalLineBreak==null;va(h,0,l-1,m?null:c),m&&(c.textContent="")}}else(function(m,p,y,_,b,k){const S=_-1,C=b-1;let w,v,E=k.getFirstChild(),A=0,T=0;for(;A<=S&&T<=C;){const R=p[A],I=y[T],te=Wt();if(R===I)E=Ks(an(I,k.element)),A++,T++;else{if(v===void 0&&(v=Uu(y,T)),w===void 0)w=Uu(p,A);else if(!w.has(R)){A++,Ct(te);continue}if(!v.has(R)){E=Ks(Ta(R)),Cn(R,k.element),A++,w.delete(R),Ct(te);continue}if(w.has(I)){const ne=Lr(de,I);ne!==E&&k.withBefore(E??k.before).insertChild(ne),E=Ks(an(I,k.element)),A++,T++}else vn(I,k.withBefore(E??k.before)),T++}const se=De.get(I);se!==null&&D(se)?ze===null&&(ze=se.getFormat(),Ze=se.getStyle(),qe=se.__key):x(se)&&T<=C&&!se.isInline()&&(ie+=Bn),Ct(te)}const j=A>S,M=T>C;if(j&&!M){const R=y[C+1],I=R===void 0?null:de.getElementByKey(R);Ea(y,m,T,C,k.withBefore(I??k.before))}else M&&!j&&va(p,A,S,k.element)})(i,h,g,l,u,s)}d.__lexicalTextContent=ie,d.__lexicalFirstTextKey=qe,ie=a+ie})(n,e,Dt(e,t,de)),Se(e)||(r=e,ze==null||ze===r.__textFormat||Fi||r.setTextFormat(ze),(function(o){Ze==null||Ze===o.__textStyle||Fi||o.setTextStyle(Ze)})(e))}function qu(n,e,t){const r=e.__lexicalFirstTextKey;if(r!=null){const o=n.__key;let i=r;for(;i!==null;){const s=De.get(i);if(s===void 0){i=null;break}if(s.__parent===o)break;i=s.__parent}if(i!==null&&!t.has(i)){const s=De.get(r);if(D(s))return ze=s.getFormat(),void(Ze=s.getStyle())}}e.__lexicalFirstTextKey=qe}function an(n,e){const t=zt.get(n);let r=De.get(n);t!==void 0&&r!==void 0||$(61);const o=ln||mo.has(n)||po.has(n),i=Lr(de,n);if(t===r&&!o){let s;if(x(t)){const a=i.__lexicalTextContent;typeof a!="string"&&$(355,t.getType()),s=a,ka(i)}else s=t.getTextContent();return ie+=s,i}if(t!==r&&o&&Wl(Eo,wo,ds,r,"updated"),Jn.$updateDOM(r,t,i,de)){const s=vn(n,null);return e===null&&$(62),e.replaceChild(s,i),Cn(n,null),s}if(x(t)){x(r)||$(334,n);const s=r.__indent;(ln||s!==t.__indent)&&Of(i,s);const a=r.__format;(ln||a!==t.__format)&&Mf(i,a);const l=o&&(pt(r).size>0||pt(t).size>0)?Wu(t,r,i):"";if(o){const u=ie;if(Km(t,r,i),Oe(r)||r.isInline()||Lf(0,r,i),l!==""){const c=i.__lexicalTextContent||"";i.__lexicalTextContent=l+c,ie=u+l+c,i.__lexicalSlotTextLength=l.length}else(pt(r).size>0||pt(t).size>0)&&(i.__lexicalSlotTextLength=0)}else{const u=i.__lexicalTextContent;typeof u!="string"&&$(356,t.getType()),ie+=u,ka(i)}if((ln||r.__dir!==t.__dir||r.__parent!==t.__parent)&&(Sa(i,r),Oe(r)&&!ln))for(const u of r.getChildren())x(u)&&Sa(Lr(de,u.getKey()),u)}else{const s=r.getTextContent();if(re(r)){const a=r.decorate(de,So);a!==null&&If(n,a),o&&(pt(r).size>0||pt(t).size>0)&&Wu(t,r,i)}ie+=s}if(!Fi&&Oe(r)){const s=r.getLatest();if(s.__cachedText!==ie){const a=s.getWritable();a.__cachedText=ie,r=a}}return Jn.$decorateDOM(r,t,i,de),zf(r),i}function If(n,e){let t=de._pendingDecorators;const r=de._decorators;if(t===null){if(r[n]===e)return;t=Lh(de)}t[n]=e}function Ks(n){let e=n.nextSibling;return e!==null&&e===de._blockCursorElement&&(e=e.nextSibling),e}function Uu(n,e){const t=new Set;for(let r=e;r<n.length;r++)t.add(n[r]);return t}function Wm(n,e,t,r,o,i){ie="",ze=null,Ze=null,qe=null,ln=r===2,de=t,So=t._config,Jn=t._config.dom||qi,wo=t._nodes,ds=de._listeners.mutation,po=o,mo=i,zt=n._nodeMap,xa=n,De=e._nodeMap,Fi=e._readOnly,Hn=wf(t._keyToDOMMap),Ca=(function(){const a=new Map,l=u=>{for(const c of u){const d=De.get(c);if(d===void 0)continue;const f=d.__parent;if(f===null)continue;let h=a.get(f);h===void 0&&(h=new Set,a.set(f,h)),h.add(c)}};return l(po.keys()),l(mo),a})();const s=new Map;return Eo=s,an("root",null),de=void 0,wo=void 0,po=void 0,mo=void 0,zt=void 0,xa=void 0,De=void 0,So=void 0,Hn=void 0,Ca=void 0,Eo=void 0,Jn=qi,s}function Ta(n){const e=Hn.get(n);return e===void 0&&$(75,n),e}function W(n){return{type:n}}const qt=W("SELECTION_CHANGE_COMMAND"),Bf=W("SELECTION_INSERT_CLIPBOARD_NODES_COMMAND"),fs=W("CLICK_COMMAND"),Kf=W("BEFORE_INPUT_COMMAND"),Wf=W("INPUT_COMMAND"),qf=W("COMPOSITION_START_COMMAND"),Uf=W("COMPOSITION_END_COMMAND"),Sn=W("DELETE_CHARACTER_COMMAND"),wr=W("INSERT_LINE_BREAK_COMMAND"),Vn=W("INSERT_PARAGRAPH_COMMAND"),Wn=W("CONTROLLED_TEXT_INSERTION_COMMAND"),Yr=W("PASTE_COMMAND"),bi=W("REMOVE_TEXT_COMMAND"),Or=W("DELETE_WORD_COMMAND"),Mr=W("DELETE_LINE_COMMAND"),Ot=W("FORMAT_TEXT_COMMAND"),qm=W("SET_TEXT_FORMAT_COMMAND"),hs=W("UNDO_COMMAND"),gs=W("REDO_COMMAND"),ps=W("KEYDOWN_COMMAND"),Cl=W("KEY_ARROW_RIGHT_COMMAND"),Hf=W("MOVE_TO_END"),vl=W("KEY_ARROW_LEFT_COMMAND"),Jf=W("MOVE_TO_START"),Sl=W("KEY_ARROW_UP_COMMAND"),wl=W("KEY_ARROW_DOWN_COMMAND"),zi=W("KEY_ENTER_COMMAND"),Vf=W("KEY_SPACE_COMMAND"),ms=W("KEY_BACKSPACE_COMMAND"),El=W("KEY_ESCAPE_COMMAND"),Tl=W("KEY_DELETE_COMMAND"),Nl=W("KEY_TAB_COMMAND"),Um=W("INSERT_TAB_COMMAND"),Hm=W("INDENT_CONTENT_COMMAND"),Hu=W("OUTDENT_CONTENT_COMMAND"),Yf=W("DROP_COMMAND"),Xf=W("FORMAT_ELEMENT_COMMAND"),Gf=W("DRAGSTART_COMMAND"),Zf=W("DRAGOVER_COMMAND"),Jm=W("DRAGEND_COMMAND"),Ko=W("COPY_COMMAND"),ys=W("CUT_COMMAND"),Dl=W("SELECT_ALL_COMMAND"),Vm=W("CLEAR_EDITOR_COMMAND"),Ym=W("CLEAR_HISTORY_COMMAND"),lo=W("CAN_REDO_COMMAND"),uo=W("CAN_UNDO_COMMAND"),Qf=W("FOCUS_COMMAND"),Xm=W("BLUR_COMMAND"),Gm=W("KEY_MODIFIER_COMMAND");function Zm(n){const e=new Map;return{dispose(){for(const t of e.values())t.dispose();e.clear()},register(t,r){let o=e.get(t);o===void 0&&(o={dispose:n(t,r),holders:new Set},e.set(t,o));const i=()=>{const s=e.get(t);s&&s.holders.delete(i)&&s.holders.size===0&&(e.delete(t),s.dispose())};return o.holders.add(i),i}}}function yo(n,e,t,r){return n.addEventListener(e,t,r),n.removeEventListener.bind(n,e,t,r)}const rn=Object.freeze({}),Na=[["keydown",function(n,e){const t=e._inputState;t.lastKeyDownTimeStamp=n.timeStamp,t.lastKeyCode=n.key,n.key!=="Backspace"&&To(t),!e.isComposing()&&P(e,ps,n)}],["pointerdown",function(n,e){const t=Xn(n),r=n.pointerType;Lt(t)&&r!=="touch"&&r!=="pen"&&n.button===0&&wt(e,()=>{Xi(t,e)||(e._inputState.isSelectionChangeFromMouseDown=!0)})}],["compositionstart",function(n,e){P(e,qf,n)}],["compositionend",function(n,e){const t=e._inputState;Pt?t.compositionPhase="ending-firefox":Tn||!Po&&!Lo?P(e,Uf,n):(t.compositionPhase="ending-safari",t.compositionEndData=n.data)}],["input",function(n,e){n.stopPropagation();const t=e._inputState;To(t),wt(e,()=>{rh(n,e)||e.dispatchCommand(Wf,n)},{event:n}),t.unprocessedBeforeInputData=null}],["click",function(n,e){wt(e,()=>{const t=O(),r=Pe(gt(e)),o=yt();if(r){if(N(t)){const i=t.anchor,s=i.getNode();i.type==="element"&&i.offset===0&&t.isCollapsed()&&!Oe(s)&&fe().getChildrenSize()===1&&s.getTopLevelElementOrThrow().isEmpty()&&o!==null&&t.is(o)&&(r.removeAllRanges(),t.dirty=!0)}else if(n.pointerType==="touch"||n.pointerType==="pen"){const i=ft(r,e._rootElement).anchorNode;(q(i)||ht(i))&&be(Do(o,r,e,n))}}if(Pt&&r!==null&&r.rangeCount===0){const i=e._rootElement;if(i!==null&&n.target===i){const s=n.clientY;let a=i.childNodes.length;for(let u=0;u<i.childNodes.length;u++){const c=i.childNodes[u];if(q(c)){const d=c.getBoundingClientRect();if(s<=(d.top+d.bottom)/2){a=u;break}}}r.setBaseAndExtent(i,a,i,a);const l=Do(o,r,e,n);l!==null?be(l):r.removeAllRanges()}}P(e,fs,n)})}],["cut",rn],["copy",rn],["dragstart",rn],["dragover",rn],["dragend",rn],["paste",rn],["focus",rn],["blur",rn],["drop",rn]];zr&&Na.push(["beforeinput",(n,e)=>(function(t,r){const o=t.inputType;o==="deleteCompositionText"||Pt&&Wh(r)||o!=="insertCompositionText"&&wt(r,()=>{rh(t,r)||P(r,Kf,t)},{event:t})})(n,e)]);const Da=new WeakMap,Oi=new WeakMap,Qm=Zm(n=>(n.addEventListener("selectionchange",Gu),()=>n.removeEventListener("selectionchange",Gu)));function eh(n,e,t,r,o,i){const s=n.anchor,a=n.focus,l=s.getNode(),u=pe();let c;if(i!==void 0)c=i;else{const m=Pe(gt(u));c=m!==null?ft(m,u._rootElement):null}const d=c!==null?c.anchorNode:null,f=s.key,h=u.getElementByKey(f),g=t.length;return f!==a.key||!D(l)||(!o&&(!zr||u._inputState.lastBeforeInputInsertTextTimeStamp<r+50)||l.isDirty()&&g<2||Ih(t))&&s.offset!==a.offset&&!l.isComposing()||Et(l)||l.isDirty()&&g>1||(o||!zr)&&h!==null&&!l.isComposing()&&d!==En(l,h,u)||c!==null&&e!==null&&(!e.collapsed||e.startContainer!==c.anchorNode||e.startOffset!==c.anchorOffset)||!l.isComposing()&&(l.getFormat()!==n.format||l.getStyle()!==n.style)||(function(m,p){if(p.isSegmented())return!0;if(!m.isCollapsed())return!1;const y=m.anchor.offset,_=p.getParentOrThrow(),b=Ui(p);return y===0?!p.canInsertTextBefore()||!_.canInsertTextBefore()&&!p.isComposing()||b||(function(k){const S=k.getPreviousSibling();return(D(S)||x(S)&&S.isInline())&&!S.canInsertTextAfter()})(p):y===p.getTextContentSize()&&(!p.canInsertTextAfter()||!_.canInsertTextAfter()&&!p.isComposing()||b)})(n,l)}function Ju(n,e){return ht(n)&&n.nodeValue!==null&&e!==0&&e!==n.nodeValue.length}function Vu(n,e,t){const{anchorNode:r,anchorOffset:o,focusNode:i,focusOffset:s}=ft(n,e._rootElement),a=e._inputState;a.isSelectionChangeFromDOMUpdate&&(a.isSelectionChangeFromDOMUpdate=!1,Ju(r,o)&&Ju(i,s)&&!a.postDeleteSelectionToRestore)||wt(e,()=>{if(!t)return void be(null);if(!Ho(e,r,i))return;let l=O();if(a.postDeleteSelectionToRestore&&N(l)&&l.isCollapsed()){const u=l.anchor,c=a.postDeleteSelectionToRestore.anchor;(u.key===c.key&&u.offset===c.offset+1||u.offset===1&&c.getNode().is(u.getNode().getPreviousSibling()))&&(l=a.postDeleteSelectionToRestore.clone(),be(l))}if(a.postDeleteSelectionToRestore=null,N(l)){const u=l.anchor,c=u.getNode();if(l.isCollapsed()){n.type==="Range"&&r===i&&(l.dirty=!0);const d=gt(e).event,f=d?d.timeStamp:performance.now(),{format:h,style:g,offset:m,key:p,timeStamp:y}=a.collapsedSelectionFormat,_=fe(),b=e.isComposing()===!1&&_.getTextContent()==="";if(f<y+200&&u.offset===m&&u.key===p)ki(l,h,g);else if(u.type==="text")D(c)||$(141),th(l,c);else if(u.type==="element"&&!b){x(c)||$(259);const k=u.getNode();k.isEmpty()?(function(S,C){const w=C.getTextFormat(),v=C.getTextStyle();ki(S,w,v)})(l,k):ki(l,l.format,"")}}else{const d=u.key,f=l.focus.key,h=l.getNodes(),g=h.length,m=l.isBackward(),p=m?s:o,y=m?o:s,_=m?f:d,b=m?d:f;let k=2047,S=!1;for(let C=0;C<g;C++){const w=h[C],v=w.getTextContentSize();if(D(w)&&v!==0&&!(C===0&&w.__key===_&&p===v||C===g-1&&w.__key===b&&y===0)&&(S=!0,k&=w.getFormat(),k===0))break}l.format=S?k:0}}P(e,qt)})}function ki(n,e,t){n.format===e&&n.style===t||(n.format=e,n.style=t,n.dirty=!0)}function th(n,e){ki(n,e.getFormat(),e.getStyle())}function nh(n){if(!n.getTargetRanges)return null;const e=n.getTargetRanges();return e.length===0?null:e[0]}function Yu(n){const{lastKeyCode:e}=pe()._inputState;if(n==null||n.length<=1||e==null)return;const t=e.length===1?e:e==="Enter"?`
4
4
  `:e==="Tab"?" ":null;if(!t)return;const r=O();if(!N(r)||!r.isCollapsed())return;const o=r.anchor.getNode();if(!D(o))return;const{offset:i}=r.anchor;if(o.getTextContentSize()===i){const s=o.getNextSibling();if(t===`
@@ -1 +1 @@
1
- import{f as r,s as o,g as a}from"./useSignature-Boz2_w0h.js";import{o as n}from"./rich-text-spellcheck-provider-J8m9wz6A.js";import"./index-BnBpXn45.js";const l=t=>({post:e=>t.postMessage(e),listen:e=>t.addEventListener("message",s=>e(s.data)),fail:e=>t.addEventListener("error",s=>e(s.message)),terminate:()=>t.terminate()}),m=async t=>{const e=r(t);if(!e)return null;const s=new Worker(new URL("/assets/rich-text-spellcheck-worker-pWkhC-WR.js",import.meta.url),{type:"module"});return n(e,o(),l(s),a(e))};export{m as openSpellcheckWorker};
1
+ import{f as r,s as o,g as a}from"./useSignature-klArqmQ3.js";import{o as n}from"./rich-text-spellcheck-provider-J8m9wz6A.js";import"./index-CmOAOx38.js";const l=t=>({post:e=>t.postMessage(e),listen:e=>t.addEventListener("message",s=>e(s.data)),fail:e=>t.addEventListener("error",s=>e(s.message)),terminate:()=>t.terminate()}),m=async t=>{const e=r(t);if(!e)return null;const s=new Worker(new URL("/assets/rich-text-spellcheck-worker-pWkhC-WR.js",import.meta.url),{type:"module"});return n(e,o(),l(s),a(e))};export{m as openSpellcheckWorker};
@@ -1 +1 @@
1
- import{b as a}from"./index-BnBpXn45.js";const e={name:"rotate-ccw",size:24,node:[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]};e.node;const o=a(e);export{o as R};
1
+ import{b as a}from"./index-CmOAOx38.js";const e={name:"rotate-ccw",size:24,node:[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]};e.node;const o=a(e);export{o as R};
@@ -1 +1 @@
1
- import{r as d}from"./index-BnBpXn45.js";const E={"data-list-row":""},v="[data-list-row]";function m(e,r,s,i="vertical"){if(s===0)return null;const n=i==="vertical"?"ArrowDown":"ArrowRight",c=i==="vertical"?"ArrowUp":"ArrowLeft";return e===n?r<0?0:Math.min(r+1,s-1):e===c?r<=0?0:r-1:e==="Home"?0:e==="End"?s-1:null}function l(e,r){return Array.from(e.querySelectorAll(r))}function y({containerRef:e,itemSelector:r,orientation:s="vertical",enabled:i=!0}){d.useEffect(()=>{if(!i)return;const n=e.current;if(!n)return;const c=()=>{const t=l(n,r);if(t.length===0)return;const f=t.find(o=>o===document.activeElement)??t[0];for(const o of t)o.tabIndex=o===f?0:-1},u=t=>{if(t.shiftKey||t.metaKey||t.ctrlKey||t.altKey)return;const a=l(n,r),f=a.indexOf(document.activeElement),o=m(t.key,f,a.length,s);o===null||o===f||(t.preventDefault(),t.stopPropagation(),a[o]?.focus())};return c(),n.addEventListener("focusin",c),n.addEventListener("keydown",u),()=>{n.removeEventListener("focusin",c),n.removeEventListener("keydown",u)}})}export{v as L,E as a,m as r,y as u};
1
+ import{r as d}from"./index-CmOAOx38.js";const E={"data-list-row":""},v="[data-list-row]";function m(e,r,s,i="vertical"){if(s===0)return null;const n=i==="vertical"?"ArrowDown":"ArrowRight",c=i==="vertical"?"ArrowUp":"ArrowLeft";return e===n?r<0?0:Math.min(r+1,s-1):e===c?r<=0?0:r-1:e==="Home"?0:e==="End"?s-1:null}function l(e,r){return Array.from(e.querySelectorAll(r))}function y({containerRef:e,itemSelector:r,orientation:s="vertical",enabled:i=!0}){d.useEffect(()=>{if(!i)return;const n=e.current;if(!n)return;const c=()=>{const t=l(n,r);if(t.length===0)return;const f=t.find(o=>o===document.activeElement)??t[0];for(const o of t)o.tabIndex=o===f?0:-1},u=t=>{if(t.shiftKey||t.metaKey||t.ctrlKey||t.altKey)return;const a=l(n,r),f=a.indexOf(document.activeElement),o=m(t.key,f,a.length,s);o===null||o===f||(t.preventDefault(),t.stopPropagation(),a[o]?.focus())};return c(),n.addEventListener("focusin",c),n.addEventListener("keydown",u),()=>{n.removeEventListener("focusin",c),n.removeEventListener("keydown",u)}})}export{v as L,E as a,m as r,y as u};
@@ -1 +1 @@
1
- import{r as e,j as l,B as b,p as y,L as x}from"./index-BnBpXn45.js";const i=()=>l.jsx(x,{className:"size-3.5 animate-spin"}),m=(s,n)=>n?l.jsx("span",{className:"sr-only",children:s}):s;function c({actions:s=[],destructive:n,className:o}){const[f,r]=e.useState(!1);return f&&n?.confirm?l.jsxs("div",{className:y("flex items-center gap-2",o),children:[l.jsx("span",{className:"text-xs text-fg-muted",children:n.confirm.prompt}),l.jsx(b,{variant:"secondary",size:"sm",onClick:()=>r(!1),children:n.confirm.cancelLabel??"Cancel"}),l.jsx(b,{variant:"danger",size:"sm","aria-busy":n.busy,icon:n.busy?i():void 0,onClick:()=>{n.busy||n.onClick()},children:n.busy?n.busyLabel??"Working…":n.confirm.confirmLabel??n.label})]}):l.jsxs("div",{className:y("flex items-center gap-2",o),children:[s.map(a=>l.jsx(b,{variant:a.variant??"ghost",size:"sm","aria-busy":a.busy,"aria-label":a.iconOnly?a.label:void 0,icon:a.busy?i():a.icon,onClick:()=>{a.busy||a.onClick()},children:a.busy&&a.busyLabel?a.busyLabel:m(a.label,a.iconOnly)},a.label)),n&&l.jsx(b,{variant:"ghost",size:"sm","aria-busy":n.busy,"aria-label":n.iconOnly?n.label:void 0,icon:n.busy?i():n.icon,onClick:()=>{if(!n.busy){if(n.confirm){r(!0);return}n.onClick()}},children:n.busy&&n.busyLabel?n.busyLabel:m(n.label,n.iconOnly)})]})}export{c as R};
1
+ import{r as e,j as l,B as b,p as y,L as x}from"./index-CmOAOx38.js";const i=()=>l.jsx(x,{className:"size-3.5 animate-spin"}),m=(s,n)=>n?l.jsx("span",{className:"sr-only",children:s}):s;function c({actions:s=[],destructive:n,className:o}){const[f,r]=e.useState(!1);return f&&n?.confirm?l.jsxs("div",{className:y("flex items-center gap-2",o),children:[l.jsx("span",{className:"text-xs text-fg-muted",children:n.confirm.prompt}),l.jsx(b,{variant:"secondary",size:"sm",onClick:()=>r(!1),children:n.confirm.cancelLabel??"Cancel"}),l.jsx(b,{variant:"danger",size:"sm","aria-busy":n.busy,icon:n.busy?i():void 0,onClick:()=>{n.busy||n.onClick()},children:n.busy?n.busyLabel??"Working…":n.confirm.confirmLabel??n.label})]}):l.jsxs("div",{className:y("flex items-center gap-2",o),children:[s.map(a=>l.jsx(b,{variant:a.variant??"ghost",size:"sm","aria-busy":a.busy,"aria-label":a.iconOnly?a.label:void 0,icon:a.busy?i():a.icon,onClick:()=>{a.busy||a.onClick()},children:a.busy&&a.busyLabel?a.busyLabel:m(a.label,a.iconOnly)},a.label)),n&&l.jsx(b,{variant:"ghost",size:"sm","aria-busy":n.busy,"aria-label":n.iconOnly?n.label:void 0,icon:n.busy?i():n.icon,onClick:()=>{if(!n.busy){if(n.confirm){r(!0);return}n.onClick()}},children:n.busy&&n.busyLabel?n.busyLabel:m(n.label,n.iconOnly)})]})}export{c as R};
@@ -1 +1 @@
1
- import{u as v,J as x,r as I}from"./index-BnBpXn45.js";import{u as p,a as g,d as Q}from"./reply-CzX8Q1T1.js";import{b}from"./MailShell-qe4eiESL.js";import{a as q}from"./useMessageBodyContent-DzlZ514L.js";function A(a){const t=v(),{searchInput:c,searchQuery:e}=x(),i=p({select:o=>g(o.location.search)}),u=p({select:o=>o.location.pathname}),h=q(),f=Q(),m=h||f,{to:s}=a,r="params"in a?a.params.mailboxId:void 0,l=r?`/mail/${r}`:s;I.useEffect(()=>{if(!b({searchInput:c,committedQuery:e,urlQuery:i,pathname:u,listPath:l}))return;const y=!!e&&i!==e&&!m,n=d=>({...d,q:e||void 0});if(!y){t({to:".",search:n,hash:!0,replace:!0});return}if(s==="/mail/$mailboxId"){if(!r)return;t({to:s,params:{mailboxId:r},search:n,hash:!0,replace:!0});return}t({to:s,search:n,hash:!0,replace:!0})},[c,e,i,t,s,r,l,u,m])}export{A as u};
1
+ import{u as v,J as x,r as I}from"./index-CmOAOx38.js";import{u as p,a as g,d as Q}from"./reply-BBXEHuds.js";import{b}from"./MailShell-BO8c-sH6.js";import{a as q}from"./useMessageBodyContent-CsZ9VCHu.js";function A(a){const t=v(),{searchInput:c,searchQuery:e}=x(),i=p({select:o=>g(o.location.search)}),u=p({select:o=>o.location.pathname}),h=q(),f=Q(),m=h||f,{to:s}=a,r="params"in a?a.params.mailboxId:void 0,l=r?`/mail/${r}`:s;I.useEffect(()=>{if(!b({searchInput:c,committedQuery:e,urlQuery:i,pathname:u,listPath:l}))return;const y=!!e&&i!==e&&!m,n=d=>({...d,q:e||void 0});if(!y){t({to:".",search:n,hash:!0,replace:!0});return}if(s==="/mail/$mailboxId"){if(!r)return;t({to:s,params:{mailboxId:r},search:n,hash:!0,replace:!0});return}t({to:s,search:n,hash:!0,replace:!0})},[c,e,i,t,s,r,l,u,m])}export{A as u};
@@ -1 +1 @@
1
- import{r as u,ci as En,j as A,p as en,aB as In}from"./index-BnBpXn45.js";import{A as Rn}from"./app-chrome-1USNGfE3.js";const Nn=1024,An=1280;function Ln(e,n=Nn,t=An){const r=e>=n;return{nav:r,reading:r,intelligence:e>=t}}function dt(e){return e===void 0?!1:e.handlers.focusNext!==void 0&&e.handlers.focusPrevious!==void 0}function kn(e){const n=u.useRef(null),[t,r]=u.useState(e??null);return u.useEffect(()=>{const i=n.current;if(!i||typeof ResizeObserver>"u")return;const o=new ResizeObserver(a=>{const g=a[0];g&&r(g.contentRect.width)});o.observe(i);const l=getComputedStyle(i),s=Number.parseFloat(l.paddingLeft)+Number.parseFloat(l.paddingRight);return r(i.clientWidth-s),()=>o.disconnect()},[]),[n,t]}const Ee=u.createContext(null);Ee.displayName="PanelGroupContext";const H={group:"data-panel-group",groupDirection:"data-panel-group-direction",groupId:"data-panel-group-id",panel:"data-panel",panelCollapsible:"data-panel-collapsible",panelId:"data-panel-id",panelSize:"data-panel-size",resizeHandle:"data-resize-handle",resizeHandleActive:"data-resize-handle-active",resizeHandleEnabled:"data-panel-resize-handle-enabled",resizeHandleId:"data-panel-resize-handle-id",resizeHandleState:"data-resize-handle-state"},Ge=10,se=u.useLayoutEffect,Ve=En.useId,Dn=typeof Ve=="function"?Ve:()=>null;let Mn=0;function We(e=null){const n=Dn(),t=u.useRef(e||n||null);return t.current===null&&(t.current=""+Mn++),e??t.current}function nn({children:e,className:n="",collapsedSize:t,collapsible:r,defaultSize:i,forwardedRef:o,id:l,maxSize:s,minSize:a,onCollapse:g,onExpand:w,onResize:f,order:c,style:z,tagName:h="div",...E}){const C=u.useContext(Ee);if(C===null)throw Error("Panel components must be rendered within a PanelGroup container");const{collapsePanel:P,expandPanel:N,getPanelSize:k,getPanelStyle:D,groupId:O,isPanelCollapsed:I,reevaluatePanelConstraints:v,registerPanel:V,resizePanel:B,unregisterPanel:F}=C,W=We(l),L=u.useRef({callbacks:{onCollapse:g,onExpand:w,onResize:f},constraints:{collapsedSize:t,collapsible:r,defaultSize:i,maxSize:s,minSize:a},id:W,idIsFromProps:l!==void 0,order:c});u.useRef({didLogMissingDefaultSizeWarning:!1}),se(()=>{const{callbacks:j,constraints:$}=L.current,G={...$};L.current.id=W,L.current.idIsFromProps=l!==void 0,L.current.order=c,j.onCollapse=g,j.onExpand=w,j.onResize=f,$.collapsedSize=t,$.collapsible=r,$.defaultSize=i,$.maxSize=s,$.minSize=a,(G.collapsedSize!==$.collapsedSize||G.collapsible!==$.collapsible||G.maxSize!==$.maxSize||G.minSize!==$.minSize)&&v(L.current,G)}),se(()=>{const j=L.current;return V(j),()=>{F(j)}},[c,W,V,F]),u.useImperativeHandle(o,()=>({collapse:()=>{P(L.current)},expand:j=>{N(L.current,j)},getId(){return W},getSize(){return k(L.current)},isCollapsed(){return I(L.current)},isExpanded(){return!I(L.current)},resize:j=>{B(L.current,j)}}),[P,N,k,I,W,B]);const U=D(L.current,i);return u.createElement(h,{...E,children:e,className:n,id:W,style:{...U,...z},[H.groupId]:O,[H.panel]:"",[H.panelCollapsible]:r||void 0,[H.panelId]:W,[H.panelSize]:parseFloat(""+U.flexGrow).toFixed(1)})}const tn=u.forwardRef((e,n)=>u.createElement(nn,{...e,forwardedRef:n}));nn.displayName="Panel";tn.displayName="forwardRef(Panel)";let je=null,Pe=-1,ne=null;function Hn(e,n){if(n){const t=(n&an)!==0,r=(n&cn)!==0,i=(n&un)!==0,o=(n&dn)!==0;if(t)return i?"se-resize":o?"ne-resize":"e-resize";if(r)return i?"sw-resize":o?"nw-resize":"w-resize";if(i)return"s-resize";if(o)return"n-resize"}switch(e){case"horizontal":return"ew-resize";case"intersection":return"move";case"vertical":return"ns-resize"}}function $n(){ne!==null&&(document.head.removeChild(ne),je=null,ne=null,Pe=-1)}function Le(e,n){var t,r;const i=Hn(e,n);if(je!==i){if(je=i,ne===null&&(ne=document.createElement("style"),document.head.appendChild(ne)),Pe>=0){var o;(o=ne.sheet)===null||o===void 0||o.removeRule(Pe)}Pe=(t=(r=ne.sheet)===null||r===void 0?void 0:r.insertRule(`*{cursor: ${i} !important;}`))!==null&&t!==void 0?t:-1}}function rn(e){return e.type==="keydown"}function on(e){return e.type.startsWith("pointer")}function ln(e){return e.type.startsWith("mouse")}function Ie(e){if(on(e)){if(e.isPrimary)return{x:e.clientX,y:e.clientY}}else if(ln(e))return{x:e.clientX,y:e.clientY};return{x:1/0,y:1/0}}function _n(){if(typeof matchMedia=="function")return matchMedia("(pointer:coarse)").matches?"coarse":"fine"}function jn(e,n,t){return e.x<n.x+n.width&&e.x+e.width>n.x&&e.y<n.y+n.height&&e.y+e.height>n.y}function Gn(e,n){if(e===n)throw new Error("Cannot compare node with itself");const t={a:qe(e),b:qe(n)};let r;for(;t.a.at(-1)===t.b.at(-1);)e=t.a.pop(),n=t.b.pop(),r=e;S(r,"Stacking order can only be calculated for elements with a common ancestor");const i={a:Ue(Ke(t.a)),b:Ue(Ke(t.b))};if(i.a===i.b){const o=r.childNodes,l={a:t.a.at(-1),b:t.b.at(-1)};let s=o.length;for(;s--;){const a=o[s];if(a===l.a)return 1;if(a===l.b)return-1}}return Math.sign(i.a-i.b)}const Wn=/\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;function Fn(e){var n;const t=getComputedStyle((n=sn(e))!==null&&n!==void 0?n:e).display;return t==="flex"||t==="inline-flex"}function Bn(e){const n=getComputedStyle(e);return!!(n.position==="fixed"||n.zIndex!=="auto"&&(n.position!=="static"||Fn(e))||+n.opacity<1||"transform"in n&&n.transform!=="none"||"webkitTransform"in n&&n.webkitTransform!=="none"||"mixBlendMode"in n&&n.mixBlendMode!=="normal"||"filter"in n&&n.filter!=="none"||"webkitFilter"in n&&n.webkitFilter!=="none"||"isolation"in n&&n.isolation==="isolate"||Wn.test(n.willChange)||n.webkitOverflowScrolling==="touch")}function Ke(e){let n=e.length;for(;n--;){const t=e[n];if(S(t,"Missing node"),Bn(t))return t}return null}function Ue(e){return e&&Number(getComputedStyle(e).zIndex)||0}function qe(e){const n=[];for(;e;)n.push(e),e=sn(e);return n}function sn(e){const{parentNode:n}=e;return n&&n instanceof ShadowRoot?n.host:n}const an=1,cn=2,un=4,dn=8,Tn=_n()==="coarse";let X=[],pe=!1,le=new Map,Re=new Map;const ve=new Set;function On(e,n,t,r,i){var o;const{ownerDocument:l}=n,s={direction:t,element:n,hitAreaMargins:r,setResizeHandlerState:i},a=(o=le.get(l))!==null&&o!==void 0?o:0;return le.set(l,a+1),ve.add(s),we(),function(){var w;Re.delete(e),ve.delete(s);const f=(w=le.get(l))!==null&&w!==void 0?w:1;if(le.set(l,f-1),we(),f===1&&le.delete(l),X.includes(s)){const c=X.indexOf(s);c>=0&&X.splice(c,1),Be(),i("up",!0,null)}}}function Vn(e){const{target:n}=e,{x:t,y:r}=Ie(e);pe=!0,Fe({target:n,x:t,y:r}),we(),X.length>0&&(Ce("down",e),e.preventDefault(),fn(n)||e.stopImmediatePropagation())}function ke(e){const{x:n,y:t}=Ie(e);if(pe&&e.buttons===0&&(pe=!1,Ce("up",e)),!pe){const{target:r}=e;Fe({target:r,x:n,y:t})}Ce("move",e),Be(),X.length>0&&e.preventDefault()}function De(e){const{target:n}=e,{x:t,y:r}=Ie(e);Re.clear(),pe=!1,X.length>0&&(e.preventDefault(),fn(n)||e.stopImmediatePropagation()),Ce("up",e),Fe({target:n,x:t,y:r}),Be(),we()}function fn(e){let n=e;for(;n;){if(n.hasAttribute(H.resizeHandle))return!0;n=n.parentElement}return!1}function Fe({target:e,x:n,y:t}){X.splice(0);let r=null;(e instanceof HTMLElement||e instanceof SVGElement)&&(r=e),ve.forEach(i=>{const{element:o,hitAreaMargins:l}=i,s=o.getBoundingClientRect(),{bottom:a,left:g,right:w,top:f}=s,c=Tn?l.coarse:l.fine;if(n>=g-c&&n<=w+c&&t>=f-c&&t<=a+c){if(r!==null&&document.contains(r)&&o!==r&&!o.contains(r)&&!r.contains(o)&&Gn(r,o)>0){let h=r,E=!1;for(;h&&!h.contains(o);){if(jn(h.getBoundingClientRect(),s)){E=!0;break}h=h.parentElement}if(E)return}X.push(i)}})}function Me(e,n){Re.set(e,n)}function Be(){let e=!1,n=!1;X.forEach(r=>{const{direction:i}=r;i==="horizontal"?e=!0:n=!0});let t=0;Re.forEach(r=>{t|=r}),e&&n?Le("intersection",t):e?Le("horizontal",t):n?Le("vertical",t):$n()}let He=new AbortController;function we(){He.abort(),He=new AbortController;const e={capture:!0,signal:He.signal};ve.size&&(pe?(X.length>0&&le.forEach((n,t)=>{const{body:r}=t;n>0&&(r.addEventListener("contextmenu",De,e),r.addEventListener("pointerleave",ke,e),r.addEventListener("pointermove",ke,e))}),window.addEventListener("pointerup",De,e),window.addEventListener("pointercancel",De,e)):le.forEach((n,t)=>{const{body:r}=t;n>0&&(r.addEventListener("pointerdown",Vn,e),r.addEventListener("pointermove",ke,e))}))}function Ce(e,n){ve.forEach(t=>{const{setResizeHandlerState:r}=t,i=X.includes(t);r(e,i,n)})}function Kn(){const[e,n]=u.useState(0);return u.useCallback(()=>n(t=>t+1),[])}function S(e,n){if(!e)throw console.error(n),Error(n)}function ae(e,n,t=Ge){return e.toFixed(t)===n.toFixed(t)?0:e>n?1:-1}function Z(e,n,t=Ge){return ae(e,n,t)===0}function K(e,n,t){return ae(e,n,t)===0}function Un(e,n,t){if(e.length!==n.length)return!1;for(let r=0;r<e.length;r++){const i=e[r],o=n[r];if(!K(i,o,t))return!1}return!0}function fe({panelConstraints:e,panelIndex:n,size:t}){const r=e[n];S(r!=null,`Panel constraints not found for index ${n}`);let{collapsedSize:i=0,collapsible:o,maxSize:l=100,minSize:s=0}=r;if(ae(t,s)<0)if(o){const a=(i+s)/2;ae(t,a)<0?t=i:t=s}else t=s;return t=Math.min(l,t),t=parseFloat(t.toFixed(Ge)),t}function xe({delta:e,initialLayout:n,panelConstraints:t,pivotIndices:r,prevLayout:i,trigger:o}){if(K(e,0))return n;const l=[...n],[s,a]=r;S(s!=null,"Invalid first pivot index"),S(a!=null,"Invalid second pivot index");let g=0;if(o==="keyboard"){{const f=e<0?a:s,c=t[f];S(c,`Panel constraints not found for index ${f}`);const{collapsedSize:z=0,collapsible:h,minSize:E=0}=c;if(h){const C=n[f];if(S(C!=null,`Previous layout not found for panel index ${f}`),K(C,z)){const P=E-C;ae(P,Math.abs(e))>0&&(e=e<0?0-P:P)}}}{const f=e<0?s:a,c=t[f];S(c,`No panel constraints found for index ${f}`);const{collapsedSize:z=0,collapsible:h,minSize:E=0}=c;if(h){const C=n[f];if(S(C!=null,`Previous layout not found for panel index ${f}`),K(C,E)){const P=C-z;ae(P,Math.abs(e))>0&&(e=e<0?0-P:P)}}}}{const f=e<0?1:-1;let c=e<0?a:s,z=0;for(;;){const E=n[c];S(E!=null,`Previous layout not found for panel index ${c}`);const P=fe({panelConstraints:t,panelIndex:c,size:100})-E;if(z+=P,c+=f,c<0||c>=t.length)break}const h=Math.min(Math.abs(e),Math.abs(z));e=e<0?0-h:h}{let c=e<0?s:a;for(;c>=0&&c<t.length;){const z=Math.abs(e)-Math.abs(g),h=n[c];S(h!=null,`Previous layout not found for panel index ${c}`);const E=h-z,C=fe({panelConstraints:t,panelIndex:c,size:E});if(!K(h,C)&&(g+=h-C,l[c]=C,g.toPrecision(3).localeCompare(Math.abs(e).toPrecision(3),void 0,{numeric:!0})>=0))break;e<0?c--:c++}}if(Un(i,l))return i;{const f=e<0?a:s,c=n[f];S(c!=null,`Previous layout not found for panel index ${f}`);const z=c+g,h=fe({panelConstraints:t,panelIndex:f,size:z});if(l[f]=h,!K(h,z)){let E=z-h,P=e<0?a:s;for(;P>=0&&P<t.length;){const N=l[P];S(N!=null,`Previous layout not found for panel index ${P}`);const k=N+E,D=fe({panelConstraints:t,panelIndex:P,size:k});if(K(N,D)||(E-=D-N,l[P]=D),K(E,0))break;e>0?P--:P++}}}const w=l.reduce((f,c)=>c+f,0);return K(w,100)?l:i}function qn({layout:e,panelsArray:n,pivotIndices:t}){let r=0,i=100,o=0,l=0;const s=t[0];S(s!=null,"No pivot index found"),n.forEach((f,c)=>{const{constraints:z}=f,{maxSize:h=100,minSize:E=0}=z;c===s?(r=E,i=h):(o+=E,l+=h)});const a=Math.min(i,100-o),g=Math.max(r,100-l),w=e[s];return{valueMax:a,valueMin:g,valueNow:w}}function ye(e,n=document){return Array.from(n.querySelectorAll(`[${H.resizeHandleId}][data-panel-group-id="${e}"]`))}function pn(e,n,t=document){const i=ye(e,t).findIndex(o=>o.getAttribute(H.resizeHandleId)===n);return i??null}function gn(e,n,t){const r=pn(e,n,t);return r!=null?[r,r+1]:[-1,-1]}function hn(e,n=document){var t;if(n instanceof HTMLElement&&(n==null||(t=n.dataset)===null||t===void 0?void 0:t.panelGroupId)==e)return n;const r=n.querySelector(`[data-panel-group][data-panel-group-id="${e}"]`);return r||null}function Ne(e,n=document){const t=n.querySelector(`[${H.resizeHandleId}="${e}"]`);return t||null}function Xn(e,n,t,r=document){var i,o,l,s;const a=Ne(n,r),g=ye(e,r),w=a?g.indexOf(a):-1,f=(i=(o=t[w])===null||o===void 0?void 0:o.id)!==null&&i!==void 0?i:null,c=(l=(s=t[w+1])===null||s===void 0?void 0:s.id)!==null&&l!==void 0?l:null;return[f,c]}function Jn({committedValuesRef:e,eagerValuesRef:n,groupId:t,layout:r,panelDataArray:i,panelGroupElement:o,setLayout:l}){u.useRef({didWarnAboutMissingResizeHandle:!1}),se(()=>{if(!o)return;const s=ye(t,o);for(let a=0;a<i.length-1;a++){const{valueMax:g,valueMin:w,valueNow:f}=qn({layout:r,panelsArray:i,pivotIndices:[a,a+1]}),c=s[a];if(c!=null){const z=i[a];S(z,`No panel data found for index "${a}"`),c.setAttribute("aria-controls",z.id),c.setAttribute("aria-valuemax",""+Math.round(g)),c.setAttribute("aria-valuemin",""+Math.round(w)),c.setAttribute("aria-valuenow",f!=null?""+Math.round(f):"")}}return()=>{s.forEach((a,g)=>{a.removeAttribute("aria-controls"),a.removeAttribute("aria-valuemax"),a.removeAttribute("aria-valuemin"),a.removeAttribute("aria-valuenow")})}},[t,r,i,o]),u.useEffect(()=>{if(!o)return;const s=n.current;S(s,"Eager values not found");const{panelDataArray:a}=s,g=hn(t,o);S(g!=null,`No group found for id "${t}"`);const w=ye(t,o);S(w,`No resize handles found for group id "${t}"`);const f=w.map(c=>{const z=c.getAttribute(H.resizeHandleId);S(z,"Resize handle element has no handle id attribute");const[h,E]=Xn(t,z,a,o);if(h==null||E==null)return()=>{};const C=P=>{if(!P.defaultPrevented)switch(P.key){case"Enter":{P.preventDefault();const N=a.findIndex(k=>k.id===h);if(N>=0){const k=a[N];S(k,`No panel data found for index ${N}`);const D=r[N],{collapsedSize:O=0,collapsible:I,minSize:v=0}=k.constraints;if(D!=null&&I){const V=xe({delta:K(D,O)?v-O:O-D,initialLayout:r,panelConstraints:a.map(B=>B.constraints),pivotIndices:gn(t,z,o),prevLayout:r,trigger:"keyboard"});r!==V&&l(V)}}break}}};return c.addEventListener("keydown",C),()=>{c.removeEventListener("keydown",C)}});return()=>{f.forEach(c=>c())}},[o,e,n,t,r,i,l])}function Xe(e,n){if(e.length!==n.length)return!1;for(let t=0;t<e.length;t++)if(e[t]!==n[t])return!1;return!0}function mn(e,n){const t=e==="horizontal",{x:r,y:i}=Ie(n);return t?r:i}function Yn(e,n,t,r,i){const o=t==="horizontal",l=Ne(n,i);S(l,`No resize handle element found for id "${n}"`);const s=l.getAttribute(H.groupId);S(s,"Resize handle element has no group id attribute");let{initialCursorPosition:a}=r;const g=mn(t,e),w=hn(s,i);S(w,`No group element found for id "${s}"`);const f=w.getBoundingClientRect(),c=o?f.width:f.height;return(g-a)/c*100}function Zn(e,n,t,r,i,o){if(rn(e)){const l=t==="horizontal";let s=0;e.shiftKey?s=100:i!=null?s=i:s=10;let a=0;switch(e.key){case"ArrowDown":a=l?0:s;break;case"ArrowLeft":a=l?-s:0;break;case"ArrowRight":a=l?s:0;break;case"ArrowUp":a=l?0:-s;break;case"End":a=100;break;case"Home":a=-100;break}return a}else return r==null?0:Yn(e,n,t,r,o)}function Qn({panelDataArray:e}){const n=Array(e.length),t=e.map(o=>o.constraints);let r=0,i=100;for(let o=0;o<e.length;o++){const l=t[o];S(l,`Panel constraints not found for index ${o}`);const{defaultSize:s}=l;s!=null&&(r++,n[o]=s,i-=s)}for(let o=0;o<e.length;o++){const l=t[o];S(l,`Panel constraints not found for index ${o}`);const{defaultSize:s}=l;if(s!=null)continue;const a=e.length-r,g=i/a;r++,n[o]=g,i-=g}return n}function ue(e,n,t){n.forEach((r,i)=>{const o=e[i];S(o,`Panel data not found for index ${i}`);const{callbacks:l,constraints:s,id:a}=o,{collapsedSize:g=0,collapsible:w}=s,f=t[a];if(f==null||r!==f){t[a]=r;const{onCollapse:c,onExpand:z,onResize:h}=l;h&&h(r,f),w&&(c||z)&&(z&&(f==null||Z(f,g))&&!Z(r,g)&&z(),c&&(f==null||!Z(f,g))&&Z(r,g)&&c())}})}function be(e,n){if(e.length!==n.length)return!1;for(let t=0;t<e.length;t++)if(e[t]!=n[t])return!1;return!0}function et({defaultSize:e,dragState:n,layout:t,panelData:r,panelIndex:i,precision:o=3}){const l=t[i];let s;return l==null?s=e!=null?e.toPrecision(o):"1":r.length===1?s="1":s=l.toPrecision(o),{flexBasis:0,flexGrow:s,flexShrink:1,overflow:"hidden",pointerEvents:n!==null?"none":void 0}}function nt(e,n=10){let t=null;return(...i)=>{t!==null&&clearTimeout(t),t=setTimeout(()=>{e(...i)},n)}}function Je(e){try{if(typeof localStorage<"u")e.getItem=n=>localStorage.getItem(n),e.setItem=(n,t)=>{localStorage.setItem(n,t)};else throw new Error("localStorage not supported in this environment")}catch(n){console.error(n),e.getItem=()=>null,e.setItem=()=>{}}}function xn(e){return`react-resizable-panels:${e}`}function zn(e){return e.map(n=>{const{constraints:t,id:r,idIsFromProps:i,order:o}=n;return i?r:o?`${o}:${JSON.stringify(t)}`:JSON.stringify(t)}).sort((n,t)=>n.localeCompare(t)).join(",")}function vn(e,n){try{const t=xn(e),r=n.getItem(t);if(r){const i=JSON.parse(r);if(typeof i=="object"&&i!=null)return i}}catch{}return null}function tt(e,n,t){var r,i;const o=(r=vn(e,t))!==null&&r!==void 0?r:{},l=zn(n);return(i=o[l])!==null&&i!==void 0?i:null}function rt(e,n,t,r,i){var o;const l=xn(e),s=zn(n),a=(o=vn(e,i))!==null&&o!==void 0?o:{};a[s]={expandToSizes:Object.fromEntries(t.entries()),layout:r};try{i.setItem(l,JSON.stringify(a))}catch(g){console.error(g)}}function Ye({layout:e,panelConstraints:n}){const t=[...e],r=t.reduce((o,l)=>o+l,0);if(t.length!==n.length)throw Error(`Invalid ${n.length} panel layout: ${t.map(o=>`${o}%`).join(", ")}`);if(!K(r,100)&&t.length>0)for(let o=0;o<n.length;o++){const l=t[o];S(l!=null,`No layout data found for index ${o}`);const s=100/r*l;t[o]=s}let i=0;for(let o=0;o<n.length;o++){const l=t[o];S(l!=null,`No layout data found for index ${o}`);const s=fe({panelConstraints:n,panelIndex:o,size:l});l!=s&&(i+=l-s,t[o]=s)}if(!K(i,0))for(let o=0;o<n.length;o++){const l=t[o];S(l!=null,`No layout data found for index ${o}`);const s=l+i,a=fe({panelConstraints:n,panelIndex:o,size:s});if(l!==a&&(i-=a-l,t[o]=a,K(i,0)))break}return t}const ot=100,ze={getItem:e=>(Je(ze),ze.getItem(e)),setItem:(e,n)=>{Je(ze),ze.setItem(e,n)}},Ze={};function yn({autoSaveId:e=null,children:n,className:t="",direction:r,forwardedRef:i,id:o=null,onLayout:l=null,keyboardResizeBy:s=null,storage:a=ze,style:g,tagName:w="div",...f}){const c=We(o),z=u.useRef(null),[h,E]=u.useState(null),[C,P]=u.useState([]),N=Kn(),k=u.useRef({}),D=u.useRef(new Map),O=u.useRef(0),I=u.useRef({autoSaveId:e,direction:r,dragState:h,id:c,keyboardResizeBy:s,onLayout:l,storage:a}),v=u.useRef({layout:C,panelDataArray:[],panelDataArrayChanged:!1});u.useRef({didLogIdAndOrderWarning:!1,didLogPanelConstraintsWarning:!1,prevPanelIds:[]}),u.useImperativeHandle(i,()=>({getId:()=>I.current.id,getLayout:()=>{const{layout:d}=v.current;return d},setLayout:d=>{const{onLayout:x}=I.current,{layout:b,panelDataArray:m}=v.current,p=Ye({layout:d,panelConstraints:m.map(y=>y.constraints)});Xe(b,p)||(P(p),v.current.layout=p,x&&x(p),ue(m,p,k.current))}}),[]),se(()=>{I.current.autoSaveId=e,I.current.direction=r,I.current.dragState=h,I.current.id=c,I.current.onLayout=l,I.current.storage=a}),Jn({committedValuesRef:I,eagerValuesRef:v,groupId:c,layout:C,panelDataArray:v.current.panelDataArray,setLayout:P,panelGroupElement:z.current}),u.useEffect(()=>{const{panelDataArray:d}=v.current;if(e){if(C.length===0||C.length!==d.length)return;let x=Ze[e];x==null&&(x=nt(rt,ot),Ze[e]=x);const b=[...d],m=new Map(D.current);x(e,b,m,C,a)}},[e,C,a]),u.useEffect(()=>{});const V=u.useCallback(d=>{const{onLayout:x}=I.current,{layout:b,panelDataArray:m}=v.current;if(d.constraints.collapsible){const p=m.map(J=>J.constraints),{collapsedSize:y=0,panelSize:R,pivotIndices:_}=ie(m,d,b);if(S(R!=null,`Panel size not found for panel "${d.id}"`),!Z(R,y)){D.current.set(d.id,R);const Y=de(m,d)===m.length-1?R-y:y-R,M=xe({delta:Y,initialLayout:b,panelConstraints:p,pivotIndices:_,prevLayout:b,trigger:"imperative-api"});be(b,M)||(P(M),v.current.layout=M,x&&x(M),ue(m,M,k.current))}}},[]),B=u.useCallback((d,x)=>{const{onLayout:b}=I.current,{layout:m,panelDataArray:p}=v.current;if(d.constraints.collapsible){const y=p.map(q=>q.constraints),{collapsedSize:R=0,panelSize:_=0,minSize:J=0,pivotIndices:Y}=ie(p,d,m),M=x??J;if(Z(_,R)){const q=D.current.get(d.id),ge=q!=null&&q>=M?q:M,Ae=de(p,d)===p.length-1?_-ge:ge-_,T=xe({delta:Ae,initialLayout:m,panelConstraints:y,pivotIndices:Y,prevLayout:m,trigger:"imperative-api"});be(m,T)||(P(T),v.current.layout=T,b&&b(T),ue(p,T,k.current))}}},[]),F=u.useCallback(d=>{const{layout:x,panelDataArray:b}=v.current,{panelSize:m}=ie(b,d,x);return S(m!=null,`Panel size not found for panel "${d.id}"`),m},[]),W=u.useCallback((d,x)=>{const{panelDataArray:b}=v.current,m=de(b,d);return et({defaultSize:x,dragState:h,layout:C,panelData:b,panelIndex:m})},[h,C]),L=u.useCallback(d=>{const{layout:x,panelDataArray:b}=v.current,{collapsedSize:m=0,collapsible:p,panelSize:y}=ie(b,d,x);return S(y!=null,`Panel size not found for panel "${d.id}"`),p===!0&&Z(y,m)},[]),U=u.useCallback(d=>{const{layout:x,panelDataArray:b}=v.current,{collapsedSize:m=0,collapsible:p,panelSize:y}=ie(b,d,x);return S(y!=null,`Panel size not found for panel "${d.id}"`),!p||ae(y,m)>0},[]),j=u.useCallback(d=>{const{panelDataArray:x}=v.current;x.push(d),x.sort((b,m)=>{const p=b.order,y=m.order;return p==null&&y==null?0:p==null?-1:y==null?1:p-y}),v.current.panelDataArrayChanged=!0,N()},[N]);se(()=>{if(v.current.panelDataArrayChanged){v.current.panelDataArrayChanged=!1;const{autoSaveId:d,onLayout:x,storage:b}=I.current,{layout:m,panelDataArray:p}=v.current;let y=null;if(d){const _=tt(d,p,b);_&&(D.current=new Map(Object.entries(_.expandToSizes)),y=_.layout)}y==null&&(y=Qn({panelDataArray:p}));const R=Ye({layout:y,panelConstraints:p.map(_=>_.constraints)});Xe(m,R)||(P(R),v.current.layout=R,x&&x(R),ue(p,R,k.current))}}),se(()=>{const d=v.current;return()=>{d.layout=[]}},[]);const $=u.useCallback(d=>{let x=!1;const b=z.current;return b&&window.getComputedStyle(b,null).getPropertyValue("direction")==="rtl"&&(x=!0),function(p){p.preventDefault();const y=z.current;if(!y)return()=>null;const{direction:R,dragState:_,id:J,keyboardResizeBy:Y,onLayout:M}=I.current,{layout:q,panelDataArray:ge}=v.current,{initialLayout:Se}=_??{},Ae=gn(J,d,y);let T=Zn(p,d,R,_,Y,y);const Te=R==="horizontal";Te&&x&&(T=-T);const wn=ge.map(Cn=>Cn.constraints),he=xe({delta:T,initialLayout:Se??q,panelConstraints:wn,pivotIndices:Ae,prevLayout:q,trigger:rn(p)?"keyboard":"mouse-or-touch"}),Oe=!be(q,he);(on(p)||ln(p))&&O.current!=T&&(O.current=T,!Oe&&T!==0?Te?Me(d,T<0?an:cn):Me(d,T<0?un:dn):Me(d,0)),Oe&&(P(he),v.current.layout=he,M&&M(he),ue(ge,he,k.current))}},[]),G=u.useCallback((d,x)=>{const{onLayout:b}=I.current,{layout:m,panelDataArray:p}=v.current,y=p.map(q=>q.constraints),{panelSize:R,pivotIndices:_}=ie(p,d,m);S(R!=null,`Panel size not found for panel "${d.id}"`);const Y=de(p,d)===p.length-1?R-x:x-R,M=xe({delta:Y,initialLayout:m,panelConstraints:y,pivotIndices:_,prevLayout:m,trigger:"imperative-api"});be(m,M)||(P(M),v.current.layout=M,b&&b(M),ue(p,M,k.current))},[]),te=u.useCallback((d,x)=>{const{layout:b,panelDataArray:m}=v.current,{collapsedSize:p=0,collapsible:y}=x,{collapsedSize:R=0,collapsible:_,maxSize:J=100,minSize:Y=0}=d.constraints,{panelSize:M}=ie(m,d,b);M!=null&&(y&&_&&Z(M,p)?Z(p,R)||G(d,R):M<Y?G(d,Y):M>J&&G(d,J))},[G]),ce=u.useCallback((d,x)=>{const{direction:b}=I.current,{layout:m}=v.current;if(!z.current)return;const p=Ne(d,z.current);S(p,`Drag handle element not found for id "${d}"`);const y=mn(b,x);E({dragHandleId:d,dragHandleRect:p.getBoundingClientRect(),initialCursorPosition:y,initialLayout:m})},[]),re=u.useCallback(()=>{E(null)},[]),oe=u.useCallback(d=>{const{panelDataArray:x}=v.current,b=de(x,d);b>=0&&(x.splice(b,1),delete k.current[d.id],v.current.panelDataArrayChanged=!0,N())},[N]),Q=u.useMemo(()=>({collapsePanel:V,direction:r,dragState:h,expandPanel:B,getPanelSize:F,getPanelStyle:W,groupId:c,isPanelCollapsed:L,isPanelExpanded:U,reevaluatePanelConstraints:te,registerPanel:j,registerResizeHandle:$,resizePanel:G,startDragging:ce,stopDragging:re,unregisterPanel:oe,panelGroupElement:z.current}),[V,h,r,B,F,W,c,L,U,te,j,$,G,ce,re,oe]),ee={display:"flex",flexDirection:r==="horizontal"?"row":"column",height:"100%",overflow:"hidden",width:"100%"};return u.createElement(Ee.Provider,{value:Q},u.createElement(w,{...f,children:n,className:t,id:o,ref:z,style:{...ee,...g},[H.group]:"",[H.groupDirection]:r,[H.groupId]:c}))}const Sn=u.forwardRef((e,n)=>u.createElement(yn,{...e,forwardedRef:n}));yn.displayName="PanelGroup";Sn.displayName="forwardRef(PanelGroup)";function de(e,n){return e.findIndex(t=>t===n||t.id===n.id)}function ie(e,n,t){const r=de(e,n),o=r===e.length-1?[r-1,r]:[r,r+1],l=t[r];return{...n.constraints,panelSize:l,pivotIndices:o}}function it({disabled:e,handleId:n,resizeHandler:t,panelGroupElement:r}){u.useEffect(()=>{if(e||t==null||r==null)return;const i=Ne(n,r);if(i==null)return;const o=l=>{if(!l.defaultPrevented)switch(l.key){case"ArrowDown":case"ArrowLeft":case"ArrowRight":case"ArrowUp":case"End":case"Home":{l.preventDefault(),t(l);break}case"F6":{l.preventDefault();const s=i.getAttribute(H.groupId);S(s,`No group element found for id "${s}"`);const a=ye(s,r),g=pn(s,n,r);S(g!==null,`No resize element found for id "${n}"`);const w=l.shiftKey?g>0?g-1:a.length-1:g+1<a.length?g+1:0;a[w].focus();break}}};return i.addEventListener("keydown",o),()=>{i.removeEventListener("keydown",o)}},[r,e,n,t])}function bn({children:e=null,className:n="",disabled:t=!1,hitAreaMargins:r,id:i,onBlur:o,onClick:l,onDragging:s,onFocus:a,onPointerDown:g,onPointerUp:w,style:f={},tabIndex:c=0,tagName:z="div",...h}){var E,C;const P=u.useRef(null),N=u.useRef({onClick:l,onDragging:s,onPointerDown:g,onPointerUp:w});u.useEffect(()=>{N.current.onClick=l,N.current.onDragging=s,N.current.onPointerDown=g,N.current.onPointerUp=w});const k=u.useContext(Ee);if(k===null)throw Error("PanelResizeHandle components must be rendered within a PanelGroup container");const{direction:D,groupId:O,registerResizeHandle:I,startDragging:v,stopDragging:V,panelGroupElement:B}=k,F=We(i),[W,L]=u.useState("inactive"),[U,j]=u.useState(!1),[$,G]=u.useState(null),te=u.useRef({state:W});se(()=>{te.current.state=W}),u.useEffect(()=>{if(t)G(null);else{const Q=I(F);G(()=>Q)}},[t,F,I]);const ce=(E=r?.coarse)!==null&&E!==void 0?E:15,re=(C=r?.fine)!==null&&C!==void 0?C:5;u.useEffect(()=>{if(t||$==null)return;const Q=P.current;S(Q,"Element ref not attached");let ee=!1;return On(F,Q,D,{coarse:ce,fine:re},(x,b,m)=>{if(!b){L("inactive");return}switch(x){case"down":{L("drag"),ee=!1,S(m,'Expected event to be defined for "down" action'),v(F,m);const{onDragging:p,onPointerDown:y}=N.current;p?.(!0),y?.();break}case"move":{const{state:p}=te.current;ee=!0,p!=="drag"&&L("hover"),S(m,'Expected event to be defined for "move" action'),$(m);break}case"up":{L("hover"),V();const{onClick:p,onDragging:y,onPointerUp:R}=N.current;y?.(!1),R?.(),ee||p?.();break}}})},[ce,D,t,re,I,F,$,v,V]),it({disabled:t,handleId:F,resizeHandler:$,panelGroupElement:B});const oe={touchAction:"none",userSelect:"none"};return u.createElement(z,{...h,children:e,className:n,id:i,onBlur:()=>{j(!1),o?.()},onFocus:()=>{j(!0),a?.()},ref:P,role:"separator",style:{...oe,...f},tabIndex:c,[H.groupDirection]:D,[H.groupId]:O,[H.resizeHandle]:"",[H.resizeHandleActive]:W==="drag"?"pointer":U?"keyboard":void 0,[H.resizeHandleEnabled]:!t,[H.resizeHandleId]:F,[H.resizeHandleState]:W})}bn.displayName="PanelResizeHandle";function Qe({className:e,...n}){return A.jsx(Sn,{className:en("flex h-full w-full data-[panel-group-direction=vertical]:flex-col",e),...n})}const me=tn;function $e({className:e,...n}){return A.jsx(bn,{className:en("relative w-px shrink-0 bg-line transition-colors cursor-col-resize","after:absolute after:inset-y-0 after:left-1/2 after:w-1.5 after:-translate-x-1/2","data-[resize-handle-state=hover]:bg-line-strong","data-[resize-handle-state=drag]:bg-accent","focus-visible:outline-none focus-visible:bg-accent",e),...n})}function lt({className:e,children:n}){const t=u.useRef(null),[r,i]=u.useState(null);return u.useEffect(()=>{const o=t.current?.parentElement;if(!o||typeof ResizeObserver>"u")return;const l=()=>{const a=Math.floor(o.getBoundingClientRect().width);i(g=>g===a?g:a)};l();const s=new ResizeObserver(l);return s.observe(o),()=>s.disconnect()},[]),A.jsx("div",{ref:t,className:e,style:r===null?void 0:{width:`${r}px`},children:n})}const Pn=u.createContext(null);function st(e,n){return e==="list"?{size:62,max:78}:e==="detail"?{size:26,max:45}:{size:n==="compact"?43:33,max:58}}function ft(){return u.useContext(Pn)}function pt({nav:e,list:n,reading:t,intelligence:r,intelligenceOpen:i=!0,hasThread:o=!0,density:l="comfortable",listBias:s="balanced",header:a,topBar:g,appBar:w,overlay:f,skeleton:c,isLoading:z=!1,initialWidth:h,navOpen:E,onOpenNav:C,onCloseNav:P}){const[N,k]=kn(h),D=Ln(k??0),[O,I]=u.useState(!1),v=D.nav,V=v&&!O,B=D.reading&&!!t,F=D.intelligence,[W,L]=u.useState(!1),U=E!==void 0,j=U?E:W,$=()=>{U||L(!0),C?.()},G=()=>{U||L(!1),P?.()},te=F&&i&&o&&!!r,re={panes:D,containerWidth:k,showNavPane:v,openNav:$,navCollapsed:O,toggleNav:()=>{if(!v){j?G():$();return}I(d=>!d)},showReadingPane:B,showIntelligencePane:F},oe=st(s,l),Q=A.jsxs(Qe,{direction:"horizontal",className:"min-h-0 flex-1",children:[A.jsx(me,{id:"list",order:1,defaultSize:B?oe.size:100,minSize:22,maxSize:B?oe.max:100,className:"min-w-0",children:n}),B&&A.jsxs(A.Fragment,{children:[A.jsx($e,{}),A.jsx(me,{id:"reading",order:2,minSize:29,className:"min-w-0",children:A.jsx(lt,{className:"h-full",children:t})})]}),te&&A.jsxs(A.Fragment,{children:[A.jsx($e,{}),A.jsx(me,{id:"intelligence",order:3,defaultSize:25,minSize:18,maxSize:39,className:"min-w-0",children:r})]})]},B?"list-reading":"list-only"),ee=A.jsxs("div",{className:"flex min-h-0 min-w-0 flex-1 flex-col",children:[!v&&a&&A.jsx("div",{className:"shrink-0",children:a}),Q]});return A.jsx(Pn.Provider,{value:re,children:A.jsxs("div",{ref:N,className:"safe-area-frame @container flex h-full w-full flex-col overflow-hidden bg-canvas font-sans text-fg",children:[A.jsx(Rn,{topBar:g,appBar:w,children:z&&c?c:V?A.jsxs(Qe,{direction:"horizontal",className:"min-h-0 flex-1",children:[A.jsx(me,{id:"nav",order:1,defaultSize:17,minSize:12,maxSize:24,className:"min-w-0",children:e}),A.jsx($e,{}),A.jsx(me,{id:"content",order:2,className:"flex min-w-0 flex-col",children:ee})]}):ee}),!(z&&c)&&A.jsxs(A.Fragment,{children:[!v&&A.jsx(In,{open:j,onClose:G,title:"Folders",anchor:"left",children:e}),f]})]})})}const _e="search-scope";function at(e){const n=e.trim().replace(/\s+/g," ").toLowerCase();return/\s/.test(n)?`in:"${n}"`:`in:${n}`}function gt(e){return e.list!==void 0&&e.list!=="brief"}function ht(e){return e.list==="mailbox"?e.mailboxId:void 0}function mt(e,n){return e.list==="flagged"?{kind:"scoped",chip:{id:_e,label:"is:starred"}}:e.list==="outbox"?{kind:"scoped",chip:{id:_e,label:"in:outbox"}}:e.list==="mailbox"?n?{kind:"scoped",chip:{id:_e,label:at(n)}}:{kind:"pending"}:{kind:"global"}}function xt(e,n,t){return n.kind==="global"?{kind:"global"}:e.list==="flagged"?{kind:"collection"}:{kind:"folder",...t?{role:t}:{}}}export{pt as A,_e as S,xt as a,gt as i,dt as k,ht as r,mt as s,ft as u};
1
+ import{r as u,ci as En,j as A,p as en,aB as In}from"./index-CmOAOx38.js";import{A as Rn}from"./app-chrome-DEclDxYQ.js";const Nn=1024,An=1280;function Ln(e,n=Nn,t=An){const r=e>=n;return{nav:r,reading:r,intelligence:e>=t}}function dt(e){return e===void 0?!1:e.handlers.focusNext!==void 0&&e.handlers.focusPrevious!==void 0}function kn(e){const n=u.useRef(null),[t,r]=u.useState(e??null);return u.useEffect(()=>{const i=n.current;if(!i||typeof ResizeObserver>"u")return;const o=new ResizeObserver(a=>{const g=a[0];g&&r(g.contentRect.width)});o.observe(i);const l=getComputedStyle(i),s=Number.parseFloat(l.paddingLeft)+Number.parseFloat(l.paddingRight);return r(i.clientWidth-s),()=>o.disconnect()},[]),[n,t]}const Ee=u.createContext(null);Ee.displayName="PanelGroupContext";const H={group:"data-panel-group",groupDirection:"data-panel-group-direction",groupId:"data-panel-group-id",panel:"data-panel",panelCollapsible:"data-panel-collapsible",panelId:"data-panel-id",panelSize:"data-panel-size",resizeHandle:"data-resize-handle",resizeHandleActive:"data-resize-handle-active",resizeHandleEnabled:"data-panel-resize-handle-enabled",resizeHandleId:"data-panel-resize-handle-id",resizeHandleState:"data-resize-handle-state"},Ge=10,se=u.useLayoutEffect,Ve=En.useId,Dn=typeof Ve=="function"?Ve:()=>null;let Mn=0;function We(e=null){const n=Dn(),t=u.useRef(e||n||null);return t.current===null&&(t.current=""+Mn++),e??t.current}function nn({children:e,className:n="",collapsedSize:t,collapsible:r,defaultSize:i,forwardedRef:o,id:l,maxSize:s,minSize:a,onCollapse:g,onExpand:w,onResize:f,order:c,style:z,tagName:h="div",...E}){const C=u.useContext(Ee);if(C===null)throw Error("Panel components must be rendered within a PanelGroup container");const{collapsePanel:P,expandPanel:N,getPanelSize:k,getPanelStyle:D,groupId:O,isPanelCollapsed:I,reevaluatePanelConstraints:v,registerPanel:V,resizePanel:B,unregisterPanel:F}=C,W=We(l),L=u.useRef({callbacks:{onCollapse:g,onExpand:w,onResize:f},constraints:{collapsedSize:t,collapsible:r,defaultSize:i,maxSize:s,minSize:a},id:W,idIsFromProps:l!==void 0,order:c});u.useRef({didLogMissingDefaultSizeWarning:!1}),se(()=>{const{callbacks:j,constraints:$}=L.current,G={...$};L.current.id=W,L.current.idIsFromProps=l!==void 0,L.current.order=c,j.onCollapse=g,j.onExpand=w,j.onResize=f,$.collapsedSize=t,$.collapsible=r,$.defaultSize=i,$.maxSize=s,$.minSize=a,(G.collapsedSize!==$.collapsedSize||G.collapsible!==$.collapsible||G.maxSize!==$.maxSize||G.minSize!==$.minSize)&&v(L.current,G)}),se(()=>{const j=L.current;return V(j),()=>{F(j)}},[c,W,V,F]),u.useImperativeHandle(o,()=>({collapse:()=>{P(L.current)},expand:j=>{N(L.current,j)},getId(){return W},getSize(){return k(L.current)},isCollapsed(){return I(L.current)},isExpanded(){return!I(L.current)},resize:j=>{B(L.current,j)}}),[P,N,k,I,W,B]);const U=D(L.current,i);return u.createElement(h,{...E,children:e,className:n,id:W,style:{...U,...z},[H.groupId]:O,[H.panel]:"",[H.panelCollapsible]:r||void 0,[H.panelId]:W,[H.panelSize]:parseFloat(""+U.flexGrow).toFixed(1)})}const tn=u.forwardRef((e,n)=>u.createElement(nn,{...e,forwardedRef:n}));nn.displayName="Panel";tn.displayName="forwardRef(Panel)";let je=null,Pe=-1,ne=null;function Hn(e,n){if(n){const t=(n&an)!==0,r=(n&cn)!==0,i=(n&un)!==0,o=(n&dn)!==0;if(t)return i?"se-resize":o?"ne-resize":"e-resize";if(r)return i?"sw-resize":o?"nw-resize":"w-resize";if(i)return"s-resize";if(o)return"n-resize"}switch(e){case"horizontal":return"ew-resize";case"intersection":return"move";case"vertical":return"ns-resize"}}function $n(){ne!==null&&(document.head.removeChild(ne),je=null,ne=null,Pe=-1)}function Le(e,n){var t,r;const i=Hn(e,n);if(je!==i){if(je=i,ne===null&&(ne=document.createElement("style"),document.head.appendChild(ne)),Pe>=0){var o;(o=ne.sheet)===null||o===void 0||o.removeRule(Pe)}Pe=(t=(r=ne.sheet)===null||r===void 0?void 0:r.insertRule(`*{cursor: ${i} !important;}`))!==null&&t!==void 0?t:-1}}function rn(e){return e.type==="keydown"}function on(e){return e.type.startsWith("pointer")}function ln(e){return e.type.startsWith("mouse")}function Ie(e){if(on(e)){if(e.isPrimary)return{x:e.clientX,y:e.clientY}}else if(ln(e))return{x:e.clientX,y:e.clientY};return{x:1/0,y:1/0}}function _n(){if(typeof matchMedia=="function")return matchMedia("(pointer:coarse)").matches?"coarse":"fine"}function jn(e,n,t){return e.x<n.x+n.width&&e.x+e.width>n.x&&e.y<n.y+n.height&&e.y+e.height>n.y}function Gn(e,n){if(e===n)throw new Error("Cannot compare node with itself");const t={a:qe(e),b:qe(n)};let r;for(;t.a.at(-1)===t.b.at(-1);)e=t.a.pop(),n=t.b.pop(),r=e;S(r,"Stacking order can only be calculated for elements with a common ancestor");const i={a:Ue(Ke(t.a)),b:Ue(Ke(t.b))};if(i.a===i.b){const o=r.childNodes,l={a:t.a.at(-1),b:t.b.at(-1)};let s=o.length;for(;s--;){const a=o[s];if(a===l.a)return 1;if(a===l.b)return-1}}return Math.sign(i.a-i.b)}const Wn=/\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;function Fn(e){var n;const t=getComputedStyle((n=sn(e))!==null&&n!==void 0?n:e).display;return t==="flex"||t==="inline-flex"}function Bn(e){const n=getComputedStyle(e);return!!(n.position==="fixed"||n.zIndex!=="auto"&&(n.position!=="static"||Fn(e))||+n.opacity<1||"transform"in n&&n.transform!=="none"||"webkitTransform"in n&&n.webkitTransform!=="none"||"mixBlendMode"in n&&n.mixBlendMode!=="normal"||"filter"in n&&n.filter!=="none"||"webkitFilter"in n&&n.webkitFilter!=="none"||"isolation"in n&&n.isolation==="isolate"||Wn.test(n.willChange)||n.webkitOverflowScrolling==="touch")}function Ke(e){let n=e.length;for(;n--;){const t=e[n];if(S(t,"Missing node"),Bn(t))return t}return null}function Ue(e){return e&&Number(getComputedStyle(e).zIndex)||0}function qe(e){const n=[];for(;e;)n.push(e),e=sn(e);return n}function sn(e){const{parentNode:n}=e;return n&&n instanceof ShadowRoot?n.host:n}const an=1,cn=2,un=4,dn=8,Tn=_n()==="coarse";let X=[],pe=!1,le=new Map,Re=new Map;const ve=new Set;function On(e,n,t,r,i){var o;const{ownerDocument:l}=n,s={direction:t,element:n,hitAreaMargins:r,setResizeHandlerState:i},a=(o=le.get(l))!==null&&o!==void 0?o:0;return le.set(l,a+1),ve.add(s),we(),function(){var w;Re.delete(e),ve.delete(s);const f=(w=le.get(l))!==null&&w!==void 0?w:1;if(le.set(l,f-1),we(),f===1&&le.delete(l),X.includes(s)){const c=X.indexOf(s);c>=0&&X.splice(c,1),Be(),i("up",!0,null)}}}function Vn(e){const{target:n}=e,{x:t,y:r}=Ie(e);pe=!0,Fe({target:n,x:t,y:r}),we(),X.length>0&&(Ce("down",e),e.preventDefault(),fn(n)||e.stopImmediatePropagation())}function ke(e){const{x:n,y:t}=Ie(e);if(pe&&e.buttons===0&&(pe=!1,Ce("up",e)),!pe){const{target:r}=e;Fe({target:r,x:n,y:t})}Ce("move",e),Be(),X.length>0&&e.preventDefault()}function De(e){const{target:n}=e,{x:t,y:r}=Ie(e);Re.clear(),pe=!1,X.length>0&&(e.preventDefault(),fn(n)||e.stopImmediatePropagation()),Ce("up",e),Fe({target:n,x:t,y:r}),Be(),we()}function fn(e){let n=e;for(;n;){if(n.hasAttribute(H.resizeHandle))return!0;n=n.parentElement}return!1}function Fe({target:e,x:n,y:t}){X.splice(0);let r=null;(e instanceof HTMLElement||e instanceof SVGElement)&&(r=e),ve.forEach(i=>{const{element:o,hitAreaMargins:l}=i,s=o.getBoundingClientRect(),{bottom:a,left:g,right:w,top:f}=s,c=Tn?l.coarse:l.fine;if(n>=g-c&&n<=w+c&&t>=f-c&&t<=a+c){if(r!==null&&document.contains(r)&&o!==r&&!o.contains(r)&&!r.contains(o)&&Gn(r,o)>0){let h=r,E=!1;for(;h&&!h.contains(o);){if(jn(h.getBoundingClientRect(),s)){E=!0;break}h=h.parentElement}if(E)return}X.push(i)}})}function Me(e,n){Re.set(e,n)}function Be(){let e=!1,n=!1;X.forEach(r=>{const{direction:i}=r;i==="horizontal"?e=!0:n=!0});let t=0;Re.forEach(r=>{t|=r}),e&&n?Le("intersection",t):e?Le("horizontal",t):n?Le("vertical",t):$n()}let He=new AbortController;function we(){He.abort(),He=new AbortController;const e={capture:!0,signal:He.signal};ve.size&&(pe?(X.length>0&&le.forEach((n,t)=>{const{body:r}=t;n>0&&(r.addEventListener("contextmenu",De,e),r.addEventListener("pointerleave",ke,e),r.addEventListener("pointermove",ke,e))}),window.addEventListener("pointerup",De,e),window.addEventListener("pointercancel",De,e)):le.forEach((n,t)=>{const{body:r}=t;n>0&&(r.addEventListener("pointerdown",Vn,e),r.addEventListener("pointermove",ke,e))}))}function Ce(e,n){ve.forEach(t=>{const{setResizeHandlerState:r}=t,i=X.includes(t);r(e,i,n)})}function Kn(){const[e,n]=u.useState(0);return u.useCallback(()=>n(t=>t+1),[])}function S(e,n){if(!e)throw console.error(n),Error(n)}function ae(e,n,t=Ge){return e.toFixed(t)===n.toFixed(t)?0:e>n?1:-1}function Z(e,n,t=Ge){return ae(e,n,t)===0}function K(e,n,t){return ae(e,n,t)===0}function Un(e,n,t){if(e.length!==n.length)return!1;for(let r=0;r<e.length;r++){const i=e[r],o=n[r];if(!K(i,o,t))return!1}return!0}function fe({panelConstraints:e,panelIndex:n,size:t}){const r=e[n];S(r!=null,`Panel constraints not found for index ${n}`);let{collapsedSize:i=0,collapsible:o,maxSize:l=100,minSize:s=0}=r;if(ae(t,s)<0)if(o){const a=(i+s)/2;ae(t,a)<0?t=i:t=s}else t=s;return t=Math.min(l,t),t=parseFloat(t.toFixed(Ge)),t}function xe({delta:e,initialLayout:n,panelConstraints:t,pivotIndices:r,prevLayout:i,trigger:o}){if(K(e,0))return n;const l=[...n],[s,a]=r;S(s!=null,"Invalid first pivot index"),S(a!=null,"Invalid second pivot index");let g=0;if(o==="keyboard"){{const f=e<0?a:s,c=t[f];S(c,`Panel constraints not found for index ${f}`);const{collapsedSize:z=0,collapsible:h,minSize:E=0}=c;if(h){const C=n[f];if(S(C!=null,`Previous layout not found for panel index ${f}`),K(C,z)){const P=E-C;ae(P,Math.abs(e))>0&&(e=e<0?0-P:P)}}}{const f=e<0?s:a,c=t[f];S(c,`No panel constraints found for index ${f}`);const{collapsedSize:z=0,collapsible:h,minSize:E=0}=c;if(h){const C=n[f];if(S(C!=null,`Previous layout not found for panel index ${f}`),K(C,E)){const P=C-z;ae(P,Math.abs(e))>0&&(e=e<0?0-P:P)}}}}{const f=e<0?1:-1;let c=e<0?a:s,z=0;for(;;){const E=n[c];S(E!=null,`Previous layout not found for panel index ${c}`);const P=fe({panelConstraints:t,panelIndex:c,size:100})-E;if(z+=P,c+=f,c<0||c>=t.length)break}const h=Math.min(Math.abs(e),Math.abs(z));e=e<0?0-h:h}{let c=e<0?s:a;for(;c>=0&&c<t.length;){const z=Math.abs(e)-Math.abs(g),h=n[c];S(h!=null,`Previous layout not found for panel index ${c}`);const E=h-z,C=fe({panelConstraints:t,panelIndex:c,size:E});if(!K(h,C)&&(g+=h-C,l[c]=C,g.toPrecision(3).localeCompare(Math.abs(e).toPrecision(3),void 0,{numeric:!0})>=0))break;e<0?c--:c++}}if(Un(i,l))return i;{const f=e<0?a:s,c=n[f];S(c!=null,`Previous layout not found for panel index ${f}`);const z=c+g,h=fe({panelConstraints:t,panelIndex:f,size:z});if(l[f]=h,!K(h,z)){let E=z-h,P=e<0?a:s;for(;P>=0&&P<t.length;){const N=l[P];S(N!=null,`Previous layout not found for panel index ${P}`);const k=N+E,D=fe({panelConstraints:t,panelIndex:P,size:k});if(K(N,D)||(E-=D-N,l[P]=D),K(E,0))break;e>0?P--:P++}}}const w=l.reduce((f,c)=>c+f,0);return K(w,100)?l:i}function qn({layout:e,panelsArray:n,pivotIndices:t}){let r=0,i=100,o=0,l=0;const s=t[0];S(s!=null,"No pivot index found"),n.forEach((f,c)=>{const{constraints:z}=f,{maxSize:h=100,minSize:E=0}=z;c===s?(r=E,i=h):(o+=E,l+=h)});const a=Math.min(i,100-o),g=Math.max(r,100-l),w=e[s];return{valueMax:a,valueMin:g,valueNow:w}}function ye(e,n=document){return Array.from(n.querySelectorAll(`[${H.resizeHandleId}][data-panel-group-id="${e}"]`))}function pn(e,n,t=document){const i=ye(e,t).findIndex(o=>o.getAttribute(H.resizeHandleId)===n);return i??null}function gn(e,n,t){const r=pn(e,n,t);return r!=null?[r,r+1]:[-1,-1]}function hn(e,n=document){var t;if(n instanceof HTMLElement&&(n==null||(t=n.dataset)===null||t===void 0?void 0:t.panelGroupId)==e)return n;const r=n.querySelector(`[data-panel-group][data-panel-group-id="${e}"]`);return r||null}function Ne(e,n=document){const t=n.querySelector(`[${H.resizeHandleId}="${e}"]`);return t||null}function Xn(e,n,t,r=document){var i,o,l,s;const a=Ne(n,r),g=ye(e,r),w=a?g.indexOf(a):-1,f=(i=(o=t[w])===null||o===void 0?void 0:o.id)!==null&&i!==void 0?i:null,c=(l=(s=t[w+1])===null||s===void 0?void 0:s.id)!==null&&l!==void 0?l:null;return[f,c]}function Jn({committedValuesRef:e,eagerValuesRef:n,groupId:t,layout:r,panelDataArray:i,panelGroupElement:o,setLayout:l}){u.useRef({didWarnAboutMissingResizeHandle:!1}),se(()=>{if(!o)return;const s=ye(t,o);for(let a=0;a<i.length-1;a++){const{valueMax:g,valueMin:w,valueNow:f}=qn({layout:r,panelsArray:i,pivotIndices:[a,a+1]}),c=s[a];if(c!=null){const z=i[a];S(z,`No panel data found for index "${a}"`),c.setAttribute("aria-controls",z.id),c.setAttribute("aria-valuemax",""+Math.round(g)),c.setAttribute("aria-valuemin",""+Math.round(w)),c.setAttribute("aria-valuenow",f!=null?""+Math.round(f):"")}}return()=>{s.forEach((a,g)=>{a.removeAttribute("aria-controls"),a.removeAttribute("aria-valuemax"),a.removeAttribute("aria-valuemin"),a.removeAttribute("aria-valuenow")})}},[t,r,i,o]),u.useEffect(()=>{if(!o)return;const s=n.current;S(s,"Eager values not found");const{panelDataArray:a}=s,g=hn(t,o);S(g!=null,`No group found for id "${t}"`);const w=ye(t,o);S(w,`No resize handles found for group id "${t}"`);const f=w.map(c=>{const z=c.getAttribute(H.resizeHandleId);S(z,"Resize handle element has no handle id attribute");const[h,E]=Xn(t,z,a,o);if(h==null||E==null)return()=>{};const C=P=>{if(!P.defaultPrevented)switch(P.key){case"Enter":{P.preventDefault();const N=a.findIndex(k=>k.id===h);if(N>=0){const k=a[N];S(k,`No panel data found for index ${N}`);const D=r[N],{collapsedSize:O=0,collapsible:I,minSize:v=0}=k.constraints;if(D!=null&&I){const V=xe({delta:K(D,O)?v-O:O-D,initialLayout:r,panelConstraints:a.map(B=>B.constraints),pivotIndices:gn(t,z,o),prevLayout:r,trigger:"keyboard"});r!==V&&l(V)}}break}}};return c.addEventListener("keydown",C),()=>{c.removeEventListener("keydown",C)}});return()=>{f.forEach(c=>c())}},[o,e,n,t,r,i,l])}function Xe(e,n){if(e.length!==n.length)return!1;for(let t=0;t<e.length;t++)if(e[t]!==n[t])return!1;return!0}function mn(e,n){const t=e==="horizontal",{x:r,y:i}=Ie(n);return t?r:i}function Yn(e,n,t,r,i){const o=t==="horizontal",l=Ne(n,i);S(l,`No resize handle element found for id "${n}"`);const s=l.getAttribute(H.groupId);S(s,"Resize handle element has no group id attribute");let{initialCursorPosition:a}=r;const g=mn(t,e),w=hn(s,i);S(w,`No group element found for id "${s}"`);const f=w.getBoundingClientRect(),c=o?f.width:f.height;return(g-a)/c*100}function Zn(e,n,t,r,i,o){if(rn(e)){const l=t==="horizontal";let s=0;e.shiftKey?s=100:i!=null?s=i:s=10;let a=0;switch(e.key){case"ArrowDown":a=l?0:s;break;case"ArrowLeft":a=l?-s:0;break;case"ArrowRight":a=l?s:0;break;case"ArrowUp":a=l?0:-s;break;case"End":a=100;break;case"Home":a=-100;break}return a}else return r==null?0:Yn(e,n,t,r,o)}function Qn({panelDataArray:e}){const n=Array(e.length),t=e.map(o=>o.constraints);let r=0,i=100;for(let o=0;o<e.length;o++){const l=t[o];S(l,`Panel constraints not found for index ${o}`);const{defaultSize:s}=l;s!=null&&(r++,n[o]=s,i-=s)}for(let o=0;o<e.length;o++){const l=t[o];S(l,`Panel constraints not found for index ${o}`);const{defaultSize:s}=l;if(s!=null)continue;const a=e.length-r,g=i/a;r++,n[o]=g,i-=g}return n}function ue(e,n,t){n.forEach((r,i)=>{const o=e[i];S(o,`Panel data not found for index ${i}`);const{callbacks:l,constraints:s,id:a}=o,{collapsedSize:g=0,collapsible:w}=s,f=t[a];if(f==null||r!==f){t[a]=r;const{onCollapse:c,onExpand:z,onResize:h}=l;h&&h(r,f),w&&(c||z)&&(z&&(f==null||Z(f,g))&&!Z(r,g)&&z(),c&&(f==null||!Z(f,g))&&Z(r,g)&&c())}})}function be(e,n){if(e.length!==n.length)return!1;for(let t=0;t<e.length;t++)if(e[t]!=n[t])return!1;return!0}function et({defaultSize:e,dragState:n,layout:t,panelData:r,panelIndex:i,precision:o=3}){const l=t[i];let s;return l==null?s=e!=null?e.toPrecision(o):"1":r.length===1?s="1":s=l.toPrecision(o),{flexBasis:0,flexGrow:s,flexShrink:1,overflow:"hidden",pointerEvents:n!==null?"none":void 0}}function nt(e,n=10){let t=null;return(...i)=>{t!==null&&clearTimeout(t),t=setTimeout(()=>{e(...i)},n)}}function Je(e){try{if(typeof localStorage<"u")e.getItem=n=>localStorage.getItem(n),e.setItem=(n,t)=>{localStorage.setItem(n,t)};else throw new Error("localStorage not supported in this environment")}catch(n){console.error(n),e.getItem=()=>null,e.setItem=()=>{}}}function xn(e){return`react-resizable-panels:${e}`}function zn(e){return e.map(n=>{const{constraints:t,id:r,idIsFromProps:i,order:o}=n;return i?r:o?`${o}:${JSON.stringify(t)}`:JSON.stringify(t)}).sort((n,t)=>n.localeCompare(t)).join(",")}function vn(e,n){try{const t=xn(e),r=n.getItem(t);if(r){const i=JSON.parse(r);if(typeof i=="object"&&i!=null)return i}}catch{}return null}function tt(e,n,t){var r,i;const o=(r=vn(e,t))!==null&&r!==void 0?r:{},l=zn(n);return(i=o[l])!==null&&i!==void 0?i:null}function rt(e,n,t,r,i){var o;const l=xn(e),s=zn(n),a=(o=vn(e,i))!==null&&o!==void 0?o:{};a[s]={expandToSizes:Object.fromEntries(t.entries()),layout:r};try{i.setItem(l,JSON.stringify(a))}catch(g){console.error(g)}}function Ye({layout:e,panelConstraints:n}){const t=[...e],r=t.reduce((o,l)=>o+l,0);if(t.length!==n.length)throw Error(`Invalid ${n.length} panel layout: ${t.map(o=>`${o}%`).join(", ")}`);if(!K(r,100)&&t.length>0)for(let o=0;o<n.length;o++){const l=t[o];S(l!=null,`No layout data found for index ${o}`);const s=100/r*l;t[o]=s}let i=0;for(let o=0;o<n.length;o++){const l=t[o];S(l!=null,`No layout data found for index ${o}`);const s=fe({panelConstraints:n,panelIndex:o,size:l});l!=s&&(i+=l-s,t[o]=s)}if(!K(i,0))for(let o=0;o<n.length;o++){const l=t[o];S(l!=null,`No layout data found for index ${o}`);const s=l+i,a=fe({panelConstraints:n,panelIndex:o,size:s});if(l!==a&&(i-=a-l,t[o]=a,K(i,0)))break}return t}const ot=100,ze={getItem:e=>(Je(ze),ze.getItem(e)),setItem:(e,n)=>{Je(ze),ze.setItem(e,n)}},Ze={};function yn({autoSaveId:e=null,children:n,className:t="",direction:r,forwardedRef:i,id:o=null,onLayout:l=null,keyboardResizeBy:s=null,storage:a=ze,style:g,tagName:w="div",...f}){const c=We(o),z=u.useRef(null),[h,E]=u.useState(null),[C,P]=u.useState([]),N=Kn(),k=u.useRef({}),D=u.useRef(new Map),O=u.useRef(0),I=u.useRef({autoSaveId:e,direction:r,dragState:h,id:c,keyboardResizeBy:s,onLayout:l,storage:a}),v=u.useRef({layout:C,panelDataArray:[],panelDataArrayChanged:!1});u.useRef({didLogIdAndOrderWarning:!1,didLogPanelConstraintsWarning:!1,prevPanelIds:[]}),u.useImperativeHandle(i,()=>({getId:()=>I.current.id,getLayout:()=>{const{layout:d}=v.current;return d},setLayout:d=>{const{onLayout:x}=I.current,{layout:b,panelDataArray:m}=v.current,p=Ye({layout:d,panelConstraints:m.map(y=>y.constraints)});Xe(b,p)||(P(p),v.current.layout=p,x&&x(p),ue(m,p,k.current))}}),[]),se(()=>{I.current.autoSaveId=e,I.current.direction=r,I.current.dragState=h,I.current.id=c,I.current.onLayout=l,I.current.storage=a}),Jn({committedValuesRef:I,eagerValuesRef:v,groupId:c,layout:C,panelDataArray:v.current.panelDataArray,setLayout:P,panelGroupElement:z.current}),u.useEffect(()=>{const{panelDataArray:d}=v.current;if(e){if(C.length===0||C.length!==d.length)return;let x=Ze[e];x==null&&(x=nt(rt,ot),Ze[e]=x);const b=[...d],m=new Map(D.current);x(e,b,m,C,a)}},[e,C,a]),u.useEffect(()=>{});const V=u.useCallback(d=>{const{onLayout:x}=I.current,{layout:b,panelDataArray:m}=v.current;if(d.constraints.collapsible){const p=m.map(J=>J.constraints),{collapsedSize:y=0,panelSize:R,pivotIndices:_}=ie(m,d,b);if(S(R!=null,`Panel size not found for panel "${d.id}"`),!Z(R,y)){D.current.set(d.id,R);const Y=de(m,d)===m.length-1?R-y:y-R,M=xe({delta:Y,initialLayout:b,panelConstraints:p,pivotIndices:_,prevLayout:b,trigger:"imperative-api"});be(b,M)||(P(M),v.current.layout=M,x&&x(M),ue(m,M,k.current))}}},[]),B=u.useCallback((d,x)=>{const{onLayout:b}=I.current,{layout:m,panelDataArray:p}=v.current;if(d.constraints.collapsible){const y=p.map(q=>q.constraints),{collapsedSize:R=0,panelSize:_=0,minSize:J=0,pivotIndices:Y}=ie(p,d,m),M=x??J;if(Z(_,R)){const q=D.current.get(d.id),ge=q!=null&&q>=M?q:M,Ae=de(p,d)===p.length-1?_-ge:ge-_,T=xe({delta:Ae,initialLayout:m,panelConstraints:y,pivotIndices:Y,prevLayout:m,trigger:"imperative-api"});be(m,T)||(P(T),v.current.layout=T,b&&b(T),ue(p,T,k.current))}}},[]),F=u.useCallback(d=>{const{layout:x,panelDataArray:b}=v.current,{panelSize:m}=ie(b,d,x);return S(m!=null,`Panel size not found for panel "${d.id}"`),m},[]),W=u.useCallback((d,x)=>{const{panelDataArray:b}=v.current,m=de(b,d);return et({defaultSize:x,dragState:h,layout:C,panelData:b,panelIndex:m})},[h,C]),L=u.useCallback(d=>{const{layout:x,panelDataArray:b}=v.current,{collapsedSize:m=0,collapsible:p,panelSize:y}=ie(b,d,x);return S(y!=null,`Panel size not found for panel "${d.id}"`),p===!0&&Z(y,m)},[]),U=u.useCallback(d=>{const{layout:x,panelDataArray:b}=v.current,{collapsedSize:m=0,collapsible:p,panelSize:y}=ie(b,d,x);return S(y!=null,`Panel size not found for panel "${d.id}"`),!p||ae(y,m)>0},[]),j=u.useCallback(d=>{const{panelDataArray:x}=v.current;x.push(d),x.sort((b,m)=>{const p=b.order,y=m.order;return p==null&&y==null?0:p==null?-1:y==null?1:p-y}),v.current.panelDataArrayChanged=!0,N()},[N]);se(()=>{if(v.current.panelDataArrayChanged){v.current.panelDataArrayChanged=!1;const{autoSaveId:d,onLayout:x,storage:b}=I.current,{layout:m,panelDataArray:p}=v.current;let y=null;if(d){const _=tt(d,p,b);_&&(D.current=new Map(Object.entries(_.expandToSizes)),y=_.layout)}y==null&&(y=Qn({panelDataArray:p}));const R=Ye({layout:y,panelConstraints:p.map(_=>_.constraints)});Xe(m,R)||(P(R),v.current.layout=R,x&&x(R),ue(p,R,k.current))}}),se(()=>{const d=v.current;return()=>{d.layout=[]}},[]);const $=u.useCallback(d=>{let x=!1;const b=z.current;return b&&window.getComputedStyle(b,null).getPropertyValue("direction")==="rtl"&&(x=!0),function(p){p.preventDefault();const y=z.current;if(!y)return()=>null;const{direction:R,dragState:_,id:J,keyboardResizeBy:Y,onLayout:M}=I.current,{layout:q,panelDataArray:ge}=v.current,{initialLayout:Se}=_??{},Ae=gn(J,d,y);let T=Zn(p,d,R,_,Y,y);const Te=R==="horizontal";Te&&x&&(T=-T);const wn=ge.map(Cn=>Cn.constraints),he=xe({delta:T,initialLayout:Se??q,panelConstraints:wn,pivotIndices:Ae,prevLayout:q,trigger:rn(p)?"keyboard":"mouse-or-touch"}),Oe=!be(q,he);(on(p)||ln(p))&&O.current!=T&&(O.current=T,!Oe&&T!==0?Te?Me(d,T<0?an:cn):Me(d,T<0?un:dn):Me(d,0)),Oe&&(P(he),v.current.layout=he,M&&M(he),ue(ge,he,k.current))}},[]),G=u.useCallback((d,x)=>{const{onLayout:b}=I.current,{layout:m,panelDataArray:p}=v.current,y=p.map(q=>q.constraints),{panelSize:R,pivotIndices:_}=ie(p,d,m);S(R!=null,`Panel size not found for panel "${d.id}"`);const Y=de(p,d)===p.length-1?R-x:x-R,M=xe({delta:Y,initialLayout:m,panelConstraints:y,pivotIndices:_,prevLayout:m,trigger:"imperative-api"});be(m,M)||(P(M),v.current.layout=M,b&&b(M),ue(p,M,k.current))},[]),te=u.useCallback((d,x)=>{const{layout:b,panelDataArray:m}=v.current,{collapsedSize:p=0,collapsible:y}=x,{collapsedSize:R=0,collapsible:_,maxSize:J=100,minSize:Y=0}=d.constraints,{panelSize:M}=ie(m,d,b);M!=null&&(y&&_&&Z(M,p)?Z(p,R)||G(d,R):M<Y?G(d,Y):M>J&&G(d,J))},[G]),ce=u.useCallback((d,x)=>{const{direction:b}=I.current,{layout:m}=v.current;if(!z.current)return;const p=Ne(d,z.current);S(p,`Drag handle element not found for id "${d}"`);const y=mn(b,x);E({dragHandleId:d,dragHandleRect:p.getBoundingClientRect(),initialCursorPosition:y,initialLayout:m})},[]),re=u.useCallback(()=>{E(null)},[]),oe=u.useCallback(d=>{const{panelDataArray:x}=v.current,b=de(x,d);b>=0&&(x.splice(b,1),delete k.current[d.id],v.current.panelDataArrayChanged=!0,N())},[N]),Q=u.useMemo(()=>({collapsePanel:V,direction:r,dragState:h,expandPanel:B,getPanelSize:F,getPanelStyle:W,groupId:c,isPanelCollapsed:L,isPanelExpanded:U,reevaluatePanelConstraints:te,registerPanel:j,registerResizeHandle:$,resizePanel:G,startDragging:ce,stopDragging:re,unregisterPanel:oe,panelGroupElement:z.current}),[V,h,r,B,F,W,c,L,U,te,j,$,G,ce,re,oe]),ee={display:"flex",flexDirection:r==="horizontal"?"row":"column",height:"100%",overflow:"hidden",width:"100%"};return u.createElement(Ee.Provider,{value:Q},u.createElement(w,{...f,children:n,className:t,id:o,ref:z,style:{...ee,...g},[H.group]:"",[H.groupDirection]:r,[H.groupId]:c}))}const Sn=u.forwardRef((e,n)=>u.createElement(yn,{...e,forwardedRef:n}));yn.displayName="PanelGroup";Sn.displayName="forwardRef(PanelGroup)";function de(e,n){return e.findIndex(t=>t===n||t.id===n.id)}function ie(e,n,t){const r=de(e,n),o=r===e.length-1?[r-1,r]:[r,r+1],l=t[r];return{...n.constraints,panelSize:l,pivotIndices:o}}function it({disabled:e,handleId:n,resizeHandler:t,panelGroupElement:r}){u.useEffect(()=>{if(e||t==null||r==null)return;const i=Ne(n,r);if(i==null)return;const o=l=>{if(!l.defaultPrevented)switch(l.key){case"ArrowDown":case"ArrowLeft":case"ArrowRight":case"ArrowUp":case"End":case"Home":{l.preventDefault(),t(l);break}case"F6":{l.preventDefault();const s=i.getAttribute(H.groupId);S(s,`No group element found for id "${s}"`);const a=ye(s,r),g=pn(s,n,r);S(g!==null,`No resize element found for id "${n}"`);const w=l.shiftKey?g>0?g-1:a.length-1:g+1<a.length?g+1:0;a[w].focus();break}}};return i.addEventListener("keydown",o),()=>{i.removeEventListener("keydown",o)}},[r,e,n,t])}function bn({children:e=null,className:n="",disabled:t=!1,hitAreaMargins:r,id:i,onBlur:o,onClick:l,onDragging:s,onFocus:a,onPointerDown:g,onPointerUp:w,style:f={},tabIndex:c=0,tagName:z="div",...h}){var E,C;const P=u.useRef(null),N=u.useRef({onClick:l,onDragging:s,onPointerDown:g,onPointerUp:w});u.useEffect(()=>{N.current.onClick=l,N.current.onDragging=s,N.current.onPointerDown=g,N.current.onPointerUp=w});const k=u.useContext(Ee);if(k===null)throw Error("PanelResizeHandle components must be rendered within a PanelGroup container");const{direction:D,groupId:O,registerResizeHandle:I,startDragging:v,stopDragging:V,panelGroupElement:B}=k,F=We(i),[W,L]=u.useState("inactive"),[U,j]=u.useState(!1),[$,G]=u.useState(null),te=u.useRef({state:W});se(()=>{te.current.state=W}),u.useEffect(()=>{if(t)G(null);else{const Q=I(F);G(()=>Q)}},[t,F,I]);const ce=(E=r?.coarse)!==null&&E!==void 0?E:15,re=(C=r?.fine)!==null&&C!==void 0?C:5;u.useEffect(()=>{if(t||$==null)return;const Q=P.current;S(Q,"Element ref not attached");let ee=!1;return On(F,Q,D,{coarse:ce,fine:re},(x,b,m)=>{if(!b){L("inactive");return}switch(x){case"down":{L("drag"),ee=!1,S(m,'Expected event to be defined for "down" action'),v(F,m);const{onDragging:p,onPointerDown:y}=N.current;p?.(!0),y?.();break}case"move":{const{state:p}=te.current;ee=!0,p!=="drag"&&L("hover"),S(m,'Expected event to be defined for "move" action'),$(m);break}case"up":{L("hover"),V();const{onClick:p,onDragging:y,onPointerUp:R}=N.current;y?.(!1),R?.(),ee||p?.();break}}})},[ce,D,t,re,I,F,$,v,V]),it({disabled:t,handleId:F,resizeHandler:$,panelGroupElement:B});const oe={touchAction:"none",userSelect:"none"};return u.createElement(z,{...h,children:e,className:n,id:i,onBlur:()=>{j(!1),o?.()},onFocus:()=>{j(!0),a?.()},ref:P,role:"separator",style:{...oe,...f},tabIndex:c,[H.groupDirection]:D,[H.groupId]:O,[H.resizeHandle]:"",[H.resizeHandleActive]:W==="drag"?"pointer":U?"keyboard":void 0,[H.resizeHandleEnabled]:!t,[H.resizeHandleId]:F,[H.resizeHandleState]:W})}bn.displayName="PanelResizeHandle";function Qe({className:e,...n}){return A.jsx(Sn,{className:en("flex h-full w-full data-[panel-group-direction=vertical]:flex-col",e),...n})}const me=tn;function $e({className:e,...n}){return A.jsx(bn,{className:en("relative w-px shrink-0 bg-line transition-colors cursor-col-resize","after:absolute after:inset-y-0 after:left-1/2 after:w-1.5 after:-translate-x-1/2","data-[resize-handle-state=hover]:bg-line-strong","data-[resize-handle-state=drag]:bg-accent","focus-visible:outline-none focus-visible:bg-accent",e),...n})}function lt({className:e,children:n}){const t=u.useRef(null),[r,i]=u.useState(null);return u.useEffect(()=>{const o=t.current?.parentElement;if(!o||typeof ResizeObserver>"u")return;const l=()=>{const a=Math.floor(o.getBoundingClientRect().width);i(g=>g===a?g:a)};l();const s=new ResizeObserver(l);return s.observe(o),()=>s.disconnect()},[]),A.jsx("div",{ref:t,className:e,style:r===null?void 0:{width:`${r}px`},children:n})}const Pn=u.createContext(null);function st(e,n){return e==="list"?{size:62,max:78}:e==="detail"?{size:26,max:45}:{size:n==="compact"?43:33,max:58}}function ft(){return u.useContext(Pn)}function pt({nav:e,list:n,reading:t,intelligence:r,intelligenceOpen:i=!0,hasThread:o=!0,density:l="comfortable",listBias:s="balanced",header:a,topBar:g,appBar:w,overlay:f,skeleton:c,isLoading:z=!1,initialWidth:h,navOpen:E,onOpenNav:C,onCloseNav:P}){const[N,k]=kn(h),D=Ln(k??0),[O,I]=u.useState(!1),v=D.nav,V=v&&!O,B=D.reading&&!!t,F=D.intelligence,[W,L]=u.useState(!1),U=E!==void 0,j=U?E:W,$=()=>{U||L(!0),C?.()},G=()=>{U||L(!1),P?.()},te=F&&i&&o&&!!r,re={panes:D,containerWidth:k,showNavPane:v,openNav:$,navCollapsed:O,toggleNav:()=>{if(!v){j?G():$();return}I(d=>!d)},showReadingPane:B,showIntelligencePane:F},oe=st(s,l),Q=A.jsxs(Qe,{direction:"horizontal",className:"min-h-0 flex-1",children:[A.jsx(me,{id:"list",order:1,defaultSize:B?oe.size:100,minSize:22,maxSize:B?oe.max:100,className:"min-w-0",children:n}),B&&A.jsxs(A.Fragment,{children:[A.jsx($e,{}),A.jsx(me,{id:"reading",order:2,minSize:29,className:"min-w-0",children:A.jsx(lt,{className:"h-full",children:t})})]}),te&&A.jsxs(A.Fragment,{children:[A.jsx($e,{}),A.jsx(me,{id:"intelligence",order:3,defaultSize:25,minSize:18,maxSize:39,className:"min-w-0",children:r})]})]},B?"list-reading":"list-only"),ee=A.jsxs("div",{className:"flex min-h-0 min-w-0 flex-1 flex-col",children:[!v&&a&&A.jsx("div",{className:"shrink-0",children:a}),Q]});return A.jsx(Pn.Provider,{value:re,children:A.jsxs("div",{ref:N,className:"safe-area-frame @container flex h-full w-full flex-col overflow-hidden bg-canvas font-sans text-fg",children:[A.jsx(Rn,{topBar:g,appBar:w,children:z&&c?c:V?A.jsxs(Qe,{direction:"horizontal",className:"min-h-0 flex-1",children:[A.jsx(me,{id:"nav",order:1,defaultSize:17,minSize:12,maxSize:24,className:"min-w-0",children:e}),A.jsx($e,{}),A.jsx(me,{id:"content",order:2,className:"flex min-w-0 flex-col",children:ee})]}):ee}),!(z&&c)&&A.jsxs(A.Fragment,{children:[!v&&A.jsx(In,{open:j,onClose:G,title:"Folders",anchor:"left",children:e}),f]})]})})}const _e="search-scope";function at(e){const n=e.trim().replace(/\s+/g," ").toLowerCase();return/\s/.test(n)?`in:"${n}"`:`in:${n}`}function gt(e){return e.list!==void 0&&e.list!=="brief"}function ht(e){return e.list==="mailbox"?e.mailboxId:void 0}function mt(e,n){return e.list==="flagged"?{kind:"scoped",chip:{id:_e,label:"is:starred"}}:e.list==="outbox"?{kind:"scoped",chip:{id:_e,label:"in:outbox"}}:e.list==="mailbox"?n?{kind:"scoped",chip:{id:_e,label:at(n)}}:{kind:"pending"}:{kind:"global"}}function xt(e,n,t){return n.kind==="global"?{kind:"global"}:e.list==="flagged"?{kind:"collection"}:{kind:"folder",...t?{role:t}:{}}}export{pt as A,_e as S,xt as a,gt as i,dt as k,ht as r,mt as s,ft as u};
@@ -1 +1 @@
1
- import{b as Q,r as l,j as d,p as y,X as R,bX as X,cm as L,cz as J,cA as Y,cB as W,cC as Z,G as k,u as j,R as ee,U as M,W as te,Y as ne,J as oe,cD as E}from"./index-BnBpXn45.js";import{e as I,f as re}from"./reply-CzX8Q1T1.js";import{c as se}from"./nav-link-CjSE3MDU.js";import{s as ae,S as ie}from"./search-scope-fyP_uHeh.js";import{u as K}from"./useQueries-BomGTQs-.js";const q={name:"bell-off",size:24,node:[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M17 17H4a1 1 0 0 1-.74-1.673C4.59 13.956 6 12.499 6 8a6 6 0 0 1 .258-1.742",key:"178tsu"}],["path",{d:"m2 2 20 20",key:"1ooewy"}],["path",{d:"M8.668 3.01A6 6 0 0 1 18 8c0 2.687.77 4.653 1.707 6.05",key:"1hqiys"}]]};q.node;const ve=Q(q),ce=[{action:"focusNext",keys:["j","k"],label:"navigate"},{action:"muteSender",keys:["m"],label:"mute"},{action:"help",keys:["?"],label:"all shortcuts"}];function Te(e){return ce.filter(t=>e[t.action]!==void 0)}const le=[{title:"Navigation",hints:[{action:"focusNext",keys:["j"],description:"Focus the message below"},{action:"focusPrevious",keys:["k"],description:"Focus the message above"},{action:"focusNext",keys:["↓"],description:"Focus the message below"},{action:"focusPrevious",keys:["↑"],description:"Focus the message above"},{action:"focusFirst",keys:["Home"],description:"Focus first"},{action:"focusLast",keys:["End"],description:"Focus last"},{action:"openFocused",keys:["Enter"],description:"Open focused thread"},{action:"back",keys:["Esc"],description:"Back / close overlay"}]},{title:"Selection",hints:[{action:"toggleSelect",keys:["x"],description:"Toggle select"},{action:"toggleSelect",keys:["Space"],description:"Toggle select"},{action:"extendSelectDown",keys:["Shift","j"],description:"Extend selection down"},{action:"extendSelectUp",keys:["Shift","k"],description:"Extend selection up"},{action:"extendSelectDown",keys:["Shift","↓"],description:"Extend selection down"},{action:"extendSelectUp",keys:["Shift","↑"],description:"Extend selection up"},{action:"selectAll",keys:["⌘","A"],description:"Select all"}]},{title:"Actions",hints:[{action:"reply",keys:["r"],description:"Reply"},{action:"replyAll",keys:["a"],description:"Reply all"},{action:"forward",keys:["f"],description:"Forward"},{action:"delete",keys:["#"],description:"Delete"},{action:"toggleStar",keys:["s"],description:"Star / unstar"},{action:"toggleRead",keys:["u"],description:"Toggle read / unread"}]},{title:"Sender",hints:[{action:"muteSender",keys:["m"],description:"Mute sender"},{action:"blockSender",keys:["b"],description:"Block sender"},{action:"vipSender",keys:["v"],description:"VIP sender"},{action:"markJunk",keys:["!"],description:"Mark junk"}]},{title:"Go to",hints:[{action:"goBrief",keys:["g","b"],description:"Daily brief"},{action:"goInbox",keys:["g","i"],description:"Inbox"},{action:"goSent",keys:["g","s"],description:"Sent"},{action:"goFlagged",keys:["g","f"],description:"Starred"},{action:"goSettings",keys:["g",","],description:"Settings"}]},{title:"View & global",hints:[{action:"toggleIntelligence",keys:["i"],description:"Toggle intelligence"},{action:"toggleDensity",keys:["d"],description:"Toggle density"},{action:"focusSearch",keys:["/"],description:"Focus search"},{action:"compose",keys:["c"],description:"Compose"},{action:"compose",keys:["⌘","N"],description:"Compose"},{action:"help",keys:["?"],description:"Shortcut help"}]}];function ue(e){for(const t of le){const n=t.hints.find(o=>o.action===e);if(n)return n.keys}}function de(e){const t=ue(e);return!t||t.length===0?"":t.length===1?t[0]??"":t[0]==="g"?t.join(" then "):t.join("")}function Ne(e){const t=de(e);return t===""?"":`(${t})`}function fe({key:e,shiftKey:t=!1,repeat:n=!1,caretAtStart:o,hasValue:i,chipCount:r}){const a=r-1;return e==="Escape"?i?{type:"clearQuery"}:{type:"blur"}:e==="Tab"&&t?r===0?{type:"none"}:{type:"focusChip",index:a}:e==="Backspace"||e==="ArrowLeft"?!o||r===0?{type:"none"}:n?{type:"none"}:{type:"focusChip",index:a}:{type:"none"}}function pe({key:e,repeat:t=!1,index:n,chipCount:o}){return e==="Backspace"||e==="Delete"?t?{type:"none"}:{type:"removeChip",index:n}:e==="ArrowLeft"?n===0?{type:"none"}:{type:"focusChip",index:n-1}:e==="ArrowRight"?n>=o-1?{type:"focusInput"}:{type:"focusChip",index:n+1}:e==="Enter"||e===" "?{type:"activateChip",index:n}:e==="Escape"?{type:"focusInput"}:{type:"none"}}function me(e,t){const n=t-1;return n<=0?null:e<n?e:n-1}const B={filter:"border-line bg-surface-sunken text-fg-muted",scope:"border-accent-2/40 bg-accent-2-soft text-accent-2"},he=({label:e,onRemove:t,tone:n="filter",className:o})=>d.jsxs("span",{className:y("inline-flex items-center gap-1 rounded-full border px-2 py-0.5 text-2xs",B[n],o),children:[d.jsx("span",{children:e}),d.jsx("button",{type:"button",onClick:t,className:"shrink-0 rounded-full p-0.5 hover:bg-fg-muted/20 transition-colors","aria-label":`Remove filter: ${e}`,children:d.jsx(R,{className:"size-3"})})]}),O=l.forwardRef(({label:e,onRemove:t,onActivate:n,tone:o="filter",focused:i=!1,onKeyDown:r,onFocusLabel:a,className:u},f)=>d.jsxs("span",{role:"row",tabIndex:-1,className:y("inline-flex max-w-48 items-center gap-1 rounded-full border px-2 py-0.5 text-2xs transition-colors",B[o],i&&"ring-2 ring-ring",u),children:[d.jsx("button",{ref:f,type:"button",role:"gridcell",tabIndex:i?0:-1,onClick:n,onFocus:a,onKeyDown:r,className:y("block min-w-0 max-w-full truncate rounded-full outline-none",n?"cursor-pointer":"cursor-default"),children:e}),d.jsx("button",{type:"button",role:"gridcell",tabIndex:-1,onClick:t,className:"block shrink-0 rounded-full p-0.5 transition-colors hover:bg-fg-muted/20","aria-label":`Remove filter: ${e}`,children:d.jsx(R,{className:"size-3"})})]}));O.displayName="SearchChipRow";const Ee=({tokens:e,className:t})=>e.length===0?null:d.jsx("div",{className:y("flex flex-wrap items-center gap-1.5 border-b border-line bg-surface px-row-inset py-1.5",t),children:e.map(n=>d.jsx(he,{label:n.label,onRemove:n.onRemove},n.label))}),ge=e=>e instanceof HTMLElement?e.tagName==="INPUT"||e.tagName==="TEXTAREA"||e.isContentEditable:!1,be=({chips:e=[],onRemoveChip:t,value:n,onChange:o,onClear:i,onClearQuery:r,placeholder:a="Search mail...",globalFocusKey:u=!0,showClearButton:f=!0,size:h="sm",inputId:p,suggest:m,className:x})=>{const H=l.useId(),F=p??H,C=l.useRef(null),$=l.useRef([]),A=r??i,[P,w]=l.useState(null),v=l.useRef(void 0),[U,_]=l.useState(""),T=e.length>0;l.useEffect(()=>{w(s=>s!==null&&s>=e.length?null:s)},[e.length]),l.useEffect(()=>{const s=v.current;if(s!==void 0){if(v.current=void 0,s===null){C.current?.focus();return}$.current[s]?.focus()}});const D=l.useRef(void 0);l.useEffect(()=>{const s=m?.caret;if(!s||s===D.current)return;D.current=s;const c=C.current;!c||c.ownerDocument.activeElement!==c||(c.setSelectionRange(s.cursor,s.cursor),m?.onCaretChange(s.cursor))});const S=s=>{m?.onCaretChange(s.selectionStart??s.value.length)},g=l.useCallback(s=>{w(s),v.current=s},[]),N=l.useCallback(s=>{const c=e[s];c&&t&&(g(me(s,e.length)),_(`${c.label} removed`),t(c.id))},[e,t,g]),z=l.useCallback(()=>{g(null),i()},[i,g]),V=l.useCallback(s=>{const c=s.currentTarget;if(m?.onKeyDown(s))return;const b=fe({key:s.key,shiftKey:s.shiftKey,repeat:s.repeat,caretAtStart:c.selectionStart===0&&c.selectionEnd===0,hasValue:n.length>0,chipCount:e.length});switch(b.type){case"focusChip":s.preventDefault(),g(b.index);return;case"clearQuery":A();return;case"blur":c.blur();return;case"none":return}},[e.length,n,A,g,m]),G=l.useCallback(s=>c=>{const b=pe({key:c.key,repeat:c.repeat,index:s,chipCount:e.length});switch(b.type!=="none"&&c.preventDefault(),b.type){case"removeChip":N(b.index);return;case"focusChip":g(b.index);return;case"focusInput":g(null);return;case"activateChip":return;case"none":return}},[e,N,g]);return l.useEffect(()=>{if(!u)return;const s=c=>{c.key!=="/"||c.metaKey||c.ctrlKey||c.altKey||ge(c.target)||L("focusSearch")||(c.preventDefault(),C.current?.focus())};return window.addEventListener("keydown",s),()=>window.removeEventListener("keydown",s)},[u]),d.jsxs("label",{htmlFor:F,className:y("flex w-full items-center gap-1.5 text-sm","bg-surface-sunken/50 border border-transparent","focus-within:bg-canvas focus-within:border-line focus-within:ring-2 focus-within:ring-ring","transition-colors",h==="lg"?"rounded-xl px-4 py-2":"rounded-md px-2.5 py-1",x),children:[d.jsx(X,{className:y("shrink-0 text-fg-muted pointer-events-none",h==="lg"?"size-5":"size-4")}),d.jsxs("div",{className:"flex min-w-0 flex-1 flex-wrap items-center gap-1",children:[T&&d.jsx("div",{role:"grid","aria-label":"Search filters",className:"flex min-w-0 flex-wrap items-center gap-1",children:e.map((s,c)=>d.jsx(O,{ref:b=>{$.current[c]=b},label:s.label,tone:s.tone,focused:P===c,onFocusLabel:()=>w(c),onKeyDown:G(c),onRemove:()=>N(c)},s.id))}),d.jsx("input",{ref:C,id:F,name:"q",type:"text","aria-label":"Search mail",autoComplete:"off",value:n,tabIndex:P===null?0:-1,onChange:s=>{o(s.target.value),S(s.target)},onKeyDown:V,onKeyUp:s=>S(s.currentTarget),onClick:s=>S(s.currentTarget),onFocus:s=>{w(null),m?.onFocusChange?.(!0),S(s.currentTarget)},onBlur:()=>m?.onFocusChange?.(!1),...m?.comboboxProps,placeholder:T?void 0:a,className:"min-w-24 flex-1 bg-transparent text-fg outline-none placeholder:text-fg-muted"})]}),(n||T)&&f&&d.jsx("button",{type:"button",onClick:z,className:"shrink-0 rounded p-0.5 hover:bg-surface-raised transition-colors","aria-label":"Clear search",children:d.jsx(R,{className:y("text-fg-muted",h==="lg"?"size-5":"size-4")})}),d.jsx("span",{role:"status","aria-live":"polite",className:"sr-only",children:U})]})},Re=({value:e,onChange:t,onClear:n,onClearQuery:o,chips:i,onRemoveChip:r,placeholder:a="Search mail...",globalFocusKey:u=!0,showClearButton:f=!0,size:h,inputId:p,suggest:m,className:x})=>d.jsx(be,{value:e,onChange:t,onClear:n,onClearQuery:o,chips:i,onRemoveChip:r,placeholder:a,globalFocusKey:u,showClearButton:f,size:h,inputId:p,suggest:m,className:x});function je({handlers:e,enabled:t=!0,target:n,sequenceTimeoutMs:o=1e3}){const i=l.useRef(e);i.current=e;const r=l.useRef(null),a=l.useRef(null);l.useEffect(()=>{if(!t)return;const u=()=>{a.current!==null&&(clearTimeout(a.current),a.current=null)},f=p=>{const m=J({key:p.key,shiftKey:p.shiftKey,metaKey:p.metaKey,ctrlKey:p.ctrlKey,altKey:p.altKey,inEditable:W(p.target),onControl:Y(p.target)},r.current);if(Z().length>0){u(),r.current=null;return}if(u(),r.current=m.nextPrefix,m.nextPrefix!==null&&(a.current=setTimeout(()=>{r.current=null,a.current=null},o)),m.action===null||L(m.action)!==null)return;const x=i.current[m.action];x&&(m.preventDefault&&p.preventDefault(),x())},h=n===void 0?window:n;if(h!==null)return h.addEventListener("keydown",f),()=>{h.removeEventListener("keydown",f),u(),r.current=null}},[t,o,n])}function Me(){const e=k({from:"/mail/brief/$threadId",shouldThrow:!1}),t=k({from:"/mail/brief/$threadId/$messageId",shouldThrow:!1}),n=k({from:"/mail/flagged/$threadId",shouldThrow:!1}),o=k({from:"/mail/flagged/$threadId/$messageId",shouldThrow:!1}),i=k({from:"/mail/$mailboxId/$threadId",shouldThrow:!1}),r=k({from:"/mail/$mailboxId/$threadId/$messageId",shouldThrow:!1}),a=e?.threadId??n?.threadId??i?.threadId,u=t?.messageId??o?.messageId??r?.messageId;return l.useMemo(()=>a?{threadId:a,messageId:u}:void 0,[a,u])}function Ke(){const e=j(),t=se(),{list:n,mailboxId:o}=I();return l.useCallback((i,r)=>{const a=r?.query,f={search:p=>a===void 0?p:{...p,q:a||void 0},hash:t,replace:r?.replace??!1};if(n==="flagged"){e({to:"/mail/flagged/$threadId/$messageId",params:i,...f});return}const h=r?.mailboxId??o;if(n==="mailbox"&&h){e({to:"/mail/$mailboxId/$threadId/$messageId",params:{mailboxId:h,...i},...f});return}e({to:"/mail/brief/$threadId/$messageId",params:i,...f})},[e,t,n,o])}function Fe(){return re()}function ye(){const e=j();return l.useCallback(t=>{e({to:"/mail/brief",search:{q:t||void 0}})},[e])}function $e(){const e=j();return l.useCallback((t,n)=>{e({to:"/mail/$mailboxId",params:{mailboxId:t},search:{q:n||void 0}})},[e])}const xe=({accounts:e})=>{const{list:t,mailboxId:n}=I(),{t:o}=ee("mail",{useSuspense:!1}),i=l.useCallback((a,u)=>o(a,{defaultValue:u}),[o]),r=K({queries:e.map(a=>({...M({path:{accountId:a.accountId}}),staleTime:1/0}))});if(t==="outbox")return"Outbox";if(!n)return null;for(let a=0;a<e.length;a++){const u=r[a]?.data?.items;if(!u)continue;const f=u.find(p=>p.mailboxId===n);if(!f)continue;const h=te(e[a].folderAppointments);return ne(f,h.get(n),i)}return null},Ae=({accounts:e})=>{const{mailboxId:t}=I(),n=K({queries:e.map(o=>({...M({path:{accountId:o.accountId}}),staleTime:1/0}))});if(!t)return null;for(const o of n){const i=o.data?.items;if(!i)continue;const r=i.find(a=>a.mailboxId===t);if(r)return r.unseenCount}return null},Pe=({accounts:e})=>{const{mailboxId:t}=I(),n=K({queries:e.map(o=>({...M({path:{accountId:o.accountId}}),staleTime:1/0}))});if(!t)return 0;for(const o of n){const i=o.data?.items;if(!i)continue;const r=i.find(a=>a.mailboxId===t);if(r)return r.messageCount}return 0};function De(e){const t=ye(),{searchInput:n}=oe(),o=xe({accounts:e}),i=I(),r=l.useMemo(()=>ae(i,o),[i,o]),a=l.useCallback(u=>{u===ie&&t(n)},[t,n]);return{scope:r,clearScope:a}}function Le(e){const t=new Map;for(const n of e){const o=n.email.toLowerCase(),i=o.split("@")[0];i&&!t.has(i)&&t.set(i,n.accountId),t.has(o)||t.set(o,n.accountId)}return t}function qe(e){const t=new Map;for(const n of e)for(const o of n){const i=o.fullPath?.toLowerCase();if(!i)continue;const r=E(o).toLowerCase();t.has(i)||t.set(i,o.mailboxId),t.has(r)||t.set(r,o.mailboxId)}return t}function Be(e,t=[]){const n=e.flat().filter(r=>r.fullPath),o=new Map;for(const r of n){const a=E(r).toLowerCase();o.set(a,(o.get(a)??0)+1)}const i=new Map(t.map(r=>[r.accountId,r.email]));return n.map(r=>{const a=E(r),u=o.get(a.toLowerCase())===1,f=t.length>1?i.get(r.accountId):void 0;return{value:u?a:r.fullPath,label:r.displayNameOverride?.trim()||a,...f?{hint:f}:{}}})}function Oe(e){const t=new Map;for(const n of e){const o=n.email.toLowerCase().split("@")[0]??"";t.set(o,(t.get(o)??0)+1)}return e.map(n=>{const o=n.email.split("@")[0]??n.email,i=t.get(o.toLowerCase())===1,r=n.displayName?.trim();return{value:i?o:n.email,label:r||n.email,...r?{hint:n.email}:{}}})}export{ve as B,le as K,Re as S,Me as a,qe as b,je as c,Le as d,Ke as e,Fe as f,xe as g,Ae as h,Pe as i,ce as j,Te as k,Ee as l,Be as m,Oe as n,$e as o,de as s,Ne as t,De as u};
1
+ import{b as Q,r as l,j as d,p as y,X as R,bX as X,cm as L,cz as J,cA as Y,cB as W,cC as Z,G as k,u as j,R as ee,U as M,W as te,Y as ne,J as oe,cD as E}from"./index-CmOAOx38.js";import{e as I,f as re}from"./reply-BBXEHuds.js";import{c as se}from"./nav-link-Bdv8kjEd.js";import{s as ae,S as ie}from"./search-scope-BCz9qlCH.js";import{u as K}from"./useQueries-DeYJYa06.js";const q={name:"bell-off",size:24,node:[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M17 17H4a1 1 0 0 1-.74-1.673C4.59 13.956 6 12.499 6 8a6 6 0 0 1 .258-1.742",key:"178tsu"}],["path",{d:"m2 2 20 20",key:"1ooewy"}],["path",{d:"M8.668 3.01A6 6 0 0 1 18 8c0 2.687.77 4.653 1.707 6.05",key:"1hqiys"}]]};q.node;const ve=Q(q),ce=[{action:"focusNext",keys:["j","k"],label:"navigate"},{action:"muteSender",keys:["m"],label:"mute"},{action:"help",keys:["?"],label:"all shortcuts"}];function Te(e){return ce.filter(t=>e[t.action]!==void 0)}const le=[{title:"Navigation",hints:[{action:"focusNext",keys:["j"],description:"Focus the message below"},{action:"focusPrevious",keys:["k"],description:"Focus the message above"},{action:"focusNext",keys:["↓"],description:"Focus the message below"},{action:"focusPrevious",keys:["↑"],description:"Focus the message above"},{action:"focusFirst",keys:["Home"],description:"Focus first"},{action:"focusLast",keys:["End"],description:"Focus last"},{action:"openFocused",keys:["Enter"],description:"Open focused thread"},{action:"back",keys:["Esc"],description:"Back / close overlay"}]},{title:"Selection",hints:[{action:"toggleSelect",keys:["x"],description:"Toggle select"},{action:"toggleSelect",keys:["Space"],description:"Toggle select"},{action:"extendSelectDown",keys:["Shift","j"],description:"Extend selection down"},{action:"extendSelectUp",keys:["Shift","k"],description:"Extend selection up"},{action:"extendSelectDown",keys:["Shift","↓"],description:"Extend selection down"},{action:"extendSelectUp",keys:["Shift","↑"],description:"Extend selection up"},{action:"selectAll",keys:["⌘","A"],description:"Select all"}]},{title:"Actions",hints:[{action:"reply",keys:["r"],description:"Reply"},{action:"replyAll",keys:["a"],description:"Reply all"},{action:"forward",keys:["f"],description:"Forward"},{action:"delete",keys:["#"],description:"Delete"},{action:"toggleStar",keys:["s"],description:"Star / unstar"},{action:"toggleRead",keys:["u"],description:"Toggle read / unread"}]},{title:"Sender",hints:[{action:"muteSender",keys:["m"],description:"Mute sender"},{action:"blockSender",keys:["b"],description:"Block sender"},{action:"vipSender",keys:["v"],description:"VIP sender"},{action:"markJunk",keys:["!"],description:"Mark junk"}]},{title:"Go to",hints:[{action:"goBrief",keys:["g","b"],description:"Daily brief"},{action:"goInbox",keys:["g","i"],description:"Inbox"},{action:"goSent",keys:["g","s"],description:"Sent"},{action:"goFlagged",keys:["g","f"],description:"Starred"},{action:"goSettings",keys:["g",","],description:"Settings"}]},{title:"View & global",hints:[{action:"toggleIntelligence",keys:["i"],description:"Toggle intelligence"},{action:"toggleDensity",keys:["d"],description:"Toggle density"},{action:"focusSearch",keys:["/"],description:"Focus search"},{action:"compose",keys:["c"],description:"Compose"},{action:"compose",keys:["⌘","N"],description:"Compose"},{action:"help",keys:["?"],description:"Shortcut help"}]}];function ue(e){for(const t of le){const n=t.hints.find(o=>o.action===e);if(n)return n.keys}}function de(e){const t=ue(e);return!t||t.length===0?"":t.length===1?t[0]??"":t[0]==="g"?t.join(" then "):t.join("")}function Ne(e){const t=de(e);return t===""?"":`(${t})`}function fe({key:e,shiftKey:t=!1,repeat:n=!1,caretAtStart:o,hasValue:i,chipCount:r}){const a=r-1;return e==="Escape"?i?{type:"clearQuery"}:{type:"blur"}:e==="Tab"&&t?r===0?{type:"none"}:{type:"focusChip",index:a}:e==="Backspace"||e==="ArrowLeft"?!o||r===0?{type:"none"}:n?{type:"none"}:{type:"focusChip",index:a}:{type:"none"}}function pe({key:e,repeat:t=!1,index:n,chipCount:o}){return e==="Backspace"||e==="Delete"?t?{type:"none"}:{type:"removeChip",index:n}:e==="ArrowLeft"?n===0?{type:"none"}:{type:"focusChip",index:n-1}:e==="ArrowRight"?n>=o-1?{type:"focusInput"}:{type:"focusChip",index:n+1}:e==="Enter"||e===" "?{type:"activateChip",index:n}:e==="Escape"?{type:"focusInput"}:{type:"none"}}function me(e,t){const n=t-1;return n<=0?null:e<n?e:n-1}const B={filter:"border-line bg-surface-sunken text-fg-muted",scope:"border-accent-2/40 bg-accent-2-soft text-accent-2"},he=({label:e,onRemove:t,tone:n="filter",className:o})=>d.jsxs("span",{className:y("inline-flex items-center gap-1 rounded-full border px-2 py-0.5 text-2xs",B[n],o),children:[d.jsx("span",{children:e}),d.jsx("button",{type:"button",onClick:t,className:"shrink-0 rounded-full p-0.5 hover:bg-fg-muted/20 transition-colors","aria-label":`Remove filter: ${e}`,children:d.jsx(R,{className:"size-3"})})]}),O=l.forwardRef(({label:e,onRemove:t,onActivate:n,tone:o="filter",focused:i=!1,onKeyDown:r,onFocusLabel:a,className:u},f)=>d.jsxs("span",{role:"row",tabIndex:-1,className:y("inline-flex max-w-48 items-center gap-1 rounded-full border px-2 py-0.5 text-2xs transition-colors",B[o],i&&"ring-2 ring-ring",u),children:[d.jsx("button",{ref:f,type:"button",role:"gridcell",tabIndex:i?0:-1,onClick:n,onFocus:a,onKeyDown:r,className:y("block min-w-0 max-w-full truncate rounded-full outline-none",n?"cursor-pointer":"cursor-default"),children:e}),d.jsx("button",{type:"button",role:"gridcell",tabIndex:-1,onClick:t,className:"block shrink-0 rounded-full p-0.5 transition-colors hover:bg-fg-muted/20","aria-label":`Remove filter: ${e}`,children:d.jsx(R,{className:"size-3"})})]}));O.displayName="SearchChipRow";const Ee=({tokens:e,className:t})=>e.length===0?null:d.jsx("div",{className:y("flex flex-wrap items-center gap-1.5 border-b border-line bg-surface px-row-inset py-1.5",t),children:e.map(n=>d.jsx(he,{label:n.label,onRemove:n.onRemove},n.label))}),ge=e=>e instanceof HTMLElement?e.tagName==="INPUT"||e.tagName==="TEXTAREA"||e.isContentEditable:!1,be=({chips:e=[],onRemoveChip:t,value:n,onChange:o,onClear:i,onClearQuery:r,placeholder:a="Search mail...",globalFocusKey:u=!0,showClearButton:f=!0,size:h="sm",inputId:p,suggest:m,className:x})=>{const H=l.useId(),F=p??H,C=l.useRef(null),$=l.useRef([]),A=r??i,[P,w]=l.useState(null),v=l.useRef(void 0),[U,_]=l.useState(""),T=e.length>0;l.useEffect(()=>{w(s=>s!==null&&s>=e.length?null:s)},[e.length]),l.useEffect(()=>{const s=v.current;if(s!==void 0){if(v.current=void 0,s===null){C.current?.focus();return}$.current[s]?.focus()}});const D=l.useRef(void 0);l.useEffect(()=>{const s=m?.caret;if(!s||s===D.current)return;D.current=s;const c=C.current;!c||c.ownerDocument.activeElement!==c||(c.setSelectionRange(s.cursor,s.cursor),m?.onCaretChange(s.cursor))});const S=s=>{m?.onCaretChange(s.selectionStart??s.value.length)},g=l.useCallback(s=>{w(s),v.current=s},[]),N=l.useCallback(s=>{const c=e[s];c&&t&&(g(me(s,e.length)),_(`${c.label} removed`),t(c.id))},[e,t,g]),z=l.useCallback(()=>{g(null),i()},[i,g]),V=l.useCallback(s=>{const c=s.currentTarget;if(m?.onKeyDown(s))return;const b=fe({key:s.key,shiftKey:s.shiftKey,repeat:s.repeat,caretAtStart:c.selectionStart===0&&c.selectionEnd===0,hasValue:n.length>0,chipCount:e.length});switch(b.type){case"focusChip":s.preventDefault(),g(b.index);return;case"clearQuery":A();return;case"blur":c.blur();return;case"none":return}},[e.length,n,A,g,m]),G=l.useCallback(s=>c=>{const b=pe({key:c.key,repeat:c.repeat,index:s,chipCount:e.length});switch(b.type!=="none"&&c.preventDefault(),b.type){case"removeChip":N(b.index);return;case"focusChip":g(b.index);return;case"focusInput":g(null);return;case"activateChip":return;case"none":return}},[e,N,g]);return l.useEffect(()=>{if(!u)return;const s=c=>{c.key!=="/"||c.metaKey||c.ctrlKey||c.altKey||ge(c.target)||L("focusSearch")||(c.preventDefault(),C.current?.focus())};return window.addEventListener("keydown",s),()=>window.removeEventListener("keydown",s)},[u]),d.jsxs("label",{htmlFor:F,className:y("flex w-full items-center gap-1.5 text-sm","bg-surface-sunken/50 border border-transparent","focus-within:bg-canvas focus-within:border-line focus-within:ring-2 focus-within:ring-ring","transition-colors",h==="lg"?"rounded-xl px-4 py-2":"rounded-md px-2.5 py-1",x),children:[d.jsx(X,{className:y("shrink-0 text-fg-muted pointer-events-none",h==="lg"?"size-5":"size-4")}),d.jsxs("div",{className:"flex min-w-0 flex-1 flex-wrap items-center gap-1",children:[T&&d.jsx("div",{role:"grid","aria-label":"Search filters",className:"flex min-w-0 flex-wrap items-center gap-1",children:e.map((s,c)=>d.jsx(O,{ref:b=>{$.current[c]=b},label:s.label,tone:s.tone,focused:P===c,onFocusLabel:()=>w(c),onKeyDown:G(c),onRemove:()=>N(c)},s.id))}),d.jsx("input",{ref:C,id:F,name:"q",type:"text","aria-label":"Search mail",autoComplete:"off",value:n,tabIndex:P===null?0:-1,onChange:s=>{o(s.target.value),S(s.target)},onKeyDown:V,onKeyUp:s=>S(s.currentTarget),onClick:s=>S(s.currentTarget),onFocus:s=>{w(null),m?.onFocusChange?.(!0),S(s.currentTarget)},onBlur:()=>m?.onFocusChange?.(!1),...m?.comboboxProps,placeholder:T?void 0:a,className:"min-w-24 flex-1 bg-transparent text-fg outline-none placeholder:text-fg-muted"})]}),(n||T)&&f&&d.jsx("button",{type:"button",onClick:z,className:"shrink-0 rounded p-0.5 hover:bg-surface-raised transition-colors","aria-label":"Clear search",children:d.jsx(R,{className:y("text-fg-muted",h==="lg"?"size-5":"size-4")})}),d.jsx("span",{role:"status","aria-live":"polite",className:"sr-only",children:U})]})},Re=({value:e,onChange:t,onClear:n,onClearQuery:o,chips:i,onRemoveChip:r,placeholder:a="Search mail...",globalFocusKey:u=!0,showClearButton:f=!0,size:h,inputId:p,suggest:m,className:x})=>d.jsx(be,{value:e,onChange:t,onClear:n,onClearQuery:o,chips:i,onRemoveChip:r,placeholder:a,globalFocusKey:u,showClearButton:f,size:h,inputId:p,suggest:m,className:x});function je({handlers:e,enabled:t=!0,target:n,sequenceTimeoutMs:o=1e3}){const i=l.useRef(e);i.current=e;const r=l.useRef(null),a=l.useRef(null);l.useEffect(()=>{if(!t)return;const u=()=>{a.current!==null&&(clearTimeout(a.current),a.current=null)},f=p=>{const m=J({key:p.key,shiftKey:p.shiftKey,metaKey:p.metaKey,ctrlKey:p.ctrlKey,altKey:p.altKey,inEditable:W(p.target),onControl:Y(p.target)},r.current);if(Z().length>0){u(),r.current=null;return}if(u(),r.current=m.nextPrefix,m.nextPrefix!==null&&(a.current=setTimeout(()=>{r.current=null,a.current=null},o)),m.action===null||L(m.action)!==null)return;const x=i.current[m.action];x&&(m.preventDefault&&p.preventDefault(),x())},h=n===void 0?window:n;if(h!==null)return h.addEventListener("keydown",f),()=>{h.removeEventListener("keydown",f),u(),r.current=null}},[t,o,n])}function Me(){const e=k({from:"/mail/brief/$threadId",shouldThrow:!1}),t=k({from:"/mail/brief/$threadId/$messageId",shouldThrow:!1}),n=k({from:"/mail/flagged/$threadId",shouldThrow:!1}),o=k({from:"/mail/flagged/$threadId/$messageId",shouldThrow:!1}),i=k({from:"/mail/$mailboxId/$threadId",shouldThrow:!1}),r=k({from:"/mail/$mailboxId/$threadId/$messageId",shouldThrow:!1}),a=e?.threadId??n?.threadId??i?.threadId,u=t?.messageId??o?.messageId??r?.messageId;return l.useMemo(()=>a?{threadId:a,messageId:u}:void 0,[a,u])}function Ke(){const e=j(),t=se(),{list:n,mailboxId:o}=I();return l.useCallback((i,r)=>{const a=r?.query,f={search:p=>a===void 0?p:{...p,q:a||void 0},hash:t,replace:r?.replace??!1};if(n==="flagged"){e({to:"/mail/flagged/$threadId/$messageId",params:i,...f});return}const h=r?.mailboxId??o;if(n==="mailbox"&&h){e({to:"/mail/$mailboxId/$threadId/$messageId",params:{mailboxId:h,...i},...f});return}e({to:"/mail/brief/$threadId/$messageId",params:i,...f})},[e,t,n,o])}function Fe(){return re()}function ye(){const e=j();return l.useCallback(t=>{e({to:"/mail/brief",search:{q:t||void 0}})},[e])}function $e(){const e=j();return l.useCallback((t,n)=>{e({to:"/mail/$mailboxId",params:{mailboxId:t},search:{q:n||void 0}})},[e])}const xe=({accounts:e})=>{const{list:t,mailboxId:n}=I(),{t:o}=ee("mail",{useSuspense:!1}),i=l.useCallback((a,u)=>o(a,{defaultValue:u}),[o]),r=K({queries:e.map(a=>({...M({path:{accountId:a.accountId}}),staleTime:1/0}))});if(t==="outbox")return"Outbox";if(!n)return null;for(let a=0;a<e.length;a++){const u=r[a]?.data?.items;if(!u)continue;const f=u.find(p=>p.mailboxId===n);if(!f)continue;const h=te(e[a].folderAppointments);return ne(f,h.get(n),i)}return null},Ae=({accounts:e})=>{const{mailboxId:t}=I(),n=K({queries:e.map(o=>({...M({path:{accountId:o.accountId}}),staleTime:1/0}))});if(!t)return null;for(const o of n){const i=o.data?.items;if(!i)continue;const r=i.find(a=>a.mailboxId===t);if(r)return r.unseenCount}return null},Pe=({accounts:e})=>{const{mailboxId:t}=I(),n=K({queries:e.map(o=>({...M({path:{accountId:o.accountId}}),staleTime:1/0}))});if(!t)return 0;for(const o of n){const i=o.data?.items;if(!i)continue;const r=i.find(a=>a.mailboxId===t);if(r)return r.messageCount}return 0};function De(e){const t=ye(),{searchInput:n}=oe(),o=xe({accounts:e}),i=I(),r=l.useMemo(()=>ae(i,o),[i,o]),a=l.useCallback(u=>{u===ie&&t(n)},[t,n]);return{scope:r,clearScope:a}}function Le(e){const t=new Map;for(const n of e){const o=n.email.toLowerCase(),i=o.split("@")[0];i&&!t.has(i)&&t.set(i,n.accountId),t.has(o)||t.set(o,n.accountId)}return t}function qe(e){const t=new Map;for(const n of e)for(const o of n){const i=o.fullPath?.toLowerCase();if(!i)continue;const r=E(o).toLowerCase();t.has(i)||t.set(i,o.mailboxId),t.has(r)||t.set(r,o.mailboxId)}return t}function Be(e,t=[]){const n=e.flat().filter(r=>r.fullPath),o=new Map;for(const r of n){const a=E(r).toLowerCase();o.set(a,(o.get(a)??0)+1)}const i=new Map(t.map(r=>[r.accountId,r.email]));return n.map(r=>{const a=E(r),u=o.get(a.toLowerCase())===1,f=t.length>1?i.get(r.accountId):void 0;return{value:u?a:r.fullPath,label:r.displayNameOverride?.trim()||a,...f?{hint:f}:{}}})}function Oe(e){const t=new Map;for(const n of e){const o=n.email.toLowerCase().split("@")[0]??"";t.set(o,(t.get(o)??0)+1)}return e.map(n=>{const o=n.email.split("@")[0]??n.email,i=t.get(o.toLowerCase())===1,r=n.displayName?.trim();return{value:i?o:n.email,label:r||n.email,...r?{hint:n.email}:{}}})}export{ve as B,le as K,Re as S,Me as a,qe as b,je as c,Le as d,Ke as e,Fe as f,xe as g,Ae as h,Pe as i,ce as j,Te as k,Ee as l,Be as m,Oe as n,$e as o,de as s,Ne as t,De as u};
@@ -1 +1 @@
1
- import{u as e,r as o}from"./index-BnBpXn45.js";const n={brief:"/mail/brief",flagged:"/mail/flagged",outbox:"/mail/outbox",settings:"/settings",accounts:"/settings/accounts",importConfig:"/import"};function i(){const t=e();return o.useCallback(s=>{t({to:n[s]})},[t])}function c(){const t=e();return o.useCallback(s=>{t({to:"/settings/accounts",search:{editAccountId:s,focusSmtp:!0}})},[t])}function u(){const t=e();return o.useCallback(s=>{t({to:"/settings/$slotId",params:{slotId:s}})},[t])}export{u as a,c as b,i as u};
1
+ import{u as e,r as o}from"./index-CmOAOx38.js";const n={brief:"/mail/brief",flagged:"/mail/flagged",outbox:"/mail/outbox",settings:"/settings",accounts:"/settings/accounts",importConfig:"/import"};function i(){const t=e();return o.useCallback(s=>{t({to:n[s]})},[t])}function c(){const t=e();return o.useCallback(s=>{t({to:"/settings/accounts",search:{editAccountId:s,focusSmtp:!0}})},[t])}function u(){const t=e();return o.useCallback(s=>{t({to:"/settings/$slotId",params:{slotId:s}})},[t])}export{u as a,c as b,i as u};
@@ -1 +1 @@
1
- import{j as a,p as x}from"./index-BnBpXn45.js";const f={sm:"min-h-9 px-3 text-xs",md:"min-h-11 px-4 text-sm"};function h({name:l,options:r,value:s,onChange:d,size:i="md","aria-label":o}){const c=r.findIndex(e=>e.value===s);return a.jsx("div",{role:"radiogroup","aria-label":o,className:"inline-flex rounded-md border border-line bg-surface-sunken p-0.5",children:r.map((e,n)=>{const t=e.value===s,u=!t&&n<r.length-1&&c!==n+1;return a.jsxs("label",{className:x("relative flex cursor-pointer items-center justify-center rounded-[5px] font-medium transition-colors",f[i],t?"bg-surface text-fg shadow":"text-fg-muted hover:text-fg",u&&"after:pointer-events-none after:absolute after:right-0 after:top-1/4 after:h-1/2 after:w-px after:bg-line"),children:[a.jsx("input",{type:"radio",name:l,value:e.value,checked:t,onChange:()=>d(e.value),className:"sr-only"}),e.label]},e.value)})})}export{h as S};
1
+ import{j as a,p as x}from"./index-CmOAOx38.js";const f={sm:"min-h-9 px-3 text-xs",md:"min-h-11 px-4 text-sm"};function h({name:l,options:r,value:s,onChange:d,size:i="md","aria-label":o}){const c=r.findIndex(e=>e.value===s);return a.jsx("div",{role:"radiogroup","aria-label":o,className:"inline-flex rounded-md border border-line bg-surface-sunken p-0.5",children:r.map((e,n)=>{const t=e.value===s,u=!t&&n<r.length-1&&c!==n+1;return a.jsxs("label",{className:x("relative flex cursor-pointer items-center justify-center rounded-[5px] font-medium transition-colors",f[i],t?"bg-surface text-fg shadow":"text-fg-muted hover:text-fg",u&&"after:pointer-events-none after:absolute after:right-0 after:top-1/4 after:h-1/2 after:w-px after:bg-line"),children:[a.jsx("input",{type:"radio",name:l,value:e.value,checked:t,onChange:()=>d(e.value),className:"sr-only"}),e.label]},e.value)})})}export{h as S};
@@ -1 +1 @@
1
- import{j as e,p as o}from"./index-BnBpXn45.js";import{C as a}from"./chevron-down-CR89KUgK.js";function p({icon:n,className:s,children:t,ref:r,...i}){return e.jsxs("div",{className:o("relative flex h-9 items-center gap-2 rounded-md border border-line bg-surface-sunken pl-3 text-sm","focus-within:border-line-strong focus-within:ring-2 focus-within:ring-ring/30 transition-colors",s),children:[n&&e.jsx("span",{className:"shrink-0 text-fg-subtle",children:n}),e.jsx("select",{ref:r,className:"min-w-0 flex-1 appearance-none bg-transparent py-0 pr-8 text-fg outline-none",...i,children:t}),e.jsx(a,{className:"pointer-events-none absolute right-2.5 size-4 text-fg-subtle"})]})}export{p as S};
1
+ import{j as e,p as o}from"./index-CmOAOx38.js";import{C as a}from"./chevron-down-CuQovlNy.js";function p({icon:n,className:s,children:t,ref:r,...i}){return e.jsxs("div",{className:o("relative flex h-9 items-center gap-2 rounded-md border border-line bg-surface-sunken pl-3 text-sm","focus-within:border-line-strong focus-within:ring-2 focus-within:ring-ring/30 transition-colors",s),children:[n&&e.jsx("span",{className:"shrink-0 text-fg-subtle",children:n}),e.jsx("select",{ref:r,className:"min-w-0 flex-1 appearance-none bg-transparent py-0 pr-8 text-fg outline-none",...i,children:t}),e.jsx(a,{className:"pointer-events-none absolute right-2.5 size-4 text-fg-subtle"})]})}export{p as S};