PageSourceSearch

https://web-assets.myfitnesspal.com/web-main/_next/static/chunks/pages/widgets/chart-25651f3cab291959.js

js myfitnesspal.com collected 2026-09-24 08:27:01 UTC 19,881 bytes, 2 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[542],{30532:(e,t,r)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/widgets/chart",function(){return r(85709)}])},85709:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>J});var a=r(64255),n=r(26081),o=r(1179),s=r(90110),i=r(41695),l=r(7040),d=r(9243),c=r(60382),u=r(76840),m=r(63826),p=r(83577),b=r(95863),x=r(10039),h=r(68690),g=r(44047),y=r(82423),f=r(90999),A=r(21067);function j(){let{query:e}=(0,d.useRouter)(),t=e?.type,r=(0,A.lK)({fields:["diary_preferences","user_subscriptions"]}),a=(0,i.useRef)(!1),[n,o]=(0,i.useState)(""),[s,l]=(0,i.useState)(!1),[c,p]=(0,i.useState)({token:"",userId:"",clientId:"",partnerName:"",userType:"",parentOrigin:"",startDate:"",endDate:""}),[g,y]=(0,i.useState)(x.c9.now().startOf("week")),[j,w]=(0,i.useState)(g.plus({days:6}));(0,i.useEffect)(function(){let{startDate:e,endDate:t}=c;if((e||t)&&e){let r=x.c9.fromFormat(e,"MM-dd-yyyy"),a=t?x.c9.fromFormat(t,"MM-dd-yyyy"):r.plus({days:6});y(r),w(a),((e,t)=>{if(!e.isValid||!t.isValid)return o("Invalid date format. Please use MM-DD-YYYY format and try again.");if(e>t)o("The start date must be earlier than the end date. Adjust your dates and try again.");else{let r=t.diff(e,"months").toObject().months??0;(0,h.GW)(r)>1?o("Dates must be less than 31 days apart. Adjust your date(s) and try again."):o("")}})(r,a)}},[c]);let v=(0,i.useMemo)(()=>b.O.widgets.parentDomainOrOrigin.split(" "),[]),k=(0,i.useCallback)(e=>v.some(t=>e===t||e.endsWith(t)),[v]),C=(0,i.useCallback)(e=>{if(window.ReactNativeWebView){let t=JSON.parse(e.data);p({...t,parentOrigin:`${t.partnerName} webview`})}else{if(!k(e.origin)||!e.ports.length)return;p({...e.data,parentOrigin:e.origin})}},[k]),M=(0,i.useMemo)(()=>({authorization:`Bearer ${c.token}`,"mfp-user-id":c.userId,"mfp-client-id":c.clientId}),[c]),{data:D={},isError:$,isPending:L}=(0,m.I)({queryKey:["user",c.userId,c.token,c.clientId],queryFn:async()=>{if(!c.token||!c.userId||n)throw Error("Missing required data");let e=await fetch(`${b.O.mfpPublicApiHost}/v2/users/${c.userId}?${r}`,{headers:M});e.ok||e.status!==u.v.UNAUTHORIZED||l(!0);let t=await e.json();return t?.item??t},enabled:!!(c.token&&c.userId&&!n),retry:!1}),_=(0,i.useMemo)(()=>D?.user_subscriptions?.features?.entitled?.includes("premium-partner-chart-widgets")??!1,[D]),I=(0,i.useMemo)(()=>$&&!s,[$,s]);return(0,i.useEffect)(function(){if(window.ReactNativeWebView)window.ReactNativeWebView.postMessage(`${t} ready`);else{let e=new MessageChannel,r=new URL(document.referrer).origin;k(r)&&window.parent.postMessage(`${t} ready`,r,[e.port2])}return document.addEventListener("message",e=>C(e)),window.addEventListener("message",C),()=>window.removeEventListener("message",C)},[t,C,k]),{headers:M,userData:D,userType:c.userType,fireAnalytics:e=>{!a.current&&c.partnerName&&c.userType&&(0!==Object.keys(D).length||_&&e)&&((0,f.dU)([f.YM],"widget_displayed",{premium:_,origin_url:c.parentOrigin,partner:c.partnerName,viewer:"trainer"===c.userType?"professional":"client",type:t}),a.current=!0)},isEntitledToWidgets:_,isUnauthorizedUserError:s,isGeneralUserError:I,isUserLoading:L,startDate:g,endDate:j,dateError:n}}let w=(0,i.createContext)(null);function v({children:e}){let t=j();return(0,a.jsx)(w.Provider,{value:t,children:e})}function k(){let e=(0,i.useContext)(w);if(!e)throw Error("useWidgetContext must be used within WidgetProvider");return e}var C=r(20498),M=r(86961),D=r(69025);let $={height:"100vh",alignItems:"center",justifyContent:"center"},L={p:5,border:"1px solid",borderColor:"common.neutrals.quinary",textAlign:"center"},_=({text:e,error:t=!1})=>(0,a.jsx)(D.A,{sx:$,children:(0,a.jsx)(D.A,{sx:L,children:(0,a.jsx)(s.A,{sx:{color:t?"error.main":"unset"},children:e})})});var I=r(55714),S=r(67594),R=r(84366),E=r(92776),N=r(68559),O=r(87159);let P={width:"100%",backgroundColor:"common.neutrals.background",padding:4,display:"flex",alignItems:"center",justifyContent:"center",position:"relative"},T={width:"100%",justifyContent:"space-between",alignItems:"center"},F={position:"absolute",right:4,bottom:4,color:"common.neutrals.tertiary",cursor:"pointer"},B=({meal:e,protein:t,carbs:r,fat:n,energy:o})=>{let l=(0,N.Vb)(),d=(0,I.A)("(max-width:440px)"),{isEntitledToWidgets:c}=j(),[u,m]=(0,i.useState)(!1);return(0,a.jsx)(D.A,{sx:P,children:(0,a.jsxs)(D.A,{direction:"row",sx:T,children:[(0,a.jsx)(s.A,{variant:"Heading/Semibold/SM",children:e}),(0,a.jsxs)(D.A,{direction:"row",sx:{alignItems:"center",...!c&&{filter:"blur(3px)"}},spacing:2,children:[!d&&(0,a.jsxs)(D.A,{direction:"row",spacing:1,children:[(0,a.jsx)(s.A,{variant:"Legal/MD",children:"Carbs:"}),(0,a.jsx)(s.A,{variant:"Legal/MD",children:`${r}${l("gramsAbbreviated")}`}),(0,a.jsx)(s.A,{variant:"Legal/MD",children:"•"}),(0,a.jsx)(s.A,{variant:"Legal/MD",children:"Fat:"}),(0,a.jsx)(s.A,{variant:"Legal/MD",children:`${n}${l("gramsAbbreviated")}`}),(0,a.jsx)(s.A,{variant:"Legal/MD",children:"•"}),(0,a.jsx)(s.A,{variant:"Legal/MD",children:"Protein:"}),(0,a.jsx)(s.A,{variant:"Legal/MD",children:`${t}${l("gramsAbbreviated")}`})]}),(0,a.jsx)(O.A,{energy:o,carbs:r,fat:n,protein:t})]}),!c&&(0,a.jsx)(S.x,{onClickAway:()=>{m(!1)},children:(0,a.jsx)(R.A,{title:"You're on a MyFitnessPal free plan. Talk to your coach about how to get your discount code.",open:u,disableFocusListener:!0,disableHoverListener:!0,disableTouchListener:!0,placement:"bottom-start",arrow:!0,slotProps:{tooltip:{sx:{fontSize:14}}},children:(0,a.jsx)(E.A,{fontSize:"small",onClick:()=>{m(!0)},sx:F})})})]})})},G={width:"100%",padding:4,borderBottom:"1px solid",borderColor:"common.neutrals.quinary"},W=({food:e,nutritional_contents:t,serving_size:r,servings:n})=>{let o=(0,N.Vb)(),{brand_name:i,description:l}=e,{energy:{value:d},fat:c,protein:u,carbohydrates:m}=t,p=Number(n)||1,b=Number(r.value)||1,x=`${Number((p*b).toFixed(2))} ${r.unit}`,{isEntitledToWidgets:h}=k();return(0,a.jsx)(D.A,{sx:G,children:(0,a.jsxs)(D.A,{spacing:2,children:[(0,a.jsx)(s.A,{variant:"Body/Regular/LG",children:l}),(0,a.jsxs)(D.A,{direction:"row",spacing:2,sx:{alignItems:"center"},children:[i&&(0,a.jsxs)(s.A,{variant:"Body/Regular/XS",children:[i,","]}),(0,a.jsx)(s.A,{variant:"Body/Regular/XS",children:x})]}),(0,a.jsxs)(D.A,{direction:"row",spacing:2,sx:{alignItems:"center"},children:[(0,a.jsx)(s.A,{variant:"Body/Regular/XS",children:`${o("caloriesCapitalized")}: ${Math.round(d)}`}),h&&(0,a.jsxs)(D.A,{direction:"row",spacing:2,sx:{alignItems:"center"},children:[(0,a.jsx)(s.A,{variant:"Legal/MD",children:"•"}),(0,a.jsx)(s.A,{variant:"Body/Regular/XS",children:`${o("carbohydratesAbbreviated")}: ${Math.round(m)}`}),(0,a.jsx)(s.A,{variant:"Legal/MD",children:"•"}),(0,a.jsx)(s.A,{variant:"Body/Regular/XS",children:`${o("fat")}: ${Math.round(c)}`}),(0,a.jsx)(s.A,{variant:"Legal/MD",children:"•"}),(0,a.jsx)(s.A,{variant:"Body/Regular/XS",children:`${o("protein")}: ${Math.round(u)}`})]})]})]})})},X=function({date:e,meals:t,diaryLength:r}){let{isEntitledToWidgets:n}=k();return(0,a.jsxs)(D.A,{children:[r>1&&(0,a.jsx)(s.A,{variant:"Heading/Semibold/MD",sx:{alignSelf:"center",p:5},children:e}),t.map((t,r)=>{let{meal_name:o,food_entries:s,meal_totals:i}=t,l=40,d=1080,c=100,u=80;return n&&(l=(0,h.GW)(i.fat,2),d=(0,h.GW)(i.energy,2),c=(0,h.GW)(i.
1carbohydrates,2),u=(0,h.GW)(i.protein,2)),(0,a.jsxs)(D.A,{children:[(0,a.jsx)(B,{meal:o,fat:l,energy:d,carbs:c,protein:u}),(0,a.jsx)(D.A,{sx:{position:"relative"},children:s.map(e=>(0,a.jsx)(W,{...e},e.food.id))})]},e+o)})]},e)};function V({diary:e,mealNames:t,isLoading:r=!1}){return r?(0,a.jsx)(y.a,{}):e&&0!==e.length?e.map(({meals:r,date:n})=>{let o=t.map(e=>r.find(t=>t.meal_name===e)).filter(Boolean);return(0,a.jsx)(X,{date:n,meals:o,diaryLength:e.length},n)}):(0,a.jsx)(_,{text:"No food diary data available for this day"})}var U=r(93514);p.t1.register(p.PP,p.kc,p.ZT,p.No,p.A6,p.E8,p.FN,p.hE,p.m_,p.s$);let q={position:"relative"},z={position:"absolute",transform:"translate(-50%, -50%)",bgcolor:"white",borderWidth:1,borderStyle:"solid",color:"common.neutrals.secondary",borderColor:"common.neutrals.quinary",px:{xs:2,sm:5},py:{xs:2,sm:3},fontSize:{xs:10,sm:16}},H={top:{xs:"36%",sm:"50%"},left:{xs:"50%",sm:"50%"}},Y={height:443},K={top:{xs:"40%",sm:"50%"},left:{xs:"60%",sm:"50%"}};function Z(){let e=(0,c.A)(),{query:t}=(0,d.useRouter)(),r=t?.type,[p,f]=(0,i.useState)(!1),{headers:A,userData:j,userType:w,fireAnalytics:v,isEntitledToWidgets:D,isUnauthorizedUserError:$,isGeneralUserError:L,isUserLoading:I,startDate:S,endDate:R,dateError:E}=k(),{data:N={},isError:O,isPending:P}=(0,m.I)({queryKey:["live-digest",r,S.toISODate(),R.toISODate(),A.authorization,A["mfp-user-id"],A["mfp-client-id"]],queryFn:async()=>{let e=S.toISODate(),t=R.toISODate(),a=`${b.O.mfpPublicApiHost}/v2/live-digest?from-date=${e}&to-date=${"diary"===r?e:t}`;"frequently-logged-foods"===r?a+="&module=RankedFoodEntries&module=DailyMacronutrients":"diary"===r?a+="&module=FoodDiary":a+="&module=DailyMacronutrients&module=MacronutrientGoals";let n=await fetch(a,{method:"GET",headers:A,redirect:"follow"});n.status===u.v.UNAUTHORIZED&&f(!0);let o=await n.json();return o?.item??o},enabled:!!(Object.keys(j).length>0&&(D||"diary"===r)&&!E),retry:!1});if((0,i.useEffect)(()=>{v(0!==Object.keys(N).length)},[N,v]),$||p)return(0,a.jsx)(_,{text:"trainer"===w?"Your client must reconnect their MyFitnessPal account in the Trainerize app.":"You must reconnect your MyFitnessPal account in the Trainerize app."});if(E)return(0,a.jsx)(_,{text:E,error:!0});if(L||O)return(0,a.jsx)(C.A,{withLink:!1});if(I||Object.keys(j).length>0&&P&&(D||"diary"===r))return(0,a.jsx)(y.a,{});if(!D&&"diary"!==r)return(0,a.jsx)(_,{text:"Insights are available for clients using MyFitnessPal Premium"});let{weekly_digest:{daily_macronutrients:T=[],macronutrient_goals:F=[],food_diary:B=[],ranked_food_entries:G=[]}={}}=N,W=j.diary_preferences?.meal_names||[];if("diary"===r)return(0,a.jsx)(V,{diary:B,mealNames:W,isLoading:P});if("frequently-logged-foods"===r)return(0,a.jsx)(U.A,{rankedFoodEntries:G||[],dailyMacronutrients:T||[],isTrainer:"trainer"===w});let{calorieChartOptions:X,calorieChartData:Z,hasLoggedFood:J,macronutrientChartData:Q,macronutrientChartOptions:ee}=(({startDate:e,endDate:t,macroGoalArray:r,macroDailyArray:a,theme:n,mealNames:o})=>{let s=x.IX.fromDateTimes(e,t.plus({days:1})).splitBy({day:1}).map(e=>e.start.toISODate()),i={},l=[],d={},c=g.UJ.small,u=100;s.forEach(e=>{l.push(x.c9.fromISO(e).toFormat("ccccc LLL, dd"));let t=x.c9.fromISO(e).toFormat("cccc").toUpperCase(),n=r.find(e=>e.day_of_week===t),o=a.find(t=>t.entry_date===e),s=n?.energy?.value??0;i[e]={goal:s},d[e]={proteinGoal:(0,h.yX)("protein",n?.protein??0,s),carbGoal:(0,h.yX)("carbohydrates",n?.carbohydrates??0,s),fatGoal:(0,h.yX)("fat",n?.fat??0,s),carbsConsumed:(0,h.yX)("carbohydrates",o?.carbohydrates??0,s),fatConsumed:(0,h.yX)("fat",o?.fat??0,s),proteinConsumed:(0,h.yX)("protein",o?.protein??0,s)},u=Math.max(u,d[e].carbsConsumed,d[e].proteinConsumed,d[e].fatConsumed)});let m={},p=!1;a.forEach(e=>{e.energy_consumed_by_meal.forEach(t=>{o.forEach(r=>{p=!0,i[e.entry_date]||(i[e.entry_date]={}),i[e.entry_date][r]||(t.meal_name===r?i[e.entry_date][r]=Math.round(t.energy.value):i[e.entry_date][r]=null)})})});let b=[n.palette.common.brand.quaternaryBG,n.palette.common.brand.fat,n.palette.common.brand.quaternary,n.palette.common.brand.protein,n.palette.common.brand.carb,n.palette.common.brand.secondary],y={fat:n.palette.common.brand.fat,protein:n.palette.common.brand.protein,carbs:n.palette.common.brand.carb};if(p)for(let e in i)for(let t in i[e])"goal"===t||m[t]||(m[t]={type:"bar",label:t,data:s.map(e=>i[e]?.[t]),backgroundColor:b.pop(),barThickness:14,borderWidth:0,borderRadius:Number.MAX_VALUE});return{calorieChartData:{labels:l,datasets:[{type:"line",label:"Calorie Goal",data:s.map(e=>Math.round(i[e]?.goal??0)),backgroundColor:n.palette.common.neutrals.tertiary,showLine:!1},...Object.values(m)]},calorieChartOptions:{interaction:{intersect:!1,mode:"index"},maintainAspectRatio:!1,plugins:{legend:{position:"bottom",labels:{boxWidth:12}},title:{display:!0,text:"Daily Calories"},tooltip:{filter:e=>Number(e.dataset.data[e.dataIndex])>0}},scales:{x:{stacked:!0,grid:{display:!1}},y:{stacked:!0,border:{dash:[2,5]},suggestedMax:3e3}}},macronutrientChartData:{labels:l,datasets:[{type:"bar",label:"Fat Goal",data:s.map(e=>{let t=d[e].fatGoal;return[t-u*c,t+u*c]}),backgroundColor:n.palette.common.neutrals.white,borderColor:y.fat,xAxisID:"xTarget",barPercentage:.6,borderWidth:1,borderRadius:Number.MAX_VALUE,borderSkipped:!1},{type:"bar",label:"Carbs Goal",data:s.map(e=>{let t=d[e].carbGoal;return[t-c*u,t+c*u]}),backgroundColor:n.palette.common.neutrals.white,borderColor:y.carbs,xAxisID:"xTarget",barPercentage:.6,borderWidth:1,borderRadius:Number.MAX_VALUE,borderSkipped:!1},{type:"bar",label:"Protein Goal",data:s.map(e=>{let t=d[e].proteinGoal;return[t-c*u,t+c*u]}),backgroundColor:n.palette.common.neutrals.white,borderColor:y.protein,xAxisID:"xTarget",barPercentage:.6,borderWidth:1,borderRadius:Number.MAX_VALUE,borderSkipped:!1},{type:"bar",label:"Fat Consumed",data:s.map(e=>d[e].fatConsumed),backgroundColor:y.fat,barPercentage:.6,borderRadius:Number.MAX_VALUE,xAxisID:"x"},{type:"bar",label:"Carbs Consumed",data:s.map(e=>d[e].carbsConsumed),backgroundColor:y.carbs,barPercentage:.6,borderRadius:Number.MAX_VALUE,xAxisID:"x"},{type:"bar",label:"Protein Consumed",data:s.map(e=>d[e].proteinConsumed),backgroundColor:y.protein,barPercentage:.6,borderRadius:Number.MAX_VALUE,xAxisID:"x"}]},macronutrientChartOptions:{interaction:{intersect:!1,mode:"index"},maintainAspectRatio:!1,aspectRatio:1.2,plugins:{legend:{position:"bottom",labels:{boxWidth:12}},title:{display:!0,text:"Daily Macronutrients"},tooltip:{callbacks:{label:e=>{let t;return(t=Array.isArray(e.raw)?e.raw.reduce((e,t)=>
1t+e,0)/e.raw.length:e.formattedValue)?`${e.dataset.label} - ${t}%`:e.dataset.label}}}},scales:{xTarget:{display:!1,grid:{display:!1}},y:{suggestedMin:0,suggestedMax:100,border:{dash:[2,5]},ticks:{callback:e=>`${e}%`}}}},hasLoggedFood:p}})({startDate:S,endDate:R,macroGoalArray:F||[],macroDailyArray:T||[],theme:e,mealNames:W});return"calories"===r?(0,a.jsx)(M.A,{title:"Calories",description:"Calories consumed relative to goal",children:(0,a.jsxs)(n.A,{size:12,sx:{height:280,...q},children:[!J&&(0,a.jsx)(o.A,{sx:[z,H],children:"No Foods Logged"}),(0,a.jsx)(l.t1,{type:"bar",data:Z,options:X,"aria-label":"Weekly Summary of Calorie Goal Breakdown",fallbackContent:(0,a.jsx)(s.A,{children:"Weekly Summary of Calorie Goal Breakdown"})})]})}):"macronutrients"===r?(0,a.jsx)(M.A,{title:"Macronutrients",description:"Macronutrients consumed relative to goal",children:(0,a.jsxs)(n.A,{size:12,sx:[q,Y],children:[!J&&(0,a.jsx)(o.A,{sx:[z,K],children:"No Foods Logged"}),(0,a.jsx)(l.t1,{type:"bar",data:Q,options:ee,"aria-label":"Weekly Summary of Macronutrient Breakdown",fallbackContent:(0,a.jsx)(s.A,{children:"Weekly Summary of Macronutrient Goal Breakdown"})})]})}):void 0}function J(){return(0,a.jsx)(v,{children:(0,a.jsx)(Z,{})})}},86961:(e,t,r)=>{"use strict";r.d(t,{A:()=>u});var a=r(64255),n=r(1179),o=r(90110);let s={border:1,bgcolor:"common.neutrals.white",borderColor:"common.neutrals.background",borderRadius:2,height:"100%"},i={p:4,bgcolor:"common.neutrals.midground1",borderBottom:1,borderColor:"common.neutrals.midground1",borderTopLeftRadius:8,borderTopRightRadius:8},l={fontSize:20},d={mt:2,fontSize:14},c={py:3,px:6,bgcolor:"common.neutrals.inverse",borderBottomLeftRadius:8,borderBottomRightRadius:8};function u({children:e,title:t,description:r}){return(0,a.jsxs)(n.A,{sx:s,children:[(0,a.jsxs)(n.A,{sx:i,children:[(0,a.jsx)(o.A,{sx:l,component:"h2",children:t}),r&&(0,a.jsx)(o.A,{sx:d,children:r})]}),(0,a.jsx)(n.A,{sx:c,children:e})]})}},87159:(e,t,r)=>{"use strict";r.d(t,{A:()=>x});var a=r(64255),n=r(1179),o=r(69025),s=r(90110),i=r(60382),l=r(83577),d=r(7040),c=r(68559),u=r(83299);l.t1.register(l.Bs);let m={position:"relative"},p={top:0,left:0,bottom:0,right:0,position:"absolute",alignItems:"center",justifyContent:"center"},b={color:"common.neutrals.secondary"};function x({energy:e,carbs:t,fat:r,protein:l,animateIn:h=!0,size:g=56,showLabel:y=!0,sx:f={}}){let A=(0,c.Vb)(),j=(0,i.A)(),w=e>0,v=t*u.sK.carbohydrates,k=r*u.sK.fat,C=l*u.sK.protein,M=w?[j.palette.common.brand.carb,j.palette.common.brand.fat,j.palette.common.brand.protein,j.palette.common.neutrals.background]:[j.palette.common.neutrals.background],D=`${A("carbohydrates")}: ${t}${A("gramsAbbreviated")}, ${A("fat")}: ${r}${A("gramsAbbreviated")}, ${A("protein")}: ${l}${A("gramsAbbreviated")}`;return(0,a.jsxs)(n.A,{sx:[m,f],children:[(0,a.jsx)(n.A,{sx:{width:g,height:g},children:(0,a.jsx)(d.nu,{data:{datasets:[{data:w?[v,k,C,e-(v+k+C)]:[1],backgroundColor:M,borderColor:j.palette.common.neutrals.background}]},options:{animation:{animateRotate:h},plugins:{legend:{display:!1},tooltip:{enabled:!1}},cutout:"75%",radius:g/2},"aria-label":A("food.macrosCircle.ariaLabel",{data:D})})}),(0,a.jsxs)(o.A,{sx:p,children:[(0,a.jsx)(s.A,{variant:"Body/Bold/MD",children:Math.round(e)}),y&&(0,a.jsx)(s.A,{sx:b,variant:"Legal/MD",component:"p",children:A("caloriesAbbreviated")})]})]})}},92776:(e,t,r)=>{"use strict";r.d(t,{A:()=>o});var a=r(27930),n=r(64255);let o=(0,a.A)((0,n.jsx)("path",{d:"M11 7h2v2h-2zm0 4h2v6h-2zm1-9C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8"}),"InfoOutlined")},93514:(e,t,r)=>{"use strict";r.d(t,{A:()=>M});var a=r(64255),n=r(1179),o=r(69025),s=r(90110),i=r(98347),l=r.n(i),d=r(68559),c=r(93937),u=r(68690),m=r(86961);let p={src:"/_next/static/media/chef-hat.e63883d4.svg",height:52,width:52,blurWidth:0,blurHeight:0},b={pb:5,display:{xs:"flex",md:"none"}},x={display:{xs:"none",md:"flex"},pb:5,py:2,justifyContent:"space-between"},h={pb:3,borderBottom:"1px solid",borderColor:"common.neutrals.quinary"},g={color:"common.neutrals.secondary",mt:2},y={pt:4,pb:3},f={my:4},A={my:4,mr:6},j={borderTop:"1px solid",borderColor:"common.neutrals.background"},w={alignItems:"center",my:10},v={display:{xs:"none",md:"flex"},alignItems:"center",textAlign:"center",mt:5},k={my:4}
1,C={display:"flex",justifyContent:"space-between"},M=({rankedFoodEntries:e,dailyMacronutrients:t,isTrainer:r=!1,energyPreference:i="calories"})=>{let M=(0,d.Vb)(),D="kilojoules"===i,$=D?M("weeklyDigest.totalKilojoules"):M("weeklyDigest.totalCalories"),L=D?M("weeklyDigest.kj"):M("weeklyDigest.cal"),_=e=>Math.round(D?(0,u.Vl)(e):e);return(0,a.jsxs)(m.A,{title:M("weeklyDigest.frequentlyLoggedFoods"),description:(0,c.U1)(e,t,M,r),children:[e.slice(0,3).map(({food:e,num_entries:t,total_energy:r},i)=>(0,a.jsxs)(n.A,{children:[(0,a.jsxs)(o.A,{sx:b,children:[(0,a.jsx)(s.A,{sx:h,children:(0,a.jsx)("strong",{children:e.description})}),(0,a.jsxs)(n.A,{sx:[C,y],children:[(0,a.jsx)(s.A,{children:M("weeklyDigest.timesEaten")}),(0,a.jsx)(s.A,{children:t})]}),(0,a.jsxs)(n.A,{sx:[C,y],children:[(0,a.jsx)(s.A,{children:$}),(0,a.jsx)(s.A,{children:_(r.value)})]})]}),(0,a.jsxs)(o.A,{direction:"row",sx:0===i?x:{...x,...j},children:[(0,a.jsxs)(n.A,{sx:f,children:[(0,a.jsx)(s.A,{children:e.description}),(0,a.jsx)(s.A,{variant:"caption",component:"p",sx:g,children:1===t?`${t} ${M("weeklyDigest.time")}`:`${t} ${M("weeklyDigest.times")}`})]}),(0,a.jsx)(s.A,{sx:A,children:`${_(r.value)} ${L}`})]})]},`${e.description}`)),0===e.length&&(0,a.jsxs)(o.A,{sx:w,children:[(0,a.jsx)(l(),{src:p,alt:""}),(0,a.jsx)(s.A,{sx:k,children:M("weeklyDigest.didNotLogFoods")})]}),e.length>0&&e.length<3&&(0,a.jsxs)(o.A,{sx:v,children:[(0,a.jsx)(l(),{src:p,alt:""}),(0,a.jsxs)(s.A,{sx:k,children:[1===e.length&&M("weeklyDigest.oneLoggedFood"),2===e.length&&M("weeklyDigest.twoLoggedFoods")]})]})]})}}},e=>{e.O(0,[1150,8347,5839,6753,4366,7707,636,6593,8792],()=>e(e.s=30532)),_N_E=e.O()}]);
2//# sourceMappingURL=chart-25651f3cab291959.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.