PageSourceSearch

https://www.rabattcorner.ch/build/assets/notifications-dropdown-DP8ITUUW.js

js rabattcorner.ch collected 2026-09-24 10:55:47 UTC 8,864 bytes, 1 lines download raw bytes

1import{d as $,P as F,o,f as M,w as l,a as t,y as e,c as s,b as _,t as c,u as H,L as R,r as w,I as k,g as d,F as h,z as g,h as A,k as E,l as I,m as D,p as Q,q as j}from"./messages.en-D-2afRE_.js";import{V as O,v as S}from"./customQueryClient-CUKn-s6e.js";import{a as L}from"./axios-B4uVmeYG.js";import{f as G}from"./index-DJhC8d7Z.js";import{b as K,_ as U,a as J,c as W}from"./DropdownMenuTrigger.vue_vue_type_script_setup_true_lang-CjZUuZPI.js";import{_ as C}from"./index-D_2TkvrV.js";import{u as X}from"./useInfiniteQuery-B5ruezKw.js";import"./index-FRCUWfIr.js";import"./utils-DMvbdbPS.js";const Y={class:"flex items-center justify-center w-16 h-16 min-w-16 p-2 mr-4 md:mr-6 border border-secondary-50 rounded"},tt={key:0,width:"24",height:"24",viewBox:"0 0 24 24",fill:"currentcolor",xmlns:"http://www.w3.org/2000/svg"},et={key:1,xmlns:"http://www.w3.org/2000/svg",height:"24px",viewBox:"0 -960 960 960",width:"24px",fill:"currentcolor"},ot={key:2,xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},st={key:3,xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},nt={key:4,xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},at={key:5,xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},it={key:6,xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},rt={class:"flex-1"},lt={class:"font-bold text-sm"},dt={class:"text-xs line-clamp-2"},ct=$({__name:"NotificationCard",props:{notification:{}},setup(y){const p=y,{notification:i}
1=F(p);return(N,n)=>(o(),M(e(K),{class:"flex items-center p-2",as:"a",href:e(i).link},{default:l(()=>[t("div",Y,[e(i).payment_icon==="reply"?(o(),s("svg",tt,n[0]||(n[0]=[t("path",{d:"M12.2651 8.5C9.61514 8.5 7.21514 9.49 5.36514 11.1L1.76514 7.5V16.5H10.7651L7.14514 12.88C8.53514 11.72 10.3051 11 12.2651 11C15.8051 11 18.8151 13.31 19.8651 16.5L22.2351 15.72C20.8451 11.53 16.9151 8.5 12.2651 8.5Z"},null,-1)]))):e(i).payment_icon==="clock-o"?(o(),s("svg",et,n[1]||(n[1]=[t("path",{d:"m612-292 56-56-148-148v-184h-80v216l172 172ZM480-80q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Zm0-400Zm0 320q133 0 226.5-93.5T800-480q0-133-93.5-226.5T480-800q-133 0-226.5 93.5T160-480q0 133 93.5 226.5T480-160Z"},null,-1)]))):e(i).payment_icon==="times-circle darkishred"?(o(),s("svg",ot,n[2]||(n[2]=[t("g",{fill:"none",stroke:"currentColor","stroke-width":"2"},[t("path",{d:"M21 12a9 9 0 1 1-18 0a9 9 0 0 1 18 0Z"}),t("path",{"stroke-linecap":"round",d:"m9 15l6-6m0 6L9 9"})],-1)]))):e(i).payment_icon==="star"?(o(),s("svg",st,n[3]||(n[3]=[t("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m12 17.75l-6.172 3.245l1.179-6.873l-5-4.867l6.9-1l3.086-6.253l3.086 6.253l6.9 1l-5 4.867l1.179 6.873z"},null,-1)]))):e(i).payment_icon==="money"?(o(),s("svg",nt,n[4]||(n[4]=[t("defs",null,[t("path",{id:"SVGgvnbobcx",d:"M21.5 11v10h-19V11z"})],-1),t("g",{fill:"none"},[t("use",{href:"#SVGgvnbobcx"}),t("path",{d:"M12 13.5a2.5 2.5 0 1 1 0 5a2.5 2.5 0 0 1 0-5m5.136-7.209L19 5.67l1.824 5.333H3.002L3 11.004L14.146 2.1z"}),t("path",{stroke:"currentColor","stroke-linecap":"square","stroke-width":"2",d:"M21 11.003h-.176L19.001 5.67L3.354 11.003L3 11m-.5.004H3L14.146 2.1l2.817 3.95"}),t("g",{stroke:"currentColor","stroke-linecap":"square","stroke-width":"2"},[t("path",{d:"M14.5 16a2.5 2.5 0 1 1-5 0a2.5 2.5 0 0 1 5 0Z"}),t("use",{href:"#SVGgvnbobcx"}),t("path",{d:"M2.5 11h2a2 2 0 0 1-2 2zm19 0h-2a2 2 0 0 0 2 2zm-19 10h2.002A2 2 0 0 0 2.5 18.998zm19 0h-2a2 2 0 0 1 2-2z"})])],-1)]))):e(i).payment_icon==="shopping-cart"?(o(),s("svg",at,n[5]||(n[5]=[t("path",{fill:"currentColor",d:"M7 22q-.825 0-1.412-.587T5 20t.588-1.412T7 18t1.413.588T9 20t-.587 1.413T7 22m10 0q-.825 0-1.412-.587T15 20t.588-1.412T17 18t1.413.588T19 20t-.587 1.413T17 22M6.15 6l2.4 5h7l2.75-5zM5.2 4h14.75q.575 0 .875.513t.025 1.037l-3.55 6.4q-.275.5-.737.775T15.55 13H8.1L7 15h12v2H7q-1.125 0-1.7-.987t-.05-1.963L6.6 11.6L3 4H1V2h3.25zm3.35 7h7z"},null,-1)]))):e(i).payment_icon==="heart"?(o(),s("svg",it,n[6]||(n[6]=[t("path",{fill:"currentColor",d:"m12.1 18.55l-.1.1l-.11-.1C7.14 14.24 4 11.39 4 8.5C4 6.5 5.5 5 7.5 5c1.54 0 3.04 1 3.57 2.36h1.86C13.46 6 14.96 5 16.5 5c2 0 3.5 1.5 3.5 3.5c0 2.89-3.14 5.74-7.9 10.05M16.5 3c-1.74 0-3.41.81-4.5 2.08C10.91 3.81 9.24 3 7.5 3C4.42 3 2 5.41 2 8.5c0 3.77 3.4 6.86 8.55 11.53L12 21.35l1.45-1.32C18.6 15.36 22 12.27 22 8.5C22 5.41 19.58 3 16.5 3"},null,-1)]))):_("",!0)]),t("div",rt,[t("h3",lt,c(e(i).date),1),t("div",dt,c(e(i).content),1)])]),_:1},8,["href"]))}}),pt={class:"relative w-full"},ut={key:0,class:"absolute -top-[0.2rem] left-[calc(100%-0.8rem)] p-1 px-1.5 text-[8px] leading-[8px] text-white bg-primary-base rounded-full"},ft={key:0},ht={class:"relative flex w-full border-t last:border-b border-secondary-50 p-2 overflow-hidden"},mt={key:1,class:"max-h-[360px] overflow-y-auto overflow-x-hidden no-scrollbar"},wt={key:0,class:"w-full flex items-center justify-center pt-4 pb-1"},gt={key:2,class:"px-2 py-6 text-center font-bold"},vt={class:"pt-5"},v=10,_t=$({__name:"NotificationsDropdownApp",setup(y){const p=H("target"),i=G(p),{t:N,locale:n}=R(),b=w(!1),q=w(0),u=w(0),{isPending:V,isFetchingNextPage:P,isError:qt,data:m,error:Tt,fetchNextPage:B,refetch:kt}=X({initialPageParam:1,queryKey:["notificationsList"],queryFn:async({pageParam:r})=>{const a=await L(`/api/notifications?limit=${v}&offset=${v*(r-1)}`);return q.value=a.data.pagination.count,u.value=a.data.pagination.unread_notifications_count,a.data},getNextPageParam:(r,a,f,T)=>Math.ceil(r.pagination.count/v)>a.length?f+1:null}),z=r=>{b.value=r},Z=async()=>{try{const r=await L.get("/api/notifications/mark-read")}catch(r){console.log("%cERROR AT handleMarkNotificationsRead:","background-color: red; color: white; font-weight: bold; padding: 2px 5px; border-radius: 4px;",r)}};return k(()=>{b.value&&u.value>0&&Z()}),k(async()=>{i.value&&B()}),(r,a)=>(o(),s("div",pt,[d(e(W),{modal:!1,"onUpdate:open":z},{default:l(()=>[d(e(U),{asChild:""},{default:l(()=>[d(e(C),{class:"relative ml-2",size:"icon-small",variant:"secondary-ghost"},{default:l(()=>[a[0]||(a[0]=t("svg",{xmlns:"http://www.w3.org/2000/svg",height:"24",viewBox:"0 -960 960 960",width:"24",fill:"
1currentcolor"},[t("path",{d:"M160-200v-80h80v-280q0-83 50-147.5T420-792v-28q0-25 17.5-42.5T480-880q25 0 42.5 17.5T540-820v28q80 20 130 84.5T720-560v280h80v80H160Zm320-300Zm0 420q-33 0-56.5-23.5T400-160h160q0 33-23.5 56.5T480-80ZM320-280h320v-280q0-66-47-113t-113-47q-66 0-113 47t-47 113v280Z"})],-1)),u.value>0?(o(),s("span",ut,c(u.value),1)):_("",!0)]),_:1})]),_:1}),d(e(J),{class:"w-[440px] overflow-visible relative rounded-tr-none shadow-none drop-shadow-[0_0_25px_rgba(0,0,0,0.1)]",align:"end",alignOffset:18,sideOffset:18},{default:l(()=>[a[3]||(a[3]=t("span",{class:"absolute inline-block -top-2 -right-2 -rotate-45 border-l-[12px] border-l-transparent border-r-[12px] border-r-transparent border-t-[12px] border-t-white"},null,-1)),e(V)?(o(),s("div",ft,[(o(),s(h,null,g([1,2,3,4],f=>t("div",ht,a[1]||(a[1]=[t("div",{class:"w-16 h-16 mr-2.5 bg-secondary-100 rounded-sm.5 animate-pulse"},null,-1),t("div",{class:"flex-1 flex flex-col justify-center pr-4"},[t("div",{class:"w-5/12 mb-1.5 h-4 bg-secondary-100 rounded-sm.5 animate-pulse"}),t("div",{class:"w-full h-3.5 bg-secondary-100 rounded-sm.5 animate-pulse"})],-1)]))),64))])):e(m)&&e(m).pages&&q.value>0?(o(),s("div",mt,[(o(!0),s(h,null,g(e(m).pages,f=>(o(),s(h,null,[(o(!0),s(h,null,g(f.data.notifications,T=>(o(),M(ct,{notification:T},null,8,["notification"]))),256))],64))),256)),t("span",{ref_key:"target",ref:p},null,512),e(P)?(o(),s("span",wt,a[2]||(a[2]=[t("svg",{class:"animate-spin text-primary-500 w-10 h-10",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 -960 960 960",fill:"currentcolor"},[t("path",{d:"M480-80q-82 0-155-31.5t-127.5-86Q143-252 111.5-325T80-480q0-83 31.5-155.5t86-127Q252-817 325-848.5T480-880q17 0 28.5 11.5T520-840q0 17-11.5 28.5T480-800q-133 0-226.5 93.5T160-480q0 133 93.5 226.5T480-160q133 0 226.5-93.5T800-480q0-17 11.5-28.5T840-520q17 0 28.5 11.5T880-480q0 82-31.5 155t-86 127.5q-54.5 54.5-127 86T480-80Z"})],-1)]))):_("",!0)])):(o(),s("p",gt,c(r.$t("activity_notification.no_notifications_yet")),1)),t("div",vt,[d(e(C),{as:"a",href:`${e(n)=="fr"?"/fr":""}/myaccount/transactions.html`,class:"w-full",variant:"secondary-outline"},{default:l(()=>[A(c(r.$t("show_all_transactions")),1)]),_:1},8,["href"])])]),_:1})]),_:1})]))}}),xt=window.location.pathname.includes("/fr/")?"fr":window.location.pathname.includes("/en/")?"en":"de",yt={de:D,fr:Q,en:j},bt=E({legacy:!1,locale:xt,fallbackLocale:"de",messages:yt}),x=I(_t);x.use(bt);x.use(O,S);x.mount("#NotificationsDropdownApp");

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.