PageSourceSearch

https://studio.com/_next/static/chunks/9569-7c58abcfcd62021c.js

js studio.com collected 2026-10-09 22:00:54 UTC 70,820 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9569],{9569:(e,t,s)=>{s.d(t,{Ch:()=>a.Ch,c0:()=>ed,qs:()=>ea,jm:()=>eo,Dx:()=>ec.Dx,sM:()=>ec.sM,eS:()=>ec.eS,pq:()=>ec.pq,Ii:()=>ec.Ii});var n=s(37876),r=s(14232),a=s(11854),i=s(24080),l=s(50247),o=s(10947);let c=(e,t,s)=>{let n=s*Math.PI/180;return{x:e+t*Math.cos(n),y:e+t*Math.sin(n)}},d=({remainingSec:e,plannedSec:t,themeColor:s,size:a=148,stroke:i=6})=>{let d=(0,r.useId)().replace(/[^a-zA-Z0-9_-]/g,""),u=`workout-dial-arc-${d}`,h=`workout-dial-lens-${d}`,m=a/2,p=.9*i,x=m-Math.max(i/2,p),g=252*x*(Math.PI/180),v=t>0?Math.min(1,Math.max(0,e/t)):0,w=c(m,x,144+(1-v)*252),f=((e,t,s,n)=>{let r=c(e,t,144),a=c(e,t,s+252);return`M ${r.x.toFixed(2)} ${r.y.toFixed(2)} A ${t} ${t} 0 ${1} 1 ${a.x.toFixed(2)} ${a.y.toFixed(2)}`})(m,x,144,252);return(0,n.jsxs)("div",{className:l.Uzr,style:{width:a,height:a},children:[(0,n.jsxs)("svg",{className:l.UEp,width:a,height:a,viewBox:`0 0 ${a} ${a}`,"aria-hidden":!0,children:[(0,n.jsxs)("defs",{children:[(0,n.jsxs)("linearGradient",{id:u,x1:"0%",y1:"100%",x2:"100%",y2:"0%",children:[(0,n.jsx)("stop",{offset:"0%",stopColor:s,stopOpacity:.5}),(0,n.jsx)("stop",{offset:"100%",stopColor:s,stopOpacity:1})]}),(0,n.jsxs)("radialGradient",{id:h,cx:"50%",cy:"50%",r:"50%",children:[(0,n.jsx)("stop",{offset:"0%",stopColor:"#000000",stopOpacity:.34}),(0,n.jsx)("stop",{offset:"70%",stopColor:"#000000",stopOpacity:.16}),(0,n.jsx)("stop",{offset:"100%",stopColor:"#000000",stopOpacity:0})]})]}),(0,n.jsx)("circle",{cx:m,cy:m,r:x-.5*i,fill:`url(#${h})`}),(0,n.jsx)("path",{d:f,fill:"none",stroke:"rgba(255,255,255,0.14)",strokeWidth:i,strokeLinecap:"round"}),(0,n.jsx)("path",{className:l.L6v,d:f,fill:"none",stroke:`url(#${u})`,strokeWidth:i,strokeLinecap:"round",strokeDasharray:`${g*v} ${g}`,strokeDashoffset:-(g*(1-v)),style:{filter:`drop-shadow(0 0 9px ${s}40)`}}),v>.002&&(0,n.jsx)("circle",{className:l.GfI,cx:w.x,cy:w.y,r:p,fill:"#FFFFFF"})]}),(0,n.jsxs)("div",{className:l.LT0,children:[(0,n.jsx)("span",{className:l.caA,children:(0,o.ei)(e)}),t>0&&(0,n.jsxs)("span",{className:l.W52,children:[(0,o.ei)(t)," total"]})]})]})};var u=s(14568);let h=(e,t)=>t&&void 0!==e.aspectRatio&&e.aspectRatio<.8,m=e=>({"--workout-media-aspect":String(e.aspectRatio??9/16)}),p=({media:e,paused:t,audioEnabled:s=!1,audioRunKey:a="",staticPreview:i=!1,holdFirstFrame:o=!1,secondaryColor:c,onAspectRatio:d,onReady:h})=>{let m=(0,r.useRef)(null),p=(0,r.useRef)(null),[x,g]=(0,r.useState)(!1),[v,w]=(0,r.useState)(null),f=(0,r.useRef)(!1),b=e.posterUrl??"/images/workout-empty-studio.jpg",j=(0,r.useMemo)(()=>(e=>e?e.match(/(?:wistia\.com\/medias\/|fast\.wistia\.net\/embed\/iframe\/)([a-zA-Z0-9]+)/i)?.[1]??null:null)(e.url),[e.url]),y=j?`https://fast.wistia.com/medias/${j}`:void 0;(0,r.useEffect)(()=>{g(!1),w(null),f.current=!1},[e.url]);let k=(0,r.useCallback)(()=>{f.current||(f.current=!0,h?.())},[h]),N=(0,r.useCallback)(e=>{e.requestVideoFrameCallback?e.requestVideoFrameCallback(()=>k()):k()},[k]);(0,r.useEffect)(()=>{if(e.aspectRatio)return void d?.(e.aspectRatio);let t=new Image;return t.onload=()=>{t.naturalWidth>0&&t.naturalHeight>0&&d?.(t.naturalWidth/t.naturalHeight)},t.src=b,()=>{t.onload=null}},[e.aspectRatio,d,b]);let S=s&&v!==a;(0,r.useEffect)(()=>{s&&!i&&(w(null),m.current&&(m.current.currentTime=0),p.current?.seekTo(0,"seconds"))},[s,a,i]),(0,r.useEffect)(()=>{let e=m.current;e&&!i&&(t||o?(e.paused||e.pause(),o&&e.readyState>=HTMLMediaElement.HAVE_METADATA&&(e.currentTime=0)):e.play()?.catch(()=>void 0))},[S,o,t,e.url,i]),(0,r.useEffect)(()=>{if(!i&&"none"!==e.kind&&e.url&&!x)return;let t=new Image;return t.onload=k,t.onerror=k,t.src=b,()=>{t.onload=null,t.onerror=null}},[e.kind,e.url,b,k,i,x]);let C=()=>{S&&(w(a),m.current&&(m.current.currentTime=0),p.current?.seekTo(0,"seconds"))};return(0,n.jsx)(n.Fragment,{children:i?(0,n.jsx)("div",{className:l.f1O,style:{backgroundColor:c,backgroundImage:`url(${b})`}}):"direct"===e.kind&&e.url?(0,n.jsx)("video",{ref:m,src:e.url,autoPlay:!o,muted:!S,loop:!S,playsInline:!0,preload:"auto",onLoadedMetadata:e=>{let t=e.currentTarget;t.videoWidth>0&&t.videoHeight>0&&d?.(t.videoWidth/t.videoHeight),o&&(t.currentTime=0)},onLoadedData:e=>{let t=e.currentTarget;if(o){t.paused||t.pause(),k();return}N(t)},onEnded:C}):"embed"===e.kind&&y&&!x?(0,n.jsx)(u.A,{ref:p,url:y,playing:!t&&!o,muted:!S,loop:!S,playsinline:!0,controls:!1,width:"100%",height:"100%",className:l.Uwh,c
1onfig:{wistia:{options:{autoPlay:!0,muted:!S,silentAutoPlay:!S&&"allow",controlsVisibleOnLoad:!1,playButton:!1,smallPlayButton:!1,volumeControl:!1,playbar:!1,qualityControl:!1,settingsControl:!1,fullscreenButton:!1,fitStrategy:"cover",endVideoBehavior:S?"default":"loop",resumable:!1,playSuspendedOffScreen:!0}}},onReady:()=>{o&&p.current?.seekTo(0,"seconds"),k()},onEnded:C,onError:()=>{g(!0),k()}}):"embed"===e.kind&&e.url&&!x?(0,n.jsx)("iframe",{src:e.url,allow:"autoplay; fullscreen",title:"Exercise demo",onLoad:k}):(0,n.jsx)("div",{className:l.f1O,style:{backgroundColor:c,backgroundImage:`url(${b})`}})})},x=({media:e,dimmed:t,heavyDim:s,resting:a=!1,paused:i,audioEnabled:o=!1,audioRunKey:c="",staticPreview:d=!1,holdFirstFrame:u=!1,desktopLayout:x=!1,secondaryColor:g})=>{let v=(0,r.useMemo)(()=>({key:(e=>`${e.kind}:${e.url??""}:${e.posterUrl??""}:${e.aspectRatio??""}`)(e),media:e,aspectRatio:e.aspectRatio??("none"!==e.kind||e.posterUrl?void 0:9/16),staticPreview:d,holdFirstFrame:u}),[u,e,d]),[w,f]=(0,r.useState)(()=>({current:v,outgoing:null}));(0,r.useLayoutEffect)(()=>{f(e=>e.current.key===v.key?{...e,current:{...v,aspectRatio:v.aspectRatio??e.current.aspectRatio}}:e.outgoing?.key===v.key?{current:{...v,aspectRatio:v.aspectRatio??e.outgoing.aspectRatio},outgoing:null}:{current:v,outgoing:e.outgoing??e.current})},[v]),(0,r.useEffect)(()=>{if(!w.outgoing)return;let e=window.setTimeout(()=>{f(e=>({...e,outgoing:null}))},3e3);return()=>window.clearTimeout(e)},[w.outgoing]);let b=(0,r.useCallback)(()=>{f(e=>e.current.key===v.key&&e.outgoing?{...e,outgoing:null}:e)},[v.key]),j=(0,r.useCallback)(e=>{f(t=>t.current.key!==v.key||t.current.aspectRatio===e?t:{...t,current:{...t.current,aspectRatio:e}})},[v.key]),y=!!((w.outgoing?.media??w.current.media).posterUrl??"/images/workout-empty-studio.jpg"),k=(e,t=!1)=>h(e,x)?(0,n.jsx)("div",{className:`${l.g1f} ${t?l.Tev:""}`,"data-media-ambient-transition":t?"waiting":"settled",style:{backgroundColor:g,backgroundImage:`url(${e.media.posterUrl??"/images/workout-empty-studio.jpg"})`}},`ambient:${e.key}`):null;return(0,n.jsxs)("div",{className:l.U6I,"aria-hidden":!0,"data-testid":"workout-backdrop","data-visual-media":y?"true":"false",style:{backgroundColor:g},children:[w.outgoing&&k(w.outgoing),k(w.current,!!w.outgoing),w.outgoing&&(0,n.jsx)("div",{className:`${l.Vs1} ${h(w.outgoing,x)?l.gY_:""}`,"data-media-transition":"waiting","data-media-paused":String(i),"data-media-presentation":h(w.outgoing,x)?"portrait":"cover",style:m(w.outgoing),children:(0,n.jsx)(p,{media:w.outgoing.media,paused:i,audioEnabled:!1,staticPreview:w.outgoing.staticPreview,holdFirstFrame:w.outgoing.holdFirstFrame,secondaryColor:g})},`media:${w.outgoing.key}`),(0,n.jsx)("div",{className:`${l.Vs1} ${h(w.current,x)?l.gY_:""} ${w.outgoing?l.G4x:""}`,"data-testid":"workout-media-stage","data-media-transition":w.outgoing?"waiting":"settled","data-media-presentation":h(w.current,x)?"portrait":"cover",style:m(w.current),children:(0,n.jsx)(p,{media:w.current.media,paused:i,audioEnabled:o,audioRunKey:c,staticPreview:w.current.staticPreview,holdFirstFrame:w.current.holdFirstFrame,secondaryColor:g,onAspectRatio:j,onReady:b})},`media:${w.current.key}`),y&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("div",{className:l.fGL,"data-testid":"workout-backdrop-dim",style:{backgroundColor:s?"rgba(0, 0, 0, 0.82)":a?"rgba(0, 0, 0, 0.7)":t?"rgba(0, 0, 0, 0.6)":"rgba(0, 0, 0, 0.22)"}}),(0,n.jsx)("div",{className:l.blu,"data-testid":"workout-backdrop-vignette"})]})]})},g=({open:e,secondaryColor:t,canGoPrevious:s,canGoNext:r,previousLabel:a,nextLabel:i,onResume:o,onPrevious:c,onNext:d,onRestartSection:u,onOpenSettings:h,onCompleteWorkout:m,onExitEarly:p})=>e?(0,n.jsxs)("div",{className:`${l.lbk} ${l.qGl}`,"data-testid":"pause-menu",children:[(0,n.jsxs)("div",{className:l.OVy,children:[(0,n.jsx)("div",{className:l.Bmr,children:"Paused"}),(0,n.jsxs)("div",{className:l.i$j,children:[(0,n.jsxs)("button",{type:"button",className:l.SEl,onClick:c,disabled:!s,children:[(0,n.jsx)("span",{className:l.HDK,"aria-hidden":!0,children:(0,n.jsx)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"
1currentColor",children:(0,n.jsx)("path",{d:"M7 6h2v12H7zM18 6.8v10.4c0 .75-.82 1.2-1.45.8L9.8 12.8a.96.96 0 010-1.6L16.55 6c.63-.4 1.45.05 1.45.8z"})})}),(0,n.jsx)("span",{className:l.c2w,children:a})]}),(0,n.jsx)("button",{type:"button",className:l.mJu,style:{backgroundColor:"#FFFFFF"},onClick:o,"aria-label":"Resume workout",children:(0,n.jsx)("svg",{width:"42",height:"42",viewBox:"0 0 24 24",fill:"#0B0C0D","aria-hidden":!0,children:(0,n.jsx)("path",{d:"M8.35 5.72c0-.9 1-1.44 1.75-.95l8.7 5.8c.7.47.7 1.5 0 1.96l-8.7 5.8c-.75.5-1.75-.04-1.75-.94V5.72z"})})}),(0,n.jsxs)("button",{type:"button",className:l.SEl,onClick:d,disabled:!r,children:[(0,n.jsx)("span",{className:l.HDK,"aria-hidden":!0,children:(0,n.jsx)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"currentColor",children:(0,n.jsx)("path",{d:"M15 6h2v12h-2zM6 6.8v10.4c0 .75.82 1.2 1.45.8l6.75-5.2a.96.96 0 000-1.6L7.45 6C6.82 5.6 6 6.05 6 6.8z"})})}),(0,n.jsx)("span",{className:l.c2w,children:i})]})]}),(0,n.jsxs)("div",{className:l.rTV,children:[(0,n.jsxs)("button",{type:"button",className:l.kzh,onClick:u,"aria-label":"Restart section",children:[(0,n.jsx)("span",{className:l.HDK,"aria-hidden":!0,children:(0,n.jsx)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"currentColor",children:(0,n.jsx)("path",{d:"M12 5V1.5L7.2 6.3 12 11V7.5c3.03 0 5.5 2.47 5.5 5.5S15.03 18.5 12 18.5 6.5 16.03 6.5 13H4.5c0 4.14 3.36 7.5 7.5 7.5s7.5-3.36 7.5-7.5S16.14 5 12 5z"})})}),(0,n.jsx)("span",{className:l.mVI,children:"Restart section"})]}),(0,n.jsxs)("button",{type:"button",className:l.kzh,onClick:h,"aria-label":"Workout settings","data-testid":"pause-settings-button",children:[(0,n.jsx)("span",{className:l.HDK,"aria-hidden":!0,children:(0,n.jsx)("svg",{width:"22",height:"22",viewBox:"0 0 24 24",fill:"currentColor",children:(0,n.jsx)("path",{d:"M3 17v2h6v-2H3zM3 5v2h10V5H3zm10 16v-2h8v-2h-8v-2h-2v6h2zM7 9v2H3v2h4v2h2V9H7zm14 4v-2H11v2h10zm-6-4h2V7h4V5h-4V3h-2v6z"})})}),(0,n.jsx)("span",{className:l.mVI,children:"Settings"})]})]})]}),(0,n.jsxs)("div",{className:l.glq,style:{backgroundColor:t},children:[(0,n.jsxs)("button",{type:"button",className:l.n9h,onClick:m,children:[(0,n.jsx)("span",{"aria-hidden":!0,children:"✓"})," Complete workout"]}),(0,n.jsxs)("button",{type:"button",className:`${l.n9h} ${l.yTR}`,onClick:p,children:[(0,n.jsx)("span",{"aria-hidden":!0,children:"✕"})," Exit workout early"]})]})]}):null;var v=s(74553),w=s(90254),f=s(18776),b=s(73349);let j=/\b(rpe|effort|exertion|intensity)\b/i,y=/^\s*notes?\s*$/i,k=({open:e,onClose:t,exercise:s,cardIndex:a,round:c,exerciseIndex:d,prefillTargets:u,existingResult:h,customComponents:m=[],themeColor:p,secondaryColor:x,showHandle:g=!1,trackEffort:k=!1,lastEntry:N,appId:S,recordingsUserId:C,visibleHistoryMetrics:$,historyRequestNonce:M=0,onSave:I,onPersonalRecordChange:R})=>{let[E,A]=(0,r.useState)(""),[L,F]=(0,r.useState)(""),[T,z]=(0,r.useState)(void 0),[P,V]=(0,r.useState)(""),[U,B]=(0,r.useState)(!1),[W,O]=(0,r.useState)({}),[H,D]=(0,r.useState)(!1),[G,_]=(0,r.useState)(!1),[q,K]=(0,r.useState)([]),Z=(0,r.useRef)(""),Q=(0,r.useRef)(""),X=(0,r.useRef)(void 0),J=(0,r.useRef)(""),Y=(0,r.useRef)({}),ee=(0,r.useRef)(null),et=(0,r.useRef)(null),es=(0,r.useRef)(null),en=(0,r.useRef)("");(0,r.useEffect)(()=>{M>0&&_(!0)},[M]),(0,r.useEffect)(()=>{e||_(!1)},[e]);let er=N?.lastSession,ea=(0,r.useMemo)(()=>(0,i.NG)(er,c),[er,c]),ei=(0,r.useMemo)(()=>m.filter(e=>!((e,t)=>!!t&&("sliderInput"===e.type?j.test(e.title??"")||j.test(e.sliderUnit??""):"openInput"===e.type&&y.test(e.title??"")))(e,k)),[m,k]);(0,r.useEffect)(()=>()=>{ee.current&&window.clearTimeout(ee.current),et.current&&window.clearTimeout(et.current)},[]);let el=s?.weight?.unit??s?.weightUnit??(h?.weightUnit?(0,i.fE)(h.weightUnit):void 0)??ea?.weightUnit??N?.preferredWeightUnit??"lbs",eo=(0,r.useCallback)(e=>{if(e){if("number"==typeof e.weightValue){let t=(0,i.fE)(e.weightUnit);return t===el?e.weightValue:(0,v.C6)(e.weightValue,t,el)}if("number"==typeof e.weightKg)return"kg"===el?e.weightKg:(0,v.C6)(e.weightKg,"kg","lbs")}},[el]);if((0,r.useEffect)(()=>{if(!e){es.current=null;return}let t=`${a}:${c}:${d}
1:${s?.name??""}`;if(es.current===t)return;es.current=t;let n=s?.reps!==void 0,r=s?.weight?.value!==void 0,l=h?.reps??(u&&n?s?.reps:void 0)??(n?void 0:ea?.reps),o=h?.weightValue??(u&&r?s?.weight?.value:void 0)??(r?void 0:eo(ea)),m=null!=l?String(l):"",p=null!=o?(0,i.ZV)(o):"";Z.current=m,Q.current=p;let x=h?.rpe;X.current=x;let g=h?.notes??"";J.current=g;let v={...h?.customInputs||{}};Y.current=v,A(m),F(p),z(x),V(g),B(g.trim().length>0),O(v),D(!1),K([]),en.current=""},[e,a,c,d,s,h,u,ea,eo]),!e||!s)return null;let ec=!!s.weight||!!s.weightUnit||h?.weightValue!==void 0||void 0!==eo(ea),ed=(0,o.VZ)(s),eu=er?(0,i.C$)(er,{displayUnit:el}):"",eh=(e,t,s)=>{let n=Number(e);return String(Math.max(s,(Number.isFinite(n)&&""!==e?n:0)+t))},em=e=>{if(""===e)return;let t=Number(e);return Number.isFinite(t)?t:void 0},ep=(e,t,n=Y.current,r=X.current,l=J.current)=>{let o=ec?em(t):void 0,u=em(e),h=l.trim().slice(0,500);I({cardIndex:a,round:c,exerciseIndex:d,exerciseName:s.name,exerciseId:s.exerciseId,reps:u,weightValue:o,weightUnit:void 0!==o?el:void 0,rpe:k?r:void 0,notes:k&&h?h:void 0,source:"logged",customInputs:Object.keys(n).length>0?n:void 0});let m=(0,i.yI)({reps:u,weightValue:o,weightUnit:el},N);K(m),(e=>{let t=e.join(",");t!==en.current&&(en.current=t,R?.(e))})(m),D(!0),ee.current&&window.clearTimeout(ee.current),ee.current=window.setTimeout(()=>D(!1),1800)},ex=e=>{Z.current=e,A(e),ep(e,Q.current)},eg=e=>{Q.current=e,F(e),ep(Z.current,e)},ev=()=>{et.current&&(window.clearTimeout(et.current),et.current=null,ep(Z.current,Q.current,Y.current,X.current,J.current))},ew=(e,t)=>{let s={...Y.current,[String(e)]:t};Y.current=s,O(s),ep(Z.current,Q.current,s)},ef=()=>{ev(),t()},eb=0===q.length?null:q.includes("weight")||q.includes("e1rm")?"New PR":q.includes("reps")?"Rep PR":"New PR";return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("div",{className:l.g26,onClick:ef}),(0,n.jsxs)("div",{className:`${l.w$g} ${G?l.$54:""} ${l.qGl}`,style:{backgroundColor:x},"data-testid":"track-results-drawer",children:[g&&(0,n.jsx)("div",{className:l.o2B,"data-testid":"drawer-handle"}),(0,n.jsxs)("div",{className:l.fF,children:[(0,n.jsxs)("div",{style:{minWidth:0},children:[(0,n.jsx)("div",{className:l.cGD,children:s.name}),(0,n.jsxs)("div",{className:l.kdO,children:["Round ",c," results"]})]}),(0,n.jsxs)("div",{className:l.Ws3,children:[eb&&(0,n.jsxs)("span",{className:`${l.uOX} ${l.qGl}`,style:{backgroundColor:p},role:"status","data-testid":"drawer-pr-chip",children:[(0,n.jsx)("svg",{width:"11",height:"11",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":!0,children:(0,n.jsx)("path",{d:"M12 2l2.9 6.3 6.9.8-5.1 4.7 1.4 6.8L12 17.2 5.9 20.6l1.4-6.8L2.2 9.1l6.9-.8z"})}),eb]}),H&&(0,n.jsxs)("span",{className:`${l.NcE} ${l.qGl}`,role:"status",children:[(0,n.jsx)("svg",{width:"11",height:"11",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":!0,children:(0,n.jsx)("path",{d:"M9 16.2l-3.5-3.5-1.4 1.4L9 19 20 8l-1.4-1.4L9 16.2z"})}),"Saved"]}),(0,n.jsx)("button",{type:"button",className:l.O0m,onClick:ef,"aria-label":"Close log",children:"✕"})]})]}),(0,n.jsxs)("div",{className:l.oHc,children:[(0,n.jsx)("div",{className:l.sPG,children:(0,n.jsxs)("div",{className:l.UrA,children:[(0,n.jsx)("button",{type:"button",className:l.wUM,onClick:()=>ex(eh(Z.current,-1,0)),"aria-label":"Fewer reps",children:"-"}),(0,n.jsx)("input",{className:l.s1L,value:E,inputMode:"numeric",placeholder:"Add your reps",onChange:e=>ex(e.target.value.replace(/[^0-9]/g,"")),style:{textAlign:"center"}}),(0,n.jsx)("span",{className:l.mVb,children:"reps"}),(0,n.jsx)("button",{type:"button",className:l.wUM,onClick:()=>ex(eh(Z.current,1,0)),"aria-label":"More reps",children:"+"})]})}),ed&&ed.max>ed.min&&(0,n.jsxs)("div",{className:l.Z6b,"data-testid":"rep-range-hint",children:["Target ",ed.min,"-",ed.max," reps"]}),ec&&(0,n.jsx)("div",{className:l.sPG,children:(0,n.jsxs)("div",{className:l.UrA,children:[(0,n.jsx)("button",{type:"button",className:l.wUM,onClick:()=>eg(eh(Q.current,-5,0)),"aria-label":"Less weight",children:"-"}),(0,n.jsx)("input",{className:l.s1L,value:L,inputMode:"decimal",placeholder:"Add your weight",onCh
1ange:e=>eg(e.target.value.replace(/[^0-9.]/g,"")),style:{textAlign:"center"}}),(0,n.jsx)("span",{className:l.mVb,children:el}),(0,n.jsx)("button",{type:"button",className:l.wUM,onClick:()=>eg(eh(Q.current,5,0)),"aria-label":"More weight",children:"+"})]})}),eu&&(0,n.jsxs)("div",{className:l.qY$,"data-testid":"drawer-last-time",children:[(0,n.jsxs)("span",{className:l.VXc,children:["Last time: ",eu]}),ea&&(0,n.jsx)("button",{type:"button",className:l.csN,onClick:()=>{if(!ea)return;let e="number"==typeof ea.reps?String(ea.reps):Z.current,t=eo(ea),s=void 0!==t?(0,i.ZV)(t):Q.current;Z.current=e,Q.current=s,A(e),F(s),ep(e,s)},children:"Use last time"})]}),k&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(w.y,{value:T,themeColor:p,onChange:e=>{X.current=e,z(e),ep(Z.current,Q.current,Y.current,e)}}),U?(0,n.jsxs)("div",{className:l.c_3,children:[(0,n.jsx)("label",{className:l.R9Z,htmlFor:"workout-log-effort-note",children:"Note"}),(0,n.jsx)("textarea",{id:"workout-log-effort-note",className:l.U4$,value:P,maxLength:500,placeholder:"How did it feel?",onChange:e=>(e=>{let t=e.slice(0,500);J.current=t,V(t),ep(Z.current,Q.current,Y.current,X.current,J.current)})(e.target.value),onBlur:ev})]}):(0,n.jsxs)("button",{type:"button",className:l.Ssz,onClick:()=>B(!0),children:[(0,n.jsxs)("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[(0,n.jsx)("path",{d:"M12 20h9"}),(0,n.jsx)("path",{d:"M16.5 3.5a2.1 2.1 0 013 3L7 19l-4 1 1-4L16.5 3.5z"})]}),"Add a note"]})]}),ei.map(e=>{let t=String(e.componentIndex),s=W[t]??"";if("openInput"===e.type)return(0,n.jsxs)("div",{className:l.c_3,children:[e.title&&(0,n.jsx)("label",{className:l.R9Z,htmlFor:`workout-log-${t}`,children:e.title}),(0,n.jsx)("textarea",{id:`workout-log-${t}`,className:l.U4$,value:s,placeholder:e.placeholder||"Add notes…",onChange:t=>ew(e.componentIndex,t.target.value)})]},t);if("sliderInput"===e.type){let r=e.sliderMin??0,a=e.sliderMax??10,i=""===s?r:Number(s),o=Number.isFinite(i)?i:r,c=a>r?(o-r)/(a-r)*100:0;return(0,n.jsxs)("div",{className:l.c_3,children:[(0,n.jsxs)("div",{className:l.CMs,children:[(0,n.jsx)("span",{className:l.R9Z,children:e.title||"Value"}),(0,n.jsxs)("span",{className:l.YYj,children:[o,e.sliderUnit?` ${e.sliderUnit}`:""]})]}),(0,n.jsx)("input",{className:l.X1h,type:"range",min:r,max:a,step:e.sliderStep??1,value:o,"aria-label":e.title||"Workout value",onChange:t=>ew(e.componentIndex,t.target.value),style:{background:`linear-gradient(to right, ${p} 0%, ${p} ${c}%, rgba(255,255,255,0.18) ${c}%, rgba(255,255,255,0.18) 100%)`}}),(0,n.jsxs)("div",{className:l.Ge3,children:[(0,n.jsx)("span",{children:r}),(0,n.jsx)("span",{children:a})]})]},t)}let r=e.sliderStep??1,a=e.measurementMetric||e.sliderUnit||"units";return(0,n.jsxs)("div",{className:l.c_3,children:[e.title&&(0,n.jsx)("span",{className:l.R9Z,children:e.title}),(0,n.jsx)("div",{className:l.sPG,children:(0,n.jsxs)("div",{className:l.UrA,children:[(0,n.jsx)("button",{type:"button",className:l.wUM,onClick:()=>ew(e.componentIndex,eh(s,-r,0)),"aria-label":`Less ${e.title||a}`,children:"-"}),(0,n.jsx)("input",{className:l.s1L,value:s,inputMode:"decimal",placeholder:e.placeholder||"Add value",onCh
1ange:t=>ew(e.componentIndex,t.target.value.replace(/[^0-9.-]/g,"")),style:{textAlign:"center"}}),(0,n.jsx)("span",{className:l.mVb,children:a}),(0,n.jsx)("button",{type:"button",className:l.wUM,onClick:()=>ew(e.componentIndex,eh(s,r,0)),"aria-label":`More ${e.title||a}`,children:"+"})]})})]},t)}),N?.exerciseKey&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("button",{type:"button",className:l.mG3,onClick:()=>_(e=>!e),"aria-expanded":G,"data-testid":"drawer-history-toggle",children:[(0,n.jsx)("span",{children:"History & Details"}),(0,n.jsx)("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":!0,style:{transform:G?"rotate(180deg)":void 0,transition:"transform 160ms ease"},children:(0,n.jsx)("path",{d:"M7.4 8.6L12 13.2l4.6-4.6L18 10l-6 6-6-6z"})})]}),G&&(0,n.jsx)("div",{className:l.i3M,"data-testid":"drawer-history-panel",children:(0,n.jsx)(b.V,{appId:S??"",exerciseKey:N.exerciseKey,entry:(0,f.vC)(N,S??"workout"),recordingsUserId:C,visibleMetrics:$,themeColor:p,secondaryColor:x,compact:!0,embedded:!0})})]})]})]})]})},N=({posterUrl:e,className:t})=>{let[s,a]=(0,r.useState)(null);return e&&s!==e?(0,n.jsx)("img",{className:t,src:e,alt:"",onError:()=>a(e??null)}):(0,n.jsx)("div",{className:t,"data-testid":"workout-thumbnail-fallback",style:{display:"flex",alignItems:"center",justifyContent:"center"},children:(0,n.jsx)("svg",{width:"22",height:"22",viewBox:"0 0 24 24",fill:"rgba(255,255,255,0.5)","aria-hidden":!0,children:(0,n.jsx)("path",{d:"M20.57 14.86L22 13.43 20.57 12 17 15.57 8.43 7 12 3.43 10.57 2 9.14 3.43 7.71 2 5.57 4.14 4.14 2.71 2.71 4.14l1.43 1.43L2 7.71l1.43 1.43L2 10.57 3.43 12 7 8.43 15.57 17 12 20.57 13.43 22l1.43-1.43L16.29 22l2.14-2.14 1.43 1.43 1.43-1.43-1.43-1.43L22 16.29z"})})})},S=[0,5,10,30,60],C={coachVoiceEnabled:"workout.player.coachVoiceEnabled",countdownSoundsEnabled:"workout.player.countdownSoundsEnabled",extraPrepSeconds:"workout.player.extraPrepSeconds"},$={coachVoiceEnabled:!0,countdownSoundsEnabled:!0,extraPrepSeconds:0},M=new Set,I=$,R=!1,E=(e,t)=>{let s=window.localStorage.getItem(e);return null===s?t:"true"===s},A=()=>{try{return{coachVoiceEnabled:E(C.coachVoiceEnabled,$.coachVoiceEnabled),countdownSoundsEnabled:E(C.countdownSoundsEnabled,$.countdownSoundsEnabled),extraPrepSeconds:(()=>{let e=Number(window.localStorage.getItem(C.extraPrepSeconds));return S.includes(e)?e:$.extraPrepSeconds})()}}catch{return $}},L=()=>{R||(R=!0,I=A())},F=()=>(L(),I),T=()=>$,z=()=>M.forEach(e=>e()),P=e=>{M.add(e);let t=e=>{(null===e.key||Object.values(C).includes(e.key))&&(I=A(),z())};return window.addEventListener("storage",t),()=>{M.delete(e),window.removeEventListener("storage",t)}},V=(e,t)=>{if(L(),I[e]!==t){I={...I,[e]:t};var s=C[e],n=String(t);try{window.localStorage.setItem(s,n)}catch{}z()}},U=()=>[(0,r.useSyncExternalStore)(P,F,T),(0,r.useCallback)(V,[])],B=({open:e,onClose:t,themeColor:s,isWorkoutActive:r=!1})=>{let[a,i]=U();if(!e)return null;let o=(e,t,r)=>{let o=a[r];return(0,n.jsxs)("div",{className:l.C0W,children:[(0,n.jsxs)("span",{className:l.ToJ,children:[(0,n.jsx)("span",{className:l.CBW,children:e}),(0,n.jsx)("span",{className:l._2P,children:t})]}),(0,n.jsx)("button",{type:"button",role:"switch","aria-checked":o,"aria-label":e,className:l.COY,style:o?{backgroundColor:s}:void 0,onClick:()=>i(r,!o),children:(0,n.jsx)("span",{className:`${l.yu3} ${o?l.t80:""}`,"aria-hidden":!0})})]})},c=0===a.extraPrepSeconds?"Uses the workout's own get-ready time. You can still add 5s during any prep.":`Adds ${a.extraPrepSeconds}s to every get-ready segment${r?" from the next one on":""}.`;return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("button",{type:"button",className:l.kem,onClick:t,"aria-label":"Close workout settings"}),(0,n.jsxs)("div",{className:`${l.bq3} ${l.qGl}`,role:"dialog","aria-modal":"true","aria-label":"Workout settings","data-testid":"workout-settings",children:[(0,n.jsxs)("div",{className:l.VuK,children:[(0,n.jsxs)("span",{className:l.ujz,children:[(0,n.jsx)("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":!0,children:(0,n.jsx)("path",{d:"M3 17v2h6v-2H3zM3 5v2h10V5H3zm10 16v-2h8v-2h-8v-2h-2v6h2zM7 9v2H3v2h4v2h2V9H7zm14 4v-2H11v2h10zm-6-4h2V7h4V5h-4V3h-2v6z"})}),"Workout settings"]}),(0,n.jsx)("button",{type:"button",className:l.Uzv,onClick:t,children:"Done"})]}),(0,n.jsxs)("div",{className:l.OMm,children:[(0,n.jsxs)("div",{className:l.pL1,
1children:[(0,n.jsx)("span",{className:l.dRT,children:"Coach audio"}),(0,n.jsxs)("div",{className:l.Mku,children:[o("Coach voice","Spoken cues during the workout. Asking the coach a question still answers out loud.","coachVoiceEnabled"),(0,n.jsx)("div",{className:l.RiO}),o("Countdown sounds","The 3-2-1 ticks before each movement ends.","countdownSoundsEnabled")]})]}),(0,n.jsxs)("div",{className:l.pL1,children:[(0,n.jsx)("span",{className:l.dRT,children:"Pace"}),(0,n.jsx)("div",{className:l.Mku,children:(0,n.jsxs)("div",{className:l.OS7,children:[(0,n.jsxs)("span",{className:l.ToJ,children:[(0,n.jsx)("span",{className:l.CBW,children:"Extra time before each movement"}),(0,n.jsx)("span",{className:l._2P,children:c})]}),(0,n.jsx)("div",{className:l.C1t,children:S.map(e=>{let t=a.extraPrepSeconds===e;return(0,n.jsx)("button",{type:"button",className:`${l.oub} ${t?l.Xqe:""}`,"aria-label":`Extra prep time ${e} seconds`,"aria-pressed":t,onClick:()=>i("extraPrepSeconds",e),children:0===e?"+0s":`+${e}s`},e)})})]})})]}),(0,n.jsx)("span",{className:l.O_E,children:"Apple Health workout type, pausing your music, Bluetooth heart rate straps, and your heart rate zones are set in the installed iOS app."})]})]})]})};var W=s(21060);let O=null,H=()=>{let e=window.AudioContext||window.webkitAudioContext;return e?(O||(O=new e),O):null},D=()=>{let e=H();e&&"suspended"===e.state&&e.resume()},G=(e,t,s,n,r="sine")=>{let a=H();if(!a||"running"!==a.state)return;let i=a.createOscillator(),l=a.createGain();i.type=r,i.frequency.value=e;let o=a.currentTime+t;l.gain.setValueAtTime(0,o),l.gain.linearRampToValueAtTime(n,o+.01),l.gain.exponentialRampToValueAtTime(.001,o+s),i.connect(l),l.connect(a.destination),i.start(o),i.stop(o+s+.05)},_=()=>{G(784,0,.14,.18),G(1175,.14,.22,.18)},q=e=>"intro"===e.kind||"outro"===e.kind,K=["Warm up","Easy","Aerobic","Threshold","Max"],Z=["#8E9BAE","#4FC3F7","#66BB6A","#FFA726","#EF5350"],Q={percentMax:[.5,.6,.7,.8,.9],heartRateReserve:[.4,.6,.7,.8,.9]},X=((e={})=>{let t,s,n;null!=e.maxHeartRate?(t=e.maxHeartRate,s="custom"):null!=e.age?(t=(e=>null==e?190:Math.max(120,Math.round(208-.7*e)))(e.age),s="age"):(t=190,s="fallback");let r=e.restingHeartRate??null,a=e.model??"percentMax";if(e.zoneLowerBounds&&e.zoneLowerBounds.length===K.length)n=[...e.zoneLowerBounds],s="customZones";else if("heartRateReserve"===a&&null!=r&&t-r>=30){let e=t-r;n=Q.heartRateReserve.map(t=>Math.round(r+t*e))}else a="percentMax",n=Q.percentMax.map(e=>Math.round(e*t));return{maxHeartRate:t,restingHeartRate:r,model:a,source:s,lowerBounds:n}})({}),J=X.maxHeartRate,Y=e=>{let t=((e,t)=>{let s=1;for(let n=1;n<t.lowerBounds.length;n+=1)e>=t.lowerBounds[n]&&(s=n+1);return s})(e,X);return{bpm:e,zone:t,zoneColor:Z[Math.min(Math.max(t,1),Z.length)-1],zoneLabel:K[Math.min(Math.max(t,1),K.length)-1]}};var ee=s(39173);let et=(e,t)=>`${e}:${t}`,es=e=>e?.weight?`${e.weight.value} ${e.weight.unit}`:null,en=()=>(0,n.jsx)("svg",{width:"10",height:"10",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":!0,children:(0,n.jsx)("path",{d:"M3 17.25V21h3.75L17.8 9.94l-3.75-3.75L3 17.25zM20.7 7.04a1 1 0 000-1.41l-2.34-2.34a1 1 0 00-1.41 0l-1.83 1.83 3.75 3.75 1.83-1.83z"})}),er=({themeColor:e,onDone:t,isLastSetOfSection:s})=>(0,n.jsx)("div",{className:l.cnF,style:{width:148},children:(0,n.jsxs)("button",{type:"button",className:`${l.mOL} ${l.bGt}`,style:{backgroundColor:e},onClick:t,"aria-label":s?"Set done, finish section":"Set done, continue","data-testid":"self-paced-done",children:[(0,n.jsx)("svg",{width:"17",height:"17",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"3.2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:(0,n.jsx)("path",{d:"M5 12.5l4.5 4.5L19 7.5"})}),"Done"]})}),ea=({activityTitle:e,cards:t,config:s,themeColor:c,secondaryColor:u,coachName:h,coachImageUrl:m,coachAvatarMode:p="profile",generatedCuesByCard:v,demoVoiceCues:w,soundEnabled:f=!0,staticPreview:b=!1,heartRateDemo:j=!1,heartRateReading:y,initialCardIndex:S=0,initialResults:C=[],topPillSurfaces:$,mediaOverride:M,onExit:I,onWorkoutComplete:R,onSectionComplete:E,onResultsChange:A,onCardIndexChange:L,layout:F="compact",showLogDrawerHandle:T=!1,lastSessions:z,exerciseHistoryMetrics:P})=>{let V="manual"===s.flow?"manual":"continuous",[O]=U(),[H,K]=(e=>{let{cards:t,flow:s,initialCardIndex:n=0,initialResults:a=[],onWorkoutComplete:i,onSectionComplete:l,onResultsChange:c,soundEnabled:d=!0,countdownSoundsEnabled:u=!0,extraPrepSeconds:h=0,staticPreview:m=!1}=e,p=(0,r.useMemo)(()=>((e,t)=>{let s=0;return e.map(e=>{let n=(0,o.Mh)(e.workoutSet,t),r=n.reduce((e,t)=>
1e+t.plannedSec,0),a={input:e,segments:n,durationSec:r,startOffsetSec:s};return s+=r,a}).filter(e=>e.segments.length>0)})(t,s),[t,s]),x=(0,r.useMemo)(()=>p.reduce((e,t)=>e+t.durationSec,0),[p]),[g,v]=(0,r.useState)(()=>Math.min(Math.max(0,n),Math.max(0,p.length-1))),[w,f]=(0,r.useState)(()=>{if(!m)return 0;let e=p[Math.min(Math.max(0,n),Math.max(0,p.length-1))]?.segments.findIndex(e=>"work"===e.kind);return void 0!==e&&e>=0?e:0}),[b,j]=(0,r.useState)(0),[y,k]=(0,r.useState)(0),[N,S]=(0,r.useState)("manual"===s?"awaitingSectionStart":"running"),[C,$]=(0,r.useState)(()=>a),[M,I]=(0,r.useState)({}),R=(0,r.useRef)(null),E=(0,r.useRef)(null),A=(0,r.useRef)(!1),L=(0,r.useRef)(a);L.current=C;let F=p[g]??null,T=F?.segments[w]??null,z=(0,r.useMemo)(()=>x+Object.values(M).reduce((e,t)=>e+t,0),[x,M]),P=M[et(g,w)]??0,V=(T?.plannedSec??0)+P,U=T?.untimed===!0,B=(0,r.useCallback)(e=>{let t=`${e}:`;I(e=>{let s=Object.fromEntries(Object.entries(e).filter(([e])=>!e.startsWith(t)));return Object.keys(s).length===Object.keys(e).length?e:s})},[]),W=(0,r.useCallback)(e=>{d&&e&&("work"===e.kind?(G(660,0,.12,.16),G(990,.12,.16,.16)):("rest"===e.kind||"roundRest"===e.kind)&&G(440,0,.18,.12))},[d]),O=(0,r.useCallback)(()=>{A.current||(A.current=!0,S("completed"),d&&(G(659,0,.16,.2),G(830,.16,.16,.2),G(1109,.32,.3,.2)),i?.(L.current))},[i,d]),H=(0,r.useCallback)((e,t=0,n=!1)=>{l?.(e,L.current),d&&!n&&_();let r=e+1;if(r>=p.length)return void O();v(r),f(0),j("manual"===s?0:Math.max(0,t)),B(r),"manual"===s?S("awaitingSectionStart"):n||W(p[r]?.segments[0]??null)},[B,O,s,l,W,p,d]),D=(0,r.useCallback)((e=0,t=!1)=>{if(!F)return;let n=w+1;if(n<F.segments.length){f(n),j(Math.max(0,e)),t||W(F.segments[n]);return}if(j(0),"manual"===s){S("awaitingSectionComplete"),d&&!t&&_();return}H(g,e,t)},[H,g,F,s,W,w,d]);(0,r.useEffect)(()=>{if("running"!==N||m){R.current=null;return}let e=window.setInterval(()=>{let e={monotonicMs:performance.now(),wallMs:Date.now()},t=R.current??e;R.current=e;let s=Math.max(Math.max(0,e.monotonicMs-t.monotonicMs),Math.max(0,e.wallMs-t.wallMs))/1e3;j(e=>e+s)},200);return()=>window.clearInterval(e)},[N,m]),(0,r.useEffect)(()=>{if("running"!==N||!T||m||U)return;let e=V-b;if(e<=0){E.current=null;let t=Math.max(0,-e);D(t,t>.4);return}let t=Math.ceil(e);d&&u&&t<=3&&t>=1&&E.current!==t&&V>5&&(E.current=t,G(880,0,.09,.12,"square"))},[D,u,V,U,N,T,b,d,m]),(0,r.useEffect)(()=>{if(m||h<=0||"running"!==N||T?.kind!=="prep")return;let e=et(g,w);I(t=>e in t?t:{...t,[e]:h})},[g,h,N,y,T?.kind,w,m]);let q=(0,r.useMemo)(()=>F?F.segments.slice(0,w).reduce((e,t,s)=>e+t.plannedSec+(M[et(g,s)]??0),0):0,[g,F,M,w]),K=(0,r.useMemo)(()=>q+Math.min(b,V),[V,b,q]),Z=(0,r.useMemo)(()=>F?"completed"===N?z:p.slice(0,g).reduce((e,t,s)=>e+t.segments.reduce((e,t,n)=>e+t.plannedSec+(M[et(s,n)]??0),0),0)+K:"completed"===N?z:0,[K,g,F,N,M,p,z]),Q=(0,r.useMemo)(()=>{if(!F)return null;for(let e=g;e<p.length;e+=1){let t=e===g?w+1:0,s=p[e].segments.slice(t).find(e=>"work"===e.kind);if(s)return{cardIndex:e,segment:s}}return null},[g,F,w,p]);return[{cards:p,totalDurationSec:z,cardIndex:g,sectionRunId:y,segmentIndex:w,segment:T,segmentElapsedSec:U?b:Math.min(b,V),segmentRemainingSec:U?0:Math.max(0,V-b),segmentPlannedSec:V,segmentStartOffsetSec:q,isHoldingForDone:U&&("running"===N||"paused"===N),cardElapsedSec:K,overallElapsedSec:Z,overallProgress:z>0?Math.min(1,Z/z):0,phase:N,isRunning:"running"===N,isReconciling:"running"===N&&!U&&b-V>.4,results:C,nextWork:Q,isLastSegmentOfCard:!!F&&w>=F.segments.length-1},{start:(0,r.useCallback)(()=>{S("manual"===s?"awaitingSectionStart":"running"),"manual"!==s&&W(p[0]?.segments[0]??null)},[s,W,p]),toggle:(0,r.useCallback)(()=>{S(e=>"running"===e?"paused":"paused"===e?"running":e)},[]),pause:(0,r.useCallback)(()=>{S(e=>"running"===e?"paused":e)},[]),resume:(0,r.useCallback)(()=>{S(e=>"paused"===e?"running":e)},[]),completeSegmentEarly:(0,r.useCallback)(()=>{("running"===N||"paused"===N)&&(E.current=null,D(),"paused"===N&&S("running"))},[D,N]),goToNextExercise:(0,r.useCallback)(()=>{if(!F||"completed"===N)return;let e=F.segments.findIndex((e,t)=>t>w&&"work"===e.kind);if(e>=0){E.current=null,f(e),j(0),"running"===N&&W(F.segments[e]);return}H(g,0,"paused"===N)},[H,g,F,N,W,w]),goToPreviousExercise:(0,r.useCallback)(()=>
1{if(!F||"completed"===N)return;let e=-1;for(let t=w-1;t>=0;t-=1)if(F.segments[t]?.kind==="work"){e=t;break}if(e>=0){E.current=null,f(e),j(0),"running"===N&&W(F.segments[e]);return}g<=0||(v(g-1),f(0),j(0),B(g-1),"manual"===s&&S("awaitingSectionStart"))},[g,B,F,s,N,W,w]),skipToNextSection:(0,r.useCallback)(()=>{F&&"completed"!==N&&H(g)},[H,g,F,N]),goToPreviousSection:(0,r.useCallback)(()=>{"completed"===N||g<=0||(v(g-1),f(0),j(0),B(g-1),"manual"===s&&S("awaitingSectionStart"))},[g,B,s,N]),restartSection:(0,r.useCallback)(()=>{"completed"!==N&&(R.current=null,E.current=null,k(e=>e+1),f(0),j(0),B(g),"manual"===s?S("awaitingSectionStart"):(S("running"),W(F?.segments[0]??null)))},[g,B,F,s,N,W]),beginSection:(0,r.useCallback)(()=>{"awaitingSectionStart"===N&&(S("running"),W(F?.segments[0]??null))},[F,N,W]),confirmSectionComplete:(0,r.useCallback)(()=>{"awaitingSectionComplete"===N&&H(g)},[H,g,N]),addPrepTime:(0,r.useCallback)(e=>{if(T?.kind!=="prep"||e<=0)return;let t=et(g,w);I(s=>({...s,[t]:(s[t]??0)+e}))},[g,T?.kind,w]),adjustRestTime:(0,r.useCallback)(e=>{if(T?.kind!=="rest"&&T?.kind!=="roundRest"||0===e||"running"!==N&&"paused"!==N)return;let t=Math.ceil(Math.max(0,V-b));if(t<=0)return;let s=e<0?-Math.min(Math.abs(e),t):e,n=et(g,w);E.current=null,I(e=>{let t=(e[n]??0)+s;if(0===t){let t={...e};return delete t[n],t}return{...e,[n]:t}}),s<=-t&&(D(),"paused"===N&&S("running"))},[D,g,V,N,T?.kind,b,w]),completeWorkoutEarly:(0,r.useCallback)(()=>{O()},[O]),exitWithoutCompleting:(0,r.useCallback)(()=>{S("paused")},[]),logResult:(0,r.useCallback)(e=>{$(t=>{let s=[...t.filter(t=>t.cardIndex!==e.cardIndex||t.round!==e.round||t.exerciseIndex!==e.exerciseIndex),{...e,completedAt:new Date().toISOString()}];return L.current=s,c?.(e.cardIndex,s),s})},[c])}]})({cards:t,flow:V,config:s,initialCardIndex:S,initialResults:C,onWorkoutComplete:R,onSectionComplete:E,onResultsChange:A,soundEnabled:!b&&f,countdownSoundsEnabled:O.countdownSoundsEnabled,extraPrepSeconds:O.extraPrepSeconds,staticPreview:b}),[Z,Q]=(0,r.useState)(!1),[X,ea]=(0,r.useState)(!1),[ei,el]=(0,r.useState)(0),[eo,ec]=(0,r.useState)({}),[ed,eu]=(0,r.useState)({}),[eh,em]=(0,r.useState)({}),ep=H.cards[H.cardIndex]??null,ex=ep?.input.workoutSet??null,eg=H.segment,ev=eg&&ex?ex.exercises[eg.exerciseIndex]??null:null,ew=eg?.kind==="rest"||eg?.kind==="roundRest",ef=eg?.kind==="prep"&&"running"===H.phase,eb="awaitingSectionStart"===H.phase||ef,ej="awaitingSectionComplete"===H.phase,ey="completed"===H.phase,ek="paused"===H.phase,eN=(({enabled:e,exerciseCount:t,cycleKey:s})=>{let[n,a]=(0,r.useState)(0),i=Math.max(0,t);return((0,r.useEffect)(()=>{if(a(0),!e||i<=1)return;let t=window.setInterval(()=>{a(e=>(e+1)%i)},3500);return()=>window.clearInterval(t)},[s,e,i]),!e||i<=1)?0:n%i})({enabled:eb,exerciseCount:ex?.exercises.length??0,cycleKey:`${H.cardIndex}:${ep?.input.id??ep?.input.title??""}`}),eS=ex?.exercises[eN]??ev,eC=(0,r.useMemo)(()=>{if(!H.nextWork)return null;let e=H.cards[H.nextWork.cardIndex];return e?.input.workoutSet.exercises[H.nextWork.segment.exerciseIndex]??null},[H.cards,H.nextWork]),e$=(0,r.useMemo)(()=>!!ep?.segments.some((e,t)=>t<H.segmentIndex&&"work"===e.kind),[ep,H.segmentIndex]),eM=H.nextWork?.cardIndex===H.cardIndex?"Next exercise":"Next section",eI=eb?eS:ew?eC??ev:ev,eR=ew&&H.nextWork?H.cards[H.nextWork.cardIndex]??ep:ep,eE=(0,r.useMemo)(()=>(Array.isArray(ep?.input.raw?.components)?ep.input.raw.components:[]).flatMap((e,t)=>["metricInput","sliderInput","openInput"].includes(e?.type)?[{...e,componentIndex:t}]:[]),[ep]),eA=(({mode:e,segmentKind:t,phase:s,staticPreview:n})=>n?{coachAllowed:!1,videoAudible:!1}:"coach"===e?{coachAllowed:!0,videoAudible:!1}:{coachAllowed:"coachIntroThenVideo"===e&&"prep"===t,videoAudible:"running"===s&&"work"===t})({mode:(e=>"video"===e||"coachIntroThenVideo"===e?e:"coach")(ev?.workoutAudioMo
1de??ep?.input.raw?.workoutAudioMode),segmentKind:eg?.kind??null,phase:H.phase,staticPreview:b}),eL=!1!==s.audioCoach&&"continuous"===V&&eA.coachAllowed&&O.coachVoiceEnabled,{isSpeaking:eF}=(({state:e,enabled:t,generatedCuesByCard:s,demoVoiceCues:n,extraPrepSeconds:a=0})=>{let[i,l]=(0,r.useState)(!1),[o,c]=(0,r.useState)(null),d=(0,r.useRef)(new Set),u=(0,r.useRef)([]),h=(0,r.useRef)(null),m=(0,r.useRef)(!1),p=(0,r.useCallback)((e,t)=>{e!==m.current&&(e?window.AndroidWorkoutAudioFocus?.beginCoachCue():window.AndroidWorkoutAudioFocus?.endCoachCue()),m.current=e,l(e),c(e?t:null)},[]),x=(0,r.useMemo)(()=>{let t=e.cards[e.cardIndex]?.segments??[],r=e=>((e,t,s)=>{if(s<=0)return e;let n=0,r=0;for(let a of t)n+=a.plannedSec,"prep"===a.kind&&n<=e&&(r+=s);return e+r})(e,t,a),i=s?.[e.cardIndex];return i&&i.length>0?i.map((t,s)=>({id:`gen-${e.cardIndex}-${s}`,atSec:r(t.atSec),url:t.url,text:t.text??null,kind:t.kind})):(n??[]).filter(t=>t.cardIndex===e.cardIndex).map((t,s)=>({id:`demo-${e.cardIndex}-${s}`,atSec:r(t.atSec),url:void 0,text:t.text,kind:t.kind}))},[n,a,s,e.cardIndex,e.cards]),g=`${e.cardIndex}:${e.sectionRunId}`;(0,r.useEffect)(()=>{d.current=new Set,u.current=[],h.current?.pause(),h.current&&(h.current.currentTime=0),"speechSynthesis"in window&&window.speechSynthesis.cancel(),p(!1,null)},[g]),(0,r.useEffect)(()=>{t||(u.current=[],h.current?.pause(),h.current&&(h.current.currentTime=0),"speechSynthesis"in window&&window.speechSynthesis.cancel(),p(!1,null))},[t,p]);let v=(0,r.useCallback)((e,t)=>{h.current||(h.current=new Audio);let s=h.current;return s.src=e,s.onended=()=>p(!1,null),s.onerror=()=>p(!1,null),p(!0,t),s.play().catch(()=>p(!1,null)),!0},[p]),w=(0,r.useCallback)(e=>{if(!("speechSynthesis"in window))return!1;let t=new SpeechSynthesisUtterance(e);return t.rate=1.04,t.pitch=1,t.onend=()=>p(!1,null),t.onerror=()=>p(!1,null),p(!0,e),window.speechSynthesis.speak(t),!0},[p]),f=(0,r.useCallback)(e=>e.url?v(e.url,e.text):!!e.text&&w(e.text),[v,w]);return(0,r.useEffect)(()=>{if(!t||!e.isRunning||e.isReconciling)return;let s=e.isHoldingForDone?e.segmentStartOffsetSec+1:1/0,n=x.filter(t=>!d.current.has(t.id)&&e.cardElapsedSec>=t.atSec&&t.atSec<=s);if(0===n.length)return;let r=((e,t,s,n=4)=>{let r=e.filter(e=>e.atSec<=t).sort((e,t)=>e.atSec-t.atSec||e.id.localeCompare(t.id)),a=r.filter(q),i=r.filter(e=>!q(e));if(s)return{playNow:null,queue:a.map(e=>e.id),drop:i.map(e=>e.id)};if(a.length>0)return{playNow:a[0].id,queue:a.slice(1).map(e=>e.id),drop:i.map(e=>e.id)};let l=i.filter(e=>t-e.atSec<=n),o=l[l.length-1]?.id??null;return{playNow:o,queue:[],drop:i.map(e=>e.id).filter(e=>e!==o)}})(n,e.cardElapsedSec,m.current||u.current.length>0),a=new Map(n.map(e=>[e.id,e]));if(n.forEach(e=>d.current.add(e.id)),r.queue.forEach(e=>{let t=a.get(e);t&&!u.current.some(t=>t.id===e)&&u.current.push(t)}),r.playNow){let e=a.get(r.playNow);if(e&&!f(e))for(;u.current.length>0&&!m.current;){let e=u.current.shift();if(e&&f(e))break}}},[x,t,f,e.cardElapsedSec,e.isHoldingForDone,e.isReconciling,e.isRunning,e.sectionRunId,e.segmentStartOffsetSec]),(0,r.useEffect)(()=>{if(t&&e.isRunning&&!i&&0!==u.current.length)for(;u.current.length>0&&!m.current;){let e=u.current.shift();if(e&&f(e))break}},[t,i,f,e.isRunning]),(0,r.useEffect)(()=>{"speechSynthesis"in window&&("paused"===e.phase?(window.speechSynthesis.pause(),h.current?.pause()):"running"===e.phase?(window.speechSynthesis.resume(),h.current&&h.current.src&&!h.current.ended&&h.current.paused&&m.current&&h.current.play().catch(()=>void 0)):"completed"===e.phase&&(u.current=[],window.speechSynthesis.cancel(),h.current?.pause(),p(!1,null)))},[p,e.phase]),(0,r.useEffect)(()=>()=>{u.current=[],h.current?.pause(),window.AndroidWorkoutAudioFocus?.endCoachCue(),"speechSynthesis"in window&&window.speechSynthesis.cancel()},[]),{isSpeaking:i,currentCueText:o}})({state:H,enabled:eL,generatedCuesByCard:v,demoVoiceCues:w,extraPrepSeconds:O.extraPrepSeconds}),eT=(0,a.km)({audioCoachEnabled:eL,isSpeaking:eF,segmentKind:eg?.kind??null}),ez=((e,t,s)=>{let[n,a]=(0,r.useState)(null),i=(0,r.useRef)(88);return(0,r.useEffect)(()=>
1{if(!e)return;let n=window.setInterval(()=>{let e=(((e,t)=>{if(!t)return 92;switch(e){case"work":return 158;case"rest":case"roundRest":return 126;default:return 104}})(t,s)-i.current)*.08,n=(Math.random()-.5)*3;i.current=Math.max(58,Math.min(J,i.current+e+n)),a(Y(Math.round(i.current)))},1e3);return()=>window.clearInterval(n)},[e,s,t]),e?n:null})(j&&!b,eg?.kind??null,H.isRunning),eP=b&&j?Y(148):null,eV=y??eP??ez;(({phase:e,cardIndex:t,segmentIndex:s,segmentKind:n})=>{let a=(0,r.useRef)();(0,r.useEffect)(()=>{let r=`${e}:${t}:${s}:${n??"none"}`;if(a.current===r)return;let i=void 0===a.current;if(a.current=r,!i){if("completed"===e)return void(0,ee.KD)("complete");"running"===e&&("prep"===n?(0,ee.KD)("prep"):"work"===n?(0,ee.KD)("work"):("rest"===n||"roundRest"===n)&&(0,ee.KD)("rest"))}},[t,e,s,n])})({phase:b?"paused":H.phase,cardIndex:H.cardIndex,segmentIndex:H.segmentIndex,segmentKind:eg?.kind??null}),(0,r.useEffect)(()=>{b||D()},[b]),(0,r.useEffect)(()=>{L?.(H.cardIndex)},[L,H.cardIndex]);let eU=(0,r.useMemo)(()=>M??(0,W.F)(eI,eR?.input.raw),[eR,eI,M]),eB=(0,r.useMemo)(()=>{if(!H.nextWork)return null;let e=H.cards[H.nextWork.cardIndex];return(0,W.F)(eC,e?.input.raw)},[eC,H.cards,H.nextWork]),eW=(0,r.useMemo)(()=>{if(!H.nextWork)return"";let e=H.nextWork.cardIndex===H.cardIndex,t=H.cards[H.nextWork.cardIndex]?.input.workoutSet.rounds??1,s=e?[]:["Next section"];s.push(`Set ${H.nextWork.segment.round} of ${t}`);let n=es(eC);return n&&s.push(n),s.join(" \xb7 ")},[eC,H.cardIndex,H.cards,H.nextWork]),eO=eg?`${H.cardIndex}:${eg.round}:${eg.exerciseIndex}`:"",eH=(0,o.X4)(s,ex),eD=eg&&eH?z?.byRef(H.cardIndex,eg.exerciseIndex):void 0,eG=(0,r.useMemo)(()=>eg?(0,i.NG)(eD?.lastSession,eg.round):void 0,[eD,eg]),e_=void 0!==eG&&("number"==typeof eG.weightValue||"number"==typeof eG.weightKg),eq=(eO?eo[eO]:void 0)??ev?.reps??void 0,eK=eO&&void 0!==eo[eO]?String(eo[eO]):(0,o.KY)(ev)??String(eq??0),eZ=H.isHoldingForDone,eQ=(eO?ed[eO]:void 0)??ev?.weight?.value??void 0,eX=H.results.find(e=>eg&&e.cardIndex===H.cardIndex&&e.round===eg.round&&e.exerciseIndex===eg.exerciseIndex),eJ=void 0!==eq,eY=void 0!==eQ||ev?.weightUnit!==void 0||e_,e0=ev?.weight?.unit??ev?.weightUnit??eG?.weightUnit??"lbs",e1=eG?`Last time: ${(0,i.My)(eG,{displayUnit:e0})}`:null,e2=(0,r.useMemo)(()=>{if(!eX)return null;let e=[];void 0!==eX.reps&&e.push(`${eX.reps} ${1===eX.reps?"rep":"reps"}`),void 0!==eX.weightValue&&e.push(`${eX.weightValue} ${eX.weightUnit??"lbs"}`);let t=Object.values(eX.customInputs||{}).filter(e=>""!==e).length;return t>0&&e.push(`${t} custom`),eO&&eh[eO]&&e.push("PR"),e.length>0?e.join(" \xb7 "):null},[eX,eO,eh]),e4=(0,r.useCallback)(e=>$?.[e]==="secondary"?{backgroundColor:u}:void 0,[u,$]),e5=Math.round(100*H.overallProgress),e3=ex?.rounds??1,e6=eg?`Set ${eg.round} of ${e3}`:"",e7=(0,r.useCallback)(()=>{"running"===H.phase&&K.pause()},[K,H.phase]),e8=(0,r.useCallback)(e=>{K.logResult(e),eO&&(void 0!==e.reps&&ec(t=>({...t,[eO]:e.reps})),void 0!==e.weightValue&&eu(t=>({...t,[eO]:e.weightValue})))},[K,eO]),e9=(0,r.useCallback)(e=>{eO&&em(t=>{let s=e.length>0;return!!t[eO]===s?t:{...t,[eO]:s}})},[eO]),te=(0,r.useCallback)(()=>Q(!0),[]),tt=(0,r.useCallback)(()=>{eg&&ev&&"number"==typeof ev.durationSec&&e8({...eX,cardIndex:H.cardIndex,round:eg.round,exerciseIndex:eg.exerciseIndex,exerciseName:ev.name,exerciseId:ev.exerciseId,reps:eX?.reps??ev.reps,weightValue:eX?.weightValue??ev.weight?.value,weightUnit:eX?.weightUnit??ev.weight?.unit,durationSec:Math.max(1,Math.round(H.segmentElapsedSec)),source:eX?.source??"logged"}),K.completeSegmentEarly()},[K,ev,eX,e8,eg,H.cardIndex,H.segmentElapsedSec]);return ey?null:(0,n.jsxs)("div",{className:`${l.qC5} ${"desktop"===F?l.CgA:""}`,"data-testid":"workout-player","data-static-preview":b||void 0,"aria-hidden":b||void 0,style:b?{pointerEvents:"none"}:void 0,children:[(0,n.jsx)(x,{media:eU,dimmed:ew||eb||ej,heavyDim:ek,resting:ew,paused:ek,audioEnabled:eA.videoAudible,audioRunKey:`${H.cardIndex}:${H.sectionRunId}:${H.segmentIndex}`,staticPreview:b,holdFirstFrame:ew,desktopLayout:"desktop"===F,secondaryColor:u}),(0,n.jsx)("button",{type:"button",className:l.aJu,onClick:e7,"aria-label":"Pause workout",tabIndex:-1}),(0,n.jsxs)("div",{className:`${l.DOP} ${l._kF}`,children:[(0,n.jsxs)("div",{className:l.XVM,children:[(0,n.jsxs)("div",{className:l.GBe,children:[(0,n.jsxs)("span",{className:l.QMP,style:e4("total"),"data-testid":"total-readout",children:[(0,n.jsx)("span",{className:l.APr,children:"Total:"}),(0,n.jsx)("span",{className:l.rCd,children:(0,o.ei)(H.overallElapsedSec)}),(0,n.jsxs)("span",{className:l.R5P,children:["\xb7 ",e5,"%"]})]}),eV&&(0,n.jsxs)("span",{className:`${l.Nu6} ${l.bGt}`,tabIndex:0,children:[(0,n.jsxs)("span",{className:l.LxZ,style:e4("heartRate"),"data-testid":"hr-chip","aria-label":`Heart rate ${eV.bpm} beats per minute, zone ${eV.zone} (${eV.zoneLabel}).${y?"":" Demo reading in preview."}`,children:[(0,n.jsx)("span",{className:l.x8f,style:{color:eV.zoneColor},children:"♥"}),eV.bpm,(0,n.jsxs)("span",{style:{color:eV.zoneColor,fontWeight:700,fontSize:11},children:["Z",eV.zone]})]}),(0,n.jsx)("span",{className:l.uXu,role:"tooltip",children:"Demo reading. In iOS, heart rate and zones come from supported wearables like Apple Watch, WHOOP, and Oura."})]})]}),(0,n.jsxs)("div",{className:`${l.Nvl} ${l.bGt}`,children:["continuous"===V&&!ej&&(0,n.jsxs)("button",{type:"button",className:l.Zm4,onClick:K.goToNextExercise,"aria-label":eM,children:[(0,n.jsx)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"
1currentColor","aria-hidden":!0,style:{flexShrink:0},children:(0,n.jsx)("path",{d:"M6 18l8.5-6L6 6v12zM16 6v12h2V6h-2z"})}),(0,n.jsx)("span",{className:l.fpG,children:"Next"})]}),(0,n.jsx)("button",{type:"button",className:l.zAN,style:e4("menu"),onClick:K.pause,"aria-label":"Workout menu",children:"•••"})]})]}),(0,n.jsx)("div",{className:l.Cdd,children:H.cards.map((e,t)=>{let s=e.segments.map((e,t)=>({workSegment:e,segmentIndex:t})).filter(({workSegment:e})=>"work"===e.kind);return(0,n.jsx)("div",{className:l.uQQ,children:s.map(({workSegment:e,segmentIndex:s})=>{let r=t===H.cardIndex&&s===H.segmentIndex,a=t<H.cardIndex||t===H.cardIndex&&s<H.segmentIndex?1:r&&H.segmentPlannedSec>0?Math.min(1,H.segmentElapsedSec/H.segmentPlannedSec):0;return(0,n.jsxs)("div",{className:l.gZd,"aria-label":`Section ${t+1}, set ${e.round}, exercise ${e.exerciseIndex+1}`,children:[(0,n.jsx)("div",{className:l.Ahi,style:{width:`${100*a}%`}}),r&&(0,n.jsx)("span",{className:l.l69,style:{left:`${100*a}%`,backgroundColor:c}})]},`${e.round}:${e.exerciseIndex}:${s}`)})},e.input.id??t)})}),eb&&ex&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("div",{className:`${l.o4Q} ${l.qGl}`,children:[(0,n.jsxs)("span",{className:l.RIv,style:{color:c},children:["Preview of section ",H.cardIndex+1," of ",H.cards.length]}),(0,n.jsx)("h2",{className:l.Gf6,children:ex.setTitle||ep?.input.title}),ex.equipment&&ex.equipment.length>0&&(0,n.jsx)("span",{className:l.RIO,children:ex.equipment.map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" \xb7 ")}),(0,n.jsx)("div",{className:l.oKH,children:ex.exercises.map((e,t)=>(0,n.jsxs)("div",{className:`${l.WLn} ${t===eN?l.mSU:""}`,"data-preview-active":t===eN||void 0,children:[(0,n.jsxs)("span",{className:l.Dll,children:[(0,n.jsx)("span",{style:{color:c},children:ex.rounds>1?`${ex.rounds}x `:""}),(0,o.c1)(e)]}),(0,n.jsx)("span",{className:l.R5$,children:(()=>{let s=[es(e),(0,o.nK)(e)?"Self-paced":null,e.restAfterSec?`${e.restAfterSec}s rest`:null].filter(Boolean).join(" \xb7 "),r=eH?z?.byRef(H.cardIndex,t)?.lastSession:void 0,a=r?(0,i.C$)(r,{displayUnit:e.weight?.unit,includeRpe:!1}):"";return a?(0,n.jsxs)(n.Fragment,{children:[s?`${s} `:"",(0,n.jsxs)("span",{className:l.GL2,style:{color:`${c}D9`},"data-testid":"intro-last-session",children:[s?"\xb7 ":"","Last: ",a]})]}):s||" "})()})]},`${e.name}-${t}`))})]}),(0,n.jsx)("div",{className:l.n1q,children:ef?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("div",{className:l.rBj,children:[(0,n.jsx)("span",{className:l.D8V,children:"Starting in"}),(0,n.jsx)("span",{className:l.p9z,children:(0,o.ei)(H.segmentRemainingSec)})]}),(0,n.jsxs)("button",{type:"button",className:`${l.n0c} ${l.bGt}`,onClick:()=>K.addPrepTime(5),children:[(0,n.jsx)("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":!0,children:(0,n.jsx)("path",{d:"M12 8v5l3.5 2 .8-1.3-2.8-1.7V8H12zm0-6a10 10 0 100 20 10 10 0 000-20zm0 18a8 8 0 110-16 8 8 0 010 16z"})}),"Add 5s to prep time"]})]}):(0,n.jsx)("button",{type:"button",className:`${l.XPu} ${l.bGt}`,style:{backgroundColor:c,color:"#0B0C0D"},onClick:K.beginSection,children:"Start section"})})]}),!eb&&ew&&(0,n.jsxs)(n.Fragment,{children:[H.nextWork&&eC&&(0,n.jsxs)("div",{className:`${l.Fvu} ${l.qGl} ${l.bGt}`,children:[(0,n.jsx)(N,{className:l.Jrd,posterUrl:eB?.posterUrl}),(0,n.jsxs)("div",{className:l.T7p,children:[(0,n.jsx)("span",{className:l.W0I,style:{backgroundColor:`${c}29`,color:c},children:"Upcoming"}),(0,n.jsx)("span",{className:l.pAA,children:(0,o.c1)(eC)}),eW&&(0,n.jsx)("span",{className:l.Q97,children:eW})]}),(0,n.jsxs)("span",{className:l.cQ_,style:{backgroundColor:`${c}29`,color:c},children:[Math.ceil(H.segmentRemainingSec),"s"]})]}),(0,n.jsxs)("div",{className:l.aTv,children:[(0,n.jsx)("span",{className:l.N5B,children:"Rest"}),(0,n.jsxs)("div",{className:l.c4Q,children:[(0,n.jsxs)("button",{type:"button",className:`${l.ish} ${l.bGt}`,onClick:()=>K.adjustRestTime(-10),"aria-label":"Remove 10 seconds from rest",style:{color:c,backgroundColor:`${c}1F`},children:["−",10,"s"]}),(0,n.jsx)("span",{className:l.cy$,children:(0,o.ei)(H.segmentRemainingSec)}),(0,n.jsxs)("button",{type:"button",className:`${l.ish} ${l.bGt}`,onClick:()=>K.adjustRestTime(10),"aria-label":"Add 10 seconds to rest",style:{color:c,backgroundColor:`${c}1F`},children:["+",10,"s"]})]}),(0,n.jsx)("button",{type:"button",className:`${l.Zm4} ${l.bGt}`,onClick:K.completeSegmentEarly,style:{marginTop:6},children:"Skip rest"})]})]}),!eb&&!ew&&!ej&&eg?.kind==="work"&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("div",{className:l.WHg,children:[(0,n.jsxs)("span",{className:l.T2U,style:{color:c},children:[e6,eZ&&(0,n.jsxs)(n.Fragment,{children:[" ",(0,n.jsx)("span",{className:l._W4,style:{backgroundColor:`${c}29`,color:c},children:"Self-paced"})]})]}),(0,n.jsx)("h2",{className:l.onm,children:(0,o.c1)(ev)}),ev?.formCue&&(0,n.jsx)("span",{className:l.R5$,children:ev.formCue}),e1&&(0,n.jsxs)("button",{type:"button",className:`${l.s6e} ${l.eJU} ${l.bGt}`,style:{color:`${c}D9`},"data-testid":"active-last-time",onClick:()=>{K.pause(),Q(!0),el(e=>e+1)},"aria-label":`${e1}. Show history and details`,children:[e1,(0,n.jsx)("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"
1currentColor","aria-hidden":!0,children:(0,n.jsx)("path",{d:"M10 6L8.6 7.4 13.2 12l-4.6 4.6L10 18l6-6z"})})]})]}),(0,n.jsx)("div",{className:l.p7}),(0,n.jsxs)("div",{className:`${l.t4e} ${eZ?l.CEV:""}`,children:[(0,n.jsxs)("button",{type:"button",className:`${l.bOo} ${l.bGt} ${eJ?"":l.t1L}`,onClick:te,disabled:!eJ,"aria-label":eJ?"Edit reps in log":"Reps not tracked",children:[(0,n.jsx)("span",{className:l.a3o,children:eK}),(0,n.jsxs)("span",{className:l.n2b,children:["reps",eJ&&(0,n.jsx)(en,{})]})]}),eZ?(0,n.jsx)(er,{themeColor:c,onDone:tt,isLastSetOfSection:H.isLastSegmentOfCard}):(0,n.jsx)(d,{remainingSec:H.segmentRemainingSec,plannedSec:H.segmentPlannedSec,themeColor:c}),(0,n.jsxs)("button",{type:"button",className:`${l.bOo} ${l.bGt} ${eY?"":l.t1L}`,onClick:te,disabled:!eY,"aria-label":eY?"Edit weight in log":"Weight not tracked",children:[(0,n.jsx)("span",{className:l.a3o,children:eQ??0}),(0,n.jsxs)("span",{className:l.n2b,children:[e0,eY&&(0,n.jsx)(en,{})]})]})]})]}),ej&&(0,n.jsxs)("div",{className:`${l.aTv} ${l.qGl}`,children:[(0,n.jsxs)("span",{className:l.RIv,style:{color:c},children:["Section ",H.cardIndex+1," complete"]}),(0,n.jsx)("span",{className:l.Gf6,style:{textAlign:"center"},children:ex?.setTitle||ep?.input.title}),(0,n.jsx)("div",{style:{height:14}}),(0,n.jsx)("button",{type:"button",className:`${l.Jc_} ${l.bGt}`,style:{backgroundColor:c,color:"#0B0C0D",minWidth:200},onClick:K.confirmSectionComplete,children:"Complete & Next"})]}),!ej&&(0,n.jsx)("div",{className:l.bYs,children:(0,n.jsxs)("div",{className:`${l.sKk} ${l.bGt}`,style:{backgroundColor:u},onClick:te,role:"button",tabIndex:0,"data-testid":"log-bar",children:[(0,n.jsxs)("span",{className:l.gzz,children:[(0,n.jsx)("svg",{width:"15",height:"15",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":!0,children:(0,n.jsx)("path",{d:"M19 3H5a2 2 0 00-2 2v14a2 2 0 002 2h14a2 2 0 002-2V5a2 2 0 00-2-2zm-9 14H7v-2h3v2zm0-4H7v-2h3v2zm0-4H7V7h3v2zm7 8h-5v-2h5v2zm0-4h-5v-2h5v2zm0-4h-5V7h5v2z"})}),"Log"]}),(0,n.jsxs)("span",{className:l.gjD,style:{color:c},children:[e2?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("span",{className:l._jx,style:{backgroundColor:c},"aria-hidden":!0,children:"✓"}),e2]}):"Track results",(0,n.jsx)("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":!0,children:(0,n.jsx)("path",{d:"M7.4 15.4L12 10.8l4.6 4.6L18 14l-6-6-6 6z"})})]})]})})]}),(0,n.jsx)(a.Ch,{visible:eT,imageUrl:m,coachName:h,mode:p,theme
1Color:c,secondaryColor:u,className:ef?l.Nxr:void 0}),(0,n.jsx)(g,{open:ek,secondaryColor:u,canGoPrevious:e$||H.cardIndex>0,canGoNext:!!H.nextWork||H.cardIndex<H.cards.length-1,previousLabel:e$?"Previous exercise":"Previous section",nextLabel:eM,onResume:K.resume,onPrevious:K.goToPreviousExercise,onNext:K.goToNextExercise,onRestartSection:K.restartSection,onOpenSettings:()=>ea(!0),onCompleteWorkout:K.completeWorkoutEarly,onExitEarly:()=>I(H.results,H.cardIndex)}),(0,n.jsx)(B,{open:X,onClose:()=>ea(!1),themeColor:c,isWorkoutActive:!0}),(0,n.jsx)(k,{open:Z,onClose:()=>Q(!1),exercise:ev,cardIndex:H.cardIndex,round:eg?.round??1,exerciseIndex:eg?.exerciseIndex??0,prefillTargets:!1!==s.prefillTargets,existingResult:eX,customComponents:eE,themeColor:c,secondaryColor:u,showHandle:T,trackEffort:!0===s.trackEffort,lastEntry:eD,appId:z?.appId,recordingsUserId:z?.recordingsUserId,visibleHistoryMetrics:P,historyRequestNonce:ei,onSave:e8,onPersonalRecordChange:e9})]})};var ei=s(35696);let el=(e,t)=>{let s=e.playlist;return s?.url&&s.provider===t?s.url:"spotify"===t?s?.name&&"spotify"===s.provider?`https://open.spotify.com/search/${encodeURIComponent(s.name)}`:"https://open.spotify.com":s?.name&&"appleMusic"===s.provider?`https://music.apple.com/search?term=${encodeURIComponent(s.name)}`:"https://music.apple.com"},eo=({activityTitle:e,activityDescription:t,cards:s,config:a,themeColor:i,secondaryColor:c,platformLimitationTooltip:d,layout:u="compact",onBack:h,onStart:m})=>{let[p,x]=(0,r.useState)("overview"),[g,v]=(0,r.useState)(0),[w,f]=(0,r.useState)(null),[b,j]=(0,r.useState)(!1),y="manual"===a.flow?"manual":"continuous",k=(0,r.useMemo)(()=>s.map((e,t)=>{let s=(0,o.Mh)(e.workoutSet,y).reduce((e,t)=>e+t.plannedSec,0),n=(0,W.Q)(e.workoutSet.exercises[0]??null,e.raw);return{card:e,cardIndex:t,durationSec:s,poster:n}}).filter(e=>e.durationSec>0),[s,y]),S=a.totalDurationSec??k.reduce((e,t)=>e+t.durationSec,0),C=(0,o.Im)(S),$=(0,r.useMemo)(()=>{let e=new Set;return k.forEach(t=>(t.card.workoutSet.equipment??[]).forEach(t=>e.add(t.toLowerCase()))),Array.from(e)},[k]),M=k.reduce((e,t)=>e+t.card.workoutSet.rounds*Math.max(1,t.card.workoutSet.exercises.length),0),I=null===w?null:k.find(e=>e.cardIndex===w)??null,R=I?k.indexOf(I):-1,E=R>0?k.slice(0,R):[],A=E.reduce((e,t)=>e+t.durationSec,0),L=e=>{if(D(),f(null),v(e),!1!==a.musicPrompt)return void x("music");m(e)};return"music"===p?(0,n.jsxs)("div",{className:`${l.AI9} ${"desktop"===u?l.IUc:""}`,style:{background:`radial-gradient(130% 100% at 50% 0%, ${c} 0%, #06080A 82%)`},"data-testid":"workout-music-step",children:[(0,n.jsx)("button",{type:"button",className:l.DPz,onClick:()=>x("overview"),children:(0,n.jsx)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":!0,children:(0,n.jsx)("path",{d:"M15.4 7.4L14 6l-6 6 6 6 1.4-1.4L10.8 12z"})})}),(0,n.jsxs)("div",{className:`${l.yMF} ${l.qGl}`,children:[(0,n.jsxs)("div",{className:l.nEf,children:[(0,n.jsx)("h2",{className:l.i1S,children:"Put your music on"}),(0,n.jsxs)("div",{className:l.R7o,children:[(0,n.jsx)("a",{className:l.Pbd,href:el(a,"spotify"),target:"_blank",rel:"noreferrer",style:{textDecoration:"none"},"aria-label":"Open Spotify",children:(0,n.jsx)("img",{className:l.Ugv,src:"https://res.cloudinary.com/monthly/image/upload/v1785251390/studio_dx/apps_landingpage_common/Spotify_logo_with_text.svg.webp",alt:"Spotify"})}),(0,n.jsx)("a",{className:l.Pbd,href:el(a,"appleMusic"),target:"_blank",rel:"noreferrer",style:{textDecoration:"none"},"aria-label":"Open Apple Music",children:(0,n.jsx)("img",{className:l.Ugv,src:"https://res.cloudinary.com/monthly/image/upload/v1785251422/studio_dx/apps_landingpage_common/Apple_Music_logo.svg.webp",alt:"Apple Music",style:{filter:"invert(1)"}})})]}),(0,n.jsxs)("div",{className:l.RDE,children:[(0,n.jsx)("p",{className:l.k5b,children:"Play your own music for a better experience. Your coach will guide you, slightly lowering the music at the right moments."}),d&&(0,n.jsx)("div",{className:l.O$B,role:"tooltip",children:d})]})]}),a.playlist?.name&&(0,n.jsx)("div",{className:l.vJj,children:(0,n.jsxs)("div",{style:{minWidth:0},children:[(0,n.jsx)("div",{style:{fontSize:12,fontWeight:800,color:"rgba(255,255,255,0.6)"},children:"Coach's playlist"}),(0,n.jsx)("div",{style:{fontSize:16,fontWeight:800},children:a.playlist.name})]})})]}),(0,n.jsxs)("div",{className:l.nPz,style:{background:"none"},children:[(0,n.jsx)("button",{type:"button",className:l.XPu,onClick:()=>m(g),children:"My music is on, let's go"}),(0,n.jsx)("button",{type:"button",className:l.nti,onClick:()=>m(g),children:"Skip, no music today"})]})]}
1):(0,n.jsxs)(ei.ZR,{secondaryColor:c,title:e,subtitle:`Workout \xb7 ${C.value} ${C.unit} \xb7 ${k.length} sections \xb7 ${M} sets`,description:t,icon:(0,n.jsx)(n.Fragment,{children:(0,n.jsx)("svg",{width:"47",height:"47",viewBox:"0 0 24 24",fill:"rgba(255,255,255,0.85)","aria-hidden":!0,children:(0,n.jsx)("path",{d:"M20.57 14.86L22 13.43 20.57 12 17 15.57 8.43 7 12 3.43 10.57 2 9.14 3.43 7.71 2 5.57 4.14 4.14 2.71 2.71 4.14l1.43 1.43L2 7.71l1.43 1.43L2 10.57 3.43 12 7 8.43 15.57 17 12 20.57 13.43 22l1.43-1.43L16.29 22l2.14-2.14 1.43 1.43 1.43-1.43-1.43-1.43L22 16.29z"})})}),layout:u,onBack:h,testId:"workout-splash",topTrailing:(0,n.jsx)("button",{type:"button",className:l.tD_,onClick:()=>j(!0),"aria-label":"Workout settings","data-testid":"workout-settings-button",children:(0,n.jsx)("svg",{width:"17",height:"17",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":!0,children:(0,n.jsx)("path",{d:"M3 17v2h6v-2H3zM3 5v2h10V5H3zm10 16v-2h8v-2h-8v-2h-2v6h2zM7 9v2H3v2h4v2h2V9H7zm14 4v-2H11v2h10zm-6-4h2V7h4V5h-4V3h-2v6z"})})}),footer:(0,n.jsxs)(ei.PK,{onClick:()=>L(0),children:[(0,n.jsx)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":!0,children:(0,n.jsx)("path",{d:"M8 5v14l11-7z"})}),"Start workout"]}),overlay:(0,n.jsxs)(n.Fragment,{children:[I&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("button",{type:"button",className:l.l9O,onClick:()=>f(null),"aria-label":"Cancel"}),(0,n.jsxs)("div",{className:`${l.E} ${l.qGl}`,role:"dialog","aria-modal":"true","aria-label":"Choose where to start","data-testid":"workout-start-point",children:[(0,n.jsx)("div",{className:l.o2B}),(0,n.jsx)("span",{className:l.pvC,children:"Where do you want to start?"}),(0,n.jsxs)("div",{className:l.bt4,children:[(0,n.jsx)(N,{className:l.OJQ,posterUrl:I.poster}),(0,n.jsxs)("div",{className:l.U6G,children:[(0,n.jsx)("span",{className:l.C6Q,children:I.card.workoutSet.setTitle||I.card.title}),(0,n.jsx)("span",{className:l.BfG,children:`Section ${R+1} of ${k.length} \xb7 ${(0,o.ei)(I.durationSec)}`})]})]}),(0,n.jsx)("span",{className:l.zQm,children:`Starting here skips the first ${1===E.length?"section":`${E.length} sections`} (${(0,o.ei)(A)}).`}),(0,n.jsxs)("div",{className:l.K35,children:[(0,n.jsx)("button",{type:"button",className:l.XPu,onClick:()=>L(I.cardIndex),children:"Start from this section"}),(0,n.jsx)("button",{type:"button",className:`${l.nti} ${l.Zmo}`,onClick:()=>L(0),children:"Start from the beginning"})]})]})]}),(0,n.jsx)(B,{open:b,onClose:()=>j(!1),themeColor:i})]}),children:[(0,n.jsxs)("div",{className:l.qXp,children:[(0,n.jsx)("span",{className:l.XCK,children:"Equipment"}),$.length>0?$.map(e=>(0,n.jsx)("span",{className:l.Re1,children:e.charAt(0).toUpperCase()+e.slice(1)},e)):(0,n.jsx)("span",{className:l.Re1,children:"Bodyweight"})]}),k.map((e,t)=>(0,n.jsxs)("button",{type:"button",className:l.m33,onClick:()=>((e,t)=>{if(0===t)return void L(e);f(e)})(e.cardIndex,t),"aria-label":`Start from section ${t+1}, ${e.card.workoutSet.setTitle||e.card.title}`,children:[(0,n.jsx)(N,{className:l.OJQ,posterUrl:e.poster}),(0,n.jsxs)("div",{className:l.U6G,children:[(0,n.jsx)("span",{className:l.C6Q,children:e.card.workoutSet.setTitle||e.card.title}),(0,n.jsx)("span",{className:l.BfG,children:(e=>{let t=e.exercises.map(e=>e.name),s=e.rounds>1?`${e.rounds} rounds \xb7 `:"";return t.length<=2?`${s}${t.join(" + ")}`:`${s}${t.length} exercises`})(e.card.workoutSet)})]}),(0,n.jsx)("span",{className:l.KZ,children:(0,o.ei)(e.durationSec)}),(0,n.jsx)("span",{className:l.LnK,children:(0,n.jsx)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":!0,children:(0,n.jsx)("path",{d:"M8.6 16.6L13.2 12 8.6 7.4 10 6l6 6-6 6z"})})})]},e.card.id??t)),(0,n.jsx)("div",{style:{height:8}})]})};var ec=s(98783);let ed={id:"workout-demo-activity",stableId:"workout-demo-activity",title:"Foundation Full-Body Workout",subtitle:"Workout • 18 min",nounPhrase:"Workout",description:"Build your first strength baseline with four guided sections. Move with intent, rest on schedule, and let your coach pace you through it.",icon:{sf:"figure.strengthtraining.traditional",material:"fitness_center"},status:"notStarted",type:"activity",orderNum:99,workoutSession:{enabled:!0,flow:"continuous",audioCoach:!0,musicPrompt:!0,playlist:{provider:"spotify",name:"Foundation Strength Mix"},voiceInput:!1,prefillTargets:!0,heartRate:!0,trackEffort:!0},cards:[{id:"demo-warmup",title:"Warm-Up Circuit",instructions:"Two easy rounds to wake everything up.",orderNum:1,icon:{sf:"flame",material:"local_fire_department"},cardType:"workoutSet",workoutSet:{setTitle:"Wake the Engine",rounds:2,exercises:[{name:"Reverse Lunge",exerciseId:"reverse-lunge",demoMediaSource:"studioFitnessLibrary",reps:10,restAfterSec:10,formCue:"Step back softly and keep your front knee stacked."},{name:"Bodyweight Squat",exerciseId:"bodyweight-squat",demoMediaSource:"studioFitnessLibrary",reps:10,formCue:"Slow down, chest tall, full depth."}],restBetweenRoundsSec:20,prepSec:10,showHistory:!1},components:[]},{id:"demo-goblet",title:"Goblet Squats",instructions:"Three working set
1s. Prioritize clean form over extra reps.",orderNum:2,icon:{sf:"dumbbell",material:"fitness_center"},cardType:"workoutSet",workoutSet:{setTitle:"Strength Block",equipment:["dumbbell"],rounds:3,exercises:[{name:"Goblet Squat",exerciseId:"goblet-squat",demoMediaSource:"studioFitnessLibrary",reps:10,weight:{value:20,unit:"lbs"},targetSec:40,formCue:"Chest tall, heels down, elbows inside the knees."}],restBetweenRoundsSec:45},components:[]},{id:"demo-bench",title:"Heavy Bench",instructions:"Self-paced strength sets. No clock: rest as needed, tap Done when the set is in.",orderNum:3,icon:{sf:"figure.strengthtraining.traditional",material:"fitness_center"},cardType:"workoutSet",workoutSet:{setTitle:"Heavy Bench",equipment:["barbell","bench"],rounds:3,exercises:[{name:"Bench Press",exerciseId:"bench-press",reps:8,repsMax:12,untimed:!0,weight:{value:135,unit:"lbs"},formCue:"Brace, lower with control, drive through the floor."}],restBetweenRoundsSec:90},components:[]},{id:"demo-push",title:"Push Circuit",instructions:"Three rounds of pushing power.",orderNum:4,icon:{sf:"figure.strengthtraining.functional",material:"sports_gymnastics"},cardType:"workoutSet",workoutSet:{setTitle:"Up Up & Away",rounds:3,exercises:[{name:"Push-Up",exerciseId:"push-up",demoMediaSource:"studioFitnessLibrary",reps:12,restAfterSec:15,formCue:"Elbows at 45 degrees, body in one line."},{name:"Forearm Plank",exerciseId:"plank",demoMediaSource:"studioFitnessLibrary",durationSec:30,formCue:"Squeeze your glutes, breathe steady."}],restBetweenRoundsSec:45},components:[]},{id:"demo-tabata",title:"Burpee Tabata",instructions:"All-out for 20 seconds, reset for 10. Eight rounds.",orderNum:5,icon:{sf:"bolt.fill",material:"bolt"},cardType:"workoutSet",workoutSet:{setTitle:"Tabata Finisher",rounds:8,exercises:[{name:"Burpees",exerciseId:"burpee",demoMediaSource:"studioFitnessLibrary",durationSec:20,restAfterSec:10,formCue:"Chest to the floor, full hip extension at the top."}],prepSec:10},components:[]}]}},11854:(e,t,s)=>{s.d(t,{Ch:()=>i,km:()=>a.km});var n=s(37876),r=s(14232);s(77413);var a=s(99777);let i=({visible:e,imageUrl:t,coachName:s,mode:i="profile",themeColor:l,secondaryColor:o,wrapStyle:c,className:d,showWave:u=!0})=>{let[h,m]=(0,r.useState)(null),[p,x]=(0,r.useState)(null),g=(0,r.useMemo)(()=>Array.from({length:26},(e,t)=>({angle:t/26*360,delayMs:71*t%900})),[]);if((0,r.useEffect)(()=>{if(!t)return;let e=!0,s=new Image;return s.onload=()=>{e&&m(t)},s.onerror=()=>{e&&x(t)},s.src=t,()=>{e=!1}},[t]),!e)return null;let v=(0,a.o6)(i);if("profile"===v&&t&&h!==t&&p!==t)return null;let w="profile"===v&&h===t&&p!==t,f="profile"===v?"initial":v,b=(0,a.Ld)(s,f);return(0,n.jsxs)("div",{className:`_1nocawj1 ${d??""}`,style:c,"data-testid":"coach-speaking-avatar",children:[u&&(0,n.jsx)("div",{className:"_1nocawj5","aria-hidden":!0,children:g.map(e=>(0,n.jsx)("span",{className:"_1nocawj6",style:{transform:`rotate(${e.angle}deg) translateY(-33px)`},children:(0,n.jsx)("span",{className:"_1nocawj7",style:{backgroundColor:l,animationDelay:`${e.delayMs}ms`}})},e.angle))}),(0,n.jsx)("div",{className:"_1nocawj2",style:"coach"===f?{backgroundColor:o,color:l}:void 0,children:w?(0,n.jsx)("img",{className:"_1nocawj3",src:t,alt:`${s??"Coach"} profile`,onError:()=>t&&x(t)}):(0,n.jsx)("span",{className:"coach"===f?"_1nocawj4":void 0,children:b})})]})}},35696:(e,t,s)=>{s.d(t,{PK:()=>i,ro:()=>l,ZR:()=>a});var n=s(37876);s(14232);var r=s(59607);let a=({secondaryColor:e,title:t,subtitle:s,description:a,icon:i,hero:l,meta:o,metaPlacement:c="summary",topTrailing:d,sectionTitle:u,children:h,footer:m,overlay:p,onBack:x,gradientEnd:g="601.6px",layout:v="compact",testId:w})=>(0,n.jsxs)("div",{className:`${r.zr} ${"desktop"===v?r.Dy:""}`,style:{background:"desktop"===v?"#000000":`linear-gradient(to bottom, ${e} 0%, #000000 ${g})`},"data-testid":w,children:[(0,n.jsx)("button",{type:"button",className:r.Gv,onClick:x,"aria-label":"Back",children:(0,n.jsx)("svg",{width:"21",height:"21",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":!0,children:(0,n.jsx)("path",{d:"M15.4 7.4L14 6l-6 6 6 6 1.4-1.4L10.8 12z"})})}),d&&(0,n.jsx)("div",{className:r.UN,children:d}),(0,n.jsxs)("div",{className:r.W2,children:[l&&(0,n.jsx)("div",{className:r.rE,children:l}),!l&&i&&(0,n.jsx)("div",{className:r.Og,style:{backgroundColor:`${e}CC`},children:i}),(0,n.jsx)("h1",{className:`${r.DD} ${!l&&!i?r.$9:""}`,children:t}),s&&(0,n.jsx)("div",{className:r.VA,children:s}),o&&"summary"===c&&(0,n.jsx)("div",{className:r.mI,children:o}),a&&(0,n.jsx)("div",{className:r.h_,children:a}),(u||o&&"section"===c)&&(0,n.jsxs)("div",{className:r.SF,children:[(0,n.jsx)("span",{children:u}),o&&"section"===c&&(0,n.jsx)("div",{className:r.hg,children:o})]}),(0,n.jsx)("div",{className:r.uW,children:h})]}),(0,n.jsx)("div",{className:r.qr,children:m}),p]}),i=({children:e,type:t="button",...s})=>(0,n.jsx)("button",{type:t,className:r.FS,...s,children:e}),l=({children:e,type:t="button",compact:s=!1,className:a="",...i})=>(0,n.jsx)("button",{type:t,className:`${r.SO} ${s?r.Ox:""} ${a}`,...i,children:e})},39173:(e,t,s)=>{s.d(t,{A9:()=>c,JN:()=>l,KD:()=>o,f5:()=>a,g2:()=>r,xy:()=>i});let n=()=>"undefined"!=typeof navigator&&navigator.userAgent.includes("DXApp-Android"),r=()=>{n()&&"vibrate"in navigator&&navigator.vibrate(2)},a=()=>{n()&&"vibrate"in navigator&&navigator.vibrate(3)},i=()=>{n()&&"vibrate"in navigator&&navigator.vibrate(5)},l=()=>{n()&&"vibrate"in navigator&&navigator.vibrate(1)},o=e=>{n()&&"vibrate"in navigator&&navigator.vibrate({prep:18,work:35,rest:[22,45,22],complete:[35,55,80]}[e])},c=e=>{if(n()&&window.AndroidKeyboardToolbar&&"function"==typeof window.AndroidKeyboardToolbar.setVisible)try{window.AndroidKeyboardToolbar.setVisible(e)}catch(e){console.warn("Failed to set Android keyboard toolbar visibility:",e)}}},59607:(e,t,s)=>{s.d(t,{$9:()=>j,DD:()=>b,Dy:()=>a,FS:()=>u,Gv:()=>n,Og:()=>l,Ox:()=>x,SF:()=>v,SO:()=>p,UN:()=>y,VA:()=>f,W2:()=>m,h_:()=>r,hg:()=>w,mI:()=>d,qr:()=>i,rE:()=>o,uW:()=>g,vb:()=>c,zr:()=>h}),s(82504);var n="wf8yyi2",r="wf8yyic",a="wf8yyi1",i="wf8yyig",l="wf8yyi7",o="wf8yyi5",c="wf8yyi6",d="wf8yyib",u="wf8yyih",h="wf8yyi0",m="wf8yyi4",p="wf8yyii",x="wf8yyij",g="wf8yyif",v="wf8yyid",w="wf8yyie",f="wf8yyia",b="wf8yyi8",j="wf8yyi9",y="wf8yyi3"},99777:(e,t,s)=>{s.d(t,{Ld:()=>a,km:()=>r,o6:()=>n});let n=e=>"coach"===e?e:"profile",r=({audioCoachEnabled:e,isSpeaking:t,segmentKind:s})=>t||e&&"prep"===s,a=(e,t)=>
1"coach"===t?"Coach":(e||"Coach").trim().charAt(0).toUpperCase()||"C"}}]);

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.