1import{c as n,p as it,f as z,g as d,t as g,a as l,i as e,b as Z,k as ue,r as T,u as Ee,e as Ue,n as Ve,S as w,q as $e,F as Ae,m as rt,P as Je,l as st,d as be,h as nt}from"./web-DyhNhRah.js";import{E as at}from"./Emoji-DxpDgdWA.js";import{F as ot,c as bt,e as ut,a as _t,d as ft}from"./FoodFormFields-CdsOL71d.js";import{p as mt}from"./toast-BLik5sa6.js";import{g as xt}from"./time-TaDpySOg.js";import{u as ht}from"./AuthProvider-EU7t0KcJ.js";import{a as pt}from"./apiFetch-DFvoe_0W.js";import{l as Ye}from"./labels-CfV5H2rS.js";import{c as vt}from"./check-BD-xBnvY.js";import{e as St}from"./ellipsis-vertical-Bbetd3DM.js";import{I as yt}from"./Icon-DOzbWna9.js";import{p as Ct}from"./pencil-CvkbZ162.js";import{p as wt}from"./plus-CGoeQntH.js";import{t as Ft}from"./trash-2-D62uQ7Xj.js";import{r as re}from"./numbers-Cja6T49v.js";import{d as kt}from"./foods-qgwRa_lv.js";import{c as ct,q as At}from"./createAsync-KplUdzUp.js";import{C as Ze}from"./CaloriesIcon-C0p9kgbB.js";import{D as Et}from"./DealInEmptyState-BvszrIhr.js";import{m as It}from"./calories-Cfjtyqy5.js";import"./auth-C8FBwjFQ.js";import"./routing-DgxbRIRQ.js";import"./achievements-DHtL8m_Z.js";import"./quests-Bz2Glnda.js";import"./streak-CAZKOZ-0.js";import"./reviewPrompt-D5DaIprh.js";import"./preload-helper-ug3pwPZ1.js";import"./track-SnGrypN8.js";import"./flame-Cu9amoZ2.js";var zt=[["path",{d:"M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z",key:"sc7q7i"}]],Lt=r=>n(yt,it(r,{iconNode:zt,name:"funnel"})),Nt=Lt,Mt=g('<dialog class="modal modal-open"><div class="modal-box space-y-4"><h3 class="font-bold text-xl">New Food</h3><form class="flex flex-col gap-3"><!$><!/><div class="flex gap-2 pt-2"><button type=button class="btn btn-outline flex-1">Cancel</button><button class="btn btn-info flex-1"></button></div></form></div><form method=dialog class=modal-backdrop><button type=button>close');function Dt(r){const[b,p]=z(!1),[F,k]=z([]);let f;function u(){f?.reset(),k([])}async function A(t){if(t.preventDefault(),!b()){p(!0);try{const c=t.currentTarget,i=new FormData(c);await bt({name:String(i.get("name")||""),serving_size:String(i.get("serving_size")||""),fat:re(Number(i.get("fat"))),carbs:re(Number(i.get("carbs"))),protein:re(Number(i.get("protein"))),labels:F()}),u(),r.onClose()}finally{p(!1)}}}function s(){u(),r.onClose()}return(()=>{var t=d(Mt),c=t.firstChild,i=c.firstChild,$=i.nextSibling,o=$.firstChild,[v,L]=l(o.nextSibling),Q=v.nextSibling,_=Q.firstChild,S=_.nextSibling,j=c.nextSibling,N=j.firstChild;$.addEventListener("submit",A);var M=f;return typeof M=="function"?Ee(M,$):f=$,e($,n(ot,{labels:F,setLabels:k}),v,L),_.$$click=s,e(S,()=>b()?"Saving...":"Save"),N.$$click=s,Z(()=>ue(S,"disabled",b())),T(),t})()}Ue(["click"]);var Pt=g(`<form class="flex flex-col gap-3"><!$><!/><div role=alert class="alert alert-info alert-soft"><span>Note: Changing macros won't affect past log entries. Renaming or relabeling applies everywhere the food is used.</span></div><div class="flex gap-2 pt-2"><button type=button class="btn btn-outline flex-1">Cancel</button><button class="btn btn-info flex-1">`),Tt=g('<dialog class="modal modal-open"><div class="modal-box space-y-4"><h3 class="font-bold text-xl">Edit Food</h3><!$><!/></div><form method=dialog class=modal-backdrop><button>close');function jt(r){const[b,p]=z(!1),[F,k]=z([]),f=ct(async()=>{const t=r.foodId();return t?kt(t):null});let u;function A(){u?.reset(),k([])}Ve(()=>{const t=f();!t||!u||(u.elements.namedItem("name").value=t.name,u.elements.namedItem("serving_size").value=t.serving_size,u.elements.namedItem("fat").value=String(t.fat),u.elements.namedItem("carbs").value=String(t.carbs),u.elements.namedItem("protein").value=String(t.protein),k(t.labels??[]))});async function s(t){if(t.preventDefault(),b())return;const c=r.foodId(),i=f();if(!(!c||!i)){p(!0);try{const $=t.currentTarget,o=new FormData($);await ut(c,{name:String(o.get("name")||""),serving_size:String(o.get("serving_size")||""),fat:re(Number(o.get("fat"))),carbs:re(Number(o.get("carbs"))),protein:re(Number(o.get("protein"))),labels:F()},i),A(),r.onClose()}finally{p(!1)}}}return(()=>{var t=d(Tt),c=t.firstChild,i=c.firstChild,$=i.nextSibling,[o,v]=l($.nextSibling),L=c.nextSibling,Q=L.firstChild;return e(c,n(w,{get when(){return f()},get children(){var _=d(Pt),S=_.firstChild,[j,N]=l(S.nextSibling),M=j.nextSibling,q=M.nextSibling,m=q.firstChild,E=m.nextSibling;_.addEventListener("submit",s);var O=u;return typeof O=="function"?Ee(O,_):u=_,e(_,n(ot,{labels:F,setLabels:k}),j,N),m.$$click=()=>{A(),r.onClose()},e(E,()=>b()?"Saving...":"Save"),Z(()=>ue(E,"disabled",b())),T(),_}}),o,v),Q.$$click=()=>{A(),r.onClose()},T(),t})()}Ue(["click"]);var qt=g('<div class="flex items-center gap-3 rounded-lg border border-base-300 bg-base-100 px-4 py-3"><div class="min-w-0 flex-1"><div class="text-sm font-medium truncate"></div><div class="text-xs opacity-50 truncate"></div></div><div class="flex gap-2 text-xs font-medium shrink-0"><span class=text-warning><!$><!/><!$><!/></span><span class=text-secondary><!$><!/>F</span><span class=text-primary><!$><!/>C</span><span class=text-accent><!$><!/>P'),Ot=g("<span class=text-gradient>starts here"),Rt=g('<th><!$><!/> <span class="opacity-40 text-xs">'),Gt=g('<div class=card-body><table class="table w-full"><thead><tr><!$><!/><th class="text-right sm:hidden">Macros</th><!$><!/><!$><!/><!$><!/><!$><!/><th class=text-right>Actions</th></tr></thead><tbody>'),Qt=g('<tr><td colspan=6 class="text-center py-12 opacity-50"><!$><!/> No foods found'),Bt=g('<span class="text-xs opacity-50">'),Ht=g('<div class="flex flex-wrap gap-1 mt-1">'),Kt=g('<tr class=hover><td><div class="flex flex-col"><span class="font-medium break-words"></span><!$><!/><!$><!/></div></td><td class="sm:hidden whitespace-nowrap"><div class="flex justify-end gap-2 text-xs font-medium"><span class=text-warning><!$><!/><!$><!/></span><span class=text-secondary><!$><!/>F</span><span class=text-primary><!$><!/>C</span><span class=text-accent><!$><!/>P</span></div></td><td class="text-right hidden sm:table-cell"><span class="text-sm font-medium text-warning"><!$><!/> <!$><!/></span></td><td class="text-right hidden sm:table-cell"><span class="text-sm font-medium text-secondary"><!$><!/>g</span></td><td class="text-right hidden sm:table-cell"><span class="text-sm font-medium text-primary"><!$><!/>g</span></td><td class="text-right hidden sm:table-cell"><span class="text-sm font-medium text-accent"><!$><!/>g</span></td><td><div class="flex justify-end"><button class="btn btn-ghost btn-sm">'),Wt=g("<span>"),Jt=g('<ul class="menu bg-base-300 rounded-box w-52 p-2 shadow-xl border border-base-200"style=position:fixed;z-index:9999><li><button></button></li><li><button><!$><!/> Edit</button></li><li><button class=text-error><!$><!/> Delete'),Yt=g('<button class="btn btn-info ml-auto">+ New Food'),Zt=g('<span class="badge badge-info badge-sm">'),Ut=g('<button class="btn btn-ghost btn-xs self-start">Clear filters â'),Vt=g('<div class="absolute right-0 z-10 mt-2 w-56 rounded-box border border-base-200 bg-base-300 p-3 shadow-xl flex flex-col gap-2"><div class="text-xs font-semibold uppercase tracking-wide opacity-60">Filter by label</div><div class="flex flex-wrap gap-2"></div><!$><!/>'),Xt=g('<div class=relative><button class="btn btn-ghost gap-2"><!$><!/>Filters<!$><!/></button><!$><!/>'),en=g('<div class="flex items-center justify-between gap-3"><!$><!/><!$><!/>'),tn=g('<div class="card bg-base-200 shadow">'),nn=g('<div class="flex justify-center"><div class=join><button class="join-item btn btn-sm">«</button><!$><!/><button class="join-item btn btn-sm">»'),ln=g('<div class="text-center text-sm opacity-60">
1'),rn=g('<div class="flex flex-col gap-3"><div class="flex justify-between items-start"><div class="hidden sm:block"><h1 class="text-3xl font-bold">Saved Foods</h1><p class="opacity-60 text-sm">Manage the foods you log frequently</p></div><!$><!/></div><!$><!/><!$><!/><!$><!/><!$><!/>'),lt=g("<button>"),sn=g('<button class="btn btn-xs btn-ghost">â'),an=g('<div class="input input-bordered flex items-center gap-2 w-48 focus-within:ring-2 focus-within:ring-primary"><!$><!/><input type=search placeholder="Search foods"class="grow bg-transparent outline-none"><!$><!/>');const ge=20;function _e(r){return Math.round(It(r.protein,r.carbs,r.fat).total)}const on=[{name:"Grilled chicken breast",serving:"1 breast · 170g",protein:53,carbs:0,fat:6},{name:"Greek yogurt, plain",serving:"1 cup · 245g",protein:20,carbs:8,fat:4},{name:"Jasmine rice, cooked",serving:"1 cup · 158g",protein:4,carbs:45,fat:0},{name:"Olive oil",serving:"1 tbsp · 14g",protein:0,carbs:0,fat:14},{name:"Banana",serving:"1 medium · 118g",protein:1,carbs:27,fat:0},{name:"Whole eggs",serving:"2 large · 100g",protein:13,carbs:1,fat:10},{name:"Rolled oats, dry",serving:"1/2 cup · 40g",protein:5,carbs:27,fat:3},{name:"Almonds",serving:"1 oz · 28g",protein:6,carbs:6,fat:14},{name:"Ground beef, 90/10",serving:"4 oz · 113g",protein:23,carbs:0,fat:11},{name:"Sweet potato, baked",serving:"1 medium · 130g",protein:2,carbs:26,fat:0}];function cn(r){return n(Et,{layout:"above",staggerMs:65,items:on,renderItem:b=>(()=>{var p=d(qt),F=p.firstChild,k=F.firstChild,f=k.nextSibling,u=F.nextSibling,A=u.firstChild,s=A.firstChild,[t,c]=l(s.nextSibling),i=t.nextSibling,[$,o]=l(i.nextSibling),v=A.nextSibling,L=v.firstChild,[Q,_]=l(L.nextSibling);Q.nextSibling;var S=v.nextSibling,j=S.firstChild,[N,M]=l(j.nextSibling);N.nextSibling;var q=S.nextSibling,m=q.firstChild,[E,O]=l(m.nextSibling);return E.nextSibling,e(k,()=>b.name),e(f,()=>b.serving),e(A,()=>_e(b),t,c),e(A,n(Ze,{size:12}),$,o),e(v,()=>b.fat,Q,_),e(S,()=>b.carbs,N,M),e(q,()=>b.protein,E,O),p})(),emoji:"ðï¸",get title(){return["Your food library ",d(Ot),"."]},pitch:"Add the meals you eat often and each one lands here with its macros â ready to drop into any day in one tap.",ctaLabel:"+ Add your first food",get onCta(){return r.onAdd}})}const dn=At(async()=>pt("/foods"),"foods");function $n(r){const[b,p]=z(null),[F,k]=z({top:0,right:0});let f;function u(s){return(()=>{var t=d(Rt),c=t.firstChild,[i,$]=l(c.nextSibling),o=i.nextSibling,v=o.nextSibling;return t.$$click=()=>r.onToggleSort(s.k),e(t,()=>s.label,i,$),e(v,()=>r.sortIcon(s.k)),Z(()=>be(t,`cursor-pointer select-none ${s.class??""}`)),T(),t})()}Ve(()=>{const s=t=>{b()&&f&&!f.contains(t.target)&&p(null)};document.addEventListener("pointerdown",s),st(()=>document.removeEventListener("pointerdown",s))});function A(s,t){s.stopPropagation();const c=s.currentTarget.getBoundingClientRect();k({top:c.bottom+4,right:window.innerWidth-c.right}),p(i=>i?.id===t.id?null:t)}return[(()=>{var s=d(Gt),t=s.firstChild,c=t.firstChild,i=c.firstChild,$=i.firstChild,[o,v]=l($.nextSibling),L=o.nextSibling,Q=L.nextSibling,[_,S]=l(Q.nextSibling),j=_.nextSibling,[N,M]=l(j.nextSibling),q=N.nextSibling,[m,E]=l(q.nextSibling),O=m.nextSibling,[W,Ie]=l(O.nextSibling);W.nextSibling;var ze=c.nextSibling;return e(i,n(u,{label:"Name",k:"name"}),o,v),e(i,n(u,{label:"Calories",k:"calories",class:"text-right hidden sm:table-cell"}),_,S),e(i,n(u,{label:"Fat",k:"fat",class:"text-right hidden sm:table-cell"}),N,M),e(i,n(u,{label:"Carbs",k:"carbs",class:"text-right hidden sm:table-cell"}),m,E),e(i,n(u,{label:"Protein",k:"protein",class:"text-right hidden sm:table-cell"}),W,Ie),e(ze,n(w,{get when(){return r.foods.length>0},get fallback(){return(()=>{var h=d(Qt),V=h.firstChild,a=V.firstChild,[I,P]=l(a.nextSibling);return I.nextSibling,e(V,n(at,{e:"ð½ï¸"}),I,P),h})()},get children(){return n(Ae,{get each(){return r.foods},children:h=>(()=>{var V=d(Kt),a=V.firstChild,I=a.firstChild,P=I.firstChild,K=P.nextSibling,[y,R]=l(K.nextSibling),J=y.nextSibling,[ie,Le]=l(J.nextSibling),fe=a.nextSibling,Ne=fe.firstChild,X=Ne.firstChild,Me=X.firstChild,[me,xe]=l(Me.nextSibling),De=me.nextSibling,[Pe,he]=l(De.nextSibling),se=X.nextSibling,Te=se.firstChild,[pe,je]=l(Te.nextSibling);pe.nextSibling;var x=se.nextSibling,U=x.firstChild,[Y,ae]=l(U.nextSibling);Y.nextSibling;var ee=x.nextSibling,oe=ee.firstChild,[te,C]=l(oe.nextSibling);te.nextSibling;
1var D=fe.nextSibling,G=D.firstChild,ve=G.firstChild,[Se,qe]=l(ve.nextSibling),Oe=Se.nextSibling,Re=Oe.nextSibling,[Ge,Qe]=l(Re.nextSibling),ye=D.nextSibling,Ce=ye.firstChild,we=Ce.firstChild,[B,Be]=l(we.nextSibling);B.nextSibling;var ce=ye.nextSibling,Fe=ce.firstChild,He=Fe.firstChild,[ke,H]=l(He.nextSibling);ke.nextSibling;var de=ce.nextSibling,ne=de.firstChild,Ke=ne.firstChild,[Xe,dt]=l(Ke.nextSibling);Xe.nextSibling;var $t=de.nextSibling,gt=$t.firstChild,et=gt.firstChild;return e(P,()=>h.name),e(I,n(w,{get when(){return h.serving_size},get children(){var le=d(Bt);return e(le,()=>h.serving_size),le}}),y,R),e(I,n(w,{get when(){return(h.labels??[]).length>0},get children(){var le=d(Ht);return e(le,n(Ae,{get each(){return h.labels??[]},children:tt=>(()=>{var We=d(Wt);return e(We,tt),Z(()=>be(We,`badge badge-soft badge-xs ${Ye(tt)}`)),We})()})),le}}),ie,Le),e(X,()=>_e(h),me,xe),e(X,n(Ze,{size:12}),Pe,he),e(se,()=>h.fat,pe,je),e(x,()=>h.carbs,Y,ae),e(ee,()=>h.protein,te,C),e(G,()=>_e(h),Se,qe),e(G,n(Ze,{size:13}),Ge,Qe),e(Ce,()=>h.fat,B,Be),e(Fe,()=>h.carbs,ke,H),e(ne,()=>h.protein,Xe,dt),et.$$click=le=>A(le,h),e(et,n(St,{size:22})),T(),V})()})}})),s})(),n(w,{get when(){return b()},children:s=>n(Je,{get children(){var t=d(Jt),c=t.firstChild,i=c.firstChild,$=c.nextSibling,o=$.firstChild,v=o.firstChild,[L,Q]=l(v.nextSibling);L.nextSibling;var _=$.nextSibling,S=_.firstChild,j=S.firstChild,[N,M]=l(j.nextSibling);N.nextSibling;var q=f;return typeof q=="function"?Ee(q,t):f=t,i.$$click=()=>{r.onLog(s()),p(null)},e(i,(()=>{var m=rt(()=>r.loggedId()===s().id);return()=>m()?[n(vt,{size:16})," Added"]:[n(wt,{size:16})," Add to Today's Log"]})()),o.$$click=()=>{r.onEdit(s().id),p(null)},e(o,n(Ct,{size:16}),L,Q),S.$$click=()=>{r.onDelete(s().id),p(null)},e(S,n(Ft,{size:16}),N,M),Z(m=>{var E=`${F().top}px`,O=`${F().right}px`,W=r.loggedId()===s().id?"text-success":"";return E!==m.e&&nt(t,"top",m.e=E),O!==m.t&&nt(t,"right",m.t=O),W!==m.a&&be(i,m.a=W),m},{e:void 0,t:void 0,a:void 0}),T(),t}})})]}function Gn(){const{user:r}=ht(),[b,p]=z(""),[F,k]=z(null),[f,u]=z(null),[A,s]=z(!1),[t,c]=z(!1),[i,$]=z(1),[o,v]=z([]),[L,Q]=z("name"),[_,S]=z("asc"),[j,N]=z(!1);let M;Ve(()=>{const a=I=>{j()&&M&&!M.contains(I.target)&&N(!1)};document.addEventListener("pointerdown",a),st(()=>document.removeEventListener("pointerdown",a))});const q=ct(()=>dn()),m=$e(()=>{const a=q();if(!Array.isArray(a))return[];const I=new Set;for(const P of a)for(const K of P.labels??[])I.add(K);return Array.from(I)}),E=$e(()=>{const a=b().toLowerCase(),I=q();let P=Array.isArray(I)?I:[];a&&(P=P.filter(R=>R.name.toLowerCase().includes(a))),o().length&&(P=P.filter(R=>o().some(J=>R.labels?.includes(J))));const K=L(),y=_();return[...P].sort((R,J)=>{const ie=K==="name"?R.name.localeCompare(J.name):K==="calories"?_e(R)-_e(J):R[K]-J[K];return y==="asc"?ie:-ie})}),O=$e(()=>{const a=q();return a===void 0?!1:!Array.isArray(a)||a.length===0}),W=$e(()=>Math.ceil(E().length/ge)),Ie=$e(()=>{const a=(i()-1)*ge;return E().slice(a,a+ge)});function ze(a){L()===a?S(_()==="asc"?"desc":"asc"):(Q(a),S(a==="name"?"asc":"desc")),$(1)}
1function h(a){return L()!==a?"â":_()==="asc"?"â":"â"}async function V(a){confirm("Delete this food?")&&await ft(a)}return n(w,{get when(){return r()},children:a=>{const I=xt(a().timezone);async function P(y){await _t(y.id,I),k(y.id),mt({title:"Food Logged",description:y.name,icon:"ð"}),setTimeout(()=>k(null),3e3)}const K={loggedId:F,onLog:P,onEdit:y=>{u(y),s(!0)},onDelete:V};return(()=>{var y=d(rn),R=y.firstChild,J=R.firstChild,ie=J.nextSibling,[Le,fe]=l(ie.nextSibling),Ne=R.nextSibling,[X,Me]=l(Ne.nextSibling),me=X.nextSibling,[xe,De]=l(me.nextSibling),Pe=xe.nextSibling,[he,se]=l(Pe.nextSibling),Te=he.nextSibling,[pe,je]=l(Te.nextSibling);return e(R,n(w,{get when(){return!O()},get children(){var x=d(Yt);return x.$$click=()=>c(!0),T(),x}}),Le,fe),e(y,n(w,{get when(){return!O()},get children(){var x=d(en),U=x.firstChild,[Y,ae]=l(U.nextSibling),ee=Y.nextSibling,[oe,te]=l(ee.nextSibling);return e(x,n(gn,{query:b,setQuery:C=>{p(C),$(1)}}),Y,ae),e(x,n(w,{get when(){return m().length},get children(){var C=d(Xt),D=C.firstChild,G=D.firstChild,[ve,Se]=l(G.nextSibling),qe=ve.nextSibling,Oe=qe.nextSibling,[Re,Ge]=l(Oe.nextSibling),Qe=D.nextSibling,[ye,Ce]=l(Qe.nextSibling),we=M;return typeof we=="function"?Ee(we,C):M=C,D.$$click=()=>N(B=>!B),e(D,n(Nt,{size:16}),ve,Se),e(D,n(w,{get when(){return o().length},get children(){var B=d(Zt);return e(B,()=>o().length),B}}),Re,Ge),e(C,n(w,{get when(){return j()},get children(){var B=d(Vt),Be=B.firstChild,ce=Be.nextSibling,Fe=ce.nextSibling,[He,ke]=l(Fe.nextSibling);return e(ce,n(Ae,{get each(){return m()},children:H=>{const de=()=>o().includes(H);return(()=>{var ne=d(lt);return ne.$$click=()=>{v(de()?o().filter(Ke=>Ke!==H):[...o(),H]),$(1)},e(ne,H),Z(()=>be(ne,`badge cursor-pointer ${Ye(H)} transition px-3 py-2 text-sm ${de()?"":`badge-soft hover:badge-outline hover:${Ye(H)}`}`)),T(),ne})()}})),e(B,n(w,{get when(){return o().length},get children(){var H=d(Ut);return H.$$click=()=>{v([]),$(1)},T(),H}}),He,ke),B}}),ye,Ce),T(),C}}),oe,te),x}}
1),X,Me),e(y,n(w,{get when(){return!O()},get fallback(){return n(cn,{onAdd:()=>c(!0)})},get children(){return[(()=>{var x=d(tn);return e(x,n($n,it({get foods(){return Ie()},sortKey:L,sortDir:_,onToggleSort:ze,sortIcon:h},K))),x})(),n(w,{get when(){return W()>1},get children(){var x=d(nn),U=x.firstChild,Y=U.firstChild,ae=Y.nextSibling,[ee,oe]=l(ae.nextSibling),te=ee.nextSibling;return Y.$$click=()=>$(i()-1),e(U,n(Ae,{get each(){return[...Array(W()).keys()]},children:C=>{const D=C+1;return(()=>{var G=d(lt);return G.$$click=()=>$(D),e(G,D),Z(()=>be(G,`join-item btn btn-sm ${i()===D?"btn-info":"btn-ghost"}`)),T(),G})()}}),ee,oe),te.$$click=()=>$(i()+1),Z(C=>{var D=i()===1,G=i()===W();return D!==C.e&&ue(Y,"disabled",C.e=D),G!==C.t&&ue(te,"disabled",C.t=G),C},{e:void 0,t:void 0}),T(),x}}),(()=>{var x=d(ln);return e(x,(()=>{var U=rt(()=>E().length===0);return()=>U()?"No results":`Showing ${(i()-1)*ge+1}â${Math.min(i()*ge,E().length)} of ${E().length} foods`})()),x})()]}}),xe,De),e(y,n(w,{get when(){return t()},get children(){return n(Je,{get children(){return n(Dt,{onClose:()=>c(!1)})}})}}),he,se),e(y,n(w,{get when(){return A()},get children(){return n(Je,{get children(){return n(jt,{foodId:f,onClose:()=>{s(!1),u(null)}})}})}}),pe,je),y})()}})}function gn(r){return(()=>{var b=d(an),p=b.firstChild,[F,k]=l(p.nextSibling),f=F.nextSibling,u=f.nextSibling,[A,s]=l(u.nextSibling);return e(b,n(at,{e:"ð"}),F,k),f.$$input=t=>r.setQuery(t.currentTarget.value),e(b,n(w,{get when(){return r.query()},get children(){var t=d(sn);return t.$$click=()=>r.setQuery(""),T(),t}}),A,s),Z(()=>ue(f,"value",r.query())),T(),b})()}Ue(["click","input"]);export{Gn as default,dn as getFoods};
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.