1 2!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="23663c8f-161c-5158-b43c-db278adb840a")}catch(e){}}(); 3(function(){try{var e=typeof window<`u`?window:typeof global<`u`?global:typeof globalThis<`u`?globalThis:typeof self<`u`?self:{};e.SENTRY_RELEASE={id:`a4abc9cbafe0822e46e4f7c20a10db00a2018519`};var t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]=`7c9c0fa8-6a3f-4425-8cdd-07637deb996f`,e._sentryDebugIdIdentifier=`sentry-dbid-7c9c0fa8-6a3f-4425-8cdd-07637deb996f`)}catch{}})();import{s as e}from"./rolldown-runtime-CXbFRrf4.js";import{t}from"./react-BvrB1W6i.js";import{t as n}from"./jsx-runtime-C9cIOqPB.js";import{t as r}from"./useMutation-CsCY_u_K.js";import{n as i}from"./react-B7kLeFXV.js";import{n as a,o}from"./AuthContext-2urpTGHa.js";import{n as s}from"./react-DhaEMwAr.js";import{n as c}from"./utils-D0oExibj.js";import{t as l}from"./js.cookie-0yLcx42b.js";import{t as u}from"./useHasMounted-Cawg4bwI.js";var d=e(t(),1),f=n(),p=c(`showRewardBanner`,null),RewardBanner=()=>{let e=i(),[t,n]=s(p),{mutateAsync:c}=r(e.user.getDubReferralStatus.mutationOptions({onSuccess:()=>{l.remove(`dub_partner_data`)}})),m=u(),{track:h}=o(),{isLoggedIn:g,userLoading:_}=a(),v=(0,d.useRef)(!1);return(0,d.useEffect)(()=>{if(!m||_||v.current)return;let checkDubCustomer=async()=>{if(!v.current)try{let e=l.get(`dub_partner_data`);if(!e)return;let{partner:r,discount:i}=JSON.parse(e);if(!r||!i||i.amount!==1e3||t!==null)return;if(v.current=!0,!g)n(!0),h(`referral_link_visited`);else{if(!await c()){n(!1);return}n(!0),h(`referral_link_visited`)}}catch(e){console.error(`Failed to check Dub referral status:`,e)}},e=setTimeout(()=>checkDubCustomer(),500);return()=>clearTimeout(e)},[m,g,_]),!t||!m?null:(0,f.jsxs)(`div`,{id:`banner-reward`,className:`left-0 top-0 sticky w-full text-center h-9 max-sm:text-xs text-blue text-sm font-semibold bg-blue/10 p-2 z-[49] flex justify-between items-center`,children:[(0,f.jsx)(`div`,{className:`text-center flex-grow`,children:(0,f.jsx)(`span`,{children:`Referral discount applied at checkout`})}),(0,f.jsx)(`button`,{onClick:()=>{n(!1)},className:`bg-transparent border-none cursor-pointer p-2 text-xl font-medium`,children:`Ã`})]})};export{p as n,RewardBanner as t}; 4//# debugId=23663c8f-161c-5158-b43c-db278adb840a
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.