{"version":3,"file":"FetchPriority.Dq-FQ918.mjs","names":["_jsx","useEffect","__esmMin","init_npm_react_18_3_1","window","init_jsx_runtime","c","ce","init_ssg_sandbox_shims","withFetchPriority","Component","props","withLCPImagePriority","vh","imgs","img","rect","src","link","init_FetchPriority"],"sources":["https:/framerusercontent.com/modules/GuJcnj8rA5fDSd3Fzodg/RQ6WprQEnBn3i7XLIkG7/FetchPriority.js"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */import{jsx as _jsx}from\"react/jsx-runtime\";import{useEffect}from\"react\";// For Framer Frame/Image nodes that use a background-image prop.\nexport function withFetchPriority(Component){return props=>{return /*#__PURE__*/_jsx(Component,{...props,background:{...props.background,fetchPriority:\"high\"}});};}// Apply to any hero container that holds <img> elements (e.g. a Slideshow).\n// Mirrors the VideoFetch pattern: injects a <link rel=\"preload\" fetchpriority=\"high\">\n// for every above-fold image and removes lazy-loading from them.\nexport function withLCPImagePriority(Component){return function LCPPriorityWrapper(props){useEffect(()=>{const vh=window.innerHeight;const imgs=Array.from(document.querySelectorAll(\"img\"));for(const img of imgs){const rect=img.getBoundingClientRect();const aboveFold=rect.top<vh&&rect.bottom>0&&rect.width>100;if(!aboveFold)continue;// Boost priority on the element itself\nimg.setAttribute(\"fetchpriority\",\"high\");if(img.loading===\"lazy\")img.loading=\"eager\";// Inject a preload hint so the browser scheduler acts immediately\nconst src=img.currentSrc||img.src;if(src&&!document.querySelector(`link[rel=\"preload\"][href=\"${src}\"]`)){const link=document.createElement(\"link\");link.rel=\"preload\";link.as=\"image\";link.href=src;link.setAttribute(\"fetchpriority\",\"high\");document.head.prepend(link);}}},[]);return /*#__PURE__*/_jsx(Component,{...props});};}\nexport const __FramerMetadata__ = {\"exports\":{\"withFetchPriority\":{\"type\":\"reactHoc\",\"name\":\"withFetchPriority\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withLCPImagePriority\":{\"type\":\"reactHoc\",\"name\":\"withLCPImagePriority\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./FetchPriority.map"],"mappings":"A,gIACA,SAAgBS,EAAkBC,EAAU,CAAC,MAAOC,IAA4BX,gBAAKU,EAAU,CAAC,GAAGC,EAAM,WAAW,CAAC,GAAGA,EAAM,WAAW,cAAc,MAAM,CAAC,CAAC,CAAI,CAGnK,SAAgBC,EAAqBF,EAAU,CAAC,OAAO,SAA4BC,EAAM,CAEyL,OAFxLV,MAAc,CAAC,IAAMY,EAAGT,EAAO,YAAkBU,EAAK,MAAM,KAAK,SAAS,iBAAiB,KAAK,CAAC,EAAE,IAAI,IAAMC,KAAOD,EAAK,CAAC,IAAME,EAAKD,EAAI,sBAAsB,EAA6D,GAAG,EAA9CC,EAAK,IAAIH,GAAIG,EAAK,OAAO,GAAGA,EAAK,MAAM,KAAkB,SACpUD,EAAI,aAAa,gBAAgB,MAAM,EAAKA,EAAI,UAAU,SAAOA,EAAI,QAAQ,SAC7E,IAAME,EAAIF,EAAI,YAAYA,EAAI,IAAI,GAAGE,GAAK,CAAC,SAAS,cAAc,6BAA6BA,EAAI,GAAG,EAAE,CAAC,IAAMC,EAAK,SAAS,cAAc,MAAM,EAAEA,EAAK,IAAI,UAAUA,EAAK,GAAG,QAAQA,EAAK,KAAKD,EAAIC,EAAK,aAAa,gBAAgB,MAAM,EAAE,SAAS,KAAK,QAAQA,CAAI,CAAE,CAAC,CAAC,EAAE,CAAC,CAAC,EAAsBlB,gBAAKU,EAAU,CAAC,GAAGC,CAAK,CAAC,CAAE,CAAE,C"}