{"version":3,"file":"ResponsiveIframe.I74BcdLU.mjs","names":["useRef","useState"],"sources":["https:/framerusercontent.com/modules/i2lc6zciyhkaabiAkj42/NXdqS4p7T4tX9XgC55YC/ResponsiveIframe.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{useEffect,useRef,useState}from\"react\";import{addPropertyControls,ControlType}from\"framer\";export function ResponsiveIframe({src,minHeight}){const iframeRef=useRef(null);const[height,setHeight]=useState(minHeight);const[iframeSrc,setIframeSrc]=useState(src);// Read UTM values from localStorage\nconst getUTMParamsFromLocalStorage=()=>{const utmKeys=[\"utm_source\",\"utm_medium\",\"utm_campaign\",\"utm_term\",\"utm_content\"];const params=new URLSearchParams;utmKeys.forEach(key=>{const value=localStorage.getItem(key);if(value){params.append(key,value);}});return params.toString();};useEffect(()=>{const utmQuery=getUTMParamsFromLocalStorage();const fullSrc=utmQuery?src.includes(\"?\")?`${src}&${utmQuery}`:`${src}?${utmQuery}`:src;setIframeSrc(fullSrc);},[src])// run when `src` changes\n;// Listen for height message and add 100px\nuseEffect(()=>{const onMessage=event=>{if(event.data?.type===\"height\"){setHeight(event.data.payload+100);}};window.addEventListener(\"message\",onMessage);return()=>window.removeEventListener(\"message\",onMessage);},[]);return /*#__PURE__*/_jsx(\"iframe\",{ref:iframeRef,src:iframeSrc,width:\"100%\",height:height,style:{border:\"none\"},title:\"Dynamic App\"});}addPropertyControls(ResponsiveIframe,{src:{type:ControlType.String,title:\"App URL\",defaultValue:\"https://internal-get-started-form.assetfy.com.au?industry=Auto Loan\"},minHeight:{type:ControlType.Number,title:\"Min Height\",defaultValue:600}});\nexport const __FramerMetadata__ = {\"exports\":{\"ResponsiveIframe\":{\"type\":\"reactComponent\",\"name\":\"ResponsiveIframe\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./ResponsiveIframe.map"],"mappings":"sMAA4I,SAAgB,EAAiB,CAAC,MAAI,aAAW,CAAC,IAAM,EAAUA,EAAO,KAAK,CAAM,CAAC,EAAO,GAAWC,EAAS,EAAU,CAAM,CAAC,EAAU,GAAcA,EAAS,EAAI,CAC5S,MAAiC,CAAC,IAAM,EAAQ,CAAC,aAAa,aAAa,eAAe,WAAW,cAAc,CAAO,EAAO,IAAI,gBAAmH,OAAnG,EAAQ,QAAQ,GAAK,CAAC,IAAM,EAAM,aAAa,QAAQ,EAAI,CAAI,GAAO,EAAO,OAAO,EAAI,EAAM,EAAI,CAAQ,EAAO,UAAU,EAE7D,OAFgE,MAAc,CAAC,IAAM,EAAS,GAA8B,CAAwF,EAAzE,EAAS,EAAI,SAAS,IAAI,CAAC,GAAG,EAAI,GAAG,IAAW,GAAG,EAAI,GAAG,IAAW,EAAyB,EAAG,CAAC,EAAI,CAAC,CAE3c,MAAc,CAAC,IAAM,EAAU,GAAO,CAAI,EAAM,MAAM,OAAO,UAAU,EAAU,EAAM,KAAK,QAAQ,IAAI,EAAiD,OAA7C,EAAO,iBAAiB,UAAU,EAAU,KAAW,EAAO,oBAAoB,UAAU,EAAU,EAAG,EAAE,CAAC,CAAqB,EAAK,SAAS,CAAC,IAAI,EAAU,IAAI,EAAU,MAAM,OAAc,SAAO,MAAM,CAAC,OAAO,OAAO,CAAC,MAAM,cAAc,CAAC,sBAHnT,IAA6C,IAAoD,CAGoN,EAAoB,EAAiB,CAAC,IAAI,CAAC,KAAK,EAAY,OAAO,MAAM,UAAU,aAAa,sEAAsE,CAAC,UAAU,CAAC,KAAK,EAAY,OAAO,MAAM,aAAa,aAAa,IAAI,CAAC,CAAC"}