{"version":3,"file":"SnazzyGoogleMaps.Bch-R5dH.mjs","names":["useRef"],"sources":["https:/framerusercontent.com/modules/3nV75WnoP6U0WSGZvgZo/n2OHqZ1PNKDPFqlyJQ8V/SnazzyGoogleMaps.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{useEffect,useRef}from\"react\";import{addPropertyControls,ControlType}from\"framer\";/**\n *\n * @framerDisableUnlink\n *\n */export default function SnazzyGoogleMaps({location,apiKey,mapStylesJson,markerUrl,streetViewControl,mapTypeControl,fullscreenControl,zoom,disablePanning}){const mapRef=useRef(null);useEffect(()=>{if(!mapRef.current)return;const loadScript=url=>{const script=document.createElement(\"script\");script.src=url;script.async=true;script.defer=true;document.head.appendChild(script);return new Promise((resolve,reject)=>{script.onload=resolve;script.onerror=reject;});};const initializeMap=()=>{if(!mapRef.current)return;const[lat,lng]=location.split(\",\").map(Number);let mapStyles;try{mapStyles=JSON.parse(mapStylesJson);}catch(e){console.error(\"Invalid JSON for map styles:\",e);mapStyles=[];}const map=new google.maps.Map(mapRef.current,{center:{lat,lng},zoom:zoom,styles:mapStyles,streetViewControl:streetViewControl,mapTypeControl:mapTypeControl,fullscreenControl:fullscreenControl,draggable:!disablePanning});new google.maps.Marker({position:{lat,lng},map:map,icon:markerUrl});};const effectiveApiKey=apiKey||\"\"// Use empty string if API key is not provided\n;loadScript(`https://maps.googleapis.com/maps/api/js?key=${effectiveApiKey}`).then(initializeMap).catch(err=>{console.error(\"Failed to load Google Maps script:\",err);});},[location,mapStylesJson,apiKey,markerUrl,streetViewControl,mapTypeControl,fullscreenControl,zoom,disablePanning]);return /*#__PURE__*/_jsx(\"div\",{ref:mapRef,style:{width:\"100%\",height:\"100%\",zIndex:10,position:\"relative\"}});}SnazzyGoogleMaps.defaultProps={location:\"40.712776,-74.005974\",apiKey:\"\",mapStylesJson:JSON.stringify([{featureType:\"water\",elementType:\"geometry\",stylers:[{color:\"#e9e9e9\"},{lightness:17}]},{featureType:\"landscape\",elementType:\"geometry\",stylers:[{color:\"#f5f5f5\"},{lightness:20}]},{featureType:\"road.highway\",elementType:\"geometry.fill\",stylers:[{color:\"#ffffff\"},{lightness:17}]},{featureType:\"road.highway\",elementType:\"geometry.stroke\",stylers:[{color:\"#ffffff\"},{lightness:29},{weight:.2}]},{featureType:\"road.arterial\",elementType:\"geometry\",stylers:[{color:\"#ffffff\"},{lightness:18}]},{featureType:\"road.local\",elementType:\"geometry\",stylers:[{color:\"#ffffff\"},{lightness:16}]},{featureType:\"poi\",elementType:\"geometry\",stylers:[{color:\"#f5f5f5\"},{lightness:21}]},{featureType:\"poi.park\",elementType:\"geometry\",stylers:[{color:\"#dedede\"},{lightness:21}]},{elementType:\"labels.text.stroke\",stylers:[{visibility:\"on\"},{color:\"#ffffff\"},{lightness:16}]},{elementType:\"labels.text.fill\",stylers:[{saturation:36},{color:\"#333333\"},{lightness:40}]},{elementType:\"labels.icon\",stylers:[{visibility:\"off\"}]},{featureType:\"transit\",elementType:\"geometry\",stylers:[{color:\"#f2f2f2\"},{lightness:19}]},{featureType:\"administrative\",elementType:\"geometry.fill\",stylers:[{color:\"#fefefe\"},{lightness:20}]},{featureType:\"administrative\",elementType:\"geometry.stroke\",stylers:[{color:\"#fefefe\"},{lightness:17},{weight:1.2}]}],null,2),markerUrl:\"\",streetViewControl:true,mapTypeControl:true,fullscreenControl:true,zoom:12,disablePanning:false};addPropertyControls(SnazzyGoogleMaps,{location:{type:ControlType.String,title:\"Location (lat,lng)\",defaultValue:\"40.712776,-74.005974\"},apiKey:{type:ControlType.String,title:\"API Key\",defaultValue:\"\",placeholder:\"Enter your API key...\"},mapStylesJson:{type:ControlType.String,title:\"Map Styles (JSON)\",defaultValue:SnazzyGoogleMaps.defaultProps.mapStylesJson,displayTextArea:true,placeholder:\"Paste your JSON map styles here...\"},markerUrl:{type:ControlType.Image,title:\"Custom Marker\",defaultValue:\"\"},streetViewControl:{type:ControlType.Boolean,title:\"Street View Control\",defaultValue:true,enabledTitle:\"Show\",disabledTitle:\"Hide\"},mapTypeControl:{type:ControlType.Boolean,title:\"Map/Satellite Control\",defaultValue:true,enabledTitle:\"Show\",disabledTitle:\"Hide\"},fullscreenControl:{type:ControlType.Boolean,title:\"Fullscreen Control\",defaultValue:true,enabledTitle:\"Show\",disabledTitle:\"Hide\"},zoom:{type:ControlType.Number,title:\"Zoom Level\",defaultValue:12,min:1,max:20,unit:\"\"},disablePanning:{type:ControlType.Boolean,title:\"Disable Panning\",defaultValue:false,enabledTitle:\"Yes\",disabledTitle:\"No\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"SnazzyGoogleMaps\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerDisableUnlink\":\"*\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./SnazzyGoogleMaps.map"],"mappings":"iLAIG,SAAwB,EAAiB,CAAC,WAAS,SAAO,gBAAc,YAAU,oBAAkB,iBAAe,oBAAkB,OAAK,kBAAgB,CAAC,IAAM,EAAOA,EAAO,KAAK,CACsG,OADrG,MAAc,CAAK,EAAO,UAAgC,GAAK,CAAC,IAAM,EAAO,SAAS,cAAc,SAAS,CAAsF,MAArF,GAAO,IAAI,EAAI,EAAO,MAAM,GAAK,EAAO,MAAM,GAAK,SAAS,KAAK,YAAY,EAAO,CAAQ,IAAI,SAAS,EAAQ,IAAS,CAAC,EAAO,OAAO,EAAQ,EAAO,QAAQ,GAAS,GACnc,+CAD89B,GAAQ,KACr6B,CAAC,SAD4Z,CAAC,GAAG,CAAC,EAAO,QAAQ,OAAO,GAAK,CAAC,EAAI,GAAK,EAAS,MAAM,IAAI,CAAC,IAAI,OAAO,CAAK,EAAU,GAAG,CAAC,EAAU,KAAK,MAAM,EAAc,OAAQ,EAAE,CAAC,QAAQ,MAAM,+BAA+B,EAAE,CAAC,EAAU,EAAE,CAAE,IAAM,EAAI,IAAI,OAAO,KAAK,IAAI,EAAO,QAAQ,C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