PageSourceSearch

https://parkmotel.lovable.app/assets/EmlekOldal-BPFHEfLh.js

js parkmotel.lovable.app collected 2026-10-03 03:33:49 UTC 9,553 bytes, 1 lines download raw bytes

1import{aP as W,r as o,s as n,j as e,S as x,aC as O,H as w}from"./index-BHYV1lln.js";import{P as V}from"./progress-Dmq5EF88.js";import{C as U}from"./calendar-DzBOzRvu.js";import{M as F}from"./map-pin-DQOVX2KE.js";import{T as C}from"./tree-pine-DU9pjtxt.js";import{L as $}from"./landmark-Cx-YGJ4j.js";const K={pin_verified:"🔑",qr_login:"🔑",park_point:"📍",park_point_visit:"📍",quiz_complete:"🧠",quiz_completed:"🧠",playlist_play:"🎵",poet_chat:"📜",time_capsule_seal:"💌",time_capsule_placed:"💌",checkout:"👋",checkout_step:"👋",trail_start:"🚶",verse_listen:"📖",discovery_card:"🗺️",service_rental:"🏊",service_requested:"🏊"},Q={mester:"🏆 Irodalmi Mester",kutato:"🎓 Irodalmi Kutató",felfedezo:"📚 Irodalmi Felfedező"},X={erdei:C,fahaz:C,apartman:w,vintage:$,csaladi:w};function re(){var z,b;const{token:u}=W(),[s,D]=o.useState(null),[l,q]=o.useState([]),[A,g]=o.useState(!0),[y,h]=o.useState(null);o.useEffect(()=>{if(!u){h("Hiányzó token."),g(!1);return}E(u)},[u]);async function E(t){var a,r,i,c;try{const{data:S,error:H}=await n.from("memory_pages").select("*").eq("token",t).maybeSingle();if(H||!S){h("Ez az emlékoldal nem található vagy lejárt."),g(!1);return}const m=S,d=m.guest_id,f=m.apartment_id,[I,N,B,R,T,L,J]=await Promise.all([n.from("guests").select("name").eq("id",d).maybeSingle(),n.from("apartments").select("name, category").eq("id",f).maybeSingle(),n.from("guest_timeline").select("id, event_type, event_title, event_meta, created_at").eq("guest_id",d).order("created_at",{ascending:!0}),n.from("guest_progress").select("park_points_visited, quiz_badge").eq("guest_id",d).eq("apartment_id",f).maybeSingle(),n.from("time_capsules").select("message, mood").eq("guest_id",d).eq("apartment_id",f).maybeSingle(),n.from("park_points").select("id, number, name, category").eq("is_active",!0).is("deleted_at",null).order("sort_order"),n.from("guest_feedback").select("rating").eq("guest_id",d).eq("apartment_id",f).maybeSingle()]);q(L.data??[]),D({guest_name:((a=I.data)==null?void 0:a.name)??"Vendég",apartment_name:((r=N.data)==null?void 0:r.name)??"Apartman",apartment_category:((i=N.data)==null?void 0:i.category)??"",erkezes:m.erkezes,tavozas:m.tavozas,timeline:B.data??[],progress:R.data??null,capsule:T.data??null,feedback_rating:((c=J.data)==null?void 0:c.rating)??null,weather_summary:m.weather_summary??null})}catch{h("Hiba történt az emlékoldal betöltésekor.")}g(!1)}const j=o.useMemo(()=>{if(!(s!=null&&s.erkezes)||!s.timeline.length)return[];const t=new Date(s.erkezes).setHours(0,0,0,0),a=new Map;for(const r of s.timeline){const i=new Date(r.created_at).setHours(0,0,0,0),c=Math.max(1,Math.floor((i-t)/864e5)+1);a.has(c)||a.set(c,[]),a.get(c).push(r)}return Array.from(a.entries()).sort((r,i)=>r[0]-i[0])},[s]),M=o.useMemo(()=>!(s!=null&&s.erkezes)||!(s!=null&&s.tavozas)?1:Math.max(1,Math.round((new Date(s.tavozas).getTime()-new Date(s.erkezes).getTime())/864e5)),[s]);if(A)return e.jsx("div",{className:"min-h-screen flex items-center justify-center",style:{background:"hsl(var(--off-white, 40 30% 96%))"},children:e.jsxs("div",{className:"space-y-4 w-full max-w-md px-4",children:[e.jsx(x,{className:"h-16 w-full"}),e.jsx(x,{className:"h-40 w-full"}),e.jsx(x,{className:"h-32 w-full"})]})});if(y||!s)return e.jsx("div",{className:"min-h-screen flex items-center justify-center",style:{background:"#F5F0E8"},children:e.jsxs("div",{className:"text-center space-y-4 px-6",children:[e.jsx("p",{className:"text-4xl",children:"📜"}),e.jsx("h1",{style:{fontFamily:"'Cormorant Garamond', serif",fontSize:"1.8rem",color:"#2D5016"},children:"Emlékoldal"}),e.jsx("p",{style:{fontFamily:"'EB Garamond', serif",color:"#666"},children:y??"Nem található."})]})});const _=new Set(((z=s.progress)==null?void 0:z.park_points_visited)??[]),p=l.filter(t=>_.has(t.id)).length,k=l.length>0?Math.round(p/l.length*100):0,v=t=>new Date(t).toLocaleDateString("hu-HU",{year:"numeric",month:"long",day:"numeric"}),G=t=>{const a=new Date(t);return`${String(a.getHours()).padStart(2,"0")}:${String(a.getMinutes()).padStart(2,"0")}`},P=t=>new Date(new Date(s.erkezes).getTime()+(t-1)*864e5).toLocaleDateString("hu-HU",{month:"long",day:"numeric"});return e.jsx("div",{className:"min-h-screen",style:{background:"#F5F0E8"}
1,children:e.jsxs("div",{className:"max-w-lg mx-auto px-4 py-8 space-y-8",children:[e.jsxs("header",{className:"text-center space-y-3",children:[e.jsxs("div",{className:"flex items-center justify-center gap-3",children:[e.jsx("div",{className:"w-12 h-px",style:{background:"#C4873A"}}),e.jsx("span",{style:{fontFamily:"Jost, sans-serif",fontSize:"0.6rem",letterSpacing:"0.28em",textTransform:"uppercase",color:"#C4873A"},children:"Irodalmi Emlékoldal"}),e.jsx("div",{className:"w-12 h-px",style:{background:"#C4873A"}})]}),e.jsxs("h1",{style:{fontFamily:"'Cormorant Garamond', serif",fontSize:"clamp(1.8rem, 5vw, 2.4rem)",fontWeight:300,color:"#2D5016"},children:[s.guest_name," emlékei"]}),e.jsxs("p",{style:{fontFamily:"'EB Garamond', serif",fontSize:"1rem",color:"#666"},children:[s.apartment_name," — ",v(s.erkezes)," – ",v(s.tavozas)]}),e.jsxs("div",{className:"flex items-center justify-center gap-4 pt-1",style:{fontFamily:"Jost, sans-serif",fontSize:"0.7rem",color:"#888"},children:[e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(U,{size:12})," ",M," nap"]}),e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(F,{size:12})," ",p,"/",l.length," pont"]}),e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(O,{size:12})," ",s.timeline.length," emlék"]})]})]}),l.length>0&&p>0&&e.jsxs("section",{className:"p-5",style:{background:"white",border:"1px solid #C4873A33"},children:[e.jsx("h2",{style:{fontFamily:"'Cormorant Garamond', serif",fontSize:"1.15rem",fontWeight:300,color:"#2D5016",marginBottom:8},children:"Verspark Útlevél"}),e.jsxs("div",{className:"flex justify-between items-baseline mb-2",children:[e.jsxs("span",{style:{fontFamily:"'EB Garamond', serif",fontSize:"0.9rem",color:"#555"},children:[p," / ",l.length," állomás"]}),e.jsxs("span",{style:{fontFamily:"Jost, sans-serif",fontSize:"0.6rem",color:"#999"},children:[k,"%"]})]}),e.jsx(V,{value:k,className:"h-2 mb-3"}),((b=s.progress)==null?void 0:b.quiz_badge)&&e.jsx("p",{style:{fontFamily:"Jost, sans-serif",fontSize:"0.65rem",letterSpacing:"0.12em",textTransform:"uppercase",color:"#C4873A",marginBottom:8},children:Q[s.progress.quiz_badge]??s.progress.quiz_badge}),e.jsx("div",{className:"grid grid-cols-7 gap-1.5",children:l.map(t=>{const a=_.has(t.id),r=X[t.category]||F;return e.jsx("div",{className:"flex flex-col items-center",title:t.name,children:e.jsx("div",{className:"w-8 h-8 flex items-center justify-center",style:{borderRadius:"50%",border:a?"2px solid #4A7C2A":"1.5px dashed #ccc",background:a?"rgba(74,124,42,0.1)":"transparent"},children:e.jsx(r,{size:12,style:{color:a?"#4A7C2A":"#ccc"}})})},t.id)})})]}),j.length>0&&e.jsxs("section",{className:"space-y-5",children:[e.jsx("h2",{style:{fontFamily:"'Cormorant Garamond', serif",fontSize:"1.15rem",fontWeight:300,color:"#2D5016"},children:"Emléknapló"}),j.map(([t,a])=>e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-3 mb-2",children:[e.jsxs("span",{style:{fontFamily:"'Cormorant Garamond', serif",fontSize:"0.9rem",color:"#4A7C2A"},children:[t,". nap — ",P(t)]}),e.jsx("div",{className:"flex-1 h-px",style:{background:"#ddd"}})]}),e.jsxs("div",{className:"relative pl-6",children:[e.jsx("div",{className:"absolute left-[7px] top-1 bottom-1 w-px",style:{background:"rgba(196,135,58,0.35)"}}),e.jsx("div",{className:"space-y-2",children:a.map(r=>e.jsxs("div",{className:"flex items-start gap-2 relative",children:[e.jsx("div",{className:"absolute left-[-19px] top-[5px] w-[6px] h-[6px] rounded-full",style:{background:"#C4873A"}}),e.jsx("span",{style:{fontFamily:"Jost, sans-serif",fontSize:"0.6rem",color:"#999",width:32,flexShrink:0},children:G(r.created_at)}),e.jsx("span",{className:"text-sm",children:K[r.event_type]??"📔"}),e.jsx("span",{style:{fontFamily:"'EB Garamond', serif",fontSize:"0.9rem",color:"#555"},children:r.event_title})]},r.id))})]})]},t))]}),s.capsule&&e.jsxs("section",{className:"p-5 space-y-3",style:{background:"#faf6f0",border:"1px solid #C4873A33"},children:[e.jsx("h2",{style:{fontFamily:"'Cormorant Garamond', serif",fontSize:"1.15rem",fontWeight:300,fontStyle:"italic",color:"#2D5016"},children:"💌 Időkapszula"}),e.jsx("blockquote",{style:{fontFamily:"'EB Garamond', serif",fontSize:"1rem",lineHeight:1.75,color:"#444",borderLeft:"3px solid #C4873A55",paddingLeft:16},children:s.capsule.message})]}),s.weather_summary&&e.jsx("p",{className:"text-center",style:{fontFamily:"'EB Garamond', serif",fontSize:"0.9rem",color:"#888"},children:s.weather_summary}),e.jsxs("div",{className:"text-center space-y-4 pt-4",children:[e.jsx("div",{className:"w-16 h-px mx-auto",style:{background:"#C4873A"}}),e.jsx("p",{style:{fontFamily:"'Cormorant Garamond', serif",fontSize:"1.1rem",fontStyle:"italic",color:"#2D5016"},children:'"Ahol az ihlet életre kel."'}),e.jsx("a",{href:"/foglalas",className:"inline-block px-8 py-3 transition-opacity hover:opacity-90",style:{fontFamily:"Jost, sans-serif",fontSize:"0.7rem",letterSpacing:"0.18em",textTransform:"uppercase",background:"#2D5016",color:"white"},children:"Foglalj újra"}),e.jsx("p",{style:{fontFamily:"Jost, sans-serif",fontSize:"0.55rem",color:"#aaa",letterSpacing:"0.1em"},children:"Horizont-idéző ParkMotel · Orfű"})]})]})})}export{re 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.