PageSourceSearch

https://mindgolf.ai/assets/Records-CfatV_-R.js

js mindgolf.ai collected 2026-10-05 14:52:43 UTC 9,427 bytes, 1 lines download raw bytes

1import{j as e,r,n as F}from"./vendor-ahVw9cdH.js";import{F as V}from"./FreeRoundsCounter-CucQGTAP.js";import{ag as W,ac as q,f9 as H,a$ as L,a5 as I,a6 as _,fr as Q,O as J,f5 as Y,ab as Z,V as d,dv as K,cO as X,fs as ee,a7 as m,bN as te,bP as se,bQ as ae,bR as re,bS as ne,bT as oe,bU as le,bV as ie,q as de,eq as me,bZ as ce,az as ue,am as xe,bY as pe,al as D,fa as he,af as fe,du as be}from"./index-DXi0I5ak.js";import{a as je}from"./query-CeIq2NOR.js";import{T as ge}from"./TimeframeControls-CwLitKXI.js";import{r as ve}from"./notifications-CoFH3WAo.js";import{A as Ne}from"./AppBreadcrumb-DQQeh5xA.js";import{u as Ce}from"./useExternalSGImport-DBeOARlz.js";import{S}from"./SGImportWizard-M_WQQhmG.js";import{g as ye,a as Re}from"./round-journey-state-CAlxnxcv.js";import"./radix--pSzM2y8.js";import"./supabase-DYrB2Yg5.js";import"./charts-CSweoJhv.js";import"./forms-Cc1FL3tT.js";import"./calendar-VJ0tAwC5.js";import"./setYear-lX1ccTYE.js";import"./endOfWeek-CvZ6jUGu.js";import"./isSameDay-CFziqlbR.js";import"./breadcrumb-C59QT_kB.js";import"./elite-sg-applicability-CWAcEzPE.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"./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"./parseISO-UaVqcKYW.js";import"./ruler-B9FVQEL6.js";import"./save-B9yLpn_M.js";const ke=[{Icon:W,label:"Best Round",value:"74",sub:"−2 vs course"},{Icon:q,label:"Lowest Putts",value:"26",sub:"Pebble Beach"},{Icon:H,label:"Longest Streak",value:"5 wks",sub:"Active"},{Icon:L,label:"Biggest Drop",value:"−4.2",sub:"in handicap"}];function we(){return e.jsx("div",{className:"grid grid-cols-2 gap-2",children:ke.map(n=>e.jsx(I,{children:e.jsxs(_,{className:"p-3 space-y-1",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx(n.Icon,{className:"h-3.5 w-3.5 text-amber-500"}),e.jsx("span",{className:"text-[10px] text-muted-foreground",children:n.label})]}),e.jsx("p",{className:"text-lg font-bold tabular-nums",children:n.value}),e.jsx("p",{className:"text-[10px] text-muted-foreground",children:n.sub})]})},n.label))})}function Ct(){const[n,A]=r.useState(null),[z,y]=r.useState(!1),[h,R]=r.useState(null),[O,f]=r.useState(!1),[u,k]=r.useState(null),[b,E]=r.useState("year"),[j,w]=r.useState(0),c=F();je();const{data:s,isLoading:o}=Q(),P=Ce();r.useEffect(()=>{T(),ve()},[]);const T=async()=>{const{data:{user:t}}=await J.auth.getUser();t?A(t):c("/auth")},p=r.useMemo(()=>s?Y(s,b,j,t=>t.round_date):[],[s,b,j]),g=p.filter(t=>!t.match),v=p.filter(t=>{var a;if(!t.match)return!1;const l=(a=t.match.round)==null?void 0:a.processing_status;return l&&!["approved","analyzed"].includes(l)}),N=p.filter(t=>{var a;if(!t.match)return!1;const l=(a=t.match.round)==null?void 0:a.processing_status;return l==="approved"||l==="analyzed"}),B=async()=>{if(u)try{await P.mutateAsync(u.id),f(!1),k(null)}catch(t){console.error("Error deleting round:",t)}},C=({sg:t,status:l})=>{const a=r.useMemo(()=>ye(t.match,t.id,t.round_date,t.course_name||void 0),[t]),U=()=>l==="unlinked"?"border-amber-500/30 bg-gradient-to-br from-amber-500/5 to-orange-500/5":a.shouldResume?"border-blue-500/30 bg-gradient-to-br from-blue-500/5 to-violet-500/5":"",$=()=>a.displayState==="approved"?e.jsxs(m,{variant:"outline",className:"text-emerald-600 border-emerald-500/30 bg-emerald-500/10",children:[e.jsx(xe,{className:"h-3 w-3 mr-1"}),"Completed"]}):a.shouldResume?e.jsxs(m,{variant:"outline",className:"text-blue-600 border-blue-500/30 bg-blue-500/10",children:[e.jsx(pe,{className:"h-3 w-3 mr-1"}),"In Progress"]}):e.jsx(m,{variant:"outline",className:"text-amber-600 border-amber-500/30 bg-amber-500/10",children:"Needs Mental Data"}),G=()=>{const i=Re(a,t.id,t.round_date,t.course_name||void 0);i.type==="wizard"?R(i.roundId):i.type==="navigate"&&c(i.path)},M=()=>{var i;return a.displayState==="approved"?e.jsxs(d,{variant:"outline",size:"sm",className:"flex-1",onClick:()=>{var x;return c(`/rounds/${(x=t.match)==null?void 0:x.round_id}`)},children:[e.jsx(D,{className:"h-4 w-4 mr-1"}),"View Analysis"]}):a.shouldResume?e.jsxs(d,{size:"sm",className:"flex-1 bg-blue-600 hover:bg-blue-700",onClick:G,children:[e.jsx(he,{className:"h-4 w-4 mr-1"}),"Resume Round"]}):a.canViewDetails&&((i=t.match)!=null&&i.round_id)?e.jsxs(d,{size:"sm",className:"flex-1 bg-violet-600 hover:bg-violet-700",onClick:()=>{var x;return c(`/rounds/${(x=t.match)==null?void 0:x.round_id}`)},children:[e.jsx(D,{className:"h-4 w-4 mr-1"}),"View & Analyse"]}):e.jsxs(e.Fragment,{children:[e.jsxs(d,{size:"sm",className:"flex-1 bg-violet-600 hover:bg-violet-700",onClick:()=>
1c(`/talk?mode=round&sgId=${t.id}&sgDate=${t.round_date}&sgCourse=${encodeURIComponent(t.course_name||"")}`),children:[e.jsx(fe,{className:"h-4 w-4 mr-1"}),"Add Round Notes"]}),e.jsxs(d,{variant:"outline",size:"sm",onClick:()=>c(`/talk?mode=reflection&sgId=${t.id}&sgDate=${t.round_date}&sgCourse=${encodeURIComponent(t.course_name||"")}`),children:[e.jsx(be,{className:"h-4 w-4 mr-1"}),"Reflect"]})]})};return e.jsx(I,{className:ue("transition-all",U()),children:e.jsxs(_,{className:"p-4",children:[e.jsxs("div",{className:"flex items-start justify-between mb-3",children:[e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("h3",{className:"font-medium truncate",children:t.course_name||"Unknown Course"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:de(new Date(t.round_date),"EEEE, MMM d, yyyy")}),t.external_source&&e.jsx(m,{variant:"outline",className:"mt-1 text-xs",children:t.external_source})]}),e.jsxs("div",{className:"flex flex-col items-end gap-1",children:[e.jsx(me,{value:t.sg_total,size:"md",showIcon:!0}),$()]})]}),e.jsxs("div",{className:"flex gap-2",children:[M(),e.jsx(d,{variant:"ghost",size:"sm",className:"text-muted-foreground hover:text-destructive",onClick:()=>{k(t),f(!0)},children:e.jsx(ce,{className:"h-4 w-4"})})]})]})})};return n?e.jsxs("div",{className:"space-y-3",children:[e.jsx(Ne,{items:[{label:"Home",href:"/dashboard"},{label:"On-Course"}]}),e.jsxs("div",{children:[e.jsxs("h1",{className:"text-2xl font-bold flex items-center gap-2",children:[e.jsx(Z,{className:"h-6 w-6"}),"On-Course"]}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Import strokes gained data and add mental context"})]}),e.jsx(V,{}),s&&s.length>0&&e.jsxs(d,{size:"sm",variant:"outline",className:"w-full",onClick:()=>y(!0),children:[e.jsx(K,{className:"h-4 w-4 mr-2"}),"Import Strokes Gained Round"]}),s&&s.length>0&&e.jsx(ge,{timeframe:b,periodOffset:j,onTimeframeChange:t=>{E(t),w(0)},onPeriodOffsetChange:w,compact:!0,centered:!1}),o&&e.jsx(X,{}),!o&&(!s||s.length===0)&&e.jsx(ee,{page:"records",roundsRecorded:(s==null?void 0:s.length)??0,children:e.jsx(we,{})}),!o&&s&&s.length>0&&p.length===0&&e.jsx("div",{className:"text-center py-8 text-muted-foreground",children:"No rounds match the selected timeframe"}),!o&&g.length>0&&e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("h2",{className:"text-sm font-semibold text-amber-700 dark:text-amber-400",children:"Ready for Mental Data"}),e.jsx(m,{variant:"outline",className:"text-amber-600 border-amber-500/30",children:g.length})]}),g.map(t=>e.jsx(C,{sg:t,status:"unlinked"},t.id))]}),!o&&v.length>0&&e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("h2",{className:"text-sm font-semibold text-blue-700 dark:text-blue-400",children:"In Progress"}),e.jsx(m,{variant:"outline",className:"text-blue-600 border-blue-500/30",children:v.length})]}),v.map(t=>e.jsx(C,{sg:t,status:"in_progress"},t.id))]}),!o&&N.length>0&&e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("h2",{className:"text-sm font-semibold text-emerald-700 dark:text-emerald-400",children:"Completed"}),e.jsx(m,{variant:"outline",className:"text-emerald-600 border-emerald-500/30",children:N.length})]}),N.map(t=>e.jsx(C,{sg:t,status:"completed"},t.id))]}),!o&&s&&s.length>0,e.jsx(S,{open:z,onOpenChange:y}),h&&e.jsx(S,{open:!!h,onOpenChange:t=>{t||R(null)},initialDraftRoundId:h}),e.jsx(te,{open:O,onOpenChange:f,children:e.jsxs(se,{children:[e.jsxs(ae,{children:[e.jsx(re,{children:"Delete Round"}),e.jsxs(ne,{children:["Are you sure you want to delete this round from ",(u==null?void 0:u.course_name)||"Unknown Course","? This action cannot be undone."]})]}),e.jsxs(oe,{children:[e.jsx(le,{children:"Cancel"}),e.jsx(ie,{className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",onClick:B,children:"Delete"})]})]})})]}):null}export{Ct 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.