PageSourceSearch

https://www.trainwithkickoff.com/_next/static/chunks/pages/dashboard/ai-workout-evals-f2240a8fd2ed8fa2.js

js trainwithkickoff.com collected 2026-09-25 20:29:52 UTC 115,728 bytes, 2 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5280],{64497:function(e){var n={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"createPromptVersion"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"stage"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"PromptVersionStage"}}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"label"}},type:{kind:"NamedType",name:{kind:"Name",value:"String"}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"body"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"createPromptVersion"},arguments:[{kind:"Argument",name:{kind:"Name",value:"stage"},value:{kind:"Variable",name:{kind:"Name",value:"stage"}}},{kind:"Argument",name:{kind:"Name",value:"label"},value:{kind:"Variable",name:{kind:"Name",value:"label"}}},{kind:"Argument",name:{kind:"Name",value:"body"},value:{kind:"Variable",name:{kind:"Name",value:"body"}}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"stage"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"label"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"body"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"status"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"contentHash"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"createdByCoachId"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"promotedAt"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"createdAt"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"updatedAt"},arguments:[],directives:[]}]}}]}},{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"updatePromptVersion"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"id"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ID"}}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"label"}},type:{kind:"NamedType",name:{kind:"Name",value:"String"}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"body"}},type:{kind:"NamedType",name:{kind:"Name",value:"String"}},directives:[]}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"updatePromptVersion"},arguments:[{kind:"Argument",name:{kind:"Name",value:"id"},value:{kind:"Variable",name:{kind:"Name",value:"id"}}},{kind:"Argument",name:{kind:"Name",value:"label"},value:{kind:"Variable",name:{kind:"Name",value:"label"}}},{kind:"Argument",name:{kind:"Name",value:"body"},value:{kind:"Variable",name:{kind:"Name",value:"body"}}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"stage"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"label"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"body"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"status"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"contentHash"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"createdByCoachId"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"promotedAt"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"createdAt"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"updatedAt"},arguments:[],directives:[]}]}}]}},{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"promotePromptVersion"}
1,variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"id"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ID"}}},directives:[]}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"promotePromptVersion"},arguments:[{kind:"Argument",name:{kind:"Name",value:"id"},value:{kind:"Variable",name:{kind:"Name",value:"id"}}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"stage"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"label"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"body"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"status"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"contentHash"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"createdByCoachId"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"promotedAt"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"createdAt"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"updatedAt"},arguments:[],directives:[]}]}}]}},{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"enqueueEvalRun"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"plannerVersionId"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ID"}}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"pickerVersionId"}},type:{kind:"NamedType",name:{kind:"Name",value:"ID"}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"composerVersionId"}},type:{kind:"NamedType",name:{kind:"Name",value:"ID"}},directives:[]}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"enqueueEvalRun"},arguments:[{kind:"Argument",name:{kind:"Name",value:"plannerVersionId"},value:{kind:"Variable",name:{kind:"Name",value:"plannerVersionId"}}},{kind:"Argument",name:{kind:"Name",value:"pickerVersionId"},value:{kind:"Variable",name:{kind:"Name",value:"pickerVersionId"}}},{kind:"Argument",name:{kind:"Name",value:"composerVersionId"},value:{kind:"Variable",name:{kind:"Name",value:"composerVersionId"}}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"status"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"mode"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"plannerVersionId"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"pickerVersionId"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"composerVersionId"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"plannerLabel"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"pickerLabel"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"composerLabel"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"total"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"completedCount"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"createdAt"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"completedAt"},arguments:[],directives:[]}]}}]}}],loc:{start:0,end:1228}};n.loc.source={body:"mutation createPromptVersion(\n  $stage: PromptVersionStage!\n  $label: String\n  $body: String!\n) {\n  createPromptVersion(stage: $stage, label: $label, body: $body) {\n    id\n    stage\n    label\n    body\n    status\n    contentHash\n    createdByCoachId\n    promotedAt\n    createdAt\n    updatedAt\n  }\n}\n\nmutation updatePromptVersion($id: ID!, $label: String, $body: String) {\n  updatePromptVersion(id: $id, label: $label, body: $body) {\n    id\n    stage\n    label\n    body\n    status\n    contentHash\n    createdByCoachId\n    promotedAt\n    createdAt\n    updatedAt\n  }\n}\n\nmutation promotePromptVersion($id: ID!) {\n  promotePromptVersion(id: $id) {\n    id\n    stage\n    label\n    body\n    status\n    contentHash\n    createdByCoachId\n    promotedAt\n    createdAt\n    updatedAt\n  }\n}\n\nmutation enqueueEvalRun(\n  $plannerVersionId: ID!\n  $pickerVersionId: ID\n  $composerVersionId: ID\n) {\n  enqueueEvalRun(\n    plannerVersionId: $plannerVersionId\n    pickerVersionId: $pickerVersionId\n    composerVersionId: $composerVersionId\n  ) {\n    id\n    status\n    mode\n    plannerVersionId\n    pickerVersionId\n    composerVersionId\n    plannerLabel\n    pickerLabel\n    composerLabel\n    total\n    completedCount\n    createdAt\n    completedAt\n  }\n}\n",name:"GraphQL request",locationOffset:{line:1,column:1}};var i={};function t(e,n){for(var i=0;i<e.definitions.length;i++){var t=e.definitions[i];if(t.name&&t.name.value==n)return t}}function a(e,n){var a={kind:e.kind,definitions:[t(e,n)]};e.hasOwnProperty("loc")&&(a.loc=e.loc);var s=i[n]||new Set,r=new Set,l=new Set;for(s.forEach(function(e){l.add(e)});l.size>0;){var o=l;l=new Set,o.forEach(function(e){r.has(e)||(r.add(e),(i[e]||new Set).forEach(function(e){l.add(e)}))})}return r.forEach(function(n){var i=t(e,n);i&&a.definitions.push(i)}),a}n.definitions.forEach(function(e){if(e.name){var n=new Set;(function e(n,i){if("FragmentSpread"===n.kind)i.add(n.name.value);
1else if("VariableDefinition"===n.kind){var t=n.type;"NamedType"===t.kind&&i.add(t.name.value)}n.selectionSet&&n.selectionSet.selections.forEach(function(n){e(n,i)}),n.variableDefinitions&&n.variableDefinitions.forEach(function(n){e(n,i)}),n.definitions&&n.definitions.forEach(function(n){e(n,i)})})(e,n),i[e.name.value]=n}}),e.exports=n,e.exports.createPromptVersion=a(n,"createPromptVersion"),e.exports.updatePromptVersion=a(n,"updatePromptVersion"),e.exports.promotePromptVersion=a(n,"promotePromptVersion"),e.exports.enqueueEvalRun=a(n,"enqueueEvalRun")},14048:function(e){var n={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"promptVersions"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"stage"}},type:{kind:"NamedType",name:{kind:"Name",value:"PromptVersionStage"}},directives:[]}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"promptVersions"},arguments:[{kind:"Argument",name:{kind:"Name",value:"stage"},value:{kind:"Variable",name:{kind:"Name",value:"stage"}}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"stage"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"label"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"body"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"status"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"contentHash"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"createdByCoachId"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"promotedAt"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"createdAt"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"updatedAt"},arguments:[],directives:[]}]}}]}},{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"evalPersonas"},variableDefinitions:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"evalPersonas"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"personaKey"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"label"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"goalType"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"experienceLevel"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"equipmentLevel"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"injuryStatus"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"daysPerWeek"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"programPosition"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"scenario"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"optPhase"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"notes"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"coachNotes"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"isEnabled"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"gender"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"secondaryGoal"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"conditions"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"preferredModalities"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"excludedWords"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"workoutDynamism"},arguments:[],directives:[]}]}}]}},{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"evalRuns"},variableDefinitions:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"evalRuns"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"status"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"mode"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"plannerVersionId"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"pickerVersionId"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"composerVersionId"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"plannerLabel"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"pickerLabel"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"composerLabel"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"total"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"completedCount"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"createdAt"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"completedAt"},arguments:[],directives:[]}]}}]}},{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"evalRun"}
1,variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"id"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ID"}}},directives:[]}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"evalRun"},arguments:[{kind:"Argument",name:{kind:"Name",value:"id"},value:{kind:"Variable",name:{kind:"Name",value:"id"}}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"status"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"mode"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"plannerVersionId"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"pickerVersionId"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"composerVersionId"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"plannerLabel"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"pickerLabel"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"composerLabel"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"total"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"completedCount"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"createdAt"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"completedAt"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"results"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"personaId"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"personaKey"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"personaLabel"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"inputs"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"goalType"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"secondaryGoal"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"gender"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"optPhase"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"experienceLevel"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"equipmentLevel"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"daysPerWeek"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"injuryStatus"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"workoutDynamism"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"notes"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"coachNotes"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"conditions"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"preferredModalities"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"excludedWords"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"blockedPatterns"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"bodyParts"},arguments:[],directives:[]}]}},{kind:"Field",name:{kind:"Name",value:"weekIntent"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"weekRationale"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"evidence"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"fact"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"source"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"detail"},arguments:[],directives:[]}]}},{kind:"Field",name:{kind:"Name",value:"l1Checks"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"label"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"owner"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"status"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"detail"},arguments:[],directives:[]}]}},{kind:"Field",name:{kind:"Name",value:"needsReview"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"needsReviewReasons"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"error"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"days"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"dayOffset"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"dayIntent"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"isRest"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"name"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"dayDescription"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"emphasis"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"durationTarget"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"pickedTemplateId"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"pickedTemplateName"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"unsatisfiedReason"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"exercises"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"exerciseId"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"name"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"order"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"prescription"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"unit"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"value"},arguments:[],directives:[]}]}}]}},{kind:"Field",name:{kind:"Name",value:"sections"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"label"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"kind"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"rounds"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"exercises"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"exerciseId"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"name"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"order"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"prescription"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"unit"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"value"},arguments:[],directives:[]}]}}]}}]}}]}},{kind:"Field",name:{kind:"Name",value:"composed"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"dayOffset"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"dayIntent"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"isRest"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"name"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"dayDescription"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"emphasis"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"durationTarget"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"reason"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"unsatisfiedReason"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"videoTemplate"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"name"},arguments:[],directives:[]}]}},{kind:"Field",name:{kind:"Name",value:"sections"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"kind"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"format"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"rounds"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"reason"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"exercises"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"exerciseId"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"name"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"role"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"sets"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"order"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"reason"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"prescription"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"unit"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"value"},arguments:[],directives:[]}]}}]}}]}},{kind:"Field",name:{kind:"Name",value:"exercises"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"exerciseId"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"name"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"role"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"sets"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"order"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"reason"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"prescription"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"unit"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"value"},arguments:[],directives:[]}]}}]}}]}}]}}]}}]}}],loc:{start:0,end:3152}};n.loc.source={body:"query promptVersions($stage: PromptVersionStage) {\n  promptVersions(stage: $stage) {\n    id\n    stage\n    label\n    body\n    status\n    contentHash\n    createdByCoachId\n    promotedAt\n    createdAt\n    updatedAt\n  }\n}\n\nquery evalPersonas {\n  evalPersonas {\n    id\n    personaKey\n    label\n    goalType\n    experienceLevel\n    equipmentLevel\n    injuryStatus\n    daysPerWeek\n    programPosition\n    scenario\n    optPhase\n    notes\n    coachNotes\n    isEnabled\n    gender\n    secondaryGoal\n    conditions\n    preferredModalities\n    excludedWords\n    workoutDynamism\n  }\n}\n\nquery evalRuns {\n  evalRuns {\n    id\n    status\n    mode\n    plannerVersionId\n    pickerVersionId\n    composerVersionId\n    plannerLabel\n    pickerLabel\n    composerLabel\n    total\n    completedCount\n    createdAt\n    completedAt\n  }\n}
1\n\nquery evalRun($id: ID!) {\n  evalRun(id: $id) {\n    id\n    status\n    mode\n    plannerVersionId\n    pickerVersionId\n    composerVersionId\n    plannerLabel\n    pickerLabel\n    composerLabel\n    total\n    completedCount\n    createdAt\n    completedAt\n    results {\n      id\n      personaId\n      personaKey\n      personaLabel\n      inputs {\n        goalType\n        secondaryGoal\n        gender\n        optPhase\n        experienceLevel\n        equipmentLevel\n        daysPerWeek\n        injuryStatus\n        workoutDynamism\n        notes\n        coachNotes\n        conditions\n        preferredModalities\n        excludedWords\n        blockedPatterns\n        bodyParts\n      }\n      weekIntent\n      weekRationale\n      evidence {\n        fact\n        source\n        detail\n      }\n      l1Checks {\n        id\n        label\n        owner\n        status\n        detail\n      }\n      needsReview\n      needsReviewReasons\n      error\n      days {\n        dayOffset\n        dayIntent\n        isRest\n        name\n        dayDescription\n        emphasis\n        durationTarget\n        pickedTemplateId\n        pickedTemplateName\n        unsatisfiedReason\n        exercises {\n          exerciseId\n          name\n          order\n          prescription {\n            unit\n            value\n          }\n        }\n        sections {\n          label\n          kind\n          rounds\n          exercises {\n            exerciseId\n            name\n            order\n            prescription {\n              unit\n              value\n            }\n          }\n        }\n      }\n      composed {\n        dayOffset\n        dayIntent\n        isRest\n        name\n        dayDescription\n        emphasis\n        durationTarget\n        reason\n        unsatisfiedReason\n        videoTemplate {\n          id\n          name\n        }\n        sections {\n          kind\n          format\n          rounds\n          reason\n          exercises {\n            exerciseId\n            name\n            role\n            sets\n            order\n            reason\n            prescription {\n              unit\n              value\n            }\n          }\n        }\n        exercises {\n          exerciseId\n          name\n          role\n          sets\n          order\n          reason\n          prescription {\n            unit\n            value\n          }\n        }\n      }\n    }\n  }\n}\n",name:"GraphQL request",locationOffset:{line:1,column:1}};var i={};function t(e,n){for(var i=0;i<e.definitions.length;i++){var t=e.definitions[i];if(t.name&&t.name.value==n)return t}}function a(e,n){var a={kind:e.kind,definitions:[t(e,n)]};e.hasOwnProperty("loc")&&(a.loc=e.loc);var s=i[n]||new Set,r=new Set,l=new Set;for(s.forEach(function(e){l.add(e)});l.size>0;){var o=l;l=new Set,o.forEach(function(e){r.has(e)||(r.add(e),(i[e]||new Set).forEach(function(e){l.add(e)}))})}return r.forEach(function(n){var i=t(e,n);i&&a.definitions.push(i)}),a}n.definitions.forEach(function(e){if(e.name){var n=new Set;(function e(n,i){if("FragmentSpread"===n.kind)i.add(n.name.value);else if("VariableDefinition"===n.kind){var t=n.type;"NamedType"===t.kind&&i.add(t.name.value)}n.selectionSet&&n.selectionSet.selections.forEach(function(n){e(n,i)}),n.variableDefinitions&&n.variableDefinitions.forEach(function(n){e(n,i)}),n.definitions&&n.definitions.forEach(function(n){e(n,i)})})(e,n),i[e.name.value]=n}}),e.exports=n,e.exports.promptVersions=a(n,"promptVersions"),e.exports.evalPersonas=a(n,"evalPersonas"),e.exports.evalRuns=a(n,"evalRuns"),e.exports.evalRun=a(n,"evalRun")},74548:function(e,n,i){var t={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"signInToken"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"token"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"signInToken"},arguments:[{kind:"Argument",name:{kind:"Name",value:"token"},value:{kind:"Variable",name:{kind:"Name",value:"token"}}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"sessionToken"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"me"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"meFields"},directives:[]}]}}]}}]}}],loc:{start:0,end:159}};t.loc.source={body:"#import 'fragments/me.graphql'\n\nmutation signInToken($token: String!) {\n  signInToken(token: $token) {\n    sessionToken\n    me {\n      ...meFields\n    }\n  }\n}\n",name:"GraphQL request",locationOffset:{line:1,column:1}};var a={};t.definitions=t.definitions.concat(i(67973).definitions.filter(function(e){if("FragmentDefinition"!==e.kind)return!0;var n=e.name.value;return!a[n]&&(a[n]=!0,!0)}));var s={};function r(e,n){for(var i=0;i<e.definitions.length;i++){var t=e.definitions[i];if(t.name&&t.name.value==n)return t}}t.definitions.forEach(function(e){if(e.name){var n=new Set;(function e(n,i){if("FragmentSpread"===n.kind)i.add(n.name.value);
1else if("VariableDefinition"===n.kind){var t=n.type;"NamedType"===t.kind&&i.add(t.name.value)}n.selectionSet&&n.selectionSet.selections.forEach(function(n){e(n,i)}),n.variableDefinitions&&n.variableDefinitions.forEach(function(n){e(n,i)}),n.definitions&&n.definitions.forEach(function(n){e(n,i)})})(e,n),s[e.name.value]=n}}),e.exports=t,e.exports.signInToken=function(e,n){var i={kind:e.kind,definitions:[r(e,n)]};e.hasOwnProperty("loc")&&(i.loc=e.loc);var t=s[n]||new Set,a=new Set,l=new Set;for(t.forEach(function(e){l.add(e)});l.size>0;){var o=l;l=new Set,o.forEach(function(e){a.has(e)||(a.add(e),(s[e]||new Set).forEach(function(e){l.add(e)}))})}return a.forEach(function(n){var t=r(e,n);t&&i.definitions.push(t)}),i}(t,"signInToken")},44694:function(e,n,i){(window.__NEXT_P=window.__NEXT_P||[]).push(["/dashboard/ai-workout-evals",function(){return i(9489)}])},77364:function(e,n,i){"use strict";i.d(n,{Z:function(){return y}});var t=i(73292),a=i(93128),s=i(85893),r=i(67814),l=i(93967),o=i.n(l),d=i(67294),c=i(41837),u=i(55171),m=i.n(u),v={"Client memory":"Injuries & restrictions"},p=/[—–;,]/,h=function(e){var n=e.indexOf(": ");if(n>0){var i=e.slice(0,n).trim(),t=e.slice(n+2).trim();if(i&&t&&i.length<=28&&!p.test(i))return{label:i,value:t}}return{label:null,value:e.trim()}},k=function(e){var n=e.fact,i=e.source,l=e.detail,u=e.onReveal,p=e.eyebrow,k=void 0!==p&&p,y=(0,a._)((0,d.useState)(!1),2),f=y[0],g=y[1],_=!!l,N=i&&(0,s.jsxs)("span",{className:m().whyEvidenceSource,children:[i&&v[i]||i,_&&(0,s.jsx)(r.G,{icon:"chevron-right",className:o()(m().whyEvidenceSourceCaret,(0,t._)({},m().whyEvidenceSourceCaretOpen,f))})]}),x=(0,s.jsx)(c.uT,{size:"xsmall",className:m().whyEvidenceFact,children:n}),b=k?(0,s.jsxs)(s.Fragment,{children:[N,x]}):(0,s.jsxs)(s.Fragment,{children:[x,N]});return(0,s.jsxs)("li",{className:o()(m().whyEvidenceItem,(0,t._)({},m().whyEvidenceItemShown,k)),children:[_?(0,s.jsx)("button",{type:"button",className:m().whyEvidenceRowButton,"aria-expanded":f,onClick:function(){var e=!f;g(e),e&&(null==u||u())},children:b}):(0,s.jsx)("div",{className:m().whyEvidenceRow,children:b}),_&&f&&(k?(0,s.jsx)("span",{className:m().whyEvidenceDetailRows,children:(null!=l?l:"").split("\n").map(function(e){return e.trim()}).filter(Boolean).map(h).map(function(e,n){return(0,s.jsx)(d.Fragment,{children:e.label?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("span",{className:m().whyDetailKey,children:e.label}),(0,s.jsx)("span",{className:m().whyDetailValue,children:e.value})]}):(0,s.jsx)("span",{className:m().whyDetailFull,children:e.value})},n)})}):(0,s.jsx)(c.uT,{size:"xsmall",color:"textSecondary",className:m().whyEvidenceDetail,children:l}))]})},y=function(e){var n,i=e.reason,l=e.evidence,u=e.className,v=e.onShowContext,p=e.onOpenEvidence,h=e.asSection,y=void 0!==h&&h,f=e.heading,g=(0,a._)((0,d.useState)(!1),2),_=g[0],N=g[1],x=!!i,b=Array.isArray(l)&&l.length>0,w=b?l.length:0;if(!x&&!b)return null;var j=function(){var e=!_;N(e),e&&(null==v||v({evidenceCount:w}))};return(0,s.jsxs)("div",{className:o()((n={},(0,t._)(n,m().rationale,x),(0,t._)(n,m().bare,!x),n),u),children:[x&&(0,s.jsx)(c.uT,{size:"xsmall",weight:"medium",className:m().rationaleReason,children:i}),b&&(0,s.jsxs)(s.Fragment,{children:[y?(0,s.jsxs)("button",{type:"button",className:o()(m().whySectionToggle,(0,t._)({},m().whySectionToggleOpen,_)),"aria-expanded":_,onClick:j,children:[(0,s.jsx)(r.G,{icon:"chevron-right",className:m().whySectionChevron}),(0,s.jsx)("span",{children:void 0===f?"Why this week":f}),(0,s.jsxs)("span",{className:m().whySectionCount,children:["\xb7 ",w]})]}):(0,s.jsxs)("button",{type:"button",className:m().whyToggle,"aria-expanded":_,onClick:j,children:[(0,s.jsx)("span",{children:"What's this based on?"}),(0,s.jsx)(r.G,{icon:"chevron-right",className:o()(m().whyToggleChevron,(0,t._)({},m().whyToggleChevronOpen,_))})]}),_&&(0,s.jsx)("ul",{className:o()(m().whyEvidenceList,(0,t._)({},m().whyEvidenceListShown,y)),children:l.map(function(e,n){return(0,s.jsx)(k,{fact:e.fact,source:e.source,detail:e.detail,eyebrow:y,onReveal:function(){return null==p?void 0:p({source:e.source})}},n)})})]})]})}},65837:function(e,n,i){"use strict";var t=i(85893),a=i(18440),s=i.n(a);n.Z=function(e){var n=e.size,i=void 0===n?26:n;return(0,t.jsxs)("svg",{className:s().aiMark,width:i,height:i,viewBox:"0 0 24 24",fill:"none","aria-hidden":!0,focusable:"false",children:[(0,t.jsx)("defs",{children:(0,t.jsxs)("linearGradient",{id:"aiProgrammerMark",x1:"2",y1:"2",x2:"22",y2:"22",gradientUnits:"userSpaceOnUse",children:[(0,t.jsx)("stop",{offset:"0%",stopColor:"#ff6d42"}),(0,t.jsx)("stop",{offset:"100%",stopColor:"#830051"})]})}),(0,t.jsxs)("g",{fill:"url(#aiProgrammerMark)",children:[(0,t.jsxs)("g",{transform:"rotate(-28 12 12)",children:[(0,t.jsx)("rect",{x:"9",y:"11",width:"6",height:"2",rx:"1"}),(0,t.jsx)("rect",{x:"6.4",y:"8.4",width:"2.4",height:"7.2",rx:"1.2"}),(0,t.jsx)("rect",{x:"3.8",y:"9.6",width:"2",height:"4.8",rx:"1"}),(0,t.jsx)("rect",{x:"15.2",y:"8.4",width:"2.4",height:"7.2",rx:"1.2"}),(0,t.jsx)("rect",{x:"18.2",y:"9.6",width:"2",height:"4.8",rx:"1"})]}),(0,t.jsx)("path",{d:"M5 2.2 Q5 5 7.8 5 Q5 5 5 7.8 Q5 5 2.2 5 Q5 5 5 2.2 Z"}),(0,t.jsx)("path",{d:"M19.5 17.4 Q19.5 19 21.1 19 Q19.5 19 19.5 20.6 Q19.5 19 17.9 19 Q19.5 19 19.5 17.4 Z"})]})]})}},11679:function(e,n,i){"use strict";i.d(n,{Z:function(){return l}});var t=i(85893),a=i(65837),s=i(88704),r=i.n(s);function l(e){var n=e.children,i=e.label,s=e.statusChip;return(0,t.jsxs)("div",{className:"".concat(r().briefCard," ph-no-capture"),"data-testid":"ai-week-brief",children:[(0,t.jsxs)("div",{className:r().briefHeader,children:[(0,t.jsx)("span",{className:r().aiMarkChip,"aria-hidden":!0,
1children:(0,t.jsx)(a.Z,{size:24})}),(0,t.jsx)("span",{className:r().briefTitle,children:"Your AI Workout Assistant"}),s,i&&(0,t.jsx)("span",{className:r().briefWeekTag,children:i})]}),n]})}},12273:function(e,n,i){"use strict";i.d(n,{U1:function(){return r},VG:function(){return c},sx:function(){return a}});var t=i(44330),a=function(e){var n,i,a,s,r;return(0,t.N)((null===(n=e.composed)||void 0===n?void 0:n.name)||(null===(i=e.workoutTemplate)||void 0===i?void 0:i.displayName)||(null===(a=e.workoutTemplate)||void 0===a?void 0:a.name)||(null===(s=e.workoutActivity)||void 0===s?void 0:s.name))||"Day ".concat((null!==(r=e.dayOffset)&&void 0!==r?r:0)+1)},s=function(e){var n;return(null!==(n=null==e?void 0:e.workouts)&&void 0!==n?n:[]).filter(function(n){return!n.isRest&&((null==e?void 0:e.status)!=="materialized"||null!==n.scheduledWorkout)})},r=function(e){var n,i,t,a,s;return null!==(s=null!==(a=null===(i=e.composed)||void 0===i?void 0:null===(n=i.sections)||void 0===n?void 0:n.filter(function(e){return"WORKING"===e.kind}).flatMap(function(e){return e.exercises}))&&void 0!==a?a:null===(t=e.composed)||void 0===t?void 0:t.exercises)&&void 0!==s?s:[]},l=function(e){if(!r(e).length||r(e).some(function(e){var n;return null==e.sets||!(null===(n=e.prescription)||void 0===n?void 0:n.length)}))return null;var n,i,t=function(e){var n,i,t,a;return[String(e.exerciseId),null!==(n=e.sets)&&void 0!==n?n:null,null!==(i=e.rest)&&void 0!==i?i:null,null!==(t=e.notes)&&void 0!==t?t:null,(null!==(a=e.prescription)&&void 0!==a?a:[]).map(function(e){return[null==e.exerciseUnitId?e.unit:String(e.exerciseUnitId),e.value]})]};return JSON.stringify((null===(i=e.composed)||void 0===i?void 0:null===(n=i.sections)||void 0===n?void 0:n.length)?e.composed.sections.map(function(e){return[e.kind,e.format,e.rounds,e.exercises.map(t)]}):r(e).map(t))},o=function(e){return e.map(a).join(" and ")},d=new Set(["FULL_BODY","UPPER_FOCUS","LOWER_FOCUS","PUSH_FOCUS","PULL_FOCUS"]),c=function(e,n){var i=[],t=s(e),c=function(n){var i,t,a;return null===(a=e.evidence)||void 0===a?void 0:null===(t=a.find(function(e){var i;return(null===(i=e.source)||void 0===i?void 0:i.toLowerCase())===n}))||void 0===t?void 0:null===(i=t.detail)||void 0===i?void 0:i.trim()},u=c("fitness goal"),m=t.filter(function(e){var n;return d.has(null!==(n=e.intent)&&void 0!==n?n:"")&&r(e).length}).slice(0,2);if(u&&/^Goal Type: (Strength|Hypertrophy)$/i.test(u)&&m.length){var v=/Hypertrophy$/i.test(u);i.push({kind:"goal",title:v?"Their muscle-building goal shapes the main work":"Their strength goal shapes the main work",explanation:"Their main training goal is ".concat(v?"to build muscle":"to get stronger",", so this week includes ").concat(o(m),". These resistance-training sessions give them ").concat(v?"focused work for the muscles they are training":"repeated practice with the programmed lifts to develop strength",", supporting that goal."),source:"Fitness goal",detail:u,workouts:m})}var p=t.filter(function(e){return null!=e.recurrence}),h=t.filter(function(e){var n;return(null===(n=e.composed)||void 0===n?void 0:n.canRegenerate)===!0&&null==e.recurrence});if(p.length&&h.length){var k=p.slice(0,2);i.push({kind:"coach",title:"Building on the work you’ve already planned",explanation:"Your ".concat(o(k)," ").concat(1===k.length?"session is":"sessions are"," part of this week, alongside ").concat(o(h.slice(0,1)),". The added session builds on that routine while keeping the training you chose in place."),source:"Your programmed workouts",detail:p.map(function(e){var n;return"Day ".concat((null!==(n=e.dayOffset)&&void 0!==n?n:0)+1,": ").concat(a(e))}).join("\n"),workouts:k})}var y=(null==n?void 0:n.weekNumber)!=null&&null!=e.weekNumber&&n.weekNumber===e.weekNumber-1?s(n):[],f=t.filter(function(e){var n=l(e);return null!=n&&y.some(function(e){return l(e)===n})});if(f.length){var g=f.slice(0,2);i.push({kind:"repeat",title:"Familiar movements, purposeful repetition",explanation:"".concat(o(g)," ").concat(1===g.length?"keeps":"keep"," the same exercises and prescriptions as last week. Repeating familiar work gives them another opportunity to practice and gives you comparable sessions before deciding what to progress."),source:"Previous week",detail
1:"Week ".concat(n.weekNumber,": matching exercises, sets, rest and prescriptions for ").concat(o(g),"."),workouts:g})}var _=c("preferred workout types"),N=t.filter(function(e){return"CONDITIONING"===e.intent&&r(e).some(function(e){var n;return/\b(running|jogging|run|jog)\b/i.test(null!==(n=e.name)&&void 0!==n?n:"")})});if((null==_?void 0:_.split(",").some(function(e){return"running"===e.trim().toLowerCase()}))&&N.length){var x=N.slice(0,1);i.push({kind:"preference",title:"Cardio they’ve asked for",explanation:"They listed running as a preferred activity, so ".concat(o(x)," brings that preference into the conditioning work. It gives them a way to train endurance using an activity they’ve asked for."),source:"Client preference",detail:_,workouts:x})}return i.slice(0,3)}},37271:function(e,n,i){"use strict";i.d(n,{Z:function(){return g}});var t=i(93128),a=i(85893),s=i(67294),r=i(67814),l=i(26203),o=i(44330),d={strength:{label:"Strength goal",headline:"A strength-first week built around them."},hypertrophy:{label:"Muscle-building goal",headline:"A muscle-building week shaped around their goal."},endurance:{label:"Endurance goal",headline:"An endurance-focused week built around them."},"weight loss":{label:"Weight-loss goal",headline:"A training week shaped around their weight-loss goal."},"general fitness":{label:"General fitness goal",headline:"A week built around their fitness goal."},maintenance:{label:"Maintenance goal",headline:"A week focused on maintaining their routine."},rehab:{label:"Rehab goal",headline:"A week to review against their recovery needs."}},c={running:"Prefers running",cycling:"Prefers cycling","road biking":"Prefers road biking",swimming:"Prefers swimming",walking:"Prefers walking",hiit:"Prefers HIIT",boxing:"Prefers boxing",yoga:"Prefers yoga",pilates:"Prefers Pilates"},u=function(e){var n,i,t,a,s,r=function(n){var i,t;return null===(t=e.evidence)||void 0===t?void 0:null===(i=t.find(function(e){var i;return(null===(i=e.source)||void 0===i?void 0:i.toLowerCase())===n}))||void 0===i?void 0:i.detail},l=null===(i=r("fitness goal"))||void 0===i?void 0:null===(n=i.match(/^Goal Type: ([\w ]+)$/i))||void 0===n?void 0:n[1],o=l?d[l.toLowerCase()]:void 0,u=null!==(a=null==o?void 0:o.headline)&&void 0!==a?a:"This week’s training, with a clear purpose.";"UNLOADING"===e.weekIntent?u="Recovery is the focus this week.":"ASSESSMENT"===e.weekIntent?u="A week to take stock of their training.":"MAINTENANCE"===e.weekIntent&&(u="Keep their training routine in focus.");var m=[];if(o&&m.push({kind:"goal",label:o.label}),Array.isArray(e.workouts)){var v=e.workouts.filter(function(n){return!n.isRest&&("materialized"!==e.status||null!==n.scheduledWorkout)}).length;m.push({kind:"sessions",label:"".concat(v," training session").concat(1===v?"":"s")})}var p=(null!==(s=null===(t=r("preferred workout types"))||void 0===t?void 0:t.split(","))&&void 0!==s?s:[]).map(function(e){return c[e.trim().toLowerCase()]}).find(Boolean);return p&&m.push({kind:"preference",label:p}),{headline:u,tags:m}},m=i(77364),v=i(12273),p=i(94551),h=i.n(p),k={goal:l.scR,repeat:l.jHE,preference:l.m6i,coach:l.ILF};function y(e){var n,i,t=e.week,s=e.priorWeek,d=e.compact,c=void 0!==d&&d,u=e.onOpenEditor,p=e.onSelectWorkout,y=(0,v.VG)(t,s),f=!!(null===(n=t.evidence)||void 0===n?void 0:n.length),g=(0,o.N)(t.weekRationale);return y.length||f||g?(0,a.jsxs)("details",{className:h().decisions,children:[(0,a.jsxs)("summary",{className:h().decisionsToggle,children:[(0,a.jsx)(r.G,{icon:l._tD,"aria-hidden":"true"}),"Why this week",y.length>0&&(0,a.jsxs)("span",{className:h().decisionCount,children:["\xb7 ",y.length," ",1===y.length?"decision":"decisions"]})]}),!y.length&&(0,a.jsxs)("article",{className:h().decision,children:[(0,a.jsx)("span",{className:h().decisionIcon,children:(0,a.jsx)(r.G,{icon:l.scR,"aria-hidden":"true"})}),(0,a.jsxs)("div",{children:[(0,a.jsx)("h4",{className:h().decisionTitle,children:"The thinking behind this week"}),(0,a.jsx)("p",{className:h().decisionExplanation,children:g||"The client context behind this week is available below."})]})]}),(c?y.slice(0,1):y).map(function(e){return(0,a.jsxs)("article",{className:h().decision,children:[(0,a.jsx)("span",{className:h().decisionIcon,children:(0,a.jsx)(r.G,{icon:k[e.kind],"aria-hidden":"true"})}),(0,a.jsxs)("div",{children:[(0,a.jsx)("h4",{className:h().decisionTitle,children:e.title}),(0,a.jsx)("p",{className:h().decisionExplanation,children:e.explanation}),(0,a.jsxs)("div",{className:h().decisionLinks,children:[(0,a.jsxs)("details",{className:h().decisionEvidence,children:[(0,a.jsxs)("summary",{children:[e.source," ",(0,a.jsx)("span",{"aria-hidden":"true",children:"›"})]}),(0,a.jsx)("p",{children:e.detail})]}),!c&&p&&e.workouts.filter(function(e){return null!=e.id}).map(function(e){return(0,a.jsxs)("button",{className:h().workoutLink,type:"button",onClick:function(){return p(e)},children:["View ",(0,v.sx)(e)," →"]},String(e.id))})]})]})]},e.kind)}),f&&!c&&(0,a.jsx)(m.Z,{reason:void 0,className:void 0,onShowContext:void 0,onOpenEvidence:void 0,evidence:t.evidence,asSection:!0,heading:"Source details"}),c&&u&&(0,a.jsx)("button",{type:"button",className:h().workoutLink,onClick:u,children:"See the reasoning in the editor →"}),c&&!y.length&&(0,a.jsx)("p",{className:h().decisionExplanation,children:"Open the editor to see the client context behind this week."})]},"".concat(null!==(i=t.weekNumber)&&void 0!==i?i:"")):null}var f={goal:l.scR,sessions:l.IV4,preference:l.m6i};function g(e){var n,i,d,c=e.week,m=e.compact,v=void 0!==m&&m,p=e.onOpenEditor,k=e.priorWeek,g=e.onSelectWorkout,_=u(c),N=_.headline,x=_.tags,b=(0,o.N)(c.weekRationale),w=(null!==(i=c.needsReviewReasons)&&void 0!==i?i:[]).flatMap(function(e){var n=(0,o.N)(e);return!n||/^(Session length|Circuit time) off the day's target\b/.test(n)||/^day [0-6]: requirements not fully satisfied$/.test(n)?[]:[{explanation:n}]}),j=(null!==(d=c.needsReviewReasons)&&void 0!==d?d:[]).some(function(e){return!!(0,o.N)(e)}),S=c.needsReview&&(w.length>
10||!j),F=(0,t._)((0,s.useState)(!1),2),C=F[0],I=F[1],R=(0,t._)((0,s.useState)(!1),2),T=R[0],E=R[1],P=(0,s.useRef)(null),L=v&&(T||C);if((0,s.useEffect)(function(){I(!1)},[b]),(0,s.useEffect)(function(){var e=P.current;if(e&&v&&"undefined"!=typeof ResizeObserver){var n=function(){return E(e.scrollHeight>e.clientHeight+1)};n();var i=new ResizeObserver(n);return i.observe(e),function(){return i.disconnect()}}},[b,v,L]),!b&&!x.length&&!S&&!(null===(n=c.evidence)||void 0===n?void 0:n.length))return null;var A=(0,a.jsx)("span",{ref:P,className:"".concat(h().summary," ").concat(v&&!C?h().clamped:""),children:b});return(0,a.jsxs)("div",{className:"".concat(h().brief," ph-no-capture"),"data-testid":"ai-week-brief-content",children:[(0,a.jsx)("div",{className:h().eyebrow,children:"This week’s focus"}),(0,a.jsx)("h3",{className:h().headline,children:N}),b&&(L?(0,a.jsxs)("button",{type:"button",className:h().summaryButton,"aria-expanded":C,onClick:function(){return I(function(e){return!e})},children:[A,(0,a.jsx)("span",{className:h().more,children:C?"Less":"More"})]}):(0,a.jsx)("p",{className:h().summaryStatic,children:A})),x.length>0&&(0,a.jsx)("ul",{className:h().tags,"aria-label":"Week highlights",children:x.map(function(e){return(0,a.jsxs)("li",{className:h().tag,children:[(0,a.jsx)(r.G,{icon:f[e.kind],"aria-hidden":"true"}),e.label]},e.kind)})}),(0,a.jsx)(y,{week:c,priorWeek:k,compact:v,onOpenEditor:p,onSelectWorkout:g}),S&&(0,a.jsxs)("section",{className:h().review,"aria-label":"Needs your review",children:[(0,a.jsxs)("details",{className:h().reviewDetails,children:[(0,a.jsxs)("summary",{className:h().reviewHeading,children:[(0,a.jsx)(r.G,{icon:l.eHv,"aria-hidden":"true"}),"Needs your review",w.length>0&&(0,a.jsx)("span",{className:h().reviewCount,children:w.length}),(0,a.jsx)(r.G,{icon:l.ptq,className:h().reviewChevron,"aria-hidden":"true"})]}),w.length>0?(0,a.jsx)("ul",{className:h().reviewReasons,children:w.map(function(e,n){return(0,a.jsxs)("li",{children:[e.title&&(0,a.jsx)("strong",{className:h().reviewReasonTitle,children:e.title}),e.explanation]},n)})}):(0,a.jsx)("p",{className:h().reviewFallback,children:"The assistant marked this week for review without a specific reason. Check the plan before approving it."})]}),p&&(0,a.jsx)("button",{type:"button",className:h().reviewAction,onClick:p,children:"Open editor to review"})]})]})}},54577:function(e,n,i){"use strict";i.d(n,{Z:function(){return v}});var t=i(85893),a=i(67814),s=i(26203),r=i(44330),l=i(76341),o=i(67462),d=i(12273),c=function(e,n,i){if(e.isRest)return[];if(null!=e.recurrence)return[{title:"The workout you programmed",explanation:"".concat((0,d.sx)(e)," is one of the sessions you added to the plan. It remains part of this week, keeping the training you chose at the center of their routine."),source:"Your programmed workout",detail:"Day ".concat((null!==(c=e.dayOffset)&&void 0!==c?c:0)+1,": ").concat((0,d.sx)(e),". Added by you; this is not an AI-selected session.")}];var t=(0,d.VG)((0,o._)((0,l._)({},n),{workouts:[e]}),i).map(function(n){if("goal"!==n.kind)return n;var i=(0,d.U1)(e).map(function(e){return(0,r.N)(e.name)}).filter(Boolean).slice(0,2),t=/Hypertrophy$/i.test(n.detail);return(0,o._)((0,l._)({},n),{title:t?"Focused work for their muscle-building goal":"Strength work with their goal in mind",explanation:"Their main goal is ".concat(t?"to build muscle":"to get stronger",", so this session ").concat(i.length?"includes ".concat(i.join(" and ")):"focuses on resistance training",". ").concat(t?"The programmed sets give those muscles focused resistance work to support that goal.":"Working through the programmed sets gives them practice with these lifts to develop strength.")})}),a=(null!==(u=null==n?void 0:n.workouts)&&void 0!==u?u:[]).filter(function(e){return!e.isRest&&null!=e.recurrence&&((null==n?void 0:n.status)!=="materialized"||null!==e.scheduledWorkout)});if((null===(s=e.composed)||void 0===s?void 0:s.canRegenerate)===!0&&a.length){var s,c,u,m,v=["FULL_BODY","UPPER_FOCUS","LOWER_FOCUS","PUSH_FOCUS","PULL_FOCUS"].includes(null!==(m=e.intent)&&void 0!==m?m:"")&&(0,d.U1)(e).length>0,p="CONDITIONING"===e.intent&&(0,d.U1)(e).length>0,h=v?"focused strength work":p?"conditioning work":(0,d.sx)(e);t.push({title:"Part of the week you’re building together",explanation:"This session adds ".concat(h," alongside ").concat(a.slice(0,2).map(d.sx).join(" and "),". It builds on the routine you’ve already planned, giving your client ").concat(v?"another opportunity to practice the programmed lifts and develop strength":p?"dedicated conditioning practice as part of that routine":"additional training alongside the sessions you chose"," while keeping your sessions in place."),source:"Your programmed workouts",detail
1:a.map(function(e){var n;return"Day ".concat((null!==(n=e.dayOffset)&&void 0!==n?n:0)+1,": ").concat((0,d.sx)(e))}).join("\n")})}return t.slice(0,2)},u=i(94551),m=i.n(u);function v(e){var n,i=e.workout,l=c(i,e.week,e.priorWeek),o=l.length||i.editedByCoachAt?null:(0,r.N)(null===(n=i.composed)||void 0===n?void 0:n.reason);return!i.isRest&&(l.length||o)?(0,t.jsxs)("details",{className:"".concat(m().workoutWhy," ph-no-capture"),"data-testid":"workout-why",children:[(0,t.jsxs)("summary",{className:m().decisionsToggle,children:[(0,t.jsx)(a.G,{icon:s._tD,"aria-hidden":"true"}),"Why this workout"]}),(0,t.jsxs)("div",{className:m().workoutWhyContent,children:[l.map(function(e){return(0,t.jsxs)("article",{className:m().workoutDecision,children:[(0,t.jsx)("h4",{className:m().decisionTitle,children:e.title}),(0,t.jsx)("p",{className:m().decisionExplanation,children:e.explanation}),(0,t.jsxs)("details",{className:m().decisionEvidence,children:[(0,t.jsxs)("summary",{children:[e.source," ",(0,t.jsx)("span",{"aria-hidden":"true",children:"›"})]}),(0,t.jsx)("p",{children:e.detail})]})]},e.title)}),o&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("h4",{className:m().decisionTitle,children:"The thinking behind this session"}),(0,t.jsx)("p",{className:m().decisionExplanation,children:o})]})]})]},String(i.id)):null}},82572:function(e,n,i){"use strict";i.d(n,{$M:function(){return c},MH:function(){return S},PH:function(){return y},QX:function(){return r},RL:function(){return j},U8:function(){return w},Xs:function(){return v},cQ:function(){return m},e4:function(){return d},hj:function(){return l},hp:function(){return p},iH:function(){return g},is:function(){return u},o$:function(){return x},pk:function(){return b}
1,tt:function(){return _},ty:function(){return a},uH:function(){return f},vk:function(){return o},we:function(){return N},x$:function(){return s},y2:function(){return t}});var t=219,a=100,s=114,r=116,l=117,o=107,d=113,c=99,u=127,m=128,v=129,p=140,h="Kickoff - Goals",k="Kickoff - Special Cases",y={1:h,2:h,133:"Kickoff - Age",3:"Kickoff - Nutrition Interests",4:"Kickoff - Preferred Coach Gender",5:k,6:k,matches:"Kickoff - Your coach",payment:"Kickoff - Start Training"},f=[181,182,183,158,164,165,166,167,168,169,170,171,172,173,174,176,177,179],g={158:"Weight training",160:"High intensity interval training (HIIT)",153:"Running and/or sprint drills",157:"Swimming",154:"Road biking",215:"Yoga",216:"Pilates",217:"Barre",218:"Boxing/kickboxing",230:"Not sure yet"},_="specialty-weightloss-male",N="specialty-weightloss-female",x="specialty-weightloss",b={WEIGHT:9,HEIGHT:10,DATE_OF_BIRTH:11,SPECIAL_CIRCUMSTANCES:224,EXERCISE_TYPES:154},w={EVENT:207,SAME_COACH:229},j={TRAINING_FOR_EVENT:"5"},S={1:"Client likes constantly changing workouts - Client gets bored easily and needs constant novelty!","-1":"Client likes to master exercises and get the most out of them before progressing",0:"Client likes a balance of novelty and mastery"}},87854:function(e,n,i){"use strict";i.d(n,{Z:function(){return r}});var t=i(93128),a=i(67294),s=function(){var e=(0,t._)((0,a.useState)(!1),2),n=e[0],i=e[1];return(0,a.useEffect)(function(){return i(!0)},[]),n},r=function(e){var n=e.children;return s()?n:null}},80129:function(e,n,i){"use strict";i.d(n,{V:function(){return p},e:function(){return h}});var t=i(32207),a=i(93128),s=i(53353),r=i(85893),l=i(67294),o=i(93967),d=i.n(o),c=i(35730),u=i.n(c),m=(0,l.createContext)(),v=0,p=function(e){var n=e.position,i=void 0===n?"top":n,o=e.children,c=(0,a._)((0,l.useState)([]),2),p=c[0],h=c[1],k=(0,l.useCallback)(function(e){h(function(n){return n.filter(function(n){return n.id!==e})})},[]);return(0,l.useEffect)(function(){var e=Date.now(),n=p.map(function(n){var i=n.duration-(e-n.createdAt);return i<0&&k(n.id),setTimeout(function(){return k(n)},i)});return function(){n.forEach(function(e){return e&&clearTimeout(e)})}},[k,p]),(0,r.jsxs)(m.Provider,{value:{add:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=n.duration,a=n.position,r=v++,l=Date.now();h((0,s._)(p).concat([{content:e,id:r,duration:void 0===t?3e3:t,createdAt:l,position:void 0===a?i:a}]))},remove:k},children:[o,p.map(function(e){var n=e.content,i=e.id,a=e.position;return(0,t._)(e,["content","id","position"]),(0,r.jsx)("div",{className:d()(u().toastContainer,u()[a]),children:(0,r.jsx)("div",{className:d()(u().toast,u()[a]),onClick:function(){return k(i)},children:n},i)})})]})},h=function(){return(0,l.useContext)(m)}},89007:function(e,n,i){"use strict";i.d(n,{Z:function(){return v}});var t=i(30137),a=i(73292),s=i(76341),r=i(67462),l=i(97582),o=i(62286),d=i(53103),c=i(63953),u=i(7433),m=i(74548),v=function(e){var n;return n=(0,t._)(function(n){var i,t,v,p,h,k,y;return(0,l.Jh)(this,function(l){switch(l.label){case 0:if(i=n.ctx||n,t=n.apolloClient,v=i.query.token,p=i.pathname,!("string"==typeof v&&""!==v&&"undefined"!==v&&"null"!==v))return[3,2];return[4,t.mutate({mutation:m.signInToken,variables:{token:v}})];case 1:(h=l.sent().data.signInToken.sessionToken)&&((0,o.setCookie)(i,c.I,h,{path:"/",maxAge:30*d.x4}),i.overrideCookies=(0,a._)({},c.I,h),t.__contextRef&&(t.__contextRef.current=i)),l.label=2;case 2:return k="/client-sign-up"===p,[4,t.query({query:k?u.getCurrentUserWithSurvey:u.getCurrentUser,fetchPolicy:"network-only"})];case 3:return y=l.sent(),[2,e((0,r._)((0,s._)({},n),{currentUserPayload:y}))]}})}),function(e){return n.apply(this,arguments)}}},9489:function(e,n,i){"use strict";i.r(n),i.d(n,{default:function(){return eh}});var t=i(85893),a=i(9008),s=i.n(a),r=i(30470),l=i(89007),o=i(37977),d=i(47915),c=i(80129),u=i(30137),m=i(93128),v=i(53353),p=i(97582),h=i(67294),k=i(50319),y=i(6812),f=i(41837),g=i(14048),_=i(64497),N=i(82572);function x(e){return e?e.split("_").map(function(e){return e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()}).join(" "):""}var b={WEIGHT_LOSS:"Lose Fat",HYPERTROPHY:"Tone Muscles",STRENGTH:"Build Muscle/Strength",ENDURANCE:"Build Endurance/Train for Race",GENERAL_FITNESS:"Improve Overall Fitness",REHAB:"Recover from an Injury"};function w(e){var n;return e?null!==(n=b[e])&&void 0!==n?n:x(e):""}var j=new Set(Object.values(N.iH).map(function(e){return e.toLowerCase()}));function S(e){return null==e||""===e?"-":String(e).replace(/\|/g,"\\|").replace(/\r?\n/g," ").trim()}function F(e){return e.length?["| Exercise | Role | Sets / reps | Why |","| --- | --- | --- | --- |"].concat((0,v._)(e.map(function(e){var n,i,t;return"| ".concat(S(e.name)," | ").concat(S(x(e.role))," | ").concat(S((t=(null!==(i=e.prescription)&&void 0!==i?i:[]).map(function(e){return/^x$/i.test(e.unit.trim())?"".concat(e.value):"".concat(e.value," ").concat(e.unit)})).length?"".concat(e.sets," sets \xd7 ").concat(t.join(" \xd7 ")):"".concat(e.sets," sets"))," | ").concat(S(null!==(n=e.reason)&&void 0!==n?n:"")," |")})),[""]):["_(no exercises)_",""]}function C(e){var n=[e.dayDescription?"goal: ".concat(e.dayDescription):null,e.emphasis?"emphasis: ".concat(e.emphasis):null,null!=e.durationTarget?"~".concat(e.durationTarget," min"):null].filter(
1Boolean);return n.length?n.join(" \xb7 "):null}function I(e){return e.length?["| Exercise | Reps / load |","| --- | --- |"].concat((0,v._)(e.map(function(e){var n;return"| ".concat(S(e.name)," | ").concat(S((null!=(n=e.prescription)?n:[]).map(function(e){return/^x$/i.test(e.unit.trim())?"".concat(e.value):"".concat(e.value," ").concat(e.unit)}).join(" \xd7 "))," |")})),[""]):["_(no exercises)_",""]}var R=i(76341),T=i(37271),E=i(11679),P=i(54577),L=i(12273),A=i(27615),D=i.n(A);function V(e){var n,i,a,s,r,l,o,d=e.result,c=(0,m._)((0,h.useState)(!1),2),u=c[0],v=c[1],p=(0,m._)((0,h.useState)(),2),k=p[0],y=p[1],f=u?(n=d.composed.length?d.composed.map(function(e){return{id:"".concat(d.id,":").concat(e.dayOffset),dayOffset:e.dayOffset,intent:e.dayIntent,isRest:e.isRest,workoutTemplate:e.videoTemplate,composed:{name:e.name,reason:e.reason,sections:e.sections.length?e.sections:void 0,exercises:e.exercises}}}):d.days.map(function(e){return{id:"".concat(d.id,":").concat(e.dayOffset),dayOffset:e.dayOffset,intent:e.dayIntent,isRest:e.isRest,workoutTemplate:e.pickedTemplateName?{name:e.pickedTemplateName}:void 0,composed:e.exercises.length||e.sections.length?{name:e.pickedTemplateName||e.name,exercises:e.exercises,sections:e.sections.length?e.sections.map(function(e){return{kind:"Warm Up"===e.kind?"WARM_UP":"Cool Down"===e.kind?"COOL_DOWN":"WORKING",rounds:e.rounds,exercises:e.exercises}}):void 0}:void 0}}),i=d.evidence.map(function(e){return(0,R._)({},e)}),a=function(e,n){if(n){var t,a=i.find(function(n){return n.source.toLowerCase()===e.toLowerCase()});a?(null===(t=a.detail)||void 0===t?void 0:t.trim())||(a.detail=n):i.push({source:e,fact:n,detail:n})}},(s=d.inputs)&&(a("Fitness goal",s.goalType?"Goal Type: ".concat(s.goalType):void 0),a("Preferred workout types",s.preferredModalities.join(", ")||void 0)),{weekRationale:d.weekRationale,weekIntent:d.weekIntent,evidence:i,needsReview:d.needsReview,needsReviewReasons:d.needsReviewReasons,workouts:n}):null,g=null!==(l=null==f?void 0:null===(r=f.workouts)||void 0===r?void 0:r.filter(function(e){return!e.isRest}))&&void 0!==l?l:[],_=null!==(o=g.find(function(e){return e.id===k}))&&void 0!==o?o:g[0];return(0,t.jsxs)("details",{className:"".concat(D().coachPreview," ph-no-capture"),onToggle:function(e){return v(e.currentTarget.open)},children:[(0,t.jsx)("summary",{className:D().weekIntentSummary,children:"Coach-facing preview"}),f&&(0,t.jsxs)("div",{className:D().coachPreviewBody,children:[(0,t.jsx)(E.Z,{label:"Eval preview",children:(0,t.jsx)(T.Z,{week:f,onSelectWorkout:function(e){return y(e.id)}})}),_&&(0,t.jsxs)("div",{className:D().coachPreviewWorkout,children:[(0,t.jsxs)("label",{children:["Workout",(0,t.jsx)("select",{value:String(_.id),onChange:function(e){return y(e.target.value)},children:g.map(function(e){var n;return(0,t.jsxs)("option",{value:String(e.id),children:["Day ",(null!==(n=e.dayOffset)&&void 0!==n?n:0)+1,":"," ",(0,L.sx)(e)]},e.id)})})]}),(0,t.jsx)(P.Z,{workout:_,week:f})]}),(0,t.jsx)("p",{className:D().coachPreviewCaption,children:"Uses this run’s saved output with the current coach-facing design. Previous-week and coach-scheduled workout context is not included in this run."})]})]})}var B=[{key:"PLANNER",label:"Planner",description:"Plans the week skeleton. Does not see the template catalog."},{key:"PICKER",label:"Picker",description:"Selects templates to realize the plan. Sees the catalog."},{key:"COMPOSER",label:"Composer",description:"Composes a day from individual exercises (exercise-composition mode). One call per training day."},{key:"EDIT_ROUTER",label:"Edit Router",description:"Interprets coach feedback on a draft week into targeted edit operations (or a full re-plan)."}];function O(e){if(!e)return"";var n=new Date(e);return Number.isNaN(n.getTime())?"":n.toLocaleString("en-US",{year:"numeric",month:"short",day:"numeric",hour:"numeric",minute:"2-digit"})}function W(e){return e?e.split("_").map(function(e){return e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()}).join(" "):""}var G={WEIGHT_LOSS:"Lose Fat",HYPERTROPHY:"Tone Muscles",STRENGTH:"Build Muscle/Strength",ENDURANCE:"Build Endurance/Train for Race",GENERAL_FITNESS:"Improve Overall Fitness",REHAB:"Recover from an Injury"};function H(e){var n;return e?null!==(n=G[e])&&void 0!==n?n:W(e):""}function U(e){return e.map(function(e){return e.charAt(0).toUpperCase()+e.slice(1)}).join(", ")}var M=new Set(Object.values(N.iH).map(function(e){return e.toLowerCase()}));function K(e){var n=[],i=[],t=!0,a=!1,s=void 0;try{for(var r,l=e[Symbol.iterator]();!(t=(r=l.next()).done);t=!0){var o=r.value;M.has(o.trim().toLowerCase())?n.push(o):i.push(o)}}catch(e){a=!0,s=e}finally{try{t||null==l.return||l.return()}finally{if(a)throw s}}return{workoutTypes:n,prefers:i}}function q(e){return e.map(function(e){return/^x$/i.test(e.unit.trim())?"".concat(e.value):"".concat(e.value," ").concat(e.unit)}).join(" \xd7 ")}function Y(e){var n,i,a,s,r=e.version,l=e.onChanged,o=(0,c.e)().add,d=(0,m._)((0,h.useState)(!1),2),v=d[0],y=d[1],f=(0,m._)((0,h.useState)(null!==(s=r.label)&&void 0!==s?s:""),2),g=f[0],N=f[1],x=(0,m._)((0,h.useState)(r.body),2),b=x[0],w=x[1],j=(0,m._)((0,k.D)(_.updatePromptVersion),2),S=j[0],F=j[1].loading,C=(0,m._)((0,k.D)(_.promotePromptVersion),2),I=C[0],R=C[1].loading,T="draft"===r.status,E=(n=(0,u._)(function(){var e,n;return(0,p.Jh)(this,function(i){switch(i.label){case 0:if(!b.trim())return o("Prompt body cannot be empty"),[2];i.label=1;case 1:return i.trys.push([1,3,,4]),[4,S({variables:{id:r.id,label:g||null,body:b}})];case 2:return i.sent(),o("Draft saved"),y(!1),l(),[3,4];case 3:return e=i.sent(),o("Failed to save: ".concat(null!==(n=null==e?void 0:e.message)&&void 0!==n?n:"unknown error")),[3,4];case 4:return[2]}})}),function(){return n.apply(this,arguments)}),P=(i=(0,u._)(function(){var e,n;return(0,p.Jh)(this,function(i){switch(i.label){case 0:if(!window.confirm("Promote this ".concat(r.stage," prompt? Production generation will read it, ")+"and any currently-promoted ver
1sion for this stage will be archived. This cannot be undone."))return[2];i.label=1;case 1:return i.trys.push([1,3,,4]),[4,I({variables:{id:r.id}})];case 2:return i.sent(),o("Prompt promoted"),l(),[3,4];case 3:return e=i.sent(),o("Failed to promote: ".concat(null!==(n=null==e?void 0:e.message)&&void 0!==n?n:"unknown error")),[3,4];case 4:return[2]}})}),function(){return i.apply(this,arguments)});return(0,t.jsxs)("div",{className:"promoted"===r.status?"".concat(D().versionCard," ").concat(D().versionCardPromoted):D().versionCard,"data-testid":"prompt-version-".concat(r.id),children:[(0,t.jsxs)("div",{className:D().versionHeader,children:[(0,t.jsxs)("div",{className:D().versionMeta,children:[(0,t.jsx)("span",{className:D().versionLabel,children:r.label||"Untitled"}),(0,t.jsxs)("span",{className:D().versionId,children:["#",r.id]}),(0,t.jsx)("span",{className:"".concat(D().statusBadge," ").concat("promoted"===(a=r.status)?D().statusPromoted:"archived"===a?D().statusArchived:D().statusDraft),children:r.status}),(0,t.jsx)("span",{className:D().versionDate,children:"promoted"===r.status&&r.promotedAt?"promoted ".concat(O(r.promotedAt)):"created ".concat(O(r.createdAt))})]}),T&&!v&&(0,t.jsxs)("div",{className:D().versionActions,children:[(0,t.jsx)("button",{type:"button",className:D().actionButton,onClick:function(){return y(!0)},children:"Edit"}),(0,t.jsx)("button",{type:"button",className:"".concat(D().actionButton," ").concat(D().promoteButton),disabled:R,onClick:P,"data-testid":"promote-prompt-".concat(r.id),children:R?"Promoting…":"Promote"})]})]}),v?(0,t.jsxs)("div",{className:D().editForm,children:[(0,t.jsxs)("div",{className:D().field,children:[(0,t.jsx)("label",{className:D().fieldLabel,htmlFor:"label-".concat(r.id),children:"Label"}),(0,t.jsx)("input",{id:"label-".concat(r.id),className:D().input,type:"text",value:g,onChange:function(e){return N(e.target.value)}})]}),(0,t.jsxs)("div",{className:D().field,children:[(0,t.jsx)("label",{className:D().fieldLabel,htmlFor:"body-".concat(r.id),children:"Body"}),(0,t.jsx)("textarea",{id:"body-".concat(r.id),className:D().textarea,value:b,onChange:function(e){return w(e.target.value)}})]}),(0,t.jsxs)("div",{className:D().editActions,children:[(0,t.jsx)("button",{type:"button",className:"".concat(D().actionButton," ").concat(D().promoteButton),disabled:F,onClick:E,children:F?"Saving…":"Save draft"}),(0,t.jsx)("button",{type:"button",className:D().actionButton,disabled:F,onClick:function(){var e;N(null!==(e=r.label)&&void 0!==e?e:""),w(r.body),y(!1)},children:"Cancel"})]})]}):(0,t.jsx)("pre",{className:D().body,children:r.body})]})}function Z(e){var n,i=e.stage,a=e.onCreated,s=(0,c.e)().add,r=(0,m._)((0,h.useState)(!1),2),l=r[0],o=r[1],d=(0,m._)((0,h.useState)(""),2),v=d[0],y=d[1],f=(0,m._)((0,h.useState)(""),2),g=f[0],N=f[1],x=(0,m._)((0,k.D)(_.createPromptVersion),2),b=x[0],w=x[1].loading,j=(n=(0,u._)(function(){var e,n;return(0,p.Jh)(this,function(t){switch(t.label){case 0:if(!g.trim())return s("Prompt body is required"),[2];t.label=1;case 1:return t.trys.push([1,3,,4]),[4,b({variables:{stage:i,label:v||null,body:g}})];case 2:return t.sent(),s("Draft created"),y(""),N(""),o(!1),a(),[3,4];case 3:return e=t.sent(),s("Failed to create: ".concat(null!==(n=null==e?void 0:e.message)&&void 0!==n?n:"unknown error")),[3,4];case 4:return[2]}})}),function(){return n.apply(this,arguments)});return l?(0,t.jsxs)("div",{className:D().newDraftForm,children:[(0,t.jsxs)("div",{className:D().field,children:[(0,t.jsx)("label",{className:D().fieldLabel,htmlFor:"new-label-".concat(i),children:"Label"}),(0,t.jsx)("input",{id:"new-label-".concat(i),className:D().input,type:"text",placeholder:"e.g. v3 — tighter rest-day rules",value:v,onChange:function(e){return y(e.target.value)},"data-testid":"new-draft-label-".concat(i)})]}),(0,t.jsxs)("div",{className:D().field,children:[(0,t.jsx)("label",{className:D().fieldLabel,htmlFor:"new-body-".concat(i),children:"Body"}),(0,t.jsx)("textarea",{id:"new-body-".concat(i),className:D().textarea,placeholder:"Instruction block for this stage…",value:g,onChange:function(e){return N(e.target.value)},"data-testid":"new-draft-body-".concat(i)})]}),(0,t.jsxs)("div",{className:D().editActions,children:[(0,t.jsx)("button",{type:"button",className:"".concat(D().actionButton," ").concat(D().promoteButton),disabled:w,onClick:j,"data-testid":"save-draft-".concat(i),children:w?"Creating…":"Create draft"}),(0,t.jsx)("button",{type:"button",className:D().actionButton,disabled:w,onClick:function(){o(!1),y(""),N("")},children:"Cancel"})]})]}):(0,t.jsxs)("button",{type:"button",className:D().actionButton,onClick:function(){return o(!0)},"data-testid":"new-draft-".concat(i),children:["+ New ",i," draft"]})}function $(e){var n=e.stage,i=e.description,a=e.versions,s=e.onCh
1anged,r=a.filter(function(e){return e.stage===n.key}),l=r.some(function(e){return"promoted"===e.status});return(0,t.jsxs)("details",{className:D().stageGroup,"data-testid":"stage-".concat(n.key),children:[(0,t.jsxs)("summary",{className:D().stageSummary,children:[(0,t.jsx)("span",{className:D().stageName,children:n.label})," ",(0,t.jsxs)("span",{className:D().stageCount,children:["(",r.length,")",l?"":" \xb7 no promoted"]})]}),(0,t.jsxs)("div",{className:D().stageHeader,children:[(0,t.jsx)("div",{className:D().subtitle,children:i}),(0,t.jsx)(Z,{stage:n.key,onCreated:s})]}),!l&&(0,t.jsx)("div",{className:D().empty,children:"No promoted version — production falls back to the in-code default for this stage."}),(0,t.jsx)("div",{className:D().versionList,children:0===r.length?(0,t.jsx)("div",{className:D().empty,children:"No versions yet."}):r.map(function(e){return(0,t.jsx)(Y,{version:e,onChanged:s},e.id)})})]})}function z(){var e,n=(0,y.a)(g.evalPersonas,{fetchPolicy:"cache-and-network"}),i=n.data,a=n.loading,s=n.error,r=null!==(e=null==i?void 0:i.evalPersonas)&&void 0!==e?e:[],l=r.filter(function(e){return e.isEnabled}).length;return(0,t.jsx)("section",{className:D().section,children:(0,t.jsxs)("details",{className:D().archetypes,children:[(0,t.jsxs)("summary",{className:D().archetypesSummary,children:["Personas",r.length?" (".concat(l," active / ").concat(r.length,")"):""]}),(0,t.jsxs)("div",{className:D().subtitle,children:["The frozen personas evals run against. Constructed personas are materialized from the spec by the"," ",(0,t.jsx)("code",{children:"build:archetype-personas"})," job; captured/adversarial cells come from committed snapshots. Disabled personas stay listed but are skipped by default runs."]}),a&&!i?(0,t.jsx)("div",{className:D().empty,children:"Loading…"}):s?(0,t.jsxs)("div",{className:D().empty,children:["Couldn’t load personas: ",s.message]}):0===r.length?(0,t.jsxs)("div",{className:D().empty,children:["No personas yet — run the ",(0,t.jsx)("code",{children:"build:archetype-personas"})," job to materialize them."]}):(0,t.jsxs)("table",{className:D().table,children:[(0,t.jsx)("thead",{children:(0,t.jsxs)("tr",{children:[(0,t.jsx)("th",{children:"Persona"}),(0,t.jsx)("th",{children:"Goal"}),(0,t.jsx)("th",{children:"2nd goal"}),(0,t.jsx)("th",{children:"Gender"}),(0,t.jsx)("th",{children:"Experience"}),(0,t.jsx)("th",{children:"Equipment"}),(0,t.jsx)("th",{children:"Days"}),(0,t.jsx)("th",{children:"Injury"}),(0,t.jsx)("th",{title:"Variety/novelty preference (workoutDynamism): -1 = prefers consistency, 0 = balanced, +1 = wants frequent variety",children:"Novelty"})]})}),(0,t.jsx)("tbody",{children:r.map(function(e){var n=K(e.preferredModalities),i=[e.conditions.length?"conditions: ".concat(e.conditions.join(", ")):null,n.workoutTypes.length?"workout types: ".concat(n.workoutTypes.join(", ")):null,n.prefers.length?"prefers: ".concat(n.prefers.join(", ")):null,e.excludedWords.length?"avoids: ".concat(e.excludedWords.join(", ")):null].filter(Boolean);return(0,t.jsxs)("tr",{"data-testid":"archetype-".concat(e.personaKey),className:e.isEnabled?void 0:D().archDisabled,children:[(0,t.jsxs)("td",{children:[(0,t.jsxs)("div",{className:D().archLabel,children:[(0,t.jsxs)("span",{className:D().personaId,children:["#",e.id]}),e.label,!e.isEnabled&&(0,t.jsx)("span",{className:"".concat(D().statusBadge," ").concat(D().statusArchived),children:"disabled"})]}),i.length>0&&(0,t.jsx)("div",{className:D().archInputs,children:i.join(" \xb7 ")}),e.notes&&(0,t.jsxs)("div",{className:D().archInstructions,children:[(0,t.jsx)("strong",{children:"AI Instructions:"})," ",e.notes]}),e.coachNotes&&(0,t.jsxs)("div",{className:D().archInputs,children:[(0,t.jsx)("strong",{children:"Coach Notes:"})," ",e.coachNotes]})]}),(0,t.jsx)("td",{children:H(e.goalType)}),(0,t.jsx)("td",{children:e.secondaryGoal?H(e.secondaryGoal):"-"}),(0,t.jsx)("td",{children:e.gender?W(e.gender):"-"}),(0,t.jsx)("td",{children:W(e.experienceLevel)}),(0,t.jsx)("td",{children:W(e.equipmentLevel)}),(0,t.jsx)("td",{children:e.daysPerWeek}),(0,t.jsx)("td",{children:W(e.injuryStatus)}),(0,t.jsx)("td",{children:e.workoutDynamism})]},e.id)})})]})]})})}function Q(e){var n="promoted"===e.status?" ★":"";return"#".concat(e.id," — ").concat(e.label||"Untitled").concat(n)}function J(e){var n,i,a=e.versions,s=e.onCompleted,r=(0,c.e)().add,l=a.filter(function(e){return"PLANNER"===e.stage}),o=a.filter(function(e){return"PICKER"===e.stage}),d=a.filter(function(e){return"COMPOSER"===e.stage}),v=(0,m._)((0,h.useState)("two_stage"),2),f=v[0],N=v[1],x=(0,m._)((0,h.useState)(""),2),b=x[0],w=x[1],j=(0,m._)((0,h.useState)(""),2),S=j[0],F=j[1],C=(0,m._)((0,h.useState)(""),2),I=C[0],R=C[1],T=(0,m._)((0,h.useState)(null),2),E=T[0],P=T[1],L=(0,m._)((0,k.D)(_.enqueueEvalRun),2),A=L[0],V=L[1].loading,B=(0,y.a)(g.evalRun,{variables:{id:E},skip:!E,fetchPolicy:"network-only",pollInterval:1500}),O=B.data,W=B.stopPolling,G=null!==(i=null==O?void 0:O.evalRun)&&void 0!==i?i:null;(0,h.useEffect)(function(){var e;G&&("complete"===(e=G.status)||"failed"===e)&&(W(),P(null),s(),r("complete"===G.status?"Eval run #".concat(G.id," complete"):"Eval run #".concat(G.id," failed")))},[null==G?void 0:G.status,null==G?void 0:G.id]);var H=(n=(0,u._)(function(){var e,n,i,t,a;return(0,p.Jh)(this,function(l){switch(l.label){case 0:if(e="compose"===f?I:S,!b||!e)return r("compose"===f?"Pick a Planner and a Composer version":"Pick a Planner and a Picker version"),[2];l.label=1;case 1:return l.trys.push([1,3,,4]),[4,A({variables:"compose"===f?{plannerVersionId:b,composerVersionId:I}:{plannerVersionId:b,pickerVersionId:S}})];case 2:return(null==(i=null==(n=l.sent().data)?void 0:n.enqueueEvalRun)?void 0:i.id)&&(P(i.id),s(),r("Eval run #".concat(i.id," queued"))),[3,4];case 3:return t=l.sent(),r("Failed to start run: ".concat(null!==(a=null==t?void 0:t.message)&&void 0!==a?a:"unknown")),[3,4];case 4:return[2]}})}),function(){return n.apply(this,arguments)}),U=V||!!E,M=G?"running"===G.status?"running ".concat(G.completedCount,"/").concat(G.total):G.status:V?"queuing…":null;return(0,t.jsxs)("div",{className:D().runControl,"data-testid":"eval-run-control",children:[(0,t.jsxs)("div",{className:D().runField,children:[(0,t.jsx)("label",{className:D().fieldLabel,htmlFor:"run-mode",children:"Mode"}),(0,t.jsxs)("select",{id:"run-mode",className:D().select,value:f,onChange:function(e){return N(e.target.value)},disabled:U,"data-testid":"run-mode-select",children:[(0,t.jsx)("option",{value:"two_stage",children:"Two-stage (pick templates)"}),(0,t.jsx)("option",{value:"compose",children:"Compose (build from exercises)"})]})]}),(0,t.jsxs)("div",{className:D().runField,children:[(0,t.jsx)("label",{className:D().fieldLabel,htmlFor:"run-planner",children:"Planner version"}),(0,t.jsxs)("select",{id:"run-planner",className:D().select,value:b,onChange:function(e){return w(e.target.value)},disabled:U,"data-testid":"run-planner-select",children:[(0,t.jsx)("option",{value:"",children:"Select a Planner…"}),l.map(function(e){return(0,t.jsx)("option",{value:e.id,children:Q(e)},e.id)})]})]}),"compose"===f?(0,t.jsxs)("div",{className:D().runField,children:[(0,t.jsx)("label",{className:D().fieldLabel,htmlFor:"run-composer",children:"Composer version"}),(0,t.jsxs)("select",{id:"run-composer",className:D().select,value:I,onChange:function(e){return R(e.target.value)},disabled:U,"data-testid":"run-composer-select",children:[(0,t.jsx)("option",{value:"",children:"Select a Composer…"}),d.map(function(e){return(0,t.jsx)("option",{value:e.id,children:Q(e)},e.id)})]})]}):(0,t.jsxs)("div",{className:D().runField,children:[(0,t.jsx)("label",{className:D().fieldLabel,htmlFor:"run-picker",children:"Picker version"}),(0,t.jsxs)("select",{id:"run-picker",className:D().select,value:S,onChange:function(e){return F(e.target.value)},disabled:U,"data-testid":"run-picker-select",children:[(0,t.jsx)("option",{value:"",children:"Select a Picker…"}),o.map(function(e){return(0,t.jsx)("option",{value:e.id,children:Q(e)},e.id)})]})]}),(0,t.jsxs)("div",{className:D().runActions,children:[(0,t.jsx)("button",{type:"button",className:"".concat(D().actionButton," ").concat(D().promoteButton),disabled:U||!b||("compose"===f?!I:!S),onClick:H,"data-testid":"run-eval-button",children:U?"Running…":"Run eval"}),M&&(0,t.jsx)("span",{className:D().runStatus,"data-testid":"eval-run-live-status",children:M})]})]})}var X={PLANNER:"Planner (prompt)",PICKER:"Picker (prompt)",COMPOSER:"Composer (prompt)",ENGINE:"Engine (our code)"};function ee(e){var n=e.checks;if(!n.length)return null;var i=n.filter(function(e){return"fail"===e.status}).length;return(0,t.jsxs)("details",{className:D().checks,open:i>0,children:[(0,t.jsxs)("summary",{className:D().checksSummary,children:["Checks"," ",(0,t.jsx)("span",{className:i>0?D().checksFail:D().checksPass,children:i>0?"(".concat(i," failing)"):"(all passing)"})]}),["PLANNER","PICKER","COMPOSER","ENGINE"].map(function(e){var i=n.filter(function(n){return n.owner===e});return i.length?(0,t.jsxs)("div",{className:D().checkGroup,children:[(0,t.jsx)("div",{className:D().checkOwner,children:X[e]}),(0,t.jsx)("ul",{className:D().checkList,children:i.map(function(e){var n,i;return(0,t.jsxs)("li",{className:D().checkItem,children:[(0,t.jsx)("span",{className:"".concat(D().checkBadge," ").concat("pass"===(n=e.status)?D().l1Pass:"fail"===n?D().l1Fail:D().l1Na),children:"pass"===(i=e.status)?"✓":"fail"===i?"✕":"–"}),(0,t.jsx)("span",{className:D().checkLabel,children:e.label}),e.detail&&(0,t.jsx)("span",{className:D().checkDetail,children:e.detail})]},e.id)})})]},e):null})]})}function en(e){var n=e.ex;return(0,t.jsxs)("li",{className:D().composedItem,children:[(0,t.jsx)("div",{className:D().composedItemName,children:(0,t.jsx)("span",{className:D().composedName,children:n.name})}),n.prescription.length>0&&(0,t.jsx)("span",{className:D().composedRx,children:q(n.prescription)})]})}function ei(e){var n=e.ex;return(0,t.jsxs)("li",{className:D().composedItem,children:[(0,t.jsxs)("div",{className:D().composedItemName,children:[(0,t.jsx)("span",{className:D().composedName,children:n.name}),(0,t.jsx)("span",{className:"".concat(D().roleTag," ").concat("primary"===n.role?D().roleTagPrimary:D().roleTagAccessory),children:W(n.role)})]}),(0,t.jsxs)("span",{className:D().composedRx,children:[n.sets," sets",n.prescription.length>0&&" \xd7 ".concat(q(n.prescription))]}
1),n.reason&&(0,t.jsx)("div",{className:D().composedReason,children:n.reason})]})}function et(e){var n=[e.dayDescription?"goal: ".concat(e.dayDescription):null,e.emphasis?"emphasis: ".concat(e.emphasis):null,null!=e.durationTarget?"~".concat(e.durationTarget," min"):null].filter(Boolean);return n.length?n.join(" \xb7 "):null}function ea(e){var n=e.dayOffset,i=e.dayIntent,a=e.name,s=e.inputLine,r=e.inputLabel,l=e.reason,o=e.children,d="Day ".concat(n," \xb7 ").concat(a||W(i)||"-");return(0,t.jsxs)("details",{className:D().composedDay,children:[(0,t.jsxs)("summary",{className:D().composedDaySummary,children:[(0,t.jsx)("span",{className:D().composedDayHead,children:d}),s&&(0,t.jsxs)("div",{className:D().composedDayInput,children:[(0,t.jsx)("span",{className:D().metaLabel,children:void 0===r?"Composer input":r})," ",s]}),l&&(0,t.jsx)("div",{className:D().composedDayReason,children:l})]}),o]})}function es(e){var n,i,a,s,r,l,o=e.result;return(0,t.jsxs)("div",{className:"".concat(D().resultCard," ph-no-capture"),"data-testid":"eval-result-".concat(o.personaKey),children:[(0,t.jsxs)("div",{className:D().resultHeader,children:[(0,t.jsx)("span",{className:D().archLabel,children:o.personaLabel}),(0,t.jsxs)("span",{className:D().personaId,children:["#",o.personaId]}),o.needsReview&&(0,t.jsx)("span",{className:"".concat(D().statusBadge," ").concat(D().statusDraft),children:"needs review"})]}),o.inputs&&(i=K((n=o.inputs).preferredModalities),s=[["Gender",n.gender?W(n.gender):"—"],["Experience",W(n.experienceLevel)],["Equipment",W(n.equipmentLevel)],["Days / week",String(n.daysPerWeek)],["OPT phase",null!=n.optPhase?String(n.optPhase):"—"],["Novelty",(a=n.workoutDynamism)>0?"High \xb7 wants variety":a<0?"Low \xb7 prefers consistency":"Balanced"]],r="none"!==n.injuryStatus||n.conditions.length>0||n.blockedPatterns.length>0||n.bodyParts.length>0,l=n.preferredModalities.length>0||n.excludedWords.length>0,(0,t.jsxs)("div",{className:D().inputsPanel,children:[(0,t.jsx)("div",{className:D().inputsHeading,children:"Inputs"}),(0,t.jsxs)("div",{className:D().inputGoal,children:[(0,t.jsx)("span",{className:D().inputGoalLabel,children:"Goal"}),(0,t.jsx)("span",{className:D().inputGoalValue,children:H(n.goalType)}),n.secondaryGoal&&(0,t.jsxs)("span",{className:D().inputGoalSecondary,children:["+ ",H(n.secondaryGoal)]})]}),(0,t.jsx)("dl",{className:D().statGrid,children:s.map(function(e){var n=(0,m._)(e,2),i=n[0],a=n[1];return(0,t.jsxs)("div",{className:D().stat,children:[(0,t.jsx)("dt",{className:D().statKey,children:i}),(0,t.jsx)("dd",{className:D().statVal,children:a})]},i)})}),r&&(0,t.jsxs)("div",{className:"".concat(D().inputBlock," ").concat(D().inputBlockHealth),children:[(0,t.jsx)("div",{className:D().inputBlockTitle,children:"Health & safety"}),(0,t.jsxs)("dl",{className:D().kvList,children:[(0,t.jsxs)("div",{className:D().kvRow,children:[(0,t.jsx)("dt",{className:D().kvKey,children:"Injury"}),(0,t.jsx)("dd",{className:D().kvVal,children:W(n.injuryStatus)})]}),n.conditions.length>0&&(0,t.jsxs)("div",{className:D().kvRow,children:[(0,t.jsx)("dt",{className:D().kvKey,children:"Conditions"}),(0,t.jsx)("dd",{className:D().kvVal,children:n.conditions.join(", ")})]}),n.bodyParts.length>0&&(0,t.jsxs)("div",{className:D().kvRow,children:[(0,t.jsx)("dt",{className:D().kvKey,children:"Body focus"}),(0,t.jsx)("dd",{className:D().kvVal,children:U(n.bodyParts)})]}),n.blockedPatterns.length>0&&(0,t.jsxs)("div",{className:D().kvRow,children:[(0,t.jsx)("dt",{className:D().kvKey,children:"Avoid"}),(0,t.jsx)("dd",{className:D().kvVal,children:U(n.blockedPatterns)})]})]})]}),l&&(0,t.jsxs)("div",{className:"".concat(D().inputBlock," ").concat(D().inputBlockPrefs),children:[(0,t.jsx)("div",{className:D().inputBlockTitle,children:"Preferences"}),(0,t.jsxs)("dl",{className:D().kvList,children:[i.workoutTypes.length>0&&(0,t.jsxs)("div",{className:D().kvRow,children:[(0,t.jsx)("dt",{className:D().kvKey,children:"Preferred workout types"}),(0,t.jsx)("dd",{className:D().kvVal,children:U(i.workoutTypes)})]}),i.prefers.length>0&&(0,t.jsxs)("div",{className:D().kvRow,children:[(0,t.jsx)("dt",{className:D().kvKey,children:"Prefers"}),(0,t.jsx)("dd",{className:D().kvVal,children:U(i.prefers)})]}),n.excludedWords.length>0&&(0,t.jsxs)("div",{className:D().kvRow,children:[(0,t.jsx)("dt",{className:D().kvKey,children:"Avoids"}),(0,t.jsx)("dd",{className:D().kvVal,children:U(n.excludedWords)})]})]})]}),n.notes&&(0,t.jsxs)("div",{className:D().inputBlock,children:[(0,t.jsx)("div",{className:D().inputBlockTitle,children:"AI Instru
1ctions"}),(0,t.jsx)("div",{className:D().inputNotes,children:n.notes})]}),n.coachNotes&&(0,t.jsxs)("div",{className:D().inputBlock,children:[(0,t.jsx)("div",{className:D().inputBlockTitle,children:"Coach Notes"}),(0,t.jsx)("div",{className:D().inputNotes,children:n.coachNotes})]})]})),o.error?(0,t.jsxs)("div",{className:D().resultError,children:["Error: ",o.error]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(V,{result:o}),(0,t.jsx)(ee,{checks:o.l1Checks}),o.weekIntent&&(0,t.jsxs)("details",{className:D().weekIntent,children:[(0,t.jsxs)("summary",{className:D().weekIntentSummary,children:[(0,t.jsx)("span",{className:D().metaLabel,children:"Week intent:"})," ",(0,t.jsx)("strong",{children:W(o.weekIntent)})]}),o.weekRationale&&(0,t.jsx)("div",{className:D().weekIntentBody,children:o.weekRationale})]}),o.needsReviewReasons.length>0&&(0,t.jsxs)("details",{className:D().review,children:[(0,t.jsxs)("summary",{className:D().reviewSummary,children:["⚠️ Needs review (",o.needsReviewReasons.length,")"]}),(0,t.jsx)("ul",{className:D().reviewReasons,children:o.needsReviewReasons.map(function(e,n){return(0,t.jsx)("li",{children:e},n)})})]}),o.evidence.length>0&&(0,t.jsxs)("details",{className:D().evidence,children:[(0,t.jsxs)("summary",{className:D().evidenceSummary,children:["Evidence (",o.evidence.length,")"]}),(0,t.jsx)("ul",{className:D().evidenceList,children:o.evidence.map(function(e,n){return(0,t.jsxs)("li",{className:D().evidenceItem,children:[(0,t.jsx)("span",{className:D().evidenceSource,children:e.source}),(0,t.jsxs)("span",{className:D().evidenceBody,children:[e.fact,e.detail&&(0,t.jsxs)("span",{className:D().evidenceDetail,children:[" ","— ",e.detail]})]})]},n)})})]}),o.composed.length>0?(0,t.jsxs)("div",{className:D().composed,children:[(0,t.jsx)("div",{className:D().metaLabel,children:"Composed workout — warm-up \xb7 working (sets/circuits) \xb7 cool-down"}),o.composed.filter(function(e){return!e.isRest}).map(function(e){return(0,t.jsx)(ea,{dayOffset:e.dayOffset,dayIntent:e.dayIntent,name:e.name,inputLine:et(e),reason:e.reason,children:e.videoTemplate?(0,t.jsxs)("div",{className:D().templatePick,children:[(0,t.jsx)("span",{className:"".concat(D().roleTag," ").concat(D().roleTagVideo),children:"Long-form video"})," ",e.videoTemplate.name]}):e.sections.length>0?e.sections.map(function(e,n){var i;return(0,t.jsxs)("div",{className:D().composedSection,children:[(0,t.jsx)("div",{className:"".concat(D().composedSectionHead," ").concat("WARM_UP"===(i=e.kind)?D().sectionWarmup:"COOL_DOWN"===i?D().sectionCooldown:D().sectionWorking),children:"WARM_UP"===e.kind?"Warm-up":"COOL_DOWN"===e.kind?"Cool-down":"CIRCUITS"===e.format?"Working \xb7 ".concat(e.rounds," circuits"):"Working"}),e.reason&&(0,t.jsx)("div",{className:D().composedSectionReason,children:e.reason}),e.exercises.length>0?(0,t.jsx)("ul",{className:D().composedList,children:e.exercises.map(function(e){return(0,t.jsx)(ei,{ex:e},e.exerciseId)})}):(0,t.jsx)("div",{className:D().empty,children:"(no exercises)"})]},n)}):0===e.exercises.length?(0,t.jsx)("div",{className:D().empty,children:e.unsatisfiedReason?"unsatisfied: ".concat(e.unsatisfiedReason):"(no exercises)"}):(0,t.jsx)("ul",{className:D().composedList,children:e.exercises.map(function(e){return(0,t.jsx)(ei,{ex:e},e.exerciseId)})})},e.dayOffset)})]}):0===o.days.length?(0,t.jsx)("div",{className:D().empty,children:"No plan produced."}):(0,t.jsxs)("div",{className:D().composed,children:[(0,t.jsx)("div",{className:D().metaLabel,children:"Template picks — evaluating template selection"}),o.days.filter(function(e){return!e.isRest}).map(function(e){return(0,t.jsx)(ea,{dayOffset:e.dayOffset,dayIntent:e.dayIntent,name:e.name,inputLine:et(e),inputLabel:"Planner input",children:e.pickedTemplateName?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:D().templatePick,children:[(0,t.jsx)("span",{className:D().metaLabel,children:"Template"})," ",e.pickedTemplateName]}),e.sections.length>0?e.sections.map(function(e,n){var i;return(0,t.jsxs)("div",{className:D().composedSection,children:[(0,t.jsx)("div",{className:"".concat(D().composedSectionHead," ").concat("Warm Up"===(i=e.kind)?D().sectionWarmup:"Cool Down"===i?D().sectionCooldown:D().sectionWorking),children:e.rounds>1?"".concat(e.label," \xb7 ").concat(e.rounds," rounds"):e.label}),e.exercises.length>0?(0,t.jsx)("ul",{className:D().composedList,children:e.exercises.map(function(e,n){return(0,t.jsx)(en,{ex:e},"".concat(e.exerciseId,"-").concat(n))})}):(0,t.jsx)("div",{className:D().empty,children:"(no exercises)"})]},n)}):e.exercises.length>0?(0,t.jsx)("ul",{className:D().composedList,children:e.exercises.map(function(e){return(0,t.jsx)(en,{ex:e},e.exerciseId)})}):(0,t.jsx)("div",{className:D().empty,children:"(no exercises found for this template)"})]}):(0,t.jsx)("div",{className:D().empty,children:e.unsatisfiedReason?"unsatisfied: ".concat(e.unsatisfiedReason):"(no pick)"})},e.dayOffset)})]})]})]})}function er(e){var n,i,a,s,r,l=e.refreshKey,o=(0,c.e)().add,d=(0,y.a)(g.evalRuns,{fetchPolicy:"cache-and-network"}),k=d.data,f=d.loading,_=d.error,N=d.refetch,b=null!==(i=null==k?void 0:k.evalRuns)&&void 0!==i?i:[],R=(0,m._)((0,h.useState)(null),2),T=R[0],E=R[1];(0,h.useEffect)(function(){l>0&&N()},[l]);var P=(0,y.a)(g.evalRun,{variables:{id:T},skip:!T,fetchPolicy:"cache-and-network"}),L=P.data,A=P.loading,V=null!==(a=null==L?void 0:L.evalRun)&&void 0!==a?a:null,B=(n=(0,u._)(function(e){var n;return(0,p.Jh)(this,function(i){switch(i.label){case 0:n=function(e){var n=null!==(l=e.results)&&void 0!==l?l:[],i=[],t=function(e){if(!e)return"";var n=new Date(e);
1return Number.isNaN(n.getTime())?"":n.toLocaleString("en-US",{year:"numeric",month:"short",day:"numeric",hour:"numeric",minute:"2-digit"})}(e.createdAt);i.push("# Eval Run #".concat(e.id).concat(t?" — ".concat(t):"")),i.push("**Mode:** ".concat("compose"===e.mode?"Compose (exercises)":"Two-stage (templates)")),i.push("");var a=!0,s=!1,r=void 0;try{for(var l,o,d=n[Symbol.iterator]();!(a=(o=d.next()).done);a=!0){var c=o.value;i.push.apply(i,(0,v._)(function(e){var n,i,t,a,s,r,l,o,d,c,u=[],p=null!=e.personaId?" (#".concat(e.personaId,")"):"";return u.push("## ".concat(e.personaLabel).concat(p),""),e.inputs&&u.push.apply(u,(0,v._)((r=[["Goal",w((n=e.inputs).goalType)]],n.secondaryGoal&&r.push(["2nd goal",w(n.secondaryGoal)]),n.gender&&r.push(["Gender",x(n.gender)]),r.push(["Experience",x(n.experienceLevel)]),r.push(["Equipment",x(n.equipmentLevel)]),r.push(["Days / week",String(n.daysPerWeek)]),null!=n.optPhase&&r.push(["OPT phase",String(n.optPhase)]),r.push(["Novelty",(l=null!==(a=n.workoutDynamism)&&void 0!==a?a:0)>0?"High (wants variety)":l<0?"Low (prefers consistency)":"Balanced"]),r.push(["Injury",x(n.injuryStatus)]),(null===(i=n.conditions)||void 0===i?void 0:i.length)&&r.push(["Conditions",n.conditions.join(", ")]),d=(o=function(e){var n=[],i=[],t=!0,a=!1,s=void 0;try{for(var r,l=e[Symbol.iterator]();!(t=(r=l.next()).done);t=!0){var o=r.value;j.has(o.trim().toLowerCase())?n.push(o):i.push(o)}}catch(e){a=!0,s=e}finally{try{t||null==l.return||l.return()}finally{if(a)throw s}}return{workoutTypes:n,prefers:i}}(null!==(s=n.preferredModalities)&&void 0!==s?s:[])).workoutTypes,c=o.prefers,d.length&&r.push(["Preferred workout types",d.join(", ")]),c.length&&r.push(["Prefers",c.join(", ")]),(null===(t=n.excludedWords)||void 0===t?void 0:t.length)&&r.push(["Avoids (words)",n.excludedWords.join(", ")]),n.bodyParts.length&&r.push(["Body focus",n.bodyParts.join(", ")]),n.blockedPatterns.length&&r.push(["Avoid patterns",n.blockedPatterns.join(", ")]),n.notes&&r.push(["AI Instru
1ctions",n.notes]),n.coachNotes&&r.push(["Coach Notes",n.coachNotes]),["### Inputs","","| Field | Value |","| --- | --- |"].concat((0,v._)(r.map(function(e){var n=(0,m._)(e,2),i=n[0],t=n[1];return"| ".concat(S(i)," | ").concat(S(t)," |")})),[""])))),e.error?u.push("**Error:** ".concat(e.error),""):e.composed&&e.composed.length?u.push.apply(u,(0,v._)(function(e){var n=["### Week of workouts",""],i=!0,t=!1,a=void 0;try{for(var s,r=e.filter(function(e){return!e.isRest})[Symbol.iterator]();!(i=(s=r.next()).done);i=!0){var l=s.value,o=l.name||x(l.dayIntent)||"-";n.push("#### Day ".concat(l.dayOffset," \xb7 ").concat(o),"");var d=C(l);if(d&&n.push("**Input from week summary output:** ".concat(d),""),l.reason&&n.push("_".concat(l.reason,"_"),""),l.videoTemplate){n.push("**Long-form video:** ".concat(l.videoTemplate.name),"");continue}if(null===(p=l.sections)||void 0===p?void 0:p.length){var c=!0,u=!1,m=void 0;try{for(var p,h,k=l.sections[Symbol.iterator]();!(c=(h=k.next()).done);c=!0){var y=h.value;n.push("**".concat("WARM_UP"===y.kind?"Warm-up":"COOL_DOWN"===y.kind?"Cool-down":"CIRCUITS"===y.format?"Working \xb7 ".concat(y.rounds," circuits"):"Working","**")),n.push(""),n.push.apply(n,(0,v._)(F(y.exercises)))}}catch(e){u=!0,m=e}finally{try{c||null==k.return||k.return()}finally{if(u)throw m}}continue}l.exercises.length?n.push.apply(n,(0,v._)(F(l.exercises))):n.push(l.unsatisfiedReason?"_unsatisfied: ".concat(l.unsatisfiedReason,"_"):"_(no exercises)_","")}}catch(e){t=!0,a=e}finally{try{i||null==r.return||r.return()}finally{if(t)throw a}}return n}(e.composed))):e.days.length?u.push.apply(u,(0,v._)(function(e){var n=["### Week of workouts",""],i=!0,t=!1,a=void 0;try{for(var s,r=e.filter(function(e){return!e.isRest})[Symbol.iterator]();!(i=(s=r.next()).done);i=!0){var l,o=s.value,d=o.name||x(o.dayIntent)||"-";n.push("#### Day ".concat(o.dayOffset," \xb7 ").concat(d),"");var c=C(o);if(c&&n.push("**Input from week summary output:** ".concat(c),""),!o.pickedTemplateName){n.push(o.unsatisfiedReason?"_unsatisfied: ".concat(o.unsatisfiedReason,"_"):"_(no pick)_","");continue}n.push("**Template:** ".concat(o.pickedTemplateName),"");var u=null!==(k=o.sections)&&void 0!==k?k:[];if(u.length){var m=!0,p=!1,h=void 0;try{for(var k,y,f=u[Symbol.iterator]();!(m=(y=f.next()).done);m=!0){var g=y.value;n.push("**".concat(g.rounds>1?"".concat(g.label," \xb7 ").concat(g.rounds," rounds"):g.label,"**")),n.push(""),n.push.apply(n,(0,v._)(I(g.exercises)))}}catch(e){p=!0,h=e}finally{try{m||null==f.return||f.return()}finally{if(p)throw h}}continue}var _=null!==(l=o.exercises)&&void 0!==l?l:[];_.length&&n.push.apply(n,(0,v._)(I(_)))}}catch(e){t=!0,a=e}finally{try{i||null==r.return||r.return()}finally{if(t)throw a}}return n}(e.days))):u.push("_No workout produced._",""),u}(c)))}}catch(e){s=!0,r=e}finally{try{a||null==d.return||d.return()}finally{if(s)throw r}}return i.join("\n").trimEnd()+"\n"}(e),i.label=1;case 1:return i.trys.push([1,3,,4]),[4,navigator.clipboard.writeText(n)];case 2:return i.sent(),o("Markdown copied — paste into Notion"),[3,4];case 3:return i.sent(),o("Copy failed — clipboard unavailable"),[3,4];case 4:return[2]}})}),function(e){return n.apply(this,arguments)});return f&&!k?(0,t.jsx)("div",{className:D().empty,children:"Loading…"}):_?(0,t.jsxs)("div",{className:D().empty,children:["Couldn’t load runs: ",_.message]}):0===b.length?(0,t.jsx)("div",{className:D().empty,children:"No eval runs yet — pick a Planner and Picker above and click Run eval."}):(0,t.jsxs)("div",{className:D().viewer,children:[(0,t.jsxs)("table",{className:D().table,"data-testid":"eval-runs-table",children:[(0,t.jsx)("thead",{children:(0,t.jsxs)("tr",{children:[(0,t.jsx)("th",{children:"Run"}),(0,t.jsx)("th",{children:"Status"}),(0,t.jsx)("th",{children:"Mode"}),(0,t.jsx)("th",{children:"Planner"}),(0,t.jsx)("th",{children:"Stage 2"}),(0,t.jsx)("th",{children:"Progress"}),(0,t.jsx)("th",{children:"Created"})]})}),(0,t.jsx)("tbody",{children:b.map(function(e){return(0,t.jsxs)("tr",{className:e.id===T?D().selectedRow:void 0,onClick:function(){return E(e.id)},"data-testid":"eval-run-row-".concat(e.id),children:[(0,t.jsxs)("td",{children:["#",e.id]}),(0,t.jsx)("td",{children:e.status}),(0,t.jsx)("td",{children:"compose"===e.mode?"Compose":"Two-stage"}),(0,t.jsx)("td",{children:e.plannerLabel||"#".concat(e.plannerVersionId)}),(0,t.jsx)("td",{children:"compose"===e.mode?e.composerLabel||"#".concat(e.composerVersionId):e.pickerLabel||"#".concat(e.pickerVersionId)}),(0,t.jsxs)("td",{children:[e.completedCount,"/",e.total]}),(0,t.jsx)("td",{children:O(e.createdAt)})]},e.id)})})]}),T&&(0,t.jsx)("div",{className:D().resultsList,"data-testid":"eval-run-detail",children:A&&!V?(0,t.jsx)("div",{className:D().empty,children:"Loading run…"}):V?0===(null!==(s=V.results)&&void 0!==s?s:[]).length?(0,t.jsxs)("div",{className:D().empty,children:["No results yet — this run is ",V.status,"."]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:D().detailToolbar,children:(0,t.jsx)("button",{type:"button",className:D().actionButton,onClick:function(){return B(V)},"data-testid":"copy-eval-markdown",children:"Copy Markdown"})}),(null!==(r=V.results)&&void 0!==r?r:[]).map(function(e){return(0,t.jsx)(es,{result:e},e.id)})]}):(0,t.jsx)("div",{className:D().empty,children:"Run not found."})})]})}function el(e){var n="compose"===e.mode?"Compose":"Two-stage",i="compose"===e.mode?e.composerLabel||"Composer #".concat(e.composerVersionId):e.pickerLabel||"Picker #".concat(e.pickerVersionId);return"#".concat(e.id," \xb7 ").concat(n," \xb7 ").concat(e.plannerLabel||"Planner"," / ").concat(i)}function eo(e){var n,i,a,s,r,l=e.refreshKey,o=(0,y.a)(g.evalRuns,{fetchPolicy:"cache-and-network"}),d=o.data,c=o.refetch,u=null!==(n=null==d?void 0:d.evalRuns)&&void 0!==n?n:[],p=(0,m._)((0,h.useState)(null),2),k=p[0],f=p[1],_=(0,m._)((0,h.useState)(null),2),N=_[0],x=_[1];(0,h.useEffect)(function(){l>0&&c()},[l]);var b=(0,y.a)(g.evalRun,{variables:{id:k},skip:!k,fetchPolicy:"cache-and-network"}).data,w=(0,y.a)(g.evalRun,{variables:{id:N},skip:!N,fetchPolicy:"cache-and-network"}).data,j=null!==(i=null==b?void 0:b.evalRun)&&void 0!==i?i:null,S=null!==(a=null==w?void 0:w.evalRun)&&void 0!==a?a:null,F=new Map((null!==(s=null==j?void 0:j.results)&&void 0!==s?s:[]).map(function(e){return[e.personaKey,e]})),C=new Map((null!==(r=null==S?void 0:S.results)&&void 0!==r?r:[]).map(function(e){return[e.personaKey,e]})),I=(0,v._)(new Set((0,v._)(F.keys()).concat((0,v._)(C.keys())))).sort(function(e,n){var i,t,a,s,r,l,o,d,c=null!==(l=null!==(r=null===(i=F.get(e))||void 0===i?void 0:i.personaLabel)&&void 0!==r?r:null===(t=C.get(e))||void 0===t?void 0:t.personaLabel)&&void 0!==l?l:e,u=null!==(d=null!==(o=null===(a=F.get(n))||void 0===a?void 0:a.personaLabel)&&void 0!==o?o:null===(s=C.get(n))||void 0===s?void 0:s.personaLabel)&&void 0!==d?d:n;return c.localeCompare(u)}),R=function(e,n,i,a){return(0,t.jsxs)("div",{className:D().runField,children:[(0,t.jsx)("label",{className:D().fieldLabel,children:i}),(0,t.jsxs)("select",{className:D().select,value:null!=e?e:"",onChange:function(e){return n(e.target.value||null)},"data-testid":a,children:[(0,t.jsx)("option",{value:"",children:"Select a run…"}),u.map(function(e){return(0,t.jsx)("option",{value:e.id,children:el(e)}
1,e.id)})]})]})};return 0===u.length?(0,t.jsx)("div",{className:D().empty,children:"No runs to compare yet."}):(0,t.jsxs)("div",{className:D().viewer,children:[(0,t.jsxs)("div",{className:D().runControl,children:[R(k,f,"Run A","compare-run-a"),R(N,x,"Run B","compare-run-b")]}),j&&S?(0,t.jsxs)("div",{"data-testid":"compare-detail",children:[(0,t.jsxs)("div",{className:D().compareHead,children:[(0,t.jsx)("div",{className:D().compareHeadCell,children:el(j)}),(0,t.jsx)("div",{className:D().compareHeadCell,children:el(S)})]}),I.map(function(e){var n,i,a=F.get(e),s=C.get(e),r=null!==(i=null!==(n=null==a?void 0:a.personaLabel)&&void 0!==n?n:null==s?void 0:s.personaLabel)&&void 0!==i?i:e;return(0,t.jsxs)("div",{className:D().compareRow,children:[(0,t.jsx)("div",{className:D().compareLabel,children:r}),(0,t.jsxs)("div",{className:D().compareCols,children:[(0,t.jsx)("div",{className:D().compareCol,children:a?(0,t.jsx)(es,{result:a}):(0,t.jsx)("div",{className:D().empty,children:"Not in run A"})}),(0,t.jsx)("div",{className:D().compareCol,children:s?(0,t.jsx)(es,{result:s}):(0,t.jsx)("div",{className:D().empty,children:"Not in run B"})})]})]},e)})]}):(0,t.jsx)("div",{className:D().empty,children:"Pick two runs to compare them archetype-by-archetype."})]})}function ed(){var e,n=(0,y.a)(g.promptVersions,{fetchPolicy:"cache-and-network"}),i=n.data,a=n.loading,s=n.error,r=n.refetch,l=(0,m._)((0,h.useState)(0),2),o=l[0],d=l[1],c=(0,m._)((0,h.useState)("view"),2),u=c[0],v=c[1],p=null!==(e=null==i?void 0:i.promptVersions)&&void 0!==e?e:[];return(0,t.jsxs)("div",{className:D().page,children:[(0,t.jsxs)("div",{className:D().pageHeader,children:[(0,t.jsx)(f.Dx,{size:"medium",tag:"h1",children:"AI Workout Evals"}),(0,t.jsx)("div",{className:D().subtitle,children:"Edit and promote the Planner / Picker generation prompts. Eval runs may use any version; production reads only the promoted one per stage."})]}),(0,t.jsx)(z,{}),(0,t.jsxs)("section",{className:D().section,children:[(0,t.jsx)("h2",{className:D().sectionTitle,children:"Prompt editor"}),a&&!i?(0,t.jsx)("div",{className:D().empty,children:"Loading…"}):s?(0,t.jsxs)("div",{className:D().empty,children:["Couldn’t load prompt versions: ",s.message]}):B.map(function(e){return(0,t.jsx)($,{stage:e,description:e.description,versions:p,onChanged:function(){return r()}},e.key)})]}),(0,t.jsxs)("section",{className:D().section,children:[(0,t.jsx)("h2",{className:D().sectionTitle,children:"Run eval"}),(0,t.jsx)("div",{className:D().subtitle,children:"Pick a Planner + Picker version, then Run. The run is enqueued as a background job (dry-run — it never writes client data); the status polls below until it’s complete."}),a&&!i?(0,t.jsx)("div",{className:D().empty,children:"Loading…"}):s?(0,t.jsxs)("div",{className:D().empty,children:["Couldn’t load prompt versions: ",s.message]}):(0,t.jsx)(J,{versions:p,onCompleted:function(){return d(function(e){return e+1})}})]}),(0,t.jsxs)("section",{className:D().section,children:[(0,t.jsxs)("div",{className:D().sectionHeaderRow,children:[(0,t.jsx)("h2",{className:D().sectionTitle,children:"Eval results"}),(0,t.jsxs)("div",{className:D().viewToggle,children:[(0,t.jsx)("button",{type:"button",className:"".concat(D().toggleBtn," ").concat("view"===u?D().toggleBtnActive:""),onClick:function(){return v("view")},"data-testid":"results-mode-view",children:"Read one run"}),(0,t.jsx)("button",{type:"button",className:"".concat(D().toggleBtn," ").concat("compare"===u?D().toggleBtnActive:""),onClick:function(){return v("compare")},"data-testid":"results-mode-compare",children:"Compare two"})]})]}),"compare"===u?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:D().subtitle,children:"Pick two runs to compare them archetype-by-archetype (works across modes — e.g. template-pick vs. compose)."}),(0,t.jsx)(eo,{refreshKey:o})]}):(0,t.jsx)(er,{refreshKey:o})]})]})}var ec=i(39737),eu=i(43783),em=i(51869),ev=i(87854),ep=function(){return(0,t.jsx)(em.V,{children:(0,t.jsx)(o.Z,{children:(0,t.jsx)(d.Z,{children:(0,t.jsxs)(c.V,{position:"top",children:[(0,t.jsx)(s(),{children:(0,t.jsx)("title",{children:"AI Workout Evals -- Kickoff"},"title")}),(0,t.jsx)(ev.Z,{children:(0,t.jsx)(ed,{})})]})})})})};ep.getInitialProps=(0,l.Z)(function(e){var n=e.ctx,i=e.currentUserPayload.data.me;return i.user?i.user.coach?i.user.coach.isActive&&i.user.coach.isAdmin||(0,eu.Z)(ec.ZP.clientDashboard(),n):(0,eu.Z)("/",n):(0,eu.Z)(ec.ZP.signIn({redirect:n.asPath}),n),{}});var eh=(0,r.C)(ep)},58961:function(e,n,i){"use strict";i.d(n,{Y:function(){return r}});var t=i(85893),a=i(20726),s=i.n(a),r=function(e){var n=e.font,i=e.children;return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(s(),{id:"56a506ffc98e56a8",dynamic:[n.style.fontFamily],children:"html{font-family:".concat(n.style.fontFamily,"}")}),i]})}},51869:function(e,n,i){"use strict";i.d(n,{V:function(){return l}});var t=i(85893),a=i(35053),s=i.n(a),r=i(58961),l=function(e){var n=e.children;return(0,t.jsx)(r.Y,{font:s(),children:n})}},44330:function(e,n,i){"use strict";i.d(n,{C:function(){return t},N:function(){return r}});var t=function(e){return e?e.toLowerCase().split("_").map(function(e){return e.charAt(0).toUpperCase()+e.slice(1)}).join(" "):e}
1,a=/^\s*(?:hi|hey|hello|dear)?[\s,]*coach\b(?:\s+[A-Z][\w'.-]*){0,2}(?:\s*[,:;!]|\s+[—–-])\s*/i,s=function(e){var n=e.replace(a,"");return n!==e&&n?n.charAt(0).toUpperCase()+n.slice(1):e},r=function(e){return e?s(e.replace(/\s*\((?:template\s*)?(?:id[:=\s]*)?#?\d+\)/gi,"")).replace(/\b[A-Z][A-Z0-9]*(?:_[A-Z0-9]+)+\b/g,function(e){return t(e)}).replace(/\s{2,}/g," ").trim():e}},27615:function(e){e.exports={page:"styles_page__DI2k_",pageHeader:"styles_pageHeader__eitl2",subtitle:"styles_subtitle__v8MVl",section:"styles_section__oscMZ",sectionTitle:"styles_sectionTitle__o_hk2",archetypes:"styles_archetypes__jfEoD",archetypesSummary:"styles_archetypesSummary__SqaLw",stageGroup:"styles_stageGroup__YJInB",stageSummary:"styles_stageSummary__Tnn08",stageCount:"styles_stageCount__kAJH_",stageHeader:"styles_stageHeader__HKhV1",stageName:"styles_stageName__3bmiK",versionList:"styles_versionList__bosjp",versionCard:"styles_versionCard__9ge2V",versionCardPromoted:"styles_versionCardPromoted__1MvsM",versionHeader:"styles_versionHeader__PgwjA",versionMeta:"styles_versionMeta__NPLno",versionLabel:"styles_versionLabel__EWzJm",versionId:"styles_versionId__88kDR",versionDate:"styles_versionDate__abfjt",statusBadge:"styles_statusBadge__JKSXt",statusDraft:"styles_statusDraft__H_Vfn",statusPromoted:"styles_statusPromoted__Ay2_U",statusArchived:"styles_statusArchived__pm0_O",versionActions:"styles_versionActions__RzUNe",actionButton:"styles_actionButton__I1l8y",promoteButton:"styles_promoteButton__GSIjT",body:"styles_body__FzcDd",field:"styles_field__gIW4J",fieldLabel:"styles_fieldLabel__fe3Mv",input:"styles_input__oZLw6",textarea:"styles_textarea__WOcnL",editForm:"styles_editForm__nw_Dd",editActions:"styles_editActions__VshEv",newDraftForm:"styles_newDraftForm__t8KzE",empty:"styles_empty__yxKOS",stub:"styles_stub__Cjkx8",table:"styles_table__y1UJ1",archLabel:"styles_archLabel__NZpnB",personaId:"styles_personaId__PCss6",archInputs:"styles_archInputs__hqGh0",archInstructions:"styles_archInstructions__FX12I",archDisabled:"styles_archDisabled__rLtQR",runControl:"styles_runControl__U6Lpa",runField:"styles_runField__0LquN",select:"styles_select__pSNPk",runActions:"styles_runActions__gKcy2",runStatus:"styles_runStatus__y_6Ev",viewer:"styles_viewer__Z8rEX",selectedRow:"styles_selectedRow__Cyztk",resultsList:"styles_resultsList__LxTDg",detailToolbar:"styles_detailToolbar__mr6HJ",sectionHeaderRow:"styles_sectionHeaderRow__It4_L",viewToggle:"styles_viewToggle__PA86r",toggleBtn:"styles_toggleBtn__8lmxn",toggleBtnActive:"styles_toggleBtnActive__h3lBJ",compareHead:"styles_compareHead__dYRa_",compareHeadCell:"styles_compareHeadCell__4_QV3",compareRow:"styles_compareRow__De_Wd",compareLabel:"styles_compareLabel__3iGWD",compareCols:"styles_compareCols__x6QGX",compareCol:"styles_compareCol__RBROU",resultCard:"styles_resultCard__DgFGX",resultHeader:"styles_resultHeader__whkdT",resultMeta:"styles_resultMeta__7uzL_",resultError:"styles_resultError__ZR9KE",review:"styles_review__7rrz0",reviewSummary:"styles_reviewSummary__5JBbc",reviewReasons:"styles_reviewReasons__bqj2z",resultInputs:"styles_resultInputs__SOxu7",inputChips:"styles_inputChips__6tZuY",inputChip:"styles_inputChip__kaiFd",inputConstraints:"styles_inputConstraints__v2iyR",inputNotes:"styles_inputNotes___tUiq",inputsPanel:"styles_inputsPanel__B35gh",inputsHeading:"styles_inputsHeading__BK2uK",inputGoal:"styles_inputGoal__CLR_e",inputGoalLabel:"styles_inputGoalLabel__dkn6p",inputGoalValue:"styles_inputGoalValue__MyQOp",inputGoalSecondary:"styles_inputGoalSecondary__JykDR",statGrid:"styles_statGrid__1P
1X7k",stat:"styles_stat__t5yq_",statKey:"styles_statKey__s_HUp",statVal:"styles_statVal__qWMS9",inputBlock:"styles_inputBlock__PKZ1d",inputBlockHealth:"styles_inputBlockHealth__AowJh",inputBlockPrefs:"styles_inputBlockPrefs__zidyL",inputBlockTitle:"styles_inputBlockTitle__IV5dj",kvList:"styles_kvList__ml_hj",kvRow:"styles_kvRow__iVzbm",kvKey:"styles_kvKey__n_RAD",kvVal:"styles_kvVal__GWCIO",metaLabel:"styles_metaLabel__XwKPS",checks:"styles_checks__uaAAI",checksSummary:"styles_checksSummary__VDneh",checksPass:"styles_checksPass__VvBtP",checksFail:"styles_checksFail__3YyKN",checkGroup:"styles_checkGroup__rVX2A",checkOwner:"styles_checkOwner__69XQk",checkList:"styles_checkList__R6F_Y",checkItem:"styles_checkItem__Pz1tF",checkBadge:"styles_checkBadge__GI8kq",l1Pass:"styles_l1Pass__bf81k",l1Fail:"styles_l1Fail__IrhQE",l1Na:"styles_l1Na___meS_",checkLabel:"styles_checkLabel__EJCco",checkDetail:"styles_checkDetail__w83lr",composed:"styles_composed__8D57o",composedDay:"styles_composedDay__ffLuy",composedDaySummary:"styles_composedDaySummary__jpKgg",composedDayHead:"styles_composedDayHead__3KphA",composedDayReason:"styles_composedDayReason__6FYnN",composedDayInput:"styles_composedDayInput__bse1R",composedList:"styles_composedList__TWzIc",templatePick:"styles_templatePick__7SRcU",composedItem:"styles_composedItem__RWicL",composedItemName:"styles_composedItemName__qVmdF",composedName:"styles_composedName___gNEH",composedRx:"styles_composedRx__GZSYi",roleTag:"styles_roleTag__yJz5d",roleTagPrimary:"styles_roleTagPrimary__TEaIM",roleTagAccessory:"styles_roleTagAccessory__FBX1y",roleTagVideo:"styles_roleTagVideo__jP9mH",composedReason:"styles_composedReason__XwLQj",composedSection:"styles_composedSection__9XAjv",composedSectionHead:"styles_composedSectionHead__LO_oV",sectionWarmup:"styles_sectionWarmup__qyDew",sectionWorking:"styles_sectionWorking__JLqKS",sectionCooldown:"styles_sectionCooldown__5nqvv",composedSectionReason:"styles_composedSectionReason__tww9O",weekIntent:"styles_weekIntent__TdSQ0",weekIntentSummary:"styles_weekIntentSummary__Ll39N",weekIntentBody:"styles_weekIntentBody__yeldI",evidence:"styles_evidence__7QK57",evidenceSummary:"styles_evidenceSummary__te1qd",evidenceList:"styles_evidenceList___HQ7Z",evidenceItem:"styles_evidenceItem__l2_Y7",evidenceSource:"styles_evidenceSource__18lI9",evidenceBody:"styles_evidenceBody__vmnGN",evidenceDetail:"styles_evidenceDetail__6aREa",coachPreview:"styles_coachPreview__IBzdL",coachPreviewBody:"styles_coachPreviewBody__bMl9K",coachPreviewWorkout:"styles_coachPreviewWorkout__Spc31",coachPreviewCaption:"styles_coachPreviewCaption__fad1O"}},55171:function(e){e.exports={colors:"'styles/colors.module.css'",NEUTRAL_GRAY_500:"#64748B",NEUTRAL_GRAY_700:"#334155",NEUTRAL_GRAY_900:"#0F172A",WHITE:"#fff",BLUE_GRAYS_00:"#F5F8FB",BLUE_GRAYS_02:"#CCD6E6",BLUE_GRAYS_03:"#B5C1D5",BLUE_GRAYS_04:"#959CB0",rationale:"styles_rationale__eBESZ",bare:"styles_bare__Uh9sr",rationaleReason:"styles_rationaleReason__tY9FK",whyToggle:"styles_whyToggle__8Gs0V",whyToggleChevron:"styles_whyToggleChevron__sIj4x",whyToggleChevronOpen:"styles_whyToggleChevronOpen__Cy360",whyEvidenceList:"styles_whyEvidenceList__00Xe9",whyEvidenceItem:"styles_whyEvidenceItem__2mPrI",whyEvidenceRow:"styles_whyEvidenceRow__v_0zJ",whyEvidenceRowButton:"styles_whyEvidenceRowButton__RuQf9",whyEvidenceSource:"styles_whyEvidenceSource__t_MAx",whyEvidenceFact:"styles_whyEvidenceFact__QuG_J",whyEvidenceSourceCaret:"styles_whyEvidenceSourceCaret__Eq5Bb",whyEvidenceSourceCaretOpen:"styles_whyEvidenceSourceCaretOpen__EKpsh",whyEvidenceDetail:"styles_whyEvidenceDetail__M5ZBx",whySectionToggle:"styles_whySectionToggle__fmC5p",whySectionChevron:"styles_whySectionChevron__3bZhl",whySectionToggleOpen:"styles_whySectionToggleOpen__e9bqR",whySectionCount:"styles_whySectionCount__Kp0xe",whyEvidenceListShown:"styles_whyEvidenceListShown__hlzM0",whyEvidenceDetailRows:"styles_whyEvidenceDetailRows__LB05s",whyDetailKey:"styles_whyDetailKey__pWWub",whyDetailValue:"styles_whyDetailValue__Gnaky",whyDetailFull:"styles_whyDetailFull__X4yo4",whyEvidenceItemShown:"styles_whyEvidenceItemShown__T3_Iu"}},18440:function(e){e.exports={aiMark:"styles_aiMark__Vbycy"}},88704:function(e){e.exports={colors:"'styles/colors.module.css'",WHITE:"#fff",NEUTRAL_GRAY_100:"#F1F5F9",NEUTRAL_GRAY_200:"#E2E8F0",NEUTRAL_GRAY_600:"#475569",NEUTRAL_GRAY_900:"#0F172A",briefCard:"brief-card_briefCard__C2thA",briefHeader:"brief-card_briefHeader__7dPAA",aiMark:"brief-card_aiMark__2HvPH",aiMarkChip:"brief-card_aiMarkChip__wOBj9",briefTitle:"brief-card_briefTitle__gZ5Yo",briefWeekTag:"brief-card_briefWeekTag__pQ5rO"}},94551:function(e){e.exports={colors:"'styles/colors.module.css'",WHITE:"#fff",BLUE_GRAYS_01:"#E9EEF6",BLUE_GRAYS_00:"#F5F8FB",BLUE_GRAYS_07:"#687189",BLUE_GRAYS_05:"#62697D",CHARCOAL:"#282828",BLUE_GRAYS_SEMI_BLACK:"#030017",WARNING_50:"#FFFBEB",WARNING_200:"#FDE68B",WARNING_900:"#76350F",brief:"styles_brief__fRsfp",eyebrow:"styles_eyebrow__iAei9",headline:"styles_headline__dXWSd",summaryStatic:"styles_summaryStatic__tvnkR",summary:"styles_summary__gIeXl",clamped:"styles_clamped__FeAc9",summaryButton:"styles_summaryButton__AsuK5",more:"styles_more__SaRQy",tags:"styles_tags__fIXx9",tag:"styles_tag__3HdHr",review:"styles_review__7BCI5",reviewHeading:"styles_reviewHeading__c_8mg",reviewReasons:"styles_reviewReasons__KPV_1",reviewFallback:"styles_reviewFallback__baQjJ",reviewDetails:"styles_reviewDetails__nCImu",reviewCount:"styles_reviewCount__iSxrF",reviewChevron:"styles_reviewChevron__CVCiL",reviewAction:"styles_reviewAction__YN2P8",reviewReasonTitle:"styles_reviewReasonTitle__a1UJQ",decisions:"styles_decisions__Wuw3e",decisionsToggle:"styles_decisionsToggle__GlHVd",decisionCount:"styles_decisionCount__rflZN",decision:"styles_decision__5meU5",decisionIcon:"styles_decisionIcon__nBl0z",decisionTitle:"styles_decisionTitle__xFaT_",decisionExplanation:"styles_decisionExplanation__vzgn2",decisionLinks:"styles_decisionLinks__CVZl7",decisionEvidence:"styles_decisionEvidence___gQ_W",workoutLink:"styles_workoutLink__2oQ1v",workoutWhy:"styles_workoutWhy__oT3X7",workoutWhyContent:"styles_workoutWhyContent__rTUdI",workoutDecision:"styles_workoutDecision__2k7Eu"}},35730:function(e){e.exports={colors:"'styles/colors.module.css'",PURPLE:"#830051",WHITE:"#fff",toastContainer:"styles_toastContainer__3Eo31",to
1p:"styles_top__Hlq37",bottom:"styles_bottom__Cy_ua",toast:"styles_toast__6Ak4a","slide-in-blurred-top":"styles_slide-in-blurred-top__PBQRo","slide-in-blurred-bottom":"styles_slide-in-blurred-bottom__m0Uyi"}}},function(e){e.O(0,[9468,2315,4853,8407,6025,984,546,7362,7844,8909,4841,2201,2964,9405,7977,3420,2888,9774,179],function(){return e(e.s=44694)}),_N_E=e.O()}]);
2//# sourceMappingURL=ai-workout-evals-f2240a8fd2ed8fa2.js.map

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.