{"version":3,"file":"HighFetchPriority.AItxV3Ac.mjs","names":["useRef","useCallback"],"sources":["https:/framerusercontent.com/modules/yqdpXdgI62ZAYrM79Lrw/7dkfV5CsQqtqAbNJmGp3/HighFetchPriority.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{forwardRef,useCallback,useEffect,useRef}from\"react\";export function withHighFetchPriority(Component){return /*#__PURE__*/forwardRef(function WithHighFetchPriority(props,ref){const rootRef=useRef(null);const setRef=useCallback(node=>{rootRef.current=node;if(typeof ref===\"function\"){ref(node);}else if(ref){ref.current=node;}},[ref]);const applyImagePriority=useCallback(()=>{const rootNode=rootRef.current;if(!rootNode)return false;const images=Array.from(rootNode.querySelectorAll(\"img\"));if(images.length===0)return false;images.forEach(img=>{if(img.getAttribute(\"fetchpriority\")===\"high\")return;if(\"fetchPriority\"in img){img.fetchPriority=\"high\";}img.setAttribute(\"fetchpriority\",\"high\");img.loading=\"eager\";img.setAttribute(\"loading\",\"eager\");});return true;},[]);useEffect(()=>{if(typeof window===\"undefined\")return;let observer=null;let retryCount=0;const maxRetries=12;applyImagePriority();const retryTimer=window.setInterval(()=>{retryCount+=1;const found=applyImagePriority();if(found||retryCount>=maxRetries){window.clearInterval(retryTimer);}},150);if(rootRef.current&&typeof MutationObserver!==\"undefined\"){observer=new MutationObserver(()=>{applyImagePriority();});observer.observe(rootRef.current,{childList:true,subtree:true});}return()=>{window.clearInterval(retryTimer);if(observer)observer.disconnect();};},[applyImagePriority]);return /*#__PURE__*/_jsx(Component,{...props,ref:setRef});});}\nexport const __FramerMetadata__ = {\"exports\":{\"withHighFetchPriority\":{\"type\":\"reactHoc\",\"name\":\"withHighFetchPriority\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./HighFetchPriority.map"],"mappings":"qJAAsG,SAAgB,EAAsB,EAAU,CAAC,OAAoB,EAAW,SAA+B,EAAM,EAAI,CAAC,IAAM,EAAQA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