{"version":3,"file":"HTMLFileEmbed.DZnoU9wY.mjs","names":["useRef","useState","__esmMin","init_ssg_sandbox_shims","init_npm_react_18_3_1","te","window","ce","_e","de","init_framer_DKtAEkcX","addPropertyControls","useIsStaticRenderer","ControlType","withPadding","pad","bleed","html","scale","zoom","pct","v","side","css","ratio","inject","doc","m","re","match","template","patched","a","c","HTMLFileEmbed","DEFAULT_URL","props","isStatic","live","showOnCanvas","rootRef","near","setNear","setHtml","source","file","url","el","io","entries","cancelled","res","text","ratioHeight","ratioWidth","padding","frameW","frameH","hasFixedHeight","style","clip","offsetY","offsetX","interactive","init_HTMLFileEmbed","init_jsx_runtime"],"sources":["https:/framerusercontent.com/modules/aa4XK4PfFAfdrfVMXL4L/8dCc8v0AzzejlE5O4OnK/HTMLFileEmbed.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{useEffect,useRef,useState,startTransition}from\"react\";import{addPropertyControls,ControlType,useIsStaticRenderer}from\"framer\";const DEFAULT_URL=\"https://framerusercontent.com/assets/sdDQEeokt6zUuR2FnGjqf7txCU.html\";// Pads the page inside the iframe. Values are fractions of the box width:\n// `bleed` = how far the iframe overhangs the box on every side (content stays box-sized),\n// `pad` = how much the content shrinks inside the box (vertical room split 30% top, 70% bottom).\n// `zoom` = the animation's size relative to the box width, centred in the box.\nfunction withPadding(html,pad,bleed,ratio,zoom){if(pad<=0&&bleed<=0)return html;const scale=zoom+2*bleed;const pct=v=>(v/scale*100).toFixed(4)+\"%\";const side=pct(bleed+pad*zoom);const top=pct(bleed+.6*pad*ratio*zoom);const bottom=pct(bleed+1.4*pad*ratio*zoom);const css=\"<style>html,body{height:100%;overflow:hidden!important}\"+`body{box-sizing:border-box!important;padding:${top} ${side} ${bottom} ${side}!important}`+\"[style*=aspect-ratio],body>#wrap{overflow:visible!important}</style>\";const inject=doc=>doc.replace(/<head[^>]*>/i,m=>m+css);const re=/(<script type=\"__bundler\\/template\">)([\\s\\S]*?)(<\\/script>)/;const match=html.match(re);if(match){try{const template=JSON.parse(match[2]);const patched=JSON.stringify(inject(template)).replace(/<\\//g,\"<\\\\u002F\");return html.replace(re,(_m,a,_b,c)=>a+patched+c);}catch(e){return html;}}return inject(html);}/**\n * HTML File Embed\n *\n * Fetches a public .html file (for example a Claude Design export uploaded to Framer)\n * and renders it in an iframe at a fixed aspect ratio. Loads when the embed nears the viewport.\n *\n * @framerIntrinsicWidth 760\n * @framerIntrinsicHeight 420\n *\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight any\n */export default function HTMLFileEmbed(props){const{url=DEFAULT_URL,file,ratioWidth=760,ratioHeight=420,background=\"rgba(0, 0, 0, 0)\",interactive=false,showOnCanvas=true,padding=0,bleed=0,zoom=100,offsetY=0,offsetX=0,clip=false,title=\"Product animation\",style}=props;const isStatic=useIsStaticRenderer();const live=!isStatic||showOnCanvas;const rootRef=useRef(null);const[near,setNear]=useState(false);const[html,setHtml]=useState(null);const source=(file&&file.length>0?file:url)||\"\";useEffect(()=>{if(!live||typeof window===\"undefined\")return;const el=rootRef.current;if(isStatic||!el||typeof IntersectionObserver===\"undefined\"){startTransition(()=>setNear(true));return;}const io=new IntersectionObserver(entries=>{if(entries.some(e=>e.isIntersecting)){startTransition(()=>setNear(true));io.disconnect();}},{rootMargin:\"600px 0px\"});io.observe(el);return()=>io.disconnect();},[isStatic,live]);useEffect(()=>{if(!near||!source)return;let cancelled=false;fetch(source).then(res=>res.ok?res.text():Promise.reject(res.status)).then(text=>{if(!cancelled)startTransition(()=>setHtml(text));}).catch(()=>{if(!cancelled)startTransition(()=>setHtml(null));});return()=>{cancelled=true;};},[near,source]);const ratio=ratioHeight/ratioWidth;const doc=html?withPadding(html,padding/100,bleed/100,ratio,zoom/100):null;const frameW=zoom+2*bleed;const frameH=zoom*ratio+2*bleed;const hasFixedHeight=!!style&&style.height!==undefined&&style.height!==\"auto\";return /*#__PURE__*/_jsx(\"div\",{ref:rootRef,style:{...style,position:\"relative\",width:style?.width??\"100%\",aspectRatio:hasFixedHeight?undefined:`${ratioWidth} / ${ratioHeight}`,overflow:clip?\"hidden\":bleed>0||zoom>100?\"visible\":\"hidden\",...{containerType:\"inline-size\"},background},children:doc&&live?/*#__PURE__*/_jsx(\"iframe\",{title:title,srcDoc:doc,style:{position:\"absolute\",top:clip?`calc(${offsetY} * 1cqw)`:`calc(50% - ${frameH/2-offsetY} * 1cqw)`,left:`calc(50% - ${frameW/2-offsetX} * 1cqw)`,width:`calc(${frameW} * 1cqw)`,height:`calc(${frameH} * 1cqw)`,border:0,display:\"block\",background:\"transparent\",pointerEvents:interactive?\"auto\":\"none\"},tabIndex:interactive?0:-1,\"aria-hidden\":interactive?undefined:true}):null});}addPropertyControls(HTMLFileEmbed,{url:{type:ControlType.String,title:\"URL\",defaultValue:DEFAULT_URL,placeholder:\"https://…/file.html\"},file:{type:ControlType.File,title:\"Or upload\",allowedFileTypes:[\"html\",\"htm\"]},ratioWidth:{type:ControlType.Number,title:\"Ratio W\",defaultValue:760,min:1,max:4e3,step:1,displayStepper:true},ratioHeight:{type:ControlType.Number,title:\"Ratio H\",defaultValue:420,min:1,max:4e3,step:1,displayStepper:true},background:{type:ControlType.Color,title:\"Background\",defaultValue:\"rgba(0, 0, 0, 0)\"},interactive:{type:ControlType.Boolean,title:\"Interactive\",defaultValue:false},showOnCanvas:{type:ControlType.Boolean,title:\"Show on canvas\",defaultValue:true},padding:{type:ControlType.Number,title:\"Padding\",description:\"Shrinks the animation so its shadows have room. % of width.\",defaultValue:0,min:0,max:20,step:.5,unit:\"%\"},bleed:{type:ControlType.Number,title:\"Bleed\",description:\"Room for shadows outside the box, % of width. Keeps the animation full size.\",defaultValue:0,min:0,max:25,step:.5,unit:\"%\"},zoom:{type:ControlType.Number,title:\"Zoom\",description:\"Animation size relative to the box width, centred. Use it to trim empty margins in the file.\",defaultValue:100,min:50,max:200,step:.5,unit:\"%\"},offsetY:{type:ControlType.Number,title:\"Offset Y\",description:\"Nudges the animation down (+) or up (−), % of the box width.\",defaultValue:0,min:-40,max:40,step:.5,unit:\"%\"},offsetX:{type:ControlType.Number,title:\"Offset X\",description:\"Moves the animation right (+) or left (−), % of the box width. With Zoom, shows one part of a wide file.\",defaultValue:0,min:-100,max:100,step:.5,unit:\"%\"},clip:{type:ControlType.Boolean,title:\"Clip\",description:\"Crop to the box. The animation is pinned to the top; Offset X and Y move it.\",defaultValue:false},title:{type:ControlType.String,title:\"Title\",defaultValue:\"Product animation\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"HTMLFileEmbed\",\"slots\":[],\"annotations\":{\"framerIntrinsicHeight\":\"420\",\"framerContractVersion\":\"1\",\"framerSupportedLayoutWidth\":\"any-prefer-fixed\",\"framerIntrinsicWidth\":\"760\",\"framerSupportedLayoutHeight\":\"any\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./HTMLFileEmbed.map"],"mappings":"A,2MAIA,SAASc,EAAY,EAAK,EAAI,EAAM,EAAM,EAAK,CAAC,GAAGC,GAAK,GAAGC,GAAO,EAAE,OAAOC,EAAK,IAAMC,EAAMC,EAAK,EAAEH,EAAYI,EAAI,IAAIC,EAAEH,EAAM,IAAA,CAAK,QAAQ,CAAC,EAAE,IAAUI,EAAKF,EAAIJ,EAAMD,EAAII,CAAI,EAA0FI,EAAI,uGAAlFH,EAAIJ,EAAM,GAAGD,EAAIS,EAAML,CAAuK,EAAE,GAAGG,EAAK,GAA9JF,EAAIJ,EAAM,IAAID,EAAIS,EAAML,CAA8I,EAAE,GAAGG,EAAK,iFAA0FG,EAAO,GAAKC,EAAI,QAAQ,eAAe,GAAGC,EAAEJ,CAAG,EAAQK,EAAG,8DAAoEC,EAAMZ,EAAK,MAAMW,CAAE,EAAE,GAAGC,EAAO,GAAG,CAAC,IAAMC,EAAS,KAAK,MAAMD,EAAM,EAAE,EAAQE,EAAQ,KAAK,UAAUN,EAAOK,CAAQ,CAAC,CAAC,CAAC,QAA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