{"version":3,"file":"LiveEmbed.BtYsw8cD.mjs","names":["React.useRef","React.useState"],"sources":["https:/framerusercontent.com/modules/TSSy4tWYZjSZXAVigjVj/Jk6VMsuHCU0sgfrLU9Ml/LiveEmbed.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import*as React from\"react\";import{addPropertyControls,ControlType}from\"framer\";/**\n * IUTA Live Embed\n *\n * Zeigt eine Live-Seite des IUTA-Backends per iframe und passt die Höhe\n * automatisch an: die Embed-Seite meldet ihre Höhe per postMessage\n * (auch bei Filter, Suche, Resize).\n *\n * @framerSupportedLayoutWidth any\n * @framerSupportedLayoutHeight auto\n * @framerIntrinsicWidth 1200\n * @framerIntrinsicHeight 800\n */export default function LiveEmbed(props){const{url,fallbackHeight}=props;const ref=React.useRef(null);const[height,setHeight]=React.useState(fallbackHeight);React.useEffect(()=>{const onMessage=e=>{const d=e.data;if(!d||d.type!==\"iuta-embed-height\"||typeof d.height!==\"number\")return;if(!ref.current||e.source!==ref.current.contentWindow)return;setHeight(Math.ceil(d.height));};window.addEventListener(\"message\",onMessage);return()=>window.removeEventListener(\"message\",onMessage);},[]);return /*#__PURE__*/_jsx(\"iframe\",{ref:ref,src:url,title:\"IUTA live data\",loading:\"lazy\",style:{width:\"100%\",height,border:0,display:\"block\",background:\"transparent\"}});}LiveEmbed.defaultProps={url:\"https://iuta-backend-alpha.vercel.app/embed/records/worldrecords\",fallbackHeight:800};addPropertyControls(LiveEmbed,{url:{type:ControlType.String,title:\"URL\"},fallbackHeight:{type:ControlType.Number,title:\"Start height\",defaultValue:800,min:100,max:6e3,unit:\"px\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"LiveEmbed\",\"slots\":[],\"annotations\":{\"framerIntrinsicHeight\":\"800\",\"framerContractVersion\":\"1\",\"framerSupportedLayoutHeight\":\"auto\",\"framerSupportedLayoutWidth\":\"any\",\"framerIntrinsicWidth\":\"1200\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./LiveEmbed.map"],"mappings":"sMAWG,SAAwB,EAAU,EAAM,CAAC,GAAK,CAAC,MAAI,kBAAgB,EAAY,EAAIA,EAAa,IAAI,EAAO,CAAC,EAAO,GAAWC,EAAe,CAAc,EAA4U,OAA1U,MAAoB,CAAC,IAAM,EAAU,GAAG,CAAC,IAAM,EAAE,EAAE,KAAQ,CAAC,GAAG,EAAE,OAAO,qBAAqB,OAAO,EAAE,QAAS,UAAmB,CAAC,EAAI,SAAS,EAAE,SAAS,EAAI,QAAQ,eAAqB,EAAU,KAAK,KAAK,EAAE,MAAM,CAAC,CAAE,EAA+C,OAA7C,EAAO,iBAAiB,UAAU,CAAS,MAAY,EAAO,oBAAoB,UAAU,CAAS,CAAE,EAAE,CAAC,CAAC,EAAsB,EAAK,SAAS,CAAK,MAAI,IAAI,EAAI,MAAM,iBAAiB,QAAQ,OAAO,MAAM,CAAC,MAAM,OAAO,SAAO,OAAO,EAAE,QAAQ,QAAQ,WAAW,aAAa,CAAC,CAAC,CAAE,qBAXzmB,IAA4B,IAAoD,EAW0hB,EAAU,aAAa,CAAC,IAAI,mEAAmE,eAAe,GAAG,EAAE,EAAoB,EAAU,CAAC,IAAI,CAAC,KAAK,EAAY,OAAO,MAAM,KAAK,EAAE,eAAe,CAAC,KAAK,EAAY,OAAO,MAAM,eAAe,aAAa,IAAI,IAAI,IAAI,IAAI,IAAI,KAAK,IAAI,CAAC,CAAC"}