1import{O as de,r as p,j as e,B as u,s as l,q as d,ac as me,b as xe,a as ue,U as P,m as D,C as I,h as A,w as ee,l as se,e as F,f as E,v as ie,n as re,X as he}from"./index-C4Zcu385.js";import{B as _}from"./badge-DJ0i8nd7.js";import{A as L,a as B,b as V}from"./avatar-CA3j6qFq.js";import{S as z}from"./skeleton-C7DemjXN.js";import{I as pe}from"./input-CTw6CINK.js";import{D as fe,f as je,a as ge,b as ve,c as Ne,d as ye}from"./dialog-DUEjz-2F.js";import{S as we,a as be,b as _e,c as Se,d as ke}from"./select-ClHLmekf.js";import{A as Ce,a as De,b as Ie,c as Ae,d as qe,e as Te,f as Re,g as Me,h as $e}from"./alert-dialog-Tw7-y5LM.js";import{D as Ue,a as Fe,b as Ee,e as le}from"./dropdown-menu-BFPt6ZS4.js";import{s as ze}from"./useSendActivityEmail-BX0ezfTA.js";import{U as te}from"./user-plus-D_c8FxpH.js";import{S as Le}from"./search-Cse-kyuY.js";import{U as Be}from"./user-cog-Dfro92ta.js";import{T as Ve}from"./trash-2-RkgVa4H3.js";import{A as Je}from"./arrow-left-D3BmiY98.js";import{C as Oe}from"./calendar-WdRwkDHX.js";import{S as ne}from"./star-CHqCab3p.js";import{C as Ye}from"./crown-BcmrWYrM.js";import{E as ce}from"./external-link-azDimJit.js";import"./index-JlD4i2Tr.js";import"./Combination-bGiTBl-F.js";import"./index-BdQq_4o_.js";import"./index-BW0eGFbm.js";import"./index-Ck76cxpQ.js";import"./chevron-down-BpKrqp48.js";import"./chevron-up-Bw-avb6Q.js";import"./index-Bj0BybEA.js";import"./chevron-right-M4Qx0nt1.js";import"./circle-B-Ct55SY.js";/** 2 * @license lucide-react v0.462.0 - ISC 3 * 4 * This source code is licensed under the ISC license. 5 * See the LICENSE file in the root directory of this source tree. 6 */const He=de("EllipsisVertical",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"12",cy:"5",r:"1",key:"gxeob9"}],["circle",{cx:"12",cy:"19",r:"1",key:"lyex9k"}]]),X=[{value:"member",label:"Member"},{value:"co-founder",label:"Co-Founder"},{value:"advisor",label:"Advisor"},{value:"developer",label:"Developer"},{value:"designer",label:"Designer"},{value:"marketing",label:"Marketing"}],oe=h=>h?h.split(" ").map(m=>m[0]).join("").toUpperCase().slice(0,2):"?";function Qe({teamId:h,ideaId:m,ideaTitle:N,members:i,isOwner:J,onMembersChange:f}){const[G,w]=p.useState(!1),[q,b]=p.useState(""),[T,y]=p.useState([]),[S,R]=p.useState(!1),[k,K]=p.useState("member"),[O,C]=p.useState(null),W=async a=>{if(b(a),a.length<2){y([]);return}R(!0);const x=i.map(v=>v.user_id),{data:r,error:g}=await l.from("profiles_public").select("id, full_name, avatar_url, skills").ilike("full_name",`%${a}%`).not("id","in",`(${x.join(",")})`).limit(5);!g&&r&&y(r.filter(v=>v.id)),R(!1)},Z=async a=>{C(a);const x=(await l.auth.getUser()).data.user;if(!x){d.error("You must be logged in"),C(null);return}const{data:r}=await l.from("join_requests").select("id, status").eq("idea_id",m).eq("user_id",a).maybeSingle();if(r){if(r.status==="pending")d.error("An invitation is already pending for this person");else if(r.status==="accepted")d.error("This person is already a team member");else{const{error:v}=await l.from("join_requests").update({status:"pending",message:`Invited as ${k}`}).eq("id",r.id);v?d.error("Failed to send invitation"):(await M(a,x.id),d.success("Invitation sent!"),b(""),y([]),w(!1))}C(null);return}const{error:g}=await l.from("join_requests").insert({idea_id:m,user_id:a,interest_type:"invited",status:"pending",message:`Invited as ${k}`});g?d.error("Failed to send invitation"):(await M(a,x.id),d.success("Invitation sent! They will need to accept to join."),b(""),y([]),w(!1),f()),C(null)},M=async(a,x)=>{const{data:r}=await l.from("profiles").select("full_name").eq("id",x).single();await l.from("notifications").insert({user_id:a,type:"team_invite",title:"Team Invitation",message:`${(r==null?void 0:r.full_name)||"Someone"} invited you to join "${N||"a project"}"`,link:"/portal/teams"}),ze({type:"team_invitation",recipient_id:a,data:{inviter_name:r==null?void 0:r.full_name,idea_title:N,role:k}})},Y=async(a,x)=>{const{error:r}=await l.from("team_members").update({role:x}).eq("id",a);r?d.error("Failed to update role"):(d.success("Role updated"),f())},$=async(a,x)=>{const{error:r}=await l.from("team_members").delete().eq("id",a);r?d.error("Failed to remove team member"):(d.success(`${x} removed from team`),f())};return e.jsxs("div",{className:"space-y-4",children:[J&&e.jsxs(fe,{open:G,onOpenChange:w,children:[e.jsx(je,{asChild:!0,children:e.jsxs(u,{className:"gap-2",children:[e.jsx(te,{className:"w-4 h-4"}),"Invite Member"]})}),e.jsxs(ge,{className:"sm:max-w-md",children:[e.jsxs(ve,{children:[e.jsx(Ne,{children:"Invite Team Member"}),e.jsx(ye,{children:"Search for people to add to your team"})]}),e.jsxs("div",{className:"space-y-4 py-4",children:[e.jsxs("div",{className:"relative",children:[e.jsx(Le,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),e.jsx(pe,{placeholder:"Search by name...",value:q,onChange:a=>W(a.target.value),className:"pl-10"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:"text-sm font-medium",children:"Role"}),e.jsxs(we,{value:k,onValueChange:K,children:[e.jsx(be,{children:e.jsx(_e,{})}),e.jsx(Se,{children:X.map(a=>e.jsx(ke,{value:a.value,children:a.label},a.value))})]})]}),e.jsx("div",{className:"space-y-2 max-h-60 overflow-y-auto",children:S?e.jsx("p",{className:"text-sm text-muted-foreground text-center py-4",children:"Searching..."}):T.length>0?T.map(a=>{var x;return e.jsxs("div",{className:"flex items-center justify-between p-3 rounded-lg border hover:bg-muted/50",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs(L,{className:"h-10 w-10",children:[e.jsx(B,{src:a.avatar_url||void 0}),e.jsx(V,{children:oe(a.full_name)})]}),e.jsxs("div",{children:[e.jsx("p",{className:"font-medium text-sm",children:a.full_name}),e.jsx("div",{className:"flex gap-1 mt-1",children:(x=a.skills)==null?void 0:x.slice(0,2).map((r,g)=>e.jsx(_,{variant:"secondary",className:"text-xs",children:r},g))})]})]}),e.jsx(u,{size:"sm",onClick:()=>Z(a.id),children:O===a.id?"Inviting...":"Invite"})]},a.id)}):q.length>=2?e.jsx("p",{className:"text-sm text-muted-foreground text-center py-4",children:"No results found"}):null})]})]})]}),e.jsx("div",{className:"space-y-3",children:i.map(a=>{var x,r,g,v,H,Q;return e.jsxs("div",{className:"flex items-center justify-between p-3 rounded-lg border bg-card",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs(L,{className:"h-10 w-10",children:[e.jsx(B,{src:((x=a.profile)==null?void 0:x.avatar_url)||void 0}),e.jsx(V,{children:oe((r=a.profile)==null?void 0:r.full_name)})]}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("p",{className:"font-medium text-sm",children:((g=a.profile)==null?void 0:g.full_name)||"Anonymous"}),a.role&&e.jsx(_,{variant:"outline",className:"text-xs",children:a.role})]}),e.jsx("div",{className:"flex gap-1 mt-1",children:(H=(v=a.profile)==null?void 0:v.skills)==null?void 0:H.slice(0,3).map((j,s)=>e.jsx(_,{variant:"secondary",className:"text-xs py-0",children:j},s))})]})]}),J&&e.jsxs(Ue,{children:[e.jsx(Fe,{asChild:!0,children:e.jsx(u,{variant:"ghost",size:"icon",children:e.jsx(He,{className:"h-4 w-4"})})}),e.jsxs(Ee,{align:"end",children:[e.jsxs(le,{onClick:()=>{const j=X[(X.findIndex(s=>s.value===a.role)+1)%X.length];Y(a.id,j.value)},children:[e.jsx(Be,{className:"mr-2 h-4 w-4"}),"Change Role"]}),e.jsxs(Ce,{children:[e.jsx(De,{asChild:!0,children:e.jsxs(le,{className:"text-destructive",onSelect:j=>j.preventDefault(),children:[e.jsx(Ve,{className:"mr-2 h-4 w-4"}),"Remove"]})}),e.jsxs(Ie,{children:[e.jsxs(Ae,{children:[e.jsx(qe,{children:"Remove team member?"}),e.jsxs(Te,{children:["Are you sure you want to remove ",((Q=a.profile)==null?void 0:Q.full_name)||"this member"," from the team? This action cannot be undone."]})]}),e.jsxs(Re,{children:[e.jsx(Me,{children:"Cancel"}),e.jsx($e,{onClick:()=>{var j;return $(a.id,((j=a.profile)==null?void 0:j.full_name)||"Member")},className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Remove"})]})]})]})]})]})]},a.id)})})]})}const ae=h=>h?h.split(" ").map(m=>m[0]).join("").toUpperCase().slice(0,2):"?";function bs(){const{ideaId:h}=me(),m=xe(),{user:N}
6=ue(),[i,J]=p.useState(null),[f,G]=p.useState(null),[w,q]=p.useState(null),[b,T]=p.useState([]),[y,S]=p.useState([]),[R,k]=p.useState([]),[K,O]=p.useState(!1),[C,W]=p.useState(!0),[Z,M]=p.useState(new Set),[Y,$]=p.useState(new Set),a=(N==null?void 0:N.id)===(i==null?void 0:i.created_by);p.useEffect(()=>{h&&(x(),v())},[h]);const x=async()=>{try{const{data:s,error:o}=await l.from("ideas").select("id, title, problem, solution, created_at, created_by").eq("id",h).single();if(o||!s){console.error("Error fetching idea:",o),d.error("Team not found"),m("/portal/teams?tab=my-teams");return}J(s);const{data:n}=await l.from("profiles_public").select("full_name, avatar_url, bio").eq("id",s.created_by).single();G(n);const{data:t}=await l.from("teams").select("id").eq("idea_id",h).single();t&&(q(t.id),await r(t.id)),await g(s.id)}catch(s){console.error("Unexpected error:",s),d.error("Failed to load team data")}finally{W(!1)}},r=async s=>{const{data:o}=await l.from("team_members").select("id, user_id, role, joined_at").eq("team_id",s);if(o&&o.length>0){const n=await Promise.all(o.map(async t=>{const{data:c}=await l.from("profiles_public").select("full_name, avatar_url, bio, skills").eq("id",t.user_id).single();return{...t,profile:c}}));T(n)}else T([])},g=async s=>{const{data:o}=await l.from("join_requests").select("id, user_id, message, created_at, status").eq("idea_id",s).eq("status","pending").order("created_at",{ascending:!1});if(o&&o.length>0){const n=await Promise.all(o.map(async t=>{const{data:c}=await l.from("profiles_public").select("full_name, avatar_url").eq("id",t.user_id).single();return{...t,requester_name:(c==null?void 0:c.full_name)||null,requester_avatar:(c==null?void 0:c.avatar_url)||null}}));S(n)}else S([])},v=async()=>{if(h){O(!0);try{const{data:s,error:o}=await l.functions.invoke("match-collaborators",{body:{trigger_type:"manual",idea_id:h,min_score:10}});if(o){console.error("Error fetching matches:",o);return}if(s!=null&&s.matches&&s.matches.length>0){const n=await Promise.all(s.matches.slice(0,5).map(async t=>{const{data:c}=await l.from("profiles_public").select("id, full_name, avatar_url, skills").ilike("full_name",`%${t.user}%`).limit(1),U=c==null?void 0:c[0];return U?{id:U.id,full_name:U.full_name,avatar_url:U.avatar_url,skills:U.skills,matchedSkills:t.matchedSkills,combinedScore:t.combinedScore}:null}));k(n.filter(Boolean))}}catch(s){console.error("Failed to fetch matches:",s)}finally{O(!1)}}},H=async s=>{const{error:o}=await l.from("join_requests").update({status:"accepted"}).eq("id",s.id);if(o){d.error("Failed to accept request");return}let n=w;if(!n&&i){const{data:t,error:c}=await l.from("teams").insert({name:`${i.title} Team`,idea_id:i.id,created_by:N==null?void 0:N.id}).select("id").single();if(c){d.error("Failed to create team");return}n=t.id,q(n)}n&&await l.from("team_members").insert({team_id:n,user_id:s.user_id,role:"member"}),await l.from("notifications").insert({user_id:s.user_id,type:"join_accepted",title:"Join Request Accepted!",message:`Your request to join "${i==null?void 0:i.title}" has been accepted.`,link:`/portal/teams/${h}`}),d.success(`${s.requester_name||"User"} added to team!`),S(t=>t.filter(c=>c.id!==s.id)),n&&r(n)},Q=async s=>{const{error:o}=await l.from("join_requests").update({status:"rejected"}).eq("id",s.id);if(o){d.error("Failed to decline request");return}await l.from("notifications").insert({user_id:s.user_id,type:"join_rejected",title:"Join Request Declined",message:`Your request to join "${i==null?void 0:i.title}" was not accepted.`}),d.success("Request declined"),S(n=>n.filter(t=>t.id!==s.id))},j=s=>s?new Date(s).toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"}):"";return C?e.jsxs("div",{className:"space-y-6",children:[e.jsx(z,{className:"h-8 w-48"}),e.jsx(z,{className:"h-32 w-full"}),e.jsx(z,{className:"h-64 w-full"})]}):i?e.jsxs("div",{className:"space-y-4 md:space-y-6",children:[e.jsxs(u,{variant:"ghost",onClick:()=>m("/portal/teams?tab=my-teams"),className:"gap-2 text-muted-foreground hover:text-foreground -ml-2",children:[e.jsx(Je,{className:"w-4 h-4"}),"Back to Teams"]}),e.jsx(D.div,{initial:{opacity:0,y:20}
6,animate:{opacity:1,y:0},transition:{duration:.4},children:e.jsx(I,{className:"bg-card",children:e.jsx(A,{className:"p-4 md:p-6",children:e.jsxs("div",{className:"flex flex-col md:flex-row md:items-center justify-between gap-4",children:[e.jsxs("div",{className:"flex items-start gap-3 md:gap-4",children:[e.jsx("div",{className:"w-12 h-12 md:w-14 md:h-14 rounded-full bg-primary/10 flex items-center justify-center flex-shrink-0",children:e.jsx(ee,{className:"w-6 h-6 md:w-7 md:h-7 text-primary"})}),e.jsxs("div",{children:[e.jsxs("h1",{className:"text-xl md:text-2xl font-bold text-foreground",children:[i.title," Team"]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-2 md:gap-4 mt-2 text-sm text-muted-foreground",children:[e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(P,{className:"w-4 h-4"}),b.length+1," members"]}),i.created_at&&e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(Oe,{className:"w-4 h-4"}),"Created ",j(i.created_at)]})]})]})]}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[e.jsxs(u,{variant:"outline",size:"sm",onClick:()=>m(`/portal/ideas/${i.id}`),className:"gap-2",children:[e.jsx(ee,{className:"w-4 h-4"}),e.jsx("span",{className:"hidden sm:inline",children:"View"})," Project"]}),a&&e.jsxs(e.Fragment,{children:[e.jsxs(u,{size:"sm",onClick:()=>m("/portal/collaborators"),className:"gap-2 bg-gradient-to-r from-amber-400 via-rose-400 to-pink-400 text-white hover:from-amber-500 hover:via-rose-500 hover:to-pink-500",children:[e.jsx(se,{className:"w-4 h-4"}),e.jsx("span",{className:"hidden sm:inline",children:"Find"})," Collaborators"]}),e.jsxs(u,{variant:"outline",size:"sm",onClick:()=>m("/portal/advisors"),className:"gap-2",children:[e.jsx(ne,{className:"w-4 h-4"}),e.jsx("span",{className:"hidden sm:inline",children:"Find"})," Advisors"]})]})]})]})})})}),e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-4 md:gap-6",children:[e.jsxs("div",{className:"lg:col-span-2 space-y-4 md:space-y-6",children:[e.jsx(D.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.4,delay:.1},children:e.jsxs(I,{children:[e.jsx(F,{className:"pb-3",children:e.jsxs("div",{className:"flex items-center gap-2 text-primary",children:[e.jsx(Ye,{className:"w-5 h-5"}),e.jsx(E,{className:"text-lg",children:"Creator"})]})}),e.jsx(A,{children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-3 md:gap-4",children:[e.jsxs(L,{className:"h-12 w-12 md:h-14 md:w-14",children:[e.jsx(B,{src:(f==null?void 0:f.avatar_url)||void 0}),e.jsx(V,{className:"bg-primary text-primary-foreground text-lg",children:ae(f==null?void 0:f.full_name)})]}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[e.jsx("h3",{className:"font-semibold text-foreground",children:(f==null?void 0:f.full_name)||"Anonymous"}),e.jsx(_,{variant:"secondary",className:"bg-primary/10 text-primary",children:"Creator"})]}),e.jsx("p",{className:"text-sm text-muted-foreground mt-1 line-clamp-1",children:(f==null?void 0:f.bio)||"No bio yet"})]})]}),e.jsx(u,{variant:"ghost",size:"sm",onClick:()=>m("/portal/profile"),children:e.jsx(ce,{className:"w-4 h-4"})})]})})]})}),e.jsx(D.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.4,delay:.2},children:e.jsxs(I,{children:[e.jsx(F,{className:"pb-3",children:e.jsx("div",{className:"flex items-center justify-between",children:e.jsxs("div",{className:"flex items-center gap-2 text-primary",children:[e.jsx(P,{className:"w-5 h-5"}),e.jsx(E,{className:"text-lg",children:"Team Members"})]})})}),e.jsx(A,{children:b.length>0||a?e.jsx(Qe,{teamId:w||"",ideaId:h||"",members:b,isOwner:a,onMembersChange:()=>{w?r(w):x()}}):e.jsxs("div",{className:"text-center py-6",children:[e.jsx(P,{className:"w-10 h-10 mx-auto text-muted-foreground mb-3"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"No team members yet"})]})})]})}),a&&e.jsx(D.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.4,delay:.25},children:e.jsxs(I,{children:[e.jsx(F,{className:"pb-3",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2 text-primary",children:[e.jsx(se,{className:"w-5 h-5"}),e.jsx(E,{className:"text-lg",children:"Suggested Matches"})]}),e.jsx(u,{variant:"ghost",size:"sm",className:"text-primary",onClick:()=>m("/portal/collaborators"),children:"View All"})]})}),e.jsx(A,{children:K?e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[e.jsx(z,{className:"h-24 w-full"}),e.jsx(z,{className:"h-24 w-full"})]}):R.length>0?e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:R.map(s=>e.jsx("div",{className:"p-4 rounded-lg border bg-gradient-to-r from-primary/5 to-transparent hover:from-primary/10 transition-colors",children:e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsxs(L,{className:"h-12 w-12",children:[e.jsx(B,{src:s.avatar_url||void 0}),e.jsx(V,{className:"text-sm bg-primary/20",children:ae(s.full_name)})]}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[e.jsx("p",{className:"font-medium text-sm truncate",children:s.full_name||"Anonymous"}),e.jsxs(_,{variant:"secondary",className:"text-xs bg-primary/10 text-primary",children:[s.combinedScore,"% match"]})]}),e.jsxs("div",{className:"flex flex-wrap gap-1 mt-2",children:[s.matchedSkills.slice(0,3).map((o,n)=>e.jsx(_,{variant:"outline",className:"text-xs py-0",children:o},n)),s.matchedSkills.length>3&&e.jsxs("span",{className:"text-xs text-muted-foreground",children:["+",s.matchedSkills.length-3]})]}),e.jsxs("div",{className:"flex gap-2 mt-3",children:[Z.has(s.id)?e.jsxs(u,{size:"sm",variant:"outline",className:"gap-1 h-8 text-muted-foreground cursor-default",disabled:!0,children:[e.jsx(ie,{className:"w-3 h-3 text-green-500"}),"Invited"]}):e.jsxs(u,{size:"sm",className:"gap-1 h-8",disabled:Y.has(s.id),onClick:async o=>{o.stopPropagation(),$(t=>new Set(t).add(s.id));const{error:n}=await l.from("join_requests").insert({idea_id:h,user_id:s.id,status:"invited",interest_type:"invited",message:`You've been invited to join the ${i==null?void 0:i.title} team!`});if(n){$(t=>{const c=new Set(t);return c.delete(s.id),c}),n.code==="23505"?(M(t=>new Set(t).add(s.id)),d.info("Invitation already sent")):d.error("Failed to send invitation");return}await l.from("notifications").insert({user_id:s.id,type:"team_invite",title:"Team Invitation",message:`You've been invited to join "${i==null?void 0:i.title}" team!`,link:`/portal/teams/${h}`}),$(t=>{const c=new Set(t);return c.delete(s.id),c}),M(t=>new Set(t).add(s.id)),d.success(`Invitation sent to ${s.full_name}`)},children:[e.jsx(te,{className:"w-3 h-3"}),Y.has(s.id)?"Sending...":"Invite"]}),e.jsxs(u,{variant:"ghost",size:"sm",className:"gap-1 h-8",onClick:()=>m(`/portal/collaborators/${s.id}`),children:[e.jsx(ce,{className:"w-3 h-3"}),"Profile"]})]})]})]})},s.id))}):e.jsxs("div",{className:"text-center py-8",children:[e.jsx(se,{className:"w-10 h-10 mx-auto text-muted-foreground mb-3"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"No matches found yet"}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Add more details to your Team Strategy section in the business plan"}),e.jsx(u,{variant:"outline",size:"sm",className:"mt-4",onClick:()=>m("/portal/collaborators"),children:"Browse All Collaborators"})]})})]})})]}),e.jsxs("div",{className:"space-y-4 md:space-y-6",children:[a&&e.jsx(D.div,{initial:{opacity:0,y:20}
6,animate:{opacity:1,y:0},transition:{duration:.4,delay:.3},children:e.jsxs(I,{children:[e.jsx(F,{className:"pb-3",children:e.jsxs("div",{className:"flex items-center gap-2 text-orange-500",children:[e.jsx(re,{className:"w-5 h-5"}),e.jsx(E,{className:"text-lg",children:"Join Requests"}),y.length>0&&e.jsx(_,{variant:"secondary",className:"ml-auto",children:y.length})]})}),e.jsx(A,{children:y.length>0?e.jsx("div",{className:"space-y-3",children:y.map(s=>e.jsxs("div",{className:"p-3 rounded-lg border bg-muted/30",children:[e.jsxs("div",{className:"flex items-center gap-3 mb-2",children:[e.jsxs(L,{className:"h-8 w-8",children:[e.jsx(B,{src:s.requester_avatar||void 0}),e.jsx(V,{className:"text-xs",children:ae(s.requester_name)})]}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("p",{className:"font-medium text-sm truncate",children:s.requester_name||"Anonymous"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:j(s.created_at)})]})]}),s.message&&e.jsxs("p",{className:"text-xs text-muted-foreground line-clamp-2 mb-3",children:['"',s.message,'"']}),e.jsxs("div",{className:"flex gap-2",children:[e.jsxs(u,{size:"sm",className:"flex-1 gap-1",onClick:()=>H(s),children:[e.jsx(ie,{className:"w-3 h-3"}),"Accept"]}),e.jsxs(u,{size:"sm",variant:"outline",className:"flex-1 gap-1",onClick:()=>Q(s),children:[e.jsx(he,{className:"w-3 h-3"}),"Decline"]})]})]},s.id))}):e.jsxs("div",{className:"text-center py-6",children:[e.jsx(re,{className:"w-8 h-8 mx-auto text-muted-foreground mb-2"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"No pending requests"})]})})]})}),e.jsx(D.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.4,delay:.4},children:e.jsxs(I,{children:[e.jsx(F,{className:"pb-3",children:e.jsx(E,{className:"text-lg",children:"Quick Actions"})}),e.jsxs(A,{className:"space-y-2",children:[e.jsxs(u,{variant:"outline",className:"w-full justify-start gap-2",onClick:()=>m("/portal/advisors"),children:[e.jsx(ne,{className:"w-4 h-4 text-amber-500"}),"Find Advisors"]}),e.jsxs(u,{variant:"outline",className:"w-full justify-start gap-2",onClick:()=>m("/portal/collaborators"),children:[e.jsx(te,{className:"w-4 h-4 text-primary"}),"Find Collaborators"]}),e.jsxs(u,{variant:"outline",className:"w-full justify-start gap-2",onClick:()=>m(`/portal/ideas/${i.id}`),children:[e.jsx(ee,{className:"w-4 h-4 text-amber-500"}),"View Business Plan"]})]})]})})]})]})]}):e.jsxs("div",{className:"text-center py-12",children:[e.jsx(P,{className:"w-12 h-12 mx-auto text-muted-foreground mb-4"}),e.jsx("h3",{className:"text-lg font-medium mb-2",children:"Team not found"}),e.jsx(u,{onClick:()=>m("/portal/teams?tab=my-teams"),children:"Back to My Teams"})]})}export{bs 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.