PageSourceSearch

https://cdn.shef.com/assets/index-811b7dca.js

js shef.com collected 2026-09-24 18:12:31 UTC 4,606 bytes, 2 lines download raw bytes

1import{h as U,j as e,aB as G}from"./vendor-4b5ffb89.js";import{i as W,ox as w,k as H,g as Q,mD as g,b1 as Y,bR as $,ck as q,cl as z,R as T,$ as J,N as K,oR as V,oL as X,oM as Z,a9 as ee}from"./index-196c1c55.js";import{u as te}from"./useDietaryPreferencesForm-81d8b117.js";import{A as ne,C as ie}from"./index-db9ec5c3.js";import{C as re,a as oe}from"./Container-9d86a07e.js";import{I as C}from"./IndicatorNumSelected-2232044d.js";import{D as se,R as ae,P as ce}from"./RestrictionsForm-7dff5ceb.js";import{B as le}from"./BackBar-aac57df4.js";import"./utiles-968fce85.js";import"./consts-98b3bb84.js";import"./Selector-40e784b4.js";import"./ScrollSnapCarousel-9a76d912.js";import"./arrow-brand-secondary-500-5c286dae.js";import"./arrow-178839f0.js";const de=({tasteProfile:r={},refetchTasteProfile:a})=>{var R,h;const[o]=W(),[d]=w(),p=H(),c=Q(),u=U(),D=r.replacementDietaryRestrictions??[],I=r.menuDietaryRestrictions??[],m=D.map(n=>({name:n,isStrictlyRestricted:I.includes(n)})),x={dietType:r.dietType??g.Omnivore,proteinPreferences:r.preferredProteins??[],replacementDietaryRestrictions:m,anyDietaryRestrictions:m.length>0},t=te(x),{value:N,onChange:v}=t.menuDietaryRestrictionsInput.field,{value:l,onChange:S}=t.replacementDietaryRestrictionsInput.field,{value:E,onChange:M}=t.moreInfoInput.field,y=(R=c.location.state)==null?void 0:R.from,j=y===T.CONSUMER_MEAL_PLANS_EDIT_ORDER?"Select Dishes":"Back",A=async()=>{const{formValues:n}=t,P=n.replacementDietaryRestrictions??[],{replacementDietaryRestrictions:B,menuDietaryRestrictions:O}=P.reduce((i,s)=>({replacementDietaryRestrictions:[...i.replacementDietaryRestrictions,s.name],menuDietaryRestrictions:s.isStrictlyRestricted?[...i.menuDietaryRestrictions,s.name]:i.menuDietaryRestrictions}),{replacementDietaryRestrictions:[],menuDietaryRestrictions:[]}),F={replacementDietaryRestrictions:B,menuDietaryRestrictions:O,dietType:n.dietType,preferredProteins:n.proteinPreferences,ingredientPriorities:r.ingredientPriorities,householdGoals:r.householdGoals},k=await d({variables:{input:{userId:(o==null?void 0:o.id)??"",tasteProfile:F}}});if(p.track(J.MEAL_PLAN_TASTE_PROFILE_EDITED,{dietType:(n==null?void 0:n.dietType)??g.Omnivore,preferredProteins:n.proteinPreferences,dietaryFilters:n.menuDietaryRestrictions,dietaryRestrictions:P.map(i=>i.name),cuisinePreferences:[]}),k.errors)K.error("We cannot update your taste profile at this time.",{position:G.BOTTOM_CENTER});else{const{cache:i}=u;Object.keys(i.extract()).forEach(s=>{s.startsWith("FoodItem:")&&i.evict({id:s,fieldName:"ingredientsFlagged"})}),i.gc(),V.getState().clear(),a==null||a(),c.push(y??T.CONSUMER_MEAL_PLANS_MANAGE_PLAN)}},f="Update taste profile",L=(l==null?void 0:l.length)??0,_=((h=t==null?void 0:t.proteinPreferencesInput.field.value)==null?void 0:h.length)??0,b=[{header:"Household Diet",expandedOnLoad:!0,hiddenContent:e.jsx("div",{className:"pb-3",children:e.jsx(se,{dietType:t.dietTypeInput.field.value,onChangeDietType:t.dietTypeInput.field.onChange})})},{header:"Ingredients to avoid",controlButtonAccompaniment:e.jsx(C,{numSelected:L}),hiddenContent:e.jsx("div",{className:"pb-3",children:e.jsx(ae,{menuDietaryRestrictions:N??[],onChangeMenuDietaryRestrictions:v,replacementDietaryRestrictions:l??[],onChangeReplacementDietaryRestrictions:S,otherRestrictions:E??null,onChangeOther:M,moreInfoIsStrictlyRestrictedInput
1:t.moreInfoIsStrictlyRestrictedInput,dietType:t.dietTypeInput.field.value})})},{header:"Your preferred proteins",controlButtonAccompaniment:e.jsx(C,{numSelected:_}),hiddenContent:e.jsx("div",{className:"pb-3",children:e.jsx(ce,{dietType:t.dietTypeInput.field.value,proteinPreferences:t.proteinPreferencesInput.field.value,onChangeProteinPreferences:t.proteinPreferencesInput.field.onChange})})}];return e.jsxs(e.Fragment,{children:[e.jsx(le,{copy:j,route:Y.CONSUMER_MEAL_PLANS_MANAGE}),e.jsxs(re,{containerWidth:oe.Narrow,className:"mt-4",children:[e.jsx("h5",{className:"text-h5-bold uppercase text-eggplant",children:"Taste Profile"}),e.jsx(ne,{hiddenContentPadding:!1,content:b,controlButtonType:ie.PlusMinus,controlButtonColor:$.EGGPLANT_500})]}),e.jsx("div",{className:"sticky bottom-0 flex flex-col items-center gap-4 p-4",children:e.jsx(q,{buttonType:z.Primary,title:f,onClick:A,children:f})})]})},Ne=({currentUser:r})=>{const{refetchTasteProfile:a}=X(),{data:o,loading:d,refetch:p}=Z({variables:{input:{userId:r.id??""}}}),c=(o==null?void 0:o.getTasteProfile.tasteProfile)??void 0,u=async()=>{await p(),await a()};return d?e.jsx(ee,{}):e.jsx(de,{tasteProfile:c,refetchTasteProfile:u})};export{Ne as default};
2//# sourceMappingURL=index-811b7dca.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.