{"version":3,"file":"QuoteTool.C0aY1CG0.mjs","names":["useRef","useState","useEffect","_jsx","__esmMin","init_ssg_sandbox_shims","_e","c","init_jsx_runtime","ce","init_npm_react_18_3_1","de","window","addPropertyControls","init_framer_BWzg2IRg","ControlType","QuoteTool","props","url","startHeight","frame","height","setHeight","origin","onMessage","event","next","init_QuoteTool"],"sources":["https:/framerusercontent.com/modules/QymDakjkxHshaEvA6EY6/1mcflIFyEoEOlIdNKauf/QuoteTool.js"],"sourcesContent":["// Framer code component for www.tunl.to. Paste this into a new code file in\n// the Framer project (Assets > Code > Create Code File). It is not part of the\n// Next.js app; it is kept here so there is one copy on record.\n//\n// It shows the quote tool in a frame and makes the frame exactly as tall as the\n// tool, so the page grows when someone adds parcels or gets rates and never\n// scrolls inside itself.\nimport{jsx as _jsx}from\"react/jsx-runtime\";import{useEffect,useRef,useState}from\"react\";import{addPropertyControls,ControlType}from\"framer\";/**\n * TUNL instant rates calculator.\n *\n * @framerSupportedLayoutWidth fixed\n * @framerSupportedLayoutHeight auto\n */export default function QuoteTool(props){const{url,startHeight}=props;const frame=useRef(null);const[height,setHeight]=useState(startHeight);useEffect(()=>{let origin=\"\";try{origin=new URL(url).origin;}catch{return;}// The tool posts its height whenever it changes. Only listen to\n// messages from the tool itself.\nfunction onMessage(event){if(event.origin!==origin)return;if(event.source!==frame.current?.contentWindow)return;if(event.data?.type!==\"tunl-quote:height\")return;const next=Math.ceil(Number(event.data.height));if(next>0)setHeight(next);}window.addEventListener(\"message\",onMessage);return()=>window.removeEventListener(\"message\",onMessage);},[url]);return /*#__PURE__*/_jsx(\"iframe\",{ref:frame,src:url,title:\"TUNL instant rates calculator\",style:{display:\"block\",width:\"100%\",height:height,border:0,background:\"transparent\"}});}QuoteTool.defaultProps={url:\"https://tunl-quote.vercel.app/\",startHeight:800};addPropertyControls(QuoteTool,{url:{type:ControlType.String,title:\"URL\",defaultValue:\"https://tunl-quote.vercel.app/\"},startHeight:{type:ControlType.Number,title:\"Start height\",defaultValue:800,min:300,max:3e3,step:10}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"QuoteTool\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutWidth\":\"fixed\",\"framerContractVersion\":\"1\",\"framerSupportedLayoutHeight\":\"auto\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./QuoteTool.map"],"mappings":"A,sMAYG,SAAwBgB,EAAUC,EAAM,CAAC,GAAK,CAACC,MAAIC,eAAaF,EAAYG,EAAMpB,EAAO,IAAI,EAAO,CAACqB,EAAOC,GAAWrB,EAASkB,CAAW,EAE8M,OAF5MjB,MAAc,CAAC,IAAIqB,EAAO,GAAG,GAAG,CAACA,EAAO,IAAI,IAAIL,CAAG,CAAC,CAAC,MAAO,MAAM,CAAC,MAAO,CAE1N,SAASM,EAAUC,EAAM,CAAuF,GAAnFA,EAAM,SAASF,GAAiBE,EAAM,SAASL,EAAM,SAAS,eAAwBK,EAAM,MAAM,OAAO,oBAAoB,OAAO,IAAMC,EAAK,KAAK,KAAK,OAAOD,EAAM,KAAK,MAAM,CAAC,EAAKC,EAAK,GAAEJ,EAAUI,CAAI,CAAE,CAA8C,OAA7Cd,EAAO,iBAAiB,UAAUY,CAAS,MAAYZ,EAAO,oBAAoB,UAAUY,CAAS,CAAE,EAAE,CAACN,CAAG,CAAC,EAAsBf,gBAAK,SAAS,CAAC,IAAIiB,EAAM,IAAIF,EAAI,MAAM,gCAAgC,MAAM,CAAC,QAAQ,QAAQ,MAAM,OAAcG,SAAO,OAAO,EAAE,WAAW,aAAa,CAAC,CAAC,CAAE,C,8CAACL,EAAU,aAAa,CAAC,IAAI,iCAAiC,YAAY,GAAG,EAAEH,EAAoBG,EAAU,CAAC,IAAI,CAAC,KAAKD,EAAY,OAAO,MAAM,MAAM,aAAa,gCAAgC,EAAE,YAAY,CAAC,KAAKA,EAAY,OAAO,MAAM,eAAe,aAAa,IAAI,IAAI,IAAI,IAAI,IAAI,KAAK,EAAE,CAAC,CAAC,C"}