1import{f as ye,g as rt,r as a,j as e,F as ct,C as se,c as Pe,d as De,as as nt,B as f,e as ae,m as lt,b as y,at as Ae,R as Ge,u as it,a as dt,t as re,A as mt,n as ut,X as xt,ag as He,aq as pt,ak as gt}from"./index-bM8UT4Os.js";import{I as Q}from"./input-BwpLlRYf.js";import{L as F}from"./label-2Seh_wFH.js";import{S as We,a as Ne,b as Ce,c as Se,d as ce}from"./select-CDP2pHh8.js";import{C as ht}from"./chevron-left-Bx_6cTqG.js";import{C as bt}from"./chevron-right-RXMaR5IV.js";import{C as ft}from"./circle-check-BF-IFrtm.js";import{D as Re,c as kt,a as $e,d as ze,b as Ue}from"./dialog-CxcTDVnZ.js";import{T as qe}from"./trash-2-4iirX7DH.js";import{M as ke}from"./minus-DyschO7I.js";import{P as ne}from"./plus-DSaqw8wa.js";import{S as Me,D as yt,h as Ie}from"./html2canvas-pro.esm-DOKDsR1V.js";import{I as jt}from"./image-CNPVod1c.js";import"./useComposition-DO5dIJEj.js";import"./chevron-up-TG6jWiKP.js";/** 2 * @license lucide-react v0.453.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 Fe=ye("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);/** 7 * @license lucide-react v0.453.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 wt=ye("Pause",[["rect",{x:"14",y:"4",width:"4",height:"16",rx:"1",key:"zuxfzm"}],["rect",{x:"6",y:"4",width:"4",height:"16",rx:"1",key:"1okwgv"}]]);/** 12 * @license lucide-react v0.453.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 Ve=ye("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]);/** 17 * @license lucide-react v0.453.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 Oe=ye("Save",[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]]),vt=["æ¥","ä¸","äº","ä¸","å","äº","å "];function Wt({data:n,mode:l,onDateSelect:u,onMonthChange:d,streak:w=0,monthSummary:i,selectedDate:g}){const{theme:o}=rt(),[m,b]=a.useState(new Date),N=m.getFullYear(),L=m.getMonth(),D=a.useMemo(()=>{const j=new Date(N,L,1).getDay(),_=new Date(N,L+1,0).getDate(),W=[];for(let P=0;P<j;P++)W.push(null);for(let P=1;P<=_;P++)W.push(P);return W},[N,L]),z=new Date,M=`${z.getFullYear()}-${String(z.getMonth()+1).padStart(2,"0")}-${String(z.getDate()).padStart(2,"0")}`,T=j=>{const _=new Date(N,L+j,1);b(_),d?.(_.getFullYear(),_.getMonth()+1)},r=j=>`${N}-${String(L+1).padStart(2,"0")}-${String(j).padStart(2,"0")}`,v=j=>{const _=r(j),W=n[_],P=_===M,q=_===g,X=W?.status||"empty",V=`w-10 h-10 rounded-xl flex flex-col items-center justify-center text-sm font-medium transition-all duration-150 cursor-pointer active:scale-[0.95] ${o==="dark"?"border border-white/[0.08]":"border border-black/[0.06]"}`;if(q)return`${V} bg-blue-600 text-white font-bold shadow-[0_2px_8px_rgba(37,99,235,0.4)]`;const Z=P?o==="dark"?"ring-2 ring-blue-400 ring-offset-1 ring-offset-zinc-900":"ring-2 ring-blue-500 ring-offset-1 ring-offset-white":"",le={"on-target":o==="dark"?"bg-green-500/20 text-green-400 font-semibold":"bg-green-50 text-green-700 font-semibold",under:o==="dark"?"bg-yellow-500/20 text-yellow-400 font-semibold":"bg-yellow-50 text-yellow-700 font-semibold",over:o==="dark"?"bg-red-500/20 text-red-400 font-semibold":"bg-red-50 text-red-700 font-semibold",trained:o==="dark"?"bg-green-500/15 text-green-400 font-semibold":"bg-green-50/80 text-green-600 font-semibold",empty:o==="dark"?"text-zinc-500 hover:bg-zinc-700/40":"text-zinc-400 hover:bg-zinc-100"}[X];return`${V} ${le} ${Z}`},k=o==="dark"?"bg-transparent border border-white/10 rounded-[20px] p-5 backdrop-blur-xl shadow-[0_8px_32px_rgba(0,0,0,0.3),0_4px_16px_rgba(0,0,0,0.2),inset_0_1px_0_rgba(255,255,255,0.06)]":"bg-transparent border border-black/5 rounded-[20px] p-5 backdrop-blur-xl shadow-[0_8px_32px_rgba(0,0,0,0.08),0_4px_16px_rgba(0,0,0,0.05),inset_0_1px_0_rgba(255,255,255,0.8)]",x=o==="dark"?"text-zinc-50":"text-zinc-900",p=o==="dark"?"text-zinc-400":"text-zinc-500";return e.jsxs("div",{"data-loc":"client/src/components/UnifiedCalendar.tsx:137",className:k,children:[e.jsxs("div",{"data-loc":"client/src/components/UnifiedCalendar.tsx:139",className:"flex items-center justify-between mb-4",children:[e.jsxs("div",{"data-loc":"client/src/components/UnifiedCalendar.tsx:140",className:"flex items-center gap-2",children:[e.jsx("button",{"data-loc":"client/src/components/UnifiedCalendar.tsx:141",onClick:()=>T(-1),className:`w-8 h-8 rounded-lg flex items-center justify-center transition-all duration-150 active:scale-[0.95] ${o==="dark"?"hover:bg-zinc-700/60 text-zinc-300":"hover:bg-zinc-100 text-zinc-600"}`,children:e.jsx(ht,{"data-loc":"client/src/components/UnifiedCalendar.tsx:149",className:"w-5 h-5"})}),e.jsxs("h3",{"data-loc":"client/src/components/UnifiedCalendar.tsx:151",className:`text-lg font-bold ${x}`,children:[N,"å¹´",L+1,"æ"]}),e.jsx("button",{"data-loc":"client/src/components/UnifiedCalendar.tsx:154",onClick:()=>T(1),className:`w-8 h-8 rounded-lg flex items-center justify-center transition-all duration-150 active:scale-[0.95] ${o==="dark"?"hover:bg-zinc-700/60 text-zinc-300":"hover:bg-zinc-100 text-zinc-600"}`,children:e.jsx(bt,{"data-loc":"client/src/components/UnifiedCalendar.tsx:162",className:"w-5 h-5"})})]}),w>0&&e.jsxs("div",{"data-loc":"client/src/components/UnifiedCalendar.tsx:168",className:`flex items-center gap-1.5 px-3 py-1.5 rounded-full text-sm font-bold ${o==="dark"?"bg-orange-500/20 text-orange-400 border border-orange-500/30":"bg-orange-50 text-orange-600 border border-orange-200"}`,children:[e.jsx(ct,{"data-loc":"client/src/components/UnifiedCalendar.tsx:175",className:"w-4 h-4"}),e.jsxs("span",{"data-loc":"client/src/components/UnifiedCalendar.tsx:176",children:[w,"æ¥é£çº"]})]})]}),e.jsx("div",{"data-loc":"client/src/components/UnifiedCalendar.tsx:182",className:"grid grid-cols-7 gap-1 mb-2",children:vt.map(j=>e.jsx("div",{"data-loc":"client/src/components/UnifiedCalendar.tsx:184",className:`text-center text-xs font-semibold py-1 ${p}`,children:j},j))}),e.jsx("div",{"data-loc":"client/src/components/UnifiedCalendar.tsx:194",className:"grid grid-cols-7 gap-1",children:D.map((j,_)=>{if(j===null)return e.jsx("div",{"data-loc":"client/src/components/UnifiedCalendar.tsx:197",className:"w-10 h-10"},`empty-${_}`);const W=r(j),P=n[W];return e.jsxs("div",{"data-loc":"client/src/components/UnifiedCalendar.tsx:204",className:v(j),onClick:()=>u(W),children:[e.jsx("span",{"data-loc":"client/src/components/UnifiedCalendar.tsx:209",children:j}),l==="combined"&&P?.hasWorkout&&e.jsx("div",{"data-loc":"client/src/components/UnifiedCalendar.tsx:212",className:"w-1.5 h-1.5 rounded-full bg-green-500 mt-0.5"})]},W)})}),i&&e.jsxs("div",{"data-loc":"client/src/components/UnifiedCalendar.tsx:221",className:`flex items-center justify-between px-4 py-3 rounded-xl mt-4 ${o==="dark"?"bg-white/5 border border-white/10 backdrop-blur-sm":"bg-black/5 border border-black/5 backdrop-blur-sm"}`,children:[e.jsxs("div",{"data-loc":"client/src/components/UnifiedCalendar.tsx:228",className:"flex items-center gap-4",children:[e.jsxs("div",{"data-loc":"client/src/components/UnifiedCalendar.tsx:229",className:"text-center",children:[e.jsx("div",{"data-loc":"client/src/components/UnifiedCalendar.tsx:230",className:`text-lg font-bold ${x}`,children:i.onTargetDays}),e.jsx("div",{"data-loc":"client/src/components/UnifiedCalendar.tsx:233",className:`text-xs ${p}`,children:l==="workout"?"è¨ç·´æ¥":"鿍æ¥"})]}),e.jsx("div",{"data-loc":"client/src/components/UnifiedCalendar.tsx:237",className:`w-px h-8 ${o==="dark"?"bg-zinc-700":"bg-zinc-200"}`}),e.jsxs("div",{"data-loc":"client/src/components/UnifiedCalendar.tsx:240",className:"text-center",children:[e.jsx("div",{"data-loc":"client/src/components/UnifiedCalendar.tsx:241",className:`text-lg font-bold ${x}`,children:i.totalRecordedDays}),e.jsx("div",{"data-loc":"client/src/components/UnifiedCalendar.tsx:244",className:`text-xs ${p}`,children:"è¨éæ¥"})]})]}),i.averageCalories&&e.jsxs("div",{"data-loc":"client/src/components/UnifiedCalendar.tsx:249",className:"text-right",children:[e.jsx("div",{"data-loc":"client/src/components/UnifiedCalendar.tsx:250",className:`text-lg font-bold ${x}
21`,children:i.averageCalories.toLocaleString()}),e.jsx("div",{"data-loc":"client/src/components/UnifiedCalendar.tsx:253",className:`text-xs ${p}`,children:"å¹³å kcal"})]}),i.totalWorkouts!==void 0&&e.jsxs("div",{"data-loc":"client/src/components/UnifiedCalendar.tsx:258",className:"text-right",children:[e.jsx("div",{"data-loc":"client/src/components/UnifiedCalendar.tsx:259",className:`text-lg font-bold ${x}`,children:i.totalWorkouts}),e.jsx("div",{"data-loc":"client/src/components/UnifiedCalendar.tsx:262",className:`text-xs ${p}`,children:"總è¨ç·´æ¬¡"})]})]}),e.jsxs("div",{"data-loc":"client/src/components/UnifiedCalendar.tsx:269",className:`flex flex-wrap gap-3 mt-3 pt-3 border-t ${o==="dark"?"border-zinc-700/40":"border-zinc-200/60"}`,children:[l==="diet"&&e.jsxs(e.Fragment,{children:[e.jsx(J,{"data-loc":"client/src/components/UnifiedCalendar.tsx:274",color:"bg-green-500",label:"鿍",theme:o}),e.jsx(J,{"data-loc":"client/src/components/UnifiedCalendar.tsx:275",color:"bg-yellow-500",label:"åå°",theme:o}),e.jsx(J,{"data-loc":"client/src/components/UnifiedCalendar.tsx:276",color:"bg-red-500",label:"è¶
æ¨",theme:o})]}),l==="workout"&&e.jsxs(e.Fragment,{children:[e.jsx(J,{"data-loc":"client/src/components/UnifiedCalendar.tsx:281",color:"bg-green-500",label:"æè¨ç·´",theme:o}),e.jsx(J,{"data-loc":"client/src/components/UnifiedCalendar.tsx:282",color:"bg-zinc-400",label:"伿¯æ¥",theme:o})]}),l==="combined"&&e.jsxs(e.Fragment,{children:[e.jsx(J,{"data-loc":"client/src/components/UnifiedCalendar.tsx:287",color:"bg-green-500",label:"鿍",theme:o}),e.jsx(J,{"data-loc":"client/src/components/UnifiedCalendar.tsx:288",color:"bg-yellow-500",label:"åå°",theme:o}),e.jsx(J,{"data-loc":"client/src/components/UnifiedCalendar.tsx:289",color:"bg-red-500",label:"è¶
æ¨",theme:o}),e.jsxs("div",{"data-loc":"client/src/components/UnifiedCalendar.tsx:290",className:"flex items-center gap-1.5",children:[e.jsx("div",{"data-loc":"client/src/components/UnifiedCalendar.tsx:291",className:"w-2 h-2 rounded-full bg-green-500"}),e.jsx("span",{"data-loc":"client/src/components/UnifiedCalendar.tsx:292",className:`text-xs ${o==="dark"?"text-zinc-400":"text-zinc-500"}`,children:"æè¨ç·´"})]})]})]})]})}function J({color:n,label:l,theme:u}){return e.jsxs("div",{"data-loc":"client/src/components/UnifiedCalendar.tsx:311",className:"flex items-center gap-1.5",children:[e.jsx("div",{"data-loc":"client/src/components/UnifiedCalendar.tsx:312",className:`w-3 h-3 rounded ${n}`}),e.jsx("span",{"data-loc":"client/src/components/UnifiedCalendar.tsx:313",className:`text-xs ${u==="dark"?"text-zinc-400":"text-zinc-500"}`,children:l})]})}function Nt({show:n,message:l="æåï¼",emoji:u="ðª",onComplete:d,duration:w=1800}){const[i,g]=a.useState(!1),[o,m]=a.useState(!1);return a.useEffect(()=>{if(n){g(!0),requestAnimationFrame(()=>m(!0));const b=setTimeout(()=>{m(!1),setTimeout(()=>{g(!1),d?.()},300)},w);return()=>clearTimeout(b)}},[n,w,d]),i?e.jsxs("div",{"data-loc":"client/src/components/SuccessOverlay.tsx:48",className:`fixed inset-0 z-[100] flex items-center justify-center transition-all duration-300 ${o?"opacity-100":"opacity-0"}`,style:{pointerEvents:"none"},children:[e.jsx("div",{"data-loc":"client/src/components/SuccessOverlay.tsx:55",className:`absolute inset-0 bg-black/40 backdrop-blur-sm transition-opacity duration-300 ${o?"opacity-100":"opacity-0"}`}),e.jsxs("div",{"data-loc":"client/src/components/SuccessOverlay.tsx:62",className:`relative flex flex-col items-center gap-3 transition-all duration-500 ${o?"scale-100 opacity-100 translate-y-0":"scale-75 opacity-0 translate-y-4"}`,style:{transitionTimingFunction:"cubic-bezier(0.23, 1, 0.32, 1)"},children:[e.jsxs("div",{"data-loc":"client/src/components/SuccessOverlay.tsx:73",className:"relative",children:[e.jsx("div",{"data-loc":"client/src/components/SuccessOverlay.tsx:74",className:`absolute inset-0 rounded-full bg-green-500/20 transition-all duration-700 ${o?"scale-150 opacity-0":"scale-100 opacity-100"}`}),e.jsx("div",{"data-loc":"client/src/components/SuccessOverlay.tsx:79",className:`absolute inset-0 rounded-full bg-green-500/10 transition-all duration-1000 delay-200 ${o?"scale-[2] opacity-0":"scale-100 opacity-100"}`}),e.jsx("div",{"data-loc":"client/src/components/SuccessOverlay.tsx:84",className:"relative w-20 h-20 rounded-full bg-gradient-to-br from-green-400 to-green-600 flex items-center justify-center shadow-lg shadow-green-500/30",children:e.jsx(ft,{"data-loc":"client/src/components/SuccessOverlay.tsx:85",className:"w-10 h-10 text-white",strokeWidth:2.5})})]}),e.jsx("div",{"data-loc":"client/src/components/SuccessOverlay.tsx:90",className:"text-center",children:e.jsxs("p",{"data-loc":"client/src/components/SuccessOverlay.tsx:91",className:"text-xl font-bold text-white",children:[u," ",l]})})]})]}):null}const Ct=[{id:"push_day",name:"Push Dayï¼æ¨ï¼",icon:"ðª",isPreset:!0,exercises:[{name:"æ§é´è¥æ¨ Bench Press",sets:4,reps:8,weight:60},{name:"ä¸æè¥æ¨ Incline Bench Press",sets:3,reps:10,weight:50}
21,{name:"åé´è©æ¨ Dumbbell Shoulder Press",sets:3,reps:10,weight:30},{name:"å´å¹³è Lateral Raise",sets:3,reps:15,weight:8},{name:"ä¸é ä¸å£ Tricep Pushdown",sets:3,reps:12,weight:20},{name:"ç¹©ç´¢å¤¾è¸ Cable Crossover",sets:3,reps:12,weight:15}]},{id:"pull_day",name:"Pull Dayï¼æï¼",icon:"ð",isPreset:!0,exercises:[{name:"硬æ Deadlift",sets:4,reps:6,weight:100},{name:"å¼é«åä¸ Pull Up",sets:3,reps:8,weight:0},{name:"æ§é´åè¹ Barbell Row",sets:3,reps:10,weight:60},{name:"颿 Face Pull",sets:3,reps:15,weight:15},{name:"æ§é´å½è Barbell Curl",sets:3,reps:12,weight:12},{name:"éå¼å½è Hammer Curl",sets:3,reps:12,weight:10}]},{id:"leg_day",name:"Leg Dayï¼è
¿ï¼",icon:"ð¦µ",isPreset:!0,exercises:[{name:"æ§é´æ·±è¹² Barbell Squat",sets:4,reps:8,weight:80},{name:"è
¿æ¨ Leg Press",sets:3,reps:12,weight:120},{name:"ä¿å å©äºåè
¿è¹² Bulgarian Split Squat",sets:3,reps:10,weight:20},{name:"è
¿å½è Leg Curl",sets:3,reps:12,weight:40},{name:"è
¿ä¼¸å± Leg Extension",sets:3,reps:12,weight:40},{name:"å°è
¿æè¸µ Calf Raise",sets:4,reps:15,weight:60}]},{id:"upper_body",name:"Upper Bodyï¼ä¸èº«ï¼",icon:"ðï¸",isPreset:!0,exercises:[{name:"æ§é´è¥æ¨ Bench Press",sets:4,reps:8,weight:60},{name:"æ§é´åè¹ Barbell Row",sets:4,reps:8,weight:60}
21,{name:"åé´è©æ¨ Dumbbell Shoulder Press",sets:3,reps:10,weight:30},{name:"å¼é«åä¸ Pull Up",sets:3,reps:8,weight:0},{name:"æ§é´å½è Barbell Curl",sets:3,reps:12,weight:12},{name:"ä¸é ä¸å£ Tricep Pushdown",sets:3,reps:12,weight:20}]},{id:"hyrox_prep",name:"Hyrox åæ°",icon:"ð
",isPreset:!0,exercises:[{name:"éªæ©æ¨ Sled Push",sets:4,reps:1,weight:100},{name:"éªæ©æ Sled Pull",sets:4,reps:1,weight:80},{name:"çç Wall Ball",sets:3,reps:15,weight:9},{name:"æ³¢æ¯è·³é Burpee Broad Jump",sets:3,reps:10,weight:0},{name:"農夫è¡èµ° Farmer's Carry",sets:3,reps:1,weight:24},{name:"å£ºé´æºçª Kettlebell Swing",sets:3,reps:15,weight:16}]}],Ee="fitdiet_workout_templates";function St({onLoadTemplate:n,currentExercises:l}){const[u,d]=a.useState([]),[w,i]=a.useState(!1),[g,o]=a.useState(""),[m,b]=a.useState(null);a.useEffect(()=>{try{const r=localStorage.getItem(Ee);r&&d(JSON.parse(r))}catch(r){console.error("Failed to load templates:",r)}},[]);const N=r=>{d(r),localStorage.setItem(Ee,JSON.stringify(r))},L=()=>
21{if(!g.trim()){y.error("å
¥è¿å模æ¿åå
");return}if(!l||l.length===0){y.error("仿¥ä»²æªæè¨ç·´è¨éï¼è¨ä½å¹¾ååä½å
åå²å");return}const r={id:`custom_${Date.now()}`,name:g.trim(),icon:"ð",exercises:l};N([...u,r]),o(""),i(!1),y.success("模æ¿å·²å²åï¼ä¸æ¬¡å¯ä»¥ç´æ¥è¼å
¥")},D=r=>{N(u.filter(v=>v.id!==r)),y.success("模æ¿å·²å·å")},z=r=>{b(r)},M=()=>{m&&(n(m.exercises),b(null),y.success(`å·²è¼å
¥ã${m.name}ãæ¨¡æ¿ï¼éåè¨éå¦ï¼`))},T=[...Ct,...u];return e.jsxs(se,{"data-loc":"client/src/components/WorkoutTemplates.tsx:174",className:"mb-6 bg-card border-border shadow-md",children:[e.jsx(Pe,{"data-loc":"client/src/components/WorkoutTemplates.tsx:175",className:"pb-3",children:e.jsxs("div",{"data-loc":"client/src/components/WorkoutTemplates.tsx:176",className:"flex items-center justify-between",children:[e.jsxs(De,{"data-loc":"client/src/components/WorkoutTemplates.tsx:177",className:"text-lg flex items-center gap-2",children:[e.jsx(nt,{"data-loc":"client/src/components/WorkoutTemplates.tsx:178",className:"w-5 h-5"})," è¨ç·´æ¨¡æ¿"]}),e.jsxs(Re,{"data-loc":"client/src/components/WorkoutTemplates.tsx:180",open:w,onOpenChange:i,children:[e.jsx(kt,{"data-loc":"client/src/components/WorkoutTemplates.tsx:181",asChild:!0,children:e.jsxs(f,{"data-loc":"client/src/components/WorkoutTemplates.tsx:182",variant:"outline",size:"sm",className:"gap-1",children:[e.jsx(Oe,{"data-loc":"client/src/components/WorkoutTemplates.tsx:183",className:"w-3.5 h-3.5"})," å²å仿¥"]})}),e.jsxs($e,{"data-loc":"client/src/components/WorkoutTemplates.tsx:186",children:[e.jsx(ze,{"data-loc":"client/src/components/WorkoutTemplates.tsx:187",children:e.jsx(Ue,{"data-loc":"client/src/components/WorkoutTemplates.tsx:188",children:"å²åçºè¨ç·´æ¨¡æ¿"})}),e.jsxs("div",{"data-loc":"client/src/components/WorkoutTemplates.tsx:190",className:"space-y-4 pt-2",children:[e.jsxs("div",{"data-loc":"client/src/components/WorkoutTemplates.tsx:191",children:[e.jsx(F,{"data-loc":"client/src/components/WorkoutTemplates.tsx:192",children:"模æ¿å稱"}),e.jsx(Q,{"data-loc":"client/src/components/WorkoutTemplates.tsx:193",className:"mt-1",placeholder:"ä¾ï¼æå
Push Day",value:g,onChange:r=>o(r.target.value)})]}),l&&l.length>0?e.jsxs("div",{"data-loc":"client/src/components/WorkoutTemplates.tsx:201",className:"space-y-1",children:[e.jsxs(F,{"data-loc":"client/src/components/WorkoutTemplates.tsx:202",className:"text-xs text-muted-foreground",children:["å°æå²åä»¥ä¸ ",l.length," ååä½ï¼"]}),l.map((r,v)=>e.jsxs("div",{"data-loc":"client/src/components/WorkoutTemplates.tsx:204",className:"text-sm bg-muted/30 px-2 py-1 rounded",children:[r.name," â ",r.sets,"Ã",r.reps," @ ",r.weight,"kg"]},v))]}):e.jsx("p",{"data-loc":"client/src/components/WorkoutTemplates.tsx:210",className:"text-sm text-muted-foreground",children:"仿¥ä»²æªæè¨ç·´è¨éï¼è¨ä½å¹¾ååä½å
åå²åã"}),e.jsxs(f,{"data-loc":"client/src/components/WorkoutTemplates.tsx:212",onClick:L,className:"w-full",disabled:!l||l.length===0,children:[e.jsx(Oe,{"data-loc":"client/src/components/WorkoutTemplates.tsx:213",className:"w-4 h-4 mr-2"})," å²å模æ¿"]})]})]})]})]})}),e.jsxs(ae,{"data-loc":"client/src/components/WorkoutTemplates.tsx:220",children:[m&&e.jsx(Re,{"data-loc":"client/src/components/WorkoutTemplates.tsx:223",open:!!m,onOpenChange:()=>b(null),children:e.jsxs($e,{"data-loc":"client/src/components/WorkoutTemplates.tsx:224",children:[e.jsx(ze,{"data-loc":"client/src/components/WorkoutTemplates.tsx:225",children:e.jsxs(Ue,{"data-loc":"client/src/components/WorkoutTemplates.tsx:226",children:[m.icon," ",m.name]})}),e.jsxs("div",{"data-loc":"client/src/components/WorkoutTemplates.tsx:228",className:"space-y-3 pt-2",children:[e.jsx("p",{"data-loc":"client/src/components/WorkoutTemplates.tsx:229",className:"text-sm text-muted-foreground",children:"è¼å
¥å¢åæ¨¡æ¿æéåå¹«ä½ è¨é以ä¸åä½ï¼"}),e.jsx("div",{"data-loc":"client/src/components/WorkoutTemplates.tsx:230",className:"space-y-1.5 max-h-[300px] overflow-y-auto",children:m.exercises.map((r,v)=>e.jsxs("div",{"data-loc":"client/src/components/WorkoutTemplates.tsx:232",className:"flex items-center justify-between text-sm bg-muted/30 px-3 py-2 rounded-lg",children:[e.jsx("span",{"data-loc":"client/src/components/WorkoutTemplates.tsx:233",className:"font-medium",children:r.name}),e.jsxs("span",{"data-loc":"client/src/components/WorkoutTemplates.tsx:234",className:"text-muted-foreground",children:[r.sets,"Ã",r.reps," ",r.weight>0?`@ ${r.weight}kg`:""]})]},v))}),e.jsxs(f,{"data-loc":"client/src/components/WorkoutTemplates.tsx:238",onClick:M,className:"w-full",children:[e.jsx(Ve,{"data-loc":"client/src/components/WorkoutTemplates.tsx:239",className:"w-4 h-4 mr-2"})," éå§è¨ç·´"]})]})]})}),e.jsx("div",{"data-loc":"client/src/components/WorkoutTemplates.tsx:247",className:"grid grid-cols-2 md:grid-cols-3 gap-2",children:T.map(r=>e.jsxs("button",{"data-loc":"client/src/components/WorkoutTemplates.tsx:249",onClick:()=>z(r),className:"relative group text-left p-3 rounded-lg bg-muted/20 hover:bg-muted/40 border border-transparent hover:border-primary/30 transition-all duration-200",children:[e.jsxs("div",{"data-loc":"client/src/components/WorkoutTemplates.tsx:254",className:"flex items-center gap-2 mb-1",children:[e.jsx("span",{"data-loc":"client/src/components/WorkoutTemplates.tsx:255",className:"text-lg",children:r.icon}),e.jsx("span",{"data-loc":"client/src/components/WorkoutTemplates.tsx:256",className:"text-sm font-medium truncate",children:r.name})]}),e.jsxs("div",{"data-loc":"client/src/components/WorkoutTemplates.tsx:258",className:"text-xs text-muted-foreground",children:[r.exercises.length," ååä½"]}),r.isPreset&&e.jsx(lt,{"data-loc":"client/src/components/WorkoutTemplates.tsx:262",variant:"secondary",className:"absolute top-1.5 right-1.5 text-[10px] px-1 py-0",children:"é è¨"}),!r.isPreset&&e.jsx("button",{"data-loc":"client/src/components/WorkoutTemplates.tsx:267",onClick:v=>{v.stopPropagation(),D(r.id)},className:"absolute top-1.5 right-1.5 opacity-0 group-hover:opacity-100 transition-opacity p-1 rounded hover:bg-destructive/20",children:e.jsx(qe,{"data-loc":"client/src/components/WorkoutTemplates.tsx:274",className:"w-3 h-3 text-destructive"})})]},r.id))})]})]})}function Lt({defaultSeconds:n=90,onTimerComplete:l}
21){const[u,d]=a.useState(n),[w,i]=a.useState(n),[g,o]=a.useState(!1),[m,b]=a.useState(!1),N=a.useRef(null);a.useRef(null),a.useEffect(()=>()=>{N.current&&clearInterval(N.current)},[]),a.useEffect(()=>(g&&w>0&&(N.current=setInterval(()=>{i(k=>k<=1?(o(!1),b(!0),L(),l?.(),0):k-1)},1e3)),()=>{N.current&&clearInterval(N.current)}),[g,w,l]);const L=a.useCallback(()=>{try{const k=new(window.AudioContext||window.webkitAudioContext),x=k.createOscillator(),p=k.createGain();x.connect(p),p.connect(k.destination),x.frequency.value=800,x.type="sine",p.gain.value=.3,x.start(),setTimeout(()=>{p.gain.value=0},150),setTimeout(()=>{p.gain.value=.3},250),setTimeout(()=>{p.gain.value=0},400),setTimeout(()=>{p.gain.value=.3},500),setTimeout(()=>{x.stop(),k.close()},650)}catch{}},[]),D=()=>{m?(i(u),b(!1),o(!0)):o(!g)},z=()=>{o(!1),b(!1),i(u)},M=k=>{const x=Math.max(15,Math.min(300,u+k));d(x),g||(i(x),b(!1))},T=(u-w)/u*100,r=Math.floor(w/60),v=w%60;return e.jsx(se,{"data-loc":"client/src/components/RestTimer.tsx:103",className:`bg-card border-border shadow-md transition-all duration-300 ${m?"border-green-500/50 shadow-green-500/20":g?"border-primary/30":""}`,children:e.jsx(ae,{"data-loc":"client/src/components/RestTimer.tsx:104",className:"pt-4 pb-4",children:e.jsxs("div",{"data-loc":"client/src/components/RestTimer.tsx:105",className:"flex items-center gap-4",children:[e.jsxs("div",{"data-loc":"client/src/components/RestTimer.tsx:107",className:"relative w-16 h-16 flex-shrink-0",children:[e.jsxs("svg",{"data-loc":"client/src/components/RestTimer.tsx:108",className:"w-full h-full -rotate-90",viewBox:"0 0 36 36",children:[e.jsx("path",{"data-loc":"client/src/components/RestTimer.tsx:109",d:"M18 2.0845 a 15.9155 15.9155 0 0 1 0 31.831 a 15.9155 15.9155 0 0 1 0 -31.831",fill:"none",stroke:"currentColor",strokeOpacity:"0.1",strokeWidth:"3"}),e.jsx("path",{"data-loc":"client/src/components/RestTimer.tsx:116",d:"M18 2.0845 a 15.9155 15.9155 0 0 1 0 31.831 a 15.9155 15.9155 0 0 1 0 -31.831",fill:"none",stroke:m?"#22c55e":"hsl(var(--primary))",strokeWidth:"3",strokeDasharray:`${T}, 100`,strokeLinecap:"round",className:"transition-all duration-1000"})]}),e.jsx("div",{"data-loc":"client/src/components/RestTimer.tsx:126",className:"absolute inset-0 flex items-center justify-center",children:e.jsxs("span",{"data-loc":"client/src/components/RestTimer.tsx:127",className:`text-sm font-bold tabular-nums ${m?"text-green-500":""}`,children:[r,":",v.toString().padStart(2,"0")]})})]}),e.jsxs("div",{"data-loc":"client/src/components/RestTimer.tsx:134",className:"flex-1",children:[e.jsxs("div",{"data-loc":"client/src/components/RestTimer.tsx:135",className:"flex items-center gap-1 mb-2",children:[e.jsx(Ae,{"data-loc":"client/src/components/RestTimer.tsx:136",className:"w-3.5 h-3.5 text-muted-foreground"}),e.jsx("span",{"data-loc":"client/src/components/RestTimer.tsx:137",className:"text-xs text-muted-foreground font-medium",children:m?"伿¯å®ç¢ï¼ðª":g?"伿¯ç·...":"çµé伿¯"})]}),e.jsxs("div",{"data-loc":"client/src/components/RestTimer.tsx:141",className:"flex items-center gap-2",children:[e.jsx(f,{"data-loc":"client/src/components/RestTimer.tsx:142",variant:m?"default":g?"secondary":"default",size:"sm",onClick:D,className:"h-8 px-3 gap-1",children:m?e.jsxs(e.Fragment,{children:[e.jsx(Ge,{"data-loc":"client/src/components/RestTimer.tsx:149",className:"w-3.5 h-3.5"})," åå"]}):g?e.jsxs(e.Fragment,{children:[e.jsx(wt,{"data-loc":"client/src/components/RestTimer.tsx:151",className:"w-3.5 h-3.5"})," æ«å"]}):e.jsxs(e.Fragment,{children:[e.jsx(Ve,{"data-loc":"client/src/components/RestTimer.tsx:153",className:"w-3.5 h-3.5"})," éå§"]})}),e.jsx(f,{"data-loc":"client/src/components/RestTimer.tsx:156",variant:"ghost",size:"sm",onClick:z,className:"h-8 w-8 p-0",children:e.jsx(Ge,{"data-loc":"client/src/components/RestTimer.tsx:157",className:"w-3.5 h-3.5"})}),e.jsxs("div",{"data-loc":"client/src/components/RestTimer.tsx:159",className:"flex items-center gap-0.5 ml-auto",children:[e.jsx(f,{"data-loc":"client/src/components/RestTimer.tsx:160",variant:"ghost",size:"sm",onClick:()=>M(-15),className:"h-7 w-7 p-0",children:e.jsx(ke,{"data-loc":"client/src/components/RestTimer.tsx:161",className:"w-3 h-3"})}),e.jsxs("span",{"data-loc":"client/src/components/RestTimer.tsx:163",className:"text-xs text-muted-foreground w-8 text-center",children:[u,"s"]}
21),e.jsx(f,{"data-loc":"client/src/components/RestTimer.tsx:164",variant:"ghost",size:"sm",onClick:()=>M(15),className:"h-7 w-7 p-0",children:e.jsx(ne,{"data-loc":"client/src/components/RestTimer.tsx:165",className:"w-3 h-3"})})]})]})]})]})})})}const Le=[{id:"light",label:"æç±³ç³ç®",url:"/manus-storage/light-mosaic-bg_ab234a62.jpg"},{id:"dark",label:"æ·±ç°ç³ç®",url:"/manus-storage/dark-mosaic-bg_7b8d2067.jpg"}],Te=[{id:"blue",label:"è",hex:"#3B82F6",r:59,g:130,b:246},{id:"purple",label:"ç´«",hex:"#8B5CF6",r:139,g:92,b:246},{id:"teal",label:"ç¶ ",hex:"#14B8A6",r:20,g:184,b:166},{id:"orange",label:"æ©",hex:"#F97316",r:249,g:115,b:22}];function Tt({data:n,trigger:l}){const[u,d]=a.useState(!1),[w,i]=a.useState(!1),[g,o]=a.useState("dark"),[m,b]=a.useState("purple"),[N,L]=a.useState("#7C3AED"),[D,z]=a.useState(.22),[M,T]=a.useState(18),[r,v]=a.useState(null),[k,x]=a.useState(!1),p=a.useRef(null),j=Le.find(s=>s.id===g)||Le[1],W=m==="custom"?{hex:N,...(s=>{const S=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(s);return S?{r:parseInt(S[1],16),g:parseInt(S[2],16),b:parseInt(S[3],16)}:{r:139,g:92,b:246}})(N)}:Te.find(s=>s.id===m)||Te[1],P=`rgba(${W.r}, ${W.g}, ${W.b}, ${D})`,q=Math.max(D,.92),X=`rgba(${W.r}, ${W.g}, ${W.b}, ${q})`,V=(W.r*299+W.g*587+W.b*114)/1e3>140&&D>.25,Z=V?"#1a1a1a":"#ffffff",le=V?"rgba(26,26,26,0.7)":"rgba(255,255,255,0.7)",ee=a.useCallback(async s=>{if(!s||s.startsWith("data:"))return s;try{const R=await(await fetch(s,{mode:"cors"})).blob(),A=new FileReader;return await new Promise(I=>{A.onloadend=()=>I(A.result),A.readAsDataURL(R)})}catch{try{const S=`/api/image-proxy?url=${encodeURIComponent(s)}`,A=await(await fetch(S)).blob(),I=new FileReader;return await new Promise(C=>{I.onloadend=()=>C(I.result),I.readAsDataURL(A)})}catch{return null}}},[]),pe=a.useCallback(async s=>{const S=s.querySelectorAll("img"),R=Array.from(S).map(async $=>{const E=await ee($.src);E&&($.src=E)}),A=s.querySelectorAll("*"),I=Array.from(A).map(async $=>{const E=$,me=E.style.backgroundImage;if(me&&me.startsWith("url(")){const B=me.match(/url\(['"]?([^'"\)]+)['"]?\)/);if(B&&B[1]&&!B[1].startsWith("data:")){const ge=await ee(B[1]);ge&&(E.style.backgroundImage=`url('${ge}')`)}}}),C=s.style.backgroundImage;if(C&&C.startsWith("url(")){const $=C.match(/url\(['"]?([^'"\)]+)['"]?\)/);if($&&$[1]&&!$[1].startsWith("data:")){const E=await ee($[1]);E&&(s.style.backgroundImage=`url('${E}')`)}}await Promise.all([...R,...I])},[ee]),O=/iPad|iPhone|iPod/.test(navigator.userAgent),ie=async()=>{if(p.current){i(!0),x(!0),await new Promise(s=>setTimeout(s,100));try{await pe(p.current);const S=(await Ie(p.current,{scale:3,backgroundColor:null,useCORS:!0,allowTaint:!0,logging:!1})).toDataURL("image/png");if(O)v(S),y.success("åçå·²çæï¼é·æåç â å²ååç ð");else{const R=document.createElement("a");R.download=`fitdiet-workout-${Date.now()}.png`,R.href=S,document.body.appendChild(R),R.click(),document.body.removeChild(R),y.success("åçå·²å²åå°ä¸è¼è³æå¤¾ â
")}}catch(s){console.error("Generate error:",s),y.error("çæåçæåæï¼è©¦å¤æ¬¡")}finally{i(!1),x(!1)}}},de=async()=>{if(p.current){i(!0),x(!0),await new Promise(s=>setTimeout(s,100));try{await pe(p.current);const s=await Ie(p.current,{scale:3,backgroundColor:null,useCORS:!0,allowTaint:!0,logging:!1});s.toBlob(async S=>{if(!S){y.error("çæåå°"),i(!1),x(!1);return}if(navigator.share&&navigator.canShare)try{const I={files:[new File([S],"fitdiet-workout.png",{type:"image/png"})]};if(navigator.canShare(I)){await navigator.share(I),y.success("å享æåï¼"),i(!1),x(!1);return}}catch{}const R=s.toDataURL("image/png");v(R),y.success("åçå·²çæï¼é·æåçå¯ä»¥å²å ð"),i(!1),x(!1)},"image/png")}catch(s){console.error("Share error:",s),y.error("çæåçæåæï¼è©¦å¤æ¬¡"),i(!1),x(!1)}}};return e.jsxs(e.Fragment,{children:[l?e.jsx("div",{"data-loc":"client/src/components/WorkoutStoryCard.tsx:228",onClick:()=>d(!0),children:l}):e.jsxs(f,{"data-loc":"client/src/components/WorkoutStoryCard.tsx:230",variant:"outline",size:"sm",onClick:()=>d(!0),className:"gap-1.5",children:[e.jsx(Me,{"data-loc":"client/src/components/WorkoutStoryCard.tsx:236",className:"w-4 h-4"}),"å享è¨ç·´ Story"]}),e.jsx(Re,{"data-loc":"client/src/components/WorkoutStoryCard.tsx:241",open:u,onOpenChange:d,children:e.jsxs($e,{"data-loc":"client/src/components/WorkoutStoryCard.tsx:242",className:"!fixed !inset-0 !top-0 !left-0 !translate-x-0 !translate-y-0 !max-w-none !w-full !h-full !rou
21nded-none p-0 bg-black/95 border-none shadow-none [&>button]:hidden flex flex-col",children:[e.jsx(Ue,{"data-loc":"client/src/components/WorkoutStoryCard.tsx:243",className:"sr-only",children:"å享è¨ç·´ Story"}),e.jsxs("div",{"data-loc":"client/src/components/WorkoutStoryCard.tsx:245",className:"flex-1 overflow-y-auto flex flex-col items-center px-3 pb-4 gap-3",children:[e.jsxs("div",{"data-loc":"client/src/components/WorkoutStoryCard.tsx:248",className:"relative w-full flex justify-center",style:{flexShrink:0},children:[e.jsxs("button",{"data-loc":"client/src/components/WorkoutStoryCard.tsx:250",onClick:()=>d(!1),className:"absolute top-3 left-3 z-50 flex items-center gap-1 px-3 py-1.5 rounded-full bg-black/40 backdrop-blur-sm text-white text-sm font-medium hover:bg-black/60 transition-colors",style:{WebkitBackdropFilter:"blur(8px)"},children:[e.jsx("svg",{"data-loc":"client/src/components/WorkoutStoryCard.tsx:255",className:"w-4 h-4",fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24",children:e.jsx("path",{"data-loc":"client/src/components/WorkoutStoryCard.tsx:255",strokeLinecap:"round",strokeLinejoin:"round",d:"M15 19l-7-7 7-7"})}),"è¿å"]}),e.jsxs("div",{"data-loc":"client/src/components/WorkoutStoryCard.tsx:258",ref:p,className:"rounded-[22px] overflow-hidden relative",style:{boxShadow:"0 10px 30px rgba(0,0,0,0.45)",width:"100%",maxWidth:"380px",aspectRatio:"9/16"},children:[e.jsx("img",{"data-loc":"client/src/components/WorkoutStoryCard.tsx:263",src:j.url,alt:"",crossOrigin:"anonymous",className:"absolute inset-0 w-full h-full object-cover",style:{imageRendering:k?"auto":"pixelated"}}),n.photoUrl&&e.jsx("img",{"data-loc":"client/src/components/WorkoutStoryCard.tsx:271",src:n.photoUrl,alt:"",crossOrigin:"anonymous",className:"absolute inset-0 w-full h-full object-cover",style:{opacity:.35}}),e.jsx("div",{"data-loc":"client/src/components/WorkoutStoryCard.tsx:279",className:"absolute",style:{top:0,left:0,right:0,bottom:0,background:k?X:P,borderRadius:"22px",padding:"20px",backdropFilter:k?"none":`blur(${M}px)`,WebkitBackdropFilter:k?"none":`blur(${M}px)`,boxShadow:k?"inset 0 0 0 1px rgba(255,255,255,0.12)":"none",color:Z},children:e.jsx(_t,{"data-loc":"client/src/components/WorkoutStoryCard.tsx:295",data:n,textColor:Z,textColorMuted:le,glassHex:W.hex})})]})]}),e.jsxs("div",{"data-loc":"client/src/components/WorkoutStoryCard.tsx:306",className:"flex items-center justify-center gap-2 w-full flex-wrap",children:[e.jsx("span",{"data-loc":"client/src/components/WorkoutStoryCard.tsx:307",className:"text-xs text-white/60",children:"ç³ç®"}),Le.map(s=>e.jsx("button",{"data-loc":"client/src/components/WorkoutStoryCard.tsx:309",onClick:()=>
21o(s.id),className:`w-[40px] h-[40px] rounded-lg border-2 transition-all overflow-hidden ${g===s.id?"border-blue-400 scale-110":"border-[#2A2A30] hover:border-white/40"}`,title:s.label,children:e.jsx("img",{"data-loc":"client/src/components/WorkoutStoryCard.tsx:315",src:s.url,alt:s.label,className:"w-full h-full object-cover",style:{imageRendering:"pixelated"}})},s.id)),e.jsx("span",{"data-loc":"client/src/components/WorkoutStoryCard.tsx:318",className:"text-xs text-white/60 ml-2",children:"Glass"}),Te.map(s=>e.jsx("button",{"data-loc":"client/src/components/WorkoutStoryCard.tsx:320",onClick:()=>b(s.id),className:`w-[28px] h-[28px] rounded-full border-2 transition-all ${m===s.id?"border-white scale-110":"border-white/20 hover:border-white/40"}`,style:{backgroundColor:s.hex},title:s.label},s.id)),e.jsxs("div",{"data-loc":"client/src/components/WorkoutStoryCard.tsx:328",className:"relative",children:[e.jsx("button",{"data-loc":"client/src/components/WorkoutStoryCard.tsx:329",onClick:()=>b("custom"),className:`w-[28px] h-[28px] rounded-full border-2 transition-all flex items-center justify-center overflow-hidden ${m==="custom"?"border-white scale-110":"border-white/20 hover:border-white/40"}`,style:{background:m==="custom"?N:"conic-gradient(from 0deg, #f00, #ff0, #0f0, #0ff, #00f, #f0f, #f00)"},title:"èªè¨é¡è²",children:m!=="custom"&&e.jsx("span",{"data-loc":"client/src/components/WorkoutStoryCard.tsx:336",className:"text-[9px] font-bold text-white drop-shadow-[0_1px_2px_rgba(0,0,0,0.8)]",children:"+"})}),e.jsx("input",{"data-loc":"client/src/components/WorkoutStoryCard.tsx:339",type:"color",value:N,onChange:s=>{L(s.target.value),b("custom")},className:"absolute inset-0 w-full h-full opacity-0 cursor-pointer",title:"èªè¨é¡è²"})]})]}),e.jsxs("div",{"data-loc":"client/src/components/WorkoutStoryCard.tsx:350",className:"flex items-center gap-2 w-full px-1",children:[e.jsx("span",{"data-loc":"client/src/components/WorkoutStoryCard.tsx:351",className:"text-[10px] text-white/60 whitespace-nowrap",children:"éæ"}),e.jsx("input",{"data-loc":"client/src/components/WorkoutStoryCard.tsx:352",type:"range",min:"0.05",max:"0.60",step:"0.01",value:D,onChange:s=>z(parseFloat(s.target.value)),className:"flex-1 h-1.5 rounded-full appearance-none cursor-pointer [&::-webkit-slider-thumb]:appearance-none [&::-webkit-slider-thumb]:w-3 [&::-webkit-slider-thumb]:h-3 [&::-webkit-slider-thumb]:rounded-full [&::-webkit-slider-thumb]:bg-white [&::-webkit-slider-thumb]:shadow-md",style:{background:"linear-gradient(to right, rgba(255,255,255,0.1), rgba(255,255,255,0.6))"}}),e.jsx("span",{"data-loc":"client/src/components/WorkoutStoryCard.tsx:358",className:"text-[10px] text-white/60 whitespace-nowrap",children:"æ¸
æ°"}),e.jsx("input",{"data-loc":"client/src/components/WorkoutStoryCard.tsx:359",type:"range",min:"0",max:"20",step:"1",value:M,onChange:s=>T(parseInt(s.target.value)),className:"flex-1 h-1.5 rounded-full appearance-none cursor-pointer [&::-webkit-slider-thumb]:appearance-none [&::-webkit-slider-thumb]:w-3 [&::-webkit-slider-thumb]:h-3 [&::-webkit-slider-thumb]:rounded-full [&::-webkit-slider-thumb]:bg-white [&::-webkit-slider-thumb]:shadow-md",style:{background:"linear-gradient(to right, rgba(255,255,255,0.1), rgba(255,255,255,0.6))"}})]}),e.jsxs("div",{"data-loc":"client/src/components/WorkoutStoryCard.tsx:368",className:"flex items-center gap-3 w-full",children:[e.jsxs(f,{"data-loc":"client/src/components/WorkoutStoryCard.tsx:369",onClick:ie,disabled:w,className:"flex-1 bg-[#3B82F6] hover:bg-[#2563EB] text-white rounded-full py-3 font-semibold",children:[e.jsx(yt,{"data-loc":"client/src/components/WorkoutStoryCard.tsx:374",className:"w-4 h-4 mr-2"}),w?"çæä¸...":"å²ååç"]}),e.jsxs(f,{"data-loc":"client/src/components/WorkoutStoryCard.tsx:377",onClick:de,disabled:w,className:"flex-1 bg-[#E1306C] hover:bg-[#C13584] text-white rounded-full py-3 font-semibold",children:[e.jsx(Me,{"data-loc":"client/src/components/WorkoutStoryCard.tsx:382",className:"w-4 h-4 mr-2"}),"åäº«å» IG"]})]})]}),r&&e.jsxs("div",{"data-loc":"client/src/components/WorkoutStoryCard.tsx:393",className:"absolute inset-0 flex flex-col items-center justify-center bg-black/95 rounded-2xl z-50 p-4",children:[e.jsx("p",{"data-loc":"client/src/components/WorkoutStoryCard.tsx:394",className:"text-white/80 text-sm mb-3 text-center",children:O?"é·æåç â å²ååç / å å°ç¸ç°¿":"é·æåçå²åï¼ææãä¸è¼ãæé"}),e.jsx("img",{"data-loc":"client/src/components/WorkoutStoryCard.tsx:395",src:r,alt:"Generated Workout Story",className:"max-w-full max-h-[500px] rounded-xl",style:{WebkitTouchCallout:"default"}}),e.jsxs("div",{"data-loc":"client/src/components/WorkoutStoryCard.tsx:401",className:"flex flex-wrap justify-center gap-2 mt-3",children:[!O&&e.jsx(f,{"data-loc":"client/src/components/WorkoutStoryCard.tsx:403",size:"sm",onClick:()=>{const s=document.createElement("a");s.download=`fitdiet-workout-${Date.now()}.png`,s.href=r,document.body.appendChild(s),s.click(),document.body.removeChild(s),y.success("åçå·²å²å â
")},className:"bg-gradient-to-r from-green-500 to-emerald-500 text-white",children:"ä¸è¼åç"}),e.jsxs(f,{"data-loc":"client/src/components/WorkoutStoryCard.tsx:419",size:"sm",onClick:async()=>{try{if(navigator.share&&r){const S=await(await fetch(r)).blob(),R=new File([S],"fitdiet-workout.png",{type:"image/png"});await navigator.share({title:"FitDiet AI è¨ç·´æå¡",text:"仿¥è¨ç·´æå¡ ðª #FitDietAI",files:[R]})}}catch(s){s.name!=="AbortError"&&y.info("é·æ³å¼µç¸å°±å¯ä»¥å²å")}},className:"bg-[#25D366] hover:bg-[#20bd5a] text-white",children:[e.jsx("svg",{"data-loc":"client/src/components/WorkoutStoryCard.tsx:441",className:"w-4 h-4 mr-1",viewBox:"0 0 24 24",fill:"
21currentColor",children:e.jsx("path",{"data-loc":"client/src/components/WorkoutStoryCard.tsx:441",d:"M17.472 14.382c-.297-.149-1.758-.867-2.03-.967-.273-.099-.471-.148-.67.15-.197.297-.767.966-.94 1.164-.173.199-.347.223-.644.075-.297-.15-1.255-.463-2.39-1.475-.883-.788-1.48-1.761-1.653-2.059-.173-.297-.018-.458.13-.606.134-.133.298-.347.446-.52.149-.174.198-.298.298-.497.099-.198.05-.371-.025-.52-.075-.149-.669-1.612-.916-2.207-.242-.579-.487-.5-.669-.51-.173-.008-.371-.01-.57-.01-.198 0-.52.074-.792.372-.272.297-1.04 1.016-1.04 2.479 0 1.462 1.065 2.875 1.213 3.074.149.198 2.096 3.2 5.077 4.487.709.306 1.262.489 1.694.625.712.227 1.36.195 1.871.118.571-.085 1.758-.719 2.006-1.413.248-.694.248-1.289.173-1.413-.074-.124-.272-.198-.57-.347"})}),"WhatsApp"]}),e.jsx(f,{"data-loc":"client/src/components/WorkoutStoryCard.tsx:444",variant:"outline",size:"sm",onClick:()=>v(null),className:"bg-white/10 border-white/20 text-white hover:bg-white/20",children:"è¿å»æ¹"})]})]})]})})]})}function _t({data:n,textColor:l,textColorMuted:u,glassHex:d}){const w=n.intensity==="low"?"ä½å¼·åº¦":n.intensity==="high"?"é«å¼·åº¦":"ä¸å¼·åº¦";return e.jsxs("div",{"data-loc":"client/src/components/WorkoutStoryCard.tsx:476",className:"flex flex-col h-full",children:[e.jsxs("div",{"data-loc":"client/src/components/WorkoutStoryCard.tsx:478",style:{marginBottom:"8px"},children:[e.jsx("p",{"data-loc":"client/src/components/WorkoutStoryCard.tsx:479",style:{fontSize:"13px",fontWeight:600,color:u},children:n.date}),e.jsx("p",{"data-loc":"client/src/components/WorkoutStoryCard.tsx:480",style:{fontSize:"18px",fontWeight:700,letterSpacing:"0.5px",color:l,marginTop:"1px"},children:"è¨ç·´æå¡ ðª"})]}),e.jsxs("div",{"data-loc":"client/src/components/WorkoutStoryCard.tsx:484",style:{display:"flex",alignItems:"center",gap:"8px",padding:"8px 12px",borderRadius:"12px",background:l==="#1a1a1a"?"rgba(0,0,0,0.06)":"rgba(255,255,255,0.08)",marginBottom:"10px"},children:[e.jsx("span",{"data-loc":"client/src/components/WorkoutStoryCard.tsx:493",style:{fontSize:"24px"},children:n.workoutIcon}),e.jsxs("div",{"data-loc":"client/src/components/WorkoutStoryCard.tsx:494",children:[e.jsx("p",{"data-loc":"client/src/components/WorkoutStoryCard.tsx:495",style:{fontSize:"14px",fontWeight:700,color:l},children:n.workoutType}),e.jsxs("p",{"data-loc":"client/src/components/WorkoutStoryCard.tsx:496",style:{fontSize:"11px",color:u},children:[n.duration?`${n.duration} åé`:"",n.duration&&n.intensity?" · ":"",n.intensity?w:""]})]})]}),e.jsxs("div",{"data-loc":"client/src/components/WorkoutStoryCard.tsx:503",style:{width:"100px",height:"100px",margin:"4px auto 10px",position:"relative"},children:[e.jsxs("svg",{"data-loc":"client/src/components/WorkoutStoryCard.tsx:504",width:"100",height:"100",style:{transform:"rotate(-90deg)"},children:[e.jsx("circle",{"data-loc":"client/src/components/WorkoutStoryCard.tsx:505",cx:"50",cy:"50",r:"42",fill:"none",stroke:`${d}44`,strokeWidth:"10"}),e.jsx("circle",{"data-loc":"client/src/components/WorkoutStoryCard.tsx:506",cx:"50",cy:"50",r:"42",fill:"none",stroke:d,strokeWidth:"10",strokeDasharray:(2*Math.PI*42).toFixed(2),strokeDashoffset:"0",strokeLinecap:"round"})]}),e.jsxs("div",{"data-loc":"client/src/components/WorkoutStoryCard.tsx:514",style:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",color:l},children:[e.jsx("div",{"data-loc":"client/src/components/WorkoutStoryCard.tsx:525",style:{fontSize:"22px",fontWeight:700,lineHeight:1},children:n.caloriesBurned}),e.jsx("div",{"data-loc":"client/src/components/WorkoutStoryCard.tsx:526",style:{fontSize:"10px",color:u},children:"kcal æ¶è"})]})]}),n.exercises.length>0&&e.jsxs("div",{"data-loc":"client/src/components/WorkoutStoryCard.tsx:532",style:{flex:1,overflow:"hidden",marginBottom:"8px"},children:[e.jsx("p",{"data-loc":"client/src/components/WorkoutStoryCard.tsx:533",style:{fontSize:"11px",color:u,marginBottom:"4px"},children:"åä½å表"}),e.jsxs("div",{"data-loc":"client/src/components/WorkoutStoryCard.tsx:534",style:{display:"flex",flexDirection:"column",gap:"3px"},children:[n.exercises.slice(0,6).map((i,g)=>e.jsxs("div",{"data-loc":"client/src/components/WorkoutStoryCard.tsx:536",style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"5px 10px",borderRadius:"8px",background:l==="#1a1a1a"?"rgba(0,0,0,0.05)":"rgba(255,255,255,0.06)",fontSize:"12px"},children:[e.jsx("span",{"data-loc":"client/src/components/WorkoutStoryCard.tsx:548",style:{color:l,fontWeight:500},children:i.name.replace(/^\[.*?\]\s*/,"")}),i.sets&&i.reps?e.jsxs("span",{"data-loc":"client/src/components/WorkoutStoryCard.tsx:552",style:{color:u,fontSize:"11px"},children:[i.sets,"Ã",i.reps,i.weight?` @${i.weight}kg`:""]}):null]},g)),n.exercises.length>6&&e.jsxs("p",{"data-loc":"client/src/components/WorkoutStoryCard.tsx:559",style:{fontSize:"10px",color:u,textAlign:"center",marginTop:"2px"},children:["+",n.exercises.length-6," ååä½"]})]})]}),n.photoUrl&&e.jsx("div",{"data-loc":"client/src/components/WorkoutStoryCard.tsx:569",style:{marginBottom:"8px",display:"flex",justifyContent:"center"},children:e.jsx("img",{"data-loc":"client/src/components/WorkoutStoryCard.tsx:570",src:n.photoUrl,alt:"Workout",crossOrigin:"anonymous",style:{width:"60px",height:"60px",borderRadius:"10px",objectFit:"cover",boxShadow:"0 4px 12px rgba(0,0,0,0.3)"}})}),e.jsxs("div",{"data-loc":"client/src/components/WorkoutStoryCard.tsx:586",style:{display:"flex",alignItems:"center",justifyContent:"center",gap:"6px",marginTop:"auto"},children:[e.jsx("div",{"data-loc":"client/src/components/WorkoutStoryCard.tsx:587",style:{width:"18px",height:"18px",background:"#7C3AED",borderRadius:"50%",display:"flex",alignItems:"center",justifyContent:"center",fontSize:"9px",fontWeight:700,color:"white"},children:"FD"}),e.jsxs("div",{"data-loc":"client/src/components/WorkoutStoryCard.tsx:599",children:[e.jsx("div",{"data-loc":"client/src/components/WorkoutStoryCard.tsx:600",style:{fontSize:"12px",fontWeight:700,color:l},children:"FitDiet AI"}),e.jsx("div",{"data-loc":"client/src/components/WorkoutStoryCard.tsx:601",style:{fontSize:"9px",color:u,marginTop:"-1px"},children:"æºè½å¥èº«é£²é£å©æ"})]})]})]})}const Pt=[{group:"è¸",icon:"ðª",exercises:[{id:"bench_press",
21name:"æ§é´è¥æ¨ Bench Press",muscleGroup:"chest"},{id:"incline_bench",name:"ä¸æè¥æ¨ Incline Bench Press",muscleGroup:"chest"},{id:"decline_bench",name:"ä¸æè¥æ¨ Decline Bench Press",muscleGroup:"chest"},{id:"dumbbell_fly",name:"åé´é£é³¥ Dumbbell Fly",muscleGroup:"chest"},{id:"cable_crossover",name:"ç¹©ç´¢å¤¾è¸ Cable Crossover",muscleGroup:"chest"},{id:"push_up",name:"æä¸å£ Push Up",muscleGroup:"chest"},{id:"chest_dip",name:"éæ§æé« Dip",muscleGroup:"chest"}]},{group:"è",icon:"ð",exercises:[{id:"deadlift",name:"硬æ Deadlift",muscleGroup:"back"},{id:"pull_up",name:"å¼é«åä¸ Pull Up",muscleGroup:"back"},{id:"lat_pulldown",name:"æ»è¼ªä¸æ Lat Pulldown",muscleGroup:"back"},{id:"barbell_row",name:"æ§é´åè¹ Barbell Row",muscleGroup:"back"},{id:"dumbbell_row",name:"åé´åè¹ Dumbbell Row",muscleGroup:"back"},{id:"seated_row",name:"åå§¿åè¹ Seated Row",muscleGroup:"back"},{id:"tbar_row",name:"Tæ§åè¹ T-Bar Row",muscleGroup:"back"}]},{group:"è
¿",icon:"ð¦µ",exercises:[{id:"squat",name:"æ§é´æ·±è¹² Barbell Squat",muscleGroup:"legs"},{id:"leg_press",name:"è
¿æ¨ Leg Press",muscleGroup:"legs"},{id:"lunge",name:"弿¥ Lunge",muscleGroup:"legs"},{id:"bulgarian_split_squat",name:"ä¿å å©äºåè
¿è¹² Bulgarian Split Squat",muscleGroup:"legs"},{id:"leg_extension",name:"è
¿ä¼¸å± Leg Extension",muscleGroup:"legs"},{id:"leg_curl",name:"è
¿å½è Leg Curl",muscleGroup:"legs"},{id:"calf_raise",name:"å°è
¿æè¸µ Calf Raise",muscleGroup:"legs"},{id:"hip_thrust",name:"èæ¨ Hip Thrust",muscleGroup:"legs"},{id:"romanian_deadlift",name:"ç¾
馬尼äºç¡¬è Romanian Deadlift",muscleGroup:"legs"},{id:"goblet_squat",name:"é«è
³æ¯æ·±è¹² Goblet Squat",muscleGroup:"legs"}]},{group:"è©è",icon:"ðï¸",exercises:[{id:"overhead_press",name:"åé´
21è©æ¨ Dumbbell Shoulder Press",muscleGroup:"shoulders"},{id:"lateral_raise",name:"å´å¹³è Lateral Raise",muscleGroup:"shoulders"},{id:"front_raise",name:"åå¹³è Front Raise",muscleGroup:"shoulders"},{id:"rear_delt_fly",name:"ååé£é³¥ Reverse Fly",muscleGroup:"shoulders"},{id:"face_pull",name:"颿 Face Pull",muscleGroup:"shoulders"},{id:"shrug",name:"è³è© Shrug",muscleGroup:"shoulders"},{id:"arnold_press",name:"é¿è«¾å¾·æ¨è Arnold Press",muscleGroup:"shoulders"}]},{group:"äºé è",icon:"ðª",exercises:[{id:"bicep_curl",name:"æ§é´å½è Barbell Curl",muscleGroup:"biceps"},{id:"hammer_curl",name:"éå¼å½è Hammer Curl",muscleGroup:"biceps"},{id:"preacher_curl",name:"ç§å¸«æ¤
å½è Preacher Curl",muscleGroup:"biceps"},{id:"concentration_curl",name:"éä¸å½è Concentration Curl",muscleGroup:"biceps"},{id:"cable_curl",name:"繩索å½è Cable Curl",muscleGroup:"biceps"}]},{group:"ä¸é è",icon:"ðª",exercises:[{id:"tricep_pushdown",name:"ä¸é ä¸å£ Tricep Pushdown",muscleGroup:"triceps"},{id:"skull_crusher",name:"ä»°è¥èå±ä¼¸ Skull Crusher",muscleGroup:"triceps"},{id:"overhead_extension",name:"éé ä¸é ä¼¸å± Overhead Extension",muscleGroup:"triceps"},{id:"tricep_dip",name:"ä¸é èæé« Tricep Dip",muscleGroup:"triceps"},{id:"close_grip_bench",name:"çªæ¡è¥æ¨ Close Grip Bench Press",muscleGroup:"triceps"},{id:"tricep_kickback",name:"ä¸é å¾è¸¢ Tricep Kickback",muscleGroup:"triceps"}]},{group:"è
¹è",icon:"ð¯",exercises:[{id:"plank",name:"å¹³æ¿æ¯æ Plank",muscleGroup:"abs"},{id:"crunch",name:"æ²è
¹ Crunch",muscleGroup:"abs"},{id:"leg_raise",name:"æ¸åèè
¿ Hanging Leg Raise",muscleGroup:"abs"},{id:"russian_twist",name:"ä¿ç¾
æ¯è½é« Russian Twist",muscleGroup:"abs"},{id:"ab_wheel",name:"å¥è
¹è¼ª Ab Wheel",muscleGroup:"abs"},{id:"cable_woodchop",name:"ç¹©ç´¢ç æ¨ Cable Woodchop",muscleGroup:"abs"},{id:"mountain_climber",name:"ç»å±±è
Mountain Climber",muscleGroup:"abs"},{id:"bicycle_crunch",name:"å®è»æ²è
¹ Bicycle Crunch",muscleGroup:"abs"},{id:"dead_bug",name:"æ»è² Dead Bug",muscleGroup:"abs"}]},{group:"Hyrox / åè½æ§è¨ç·´",icon:"ð
",exercises:[{id:"sled_push",name:"éªæ©æ¨ Sled Push",muscleGroup:"full_body"},{id:"sled_pull",name:"éªæ©æ Sled Pull",muscleGroup:"full_body"},{id:"farmers_carry",name:"農夫è¡èµ° Farmer's Carry",muscleGroup:"full_body"},{id:"wall_ball",name:"çç Wall Ball",muscleGroup:"full_body"},{id:"burpee_broad_jump",name:"æ³¢æ¯è·³é Burpee Broad Jump",muscleGroup:"full_body"},{id:"rowing_machine",name:"åè¹æ© Rowing Machine",muscleGroup:"full_body"},{id:"ski_erg",name:"æ»éªæ© SkiErg",muscleGroup:"full_body"},{id:"battle_rope",name:"æ°ç¹© Battle Rope",muscleGroup:"full_body"},{id:"kettlebell_swing",name:"å£ºé´æºçª Kettlebell Swing",muscleGroup:"full_body"},{id:"box_jump",name:"跳箱 Box Jump",muscleGroup:"full_body"}]}],_e=[{id:"weight_training",name:"ééè¨ç·´",category:"strength",caloriesPerMin:6,icon:"ðï¸"},{id:"bodyweight",name:"èªéè¨ç·´",category:"strength",caloriesPerMin:5,icon:"ðª"},{id:"resistance_band",name:"å½å帶",category:"strength",caloriesPerMin:4,icon:"ð"},{id:"hiit",name:"HIIT é«å¼·åº¦éæ",category:"hiit",caloriesPerMin:12,icon:"â¡"},{id:"tabata",name:"Tabata",category:"hiit",caloriesPerMin:14,icon:"ð¥"},{id:"crossfit",name:"CrossFit",category:"hiit",caloriesPerMin:13,icon:"ð"},{id:"running",name:"è·æ¥",category:"cardio",caloriesPerMin:10,icon:"ð"},{id:"cycling",name:"踩å®è»",category:"cardio",caloriesPerMin:8,icon:"ð´"},{id:"swimming",name:"游水",category:"cardio",caloriesPerMin:9,icon:"ð"},{id:"hiking",name:"è¡å±±",category:"cardio",caloriesPerMin:7,icon:"ð¥¾"},{id:"walking",name:"æ¥è¡/æ£æ¥",category:"cardio",caloriesPerMin:4,icon:"ð¶"},{id:"zone2_walk",name:"æ
¢æ¥ Zone 2 å¿çè¨ç·´",category:"cardio",caloriesPerMin:5,icon:"ð"},{id:"jump_rope",name:"跳繩",category:"cardio",caloriesPerMin:11,icon:"ðª¢"},{id:"stair_climbing",name:"è¡æ¨æ¢¯",category:"cardio",caloriesPerMin:9,icon:"ðª"},{id:"incline_walk",name:"è¡æè·¯ / æè·¯æ©",category:"cardio",caloriesPerMin:7,icon:"â°ï¸"},{id:"stair_machine",name:"æ¨æ¢¯æ©",category:"cardio",caloriesPerMin:10,icon:"ðï¸"},{id:"hyrox",name:"Hyrox è¨ç·´",category:"hiit",caloriesPerMin:12,icon:"ð
"},{id:"yoga",name:"çä¼½",category:"flexibility",caloriesPerMin:4,icon:"ð§"},{id:"pilates",name:"æ®ææ",category:"flexibility",caloriesPerMin:5,icon:"ð¤¸"},{id:"stretching",name:"伸å±/æç",category:"flexibility",caloriesPerMin:3,icon:"ð"},{id:"basketball",name:"ç±ç",category:"sports",caloriesPerMin:8,icon:"ð"},{id:"badminton",name:"ç¾½æ¯ç",category:"sports",caloriesPerMin:7,icon:"ð¸"},{id:"tennis",name:"ç¶²ç",category:"sports",caloriesPerMin:8,icon:"ð¾"},{id:"football",name:"è¶³ç",category:"sports",caloriesPerMin:9,icon:"â½"},{id:"boxing",name:"æ³æ",category:"sports",caloriesPerMin:10,icon:"ð¥"},{id:"dance",name:"è·³è",category:"sports",caloriesPerMin:6,icon:"ð"},{id:"sex_light",name:"æ§æï¼è¼é¬ç¯å¥ï¼",category:"intimate",caloriesPerMin:4,icon:"ð¥"},{id:"sex_moderate",name:"æ§æï¼ä¸ç強度ï¼",category:"intimate",caloriesPerMin:6,icon:"ð¦"},{id:"sex_intense",name:"æ§æï¼é«å¼·åº¦ï¼",category:"intimate",caloriesPerMin:9,icon:"ð¥µ"},{id:"rest_day",name:"伿¯æ¥ï¼ååéåï¼",category:"rest",caloriesPerMin:0,icon:"ð¤"},{id:"rest_sick",name:"伿¯æ¥ï¼ç
åï¼",category:"rest",caloriesPerMin:0,icon:"ð©º"},{id:"rest_recovery",name:"伿¯æ¥ï¼æ¢å¾©æ¥ï¼",category:"rest",caloriesPerMin:0,icon:"ð"}],fe={strength:{name:"éè¨",icon:e.jsx(He,{"data-loc":"client/src/pages/WorkoutLog.tsx:184",className:"w-4 h-4"}),color:"text-purple-500"},hiit:{name:"HIIT",icon:e.jsx(gt,{"data-loc":"client/src/pages/WorkoutLog.tsx:185",className:"w-4 h-4"}),color:"text-orange-500"},cardio:{name:"ææ°§",icon:e.jsx(pt,{"data-loc":"client/src/pages/WorkoutLog.tsx:186",className:"w-4 h-4"}),color:"text-red-500"},flexibility:{name:"æé",icon:e.jsx("span",{"data-loc":"client/src/pages/WorkoutLog.tsx:187",className:"text-sm",children:"ð§"}),color:"text-green-500"},sports:{name:"çé¡éå",icon:e.jsx("span",{"data-loc":"client/src/pages/WorkoutLog.tsx:188",className:"text-sm",children:"ð"}),color:"text-blue-500"},intimate:{name:"18+ 親å¯éå",icon:e.jsx("span",{"data-loc":"client/src/pages/WorkoutLog.tsx:189",className:"text-sm",children:"ð¥"}),color:"text-pink-500"},rest:{name:"伿¯æ¥",icon:e.jsx("span",{"data-loc":"client/src/pages/WorkoutLog.tsx:190",className:"text-sm",children:"ð¤"}),color:"text-muted-foreground"}};function Vt(){it();const n=dt(),l=re.useUtils(),u=n.toISOString().slice(0,10),[d,w]=a.useState(null),[i,g]=a.useState(""),[o,m]=a.useState(""),[b,N]=a.useState("medium"),[L,D]=a.use
21State(""),[z,M]=a.useState(""),[T,r]=a.useState(""),[v,k]=a.useState(""),[x,p]=a.useState(""),[j,_]=a.useState(""),[W,P]=a.useState(null),[q,X]=a.useState(null),[xe,V]=a.useState(!1),Z=a.useRef(null),[le,ee]=a.useState(!1),pe=a.useCallback(()=>ee(!1),[]),[O,ie]=a.useState([]),[de,s]=a.useState(0),[S,R]=a.useState(!1),[A,I]=a.useState(null),C=_e.find(t=>t.id===i),$=C?.category==="strength",E=t=>{ie(t),s(0),t.length>0&&(g("weight_training"),D(t[0].name),r(t[0].sets.toString()),k(t[0].reps.toString()),p(t[0].weight.toString()))},me=()=>{const t=de+1;if(t<O.length){s(t);const c=O[t];g("weight_training"),D(c.name),r(c.sets.toString()),k(c.reps.toString()),p(c.weight.toString())}else ie([]),s(0)},B=(()=>{if(!C)return 0;const t=b==="low"?.7:b==="high"?1.3:1;if(o){const c=parseInt(o);return Math.round(C.caloriesPerMin*c*t)}if($&&T&&v){const c=parseInt(T),U=parseInt(v),te=(c*U*3+c*60)/60;return Math.round(C.caloriesPerMin*te*t)}return 0})(),[ge,Ye]=a.useState(()=>{const t=new Date;return{year:t.getFullYear(),month:t.getMonth()+1}}),[Ke,je]=a.useState(void 0),Je=d||n,{data:h,refetch:we}=re.workouts.getByDate.useQuery({date:Je}),Y=d!==null&&d.toDateString()!==n.toDateString(),ue=d?`${d.getFullYear()}å¹´${d.getMonth()+1}æ${d.getDate()}æ¥`:"仿¥",Be=(d||new Date).toLocaleDateString("zh-TW",{year:"numeric",month:"long",day:"numeric",weekday:"short"}),{data:K}=re.workouts.getMonthSummary.useQuery(ge),Qe=a.useMemo(()=>{if(!K)return{};const t={};for(const c of K)t[c.date]={status:"trained",hasWorkout:!0,label:`${c.workoutCount}次`};return t},[K]),Xe=a.useMemo(()=>{if(K)return{onTargetDays:K.length,totalRecordedDays:K.length,totalWorkouts:K.reduce((t,c)=>t+c.workoutCount,0)}},[K]),Ze=t=>{const c=t.target.files?.[0];if(!c)return;if(c.size>10*1024*1024){y.error("ç¸çå¤ªå¤§ï¼æå¤ 10MB");return}X(c);const U=new FileReader;U.onloadend=()=>P(U.result),U.readAsDataURL(c)},et=async()=>{if(!q)return null;V(!0);try{const t=new FileReader,c=await new Promise(H=>{t.onloadend=()=>{const be=t.result;H(be.split(",")[1])},t.readAsDataURL(q)}),U=await fetch("/api/upload-workout-photo",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({imageBase64:c,mimeType:q.type})});if(!U.ok)throw new Error("Upload failed");const{url:te}=await U.json();return te}catch(t){return console.error("Photo upload error:",t),y.error("ä¸å³ç¸ç失æ"),null}finally{V(!1)}},he=re.workouts.add.useMutation({onSuccess:()=>{ee(!0),y.success("è¨ç·´è¨éå·²è¨ä½ï¼ç¹¼çºåªå ðª"),O.length>0?me():(g(""),m(""),D(""),M(""),r(""),k(""),p(""),_("")),P(null),X(null),we(),l.workouts.getByDate.invalidate({date:n}),l.meals.getByDate.invalidate({date:n}),l.hydration.getByDate.invalidate({date:n}),l.sleep.getByDate.invalidate({date:n}),l.supplements.getDailyChecklist.invalidate({date:u})},onError:()=>y.error("è¨éåä¸å°ï¼è©¦å¤æ¬¡")}),tt=re.workouts.delete.useMutation({onSuccess:()=>{y.success("è¨éå·²å·å"),we(),l.workouts.getByDate.invalidate({date:n}),l.meals.getByDate.invalidate({date:n}),l.hydration.getByDate.invalidate({date:n}),l.sleep.getByDate.invalidate({date:n}),l.supplements.getDailyChecklist.invalidate({date:u})},onError:()=>y.error("å·åå°")}),oe=re.workouts.copyToToday.useMutation({onSuccess:t=>{y.success(`å·²è¤è£½ ${t.copiedCount} æ¢è¨éå°ä»æ¥ ðª`),w(null),je(void 0),we()},onError:t=>y.error(t.message||"è¤è£½å¤±æ")}),st=async t=>{if(t.preventDefault(),!i){y.error("æè¿è¨ç·´é¡åå
");return}let c;if(q){const H=await et();H&&(c=H)}const U=Y&&d?d:void 0;if(C?.category==="rest"){await he.mutateAsync({exerciseName:`${C.icon} ${C.name}`,sets:0,reps:0,weight:0,photoUrl:c,notes:j||"仿¥ä¼æ¯",recordDate:U});return}if($){const H=L==="__custom__"?z:L;if(!H||!T||!v){y.error("å
¥è¿åä½åãçµæ¸å次æ¸å
");return}await he.mutateAsync({exerciseName:`[${C.name}] ${H}`,sets:parseInt(T),reps:parseInt(v),weight:x?parseFloat(x):0,duration:o?parseInt(o):void 0,intensity:b,caloriesBurned:B>0?B:void 0,photoUrl:c,notes:j||`${o?o+"åé":""} | 強度: ${b==="low"?"ä½":b==="high"?"é«":"ä¸"} | é ä¼°æ¶è: ${B}kcal`,recordDate:U})}else{if(!o){y.error("å
¥è¿éåæéå
");return}await he.mutateAsync({exerciseName:`${C.icon} ${C.name}`,sets:1,reps:parseInt(o),weight:0,duration:parseInt(o),intensity:b,caloriesBurned:B>0?B:void 0,photoUrl:c,notes:`${o}åé | 強度: ${b==="low"?"ä½":b==="high"?"é«":"ä¸"} | é ä¼°æ¶è: ${B}kcal${j?" | "+j:""}`,recordDate:U})}},at=a.useCallback(()=>
21{if(!h||h.length===0)return null;const t=h[0],c=t.exerciseName.replace(/^\[.*?\]\s*/,"").replace(/^[^\s]+\s/,""),U=t.exerciseName.match(/^([^\s]+)/)?.[1]||"ðï¸",te=_e.find(G=>t.exerciseName.includes(G.name)),H=h.reduce((G,ve)=>G+(ve.caloriesBurned||0),0),be=h.reduce((G,ve)=>G+(ve.duration||0),0),ot=h.find(G=>G.photoUrl)?.photoUrl||void 0;return{date:Be,workoutType:te?.name||c||"è¨ç·´",workoutIcon:te?.icon||U,duration:be>0?be:void 0,intensity:h[0].intensity||void 0,caloriesBurned:H,exercises:h.map(G=>({name:G.exerciseName,sets:G.sets||void 0,reps:G.reps||void 0,weight:G.weight?Number(G.weight):void 0})),photoUrl:ot||void 0}},[h,Be]);return e.jsxs(mt,{"data-loc":"client/src/pages/WorkoutLog.tsx:535",title:"è¨ç·´è¨é",showBack:!0,children:[e.jsx(Nt,{"data-loc":"client/src/pages/WorkoutLog.tsx:537",show:le,message:"è¨éæå",emoji:"ðª",onComplete:pe}),e.jsx("div",{"data-loc":"client/src/pages/WorkoutLog.tsx:543",className:"py-6 px-4",children:e.jsxs("div",{"data-loc":"client/src/pages/WorkoutLog.tsx:544",className:"max-w-3xl mx-auto space-y-5",children:[e.jsxs("div",{"data-loc":"client/src/pages/WorkoutLog.tsx:546",className:"mb-2",children:[e.jsx("h1",{"data-loc":"client/src/pages/WorkoutLog.tsx:547",className:"text-2xl md:text-3xl font-bold text-foreground",children:"è¨ç·´è¨é"}),e.jsx("p",{"data-loc":"client/src/pages/WorkoutLog.tsx:548",className:"text-muted-foreground text-sm mt-1",children:"è¨ä½æ¯æ¬¡è¨ç·´ï¼è¿½è¹¤ä½ åç鲿¥"})]}),e.jsx(St,{"data-loc":"client/src/pages/WorkoutLog.tsx:552",onLoadTemplate:E,currentExercises:h?.filter(t=>Number(t.weight)>0).map(t=>({name:t.exerciseName.replace(/^\[.*?\]\s*/,""),sets:t.sets||4,reps:t.reps||10,weight:Number(t.weight)||0}))}),O.length>0&&e.jsx(se,{"data-loc":"client/src/pages/WorkoutLog.tsx:564",className:"mb-4 card-premium",children:e.jsxs(ae,{"data-loc":"client/src/pages/WorkoutLog.tsx:565",className:"py-3",children:[e.jsxs("div",{"data-loc":"client/src/pages/WorkoutLog.tsx:566",className:"flex items-center justify-between",children:[e.jsxs("div",{"data-loc":"client/src/pages/WorkoutLog.tsx:567",className:"flex items-center gap-2",children:[e.jsx("span",{"data-loc":"client/src/pages/WorkoutLog.tsx:568",className:"text-sm font-medium",children:"模æ¿é²åº¦"}),e.jsxs("span",{"data-loc":"client/src/pages/WorkoutLog.tsx:569",className:"text-xs text-muted-foreground",children:[de+1," / ",O.length]})]}),e.jsx(f,{"data-loc":"client/src/pages/WorkoutLog.tsx:573",variant:"ghost",size:"sm",onClick:()=>{ie([]),s(0)},children:"åç¨æ¨¡æ¿"})]}),e.jsx("div",{"data-loc":"client/src/pages/WorkoutLog.tsx:577",className:"mt-2 h-1.5 bg-muted rounded-full overflow-hidden",children:e.jsx("div",{"data-loc":"client/src/pages/WorkoutLog.tsx:578",className:"h-full bg-primary rounded-full transition-all duration-500",style:{width:`${de/O.length*100}%`}})})]})}),$&&h&&h.length>0&&e.jsx("div",{"data-loc":"client/src/pages/WorkoutLog.tsx:589",className:"mb-4",children:e.jsx(Lt,{"data-loc":"client/src/pages/WorkoutLog.tsx:590",defaultSeconds:90})}),Y&&e.jsx(se,{"data-loc":"client/src/pages/WorkoutLog.tsx:596",className:"mb-4 card-premium border-amber-500/30",children:e.jsx(ae,{"data-loc":"client/src/pages/WorkoutLog.tsx:597",className:"py-3",children:e.jsxs("div",{"data-loc":"client/src/pages/WorkoutLog.tsx:598",className:"flex items-center justify-between",children:[e.jsxs("div",{"data-loc":"client/src/pages/WorkoutLog.tsx:599",className:"flex items-center gap-2",children:[e.jsx("span",{"data-loc":"client/src/pages/WorkoutLog.tsx:600",className:"text-lg",children:"â°"}),e.jsxs("div",{"data-loc":"client/src/pages/WorkoutLog.tsx:601",children:[e.jsx("p",{"data-loc":"client/src/pages/WorkoutLog.tsx:602",className:"text-sm font-bold text-amber-400",children:"è£è¨é模å¼"}),e.jsxs("p",{"data-loc":"client/src/pages/WorkoutLog.tsx:603",className:"text-xs text-muted-foreground",children:["æ£å¨çº ",e.jsx("span",{"data-loc":"client/src/pages/WorkoutLog.tsx:603",className:"font-medium text-foreground",children:ue})," è£è¨é"]})]})]}),e.jsxs("div",{"data-loc":"client/src/pages/WorkoutLog.tsx:606",className:"flex items-center gap-2",children:[h&&h.length>0&&e.jsxs(f,{"data-loc":"client/src/pages/WorkoutLog.tsx:608",variant:"outline",size:"sm",onClick:()=>d&&oe.mutate({sourceDate:d}),disabled:oe.isPending,className:"text-xs gap-1.5 border-purple-500/30 hover:border-purple-500/50 bg-purple-500/10",children:[e.jsx(Fe,{"data-loc":"client/src/pages/WorkoutLog.tsx:615",className:"w-3.5 h-3.5"}),oe.isPending?"è¤è£½ä¸...":"è¤è£½å°ä»æ¥"]}),e.jsx(f,{"data-loc":"client/src/pages/WorkoutLog.tsx:619",variant:"ghost",size:"sm",onClick:()=>{w(null),je(void 0)},className:"text-xs",children:"è¿å仿¥"})]})]})})}),e.jsxs(se,{"data-loc":"client/src/pages/WorkoutLog.tsx:634",className:"mb-6 card-premium",children:[e.jsx(Pe,{"data-loc":"client/src/pages/WorkoutLog.tsx:635",className:"pb-3",children:e.jsxs(De,{"data-loc":"client/src/pages/WorkoutLog.tsx:636",className:"text-lg flex items-center gap-2",children:[e.jsx(ne,{"data-loc":"client/src/pages/WorkoutLog.tsx:637",className:"w-5 h-5"})," ",Y?`è£è¨éï¼${ue}`:"è¨ä½ä»æ¥è¨ç·´"]})}),e.jsx(ae,{"data-loc":"client/src/pages/WorkoutLog.tsx:640",children:e.jsxs("form",{"data-loc":"client/src/pages/WorkoutLog.tsx:641",onSubmit:st,className:"space-y-4",children:[e.jsxs("div",{"data-loc":"client/src/pages/WorkoutLog.tsx:643",children:[e.jsx(F,{"data-loc":"client/src/pages/WorkoutLog.tsx:644",className:"text-sm font-semibold",children:"è¨ç·´é¡å"}),e.jsxs(We,{"data-loc":"client/src/pages/WorkoutLog.tsx:645",value:i,onValueChange:g,children:[e.jsx(Ne,{"data-loc":"client/src/pages/WorkoutLog.tsx:646",className:"mt-2",children:e.jsx(Ce,{"data-loc":"client/src/pages/WorkoutLog.tsx:647",placeholder:"æä½ åå
éå..."})}),e.jsx(Se,{"data-loc":"client/src/pages/WorkoutLog.tsx:649",className:"max-h-[300px]",children:Object.keys(fe).map(t=>e.jsxs("div",{"data-loc":"client/src/pages/WorkoutLog.tsx:651",children:[e.jsxs("div",{"data-loc":"client/src/pages/WorkoutLog.tsx:652",className:`px-2 py-1.5 text-xs font-bold ${fe[t].color} flex items-center gap-1`,children:[fe[t].icon," ",fe[t].name]}),_e.filter(c=>c.category===t).map(c=>e.jsxs(ce,{"data-loc":"client/src/pages/WorkoutLog.tsx:656",value:c.id,children:[c.icon," ",c.name,"
21(",c.caloriesPerMin," kcal/min)"]},c.id))]},t))})]})]}),i&&C?.category==="rest"&&e.jsxs("div",{"data-loc":"client/src/pages/WorkoutLog.tsx:668",className:"p-4 bg-muted/20 rounded-lg text-center",children:[e.jsx("p",{"data-loc":"client/src/pages/WorkoutLog.tsx:669",className:"text-2xl mb-2",children:C.icon}),e.jsx("p",{"data-loc":"client/src/pages/WorkoutLog.tsx:670",className:"text-sm text-muted-foreground",children:"仿¥ä¼æ¯ï¼è¨ä½å°±å¾ï¼åæ· streakï¼"}),e.jsx(Q,{"data-loc":"client/src/pages/WorkoutLog.tsx:671",placeholder:"å åå註ï¼ä¾å¦ï¼ç
åãèèç ã伿¯æ¥ï¼",value:j,onChange:t=>_(t.target.value),className:"mt-3"})]}),i&&C?.category!=="rest"&&e.jsxs("div",{"data-loc":"client/src/pages/WorkoutLog.tsx:677",className:"grid grid-cols-2 gap-3",children:[e.jsxs("div",{"data-loc":"client/src/pages/WorkoutLog.tsx:678",children:[e.jsx(F,{"data-loc":"client/src/pages/WorkoutLog.tsx:679",className:"text-xs text-muted-foreground",children:"æéï¼åéï¼"}),e.jsx(Q,{"data-loc":"client/src/pages/WorkoutLog.tsx:680",type:"text",inputMode:"numeric",pattern:"[0-9]*",placeholder:"30",value:o,onChange:t=>m(t.target.value.replace(/[^0-9]/g,"")),className:"mt-1 h-10 text-lg font-bold text-center"})]}),e.jsxs("div",{"data-loc":"client/src/pages/WorkoutLog.tsx:690",children:[e.jsx(F,{"data-loc":"client/src/pages/WorkoutLog.tsx:691",className:"text-xs text-muted-foreground",children:"強度"}),e.jsxs(We,{"data-loc":"client/src/pages/WorkoutLog.tsx:692",value:b,onValueChange:t=>N(t),children:[e.jsx(Ne,{"data-loc":"client/src/pages/WorkoutLog.tsx:693",className:"mt-1 h-10",children:e.jsx(Ce,{"data-loc":"client/src/pages/WorkoutLog.tsx:693"})}),e.jsxs(Se,{"data-loc":"client/src/pages/WorkoutLog.tsx:694",children:[e.jsx(ce,{"data-loc":"client/src/pages/WorkoutLog.tsx:695",value:"low",children:"ä½å¼·åº¦ï¼è¼é¬ï¼"}),e.jsx(ce,{"data-loc":"client/src/pages/WorkoutLog.tsx:696",value:"medium",children:"ä¸å¼·åº¦ï¼æ£å¸¸ï¼"}),e.jsx(ce,{"data-loc":"client/src/pages/WorkoutLog.tsx:697",value:"high",children:"é«å¼·åº¦ï¼çæ±ï¼"})]})]})]})]}),$&&e.jsxs("div",{"data-loc":"client/src/pages/WorkoutLog.tsx:706",className:"space-y-3 p-3 bg-muted/20 rounded-lg",children:[e.jsxs("div",{"data-loc":"client/src/pages/WorkoutLog.tsx:707",children:[e.jsx(F,{"data-loc":"client/src/pages/WorkoutLog.tsx:708",className:"text-sm font-semibold",children:"åä½å稱"}),e.jsxs(We,{"data-loc":"client/src/pages/WorkoutLog.tsx:709",value:L,onValueChange:D,children:[e.jsx(Ne,{"data-loc":"client/src/pages/WorkoutLog.tsx:710",className:"mt-1",children:e.jsx(Ce,{"data-loc":"client/src/pages/WorkoutLog.tsx:711",placeholder:"æä½ åå
åä½..."})}),e.jsxs(Se,{"data-loc":"client/src/pages/WorkoutLog.tsx:713",className:"max-h-[300px]",children:[Pt.map(t=>e.jsxs("div",{"data-loc":"client/src/pages/WorkoutLog.tsx:715",children:[e.jsxs("div",{"data-loc":"client/src/pages/WorkoutLog.tsx:716",className:"px-2 py-1.5 text-xs font-bold text-primary flex items-center gap-1",children:[t.icon," ",t.group]}),t.exercises.map(c=>e.jsx(ce,{"data-loc":"client/src/pages/WorkoutLog.tsx:720",value:c.name,children:c.name},c.id))]},t.group)),e.jsx("div",{"data-loc":"client/src/pages/WorkoutLog.tsx:726",className:"px-2 py-1.5 text-xs font-bold text-muted-foreground",children:"âï¸ èªå®ç¾©"}),e.jsx(ce,{"data-loc":"client/src/pages/WorkoutLog.tsx:727",value:"__custom__",children:"èªå·±æ..."})]})]}),L==="__custom__"&&e.jsx(Q,{"data-loc":"client/src/pages/WorkoutLog.tsx:731",className:"mt-2",placeholder:"æåä½åï¼ä¾å¦ï¼å¡ç¾æ¼æ© Cable Machine",value:z,onChange:t=>M(t.target.value),autoFocus:!0})]}),e.jsxs("div",{"data-loc":"client/src/pages/WorkoutLog.tsx:740",className:"space-y-2",children:[e.jsxs("div",{"data-loc":"client/src/pages/WorkoutLog.tsx:741",className:"flex items-center gap-3",children:[e.jsx(F,{"data-loc":"client/src/pages/WorkoutLog.tsx:742",className:"text-sm text-muted-foreground w-16 shrink-0",children:"çµæ¸"}),e.jsx(f,{"data-loc":"client/src/pages/WorkoutLog.tsx:743",type:"button",variant:"ghost",size:"icon",className:"h-8 w-8 shrink-0 rounded-full border border-border/50",onClick:()=>r(String(Math.max(0,(parseInt(T)||0)-1))),children:e.jsx(ke,{"data-loc":"client/src/pages/WorkoutLog.tsx:744",className:"w-3.5 h-3.5"})}),e.jsx(Q,{"data-loc":"client/src/pages/WorkoutLog.tsx:746",type:"text",inputMode:"numeric",pattern:"[0-9]*",value:T,onChange:t=>r(t.target.value.replace(/[^0-9]/g,"")),className:"text-center text-lg font-bold h-9 w-16",placeholder:"0"}),e.jsx(f,{"data-loc":"client/src/pages/WorkoutLog.tsx:747",type:"button",variant:"ghost",size:"icon",className:"h-8 w-8 shrink-0 rounded-full border border-border/50",onClick:()=>r(String((parseInt(T)||0)+1)),children:e.jsx(ne,{"data-loc":"client/src/pages/WorkoutLog.tsx:748",className:"w-3.5 h-3.5"})})]}),e.jsxs("div",{"data-loc":"client/src/pages/WorkoutLog.tsx:751",className:"flex items-center gap-3",children:[e.jsx(F,{"data-loc":"client/src/pages/WorkoutLog.tsx:752",className:"text-sm text-muted-foreground w-16 shrink-0",children:"次æ¸"}),e.jsx(f,{"data-loc":"client/src/pages/WorkoutLog.tsx:753",type:"button",variant:"ghost",size:"icon",className:"h-8 w-8 shrink-0 rounded-full border border-border/50",onClick:()=>k(String(Math.max(0,(parseInt(v)||0)-1))),children:e.jsx(ke,{"data-loc":"client/src/pages/WorkoutLog.tsx:754",className:"w-3.5 h-3.5"})}),e.jsx(Q,{"data-loc":"client/src/pages/WorkoutLog.tsx:756",type:"text",inputMode:"numeric",pattern:"[0-9]*",value:v,onCh
21ange:t=>k(t.target.value.replace(/[^0-9]/g,"")),className:"text-center text-lg font-bold h-9 w-16",placeholder:"0"}),e.jsx(f,{"data-loc":"client/src/pages/WorkoutLog.tsx:757",type:"button",variant:"ghost",size:"icon",className:"h-8 w-8 shrink-0 rounded-full border border-border/50",onClick:()=>k(String((parseInt(v)||0)+1)),children:e.jsx(ne,{"data-loc":"client/src/pages/WorkoutLog.tsx:758",className:"w-3.5 h-3.5"})})]}),e.jsxs("div",{"data-loc":"client/src/pages/WorkoutLog.tsx:761",className:"flex items-center gap-3",children:[e.jsx(F,{"data-loc":"client/src/pages/WorkoutLog.tsx:762",className:"text-sm text-muted-foreground w-16 shrink-0",children:"éé(kg)"}),e.jsx(f,{"data-loc":"client/src/pages/WorkoutLog.tsx:763",type:"button",variant:"ghost",size:"icon",className:"h-8 w-8 shrink-0 rounded-full border border-border/50",onClick:()=>p(String(Math.max(0,(parseFloat(x)||0)-2.5))),children:e.jsx(ke,{"data-loc":"client/src/pages/WorkoutLog.tsx:764",className:"w-3.5 h-3.5"})}),e.jsx(Q,{"data-loc":"client/src/pages/WorkoutLog.tsx:766",type:"text",inputMode:"decimal",pattern:"[0-9.]*",value:x,onChange:t=>p(t.target.value.replace(/[^0-9.]/g,"")),className:"text-center text-lg font-bold h-9 w-16",placeholder:"0"}),e.jsx(f,{"data-loc":"client/src/pages/WorkoutLog.tsx:767",type:"button",variant:"ghost",size:"icon",className:"h-8 w-8 shrink-0 rounded-full border border-border/50",onClick:()=>p(String((parseFloat(x)||0)+2.5)),children:e.jsx(ne,{"data-loc":"client/src/pages/WorkoutLog.tsx:768",className:"w-3.5 h-3.5"})})]})]})]}),i&&!$&&C?.category!=="rest"&&e.jsxs("div",{"data-loc":"client/src/pages/WorkoutLog.tsx:777",children:[e.jsx(F,{"data-loc":"client/src/pages/WorkoutLog.tsx:778",className:"text-sm",children:"å註ï¼å¯é¸ï¼"}),e.jsx(Q,{"data-loc":"client/src/pages/WorkoutLog.tsx:779",placeholder:"ä¾ï¼æè¦ºè¯å¥½ãæé»ç´¯",value:j,onChange:t=>_(t.target.value),className:"mt-1"})]}),i&&C?.category!=="rest"&&e.jsxs("div",{"data-loc":"client/src/pages/WorkoutLog.tsx:785",children:[e.jsxs(F,{"data-loc":"client/src/pages/WorkoutLog.tsx:786",className:"text-sm font-semibold flex items-center gap-1.5",children:[e.jsx(ut,{"data-loc":"client/src/pages/WorkoutLog.tsx:787",className:"w-4 h-4"})," è¨ç·´ç¸ï¼å¯é¸ï¼"]}),e.jsx("p",{"data-loc":"client/src/pages/WorkoutLog.tsx:789",className:"text-xs text-muted-foreground mt-0.5 mb-2",children:"影張ç¸è¨é仿¥è¨ç·´ï¼å¯ä»¥åäº«å» Story"}),W?e.jsxs("div",{"data-loc":"client/src/pages/WorkoutLog.tsx:791",className:"relative inline-block",children:[e.jsx("img",{"data-loc":"client/src/pages/WorkoutLog.tsx:792",src:W,alt:"Workout preview",className:"w-24 h-24 rounded-xl object-cover border border-border/50"}),e.jsx("button",{"data-loc":"client/src/pages/WorkoutLog.tsx:797",type:"button",onClick:()=>{P(null),X(null)},className:"absolute -top-2 -right-2 w-6 h-6 rounded-full bg-destructive text-white flex items-center justify-center shadow-md",children:e.jsx(xt,{"data-loc":"client/src/pages/WorkoutLog.tsx:802",className:"w-3.5 h-3.5"})})]}):e.jsxs("button",{"data-loc":"client/src/pages/WorkoutLog.tsx:806",type:"button",onClick:()=>Z.current?.click(),className:"w-24 h-24 rounded-xl border-2 border-dashed border-border/50 flex flex-col items-center justify-center gap-1 text-muted-foreground hover:border-primary/50 hover:text-primary transition-colors",children:[e.jsx(jt,{"data-loc":"client/src/pages/WorkoutLog.tsx:811",className:"w-6 h-6"}),e.jsx("span",{"data-loc":"client/src/pages/WorkoutLog.tsx:812",className:"text-[10px]",children:"å ç¸"})]}),e.jsx("input",{"data-loc":"client/src/pages/WorkoutLog.tsx:815",ref:Z,type:"file",accept:"image/*",className:"hidden",onChange:Ze})]}),B>0&&e.jsxs("div",{"data-loc":"client/src/pages/WorkoutLog.tsx:827",className:"flex items-center justify-between p-3 bg-gradient-to-r from-orange-500/10 to-red-500/10 rounded-lg",children:[e.jsx("span",{"data-loc":"client/src/pages/WorkoutLog.tsx:828",className:"text-sm font-medium",children:"é ä¼°æ¶è"}),e.jsxs("span",{"data-loc":"client/src/pages/WorkoutLog.tsx:829",className:"text-lg font-bold text-orange-500",children:[B," kcal"]})]}),e.jsx(f,{"data-loc":"client/src/pages/WorkoutLog.tsx:833",type:"submit",className:"w-full",disabled:he.isPending||!i||xe,children:xe?e.jsx(e.Fragment,{children:"ä¸å³ç¸çä¸..."}):e.jsxs(e.Fragment,{children:[e.jsx(ne,{"data-loc":"client/src/pages/WorkoutLog.tsx:837",className:"w-4 h-4 mr-2"})," è¨ä½è¨ç·´"]})})]})})]}),h&&h.length>0&&e.jsx(se,{"data-loc":"client/src/pages/WorkoutLog.tsx:846",className:"mb-6 card-premium overflow-hidden",children:e.jsx(ae,{"data-loc":"client/src/pages/WorkoutLog.tsx:847",className:"p-0",children:e.jsxs("div",{"data-loc":"client/src/pages/WorkoutLog.tsx:848",className:"bg-gradient-to-r from-purple-500/10 via-blue-500/10 to-teal-500/10 p-5",children:[e.jsxs("div",{"data-loc":"client/src/pages/WorkoutLog.tsx:849",className:"flex items-center justify-between mb-3",children:[e.jsxs("h3",{"data-loc":"client/src/pages/WorkoutLog.tsx:850",className:"text-lg font-bold flex items-center gap-2",children:[e.jsx("span",{"data-loc":"client/src/pages/WorkoutLog.tsx:851",className:"text-2xl",children:"ð"})," ",Y?`${ue} è¨ç·´ç¸½çµ`:"仿¥è¨ç·´ç¸½çµ"]}),e.jsx(Tt,{"data-loc":"client/src/pages/WorkoutLog.tsx:853",data:at(),trigger:e.jsxs(f,{"data-loc":"client/src/pages/WorkoutLog.tsx:856",variant:"outline",size:"sm",className:"gap-1.5 bg-gradient-to-r from-purple-500/20 to-pink-500/20 border-purple-500/30 hover:border-purple-500/50",children:[e.jsx(Me,{"data-loc":"client/src/pages/WorkoutLog.tsx:857",className:"w-3.5 h-3.5"}),"å享 Story"]})})]}),e.jsxs("div",{"data-loc":"client/src/pages/WorkoutLog.tsx:865",className:"grid grid-cols-3 gap-3 mb-3",children:[e.jsxs("div",{"data-loc":"client/src/pages/WorkoutLog.tsx:866",className:"text-center p-3 rounded-xl bg-background/40",children:[e.jsx("p",{"data-loc":"client/src/pages/WorkoutLog.tsx:867",className:"text-2xl font-bold text-orange-500",children:h.reduce((t,c)=>t+(c.caloriesBurned||0),0)}),e.jsx("p",{"data-loc":"client/src/pages/WorkoutLog.tsx:870",className:"text-xs text-muted-foreground",children:"kcal æ¶è"})]}),e.jsxs("div",{"data-loc":"client/src/pages/WorkoutLog.tsx:872",className:"text-center p-3 rounded-xl bg-background/40",children:[e.jsx("p",{"data-loc":"client/src/pages/WorkoutLog.tsx:873",className:"text-2xl font-bold text-blue-500",children:h.length}),e.jsx("p",{"data-loc":"client/src/pages/WorkoutLog.tsx:874",className:"text-xs text-muted-foreground",children:"ååä½"})]}),e.jsxs("div",{"data-loc":"client/src/pages/WorkoutLog.tsx:876",className:"text-center p-3 rounded-xl bg-background/40",children:[e.jsx("p",{"data-loc":"client/src/pages/WorkoutLog.tsx:877",className:"text-2xl font-bold text-green-500",children:h.reduce((t,c)=>t+(c.duration||0),0)||"â"}),e.jsx("p",{"data-loc":"client/src/pages/WorkoutLog.tsx:880",className:"text-xs text-muted-foreground",children:"åé"})]})]}),h.some(t=>t.photoUrl)&&e.jsx("div",{"data-loc":"client/src/pages/WorkoutLog.tsx:886",className:"flex gap-2 overflow-x-auto pb-1",children:h.filter(t=>t.photoUrl).map((t,c)=>e.jsx("img",{"data-loc":"client/src/pages/WorkoutLog.tsx:888",src:t.photoUrl,alt:"Workout",className:"w-16 h-16 rounded-lg object-cover border border-border/30 shrink-0"},c))})]})})}),e.jsx("div",{"data-loc":"client/src/pages/WorkoutLog.tsx:903",className:"mb-6",children:e.jsx(Wt,{"data-loc":"client/src/pages/WorkoutLog.tsx:904",data:Qe,mode:"workout",onDateSelect:t=>{je(t);const c=new Date(t+"T12:00:00");w(c)},onMonthChange:(t,c)=>Ye({year:t,month:c}),monthSummary:Xe,selectedDate:Ke})}),e.jsxs(se,{"data-loc":"client/src/pages/WorkoutLog.tsx:920",className:"card-premium",children:[e.jsx(Pe,{"data-loc":"client/src/pages/WorkoutLog.tsx:921",className:"pb-3",children:e.jsxs("div",{"data-loc":"client/src/pages/WorkoutLog.tsx:922",className:"flex items-center justify-between",children:[e.jsxs(De,{"data-loc":"client/src/pages/WorkoutLog.tsx:923",className:"text-lg flex items-center gap-2",children:[e.jsx(Ae,{"data-loc":"client/src/pages/WorkoutLog.tsx:924",className:"w-5 h-5"})," ",Y?`${ue} è¨ç·´`:"仿¥è¨ç·´"," (",h?.length||0,")"]}),Y&&h&&h.length>0&&e.jsxs(f,{"data-loc":"client/src/pages/WorkoutLog.tsx:927",variant:"outline",size:"sm",onClick:()=>d&&oe.mutate({sourceDate:d}),disabled:oe.isPending,className:"gap-1.5 text-xs border-purple-500/30 hover:border-purple-500/50 bg-purple-500/10",children:[e.jsx(Fe,{"data-loc":"client/src/pages/WorkoutLog.tsx:934",className:"w-3.5 h-3.5"}),oe.isPending?"è¤è£½ä¸...":"è¤è£½å°ä»æ¥"]})]})}),e.jsx(ae,{"data-loc":"client/src/pages/WorkoutLog.tsx:940",children:h&&h.length>0?e.jsx("div",{"data-loc":"client/src/pages/WorkoutLog.tsx:942",className:"space-y-2",children:h.map(t=>e.jsxs("div",{"data-loc":"client/src/pages/WorkoutLog.tsx:944",className:"flex items-center justify-between p-3 bg-muted/20 rounded-lg",children:[e.jsxs("div",{"data-loc":"client/src/pages/WorkoutLog.tsx:945",className:"flex items-center gap-3 flex-1",children:[t.photoUrl&&e.jsx("img",{"data-loc":"client/src/pages/WorkoutLog.tsx:948",src:t.photoUrl,alt:"",className:"w-10 h-10 rounded-lg object-cover shrink-0"}),e.jsxs("div",{"data-loc":"client/src/pages/WorkoutLog.tsx:954",className:"flex-1 min-w-0",children:[e.jsx("div",{"data-loc":"client/src/pages/WorkoutLog.tsx:955",className:"font-medium text-sm truncate",children:t.exerciseName}),e.jsxs("div",{"data-loc":"client/src/pages/WorkoutLog.tsx:956",className:"text-xs text-muted-foreground mt-0.5",children:[t.weight&&Number(t.weight)>0?`${t.sets}çµ Ã ${t.reps}次 @ ${t.weight}kg`:`${t.notes||""}`,t.caloriesBurned?` · ${t.caloriesBurned}kcal`:""]})]})]}),e.jsx(f,{"data-loc":"client/src/pages/WorkoutLog.tsx:964",variant:"ghost",size:"sm",onClick:()=>tt.mutate({id:t.id}),children:e.jsx(qe,{"data-loc":"client/src/pages/WorkoutLog.tsx:965",className:"w-4 h-4 text-destructive"})})]},t.id))}):e.jsxs("div",{"data-loc":"client/src/pages/WorkoutLog.tsx:971",className:"text-center py-8 text-muted-foreground",children:[e.jsx(He,{"data-loc":"client/src/pages/WorkoutLog.tsx:972",className:"w-10 h-10 mx-auto mb-3 opacity-30"}),e.jsx("p",{"data-loc":"client/src/pages/WorkoutLog.tsx:973",children:Y?`${ue} ç¡è¨ç·´è¨é`:"仿¥ä»²æªæè¨ç·´è¨é"}),e.jsx("p",{"data-loc":"client/src/pages/WorkoutLog.tsx:974",className:"text-xs mt-1",children:Y?"å¯ä»¥è£è¿è¨éï¼":"æåéåéå§è¨ä½å¦ï¼"})]})})]})]})})]})}export{Vt 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.