{"version":3,"file":"CabinFirstScreen.B4p8fd5_.mjs","names":["React.useRef","React.useState","__esmMin","init_npm_react_18_3_1","init_ssg_sandbox_shims","window","le","_e","J","init_jsx_runtime","de","withFirstScreen","firstScreen","Component","withFirstScreenGrow","ref","h","setH","phone","setPhone","el","touch","fullH","v","p","vh","w","fit","top","t","setRef","node","outer","props","grow","init_CabinFirstScreen"],"sources":["https:/framerusercontent.com/modules/plySLulRQfGlROWTfTtA/5a2N4RHcd8U3FqfPjw3t/CabinFirstScreen.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import*as React from\"react\";// First frame: a hero that opens the page fills the visible screen below the nav, with no empty band and nothing\n// below the fold. Children set to fill (the scene) take the spare height. On touch screens the height is taken once\n// at load, with the browser bars showing, and only measured again when the width changes.\nexport function withFirstScreen(Component){return firstScreen(Component,false);}// Phone heroes with a square scene: at least the visible screen, taller when the square scene and the text need it.\nexport function withFirstScreenGrow(Component){return firstScreen(Component,true);}function firstScreen(Component,grow){return /*#__PURE__*/React.forwardRef(function FirstScreen(props,outer){const ref=React.useRef(null);const[h,setH]=React.useState(null);const[phone,setPhone]=React.useState(false);React.useLayoutEffect(()=>{const el=ref.current;if(!el||typeof window===\"undefined\")return;const touch=!!(window.matchMedia&&window.matchMedia(\"(hover: none)\").matches);// Full screen height on phones, including the strip under translucent browser bars, so the next section never peeks out.\nconst fullH=()=>{let v=window.innerHeight;try{const p=document.createElement(\"div\");p.style.cssText=\"position:fixed;top:0;left:0;width:0;height:100lvh;visibility:hidden;pointer-events:none\";document.body.appendChild(p);v=Math.max(v,p.offsetHeight);p.remove();}catch(e){}return v;};let vh=touch?fullH():window.innerHeight,w=window.innerWidth;const fit=()=>{if(!touch||Math.abs(window.innerWidth-w)>40){vh=touch?fullH():window.innerHeight;w=window.innerWidth;}const top=el.getBoundingClientRect().top+window.scrollY;setPhone(window.innerWidth<810);setH(top<vh*.5?Math.max(360,Math.round(vh-top)):null);};fit();const t=setTimeout(fit,300);window.addEventListener(\"resize\",fit);return()=>{clearTimeout(t);window.removeEventListener(\"resize\",fit);};},[]);const setRef=node=>{ref.current=node;if(typeof outer===\"function\")outer(node);else if(outer)outer.current=node;};return /*#__PURE__*/_jsx(Component,{...props,ref:setRef,style:{...props.style,...h?grow&&phone?{height:\"auto\",minHeight:h}:{height:h,minHeight:h}:{}}});});}\nexport const __FramerMetadata__ = {\"exports\":{\"withFirstScreen\":{\"type\":\"reactHoc\",\"name\":\"withFirstScreen\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withFirstScreenGrow\":{\"type\":\"reactHoc\",\"name\":\"withFirstScreenGrow\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./CabinFirstScreen.map"],"mappings":"A,gJAGA,SAAgBW,EAAgB,EAAU,CAAC,OAAOC,EAAYC,EAAU,EAAK,CAAE,CAC/E,SAAgBC,EAAoB,EAAU,CAAC,OAAOF,EAAYC,EAAU,EAAI,CAAE,CAAC,SAASD,EAAY,EAAU,EAAK,CAAC,MAAoB,gBAAiB,SAAqB,EAAM,EAAM,CAAC,IAAMG,EAAIf,EAAa,IAAI,EAAO,CAACgB,EAAEC,GAAMhB,EAAe,IAAI,EAAO,CAACiB,EAAMC,GAAUlB,EAAe,EAAK,EAAEK,MAA0B,CAAC,IAAMc,EAAGL,EAAI,QAAQ,GAAG,CAACK,GAAWf,IAAS,OAAY,OAAO,IAAMgB,EAAM,CAAC,EAAEhB,EAAO,YAAYA,EAAO,WAAW,eAAe,CAAC,CAAC,SACrciB,MAAU,CAAC,IAAIC,EAAElB,EAAO,YAAY,GAAG,CAAC,IAAMmB,EAAE,SAAS,cAAc,KAAK,EAAE,EAAE,MAAM,QAAQ,0FAA0F,SAAS,KAAK,YAAYA,CAAC,EAAE,EAAE,KAAK,IAAID,EAAEC,EAAE,YAAY,EAAEA,EAAE,OAAO,CAAE,MAAS,CAAC,CAAC,OAAOD,CAAE,EAAME,EAAG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