1import{l as C,r as f,j as e,a as g,Z as D,$ as S,a0 as T,a1 as I,ah as z,a2 as B,X as q,a5 as P,C as H,k as F,L as Q}from"./entry-CFysDqw_.js";import{B as N}from"./index-BMOAZvav.js";import{u as m,M as d,d as u}from"./index-B2wgB0BV.js";import{S as b}from"./skeleton-CYx887YE.js";import{m as $,e as A,u as _,a as V,E as R,d as U}from"./ExercisePreviewCard-D3_cVHJI.js";import{a as W}from"./chat-session-context-2m7mGyup.js";import{u as O}from"./use-page-context-rP6Q1Kvp.js";import{u as X}from"./use-mobile-Ble9eBfK.js";import{f as G}from"./PageHeaderSlot-B0sriCQm.js";import"./textarea-D_r1wqLQ.js";import{B as K}from"./Breadcrumbs-Cm2K83-j.js";import{u as Z}from"./use-permission-CNsaSB_3.js";import"./side-panel-context-Dgm94F12.js";import{u as J}from"./use-open-chat-panel-Cu636TYj.js";import{C as Y}from"./circle-alert-CqY5pR2X.js";import{S as ee}from"./sparkles-4OJAl6sZ.js";import{A as se}from"./arrow-up-right-nkdD3BVH.js";import"./with-selector-5orPIsow.js";import"./copy-ClaX0sSv.js";import"./chevron-right-CVRkkDZ6.js";import"./mock-members-LGgI6A3N.js";import"./arrow-up-DMB7Jo4d.js";import"./dumbbell-Chq-Sanx.js";import"./clock-C8zY0FqF.js";import"./chart-column-CNpxvM2S.js";import"./map-pinned-B9GFFD2x.js";import"./zap-kSLV-0uJ.js";import"./chat-entry-point-B1jLAIED.js";/** 2 * @license lucide-react v0.462.0 - ISC 3 * 4 * This source code is licensed under the ISC license. 5 * See the LICENSE file in the root directory of this source tree. 6 */const ae=C("Maximize2",[["polyline",{points:"15 3 21 3 21 9",key:"mznyad"}],["polyline",{points:"9 21 3 21 3 15",key:"1avn1i"}],["line",{x1:"21",x2:"14",y1:"3",y2:"10",key:"ota7mn"}],["line",{x1:"3",x2:"10",y1:"21",y2:"14",key:"1atl0r"}]]),x=u({heading:{id:"portal.exercises.muscles.heading",defaultMessage:"Muscles",description:"Heading of the exercise's muscles section."},primaryLabel:{id:"portal.exercises.muscles.primaryLabel",defaultMessage:"Primary",description:"Label above the exercise's primary muscle chips."},secondaryLabel:{id:"portal.exercises.muscles.secondaryLabel",defaultMessage:"Secondary",description:"Label above the exercise's secondary muscle chips."},diagramAlt:{id:"portal.exercises.muscles.diagramAlt",defaultMessage:"{muscle} muscle group anatomy diagram",description:"Alt text for a muscle group anatomy diagram image. `muscle` is catalog content and must not be translated."}});function y({label:s,values:t}){return t.length===0?null:e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx("span",{className:"text-heading-h4 text-on-surface-muted",children:s}),t.map(i=>e.jsx("span",{className:"rounded-full bg-surface-sunken px-2.5 py-1 text-[13px] text-on-surface",children:i},i))]})}function te({exercise:s,className:t}){const[i,a]=f.useState([]),n=m(),l=s.muscles.primary.filter(o=>!i.includes(o)).map(o=>({muscle:o,src:$(o)})).filter(o=>!!o.src);return e.jsxs("div",{className:g("flex flex-col gap-3 rounded-2xl bg-surface-base p-4",t),children:[e.jsx("h2",{className:"text-[15px] font-semibold text-on-surface-heading",children:e.jsx(d,{...x.heading})}),l.length>0?e.jsx("div",{className:"flex flex-wrap items-start gap-3",children:l.map(({muscle:o,src:c})=>e.jsx("img",{src:c,alt:n.formatMessage(x.diagramAlt,{muscle:o}),className:"h-40 w-auto",loading:"lazy",onError:()=>a(h=>[...h,o])},o))}):null,e.jsx(y,{label:n.formatMessage(x.primaryLabel),values:s.muscles.primary}),e.jsx(y,{label:n.formatMessage(x.secondaryLabel),values:s.muscles.secondary})]})}const M=u({noDemo:{id:"portal.exercises.video.noDemo",defaultMessage:"No demo video for this exercise yet",description:"Shown in the video slot when the exercise has no demo video."},ariaLabel:{id:"portal.exercises.video.ariaLabel",defaultMessage:"{name} demonstration",description:"Accessible label for an exercise's demo video. `name` is catalog content and must not be translated."}});function w({exercise:s,orientation:t="portrait",label:i,className:a}){const n=m(),l=A(s,t);return l?e.jsx("video",{className:g("rounded-2xl bg-surface-sunken object-contain",a),src:l,poster:s.media.posterUrl??void 0,autoPlay:!0,loop:!0,muted:!0,playsInl
6ine:!0,preload:"metadata","aria-label":i??n.formatMessage(M.ariaLabel,{name:s.name})},l):e.jsx("div",{className:g("flex min-h-[220px] w-full items-center justify-center rounded-2xl bg-surface-sunken p-4 text-center text-sm text-on-surface-muted",a),children:e.jsx(d,{...M.noDemo})})}const j=u({title:{id:"portal.exercises.video.dialogTitle",defaultMessage:"{name} demonstration",description:"Screen-reader title of the expanded demo video dialog. `name` is catalog content and must not be translated."},expandedLabel:{id:"portal.exercises.video.expandedLabel",defaultMessage:"{name} demonstration, expanded",description:"Accessible name of the demo video once expanded to full screen. `name` is catalog content and must not be translated."},close:{id:"portal.exercises.video.close",defaultMessage:"Close video",description:"Accessible name of the button that closes the expanded demo video."}});function ie({exercise:s,open:t,onOpenChange:i,orientation:a="portrait"}){const n=m();return e.jsx(D,{open:t,onOpenChange:i,children:e.jsxs(S,{children:[e.jsx(T,{className:"bg-black/80"}),e.jsxs(I,{"aria-describedby":void 0,onClick:l=>{l.target===l.currentTarget&&i(!1)},className:"fixed inset-0 z-50 flex items-center justify-center p-4 focus:outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95",children:[e.jsx(z,{className:"sr-only",children:e.jsx(d,{...j.title,values:{name:s.name}})}),e.jsx(w,{exercise:s,orientation:a,label:n.formatMessage(j.expandedLabel,{name:s.name}),className:"h-[80svh] max-h-full w-auto max-w-full bg-transparent"}),e.jsxs(B,{className:"absolute right-3 top-3 flex size-11 items-center justify-center rounded-full bg-black/40 text-white ring-1 ring-inset ring-white/40 backdrop-blur-sm transition-colors hover:bg-black/70 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-white md:right-6 md:top-6",children:[e.jsx(q,{className:"size-5","aria-hidden":"true"}),e.jsx("span",{className:"sr-only",children:e.jsx(d,{...j.close})})]})]})]})})}const le=u({expand:{id:"portal.exercises.video.expand",defaultMessage:"Expand {name} video to full screen",description:"Accessible name of the button that opens the demo video full screen. `name` is catalog content and must not be translated."}});function ne({exercise:s,className:t}){const[i,a]=f.useState(!1),n=A(s,"portrait")!==null;return e.jsxs("div",{className:g("relative lg:min-h-[380px]",t),children:[e.jsx("div",{className:"mx-auto w-full max-w-[360px] lg:absolute lg:inset-0 lg:max-w-none",children:e.jsxs("div",{className:"relative h-full overflow-hidden rounded-2xl bg-surface-sunken",children:[e.jsx(w,{exercise:s,className:"h-full max-h-[70svh] w-full rounded-none lg:max-h-none"}),n?e.jsxs("button",{type:"button",onClick:()=>a(!0),className:"group absolute inset-0 flex items-start justify-end p-2 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-focus-ring",children:[e.jsx("span",{className:"flex size-9 items-center justify-center rounded-full bg-black/45 text-white transition-colors group-hover:bg-black/70",children:e.jsx(ae,{className:"size-4","aria-hidden":"true"})}),e.jsx("span",{className:"sr-only",children:e.jsx(d,{...le.expand,values:{name:s.name}})})]}):null]})}),n?e.jsx(ie,{exercise:s,open:i,onOpenChange:a}):null]})}const L=u({formCoaching:{id:"portal.exerciseDetail.suggestedQuestions.formCoaching",defaultMessage:"How do I coach the correct form for this exercise?",description:"Generic suggested AI question offered when the exercise has no curated questions of its own."},beginnerWatch:{id:"portal.exerciseDetail.suggestedQuestions.beginnerWatch",defaultMessage:"What should I watch for with a beginner doing this?",description:"Generic suggested AI question offered when the exercise has no curated questions of its own."}}),re=[L.formCoaching,L.beginnerWatch];function oe(s){return s.aiQuestions.length>0?s.aiQuestions:re}function ce(s){const t=Z("chat.use"),{discussExercise:i}=W(),a=J("exercise_detail"),n=f.useCallback(l=>{s&&(i(s,l),a())},[s,i,a]);return f.useMemo(()=>t?{askQuestion:n,askAi:a}:null,[t,n,a])}const E="/dashboard/exercises",r=u({loadingLabel:{id:"portal.exerciseDetail.loadingLabel",defaultMessage:"Loading exercise...",description:"Accessible label for the exercise detail page's loading skeleton."},errorTitle:{id:"portal.exerciseDetail.errorTitle",defaultMessage:"Could not load this exercise",description:"Title shown when an exercise fails to load."},backLink:{id:"portal.exerciseDetail.backLink",defaultMessage:"Back to exercises",description:"Link back to the exercise library, shown on the error state."},levelLabel:{id:"portal.exerciseDetail.levelLabel",defaultMessage:"Level",description:"Label above an exercise's difficulty level."},primarySkillLabel:{id:"portal.exerciseDetail.primarySkillLabel",defaultMessage:"Primary skill",description:"Label above an exercise's primary skill."},bodyAreaLabel:{id:"portal.exerciseDetail.bodyAreaLabel",defaultMessage:"Body area",description:"Label above an exercise's body area."},equipmentLabel:{id:"portal.exerciseDetail.equipmentLabel",defaultMessage:"Equipment",description:"Label above an exercise's equipment list."},equipmentNone:{id:"portal.exerciseDetail.equipmentNone",defaultMessage:"None",description:"Shown in place of the equipment list when an exercise needs no equipment."},correctFormTitle:{id:"portal.exerciseDetail.correctFormTitle",defaultMessage:"Correct Form",description:"Title of the exercise detail page's correct-form section."},commonMistakesTitle:{id:"portal.exerciseDetail.commonMistakesTitle",defaultMessage:"Common Mistakes",description:"Title of the exercise detail page's common-mistakes section."},proTipsTitle:{id:"portal.exerciseDetail.proTipsTitle",defaultMessage:"Pro Tips",description:"Title of the exercise detail page's pro-tips section."},askAiCoachHeading:{id:"portal.exerciseDetail.askAiCoachHeading",defaultMessage:"Ask the AI Coach",description:"Heading of the exercise detail page's Ask AI Coach section."},askAiButton:{id:"portal.exerciseDetail.askAiButton",defaultMessage:"Ask AI",description:"Button that opens the docked AI chat with an empty composer."},alternativesHeading:{id:"portal.exerciseDetail.alternativesHeading",defaultMessage:"Alternative Exercises",description:"Heading above a grid of alternative exercises."},breadcrumbExercises:{id:"portal.exerciseDetail.breadcrumbExercises",defaultMessage:"Exercises",description:"Breadcrumb label linking back to the exercise library."},fallbackName:{id:"portal.exerciseDetail.fallbackName",defaultMessage:"Exercise",description:"Fallback exercise name shown while the exercise has not loaded yet."}});function de(){const s=m();return e.jsxs("div",{className:"flex flex-col gap-6","aria-label":s.formatMessage(r.loadingLabel),children:[e.jsx(b,{className:"aspect-video w-full rounded-2xl"}),e.jsx(b,{className:"h-8 w-64"}),e.jsx(b,{className:"h-24 w-full"})]})}function me(){return e.jsx(H,{children:e.jsxs(F,{className:"flex flex-col items-center gap-2 pt-6 text-center",children:[e.jsx(Y,{className:"h-8 w-8 text-on-surface-muted"}),e.jsx("p",{className:"text-base font-semibold",children:e.jsx(d,{...r.errorTitle})}),e.jsx(Q,{to:E,className:"text-sm text-brand underline",children:e.jsx(d,{...r.backLink})})]})})}function p({label:s,value:t}){return e.jsxs("div",{className:"flex flex-col gap-0.5",children:[e.jsx("dt",{className:"text-heading-h4 text-on-surface-muted",children:s}),e.jsx("dd",{className:"text-[14px] font-medium text-on-surface",children:t})]})}function v({title:s,children:t,className:i}){return e.jsxs("section",{className:`flex flex-col gap-2 rounded-2xl bg-surface-base p-4 ${i??""}`,children:[e.jsx("h2",{className:"text-[15px] font-semibold text-on-surface-heading",children:s}),t]})}function k({items:s,ordered:t}){const i=t?"ol":"ul";return e.jsx(i,{className:`flex flex-col gap-1.5 text-[14px] leading-[20px] text-on-surface-muted ${t?"list-decimal":"list-disc"} pl-5`,children:s.map(a=>e.jsx("li",{children:a},a))})}function ue({exercise:s,onAskQuestion:t,onAskAi:i}
6){const a=m(),n=oe(s).map(l=>typeof l=="string"?l:a.formatMessage(l));return e.jsxs("section",{className:"flex flex-col gap-3 rounded-2xl bg-surface-base p-4",children:[e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsx("h2",{className:"text-[15px] font-semibold text-on-surface-heading",children:e.jsx(d,{...r.askAiCoachHeading})}),e.jsx(N,{variant:"secondary",size:"sm",onClick:i,leftIcon:e.jsx(ee,{className:"text-accent","aria-hidden":"true"}),children:e.jsx(d,{...r.askAiButton})})]}),e.jsx("div",{className:"flex flex-col items-start gap-2",children:n.map(l=>e.jsx(N,{variant:"secondary",size:"sm",onClick:()=>t(l),leftIcon:e.jsx(se,{className:"text-accent","aria-hidden":"true"}),className:"max-w-full justify-start gap-1.5 whitespace-normal rounded-full border-border-subtle bg-surface-raised px-3 py-1.5 text-left text-on-surface shadow-sm hover:bg-surface-sunken",children:l},l))})]})}function xe({exercise:s,isMobile:t,discuss:i}){const a=m(),{data:n}=V(),l=(n??[]).filter(c=>s.alternativeSlugs.includes(c.slug)),o=s.equipment.map(c=>c.label).join(", ");return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"grid gap-6 lg:grid-cols-[minmax(0,280px)_minmax(0,1fr)]",children:[e.jsx(ne,{exercise:s}),e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsxs("div",{className:"flex flex-col gap-2",children:[t?null:e.jsx("h1",{className:"font-brand text-[28px] font-semibold leading-[1.15] tracking-[0.4px] text-on-surface-heading",children:s.name}),e.jsx("p",{className:"text-[14px] leading-[20px] text-on-surface-muted",children:s.description})]}),e.jsxs("dl",{className:"grid grid-cols-2 gap-3 rounded-2xl bg-surface-base p-4",children:[e.jsx(p,{label:a.formatMessage(r.levelLabel),value:a.formatMessage(R[s.level])}),e.jsx(p,{label:a.formatMessage(r.primarySkillLabel),value:s.primarySkill}),e.jsx(p,{label:a.formatMessage(r.bodyAreaLabel),value:s.bodyArea}),e.jsx(p,{label:a.formatMessage(r.equipmentLabel),value:o||a.formatMessage(r.equipmentNone)})]}),e.jsx(te,{exercise:s})]})]}),e.jsxs("div",{className:"grid gap-4 lg:grid-cols-4",children:[e.jsx(v,{title:a.formatMessage(r.correctFormTitle),className:"lg:col-span-2",children:e.jsx(k,{items:s.correctForm,ordered:!0}
6)}),e.jsx(v,{title:a.formatMessage(r.commonMistakesTitle),children:e.jsx(k,{items:s.commonMistakes})}),e.jsx(v,{title:a.formatMessage(r.proTipsTitle),children:e.jsx(k,{items:s.proTips})})]}),i?e.jsx(ue,{exercise:s,onAskQuestion:i.askQuestion,onAskAi:i.askAi}):null,l.length>0?e.jsxs("section",{className:"flex flex-col gap-3",children:[e.jsx("h2",{className:"text-[15px] font-semibold text-on-surface-heading",children:e.jsx(d,{...r.alternativesHeading})}),e.jsx("div",{className:"grid gap-4 sm:grid-cols-2 xl:grid-cols-3",children:l.map(c=>e.jsx(U,{exercise:c},c.slug))})]}):null]})}function _e(){const{slug:s}=P(),t=X(),i=m(),{data:a,isLoading:n,isError:l}=_(s),o=ce(a),c=i.formatMessage(r.fallbackName);O({type:"exercise",ref:a?{exercise_slug:a.slug}:void 0,label:(a==null?void 0:a.name)??c});const h=[{label:i.formatMessage(r.breadcrumbExercises),to:E},{label:(a==null?void 0:a.name)??c}];return e.jsxs("div",{className:"flex flex-col gap-6",children:[t?e.jsx(G,{children:e.jsx("h1",{className:"truncate font-brand text-heading-h4-semi text-on-surface-heading",children:(a==null?void 0:a.name)??c})}):null,e.jsx(K,{items:h}),l?e.jsx(me,{}):n||!a?e.jsx(de,{}):e.jsx(xe,{exercise:a,isMobile:t,discuss:o})]})}export{E as EXERCISES_PATH,_e as ExerciseDetailPage};
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.