PageSourceSearch

https://metamorphos.ai/assets/Reflection-C9zqu5y4.js

js metamorphos.ai collected 2026-10-05 15:40:21 UTC 31,967 bytes, 3 lines download raw bytes

1import{j as n,X as oe,h as se,u as ie,r as h,l as le,V as ce,k,W as de,H as ue,bs as he}from"./index-B84WFMzJ.js";import{B as me}from"./button-c0Tj-mto.js";import{d as D}from"./signal-cluster-f-cUrnQp.js";import{S as pe}from"./signal-scan-routes-BcYkKIMF.js";import{P as ye}from"./PastReflections-CuFAk5Uy.js";import{J as ge}from"./JungleBackground-BhiGNJRf.js";import{A as fe}from"./index-CRViiWkF.js";import{m as y}from"./proxy-BeERT6dT.js";import{F as be}from"./FieldBackdrop-XACIWFBU.js";import{L as xe}from"./LayeredFieldSphere-CoV__FE6.js";import{u as ve}from"./useHomeAction-B2p94w-A.js";import{r as we,S as _e,d as Ne,b as Le,c as Se}from"./entryContext-DgAeGxV5.js";import{S as ke,b as Te}from"./library-ddpgbsQ0.js";import"./trash-2-BU0r2nQ4.js";import"./react-three-fiber.esm-Csbh013m.js";import"./usePerformanceTier-BmB5Ourf.js";import"./extends-CF3RwP-h.js";import"./AtmosphereSpheres-CCb_vSTA.js";import"./use-mobile-TsxRQvGN.js";import"./coherence-color-progression-BkyY4ATc.js";import"./authenticated-home-DTZiUMib.js";const B={PRESSURE_PATTERN:{summary:"You seem to be carrying a lot, while still trying to stay clear and composed.",notice:"There is a quiet weight in how you are holding things — present, capable, but stretched.",friction:"Pressure may be sitting underneath the surface, shaping how your body and breath feel right now.",next:"A small pause to settle your state could create more space than another decision."},REACTIVE_SYSTEM:{summary:"You appear to be the centre of gravity right now — much depends on you to keep things moving.",notice:"Your attention seems pulled into constant decisions, leaving little room to step back.",friction:"The system around you may not yet be carrying its own weight, which keeps you in the loop.",next:"Returning to your own rhythm first can make the next move clearer."},MISALIGNMENT:{summary:"There is a clear pull toward more calm and clarity, but the current shape of things still creates pressure.",notice:"A part of you knows what alignment would feel like — it is asking to be listened to.",friction:"How things are set up may be quietly out of step with how you want to lead.",next:"A brief moment of regulation can help that signal become easier to follow."},STRETCHED:{summary:"Things feel relatively steady, with a quiet stretch underneath that you are still holding.",notice:"You are managing well — and there is a softer pull asking for some recovery.",friction:"Subtle reliance on you may be using more energy than it appears.",next:"A few minutes of breath can refresh the steadiness you already have."},LOW_SIGNAL:{summary:"Things feel a little unclear right now — that often means there has not been space to fully notice.",notice:"Your signals are present, just quieter than usual.",friction:"Without pause, it can be hard to sense what is actually shaping your day.",next:"A short, calm breath cycle can help the picture come back into focus."}};function Me(e){return B[e]??B.MISALIGNMENT}const T={coral:{h:14,s:70,l:58},amber:{h:42,s:68,l:56},green:{h:118,s:58,l:50},blue:{h:205,s:72,l:60}},I=e=>Math.max(0,Math.min(1,e));function je(e){return{coral:Math.max(0,e.activation)*1+Math.max(0,e.pressure)*1+Math.max(0,e.mentalLoad)*.55+Math.max(0,e.bodyHolding)*.35,amber:Math.max(0,e.depletion)*1.2+Math.max(0,e.recoveryNeed)*1+Math.max(0,e.supportLoad)*.5+Math.max(0,-e.selfTrust)*.3,green:Math.max(0,e.uncertainty)*.9+Math.max(0,e.systemLoad)*.6+Math.abs(e.alignment)*.45+Math.max(0,-e.boundaries)*.25,blue:Math.max(0,e.clarity)*1.2+Math.max(0,e.selfTrust)*.9+Math.max(0,e.alignment)*.7}}function Ce(e){const t=je(e),a=Object.keys(t).sort((g,b)=>t[b]-t[g]),r=a[0],s={coral:"amber",amber:"blue",green:"blue",blue:"green"};let i=a[1];(!i||i===r||t[i]<=1e-4)&&(i=s[r]);const c=I(.32+Math.max(0,e.activation)*.05+Math.max(0,e.pressure)*.05+Math.max(0,e.mentalLoad)*.035+Math.max(0,e.bodyHolding)*.025-Math.max(0,e.depletion)*.02),d=I(.42+Math.max(0,e.clarity)*.07+Math.max(0,e.selfTrust)*.06+Math.max(0,e.alignment)*.04-Math.max(0,e.pressure)*.04-Math.max(0,e.mentalLoad)*.035-Math.max(0,e.uncertainty)*.04-Math.max(0,e.bodyH
1olding)*.03),m=I(.38+Math.max(0,e.activation)*.05+Math.max(0,e.uncertainty)*.04+Math.max(0,e.mentalLoad)*.03-Math.max(0,e.depletion)*.04-Math.max(0,e.bodyHolding)*.03);return{primary:r,secondary:i,intensity:c,coherence:d,movement:m,primaryColor:T[r],secondaryColor:T[i]}}const Ae={primary:"blue",secondary:"green",intensity:.45,coherence:.62,movement:.4,primaryColor:T.blue,secondaryColor:T.green},U={light_open:{activation:-1,clarity:2,alignment:1},steady_neutral:{clarity:1},tight_heavy:{bodyHolding:3,pressure:2,recoveryNeed:2},hard_to_sense:{clarity:-2,uncertainty:2,bodyHolding:1},energised_clear:{clarity:2,alignment:2,selfTrust:1},focused_tense:{activation:2,pressure:2,bodyHolding:1},wired_stretched:{activation:3,pressure:2,recoveryNeed:2},heavy_depleted:{depletion:3,recoveryNeed:3},soft_open:{clarity:2,alignment:1,recoveryNeed:-1},steady_tired:{depletion:2,recoveryNeed:2},heavy_drained:{depletion:3,recoveryNeed:3},tight_holding:{bodyHolding:3,supportLoad:2,pressure:2},open_curious:{clarity:2,alignment:2,selfTrust:1},quiet_uncertain:{uncertainty:2,clarity:-1},restless:{activation:2,uncertainty:2},heavy_stuck:{depletion:2,uncertainty:2,bodyHolding:1},shallow:{activation:2,pressure:2,bodyHolding:1},uneven:{activation:1,uncertainty:1},steady:{clarity:2,alignment:1},deep:{clarity:2,alignment:2,recoveryNeed:-1},not_sure:{uncertainty:1,clarity:-1},held:{bodyHolding:2,pressure:2},easy:{clarity:2,alignment:1},emotional:{supportLoad:2,recoveryNeed:2},open:{clarity:2,alignment:2},fast:{mentalLoad:3,activation:2},looping:{mentalLoad:3,pressure:2},solving:{mentalLoad:3,systemLoad:2},quiet_tired:{depletion:2,recoveryNeed:2},clear:{clarity:2,mentalLoad:-1},calm:{recoveryNeed:2,activation:1},focus:{mentalLoad:2},space:{systemLoad:2,recoveryNeed:2},trust:{selfTrust:-1,uncertainty:1},energy:{depletion:2,recoveryNeed:2},clear_steady:{clarity:3,selfTrust:2,activation:-1},stretched_grounded:{pressure:1,alignment:1,selfTrust:1},overloaded:{mentalLoad:3,pressure:2},pressure:{pressure:3,mentalLoad:2},switching:{mentalLoad:3,systemLoad:2},vision:{clarity:2,alignment:2},decisions:{mentalLoad:3,systemLoad:2,pressure:2},team:{supportLoad:2,systemLoad:1},ops:{systemLoad:3},problems:{systemLoad:3,pressure:2},present:{clarity:2,alignment:2},tired_okay:{depletion:2},emotionally_full:{supportLoad:2,recoveryNeed:2},little_left:{depletion:3,recoveryNeed:3},disconnected:{clarity:-2,alignment:-2,uncertainty:2},rest:{recoveryNeed:2},support:{supportLoad:2},boundaries:{boundaries:-2,supportLoad:2},time_self:{recoveryNeed:2,boundaries:-1},changing:{uncertainty:1,alignment:1},between:{uncertainty:2,alignment:1},unclear_hopeful:{uncertainty:2,alignment:1,selfTrust:1},stuck:{depletion:2,uncertainty:2,alignment:-1},clarity:{clarity:2},purpose:{alignment:2},permission:{boundaries:-2,selfTrust:-1},next_step:{uncertainty:2},self_trust:{selfTrust:-2,uncertainty:2},too_much:{systemLoad:3,pressure:3},no_space:{systemLoad:3,pressure:2,recoveryNeed:2},others:{supportLoad:3,boundaries:-2,depletion:1},personal_energy:{depletion:3,recoveryNeed:3},decision_overload:{mentalLoad:3,systemLoad:2,pressure:2},operational_systems:{systemLoad:3},team_coordination:{systemLoad:2,supportLoad:1},growth_direction:{alignment:2,uncertainty:1},fine:{clarity:2,alignment:1,systemLoad:-1},wait:{systemLoad:1},guilty:{boundaries:-2,supportLoad:2},behind:{pressure:3,systemLoad:2},unknown:{uncertainty:1},continues:{clarity:2,alignment:2,systemLoad:-1},slows:{systemLoad:1},stalls:{systemLoad:3,pressure:2},holding:{systemLoad:3,pressure:2,depletion:1},always_available:{supportLoad:3,boundaries:-3,recoveryNeed:2},emotional_labour:{supportLoad:3,depletion:2,recoveryNeed:2},no_recovery:{recoveryNeed:3,depletion:2},responsibility:{supportLoad:2,boundaries:-1},no_stop:{boundaries:-3,recoveryNeed:2,supportLoad:2},natural:{boundaries:2,selfTrust:2},unfamiliar:{boundaries:-1,uncertainty:1},worry:{supportLoad:2,boundaries:-1},rarely:{boundaries:-3,recoveryNeed:2,depletion:1},family:{supportLoad:2},clients_work:{systemLoad:2,supportLoad:1},team_community:{supportLoad:2},relationships:{supportLoad:2},everything:{systemLoad:3,depletion:2,supportLoad:2},noise:{mentalLoad:2,uncertainty:2},options:{uncertainty:2,mentalLoad:2},fear:{uncertainty:2,selfTrust:-2},outgrown:{alignment:2,uncertainty:2,systemLoad:1},want:{clarity:1,alignment:1},change:{alignment:1},let_go:{alignment:1,recoveryNeed:1},direction:{uncertainty:1},past_future:{uncertainty:2},duty_desire:{uncertainty:2,alignment:-1},safety_growth:{uncertainty:2,selfTrust:-1,alignment:2},clarity_fear:{uncertainty:2,selfTrust:-2},paths:{uncertainty:2,mentalLoad:1},quiet_body:{recoveryNeed:2,bodyHolding:-1},less_pressure:{recoveryNeed:2,pressure:-1},rhythm:{alignment:2,recoveryNeed:1},clarity_calm:{clarity:2,recoveryNeed:1},better_systems:{systemLoad:-2},team_structure:{systemLoad:-1,supportLoad:-1},sustainable_growth:{alignment:2,systemLoad:-1},deeper_alignment:{alignment:3,selfTrust:1},recover:{recoveryNeed:3},steadiness:{alignment:1,recoveryNeed:1},confidence:{selfTrust:2},alignment:{alignment:3},chest:{},stomach:{},head_jaw:{},shoulders_neck:{},whole_body:{},no_clear_area:{},head:{},throat:{}},Ie={activation:0,depletion:0,pressure:0,mentalLoad:0,bodyHolding:0,uncertainty:0,clarity:0,selfTrust:0,boundaries:0,systemLoad:0,supportLoad:0,recoveryNeed:0,alignment:0};function Ee(e){const t={...Ie};for(const a of e){const r=U[a.answerId];
1if(r)for(const s of Object.keys(r))t[s]+=r[s]??0}return t}function He(e,t){return e==="support"&&(t.depletion>=4||t.supportLoad>=4)?"exhausted_supporter":e==="builder"&&(t.pressure>=4||t.systemLoad>=4)?"compressed_builder":e==="searching"&&t.uncertainty>=4&&t.alignment>=2?"threshold_seeker":t.activation>=4&&t.mentalLoad>=4?"cognitive_overload":t.supportLoad>=4&&t.boundaries<=-2&&t.recoveryNeed>=2?"boundary_depletion":t.depletion>=4&&t.clarity<=-1&&t.bodyHolding>=2?"protective_shutdown":e==="searching"&&t.activation<=1&&t.uncertainty>=4?"quiet_transition":t.clarity>=4&&t.alignment>=2&&t.pressure<=1?"regulated_momentum":"diffuse_pressure"}function We(e){let t="pressure",a=-1/0;return Object.keys(e).forEach(r=>{e[r]>a&&(a=e[r],t=r)}),t}function qe(e){for(let t=e.length-1;t>=0;t--)if(e[t].stage==="shift")return e[t];return null}function $e(e){const t=e.filter(s=>s.stage==="system");if(t.length===0)return null;let a=t[0],r=-1;for(const s of t){const i=U[s.answerId]??{},c=Object.values(i).reduce((d,m)=>d+Math.abs(m??0),0);c>r&&(r=c,a=s)}return a}function z(e,t){for(let a=e.length-1;a>=0;a--)if(e[a].stage===t)return e[a];return null}function E(e){return e&&e.charAt(0).toLowerCase()+e.slice(1)}const Fe={overload:"overload",builder:"builder",support:"support",searching:"searching"},Oe={exhausted_supporter:"Your system may be carrying more than it can restore",compressed_builder:"Momentum is present, but so is pressure",threshold_seeker:"A transition is asking to be heard",cognitive_overload:"Your signal is asking for space",boundary_depletion:"Your own ground is asking to be held",protective_shutdown:"A quieter ground is being asked for",quiet_transition:"Something is shifting beneath the surface",regulated_momentum:"A clear current is moving through you",diffuse_pressure:"A reflection of your current signal"};function Ge(e,t){const a=`${e}:${t}`,r={"overload:cognitive_overload":"There is a clear pull toward quiet, but your system appears to be carrying more noise than it can easily process right now.","overload:protective_shutdown":"Some part of you seems to have softened the volume on what is present, in order to keep going.","overload:diffuse_pressure":"There is real load present, and the signal is asking for slower ground before anything else moves.","builder:compressed_builder":"There is forward movement here, but the structure around you may be asking too much from your personal capacity.","builder:cognitive_overload":"There is clear direction in what you are building, but the mental load underneath is asking for more space than it currently has.","builder:regulated_momentum":"There is clarity in your direction, and your system appears to be moving with you rather than against you.","support:exhausted_supporter":"There is care and steadiness in your signal, but also signs that your own energy may have been placed behind the needs of others.","support:boundary_depletion":"The way you hold others is generous, and that same generosity may be leaving little ground for you to stand on.","searching:threshold_seeker":"Something in you seems ready to move, but the next shape may still need space before it becomes clear.","searching:quiet_transition":"A quiet transition appears to be underway — less of a decision, more of a slow re-arrangement of what feels true."};return r[a]?r[a]:{exhausted_supporter:"There is care in your signal, and also signs of an energy debt that has been quietly accumulating.",compressed_builder:"There is momentum in what you are holding, and the container around it appears to be tightening.",threshold_seeker:"Something is asking to move, even if the shape of it is not yet clear.",cognitive_overload:"There is a lot moving through the mind right now, and the system is asking for quieter ground.",boundary_depletion:"Your own needs appear to be waiting in line behind everyone else, and that line has grown long.",protective_shutdown:"Some part of you seems to have stepped back from the signal, as a way of preserving energy.",quiet_transition:"A slow shift seems to be moving underneath, even where the surface looks still.",regulated_momentum:"Your signal appears clear and steady — there is a current moving through you with more ease than friction.",diffuse_pressure:"There is mixed pressure present, with no single source dominant — a system holding a number of things at once."}[t]}function Pe(e,t,a){const r=We(e),s=t?E(t.label):"what is present in the body",i=a?E(a.label):"what is moving in the mind";return{activation:`An activated quality is present in the system — ${i} sits close to the surface.`,depletion:`Underneath, the signal points to a real depletion — the body reads as ${s}.`,pressure:`There is real pressure being carried — both in the body (${s}) and in the way the mind is moving.`,mentalLoad:`The mind is doing a lot of work right now — ${i}.`,bodyHolding:`The body appears to be holding more than it is releasing — ${s}.`,uncertainty:`Underneath the noise, the signal is uncertain — ${i}.`,clarity:`There is clarity moving through your signal — ${i}.`,selfTrust:`A quieter form of self-trust seems to be present — ${i}
1.`,boundaries:`Your sense of where you end and others begin appears thinned — ${i}.`,systemLoad:"The system around you is asking a lot — and your inner state mirrors that load.",supportLoad:`You appear to be holding the weight of others alongside your own — ${s}.`,recoveryNeed:`A recovery signal is clearly present — the body reads as ${s}.`,alignment:`Something is moving into closer alignment — the body softens as ${s}.`}[r]}function Ye(e,t,a){const r=t?E(t.label):"the shape of what you are carrying";return a==="support"&&(e.supportLoad>=4||e.boundaries<=-2)?`Being available to others appears to come before being available to yourself — and ${r} sits at the centre of that pattern.`:a==="builder"&&(e.systemLoad>=4||e.pressure>=4)?`Much of what is being built still routes through you personally — ${r} appears to be where the weight gathers.`:a==="searching"&&e.uncertainty>=3?`The next shape is not yet visible, and ${r} seems to be where the search keeps circling.`:e.mentalLoad>=4?`The mind appears to be solving everything at once — ${r} is one of the places that load lands hardest.`:e.depletion>=4?`There has been more output than input for some time, and ${r} reads as a symptom of that imbalance.`:`What appears to weigh most right now is ${r} — that is where the friction seems to gather.`}function De(e,t){if(!e)return"What may help next is something simpler than the mind expects — a slower pace, a smaller next step, and a little more space around the day.";const a=e.answerId,r={quiet_body:"What may help next is body quiet — short, regular moments where the system can step out of input and let the nervous system settle.",less_pressure:"What may help next is less pressure in the mind — fewer open loops, and one thing at a time held with more presence.",next_step:"What may help next is one clear next step — not the whole map, just the immediate ground beneath the foot.",permission:"What may help next is permission to pause — the kind that does not need to be earned, and that the system can actually trust.",rhythm:"What may help next is a calmer rhythm — a daily shape the body can settle into rather than chase.",clarity_calm:"What may help next is the combination of clarity and calm — the quiet that lets the next move become obvious.",better_systems:"What may help next is better systems around you — so less of what is being built has to be carried personally.",team_structure:"What may help next is stronger team structure — distributing what currently routes only through you.",sustainable_growth:"What may help next is a more sustainable pace of growth — one your nervous system can actually live inside.",deeper_alignment:"What may help next is a deeper sense of alignment — leadership that follows your own ground rather than outpaces it.",energy:"What may help next is the slow rebuilding of energy — protected time that is not negotiable.",boundaries:"What may help next is better boundaries — clearer edges around where your care ends and self-care begins.",recover:"What may help next is true space to recover — not productive rest, but actual restoration.",steadiness:"What may help next is emotional steadiness — a wider base under the day so it cannot tip you as easily.",support:"What may help next is support without depletion — being held, instead of always being the one who holds.",direction:"What may help next is a clearer direction — even one degree of clarity is enough to begin walking.",purpose:"What may help next is reconnection with purpose — moving toward what you actually want, not away from what you fear.",space:"What may help next is space to listen — a quieter inner room where the next move can become audible.",confidence:"What may help next is confidence in the next step — small actions that build trust with yourself again.",alignment:"What may help next is a deeper sense of alignment — a way of moving that matches what you actually value."};return r[a]?r[a]:{overload:"What may help next is quieter ground beneath the day — a slower rhythm the system can settle into.",builder:"What may help next is more spacious structure around what you carry — so capacity can return to where it is most needed.",support:"What may help next is being supported, too — the same care you give, turned gently toward you.",searching:"What may help next is space to listen — a quieter room where the next shape can find its own voice."}[t]}function Be(e){const t=[["coral",Math.max(e.activation,e.pressure)],["amber",Math.max(e.depletion,e.recoveryNeed)],["green",Math.max(e.systemLoad,Math.abs(e.alignment))],["blue",Math.max(e.clarity,e.selfTrust)]];t.sort((s,i)=>i[1]-s[1]);const[a,r]=t;return a[1]<=0||r&&a[1]-r[1]<=1?"mixed":a[0]}function ze(e){switch(e){case"cognitive_overload":case"compressed_builder":case"diffuse_pressure":return"regulate";case"threshold_seeker":case"quiet_transition":return"reveal";
1case"exhausted_supporter":case"boundary_depletion":case"protective_shutdown":return"restore";case"regulated_momentum":return"integrate";default:return"regulate"}}function Ue(e){var g;const t=((g=e[0])==null?void 0:g.pathway)??"overload",a=Ee(e),r=He(t,a),s=z(e,"soma"),i=z(e,"awareness"),c=$e(e),d=qe(e);return{pathway:Fe[t],archetype:r,title:Oe[r],summary:Ge(t,r),whatWeNotice:Pe(a,s,i),whatMayBeCreatingFriction:Ye(a,c,t),whatMayHelpNext:De(d,t),footer:"This is not a score. It is a reflection of where you may be right now.",primaryCta:"Enter Flow Space",secondaryCta:"Start a conversation →",sphereTone:Be(a),field:Ce(a),recommendedFlowSpaceEntry:ze(r)}}function Je(e,t){if(!e||!t)return[];const a=pe[e];if(!a)return[];const r=[];for(const s of a.questions){const i=`${a.id}:${s.id}`,c=t[i];if(!c)continue;const d=s.options.find(m=>m.value===c);r.push({pathway:a.id,stage:s.section,questionId:s.id,answerId:c,label:(d==null?void 0:d.label)??c})}return r}function Ve({open:e,onClose:t}){return n.jsx(fe,{children:e&&n.jsxs(y.div,{initial:{opacity:0}
1,animate:{opacity:1},exit:{opacity:0},transition:{duration:.4},className:"fixed inset-0 z-50 flex items-center justify-center p-4",onClick:t,children:[n.jsx("div",{className:"absolute inset-0 bg-black/70 backdrop-blur-sm"}),n.jsxs(y.div,{initial:{opacity:0,y:20,scale:.97},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:12,scale:.98},transition:{duration:.4,ease:"easeOut"},onClick:a=>a.stopPropagation(),className:"relative z-10 w-full max-w-2xl max-h-[90vh] rounded-3xl border border-white/10 overflow-hidden flex flex-col",style:{background:"rgba(8, 10, 16, 0.85)",backdropFilter:"blur(32px) saturate(140%)",WebkitBackdropFilter:"blur(32px) saturate(140%)",boxShadow:"0 32px 80px rgba(0,0,0,0.6), inset 0 1px 0 rgba(255,255,255,0.08)"},children:[n.jsx("button",{type:"button",onClick:t,className:"absolute top-4 right-4 z-20 p-2 rounded-full text-foreground/50 hover:text-foreground/80 transition-colors duration-300",style:{background:"rgba(255,255,255,0.06)",backdropFilter:"blur(12px)"},children:n.jsx(oe,{className:"w-4 h-4"})}),n.jsxs("div",{className:"px-7 pt-8 pb-5",children:[n.jsx("h2",{className:"text-xl md:text-2xl font-light tracking-wide text-foreground/90",children:"Alignment Call"}),n.jsx("p",{className:"mt-3 text-sm md:text-base text-foreground/55 leading-relaxed font-light",children:"A quiet space to explore what your signal may be showing, and what kind of support would help you move from friction to flow."})]}),n.jsx("div",{className:"flex-1 min-h-0 px-4 pb-4",children:n.jsx("div",{className:"w-full h-full min-h-[420px] md:min-h-[520px] rounded-2xl overflow-hidden border border-white/5",children:n.jsx("iframe",{src:"https://calendly.com/juri-metamorphos?hide_gdpr_banner=1&hide_landing_page_details=1&background_color=080a10&text_color=e0e0e0&primary_color=3B82F6",title:"Book an Alignment Call",className:"w-full h-full min-h-[420px] md:min-h-[520px]",style:{border:"none",background:"transparent"}})})})]})]})})}function Xe({breathPhase:e,breathProgress:t,coherence:a,fogDensity:r,heartRateBpm:s=64,sphereColor:i,secondaryColor:c,intensity:d,movement:m}){return n.jsx(be,{intensity:"restrained",children:n.jsx(xe,{color:i,secondaryColor:c,breathPhase:e,breathProgress:t,coherence:a,fogDensity:r,intensity:d,movement:m,heartRateBpm:s})})}function bt(){var P;const e=se();ve();const t=ie(),a=t.state??{},r=t.state,s=(r==null?void 0:r.signalScanResponseId)??null,[i,c]=h.useState(null),[d,m]=h.useState(!1),[g,b]=h.useState("idle"),[H,M]=h.useState(null),[j,J]=h.useState(null),[V,W]=h.useState(!1),[q,X]=h.useState(!1),{user:w}=le(),_=h.useMemo(()=>{var l;return we(new URLSearchParams(t.search).get(_e)??((l=t.state)==null?void 0:l.context)??null,{hasUser:!!w})},[t.search,t.state,w]),N=Le(_),{coherence:L,sphereColor:x,fogDensity:Re,breathPhase:R,breathProgress:K,setCoherence:$,setSphereColor:F,setFogDensity:O,setFieldIntensity:G}=ce();h.useEffect(()=>{G("restrained")},[G]);const{reflection:f,signalReflection:o}=h.useMemo(()=>{const l=a.answers??{},p=D(l).cluster,v=(r==null?void 0:r.route)??null,S=Je(v,l),C=S.length>0?Ue(S):null;return{reflection:Me(p),cluster:p,signalReflection:C}},[a.answers,r==null?void 0:r.route]),u=(o==null?void 0:o.field)??Ae;h.useEffect(()=>{F(u.primaryColor),$(u.coherence),O(1-u.coherence)},[u.primaryColor.h,u.primaryColor.s,u.primaryColor.l,u.coherence,F,$,O]),h.useEffect(()=>{k.auth.getSession().then(({data:p})=>c(p.session));const{data:l}=k.auth.onAuthStateChange((p,v)=>c(v));return()=>l.subscription.unsubscribe()},[]),h.useEffect(()=>{try{localStorage.setItem("reflection_state",JSON.stringify({coherence:L,sphereColor:x,ts:Date.now()}))}catch{}},[L,x]);const Q=async()=>{if(!q){X(!0);try{w&&_==="flow_onboarding"&&await he(w.id,"baseline_intro")}catch(l){console.warn("[reflection] onboarding advance failed",l)}finally{e(Se(_),{replace:!0})}}},Z=()=>{try{localStorage.setItem("reflection_state",JSON.stringify({coherence:L,sphereColor:x,ts:Date.now()}))}catch{}e("/auth?redirect=/flow-space")},ee=async()=>{var l;if(!(g!=="idle"||j)){b("saving"),M(null);try{const{data:{user:p}}=await k.auth.getUser();if(!p){M("An account is required to save. Sign in, then save your reflection."),b("idle");return}const v=D(a.answers??{}).cluster,S=(o==null?void 0:o.whatWeNotice)??f.notice,C=(o==null?void 0:o.whatMayBeCreatingFriction)??f.friction,re=(o==null?void 0:o.whatMayHelpNext)??f.next,ne=[`What we notice: ${S}`,`What may be creating friction: ${C}`,`What may help next: ${re}`].join(`
2
3`),{data:A,error:Y}=await k.from("flow_space_reflections").insert({user_id:p.id,note_text:ne,state_tag:v,sphere_color:`hsl(${Math.round(x.h)} ${Math.round(x.s)}% ${Math.round(x.l)}%)`,coherence:L,context:{source:ke,source_route:Te,source_record_id:s,summary:(o==null?void 0:o.summary)??f.summary,archetype:(o==null?void 0:o.archetype)??null,pathway:(o==null?void 0:o.pathway)??null,
3name:((l=a.scanData)==null?void 0:l.name)??null,answers:a.answers??{}}}).select("id").maybeSingle();if(Y)throw Y;J((A==null?void 0:A.id)??"saved"),b("saved")}catch(p){console.error("Save reflection failed",p),M("Couldn't save just now. Your reflection is still here — try again."),b("idle")}}},te=(P=a.scanData)!=null&&P.name?`, ${a.scanData.name}`:"",ae=de(300);return n.jsxs(n.Fragment,{children:[n.jsxs(ue,{children:[n.jsx("title",{children:"Your reflection — Metamorphos"}),n.jsx("meta",{name:"description",content:"A calm reflection of your current signal before stepping into Flow Space."})]}),n.jsxs("main",{className:"min-h-screen w-full relative",children:[ae&&n.jsx("div",{className:"fixed inset-0 pointer-events-none",style:{zIndex:0,filter:"blur(8px) brightness(0.4) saturate(0.7)"},children:n.jsx(ge,{})}),n.jsx("div",{className:"fixed inset-0",style:{zIndex:1},children:n.jsx(Xe,{breathPhase:R,breathProgress:K,coherence:u.coherence,fogDensity:1-u.coherence,sphereColor:u.primaryColor,secondaryColor:u.secondaryColor,intensity:u.intensity,movement:u.movement})}),n.jsx("div",{className:"fixed inset-0 pointer-events-none",style:{zIndex:2,background:"radial-gradient(ellipse at center, transparent 0%, transparent 40%, rgba(4,8,14,0.5) 78%, rgba(2,4,8,0.8) 100%)"}}),n.jsx("div",{className:"fixed inset-0 pointer-events-none flex items-center justify-center",style:{zIndex:2},children:n.jsx("div",{style:{width:"60vmin",height:"60vmin",background:"radial-gradient(circle, rgba(255,255,255,0.05) 0%, rgba(255,255,255,0.02) 40%, transparent 70%)",filter:"blur(20px)"}})}),n.jsx("section",{className:"relative z-10 flex flex-col items-center px-6 pt-20 md:pt-28 pb-10 pointer-events-none",children:n.jsxs(y.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:1.6,ease:"easeOut",delay:.4},className:"text-center max-w-2xl mx-auto",children:[n.jsxs(y.h1,{initial:{opacity:0}
3,animate:{opacity:1},transition:{duration:1.6,delay:.6},className:"text-2xl md:text-3xl font-light tracking-wide text-foreground/90",children:[(o==null?void 0:o.title)??"A reflection of your current signal",te]}),n.jsx(y.p,{initial:{opacity:0},animate:{opacity:1},transition:{duration:1.6,delay:1.2},className:"mt-5 text-base md:text-lg text-foreground/70 leading-relaxed",children:(o==null?void 0:o.summary)??f.summary}),n.jsx(y.p,{initial:{opacity:0},animate:{opacity:1},transition:{duration:1.6,delay:1.6},className:"mt-3 text-xs md:text-sm text-foreground/45 italic tracking-wide",children:"Your Signal Scan reflection, shaped by the answers you brought into this scan."})]})}),n.jsx(y.div,{initial:{opacity:1},animate:{opacity:1},transition:{duration:.8},children:n.jsxs("div",{className:"relative z-10 max-w-xl mx-auto px-6 pb-24 pt-2 flex flex-col items-center",children:[n.jsx("div",{className:"w-full flex flex-col gap-5",children:[{title:"What we notice",body:(o==null?void 0:o.whatWeNotice)??f.notice,delay:1.8},{title:"What may be creating friction",body:(o==null?void 0:o.whatMayBeCreatingFriction)??f.friction,delay:2.3},{title:"What may help next",body:(o==null?void 0:o.whatMayHelpNext)??f.next,delay:2.8}].map(l=>n.jsxs(y.div,{initial:{opacity:0,y:24},animate:{opacity:1,y:0},transition:{duration:1.4,delay:l.delay,ease:"easeOut"},className:"group rounded-3xl px-7 py-6 border border-white/10 transition-all duration-500 hover:border-white/25 hover:[background:rgba(8,10,16,0.6)] hover:[backdrop-filter:blur(32px)_saturate(140%)] hover:[-webkit-backdrop-filter:blur(32px)_saturate(140%)] hover:shadow-[0_24px_60px_rgba(0,0,0,0.55),inset_0_1px_0_rgba(255,255,255,0.1)]",style:{background:"rgba(255,255,255,0.04)",backdropFilter:"blur(24px)",WebkitBackdropFilter:"blur(24px)",boxShadow:"0 20px 50px rgba(0,0,0,0.35), inset 0 1px 0 rgba(255,255,255,0.08)"},children:[n.jsx("h3",{className:"text-xs uppercase tracking-[0.18em] text-foreground/50 mb-3 transition-colors duration-500 group-hover:text-foreground/70",children:l.title}),n.jsx("p",{className:"text-base md:text-lg text-foreground/85 leading-relaxed font-light transition-colors duration-500 group-hover:text-foreground",children:l.body})]},l.title))}),n.jsx(y.p,{initial:{opacity:0}
3,animate:{opacity:1},transition:{duration:1.6,delay:3.4},className:"mt-12 text-sm text-foreground/45 text-center max-w-md italic",children:(o==null?void 0:o.footer)??"This is not a score. It is a reflection of where you may be right now."}),n.jsxs(y.div,{initial:{opacity:0,y:16},animate:{opacity:1,y:0},transition:{duration:1.4,delay:3.8},className:"mt-12 w-full flex flex-col items-center gap-4",children:[n.jsx(me,{size:"lg",variant:"hero",disabled:q,onClick:N?()=>void Q():Z,className:"min-w-[260px] morpho-shimmer",style:{backdropFilter:"blur(12px)",WebkitBackdropFilter:"blur(12px)",background:"rgba(0,0,0,0.25)"},children:Ne(_,(o==null?void 0:o.primaryCta)??"Enter Flow Space")}),!N&&n.jsxs("p",{className:"text-sm text-foreground/50 mt-4",children:["Or explore this with Jurjen directly."," ",n.jsx("a",{href:"#",onClick:l=>{l.preventDefault(),W(!0)},className:"text-foreground/70 underline underline-offset-2 hover:text-foreground/90 transition-colors duration-300",children:(o==null?void 0:o.secondaryCta)??"Start a conversation →"})]}),!N&&(i?n.jsx("button",{type:"button","data-testid":"save-signal-scan-reflection",onClick:ee,disabled:g!=="idle"||!!j,className:"glass-pill px-7 py-3 text-sm md:text-base font-light text-foreground/75 hover:text-foreground transition-colors duration-500 disabled:opacity-70",children:g==="saving"?"Saving…":j?"Saved to your reflections":"Save reflection"}):n.jsxs("p",{"data-testid":"signal-scan-save-requires-account",className:"text-sm text-foreground/50 text-center max-w-sm",children:["Saving a reflection requires a MetamorphOS account."," ",n.jsx("button",{type:"button",onClick:()=>e("/auth?redirect=/signal-scan"),className:"text-foreground/75 underline underline-offset-2 hover:text-foreground transition-colors",children:"Sign in to save your reflections"})]})),H&&n.jsx("p",{className:"text-xs text-foreground/50","data-testid":"save-reflection-error",children:H}),i&&!N&&n.jsx("button",{type:"button","data-testid":"view-saved-reflections",onClick:()=>e("/os/flow-space/reflections"),className:"text-xs text-foreground/40 hover:text-foreground/70 transition-colors duration-300",children:"View saved reflections"})]})]})},"reflection-view"),n.jsx(ye,{open:d,onClose:()=>m(!1)}),n.jsx(Ve,{open:V,onClose:()=>W(!1)})]})]})}export{bt 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.