1import{r as h,j as e}from"./index-CldD1EfH.js";import{N as _,F as E}from"./Footer-BmByuyxg.js";import{SvgImg as B,InteractiveClock as C}from"./parts-B-FWye5u.js";import{T as i}from"./TaxonomyText-B0Kf4RlW.js";import{orderMembers as F,isParentMember as k,isChildMember as S,isAutoChainName as D,FamilyAboutModal as T}from"./Family-DJetJK-4.js";import{b as A}from"./api-Bkhx3evP.js";import{a as v}from"./auth-session-D9wwO7C2.js";import"./ArchetypeModal-DZNCDSMB.js";import"./archetypes-CVeXX8zQ.js";import"./sanitize-svg-BWH2CyTi.js";function L({viewerProfileId:u}){const[j,b]=h.useState(!1),[x,a]=h.useState(""),[o,n]=h.useState(null);async function g(l){l.preventDefault();const f=v();if(!f||!u){n("auth");return}n("sending");try{const m=await fetch(`/api/profiles/${u}/conversation-request`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${f}`},body:JSON.stringify({message:x})});m.status===409?n("requested"):m.status===401?n("auth"):m.ok?n("sent"):n("error")}catch{n("error")}}return e.jsxs("div",{className:"text-center print-hide mb-10",children:[e.jsx("h2",{className:"font-['Lora'] text-2xl sm:text-3xl text-[#1E1B17] mb-5 font-bold",children:"What's Next"}),e.jsxs("div",{className:"max-w-xl mx-auto bg-white rounded-[12px] p-5 shadow-[0_2px_12px_rgba(0,0,0,0.06)] text-left",children:[e.jsx("h3",{className:"font-['Lora'] text-base font-semibold text-[#1E1B17] mb-2",children:"Talk It Through With the Founder"}),o==="sent"?e.jsx("p",{className:"text-[15px] text-[#009F81] font-semibold",children:"Request sent. Edward will email you personally to set up a time."}):o==="requested"?e.jsx("p",{className:"text-[15px] text-[#C49A3C]",children:"You've already requested a conversation. Edward will be in touch."}):j?e.jsxs("form",{onSubmit:g,children:[e.jsx("p",{className:"text-[14px] text-[#6B7D6A] mb-2",children:"Share a few times that work for you, and anything you'd like to focus on. No email leaves this page; Edward replies to you personally."}),e.jsx("textarea",{required:!0,rows:3,maxLength:1e3,placeholder:"Weekday evenings work best for me...",value:x,onChange:l=>a(l.target.value),className:"w-full px-3 py-2 rounded-lg border border-[#EDE8DE] bg-[#F5F0E8] text-base text-[#1E1B17] mb-2 focus:outline-none focus:border-[#8B5E3C]"}),e.jsx("button",{type:"submit",disabled:o==="sending",className:"w-full px-4 py-2 rounded-lg bg-[#8B5E3C] text-white text-[14px] font-semibold hover:bg-[#724D30] transition-colors cursor-pointer disabled:opacity-60",children:o==="sending"?"Sending...":"Send Request"}),o==="error"&&e.jsx("p",{className:"text-[13px] text-red-600 mt-1",children:"Something went wrong. Try again."}),o==="auth"&&e.jsxs("p",{className:"text-[13px] text-[#8B5E3C] mt-1",children:["To send this, sign in at ",e.jsx("a",{href:"/home",className:"underline",children:"your FruitPile home"})," with the email you used for your profile, then come back to this page and send again."]})]}):e.jsxs("div",{children:[e.jsx("p",{className:"text-[16px] text-[#1E1B17] mb-3",children:"A real conversation about what your family's report surfaced: what resonated, what surprised you, and what to do with it together. Free, about 30 minutes."}),e.jsx("button",{onClick:()=>b(!0),className:"w-full px-4 py-2 rounded-lg bg-white text-[#8B5E3C] text-[14px] font-semibold border border-[#8B5E3C] hover:bg-[#F5F0E8] transition-colors cursor-pointer",children:"Request a Conversation"})]})]})]})}function Y({data:u,fullReportUrl:j,demo:b}){const{familyName:x,family:a,members:o,comparisons:n,groupFamilySvg:g}=u,l=F(o),[f,m]=h.useState(!1),[y,w]=h.useState(null);h.useEffect(()=>{b||!v()||A("/api/profiles/me",{handle401:!1}).then(t=>w(t?.profileId?t:null)).catch(()=>{})},[]),document.title=`${x}: Family Summary | FruitPile`;function N(t,s){return n.find(r=>r.profileAId===t&&r.profileBId===s||r.profileAId===s&&r.profileBId===t)}const d=l.filter(k),c=l.filter(S);return e.jsxs("div",{className:"bg-[#F5F0E8] min-h-screen font-sans",children:[e.jsx(_,{}),e.jsx("article",{className:"py-10",children:e.jsxs("div",{className:"mx-auto px-6 max-w-4xl",children:[e.jsxs("div",{className:"mb-10 print-page-after",children:[e.jsxs("div",{className:"text-center mb-10",children:[e.jsx("p",{className:"text-[16px] font-semibold tracking-[2px] text-[#6B7D6A] mb-3 uppercase",children:"Family Summary"}),e.jsx("nav",{className:"print-hide flex flex-wrap justify-center gap-2 mb-6","aria-label":"Report actions",children:e.jsx("button",{onClick:()=>m(!0),className:"px-3.5 py-1.5 rounded-full bg-white shadow-[0_1px_6px_rgba(0,0,0,0.06)] text-[13px] font-semibold text-[#8B5E3C] hover:shadow-[0_2px_10px_rgba(139,94,60,0.15)] transition-all cursor-pointer",children:"Report Info"})}),!D(x,l)&&e.jsx("h1",{className:"font-['Lora'] text-5xl text-[#1E1B17] mb-4 font-bold",children:x}),e.jsx("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4 mb-8 max-w-4xl mx-auto",children:l.map(t=>e.jsxs("div",{className:"bg-white rounded-[10px] shadow-[0_2px_12px_rgba(0,0,0,0.06)] px-4 py-3 text-center",children:[e.jsx("p",{className:"text-[20px] text-[#1E1B17] font-bold",children:t.firstName}),e.jsx("p",{className:"text-[16px] text-[#8B5E3C] font-medium",children:t.archetype})]},t.id))})]}),e.jsxs("div",{className:"my-10",children:[e.jsx("h2",{className:"font-['Lora'] text-3xl text-[#1E1B17] mb-6 font-bold",children:"Contents"}),e.jsx("div",{className:"bg-white rounded-[12px] shadow-[0_6px_30px_rgba(0,0,0,0.1)] p-8",children:e.jsx("div",{className:"space-y-3",children:[a&&["s-overview","Family Overview"],["s-collective","Family Collective & Members"],["s-relationships","Key Relationships"],(a?.closing_insight||a?.closing_summary)&&["s-conclusion","Family Conclusion"]].filter(
1Boolean).map(([t,s])=>e.jsxs("a",{href:`#${t}`,className:"flex items-center justify-between py-2 border-b border-[#EDE8DE] last:border-0 hover:text-[#8B5E3C] transition-colors",children:[e.jsx("span",{className:"text-[16px] text-[#1E1B17] font-medium",children:s}),e.jsx("span",{className:"text-[16px] text-[#8B5E3C]",children:"â"})]},t))})})]}),a&&e.jsxs("div",{id:"s-overview",className:"space-y-4 scroll-mt-32",children:[[["Cognitive Diversity",a.cognitive_diversity],["Family Blind Spots",a.blind_spots]].map(([t,s])=>s?e.jsxs("div",{className:"bg-white rounded-[12px] p-5 shadow-[0_2px_12px_rgba(0,0,0,0.06)] print-avoid-break",children:[e.jsx("p",{className:"text-[16px] font-semibold text-[#6B7D6A] uppercase tracking-[1px] mb-2",children:t}),e.jsx("div",{className:"space-y-3",children:s.split(` 2 3`).map((r,p)=>e.jsx("p",{className:"text-[16px] text-[#1E1B17] leading-relaxed",children:e.jsx(i,{text:r})},p))})]},t):null),a.natural_roles&&a.natural_roles.length>0&&e.jsxs("div",{className:"bg-white rounded-[12px] p-5 shadow-[0_2px_12px_rgba(0,0,0,0.06)] print-avoid-break",children:[e.jsx("p",{className:"text-[16px] font-semibold text-[#6B7D6A] uppercase tracking-[1px] mb-2",children:"Natural Roles"}),e.jsx("div",{className:"space-y-2",children:a.natural_roles.map((t,s)=>e.jsxs("p",{className:"text-[16px] text-[#1E1B17] leading-relaxed",children:[e.jsxs("strong",{children:[t.role,":"]})," ",t.name,", ",e.jsx(i,{text:t.description})]},s))})]}),a.communication_pattern&&e.jsxs("div",{className:"bg-white rounded-[12px] p-5 shadow-[0_2px_12px_rgba(0,0,0,0.06)] print-avoid-break",children:[e.jsx("p",{className:"text-[16px] font-semibold text-[#6B7D6A] uppercase tracking-[1px] mb-2",children:"Communication Pattern"}),e.jsx("div",{className:"space-y-3",children:a.communication_pattern.split(` 4 5`).map((t,s)=>e.jsx("p",{className:"text-[16px] text-[#1E1B17] leading-relaxed",children:e.jsx(i,{text:t})},s))})]})]})]}),e.jsxs("div",{id:"s-collective",className:"mb-10 print-page-after scroll-mt-32",children:[g&&e.jsxs("div",{className:"mb-8",children:[e.jsx("h2",{className:"font-['Lora'] text-3xl text-[#1E1B17] mb-2 font-bold",children:"Family Collective"}),e.jsx("p",{className:"text-[16px] text-[#1E1B17] mb-4",children:"When the whole family works together, each person contributing their strongest dimension"}),e.jsx("div",{className:"bg-white rounded-[12px] shadow-[0_6px_30px_rgba(0,0,0,0.1)] p-4 max-w-2xl mx-auto",children:e.jsx(B,{svg:g,alt:`${x} collective cognitive architecture`,className:"w-full"})})]}),e.jsx("div",{className:"grid md:grid-cols-2 gap-4 print-summary-grid",children:l.map(t=>{const s=t.narrative?.key_insight||"";return e.jsxs("div",{className:"bg-white rounded-[12px] p-5 shadow-[0_2px_12px_rgba(0,0,0,0.06)] print-avoid-break",children:[e.jsx("div",{className:"text-center mb-3",children:e.jsx("div",{className:"max-w-[280px] mx-auto",children:e.jsx(C,{svg:t.clockSvg,alt:`${t.firstName}'s clock`,className:"w-full [&>svg]:w-full [&>svg]:h-auto"})})}),e.jsx("h3",{className:"font-['Lora'] text-lg font-bold text-[#1E1B17] text-center",children:t.firstName}),e.jsx("p",{className:"text-[16px] text-[#8B5E3C] font-medium mb-2 text-center",children:t.archetype}),s&&e.jsx("p",{className:"text-[16px] text-[#1E1B17] leading-relaxed",children:e.jsx(i,{text:s})})]},t.id)})})]}),e.jsxs("div",{id:"s-relationships",className:"mb-10 print-page-before scroll-mt-32",children:[e.jsx("h2",{className:"font-['Lora'] text-3xl text-[#1E1B17] mb-6 font-bold",children:"Key Relationships"}),d.length===2&&(()=>{const t=N(d[0].id,d[1].id),s=t?.comparison||{};return t?e.jsxs("div",{className:"mb-6 print-avoid-break",children:[e.jsxs("h3",{className:"font-['Lora'] text-xl text-[#1E1B17] mb-2 font-bold",children:[d[0].firstName," & ",d[1].firstName," · The Parents"]}),s.insight&&e.jsx("p",{className:"text-[16px] text-[#1E1B17] leading-relaxed mb-4",children:e.jsx(i,{text:s.insight})})]}):null})(),c.length>=2&&(()=>{const t=N(c[0].id,c[1].id),s=t?.comparison||{};return t?e.jsxs("div",{className:"mb-6 print-avoid-break",children:[e.jsxs("h3",{className:"font-['Lora'] text-xl text-[#1E1B17] mb-2 font-bold",children:[c[0].firstName," & ",c[1].firstName," · The Children"]}),s.insight&&e.jsx("p",{className:"text-[16px] text-[#1E1B17] leading-relaxed mb-4",children:e.jsx(i,{text:s.insight})})]}):null})(),d.length>0&&c.length>0&&e.jsxs("div",{className:"mb-6",children:[e.jsx("h3",{className:"font-['Lora'] text-xl text-[#1E1B17] mb-4 font-bold",children:"ParentâChild Connections"}),e.jsx("div",{className:"space-y-3",children:d.map(t=>c.map(s=>{const r=N(t.id,s.id),p=r?.comparison||{};return r?e.jsxs("div",{className:"bg-white rounded-[12px] p-4 shadow-[0_2px_12px_rgba(0,0,0,0.06)] print-avoid-break",children:[e.jsxs("h4",{className:"font-['Lora'] text-lg font-semibold text-[#1E1B17] mb-1",children:[t.firstName," & ",s.firstName]}),p.insight&&e.jsx("p",{className:"text-[16px] text-[#1E1B17] leading-relaxed",children:e.jsx(i,{text:p.insight})})]},`${t.id}-${s.id}`):null}))})]}),(a?.group_parents_narrative||a?.group_children_narrative||a?.group_males_narrative||a?.group_females_narrative)&&e.jsxs("div",{className:"mb-6",children:[e.jsx("h3",{className:"font-['Lora'] text-xl text-[#1E1B17] mb-4 font-bold",children:"Collective Layers"}),e.jsx("div",{className:"space-y-3",children:[["The Parents Together",a?.group_parents_narrative],["The Children Together",a?.group_children_narrative],["The Men",a?.group_males_narrative],["The Women",a?.group_females_narrative]].map(([t,s])=>s?e.jsxs("div",{className:"bg-white rounded-[12px] p-4 shadow-[0_2px_12px_rgba(0,0,0,0.06)] print-avoid-break",children:[e.jsx("h4",{className:"font-['Lora'] text-lg font-semibold text-[#1E1B17] mb-1",children:t}),e.jsx("div",{className:"space-y-3",children:s.split(` 6 7`).map((r,p)=>e.jsx("p",{className:"text-[16px] text-[#1E1B17] leading-relaxed",children:e.jsx(i,{text:r})},p))})]},t):null)})]})]}),(a?.closing_insight||a?.closing_summary)&&e.jsxs("div",{id:"s-conclusion",className:"mb-10 print-page-before scroll-mt-32",children:[e.jsx("h2",{className:"font-['Lora'] text-3xl text-[#1E1B17] mb-6 font-bold",children:"Family Conclusion"}),a.closing_insight&&e.jsxs("div",{className:"rounded-[12px] border-2 border-[#C49A3C] bg-[#EDE8DE] p-8 mb-8",children:[e.jsx("p",{className:"text-[16px] font-semibold tracking-[2px] text-[#C49A3C] mb-3 uppercase",children:"The Family"}),e.jsxs("p",{className:"font-['Lora'] text-[18px] text-[#1E1B17] leading-relaxed italic",children:['"',e.jsx(i,{text:a.closing_insight}),'"']})]}),a.closing_summary&&e.jsx("div",{className:"space-y-4 text-[16px] text-[#1E1B17] leading-relaxed",children:a.closing_summary.split(` 8 9`).map((t,s)=>e.jsx("p",{children:e.jsx(i,{text:t})},s))})]}),!b&&e.jsx(L,{viewerProfileId:y?.profileId}),e.jsx("div",{className:"text-center mb-10 print-hide",children:e.jsx("a",{href:j||`/report/${u.reportCode}`,className:"text-[#8B5E3C] font-semibold text-[18px] underline",children:"View Full Family Report"})})]})}),e.jsxs("div",{className:"text-center py-8 print-hide",children:[e.jsx("button",{onClick:()=>window.print(),className:"text-[14px] font-semibold px-6 py-3 rounded-full bg-[#8B5E3C] text-white hover:bg-[#724D30] transition-colors",children:"Save as PDF"}),e.jsx("p",{className:"text-[12px] text-[#6B7D6A] mt-2",children:`Opens your browser's print window. Choose "Save as PDF" as the destination or printer there.`})]}),f&&e.jsx(T,{onClose:()=>m(!1),summary:!0}),e.jsx(E,{}),e.jsxs("div",{className:"hidden print-footer",children:["© ",new Date().getFullYear()," FruitPile · Come home to yourself."]}
9)]})}export{Y 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.