PageSourceSearch

https://youngaileaderslinz.at/assets/profile-DwirzmIl.js

js youngaileaderslinz.at collected 2026-10-05 04:51:48 UTC 16,979 bytes, 1 lines download raw bytes

1import{r as n,s as o,at as ue,j as t,as as he,aw as fe,ad as ge,T as Q,ao as ve,ax as be,ay as je,t as N}from"./index-nxedOTY2.js";import{i as Ne,T as ke}from"./TrialProgress-0zaCSo_8.js";import{i as ye}from"./MemberLinkList-BJ1r7hnp.js";import{I as _e,p as we,f as Se}from"./validate-image-C_3Bieu1.js";import{h as Ee,b as Te,W as X,E as Z,f as C,a as Ae,A as Pe}from"./hub-events-DlODnqLr.js";import{E as v}from"./external-link-DEWD2viU.js";import{L as Ce}from"./lock-B9HDtewq.js";import{I as Ie}from"./image-up-bs5mcAk2.js";import"./link-2-B99QFIYD.js";import"./globe-BX8TnjbJ.js";import"./landmark-CpMjRuVB.js";const Le=l=>{const d=l.sub_role||(l.team==="Leadership"?"":l.team);return l.title?[l.title,l.sub_role].filter(Boolean).join(" · "):l.kind==="advisor"?"Advisor":`${l.kind==="lead"?"Team Lead":"Member"}${d?` · ${d}`:""}`},$e={trial:"Trial phase — your profile stays inside the portal until the hub confirms you.",active:"Active member — your profile is published on the Teams page.",alumni:"Alumni — your profile stays on the Teams page.",hidden:"Hidden — your profile is not published."};function Ue(){const[l,d]=n.useState(null);return n.useEffect(()=>{o.rpc("member_status_overview").then(({data:b})=>d((b??[])[0]??null))},[]),Ne(l)&&l?t.jsx(ke,{s:l}):null}function qe(){const[l,d]=n.useState(!0),[b,I]=n.useState(!1),[L,k]=n.useState(!1),[s,c]=n.useState(null),[$,y]=n.useState(null),[U,ee]=n.useState(null),[z,te]=n.useState([]),[_,se]=n.useState([]),[w,ae]=n.useState([]),[re,ne]=n.useState({}),[M,S]=n.useState(null),[B,le]=n.useState(!1),[D,ie]=n.useState(!1),[R,oe]=n.useState(!1);n.useEffect(()=>{(async()=>{const{data:e}=await o.auth.getUser();if(!e.user)return d(!1);ee(e.user.id);const{data:r}=await o.from("member_directory").select("id, name, slug, team, kind, status, title, sub_role, focus, photo, links, credits, place").eq("user_id",e.user.id).maybeSingle();if(r){const a=r;if(c({...a,links:ue(a.links)}),a.photo){const{data:m}=await o.storage.from("member-photos").createSignedUrl(a.photo,3600);y(m?.signedUrl??null)}const[{data:i},{data:j},{data:P}]=await Promise.all([o.from("event_attendance").select("id, status, note, event_id").eq("member_id",a.id),o.from("hub_events").select("id, title, event_date, event_type, place, description, luma_url, internal_url, starts_at_time, ends_at_time, place_lat, place_lng, series_id, expected, hub").order("event_date",{ascending:!1}),o.from("member_work_items").select("id, member_id, title, contribution, status, impact_slug, link_url, internal_url, started_on").eq("member_id",a.id).order("updated_at",{ascending:!1})]);te(i??[]);const xe=Ee(r.place);se((j??[]).filter(m=>Te(m,xe))),ae(P??[]);const V=(a.credits??[]).map(m=>m.projectId).filter(Boolean);if(V.length){const{data:m}=await o.from("impact_entries").select("slug, title").in("slug",V);ne(Object.fromEntries((m??[]).map(J=>[J.slug,J.title])))}}d(!1)})()},[]);const ce=async e=>{if(!e||!U||!s)return;S(null);const r=await we(e);if("error"in r)return S(r.error);e=r.file,k(!0);const a=e.name.split(".").pop()?.toLowerCase()||"jpg",i=`self/${U}/${Date.now()}.${a}`,{error:j}=await o.storage.from("member-photos").upload(i,e,{contentType:e.type,cacheControl:"3600"});if(j)return k(!1),S(Se(j.message));const{data:P}=await o.storage.from("member-photos").createSignedUrl(i,3600);y(P?.signedUrl??null),c({...s,photo:i}),k(!1),N.success("Photo uploaded. Save to publish it.")},de=async e=>{if(e.preventDefault(),!s)return;if(s.links.find(i=>i.url.trim()&&!/^https:\/\//i.test(i.url.trim())))return N.error("Every link must start with https://");I(!0);const{error:a}=await o.rpc("update_my_member_profile",{_name:s.name,_focus:s.focus??"",_photo:s.photo??"",_links:s.links.filter(i=>i.url.trim())});I(!1),a?N.error(a.message):(N.success("Profile updated."),window.dispatchEvent(new Event("profile-photo-changed")))},u="w-full rounded-lg border border-[color:var(--hairline-strong)] bg-card px-3 py-2.5 text-sm focus:border-[color:var(--signal)] focus:outline-none",h="mono mb-1.5 block text-[10px] uppercase tracking-[0.18em] text-[color:var(--ink-soft)]";if(l)return t.jsx(he,{rows:3});if(!s)return t.jsxs("div",{className:"max-w-xl",children:[t.jsx("div",{className:h,children:"My profile"}),t.jsx("h1",{className:"mb-4 text-3xl md:text-4xl",children:"No directory entry yet."}),t.jsx("p",{className:"text-sm text-[color:var(--ink-soft)]",children:"Your account is not linked to a person in the member directory yet. A hub admin can link it, then your profile becomes editable here."})]});const E=(e,r)=>{const a=[...s.links];a[e]={...a[e],...r},c({...s,links:a})},me=new Map(_.map(e=>[e.id,e])),F=z.map(e=>({...e,event:me.get(e.event_id)})).filter(e=>e.event).sort((e,r)=>e.event.event_date<r.event.event_date?1:-1),T=new Date().toISOString().slice(0,10),p=_.filter(e=>e.event_date>=T).sort((e,r)=>e.event_date<r.event_date?-1:1),H=new Map(z.map(e=>[e.event_id,e.status])),f=_.filter(e=>e.expected&&e.event_date<=T),O=f.filter(e=>H.get(e.id)==="attended").length,W=f.filter(e=>H.get(e.id)==="excused").length,pe=F.filter(e=>e.status==="attended").length,G=new Set,Y=(s.credits??[]).map(e=>({slug:e.projectId,title:e.projectId&&re[e.projectId]||e.label||e.projectId||"",contribution:e.contribution})).filter(e=>e.title&&!(e.slug&&G.has(e.slug))&&(e.slug?G.add(e.slug):!0)),q=f.length?Math.round(O/f.length*100):null,g=F.filter(e=>e.event.event_date<T||e.status!=="registered"),K=new Set(["delivered","published"]),A=w.filter(e=>!K.has(String(e.status))),x=[...w.filter(e=>K.has(String(e.status))).map(e=>({key:e.id,title:e.title,slug:e.impact_slug,label:`Internal · ${X[e.status]??e.status}`})),...Y.map((e,r)=>({key:`c-${r}`,title:e.title,slug:e.slug,label:"Public · on your Teams profile"}))];return t.jsxs("div",{children:[t.jsx("div",{className:"mono mb-2 text-xs uppercase tracking-[0.18em] text-[color:var(--ink-soft)]",children:"My profile"}),t.jsxs("div",{className:"mb-6 flex flex-wrap items-end justify-between gap-3",children:[t.jsx("h1",{className:"text-3xl md:text-4xl",children:"Edit profile"}),s.slug&&s.status!=="trial"&&t.jsxs("a",{href:`/teams/${s.slug}`,target:"_blank",rel:"noopener noreferrer",className:"btn btn-ghost text-sm",children:["View public profile ",t.jsx(v,{size:13,className:"ml-1"})]})]}),t.jsx(Ue,{}),t.jsxs("section",{"aria-label":"Managed by hub admins",className:"mb-10 rounded-2xl bg-[color:var(--paper-2)] p-5",children:[t.jsxs("div",{className:"mono mb-3 flex items-center gap-2 text-[10px] uppercase tracking-[0.18em] text-[color:var(--ink-soft)]",children:[t.jsx(Ce,{size:12})," Managed by hub admins · read only"]}),t.jsxs("dl",{className:"grid gap-4 text-sm sm:grid-cols-3",children:[t.jsxs("div",{children:[t.jsx("dt",{className:"text-xs text-[color:var(--ink-soft)]",children:"Position"}),t.jsx("dd",{className:"mt-0.5",children:Le(s)})]}),t.jsxs("div",{children:[t.jsx("dt",{className:"text-xs text-[color:var(--ink-soft)]",children:"Team"}),t.jsx("dd",{className:"mt-0.5",children:s.team})]}),t.jsxs("div",{children:[t.jsx("dt",{className:"text-xs text-[color:var(--ink-soft)]",children:"Status"}),t.jsx("dd",{className:"mt-0.5 capitalize",children:s.status})]})]}),t.jsx("p",{className:"mt-3 text-xs text-[color:var(--ink-soft)]",children:$e[s.status]??""})]}),t.jsxs("div",{className:"mono mb-4 flex items-center gap-2 text-[10px] uppercase tracking-[0.18em] text-[color:var(--ink)]",children:[t.jsx(fe,{size:12})," Editable by you"]}),t.jsxs("form",{onSubmit:de,className:"space-y-5",children:[t.jsxs("div",{children:[t.jsx("label",{className:h,htmlFor:"p-name",children:"Full name"}),t.jsx("input",{id:"p-name",className:u,value:s.name,onChange:e=>c({...s,name:e.target.value})})]}),t.jsxs("div",{children:[t.jsx("label",{className:h,htmlFor:"p-focus",children:"One line: what you work on"}),t.jsx("textarea",{id:"p-focus",rows:3,className:u,value:s.focus??"",onChange:e=>c({...s,focus:e.target.value})})]}),t.jsxs("div",{children:[t.jsx("span",{className:h,children:"Profile picture"}),t.jsxs("div",{className:"flex flex-wrap items-center gap-4",children:[$?t.jsx("img",{src:$,alt:"",className:"h-20 w-20 rounded-full border border-[color:var(--hairline)] object-cover"}):t.jsx("span",{className:"h-20 w-20 overflow-hidden rounded-full border border-[color:var(--hairline)]",children:t.jsx(ge,{name:s?.name??"",initialsSize:26})}),t.jsxs("label",{className:"btn btn-ghost cursor-pointer",children:[t.jsx(Ie,{size:16})," ",L?"Uploading...":"Upload photo",t.jsx("input",{type:"file",accept:_e,className:"sr-only",disabled:L,onChange:e=>{ce(e.target.files?.[0]),e.target.value=""}})]}),s.photo&&t.jsxs("button",{type:"button",className:"btn btn-ghost",onClick:()=>{c({...s,photo:""}),y(null)},children:[t.jsx(Q,{size:14})," Remove"]})]}),M&&t.jsx("p",{role:"alert",className:"mt-2 text-sm text-[color:var(--color-destructive)]",children:M}),t.jsx("p",{className:"mt-1 text-xs text-[color:var(--ink-soft)]",children:"JPG, PNG, WebP or iPhone photo (HEIC) · max 5 MB · at least 400 px wide."})]}),t.jsxs("div",{children:[t.jsxs("div",{className:"mb-2 flex items-center justify-between",children:[t.jsx("span",{className:h,children:"Links"}),t.jsxs("button",{type:"button",className:"btn btn-ghost",onClick:()=>c({...s,links:[{type:"linkedin",url:""},...s.links]}),children:[t.jsx(ve,{size:14})," Add link"]})]}),t.jsx("div",{className:"space-y-3",children:s.links.map((e,r)=>t.jsxs("div",{className:"grid gap-3 sm:grid-cols-[28px_170px_1fr_auto] sm:items-center",children:[(()=>{const a=ye(e);
1return t.jsx(a,{size:18,"aria-hidden":!0,className:"hidden sm:block"})})(),t.jsx("select",{className:u,"aria-label":"Link type",value:e.type,onChange:a=>E(r,{type:a.target.value}),children:be.map(a=>t.jsx("option",{value:a,children:je[a]},a))}),t.jsxs("div",{className:"grid gap-3 sm:grid-cols-2",children:[e.type==="other"&&t.jsx("input",{className:u,placeholder:"Label",value:e.label??"",onChange:a=>E(r,{label:a.target.value})}),t.jsx("input",{className:`${u} ${e.type==="other"?"":"sm:col-span-2"}`,placeholder:"https://",value:e.url,onChange:a=>E(r,{url:a.target.value})})]}),t.jsx("button",{type:"button",className:"btn btn-ghost","aria-label":"Remove link",onClick:()=>c({...s,links:s.links.filter((a,i)=>i!==r)}),children:t.jsx(Q,{size:14})})]},r))})]}),t.jsx("button",{type:"submit",className:"btn btn-signal",disabled:b,children:b?"Saving...":"Save profile"})]}),t.jsxs("section",{className:"mt-14 border-t border-[color:var(--hairline)] pt-10",children:[t.jsx("h2",{className:"text-2xl",children:"Attendance record"}),t.jsx("p",{className:"mt-1 text-sm text-[color:var(--ink-soft)]",children:"Hub meetings, workshops and sessions recorded for you."}),t.jsxs("div",{className:"mt-5 grid gap-3 sm:grid-cols-3",children:[t.jsxs("div",{className:"card-hairline p-4",children:[t.jsx("div",{className:"font-display text-3xl",children:q===null?"—":`${q}%`}),t.jsx("div",{className:"mono text-[10px] uppercase tracking-[0.18em] text-[color:var(--ink-soft)]",children:"Expected meetings attended"}),t.jsxs("div",{className:"mt-1 text-xs text-[color:var(--ink-soft)]",children:[O," of ",f.length,W?` · ${W} excused`:""]})]}),t.jsxs("div",{className:"card-hairline p-4",children:[t.jsx("div",{className:"font-display text-3xl",children:pe}),t.jsx("div",{className:"mono text-[10px] uppercase tracking-[0.18em] text-[color:var(--ink-soft)]",children:"Sessions attended"})]}),t.jsxs("div",{className:"card-hairline p-4",children:[t.jsx("div",{className:"font-display text-3xl",children:p.length}),t.jsx("div",{className:"mono text-[10px] uppercase tracking-[0.18em] text-[color:var(--ink-soft)]",children:"Upcoming events"})]})]}),p.length>0&&t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"mono mt-6 text-[10px] uppercase tracking-[0.18em] text-[color:var(--ink-soft)]",children:"Next up"}),t.jsx("ul",{className:"mt-2 space-y-2",children:(B?p:p.slice(0,3)).map(e=>t.jsxs("li",{className:"flex flex-wrap items-center justify-between gap-3 rounded-lg border border-[color:var(--hairline)] p-4",children:[t.jsxs("div",{children:[t.jsxs("div",{className:"mono text-[10px] uppercase tracking-[0.18em] text-[color:var(--ink-soft)]",children:[C(e.event_date),Ae(e)," ·"," ",Z[e.event_type]??e.event_type,e.place?` · ${e.place}`:""]}),t.jsx("div",{className:"text-sm",children:e.title})]}),t.jsxs("div",{className:"flex gap-3 text-xs",children:[e.luma_url&&t.jsxs("a",{href:e.luma_url,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1 text-[color:var(--link)] underline underline-offset-4",children:["Register ",t.jsx(v,{size:11})]}),e.internal_url&&t.jsxs("a",{href:e.internal_url,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1 text-[color:var(--link)] underline underline-offset-4",children:["Details ",t.jsx(v,{size:11})]})]})]},e.id))}),p.length>3&&t.jsx("button",{type:"button",className:"btn btn-ghost mt-3",onClick:()=>le(e=>!e),children:B?"Show fewer":`Show all upcoming (${p.length})`})]}),t.jsx("div",{className:"mono mt-8 text-[10px] uppercase tracking-[0.18em] text-[color:var(--ink-soft)]",children:"History"}),t.jsxs("ul",{className:"mt-2 divide-y divide-[color:var(--hairline)] rounded-lg border border-[color:var(--hairline)]",children:[(D?g:g.slice(0,5)).map(e=>t.jsxs("li",{className:"flex flex-wrap items-center justify-between gap-3 px-4 py-3",children:[t.jsxs("div",{className:"min-w-0",children:[t.jsxs("div",{className:"mono text-[10px] uppercase tracking-[0.18em] text-[color:var(--ink-soft)]",children:[C(e.event.event_date)," · ",Z[e.event.event_type]??e.event.event_type]}),t.jsx("div",{className:"truncate text-sm",children:e.event.title}),e.note&&t.jsx("div",{className:"text-xs text-[color:var(--ink-soft)]",children:e.note})]}),t.jsx("span",{className:"mono text-[10px] uppercase tracking-[0.18em]",children:Pe[e.status]??e.status})]},e.id)),g.length===0&&t.jsx("li",{className:"p-6 text-sm text-[color:var(--ink-soft)]",children:"Nothing recorded yet."})]}),g.length>5&&t.jsx("button",{type:"button",className:"btn btn-ghost mt-3",onClick:()=>ie(e=>!e),children:D?"Show less":`Show full history (${g.length})`})]}),t.jsxs("section",{className:"mt-14 border-t border-[color:var(--hairline)] pt-10",children:[t.jsx("h2",{className:"text-2xl",children:"My contributions"}),t.jsx("p",{className:"mt-1 text-sm text-[color:var(--ink-soft)]",children:"Everything you own right now — including work that is not announced on the website yet."}),A.length>0&&t.jsxs("div",{className:"mono mt-6 text-[10px] uppercase tracking-[0.18em] text-[color:var(--ink-soft)]",children:["Active now (",A.length,")"]}),t.jsx("ul",{className:"mt-3 grid gap-3 md:grid-cols-2",children:A.map(e=>t.jsxs("li",{className:"card-hairline p-5",children:[t.jsxs("div",{className:"mono text-[10px] uppercase tracking-[0.18em] text-[color:var(--ink-soft)]",children:["Internal · ",X[e.status]??e.status,e.started_on?` · since ${C(e.started_on)}`:""]}),t.jsx("h3",{className:"font-display text-lg",children:e.title}),e.contribution&&t.jsx("p",{className:"mt-1 text-sm text-[color:var(--ink-soft)]",children:e.contribution}),t.jsxs("div",{className:"mt-2 flex flex-wrap gap-3 text-xs",children:[e.impact_slug&&t.jsx("a",{href:`/impact/${e.impact_slug}`,className:"text-[color:var(--link)] underline underline-offset-4",children:"Impact record"}),e.link_url&&t.jsxs("a",{href:e.link_url,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1 text-[color:var(--link)] underline underline-offset-4",children:["Public link ",t.jsx(v,{size:11})]}),e.internal_url&&t.jsxs("a",{href:e.internal_url,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1 text-[color:var(--link)] underline underline-offset-4",children:["Internal link ",t.jsx(v,{size:11})]})]})]},e.id))}),x.length>0&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"mono mt-8 text-[10px] uppercase tracking-[0.18em] text-[color:var(--ink-soft)]",children:["Completed & credits (",x.length,")"]}),t.jsx("ul",{className:"mt-3 divide-y divide-[color:var(--hairline)] rounded-lg border border-[color:var(--hairline)]",children:(R?x:x.slice(0,6)).map(e=>t.jsxs("li",{className:"flex flex-wrap items-center justify-between gap-3 px-4 py-3",children:[t.jsxs("div",{className:"min-w-0",children:[t.jsx("div",{className:"truncate text-sm",children:e.title}),t.jsx("div",{className:"mono text-[10px] uppercase tracking-[0.18em] text-[color:var(--ink-soft)]",children:e.label})]}),e.slug&&t.jsx("a",{href:`/impact/${e.slug}`,className:"text-xs text-[color:var(--link)] underline underline-offset-4",children:"Impact record"})]},e.key))}),x.length>6&&t.jsx("button",{type:"button",className:"btn btn-ghost mt-3",onClick:()=>oe(e=>!e),children:R?"Show less":`Show all ${x.length}`})]}),w.length===0&&Y.length===0&&t.jsx("div",{className:"mt-5 rounded-lg border border-[color:var(--hairline)] p-6 text-sm text-[color:var(--ink-soft)]",children:"No contributions recorded yet."})]})]})}export{qe as component};

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.