@remit/web-client-dist 0.0.232 → 0.0.234

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 (39) hide show
  1. package/assets/{ComposeBody-h1PiftR4.js → ComposeBody-3gdZPURN.js} +1 -1
  2. package/assets/{ConfirmDialog-B_KkBkuo.js → ConfirmDialog-DNa2Mmm9.js} +1 -1
  3. package/assets/{ErrorState-D1WBXDNQ.js → ErrorState-Dfn-pYGs.js} +1 -1
  4. package/assets/{OnboardingWizard-DOuEMblV.js → OnboardingWizard-DCdyLpVy.js} +1 -1
  5. package/assets/{account-form-helpers-Cqm6cgIX.js → account-form-helpers-CGoKIwcn.js} +1 -1
  6. package/assets/{accounts-CHELDGRg.js → accounts-WnNLLYjf.js} +1 -1
  7. package/assets/{advanced-HgkbIhJt.js → advanced-DbtGO91i.js} +1 -1
  8. package/assets/{appearance-CHDzuejc.js → appearance-CmA_uuzo.js} +1 -1
  9. package/assets/{avatar-BaD2W0t4.js → avatar-suyTsU9g.js} +1 -1
  10. package/assets/{browser-ponyfill-DoFKSiNJ.js → browser-ponyfill-BBVWkk0l.js} +1 -1
  11. package/assets/{circle-check-CO5Qa0p3.js → circle-check-bhz_BCyy.js} +1 -1
  12. package/assets/{download-DlKKAnxh.js → download-6HmMoKsy.js} +1 -1
  13. package/assets/{filters-BXPOApqA.js → filters-BYkDNdzg.js} +1 -1
  14. package/assets/{flagged-D_qDboQg.js → flagged-bUSOb7nK.js} +1 -1
  15. package/assets/{folders-DnfeDEVr.js → folders-D7soRaV0.js} +1 -1
  16. package/assets/index-C3vNBuTr.js +1 -0
  17. package/assets/{index-6tSumyxe.js → index-C4gdCC1e.js} +40 -40
  18. package/assets/{index-FMcONjS6.js → index-DVBVV_iC.js} +1 -1
  19. package/assets/{kbd-CINjDjpx.js → kbd-X1zcvvx9.js} +1 -1
  20. package/assets/{labels-BtAOk4h3.js → labels-BL7dpgMT.js} +1 -1
  21. package/assets/mail-Cq59y83q.js +118 -0
  22. package/assets/{move-options-BEXPDvs8.js → move-options-BFAy-_jT.js} +1 -1
  23. package/assets/{move-targets-CNDlVmGD.js → move-targets-kKfahWSZ.js} +1 -1
  24. package/assets/{onboarding-CaAXnDTj.js → onboarding-BXRCu4Yn.js} +1 -1
  25. package/assets/{senders-CmD7qiOW.js → senders-DdxVL3D2.js} +1 -1
  26. package/assets/settings-BQL6F81I.js +1 -0
  27. package/assets/{settings-screen-CiCY9UZC.js → settings-screen-CjfmQ3DW.js} +1 -1
  28. package/assets/{shield-check-65Jnam5m.js → shield-check-BBFBbe8i.js} +1 -1
  29. package/assets/{suggested-vips-2MZY2sG1.js → suggested-vips-Dtarw2k3.js} +1 -1
  30. package/assets/{useDebouncedValue-CahN5uwg.js → useDebouncedValue-Dw-qktJ4.js} +1 -1
  31. package/assets/useFilters-Bn7VuruG.js +1 -0
  32. package/assets/{useLabels-Bgv_k5-j.js → useLabels-BTnW31IV.js} +1 -1
  33. package/assets/{useSignature-Bz5ocFjh.js → useSignature-D4tLXoKh.js} +1 -1
  34. package/index.html +1 -1
  35. package/package.json +1 -1
  36. package/assets/index-Cdlvp5lt.js +0 -1
  37. package/assets/mail-C4DqVu3m.js +0 -118
  38. package/assets/settings-Bp_w9cVP.js +0 -1
  39. package/assets/useFilters-D8c--87w.js +0 -1
@@ -1 +0,0 @@
1
- import{j as t,bO as o}from"./index-6tSumyxe.js";const n=()=>t.jsx(o,{});export{n as component};
@@ -1 +0,0 @@
1
- import{r as l,j as S,d as E,aC as x,cn as F,az as I,co as z,bl as k,cp as R,cq as _,a8 as N,cr as Y,cs as $,ct as j}from"./index-6tSumyxe.js";const J=320,H="cubic-bezier(0.32, 0.9, 0.3, 1)",B=.5,Q=.4,U=360;function q(e){return Math.sign(e)*Math.sqrt(Math.abs(e))*4}function oe({open:e,onClose:t,children:r,dismissLabel:s="Dismiss"}){const i=l.useRef(null),[n,a]=l.useState(U),[o,m]=l.useState(null);l.useLayoutEffect(()=>{const c=i.current;if(!c)return;const f=()=>a(c.offsetHeight);f();const b=new ResizeObserver(f);return b.observe(c),()=>b.disconnect()},[]);const u=l.useRef(null),g=l.useCallback(c=>{c.currentTarget.setPointerCapture(c.pointerId),u.current={startY:c.clientY,lastY:c.clientY,lastT:c.timeStamp,velocity:0,moved:!1},m(0)},[]),p=l.useCallback(c=>{const f=u.current;if(!f)return;const b=c.timeStamp-f.lastT;b>0&&(f.velocity=(c.clientY-f.lastY)/b),f.lastY=c.clientY,f.lastT=c.timeStamp;const v=c.clientY-f.startY;Math.abs(v)>4&&(f.moved=!0);const T=v<0?q(v):v;m(T)},[]),d=l.useCallback(()=>{const c=u.current;if(u.current=null,!c)return;const f=c.lastY-c.startY,v=c.velocity>B||f>n*Q;m(null),v&&t()},[n,t]),h=o!==null,M=e?o??0:n,y=Math.min(Math.max(1-M/n,0),1),O=h?"none":`transform ${J}ms ${H}`;return S.jsxs("div",{className:E("absolute inset-0 z-40 select-none overflow-hidden",e||h?"":"pointer-events-none"),children:[S.jsx("button",{type:"button","aria-label":s,tabIndex:-1,onClick:t,className:E("absolute inset-0 bg-black/40",y>0?"pointer-events-auto":"pointer-events-none"),style:{opacity:y*.6,transition:O.replace("transform","opacity")}}),S.jsxs("div",{ref:i,className:"absolute inset-x-0 bottom-0 flex max-h-[92%] flex-col rounded-t-3xl border-t border-line bg-surface shadow-2xl shadow-black/30",style:{transform:`translateY(${M}px)`,transition:O},children:[S.jsx("div",{role:"slider","aria-label":"Drag down to dismiss","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":Math.round(y*100),tabIndex:0,onPointerDown:g,onPointerMove:p,onPointerUp:d,onPointerCancel:d,className:"flex cursor-grab touch-none justify-center pb-1 pt-2.5 active:cursor-grabbing",children:S.jsx("div",{className:"h-1 w-10 rounded-full bg-fg-subtle/40"})}),S.jsx("div",{className:"flex min-h-0 flex-1 flex-col overflow-hidden",children:r})]})]})}const K=e=>{const[t,r]=l.useState(()=>typeof window>"u"||!window.matchMedia?!1:window.matchMedia(e).matches);return l.useEffect(()=>{if(typeof window>"u"||!window.matchMedia)return;const s=window.matchMedia(e),i=n=>r(n.matches);return r(s.matches),s.addEventListener("change",i),()=>s.removeEventListener("change",i)},[e]),t},ce=()=>K("(min-width: 1024px)"),le=(e,t)=>{if(e.state==="Expired")return"Expired";if(e.scope!=="Temporary"||!e.expiresAt)return"Active";const r=Date.parse(e.expiresAt);return Number.isNaN(r)?"Active":r<=t?"Expired":"Active"},ue=e=>{if(!e)return;const t=Date.parse(e);if(!Number.isNaN(t))return new Date(t).toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"})},D=(e,t=new Date)=>{if(!e)return;const r=/^(\d{4})-(\d{2})-(\d{2})$/.exec(e);if(!r)return;const[,s,i,n]=r,a=new Date(Number(s),Number(i)-1,Number(n),23,59,59,0);if(Number.isNaN(a.getTime()))return;const o=-t.getTimezoneOffset(),m=o>=0?"+":"-",u=Math.abs(o),g=String(Math.floor(u/60)).padStart(2,"0"),p=String(u%60).padStart(2,"0"),d=h=>String(h).padStart(2,"0");return`${a.getFullYear()}-${d(a.getMonth()+1)}-${d(a.getDate())}T${d(a.getHours())}:${d(a.getMinutes())}:${d(a.getSeconds())}${m}${g}:${p}`},C="None",de=e=>!e.literalClauses.some(t=>t.field==="HasWords"),P=e=>({...e.anchorMessageId?{anchorMessageId:e.anchorMessageId}:{},matchOperator:e.matchOperator,literalClauses:e.literalClauses,actionLabelId:e.labelId??C,actionMailboxId:e.moveMailboxId??C}),me=({mode:e,ruleScope:t})=>t==="standing"?"standing":t==="until"?"temporary":e==="selected"?"just-these":"all-like-these",fe=({mode:e,ruleScope:t,anchorMessageId:r,clauses:s,matchOperator:i,moveMailboxId:n,until:a})=>({...e==="similar"&&r?{anchorMessageId:r}:{},matchOperator:i==="all"?"And":"Or",literalClauses:s.map(o=>({field:o.field,value:o.value})),moveMailboxId:n,expiresAt:t==="until"?D(a??""):void 0}),w=(e,t,r)=>({name:r,scope:t==="standing"?"Standing":"Temporary",...t==="temporary"&&e.expiresAt?{expiresAt:e.expiresAt}:{},matchOperator:e.matchOperator,literalClauses:e.literalClauses,actionLabelId:e.labelId??C,actionMailboxId:e.moveMailboxId??C,...e.anchorMessageId?{anchorMessageId:e.anchorMessageId}:{}}),W=new Set(["Complete","Failed"]),A=e=>e!==void 0&&W.has(e),V=1e3,G=15e3,X=e=>{const t=Math.max(0,e),r=V*2**t;return Math.min(r,G)},pe=e=>{const[t,r]=l.useState(),s=x({...F(),onSuccess:p=>r(p.organizeJobId)}),{mutate:i}=s,n=I({...z({path:{accountId:e??"",organizeJobId:t??""}}),enabled:!!e&&!!t,refetchInterval:p=>{const d=p.state.data?.state;return A(d)?!1:X(p.state.dataUpdateCount)}}),a=l.useCallback(p=>{e&&(r(void 0),i({path:{accountId:e},body:P(p)}))},[e,i]),o=n.data,m=o?.state??s.data?.state,u=A(o?.state),g={state:m,matchedCount:o?.matchedCount??0,appliedCount:o?.appliedCount??0,failedCount:o?.failedCount??0,errorMessage:o?.errorMessage??""};return{start:a,progress:g,isStarting:s.isPending,isRunning:!!t&&!u,isDone:u,isError:s.isError||n.isError,error:s.error??n.error}},he=["From","Subject","HasWords","ListId","FromDomain"],Z=e=>{const t=e.trim(),r=t.match(/<([^>]+)>/);return(r?r[1]:t).trim().toLowerCase()},ge=(e,t)=>e==="ListId"?Z(t):t.trim(),ee=e=>e==="all"?"And":"Or",te=(e,t)=>{const r=e.widen!==void 0&&!e.widen.inactive,s=e.clauses.map(i=>({field:i.field,value:i.value}));return{...r&&t?{anchorMessageId:t}:{},matchOperator:ee(e.matchOperator),literalClauses:s}},re=e=>e.anchorMessageId!==void 0||!e.literalClauses.some(t=>t.field==="HasWords"),se=e=>JSON.stringify({anchor:e.anchorMessageId??null,operator:e.matchOperator,clauses:e.literalClauses.map(t=>`${t.field} ${t.value}`)}),be=(e,t)=>{const r=te(e,t);return{...r.anchorMessageId?{anchorMessageId:r.anchorMessageId}:{},matchOperator:r.matchOperator,literalClauses:r.literalClauses,moveMailboxId:e.moveMailboxId,labelId:e.labelId,expiresAt:e.scope==="until"?D(e.until??""):void 0}},ne=(e,t)=>e.error!==void 0&&e.errorSignature===t?{status:"error",reason:e.error}:e.count===void 0?{status:"loading"}:e.previewedSignature===t?{status:"ready",count:e.count}:{status:"ready",count:e.count,stale:!0},ae=350,ve=(e,t,r)=>{const s=x(k()),{mutateAsync:i}=s,n=se(t),[a,o]=l.useState(()=>({})),m=l.useRef(t);m.current=t;const u=l.useRef(n),g=re(t);return l.useEffect(()=>{if(!e||!g||n===a.previewedSignature||n===a.errorSignature)return;const p=setTimeout(()=>{const d=n;u.current=d,i({path:{accountId:e},body:P({...m.current})}).then(h=>{u.current===d&&o({count:h.matchedCount,matchedIds:h.messageIds,previewedSignature:d})}).catch(h=>{u.current===d&&o(M=>({...M,error:h instanceof Error?h.message:"Couldn't count matches.",errorSignature:d}))})},ae);return()=>clearTimeout(p)},[e,g,n,a.previewedSignature,a.errorSignature,i]),g?{count:ne(a,n),matchedIds:a.previewedSignature===n?a.matchedIds??[]:[]}:{count:{status:"error",reason:R},matchedIds:[]}},L=e=>$({path:{accountId:e}}),Se=e=>{const t=I({..._({path:{accountId:e??""}}),enabled:!!e});return{filters:t.data?.items??[],isPending:t.isPending,isError:t.isError,error:t.error,refetch:t.refetch}},Me=e=>{const t=N(),r=x({...j(),onSuccess:()=>{e&&t.invalidateQueries({queryKey:L(e)})}}),{mutate:s,mutateAsync:i}=r,n=l.useCallback((o,m,u)=>{e&&s({path:{accountId:e},body:w(o,m,u)})},[e,s]),a=l.useCallback(async(o,m,u)=>e?i({path:{accountId:e},body:w(o,m,u)}).then(()=>!0,()=>!1):!1,[e,i]);return{createFilter:n,createFilterAsync:a,isPending:r.isPending,isSuccess:r.isSuccess,isError:r.isError,error:r.error,reset:r.reset}},Ce=e=>{const t=N(),r=x({...Y(),onSuccess:()=>{e&&t.invalidateQueries({queryKey:L(e)})}}),{mutate:s}=r;return{deleteFilter:l.useCallback(n=>{e&&s({path:{accountId:e,filterId:n}})},[e,s]),isPending:r.isPending,deletingFilterId:r.isPending?r.variables?.path.filterId:void 0}};export{oe as B,C as N,he as S,K as a,P as b,ve as c,pe as d,Me as e,fe as f,de as g,L as h,be as i,le as j,ue as k,Se as l,Ce as m,ge as n,me as o,D as p,te as r,ce as u};