{"version":3,"file":"GLBModel.D178RuyC.mjs","names":["useRef","useState"],"sources":["https:/framerusercontent.com/modules/bm5tqj7Ytdx69rZi8zNJ/addljfHXP1MUcvX8Tw9B/GLBModel.js"],"sourcesContent":["// Interactive 3D GLB Model Viewer with mouse-controlled rotation\nimport{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useEffect,useRef,useState,startTransition}from\"react\";import{addPropertyControls,ControlType,useIsStaticRenderer}from\"framer\";/**\n * Interactive 3D GLB Model Viewer\n * \n * @framerIntrinsicWidth 600\n * @framerIntrinsicHeight 600\n * \n * @framerSupportedLayoutWidth fixed\n * @framerSupportedLayoutHeight fixed\n */export default function GLBModel(props){const{modelUrl=\"https://framerusercontent.com/assets/B4dm46p6qZdpKPvYCLV4i0Oo.glb\",enableZoom=true,enablePan=false,backgroundColor=\"#F5F5F5\",lightIntensity=1,ambientLightIntensity=.5,cameraDistance=5,rotationSensitivity=1,focalLength=45,toneMapping=\"auto\",posterUrl=\"\"}=props;const containerRef=useRef(null);const modelViewerRef=useRef(null);const[isLoading,setIsLoading]=useState(true);const[error,setError]=useState(null);const isStatic=useIsStaticRenderer();const[rotation,setRotation]=useState({x:75,y:0});useEffect(()=>{if(isStatic){startTransition(()=>setIsLoading(false));return;}// Load model-viewer web component\nif(typeof window!==\"undefined\"&&!customElements.get(\"model-viewer\")){const script=document.createElement(\"script\");script.type=\"module\";script.src=\"https://ajax.googleapis.com/ajax/libs/model-viewer/3.3.0/model-viewer.min.js\";document.head.appendChild(script);}const timer=setTimeout(()=>{startTransition(()=>setIsLoading(false));},1e3);return()=>clearTimeout(timer);},[isStatic]);const handleLoad=()=>{startTransition(()=>{setIsLoading(false);setError(null);});};const handleError=()=>{startTransition(()=>{setError(\"Failed to load 3D model\");setIsLoading(false);});};const handleMouseMove=e=>{if(!containerRef.current||isStatic)return;const rect=containerRef.current.getBoundingClientRect();const x=e.clientX-rect.left;const y=e.clientY-rect.top;// Normalize to -1 to 1 range\nconst normalizedX=x/rect.width*2-1;const normalizedY=y/rect.height*2-1;// Calculate rotation angles - invert X direction and limit to -45 to +45 degrees\nconst yRotation=-normalizedX*45*rotationSensitivity;const xRotation=75+normalizedY*-30*rotationSensitivity;startTransition(()=>{setRotation({x:xRotation,y:yRotation});});};useEffect(()=>{if(modelViewerRef.current&&!isStatic){modelViewerRef.current.cameraOrbit=`${rotation.y}deg ${rotation.x}deg ${cameraDistance}m`;modelViewerRef.current.setAttribute(\"field-of-view\",`${focalLength}deg`);}},[rotation,cameraDistance,focalLength,isStatic]);if(isStatic){return /*#__PURE__*/_jsx(\"div\",{style:{width:\"100%\",height:\"100%\",display:\"flex\",alignItems:\"center\",justifyContent:\"center\",backgroundColor,borderRadius:8},children:/*#__PURE__*/_jsxs(\"div\",{style:{textAlign:\"center\",color:\"#666\"},children:[/*#__PURE__*/_jsx(\"div\",{style:{fontSize:48,marginBottom:8},children:\"🎨\"}),/*#__PURE__*/_jsx(\"div\",{style:{fontSize:14},children:\"3D Model Viewer\"}),/*#__PURE__*/_jsx(\"div\",{style:{fontSize:12,marginTop:4,opacity:.7},children:\"Preview in browser\"})]})});}return /*#__PURE__*/_jsxs(\"div\",{ref:containerRef,style:{width:\"100%\",height:\"100%\",position:\"relative\",borderRadius:8,overflow:\"hidden\",backgroundColor},onMouseMove:handleMouseMove,children:[/*#__PURE__*/_jsx(\"model-viewer\",{ref:modelViewerRef,src:modelUrl,alt:\"3D model\",\"camera-orbit\":`${rotation.y}deg ${rotation.x}deg ${cameraDistance}m`,\"field-of-view\":`${focalLength}deg`,\"min-field-of-view\":\"10deg\",\"max-field-of-view\":\"120deg\",\"disable-zoom\":!enableZoom,\"disable-pan\":!enablePan,\"shadow-intensity\":lightIntensity,exposure:ambientLightIntensity,\"tone-mapping\":toneMapping,poster:posterUrl||undefined,style:{width:\"100%\",height:\"100%\",backgroundColor},onLoad:handleLoad,onError:handleError}),isLoading&&/*#__PURE__*/_jsx(\"div\",{style:{position:\"absolute\",top:0,left:0,width:\"100%\",height:\"100%\",display:\"flex\",alignItems:\"center\",justifyContent:\"center\",backgroundColor,zIndex:10},children:/*#__PURE__*/_jsx(\"div\",{style:{textAlign:\"center\",color:\"#666\"},children:/*#__PURE__*/_jsx(\"div\",{style:{fontSize:14},children:\"Loading 3D Model...\"})})}),error&&/*#__PURE__*/_jsx(\"div\",{style:{position:\"absolute\",top:0,left:0,width:\"100%\",height:\"100%\",display:\"flex\",alignItems:\"center\",justifyContent:\"center\",backgroundColor,zIndex:10},children:/*#__PURE__*/_jsx(\"div\",{style:{textAlign:\"center\",color:\"#ff0000\"},children:/*#__PURE__*/_jsx(\"div\",{style:{fontSize:14},children:error})})})]});}addPropertyControls(GLBModel,{modelUrl:{type:ControlType.File,title:\"GLB Model\",allowedFileTypes:[\"glb\",\"gltf\"]},posterUrl:{type:ControlType.File,title:\"Poster Image\",allowedFileTypes:[\"jpg\",\"jpeg\",\"png\",\"webp\"]},rotationSensitivity:{type:ControlType.Number,title:\"Rotation Sensitivity\",defaultValue:1,min:.1,max:3,step:.1},cameraDistance:{type:ControlType.Number,title:\"Camera Distance\",defaultValue:5,min:.5,max:50,step:.5,unit:\"m\"},focalLength:{type:ControlType.Number,title:\"Focal Length (FOV)\",defaultValue:45,min:10,max:120,step:1,unit:\"deg\"},toneMapping:{type:ControlType.Enum,title:\"Tone Mapping\",defaultValue:\"auto\",options:[\"auto\",\"commerce\",\"neutral\"],optionTitles:[\"Auto\",\"Commerce\",\"Neutral\"],displaySegmentedControl:true},enableZoom:{type:ControlType.Boolean,title:\"Enable Zoom\",defaultValue:true,enabledTitle:\"On\",disabledTitle:\"Off\"},enablePan:{type:ControlType.Boolean,title:\"Enable Pan\",defaultValue:false,enabledTitle:\"On\",disabledTitle:\"Off\"},backgroundColor:{type:ControlType.Color,title:\"Background\",defaultValue:\"#F5F5F5\"},lightIntensity:{type:ControlType.Number,title:\"Light Intensity\",defaultValue:1,min:0,max:3,step:.1},ambientLightIntensity:{type:ControlType.Number,title:\"Ambient Light\",defaultValue:.5,min:0,max:2,step:.1}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"GLBModel\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerIntrinsicWidth\":\"600\",\"framerSupportedLayoutHeight\":\"fixed\",\"framerSupportedLayoutWidth\":\"fixed\",\"framerIntrinsicHeight\":\"600\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./GLBModel.map"],"mappings":"4NASG,SAAwB,EAAS,EAAM,CAAC,GAAK,CAAC,WAAS,oEAAoE,aAAW,GAAK,YAAU,GAAM,kBAAgB,UAAU,iBAAe,EAAE,wBAAsB,GAAG,iBAAe,EAAE,sBAAoB,EAAE,cAAY,GAAG,cAAY,OAAO,YAAU,IAAI,EAAY,EAAaA,EAAO,IAAI,EAAQ,EAAeA,EAAO,IAAI,EAAO,CAAC,EAAU,GAAcC,EAAS,EAAI,EAAO,CAAC,EAAM,GAAUA,EAAS,IAAI,EAAQ,EAAS,EAAoB,EAAO,CAAC,EAAS,GAAaA,EAAS,CAAC,EAAE,GAAG,EAAE,CAAC,CAAC,EAG+Y,OAH7Y,MAAc,CAAC,GAAG,EAAS,CAAC,MAAoB,EAAa,EAAK,CAAC,EAAE,MAAO,CACrnB,GAAU,IAAS,QAAa,CAAC,eAAe,IAAI,cAAc,EAAE,CAAC,IAAM,EAAO,SAAS,cAAc,QAAQ,EAAE,EAAO,KAAK,SAAS,EAAO,IAAI,+EAA+E,SAAS,KAAK,YAAY,CAAM,CAAE,CAAC,IAAM,EAAM,eAAe,CAAC,MAAoB,EAAa,EAAK,CAAC,CAAE,EAAE,GAAG,EAAE,UAAU,aAAa,CAAK,CAAE,EAAE,CAAC,CAAQ,CAAC,EAE/M,MAAc,CAAI,EAAe,SAAS,CAAC,IAAU,EAAe,QAAQ,YAAY,GAAG,EAAS,EAAE,MAAM,EAAS,EAAE,MAAM,EAAe,GAAG,EAAe,QAAQ,aA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