{"version":3,"file":"shared-lib.CgZoIX4H.mjs","names":["useState"],"sources":["https:/framerusercontent.com/modules/U54Gmat5vNkYg74N9iuh/iWs7pfJwqfsmKFLaJWHu/SmashhouseCore.js"],"sourcesContent":["/*\n * Smashhouse — Core\n *\n * Shared code for every Smashhouse component. Not a component itself: nothing to place on the canvas.\n *\n * What lives here\n *   - The menu registry: hidden \"Smashhouse Menu Item\" components inside a Collection List register\n *     each burger from the CMS here, and display components (the 3D scene, the menu grid) read them.\n *   - Small helpers: <Css>, link resolving (Link + Path), price formatting, setStyle.\n *\n * Why a registry: Framer code components cannot query the CMS directly. A Collection List with one\n * small item component per row is the bridge; the buyer only connects fields once.\n */import{jsx as _jsx}from\"react/jsx-runtime\";import{useEffect,useState}from\"react\";const menu=new Map;let menuVersion=0;let notifyQueued=false;const listeners=new Set;function notify(){if(notifyQueued)return;notifyQueued=true;const run=()=>{notifyQueued=false;listeners.forEach(fn=>fn());};if(typeof queueMicrotask===\"function\")queueMicrotask(run);else Promise.resolve().then(run);}const same=(a,b)=>JSON.stringify(a)===JSON.stringify(b);/** Called by Smashhouse Menu Item during render. Safe to call repeatedly; only real changes notify. */export function registerMenuEntry(entry){if(!entry.key)return;const previous=menu.get(entry.key);if(previous&&same(previous,entry))return;menu.set(entry.key,entry);menuVersion++;if(typeof window!==\"undefined\")notify();}/** Called when a Menu Item unmounts (item removed from the Collection List). */export function unregisterMenuEntry(key){if(!menu.delete(key))return;menuVersion++;if(typeof window!==\"undefined\")notify();}export function getMenu(){return Array.from(menu.values());}/** Menu entries registered by the hidden Collection List, in list order. Empty when nothing is connected. */export function useMenu(){const[,setVersion]=useState(menuVersion);useEffect(()=>{const update=()=>setVersion(menuVersion);listeners.add(update);update();return()=>{listeners.delete(update);};},[]);return getMenu();}/* ------------------------------------------------------------------ *//* Helpers                                                            *//* ------------------------------------------------------------------ *//** React escapes quotes inside <style> text on the server; this keeps the CSS intact. */export function Css({css}){return /*#__PURE__*/_jsx(\"style\",{dangerouslySetInnerHTML:{__html:css}});}export function setStyle(el,key,value){if(!el)return;const style=el.style;if(style[key]!==value)style[key]=value;}/** Framer link props arrive as strings or objects; \"#\" and unresolved CMS routes count as empty. */export function toHref(value){if(!value)return\"\";let href=\"\";if(typeof value===\"string\")href=value;else if(typeof value===\"object\"){const v=value;href=typeof v.href===\"string\"?v.href:typeof v.url===\"string\"?v.url:\"\";}href=href.trim();if(!href||href===\"#\"||href.indexOf(\"/:\")>=0)return\"\";return href;}/** The picked page wins; the Path text is the fallback; then the given default. */export function pick(link,path,fallback=\"/\"){return toHref(link)||toHref(path)||fallback;}/** \"14\" + settings → \"$14\" / \"14 €\". Returns \"\" when there is no price. */export function formatPrice(value,prefix,suffix){if(value===null||value===undefined||isNaN(Number(value)))return\"\";const n=Number(value);const text=Math.abs(n%1)>.001?n.toFixed(2):String(Math.round(n));return`${prefix||\"\"}${text}${suffix||\"\"}`;}export function imageSrc(value){if(!value)return\"\";if(typeof value===\"string\")return value;if(typeof value===\"object\"&&typeof value.src===\"string\")return value.src;return\"\";}\nexport const __FramerMetadata__ = {\"exports\":{\"formatPrice\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"setStyle\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"registerMenuEntry\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"unregisterMenuEntry\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"useMenu\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"getMenu\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"Css\":{\"type\":\"reactComponent\",\"name\":\"Css\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"imageSrc\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"toHref\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"pick\":{\"type\":\"function\",\"annotations\":{\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