1import{r as s,j as e}from"./vendor-ui-BdR_ANcL.js";import{X as g,s as i}from"./index-Cn5xffnt.js";import{u as h}from"./vendor-react-2wG_afoi.js";import{G as j}from"./gift-Bimaq1BB.js";import{C as v}from"./check-CD-_Uj2C.js";import{C as N}from"./copy-BjcnS3vd.js";import"./vendor-supabase-XW2fJUyV.js";import"./vendor-query-usLDJ6bn.js";const c="redavip_promo_shown",y=5e3;function P(){const[l,a]=s.useState(!1),[d,n]=s.useState(!1),[t,m]=s.useState(null),u=h();s.useEffect(()=>{if(localStorage.getItem(c))return;async function f(){const{data:b}=await i.from("site_settings").select("promo_popup_enabled").limit(1);if(b?.[0]?.promo_popup_enabled===!1)return;const{data:r}=await i.from("coupons").select("code, discount_percent").eq("active",!0).filter("is_popup","eq",!0).limit(1);r&&r.length>0&&(m(r[0]),setTimeout(()=>a(!0),y))}f()},[]);function o(){a(!1),localStorage.setItem(c,"1")}function p(){t&&(navigator.clipboard.writeText(t.code),n(!0),setTimeout(()=>n(!1),2e3))}function x(){o(),u("/cars")}return!l||!t?null:e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"fixed inset-0 bg-black/50 backdrop-blur-sm z-[60] animate-fade-in",onClick:o}),e.jsx("div",{className:"fixed inset-0 z-[61] flex items-center justify-center p-4 animate-scale-in",children:e.jsxs("div",{className:"relative w-full max-w-md rounded-2xl bg-background border border-border shadow-2xl overflow-hidden",children:[e.jsx("button",{onClick:o,className:"absolute top-3 right-3 p-1.5 rounded-full bg-muted hover:bg-muted/80 text-muted-foreground transition-colors z-10","aria-label":"Fermer",children:e.jsx(g,{className:"w-4 h-4"})}),e.jsxs("div",{className:"bg-primary px-6 py-5 text-center",children:[e.jsx(j,{className:"w-10 h-10 text-primary-foreground mx-auto mb-2"}),e.jsx("h2",{className:"text-xl font-bold text-primary-foreground",children:"Bienvenue chez Reda VIP !"}),e.jsxs("p",{className:"text-primary-foreground/80 text-sm mt-1",children:["Profitez de ",e.jsxs("span",{className:"font-bold text-primary-foreground",children:[t.discount_percent,"% de réduction"]})," sur votre première location"]})]}),e.jsxs("div",{className:"px-6 py-5 text-center space-y-4",children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:"Utilisez ce code lors de votre réservation :"}),e.jsxs("button",{onClick:p,className:"inline-flex items-center gap-2 px-5 py-2.5 rounded-lg border-2 border-dashed border-accent bg-accent/5 text-accent font-mono text-lg font-bold tracking-widest hover:bg-accent/10 transition-colors",children:[t.code,d?e.jsx(v,{className:"w-4 h-4 text-accent"}):e.jsx(N,{className:"w-4 h-4"})]}),e.jsx("button",{onClick:x,className:"w-full py-3 rounded-xl bg-accent text-accent-foreground font-semibold text-base hover:opacity-90 transition-opacity",children:"Voir nos voitures â"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Offre limitée · Conditions générales applicables"})]})]})})]})}export{P 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.