PageSourceSearch

https://app.cookieyes.com/assets/notifications.lazy-zd7SqQic.js

js cookieyes.com collected 2026-09-24 07:17:47 UTC 6,995 bytes, 1 lines download raw bytes

1import{j as e,T as Q,e as z,a6 as k,u as N,gC as O,gD as v,gE as P,E as S,gF as U,gG as $,a9 as B,aa as M,ab as H,ad as G,eJ as J,aE as V,L as _,gH as X,gI as Y,gJ as W,dH as Z,gK as D,r as m,gL as ee,gM as te,gN as se,az as ae,aA as ie,aW as ne,aX as oe,aY as re,aZ as le,bX as ce,gO as de,a_ as ue,d as fe}from"./index-DMQ34O7E.js";import{F as me}from"./FilterIcon-DmtVRvq-.js";function C({image:o,title:n,description:a}){return e.jsxs("div",{className:"flex flex-col items-center justify-center text-secondary-dark h-full flex-1",children:[e.jsx("img",{src:o,alt:n.toLowerCase()}),e.jsxs("div",{className:"mt-6 text-center",children:[e.jsx("h6",{className:"text-3xl font-semibold font-heading",children:n}),e.jsx("div",{className:"text-md mt-3",children:e.jsx(Q,{i18nKey:a,components:{br:e.jsx("br",{})}})})]})]})}function xe({groupedNotifications:o}){const n=z(),a=k(),{t}=N(),c=l=>l?J.sanitize(l):"",{mutate:r,isPending:x}=O(),g=(l,p)=>{if(x)return;r({notification_id:l,is_read:p},{onSuccess:()=>{a.invalidateQueries({queryKey:["notificationUnreadCount"]}),a.invalidateQueries({queryKey:["minimalNotifications"]}),a.invalidateQueries({queryKey:["allNotifications"]}),a.invalidateQueries({queryKey:["userFilteredNotifications"]})},onError:u=>{console.error("Failed to mark notification:",u)}})};return e.jsx("div",{className:"space-y-4",children:Object.entries(o).map(([l,p])=>e.jsxs("div",{children:[e.jsx("p",{className:"px-8 py-6 text-secondary-dark text-md capitalize",children:l}),e.jsx("ul",{children:p.map(s=>{var u;return e.jsxs("li",{className:"group grid grid-cols-12 pr-8 pl-[74px] py-[14px] hover:bg-secondary-lightest cursor-pointer transition-colors duration-200",children:[e.jsxs("div",{className:"flex items-start col-span-10",children:[e.jsx("img",{src:P(s.tag,"small"),alt:`${v(s.tag)} icon`,className:"mr-3"}),e.jsxs("div",{children:[e.jsx("p",{className:"text-xl font-semibold text-secondary-dark mb-2",children:s.title}),e.jsx("div",{dangerouslySetInnerHTML:{__html:c(s.content)},className:"text-md text-secondary-dark",id:"notification-content"}),s.button_details&&e.jsx(S,{variant:"primary",className:"mt-2 text-md mb-1 leading-4",onClick:h=>{h.stopPropagation(),s.button_details&&U(s.button_details.url,s.button_details.open_in_new_tab,n)},children:(u=s.button_details)==null?void 0:u.text}),e.jsxs("div",{className:"flex items-center text-md text-gray-dark mt-1",children:[e.jsx("span",{children:v(s.tag)}),e.jsx("div",{className:"h-1 w-1 rounded-full mx-1.5 bg-gray-dark"}),e.jsx("span",{children:$(s.created_at)})]})]})]}),e.jsx("div",{className:"relative col-span-2",children:e.jsx(B,{children:e.jsxs(M,{children:[e.jsx(H,{asChild:!0,children:e.jsx("button",{type:"button",id:"read-unread-button",className:`absolute right-12 h-6 w-6 cursor-pointer rounded-full transition-all duration-200 before:content-[''] before:absolute before:inset-0 before:m-auto before:h-6 before:w-6 before:rounded-full before:bg-primary/10 ${s.read_at?"opacity-0 group-hover:opacity-100":"opacity-100"} before:scale-0 group-hover:before:scale-100 before:transition-transform before:duration-200`,onClick:()=>g(s.id,!s.read_at),children:e.jsx("span",{className:`absolute inset-0 m-auto h-3 w-3 rounded-full ${s.read_at?"border border-primary":"bg-primary"}`})})}),e.jsx(G,{side:"left",sideOffset:5,children:e.jsx("p",{className:"text-xs",children:s.read_at?t("notification.markAsUnread"):t("notification.markAsRead")})})]})})})]},s.id)})})]},l))})}const pe=(o,n)=>{const a=X(o);return Y(a)?n("notification.today"):W(a)?n("notification.yesterday"):Z(o)},he=(o,n)=>{const a={};return o.forEach((t,c)=>{const r=c===0?n("notification.latest"):pe(t.created_at,n);a[r]||(a[r]=[]),a[r].push(t)}),a};function ge({notifications:o,isLoading:n,dataSource:a,lastId:t}){const{t:c}=N(),r=he(o,c),x=o.length!==0,g=Object.keys(r).length>0,l=()=>n&&t===""?e.jsx(_,{}):a==="all"&&!x?e.jsx(C,{image:"/images/notification-icons/notification-bell-empty.svg",title:c("notification.emptyState.noNotifications.title"),description:c("notification.emptyState.noNotifications.description")}):a==="filtered"&&!g?e.jsx(C,{image:"/images/notification-icons/notification-filter-empty.svg",title:c("notification.emptyState.noFilteredResults.title"),description:c("notification.emptyState.noFilteredResults.description")}):e.jsx(xe,{groupedNotifications:r});return e.jsx(V,{className:`pb-6 min-h-[calc(100vh-192px)] flex flex-col ${n?"justify-center":""}`,children:l()})}function ye(){const{t:o}=N(),n=k(),a=D(i=>i.unreadCount),[t,c]=m.useState(""),[r,x]=m.useState(""),[g,l]=m.useState(!1),[p,s]=m.useState([]),u=m.useRef(null),{data:h,isLoading:F}=ee(r,{enabled:!t||t==="all"}),{mutate:R,isPending:b}=te(),{data:y,isLoading:w}=se(t,r,{enabled:!!t&&t!=="all"}),A=()=>{R(void 0,{onSuccess:()=>{n.invalidateQueries({queryKey:["notificationUnreadCount"]}),n.invalidateQueries({queryKey:["minimalNotifications"]}),n.invalidateQueries({queryKey:["allNotifications"]})},onError:i=>{console.error("Failed to mark notification:",i)}})},T=i=>{c(i),x(""),s([])};m.useEffect(()=>{const i=new IntersectionObserver(j=>{const[q]=j;if(q.isIntersecting){const f=t&&t!=="all"?y:h;f!=null&&f.has_more&&(f!=null&&f.last_id)?(l(!0),x(f.last_id)):l(!1)}},{threshold:.5}),d=u.current;return d&&i.observe(d),()=>{d&&i.unobserve(d)}},[h,y,t]);const L=(i,d)=>
1{if(i!=null&&i.notifications)return d===""?i.notifications:j=>[...j,...i.notifications]};m.useEffect(()=>{const d=L(t&&t!=="all"?y:h,r);d&&(s(d),l(!1))},[h,y,r,t]);const E=p,I=t&&t!=="all"?w:F,K=t&&t!=="all"?"filtered":"all";return e.jsxs(ae,{children:[e.jsxs(ie,{className:"grid grid-cols-12 items-center px-8 py-3",children:[e.jsx("h6",{className:"text-3xl font-semibold font-heading  text-secondary-dark col-span-9",children:o("notification.title")}),e.jsxs("div",{className:"flex items-center justify-end gap-[22px] col-span-3",children:[a>0&&e.jsx(S,{variant:"link",className:`p-0 bg-transparent text-primary ${b?"cursor-not-allowed opacity-50":""}`,onClick:A,disabled:b,children:e.jsx("span",{className:"text-md font-semibold",children:o("notification.markAllAsRead")})}),e.jsxs(ne,{onValueChange:T,value:t,children:[e.jsxs(oe,{className:"h-[40px] text-md text-secondary-dark max-w-54",showChevron:!1,children:[e.jsx(re,{placeholder:o("notification.notificationFilter.placeholder")}),e.jsx(me,{width:24,height:24,svgColor:"dark"})]}),e.jsx(le,{children:e.jsx(ce,{children:de.map(i=>e.jsx(ue,{value:i.value,showCheckIcon:!1,children:o(i.label)},i.value))})})]})]})]}),e.jsx("hr",{className:"bg-secondary-lighter shadow-md"}),e.jsx(ge,{notifications:E||[],isLoading:I,dataSource:K,lastId:r}),e.jsx("div",{ref:u}),g&&e.jsx("div",{className:"flex justify-center items-center py-4",children:e.jsx(_,{})})]})}const ve=fe("/settings/notifications")({component:je});function je(){return e.jsx("div",{className:"bg-secondary-lightest pt-24 w-full min-h-[calc(100vh-0px)] flex-grow",children:e.jsx("div",{className:"py-6 px-8",children:e.jsx(ye,{})})})}export{ve as Route,je as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.