PageSourceSearch

https://www.gemphere.com/assets/SFTechWeek-DGI66wYe.js

js gemphere.com collected 2026-10-02 01:30:24 UTC 84,600 bytes, 25 lines download raw bytes

1import{bm as be,j as e,u as F,r as l,e3 as Ts,bd as Es,as as tn,ck as rs,ab as cs,bU as $s,by as an,d as Be,dn as on,e4 as ln,dq as rn,dr as cn,dj as dn}from"./index-t4UNL-er.js";import{Q as O,S as hn,T as un,V as mn,X as Is,Y as pn,Z as gn,_ as xn,$ as fn,F as yn,a0 as vn,a1 as jn,H as Nn,G as bn,a2 as kn,a3 as wn,a4 as Cn,a5 as Sn,c as V,d as Tn,a6 as ds,e as En,a7 as As,a8 as Ps,l as Ne,h as se,a9 as Le,aa as We,ab as ze,p as Ls,r as Ws,q as zs,ac as $n,ad as hs,ae as Fs,af as In,W as An,ag as Pn,ah as Ln,ai as Wn}from"./sf-tech-week-CWiSP6r6.js";import{s as zn,b as ne,f as Os,c as Rs,d as Ys,e as Fn,g as On,a as Rn,r as Yn,h as Un}from"./api-CykbWEt-.js";import{O as Mn,C as Bn,u as Gn,p as _n,v as Hn,V as Dn,B as qn,A as Vn,W as Jn,Z as Kn,a0 as Zn,a1 as Qn,U as Xn,y as et,S as st,N as nt}from"./api-DzEwHsS8.js";import{Q as Fe}from"./QrCode-Bvvwo3ZD.js";import{C as us}from"./chevron-right-vNJNS7I3.js";import"./map-pin-Bs8yA5Hl.js";import"./plus-B0nFezmJ.js";import"./accounts-Dq7TYPam.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 tt=be("CalendarDays",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}],["path",{d:"M8 14h.01",key:"6423bh"}],["path",{d:"M12 14h.01",key:"1etili"}],["path",{d:"M16 14h.01",key:"1gbofw"}],["path",{d:"M8 18h.01",key:"lrp35t"}],["path",{d:"M12 18h.01",key:"mhygvu"}],["path",{d:"M16 18h.01",key:"kzsmim"}]]);/**
7 * @license lucide-react v0.462.0 - ISC
8 *
9 * This source code is licensed under the ISC license.
10 * See the LICENSE file in the root directory of this source tree.
11 */const at=be("CircleHelp",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/**
12 * @license lucide-react v0.462.0 - ISC
13 *
14 * This source code is licensed under the ISC license.
15 * See the LICENSE file in the root directory of this source tree.
16 */const ms=be("Pencil",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]);/**
17 * @license lucide-react v0.462.0 - ISC
18 *
19 * This source code is licensed under the ISC license.
20 * See the LICENSE file in the root directory of this source tree.
21 */const ot=be("Share2",[["circle",{cx:"18",cy:"5",r:"3",key:"gq8acd"}],["circle",{cx:"6",cy:"12",r:"3",key:"w7nqdw"}],["circle",{cx:"18",cy:"19",r:"3",key:"1xt0gg"}],["line",{x1:"8.59",x2:"15.42",y1:"13.51",y2:"17.49",key:"47mynk"}],["line",{x1:"15.41",x2:"8.59",y1:"6.51",y2:"10.49",key:"1n3mei"}]]);function ke({msg:s}){return s?e.jsx("p",{className:"sfwerr",children:s}):null}const lt=["Raising? Stage, amount, funds you have talked to.","Selling? Company size, who signs, who you beat.","Hiring? The role, the level, what they have done.","Partnering? What sits next to your product."].join(`
22`);function it(){const{s,set:n,patch:t,go:a,signIn:c}=O(),{user:i}=F(),r=l.useRef(null),[o,d]=l.useState(!1),[m,p]=l.useState("");async function h(){const g=i==null?void 0:i.accessToken;if(!g){c("attendee");return}if(!s.hunt.length){p("Pick at least one thing you are hunting.");return}d(!0),p("");try{await zn(g,{hunt:s.hunt,seeking:s.seeking,targets:s.targets,viewerUserId:(i==null?void 0:i.userId)??null}),a("monday")}catch(S){p(S instanceof Error?S.message:"Could not save what you are hunting")}finally{d(!1)}}const b=g=>{const S=s.hunt.indexOf(g),u=s.hunt.slice();S>=0?u.splice(S,1):u.push(g),n("hunt",u)},w=()=>{var S;const g=s.targetInput.trim();g&&(t({targets:[...s.targets,g],targetInput:""}),(S=r.current)==null||S.focus())};return e.jsxs(e.Fragment,{children:[e.jsxs("div",{style:{marginBottom:18},children:[e.jsx("span",{className:"eyeb",children:"Step 1 of 2"}),e.jsx("h2",{className:"d2",style:{marginTop:6},children:"Who are you hunting?"}),e.jsxs("p",{className:"lede",style:{marginTop:10},children:[hn(s.hunt)," I rank every room against all of them."]})]}),e.jsx("div",{className:"grid g2",style:{gridTemplateColumns:"repeat(auto-fit,minmax(240px,1fr))"},children:un.map(([g,S])=>e.jsxs("button",{className:"pick","aria-pressed":s.hunt.includes(g),onClick:()=>b(g),children:[e.jsx("span",{className:"tick",children:"✓"}),e.jsx("span",{className:"nm",children:g}),e.jsx("span",{className:"ds",children:S})]},g))}),e.jsxs("div",{className:"grid g2 huntgrid",style:{marginTop:18},children:[e.jsxs("div",{className:"card sky stack ask",children:[e.jsxs("div",{children:[e.jsx("span",{className:"eyeb",children:"The part that decides everything"}),e.jsx("h3",{className:"d3",style:{marginTop:6},children:"Tell me more about who you want to meet."})]}),e.jsxs("label",{className:"fld",children:[e.jsx("span",{className:"l",children:"In your own words"}),e.jsx("textarea",{style:{minHeight:216},value:s.seeking,onChange:g=>n("seeking",g.target.value),placeholder:lt})]}),e.jsx("p",{className:"note",children:"Never shown to anyone. It decides which names come back."})]}),e.jsxs("div",{className:"card huntside",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"d3",children:"Anyone specific?"}),e.jsx("p",{className:"note",style:{marginTop:8},children:"Name companies or people. If they are in a room this week, I will tell you."}),e.jsxs("div",{style:{display:"flex",gap:10,marginTop:16,flexWrap:"wrap"},children:[e.jsx("input",{ref:r,className:"huntadd",value:s.targetInput,onChange:g=>n("targetInput",g.target.value),onKeyDown:g=>{g.key==="Enter"&&(g.preventDefault(),w())},placeholder:"Stripe · Sarah at Sequoia",autoComplete:"off","aria-label":"Add a company or a person"}),e.jsx("button",{className:"btn btn-t",onClick:w,children:"Add"})]})]}),e.jsxs("div",{style:{marginTop:20},children:[e.jsx("span",{className:"plbl",children:"On your list"}),e.jsx("div",{className:"chips",style:{marginTop:12},children:s.targets.length?s.targets.map((g,S)=>e.jsxs("span",{className:"chip",children:[g,e.jsx("button",{"aria-label":`Remove ${g}`,onClick:()=>n("targets",s.targets.filter((u,k)=>k!==S)),children:"×"})]},`${g}-${S}`)):e.jsx("span",{className:"note",children:"Nothing yet."})})]}),e.jsx(ke,{msg:m}),e.jsx(mn,{note:"Private to you.",children:e.jsx("button",{className:"btn btn-p",onClick:h,disabled:o,children:o?"Saving…":"Continue"})})]})]})]})}const rt=[["I read your open hours","The five days of the week, nothing else."],["I rank every room","Scored against the hunt you just described."],["I fill the gaps","The right room each hour, and who to meet in it."]];function ct(){const{s,go:n,signIn:t}=O(),{user:a}=F(),[c,i]=l.useState(!1),[r,o]=l.useState(""),d=Is(),m=s.calConnected;async function p(){const h=a==null?void 0:a.accessToken;if(!h){t("attendee");return}i(!0),o("");try{Ts({path:"/sf-tech-week",step:pn,mailboxProvider:"google"}),await Es(h,"google",{googleScopeTier:"calendar"})}catch(b){o(b instanceof Error?b.message:"Could not start Google Calendar"),i(!1)}}return e.jsx("div",{className:"calstep",children:e.jsx("div",{className:"card calcard calswap",children:m?e.jsx(Us,{label:`${s.calendarProvider==="microsoft"?"Outlook":"Google Calendar"} connected · ${d.roomTotal} rooms`,onDone:()=>n("week")}):e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"eyeb",children:"Last step"}),e.jsx("h2",{className:"d2 caltitle",children:"Connect your calendar"}),e.jsx("p",{className:"lede calsub",children:"I plan all five days around what you already have on."}),e.jsx("ol",{className:"caldoes",children:rt.map(([h,b])=>e.jsxs("li",{children:[e.jsx("b",{children:h}),e.jsx("span",{children:b})]},h))}),e.jsx(ke,{msg:r}),e.jsx("div",{className:"calgo",children:e.jsx("button",{className:"btn btn-p",onClick:p,disabled:c,
22children:c?"Opening Google…":"Connect Google Calendar"})})]})},m?"scan":"ask")})}function Us({label:s,onDone:n,phases:t=gn,doneTitle:a="Your week is set.",cta:c="See my week",busy:i=!1}){const[r,o]=l.useState(0);l.useEffect(()=>{if(r>=t.length)return;const h=window.setTimeout(()=>o(b=>b+1),850);return()=>window.clearTimeout(h)},[r,t.length]);const d=r>=t.length,m=Math.round(Math.min(r,t.length)/t.length*100),p=2*Math.PI*46;return e.jsxs("div",{className:"calscan",children:[e.jsxs("div",{className:"ringwrap",children:[e.jsxs("svg",{viewBox:"0 0 100 100","aria-hidden":"true",children:[e.jsx("circle",{cx:"50",cy:"50",r:"46",fill:"none",stroke:"rgba(188,210,242,.16)",strokeWidth:"7"}),e.jsx("circle",{cx:"50",cy:"50",r:"46",fill:"none",stroke:"var(--accent)",strokeWidth:"7",strokeLinecap:"round",strokeDasharray:p.toFixed(1),strokeDashoffset:(p*(1-m/100)).toFixed(1),style:{transition:"stroke-dashoffset .55s cubic-bezier(.3,.7,.3,1)"}})]}),e.jsxs("span",{className:"val",children:[m,"%"]})]}),e.jsxs("div",{children:[e.jsx("span",{className:"eyeb",children:s}),e.jsx("h2",{className:"d2 caltitle","aria-live":"polite",children:d?a:"Sniffing around."}),e.jsx("ol",{className:"calphases",children:t.map((h,b)=>e.jsxs("li",{className:`phase ${b<r?"done":b===r?"now":""}`,children:[e.jsx("span",{className:"m","aria-hidden":"true",children:b<r?"✓":b===r?"●":""}),e.jsx("span",{children:h})]},h))}),e.jsx("div",{className:`calout${d?" in":""}`,children:e.jsx("button",{className:"btn btn-p",onClick:n,disabled:i,tabIndex:d?0:-1,"aria-hidden":!d,children:c})})]})]})}const dt=900;let Ie={};function Ms(){const{user:s}=F(),n=s==null?void 0:s.accessToken,t=l.useRef(void 0);return l.useEffect(()=>()=>{t.current&&window.clearTimeout(t.current)},[]),l.useCallback(a=>{n&&(Ie={...Ie,...a},t.current&&window.clearTimeout(t.current),t.current=window.setTimeout(()=>{ne(n,{...Ie}).catch(()=>{})},dt))},[n])}const ht=1200;function ut(s){const n=new Set;for(const{ev:t}of fn(s))typeof t.id=="number"&&t.id>0&&n.add(t.id);return[...n]}function mt(s){const{user:n}=F(),t=n==null?void 0:n.accessToken,[a,c]=l.useState({joined:null,syncing:!1,failed:null}),i=l.useRef(s);i.current=s;const r=l.useRef(void 0),o=l.useRef(null),d=l.useCallback(async()=>{if(!t||!xn())return!0;const h=ut(i.current),b=h.slice().sort((w,g)=>w-g).join(",");if(b===o.current)return!0;o.current=b,c(w=>({...w,syncing:!0,failed:null}));try{const w=await Mn(t,h);return c({joined:w.count,syncing:!1,failed:null}),!0}catch(w){return o.current=null,c(g=>({...g,syncing:!1,failed:w instanceof Error?w.message:"Could not save your week"})),!1}},[t]),m=l.useCallback(()=>(r.current&&window.clearTimeout(r.current),d()),[d]),p=Object.keys(s).length>0;return l.useEffect(()=>{if(!(!p||!t))return r.current&&window.clearTimeout(r.current),r.current=window.setTimeout(()=>void d(),ht),()=>{r.current&&window.clearTimeout(r.current)}},[s,p,t,d]),{...a,flush:m}}function pt(){const{s,patch:n,go:t}=O(),{week:a,calSlot:c}=s,i=Ms(),r=mt(a);l.useEffect(()=>{const m={};for(const[p,h]of Object.entries(a))m[p]=h==="none"?"none":h.t;i({week:m})},[a,i]);const o=(m,p,h)=>{n({week:{...a,[bn(m,p)]:h??"none"}})},d=r.failed?e.jsx("button",{className:"btn btn-s",onClick:()=>t("league"),children:"Carry on anyway"}):null;return e.jsx(yn,{eventAt:(m,p)=>vn(m,p,a),optionsAt:jn,setSlot:o,calSlot:c,onCalSlot:m=>n({calSlot:m}),phrase:Nn(s.hunt),cover:{label:r.syncing?"Covering your week…":"Cover the whole week",disabled:r.syncing,onClick:async()=>{await r.flush()&&t("league")}},extra:d,note:gt(r)})}function gt(s){return s.failed?`Week saved, but I could not add you to the rooms — ${s.failed}`:s.syncing?"Adding you to the rooms…":s.joined!=null?s.joined===0?"Your calendar is clear — you are on no room's list.":`You are on ${s.joined} room${s.joined===1?"":"s"}. They are on your home page.`:"What you leave on the calendar is the week you cover."}function xt(){const{s,go:n}=O();return Is(),e.jsxs(e.Fragment,{children:[e.jsxs("div",{style:{marginBottom:18},children:[e.jsx("span",{className:"eyeb",children:"Post it"}),e.jsx("h2",{className:"d2",style:{marginTop:6,maxWidth:"22ch"},children:"Post this so the right people find you."}),e.jsx("p",{className:"lede",style:{marginTop:10,maxWidth:"58ch"},children:"Put your week on LinkedIn. Anyone in the same rooms sees where you will be, and you both arrive knowing who to look for."})]}),e.jsx("div",{className:"postbar",children:e.jsxs("span",{className:"postbar-acts",children:[e.jsx("button",{className:"btn btn-p",onClick:()=>kn(s.posterStyle,s.week,s.name),children:"Download poster"}),e.jsx("button",{className:"btn btn-t",onClick:()=>n("week"),children:"Edit my week"})]})}),e.jsx(wn,{week:s.week}),e.jsx(Cn,{title:"Everything above is waiting on one date.",note:"Names, rooms and intros land the week before.",label:"See what lands",target:"reveal"})]})}function ft(s){return{id:s.id,name:s.name,code:s.inviteCode,seats:s.seats,pending:s.pending??0,startsAt:s.seasonStartedAt??null,endsAt:s.seasonEndsAt??null}}function yt(){const{patch:s}=O(),{user:n}=F(),t=n==null?void 0:n.accessToken;return l.useCallback(a=>{s({league:a}),t&&ne(t,{leagueId:a.id,leagueName:a.name,leagueCode:a.code,leagueSeats:a.seats,leaguePending:a.pending}).catch(()=>{})},[s,t])}function vt(s){const n=s.replace(/\s+/g," ").trim().split(" ").filter(
22Boolean);return n.length>=2?(n[0][0]+n[n.length-1][0]).toUpperCase():(s.slice(0,2)||"?").toUpperCase()}function Bs(s){const n=s.name.split(" ")[0]||s.name,t=s.tier&&tn(s.tier)||"In your contacts";return{key:`c${s.contactId}`,n:s.name,i:s.mark||vt(s.name),r:s.role||"On your calendar",m:t,line:`On Friday I will tell you which doors ${n} and you can open for each other.`,contactId:s.contactId,userId:s.userId,onGemphere:s.onGemphere,tier:s.tier}}const jt=60,Nt=280;function bt(s){const{user:n,isReady:t}=F(),a=n==null?void 0:n.accessToken,[c,i]=l.useState([]),[r,o]=l.useState(0),[d,m]=l.useState(!1),[p,h]=l.useState(!0),[b,w]=l.useState(null),[g,S]=l.useState(0),u=l.useRef(0),k=l.useCallback(()=>S(j=>j+1),[]);return l.useEffect(()=>{if(!t){h(!0);return}if(!a){i([]),o(0),m(!1),w(null),h(!1);return}const j=++u.current;h(!0);const v=window.setTimeout(()=>{(async()=>{try{const x=await Bn(a,{search:s.trim()||void 0,limit:jt});if(u.current!==j)return;i(x.candidates.map(Bs)),o(x.total),m(!!x.suggested),w(null)}catch(x){if(u.current!==j)return;w(x instanceof Error?x.message:"Could not read your calendar people")}finally{u.current===j&&h(!1)}})()},s?Nt:0);return()=>window.clearTimeout(v)},[t,a,s,g]),{faces:c,loading:p,error:b,total:r,ready:t,live:!!a,suggested:d,reload:k}}const ps=[["Add up to 8 people you trust.","Read off your calendar. Nothing to import."],["Everyone writes down who they want.","One line each, and only I read it."],["I match who they meet to every list.","Every room any of the eight walks into."],["You get the intro.","With the reason, and how they know them."]],Gs=Math.PI*2,_s=-Math.PI/2,gs=4,xs=Array.from({length:gs},(s,n)=>_s+(n+.5)/gs*Gs);function Hs(s){const n=(a,c)=>({x:s.cx+Math.cos(a)*c,y:s.cy+Math.sin(a)*c*s.squash}),t=xs.map(a=>n(a,s.ring));return{plan:s,slots:t,labels:xs.map(a=>n(a,s.ring+s.label)),specks:Array.from({length:9},(a,c)=>{const i=_s+c/9*Gs+.31,r=n(i,s.ring+s.scenery+c%3*14);return[r.x,r.y,1.5+c%3*.6]}),edges:t.map((a,c)=>({x1:s.cx,y1:s.cy,x2:a.x,y2:a.y,s:2+c,big:!0}))}}const kt=Hs({w:720,h:520,cx:360,cy:248,squash:.66,ring:202,label:66,scenery:74,rSeat:25,rYou:34}),wt=Hs({w:540,h:372,cx:270,cy:188,squash:.66,ring:172,label:80,scenery:56,rSeat:22,rYou:29});function fs(s,n){return n>s-2}function ys({x:s,y:n,r:t,cls:a="",ini:c="",label:i,labelAt:r,on:o}){return e.jsxs("g",{className:`lgnd ${a}${o?" in":""}`,children:[e.jsx("circle",{className:"ring",cx:s,cy:n,r:t+6}),e.jsx("circle",{className:"face",cx:s,cy:n,r:t}),e.jsx("text",{className:"ini",x:s,y:n+4,children:c}),i!==void 0&&e.jsx("text",{className:"lb",x:(r==null?void 0:r.x)??s,y:(r==null?void 0:r.y)??n+t+22,children:i})]})}function Ds(s){const n=s.split(" ")[0]||s;return n.length>13?`${n.slice(0,12)}…`:n}function vs({g:s,zoom:n,chosen:t}){const{plan:a}=s,c=t.length;return e.jsx("svg",{viewBox:`0 0 ${a.w} ${a.h}`,role:"img","aria-label":"A map that grows from you to each person you seat in your league.",children:e.jsxs("g",{className:"lgzoom",style:{transform:`scale(${n})`,transformOrigin:`${a.cx}px ${a.cy}px`},children:[s.specks.map(([i,r,o],d)=>e.jsx("circle",{className:"lgamb",cx:i,cy:r,r:o},`amb${d}`)),s.edges.map((i,r)=>e.jsx("line",{className:(i.glow?"lgglow":"lgedge")+(i.big?" lg":"")+(fs(i.s,c)?" in":""),x1:i.x1,y1:i.y1,x2:i.x2,y2:i.y2},`e${r}`)),s.slots.map((i,r)=>{var o;return e.jsx(ys,{x:i.x,y:i.y,r:a.rSeat,cls:"league",ini:((o=t[r])==null?void 0:o.i)??"",label:t[r]?Ds(t[r].n):"",labelAt:s.labels[r],on:fs(2+r,c)},`slot${r}`)}),e.jsx(ys,{x:a.cx,y:a.cy,r:a.rYou,cls:"you",ini:"You",on:!0})]})})}function Ae({title:s,sub:n,onClose:t,foot:a,children:c}){const[i,r]=l.useState(!1),o=l.useRef(0);l.useEffect(()=>()=>window.clearTimeout(o.current),[]);const d=l.useCallback(()=>{o.current||(r(!0),o.current=window.setTimeout(t,Ct))},[t]);return l.useEffect(()=>{const m=p=>{p.key==="Escape"&&d()};return window.addEventListener("keydown",m),()=>window.removeEventListener("keydown",m)},[d]),e.jsxs("div",{className:`lgsheet${i?" out":""}`,role:"dialog","aria-modal":"true","aria-label":s,children:[e.jsx("button",{className:"lgsheet-scrim","aria-label":"Close",onClick:d}),e.jsxs("div",{className:"lgsheet-box",children:[e.jsx("span",{className:"lgsheet-grip","aria-hidden":"true"}),e.jsxs("div",{className:"lgsheet-h",children:[e.jsxs("span",{className:"lgsheet-t",children:[e.jsx("b",{children:s}),n?e.jsx("span",{className:"note",children:n}):null]}),e.jsx("button",{className:"lgsheet-x",onClick:d,"aria-label":"Close",children:e.jsx($s,{size:17,strokeWidth:1.7,"aria-hidden":"true"})})]}),e.jsx("div",{className:"lgsheet-body",children:c}),a?e.jsx("div",{className:"lgsheet-foot",children:a}):null]})]})}const Ct=190,St=170;
22function js({people:s,list:n,term:t,chosenKeys:a,seatedKeys:c,room:i,toggle:r,className:o=""}){return e.jsxs(e.Fragment,{children:[e.jsx("div",{className:`lgsugs ${o}`.trim(),children:!s.ready||s.live&&s.loading&&!n.length?e.jsx("p",{className:"note",style:{padding:"16px 2px"},children:"Reading your calendar…"}):s.live?s.error?e.jsxs("div",{className:"sfwerr",children:[s.error," ",e.jsx("button",{className:"btn mini btn-t",onClick:s.reload,style:{marginLeft:8},children:"Try again"})]}):n.length?n.map(d=>{const m=a.has(d.key),p=c.has(d.key),h=!m&&i<=0;return e.jsxs("div",{className:`lgsug${m?" added":""}`,children:[e.jsx("span",{className:"av sm",children:d.i}),e.jsxs("span",{className:"tx",children:[e.jsx("b",{children:d.n}),e.jsxs("span",{className:"note",children:[d.r," · ",d.m]})]}),e.jsx("button",{className:`btn ${m?"btn-t":"btn-p"}`,style:{padding:"9px 17px",fontSize:"13.5px"},disabled:h||p,"aria-pressed":m,"aria-label":m?`Remove ${d.n}`:`Add ${d.n}`,onClick:()=>r(d),children:p?"Seated":m?"Added":h?"Full":"Add"})]},d.key)}):e.jsx("p",{className:"note",style:{padding:"16px 2px"},children:t?"Nobody by that name in your contacts.":"Nothing on your calendar yet — write somebody in below."}):e.jsx("p",{className:"note",style:{padding:"16px 2px",maxWidth:"52ch"},children:"Set up your account and the people you already meet with land here — the ones you actually keep up with, first."})}),s.live&&!t&&s.suggested&&n.length>0&&e.jsxs("p",{className:"note lgsugs-note",style:{padding:"2px 2px 0"},children:["The people you keep up with most — ",s.total," ",s.total===1?"person":"people",". Search to reach anybody else in your contacts."]})]})}const Ns=4,bs="SF Tech Week";function Tt(){var is;const{s,go:n,signIn:t}=O(),{user:a}=F(),c=a==null?void 0:a.accessToken,i=yt(),[r,o]=l.useState(0),[d,m]=l.useState([]),[p,h]=l.useState(""),[b,w]=l.useState(!1),g=l.useRef([]),S=Ms(),u=s.league,[k,j]=l.useState((u==null?void 0:u.name)??""),[v,x]=l.useState(!1),[N,E]=l.useState(""),[I,A]=l.useState(null),[R,_]=l.useState([]),[J,te]=l.useState(""),[K,T]=l.useState(""),[C,U]=l.useState(""),[H,Y]=l.useState(""),[z,Ge]=l.useState(!1),[de,le]=l.useState("");l.useEffect(()=>{u!=null&&u.name&&j(u.name)},[u==null?void 0:u.name]);const M=bt(p),[we,Ks]=l.useState([]),he=M.live,ae=p.trim().toLowerCase(),_e=l.useMemo(()=>{const f=ae?we.filter(y=>y.n.toLowerCase().includes(ae)||y.r.toLowerCase().includes(ae)):we,P=new Set,$=[];for(const y of[...f,...M.faces])P.has(y.key)||(P.add(y.key),$.push(y));return $},[ae,we,M.faces]);l.useEffect(()=>{b&&S({league:d.map(f=>f.n)})},[b,d,S]);const D=l.useCallback(()=>{g.current.forEach(f=>window.clearTimeout(f)),g.current=[]},[]),ue=l.useCallback(()=>{var P;if(D(),o(0),(P=window.matchMedia)==null?void 0:P.call(window,"(prefers-reduced-motion: reduce)").matches){o(1);return}g.current.push(window.setTimeout(()=>o(1),900))},[D]);l.useEffect(()=>(ue(),D),[ue,D]);const ie=Sn(),[Ce,Z]=l.useState(null),[re,me]=l.useState(!1),[He,De]=l.useState("name"),[Zs,qe]=l.useState(!1),pe=l.useRef(0),[ge,Ve]=l.useState(!1),[Je,Ke]=l.useState(""),Se=l.useRef(0);l.useEffect(()=>()=>{window.clearTimeout(pe.current),window.clearTimeout(Se.current)},[]),l.useEffect(()=>{u&&De("seats")},[u]);const Ze=l.useCallback(f=>{pe.current||(qe(!0),pe.current=window.setTimeout(()=>{pe.current=0,De(f),qe(!1)},St))},[]),Te=l.useCallback(f=>{ie&&(window.clearTimeout(Se.current),Ke(f),Se.current=window.setTimeout(()=>Ke(""),2400))},[ie]),Q=l.useMemo(()=>new Set(R),[R]),ce=l.useMemo(()=>d.filter(f=>!Q.has(f.key)),[d,Q]),xe=(u?u.seats:1)+ce.length,B=V-xe,Ee=f=>{if(Q.has(f.key))return;w(!0),E(""),A(null),D(),o(1);const P=!d.some($=>$.key===f.key);P&&B<=0||(m($=>$.some(y=>y.key===f.key)?$.filter(y=>y.key!==f.key):B>0?[...$,f]:$),Te(P?`${f.n.split(" ")[0]} has a seat`:`${f.n.split(" ")[0]} is off the map`))},Qe=l.useCallback(async(f=()=>n("post"))=>{if(!c){t("attendee");return}const P=ce.map($=>$.contactId).filter($=>typeof $=="number");if((u||!k.trim())&&!P.length){f();return}x(!0),E(""),A(null);try{const $=u?await Gn(c,u.id,[],P,bs):await _n(c,{name:k.trim()||"My SF Tech Week league",memberContactIds:P,eventLabel:bs});i(ft($.league)),_(W=>[...W,...ce.map(q=>q.key)]);const y=$.invites??{sent:0,skipped:[]};if(y.failed||y.skipped.length){A(y);return}f()}catch($){E($ instanceof Error?$.message:"Could not build the league")}finally{x(!1)}},[c,t,u,k,ce,i,n]),fe=l.useCallback(async()=>
22{if(!c){t("attendee");return}const f=K.trim(),P=C.trim();if(!f){le("A name — the seat has to be somebody's.");return}if(!/^[^\s@]+@[^\s@]+\.[^\s@]{2,}$/.test(P)){le("An email address. That is how the seat reaches them.");return}if(B<=0){le(`Every seat is taken — a league holds ${V}, yours included.`);return}Ge(!0),le("");try{const $=await Hn(c,{name:f,email:P,company:H.trim()||void 0}),y=Bs($.candidate);Ks(W=>[y,...W.filter(q=>q.key!==y.key)]),m(W=>W.some(q=>q.key===y.key)?W:[...W,y]),w(!0),D(),o(1),T(""),U(""),Y(""),Te(`${f.split(" ")[0]} has a seat`),M.reload()}catch($){le($ instanceof Error?$.message:"Could not add them")}finally{Ge(!1)}},[c,t,K,C,H,B,D,M,Te]),X=u!=null&&u.code?Dn(u.code):"",oe=u?Math.max(0,V-u.seats):0,ye=u?Math.max(0,Tn-(u.seats-u.pending)):0,ve=f=>{const P=f==="link"?X:(u==null?void 0:u.code)||"";P&&En(P).then($=>{$&&(te(f),window.setTimeout(()=>te(""),1600))})},Qs=k.trim().length>0,Xe=u?`Add people to ${u.name}`:Qs?`Add people to ${k.trim()}`:"Add the people you already meet with",L=d.length,Xs=((is=d[L-1])==null?void 0:is.line)??"",es=L?Math.min(100,45+Math.min(L,Ns)*(55/Ns)):r===1?45:12,ss=L?`Your league: ${L}${L===1?" person":" people"}`:r===1?"The people you already know are going too":"Just you, one calendar",$e=L?Xs:r===1?"":"Forty events run this week. You will get to three of them and guess about the rest.",ns=he?String(L):L?String(L*3):r===1?"18":"3",ts=he?L===1?"person in your league":"people in your league":L?"doors you can open for each other":"of 40 events covered",en=L?1.2:1.62,as=l.useMemo(()=>new Set(d.map(f=>f.key)),[d]),os=c?v?"Saving…":"Save and continue":"Set up your account",ls=c?ce.length?ie?"Seating them sends each one an invitation, then shows you the map.":"Seating them sends each one an invitation, and takes you on.":u?ie?"Your league is saved. Tap the code to send it to anyone else.":"Your league is saved. Send the code above to anyone else.":"A league is optional — press on without one if you would rather.":"A league hangs off an account. Your calendar people will be waiting here.";if(ie){const f=ts.replace("people in your league","in your league").replace("person in your league","in your league").replace("doors 
22you can open for each other","doors to open").replace("of 40 events covered","of 40 events"),P=L?1:2,$=(u==null?void 0:u.name)||k.trim();return e.jsxs("div",{className:`lgph${ge?" lgph-mapped":" lgph-form"}`,children:[e.jsxs("div",{className:"lgph-say",children:[e.jsxs("div",{className:"lgph-eyeb",children:[e.jsx("span",{className:"eyeb",children:"Leagues"}),e.jsxs("button",{className:"lgph-how",onClick:()=>Z("how"),children:[e.jsx(at,{size:13,strokeWidth:1.8,"aria-hidden":"true"}),"How it works"]})]}),e.jsx("h2",{className:"d2",children:"You can't cover this week alone."}),!ge&&He==="name"&&L===0&&e.jsx("p",{className:"lede",children:"Eight people cover it with you. You skip an event, somebody in your league goes — and meets the person on your list."})]}),ge&&e.jsxs("div",{className:"lgpanel lgph-map",children:[e.jsxs("div",{className:"lgph-mh",children:[e.jsx("h3",{className:"d3",children:ss}),e.jsxs("div",{className:"lgchip",children:[e.jsx("b",{children:ns}),e.jsx("span",{children:f})]})]}),$e&&L>0?e.jsx("p",{className:"lede lgph-sub",children:$e}):null,!he&&L>0&&e.jsxs("div",{className:"lgcall",children:[e.jsx("b",{children:"Femi Adisa — CFO, Ledgerline"}),e.jsxs("span",{children:[d[0].n.split(" ")[0]," meets him Thursday. Your open deal since June."]})]}),e.jsx(vs,{g:wt,zoom:P,chosen:d}),Je?e.jsx("div",{className:"lgph-pop",role:"status",children:Je}):null,e.jsx("div",{className:"lgprog",children:e.jsx("i",{style:{width:`${es}%`}})}),e.jsxs("div",{className:"lgfoot lgph-mfoot",children:[e.jsx("div",{className:"lgtabs",role:"group","aria-label":"Steps",children:[["k1","1","You","You"],["k2","2","People","People you know"],["k3","3","League","Your league"]].map(([y,W,q,sn],je)=>{const nn=je===0?r===0:je===1?r===1&&L===0:L>0;return e.jsxs("button",{className:`lgtab${nn?" on":""}`,"aria-label":sn,disabled:je===2,onClick:()=>{D(),o(je===0?0:1)},children:[e.jsx("i",{className:y}),e.jsx("u",{children:W})," ",q]},y)})}),e.jsx("button",{className:"lgreplay",onClick:()=>{m(y=>y.filter(W=>Q.has(W.key))),ue()},children:"Start over"})]})]}),ge?e.jsxs("div",{className:"lgph-act",children:[e.jsx("button",{className:"btn btn-p",onClick:()=>n("post"),children:"Continue"}),e.jsxs("button",{className:"lgph-hand lgph-back",onClick:()=>Ve(!1),children:[e.jsx(ms,{size:13,strokeWidth:1.9,"aria-hidden":"true"}),"Edit the league"]})]}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:`lgph-do${Zs?" out":""}`,children:He==="name"?e.jsxs("div",{className:"lgph-stage",children:[e.jsxs("label",{className:"fld",children:[e.jsx("span",{className:"l",children:"Call it something"}),e.jsx("input",{value:k,onChange:y=>j(y.target.value),placeholder:"The Mission Ten","aria-label":"League name",autoComplete:"off"})]}),k.trim()?e.jsxs("p",{className:"note lgph-said",children:[e.jsx(rs,{size:13,strokeWidth:2.2,"aria-hidden":"true"}),k.trim(),". Now put people in it."]}):e.jsx("p",{className:"note",children:"You can name it later, or never — a league works either way."}),e.jsxs("button",{className:"lgph-add",onClick:()=>Ze("seats"),children:[e.jsx(cs,{size:16,strokeWidth:1.8,"aria-hidden":"true"}),k.trim()?"Next — add the people":"Skip, and add the people",e.jsx(us,{size:16,strokeWidth:1.7,"aria-hidden":"true"})]})]},"name"):e.jsxs("div",{className:"lgph-stage",children:[e.jsxs("div",{className:"lgph-seath",children:[u?e.jsx("b",{className:"lgph-nm",children:u.name}):e.jsxs("button",{className:"lgph-nm",onClick:()=>Ze("name"),children:[$||"Name your league",e.jsx(ms,{size:12,strokeWidth:1.9,"aria-hidden":"true"})]}),e.jsxs("span",{className:"note",children:[xe," of ",V," seats"]})]}),d.length>0&&e.jsx("div",{className:"lgph-chips",children:d.map(y=>{const W=Q.has(y.key);return e.jsxs("button",{className:`lgph-chip${W?" done":""}`,disabled:W,"aria-label":W?`${y.n} is seated`:`Remove ${y.n}`,onClick:()=>Ee(y),children:[e.jsx("span",{className:"av sm",children:y.i}),e.jsx("b",{children:Ds(y.n)}),W?e.jsx(rs,{size:12,strokeWidth:2.2,"aria-hidden":"true"}):e.jsx($s,{size:12,strokeWidth:2.2,"aria-hidden":"true"})]},y.key)})}),e.jsxs("button",{className:"lgph-add",onClick:()=>{me(!1),Z("people")},children:[e.jsx(cs,{size:16,strokeWidth:1.8,"aria-hidden":"true"}),d.length?"Add more people":"Add the people you already meet with",e.jsx(us,{size:16,strokeWidth:1.7,"aria-hidden":"true"})]}),M.live&&e.jsxs("button",{className:"lgph-hand",onClick:()=>{me(!0),Z("people")},children:[e.jsx(an,{size:14,strokeWidth:1.8,"aria-hidden":"true"}),"Not on your calendar? Type them in"]}),u&&e.jsxs("button",{className:"lgph-code",onClick:()=>Z("share"),children:[e.jsxs("span",{className:"lgph-code-l",children:[e.jsx("span",{className:"plbl",children:"Anyone with this can join"}),e.jsx("b",{children:u.code||"—"})]}),e.jsx(ot,{size:16,strokeWidth:1.7,"aria-hidden":"true"})]}),N&&e.jsx("div",{className:"sfwerr",children:N}),I&&e.jsx(ds,{invites:I})]},"seats")}),e.jsxs("div",{className:"lgph-act",children:[e.jsx("button",{className:"btn btn-p",disabled:v,onClick:()=>void Qe(()=>Ve(!0)),children:c&&!v?"Save":os}),e.jsx("p",{className:"note",children:ls})]})]}),Ce==="how"&&e.jsxs(Ae,{title:"How a league works",onClose:()=>Z(null),children:[e.jsx("p",{className:"lede lgph-howp",children:"Eight people cover the week with you. You skip an event, somebody in your league goes — and meets the person on your list."}),e.jsx("div",{className:"flow lgph-flow",children:ps.map(([y,W],q)=>e.jsxs("div",{className:"fstep",children:[e.jsx("span",{className:"c",children:q+1}),e.jsx("b",{children:y}),e.jsx("span",{className:"note",children:W})]},y))})]}),Ce==="people"&&e.jsxs(Ae,{title:Xe,sub:`${xe} of ${V} seats`,onClose:()=>Z(null),foot:e.jsx("button",{className:"btn btn-p",onClick:()=>Z(null),children:d.length?`Done — ${d.length} on the map`:"Done"}),children:[M.live&&e.jsxs("div",{className:"lgph-tabs",role:"tablist","aria-label":"Where they come from",children:[e.jsx("button",{role:"tab","aria-selected":!re,className:`lgph-tab${re?"":" on"}`,onClick:()=>me(!1),children:"Your calendar"}),e.jsx("button",{role:"tab","aria-selected":re,className:`lgph-tab${re?" on":""}`,onClick:()=>me(!0),children:"Type somebody in"})]}),M.live&&re?e.jsxs("div",{className:"lgman-f lgph-hand-f",children:[e.jsxs("label",{className:"fld",children:[e.jsx("span",{className:"l",children:"Name"}),e.jsx("input",{value:K,onChange:y=>T(y.target.value),placeholder:"Priya Shah","aria-label":"Their name",autoComplete:"off"})]}),e.jsxs("label",{className:"fld",children:[e.jsx("span",{className:"l",children:"Email"}),e.jsx("input",{type:"email",value:C,onChange:y=>U(y.target.value),placeholder:"[email protected]","aria-label":"Their email address",autoComplete:"off",inputMode:"email"})]}),e.jsxs("label",{className:"fld",children:[e.jsxs("span",{className:"l",children:["Company ",e.jsx("i",{children:"optional"})]}),e.jsx("input",{value:H,onChange:y=>Y(y.target.value),placeholder:"Cormorant","aria-label":"Their company",autoComplete:"off",onKeyDown:y=>{y.key==="Enter"&&fe()}})]}),e.jsx("button",{className:"btn btn-t",disabled:z||B<=0,onClick:()=>void fe(),children:z?"Adding…":B<=0?"Every seat is taken":"Add them"}),de&&e.jsx("div",{className:"sfwerr",children:de})]}):e.jsxs(e.Fragment,{children:[e.jsx("label",{className:"fld lgph-search",children:e.jsx("input",{type:"search",value:p,onChange:y=>h(y.target.value),placeholder:"Search your contacts","aria-label":"Search people",autoComplete:"off"})}),e.jsx(js,{people:M,list:_e,term:ae,chosenKeys:as,seatedKeys:Q,room:B,toggle:Ee,className:"lgph-sugs"})]})]}),Ce==="share"&&u&&e.jsxs(Ae,{title:"Send it on",onClose:()=>Z(null),children:[e.jsxs("p",{className:"note",children:["Anyone you send it to joins ",u.name,", takes an open seat and lands on the map beside you. Nothing to fill in, nothing to approve."]}),e.jsxs("p",{className:"note",style:{marginTop:6},children:[oe?`${oe} of ${V} seats ${oe===1?"is":"are"} still open. `:"Every seat is taken. ",ye?`${ye} more of you and everyone's targets go live to each other.`:"Everyone's targets are live, so it is already finding the doors."]}),e.jsxs("div",{className:"lgph-share",children:[e.jsx("span",{className:"plbl",children:"Anyone with this can join"}),e.jsx("div",{className:"lgcode",children:u.code||"—"}),e.jsxs("div",{className:"lgph-share-acts",children:[e.jsx("button",{className:"btn btn-t mini",onClick:()=>ve("code"),children:J==="code"?"Copied ✓":"Copy code"}),e.jsx("button",{className:"btn btn-t mini",disabled:!X,onClick:()=>
22ve("link"),children:J==="link"?"Copied ✓":"Copy link"})]})]}),X&&e.jsxs("div",{className:"lgph-qr",children:[e.jsx(Fe,{value:X,size:132,alt:`QR code to join ${u.name}`}),e.jsx("span",{className:"note",children:"Point a phone at it."})]})]})]})}return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"lghead",children:[e.jsx("span",{className:"eyeb",children:"Leagues"}),e.jsx("h2",{className:"d2",children:"You can't cover this week alone."}),e.jsx("p",{className:"lede lghead-p",children:"Eight people cover it with you. You skip an event, somebody in your league goes — and meets the person on your list."}),e.jsx("div",{className:"flow lgflow",children:ps.map(([f,P],$)=>e.jsxs("div",{className:"fstep",children:[e.jsx("span",{className:"c",children:$+1}),e.jsx("b",{children:f}),e.jsx("span",{className:"note",children:P})]},f))})]}),e.jsxs("div",{className:"lgstack",children:[e.jsxs("div",{className:"lgpair",children:[e.jsxs("div",{className:"card lglist",children:[e.jsx("span",{className:"eyeb",children:u?"Your league":"Build a league"}),e.jsx("h3",{className:"d3",style:{marginTop:6},children:u?u.name:"Name it. The people come next."}),u&&e.jsxs("p",{className:"note",style:{marginTop:8},children:[u.seats," of ",V," ",u.seats===1?"seat":"seats"," taken",u.pending?`, ${u.pending} held for people not on Gemphere yet`:"",". Send the code to anyone else you want in it."]}),u?null:e.jsxs("label",{className:"fld lglist-name",children:[e.jsx("span",{className:"l",children:"Call it something"}),e.jsx("input",{value:k,onChange:f=>j(f.target.value),placeholder:"The Mission Ten","aria-label":"League name",autoComplete:"off"})]}),e.jsxs("div",{className:"row between lgseat-h",style:{alignItems:"baseline"},children:[e.jsx("h3",{className:"d3",children:Xe}),e.jsxs("span",{className:"note",children:[xe," of ",V," seats"]})]}),e.jsx("label",{className:"fld",style:{display:"block",marginTop:16},children:e.jsx("input",{type:"search",value:p,onChange:f=>h(f.target.value),placeholder:"Search the people you already meet with","aria-label":"Search people",autoComplete:"off"})}),e.jsx(js,{people:M,list:_e,term:ae,chosenKeys:as,seatedKeys:Q,room:B,toggle:Ee}),M.live&&e.jsxs("div",{className:"lgman",children:[e.jsx("div",{className:"lgman-h",children:e.jsx("b",{children:"Not on your calendar?"})}),e.jsxs("div",{className:"lgman-f",children:[e.jsxs("label",{className:"fld",children:[e.jsx("span",{className:"l",children:"Name"}),e.jsx("input",{value:K,onChange:f=>T(f.target.value),placeholder:"Priya Shah","aria-label":"Their name",autoComplete:"off"})]}),e.jsxs("label",{className:"fld",children:[e.jsx("span",{className:"l",children:"Email"}),e.jsx("input",{type:"email",value:C,onChange:f=>U(f.target.value),placeholder:"[email protected]","aria-label":"Their email address",autoComplete:"off",inputMode:"email"})]}),e.jsxs("label",{className:"fld",children:[e.jsxs("span",{className:"l",children:["Company ",e.jsx("i",{children:"optional"})]}),e.jsx("input",{value:H,onChange:f=>Y(f.target.value),placeholder:"Cormorant","aria-label":"Their company",autoComplete:"off",onKeyDown:f=>{f.key==="Enter"&&fe()}})]}),e.jsx("button",{className:"btn btn-t",disabled:z||B<=0,onClick:()=>void fe(),children:z?"Adding…":B<=0?"Every seat is taken":"Add them"})]}),de&&e.jsx("div",{className:"sfwerr",children:de})]}),N&&e.jsx("div",{className:"sfwerr",children:N}),I&&e.jsx(ds,{invites:I}),e.jsxs("div",{className:"formfoot",children:[e.jsx("span",{className:"note",children:ls}),e.jsx("span",{className:"formfoot-btns",children:e.jsx("button",{className:"btn btn-p",disabled:v,onClick:()=>void Qe(),children:os})})]})]}),e.jsxs("div",{className:"lgpanel",children:[e.jsxs("div",{className:"lgh",children:[e.jsxs("div",{style:{minWidth:0},children:[e.jsx("h3",{className:"d3",children:ss}),e.jsx("p",{className:"lede",style:{marginTop:6,minHeight:46},children:$e})]}),e.jsxs("div",{className:"lgchip",children:[e.jsx("b",{children:ns}),e.jsx("span",{children:ts})]})]}),!he&&L>0&&e.jsxs("div",{className:"lgcall",children:[e.jsx("b",{children:"Femi Adisa — CFO, Ledgerline"}),e.jsxs("span",{children:[d[0].n.split(" ")[0]," meets him Thursday. Your open deal since June."]})]}),e.jsx(vs,{g:kt,zoom:en,chosen:d}),e.jsx("div",{className:"lgprog",children:e.jsx("i",{style:{width:`${es}%`}})}),e.jsxs("div",{className:"lgfoot",children:[e.jsx("div",{className:"lgtabs",role:"group","aria-label":"Steps",children:[["k1","1","You"],["k2","2","People you know"],["k3","3","Your league"]].map(([f,P,$],y)=>{const W=y===0?r===0:y===1?r===1&&L===0:L>0;return e.jsxs("button",{className:`lgtab${W?" on":""}`,disabled:y===2,onClick:()=>{D(),o(y===0?0:1)},children:[e.jsx("i",{className:f}),e.jsx("u",{children:P})," ",$]},f)})}),e.jsx("button",{className:"lgreplay",onClick:()=>{m(f=>f.filter(P=>Q.has(P.key))),ue()},children:"Start over"})]})]})]}),u&&e.jsxs("div",{className:"card lgband",children:[e.jsxs("div",{className:"lgband-say",children:[e.jsx("span",{className:"eyeb",children:"Send it on"}),e.jsx("h3",{className:"d3",style:{marginTop:6},children:"Anybody with the code takes a seat."}),e.jsxs("p",{className:"note",children:["Anyone you send it to joins ",u.name,", takes an open seat and lands on the map beside you. Nothing to fill in, nothing to approve."]}),e.jsxs("p",{className:"note",children:[oe?`${oe} of ${V} seats ${oe===1?"is":"are"} still open. `:"Every seat is taken. ",ye?`${ye} more of you and everyone's targets go live to each other.`:"Everyone's targets are live, so it is already finding the doors."]})]}),e.jsxs("div",{className:"lgband-code",children:[e.jsx("span",{className:"plbl",children:"Anyone with this can join"}),e.jsx("div",{className:"lgcode",children:u.code||"—"}),e.jsxs("div",{className:"lgband-acts",children:[e.jsx("button",{className:"btn btn-t mini",onClick:()=>ve("code"),children:J==="code"?"Copied ✓":"Copy code"}),e.jsx("button",{className:"btn btn-t mini",disabled:!X,onClick:()=>
22ve("link"),children:J==="link"?"Copied ✓":"Copy link"})]})]}),X&&e.jsxs("div",{className:"lgband-qr",children:[e.jsx(Fe,{value:X,size:116,alt:`QR code to join ${u.name}`}),e.jsx("span",{className:"note",children:"Point a phone at it."})]})]})]})]})}const Et=[["The rooms, rescored","Ranked against your hunt again, late signups counted in."],["The names, with reasons","Who is in each room, and what you can open for each other."],["The meetings, booked","The ask written, sent, and in both calendars."]];function $t(){const{s}=O(),{user:n}=F(),t=l.useRef(!1);return l.useEffect(()=>{const a=n==null?void 0:n.accessToken;!a||t.current||(t.current=!0,(async()=>{try{await ne(a,{role:s.role,posterStyle:s.posterStyle}),await Os(a)}catch{}})())},[n==null?void 0:n.accessToken,s.role,s.posterStyle]),e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"cdhero",children:e.jsxs("div",{className:"cdhero-in",children:[e.jsx("span",{className:"cdlabel",children:"Countdown until"}),e.jsx("h2",{className:"cdtitle",children:"I send you who to meet"}),e.jsx(As,{}),e.jsx("p",{className:"lede",style:{marginTop:26,maxWidth:"52ch"},children:"Who to meet, in which room, and why. Then I book the meetings."})]})}),e.jsx("div",{className:"grid g3",style:{marginTop:18},children:Et.map(([a,c])=>e.jsxs("div",{className:"card",children:[e.jsx("h3",{className:"d3",children:a}),e.jsx("p",{className:"note",style:{marginTop:8},children:c})]},a))}),e.jsx(Ps,{enabled:!!(n!=null&&n.accessToken)})]})}function qs({token:s,value:n,onPick:t,onClear:a,onAddByHand:c}){const[i,r]=l.useState(""),[o,d]=l.useState({kind:"idle"}),[m,p]=l.useState(!1),[h,b]=l.useState(0),w=l.useRef(null);l.useEffect(()=>{if(!s)return;const j=i.trim();let v=!0;d(N=>N.kind==="ready"?N:{kind:"searching"});const x=window.setTimeout(()=>{qn(s,{query:j,limit:8}).then(N=>{v&&(d({kind:"ready",events:N.events,total:N.total}),b(0))}).catch(N=>{v&&d({kind:"failed",message:N instanceof Error?N.message:"Could not reach the programme"})})},250);return()=>{v=!1,window.clearTimeout(x)}},[i,s]),l.useEffect(()=>{if(!m)return;const j=v=>{w.current&&!w.current.contains(v.target)&&p(!1)};return document.addEventListener("mousedown",j),()=>document.removeEventListener("mousedown",j)},[m]);const g=o.kind==="ready"?o.events:[],S=l.useCallback(j=>{t(j),p(!1),r("")},[t]),u=j=>{if(j.key==="Escape"){p(!1);return}g.length&&(j.key==="ArrowDown"?(j.preventDefault(),p(!0),b(v=>(v+1)%g.length)):j.key==="ArrowUp"?(j.preventDefault(),b(v=>(v-1+g.length)%g.length)):j.key==="Enter"&&m&&(j.preventDefault(),S(g[Math.min(h,g.length-1)])))},k=l.useMemo(()=>s?o.kind==="failed"?o.message:o.kind==="searching"?"Looking through the programme…":o.kind==="ready"&&i.trim()&&!o.events.length?"Nothing in the programme matches that.":o.kind==="ready"&&o.total>o.events.length?`${o.total} events match — keep typing to narrow it down.`:"Search by name, by who is hosting, or by neighbourhood.":"Confirm your number first and the whole programme opens up.",[s,o,i]);return n?e.jsxs("div",{className:"tw-picked",children:[e.jsxs("div",{className:"row between",style:{alignItems:"flex-start",gap:12},children:[e.jsxs("div",{style:{minWidth:0},children:[e.jsx("span",{className:"plbl",children:"Your event"}),e.jsx("div",{className:"tw-picked-title",children:n.name}),e.jsx("div",{className:"note",children:Ne(n)||"Time and place to be confirmed"}),se(n)&&e.jsxs("div",{className:"note",style:{marginTop:4},children:["Hosted by ",se(n)]})]}),e.jsx("button",{type:"button",className:"btn btn-t tw-change",onClick:a,children:"Change"})]}),e.jsxs("div",{className:"row",style:{gap:8,marginTop:12,flexWrap:"wrap"},children:[n.featured&&e.jsx("span",{className:"pill win",children:"featured"}),n.inviteOnly&&e.jsx("span",{className:"pill grey",children:"invite only"}),n.registrationStatus==="closed"&&e.jsx("span",{className:"pill grey",children:"registration closed"}),n.url&&e.jsx("a",{className:"note tw-listing-link",href:n.url,target:"_blank",rel:"noopener noreferrer",children:"See the listing ↗"})]})]}):e.jsxs("div",{className:"tw-search",ref:w,children:[e.jsxs("div",{className:"tw-field",children:[e.jsxs("label",{className:"fld",children:[e.jsx("span",{className:"l",children:"Find your event"}),e.jsx("input",{value:i,disabled:!s,onChange:j=>{r(j.target.value),p(!0)},onFocus:()=>p(!0),onKeyDown:u,placeholder:"AI Founders Dinner, Sequoia, SOMA…",autoComplete:"off",role:"combobox","aria-expanded":m,"aria-controls":"tw-results","aria-autocomplete":"list"})]}),m&&!!s&&e.jsxs("div",{className:"tw-results",id:"tw-results",role:"listbox",children:[g.map((j,v)=>e.jsxs("button",{type:"button",role:"option","aria-selected":v===h,className:`tw-result${v===h?" on":""}`,onMouseEnter:()=>b(v),onClick:()=>S(j),children:[e.jsx("span",{className:"tw-result-name",children:j.name}),e.jsx("span",{className:"tw-result-meta",children:[Ne(j),se(j)].filter(
22Boolean).join(" — ")})]},j.id)),o.kind==="ready"&&!g.length&&e.jsxs("div",{className:"tw-result tw-result--none",children:[e.jsxs("span",{className:"tw-result-name",children:["Nothing matches “",i.trim(),"”."]}),e.jsx("span",{className:"tw-result-meta",children:"Not on the programme? Add it by hand — it takes a name, a night and a venue."}),e.jsx("button",{type:"button",className:"linkbtn",onClick:c,children:"Add it by hand"})]}),o.kind==="searching"&&!g.length&&e.jsx("div",{className:"tw-result tw-result--none",children:e.jsx("span",{className:"tw-result-meta",children:"Looking through the programme…"})})]})]}),e.jsx("span",{className:"note",style:{display:"block",marginTop:8},children:k})]})}function Vs(s,n){if(!s.trim())return;const t=new Date(`${s}T${(n||"00:00").slice(0,5)}`);if(!Number.isNaN(t.getTime()))return t.toISOString()}function It(s,n){const t=[s.trim(),n.trim()].filter(Boolean).join(" · ");return t?t.slice(0,200):void 0}function At(s,n){const t=Vs(s,n);return t?new Date(t).toLocaleString(void 0,{weekday:"short",day:"numeric",month:"short",hour:"numeric",minute:"2-digit"}):null}const ee={name:"",email:"",company:""},G=s=>{var n;return!!(s.email.trim()||s.name.trim()||(n=s.linkedin)!=null&&n.trim())},Oe=s=>{var n,t,a,c,i;return{...s.name.trim()?{name:s.name.trim()}:{},...s.email.trim()?{email:s.email.trim()}:{},...s.company.trim()?{company:s.company.trim()}:{},...(n=s.firstName)!=null&&n.trim()?{firstName:s.firstName.trim()}:{},...(t=s.lastName)!=null&&t.trim()?{lastName:s.lastName.trim()}:{},...(a=s.title)!=null&&a.trim()?{title:s.title.trim()}:{},...(c=s.linkedin)!=null&&c.trim()?{linkedinUrl:s.linkedin.trim()}:{},...(i=s.website)!=null&&i.trim()?{website:s.website.trim()}:{}}};function ks(s){const n=[];for(const t of s.split(/[\r\n]+/)){const a=t.trim();if(!a)continue;const c=a.split(/\s*[,\t;]\s*/).filter(d=>d.length);if(!c.length||/^(name|full ?name|first ?name)$/i.test(c[0])&&c.some(d=>/^e-?mail$/i.test(d)))continue;const i=c.findIndex(d=>/^[^@\s]+@[^@\s]+\.[^@\s]+$/.test(d)),r=i>=0?c[i]:"",o=c.filter((d,m)=>m!==i);n.push({name:o[0]||"",email:r,company:o[1]||""})}return n.filter(G)}function Re(s){const n=[`${s.rows.length} attendee${s.rows.length===1?"":"s"} read`];return s.skipped&&n.push(`${s.skipped} with no name, email or LinkedIn`),s.duplicates&&n.push(`${s.duplicates} duplicate${s.duplicates===1?"":"s"}`),n.join(" · ")}function ws({guests:s,onChange:n,note:t,hint:a}){const[c,i]=l.useState(""),[r,o]=l.useState(!1),[d,m]=l.useState(null),[p,h]=l.useState(""),b=l.useRef(null),w=s.length?s:[ee],g=(x,N,E)=>{const I=w.map((A,R)=>x===R?{...A,[N]:E}:A);x===I.length-1&&G(I[x])&&I.push({...ee}),n(I)},S=x=>{const N=w.filter((E,I)=>I!==x);n(N.length?N:[{...ee}])},u=x=>{const N=w.filter(G),E=new Set(N.map(A=>A.email.trim().toLowerCase()).filter(Boolean)),I=x.filter(A=>{const R=A.email.trim().toLowerCase();return R&&E.has(R)?!1:(R&&E.add(R),!0)});return n([...N,...I,{...ee}]),I.length},k=()=>{const x=ks(c);x.length&&(u(x),i(""),o(!1))},j=async x=>{var E;const N=(E=x.target.files)==null?void 0:E[0];if(x.target.value="",!!N){h("");try{const I=Ls(await Ws(N));if(!I.rows.length){m(null),h(I.read?`Read ${I.read} rows but found nobody — the file needs a name, an email or a LinkedIn per person.`:"That file has no rows in it.");return}const A=u(I.rows);m({name:N.name,summary:A===I.rows.length?Re(I):`${Re(I)} · ${I.rows.length-A} already on the list`})}catch(I){h(I instanceof zs?I.message:"Could not read that file. A .csv export is what this wants.")}}},v=w.filter(G).length;return e.jsxs("div",{className:"card",style:{marginTop:16},children:[e.jsxs("div",{className:"row between gl-head",style:{alignItems:"flex-end",marginBottom:14},children:[e.jsxs("div",{children:[e.jsx("span",{className:"eyeb",children:"The guest list"}),e.jsx("h3",{className:"d3",style:{marginTop:8},children:"Who is coming?"}),e.jsx("p",{className:"note",style:{marginTop:6,maxWidth:"56ch"},children:t})]}),e.jsxs("span",{className:"row",style:{gap:8},children:[e.jsxs("span",{className:`pill ${v?"win":"grey"}`,children:[v," added"]}),e.jsx("button",{type:"button",className:"btn btn-t",style:{padding:"9px 15px",fontSize:13},onClick:()=>{var x;return(x=b.current)==null?void 0:x.click()},children:"Upload a CSV"}),e.jsx("button",{type:"button",className:"btn btn-t",style:{padding:"9px 15px",fontSize:13},onClick:()=>o(x=>!x),children:r?"Close paste":"Paste a list"})]})]}),e.jsx("input",{ref:b,type:"file",accept:".csv,text/csv",onChange:x=>void j(x),style:{display:"none"},"aria-label":"Upload your attendee CSV"}),(d||p)&&e.jsxs("div",{className:"sub tint",style:{marginBottom:14},children:[d&&e.jsxs(e.Fragment,{children:[e.jsx("b",{style:{fontSize:14,fontWeight:600,display:"block"},children:d.name}),e.jsxs("span",{className:"note",children:[d.summary,". Check them over — ",a]})]}),p&&e.jsx("span",{className:"note",style:{color:"var(--wine)"},children:p})]}),r&&e.jsxs("div",{className:"sub tint",style:{marginBottom:14},children:[e.jsxs("label",{className:"fld",children:[e.jsx("span",{className:"l",children:"One guest a line"}),e.jsx("textarea",{value:c,onChange:x=>i(x.target.value),placeholder:`Full name, [email protected], Company
23Another name, [email protected], Company`})]}),e.jsxs("div",{className:"row",style:{gap:8,marginTop:10},children:[e.jsxs("button",{className:"btn btn-p",style:{padding:"9px 16px",fontSize:13},onClick:k,children:["Add ",ks(c).length||""," to the list"]}),e.jsx("span",{className:"note",children:"Name, email, company — commas or tabs. Straight out of a spreadsheet."})]})]}),e.jsx("div",{className:"gl-hand",children:w.map((x,N)=>e.jsxs("div",{className:"gl-hand-row",children:[e.jsxs("label",{className:"fld",children:[N===0&&e.jsx("span",{className:"l",children:"Name"}),e.jsx("input",{value:x.name,onChange:E=>g(N,"name",E.target.value),placeholder:"Full name",autoComplete:"off"})]}),e.jsxs("label",{className:"fld",children:[N===0&&e.jsx("span",{className:"l",children:"Email"}),e.jsx("input",{type:"email",value:x.email,onChange:E=>g(N,"email",E.target.value),placeholder:"[email protected]",autoComplete:"off"})]}),e.jsxs("label",{className:"fld",children:[N===0&&e.jsx("span",{className:"l",children:"Company"}),e.jsx("input",{value:x.company,onChange:E=>g(N,"company",E.target.value),placeholder:"Company",autoComplete:"off"})]}),e.jsx("button",{type:"button",className:`gl-hand-x${G(x)?"":" off"}`,onClick:()=>S(N),"aria-label":`Remove ${x.name||"this guest"}`,style:{marginTop:N===0?22:0},children:"×"})]},N))}),e.jsx("button",{type:"button",className:"btn btn-t gl-add",style:{padding:"9px 15px",fontSize:13,marginTop:12},onClick:()=>n([...w,{...ee}]),children:"Add another"})]})}function Pt({url:s,title:n}){const{copy:t,label:a}=ze(),c=`${n} — add yourself and Gemphere will tell you who in the room is worth ten minutes:`,i=`mailto:?subject=${encodeURIComponent(`You are invited: ${n}`)}&body=${encodeURIComponent(`${c}
24
25${s}`)}`,r=`https://wa.me/?text=${encodeURIComponent(`${c} ${s}`)}`;return e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"plbl",children:"Your inv
25itation link"}),e.jsxs("div",{className:"row",style:{gap:8,marginTop:10,flexWrap:"nowrap"},children:[e.jsx("label",{className:"fld",style:{flex:1,minWidth:0},children:e.jsx("input",{value:s,readOnly:!0,"aria-label":"Your invitation link",onFocus:o=>o.currentTarget.select()})}),e.jsx("button",{className:"btn btn-p",style:{padding:"11px 18px",fontSize:"13.5px",flex:"none"},onClick:()=>t(s),children:a??"Copy link"})]}),e.jsxs("div",{className:"row",style:{gap:8,marginTop:10},children:[e.jsx("a",{className:"btn btn-t",style:{padding:"9px 15px",fontSize:13},href:i,children:"Send by email"}),e.jsx("a",{className:"btn btn-t",style:{padding:"9px 15px",fontSize:13},href:r,target:"_blank",rel:"noopener noreferrer",children:"WhatsApp"}),e.jsx("a",{className:"btn btn-t",style:{padding:"9px 15px",fontSize:13},href:s,target:"_blank",rel:"noopener noreferrer",children:"Open the invitation"})]})]})}function Lt(){const{s,set:n,patch:t,go:a,signIn:c}=O(),{user:i}=F(),r=i==null?void 0:i.accessToken,[o,d]=l.useState(!1),[m,p]=l.useState(""),[h,b]=l.useState([]),[w,g]=l.useState(!1),[S,u]=l.useState(0),k=s.event,j=h.filter(G).length,v=s.evPicked,x=s.evByHand,N=v?v.name:s.evTitle.trim(),E=At(s.evDate,s.evStart),I=[s.evVenue.trim(),s.evAddress.trim()].filter(Boolean).join(" · "),A=l.useMemo(()=>s.evGuests.filter(G),[s.evGuests]),R=!!v||!!N;function _(T){t({evPicked:T,evByHand:!1,evTitle:"",evUrl:T.url||""}),p("")}async function J(){if(!r){c("organizer");return}if(!R){p("Find your event on the programme, or add it by hand, before it can have a link.");return}d(!0),p("");try{const T=parseInt(s.evSeats,10),C=await Rs(r,{...v?{techweekEventId:v.id}:{title:N,startsAt:Vs(s.evDate,s.evStart),venue:It(s.evVenue,s.evAddress),source:"manual",...s.evUrl.trim()?{sourceUrl:s.evUrl.trim()}:{}},...Number.isFinite(T)&&T>0?{seatsLeft:T}:{},guests:A.map(Oe)});t({event:C,role:"organizer",registered:!0})}catch(T){p(T instanceof Error?T.message:"Could not create your event")}finally{d(!1)}}async function te(){if(!r||!k)return!1;const T=h.filter(G);if(!T.length)return!0;g(!0),p("");try{const C=await Ys(r,k.id,T.map(Oe));return u(U=>U+(C.added??T.length)),b([]),!0}catch(C){return p(C instanceof Error?C.message:"Could not save those guests"),!1}finally{g(!1)}}async function K(){await te()&&a("org-count")}return k?e.jsxs(e.Fragment,{children:[e.jsx(Le,{step:"Your event is live",title:"Here is the link to share.",lede:"Put it on your Luma page, your confirmation email, or the group chat. Anyone who opens it can add themselves."}),e.jsxs("div",{className:"grid g2",style:{alignItems:"start"},children:[e.jsxs("div",{className:"card",children:[e.jsx("span",{className:"plbl",children:"What your guests will see"}),e.jsx("div",{style:{fontSize:19,fontWeight:600,letterSpacing:"-.02em",marginTop:10},children:k.title}),e.jsx("div",{className:"note",children:[v?Ne(v):E,k.venue].filter(Boolean).join(" · ")||"Time and place to be confirmed"}),e.jsxs("div",{className:"row between",style:{marginTop:16,paddingTop:14,borderTop:"1px solid var(--line)"},children:[e.jsx("span",{className:"note",children:k.guestsAdded+S>0?`${k.guestsAdded+S} on the guest list already`:"Nobody on the list yet — the link is how they get on it"}),e.jsx("span",{className:"pill win",children:"live"})]})]}),e.jsxs("div",{className:"card sky",children:[e.jsx(Pt,{url:k.url,title:k.title}),e.jsxs("div",{className:"sub tint",style:{marginTop:14,background:"var(--white)"},children:[e.jsx("b",{style:{fontSize:14,fontWeight:600,display:"block"},children:"What happens when they open it"}),e.jsx("p",{className:"note",style:{marginTop:6},children:"Your event, the host, the headcount. One button puts them on the list and makes the two of you connectors, so Gem can start showing each of you the other's doors."})]})]})]}),e.jsx(ws,{guests:h.length?h:[ee],onChange:b,note:"Anyone else you know is coming — type, paste or upload them. They go on under their email, so your link recognises them rather than adding them twice.",hint:"they go on the list — you send their invitations from the room."}),S>0&&e.jsxs("p",{className:"note",style:{marginTop:10},children:[S," on your guest list. Invitations go out from the room."]}
25),m&&e.jsx("p",{className:"note",style:{marginTop:10,color:"var(--wine)"},children:m}),e.jsxs(We,{children:[e.jsx("button",{className:"btn btn-p",onClick:()=>void K(),disabled:w,children:w?"Saving…":j?`Submit ${j} to the list`:"Submit"}),e.jsx("span",{className:"note",children:j>0?`${j} go on your list. Nobody is emailed here — invitations go out from the room.`:"Your link stays the same however many you add."})]})]}):e.jsxs(e.Fragment,{children:[e.jsx(Le,{step:"Your event",title:"Which event are you running?",lede:"Every SF Tech Week event is on the programme. Find yours, upload who is coming, get a link to share."}),e.jsxs("div",{className:"grid g2",style:{alignItems:"start"},children:[e.jsx("div",{className:"card",style:{padding:"clamp(20px,2.4vw,28px)"},children:e.jsxs("div",{className:"stack",children:[e.jsx(qs,{token:r,value:v,onPick:_,onClear:()=>t({evPicked:null,evUrl:""}),onAddByHand:()=>t({evByHand:!0,evPicked:null})},v?`picked-${v.id}`:"search"),!v&&!x&&e.jsx("button",{type:"button",className:"linkbtn",style:{alignSelf:"flex-start"},onClick:()=>t({evByHand:!0}),children:"Not on the programme? Add it by hand"}),!v&&x&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"row between",style:{alignItems:"center"},children:[e.jsx("span",{className:"plbl",children:"Your event, by hand"}),e.jsx("button",{type:"button",className:"linkbtn",onClick:()=>t({evByHand:!1}),children:"Search the programme instead"})]}),e.jsxs("label",{className:"fld",children:[e.jsx("span",{className:"l",children:"Event name"}),e.jsx("input",{value:s.evTitle,onChange:T=>n("evTitle",T.target.value),placeholder:"AI Founders Dinner",autoComplete:"off"})]}),e.jsxs("div",{className:"grid g3",style:{gap:14},children:[e.jsxs("label",{className:"fld",children:[e.jsx("span",{className:"l",children:"Date"}),e.jsx("input",{type:"date",value:s.evDate,onChange:T=>n("evDate",T.target.value)})]}),e.jsxs("label",{className:"fld",children:[e.jsx("span",{className:"l",children:"Starts"}),e.jsx("input",{type:"time",value:s.evStart,onChange:T=>n("evStart",T.target.value)})]}),e.jsxs("label",{className:"fld",children:[e.jsx("span",{className:"l",children:"Ends"}),e.jsx("input",{type:"time",value:s.evEnd,onChange:T=>n("evEnd",T.target.value)})]})]}),e.jsxs("label",{className:"fld",children:[e.jsx("span",{className:"l",children:"Venue"}),e.jsx("input",{value:s.evVenue,onChange:T=>n("evVenue",T.target.value),placeholder:"Fort Mason, Gallery 308",autoComplete:"off"})]}),e.jsxs("label",{className:"fld",children:[e.jsx("span",{className:"l",children:"Address"}),e.jsx("input",{value:s.evAddress,onChange:T=>n("evAddress",T.target.value),placeholder:"2 Marina Blvd, San Francisco",autoComplete:"off"})]}),e.jsxs("label",{className:"fld",children:[e.jsx("span",{className:"l",children:"Existing event page (optional)"}),e.jsx("input",{value:s.evUrl,onChange:T=>n("evUrl",T.target.value),placeholder:"lu.ma/ai-founders-dinner",autoComplete:"off"}),e.jsx("span",{className:"note",style:{display:"block",marginTop:6},children:"Kept alongside your event so you can still point people at it."})]})]}),e.jsxs("label",{className:"fld",children:[e.jsx("span",{className:"l",children:"Seats you would still like to fill"}),e.jsx("input",{type:"number",min:0,value:s.evSeats,onChange:T=>n("evSeats",T.target.value),placeholder:"20"}),e.jsx("span",{className:"note",style:{display:"block",marginTop:6},children:"Your guests can bring the right people into those seats."})]})]})}),e.jsxs("div",{className:"card sky",children:[e.jsx("span",{className:"plbl",children:"The invitation"}),e.jsx("div",{style:{fontSize:19,fontWeight:600,letterSpacing:"-.02em",marginTop:10},children:N||"Your event"}),e.jsx("div",{className:"note",children:(v?[Ne(v),se(v)?`hosted by ${se(v)}`:""]:[E,I]).filter(Boolean).join(" · ")||(x?"Add a date and a venue and they show up here":"Find your event above and the details land here")}),e.jsx("p",{className:"note",style:{marginTop:14},children:"The card anyone who opens your link lands on: your name as the host, one button to get on the list."}),e.jsxs("div",{className:"sub tint",style:{marginTop:14,background:"var(--white)"},children:[e.jsx("b",{style:{fontSize:14,fontWeight:600,display:"block"},children:"The link comes next"}),e.jsx("p",{className:"note",style:{marginTop:6},children:"Save the event and the link is live. You can keep adding guests after."})]})]})]}),e.jsx(ws,{guests:s.evGuests.length?s.evGuests:[ee],onChange:T=>n("evGuests",T),note:"Upload the CSV from Luma, Partiful or a spreadsheet — or type people in. Optional: save the event first and add the list after.",hint:"they go on the list — you send their invitations from the room."}),m&&e.jsx("p",{className:"note",style:{marginTop:10,color:"var(--wine)"},children:m}),e.jsxs(We,{children:[e.jsx("button",{className:"btn btn-p",onClick:()=>void J(),disabled:o||!R,children:o?"Saving your event…":"Save event and get my link"}),e.jsx("button",{className:"btn btn-t",onClick:()=>a("org-setup"),children:"Back to the link"}),e.jsx("span",{className:"note",children:r?"One click and the link is live.":"You will be asked to confirm your number first."})]})]})}function Wt(s){const n=s.trim().replace(/[?#].*$/,"").replace(/\/+$/,"").split("/").pop()||"";if(!/[-_]/.test(n)&&(/\d/.test(n)||/[a-z][A-Z]/.test(n)))return null;const t=n.replace(/[-_]+/g," ").trim();return t.length<3?null:t.replace(/\b\w/g,a=>a.toUpperCase())}function zt(s){var a;if(!s.startsAt)return null;const n=new Date(s.startsAt);if(Number.isNaN(n.getTime()))return null;const t={weekday:"short",day:"numeric",month:"short",hour:"numeric",minute:"2-digit"};
25try{const c=n.toLocaleString(void 0,{...t,...s.timezone?{timeZone:s.timezone}:{}});if(!s.timezone)return c;const i=(a=new Intl.DateTimeFormat("en-US",{timeZone:s.timezone,timeZoneName:"short"}).formatToParts(n).find(r=>r.type==="timeZoneName"))==null?void 0:a.value;return i?`${c} ${i}`:c}catch{return n.toLocaleString(void 0,t)}}function Ft(s){const n=s.replace(/\s+/g," ").trim().split(" ").filter(Boolean);return n.length>=2?(n[0][0]+n[n.length-1][0]).toUpperCase():(s.slice(0,2)||"?").toUpperCase()}function Ot(s){return s==="luma"?"Luma":s==="partiful"?"Partiful":"your page"}function Rt(s,n){const t=a=>a.replace(/\s+/g," ").trim().toLowerCase();return t(s)===t(n)}function Js(){const{s,patch:n,go:t,signIn:a}=O(),{user:c}=F(),[i,r]=l.useState(!1),[o,d]=l.useState(""),m=c==null?void 0:c.accessToken;async function p(h){var u,k;if(!m)return a("organizer"),!1;const b=s.orgLink.trim(),w=s.evPicked,g=((u=w==null?void 0:w.name)==null?void 0:u.trim())||((k=h==null?void 0:h.title)==null?void 0:k.trim())||(b?Wt(b):null),S=s.event&&(!g||Rt(s.event.title,g))?s.event:null;if(!S&&!g)return d("Paste your event link, or find your event on the programme, first."),!1;r(!0),d("");try{const j=s.evGuests.filter(G).map(Oe);if(S)j.length&&await Ys(m,S.id,j),b&&await ne(m,{role:"organizer",eventUrl:(h==null?void 0:h.url)||b});else{const v=await Rs(m,{title:g,...w?{techweekEventId:w.id}:{},...h!=null&&h.startsAt?{startsAt:h.startsAt}:{},...h!=null&&h.venue?{venue:h.venue}:{},source:h!=null&&h.source&&h.source!=="manual"?h.source:"manual",...b?{sourceUrl:(h==null?void 0:h.url)||b}:{},...j.length?{guests:j}:{}});n({event:v,role:"organizer"})}return t("org-count"),!0}catch(j){return d(j instanceof Error?j.message:"Could not save your event"),!1}finally{r(!1)}}return{save:p,saving:i,err:o,setErr:d}}function Yt(){const{s,go:n}=O(),{save:t,saving:a,err:c}=Js(),i=s.orgLink.trim(),r=s.evParsed&&s.evParsed.url===i&&s.evParsed.data.ok?s.evParsed.data:null,o=!!(r||s.evPicked),d=s.evGuests.filter(G).length,m=o&&s.evGuests.length>0,p=s.calendarProvider==="microsoft"?"Outlook":"Google Calendar";return e.jsx("div",{className:"calstep",children:e.jsxs("div",{className:"card calcard calswap",children:[e.jsx(Us,{label:d?`${p} connected · ${d} on your list`:`${p} connected`,phases:$n,doneTitle:"Your calendar is in.",busy:a,cta:a?"Saving…":m?`Save my event and ${s.evGuests.length} guests`:o?"Add my attendee list":"Add my event",onDone:()=>m?void t(r):n("org-setup")}),e.jsx(ke,{msg:c})]})})}function Ut(){const{s,set:n,patch:t,go:a,signIn:c}=O(),{user:i}=F(),[r,o]=l.useState(!1),{save:d,saving:m,err:p,setErr:h}=Js(),[b,w]=l.useState(""),g=l.useRef(null),S=i==null?void 0:i.accessToken,u=s.orgLink.trim(),k=s.evGuests,j=C=>n("evGuests",C),v=s.evUpload,[x,N]=l.useState(()=>s.evParsed&&s.evParsed.url===u?{kind:"read",data:s.evParsed.data}:{kind:"idle"}),E=x.kind==="read"?x.data:null,I=E?zt(E):null,A=s.evPicked,R=!!(E||A),_=s.orgCal||s.calConnected,J=k.length>0&&_;l.useEffect(()=>{var Y;if(!S){N(z=>z.kind==="read"?z:{kind:"idle"});return}if(u.length<5||!/\.[a-z]{2,}/i.test(u)){N({kind:"idle"});return}let C=!0;const U=((Y=s.evParsed)==null?void 0:Y.url)===u?s.evParsed.data:null;N(z=>z.kind==="read"?z:{kind:"reading"});const H=window.setTimeout(()=>{Vn(S,u).then(z=>{if(C){if(z.ok&&z.title){N({kind:"read",data:z}),n("evParsed",{url:u,data:z});return}U||N({kind:"failed",message:z.error||"We could not read that page."})}}).catch(z=>{!C||U||N({kind:"failed",message:z instanceof Error?z.message:"We could not read that page."})})},400);return()=>{C=!1,window.clearTimeout(H)}},[u,S]);async function te(){if(!S){c("organizer");return}o(!0),h("");try{Ts({path:"/sf-tech-week?start=organizer",step:Fs,mailboxProvider:"google"}),await Es(S,"google",{googleScopeTier:"calendar"})}catch(C){h(C instanceof Error?C.message:"Could not start Google Calendar"),o(!1)}}async function K(C){var H;const U=(H=C.target.files)==null?void 0:H[0];if(C.target.value="",!!U){w("");try{const Y=Ls(await Ws(U));if(!Y.rows.length){n("evUpload",null),w(Y.read?`Read ${Y.read} rows but found nobody — the file needs a name, an email or a LinkedIn per person.`:"That file has no rows in it.");return}j(Y.rows),n("evUpload",{name:U.name,summary:Re(Y)})}catch(Y){w(Y instanceof zs?Y.message:"Could not read that file. A .csv export is what this wants.")}}}function T(){d(E)}return e.jsxs(e.Fragment,{children:[e.jsx(Le,{step:"The one thing I need",title:"Add your event.",lede:"Paste your link or find it on the programme. Your list and your calendar are the two things beside it."}),e.jsxs("div",{className:"grid os-grid",children:[e.jsxs("div",{className:"os-col",children:[e.jsxs("div",{className:"card os-form",children:[e.jsxs("div",{className:"os-sec-h",children:[e.jsx("i",{className:"os-num",children:"1"}),e.jsxs("span",{children:[e.jsx("b",{children:"Paste your event link"}),e.jsx("span",{className:"note",children:"A Luma or Partiful page. I read the name, date and venue off it."})]})]}),e.jsxs("div",{className:"os-body",children:[e.jsxs("label",{className:"fld",children:[e.jsx("span",{className:"sr",children:"Event link"}),e.jsx("input",{className:"os-link-in",value:s.orgLink,onChange:C=>n("orgLink",C.target.value),placeholder:"partiful.com/e/… or lu.ma/…",autoComplete:"off",inputMode:"url",spellCheck:!1,autoFocus:!0})]}),x.kind==="reading"&&e.jsxs("span",{className:"os-hint os-hint--live",children:[e.jsx("i",{className:"os-spin","aria-hidden":"true"})," Reading your page…"]}),x.kind==="read"&&e.jsxs("span",{className:"os-hint os-hint--good",children:["Read from ",Ot(E.source)," — it is right under here."]}),x.kind==="failed"&&e.jsx("span",{className:"os-hint os-hint--bad",children:x.message}),e.jsx("div",{className:"os-or",children:e.jsx("span",{children:"Or find it on the programme"})}),e.jsx(qs,{token:S,value:A,onPick:C=>t({evPicked:C,evByHand:!1}),onClear:()=>t({evPicked:null}),onAddByHand:()=>{t({evByHand:!0,evPicked:null}),a("org-event")}})]})]}),x.kind==="reading"&&e.jsxs("div",{className:"card os-read os-rise","aria-hidden":"true",children:[e.jsx("span",{className:"os-gline w1"}),e.jsx("span",{className:"os-gline w2"}),e.jsxs("div",{className:"os-facts",children:[e.jsx("span",{className:"os-gline w3"}),e.jsx("span",{className:"os-gline w3"})]})]}),A&&e.jsxs("div",{className:"card os-read os-rise",children:[e.jsx("span",{className:"eyeb",children:"From the programme"}),e.jsx("h3",{className:"os-read-title",children:A.name}),e.jsxs("div",{className:"os-facts",children:[e.jsxs("div",{className:"os-fact",children:[e.jsx("span",{className:"plbl",children:"When"}),e.jsx("b",{className:hs(A)?"":"os-fact--none",children:hs(A)||"Not on the listing"})]}),e.jsxs("div",{className:"os-fact",children:[e.jsx("span",{className:"plbl",children:"Where"}),e.jsx("b",{className:A.neighborhood?"":"os-fact--none",children:A.neighborhood||"Not on the listing"})]}),!!se(A)&&e.jsxs("div",{className:"os-fact",children:[e.jsx("span",{className:"plbl",children:"Hosted by"}),e.jsx("b",{children:se(A)})]})]})]},`tw${A.id}
25`),E&&!A&&e.jsxs("div",{className:"card os-read os-rise",children:[e.jsx("span",{className:"eyeb",children:"Pulled from the link"}),e.jsx("h3",{className:"os-read-title",children:E.title}),e.jsxs("div",{className:"os-facts",children:[e.jsxs("div",{className:"os-fact",children:[e.jsx("span",{className:"plbl",children:"When"}),e.jsx("b",{className:I?"":"os-fact--none",children:I||"Not on that page"})]}),e.jsxs("div",{className:"os-fact",children:[e.jsx("span",{className:"plbl",children:"Where"}),e.jsx("b",{className:E.venue?"":"os-fact--none",children:E.venue||"Not on that page"})]}),!!E.hosts.length&&e.jsxs("div",{className:"os-fact",children:[e.jsx("span",{className:"plbl",children:"Hosted by"}),e.jsx("b",{children:E.hosts.slice(0,3).join(" & ")})]})]})]},E.url),!R&&x.kind!=="reading"&&e.jsxs("aside",{className:"card os-read os-read--waiting",children:[e.jsx("span",{className:"eyeb",children:"Your event"}),e.jsxs("div",{className:"os-ghost","aria-hidden":"true",children:[e.jsx("span",{className:"os-gline w1"}),e.jsx("span",{className:"os-gline w2"})]}),e.jsx("p",{className:"note",style:{marginTop:14},children:x.kind==="failed"?"Could not read that page. Try another link, or search above.":"Paste a link or search above, and your event lands here."})]})]}),e.jsxs("div",{className:"os-col",children:[e.jsxs("div",{className:"card os-form os-rise",style:{animationDelay:"110ms"},children:[e.jsxs("div",{className:"os-sec-h",children:[e.jsx("i",{className:"os-num",children:"2"}),e.jsxs("span",{children:[e.jsxs("span",{className:"os-sec-t",children:[e.jsx("b",{children:"Upload your attendee list"}),e.jsx("span",{className:`pill ${k.length?"win":"grey"}`,children:k.length?`${k.length} ready`:"required"})]}),e.jsx("span",{className:"note",children:"The one thing Luma and Partiful will not hand over. Nobody is emailed here — invitations go out from the room."})]})]}),e.jsxs("div",{className:"os-body",children:[e.jsx("input",{ref:g,type:"file",accept:".csv,text/csv",onChange:C=>void K(C),style:{display:"none"},"aria-label":"Upload your attendee CSV"}),e.jsxs("button",{type:"button",className:"os-alt",onClick:()=>{var C;return(C=g.current)==null?void 0:C.click()},children:[e.jsxs("span",{children:[e.jsx("b",{children:v?"Choose a different CSV":"Upload a CSV"}),e.jsx("span",{className:"note",children:v?`${v.name} · ${v.summary}`:"Straight out of Luma, Partiful, Eventbrite or a spreadsheet."})]}),e.jsx("i",{"aria-hidden":"true",children:v?"✓":"→"})]}),b&&e.jsx("span",{className:"os-hint os-hint--bad",children:b}),k.length>0&&e.jsxs("div",{className:"os-guests",children:[e.jsxs("div",{className:"os-guests-h",children:[e.jsxs("b",{children:[k.length," ",k.length===1?"person":"people"," on your list"]}),e.jsxs("span",{className:"note",children:["Read from ",(v==null?void 0:v.name)??"your file",". Nobody is emailed yet."]})]}),e.jsx("ul",{className:"os-guests-l",children:k.map((C,U)=>e.jsxs("li",{children:[e.jsx("span",{className:"av sm",children:Ft(C.name||C.email)}),e.jsxs("span",{className:"tx",children:[e.jsx("b",{children:C.name||C.email}),e.jsx("span",{className:"note",children:[C.title,C.company,C.name?C.email:""].filter(Boolean).join(" · ")||"No other details in the file"})]})]},`${C.email||C.name}-${U}`))})]}),e.jsx("button",{type:"button",className:"linkbtn",style:{marginTop:12},onClick:()=>{t({evByHand:!0}),a("org-event")},children:"Or type them in, or paste a list"})]})]}),e.jsxs("div",{className:"card os-cal os-rise",style:{animationDelay:"220ms"},children:[e.jsxs("div",{className:"os-sec-h",children:[e.jsx("i",{className:"os-num",children:"3"}),e.jsxs("span",{children:[e.jsxs("span",{className:"os-sec-t",children:[e.jsx("b",{children:"Connect your calendar"}),e.jsx("span",{className:`pill ${_?"win":"grey"}`,children:_?"connected":"required"})]}),e.jsx("span",{className:"note",children:"How I see who you already know, so I can tell you which guests to walk over to each other. Your event and your list are kept."})]})]}),e.jsx("div",{className:"os-body",children:_?e.jsxs("span",{className:"os-done-line",children:[e.jsx("i",{"aria-hidden":"true",children:"✓"})," Google Calendar connected"]}):e.jsx("button",{className:"btn btn-p os-cta",onClick:()=>void te(),disabled:r,children:r?"Opening Google…":"Connect Google Calendar"})})]})]})]}),e.jsxs("div",{className:"os-foot",children:[e.jsx(ke,{msg:p}),e.jsxs(We,{children:[e.jsx("button",{className:"btn btn-p",onClick:T,disabled:m||!R||!J,children:m?"Saving…":k.length?`Save my event and ${k.length} guests`:"Save my event"}),e.jsx("span",{className:"note",children:R?k.length?_?`${k.length} go on your list — you invite them from the room.`:"Connect your calendar to carry on.":"Upload your attendee list to carry on.":"Paste your link, or find your event above."})]})]})]})}function Mt(){var p;const{copy:s,label:n}=ze(),t=ze(),{s:a,go:c}=O(),{user:i}=F(),r=l.useRef(!1),o=a.event?a.event.url:null,[d,m]=l.useState(null);return l.useEffect(()=>{const h=i==null?void 0:i.accessToken;if(!h)return;let b=!0;return Jn(h).then(w=>
25b&&m(Kn(w.code))).catch(()=>{}),()=>{b=!1}},[i==null?void 0:i.accessToken]),l.useEffect(()=>{const h=i==null?void 0:i.accessToken;!h||r.current||(r.current=!0,Os(h).catch(()=>{}))},[i==null?void 0:i.accessToken]),e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"cdhero",children:e.jsxs("div",{className:"cdhero-in",children:[e.jsx("span",{className:"cdlabel",children:"Checking your attendee list · countdown until"}),e.jsx("h2",{className:"cdtitle",children:"I send you your room"}),e.jsx(As,{}),e.jsx("p",{className:"lede",style:{marginTop:26,maxWidth:"54ch"},children:"I’m reading your attendee list. At zero you get who should meet, and which introductions to make yourself."})]})}),e.jsx("div",{className:"card",style:{marginTop:18},children:e.jsxs("div",{className:"grid g2",style:{alignItems:"start",gap:"clamp(20px,3vw,44px)"},children:[e.jsxs("div",{children:[e.jsx("span",{className:"eyeb",children:"Share it with your guests"}),e.jsx("h3",{className:"d2",style:{margin:"8px 0 12px",maxWidth:"22ch"},children:"One link turns your guest list into a room full of opportunity."}),e.jsx("p",{className:"lede",children:"Put your link on your Luma page or confirmation email. Each guest says who they want to meet and what they can open for others."}),e.jsx("p",{className:"lede",style:{marginTop:12},children:"I match the room and tell each guest who to meet, and why. The more who join, the better it gets for everyone."})]}),e.jsxs("div",{className:"oclink",children:[e.jsx("span",{className:"plbl",children:"Your invitation link"}),o?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"row ocl
25ink-copy",style:{gap:8,marginTop:10,flexWrap:"nowrap"},children:[e.jsx("label",{className:"fld",style:{flex:1,minWidth:0},children:e.jsx("input",{value:o,readOnly:!0,"aria-label":"Your invitation link",onFocus:h=>h.currentTarget.select()})}),e.jsx("button",{className:"btn btn-p",style:{padding:"11px 18px",fontSize:"13.5px",flex:"none"},onClick:()=>s(o),children:n??"Copy link"})]}),e.jsxs("div",{className:"row oclink-send",style:{gap:8,marginTop:10},children:[e.jsx("a",{className:"btn btn-t",style:{padding:"9px 15px",fontSize:13},href:`mailto:?subject=${encodeURIComponent(`You are invited: ${((p=a.event)==null?void 0:p.title)??"my event"}`)}&body=${encodeURIComponent(`${o}`)}`,children:"Send by email"}),e.jsx("a",{className:"btn btn-t",style:{padding:"9px 15px",fontSize:13},href:o,target:"_blank",rel:"noopener noreferrer",children:"Open the invitation"})]})]}):e.jsxs("div",{style:{marginTop:10},children:[e.jsx("p",{className:"note",children:"No event yet, so nothing to share. Find it on the programme and the link is one click away."}),e.jsx("button",{className:"btn btn-p",style:{padding:"11px 18px",fontSize:"13.5px",marginTop:12},onClick:()=>c("org-event"),children:"Find my event"})]}),d&&e.jsxs("div",{className:"ocqr",children:[e.jsx("span",{className:"plbl",children:"One code for every room you run"}),e.jsxs("p",{className:"note",style:{marginTop:7},children:["The link is one event; this code is you — everything you run. Scanning puts nobody in: every request comes to you, under ",e.jsx("b",{children:"Your code"}),"."]}),e.jsxs("div",{className:"ocqr-row",children:[e.jsx(Fe,{value:d,size:150,alt:"Your Gemphere organizer code"}),e.jsxs("div",{className:"ocqr-acts",children:[e.jsx("button",{className:"btn btn-p",style:{padding:"10px 16px",fontSize:13},onClick:()=>t.copy(d),children:t.label??"Copy my code link"}),e.jsx("a",{className:"btn btn-t",style:{padding:"9px 15px",fontSize:13},href:d,target:"_blank",rel:"noopener noreferrer",children:"See what they see"})]})]})]})]})]})}),e.jsx(Ps,{enabled:!!(i!=null&&i.accessToken)})]})}const Bt={hunt:it,monday:ct,week:pt,post:xt,league:Tt,reveal:$t,"org-setup":Ut,"org-scan":Yt,"org-event":Lt,"org-count":Mt},Gt="https://fonts.googleapis.com/css2?family=Instrument+Sans:wght@400;500;600;700&family=Instrument+Serif:ital@0;1&display=swap";function _t(){l.useEffect(()=>{if(document.querySelector("link[data-sfw-fonts]"))return;const s=document.createElement("link");s.rel="stylesheet",s.href=Gt,s.setAttribute("data-sfw-fonts",""),document.head.appendChild(s)},[])}const Ht=["hunt","org-setup","org-scan"],Dt=["league","org-setup"];function qt(){const{go:s,patch:n}=O(),{user:t}=F(),[a,c]=Be(),i=l.useRef(!1);l.useEffect(()=>{if(i.current||a.get("mailboxConnected")!=="1")return;i.current=!0;const r=a.get("mailboxProvider")==="microsoft"?"microsoft":"google",o=Number(a.get("step"))===Fs||a.get("start")==="organizer"||a.get("start")==="organizers";n({calendarProvider:r,...o?{orgCal:!0,role:"organizer"}:{calConnected:!0}});const d=new URLSearchParams(a);["mailboxConnected","mailboxProvider","step","gmailConnected"].forEach(p=>d.delete(p)),c(d,{replace:!0});const m=t==null?void 0:t.accessToken;m&&(async()=>{try{await On(m,r),await ne(m,{role:o?"organizer":"attendee"})}catch{}})(),s(o?"org-scan":"monday")},[a,c,s,n,t==null?void 0:t.accessToken])}const Ye="gemphere_sfw_pending_event",Ue="gemphere_sfw_pending_connector",Me="gemphere_sfw_pending_league";function Cs(){try{return sessionStorage.getItem(Ye)}catch{return null}}function Ss(){try{return sessionStorage.getItem(Me)}catch{return null}}function Vt(){try{const s=sessionStorage.getItem(Ue);if(!s)return null;const n=JSON.parse(s);return n!=null&&n.token?{token:n.token,join:!!n.join}:null}catch{return null}}function Pe(s){try{sessionStorage.removeItem(s)}catch{}}function Jt(){const{patch:s}=O(),{user:n}=F(),[t,a]=Be(),c=l.useRef(!1);l.useEffect(()=>{const o=t.get("event"),d=t.get("league"),m=t.get("connector");if(!o&&!d&&!m)return;try{o&&sessionStorage.setItem(Ye,o),d&&sessionStorage.setItem(Me,d),m&&sessionStorage.setItem(Ue,JSON.stringify({token:m,join:t.get("join")==="1"}))}catch{}const p=new URLSearchParams(t);["event","league","connector","join"].forEach(h=>p.delete(h)),a(p,{replace:!0})},[t,a]);const i=t.get("event")??Cs();l.useEffect(()=>{if(!i)return;let o=!0;return Zn(i).then(d=>o&&s({invite:d.event})).catch(()=>{}),()=>{o=!1}},[i,s]);const r=t.get("league")??Ss();l.useEffect(()=>{if(!r)return;let o=!0;return Qn(r).then(d=>o&&s({leagueInvite:{...d.league,code:r}})).catch(()=>{}),()=>{o=!1}},[r,s]),l.useEffect(()=>{const o=n==null?void 0:n.accessToken;if(!o||c.current)return;const d=Cs(),m=Ss(),p=Vt();!d&&!m&&!p||(c.current=!0,(async()=>{let h=!0;if(p)try{await(p.join?rn(o,p.token):cn(o,p.token)),Pe(Ue)}catch{h=!1}if(d)try{await Xn(o,d),s({inviteJoined:!0}),Pe(Ye)}catch{h=!1}if(m)try{await et(o,m),s({leagueJoined:!0}),Pe(Me)}catch{h=!1}h||(c.current=!1)})())},[n==null?void 0:n.accessToken,s])}function Kt(){const{patch:s}=O(),{user:n}=F(),t=l.useRef(!1);l.useEffect(()=>{const a=n==null?void 0:n.accessToken;!a||t.current||(t.current=!0,(async()=>{var c,i;try{const r=await dn(a),o=Rn(r),d=Yn(r);s({registered:!0,...(c=r.profile)!=null&&c.fullName?{name:r.profile.fullName}:{},...(i=r.profile)!=null&&i.email?{email:r.profile.email}:{},...d.length?{hunt:d}:{},...o!=null&&o.role?{role:o.role}:{},...(o==null?void 0:o.posterStyle)!=null?{posterStyle:o.posterStyle}:{},...o!=null&&o.eventId?{event:{id:o.eventId,title:o.eventName||"Your event",startsAt:o.eventStartsAt??null,venue:o.eventVenue??null,url:st(o.eventId),guestsAdded:o.eventGuests??0}}:{},...o!=null&&o.leagueId?{league:{id:o.leagueId,name:o.leagueName||"Your league",code:o.leagueCode||"",seats:o.leagueSeats??1,pending:o.leaguePending??0}}:{},...Un(r)?{orgCal:!0}:{}})}catch{}})())},[n==null?void 0:n.accessToken,s])}function Zt(){var c,i;const{s}
25=O(),n=s.invite;if(!n)return null;const t=n.startsAt?new Date(n.startsAt).toLocaleString(void 0,{weekday:"short",month:"short",day:"numeric",hour:"numeric",minute:"2-digit"}):null,a=(i=(c=n.host)==null?void 0:c.name)==null?void 0:i.trim();return e.jsxs("div",{className:"invband",children:[e.jsxs("span",{className:"invband-x",children:[e.jsx("b",{children:s.inviteJoined?`You are on the list for ${n.title}.`:a?`${a} invited you to ${n.title}.`:`You are invited to ${n.title}.`}),e.jsxs("span",{className:"note",children:[[t,n.venue].filter(Boolean).join(" · ")||"Time and place to be confirmed",s.inviteJoined?" — and connectors with your host.":" · finish this and you are on the guest list."]})]}),e.jsx("span",{className:`pill ${s.inviteJoined?"win":"grey"}`,children:s.inviteJoined?"on the list":`${n.going} going`})]})}function Qt(){var a,c;const{s}=O(),n=s.leagueInvite;if(!n)return null;const t=(c=(a=n.host)==null?void 0:a.name)==null?void 0:c.trim();return e.jsxs("div",{className:"invband",children:[e.jsxs("span",{className:"invband-x",children:[e.jsx("b",{children:s.leagueJoined?`You are in ${n.name}.`:t?`${t} invited you to ${n.name}.`:`You are invited to ${n.name}.`}),e.jsx("span",{className:"note",children:s.leagueJoined?"Say who you are chasing and the others can start opening doors for you.":`${n.seats} of ${n.maxMembers} seats taken · finish this and one of them is yours.`})]}),e.jsx("span",{className:`pill ${s.leagueJoined?"win":"grey"}`,children:s.leagueJoined?"in the league":n.full?"full":`${n.maxMembers-n.seats} seats left`})]})}function Xt(){const{user:s}=F(),[,n]=l.useReducer(a=>a+1,0),t=s==null?void 0:s.accessToken;l.useEffect(()=>{if(!t)return;let a=!0;return nt(t).then(c=>{a&&(Ln(c.hasHunt?c.days:null),Wn(c.hasHunt?c.all:null),n())}).catch(()=>{}),()=>{a=!1}},[t])}function ea(){const{screen:s,go:n,patch:t,back:a,canGoBack:c,now:i}=O(),{user:r}=F(),o=Bt[s];_t(),qt(),Jt(),Kt(),Xt();const d=c&&!Ht.includes(s);function m(){t({role:"organizer"}),n("org-setup");const p=r==null?void 0:r.accessToken;p&&ne(p,{role:"organizer"}).catch(()=>{})}return e.jsxs("div",{className:`sfw sfw-${s}`,children:[e.jsxs("header",{className:"top",children:[e.jsxs("a",{className:"logo",href:"https://gemphere.com",target:"_blank",rel:"noopener noreferrer",children:[e.jsx("i",{style:{"--mark":`url(${ln})`},"aria-hidden":"true"}),"Gemphere"]}),e.jsxs("div",{className:"row",style:{gap:14},children:[e.jsxs("div",{className:"cd weekchip",children:[e.jsx(tt,{size:15,strokeWidth:1.7,"aria-hidden":"true"}),e.jsx("span",{children:An})]}),e.jsxs("div",{className:"cd",children:[e.jsx("i",{}),e.jsx("span",{className:"mono",children:Pn(i)}),e.jsx("span",{className:"cd-suffix",style:{color:"var(--muted)",fontWeight:400},children:"to SF Tech Week"})]}),!s.startsWith("org-")&&e.jsx("button",{className:"btn btn-t appbtn",onClick:m,children:"For organizers"})]})]}),e.jsx(Zt,{}),e.jsx(Qt,{}),e.jsxs("main",{className:`stage st-${s}${Dt.includes(s)?" wide":""}`,children:[d&&e.jsxs("button",{className:"backlink",onClick:a,children:[e.jsx("span",{"aria-hidden":"true",children:"←"})," Back"]}),e.jsx("section",{className:"screen on",children:e.jsx(o,{})},s)]})]})}function sa(s){return s==="organizer"||s==="organizers"?{screen:"org-setup",role:"organizer"}:{screen:"hunt",role:"attendee"}}function na(s){const{s:n,patch:t}=O(),{user:a}=F(),c=l.useRef(!1);l.useEffect(()=>{const i=a==null?void 0:a.accessToken;!i||c.current||n.registered||(c.current=!0,(async()=>{try{await Fn(i,{fullName:(a.fullName||"").trim(),email:(a.email||"").trim(),role:s}),await ne(i,{role:s})}catch{}t({registered:!0,role:s,name:n.name||a.fullName||"",email:n.email||a.email||""})})())},[a==null?void 0:a.accessToken,a==null?void 0:a.fullName,a==null?void 0:a.email,s,n.registered,n.name,n.email,t])}function ta({role:s}){return na(s),e.jsx(ea,{})}function ma(){const[s]=Be(),{user:n,isReady:t}=F(),{screen:a,role:c}=sa(s.get("start"));if(!t)return null;if(!(n!=null&&n.accessToken)){const i=new URLSearchParams(s);return i.delete("start"),i.set("signin",c),e.jsx(on,{to:`/sftw?${i.toString()}`,replace:!0})}return e.jsx(In,{initialScreen:a,initial:{role:c},children:e.jsx(ta,{role:c})})}export{ma 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.