PageSourceSearch

https://mindgolf.ai/assets/OrgRecordRound-CAtWCoTW.js

js mindgolf.ai collected 2026-10-05 14:53:43 UTC 8,482 bytes, 1 lines download raw bytes

1import{q as A,r as l,j as e}from"./vendor-ahVw9cdH.js";import{B,a as D,b as j,d as L,e as z,c as U}from"./breadcrumb-C59QT_kB.js";import{ez as E,eA as F,eS as q,ab as M,dU as N,bC as Y,V as w,eU as g,bX as G,eM as b,eN as v,eO as C,a7 as V,az as S}from"./index-DXi0I5ak.js";import{u as H}from"./useShadowAthleteMutations-Bl6BIj_J.js";import{O as Q,S as T}from"./ShadowAthletePanel-DBvOOaRJ.js";import{C as X}from"./CoachRosterRoundEntryDialog-qXDT5AX4.js";import{C as J}from"./CoachShadowRoundEntryDialog-D3PfXRew.js";import{O as K}from"./OrgPageSkeleton-CB7vwaU8.js";import{C as W}from"./CoachDraftRoundsResume-By2JRYZ8.js";import"./radix--pSzM2y8.js";import"./supabase-DYrB2Yg5.js";import"./charts-CSweoJhv.js";import"./query-CeIq2NOR.js";import"./forms-Cc1FL3tT.js";import"./circle-x-gCUm4_Za.js";import"./user-check-BZoKlDGY.js";import"./ProBadge-f4y6d5B9.js";import"./pro-status-ITwCcTPD.js";import"./ProStatusFields-8mC-r4Tv.js";import"./ShadowAvatarUpload-BS-Ep1w_.js";import"./SGImportWizard-M_WQQhmG.js";import"./slider-C_IZaYBN.js";import"./useUnifiedCoachChat-BsErDRXx.js";import"./score-utils-CbzbcqzZ.js";import"./markdown-BiKHWscL.js";import"./CourseCombobox-BysBvuu6.js";import"./command-CK_xWGRQ.js";import"./chevrons-up-down-DYfEac18.js";import"./useExternalSGImport-DBeOARlz.js";import"./elite-sg-applicability-CWAcEzPE.js";import"./useImportProfiles---0LjDzK.js";import"./exceljs.min-CrWE-Rna.js";import"./_commonjs-dynamic-modules-TDtrdbi3.js";import"./LikertOptions-BoJtRtBk.js";import"./clipboard-check-DOi-ALrE.js";import"./battery-cUvfyqgx.js";import"./moon-BoHG4F4i.js";import"./wind-DDM9daqs.js";import"./club-constants-CuFYEor4.js";import"./useRoundDetail-pT4ZcXk-.js";import"./TierLegend-eS4dvAPO.js";import"./golf-stat-tiers-B_t78XU2.js";import"./CircularProgress-BuIze6Y1.js";import"./download-B1xImY38.js";import"./useBottomUpKpiCategoryImpacts-DwUJ4siq.js";import"./useBottomUpReadinessMatrix-Bw0kRfNF.js";import"./RecordingQuickViewSheet-BWlxmGo4.js";import"./RecordingChecklistContent-DUePdraQ.js";import"./circle-help-BWJGwUEn.js";import"./calendar-VJ0tAwC5.js";import"./setYear-lX1ccTYE.js";import"./endOfWeek-CvZ6jUGu.js";import"./isSameDay-CFziqlbR.js";import"./parseISO-UaVqcKYW.js";import"./ruler-B9FVQEL6.js";import"./save-B9yLpn_M.js";import"./AssignShadowRoundDialog-BPt1pnB4.js";import"./circle-play-DuK2gdK3.js";function at(){const{slug:p}=A(),{data:o,isLoading:_}=E(p),a=o==null?void 0:o.organization.id,{data:i=[]}=F(a),m=H(),[s,k]=l.useState(""),[r,d]=l.useState(null),[O,y]=l.useState(!1),[P,c]=l.useState(!1),u=(o==null?void 0:o.players)??[],I=u.length>0,h=l.useMemo(()=>{const t=u.filter(f=>f.consent_status==="accepted");if(!s.trim())return t;const n=s.toLowerCase();return t.filter(f=>(f.full_name??"").toLowerCase().includes(n))},[u,s]),x=l.useMemo(()=>{if(!s.trim())return i;const t=s.toLowerCase();return i.filter(n=>n.display_name.toLowerCase().includes(t))},[i,s]),R=h.length===0&&x.length===0;return _?e.jsx(K,{contentRows:2}):e.jsxs("div",{className:"space-y-4",children:[e.jsx(B,{children:e.jsxs(D,{children:[e.jsx(j,{children:e.jsx(L,{href:q(p||""),children:"Home"})}),e.jsx(z,{}),e.jsx(j,{children:e.jsx(U,{children:"Record a round"})})]})}),e.jsxs("div",{className:"space-y-1",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(M,{className:"h-5 w-5 text-emerald-500"}),e.jsx("h1",{className:"text-xl font-bold",children:"Record a round"})]}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Select a roster player — or a shadow athlete you own — to record a strokes-gained round on their behalf. Shadow rounds let you pick voice, manual or CSV entry so you can demonstrate every mode of the Certified protocol."})]}),e.jsx(W,{slug:p}),e.jsxs("div",{className:"relative max-w-md",children:[e.jsx(N,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),e.jsx(Y,{value:s,onChange:t=>k(t.target.value),placeholder:"Search players…",className:"pl-9"})]}),e.jsx("div",{className:"rounded-lg border bg-card",children:R?e.jsxs("div",{className:"px-4 py-10 text-center space-y-3",children:[e.jsx(N,{className:"h-6 w-6 text-muted-foreground
1/50 mx-auto"}),!I&&i.length===0?e.jsxs(e.Fragment,{children:[e.jsx("p",{className:"text-sm text-muted-foreground max-w-sm mx-auto",children:"No connected players or shadow athletes yet. Create a shadow athlete to demo the MindGolf protocol before your player signs up — or invite them directly."}),e.jsxs("div",{className:"flex flex-col sm:flex-row gap-2 justify-center pt-2",children:[e.jsxs(w,{size:"sm",variant:"outline",onClick:()=>c(!0),disabled:!a||m.isPending,className:"gap-2",children:[e.jsx(g,{className:"h-4 w-4"}),"Create shadow athlete"]}),e.jsxs(w,{size:"sm",onClick:()=>y(!0),disabled:!a,className:"gap-2",children:[e.jsx(G,{className:"h-4 w-4"}),"Invite players"]})]})]}):e.jsx("p",{className:"text-sm text-muted-foreground",children:"No players match your search."})]}):e.jsxs("div",{className:"p-2 space-y-1",children:[x.length>0&&e.jsx("div",{className:"px-3 pt-2 pb-1 text-[10px] uppercase tracking-wide text-muted-foreground",children:"Your athletes (pre-signup)"}),x.map(t=>e.jsxs("button",{onClick:()=>d({playerId:t.id,playerName:t.display_name,kind:"shadow"}),className:S("w-full flex items-center gap-3 px-3 py-2.5 rounded-md hover:bg-accent transition-colors text-left"),children:[e.jsxs(b,{className:"h-8 w-8",children:[t.avatar_url&&e.jsx(v,{src:t.avatar_url,alt:t.display_name,className:"object-cover"}),e.jsx(C,{className:"text-xs bg-secondary text-secondary-foreground",children:t.display_name.charAt(0).toUpperCase()})]}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsxs("p",{className:"text-sm font-medium truncate flex items-center gap-2",children:[t.display_name,e.jsxs(V,{variant:"secondary",className:"bg-purple-500/10 text-purple-600 border-purple-500/30 gap-1 text-[10px] px-1.5 py-0",children:[e.jsx(g,{className:"h-3 w-3"}),"Shadow"]})]}),e.jsx("p",{className:"text-[11px] text-muted-foreground truncate",children:"Rounds transfer when the player claims their invite."})]})]},t.id)),i.length===0&&a&&e.jsxs("button",{onClick:()=>c(!0),disabled:m.isPending,className:"w-full flex items-center gap-3 px-3 py-2.5 rounded-md hover:bg-accent transition-colors text-left border border-dashed",children:[e.jsx("div",{className:"h-8 w-8 rounded-full bg-muted flex items-center justify-center",children:e.jsx(g,{className:"h-4 w-4 text-muted-foreground"})}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("p",{className:"text-sm font-medium",children:"Create shadow athlete"}),e.jsx("p",{className:"text-[11px] text-muted-foreground",children:"Record round on behalf of your player before they signs up. You can invite them to signup at anytime."})]})]}),h.length>0&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"px-3 pt-3 pb-1 text-[10px] uppercase tracking-wide text-muted-foreground",children:"Connected players"}),e.jsx("p",{className:"px-3 pb-1 text-[11px] leading-snug text-muted-foreground/80",children:"You can always record on their behalf. Players on the free plan can complete 3 rounds — beyond that they'll need Pro to review and complete the round you recorded."})]}),h.map(t=>e.jsxs("button",{onClick:()=>d({playerId:t.player_id,playerName:t.full_name??"Player",kind:"roster"}),className:S("w-full flex items-center gap-3 px-3 py-2.5 rounded-md hover:bg-accent transition-colors text-left"),children:[e.jsxs(b,{className:"h-8 w-8",children:[t.avatar_url&&e.jsx(v,{src:t.avatar_url,alt:t.full_name??""}),e.jsx(C,{className:"text-xs bg-primary/10 text-primary",children:(t.full_name??"P").charAt(0).toUpperCase()})]}),e.jsx("div",{className:"min-w-0 flex-1",children:e.jsx("p",{className:"text-sm font-medium truncate",children:t.full_name??"Player"})})]},t.player_id))]})}),r&&a&&r.kind==="shadow"&&e.jsx(J,{shadowAthleteId:r.playerId,shadowDisplayName:r.playerName,organizationId:a,open:!!r,onOpenChange:t=>{t||d(null)}}),r&&a&&r.kind==="roster"&&e.jsx(X,{rosterPlayerId:r.playerId,rosterDisplayName:r.playerName,organizationId:a,open:!!r,onOpenChange:t=>{t||d(null)}}),a&&e.jsx(Q,{open:O,onOpenChange:y,organizationId:a}),a&&e.jsx(T,{open:P,onOpenChange:c,title:"Create shadow athlete",submitLabel:"Create",pending:m.isPending,onSubmit:t=>m.mutate({organizationId:a,displayName:t.name,handicap:t.hcp,invitedEmail:t.email},{onSuccess:n=>{c(!1),d({playerId:n.id,playerName:n.display_name,kind:"shadow"})}})})]})}export{at 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.