{"version":3,"file":"MobileScaleController.D4xx94cR.mjs","names":["useRef"],"sources":["https:/framerusercontent.com/modules/HVuOC9Pt3Wu1DY2UfgVQ/du8usy52lA1soK2uoTXt/MobileScaleController.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{useEffect,useRef}from\"react\";import{RenderTarget}from\"framer\";const DESIGN_WIDTH=450;const MIN_SCALE=.75;const MAX_SCALE=1.3;const TARGET_SELECTOR='[data-framer-name$=\"Native Layers\"]';const PHONE_QUERY=\"(max-width: 1199.98px)\";/**\n * Locks the mobile layout to a fixed 450px design and uniformly scales it\n * (via CSS zoom) to fit the real device width, instead of letting the\n * layout reflow at different phone sizes. Only active within the Phone\n * breakpoint's media query range; Desktop is left untouched.\n *\n * The controller only ever touches its own enclosing \"* — Native Layers\"\n * frame (found via closest()), never another breakpoint's frame, and it is\n * fully inert on the Framer canvas so the editor renders normally.\n *\n * @framerSupportedLayoutWidth fixed\n * @framerSupportedLayoutHeight fixed\n */export default function MobileScaleController(){const ref=useRef(null);useEffect(()=>{if(RenderTarget.current()===RenderTarget.canvas)return;const target=ref.current?.closest(TARGET_SELECTOR)??null;if(!target)return;const mq=window.matchMedia(PHONE_QUERY);function applyScale(){if(!target)return;if(!mq.matches){target.style.width=\"\";target.style.maxWidth=\"\";target.style.removeProperty(\"zoom\");return;}target.style.width=`${DESIGN_WIDTH}px`;target.style.maxWidth=`${DESIGN_WIDTH}px`;const raw=window.innerWidth/DESIGN_WIDTH;const scale=Math.min(MAX_SCALE,Math.max(MIN_SCALE,raw));target.style.setProperty(\"zoom\",String(scale));}applyScale();window.addEventListener(\"resize\",applyScale);mq.addEventListener(\"change\",applyScale);return()=>{window.removeEventListener(\"resize\",applyScale);mq.removeEventListener(\"change\",applyScale);target.style.width=\"\";target.style.maxWidth=\"\";target.style.removeProperty(\"zoom\");};},[]);return /*#__PURE__*/_jsx(\"div\",{ref:ref,style:{position:\"absolute\",width:1,height:1,pointerEvents:\"none\",opacity:0}});}\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"MobileScaleController\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutHeight\":\"fixed\",\"framerContractVersion\":\"1\",\"framerSupportedLayoutWidth\":\"fixed\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./MobileScaleController.map"],"mappings":"mLAYG,SAAwB,GAAuB,CAAC,IAAM,EAAIA,EAAO,IAAI,EAAq1B,OAAn1B,MAAc,CAAC,GAAG,EAAa,QAAQ,IAAI,EAAa,OAAO,OAAO,IAAM,EAAO,EAAI,SAAS,QAAQ,CAAe,GAAG,KAAK,GAAG,CAAC,EAAO,OAAO,IAAM,EAAG,EAAO,WAAW,CAAW,EAAE,SAAS,GAAY,CAAC,GAAG,CAAC,EAAO,OAAO,GAAG,CAAC,EAAG,QAAQ,CAAC,EAAO,MAAM,MAAM,GAAG,EAAO,MAAM,SAAS,GAAG,EAAO,MAAM,eAAe,MAAM,EAAE,MAAO,CAAC,EAAO,MAAM,MAAM,GAAG,EAAa,IAAI,EAAO,MAAM,SAAS,GAAG,EAAa,IAAI,IAAM,EAAI,EAAO,WAAW,EAAmB,EAAM,KAAK,IAAI,EAAU,KAAK,IAAI,EAAU,CAAG,CAAC,EAAE,EAAO,MAAM,YAAY,OAAO,OAAO,CAAK,CAAC,CAAE,CAAoG,OAAnG,EAAW,EAAE,EAAO,iBAAiB,SAAS,CAAU,EAAE,EAAG,iBAAiB,SAAS,CAAU,MAAY,CAAC,EAAO,oBAAoB,SAAS,CAAU,EAAE,EAAG,oBAAoB,SAAS,CAAU,EAAE,EAAO,MAAM,MAAM,GAAG,EAAO,MAAM,SAAS,GAAG,EAAO,MAAM,eAAe,MAAM,CAAE,CAAE,EAAE,CAAC,CAAC,EAAsB,EAAK,MAAM,CAAK,MAAI,MAAM,CAAC,SAAS,WAAW,MAAM,EAAE,OAAO,EAAE,cAAc,OAAO,QAAQ,CAAC,CAAC,CAAC,CAAE,+BAZz+B,IAAoC,IAAiC,EAAO,EAAa,IAAU,EAAU,IAAU,EAAU,IAAU,EAAgB,sCAA4C,EAAY"}