import"./hoisted.D3rG7FoM.js";import"./hoisted.DRt8F0_Y.js";const g=document.getElementById("floating-share"),x=document.getElementById("article-content-start"),$=document.getElementById("article-content-end");if(g&&x&&$){const a=()=>{const r=x.getBoundingClientRect().top,t=$.getBoundingClientRect().top;g.dataset.visible=String(r<0&&t>window.innerHeight*.35)};if(window.addEventListener("scroll",a,{passive:!0}),window.addEventListener("resize",a),a(),g.querySelectorAll("a[data-popup]").forEach(r=>r.addEventListener("click",t=>{t.preventDefault(),window.open(r.href,"share","noopener,noreferrer,width=680,height=560")})),g.hasAttribute("data-ads")){let r=!1;const t=()=>{r=!1;let i=0,o=!1;document.querySelectorAll("ins.adsbygoogle").forEach(l=>{const n=getComputedStyle(l);if(n.position!=="fixed"||n.display==="none"||n.visibility==="hidden")return;const u=l.getBoundingClientRect();u.width<1||u.height<1||u.top>=window.innerHeight||(u.bottom>=window.innerHeight-4&&u.width>window.innerWidth*.5?i=Math.max(i,window.innerHeight-u.top):u.left<=4&&u.height>window.innerHeight*.4&&(o=!0))}),g.style.setProperty("--ad-bottom",`${Math.round(i)}px`),g.classList.toggle("ad-rail",o)},h=()=>{r||(r=!0,requestAnimationFrame(t))};new MutationObserver(h).observe(document.body,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["style","data-anchor-status","data-anchor-shown","aria-hidden"]}),window.addEventListener("resize",h),window.addEventListener("scroll",h,{passive:!0})}const e=g.querySelector(".fs-copy");e?.addEventListener("click",async()=>{try{await navigator.clipboard.writeText(e.dataset.url),e.classList.add("copied"),e.setAttribute("aria-label","Link copied"),setTimeout(()=>{e.classList.remove("copied"),e.setAttribute("aria-label","Copy link")},2e3)}catch{}})}document.querySelectorAll(".share-widget-container").forEach(a=>{const e=a,r=e.dataset.url||window.location.href,t=e.dataset.title||document.title,h=e.dataset.desc||"",i=e.dataset.image||"";e.querySelectorAll(".share-btn").forEach(o=>{o.addEventListener("click",()=>{const l=o.dataset.share;let n="";l==="facebook"?n=`https://www.facebook.com/sharer/sharer.php?u=${encodeURIComponent(r)}`:l==="x"?n=`https://twitter.com/intent/tweet?url=${encodeURIComponent(r)}&text=${encodeURIComponent(t)}`:l==="whatsapp"?n=`https://api.whatsapp.com/send?text=${encodeURIComponent(`${t} — ${r}`)}`:l==="pinterest"?n=`https://www.pinterest.com/pin/create/button/?url=${encodeURIComponent(r)}&description=${encodeURIComponent(t)}${i?`&media=${encodeURIComponent(i)}`:""}`:l==="email"&&(n=`mailto:?subject=${encodeURIComponent(t)}&body=${encodeURIComponent(`${h?`${h}
`:""}${r}`)}`),n&&window.open(n,"share","width=640,height=480,noopener,noreferrer")})})});document.querySelectorAll("[data-recipe]").forEach(a=>{const e=a,r=parseFloat(e.dataset.baseServings||"4")||4;let t=1,h="us";const i=e.querySelector("[data-recipe-serv]"),o=[...e.querySelectorAll("[data-recipe-qty]")],l=new Map;o.forEach(c=>l.set(c,c.textContent?.trim()??""));const n={"¼":.25,"½":.5,"¾":.75,"⅓":1/3,"⅔":2/3,"⅛":.125,"⅜":.375,"⅝":.625,"⅞":.875},u=["cups","cup","tbsp","tsp","tablespoons","tablespoon","teaspoons","teaspoon","oz","ounce","ounces","lb","lbs","pound","pounds","g","gram","grams","kg","ml","l","liter","liters","pint","pints","quart","quarts","gallon","gallons"],m=(c,s)=>{const p=s.toLowerCase();return["cup","cups"].includes(p)?[c*236.588,"ml"]:["tbsp","tablespoon","tablespoons"].includes(p)?[c*15,"ml"]:["tsp","teaspoon","teaspoons"].includes(p)?[c*5,"ml"]:["oz","ounce","ounces"].includes(p)?[c*28.35,"g"]:["lb","lbs","pound","pounds"].includes(p)?[c*453.6,"g"]:null},w=c=>{const s=Math.round(c*100)/100;return Number.isInteger(s)?String(s):String(s).replace(/0$/,"")},v=c=>{let s=c.trim(),p=null,d=s.match(/^(\d+)\s+(\d+)\s*\/\s*(\d+)\b\s*(.*)$/)||s.match(/^(\d+)\s+([¼½¾⅓⅔⅛⅜⅝⅞])\b\s*(.*)$/);if(d?(p=d[2]in n?parseInt(d[1])+n[d[2]]:parseInt(d[1])+parseInt(d[2])/parseInt(d[3]),s=d[d.length-1]):(d=s.match(/^(\d+)\s*\/\s*(\d+)\b\s*(.*)$/))?(p=parseInt(d[1])/parseInt(d[2]),s=d[3]):(d=s.match(/^([¼½¾⅓⅔⅛⅜⅝⅞])\b\s*(.*)$/))?(p=n[d[1]],s=d[2]):(d=s.match(/^(\d+(?:\.\d+)?)\b\s*(.*)$/))&&(p=parseFloat(d[1]),s=d[2]),p===null)return null;const f=s.split(/\s+/,1)[0]?.replace(/[.,]$/,"")??"";return u.includes(f.toLowerCase())?{qty:p,unit:s.slice(0,f.length),rest:s.slice(f.length).trim()}:{qty:p,unit:"",rest:s.trim()}},E=()=>{const c=Math.max(1,Math.round(r*t));i&&(i.textContent=String(c)),o.forEach(s=>{const p=l.get(s)??"",d=v(p);if(!d)return;let f=d.qty*t,y=d.unit;if(h==="metric"&&y){const b=m(f,y);b&&(f=b[0]>=100?Math.round(b[0]/5)*5:Math.round(b[0]*10)/10,y=b[1])}s.textContent=`${w(f)}${y?" "+y:""}${d.rest?" "+d.rest:""}`}),e.querySelectorAll("[data-recipe-scale]").forEach(s=>{const p=parseFloat(s.dataset.recipeScale||"1")===t;s.setAttribute("aria-pressed",String(p)),s.classList.toggle("on",p)})};e.querySelectorAll("[data-recipe-scale]").forEach(c=>c.addEventListener("click",()=>{t=parseFloat(c.dataset.recipeScale||"1")||1,E()})),e.querySelector("[data-recipe-serv-inc]")?.addEventListener("click",()=>{t=Math.min(6,t+.5),E()}),e.querySelector("[data-recipe-serv-dec]")?.addEventListener("click",()=>{t=Math.max(.5,t-.5),E()}),e.querySelectorAll("[data-recipe-units]").forEach(c=>c.addEventListener("click",()=>{h=c.dataset.recipeUnits,e.querySelectorAll("[data-recipe-units]").forEach(s=>{const p=s===c;s.setAttribute("aria-pressed",String(p)),s.classList.toggle("on",p)}),E()})),e.querySelector("[data-recipe-copy]")?.addEventListener("click",async c=>{const s=c.currentTarget,p=o.map(d=>`• ${d.textContent?.trim()}`).join(`
`);try{await navigator.clipboard.writeText(p),s.innerHTML="Copied! ✓"}catch{s.innerHTML="Copy failed"}setTimeout(()=>{s.innerHTML='Copy list'},1800)}),e.querySelectorAll("[data-recipe-step-btn]").forEach(c=>c.addEventListener("click",()=>{c.closest(".rc-step-card")?.classList.toggle("done")}));let A=null;const S=e.querySelector("[data-recipe-cook]");S?.addEventListener("click",async()=>{if(S.getAttribute("aria-pressed")==="true"){try{await A?.release()}catch{}A=null,S.setAttribute("aria-pressed","false")}else{try{const s=await navigator.wakeLock?.request("screen");s&&(A=s)}catch{}S.setAttribute("aria-pressed","true")}});const L=e.querySelector("[data-recipe-save]"),k=e.querySelector("[data-recipe-save-label]"),q=`nutriforks-saved-${e.dataset.slug||document.location.pathname}`;try{localStorage.getItem(q)==="1"&&(L?.setAttribute("aria-pressed","true"),k&&(k.textContent="Saved"))}catch{}L?.addEventListener("click",()=>{const c=L.getAttribute("aria-pressed")==="true";try{c?localStorage.removeItem(q):localStorage.setItem(q,"1")}catch{}L.setAttribute("aria-pressed",String(!c)),k&&(k.textContent=c?"Save":"Saved")}),e.querySelector("[data-recipe-share]")?.addEventListener("click",async c=>{const s=c.currentTarget,p={title:document.title,url:location.href};try{if(navigator.share){await navigator.share(p);return}throw new Error("no-share")}catch{try{await navigator.clipboard.writeText(location.href),s.innerHTML="Link copied! ✓"}catch{s.innerHTML="Share failed"}setTimeout(()=>{s.innerHTML='Share'},1800)}})});document.querySelectorAll("[data-recipe] [data-print-recipe]").forEach(a=>a.addEventListener("click",()=>{document.body.classList.add("print-recipe");const e=()=>{document.body.classList.remove("print-recipe"),window.removeEventListener("afterprint",e)};window.addEventListener("afterprint",e),window.print(),setTimeout(e,2e3)}));document.querySelectorAll(".checklist[data-key]").forEach(a=>{const e=a.dataset.key;let r=[];try{r=JSON.parse(localStorage.getItem(e)||"[]")}catch{}a.querySelectorAll("input[type=checkbox]").forEach(t=>{t.checked=r.includes(Number(t.dataset.i)),t.addEventListener("change",()=>{const h=[...a.querySelectorAll("input:checked")].map(i=>Number(i.dataset.i));try{localStorage.setItem(e,JSON.stringify(h))}catch{}})})});document.addEventListener("click",a=>{const e=a.target.closest(".embed .load");if(!e)return;const r=e.closest(".embed"),t=document.createElement("iframe");t.src=r.dataset.src,t.title=r.dataset.title,t.loading="lazy",t.allowFullscreen=!0,r.replaceChildren(t)});document.querySelectorAll("[data-gallery]").forEach(a=>{const e=[...a.querySelectorAll(".g-item")],r=a.querySelector("dialog"),t=r.querySelector("figure img"),h=r.querySelector("figcaption");let i=0;const o=n=>{i=(n+e.length)%e.length;const u=e[i];t.src=u.dataset.full,u.dataset.fullSrcset?t.srcset=u.dataset.fullSrcset:t.removeAttribute("srcset"),t.sizes="92vw",t.alt=u.querySelector("img").alt,h.textContent=u.dataset.caption||""};e.forEach((n,u)=>n.addEventListener("click",()=>{o(u),r.showModal()})),r.querySelector(".g-close").addEventListener("click",()=>r.close()),r.querySelector(".g-prev").addEventListener("click",()=>o(i-1)),r.querySelector(".g-next").addEventListener("click",()=>o(i+1)),r.addEventListener("click",n=>{n.target===r&&r.close()}),r.addEventListener("keydown",n=>{n.key==="ArrowLeft"&&o(i-1),n.key==="ArrowRight"&&o(i+1)});let l=0;r.addEventListener("touchstart",n=>{l=n.touches[0].clientX},{passive:!0}),r.addEventListener("touchend",n=>{const u=n.changedTouches[0].clientX-l;Math.abs(u)>50&&o(i+(u<0?1:-1))})});document.addEventListener("click",a=>{const e=a.target.closest(".map .load");if(!e)return;const r=e.closest(".map"),t=document.createElement("iframe");t.src=r.dataset.map,t.title=r.dataset.title||"Map",t.loading="lazy",t.referrerPolicy="no-referrer-when-downgrade",t.allowFullscreen=!0,r.replaceChildren(t)});document.querySelectorAll("[data-tabs]").forEach((a,e)=>{const r=[...a.querySelectorAll(":scope > .tab")],t=a.querySelector(".tablist");if(!r.length)return;r.forEach((i,o)=>{const l=`tab-${e}-${o}`;i.id=`${l}-panel`,i.setAttribute("role","tabpanel"),i.setAttribute("aria-labelledby",l);const n=document.createElement("button");n.type="button",n.id=l,n.setAttribute("role","tab"),n.setAttribute("aria-controls",i.id),n.textContent=i.dataset.label||`Tab ${o+1}`,n.addEventListener("click",()=>h(o)),n.addEventListener("keydown",u=>{u.key==="ArrowRight"&&(h((o+1)%r.length),t.children[(o+1)%r.length].focus()),u.key==="ArrowLeft"&&(h((o-1+r.length)%r.length),t.children[(o-1+r.length)%r.length].focus())}),t.appendChild(n)});const h=i=>{r.forEach((o,l)=>o.hidden=l!==i),[...t.children].forEach((o,l)=>{o.setAttribute("aria-selected",String(l===i)),o.tabIndex=l===i?0:-1})};t.hidden=!1,a.classList.add("ready"),h(0)});document.addEventListener("click",a=>{const e=a.target.closest(".vid .play");if(!e)return;const r=e.closest(".vid"),t=document.createElement("iframe");t.src=r.dataset.embed,t.allow="autoplay; fullscreen; picture-in-picture",t.allowFullscreen=!0,r.replaceChildren(t)});document.addEventListener("click",a=>{const e=a.target.closest(".yt .play");if(!e)return;const r=e.closest(".yt"),t=document.createElement("iframe");t.src=r.dataset.embed,t.title=r.querySelector("img").alt,t.allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share",t.allowFullscreen=!0,r.replaceChildren(t)});document.querySelectorAll(".prose h2[id], .prose h3[id]").forEach(a=>{if(a.closest("#recipe"))return;const e=document.createElement("a");e.href=`#${a.id}`,e.className="heading-anchor",e.setAttribute("aria-label",`Link to section: ${a.textContent}`),e.textContent="#",a.appendChild(e)});const C=a=>{const e=a.replace(/,/g,"").match(/-?\d+(\.\d+)?/);return e?parseFloat(e[0]):NaN};document.querySelectorAll("[data-sortable]").forEach(a=>{const e=a.tagName==="TABLE"?a:a.querySelector("table"),r=e?.tBodies[0];!e||!r||e.querySelectorAll("thead th").forEach((t,h)=>{t.classList.add("sortable"),t.tabIndex=0,t.setAttribute("aria-sort","none");const i=()=>{const o=t.getAttribute("aria-sort")!=="ascending";e.querySelectorAll("thead th").forEach(m=>m.setAttribute("aria-sort","none")),t.setAttribute("aria-sort",o?"ascending":"descending");const l=[...r.rows],n=m=>m.cells[h]?.textContent?.trim()??"",u=l.every(m=>!isNaN(C(n(m)))||n(m)==="");l.sort((m,w)=>{const v=u?C(n(m))-C(n(w)):n(m).localeCompare(n(w));return o?v:-v}),r.append(...l)};t.addEventListener("click",i),t.addEventListener("keydown",o=>{(o.key==="Enter"||o.key===" ")&&(o.preventDefault(),i())})})});document.querySelectorAll(".prose table").forEach(a=>{if(a.parentElement?.classList.contains("table-scroll"))return;const e=document.createElement("div");e.className="table-scroll",a.replaceWith(e),e.appendChild(a)});