1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[451],{1152:(e,t,r)=>{"use strict";r.r(t),r.d(t,{__N_SSP:()=>Q,default:()=>$});var a=r(7876),s=r(8230),l=r.n(s),d=r(4232),i=r(7768),n=r(4359),o=r(97),c=r(6838);let m=(0,c.A)("CalendarClock",[["path",{d:"M21 7.5V6a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h3.5",key:"1osxxc"}],["path",{d:"M16 2v4",key:"4m81vk"}],["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M3 10h5",key:"r794hk"}],["path",{d:"M17.5 17.5 16 16.3V14",key:"akvzfd"}],["circle",{cx:"16",cy:"16",r:"6",key:"qoo3c4"}]]),u=(0,c.A)("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);var x=r(4726),p=r(9999),b=r(6480);let g=(0,c.A)("Flame",[["path",{d:"M8.5 14.5A2.5 2.5 0 0 0 11 12c0-1.38-.5-2-1-3-1.072-2.143-.224-4.054 2-6 .5 2.5 2 4.9 4 6.5 2 1.6 3 3.5 3 5.5a7 7 0 1 1-14 0c0-1.153.433-2.294 1-3a2.5 2.5 0 0 0 2.5 2.5z",key:"96xj49"}]]),h=(0,c.A)("MessageSquareText",[["path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",key:"1lielz"}],["path",{d:"M13 8H7",key:"14i4kc"}],["path",{d:"M17 12H7",key:"16if0g"}]]);var f=r(9688),v=r(3643),y=r(513),j=r(1097),N=r(7025);let _=y.z.enum(N.A9),w=y.z.preprocess(e=>{if(Array.isArray(e)){var t;return null!=(t=e[0])?t:null}return null!=e?e:null},j.Ss.nullable()),k=y.z.object({profile_id:y.z.string(),vibe:_,note:y.z.string().nullable(),vibe_date:y.z.string(),updated_at:y.z.date({coerce:!0})}),S=k.extend({profile:w}),C=y.z.object({post_id:y.z.string(),profile_id:y.z.string(),vibe:_,reacted_at:y.z.date({coerce:!0})}),V=y.z.object({id:y.z.string(),content:y.z.string(),author:w}),M=y.z.object({vibe:_,vibe_date:y.z.string()}),z=y.z.object({vibe:_,reacted_at:y.z.date({coerce:!0})}),E=y.z.object({id:y.z.string()}),A=(e,t)=>N.A9.map(r=>({vibe:r,label:N.t4[r],emoji:N.rz[r],count:e[r],percent:t>0?Math.round(e[r]/t*100):0})),L=e=>e.every(e=>0===e.count)?null:e.reduce((e,t)=>t.count>e.count?t:e),P=async(e,t)=>{let{data:r,error:a}=await e.from("follow").select("following_id").eq("follower_id",t.id);if(a)throw Error(a.message);return Array.from(new Set([t.id,...(null!=r?r:[]).map(e=>e.following_id)].filter(Boolean)))},D=async e=>{let t=0,r=[];for(;;){let a=t+1e3-1,{data:s,error:l}=await e(t,a);if(l)throw Error(l.message);let d=null!=s?s:[];if(r.push(...d),d.length<1e3)break;t+=1e3}return r},q=async function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new Date,a=(0,N.j6)(r),{data:s,error:l}=await e.from("daily_vibe_status").select("profile_id, vibe, note, vibe_date, updated_at").eq("profile_id",t.id).eq("vibe_date",a).maybeSingle();if(l)throw Error(l.message);return s?k.parse(s):null},R=async function(e,t,r){var a;let s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,l=arguments.length>4&&void 0!==arguments[4]?arguments[4]:new Date,d=(0,N.j6)(l),i=null!=(a=null==s?void 0:s.trim())?a:"",n=i.length>0?i.slice(0,280):null,{data:o,error:c}=await e.from("daily_vibe_status").upsert({profile_id:t.id,vibe_date:d,vibe:r,note:n,updated_at:new Date().toISOString()},{onConflict:"profile_id,vibe_date"}).select("profile_id, vibe, note, vibe_date, updated_at").single();if(c)throw Error(c.message);return k.parse(o)},I=async(e,t,r)=>{var a,s,l;let d=null!=(a=null==r?void 0:r.date)?a:new Date,i=Math.max(1,null!=(s=null==r?void 0:r.topPostsLimit)?s:4),n=Math.max(4,null!=(l=null==r?void 0:r.statusLimit)?l:16),o=(0,N.j6)(d),c=(0,N.KD)(d),m=await P(e,t),[u,x]=await Promise.all([D((t,r)=>e.from("daily_vibe_status").select("\n profile_id,\n vibe,\n note,\n vibe_date,\n updated_at,\n profile:profile_id (\n id,\n name,\n handle,\n avatar_url\n )\n ").in("profile_id",m).eq("vibe_date",o).order("updated_at",{ascending:!1}).range(t,r)),D((t,r)=>e.from("vibe_reaction").select("post_id, profile_id, vibe, reacted_at").in("profile_id",m).gte("reacted_at",c.dayStartIso).lt("reacted_at",c.dayEndIso).order("reacted_at",{ascending:!1}).range(t,r))]),p=S.array().parse(u),b=C.array().parse(null!=x?x:[]),g=(0,N.iF)();p.forEach(e=>{g[e.vibe]+=1}
1),b.forEach(e=>{g[e.vibe]+=1});let h=p.length+b.length,f=A(g,h),v=L(f),y=new Map;b.forEach(e=>{var t;let r=null!=(t=y.get(e.post_id))?t:{totalSignals:0,counts:(0,N.iF)()};r.totalSignals+=1,r.counts[e.vibe]+=1,y.set(e.post_id,r)});let j=Array.from(y.entries()).sort((e,t)=>t[1].totalSignals-e[1].totalSignals).slice(0,i),_=j.map(e=>{let[t]=e;return t}),w=new Map;if(_.length>0){let{data:t,error:r}=await e.from("post").select("\n id,\n content,\n author:author_id (\n id,\n name,\n handle,\n avatar_url\n )\n ").in("id",_);if(r)throw Error(r.message);V.array().parse(null!=t?t:[]).forEach(e=>{w.set(e.id,e)})}let k=j.map(e=>{var t,r,a;let[s,l]=e,d=A(l.counts,l.totalSignals),i=null!=(t=L(d))?t:d[0],n=w.get(s);return{postId:s,content:null!=(r=null==n?void 0:n.content)?r:"",author:null!=(a=null==n?void 0:n.author)?a:null,totalSignals:l.totalSignals,topVibe:i.vibe,topVibePercent:i.percent,byVibe:d}});return{date:o,circleProfileCount:m.length,activeStatusCount:p.length,reactionCount:b.length,totalSignals:h,topVibe:v,byVibe:f,statuses:p.slice(0,n),topImpactPosts:k}},T=async function(e,t){var r,a,s;let l=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new Date,d=(0,N.QT)(l,-6),i=(0,N.j6)(d),n=(0,N.j6)(l),o=(0,N.KD)(d).dayStartIso,c=(0,N.KD)(l).dayEndIso,[m,u,x]=await Promise.all([e.from("daily_vibe_status").select("vibe, vibe_date").eq("profile_id",t.id).gte("vibe_date",i).lte("vibe_date",n),e.from("vibe_reaction").select("vibe, reacted_at").eq("profile_id",t.id).gte("reacted_at",o).lt("reacted_at",c),e.from("post").select("id").eq("author_id",t.id)]);if(m.error)throw Error(m.error.message);if(u.error)throw Error(u.error.message);if(x.error)throw Error(x.error.message);let p=M.array().parse(null!=(r=m.data)?r:[]),b=z.array().parse(null!=(a=u.data)?a:[]),g=E.array().parse(null!=(s=x.data)?s:[]).map(e=>e.id),h=0;if(g.length>0){let{count:t,error:r}=await e.from("vibe_reaction").select("*",{count:"exact",head:!0}).in("post_id",g).gte("reacted_at",o).lt("reacted_at",c);if(r)throw Error(r.message);h=null!=t?t:0}let f=(0,N.iF)(),v=new Set,y=new Map;p.forEach(e=>{if(f[e.vibe]+=1,v.add(e.vibe_date),"chaotic"===e.vibe){var t;y.set(e.vibe_date,(null!=(t=y.get(e.vibe_date))?t:0)+1)}}),b.forEach(e=>{f[e.vibe]+=1;let t=(0,N.j6)(e.reacted_at);if(v.add(t),"chaotic"===e.vibe){var r;y.set(t,(null!=(r=y.get(t))?r:0)+1)}});let j=p.length+b.length,_=A(f,j),w=L(_),k=Array.from(y.entries()).sort((e,t)=>t[1]-e[1]||t[0].localeCompare(e[0])),S=0===k.length?null:{date:k[0][0],label:new Date("".concat(k[0][0],"T12:00:00.000Z")).toLocaleDateString(void 0,{weekday:"long"}),count:k[0][1]};return{rangeStart:i,rangeEnd:n,totalSignals:j,activeDays:v.size,mostUsedVibe:w,vibesReceivedOnPosts:h,mostChaoticDay:S,byVibe:_}};var Z=r(2386),F=r(7808),U=r(8077),K=r(7489);let B={aura_up:"border-emerald-400/50 bg-emerald-500/15 text-emerald-700 dark:text-emerald-300",real:"border-cyan-400/50 bg-cyan-500/15 text-cyan-700 dark:text-cyan-300",mood:"border-amber-400/50 bg-amber-500/15 text-amber-700 dark:text-amber-300",chaotic:"border-rose-400/50 bg-rose-500/15 text-rose-700 dark:text-rose-300"},H={aura_up:"bg-emerald-500/80",real:"bg-cyan-500/80",mood:"bg-amber-500/80",chaotic:"bg-rose-500/80"},W={aura_up:"rgba(16, 185, 129, 0.95)",real:"rgba(6, 182, 212, 0.95)",mood:"rgba(245, 158, 11, 0.95)",chaotic:"rgba(244, 63, 94, 0.95)"};function O(e){var t,r,s,c;let{user:y,profile:j}=e,_=(0,v.R)(),w=(0,i.jE)(),[k,S]=(0,d.useState)(""),[C,V]=(0,d.useState)(!1),{data:M,isLoading:z}=(0,n.I)({queryKey:["daily_vibe_status",y.id],queryFn:async()=>q(_,y)}),{data:E,isLoading:A}=(0,n.I)({queryKey:["daily_vibe_pulse",y.id],queryFn:async()=>I(_,y),refetchInterval:6e4}),{data:L}=(0,n.I)({queryKey:["weekly_vibe_recap",y.id],queryFn:async()=>T(_,y),staleTime:12e4});(0,d.useEffect)(()=>{if(!C){var e;S(null!=(e=null==M?void 0:M.note)?e:"")}},[null==M?void 0:M.note,C]);let P=(0,o.n)({mutationFn:async e=>R(_,y,e.vibe,e.note),onSuccess:e=>{var t;w.setQueryData(["daily_vibe_status",y.id],e),w.invalidateQueries({queryKey:["daily_vibe_pulse"],refetchType:"all"}),w.invalidateQueries({queryKey:["weekly_vibe_recap"],refetchType:"all"}),V(!1),S(null!=(t=e.note)?t:""),f.oR.success("Today's vibe: ".concat(N.t4[e.vibe]))},onError:()=>{f.oR.error("Couldn't save your daily vibe right now.")}}),D=null!=(t=null==M?void 0:M.vibe)?t:null,O=(0,d.useMemo)(()=>{var e;let t=null!=(e=null==E?void 0:E.date)?e:(0,N.j6)();return new Date("".concat(t,"T12:00:00.000Z")).toLocaleDateString(void 0,{weekday:"long",month:"short",day:"numeric"})},[null==E?void 0:E.date]),Q=(0,d.useMemo)(()=>{var e;return(null!=(e=null==E?void 0:E.statuses)?e:[]).filter(e=>e.profile_id!==y.id&&e.profile)},[null==E?void 0:E.statuses,y.id]),$=(0,d.useMemo)(()=>{var e;let t=null!=(e=null==j?void 0:j.avatar_url)?e:"";if(t)return _.storage.from("avatars").getPublicUrl(t).data.publicUrl},[null==j?void 0:j.avatar_url,_]),X=async()=>
1{if(!D)return void f.oR.error("Set today's vibe first.");await P.mutateAsync({vibe:D,note:k})},Y=(0,d.useMemo)(()=>{if(!E||E.totalSignals<=0)return{background:"conic-gradient(from 210deg, rgba(148,163,184,0.4) 0% 100%)"};let e=0,t=E.byVibe.filter(e=>e.count>0).map(t=>{let r=t.count/E.totalSignals*100,a=e,s=e+r;return e=s,"".concat(W[t.vibe]," ").concat(a,"% ").concat(s,"%")});return 0===t.length?{background:"conic-gradient(from 210deg, rgba(148,163,184,0.4) 0% 100%)"}:{background:"conic-gradient(from 210deg, ".concat(t.join(", "),")")}},[E]);return(0,a.jsxs)("section",{className:"mb-5 grid gap-4 lg:grid-cols-12",children:[(0,a.jsxs)(U.Zp,{className:"lg:col-span-5 animate-fade-up border-border/70 bg-card/90",children:[(0,a.jsxs)(U.aR,{className:"pb-3",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,a.jsx)(U.ZB,{className:"text-lg",children:"Daily Vibe Check"}),(0,a.jsxs)("span",{className:"inline-flex items-center gap-1 rounded-full border border-border/70 bg-muted/40 px-2 py-1 text-[11px] font-medium text-muted-foreground",children:[(0,a.jsx)(m,{className:"h-3.5 w-3.5"}),O]})]}),(0,a.jsx)("p",{className:"text-sm text-muted-foreground",children:"How are you feeling today? One tap sets your vibe."})]}),(0,a.jsxs)(U.Wu,{className:"space-y-3",children:[(0,a.jsx)("div",{className:"grid grid-cols-1 gap-2 sm:grid-cols-2",children:N.t$.map(e=>{let t=D===e.value;return(0,a.jsx)(F.$,{type:"button",variant:"ghost",disabled:P.isPending,onClick:()=>P.mutate({vibe:e.value,note:k}),className:"h-auto w-full flex-col items-stretch rounded-xl border px-3 py-2.5 text-left ".concat(t?B[e.value]:"border-border/70 bg-background/70 text-foreground/90 hover:border-primary/30 hover:bg-primary/[0.07]"),children:(0,a.jsxs)("div",{className:"flex w-full items-center justify-between gap-2",children:[(0,a.jsxs)("div",{className:"flex min-w-0 items-center gap-2.5",children:[(0,a.jsx)("span",{className:"inline-flex max-w-[5.25rem] shrink-0 items-center justify-center overflow-hidden rounded-full border border-border/60 bg-background/70 px-2.5 py-1 text-[10px] font-bold leading-none tracking-wide text-ellipsis whitespace-nowrap",children:e.emoji}),(0,a.jsx)("span",{className:"min-w-0",children:(0,a.jsx)("span",{className:"block truncate text-sm font-semibold leading-tight",children:e.label})})]}),t&&(0,a.jsxs)("span",{className:"inline-flex shrink-0 items-center gap-1 rounded-full border border-primary/35 bg-primary/15 px-2 py-1 text-[10px] font-semibold uppercase tracking-wide",children:[(0,a.jsx)(u,{className:"h-3 w-3"}),"Active"]})]})},e.value)})}),(0,a.jsxs)("div",{className:"rounded-xl border border-border/70 bg-muted/20 p-2.5",children:[(0,a.jsx)("label",{htmlFor:"daily-vibe-note",className:"mb-1 block text-xs font-semibold uppercase tracking-[0.14em] text-muted-foreground",children:"Optional status note"}),(0,a.jsx)(K.p,{id:"daily-vibe-note",maxLength:280,value:k,onChange:e=>{V(!0),S(e.target.value)},placeholder:"Running on 2 hours of sleep..."}),(0,a.jsxs)("div",{className:"mt-2 flex items-center justify-between gap-3",children:[(0,a.jsx)("span",{className:"text-xs text-muted-foreground",children:D?"Current vibe: ".concat(N.t4[D]):"No vibe set yet"}),(0,a.jsx)(F.$,{type:"button",size:"sm",className:"rounded-full",variant:"secondary",onClick:X,disabled:P.isPending||!D,children:"Save note"})]})]})]})]}),(0,a.jsxs)(U.Zp,{className:"lg:col-span-7 animate-fade-up border-border/70 bg-card/90",children:[(0,a.jsxs)(U.aR,{className:"pb-3",children:[(0,a.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[(0,a.jsx)(U.ZB,{className:"text-lg",children:"Meadows Pulse"}),(0,a.jsxs)("span",{className:"inline-flex items-center gap-1 rounded-full border border-primary/25 bg-primary/10 px-2 py-1 text-[11px] font-semibold text-primary",children:[(0,a.jsx)(x.A,{className:"h-3.5 w-3.5"}),"Live today"]})]}),(0,a.jsx)("p",{className:"text-sm text-muted-foreground",children:"Collective mood from daily check-ins and post vibe reactions."})]}),(0,a.jsx)(U.Wu,{children:A?(0,a.jsx)("div",{className:"rounded-xl border border-border/70 bg-muted/20 p-4 text-sm text-muted-foreground",children:"Loading pulse..."}):E?(0,a.jsxs)("div",{className:"space-y-4",children:[(0,a.jsxs)("div",{className:"grid gap-3 md:grid-cols-[0.95fr,1.05fr]",children:[(0,a.jsxs)("div",{className:"relative overflow-hidden rounded-2xl border border-border/70 bg-gradient-to-br from-background/80 via-primary/[0.06] to-accent/[0.09] p-3",children:[(0,a.jsx)("div",{className:"pointer-events-none absolute -right-12 -top-12 h-32 w-32 rounded-full bg-primary/15 blur-2xl"}),(0,a.jsx)("div",{className:"pointer-events-none absolute -bottom-16 left-0 h-32 w-32 rounded-full bg-accent/20 blur-2xl"}),(0,a.jsxs)("div",{className:"relative",children:[(0,a.jsx)("p",{className:"text-[11px] font-semibold uppercase tracking-[0.14em] text-muted-foreground",children:"Vibe Mix Wheel"}),(0,a.jsx)("div",{className:"mt-3 flex justify-center",children:(0,a.jsx)("div",{className:"relative h-44 w-44 rounded-full p-3 shadow-[0_0_0_1px_hsl(var(--border)/0.35),0_12px_30px_-16px_hsl(var(--foreground)/0.55)]",style:Y,children:(0,a.jsxs)("div",{className:"flex h-full w-full flex-col items-center justify-center rounded-full border border-border/70 bg-card/95 text-center",children:[(0,a.jsx)("p",{className:"text-[10px] font-semibold uppercase tracking-[0.14em] text-muted-foreground",children:"Signals"}),(0,a.jsx)("p",{className:"mt-0.5 text-2xl font-bold leading-none",children:E.totalSignals.toLocaleStr
1ing()}),(0,a.jsx)("p",{className:"mt-1 px-2 text-[11px] font-medium text-muted-foreground",children:E.topVibe?"".concat(E.topVibe.emoji," ").concat(E.topVibe.label," leads"):"No dominant vibe yet"})]})})})]})]}),(0,a.jsxs)("div",{className:"space-y-3",children:[(0,a.jsxs)("div",{className:"rounded-2xl border px-3 py-2.5 ".concat(E.topVibe?B[E.topVibe.vibe]:"border-border/70 bg-muted/20 text-foreground"),children:[(0,a.jsx)("p",{className:"text-[11px] font-semibold uppercase tracking-[0.14em]",children:"Top vibe right now"}),(0,a.jsx)("p",{className:"mt-1 text-base font-bold",children:E.topVibe?"".concat(E.topVibe.emoji," ").concat(E.topVibe.label):"No pulse leader yet"}),(0,a.jsx)("p",{className:"text-xs opacity-85",children:E.topVibe?"".concat(E.topVibe.percent,"% of today's signals"):"Set your vibe and react to posts to shape the pulse."})]}),(0,a.jsx)("div",{className:"grid grid-cols-2 gap-2",children:E.byVibe.map(e=>{var t;return(0,a.jsxs)("div",{className:"rounded-xl border border-border/70 bg-muted/20 px-2.5 py-2 ".concat((null==(t=E.topVibe)?void 0:t.vibe)===e.vibe?"ring-1 ring-primary/40":""),children:[(0,a.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,a.jsx)("span",{className:"text-sm font-bold",children:e.emoji}),(0,a.jsxs)("span",{className:"text-[11px] font-semibold text-muted-foreground",children:[e.percent,"%"]})]}),(0,a.jsx)("p",{className:"mt-0.5 truncate text-sm font-semibold",children:e.label}),(0,a.jsxs)("p",{className:"text-[11px] text-muted-foreground",children:[e.count.toLocaleString()," signals"]})]},e.vibe)})})]})]}),(0,a.jsxs)("div",{className:"rounded-2xl border border-border/70 bg-muted/[0.14] p-3",children:[(0,a.jsxs)("div",{className:"mb-2 flex flex-wrap items-center justify-between gap-2",children:[(0,a.jsx)("p",{className:"text-[11px] font-semibold uppercase tracking-[0.14em] text-muted-foreground",children:"Vibe Skyline"}),(0,a.jsx)("p",{className:"text-xs text-muted-foreground",children:"Live vibe distribution"})]}),(0,a.jsx)("div",{className:"grid grid-cols-4 gap-2 sm:gap-3",children:E.byVibe.map(e=>(0,a.jsxs)("div",{className:"flex flex-col items-center gap-1.5",children:[(0,a.jsxs)("div",{className:"relative flex h-24 w-full items-end overflow-hidden rounded-xl border border-border/70 bg-background/70 p-1.5",children:[(0,a.jsx)("div",{className:"w-full rounded-lg transition-all duration-500 ".concat(H[e.vibe]),style:{height:0===e.count?"8%":"".concat(Math.max(e.percent,E.totalSignals>0?18:8),"%")}}),(0,a.jsxs)("span",{className:"absolute left-1/2 top-1 -translate-x-1/2 rounded-full border border-border/60 bg-background/85 px-1.5 py-0.5 text-[10px] font-semibold text-muted-foreground",children:[e.percent,"%"]})]}),(0,a.jsx)("p",{className:"text-[10px] font-bold leading-none text-muted-foreground",children:e.emoji}),(0,a.jsx)("p",{className:"text-center text-[11px] font-semibold leading-tight",children:e.label})]},"bar-".concat(e.vibe)))})]}),(0,a.jsxs)("div",{className:"grid gap-2 text-xs text-muted-foreground sm:grid-cols-3",children:[(0,a.jsxs)("div",{className:"rounded-xl border border-border/70 bg-muted/20 px-3 py-2",children:[(0,a.jsx)("p",{className:"text-[11px] uppercase tracking-[0.13em]",children:"Signals"}),(0,a.jsx)("p",{className:"mt-0.5 text-sm font-semibold text-foreground",children:E.totalSignals.toLocaleString()})]}),(0,a.jsxs)("div",{className:"rounded-xl border border-border/70 bg-muted/20 px-3 py-2",children:[(0,a.jsx)("p",{className:"text-[11px] uppercase tracking-[0.13em]",children:"Statuses"}),(0,a.jsx)("p",{className:"mt-0.5 text-sm font-semibold text-foreground",children:E.activeStatusCount.toLocaleString()})]}),(0,a.jsxs)("div",{className:"rounded-xl border border-border/70 bg-muted/20 px-3 py-2",children:[(0,a.jsx)("p",{className:"text-[11px] uppercase tracking-[0.13em]",children:"Reactions"}),(0,a.jsx)("p",{className:"mt-0.5 text-sm font-semibold text-foreground",children:E.reactionCount.toLocaleString()})]})]})]}):(0,a.jsx)("div",{className:"rounded-xl border border-border/70 bg-muted/20 p-4 text-sm text-muted-foreground",children:"Pulse data is unavailable right now."})})]}),(0,a.jsxs)(U.Zp,{className:"lg:col-span-8 animate-fade-up border-border/70 bg-card/90",children:[(0,a.jsxs)(U.aR,{className:"pb-3",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,a.jsx)(U.ZB,{className:"text-lg",children:"Circle Vibe Statuses"}),(0,a.jsxs)("span",{className:"inline-flex items-center gap-1 rounded-full border border-border/70 bg-muted/40 px-2 py-1 text-[11px] font-medium text-muted-foreground",children:[(0,a.jsx)(p.A,{className:"h-3.5 w-3.5"}
1),(null!=(r=null==E?void 0:E.circleProfileCount)?r:0).toLocaleString()," in your circle"]})]}),(0,a.jsx)("p",{className:"text-xs text-muted-foreground",children:"Friends are accounts you follow. A vibe appears here once they check in for today."})]}),(0,a.jsx)(U.Wu,{children:0===Q.length?(0,a.jsx)("div",{className:"rounded-xl border border-dashed border-border/70 bg-muted/20 p-4 text-sm text-muted-foreground",children:"No friend vibe check-ins yet today."}):(0,a.jsx)("div",{className:"grid gap-2 sm:grid-cols-2",children:Q.map(e=>{let t=e.profile,r=t.avatar_url?_.storage.from("avatars").getPublicUrl(t.avatar_url).data.publicUrl:void 0;return(0,a.jsx)("div",{className:"rounded-xl border border-border/70 bg-muted/15 p-3",children:(0,a.jsxs)("div",{className:"flex items-start gap-2.5",children:[(0,a.jsxs)(Z.eu,{className:"h-9 w-9",children:[(0,a.jsx)(Z.BK,{src:r}),(0,a.jsx)(Z.q5,{children:t.name.slice(0,2).toUpperCase()})]}),(0,a.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,a.jsx)("p",{className:"truncate text-sm font-semibold",children:t.name}),(0,a.jsxs)("p",{className:"truncate text-xs text-muted-foreground",children:["@",t.handle]}),(0,a.jsx)("p",{className:"mt-1 text-xs font-semibold uppercase tracking-[0.11em] text-primary",children:N.t4[e.vibe]}),e.note&&(0,a.jsxs)("p",{className:"mt-1 line-clamp-2 text-sm text-foreground/90",children:["â",e.note,"â"]})]})]})},"".concat(e.profile_id,"-").concat(e.vibe_date))})})})]}),(0,a.jsxs)(U.Zp,{className:"lg:col-span-4 animate-fade-up border-border/70 bg-card/90",children:[(0,a.jsx)(U.aR,{className:"pb-3",children:(0,a.jsx)(U.ZB,{className:"text-lg",children:"Your Week on Meadows"})}),(0,a.jsxs)(U.Wu,{className:"space-y-2.5",children:[(0,a.jsxs)("div",{className:"rounded-xl border border-border/70 bg-muted/20 p-3",children:[(0,a.jsx)("p",{className:"text-xs uppercase tracking-[0.12em] text-muted-foreground",children:"Most used vibe"}),(0,a.jsx)("p",{className:"mt-1 text-base font-semibold",children:(null==L?void 0:L.mostUsedVibe)?"".concat(L.mostUsedVibe.label," ").concat(L.mostUsedVibe.emoji):"No vibe signals yet"})]}),(0,a.jsxs)("div",{className:"rounded-xl border border-border/70 bg-muted/20 p-3",children:[(0,a.jsx)("p",{className:"text-xs uppercase tracking-[0.12em] text-muted-foreground",children:"Your post vibes (7d)"}),(0,a.jsx)("p",{className:"mt-1 text-base font-semibold",children:(null!=(s=null==L?void 0:L.vibesReceivedOnPosts)?s:0).toLocaleString()})]}),(0,a.jsxs)("div",{className:"rounded-xl border border-border/70 bg-muted/20 p-3",children:[(0,a.jsx)("p",{className:"text-xs uppercase tracking-[0.12em] text-muted-foreground",children:"Most chaotic day"}),(0,a.jsx)("p",{className:"mt-1 text-base font-semibold",children:(null==L?void 0:L.mostCha
1oticDay)?"".concat(L.mostChaoticDay.label," (").concat(L.mostChaoticDay.count,")"):"No chaotic spikes"})]})]})]}),(0,a.jsxs)(U.Zp,{className:"lg:col-span-12 animate-fade-up border-border/70 bg-card/90",children:[(0,a.jsx)(U.aR,{className:"pb-3",children:(0,a.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[(0,a.jsx)(U.ZB,{className:"text-lg",children:"Posts Influencing Today's Vibe"}),(0,a.jsxs)("span",{className:"inline-flex items-center gap-1 rounded-full border border-border/70 bg-muted/40 px-2 py-1 text-[11px] font-medium text-muted-foreground",children:[(0,a.jsx)(b.A,{className:"h-3.5 w-3.5"}),"Live influence"]})]})}),(0,a.jsx)(U.Wu,{children:E&&0!==E.topImpactPosts.length?(0,a.jsx)("div",{className:"grid gap-3 md:grid-cols-2",children:E.topImpactPosts.map(e=>(0,a.jsxs)(l(),{href:"/post/".concat(e.postId),className:"group rounded-xl border border-border/70 bg-muted/15 p-3 transition hover:border-primary/35 hover:bg-primary/[0.07]",children:[(0,a.jsxs)("div",{className:"flex items-start justify-between gap-3",children:[(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsx)("p",{className:"truncate text-sm font-semibold",children:e.author?"".concat(e.author.name," (@").concat(e.author.handle,")"):"Unknown author"}),(0,a.jsx)("p",{className:"mt-1 line-clamp-2 text-sm text-muted-foreground",children:e.content||"No post text."})]}),(0,a.jsxs)("span",{className:"inline-flex shrink-0 items-center gap-1 rounded-full border px-2 py-1 text-[11px] font-semibold ".concat(B[e.topVibe]),children:[(0,a.jsx)(g,{className:"h-3.5 w-3.5"}),N.t4[e.topVibe]," ",e.topVibePercent,"%"]})]}),(0,a.jsx)("div",{className:"mt-2 flex items-center gap-3 text-xs text-muted-foreground",children:(0,a.jsxs)("span",{className:"inline-flex items-center gap-1",children:[(0,a.jsx)(h,{className:"h-3.5 w-3.5"}),e.totalSignals.toLocaleString()," vibe signals"]})})]},e.postId))}):(0,a.jsx)("div",{className:"rounded-xl border border-dashed border-border/70 bg-muted/20 p-4 text-sm text-muted-foreground",children:"No post vibe activity yet today."})})]}),z&&(0,a.jsx)("p",{className:"lg:col-span-12 text-xs text-muted-foreground",children:"Syncing your vibe state..."}),!z&&!M&&(0,a.jsxs)("div",{className:"lg:col-span-12 flex items-center gap-2 rounded-xl border border-dashed border-border/70 bg-muted/15 px-3 py-2 text-xs text-muted-foreground",children:[(0,a.jsxs)(Z.eu,{className:"h-7 w-7",children:[(0,a.jsx)(Z.BK,{src:$}),(0,a.jsx)(Z.q5,{children:(null!=(c=null==j?void 0:j.name)?c:"ME").slice(0,2).toUpperCase()})]}),"Set your vibe to appear in your circle's Daily Pulse."]})]})}var Q=!0;function $(e){let{user:t,profile:r}=e;return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(f.l$,{position:"bottom-center",theme:"system",richColors:!0}),(0,a.jsx)("main",{className:"min-h-screen w-full text-foreground",children:(0,a.jsxs)("div",{className:"page-shell max-w-5xl",children:[(0,a.jsx)("section",{className:"surface mb-5 animate-fade-up p-5 sm:p-6",children:(0,a.jsxs)("div",{className:"flex flex-wrap items-start justify-between gap-4",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-xs font-semibold uppercase tracking-[0.22em] text-primary",children:"Vibe Intelligence"}),(0,a.jsx)("h1",{className:"mt-2 text-3xl font-bold tracking-tight",children:"Daily Pulse"}),(0,a.jsx)("p",{className:"mt-1.5 text-sm text-muted-foreground",children:"Track your circle's mood and manage your daily vibe status."})]}),(0,a.jsxs)("div",{className:"inline-flex items-center gap-2 rounded-full border border-border/70 bg-card/70 px-3 py-1.5 text-sm font-medium text-muted-foreground",children:[(0,a.jsx)(x.A,{className:"h-4 w-4 text-primary"}),"Live vibe data"]})]})}),(0,a.jsx)(O,{user:t,profile:r})]})})]})}},5288:(e,t,r)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/pulse",function(){return r(1152)}])},6480:(e,t,r)=>{"use strict";r.d(t,{A:()=>a});let a=(0,r(6838).A)("Activity",[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]])},8077:(e,t,r)=>{"use strict";r.d(t,{Wu:()=>o,ZB:()=>n,Zp:()=>d,aR:()=>i,wL:()=>c});var a=r(7876),s=r(4232),l=r(1257);let d=s.forwardRef((e,t)=>
1{let{className:r,...s}=e;return(0,a.jsx)("div",{ref:t,className:(0,l.cn)("rounded-[1.25rem] border border-border/80 bg-card/85 text-card-foreground shadow-soft-xl backdrop-blur-xl",r),...s})});d.displayName="Card";let i=s.forwardRef((e,t)=>{let{className:r,...s}=e;return(0,a.jsx)("div",{ref:t,className:(0,l.cn)("flex flex-col space-y-1.5 p-6",r),...s})});i.displayName="CardHeader";let n=s.forwardRef((e,t)=>{let{className:r,...s}=e;return(0,a.jsx)("div",{ref:t,className:(0,l.cn)("font-semibold leading-none tracking-tight",r),...s})});n.displayName="CardTitle",s.forwardRef((e,t)=>{let{className:r,...s}=e;return(0,a.jsx)("div",{ref:t,className:(0,l.cn)("text-sm text-muted-foreground",r),...s})}).displayName="CardDescription";let o=s.forwardRef((e,t)=>{let{className:r,...s}=e;return(0,a.jsx)("div",{ref:t,className:(0,l.cn)("p-6 pt-0",r),...s})});o.displayName="CardContent";let c=s.forwardRef((e,t)=>{let{className:r,...s}=e;return(0,a.jsx)("div",{ref:t,className:(0,l.cn)("flex items-center p-6 pt-0",r),...s})});c.displayName="CardFooter"},9999:(e,t,r)=>{"use strict";r.d(t,{A:()=>a});let a=(0,r(6838).A)("Users",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["path",{d:"M16 3.13a4 4 0 0 1 0 7.75",key:"1da9ce"}]])}},e=>{e.O(0,[688,636,593,792],()=>e(e.s=5288)),_N_E=e.O()}]);
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.