{"version":3,"file":"popup.B7S52r-R.mjs","names":["useState"],"sources":["https:/framerusercontent.com/modules/H0HyffNYSY3ow397qxcn/F0nL4iO6xFIufEP7LUjG/popup.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{useState,useEffect}from\"react\";export function withCustomClosePopup(Component){return props=>{const[visible,setVisible]=useState(false);const[shouldRender,setShouldRender]=useState(true)// 改為 true，每次都顯示\n;useEffect(()=>{// 頁面載入後開始淡入動畫\nconst showTimer=setTimeout(()=>{setVisible(true);},100);// 10秒後自動關閉\nconst autoCloseTimer=setTimeout(()=>{handleClose();},9e4)// 修正為 10000 毫秒 (10秒)\n;return()=>{clearTimeout(showTimer);clearTimeout(autoCloseTimer);};},[]);const handleClose=()=>{setVisible(false);// 等待淡出動畫完成後完全移除元件\nsetTimeout(()=>{setShouldRender(false);},300);};const handleTap=()=>{handleClose();};if(!shouldRender){return null;}return /*#__PURE__*/_jsx(Component,{...props,onTap:handleTap,onClick:handleTap,initial:{opacity:1},animate:{opacity:visible?1:0},transition:{duration:.3,ease:\"easeInOut\"}});};}\nexport const __FramerMetadata__ = {\"exports\":{\"withCustomClosePopup\":{\"type\":\"reactHoc\",\"name\":\"withCustomClosePopup\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./popup.map"],"mappings":"yHAAiF,SAAgB,EAAqB,EAAU,CAAC,MAAO,IAAO,CAAC,GAAK,CAAC,EAAQ,GAAYA,EAAS,GAAM,CAAM,CAAC,EAAa,GAAiBA,EAAS,GAAK,CAC3O,MAAc,CACf,IAAM,EAAU,eAAe,CAAC,EAAW,GAAK,EAAG,IAAI,CACjD,EAAe,eAAe,CAAC,GAAa,EAAG,IAAI,CACxD,UAAU,CAAC,aAAa,EAAU,CAAC,aAAa,EAAe,GAAK,EAAE,CAAC,CAAC,IAAM,MAAgB,CAAC,EAAW,GAAM,CACjH,eAAe,CAAC,EAAgB,GAAM,EAAG,IAAI,EAAS,MAAc,CAAC,GAAa,EAAkC,OAA3B,EAA+C,EAAK,EAAU,CAAC,GAAG,EAAM,MAAM,EAAU,QAAQ,EAAU,QAAQ,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,QAAQ,EAAQ,EAAE,EAAE,CAAC,WAAW,CAAC,SAAS,GAAG,KAAK,YAAY,CAAC,CAAC,CAAlL,uBALnE,IAAsC"}