{"version":3,"file":"ModelViewer.B2LvGsCU.mjs","names":[],"sources":["https:/framerusercontent.com/modules/zdJMiypz4Ak5cENZCXWC/T2R5tVx0SNanTBcUQjA7/ModelViewer.js"],"sourcesContent":["// 3D Object Viewer component using model-viewer web component for displaying and exploring 3D objects\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 * 3D Object Viewer\n * \n * Interactive 3D model viewer with camera controls, auto-rotation, and lighting options.\n * Supports GLB, GLTF, and other 3D formats via model-viewer web component.\n *\n * @framerIntrinsicWidth 400\n * @framerIntrinsicHeight 400\n *\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight any-prefer-fixed\n */export default function ModelViewer(props){const{modelSrc=\"https://modelviewer.dev/shared-assets/models/Astronaut.glb\",poster={src:\"https://framerusercontent.com/images/GfGkADagM4KEibNcIiRUWlfrR0.jpg\",alt:\"3D Model Preview\"},backgroundColor=\"#FFFFFF\",autoRotate=true,cameraControls=true,environmentImage=\"https://modelviewer.dev/shared-assets/environments/moon_1k.hdr\",exposure=1,shadowIntensity=1,shadowSoftness=1,autoPlay=true,loading=\"auto\",reveal=\"auto\"}=props;const modelViewerRef=useRef(null);const[isLoaded,setIsLoaded]=useState(false);const[error,setError]=useState(null);const isStatic=useIsStaticRenderer();useEffect(()=>{if(typeof window===\"undefined\"||isStatic)return;// Load model-viewer script if not already loaded\nif(!customElements.get(\"model-viewer\")){const script=document.createElement(\"script\");script.type=\"module\";script.src=\"https://unpkg.com/@google/model-viewer/dist/model-viewer.min.js\";document.head.appendChild(script);}return()=>{// Cleanup if needed\n};},[isStatic]);useEffect(()=>{if(!modelViewerRef.current||isStatic)return;const modelViewer=modelViewerRef.current;const handleLoad=()=>{startTransition(()=>{setIsLoaded(true);setError(null);});};const handleError=event=>{startTransition(()=>{setError(\"Failed to load 3D model\");setIsLoaded(false);});};modelViewer.addEventListener(\"load\",handleLoad);modelViewer.addEventListener(\"error\",handleError);return()=>{modelViewer.removeEventListener(\"load\",handleLoad);modelViewer.removeEventListener(\"error\",handleError);};},[modelSrc,isStatic]);if(isStatic){return /*#__PURE__*/_jsx(\"div\",{style:{width:\"100%\",height:\"100%\",backgroundColor,display:\"flex\",alignItems:\"center\",justifyContent:\"center\",backgroundImage:`url(${poster.src})`,backgroundSize:\"cover\",backgroundPosition:\"center\",position:\"relative\",borderRadius:8,overflow:\"hidden\"},children:/*#__PURE__*/_jsx(\"div\",{style:{position:\"absolute\",top:0,left:0,right:0,bottom:0,backgroundColor:\"rgba(0, 0, 0, 0.3)\",display:\"flex\",alignItems:\"center\",justifyContent:\"center\"},children:/*#__PURE__*/_jsxs(\"div\",{style:{color:\"#FFFFFF\",fontSize:\"16px\",fontWeight:\"600\",textAlign:\"center\",padding:\"16px\"},children:[\"3D Model Viewer\",/*#__PURE__*/_jsx(\"br\",{}),/*#__PURE__*/_jsx(\"span\",{style:{fontSize:\"12px\",opacity:.8},children:\"Interactive in preview\"})]})})});}return /*#__PURE__*/_jsxs(\"div\",{style:{width:\"100%\",height:\"100%\",position:\"relative\",borderRadius:8,overflow:\"hidden\",backgroundColor},children:[/*#__PURE__*/_jsx(\"model-viewer\",{ref:modelViewerRef,src:modelSrc,poster:poster.src,alt:poster.alt,\"auto-rotate\":autoRotate,\"camera-controls\":cameraControls,\"environment-image\":environmentImage,exposure:exposure,\"shadow-intensity\":shadowIntensity,\"shadow-softness\":shadowSoftness,autoplay:autoPlay,loading:loading,reveal:reveal,style:{width:\"100%\",height:\"100%\",backgroundColor:\"transparent\"}}),error&&/*#__PURE__*/_jsxs(\"div\",{style:{position:\"absolute\",top:0,left:0,right:0,bottom:0,backgroundColor:\"rgba(255, 255, 255, 0.9)\",display:\"flex\",alignItems:\"center\",justifyContent:\"center\",color:\"#FF5588\",fontSize:\"14px\",textAlign:\"center\",padding:\"16px\"},children:[error,/*#__PURE__*/_jsx(\"br\",{}),/*#__PURE__*/_jsx(\"span\",{style:{fontSize:\"12px\",color:\"#666\"},children:\"Check the model URL or try a different file\"})]})]});}addPropertyControls(ModelViewer,{modelSrc:{type:ControlType.String,title:\"Model URL\",defaultValue:\"https://modelviewer.dev/shared-assets/models/Astronaut.glb\",placeholder:\"Enter GLB/GLTF URL...\"},poster:{type:ControlType.ResponsiveImage,title:\"Poster Image\"},backgroundColor:{type:ControlType.Color,title:\"Background\",defaultValue:\"#FFFFFF\"},cameraControls:{type:ControlType.Boolean,title:\"Camera Controls\",defaultValue:true,enabledTitle:\"Enabled\",disabledTitle:\"Disabled\"},autoRotate:{type:ControlType.Boolean,title:\"Auto Rotate\",defaultValue:true,enabledTitle:\"On\",disabledTitle:\"Off\"},environmentImage:{type:ControlType.String,title:\"Environment HDR\",defaultValue:\"https://modelviewer.dev/shared-assets/environments/moon_1k.hdr\",placeholder:\"HDR environment URL...\"},exposure:{type:ControlType.Number,title:\"Exposure\",defaultValue:1,min:0,max:3,step:.1},shadowIntensity:{type:ControlType.Number,title:\"Shadow Intensity\",defaultValue:1,min:0,max:3,step:.1},shadowSoftness:{type:ControlType.Number,title:\"Shadow Softness\",defaultValue:1,min:0,max:2,step:.1},autoPlay:{type:ControlType.Boolean,title:\"Auto Play Animations\",defaultValue:true,enabledTitle:\"On\",disabledTitle:\"Off\"},loading:{type:ControlType.Enum,title:\"Loading\",options:[\"auto\",\"lazy\",\"eager\"],optionTitles:[\"Auto\",\"Lazy\",\"Eager\"],defaultValue:\"auto\"},reveal:{type:ControlType.Enum,title:\"Reveal\",options:[\"auto\",\"interaction\",\"manual\"],optionTitles:[\"Auto\",\"On Interaction\",\"Manual\"],defaultValue:\"auto\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"ModelViewer\",\"slots\":[],\"annotations\":{\"framerIntrinsicWidth\":\"400\",\"framerSupportedLayoutHeight\":\"any-prefer-fixed\",\"framerIntrinsicHeight\":\"400\",\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