{"version":3,"file":"Embedheight.DYPFT5rb.mjs","names":[],"sources":["https:/framerusercontent.com/modules/90tNLzLRHDsc71t1hZR2/8tEMWff1bBCZRDrwAuL6/Embedheight.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{forwardRef,useEffect}from\"react\";export function AutoHeight(Component){return /*#__PURE__*/forwardRef((props,ref)=>{useEffect(()=>{// 检查是否在浏览器环境\nif(typeof window===\"undefined\"||typeof document===\"undefined\"){return;}function sendHeight(){const height=document.body.scrollHeight;window.parent.postMessage({iframeHeight:height},\"*\");}// 组件挂载后发送一次高度\nsendHeight();// 添加事件监听器\nwindow.addEventListener(\"resize\",sendHeight);// 使用 MutationObserver 监听 DOM 变化\nconst observer=new MutationObserver(()=>{sendHeight();});observer.observe(document.body,{childList:true,subtree:true,attributes:true,characterData:true});// 清理函数\nreturn()=>{window.removeEventListener(\"resize\",sendHeight);observer.disconnect();};},[]);return /*#__PURE__*/_jsx(Component,{ref:ref,...props});});}\nexport const __FramerMetadata__ = {\"exports\":{\"AutoHeight\":{\"type\":\"reactHoc\",\"name\":\"AutoHeight\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Embedheight.map"],"mappings":"uIAAmF,SAAgB,EAAW,EAAU,CAAC,OAAoB,GAAY,EAAM,KAAO,MAAc,CACpL,GAAU,IAAS,QAAa,OAAO,SAAW,IAAa,OAAQ,SAAS,GAAY,CAAC,IAAM,EAAO,SAAS,KAAK,aAAa,EAAO,OAAO,YAAY,CAAC,aAAa,EAAO,CAAC,IAAI,CACzL,GAAY,CACZ,EAAO,iBAAiB,SAAS,EAAW,CAC5C,IAAM,EAAS,IAAI,qBAAqB,CAAC,GAAY,EAAG,CACxD,OADyD,EAAS,QAAQ,SAAS,KAAK,CAAC,UAAU,GAAK,QAAQ,GAAK,WAAW,GAAK,cAAc,GAAK,CAAC,KAC/I,CAAC,EAAO,oBAAoB,SAAS,EAAW,CAAC,EAAS,YAAY,GAAK,EAAE,CAAC,CAAqB,EAAK,EAAU,CAAK,MAAI,GAAG,EAAM,CAAC,EAAG,sBALvG,IAAwC"}