PageSourceSearch

https://capitaineaventure.fr/assets/GiftSubscription-D__S5wf6.js

js capitaineaventure.fr collected 2026-10-02 01:02:05 UTC 12,289 bytes, 6 lines download raw bytes

1import{j as e}from"./vendor-query-DFKzjVri.js";import{r,L as I}from"./vendor-react-B9UTwVUJ.js";import{L as O}from"./Layout-U3hfl5tA.js";import{S as R}from"./SEO-DL9ijUL0.js";import{C as a}from"./card-CwhdHZ1t.js";import{B as y,s as m}from"./index-BmRjENVC.js";import{I as d}from"./input-BJr2T0MS.js";import{T as V}from"./textarea-D0ubGdaq.js";import{L as n}from"./label-6zclpojq.js";import{toast as u}from"./index-CqtmjIGR.js";import{G as x}from"./gift-NkkSvm85.js";import{S as w}from"./sparkles-Cy9dIcCr.js";import{M as _}from"./mail-BwTUghZD.js";import{U as B}from"./user-C1oJ_K8p.js";import{B as U}from"./book-open-Dg5RAkxZ.js";import{C as k}from"./compass-DusABFan.js";import{H as D}from"./headphones-bG0FI2Yf.js";import{P as J}from"./pen-tool-DDSvahuG.js";import{T as S}from"./trophy-DhW1Dn2L.js";import{U as $}from"./users-DDvM2Vv6.js";import{H as F}from"./heart-C8AYHbD8.js";import{L as Q}from"./lock-C6qimmfF.js";import{c as Y}from"./createLucideIcon-DcuJWPyU.js";import{S as K}from"./shield-CZ_izf6j.js";import"./use-toast-tfTEdvO_.js";import"./sheet-CR4W5BFg.js";import"./vendor-ui-5lK0Gku8.js";import"./dialog-DtmeHtV9.js";import"./separator-DO-uaT3r.js";import"./engagementMilestones-JMZ1KSvC.js";import"./crown-Ulhw-YL6.js";import"./settings-k-fEU8RX.js";import"./vendor-supabase-IraqMp5m.js";/**
2 * @license lucide-react v0.462.0 - ISC
3 *
4 * This source code is licensed under the ISC license.
5 * See the LICENSE file in the root directory of this source tree.
6 */const W=Y("Server",[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]]),X=[{months:6,price:23.94,label:"6 mois",monthlyPrice:3.99},{months:12,price:47.88,label:"1 an",popular:!0,monthlyPrice:3.99}],Ge=()=>{const[Z,E]=r.useState(null),[L,c]=r.useState(!1),[i,p]=r.useState(""),[h,f]=r.useState(""),[o,C]=r.useState(""),[b,q]=r.useState(""),[g,z]=r.useState("");r.useEffect(()=>{(async()=>{const{data:{session:t}}=await m.auth.getSession();if(t?.user){t.user.email&&p(t.user.email);const{data:l}=await m.from("user_profiles").select("reader_name").eq("id",t.user.id).single();l?.reader_name&&f(l.reader_name)}})()},[]);const j=i.includes("@")&&o.includes("@"),P=async s=>{try{if(c(!0),!i||!i.includes("@")){u.error("Veuillez entrer votre email pour la facture"),c(!1);return}if(!o||!o.includes("@")){u.error("Veuillez entrer l'email du destinataire"),c(!1);return}const{data:{session:t}}=await m.auth.getSession(),l={};t?.access_token&&(l.Authorization=`Bearer ${t.access_token}`);const{data:N,error:v}=await m.functions.invoke("create-gift-payment",{headers:l,body:{months:s,buyerEmail:i.trim(),recipientEmail:o.trim(),giverFirstName:h.trim(),childFirstName:b.trim(),giftMessage:g.trim()}});if(v){const H=await v.context?.json?.().catch(()=>null);throw new Error(H?.error||"Impossible de préparer le paiement. Réessayez dans un instant.")}if(N?.url)window.location.href=N.url;else throw new Error("Le lien de paiement est indisponible. Réessayez dans un instant.")}catch(t){u.error(t.message||"Erreur lors de la création du cadeau")}finally{c(!1)}},G=[{icon:U,text:"Histoires illimitées : tout le catalogue en accès libre"},{icon:k,text:"Le Grand Voyage en entier, tous les mondes inclus 🧭"},{icon:D,text:"Narration audio sur les histoires équipées"},{icon:J,text:"Accès à l'Atelier de Création d'histoires ✍️"},{icon:k,text:"Yuki, le compagnon magique"},{icon:S,text:"Récompenses, jardin, progression"}],T=[{icon:$,text:"Le compte peut accueillir jusqu'à 6 aventuriers !",color:"text-pink-500"},{icon:S,text:"Tableau de bord de progression",color:"text-green-500"},{icon:F,text:"Gestion profil TDAH ou dyslexie",color:"text-red-500"}],A=[{number:"1",text:"Tu choisis la durée"},{number:"2",text:"Tu renseignes les emails"},{number:"3",text:"Il reçoit un joli email magique 🎉"},{number:"4",text:"L'enfant commence son aventure ✨"}],M=[{icon:Q,text:"Sans engagement"},{icon:W,text:"Hébergé en France"},{icon:K,text:"Sans publicité"},{icon:F,text:"Respect des données enfants"}];return e.jsxs(O,{children:[e.jsx(R,{title:"Offrez Capitaine Aventure - Abonnement cadeau histoires enfants",description:"Offrez un abonnement aux histoires interactives personnalisées : histoires illimitées, Grand Voyage complet, narration audio et compagnon magique. Le cadeau idéal pour les enfants de 4 à 12 ans.",keywords:"offrir abonnement histoires enfants, cadeau lecture enfant, abonnement cadeau, histoires interactives"}),e.jsx("div",{className:"min-h-screen py-6 sm:py-12 px-4",children:e.jsxs("div",{className:"max-w-4xl mx-auto",children:[e.jsxs("div",{className:"text-center mb-10 sm:mb-14",children:[e.jsx("div",{className:"inline-flex items-center justify-center w-16 h-16 rounded-full bg-primary/10 mb-6",children:e.jsx(x,{className:"w-8 h-8 text-primary"})}),e.jsx("h1",{className:"text-3xl sm:text-5xl font-bold mb-4 text-foreground",children:"Offrez des histoires interactives"}),e.jsx("p",{className:"text-lg sm:text-xl text-muted-foreground max-w-2xl mx-auto",children:"Des histoires interactives personnalisées, à vivre chaque jour."})]}),e.jsxs("div",{className:"mb-12",children:[e.jsxs("h2",{className:"text-2xl sm:text-3xl font-bold text-center mb-8 flex items-center justify-center gap-2",children:[e.jsx(w,{className:"w-6 h-6 text-primary"}),"Ce que l'enfant reçoit"]}),e.jsx("div",{className:"flex flex-col items-center gap-3 max-w-md mx-auto",children:G.map((s,t)=>e.jsx(a,{className:"p-4 bg-card border-border/50 hover:shadow-lg transition-shadow w-full",children:e.jsxs("div",{className:"flex items-center justify-center gap-3",children:[e.jsx(s.icon,{className:"w-5 h-5 text-primary shrink-0"}),e.jsx("p",{className:"font-medium text-foreground",children:s.text})]})},t))})]}),e.jsxs("div",{className:"mb-12",children:[e.jsx("h2",{className:"text-2xl sm:text-3xl font-bold text-center mb-8",children:"👨‍👩‍👧 Pour des parents heureux"}),e.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-4",children:T.map((s,t)=>e.jsx(a,{className:"p-5 bg-card border-border/50 hover:shadow-lg transition-shadow",children:e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx("div",{className:`p-3 rounded-full bg-background ${s.color}`,children:e.jsx(s.icon,{className:"w-5 h-5"})}),e.jsx("p",{className:"font-medium text-foreground",children:s.text})]})},t))})]}),e.jsxs("div",{className:"mb-12",children:[e.jsx("h2",{className:"text-2xl sm:text-3xl font-bold text-center mb-8",children:"✨ Et toujours"}),e.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-3",children:M.map((s,t)=>e.jsxs(a,{className:"p-4 bg-card text-center",children:[e.jsx(s.icon,{className:"w-6 h-6 mx-auto mb-2 text-primary"}),e.jsx("p",{className:"text-sm font-medium text-foreground",children:s.text})]},t))})]}),e.jsxs("div",{className:"mb-12",children:[e.jsx("h2",{className:"text-2xl sm:text-3xl font-bold text-center mb-8",children:"📩 Comment ça marche ?"}),e.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4",children:A.map((s,t)=>e.jsxs(a,{className:"p-5 bg-card text-center",children:[e.jsx("div",{className:"inline-flex items-center justify-center w-10 h-10 rounded-full bg-primary text-primary-foreground font-bold text-lg mb-3",children:s.number}),e.jsx("p",{className:"font-medium text-foreground",children:s.text})]},t))})]}),e.jsxs(a,{className:"p-6 sm:p-8 mb-12 bg-card",children:[e.jsxs("h2",{className:"text-2xl font-bold text-center mb-8 flex items-center justify-center gap-2",children:[e.jsx(x,{className:"w-6 h-6 text-primary"}),"Préparer le cadeau"]}
6),e.jsxs("div",{className:"max-w-lg mx-auto space-y-8",children:[e.jsxs("div",{className:"p-5 rounded-xl border-2 border-primary/20 bg-primary/5",children:[e.jsxs("h3",{className:"text-lg font-bold mb-4 flex items-center gap-2",children:[e.jsx(_,{className:"w-5 h-5 text-primary"}),"🧾 Qui offre ce cadeau ?"]}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx(n,{htmlFor:"buyerEmail",className:"text-base font-semibold mb-2 block",children:"Votre email *"}),e.jsx(d,{id:"buyerEmail",type:"email",value:i,onChange:s=>p(s.target.value),placeholder:"[email protected]",required:!0,className:"bg-background"}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1.5",children:"📌 La facture sera envoyée à cette adresse."})]}),e.jsxs("div",{children:[e.jsx(n,{htmlFor:"giverFirstName",className:"text-base font-semibold mb-2 block",children:"Votre prénom (optionnel)"}),e.jsx(d,{id:"giverFirstName",type:"text",value:h,onChange:s=>f(s.target.value),placeholder:"Sophie",className:"bg-background"})]})]})]}),e.jsxs("div",{className:"p-5 rounded-xl border-2 border-border/50 bg-card/50",children:[e.jsxs("h3",{className:"text-lg font-bold mb-4 flex items-center gap-2",children:[e.jsx(B,{className:"w-5 h-5 text-primary"}),"🎁 Qui reçoit le cadeau ?"]}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx(n,{htmlFor:"recipientEmail",className:"text-base font-semibold mb-2 block",children:"Email du destinataire *"}),e.jsx(d,{id:"recipientEmail",type:"email",value:o,onChange:s=>C(s.target.value),placeholder:"[email protected]",required:!0,className:"bg-background"})]}),e.jsxs("div",{children:[e.jsx(n,{htmlFor:"childFirstName",className:"text-base font-semibold mb-2 block",children:"Prénom de l'enfant (optionnel)"}),e.jsx(d,{id:"childFirstName",type:"text",value:b,onChange:s=>q(s.target.value),placeholder:"Lucas",className:"bg-background"})]}),e.jsxs("div",{children:[e.jsx(n,{htmlFor:"giftMessage",className:"text-base font-semibold mb-2 block",children:"Message cadeau (optionnel)"}),e.jsx(V,{id:"giftMessage",value:g,onChange:s=>z(s.target.value),placeholder:"Joyeux anniversaire ! J'espère que tu vas adorer ces aventures extraordinaires ✨🎂",rows:3,className:"bg-background"})]})]})]})]})]}),e.jsxs(a,{className:"p-6 sm:p-8 mb-12 bg-card border-2 border-primary/30",children:[e.jsxs("h2",{className:"text-2xl font-bold text-center mb-6 flex items-center justify-center gap-2",children:[e.jsx(x,{className:"w-6 h-6 text-primary"}),"Choisir la durée de l'abonnement"]}),e.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4 max-w-xl mx-auto",children:X.map(s=>e.jsxs(a,{className:`relative p-6 transition-all hover:shadow-xl cursor-pointer ${s.popular?"border-2 border-primary bg-primary/5":"bg-background border-border"}`,onClick:()=>E(s.months),children:[s.popular&&e.jsx("div",{className:"absolute -top-3 left-1/2 -translate-x-1/2",children:e.jsx("span",{className:"bg-primary text-primary-foreground px-3 py-1 rounded-full text-xs font-bold whitespace-nowrap",children:"Le plus populaire"})}),e.jsxs("div",{className:"text-center",children:[e.jsx("div",{className:"text-xl sm:text-2xl font-bold mb-1",children:s.label}),e.jsxs("div",{className:"text-sm text-muted-foreground mb-3",children:["soit ",s.monthlyPrice,"€/mois"]}),e.jsxs("div",{className:"text-3xl sm:text-4xl font-bold text-primary mb-4",children:[s.price.toFixed(2),"€"]}),e.jsxs(y,{className:"w-full",size:"lg",disabled:L||!j,onClick:t=>{t.stopPropagation(),P(s.months)},children:[e.jsx(x,{className:"w-4 h-4 mr-2"}),"Offrir ",s.label]})]})]},s.months))}),!j&&e.jsx("p",{className:"text-center text-sm text-muted-foreground mt-4",children:"⬆️ Remplissez votre email et celui du destinataire pour activer le paiement"})]}),e.jsx(a,{className:"p-6 sm:p-8 bg-gradient-to-r from-primary/10 to-purple-500/10 border-primary/20",children:e.jsxs("div",{className:"text-center",children:[e.jsx("h3",{className:"text-xl sm:text-2xl font-bold mb-3",children:"✨ Envie d'un cadeau encore plus unique ?"}),e.jsx("p",{className:"text-muted-foreground mb-6 max-w-lg mx-auto",children:"Offrez une aventure personnalisée, créée spécialement pour cet enfant, dont il sera le héros."}),e.jsx(I,{to:"/histoire-personnalisee",children:e.jsxs(y,{variant:"outline",size:"lg",className:"gap-2 whitespace-normal text-center h-auto py-3 px-4",children:[e.jsx(w,{className:"w-4 h-4 shrink-0"}),e.jsx("span",{children:"Découvrir les histoires personnalisées"})]})})]})})]})})]})};export{Ge 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.