PageSourceSearch

https://www.trouwassistent.nl/assets/index-DzvM7bBB.js

js trouwassistent.nl collected 2026-10-02 01:06:08 UTC 36,287 bytes, 13 lines download raw bytes

1import{j as e}from"./ui-DGDVfbFn.js";import{u as s,L as a,a as t,d as l}from"./react-vendor-CG7WfdSN.js";import{c as n,B as i,L as r,e as c,l as d,M as o,p as m,H as x,R as h,g,h as j}from"./index-BEigjK7B.js";import{w as b}from"./webGuestAuth-0azyuHaG.js";import{A as p}from"./arrow-left-DMim9f-g.js";import{I as u}from"./input-B3Vwc5ya.js";import{T as f}from"./textarea-I4nIMqxP.js";import{A as N,a as v}from"./alert-BIJxlNbR.js";import{C as w,G as k}from"./gift-CTP1WrRA.js";import{T as y}from"./triangle-alert-Df82UXXT.js";import{C as _}from"./circle-check-big-_gippx9a.js";import{C}from"./circle-x-C6AjMQsG.js";import{M as z}from"./message-square-D0EIAY7o.js";import{M as S}from"./map-pin-CJYtqSBn.js";import{L as B}from"./loader-circle-D0ynUUPP.js";import{S as L}from"./save-DXvR1pUu.js";import{C as M}from"./check-DiZDg0W7.js";import{D,a as R,b as $,c as A,d as I}from"./dialog-BQwBs0Sb.js";import{C as T,a as V,S as F}from"./shirt-DWP1wz7p.js";import{E as U}from"./external-link-DZWSR7nl.js";import{U as O}from"./users-BfwDHXIU.js";import{P}from"./phone-BntUzGGo.js";import"./supabase-BrKiwD5U.js";import"./charts-ChniAfy4.js";import"./x-DrAs1Mgh.js";
2/**
3 * @license lucide-react v0.462.0 - ISC
4 *
5 * This source code is licensed under the ISC license.
6 * See the LICENSE file in the root directory of this source tree.
7 */const q=n("CircleHelp",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]]),E=n("Utensils",[["path",{d:"M3 2v7c0 1.1.9 2 2 2h4a2 2 0 0 0 2-2V2",key:"cjf0a3"}],["path",{d:"M7 2v20",key:"1473qp"}],["path",{d:"M21 15V2a5 5 0 0 0-5 5v6c0 1.1.9 2 2 2h3Zm0 0v7",key:"j28e5"}]]),W=({showBackButton:t=!1,backLabel:l="Terug",onBack:n,title:c})=>{const d=s();return e.jsx("nav",{className:"fixed top-0 w-full backdrop-blur-md z-50 border-b border-white/20 shadow-sm",style:{backgroundColor:"#a2c4c9"},children:e.jsx("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:e.jsxs("div",{className:"flex justify-between items-center py-4",children:[e.jsxs("div",{className:"flex items-center space-x-4",children:[e.jsx(a,{to:"/uitnodiging-overzicht",className:"text-2xl font-medium text-white hover:text-white/90 transition-colors",style:{fontFamily:"Dancing Script, cursive"},children:"TrouwAssistent"}),t&&e.jsxs("div",{className:"flex items-center space-x-2 text-sm",children:[e.jsx("span",{className:"text-white/50",children:"/"}),e.jsxs("button",{onClick:()=>{n?n():d("/uitnodiging-overzicht")},className:"text-white/90 hover:text-white transition-colors flex items-center space-x-1",children:[e.jsx(p,{className:"h-4 w-4"}),e.jsx("span",{children:l})]}),c&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"text-white/50",children:"/"}),e.jsx("span",{className:"text-white",children:c})]})]})]}),e.jsx("div",{className:"flex items-center space-x-1",children:e.jsxs(i,{onClick:()=>{b.clearSession(),d("/")},variant:"ghost",className:"text-white hover:text-white hover:bg-white/20 px-4 py-2.5 rounded-[15px] font-medium transition-all duration-200 border border-transparent hover:border-white/30 flex items-center space-x-2",children:[e.jsx(r,{className:"h-4 w-4"}),e.jsx("span",{className:"hidden sm:inline",children:"Uitloggen"})]})})]})})})},G=({active:s,onToggle:a,label:t,ariaLabel:l})=>e.jsxs("button",{type:"button",onClick:a,"aria-pressed":s,"aria-label":l||t,className:"inline-flex items-center gap-2 select-none",children:[e.jsx("span",{className:`w-6 h-6 rounded-full border-2 flex items-center justify-center transition\n        ${s?"bg-[#a2c4c9] border-[#a2c4c9] text-white":"bg-white border-slate-300 text-transparent hover:border-[#a2c4c9]"}\n      `,children:e.jsx(M,{className:"w-3.5 h-3.5"})}),e.jsx("span",{className:"text-sm text-slate-800",children:t})]}),H=({weddingData:s,onBack:a,onUpdate:l})=>{const n=s?.guest||null,[r,x]=t.useState("aanwezig"===n?.rsvp_status?"yes":"afwezig"===n?.rsvp_status?"no":null),[h,g]=t.useState(n?.diet||""),[j,p]=t.useState(!n?.diet),[k,M]=t.useState(n?.allergies||""),[D,R]=t.useState(!n?.allergies),[$,A]=t.useState(n?.requests||""),[I,T]=t.useState(!!n?.requests),[V,F]=t.useState(n?.address||""),[U,O]=t.useState(n?.postal_code||""),[P,q]=t.useState(n?.city||""),[W,H]=t.useState(!1),J=t.useMemo(()=>{const e=n;if(!e)return null!==r||""!==h||""!==k||""!==$||""!==V||""!==U||""!==P;const s="aanwezig"===e.rsvp_status?"yes":"afwezig"===e.rsvp_status?"no":null,a=e.diet||"",t=e.allergies||"",l=e.requests||"",i=e.address||"",c=e.postal_code||"",d=e.city||"";return r!==s||(j?"":h)!==a||(D?"":k)!==t||(I?$:"")!==l||V!==i||U!==c||P!==d},[n,r,h,j,k,D,$,I,V,U,P]);t.useEffect(()=>{const e=s?.guest;e&&(x("aanwezig"===e?.rsvp_status?"yes":"afwezig"===e?.rsvp_status?"no":null),g(e?.diet||""),p(!e?.diet),M(e?.allergies||""),R(!e?.allergies),A(e?.requests||""),T(!!e?.requests),F(e?.address||""),O(e?.postal_code||""),q(e?.city||""))},[s?.guest]);const K=t.useMemo(()=>s?.wedding?.name||s?.wedding_info?.contact_info||"Deze bruiloft",[s?.wedding?.name,s?.wedding_info?.contact_info]),Z=t.useMemo(()=>s?.wedding?.date?new Date(s.wedding.date).toLocaleDateString("nl-NL",{weekday:"long",year:"numeric",month:"long",day:"numeric"}):null,[s?.wedding?.date]);return e.jsxs("div",{className:"pb-12",children:[e.jsxs("div",{className:"text-center mb-12",children:[e.jsx("span",{className:"text-sm tracking-[0.3em] uppercase text-[#8b9290] font-light mb-4 block",children:"RSVP"}),e.jsx("h1",{className:"text-5xl md:text-6xl font-medium text-[#2c2c2c] mb-5 font-d
7ancing leading-tight",children:K}),Z&&e.jsxs("div",{className:"flex items-center justify-center space-x-2 text-lg text-[#5a5a5a] mb-4",children:[e.jsx(w,{className:"h-5 w-5"}),e.jsx("span",{children:Z})]}),e.jsx("p",{className:"text-lg text-[#5a5a5a] max-w-2xl mx-auto font-light leading-relaxed",children:"Laat ons weten of je erbij kunt zijn en deel eventuele dieetwensen of speciale verzoeken"})]}),e.jsx("div",{className:"max-w-5xl mx-auto mb-12",children:e.jsx("div",{className:"h-px bg-gradient-to-r from-transparent via-[#d4d4d4] to-transparent"})}),e.jsxs("div",{className:"max-w-6xl mx-auto",children:[J&&e.jsxs(N,{className:"bg-amber-50 border-amber-200",children:[e.jsx(y,{className:"h-4 w-4 text-amber-600"}),e.jsxs(v,{className:"text-amber-800",children:[e.jsx("strong",{children:"Let op:"})," Je hebt niet-opgeslagen wijzigingen."]})]}),e.jsx(c,{className:"border-0 shadow-md mb-6",children:e.jsxs(d,{className:"p-8",children:[e.jsxs("div",{className:"flex items-center mb-6",children:[e.jsx(w,{className:"h-6 w-6 text-[#a2c4c9] mr-3"}),e.jsx("h3",{className:"text-xl font-semibold text-slate-900",children:"Kun je komen?"})]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4 max-w-3xl mx-auto",children:[e.jsx(i,{type:"button",variant:"yes"===r?"default":"outline",onClick:()=>x("yes"),className:"h-16 text-left justify-start "+("yes"===r?"bg-[#8bb1b6] hover:bg-[#a2c4c9] text-white border-[#8bb1b6]":"border-2 border-slate-300 hover:border-[#8bb1b6] hover:bg-slate-50"),children:e.jsxs("div",{className:"flex items-center px-2",children:[e.jsx(_,{className:"w-6 h-6 mr-3"}),e.jsxs("div",{children:[e.jsx("div",{className:"font-medium text-base",children:"Ja, ik kom graag!"}),e.jsx("div",{className:"text-xs opacity-75 mt-0.5",children:"Ik verheug me erop"})]})]})}),e.jsx(i,{type:"button",variant:"no"===r?"default":"outline",onClick:()=>x("no"),className:"h-16 text-left justify-start "+("no"===r?"bg-[#8bb1b6] hover:bg-[#a2c4c9] text-white border-[#8bb1b6]":"border-2 border-slate-300 hover:border-[#a2c4c9] hover:bg-slate-50"),children:e.jsxs("div",{className:"flex items-center px-2",children:[e.jsx(C,{className:"w-6 h-6 mr-3"}),e.jsxs("div",{children:[e.jsx("div",{className:"font-medium text-base",children:"Nee, helaas niet"}),e.jsx("div",{className:"text-xs opacity-75 mt-0.5",children:"Ik kan niet aanwezig zijn"})]})]})})]})]})}),e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-6 mb-6",children:[e.jsx(c,{className:"border-0 shadow-md",children:e.jsxs(d,{className:"p-8",children:[e.jsxs("div",{className:"font-medium text-slate-900 flex items-center gap-2 mb-5",children:[e.jsx(E,{className:"w-6 h-6 text-[#a2c4c9]"}),e.jsx("span",{className:"text-lg",children:"Dieetwensen"})]}),e.jsx("div",{className:"mb-4",children:e.jsx(G,{active:j,onToggle:()=>{const e=!j;p(e),e&&g("")},label:"Geen dieetwensen",ariaLabel:"Geen dieetwensen"})}),e.jsx(u,{value:h,onChange:e=>g(e.target.value),placeholder:"Bijv. vegetarisch, halal, lactosevrij",disabled:j,maxLength:100,className:"border-slate-200 focus:border-[#a2c4c9] focus:ring-[#a2c4c9]"})]})}),e.jsx(c,{className:"border-0 shadow-md",children:e.jsxs(d,{className:"p-8",children:[e.jsx("div",{className:"font-medium text-slate-900 mb-5",children:e.jsx("span",{className:"text-lg",children:"Allergieën"})}),e.jsx("div",{className:"mb-4",children:e.jsx(G,{active:D,onToggle:()=>{const e=!D;R(e),e&&M("")},label:"Geen allergieën",ariaLabel:"Geen allergieën"})}),e.jsx(u,{value:k,onChange:e=>M(e.target.value),placeholder:"Bijv. noten, gluten, lactose...",disabled:D,maxLength:100,className:"border-slate-200 focus:border-[#a2c4c9] focus:ring-[#a2c4c9]"})]})}),e.jsx(c,{className:"border-0 shadow-md",children:e.jsxs(d,{className:"p-8",children:[e.jsxs("div",{className:"font-medium text-slate-900 flex items-center gap-2 mb-5",children:[e.jsx(z,{className:"w-6 h-6 text-[#a2c4c9]"}),e.jsx("span",{className:"text-lg",children:"Verzoeken"})]}),e.jsx("div",{className:"mb-4",children:e.jsx(G,{active:I,onToggle:()=>{const e=!I;T(e),e||A("")},label:"Ik heb een verzoek/opmerking",ariaLabel:"Ik heb een verzoek/opmerking"})}),I&&e.jsx(f,{value:$,onChange:e=>A(e.target.value),placeholder:"Heb je nog wensen of opmerkingen?",maxLength:500,className:"w-full h-24 border-slate-200 focus:border-[#a2c4c9] focus:ring-[#a2c4c9]"})]})})]}),e.jsx(c,{className:"border-0 shadow-md mb-6",children:e.jsxs(d,{className:"p-8",children:[e.jsxs("div",{className:"font-medium text-slate-900 flex items-center gap-2 mb-5",children:[e.jsx(S,{className:"w-6 h-6 text-[#a2c4c9]"}),e.jsxs("span",{className:"text-lg",children:["Adresgegevens ",e.jsx("span",{className:"text-base font-light text-slate-500",children:"(optioneel)"})]})]}),e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-4 mb-4",children:[e.jsx(u,{value:V,onChange:e=>F(e.target.value),placeholder:"Straat + huisnummer",maxLength:150,className:"lg:col-span-2 border-slate-200 focus:border-[#a2c4c9] focus:ring-[#a2c4c9]"}),e.jsx(u,{value:U,onChange:e=>O(e.target.value),placeholder:"1234 AB",maxLength:10,className:"border-slate-200 focus:border-[#a2c4c9] focus:ring-[#a2c4c9]"})]}),e.jsx("div",{className:"mb-4",children:e.jsx(u,{value:P,onChange:e=>q(e.target.value),placeholder:"Plaatsnaam",maxLength:100,className:"border-slate-200 focus:border-[#a2c4c9] focus:ring-[#a2c4c9]"})}),e.jsxs("div",{className:"flex items-start text-slate-600 text-sm gap-2 bg-slate-50 p-4 rounded-lg",children:[e.jsx(o,{className:"w-4 h-4 mt-0.5 flex-shrink-0"}),e.jsx("span",{className:"font-light",children:"Je antwoorden worden gekoppeld aan je e-mailadres en kunnen later worden gewijzigd."})]})]})}),e.jsxs("div",{className:"max-w-2xl mx-auto",children:[e.jsxs(i,{onClick:async()=>{H(!0);try{(await b.submitRSVP({attending:r,dietary:j?null:h.trim()||null,allergies:D?null:k.trim()||null,comments:I&&$.trim()||null,address:V.trim()||null,postal_code:U.trim()||null,city:P.trim()||null})).success&&await(l?.())}catch(e){m(e)}finally{H(!1)}},disabled:!r||W,className:"w-full h-11 text-white text-base font-medium transition-all duration-300 disabled:opacity-50 disabled:cursor-not-allowed relative "+(J&&!W?"bg-gradient-to-r from-orange-500 to-orange-600 hover:from-orange-600 hover:to-orange-700 shadow-lg shadow-orange-200":"bg-[#8bb1b6] hover:bg-[#a2c4c9]"),children:[J&&!W&&e.jsxs("span",{className:"absolute -top-1 -right-1 flex h-3 w-3",children:[e.jsx("span",{className:"animate-ping absolute inline-flex h-full w-full rounded-full bg-orange-400 opacity-75"}),e.jsx("span",{className:"relative inline-flex rounded-full h-3 w-3 bg-orange-500"})]}),W?e.jsxs(e.Fragment,{children:[e.jsx(B,{className:"w-4 h-4 mr-2 animate-spin"}),"Bezig met opslaan..."]}):e.jsxs(e.Fragment,{children:[e.jsx(L,{className:"w-4 h-4 mr-2"}),J?"Wijzigingen Opslaan":"RSVP Opslaan"]})]}),e.jsx("p",{className:"text-center text-sm text-slate-500 mt-4 font-light",children:"Je wordt na opslaan teruggeleid naar het overzicht"})]})]})]})},J=({weddingData:s,onBack:a})=>{const t=s?.messages||[],l=s?.wedding?.name||"Onze bruiloft";return e.jsxs("div",{className:"pb-12",children:[e.jsxs("div",{className:"text-center mb-12",children:[e.jsx("span",{className:"text-sm tracking-[0.3em] uppercase text-[#8b9290] font-light mb-4 block",children:"Updates & Mededelingen"}),e.jsx("h1",{className:"text-5xl md:text-6xl font-medium text-[#2c2c2c] mb-5 font-d
7ancing leading-tight",children:l}),e.jsx("p",{className:"text-lg text-[#5a5a5a] max-w-3xl mx-auto font-light leading-relaxed",children:"Hier vind je alle berichten en updates"})]}),e.jsx("div",{className:"max-w-5xl mx-auto mb-12",children:e.jsx("div",{className:"h-px bg-gradient-to-r from-transparent via-[#d4d4d4] to-transparent"})}),e.jsx("div",{className:"max-w-4xl mx-auto",children:0===t.length?e.jsx(c,{className:"border-0 shadow-md",children:e.jsxs(d,{className:"p-12 text-center",children:[e.jsx(z,{className:"h-16 w-16 text-slate-300 mx-auto mb-4"}),e.jsx("p",{className:"text-slate-500 font-light",children:"Nog geen berichten"})]})}):e.jsx("div",{className:"space-y-6",children:t.map(s=>e.jsx(K,{message:s},s.id))})})]})};
8/**
9 * @license lucide-react v0.462.0 - ISC
10 *
11 * This source code is licensed under the ISC license.
12 * See the LICENSE file in the root directory of this source tree.
13 */const K=l.memo(({message:s})=>{const a=t.useMemo(()=>new Date(s.date).toLocaleDateString("nl-NL",{weekday:"long",year:"numeric",month:"long",day:"numeric"}),[s.date]);return e.jsx(c,{className:"border-0 shadow-md hover:shadow-lg transition-shadow duration-200 "+(s.important?"border-l-4 border-l-red-500":""),children:e.jsxs(d,{className:"p-8",children:[e.jsxs("div",{className:"flex flex-col sm:flex-row sm:justify-between sm:items-start gap-3 mb-4",children:[e.jsx("h3",{className:"text-xl font-semibold text-slate-900",children:s.title}),e.jsxs("div",{className:"flex items-center gap-3 flex-shrink-0",children:[s.important&&e.jsx("span",{className:"bg-red-100 text-red-800 text-xs font-medium px-3 py-1 rounded-full",children:"Belangrijk"}),e.jsx("span",{className:"text-sm text-slate-500 font-light",children:a})]})]}),e.jsx("p",{className:"text-slate-600 whitespace-pre-wrap font-light leading-relaxed [&_strong]:font-semibold [&_strong]:text-slate-800",children:(l=s.message||"",l.split(/\*\*(.+?)\*\*/g).map((s,a)=>a%2==1?e.jsx("strong",{children:s},a):s))})]})});var l}),Z=({open:s,onClose:a,presentId:l,presentTitle:n,weddingName:r,payment:c,onContributed:d})=>{const o=`${n} - ${r}`,m=c?.iban||c?.link,[h,g]=t.useState(""),[j,p]=t.useState(!1),[f,N]=t.useState(!1),[v,w]=t.useState(null);t.useEffect(()=>{s&&(g(b.getCurrentSession()?.guestInfo.name??""),p(!1),N(!1),w(null))},[s]);return e.jsx(D,{open:s,onOpenChange:a,children:e.jsxs(R,{className:"sm:max-w-lg",children:[e.jsxs($,{children:[e.jsx(A,{className:"text-[#8bb1b6]",children:"Bijdragen"}),e.jsxs(I,{className:"sr-only",children:["Betaalinformatie voor ",n]})]}),e.jsx("p",{className:"text-sm font-semibold text-slate-800 -mt-1",children:n}),m?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"space-y-3",children:[e.jsx("p",{className:"text-sm text-slate-500 leading-relaxed",children:"Wat leuk dat je wil bijdragen! Maak je bijdrage over via onderstaande gegevens en vermeld de omschrijving zodat het bruidspaar ziet voor welk cadeau je bijdraagt."}),c.link&&e.jsxs(i,{className:"w-full bg-[#8bb1b6] hover:bg-[#a2c4c9] text-white gap-2",onClick:()=>{const e=c.link.startsWith("http")?c.link:`https://${c.link}`;window.open(e,"_blank","noopener,noreferrer")},children:[e.jsx(U,{className:"h-4 w-4"}),"Open betaalverzoek"]}),c.iban&&e.jsxs("div",{className:"bg-slate-50 rounded-lg p-3 space-y-2",children:[e.jsx("p",{className:"text-xs font-semibold uppercase tracking-wide text-slate-500",children:"Bankgegevens"}),e.jsx(Q,{label:"IBAN",value:c.iban}),c.name&&e.jsx(Q,{label:"Naam",value:c.name})]}),e.jsxs("div",{className:"bg-slate-50 rounded-lg p-3 space-y-2",children:[e.jsx("p",{className:"text-xs font-semibold uppercase tracking-wide text-slate-500",children:"Omschrijving overschrijving"}),e.jsx(Q,{label:"",value:o})]})]}),e.jsxs("div",{className:"border-t border-slate-100 pt-3 space-y-2",children:[e.jsx("p",{className:"text-xs text-slate-500 leading-relaxed",children:"Heb je bijgedragen? Laat het weten — anderen zien dan dat dit cadeau al bijdragers heeft en kunnen hun keuze daarop afstemmen."}),f?e.jsxs("div",{className:"flex items-center gap-2 text-sm text-green-600 font-medium py-1",children:[e.jsx(_,{className:"h-4 w-4 flex-shrink-0"}),"Bijdrage geregistreerd, bedankt!"]}):e.jsxs(e.Fragment,{children:[e.jsx(u,{value:h,onChange:e=>g(e.target.value),placeholder:"Bijv. Jan & Marie of Familie de Vries",className:"text-sm"}),v&&e.jsx("p",{className:"text-xs text-red-600",children:v})]})]}),e.jsxs("div",{className:"flex gap-3",children:[e.jsx(i,{variant:"outline",className:"flex-1",onClick:a,children:"Sluiten"}),!f&&e.jsxs(i,{variant:"outline",className:"flex-1 gap-2 border-[#8bb1b6] text-[#8bb1b6] hover:bg-[#8bb1b6]/10",onClick:async()=>{p(!0),w(null);const e=await b.markContribution(l,h);p(!1),e.success?(N(!0),d?.()):w(e.error??"Er ging iets mis")},disabled:j||!h.trim(),children:[j?e.jsx(B,{className:"h-4 w-4 animate-spin"}):e.jsx(x,{className:"h-4 w-4"}),"Ik heb bijgedragen"]}),f&&e.jsx(i,{className:"flex-1 bg-[#8bb1b6] hover:bg-[#a2c4c9] text-white",onClick:a,children:"Sluiten"})]})]}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"py-6 text-center space-y-3",children:[e.jsx(T,{className:"h-9 w-9 text-slate-400 mx-auto"}),e.jsx("p",{className:"text-sm text-slate-500 leading-relaxed",children:"Het bruidspaar heeft nog geen betaalinfo ingesteld. Probeer het later opnieuw."})]}),e.jsx(i,{variant:"outline",className:"w-full",onClick:a,children:"Sluiten"})]})]})})},Q=({label:s,value:a})=>{const[l,n]=t.useState(!1);return e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsxs("div",{className:"min-w-0",children:[s&&e.jsx("p",{className:"text-xs text-slate-500 mb-0.5",children:s}),e.jsx("p",{className:"text-sm font-medium text-slate-800 break-all",children:a})]}),e.jsx("button",{onClick:async()=>{try{await navigator.clipboard.writeText(a),n(!0),setTimeout(()=>n(!1),2e3)}catch{}},className:"flex-shrink-0 p-1.5 rounded-md bg-white text-slate-400 hover:text-[#8bb1b6] transition-colors",title:"Kopieer",children:l?e.jsx(_,{className:"h-4 w-4 text-green-500"}):e.jsx(V,{className:"h-4 w-4"})})]})};const X=({weddingData:s,onRefresh:a,loading:l})=>{const n=s?.presents||[],r=s?.wedding?.name||"Onze bruiloft",o=s?.payment??{iban:null,name:null,link:null},[m,x]=t.useState(!1),[g,j]=t.useState(null),[b,p]=t.useState(!1),u=t.useCallback(e=>{j(e),x(!0)},[]),f=t.useCallback(async()=>
13{if(a){p(!0);try{await a()}finally{p(!1)}}},[a]);return e.jsxs("div",{className:"pb-12",children:[e.jsxs("div",{className:"text-center mb-12",children:[e.jsx("span",{className:"text-sm tracking-[0.3em] uppercase text-[#8b9290] font-light mb-4 block",children:"Cadeaulijst"}),e.jsx("h1",{className:"text-5xl md:text-6xl font-medium text-[#2c2c2c] mb-5 font-dancing leading-tight",children:r}),s?.wedding?.intro_presents?e.jsx("p",{className:"text-lg text-[#5a5a5a] max-w-3xl mx-auto font-light leading-relaxed",children:s.wedding.intro_presents}):0===n.length?e.jsx("p",{className:"text-base text-[#8b9290] font-light",children:"Er zijn nog geen cadeaus ingevuld door het bruidspaar."}):null]}),e.jsx("div",{className:"max-w-5xl mx-auto mb-12",children:e.jsx("div",{className:"h-px bg-gradient-to-r from-transparent via-[#d4d4d4] to-transparent"})}),a&&e.jsx("div",{className:"max-w-5xl mx-auto mb-6 flex justify-end",children:e.jsxs(i,{variant:"outline",size:"sm",onClick:f,disabled:b,className:"gap-2",children:[e.jsx(h,{className:"h-4 w-4 "+(b?"animate-spin":"")}),"Vernieuwen"]})}),l?e.jsx("div",{className:"flex justify-center py-16",children:e.jsx(B,{className:"h-8 w-8 text-[#8bb1b6] animate-spin"})}):0===n.length?e.jsx(c,{className:"max-w-2xl mx-auto border-0 shadow-md",children:e.jsxs(d,{className:"p-12 text-center",children:[e.jsx(k,{className:"h-16 w-16 text-slate-300 mx-auto mb-4"}),e.jsx("p",{className:"text-slate-500 font-light",children:"Nog geen cadeaus toegevoegd"})]})}):e.jsx("div",{className:"grid md:grid-cols-2 lg:grid-cols-3 gap-6 max-w-7xl mx-auto",children:n.map(s=>e.jsx(ee,{present:s,onContribute:()=>u(s)},s.id))}),g&&e.jsx(Z,{open:m,onClose:()=>{x(!1),j(null)},presentId:g.id,presentTitle:g.title,weddingName:r,payment:o,onContributed:a})]})},Y=({initials:s,name:a})=>e.jsx("div",{className:"w-8 h-8 rounded-full bg-[#8bb1b6] flex items-center justify-center -ml-2 first:ml-0 border-2 border-white",title:a,children:e.jsx("span",{className:"text-white text-xs font-semibold",children:s})}),ee=l.memo(({present:s,onContribute:a})=>{const l=s.contributors||[],n=l.slice(0,3),r=Math.max(0,l.length-3),[o,m]=t.useState(!1),x=s.image_url?s.image_url.startsWith("http")?s.image_url:`https://gjdtchvctgopcnmjxavh.supabase.co/storage/v1/object/public/presents/${s.image_url}`:null;return e.jsx(c,{className:"border-0 shadow-md hover:shadow-lg transition-shadow duration-200",children:e.jsx(d,{className:"p-6",children:e.jsxs("div",{className:"flex flex-col gap-4",children:[x&&!o?e.jsx("img",{src:x,alt:s.title,className:"w-full h-48 object-cover rounded-lg",loading:"lazy",onError:()=>m(!0)}):e.jsx("div",{className:"w-full h-48 bg-gradient-to-br from-slate-100 to-slate-200 rounded-lg flex items-center justify-center",children:e.jsx(k,{className:"h-12 w-12 text-slate-400"})}),e.jsxs("div",{className:"flex-1",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[e.jsx("span",{className:"text-slate-500 text-sm",children:"Bijdragers:"}),0===l.length?e.jsx("span",{className:"text-slate-400 text-sm italic",children:"nog geen bijdragen"}):e.jsxs("div",{className:"flex items-center",children:[n.map((s,a)=>e.jsx(Y,{initials:s.initials,name:s.name},`${s.name}-${a}`)),r>0&&e.jsx("div",{className:"w-8 h-8 rounded-full bg-slate-400 flex items-center justify-center -ml-2 border-2 border-white",title:`${r} meer`,children:e.jsxs("span",{className:"text-white text-xs font-semibold",children:["+",r]})})]})]}),e.jsx("h3",{className:"text-xl font-semibold mb-2 text-[#8bb1b6]",children:s.title}),e.jsx("p",{className:"text-slate-600 mb-4 text-sm font-light leading-relaxed line-clamp-3",children:s.description}),e.jsx(i,{className:"w-full py-3 rounded-lg font-medium transition-colors bg-[#8bb1b6] hover:bg-[#a2c4c9] text-white",onClick:a,children:"Bijdragen"})]})]})})})});ee.displayName="PresentCard";function se(e){return e?e.startsWith("http")?e:`https://gjdtchvctgopcnmjxavh.supabase.co/storage/v1/object/public/wedding_info_photo/${e}`:null}function ae(e,s){return!e||0===e.length||!e.includes("Verborgen")&&(!!e.includes("Alles")||(!(0!==s.length&&!s.some(e=>"alles"===e.toLowerCase()))||e.some(e=>s.some(s=>s.toLowerCase()===e.toLowerCase()))))}const te=()=>{const a=s(),[l,n]=t.useState({loading:!0,error:null}),[i,r]=t.useState(null),[c,d]=t.useState("dashboard"),[o,x]=t.useState(!1),[h,g]=t.useState(!1),j=t.useCallback(async(e=!1,s=!0)=>{try{n({loading:!0,error:null});const a=await b.getWeddingData(e,s);r(a),s&&x(!0),n({loading:!1,error:null})}catch(t){m(t);const e=t instanceof Error?t.message:"Kon bruiloftgegevens niet laden";if(e.includes("Refresh de pagina"))return void a("/uitnodiging",{replace:!0});n({loading:!1,error:e})}},[a]);t.useEffect(()=>{j(!1,!1)},[j]);const p=t.useCallback(async()=>{o||(g(!0),await j(!0,!0),g(!1))},[o,j]),u=t.useCallback(e=>
13{d(e),"messages"!==e&&"gifts"!==e||o||p()},[p,o]);if(l.loading)return e.jsx(xe,{});if(l.error)return e.jsx(he,{error:l.error,onRetry:()=>a("/uitnodiging")});const f=i?.wedding,N=i?.guest,v=i?.wedding_info;return e.jsxs("div",{className:"min-h-screen bg-gradient-to-br from-slate-50 via-white to-slate-50",children:[e.jsx(W,{showBackButton:"dashboard"!==c,title:"rsvp"===c?"RSVP":"messages"===c?"Berichten":"gifts"===c?"Cadeaulijst":void 0,onBack:()=>d("dashboard")}),e.jsx("div",{className:"max-w-5xl mx-auto px-4 py-6 pt-24",children:"dashboard"===c?e.jsx(le,{wedding:f,guest:N,weddingInfo:v,onNavigate:u}):"rsvp"===c?e.jsx(H,{weddingData:i,onBack:()=>d("dashboard"),onUpdate:async()=>{await j(!0,o),d("dashboard")}}):"gifts"===c?e.jsx(X,{weddingData:i,onBack:()=>d("dashboard"),onRefresh:()=>j(!0,!0),loading:h}):"messages"===c?e.jsx(J,{weddingData:i,onBack:()=>d("dashboard")}):null})]})},le=l.memo(({wedding:s,guest:a,weddingInfo:l,onNavigate:n})=>{const r=t.useMemo(()=>s?.date?new Date(s.date).toLocaleDateString("nl-NL",{weekday:"long",year:"numeric",month:"long",day:"numeric"}):"Datum volgt nog",[s?.date]),o=t.useMemo(()=>a?.part&&Array.isArray(a.part)?a.part:[],[a?.part]),m=t.useMemo(()=>{const e={aanwezig:{label:"Aanwezig",icon:_,color:"text-emerald-600",bgColor:"bg-emerald-50 border-emerald-200"},afwezig:{label:"Afwezig",icon:C,color:"text-red-600",bgColor:"bg-red-50 border-red-200"},uitgenodigd:{label:"Nog niet gereageerd",icon:q,color:"text-amber-600",bgColor:"bg-amber-50 border-amber-200"}};return e[a?.rsvp_status||"uitgenodigd"]||e.uitgenodigd},[a?.rsvp_status]);return e.jsxs(e.Fragment,{children:[e.jsx(me,{}),e.jsxs("div",{className:"text-center mb-12",children:[e.jsxs("span",{className:"text-sm tracking-[0.3em] uppercase text-[#8b9290] font-light mb-4 block",children:["Welkom ",a?.name]}),e.jsx("h1",{className:"text-5xl md:text-6xl font-medium text-[#2c2c2c] mb-5 font-dancing leading-tight",children:s?.name||"Onze Bruiloft"}),e.jsxs("div",{className:"flex items-center justify-center space-x-2 text-xl text-[#5a5a5a] mb-6",children:[e.jsx(w,{className:"h-5 w-5"}),e.jsx("span",{children:r})]}),o.length>0&&e.jsxs("div",{className:"inline-flex items-center px-5 py-2.5 bg-[#a2c4c9]/10 rounded-full text-sm text-[#5a5a5a] border border-[#a2c4c9]/20",children:[e.jsx(O,{className:"h-4 w-4 mr-2 text-[#a2c4c9]"}),o.some(e=>"alles"===e.toLowerCase())?e.jsx("span",{className:"font-medium",children:"Uitgenodigd voor: de hele dag"}):e.jsxs(e.Fragment,{children:["Uitgenodigd voor: ",e.jsx("span",{className:"font-medium ml-1",children:o.join(", ")})]})]})]}),e.jsx("div",{className:"max-w-3xl mx-auto mb-12",children:e.jsx("div",{className:"h-px bg-gradient-to-r from-transparent via-[#d4d4d4] to-transparent"})}),se(l?.image_url)&&e.jsx("div",{className:"mb-8",children:e.jsx("img",{src:se(l.image_url),alt:"Welkomstfoto",className:"w-full rounded-xl object-cover shadow-md",style:{aspectRatio:"15/8"}})}),l?.welcome_message&&e.jsx(c,{className:"mb-8 border-0 shadow-md",children:e.jsx(d,{className:"p-8 text-center",children:e.jsxs("p",{className:"text-lg text-slate-700 leading-relaxed italic font-light",children:['"',l.welcome_message,'"']})})}),"uitgenodigd"===a?.rsvp_status?e.jsx(c,{className:`mb-8 border-2 ${m.bgColor}`,children:e.jsx(d,{className:"p-4",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center space-x-3",children:[e.jsx(m.icon,{className:`h-5 w-5 ${m.color}`}),e.jsxs("div",{children:[e.jsx("h3",{className:"font-semibold text-slate-900",children:"RSVP Status"}),e.jsx("p",{className:`text-sm ${m.color}`,children:m.label})]})]}),e.jsx(i,{onClick:()=>n("rsvp"),size:"sm",className:"bg-[#8bb1b6] hover:bg-[#a2c4c9]",children:"Reageren"})]})})}):e.jsxs("div",{className:"flex items-center justify-between mb-6 p-3 rounded-lg bg-slate-50",children:[e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(m.icon,{className:`h-4 w-4 ${m.color}`}),e.jsx("span",{className:`text-sm font-medium ${m.color}`,children:m.label})]}),e.jsx(i,{onClick:()=>n("rsvp"),variant:"ghost",size:"sm",className:"text-xs text-slate-600 hover:text-[#8bb1b6]",children:"Wijzigen"})]}),e.jsxs("div",{className:"grid md:grid-cols-3 gap-4 mb-8",children:[e.jsx(ce,{icon:_,title:"RSVP & Dieetwensen",description:"Reageer op de uitnodiging",onClick:()=>n("rsvp")}),e.jsx(ce,{icon:z,title:"Berichten",description:"Updates van het bruidspaar",onClick:()=>n("messages")}),e.jsx(ce,{icon:k,title:"Cadeaulijst",description:"Bekijk onze wensen",onClick:()=>n("gifts")})]}),e.jsxs("div",{className:"space-y-6 mb-8",children:[l?.ceremonie_enabled&&ae(["Ceremonie"],o)&&e.jsx(ne,{title:"Ceremonie",time:l.ceremonie_time||void 0,dresscode:l.ceremonie_dresscode||void 0,venue:l.ceremonie_venue||void 0,address:l.ceremonie_address||void 0}),l?.receptie_enabled&&ae(["Receptie"],o)&&e.jsx(ne,{title:"Receptie",time:l.receptie_time||void 0,dresscode:l.receptie_dresscode||void 0,venue:l.receptie_venue||void 0,address:l.receptie_address||void 0}),l?.lunch_enabled&&ae(["Lunch"],o)&&e.jsx(ne,{title:"Lunch",time:l.lunch_time||void 0,dresscode:l.lunch_dresscode||void 0,venue:l.lunch_venue||void 0,address:l.lunch_address||void 0}),l?.diner_enabled&&ae(["Diner"],o)&&e.jsx(ne,{title:"Diner",time:l.diner_time||void 0,dresscode:l.diner_dresscode||void 0,venue:l.diner_venue||void 0,address:l.diner_address||void 0}),l?.feest_enabled&&ae(["Feest"],o)&&e.jsx(ne,{title:"Feest",time:l.feest_time||void 0,dresscode:l.feest_dresscode||void 0,venue:l.feest_venue||void 0,address:l.feest_address||void 0})]}),l?.extra_info_enabled&&l.extra_info&&ae(l.extra_info_visible_for,o)&&e.jsx(de,{info:l.extra_info}),(l?.contact_info||l?.email||l?.phone)&&e.jsx(re,{weddingInfo:l}),l?.extra_photo_enabled&&ae(l.extra_photo_visible_for,o)&&se(l.extra_photo_url)&&e.jsx(oe,{photoUrl:se(l.extra_photo_url)})]})}),ne=l.memo(({title:s,time:a,dresscode:t,venue:l,address:n})=>e.jsxs(c,{className:"border-0 shadow-md",children:[e.jsx(g,{className:"bg-[#a2c4c9] text-white rounded-t-lg py-4",children:e.jsx(j,{className:"text-lg font-light tracking-wide",children:s})}),e.jsx(d,{className:"p-6",children:e.jsxs("div",{className:"grid md:grid-cols-2 gap-6",children:[e.jsxs("div",{className:"space-y-4",children:[a&&e.jsx(ie,{icon:T,label:"Tijd",content:a}),l&&e.jsx(ie,{icon:S,label:"Locatie",content:l}),t&&e.jsx(ie,{icon:F,label:"Dresscode",content:t})]}),n&&e.jsx("div",{className:"space-y-4",children:e.jsxs("div",{children:[e.jsxs("h4",{className:"font-semibold text-slate-900 mb-2 flex items-center",children:[e.jsx(S,{className:"h-4 w-4 mr-2"}),"Adres"]}),e.jsx("p",{className:"text-slate-600 mb-3",children:n}),e.jsxs(i,{variant:"outline",size:"sm",onClick:()=>window.open(`https://maps.google.com/?q=${encodeURIComponent(n)}`,"_blank"),className:"flex items-center space-x-2",children:[e.jsx(S,{className:"h-4 w-4"}),e.jsx("span",{children:"Bekijk op kaart"})]})]})})]})})]})),ie=l.memo(({icon:s,label:a,content:t})=>e.jsxs("div",{children:[e.jsxs("h4",{className:"font-semibold text-slate-900 mb-2 flex items-center",children:[e.jsx(s,{className:"h-4 w-4 mr-2"}),a]}),e.jsx("p",{className:"text-slate-600",children:t})]})),re=l.memo(({weddingInfo:s})=>e.jsxs(c,{className:"mb-8 border-0 shadow-md",children:[e.jsx(g,{className:"bg-[#a2c4c9] text-white rounded-t-lg py-4",children:e.jsx(j,{className:"text-lg font-light tracking-wide",children:"Contact & Vragen"})}),e.jsxs(d,{className:"p-6 text-center",children:[s.contact_info&&e.jsx("p",{className:"text-slate-600 mb-6 font-light",children:s.contact_info}),e.jsxs("div",{className:"flex flex-col sm:flex-row justify-center items-center gap-4",children:[s.email&&e.jsxs(i,{variant:"outline",onClick:()=>window.open(`mailto:${s.email}`,"_blank"),className:"flex items-center space-x-2",children:[e.jsx(o,{className:"h-4 w-4"}),e.jsx("span",{children:s.email})]}),s.phone&&e.jsxs(i,{variant:"outline",onClick:()=>window.open(`tel:${s.phone}`,"_blank"),className:"flex items-center space-x-2",children:[e.jsx(P,{className:"h-4 w-4"}),e.jsx("span",{children:s.phone})]})]})]})]})),ce=l.memo(({icon:s,title:a,description:t,onClick:l})=>e.jsx(c,{className:"cursor-pointer transition-all duration-200 hover:shadow-lg hover:scale-105 border-0 shadow-md",onClick:l,children:e.jsxs(d,{className:"p-6 text-center",children:[e.jsx(s,{className:"h-8 w-8 text-[#a2c4c9] mx-auto mb-3"}),e.jsx("h3",{className:"font-semibold text-slate-900 mb-2",children:a}),e.jsx("p",{className:"text-sm text-slate-600 font-light",children:t})]})})),de=l.memo(({info:s})=>(s.split(/\n{2,}/).map(e=>
13e.replace(/\n/g," ").trim()).filter(Boolean),e.jsxs(c,{className:"mb-8 border-0 shadow-md",children:[e.jsx(g,{className:"bg-[#a2c4c9] text-white rounded-t-lg py-4",children:e.jsx(j,{className:"text-lg font-light tracking-wide",children:"Overige informatie"})}),e.jsx(d,{className:"p-6",children:e.jsx("p",{className:"text-slate-600 whitespace-pre-wrap leading-none",children:s})})]}))),oe=l.memo(({photoUrl:s})=>e.jsx("div",{className:"mb-8",children:e.jsx("img",{src:s,alt:"Extra foto",className:"w-full rounded-xl object-cover shadow-md",style:{aspectRatio:"15/8"}})})),me=l.memo(()=>e.jsx(c,{className:"bg-gradient-to-r from-[#a2c4c9]/10 to-[#8bb1b6]/10 border-[#8bb1b6]/20 mb-8",children:e.jsx(d,{className:"p-8 text-center",children:e.jsxs("div",{className:"max-w-2xl mx-auto",children:[e.jsx("h3",{className:"text-2xl font-semibold text-slate-900 mb-4 font-light",children:"Download de app voor de volledige ervaring"}),e.jsx("p",{className:"text-slate-600 mb-6 font-light",children:"Met de TrouwAssistent app krijg je toegang tot foto's uploaden, pushnotificaties en leuke voorpret momenten."}),e.jsxs("div",{className:"flex flex-col sm:flex-row justify-center gap-2",children:[e.jsxs("a",{href:"https://apps.apple.com/nl/app/trouwassistent/id6758988622",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center justify-center gap-2 px-5 py-2.5 bg-black text-white text-sm font-medium rounded-[15px] hover:bg-gray-800 transition-colors",children:[e.jsx("svg",{className:"h-5 w-5",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M18.71 19.5c-.83 1.24-1.71 2.45-3.05 2.47-1.34.03-1.77-.79-3.29-.79-1.53 0-2 .77-3.27.82-1.31.05-2.3-1.32-3.14-2.53C4.25 17 2.94 12.45 4.7 9.39c.87-1.52 2.43-2.48 4.12-2.51 1.28-.02 2.5.87 3.29.87.78 0 2.26-1.07 3.8-.91.65.03 2.47.26 3.64 1.98-.09.06-2.17 1.28-2.15 3.81.03 3.02 2.65 4.03 2.68 4.04-.03.07-.42 1.44-1.38 2.83M13 3.5c.73-.83 1.94-1.46 2.94-1.5.13 1.17-.34 2.35-1.04 3.19-.69.85-1.83 1.51-2.95 1.42-.15-1.15.41-2.35 1.05-3.11z"})}),"App Store"]}),e.jsxs("a",{href:"https://play.google.com/store/apps/details?id=nl.trouwassistent.app&hl=nl",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center justify-center gap-2 px-5 py-2.5 bg-[#8bb1b6] text-white text-sm font-medium rounded-[15px] hover:bg-[#a2c4c9] transition-colors",children:[e.jsx("svg",{className:"h-5 w-5",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M3.18 23.76c.3.17.64.22.98.15l12.08-6.98-2.54-2.54-10.52 9.37zM.54 1.03C.2 1.38 0 1.94 0 2.67v18.67c0 .73.2 1.29.54 1.63l.09.08 10.46-10.46v-.25L.63.95l-.09.08zM20.38 10.43l-2.9-1.68-2.85 2.85 2.85 2.85 2.92-1.68c.83-.48.83-1.27-.02-1.34zM3.18.24l12.08 6.98-2.54 2.54L2.2.39c.34-.07.68-.02.98-.15z"})}),"Google Play"]})]})]})})})),xe=l.memo(()=>e.jsx("div",{className:"min-h-screen bg-gradient-to-br from-slate-50 via-white to-slate-50 flex items-center justify-center",children:e.jsxs("div",{className:"text-center",children:[e.jsx(x,{className:"h-12 w-12 text-[#a2c4c9] mx-auto mb-4 animate-pulse"}),e.jsx("p",{className:"text-slate-600",children:"Laden..."})]})})),he=l.memo(({error:s,onRetry:a})=>e.jsx("div",{className:"min-h-screen bg-gradient-to-br from-slate-50 via-white to-slate-50 flex items-center justify-center p-4",children:e.jsx(c,{className:"max-w-md w-full",children:e.jsxs(d,{className:"p-6 text-center",children:[e.jsx(C,{className:"h-12 w-12 text-red-500 mx-auto mb-4"}),e.jsx("p",{className:"text-slate-600 mb-4",children:s}),e.jsx(i,{onClick:a,className:"bg-[#8bb1b6] hover:bg-[#a2c4c9]",children:"Opnieuw proberen"})]})})}));export{te 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.